Alchemy

douse.c

Douse.

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

Douse. Part of psynergy_effects.c, compiled only through it.

Functions

FieldFx_SpawnRandomAngleTriplet

void FieldFx_SpawnRandomAngleTriplet(union FieldObject *fieldObject)

Per-frame update of a falling drop: on reaching altitude it is freed 2 frames later and scatters three half-size splashes, which hop toward points 32 pixels away and are freed after 6 frames.

Used by FieldFx_RunDouse.

Line 53

BattleFx_UpdateDriftingFallObject

void BattleFx_UpdateDriftingFallObject(union FieldObject *fieldObject)

Per-frame update: drifts from side to side, up to a pixel a frame, as it falls 0.3 pixels a frame, and is released on reaching its ground height. Douse's swaying particles in Mercury Lighthouse.

Used by FieldFx_RunDouse.

Line 95

FieldFx_RunDouseOnTarget

void FieldFx_RunDouseOnTarget(s32 unused)

Runs Douse cast on a target, through FieldFx_RunDouse.

Abilities: Douse (field kind 5), cast on a target.

Used by BattleFx_DispatchRequestKind.

Line 111

FieldFx_RunDouse

void FieldFx_RunDouse(void)

An orb rises from 16 pixels above the caster to 32 pixels above the destination (80 with variant) over 10 frames, growing as it goes, rains particles, and returns.

Abilities: Douse (field kind 5).

The destination is the target's position (BattleFx_SetupObjectPair); with no target it is 16 pixels in front of the caster, on the ground. Called by BattleFx_Run, and through FieldFx_RunDouseOnTarget.

Used by BattleFx_Run, FieldFx_RunDouseOnTarget.

Line 122

Structures

Effect05Object

struct Effect05Object

A FieldActor as Douse's orb and drops use it; the notes give the FieldActor fields at the same offsets.

FieldDeclared as
reserved00u8 reserved00[8]
x, y, zs32 x, y, z16.16 fixed-point pixels
altitudes32 altitudeterrainHeight: a drop's height to fall to
scaleX, scaleYs32 scaleX, scaleY
reserved20u8 reserved20[8]
velocityYs32 velocityY16.16 fixed-point pixels per frame, up
reserved2cu8 reserved2c[4]
speeds32 speedspeed limit, 16.16 fixed-point pixels per frame
reserved34u8 reserved34[0x1c]
spritestruct WaveFxSprite *sprite
reserved54u8 reserved54
flagu8 flagmotionFlags: 2 falls, 0 free flight
reserved56u8 reserved56[8]
phases16 phasewait: frames its script waits before it runs on; 2 or 6 here, before gBattleFx_CommonParticleScript frees it.
reserved60u8 reserved60[0xc]
callbackvoid (*callback)(union FieldObject *object)per-frame update

Used by FieldFx_RunDouse, FieldFx_SpawnRandomAngleTriplet.

Line 9

Effect05State

struct Effect05State

The effect scene (struct BattleFxScene, gEffectWork) as Douse reads it; the notes give the BattleFxScene fields at the same offsets.

FieldDeclared as
angles32 angle1/65536 turns: the way the caster faces
x, y, zs32 x, y, zthe ground under the orb's destination
targetstruct Object *targetmainObject: the caster, despite the name
initializeds32 initializedchild: the target's object, 0 for none
reserved18u8 reserved18[8]
highArcu8 highArcenabled: set at the start, cleared when a scene event names the target (BattleFx_DispatchRequestKind). Set, 10 particles fall; cleared, 24 drops, or 30 swaying particles in Mercury Lighthouse.
reserved21u8 reserved21[0x13]
variantu8 variantchildOption: set by a scene, the orb stops 80 pixels up
reserved35u8 reserved35[0x10]
alternateu8 alternatelit: set in two Mercury Lighthouse maps (setup.c), where swaying particles (object 0x11c) fall rather than splashing drops.

Used by FieldFx_RunDouse.

Line 32

On this page