src/debug/psynergy_test_2.c
The second debug room of Psynergy tests, on the east side of the Psynergy test's map, where a fire, a stake sunk flat and two posts stand: Douse and Pound take the fire away, Grind stands the stake up and Tremor on it does nothing, talking to it scatters rocks, and a rope is coiled between the posts. More…
#include "field/field.h"#include "game/game.h"#include "field/script_inline.h"#include "field/field_engine_script.h"#include "field/call.h"#include "window/message_speed.h"#include "scene/falling_rocks.h"#include "../scene/shared/psynergy_test_exits.c"
Structures
| Name | Description | |
|---|---|---|
struct | ROCK_PARTICLE_STATE | The rocks a talk scatters, in the menu's heap slot: the scenes' struct ROCK_STATE with each rock read as a particle. |
Macros
| Name | Description | |
|---|---|---|
#define | FLAG_BATTLE_FOUGHT FLAG_SCENE_TEMP(0x20) | Set once the step onto METATILE_BEHAVIOR_BATTLE_STEP has started its battle. |
#define | ROCK_TICKS 20 | how long a rock flies |
Enumerations
| Name | Description | |
|---|---|---|
enum | PSYNERGY_TEST2_METATILE_BEHAVIOR { METATILE_BEHAVIOR_BATTLE_STEP, METATILE_BEHAVIOR_HOLE_SPOT } | The metatile behaviors the room's cues answer. |
enum | PSYNERGY_TEST2_ACTOR_ID { ACTOR_FIRE, ACTOR_STAKE, ACTOR_FIRST_POST, ACTOR_SECOND_POST } | The room's actors, numbered in the order of ActorPlacements. |
Functions
| Name | Description | |
|---|---|---|
void | dbPsynergyTest2SpawnRocks (Sint32 x, Sint32 y, Sint32 z, Sint32 count) | Throws count rocks out of (x, y, z): each starts 8 pixels or more away at a random angle and flies up and outward. |
void | dbPsynergyTest2StartRocks (void) | Loads the rocks' tiles, hides every rock and starts dbPsynergyTest2UpdateRocks. |
void | dbPsynergyTest2EndRocks (void) | Stops the rocks and frees their tiles and state. |
const SCENE_ENTRANCE * | scGetEntrances (void) | Where the party can enter: the cave under the spring has its own entrances. |
const SCENE_REGION * | scGetExitRegions (void) | The regions of the rooms whose exits are rectangles: the Chestbeaters' room and the stream room. |
const Uint32 * | scGetExits (void) | The dock's ways lead back the way the party came into Lemuria, which the harbour and the shore of Ancient Lemuria note in FLAG_LEMURIA_OTHER_WAY_IN. |
const ACTOR_PLACE * | scGetActorPlacements (void) | The scene's actor placements: a room of names for its entrance, else the debug room's. |
void | dbPsynergyTest2DouseFire (void) | Douse on ACTOR_FIRE takes it off the map. |
void | dbPsynergyTest2PoundFire (Sint32 stage) | So does Pound, as its fist lands. |
void | dbPsynergyTest2IgnoreTremor (void) | The script for Tremor on ACTOR_STAKE, which does nothing. |
void | dbPsynergyTest2GrindStake (void) | Grind on ACTOR_STAKE stands the stone stake up again. |
void | dbPsynergyTest2BurstMetatiles (Sint32 stage) | Burst at METATILE_BEHAVIOR_HOLE_SPOT, as its great blast dies down, copies the 1 by 2 block of metatiles at (49, 1) over (34, 1), and its metatile behaviors over (34, 3). |
void | dbPsynergyTest2StepIntoBattle (void) | Stepping onto METATILE_BEHAVIOR_BATTLE_STEP starts a battle, the first time only; no metatile holds it, so it never runs. |
void | dbPsynergyTest2ScatterRocks (Sint32 id) | Talking to ACTOR_STAKE: twenty rocks burst out around it and fall for 20 ticks. |
const CUE * | scGetCues (void) | The scene's cues: the rooms of names' for any entrance above ENTRANCE_NAMES_ABOVE, else the debug room's. |
Sint32 | scInit (void) | Fades the room in over the backdrop, sets the fast message speed, coils the rope and shows the stake sunk flat. |
Sint32 | scPrepareMap (void) | Once Briggs is caught the pool has dried up: its colours take the dry ground's. |
void | dbPsynergyTest2UpdateRocks (void) | Each tick of the rocks: each rock younger than ROCK_TICKS is drawn, its picture one of eight as it ages, and falls. |
void | dbPsynergyTest2DigMetatiles (Sint32 stage, Sint32 srcX, Sint32 srcY, Sint32 width, Sint32 height, Sint32 destX, Sint32 destY) | Unused: the Psynergy test's dbPsynergyTestDigMetatiles again. |
void | dbPsynergyTest2GrowActor (Sint32 stage, Sint32 id, Sint32 x, Sint32 z) | Unused: the Psynergy test's dbPsynergyTestGrowActor again. |
void | dbPsynergyTest2DropActor (Sint32 stage, Sint32 id, Sint32 x, Sint32 z) | Unused: the Psynergy test's dbPsynergyTestDropActor again. |
void | dbPsynergyTest2RaiseStatue ( Sint32 stage, Sint32 x, Sint32 z, Sint32 row, Sint32 column) | Unused: the Psynergy test's dbPsynergyTestRaiseStatue again. |
Variables
| Name | Description | |
|---|---|---|
SCENE_ENTRANCE | SceneEntrances [] | Besides the party's return to the pier after the ship is stolen, four unused spots about the mast: below the huge block, on the dock by its crate, on the deck, and at the top of the sail's east pole. |
ACTOR_PLACE | ActorPlacements [] | The room's people: the party's four rows, then PSYNERGY_TEST_ACTOR_ID's. |
CUE | SceneCues [] | The room's scripts: talking to its people, Mind Read on them, the metatiles examined, and the field Psynergy each spot answers. |
Description
The second debug room of Psynergy tests, on the east side of the Psynergy test's map, where a fire, a stake sunk flat and two posts stand: Douse and Pound take the fire away, Grind stands the stake up and Tremor on it does nothing, talking to it scatters rocks, and a rope is coiled between the posts. Its Burst row answers the Psynergy test's first Scoop spot, west of this room's view, and its battle row a metatile behavior no metatile holds.
Macros in detail
FLAG_BATTLE_FOUGHT
#define FLAG_BATTLE_FOUGHT FLAG_SCENE_TEMP(0x20)
Set once the step onto METATILE_BEHAVIOR_BATTLE_STEP has started its battle.
Referenced by dbPsynergyTest2StepIntoBattle().
Definition at line 18 of file psynergy_test_2.c.
ROCK_TICKS
#define ROCK_TICKS 20
how long a rock flies
Referenced by dbPsynergyTest2UpdateRocks().
Definition at line 41 of file psynergy_test_2.c.
Enumerations in detail
PSYNERGY_TEST2_METATILE_BEHAVIOR
enum PSYNERGY_TEST2_METATILE_BEHAVIOR
The metatile behaviors the room's cues answer.
| Enumerator | Value | Description |
|---|---|---|
METATILE_BEHAVIOR_BATTLE_STEP | 30 | A step here starts a battle; no metatile of the map holds it. |
METATILE_BEHAVIOR_HOLE_SPOT | 50 | The Psynergy test's first Scoop spot, metatile (10, 10), west of this room. |
Definition at line 21 of file psynergy_test_2.c.
PSYNERGY_TEST2_ACTOR_ID
enum PSYNERGY_TEST2_ACTOR_ID
The room's actors, numbered in the order of ActorPlacements.
| Enumerator | Value | Description |
|---|---|---|
ACTOR_FIRE | ACTOR_FIRST_PLACED | Douse and Pound take it off the map |
ACTOR_STAKE | Grind and Tremor are tried on it; talked to, rocks fly | |
ACTOR_FIRST_POST | the rope's first end; Lash at it does nothing | |
ACTOR_SECOND_POST | the rope's other end |
Definition at line 31 of file psynergy_test_2.c.
Functions in detail
dbPsynergyTest2SpawnRocks
void dbPsynergyTest2SpawnRocks(Sint32 x, Sint32 y, Sint32 z, Sint32 count)
Throws count rocks out of (x, y, z): each starts 8 pixels or more away at a
random angle and flies up and outward.
References scFieldVectorAddPolarOffsetFX(), Sint32 and syRandom().
Referenced by dbPsynergyTest2ScatterRocks().
Definition at lines 55 and 270 of file psynergy_test_2.c.
dbPsynergyTest2StartRocks
void dbPsynergyTest2StartRocks(void)
Loads the rocks' tiles, hides every rock and starts
dbPsynergyTest2UpdateRocks.
References dbPsynergyTest2UpdateRocks(), fdEffectSpriteInit(), mnVRAMLoad(), scFieldSetTickEvent(), Sint32, syDecompressTaggedLZ(), syHeapSlotAllocate(), syResourceGetTableEntry() and syVRAMCacheFindFreeEntry().
Referenced by dbPsynergyTest2ScatterRocks().
Definition at lines 57 and 304 of file psynergy_test_2.c.
dbPsynergyTest2EndRocks
void dbPsynergyTest2EndRocks(void)
Stops the rocks and frees their tiles and state.
References dbPsynergyTest2UpdateRocks(), scFieldCloseEvent(), syHeapSlotRelease() and syVRAMCacheFreeEntry().
Referenced by dbPsynergyTest2ScatterRocks().
Definition at lines 58 and 336 of file psynergy_test_2.c.
scGetEntrances
const SCENE_ENTRANCE *scGetEntrances(void)
References SceneEntrances.
Definition at line 60 of file psynergy_test_2.c.
scGetExitRegions
const SCENE_REGION *scGetExitRegions(void)
Definition at line 65 of file psynergy_test_2.c.
scGetExits
const Uint32 *scGetExits(void)
References SceneExits.
Definition at line 70 of file psynergy_test_2.c.
scGetActorPlacements
const ACTOR_PLACE *scGetActorPlacements(void)
References ActorPlacements.
Definition at line 75 of file psynergy_test_2.c.
dbPsynergyTest2DouseFire
void dbPsynergyTest2DouseFire(void)
Douse on ACTOR_FIRE takes it off the map.
Referenced by SceneCues.
Definition at line 81 of file psynergy_test_2.c.
dbPsynergyTest2PoundFire
void dbPsynergyTest2PoundFire(Sint32 stage)
So does Pound, as its fist lands.
References Sint32.
Referenced by SceneCues.
Definition at line 87 of file psynergy_test_2.c.
dbPsynergyTest2IgnoreTremor
void dbPsynergyTest2IgnoreTremor(void)
The script for Tremor on ACTOR_STAKE, which does nothing.
Referenced by SceneCues.
Definition at line 94 of file psynergy_test_2.c.
dbPsynergyTest2GrindStake
void dbPsynergyTest2GrindStake(void)
Grind on ACTOR_STAKE stands the stone stake up again.
References fdActorSetAnimationById().
Referenced by SceneCues.
Definition at line 99 of file psynergy_test_2.c.
dbPsynergyTest2BurstMetatiles
void dbPsynergyTest2BurstMetatiles(Sint32 stage)
Burst at METATILE_BEHAVIOR_HOLE_SPOT, as its great blast dies down, copies
the 1 by 2 block of metatiles at (49, 1) over (34, 1), and its metatile
behaviors over (34, 3).
References fdMapGridCopyMetatileAttributes(), fdMapGridCopyMetatilesLayered() and Sint32.
Referenced by SceneCues.
Definition at line 107 of file psynergy_test_2.c.
dbPsynergyTest2StepIntoBattle
void dbPsynergyTest2StepIntoBattle(void)
Stepping onto METATILE_BEHAVIOR_BATTLE_STEP starts a battle, the first time
only; no metatile holds it, so it never runs.
References fdRequestBattleFromEncounterTable(), fdScriptGetFlag() and fdScriptSetFlag().
Referenced by SceneCues.
Definition at line 118 of file psynergy_test_2.c.
dbPsynergyTest2ScatterRocks
void dbPsynergyTest2ScatterRocks(Sint32 id)
Talking to ACTOR_STAKE: twenty rocks burst out around it and fall for 20
ticks.
References dbPsynergyTest2EndRocks(), dbPsynergyTest2SpawnRocks(), dbPsynergyTest2StartRocks(), fdActorGet(), Sint32 and sySynch().
Referenced by SceneCues.
Definition at line 130 of file psynergy_test_2.c.
scGetCues
const CUE *scGetCues(void)
References SceneCues.
Definition at line 141 of file psynergy_test_2.c.
scInit
Sint32 scInit(void)
Fades the room in over the backdrop, sets the fast message speed, coils the rope and shows the stake sunk flat.
References fdActorSetAnimation(), fdRopeCoil(), fdRopeInit(), MainRoutineStateWork, Sint32 and Value3().
Definition at line 148 of file psynergy_test_2.c.
scPrepareMap
Sint32 scPrepareMap(void)
References Sint32.
Definition at line 163 of file psynergy_test_2.c.
dbPsynergyTest2UpdateRocks
void dbPsynergyTest2UpdateRocks(void)
Each tick of the rocks: each rock younger than ROCK_TICKS is drawn, its
picture one of eight as it ages, and falls.
References fdBattleEffectStepVector3(), fdEffectSpriteDrawAtWorldPos() and Sint32.
Referenced by dbPsynergyTest2EndRocks() and dbPsynergyTest2StartRocks().
Definition at line 170 of file psynergy_test_2.c.
dbPsynergyTest2DigMetatiles
void dbPsynergyTest2DigMetatiles(Sint32 stage, Sint32 srcX, Sint32 srcY, Sint32 width, Sint32 height, Sint32 destX, Sint32 destY)
Unused: the Psynergy test's dbPsynergyTestDigMetatiles again.
References fdMapGridCopyMetatiles() and Sint32.
Definition at line 346 of file psynergy_test_2.c.
dbPsynergyTest2GrowActor
void dbPsynergyTest2GrowActor(Sint32 stage, Sint32 id, Sint32 x, Sint32 z)
Unused: the Psynergy test's dbPsynergyTestGrowActor again.
References fdActorGet(), Sint32 and sySynch().
Definition at line 359 of file psynergy_test_2.c.
dbPsynergyTest2DropActor
void dbPsynergyTest2DropActor(Sint32 stage, Sint32 id, Sint32 x, Sint32 z)
Unused: the Psynergy test's dbPsynergyTestDropActor again.
References fdActorGet(), Sint32 and sySynch().
Definition at line 388 of file psynergy_test_2.c.
dbPsynergyTest2RaiseStatue
void dbPsynergyTest2RaiseStatue( Sint32 stage, Sint32 x, Sint32 z, Sint32 row, Sint32 column)
Unused: the Psynergy test's dbPsynergyTestRaiseStatue again.
References fdActorGet(), fdActorSetSpriteFlags(), fdRequestBattleFromEncounterTable(), MainRoutineStateWork, scFieldActorCreate(), Sint32 and sySynch().
Definition at line 405 of file psynergy_test_2.c.
Variables in detail
SceneEntrances
SCENE_ENTRANCE SceneEntrances[]
Referenced by scGetEntrances().
Definition at line 193 of file psynergy_test_2.c.
ActorPlacements
ACTOR_PLACE ActorPlacements[]
Referenced by scGetActorPlacements().
Definition at line 202 of file psynergy_test_2.c.
SceneCues
CUE SceneCues[]
References dbPsynergyTest2BurstMetatiles(), dbPsynergyTest2DouseFire(), dbPsynergyTest2GrindStake(), dbPsynergyTest2IgnoreTremor(), dbPsynergyTest2PoundFire(), dbPsynergyTest2ScatterRocks() and dbPsynergyTest2StepIntoBattle().
Referenced by scGetCues().
Definition at line 242 of file psynergy_test_2.c.