NewShipType = StartShipConfig()

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

NewShipType.displayedName = "Invincible Dreadnought"
NewShipType.sobDescription = "Heavy Cruiser"
NewShipType.SquadronSize = 1


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

NewShipType.buildCost = 250000
NewShipType.buildTime = 333
NewShipType.buildPriorityOrder = 5

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

NewShipType.mass = 2400
NewShipType.maxhealth = 5294400
NewShipType.regentime = 1500
NewShipType.minRegenTime = 1
NewShipType.topArmourDamage = 0.75
NewShipType.bottomArmourDamage = 0.75
NewShipType.frontArmourDamage = 0.75
NewShipType.sideArmourDamage = 0.75
NewShipType.rearArmourDamage = 2
NewShipType.dustCloudDamageTime = 200
NewShipType.nebulaDamageTime = 100
addShield(NewShipType,"EMP",10000,20)

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

NewShipType.paradeData = "hgn_carrier_parade"
NewShipType.passiveFormation = "Broad"
NewShipType.defensiveFormation = "Delta"
NewShipType.aggressiveFormation = "Claw"
NewShipType.formationSpacing = 1500

--====================================================================================
--PROPULSION
--====================================================================================
NewShipType.thrusterMaxSpeed = 25
NewShipType.mainEngineMaxSpeed = 150
NewShipType.rotationMaxSpeed = 2

NewShipType.thrusterAccelTime = 12
NewShipType.thrusterBrakeTime = 12
NewShipType.mainEngineAccelTime = 15 
NewShipType.mainEngineBrakeTime = 15
NewShipType.rotationAccelTime = 10
NewShipType.rotationBrakeTime = 10

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

NewShipType.controllerType = "Ship"

NewShipType.thrusterUsage = 0.9
NewShipType.accelerationAngle = 60
NewShipType.mirrorAngle = 0
NewShipType.secondaryTurnAngle = 0
NewShipType.maxBankingAmount = 30
NewShipType.descendPitch = 0
NewShipType.goalReachEpsilon = 100
NewShipType.slideMoveRange = 350
NewShipType.relativeMoveFactor = 1

NewShipType.collisionMultiplier = 1

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

NewShipType.militaryUnit = 1
NewShipType.MinimalFamilyToFindPathAround = "Cruiser"
NewShipType.BuildFamily = "Destroyer_Ben"
NewShipType.AttackFamily = "Destroyer"
NewShipType.DockFamily = "BattleCruiser"
NewShipType.AvoidanceFamily = "Destroyer"
NewShipType.DisplayFamily = "Capital"
NewShipType.AutoFormationFamily = "Capship"
NewShipType.CollisionFamily = "Big"
NewShipType.ArmourFamily = "Hull_Cap_10D"
NewShipType.UnitCapsFamily = "Destroyer"
NewShipType.unitCapsNumber = 1

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

NewShipType.visualRange = 25000
NewShipType.prmSensorRange = 22000
NewShipType.secSensorRange = 25000
NewShipType.detectionStrength = 2

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

NewShipType.useEngagementRanges = 1
NewShipType.retaliationRange = 25000
NewShipType.retaliationDistanceFromGoal = 15000
--fourth value 0 
addAbility(NewShipType, "CanAttack", 1, 1, 0, 1, 1, 1.2, "large_missile,small_missile,munition,SuperCapital,Cruiser,Destroyer,BigCapitalShip,Heavy_Frigate,Frigate,SmallCapitalShip,Heavy_Corvette,Capturer,Corvette,bomber,SubSystem,Emplacement,Fighter,MotherShip,Heavy_Utility,Utility","FrontalAssault2",
{
  large_missile = "JustShoot",
},{
  small_missile = "JustShoot",
},{
  munition = "JustShoot",
},{
  SuperCapital = "FrontalAssault2",
},{
  Cruiser = "FrontalAssault2",
},{
  Destroyer = "FrontalAssault2",
},{
  Heavy_Frigate = "FrontalAssault2",
},{
  Frigate = "MoveToTargetAndShoot",
},{
  Heavy_Corvette = "MoveToTargetAndShoot",
},{
  Bomber = "MoveToTargetAndShoot",
},{
  Fighter = "MoveToTargetAndShoot",
},{
  Corvette = "MoveToTargetAndShoot",
},{
  Emplacement = "MoveToTargetAndShoot",
},{
  SubSystem = "MoveToTargetAndShoot",
},{
  Capturer = "MoveToTargetAndShoot",
})
addAbility(NewShipType, "GuardCommand", 1, 10000, 6000)

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

NewShipType.mouseOverMinFadeSize = 0.045
NewShipType.mouseOverMaxFadeSize = 0.1
NewShipType.healthBarStyle = 1

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

NewShipType.nlips = 0
NewShipType.nlipsRange = 75000
NewShipType.nlipsFar = 0
NewShipType.nlipsFarRange = 0
NewShipType.SMRepresentation = "Mesh"
NewShipType.meshRenderLimit = 50000
NewShipType.dotRenderLimit = 10
NewShipType.visibleInSecondary = 1
NewShipType.goblinsStartFade = 3000
NewShipType.goblinsOff = 3500
NewShipType.upLOD = 5000
NewShipType.upLOD = 15000
NewShipType.downLOD = 5015
NewShipType.downLOD = 15015
NewShipType.minimumZoomFactor = 0.25
NewShipType.selectionLimit = 40000000000000000000000000
NewShipType.preciseSelectionLimit = 50000
NewShipType.preciseATILimit = 0.001
NewShipType.selectionPriority = 100
NewShipType.SMHighlightDistMin = 0
NewShipType.SMHighlightDistMax = 0

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

addAbility(NewShipType,"MoveCommand",1,0)
AddShipMultiplier(NewShipType, "MaxShield", "ThisShipOnly", "Linear", 1, 0, 1)
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, "HyperSpaceCommand", 1, 2, 600, 1200, 0, 3)
--addAbility(NewShipType,"CanBeCaptured",463,10)
addAbility(NewShipType,"CanBeRepaired")
addAbility(NewShipType,"RetireAbility",1,1)
addAbility(NewShipType,"MinelayerAbility",1,1)
addAbility(NewShipType,"HyperspaceViaGateCommand",1,3,1,0.3)
AddShipMultiplier(NewShipType,"HyperSpaceAbortDamage","ThisShipOnly","Linear",0.00001,0.00001,0)

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

addAbility(NewShipType, "CanDock", 1, 1)
NewShipType.dockTimeBetweenTwoFormations = 0
NewShipType.dockTimeBeforeStart = 0
NewShipType.dockNrOfShipsInDockFormation = 1
NewShipType.dockFormation = "dockline"
NewShipType.queueFormation = "n_delta"
NewShipType.dontDockWithOtherRaceShips = 0
NewShipType.ignoreRaceWhenDocking = 1
addAbility(NewShipType, "CanLaunch")
NewShipType.launchTimeBetweenTwoFormations = 0
NewShipType.launchTimeBeforeStart = 0
NewShipType.launchNrOfShipsInDockFormation = 1
NewShipType.launchFormation = "n_delta"
addAbility(NewShipType, "ShipHold", 1, 0, 6, "rallypoint", "Fighter, Corvette,Utility", 25, 
{ 
    Fighter = "12", 
}, 
{ 
    Corvette = "75", })
addAbility(NewShipType, "ParadeCommand", 1)

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

--====================================================================================
--SUBSYSTEMS
--====================================================================================
LoadModel(NewShipType,1)
--StartShipHardPointConfig(NewShipType,"Shield","Hardpoint_Shield","System","Generic","Damageable","Ben_Invincible_Dreadnought_Shields")

StartShipHardPointConfig(NewShipType,"Sensors 1","Hardpoint_Sensors","System","Sensors","Damageable","Vgr_Module_Sensors_Large")
StartShipHardPointConfig(NewShipType,"Engine","Hardpoint_Engines","System","Generic","Damageable","Vgr_Module_Ion_Engine_Large")
StartShipHardPointConfig(NewShipType,"Engine","Hardpoint_Engines1","System","Generic","Damageable","Vgr_Module_Ion_Engine_Large")
StartShipHardPointConfig(NewShipType,"Engine","Hardpoint_Engines2","System","Generic","Damageable","Vgr_Module_Ion_Engine_Large")
StartShipHardPointConfig(NewShipType,"FireControl","Hardpoint_Accuracy","System","Generic","Damageable","Vgr_Module_FireControl_Large")
StartShipHardPointConfig(NewShipType,"FireControl1","Hardpoint_Firecontrol","System","Generic","Damageable","Vgr_Module_FireControl_Large")
StartShipHardPointConfig(NewShipType,"Reactor","Hardpoint_Reactor","System","Generic","Damageable","Vgr_Module_Reactor_Large")
StartShipHardPointConfig(NewShipType,"Bridge","Hardpoint_Bridge","System","Generic","Damageable","Vgr_Module_Bridge_Large")
StartShipHardPointConfig(NewShipType,"ECM","Hardpoint_Stealth","System","Generic","Damageable","Vgr_Module_ECM_Large")
StartShipHardPointConfig(NewShipType,"REGEN","Hardpoint_Regen","System","Generic","Damageable","Vgr_Module_Regen_large")
StartShipHardPointConfig(NewShipType,"REGEN1","Hardpoint_Regen1","System","Generic","Damageable","Vgr_Module_Regen_large")
StartShipHardPointConfig(NewShipType,"REGEN2","Hardpoint_Regen2","System","Generic","Damageable","Vgr_Module_Regen_large")
StartShipHardPointConfig(NewShipType,"REGEN3","Hardpoint_Regen3","System","Generic","Damageable","Vgr_Module_Regen_large")
StartShipHardPointConfig(NewShipType,"REGEN4","Hardpoint_Regen4","System","Generic","Damageable","Vgr_Module_Regen_large")
StartShipHardPointConfig(NewShipType,"REGEN5","Hardpoint_Regen5","System","Generic","Damageable","Vgr_Module_Regen_large")
StartShipHardPointConfig(NewShipType,"REGEN6","Hardpoint_Regen6","System","Generic","Damageable","Vgr_Module_Regen_large")


StartShipWeaponConfig(NewShipType,"BTurboLaser_8D","Weapon_L0","")
StartShipWeaponConfig(NewShipType,"BTurboLaser_8D","Weapon_L1","")
StartShipWeaponConfig(NewShipType,"BTurboLaser_8D","Weapon_L2","")
StartShipWeaponConfig(NewShipType,"BTurboLaser_8D","Weapon_L3","")
StartShipWeaponConfig(NewShipType,"BTurboLaser_8D","Weapon_L4","")
StartShipWeaponConfig(NewShipType,"BTurboLaser_8D","Weapon_L5","")
StartShipWeaponConfig(NewShipType,"BTurboLaser_8D","Weapon_L6","")
StartShipWeaponConfig(NewShipType,"BTurboLaser_8D","Weapon_L7","")
StartShipWeaponConfig(NewShipType,"BTurboLaser_8D","Weapon_L8","")
StartShipWeaponConfig(NewShipType,"BTurboLaser_8D","Weapon_L9","")

StartShipWeaponConfig(NewShipType,"BLaser_5D","Weapon_T0","")
StartShipWeaponConfig(NewShipType,"BLaser_5D","Weapon_T1","")
StartShipWeaponConfig(NewShipType,"BLaser_5D","Weapon_T2","")
StartShipWeaponConfig(NewShipType,"BLaser_5D","Weapon_T3","")
StartShipWeaponConfig(NewShipType,"BLaser_5D","Weapon_T4","")
StartShipWeaponConfig(NewShipType,"BLaser_5D","Weapon_T5","")
StartShipWeaponConfig(NewShipType,"BLaser_5D","Weapon_T6","")
StartShipWeaponConfig(NewShipType,"BLaser_5D","Weapon_T7","")
StartShipWeaponConfig(NewShipType,"BLaser_5D","Weapon_T8","")
StartShipWeaponConfig(NewShipType,"BLaser_5D","Weapon_T9","")

StartShipWeaponConfig(NewShipType,"heavy_rocket_launcher_tyrant","Weapon_R0","Large_Missile1")
StartShipWeaponConfig(NewShipType,"heavy_rocket_launcher_tyrant","Weapon_R1","Large_Missile2")
StartShipWeaponConfig(NewShipType,"heavy_rocket_launcher_tyrant","Weapon_R2","Large_Missile3")
StartShipWeaponConfig(NewShipType,"heavy_rocket_launcher_tyrant","Weapon_R3","Large_Missile4")
StartShipWeaponConfig(NewShipType,"heavy_rocket_launcher_tyrant","Weapon_R4","Large_Missile5")
StartShipWeaponConfig(NewShipType,"heavy_rocket_launcher_tyrant","Weapon_R5","Large_Missile6")
StartShipWeaponConfig(NewShipType,"heavy_rocket_launcher_tyrant","Weapon_R6","Large_Missile7")
StartShipWeaponConfig(NewShipType,"heavy_rocket_launcher_tyrant","Weapon_R7","Large_Missile8")
StartShipWeaponConfig(NewShipType,"heavy_rocket_launcher_tyrant","Weapon_R8","Large_Missile9")
StartShipWeaponConfig(NewShipType,"heavy_rocket_launcher_tyrant","Weapon_R9","Large_Missile10")
--====================================================================================
--WEAPONRY
--====================================================================================
StartShipWeaponConfig(NewShipType,"BLaser_5D_PDS_Lateral","Weapon_SS0","")
StartShipWeaponConfig(NewShipType,"BLaser_5D_PDS_Lateral","Weapon_SS1","")
StartShipWeaponConfig(NewShipType,"BLaser_5D_PDS_Lateral","Weapon_SS2","")
StartShipWeaponConfig(NewShipType,"BLaser_5D_PDS_Lateral","Weapon_SS3","")
StartShipWeaponConfig(NewShipType,"BLaser_5D_PDS_Lateral","Weapon_SS4","")
StartShipWeaponConfig(NewShipType,"BLaser_5D_PDS_Lateral","Weapon_SS5","")
StartShipWeaponConfig(NewShipType,"BLaser_5D_PDS_Lateral","Weapon_SS6","")
StartShipWeaponConfig(NewShipType,"BLaser_5D_PDS_Lateral","Weapon_SS7","")
StartShipWeaponConfig(NewShipType,"BLaser_5D_PDS_Lateral","Weapon_SS8","")
StartShipWeaponConfig(NewShipType,"BLaser_5D_PDS_Lateral","Weapon_SS9","")
StartShipWeaponConfig(NewShipType,"BLaser_5D_AF_Lateral","Weapon_SS0","")
StartShipWeaponConfig(NewShipType,"BLaser_5D_AF_Lateral","Weapon_SS1","")
StartShipWeaponConfig(NewShipType,"BLaser_5D_AF_Lateral","Weapon_SS2","")
StartShipWeaponConfig(NewShipType,"BLaser_5D_AF_Lateral","Weapon_SS3","")
StartShipWeaponConfig(NewShipType,"BLaser_5D_AF_Lateral","Weapon_SS4","")
StartShipWeaponConfig(NewShipType,"BLaser_5D_AF_Lateral","Weapon_SS5","")
StartShipWeaponConfig(NewShipType,"BLaser_5D_AF_Lateral","Weapon_SS6","")
StartShipWeaponConfig(NewShipType,"BLaser_5D_AF_Lateral","Weapon_SS7","")
StartShipWeaponConfig(NewShipType,"BLaser_5D_AF_Lateral","Weapon_SS8","")
StartShipWeaponConfig(NewShipType,"BLaser_5D_AF_Lateral","Weapon_SS9","")

StartShipWeaponConfig(NewShipType,"rehash_Flak_Cannon_Large","Weapon_B0","")
StartShipWeaponConfig(NewShipType,"rehash_Flak_Cannon_Large","Weapon_B1","")
StartShipWeaponConfig(NewShipType,"rehash_Flak_Cannon_Large","Weapon_B2","")
StartShipWeaponConfig(NewShipType,"rehash_Flak_Cannon_Large","Weapon_B3","")
StartShipWeaponConfig(NewShipType,"rehash_Flak_Cannon_Large","Weapon_B4","")
StartShipWeaponConfig(NewShipType,"rehash_Flak_Cannon_Large","Weapon_B5","")
--====================================================================================
--DEATH
--====================================================================================

NewShipType.battleScarMaxTriBase = 2000
NewShipType.battleScarMaxTriInc = 4000
NewShipType.sobDieTime = 11.5
NewShipType.sobSpecialDieTime = 1.9
NewShipType.specialDeathSpeed = 0
NewShipType.chanceOfSpecialDeath = 0.5
NewShipType.deadSobFadeTime = 0
NewShipType.chanceOfSpecialDeath = 0.5
NewShipType.deadSobFadeTime = 0
--====================================================================================
--ENGINES AND SOUND
--====================================================================================

setEngineBurn(NewShipType,10,0.5,1,300,0,0.7,0.15,380)
setEngineGlow(NewShipType,20,0.95,0.95,20,25000,25000,5,{
  0.27,
  0.47,
  0.69,
  0.3,
})
loadShipPatchList(NewShipType,"data:sound/sfx/ship/imperial/destroyer/",0,"Engines/destroyer","",1,"Ambience/destroyer")

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

NewShipType.isTransferable = 1
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
NewShipType.useTargetRandom = 1
NewShipType.targetRandomPointXMin = -0.2
NewShipType.targetRandomPointXMax = 0.2
NewShipType.targetRandomPointYMin = -0.1
NewShipType.targetRandomPointYMax = 0.1
NewShipType.targetRandomPointZMin = -0.4
NewShipType.targetRandomPointZMax = 0.4

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

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