Ports Nebula's spawn blurb + makes people spawn asleep in cryo cells. (#9227)

This commit is contained in:
Matt Atlas
2020-07-01 11:20:18 +02:00
committed by GitHub
parent b9b237cddd
commit 298bdfc725
7 changed files with 145 additions and 59 deletions
+35 -19
View File
@@ -377,15 +377,8 @@
EquipItemsStorage(H, H.client.prefs, spawn_in_storage)
if(istype(H) && !megavend) //give humans wheelchairs, if they need them.
var/obj/item/organ/external/l_foot = H.get_organ(BP_L_FOOT)
var/obj/item/organ/external/r_foot = H.get_organ(BP_R_FOOT)
if(!l_foot || !r_foot)
var/obj/structure/bed/chair/wheelchair/W = new /obj/structure/bed/chair/wheelchair(H.loc)
H.buckled = W
H.update_canmove()
W.set_dir(H.dir)
W.buckled_mob = H
W.add_fingerprint(H)
if(H.needs_wheelchair())
H.equip_wheelchair()
to_chat(H, "<B>You are [job.total_positions == 1 ? "the" : "a"] [alt_title ? alt_title : rank].</B>")
@@ -406,6 +399,8 @@
BITSET(H.hud_updateflag, IMPLOYAL_HUD)
BITSET(H.hud_updateflag, SPECIALROLE_HUD)
INVOKE_ASYNC(GLOBAL_PROC, .proc/show_location_blurb, H.client, 30)
Debug("ER/([H]): Completed.")
return H
@@ -520,16 +515,7 @@
if(LAZYLEN(spawn_in_storage))
EquipItemsStorage(H, H.client.prefs, spawn_in_storage)
if(istype(H)) //give humans wheelchairs, if they need them.
var/obj/item/organ/external/l_foot = H.get_organ(BP_L_FOOT)
var/obj/item/organ/external/r_foot = H.get_organ(BP_R_FOOT)
if(!l_foot || !r_foot)
var/obj/structure/bed/chair/wheelchair/W = new /obj/structure/bed/chair/wheelchair(H.loc)
H.buckled = W
H.update_canmove()
W.set_dir(H.dir)
W.buckled_mob = H
W.add_fingerprint(H)
//Gives glasses to the vision impaired
if(H.disabilities & NEARSIGHTED)
@@ -661,6 +647,7 @@
if(spawnpos.check_job_spawning(rank))
H.forceMove(pick(spawnpos.turfs))
. = spawnpos.msg
spawnpos.after_join(H)
else
to_chat(H, "Your chosen spawnpoint ([spawnpos.display_name]) is unavailable for your chosen job. Spawning you at the Arrivals shuttle instead.")
H.forceMove(pick(latejoin))
@@ -914,4 +901,33 @@
Debug("EA/([H]): Complete.")
return TRUE
/proc/show_location_blurb(client/C, duration)
set waitfor = 0
var/style = "font-family: 'Fixedsys'; -dm-text-outline: 1 black; font-size: 11px;"
var/area/A = get_area(C.mob)
var/text = "[worlddate2text()], [worldtime2text()]\n[station_name()], [A.name]"
text = uppertext(text)
var/obj/effect/overlay/T = new()
T.maptext_height = 64
T.maptext_width = 512
T.layer = SCREEN_LAYER+1
T.plane = FLOAT_PLANE
T.screen_loc = "LEFT+1,BOTTOM+2"
C.screen += T
animate(T, alpha = 255, time = 10)
for(var/i = 1 to length(text)+1)
T.maptext = "<span style=\"[style]\">[copytext(text,1,i)] </span>"
sleep(1)
addtimer(CALLBACK(GLOBAL_PROC, .proc/fade_location_blurb, C, T), duration)
/proc/fade_location_blurb(client/C, obj/T)
animate(T, alpha = 0, time = 5)
sleep(5)
C.screen -= T
qdel(T)
#undef Debug
+25 -29
View File
@@ -349,16 +349,14 @@ var/global/list/frozen_crew = list()
else
W.forceMove(get_turf(src))
flick("[initial(icon_state)]-anim", src)
icon_state = base_icon_state
global_announcer.autosay("[occupant.real_name], [occupant.mind.role_alt_title], [on_store_message]", "[on_store_name]")
visible_message(SPAN_NOTICE("\The [src] hums and hisses as it moves [occupant] into storage."))
frozen_crew += occupant
// Let SSjobs handle the rest.
SSjobs.DespawnMob(occupant)
set_occupant(null)
occupant = null
update_icon()
/obj/machinery/cryopod/attackby(var/obj/item/grab/G, var/mob/user)
if(istype(G))
@@ -395,8 +393,7 @@ var/global/list/frozen_crew = list()
M.client.perspective = EYE_PERSPECTIVE
M.client.eye = src
flick("[initial(icon_state)]-anim", src)
icon_state = occupied_icon_state
update_icon()
to_chat(M, SPAN_NOTICE("[on_enter_occupant_message]"))
to_chat(M, span("danger", "Press Ghost in the OOC tab to cryo, your character will shortly be removed from the round and the slot you occupy will be freed."))
@@ -478,13 +475,11 @@ var/global/list/frozen_crew = list()
to_chat(user, SPAN_NOTICE("You stop [L == user ? "climbing into" : "putting [L] into"] \the [name]."))
return
flick("[initial(icon_state)]-anim", src)
icon_state = occupied_icon_state
to_chat(L, SPAN_NOTICE("You feel cool air surround you. You go numb as your senses turn inward."))
to_chat(L, span("danger", "Press Ghost in the OOC tab to cryo, your character will shortly be removed from the round and the slot you occupy will be freed."))
occupant = L
time_entered = world.time
update_icon()
if(isipc(L))
var/choice = alert(L, "Would you like to save your tag data?", "Tag Persistence", "Yes", "No")
@@ -518,9 +513,6 @@ var/global/list/frozen_crew = list()
if(use_check_and_message(usr))
return
flick("[initial(icon_state)]-anim", src)
icon_state = base_icon_state
//Eject any items that aren't meant to be in the pod.
var/list/items = src.contents
if(occupant)
@@ -533,9 +525,8 @@ var/global/list/frozen_crew = list()
src.go_out()
add_fingerprint(usr)
name = initial(name)
return
update_icon()
/obj/machinery/cryopod/verb/move_inside()
set name = "Enter Pod"
@@ -560,18 +551,13 @@ var/global/list/frozen_crew = list()
if(!usr || !usr.client)
return
if(src.occupant)
if(occupant)
to_chat(usr, SPAN_WARNING("\The [src] is in use."))
return
usr.stop_pulling()
usr.client.perspective = EYE_PERSPECTIVE
usr.client.eye = src
usr.forceMove(src)
set_occupant(usr)
flick("[initial(icon_state)]-anim", src)
icon_state = occupied_icon_state
update_icon()
to_chat(usr, SPAN_NOTICE("[on_enter_occupant_message]"))
to_chat(usr, span("danger", "Press Ghost in the OOC tab to cryo, your character will shortly be removed from the round and the slot you occupy will be freed."))
@@ -606,15 +592,25 @@ var/global/list/frozen_crew = list()
occupant.client.perspective = MOB_PERSPECTIVE
occupant.forceMove(get_turf(src))
set_occupant(null)
occupant = null
update_icon()
flick("[initial(icon_state)]-anim", src)
icon_state = base_icon_state
return
/obj/machinery/cryopod/proc/set_occupant(var/occupant)
/obj/machinery/cryopod/proc/set_occupant(var/mob/living/carbon/occupant)
src.occupant = occupant
name = initial(name)
occupant.forceMove(src)
occupant.stop_pulling()
if(occupant.client)
occupant.client.perspective = EYE_PERSPECTIVE
occupant.client.eye = src
update_icon()
/obj/machinery/cryopod/update_icon()
if(occupant)
name = "[name] ([occupant])"
icon_state = occupied_icon_state
else
icon_state = base_icon_state
name = initial(name)
/obj/machinery/cryopod/relaymove(var/mob/user)
go_out()
+20 -6
View File
@@ -5,14 +5,17 @@
var/list/restrict_job = null
var/list/disallow_job = null
proc/check_job_spawning(job)
if(restrict_job && !(job in restrict_job))
return 0
/datum/spawnpoint/proc/check_job_spawning(job)
if(restrict_job && !(job in restrict_job))
return FALSE
if(disallow_job && (job in disallow_job))
return 0
if(disallow_job && (job in disallow_job))
return FALSE
return 1
return TRUE
/datum/spawnpoint/proc/after_join(mob/victim)
return
/datum/spawnpoint/arrivals
display_name = "Arrivals Shuttle"
@@ -33,6 +36,17 @@
..()
turfs = latejoin_cryo
/datum/spawnpoint/cryo/after_join(mob/victim)
if(!istype(victim))
return
var/area/A = get_area(victim)
for(var/obj/machinery/cryopod/C in A)
if(!C.occupant)
C.set_occupant(victim, 1)
victim.Sleeping(3)
to_chat(victim,SPAN_NOTICE("You are slowly waking up from the cryostasis aboard [current_map.full_name]. It might take a few seconds."))
return
/datum/spawnpoint/cyborg
display_name = "Cyborg Storage"
msg = "has been activated from storage"
@@ -299,9 +299,7 @@
sleeping = max(sleeping-1, 0)
blinded = TRUE
stat = UNCONSCIOUS
else if(resting)
// insert dial up tone
else
else if(!resting)
stat = CONSCIOUS
// Eyes and blindness.
+4 -1
View File
@@ -944,4 +944,7 @@ default behaviour is:
if(auras)
for(var/a in auras)
remove_aura(a)
return ..()
return ..()
/mob/living/proc/needs_wheelchair()
return FALSE
+18 -1
View File
@@ -1204,4 +1204,21 @@ proc/is_blind(A)
return result
/mob/proc/remove_blood_simple(var/blood)
return
return
/mob/living/carbon/human/needs_wheelchair()
var/stance_damage = 0
for(var/limb_tag in list(BP_L_LEG, BP_R_LEG, BP_L_FOOT, BP_R_FOOT))
var/obj/item/organ/external/E = organs_by_name[limb_tag]
if(!E || !E.is_usable())
stance_damage += 2
return stance_damage >= 4
/mob/living/carbon/human/proc/equip_wheelchair()
var/obj/structure/bed/chair/wheelchair/W = new(get_turf(src))
if(isturf(loc))
buckled = W
update_canmove()
W.set_dir(dir)
W.buckled_mob = src
W.add_fingerprint(src)
+42
View File
@@ -0,0 +1,42 @@
################################
# Example Changelog File
#
# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb.
#
# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.)
# When it is, any changes listed below will disappear.
#
# Valid Prefixes:
# bugfix
# wip (For works in progress)
# tweak
# soundadd
# sounddel
# rscadd (general adding of nice things)
# rscdel (general deleting of nice things)
# imageadd
# imagedel
# maptweak
# spellcheck (typo fixes)
# experiment
# balance
# admin
# backend
# security
# refactor
#################################
# Your name.
author: MattAtlas
# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again.
delete-after: True
# Any changes you've made. See valid prefix list above.
# INDENT WITH TWO SPACES. NOT TABS. SPACES.
# SCREW THIS UP AND IT WON'T WORK.
# Also, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries.
# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog.
changes:
- rscadd: "If you chose to spawn at cryostorage, you will now spawn inside the cryocells, asleep."
- rscadd: "Added a short spawn blurb."