Skip to Content
The Alchemy Project

src/field/field_psynergy_teleport.c

Teleport: the leader leaving in a burst of sparks and arriving in a whirl of them, and the cast that opens the picture of the world. More…

Included by field_psynergy.c.

Structures

NameDescription
structTELEPORT_WHIRL_STATETeleport's whirl (heap slot battleEffect): the decoded spark picture, then the 100 sparks and their sprites.
structTELEPORT_SPARKS_STATETeleport's burst of sparks (heap slot battleEffect): the decoded picture, then the sparks and their sprites.

Macros

NameDescription
#defineWHIRL_COUNT 100sparks that whirl round the leader
#defineTELEPORT_SPARK_TICKS 20The ticks a spark flies before it vanishes.
#defineTELEPORT_SPIN_TICKS 50Before the sparks, the leader spins for TELEPORT_SPIN_TICKS, its turn each tick TELEPORT_SPIN_ACCELERATION (1/65536 turns) faster than the last.
#defineTELEPORT_SPIN_ACCELERATION 60
#defineTELEPORT_SPARK_COUNT 100The sparks of Teleport's leaving burst.

Enumerations

NameDescription
enumWHIRL_STAGE { WHIRL_FALLS_IN, WHIRL_LEADER_GROWS, WHIRL_DIES_AWAY }The stages of fdTeleportPlayWhirl.
enumSPARK_STAGE { SPARKS_BURST, SPARKS_LEADER_SHRINKS, SPARKS_DIE_AWAY }The stages of fdTeleportPlaySparks.

Functions

NameDescription
voidfdTeleportPlayWhirl (void)The arriving half of a teleport: a whirl of sparks, the coloured orbs of RESOURCE_COLOURED_ORBS, falls in round the hidden leader with SE_SPARKLE_FALL, the leader spins and grows back to full size inside it, and the whirl dies away.
voidfdTeleportPlaySparks (void)The leaving half of a teleport, fdTeleportPlayWhirl's companion in the same scenes: the leader raises both arms in changing colours, spins faster and faster as sparks burst from it, shrinks away and is hidden.
voidfdTeleportPlaySparksAndFade (void)Runs fdTeleportPlaySparks, fades the palettes back to the saved ones and waits 10 ticks.
voidfdPsynergyTeleportOnTarget (void)Teleport cast on a target: does nothing.
voidfdPsynergyTeleport (void)Teleport: raises FIELD_RAISED_CUE_TELEPORT, which shows the picture of the whole world for the player to choose where to go.

Description

Teleport: the leader leaving in a burst of sparks and arriving in a whirl of them, and the cast that opens the picture of the world. Part of field_psynergy.c.

Macros in detail

WHIRL_COUNT

#define WHIRL_COUNT 100

sparks that whirl round the leader

Referenced by fdTeleportPlayWhirl().

Definition at line 5 of file field_psynergy_teleport.c.

TELEPORT_SPARK_TICKS

#define TELEPORT_SPARK_TICKS 20

The ticks a spark flies before it vanishes.

Referenced by fdTeleportPlaySparks() and fdTeleportPlayWhirl().

Definition at line 7 of file field_psynergy_teleport.c.

TELEPORT_SPIN_TICKS

#define TELEPORT_SPIN_TICKS 50

Before the sparks, the leader spins for TELEPORT_SPIN_TICKS, its turn each tick TELEPORT_SPIN_ACCELERATION (1/65536 turns) faster than the last.

Referenced by fdTeleportPlaySparks().

Definition at line 10 of file field_psynergy_teleport.c.

TELEPORT_SPIN_ACCELERATION

#define TELEPORT_SPIN_ACCELERATION 60

Referenced by fdTeleportPlaySparks().

Definition at line 11 of file field_psynergy_teleport.c.

TELEPORT_SPARK_COUNT

#define TELEPORT_SPARK_COUNT 100

The sparks of Teleport's leaving burst.

Referenced by fdTeleportPlaySparks().

Definition at line 192 of file field_psynergy_teleport.c.

Enumerations in detail

WHIRL_STAGE

enum WHIRL_STAGE

The stages of fdTeleportPlayWhirl.

EnumeratorValueDescription
WHIRL_FALLS_IN0more and more sparks fall in round the hidden leader
WHIRL_LEADER_GROWS1
WHIRL_DIES_AWAY2

Definition at line 14 of file field_psynergy_teleport.c.

SPARK_STAGE

enum SPARK_STAGE

The stages of fdTeleportPlaySparks.

EnumeratorValueDescription
SPARKS_BURST0more and more sparks burst from the spinning
SPARKS_LEADER_SHRINKS1leader
SPARKS_DIE_AWAY2

Definition at line 23 of file field_psynergy_teleport.c.

Functions in detail

fdTeleportPlayWhirl

void fdTeleportPlayWhirl(void)

The arriving half of a teleport: a whirl of sparks, the coloured orbs of RESOURCE_COLOURED_ORBS, falls in round the hidden leader with SE_SPARKLE_FALL, the leader spins and grows back to full size inside it, and the whirl dies away. The scenes with Teleport circles call it (Mars Lighthouse, the Anemos Inner Sanctum, the Yampi Desert and Islet caves, Contigo).

References fdActorLookup(), fdActorSetSpriteFlagsStub(), fdCameraWorldToScreen(), fdEffectSpriteDraw(), fdEffectSpriteInit(), fdPartyGetLeaderActor(), fdPsynergyMarkWorldMapTilesUsed(), Sint32, syDecompressTaggedLZ(), syHeapSlotAllocate(), syHeapSlotRelease(), syRandom(), syResourceGetTableEntry(), sySoundPlayStub(), sySynch(), syVectorAddPolarOffset(), syVRAMCacheFindFreeEntry(), syVRAMCacheFreeEntry() and syVRAMCacheLoad().

Referenced by fdEngineRun(), scIsletCaveFinishTeleport(), scMarsLighthouseEntranceTeleportFromNorthCircle() and scTeleportArriveWhirling().

Definition at line 46 of file field_psynergy_teleport.c.

fdTeleportPlaySparks

void fdTeleportPlaySparks(void)

The leaving half of a teleport, fdTeleportPlayWhirl's companion in the same scenes: the leader raises both arms in changing colours, spins faster and faster as sparks burst from it, shrinks away and is hidden.

References fdActorCycleSpriteColors(), fdActorFaceDirectionById(), fdActorLookup(), fdActorSelectAnimationStub(), fdActorSetSpriteFlagsStub(), fdAdvanceWithGravity3D(), fdEffectSpriteDrawAtWorldPos(), fdEffectSpriteInit(), fdPartyGetLeaderActor(), fdPsynergyFadeToCastColor(), Sint32, syDecompressTaggedLZ(), syHeapSlotAllocate(), syHeapSlotRelease(), syRandom(), syResourceGetTableEntry(), sySoundPlayStub(), sySynch(), syVectorAddPolarOffset(), syVRAMCacheFindFreeEntry(), syVRAMCacheFreeEntry() and syVRAMCacheLoad().

Referenced by fdTeleportPlaySparksAndFade(), scAnemosInnerSanctumTeleportOut(), scContigoTeleportOut(), scLeaveByExit(), scMarsLighthouseEntranceTeleportFromBalm(), scMarsLighthouseEntranceTeleportFromDragonFaceNorth(), scMarsLighthouseEntranceTeleportFromDragonFaceSouth(), scMarsLighthouseEntranceTeleportFromHiddenCircle(), scMarsLighthouseEntranceTeleportFromNorthCircle(), scMarsLighthouseEntranceTeleportFromSouthCircle() and scMarsLighthouseHallTeleportToAerie().

Definition at line 206 of file field_psynergy_teleport.c.

fdTeleportPlaySparksAndFade

void fdTeleportPlaySparksAndFade(void)

Runs fdTeleportPlaySparks, fades the palettes back to the saved ones and waits 10 ticks.

References fdPsynergyFadeFromCastColor(), fdTeleportPlaySparks() and sySynch().

Referenced by fdEngineRun() and scLemuriaTeleportToGirlsHouse().

Definition at line 373 of file field_psynergy_teleport.c.

fdPsynergyTeleportOnTarget

void fdPsynergyTeleportOnTarget(void)

Teleport cast on a target: does nothing.

Referenced by fdPsynergyDispatch().

Definition at line 381 of file field_psynergy_teleport.c.

fdPsynergyTeleport

void fdPsynergyTeleport(void)

Teleport: raises FIELD_RAISED_CUE_TELEPORT, which shows the picture of the whole world for the player to choose where to go.

References fdActorLookup() and fdPartyGetLeaderActor().

Referenced by fdPsynergyRun().

Definition at line 387 of file field_psynergy_teleport.c.