[MANUAL MIRROR] Refactors Admin Setups on Forced Events + Refactors Vending Sentience (#19068)

* Refactors Admin Setups on Forced Events + Refactors Vending Sentience + Refactors Shuttle Loans (#72998)

- [x] TEST EVERYTHING
tested:
- Pirates
- Vending Machines
- Shuttle Catastrophe
- Anomalies
- Immovable Rod
- Sandstorms
- Scrubber Overflow
- Stray Meteor
- Madness
- Department Revolt (Well obviously, it is my super robust code after
all)
- Shuttle Loan
- Mass Hallucination
- Heart Attack
- False Alarm

Disease Outbreak is probably fine aha... It correctly reports that there
are no candidates before aborting.

allow you to let the game decide where previously you had to choose!

I need to refactor and datumize how admins set up special conditions on
forced events, so I did! Now `/datum/event_admin_setup` handles admin
settings, with a few prototypes to make it easier to give events admin
options in the future. This was exhausting and what 90% of the pr is.

The code was so bad I could not datumize the admin part of it so I
cleaned it up, making a lot of things in the event get decided in
`setup()` where they should.

The code was so bad I could not datumize the admin part of it so I
cleaned it up AS WELL, by datumizing the shuttle loans. Should be easier
to add more types in the future, actually kinda stoked.

This is preparation for a tgui change to ForceEvent.ts an admin has
requested. Phew!

🆑
refactor: Refactored a bunch of admin-related event code, hopefully you
won't notice much
admin: ... But you specifically may notice some minor differences. Raw
inputs changed into tgui ones, minor soul removal, etc.
/🆑

* remove override

* merge conflict

* dm update

* merge conflict

---------

Co-authored-by: tralezab <40974010+tralezab@users.noreply.github.com>
This commit is contained in:
lessthanthree
2023-02-12 11:37:52 -08:00
committed by GitHub
parent 869d51dfce
commit 0b4e32ec59
27 changed files with 1255 additions and 1001 deletions
+1 -1
View File
@@ -88,7 +88,7 @@
var/datum/round_event_control/event = locate(event_to_run_type) in SSevents.control
if(!event)
return
if(event.admin_setup(usr) == ADMIN_CANCEL_EVENT)
if(event.admin_setup && event.admin_setup.prompt_admins() == ADMIN_CANCEL_EVENT)
return
var/always_announce_chance = 100
var/no_announce_chance = 0
-25
View File
@@ -83,31 +83,6 @@
else message_admins("[key_name_admin(usr)] FAILED to create '[href_list["makeAntag"]]' with a parameter of '[opt]'.")
// SKYRAT EDIT END -- ONE CLICK ANTAG
else if(href_list["forceevent"])
if(!check_rights(R_FUN))
return
var/datum/round_event_control/E = locate(href_list["forceevent"]) in SSevents.control
if(E)
E.admin_setup(usr)
var/datum/round_event/event = E.runEvent()
if(event.cancel_event)
return
if(event.announce_when>0)
event.processing = FALSE
var/prompt = tgui_alert(usr, "Would you like to alert the crew?", "Alert", list("Yes", "No", "Cancel"))
switch(prompt)
if("Yes")
event.announce_chance = 100
if("Cancel")
event.kill()
return
if("No")
event.announce_chance = 0
event.processing = TRUE
message_admins("[key_name_admin(usr)] has triggered an event. ([E.name])")
log_admin("[key_name(usr)] has triggered an event. ([E.name])")
return
else if(href_list["editrightsbrowser"])
edit_admin_permissions(0)