mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-24 00:21:52 +00:00
## 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. /🆑
28 lines
887 B
Plaintext
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)
|