NewShipType = StartShipConfig()

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

NewShipType.displayedName = "Lancer Frigate"
NewShipType.sobDescription = "Anti-Star FIghter Frigate"
NewShipType.SquadronSize = 1


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

NewShipType.buildCost = 25000
NewShipType.buildTime = 100
NewShipType.buildPriorityOrder = 5

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

NewShipType.mass = 250
NewShipType.maxhealth = 814250
NewShipType.regentime = 1628.5
NewShipType.minRegenTime = 814
NewShipType.sideArmourDamage = 1
NewShipType.rearArmourDamage = 1
NewShipType.topArmourDamage = 1
NewShipType.bottomArmourDamage = 1
NewShipType.frontArmourDamage = 1
NewShipType.dustCloudDamageTime = 100
NewShipType.nebulaDamageTime = 50
addShield(NewShipType,"EMP",5000,20)

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

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

--====================================================================================
--PROPULSION
--====================================================================================
NewShipType.thrusterMaxSpeed = 50
NewShipType.mainEngineMaxSpeed = 200
NewShipType.rotationMaxSpeed = 18

NewShipType.thrusterAccelTime = 2
NewShipType.thrusterBrakeTime = 2
NewShipType.mainEngineAccelTime = 7
NewShipType.mainEngineBrakeTime = 7
NewShipType.rotationAccelTime = 3
NewShipType.rotationBrakeTime = 3

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

NewShipType.controllerType = "Ship"

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

NewShipType.collisionMultiplier = 1

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

NewShipType.militaryUnit = 1
NewShipType.MinimalFamilyToFindPathAround = "Frigate"
NewShipType.BuildFamily = "Frigate_Vgr"
NewShipType.AttackFamily = "Frigate"
NewShipType.DockFamily = "Frigate"
NewShipType.AvoidanceFamily = "Frigate"
NewShipType.DisplayFamily = "Frigate"
NewShipType.AutoFormationFamily = "Frigate"
NewShipType.CollisionFamily = "Big"
NewShipType.ArmourFamily = "Hull_Cap_4D"
NewShipType.UnitCapsFamily = "Frigate"
NewShipType.unitCapsNumber = 1

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

NewShipType.visualRange = 20000
NewShipType.prmSensorRange = 17000
NewShipType.secSensorRange = 19000
NewShipType.detectionStrength = 1

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

NewShipType.useEngagementRanges = 1 
NewShipType.retaliationRange = 22000
NewShipType.retaliationDistanceFromGoal = 5000

addAbility(NewShipType,"CanAttack",1,1,0,1,0.35,0.9,"Capturer,Bomber,large_missile,small_missile,Fighter,Corvette,SubSystem,Emplacement,Heavy_Corvette,Utility,SmallCapitalShip,Frigate,Heavy_Frigate,Destroyer,BigCapitalShip,Cruiser,SuperCapital,MotherShip","FlyRound_Corvette_vs_Frigate",{
  Fighter = "MoveToTargetAndShoot",
},{
  Corvette = "MoveToTargetAndShoot",
},{
  Heavy_Corvette = "flyround_corvette_vs_frigate",
},{
  Frigate = "FlyRound_Corvette_vs_CapShip",
},{
  Heavy_Frigate = "FlyRound_Corvette_vs_CapShip",
},{
  Destroyer = "FlyRound_Corvette_vs_CapShip",
},{
  Cruiser = "flyround_Corvette_vs_Mothership",
},{
  SuperCapital = "flyround_Corvette_vs_Mothership",
},{
  SubSystem = "MoveToTargetAndShoot",
},{
  Capturer = "MoveToTargetAndShoot",
})
addAbility(NewShipType,"GuardCommand",1,8000,2000)

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

NewShipType.TOIcon = "Diamond"
NewShipType.TOScale = 1
NewShipType.TODistanceFade0 = 9000
NewShipType.TODistanceDisappear0 = 7000
NewShipType.TODistanceFade1 = 4500
NewShipType.TODistanceDisappear1 = 3500
NewShipType.TODistanceFade2 = 12000
NewShipType.TODistanceDisappear2 = 50000
NewShipType.TOGroupScale = 1
NewShipType.TOGroupMergeSize = 0
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 = 17000
NewShipType.dotRenderLimit = 10
NewShipType.visibleInSecondary = 0
NewShipType.goblinsStartFade = 1500
NewShipType.goblinsOff = 1510
NewShipType.upLOD = 3000
NewShipType.downLOD = 3015
NewShipType.minimumZoomFactor = 0.25
NewShipType.selectionLimit = 40000000000000000000000000
NewShipType.preciseATILimit = 0.001
NewShipType.selectionPriority = 100

--====================================================================================
--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,1,150,150,0.5,1)
addAbility(NewShipType,"CanBeCaptured",260,1)
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",1,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.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,"ParadeCommand",1)

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

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


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

StartShipWeaponConfig(NewShipType,"Laser_4D_PDS","Weapon_L0","")
StartShipWeaponConfig(NewShipType,"Laser_4D_PDS","Weapon_L1","")
StartShipWeaponConfig(NewShipType,"Laser_4D_PDS","Weapon_L2","")
StartShipWeaponConfig(NewShipType,"Laser_4D_PDS","Weapon_L3","")
StartShipWeaponConfig(NewShipType,"Laser_4D_PDS","Weapon_L4","")
StartShipWeaponConfig(NewShipType,"Laser_4D_PDS","Weapon_L5","")
StartShipWeaponConfig(NewShipType,"Laser_4D_PDS","Weapon_L6","")
StartShipWeaponConfig(NewShipType,"Laser_4D_PDS","Weapon_L7","")

StartShipWeaponConfig(NewShipType,"Laser_4D_PDS","Weapon_R0","")
StartShipWeaponConfig(NewShipType,"Laser_4D_PDS","Weapon_R1","")
StartShipWeaponConfig(NewShipType,"Laser_4D_PDS","Weapon_R2","")
StartShipWeaponConfig(NewShipType,"Laser_4D_PDS","Weapon_R3","")
StartShipWeaponConfig(NewShipType,"Laser_4D_PDS","Weapon_R4","")
StartShipWeaponConfig(NewShipType,"Laser_4D_PDS","Weapon_R5","")
StartShipWeaponConfig(NewShipType,"Laser_4D_PDS","Weapon_R6","")
StartShipWeaponConfig(NewShipType,"Laser_4D_PDS","Weapon_R7","")


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


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

NewShipType.battleScarMaxTriBase = 1000
NewShipType.battleScarMaxTriInc = 2000
NewShipType.sobDieTime = 8
NewShipType.sobSpecialDieTime = 1.9
NewShipType.specialDeathSpeed = 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,1,1,1,25000,25000,150,1.5,{
  0.27,
  0.47,
  0.69,
  0.3,
})
loadShipPatchList(NewShipType,"data:sound/sfx/ship/imperial/frigate/",0,"Engines/frigate","",1,"Ambience/frigate")

--====================================================================================
--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 = 586
NewShipType.frigateValue = 117
NewShipType.neutralValue = 0
NewShipType.antiFighterValue = 50
NewShipType.antiCorvetteValue = 533
NewShipType.antiFrigateValue = 117
NewShipType.totalValue = 1403