Alchemy
Loading...
Searching...
No Matches

thor.c File Reference

The Thor summon. More...

Go to the source code of this file.

Macros

#define THOR_PARTICLES   ((struct EffectStep *)(Ram_MapCellBuffer + 0xc58))
 910 sparks from Ram_MapCellBuffer + 0xc58; the smoke pictures come before them.
#define THOR_SPRITES_CELLS   0x1800
 The particle sprites, after the light fan pictures.
#define THOR_MOTE_CELLS   0x6000
 The violet mote in the second part's sheet.
#define THOR_PARTICLE_COUNT   910
 particles in THOR_PARTICLES
#define THOR_DIMMED_DOTS   10000
 the darker copies of the dot pictures
#define THOR_DIMMED_DOT_BYTES   MOTE_SET_BYTES
 bytes in each darker copy
#define THOR_DUSK_FRAMES   170
 frames, at most, of the dusk part
#define THOR_LIGHTNING_FRAMES   192
 frames of the lightning part
#define THOR_BOLTS   30
 violet bolts after the pillar
#define THOR_BOLT_SIZE   72
 each of the three bolt pictures is 72x72
#define THOR_BOLT_BYTES   (THOR_BOLT_SIZE * THOR_BOLT_SIZE)
#define THOR_LAUNCH_SPARKS(spark, index, px, py, angleExpr, max)
 Launches up to max sparks from (px, py), 16.16, into the free slots (variant 0) of THOR_PARTICLES, walking them with spark and counting with index.

Functions

void BattleFx_RunThor (struct BattleEffectArgument *effect)
 The scene plays in two parts on the effect canvas.

Detailed Description

The Thor summon.

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

Definition in file thor.c.

Macro Definition Documentation

◆ THOR_PARTICLES

#define THOR_PARTICLES   ((struct EffectStep *)(Ram_MapCellBuffer + 0xc58))

910 sparks from Ram_MapCellBuffer + 0xc58; the smoke pictures come before them.

Definition at line 9 of file thor.c.

Referenced by BattleFx_RunThor().

◆ THOR_SPRITES_CELLS

#define THOR_SPRITES_CELLS   0x1800

The particle sprites, after the light fan pictures.

Definition at line 12 of file thor.c.

Referenced by BattleFx_RunThor().

◆ THOR_MOTE_CELLS

#define THOR_MOTE_CELLS   0x6000

The violet mote in the second part's sheet.

Definition at line 15 of file thor.c.

Referenced by BattleFx_RunThor().

◆ THOR_PARTICLE_COUNT

#define THOR_PARTICLE_COUNT   910

particles in THOR_PARTICLES

Definition at line 17 of file thor.c.

Referenced by BattleFx_RunThor().

◆ THOR_DIMMED_DOTS

#define THOR_DIMMED_DOTS   10000

the darker copies of the dot pictures

Definition at line 18 of file thor.c.

Referenced by BattleFx_RunThor().

◆ THOR_DIMMED_DOT_BYTES

#define THOR_DIMMED_DOT_BYTES   MOTE_SET_BYTES

bytes in each darker copy

Definition at line 19 of file thor.c.

Referenced by BattleFx_RunThor().

◆ THOR_DUSK_FRAMES

#define THOR_DUSK_FRAMES   170

frames, at most, of the dusk part

Definition at line 20 of file thor.c.

Referenced by BattleFx_RunThor().

◆ THOR_LIGHTNING_FRAMES

#define THOR_LIGHTNING_FRAMES   192

frames of the lightning part

Definition at line 21 of file thor.c.

Referenced by BattleFx_RunThor().

◆ THOR_BOLTS

#define THOR_BOLTS   30

violet bolts after the pillar

Definition at line 22 of file thor.c.

Referenced by BattleFx_RunThor().

◆ THOR_BOLT_SIZE

#define THOR_BOLT_SIZE   72

each of the three bolt pictures is 72x72

Definition at line 23 of file thor.c.

Referenced by BattleFx_RunThor().

◆ THOR_BOLT_BYTES

#define THOR_BOLT_BYTES   (THOR_BOLT_SIZE * THOR_BOLT_SIZE)

Definition at line 24 of file thor.c.

Referenced by BattleFx_RunThor().

◆ THOR_LAUNCH_SPARKS

#define THOR_LAUNCH_SPARKS ( spark,
index,
px,
py,
angleExpr,
max )
Value:
{ \
s32 spawned = 0; \
for (index = 0, spark = THOR_PARTICLES; index != THOR_PARTICLE_COUNT; \
index++, spark++) { \
if (spark->variant == 0) { \
\
s32 speed = 0x3ff; \
s32 angle; \
speed &= Random16(); \
angle = angleExpr; \
spark->x = px; \
spark->y = py; \
speed += 32; \
spark->velocityX = (Trig_Sin(angle) * speed) >> 7; \
spark->velocityY = -((Trig_Cos(angle) * speed) << 1) >> 7; \
spark->variant = (Random16() & 7) + 32; \
if (++spawned == (max)) { \
break; \
} \
} \
} \
}
s32 Trig_Cos(s32 angle)
s32 Trig_Sin(s32 angle)
u32 Random16(void)
Advances the game's random number generator (the C library's classic linear congruential one),...
Definition math.c:10
#define THOR_PARTICLE_COUNT
particles in THOR_PARTICLES
Definition thor.c:17
#define THOR_PARTICLES
910 sparks from Ram_MapCellBuffer + 0xc58; the smoke pictures come before them.
Definition thor.c:9
signed int s32
Definition types.h:14

Launches up to max sparks from (px, py), 16.16, into the free slots (variant 0) of THOR_PARTICLES, walking them with spark and counting with index.

Each flies at angle at a random speed of 32 to 1054 (128ths of a pixel a frame) and lives 32 to 39 frames. Used for the pillar's 512 sparks and each bolt's 16; the mote's sparks are launched inline.

Definition at line 31 of file thor.c.

Referenced by BattleFx_RunThor().

Function Documentation

◆ BattleFx_RunThor()

void BattleFx_RunThor ( struct BattleEffectArgument * effect)

The scene plays in two parts on the effect canvas.

Abilities: Thor (scene kind 12).

In the dusk part (THOR_DUSK_FRAMES, which A or B cuts short) a circle of 128 dots and three lines across it form over scrolling dusk clouds; the circle turns, sinks into the sky and a beam of light falls from it. In the lightning part (THOR_LIGHTNING_FRAMES) a pillar of lightning strikes the formation and throws sparks, THOR_BOLTS violet bolts follow while a violet mote sways above, and the formation is pushed back in smoke until an impact burst ends the effect. The sparks live in THOR_PARTICLES; a spark whose variant is 0 is free, and a positive variant counts the frames it has left.

Definition at line 68 of file thor.c.

Referenced by BattleFx_RunSceneEffect(), and BattleFx_RunThor().