Merge pull request #10999 from Kyep/ghost_verb

Tweaks Ghost Verb
This commit is contained in:
variableundefined
2019-04-07 15:27:56 +08:00
committed by GitHub
4 changed files with 46 additions and 10 deletions
+23 -10
View File
@@ -49,7 +49,7 @@ var/list/image/ghost_darkness_images = list() //this is a list of images for thi
T = get_turf(body) //Where is the body located?
attack_log = body.attack_log //preserve our attack logs by copying them to our ghost
var/mutable_appearance/MA = copy_appearance(body)
var/mutable_appearance/MA = copy_appearance(body)
if(body.mind && body.mind.name)
MA.name = body.mind.name
else if(body.real_name)
@@ -179,30 +179,44 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
if(P)
if(TOO_EARLY_TO_GHOST)
warningmsg = "It's too early in the shift to enter cryo"
// If it's not too early, we'll skip straight to ghosting out without penalty
else if(suiciding && TOO_EARLY_TO_GHOST)
warningmsg = "You have committed suicide too early in the round"
else if(stat != DEAD)
warningmsg = "You are alive"
if(isAI(src))
warningmsg = "You are a living AI! You should probably use OOC -> Wipe Core instead."
else if(GLOB.non_respawnable_keys[ckey])
warningmsg = "You have lost your right to respawn"
if(!warningmsg)
ghostize(1)
else
if(warningmsg)
var/response
var/alertmsg = "Are you -sure- you want to ghost?\n([warningmsg]. If you ghost now, you probably won't be able to rejoin the round! You can't change your mind, so choose wisely!)"
response = alert(src, alertmsg,"Are you sure you want to ghost?","Stay in body","Ghost")
if(response != "Ghost")
return //didn't want to ghost after-all
StartResting()
var/mob/dead/observer/ghost = ghostize(0) //0 parameter is so we can never re-enter our body, "Charlie, you can never come baaaack~" :3
ghost.timeofdeath = world.time // Because the living mob won't have a time of death and we want the respawn timer to work properly.
return
if(stat == CONSCIOUS)
if(!is_admin_level(z))
player_ghosted = 1
if(mind && mind.special_role)
message_admins("[key_name_admin(src)] has ghosted while alive, with special_role: [mind.special_role]")
if(warningmsg)
// Not respawnable
var/mob/dead/observer/ghost = ghostize(0) // 0 parameter stops them re-entering their body
ghost.timeofdeath = world.time // Because the living mob won't have a time of death and we want the respawn timer to work properly.
else
// Respawnable
ghostize(1)
// If mob in morgue tray, update tray
var/obj/structure/morgue/Morgue = locate() in M.loc
if(istype(M.loc, /obj/structure/morgue))
Morgue = M.loc
if(Morgue)
Morgue.update()
// If mob in cryopod, despawn mob
if(P)
if(!P.control_computer)
P.find_control_computer(urgent=1)
@@ -210,7 +224,6 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
P.despawn_occupant()
return
/mob/dead/observer/Move(NewLoc, direct)
following = null
dir = direct
@@ -37,6 +37,17 @@
if(life_tick == 1)
regenerate_icons() // Make sure the inventory updates
handle_ghosted()
/mob/living/carbon/human/proc/handle_ghosted()
if(player_ghosted > 0 && stat == CONSCIOUS && job && !restrained())
if(key)
player_ghosted = 0
else
player_ghosted++
if(player_ghosted % 150 == 0)
force_cryo_human(src)
/mob/living/carbon/human/calculate_affecting_pressure(var/pressure)
..()
var/pressure_difference = abs( pressure - ONE_ATMOSPHERE )
+3
View File
@@ -173,6 +173,9 @@
//SSD var, changed it up some so people can have special things happen for different mobs when SSD.
var/player_logged = 0
//Ghosted var, set only if a player has manually ghosted out of this mob.
var/player_ghosted = 0
var/turf/listed_turf = null //the current turf being examined in the stat panel
var/list/shouldnt_see = list(/atom/movable/lighting_overlay) //list of objects that this mob shouldn't see in the stat panel. this silliness is needed because of AI alt+click and cult blood runes