[MIRROR] Move death(), gib(), and dust() from /mob to /mob/living (#1634)

* Move death(), gib(), and dust() from /mob to /mob/living

* a

Co-authored-by: Jared-Fogle <35135081+Jared-Fogle@users.noreply.github.com>
Co-authored-by: Azarak <azarak10@gmail.com>
This commit is contained in:
SkyratBot
2020-11-10 22:01:47 +01:00
committed by GitHub
co-authored by Jared-Fogle Azarak
parent a144a5e9e2
commit 2ff5f9b259
37 changed files with 169 additions and 137 deletions
-6
View File
@@ -25,12 +25,6 @@ INITIALIZE_IMMEDIATE(/mob/dead)
/mob/dead/canUseStorage()
return FALSE
/mob/dead/dust(just_ash, drop_items, force) //ghosts can't be vaporised.
return
/mob/dead/gib() //ghosts can't be gibbed.
return
/mob/dead/forceMove(atom/destination)
var/turf/old_turf = get_turf(src)
var/turf/new_turf = get_turf(destination)
-14
View File
@@ -1,14 +0,0 @@
//This is the proc for gibbing a mob. Cannot gib ghosts.
//added different sort of gibs and animations. N
/mob/proc/gib()
return
//This is the proc for turning a mob into ash. Mostly a copy of gib code (above).
//Originally created for wizard disintegrate. I've removed the virus code since it's irrelevant here.
//Dusting robots does not eject the MMI, so it's a bit more powerful than gib() /N
/mob/proc/dust(just_ash, drop_items, force)
return
/mob/proc/death(gibbed)
SEND_SIGNAL(src, COMSIG_MOB_DEATH, gibbed)
SEND_GLOBAL_SIGNAL(COMSIG_GLOB_MOB_DEATH, src , gibbed)
@@ -620,7 +620,7 @@
var/datum/action/innate/linked_speech/action = new(src)
linked_actions.Add(action)
action.Grant(M)
RegisterSignal(M, COMSIG_MOB_DEATH , .proc/unlink_mob)
RegisterSignal(M, COMSIG_LIVING_DEATH , .proc/unlink_mob)
RegisterSignal(M, COMSIG_PARENT_QDELETING, .proc/unlink_mob)
return TRUE
@@ -628,7 +628,7 @@
var/link_id = linked_mobs.Find(M)
if(!(link_id))
return
UnregisterSignal(M, list(COMSIG_MOB_DEATH, COMSIG_PARENT_QDELETING))
UnregisterSignal(M, list(COMSIG_LIVING_DEATH, COMSIG_PARENT_QDELETING))
var/datum/action/innate/linked_speech/action = linked_actions[link_id]
action.Remove(M)
to_chat(M, "<span class='notice'>You are no longer connected to [slimelink_owner.real_name]'s Slime Link.</span>")
+28 -5
View File
@@ -1,4 +1,12 @@
/mob/living/gib(no_brain, no_organs, no_bodyparts)
/**
* Blow up the mob into giblets
*
* Arguments:
* * no_brain - Should the mob NOT drop a brain?
* * no_organs - Should the mob NOT drop organs?
* * no_bodyparts - Should the mob NOT drop bodyparts?
*/
/mob/living/proc/gib(no_brain, no_organs, no_bodyparts)
var/prev_lying = lying_angle
if(stat != DEAD)
death(TRUE)
@@ -26,7 +34,16 @@
/mob/living/proc/spread_bodyparts()
return
/mob/living/dust(just_ash, drop_items, force)
/**
* This is the proc for turning a mob into ash.
* Dusting robots does not eject the MMI, so it's a bit more powerful than gib()
*
* Arguments:
* * just_ash - If TRUE, ash will spawn where the mob was, as opposed to remains
* * drop_items - Should the mob drop their items before dusting?
* * force - Should this mob be FORCABLY dusted?
*/
/mob/living/proc/dust(just_ash, drop_items, force)
death(TRUE)
if(drop_items)
@@ -45,8 +62,13 @@
/mob/living/proc/spawn_dust(just_ash = FALSE)
new /obj/effect/decal/cleanable/ash(loc)
/mob/living/death(gibbed)
/*
* Called when the mob dies. Can also be called manually to kill a mob.
*
* Arguments:
* * gibbed - Was the mob gibbed?
*/
/mob/living/proc/death(gibbed)
set_stat(DEAD)
unset_machine()
timeofdeath = world.time
@@ -70,7 +92,8 @@
med_hud_set_status()
stop_pulling()
. = ..()
SEND_SIGNAL(src, COMSIG_LIVING_DEATH, gibbed)
SEND_GLOBAL_SIGNAL(COMSIG_GLOB_MOB_DEATH, src, gibbed)
if (client)
client.move_delay = initial(client.move_delay)
+2 -2
View File
@@ -958,7 +958,7 @@
return
else if(mind)
RegisterSignal(target, COMSIG_MOB_DEATH, .proc/disconnect_shell)
RegisterSignal(target, COMSIG_LIVING_DEATH, .proc/disconnect_shell)
deployed_shell = target
target.deploy_init(src)
mind.transfer_to(target)
@@ -996,7 +996,7 @@
if(deployed_shell) //Forcibly call back AI in event of things such as damage, EMP or power loss.
to_chat(src, "<span class='danger'>Your remote connection has been reset!</span>")
deployed_shell.undeploy()
UnregisterSignal(deployed_shell, COMSIG_MOB_DEATH)
UnregisterSignal(deployed_shell, COMSIG_LIVING_DEATH)
diag_hud_set_deployed()
/mob/living/silicon/ai/resist()
@@ -85,7 +85,7 @@
var/datum/action/innate/mansus_speech/action = new(src)
linked_mobs[mob_linked] = action
action.Grant(mob_linked)
RegisterSignal(mob_linked, list(COMSIG_MOB_DEATH, COMSIG_PARENT_QDELETING), .proc/unlink_mob)
RegisterSignal(mob_linked, list(COMSIG_LIVING_DEATH, COMSIG_PARENT_QDELETING), .proc/unlink_mob)
return TRUE
/mob/living/simple_animal/hostile/eldritch/raw_prophet/proc/unlink_mob(mob/living/mob_linked)
@@ -93,7 +93,7 @@
if(!linked_mobs[mob_linked])
return
UnregisterSignal(mob_linked, list(COMSIG_MOB_DEATH, COMSIG_PARENT_QDELETING))
UnregisterSignal(mob_linked, list(COMSIG_LIVING_DEATH, COMSIG_PARENT_QDELETING))
var/datum/action/innate/mansus_speech/action = linked_mobs[mob_linked]
action.Remove(mob_linked)
qdel(action)
@@ -817,7 +817,7 @@ Difficulty: Very Hard
action_icon_state = "exit_possession"
sound = null
/obj/effect/proc_holder/spell/targeted/exit_possession/cast(list/targets, mob/user = usr)
/obj/effect/proc_holder/spell/targeted/exit_possession/cast(list/targets, mob/living/user = usr)
if(!isfloorturf(user.loc))
return
var/datum/mind/target_mind = user.mind
@@ -286,7 +286,7 @@ Difficulty: Extremely Hard
return
forceMove(user)
to_chat(user, "<span class='notice'>You feel a bit safer... but a demonic presence lurks in the back of your head...</span>")
RegisterSignal(user, COMSIG_MOB_DEATH, .proc/resurrect)
RegisterSignal(user, COMSIG_LIVING_DEATH, .proc/resurrect)
/// Resurrects the target when they die by moving them and dusting a clone in their place, one life for another
/obj/item/resurrection_crystal/proc/resurrect(mob/living/carbon/user, gibbed)
@@ -207,7 +207,7 @@
///Register for owner death
/datum/action/consume/New(Target)
. = ..()
RegisterSignal(owner, COMSIG_MOB_DEATH, .proc/on_owner_death)
RegisterSignal(owner, COMSIG_LIVING_DEATH, .proc/on_owner_death)
RegisterSignal(owner, COMSIG_PARENT_PREQDELETED, .proc/handle_mob_deletion)
/datum/action/consume/proc/handle_mob_deletion()