diff options
Diffstat (limited to 'data/devices.lua')
| -rw-r--r-- | data/devices.lua | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/data/devices.lua b/data/devices.lua new file mode 100644 index 0000000..e5309dc --- /dev/null +++ b/data/devices.lua @@ -0,0 +1,48 @@ +-- Device catalog (reactor / mine / turbine / battery). Values scaled from Forts' +-- devices/*.lua. `texture` may use a "forts:REL" path to load real art from your +-- own Forts install at runtime (nothing copyrighted is stored in the repo); if +-- the game isn't present it falls back to the flat `color`. + +DeviceDefs = +{ + { + name = "reactor", is_core = true, -- the core: lose it and the round ends + hp = 100, -- Forts reactor HP 100 (fragile) + energy_rate = 100, metal_rate = 5, -- also the base generator + half_w = 0.7, half_h = 0.9, + texture = "forts:devices/reactor/reactor_core01.tga", + color = { 0.3, 1.0, 0.5 }, + }, + { + name = "turbine", wind = true, -- energy scales with height above ground + hp = 60, wind_max_rate = 16, wind_max_height = 22, + half_w = 0.5, half_h = 1.3, + cost_metal = 30, cost_energy = 50, + texture = "forts:devices/windturbine/base.tga", + color = { 0.6, 0.8, 1.0 }, + }, + { + name = "mine", needs_deposit = true, -- only produces on a metal deposit + hp = 80, energy_rate = -5, metal_rate = 4, -- Forts mine: -5 e, +4 metal + half_w = 0.6, half_h = 0.5, + cost_metal = 0, cost_energy = 100, + texture = "", + color = { 0.75, 0.55, 0.2 }, + }, + { + name = "battery", -- energy storage + hp = 100, energy_storage = 2000, -- Forts battery cap 2000 + half_w = 0.6, half_h = 0.6, + cost_metal = 20, cost_energy = 100, + texture = "", + color = { 0.9, 0.85, 0.3 }, + }, +} + +function IndexOfDevice(name) + for i, d in ipairs(DeviceDefs) do if d.name == name then return i end end + return nil +end +function FindDevice(name) + local i = IndexOfDevice(name); if i then return DeviceDefs[i] end; return nil +end |
