src/battle_effect/battle_effect_projectiles.c
The Djinni entrance that opens the Djinn's effects, and the projectile volleys (Slash, Shuriken, Wing Flutter, Blizzard ...). More…
Included by battle_effect.c.
Macros
| Name | Description | |
|---|---|---|
#define | ENTRANCE_SPARK_SLOTS 64 | The sparks the Djinni entrance sets out round the user, of which the first ENTRANCE_SPARKS spin and gather. |
#define | ENTRANCE_SPARKS 32 | |
#define | ENTRANCE_SPARK_SIZE_MAX 8 | A spinning spark is drawn at size ENTRANCE_SPARK_SIZE_MAX at depth ENTRANCE_SPARK_DEPTH_NEAR or nearer, one size smaller every ENTRANCE_SPARK_DEPTH_STEP farther, its depth held below ENTRANCE_SPARK_DEPTH_FAR. |
#define | ENTRANCE_SPARK_DEPTH_NEAR 250 | |
#define | ENTRANCE_SPARK_DEPTH_STEP 64 | |
#define | ENTRANCE_SPARK_DEPTH_FAR 634 | |
#define | ENTRANCE_TICKS 64 | The entrance's ticks, and the long entrance's, which ends in a burst of motes. |
#define | ENTRANCE_LONG_TICKS 84 | |
#define | PROJECTILE_VOLLEY_ANIMATION_STEP_FAST (ANIM_STEP_NORMAL * 3) | The user's animation step while firing. |
#define | PROJECTILE_VOLLEY_PARTICLE_COUNT PARTICLE_POOL_COUNT | |
#define | PROJECTILE_VOLLEY_COMET_PICTURES 4096 | Comets: the top half of each. |
#define | PROJECTILE_VOLLEY_STREAK_PICTURES 8192 | Wind streaks. |
#define | PROJECTILE_VOLLEY_FLASH_TURNED | The hit flashes turned on their side, after the upright ones. |
#define | PROJECTILE_VOLLEY_SMALL_SPARK_PICTURE_WIDTH 12 | The yellow spark sprite sheet: the small spark first, then the medium one, then the large one. |
#define | PROJECTILE_VOLLEY_SMALL_SPARK_PICTURE_HEIGHT 8 | |
#define | PROJECTILE_VOLLEY_MEDIUM_SPARK_PICTURE_WIDTH 18 | |
#define | PROJECTILE_VOLLEY_MEDIUM_SPARK_PICTURE_HEIGHT 13 | |
#define | PROJECTILE_VOLLEY_LARGE_SPARK_PICTURE_WIDTH 29 | |
#define | PROJECTILE_VOLLEY_LARGE_SPARK_PICTURE_HEIGHT 23 | |
#define | PROJECTILE_VOLLEY_SMALL_SPARK_PICTURE 0 | |
#define | PROJECTILE_VOLLEY_MEDIUM_SPARK_PICTURE | |
#define | PROJECTILE_VOLLEY_LARGE_SPARK_PICTURE | |
#define | PROJECTILE_VOLLEY_COMET_WIDTH 32 | The comets' width, and the shuriken's six pictures. |
#define | SHURIKEN_WIDTH 32 | |
#define | SHURIKEN_HEIGHT 24 | |
#define | PROJECTILE_VOLLEY_DJINNI_PICTURE 26048 | The small Mercury Djinni. |
#define | PROJECTILE_VOLLEY_FIRST_SPARK 100 | The first spark in PARTICLES. |
#define | PROJECTILE_VOLLEY_FIRST_TRAIL 512 | The first trail in PARTICLES. |
#define | PROJECTILE_VOLLEY_SHOTS_MAX 63 | The most shots a volley fires at all its targets together, one fewer than the effect's particles; past it, the volley fires at the first target alone. |
#define | PROJECTILE_VOLLEY_SPARK_SPEED_SHIFT 11 | A hit's sparks fly at up to 4 pixels a tick each way, as a random -128 to 127 shifted up; Cutting Edge's at up to 8. |
#define | CUTTING_EDGE_SPARK_SPEED_SHIFT 12 | |
#define | APPROACH_PERCENT 80 | How far btEffectSetApproachMotion takes a unit toward the other. |
Enumerations
| Name | Description | |
|---|---|---|
enum | VOLLEY_FIELD { PROJECTILE_VOLLEY_SHOTS, PROJECTILE_VOLLEY_STEPS, PROJECTILE … } | The bytes of a ProjectileVolleyModes row. |
Functions
| Name | Description | |
|---|---|---|
void | btEffectRunDjinniEntrance (BATTLE_EFFECT_PARM *args, Sint32 element, Sint32 side, Sint32 anchor, Sint32 *outX, Sint32 *outY) | Sparks swirl around a point that travels from the user to the goal and gather into a Djinni, which sways for 16 ticks and bursts into motes. |
void | btEffectRunSlash (BATTLE_EFFECT_PARM *args) | Six comets fly at each target, three ticks apart, and burst into a flash and sparks; the effect's variant picks one of three comets. |
void | btEffectRunShuriken (BATTLE_EFFECT_PARM *args) | Four spinning shurikens fly at each target, five ticks apart, and vanish once past it. |
void | btEffectRunCrazyVoice (BATTLE_EFFECT_PARM *args) | Ten pellets fly slowly at each target and bounce off it, up or down at random. |
void | btEffectRunWingFlutter (BATTLE_EFFECT_PARM *args) | Five yellow sparks fly level at each target, five ticks apart. |
void | btEffectRunWingStroke (BATTLE_EFFECT_PARM *args) | Ten large yellow sparks stream level at each target, one a tick, spread up and down. |
void | btEffectRunWingBeat (BATTLE_EFFECT_PARM *args) | Ten small yellow sparks stream level at each target, one a tick. |
static inline void | btEffectRunVolleyWithAction (BATTLE_EFFECT_PARM *args, Sint32 mode) | Fires the volley from the user's leap pose. |
void | btEffectRunCuttingEdge (BATTLE_EFFECT_PARM *args) | From the user's action pose, one large comet in ice colours flies at each target and bursts into 80 sparks. |
void | btEffectRunHeatWave (BATTLE_EFFECT_PARM *args) | From the user's action pose, seven fireballs trailing embers fly at each target, two ticks apart, each bursting into 40 sparks. |
void | btEffectRunSleet (BATTLE_EFFECT_PARM *args) | Thirty ice chips fall from high above the user onto each target. |
void | btEffectRunIceBlessing (BATTLE_EFFECT_PARM *args) | Sixty ice chips stream at each target, one a tick, without knocking it back. |
void | btEffectRunBlizzard (BATTLE_EFFECT_PARM *args) | From the user's action pose, sixty ice chips stream at each target, one a tick, scattered up and down, without knocking it back. |
void | btEffectRunProjectileVolley (BATTLE_EFFECT_PARM *args, Sint32 mode) | Shots fly from the user to each target and burst into a flash and sparks when they pass it. |
void | btEffectHopBackToSpot (Sint32 id) | Sends a unit back to its place (its anchor) with a hop. |
void | btEffectSetApproachMotion (Sint32 id, Sint32 targetId, Sint32 ticks) | Moves a unit APPROACH_PERCENT of the way to another one over ticks, in its leap pose. |
Description
The Djinni entrance that opens the Djinn's effects, and the projectile
volleys (Slash, Shuriken, Wing Flutter, Blizzard ...). Part of
battle_effect.c.
Macros in detail
ENTRANCE_SPARK_SLOTS
#define ENTRANCE_SPARK_SLOTS 64
The sparks the Djinni entrance sets out round the user, of which the first
ENTRANCE_SPARKS spin and gather.
Referenced by btEffectRunDjinniEntrance().
Definition at line 7 of file battle_effect_projectiles.c.
ENTRANCE_SPARKS
#define ENTRANCE_SPARKS 32
Referenced by btEffectRunDjinniEntrance().
Definition at line 8 of file battle_effect_projectiles.c.
ENTRANCE_SPARK_SIZE_MAX
#define ENTRANCE_SPARK_SIZE_MAX 8
A spinning spark is drawn at size ENTRANCE_SPARK_SIZE_MAX at depth
ENTRANCE_SPARK_DEPTH_NEAR or nearer, one size smaller every
ENTRANCE_SPARK_DEPTH_STEP farther, its depth held below
ENTRANCE_SPARK_DEPTH_FAR.
Referenced by btEffectRunDjinniEntrance().
Definition at line 13 of file battle_effect_projectiles.c.
ENTRANCE_SPARK_DEPTH_NEAR
#define ENTRANCE_SPARK_DEPTH_NEAR 250
Referenced by btEffectRunDjinniEntrance().
Definition at line 14 of file battle_effect_projectiles.c.
ENTRANCE_SPARK_DEPTH_STEP
#define ENTRANCE_SPARK_DEPTH_STEP 64
Referenced by btEffectRunDjinniEntrance().
Definition at line 15 of file battle_effect_projectiles.c.
ENTRANCE_SPARK_DEPTH_FAR
#define ENTRANCE_SPARK_DEPTH_FAR 634
Referenced by btEffectRunDjinniEntrance().
Definition at line 16 of file battle_effect_projectiles.c.
ENTRANCE_TICKS
#define ENTRANCE_TICKS 64
The entrance's ticks, and the long entrance's, which ends in a burst of motes.
Referenced by btEffectRunDjinniEntrance().
Definition at line 19 of file battle_effect_projectiles.c.
ENTRANCE_LONG_TICKS
#define ENTRANCE_LONG_TICKS 84
Referenced by btEffectRunDjinniEntrance().
Definition at line 20 of file battle_effect_projectiles.c.
PROJECTILE_VOLLEY_ANIMATION_STEP_FAST
#define PROJECTILE_VOLLEY_ANIMATION_STEP_FAST (ANIM_STEP_NORMAL * 3)
The user's animation step while firing.
Referenced by btEffectRunVolleyWithAction().
Definition at line 275 of file battle_effect_projectiles.c.
PROJECTILE_VOLLEY_PARTICLE_COUNT
#define PROJECTILE_VOLLEY_PARTICLE_COUNT PARTICLE_POOL_COUNT
Referenced by btEffectRunProjectileVolley().
Definition at line 385 of file battle_effect_projectiles.c.
PROJECTILE_VOLLEY_COMET_PICTURES
#define PROJECTILE_VOLLEY_COMET_PICTURES 4096
Comets: the top half of each.
Referenced by btEffectRunProjectileVolley().
Definition at line 398 of file battle_effect_projectiles.c.
PROJECTILE_VOLLEY_STREAK_PICTURES
#define PROJECTILE_VOLLEY_STREAK_PICTURES 8192
Wind streaks.
Referenced by btEffectRunProjectileVolley().
Definition at line 400 of file battle_effect_projectiles.c.
PROJECTILE_VOLLEY_FLASH_TURNED
#define PROJECTILE_VOLLEY_FLASH_TURNED
The hit flashes turned on their side, after the upright ones.
Referenced by btEffectRunProjectileVolley().
Definition at line 402 of file battle_effect_projectiles.c.
PROJECTILE_VOLLEY_SMALL_SPARK_PICTURE_WIDTH
#define PROJECTILE_VOLLEY_SMALL_SPARK_PICTURE_WIDTH 12
The yellow spark sprite sheet: the small spark first, then the medium one, then the large one.
Definition at line 406 of file battle_effect_projectiles.c.
PROJECTILE_VOLLEY_SMALL_SPARK_PICTURE_HEIGHT
#define PROJECTILE_VOLLEY_SMALL_SPARK_PICTURE_HEIGHT 8
Definition at line 407 of file battle_effect_projectiles.c.
PROJECTILE_VOLLEY_MEDIUM_SPARK_PICTURE_WIDTH
#define PROJECTILE_VOLLEY_MEDIUM_SPARK_PICTURE_WIDTH 18
Definition at line 408 of file battle_effect_projectiles.c.
PROJECTILE_VOLLEY_MEDIUM_SPARK_PICTURE_HEIGHT
#define PROJECTILE_VOLLEY_MEDIUM_SPARK_PICTURE_HEIGHT 13
Definition at line 409 of file battle_effect_projectiles.c.
PROJECTILE_VOLLEY_LARGE_SPARK_PICTURE_WIDTH
#define PROJECTILE_VOLLEY_LARGE_SPARK_PICTURE_WIDTH 29
Definition at line 410 of file battle_effect_projectiles.c.
PROJECTILE_VOLLEY_LARGE_SPARK_PICTURE_HEIGHT
#define PROJECTILE_VOLLEY_LARGE_SPARK_PICTURE_HEIGHT 23
Definition at line 411 of file battle_effect_projectiles.c.
PROJECTILE_VOLLEY_SMALL_SPARK_PICTURE
#define PROJECTILE_VOLLEY_SMALL_SPARK_PICTURE 0
Referenced by btEffectRunProjectileVolley().
Definition at line 412 of file battle_effect_projectiles.c.
PROJECTILE_VOLLEY_MEDIUM_SPARK_PICTURE
#define PROJECTILE_VOLLEY_MEDIUM_SPARK_PICTURE
Referenced by btEffectRunProjectileVolley().
Definition at line 413 of file battle_effect_projectiles.c.
PROJECTILE_VOLLEY_LARGE_SPARK_PICTURE
#define PROJECTILE_VOLLEY_LARGE_SPARK_PICTURE
Referenced by btEffectRunProjectileVolley().
Definition at line 415 of file battle_effect_projectiles.c.
PROJECTILE_VOLLEY_COMET_WIDTH
#define PROJECTILE_VOLLEY_COMET_WIDTH 32
The comets' width, and the shuriken's six pictures.
Referenced by btEffectRunProjectileVolley().
Definition at line 419 of file battle_effect_projectiles.c.
SHURIKEN_WIDTH
#define SHURIKEN_WIDTH 32
Referenced by btEffectRunProjectileVolley().
Definition at line 420 of file battle_effect_projectiles.c.
SHURIKEN_HEIGHT
#define SHURIKEN_HEIGHT 24
Referenced by btEffectRunProjectileVolley().
Definition at line 421 of file battle_effect_projectiles.c.
PROJECTILE_VOLLEY_DJINNI_PICTURE
#define PROJECTILE_VOLLEY_DJINNI_PICTURE 26048
The small Mercury Djinni.
Referenced by btEffectRunProjectileVolley().
Definition at line 423 of file battle_effect_projectiles.c.
PROJECTILE_VOLLEY_FIRST_SPARK
#define PROJECTILE_VOLLEY_FIRST_SPARK 100
The first spark in PARTICLES.
Referenced by btEffectRunProjectileVolley().
Definition at line 425 of file battle_effect_projectiles.c.
PROJECTILE_VOLLEY_FIRST_TRAIL
#define PROJECTILE_VOLLEY_FIRST_TRAIL 512
The first trail in PARTICLES.
Referenced by btEffectRunProjectileVolley().
Definition at line 427 of file battle_effect_projectiles.c.
PROJECTILE_VOLLEY_SHOTS_MAX
#define PROJECTILE_VOLLEY_SHOTS_MAX 63
The most shots a volley fires at all its targets together, one fewer than the effect's particles; past it, the volley fires at the first target alone.
Referenced by btEffectRunProjectileVolley().
Definition at line 430 of file battle_effect_projectiles.c.
PROJECTILE_VOLLEY_SPARK_SPEED_SHIFT
#define PROJECTILE_VOLLEY_SPARK_SPEED_SHIFT 11
A hit's sparks fly at up to 4 pixels a tick each way, as a random -128 to 127 shifted up; Cutting Edge's at up to 8.
Referenced by btEffectRunProjectileVolley().
Definition at line 433 of file battle_effect_projectiles.c.
CUTTING_EDGE_SPARK_SPEED_SHIFT
#define CUTTING_EDGE_SPARK_SPEED_SHIFT 12
Referenced by btEffectRunProjectileVolley().
Definition at line 434 of file battle_effect_projectiles.c.
APPROACH_PERCENT
#define APPROACH_PERCENT 80
How far btEffectSetApproachMotion takes a unit toward the other.
Referenced by btEffectSetApproachMotion().
Definition at line 1177 of file battle_effect_projectiles.c.
Enumerations in detail
VOLLEY_FIELD
enum VOLLEY_FIELD
The bytes of a ProjectileVolleyModes row.
| Enumerator | Value | Description |
|---|---|---|
PROJECTILE_VOLLEY_SHOTS | shots at each target | |
PROJECTILE_VOLLEY_STEPS | ticks a shot takes to reach its target | |
PROJECTILE_VOLLEY_STAGGER | ticks between shots | |
PROJECTILE_VOLLEY_DELAY | ticks between targets | |
PROJECTILE_VOLLEY_SPARKS | sparks thrown on each hit |
Definition at line 388 of file battle_effect_projectiles.c.
Functions in detail
btEffectRunDjinniEntrance
void btEffectRunDjinniEntrance(BATTLE_EFFECT_PARM *args, Sint32 element, Sint32 side, Sint32 anchor, Sint32 *outX, Sint32 *outY)
Sparks swirl around a point that travels from the user to the goal and gather into a Djinni, which sways for 16 ticks and bursts into motes.
References btEffectDarkenBackgroundStep(), btEffectStartCanvasLayer(), btEffectTintBattler(), btEffectTransferCanvas(), btObjectGetStub(), btParticleAdvanceWithGravity2D(), btParticleAdvanceWithGravity3D(), btProjectionPoint(), btResourceLoadAndDecompress(), Sint32, state, syCloseEvent(), syCos(), syDecompressTaggedLZ(), syMatrixTranslateVector(), syPopMatrix(), syPushMatrix(), syRandom(), syResourceGetTableEntry(), syRotX(), syRotY(), syRotZ(), sySin(), sySoundPlayStub(), syWordsClear() and syWordsCopy().
Referenced by btEffectRunBind(), btEffectRunDjinnBeams(), btEffectRunFlurry(), btEffectRunGround(), btEffectRunHail(), btEffectRunHealingMotes(), btEffectRunKite(), btEffectRunProjectileVolley(), btEffectRunStatBoost(), btEffectRunTorch() and btEffectRunVine().
Definition at line 24 of file battle_effect_projectiles.c.
btEffectRunSlash
void btEffectRunSlash(BATTLE_EFFECT_PARM *args)
Six comets fly at each target, three ticks apart, and burst into a flash and sparks; the effect's variant picks one of three comets.
Abilities: Slash, Wind Slash, Sonic Slash.



References btEffectRunProjectileVolley().
Referenced by BattleEffectHandlers.
Definition at line 281 of file battle_effect_projectiles.c.
btEffectRunShuriken
void btEffectRunShuriken(BATTLE_EFFECT_PARM *args)
Four spinning shurikens fly at each target, five ticks apart, and vanish once past it.
Abilities: Shuriken.

References btEffectRunProjectileVolley().
Referenced by BattleEffectHandlers.
Definition at line 290 of file battle_effect_projectiles.c.
btEffectRunCrazyVoice
void btEffectRunCrazyVoice(BATTLE_EFFECT_PARM *args)
Ten pellets fly slowly at each target and bounce off it, up or down at random.
Abilities: Crazy Voice.
References btEffectRunProjectileVolley().
Referenced by BattleEffectHandlers.
Definition at line 299 of file battle_effect_projectiles.c.
btEffectRunWingFlutter
void btEffectRunWingFlutter(BATTLE_EFFECT_PARM *args)
Five yellow sparks fly level at each target, five ticks apart.
Abilities: Wing Flutter.
References btEffectRunProjectileVolley().
Referenced by BattleEffectHandlers.
Definition at line 307 of file battle_effect_projectiles.c.
btEffectRunWingStroke
void btEffectRunWingStroke(BATTLE_EFFECT_PARM *args)
Ten large yellow sparks stream level at each target, one a tick, spread up and down.
Abilities: Wing Stroke.
References btEffectRunProjectileVolley().
Referenced by BattleEffectHandlers.
Definition at line 316 of file battle_effect_projectiles.c.
btEffectRunWingBeat
void btEffectRunWingBeat(BATTLE_EFFECT_PARM *args)
Ten small yellow sparks stream level at each target, one a tick.
Abilities: Wing Beat.
References btEffectRunProjectileVolley().
Referenced by BattleEffectHandlers.
Definition at line 324 of file battle_effect_projectiles.c.
btEffectRunVolleyWithAction
static inline void btEffectRunVolleyWithAction(BATTLE_EFFECT_PARM *args, Sint32 mode)
Fires the volley from the user's leap pose.
References btEffectRunProjectileVolley(), btObjectGetStub(), fdActorSelectAnimationStub(), fdActorSetAnimationSpeedStub() and Sint32.
Referenced by btEffectRunBlizzard(), btEffectRunCuttingEdge() and btEffectRunHeatWave().
Definition at line 330 of file battle_effect_projectiles.c.
btEffectRunCuttingEdge
void btEffectRunCuttingEdge(BATTLE_EFFECT_PARM *args)
From the user's action pose, one large comet in ice colours flies at each target and bursts into 80 sparks.
Abilities: Cutting Edge.

References btEffectRunVolleyWithAction().
Referenced by BattleEffectHandlers.
Definition at line 346 of file battle_effect_projectiles.c.
btEffectRunHeatWave
void btEffectRunHeatWave(BATTLE_EFFECT_PARM *args)
From the user's action pose, seven fireballs trailing embers fly at each target, two ticks apart, each bursting into 40 sparks.
Abilities: Heat Wave.

References btEffectRunVolleyWithAction().
Referenced by BattleEffectHandlers.
Definition at line 355 of file battle_effect_projectiles.c.
btEffectRunSleet
void btEffectRunSleet(BATTLE_EFFECT_PARM *args)
Thirty ice chips fall from high above the user onto each target.
Abilities: Sleet.

References btEffectRunProjectileVolley().
Referenced by BattleEffectHandlers.
Definition at line 363 of file battle_effect_projectiles.c.
btEffectRunIceBlessing
void btEffectRunIceBlessing(BATTLE_EFFECT_PARM *args)
Sixty ice chips stream at each target, one a tick, without knocking it back.
Abilities: Ice Blessing.
References btEffectRunProjectileVolley().
Referenced by BattleEffectHandlers.
Definition at line 371 of file battle_effect_projectiles.c.
btEffectRunBlizzard
void btEffectRunBlizzard(BATTLE_EFFECT_PARM *args)
From the user's action pose, sixty ice chips stream at each target, one a tick, scattered up and down, without knocking it back.
Abilities: Blizzard.
References btEffectRunVolleyWithAction().
Referenced by BattleEffectHandlers.
Definition at line 380 of file battle_effect_projectiles.c.
btEffectRunProjectileVolley
void btEffectRunProjectileVolley(BATTLE_EFFECT_PARM *args, Sint32 mode)
Shots fly from the user to each target and burst into a flash and sparks when they pass it. The hit sound plays at most once every 8 ticks.
References btCameraShake(), btEffectRunDjinniEntrance(), btEffectStartCanvasLayer(), btEffectTintBattler(), btEffectTransferCanvas(), btMotionApplyKnockbackStub(), btObjectGetStub(), btParticleAdvanceWithGravity2D(), btProjectionPoint(), btResourceLoadAndDecompress(), btUnitGetEffectHeightStub(), ProjectileVolleyCometHeights, ProjectileVolleyFlashHeights, ProjectileVolleyFlashPictures, ProjectileVolleyFlashRises, ProjectileVolleyFlashSteps, ProjectileVolleyFlashWidths, ProjectileVolleyModes, ProjectileVolleyPelletPictures, Sint32, state, syCos(), syHeapSlotRelease(), syRandom(), syResourceGetTableEntry(), sySetEvent(), sySin(), sySoundPlayStub() and syWordsCopy().
Referenced by btEffectRunCastingImpact(), btEffectRunCrazyVoice(), btEffectRunIceBlessing(), btEffectRunShuriken(), btEffectRunSlash(), btEffectRunSleet(), btEffectRunVolleyWithAction(), btEffectRunWingBeat(), btEffectRunWingFlutter() and btEffectRunWingStroke().
Definition at line 438 of file battle_effect_projectiles.c.
btEffectHopBackToSpot
void btEffectHopBackToSpot(Sint32 id)
Sends a unit back to its place (its anchor) with a hop.
References btObjectGetStub(), fdActorSelectAnimationStub(), fdActorSetMoveTargetStub(), fdActorStartIdleStub() and Sint32.
Definition at line 1159 of file battle_effect_projectiles.c.
btEffectSetApproachMotion
void btEffectSetApproachMotion(Sint32 id, Sint32 targetId, Sint32 ticks)
Moves a unit APPROACH_PERCENT of the way to another one over ticks, in its
leap pose.
References btObjectGetStub(), fdActorSelectAnimationStub(), fdActorSetMoveTargetStub(), fdActorStartIdleStub(), Sint32 and sySquartIWRAM().
Referenced by btEffectRunRushingStrike().
Definition at line 1181 of file battle_effect_projectiles.c.