Fixes dusting. (#22344)

* dust properly

* oops

* Update code/_globalvars/traits.dm

Co-authored-by: Henri215 <77684085+Henri215@users.noreply.github.com>

---------

Co-authored-by: Henri215 <77684085+Henri215@users.noreply.github.com>
This commit is contained in:
Contrabang
2023-09-17 20:19:28 -04:00
committed by GitHub
co-authored by Henri215
parent 527fb7e5c2
commit cb909df3cf
9 changed files with 37 additions and 17 deletions
+1 -6
View File
@@ -3,14 +3,9 @@
GLOB.carbon_list += src
/mob/living/carbon/Destroy()
// We need to delete the back slot first, for modsuits. Otherwise, we have issues.
if(back)
var/obj/I = back
unEquip(I)
qdel(I)
// This clause is here due to items falling off from limb deletion
for(var/obj/item in get_all_slots())
unEquip(item)
unEquip(item, silent = TRUE)
qdel(item)
QDEL_LIST_CONTENTS(internal_organs)
QDEL_LIST_CONTENTS(stomach_contents)
@@ -43,21 +43,24 @@
return TRUE
/mob/living/carbon/human/dust()
if(!IS_HORIZONTAL(src))
// keep us upright so the animation fits.
ADD_TRAIT(src, TRAIT_FORCED_STANDING, TRAIT_GENERIC)
if(!death(TRUE) && stat != DEAD)
return FALSE
notransform = TRUE
dust_animation()
QDEL_IN(src, 20)
QDEL_IN(src, 2 SECONDS)
return TRUE
/mob/living/carbon/human/dust_animation()
// Animate them being dusted out of existence
var/obj/effect/dusting_anim/dust_effect = new(loc, UID())
filters += filter(type = "displace", size = 256, render_source = "*snap[UID()]")
animate(src, alpha = 0, time = 20, easing = (EASE_IN | SINE_EASING))
animate(src, alpha = 0, time = 2 SECONDS, easing = (EASE_IN | SINE_EASING))
new dna.species.remains_type(get_turf(src))
QDEL_IN(dust_effect, 20)
QDEL_IN(dust_effect, 2 SECONDS)
return TRUE
/mob/living/carbon/human/melt()
@@ -372,13 +372,13 @@
return null
/mob/living/carbon/human/get_all_slots()
. = get_head_slots() | get_body_slots()
. = get_body_slots() | get_head_slots()
/mob/living/carbon/human/proc/get_body_slots()
return list(
back,
l_hand,
r_hand,
back,
s_store,
handcuffed,
legcuffed,
+20
View File
@@ -12,6 +12,9 @@
RegisterSignal(src, SIGNAL_ADDTRAIT(TRAIT_FLOORED), PROC_REF(on_floored_trait_gain))
RegisterSignal(src, SIGNAL_REMOVETRAIT(TRAIT_FLOORED), PROC_REF(on_floored_trait_loss))
RegisterSignal(src, SIGNAL_ADDTRAIT(TRAIT_FORCED_STANDING), PROC_REF(on_forced_standing_trait_gain))
RegisterSignal(src, SIGNAL_REMOVETRAIT(TRAIT_FORCED_STANDING), PROC_REF(on_forced_standing_trait_loss))
RegisterSignal(src, SIGNAL_ADDTRAIT(TRAIT_HANDS_BLOCKED), PROC_REF(on_handsblocked_trait_gain))
RegisterSignal(src, SIGNAL_REMOVETRAIT(TRAIT_HANDS_BLOCKED), PROC_REF(on_handsblocked_trait_loss))
@@ -50,6 +53,8 @@
/// Called when [TRAIT_FLOORED] is added to the mob.
/mob/living/proc/on_floored_trait_gain(datum/source)
SIGNAL_HANDLER
if(HAS_TRAIT(src, TRAIT_FORCED_STANDING))
return // Don't go horizontal if mob has forced standing trait.
mobility_flags &= ~MOBILITY_STAND
on_floored_start()
@@ -68,6 +73,21 @@
if(!resting)
stand_up(FALSE)
/// Called when [TRAIT_FORCED_STANDING] is added to the mob.
/mob/living/proc/on_forced_standing_trait_gain(datum/source)
SIGNAL_HANDLER
set_body_position(STANDING_UP)
/// Called when [TRAIT_FORCED_STANDING] is removed from the mob.
/mob/living/proc/on_forced_standing_trait_loss(datum/source)
SIGNAL_HANDLER
if(HAS_TRAIT(src, TRAIT_FLOORED))
fall()
else if(resting)
lay_down()
/// Called when [TRAIT_HANDS_BLOCKED] is added to the mob.
/mob/living/proc/on_handsblocked_trait_gain(datum/source)
SIGNAL_HANDLER
@@ -102,6 +102,9 @@ STATUS EFFECTS
return FALSE
if(buckled) // if they are buckled they aint movin nowhere
return FALSE
if(HAS_TRAIT(src, TRAIT_FORCED_STANDING) && new_value == LYING_DOWN)
return FALSE
. = TRUE
body_position = new_value
if(new_value == LYING_DOWN) // From standing to lying down.