Added Harpoon
This commit is contained in:
@@ -22,6 +22,13 @@ scales[WeaponType.Diffuser] = {
|
||||
{from = 51, to = 52, size = 3.0, usedSlots = 6},
|
||||
}
|
||||
|
||||
scales[WeaponType.Harpoon] = {
|
||||
{from = 0, to = 46, size = 1.0, usedSlots = 2},
|
||||
{from = 47, to = 50, size = 2.0, usedSlots = 4},
|
||||
--dummy for cooaxial, add 1 to size and level
|
||||
{from = 51, to = 52, size = 3.0, usedSlots = 6},
|
||||
}
|
||||
|
||||
if GameVersion() >= Version(0, 31, 0) then
|
||||
possibleSpecialties[WeaponType.AutoCannon] = {
|
||||
{specialty = Specialty.HighDamage, probability = 0.2},
|
||||
@@ -74,6 +81,19 @@ else
|
||||
}
|
||||
end
|
||||
|
||||
if GameVersion() >= Version(0, 31, 0) then
|
||||
possibleSpecialties[WeaponType.Harpoon] = {
|
||||
{specialty = Specialty.HighDamage, probability = 0.3},
|
||||
{specialty = Specialty.HighRange, probability = 0.3},
|
||||
-- {specialty = Specialty.FasterRechargeTime, probability = 0.6},
|
||||
}
|
||||
else
|
||||
possibleSpecialties[WeaponType.Harpoon] = {
|
||||
Specialty.HighDamage,
|
||||
Specialty.HighRange,
|
||||
Specialty.FasterRechargeTime,
|
||||
}
|
||||
end
|
||||
|
||||
function TurretGenerator.generateAutoCannonTurret(rand, dps, tech, material, rarity)
|
||||
local result = TurretTemplate()
|
||||
@@ -174,3 +194,37 @@ function TurretGenerator.generateDiffuserTurret(rand, dps, tech, material, rarit
|
||||
end
|
||||
|
||||
generatorFunction[WeaponType.Diffuser] = TurretGenerator.generateDiffuserTurret
|
||||
|
||||
|
||||
function TurretGenerator.generateHarpoonTurret(rand, dps, tech, material, rarity)
|
||||
local result = TurretTemplate()
|
||||
|
||||
-- generate turret
|
||||
local requiredCrew = TurretGenerator.dpsToRequiredCrew(dps)
|
||||
local crew = Crew()
|
||||
crew:add(requiredCrew, CrewMan(CrewProfessionType.Gunner))
|
||||
result.crew = crew
|
||||
|
||||
-- generate weapons
|
||||
local numWeapons = rand:getInt(1, 2)
|
||||
|
||||
local weapon = WeaponGenerator.generateHarpoon(rand, dps, tech, material, rarity)
|
||||
weapon.damage = weapon.damage / numWeapons
|
||||
|
||||
-- attach weapons to turret
|
||||
TurretGenerator.attachWeapons(rand, result, weapon, numWeapons)
|
||||
|
||||
local rechargeTime = 4 * rand:getFloat(0.8, 1.2)
|
||||
local shootingTime = 2 * rand:getFloat(0.8, 1.2)
|
||||
TurretGenerator.createBatteryChargeCooling(result, rechargeTime, shootingTime)
|
||||
|
||||
|
||||
TurretGenerator.scale(rand, result, WeaponType.Harpoon, tech, 0.75)
|
||||
TurretGenerator.addSpecialties(rand, result, WeaponType.Harpoon)
|
||||
|
||||
result:updateStaticStats()
|
||||
|
||||
return result
|
||||
end
|
||||
|
||||
generatorFunction[WeaponType.Harpoon] = TurretGenerator.generateHarpoonTurret
|
||||
|
||||
Reference in New Issue
Block a user