mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-01-27 17:41:50 +00:00
## About The Pull Request Monster cores now render above lying mobs and corpses, making them easier to grab during fights. They reset to object layer once moved or picked up to avoid visual issues. ## Why It's Good For The Game During vent defenses when you encounter legions while low on heals you may be tempted to grab a core to buff and regen, but as they're rendered below mobs you either have to pixel hunt through a skeleton's ribs, or use right click to pick it up via the context menu. Both of these options make for a rather unpleasant experience, this should make it less painful to do. Technically applies to other mobs as well, but I doubt that anyone is butchering monsters mid-fight for lobstrocity or brimdemon cores. ## Changelog 🆑 qol: Monster cores now display above corpses when dropped /🆑
22 lines
753 B
Plaintext
22 lines
753 B
Plaintext
/// Element that makes mob drops appear above their corpses until moved or picked up
|
|
/datum/element/above_mob_drop
|
|
element_flags = ELEMENT_BESPOKE
|
|
argument_hash_start_idx = 2
|
|
/// Layer to which items are initially changed
|
|
var/target_layer = ABOVE_LYING_MOB_LAYER
|
|
|
|
/datum/element/above_mob_drop/Attach(datum/target, target_layer = ABOVE_LYING_MOB_LAYER)
|
|
. = ..()
|
|
if (!ismovable(target))
|
|
return ELEMENT_INCOMPATIBLE
|
|
src.target_layer = target_layer
|
|
var/atom/movable/owner = target
|
|
owner.layer = target_layer
|
|
RegisterSignal(owner, COMSIG_MOVABLE_MOVED, PROC_REF(on_moved))
|
|
|
|
/datum/element/above_mob_drop/proc/on_moved(atom/movable/source)
|
|
SIGNAL_HANDLER
|
|
if (source.layer == target_layer)
|
|
source.layer = initial(source.layer)
|
|
Detach(source)
|