Skip to Content
The Alchemy Project

src/field/script_commands_jupiter.c

A Jupiter Djinni joining the party, and the first of the Mars Djinni's functions, linked after it: its shrinking and its sparks. More…

Included by script_commands.c.

Functions

NameDescription
voidfdDjinnRunJupiterJoinEffect (Sint32 djinniId)A Jupiter Djinni joins the party: it bounces three times, spins, leaps out of sight and bursts into a light particle for each of the effect state's, which circle and close in on the leader, who turns to the camera and raises its arms (ANIM_LEADER_ARMS_RAISED).
voidfdEffectPulseActorScale (ACTOR *actor)Per-tick update: makes an actor pulse, switching its scale between the two values of FieldEffectPulseScales every 4 ticks.
voidfdEffectAdvanceAngleWithRamp (ACTOR *actor)Per-tick update: spins an actor ever faster, from 1/16 turn a tick up to just over 1/8 (DEGtoANG(45) + 64), 80 more each tick for 52 ticks.
DEFINE_SHRINK_AND_DESTROY(fdEffectShrinkActorAndDestroySlow , -(toFIXED(7) / 1024))Spins an actor an eighth of a turn and shrinks it by 7/1024 of its size a tick, then releases it: 119 ticks from full size.
voidfdEffectUpdateMarsSpark (FIELD_PARTICLE *effect)Field effect sprite callback of a Mars Djinni's sparks (enum MARS_SPARK_STATE): the spark flies 120 pixels up the screen (give or take 3/32 turn) from its origin at up to 5 pixels a tick and starts over, until it stops where it arrives, hidden; 40 ticks later it swarms to points within 4 pixels of one 20 pixels over the leader, until it is freed once it arrives.

Description

A Jupiter Djinni joining the party, and the first of the Mars Djinni's functions, linked after it: its shrinking and its sparks. Part of script_commands.c.

Functions in detail

fdDjinnRunJupiterJoinEffect

void fdDjinnRunJupiterJoinEffect(Sint32 djinniId)

A Jupiter Djinni joins the party: it bounces three times, spins, leaps out of sight and bursts into a light particle for each of the effect state's, which circle and close in on the leader, who turns to the camera and raises its arms (ANIM_LEADER_ARMS_RAISED).

References fdActorFaceDirectionById(), fdActorGetById(), fdActorJump(), fdActorReleaseStub(), fdActorRunRepeatedMotion(), fdActorSelectAnimationStub(), fdCameraWorldToScreen(), fdEffectAdvanceSpinAngle(), fdEffectInitSlots(), fdEffectReleaseSlots(), fdEffectRunAngledApproachPhases(), fdParticleInit(), fdParticleSetAnimation(), fdParticleSetCallback(), fdSpriteSetAnimationColorModesStub(), MainRoutineStateWork, mnShopRestoreFieldPaletteStub(), mnShopSaveAndTintFieldPaletteStub(), Sint32, syRandom(), sySoundPlayStub() and sySynch().

Referenced by fdDjinnJoinParty().

Definition at line 11 of file script_commands_jupiter.c.

fdEffectPulseActorScale

void fdEffectPulseActorScale(ACTOR *actor)

Per-tick update: makes an actor pulse, switching its scale between the two values of FieldEffectPulseScales every 4 ticks.

References FieldEffectPulseScales and FrameCount.

Referenced by fdDjinnRunMarsJoinEffect().

Definition at line 82 of file script_commands_jupiter.c.

fdEffectAdvanceAngleWithRamp

void fdEffectAdvanceAngleWithRamp(ACTOR *actor)

Per-tick update: spins an actor ever faster, from 1/16 turn a tick up to just over 1/8 (DEGtoANG(45) + 64), 80 more each tick for 52 ticks.

Referenced by fdDjinnRunMarsJoinEffect().

Definition at line 93 of file script_commands_jupiter.c.

fdEffectShrinkActorAndDestroySlow

DEFINE_SHRINK_AND_DESTROY(fdEffectShrinkActorAndDestroySlow, -(toFIXED(7) / 1024))

Spins an actor an eighth of a turn and shrinks it by 7/1024 of its size a tick, then releases it: 119 ticks from full size. The Mars Djinni's joining shrinks the Djinni away with it.

Referenced by fdDjinnRunMarsJoinEffect().

Definition at line 108 of file script_commands_jupiter.c.

fdEffectUpdateMarsSpark

void fdEffectUpdateMarsSpark(FIELD_PARTICLE *effect)

Field effect sprite callback of a Mars Djinni's sparks (enum MARS_SPARK_STATE): the spark flies 120 pixels up the screen (give or take 3/32 turn) from its origin at up to 5 pixels a tick and starts over, until it stops where it arrives, hidden; 40 ticks later it swarms to points within 4 pixels of one 20 pixels over the leader, until it is freed once it arrives.

References fdActorGetById(), fdCameraWorldToScreen(), fdParticleFree(), fdParticleHasPendingTarget(), FrameCount, MainRoutineStateWork, Sint32, state, syRandom(), sySoundPlayStub() and syVectorAddPolarOffset().

Referenced by fdDjinnRunMarsJoinEffect().

Definition at line 116 of file script_commands_jupiter.c.