99 if (before || after || during) {
103 if (after && (after->
trigger & 0x400)) {
145 return (
u32)((-eventAddress) | eventAddress) >> 31;
155 return (
u32)((0 - eventAddress) | eventAddress) >> 31;
void * ObjectTable_Get(u32 actorIndex)
Returns the actor in slot index (0 to 65), or NULL.
void BattleEffect_ClearOutOfBoundsObjects(void)
Destroys the placed actors far from the view's centre: more than 160 pixels to either side,...
void BattleEffect_ClearAllObjects(void)
Destroys every placed actor and places the scene's actors again from its first placement table after ...
#define ALLY_MAX
the last party member's unit id
struct BattleUnit * UnitGetFar(u32 owner)
s16 Unit_AddPpFar(s32 owner, s32 delta)
s32 GameFlag_TestFar(s32 flag)
struct BattleAct * BattleActGet(s32 actionId)
Far call to BattleAction_GetDirect.
s32 GameFlag_SetBitFar(s32 flag)
void GameFlag_ClearBitFar(s32 flag)
void UiText_ShowPositionedMessageAndWaitFar(s32 no, s32 flags)
void UiWork_PushValueSlotFar(u32 value, u32 kind)
void UiWork_FinalizePendingCoreFar(void)
#define FLAG_RETREAT_BLOCKED
Retreat is blocked, from Psynergy or an item.
#define FLAG_ITEM_USE
the Psynergy comes from an item
#define FLAG_IN_LINK_LOBBY
Set when the cleared game's menu goes to the link lobby: there Psynergy has no effect and the system ...
struct GameState gGameState
void * BattleFx_FindMatchingEvent(s32 eventFlags, s32 group, void *target)
Returns the scene's Psynergy event (kind 5) for Psynergy of the given group that applies to what the ...
s32 Field_FindItemEvent(s32 item)
Returns the scene's item event (kind 4) for item that applies to what the leader faces,...
s32 Field_RunPsynergyEvents(s32 packed)
Runs the scene's events for Psynergy without paying its PP or showing its usual effect (phases 3 and ...
s32 Field_UsePsynergy(u32 code)
Uses Psynergy on the field.
u32 BattleFx_HasTrigger(u16 item)
Returns whether the scene has an event for item and what the leader faces.
s32 BattleFx_HasMatchingEvent5(s32 group)
Returns whether the scene has a Psynergy event, in any phase, for Psynergy of group and what the lead...
s32 Field_FindNearbyPsynergyTarget(s32 id, s32 kind)
Returns the actor nearest in front of actor id that a field Psynergy of the given kind can reach,...
void BattleFx_DispatchRequestKind(void)
Casts the current Psynergy effect on its target (secondObjectId): runs the handler of its kind.
s32 Field_RunEventAction(const void *event, s32 param, s32 target)
Runs the event tied to an effect: a result below 0x10000 is a message, shown at target; a larger one ...
void BattleFx_ClearChildValueOnMismatch(void)
Finishes the current effect when it is Mind Read: ends the effect and lets its target move again,...
void BattleFx_Run(void)
Casts the current Psynergy effect with no target: runs the body of its kind (scene->fieldKind).
s32 Menu_AskYesNo(s32 atBottom)
Asks yes or no at the top of the screen, or at the bottom with atBottom set.
void Leader_StopMoving(void)
Stops the leader where it stands: no horizontal velocity, the normal walking speed (1....
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 BattleEffect_CleanupSceneObjects(void)
Ends a Psynergy effect: frees the effect slots still in use and, unless another effect is being resol...
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.
What every part of object.c shares: its includes and the macros and types more than one part uses.
#define ABILITY_ID(c)
the Psynergy
#define ACT_PACKED
use it without paying PP
#define EXIT_RETREAT
the exit Retreat takes
#define ACT_UNIT(c)
who uses it
#define FLAG_PSYNERGY_EFFECT
play the usual effect
#define PSYNERGY_MESSAGE(who, act, m)
Shows message m with the user's and the Psynergy's names, and waits.
#define FLAG_PSYNERGY_TARGET
aim the effect at the target
#define PSYNERGY_EV_ANY
any phase
#define PSYNERGY_EV(phase)
The flags of a Psynergy event (kind 5) in the given phase.
struct EventWork * gEventWork
u8 type0c
The field Psynergy the ability works as, 1 (Move) to 16 (Avoid); 0 for none.
u8 ppCost
PP the ability costs.
Full event work allocated by Field_RunScene (heap slot 27).
s16 exit
the exit taken, which ends the scene
s8 resolvingAction
set while Psynergy takes effect
s16 mode
MODE_WORLD_MAP (3) on the world map.
The game's state: play time, coins, the scene and the leader's position, the active party and the opt...
s16 retreatEntrance
where Retreat goes; the group's first entrance
s16 retreatScene
where Retreat goes; the group's first entrance
s32 selectedActor
the leader: its unit and its actor
A scene event: its kind and detail, the trigger it answers, its condition and its value (a message or...
s16 trigger
What the event answers: an actor id, a tile's collision code, a marker id or a raised value.
#define MODE_WORLD_MAP
the world map