NewShipType = StartShipConfig()

--====================================================================================
--NAMING AND DESCRIPTION
--====================================================================================

NewShipType.displayedName = "TIE Bomber"
NewShipType.sobDescription = "Bomber"
NewShipType.SquadronSize = 6

--====================================================================================
--COST
--====================================================================================

NewShipType.buildCost = 500
NewShipType.buildTime = 25
NewShipType.buildPriorityOrder = 4

--====================================================================================
--HEALTH
--====================================================================================

NewShipType.mass = 7.8
NewShipType.maxhealth = 39
NewShipType.regentime = 0
NewShipType.minRegenTime = 0

NewShipType.sideArmourDamage = 1
NewShipType.rearArmourDamage = 1
NewShipType.topArmourDamage = 1
NewShipType.bottomArmourDamage = 1
NewShipType.frontArmourDamage = 1

NewShipType.dustCloudDamageTime = 10
NewShipType.nebulaDamageTime = 5
addShield(NewShipType,"EMP",40,20)

--====================================================================================
--FORMATION
--====================================================================================

NewShipType.passiveFormation = "Broad"
NewShipType.defensiveFormation = "2_story_delta"
NewShipType.aggressiveFormation = "hexagon"
NewShipType.formationSpacing = 45

--====================================================================================
--PROPULSION
--====================================================================================
NewShipType.thrusterMaxSpeed = 100
NewShipType.mainEngineMaxSpeed = 400
NewShipType.rotationMaxSpeed = 120

NewShipType.thrusterAccelTime = 0.35
NewShipType.thrusterBrakeTime = 0.35
NewShipType.mainEngineAccelTime = 1
NewShipType.mainEngineBrakeTime = 1
NewShipType.rotationAccelTime = 0.25
NewShipType.rotationBrakeTime = 0.25

--====================================================================================
--MOVEMENT
--====================================================================================

NewShipType.controllerType = "Ship"

NewShipType.thrusterUsage = 0.25
NewShipType.accelerationAngle = 170
NewShipType.mirrorAngle = 30
NewShipType.secondaryTurnAngle = 90
NewShipType.maxBankingAmount = 89
NewShipType.descendPitch = 0
NewShipType.goalReachEpsilon = 5
NewShipType.slideMoveRange = 100
NewShipType.relativeMoveFactor = .1

NewShipType.collisionMultiplier = 35

--NewShipType.mirrorAboveManeuver = "ImmelMann_speedy,OneEightyDegRightTurn,OneEightyDegLeftTurn,ImmelMann_speedy,ImmelMann_speedy,ImmelMann_speedy"
--NewShipType.mirrorBelowManeuver = "Split_S_speedy,OneEightyDegRightTurn,OneEightyDegLeftTurn,Split_S_speedy,Split_S_speedy,Split_S_speedy"
--NewShipType.specialTurnLeftManeuver = "NinetyDegLeftTurn,None,None"
--NewShipType.specialTurnRightManeuver = "NinetyDegRightTurn,None,None"
--NewShipType.testManeuver1 = "RollCW"
--NewShipType.testManeuver2 = "RollCCW"
--NewShipType.testManeuver3 = "Loop"

--====================================================================================
--CLASSIFICATION
--====================================================================================

NewShipType.militaryUnit = 1
NewShipType.MinimalFamilyToFindPathAround = "Corvette"
NewShipType.BuildFamily = "FighterD_Vgr"
NewShipType.AttackFamily = "Bomber"
NewShipType.DockFamily = "Fighter"
NewShipType.AvoidanceFamily = "Fighter"
NewShipType.DisplayFamily = "Fighter"
NewShipType.AutoFormationFamily = "Fighter"
NewShipType.CollisionFamily = "Small"
NewShipType.ArmourFamily = "Hull_SF_4D"
NewShipType.UnitCapsFamily = "DFighter"
NewShipType.unitCapsNumber = 1

--====================================================================================
--SENSORS
--====================================================================================

NewShipType.visualRange = 7000
NewShipType.prmSensorRange = 10000
NewShipType.secSensorRange = 12000
NewShipType.detectionStrength = 1

--====================================================================================
--COMBAT
--====================================================================================

NewShipType.useEngagementRanges = 1
NewShipType.retaliationRange = 15000
NewShipType.retaliationDistanceFromGoal = 3000
addAbility(NewShipType,"CanAttack",1,2,0,1,1,0.9,"SubSystem,Emplacement,Frigate,bomber,Fighter","Flyby_Interceptor_vs_CapShip",{
  Fighter = "Dogfight",
},{
  Bomber = "Dogfight",
},{
  Corvette = "Dogfight",
},{
  Destroyer = "Flyby_Interceptor_vs_Mothership",
},{
  Cruiser = "Flyby_Interceptor_vs_Mothership",
},{
  SuperCapital = "Flyby_Bomber_vs_Mothership",
})
addAbility(NewShipType,"GuardCommand",1,15000,3000)

--====================================================================================
--UI VISIBILITY
--====================================================================================

NewShipType.TOIcon = "Triangle"
NewShipType.TOScale = 1
NewShipType.TODistanceFade0 = 3000
NewShipType.TODistanceDisappear0 = 500
NewShipType.TODistanceFade1 = 2500
NewShipType.TODistanceDisappear1 = 10000
NewShipType.TODistanceFade2 = 9500
NewShipType.TODistanceDisappear2 = 55000
NewShipType.TOGroupScale = 1
NewShipType.TOGroupMergeSize = 0
NewShipType.mouseOverMinFadeSize = 0.045
NewShipType.mouseOverMaxFadeSize = 0.1
NewShipType.healthBarStyle = 0

--====================================================================================
--VISIBILITY
--====================================================================================

NewShipType.nlips = 0.0005
NewShipType.nlipsRange = 400
NewShipType.nlipsFar = 0.00085
NewShipType.nlipsFarRange = 2000
NewShipType.SMRepresentation = "HardDot"
NewShipType.meshRenderLimit = 4000
NewShipType.dotRenderLimit = 10
NewShipType.visibleInSecondary = 0
NewShipType.minLOD = 0.25
NewShipType.goblinsStartFade = 40
NewShipType.goblinsOff = 50
NewShipType.upLOD = 150
NewShipType.upLOD = 250
NewShipType.downLOD = 165
NewShipType.downLOD = 265
NewShipType.minimumZoomFactor = 0.25
NewShipType.selectionLimit = 40000000000000000000000000
NewShipType.preciseATILimit = 5
NewShipType.preciseSelectionLimit = 35
NewShipType.selectionPriority = 75

--====================================================================================
--ABILITIES
--====================================================================================

addAbility(NewShipType,"MoveCommand",1,0)
AddShipMultiplier(NewShipType, "MaxShield", "ThisShipOnly", "Linear", 3, 0, 0)
AddShipMultiplier(NewShipType, "HealthRegenerationRate", "ThisShipOnly", "Linear", 2, 0, 0)
AddShipMultiplier(NewShipType, "Speed", "ThisShipOnly", "Linear", 1, .9, 0)
AddShipMultiplier(NewShipType, "WeaponAccuracy", "ThisShipOnly", "Linear", 1, .75, 0)
AddShipMultiplier(NewShipType, "WeaponDamage", "ThisShipOnly", "Linear", 1, .75, 0)
AddShipMultiplier(NewShipType, "PrimarySensorsRange", "ThisShipOnly", "Linear", 1, .75, 0)
addAbility(NewShipType,"WaypointMove")
addAbility(NewShipType,"RetireAbility",1,1)
addAbility(NewShipType,"MinelayerAbility",1,1)
addAbility(NewShipType,"HyperspaceViaGateCommand",1,3,1,0.3)
AddShipMultiplier(NewShipType,"HyperSpaceAbortDamage","ThisShipOnly","Linear",0,0,0)

--====================================================================================
--DOCKING
--====================================================================================

addAbility(NewShipType,"CanDock",1,1)
NewShipType.dockTimeBetweenTwoFormations = 0.25
NewShipType.dockTimeBeforeStart = 0.25
NewShipType.dockNrOfShipsInDockFormation = 1
NewShipType.dockFormation = "dockline"
NewShipType.queueFormation = "n_delta"
NewShipType.ignoreRaceWhenDocking = 1
addAbility(NewShipType,"CanLaunch")
NewShipType.launchTimeBetweenTwoFormations = 0.25
NewShipType.launchTimeBeforeStart = 0.25
NewShipType.launchNrOfShipsInDockFormation = 1
NewShipType.launchFormation = "n_delta"
addAbility(NewShipType,"ParadeCommand",1)

--====================================================================================
--CONSTRUCTION
--====================================================================================

--====================================================================================
--SUBSYSTEMS
--====================================================================================
LoadSharedModel(NewShipType,"Vgr_Tie_Bomber")


--====================================================================================
--WEAPONRY
--====================================================================================

StartShipWeaponConfig(NewShipType,"Blaster_AS","Weapon_L0","")
StartShipWeaponConfig(NewShipType,"Blaster_AS","Weapon_R0","")
StartShipWeaponConfig(NewShipType,"Blaster_3D","Weapon_L0","")
StartShipWeaponConfig(NewShipType,"Blaster_3D","Weapon_R0","")
StartShipWeaponConfig(NewShipType,"Proton_Torpedo_Launcher","Weapon_F0","")
StartShipWeaponConfig(NewShipType,"Proton_Torpedo_Launcher_S","Weapon_F0","")
StartShipWeaponConfig(NewShipType,"Proton_Torpedo_Launcher_S","Weapon_F0","")
StartShipWeaponConfig(NewShipType,"Proton_Torpedo_Launcher_S","Weapon_F0","")
StartShipWeaponConfig(NewShipType,"Proton_Torpedo_Launcher_S","Weapon_F0","")
StartShipWeaponConfig(NewShipType,"Proton_Torpedo_Launcher_S","Weapon_F0","")
StartShipWeaponConfig(NewShipType,"Proton_Torpedo_Launcher_S","Weapon_F0","")
StartShipWeaponConfig(NewShipType,"Proton_Torpedo_Launcher_S","Weapon_F0","")
StartShipWeaponConfig(NewShipType,"Proton_Torpedo_Launcher_S","Weapon_F0","")
StartShipWeaponConfig(NewShipType,"Concussion_Missile_Launcher","Weapon_F0","")

--====================================================================================
--DEATH
--====================================================================================

NewShipType.sobDieTime = 0.1
NewShipType.sobSpecialDieTime = 1.9
NewShipType.specialDeathSpeed = 50
NewShipType.chanceOfSpecialDeath = 0.5
NewShipType.deadSobFadeTime = 0

--====================================================================================
--ENGINES AND SOUND
--====================================================================================
--setEngineBurn(NewShipType,10,0.5,1,15,0,0.7,0.15,30)
setEngineGlow(NewShipType,.5,0.95,0.95,5,25,4,0.1,{
  0.69,
  0.2,
  0.2,
  0.3,
})
loadShipPatchList(NewShipType,"data:sound/sfx/ship/imperial/tie/",0,"Engines/tieeng","",1,"ambience/tieamb")

--====================================================================================
--MISC
--====================================================================================

NewShipType.tumbleStaticX = 1
NewShipType.tumbleStaticY = 1
NewShipType.tumbleStaticZ = 1
NewShipType.tumbleDynamicX = 1
NewShipType.tumbleDynamicY = 1
NewShipType.tumbleDynamicZ = 1
NewShipType.tumbleSpecialDynamicX = 1
NewShipType.tumbleSpecialDynamicY = 1
NewShipType.tumbleSpecialDynamicZ = 1
NewShipType.swayUpdateTime = 50
NewShipType.swayOffsetRandomX = 1
NewShipType.swayOffsetRandomY = 1
NewShipType.swayOffsetRandomZ = 1
NewShipType.swayBobbingFactor = 0.15
NewShipType.swayRotateFactor = 0

--====================================================================================
--AI WEIGHTING
--====================================================================================

NewShipType.fighterValue = 1
NewShipType.corvetteValue = 0
NewShipType.frigateValue = 0
NewShipType.neutralValue = 0
NewShipType.antiFighterValue = 1
NewShipType.antiCorvetteValue = 2
NewShipType.antiFrigateValue = 1
NewShipType.totalValue = 5