Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Makes the emergency shuttle and status display process timed to the second #36388

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions code/controllers/shuttle_controller.dm
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ var/global/datum/emergency_shuttle/emergency_shuttle
var/voting_cache = 0

var/warmup_sound = 0
var/takeoff = 0

var/was_early_launched = FALSE //had timer shortened to 10 seconds

Expand Down Expand Up @@ -336,7 +337,7 @@ var/global/datum/emergency_shuttle/emergency_shuttle

online = 0

/datum/emergency_shuttle/proc/process()
/datum/emergency_shuttle/proc/process(tick)
if(!online || shutdown)
return

Expand All @@ -346,6 +347,11 @@ var/global/datum/emergency_shuttle/emergency_shuttle
if(timeleft < 0) // Sanity
timeleft = 0


for(var/obj/machinery/status_display/S in status_displays)
if(S.mode == 1)
S.update()

if(timeleft > 6)
warmup_sound = 0

Expand All @@ -354,9 +360,10 @@ var/global/datum/emergency_shuttle/emergency_shuttle

/* --- Shuttle is in transit toward centcom --- */
if(direction == 2)
for(var/obj/structure/shuttle/engine/propulsion/P in shuttle.linked_area)
spawn()
P.shoot_exhaust(backward = 3)
if(tick % 20 == 0)
for(var/obj/structure/shuttle/engine/propulsion/P in shuttle.linked_area)
spawn()
P.shoot_exhaust(backward = 3)

var/collision_imminent = FALSE
for(var/datum/shuttle/escape/pod/pod in escape_pods)
Expand Down Expand Up @@ -409,7 +416,8 @@ var/global/datum/emergency_shuttle/emergency_shuttle
warmup_sound = 1
hyperspace_sounds("begin")
// Just before it leaves, close the damn doors!
if(timeleft == 2 || timeleft == 1)
if(timeleft <= 2 && !takeoff)
takeoff = 1
for(var/obj/machinery/door/unpowered/shuttle/D in shuttle.linked_area)
spawn(0)
D.close()
Expand Down
4 changes: 2 additions & 2 deletions code/controllers/subsystem/emergency_shuttle.dm
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ var/datum/subsystem/emergency_shuttle/SSemergency_shuttle
/datum/subsystem/emergency_shuttle
name = "Emergency Shuttle"
init_order = SS_INIT_EMERGENCY_SHUTTLE
wait = 2 SECONDS
SECBATON-GRIFFON marked this conversation as resolved.
Show resolved Hide resolved
wait = 1
flags = SS_KEEP_TIMING | SS_NO_TICK_CHECK


Expand All @@ -20,4 +20,4 @@ var/datum/subsystem/emergency_shuttle/SSemergency_shuttle


/datum/subsystem/emergency_shuttle/fire(resumed = FALSE)
emergency_shuttle.process()
emergency_shuttle.process(times_fired)
6 changes: 5 additions & 1 deletion code/controllers/subsystem/supply_shuttle.dm
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ var/datum/subsystem/supply_shuttle/SSsupply_shuttle
name = "Supply Shuttle"
init_order = SS_INIT_SUPPLY_SHUTTLE
flags = SS_NO_TICK_CHECK
wait = 1 SECONDS
wait = 1
//supply points have been replaced with MONEY MONEY MONEY - N3X
var/credits_per_slip = 5
var/credits_per_crate = 5
Expand Down Expand Up @@ -102,6 +102,10 @@ var/datum/subsystem/supply_shuttle/SSsupply_shuttle
centcomm_last_order = world.time
centcomm_order_cooldown = rand(modified_min,modified_max)

for(var/obj/machinery/status_display/supply/S in supply_displays)
if(S.mode == 4)
S.update()

/datum/supply_order
var/ordernum
var/datum/supply_packs/object = null
Expand Down
28 changes: 19 additions & 9 deletions code/game/machinery/status_display.dm
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
#define MODE_IMAGE 3
#define MODE_CARGO_TIMER 4

var/global/list/status_displays = list() //This list contains both normal status displays, and AI status dispays
var/global/list/status_displays = list() //This list contains both normal status displays, and AI status displays
var/global/list/supply_displays = list()

/obj/machinery/status_display
icon = 'icons/obj/status_display.dmi'
Expand Down Expand Up @@ -62,6 +63,10 @@ var/global/list/status_displays = list() //This list contains both normal status
if (ticker && ticker.current_state == GAME_STATE_PLAYING)
initialize()

/obj/machinery/status_display/supply/New()
..()
supply_displays |= src

/obj/machinery/status_display/initialize()
..()
if(radio_controller)
Expand All @@ -71,16 +76,14 @@ var/global/list/status_displays = list() //This list contains both normal status
.=..()
status_displays -= src

/obj/machinery/status_display/supply/Destroy()
.=..()
supply_displays -= src

// timed process
/obj/machinery/status_display/process()
if(stat & (FORCEDISABLE|NOPOWER))
remove_display()
return
if(spookymode)
spookymode = 0
remove_display()
return
update()
if(mode != MODE_SHUTTLE_TIMER && mode != MODE_CARGO_TIMER) // handled in their subsystems
jwhitak marked this conversation as resolved.
Show resolved Hide resolved
update()

/obj/machinery/status_display/attack_ai(mob/user)
if(spookymode)
Expand Down Expand Up @@ -131,6 +134,13 @@ var/global/list/status_displays = list() //This list contains both normal status
// set what is displayed

/obj/machinery/status_display/proc/update()
if(stat & (FORCEDISABLE|NOPOWER))
remove_display()
return
if(spookymode)
spookymode = 0
remove_display()
return
if(friendc && mode!=4) //Makes all status displays except supply shuttle timer display the eye -- Urist
set_picture("ai_friend")
return
Expand Down
Loading