Skip to Content
The Alchemy Project

src/battle_effect/battle_effect_legend.c

Legend, the Bramble, Frost, Flame and Thunder Cards, and the Sleep, Baffle, Death and Sword Cards' entries into their own body. More…

Included by battle_effect.c.

Macros

NameDescription
#defineLEGEND_SPARK_COUNT 512Legend's sparks, and the cards', are the first LEGEND_SPARK_COUNT of EXTRA_PARTICLES, 128 for each of Legend's swords; they bounce once on the ground at SPARK_GROUND_Y.
#defineSPARK_GROUND_Y 104
#defineLEGEND_SWORD_SPARKS 128
#defineLEGEND_BLADE_PICTURES 16384BladeSheet's sword, point down, in the effect's pictures; it is drawn cut off at SPARK_GROUND_Y, stuck in the ground.
#defineLEGEND_SWORD_WIDTH 40
#defineLEGEND_SWORD_HEIGHT 80
#defineLEGEND_FLAME_GRADIENT 20480Where FlameGradientTexture is decoded in the effect's pictures.
#defineLEGEND_FAN_FLAMES 8The fan of LEGEND_FAN_FLAMES flames, FlameGradientTexture's dark red to white, tilted LEGEND_FAN_TILT.
#defineLEGEND_FAN_TILT 18384
#defineLEGEND_FIRE_RING_GROWTH 12384Each sword's ring of fire grows by this share of its size a tick, from half.
#defineLEGEND_SWORD_INTERVAL 16The swords set out LEGEND_SWORD_INTERVAL ticks apart; each falls from LEGEND_SWORD_FALL_TICK ticks after it sets out, rings out at LEGEND_SWORD_SOUND_TICK and strikes at LEGEND_SWORD_STRIKE_TICK.
#defineLEGEND_SWORD_FALL_TICK 50
#defineLEGEND_SWORD_SOUND_TICK 54
#defineLEGEND_SWORD_STRIKE_TICK 59
#defineLEGEND_SWORD_FALL_TICKS 12Each sword falls for LEGEND_SWORD_FALL_TICKS ticks, from LEGEND_SWORD_START_DISTANCE pixels above and beside the target.
#defineLEGEND_SWORD_START_DISTANCE 80
#defineLEGEND_TICKS 86Legend's length with one sword, up to LEGEND_SWORDS_MAX of them as the variant grows; each further sword adds LEGEND_SWORD_INTERVAL.
#defineLEGEND_SWORDS_MAX 3
#defineCARD_STREAK_WIDTH 32A card's picture, CARD_WIDTH by CARD_HEIGHT, at its sprite sheet's start; the Bramble Card's sprite sheet has its three vines after it, 32 by 128 as JaggedStreakSheet's streaks are.
#defineCARD_STREAK_HEIGHT 128
#defineELEMENT_CARDS_PICTURES PICTURE_BYTES(CARD)Where the card's element pictures are decoded in the effect's pictures, after the card: CrystalSheet, FlashBurstSheet, SmokeSheet or JaggedStreakSheet.
#defineCARD_PIECES 56The state's particles: the shards, smoke or pictures the card throws, then one strike countdown for each target.
#defineCARD_STRIKE_TIMERS CARD_PIECES
#defineCARD_SPARKS_PER_TARGET 64
#defineCARD_STRIKE_SPARKS 16
#defineCARD_STRIKE_INTERVAL 5Each target is struck every CARD_STRIKE_INTERVAL ticks.
#defineCARD_STREAKS 4The Bramble Card's vines and the Thunder Card's bolts, one from each of the card's corners, each one of the three streak pictures.
#defineCARD_STREAK_PICTURES 3
#defineCARD_RISE_TICKS 48The card rises and grows for CARD_RISE_TICKS ticks, then shows its picture; from CARD_SHRINK_TICK it rises faster and shrinks away.
#defineCARD_SHRINK_TICK 96
#defineCARD_TILT 6000
#defineCARD_GROUND_Y 96The shards and smoke land on the ground at CARD_GROUND_Y.
#defineCARD_SHARD_TUMBLE_SPEED 32
#defineCARD_SHARD_TUMBLE_END 1024
#defineCARD_STRIKES_FROM 68The ticks the strikes run between: the Thunder Card's start first and the Bramble Card's end first.
#defineCARD_THUNDER_STRIKES_FROM 52
#defineCARD_BRAMBLE_STRIKES_FROM 60
#defineCARD_STRIKES_UNTIL 110
#defineCARD_BRAMBLE_STRIKES_UNTIL 96
#defineCARD_VINE_ANGLE 12192The vines lean CARD_VINE_ANGLE, each swaying TRIG_TURN / CARD_VINE_SWAY either way from its own phase.
#defineCARD_VINE_SWAY 16

Functions

NameDescription
voidbtEffectRunLegend (BATTLE_EFFECT_PARM *args)Legend, Excalibur's unleash: a fan of flames opens over the target until the first sword falls, while a rune, mirrored from one corner, rises and turns behind it.
voidbtEffectRunBrambleCard (BATTLE_EFFECT_PARM *args)Abilities: Bramble Card.
voidbtEffectRunFrostCard (BATTLE_EFFECT_PARM *args)Abilities: Frost Card.
voidbtEffectRunFlameCard (BATTLE_EFFECT_PARM *args)Abilities: Flame Card.
voidbtEffectRunThunderCard (BATTLE_EFFECT_PARM *args)Abilities: Thunder Card.
voidbtEffectRunElementCards (BATTLE_EFFECT_PARM *args, Sint32 mode)The cards of the four suits (Bramble, Frost, Flame and Thunder Card): a card rises from the user, spinning, swinging and growing, then shows its picture, and the background takes its colours.
voidbtEffectRunSleepCard (BATTLE_EFFECT_PARM *args)Abilities: Sleep Card.
voidbtEffectRunBaffleCard (BATTLE_EFFECT_PARM *args)Abilities: Baffle Card.
voidbtEffectRunDeathCard (BATTLE_EFFECT_PARM *args)Abilities: Death Card.
voidbtEffectRunSwordCard (BATTLE_EFFECT_PARM *args)Abilities: Sword Card.

Description

Legend, the Bramble, Frost, Flame and Thunder Cards, and the Sleep, Baffle, Death and Sword Cards' entries into their own body. Part of battle_effect.c.

Macros in detail

LEGEND_SPARK_COUNT

#define LEGEND_SPARK_COUNT 512

Legend's sparks, and the cards', are the first LEGEND_SPARK_COUNT of EXTRA_PARTICLES, 128 for each of Legend's swords; they bounce once on the ground at SPARK_GROUND_Y.

Referenced by btEffectRunElementCards() and btEffectRunLegend().

Definition at line 7 of file battle_effect_legend.c.

SPARK_GROUND_Y

#define SPARK_GROUND_Y 104

Referenced by btEffectRunElementCards() and btEffectRunLegend().

Definition at line 8 of file battle_effect_legend.c.

LEGEND_SWORD_SPARKS

#define LEGEND_SWORD_SPARKS 128

Referenced by btEffectRunLegend().

Definition at line 9 of file battle_effect_legend.c.

LEGEND_BLADE_PICTURES

#define LEGEND_BLADE_PICTURES 16384

BladeSheet's sword, point down, in the effect's pictures; it is drawn cut off at SPARK_GROUND_Y, stuck in the ground.

Referenced by btEffectRunLegend().

Definition at line 13 of file battle_effect_legend.c.

LEGEND_SWORD_WIDTH

#define LEGEND_SWORD_WIDTH 40

Referenced by btEffectRunLegend().

Definition at line 14 of file battle_effect_legend.c.

LEGEND_SWORD_HEIGHT

#define LEGEND_SWORD_HEIGHT 80

Referenced by btEffectRunLegend().

Definition at line 15 of file battle_effect_legend.c.

LEGEND_FLAME_GRADIENT

#define LEGEND_FLAME_GRADIENT 20480

Where FlameGradientTexture is decoded in the effect's pictures.

Referenced by btEffectRunLegend().

Definition at line 18 of file battle_effect_legend.c.

LEGEND_FAN_FLAMES

#define LEGEND_FAN_FLAMES 8

The fan of LEGEND_FAN_FLAMES flames, FlameGradientTexture's dark red to white, tilted LEGEND_FAN_TILT.

Referenced by btEffectRunLegend().

Definition at line 22 of file battle_effect_legend.c.

LEGEND_FAN_TILT

#define LEGEND_FAN_TILT 18384

Referenced by btEffectRunLegend().

Definition at line 23 of file battle_effect_legend.c.

LEGEND_FIRE_RING_GROWTH

#define LEGEND_FIRE_RING_GROWTH 12384

Each sword's ring of fire grows by this share of its size a tick, from half.

Referenced by btEffectRunLegend().

Definition at line 25 of file battle_effect_legend.c.

LEGEND_SWORD_INTERVAL

#define LEGEND_SWORD_INTERVAL 16

The swords set out LEGEND_SWORD_INTERVAL ticks apart; each falls from LEGEND_SWORD_FALL_TICK ticks after it sets out, rings out at LEGEND_SWORD_SOUND_TICK and strikes at LEGEND_SWORD_STRIKE_TICK.

Referenced by btEffectRunLegend().

Definition at line 30 of file battle_effect_legend.c.

LEGEND_SWORD_FALL_TICK

#define LEGEND_SWORD_FALL_TICK 50

Referenced by btEffectRunLegend().

Definition at line 31 of file battle_effect_legend.c.

LEGEND_SWORD_SOUND_TICK

#define LEGEND_SWORD_SOUND_TICK 54

Referenced by btEffectRunLegend().

Definition at line 32 of file battle_effect_legend.c.

LEGEND_SWORD_STRIKE_TICK

#define LEGEND_SWORD_STRIKE_TICK 59

Referenced by btEffectRunLegend().

Definition at line 33 of file battle_effect_legend.c.

LEGEND_SWORD_FALL_TICKS

#define LEGEND_SWORD_FALL_TICKS 12

Each sword falls for LEGEND_SWORD_FALL_TICKS ticks, from LEGEND_SWORD_START_DISTANCE pixels above and beside the target.

Referenced by btEffectRunLegend().

Definition at line 36 of file battle_effect_legend.c.

LEGEND_SWORD_START_DISTANCE

#define LEGEND_SWORD_START_DISTANCE 80

Referenced by btEffectRunLegend().

Definition at line 37 of file battle_effect_legend.c.

LEGEND_TICKS

#define LEGEND_TICKS 86

Legend's length with one sword, up to LEGEND_SWORDS_MAX of them as the variant grows; each further sword adds LEGEND_SWORD_INTERVAL.

Referenced by btEffectRunLegend().

Definition at line 40 of file battle_effect_legend.c.

LEGEND_SWORDS_MAX

#define LEGEND_SWORDS_MAX 3

Referenced by btEffectRunLegend().

Definition at line 41 of file battle_effect_legend.c.

CARD_STREAK_WIDTH

#define CARD_STREAK_WIDTH 32

A card's picture, CARD_WIDTH by CARD_HEIGHT, at its sprite sheet's start; the Bramble Card's sprite sheet has its three vines after it, 32 by 128 as JaggedStreakSheet's streaks are.

Definition at line 361 of file battle_effect_legend.c.

CARD_STREAK_HEIGHT

#define CARD_STREAK_HEIGHT 128

Definition at line 362 of file battle_effect_legend.c.

ELEMENT_CARDS_PICTURES

#define ELEMENT_CARDS_PICTURES PICTURE_BYTES(CARD)

Where the card's element pictures are decoded in the effect's pictures, after the card: CrystalSheet, FlashBurstSheet, SmokeSheet or JaggedStreakSheet.

Referenced by btEffectRunElementCards().

Definition at line 365 of file battle_effect_legend.c.

CARD_PIECES

#define CARD_PIECES 56

The state's particles: the shards, smoke or pictures the card throws, then one strike countdown for each target. Each target has its own run of the sparks, and a strike throws up the next free 16 of them. The sparks are Legend's, LEGEND_SPARK_COUNT of EXTRA_PARTICLES.

Referenced by btEffectRunElementCards().

Definition at line 370 of file battle_effect_legend.c.

CARD_STRIKE_TIMERS

#define CARD_STRIKE_TIMERS CARD_PIECES

Referenced by btEffectRunElementCards().

Definition at line 371 of file battle_effect_legend.c.

CARD_SPARKS_PER_TARGET

#define CARD_SPARKS_PER_TARGET 64

Referenced by btEffectRunElementCards().

Definition at line 372 of file battle_effect_legend.c.

CARD_STRIKE_SPARKS

#define CARD_STRIKE_SPARKS 16

Referenced by btEffectRunElementCards().

Definition at line 373 of file battle_effect_legend.c.

CARD_STRIKE_INTERVAL

#define CARD_STRIKE_INTERVAL 5

Each target is struck every CARD_STRIKE_INTERVAL ticks.

Referenced by btEffectRunElementCards().

Definition at line 375 of file battle_effect_legend.c.

CARD_STREAKS

#define CARD_STREAKS 4

The Bramble Card's vines and the Thunder Card's bolts, one from each of the card's corners, each one of the three streak pictures.

Referenced by btEffectRunElementCards().

Definition at line 378 of file battle_effect_legend.c.

CARD_STREAK_PICTURES

#define CARD_STREAK_PICTURES 3

Referenced by btEffectRunElementCards().

Definition at line 379 of file battle_effect_legend.c.

CARD_RISE_TICKS

#define CARD_RISE_TICKS 48

The card rises and grows for CARD_RISE_TICKS ticks, then shows its picture; from CARD_SHRINK_TICK it rises faster and shrinks away. It swings from side to side once every 96 ticks as it rises, and leans CARD_TILT.

Referenced by btEffectRunElementCards().

Definition at line 384 of file battle_effect_legend.c.

CARD_SHRINK_TICK

#define CARD_SHRINK_TICK 96

Referenced by btEffectRunElementCards().

Definition at line 385 of file battle_effect_legend.c.

CARD_TILT

#define CARD_TILT 6000

Referenced by btEffectRunElementCards().

Definition at line 386 of file battle_effect_legend.c.

CARD_GROUND_Y

#define CARD_GROUND_Y 96

The shards and smoke land on the ground at CARD_GROUND_Y. A Frost Card's shard starts tumbling CARD_SHARD_TUMBLE_SPEED a tick, slowing by one every other tick, and is drawn until its tumble reaches CARD_SHARD_TUMBLE_END.

Referenced by btEffectRunElementCards().

Definition at line 390 of file battle_effect_legend.c.

CARD_SHARD_TUMBLE_SPEED

#define CARD_SHARD_TUMBLE_SPEED 32

Referenced by btEffectRunElementCards().

Definition at line 391 of file battle_effect_legend.c.

CARD_SHARD_TUMBLE_END

#define CARD_SHARD_TUMBLE_END 1024

Referenced by btEffectRunElementCards().

Definition at line 392 of file battle_effect_legend.c.

CARD_STRIKES_FROM

#define CARD_STRIKES_FROM 68

The ticks the strikes run between: the Thunder Card's start first and the Bramble Card's end first.

Referenced by btEffectRunElementCards().

Definition at line 395 of file battle_effect_legend.c.

CARD_THUNDER_STRIKES_FROM

#define CARD_THUNDER_STRIKES_FROM 52

Referenced by btEffectRunElementCards().

Definition at line 396 of file battle_effect_legend.c.

CARD_BRAMBLE_STRIKES_FROM

#define CARD_BRAMBLE_STRIKES_FROM 60

Referenced by btEffectRunElementCards().

Definition at line 397 of file battle_effect_legend.c.

CARD_STRIKES_UNTIL

#define CARD_STRIKES_UNTIL 110

Referenced by btEffectRunElementCards().

Definition at line 398 of file battle_effect_legend.c.

CARD_BRAMBLE_STRIKES_UNTIL

#define CARD_BRAMBLE_STRIKES_UNTIL 96

Referenced by btEffectRunElementCards().

Definition at line 399 of file battle_effect_legend.c.

CARD_VINE_ANGLE

#define CARD_VINE_ANGLE 12192

The vines lean CARD_VINE_ANGLE, each swaying TRIG_TURN / CARD_VINE_SWAY either way from its own phase.

Referenced by btEffectRunElementCards().

Definition at line 402 of file battle_effect_legend.c.

CARD_VINE_SWAY

#define CARD_VINE_SWAY 16

Referenced by btEffectRunElementCards().

Definition at line 403 of file battle_effect_legend.c.

Functions in detail

btEffectRunLegend

void btEffectRunLegend(BATTLE_EFFECT_PARM *args)

Legend, Excalibur's unleash: a fan of flames opens over the target until the first sword falls, while a rune, mirrored from one corner, rises and turns behind it. Then one sword for each step of the variant (variant + 1 in all) falls on the target from above the user's side: it strikes, throwing sparks that bounce on the ground, while a ring of fire grows and fades where it lands.

Abilities: Legend.

References BattleEffectLargeSquareMesh, BattleEffectSquareCorners, BattleEffectTallMesh, btCameraShake(), btEffectPosProjectBattler(), btEffectStartActorMotion(), btEffectStartCanvasLayer(), btEffectTintBattler(), btParticleAdvanceWithGravity2D(), btPictureMirrorIntoQuadrants(), btRenderAllocateModelList(), btRenderDrawModelList(), btRenderTransformVertices(), btResourceLoadAndDecompress(), LegendFanFlameCorners, Sint32, syCos(), syHeapAllocateEWRAM(), syHeapRelease(), syInitMatrix(), syMatrixScaleUniform(), syRandom(), syRotX(), syRotY(), syRotZ(), syScale(), sySin(), sySoundPlayStub() and syTranslate().

Referenced by BattleEffectHandlers.

Definition at line 51 of file battle_effect_legend.c.

btEffectRunBrambleCard

void btEffectRunBrambleCard(BATTLE_EFFECT_PARM *args)

Abilities: Bramble Card.

References btEffectRunElementCards().

Referenced by BattleEffectHandlers.

Definition at line 335 of file battle_effect_legend.c.

btEffectRunFrostCard

void btEffectRunFrostCard(BATTLE_EFFECT_PARM *args)

Abilities: Frost Card.

References btEffectRunElementCards().

Referenced by BattleEffectHandlers.

Definition at line 341 of file battle_effect_legend.c.

btEffectRunFlameCard

void btEffectRunFlameCard(BATTLE_EFFECT_PARM *args)

Abilities: Flame Card.

References btEffectRunElementCards().

Referenced by BattleEffectHandlers.

Definition at line 347 of file battle_effect_legend.c.

btEffectRunThunderCard

void btEffectRunThunderCard(BATTLE_EFFECT_PARM *args)

Abilities: Thunder Card.

References btEffectRunElementCards().

Referenced by BattleEffectHandlers.

Definition at line 353 of file battle_effect_legend.c.

btEffectRunElementCards

void btEffectRunElementCards(BATTLE_EFFECT_PARM *args, Sint32 mode)

The cards of the four suits (Bramble, Frost, Flame and Thunder Card): a card rises from the user, spinning, swinging and growing, then shows its picture, and the background takes its colours. The Frost Card throws crystal shards and the Flame Card puffs of fiery smoke at the targets, while the Bramble Card's thorny vines and the Thunder Card's bolts of lightning reach out over them. Each target is struck every five ticks for a while, reeling, flashing and throwing up sparks, before the card shrinks away.

References BattleEffectBeamCorners, BattleEffectColumnMesh, BattleEffectSquareCorners, BattleEffectTallMesh, btCameraShake(), btEffectPosProjectScaledBattler(), btEffectPosProjectSprite(), btEffectStartActorMotion(), btEffectStartCanvasLayer(), btEffectStepPaletteToResource(), btEffectTintBattler(), btParticleAdvanceWithGravity2D(), btRenderAllocateModelList(), btRenderDrawModelList(), btRenderTransformVertices(), btResourceLoadAndDecompress(), ElementCardsSparkMotions, ElementCardsTicks, PrismShardHeights, PrismShardPictures, PrismShardWidths, Sint32, syCos(), syHeapAllocateEWRAM(), syHeapRelease(), syInitMatrix(), syMatrixScaleUniform(), syRandom(), syRotX(), syRotY(), syRotZ(), syScale(), sySin(), sySoundPlayStub() and syTranslate().

Referenced by btEffectRunBrambleCard(), btEffectRunFlameCard(), btEffectRunFrostCard() and btEffectRunThunderCard().

Definition at line 412 of file battle_effect_legend.c.

btEffectRunSleepCard

void btEffectRunSleepCard(BATTLE_EFFECT_PARM *args)

Abilities: Sleep Card.

References btEffectRunCards().

Referenced by BattleEffectHandlers.

Definition at line 908 of file battle_effect_legend.c.

btEffectRunBaffleCard

void btEffectRunBaffleCard(BATTLE_EFFECT_PARM *args)

Abilities: Baffle Card.

References btEffectRunCards().

Referenced by BattleEffectHandlers.

Definition at line 914 of file battle_effect_legend.c.

btEffectRunDeathCard

void btEffectRunDeathCard(BATTLE_EFFECT_PARM *args)

Abilities: Death Card.

References btEffectRunCards().

Referenced by BattleEffectHandlers.

Definition at line 920 of file battle_effect_legend.c.

btEffectRunSwordCard

void btEffectRunSwordCard(BATTLE_EFFECT_PARM *args)

Abilities: Sword Card.

References btEffectRunCards().

Referenced by BattleEffectHandlers.

Definition at line 926 of file battle_effect_legend.c.