8#if (LANGUAGE == LANGUAGE_GERMAN)
9#define GIFT_RECEIVED_MESSAGE MsgGaveItemToMember
10#define GIFT_RECEIVED_MESSAGE_MODE 1
11#elif (LANGUAGE == LANGUAGE_SPANISH) || (LANGUAGE == LANGUAGE_FRENCH) || \
12 (LANGUAGE == LANGUAGE_ITALIAN)
13#define GIFT_RECEIVED_MESSAGE (MsgColossoIsaacGotItem + 1)
14#define GIFT_RECEIVED_MESSAGE_MODE 1
16#define GIFT_RECEIVED_MESSAGE (MsgColossoIsaacGotItem + 1)
17#define GIFT_RECEIVED_MESSAGE_MODE 3
25#if (LANGUAGE == LANGUAGE_GERMAN)
71 object->speedLimit = 0x10000;
72 object->acceleration = 0x8000;
75 object->velocityX = 0;
76 object->velocityZ = 0;
187 s32 member = (shortcut >> 10) & 0xf;
188 s32 ability = shortcut & 0x3ff;
218 s32 survivingMembers;
228 survivingMembers = 0;
230 for (partyIndex = 0; partyIndex < partyCount; partyIndex++) {
235 if (survivingMembers == 0) {
250 s32 heldQuantity = 0;
254 for (partyIndex = 0; partyIndex < partyCount; partyIndex++)
258 if (heldQuantity >= partyCount * 30) {
328 s32 selectedSlot = slot;
335#if !(TBS_PATCH_1 && !TBS_PATCH_2)
343 for (discardIndex = 0; discardIndex < discardQuantity; discardIndex++)
397 u8 *animationNumber =
400 while (frames <= 89) {
402 if (animation != *animationNumber) {
435 if (forceBottom == 0) {
440 if (bottom < sideBottom)
538 state->
exit = request;
541#undef GIFT_RECEIVED_MESSAGE
542#undef GIFT_RECEIVED_MESSAGE_MODE
void Object_SetModeById(u32 objectId, s32 animation)
The event command "set actor animation" (1 stands, 2 walks, 3 nods, 4 shakes the head and so on).
void * ObjectTable_Get(u32 actorIndex)
Returns the actor in slot index (0 to 65), or NULL.
s32 ObjectTable_FindLastActiveId(void)
Returns the slot after the last placed actor (8 when there is none), or -1 when slot 65 is occupied.
void ObjectTable_ResetForObject(struct ScenePlacement *table)
Creates a scene's actors on entering it: the party leader where the game state puts it,...
void Event_SpawnObjectTable(struct ScenePlacement *entry, s32 slot)
Creates the actors of a scene's placement table (ended by sprite -1), and records the table among the...
#define Unit_UpdateGauges(unit)
Recalculates HP and PP gauges, keeping at least one when any points remain.
void Camera_FollowActor(s32 actor, s32 keepPosition)
The event command "camera follow actor": the camera (the event's view centre) follows actor.
void ObjectDispatch_SelectAnimationFar(void *raw, s32 no)
s32 Party_AddActiveOwnerFar(s32 value)
struct BattleUnit * UnitGetFar(u32 owner)
struct ItemDefinition * Item_GetDirectFar(s32 item)
s32 Inventory_CountItemFar(s32 owner, s32 item_id)
s32 Item_AdjustCounterFar(s32 item_id, s32 delta)
s32 GameFlag_TestFar(s32 flag)
s32 Inventory_AddItemFar(s32 owner_id, s32 item_id)
s32 Unit_LearnPsynergyFar()
s32 Party_RemoveActiveOwnerFar(s32 value)
s32 Shop_GetSelectionState(s32 owner, s32 slot)
Far call to Inventory_GetQuantity.
s32 Unit_KnowsActionFar(s32 owner, s32 value)
void GameFlag_RefreshLureCapFar(void)
s32 PartyInventory_AddFar(s32 item_id)
s32 Party_CountActiveOwnersFar(void)
void GameFlag_ClearBitFar(s32 flag)
s32 Inventory_DiscardFar(s32 owner, s32 slot)
s32 Shop_PickUnitItemFar(s32 *selected_unit, s32 *selectedItem)
void AudioCommand_PlayFar(s32 id)
void Party_ShowPairJoinedMessageFar(s32 first, s32 second)
void Party_ShowJoinedMessageFar()
void UiText_ShowPositionedMessageAndWaitFar(s32 no, s32 flags)
void UiTimedNotice_CloseIfActiveFar(void)
void UiWork_PushValueSlotFar(u32 value, u32 kind)
void UiWork_FinalizeEntityMatchingLocalizedIdFar(u32 entry)
s32 UiWork_IsCompleteFar(void)
s32 Menu_RunConfirmSelectionFar(s32 low, s32 message, s32 w, s32 selection)
void UiWork_FinalizePendingCoreFar(void)
#define ACTOR_NO_TARGET
A target coordinate that is not set: the object has no target.
void WaitFrames(s32 frames)
The game's frame loop: runs frames frames and returns.
u8 gDebugMode
Debug builds: Start+Select pauses the frame loop.
struct GameState gGameState
volatile u32 gKeysPressed
Keys that went down this frame.
struct ScenePlacement * Scene_FindActorPlacement(s32 id)
Returns the placement of actor id in the scene's placement tables, or NULL: for a party character (0 ...
void Battle_ResetEffectCounter(void)
Clears the field's busy flag and, while Reveal is active, ends it: Reveal used with ACT_PACKED runs i...
void DisplayTransition_Start(s32 mode, s32 frames)
Fades the screen in over frames frames.
void DisplayTransition_Finish(s32 mode, s32 frames)
Fades the screen out over frames frames, as DisplayTransition_Start fades it in.
s32 Event_AskYesNoWithActorAnimation(s32 actor, s32 forceBottom)
The event command "choose yes or no": once the message on screen has been read, asks yes or no below ...
void Event_SetExitRequest(u16 request)
The event command "request exit": sets the field's exit request (999 leaves for gGameState's scene an...
void Event_SetSavedDestination(u16 scene, u16 entrance)
Makes the event leave and records scene and entrance as the saved destination.
#define GIFT_RECEIVED_MESSAGE_MODE
void Actor_WaitForAnimationEnd(s32 actor, s32 animation)
Waits, at most 90 frames, for an actor's animation to stop being animation: the actor has finished a ...
s32 Menu_AskYesNo(s32 atBottom)
Asks yes or no at the top of the screen, or at the bottom with atBottom set.
s32 PartyInventory_GiveItem(s32 item, s32 unused)
The event command "give item": gives item to the first party member with room for it and says so.
static void ItemGift_ShowGotItem(s32 item, s32 flags)
Shows the message for an item the party has just received.
UNUSED void Event_NoOpHookA(void)
Nothing calls it.
void Leader_StopMoving(void)
Stops the leader where it stands: no horizontal velocity, the normal walking speed (1....
void FieldEvent_End(void)
Ends an event: stops the debug fast-forward callback, gives the camera back to the leader and refresh...
void Event_UpdateDebugSkip(void)
Debug only: while debug mode is on, R makes every event wait (FieldEvent_WaitFrames) end at once and ...
void Event_FinishScreenTransition(void)
The event command "close screen": finishes the event's screen transition and clears work->transitionA...
void Event_SetSceneEvents(const struct SceneEvent *events)
Sets the scene's event table, which the field checks as the leader moves: writes work->events.
void Inventory_NoOpCallback(void)
An empty function; nothing in ☀️ calls it.
void Event_ClearInvalidPackedValues(void)
Clears each button shortcut whose Psynergy can no longer be cast: zeroes gGameState....
#define GIFT_RECEIVED_MESSAGE
void Event_WaitTransitionFrames(void)
The event command "wait for screen": waits as long as the transition runs (work->transitionFrames).
void FieldEvent_WaitFrames(s32 frames)
The event command "wait": waits the requested frames, unless debug fast forward (Event_UpdateDebugSki...
s32 Party_CheckItemLimit(s32 item)
Checks whether the party can carry one more of item: each member carries at most 30 of one item.
void Event_PrepareTwoObjectsAndApply(s32 first, s32 second)
Adds two units to the party and announces them together.
void Party_RemoveOwnerRestored(s32 unit)
Takes unit out of the party, fully restoring its HP and PP and curing its poison.
void Event_RunObjectHookAndWait(struct ScenePlacement *table)
Respawns the scene's actors from a placement table and waits one frame for them to appear.
void Event_StartScreenTransition(void)
The event command "open screen": starts the event's screen transition and sets work->transitionActive...
s32 Inventory_TryAddAndReturnOwner(s32 item, s32 unused, s32 unit)
Gives item to one party member.
void Event_SetDestination(s32 scene, s32 entrance)
Makes the event leave for the given entrance of the given scene: raises the exit request 999 and writ...
void Event_CallWithLastActiveObjectId(struct ScenePlacement *table)
Spawns the actors of a placement table after the last actor in use.
void FieldEvent_Begin(void)
The event command "begin event": closes any timed notice, stops the leader, resets the message and ti...
s32 Event_ValidatePackedId(u32 shortcut)
Checks an L or R button shortcut, packed as the member in bits 10 to 13 and the Psynergy in bits 0 to...
void Event_NoOpHook(void)
An empty hook; it does nothing in the released game.
void Event_PrepareObjectAndApplyValue(s32 unit, s32 announce)
Adds unit to the party.
void Inventory_ReservedNoOp(void)
An empty function; nothing in ☀️ calls it.
void Party_LearnAbility(s32 unit, s32 ability)
Teaches unit the Psynergy ability and says so with its jingle, waiting for the player to read it.
What every part of psynergy_effects.c shares: its includes and the macros and types more than one par...
s32 Scheduler_AddOrUpdateCallback(SchedulerCallback callback, s32 order)
Schedules callback with order, or gives a task already running it the new order, and re-sorts the tab...
s32 Scheduler_RemoveCallback(SchedulerCallback callback)
Unschedules the task running callback: clears its routine and gives it order 0x7fff,...
#define MUS_TREASURE_FOUND
struct EventWork * gEventWork
An animated sprite: its image and shadow, scale, rotation, size and up to four animation layers.
u8 lastNo
The animation number last selected, which selecting again skips.
A unit in battle: a party member's or an enemy's stats, Psynergy, items, Djinn and ailments.
s16 maxPp
0 to 1999 for a character, 9999 for an enemy (UnitCalc)
s8 poison
1 poisoned, 2 deadly poison
s16 hp
current HP, 0 when downed
s16 maxHp
0 to 1999 for a character, 9999 for an enemy (UnitCalc)
Full event work allocated by Field_RunScene (heap slot 27).
s16 exit
the exit taken, which ends the scene
u16 transitionActive
set once the opening transition has started
s16 unk1de
set to -1 by FieldEvent_Begin; not read by name
const struct SceneEvent * events
the scene's event table
s16 unk1dc
set to -1 by FieldEvent_Begin; not read by name
s32 transition
SCENE_TRANSITION(style, variant); 0x100 on entry.
u16 busy
Set while a raised or touch event runs; FieldEvent_Begin then resets the effect counter.
s32 fastForward
debug: skip timed event waits and actor messages
u16 unk1da
set to 0xffff by FieldEvent_Begin; not read by name
s16 nameMessage
first message of the menu's name window (0: none)
s32 speaker
the actor speaking; the leader at each event
s16 message
the next message, advanced as each window opens
s16 nameWidth
width of the name window (0: the default)
s32 sideWindow
the speaker's portrait window
s32 messageWindow
the open message window, 0 for none
s16 item
an item to use, packed as Field_UseItem reads it
s32 transitionFrames
frames; 16 on entry and at each event
u16 firstShortcut
The shortcuts' assignments.
u8 activeOwners[8]
the party in order
u8 movementMode
1 while the leader is climbing, 0 otherwise
s32 selectedActor
the leader: its unit and its actor
s16 savedScene
where a defeat returns to without a defeat point
s16 savedEntrance
where a defeat returns to without a defeat point
One of the 64 field objects in the object pool (heap slot 5): its script, position,...
void * animation
its sprite, or its list of four, by animationKind
u8 animationKind
Low four bits: 0 no sprite, 1 one sprite, 2 a group of up to four.
A scene event: its kind and detail, the trigger it answers, its condition and its value (a message or...
An actor a scene places: its sprite, the condition for placing it, how it behaves,...
s16 sprite
The actor's sprite; 0 to 7 are the party's characters, each in its own actor slot,...
A window: a framed rectangle of the tilemap with its sprite outputs, its opening or closing animation...