Alchemy

arcs.c

The swelling arcs over the caster.

games/tbs/src/object/psynergy_effects/arcs.c on GitHub

The swelling arcs over the caster. Part of psynergy_effects.c, compiled only through it.

Functions

FieldFx_UpdateScaledArcObjectA

void FieldFx_UpdateScaledArcObjectA(union FieldObject *fieldObject)

Per-frame update of arc A: over 32 frames it swells and shrinks again (scale sin(frame / 64 turn)) while it rises a pixel a frame on the object it follows, 9 pixels in front of it and up to 5 pixels further while small.

Used by BattleEffect_CleanupSceneObjects, BattleFx_SpawnScaledArcObjects.

Line 11

FieldFx_UpdateScaledArcObjectB

void FieldFx_UpdateScaledArcObjectB(union FieldObject *fieldObject)

Per-frame update of arc B: arc A upside down, 16 pixels in front of the object and up to 5 pixels nearer while small.

Used by BattleEffect_CleanupSceneObjects, BattleFx_SpawnScaledArcObjects.

Line 36

BattleFx_SpawnScaledArcObjects

void BattleFx_SpawnScaledArcObjects(struct FieldActor *linked)

Spawns the two swelling arcs (object 26) on an object, A and B (B upside down); they follow it for 32 frames, then free themselves. They draw with the effect's spark tiles, so they need the effect's work; the casting hooks below spawn them every 16 frames, and BattleEffect_CleanupSceneObjects waits for the last to end (at most 30 frames).

Used by BattleFx_FlickerObjectAndTick, FieldFx_CycleObjectValueByCounter.

Line 95

BattleFx_FlickerObjectAndTick

void BattleFx_FlickerObjectAndTick(union FieldObject *fieldObject)

Per-frame update: flashes an object between sprite param 7 and 0 every 2 frames and spawns the swelling arcs on it every 16. EventObject_Initialize gives it to the caster as a cast starts with a flash (scene->visible).

Used by EventObject_Initialize.

Line 142

FieldFx_CycleObjectValueByCounter

void FieldFx_CycleObjectValueByCounter(union FieldObject *fieldObject)

Per-frame update: cycles an object through sprite params 0 to 5, one step every 2 frames, and spawns the swelling arcs on it every 16. EventObject_Initialize gives it to the caster in place of the flicker while flag 0x140 is set.

Used by EventObject_Initialize.

Line 158

Structures

ArcSprite

struct ArcSprite

A sprite (struct AnimationObject) as the arcs set it up: its image's three OAM attributes and its bookkeeping; the notes give the AnimationObject fields at the same offsets.

FieldDeclared as
pad00u8 pad00[4]
yu16 y : 8screen pixels
affineu16 affine : 1
doubleSizeu16 doubleSize : 1
modeu16 mode : 2
mosaicu16 mosaic : 1
coloru16 color : 11 = 256 colours
shapeu16 shape : 21 wide
xu16 x : 9screen pixels
unusedu16 unused : 3
hflipu16 hflip : 1
vflipu16 vflip : 1
sizeu16 size : 2
tileu16 tile : 10first sprite tile in VRAM
priorityu16 priority : 2
paletteu16 palette : 4
pad0au8 pad0a[18]
slotu8 slotVRAM cache entry holding its tiles
activeu8 active : 1retainCacheEntry: set, releasing the arc leaves the effect's spark tiles (scene->tileSlot), which it borrows, loaded.
displayFlagsu8 displayFlags : 7
pad1eu8 pad1e[8]
flagsu8 flagsbit 0 draws its shadow; the arcs clear it
pad27u8 pad27
childstruct AnimationEntry *childentries[0], its first layer

Used by BattleFx_SpawnScaledArcObjects.

Line 60

On this page