Allows a delta malf AI to recall the shuttle (#26286)

* Allows a delta malf AI to recall the shuttle

* formatting

* New error message
This commit is contained in:
adrian
2020-05-07 20:41:14 -03:00
committed by GitHub
parent e433050e22
commit f1e9cf5c40
5 changed files with 32 additions and 20 deletions

View File

@@ -58,7 +58,7 @@
//Shuttle
using = getFromPool(/obj/abstract/screen)
using.name = "Call Emergency Shuttle"
using.name = "(Re)Call Emergency Shuttle"
using.icon = 'icons/mob/screen_ai.dmi'
using.icon_state = "call_shuttle"
using.screen_loc = ui_ai_shuttle

View File

@@ -502,10 +502,10 @@
var/mob/living/silicon/ai/AI = usr
AI.make_announcement()
if("Call Emergency Shuttle")
if("(Re)Call Emergency Shuttle")
if(isAI(usr))
var/mob/living/silicon/ai/AI = usr
AI.ai_call_shuttle()
AI.ai_call_or_recall_shuttle()
if("State Laws")
if(isAI(usr))

View File

@@ -8,6 +8,11 @@
#define SHUTTLETRANSITTIME 120 // 2 minutes = 120 seconds
#define SHUTTLEGRACEPERIOD 300 // time after roundstart until the shuttle can be called, 5 minutes = 300 seconds
#define EMERGENCY_SHUTTLE_RECALLED -1
#define EMERGENCY_SHUTTLE_STANDBY 0
#define EMERGENCY_SHUTTLE_GOING_TO_STATION 1
#define EMERGENCY_SHUTTLE_GOING_TO_CENTCOMM 2
var/global/datum/emergency_shuttle/emergency_shuttle
datum/emergency_shuttle

View File

@@ -96,7 +96,7 @@ rcd light flash thingy on matter drain
/datum/AI_Module/small/overload_machine
module_name = "Machine overload"
mod_pick_name = "overload"
description = "Overloads an electrical machine, causing a small explosion. 2 uses."
description = "Overloads an electrical machine, causing a small explosion after a short delay. 2 uses."
uses = 2
cost = 15
power_type = /spell/targeted/overload_machine

View File

@@ -338,16 +338,26 @@ var/list/ai_list = list()
/mob/living/silicon/ai/proc/ai_roster()
show_station_manifest()
/mob/living/silicon/ai/proc/ai_call_shuttle()
/mob/living/silicon/ai/proc/ai_call_or_recall_shuttle()
if(isDead())
to_chat(src, "You can't call the shuttle because you are dead!")
to_chat(src, "<span class='warning'>You can't call/recall the shuttle because you are dead!</span>")
return
if(istype(usr,/mob/living/silicon/ai))
var/mob/living/silicon/ai/AI = src
if(AI.control_disabled)
to_chat(usr, "Wireless control is disabled!")
to_chat(usr, "<span class='warning'>Wireless control is disabled!</span>")
return
switch(emergency_shuttle.direction)
if(EMERGENCY_SHUTTLE_RECALLED)
to_chat(usr, "<span class='warning'>Wait until the shuttle arrives at Centcomm and try again</span>")
if(EMERGENCY_SHUTTLE_STANDBY)
ai_call_shuttle()
if(EMERGENCY_SHUTTLE_GOING_TO_STATION)
ai_recall_shuttle()
if(EMERGENCY_SHUTTLE_GOING_TO_CENTCOMM)
to_chat(usr, "<span class='warning'>Too late!</span>")
/mob/living/silicon/ai/proc/ai_call_shuttle()
var/justification = stripped_input(usr, "Please input a concise justification for the shuttle call. Note that failure to properly justify a shuttle call may lead to recall or termination.", "Nanotrasen Anti-Comdom Systems")
if(!justification)
return
@@ -361,20 +371,17 @@ var/list/ai_list = list()
if(C)
C.post_status("shuttle")
return
/mob/living/silicon/ai/proc/ai_cancel_call()
set category = "AI Commands"
if(isDead())
to_chat(src, "You can't send the shuttle back because you are dead!")
/mob/living/silicon/ai/proc/ai_recall_shuttle()
if(!ismalf(src))
to_chat(usr, "<span class='warning'>Your morality core throws an error. Recalling an emergency shuttle is a symptom of a malfunctioning artificial intelligence.</span>")
return
if(istype(usr,/mob/living/silicon/ai))
var/mob/living/silicon/ai/AI = src
if(AI.control_disabled)
to_chat(src, "Wireless control is disabled!")
return
recall_shuttle(src)
var/datum/faction/malf/M = find_active_faction_by_member(mind.GetRole(MALF))
if(M?.stage != FACTION_ENDGAME)
to_chat(usr, "<span class='warning'>You need to initiate the takeover first</span>")
return
var/confirm = alert("Are you sure you want to recall the shuttle?", "Confirm Recall Shuttle", "Yes", "Cancel")
if(confirm == "Yes")
recall_shuttle(src)
/mob/living/silicon/ai/check_eye(var/mob/user as mob)
if(!current)