Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e90ff8f1e2 | ||
|
|
13a688edb3 | ||
|
|
0880b82677 | ||
|
|
050a642982 |
@@ -1,5 +1,6 @@
|
||||
|
||||
weaponProbabilities[WeaponType.SmartCannon] = {d = 0.65, p = 2.0}
|
||||
weaponProbabilities[WeaponType.HeavyCannon] = {d = 0.6, p = 1.0}
|
||||
weaponProbabilities[WeaponType.Diffuser] = {d = 0.6, p = 1.0}
|
||||
weaponProbabilities[WeaponType.Hookgun] = {d = 0.6, p = 1.0}
|
||||
|
||||
weaponProbabilities[WeaponType.SmartCannon] = {d = 0.65, p = 2.0}
|
||||
weaponProbabilities[WeaponType.HeavyCannon] = {d = 0.6, p = 1.0}
|
||||
weaponProbabilities[WeaponType.Diffuser] = {d = 0.6, p = 1.0}
|
||||
weaponProbabilities[WeaponType.Hookgun] = {d = 0.6, p = 1.0}
|
||||
weaponProbabilities[WeaponType.HiveLauncher] = {d = 0.6, p = 1.0} -- TODO Подсмотреть у ванильных ракетниц
|
||||
@@ -1,5 +1,6 @@
|
||||
|
||||
valueWeights[WeaponType.SmartCannon ] = 2
|
||||
valueWeights[WeaponType.HeavyCannon ] = 2.5
|
||||
valueWeights[WeaponType.Diffuser ] = 1.7
|
||||
valueWeights[WeaponType.Hookgun ] = 1.5
|
||||
|
||||
valueWeights[WeaponType.SmartCannon ] = 2
|
||||
valueWeights[WeaponType.HeavyCannon ] = 2.5
|
||||
valueWeights[WeaponType.Diffuser ] = 1.7
|
||||
valueWeights[WeaponType.Hookgun ] = 1.5
|
||||
valueWeights[WeaponType.HiveLauncher] = 2
|
||||
|
||||
@@ -1,266 +1,352 @@
|
||||
|
||||
scales[WeaponType.SmartCannon] = {
|
||||
{from = 0, to = 28, size = 1.0, usedSlots = 2},
|
||||
{from = 29, to = 38, size = 2.0, usedSlots = 3},
|
||||
{from = 39, to = 49, size = 3.0, usedSlots = 4},
|
||||
--dummy for cooaxial, add 1 to size and level
|
||||
{from = 50, to = 52, size = 4.0, usedSlots = 5},
|
||||
}
|
||||
|
||||
scales[WeaponType.HeavyCannon] = {
|
||||
{from = 0, to = 28, size = 3.0, usedSlots = 4},
|
||||
{from = 29, to = 38, size = 4.0, usedSlots = 5},
|
||||
{from = 39, to = 49, size = 5.0, usedSlots = 6},
|
||||
--dummy for cooaxial, add 1 to size and level
|
||||
{from = 50, to = 52, size = 5, usedSlots = 6},
|
||||
}
|
||||
|
||||
scales[WeaponType.Diffuser] = {
|
||||
{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},
|
||||
}
|
||||
|
||||
scales[WeaponType.Hookgun] = {
|
||||
{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.SmartCannon] = {
|
||||
{specialty = Specialty.HighDamage, probability = 0.2},
|
||||
{specialty = Specialty.HighFireRate, probability = 0.3},
|
||||
{specialty = Specialty.HighRange, probability = 0.7},
|
||||
-- {specialty = Specialty.HighHullDamage, probability = 0.5},
|
||||
-- {specialty = Specialty.LessCoolingTime, probability = 0.4},
|
||||
}
|
||||
else
|
||||
possibleSpecialties[WeaponType.SmartCannon] = {
|
||||
Specialty.HighDamage,
|
||||
Specialty.HighFireRate,
|
||||
Specialty.HighRange,
|
||||
Specialty.HighHullDamage,
|
||||
Specialty.LessCoolingTime,
|
||||
}
|
||||
end
|
||||
|
||||
if GameVersion() >= Version(0, 31, 0) then
|
||||
possibleSpecialties[WeaponType.HeavyCannon] = {
|
||||
{specialty = Specialty.HighDamage, probability = 0.2},
|
||||
{specialty = Specialty.HighRange, probability = 0.35},
|
||||
{specialty = Specialty.HighFireRate, probability = 0.3},
|
||||
-- {specialty = Specialty.HighHullDamage, probability = 0.2},
|
||||
-- {specialty = Specialty.HighShieldDamage, probability = 0.2},
|
||||
-- {specialty = Specialty.LessCoolingTime, probability = 0.2}
|
||||
}
|
||||
else
|
||||
possibleSpecialties[WeaponType.HeavyCannon] = {
|
||||
Specialty.HighDamage,
|
||||
Specialty.HighFireRate,
|
||||
Specialty.HighRange,
|
||||
Specialty.HighHullDamage,
|
||||
Specialty.HighShieldDamage,
|
||||
Specialty.LessCoolingTime,
|
||||
}
|
||||
end
|
||||
|
||||
if GameVersion() >= Version(0, 31, 0) then
|
||||
possibleSpecialties[WeaponType.Diffuser] = {
|
||||
{specialty = Specialty.HighDamage, probability = 0.3},
|
||||
{specialty = Specialty.HighRange, probability = 0.3},
|
||||
-- {specialty = Specialty.FasterRechargeTime, probability = 0.6},
|
||||
}
|
||||
else
|
||||
possibleSpecialties[WeaponType.Diffuser] = {
|
||||
Specialty.HighDamage,
|
||||
Specialty.HighRange,
|
||||
Specialty.FasterRechargeTime,
|
||||
}
|
||||
end
|
||||
|
||||
if GameVersion() >= Version(0, 31, 0) then
|
||||
possibleSpecialties[WeaponType.Hookgun] = {
|
||||
{specialty = Specialty.HighDamage, probability = 0.3},
|
||||
{specialty = Specialty.HighRange, probability = 0.3},
|
||||
-- {specialty = Specialty.FasterRechargeTime, probability = 0.6},
|
||||
}
|
||||
else
|
||||
possibleSpecialties[WeaponType.Hookgun] = {
|
||||
Specialty.HighDamage,
|
||||
Specialty.HighRange,
|
||||
Specialty.FasterRechargeTime,
|
||||
}
|
||||
end
|
||||
|
||||
function TurretGenerator.generateSmartCannonTurret(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, 4)
|
||||
|
||||
local weapon = WeaponGenerator.generateSmartCannon(rand, dps, tech, material, rarity)
|
||||
weapon.fireDelay = weapon.fireDelay * numWeapons
|
||||
|
||||
-- attach weapons to turret
|
||||
TurretGenerator.attachWeapons(rand, result, weapon, numWeapons)
|
||||
|
||||
local shootingTime = 25 * 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.SmartCannon, tech, 0.6)
|
||||
local specialties = TurretGenerator.addSpecialties(rand, result, WeaponType.SmartCannon)
|
||||
|
||||
result.slotType = TurretSlotType.Armed
|
||||
result:updateStaticStats()
|
||||
|
||||
local name = "SmartCannon /* weapon name*/"%_T
|
||||
|
||||
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], e.g. Enduring Dual Coaxial Plasmatic Tri-R-Mining Laser T-F */"%_T, outerAdjective, barrel, coax, dmgAdjective, multishot, name, serial)
|
||||
local specType = 1
|
||||
if specType > 0 then
|
||||
weapon.prefix = "Ionized /* Weapon Prefix*/"%_t
|
||||
weapon.shieldPenetration = 1
|
||||
end
|
||||
|
||||
return result
|
||||
end
|
||||
|
||||
generatorFunction[WeaponType.SmartCannon] = TurretGenerator.generateSmartCannonTurret
|
||||
|
||||
|
||||
function TurretGenerator.generateHeavyCannonTurret(rand, dps, tech, material, rarity)
|
||||
local result = TurretTemplate()
|
||||
|
||||
-- generate turret
|
||||
local requiredCrew = TurretGenerator.dpsToRequiredCrew(dps)
|
||||
local crew = Crew()
|
||||
crew:add(requiredCrew*2, CrewMan(CrewProfessionType.Gunner))
|
||||
crew:add(requiredCrew, CrewMan(CrewProfessionType.Repair))
|
||||
result.crew = crew
|
||||
|
||||
-- generate weapons
|
||||
local numWeapons = rand:getInt(1, 4)
|
||||
|
||||
local weapon = WeaponGenerator.generateHeavyCannon(rand, dps, tech, material, rarity)
|
||||
weapon.fireDelay = weapon.fireDelay * numWeapons
|
||||
|
||||
-- attach weapons to turret
|
||||
TurretGenerator.attachWeapons(rand, result, weapon, numWeapons)
|
||||
|
||||
local shootingTime = 25 * rand:getFloat(0.8, 1.2)
|
||||
local coolingTime = 20 * rand:getFloat(0.8, 1.2)
|
||||
TurretGenerator.createStandardCooling(result, coolingTime, shootingTime)
|
||||
|
||||
TurretGenerator.scale(rand, result, WeaponType.HeavyCannon, tech, 0.6)
|
||||
local specialties = TurretGenerator.addSpecialties(rand, result, WeaponType.HeavyCannon)
|
||||
|
||||
result.slotType = TurretSlotType.Armed
|
||||
result:updateStaticStats()
|
||||
|
||||
local name = "Heavy Cannon /* weapon name*/"%_T
|
||||
|
||||
local Pen = rand:getInt(0, rarity.value)
|
||||
if Pen > 0 then
|
||||
weapon.blockPenetration = Pen
|
||||
weapon.prefix = "Cumulative /* Weapon Prefix*/"%_t
|
||||
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], e.g. Enduring Dual Coaxial Plasmatic Tri-R-Mining Laser T-F */"%_T, outerAdjective, barrel, coax, dmgAdjective, multishot, name, serial)
|
||||
|
||||
return result
|
||||
end
|
||||
|
||||
generatorFunction[WeaponType.HeavyCannon] = TurretGenerator.generateHeavyCannonTurret
|
||||
|
||||
|
||||
function TurretGenerator.generateDiffuserTurret(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.generateDiffuser(rand, dps, tech, material, rarity)
|
||||
weapon.damage = weapon.damage / numWeapons
|
||||
|
||||
-- attach weapons to turret
|
||||
TurretGenerator.attachWeapons(rand, result, weapon, numWeapons)
|
||||
|
||||
local rechargeTime = 20 * rand:getFloat(0.8, 1.2)
|
||||
local shootingTime = 15 * rand:getFloat(0.8, 1.2)
|
||||
TurretGenerator.createBatteryChargeCooling(result, rechargeTime, shootingTime)
|
||||
|
||||
|
||||
TurretGenerator.scale(rand, result, WeaponType.Diffuser, tech, 0.75)
|
||||
local specialties = TurretGenerator.addSpecialties(rand, result, WeaponType.Diffuser)
|
||||
|
||||
result.slotType = TurretSlotType.Armed
|
||||
result:updateStaticStats()
|
||||
|
||||
local name = "Diffusor /* weapon name*/"%_T
|
||||
|
||||
local dmgAdjective, outerAdjective, barrel, multishot, coax, serial = makeTitleParts(rand, specialties, result, DamageType.Energy)
|
||||
result.title = Format("%1%%2%%3%%4%%5%%6%%7% /* [outer-adjective][barrel][coax][dmg-adjective][multishot][name][serial], e.g. Enduring Dual Coaxial Plasmatic Tri-R-Mining Laser T-F */"%_T, outerAdjective, barrel, coax, dmgAdjective, multishot, name, serial)
|
||||
|
||||
return result
|
||||
end
|
||||
|
||||
generatorFunction[WeaponType.Diffuser] = TurretGenerator.generateDiffuserTurret
|
||||
|
||||
|
||||
function TurretGenerator.generateHookgunTurret(rand, dps, tech, material, rarity)
|
||||
local result = TurretTemplate()
|
||||
|
||||
-- generate turret
|
||||
local requiredCrew = TurretGenerator.dpsToRequiredCrew(dps)
|
||||
local crew = Crew()
|
||||
crew:add(requiredCrew*2, CrewMan(CrewProfessionType.Gunner))
|
||||
result.crew = crew
|
||||
|
||||
-- generate weapons
|
||||
local numWeapons = rand:getInt(1, 2)
|
||||
|
||||
local weapon = WeaponGenerator.generateHookgun(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.Hookgun, tech, 0.75)
|
||||
local specialties = TurretGenerator.addSpecialties(rand, result, WeaponType.Hookgun)
|
||||
|
||||
result.slotType = TurretSlotType.Armed
|
||||
result:updateStaticStats()
|
||||
|
||||
local name = "Hookgun /* weapon name*/"%_T
|
||||
|
||||
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], e.g. Enduring Dual Coaxial Plasmatic Tri-R-Mining Laser T-F */"%_T, outerAdjective, barrel, coax, dmgAdjective, multishot, name, serial)
|
||||
|
||||
return result
|
||||
end
|
||||
|
||||
generatorFunction[WeaponType.Hookgun] = TurretGenerator.generateHookgunTurret
|
||||
|
||||
scales[WeaponType.SmartCannon] = {
|
||||
{from = 0, to = 28, size = 1.0, usedSlots = 2},
|
||||
{from = 29, to = 38, size = 2.0, usedSlots = 3},
|
||||
{from = 39, to = 49, size = 3.0, usedSlots = 4},
|
||||
--dummy for cooaxial, add 1 to size and level
|
||||
{from = 50, to = 52, size = 4.0, usedSlots = 5},
|
||||
}
|
||||
|
||||
scales[WeaponType.HeavyCannon] = {
|
||||
{from = 0, to = 28, size = 3.0, usedSlots = 4},
|
||||
{from = 29, to = 38, size = 4.0, usedSlots = 5},
|
||||
{from = 39, to = 49, size = 5.0, usedSlots = 6},
|
||||
--dummy for cooaxial, add 1 to size and level
|
||||
{from = 50, to = 52, size = 5, usedSlots = 6},
|
||||
}
|
||||
|
||||
scales[WeaponType.Diffuser] = {
|
||||
{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},
|
||||
}
|
||||
|
||||
scales[WeaponType.Hookgun] = {
|
||||
{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},
|
||||
}
|
||||
|
||||
scales[WeaponType.HiveLauncher] = {
|
||||
{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.SmartCannon] = {
|
||||
{specialty = Specialty.HighDamage, probability = 0.2},
|
||||
{specialty = Specialty.HighFireRate, probability = 0.3},
|
||||
{specialty = Specialty.HighRange, probability = 0.7},
|
||||
-- {specialty = Specialty.HighHullDamage, probability = 0.5},
|
||||
-- {specialty = Specialty.LessCoolingTime, probability = 0.4},
|
||||
}
|
||||
else
|
||||
possibleSpecialties[WeaponType.SmartCannon] = {
|
||||
Specialty.HighDamage,
|
||||
Specialty.HighFireRate,
|
||||
Specialty.HighRange,
|
||||
Specialty.HighHullDamage,
|
||||
Specialty.LessCoolingTime,
|
||||
}
|
||||
end
|
||||
|
||||
if GameVersion() >= Version(0, 31, 0) then
|
||||
possibleSpecialties[WeaponType.HeavyCannon] = {
|
||||
{specialty = Specialty.HighDamage, probability = 0.2},
|
||||
{specialty = Specialty.HighRange, probability = 0.35},
|
||||
{specialty = Specialty.HighFireRate, probability = 0.3},
|
||||
-- {specialty = Specialty.HighHullDamage, probability = 0.2},
|
||||
-- {specialty = Specialty.HighShieldDamage, probability = 0.2},
|
||||
-- {specialty = Specialty.LessCoolingTime, probability = 0.2}
|
||||
}
|
||||
else
|
||||
possibleSpecialties[WeaponType.HeavyCannon] = {
|
||||
Specialty.HighDamage,
|
||||
Specialty.HighFireRate,
|
||||
Specialty.HighRange,
|
||||
Specialty.HighHullDamage,
|
||||
Specialty.HighShieldDamage,
|
||||
Specialty.LessCoolingTime,
|
||||
}
|
||||
end
|
||||
|
||||
if GameVersion() >= Version(0, 31, 0) then
|
||||
possibleSpecialties[WeaponType.Diffuser] = {
|
||||
{specialty = Specialty.HighDamage, probability = 0.3},
|
||||
{specialty = Specialty.HighRange, probability = 0.3},
|
||||
-- {specialty = Specialty.FasterRechargeTime, probability = 0.6},
|
||||
}
|
||||
else
|
||||
possibleSpecialties[WeaponType.Diffuser] = {
|
||||
Specialty.HighDamage,
|
||||
Specialty.HighRange,
|
||||
Specialty.FasterRechargeTime,
|
||||
}
|
||||
end
|
||||
|
||||
if GameVersion() >= Version(0, 31, 0) then
|
||||
possibleSpecialties[WeaponType.Hookgun] = {
|
||||
{specialty = Specialty.HighDamage, probability = 0.3},
|
||||
{specialty = Specialty.HighRange, probability = 0.3},
|
||||
-- {specialty = Specialty.FasterRechargeTime, probability = 0.6},
|
||||
}
|
||||
else
|
||||
possibleSpecialties[WeaponType.Hookgun] = {
|
||||
Specialty.HighDamage,
|
||||
Specialty.HighRange,
|
||||
Specialty.FasterRechargeTime,
|
||||
}
|
||||
end
|
||||
|
||||
if GameVersion() >= Version(0, 31, 0) then
|
||||
possibleSpecialties[WeaponType.HiveLauncher] = {
|
||||
{specialty = Specialty.HighDamage, probability = 0.3},
|
||||
{specialty = Specialty.HighRange, probability = 0.3},
|
||||
-- {specialty = Specialty.FasterRechargeTime, probability = 0.6},
|
||||
}
|
||||
else
|
||||
possibleSpecialties[WeaponType.HiveLauncher] = {
|
||||
Specialty.HighDamage,
|
||||
Specialty.HighRange,
|
||||
Specialty.FasterRechargeTime,
|
||||
}
|
||||
end
|
||||
|
||||
function TurretGenerator.generateSmartCannonTurret(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, 4)
|
||||
|
||||
local weapon = WeaponGenerator.generateSmartCannon(rand, dps, tech, material, rarity)
|
||||
weapon.fireDelay = weapon.fireDelay * numWeapons
|
||||
|
||||
-- attach weapons to turret
|
||||
TurretGenerator.attachWeapons(rand, result, weapon, numWeapons)
|
||||
|
||||
local shootingTime = 25 * 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.SmartCannon, tech, 0.6)
|
||||
local specialties = TurretGenerator.addSpecialties(rand, result, WeaponType.SmartCannon)
|
||||
|
||||
result.slotType = TurretSlotType.Armed
|
||||
result:updateStaticStats()
|
||||
|
||||
local name = "SmartCannon /* weapon name*/"%_T
|
||||
|
||||
local specType = 1
|
||||
if specType > 0 then
|
||||
name = "Ionized SmartCannon/* weapon name*/"%_T
|
||||
weapon.shieldPenetration = 1
|
||||
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], e.g. Enduring Dual Coaxial Plasmatic Tri-R-Mining Laser T-F */"%_T, outerAdjective, barrel, coax, dmgAdjective, multishot, name, serial)
|
||||
|
||||
return result
|
||||
end
|
||||
|
||||
generatorFunction[WeaponType.SmartCannon] = TurretGenerator.generateSmartCannonTurret
|
||||
|
||||
|
||||
function TurretGenerator.generateHeavyCannonTurret(rand, dps, tech, material, rarity)
|
||||
local result = TurretTemplate()
|
||||
|
||||
-- generate turret
|
||||
local requiredCrew = TurretGenerator.dpsToRequiredCrew(dps)
|
||||
local crew = Crew()
|
||||
crew:add(requiredCrew*2, CrewMan(CrewProfessionType.Gunner))
|
||||
crew:add(requiredCrew, CrewMan(CrewProfessionType.Repair))
|
||||
result.crew = crew
|
||||
|
||||
-- generate weapons
|
||||
local numWeapons = rand:getInt(1, 4)
|
||||
|
||||
local weapon = WeaponGenerator.generateHeavyCannon(rand, dps, tech, material, rarity)
|
||||
weapon.fireDelay = weapon.fireDelay * numWeapons
|
||||
|
||||
-- attach weapons to turret
|
||||
TurretGenerator.attachWeapons(rand, result, weapon, numWeapons)
|
||||
|
||||
local shootingTime = 25 * rand:getFloat(0.8, 1.2)
|
||||
local coolingTime = 20 * rand:getFloat(0.8, 1.2)
|
||||
TurretGenerator.createStandardCooling(result, coolingTime, shootingTime)
|
||||
|
||||
TurretGenerator.scale(rand, result, WeaponType.HeavyCannon, tech, 0.6)
|
||||
local specialties = TurretGenerator.addSpecialties(rand, result, WeaponType.HeavyCannon)
|
||||
|
||||
result.slotType = TurretSlotType.Armed
|
||||
result:updateStaticStats()
|
||||
|
||||
local name = "Heavy Cannon /* weapon name*/"%_T
|
||||
|
||||
local Pen = rand:getInt(0, rarity.value)
|
||||
if Pen > 0 then
|
||||
weapon.blockPenetration = Pen
|
||||
name = "Cumulative Heavy Cannon /* weapon name*/"%_T
|
||||
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], e.g. Enduring Dual Coaxial Plasmatic Tri-R-Mining Laser T-F */"%_T, outerAdjective, barrel, coax, dmgAdjective, multishot, name, serial)
|
||||
|
||||
return result
|
||||
end
|
||||
|
||||
generatorFunction[WeaponType.HeavyCannon] = TurretGenerator.generateHeavyCannonTurret
|
||||
|
||||
|
||||
function TurretGenerator.generateDiffuserTurret(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.generateDiffuser(rand, dps, tech, material, rarity)
|
||||
weapon.damage = weapon.damage / numWeapons
|
||||
|
||||
-- attach weapons to turret
|
||||
TurretGenerator.attachWeapons(rand, result, weapon, numWeapons)
|
||||
|
||||
local rechargeTime = 20 * rand:getFloat(0.8, 1.2)
|
||||
local shootingTime = 15 * rand:getFloat(0.8, 1.2)
|
||||
TurretGenerator.createBatteryChargeCooling(result, rechargeTime, shootingTime)
|
||||
|
||||
|
||||
TurretGenerator.scale(rand, result, WeaponType.Diffuser, tech, 0.75)
|
||||
local specialties = TurretGenerator.addSpecialties(rand, result, WeaponType.Diffuser)
|
||||
|
||||
result.slotType = TurretSlotType.Armed
|
||||
result:updateStaticStats()
|
||||
|
||||
local name = "Diffusor /* weapon name*/"%_T
|
||||
|
||||
local dmgAdjective, outerAdjective, barrel, multishot, coax, serial = makeTitleParts(rand, specialties, result, DamageType.Energy)
|
||||
result.title = Format("%1%%2%%3%%4%%5%%6%%7% /* [outer-adjective][barrel][coax][dmg-adjective][multishot][name][serial], e.g. Enduring Dual Coaxial Plasmatic Tri-R-Mining Laser T-F */"%_T, outerAdjective, barrel, coax, dmgAdjective, multishot, name, serial)
|
||||
|
||||
return result
|
||||
end
|
||||
|
||||
generatorFunction[WeaponType.Diffuser] = TurretGenerator.generateDiffuserTurret
|
||||
|
||||
|
||||
function TurretGenerator.generateHookgunTurret(rand, dps, tech, material, rarity)
|
||||
local result = TurretTemplate()
|
||||
|
||||
-- generate turret
|
||||
local requiredCrew = TurretGenerator.dpsToRequiredCrew(dps)
|
||||
local crew = Crew()
|
||||
crew:add(requiredCrew*2, CrewMan(CrewProfessionType.Gunner))
|
||||
result.crew = crew
|
||||
|
||||
-- generate weapons
|
||||
local numWeapons = rand:getInt(1, 2)
|
||||
|
||||
local weapon = WeaponGenerator.generateHookgun(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.Hookgun, tech, 0.75)
|
||||
local specialties = TurretGenerator.addSpecialties(rand, result, WeaponType.Hookgun)
|
||||
|
||||
result.slotType = TurretSlotType.Armed
|
||||
result:updateStaticStats()
|
||||
|
||||
local name = "Hookgun /* weapon name*/"%_T
|
||||
|
||||
local specType = 0
|
||||
if specType >0 then
|
||||
|
||||
else
|
||||
|
||||
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], e.g. Enduring Dual Coaxial Plasmatic Tri-R-Mining Laser T-F */"%_T, outerAdjective, barrel, coax, dmgAdjective, multishot, name, serial)
|
||||
|
||||
return result
|
||||
end
|
||||
|
||||
generatorFunction[WeaponType.Hookgun] = TurretGenerator.generateHookgunTurret
|
||||
|
||||
function TurretGenerator.generateHiveLauncherTurret(rand, dps, tech, material, rarity)
|
||||
local result = TurretTemplate()
|
||||
|
||||
-- generate turret
|
||||
local requiredCrew = TurretGenerator.dpsToRequiredCrew(dps)
|
||||
local crew = Crew()
|
||||
crew:add(requiredCrew*2, CrewMan(CrewProfessionType.Gunner))
|
||||
result.crew = crew
|
||||
|
||||
-- generate weapons
|
||||
local numWeapons = rand:getInt(1, 2)
|
||||
|
||||
local weapon = WeaponGenerator.generateHiveLauncher(rand, dps, tech, material, rarity)
|
||||
weapon.damage = weapon.damage / numWeapons
|
||||
|
||||
-- attach weapons to turret
|
||||
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
|
||||
|
||||
-- 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.RocketLauncher, tech, 0.6, coaxialAllowed)
|
||||
local specialties = TurretGenerator.addSpecialties(rand, result, WeaponType.RocketLauncher)
|
||||
|
||||
result.slotType = TurretSlotType.Armed
|
||||
result:updateStaticStats()
|
||||
|
||||
local name = "HiveLauncher /* weapon name*/"%_T
|
||||
|
||||
local specType = 0
|
||||
if specType >0 then
|
||||
|
||||
else
|
||||
|
||||
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], e.g. Enduring Dual Coaxial Plasmatic Tri-R-Mining Laser T-F */"%_T, outerAdjective, barrel, coax, dmgAdjective, multishot, name, serial)
|
||||
|
||||
return result
|
||||
end
|
||||
|
||||
generatorFunction[WeaponType.HiveLauncher] = TurretGenerator.generateHiveLauncherTurret
|
||||
|
||||
@@ -1,45 +1,56 @@
|
||||
|
||||
TurretIngredients[WeaponType.SmartCannon] =
|
||||
{
|
||||
{name = "Servo", amount = 15, investable = 10, minimum = 5, weaponStat = "fireRate", investFactor = 1.0, changeType = StatChanges.Percentage},
|
||||
{name = "Warhead", amount = 5, investable = 6, minimum = 1, weaponStat = "damage", },
|
||||
{name = "High Pressure Tube", amount = 2, investable = 6, minimum = 1, weaponStat = "reach", },
|
||||
{name = "Ammunition M", amount = 2, investable = 4, minimum = 1, weaponStat = "damage", investFactor = 0.5,},
|
||||
{name = "Targeting Card", amount = 3, investable = 3, minimum = 0, weaponStat = "seeker", investFactor = 1, changeType = StatChanges.Flat},
|
||||
{name = "Steel", amount = 8, investable = 10, minimum = 3,},
|
||||
{name = "Steel Tube", amount = 5, investable = 10, minimum = 3,},
|
||||
-- {name = "Targeting System", amount = 0, investable = 2, minimum = 0, turretStat = "automatic", investFactor = 1, changeType = StatChanges.Flat},
|
||||
}
|
||||
|
||||
TurretIngredients[WeaponType.HeavyCannon] =
|
||||
{
|
||||
{name = "Servo", amount = 8, investable = 8, minimum = 4, weaponStat = "fireRate", investFactor = 1.0, changeType = StatChanges.Percentage},
|
||||
{name = "Warhead", amount = 5, investable = 6, minimum = 1, weaponStat = "damage", },
|
||||
{name = "High Pressure Tube", amount = 2, investable = 6, minimum = 1, weaponStat = "reach", },
|
||||
{name = "Ammunition", amount = 5, investable = 10, minimum = 3, weaponStat = "damage", investFactor = 0.2,},
|
||||
{name = "Steel", amount = 20, investable = 10, minimum = 20,},
|
||||
{name = "Metal Plate", amount = 8, investable = 10, minimum = 10,},
|
||||
-- {name = "Targeting System", amount = 0, investable = 2, minimum = 0, turretStat = "automatic", investFactor = 1, changeType = StatChanges.Flat},
|
||||
}
|
||||
|
||||
TurretIngredients[WeaponType.Diffuser] =
|
||||
{
|
||||
{name = "Plasma Cell", amount = 10, investable = 10, minimum = 10, weaponStat = "fireRate", investFactor = 1.0, changeType = StatChanges.Percentage},
|
||||
{name = "High Capacity Lens", amount = 5, investable = 6, minimum = 1, weaponStat = "reach", },
|
||||
{name = "Energy Tube", amount = 2, investable = 6, minimum = 1, weaponStat = "damage", },
|
||||
{name = "Steel", amount = 20, investable = 0, minimum = 20,},
|
||||
{name = "Copper", amount = 10, investable = 0, minimum = 10,},
|
||||
{name = "Silver", amount = 5, investable = 0, minimum = 5,},
|
||||
-- {name = "Targeting System", amount = 0, investable = 2, minimum = 0, turretStat = "automatic", investFactor = 1, changeType = StatChanges.Flat},
|
||||
}
|
||||
|
||||
TurretIngredients[WeaponType.Hookgun] =
|
||||
{
|
||||
{name = "Plasma Cell", amount = 10, investable = 10, minimum = 10, weaponStat = "fireRate", investFactor = 1.0, changeType = StatChanges.Percentage},
|
||||
{name = "High Capacity Lens", amount = 5, investable = 6, minimum = 1, weaponStat = "reach", },
|
||||
{name = "Energy Tube", amount = 2, investable = 6, minimum = 1, weaponStat = "damage", },
|
||||
{name = "Steel", amount = 20, investable = 0, minimum = 20,},
|
||||
{name = "Copper", amount = 10, investable = 0, minimum = 10,},
|
||||
{name = "Silver", amount = 5, investable = 0, minimum = 5,},
|
||||
-- {name = "Targeting System", amount = 0, investable = 2, minimum = 0, turretStat = "automatic", investFactor = 1, changeType = StatChanges.Flat},
|
||||
}
|
||||
|
||||
TurretIngredients[WeaponType.SmartCannon] =
|
||||
{
|
||||
{name = "Servo", amount = 15, investable = 10, minimum = 5, weaponStat = "fireRate", investFactor = 1.0, changeType = StatChanges.Percentage},
|
||||
{name = "Warhead", amount = 5, investable = 6, minimum = 1, weaponStat = "damage", },
|
||||
{name = "High Pressure Tube", amount = 2, investable = 6, minimum = 1, weaponStat = "reach", },
|
||||
{name = "Ammunition M", amount = 2, investable = 4, minimum = 1, weaponStat = "damage", investFactor = 0.5,},
|
||||
{name = "Targeting Card", amount = 3, investable = 3, minimum = 0, weaponStat = "seeker", investFactor = 1, changeType = StatChanges.Flat},
|
||||
{name = "Steel", amount = 8, investable = 10, minimum = 3,},
|
||||
{name = "Steel Tube", amount = 5, investable = 10, minimum = 3,},
|
||||
-- {name = "Targeting System", amount = 0, investable = 2, minimum = 0, turretStat = "automatic", investFactor = 1, changeType = StatChanges.Flat},
|
||||
}
|
||||
|
||||
TurretIngredients[WeaponType.HeavyCannon] =
|
||||
{
|
||||
{name = "Servo", amount = 8, investable = 8, minimum = 4, weaponStat = "fireRate", investFactor = 1.0, changeType = StatChanges.Percentage},
|
||||
{name = "Warhead", amount = 5, investable = 6, minimum = 1, weaponStat = "damage", },
|
||||
{name = "High Pressure Tube", amount = 2, investable = 6, minimum = 1, weaponStat = "reach", },
|
||||
{name = "Ammunition", amount = 5, investable = 10, minimum = 3, weaponStat = "damage", investFactor = 0.2,},
|
||||
{name = "Steel", amount = 20, investable = 10, minimum = 20,},
|
||||
{name = "Metal Plate", amount = 8, investable = 10, minimum = 10,},
|
||||
-- {name = "Targeting System", amount = 0, investable = 2, minimum = 0, turretStat = "automatic", investFactor = 1, changeType = StatChanges.Flat},
|
||||
}
|
||||
|
||||
TurretIngredients[WeaponType.Diffuser] =
|
||||
{
|
||||
{name = "Plasma Cell", amount = 10, investable = 10, minimum = 10, weaponStat = "fireRate", investFactor = 1.0, changeType = StatChanges.Percentage},
|
||||
{name = "High Capacity Lens", amount = 5, investable = 6, minimum = 1, weaponStat = "reach", },
|
||||
{name = "Energy Tube", amount = 2, investable = 6, minimum = 1, weaponStat = "damage", },
|
||||
{name = "Steel", amount = 20, investable = 0, minimum = 20,},
|
||||
{name = "Copper", amount = 10, investable = 0, minimum = 10,},
|
||||
{name = "Silver", amount = 5, investable = 0, minimum = 5,},
|
||||
-- {name = "Targeting System", amount = 0, investable = 2, minimum = 0, turretStat = "automatic", investFactor = 1, changeType = StatChanges.Flat},
|
||||
}
|
||||
|
||||
TurretIngredients[WeaponType.Hookgun] =
|
||||
{
|
||||
{name = "Plasma Cell", amount = 10, investable = 10, minimum = 10, weaponStat = "fireRate", investFactor = 1.0, changeType = StatChanges.Percentage},
|
||||
{name = "High Capacity Lens", amount = 5, investable = 6, minimum = 1, weaponStat = "reach", },
|
||||
{name = "Energy Tube", amount = 2, investable = 6, minimum = 1, weaponStat = "damage", },
|
||||
{name = "Steel", amount = 20, investable = 0, minimum = 20,},
|
||||
{name = "Copper", amount = 10, investable = 0, minimum = 10,},
|
||||
{name = "Silver", amount = 5, investable = 0, minimum = 5,},
|
||||
-- {name = "Targeting System", amount = 0, investable = 2, minimum = 0, turretStat = "automatic", investFactor = 1, changeType = StatChanges.Flat},
|
||||
}
|
||||
|
||||
TurretIngredients[WeaponType.HiveLauncher] =
|
||||
{
|
||||
{name = "Plasma Cell", amount = 10, investable = 10, minimum = 10, weaponStat = "fireRate", investFactor = 1.0, changeType = StatChanges.Percentage},
|
||||
{name = "High Capacity Lens", amount = 5, investable = 6, minimum = 1, weaponStat = "reach", },
|
||||
{name = "Energy Tube", amount = 2, investable = 6, minimum = 1, weaponStat = "damage", },
|
||||
{name = "Steel", amount = 20, investable = 0, minimum = 20,},
|
||||
{name = "Copper", amount = 10, investable = 0, minimum = 10,},
|
||||
{name = "Silver", amount = 5, investable = 0, minimum = 5,},
|
||||
-- {name = "Targeting System", amount = 0, investable = 2, minimum = 0, turretStat = "automatic", investFactor = 1, changeType = StatChanges.Flat},
|
||||
}
|
||||
|
||||
@@ -46,6 +46,7 @@ end
|
||||
generatorFunction[WeaponType.SmartCannon] = WeaponGenerator.generateSmartCannon
|
||||
|
||||
|
||||
|
||||
function WeaponGenerator.generateHeavyCannon(rand, dps, tech, material, rarity)
|
||||
local weapon = Weapon()
|
||||
weapon:setProjectile()
|
||||
@@ -91,6 +92,7 @@ end
|
||||
generatorFunction[WeaponType.HeavyCannon] = WeaponGenerator.generateHeavyCannon
|
||||
|
||||
|
||||
|
||||
function WeaponGenerator.generateDiffuser(rand, dps, tech, material, rarity)
|
||||
local weapon = Weapon()
|
||||
weapon:setBeam()
|
||||
@@ -192,3 +194,54 @@ function WeaponGenerator.generateHookgun(rand, dps, tech, material, rarity)
|
||||
end
|
||||
|
||||
generatorFunction[WeaponType.Hookgun] = WeaponGenerator.generateHookgun
|
||||
|
||||
|
||||
|
||||
function WeaponGenerator.generateHiveLauncher(rand, dps, tech, material, rarity)
|
||||
local weapon = Weapon()
|
||||
weapon:setProjectile()
|
||||
|
||||
local fireDelay = rand:getFloat(0.5, 1.5)
|
||||
local reach = rand:getFloat(1300, 1800)
|
||||
local damage = dps * fireDelay
|
||||
local speed = rand:getFloat(150, 200)
|
||||
local existingTime = reach / speed
|
||||
|
||||
weapon.fireDelay = fireDelay
|
||||
weapon.reach = reach
|
||||
weapon.appearanceSeed = rand:getInt()
|
||||
weapon.seeker = rand:test(1 / 8)
|
||||
weapon.appearance = WeaponAppearance.RocketLauncher
|
||||
weapon.name = "HiveLauncher /* Weapon Name*/"%_t
|
||||
weapon.prefix = "HiveLauncher /* Weapon Prefix*/"%_t
|
||||
weapon.icon = "data/textures/icons/hivelauncher.png"
|
||||
weapon.sound = "cannon"
|
||||
weapon.accuracy = 0.99 - rand:getFloat(0, 0.02)
|
||||
|
||||
weapon.damage = damage
|
||||
weapon.damageType = DamageType.Physical
|
||||
weapon.impactParticles = ImpactParticles.Explosion
|
||||
weapon.impactSound = 1
|
||||
weapon.impactExplosion = true
|
||||
|
||||
weapon.psize = rand:getFloat(0.2, 0.4)
|
||||
weapon.pmaximumTime = existingTime
|
||||
weapon.pvelocity = speed
|
||||
weapon.pcolor = ColorHSV(rand:getFloat(10, 60), 0.7, 1)
|
||||
weapon.pshape = ProjectileShape.Rocket
|
||||
|
||||
if rand:test(1) then
|
||||
local shots = {2, 2, 2, 2, 2, 3, 4}
|
||||
weapon.shotsFired = shots[rand:getInt(1, #shots)]
|
||||
weapon.damage = (weapon.damage * 1.5) / weapon.shotsFired
|
||||
end
|
||||
|
||||
WeaponGenerator.adaptWeapon(rand, weapon, tech, material, rarity)
|
||||
|
||||
weapon.recoil = weapon.damage * 2
|
||||
weapon.explosionRadius = math.sqrt(weapon.damage * 5)
|
||||
|
||||
return weapon
|
||||
end
|
||||
|
||||
generatorFunction[WeaponType.HiveLauncher] = WeaponGenerator.generateHiveLauncher
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
|
||||
WeaponTypes.addType("SmartCannon", "Smart Сannon /* Weapon Type */"%_t, armed)
|
||||
WeaponTypes.addType("HeavyCannon", "Heavy Cannon /* Weapon Type */"%_t, armed)
|
||||
WeaponTypes.addType("Diffuser", "Diffuser /* Weapon Type */"%_t, armed)
|
||||
WeaponTypes.addType("Hookgun", "Hookgun /* Weapon Type */"%_t, armed)
|
||||
|
||||
WeaponTypes.addType("SmartCannon", "Smart Сannon /* Weapon Type */"%_t, armed)
|
||||
WeaponTypes.addType("HeavyCannon", "Heavy Cannon /* Weapon Type */"%_t, armed)
|
||||
WeaponTypes.addType("Diffuser", "Diffuser /* Weapon Type */"%_t, armed)
|
||||
WeaponTypes.addType("Hookgun", "Hookgun /* Weapon Type */"%_t, armed)
|
||||
WeaponTypes.addType("HiveLauncher", "HiveLauncher /* Weapon Type */"%_t, armed)
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 36 KiB After Width: | Height: | Size: 37 KiB |
BIN
data/textures/icons/railgun.png
Normal file
BIN
data/textures/icons/railgun.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 36 KiB |
Reference in New Issue
Block a user