F13 Faction Power Grid: generators, relays, breakers, and maintenance hazards#433
Draft
Malerus wants to merge 5 commits into
Draft
F13 Faction Power Grid: generators, relays, breakers, and maintenance hazards#433Malerus wants to merge 5 commits into
Malerus wants to merge 5 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
About The Pull Request
Adds a complete modular F13 Faction Power Grid system, replacing the flat always-on area power model with a wired generator → relay → junction box chain that factions must actively maintain. The system is designed to work with both indoor faction bases (flood-fill zone discovery) and outdoor wasteland setups (range-limited direct stamping).
videoplayback.1775440442079.publer.com.mp4
Generator Variants
/faction_generator/diesel) — Industrial CP-8800 unit, 750W flat output, 1440L tank (~48 min full). Fuelled by pouring diesel from any reagent container./faction_generator/atomic) — Poseidon PEAG-5, 1500W flat, single atomic fuel cell chamber (~22 min/cell). Highest output, rarest fuel./faction_generator/wastelander) — Jury-rigged diesel unit for outdoor/wasteland use. No flood-fill: powers lights within 10 tiles of the generator and any wired relay in reach. Uses the same wired relay/breaker infrastructure as the vault-tec grid, just range-limited.Grid Components
/power_relay/wasteland) — Scavenged relay post; same as a standard relay but auto-stamps lights within its own 10-tile radius instead of flooding an area datum. Usable as a range extender for the wastelander generator./power_relay/breaker_box) — Inline manual cutoff panel. Wire it between the generator and downstream devices; clicking it cuts or restores everything downstream without touching the generator. Respectsmanually_trippedso upstream power-restore cascades from the generator can never silently re-enable a breaker a player deliberately opened.Maintenance & Safety Risks
All generator variants track a maintenance interval (~15 min). Failing to service with a wrench while running escalates hazards specific to the generator type:
Additional hazards across all types:
heat_exposure; thresholds triggerfire_act()(diesel: sustained fire + neighbour spread; atomic: containment breach + wide radiation pulse).Button-in-Wall Fix
Door/access buttons mounted on wall tiles (which are typically in
/area/spacerather than the stamped zone) now correctly respond to F13 grid power changes.power_change()on/area/f13now explicitly sweeps closed tiles adjacent to the area and notifies buttons there. Both the generator'sstamp_zone()and the wasteland relay maintain abutton_sweep_cacheof border space-tiles so each power toggle reaches those buttons without re-scanning the whole area.F13 Turret Power Integration
F13 turrets now check
area.f13_grid_powerfor their power state in non-immune, non-outdoor areas, so they go offline when a generator is down.Vault Floor Tile Fix
Crowbarring and replacing vault floor tiles now correctly preserves the exact tile subtype and
icon_state.ChangeTurfretainsicon_statewhen the source and destination share the same DMI file;f13_vaultplating and tile items carrysaved_turf_typeto recreate the exact subtype on re-placement.Fuel Reagent Spills
/datum/reagent/fuelnow creates a slippery oil decal when spilled on a turf (≥5 volume), matching diesel drain and tank fire behaviour.New Area Subtypes
Adds granular sub-areas for Enclave, AHS, NCR, Legion, and Followers factions (barracks, armory, command, medical, etc.). Adds
outdoors = 1 / open_space = 1to forest and wildland areas,requires_power = TRUEto sewers, and a/wasteland/cold/poweredalias for map compatibility.Admin Tools
The
master_breakerdebug tool gains a full per-area power panel (toggle individual F13 areas live) and a newF13 Area Power Paneladmin verb. Four in-game paper manuals are spawnable for player/mapper reference (Vault-Tec fusion, CPS diesel, Poseidon atomic, wastelander field guide by Wade Tucker).Pre-Merge Checklist
Changelog
🆑
add: Added the F13 Faction Power Grid system generators, relays, junction boxes, breakers, and core fabricators now form a wired power chain factions must actively run and maintain.
add: Added four generator variants: fusion core (pre-War, 2000W), diesel (industrial, 750W), atomic (Poseidon, 1500W), and jury-rigged wastelander (diesel, 500W, range-limited outdoor use).
add: Added a wasteland relay post and breaker box as grid extension and manual cutoff components for the wastelander generator.
add: Added per-generator maintenance intervals: generators require a wrench service every ~15 minutes while running or risk escalating type-specific hazards (fire, radiation, auto-trip).
add: Added active safety hazards to generators water electrocution, arc flash on live refuelling, wirecutters shock on live cable, heat ignition from open flames, CO exhaust poisoning indoors from diesel.
add: Added atomic fuel cell item for the Poseidon atomic generator.
add: Added four in-game operator manuals for each generator variant (spawnable paper items).
add: F13 turrets now go offline when the grid supplying their area is down.
add: Added admin F13 Area Power Panel for per-area grid debugging.
add: Added new faction sub-area types for Enclave, AHS, NCR, Legion, and Followers.
fix: Fixed door/access buttons on wall tiles (in /area/space) not responding to F13 grid power changes.
fix: Fixed junction boxes in outdoor/wasteland areas lighting every light of that area type across the entire map outdoor stamping is now range-limited to the box's immediate vicinity.
fix: Fixed the breaker box not holding its OFF state when the generator cascades a power-on signal downstream.
fix: Fixed vault floor tiles not restoring the correct subtype and appearance when crowbarred and re-placed.
fix: Fuel reagent now creates a slippery oil decal when spilled on a turf.
tweak: Diesel generator enforces a 30-second hot-refuel cooldown after shutdown.
tweak: Diesel drain captures fuel into a held container; excess spills on the floor.
code: Generator fuel system is fully abstracted (accepted_fuel_path, fuel_is_liquid, fuel_per_unit, watts_per_fuel_unit) new generator variants only need to set vars and override hazard callbacks.
/:cl: