src/debug/test.c
The debug room Menu test, whose actors each run a test of the menus, the shops or the bags when talked to.
#include "ability_ids.h"#include "item_ids.h"#include "battle/battle.h"#include "debug/debug.h"#include "field/script.h"#include "field/field_psynergy_state.h"#include "game/system_call.h"#include "window/message_speed.h"#include "text/msg_ids.h"#include "test_rows.c"
Macros
| Name | Description | |
|---|---|---|
#define | DEBUG_PARTY_LEVEL 30 | The level scInit raises Garet, Mia and Ivan to. |
#define | DEBUG_ISAAC_LEVEL | The level scInit raises Isaac to, higher in the international editions. |
#define | SHOP_MESSAGES (MsgArmorShopWelcome - MsgWeaponShopWelcome) | The lines of one shop, as many as the weapon shop's. |
#define | FILL_PASSES 16 | The Japanese release's leftover loop fills the buffer this many times, with this many letters the first time and one more each time after. |
#define | FILL_FIRST_LENGTH 32 |
Enumerations
| Name | Description | |
|---|---|---|
enum | MENU_TEST_ACTOR_ID { ACTOR_KRADEN, ACTOR_DORA, ACTOR_SATUROS, ACTOR_MENARDI, ACTO … } | The placed actors, numbered in the order of MenuTestActorPlacements after its four party rows, which keep their characters' ids. |
Functions
| Name | Description | |
|---|---|---|
const SCENE_ENTRANCE * | scGetEntrances (void) | The six rooms share one entrance table. |
const Uint32 * | scGetExits (void) | Both scenes share one exit table. |
const ACTOR_PLACE * | scGetActorPlacements (void) | Some villagers only turn back after talking once the flood is over or their family has gone home. |
const CUE * | scGetCues (void) | The first water beast's cave changes its cues once the first drain has lowered its water: the beast is gone and its two puddles can be frozen. |
Sint32 | scInit (void) | Sets up the room: Isaac, Garet, Mia and Ivan as the party, a stock of rare items for the shops, everyone's levels, and in Japanese 777,777 coins. |
static __inline__ void | dbMenuTestRecalculateParty (void) | Recalculates the four heroes after a debug inventory or stat change. |
const SCENE_EXIT_REGION * | scGetExitRegions (void) | The scene has no exit regions: its regions entry returns none. |
static void | dbMenuTestShowMessageAndWait (Sint32 msgId) | Closes the finished message windows, opens the message and waits until it is typed out, then a tick more. |
static void | dbMenuTestBrowseMessageRange (Sint32 msgId, Sint32 msgCount) | Browses sample dialogue with A/Down and Up; B closes the window. |
static void | dbMenuTestBrowseWeaponShopMessages (void) | The shop message browsers, run by talking to ACTOR_FELIX and ACTOR_SECOND_FELIX while the leader faces a given way (MenuTestCues). |
static void | dbMenuTestBrowseArmorShopMessages (void) | |
static void | dbMenuTestBrowseItemShopMessages (void) | |
static void | dbMenuTestBrowseSanctumMessages (void) | |
static void | dbMenuTestBrowseWarriorShopMessages (void) | |
static void | dbMenuTestBrowseWarriorArmorShopMessages (void) | |
static void | dbMenuTestBrowseWarriorItemShopMessages (void) | |
static void | dbMenuTestRunMessageTest (void) | Sets the script's message twice, so the second is the one shown, with no speaker, and waits until it closes. |
static void | dbMenuTestOpenDebugShop (void) | Talking to ACTOR_ARMOR_MERCHANT: the debug shop. |
static void | dbMenuTestNoOperation (void) | Unused: a script that does nothing. |
static void | dbMenuTestOpenItemPicker (void) | Talking to ACTOR_KRADEN: the picker a full party drops an item with, whose choice of member and slot nothing uses. |
static void | dbMenuTestEditIsaacName (void) | Talking to Mia: the name entry screen for Isaac. |
static void | dbMenuTestIgnorePsynergy (void) | Whirlwind, Force and Catch cast at ACTOR_IVY: nothing happens to it. |
static void | dbMenuTestKeepIvyInPlace (void) | Keeps Force from pushing ACTOR_IVY: run as Force is cast at it, before the shot, this sets the effect's leaveTarget, and the shot then leaves its target where it is (field/script_commands_force.c). |
static void | dbMenuTestGiveItemToParty (void) | Gives a Nut through the ordinary party gift and full-inventory dialogue. |
static void | dbMenuTestRaisePartyLevels (void) | Talking to Garet: levels the four to MenuTestNextLevel, then raises it by ten. |
static void | dbMenuTestGiveConsumableTestStock (void) | Talking to Ivan: gives the four stacks of items to use: healing items, Psy Crystals, Sacred Feathers and the foods that raise a stat. |
static void | dbMenuTestGivePartyDjinn (void) | Talking to ACTOR_DORA: gives each of the four seven Djinn of their element (Ivan six) and sets them. |
static void | dbMenuTestDamageAndAfflictParty (void) | Talking to ACTOR_SATUROS: takes HP and PP from the four, then poisons and haunts Isaac, and binds Garet and gives him deadly poison. |
static void | dbMenuTestGiveEquipmentTestStock (void) | Talking to Jenna: gives the four weapons and armor. |
static void | dbMenuTestSelectItem (void) | The Japanese item browser: Item No: over an item's name, its icon and what equipping it does; A gives it to the party, and B, or A once the bags are full, leaves. |
static void | dbMenuTestOpenItemBrowser (void) | Talking to ACTOR_SECOND_FELIX in Japanese: the item browser. |
static void | dbMenuTestGiveTreasureTestStock (void) | Talking to ACTOR_MENARDI: gives the four treasure, eleven Game Tickets and eight Lucky Medals among it. |
static Sint32 | dbMenuTestOpenIconBrowser (void) | Talking to ACTOR_IVY: the icon browser. |
static Sint32 | dbMenuTestSelectCharacter (void) | Talking to ACTOR_FELIX in Japanese: the party member chooser, whose choice nothing uses. |
static Sint32 | dbMenuTestOpenSanctum (Sint32 unitId) | Talking to ACTOR_SECOND_DORA in Japanese, English and German: the sanctum. |
Variables
| Name | Description | |
|---|---|---|
extern Uint32 | TestUnusedRows [] | Unused: eight rows of seven words, the same in both overlays. |
extern char | MenuTestItemPrompt [12] | |
extern char | MenuTestItemHelp [24] | |
extern char | MenuTestItemFull [20] | |
extern SCENE_ENTRANCE | MenuTestEntrances [] | |
extern Uint32 | MenuTestExits [] | No exits. |
extern ACTOR_PLACE | MenuTestActorPlacements [] | |
extern CUE | MenuTestCues [] | Who runs what: Garet levels, Jenna equipment, Ivan consumables, Mia Isaac's name, and the placed actors (MENU_TEST_ACTOR_ID) the rest. |
extern Sint32 | MenuTestNextLevel | The level dbMenuTestRaisePartyLevels levels the four to next: 10 at first, ten more after each use. |
extern Sint32 | MenuTestFillLetter | One less than the character the Japanese loop of dbMenuTestGivePartyDjinn fills with: 'A' at first, so 'B', one more each pass, and back to 'A' when it reaches 'a'. |
Description
The debug room Menu test, whose actors each run a test of the menus, the shops or the bags when talked to.
Macros in detail
DEBUG_PARTY_LEVEL
#define DEBUG_PARTY_LEVEL 30
The level scInit raises Garet, Mia and Ivan to.
Referenced by scInit().
Definition at line 31 of file test.c.
DEBUG_ISAAC_LEVEL
#define DEBUG_ISAAC_LEVEL
The level scInit raises Isaac to, higher in the international editions.
Referenced by scInit().
Definition at line 33 of file test.c.
SHOP_MESSAGES
#define SHOP_MESSAGES (MsgArmorShopWelcome - MsgWeaponShopWelcome)
The lines of one shop, as many as the weapon shop's.
Referenced by dbMenuTestBrowseArmorShopMessages(), dbMenuTestBrowseItemShopMessages(), dbMenuTestBrowseWarriorArmorShopMessages(), dbMenuTestBrowseWarriorItemShopMessages(), dbMenuTestBrowseWarriorShopMessages() and dbMenuTestBrowseWeaponShopMessages().
Definition at line 103 of file test.c.
FILL_PASSES
#define FILL_PASSES 16
The Japanese release's leftover loop fills the buffer this many times, with this many letters the first time and one more each time after.
Referenced by dbMenuTestGivePartyDjinn().
Definition at line 492 of file test.c.
FILL_FIRST_LENGTH
#define FILL_FIRST_LENGTH 32
Referenced by dbMenuTestGivePartyDjinn().
Definition at line 493 of file test.c.
Enumerations in detail
MENU_TEST_ACTOR_ID
enum MENU_TEST_ACTOR_ID
The placed actors, numbered in the order of MenuTestActorPlacements after its
four party rows, which keep their characters' ids. Each runs its test when
talked to.
| Enumerator | Value | Description |
|---|---|---|
ACTOR_KRADEN | ACTOR_FIRST_PLACED | Kraden: the picker a full party drops an item with. |
ACTOR_DORA | Gives the party Djinn: "You got a Djinni!" | |
ACTOR_SATUROS | Hurts the party: "The body is being torn apart." | |
ACTOR_MENARDI | Gives the party treasure: "You got treasure!" | |
ACTOR_ARMOR_MERCHANT | Vale's armor merchant: the debug shop. | |
ACTOR_SECOND_DORA | Dora again: the sanctum in Japanese, English and German, a Nut in French, and in Spanish and Italian "That IS dangerous!" | |
ACTOR_SECOND_SATUROS | Saturos again: "Kyle... Will they be able to stop the Boulder?" | |
ACTOR_IVY | The ivy: the icon browser. Whirlwind, Force and Catch leave it be. | |
ACTOR_FELIX | Felix: in Japanese the party member chooser; in the other editions the lines of the weapon, armor and item shops and the sanctum, one for each way the leader faces him. | |
ACTOR_SECOND_FELIX | Felix again: in Japanese the item browser; in the other editions the warrior shops' lines in the same way, and in German, French, Spanish and Italian a message test while the leader faces south. |
Definition at line 39 of file test.c.
Functions in detail
scGetEntrances
const SCENE_ENTRANCE *scGetEntrances(void)
References MenuTestEntrances.
Definition at lines 14 and 80 of file test.c.
scGetExits
const Uint32 *scGetExits(void)
References MenuTestExits.
Definition at lines 15 and 91 of file test.c.
scGetActorPlacements
const ACTOR_PLACE *scGetActorPlacements(void)
References MenuTestActorPlacements.
Definition at lines 16 and 96 of file test.c.
scGetCues
const CUE *scGetCues(void)
References MenuTestCues.
Definition at lines 17 and 265 of file test.c.
scInit
Sint32 scInit(void)
Sets up the room: Isaac, Garet, Mia and Ivan as the party, a stock of rare items for the shops, everyone's levels, and in Japanese 777,777 coins.
References dbMenuTestRecalculateParty(), gmItemAdjustRareItemStock(), gmPartyAddMember(), gmPartyRemoveMember(), gmUnitLevelUpTo(), MainRoutineStateWork and Sint32.
Definition at lines 18 and 830 of file test.c.
dbMenuTestRecalculateParty
static __inline__ void dbMenuTestRecalculateParty(void)
Recalculates the four heroes after a debug inventory or stat change.
References gmUnitCalculate().
Referenced by dbMenuTestDamageAndAfflictParty(), dbMenuTestGiveConsumableTestStock(), dbMenuTestGiveEquipmentTestStock(), dbMenuTestGivePartyDjinn(), dbMenuTestGiveTreasureTestStock(), dbMenuTestRaisePartyLevels() and scInit().
Definition at line 72 of file test.c.
scGetExitRegions
const SCENE_EXIT_REGION *scGetExitRegions(void)
The scene has no exit regions: its regions entry returns none.
Definition at line 86 of file test.c.
dbMenuTestShowMessageAndWait
static void dbMenuTestShowMessageAndWait(Sint32 msgId)
Closes the finished message windows, opens the message and waits until it is typed out, then a tick more.
References mnMessageAllTyped(), mnMessageCloseFinishedWindows(), mnMessageOpenWindow(), Sint32 and sySynch().
Referenced by dbMenuTestBrowseMessageRange().
Definition at line 107 of file test.c.
dbMenuTestBrowseMessageRange
static void dbMenuTestBrowseMessageRange(Sint32 msgId, Sint32 msgCount)
Browses sample dialogue with A/Down and Up; B closes the window.
References dbMenuTestShowMessageAndWait(), MainRoutineStateWork, mnMessageArgumentPush(), mnMessageCloseFinishedWindows(), mnPortraitOpenWindow(), mnWindowClose(), PerData, Sint32 and sySynch().
Referenced by dbMenuTestBrowseArmorShopMessages(), dbMenuTestBrowseItemShopMessages(), dbMenuTestBrowseSanctumMessages(), dbMenuTestBrowseWarriorArmorShopMessages(), dbMenuTestBrowseWarriorItemShopMessages(), dbMenuTestBrowseWarriorShopMessages() and dbMenuTestBrowseWeaponShopMessages().
Definition at line 120 of file test.c.
dbMenuTestBrowseWeaponShopMessages
static void dbMenuTestBrowseWeaponShopMessages(void)
The shop message browsers, run by talking to ACTOR_FELIX and
ACTOR_SECOND_FELIX while the leader faces a given way (MenuTestCues).
References dbMenuTestBrowseMessageRange().
Definition at line 168 of file test.c.
dbMenuTestBrowseArmorShopMessages
static void dbMenuTestBrowseArmorShopMessages(void)
References dbMenuTestBrowseMessageRange().
Definition at line 173 of file test.c.
dbMenuTestBrowseItemShopMessages
static void dbMenuTestBrowseItemShopMessages(void)
References dbMenuTestBrowseMessageRange().
Definition at line 178 of file test.c.
dbMenuTestBrowseSanctumMessages
static void dbMenuTestBrowseSanctumMessages(void)
References dbMenuTestBrowseMessageRange().
Definition at line 183 of file test.c.
dbMenuTestBrowseWarriorShopMessages
static void dbMenuTestBrowseWarriorShopMessages(void)
References dbMenuTestBrowseMessageRange().
Definition at line 189 of file test.c.
dbMenuTestBrowseWarriorArmorShopMessages
static void dbMenuTestBrowseWarriorArmorShopMessages(void)
References dbMenuTestBrowseMessageRange().
Definition at line 194 of file test.c.
dbMenuTestBrowseWarriorItemShopMessages
static void dbMenuTestBrowseWarriorItemShopMessages(void)
References dbMenuTestBrowseMessageRange().
Definition at line 199 of file test.c.
dbMenuTestRunMessageTest
static void dbMenuTestRunMessageTest(void)
Sets the script's message twice, so the second is the one shown, with no speaker, and waits until it closes.
References fdScriptSetMessageId() and fdScriptShowMessage().
Definition at line 208 of file test.c.
dbMenuTestOpenDebugShop
static void dbMenuTestOpenDebugShop(void)
Talking to ACTOR_ARMOR_MERCHANT: the debug shop.
References mnShopOpenDebugShop().
Referenced by MenuTestCues.
Definition at line 218 of file test.c.
dbMenuTestNoOperation
static void dbMenuTestNoOperation(void)
Unused: a script that does nothing.
Definition at line 224 of file test.c.
dbMenuTestOpenItemPicker
static void dbMenuTestOpenItemPicker(void)
Talking to ACTOR_KRADEN: the picker a full party drops an item with, whose
choice of member and slot nothing uses.
References mnItemPickerRun() and Sint32.
Referenced by MenuTestCues.
Definition at line 230 of file test.c.
dbMenuTestEditIsaacName
static void dbMenuTestEditIsaacName(void)
Talking to Mia: the name entry screen for Isaac.
References mnNameEntryEditMemberName().
Referenced by MenuTestCues.
Definition at line 238 of file test.c.
dbMenuTestIgnorePsynergy
static void dbMenuTestIgnorePsynergy(void)
Whirlwind, Force and Catch cast at ACTOR_IVY: nothing happens to it.
Referenced by MenuTestCues.
Definition at line 244 of file test.c.
dbMenuTestKeepIvyInPlace
static void dbMenuTestKeepIvyInPlace(void)
Keeps Force from pushing ACTOR_IVY: run as Force is cast at it, before the
shot, this sets the effect's leaveTarget, and the shot then leaves its target
where it is (field/script_commands_force.c).
Referenced by MenuTestCues.
Definition at line 251 of file test.c.
dbMenuTestGiveItemToParty
static void dbMenuTestGiveItemToParty(void)
Gives a Nut through the ordinary party gift and full-inventory dialogue.
Talking to ACTOR_SECOND_DORA in French only.
References fdPartyInventoryGiveItem().
Referenced by MenuTestCues.
Definition at line 259 of file test.c.
dbMenuTestRaisePartyLevels
static void dbMenuTestRaisePartyLevels(void)
Talking to Garet: levels the four to MenuTestNextLevel, then raises it by
ten.
References dbMenuTestRecalculateParty(), gmUnitLevelUpTo(), MenuTestNextLevel and mnFieldMessageShow().
Referenced by MenuTestCues.
Definition at line 272 of file test.c.
dbMenuTestGiveConsumableTestStock
static void dbMenuTestGiveConsumableTestStock(void)
Talking to Ivan: gives the four stacks of items to use: healing items, Psy Crystals, Sacred Feathers and the foods that raise a stat.
References dbMenuTestRecalculateParty(), gmInventoryAddItem() and mnFieldMessageShow().
Referenced by MenuTestCues.
Definition at line 286 of file test.c.
dbMenuTestGivePartyDjinn
static void dbMenuTestGivePartyDjinn(void)
Talking to ACTOR_DORA: gives each of the four seven Djinn of their element
(Ivan six) and sets them.
References dbMenuTestRecalculateParty(), gmDjinnGive(), gmDjinnSet(), MenuTestFillLetter, mnFieldMessageShow() and Sint32.
Referenced by MenuTestCues.
Definition at line 498 of file test.c.
dbMenuTestDamageAndAfflictParty
static void dbMenuTestDamageAndAfflictParty(void)
Talking to ACTOR_SATUROS: takes HP and PP from the four, then poisons and
haunts Isaac, and binds Garet and gives him deadly poison.
References dbMenuTestRecalculateParty(), gmUnitAddPp(), gmUnitGet(), mnFieldMessageShow() and scFieldUnitAddHp().
Referenced by MenuTestCues.
Definition at line 587 of file test.c.
dbMenuTestGiveEquipmentTestStock
static void dbMenuTestGiveEquipmentTestStock(void)
Talking to Jenna: gives the four weapons and armor.
References dbMenuTestRecalculateParty(), gmInventoryAddItem() and mnFieldMessageShow().
Referenced by MenuTestCues.
Definition at line 612 of file test.c.
dbMenuTestSelectItem
static void dbMenuTestSelectItem(void)
The Japanese item browser: Item No: over an item's name, its icon and what
equipping it does; A gives it to the party, and B, or A once the bags are
full, leaves. Unlike the Increase item and level room's, it stops on numbers
with no item.
References gmItemGetDefinition(), gmPartyInventoryAdd(), gmPartyInventoryHasSpace(), MenuTestItemFull, MenuTestItemHelp, MenuTestItemPrompt, mnItemMenuDrawItemDetails(), mnTextDrawMessage(), mnTextDrawMessageAsTiles(), mnTextDrawNumberAtOffset(), mnTextDrawStringInWindow(), mnWindowClose(), mnWindowCreate(), mnWindowSpriteClearList(), mnWindowSpriteRedrawSavedRect(), PerPush, PerRepeat, Sint32, syDMAXCopy(), sySoundPlay() and sySynch().
Referenced by dbMenuTestOpenItemBrowser().
Definition at line 657 of file test.c.
dbMenuTestOpenItemBrowser
static void dbMenuTestOpenItemBrowser(void)
Talking to ACTOR_SECOND_FELIX in Japanese: the item browser.
References dbMenuTestSelectItem().
Referenced by MenuTestCues.
Definition at line 770 of file test.c.
dbMenuTestGiveTreasureTestStock
static void dbMenuTestGiveTreasureTestStock(void)
Talking to ACTOR_MENARDI: gives the four treasure, eleven Game Tickets and
eight Lucky Medals among it.
References dbMenuTestRecalculateParty(), gmInventoryAddItem() and mnFieldMessageShow().
Referenced by MenuTestCues.
Definition at line 777 of file test.c.
dbMenuTestOpenIconBrowser
static Sint32 dbMenuTestOpenIconBrowser(void)
Talking to ACTOR_IVY: the icon browser.
References mnDebugBrowserIcons() and Sint32.
Referenced by MenuTestCues.
Definition at line 865 of file test.c.
dbMenuTestSelectCharacter
static Sint32 dbMenuTestSelectCharacter(void)
Talking to ACTOR_FELIX in Japanese: the party member chooser, whose choice
nothing uses.
References mnPartyMemberChooserOpen() and Sint32.
Referenced by MenuTestCues.
Definition at line 873 of file test.c.
dbMenuTestOpenSanctum
static Sint32 dbMenuTestOpenSanctum(Sint32 unitId)
Talking to ACTOR_SECOND_DORA in Japanese, English and German: the sanctum.
References mnSanctumRun() and Sint32.
Definition at line 881 of file test.c.
Variables in detail
MenuTestItemPrompt
extern char MenuTestItemPrompt[12]
char MenuTestItemPrompt[12]
Referenced by dbMenuTestSelectItem().
Definition at lines 20 and 889 of file test.c.
MenuTestItemHelp
extern char MenuTestItemHelp[24]
char MenuTestItemHelp[24]
Referenced by dbMenuTestSelectItem().
Definition at lines 21 and 891 of file test.c.
MenuTestItemFull
extern char MenuTestItemFull[20]
char MenuTestItemFull[20]
Referenced by dbMenuTestSelectItem().
Definition at lines 22 and 893 of file test.c.
MenuTestEntrances
extern SCENE_ENTRANCE MenuTestEntrances[]
SCENE_ENTRANCE MenuTestEntrances[]
Referenced by scGetEntrances().
Definition at lines 23 and 895 of file test.c.
MenuTestExits
extern Uint32 MenuTestExits[]
Uint32 MenuTestExits[]
No exits.
Referenced by scGetExits().
Definition at lines 24 and 901 of file test.c.
MenuTestActorPlacements
extern ACTOR_PLACE MenuTestActorPlacements[]
ACTOR_PLACE MenuTestActorPlacements[]
Referenced by scGetActorPlacements().
Definition at lines 25 and 905 of file test.c.
MenuTestCues
extern CUE MenuTestCues[]
CUE MenuTestCues[]
Who runs what: Garet levels, Jenna equipment, Ivan consumables, Mia Isaac's
name, and the placed actors (MENU_TEST_ACTOR_ID) the rest.
References dbMenuTestDamageAndAfflictParty(), dbMenuTestEditIsaacName(), dbMenuTestGiveConsumableTestStock(), dbMenuTestGiveEquipmentTestStock(), dbMenuTestGiveItemToParty(), dbMenuTestGivePartyDjinn(), dbMenuTestGiveTreasureTestStock(), dbMenuTestIgnorePsynergy(), dbMenuTestKeepIvyInPlace(), dbMenuTestOpenDebugShop(), dbMenuTestOpenIconBrowser(), dbMenuTestOpenItemBrowser(), dbMenuTestOpenItemPicker(), dbMenuTestRaisePartyLevels() and dbMenuTestSelectCharacter().
Referenced by scGetCues().
Definition at lines 26 and 1037 of file test.c.
MenuTestNextLevel
extern Sint32 MenuTestNextLevel
Sint32 MenuTestNextLevel
The level dbMenuTestRaisePartyLevels levels the four to next: 10 at first,
ten more after each use.
References Sint32.
Referenced by dbMenuTestRaisePartyLevels().
Definition at lines 27 and 1142 of file test.c.
MenuTestFillLetter
extern Sint32 MenuTestFillLetter
Sint32 MenuTestFillLetter
One less than the character the Japanese loop of dbMenuTestGivePartyDjinn
fills with: 'A' at first, so 'B', one more each pass, and back to 'A' when it
reaches 'a'.
References Sint32.
Referenced by dbMenuTestGivePartyDjinn().