summaryrefslogtreecommitdiff
path: root/kon/konrmfield.h
diff options
context:
space:
mode:
authorKonAki <konaki@anokonaki.org>2026-10-16 07:08:55 +0800
committerKonAki <konaki@anokonaki.org>2026-10-16 07:08:55 +0800
commit1c1c2aa89920ffcf4d80a29c12a9999188adbaac (patch)
treefcfac42e390af8b284924fa79615dddb008241a0 /kon/konrmfield.h
parent85c684cefcb133ce5025f991077b2d9f9bc9ec64 (diff)
add random fights to rmfield
Diffstat (limited to 'kon/konrmfield.h')
-rw-r--r--kon/konrmfield.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/kon/konrmfield.h b/kon/konrmfield.h
index d2b358f..17a44fd 100644
--- a/kon/konrmfield.h
+++ b/kon/konrmfield.h
@@ -76,10 +76,12 @@ typedef struct kon_rmField {
int count;
uint32_t seed;
int busy; /* set it while a script that stops the player is running */
- int steps; /* the steps of the player, count them for encounters and take them back to 0 */
+ int steps; /* the steps of the player so far, for the game to use as it likes */
int thisEvent; /* the id of the event whose script is running, for the commands that mean "this event". set it before you run one */
int waitIndex; /* the character a script waits for, -1 for none */
int transferPending;
+ int encounterCount; /* what is left until the next fight, in halves of a step */
+ int encounterHalf, encounterNone; /* set them to halve the steps that count, or to stop fights altogether */
kon_rmTransfer_t transfer;
/* both can stay NULL. the first is how a route that turns a switch on or off reaches your game, the second says whether
@@ -111,6 +113,13 @@ int kon_rmFieldPlayerStep(kon_rmField_t *field, int dir, int dash);
/* the action button: an event on the player's tile or in front of it, or behind a counter. returns 1 when one starts */
int kon_rmFieldAction(kon_rmField_t *field);
+/*** fights ***/
+
+/* the random fights of the map: every step of the player counts down, a bush counts twice, and when it runs out a troop is picked
+ from the map's list by weight, only the ones whose regions include the one the player stands in. returns the troop id once,
+ or 0 for no fight. call it when no script is running. nothing starts while the player is walking a forced route */
+int kon_rmFieldEncounter(kon_rmField_t *field);
+
/*** events that start ***/
/* the next event that wants its script to run, lowest first: the touched or talked to, and the autorun ones. call it when no