Skip to content

Commit 9a5e160

Browse files
Absolucynotghosti
authored andcommitted
[PORT] Adds unit test for effects set to "Curse of Mundanity" (and missing IDs) (Monkestation#4580)
Ports tgstation/tgstation#88240 and partially tgstation/tgstation#87842
1 parent 0c21d93 commit 9a5e160

File tree

58 files changed

+193
-102
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+193
-102
lines changed

code/__DEFINES/status_effects.dm

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,16 @@
77
/// if it only allows one, and new instances just instead refresh the timer
88
#define STATUS_EFFECT_REFRESH 3
99

10+
/// Use in status effect "duration" to make it last forever
11+
#define STATUS_EFFECT_PERMANENT -1
12+
/// Use in status effect "tick_interval" to prevent it from calling tick()
13+
#define STATUS_EFFECT_NO_TICK -1
14+
15+
/// Indicates this status effect is an abstract type, ie not instantiated
16+
/// Doesn't actually do anything in practice, primarily just a marker / used in unit tests,
17+
/// so don't worry if your abstract status effect doesn't actually set this
18+
#define STATUS_EFFECT_ID_ABSTRACT "abstract"
19+
1020
///Processing flags - used to define the speed at which the status will work
1121
///This is fast - 0.2s between ticks (I believe!)
1222
#define STATUS_EFFECT_FAST_PROCESS 0

code/datums/elements/organ_set_bonus.dm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@
4242

4343
/datum/status_effect/organ_set_bonus
4444
id = "organ_set_bonus"
45-
duration = -1
46-
tick_interval = -1
45+
duration = STATUS_EFFECT_PERMANENT
46+
tick_interval = STATUS_EFFECT_NO_TICK
4747
alert_type = null
4848
///how many organs the carbon with this has in the set
4949
var/organs = 0

code/datums/status_effects/_status_effect.dm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
/// When set initially / in on_creation, this is how long the status effect lasts in deciseconds.
77
/// While processing, this becomes the world.time when the status effect will expire.
88
/// -1 = infinite duration.
9-
var/duration = -1
9+
var/duration = STATUS_EFFECT_PERMANENT
1010
/// When set initially / in on_creation, this is how long between [proc/tick] calls in deciseconds.
1111
/// While processing, this becomes the world.time when the next tick will occur.
1212
/// -1 = will stop processing, if duration is also unlimited (-1).

code/datums/status_effects/agent_pinpointer.dm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
/datum/status_effect/agent_pinpointer
1212
id = "agent_pinpointer"
13-
duration = -1
13+
duration = STATUS_EFFECT_PERMANENT
1414
tick_interval = PINPOINTER_PING_TIME
1515
alert_type = /atom/movable/screen/alert/status_effect/agent_pinpointer
1616
///The minimum range to start pointing towards your target.

code/datums/status_effects/buffs.dm

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
/datum/status_effect/his_grace
44
id = "his_grace"
5-
duration = -1
5+
duration = STATUS_EFFECT_PERMANENT
66
tick_interval = 4
77
alert_type = /atom/movable/screen/alert/status_effect/his_grace
88
var/bloodlust = 0
@@ -86,7 +86,7 @@
8686

8787
/datum/status_effect/cult_master
8888
id = "The Cult Master"
89-
duration = -1
89+
duration = STATUS_EFFECT_PERMANENT
9090
alert_type = null
9191
on_remove_on_mob_delete = TRUE
9292
var/alive = TRUE
@@ -116,7 +116,7 @@
116116
/datum/status_effect/blooddrunk
117117
id = "blooddrunk"
118118
duration = 10
119-
tick_interval = -1 // monkestation edit
119+
tick_interval = STATUS_EFFECT_NO_TICK // monkestation edit
120120
alert_type = /atom/movable/screen/alert/status_effect/blooddrunk
121121

122122
/atom/movable/screen/alert/status_effect/blooddrunk
@@ -211,7 +211,7 @@
211211
/datum/status_effect/hippocratic_oath
212212
id = "Hippocratic Oath"
213213
status_type = STATUS_EFFECT_UNIQUE
214-
duration = -1
214+
duration = STATUS_EFFECT_PERMANENT
215215
tick_interval = 25
216216
alert_type = null
217217

@@ -423,6 +423,7 @@
423423
duration = 2 SECONDS
424424
status_type = STATUS_EFFECT_REPLACE
425425
show_duration = TRUE
426+
alert_type = null
426427

427428
/datum/status_effect/speed_boost/on_creation(mob/living/new_owner, set_duration)
428429
if(isnum(set_duration))
@@ -475,7 +476,7 @@
475476

476477
/datum/status_effect/nest_sustenance
477478
id = "nest_sustenance"
478-
duration = -1
479+
duration = STATUS_EFFECT_PERMANENT
479480
tick_interval = 0.4 SECONDS
480481
alert_type = /atom/movable/screen/alert/status_effect/nest_sustenance
481482

@@ -504,8 +505,8 @@
504505
*/
505506
/datum/status_effect/blessing_of_insanity
506507
id = "blessing_of_insanity"
507-
duration = -1
508-
tick_interval = -1
508+
duration = STATUS_EFFECT_PERMANENT
509+
tick_interval = STATUS_EFFECT_NO_TICK
509510
alert_type = /atom/movable/screen/alert/status_effect/blessing_of_insanity
510511

511512
/atom/movable/screen/alert/status_effect/blessing_of_insanity

code/datums/status_effects/buffs/stun_asorption.dm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
*/
1010
/datum/status_effect/stun_absorption
1111
id = "absorb_stun"
12-
tick_interval = -1
12+
tick_interval = STATUS_EFFECT_NO_TICK
1313
alert_type = null
1414
status_type = STATUS_EFFECT_MULTIPLE
1515

code/datums/status_effects/debuffs/blindness.dm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
/// Nearsighted
66
/datum/status_effect/grouped/nearsighted
77
id = "nearsighted"
8-
tick_interval = -1
8+
tick_interval = STATUS_EFFECT_NO_TICK
99
alert_type = null
1010
// This is not "remove on fullheal" as in practice,
1111
// fullheal should instead remove all the sources and in turn cure this
@@ -55,7 +55,7 @@
5555
/// Blindness
5656
/datum/status_effect/grouped/blindness
5757
id = "blindness"
58-
tick_interval = -1
58+
tick_interval = STATUS_EFFECT_NO_TICK
5959
alert_type = /atom/movable/screen/alert/status_effect/blind
6060
// This is not "remove on fullheal" as in practice,
6161
// fullheal should instead remove all the sources and in turn cure this

code/datums/status_effects/debuffs/debuffs.dm

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
//Largely negative status effects go here, even if they have small benificial effects
22
//STUN EFFECTS
33
/datum/status_effect/incapacitating
4-
tick_interval = -1 // monkestation edit
4+
id = STATUS_EFFECT_ID_ABSTRACT
5+
tick_interval = STATUS_EFFECT_NO_TICK // monkestation edit
56
status_type = STATUS_EFFECT_REPLACE
67
alert_type = null
78
remove_on_fullheal = TRUE
@@ -134,7 +135,7 @@
134135
if(!.)
135136
return
136137
if(HAS_TRAIT(owner, TRAIT_SLEEPIMMUNE))
137-
tick_interval = -1
138+
tick_interval = STATUS_EFFECT_NO_TICK
138139
else
139140
ADD_TRAIT(owner, TRAIT_KNOCKEDOUT, TRAIT_STATUS_EFFECT(id))
140141
RegisterSignal(owner, SIGNAL_ADDTRAIT(TRAIT_SLEEPIMMUNE), PROC_REF(on_owner_insomniac))
@@ -156,7 +157,7 @@
156157
/datum/status_effect/incapacitating/sleeping/proc/on_owner_insomniac(mob/living/source)
157158
SIGNAL_HANDLER
158159
REMOVE_TRAIT(owner, TRAIT_KNOCKEDOUT, TRAIT_STATUS_EFFECT(id))
159-
tick_interval = -1
160+
tick_interval = STATUS_EFFECT_NO_TICK
160161

161162
///If the mob has the TRAIT_SLEEPIMMUNE but somehow looses it we make him sleep and restart the tick()
162163
/datum/status_effect/incapacitating/sleeping/proc/on_owner_sleepy(mob/living/source)
@@ -237,7 +238,7 @@
237238
//STASIS
238239
/datum/status_effect/grouped/stasis
239240
id = "stasis"
240-
duration = -1
241+
duration = STATUS_EFFECT_PERMANENT
241242
alert_type = /atom/movable/screen/alert/status_effect/stasis
242243
var/last_dead_time
243244

@@ -289,7 +290,7 @@
289290

290291
/datum/status_effect/his_wrath //does minor damage over time unless holding His Grace
291292
id = "his_wrath"
292-
duration = -1
293+
duration = STATUS_EFFECT_PERMANENT
293294
tick_interval = 4
294295
alert_type = /atom/movable/screen/alert/status_effect/his_wrath
295296

@@ -309,7 +310,7 @@
309310

310311
/datum/status_effect/cultghost //is a cult ghost and can't use manifest runes
311312
id = "cult_ghost"
312-
duration = -1
313+
duration = STATUS_EFFECT_PERMANENT
313314
alert_type = null
314315

315316
/datum/status_effect/cultghost/on_apply()
@@ -386,7 +387,7 @@
386387
id = "neck_slice"
387388
status_type = STATUS_EFFECT_UNIQUE
388389
alert_type = null
389-
duration = -1
390+
duration = STATUS_EFFECT_PERMANENT
390391

391392
/datum/status_effect/neck_slice/on_apply()
392393
if(!ishuman(owner))
@@ -511,7 +512,7 @@
511512
/datum/status_effect/gonbola_pacify
512513
id = "gonbolaPacify"
513514
status_type = STATUS_EFFECT_MULTIPLE
514-
tick_interval = -1
515+
tick_interval = STATUS_EFFECT_NO_TICK
515516
alert_type = null
516517

517518
/datum/status_effect/gonbola_pacify/on_apply()
@@ -693,9 +694,9 @@
693694

694695
/datum/status_effect/go_away
695696
id = "go_away"
696-
duration = 100
697+
duration = 10 SECONDS
697698
status_type = STATUS_EFFECT_REPLACE
698-
tick_interval = 1
699+
tick_interval = 0.2 SECONDS
699700
alert_type = /atom/movable/screen/alert/status_effect/go_away
700701
var/direction
701702

@@ -716,11 +717,11 @@
716717

717718
/datum/status_effect/fake_virus
718719
id = "fake_virus"
719-
duration = 1800//3 minutes
720+
duration = 3 MINUTES //3 minutes
720721
status_type = STATUS_EFFECT_REPLACE
721-
tick_interval = 1
722+
tick_interval = 0.2 SECONDS
722723
alert_type = null
723-
var/msg_stage = 0//so you dont get the most intense messages immediately
724+
var/msg_stage = 0//so you don't get the most intense messages immediately
724725

725726
/datum/status_effect/fake_virus/on_apply()
726727
if(HAS_TRAIT(owner, TRAIT_VIRUSIMMUNE))
@@ -937,7 +938,8 @@
937938
id = "teleport_madness"
938939
duration = 10 SECONDS
939940
status_type = STATUS_EFFECT_REPLACE
940-
tick_interval = 0.1 SECONDS
941+
tick_interval = 0.2 SECONDS
942+
alert_type = null
941943

942944
/datum/status_effect/teleport_madness/tick()
943945
dump_in_space(owner)

code/datums/status_effects/debuffs/dna_transformation.dm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/// then turns them back to how they were before transformation.
33
/datum/status_effect/temporary_transformation
44
id = "temp_dna_transformation"
5-
tick_interval = -1
5+
tick_interval = STATUS_EFFECT_NO_TICK
66
duration = 1 MINUTES // set in on creation, this just needs to be any value to process
77
alert_type = null
88
remove_on_fullheal = TRUE
@@ -85,7 +85,7 @@
8585
return // Already paused
8686

8787
time_before_pause = duration - world.time
88-
duration = -1
88+
duration = STATUS_EFFECT_PERMANENT
8989

9090
// Resume if we're none of the above and also were paused
9191
else if(time_before_pause != -1)

code/datums/status_effects/debuffs/drunk.dm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
tick_interval = 2 SECONDS
1616
status_type = STATUS_EFFECT_REPLACE
1717
remove_on_fullheal = TRUE
18+
alert_type = null
1819
/// The level of drunkness we are currently at.
1920
var/drunk_value = 0
2021

code/datums/status_effects/debuffs/fire_stacks.dm

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/datum/status_effect/fire_handler
2-
duration = -1
2+
duration = STATUS_EFFECT_PERMANENT
3+
id = STATUS_EFFECT_ID_ABSTRACT
34
alert_type = null
45
status_type = STATUS_EFFECT_REFRESH //Custom code
56
on_remove_on_mob_delete = TRUE

code/datums/status_effects/debuffs/genetic_damage.dm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
id = "genetic_damage"
66
alert_type = null
77
status_type = STATUS_EFFECT_REFRESH // New effects will add to total_damage
8-
duration = -1
8+
duration = STATUS_EFFECT_PERMANENT
99
tick_interval = 2 SECONDS
1010
on_remove_on_mob_delete = TRUE // Need to unregister from owner, be_replaced() would cause runtimes
1111
remove_on_fullheal = TRUE

code/datums/status_effects/debuffs/hallucination.dm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@
8282
/datum/status_effect/hallucination/sanity
8383
id = "low sanity"
8484
status_type = STATUS_EFFECT_REFRESH
85-
duration = -1 // This lasts "forever", only goes away with sanity gain
85+
duration = STATUS_EFFECT_PERMANENT // This lasts "forever", only goes away with sanity gain
8686

8787
/datum/status_effect/hallucination/sanity/on_apply()
8888
if(!owner.mob_mood)

code/datums/status_effects/debuffs/speech_debuffs.dm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/datum/status_effect/speech
2-
id = null
2+
id = STATUS_EFFECT_ID_ABSTRACT
33
alert_type = null
44
remove_on_fullheal = TRUE
55

code/datums/status_effects/debuffs/tower_of_babel.dm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
// Used by wizard magic and tower of babel event
3434
/datum/status_effect/tower_of_babel/magical
3535
id = "tower_of_babel_magic" // do we need a new id?
36-
duration = -1
36+
duration = STATUS_EFFECT_PERMANENT
3737
trait_source = TRAUMA_TRAIT
3838

3939
/datum/status_effect/tower_of_babel/magical/on_apply()

code/datums/status_effects/drug_effects.dm

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/datum/status_effect/woozy
22
id = "woozy"
3-
tick_interval = -1
3+
tick_interval = STATUS_EFFECT_NO_TICK
44
status_type = STATUS_EFFECT_UNIQUE
55
alert_type = /atom/movable/screen/alert/status_effect/woozy
66

@@ -14,7 +14,7 @@
1414

1515
/datum/status_effect/high_blood_pressure
1616
id = "high_blood_pressure"
17-
tick_interval = -1
17+
tick_interval = STATUS_EFFECT_NO_TICK
1818
status_type = STATUS_EFFECT_UNIQUE
1919
alert_type = /atom/movable/screen/alert/status_effect/high_blood_pressure
2020

@@ -40,7 +40,7 @@
4040

4141
/datum/status_effect/seizure
4242
id = "seizure"
43-
tick_interval = -1
43+
tick_interval = STATUS_EFFECT_NO_TICK
4444
status_type = STATUS_EFFECT_UNIQUE
4545
alert_type = /atom/movable/screen/alert/status_effect/seizure
4646

code/datums/status_effects/gas.dm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757

5858
/datum/status_effect/freon/lasting
5959
id = "lasting_frozen"
60-
duration = -1
60+
duration = STATUS_EFFECT_PERMANENT
6161

6262
/datum/status_effect/hypernob_protection
6363
id = "hypernob_protection"

code/datums/status_effects/grouped_effect.dm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
/// Status effect from multiple sources, when all sources are removed, so is the effect
22
/datum/status_effect/grouped
3+
id = STATUS_EFFECT_ID_ABSTRACT
4+
alert_type = null
35
// Grouped effects adds itself to [var/sources] and destroys itself if one exists already, there are never actually multiple
46
status_type = STATUS_EFFECT_MULTIPLE
57
/// A list of all sources applying this status effect. Sources are a list of keys

code/datums/status_effects/limited_effect.dm

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
/// These effects reapply their on_apply() effect when refreshed while stacks < max_stacks.
22
/datum/status_effect/limited_buff
33
id = "limited_buff"
4-
duration = -1
4+
duration = STATUS_EFFECT_PERMANENT
55
status_type = STATUS_EFFECT_REFRESH
6+
alert_type = null
67
///How many stacks we currently have
78
var/stacks = 1
89
///How many stacks we can have maximum

0 commit comments

Comments
 (0)