diff options
Diffstat (limited to 'data')
| -rw-r--r-- | data/devices.lua | 48 | ||||
| -rw-r--r-- | data/map.lua | 13 | ||||
| -rw-r--r-- | data/materials.lua | 62 | ||||
| -rw-r--r-- | data/mods/enemy-fort/map.lua | 3 | ||||
| -rw-r--r-- | data/mods/enemy-fort/mod.lua | 4 | ||||
| -rw-r--r-- | data/mods/enemy-fort/structures.lua | 19 | ||||
| -rw-r--r-- | data/structures.lua | 5 | ||||
| -rw-r--r-- | data/textures/CREDITS.md | 23 | ||||
| -rw-r--r-- | data/textures/bgbrace.png | bin | 0 -> 1561 bytes | |||
| -rw-r--r-- | data/textures/deposit.png | bin | 0 -> 597 bytes | |||
| -rw-r--r-- | data/textures/ground.png | bin | 0 -> 753 bytes | |||
| -rw-r--r-- | data/textures/projectile_laser.png | bin | 0 -> 744 bytes | |||
| -rw-r--r-- | data/textures/reactor_enemy.png | bin | 0 -> 638 bytes | |||
| -rw-r--r-- | data/textures/reactor_player.png | bin | 0 -> 636 bytes | |||
| -rw-r--r-- | data/textures/weapon_gun.png | bin | 0 -> 446 bytes | |||
| -rw-r--r-- | data/textures/weapon_turret.png | bin | 0 -> 825 bytes | |||
| -rw-r--r-- | data/textures/wood.png | bin | 0 -> 1213 bytes | |||
| -rw-r--r-- | data/weapons.lua | 47 |
18 files changed, 224 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 diff --git a/data/map.lua b/data/map.lua new file mode 100644 index 0000000..13f9c94 --- /dev/null +++ b/data/map.lua @@ -0,0 +1,13 @@ +-- Base scenario map: metal deposits and pre-placed devices. Mods append (the +-- enemy-fort mod adds the enemy reactor). Coordinates are world units; y ~ 1 is +-- the ground surface. +Deposits = Deposits or {} +MapDevices = MapDevices or {} + +-- Metal deposits (mines must sit on these). Player side (left) + enemy side (right). +for _, x in ipairs({ -24, -11, 23, 31 }) do + table.insert(Deposits, { x, 1.0 }) +end + +-- Player reactor on the left. +table.insert(MapDevices, { type = "reactor", x = -22, y = 2.0, team = 0 }) diff --git a/data/materials.lua b/data/materials.lua new file mode 100644 index 0000000..a2f876c --- /dev/null +++ b/data/materials.lua @@ -0,0 +1,62 @@ +-- 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 +-- FindMaterial(name) to tweak these, or table.insert(Materials, ...) to add new +-- ones. (angle_threshold is in DEGREES; the engine converts to radians.) + +Materials = +{ + { + name = "wood", + stiffness = 600, damping = 12, mass = 0.25, + max_compression = 0.90, max_expansion = 1.10, -- snaps past +/-10% length + angle_threshold = 30, tension_only = false, -- snaps if a loose strut rotates >30deg + min_length = 0.4, max_length = 3.0, max_link_length = 6.0, -- single-strut size limits + hit_points = 150, + 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, + color = { 1.0, 1.0, 1.0, 1.0 }, -- white = show texture untinted + texture = "data/textures/wood.png", + }, + { + name = "bgbrace", -- background bracing + stiffness = 600, damping = 12, mass = 0.25, + max_compression = 0.92, max_expansion = 1.08, + angle_threshold = 30, tension_only = false, + min_length = 0.4, max_length = 3.0, max_link_length = 6.0, + hit_points = 100, + 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, + color = { 1.0, 1.0, 1.0, 0.45 }, -- translucent + texture = "data/textures/bgbrace.png", + }, + { + name = "rope", + stiffness = 150, damping = 8, mass = 0.05, + max_compression = 0.0, max_expansion = 1.50, -- slack in compression, snaps at +50% + angle_threshold = 360, tension_only = true, -- never snaps on angle + min_length = 0.8, max_length = 1.5, max_link_length = 20.0, -- subdivides into many segments -> drapes + hit_points = 50, + 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, + color = { 0.15, 0.12, 0.10, 1.0 }, + }, +} + +-- Helpers mods can use (mirrors the Forts modding API shape). +function IndexOfMaterial(name) + for i, m in ipairs(Materials) do + if m.name == name then return i end + end + return nil +end + +function FindMaterial(name) + local i = IndexOfMaterial(name) + if i then return Materials[i] end + return nil +end diff --git a/data/mods/enemy-fort/map.lua b/data/mods/enemy-fort/map.lua new file mode 100644 index 0000000..443b74b --- /dev/null +++ b/data/mods/enemy-fort/map.lua @@ -0,0 +1,3 @@ +-- The enemy fort's reactor (team 1). Sits inside the fort (columns x=25..29). +-- Destroy it to win. +table.insert(MapDevices, { type = "reactor", x = 27, y = 3.0, team = 1 }) diff --git a/data/mods/enemy-fort/mod.lua b/data/mods/enemy-fort/mod.lua new file mode 100644 index 0000000..b2bc990 --- /dev/null +++ b/data/mods/enemy-fort/mod.lua @@ -0,0 +1,4 @@ +-- Scenario mod: a prebuilt enemy fort on the right for the player to shoot at. +Selectable = true +Priority = 5 +Category = "Scenario" diff --git a/data/mods/enemy-fort/structures.lua b/data/mods/enemy-fort/structures.lua new file mode 100644 index 0000000..ce6bdd0 --- /dev/null +++ b/data/mods/enemy-fort/structures.lua @@ -0,0 +1,19 @@ +-- A triangulated wooden fort on the right side (columns at x=25,27,29; rows at +-- y=1,3,5). Foundations sit on the ground (y=1). All beams <= 3 units so they +-- obey the material length limits. Shoot it apart with the cannon. +table.insert(Structures, { + name = "enemy fort", + beams = { + -- verticals + {25,1,25,3,"wood"}, {25,3,25,5,"wood"}, + {27,1,27,3,"wood"}, {27,3,27,5,"wood"}, + {29,1,29,3,"wood"}, {29,3,29,5,"wood"}, + -- horizontals + {25,1,27,1,"wood"}, {27,1,29,1,"wood"}, + {25,3,27,3,"wood"}, {27,3,29,3,"wood"}, + {25,5,27,5,"wood"}, {27,5,29,5,"wood"}, + -- diagonals (triangulation, so it's rigid) + {25,1,27,3,"wood"}, {27,1,29,3,"wood"}, + {25,3,27,5,"wood"}, {27,3,29,5,"wood"}, + }, +}) diff --git a/data/structures.lua b/data/structures.lua new file mode 100644 index 0000000..f7d88f2 --- /dev/null +++ b/data/structures.lua @@ -0,0 +1,5 @@ +-- Base scenario structures. Empty by default; mods under data/mods/ append to +-- the global `Structures` list. Each structure is: +-- { name = "...", beams = { {x1,y1,x2,y2,material}, ... } } +-- The loader creates/merges nodes at the endpoints and welds the beams. +Structures = Structures or {} diff --git a/data/textures/CREDITS.md b/data/textures/CREDITS.md new file mode 100644 index 0000000..3c4ce4a --- /dev/null +++ b/data/textures/CREDITS.md @@ -0,0 +1,23 @@ +# Placeholder texture credits + +All placeholder art here is **CC0 1.0 (public domain)** by **Kenney** — https://kenney.nl +(no attribution required; credited anyway). Pulled from the mirror +https://github.com/iwenzhou/kenney. + +| File | Source pack | Original | +|------|-------------|----------| +| wood.png | Platformer pack (Base) | Tiles/box.png | +| bgbrace.png | Platformer pack (Base) | Tiles/boxAlt.png | +| ground.png | Platformer pack (Base) | Tiles/dirtCenter.png | +| weapon_gun.png | Space Shooter (300) | Parts/gun07.png | +| weapon_turret.png | Space Shooter (300) | Parts/turretBase_big.png | +| projectile_laser.png | Space Shooter (300) | Lasers/laserBlue01.png | + +These are temporary placeholders. Replace with original art before release. + +Third-party code: `third_party/stb/stb_image*.h` — public domain (stb, Sean Barrett). + +## M5 devices (added) +| reactor_player.png | Platformer (Base) | Items/gemGreen.png | +| reactor_enemy.png | Platformer (Base) | Items/gemRed.png | +| deposit.png | Platformer (Base) | Items/gemYellow.png | diff --git a/data/textures/bgbrace.png b/data/textures/bgbrace.png Binary files differnew file mode 100644 index 0000000..1da31f0 --- /dev/null +++ b/data/textures/bgbrace.png diff --git a/data/textures/deposit.png b/data/textures/deposit.png Binary files differnew file mode 100644 index 0000000..0e4b4db --- /dev/null +++ b/data/textures/deposit.png diff --git a/data/textures/ground.png b/data/textures/ground.png Binary files differnew file mode 100644 index 0000000..d8e173f --- /dev/null +++ b/data/textures/ground.png diff --git a/data/textures/projectile_laser.png b/data/textures/projectile_laser.png Binary files differnew file mode 100644 index 0000000..b76aaf7 --- /dev/null +++ b/data/textures/projectile_laser.png diff --git a/data/textures/reactor_enemy.png b/data/textures/reactor_enemy.png Binary files differnew file mode 100644 index 0000000..deb5cb0 --- /dev/null +++ b/data/textures/reactor_enemy.png diff --git a/data/textures/reactor_player.png b/data/textures/reactor_player.png Binary files differnew file mode 100644 index 0000000..9e9c3f6 --- /dev/null +++ b/data/textures/reactor_player.png diff --git a/data/textures/weapon_gun.png b/data/textures/weapon_gun.png Binary files differnew file mode 100644 index 0000000..209b40b --- /dev/null +++ b/data/textures/weapon_gun.png diff --git a/data/textures/weapon_turret.png b/data/textures/weapon_turret.png Binary files differnew file mode 100644 index 0000000..e9747f7 --- /dev/null +++ b/data/textures/weapon_turret.png diff --git a/data/textures/wood.png b/data/textures/wood.png Binary files differnew file mode 100644 index 0000000..7471ed7 --- /dev/null +++ b/data/textures/wood.png 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 |
