src/battle/battle_motion.c
The units' movements: returning, running, leaping and knocked back, and their positions on the screen. More…
Included by battle.c.
Macros
| Name | Description | |
|---|---|---|
#define | EFFECT_HEIGHT_SMALL 24 | The pixels above a unit where its battle effects play when its battle sprite row gives none: a small enemy's, and everyone else's. |
#define | EFFECT_HEIGHT_LARGE 48 |
Functions
| Name | Description | |
|---|---|---|
void | btMotionReturnToSpot (Sint32 unitId) | Sends unitId back to its spot, landing exactly there (snapToTarget), and turns it to face the centre at once. |
void | btMotionSetupEscapeObject (Sint32 unitId) | Sends unitId running off its side of the battlefield, three times as far out as its spot, with a hop, in POSE_STANDING. |
void | btMotionLeapToward (BATTLE_OBJECT *startSlot, BATTLE_OBJECT *endSlot, Sint32 progress) | Unused: sends one unit leaping progress percent of the way toward another. |
void | btMotionReturnObjectToSpot (BATTLE_OBJECT *battleObject) | Unused: sends a unit's actor back to its spot. |
void | btMotionHopBack (Sint32 unitId) | Sends unitId hopping out to one and a half times its spot's distance from the centre. |
void | btMotionLeapBack (Sint32 unitId) | Unused: sends a unit leaping back from the centre in its damage pose. |
void | btMotionApplyKnockback (Sint32 unitId, Sint32 variant) | Knocks a unit back as the knockback variant says, in its damage pose; the Fusion Dragon only takes the pose. |
void | btMotionApproachTarget (Sint32 unitId, Sint32 targetId, Sint32 ticks, Sint32 initVelocityY) | Sends one unit leaping three quarters of the way to another, arriving in ticks ticks, with a hop of initVelocityY. |
void | btMotionRestartLeap (Sint32 unitId) | Unused: restarts unit id's motion in POSE_LEAP. |
void | btMotionMidpointNoOperation () | Does nothing; btMotionApplyPairMidpoint, its only caller, passes it a position and a distance. |
void | btMotionApplyPairMidpoint (Sint32 firstId, Sint32 secondId) | Unused: works out the point halfway between two units and hands it to a function that does nothing. |
void | btMotionPlayHitFlash (Sint32 unitId) | Unused: plays the hit flash on unit id's sprite and waits ten ticks. |
Sint32 | btMotionProjectScaledPos (Sint32 unitId, Sint32 *projected) | Projects the point above a unit where its battle effects play onto the screen, scaled as its sprite is. |
Sint32 | btMotionProjectCursorPoint (Sint32 unitId, Sint32 *projected) | Projects the point above a unit onto the screen: the target cursor's place, EFFECT_HEIGHT_SMALL up for a small enemy and EFFECT_HEIGHT_LARGE for others, scaled as the sprite is. |
Sint32 | btUnitGetEffectHeight (Sint32 unitId) | Returns the height above a unit where its battle effects play, in 16.16 pixels: its battle sprite row's own, else EFFECT_HEIGHT_SMALL for a small enemy and EFFECT_HEIGHT_LARGE for others. |
Description
The units' movements: returning, running, leaping and knocked back, and their
positions on the screen. Part of battle.c.
Macros in detail
EFFECT_HEIGHT_SMALL
#define EFFECT_HEIGHT_SMALL 24
The pixels above a unit where its battle effects play when its battle sprite row gives none: a small enemy's, and everyone else's.
Referenced by btMotionProjectCursorPoint() and btUnitGetEffectHeight().
Definition at line 321 of file battle_motion.c.
EFFECT_HEIGHT_LARGE
#define EFFECT_HEIGHT_LARGE 48
Referenced by btMotionProjectCursorPoint() and btUnitGetEffectHeight().
Definition at line 322 of file battle_motion.c.
Functions in detail
btMotionReturnToSpot
void btMotionReturnToSpot(Sint32 unitId)
Sends unitId back to its spot, landing exactly there (snapToTarget), and turns it to face the centre at once.
References btObjectGet(), fdActorSetMoveTargetStub(), fdActorStartIdleStub(), Sint32 and syAtan().
Referenced by btAbilityApplyToTarget(), btAutoBattleRunApproachAttack(), btAutoBattleRunAttackOrItem(), btStagingDispatchAction(), btStagingRunAttack(), btStagingRunItem(), btStagingRunPlainAttack() and btStagingRunPsynergyCast().
Definition at line 11 of file battle_motion.c.
btMotionSetupEscapeObject
void btMotionSetupEscapeObject(Sint32 unitId)
Sends unitId running off its side of the battlefield, three times as far out
as its spot, with a hop, in POSE_STANDING.
References btObjectGet(), fdActorSelectAnimationStub(), fdActorSetMoveTargetStub(), fdActorStartIdleStub() and Sint32.
Referenced by btFleePlayRun() and btStagingRunFlee().
Definition at line 35 of file battle_motion.c.
btMotionLeapToward
void btMotionLeapToward(BATTLE_OBJECT *startSlot, BATTLE_OBJECT *endSlot, Sint32 progress)
Unused: sends one unit leaping progress percent of the way toward another.
References fdActorSelectAnimationStub(), fdActorSetMoveTargetStub() and Sint32.
Definition at line 55 of file battle_motion.c.
btMotionReturnObjectToSpot
void btMotionReturnObjectToSpot(BATTLE_OBJECT *battleObject)
Unused: sends a unit's actor back to its spot.
References fdActorSetMoveTargetStub().
Definition at line 86 of file battle_motion.c.
btMotionHopBack
void btMotionHopBack(Sint32 unitId)
Sends unitId hopping out to one and a half times its spot's distance from the centre.
References btObjectGet(), fdActorSetMoveTargetStub(), fdActorStartIdleStub() and Sint32.
Referenced by btStagingRunAttack() and btStagingRunPlainAttack().
Definition at line 101 of file battle_motion.c.
btMotionLeapBack
void btMotionLeapBack(Sint32 unitId)
Unused: sends a unit leaping back from the centre in its damage pose.
References btObjectGet(), fdActorSelectAnimationStub(), fdActorSetMoveTargetStub(), fdActorStartIdleStub(), Sint32 and syMulFX().
Definition at line 120 of file battle_motion.c.
btMotionApplyKnockback
void btMotionApplyKnockback(Sint32 unitId, Sint32 variant)
Knocks a unit back as the knockback variant says, in its damage pose; the Fusion Dragon only takes the pose.
References BattleKnockbackAcceleration, BattleKnockbackDistancePercent, BattleKnockbackSpeedLimit, BattleKnockbackVelocityY, btObjectGet(), fdActorSelectAnimationStub(), fdActorSetMoveTargetStub(), fdActorStartIdleStub(), gmUnitGetStub() and Sint32.
Definition at line 141 of file battle_motion.c.
btMotionApproachTarget
void btMotionApproachTarget(Sint32 unitId, Sint32 targetId, Sint32 ticks, Sint32 initVelocityY)
Sends one unit leaping three quarters of the way to another, arriving in
ticks ticks, with a hop of initVelocityY.
References btObjectGet(), fdActorSelectAnimationStub(), fdActorSetMoveTargetStub(), fdActorStartIdleStub(), Sint32 and sySquartIWRAM().
Referenced by btAutoBattleRunApproachAttack(), btStagingRunAttack() and btStagingRunPlainAttack().
Definition at line 171 of file battle_motion.c.
btMotionRestartLeap
void btMotionRestartLeap(Sint32 unitId)
Unused: restarts unit id's motion in POSE_LEAP.
References btObjectGet(), fdActorSelectAnimationStub(), fdActorStartIdleStub() and Sint32.
Definition at line 213 of file battle_motion.c.
btMotionMidpointNoOperation
void btMotionMidpointNoOperation()
Does nothing; btMotionApplyPairMidpoint, its only caller, passes it a
position and a distance.
Referenced by btMotionApplyPairMidpoint().
Definition at line 224 of file battle_motion.c.
btMotionApplyPairMidpoint
void btMotionApplyPairMidpoint(Sint32 firstId, Sint32 secondId)
Unused: works out the point halfway between two units and hands it to a function that does nothing.
References btMotionMidpointNoOperation(), btObjectGet() and Sint32.
Definition at line 230 of file battle_motion.c.
btMotionPlayHitFlash
void btMotionPlayHitFlash(Sint32 unitId)
Unused: plays the hit flash on unit id's sprite and waits ten ticks. Only a single-sprite actor takes it.
References btObjectGet(), fdSpriteAddAnimationStub(), fdSpriteAnimationStartStub(), Sint32 and sySynch().
Definition at line 275 of file battle_motion.c.
btMotionProjectScaledPos
Sint32 btMotionProjectScaledPos(Sint32 unitId, Sint32 *projected)
Projects the point above a unit where its battle effects play onto the screen, scaled as its sprite is. Returns 0.
References btActorGetSprite(), btCameraApplyTransform(), btObjectGet(), btUnitGetEffectHeight(), Sint32, syConvert3Dto2D() and syMulFX().
Referenced by btElementGlowPlay().
Definition at line 300 of file battle_motion.c.
btMotionProjectCursorPoint
Sint32 btMotionProjectCursorPoint(Sint32 unitId, Sint32 *projected)
Projects the point above a unit onto the screen: the target cursor's place,
EFFECT_HEIGHT_SMALL up for a small enemy and EFFECT_HEIGHT_LARGE for others,
scaled as the sprite is. Returns 0.
References btActorGetSprite(), btCameraApplyTransform(), btObjectGet(), btSpriteIsSmall(), gmUnitGetStub(), Sint32, syConvert3Dto2D() and syMulFX().
Definition at line 327 of file battle_motion.c.
btUnitGetEffectHeight
Sint32 btUnitGetEffectHeight(Sint32 unitId)
Returns the height above a unit where its battle effects play, in 16.16
pixels: its battle sprite row's own, else EFFECT_HEIGHT_SMALL for a small
enemy and EFFECT_HEIGHT_LARGE for others.
References btSpriteGetEffectHeight(), btSpriteIsSmall(), gmUnitGetStub() and Sint32.
Referenced by btMotionProjectScaledPos().
Definition at line 348 of file battle_motion.c.