Skip to content

Commit

Permalink
[PORT] Adds unit test for effects set to "Curse of Mundanity" (and mi…
Browse files Browse the repository at this point in the history
…ssing IDs)

Ports tgstation/tgstation#88240 and partially tgstation/tgstation#87842
  • Loading branch information
Absolucy committed Dec 16, 2024
1 parent e3f8b3e commit e0a02f7
Show file tree
Hide file tree
Showing 49 changed files with 170 additions and 87 deletions.
10 changes: 10 additions & 0 deletions code/__DEFINES/status_effects.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,16 @@
/// if it only allows one, and new instances just instead refresh the timer
#define STATUS_EFFECT_REFRESH 3

/// Use in status effect "duration" to make it last forever
#define STATUS_EFFECT_PERMANENT -1
/// Use in status effect "tick_interval" to prevent it from calling tick()
#define STATUS_EFFECT_NO_TICK -1

/// Indicates this status effect is an abstract type, ie not instantiated
/// Doesn't actually do anything in practice, primarily just a marker / used in unit tests,
/// so don't worry if your abstract status effect doesn't actually set this
#define STATUS_EFFECT_ID_ABSTRACT "abstract"

///Processing flags - used to define the speed at which the status will work
///This is fast - 0.2s between ticks (I believe!)
#define STATUS_EFFECT_FAST_PROCESS 0
Expand Down
4 changes: 2 additions & 2 deletions code/datums/elements/organ_set_bonus.dm
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@

/datum/status_effect/organ_set_bonus
id = "organ_set_bonus"
duration = -1
tick_interval = -1
duration = STATUS_EFFECT_PERMANENT
tick_interval = STATUS_EFFECT_NO_TICK
alert_type = null
///how many organs the carbon with this has in the set
var/organs = 0
Expand Down
2 changes: 1 addition & 1 deletion code/datums/status_effects/_status_effect.dm
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/// When set initially / in on_creation, this is how long the status effect lasts in deciseconds.
/// While processing, this becomes the world.time when the status effect will expire.
/// -1 = infinite duration.
var/duration = -1
var/duration = STATUS_EFFECT_PERMANENT
/// When set initially / in on_creation, this is how long between [proc/tick] calls in deciseconds.
/// While processing, this becomes the world.time when the next tick will occur.
/// -1 = will stop processing, if duration is also unlimited (-1).
Expand Down
2 changes: 1 addition & 1 deletion code/datums/status_effects/agent_pinpointer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

/datum/status_effect/agent_pinpointer
id = "agent_pinpointer"
duration = -1
duration = STATUS_EFFECT_PERMANENT
tick_interval = PINPOINTER_PING_TIME
alert_type = /atom/movable/screen/alert/status_effect/agent_pinpointer
///The minimum range to start pointing towards your target.
Expand Down
14 changes: 7 additions & 7 deletions code/datums/status_effects/buffs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

/datum/status_effect/his_grace
id = "his_grace"
duration = -1
duration = STATUS_EFFECT_PERMANENT
tick_interval = 4
alert_type = /atom/movable/screen/alert/status_effect/his_grace
var/bloodlust = 0
Expand Down Expand Up @@ -86,7 +86,7 @@

/datum/status_effect/cult_master
id = "The Cult Master"
duration = -1
duration = STATUS_EFFECT_PERMANENT
alert_type = null
on_remove_on_mob_delete = TRUE
var/alive = TRUE
Expand Down Expand Up @@ -116,7 +116,7 @@
/datum/status_effect/blooddrunk
id = "blooddrunk"
duration = 10
tick_interval = -1 // monkestation edit
tick_interval = STATUS_EFFECT_NO_TICK // monkestation edit
alert_type = /atom/movable/screen/alert/status_effect/blooddrunk

/atom/movable/screen/alert/status_effect/blooddrunk
Expand Down Expand Up @@ -211,7 +211,7 @@
/datum/status_effect/hippocratic_oath
id = "Hippocratic Oath"
status_type = STATUS_EFFECT_UNIQUE
duration = -1
duration = STATUS_EFFECT_PERMANENT
tick_interval = 25
alert_type = null

Expand Down Expand Up @@ -475,7 +475,7 @@

/datum/status_effect/nest_sustenance
id = "nest_sustenance"
duration = -1
duration = STATUS_EFFECT_PERMANENT
tick_interval = 0.4 SECONDS
alert_type = /atom/movable/screen/alert/status_effect/nest_sustenance

Expand Down Expand Up @@ -504,8 +504,8 @@
*/
/datum/status_effect/blessing_of_insanity
id = "blessing_of_insanity"
duration = -1
tick_interval = -1
duration = STATUS_EFFECT_PERMANENT
tick_interval = STATUS_EFFECT_NO_TICK
alert_type = /atom/movable/screen/alert/status_effect/blessing_of_insanity

/atom/movable/screen/alert/status_effect/blessing_of_insanity
Expand Down
2 changes: 1 addition & 1 deletion code/datums/status_effects/buffs/stun_asorption.dm
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
*/
/datum/status_effect/stun_absorption
id = "absorb_stun"
tick_interval = -1
tick_interval = STATUS_EFFECT_NO_TICK
alert_type = null
status_type = STATUS_EFFECT_MULTIPLE

Expand Down
4 changes: 2 additions & 2 deletions code/datums/status_effects/debuffs/blindness.dm
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/// Nearsighted
/datum/status_effect/grouped/nearsighted
id = "nearsighted"
tick_interval = -1
tick_interval = STATUS_EFFECT_NO_TICK
alert_type = null
// This is not "remove on fullheal" as in practice,
// fullheal should instead remove all the sources and in turn cure this
Expand Down Expand Up @@ -55,7 +55,7 @@
/// Blindness
/datum/status_effect/grouped/blindness
id = "blindness"
tick_interval = -1
tick_interval = STATUS_EFFECT_NO_TICK
alert_type = /atom/movable/screen/alert/status_effect/blind
// This is not "remove on fullheal" as in practice,
// fullheal should instead remove all the sources and in turn cure this
Expand Down
18 changes: 10 additions & 8 deletions code/datums/status_effects/debuffs/debuffs.dm
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
//Largely negative status effects go here, even if they have small benificial effects
//STUN EFFECTS
/datum/status_effect/incapacitating
tick_interval = -1 // monkestation edit
id = STATUS_EFFECT_ID_ABSTRACT
tick_interval = STATUS_EFFECT_NO_TICK // monkestation edit
status_type = STATUS_EFFECT_REPLACE
alert_type = null
remove_on_fullheal = TRUE
Expand Down Expand Up @@ -134,7 +135,7 @@
if(!.)
return
if(HAS_TRAIT(owner, TRAIT_SLEEPIMMUNE))
tick_interval = -1
tick_interval = STATUS_EFFECT_NO_TICK
else
ADD_TRAIT(owner, TRAIT_KNOCKEDOUT, TRAIT_STATUS_EFFECT(id))
RegisterSignal(owner, SIGNAL_ADDTRAIT(TRAIT_SLEEPIMMUNE), PROC_REF(on_owner_insomniac))
Expand All @@ -156,7 +157,7 @@
/datum/status_effect/incapacitating/sleeping/proc/on_owner_insomniac(mob/living/source)
SIGNAL_HANDLER
REMOVE_TRAIT(owner, TRAIT_KNOCKEDOUT, TRAIT_STATUS_EFFECT(id))
tick_interval = -1
tick_interval = STATUS_EFFECT_NO_TICK

///If the mob has the TRAIT_SLEEPIMMUNE but somehow looses it we make him sleep and restart the tick()
/datum/status_effect/incapacitating/sleeping/proc/on_owner_sleepy(mob/living/source)
Expand Down Expand Up @@ -237,7 +238,7 @@
//STASIS
/datum/status_effect/grouped/stasis
id = "stasis"
duration = -1
duration = STATUS_EFFECT_PERMANENT
alert_type = /atom/movable/screen/alert/status_effect/stasis
var/last_dead_time

Expand Down Expand Up @@ -289,7 +290,7 @@

/datum/status_effect/his_wrath //does minor damage over time unless holding His Grace
id = "his_wrath"
duration = -1
duration = STATUS_EFFECT_PERMANENT
tick_interval = 4
alert_type = /atom/movable/screen/alert/status_effect/his_wrath

Expand All @@ -309,7 +310,7 @@

/datum/status_effect/cultghost //is a cult ghost and can't use manifest runes
id = "cult_ghost"
duration = -1
duration = STATUS_EFFECT_PERMANENT
alert_type = null

/datum/status_effect/cultghost/on_apply()
Expand Down Expand Up @@ -386,7 +387,7 @@
id = "neck_slice"
status_type = STATUS_EFFECT_UNIQUE
alert_type = null
duration = -1
duration = STATUS_EFFECT_PERMANENT

/datum/status_effect/neck_slice/on_apply()
if(!ishuman(owner))
Expand Down Expand Up @@ -511,7 +512,7 @@
/datum/status_effect/gonbola_pacify
id = "gonbolaPacify"
status_type = STATUS_EFFECT_MULTIPLE
tick_interval = -1
tick_interval = STATUS_EFFECT_NO_TICK
alert_type = null

/datum/status_effect/gonbola_pacify/on_apply()
Expand Down Expand Up @@ -938,6 +939,7 @@
duration = 10 SECONDS
status_type = STATUS_EFFECT_REPLACE
tick_interval = 0.1 SECONDS
alert_type = null

/datum/status_effect/teleport_madness/tick()
dump_in_space(owner)
Expand Down
4 changes: 2 additions & 2 deletions code/datums/status_effects/debuffs/dna_transformation.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/// then turns them back to how they were before transformation.
/datum/status_effect/temporary_transformation
id = "temp_dna_transformation"
tick_interval = -1
tick_interval = STATUS_EFFECT_NO_TICK
duration = 1 MINUTES // set in on creation, this just needs to be any value to process
alert_type = null
remove_on_fullheal = TRUE
Expand Down Expand Up @@ -85,7 +85,7 @@
return // Already paused

time_before_pause = duration - world.time
duration = -1
duration = STATUS_EFFECT_PERMANENT

// Resume if we're none of the above and also were paused
else if(time_before_pause != -1)
Expand Down
1 change: 1 addition & 0 deletions code/datums/status_effects/debuffs/drunk.dm
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
tick_interval = 2 SECONDS
status_type = STATUS_EFFECT_REPLACE
remove_on_fullheal = TRUE
alert_type = null
/// The level of drunkness we are currently at.
var/drunk_value = 0

Expand Down
3 changes: 2 additions & 1 deletion code/datums/status_effects/debuffs/fire_stacks.dm
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/datum/status_effect/fire_handler
duration = -1
duration = STATUS_EFFECT_PERMANENT
id = STATUS_EFFECT_ID_ABSTRACT
alert_type = null
status_type = STATUS_EFFECT_REFRESH //Custom code
on_remove_on_mob_delete = TRUE
Expand Down
2 changes: 1 addition & 1 deletion code/datums/status_effects/debuffs/genetic_damage.dm
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
id = "genetic_damage"
alert_type = null
status_type = STATUS_EFFECT_REFRESH // New effects will add to total_damage
duration = -1
duration = STATUS_EFFECT_PERMANENT
tick_interval = 2 SECONDS
on_remove_on_mob_delete = TRUE // Need to unregister from owner, be_replaced() would cause runtimes
remove_on_fullheal = TRUE
Expand Down
2 changes: 1 addition & 1 deletion code/datums/status_effects/debuffs/hallucination.dm
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
/datum/status_effect/hallucination/sanity
id = "low sanity"
status_type = STATUS_EFFECT_REFRESH
duration = -1 // This lasts "forever", only goes away with sanity gain
duration = STATUS_EFFECT_PERMANENT // This lasts "forever", only goes away with sanity gain

/datum/status_effect/hallucination/sanity/on_apply()
if(!owner.mob_mood)
Expand Down
2 changes: 1 addition & 1 deletion code/datums/status_effects/debuffs/speech_debuffs.dm
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/datum/status_effect/speech
id = null
id = STATUS_EFFECT_ID_ABSTRACT
alert_type = null
remove_on_fullheal = TRUE

Expand Down
2 changes: 1 addition & 1 deletion code/datums/status_effects/debuffs/tower_of_babel.dm
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
// Used by wizard magic and tower of babel event
/datum/status_effect/tower_of_babel/magical
id = "tower_of_babel_magic" // do we need a new id?
duration = -1
duration = STATUS_EFFECT_PERMANENT
trait_source = TRAUMA_TRAIT

/datum/status_effect/tower_of_babel/magical/on_apply()
Expand Down
6 changes: 3 additions & 3 deletions code/datums/status_effects/drug_effects.dm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/datum/status_effect/woozy
id = "woozy"
tick_interval = -1
tick_interval = STATUS_EFFECT_NO_TICK
status_type = STATUS_EFFECT_UNIQUE
alert_type = /atom/movable/screen/alert/status_effect/woozy

Expand All @@ -14,7 +14,7 @@

/datum/status_effect/high_blood_pressure
id = "high_blood_pressure"
tick_interval = -1
tick_interval = STATUS_EFFECT_NO_TICK
status_type = STATUS_EFFECT_UNIQUE
alert_type = /atom/movable/screen/alert/status_effect/high_blood_pressure

Expand All @@ -40,7 +40,7 @@

/datum/status_effect/seizure
id = "seizure"
tick_interval = -1
tick_interval = STATUS_EFFECT_NO_TICK
status_type = STATUS_EFFECT_UNIQUE
alert_type = /atom/movable/screen/alert/status_effect/seizure

Expand Down
2 changes: 1 addition & 1 deletion code/datums/status_effects/gas.dm
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@

/datum/status_effect/freon/lasting
id = "lasting_frozen"
duration = -1
duration = STATUS_EFFECT_PERMANENT

/datum/status_effect/hypernob_protection
id = "hypernob_protection"
Expand Down
2 changes: 2 additions & 0 deletions code/datums/status_effects/grouped_effect.dm
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/// Status effect from multiple sources, when all sources are removed, so is the effect
/datum/status_effect/grouped
id = STATUS_EFFECT_ID_ABSTRACT
alert_type = null
// Grouped effects adds itself to [var/sources] and destroys itself if one exists already, there are never actually multiple
status_type = STATUS_EFFECT_MULTIPLE
/// A list of all sources applying this status effect. Sources are a list of keys
Expand Down
3 changes: 2 additions & 1 deletion code/datums/status_effects/limited_effect.dm
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
/// These effects reapply their on_apply() effect when refreshed while stacks < max_stacks.
/datum/status_effect/limited_buff
id = "limited_buff"
duration = -1
duration = STATUS_EFFECT_PERMANENT
status_type = STATUS_EFFECT_REFRESH
alert_type = null
///How many stacks we currently have
var/stacks = 1
///How many stacks we can have maximum
Expand Down
Loading

0 comments on commit e0a02f7

Please sign in to comment.