Digimon World 3 decomp
The European version, SLES_039.36
Loading...
Searching...
No Matches
update_event9015.inc.c
Go to the documentation of this file.
1/*
2 * Events 9000 to 9015, the traps of the dungeon's Fire floor (Book Worm Ruri
3 * calls it "an advanced dungeon with various traps"): the player stops, then
4 * each partner of the party (the stage's partyActorIds) in turn gets a
5 * createSpritePair effect and is left with 1 HP, 0x1E frames apart; the task
6 * then runs while the first effect is in children->party[0]
7 */
9 Actor *player;
10 Actor *actor;
11 s32 i;
12
13 switch (task->state) {
14 case TASK_INIT:
15 default:
16 switch (task->substate) {
17 case 0:
18 default:
19 switch (task->step) {
20 case 0:
21 default:
23 player->setSubstate(player, ACTOR_STAND);
25 task->nextStep(task);
26 /* fallthrough */
27 case 1:
28 task->counter += GFX.funcs.getFrameTime();
29 if (task->counter >= 0x1E) {
30 task->nextSubstate(task);
31 }
32 break;
33 }
34 break;
35 case 1:
36 case 2:
37 case 3:
38 switch (task->step) {
39 case 0:
40 default:
41 i = task->substate - 1;
43 if (actor != NULL) {
44 children->party[i] = createSpritePair(actor->tile.x, actor->tile.y);
46 actor->setSubstate(actor, ACTOR_STOP);
48 task->nextStep(task);
49 } else {
50 task->nextSubstate(task);
51 }
52 break;
53 case 1:
54 task->counter += GFX.funcs.getFrameTime();
55 if (task->counter >= 0x1E) {
56 task->nextSubstate(task);
57 }
58 break;
59 }
60 break;
61 case 4:
62 task->nextState(task);
63 break;
64 }
65 break;
66 case TASK_RUN:
67 if (children->party[0] == NULL) {
68 task->setState(task, TASK_KILL);
69 }
70 break;
71 case TASK_DONE:
72 case TASK_KILL:
73 break;
74 }
75}
#define NULL
Definition common.h:17
signed int s32
Definition common.h:11
void * createSpritePair(s32 x, s32 y)
Creates a StageSpritePair at (x, y)
GfxState GFX
GFX: the graphics state and its methods.
Definition display.c:209
GameState GAME
The save data, the game mode and the methods.
Definition state.c:64
#define TASK_RUN
Definition task.h:35
#define TASK_KILL
Definition task.h:37
#define TASK_INIT
Tasks: every game object is a task, a heap block that starts with this header and is updated once per...
Definition task.h:34
#define TASK_DONE
Definition task.h:36
#define FIELD_TASK_ACTOR
every character (FIELDSTG_createActor)
Definition field_map.h:26
#define ACTOR_STOP
stops after a run
Definition field_map.h:309
#define ACTOR_STAND
Definition field_map.h:306
#define STAT_HP
Definition game_state.h:281
TaskRegistry TASK_REGISTRY
Definition registry.c:122
SoundState SOUND
rsin and rcos (libgte) read rsin_tbl[a - 0x800] and the like: their addresses before the table fall i...
Definition sound.c:180
#define SOUND_COMEX113
Definition sound.h:55
#define SOUND_SWITCH02
Definition sound.h:51
A character on the field (FIELDSTG_createActor): the player (kind 0) and the other characters.
Definition field_map.h:334
void(* setSubstate)(struct Actor *task, s32 substate)
Definition field_map.h:335
Vec2 tile
Definition field_map.h:337
Partner partners[PARTNER_COUNT]
Definition game_state.h:517
s32 party[3]
partner indices
Definition game_state.h:511
s32(* getFrameTime)(void)
Definition gfx.h:32
GfxFuncs funcs
Definition gfx.h:77
s16 stats[19]
Definition game_state.h:306
PartnerStats info
Definition game_state.h:349
short(* playSound)(s32 id)
returns the voice of a key-on
Definition sound.h:187
The children of a task with one per party slot.
Definition stage.h:125
void * party[3]
Definition stage.h:126
The task a stage starts (startStage), updated by its updateStage.
Definition stage.h:26
void(* nextStep)(struct StageTask *task)
Definition stage.h:27
s32 step
Definition stage.h:27
void(* nextSubstate)(struct StageTask *task)
Definition stage.h:27
s32 substate
Definition stage.h:27
void(* nextState)(struct StageTask *task)
Definition stage.h:27
s32 state
Definition stage.h:27
void(* setState)(struct StageTask *task, s32 state)
Definition stage.h:27
s32 counter
Definition stage.h:27
void *(* find)(s32 id, s32 key1, s32 key2)
Definition task.h:18
TaskFuncs funcs
Definition task.h:76
s32 y
Definition gfx.h:354
s32 x
Definition gfx.h:353
void updateEvent9015(StageTask *task, StagePartyChildren *children)
Events 9000 to 9015, the traps of the dungeon's Fire floor (Book Worm Ruri calls it "an advanced dung...
s32 partyActorIds[]
Defined below, after the code that uses them.
Definition wstag740.c:234