mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-20 22:54:46 +00:00
* Auto-docs + code improvements + splits up status_effect.dm (#66362) * Code improvements for status effects in general * Does this for now * Throws in a qdeleted check * A return * comment tweak * Missed some ref()s * Wrong var * Comment clarifications * Some more comment clarifications * Auto-docs + code improvements + splits up status_effect.dm Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com>
21 lines
579 B
Plaintext
21 lines
579 B
Plaintext
/// These effects reapply their on_apply() effect when refreshed while stacks < max_stacks.
|
|
/datum/status_effect/limited_buff
|
|
id = "limited_buff"
|
|
duration = -1
|
|
status_type = STATUS_EFFECT_REFRESH
|
|
///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
|