Skip to Content
The Alchemy Project

src/field/script_commands_arcs.c

The golden rings that swell around a caster and rise up its body: each ring is two arcs of SPRITE_GOLDEN_RINGS, its back half behind the caster and its front half, the same arc upside down, in front. More…

Included by script_commands.c.

Macros

NameDescription
#defineCAST_RING_TICKS 32A ring's life in ticks, over which its scale runs through half a sine wave: it swells from nothing and shrinks again.
#defineCAST_RING_SCALE (tick) sySin((tick) * (TRIG_TURN / 2 / CAST_RING_TICKS))
#defineCAST_RING_INTERVAL 16The ring is set off every this many ticks while the caster flashes.

Functions

NameDescription
voidfdEffectUpdateScaledArcActorA (ACTOR *arc)Per-tick update of a ring's back half (arc A): over CAST_RING_TICKS it swells and shrinks again while it rises a pixel a tick on the actor it follows, 9 pixels in front of it and up to 5 pixels further while small.
voidfdEffectUpdateScaledArcActorB (ACTOR *arc)Per-tick update of a ring's front half (arc B): the back half's arc upside down, 16 pixels in front of the actor and up to 5 pixels nearer while small.
voidfdEffectSpawnScaledArcActors (ACTOR *watched)Spawns a ring on an actor, its two halves (arcs A and B of SPRITE_GOLDEN_RINGS, B upside down); they follow it for CAST_RING_TICKS, then release themselves.
voidfdEffectFlickerActorAndSpawnArcs (ACTOR *actor)Per-tick update: flashes an actor white two ticks in four and sets off a ring around it every CAST_RING_INTERVAL ticks.
voidfdEffectCycleActorAndSpawnArcs (ACTOR *actor)Per-tick update: cycles an actor through its own colours and the five with channels swapped, a new one every two ticks, and sets off a ring around it every CAST_RING_INTERVAL ticks.

Description

The golden rings that swell around a caster and rise up its body: each ring is two arcs of SPRITE_GOLDEN_RINGS, its back half behind the caster and its front half, the same arc upside down, in front. Part of script_commands.c.

Macros in detail

CAST_RING_TICKS

#define CAST_RING_TICKS 32

A ring's life in ticks, over which its scale runs through half a sine wave: it swells from nothing and shrinks again.

Referenced by fdEffectUpdateScaledArcActorA() and fdEffectUpdateScaledArcActorB().

Definition at line 9 of file script_commands_arcs.c.

CAST_RING_SCALE

#define CAST_RING_SCALE(tick) sySin((tick) * (TRIG_TURN / 2 / CAST_RING_TICKS))

Referenced by fdEffectUpdateScaledArcActorA() and fdEffectUpdateScaledArcActorB().

Definition at line 10 of file script_commands_arcs.c.

CAST_RING_INTERVAL

#define CAST_RING_INTERVAL 16

The ring is set off every this many ticks while the caster flashes.

Referenced by fdEffectCycleActorAndSpawnArcs() and fdEffectFlickerActorAndSpawnArcs().

Definition at line 12 of file script_commands_arcs.c.

Functions in detail

fdEffectUpdateScaledArcActorA

void fdEffectUpdateScaledArcActorA(ACTOR *arc)

Per-tick update of a ring's back half (arc A): over CAST_RING_TICKS it swells and shrinks again while it rises a pixel a tick on the actor it follows, 9 pixels in front of it and up to 5 pixels further while small.

References fdActorStartScriptStub(), FieldEffectSharedParticleScript and Sint32.

Referenced by fdEffectSpawnScaledArcActors() and fdPsynergyEnd().

Definition at line 17 of file script_commands_arcs.c.

fdEffectUpdateScaledArcActorB

void fdEffectUpdateScaledArcActorB(ACTOR *arc)

Per-tick update of a ring's front half (arc B): the back half's arc upside down, 16 pixels in front of the actor and up to 5 pixels nearer while small.

References fdActorStartScriptStub(), FieldEffectSharedParticleScript and Sint32.

Referenced by fdEffectSpawnScaledArcActors() and fdPsynergyEnd().

Definition at line 40 of file script_commands_arcs.c.

fdEffectSpawnScaledArcActors

void fdEffectSpawnScaledArcActors(ACTOR *watched)

Spawns a ring on an actor, its two halves (arcs A and B of SPRITE_GOLDEN_RINGS, B upside down); they follow it for CAST_RING_TICKS, then release themselves.

References fdActorCreateStub(), fdEffectUpdateScaledArcActorA(), fdEffectUpdateScaledArcActorB(), fdSpriteStartAnimationStub(), Sint32, syVRAMCacheFreeEntry() and VramCacheEntries.

Referenced by fdEffectCycleActorAndSpawnArcs() and fdEffectFlickerActorAndSpawnArcs().

Definition at line 64 of file script_commands_arcs.c.

fdEffectFlickerActorAndSpawnArcs

void fdEffectFlickerActorAndSpawnArcs(ACTOR *actor)

Per-tick update: flashes an actor white two ticks in four and sets off a ring around it every CAST_RING_INTERVAL ticks.

References fdActorSetSpriteColorModeStub(), fdEffectSpawnScaledArcActors() and TickCount.

Referenced by fdPsynergyStartCast().

Definition at line 116 of file script_commands_arcs.c.

fdEffectCycleActorAndSpawnArcs

void fdEffectCycleActorAndSpawnArcs(ACTOR *actor)

Per-tick update: cycles an actor through its own colours and the five with channels swapped, a new one every two ticks, and sets off a ring around it every CAST_RING_INTERVAL ticks.

References fdActorSetSpriteColorModeStub(), fdEffectSpawnScaledArcActors(), Sint32 and TickCount.

Referenced by fdPsynergyStartCast().

Definition at line 135 of file script_commands_arcs.c.