From e7ff9f893130bc04f3a17ffde3a5eb0dd9b906c9 Mon Sep 17 00:00:00 2001 From: Mykhailo Bykhovtsev Date: Tue, 29 Jan 2019 04:23:35 -0800 Subject: [PATCH] Making certain SMES and Blast Doors be critical + remapping Tesla APC and SM blast doors (#5993) --- code/game/gamemodes/events/power_failure.dm | 3 +- code/game/machinery/doors/blast_door.dm | 9 +++-- code/modules/power/smes.dm | 1 + html/changelogs/Sindorman-fix.yml | 44 +++++++++++++++++++++ maps/aurora/aurora-3_sublevel.dmm | 36 +++++++++++------ maps/aurora/aurora-4_mainlevel.dmm | 6 +++ 6 files changed, 81 insertions(+), 18 deletions(-) create mode 100644 html/changelogs/Sindorman-fix.yml diff --git a/code/game/gamemodes/events/power_failure.dm b/code/game/gamemodes/events/power_failure.dm index dccfe8b47e5..dde28a5bde9 100644 --- a/code/game/gamemodes/events/power_failure.dm +++ b/code/game/gamemodes/events/power_failure.dm @@ -4,7 +4,8 @@ command_announcement.Announce("Abnormal activity detected in [station_name()]'s powernet. As a precautionary measure, the station's power will be shut off for an indeterminate duration.", "Critical Power Failure", new_sound = 'sound/AI/poweroff.ogg') for(var/obj/machinery/power/smes/buildable/S in SSpower.smes_units) - 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 SSmachinery.processing_machines) diff --git a/code/game/machinery/doors/blast_door.dm b/code/game/machinery/doors/blast_door.dm index 98016fde656..1cae2450a0b 100644 --- a/code/game/machinery/doors/blast_door.dm +++ b/code/game/machinery/doors/blast_door.dm @@ -35,7 +35,8 @@ var/_wifi_id var/datum/wifi/receiver/button/door/wifi_receiver - var/securitylock = 0 + var/securitylock = FALSE + var/is_critical = FALSE /obj/machinery/door/blast/Initialize() . = ..() @@ -182,14 +183,14 @@ /obj/machinery/door/blast/power_change() ..() - if(src.operating || (stat & BROKEN)) + if(src.operating || (stat & BROKEN) || is_critical) return if(stat & NOPOWER) INVOKE_ASYNC(src, /obj/machinery/door/blast/.proc/force_close) - securitylock = 1 + securitylock = TRUE else if(securitylock) INVOKE_ASYNC(src, /obj/machinery/door/blast/.proc/force_open) - securitylock = 0 + securitylock = FALSE /obj/machinery/door/blast/attack_hand(mob/user as mob) return diff --git a/code/modules/power/smes.dm b/code/modules/power/smes.dm index 1315c43fc69..03ae73449a3 100644 --- a/code/modules/power/smes.dm +++ b/code/modules/power/smes.dm @@ -55,6 +55,7 @@ var/input_pulsed = 0 var/output_cut = 0 var/output_pulsed = 0 + var/is_critical = FALSE // Use by gridcheck event, if set to true we do not disable it var/failure_timer = 0 // Set by gridcheck event, temporarily disables the SMES. var/target_load = 0 var/open_hatch = 0 diff --git a/html/changelogs/Sindorman-fix.yml b/html/changelogs/Sindorman-fix.yml new file mode 100644 index 00000000000..b6cddb5d3b4 --- /dev/null +++ b/html/changelogs/Sindorman-fix.yml @@ -0,0 +1,44 @@ +################################ +# Example Changelog File +# +# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb. +# +# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.) +# When it is, any changes listed below will disappear. +# +# Valid Prefixes: +# bugfix +# wip (For works in progress) +# tweak +# soundadd +# sounddel +# rscadd (general adding of nice things) +# rscdel (general deleting of nice things) +# imageadd +# imagedel +# maptweak +# spellcheck (typo fixes) +# experiment +# balance +# admin +# backend +# security +# refactor +################################# + +# Your name. +author: PoZe + +# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again. +delete-after: True + +# Any changes you've made. See valid prefix list above. +# INDENT WITH TWO SPACES. NOT TABS. SPACES. +# SCREW THIS UP AND IT WON'T WORK. +# Also, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries. +# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog. +changes: + - tweak: "SMES can no be marked on map as critical, which will exclude them in power grid check event. Tesla and SM engine SMES are now marked as critical." + - tweak: "Blast doors can now be mapped as critical, which will prevent them from being affected if area lost power, they will remain in same state as they were." + - maptweak: "SM emergency ventilation blast door is labeled as critical. Same goes for reactor blast doors. They are no longer affected by power loss." + - maptweak: "Tesla Engine APC was remapped and is no connected to the Tesla Engine SMES instead of main SMES. Tesla Engine SMES max default input/output was increased by 150kW to account for the new APC connected, since PA eats lots of power." diff --git a/maps/aurora/aurora-3_sublevel.dmm b/maps/aurora/aurora-3_sublevel.dmm index cd54eec74bc..edcfc3e2138 100644 --- a/maps/aurora/aurora-3_sublevel.dmm +++ b/maps/aurora/aurora-3_sublevel.dmm @@ -1003,6 +1003,9 @@ "acm" = ( /obj/machinery/power/smes/buildable{ charge = 2e+006; + input_level_max = 350000; + is_critical = 1; + output_level_max = 350000; RCon_tag = "Tesla - Containment" }, /obj/structure/cable{ @@ -3024,18 +3027,6 @@ pixel_x = 0; pixel_y = 36 }, -/obj/machinery/power/apc{ - cell_type = /obj/item/weapon/cell/super; - dir = 1; - is_critical = 1; - name = "north bump"; - pixel_x = 0; - pixel_y = 24 - }, -/obj/structure/cable{ - icon_state = "0-4"; - d2 = 4 - }, /turf/simulated/floor/plating, /area/outpost/engineering/power) "agF" = ( @@ -4133,6 +4124,11 @@ d2 = 8; icon_state = "2-8" }, +/obj/structure/cable/yellow{ + d1 = 2; + d2 = 4; + icon_state = "2-4" + }, /turf/simulated/floor/plating, /area/outpost/engineering/power) "aiO" = ( @@ -30755,6 +30751,20 @@ }, /turf/simulated/floor/tiled/white, /area/medical/patient_wing_post1) +"wzY" = ( +/obj/machinery/light, +/obj/machinery/power/apc{ + dir = 2; + is_critical = 1; + name = "south bump"; + pixel_y = -24 + }, +/obj/structure/cable/yellow{ + d2 = 8; + icon_state = "0-8" + }, +/turf/simulated/floor/plating, +/area/outpost/engineering/power) "wLc" = ( /turf/simulated/floor/tiled/white, /area/medical/patient_wing_gym) @@ -43016,7 +43026,7 @@ agE ace aiu ace -afR +wzY abJ ajQ afM diff --git a/maps/aurora/aurora-4_mainlevel.dmm b/maps/aurora/aurora-4_mainlevel.dmm index 3dfccea0a14..fb9372fade0 100644 --- a/maps/aurora/aurora-4_mainlevel.dmm +++ b/maps/aurora/aurora-4_mainlevel.dmm @@ -9817,6 +9817,7 @@ charge = 2e+006; input_attempt = 1; input_level = 100000; + is_critical = 1; output_attempt = 1; output_level = 200000; RCon_tag = "Supermatter - Containment" @@ -10796,6 +10797,7 @@ dir = 4; icon_state = "pdoor0"; id = "SupermatterPort"; + is_critical = 1; layer = 2.7; name = "Reactor Blast Door"; opacity = 0 @@ -10814,6 +10816,7 @@ dir = 4; icon_state = "pdoor0"; id = "SupermatterPort"; + is_critical = 1; layer = 2.7; name = "Reactor Blast Door"; opacity = 0 @@ -10836,6 +10839,7 @@ dir = 4; icon_state = "pdoor0"; id = "SupermatterPort"; + is_critical = 1; layer = 2.7; name = "Reactor Blast Door"; opacity = 0 @@ -12636,6 +12640,7 @@ dir = 4; icon_state = "pdoor1"; id = "EngineVent"; + is_critical = 1; name = "Reactor Vent"; p_open = 0 }, @@ -12686,6 +12691,7 @@ dir = 1; icon_state = "pdoor0"; id = "SupermatterPort"; + is_critical = 1; layer = 2.7; name = "Reactor Blast Door"; opacity = 0