src/field/field_psynergy_tremor.c
Tremor: the view swayed from side to side. More…
Included by field_psynergy.c.
Structures
| Name | Description | |
|---|---|---|
struct | TREMOR_STATE | Tremor's state (heap slot HEAP_SLOT_BATTLE_EFFECT): the view's sway, the picture of the shaken actor and its falling pieces. |
Macros
| Name | Description | |
|---|---|---|
#define | SHAKE_SPRITE_COUNT 64 | The sprites of RESOURCE_SHAKE_TILES' two tiles the state sets up. |
#define | SHAKE_SPRITE_PALETTE 14 | The OBJ palette the shake sprites take. |
#define | PICTURE_SIZE 4096 | |
#define | PICTURE_MAX_PIXELS 2048 | |
#define | SHAKE_STEP (TRIG_TURN * 3 / 32) | How far round the nearby objects' shaking goes each tick: 3/32 of a turn. |
#define | STRONG_SHAKE_PIXELS_PER_TURN 128 | The objects shake as far as a whole turn for every STRONG_SHAKE_PIXELS_PER_TURN pixels the view sways past SWAY_SHAKE. |
#define | STRONG_SWAY_PEAK toFIXED(12) | The stronger sway at an object (16.16 pixels): from SWAY_START up to STRONG_SWAY_PEAK, ramping more slowly and holding longer. |
#define | STRONG_SWAY_RAMP (toFIXED(1) / 10) | 0.1 pixels a tick. |
#define | SWAY_SHAKE toFIXED(4) | Sprites shake only past this. |
#define | STRONG_SWAY_HOLD_TICKS 40 | |
#define | SWAY_SHAKE_TICKS 50 | The sway's hold while nearby objects shake with it, in place of SWAY_HOLD_TICKS. |
#define | SHAKE_PIXELS_PER_TURN 384 | The objects shake as far as a whole turn for every SHAKE_PIXELS_PER_TURN pixels the view sways. |
Enumerations
| Name | Description | |
|---|---|---|
enum | anonymous enum { SWAY_GROW, SWAY_HOLD, SWAY_SHRINK, SWAY_SETTLE, SWAY_DONE } | The stages of a sway of the view (Tremor's and Grind's): it grows, holds, shrinks and settles, and SWAY_DONE ends it. |
Functions
| Name | Description | |
|---|---|---|
void | fdSpriteSetAnimationSpeedStub (void *sprite, Sint32 value) | Sets the step of each of a sprite's layers: 0 stops its animation, ANIM_STEP_NORMAL runs it at normal speed. |
void | fdPsynergyTremorOnTarget (void) | Tremor ("Shake objects left and right.") on the chosen object: sways the view from side to side, as fdPsynergyTremor does with no object: the swing grows from SWAY_START to STRONG_SWAY_PEAK, holds STRONG_SWAY_HOLD_TICKS, shrinks back and stops. |
void | fdPsynergyTremor (void) | Sways the view from side to side, with a sound every 16 ticks: the swing grows from SWAY_START to SWAY_PEAK, holds, shrinks back and stops. |
void | fdBattleEffectShiftRowsDown (Uint8 *base, Sint32 stride, Sint32 rows) | Moves rows 1 to rows - 2 of a buffer down one row by DMA, dropping the last, then clears row 0 (stride bytes per row). |
Description
Tremor: the view swayed from side to side. Part of field_psynergy.c.
Macros in detail
SHAKE_SPRITE_COUNT
#define SHAKE_SPRITE_COUNT 64
The sprites of RESOURCE_SHAKE_TILES' two tiles the state sets up.
Referenced by fdPsynergyTremorOnTarget().
Definition at line 7 of file field_psynergy_tremor.c.
SHAKE_SPRITE_PALETTE
#define SHAKE_SPRITE_PALETTE 14
The OBJ palette the shake sprites take.
Referenced by fdPsynergyTremorOnTarget().
Definition at line 9 of file field_psynergy_tremor.c.
PICTURE_SIZE
#define PICTURE_SIZE 4096
Definition at line 10 of file field_psynergy_tremor.c.
PICTURE_MAX_PIXELS
#define PICTURE_MAX_PIXELS 2048
Referenced by fdPsynergyTremorOnTarget().
Definition at line 11 of file field_psynergy_tremor.c.
SHAKE_STEP
#define SHAKE_STEP (TRIG_TURN * 3 / 32)
How far round the nearby objects' shaking goes each tick: 3/32 of a turn.
Referenced by fdPsynergyTremor() and fdPsynergyTremorOnTarget().
Definition at line 14 of file field_psynergy_tremor.c.
STRONG_SHAKE_PIXELS_PER_TURN
#define STRONG_SHAKE_PIXELS_PER_TURN 128
The objects shake as far as a whole turn for every
STRONG_SHAKE_PIXELS_PER_TURN pixels the view sways past SWAY_SHAKE.
Referenced by fdPsynergyTremorOnTarget().
Definition at line 17 of file field_psynergy_tremor.c.
STRONG_SWAY_PEAK
#define STRONG_SWAY_PEAK toFIXED(12)
The stronger sway at an object (16.16 pixels): from SWAY_START up to
STRONG_SWAY_PEAK, ramping more slowly and holding longer.
Referenced by fdPsynergyTremorOnTarget().
Definition at line 21 of file field_psynergy_tremor.c.
STRONG_SWAY_RAMP
#define STRONG_SWAY_RAMP (toFIXED(1) / 10)
0.1 pixels a tick.
Referenced by fdPsynergyTremorOnTarget().
Definition at line 23 of file field_psynergy_tremor.c.
SWAY_SHAKE
#define SWAY_SHAKE toFIXED(4)
Sprites shake only past this.
Referenced by fdPsynergyTremorOnTarget().
Definition at line 25 of file field_psynergy_tremor.c.
STRONG_SWAY_HOLD_TICKS
#define STRONG_SWAY_HOLD_TICKS 40
Referenced by fdPsynergyTremorOnTarget().
Definition at line 26 of file field_psynergy_tremor.c.
SWAY_SHAKE_TICKS
#define SWAY_SHAKE_TICKS 50
The sway's hold while nearby objects shake with it, in place of
SWAY_HOLD_TICKS.
Referenced by fdPsynergyTremor().
Definition at line 215 of file field_psynergy_tremor.c.
SHAKE_PIXELS_PER_TURN
#define SHAKE_PIXELS_PER_TURN 384
The objects shake as far as a whole turn for every SHAKE_PIXELS_PER_TURN
pixels the view sways.
Referenced by fdPsynergyTremor().
Definition at line 218 of file field_psynergy_tremor.c.
Enumerations in detail
anonymous enum
enum { SWAY_GROW, SWAY_HOLD, SWAY_SHRINK, SWAY_SETTLE, … }
The stages of a sway of the view (Tremor's and Grind's): it grows, holds,
shrinks and settles, and SWAY_DONE ends it.
| Enumerator | Value | Description |
|---|---|---|
SWAY_GROW | ||
SWAY_HOLD | ||
SWAY_SHRINK | ||
SWAY_SETTLE | ||
SWAY_DONE | 999 |
Definition at line 30 of file field_psynergy_tremor.c.
Functions in detail
fdSpriteSetAnimationSpeedStub
void fdSpriteSetAnimationSpeedStub(void *sprite, Sint32 value)
Sets the step of each of a sprite's layers: 0 stops its animation,
ANIM_STEP_NORMAL runs it at normal speed.
Referenced by fdPsynergyGrindOnTarget(), fdPsynergyTremorOnTarget() and mnSanctumRunMemberIconBurst().
Definition at line 51 of file field_psynergy_tremor.c.
fdPsynergyTremorOnTarget
void fdPsynergyTremorOnTarget(void)
Tremor ("Shake objects left and right.") on the chosen object: sways the view
from side to side, as fdPsynergyTremor does with no object: the swing grows
from SWAY_START to STRONG_SWAY_PEAK, holds STRONG_SWAY_HOLD_TICKS, shrinks
back and stops. Past SWAY_SHAKE the nearby objects' sprites shake with it.
The state also takes the object's picture and SHAKE_SPRITE_COUNT sprites,
which nothing here draws. An object whose picture is larger than
PICTURE_MAX_PIXELS gets no sway.
References fdBattleEffectSetObjectUpdateMode(), fdEffectSpriteInit(), fdPsynergyDecodePicture(), fdPsynergyFadeFromCastColor(), fdPsynergyFadeToCastColor(), fdSpriteSetAnimationSpeedStub(), fdViewMoveEnd(), fdViewMoveRestoreNearbySprites(), fdViewMoveSaveNearbySprites(), fdViewMoveStart(), fdViewMoveSwing(), Sint32, syDecompressTaggedLZ(), syHeapSlotAllocate(), syHeapSlotRelease(), syResourceGetTableEntry(), sySin(), sySoundPlayStub(), sySynch(), syVRAMCacheFindFreeEntry(), syVRAMCacheFreeEntry() and syVRAMCacheLoad().
Referenced by fdPsynergyDispatch().
Definition at line 60 of file field_psynergy_tremor.c.
fdPsynergyTremor
void fdPsynergyTremor(void)
Sways the view from side to side, with a sound every 16 ticks: the swing
grows from SWAY_START to SWAY_PEAK, holds, shrinks back and stops. On a town
or dungeon map the nearby objects' sprites shake with it; when there are any,
the hold lasts SWAY_SHAKE_TICKS instead of SWAY_HOLD_TICKS. Then the view
bounds and the sprites come back.
References fdBattleEffectSetObjectUpdateMode(), fdPsynergyFadeFromCastColor(), fdPsynergyFadeToCastColor(), fdViewMoveEnd(), fdViewMoveRestoreNearbySprites(), fdViewMoveSaveNearbySprites(), fdViewMoveStart(), fdViewMoveSwing(), Sint32, syHeapSlotAllocate(), syHeapSlotRelease(), sySin(), sySoundPlayStub() and sySynch().
Referenced by fdPsynergyRun().
Definition at line 225 of file field_psynergy_tremor.c.
fdBattleEffectShiftRowsDown
void fdBattleEffectShiftRowsDown(Uint8 *base, Sint32 stride, Sint32 rows)
Moves rows 1 to rows - 2 of a buffer down one row by DMA, dropping the last, then clears row 0 (stride bytes per row).
References Sint32 and syDMAXCopy().
Referenced by fdPsynergyGrindOnTarget().
Definition at line 326 of file field_psynergy_tremor.c.