Skip to Content
The Alchemy Project

src/field/field_psynergy_whirlwind.c

Whirlwind: radial particle rings, circling and wandering leaves and the Whirlwind orb. More…

Included by field_psynergy.c.

Macros

NameDescription
#defineRADIAL_RING_STEPS 16The radial ring's particles, a 16th of a turn apart; the last goes where the first went.

Enumerations

NameDescription
enumanonymous enum { WHIRLWIND_LEAF_COUNT, WHIRLWIND_ORBIT_RADIUS, WHIRLWIND_ORBI … }Whirlwind: its leaves, their circling and wandering, the target's shrinking and the orb's flight, in ticks.

Functions

NameDescription
voidfdEffectSpawnRadialParticleRing (MOTION_OBJECT *origin)Spawns 17 particles that spread from origin in a flat ring, their x velocity 1.5 times their z velocity, so the ring is wider than deep as the field is drawn.
voidfdEffectWanderAroundAnchor (ACTOR *effect)Per-tick update: wanders away from the anchor, 2 to 3 pixels a tick, now and then turning sharply; after 101 ticks it hands over to the shared particle script.
voidfdEffectCircleAnchor (ACTOR *effect)Per-tick update of a Whirlwind particle: circles the anchor at 8 pixels, a 32nd of a turn a tick; after 121 ticks it starts to wander (fdEffectWanderAroundAnchor) with upward speed and gravity.
voidfdWhirlwindUpdateTarget (ACTOR *actor)Per-tick update of Whirlwind's target: it shrinks a 512th a tick and, below half its size, is put away at the map's origin.
voidfdPsynergyWhirlwindOnTarget (Sint32 unused)Runs Whirlwind cast on a target, using the target already stored in the field effect.
voidfdWhirlwindUpdateSpentOrb (ACTOR *actor)Per-tick update of Whirlwind's orb once it has done its work: it whooshes on its 80th tick.
voidfdPsynergyWhirlwind (void)Whirlwind: a whirlwind orb flies from the caster to the spot over ten ticks, growing from a quarter size.

Description

Whirlwind: radial particle rings, circling and wandering leaves and the Whirlwind orb. Part of field_psynergy.c.

Macros in detail

RADIAL_RING_STEPS

#define RADIAL_RING_STEPS 16

The radial ring's particles, a 16th of a turn apart; the last goes where the first went.

Referenced by fdEffectSpawnRadialParticleRing().

Definition at line 20 of file field_psynergy_whirlwind.c.

Enumerations in detail

anonymous enum

enum { WHIRLWIND_LEAF_COUNT, WHIRLWIND_ORBIT_RADIUS, WHIRLWIND_ORBIT_ANGLE_STEP, WHIRLWIND_ORBIT_TICKS, … }

Whirlwind: its leaves, their circling and wandering, the target's shrinking and the orb's flight, in ticks.

EnumeratorValueDescription
WHIRLWIND_LEAF_COUNT16
WHIRLWIND_ORBIT_RADIUStoFIXED(8)
WHIRLWIND_ORBIT_ANGLE_STEPTRIG_TURN / 32
WHIRLWIND_ORBIT_TICKS121
WHIRLWIND_WANDER_TICKS101
WHIRLWIND_TARGET_SCALE_STEPtoFIXED(1) / 512
WHIRLWIND_TARGET_MIN_SCALEtoFIXED(1) / 2
WHIRLWIND_TRAVEL_TICKS10

Definition at line 6 of file field_psynergy_whirlwind.c.

Functions in detail

fdEffectSpawnRadialParticleRing

void fdEffectSpawnRadialParticleRing(MOTION_OBJECT *origin)

Spawns 17 particles that spread from origin in a flat ring, their x velocity 1.5 times their z velocity, so the ring is wider than deep as the field is drawn.

References fdEffectAdvanceMotion(), fdEffectSpawnResident(), Sint32, syCos() and sySin().

Referenced by fdPsynergySteerLiftedTarget().

Definition at line 25 of file field_psynergy_whirlwind.c.

fdEffectWanderAroundAnchor

void fdEffectWanderAroundAnchor(ACTOR *effect)

Per-tick update: wanders away from the anchor, 2 to 3 pixels a tick, now and then turning sharply; after 101 ticks it hands over to the shared particle script.

References fdActorStartScriptStub(), FieldEffectReleaseScript, Sint32, syCos(), syRandom() and sySin().

Referenced by fdEffectCircleAnchor() and fdPsynergyWhirlwind().

Definition at line 59 of file field_psynergy_whirlwind.c.

fdEffectCircleAnchor

void fdEffectCircleAnchor(ACTOR *effect)

Per-tick update of a Whirlwind particle: circles the anchor at 8 pixels, a 32nd of a turn a tick; after 121 ticks it starts to wander (fdEffectWanderAroundAnchor) with upward speed and gravity. As The Broken Seal's fdEffectCircleAnchor.

References fdEffectWanderAroundAnchor(), Sint32, syCos(), syRandom() and sySin().

Referenced by fdPsynergyWhirlwind().

Definition at line 91 of file field_psynergy_whirlwind.c.

fdWhirlwindUpdateTarget

void fdWhirlwindUpdateTarget(ACTOR *actor)

Per-tick update of Whirlwind's target: it shrinks a 512th a tick and, below half its size, is put away at the map's origin.

References fdActorSetPosAndResetMotionStub() and Sint32.

Referenced by fdPsynergyWhirlwind().

Definition at line 120 of file field_psynergy_whirlwind.c.

fdPsynergyWhirlwindOnTarget

void fdPsynergyWhirlwindOnTarget(Sint32 unused)

Runs Whirlwind cast on a target, using the target already stored in the field effect.

References fdPsynergyWhirlwind() and Sint32.

Referenced by fdPsynergyDispatch().

Definition at line 136 of file field_psynergy_whirlwind.c.

fdWhirlwindUpdateSpentOrb

void fdWhirlwindUpdateSpentOrb(ACTOR *actor)

Per-tick update of Whirlwind's orb once it has done its work: it whooshes on its 80th tick.

References sySoundPlayStub().

Referenced by fdPsynergyWhirlwind().

Definition at lines 141 and 296 of file field_psynergy_whirlwind.c.

fdPsynergyWhirlwind

void fdPsynergyWhirlwind(void)

Whirlwind: a whirlwind orb flies from the caster to the spot over ten ticks, growing from a quarter size. With nothing to blow it whooshes away; on a target, leaves circle it while the target shrinks away; on sprouting leaves the leaves scatter, and there or on a seedling the vine swings (fdHangingVineSwing).

References fdActorReleaseStub(), fdActorSelectAnimationStub(), fdActorSpawn(), fdActorWaitForTrackEndStub(), fdBattleEffectSetObjectUpdateMode(), fdEffectCircleAnchor(), fdEffectWanderAroundAnchor(), fdHangingVineSwing(), fdPsynergyFadeFromCastColor(), fdPsynergyFadeToCastColor(), fdWhirlwindUpdateSpentOrb(), fdWhirlwindUpdateTarget(), Sint32, syRandom(), sySoundPlayStub(), sySynch() and syVectorAddPolarOffset().

Referenced by fdPsynergyRun() and fdPsynergyWhirlwindOnTarget().

Definition at line 148 of file field_psynergy_whirlwind.c.