src/field/field_psynergy_parch.c
Parch, then two drawing helpers of the Ring's: a canvas pixel on a circle, and its 16 by 16-tile picture copied to BG0 clipped to the screen. More…
Included by field_psynergy.c.
Structures
| Name | Description | |
|---|---|---|
struct | PARCH_PUFF | A puff of Parch's steam: its place, its sway and rise, and its age. |
struct | PARCH_STATE | Parch's state (heap slot HEAP_SLOT_BATTLE_EFFECT): the glow disc over the target and the 64 puffs of steam that rise as it dries. |
Macros
| Name | Description | |
|---|---|---|
#define | PARCH_PUFF_COUNT 64 | The puffs of steam Parch keeps, a power of two: the next wraps by a mask. |
#define | PARCH_DISC_TILE_OFFSET 128 | The disc's tiles, this many tiles after the window sprites' glyph tiles. |
#define | PARCH_GLOW_COLORS 32 | The disc's colours, the last 32 of the sprite palette, which glow as the Ring's do (GLOW_RED and the rest); the white flash of drying water raises them all. |
#define | CLIPPED_PICTURE_TILES 16 | The picture fdBgMapDrawClipped16x16 draws, 16 tiles square. |
Enumerations
| Name | Description | |
|---|---|---|
enum | PARCH_RESULT { PARCH_NOTHING, PARCH_WATER, PARCH_DRIES } | What Parch finds before the caster. |
enum | PARCH_PHASE { PARCH_SWELLS, PARCH_HOLDS, PARCH_EMPTY_SHRINKS, PARCH_STEAMS … } | The stages of Parch's disc, which differ by what it finds (PARCH_RESULT). |
Functions
| Name | Description | |
|---|---|---|
void | fdPsynergyParchOnTarget (void) | Parch cast on a target: runs fdPsynergyParch. |
void | fdBattleEffectFadeToSavedPalettes (Sint32 ticks) | Fades the palettes back to the saved ones over the given ticks. |
void | fdPsynergyParch (void) | Parch ("Evaporate standing water."): a glowing disc spreads 32 pixels before the caster and white puffs rise from it. |
void | fdBattleEffectPlotCanvasPixel (Sint32 x, Sint32 y, Sint32 color) | Plots a pixel of colour color at (x, y) on the 128-pixel-wide canvas pair: x from 64 lands on the second canvas. |
void | fdCanvasPlotPolarPixel (Sint32 unused, FIXED radius, Sint32 angle, Sint32 color) | Plots one pixel of the 128x64 canvas on a circle around its bottom middle (63, 63): a radius (16.16) and an angle, the cosine leftward and the sine upward. |
void | fdBgMapDrawClipped16x16 (Sint32 x, Sint32 y) | Copies the Ring's 16x16-tile picture (RingPictureTiles) to the top left of BG0's map, leaving out the tiles that would fall off the 30x20-tile screen once BG0 is scrolled to show the picture at (x, y), in pixels. |
Variables
| Name | Description | |
|---|---|---|
extern const Uint16 | RingPictureTiles [] | The screen entries of the Ring's 16x16-tile picture (fdBgMapDrawClipped16x16), row by row: tile numbers with their flip bits. |
Description
Parch, then two drawing helpers of the Ring's: a canvas pixel on a circle,
and its 16 by 16-tile picture copied to BG0 clipped to the screen. Part of
field_psynergy.c.
Macros in detail
PARCH_PUFF_COUNT
#define PARCH_PUFF_COUNT 64
The puffs of steam Parch keeps, a power of two: the next wraps by a mask.
Referenced by fdPsynergyParch().
Definition at line 24 of file field_psynergy_parch.c.
PARCH_DISC_TILE_OFFSET
#define PARCH_DISC_TILE_OFFSET 128
The disc's tiles, this many tiles after the window sprites' glyph tiles.
Referenced by fdPsynergyParch().
Definition at line 26 of file field_psynergy_parch.c.
PARCH_GLOW_COLORS
#define PARCH_GLOW_COLORS 32
The disc's colours, the last 32 of the sprite palette, which glow as the
Ring's do (GLOW_RED and the rest); the white flash of drying water raises
them all.
Referenced by fdPsynergyParch().
Definition at line 30 of file field_psynergy_parch.c.
CLIPPED_PICTURE_TILES
#define CLIPPED_PICTURE_TILES 16
The picture fdBgMapDrawClipped16x16 draws, 16 tiles square.
Referenced by fdBgMapDrawClipped16x16().
Definition at line 452 of file field_psynergy_parch.c.
Enumerations in detail
PARCH_RESULT
enum PARCH_RESULT
What Parch finds before the caster.
| Enumerator | Value | Description |
|---|---|---|
PARCH_NOTHING | 0 | no water: the disc swells and shrinks |
PARCH_WATER | 1 | water with no Parch script: steam rises from it |
PARCH_DRIES | 2 | a puddle, or water with a Parch script: it dries up in a white flash |
Definition at line 33 of file field_psynergy_parch.c.
PARCH_PHASE
enum PARCH_PHASE
The stages of Parch's disc, which differ by what it finds (PARCH_RESULT).
Every result starts with PARCH_SWELLS.
| Enumerator | Value | Description |
|---|---|---|
PARCH_SWELLS | 0 | The disc grows, to three quarters (a quarter on nothing). |
PARCH_HOLDS | 1 | On nothing: the disc holds for 30 ticks, then |
PARCH_EMPTY_SHRINKS | 2 | shrinks away. |
PARCH_STEAMS | 1 | On water: steam rises two puffs a tick, then one, and the disc shrinks away. Water that dries flashes white 40 ticks into the steam, and the cast ends with the thinner steam. |
PARCH_STEAM_THINS | 2 | |
PARCH_STEAM_SHRINKS | 3 |
Definition at line 43 of file field_psynergy_parch.c.
Functions in detail
fdPsynergyParchOnTarget
void fdPsynergyParchOnTarget(void)
Parch cast on a target: runs fdPsynergyParch.
References fdPsynergyParch().
Referenced by fdPsynergyDispatch().
Definition at line 6 of file field_psynergy_parch.c.
fdPsynergyParch
void fdPsynergyParch(void)
Parch ("Evaporate standing water."): a glowing disc spreads 32 pixels before
the caster and white puffs rise from it. On a puddle (SPRITE_PUDDLE), or on
water with a Parch script, the water there dries up and the script runs.
References fdActorGetById(), fdActorSetHorizontalPosWithTerrain(), fdBattleEffectFadeToSavedPalettes(), fdCameraWorldToScreen(), fdEffectSpriteDraw(), fdEffectSpriteInit(), fdFindPsynergyCue(), fdMapGridGetMetatileBehavior(), fdMapGridIsWaterMetatile(), fdMapGridSetMetatileBehavior(), fdMeasurePsynergyHeight(), fdPaletteFadeSetTarget(), fdPaletteFadeStartInterpolation(), fdPsynergyCheckOverlap(), fdPsynergyFadeFromCastColor(), fdPsynergyFadeToCastColor(), fdPsynergyGetCanvasPriority(), fdRunPsynergyScript(), result, Sint32, syDecompressTaggedLZ(), syDMAXCopy(), syHeapSlotAllocate(), syHeapSlotRelease(), syRandom(), syResourceGetTableEntry(), sySin(), sySoundPlayStub(), sySynch(), syVectorAddPolarOffset(), syVRAMCacheFindFreeEntry(), syVRAMCacheFreeEntry() and syVRAMCacheLoad().
Referenced by fdPsynergyParchOnTarget() and fdPsynergyRun().
Definition at line 78 of file field_psynergy_parch.c.
fdCanvasPlotPolarPixel
void fdCanvasPlotPolarPixel(Sint32 unused, FIXED radius, Sint32 angle, Sint32 color)
Plots one pixel of the 128x64 canvas on a circle around its bottom middle (63, 63): a radius (16.16) and an angle, the cosine leftward and the sine upward.
References fdBattleEffectPlotCanvasPixel(), Sint32, syCos() and sySin().
Referenced by fdPsynergyRing().
Definition at line 438 of file field_psynergy_parch.c.
fdBgMapDrawClipped16x16
void fdBgMapDrawClipped16x16(Sint32 x, Sint32 y)
Copies the Ring's 16x16-tile picture (RingPictureTiles) to the top left of
BG0's map, leaving out the tiles that would fall off the 30x20-tile screen
once BG0 is scrolled to show the picture at (x, y), in pixels.
References RingPictureTiles and Sint32.
Referenced by fdPsynergyUpdateRing().
Definition at line 457 of file field_psynergy_parch.c.