mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-23 03:57:13 +01:00
Merge pull request #5209 from Krausus/OnceYouLeaveYouCannotComeBack
Changes to Player Respawnability
This commit is contained in:
@@ -1252,6 +1252,7 @@
|
||||
message_admins("[key_name_admin(usr)] has sent [key_name_admin(M)] back to the Lobby.")
|
||||
|
||||
var/mob/new_player/NP = new()
|
||||
non_respawnable_keys -= M.ckey
|
||||
NP.ckey = M.ckey
|
||||
qdel(M)
|
||||
|
||||
|
||||
@@ -3,5 +3,9 @@
|
||||
if(ghostimage)
|
||||
ghostimage.icon_state = src.icon_state
|
||||
updateghostimages()
|
||||
|
||||
if(non_respawnable_keys[ckey])
|
||||
can_reenter_corpse = 0
|
||||
respawnable_list -= src
|
||||
|
||||
update_interface()
|
||||
@@ -129,11 +129,15 @@ Works together with spawning an observer, noted above.
|
||||
|
||||
/mob/proc/ghostize(var/flags = GHOST_CAN_REENTER)
|
||||
if(key)
|
||||
if(non_respawnable_keys[ckey])
|
||||
flags &= ~GHOST_CAN_REENTER
|
||||
var/mob/dead/observer/ghost = new(src, flags) //Transfer safety to observer spawning proc.
|
||||
ghost.timeofdeath = src.timeofdeath //BS12 EDIT
|
||||
respawnable_list -= src
|
||||
if(ghost.can_reenter_corpse)
|
||||
respawnable_list += ghost
|
||||
else
|
||||
non_respawnable_keys[ckey] = 1
|
||||
ghost.key = key
|
||||
if(!(ghost.client && ghost.client.holder) && !config.antag_hud_allowed) // For new ghosts we remove the verb from even showing up if it's not allowed.
|
||||
ghost.verbs -= /mob/dead/observer/verb/toggle_antagHUD // Poor guys, don't know what they are missing!
|
||||
@@ -148,12 +152,28 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
set desc = "Relinquish your life and enter the land of the dead."
|
||||
|
||||
var/mob/M = src
|
||||
var/warningmsg = null
|
||||
var/obj/machinery/cryopod/P = istype(loc, /obj/machinery/cryopod) && loc
|
||||
|
||||
if(stat == DEAD)
|
||||
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"
|
||||
else if(non_respawnable_keys[ckey])
|
||||
warningmsg = "You have lost your right to respawn"
|
||||
|
||||
if(!warningmsg)
|
||||
ghostize(1)
|
||||
else
|
||||
var/response = alert(src, "Are you -sure- you want to ghost?\n(You are alive. If you ghost now, you probably won't be able to rejoin the round! You can't change your mind, so choose wisely!)","Are you sure you want to ghost?","Ghost","Stay in body")
|
||||
if(response != "Ghost") return //didn't want to ghost after-all
|
||||
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?","Ghost","Stay in body")
|
||||
if(response != "Ghost")
|
||||
return //didn't want to ghost after-all
|
||||
resting = 1
|
||||
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.
|
||||
@@ -162,8 +182,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
Morgue = M.loc
|
||||
if(Morgue)
|
||||
Morgue.update()
|
||||
if(istype(M.loc, /obj/machinery/cryopod))
|
||||
var/obj/machinery/cryopod/P = M.loc
|
||||
if(P)
|
||||
if(!P.control_computer)
|
||||
P.find_control_computer(urgent=1)
|
||||
if(P.control_computer)
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
req_access = list(access_robotics)
|
||||
mecha = null//This does not appear to be used outside of reference in mecha.dm.
|
||||
var/silenced = 0 //if set to 1, they can't talk.
|
||||
var/next_ping_at = 0
|
||||
|
||||
|
||||
/obj/item/device/mmi/posibrain/attack_self(mob/user as mob)
|
||||
@@ -53,6 +54,8 @@
|
||||
return 0
|
||||
if(jobban_isbanned(O, "Cyborg") || jobban_isbanned(O,"nonhumandept"))
|
||||
return 0
|
||||
if(!O.can_reenter_corpse)
|
||||
return 0
|
||||
if(O.client)
|
||||
return 1
|
||||
return 0
|
||||
@@ -190,7 +193,11 @@
|
||||
/obj/item/device/mmi/posibrain/attack_ghost(var/mob/dead/observer/O)
|
||||
if(searching)
|
||||
volunteer(O)
|
||||
else
|
||||
return
|
||||
if(brainmob && brainmob.key)
|
||||
return // No point pinging a posibrain with a player already inside
|
||||
if(check_observer(O) && (world.time >= next_ping_at))
|
||||
next_ping_at = world.time + (20 SECONDS)
|
||||
var/turf/T = get_turf_or_move(src.loc)
|
||||
for(var/mob/M in viewers(T))
|
||||
M.show_message("\blue The positronic brain pings softly.")
|
||||
|
||||
@@ -113,7 +113,7 @@
|
||||
if(istype(src,/mob/dead/observer))
|
||||
var/mob/dead/observer/G = src
|
||||
if(G.has_enabled_antagHUD == 1 && config.antag_hud_restricted)
|
||||
to_chat(usr, "\blue <B>Upon using the antagHUD you forfeited the ability to join the round.</B>")
|
||||
to_chat(usr, "<span class='warning'>Upon using the antagHUD you forfeited the ability to join the round.</span>")
|
||||
return
|
||||
if(G.started_as_observer == 1)
|
||||
joinedasobserver = 1
|
||||
@@ -133,6 +133,9 @@
|
||||
to_chat(usr, "<span class='warning'>You must wait 10 minutes to respawn as a drone!</span>")
|
||||
return
|
||||
|
||||
if(alert("Are you sure you want to respawn as a drone?", "Are you sure?", "Yes", "No") != "Yes")
|
||||
return
|
||||
|
||||
for(var/obj/machinery/drone_fabricator/DF in world)
|
||||
if(DF.stat & NOPOWER || !DF.produce_drones)
|
||||
continue
|
||||
|
||||
@@ -403,6 +403,8 @@
|
||||
return 0
|
||||
if(O.mind && O.mind.current && O.mind.current.stat != DEAD)
|
||||
return 0
|
||||
if(!O.can_reenter_corpse)
|
||||
return 0
|
||||
if(O.has_enabled_antagHUD == 1 && config.antag_hud_restricted)
|
||||
return 0
|
||||
return 1
|
||||
|
||||
Reference in New Issue
Block a user