Using an item on the field. More...
Go to the source code of this file.
Typedefs | |
| typedef s32(*) | BattleItemCallback(s32 item, s32 actor, s32 slot) |
| An item's own field routine, which the scene's item event may name. | |
Functions | |
| s32 | Field_FindItemEvent (s32 item) |
| Returns the scene's item event (kind 4) for item that applies to what the leader faces, or 0 (item 0 matches any item). | |
| s32 | Field_UseItem (s32 packedItem, s32 slot) |
| Uses an item on the field. | |
| void * | BattleFx_FindMatchingEvent (s32 eventFlags, s32 group, void *target) |
| Returns the scene's Psynergy event (kind 5) for Psynergy of the given group that applies to what the leader faces, or NULL; stores the actor the Psynergy would target in *target. | |
| s32 | Field_RunPsynergyEvents (s32 packed) |
| Runs the scene's events for Psynergy without paying its PP or showing its usual effect (phases 3 and 2, around the event's own effect), as for a Psynergy that ends by itself: packed holds the Psynergy (bits 0 to 9) and its user (bits 10 to 13). | |
Using an item on the field.
Part of object.c, the field object, compiled only through it.
Definition in file items.c.
Returns the scene's item event (kind 4) for item that applies to what the leader faces, or 0 (item 0 matches any item).
The event's trigger names an actor (control flag 0x10) or a tile code, and may also require the leader to face within 0x17ff of a direction. Called by Field_UseItem, and by BattleFx_HasTrigger (psynergy.c) to test whether an item would do anything here.
Definition at line 16 of file items.c.
Referenced by BattleFx_HasTrigger(), Field_FindItemEvent(), and Field_UseItem().
Uses an item on the field.
packedItem holds the item (bits 0 to 9) and the character using it (bits 10 to 13; 15 for the character carrying most of it); slot is its inventory slot. The scene's item event for what the leader faces runs if there is one; otherwise an item with a field action uses it (Retreat asks first and leaves the scene). FLAG_NOTHING_HAPPENS still set afterwards says "But nothing happens."; FLAG_ITEM_USED_UP removes the item. Called by Field_RunScene for the item request (work->item and work->itemArgument). Retreat sets gGameState.scene and .entrance to the Retreat point and raises work->exit.
Definition at line 65 of file items.c.
Referenced by Field_RunScene(), and Field_UseItem().
Returns the scene's Psynergy event (kind 5) for Psynergy of the given group that applies to what the leader faces, or NULL; stores the actor the Psynergy would target in *target.
eventFlags gives the event's phase and kind (0x70000005 for any phase). The event may apply to any target (control flag 0x80), to an actor (0x10) or to a tile code. Called by Field_UsePsynergy for each phase, by Field_RunPsynergyEvents, and by the Force, Frost and Reveal effects (psynergy_effects/) for their own phases.
Definition at line 206 of file items.c.
Referenced by BattleFx_FindMatchingEvent(), BattleFx_HasMatchingEvent5(), Field_RunPsynergyEvents(), Field_UsePsynergy(), FieldFx_RunForce(), FieldFx_RunFrost(), FieldFx_RunReveal(), and ResetSceneTransitionEffect().
Runs the scene's events for Psynergy without paying its PP or showing its usual effect (phases 3 and 2, around the event's own effect), as for a Psynergy that ends by itself: packed holds the Psynergy (bits 0 to 9) and its user (bits 10 to 13).
Called by Field_UsePsynergy for a use with ACT_PACKED, and by Battle_ResetEffectCounter to end Reveal.
Definition at line 253 of file items.c.
Referenced by Battle_ResetEffectCounter(), Field_RunPsynergyEvents(), and Field_UsePsynergy().