Alchemy
Loading...
Searching...
No Matches

effect_slot.c File Reference

Effect slots: the particles Psynergy effects move and draw. More...

Go to the source code of this file.

Functions

void EffectSlot_Update (struct EffectSlot *effect)
 Updates one effect slot: counts its age, runs its callback (after any delay), moves it and draws it.
void BattleFx_DrawScaledObject (struct EffectSlot *object)
 Draws an effect slot's sprite at its screen position and scale, when it is near the screen.
void EffectSlot_UpdateMotion (struct EffectSlot *effect)
 Moves an effect slot toward its target, turning at most maxTurnStep a frame when limitTurnStep is set and speeding up by acceleration to maxSpeed.
u32 EffectSlot_HasPendingTarget (struct EffectSlot *effect)
 Returns nonzero while an effect slot that stops at its target still has one (it has not arrived), 0 once it has arrived or when it never stops.
void EffectSlot_SetPosition (struct EffectSlot *effect, s32 x, s32 z)
 Places an effect slot at (x, z), at rest with no target.
void EffectSlot_SetObjectMode (struct EffectSlot *effect, s32 mode)
 Sets the animation of an effect slot's sprite.
void EffectSlot_SetCallback (struct EffectSlot *effect, EffectCallback callback)
 Gives an effect slot its per-frame callback, starting at state 0.
void EffectSlot_Initialize (struct EffectSlot *effect, s32 kind, s32 x, s32 z)
 Fills an effect slot with a new sprite of kind at (x, z): stopping at its target, top speed 2, acceleration and scale 1, drawn, animation 1.
void BattleFx_ClearOwnedSlot (struct EffectSlot *slot)
 Frees an effect slot and its sprite.

Detailed Description

Effect slots: the particles Psynergy effects move and draw.

Part of psynergy_effects.c, compiled only through it.

Definition in file effect_slot.c.

Function Documentation

◆ EffectSlot_Update()

void EffectSlot_Update ( struct EffectSlot * effect)

Updates one effect slot: counts its age, runs its callback (after any delay), moves it and draws it.

Definition at line 9 of file effect_slot.c.

Referenced by Djinn_ResolvePendingEvent(), EffectSlot_Update(), and FieldFx_UpdateSceneSlots().

◆ BattleFx_DrawScaledObject()

void BattleFx_DrawScaledObject ( struct EffectSlot * object)

Draws an effect slot's sprite at its screen position and scale, when it is near the screen.

With flag 4 the slot's z also lifts it (0x1fc pixels less z).

Definition at line 29 of file effect_slot.c.

Referenced by BattleFx_DrawScaledObject(), Djinn_ResolvePendingEvent(), and EffectSlot_Update().

◆ EffectSlot_UpdateMotion()

void EffectSlot_UpdateMotion ( struct EffectSlot * effect)

Moves an effect slot toward its target, turning at most maxTurnStep a frame when limitTurnStep is set and speeding up by acceleration to maxSpeed.

A slot that stops at its target lands on it once within 8 pixels.

Definition at line 53 of file effect_slot.c.

Referenced by Djinn_ResolvePendingEvent(), EffectSlot_Update(), and EffectSlot_UpdateMotion().

◆ EffectSlot_HasPendingTarget()

u32 EffectSlot_HasPendingTarget ( struct EffectSlot * effect)

◆ EffectSlot_SetPosition()

void EffectSlot_SetPosition ( struct EffectSlot * effect,
s32 x,
s32 z )

Places an effect slot at (x, z), at rest with no target.

Definition at line 120 of file effect_slot.c.

Referenced by Djinn_ResolvePendingEvent(), EffectSlot_Initialize(), EffectSlot_SetPosition(), and EffectSlot_UpdateMotion().

◆ EffectSlot_SetObjectMode()

◆ EffectSlot_SetCallback()

◆ EffectSlot_Initialize()

void EffectSlot_Initialize ( struct EffectSlot * effect,
s32 kind,
s32 x,
s32 z )

Fills an effect slot with a new sprite of kind at (x, z): stopping at its target, top speed 2, acceleration and scale 1, drawn, animation 1.

Definition at line 144 of file effect_slot.c.

Referenced by AltmillerCave_ReleaseWallBurst(), BattleEffect_RunFallbackObjectTransition(), BattleFx_RunMercuryDjinnCapture(), BattleFx_RunVenusDjinnCapture(), Djinn_ResolvePendingEvent(), Djinn_RunJupiterJoinEffect(), Djinn_RunMarsJoinEffect(), EffectSlot_Initialize(), FieldFx_RunForce(), and FieldFx_RunRetreat().

◆ BattleFx_ClearOwnedSlot()