Delam suppression system refactor (#3898)

## About The Pull Request

Code cleanup and refactors the delam suppression system. Instead of a
guaranteed heal of the crystal and flooding the room with a freon fire,
the suppression system will try its best to suppress the delam,
alternatively minimizing the explosion size of the delam through cooling
it.

- Orange alert threshold moved from 95% to 40%. (70% on skeleton crew)
- Reduced amount of freon in the system by half
- Windows in the SM chamber no longer explode when the system is
activated
- Various minor timing adjustments to fit the new system purpose
- Penalty to delam counter highscore reduced to 50% from 100%

## Why It's Good For The Game

The freon flood/fire in the engine room is pain in the ass busywork.
Instead, minimizing the size of the delam explosion keeps it mostly
contained to the engine room while also being a logical type of cleanup
associated with a delam.

Example of a minimized explosion:

![image](https://github.com/user-attachments/assets/f75964b3-7eee-4a94-bfb5-71c5a5135c87)

## Changelog

🆑 LT3
balance: Windows in the SM chamber no longer explode when the
suppression system is activated
balance: Reduced amount of freon in the delam suppression system by half
balance: Penalty to delam counter highscore reduced to 50% from 100%
qol: Automatic alert for delams fires later into the delam progress.
fix: The delam sound effect stops if the delam is saved during the 15
second countdown
fix: Partially delaminated supermatter crystal heat modifier actually
works
/🆑
This commit is contained in:
LT3
2025-05-27 21:15:36 -07:00
committed by GitHub
parent bbe7f1d1df
commit ef427fa77b
8 changed files with 144 additions and 146 deletions

View File

@@ -1,2 +0,0 @@
/// Reason for delam suppression: admin command
#define DIVINE_INTERVENTION 3

View File

@@ -0,0 +1,7 @@
// Reasons for delam suppression
/// player button push
#define SCRAM_TRIGGER_PUSHED "trigger_pushed"
/// integrity hit minimum
#define SCRAM_AUTO_FIRE "auto_fire"
/// admin fuckery
#define SCRAM_DIVINE_INTERVENTION "divine_intervention"

View File

@@ -1,3 +1,5 @@
#define SUPERMATTER_SUPPRESSION_THRESHOLD 98.4 // BUBBER EDIT ADDITION - DELAM_SCRAM
//Ported from /vg/station13, which was in turn forked from baystation12; //Ported from /vg/station13, which was in turn forked from baystation12;
//Please do not bother them with bugs from this port, however, as it has been modified quite a bit. //Please do not bother them with bugs from this port, however, as it has been modified quite a bit.
//Modifications include removing the world-ending full supermatter variation, and leaving only the shard. //Modifications include removing the world-ending full supermatter variation, and leaving only the shard.
@@ -78,6 +80,8 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal)
var/explosion_point = 100 var/explosion_point = 100
///Are we exploding? ///Are we exploding?
var/final_countdown = FALSE var/final_countdown = FALSE
///Have we fired delam suppression?
var/suppression_fired = FALSE // BUBBER EDIT ADDITION - DELAM_SCRAM
///A scaling value that affects the severity of explosions. ///A scaling value that affects the severity of explosions.
var/explosion_power = 35 var/explosion_power = 35
///Time in 1/10th of seconds since the last sent warning ///Time in 1/10th of seconds since the last sent warning
@@ -254,7 +258,7 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal)
QDEL_NULL(radio) QDEL_NULL(radio)
QDEL_NULL(countdown) QDEL_NULL(countdown)
if(is_main_engine && GLOB.main_supermatter_engine == src) if(is_main_engine && GLOB.main_supermatter_engine == src)
SSpersistence.reset_delam_counter() // SKYRAT EDIT ADDITION BEGIN - DELAM SCRAM SSpersistence.delam_counter_penalty() // SKYRAT EDIT ADDITION BEGIN - DELAM SCRAM
GLOB.main_supermatter_engine = null GLOB.main_supermatter_engine = null
QDEL_NULL(soundloop) QDEL_NULL(soundloop)
return ..() return ..()
@@ -339,9 +343,16 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal)
damage_factors = calculate_damage() damage_factors = calculate_damage()
if(damage == 0) // Clear any in game forced delams if on full health. if(damage == 0) // Clear any in game forced delams if on full health.
set_delam(SM_DELAM_PRIO_IN_GAME, SM_DELAM_STRATEGY_PURGE) set_delam(SM_DELAM_PRIO_IN_GAME, SM_DELAM_STRATEGY_PURGE)
station_notified = FALSE // BUBBER EDIT ADDITION - DELAM_SCRAM
else if(!final_countdown) else if(!final_countdown)
set_delam(SM_DELAM_PRIO_NONE, SM_DELAM_STRATEGY_PURGE) // This one cant clear any forced delams. set_delam(SM_DELAM_PRIO_NONE, SM_DELAM_STRATEGY_PURGE) // This one cant clear any forced delams.
delamination_strategy.delam_progress(src) delamination_strategy.delam_progress(src)
// BUBBER EDIT ADDITION BEGIN - DELAM_SCRAM
if(damage > SUPERMATTER_SUPPRESSION_THRESHOLD && is_main_engine && !suppression_fired)
investigate_log("Integrity at time of suppression signal was [100 - damage]", INVESTIGATE_ENGINE)
SEND_GLOBAL_SIGNAL(COMSIG_MAIN_SM_DELAMINATING, SCRAM_AUTO_FIRE)
suppression_fired = TRUE
// BUBBER EDIT ADDITION END
if(damage > explosion_point && !final_countdown) if(damage > explosion_point && !final_countdown)
count_down() count_down()
@@ -580,8 +591,6 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal)
final_countdown = TRUE final_countdown = TRUE
INVOKE_ASYNC(src, PROC_REF(final_announcement)) // BUBBER EDIT ADDITION - DELAM SOUNDS INVOKE_ASYNC(src, PROC_REF(final_announcement)) // BUBBER EDIT ADDITION - DELAM SOUNDS
if(is_main_engine) // BUBBER EDIT ADDITION - DELAM_SCRAM
SEND_GLOBAL_SIGNAL(COMSIG_MAIN_SM_DELAMINATING, final_countdown) // BUBBER EDIT ADDITION - DELAM_SCRAM
notify_ghosts( notify_ghosts(
"[src] has begun the delamination process!", "[src] has begun the delamination process!",
@@ -639,7 +648,10 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal)
if(isanimal_or_basicmob(lucky_engi)) if(isanimal_or_basicmob(lucky_engi))
continue continue
LAZYADD(saviors, WEAKREF(lucky_engi)) LAZYADD(saviors, WEAKREF(lucky_engi))
// BUBBER EDIT ADDITION BEGIN - DELAM_SCRAM
for(var/mob/player as anything in GLOB.player_list)
SEND_SOUND(player, sound(null)) // stop our long ass delam sound
// BUBBER EDIT ADDITION END
return // delam averted return // delam averted
sleep(1 SECONDS) sleep(1 SECONDS)
@@ -1124,3 +1136,5 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal)
#undef MACHINERY #undef MACHINERY
#undef OBJECT #undef OBJECT
#undef LOWEST #undef LOWEST
#undef SUPERMATTER_SUPPRESSION_THRESHOLD // BUBBER EDIT ADDITION - DELAM_SCRAM

View File

@@ -37,7 +37,13 @@ GLOBAL_LIST_INIT(sm_delam_list, list(
if(sm.damage <= sm.warning_point) // Damage is too low, lets not if(sm.damage <= sm.warning_point) // Damage is too low, lets not
return FALSE return FALSE
notify_delam_suppression(sm) // SKYRAT EDIT ADDITION - DELAM_SCRAM // BUBBER EDIT ADDITION BEGIN - DELAM_SCRAM
if(!sm.station_notified && sm.damage >= sm.danger_point - 29) // 69%. Nice.
if(SSjob.is_skeleton_engineering(3)) // Notify early for a skeleton crew
notify_delam_suppression(sm)
else if(sm.damage >= sm.danger_point)
notify_delam_suppression(sm)
// BUBBER EDIT ADDITION END
if (sm.damage >= sm.emergency_point && sm.damage_archived < sm.emergency_point) if (sm.damage >= sm.emergency_point && sm.damage_archived < sm.emergency_point)
sm.investigate_log("has entered the emergency point.", INVESTIGATE_ENGINE) sm.investigate_log("has entered the emergency point.", INVESTIGATE_ENGINE)

View File

@@ -22,7 +22,7 @@ ADMIN_VERB(try_stop_delam, R_ADMIN, "Delam Emergency Stop", "Activate the delam
log_admin("[key_name_admin(user)] started a supermatter emergency stop!") log_admin("[key_name_admin(user)] started a supermatter emergency stop!")
message_admins("[ADMIN_LOOKUPFLW(user)] started a supermatter emergency stop! [ADMIN_COORDJMP(suppression_system)]") message_admins("[ADMIN_LOOKUPFLW(user)] started a supermatter emergency stop! [ADMIN_COORDJMP(suppression_system)]")
suppression_system.investigate_log("[key_name_admin(user)] started a supermatter emergency stop!", INVESTIGATE_ATMOS) suppression_system.investigate_log("[key_name_admin(user)] started a supermatter emergency stop!", INVESTIGATE_ATMOS)
SEND_GLOBAL_SIGNAL(COMSIG_MAIN_SM_DELAMINATING, DIVINE_INTERVENTION) SEND_GLOBAL_SIGNAL(COMSIG_MAIN_SM_DELAMINATING, SCRAM_DIVINE_INTERVENTION)
for(var/obj/machinery/door/airlock/escape_route in range(14, suppression_system)) // a little more space here due to positioning for(var/obj/machinery/door/airlock/escape_route in range(14, suppression_system)) // a little more space here due to positioning
if(istype(escape_route, /obj/machinery/door/airlock/command)) if(istype(escape_route, /obj/machinery/door/airlock/command))
continue continue

View File

@@ -2,6 +2,11 @@
/// If admins and the station have been notified according to the delam suppression function /// If admins and the station have been notified according to the delam suppression function
var/station_notified = FALSE var/station_notified = FALSE
/**
* Send a single notification when the main engine integrity is 40% or lower.
* If the round timer is under 30 minutes, we notify admins about
* the automated delam suppression system, cause it'll trigger.
*/
/datum/sm_delam/proc/notify_delam_suppression(obj/machinery/power/supermatter_crystal/sm) /datum/sm_delam/proc/notify_delam_suppression(obj/machinery/power/supermatter_crystal/sm)
if(!sm.is_main_engine) if(!sm.is_main_engine)
return return
@@ -9,22 +14,19 @@
if(sm.station_notified) if(sm.station_notified)
return return
SSsecurity_level.minimum_security_level(SEC_LEVEL_ORANGE, TRUE, FALSE)
var/obj/machinery/announcement_system/system = pick(GLOB.announcement_systems)
system.broadcast("Danger! Crystal hyperstructure integrity faltering! Integrity: [round(sm.get_integrity_percent(), 0.01)]%", list(RADIO_CHANNEL_COMMAND), list(SPAN_COMMAND))
sm.station_notified = TRUE
if(world.time - SSticker.round_start_time > 30 MINUTES) if(world.time - SSticker.round_start_time > 30 MINUTES)
return return
if(SSjob.is_skeleton_engineering(3)) // Don't bother if there's command or a well staffed department, they -should- be paying attention.
var/obj/machinery/announcement_system/system = pick(GLOB.announcement_systems)
SSsecurity_level.minimum_security_level(SEC_LEVEL_ORANGE, TRUE, FALSE) // Give the skeleton crew a warning
system.broadcast("The supermatter delamination early warning system has been triggered due to anomalous conditions. Please investigate the engine as soon as possible.", list(RADIO_CHANNEL_COMMAND))
system.broadcast("In the event of uncontrolled delamination, please consult the documentation packet regarding usage of the supermatter emergency stop button.", list(RADIO_CHANNEL_COMMAND))
system.broadcast("Failure to stabilise the engine may result in an automatic deployment of the suppression system.", list(RADIO_CHANNEL_COMMAND))
log_admin("DELAM: Round timer under 30 minutes! Supermatter will perform an automatic delam suppression at strength 0%.") log_admin("DELAM: Round timer under 30 minutes! Supermatter will perform an automatic delam suppression at strength 0%.")
for(var/client/staff as anything in GLOB.admins) for(var/client/staff as anything in GLOB.admins)
if(staff?.prefs.read_preference(/datum/preference/toggle/comms_notification)) if(staff?.prefs.read_preference(/datum/preference/toggle/comms_notification))
SEND_SOUND(staff, sound('sound/misc/server-ready.ogg')) SEND_SOUND(staff, sound('sound/misc/server-ready.ogg'))
message_admins("<font color='[COLOR_ADMIN_PINK]'>DELAM: Round timer under 30 minutes! [ADMIN_VERBOSEJMP(sm)] will perform an automatic delam suppression once integrity reaches 0%. (<a href='byond://?src=[REF(src)];togglesuppression=yes'>TOGGLE AUTOMATIC INTERVENTION)</a>)</font>") message_admins("<font color='[COLOR_ADMIN_PINK]'>DELAM: Round timer under 30 minutes! [ADMIN_VERBOSEJMP(sm)] will perform an automatic delam suppression once integrity reaches 0%. (<a href='byond://?src=[REF(src)];togglesuppression=yes'>TOGGLE AUTOMATIC INTERVENTION)</a>)</font>")
sm.station_notified = TRUE
/datum/sm_delam/Topic(href, href_list) /datum/sm_delam/Topic(href, href_list)
if(..()) if(..())

View File

@@ -1,31 +1,8 @@
#define SM_PREVENT_EXPLOSION_THRESHOLD 100
#define SM_COOLING_MIXTURE_MOLES 16000
#define SM_COOLING_MIXTURE_TEMP 170
#define DAMAGED_SUPERMATTER_COLOR list(1,0.1,0.2,0, 0,0.9,0.1,0, 0.1,-0.05,0.85,0, 0,0,0,0.9, 0,0,0,0) #define DAMAGED_SUPERMATTER_COLOR list(1,0.1,0.2,0, 0,0.9,0.1,0, 0.1,-0.05,0.85,0, 0,0,0,0.9, 0,0,0,0)
#define MISTAKES_WERE_MADE 0
#define MANUAL_INTERVENTION 0
#define AUTOMATIC_SAFETIES 1
#define BUTTON_PUSHED 0 #define BUTTON_PUSHED 0
#define BUTTON_IDLE 1 #define BUTTON_IDLE 1
#define BUTTON_AWAKE 2 #define BUTTON_AWAKE 2
#define BUTTON_ARMED 3 #define BUTTON_ARMED 3
#define SM_DAMAGED_EXPLOSION_POWER 41
#define SHATTER_DEVASTATION_RANGE 0
#define SHATTER_HEAVY_RANGE 0
#define SHATTER_LIGHT_RANGE 0
#define SHATTER_FLAME_RANGE 3
#define SHATTER_FLASH_RANGE 5
#define SHATTER_MIN_TIME 17 SECONDS
#define SHATTER_MAX_TIME 19 SECONDS
#define EVAC_WARNING_TIMER 3 SECONDS
#define POWER_CUT_MIN_DURATION_SECONDS 21
#define POWER_CUT_MAX_DURATION_SECONDS 23
#define AIR_INJECT_RATE 175
#define BUTTON_SOUND_RANGE 7
#define BUTTON_SOUND_FALLOFF_DISTANCE 7
#define MACHINE_SOUND_RANGE 15
#define MACHINE_RUMBLE_SOUND_RANGE 30
#define MACHINE_SOUND_FALLOFF_DISTANCE 10
/// An atmos device that uses freezing cold air to attempt an emergency shutdown of the supermatter engine /// An atmos device that uses freezing cold air to attempt an emergency shutdown of the supermatter engine
/obj/machinery/atmospherics/components/unary/delam_scram /obj/machinery/atmospherics/components/unary/delam_scram
@@ -42,9 +19,8 @@
pipe_state = "injector" pipe_state = "injector"
resistance_flags = FIRE_PROOF | FREEZE_PROOF | UNACIDABLE resistance_flags = FIRE_PROOF | FREEZE_PROOF | UNACIDABLE
idle_power_usage = BASE_MACHINE_IDLE_CONSUMPTION * 4 idle_power_usage = BASE_MACHINE_IDLE_CONSUMPTION * 4
///Rate of operation of the device (L/s) ///Rate of operation of the device (L/s)
var/volume_rate = AIR_INJECT_RATE var/volume_rate = 175
///weakref to our SM ///weakref to our SM
var/datum/weakref/my_sm var/datum/weakref/my_sm
///Our internal radio ///Our internal radio
@@ -57,10 +33,8 @@
///If someone -really- wants the SM to explode ///If someone -really- wants the SM to explode
var/admin_disabled = FALSE var/admin_disabled = FALSE
/obj/machinery/atmospherics/components/unary/delam_scram/Initialize(mapload) /obj/machinery/atmospherics/components/unary/delam_scram/Initialize(mapload)
. = ..() . = ..()
return INITIALIZE_HINT_LATELOAD return INITIALIZE_HINT_LATELOAD
/obj/machinery/atmospherics/components/unary/delam_scram/post_machine_initialize() /obj/machinery/atmospherics/components/unary/delam_scram/post_machine_initialize()
@@ -132,54 +106,54 @@
if(admin_disabled) if(admin_disabled)
investigate_log("Delam SCRAM tried to activate but an admin disabled it", INVESTIGATE_ATMOS) investigate_log("Delam SCRAM tried to activate but an admin disabled it", INVESTIGATE_ATMOS)
playsound(src, 'sound/machines/compiler/compiler-failure.ogg', 100, FALSE, MACHINE_SOUND_RANGE, ignore_walls = TRUE, use_reverb = TRUE, falloff_distance = MACHINE_SOUND_FALLOFF_DISTANCE) playsound(
radio.talk_into(src, "System fault! Unable to trigger.", warning_channel) source = src,
soundin = 'sound/machines/compiler/compiler-failure.ogg',
vol = 100,
vary = FALSE,
extrarange = 15,
ignore_walls = TRUE,
use_reverb = TRUE,
falloff_distance = 10,
)
radio.talk_into(src, "Suppression system fault! Unable to trigger, software integrity check failed.", warning_channel, list(SPAN_COMMAND))
audible_message(span_danger("[src] makes a series of sad beeps. Someone has corrupted its software!")) audible_message(span_danger("[src] makes a series of sad beeps. Someone has corrupted its software!"))
return FALSE return FALSE
if(world.time - SSticker.round_start_time > 30 MINUTES && trigger_reason != DIVINE_INTERVENTION) if(world.time - SSticker.round_start_time > 30 MINUTES && trigger_reason == SCRAM_TRIGGER_PUSHED)
playsound(src, 'sound/machines/compiler/compiler-failure.ogg', 100, FALSE, MACHINE_SOUND_RANGE, ignore_walls = TRUE, use_reverb = TRUE, falloff_distance = MACHINE_SOUND_FALLOFF_DISTANCE) audible_message(span_danger("[src] makes a series of sad beeps. The internal gas buffer is past its 30 minute expiry... what a feat of engineering!"))
audible_message(span_danger("[src] makes a series of sad beeps. The internal charge only lasts about 30 minutes... what a feat of engineering!"))
investigate_log("Delam SCRAM signal was received but failed precondition check. (Round time or trigger reason)", INVESTIGATE_ATMOS) investigate_log("Delam SCRAM signal was received but failed precondition check. (Round time or trigger reason)", INVESTIGATE_ATMOS)
radio.talk_into(src, "Supermatter delam suppression system fault! Unable to trigger, internal gas mix integrity check failed.", emergency_channel, list(SPAN_COMMAND))
return FALSE return FALSE
return TRUE return TRUE
/// Tells the station (they probably already know) and starts the procedure /// Tells the station (they probably already know) and starts the procedure
/obj/machinery/atmospherics/components/unary/delam_scram/proc/send_warning(source, trigger_reason) /obj/machinery/atmospherics/components/unary/delam_scram/proc/send_warning(source, trigger_reason)
if(trigger_reason == DIVINE_INTERVENTION) investigate_log("Delam SCRAM was activated by [trigger_reason]", INVESTIGATE_ATMOS)
investigate_log("Delam SCRAM was activated by admin intervention", INVESTIGATE_ATMOS)
notify_ghosts( notify_ghosts(
"[src] has been activated!", "[src] has been activated!",
source = src, source = src,
header = "Divine Intervention", header = trigger_reason == SCRAM_DIVINE_INTERVENTION ? "Divine Intervention" : "Mistakes Were Made",
ghost_sound = 'sound/machines/warning-buzzer.ogg',
notify_volume = 75,
)
else
var/reason
switch(trigger_reason)
if(AUTOMATIC_SAFETIES)
reason = "automatic safeties"
if(MANUAL_INTERVENTION)
reason = "manual intervention"
investigate_log("Delam SCRAM was activated by [reason]", INVESTIGATE_ATMOS)
// They're probably already deadchat engineering discussing what you did wrong
notify_ghosts(
"[src] has been activated!",
source = src,
header = "Mistakes Were Made",
ghost_sound = 'sound/machines/warning-buzzer.ogg', ghost_sound = 'sound/machines/warning-buzzer.ogg',
notify_volume = 75, notify_volume = 75,
) )
radio.talk_into(src, "DELAMINATION SUPPRESSION SYSTEM FIRING. EVACUATE THE SUPERMATTER ENGINE ROOM!", emergency_channel) radio.talk_into(src, "Supermatter delamination suppression system triggered!", emergency_channel, list(SPAN_COMMAND))
// fight power with power // fight fire with ~~gasoline~~ freon
addtimer(CALLBACK(src, PROC_REF(put_on_a_show)), EVAC_WARNING_TIMER) addtimer(CALLBACK(src, PROC_REF(put_on_a_show)), 4 SECONDS)
playsound(src, 'sound/announcer/alarm/bloblarm.ogg', 100, FALSE, MACHINE_RUMBLE_SOUND_RANGE, ignore_walls = TRUE, use_reverb = TRUE, falloff_distance = MACHINE_SOUND_FALLOFF_DISTANCE) playsound(
power_fail((EVAC_WARNING_TIMER / 10) + POWER_CUT_MAX_DURATION_SECONDS, (EVAC_WARNING_TIMER / 10) + POWER_CUT_MAX_DURATION_SECONDS) source = src,
soundin = 'sound/announcer/alarm/bloblarm.ogg',
vol = 100,
vary = FALSE,
extrarange = 30,
ignore_walls = TRUE,
use_reverb = TRUE,
falloff_distance = 10,
)
power_fail(duration_min = 27, duration_max = 33)
/// Stop the delamination. Let the fireworks begin /// Stop the delamination. Let the fireworks begin
/obj/machinery/atmospherics/components/unary/delam_scram/proc/put_on_a_show() /obj/machinery/atmospherics/components/unary/delam_scram/proc/put_on_a_show()
@@ -188,8 +162,9 @@
return return
// Fire bell close, that nice 'are we gonna die?' rumble out far // Fire bell close, that nice 'are we gonna die?' rumble out far
investigate_log("Integrity at time of suppression activation was [100 - angry_sm.damage]", INVESTIGATE_ENGINE)
on = TRUE on = TRUE
SSpersistence.reset_delam_counter() SSpersistence.delam_counter_penalty()
alert_sound_to_playing('sound/ambience/earth_rumble/earth_rumble_distant3.ogg', override_volume = TRUE) alert_sound_to_playing('sound/ambience/earth_rumble/earth_rumble_distant3.ogg', override_volume = TRUE)
update_appearance() update_appearance()
@@ -211,55 +186,57 @@
venti_boi.on = FALSE venti_boi.on = FALSE
venti_boi.update_appearance() venti_boi.update_appearance()
// The windows can only protect you for so long // Let the gas work for a few seconds to start the cooling process.
for(var/obj/structure/window/reinforced/plasma/fucked_window in range(3, src)) addtimer(CALLBACK(src, PROC_REF(aftermath)), 2 SECONDS)
addtimer(CALLBACK(fucked_window, TYPE_PROC_REF(/obj/structure/window/reinforced/plasma, shatter_window)), rand(SHATTER_MIN_TIME, SHATTER_MAX_TIME))
// Let the gas work for a few seconds to cool the crystal. If it has damage beyond repair, heal it a bit
addtimer(CALLBACK(src, PROC_REF(prevent_explosion)), 9 SECONDS)
/// Shatter the supermatter chamber windows
/obj/structure/window/reinforced/plasma/proc/shatter_window()
visible_message(span_danger("[src] shatters in the freon fire!"))
explosion(src, SHATTER_DEVASTATION_RANGE, SHATTER_HEAVY_RANGE, SHATTER_LIGHT_RANGE, SHATTER_FLAME_RANGE, SHATTER_FLASH_RANGE)
qdel(src)
/// The valiant little machine falls apart, one time use only! /// The valiant little machine falls apart, one time use only!
/obj/machinery/atmospherics/components/unary/delam_scram/proc/goodbye_friends() /obj/machinery/atmospherics/components/unary/delam_scram/proc/goodbye_friends()
// good job buddy, sacrificing yourself for the greater good // good job buddy, sacrificing yourself for the greater good
playsound(src, 'sound/machines/compiler/compiler-failure.ogg', 100, FALSE, MACHINE_SOUND_RANGE, ignore_walls = TRUE, use_reverb = TRUE, falloff_distance = MACHINE_SOUND_FALLOFF_DISTANCE) playsound(
source = src,
soundin = 'sound/machines/compiler/compiler-failure.ogg',
vol = 100,
vary = FALSE,
extrarange = 15,
ignore_walls = TRUE,
use_reverb = TRUE,
falloff_distance = 10,
)
visible_message(span_danger("[src] beeps a sorrowful melody and collapses into a pile of twisted metal and foam!"), blind_message = span_danger("[src] beeps a sorrowful melody!")) visible_message(span_danger("[src] beeps a sorrowful melody and collapses into a pile of twisted metal and foam!"), blind_message = span_danger("[src] beeps a sorrowful melody!"))
deconstruct(FALSE) deconstruct(FALSE)
/// Drain the internal energy, if the crystal damage is above 100 we heal it a bit. Not much, but should be good to let them recover. /// Drain the internal energy, if the crystal damage is above 100 we heal it a bit. Not much, but should be good to let them recover.
/obj/machinery/atmospherics/components/unary/delam_scram/proc/prevent_explosion() /obj/machinery/atmospherics/components/unary/delam_scram/proc/aftermath()
var/obj/machinery/power/supermatter_crystal/engine/damaged_sm = my_sm?.resolve() var/obj/machinery/power/supermatter_crystal/engine/damaged_sm = my_sm?.resolve()
if(!damaged_sm) if(!damaged_sm)
return return
damaged_sm.name = "partially delaminated supermatter crystal" damaged_sm.name = "partially delaminated supermatter crystal"
damaged_sm.desc = "This crystal has seen better days, the glow seems off and the shards look brittle. Central says it's still \"relatively safe.\" They'd never lie to us, right?" damaged_sm.desc = "This crystal has seen better days, the glow seems off and the shards look brittle. Central says it's still \"relatively safe.\" They'd never lie to us, right?"
damaged_sm.explosion_power = SM_DAMAGED_EXPLOSION_POWER // if you fuck up again, yeesh damaged_sm.explosion_power += 5 // if you fuck up again, yeesh
for(var/current_gas_mix as anything in damaged_sm.current_gas_behavior)
var/datum/sm_gas/gas_mix = damaged_sm.current_gas_behavior[current_gas_mix]
if(istype(gas_mix, /datum/sm_gas/freon))
gas_mix.heat_resistance += 0.4
continue
gas_mix.heat_modifier += 1.5
gas_mix.heat_resistance -= 0.4
if(damaged_sm.damage > SM_PREVENT_EXPLOSION_THRESHOLD) damaged_sm.internal_energy = 0
damaged_sm.damage = SM_PREVENT_EXPLOSION_THRESHOLD
damaged_sm.internal_energy = MISTAKES_WERE_MADE
for(var/obj/machinery/power/energy_accumulator/tesla_coil/zappy_boi in range(3, src)) for(var/obj/machinery/power/energy_accumulator/tesla_coil/zappy_boi in range(3, src))
zappy_boi.stored_energy = MISTAKES_WERE_MADE zappy_boi.stored_energy = 0
/obj/machinery/atmospherics/components/unary/delam_scram/New() /obj/machinery/atmospherics/components/unary/delam_scram/Initialize(mapload)
. = ..() . = ..()
var/datum/gas_mixture/delam_juice = new var/datum/gas_mixture/delam_juice = new
delam_juice.add_gases(/datum/gas/freon) delam_juice.add_gases(/datum/gas/freon)
delam_juice.gases[/datum/gas/freon][MOLES] = SM_COOLING_MIXTURE_MOLES delam_juice.gases[/datum/gas/freon][MOLES] = 7000 // enough to stop most delams, but not the really big fuckups
delam_juice.temperature = SM_COOLING_MIXTURE_TEMP delam_juice.temperature = 170 // 170K -103c
airs[1] = delam_juice airs[1] = delam_juice
/// A big red button you can smash to stop the supermatter engine, oh how tempting! /// A big red button you can smash to stop the supermatter engine, oh how tempting!
/obj/machinery/button/delam_scram /obj/machinery/button/delam_scram
name = "\improper supermatter emergency stop button" name = "\proper the supermatter emergency stop button"
desc = "Your last hope to try and save the crystal during a delamination.<br>\ desc = "Your last hope to try and save the crystal during a delamination.<br>\
While it is indeed a big red button, pressing it outside of an emergency \ While it is indeed a big red button, pressing it outside of an emergency \
will probably get the engineering department out for your blood." will probably get the engineering department out for your blood."
@@ -306,7 +283,14 @@
return return
if(!validate_suppression_status()) if(!validate_suppression_status())
playsound(src.loc, 'sound/machines/buzz/buzz-sigh.ogg', 50, FALSE, BUTTON_SOUND_RANGE, falloff_distance = BUTTON_SOUND_FALLOFF_DISTANCE) playsound(
source = src.loc,
soundin = 'sound/machines/buzz/buzz-sigh.ogg',
vol = 50,
vary = FALSE,
extrarange = 7,
falloff_distance = 7,
)
audible_message(span_danger("[src] makes a sad buzz and goes dark. Did someone activate it already?")) // Look through the window, buddy audible_message(span_danger("[src] makes a sad buzz and goes dark. Did someone activate it already?")) // Look through the window, buddy
burn_out() burn_out()
return return
@@ -325,18 +309,9 @@
return return
COOLDOWN_START(src, scram_button, 15 SECONDS) COOLDOWN_START(src, scram_button, 15 SECONDS)
button_stage = BUTTON_ARMED // You thought you could sneak this one by your coworkers?
// For roundstart only, after that it's on you!
if(world.time - SSticker.round_start_time > 30 MINUTES)
playsound(src.loc, 'sound/machines/compiler/compiler-failure.ogg', 50, FALSE, BUTTON_SOUND_RANGE, falloff_distance = BUTTON_SOUND_FALLOFF_DISTANCE)
audible_message(span_danger("[src] makes a series of sad beeps. The internal charge only lasts about 30 minutes... what a feat of engineering! Looks like it's all on you to save the day."))
burn_out()
return
// You thought you could sneak this one by your coworkers?
button_stage = BUTTON_ARMED
update_appearance() update_appearance()
radio.talk_into(src, "SUPERMATTER EMERGENCY STOP BUTTON ARMED!", RADIO_CHANNEL_ENGINEERING) radio.talk_into(src, "Supermatter delamination suppression system armed!", RADIO_CHANNEL_ENGINEERING, list(SPAN_COMMAND))
visible_message(span_danger("[user] swings open the plastic cover on [src]!")) visible_message(span_danger("[user] swings open the plastic cover on [src]!"))
// Let the admins know someone's fucked up // Let the admins know someone's fucked up
@@ -354,7 +329,16 @@
return return
// Make scary sound and flashing light // Make scary sound and flashing light
playsound(src, 'sound/machines/high_tech_confirm.ogg', 50, FALSE, BUTTON_SOUND_RANGE, ignore_walls = TRUE, use_reverb = TRUE, falloff_distance = BUTTON_SOUND_FALLOFF_DISTANCE) playsound(
source = src,
soundin = 'sound/machines/high_tech_confirm.ogg',
vol = 50,
vary = FALSE,
extrarange = 7,
ignore_walls = TRUE,
use_reverb = TRUE,
falloff_distance = 7,
)
button_stage = BUTTON_PUSHED button_stage = BUTTON_PUSHED
visible_message(span_danger("[user] smashes [src] with their hand!")) visible_message(span_danger("[user] smashes [src] with their hand!"))
message_admins("[ADMIN_LOOKUPFLW(user)] pushed [src]!") message_admins("[ADMIN_LOOKUPFLW(user)] pushed [src]!")
@@ -362,7 +346,18 @@
flick_overlay_view("[base_icon_state]-overlay-active", 20 SECONDS) flick_overlay_view("[base_icon_state]-overlay-active", 20 SECONDS)
// No going back now! // No going back now!
SEND_GLOBAL_SIGNAL(COMSIG_MAIN_SM_DELAMINATING, MANUAL_INTERVENTION) SEND_GLOBAL_SIGNAL(COMSIG_MAIN_SM_DELAMINATING, SCRAM_TRIGGER_PUSHED)
if(world.time - SSticker.round_start_time > 30 MINUTES)
playsound(
source = src.loc,
soundin = 'sound/machines/compiler/compiler-failure.ogg',
vol = 50,
vary = FALSE,
extrarange = 7,
falloff_distance = 7,
)
audible_message(span_danger("[src] makes a series of sad beeps. Looks like it's all on you to save the day!"))
// Temporarily let anyone escape the engine room before it becomes spicy // Temporarily let anyone escape the engine room before it becomes spicy
for(var/obj/machinery/door/airlock/escape_route in range(7, src)) for(var/obj/machinery/door/airlock/escape_route in range(7, src))
@@ -459,9 +454,8 @@
return ..() return ..()
/// Resets the safety incident display internal counter back to -1 (delam event happened) /// Resets the safety incident display internal counter back to -1 (delam event happened)
/datum/controller/subsystem/persistence/proc/reset_delam_counter() /datum/controller/subsystem/persistence/proc/delam_counter_penalty()
delam_highscore = rounds_since_engine_exploded rounds_since_engine_exploded = round(rounds_since_engine_exploded * 0.5)
rounds_since_engine_exploded = -1
for(var/obj/machinery/incident_display/sign as anything in GLOB.map_incident_displays) for(var/obj/machinery/incident_display/sign as anything in GLOB.map_incident_displays)
sign.update_delam_count(rounds_since_engine_exploded) sign.update_delam_count(rounds_since_engine_exploded)
@@ -469,30 +463,7 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/machinery/atmospherics/components/unary/delam_s
MAPPING_DIRECTIONAL_HELPERS(/obj/structure/sign/delam_procedure, 32) MAPPING_DIRECTIONAL_HELPERS(/obj/structure/sign/delam_procedure, 32)
#undef DAMAGED_SUPERMATTER_COLOR #undef DAMAGED_SUPERMATTER_COLOR
#undef SM_PREVENT_EXPLOSION_THRESHOLD
#undef SM_COOLING_MIXTURE_MOLES
#undef SM_COOLING_MIXTURE_TEMP
#undef MISTAKES_WERE_MADE
#undef MANUAL_INTERVENTION
#undef AUTOMATIC_SAFETIES
#undef BUTTON_PUSHED #undef BUTTON_PUSHED
#undef BUTTON_IDLE #undef BUTTON_IDLE
#undef BUTTON_AWAKE #undef BUTTON_AWAKE
#undef BUTTON_ARMED #undef BUTTON_ARMED
#undef SM_DAMAGED_EXPLOSION_POWER
#undef SHATTER_DEVASTATION_RANGE
#undef SHATTER_HEAVY_RANGE
#undef SHATTER_LIGHT_RANGE
#undef SHATTER_FLAME_RANGE
#undef SHATTER_FLASH_RANGE
#undef SHATTER_MIN_TIME
#undef SHATTER_MAX_TIME
#undef EVAC_WARNING_TIMER
#undef POWER_CUT_MIN_DURATION_SECONDS
#undef POWER_CUT_MAX_DURATION_SECONDS
#undef AIR_INJECT_RATE
#undef BUTTON_SOUND_RANGE
#undef BUTTON_SOUND_FALLOFF_DISTANCE
#undef MACHINE_SOUND_RANGE
#undef MACHINE_RUMBLE_SOUND_RANGE
#undef MACHINE_SOUND_FALLOFF_DISTANCE

View File

@@ -446,7 +446,6 @@
#include "code\__DEFINES\~skyrat_defines\customization.dm" #include "code\__DEFINES\~skyrat_defines\customization.dm"
#include "code\__DEFINES\~skyrat_defines\DNA.dm" #include "code\__DEFINES\~skyrat_defines\DNA.dm"
#include "code\__DEFINES\~skyrat_defines\economy.dm" #include "code\__DEFINES\~skyrat_defines\economy.dm"
#include "code\__DEFINES\~skyrat_defines\events.dm"
#include "code\__DEFINES\~skyrat_defines\examine_defines.dm" #include "code\__DEFINES\~skyrat_defines\examine_defines.dm"
#include "code\__DEFINES\~skyrat_defines\faction.dm" #include "code\__DEFINES\~skyrat_defines\faction.dm"
#include "code\__DEFINES\~skyrat_defines\factions.dm" #include "code\__DEFINES\~skyrat_defines\factions.dm"
@@ -527,6 +526,7 @@
#include "code\__DEFINES\~~bubber_defines\item.dm" #include "code\__DEFINES\~~bubber_defines\item.dm"
#include "code\__DEFINES\~~bubber_defines\jobs.dm" #include "code\__DEFINES\~~bubber_defines\jobs.dm"
#include "code\__DEFINES\~~bubber_defines\loadout.dm" #include "code\__DEFINES\~~bubber_defines\loadout.dm"
#include "code\__DEFINES\~~bubber_defines\machines.dm"
#include "code\__DEFINES\~~bubber_defines\maps.dm" #include "code\__DEFINES\~~bubber_defines\maps.dm"
#include "code\__DEFINES\~~bubber_defines\misc.dm" #include "code\__DEFINES\~~bubber_defines\misc.dm"
#include "code\__DEFINES\~~bubber_defines\mood.dm" #include "code\__DEFINES\~~bubber_defines\mood.dm"