30#include "text/msg_ids.h"
88 }
else if (column == 16) {
448 u8 *f = (
u8 *)((
s32)effectWork + 0x71c);
483 for (i = 0; i <= 17; i++) {
486 *(
s16 *)&actor->sprite->rotation += -256;
502 for (i = 0; i <= 16; i++) {
521 actor->sprite->rotation = 0x1000;
551 if (++tries > 1000) {
616 {0,
CONDITION_ALWAYS, 192, 0, 197,
FACING_SOUTH, 0, -1, -1, -1, -1, 0},
617 {1,
CONDITION_ALWAYS, 96, 0, 440,
FACING_NORTH, 0, -1, -1, -1, -1, 0},
618 {2,
CONDITION_ALWAYS, 200, 0, 184,
FACING_SOUTH, 0, -1, -1, -1, -1, 0},
Ability numbers, named from the English release.
struct FieldActor * Object_GetById(s32 actor)
Returns an actor, or NULL if it does not exist.
const struct ScenePlacement * Scene_GetPlacements(void)
const struct SceneEntrance * Scene_GetEntrances(void)
const struct SceneEvent * Scene_GetEvents(void)
const u32 * Scene_GetExits(void)
Both scenes share one exit table.
const struct SceneRegion * Scene_GetRegions(void)
s32 Scene_Initialize(void)
Sets up whichever scene is being entered and runs its arrival events.
const s32 * gEffectScripts[]
#define ITEM_USE_CONSUMED
one is used up
BattleUnit_Recalculate, which recalculates a unit's stats.
BattleUnit, a party member's or enemy's battle state, with the elements, abilities and actions it use...
Calls through a function pointer, by argument count.
The engine calls the debug menus import, and their palette swatch tiles.
The edition's language, for C to compare (LANGUAGE == LANGUAGE_GERMAN).
Scene commands: the all-caps macros the scene scripts are written in.
#define OBJ_DIR(no, d, t)
#define OBJ_POS_SET(no, x, z)
#define OBJ_WALK(no, x, z)
#define MESSAGE_PUT(no, f)
#define OBJ_EMOTE(no, e, t)
#define OBJ_SPEED(no, s, a)
The scene script layer: the engine services a scene's events call, declared once (Engine_EventBegin,...
static void Actor_SetDestination(s32 actor, s32 x, s32 z)
void Engine_ActorSetAnimationAndWait(s32 actor, s32 animation)
static void Event_ShowMessageAndWait(s32 speaker, s32 flags, s32 frames)
static void Actor_WalkToAndWait(s32 actor, s32 x, s32 z)
void Engine_ActorJump(s32 actor, s32 height, s32 frames)
s32 Engine_MathSin(s32 angle)
static void Actor_SetDestinationOffset(s32 actor, s32 dx, s32 dz)
void Engine_ActorSetDestination(s32 actor, s32 x, s32 z)
static void Actor_FaceActor(s32 actor, s32 target, s32 frames)
void Engine_MapWaitWorkValuesBelow256(void)
void Engine_GameFlagSet(s32 flag)
void Engine_ActorWaitForMove(s32 actor)
static void Map_CopyCellAttributes(s32 srcX, s32 srcY, s32 width, s32 height, s32 destX, s32 destY)
void Engine_ActorRunRepeatedMotion(s32 actor, s32 repeats)
static void Map_SetShake(s32 horizontal, s32 vertical, s32 decay)
Sets shake amplitudes in fixed-point pixels and the per-frame decay factor.
s32 Engine_GameFlagIsSet(s32 flag)
void Engine_ActorStartRepeatedMotion(s32 actor, s32 repeats)
s32 Engine_MathCos(s32 angle)
static void Actor_SetPosition(s32 actor, s32 fixed_x, s32 fixed_z)
void Engine_ActorFaceEachOther(s32 actor, s32 other, s32 frames)
static void Actor_SetAttachedEffect(s32 actor, s32 effect)
Field objects and actors, and the scene transition styles.
@ ACTOR_PRIORITY_UNDERFOOT
The depth sort treats it as 320 pixels higher on the screen.
#define ACTOR_NO_TARGET
A target coordinate that is not set: the object has no target.
The scene table formats: entrances, exits, placements and events, and the macros that write them.
#define SCENE_EXITS(scene)
#define SCENE_EXIT(exit, scene, entrance)
#define PSYNERGY_ON_ACTOR(ability)
#define EVENT_SCRIPT(script)
#define TOUCH_WALKING_INTO(facing)
#define PLACEMENT_SHARE_PREVIOUS_SPRITE
Game flags, named where their meaning is shown.
#define FLAG_GOMA_CAVE_ENTRANCE_EAST_PILLAR_IN_PLACE
#define FLAG_GOMA_CAVE_ENTRANCE_WEST_PILLAR_TWO_STEPS
#define FLAG_VAULT_THIEVES_JAILED
#define FLAG_GOMA_CAVE_ENTRANCE_IVY_BLOWN_AWAY
#define FLAG_RETREAT_BLOCKED
Retreat is blocked, from Psynergy or an item.
#define FLAG_GOMA_CAVE_IVAN_REJOINED
Ivan has blown the ivy off the stump and rejoined the party.
#define FLAG_GOMA_CAVE_ENTRANCE_STUMP_MOVED
#define FLAG_GOMA_CAVE_ENTRANCE_WEST_PILLAR_ONE_STEP
The work slots of gWorkSlot, read through their own names.
void * gEffectWork
Slot 56: points to a scene-specific structure.
static UNUSED void GomaCaveEntrance_NoOpB(void)
A second reserved hook, also unused by the scene.
static void Event_MoveStump(void)
Move on the freed stump: from column 11 it spins, leaps away and lies where it lands.
static void GomaCaveEntrance_SayThenWait(s32 actorId, s32 frames)
Shows the next message over the speaker, then pauses.
static void Event_BlowAwayIvy(void)
Whirlwind on the other ivy: it is blown away for good.
static void GomaCaveEntrance_SpinStump(union FieldObject *fieldObject)
The leaping stump's update hook turns its sprite a fixed amount per frame.
static void GomaCaveEntrance_WhirlwindOnStumpIvy(void)
Ivan casts Whirlwind on the stump's ivy, and the scene waits for it.
static void Event_PushWestPillar(void)
Walking into the west pillar from the west (trigger 5) or the east (trigger 6): the leader leans on i...
#define STUMP_IVY
the ivy holding the stump
s32 gGomaCaveEntranceTallIvyScript[]
struct SceneEvent gGomaCaveEntranceEvents[]
static void Event_MoveWestPillar(void)
Move on the west pillar, and after each push: the pillar stands on one of three columns,...
static UNUSED void GomaCaveEntrance_NoOpA(void)
Reserved overlay hook; no current scene calls it.
static void GomaCaveEntrance_GiveShamansRod(void)
Gives Ivan the Shaman's Rod and equips it.
struct SceneEntrance gGomaCaveEntranceEntrances[]
static void Event_MoveEastPillar(void)
Move on the east pillar: once it reaches column 23 it settles into the floor and can be walked over.
static void GomaCaveEntrance_LeapStump(s32 id)
The stump spins in place, leaps and lands with a shake and a ring of dust, then comes to rest a littl...
static void Event_IvanRejoins(void)
Move on the stump while the ivy holds it: Garet says their Psynergy is not strong enough.
u32 gGomaCaveEntranceExits[]
struct ScenePlacement gGomaCaveEntrancePlacements[]
The screen blend's globals and the graphics routines.
s32 Inventory_AddItem(s32 owner, s32 itemId)
Gives a unit one item, joining its first matching stack (up to 30) or taking the first free slot.
s32 Inventory_Equip(s32 owner, s32 slot)
Equips the item in slot, clearing the equipped bit of the item of the same type it replaces.
s32 Inventory_Discard(s32 owner, s32 slot)
Removes one item as Inventory_Remove does, and puts a rare item back into circulation (its counter go...
gOverflowItem, an item slot the spoils code uses when items are handed out.
Items: their definitions, types, flags and effects.
@ ITEM_TYPE_NONE
not equipment: Herb, Game Ticket, the keys, unused rows
@ ITEM_TYPE_WEAPON
swords, axes, maces, rods and staffs
struct ItemDefinition * Item_Get(s32 item)
Colosso Log, River and Wall, and Goma Cave's entrance: giving a character an item and putting it on.
Item numbers, named from the English release.
Small statement macros both games use for positions, velocities and bounds.
#define SET_POSITION(p, px, py, pz)
Sets the position or the velocity of a particle, a piece of debris or an object in one statement.
The reel game's title lettering.
Field object scripts: one s32 command word, then its operands, as gScriptObject_CommandTable runs the...
#define SC_SET(w, v)
Write a work value.
#define SC_LOOP(n, to)
Repeat up to n times.
#define SC_POS(x, y, z)
Set position.
#define SC_WAIT(n)
Wait n frames.
#define SC_TOP
Script start.
#define SC_END
Return to the main script.
void Field_DispatchTypeHandler(s32 kind)
Runs one step of the current Psynergy effect: 0 casts it with no target, 1 casts it on its target (se...
void Event_PrepareObjectAndApplyValue(s32 unit, s32 announce)
Adds unit to the party.
void BattleFx_SetupObjectPair(s32 userId, s32 targetId)
Records the caster and the target of an effect.
void EffectRuntime_StopCurrentObject(void)
Stops the caster's per-frame hook and restores its colours.
void EventObject_Initialize(void)
Starts casting: the caster takes its casting pose (animation 20) and stops.
void BattleFx_LoadActionEffectResources(s32 abilityId, s32 mode)
Prepares the work of the Psynergy effect for ability (heap slot 56) and loads its spark tiles.
static void SceneActor_WaitObjectBelowHeight(struct FieldActor *object, s32 height)
Waits until the object has come down to height (16.16), a second at most.
void BattleFx_PlayQueuedSound(void)
Plays the sound BattleFx_SetQueuedSoundAndPlay remembered, if any.
void BattleFx_SetQueuedSoundAndPlay(s32 soundId)
Plays SE_298, then soundId (SE_289 for -1), and remembers soundId for BattleFx_PlayQueuedSound in the...
Song and sound effect ids, indices into gSound_SongTable.
struct EventWork * gEventWork
void Engine_ActorSetPosition(u32 actor, s32 x, s32 z)
void Engine_AudioPlayCue()
An animated sprite: its image and shadow, scale, rotation, size and up to four animation layers.
u16 rotation
1/65536 turns
A unit in battle: a party member's or an enemy's stats, Psynergy, items, Djinn and ailments.
u16 inventory[15]
Items held, one entry each: bits 15..11 quantity | 10 broken | 9 equipped | 8..0 item id (INVENTORY_*...
The options of a spawned field effect, each used when its EFFECT_USE_ flag (or EFFECT_SCALE_TO_TARGET...
s16 type
the object type to create; 222 without the flag
s32 targetScaleY
16.16 fixed point, 0x10000 full size
s32 targetScaleX
16.16 fixed point, 0x10000 full size
s32 startScaleY
16.16 fixed point, 0x10000 full size
s32 startScaleX
16.16 fixed point, 0x10000 full size
The running scene's event work: its placement and event tables, its actors, the triggers and exit it ...
s16 touchedTrigger
the step event a touch or exit event answers
A field actor: a person or thing on the field with a position, motion toward a target,...
s32 targetX
16.16 fixed-point pixels; ACTOR_NO_TARGET when unset
u8 motionFlags
ActorMotionFlag bits; zero is free flight in 3D, and 3 is set on creation.
union FieldCoordinate x
16.16 fixed-point pixels
union FieldCoordinate y
16.16 fixed-point pixels
u8 priorityFlags
ActorPriorityFlag bits, read by the scrolling camera.
s32 velocityY
16.16 fixed-point pixels per frame
s32 gravity
Taken off the vertical velocity each frame while it is above the ground, in 16.16 fixed-point pixels ...
union FieldCoordinate z
16.16 fixed-point pixels
void(*) update(union FieldObject *object)
Called each frame before the object's script, while the object is live.
u8 collisionFlags
bits: 7 refuses to move into a solid object | 4 nearer for Psynergy targets | 3 never a talk or Psyne...
u8 terrainId
The map layer (0 to 3) its ground height is read from, which the scrolling camera updates from the ce...
An item's definition: its price, type, who can equip it, its bonuses and unleash, its effects and the...
u8 useType
what using it costs (ITEM_USE_), or 0 for nothing
u8 type
enum ItemType; 0 for an item that is not equipment
A scene entrance: where and facing which way the party arrives, and the camera's bounds there (-1 for...
A scene event: its kind and detail, the trigger it answers, its condition and its value (a message or...
An actor a scene places: its sprite, the condition for placing it, how it behaves,...
A scene's exit region: the box that, while its condition holds, takes the party leader out through it...
Three coordinates, x, y and z: a position, a velocity or a direction.
The system's routines and globals: interrupts, BIOS sound bias, random numbers and sleep.
The integer types, TRUE, UNUSED and the fixed-address macros.
struct FieldCoordinate::@024321007066302143002254325121164243234242211074 part
s32 fixed
16.16 fixed-point pixels
An object on the field, read as an actor or as an effect.
struct BattleUnit * UnitGet(u32 owner)
Returns the unit record of owner: 0 to 7 are the playable characters in the game state,...
Vector3, a three-coordinate vector.
The patch levels: our groups of the measured changes from the Japanese release.