Skip to Content
The Alchemy Project

src/battle_effect/battle_effect_cards.c

The Sleep, Baffle, Death and Sword Cards. More…

Included by battle_effect.c.

Macros

NameDescription
#defineRED_CRESCENT_BYTESThe Death Card's RedCrescentSheetA, decoded at the start of the map cell buffer: its four pictures' bytes.
#defineCARD (MapGridMetatileBuffer + RED_CRESCENT_BYTES)The card's picture, CARD_WIDTH by CARD_HEIGHT, in the map cell buffer after the crescent's; SheepCardSheet's four sheep follow it.
#defineCARD_SHEEP
#defineCARD_DISSOLVE_STEPS (CARD + CARD_WIDTH * CARD_HEIGHT)After the Death and Sword cards' pictures: the particle of the dissolve, 0 to 15, at which each pixel clears, for eight rows repeated down the card.
#defineCARD_FLIGHT_TICKS 48The card flies to the targets for CARD_FLIGHT_TICKS, turning back a CARD_SPIN a tick about its face and its width; it would stand square at CARD_SQUARE_TICK, and arrives a sixteenth of a turn short of it.
#defineCARD_SQUARE_TICK 52
#defineCARD_SPIN (TRIG_TURN / 64)
#defineCARD_SLANT 6000The card's turn about its upright axis, about 33 degrees.
#defineCARD_SHOWN_TICKS 80The ticks the card is drawn: the Sleep Card's past the effect's end, the Sword Card's until its dagger strikes.
#defineSLEEP_CARD_SHOWN_TICKS 120
#defineCARD_DISSOLVE_TICKS 16The Death and Sword cards dissolve a particle a tick from CARD_FLIGHT_TICKS.
#defineREAPER_RISE_TICK 52The Death Card's Reaper rises from REAPER_RISE_TICK and swings at REAPER_SWING_TICK; two ticks of flash, then the red crescent and its four fading pictures, two ticks each.
#defineREAPER_SWING_TICK 64
#defineBAFFLE_PUFF_TICKS 16Each puff of the Baffle Card's mist lives BAFFLE_PUFF_TICKS, through BlueCloudPuffSheet's four pictures.
#defineSHEEP_TICKS 64Each sheep tumbles out of the Sleep Card for SHEEP_TICKS, through its four pictures every 16 ticks.
#defineSWORD_CARD_DAGGER_TICKS 24The Sword Card's dagger glints over the target for SWORD_CARD_DAGGER_TICKS, then strikes and SWORD_CARD_PARTICLES fly, of which SWORD_CARD_SHARDS are drawn as shards for SWORD_CARD_SHARD_TICKS, a copy darker every four ticks after the first four.
#defineSWORD_CARD_PARTICLES 64
#defineSWORD_CARD_SHARDS 32
#defineSWORD_CARD_SHARD_TICKS 36
#defineSWORD_CARD_SHARD_TOP 48
#defineSWORD_CARD_SHARD_SPEED 64
#defineSWORD_CARD_SHARD_DIMMING 6Each darker copy of the stat reduction's shard pictures (STAT_REDUCTION_SHARD_PICTURES) is this many levels darker than the one before, but never blank.

Functions

NameDescription
voidbtEffectRunCards (BATTLE_EFFECT_PARM *args, Sint32 mode)The four cards (Sleep, Baffle, Death and Sword Card): a card flies from the user to above the targets' middle, spinning upright and growing, and the background scrolls with it as far as it can.

Description

The Sleep, Baffle, Death and Sword Cards. Part of battle_effect.c.

Macros in detail

RED_CRESCENT_BYTES

#define RED_CRESCENT_BYTES

The Death Card's RedCrescentSheetA, decoded at the start of the map cell buffer: its four pictures' bytes.

Definition at line 5 of file battle_effect_cards.c.

CARD

#define CARD (MapGridMetatileBuffer + RED_CRESCENT_BYTES)

The card's picture, CARD_WIDTH by CARD_HEIGHT, in the map cell buffer after the crescent's; SheepCardSheet's four sheep follow it. CARD_SHEEP reaches the same buffer by its fixed address.

Referenced by btEffectRunCards(), btEffectRunElementCards() and btEffectRunSleep().

Definition at line 10 of file battle_effect_cards.c.

CARD_SHEEP

#define CARD_SHEEP

Referenced by btEffectRunCards().

Definition at line 11 of file battle_effect_cards.c.

CARD_DISSOLVE_STEPS

#define CARD_DISSOLVE_STEPS (CARD + CARD_WIDTH * CARD_HEIGHT)

After the Death and Sword cards' pictures: the particle of the dissolve, 0 to 15, at which each pixel clears, for eight rows repeated down the card.

Referenced by btEffectRunCards().

Definition at line 15 of file battle_effect_cards.c.

CARD_FLIGHT_TICKS

#define CARD_FLIGHT_TICKS 48

The card flies to the targets for CARD_FLIGHT_TICKS, turning back a CARD_SPIN a tick about its face and its width; it would stand square at CARD_SQUARE_TICK, and arrives a sixteenth of a turn short of it.

Referenced by btEffectRunCards().

Definition at line 20 of file battle_effect_cards.c.

CARD_SQUARE_TICK

#define CARD_SQUARE_TICK 52

Referenced by btEffectRunCards().

Definition at line 21 of file battle_effect_cards.c.

CARD_SPIN

#define CARD_SPIN (TRIG_TURN / 64)

Referenced by btEffectRunCards().

Definition at line 22 of file battle_effect_cards.c.

CARD_SLANT

#define CARD_SLANT 6000

The card's turn about its upright axis, about 33 degrees.

Referenced by btEffectRunCards().

Definition at line 24 of file battle_effect_cards.c.

CARD_SHOWN_TICKS

#define CARD_SHOWN_TICKS 80

The ticks the card is drawn: the Sleep Card's past the effect's end, the Sword Card's until its dagger strikes.

Referenced by btEffectRunCards().

Definition at line 27 of file battle_effect_cards.c.

SLEEP_CARD_SHOWN_TICKS

#define SLEEP_CARD_SHOWN_TICKS 120

Referenced by btEffectRunCards().

Definition at line 28 of file battle_effect_cards.c.

CARD_DISSOLVE_TICKS

#define CARD_DISSOLVE_TICKS 16

The Death and Sword cards dissolve a particle a tick from CARD_FLIGHT_TICKS.

Referenced by btEffectRunCards().

Definition at line 30 of file battle_effect_cards.c.

REAPER_RISE_TICK

#define REAPER_RISE_TICK 52

The Death Card's Reaper rises from REAPER_RISE_TICK and swings at REAPER_SWING_TICK; two ticks of flash, then the red crescent and its four fading pictures, two ticks each.

Referenced by btEffectRunCards().

Definition at line 35 of file battle_effect_cards.c.

REAPER_SWING_TICK

#define REAPER_SWING_TICK 64

Referenced by btEffectRunCards().

Definition at line 36 of file battle_effect_cards.c.

BAFFLE_PUFF_TICKS

#define BAFFLE_PUFF_TICKS 16

Each puff of the Baffle Card's mist lives BAFFLE_PUFF_TICKS, through BlueCloudPuffSheet's four pictures.

Referenced by btEffectRunCards().

Definition at line 40 of file battle_effect_cards.c.

SHEEP_TICKS

#define SHEEP_TICKS 64

Each sheep tumbles out of the Sleep Card for SHEEP_TICKS, through its four pictures every 16 ticks.

Referenced by btEffectRunCards().

Definition at line 43 of file battle_effect_cards.c.

SWORD_CARD_DAGGER_TICKS

#define SWORD_CARD_DAGGER_TICKS 24

The Sword Card's dagger glints over the target for SWORD_CARD_DAGGER_TICKS, then strikes and SWORD_CARD_PARTICLES fly, of which SWORD_CARD_SHARDS are drawn as shards for SWORD_CARD_SHARD_TICKS, a copy darker every four ticks after the first four. The shards start one a line from SWORD_CARD_SHARD_TOP, down the dagger, and the slowest flies SWORD_CARD_SHARD_SPEED, a pixel a tick in 64ths.

Referenced by btEffectRunCards().

Definition at line 51 of file battle_effect_cards.c.

SWORD_CARD_PARTICLES

#define SWORD_CARD_PARTICLES 64

Referenced by btEffectRunCards().

Definition at line 52 of file battle_effect_cards.c.

SWORD_CARD_SHARDS

#define SWORD_CARD_SHARDS 32

Referenced by btEffectRunCards().

Definition at line 53 of file battle_effect_cards.c.

SWORD_CARD_SHARD_TICKS

#define SWORD_CARD_SHARD_TICKS 36

Referenced by btEffectRunCards().

Definition at line 54 of file battle_effect_cards.c.

SWORD_CARD_SHARD_TOP

#define SWORD_CARD_SHARD_TOP 48

Referenced by btEffectRunCards().

Definition at line 55 of file battle_effect_cards.c.

SWORD_CARD_SHARD_SPEED

#define SWORD_CARD_SHARD_SPEED 64

Referenced by btEffectRunCards().

Definition at line 56 of file battle_effect_cards.c.

SWORD_CARD_SHARD_DIMMING

#define SWORD_CARD_SHARD_DIMMING 6

Each darker copy of the stat reduction's shard pictures (STAT_REDUCTION_SHARD_PICTURES) is this many levels darker than the one before, but never blank.

Referenced by btEffectRunCards().

Definition at line 60 of file battle_effect_cards.c.

Functions in detail

btEffectRunCards

void btEffectRunCards(BATTLE_EFFECT_PARM *args, Sint32 mode)

The four cards (Sleep, Baffle, Death and Sword Card): a card flies from the user to above the targets' middle, spinning upright and growing, and the background scrolls with it as far as it can. Then its picture comes to life: sheep tumble out of the Sleep Card; a mist pours from the Baffle Card and spreads over the ground while the screen waves; the Death and Sword cards dissolve, and the Reaper rises and swings his scythe in a red crescent, or a dagger glints, strikes and breaks into shards. The screen fades in the last eight ticks.

References BattleEffectSquareCorners, BattleEffectTallMesh, btCameraShake(), btEffectArmBg2AffineHBlankDMA(), btEffectGetTargetsMidpoint(), btEffectPosProjectSprite(), btEffectStartActorMotion(), btEffectStartTiledCanvas(), btEffectStartTiledCanvasFilled(), btEffectStepPaletteToResource(), btEffectTintBattler(), btParticleAdvanceWithGravity2D(), btRenderAllocateModelList(), btRenderDrawModelList(), btRenderTransformVertices(), btResourceLoadAndDecompress(), ReaperPictureX, ReaperPictureY, Sint32, StatChangeShardHeights, StatChangeShardPictures, StatChangeShardWidths, syCloseEvent(), syCos(), syHeapAllocateEWRAM(), syHeapRelease(), syInitMatrix(), syMatrixScaleUniform(), syRandom(), syRotX(), syRotY(), syRotZ(), syScale(), sySetEvent(), sySin(), sySoundPlayStub() and syTranslate().

Referenced by btEffectRunBaffleCard(), btEffectRunDeathCard(), btEffectRunSleepCard() and btEffectRunSwordCard().

Definition at line 70 of file battle_effect_cards.c.