Digimon World 3 decomp
The European version, SLES_039.36
Loading...
Searching...
No Matches
story.c
Go to the documentation of this file.
1/* The story events, which start at a point of the story */
2
3#include "field/field_mode.h"
4
5/*
6 * Runs the story events: marks the map object 1 for the progresses that have
7 * one, then starts the first event of FIELDSTG_progressEvents whose progress, flag and
8 * condition hold, and its next script once the first one ends.
9 */
11 StageTile *object;
12 ProgressEvent *event;
13 s32 i;
14
15 switch (task->state) {
16 case TASK_INIT:
17 default:
18 task->nextState(task);
19 task->script = 0;
20 for (object = FIELDSTG_state.objects; object->margin != 0; object++) {
21 if (object->anim == 1) {
22 break;
23 }
24 }
25 switch (GAME.progress) {
42 object->visible = 1;
43 break;
44 default:
45 object->visible = 0;
46 break;
47 }
48 children->lift = FIELDSTG_createLift(0x33A);
49 for (i = 0; FIELDSTG_progressEvents[i].progress != -1; i++) {
50 event = &FIELDSTG_progressEvents[i];
51 if (GAME.progress == event->progress && FLAGS_00.checkCondition(event->flag, 0) &&
53 children->script = FIELDSTG_startEvent(event->script);
54 task->script = event->nextScript;
55 break;
56 }
57 }
58 break;
59 case TASK_RUN:
60 if (children->script == NULL && task->script != 0) {
61 children->script = FIELDSTG_startEvent(task->script);
62 task->script = 0;
63 }
64 break;
65 case TASK_DONE:
66 case TASK_KILL:
67 break;
68 }
69}
70
71/* Creates the story events, and loads the field's sound bank and files */
74
75 task->owner = owner;
77 return task;
78}
#define NULL
Definition common.h:17
signed int s32
Definition common.h:11
GameFlags FLAGS_00
The flag bitset FLAGS_00 and the event functions.
Definition events.c:701
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
EventTask * FIELDSTG_startEvent(s32 id)
Starts the event id of FieldState.events: its script, start and end, and its text; the player stands ...
Definition event.c:250
FIELDSTG.PRO: the field mode, where the player walks around the map.
ProgressEvent FIELDSTG_progressEvents[]
Definition fieldstg.c:1328
void(* FIELDSTG_initFuncs[])(void)
Definition fieldstg.c:2559
FieldState FIELDSTG_state
Definition fieldstg.c:2641
Lift * FIELDSTG_createLift(s32 id)
Creates the lift, raised when flag 0x1C3D is set.
Definition lift.c:141
StoryEvents * FIELDSTG_createStoryEvents(void *owner)
Creates the story events, and loads the field's sound bank and files.
Definition story.c:72
void FIELDSTG_runStoryEvents(StoryEvents *task, StoryEventsChildren *children)
Runs the story events: marks the map object 1 for the progresses that have one, then starts the first...
Definition story.c:10
@ STORY_BLACK_ID_PASS
WSTAG756 (Battle Gate), event 911: the Black ID Pass.
Definition story.h:131
@ STORY_PRESIDENT_ARRESTED
WSTAG226 (Login Room, Amaterasu City), event 935, after the President of MAGAMI gives himself up (WST...
Definition story.h:136
@ STORY_BULBMON_FOUND
WSTAG520 (Suzaku Hall), event 695: another earthquake; Bulbmon digs the holes.
Definition story.h:103
@ STORY_BLUE_ID_PASS
WSTAG421 (Qing Long City), event 743: with the Blue ID Pass a Trooper takes the player for the Qing L...
Definition story.h:109
@ STORY_SEPIKMON_MASK_LOST
WSTAG480 (Jungle Grave), event 171: Sepikmon will say how to beat Zanbamon once the player finds his ...
Definition story.h:49
@ STORY_AMATERASU_BRIDGE
WSTAG206 (Amaterasu Bridge), event 922: an Attacker holds the bridge.
Definition story.h:133
@ STORY_CONTROL_ROOM
WSTAG325 (Control Room, Asuka City), event 560: a Soldier guards the way.
Definition story.h:90
@ STORY_NUMEMON_FOUND
WSTAG685 (Underground Cave, Byakko City), event 413: the rock blocking the hole is Numemon.
Definition story.h:73
@ STORY_KNIGHTMON_REPROGRAMMED
WSTAG210 (Main Lobby, Asuka City), event 685: the A.o.A have reprogrammed Knightmon,...
Definition story.h:97
@ STORY_TEDDY_FOUND
WSTAG212, event 352: Teddy is found; MAGAMI is part of the A.o.A, and the player sets off to beat the...
Definition story.h:67
@ STORY_LOOKING_FOR_TEDDY
WSTAG212, event 273: Kail and the player will put on the Agumon Suits to look for Teddy.
Definition story.h:61
@ STORY_WAY_TO_AMATERASU
WSTAG305, events 893 and 895: the way into Amaterasu City, the A.o.A's headquarters,...
Definition story.h:126
@ STORY_DE_KNOWLEDGE
WSTAG526 (Zhu Que UG Lake), event 760: the fight with Zanbamon (the DE Knowledge)
Definition story.h:115
@ STORY_GENBU_BADGE
WSTAG755 (Battle Gate), event 781: the Xuen Wu Chief, who holds the Black ID Pass,...
Definition story.h:118
@ STORY_ASUKA_HEADQUARTERS
WSTAG310 (A.o.A Headquarters, Asuka City), event 961.
Definition story.h:138
@ STORY_SEIRYU_BADGE
WSTAG420, event 71: the Seiryu Leader is beaten (the Silver ID and the Seiryu Badge),...
Definition story.h:39
StageTile * objects
the map objects, up to the first margin 0
Definition field_map.h:446
s32(* checkCondition)(u16 code, u16 value)
Definition game_state.h:53
A story event (FIELDSTG_progressEvents): at a progress, while a flag is clear and a condition holds,...
Definition field_mode.h:335
s32 progress
-1 ends the list
Definition field_mode.h:336
An object of a map, which FIELDSTG draws: a record of the table at FieldState.objects,...
Definition field_map.h:208
u8 anim
which of a stage's animations sets frame (1-3); FIELDSTG finds objects by it (its lift,...
Definition field_map.h:210
EventTask * script
Definition field_mode.h:330
The story events of the field (FIELDSTG_createStoryEvents)
Definition field_mode.h:322
s32 script
the script to run next, or 0
Definition field_mode.h:325
void(* nextState)(struct StoryEvents *task)
Definition field_mode.h:323
void * owner
the field's task, as a stage's init gets it
Definition field_mode.h:324
void * createTask(void(*update)(), s32 size, s32 childrenSize)
createTaskWithId for a task nothing needs to find
Definition task.c:105