From c217861ab62987b798835194786dc99424e1804e Mon Sep 17 00:00:00 2001 From: "Emil A. Overbeck" Date: Sun, 19 Jul 2026 03:14:53 +0200 Subject: Recoil and armor --- data/materials.lua | 27 +++++++++++++++++++++++++-- data/weapons.lua | 3 +++ 2 files changed, 28 insertions(+), 2 deletions(-) (limited to 'data') diff --git a/data/materials.lua b/data/materials.lua index 3725aa9..b88a1da 100644 --- a/data/materials.lua +++ b/data/materials.lua @@ -1,7 +1,7 @@ -- Base building materials for the clone. -- --- The engine reads the global `Materials` array (in order). Build modes 1/2/3 --- map to entries 1/2/3. Mods under data/mods/ run AFTER this file and may use +-- The engine reads the global `Materials` array (in order). Build modes 1-4 +-- map to entries 1-4. Mods under data/mods/ run AFTER this file and may use -- FindMaterial(name) to tweak these, or table.insert(Materials, ...) to add new -- ones. (angle_threshold is in DEGREES; the engine converts to radians.) @@ -17,6 +17,7 @@ Materials = flammable = true, burn_rate = 15, spread_time = 2.0, -- wood: slow burn/spread blocks_projectiles = true, blocks_beam = true, -- solid: stops shells & beams half_width = 0.15, + cost_metal = 5, cost_energy = 25, -- Forts wood 0.1 / 0.5 color = { 1.0, 1.0, 1.0, 1.0 }, -- white = show texture untinted texture = "data/textures/wood.png", texture_forts = "forts:materials/wood_panel.tga", @@ -31,6 +32,7 @@ Materials = flammable = true, burn_rate = 22, spread_time = 0.7, -- burns ~3x faster than wood blocks_projectiles = false, blocks_beam = false, -- shells AND beams pass through (beam still burns it) half_width = 0.15, + cost_metal = 5, cost_energy = 25, color = { 1.0, 1.0, 1.0, 0.45 }, -- translucent texture = "data/textures/bgbrace.png", texture_forts = "forts:materials/bracing-bg.tga", @@ -45,10 +47,31 @@ Materials = flammable = true, burn_rate = 25, spread_time = 1.0, -- burns through fast blocks_projectiles = false, blocks_beam = false, -- shells AND beams pass through half_width = 0.04, + cost_metal = 5, cost_energy = 25, color = { 0.72, 0.66, 0.55, 1.0 }, -- tan: tints the cable art, and is -- the visible rope when it is absent texture_forts = "forts:materials/cable.tga", }, + -- Appended LAST on purpose: build modes map to this array by index, so a new + -- material goes on the end (key 4) rather than shifting bg-brace and rope. + { + name = "armour", -- the kinetic tank + -- Forts armor: 25% stiffer than wood, 2x the mass, HP 400, and it does + -- NOT catch fire (its Fire deg/s is n/a). 3 wood (450 HP) still beats + -- 1 armour (400 HP), so armour buys durability per strut, not per metal. + stiffness = 750, damping = 12, mass = 0.5, + max_compression = 0.90, max_expansion = 1.10, -- same +/-10% as wood + angle_threshold = 30, tension_only = false, + min_length = 0.4, max_length = 3.0, max_link_length = 6.0, + hit_points = 400, + flammable = false, burn_rate = 0, spread_time = 0, -- metal: never burns + blocks_projectiles = true, blocks_beam = true, -- solid + half_width = 0.18, -- reads chunkier than wood + cost_metal = 90, cost_energy = 75, -- Forts 1.8 / 1.5, i.e. + -- 18x wood metal, 3x energy + color = { 0.62, 0.66, 0.70, 1.0 }, -- steel (also the fallback) + texture_forts = "forts:materials/armor.tga", + }, } -- Helpers mods can use (mirrors the Forts modding API shape). diff --git a/data/weapons.lua b/data/weapons.lua index a6e23d5..98b7464 100644 --- a/data/weapons.lua +++ b/data/weapons.lua @@ -15,6 +15,8 @@ Weapons = 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", @@ -31,6 +33,7 @@ Weapons = 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", }, -- cgit v1.3