mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-20 11:40:07 +01:00
Bileworms are a new lavaland monster, that has unique AI that should prove them. Instead of moving normally, it periodically burrows underground and resurfaces nearby. Its attack is an AOE acid spit.
29 lines
806 B
Plaintext
29 lines
806 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
|
|
element_flags = ELEMENT_DETACH
|
|
id_arg_index = 2
|
|
|
|
/datum/element/content_barfer/Attach(datum/target, tally_string)
|
|
. = ..()
|
|
|
|
if(!isliving(target))
|
|
return ELEMENT_INCOMPATIBLE
|
|
|
|
RegisterSignal(target, list(COMSIG_LIVING_DEATH, COMSIG_LIVING_WABBAJACKED), .proc/barf_contents)
|
|
|
|
/datum/element/content_barfer/Detach(datum/target)
|
|
UnregisterSignal(target, list(COMSIG_LIVING_DEATH, COMSIG_LIVING_WABBAJACKED))
|
|
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))
|