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 192Ticks 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_SINK_TICK 128The ring tips flat and sinks into the sky after THOR_SINK_TICK.
#defineTHOR_APPEAR_TICK 16Thor appears over the targets at THOR_APPEAR_TICK of the storm and is pushed back from THOR_PUSH_TICK; the damage shows at THOR_DAMAGE_TICK.
#defineTHOR_PUSH_TICK 32
#defineTHOR_DAMAGE_TICK 140
#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_WIDTH 12
#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 its dimmed copies of the mote pictures in its sprite sheet; its ring darkens through them 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 lineEnds, 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 floods with light.
#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 30Violet bolts, one each 2 ticks on 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, violet bolts 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 4 of file battle_effect_thor.c.

THOR_STORM_TICKS

#define THOR_STORM_TICKS 192

Ticks of the pillar, Thor and his bolts.

Referenced by btEffectRunThor().

Definition at line 6 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 8 of file battle_effect_thor.c.

THOR_BOLTS_TICK

#define THOR_BOLTS_TICK 80

Referenced by btEffectRunThor().

Definition at line 9 of file battle_effect_thor.c.

THOR_SINK_TICK

#define THOR_SINK_TICK 128

The ring tips flat and sinks into the sky after THOR_SINK_TICK.

Referenced by btEffectRunThor().

Definition at line 11 of file battle_effect_thor.c.

THOR_APPEAR_TICK

#define THOR_APPEAR_TICK 16

Thor appears over the targets at THOR_APPEAR_TICK of the storm and is pushed back from THOR_PUSH_TICK; the damage shows at THOR_DAMAGE_TICK.

Referenced by btEffectRunThor().

Definition at line 14 of file battle_effect_thor.c.

THOR_PUSH_TICK

#define THOR_PUSH_TICK 32

Referenced by btEffectRunThor().

Definition at line 15 of file battle_effect_thor.c.

THOR_DAMAGE_TICK

#define THOR_DAMAGE_TICK 140

Referenced by btEffectRunThor().

Definition at line 16 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 20 of file battle_effect_thor.c.

THOR_SPARK_COUNT

#define THOR_SPARK_COUNT 910

Referenced by btEffectRunThor().

Definition at line 22 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 26 of file battle_effect_thor.c.

THOR_BOLT_SPARKS

#define THOR_BOLT_SPARKS 16

Referenced by btEffectRunThor().

Definition at line 27 of file battle_effect_thor.c.

THOR_HAMMER_GLOW_SPARKS

#define THOR_HAMMER_GLOW_SPARKS 4

Referenced by btEffectRunThor().

Definition at line 28 of file battle_effect_thor.c.

THOR_SPARK_SHRINK_TICKS

#define THOR_SPARK_SHRINK_TICKS 16

Referenced by btEffectRunThor().

Definition at line 29 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 32 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 37 of file battle_effect_thor.c.

THOR_HAMMER_GLOW_PICTURE_WIDTH

#define THOR_HAMMER_GLOW_PICTURE_WIDTH 12

Definition at line 38 of file battle_effect_thor.c.

THOR_HAMMER_GLOW_PICTURE_HEIGHT

#define THOR_HAMMER_GLOW_PICTURE_HEIGHT 24

Definition at line 39 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 41 of file battle_effect_thor.c.

THOR_LIGHT_FAN_HEIGHT

#define THOR_LIGHT_FAN_HEIGHT 96

Referenced by btEffectRunThor().

Definition at line 42 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 45 of file battle_effect_thor.c.

THOR_BOLT_HEIGHT

#define THOR_BOLT_HEIGHT 72

Referenced by btEffectRunThor().

Definition at line 46 of file battle_effect_thor.c.

THOR_DIMMED_MOTES

#define THOR_DIMMED_MOTES 10000

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

Referenced by btEffectRunThor().

Definition at line 50 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 52 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 56 of file battle_effect_thor.c.

THOR_CANVAS_CENTER_Y

#define THOR_CANVAS_CENTER_Y 60

Referenced by btEffectRunThor().

Definition at line 57 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 lineEnds, 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 62 of file battle_effect_thor.c.

THOR_RING_MOTES

#define THOR_RING_MOTES 128

Referenced by btEffectRunThor().

Definition at line 63 of file battle_effect_thor.c.

THOR_LINE_MOTES

#define THOR_LINE_MOTES 48

Referenced by btEffectRunThor().

Definition at line 64 of file battle_effect_thor.c.

THOR_LINES_TICK

#define THOR_LINES_TICK 64

Referenced by btEffectRunThor().

Definition at line 65 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 floods with light.

Referenced by btEffectRunThor().

Definition at line 69 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 75 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 76 of file battle_effect_thor.c.

THOR_BEAM_TOP

#define THOR_BEAM_TOP 16

Referenced by btEffectRunThor().

Definition at line 77 of file battle_effect_thor.c.

THOR_BEAM_TIP_ROWS

#define THOR_BEAM_TIP_ROWS 9

Referenced by btEffectRunThor().

Definition at line 78 of file battle_effect_thor.c.

THOR_BEAM_SPEED

#define THOR_BEAM_SPEED 20

Referenced by btEffectRunThor().

Definition at line 79 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 80 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 84 of file battle_effect_thor.c.

THOR_PILLAR_TICK

#define THOR_PILLAR_TICK 8

Referenced by btEffectRunThor().

Definition at line 85 of file battle_effect_thor.c.

THOR_BOLTS

#define THOR_BOLTS 30

Violet bolts, one each 2 ticks on from THOR_BOLTS_TICK.

Referenced by btEffectRunThor().

Definition at line 88 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 90 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 92 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 96 of file battle_effect_thor.c.

THOR_CRACKLE_RADIUS_Y

#define THOR_CRACKLE_RADIUS_Y 40

Referenced by btEffectRunThor().

Definition at line 97 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 101 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 104 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, violet bolts strike the targets again and again, and Thor drifts back in crackling lightning.

Abilities: Thor.

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

Referenced by btEffectRunSummon().

Definition at line 134 of file battle_effect_thor.c.