mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-05-31 19:47:22 +01:00
77de679782
* `mob_transformation_simple` sends a `COMSIG_MOB_CHANGED_TYPE` signal, letting `content_barfer` mobs spit things out (#78093) ## About The Pull Request Title; also makes bileworm devour message have a warning span. ~~it's a bit cheeky but i didn't want to add a deletion signal to the content_barfer's signal list, and the wabbajack signal here kinda makes sense?~~ ## Why It's Good For The Game Fixes #76791 ## Changelog 🆑 fix: fixed bileworm evolution deleting anything they devoured; they will now eject their contents upon evolution to vileworms /🆑 * `mob_transformation_simple` sends a `COMSIG_MOB_CHANGED_TYPE` signal, letting `content_barfer` mobs spit things out --------- Co-authored-by: Sealed101 <cool.bullseye@yandex.ru>
28 lines
906 B
Plaintext
28 lines
906 B
Plaintext
/**
|
|
* Content Barfer; which expels the contents of a mob when it dies, or is transformed
|
|
*
|
|
* Used for morphs and bileworms!
|
|
*/
|
|
/datum/element/content_barfer
|
|
argument_hash_start_idx = 2
|
|
|
|
/datum/element/content_barfer/Attach(datum/target, tally_string)
|
|
. = ..()
|
|
|
|
if(!isliving(target))
|
|
return ELEMENT_INCOMPATIBLE
|
|
|
|
RegisterSignals(target, list(COMSIG_LIVING_DEATH, COMSIG_LIVING_ON_WABBAJACKED, COMSIG_LIVING_UNSHAPESHIFTED, COMSIG_MOB_CHANGED_TYPE), PROC_REF(barf_contents))
|
|
|
|
/datum/element/content_barfer/Detach(datum/target)
|
|
UnregisterSignal(target, list(COMSIG_LIVING_DEATH, COMSIG_LIVING_ON_WABBAJACKED, COMSIG_LIVING_UNSHAPESHIFTED, COMSIG_MOB_CHANGED_TYPE))
|
|
return ..()
|
|
|
|
/datum/element/content_barfer/proc/barf_contents(mob/living/target)
|
|
SIGNAL_HANDLER
|
|
|
|
for(var/atom/movable/barfed_out in target)
|
|
barfed_out.forceMove(target.loc)
|
|
if(prob(90))
|
|
step(barfed_out, pick(GLOB.alldirs))
|