Digimon World 3 decomp
The European version, SLES_039.36
Loading...
Searching...
No Matches
wstag460.c File Reference

WSTAG460: Reliability Spot, South Sector. More...

Include dependency graph for wstag460.c:

Go to the source code of this file.

Macros

#define STAGE_CHILDREN_SIZE   4
 
#define STAGE_TEXT   TEXT_FILE(TEXT_TALKS_06)
 
#define EVENT_TEXT_FILE   (TEXT_EVENTS_400 - 1)
 
#define STAGE_FILE   0x363
 
#define STAGE_ARCHIVE   0x45F
 

Functions

void * createTileSoloTask (void)
 Creates the color-cycling map object by the Digi-Egg of Sincerity (updateTileSolo), the one with animation 10.
 
void * createTileDuoTask (void)
 Creates the updateTileDuo task.
 
void fadeOutWanderer ()
 
void fadeOutTileSolo (StageTileSolo *task, s32 command, s32 arg)
 Makes the StageTileSolo hide in 20 frames; command and arg, a script command handler's (ScriptCommand.handle), are 0 from the stage and unread.
 
void fadeOutTileDuo (StageTileDuo *task, s32 command, s32 arg)
 Makes the StageTileDuo hide in 150 frames (command and arg as fadeOutTileSolo's)
 
StageWanderer * createWandererTask (s32 tileAnim, s32 speedIndex, s32 start)
 Creates a wanderer of the map object with the given animation.
 
void updateCommand830 (StageTask *task, void **children)
 Creates the tiles and the seven wanderers; in TASK_DONE makes them all hide and goes back to TASK_RUN.
 
void handleCommand830 (Task *task, s32 id)
 Sets the task to TASK_DONE when the id is 0x34C.
 
void * createCommand830 (s32 id)
 Creates the task of updateCommand830 with the given id.
 
void updateTileSolo (StageTileSolo *task)
 Shows the map object with animation 10 (animated) while mode isn't 0, and hides it by a one-shot animation wait frames after mode 2.
 
void * createTileSolo (s32 arg)
 Creates the color-cycling map object by the Digi-Egg of Sincerity (updateTileSolo) with an id; nothing in the game calls it.
 
void updateTileDuo (StageTileDuo *task)
 Cycles the colors of the map objects with animations 8 and 9 by the Digi- Egg of Sincerity while mode isn't 0, and ends wait frames after mode 2.
 
s32 isFarFromHome (StageWanderer *task, s32 dist)
 Whether the wanderer is more than dist from home (in x + y)
 
void moveWanderer (StageWanderer *task)
 Moves the wanderer, turning it every period frames.
 
void updateWanderer (StageWanderer *task)
 Wanders; when done, plays the animation of updateWandererFrames1 once and hides.
 
void fadeOutWanderer (StageWanderer *task)
 Makes the wanderer wait 60 frames, then slow down and finish.
 
void * createWanderer (s32 arg)
 Creates one of the map objects that wander by the Digi-Egg of Sincerity (updateWanderer) with an id; nothing in the game calls it.
 
void updateStage (StageTask *task, void **children)
 Creates the task of updateCommand830 (id 0x33E) before progress 0xF.
 
void endEvent370 (void)
 After event 370, with the player: moves the story on to STORY_DE_SINCERITY and gives the player the DE Sincerity.
 
void setupStage (void)
 Sets the stage up: its map, actors and events, playing BGM_0014.
 

Variables

AnimFrame updateWandererFrames0 []
 Defined below, after the code that uses them.
 
AnimFrame updateWandererFrames1 []
 
u16 wandererSpeeds []
 
u16 angleTangents []
 
AnimFrame * updateTileDuoFrames0 []
 
AnimFrame * updateTileDuoFrames1 []
 
u8 tileDuoObjectFrames [2][2]
 
AnimFrame updateTileSoloFrames0 []
 
AnimFrame updateTileSoloFrames1 []
 
s16 script370 []
 
AnimFrame updateTileDuoFrames0_0 []
 
AnimFrame updateTileDuoFrames1_0 []
 
AnimFrame updateTileDuoFrames0_1 []
 
AnimFrame updateTileDuoFrames1_1 []
 
ActorImage stageImages []
 
FieldTalk actor0Talks []
 
u16 actor1Conditions [] = { (0x6000 | ( STORY_TEDDY_FOUND )) , 1, 0xFFFF }
 
FieldActorEntry actor0 = { ((void *)0) , actor0Talks, 0x3F, 4, 250, 109, 1 }
 
FieldActorEntry actor1 = { actor1Conditions, ((void *)0) , 0x82, 5, 96, 367, 7 }
 
FieldActorEntry * stageActors []
 
StageTile stageObjects []
 The tables and color setupStage gives FIELDSTG_state (FieldState)
 
StageSlot stageSlots []
 
void(* stageFuncs [])(void)
 The stage's functions (common/start_stage.inc.c calls the first): a StageFuncs in the stages with a tween, which define STAGE_TWEEN before they include this file, and in the others an array of just setupStage.
 
FieldEvent stageEvents []
 

Detailed Description

WSTAG460: Reliability Spot, South Sector.

Where the Qing Long Chief welcomes the player.

Definition in file wstag460.c.

Macro Definition Documentation

◆ STAGE_CHILDREN_SIZE

#define STAGE_CHILDREN_SIZE   4

Definition at line 429 of file wstag460.c.

◆ STAGE_TEXT

#define STAGE_TEXT   TEXT_FILE(TEXT_TALKS_06)

Definition at line 447 of file wstag460.c.

◆ EVENT_TEXT_FILE

#define EVENT_TEXT_FILE   (TEXT_EVENTS_400 - 1)

Definition at line 448 of file wstag460.c.

◆ STAGE_FILE

#define STAGE_FILE   0x363

Definition at line 449 of file wstag460.c.

◆ STAGE_ARCHIVE

#define STAGE_ARCHIVE   0x45F

Definition at line 450 of file wstag460.c.

Function Documentation

◆ createTileSoloTask()

void * createTileSoloTask ( void  )

Creates the color-cycling map object by the Digi-Egg of Sincerity (updateTileSolo), the one with animation 10.

Definition at line 161 of file wstag460.c.

Referenced by updateCommand830().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ createTileDuoTask()

void * createTileDuoTask ( void  )

Creates the updateTileDuo task.

Definition at line 2 of file create_tile_duo_task.inc.c.

Referenced by updateCommand830().

Here is the caller graph for this function:

◆ fadeOutWanderer() [1/2]

void fadeOutWanderer ( )

Referenced by updateCommand830().

Here is the caller graph for this function:

◆ fadeOutTileSolo()

void fadeOutTileSolo ( StageTileSolo *  task,
s32  command,
s32  arg 
)

Makes the StageTileSolo hide in 20 frames; command and arg, a script command handler's (ScriptCommand.handle), are 0 from the stage and unread.

Definition at line 142 of file wstag460.c.

Referenced by updateCommand830().

Here is the caller graph for this function:

◆ fadeOutTileDuo()

void fadeOutTileDuo ( StageTileDuo *  task,
s32  command,
s32  arg 
)

Makes the StageTileDuo hide in 150 frames (command and arg as fadeOutTileSolo's)

Definition at line 250 of file wstag460.c.

◆ createWandererTask()

StageWanderer * createWandererTask ( s32  tileAnim,
s32  speedIndex,
s32  start 
)

Creates a wanderer of the map object with the given animation.

Definition at line 403 of file wstag460.c.

Referenced by updateCommand830().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ updateCommand830()

void updateCommand830 ( StageTask *  task,
void **  children 
)

Creates the tiles and the seven wanderers; in TASK_DONE makes them all hide and goes back to TASK_RUN.

Definition at line 26 of file wstag460.c.

Referenced by createCommand830().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ handleCommand830()

void handleCommand830 ( Task *  task,
s32  id 
)

Sets the task to TASK_DONE when the id is 0x34C.

Definition at line 61 of file wstag460.c.

◆ createCommand830()

void * createCommand830 ( s32  id)

Creates the task of updateCommand830 with the given id.

Definition at line 68 of file wstag460.c.

Referenced by updateStage().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ updateTileSolo()

void updateTileSolo ( StageTileSolo *  task)

Shows the map object with animation 10 (animated) while mode isn't 0, and hides it by a one-shot animation wait frames after mode 2.

Definition at line 75 of file wstag460.c.

Referenced by createTileSolo(), and createTileSoloTask().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ createTileSolo()

void * createTileSolo ( s32  arg)

Creates the color-cycling map object by the Digi-Egg of Sincerity (updateTileSolo) with an id; nothing in the game calls it.

Definition at line 153 of file wstag460.c.

Here is the call graph for this function:

◆ updateTileDuo()

void updateTileDuo ( StageTileDuo *  task)

Cycles the colors of the map objects with animations 8 and 9 by the Digi- Egg of Sincerity while mode isn't 0, and ends wait frames after mode 2.

Definition at line 171 of file wstag460.c.

Referenced by createTileDuo(), and createTileDuoTask().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isFarFromHome()

s32 isFarFromHome ( StageWanderer *  task,
s32  dist 
)

Whether the wanderer is more than dist from home (in x + y)

Definition at line 264 of file wstag460.c.

Referenced by moveWanderer().

Here is the caller graph for this function:

◆ moveWanderer()

void moveWanderer ( StageWanderer *  task)

Moves the wanderer, turning it every period frames.

Definition at line 280 of file wstag460.c.

Referenced by updateWanderer().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ updateWanderer()

void updateWanderer ( StageWanderer *  task)

Wanders; when done, plays the animation of updateWandererFrames1 once and hides.

Definition at line 303 of file wstag460.c.

Referenced by createWanderer(), and createWandererTask().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fadeOutWanderer() [2/2]

void fadeOutWanderer ( StageWanderer *  task)

Makes the wanderer wait 60 frames, then slow down and finish.

Definition at line 387 of file wstag460.c.

◆ createWanderer()

void * createWanderer ( s32  arg)

Creates one of the map objects that wander by the Digi-Egg of Sincerity (updateWanderer) with an id; nothing in the game calls it.

Definition at line 398 of file wstag460.c.

Here is the call graph for this function:

◆ updateStage()

void updateStage ( StageTask *  task,
void **  children 
)

Creates the task of updateCommand830 (id 0x33E) before progress 0xF.

Definition at line 413 of file wstag460.c.

Here is the call graph for this function:

◆ endEvent370()

void endEvent370 ( void  )

After event 370, with the player: moves the story on to STORY_DE_SINCERITY and gives the player the DE Sincerity.

Definition at line 436 of file wstag460.c.

◆ setupStage()

void setupStage ( void  )

Sets the stage up: its map, actors and events, playing BGM_0014.

Sets the stage up: its map, actors, battles and events, playing KANRIBGM; BGM_0029 instead except at STORY_PRESIDENT_ARRESTED once flag 0x1A0A is set.

< BGM_0014: the Reliability Spot

< BGM_0014: the Reliability Spot

< a cell's value: a direction (3 bits) and a StageSlot (5)

Definition at line 453 of file wstag460.c.

Variable Documentation

◆ updateWandererFrames0

AnimFrame updateWandererFrames0
Initial value:
= {
{ 0, 4 }, { 1, 4 }, { 2, 4 }, { 3, 4 },
{ 4, 4 }, { 5, 4 }, { 4, 4 }, { 3, 4 },
{ 2, 4 }, { 1, 4 }, { 255, 0 },
}

Defined below, after the code that uses them.

Definition at line 551 of file wstag460.c.

Referenced by updateWanderer().

◆ updateWandererFrames1

AnimFrame updateWandererFrames1
Initial value:
= {
{ 0, 4 }, { 1, 4 }, { 2, 4 }, { 3, 4 },
{ 4, 4 }, { 5, 4 }, { 6, 8 }, { 7, 8 },
{ 8, 8 }, { 9, 8 }, { 10, 8 }, { 255, 0x3E7 },
}

Definition at line 556 of file wstag460.c.

Referenced by updateWanderer().

◆ wandererSpeeds

u16 wandererSpeeds
Initial value:
= {
96, 80, 72, 64,
}

Definition at line 561 of file wstag460.c.

Referenced by updateWanderer().

◆ angleTangents

u16 angleTangents
Initial value:
= {
0, 0x648, 0xC93, 0x12E2, 0x1936, 0x1F92, 0x259F, 0x2C6B,
0x32EB, 0x39C7, 0x401F, 0x46D7, 0x4DA7, 0x5491, 0x5B98, 0x62BF,
0x6A09, 0x7179, 0x7913, 0x80DB, 0x88B5, 0x9105, 0x9970, 0xA21B,
0xAB0D, 0xB44A, 0xBDDC, 0xC7C8, 0xD217, 0xDCD2, 0xE805, 0xF3BA,
0xFFFE, 0xFFFF,
}

Definition at line 564 of file wstag460.c.

Referenced by getAngle().

◆ updateTileDuoFrames0

AnimFrame * updateTileDuoFrames0
Initial value:
= {
}
AnimFrame updateTileDuoFrames0_1[]
Definition wstag460.c:529
AnimFrame updateTileDuoFrames0_0[]
Definition wstag460.c:517

Definition at line 541 of file wstag460.c.

Referenced by updateTileDuo().

◆ updateTileDuoFrames1

AnimFrame * updateTileDuoFrames1
Initial value:
= {
}
AnimFrame updateTileDuoFrames1_0[]
Definition wstag460.c:523
AnimFrame updateTileDuoFrames1_1[]
Definition wstag460.c:535

Definition at line 544 of file wstag460.c.

Referenced by updateTileDuo().

◆ tileDuoObjectFrames

u8 tileDuoObjectFrames
Initial value:
= {
{ 62, 63 },
{ 64, 65 },
}

Definition at line 547 of file wstag460.c.

Referenced by updateTileDuo().

◆ updateTileSoloFrames0

AnimFrame updateTileSoloFrames0
Initial value:
= {
{ 0, 8 }, { 1, 8 }, { 2, 8 }, { 3, 8 },
{ 4, 8 }, { 5, 8 }, { 6, 8 }, { 7, 8 },
{ 8, 8 }, { 9, 8 }, { 10, 8 }, { 11, 8 },
{ 12, 8 }, { 13, 8 }, { 14, 8 }, { 255, 0 },
}

Definition at line 505 of file wstag460.c.

Referenced by updateTileSolo().

◆ updateTileSoloFrames1

AnimFrame updateTileSoloFrames1
Initial value:
= {
{ 0, 8 }, { 1, 8 }, { 2, 8 }, { 3, 8 },
{ 4, 8 }, { 5, 8 }, { 6, 8 }, { 7, 8 },
{ 8, 8 }, { 9, 8 }, { 10, 8 }, { 11, 8 },
{ 255, 0x3E7 },
}

Definition at line 511 of file wstag460.c.

Referenced by updateTileSolo().

◆ script370

s16 script370[]

Definition at line 472 of file wstag460.c.

◆ updateTileDuoFrames0_0

AnimFrame updateTileDuoFrames0_0[]
Initial value:
= {
{ 0, 8 }, { 1, 8 }, { 2, 8 }, { 3, 8 },
{ 4, 8 }, { 5, 8 }, { 6, 8 }, { 7, 8 },
{ 8, 8 }, { 9, 8 }, { 10, 8 }, { 11, 8 },
{ 12, 8 }, { 13, 8 }, { 14, 8 }, { 255, 0 },
}

Definition at line 517 of file wstag460.c.

◆ updateTileDuoFrames1_0

AnimFrame updateTileDuoFrames1_0[]
Initial value:
= {
{ 0, 6 }, { 1, 6 }, { 2, 6 }, { 3, 6 },
{ 4, 6 }, { 5, 6 }, { 6, 6 }, { 7, 6 },
{ 8, 6 }, { 9, 6 }, { 10, 6 }, { 11, 6 },
{ 255, 0x3E7 },
}

Definition at line 523 of file wstag460.c.

◆ updateTileDuoFrames0_1

AnimFrame updateTileDuoFrames0_1[]
Initial value:
= {
{ 0, 8 }, { 1, 8 }, { 2, 8 }, { 3, 8 },
{ 4, 8 }, { 5, 8 }, { 6, 8 }, { 7, 8 },
{ 8, 8 }, { 9, 8 }, { 10, 8 }, { 11, 8 },
{ 12, 8 }, { 13, 8 }, { 14, 8 }, { 255, 0 },
}

Definition at line 529 of file wstag460.c.

◆ updateTileDuoFrames1_1

AnimFrame updateTileDuoFrames1_1[]
Initial value:
= {
{ 0, 6 }, { 1, 6 }, { 2, 6 }, { 3, 6 },
{ 4, 6 }, { 5, 6 }, { 6, 6 }, { 7, 6 },
{ 8, 6 }, { 9, 6 }, { 10, 6 }, { 11, 6 },
{ 255, 0x3E7 },
}

Definition at line 535 of file wstag460.c.

◆ stageImages

ActorImage stageImages[]
Initial value:
= {
{ 0x200, 0x100, 0x21C, 0x1A6, 0x70, 0xA6, 0x230, 0x1FE },
{ 0x200, 0x100, 0x200, 0x100, 0, 0, 0x220, 0x1FE },
{ 0x200, 0x100, 0x216, 0x138, 0x58, 0x38, 0x200, 0x1FD },
{ 0x200, 0x100, 0x208, 0x1BC, 0x20, 0xBC, 0x210, 0x1FD },
{ 0x200, 0x100, 0x210, 0x1BC, 0x40, 0xBC, 0x220, 0x1FD },
{ 0x200, 0x100, 0x200, 0x1BC, 0, 0xBC, 0x230, 0x1FD },
{ 0, 0, 0, 0, 0, 0, 0, 0 },
{ 0x140, 0x100, 0x17A, 0x1D8, 0xE8, 0xD8, 0x170, 0x1F1 },
}

Definition at line 571 of file wstag460.c.

Referenced by setupStage().

◆ actor0Talks

FieldTalk actor0Talks[]
Initial value:
= {
{ ((void *)0) , ((void *)0) , 0x33A },
{ ((void *)0) , ((void *)0) , 0 },
}

Definition at line 581 of file wstag460.c.

◆ actor1Conditions

u16 actor1Conditions[] = { (0x6000 | ( STORY_TEDDY_FOUND )) , 1, 0xFFFF }

Definition at line 585 of file wstag460.c.

◆ actor0

FieldActorEntry actor0 = { ((void *)0) , actor0Talks, 0x3F, 4, 250, 109, 1 }

Definition at line 586 of file wstag460.c.

◆ actor1

FieldActorEntry actor1 = { actor1Conditions, ((void *)0) , 0x82, 5, 96, 367, 7 }

Definition at line 587 of file wstag460.c.

◆ stageActors

FieldActorEntry* stageActors[]
Initial value:
= {
((void *)0) ,
}
FieldActorEntry actor0
Definition wstag460.c:586
FieldActorEntry actor1
Definition wstag460.c:587

Definition at line 588 of file wstag460.c.

Referenced by setupStage().

◆ stageObjects

StageTile stageObjects[]
Initial value:
= {
{ 0, 8, 0xFF, 2, 0x3E, 0, 0, 0, 0, 0, 46, 288, 0, 0 },
{ 0, 3, 0x40, 2, 0xD, 0, 0, 0, 0, 0, 52, 288, 0, 0 },
{ 0, 2, 0x40, 2, 0xD, 0, 0, 0, 0, 0, 154, 262, 0, 0 },
{ 0, 1, 0x40, 2, 0xD, 0, 0, 0, 0, 0, 174, 359, 0, 0 },
{ 0, 7, 0x40, 2, 0xE, 0, 0, 0, 0, 0, 103, 297, 0, 0 },
{ 0, 5, 0x40, 2, 0xE, 0, 0, 0, 0, 0, 117, 236, 0, 0 },
{ 0, 6, 0x40, 2, 0xE, 0, 0, 0, 0, 0, 217, 300, 0, 0 },
{ 1, 0, 0x40, 2, 0x32, 2, 0, 1, 0xC, 0, 48, 288, 0, 0 },
{ 1, 0, 0x40, 2, 0x32, 2, 0, 1, 0xC, 0, 160, 280, 0, 0 },
{ 1, 0, 0x40, 2, 0x33, 2, 0, 1, 0xC, 0, 104, 248, 0, 0 },
{ 1, 0, 0x40, 2, 0x33, 2, 0, 1, 0xC, 0, 233, 263, 0, 0 },
{ 1, 0, 0x40, 2, 0x33, 2, 0, 1, 0xC, 0, 233, 335, 0, 0 },
{ 0, 0xA, 0xFF, 6, 0x3C, 0, 0, 0, 0, 0, 50, 239, 0, 0 },
{ 0, 9, 0xFF, 6, 0x3F, 0, 0, 0, 0, 0, 46, 288, 0, 0 },
{ 1, 0, 0x40, 4, 0, 0, 0, 0, 0, 0, 240, 72, 135, 0 },
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
}

The tables and color setupStage gives FIELDSTG_state (FieldState)

Definition at line 593 of file wstag460.c.

Referenced by setupStage().

◆ stageSlots

StageSlot stageSlots[]
Initial value:
= {
{ { { (0x6000 | ( STORY_TEDDY_FOUND )) , 1 }, { 0xFFFF , 0 } }, 8 , 0x172, 0, 0, 0, 0, 0, 0 },
{ { { 0xFFFF , 0 }, { 0xFFFF , 0 } }, 3 , 0xE, 0xEF, 0xA8, 0, 0, 0, 0 },
{ { { 0xFFFF , 0 }, { 0xFFFF , 0 } }, 2 , 0xE, 0xDF, 0x190, 0, 0, 0, 0 },
{ { { 0xFFFF , 0 }, { 0xFFFF , 0 } }, 0, 0, 0, 0, 0, 0, 0, 0 },
}
@ 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

Definition at line 611 of file wstag460.c.

Referenced by setupStage().

◆ stageFuncs

void(* stageFuncs[])(void) ( void  )
Initial value:
= {
}
void setupStage(void)
Sets the stage up: its map, actors and events, playing BGM_0014.
Definition wstag460.c:453

The stage's functions (common/start_stage.inc.c calls the first): a StageFuncs in the stages with a tween, which define STAGE_TWEEN before they include this file, and in the others an array of just setupStage.

Definition at line 617 of file wstag460.c.

◆ stageEvents

FieldEvent stageEvents[]
Initial value:
= {
{ 370, script370, ( ( 0x136 - 1) << 16 | ( 0x28 )), ((void *)0) , endEvent370 },
{ -1, ((void *)0) , 0, ((void *)0) , ((void *)0) },
}
s16 script370[]
Definition wstag460.c:472
void endEvent370(void)
After event 370, with the player: moves the story on to STORY_DE_SINCERITY and gives the player the D...
Definition wstag460.c:436

Definition at line 620 of file wstag460.c.

Referenced by setupStage().