From 0a3f032d56f40aa2b606fe08eeb9fb329910c7e8 Mon Sep 17 00:00:00 2001 From: Alex Date: Wed, 30 Aug 2023 18:37:08 +0000 Subject: [PATCH] Update file turretgenerator.lua --- data/scripts/lib/turretgenerator.lua | 38 ++++++++++++++-------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/data/scripts/lib/turretgenerator.lua b/data/scripts/lib/turretgenerator.lua index 404fd9b..3aa076e 100644 --- a/data/scripts/lib/turretgenerator.lua +++ b/data/scripts/lib/turretgenerator.lua @@ -126,6 +126,18 @@ function TurretGenerator.generateSmartCannonTurret(rand, dps, tech, material, ra local weapon = WeaponGenerator.generateSmartCannon(rand, dps, tech, material, rarity) weapon.fireDelay = weapon.fireDelay * numWeapons + + local name = "Smart-Cannon /* weapon name*/"%_T + + local specType = rand:getInt(0, 2) + if specType == 1 then + name = "Ionized Smart-Cannon /* weapon name*/"%_T + weapon.shieldPenetration = 1 + elseif specType == 2 then + name = "Plasmed Smart-Cannon /* weapon name*/"%_T + weapon.damageType = DamageType.Plasma + weapon.damage = weapon.damage * 0.9 + end -- attach weapons to turret TurretGenerator.attachWeapons(rand, result, weapon, numWeapons) @@ -140,18 +152,6 @@ function TurretGenerator.generateSmartCannonTurret(rand, dps, tech, material, ra result.slotType = TurretSlotType.Armed result:updateStaticStats() - local name = "Smart-Cannon /* weapon name*/"%_T - - local specType = rand:getInt(0, 2) - if specType == 1 then - name = "Ionized Smart-Cannon /* weapon name*/"%_T - weapon.shieldPenetration = 1 - elseif specType == 2 then - name = "Plasmed Smart-Cannon /* weapon name*/"%_T - weapon.damageType = DamageType.Plasma - weapon.damage = weapon.damage * 0.9 - end - local dmgAdjective, outerAdjective, barrel, multishot, coax, serial = makeTitleParts(rand, specialties, result, DamageType.Physical) result.title = Format("%1%%2%%3%%4%%5%%6%%7% /* [outer-adjective][barrel][coax][dmg-adjective][multishot][name][serial] */"%_T, outerAdjective, barrel, coax, dmgAdjective, multishot, name, serial) @@ -168,7 +168,7 @@ function TurretGenerator.generateHeavyCannonTurret(rand, dps, tech, material, ra -- generate turret local requiredCrew = TurretGenerator.dpsToRequiredCrew(dps) local crew = Crew() - crew:add(requiredCrew, CrewMan(CrewProfessionType.Gunner)) + crew:add(requiredCrew * 3, CrewMan(CrewProfessionType.Gunner)) crew:add(requiredCrew, CrewMan(CrewProfessionType.Repair)) result.crew = crew @@ -178,6 +178,12 @@ function TurretGenerator.generateHeavyCannonTurret(rand, dps, tech, material, ra local weapon = WeaponGenerator.generateHeavyCannon(rand, dps, tech, material, rarity) weapon.fireDelay = weapon.fireDelay * numWeapons + local Pen = rand:getInt(0, rarity.value) + if Pen > 0 then + weapon.blockPenetration = Pen + outerAdjective = "Cumulative "%_T + end + -- attach weapons to turret TurretGenerator.attachWeapons(rand, result, weapon, numWeapons) @@ -195,12 +201,6 @@ function TurretGenerator.generateHeavyCannonTurret(rand, dps, tech, material, ra local dmgAdjective, outerAdjective, barrel, multishot, coax, serial = makeTitleParts(rand, specialties, result, DamageType.Physical) - local Pen = rand:getInt(0, rarity.value) - if Pen > 0 then - weapon.blockPenetration = Pen - outerAdjective = "Cumulative "%_T - end - if result.size >= 4 then name = "Mons Meg /* weapon name*/"%_T end