mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-28 07:38:05 +01:00
Convert all traits given by status effects to use TRAIT_STATUS_EFFECT(id) (#89291)
## About The Pull Request This makes (almost?) all traits given by status effects use `TRAIT_STATUS_EFFECT(id)` as their source, rather than the previous mix of `id`, `type`, `REF(src)`, or some bespoke thing. ## Why It's Good For The Game Consistency is good. ## Changelog No user-facing changes
This commit is contained in:
@@ -3,16 +3,16 @@
|
||||
var/trait = TRAIT_DUMB // You need to override this
|
||||
|
||||
/datum/status_effect/food/trait/on_apply()
|
||||
if(!HAS_TRAIT_FROM(owner, trait, type)) // Check if trait was already applied
|
||||
ADD_TRAIT(owner, trait, type)
|
||||
if(!HAS_TRAIT_FROM(owner, trait, TRAIT_STATUS_EFFECT(id))) // Check if trait was already applied
|
||||
ADD_TRAIT(owner, trait, TRAIT_STATUS_EFFECT(id))
|
||||
return ..()
|
||||
|
||||
/datum/status_effect/food/trait/be_replaced()
|
||||
REMOVE_TRAIT(owner, trait, type)
|
||||
REMOVE_TRAIT(owner, trait, TRAIT_STATUS_EFFECT(id))
|
||||
return ..()
|
||||
|
||||
/datum/status_effect/food/trait/on_remove()
|
||||
REMOVE_TRAIT(owner, trait, type)
|
||||
REMOVE_TRAIT(owner, trait, TRAIT_STATUS_EFFECT(id))
|
||||
return ..()
|
||||
|
||||
/datum/status_effect/food/trait/shockimmune
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
RegisterSignal(owner, COMSIG_MOVABLE_MOVED, PROC_REF(stop_rolling))
|
||||
RegisterSignal(owner, COMSIG_LIVING_SET_BODY_POSITION, PROC_REF(body_position_changed))
|
||||
ADD_TRAIT(owner, TRAIT_HANDS_BLOCKED, id) // they're kinda busy!
|
||||
ADD_TRAIT(owner, TRAIT_HANDS_BLOCKED, TRAIT_STATUS_EFFECT(id)) // they're kinda busy!
|
||||
|
||||
owner.visible_message(
|
||||
span_danger("[owner] rolls on the floor, trying to put [owner.p_them()]self out!"),
|
||||
@@ -31,7 +31,7 @@
|
||||
|
||||
/datum/status_effect/stop_drop_roll/on_remove()
|
||||
UnregisterSignal(owner, list(COMSIG_MOVABLE_MOVED, COMSIG_LIVING_SET_BODY_POSITION))
|
||||
REMOVE_TRAIT(owner, TRAIT_HANDS_BLOCKED, id)
|
||||
REMOVE_TRAIT(owner, TRAIT_HANDS_BLOCKED, TRAIT_STATUS_EFFECT(id))
|
||||
|
||||
/datum/status_effect/stop_drop_roll/tick(seconds_between_ticks)
|
||||
if(HAS_TRAIT(owner, TRAIT_IMMOBILIZED) || HAS_TRAIT(owner, TRAIT_INCAPACITATED))
|
||||
|
||||
Reference in New Issue
Block a user