diff options
Diffstat (limited to 'data/weapons.lua')
| -rw-r--r-- | data/weapons.lua | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/data/weapons.lua b/data/weapons.lua new file mode 100644 index 0000000..8fd2a6b --- /dev/null +++ b/data/weapons.lua @@ -0,0 +1,47 @@ +-- Weapon definitions (values scaled from Forts' data to our world units). +-- Build modes / firing read the global `Weapons` array; mods may FindWeapon(). + +Weapons = +{ + { + name = "cannon", -- ballistic artillery (arcs under gravity) + muzzle_speed = 38, -- launch speed (units/s); Forts MuzzleSpeed 6000 cm/s + reload = 2.0, -- seconds between shots + splash_damage = 200, -- Forts StructureSplashDamage 200 + splash_radius = 3.0, -- Forts 150 cm ~= 3 units + knockback = 55, -- Forts KickbackMean 40 (impulse) + projectile_radius = 0.18, + fire_chance = 0.25, -- Forts cannon is incendiary (~25%) + min_fire_angle = -20, -- firing arc (degrees, rel. to mount) — Forts MinFireAngle + max_fire_angle = 30, -- Forts MaxFireAngle + energy_cost = 120, -- energy per shot (Forts EnergyFireCost) + texture = "data/textures/weapon_turret.png", + projectile_texture = "data/textures/projectile_laser.png", + }, + { + name = "laser", -- line-of-sight beam; ignites what it hits + is_beam = true, + reload = 3.0, -- seconds between beams (Forts ReloadTime) + beam_range = 70, -- max beam length (units) + beam_dps = 90, -- HP/s to the struck strut + beam_duration = 1.5, -- Forts BeamDuration 1.5 + fire_chance = 1.0, -- laser ALWAYS ignites (its whole point) + min_fire_angle = -20, -- Forts laser MinFireAngle -20 + max_fire_angle = 45, -- Forts laser MaxFireAngle 45 + energy_cost = 200, -- beam is energy-hungry + texture = "data/textures/weapon_turret.png", + }, +} + +function IndexOfWeapon(name) + for i, w in ipairs(Weapons) do + if w.name == name then return i end + end + return nil +end + +function FindWeapon(name) + local i = IndexOfWeapon(name) + if i then return Weapons[i] end + return nil +end |
