1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
-- 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)
recoil = 12, -- kick shoved back into the firing fort
-- (Forts Recoil). Tune in the Dev panel.
texture = "data/textures/weapon_turret.png",
projectile_texture = "data/textures/projectile_laser.png",
texture_forts = "forts:weapons/cannon/base.tga",
projectile_texture_forts = "forts:weapons/media/CannonShell.tga",
},
{
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
recoil = 0, -- a beam has no kickback
texture = "data/textures/weapon_turret.png",
texture_forts = "forts:weapons/beamlaser/base.tga",
},
}
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
|