Shuttle SS keeps track of hostile environments (#19235)

* Shuttle SS keeps track of hostile environments

Instead of changing SSshuttle.emergencyNoEscape manually, datums now
register and clear themselves with the SS, and a hostile environment is
if any datums are registered.

Note that it's datums that can be registered, as rev and blob gamemodes
register themselves.

Overhauling this means that you can have multiple sources of no-recall,
which although can't happen at present, may do so in the future whenever
multi-antag rounds happen.

🆑 coiax
tweak: The AI doomsday device timer is more accurate.
fix: Fixes a bug where the doomsday device would take twice as long as
it should.
/🆑

AI doomsday timer uses world.time, uses fastprocess to make sure the
announcements go out on time, added observer countdown for
the AI doomsday device.

* Fixes bugs
This commit is contained in:
coiax
2016-07-11 16:53:23 +12:00
committed by oranges
parent 305cb279c8
commit 771c64084d
13 changed files with 113 additions and 65 deletions
+10
View File
@@ -135,3 +135,13 @@
else if(T.cooldown)
var/seconds_left = max(0, (T.cooldown_timer - world.time) / 10)
return "[round(seconds_left)]"
/obj/effect/countdown/doomsday
name = "doomsday countdown"
/obj/effect/countdown/doomsday/get_value()
var/obj/machinery/doomsday_device/DD = attached_to
if(!istype(DD))
return
else if(DD.timing)
. = DD.seconds_remaining()
+3 -7
View File
@@ -23,17 +23,13 @@
if(nuking)
set_security_level("red")
nuking = 0
SSshuttle.emergencyNoEscape = 0
if(SSshuttle.emergency.mode == SHUTTLE_STRANDED)
SSshuttle.emergency.mode = SHUTTLE_DOCKED
SSshuttle.emergency.timer = world.time
priority_announce("Hostile enviroment resolved. You have 3 minutes to board the Emergency Shuttle.", null, 'sound/AI/shuttledock.ogg', "Priority")
nuking = FALSE
for(var/obj/item/weapon/pinpointer/point in pinpointer_list)
point.the_disk = null //Point back to the disk.
if(doomsday_device)
doomsday_device.timing = 0
doomsday_device.timing = FALSE
SSshuttle.clearHostileEnvironment(doomsday_device)
qdel(doomsday_device)
if(explosive)
spawn(10)
+15 -11
View File
@@ -274,19 +274,20 @@
if(SHUTTLE_DOCKED)
if(time_left <= ENGINES_START_TIME)
if(SSshuttle.emergencyNoEscape)
priority_announce("Hostile environment detected. Departure has been postponed indefinitely pending conflict resolution.", null, 'sound/misc/notice1.ogg', "Priority")
sound_played = 0 //Since we didn't launch, we will need to rev up the engines again next pass.
mode = SHUTTLE_STRANDED
else
mode = SHUTTLE_IGNITING
for(var/A in SSshuttle.mobile)
var/obj/docking_port/mobile/M = A
if(M.launch_status == UNLAUNCHED) //Pods will not launch from the mine/planet, and other ships won't launch unless we tell them to.
M.check_transit_zone()
mode = SHUTTLE_IGNITING
SSshuttle.checkHostileEnvironment()
if(mode == SHUTTLE_STRANDED)
return
for(var/A in SSshuttle.mobile)
var/obj/docking_port/mobile/M = A
if(M.launch_status == UNLAUNCHED) //Pods will not launch from the mine/planet, and other ships won't launch unless we tell them to.
M.check_transit_zone()
if(SHUTTLE_IGNITING)
var/success = TRUE
SSshuttle.checkHostileEnvironment()
if(mode == SHUTTLE_STRANDED)
return
success &= (check_transit_zone() == TRANSIT_READY)
for(var/A in SSshuttle.mobile)
@@ -317,6 +318,8 @@
launch_status = ENDGAME_LAUNCHED
setTimer(SSshuttle.emergencyEscapeTime)
priority_announce("The Emergency Shuttle has left the station. Estimate [timeLeft(600)] minutes until the shuttle docks at Central Command.", null, null, "Priority")
if(SHUTTLE_STRANDED)
SSshuttle.checkHostileEnvironment()
if(SHUTTLE_ESCAPE)
if(time_left <= 0)
//move each escape pod to its corresponding escape dock
@@ -428,13 +431,14 @@
/obj/item/weapon/storage/pod/MouseDrop(over_object, src_location, over_location)
if(security_level == SEC_LEVEL_RED || security_level == SEC_LEVEL_DELTA)
return ..()
. = ..()
else
usr << "The storage unit will only unlock during a Red or Delta security alert."
/obj/item/weapon/storage/pod/attack_hand(mob/user)
return
/obj/docking_port/mobile/emergency/backup
name = "backup shuttle"
id = "backup"