Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make LZ smoke admin only #7556

Merged
merged 1 commit into from
Nov 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions code/__DEFINES/mode.dm
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
#define MODE_DISABLE_JOE_RESPAWN (1<<12) // Toggles if ghosts can respawn as Working Joes after dying as one when 15 minutes have passed. Off by default
#define MODE_INDESTRUCTIBLE_SPLINTS (1<<13) //Toggle is splints are to become nanosplints
#define MODE_NO_INTERNAL_BLEEDING (1<<14) // Toggles all internal bleeding behavior to cause normal bleeding instead
#define MODE_LZ_HAZARD_ACTIVATED (1<<15) // Distress Signal: Spawns miasma 3 minutes after round start


#define ROUNDSTATUS_FOG_DOWN 1
Expand Down
1 change: 1 addition & 0 deletions code/_globalvars/bitfields.dm
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,7 @@ DEFINE_BITFIELD(toggleable_flags, list(
"MODE_DISPOSABLE_MOBS" = MODE_DISPOSABLE_MOBS,
"MODE_BYPASS_JOE" = MODE_BYPASS_JOE,
"MODE_DISABLE_JOE_RESPAWN" = MODE_DISABLE_JOE_RESPAWN,
"MODE_LZ_HAZARD_ACTIVATED" = MODE_LZ_HAZARD_ACTIVATED
))

DEFINE_BITFIELD(state, list(
Expand Down
4 changes: 4 additions & 0 deletions code/game/gamemodes/colonialmarines/colonialmarines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,10 @@
/datum/game_mode/colonialmarines/proc/start_lz_hazards()
if(SSobjectives.first_drop_complete)
return // Just for sanity
if(!MODE_HAS_TOGGLEABLE_FLAG(MODE_LZ_HAZARD_ACTIVATED))
return

log_game("Distress Signal LZ hazards active!")
INVOKE_ASYNC(src, PROC_REF(warn_lz_hazard), locate(/obj/structure/machinery/computer/shuttle/dropship/flight/lz1))
INVOKE_ASYNC(src, PROC_REF(warn_lz_hazard), locate(/obj/structure/machinery/computer/shuttle/dropship/flight/lz2))
addtimer(CALLBACK(src, PROC_REF(spawn_lz_hazards)), OB_TRAVEL_TIMING + 1 SECONDS)
Expand Down
1 change: 1 addition & 0 deletions code/modules/admin/admin_verbs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ GLOBAL_LIST_INIT(admin_verbs_minor_event, list(
/client/proc/toggle_hardcore_perma,
/client/proc/toggle_bypass_joe_restriction,
/client/proc/toggle_joe_respawns,
/client/proc/toggle_lz_hazards,
/datum/admins/proc/open_shuttlepanel,
/client/proc/get_whitelisted_clients,
))
Expand Down
23 changes: 23 additions & 0 deletions code/modules/admin/tabs/admin_tab.dm
Original file line number Diff line number Diff line change
Expand Up @@ -886,3 +886,26 @@

SSticker.mode.toggleable_flags ^= MODE_DISABLE_JOE_RESPAWN
message_admins("[src] has [MODE_HAS_TOGGLEABLE_FLAG(MODE_DISABLE_JOE_RESPAWN) ? "disabled" : "enabled"] Working Joe respawns.")

/client/proc/toggle_lz_hazards()
set name = "Toggle LZ Hazards"
set category = "Admin.Flags"
set desc = "Distress Signal: Whether miasma smoke is spawned 3 minutes after the start of the round."

if(!admin_holder || !check_rights(R_EVENT, TRUE))
return

if(!SSticker.mode)
to_chat(usr, SPAN_WARNING("A mode hasn't been selected yet!"))
return

if(!istype(SSticker.mode, /datum/game_mode/colonialmarines))
to_chat(usr, SPAN_WARNING("LZ hazards are only applicable to distress signal!"))
return

if(ROUND_TIME > LZ_HAZARD_START)
to_chat(usr, SPAN_WARNING("Its too late to toggle this!"))
return

SSticker.mode.toggleable_flags ^= MODE_LZ_HAZARD_ACTIVATED
message_admins("[src] has [MODE_HAS_TOGGLEABLE_FLAG(MODE_LZ_HAZARD_ACTIVATED) ? "enabled" : "disabled"] LZ hazards.")
Loading