Skip to Content
The Alchemy Project

src/field/script_commands_whirlwind.c

Whirlwind: an orb flies from the caster and spins up a ring of leaves that blows its target away. More…

Included by script_commands.c.

Macros

NameDescription
#defineEFFECT_SPAWN_RESIDENTThe shared effect-spawning source, at its place in the ROM.

Enumerations

NameDescription
enumanonymous enum { WHIRLWIND_RADIAL_DIRECTIONS, WHIRLWIND_ORBIT_PARTICLES, WHIR … }Whirlwind's particles: the ring that spreads from the caster, the leaves that circle the orb 8 pixels out, a 32nd of a turn a tick, for 121 ticks before they wander off for 101, the target shrinking to half its size, and the orb's 10 ticks from caster to target.

Functions

NameDescription
voidfdEffectSpawnRadialParticleRing (ACTOR *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: circles the anchor at 8 pixels; after 121 ticks it starts to wander (fdEffectWanderAroundAnchor).
voidfdWhirlwindUpdateTarget (ACTOR *actor)Shrinks an event-selected Whirlwind target each tick; below half size, moves it to the origin, stops it and removes the update.
voidfdPsynergyWhirlwindOnTarget (Sint32 unused)Runs Whirlwind cast on a target, using the target already stored in the field effect.
voidfdPsynergyWhirlwind (void)Whirlwind: an orb grows as it flies from the caster to 4 pixels below the Psynergy's position in 10 ticks, swells and gusts; cast at a target a cue names, it shrinks the target away and sends 16 leaves circling, then it whooshes off.

Description

Whirlwind: an orb flies from the caster and spins up a ring of leaves that blows its target away. Part of script_commands.c.

Macros in detail

EFFECT_SPAWN_RESIDENT

#define EFFECT_SPAWN_RESIDENT

The shared effect-spawning source, at its place in the ROM.

Definition at line 24 of file script_commands_whirlwind.c.

Enumerations in detail

anonymous enum

enum { WHIRLWIND_RADIAL_DIRECTIONS, WHIRLWIND_ORBIT_PARTICLES, WHIRLWIND_ORBIT_RADIUS, WHIRLWIND_ORBIT_ANGLE_STEP, … }

Whirlwind's particles: the ring that spreads from the caster, the leaves that circle the orb 8 pixels out, a 32nd of a turn a tick, for 121 ticks before they wander off for 101, the target shrinking to half its size, and the orb's 10 ticks from caster to target.

EnumeratorValueDescription
WHIRLWIND_RADIAL_DIRECTIONS16
WHIRLWIND_ORBIT_PARTICLES16
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 10 of file script_commands_whirlwind.c.

Functions in detail

fdEffectSpawnRadialParticleRing

void fdEffectSpawnRadialParticleRing(ACTOR *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 fdEffectSpawnResident(), scFieldEffectAdvanceMotion(), Sint32, syCos() and sySin().

Referenced by fdPsynergySteerLiftedTarget().

Definition at line 32 of file script_commands_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(), FieldEffectSharedParticleScript, Sint32, syCos(), syMulFX(), syRandom() and sySin().

Referenced by fdEffectCircleAnchor().

Definition at line 66 of file script_commands_whirlwind.c.

fdEffectCircleAnchor

void fdEffectCircleAnchor(ACTOR *effect)

Per-tick update: circles the anchor at 8 pixels; after 121 ticks it starts to wander (fdEffectWanderAroundAnchor).

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

Referenced by fdPsynergyWhirlwind().

Definition at line 97 of file script_commands_whirlwind.c.

fdWhirlwindUpdateTarget

void fdWhirlwindUpdateTarget(ACTOR *actor)

Shrinks an event-selected Whirlwind target each tick; below half size, moves it to the origin, stops it and removes the update.

References fdActorSetPosAndResetMotionStub() and Sint32.

Referenced by fdPsynergyWhirlwind().

Definition at line 129 of file script_commands_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 145 of file script_commands_whirlwind.c.

fdPsynergyWhirlwind

void fdPsynergyWhirlwind(void)

Whirlwind: an orb grows as it flies from the caster to 4 pixels below the Psynergy's position in 10 ticks, swells and gusts; cast at a target a cue names, it shrinks the target away and sends 16 leaves circling, then it whooshes off.

References fdActorReleaseStub(), fdActorSelectAnimationStub(), fdActorSpawn(), fdEffectCircleAnchor(), fdPsynergyFadeFromCastColor(), fdPsynergyFadeToCastColor(), fdWhirlwindUpdateTarget(), Sint32, syRandom(), sySoundPlayStub(), sySynch() and syVectorAddPolarOffset().

Referenced by fdPsynergyRun() and fdPsynergyWhirlwindOnTarget().

Definition at line 154 of file script_commands_whirlwind.c.