Process certain status effects using a new "priority effects" subsystem (#89076)

This commit is contained in:
Lucy
2025-01-26 08:34:38 -05:00
committed by GitHub
parent 2aa4f6c881
commit cc80029518
8 changed files with 22 additions and 3 deletions

View File

@@ -22,6 +22,8 @@
#define STATUS_EFFECT_FAST_PROCESS 0
/// This is slower and better for more intensive status effects - 1s between ticks
#define STATUS_EFFECT_NORMAL_PROCESS 1
/// Similar speed to STATUS_EFFECT_FAST_PROCESS, but uses a high priority subsystem (SSpriority_effects)
#define STATUS_EFFECT_PRIORITY 2
//several flags for the Necropolis curse status effect
///makes the edges of the target's screen obscured

View File

@@ -224,6 +224,7 @@
#define FIRE_PRIORITY_PARALLAX 65
#define FIRE_PRIORITY_INSTRUMENTS 80
#define FIRE_PRIORITY_FLUIDS 80
#define FIRE_PRIORITY_PRIORITY_EFFECTS 90
#define FIRE_PRIORITY_MOBS 100
#define FIRE_PRIORITY_TGUI 110
#define FIRE_PRIORITY_TICKER 200

View File

@@ -0,0 +1,6 @@
PROCESSING_SUBSYSTEM_DEF(priority_effects)
name = "Priority Status Effects"
flags = SS_TICKER | SS_KEEP_TIMING | SS_NO_INIT
wait = 2 // Not seconds - we're running on SS_TICKER, so this is ticks.
priority = FIRE_PRIORITY_PRIORITY_EFFECTS
stat_tag = "PEFF"

View File

@@ -75,6 +75,8 @@
START_PROCESSING(SSfastprocess, src)
if(STATUS_EFFECT_NORMAL_PROCESS)
START_PROCESSING(SSprocessing, src)
if(STATUS_EFFECT_PRIORITY)
START_PROCESSING(SSpriority_effects, src)
update_particles()
@@ -86,6 +88,8 @@
STOP_PROCESSING(SSfastprocess, src)
if(STATUS_EFFECT_NORMAL_PROCESS)
STOP_PROCESSING(SSprocessing, src)
if(STATUS_EFFECT_PRIORITY)
STOP_PROCESSING(SSpriority_effects, src)
if(owner)
linked_alert = null
owner.clear_alert(id)

View File

@@ -1,8 +1,8 @@
/datum/status_effect/stop_drop_roll
id = "stop_drop_roll"
alert_type = null
tick_interval = 0.8 SECONDS
processing_speed = STATUS_EFFECT_PRIORITY
/datum/status_effect/stop_drop_roll/on_apply()
if(!iscarbon(owner))

View File

@@ -12,6 +12,7 @@
tick_interval = STATUS_EFFECT_NO_TICK
status_type = STATUS_EFFECT_REPLACE
alert_type = null
processing_speed = STATUS_EFFECT_PRIORITY
remove_on_fullheal = TRUE
heal_flag_necessary = HEAL_CC_STATUS
var/needs_update_stat = FALSE

View File

@@ -21,6 +21,10 @@
if(STATUS_EFFECT_NORMAL_PROCESS)
if(tick_speed < SSprocessing.wait)
TEST_FAIL("Status effect [checking] has tick_interval set to [tick_speed], which is faster than SSprocessing can tick ([SSprocessing.wait]).")
if(STATUS_EFFECT_PRIORITY)
var/priority_wait = world.tick_lag * SSpriority_effects.wait // SSpriority_effects has the SS_TICKER flag, so its wait is in ticks, so we have to convert it to deciseconds.
if(tick_speed < priority_wait)
TEST_FAIL("Status effect [checking] has tick_interval set to [tick_speed], which is faster than SSpriority_effects can tick ([priority_wait]).")
else
TEST_FAIL("Invalid processing speed for status effect [checking] : [initial(checking.processing_speed)]")

View File

@@ -777,6 +777,7 @@
#include "code\controllers\subsystem\processing\manufacturing.dm"
#include "code\controllers\subsystem\processing\obj.dm"
#include "code\controllers\subsystem\processing\plumbing.dm"
#include "code\controllers\subsystem\processing\priority_effects.dm"
#include "code\controllers\subsystem\processing\processing.dm"
#include "code\controllers\subsystem\processing\projectiles.dm"
#include "code\controllers\subsystem\processing\quirks.dm"