Alchemy
Loading...
Searching...
No Matches

level.c

Go to the documentation of this file.
1#include "game_state.h"
2#include "unit/debug/level.h"
5#include "unit/game/game.h"
8#include "battle.h"
9#include "keystate.h"
10#include "debug.h"
11#include "field.h"
12#include "game.h"
13#include "graphics.h"
14#include "menu.h"
15#include "minigame.h"
16#include "sound.h"
17#include "system.h"
18#include "level.h"
19#include "field_service.h"
20#include "field_obj.h"
21#include "party_state.h"
22#include "types.h"
23#include "io_reg.h"
24#include "inventory.h"
25#include "dma.h"
26#include "text_render_runtime.h"
27#include "item.h"
28#include "edition.h"
29#include "uiflow.h"
30#include "text/msg_ids.h"
31#include "field_scene.h"
32#include "fx_scene.h"
33#include "songs.h"
34
35// Edition-specific text and window layout values.
36#if TBS_PATCH_1
37#define ITEM_DEBUG_DETAILS_WIDTH 28
38#define ITEM_DEBUG_DRAW_ITEM_NAME UiText_DrawCharacterAtOffset
39#else
40#define ITEM_DEBUG_DETAILS_WIDTH 13
41#define ITEM_DEBUG_DRAW_ITEM_NAME UiText_DrawResource
42#endif
43
44#define ITEM_COUNT 270
45#define ABILITY_COUNT 270
46#define BROWSER_ROW_STEP 10
47#define BROWSER_PAGE_STEP 30
48
50
51s32 SceneData_ReturnZero(void) { return 0; }
52
54
56
57#if TBS_PATCH_1
58/// Sets the test message before displaying the first emote on actor 13.
59/// The emote's actual type remains unnamed.
61 Engine_EventSetMessage(MsgDebugWontStopYou);
62 Actor_ShowEmote(13, 0x102, 0);
64}
65
66/// Displays the other test emote before setting actor 13's message.
68 Actor_ShowEmote(13, 0x105, 0);
69 Engine_EventSetMessage(MsgDebugWontStopYou);
71}
72#endif
73
75
76/// Raises one owner's level by amount, then recalculates that unit.
77static void ItemLevel_AdjustOwnerLevel(s32 ownerId, s32 amount) {
78 struct BattleUnit *unit = UnitGet(ownerId);
79
80 Unit_LevelUpTo(ownerId, unit->level + amount);
81 UnitCalc(ownerId);
82}
83
84/// Applies the level change to the owners returned by the active-party service.
85static void ItemLevel_AdjustPartyLevels(s32 amount) {
86 u16 ownerIds[16];
87 u16 *owner;
88 s32 ownerCount;
89
90 ownerCount = FieldParty_ListActiveOwners(ownerIds);
91 if (ownerCount > 0) {
92 s32 remaining;
93 owner = ownerIds;
94 remaining = ownerCount;
95 do {
96 ItemLevel_AdjustOwnerLevel(*owner++, amount);
97 } while (--remaining != 0);
98 }
99}
100
101/// Displays the selected owner's level and changes all active owners.
102/// B closes the window and recalculates the original four heroes.
103static void ItemLevel_RunLevelEditor(void) {
104 struct BattleUnit *unit;
105 struct UiWindow *window;
106 s32 redraw;
107 s32 messageId;
108
110 window = UiWindow_Create(0, 0, 30, 9, 2);
111
112 messageId = MsgDebugRaiseEveryonesLevel;
113 UiText_DrawResource(messageId, window, 0, 0);
114 UiText_DrawResource(messageId + 1, window, 0, 16);
115 messageId += 2;
116 redraw = 1;
117 UiText_DrawResource(messageId, window, 0, 32);
118
119 for (;;) {
120 if (redraw != 0) {
122 UiText_DrawStringAtOffset(unit->name, window, 0, 48);
124 redraw = 0;
125 UiText_DrawNumberInWindow(unit->level, 0, window, 72, 48);
126 }
127
128 // Start/Select add five levels; A adds one. Tests remain independent.
129 if ((gKeysPressed & KEY_START) != 0 || (gKeysPressed & KEY_SELECT) != 0) {
132 redraw = 1;
133 }
134
135 if ((gKeysPressed & KEY_A) != 0) {
138 redraw = 1;
139 }
140
141 if ((gKeysPressed & KEY_B) != 0) {
145 UiWork_Finalize(window, 1);
146
149 UnitCalc(MIA);
150 UnitCalc(IVAN);
151 return;
152 }
153
155 }
156}
157
158/// Browses nonempty item definitions and gives the selected item to the party.
159static void ItemLevel_SelectItem(void) {
160 // Preserve independent key tests and the direction-specific empty-icon scans.
161 // Ordinary while scans grow the native function from 0x29c to 0x2a0; retain
162 // its current polling edges.
163 struct UiWindow *window;
164 struct UiWindow *details;
165 s32 selectedItemId;
166 s32 redraw;
167 s32 messageOrDefinitionId;
168 s32 entryCount;
169 s8 seekDirection;
170
171 entryCount = ITEM_COUNT;
172 seekDirection = 0;
173 selectedItemId = 1;
175 redraw = 1;
176 window = UiWindow_Create(0, 0, 30, 7, 2);
177 details = UiWindow_Create(0, 8, ITEM_DEBUG_DETAILS_WIDTH, 10, 2);
178 // Copy the existing sprite palette into the debug window palettes.
179 Dma_Set((const void *)OBJ_PLTT, (void *)&BG_PLTT_COLOR(14, 0),
180 DMA_ENABLE << 16 | 0x10, REG_DMA3);
181 Dma_Set((const void *)&BG_PLTT_COLOR(15, 4), (void *)&BG_PLTT_COLOR(14, 14),
182 DMA_ENABLE << 16 | 1, REG_DMA3);
184 while (1) {
185 if (redraw) {
186 redraw = 0;
187 selectedItemId = (selectedItemId + ITEM_COUNT) % entryCount;
191 UiText_DrawNumberAtOffset(selectedItemId, 0, window, 80, 0);
194 messageOrDefinitionId = selectedItemId & 0x1ff;
195 Engine_DebugGetItem(messageOrDefinitionId);
196 UiText_DrawCharacterAtOffset(messageOrDefinitionId + MsgItemName,
197 window, 120, 0);
198 ITEM_DEBUG_DRAW_ITEM_NAME(messageOrDefinitionId + MsgItemPlainName,
199 window, 0, 16);
201 Engine_DebugDrawItemDetails(details, selectedItemId);
202 } else {
204 }
205 }
206 if (gKeysPressed & KEY_A) {
207 if (PartyInventory_Add(selectedItemId) == -1) {
209 break;
210 }
212 }
213 if (gKeysPressed & KEY_B) {
215 break;
216 }
217 if (gKeysRepeat & KEY_UP) {
218 seekDirection = -1;
219 selectedItemId--;
220 redraw = 1;
222 }
223 if (gKeysRepeat & KEY_DOWN) {
224 seekDirection = 1;
225 selectedItemId++;
226 redraw = 1;
228 }
229 if (gKeysRepeat & KEY_RIGHT) {
230 seekDirection = 1;
231 selectedItemId += BROWSER_ROW_STEP;
232 redraw = 1;
234 }
235 if (gKeysRepeat & KEY_LEFT) {
236 seekDirection = -1;
237 selectedItemId -= BROWSER_ROW_STEP;
238 redraw = 1;
240 }
241 if (gKeysRepeat & KEY_R) {
242 seekDirection = 1;
243 selectedItemId += BROWSER_PAGE_STEP;
244 redraw = 1;
246 }
247 if (gKeysRepeat & KEY_L) {
248 seekDirection = -1;
249 selectedItemId -= BROWSER_PAGE_STEP;
250 redraw = 1;
252 }
253 // Skip definitions with no icon/availability byte in the chosen direction.
254 if (seekDirection == -1) {
255 selectedItemId = (selectedItemId + ITEM_COUNT) % entryCount;
256 goto check_back;
257 back:
258 selectedItemId = (selectedItemId + ITEM_COUNT - 1) % entryCount;
259 check_back:
260 if (Engine_DebugGetItem(selectedItemId & 0x1ff)->icon == 0)
261 goto back;
262 }
263 if (seekDirection == 1) {
264 selectedItemId = (selectedItemId + ITEM_COUNT) % entryCount;
265 goto check_ahead;
266 ahead:
267 selectedItemId = (selectedItemId + ITEM_COUNT + 1) % entryCount;
268 check_ahead:
269 if (Engine_DebugGetItem(selectedItemId & 0x1ff)->icon == 0)
270 goto ahead;
271 }
272 seekDirection = 0;
274 }
277 UiWork_Finalize(window, 1);
278 UiWork_Finalize(details, 1);
279}
280
281#if TBS_PATCH_1
282/// Browses ability names and descriptions, skipping unavailable entries. B
283/// closes the sole window created by this browser.
285 // Ordinary while scans grow the native function from 0x248 to 0x260; retain
286 // the original polling edges.
287 struct UiWindow *window;
288#ifndef UBFIX
289 struct UiWindow *details;
290#endif
291 s32 selectedAbilityId;
292 s32 redraw;
293 s32 messageOrDefinitionId;
294 s32 entryCount;
295 s8 seekDirection;
296
297 entryCount = ABILITY_COUNT;
298 seekDirection = 0;
299 selectedAbilityId = 1;
301 redraw = 1;
302 window = UiWindow_Create(0, 0, 30, 12, 2);
303 // Copy the existing sprite palette into the debug window palettes.
304 Dma_Set((const void *)OBJ_PLTT, (void *)&BG_PLTT_COLOR(14, 0),
305 DMA_ENABLE << 16 | 0x10, REG_DMA3);
306 Dma_Set((const void *)&BG_PLTT_COLOR(15, 4), (void *)&BG_PLTT_COLOR(14, 14),
307 DMA_ENABLE << 16 | 1, REG_DMA3);
309 while (1) {
310 if (redraw) {
311 redraw = 0;
312 selectedAbilityId = (selectedAbilityId + ABILITY_COUNT) % entryCount;
316 UiText_DrawNumberAtOffset(selectedAbilityId, 0, window, 80, 0);
318 messageOrDefinitionId = selectedAbilityId & 0x3fff;
319 UiText_DrawCharacterAtOffset(messageOrDefinitionId + MsgAbilityName,
320 window, 120, 0);
321 messageOrDefinitionId += MsgAbilityDescription;
322 UiText_DrawCharacterAtOffset(messageOrDefinitionId, window, 0, 24);
323 UiText_DrawResource(messageOrDefinitionId, window, 0, 48);
324 }
325 if (gKeysPressed & KEY_B) {
327 break;
328 }
329 if (gKeysRepeat & KEY_UP) {
330 seekDirection = -1;
331 selectedAbilityId--;
332 redraw = 1;
334 }
335 if (gKeysRepeat & KEY_DOWN) {
336 seekDirection = 1;
337 selectedAbilityId++;
338 redraw = 1;
340 }
341 if (gKeysRepeat & KEY_RIGHT) {
342 seekDirection = 1;
343 selectedAbilityId += BROWSER_ROW_STEP;
344 redraw = 1;
346 }
347 if (gKeysRepeat & KEY_LEFT) {
348 seekDirection = -1;
349 selectedAbilityId -= BROWSER_ROW_STEP;
350 redraw = 1;
352 }
353 if (gKeysRepeat & KEY_R) {
354 seekDirection = 1;
355 selectedAbilityId += BROWSER_PAGE_STEP;
356 redraw = 1;
358 }
359 if (gKeysRepeat & KEY_L) {
360 seekDirection = -1;
361 selectedAbilityId -= BROWSER_PAGE_STEP;
362 redraw = 1;
364 }
365 // Skip definitions with no icon/availability byte in the chosen direction.
366 if (seekDirection == -1) {
367 selectedAbilityId = (selectedAbilityId + ABILITY_COUNT) % entryCount;
368 goto check_back;
369 back:
370 selectedAbilityId = (selectedAbilityId + ABILITY_COUNT - 1) % entryCount;
371 check_back:
372 if (Engine_DebugGetAbility(selectedAbilityId & 0x3fff)[4] == 0)
373 goto back;
374 }
375 if (seekDirection == 1) {
376 selectedAbilityId = (selectedAbilityId + ABILITY_COUNT) % entryCount;
377 goto check_ahead;
378 ahead:
379 selectedAbilityId = (selectedAbilityId + ABILITY_COUNT + 1) % entryCount;
380 check_ahead:
381 if (Engine_DebugGetAbility(selectedAbilityId & 0x3fff)[4] == 0)
382 goto ahead;
383 }
384 seekDirection = 0;
386 }
389 UiWork_Finalize(window, 1);
390#ifndef UBFIX
391 // The original never initializes details or creates a second window.
392 // Reading this indeterminate pointer is UB; modern builds omit that call.
393 UiWork_Finalize(details, 1);
394#endif
395}
396#endif
397
398/// Requests a window-style exit with variant one over 24 frames.
399UNUSED static void ItemLevel_RequestExit(void) {
403}
404
405/// Starts the window transition and edition-specific actor scale/animation
406/// setup. Returns zero through the exported scene entry.
410#if TBS_PATCH_1
411 Object_GetById(11)->scaleY = 0x19999;
412 Object_GetById(11)->scaleX = 0x19999;
415#else
416 Object_GetById(11)->scaleY = 0x1b333;
417 Object_GetById(11)->scaleX = 0x1b333;
418#endif
419 return 0;
420}
421
422#if !TBS_PATCH_1
423/// Runs the Japanese animation test, then moves actor 11 to its test position.
424static void ItemLevel_RunMotionTest(void) {
429 Actor_SetPosition(11, PIXELS(312), PIXELS(416));
431}
432#endif
433
434#if TBS_PATCH_1
435/// Displays the three character-set caption rows in a debug window.
437 struct UiWindow *window;
438 /* FAKEMATCH: an unread 32-byte text buffer, the native frame's 32 extra
439 * bytes. Without it: differ 4 (sp moves 4 for 36). */
440 UNUSED u8 text[32];
441
442 window = UiWindow_Create(0, 13, 30, 6, 2);
446}
447#endif
448
450 struct BattleFxScene *effect = (struct BattleFxScene *)gEffectWork;
451
452 effect->childMode = 1;
453}
454
455/// Returns the icon browser's status to the event dispatcher.
457
458/// Returns the entry-glyph browser's status to the event dispatcher.
461}
462
463char gItemLevelLvLabel[4] = "Lv";
464
465char gItemLevelItemPrompt[12] = "Item No:";
466
467char gItemLevelItemHelp[24] = "A:Get Item B:Return";
468
469char gItemLevelItemFull[20] = "ITEM FULL........";
470
471#if (LANGUAGE != LANGUAGE_JAPANESE)
472char gItemLevelPsyPrompt[8] = "Psy No:";
473#endif
474
475#if (LANGUAGE != LANGUAGE_JAPANESE)
476char gItemLevelPsyHelp[12] = "B:Return";
477#endif
478
479#if (LANGUAGE != LANGUAGE_JAPANESE)
480char gItemLevelGlyphsUpper[28] = "A B C D E F G H J K L M N O";
481#endif
482
483#if (LANGUAGE != LANGUAGE_JAPANESE)
484char gItemLevelGlyphsLower[28] = "P Q R S T U V W X Y Z a b c";
485#endif
486
487#if (LANGUAGE != LANGUAGE_JAPANESE)
488char gItemLevelGlyphsMarks[12] = "! ? # $ %";
489#endif
490
492 {0, CONDITION_ALWAYS, 824, 0, 864, FACING_NORTH, 0, 280, 504, 912, 896, 0},
494};
495
497 SCENE_EXITS(511),
498};
499
500// clang-format off
503 TALK_FACE_PARTY, 0},
505 TALK_FACE_PARTY, 0},
507 TALK_FACE_PARTY, 0},
508#if !TBS_PATCH_1
510 TALK_FACE_PARTY, 0},
511#elif TBS_PATCH_1 && !TBS_PATCH_3
513 0},
520#else
522 0},
529#endif
531};
532// clang-format on
533
540#if !TBS_PATCH_1
542 EVENT_SCRIPT(ItemLevel_RunMotionTest)},
543#else
544#if !TBS_PATCH_3
546#endif
553#endif
554 {0x10008e15, 10, CONDITION_ALWAYS,
557};
void ObjectMotion_WaitForAnimationChange(u32 objectId)
Waits, at most 90 frames, for an actor's animation to change.
struct FieldActor * Object_GetById(s32 actor)
Returns an actor, or NULL if it does not exist.
#define GARET
Jerald.
#define MIA
Mary.
#define ISAAC
Robin.
#define IVAN
Ivan.
The engine calls the debug menus import, and their palette swatch tiles.
void Engine_DebugClearWindow(struct UiWindow *window)
void Engine_DebugDrawItemDetails(struct UiWindow *window, s32 item)
struct ItemDefinition * Engine_DebugGetItem(s32 item)
u8 * Engine_DebugGetAbility(s32 ability)
DMA channel registers, and the DMA and CPU fills.
static __inline__ void Dma_Set(const volatile void *source, volatile void *destination, u32 control, volatile u32 *channel)
Starts a DMA transfer: stores the source, destination and control words into channel's registers with...
Definition dma.h:62
The edition's language, for C to compare (LANGUAGE == LANGUAGE_GERMAN).
static s32 FieldParty_ListActiveOwners(s16 *owners)
Definition engine_call.h:79
static void Actor_ShowEmote(s32 actor, s32 emote, s32 frames)
static void Actor_SetPosition(s32 actor, s32 fixed_x, s32 fixed_z)
Field objects and actors, and the scene transition styles.
@ TRANSITION_WINDOW
Definition field_obj.h:17
#define SCENE_TRANSITION(style, variant)
Definition field_obj.h:20
The scene table formats: entrances, exits, placements and events, and the macros that write them.
#define SCENE_EVENTS_END
@ EVENT_TALK
@ FACING_STEP
Definition field_scene.h:36
#define SCENE_EXITS(scene)
Definition field_scene.h:72
@ SCENE_TABLE_END
Definition field_scene.h:43
@ CONDITION_ALWAYS
Definition field_scene.h:44
@ TALK_KEEP_FACING
@ TALK_FACE_PARTY
@ TALK_FACE_PARTY_AND_BACK
#define PSYNERGY_ON_ACTOR(ability)
#define EVENT_SCRIPT(script)
@ ACTOR_STAND
@ FACING_EAST
Definition field_scene.h:26
@ FACING_SOUTHEAST
Definition field_scene.h:27
@ FACING_NORTH
Definition field_scene.h:32
@ FACING_SOUTH
Definition field_scene.h:28
#define PIXELS(value)
The scene service layer: one typed inline for each engine service a scene calls by its own name,...
BattleFxScene, the work of a battle or field Psynergy effect scene, and its arc objects.
GameState, the game's state: play time, coins, the scene and the leader's position,...
struct GameState gGameState
void * gEffectWork
Slot 56: points to a scene-specific structure.
The screen blend's globals and the graphics routines.
s32 PartyInventory_HasSpace(void)
Returns 1 when the selected character or any party member has a free inventory slot.
Definition inventory.c:99
s32 PartyInventory_Add(s32 itemId)
Gives the item to the first party member with room.
Definition inventory.c:189
gOverflowItem, an item slot the spoils code uses when items are handed out.
The hardware's I/O registers and their bits, as pret names them.
#define OBJ_PLTT
Definition io_reg.h:159
@ KEY_UP
Definition io_reg.h:249
@ KEY_B
Definition io_reg.h:244
@ KEY_SELECT
Definition io_reg.h:245
@ KEY_LEFT
Definition io_reg.h:248
@ KEY_START
Definition io_reg.h:246
@ KEY_RIGHT
Definition io_reg.h:247
@ KEY_R
Definition io_reg.h:251
@ KEY_A
Definition io_reg.h:243
@ KEY_DOWN
Definition io_reg.h:250
@ KEY_L
Definition io_reg.h:252
#define REG_DMA3
Definition io_reg.h:153
#define BG_PLTT_COLOR(palette, color)
Definition io_reg.h:158
#define DMA_ENABLE
Definition io_reg.h:217
Items: their definitions, types, flags and effects.
The keypad state the VBlank interrupt keeps.
volatile u32 gKeysPressed
Keys that went down this frame.
volatile u32 gKeysRepeat
Pressed keys, repeating while held: after 19 frames, then every 6.
#define ITEM_COUNT
Definition level.c:44
static void ItemLevel_SelectItem(void)
Browses nonempty item definitions and gives the selected item to the party.
Definition level.c:159
static int ItemLevel_OpenGlyphBrowser(void)
Returns the entry-glyph browser's status to the event dispatcher.
Definition level.c:459
char gItemLevelItemFull[20]
Definition level.c:469
struct ScenePlacement gItemLevelPlacements[]
Definition level.c:501
static void ItemLevel_EnableEffectChildMode(void)
Definition level.c:449
char gItemLevelPsyHelp[12]
Definition level.c:476
static void ItemLevel_AdjustPartyLevels(s32 amount)
Applies the level change to the owners returned by the active-party service.
Definition level.c:85
struct SceneEntrance gItemLevelEntrances[]
Definition level.c:491
char gItemLevelGlyphsUpper[28]
Definition level.c:480
u8 * ItemLevel_GetPlacements(void)
Definition level.c:55
#define ITEM_DEBUG_DETAILS_WIDTH
Definition level.c:37
#define BROWSER_PAGE_STEP
Definition level.c:47
s32 FieldScene_RunEntrySetup(void)
Starts the window transition and edition-specific actor scale/animation setup.
Definition level.c:407
static void ItemLevel_ShowEmoteThenMessage(void)
Displays the other test emote before setting actor 13's message.
Definition level.c:67
static void ItemLevel_ShowMessageThenEmote(void)
Sets the test message before displaying the first emote on actor 13.
Definition level.c:60
struct SceneEvent gItemLevelEvents[]
Definition level.c:534
static void ItemLevel_ShowGlyphCaptions(void)
Displays the three character-set caption rows in a debug window.
Definition level.c:436
#define ABILITY_COUNT
Definition level.c:45
s32 SceneData_ReturnZero(void)
Definition level.c:51
static UNUSED void ItemLevel_SelectAbility(void)
Browses ability names and descriptions, skipping unavailable entries.
Definition level.c:284
u32 gItemLevelExits[]
Definition level.c:496
u8 * ItemLevel_GetEvents(void)
Definition level.c:74
#define BROWSER_ROW_STEP
Definition level.c:46
static int ItemLevel_OpenIconBrowser(void)
Returns the icon browser's status to the event dispatcher.
Definition level.c:456
static void ItemLevel_RunLevelEditor(void)
Displays the selected owner's level and changes all active owners.
Definition level.c:103
char gItemLevelItemHelp[24]
Definition level.c:467
char gItemLevelLvLabel[4]
Definition level.c:463
char gItemLevelItemPrompt[12]
Definition level.c:465
u8 * ItemLevel_GetEntrances(void)
Definition level.c:49
char gItemLevelGlyphsLower[28]
Definition level.c:484
char gItemLevelPsyPrompt[8]
Definition level.c:472
#define ITEM_DEBUG_DRAW_ITEM_NAME
Definition level.c:38
static void ItemLevel_AdjustOwnerLevel(s32 ownerId, s32 amount)
Raises one owner's level by amount, then recalculates that unit.
Definition level.c:77
static UNUSED void ItemLevel_RequestExit(void)
Requests a window-style exit with variant one over 24 frames.
Definition level.c:399
char gItemLevelGlyphsMarks[12]
Definition level.c:488
u8 * ItemLevel_GetExits(void)
Definition level.c:53
void Unit_LevelUpTo(s32 owner, s32 targetLevel)
Levels character owner up one level at a time until targetLevel, then recomputes its stats.
Definition levels.c:429
The reel game's title lettering.
Declares nothing of its own: it only includes static_assert.h and game_state.h.
Song and sound effect ids, indices into gSound_SongTable.
#define SE_MENU_CANCEL
Definition songs.h:106
#define SE_MENU_CURSOR_MOVE
Definition songs.h:104
#define SE_175
Definition songs.h:170
#define MUS_093
Definition songs.h:91
#define SE_MENU_CONFIRM
Definition songs.h:105
#define MUS_091
Definition songs.h:89
void Engine_ActorSetAnimation()
struct EventWork * gEventWork
void Engine_EventRequestExit()
void Engine_EventEnd(void)
void Engine_AudioPlayCue()
void Engine_EventBegin(void)
void Engine_TaskWait()
void Engine_EventSetMessage()
void Engine_EventShowMessage()
The work of a Psynergy effect scene: its caster and target, where it takes place, the map state it re...
Definition fx_scene.h:31
s8 childMode
set by some scenes: Frost and Force leave the target be
Definition fx_scene.h:53
A unit in battle: a party member's or an enemy's stats, Psynergy, items, Djinn and ailments.
u8 name[0x0f]
The name, one byte a character, ending in 0.
u8 level
1 to 99 for a character
s32 startTransition
SCENE_TRANSITION(style, variant).
Definition event_work.h:43
s32 transitionFrames
frames
Definition event_work.h:45
s32 scaleX
16.16 fixed point, 0x10000 full size
Definition field_obj.h:39
s32 scaleY
16.16 fixed point, 0x10000 full size
Definition field_obj.h:40
s32 selectedActor
the leader: its unit and its actor
Definition game_state.h:59
A scene entrance: where and facing which way the party arrives, and the camera's bounds there (-1 for...
Definition field_scene.h:54
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,...
Definition field_scene.h:81
A window: a framed rectangle of the tilemap with its sprite outputs, its opening or closing animation...
Definition uiwindow.h:11
The system's routines and globals: interrupts, BIOS sound bias, random numbers and sleep.
Declares nothing of its own: it only includes edition.h and render_input.h.
void UiText_DrawStringInWindow(const u8 *text, struct UiWindow *window, u32 x, u32 y)
Draws a byte string into a window's tilemap at pixel (x, y) of its interior, rounded down to tiles.
Definition text_tiles.c:646
void UiText_DrawResource(s32 message, struct UiWindow *window, s32 x, s32 y)
Decodes a message and draws it into a text canvas window at pixel (x, y).
Definition text_tiles.c:538
void UiText_DrawStringAtOffset(const u8 *text, const struct UiWindow *work, s32 offsetX, s32 offsetY)
Draws a byte string as tiles in window work at pixel (offsetX, offsetY) of its interior.
Definition text_tiles.c:614
void UiText_DrawNumberInWindow(s32 value, s32 width, struct UiWindow *window, s32 x, s32 y)
Draws a number (width as UiText_FormatNumber) into a window's tilemap at pixel (x,...
Definition text_tiles.c:678
void UiText_DrawNumberAtOffset(s32 value, s32 width, const struct UiWindow *window, s32 x, s32 y)
Draws a number (width as UiText_FormatNumber) as tiles in a window at pixel (x, y) of its interior.
Definition text_tiles.c:668
void UiText_DrawCharacterAtOffset(s32 message, const struct UiWindow *window, u32 offsetX, u32 offsetY)
Decodes a message and draws it as tiles in a window at pixel (offsetX, offsetY) of its interior.
Definition text_tiles.c:552
The integer types, TRUE, UNUSED and the fixed-address macros.
signed int s32
Definition types.h:14
unsigned int u32
Definition types.h:15
signed char s8
Definition types.h:10
unsigned short u16
Definition types.h:13
#define UNUSED
Definition types.h:22
unsigned char u8
Definition types.h:11
Declares nothing of its own: it only includes edition.h and uiwindow.h.
void UnitCalc(s32 owner)
Recomputes a unit's stats from its base stats, equipment, set Djinn, class and battle stat levels,...
Definition units.c:149
struct BattleUnit * UnitGet(u32 owner)
Returns the unit record of owner: 0 to 7 are the playable characters in the game state,...
Definition units.c:73
s32 DebugMenu_BrowseIcons(void)
Browses pages of item, Psynergy and status-pattern icons, suspending the menu controller while the br...
Definition debug.c:327
s32 DebugMenu_BrowseEntryGlyphs(void)
Browses the character and sprite portrait maps as one circular list.
Definition debug.c:421
void UiWork_Finalize(struct UiWindow *window, s32 instant)
Closes a window: clears its contents and remembers its last rectangle.
Definition windows.c:349
void RenderOutput_RedrawSavedRect(struct UiWindow *window)
Redraws a window's empty frame at its current rectangle.
Definition windows.c:400
struct UiWindow * UiWindow_Create(s32 x, s32 y, s32 width, s32 height, s32 attrs)
Opens a window at tile (x, y) of width by height tiles in the first free window slot,...
Definition windows.c:279