Alchemy
Loading...
Searching...
No Matches

setup.c File Reference

An effect's work: setting it up, its caster and target, cleaning up. More...

Go to the source code of this file.

Macros

#define SETUP_OBJECT_SLOTS   ((struct ScriptMotionObject *)gObjectSlots)

Functions

void BattleFx_UpdateAllEffectSlots (void)
 Scheduler callback: updates the 24 effect slots.
void BattleFx_LoadActionEffectResources (s32 abilityId, s32 mode)
 Prepares the work of the Psynergy effect for ability (heap slot 56) and loads its spark tiles.
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 resolved, waits (at most 30 frames) for the swelling arcs to end, stops the slot callback, releases the effect's tiles, restores the map's shake, plays the queued sound and releases the effect's work.
void EventObject_Initialize (void)
 Starts casting: the caster takes its casting pose (animation 20) and stops.
void BattleEffect_InitializeSharedScene (void)
 Saves the palettes for the effect (once, unless an effect is already shown) and fades them toward one of the eight effect colours (gBattleFx_TargetColors), picked by the frame counter or forced by flags 0x148 to 0x14f, over 8 frames.
void BattleFx_PrepareBufferInterpolation (void)
 Fades the palettes back from an effect's colours to the saved ones (or to palette 0x10001 while an effect is shown) over 8 frames.
void Camera_WorldToScreen (struct EffectVector *position)
 Converts a world position (16.16 pixels) to the screen: x and z receive the screen's x and y and y becomes 0.

Detailed Description

An effect's work: setting it up, its caster and target, cleaning up.

Part of psynergy_effects.c, compiled only through it.

Definition in file setup.c.

Macro Definition Documentation

◆ SETUP_OBJECT_SLOTS

#define SETUP_OBJECT_SLOTS   ((struct ScriptMotionObject *)gObjectSlots)

Definition at line 103 of file setup.c.

Referenced by BattleEffect_CleanupSceneObjects().

Function Documentation

◆ BattleFx_UpdateAllEffectSlots()

void BattleFx_UpdateAllEffectSlots ( void )

Scheduler callback: updates the 24 effect slots.

Definition at line 8 of file setup.c.

Referenced by BattleEffect_CleanupSceneObjects(), BattleFx_LoadActionEffectResources(), BattleFx_UpdateAllEffectSlots(), and Djinn_ResolvePendingEvent().

◆ BattleFx_LoadActionEffectResources()

void BattleFx_LoadActionEffectResources ( s32 abilityId,
s32 mode )

Prepares the work of the Psynergy effect for ability (heap slot 56) and loads its spark tiles.

Called again while an effect resolves, it only switches the ability.

Definition at line 13 of file setup.c.

Referenced by BattleFx_LoadActionEffectResources(), Djinn_ResolvePendingEvent(), Field_RunPsynergyEvents(), Field_UseItem(), Field_UsePsynergy(), and GomaCaveEntrance_WhirlwindOnStumpIvy().

◆ BattleFx_SetupObjectPair()

void BattleFx_SetupObjectPair ( s32 userId,
s32 targetId )

Records the caster and the target of an effect.

With no target, the effect takes place 16 pixels in front of the caster (facing to the nearest quarter turn).

Definition at line 56 of file setup.c.

Referenced by BattleFx_LoadActionEffectResources(), BattleFx_Run(), BattleFx_SetupObjectPair(), Djinn_ResolvePendingEvent(), Field_RunPsynergyEvents(), Field_UsePsynergy(), and GomaCaveEntrance_WhirlwindOnStumpIvy().

◆ EffectRuntime_StopCurrentObject()

void EffectRuntime_StopCurrentObject ( void )

◆ BattleEffect_CleanupSceneObjects()

void BattleEffect_CleanupSceneObjects ( void )

Ends a Psynergy effect: frees the effect slots still in use and, unless another effect is being resolved, waits (at most 30 frames) for the swelling arcs to end, stops the slot callback, releases the effect's tiles, restores the map's shake, plays the queued sound and releases the effect's work.

Definition at line 110 of file setup.c.

Referenced by AltinPeak_BeastFreezesWidePuddle(), BattleEffect_CleanupSceneObjects(), Djinn_ResolvePendingEvent(), Event_MeetFlint(), Field_RunPsynergyEvents(), Field_UseItem(), Field_UsePsynergy(), Imil_MiaCastsPlyOnOldMan(), Kolima_FinishReadingThoughts(), MercuryLighthouseAerie_AlexCastsPly(), Scene_EndCutscenePsynergy(), ValeBabi_DemonstrateCatch(), and VaultInteriors_EndMindRead().

◆ EventObject_Initialize()

void EventObject_Initialize ( void )

Starts casting: the caster takes its casting pose (animation 20) and stops.

Unless the effect is silent the caster flashes with a sound; unless it is quiet, the ability's name is shown while every other object stands still. With flag 0x140 the caster's colours keep cycling and it takes pose 21; otherwise the caster's hook stops.

Definition at line 186 of file setup.c.

Referenced by Djinn_ResolvePendingEvent(), EventObject_Initialize(), Field_UsePsynergy(), and GomaCaveEntrance_WhirlwindOnStumpIvy().

◆ BattleEffect_InitializeSharedScene()

void BattleEffect_InitializeSharedScene ( void )

Saves the palettes for the effect (once, unless an effect is already shown) and fades them toward one of the eight effect colours (gBattleFx_TargetColors), picked by the frame counter or forced by flags 0x148 to 0x14f, over 8 frames.

Definition at line 236 of file setup.c.

Referenced by BattleEffect_InitializeSharedScene(), BattleEffect_RunFallbackObjectTransition(), BattleEffect_SpawnBurstParticleField(), BattleFx_SteerLiftedTarget(), BattleFx_SteerPushedTarget(), Djinn_ResolvePendingEvent(), FieldFx_RunCatch(), FieldFx_RunDouse(), FieldFx_RunForce(), FieldFx_RunFrost(), FieldFx_RunLiftOnTarget(), FieldFx_RunMove(), FieldFx_RunPly(), FieldFx_RunRetreat(), FieldFx_RunWhirlwind(), and RunSceneTransitionEffect().

◆ BattleFx_PrepareBufferInterpolation()

◆ Camera_WorldToScreen()