# modules.toml
#
# Production tree v2: all weapons are railguns for now — the implementation
# (instant damage, no projectile, no ammunition) stays as-is and the beam
# visual reads as a tracer round. Lasers are reserved for a future distinct
# weapon type (see docs/content_design.md, "Production tree v2 — Weapons").
# Combat stats are placeholders until the arena balancing pass;
# production_time_seconds values come from the numbers pass.
#
# Unlock gating is defined in unlocks.toml, not here (REQ-LOCK-EXPLICIT): a
# module id granted by an unlock group starts locked and is awarded via a
# defence station drop; ids absent from unlocks.toml (railgun_s) start unlocked.
#
# Surface mask footprint ladder — footprints gate which hulls can mount a
# module, purely through geometry (see ships.toml for the matching hull
# grids):
#
#   1x1       railgun_s, salvager, repair_tool        fits every hull, incl. drones
#   1x2       maneuvering_thrusters, sensor_booster,
#             armor_plates                            frigate and up
#   1x3       afterburner                             frigate and up (eats most of a frigate)
#   L-shape   weapon_stabilizer, weapon_primer,
#             weapon_upgrade                          frigate and up
#   2x2       railgun_m, drone_bay                    cruiser and up (no 2x2 area on s hulls)
#   3x3       railgun_l                               battleship and up (no 3x3 area on m hulls)
#   2x6       drone_hangar                            carrier only

# -----------------------------------------------------------------------------
# Weapons
# -----------------------------------------------------------------------------

[[module]]
id = "railgun_s"
tooltip = "Small railgun. Fast-firing, short range, low damage; fits any hull."
surface_mask = ["O"]
materials = [{item = "railgun_s_module", amount = 1}]
production_time_seconds = 1
fill_color = "#FF8040"
glyph = "Rs"

[module.weapon]
damage = 2
attack_range_m = 50
attack_rate_hz = 2.0


[[module]]
id = "railgun_m"
tooltip = "Medium railgun. Higher damage at longer range; needs a 2x2 slot."
surface_mask = [
    "OO",
    "OO"]
materials = [{item = "railgun_m_module", amount = 1}]
production_time_seconds = 3
fill_color = "#FF8040"
glyph = "Rm"

[module.weapon]
damage = 14
attack_range_m = 70
attack_rate_hz = 1.5


[[module]]
id = "railgun_l"
tooltip = "Large railgun. Heavy damage at long range; needs a 3x3 slot."
surface_mask = [
    "OOO",
    "OOO",
    "OOO"]
materials = [{item = "railgun_l_module", amount = 1}]
production_time_seconds = 4
fill_color = "#FF8040"
glyph = "Rl"

[module.weapon]
damage = 52
attack_range_m = 100
attack_rate_hz = 0.8

# -----------------------------------------------------------------------------
# Utility tools
# -----------------------------------------------------------------------------

[[module]]
id = "salvager"
tooltip = "Collects scrap from wrecks and stores it in the ship's cargo hold."
surface_mask = ["O"]
materials = [{item = "salvager_module", amount = 1}]
production_time_seconds = 1
fill_color = "#AACC44"
glyph = "Sv"

[module.salvage]
collection_range_m = 60
cargo_capacity = 20
collection_rate_hz = 0.5


[[module]]
id = "repair_tool"
tooltip = "Repairs damaged friendly ships and defence stations within range."
surface_mask = ["O"]
materials = [{item = "repair_tool_module", amount = 1}]
production_time_seconds = 1
fill_color = "#66CCFF"
glyph = "Rp"

[module.repair]
repair_rate_hz = 1
repair_amount_hp = 4
repair_range_m = 80

# -----------------------------------------------------------------------------
# Propulsion
# -----------------------------------------------------------------------------

[[module]]
id = "afterburner"
tooltip = "Greatly boosts top speed and forward acceleration."
surface_mask = ["OOO"]
materials = [{item = "afterburner_module", amount = 1}]
production_time_seconds = 1
fill_color = "#40A0FF"
glyph = "Ab"

[module.movement]
multiplied_speed_mps = 1.6
added_main_acceleration_mpss = 60


[[module]]
id = "maneuvering_thrusters"
tooltip = "Improves top speed and lateral/braking acceleration."
surface_mask = ["OO"]
materials = [{item = "maneuvering_thrusters_module", amount = 1}]
production_time_seconds = 1
fill_color = "#40A0FF"
glyph = "Mt"

[module.movement]
multiplied_speed_mps = 1.2
added_maneuvering_acceleration_mpss = 10

# -----------------------------------------------------------------------------
# Defense & sensors
# -----------------------------------------------------------------------------

[[module]]
id = "armor_plates"
tooltip = "Adds a large flat bonus to the ship's hit points."
surface_mask = ["OO"]
materials = [{item = "armor_plates_module", amount = 1}]
production_time_seconds = 1
fill_color = "#808080"
glyph = "A"

[module.health]
added_hp = 1200


[[module]]
id = "sensor_booster"
tooltip = "Extends the ship's sensor range."
surface_mask = ["OO"]
materials = [{item = "sensor_booster_module", amount = 1}]
production_time_seconds = 1
fill_color = "#40A0FF"
glyph = "S"

[module.sensor]
added_sensor_range_m = 50

# -----------------------------------------------------------------------------
# Weapon modifiers
# -----------------------------------------------------------------------------

[[module]]
id = "weapon_upgrade"
tooltip = "Increases the damage of all weapons on the ship."
surface_mask = [
    "OO",
    "OX",
]
materials = [{item = "weapon_upgrade_module", amount = 1}]
production_time_seconds = 2
fill_color = "#FF4040"
glyph = "Wu"

[module.weapon]
multiplied_damage = 1.2


[[module]]
id = "weapon_primer"
tooltip = "Increases the fire rate of all weapons on the ship."
surface_mask = [
    "OO",
    "OX",
]
materials = [{item = "weapon_primer_module", amount = 1}]
production_time_seconds = 2
fill_color = "#FF4040"
glyph = "Wp"

[module.weapon]
multiplied_attack_rate_hz = 1.2


[[module]]
id = "weapon_stabilizer"
tooltip = "Extends weapon range at the cost of some fire rate."
surface_mask = [
    "OO",
    "OX",
]
materials = [{item = "weapon_stabilizer_module", amount = 1}]
production_time_seconds = 1
fill_color = "#FF4040"
glyph = "Ws"

[module.weapon]
multiplied_attack_range_m = 1.3
multiplied_attack_rate_hz = 0.8

# -----------------------------------------------------------------------------
# Drone modules
#
# Footprint-only placeholders: the drone launching capability is not
# implemented yet, so these modules define no capability section.
# -----------------------------------------------------------------------------

[[module]]
id = "drone_bay"
tooltip = "Drone launch bay (capability not yet implemented)."
surface_mask = [
    "OO",
    "OO"]
materials = [{item = "drone_bay_module", amount = 1}]
production_time_seconds = 3
fill_color = "#CC66FF"
glyph = "Db"


[[module]]
id = "drone_hangar"
tooltip = "Large drone hangar (capability not yet implemented)."
surface_mask = [
    "OOOOOO",
    "OOOOOO"]
materials = [{item = "drone_hangar_module", amount = 1}]
production_time_seconds = 6
fill_color = "#9933CC"
glyph = "Dh"
