mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 10:12:45 +00:00
[MIRROR] Removes sleeping from the code in more places (#10611)
Co-authored-by: Cameron Lennox <killer65311@gmail.com>
This commit is contained in:
committed by
GitHub
parent
174fb57a2c
commit
de641ab6f8
@@ -72,7 +72,7 @@
|
||||
INVOKE_ASYNC(src, PROC_REF(toggle_all), FALSE)
|
||||
. = TRUE
|
||||
if("scan")
|
||||
scanscrubbers(ui.user)
|
||||
scanscrubbers_user(ui.user)
|
||||
. = TRUE
|
||||
|
||||
add_fingerprint(ui.user)
|
||||
@@ -92,7 +92,7 @@
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/computer/area_atmos/proc/scanscrubbers(mob/user)
|
||||
/obj/machinery/computer/area_atmos/proc/scanscrubbers()
|
||||
connectedscrubbers = list()
|
||||
|
||||
var/found = 0
|
||||
@@ -103,6 +103,8 @@
|
||||
if(!found)
|
||||
status = "ERROR: No scrubber found!"
|
||||
|
||||
/obj/machinery/computer/area_atmos/proc/scanscrubbers_user(mob/user) //Used when the user is in the UI and scans for scrubbers.
|
||||
scanscrubbers()
|
||||
updateUsrDialog(user)
|
||||
|
||||
// The one that only works in the same map area
|
||||
@@ -121,6 +123,8 @@
|
||||
if(!found)
|
||||
status = "ERROR: No scrubber found!"
|
||||
|
||||
/obj/machinery/computer/area_atmos/area/scanscrubbers_user(mob/user) //Used when the user is in the UI and scans for scrubbers.
|
||||
scanscrubbers()
|
||||
updateUsrDialog(user)
|
||||
|
||||
/obj/machinery/computer/area_atmos/area/validscrubber(var/obj/machinery/portable_atmospherics/powered/scrubber/huge/scrubber)
|
||||
|
||||
@@ -26,12 +26,12 @@
|
||||
/obj/machinery/vr_sleeper/alien/process()
|
||||
if(stat & (BROKEN))
|
||||
if(occupant)
|
||||
go_out()
|
||||
perform_exit()
|
||||
visible_message(span_infoplain(span_bold("\The [src]") + " emits a low droning sound, before the pod door clicks open."))
|
||||
return
|
||||
else if(eject_dead && occupant && occupant.stat == DEAD)
|
||||
visible_message(span_warning("\The [src] sounds an alarm, swinging its hatch open."))
|
||||
go_out()
|
||||
perform_exit()
|
||||
|
||||
/obj/machinery/vr_sleeper/alien/attackby(var/obj/item/I, var/mob/user)
|
||||
add_fingerprint(user)
|
||||
@@ -47,19 +47,17 @@
|
||||
if(usr.incapacitated())
|
||||
return
|
||||
|
||||
var/forced = FALSE
|
||||
|
||||
if(stat & (BROKEN) || (eject_dead && occupant && occupant.stat == DEAD))
|
||||
forced = TRUE
|
||||
|
||||
go_out(forced)
|
||||
perform_exit()
|
||||
else
|
||||
go_out()
|
||||
add_fingerprint(usr)
|
||||
|
||||
/obj/machinery/vr_sleeper/alien/go_out(var/forced = TRUE)
|
||||
/obj/machinery/vr_sleeper/alien/go_out()
|
||||
if(!occupant)
|
||||
return
|
||||
|
||||
if(!forced && avatar)
|
||||
if(avatar)
|
||||
if(tgui_alert(avatar, "Someone wants to remove you from virtual reality. Do you want to leave?", "Leave VR?", list("Yes", "No")) != "Yes")
|
||||
return
|
||||
|
||||
@@ -103,7 +101,7 @@
|
||||
to_chat(occupant,span_alien("\The [src] begins to [pick("whir","hum","pulse")] as a screen appears in front of you."))
|
||||
if(tgui_alert(occupant, "This pod is already linked. Are you certain you wish to engage?", "Commmit?", list("Yes", "No")) != "Yes")
|
||||
visible_message(span_alien("\The [src] pulses!"))
|
||||
go_out(TRUE)
|
||||
perform_exit()
|
||||
return
|
||||
|
||||
to_chat(occupant,span_alien("Your mind blurs as information bombards you."))
|
||||
|
||||
@@ -56,12 +56,12 @@
|
||||
/obj/machinery/vr_sleeper/process()
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
if(occupant)
|
||||
go_out()
|
||||
occupant.exit_vr(FALSE)
|
||||
visible_message(span_infoplain(span_bold("\The [src]") + " emits a low droning sound, before the pod door clicks open."))
|
||||
return
|
||||
else if(eject_dead && occupant && occupant.stat == DEAD) // If someone dies somehow while inside, spit them out.
|
||||
visible_message(span_warning("\The [src] sounds an alarm, swinging its hatch open."))
|
||||
go_out()
|
||||
occupant.exit_vr(FALSE)
|
||||
|
||||
/obj/machinery/vr_sleeper/update_icon()
|
||||
icon_state = "[base_state][occupant ? "1" : "0"]"
|
||||
@@ -99,7 +99,7 @@
|
||||
if(occupant && avatar)
|
||||
avatar.exit_vr()
|
||||
avatar = null
|
||||
go_out()
|
||||
perform_exit()
|
||||
return
|
||||
|
||||
|
||||
@@ -132,7 +132,7 @@
|
||||
visible_message(span_danger("\The [src]'s internal lighting flashes rapidly, before the hatch swings open with a cloud of smoke."))
|
||||
smoke.set_up(severity, 0, src)
|
||||
smoke.start("#202020")
|
||||
go_out()
|
||||
perform_exit()
|
||||
|
||||
..(severity)
|
||||
|
||||
@@ -144,12 +144,10 @@
|
||||
if(usr.incapacitated())
|
||||
return
|
||||
|
||||
var/forced = FALSE
|
||||
|
||||
if(stat & (BROKEN|NOPOWER) || occupant && occupant.stat == DEAD)
|
||||
forced = TRUE
|
||||
|
||||
go_out(forced)
|
||||
perform_exit()
|
||||
else
|
||||
go_out()
|
||||
add_fingerprint(usr)
|
||||
|
||||
/obj/machinery/vr_sleeper/verb/climb_in()
|
||||
@@ -165,7 +163,7 @@
|
||||
/obj/machinery/vr_sleeper/relaymove(mob/user as mob)
|
||||
if(user.incapacitated())
|
||||
return 0 //maybe they should be able to get out with cuffs, but whatever
|
||||
go_out(TRUE)
|
||||
perform_exit()
|
||||
|
||||
/obj/machinery/vr_sleeper/proc/go_in(var/mob/M, var/mob/user)
|
||||
if(!M)
|
||||
@@ -204,16 +202,26 @@
|
||||
to_chat(user, span_warning("\The [src] rejects [M] with a sharp beep."))
|
||||
return
|
||||
|
||||
/obj/machinery/vr_sleeper/proc/go_out(var/forced = TRUE)
|
||||
/obj/machinery/vr_sleeper/proc/go_out()
|
||||
if(!occupant)
|
||||
return
|
||||
|
||||
if(!forced && avatar)
|
||||
if(avatar)
|
||||
if(tgui_alert(avatar, "Someone wants to remove you from virtual reality. Do you want to leave?", "Leave VR?", list("Yes", "No")) != "Yes")
|
||||
return
|
||||
|
||||
perform_exit()
|
||||
|
||||
//The actual bulk of the exit code.
|
||||
/obj/machinery/vr_sleeper/proc/perform_exit()
|
||||
if(!occupant)
|
||||
return
|
||||
|
||||
avatar = null
|
||||
|
||||
if(occupant.vr_link)
|
||||
occupant.vr_link.exit_vr(FALSE)
|
||||
|
||||
if(occupant.client)
|
||||
occupant.client.eye = occupant.client.mob
|
||||
occupant.client.perspective = MOB_PERSPECTIVE
|
||||
@@ -249,6 +257,8 @@
|
||||
// If they've already enterred VR, and are reconnecting, prompt if they want a new body
|
||||
if(avatar && tgui_alert(occupant, "You already have a [avatar.stat == DEAD ? "" : "deceased "]Virtual Reality avatar. Would you like to use it?", "New avatar", list("Yes", "No")) != "Yes")
|
||||
// Delink the mob
|
||||
if(!occupant) //We can walk out of this before we give a prompt...A TGUI state won't help here sadly.
|
||||
return
|
||||
occupant.vr_link = null
|
||||
avatar = null
|
||||
|
||||
@@ -266,7 +276,7 @@
|
||||
var/tf = null
|
||||
if(tgui_alert(occupant, "Would you like to play as a different creature?", "Join as a mob?", list("Yes", "No")) == "Yes")
|
||||
var/k = tgui_input_list(occupant, "Please select a creature:", "Mob list", vr_mob_tf_options)
|
||||
if(!k)
|
||||
if(!k || !occupant) //Our occupant can walk out.
|
||||
return 0
|
||||
tf = vr_mob_tf_options[k]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user