From 4bce5c442f3b9eab3aa21aceaedcb1aa77265e6f Mon Sep 17 00:00:00 2001 From: Giacomand Date: Mon, 21 Apr 2014 00:10:47 +0100 Subject: [PATCH] You now have to give a reason for shuttle calls, from the communication console. The reason must be over 12 characters. You can open the communication console UI by using your ID card. Added a config option for the shuttle refuel delay, defaults to 20 minutes. Fixed a bug where the refuel delay was counting the pre-game lobby time. --- code/controllers/configuration.dm | 3 + code/game/gamemodes/gameticker.dm | 3 + .../game/machinery/computer/communications.dm | 61 ++++++++++++++----- config/game_options.txt | 2 + 4 files changed, 54 insertions(+), 15 deletions(-) diff --git a/code/controllers/configuration.dm b/code/controllers/configuration.dm index b277b48eda6..fb8055ae540 100644 --- a/code/controllers/configuration.dm +++ b/code/controllers/configuration.dm @@ -82,6 +82,7 @@ var/continuous_round_rev = 0 // Gamemodes which end instantly will instead keep on going until the round ends by escape shuttle or nuke. var/continuous_round_wiz = 0 var/continuous_round_malf = 0 + var/shuttle_refuel_delay = 12000 var/show_game_type_odds = 0 //if set this allows players to see the odds of each roundtype on the get revision screen var/mutant_races = 0 //players can choose their mutant race before joining the game @@ -336,6 +337,8 @@ config.continuous_round_wiz = 1 if("continuous_round_malf") config.continuous_round_malf = 1 + if("shuttle_refuel_delay") + config.shuttle_refuel_delay = text2num(value) if("show_game_type_odds") config.show_game_type_odds = 1 if("ghost_interaction") diff --git a/code/game/gamemodes/gameticker.dm b/code/game/gamemodes/gameticker.dm index dab9de3ee82..f508252b9ab 100644 --- a/code/game/gamemodes/gameticker.dm +++ b/code/game/gamemodes/gameticker.dm @@ -1,4 +1,5 @@ var/global/datum/controller/gameticker/ticker +var/round_start_time = 0 #define GAME_STATE_PREGAME 1 #define GAME_STATE_SETTING_UP 2 @@ -114,6 +115,8 @@ var/global/datum/controller/gameticker/ticker else src.mode.announce() + round_start_time = world.time + supply_shuttle.process() //Start the supply shuttle regenerating points master_controller.process() //Start master_controller.process() lighting_controller.process() //Start processing DynamicAreaLighting updates diff --git a/code/game/machinery/computer/communications.dm b/code/game/machinery/computer/communications.dm index 783792e774a..3b674d94b03 100644 --- a/code/game/machinery/computer/communications.dm +++ b/code/game/machinery/computer/communications.dm @@ -1,5 +1,7 @@ //This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:31 +var/const/CALL_SHUTTLE_REASON_LENGTH = 12 + // The communications computer /obj/machinery/computer/communications name = "communications console" @@ -121,7 +123,7 @@ src.state = STATE_CALLSHUTTLE if("callshuttle2") if(src.authenticated) - call_shuttle_proc(usr) + call_shuttle_proc(usr, href_list["call"]) if(emergency_shuttle.online) post_status("shuttle") src.state = STATE_DEFAULT @@ -245,7 +247,7 @@ if("ai-callshuttle") src.aistate = STATE_CALLSHUTTLE if("ai-callshuttle2") - call_shuttle_proc(usr) + call_shuttle_proc(usr, href_list["ai-callshuttle2"]) src.aistate = STATE_DEFAULT if("ai-messagelist") src.aicurrmsg = 0 @@ -315,6 +317,8 @@ if(authenticated == 1) authenticated = 2 user << "You scramble the communication routing circuits!" + else if(istype(I, /obj/item/weapon/card/id)) + attack_hand(user) else ..() return @@ -378,9 +382,9 @@ else dat += "
\[ Log In \]" if(STATE_CALLSHUTTLE) - dat += "Are you sure you want to call the shuttle? \[ OK | Cancel \]" + dat += get_call_shuttle_form() if(STATE_CANCELSHUTTLE) - dat += "Are you sure you want to cancel the shuttle? \[ OK | Cancel \]" + dat += get_cancel_shuttle_form() if(STATE_MESSAGELIST) dat += "Messages:" for(var/i = 1; i<=src.messagetitle.len; i++) @@ -438,7 +442,32 @@ popup.open() +/obj/machinery/computer/communications/proc/get_call_shuttle_form() + var/dat = {""} + dat += "
" + dat += "" + dat += "" + dat += "Nature of emergency:
" + dat += "
Are you sure you want to call the shuttle? \[
\]" + return dat + +/obj/machinery/computer/communications/proc/get_cancel_shuttle_form() + var/dat = "
" + dat += "" + dat += "" + dat += "
Are you sure you want to cancel the shuttle? \[
\]" + return dat /obj/machinery/computer/communications/proc/interact_ai(var/mob/living/silicon/ai/user as mob) var/dat = "" @@ -457,7 +486,7 @@ dat += "
\[ Change Alert Level \]" dat += "
\[ Emergency Maintenance Access \]" if(STATE_CALLSHUTTLE) - dat += "Are you sure you want to call the shuttle? \[ OK | Cancel \]" + dat += get_call_shuttle_form() if(STATE_MESSAGELIST) dat += "Messages:" for(var/i = 1; i<=src.messagetitle.len; i++) @@ -510,16 +539,11 @@ return dat -/proc/call_shuttle_proc(var/mob/user) +/proc/call_shuttle_proc(var/mob/user, var/call_reason) if ((!( ticker ) || emergency_shuttle.location)) return -/* DEATH SQUADS - if(sent_strike_team == 1) - user << "Centcom will not allow the shuttle to be called. Consider all contracts terminated." - return -*/ - if(world.time < 6000) - user << "The emergency shuttle is refueling. Please wait another [round((6000-world.time)/600)] minutes before trying again." + if(world.time - round_start_time < config.shuttle_refuel_delay) + user << "The emergency shuttle is refueling. Please wait another [round((config.shuttle_refuel_delay - round_start_time)/600)] minutes before trying again." return if(emergency_shuttle.direction == -1) @@ -530,13 +554,20 @@ user << "The emergency shuttle is already on its way." return + call_reason = strip_html_simple(trim(call_reason)) + + if(length(call_reason) < CALL_SHUTTLE_REASON_LENGTH) + user << "You must provide a reason." + return + var/area/signal_origin = get_area(user) + var/emergency_reason = "\nNature of emergency:\n\n[call_reason]" if (seclevel2num(get_security_level()) == SEC_LEVEL_RED) // There is a serious threat we gotta move no time to give them five minutes. emergency_shuttle.incall(0.6, signal_origin) - captain_announce("The emergency shuttle has been called. Red Alert state confirmed: Dispatching priority shuttle. It will arrive in [round(emergency_shuttle.timeleft()/60)] minutes.") + captain_announce("The emergency shuttle has been called. Red Alert state confirmed: Dispatching priority shuttle. It will arrive in [round(emergency_shuttle.timeleft()/60)] minutes.[emergency_reason]") else emergency_shuttle.incall(1, signal_origin) - captain_announce("The emergency shuttle has been called. It will arrive in [round(emergency_shuttle.timeleft()/60)] minutes.") + captain_announce("The emergency shuttle has been called. It will arrive in [round(emergency_shuttle.timeleft()/60)] minutes.[emergency_reason]") log_game("[key_name(user)] has called the shuttle.") message_admins("[key_name_admin(user)] has called the shuttle.", 1) diff --git a/config/game_options.txt b/config/game_options.txt index 1ce50aa0eb5..b9ca7e763ca 100644 --- a/config/game_options.txt +++ b/config/game_options.txt @@ -105,6 +105,8 @@ PROBABILITY SANDBOX 0 #CONTINUOUS_ROUND_WIZ #CONTINUOUS_ROUND_MALF +## The amount of time it takes for the emergency shuttle to be called, from round start. +SHUTTLE_REFUEL_DELAY 12000 ## Variables calculate how number of antagonists will scale to population. ## Used as (Antagonists = Population / Coeff)