Alchemy

djinni.c

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

games/tbs/src/object/psynergy_effects/djinni.c on GitHub

A Djinni's hop before its battle, joining the party, the effect slots. Part of psynergy_effects.c, compiled only through it.

Functions

ObjectMotion_MoveHalfwayTowardTarget

void ObjectMotion_MoveHalfwayTowardTarget(union FieldObject *fieldObject)

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

Used by Djinn_RunBattleStartHop.

Line 8

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.

Used by Field_RequestDjinnBattle.

Line 17

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>.

Used by Djinn_ResolvePendingEvent, Event_BaneJoins, Event_GustJoins, Event_MeetFlint, Event_TalkToKite, Event_TalkToVenusDjinni, Imil_RecruitDjinni, KalayTolbiDocks_RecruitVenusDjinni, Kalay_RecruitDjinn, Kolima_RecruitDjinni, TalkToSmog, TalkToTorch, TestRooms_GiveDjinniForTesting, Tolbi_JoinEmber, Xian_RecruitVillageDjinni.

Line 124

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.

Used by Field_RunScene.

Line 168

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.

Used by Field_RunScene.

Line 209

BattleFx_UpdateAllSlots

void BattleFx_UpdateAllSlots(void)

Scheduler callback: updates the 24 effect slots.

Used by BattleFx_ClearActiveSlotsAndScheduleUpdates, BattleFx_InitializeSlots.

Line 257

BattleFx_InitializeSlots

void BattleFx_InitializeSlots(void)

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

Used by AltmillerCave_ReleaseWallBurst, BattleFx_RunMercuryDjinnCapture, BattleFx_RunVenusDjinnCapture, Djinn_RunJupiterJoinEffect, Djinn_RunMarsJoinEffect.

Line 261

BattleFx_ClearActiveSlotsAndScheduleUpdates

void BattleFx_ClearActiveSlotsAndScheduleUpdates(void)

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

Used by AltmillerCave_ReleaseWallBurst, BattleFx_RunMercuryDjinnCapture, BattleFx_RunVenusDjinnCapture, Djinn_RunJupiterJoinEffect, Djinn_RunMarsJoinEffect.

Line 271

BattleFx_AdvanceSpinAngle

void BattleFx_AdvanceSpinAngle(union FieldObject *fieldObject)

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

Used by BattleFx_RunVenusDjinnCapture, Djinn_RunJupiterJoinEffect.

Line 287

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.

Used by Djinn_RunJupiterJoinEffect.

Line 295

Macros, without a comment: DJINNI_CLONE_MAX.

On this page