From 87e33931dd2d7bb0db5666ea5c8c16da7e59bbea Mon Sep 17 00:00:00 2001 From: BongaTheProto <93835010+BongaTheProto@users.noreply.github.com> Date: Mon, 22 Apr 2024 18:37:06 -0500 Subject: [PATCH 1/3] fix plushies it works as intended now --- .../code/modules/power/reactor/rbmk.dm | 24 +++++++++++-------- .../modules/power/supermatter/supermatter.dm | 12 ++++++---- 2 files changed, 21 insertions(+), 15 deletions(-) diff --git a/modular_splurt/code/modules/power/reactor/rbmk.dm b/modular_splurt/code/modules/power/reactor/rbmk.dm index 41895e925503..df3297391e67 100644 --- a/modular_splurt/code/modules/power/reactor/rbmk.dm +++ b/modular_splurt/code/modules/power/reactor/rbmk.dm @@ -9,11 +9,13 @@ priority_announce("RBMK privileges revoked. Current crew is deemed unsuitable to handle a highly radioactive steam engine. More training is required.", "SIMULATION TERMINATED") var/skill_issue_sound = pick('modular_splurt/sound/voice/boowomp.ogg', 'modular_splurt/sound/effects/fart_reverb.ogg') sound_to_playing_players(skill_issue_sound) - var/obj/item/toy/plush/random/plushe = new(get_turf(src)) - plushe.name = "Consolation plushie" - plushe.desc = "It has \"You tried\" poorly written in its tag." - plushe.squeak_override = list(skill_issue_sound = 1) - plushe.resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | ACID_PROOF | FREEZE_PROOF + var/turf/plush_turf = get_turf(src) + var/obj/item/toy/plush/random/plushe = new(plush_turf) + plushe = locate(/obj/item/toy/plush) in plush_turf + plushe?.name = "Consolation plushie" + plushe?.desc = "It says \"You tried\" poorly written in its tag." + plushe?.squeak_override = list(skill_issue_sound = 1) + plushe?.resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | ACID_PROOF | FREEZE_PROOF qdel(src) /obj/machinery/atmospherics/components/trinary/nuclear_reactor/blowout() @@ -27,9 +29,11 @@ priority_announce("RBMK privileges revoked. Current crew is deemed unsuitable to handle a highly radioactive steam engine. More training is required.", "SIMULATION TERMINATED") var/skill_issue_sound = pick('modular_splurt/sound/voice/boowomp.ogg', 'modular_splurt/sound/effects/fart_reverb.ogg') sound_to_playing_players(skill_issue_sound) - var/obj/item/toy/plush/random/plushe = new(get_turf(src)) - plushe.name = "Holy fucking shit plushie" - plushe.desc = "You really fucked it up this time, didn't you?." - plushe.squeak_override = list(skill_issue_sound = 1) - plushe.resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | ACID_PROOF | FREEZE_PROOF + var/turf/plush_turf = get_turf(src) + var/obj/item/toy/plush/random/plushe = new(plush_turf) + plushe = locate(/obj/item/toy/plush) in plush_turf + plushe?.name = "Consolation plushie" + plushe?.desc = "It says \"You tried\" poorly written in its tag." + plushe?.squeak_override = list(skill_issue_sound = 1) + plushe?.resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | ACID_PROOF | FREEZE_PROOF qdel(src) diff --git a/modular_splurt/code/modules/power/supermatter/supermatter.dm b/modular_splurt/code/modules/power/supermatter/supermatter.dm index 5948f6610899..f046bb8ed8f2 100644 --- a/modular_splurt/code/modules/power/supermatter/supermatter.dm +++ b/modular_splurt/code/modules/power/supermatter/supermatter.dm @@ -61,11 +61,13 @@ Custom Bombcaps: priority_announce("Supermatter privileges revoked. Current crew is deemed unsuitable to handle a highly hazardous engine. More training is required.", "SIMULATION TERMINATED") var/skill_issue_sound = pick('modular_splurt/sound/voice/boowomp.ogg', 'modular_splurt/sound/effects/fart_reverb.ogg') sound_to_playing_players(skill_issue_sound) - var/obj/item/toy/plush/random/plushe = new(get_turf(src)) - plushe.name = "Consolation plushie" - plushe.desc = "It has \"You tried\" poorly written in its tag." - plushe.squeak_override = list(skill_issue_sound = 1) - plushe.resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | ACID_PROOF | FREEZE_PROOF + var/turf/plush_turf = get_turf(src) + var/obj/item/toy/plush/random/plushe = new(plush_turf) + plushe = locate(/obj/item/toy/plush) in plush_turf + plushe?.name = "Consolation plushie" + plushe?.desc = "It has \"You tried\" poorly written in its tag." + plushe?.squeak_override = list(skill_issue_sound = 1) + plushe?.resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | ACID_PROOF | FREEZE_PROOF qdel(src) return From 22b61dba91c297b3d23722aa0579e1fb30e5ec51 Mon Sep 17 00:00:00 2001 From: BongaTheProto <93835010+BongaTheProto@users.noreply.github.com> Date: Mon, 22 Apr 2024 20:12:41 -0500 Subject: [PATCH 2/3] sm delam cooldown it seems to work I guess --- code/modules/admin/admin_verbs.dm | 3 +- config/splurt/general.txt | 8 +++-- modular_splurt/code/_globalvars/sm_delam.dm | 1 + .../configuration/entries/splurt_general.dm | 4 ++- .../code/modules/admin/verbs/sm_delam.dm | 15 +++++++++ .../code/modules/power/reactor/rbmk.dm | 6 ++-- .../modules/power/supermatter/supermatter.dm | 31 ++++++++++++++++++- tgstation.dme | 2 ++ 8 files changed, 62 insertions(+), 8 deletions(-) create mode 100644 modular_splurt/code/_globalvars/sm_delam.dm create mode 100644 modular_splurt/code/modules/admin/verbs/sm_delam.dm diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index 9b6d7ecc5cd9..7a8ea640c941 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -126,7 +126,8 @@ GLOBAL_LIST_INIT(admin_verbs_fun, list( /client/proc/admin_away, // /client/proc/spawn_floor_cluwne, /client/proc/cmd_admin_toggle_fov, //CIT CHANGE - FOV - /client/proc/roll_dices //CIT CHANGE - Adds dice verb + /client/proc/roll_dices, //CIT CHANGE - Adds dice verb + /client/proc/override_sm_delam //SPLURT change - Adds SM toggle )) GLOBAL_PROTECT(admin_verbs_fun) GLOBAL_LIST_INIT(admin_verbs_spawn, list(/datum/admins/proc/spawn_atom, /datum/admins/proc/podspawn_atom, /datum/admins/proc/spawn_cargo, /datum/admins/proc/spawn_objasmob, /client/proc/respawn_character)) diff --git a/config/splurt/general.txt b/config/splurt/general.txt index 773d015386b6..399e80a4a10e 100644 --- a/config/splurt/general.txt +++ b/config/splurt/general.txt @@ -15,9 +15,11 @@ WEIGHTED_STATION_TRAITS # default is 24 #BASE_SAVE_SLOTS 24 -# SM delamination -# Comment to make the SM not explode -SM_DELAMINATION +# SM delamination cooldown +# Configures tha amount of rounds that need to pass from the previous delam for another to happen again +# If commented or 0 will enable delaminations every round +# If -1 disables delams indefinitely +#SM_DELAMINATION_COOLDOWN 0 # Protolathe access # Comment to make protolathes and mechfabs use their access locks diff --git a/modular_splurt/code/_globalvars/sm_delam.dm b/modular_splurt/code/_globalvars/sm_delam.dm new file mode 100644 index 000000000000..ef1e51f8849c --- /dev/null +++ b/modular_splurt/code/_globalvars/sm_delam.dm @@ -0,0 +1 @@ +GLOBAL_VAR(delam_override) // Overides the config for delamination diff --git a/modular_splurt/code/controllers/configuration/entries/splurt_general.dm b/modular_splurt/code/controllers/configuration/entries/splurt_general.dm index 262e0df6123b..59d92c1d3af0 100644 --- a/modular_splurt/code/controllers/configuration/entries/splurt_general.dm +++ b/modular_splurt/code/controllers/configuration/entries/splurt_general.dm @@ -8,7 +8,9 @@ /datum/config_entry/number/base_save_slots default = DEFAULT_SAVE_SLOTS -/datum/config_entry/flag/sm_delamination +/datum/config_entry/number/sm_delamination_cooldown + default = 0 + min_val = -1 /datum/config_entry/flag/protolock_all_access diff --git a/modular_splurt/code/modules/admin/verbs/sm_delam.dm b/modular_splurt/code/modules/admin/verbs/sm_delam.dm new file mode 100644 index 000000000000..93a4a3077030 --- /dev/null +++ b/modular_splurt/code/modules/admin/verbs/sm_delam.dm @@ -0,0 +1,15 @@ +/client/proc/override_sm_delam() + set category = "Admin.Fun" + set name = "Toggle SM delam" + set desc = "Toggles this round's SM delam mode." + + switch(GLOB.delam_override) + if(TRUE) + GLOB.delam_override = FALSE + if(FALSE) + GLOB.delam_override = null + else + GLOB.delam_override = TRUE + + log_admin("[key_name(usr)] [isnull(GLOB.delam_override) ? "reset the SM delam to follow the config's rules. It is [check_sm_delam() ? "ON" : "OFF"] for the round" : "has forced the SM delam [GLOB.delam_override ? "ON" : "OFF"]"] for the round.") + message_admins("[ADMIN_LOOKUPFLW(usr)] [isnull(GLOB.delam_override) ? "reset the SM delam to follow the config's rules. It is [check_sm_delam() ? "ON" : "OFF"] for the round" : "has forced the SM delam [GLOB.delam_override ? "ON" : "OFF"]"] for the round.") diff --git a/modular_splurt/code/modules/power/reactor/rbmk.dm b/modular_splurt/code/modules/power/reactor/rbmk.dm index df3297391e67..d2ba601ac02f 100644 --- a/modular_splurt/code/modules/power/reactor/rbmk.dm +++ b/modular_splurt/code/modules/power/reactor/rbmk.dm @@ -1,5 +1,6 @@ /obj/machinery/atmospherics/components/trinary/nuclear_reactor/meltdown() - if(CONFIG_GET(flag/sm_delamination)) + if(check_sm_delam()) + write_sm_delam() return ..() shut_down() stop_relay(CHANNEL_REACTOR_ALERT) @@ -19,7 +20,8 @@ qdel(src) /obj/machinery/atmospherics/components/trinary/nuclear_reactor/blowout() - if(CONFIG_GET(flag/sm_delamination)) + if(check_sm_delam()) + write_sm_delam() return ..() shut_down() stop_relay(CHANNEL_REACTOR_ALERT) diff --git a/modular_splurt/code/modules/power/supermatter/supermatter.dm b/modular_splurt/code/modules/power/supermatter/supermatter.dm index f046bb8ed8f2..8a756378f30a 100644 --- a/modular_splurt/code/modules/power/supermatter/supermatter.dm +++ b/modular_splurt/code/modules/power/supermatter/supermatter.dm @@ -22,6 +22,32 @@ Custom Bombcaps: #define EXPLOSION_MODIFIER_MEDIUM 0.5 #define EXPLOSION_MODIFIER_LARGE 0.75 +// Check if the SM Can explode at all or not +/proc/check_sm_delam() + switch(GLOB.delam_override) + if(TRUE) + return TRUE + if(FALSE) + return FALSE + + var/cooldown_sm = CONFIG_GET(number/sm_delamination_cooldown) + + // If fully disabled + if(cooldown_sm == -1) + return FALSE + + // Check if the cooldown is still active + if(!rustg_file_exists("data/last_sm_delam.txt")) + return TRUE + var/last_sm_delam = text2num(rustg_file_read("data/last_sm_delam.txt")) + if(GLOB.round_id > last_sm_delam + cooldown_sm) + return TRUE + return FALSE + +// Proc to log the round in which the sm or another engine goes boom +/proc/write_sm_delam() + rustg_file_write("data/last_sm_delam.txt", "[GLOB.round_id]") + // Let's turn the base explosion power down a little... /obj/machinery/power/supermatter_crystal explosion_power = 22 @@ -56,7 +82,7 @@ Custom Bombcaps: SEND_SIGNAL(M, COMSIG_ADD_MOOD_EVENT, "delam", /datum/mood_event/delam) // Don't explode if we no allow - if(!CONFIG_GET(flag/sm_delamination)) + if(!check_sm_delam()) investigate_log("has attempted a delamination, but the config disallows it", INVESTIGATE_SUPERMATTER) priority_announce("Supermatter privileges revoked. Current crew is deemed unsuitable to handle a highly hazardous engine. More training is required.", "SIMULATION TERMINATED") var/skill_issue_sound = pick('modular_splurt/sound/voice/boowomp.ogg', 'modular_splurt/sound/effects/fart_reverb.ogg') @@ -71,6 +97,9 @@ Custom Bombcaps: qdel(src) return +// Log if it explodes + write_sm_delam() + // Replace the singularity and tesla delaminations with an EMP pulse. It's hard to achieve this without deliberate sabotage. if(combined_gas > MOLE_PENALTY_THRESHOLD || power > POWER_PENALTY_THRESHOLD) investigate_log("has reached critical mass, causing an EMP.", INVESTIGATE_SUPERMATTER) diff --git a/tgstation.dme b/tgstation.dme index c1b1e3c3b0e3..83702e95fa0a 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -4406,6 +4406,7 @@ #include "modular_splurt\code\__HELPERS\spawns.dm" #include "modular_splurt\code\__HELPERS\text.dm" #include "modular_splurt\code\__HELPERS\unsorted.dm" +#include "modular_splurt\code\_globalvars\sm_delam.dm" #include "modular_splurt\code\_globalvars\tgui.dm" #include "modular_splurt\code\_globalvars\lists\character_directory.dm" #include "modular_splurt\code\_globalvars\lists\global_lewd.dm" @@ -4648,6 +4649,7 @@ #include "modular_splurt\code\modules\admin\verbs\one_click_antag.dm" #include "modular_splurt\code\modules\admin\verbs\pray.dm" #include "modular_splurt\code\modules\admin\verbs\randomverbs.dm" +#include "modular_splurt\code\modules\admin\verbs\sm_delam.dm" #include "modular_splurt\code\modules\admin\verbs\vpnbunker.dm" #include "modular_splurt\code\modules\antagonists\_common\antag_spawner.dm" #include "modular_splurt\code\modules\antagonists\bloodsucker\datum_bloodsucker.dm" From 0b756182f878781497fda501db21213684afa747 Mon Sep 17 00:00:00 2001 From: BongaTheProto <93835010+BongaTheProto@users.noreply.github.com> Date: Mon, 22 Apr 2024 20:31:39 -0500 Subject: [PATCH 3/3] Update sm_delam.dm --- modular_splurt/code/modules/admin/verbs/sm_delam.dm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modular_splurt/code/modules/admin/verbs/sm_delam.dm b/modular_splurt/code/modules/admin/verbs/sm_delam.dm index 93a4a3077030..b45fe3ca3ea6 100644 --- a/modular_splurt/code/modules/admin/verbs/sm_delam.dm +++ b/modular_splurt/code/modules/admin/verbs/sm_delam.dm @@ -11,5 +11,5 @@ else GLOB.delam_override = TRUE - log_admin("[key_name(usr)] [isnull(GLOB.delam_override) ? "reset the SM delam to follow the config's rules. It is [check_sm_delam() ? "ON" : "OFF"] for the round" : "has forced the SM delam [GLOB.delam_override ? "ON" : "OFF"]"] for the round.") - message_admins("[ADMIN_LOOKUPFLW(usr)] [isnull(GLOB.delam_override) ? "reset the SM delam to follow the config's rules. It is [check_sm_delam() ? "ON" : "OFF"] for the round" : "has forced the SM delam [GLOB.delam_override ? "ON" : "OFF"]"] for the round.") + log_admin("[key_name(usr)] [isnull(GLOB.delam_override) ? "reset the SM delam to follow the config's rules. It is [check_sm_delam() ? "ON" : "OFF"]" : "has forced the SM delam [GLOB.delam_override ? "ON" : "OFF"]"] for the round.") + message_admins("[ADMIN_LOOKUPFLW(usr)] [isnull(GLOB.delam_override) ? "reset the SM delam to follow the config's rules. It is [check_sm_delam() ? "ON" : "OFF"]" : "has forced the SM delam [GLOB.delam_override ? "ON" : "OFF"]"] for the round.")