Tolbi's spring and the game rooms beside it: Lucky Medals or coins tossed into the spring win prizes, and the attendants run Lucky Dice and Lucky Wheels. More...
Go to the source code of this file.
Data Structures | |
| struct | SpringTossMotion |
| The tossed coin or medal: its last four positions for the trail, its velocity and the frames the prize rings still pull it. More... | |
| struct | SpringObstacle |
| One of the four obstacles moving in the spring during a toss. More... | |
| struct | Half |
| A halfword holding the zero the gauge's slide and phase are cleared with. More... | |
Macros | |
| #define | SPRING_CENTER_X PIXELS(120) |
| #define | SPRING_CENTER_Z PIXELS(71) |
| #define | ASK_WIDTH 17 |
| #define | NUMBER_X 72 |
| #define | TOSS_X 20 |
| #define | TOSS_WIDTH 9 |
Enumerations | |
| enum | SpringTossKind { SPRING_TOSS_COIN , SPRING_TOSS_MEDAL } |
| enum | TolbiSpringGameRoomActor { TOLBI_SPRING_WHEELS_ATTENDANT = 8 , TOLBI_SPRING_DICE_ATTENDANT = 9 , TOLBI_SPRING_WHEELS_PRIZE_SIGN = 14 , TOLBI_SPRING_WHEELS_RULES_SIGN = 15 , TOLBI_SPRING_SOLDIER = 17 } |
| The game room's actors, numbered in the order of its placement table from 8. More... | |
| enum | TolbiSpringActor { TOLBI_SPRING_MEDAL_SEEKER = 27 , TOLBI_SPRING_SPRING = 80 } |
| The spring's own actors, numbered the same way. More... | |
Functions | |
| static void | TolbiSpring_RiseAndFadeIn (void) |
| Raises the spring's displayed layer and blends it into view. | |
| static void | TolbiSpring_OfferLuckyWheels (s32 spoken) |
| Checks tickets and inventory space before sending the party to Lucky Wheels. | |
| static s32 | TolbiSpring_RunSpringGame (void) |
| Chooses a coin or medal, runs its toss, and awards the resulting prize. | |
| static s32 | TolbiSpring_SelectLuckyWheelsPrize (s32 category) |
| Chooses an item variant in the prize category, avoiding its last variant. | |
| static void | TolbiSpring_InitializeTossSimulation (void) |
| Resets four obstacles and schedules the spring simulation. | |
| static s32 | TolbiSpring_RunToss (s32 tossKind) |
| Launches the chosen coin or medal and waits for its final prize ring. | |
| static __inline__ void | Io_SetBlendControl (s32 value) |
| static __inline__ void | Io_SetBlendAlpha (s32 value) |
| const struct SceneEntrance * | TolbiSpring_GetEntrances (void) |
| const struct SceneRegion * | TolbiSpring_GetRegions (void) |
| const u32 * | TolbiSpring_GetExits (void) |
| const struct ScenePlacement * | TolbiSpring_GetPlacements (void) |
| Selects the actors for the spring or its nearby games. | |
| static void | TolbiSpring_AskAboutLuckyMedal (s32 actorId) |
| Asks whether the party has a Lucky Medal. | |
| static void | TolbiSpring_AskAboutFirstDiceGame (s32 actorId) |
| Asks whether this is the party's first Lucky Dice game. | |
| static void | TolbiSpring_TossCoinOrMedal (void) |
| Reveals the spring once, then positions the leader to toss into it. | |
| static void | TolbiSpring_ReadLuckyWheelsRules (void) |
| Reads the Lucky Wheels rules sign. | |
| static void | TolbiSpring_ReadLuckyWheelsPrizes (void) |
| Reads the Lucky Wheels prize sign. | |
| static void | TolbiSpring_TalkToWheelsAttendant (void) |
| const struct SceneEvent * | TolbiSpring_GetEvents (void) |
| Selects interactions for the spring or the game attendants. | |
| s32 | TolbiSpring_Initialize (void) |
| Prepares the spring or settles rewards from the nearby games. | |
| static void | TolbiSpring_ShowPrizeFrame (s32 sourceColumn, s32 sourceRow) |
| Displays one frame of the spring's opening or closing prize animation. | |
| static void | TolbiSpring_RevealPrize (s32 item) |
| Animates the spring's prize reveal, gives the item, and closes it. | |
| static void | TolbiSpring_OfferLuckyDice (void) |
| Offers Lucky Dice and saves the coin total for the return visit. | |
| static void | TolbiSpring_SetActorAppearance (s32 actorId, const s32 *coordinate, s32 facing, s32 colorVariant, s32 childValue) |
| Copies three coordinates and sets the actor's facing, child value and colors. | |
| static void | TolbiSpring_SetSpriteStorageKind (s32 actorId, s32 storageKind) |
| Sets whether the specified actor draws its sprite. | |
| static void | TolbiSpring_UpdateTossSimulation (void) |
| Advances the toss, obstacles, collisions and displayed trail each frame. | |
Variables | |
| static struct SpringTossMotion | sToss |
| static s32 | sTossKind |
| static s32 sTossUnknown[3] | UNUSED |
| Unreferenced toss storage; removing it shifts the obstacle state. | |
| static struct SpringObstacle | sObstacles [4] |
| static s32 | sTossFrame |
| static s32 | sTossEnded |
| static s32 | sTossResult |
| const struct SceneEntrance | gTolbiSpring_Entrances [] |
| const u32 | gTolbiSpring_Exits [] |
| const struct ScenePlacement | gTolbiSpringPlacements2 [] |
| const struct ScenePlacement | gTolbiSpringPlacementsOther [] |
| const struct SceneEvent | gTolbiSpringEventsOther [] |
| const struct SceneEvent | gTolbiSpringEvents2 [] |
| const u16 | gTolbiSpring_AlphaSteps [] |
| BLDALPHA steps. | |
| const u32 | gTolbiSpring_PrizeItems [] |
| const u16 | gTolbiSpring_CoinPrizes [] |
| const u32 | gTolbiSpring_LuckyWheelsPrizeItems [] |
| const u8 | gTolbiSpring_SliderFrames [] |
| const u8 | gTolbiSpring_CircleFrames [] |
| const u8 | gTolbiSpring_ActorPixelX [] |
| const u8 | gTolbiSpring_ActorPixelZ [] |
| const u16 | gTolbiSpring_ActorHeadings [] |
Tolbi's spring and the game rooms beside it: Lucky Medals or coins tossed into the spring win prizes, and the attendants run Lucky Dice and Lucky Wheels.
Definition in file tolbi_spring.c.
| #define SPRING_CENTER_X PIXELS(120) |
Definition at line 76 of file tolbi_spring.c.
Referenced by TolbiSpring_UpdateTossSimulation().
| #define SPRING_CENTER_Z PIXELS(71) |
Definition at line 77 of file tolbi_spring.c.
Referenced by TolbiSpring_UpdateTossSimulation().
| #define ASK_WIDTH 17 |
Definition at line 467 of file tolbi_spring.c.
Referenced by TolbiSpring_RunSpringGame().
| #define NUMBER_X 72 |
Definition at line 476 of file tolbi_spring.c.
Referenced by TolbiSpring_RunSpringGame().
| #define TOSS_X 20 |
Definition at line 477 of file tolbi_spring.c.
Referenced by TolbiSpring_RunSpringGame().
| #define TOSS_WIDTH 9 |
Definition at line 478 of file tolbi_spring.c.
Referenced by TolbiSpring_RunSpringGame().
| enum SpringTossKind |
| Enumerator | |
|---|---|
| SPRING_TOSS_COIN | |
| SPRING_TOSS_MEDAL | |
Definition at line 55 of file tolbi_spring.c.
The game room's actors, numbered in the order of its placement table from 8.
Definition at line 58 of file tolbi_spring.c.
| enum TolbiSpringActor |
The spring's own actors, numbered the same way.
| Enumerator | |
|---|---|
| TOLBI_SPRING_MEDAL_SEEKER | Asks for a medal. "Do you have a Lucky Medal?". |
| TOLBI_SPRING_SPRING | searched to toss a coin or medal |
Definition at line 68 of file tolbi_spring.c.
|
static |
Raises the spring's displayed layer and blends it into view.
Definition at line 358 of file tolbi_spring.c.
Referenced by TolbiSpring_RiseAndFadeIn(), and TolbiSpring_TossCoinOrMedal().
|
static |
Checks tickets and inventory space before sending the party to Lucky Wheels.
Definition at line 379 of file tolbi_spring.c.
Referenced by TolbiSpring_Initialize(), TolbiSpring_OfferLuckyWheels(), and TolbiSpring_TalkToWheelsAttendant().
|
static |
Chooses a coin or medal, runs its toss, and awards the resulting prize.
Definition at line 486 of file tolbi_spring.c.
Referenced by TolbiSpring_RunSpringGame(), and TolbiSpring_TossCoinOrMedal().
Chooses an item variant in the prize category, avoiding its last variant.
Definition at line 754 of file tolbi_spring.c.
Referenced by TolbiSpring_Initialize(), and TolbiSpring_SelectLuckyWheelsPrize().
|
static |
Resets four obstacles and schedules the spring simulation.
Definition at line 1252 of file tolbi_spring.c.
Referenced by TolbiSpring_Initialize(), and TolbiSpring_InitializeTossSimulation().
Launches the chosen coin or medal and waits for its final prize ring.
Definition at line 1302 of file tolbi_spring.c.
Referenced by TolbiSpring_RunSpringGame(), and TolbiSpring_RunToss().
|
static |
Definition at line 101 of file tolbi_spring.c.
Referenced by Io_SetBlendControl(), and TolbiSpring_Initialize().
|
static |
Definition at line 103 of file tolbi_spring.c.
Referenced by Io_SetBlendAlpha(), and TolbiSpring_Initialize().
| const struct SceneEntrance * TolbiSpring_GetEntrances | ( | void | ) |
Definition at line 105 of file tolbi_spring.c.
Referenced by TolbiSpring_GetEntrances().
| const struct SceneRegion * TolbiSpring_GetRegions | ( | void | ) |
Definition at line 109 of file tolbi_spring.c.
Referenced by TolbiSpring_GetRegions().
| const u32 * TolbiSpring_GetExits | ( | void | ) |
Definition at line 111 of file tolbi_spring.c.
Referenced by TolbiSpring_GetExits().
| const struct ScenePlacement * TolbiSpring_GetPlacements | ( | void | ) |
Selects the actors for the spring or its nearby games.
Definition at line 114 of file tolbi_spring.c.
Referenced by TolbiSpring_GetPlacements().
|
static |
Asks whether the party has a Lucky Medal.
Definition at line 122 of file tolbi_spring.c.
Referenced by TolbiSpring_AskAboutLuckyMedal().
|
static |
Asks whether this is the party's first Lucky Dice game.
Definition at line 136 of file tolbi_spring.c.
Referenced by TolbiSpring_AskAboutFirstDiceGame().
|
static |
Reveals the spring once, then positions the leader to toss into it.
Definition at line 150 of file tolbi_spring.c.
Referenced by TolbiSpring_TossCoinOrMedal().
|
static |
Reads the Lucky Wheels rules sign.
Definition at line 165 of file tolbi_spring.c.
Referenced by TolbiSpring_ReadLuckyWheelsRules().
|
static |
Reads the Lucky Wheels prize sign.
Definition at line 173 of file tolbi_spring.c.
Referenced by TolbiSpring_ReadLuckyWheelsPrizes().
|
static |
Definition at line 180 of file tolbi_spring.c.
Referenced by TolbiSpring_TalkToWheelsAttendant().
| const struct SceneEvent * TolbiSpring_GetEvents | ( | void | ) |
Selects interactions for the spring or the game attendants.
Definition at line 185 of file tolbi_spring.c.
Referenced by TolbiSpring_GetEvents().
| s32 TolbiSpring_Initialize | ( | void | ) |
Prepares the spring or settles rewards from the nearby games.
Definition at line 193 of file tolbi_spring.c.
Referenced by TolbiSpring_Initialize().
Displays one frame of the spring's opening or closing prize animation.
Definition at line 300 of file tolbi_spring.c.
Referenced by TolbiSpring_RevealPrize(), and TolbiSpring_ShowPrizeFrame().
|
static |
Animates the spring's prize reveal, gives the item, and closes it.
Definition at line 307 of file tolbi_spring.c.
Referenced by TolbiSpring_RevealPrize(), and TolbiSpring_RunSpringGame().
|
static |
Offers Lucky Dice and saves the coin total for the return visit.
Definition at line 434 of file tolbi_spring.c.
Referenced by TolbiSpring_OfferLuckyDice().
|
static |
Copies three coordinates and sets the actor's facing, child value and colors.
Definition at line 779 of file tolbi_spring.c.
Referenced by TolbiSpring_SetActorAppearance(), and TolbiSpring_UpdateTossSimulation().
Sets whether the specified actor draws its sprite.
Definition at line 825 of file tolbi_spring.c.
Referenced by TolbiSpring_RunToss(), TolbiSpring_SetSpriteStorageKind(), and TolbiSpring_UpdateTossSimulation().
|
static |
Advances the toss, obstacles, collisions and displayed trail each frame.
Definition at line 849 of file tolbi_spring.c.
Referenced by TolbiSpring_InitializeTossSimulation(), and TolbiSpring_UpdateTossSimulation().
|
static |
Definition at line 835 of file tolbi_spring.c.
Referenced by TolbiSpring_InitializeTossSimulation(), TolbiSpring_RunToss(), and TolbiSpring_UpdateTossSimulation().
|
static |
Definition at line 837 of file tolbi_spring.c.
Referenced by TolbiSpring_RunToss(), and TolbiSpring_UpdateTossSimulation().
|
static |
Unreferenced toss storage; removing it shifts the obstacle state.
Definition at line 840 of file tolbi_spring.c.
|
static |
Definition at line 842 of file tolbi_spring.c.
Referenced by TolbiSpring_InitializeTossSimulation(), and TolbiSpring_UpdateTossSimulation().
|
static |
Definition at line 844 of file tolbi_spring.c.
Referenced by TolbiSpring_RunToss().
|
static |
Definition at line 845 of file tolbi_spring.c.
Referenced by TolbiSpring_RunToss(), and TolbiSpring_UpdateTossSimulation().
|
static |
Definition at line 846 of file tolbi_spring.c.
Referenced by TolbiSpring_RunToss(), and TolbiSpring_UpdateTossSimulation().
| const struct SceneEntrance gTolbiSpring_Entrances[] |
Definition at line 1350 of file tolbi_spring.c.
Referenced by TolbiSpring_GetEntrances().
| const u32 gTolbiSpring_Exits[] |
Definition at line 1361 of file tolbi_spring.c.
Referenced by TolbiSpring_GetExits().
| const struct ScenePlacement gTolbiSpringPlacements2[] |
Definition at line 1371 of file tolbi_spring.c.
Referenced by TolbiSpring_GetPlacements().
| const struct ScenePlacement gTolbiSpringPlacementsOther[] |
Definition at line 1417 of file tolbi_spring.c.
Referenced by TolbiSpring_GetPlacements().
| const struct SceneEvent gTolbiSpringEventsOther[] |
Definition at line 1443 of file tolbi_spring.c.
Referenced by TolbiSpring_GetEvents().
| const struct SceneEvent gTolbiSpringEvents2[] |
Definition at line 1469 of file tolbi_spring.c.
Referenced by TolbiSpring_GetEvents().
| const u16 gTolbiSpring_AlphaSteps[] |
BLDALPHA steps.
Definition at line 1485 of file tolbi_spring.c.
Referenced by TolbiSpring_RiseAndFadeIn().
| const u32 gTolbiSpring_PrizeItems[] |
Definition at line 1489 of file tolbi_spring.c.
Referenced by TolbiSpring_RunSpringGame().
| const u16 gTolbiSpring_CoinPrizes[] |
Definition at line 1494 of file tolbi_spring.c.
Referenced by TolbiSpring_RunSpringGame().
| const u32 gTolbiSpring_LuckyWheelsPrizeItems[] |
Definition at line 1498 of file tolbi_spring.c.
Referenced by TolbiSpring_SelectLuckyWheelsPrize().
| const u8 gTolbiSpring_SliderFrames[] |
Definition at line 1503 of file tolbi_spring.c.
Referenced by TolbiSpring_UpdateTossSimulation().
| const u8 gTolbiSpring_CircleFrames[] |
Definition at line 1507 of file tolbi_spring.c.
Referenced by TolbiSpring_UpdateTossSimulation().
| const u8 gTolbiSpring_ActorPixelX[] |
Definition at line 1511 of file tolbi_spring.c.
Referenced by TolbiSpring_InitializeTossSimulation().
| const u8 gTolbiSpring_ActorPixelZ[] |
Definition at line 1515 of file tolbi_spring.c.
Referenced by TolbiSpring_InitializeTossSimulation().
| const u16 gTolbiSpring_ActorHeadings[] |
Definition at line 1519 of file tolbi_spring.c.
Referenced by TolbiSpring_InitializeTossSimulation().