mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-01-03 14:02:49 +00:00
Made it so auto- and admin-ERT crosscheck each other
This avoids having an admin call an ERT and then having the auto call a second ERT on its own Also added a check to abort ERT if not enough people sign up (members_required is currently 1)
This commit is contained in:
@@ -2,7 +2,9 @@
|
||||
// work in progress
|
||||
|
||||
var/const/members_possible = 5
|
||||
var/sent_emergency_team = 0
|
||||
var/const/members_required = 1 // We need at least *one* person ;_;
|
||||
var/global/admin_emergency_team = 0 // Used for admin-spawned response teams
|
||||
// 'sent_response_team' for automagic response teams
|
||||
|
||||
/client/proc/response_team()
|
||||
set name = "Dispatch Emergency Response Team"
|
||||
@@ -18,7 +20,7 @@ var/sent_emergency_team = 0
|
||||
if(ticker.current_state == GAME_STATE_PREGAME)
|
||||
usr << "\red The round hasn't started yet!"
|
||||
return
|
||||
if(sent_emergency_team == 1)
|
||||
if(admin_emergency_team || send_emergency_team)
|
||||
usr << "\red Central Command has already dispatched an emergency response team!"
|
||||
return
|
||||
if(alert("Do you want to dispatch an Emergency Response Team?",,"Yes","No") != "Yes")
|
||||
@@ -35,11 +37,11 @@ var/sent_emergency_team = 0
|
||||
if(alert("You haven't specified a mission. Exit the setup process?",,"No","Yes")=="Yes")
|
||||
return
|
||||
|
||||
if(sent_emergency_team)
|
||||
if(admin_emergency_team || send_emergency_team)
|
||||
usr << "\red Looks like somebody beat you to it!"
|
||||
return
|
||||
|
||||
sent_emergency_team = 1
|
||||
admin_emergency_team = 1
|
||||
message_admins("[key_name_admin(usr)] is dispatching an Emergency Response Team.", 1)
|
||||
log_admin("[key_name(usr)] used Dispatch Response Team.")
|
||||
|
||||
@@ -87,6 +89,12 @@ var/sent_emergency_team = 0
|
||||
|
||||
sleep(300)
|
||||
|
||||
if(candidates.len < members_required)
|
||||
message_admins("Not enough people signed up for [key_name_admin(usr)]'s response team! Aborting.")
|
||||
log_admin("Response Team aborted: Not Enough Signups.")
|
||||
admin_emergency_team = 0
|
||||
return
|
||||
|
||||
for(var/i=members_possible,(i>0&&candidates.len), i--) // The rest of the choosing process is just an input with a list of candidates on it
|
||||
var/chosen = input("Time's up! Choose characters to spawn as reponse team members. This will go on until there are no more ghosts to pick from or until all slots are full.", "Considered Players") as null|anything in candidates
|
||||
candidates -= chosen
|
||||
@@ -175,9 +183,11 @@ var/sent_emergency_team = 0
|
||||
new_member.mind.special_role = "Emergency Response Team"
|
||||
ticker.mode.traitors += new_member.mind // ERTs will show up at the end of the round on the "traitor" list
|
||||
|
||||
// Join message
|
||||
new_member << "\blue You are the <b>Emergency Response Team[!leader_selected?"!</b>":" Leader!</b>"] \nAs a response team [!leader_selected?"member":"<b>leader</b>"] you answer directly to [!leader_selected?"your team leader.":"Central Command."] \nYou have been deployed by NanoTrasen Central Command in Tau Ceti to resolve a Code Red alert aboard [station_name()], and have been provided with the following instructions and information regarding your mission: \red [situation]"
|
||||
new_member.mind.store_memory("<b>Mission Parameters:</b> \red [situation].")
|
||||
|
||||
// Leader join message
|
||||
if(leader_selected)
|
||||
new_member << "\red The Nuclear Authentication Code is: <b> [nuke_code]</b>. You are instructed not to detonate the nuclear device aboard [station_name()] unless <u>absolutely necessary</u>."
|
||||
new_member.mind.store_memory("<b>Nuclear Authentication Code:</b> \red [nuke_code]")
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
//STRIKE TEAMS
|
||||
|
||||
var/list/response_team_members = list()
|
||||
var/global/send_emergency_team = 0
|
||||
var/global/send_emergency_team = 0 // Used for automagic response teams
|
||||
// 'admin_emergency_team' for admin-spawned response teams
|
||||
|
||||
client/verb/JoinResponseTeam()
|
||||
set category = "IC"
|
||||
@@ -10,6 +11,9 @@ client/verb/JoinResponseTeam()
|
||||
if(!send_emergency_team)
|
||||
usr << "No emergency response team is currently being sent."
|
||||
return
|
||||
if(admin_emergency_team)
|
||||
usr << "An emergency response team has already been sent."
|
||||
return
|
||||
if(jobban_isbanned(usr, "Syndicate") || jobban_isbanned(usr, "Emergency Response Team") || jobban_isbanned(usr, "Security Officer"))
|
||||
usr << "<font color=red><b>You are jobbanned from the emergency reponse team!"
|
||||
return
|
||||
@@ -65,7 +69,7 @@ proc/percentage_antagonists()
|
||||
|
||||
|
||||
proc/trigger_armed_response_team(var/force = 0)
|
||||
if(send_emergency_team)
|
||||
if(send_emergency_team || admin_emergency_team)
|
||||
return
|
||||
|
||||
var/send_team_chance = 20 // base chance that a team will be sent
|
||||
@@ -78,7 +82,7 @@ proc/trigger_armed_response_team(var/force = 0)
|
||||
// there's only a certain chance a team will be sent
|
||||
if(!prob(send_team_chance)) return
|
||||
|
||||
command_alert("According to our sensors, [station_name()] has entered code red. We will prepare and dispatch an emergency response team to deal with the situation.", "Command Report")
|
||||
command_alert("Sensors indicate that [station_name()] has entered Code Red and is in need of assistance. We will prepare and dispatch an emergency response team to deal with the situation.", "NMV Icarus Command")
|
||||
|
||||
send_emergency_team = 1
|
||||
|
||||
|
||||
Reference in New Issue
Block a user