Showing a found item, and Reveal's sparkles on hidden things. More...
Go to the source code of this file.
Data Structures | |
| struct | EffectObj |
| An actor as these effects see it. More... | |
Macros | |
| #define | EFFECT_OBJECT_COUNT 64 |
| ObjectSystem_Initialize allocates 64 ObjectRuntime records in heap slot 5. | |
| #define | EFFECT_OBJECT_POOL (*(struct EffectObj **)((u8 *)&gEventWork - 88)) |
| #define | SPARKLE_OBJECT_ID 285 |
Functions | |
| STATIC_ASSERT (offsetof(struct ObjectRuntime, velocityY)==0x28) | |
| STATIC_ASSERT (offsetof(struct ObjectRuntime, flags)==0x55) | |
| STATIC_ASSERT (offsetof(struct ObjectRuntime, animation)==0x50) | |
| STATIC_ASSERT (sizeof(struct EffectObj)==0x70) | |
| STATIC_ASSERT (offsetof(struct EffectObj, updateHook)==0x6c) | |
| void | Marker_MoveLeaderAway (void) |
| Keeps the party leader off the markers: a leader within 16 pixels of a marker cell's centre is moved 20 pixels from that centre, in the direction it stood, and loses its move target. | |
| static void | Object_InitializeSparkle (struct ObjectRuntime *obj) |
| Starts the particle script and its first child at priority 1, if the spawn succeeded. | |
| void | ItemDisplay_EmitSparkles (union FieldObject *fieldObject) |
| Each frame of a found item's picture: one time in ten, a sparkle appears within 16 pixels of it. | |
| struct EffectObj * | BattleFx_StartRandomParticleEmitter (s32 actor, s32 item) |
| Shows the picture of item (0 for none) at the centre of the cell 16 pixels in front of character actor, 16 pixels up, with sparkles. | |
| void | Object_DestroyIfPresent (void *object) |
| Releases object unless it is NULL. | |
| void | ItemDisplay_RaiseAboveLeader (struct ObjectRuntime *object) |
| Raises a found item's picture to 36 pixels above the party leader, who holds it up (animation 28) facing the screen. | |
| void | EffectRuntime_RunRisingObjectSequence (void *object, s32 flags) |
| Shows a found item's picture: flags bit 0 adds sparkles and bit 1 raises it above the leader, with waits of 60 and 80 frames around that when both are set. | |
| void | BattleFx_StartEffectObject22 (s32 item, s32 flags) |
| Shows the picture of item 36 pixels above the party leader for 80 frames; flags bit 0 adds sparkles and bit 1 raises it as a found item. | |
| void | RevealMarker_EmitSparkles (union FieldObject *fieldObject) |
| Each frame of a Reveal marker: one time in ten, a sparkle appears within 16 pixels of it. | |
| s32 | Field_IsRevealActive (struct ScriptInterpreter *interpreter) |
| Returns 1 while Reveal is active, else 0. | |
| void | FieldEffect_SpawnNearbyMarkers (void) |
| Reveal: marks with sparkles the hidden things within 8 cells left or right and 5 up or down of the leader: map places 100 to 239 with no marker actor, whose search event (kind 3) gives an item, coins, a Psynergy stone or a mimic (types 0 to 3 and 5) and whose flag is not yet set. | |
Showing a found item, and Reveal's sparkles on hidden things.
Part of object.c, the field object, compiled only through it.
Definition in file field_fx.c.
| #define EFFECT_OBJECT_COUNT 64 |
ObjectSystem_Initialize allocates 64 ObjectRuntime records in heap slot 5.
Definition at line 28 of file field_fx.c.
Referenced by BattleFx_StartRandomParticleEmitter().
| #define EFFECT_OBJECT_POOL (*(struct EffectObj **)((u8 *)&gEventWork - 88)) |
Definition at line 35 of file field_fx.c.
Referenced by BattleFx_StartRandomParticleEmitter().
| #define SPARKLE_OBJECT_ID 285 |
Definition at line 37 of file field_fx.c.
Referenced by ItemDisplay_EmitSparkles(), and RevealMarker_EmitSparkles().
| STATIC_ASSERT | ( | offsetof(struct ObjectRuntime, velocityY) | = =0x28 | ) |
| STATIC_ASSERT | ( | offsetof(struct ObjectRuntime, flags) | = =0x55 | ) |
| STATIC_ASSERT | ( | offsetof(struct ObjectRuntime, animation) | = =0x50 | ) |
| STATIC_ASSERT | ( | sizeof(struct EffectObj) | = =0x70 | ) |
| void Marker_MoveLeaderAway | ( | void | ) |
Keeps the party leader off the markers: a leader within 16 pixels of a marker cell's centre is moved 20 pixels from that centre, in the direction it stood, and loses its move target.
Only the first marker it stands on moves it. Called by two scene overlays (Suhalla Desert, Lamakan Desert).
Definition at line 43 of file field_fx.c.
Referenced by Event_RevealStarts(), Marker_MoveLeaderAway(), and Reveal_ShowSecrets().
|
inlinestatic |
Starts the particle script and its first child at priority 1, if the spawn succeeded.
Allocation failure leaves the effect absent.
Definition at line 84 of file field_fx.c.
Referenced by ItemDisplay_EmitSparkles(), Object_InitializeSparkle(), and RevealMarker_EmitSparkles().
| void ItemDisplay_EmitSparkles | ( | union FieldObject * | fieldObject | ) |
Each frame of a found item's picture: one time in ten, a sparkle appears within 16 pixels of it.
Installed as the picture's updateHook by BattleFx_StartRandomParticleEmitter, EffectRuntime_RunRisingObjectSequence and BattleFx_StartEffectObject22.
Definition at line 99 of file field_fx.c.
Referenced by BattleFx_StartEffectObject22(), BattleFx_StartRandomParticleEmitter(), EffectRuntime_RunRisingObjectSequence(), and ItemDisplay_EmitSparkles().
Shows the picture of item (0 for none) at the centre of the cell 16 pixels in front of character actor, 16 pixels up, with sparkles.
While Reveal is active, its sparkles are cleared first. Returns the picture's actor, or 0. The picture is object 22, thrown up (velocityY 2 << 16, gravity 0x4000), its icon drawn through heap block 17 and loaded into VRAM. Called by Field_SearchTile for coins and items found, and by BattleFx_PlayCueAndStartEmitterOnTarget.
Definition at line 132 of file field_fx.c.
Referenced by BattleFx_PlayCueAndStartEmitterOnTarget(), BattleFx_StartRandomParticleEmitter(), and Field_SearchTile().
| void Object_DestroyIfPresent | ( | void * | object | ) |
Releases object unless it is NULL.
Called by Field_SearchTile to drop the picture of an item nobody could carry.
Definition at line 212 of file field_fx.c.
Referenced by Field_SearchTile(), and Object_DestroyIfPresent().
| void ItemDisplay_RaiseAboveLeader | ( | struct ObjectRuntime * | object | ) |
Raises a found item's picture to 36 pixels above the party leader, who holds it up (animation 28) facing the screen.
Called by Field_SearchTile for what a search finds, by EffectRuntime_RunRisingObjectSequence and by BattleFx_StartEffectObject22.
Definition at line 221 of file field_fx.c.
Referenced by BattleFx_StartEffectObject22(), EffectRuntime_RunRisingObjectSequence(), Field_SearchTile(), and ItemDisplay_RaiseAboveLeader().
| void EffectRuntime_RunRisingObjectSequence | ( | void * | object, |
| s32 | flags ) |
Shows a found item's picture: flags bit 0 adds sparkles and bit 1 raises it above the leader, with waits of 60 and 80 frames around that when both are set.
The leader then returns to animation 1. Scene overlays call it as Engine_RunRisingObjectSequence (six of them).
Definition at line 244 of file field_fx.c.
Referenced by EffectRuntime_RunRisingObjectSequence().
Shows the picture of item 36 pixels above the party leader for 80 frames; flags bit 0 adds sparkles and bit 1 raises it as a found item.
Then it releases the picture and the leader returns to animation 1. Scene overlays call it as Engine_ItemShowFound (41 of them).
Definition at line 273 of file field_fx.c.
Referenced by BattleFx_StartEffectObject22().
| void RevealMarker_EmitSparkles | ( | union FieldObject * | fieldObject | ) |
Each frame of a Reveal marker: one time in ten, a sparkle appears within 16 pixels of it.
Installed as the marker's updateHook by FieldEffect_SpawnNearbyMarkers.
Definition at line 336 of file field_fx.c.
Referenced by BattleFx_ClearRandomParticles(), BattleFx_StartRandomParticleEmitter(), FieldEffect_SpawnNearbyMarkers(), and RevealMarker_EmitSparkles().
| s32 Field_IsRevealActive | ( | struct ScriptInterpreter * | interpreter | ) |
Returns 1 while Reveal is active, else 0.
Run by a Reveal marker's object script (gBattleFx_MarkerParticleScript) through SC_CALL.
Definition at line 361 of file field_fx.c.
Referenced by BattleFx_ClearRandomParticles(), and Field_IsRevealActive().
| void FieldEffect_SpawnNearbyMarkers | ( | void | ) |
Reveal: marks with sparkles the hidden things within 8 cells left or right and 5 up or down of the leader: map places 100 to 239 with no marker actor, whose search event (kind 3) gives an item, coins, a Psynergy stone or a mimic (types 0 to 3 and 5) and whose flag is not yet set.
Each mark is an object 22 running gBattleFx_MarkerParticleScript. Called by Reveal's effect (psynergy_effects/reveal.c).
Definition at line 380 of file field_fx.c.
Referenced by BattleFx_ClearRandomParticles(), FieldEffect_SpawnNearbyMarkers(), and FieldFx_RunReveal().