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

[MIRROR] Fixes secrets panel disease outbreak button #857

Merged
merged 1 commit into from
Nov 28, 2023
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
2 changes: 1 addition & 1 deletion code/modules/admin/force_event.dm
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
if(!event)
return
if(length(event.admin_setup))
for(var/datum/event_admin_setup/admin_setup_datum in event.admin_setup)
for(var/datum/event_admin_setup/admin_setup_datum as anything in event.admin_setup)
if(admin_setup_datum.prompt_admins() == ADMIN_CANCEL_EVENT)
return
var/always_announce_chance = 100
Expand Down
26 changes: 17 additions & 9 deletions code/modules/admin/verbs/secrets.dm
Original file line number Diff line number Diff line change
Expand Up @@ -203,17 +203,25 @@ GLOBAL_DATUM(everyone_a_traitor, /datum/everyone_is_a_traitor_controller)
if(!is_funmin)
return
SSblackbox.record_feedback("nested tally", "admin_secrets_fun_used", 1, list("Virus Outbreak"))
switch(tgui_alert(usr,"Do you want this to be a random disease or do you have something in mind?",,list("Make Your Own","Random","Choose")))
var/datum/round_event_control/event
var/prompt = tgui_alert(usr, "What disease system do you want?", "Disease Setup", list("Advanced", "Simple", "Make Your Own"))
switch(prompt)
if("Make Your Own")
AdminCreateVirus(holder)
if("Random")
force_event(/datum/round_event_control/disease_outbreak)
if("Choose")
var/virus = input("Choose the virus to spread", "BIOHAZARD") as null|anything in sort_list(typesof(/datum/disease), GLOBAL_PROC_REF(cmp_typepaths_asc))
var/datum/round_event_control/disease_outbreak/DC = locate(/datum/round_event_control/disease_outbreak) in SSevents.control
var/datum/round_event/disease_outbreak/DO = DC.run_event()
DO.virus_type = virus
E = DO
if("Advanced")
event = locate(/datum/round_event_control/disease_outbreak/advanced) in SSevents.control
if("Simple")
event = locate(/datum/round_event_control/disease_outbreak) in SSevents.control
if(isnull(event))
return
if(length(event.admin_setup))
for(var/datum/event_admin_setup/admin_setup_datum as anything in event.admin_setup)
if(admin_setup_datum.prompt_admins() == ADMIN_CANCEL_EVENT)
return
event.run_event(admin_forced = TRUE)
message_admins("[key_name_admin(usr)] has triggered an event. ([event.name])")
log_admin("[key_name(usr)] has triggered an event. ([event.name])")

if("allspecies")
if(!is_funmin)
return
Expand Down
6 changes: 4 additions & 2 deletions code/modules/events/disease_outbreak.dm
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,8 @@
return
CHECK_TICK //don't lag the server to death
if(isnull(victim))
log_game("Event Disease Outbreak: Classic attempted to start, but failed.")
message_admins("Event Disease Outbreak: Classic attempted to start, but failed to find a candidate target.")
log_game("Event Disease Outbreak: Classic attempted to start, but failed to find a candidate target")

/datum/round_event_control/disease_outbreak/advanced
name = "Disease Outbreak: Advanced"
Expand Down Expand Up @@ -279,7 +280,8 @@
return
CHECK_TICK //don't lag the server to death
if(isnull(victim))
log_game("Event Disease Outbreak: Advanced attempted to start, but failed.")
message_admins("Event Disease Outbreak: Advanced attempted to start, but failed to find a candidate target.")
log_game("Event Disease Outbreak: Advanced attempted to start, but failed to find a candidate target.")

/datum/disease/advance/random/event
name = "Event Disease"
Expand Down
Loading