mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-21 03:59:59 +01:00
* Mobility refactor: no more update_mobility() * Update robot.dm Fixes robots. * megadumb * Update robot.dm * weh * Update gunpoint_datum.dm Co-authored-by: Rohesie <rohesie@gmail.com> Co-authored-by: Gandalf <jzo123@hotmail.com> Co-authored-by: Azarak <azarak10@gmail.com>
34 lines
984 B
Plaintext
34 lines
984 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(!isanimal(parent))
|
|
return COMPONENT_INCOMPATIBLE
|
|
var/mob/living/simple_animal/S = parent
|
|
|
|
src.container = container
|
|
|
|
S.forceMove(container)
|
|
|
|
S.status_flags |= GODMODE
|
|
ADD_TRAIT(S, TRAIT_IMMOBILIZED, SOULSTONE_TRAIT)
|
|
ADD_TRAIT(S, TRAIT_HANDS_BLOCKED, SOULSTONE_TRAIT)
|
|
S.health = S.maxHealth
|
|
S.bruteloss = 0
|
|
|
|
RegisterSignal(S, COMSIG_MOVABLE_MOVED, .proc/free_prisoner)
|
|
|
|
/datum/component/soulstoned/proc/free_prisoner()
|
|
SIGNAL_HANDLER
|
|
|
|
var/mob/living/simple_animal/S = parent
|
|
if(S.loc != container)
|
|
qdel(src)
|
|
|
|
/datum/component/soulstoned/UnregisterFromParent()
|
|
var/mob/living/simple_animal/S = parent
|
|
S.status_flags &= ~GODMODE
|
|
REMOVE_TRAIT(S, TRAIT_IMMOBILIZED, SOULSTONE_TRAIT)
|
|
REMOVE_TRAIT(S, TRAIT_HANDS_BLOCKED, SOULSTONE_TRAIT)
|