avoid.c
Avoid.
games/tbs/src/object/psynergy_effects/avoid.c on GitHub
Avoid. Part of psynergy_effects.c, compiled only through it.
Functions
FieldFx_BlinkAvoidCaster
void FieldFx_BlinkAvoidCaster(void)
End of the effect: switches the caster's display flags between 3 and 1 on a 5-frame cycle, so its outline (bit 1) blinks beside its shadow (bit 0). FieldFx_RunAvoid schedules it (order 0xc80) for its last 70 frames and removes it again.
Used by FieldFx_RunAvoid.
BattleFx_UpdatePairedArcSpawner
void BattleFx_UpdatePairedArcSpawner(union FieldObject *fieldObject)
The caster during the effect: sheds a pair of falling arcs every 5 frames (7 on the world map), and spins in phase 1, 3/64 turn a frame. FieldFx_RunAvoid makes it the caster's callback; it counts the caster's step and turns its angle. The arcs draw with the tiles FieldFx_RunAvoid loads into scene->arcTileSlot.
Used by FieldFx_RunAvoid.
FieldEvent_ShowStatusMessage
void FieldEvent_ShowStatusMessage(void)
Avoid (or the Sacred Feather) has worn off, and the game says so. "Avoid's effects wore off." (or "Sacred Feather's ...").
Clears gGameState.avoidDistance. Reached through FieldEvent_RunTypeHandler when the Psynergy request the leader's steps raise as Avoid runs out (object/step.c) is handled.
Used by FieldEvent_RunTypeHandler.
FieldFx_RunAvoid
void FieldFx_RunAvoid(void)
The caster spins and flashes, then blinks, and encounters are kept away until Avoid wears off.
Abilities: Avoid (field kind 16), and the Sacred Feather.
The caster spins shedding falling arcs and flashes 20 times, then blinks for 55 frames; encounters are kept away (avoidDistance 0x9600000) until it wears off, and the game says "Monsters won't attack so often now.". FLAG_ITEM_USE marks it as cast from the Sacred Feather.
Called by BattleFx_Run and BattleFx_DispatchRequestKind. Sets gGameState.avoidDistance and avoidByItem; the leader's steps count the distance down by their speed (object/step.c), 2,400 pixels in all.
Used by BattleFx_DispatchRequestKind, BattleFx_Run.