Alchemy
Loading...
Searching...
No Matches

falling.c File Reference

Ice and Douse: shards and bolts falling on the targets' side. More...

Go to the source code of this file.

Data Structures

struct  BoltSparkBuffer
 Ram_MapCellBuffer as the falling bolts use it: window 0's scanline table, then the bolts' sparks. More...

Macros

#define FALLING_BUILD_SLANTED_WINDOW(line, i, last, slant, span)
 Fills window 0's per-scanline edges for the falling shards and bolts: lines 8 to last take slant, an expression of the line i; the rest of the battle view, down to line 135, takes the fixed span; and the lines below it are empty.
#define FALLING_LAND_Y   0x27f
 A falling shard or bolt keeps falling while its y (in eighths of a pixel) is at most this, just above 80 pixels.
#define FALLING_BOLT_SPARKS   ((struct BoltSparkBuffer *)Ram_MapCellBuffer)
 Ram_MapCellBuffer seen as Douse's struct BoltSparkBuffer.
#define DOUSE_FALLING_CELL   0x604
 the falling bolt picture in the sheet
#define DOUSE_FLASH_CELL   0x844
 the landing flash picture in the sheet
#define DOUSE_BURST_CELL   0xa84
 the 42x42 burst picture in the sheet

Enumerations

enum  { FALLING_SHARD_COUNT = 32 , FALLING_SHARD_PUFF_COUNT = 32 }
 Ice keeps its shards in work->particles 0 to 31 and their puffs in 32 to 63. More...
enum  { FALLING_BOLT_COUNT = 64 , FALLING_BOLT_SPARK_COUNT = 512 }
 Douse's bolts are work->particles 0 to 63; their sparks follow window 0's scanline table in Ram_MapCellBuffer. More...

Functions

void BattleFx_RunIce (struct BattleEffectArgument *effect)
 Ice shards rain down diagonally onto the targets' side of the field and shatter into puffs of sparkle, flashing and shaking each target as they land.
void BattleFx_RunDouse (struct BattleEffectArgument *effect)
 Blue bolts streak down diagonally onto the targets' side of the field, each bursting into a fountain of falling sparks where it lands, while the targets flash.

Detailed Description

Ice and Douse: shards and bolts falling on the targets' side.

Part of effect.c, the battle effect object, compiled only through it.

Definition in file falling.c.

Macro Definition Documentation

◆ FALLING_BUILD_SLANTED_WINDOW

#define FALLING_BUILD_SLANTED_WINDOW ( line,
i,
last,
slant,
span )
Value:
for ((i) = 0; (i) != 160; (i)++) { \
if ((i) >= 8 && (i) <= (last)) \
(line)[i] = (slant); \
else if ((i) <= 135) \
(line)[i] = (span); \
else \
(line)[i] = WINDOW_SPAN_INVERTED; \
}
#define WINDOW_SPAN_INVERTED
A WIN0H value whose left edge is past its right edge.

Fills window 0's per-scanline edges for the falling shards and bolts: lines 8 to last take slant, an expression of the line i; the rest of the battle view, down to line 135, takes the fixed span; and the lines below it are empty.

Every band the effects pass is 128 pixels wide.

Definition at line 11 of file falling.c.

Referenced by BattleFx_RunDouse(), and BattleFx_RunIce().

◆ FALLING_LAND_Y

#define FALLING_LAND_Y   0x27f

A falling shard or bolt keeps falling while its y (in eighths of a pixel) is at most this, just above 80 pixels.

Definition at line 39 of file falling.c.

Referenced by BattleFx_RunDouse(), and BattleFx_RunIce().

◆ FALLING_BOLT_SPARKS

#define FALLING_BOLT_SPARKS   ((struct BoltSparkBuffer *)Ram_MapCellBuffer)

Ram_MapCellBuffer seen as Douse's struct BoltSparkBuffer.

Definition at line 263 of file falling.c.

Referenced by BattleFx_RunDouse().

◆ DOUSE_FALLING_CELL

#define DOUSE_FALLING_CELL   0x604

the falling bolt picture in the sheet

Definition at line 265 of file falling.c.

Referenced by BattleFx_RunDouse().

◆ DOUSE_FLASH_CELL

#define DOUSE_FLASH_CELL   0x844

the landing flash picture in the sheet

Definition at line 266 of file falling.c.

Referenced by BattleFx_RunDouse().

◆ DOUSE_BURST_CELL

#define DOUSE_BURST_CELL   0xa84

the 42x42 burst picture in the sheet

Definition at line 267 of file falling.c.

Referenced by BattleFx_RunDouse().

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

Ice keeps its shards in work->particles 0 to 31 and their puffs in 32 to 63.

Enumerator
FALLING_SHARD_COUNT 
FALLING_SHARD_PUFF_COUNT 

Definition at line 35 of file falling.c.

◆ anonymous enum

anonymous enum

Douse's bolts are work->particles 0 to 63; their sparks follow window 0's scanline table in Ram_MapCellBuffer.

Enumerator
FALLING_BOLT_COUNT 
FALLING_BOLT_SPARK_COUNT 

Definition at line 253 of file falling.c.

Function Documentation

◆ BattleFx_RunIce()

void BattleFx_RunIce ( struct BattleEffectArgument * effect)

Ice shards rain down diagonally onto the targets' side of the field and shatter into puffs of sparkle, flashing and shaking each target as they land.

Abilities: Ice, Ice Horn, Ice Missile (kind 7).

The canvas shows only inside a slanted band of window 0, so the shards stream out of the sky above the targets. effect->variant picks the size of the volley from gFalling_IceCounts (shards and frames: 16 for 46 frames, 20 for 52, 32 for 80); variant 1 leaves longer trails and variant 2 draws additively. effect->side is 1 when the targets are the party, 0 when they are enemies.

Definition at line 53 of file falling.c.

Referenced by BattleFx_RunIce().

◆ BattleFx_RunDouse()

void BattleFx_RunDouse ( struct BattleEffectArgument * effect)

Blue bolts streak down diagonally onto the targets' side of the field, each bursting into a fountain of falling sparks where it lands, while the targets flash.

Abilities: Douse, Drench, Deluge (kind 9).

Like the falling shards, the canvas shows only inside a slanted band of window 0. effect->variant picks the volley from gFalling_Counts: 6 bolts of 8 sparks, 8 of 16 or 32 of 4, spaced 32, 24 or 8 pixels apart, over 80 frames; it also picks how the canvas fades (see below). effect->side is 1 when the targets are the party, 0 when they are enemies.

Definition at line 280 of file falling.c.

Referenced by BattleFx_RunDouse().