Shades now drop bodies when killed/destroyed (#24784)

* this was a bit of a pain

* yes

* damger reviwe

* funny review

* Apply suggestions from code review

Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com>

---------

Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com>
This commit is contained in:
Contrabang
2024-04-25 18:20:50 +00:00
committed by GitHub
co-authored by DGamerL
parent e204ca6694
commit 20701d905c
6 changed files with 107 additions and 67 deletions
@@ -46,38 +46,12 @@
set_light(2, 3, l_color = GET_CULT_DATA(construct_glow, LIGHT_COLOR_BLOOD_MAGIC))
/mob/living/simple_animal/hostile/construct/Destroy()
mind?.remove_antag_datum(/datum/antagonist/cultist, silent_removal = TRUE)
mind?.remove_antag_datum(/datum/antagonist/wizard/construct, silent_removal = TRUE)
remove_held_body()
return ..()
/mob/living/simple_animal/hostile/construct/death(gibbed)
mind?.remove_antag_datum(/datum/antagonist/cultist, silent_removal = TRUE)
mind?.remove_antag_datum(/datum/antagonist/wizard/construct, silent_removal = TRUE)
if(held_body) // Null check for empty bodies
held_body.forceMove(get_turf(src))
SSticker.mode?.cult_team?.add_cult_immunity(held_body)
if(ismob(held_body)) // Check if the held_body is a mob
held_body.key = key
else if(istype(held_body, /obj/item/organ/internal/brain)) // Check if the held_body is a brain
var/obj/item/organ/internal/brain/brain = held_body
if(brain.brainmob) // Check if the brain has a brainmob
brain.brainmob.key = key // Set the key to the brainmob
brain.brainmob.mind.transfer_to(brain.brainmob) // Transfer the mind to the brainmob
held_body.cancel_camera()
// we also drop our heldbody from the /construct_held_body component, as well as our cult/wiz construct antag datums
new /obj/effect/temp_visual/cult/sparks(get_turf(src))
playsound(src, 'sound/effects/pylon_shatter.ogg', 40, TRUE)
return ..()
/mob/living/simple_animal/hostile/construct/proc/add_held_body(atom/movable/body)
held_body = body
RegisterSignal(body, COMSIG_PARENT_QDELETING, PROC_REF(remove_held_body))
/mob/living/simple_animal/hostile/construct/proc/remove_held_body()
SIGNAL_HANDLER
held_body = null
/mob/living/simple_animal/hostile/construct/examine(mob/user)
. = ..()
@@ -34,11 +34,6 @@
deathmessage = "lets out a contented sigh as their form unwinds."
var/holy = FALSE
/mob/living/simple_animal/shade/Destroy()
mind?.remove_antag_datum(/datum/antagonist/cultist, silent_removal = TRUE)
mind?.remove_antag_datum(/datum/antagonist/wizard/construct, silent_removal = TRUE)
return ..()
/mob/living/simple_animal/shade/attackby(obj/item/O, mob/user) //Marker -Agouri
if(istype(O, /obj/item/soulstone))
var/obj/item/soulstone/SS = O