Update 2 files

- /data/scripts/lib/turretgenerator.lua
- /data/scripts/lib/weapongenerator.lua
This commit is contained in:
Alex
2023-08-28 20:07:43 +00:00
parent 0880b82677
commit 13a688edb3
2 changed files with 43 additions and 31 deletions

View File

@@ -310,15 +310,26 @@ function TurretGenerator.generateHiveLauncherTurret(rand, dps, tech, material, r
weapon.damage = weapon.damage / numWeapons
-- attach weapons to turret
TurretGenerator.attachWeapons(rand, result, weapon, numWeapons)
local positions = {}
if rand:getBool() then
table.insert(positions, vec3(0, 0.3, 0))
else
table.insert(positions, vec3(0.4, 0.3, 0))
table.insert(positions, vec3(-0.4, 0.3, 0))
end
local rechargeTime = 4 * rand:getFloat(0.8, 1.2)
local shootingTime = 2 * rand:getFloat(0.8, 1.2)
TurretGenerator.createBatteryChargeCooling(result, rechargeTime, shootingTime)
-- attach
for _, position in pairs(positions) do
weapon.localPosition = position * result.size
result:addWeapon(weapon)
end
local shootingTime = 20 * rand:getFloat(0.8, 1.2)
local coolingTime = 15 * rand:getFloat(0.8, 1.2)
TurretGenerator.createStandardCooling(result, coolingTime, shootingTime)
TurretGenerator.scale(rand, result, WeaponType.HiveLauncher, tech, 0.75)
local specialties = TurretGenerator.addSpecialties(rand, result, WeaponType.HiveLauncher)
TurretGenerator.scale(rand, result, WeaponType.RocketLauncher, tech, 0.6, coaxialAllowed)
local specialties = TurretGenerator.addSpecialties(rand, result, WeaponType.RocketLauncher)
result.slotType = TurretSlotType.Armed
result:updateStaticStats()