Skip to Content
The Alchemy Project

src/field/script_commands_move.c

Move: a hand pushes the target, steered with the d-pad. More…

Included by script_commands.c.

Functions

NameDescription
Sint32fdInputGetDpadAngle (Uint32 unused)Returns the direction of the d-pad (TRIG_TURN a full turn): right FACING_EAST, down FACING_SOUTH, left FACING_WEST, up FACING_NORTH; DPAD_ANGLE_NONE when none or a diagonal is held.
voidfdEffectUpdateMoveHand (ACTOR *hand)Per-tick update of Move's hand (fdEffectSpawnMoveHand): turns it toward the actor it watches, at most 1/16 turn a tick, and sheds a particle (SPRITE_SPARKLE) round it.
voidfdPsynergySteerPushedTarget (Sint32 targetId)When Move is cast on a target, the pushing hand appears beside it and pushes it 16 pixels the way the d-pad points, for as long as the player pushes; A, B, L or R end it.
voidfdEffectUpdateOutAndBack (FIELD_PARTICLE *effect)Field effect sprite callback of a particle that flies 30 pixels out from where it started, comes back and is freed.
voidfdPsynergyMove (void)When Move is cast with no target, the hand appears beside the caster for 30 ticks and then bursts into sparkles.
ACTOR *fdEffectSpawnMoveHand (ACTOR *caster)Spawns Move's hand (SPRITE_MOVE_HAND) 16 pixels above the caster, at quarter size, and moves it 16 pixels the way the caster faces (to the nearest quarter turn), with 8 sparkles scattering from it.
voidfdEffectGrowHandAndWait (ACTOR *actor)Sets an actor's scale at once to full size (its first step of 1/16 past toFIXED(1) - 1: exactly toFIXED(1) from a multiple of 1/16) when it is smaller, then waits, at most 600 ticks, for it to arrive at its target.
voidfdEffectBurstHand (ACTOR *hand)Ends a hand: over 31 ticks it rises 1 pixel, turns 1/8 turn and shrinks by 1/32 of full size a tick, then bursts into 8 sparkles and is released.

Description

Move: a hand pushes the target, steered with the d-pad. Part of script_commands.c.

Functions in detail

fdInputGetDpadAngle

Sint32 fdInputGetDpadAngle(Uint32 unused)

Returns the direction of the d-pad (TRIG_TURN a full turn): right FACING_EAST, down FACING_SOUTH, left FACING_WEST, up FACING_NORTH; DPAD_ANGLE_NONE when none or a diagonal is held.

References InputDpadAngles, PerData and Sint32.

Referenced by fdPsynergySteerLiftedTarget() and fdPsynergySteerPushedTarget().

Definition at line 9 of file script_commands_move.c.

fdEffectUpdateMoveHand

void fdEffectUpdateMoveHand(ACTOR *hand)

Per-tick update of Move's hand (fdEffectSpawnMoveHand): turns it toward the actor it watches, at most 1/16 turn a tick, and sheds a particle (SPRITE_SPARKLE) round it.

References fdActorSpawn(), fdEffectInitFallingFragment(), Sint32, syAtan(), syRandom() and syVectorAddPolarOffset().

Referenced by fdEffectSpawnMoveHand().

Definition at line 18 of file script_commands_move.c.

fdPsynergySteerPushedTarget

void fdPsynergySteerPushedTarget(Sint32 targetId)

When Move is cast on a target, the pushing hand appears beside it and pushes it 16 pixels the way the d-pad points, for as long as the player pushes; A, B, L or R end it.

References fdActorCycleSpriteColors(), fdActorGetById(), fdActorScriptFindOverlappingActorStub(), fdActorSelectAnimationStub(), fdActorSetMoveTargetStub(), fdActorSetSpriteColorModeStub(), fdActorStartScriptStub(), fdActorWaitForMoveStub(), fdEffectBurstHand(), fdEffectGrowHandAndWait(), fdEffectSpawnMoveHand(), fdInputGetDpadAngle(), fdMapGridCheckCollisionStub(), fdMapGridGetTerrainKindAtStub(), fdPsynergyFadeFromCastColor(), fdPsynergyFadeToCastColor(), fdPsynergyStopCasterUpdate(), FieldEffectQuadrantModes, FieldEffectSourceHoldScript, PerData, PerPush, Sint32, sySoundPlayStub(), sySynch(), syVectorAddPolarOffset() and TickCount.

Referenced by fdPsynergyDispatch().

Definition at line 61 of file script_commands_move.c.

fdEffectUpdateOutAndBack

void fdEffectUpdateOutAndBack(FIELD_PARTICLE *effect)

Field effect sprite callback of a particle that flies 30 pixels out from where it started, comes back and is freed.

References fdParticleFree(), fdParticleHasPendingTarget(), Sint32, state, syRandom() and syVectorAddPolarOffset().

Definition at line 256 of file script_commands_move.c.

fdPsynergyMove

void fdPsynergyMove(void)

When Move is cast with no target, the hand appears beside the caster for 30 ticks and then bursts into sparkles.

References fdActorSelectAnimationStub(), fdEffectBurstHand(), fdEffectGrowHandAndWait(), fdEffectSpawnMoveHand(), fdPsynergyFadeFromCastColor(), fdPsynergyFadeToCastColor(), Sint32 and sySynch().

Referenced by fdPsynergyRun().

Definition at line 307 of file script_commands_move.c.

fdEffectSpawnMoveHand

ACTOR *fdEffectSpawnMoveHand(ACTOR *caster)

Spawns Move's hand (SPRITE_MOVE_HAND) 16 pixels above the caster, at quarter size, and moves it 16 pixels the way the caster faces (to the nearest quarter turn), with 8 sparkles scattering from it.

References fdActorSelectAnimationStub(), fdActorSetTargetPosFromMagnitudeAngle(), fdActorSpawn(), fdActorStartScriptStub(), fdEffectUpdateMoveHand(), FieldEffectFragmentScript, Sint32, syRandom() and sySoundPlayStub().

Referenced by fdPsynergyMove() and fdPsynergySteerPushedTarget().

Definition at line 337 of file script_commands_move.c.

fdEffectGrowHandAndWait

void fdEffectGrowHandAndWait(ACTOR *actor)

Sets an actor's scale at once to full size (its first step of 1/16 past toFIXED(1) - 1: exactly toFIXED(1) from a multiple of 1/16) when it is smaller, then waits, at most 600 ticks, for it to arrive at its target.

References fdActorWaitForMoveStub().

Referenced by fdPsynergyMove() and fdPsynergySteerPushedTarget().

Definition at line 395 of file script_commands_move.c.

fdEffectBurstHand

void fdEffectBurstHand(ACTOR *hand)

Ends a hand: over 31 ticks it rises 1 pixel, turns 1/8 turn and shrinks by 1/32 of full size a tick, then bursts into 8 sparkles and is released.

References fdActorReleaseStub(), fdActorSetTargetPosFromMagnitudeAngle(), fdActorSpawn(), fdActorStartScriptStub(), FieldEffectFragmentScript, Sint32, syRandom(), sySoundPlayStub() and sySynch().

Referenced by fdPsynergyLiftOnTarget(), fdPsynergyMove() and fdPsynergySteerPushedTarget().

Definition at line 419 of file script_commands_move.c.