mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-21 03:55:05 +01:00
New respawn system is in yay!
This commit is contained in:
@@ -91,11 +91,11 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
if(stat == DEAD)
|
||||
resting = 1
|
||||
ghost.timeofdeath = world.time // Because the living mob won't have a time of death and we want the respawn timer to work properly.
|
||||
respawnable_list -= src
|
||||
|
||||
|
||||
return
|
||||
|
||||
|
||||
/mob/dead/observer/Move(NewLoc, direct)
|
||||
dir = direct
|
||||
if(NewLoc)
|
||||
@@ -146,6 +146,9 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
set category = "Ghost"
|
||||
set name = "Re-enter Corpse"
|
||||
if(!client) return
|
||||
if(!can_reenter_corpse)
|
||||
src << "<span class='warning'>You've given up your right to respawn!</span>"
|
||||
return
|
||||
if(!(mind && mind.current && can_reenter_corpse))
|
||||
src << "<span class='warning'>You have no body.</span>"
|
||||
return
|
||||
@@ -273,7 +276,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
|
||||
/mob/dead/observer/verb/become_mouse()
|
||||
set name = "Become mouse"
|
||||
set category = "Ghost"
|
||||
set category = "OOC"
|
||||
|
||||
var/timedifference = world.time - client.time_died_as_mouse
|
||||
if(client.time_died_as_mouse && timedifference <= mouse_respawn_time * 600)
|
||||
|
||||
@@ -17,6 +17,8 @@
|
||||
gibs(loc, viruses, dna)
|
||||
|
||||
dead_mob_list -= src
|
||||
if(client)
|
||||
respawnable_list += src
|
||||
spawn(15)
|
||||
if(animation) del(animation)
|
||||
if(src) del(src)
|
||||
@@ -42,6 +44,8 @@
|
||||
new /obj/effect/decal/cleanable/ash(loc)
|
||||
|
||||
dead_mob_list -= src
|
||||
if(client)
|
||||
respawnable_list += src
|
||||
spawn(15)
|
||||
if(animation) del(animation)
|
||||
if(src) del(src)
|
||||
@@ -52,4 +56,6 @@
|
||||
|
||||
living_mob_list -= src
|
||||
dead_mob_list += src
|
||||
if(client)
|
||||
respawnable_list += src
|
||||
return ..(gibbed)
|
||||
|
||||
@@ -95,6 +95,7 @@
|
||||
spawn(6)
|
||||
var/mob/living/carbon/alien/larva/new_xeno = new(affected_mob.loc)
|
||||
new_xeno.key = picked
|
||||
respawnable_list -= picked
|
||||
new_xeno << sound('sound/voice/hiss5.ogg',0,0,0,100) //To get the player's attention
|
||||
if(gib_on_success)
|
||||
affected_mob.gib()
|
||||
|
||||
@@ -643,3 +643,59 @@
|
||||
CM.legcuffed.loc = usr.loc
|
||||
CM.legcuffed = null
|
||||
CM.update_inv_legcuffed()
|
||||
|
||||
|
||||
/mob/living/verb/respawn()
|
||||
set name = "Respawn as Mindless"
|
||||
set category = "OOC"
|
||||
|
||||
if(usr in respawnable_list)
|
||||
var/list/creatures = list("Mouse")
|
||||
for(var/mob/living/simple_animal/S in living_mob_list)
|
||||
if(safe_animal(S.type))
|
||||
if(!S.key)
|
||||
creatures += S
|
||||
var/picked = input("Please select a creature to respawn as", "Respawn as Mindless Creature") as null|anything in creatures
|
||||
switch(picked)
|
||||
if("Mouse")
|
||||
become_mouse()
|
||||
else
|
||||
var/mob/living/simple_animal/picked_animal = picked
|
||||
if(istype(picked_animal) && !picked_animal.key)
|
||||
picked_animal.key = key
|
||||
else
|
||||
message_admins("Failed to check type")
|
||||
else
|
||||
usr << "You are not dead or you have given up your right to be respawned!"
|
||||
return
|
||||
|
||||
|
||||
|
||||
/mob/living/verb/become_mouse()
|
||||
if(usr in respawnable_list)
|
||||
var/timedifference = world.time - client.time_died_as_mouse
|
||||
if(client.time_died_as_mouse && timedifference <= mouse_respawn_time * 600)
|
||||
var/timedifference_text
|
||||
timedifference_text = time2text(mouse_respawn_time * 600 - timedifference,"mm:ss")
|
||||
src << "<span class='warning'>You may only spawn again as a mouse more than [mouse_respawn_time] minutes after your death. You have [timedifference_text] left.</span>"
|
||||
return
|
||||
|
||||
//find a viable mouse candidate
|
||||
var/mob/living/simple_animal/mouse/host
|
||||
var/obj/machinery/atmospherics/unary/vent_pump/vent_found
|
||||
var/list/found_vents = list()
|
||||
for(var/obj/machinery/atmospherics/unary/vent_pump/v in world)
|
||||
if(!v.welded && v.z == src.z)
|
||||
found_vents.Add(v)
|
||||
if(found_vents.len)
|
||||
vent_found = pick(found_vents)
|
||||
host = new /mob/living/simple_animal/mouse(vent_found.loc)
|
||||
else
|
||||
src << "<span class='warning'>Unable to find any unwelded vents to spawn mice at.</span>"
|
||||
|
||||
if(host)
|
||||
host.ckey = src.ckey
|
||||
host << "<span class='info'>You are now a mouse. Try to avoid interaction with players, and do not give hints away that you are more than a simple rodent.</span>"
|
||||
else
|
||||
usr << "You are not dead or you have given up your right to be respawned!"
|
||||
return
|
||||
|
||||
@@ -426,6 +426,8 @@
|
||||
/mob/living/simple_animal/proc/Die()
|
||||
living_mob_list -= src
|
||||
dead_mob_list += src
|
||||
if(key)
|
||||
respawnable_list += src
|
||||
icon_state = icon_dead
|
||||
stat = DEAD
|
||||
density = 0
|
||||
|
||||
@@ -331,7 +331,7 @@ var/list/slot_equipment_priority = list( \
|
||||
src << browse('html/help.html', "window=help")
|
||||
return
|
||||
*/
|
||||
|
||||
/*
|
||||
/mob/verb/abandon_mob()
|
||||
set name = "Respawn"
|
||||
set category = "OOC"
|
||||
@@ -384,7 +384,7 @@ var/list/slot_equipment_priority = list( \
|
||||
M.key = key
|
||||
// M.Login() //wat
|
||||
return
|
||||
|
||||
*/
|
||||
/mob/verb/observe()
|
||||
set name = "Observe"
|
||||
set category = "OOC"
|
||||
|
||||
Reference in New Issue
Block a user