From 3e364635b273e3c22eb83c95067e0f8a87dd0b73 Mon Sep 17 00:00:00 2001 From: NicholasDV Date: Sat, 3 Aug 2013 05:13:28 -0400 Subject: [PATCH] Separated ERT from red alert and other small changes... Separated the ERT to be callable via the keycard auth device. Gave the ERT call different messages to work with the above, as well as a message when it has been denied. The old base amount of 50 was way too stronk. Furthermore, it was added to by other factors from the game. It has been lowered a bit and a proc added in to increase it the longer the round has been going on. Made it so that you may only attempt to call the ERT a single time. Changed it so that you only have 5 minutes to join the ERT after it has been called. --- code/game/response_team.dm | 36 +++++++++++++++---- .../security levels/keycard authentication.dm | 4 +++ .../security levels/security levels.dm | 4 --- 3 files changed, 34 insertions(+), 10 deletions(-) diff --git a/code/game/response_team.dm b/code/game/response_team.dm index afd1cf10eed..1b2c50fb636 100644 --- a/code/game/response_team.dm +++ b/code/game/response_team.dm @@ -3,8 +3,9 @@ var/list/response_team_members = list() var/global/send_emergency_team = 0 // Used for automagic response teams -// 'admin_emergency_team' for admin-spawned response teams - + // 'admin_emergency_team' for admin-spawned response teams +var/ert_base_chance = 10 // Default base chance. Will be incremented by increment ERT chance. +var/can_call_ert /client/proc/response_team() set name = "Dispatch Emergency Response Team" @@ -26,7 +27,7 @@ var/global/send_emergency_team = 0 // Used for automagic response teams if(alert("Do you want to dispatch an Emergency Response Team?",,"Yes","No") != "Yes") return if(get_security_level() != "red") // Allow admins to reconsider if the alert level isn't Red - switch(alert("The station has not entered code red recently. Do you still want to dispatch a response team?",,"Yes","No")) + switch(alert("The station is not in red alert. Do you still want to dispatch a response team?",,"Yes","No")) if("No") return if(send_emergency_team) @@ -101,12 +102,28 @@ proc/percentage_antagonists() if(total == 0) return 0 else return round(100 * antagonists / total) +// Increments the ERT chance automatically, so that the later it is in the round, +// the more likely an ERT is to be able to be called. +proc/increment_ert_chance() + while(send_emergency_team == 0) // There is no ERT at the time. + if(get_security_level() == "green") + ert_base_chance += 1 + if(get_security_level() == "blue") + ert_base_chance += 2 + if(get_security_level() == "red") + ert_base_chance += 3 + if(get_security_level() == "delta") + ert_base_chance += 10 // Need those big guns + sleep(600 * 3) // Minute * Number of Minutes + proc/trigger_armed_response_team(var/force = 0) + if(!can_call_ert) + return if(send_emergency_team) return - var/send_team_chance = 50 // base chance that a team will be sent + var/send_team_chance = ert_base_chance // Is incremented by increment_ert_chance. send_team_chance += 2*percentage_dead() // the more people are dead, the higher the chance send_team_chance += percentage_antagonists() // the more antagonists, the higher the chance send_team_chance = min(send_team_chance, 100) @@ -114,12 +131,19 @@ proc/trigger_armed_response_team(var/force = 0) if(force) send_team_chance = 100 // there's only a certain chance a team will be sent - if(!prob(send_team_chance)) return + if(!prob(send_team_chance)) + command_alert("It would appear that an emergency response team was requested for [station_name()]. Unfortunately, we were unable to send one at this time.", "Central Command") + can_call_ert = 0 // Only one call per round, ladies. + return - 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.", "Central Command") + command_alert("It would appear that an emergency response team was requested for [station_name()]. We will prepare and send one as soon as possible.", "Central Command") + can_call_ert = 0 // Only one call per round, gentleman. send_emergency_team = 1 + sleep(600 * 5) + send_emergency_team = 0 // Can no longer join the ERT. + /* var/area/security/nuke_storage/nukeloc = locate()//To find the nuke in the vault var/obj/machinery/nuclearbomb/nuke = locate() in nukeloc if(!nuke) diff --git a/code/modules/security levels/keycard authentication.dm b/code/modules/security levels/keycard authentication.dm index 4e82f08b55e..b36a1772be7 100644 --- a/code/modules/security levels/keycard authentication.dm +++ b/code/modules/security levels/keycard authentication.dm @@ -69,6 +69,7 @@ if(screen == 1) dat += "Select an event to trigger:" user << browse(dat, "window=keycard_auth;size=500x250") @@ -146,6 +147,9 @@ if("Emergency Maintenance Access") make_maint_all_access() feedback_inc("alert_keycard_auth_maint",1) + if("Emergency Rescue Team") // DEC + trigger_armed_response_team(1) + feedback_inc("alert_keycard_auth_ert",1) /proc/make_maint_all_access() for(var/obj/machinery/door/airlock/A in machines) diff --git a/code/modules/security levels/security levels.dm b/code/modules/security levels/security levels.dm index dd259d2c1bb..28563c3b488 100644 --- a/code/modules/security levels/security levels.dm +++ b/code/modules/security levels/security levels.dm @@ -59,10 +59,6 @@ FA.overlays = list() FA.overlays += image('icons/obj/monitors.dmi', "overlay_red") - // trigger a response team - spawn - sleep(100) - if(security_level == SEC_LEVEL_RED) trigger_armed_response_team() if(SEC_LEVEL_DELTA) world << "Attention! Delta security level reached!" world << "[config.alert_desc_delta]"