NewShipType = StartShipConfig()

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

NewShipType.displayedName = "Marauder Corvette"
NewShipType.sobDescription = "Patrol Corvette"
NewShipType.SquadronSize = 1


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

NewShipType.buildCost = 15000
NewShipType.buildTime = 100
NewShipType.buildPriorityOrder = 4

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

NewShipType.mass = 195
NewShipType.maxhealth = 365143
NewShipType.regentime = 365
NewShipType.minRegenTime = 730
NewShipType.sideArmourDamage = 1
NewShipType.rearArmourDamage = 1
NewShipType.dustCloudDamageTime = 50
NewShipType.nebulaDamageTime = 25
addShield(NewShipType,"EMP",2500,20)

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

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

--====================================================================================
--PROPULSION
--====================================================================================
NewShipType.thrusterMaxSpeed = 60
NewShipType.mainEngineMaxSpeed = 240
NewShipType.rotationMaxSpeed = 18

NewShipType.thrusterAccelTime = 2
NewShipType.thrusterBrakeTime = 2
NewShipType.mainEngineAccelTime = 6
NewShipType.mainEngineBrakeTime = 6
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 = 50
NewShipType.slideMoveRange = 100
NewShipType.relativeMoveFactor = 1

NewShipType.collisionMultiplier = 1

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

NewShipType.militaryUnit = 1
NewShipType.MinimalFamilyToFindPathAround = "Frigate"
NewShipType.BuildFamily = "Heavy_Corvette_Hgn"
NewShipType.AttackFamily = "Heavy_Corvette"
NewShipType.DockFamily = "Frigate"
NewShipType.AvoidanceFamily = "Frigate"
NewShipType.DisplayFamily = "Corvette"
NewShipType.AutoFormationFamily = "Corvette"
NewShipType.CollisionFamily = "Small"
NewShipType.ArmourFamily = "Hull_Cap_3D"
NewShipType.UnitCapsFamily = "Heavy_Corvette"
NewShipType.unitCapsNumber = 1

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

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

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

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

addAbility(NewShipType,"CanAttack",1,1,0,1,0.25,0.9,"Capturer,large_missile,small_missile,bomber,Frigate,Heavy_Frigate,Heavy_Corvette,Destroyer,SmallCapitalShip,BigCapitalShip,SubSystem,Emplacement,Cruiser,SuperCapital,Corvette,Fighter,MotherShip,Heavy_Utility,Utility","FlyRound_Corvette_vs_Frigate",{
  Fighter = "FlyRound_Corvette_vs_Fighter",
},{
  Bomber = "FlyRound_Corvette_vs_Fighter",
},{
  Corvette = "FlyRound_Corvette_vs_Fighter",
},{
  Heavy_Corvette = "FlyBy_Corvette_vs_Corvette",
},{
  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",
},{
  munition = "JustShoot",
},{
  small_missile = "JustShoot",
},{
  large_missile = "JustShoot",
})
addAbility(NewShipType,"GuardCommand",1,10000,2000)

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

NewShipType.TOIcon = "Diamond"
NewShipType.TOScale = 1
NewShipType.TODistanceFade0 = 3000
NewShipType.TODistanceDisappear0 = 2000
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 = 1

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

NewShipType.nlips = 0
NewShipType.nlipsRange = 75000
NewShipType.nlipsFar = 0
NewShipType.nlipsFarRange = 0
NewShipType.SMRepresentation = "HardDot"
NewShipType.meshRenderLimit = 13000
NewShipType.dotRenderLimit = 10
NewShipType.visibleInSecondary = 0
NewShipType.minLOD = 0.25
NewShipType.goblinsStartFade = 500
NewShipType.goblinsOff = 510
NewShipType.upLOD = 1550
NewShipType.upLOD = 2050
NewShipType.downLOD = 1565
NewShipType.downLOD = 2065
NewShipType.minimumZoomFactor = 0.25
NewShipType.selectionLimit = 40000000000000000000000000
NewShipType.preciseATILimit = 5
NewShipType.preciseSelectionLimit = 35
NewShipType.selectionPriority = 80

--====================================================================================
--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,100,100,1,5)
addAbility(NewShipType,"CanBeCaptured",40,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",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","Hgn_Marauder_Corvette_Shields")
--StartShipHardPointConfig(NewShipType,"Shield","Hardpoint_Shield","System","Generic","Damageable","Vgr_Corellian_Heavy_Gunship_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,"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_Regen","System","Generic","Damageable","Vgr_Module_Regen_medium")
--StartShipHardPointConfig(NewShipType,"REGEN2","Hardpoint_Regen1","System","Generic","Damageable","Vgr_Module_Regen_medium")


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

--====================================================================================
--WEAPONRY
--====================================================================================
StartShipWeaponConfig(NewShipType,"concussion_missile_launcher_medium","Weapon_Launcher0","Small_Missile1")
StartShipWeaponConfig(NewShipType,"concussion_missile_launcher_medium","Weapon_Launcher1","Small_Missile2")
StartShipWeaponConfig(NewShipType,"concussion_missile_launcher_medium","Weapon_Launcher2","Small_Missile3")
StartShipWeaponConfig(NewShipType,"concussion_missile_launcher_medium","Weapon_Launcher3","Small_Missile4")
StartShipWeaponConfig(NewShipType,"concussion_missile_launcher_medium","Weapon_Launcher4","Small_Missile5")
StartShipWeaponConfig(NewShipType,"concussion_missile_launcher_medium","Weapon_Launcher5","Small_Missile6")
StartShipWeaponConfig(NewShipType,"Concussion_Missile_Launcher_Mid","Weapon_Launcher0","Small_Missile1")
StartShipWeaponConfig(NewShipType,"Concussion_Missile_Launcher_Mid","Weapon_Launcher1","Small_Missile2")
StartShipWeaponConfig(NewShipType,"Concussion_Missile_Launcher_Mid","Weapon_Launcher2","Small_Missile3")
StartShipWeaponConfig(NewShipType,"Concussion_Missile_Launcher_Mid","Weapon_Launcher3","Small_Missile4")
StartShipWeaponConfig(NewShipType,"Concussion_Missile_Launcher_Mid","Weapon_Launcher4","Small_Missile5")
StartShipWeaponConfig(NewShipType,"Concussion_Missile_Launcher_Mid","Weapon_Launcher5","Small_Missile6")
StartShipWeaponConfig(NewShipType,"Concussion_Missile_Launcher_Cap","Weapon_Launcher0","Small_Missile1")
StartShipWeaponConfig(NewShipType,"Concussion_Missile_Launcher_Cap","Weapon_Launcher1","Small_Missile2")
StartShipWeaponConfig(NewShipType,"Concussion_Missile_Launcher_Cap","Weapon_Launcher2","Small_Missile3")
StartShipWeaponConfig(NewShipType,"Concussion_Missile_Launcher_Cap","Weapon_Launcher3","Small_Missile4")
StartShipWeaponConfig(NewShipType,"Concussion_Missile_Launcher_Cap","Weapon_Launcher4","Small_Missile5")
StartShipWeaponConfig(NewShipType,"Concussion_Missile_Launcher_Cap","Weapon_Launcher5","Small_Missile6")
--====================================================================================
--DEATH
--====================================================================================

NewShipType.battleScarMaxTriBase = 500
NewShipType.battleScarMaxTriInc = 1000
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,10,0.95,0.95,20,3000,1,2,{
  0.27,
  0.47,
  0.69,
  0.3,
})
loadShipPatchList(NewShipType,"data:sound/sfx/ship/imperial/heavycorvette/",0,"Engines/heavycorvette","",1,"Ambience/heavycorvette")

--====================================================================================
--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.3
NewShipType.targetRandomPointXMax = 0.3
NewShipType.targetRandomPointYMin = -0.1
NewShipType.targetRandomPointYMax = 0.1
NewShipType.targetRandomPointZMin = -0.5
NewShipType.targetRandomPointZMax = 0.5

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

NewShipType.fighterValue = 0
NewShipType.corvetteValue = 259
NewShipType.frigateValue = 0
NewShipType.neutralValue = 0
NewShipType.antiFighterValue = 0
NewShipType.antiCorvetteValue = 24
NewShipType.antiFrigateValue = 12
NewShipType.totalValue = 295


























