[MIRROR] Floored trait (#329)

* Floored trait (#52884)

Refactors mobility, so we respond to more things as events.
One has_legs and has_arms are turned into events we'll be close to be able to eschew update_mobility()

* Floored trait

Co-authored-by: Rohesie <rohesie@gmail.com>
This commit is contained in:
SkyratBot
2020-08-13 05:24:25 +02:00
committed by GitHub
co-authored by Rohesie
parent e3aa9e933b
commit d06d8f6db6
4 changed files with 29 additions and 5 deletions
+17
View File
@@ -24,6 +24,7 @@
owner.update_stat()
return ..()
//STUN
/datum/status_effect/incapacitating/stun
id = "stun"
@@ -40,10 +41,21 @@
REMOVE_TRAIT(owner, TRAIT_IMMOBILIZED, TRAIT_STATUS_EFFECT(id))
return ..()
//KNOCKDOWN
/datum/status_effect/incapacitating/knockdown
id = "knockdown"
/datum/status_effect/incapacitating/knockdown/on_apply()
. = ..()
if(!.)
return
ADD_TRAIT(owner, TRAIT_FLOORED, TRAIT_STATUS_EFFECT(id))
/datum/status_effect/incapacitating/knockdown/on_remove()
REMOVE_TRAIT(owner, TRAIT_FLOORED, TRAIT_STATUS_EFFECT(id))
return ..()
//IMMOBILIZED
/datum/status_effect/incapacitating/immobilized
@@ -60,6 +72,7 @@
return ..()
//PARALYZED
/datum/status_effect/incapacitating/paralyzed
id = "paralyzed"
@@ -69,12 +82,15 @@
return
ADD_TRAIT(owner, TRAIT_INCAPACITATED, TRAIT_STATUS_EFFECT(id))
ADD_TRAIT(owner, TRAIT_IMMOBILIZED, TRAIT_STATUS_EFFECT(id))
ADD_TRAIT(owner, TRAIT_FLOORED, TRAIT_STATUS_EFFECT(id))
/datum/status_effect/incapacitating/paralyzed/on_remove()
REMOVE_TRAIT(owner, TRAIT_INCAPACITATED, TRAIT_STATUS_EFFECT(id))
REMOVE_TRAIT(owner, TRAIT_IMMOBILIZED, TRAIT_STATUS_EFFECT(id))
REMOVE_TRAIT(owner, TRAIT_FLOORED, TRAIT_STATUS_EFFECT(id))
return ..()
//UNCONSCIOUS
/datum/status_effect/incapacitating/unconscious
id = "unconscious"
@@ -94,6 +110,7 @@
if(owner.getStaminaLoss())
owner.adjustStaminaLoss(-0.3) //reduce stamina loss by 0.3 per tick, 6 per 2 seconds
//SLEEPING
/datum/status_effect/incapacitating/sleeping
id = "sleeping"