NewShipType = StartShipConfig()

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

NewShipType.displayedName = "Dreadnaught"
NewShipType.sobDescription = "Heavy Cruiser"
NewShipType.SquadronSize = 1


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

NewShipType.buildCost = 45000
NewShipType.buildTime = 90
NewShipType.buildPriorityOrder = 6

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

NewShipType.mass = 600
NewShipType.maxhealth = 1564400
NewShipType.regentime = 782.2
NewShipType.minRegenTime = 1
NewShipType.topArmourDamage = 0.75
NewShipType.bottomArmourDamage = 0.9
NewShipType.frontArmourDamage = 0.5
NewShipType.sideArmourDamage = 1.1
NewShipType.rearArmourDamage = 1.2
NewShipType.dustCloudDamageTime = 150
NewShipType.nebulaDamageTime = 75
addShield(NewShipType,"EMP",7500,20)

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

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

--====================================================================================
--PROPULSION
--====================================================================================
NewShipType.thrusterMaxSpeed = 45
NewShipType.mainEngineMaxSpeed = 180
NewShipType.rotationMaxSpeed = 15

NewShipType.thrusterAccelTime = 3
NewShipType.thrusterBrakeTime = 3
NewShipType.mainEngineAccelTime = 10
NewShipType.mainEngineBrakeTime = 10
NewShipType.rotationAccelTime = 6
NewShipType.rotationBrakeTime = 6

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

NewShipType.controllerType = "Ship"

NewShipType.thrusterUsage = 1
NewShipType.accelerationAngle = 60
NewShipType.mirrorAngle = 0
NewShipType.secondaryTurnAngle = 0
NewShipType.maxBankingAmount = 89
NewShipType.descendPitch = 0
NewShipType.goalReachEpsilon = 250
NewShipType.slideMoveRange = 350
NewShipType.relativeMoveFactor = 1

NewShipType.collisionMultiplier = 1

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

NewShipType.militaryUnit = 1
NewShipType.MinimalFamilyToFindPathAround = "Destroyer"
NewShipType.BuildFamily = "Heavy_Frigate_Ben"
NewShipType.AttackFamily = "Heavy_Frigate"
NewShipType.DockFamily = "Frigate"
NewShipType.AvoidanceFamily = "Destroyer"
NewShipType.DisplayFamily = "Frigate"
NewShipType.AutoFormationFamily = "Frigate"
NewShipType.CollisionFamily = "Big"
NewShipType.ArmourFamily = "Hull_Cap_5D"
NewShipType.UnitCapsFamily = "Heavy_Frigate"
NewShipType.unitCapsNumber = 1

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

NewShipType.visualRange = 25000
NewShipType.prmSensorRange = 20000
NewShipType.secSensorRange = 22000
NewShipType.detectionStrength = 1

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

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

--====================================================================================
--UI VISIBILITY
--====================================================================================
NewShipType.TOIcon = "parallelogram"
NewShipType.TOScale = 1
NewShipType.TODistanceFade0 = 9000
NewShipType.TODistanceDisappear0 = 7000
NewShipType.TODistanceFade1 = 12500
NewShipType.TODistanceDisappear1 = 15500
NewShipType.TODistanceFade2 = 12000
NewShipType.TODistanceDisappear2 = 50000
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 = "HardDot"
NewShipType.meshRenderLimit = 22000
NewShipType.dotRenderLimit = 10
NewShipType.visibleInSecondary = 0
NewShipType.goblinsStartFade = 2000
NewShipType.goblinsOff = 2500
NewShipType.upLOD = 2500
NewShipType.upLOD = 5550
NewShipType.downLOD = 2650
NewShipType.downLOD = 5565
NewShipType.minimumZoomFactor = 0.25
NewShipType.selectionLimit = 40000000000000000000000000
NewShipType.preciseSelectionLimit = 20000
NewShipType.preciseATILimit = 0.001
NewShipType.selectionPriority = 100
NewShipType.SMHighlightDistMin = 0
NewShipType.SMHighlightDistMax = 0

--====================================================================================
--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,"HyperSpaceCommand",1,2,200,200,0.5,1)
addAbility(NewShipType,"HyperspaceViaGateCommand",1,3,1,0.3)
AddShipMultiplier(NewShipType,"HyperSpaceAbortDamage","ThisShipOnly","Linear",1,0,0)
addAbility(NewShipType,"CanBeCaptured",609,1)
addAbility(NewShipType,"CanBeRepaired")
addAbility(NewShipType,"RetireAbility",1,1)
addAbility(NewShipType,"MinelayerAbility",1,1)

--====================================================================================
--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.dontDockWithOtherRaceShips = 0
NewShipType.ignoreRaceWhenDocking = 1
addAbility(NewShipType,"CanLaunch")
NewShipType.launchTimeBetweenTwoFormations = 0.25
NewShipType.launchTimeBeforeStart = 0.25
NewShipType.launchNrOfShipsInDockFormation = 1
NewShipType.launchFormation = "n_delta"
addAbility(NewShipType,"ShipHold",1,0,2,"rallypoint","Fighter",25,{
  Fighter = "25",
})
addAbility(NewShipType,"ParadeCommand",1)

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

--====================================================================================
--SUBSYSTEMS
--====================================================================================
LoadModel(NewShipType,1)
--StartShipHardPointConfig(NewShipType,"Shield","Hardpoint_Shield","System","Generic","Damageable","Vgr_Dreadnaught_Shields")
StartShipHardPointConfig(NewShipType,"Sensors 1","Hardpoint_Sensors","System","Sensors","Damageable","Vgr_Module_Sensors_medium")
StartShipHardPointConfig(NewShipType,"Engine","Hardpoint_Engines","System","Generic","Damageable","Vgr_Module_Ion_Engine_medium")
StartShipHardPointConfig(NewShipType,"Engine","Hardpoint_Engines1","System","Generic","Damageable","Vgr_Module_Ion_Engine_medium")
StartShipHardPointConfig(NewShipType,"FireControl1","Hardpoint_Firecontrol","System","Generic","Damageable","Vgr_Module_FireControl_medium")
StartShipHardPointConfig(NewShipType,"Reactor","Hardpoint_Reactor","System","Generic","Damageable","Vgr_Module_Reactor_medium")
StartShipHardPointConfig(NewShipType,"Bridge","Hardpoint_Bridge","System","Generic","Damageable","Vgr_Module_Bridge_medium")
StartShipHardPointConfig(NewShipType,"ECM","Hardpoint_Stealth","System","Generic","Damageable","Vgr_Module_ECM_medium")
StartShipHardPointConfig(NewShipType,"REGEN1","Hardpoint_Regen1","System","Generic","Damageable","Vgr_Module_Regen_medium")
StartShipHardPointConfig(NewShipType,"REGEN2","Hardpoint_Regen2","System","Generic","Damageable","Vgr_Module_Regen_medium")



StartShipWeaponConfig(NewShipType,"TurboLaser_7D_dread","Weapon_L0","")
StartShipWeaponConfig(NewShipType,"TurboLaser_7D_dread","Weapon_L1","")
StartShipWeaponConfig(NewShipType,"TurboLaser_7D_dread","Weapon_L2","")
StartShipWeaponConfig(NewShipType,"TurboLaser_7D_dread","Weapon_L3","")
StartShipWeaponConfig(NewShipType,"TurboLaser_7D_dread","Weapon_L4","")


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

StartShipWeaponConfig(NewShipType,"BSG_RAILLARGE","Weapon_R0","")
StartShipWeaponConfig(NewShipType,"BSG_RAILLARGE","Weapon_R1","")
StartShipWeaponConfig(NewShipType,"BSG_RAILLARGE","Weapon_R2","")
StartShipWeaponConfig(NewShipType,"BSG_RAILLARGE","Weapon_R3","")
StartShipWeaponConfig(NewShipType,"BSG_RAILLARGE","Weapon_R4","")
StartShipWeaponConfig(NewShipType,"BSG_RAILLARGE","Weapon_R5","")
StartShipWeaponConfig(NewShipType,"laser_4d","Weapon_R6","")
StartShipWeaponConfig(NewShipType,"laser_4d","Weapon_R7","")
StartShipWeaponConfig(NewShipType,"laser_4d","Weapon_R8","")
StartShipWeaponConfig(NewShipType,"laser_4d","Weapon_R9","")

StartShipWeaponConfig(NewShipType,"rehash_Flak_Cannon_Large","Weapon_SS0","")
StartShipWeaponConfig(NewShipType,"rehash_Flak_Cannon_Large","Weapon_SS1","")
--====================================================================================
--WEAPONRY
--====================================================================================

--====================================================================================
--DEATH
--====================================================================================
SpawnSalvageOnDeath(NewShipType,"Slv_Chunk_dreadnaught_bow",1,0.75,0,0,0,50,0,0,0,1,0,0,0,1,0,0,0,1)
SpawnSalvageOnDeath(NewShipType,"Slv_Chunk_dreadnaught_stern",1,0.75,0,0,0,50,0,0,0,1,0,0,0,1,0,0,0,1)
NewShipType.battleScarMaxTriBase = 1000
NewShipType.battleScarMaxTriInc = 2000
NewShipType.sobDieTime = 11.5
NewShipType.sobSpecialDieTime = 1.9
NewShipType.specialDeathSpeed = 0
NewShipType.chanceOfSpecialDeath = 0.5
NewShipType.deadSobFadeTime = 0
SpawnSalvageOnDeath(NewShipType,"Slv_Chunk_Lrg03",2,0.75,0,0,0,50,0,0,0,200,0,0,0,50,0,0,0,50)

--====================================================================================
--ENGINES AND SOUND
--====================================================================================

setEngineBurn(NewShipType,10,0.5,1,300,0,0.7,0.15,380)
setEngineGlow(NewShipType,20,1,1,25000,25000,50,4,{
  0.9,
  0.6,
  0.6,
  0.3,
})
loadShipPatchList(NewShipType,"data:sound/sfx/ship/Hiigaran/Carrier/",0,"Engines/HDestroyerEng","",1,"Ambience/HBattleCrusierAmb")

--====================================================================================
--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 = 216
NewShipType.neutralValue = 0
NewShipType.antiFighterValue = 10
NewShipType.antiCorvetteValue = 392
NewShipType.antiFrigateValue = 196
NewShipType.totalValue = 814