Alchemy
Loading...
Searching...
No Matches

djinni.c File Reference

A Djinni's hop before its battle, joining the party, the effect slots. More...

Go to the source code of this file.

Macros

#define DJINNI_CLONE_MAX   8
 afterimages of the leaping Djinni

Functions

void ObjectMotion_MoveHalfwayTowardTarget (union FieldObject *fieldObject)
 Update hook shared by the Djinni battle-start and Mercury afterimages.
void Djinn_RunBattleStartHop (s32 djinniId)
 A Djinni's battle start: the Djinni (actor id) bounces twice, turns to face the leader, hops back 16 pixels three times, then leaps 64 pixels at the party trailing eight afterimages tinted for its element.
void Djinn_JoinParty (s32 slot, s32 element, s32 djinn)
 A Djinni joins the party: djinn (0 to 19) of element goes to the member with the fewest Djinn, or to no one and only its flag while FLAG_DJINN_TUTORIAL is set.
void FieldObject_PlaceSceneActors (void)
 Puts a Djinni's actor back where its battle started from: for a pending Djinni battle (pendingDjinnEvent 300 to 380, FLAG_KEEP_PARTY_POSITION set, the battle over) the scene actor placed for that Djinni (condition = its flag) goes back to its placement, or 32 pixels north of the leader when the event has 0x800 set.
void Djinn_ResolvePendingEvent (s32 shown)
 Settles a pending Djinni battle as a scene loads.
void BattleFx_UpdateAllSlots (void)
 Scheduler callback: updates the 24 effect slots.
void BattleFx_InitializeSlots (void)
 Allocates and clears the effect slots (heap block 56) and starts their update callback.
void BattleFx_ClearActiveSlotsAndScheduleUpdates (void)
 Stops the effect slots: removes their callback, frees every slot still in use and releases their heap block.
void BattleFx_AdvanceSpinAngle (union FieldObject *fieldObject)
 Per-frame update: spins an object 1/8 turn a frame.
void BattleFx_RunAngledApproachPhases (struct EffectSlot *particle)
 Effect slot callback of a Jupiter Djinni's light particles: each circles its centre while it widens for 60 frames, circles 40, drifts toward a point 20 pixels over the leader for 40, closes in for 60 and is freed.

Detailed Description

A Djinni's hop before its battle, joining the party, the effect slots.

Part of psynergy_effects.c, compiled only through it.

Definition in file djinni.c.

Macro Definition Documentation

◆ DJINNI_CLONE_MAX

#define DJINNI_CLONE_MAX   8

afterimages of the leaping Djinni

Definition at line 12 of file djinni.c.

Referenced by Djinn_RunBattleStartHop().

Function Documentation

◆ ObjectMotion_MoveHalfwayTowardTarget()

void ObjectMotion_MoveHalfwayTowardTarget ( union FieldObject * fieldObject)

Update hook shared by the Djinni battle-start and Mercury afterimages.

Definition at line 8 of file djinni.c.

Referenced by Djinn_RunBattleStartHop(), and ObjectMotion_MoveHalfwayTowardTarget().

◆ Djinn_RunBattleStartHop()

void Djinn_RunBattleStartHop ( s32 djinniId)

A Djinni's battle start: the Djinni (actor id) bounces twice, turns to face the leader, hops back 16 pixels three times, then leaps 64 pixels at the party trailing eight afterimages tinted for its element.

Definition at line 17 of file djinni.c.

Referenced by Djinn_RunBattleStartHop(), and Field_RequestDjinnBattle().

◆ Djinn_JoinParty()

void Djinn_JoinParty ( s32 slot,
s32 element,
s32 djinn )

A Djinni joins the party: djinn (0 to 19) of element goes to the member with the fewest Djinn, or to no one and only its flag while FLAG_DJINN_TUTORIAL is set.

Unless slot is -1, the Djinni's actor slot first plays its element's capture effect and is freed. Ends with <Djinni> joined <member>.

Definition at line 124 of file djinni.c.

Referenced by Djinn_JoinParty(), Djinn_ResolvePendingEvent(), Event_BaneJoins(), Event_GustJoins(), Event_MeetFlint(), Event_TalkToKite(), Event_TalkToVenusDjinni(), Imil_RecruitDjinni(), Kalay_RecruitDjinn(), KalayTolbiDocks_RecruitVenusDjinni(), Kolima_RecruitDjinni(), TalkToSmog(), TalkToTorch(), TestRooms_GiveDjinniForTesting(), Tolbi_JoinEmber(), and Xian_RecruitVillageDjinni().

◆ FieldObject_PlaceSceneActors()

void FieldObject_PlaceSceneActors ( void )

Puts a Djinni's actor back where its battle started from: for a pending Djinni battle (pendingDjinnEvent 300 to 380, FLAG_KEEP_PARTY_POSITION set, the battle over) the scene actor placed for that Djinni (condition = its flag) goes back to its placement, or 32 pixels north of the leader when the event has 0x800 set.

Definition at line 168 of file djinni.c.

Referenced by Field_RunScene(), and FieldObject_PlaceSceneActors().

◆ Djinn_ResolvePendingEvent()

void Djinn_ResolvePendingEvent ( s32 shown)

Settles a pending Djinni battle as a scene loads.

The field calls it with shown 0 while it builds the scene and with shown nonzero once the scene is on screen. After a won battle (sceneChangeReason above 0) the second call makes the Djinni join the party (Djinn_JoinParty); otherwise the first call sets flag 128 + the Djinni's number and drops the event. An event of kind 0x1000 instead sets its flag when sceneChangeReason is 1.

Definition at line 209 of file djinni.c.

Referenced by Djinn_ResolvePendingEvent(), Djinn_ResolvePendingEvent(), and Field_RunScene().

◆ BattleFx_UpdateAllSlots()

void BattleFx_UpdateAllSlots ( void )

Scheduler callback: updates the 24 effect slots.

Definition at line 257 of file djinni.c.

Referenced by BattleFx_ClearActiveSlotsAndScheduleUpdates(), BattleFx_InitializeSlots(), BattleFx_UpdateAllSlots(), and Djinn_ResolvePendingEvent().

◆ BattleFx_InitializeSlots()

void BattleFx_InitializeSlots ( void )

Allocates and clears the effect slots (heap block 56) and starts their update callback.

Definition at line 261 of file djinni.c.

Referenced by AltmillerCave_ReleaseWallBurst(), BattleFx_InitializeSlots(), BattleFx_RunMercuryDjinnCapture(), BattleFx_RunVenusDjinnCapture(), Djinn_ResolvePendingEvent(), Djinn_RunJupiterJoinEffect(), and Djinn_RunMarsJoinEffect().

◆ BattleFx_ClearActiveSlotsAndScheduleUpdates()

void BattleFx_ClearActiveSlotsAndScheduleUpdates ( void )

Stops the effect slots: removes their callback, frees every slot still in use and releases their heap block.

Definition at line 271 of file djinni.c.

Referenced by AltmillerCave_ReleaseWallBurst(), BattleFx_ClearActiveSlotsAndScheduleUpdates(), BattleFx_RunMercuryDjinnCapture(), BattleFx_RunVenusDjinnCapture(), Djinn_ResolvePendingEvent(), Djinn_RunJupiterJoinEffect(), and Djinn_RunMarsJoinEffect().

◆ BattleFx_AdvanceSpinAngle()

void BattleFx_AdvanceSpinAngle ( union FieldObject * fieldObject)

Per-frame update: spins an object 1/8 turn a frame.

Definition at line 287 of file djinni.c.

Referenced by BattleFx_AdvanceSpinAngle(), BattleFx_RunVenusDjinnCapture(), Djinn_ResolvePendingEvent(), and Djinn_RunJupiterJoinEffect().

◆ BattleFx_RunAngledApproachPhases()

void BattleFx_RunAngledApproachPhases ( struct EffectSlot * particle)

Effect slot callback of a Jupiter Djinni's light particles: each circles its centre while it widens for 60 frames, circles 40, drifts toward a point 20 pixels over the leader for 40, closes in for 60 and is freed.

Definition at line 295 of file djinni.c.

Referenced by BattleFx_RunAngledApproachPhases(), Djinn_ResolvePendingEvent(), and Djinn_RunJupiterJoinEffect().