mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-25 09:01:40 +00:00
* Implements AddTraits and RemoveTraits procs for adding/removing multiple traits + swag unit test * MISSED MIRROR https://github.com/tgstation/tgstation/pull/71606 * Update modules_supply.dm * Update tgstation.dme --------- Co-authored-by: san7890 <the@san7890.com> Co-authored-by: Gandalf <9026500+Gandalf2k15@users.noreply.github.com>
30 lines
922 B
Plaintext
30 lines
922 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_IMMOBILIZED, TRAIT_HANDS_BLOCKED), SOULSTONE_TRAIT)
|
|
stoned.status_flags |= GODMODE
|
|
|
|
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.status_flags &= ~GODMODE
|
|
stoned.remove_traits(list(TRAIT_IMMOBILIZED, TRAIT_HANDS_BLOCKED), SOULSTONE_TRAIT)
|