Skip to Content
The Alchemy Project

src/battle_effect/battle_effect_thor.c

The Thor summon. More…

Included by battle_effect.c.

Macros

NameDescription
#defineTHOR_OPENING_TICKS 170ticks of the ring, triangle and beam
#defineTHOR_STORM_TICKS 128ticks of the pillar, Thor and his bolts
#defineTHOR_BEAM_TICK 151The opening's beam of light, and the storm's bolts
#defineTHOR_BOLTS_TICK 80
#defineTHOR_PARTICLESThe sparks, from the first word after the glint pictures that draw the crackles of lightning.
#defineTHOR_SPARK_COUNT 910
#defineTHOR_PILLAR_SPARKS 512The sparks the pillar of lightning throws up from its foot, each bolt throws out, and the glow at Thor's hammer sheds each tick; a spark's mote shrinks a size for each THOR_SPARK_SHRINK_TICKS of its life it loses.
#defineTHOR_BOLT_SPARKS 16
#defineTHOR_HAMMER_GLOW_SPARKS 4
#defineTHOR_SPARK_SHRINK_TICKS 16
#defineTHOR_SPRITE_PICTURES 6144The particle sprites, after the light fan pictures.
#defineTHOR_HAMMER_GLOW_PICTURE 24576The glow that flickers about the head of Thor's hammer while his bolts strike (RESOURCE_VIOLET_MOTE_SHEET's picture, after the second part's sprite sheet), a quarter drawn four times mirrored.
#defineTHOR_HAMMER_GLOW_PICTURE_HEIGHT 24
#defineTHOR_LIGHT_FAN_WIDTH 32The light fan, at the first part's sprite sheet start, drawn twice mirrored.
#defineTHOR_LIGHT_FAN_HEIGHT 96
#defineTHOR_BOLT_WIDTH 72The second part's sprite sheet: the pillar of lightning in two pictures, then the bolts.
#defineTHOR_BOLT_HEIGHT 72
#defineTHOR_DIMMED_MOTES 10000Where Thor keeps the dimmed copies of the mote pictures in its sprite sheet, which its ring darkens through once the beam has fallen.
#defineTHOR_SPRITES 9Thor's sprites, in SUMMON_FORMATION_THOR
#defineTHOR_CANVAS_CENTER_X (CANVAS_SIZE / 2)The canvas point a projected (0, 0) is drawn at; the canvas is shown at twice its width, so a projected x is halved first.
#defineTHOR_CANVAS_CENTER_Y 60
#defineTHOR_RING_RADIUS 96The ring of motes, and the three lines across it, between the points of ThorPoints, measured from the corner of the ring's square.
#defineTHOR_RING_MOTES 128
#defineTHOR_LINE_MOTES 48
#defineTHOR_LINES_TICK 64
#defineTHOR_BEAM_FLASH_LEVEL 26The level the canvas is left at the tick before the beam falls: the sky flashes.
#defineTHOR_BEAM_WIDTH 32The beam of light: a ramp of levels THOR_BEAM_WIDTH wide, brightest in its middle, down from THOR_BEAM_TOP, its tip narrowing a pixel each side a row over THOR_BEAM_TIP_ROWS rows, and THOR_BEAM_SPEED rows longer each tick; it narrows a pixel each side a tick after its first.
#defineTHOR_BEAM_X ((CANVAS_SIZE - THOR_BEAM_WIDTH) / 2)
#defineTHOR_BEAM_TOP 16
#defineTHOR_BEAM_TIP_ROWS 9
#defineTHOR_BEAM_SPEED 20
#defineTHOR_BEAM_LAST_TICK (THOR_BEAM_TICK + 16)
#defineTHOR_PILLAR_INTERVAL 128A dead loop's step between pillars of lightning, of which Thor strikes one, THOR_PILLAR_TICK ticks into the storm.
#defineTHOR_PILLAR_TICK 8
#defineTHOR_BOLTS 18Bolts, one each 2 ticks from THOR_BOLTS_TICK.
#defineTHOR_FLASHES 6The canvas flashes, one each 8 ticks from then.
#defineTHOR_BOLT_FLASH_LEVEL 16The level each flash fills the canvas to.
#defineTHOR_CRACKLE_RADIUS_X 8The crackles of lightning around Thor: within 8 pixels across and 40 up and down of him.
#defineTHOR_CRACKLE_RADIUS_Y 40
#defineTHOR_STRAY_PARTICLES 16The first particles of the effect's state, which the storm fills with random offsets and nothing in Thor reads.
#defineTHOR_LAUNCH_SPARKS (spark, index, startX, startY, angleExpr, max)Launches up to max sparks from a point, each at angle at a random speed.

Functions

NameDescription
voidbtEffectRunThor (BATTLE_EFFECT_PARM *args)Over scrolling dusk clouds a ring with a triangle across it draws itself and turns, its colours cycling, then tips flat, sinks into the sky and sends down a beam of light; then a pillar of lightning strikes the targets, Thor appears in a spray of sparks, bolts of lightning from his hammer strike the targets again and again, and Thor drifts back in crackling lightning.

Description

The Thor summon. Part of battle_effect.c.

Macros in detail

THOR_OPENING_TICKS

#define THOR_OPENING_TICKS 170

ticks of the ring, triangle and beam

Referenced by btEffectRunThor().

Definition at line 3 of file battle_effect_thor.c.

THOR_STORM_TICKS

#define THOR_STORM_TICKS 128

ticks of the pillar, Thor and his bolts

Referenced by btEffectRunThor().

Definition at line 4 of file battle_effect_thor.c.

THOR_BEAM_TICK

#define THOR_BEAM_TICK 151

The opening's beam of light, and the storm's bolts

Referenced by btEffectRunThor().

Definition at line 5 of file battle_effect_thor.c.

THOR_BOLTS_TICK

#define THOR_BOLTS_TICK 80

Referenced by btEffectRunThor().

Definition at line 6 of file battle_effect_thor.c.

THOR_PARTICLES

#define THOR_PARTICLES

The sparks, from the first word after the glint pictures that draw the crackles of lightning.

Referenced by btEffectRunThor().

Definition at line 10 of file battle_effect_thor.c.

THOR_SPARK_COUNT

#define THOR_SPARK_COUNT 910

Referenced by btEffectRunThor().

Definition at line 12 of file battle_effect_thor.c.

THOR_PILLAR_SPARKS

#define THOR_PILLAR_SPARKS 512

The sparks the pillar of lightning throws up from its foot, each bolt throws out, and the glow at Thor's hammer sheds each tick; a spark's mote shrinks a size for each THOR_SPARK_SHRINK_TICKS of its life it loses.

Referenced by btEffectRunThor().

Definition at line 16 of file battle_effect_thor.c.

THOR_BOLT_SPARKS

#define THOR_BOLT_SPARKS 16

Referenced by btEffectRunThor().

Definition at line 17 of file battle_effect_thor.c.

THOR_HAMMER_GLOW_SPARKS

#define THOR_HAMMER_GLOW_SPARKS 4

Referenced by btEffectRunThor().

Definition at line 18 of file battle_effect_thor.c.

THOR_SPARK_SHRINK_TICKS

#define THOR_SPARK_SHRINK_TICKS 16

Referenced by btEffectRunThor().

Definition at line 19 of file battle_effect_thor.c.

THOR_SPRITE_PICTURES

#define THOR_SPRITE_PICTURES 6144

The particle sprites, after the light fan pictures.

Referenced by btEffectRunThor().

Definition at line 22 of file battle_effect_thor.c.

THOR_HAMMER_GLOW_PICTURE

#define THOR_HAMMER_GLOW_PICTURE 24576

The glow that flickers about the head of Thor's hammer while his bolts strike (RESOURCE_VIOLET_MOTE_SHEET's picture, after the second part's sprite sheet), a quarter drawn four times mirrored.

Referenced by btEffectRunThor().

Definition at line 27 of file battle_effect_thor.c.

THOR_HAMMER_GLOW_PICTURE_HEIGHT

#define THOR_HAMMER_GLOW_PICTURE_HEIGHT 24

Referenced by btEffectRunThor().

Definition at line 28 of file battle_effect_thor.c.

THOR_LIGHT_FAN_WIDTH

#define THOR_LIGHT_FAN_WIDTH 32

The light fan, at the first part's sprite sheet start, drawn twice mirrored.

Referenced by btEffectRunThor().

Definition at line 30 of file battle_effect_thor.c.

THOR_LIGHT_FAN_HEIGHT

#define THOR_LIGHT_FAN_HEIGHT 96

Referenced by btEffectRunThor().

Definition at line 31 of file battle_effect_thor.c.

THOR_BOLT_WIDTH

#define THOR_BOLT_WIDTH 72

The second part's sprite sheet: the pillar of lightning in two pictures, then the bolts.

Referenced by btEffectRunThor().

Definition at line 34 of file battle_effect_thor.c.

THOR_BOLT_HEIGHT

#define THOR_BOLT_HEIGHT 72

Referenced by btEffectRunThor().

Definition at line 35 of file battle_effect_thor.c.

THOR_DIMMED_MOTES

#define THOR_DIMMED_MOTES 10000

Where Thor keeps the dimmed copies of the mote pictures in its sprite sheet, which its ring darkens through once the beam has fallen.

Referenced by btEffectRunThor().

Definition at line 39 of file battle_effect_thor.c.

THOR_SPRITES

#define THOR_SPRITES 9

Thor's sprites, in SUMMON_FORMATION_THOR

Referenced by btEffectRunThor().

Definition at line 41 of file battle_effect_thor.c.

THOR_CANVAS_CENTER_X

#define THOR_CANVAS_CENTER_X (CANVAS_SIZE / 2)

The canvas point a projected (0, 0) is drawn at; the canvas is shown at twice its width, so a projected x is halved first.

Referenced by btEffectRunThor().

Definition at line 45 of file battle_effect_thor.c.

THOR_CANVAS_CENTER_Y

#define THOR_CANVAS_CENTER_Y 60

Referenced by btEffectRunThor().

Definition at line 46 of file battle_effect_thor.c.

THOR_RING_RADIUS

#define THOR_RING_RADIUS 96

The ring of motes, and the three lines across it, between the points of ThorPoints, measured from the corner of the ring's square. Each line draws four motes a tick from THOR_LINES_TICK, the next starting when one is whole.

Referenced by btEffectRunThor().

Definition at line 51 of file battle_effect_thor.c.

THOR_RING_MOTES

#define THOR_RING_MOTES 128

Referenced by btEffectRunThor().

Definition at line 52 of file battle_effect_thor.c.

THOR_LINE_MOTES

#define THOR_LINE_MOTES 48

Referenced by btEffectRunThor().

Definition at line 53 of file battle_effect_thor.c.

THOR_LINES_TICK

#define THOR_LINES_TICK 64

Referenced by btEffectRunThor().

Definition at line 54 of file battle_effect_thor.c.

THOR_BEAM_FLASH_LEVEL

#define THOR_BEAM_FLASH_LEVEL 26

The level the canvas is left at the tick before the beam falls: the sky flashes.

Referenced by btEffectRunThor().

Definition at line 58 of file battle_effect_thor.c.

THOR_BEAM_WIDTH

#define THOR_BEAM_WIDTH 32

The beam of light: a ramp of levels THOR_BEAM_WIDTH wide, brightest in its middle, down from THOR_BEAM_TOP, its tip narrowing a pixel each side a row over THOR_BEAM_TIP_ROWS rows, and THOR_BEAM_SPEED rows longer each tick; it narrows a pixel each side a tick after its first.

Referenced by btEffectRunThor().

Definition at line 63 of file battle_effect_thor.c.

THOR_BEAM_X

#define THOR_BEAM_X ((CANVAS_SIZE - THOR_BEAM_WIDTH) / 2)

Referenced by btEffectRunThor().

Definition at line 64 of file battle_effect_thor.c.

THOR_BEAM_TOP

#define THOR_BEAM_TOP 16

Referenced by btEffectRunThor().

Definition at line 65 of file battle_effect_thor.c.

THOR_BEAM_TIP_ROWS

#define THOR_BEAM_TIP_ROWS 9

Referenced by btEffectRunThor().

Definition at line 66 of file battle_effect_thor.c.

THOR_BEAM_SPEED

#define THOR_BEAM_SPEED 20

Referenced by btEffectRunThor().

Definition at line 67 of file battle_effect_thor.c.

THOR_BEAM_LAST_TICK

#define THOR_BEAM_LAST_TICK (THOR_BEAM_TICK + 16)

Referenced by btEffectRunThor().

Definition at line 68 of file battle_effect_thor.c.

THOR_PILLAR_INTERVAL

#define THOR_PILLAR_INTERVAL 128

A dead loop's step between pillars of lightning, of which Thor strikes one, THOR_PILLAR_TICK ticks into the storm.

Referenced by btEffectRunThor().

Definition at line 72 of file battle_effect_thor.c.

THOR_PILLAR_TICK

#define THOR_PILLAR_TICK 8

Referenced by btEffectRunThor().

Definition at line 73 of file battle_effect_thor.c.

THOR_BOLTS

#define THOR_BOLTS 18

Bolts, one each 2 ticks from THOR_BOLTS_TICK.

Referenced by btEffectRunThor().

Definition at line 76 of file battle_effect_thor.c.

THOR_FLASHES

#define THOR_FLASHES 6

The canvas flashes, one each 8 ticks from then.

Referenced by btEffectRunThor().

Definition at line 78 of file battle_effect_thor.c.

THOR_BOLT_FLASH_LEVEL

#define THOR_BOLT_FLASH_LEVEL 16

The level each flash fills the canvas to.

Referenced by btEffectRunThor().

Definition at line 80 of file battle_effect_thor.c.

THOR_CRACKLE_RADIUS_X

#define THOR_CRACKLE_RADIUS_X 8

The crackles of lightning around Thor: within 8 pixels across and 40 up and down of him.

Referenced by btEffectRunThor().

Definition at line 84 of file battle_effect_thor.c.

THOR_CRACKLE_RADIUS_Y

#define THOR_CRACKLE_RADIUS_Y 40

Referenced by btEffectRunThor().

Definition at line 85 of file battle_effect_thor.c.

THOR_STRAY_PARTICLES

#define THOR_STRAY_PARTICLES 16

The first particles of the effect's state, which the storm fills with random offsets and nothing in Thor reads.

Referenced by btEffectRunThor().

Definition at line 89 of file battle_effect_thor.c.

THOR_LAUNCH_SPARKS

#define THOR_LAUNCH_SPARKS(spark, index, startX, startY, angleExpr, max)

Launches up to max sparks from a point, each at angle at a random speed.

Referenced by btEffectRunThor().

Definition at line 92 of file battle_effect_thor.c.

Functions in detail

btEffectRunThor

void btEffectRunThor(BATTLE_EFFECT_PARM *args)

Over scrolling dusk clouds a ring with a triangle across it draws itself and turns, its colours cycling, then tips flat, sinks into the sky and sends down a beam of light; then a pillar of lightning strikes the targets, Thor appears in a spray of sparks, bolts of lightning from his hammer strike the targets again and again, and Thor drifts back in crackling lightning.

Abilities: Thor.

References BattleEffectGlintPictureHeights, BattleEffectGlintPictures, BattleEffectGlintPictureWidths, BattleEffectMotePictures, btBackgroundLoadStub(), btCameraShake(), btCanvasBlitMirroredQuarters(), btEffectAdvanceScrollOnInterval(), btEffectConfigureEffectDisplay(), btEffectCreateSprites(), btEffectEndCanvasLayer(), btEffectPlaceFormationSprites(), btEffectPosProjectPoint(), btEffectRunImpactBurst(), btEffectSetupBlendedDisplay(), btEffectShowLivingTargets(), btEffectStepPaletteToResource(), btEffectTintBattler(), btEffectTransferCanvas(), btEffectWipeCanvas(), btMotionApplyKnockbackStub(), btParticleAdvanceWithGravity2D(), btResourceLoadAndDecompress(), fdSpriteDestroyStub(), PerWork, ProjectionWork, Sint32, syCloseEvent(), syCos(), syDivFX(), syHeapSlotRelease(), syInitMatrix(), syMatrixScaleVector(), syMatrixTranslateVector(), syRandom(), syResourceGetTableEntry(), syRotX(), syRotY(), syRotZ(), sySetEvent(), sySetScreenDist(), sySin(), sySoundPlayStub(), syWordsCopy(), ThorCrackleFlips, ThorPoints and ThorTargetPalettes.

Referenced by btEffectRunSummon().

Definition at line 122 of file battle_effect_thor.c.