move.c
Move: a hand pushes the target, steered with the d-pad.
games/tbs/src/object/psynergy_effects/move.c on GitHub
Move: a hand pushes the target, steered with the d-pad. Part of psynergy_effects.c, compiled only through it.
Functions
Input_GetDpadAngle
s32 Input_GetDpadAngle(u32 unused)
Returns the direction of the d-pad (0x10000 a full turn): right 0, down 0x4000, left 0x8000, up 0xc000; 0xffff when none or a diagonal is held. Opposite directions cancel, so a third held direction still counts.
Used by BattleFx_SteerLiftedTarget, BattleFx_SteerPushedTarget.
BattleFx_UpdateItemBreakFragment
void BattleFx_UpdateItemBreakFragment(union FieldObject *fieldObject)
Per-frame update of Move's hand (BattleFx_StartItemBreak): turns it toward the object it is linked to, at most 1/16 turn a frame, and sheds a particle (object 0x11d) round it.
Used by BattleFx_StartItemBreak.
BattleFx_SteerPushedTarget
void BattleFx_SteerPushedTarget(s32 targetId)
Puts the pushing hand beside the target and pushes the target 16 pixels the way the d-pad points, for as long as the player pushes; A, B, L or R end it.
Abilities: Move (field kind 1), cast on a target.
Where the target cannot go, an error sound plays every 16 frames. When the push would run into the caster, the caster blocks it or, when the tile beyond is free, is pushed along too.
Used by BattleFx_DispatchRequestKind.
BattleFx_UpdateOrbitAndReturn
void BattleFx_UpdateOrbitAndReturn(struct EffectSlot *slot)
Effect slot callback of a particle that flies 30 pixels out from where it started, comes back and is freed. It goes out straight at up to 4 pixels a frame and comes back turning at most 1/64 turn a frame, so it curves home.
FieldFx_RunMove
void FieldFx_RunMove(void)
Shows the hand beside the caster for 30 frames, then turns it into particles.
Abilities: Move (field kind 1), cast with no target.
Used by BattleFx_Run.
BattleFx_StartItemBreak
void *BattleFx_StartItemBreak(void *object)
Spawns Move's hand (object 215) 16 pixels above object, at quarter size, and moves it 16 pixels the way object faces (to the nearest quarter turn), with 8 particles round it. Returns the hand, or 0 when it cannot be spawned (Object_Spawn); the caller releases it (UpdateRisingParticleBurst).
Used by BattleFx_SteerPushedTarget, FieldFx_RunMove.
BattleFx_SnapScaleToFull
void BattleFx_SnapScaleToFull(struct MotionObject *obj)
Sets an object's scale at once to full size (its first step of 1/16 past 0xffff: 0x10000 from a multiple of 1/16) when it is smaller, then waits, at most 600 frames, for it to arrive at its target. Called by both Move effects on the hand.
Used by BattleFx_SteerPushedTarget, FieldFx_RunMove.
UpdateRisingParticleBurst
void UpdateRisingParticleBurst(void *object)
Ends a hand: over 31 frames it rises 1 pixel, turns 1/8 turn and shrinks by 1/32 of full size a frame, then bursts into 8 particles and is released. Not a per-frame update: it waits the frames itself. Called by the Move effects and Lift.
Used by BattleFx_SteerPushedTarget, FieldFx_RunLiftOnTarget, FieldFx_RunMove.
Macros, without a comment: MOVE_CELL_MASK.