Files
Bubberstation/code/datums/status_effects/limited_effect.dm
MrMelbert 3c40876f15 Fix itchy skillchip status effect "Curse of Mundanity", adds unit test for effects set to "Curse of Mundanity" (and missing IDs) (#88240)
## About The Pull Request

Fixes a lot of status effects having the default alert, adds a unit test
to check that status effects don't forget to change it

I chose a test rather than just making the default "no alert" because I
think people making status effects should think about whether it should
have an alert

Also I added a test for effects which did not set an ID because that's
kind of important, I applied the same mindset here to account for
abstract types but admittedly less sold on this one.

## Changelog

🆑 Melbert
fix: You should be afflicted by the "Curse of Mundanity" far, far less
/🆑
2024-11-29 15:41:37 +01:00

22 lines
619 B
Plaintext

/// These effects reapply their on_apply() effect when refreshed while stacks < max_stacks.
/datum/status_effect/limited_buff
id = "limited_buff"
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
var/max_stacks = 3
/datum/status_effect/limited_buff/refresh(effect)
if(stacks < max_stacks)
on_apply()
stacks++
else
maxed_out()
/// Called whenever the buff is refreshed when there are more stacks than max_stacks.
/datum/status_effect/limited_buff/proc/maxed_out()
return