Skip to Content
The Alchemy Project

src/field/field_engine_item_display.c

Showing a found item, and Reveal's sparkles on hidden things. More…

Included by field_engine.c.

Functions

NameDescription
voidfdTreasureSpotMoveLeaderAway (void)Keeps the party leader off the treasure spots: a leader within 16 pixels of a treasure spot's centre is moved 20 pixels from that centre, in the direction it stood, and loses its move target.
static inline voidfdActorInitSparkle (ACTOR *actor)Starts a sparkle twinkling, drawn at priority 1; one that could not be spawned is left out.
voidfdItemDisplayEmitSparkles (ACTOR *emitter)Each tick of a found item's picture: one time in ten, a sparkle appears within 16 pixels of it.
ACTOR *fdItemDisplayShowItemInFront (Sint32 actorId, Sint32 item)Shows the picture of item (0 for none) at the centre of the metatile 16 pixels in front of character actorId, at a height of 16 pixels whatever the actor's, with sparkles.
voidfdActorReleaseIfPresent (void *object)Releases object unless it is NULL.
voidfdItemDisplayRaiseAboveLeader (ACTOR *actor)Raises a found item's picture to 36 pixels above the party leader, who holds it up (ANIM_LEADER_ARMS_RAISED) facing the screen.
voidfdItemDisplayShowPicture (void *object, Sint32 flags)Shows a found item's picture, with sparkles (ITEM_DISPLAY_SPARKLES) or held up by the leader (ITEM_DISPLAY_RAISED); with both it sparkles for 60 ticks before he raises it, and he holds it 80.
voidfdItemDisplayShowItem (Sint32 item, Sint32 flags)Shows the picture of item 36 pixels above the party leader for 80 ticks, with sparkles (ITEM_DISPLAY_SPARKLES) or held up as a found item (ITEM_DISPLAY_RAISED).
voidfdEffectReleaseRevealSparkles (void)While Reveal is active, releases all its sparkles, leaving its marks.
voidfdRevealEmitSparkles (ACTOR *actor)Each tick of a Reveal marker: one time in ten, a sparkle appears within 16 pixels of it.
BoolfdIsRevealActive (ACTOR *interpreter)Returns 1 while Reveal is active, else 0.
voidfdEffectSpawnRevealMarkers (void)Reveal: marks with sparkles the hidden things within 8 metatiles left or right and 5 up or down of the leader: treasure spots (ids 100 to 239) with no actor placed, whose examine cue (CUE_EXAMINE) gives an item, coins, a Psynergy Stone or a mimic and whose flag is not yet set.

Description

Showing a found item, and Reveal's sparkles on hidden things. Part of field_engine.c.

Functions in detail

fdTreasureSpotMoveLeaderAway

void fdTreasureSpotMoveLeaderAway(void)

Keeps the party leader off the treasure spots: a leader within 16 pixels of a treasure spot's centre is moved 20 pixels from that centre, in the direction it stood, and loses its move target.

References fdActorLookup(), MainRoutineStateWork, Sint32, syAtan() and syVectorAddPolarOffset().

Referenced by scRevealShowSecrets() and scSuhallaDesertRevealStarts().

Definition at line 9 of file field_engine_item_display.c.

fdActorInitSparkle

static inline void fdActorInitSparkle(ACTOR *actor)

Starts a sparkle twinkling, drawn at priority 1; one that could not be spawned is left out.

References fdActorSelectAnimationStub(), fdActorStartScriptStub() and FieldEffectParticleScript.

Referenced by fdItemDisplayEmitSparkles() and fdRevealEmitSparkles().

Definition at line 57 of file field_engine_item_display.c.

fdItemDisplayEmitSparkles

void fdItemDisplayEmitSparkles(ACTOR *emitter)

Each tick of a found item's picture: one time in ten, a sparkle appears within 16 pixels of it.

References fdActorInitSparkle(), fdActorSpawn(), syRandom() and syVectorAddPolarOffset().

Referenced by fdItemDisplayShowItem(), fdItemDisplayShowItemInFront() and fdItemDisplayShowPicture().

Definition at line 69 of file field_engine_item_display.c.

fdItemDisplayShowItemInFront

ACTOR *fdItemDisplayShowItemInFront(Sint32 actorId, Sint32 item)

Shows the picture of item (0 for none) at the centre of the metatile 16 pixels in front of character actorId, at a height of 16 pixels whatever the actor's, with sparkles.

References fdActorCreateStub(), fdActorReleaseStub(), fdActorStartScriptStub(), fdItemDisplayEmitSparkles(), fdRevealEmitSparkles(), FieldEffectParticleScript, ItemDisplayGrowInScript, mnIconDrawItemStub(), Sint32, state, syHeapSlotAllocate(), syHeapSlotRelease(), sySynch(), syVectorAddPolarOffset() and syVRAMCacheLoad().

Referenced by fdChestOpenAndShowItem() and fdExamineMetatile().

Definition at line 99 of file field_engine_item_display.c.

fdActorReleaseIfPresent

void fdActorReleaseIfPresent(void *object)

Releases object unless it is NULL.

References fdActorReleaseStub().

Referenced by fdExamineMetatile().

Definition at line 186 of file field_engine_item_display.c.

fdItemDisplayRaiseAboveLeader

void fdItemDisplayRaiseAboveLeader(ACTOR *actor)

Raises a found item's picture to 36 pixels above the party leader, who holds it up (ANIM_LEADER_ARMS_RAISED) facing the screen.

References fdActorLookup(), fdActorSelectAnimationStub(), fdActorSetMoveTargetStub(), fdActorStartScriptStub(), ItemDisplayPulseScript, MainRoutineStateWork and sySynch().

Referenced by fdExamineMetatile(), fdItemDisplayShowItem() and fdItemDisplayShowPicture().

Definition at line 194 of file field_engine_item_display.c.

fdItemDisplayShowPicture

void fdItemDisplayShowPicture(void *object, Sint32 flags)

Shows a found item's picture, with sparkles (ITEM_DISPLAY_SPARKLES) or held up by the leader (ITEM_DISPLAY_RAISED); with both it sparkles for 60 ticks before he raises it, and he holds it 80.

References fdActorLookup(), fdActorSelectAnimationStub(), fdActorSetSpriteFlagsStub(), fdActorStartScriptStub(), fdItemDisplayEmitSparkles(), fdItemDisplayRaiseAboveLeader(), ItemDisplayGrowInScript, MainRoutineStateWork, Sint32 and sySynch().

Referenced by scFuchinFallsCaveFindDragonsEye(), scSolSanctumElementalStarRoomPresentStarFX() and scSolSanctumEruptionPlayWiseOneRescue().

Definition at line 219 of file field_engine_item_display.c.

fdItemDisplayShowItem

void fdItemDisplayShowItem(Sint32 item, Sint32 flags)

Shows the picture of item 36 pixels above the party leader for 80 ticks, with sparkles (ITEM_DISPLAY_SPARKLES) or held up as a found item (ITEM_DISPLAY_RAISED).

References fdActorCreateStub(), fdActorLookup(), fdActorReleaseStub(), fdActorSelectAnimationStub(), fdItemDisplayEmitSparkles(), fdItemDisplayRaiseAboveLeader(), MainRoutineStateWork, mnIconDrawItemStub(), Sint32, syHeapSlotAllocate(), syHeapSlotRelease(), sySynch() and syVRAMCacheLoad().

Referenced by gmItemShowFound(), scCatchNut(), scKalayCatchTownNut(), scLogRoomsBOfferBones(), scMercuryLighthouseFillHermesWaterBottle() and scVaultFindBone().

Definition at line 253 of file field_engine_item_display.c.

fdEffectReleaseRevealSparkles

void fdEffectReleaseRevealSparkles(void)

While Reveal is active, releases all its sparkles, leaving its marks.

References fdActorReleaseStub(), FieldEffectParticleScript and Sint32.

Definition at line 295 of file field_engine_item_display.c.

fdRevealEmitSparkles

void fdRevealEmitSparkles(ACTOR *actor)

Each tick of a Reveal marker: one time in ten, a sparkle appears within 16 pixels of it.

References fdActorInitSparkle(), fdActorSpawn(), syRandom() and syVectorAddPolarOffset().

Referenced by fdEffectSpawnRevealMarkers() and fdItemDisplayShowItemInFront().

Definition at line 318 of file field_engine_item_display.c.

fdIsRevealActive

Bool fdIsRevealActive(ACTOR *interpreter)

Returns 1 while Reveal is active, else 0.

References state.

Referenced by RevealMarkerScript.

Definition at line 343 of file field_engine_item_display.c.

fdEffectSpawnRevealMarkers

void fdEffectSpawnRevealMarkers(void)

Reveal: marks with sparkles the hidden things within 8 metatiles left or right and 5 up or down of the leader: treasure spots (ids 100 to 239) with no actor placed, whose examine cue (CUE_EXAMINE) gives an item, coins, a Psynergy Stone or a mimic and whose flag is not yet set.

References fdActorCreateStub(), fdActorLookup(), fdActorSetSpriteFlagsStub(), fdActorStartScriptStub(), fdRevealEmitSparkles(), fdTreasureSpotGetActor(), gmFlagGetStub(), MainRoutineStateWork, OverlayArea, RevealMarkerScript and Sint32.

Referenced by fdPsynergyReveal().

Definition at line 359 of file field_engine_item_display.c.