src/field/script_commands_field_psynergy_state.c
The effect scene a field Psynergy runs in: fading to and from its cast colour, its effect slots and resources, the actor pair it works on, and Mind Read's wave and palettes. More…
#include "game/stubs.h"#include "text/msg_ids.h"
Included by script_commands.c.
Macros
| Name | Description | |
|---|---|---|
#define | END_FADE_WAIT_TICKS 90 | How long fdPsynergyEnd waits at most for the World Map's palette fade. |
#define | MIND_READ_GREY RGB(28, 28, 28) | a thought window's light grey |
Functions
| Name | Description | |
|---|---|---|
void | fdBattleEffectFadeToSavedPalettes (Sint32 ticks) | Fades the palettes back to the saved ones over the given ticks. |
void | fdPsynergyFadeFromCastColor (void) | Fades the palettes back from a cast's colours to the saved ones over 8 ticks; while Reveal is active the BG half fades to Reveal's grey instead (PALETTE_TINT_GRAYSCALE). |
void | fdCameraWorldToScreen (VECTOR3 *pos) | Converts a world position (16.16 pixels) to the screen: x and z receive the screen's x and y and y becomes 0. |
void | fdBattleEffectUpdateAllEffectSlots (void) | The same function as fdEffectUpdateAllSlots (script_commands_djinni.c), under another name. |
void | fdPsynergyLoadResources (Sint32 abilityId, Sint32 mode) | Prepares the state of the field Psynergy for ability (heap slot fieldEffectState): its kind, the free VRAM it starts with, the map's shake to restore, and whether the place is lit. |
void | fdPsynergySetupActorPair (Sint32 userId, Sint32 targetId) | Records the caster and the target of a field Psynergy. |
void | fdPsynergyStartCast (void) | Starts casting: the caster raises its hand (ANIM_CAST_PSYNERGY_START) and stops, flashes with a sound, and the ability's name is announced; with FLAG_PLAY_PSYNERGY_CAST set the caster holds out its hand (ANIM_CAST_PSYNERGY_END) and keeps its glow. |
void | fdBattleEffectStopMainActor (void) | Takes the caster out of its casting update and waits a tick. |
void | fdPsynergyEnd (void) | Ends a field Psynergy: frees the field effect sprites still in use and, unless another is being resolved, waits for the swelling arcs to end, restores the map's shake and releases the state. |
void | fdPsynergyMarkWorldMapTilesUsed (void) | On the World Map, notes that the field Psynergy has used the second half of the BG tile buffer, so the next still image decodes it again. |
void | fdPsynergyStartMindReadWave (Sint32 casterId, Sint32 targetId) | Starts Mind Read's wave between the caster and the one it reads (HEAP_SLOT_MIND_READ): a hue taken from the tick count, the field faded toward it, the message window greyed for thoughts, and fdPsynergyUpdateMindReadWave run each tick. |
void | fdPsynergyStopMindReadWave (void) | Stops the wave effect: restores the caster's colours and the palettes and releases the Psynergy's state. |
void | fdPsynergyGreyMindReadPalette (void) | Greys the message window's white and most of its other colours (MIND_READ_GREY), so messages read as thoughts, and starts the BG0 line scroll (fdMindReadStartRipple) at each VBlank. |
void | fdPsynergyRestoreMindReadPalette (void) | Stops the BG0 line scroll and restores WINDOW_PALETTE. |
Description
The effect scene a field Psynergy runs in: fading to and from its cast
colour, its effect slots and resources, the actor pair it works on, and Mind
Read's wave and palettes. Part of script_commands.c.
Macros in detail
END_FADE_WAIT_TICKS
#define END_FADE_WAIT_TICKS 90
How long fdPsynergyEnd waits at most for the World Map's palette fade.
Referenced by fdPsynergyEnd().
Definition at line 9 of file script_commands_field_psynergy_state.c.
MIND_READ_GREY
#define MIND_READ_GREY RGB(28, 28, 28)
a thought window's light grey
Referenced by fdPsynergyGreyMindReadPalette().
Definition at line 344 of file script_commands_field_psynergy_state.c.
Functions in detail
fdBattleEffectFadeToSavedPalettes
void fdBattleEffectFadeToSavedPalettes(Sint32 ticks)
Fades the palettes back to the saved ones over the given ticks.
References fdStartPaletteTransition() and Sint32.
Referenced by fdPsynergyParch().
Definition at line 12 of file script_commands_field_psynergy_state.c.
fdPsynergyFadeFromCastColor
void fdPsynergyFadeFromCastColor(void)
Fades the palettes back from a cast's colours to the saved ones over 8 ticks;
while Reveal is active the BG half fades to Reveal's grey instead
(PALETTE_TINT_GRAYSCALE).
References fdStartPaletteTransition().
Referenced by fdPsynergyArrow(), fdPsynergyBlaze(), fdPsynergyBurst(), fdPsynergyCarry(), fdPsynergyCatch(), fdPsynergyCyclone(), fdPsynergyDouse(), fdPsynergyForce(), fdPsynergyFrost(), fdPsynergyGrind(), fdPsynergyGrindOnTarget(), fdPsynergyGrowth(), fdPsynergyGrowthOnTarget(), fdPsynergyHalt(), fdPsynergyLash(), fdPsynergyLift(), fdPsynergyLiftOnTarget(), fdPsynergyMove(), fdPsynergyParch(), fdPsynergyPly(), fdPsynergyPound(), fdPsynergyRetreat(), fdPsynergyRing(), fdPsynergySand(), fdPsynergyScoop(), fdPsynergySteerLiftedTarget(), fdPsynergySteerPushedTarget(), fdPsynergyStopMindReadWave(), fdPsynergyTremor(), fdPsynergyTremorOnTarget(), fdPsynergyWhirlwind(), fdSummonTabletPlayRunes(), fdTeleportPlaySparksAndFade() and scMarsLighthouseEntranceTeleportFromNorthCircle().
Definition at line 20 of file script_commands_field_psynergy_state.c.
fdCameraWorldToScreen
void fdCameraWorldToScreen(VECTOR3 *pos)
Converts a world position (16.16 pixels) to the screen: x and z receive the screen's x and y and y becomes 0.
References result, Sint32 and syConvert3Dto2D().
Referenced by dbPsynergyTestUpdateRings(), fdActorAppearInSparks(), fdBattleEffectUpdateArcEffect(), fdBlazeUpdateSpray(), fdDjinnRunJupiterJoinEffect(), fdDjinnRunMarsJoinEffect(), fdDjinnRunMercuryJoinEffect(), fdDjinnRunVenusJoinEffect(), fdEffectRunAngledApproachPhases(), fdEffectSpriteDrawAtWorldPos(), fdEffectSpriteDrawAtWorldXYZ(), fdEffectUpdateHaltParticle(), fdEffectUpdateMarsSpark(), fdEffectUpdateRadialBurst(), fdEffectUpdateRadialSpread(), fdEffectUpdateRandomTargetParticle(), fdGrowingParticleUpdate(), fdHoverGlowUpdate(), fdParticleBurstUpdate(), fdPsynergyBurst(), fdPsynergyCyclone(), fdPsynergyForce(), fdPsynergyHalt(), fdPsynergyParch(), fdPsynergyPound(), fdPsynergyRetreat(), fdPsynergyRing(), fdPsynergyScoop(), fdPsynergyStartSceneSprite(), fdPsynergyUpdateArrow(), fdPsynergyUpdateBurst(), fdPsynergyUpdateRing(), fdRetreatUpdateSpark(), fdRisingParticlesUpdate(), fdSandInitLeaderSprite(), fdScoopDustUpdateGrain(), fdSummonTabletPlayRunes(), fdTeleportPlayWhirl(), scChampaCliffCavesDrawForgeFire(), scChampaCliffCavesStartFlash(), scContigoRaiseSparkle(), scJupiterLighthouseUpdateBeam(), scJupiterLighthouseUpdateSparkRing(), scLemuriaPalaceDrawMaps(), scMarsLighthouseAerieUpdateRisingRings() and scWhirlwindUpdate().
Definition at line 27 of file script_commands_field_psynergy_state.c.
fdBattleEffectUpdateAllEffectSlots
void fdBattleEffectUpdateAllEffectSlots(void)
The same function as fdEffectUpdateAllSlots (script_commands_djinni.c), under
another name. An event: updates the scene's 24 effect slots.
References fdParticleUpdate() and Sint32.
Referenced by fdPsynergyEnd() and fdPsynergyLoadResources().
Definition at line 57 of file script_commands_field_psynergy_state.c.
fdPsynergyLoadResources
void fdPsynergyLoadResources(Sint32 abilityId, Sint32 mode)
Prepares the state of the field Psynergy for ability (heap slot
fieldEffectState): its kind, the free VRAM it starts with, the map's shake to
restore, and whether the place is lit. While another field Psynergy is
resolving, only the ability and kind are set.
References fdBattleEffectStartArcEffect(), fdBattleEffectUpdateAllEffectSlots(), fdPsynergySetupActorPair(), fdResourceTableCountFreeBlocks(), gmAbilityGetDefinitionStub(), MainRoutineStateWork, SceneIdJupiterLighthouseAerieBeacon, Sint32, syHeapSlotAllocate() and sySetEvent().
Referenced by fdRunPsynergyEndScripts(), fdUseItem(), fdUsePsynergy(), scDehkanPlateauCannonCastsPound(), scDehkanPlateauCannonCastsPoundOnLeader(), scGarohWerewolfPeersFromCave(), scIzumoRoomsShowMove(), scKandoreanTempleCastLash(), scKibomboAkafubuCastsOnCrystal(), scKibomboCastScoop(), scMadraRoomsPiersUsesPsynergy(), scMadraRoomsShinAngersPiers(), scMagmaRockInsidePlayBurst(), scMagmaRockPlayBurst(), scVenusLighthouseFelixMovesStatue() and scYampiDesertScorpionUsesScoop().
Definition at line 71 of file script_commands_field_psynergy_state.c.
fdPsynergySetupActorPair
void fdPsynergySetupActorPair(Sint32 userId, Sint32 targetId)
Records the caster and the target of a field Psynergy.
References fdActorLookup(), Sint32 and syVectorAddPolarOffset().
Referenced by fdPsynergyLoadResources(), fdPsynergyRun(), fdRunPsynergyEndScripts(), fdUsePsynergy(), scDehkanPlateauCannonCastsPound(), scDehkanPlateauCannonCastsPoundOnLeader(), scGarohWerewolfPeersFromCave(), scIzumoRoomsShowMove(), scKandoreanTempleCastLash(), scKibomboAkafubuCastsOnCrystal(), scKibomboCastScoop(), scMadraRoomsPiersUsesPsynergy(), scMadraRoomsShinAngersPiers(), scVenusLighthouseFelixMovesStatue() and scYampiDesertScorpionUsesScoop().
Definition at line 135 of file script_commands_field_psynergy_state.c.
fdPsynergyStartCast
void fdPsynergyStartCast(void)
Starts casting: the caster raises its hand (ANIM_CAST_PSYNERGY_START) and
stops, flashes with a sound, and the ability's name is announced; with
FLAG_PLAY_PSYNERGY_CAST set the caster holds out its hand
(ANIM_CAST_PSYNERGY_END) and keeps its glow.
References fdActorSelectAnimationStub(), fdActorSetOthersPaused(), fdBattleEffectSetObjectUpdateMode(), fdBattleEffectStopMainActor(), mnFieldMessageShowStub(), mnMessageArgumentPushStub(), Sint32, syGameFlagGet() and sySoundPlayStub().
Referenced by fdUsePsynergy(), scDehkanPlateauCannonCastsPound(), scDehkanPlateauCannonCastsPoundOnLeader(), scIzumoRoomsShowMove(), scKandoreanTempleCastLash(), scKibomboAkafubuCastsOnCrystal(), scKibomboCastScoop(), scMadraRoomsPiersUsesPsynergy(), scMadraRoomsShinAngersPiers(), scVenusLighthouseFelixMovesStatue() and scYampiDesertScorpionUsesScoop().
Definition at line 183 of file script_commands_field_psynergy_state.c.
fdBattleEffectStopMainActor
void fdBattleEffectStopMainActor(void)
Takes the caster out of its casting update and waits a tick.
References fdBattleEffectSetObjectUpdateMode() and sySynch().
Referenced by fdPsynergyPlyOnTarget(), fdPsynergyStartCast(), fdPsynergySteerPushedTarget(), fdRunPsynergyEndScripts(), fdUsePsynergy(), scDehkanPlateauCannonCastsPound(), scDehkanPlateauCannonCastsPoundOnLeader(), scGarohWerewolfPeersFromCave(), scIzumoRoomsShowMove(), scKandoreanTempleCastLash(), scKibomboAkafubuCastsOnCrystal(), scKibomboCastScoop(), scMadraRoomsPiersUsesPsynergy(), scMadraRoomsShinAngersPiers(), scMagmaRockPlayBurst(), scVenusLighthouseFelixMovesStatue() and scYampiDesertScorpionUsesScoop().
Definition at line 226 of file script_commands_field_psynergy_state.c.
fdPsynergyEnd
void fdPsynergyEnd(void)
Ends a field Psynergy: frees the field effect sprites still in use and, unless another is being resolved, waits for the swelling arcs to end, restores the map's shake and releases the state.
References fdBattleEffectEndArcEffect(), fdBattleEffectUpdateAllEffectSlots(), fdBattleEffectWaitForArcGroups(), fdParticleFree(), fdPsynergyMarkWorldMapTilesUsed(), fdPsynergyReleaseSceneSprite(), fdScriptNoOperation(), Sint32, syCloseEvent(), syHeapSlotRelease() and sySynch().
Referenced by fdRunPsynergyEndScripts(), fdUseItem(), fdUsePsynergy(), scDehkanPlateauCannonCastsPound(), scDehkanPlateauCannonCastsPoundOnLeader(), scGarohWerewolfPeersFromCave(), scIzumoRoomsShowMove(), scKandoreanTempleCastLash(), scKibomboAkafubuCastsOnCrystal(), scKibomboCastScoop(), scMadraRoomsPiersUsesPsynergy(), scMadraRoomsShinAngersPiers(), scMagmaRockInsidePlayBurst(), scMagmaRockPlayBurst(), scVenusLighthouseFelixMovesStatue() and scYampiDesertScorpionUsesScoop().
Definition at line 237 of file script_commands_field_psynergy_state.c.
fdPsynergyMarkWorldMapTilesUsed
void fdPsynergyMarkWorldMapTilesUsed(void)
On the World Map, notes that the field Psynergy has used the second half of the BG tile buffer, so the next still image decodes it again.
References Sint32.
Referenced by fdPsynergyEnd(), fdPsynergyEndSand(), fdPsynergySand() and fdTeleportPlayWhirl().
Definition at line 296 of file script_commands_field_psynergy_state.c.
fdPsynergyStartMindReadWave
void fdPsynergyStartMindReadWave(Sint32 casterId, Sint32 targetId)
Starts Mind Read's wave between the caster and the one it reads
(HEAP_SLOT_MIND_READ): a hue taken from the tick count, the field faded
toward it, the message window greyed for thoughts, and
fdPsynergyUpdateMindReadWave run each tick.
References fdMindReadAdvanceTint(), fdPaletteFadeSetTarget(), fdPaletteFadeStartInterpolation(), fdPsynergyFadeToCastColor(), fdPsynergyGreyMindReadPalette(), fdPsynergyUpdateMindReadWave(), Sint32, syHeapSlotAllocateEWRAM(), sySetEvent() and TickCount.
Referenced by fdPsynergyDispatch(), fdPsynergyRun(), scIsletsArriveAtSecretSpot(), scIsletsArriveBackAtIsland(), scIsletsPengusGivesPrettyStone(), scMarsLighthouseAerieLightBeacon(), scMarsLighthouseAerieWatchGoldenSunRise() and scMercuryLighthouseHearVoices().
Definition at line 309 of file script_commands_field_psynergy_state.c.
fdPsynergyStopMindReadWave
void fdPsynergyStopMindReadWave(void)
Stops the wave effect: restores the caster's colours and the palettes and releases the Psynergy's state.
References fdActorGetById(), fdActorSetLayersColorMode(), fdPsynergyFadeFromCastColor(), fdPsynergyRestoreMindReadPalette(), fdPsynergyUpdateMindReadWave(), syCloseEvent() and syHeapSlotRelease().
Referenced by fdPsynergyFinishMindRead(), scIsletsArriveAtSecretSpot(), scIsletsArriveBackAtIsland(), scIsletsPengusGivesPrettyStone(), scMarsLighthouseAerieLightBeacon(), scMarsLighthouseAerieWatchGoldenSunRise() and scMercuryLighthouseHearVoices().
Definition at line 332 of file script_commands_field_psynergy_state.c.
fdPsynergyGreyMindReadPalette
void fdPsynergyGreyMindReadPalette(void)
Greys the message window's white and most of its other colours
(MIND_READ_GREY), so messages read as thoughts, and starts the BG0 line
scroll (fdMindReadStartRipple) at each VBlank.
References fdMindReadStartRipple() and sySetEvent().
Referenced by fdPsynergyStartMindReadWave(), scIsletsGiveTurtle(), scIsletsLonesomeGeorgeThanks(), scIsletsPengusGivesPrettyStone(), scIsletsRideBackToIsland(), scIsletsTradeWithBird(), scIsletsTradeWithCow() and scIsletsTradeWithDog().
Definition at line 349 of file script_commands_field_psynergy_state.c.
fdPsynergyRestoreMindReadPalette
void fdPsynergyRestoreMindReadPalette(void)
Stops the BG0 line scroll and restores WINDOW_PALETTE.
References fdMindReadStartRipple(), MainRoutineStateWork, mnWindowColorApplyStub() and syCloseEvent().
Referenced by fdPsynergyStopMindReadWave(), scIsletsGiveTurtle(), scIsletsLonesomeGeorgeThanks(), scIsletsPengusGivesPrettyStone(), scIsletsRideBackToIsland(), scIsletsTradeWithBird(), scIsletsTradeWithCow() and scIsletsTradeWithDog().
Definition at line 380 of file script_commands_field_psynergy_state.c.