Skip to Content
The Alchemy Project

src/field/field_psynergy_pound.c

Pound: its shine, the object it drives into the ground, and a picture's columns shifted by a wave. More…

Included by field_psynergy.c.

Structures

NameDescription
structPOUND_STATEPound's state (heap slot HEAP_SLOT_BATTLE_EFFECT): the star tiles, the shine's 32 sparks, the glow under the fist, the fist itself and the stage of its fall.

Macros

NameDescription
#definePOUND_SPARK_COUNT 32The sparks of Pound's shine; the first 12 are drawn.
#definePOUND_DRAWN_SPARKS 12
#definePOUND_SHINE_COLORS (2 * PALETTE_COLORS)The shine's colours, two palettes of the canvas: blue full, red and green swinging together round their middle as the cycle steps.
#definePOUND_SHATTER_PIECES 16The pieces the fist shatters into when it cannot come down.
#definePOUND_GLOW_SIZE 64The glow under the fist, 64 pixels square in 16 colours.
#defineWAVE_PICTURE_SIZE 32The pictures fdPictureShiftColumnsByWave shifts, 32 pixels square.

Enumerations

NameDescription
enumPOUND_STAGE { POUND_FALLS, POUND_SHINE_GROWS, POUND_SHINE_HOLDS, POUND_SET … }The stages of the fist's fall (POUND_STATE.state).

Functions

NameDescription
voidfdPsynergyUpdatePound (void)Event of a Pound that comes down: the fist falls and lands with a shake, the shine spreads round it with its sparks, then the fist lifts again.
voidfdPoundSinkFist (void)Event of a Pound that cannot come down: the fist sinks 2.5 pixels and shrinks by 1/64 a tick for 8 ticks, before it shatters.
voidfdPsynergyPoundOnTarget (void)Pound cast on a target: runs fdPsynergyPound.
voidfdPsynergyStartSceneSprite (void)When the caster faces away (FACING_NORTH), starts the Psynergy's canvas sprite (FIELD_EFFECT_STATE.sprite): a blank 32x32 sprite of its own VRAM cache entry, twice as tall, 28 pixels above the caster in front of everything, drawn each tick by fdPsynergyDrawCanvasSprite until fdPsynergyReleaseSceneSprite.
voidfdPsynergyShrinkToCaster (ACTOR *actor, Sint32 x, Sint32 y, Sint32 z)fdPsynergyGrowFromCaster backwards: moves the actor from (x, y, z) to 16 pixels above the caster, shrinking it from full size to a quarter.
voidfdPsynergyPound (void)Pound ("Drive objects into the ground."): a giant fist forms over the spot 32 pixels before the caster, or over the target, and comes down on it.
voidfdPictureShiftColumnsByWave (Uint8 *src, Uint8 *dest, Sint32 phase)Copies a 32 by 32 byte picture into a cleared one stretched down, its rows four pixels apart, each column slid down by phase (1.6 pixels a step, from 124 pixels up) less a sine wave across the columns; what falls outside is dropped.

Description

Pound: its shine, the object it drives into the ground, and a picture's columns shifted by a wave. Part of field_psynergy.c.

Macros in detail

POUND_SPARK_COUNT

#define POUND_SPARK_COUNT 32

The sparks of Pound's shine; the first 12 are drawn.

Referenced by fdPsynergyPound().

Definition at line 5 of file field_psynergy_pound.c.

POUND_DRAWN_SPARKS

#define POUND_DRAWN_SPARKS 12

Referenced by fdPsynergyUpdatePound().

Definition at line 6 of file field_psynergy_pound.c.

POUND_SHINE_COLORS

#define POUND_SHINE_COLORS (2 * PALETTE_COLORS)

The shine's colours, two palettes of the canvas: blue full, red and green swinging together round their middle as the cycle steps.

Referenced by fdPsynergyUpdatePound().

Definition at line 9 of file field_psynergy_pound.c.

POUND_SHATTER_PIECES

#define POUND_SHATTER_PIECES 16

The pieces the fist shatters into when it cannot come down.

Referenced by fdPsynergyPound().

Definition at line 11 of file field_psynergy_pound.c.

POUND_GLOW_SIZE

#define POUND_GLOW_SIZE 64

The glow under the fist, 64 pixels square in 16 colours.

Referenced by fdPsynergyPound().

Definition at line 13 of file field_psynergy_pound.c.

WAVE_PICTURE_SIZE

#define WAVE_PICTURE_SIZE 32

The pictures fdPictureShiftColumnsByWave shifts, 32 pixels square.

Referenced by fdPictureShiftColumnsByWave().

Definition at line 405 of file field_psynergy_pound.c.

Enumerations in detail

POUND_STAGE

enum POUND_STAGE

The stages of the fist's fall (POUND_STATE.state).

EnumeratorValueDescription
POUND_FALLS0the fist comes down; it lands on the eighth tick
POUND_SHINE_GROWS1the shine spreads, its colours cycling
POUND_SHINE_HOLDS2
POUND_SETTLES3the shaking stops
POUND_LIFTS4the fist rises off the ground

Definition at line 16 of file field_psynergy_pound.c.

Functions in detail

fdPsynergyUpdatePound

void fdPsynergyUpdatePound(void)

Event of a Pound that comes down: the fist falls and lands with a shake, the shine spreads round it with its sparks, then the fist lifts again.

References fdAdvanceWithGravity2D(), fdEffectSpriteDraw(), fdMapGridSetScreenShakeStub(), Sint32, sySin() and sySoundPlayStub().

Referenced by fdPsynergyPound().

Definition at line 46 of file field_psynergy_pound.c.

fdPoundSinkFist

void fdPoundSinkFist(void)

Event of a Pound that cannot come down: the fist sinks 2.5 pixels and shrinks by 1/64 a tick for 8 ticks, before it shatters.

Referenced by fdPsynergyPound().

Definition at line 153 of file field_psynergy_pound.c.

fdPsynergyPoundOnTarget

void fdPsynergyPoundOnTarget(void)

Pound cast on a target: runs fdPsynergyPound.

References fdPsynergyPound().

Referenced by fdPsynergyDispatch().

Definition at line 171 of file field_psynergy_pound.c.

fdPsynergyPound

void fdPsynergyPound(void)

Pound ("Drive objects into the ground."): a giant fist forms over the spot 32 pixels before the caster, or over the target, and comes down on it. Out of reach, or with a solid actor in the way, it shatters with the error sound; else the place's Pound script runs.

References fdActorGetSpritePriority(), fdActorReleaseStub(), fdActorSelectAnimationStub(), fdActorSpawn(), fdBattleEffectEndCanvasSprite(), fdBattleEffectSpawnScatterParticle(), fdBattleEffectStartCanvasSprite(), fdCameraWorldToScreen(), fdEffectSpriteDraw(), fdEffectSpriteInit(), fdFindPsynergyCue(), fdMeasurePsynergyHeight(), fdPoundSinkFist(), fdPsynergyCheckOverlap(), fdPsynergyFadeFromCastColor(), fdPsynergyFadeToCastColor(), fdPsynergyGrowFromCaster(), fdPsynergyShrinkToCaster(), fdPsynergyStartSceneSprite(), fdPsynergyUpdatePound(), fdRunPsynergyScript(), fdSelectPsynergyTarget(), Sint32, syCloseEvent(), syCos(), syDecompressTaggedLZ(), syHeapSlotAllocate(), syHeapSlotRelease(), syRandom(), syResourceGetTableEntry(), sySetEvent(), sySin(), sySoundPlayStub(), sySynch(), syVectorAddPolarOffset(), syVRAMCacheFindFreeEntry(), syVRAMCacheFreeEntry() and syVRAMCacheLoad().

Referenced by fdPsynergyPoundOnTarget() and fdPsynergyRun().

Definition at line 183 of file field_psynergy_pound.c.

fdPictureShiftColumnsByWave

void fdPictureShiftColumnsByWave(Uint8 *src, Uint8 *dest, Sint32 phase)

Copies a 32 by 32 byte picture into a cleared one stretched down, its rows four pixels apart, each column slid down by phase (1.6 pixels a step, from 124 pixels up) less a sine wave across the columns; what falls outside is dropped. The Scoop draws its rising picture with it.

References Sint32, sySin() and syWordsClear().

Referenced by fdScoopUpdate().

Definition at line 411 of file field_psynergy_pound.c.