diff --git a/code/datums/status_effects/blob_burst.dm b/code/datums/status_effects/blob_burst.dm index d1381612a2c..5e5485b7580 100644 --- a/code/datums/status_effects/blob_burst.dm +++ b/code/datums/status_effects/blob_burst.dm @@ -1,4 +1,5 @@ /datum/status_effect/blob_burst + id = "blob_burst" alert_type = /atom/movable/screen/alert/status_effect/blob_burst var/datum/callback/blob_burst_callback diff --git a/code/datums/status_effects/buffs.dm b/code/datums/status_effects/buffs.dm index aadac8f9d6d..2d0d83f725f 100644 --- a/code/datums/status_effects/buffs.dm +++ b/code/datums/status_effects/buffs.dm @@ -275,6 +275,7 @@ owner.adjustFireLoss(-5) /datum/status_effect/blood_rush + id = "blood_rush" alert_type = null duration = 10 SECONDS @@ -488,6 +489,7 @@ REMOVE_TRAIT(owner, TRAIT_IGNOREDAMAGESLOWDOWN, id) /datum/status_effect/fleshmend + id = "fleshmend" duration = -1 status_type = STATUS_EFFECT_REFRESH tick_interval = 1 SECONDS @@ -536,6 +538,7 @@ qdel(src) /datum/status_effect/speedlegs + id = "speedlegs" duration = -1 status_type = STATUS_EFFECT_UNIQUE tick_interval = 4 SECONDS @@ -577,6 +580,7 @@ cling = null /datum/status_effect/panacea + id = "panacea" duration = 20 SECONDS tick_interval = 2 SECONDS status_type = STATUS_EFFECT_REFRESH @@ -702,6 +706,7 @@ to_chat(owner, "[pick(un_hopeful_messages)]") /datum/status_effect/drill_payback + id = "drill_payback" duration = -1 status_type = STATUS_EFFECT_UNIQUE alert_type = null @@ -797,6 +802,7 @@ vamp = null /datum/status_effect/rev_protection + id = "rev_protection" // revs are paralyzed for 10 seconds when they're deconverted, same duration duration = 10 SECONDS alert_type = null @@ -823,6 +829,7 @@ . = ..() /datum/status_effect/bookwyrm + id = "bookwyrm" duration = BRAIN_DAMAGE_MOB_TIME alert_type = null diff --git a/code/datums/status_effects/debuffs.dm b/code/datums/status_effects/debuffs.dm index cfaa6063410..6bcdddea7fe 100644 --- a/code/datums/status_effects/debuffs.dm +++ b/code/datums/status_effects/debuffs.dm @@ -523,6 +523,7 @@ id = "cult_slurring" /datum/status_effect/incapacitating + id = "incapacitating" tick_interval = 0 status_type = STATUS_EFFECT_REPLACE alert_type = null diff --git a/code/datums/status_effects/neutral.dm b/code/datums/status_effects/neutral.dm index d4e6b085276..32fb5edf89a 100644 --- a/code/datums/status_effects/neutral.dm +++ b/code/datums/status_effects/neutral.dm @@ -249,6 +249,7 @@ /// A status effect that can have a certain amount of "bonus" duration added, which extends the duration every tick, /// although there is a maximum amount of bonus time that can be active at any given time. /datum/status_effect/limited_bonus + id = "limited_bonus" /// How much extra time has been added var/bonus_time = 0 /// How much extra time to apply per tick @@ -366,6 +367,7 @@ expire_proc.Invoke() /datum/status_effect/action_status_effect + id = "action_status_effect" alert_type = null tick_interval = -1 diff --git a/code/datums/status_effects/status_effect.dm b/code/datums/status_effects/status_effect.dm index 92d46237964..086a4e21878 100644 --- a/code/datums/status_effects/status_effect.dm +++ b/code/datums/status_effects/status_effect.dm @@ -3,7 +3,8 @@ //When making a new status effect, add a define to status_effects.dm in __DEFINES for ease of use! /datum/status_effect - var/id = "effect" //Used for screen alerts. + /// A unique ID that is used to see if there is already a status effect of the same type on something. Also used for screen alerts + var/id var/duration = -1 //How long the status effect lasts in DECISECONDS. Enter -1 for an effect that never ends unless removed through some means. var/tick_interval = 10 //How many deciseconds between ticks, approximately. Leave at 10 for every second. Setting this to -1 will stop processing if duration is also unlimited. var/mob/living/owner //The mob affected by the status effect. @@ -14,6 +15,11 @@ var/atom/movable/screen/alert/status_effect/linked_alert = null //the alert itself, if it exists /datum/status_effect/New(list/arguments) + if(!id) + stack_trace("[src] was created but did not have an unique ID. Deleting.") + qdel(src) + return + on_creation(arglist(arguments)) /datum/status_effect/proc/on_creation(mob/living/new_owner, ...) @@ -256,6 +262,7 @@ /// Status effect from multiple sources, when all sources are removed, so is the effect /datum/status_effect/grouped + id = "grouped" status_type = STATUS_EFFECT_MULTIPLE //! Adds itself to sources and destroys itself if one exists already, there are never multiple var/list/sources = list() @@ -280,6 +287,7 @@ * This allows for a more precise tweaking of status durations at runtime (e.g. paralysis). */ /datum/status_effect/transient + id = "transient" tick_interval = 0.2 SECONDS // SSfastprocess interval alert_type = null /// How much strength left before expiring? time in deciseconds. diff --git a/code/modules/projectiles/guns/chaos_bolt.dm b/code/modules/projectiles/guns/chaos_bolt.dm index 3466cc29581..fab8d9955f4 100644 --- a/code/modules/projectiles/guns/chaos_bolt.dm +++ b/code/modules/projectiles/guns/chaos_bolt.dm @@ -247,6 +247,7 @@ H.electrocute_act(CHAOS_STAFF_DAMAGE, src) /datum/status_effect/teleport_roulette + id = "teleport_roulette" duration = 16 SECONDS status_type = STATUS_EFFECT_REPLACE tick_interval = 2 SECONDS diff --git a/code/modules/unit_tests/_unit_tests.dm b/code/modules/unit_tests/_unit_tests.dm index 400eae48171..8f7f9c7d318 100644 --- a/code/modules/unit_tests/_unit_tests.dm +++ b/code/modules/unit_tests/_unit_tests.dm @@ -24,6 +24,7 @@ #include "spawn_humans.dm" #include "spell_targeting_test.dm" #include "sql.dm" +#include "status_effect_ids.dm" #include "subsystem_init.dm" #include "subsystem_metric_sanity.dm" #include "test_runner.dm" diff --git a/code/modules/unit_tests/status_effect_ids.dm b/code/modules/unit_tests/status_effect_ids.dm new file mode 100644 index 00000000000..febe085e1c7 --- /dev/null +++ b/code/modules/unit_tests/status_effect_ids.dm @@ -0,0 +1,8 @@ +/datum/unit_test/status_effect_ids/Run() + var/list/bad_statuses = list() + for(var/datum/status_effect/effect as anything in subtypesof(/datum/status_effect)) + if(initial(effect.id) == null) + bad_statuses += effect + + if(length(bad_statuses)) + Fail("STatus effects found without an unique ID: [bad_statuses.Join(", ")]")