Files
Bubberstation/code/datums/components/soulstoned.dm
Ghom 5409570e01 Upgrades GODMODE from a flag to a trait. (#86596)
## About The Pull Request
GODMODE has a lot of sources that toggle it. From admin-stuff to status
effects, components, actions and mobs which are supposed to be
invincible. It's better off as a trait than a flag, so we can manage
these sources.

## Why It's Good For The Game
See above.

## Changelog

🆑
admin: godmode is now a datum trait instead of a bitflag. This means the
process for toggling it is a little different now.
/🆑
2024-09-15 13:40:19 +00:00

28 lines
887 B
Plaintext

//adds godmode while in the container, prevents moving, and clears these effects up after leaving the stone
/datum/component/soulstoned
var/atom/movable/container
/datum/component/soulstoned/Initialize(atom/movable/container)
if(!isliving(parent))
return COMPONENT_INCOMPATIBLE
var/mob/living/stoned = parent
src.container = container
stoned.forceMove(container)
stoned.fully_heal()
stoned.add_traits(list(TRAIT_GODMODE, TRAIT_IMMOBILIZED, TRAIT_HANDS_BLOCKED), SOULSTONE_TRAIT)
RegisterSignal(stoned, COMSIG_MOVABLE_MOVED, PROC_REF(free_prisoner))
/datum/component/soulstoned/proc/free_prisoner()
SIGNAL_HANDLER
var/mob/living/stoned = parent
if(stoned.loc != container)
qdel(src)
/datum/component/soulstoned/UnregisterFromParent()
var/mob/living/stoned = parent
stoned.remove_traits(list(TRAIT_GODMODE, TRAIT_IMMOBILIZED, TRAIT_HANDS_BLOCKED), SOULSTONE_TRAIT)