Skip to content

Commit

Permalink
Critical APCs/SMES tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
EgorDinamit committed Feb 13, 2024
1 parent 520623c commit a94cfc6
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 24 deletions.
3 changes: 2 additions & 1 deletion code/game/gamemodes/events/power_failure.dm
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
GLOB.using_map.grid_check_announcement()

for(var/obj/machinery/power/smes/buildable/S in SSmachines.machinery)
S.energy_fail(rand(15 * severity,30 * severity))
if(!S.is_critical)
S.energy_fail(rand(15 * severity,30 * severity))


for(var/obj/machinery/power/apc/C in SSmachines.machinery)
Expand Down
8 changes: 3 additions & 5 deletions code/modules/events/electrical_storm.dm
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
..()
valid_apcs = list()
for(var/obj/machinery/power/apc/A in SSmachines.machinery)
if(A.is_critical)
continue
if(A.z in affecting_z)
valid_apcs.Add(A)
endWhen = (severity * 60) + startWhen
Expand Down Expand Up @@ -63,11 +65,7 @@
T.emagged = TRUE
T.update_icon()

if(T.is_critical)
T.energy_fail(10 * severity)
continue
else
T.energy_fail(10 * severity * rand(severity * 2, severity * 4))
T.energy_fail(10 * severity * rand(severity * 2, severity * 4))

// Very tiny chance to completely break the APC. Has a check to ensure we don't break critical APCs such as the Engine room, or AI core. Does not occur on Mundane severity.
if(prob((0.2 * severity) - 0.2))
Expand Down
8 changes: 5 additions & 3 deletions code/modules/power/smes.dm
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
stat_immune = 0
stat = BROKEN // Should be removed if the terminals initialize fully.
reason_broken = MACHINE_BROKEN_GENERIC

machine_name = "superconductive magnetic energy storage"
machine_desc = "The SMES is effectively a giant battery. It stores vast quantities of power for later use, and can be remotely controlled using the RCON system."

Expand Down Expand Up @@ -59,6 +59,8 @@
var/name_tag = null
var/num_terminals = 0 // internal bookkeeping for number of connected terminals
var/should_be_mapped = 0 // If this is set to 0 it will send out warning on New()
/// If TRUE - will be unaffected by power failure event
var/is_critical = FALSE

/obj/machinery/power/smes/drain_power(var/drain_check, var/surge, var/amount = 0)

Expand Down Expand Up @@ -175,9 +177,9 @@
var/is_input_available = FALSE
for(var/obj/item/stock_parts/power/terminal/term in power_components)
if(!term.terminal || !term.terminal.powernet)
continue
continue
is_input_available = TRUE
term.terminal.powernet.smes_demand += target_load
term.terminal.powernet.smes_demand += target_load
term.terminal.powernet.inputting.Add(src)
if(!is_input_available)
target_load = 0 // We won't input any power without powernet connection.
Expand Down
31 changes: 16 additions & 15 deletions maps/intrepid/intrepid2.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -2204,7 +2204,8 @@
dir = 8
},
/obj/machinery/power/smes/buildable/preset/torch/engine_main{
RCon_tag = "Singularity to Substations"
RCon_tag = "Singularity to Substations";
is_critical = 1
},
/obj/structure/cable/orange,
/turf/simulated/floor/tiled/techmaint,
Expand Down Expand Up @@ -9354,9 +9355,9 @@
dir = 4
},
/obj/machinery/door/airlock/engineering{
autoset_access = 0;
name = "Bluespace Drive Access";
req_access = list("ACCESS_ENGINE_EQUIP");
autoset_access = 0
req_access = list("ACCESS_ENGINE_EQUIP")
},
/obj/structure/cable/green{
d1 = 4;
Expand Down Expand Up @@ -9597,8 +9598,8 @@
"wF" = (
/obj/machinery/door/firedoor,
/obj/machinery/door/airlock/multi_tile/engineering{
name = "Engineering Lounge";
autoset_access = 0;
name = "Engineering Lounge";
req_access = list("ACCESS_ENGINE_EQUIP")
},
/obj/machinery/atmospherics/pipe/simple/hidden/supply,
Expand Down Expand Up @@ -10829,9 +10830,9 @@
icon_state = "1-2"
},
/obj/machinery/door/airlock/engineering{
autoset_access = 0;
name = "Engineering Equipment";
req_access = list("ACCESS_ENGINE_EQUIP");
autoset_access = 0
req_access = list("ACCESS_ENGINE_EQUIP")
},
/turf/simulated/floor/tiled/techfloor/grid,
/area/intrepid/department/engineering/lockerroom)
Expand Down Expand Up @@ -11277,10 +11278,10 @@
/area/intrepid/misc/maint/upper/central)
"AK" = (
/obj/machinery/button/blast_door{
pixel_y = -22;
dir = 1;
id_tag = "cargoexport";
name = "Cargo Exports Beacon access button"
name = "Cargo Exports Beacon access button";
pixel_y = -22
},
/turf/simulated/floor,
/area/intrepid/misc/maint/upper/starboard)
Expand Down Expand Up @@ -12125,8 +12126,8 @@
icon_state = "1-2"
},
/obj/machinery/door/airlock/glass/engineering{
name = "Engineering Lounge";
autoset_access = 0;
name = "Engineering Lounge";
req_access = list("ACCESS_ENGINE_EQUIP")
},
/turf/simulated/floor/tiled/techfloor/grid,
Expand Down Expand Up @@ -14479,8 +14480,8 @@
},
/obj/item/cell/standard,
/obj/item/cell/standard{
pixel_y = 9;
pixel_x = -3
pixel_x = -3;
pixel_y = 9
},
/turf/simulated/floor/bluegrid,
/area/intrepid/department/command/robocontrol)
Expand Down Expand Up @@ -17116,9 +17117,9 @@
icon_state = "6-10"
},
/obj/machinery/door/airlock/glass/engineering{
autoset_access = 0;
name = "Shield Control Access";
req_access = list("ACCESS_ENGINE_EQUIP");
autoset_access = 0
req_access = list("ACCESS_ENGINE_EQUIP")
},
/turf/simulated/floor/tiled/techfloor/grid,
/area/intrepid/department/engineering/shieldcontrol)
Expand Down Expand Up @@ -20243,9 +20244,9 @@
/obj/effect/floor_decal/borderfloorblack,
/obj/machinery/button/blast_door{
dir = 8;
pixel_x = 22;
id_tag = "cargoexport";
name = "Cargo Exports Beacon access button"
name = "Cargo Exports Beacon access button";
pixel_x = 22
},
/obj/machinery/computer/modular/preset/cardslot/supply{
dir = 8
Expand Down

0 comments on commit a94cfc6

Please sign in to comment.