From 2d8dac183286397410b794ea7f73251084e7e7ec Mon Sep 17 00:00:00 2001 From: Lukas Krickl Date: Sat, 31 May 2025 05:39:17 +0200 Subject: [PATCH] effect: added effect definition for all units --- src/defs.s | 26 ++++++++++++++++++++++++++ src/effect.s | 0 src/macros.inc | 4 ++++ src/main.s | 1 + 4 files changed, 31 insertions(+) create mode 100644 src/effect.s diff --git a/src/defs.s b/src/defs.s index e697a62..5e0492b 100644 --- a/src/defs.s +++ b/src/defs.s @@ -33,6 +33,9 @@ #define CURSOR_MIN_Y 0 #define CURSOR_MAX_Y 0xB8 + ; each unit can have up to 4 status effects +#define EFFECTS_MAX 4 + #define PLAYERS 2 ; draw flags @@ -85,6 +88,22 @@ .de stat_max, 1 .de stat_size, 0 + ; status effect +.se 0 +.de effect_type, 1 +.de effect_dat, 1 +.de effect_size, 0 + + ; status effect types +.se 0 +.de EFFECT_NONE, 1 + + ; damage over time effect + ; dat NNNN0000: timer + ; dat 0000NNNN: damage value per tick +.de EFFECT_DOT, 1 + + ; actor type enum .se 0 .de ACT_T_NULL, 1 @@ -124,6 +143,13 @@ .de act_moves, stat_size ; moves for each turn .de act_init, 1 ; initiative value + ; inventory + + ; equipment + + ; status effects +.de act_effect, EFFECTS_MAX * effect_size + ; actor states ; used for state switching ; set to 0000 to disable the state diff --git a/src/effect.s b/src/effect.s new file mode 100644 index 0000000..e69de29 diff --git a/src/macros.inc b/src/macros.inc index 1435e88..d65256a 100644 --- a/src/macros.inc +++ b/src/macros.inc @@ -219,6 +219,10 @@ ; defines an empty status effect table #macro act_effects_empty + .db 0, 0 + .db 0, 0 + .db 0, 0 + .db 0, 0 #endmacro ; loads NULL into a 16 bit register diff --git a/src/main.s b/src/main.s index ca44f74..6ad5a4a 100644 --- a/src/main.s +++ b/src/main.s @@ -66,6 +66,7 @@ main: #include "state.s" #include "tiles.inc" #include "unit.s" +#include "effect.s" ; fill bank .fill 0, 0x7FFF - $ -- 2.30.2