src/debug/level.c
The debug room Increase item and level, as The Broken Seal's: its actors raise the party's levels, give any item and show the game's icons and portraits. More…
#include "debug/debug.h"#include "field/field.h"#include "menu/menu.h"#include "field/script_inline.h"#include "text/msg_ids.h"#include "battle/battle_unit.h"#include "game/character_ids.h"#include "field/field_engine_script.h"#include "window/screens.h"#include "window/window.h"#include "field/field_psynergy_state.h"
Macros
| Name | Description | |
|---|---|---|
#define | LEVEL_EDITOR_SCALE (toFIXED(17) / 10) | How much larger ACTOR_LEVEL_EDITOR is drawn in the debug room. |
#define | ITEM_BROWSER_ITEM_COUNT 512 | The browser's item numbers, 0 to 511, wrapping. |
#define | TALK_CUE (actor, script) | A row that runs script when actor is talked to. |
#define | FORCE_CUES | Force cast at the sun disc statue runs the motion test; the second row, on the same statue and run before the cast, sets the effect's child mode, so Force's shot leaves the statue where it stands. |
#define | NAME_CUE (person) | The rooms of names' cues: each party member says their name, and each of the first 25 people placed theirs. |
Enumerations
| Name | Description | |
|---|---|---|
enum | anonymous enum { ENTRANCE_NAMES_FOURTH, ENTRANCE_NAMES_THIRD, ENTRANCE_NAMES_ … } | The entrances that open a room of names in place of the debug room: each has its own actor placements and the cues of IncreaseItemAndLevelNameCues. |
enum | anonymous enum { ENTRANCE_DEBUG_ROOM_LAST, ENTRANCE_NAMES_ABOVE } | Entrances up to ENTRANCE_DEBUG_ROOM_LAST open the debug room; those above ENTRANCE_NAMES_ABOVE take the rooms of names' cues. |
enum | INCREASE_ITEM_AND_LEVEL_ACTOR_ID { ACTOR_ITEM_BROWSER, ACTOR_ICON_BROWSER, ACTOR_PORTRAIT_BROWS … } | The debug room's actors, numbering the rows of IncreaseItemAndLevelActorPlacements. |
Functions
| Name | Description | |
|---|---|---|
void | dbIncreaseItemAndLevelRunMotionTest (void) | The motion test, Force cast at the sun disc statue: the statue takes its walk and the cat shakes its head, and once the statue's animation has changed the cat moves to (312, 416). |
void | dbIncreaseItemAndLevelKeepPortraitBrowserInPlace (void) | Keeps Force from moving ACTOR_PORTRAIT_BROWSER: run just before Force is cast at it, this sets the effect's childMode, and Force's shot then leaves its target where it is. |
void | dbIncreaseItemAndLevelOpenIconBrowser (void) | Talking to ACTOR_ICON_BROWSER: pages of item, Psynergy and status icons. |
void | dbIncreaseItemAndLevelOpenPortraitBrowser (void) | Talking to ACTOR_PORTRAIT_BROWSER: the portraits, one at a time. |
const SCENE_ENTRANCE * | scGetEntrances (void) | Where the party can enter: the cave under the spring has its own entrances. |
const struct SCENE_EXIT_REGION * | scGetExitRegions (void) | The regions of the rooms whose exits are rectangles: the Chestbeaters' room and the stream room. |
const Uint32 * | scGetExits (void) | The dock's ways lead back the way the party came into Lemuria, which the harbour and the shore of Ancient Lemuria note in FLAG_LEMURIA_OTHER_WAY_IN. |
const ACTOR_PLACE * | scGetActorPlacements (void) | The scene's actor placements: a room of names for its entrance, else the debug room's. |
void | dbIncreaseItemAndLevelShowName (Sint32 actorId) | Shows the name of the person talked to in a room of names: actor actorId says the message its room's list of names gives it, counted from the room's first name: "Master Poi" in the first room, "Susa" in the second, "Alex" in the third and "Weapons Shop" in the fourth. |
void | dbIncreaseItemAndLevelShowCharacterName (Sint32 character) | Shows a party member's name when they are talked to in a room of names, the line of the list from MsgNamesIsaac at their character number, with the character as the message's actor argument. |
const CUE * | scGetCues (void) | The scene's cues: the rooms of names' for any entrance above ENTRANCE_NAMES_ABOVE, else the debug room's. |
void | dbIncreaseItemAndLevelRaiseMemberLevel (Sint32 ownerId, Sint32 amount) | Raises one party member amount levels and works out their new stats. |
void | dbIncreaseItemAndLevelRaisePartyLevels (Sint32 amount) | Raises every party member amount levels. |
void | dbIncreaseItemAndLevelRunLevelEditor (void) | Displays the leader's level and changes the whole party's: talking to ACTOR_LEVEL_EDITOR shows Raise everyone's level. over the leader's name and level; Start or Select raises the whole party five levels to the Super Lucky jingle, A one level to the Lucky one. |
void | dbIncreaseItemAndLevelSelectItem (void) | Browses nonempty item definitions and gives the selected item to the party: talking to ACTOR_ITEM_BROWSER. |
void | dbIncreaseItemAndLevelRequestExit (Sint32 countdown) | Unused: requests an exit through a window transition over 24 ticks; no cue row names it. |
Sint32 | scInit (void) | Opens the room through the window transition, and in the debug room draws the cat 1.7 times its size. |
Sint32 | scPrepareMap (void) | Once Briggs is caught the pool has dried up: its colours take the dry ground's. |
Variables
| Name | Description | |
|---|---|---|
extern ACTOR_PLACE | IncreaseItemAndLevelActorPlacements [] | The debug room's actors, in the order of INCREASE_ITEM_AND_LEVEL_ACTOR_ID. |
extern ACTOR_PLACE | IncreaseItemAndLevelFirstNamePlacements [] | The first room of names, from Master Poi. |
extern ACTOR_PLACE | IncreaseItemAndLevelSecondNamePlacements [] | The second room of names. |
extern ACTOR_PLACE | IncreaseItemAndLevelThirdNamePlacements [] | The third room of names, from Alex. |
extern ACTOR_PLACE | IncreaseItemAndLevelFourthNamePlacements [] | The fourth room of names. |
extern CUE | IncreaseItemAndLevelNameCues [] | |
extern CUE | IncreaseItemAndLevelCues [] | Talking to each statue, or the cat, runs its tool, and Force at the sun disc statue its test, as in The Broken Seal's Japanese edition. |
extern char | IncreaseItemAndLevelLvLabel [] | The level editor's label before a member's level. |
extern char | IncreaseItemAndLevelItemPrompt [] | The item selector's prompt, before the item number. |
extern char | IncreaseItemAndLevelItemHelp [] | The item selector's help line, while the bags have room. |
extern char | IncreaseItemAndLevelItemFull [] | The item selector's line when the party's bags are full. |
SCENE_ENTRANCE | SceneEntrances [] | Besides the party's return to the pier after the ship is stolen, four unused spots about the mast: below the huge block, on the dock by its crate, on the deck, and at the top of the sail's east pole. |
Uint32 | SceneExits [] | The room has no exits of its own. |
Description
The debug room Increase item and level, as The Broken Seal's: its actors raise the party's levels, give any item and show the game's icons and portraits. Through entrances 96 to 99 the same scene is instead one of four rooms of people in rows, each of whom says their name when talked to.
Macros in detail
LEVEL_EDITOR_SCALE
#define LEVEL_EDITOR_SCALE (toFIXED(17) / 10)
How much larger ACTOR_LEVEL_EDITOR is drawn in the debug room.
Referenced by scInit().
Definition at line 100 of file level.c.
ITEM_BROWSER_ITEM_COUNT
#define ITEM_BROWSER_ITEM_COUNT 512
The browser's item numbers, 0 to 511, wrapping.
Referenced by dbIncreaseItemAndLevelSelectItem().
Definition at line 241 of file level.c.
TALK_CUE
#define TALK_CUE(actor, script)
A row that runs script when actor is talked to.
Referenced by IncreaseItemAndLevelCues and IncreaseItemAndLevelNameCues.
Definition at line 1069 of file level.c.
FORCE_CUES
#define FORCE_CUES
Force cast at the sun disc statue runs the motion test; the second row, on the same statue and run before the cast, sets the effect's child mode, so Force's shot leaves the statue where it stands.
Referenced by IncreaseItemAndLevelCues and IncreaseItemAndLevelNameCues.
Definition at line 1076 of file level.c.
NAME_CUE
#define NAME_CUE(person)
The rooms of names' cues: each party member says their name, and each of the first 25 people placed theirs. The debug room's two Force rows stay at the end.
Referenced by IncreaseItemAndLevelNameCues.
Definition at line 1097 of file level.c.
Enumerations in detail
anonymous enum
enum { ENTRANCE_NAMES_FOURTH, ENTRANCE_NAMES_THIRD, ENTRANCE_NAMES_SECOND, ENTRANCE_NAMES_FIRST }
The entrances that open a room of names in place of the debug room: each has
its own actor placements and the cues of IncreaseItemAndLevelNameCues.
| Enumerator | Value | Description |
|---|---|---|
ENTRANCE_NAMES_FOURTH | 96 | |
ENTRANCE_NAMES_THIRD | 97 | |
ENTRANCE_NAMES_SECOND | 98 | |
ENTRANCE_NAMES_FIRST | 99 |
Definition at line 36 of file level.c.
anonymous enum
enum { ENTRANCE_DEBUG_ROOM_LAST, ENTRANCE_NAMES_ABOVE }
Entrances up to ENTRANCE_DEBUG_ROOM_LAST open the debug room; those above
ENTRANCE_NAMES_ABOVE take the rooms of names' cues.
| Enumerator | Value | Description |
|---|---|---|
ENTRANCE_DEBUG_ROOM_LAST | 89 | |
ENTRANCE_NAMES_ABOVE | 94 |
Definition at line 46 of file level.c.
INCREASE_ITEM_AND_LEVEL_ACTOR_ID
enum INCREASE_ITEM_AND_LEVEL_ACTOR_ID
The debug room's actors, numbering the rows of
IncreaseItemAndLevelActorPlacements.
| Enumerator | Value | Description |
|---|---|---|
ACTOR_ITEM_BROWSER | ACTOR_FIRST_PLACED | The lady statue: dbIncreaseItemAndLevelSelectItem. |
ACTOR_ICON_BROWSER | The winged statue: dbIncreaseItemAndLevelOpenIconBrowser. | |
ACTOR_PORTRAIT_BROWSER | The sun disc statue: dbIncreaseItemAndLevelOpenPortraitBrowser; Force cast at it runs dbIncreaseItemAndLevelRunMotionTest. | |
ACTOR_LEVEL_EDITOR | The cat: dbIncreaseItemAndLevelRunLevelEditor, drawn larger than the others. |
Definition at line 54 of file level.c.
Functions in detail
dbIncreaseItemAndLevelRunMotionTest
void dbIncreaseItemAndLevelRunMotionTest(void)
The motion test, Force cast at the sun disc statue: the statue takes its walk and the cat shakes its head, and once the statue's animation has changed the cat moves to (312, 416).
References fdActorSetAnimationById(), fdActorWaitForAnimationChange(), fdScriptEnd(), fdScriptEndLastingPsynergy() and fdScriptStart().
Definition at lines 29 and 1169 of file level.c.
dbIncreaseItemAndLevelKeepPortraitBrowserInPlace
void dbIncreaseItemAndLevelKeepPortraitBrowserInPlace(void)
Keeps Force from moving ACTOR_PORTRAIT_BROWSER: run just before Force is cast
at it, this sets the effect's childMode, and Force's shot then leaves its
target where it is.
Definition at lines 30 and 1183 of file level.c.
dbIncreaseItemAndLevelOpenIconBrowser
void dbIncreaseItemAndLevelOpenIconBrowser(void)
Talking to ACTOR_ICON_BROWSER: pages of item, Psynergy and status icons.
References mnDebugBrowserIcons().
Referenced by IncreaseItemAndLevelCues.
Definition at lines 31 and 1196 of file level.c.
dbIncreaseItemAndLevelOpenPortraitBrowser
void dbIncreaseItemAndLevelOpenPortraitBrowser(void)
Talking to ACTOR_PORTRAIT_BROWSER: the portraits, one at a time.
References mnDebugBrowserPortraits().
Referenced by IncreaseItemAndLevelCues.
Definition at lines 32 and 1202 of file level.c.
scGetEntrances
const SCENE_ENTRANCE *scGetEntrances(void)
References SceneEntrances.
Definition at line 69 of file level.c.
scGetExitRegions
const struct SCENE_EXIT_REGION *scGetExitRegions(void)
Definition at line 74 of file level.c.
scGetExits
const Uint32 *scGetExits(void)
References SceneExits.
Definition at line 79 of file level.c.
scGetActorPlacements
const ACTOR_PLACE *scGetActorPlacements(void)
The scene's actor placements: a room of names for its entrance, else the debug room's.
References IncreaseItemAndLevelActorPlacements, IncreaseItemAndLevelFirstNamePlacements, IncreaseItemAndLevelFourthNamePlacements, IncreaseItemAndLevelSecondNamePlacements, IncreaseItemAndLevelThirdNamePlacements and MainRoutineStateWork.
Definition at line 86 of file level.c.
dbIncreaseItemAndLevelShowName
void dbIncreaseItemAndLevelShowName(Sint32 actorId)
Shows the name of the person talked to in a room of names: actor actorId
says the message its room's list of names gives it, counted from the room's
first name: "Master Poi" in the first room, "Susa" in the second, "Alex" in
the third and "Weapons Shop" in the fourth.
References fdScriptEnd(), fdScriptEndLastingPsynergy(), fdScriptSetMessageId(), fdScriptShowMessageAndWait(), fdScriptStart(), MainRoutineStateWork and Sint32.
Definition at line 106 of file level.c.
dbIncreaseItemAndLevelShowCharacterName
void dbIncreaseItemAndLevelShowCharacterName(Sint32 character)
Shows a party member's name when they are talked to in a room of names, the
line of the list from MsgNamesIsaac at their character number, with the
character as the message's actor argument. The list runs Isaac, Garet, Ivan,
Mia, Jenna, Sheba, Piers with no Felix, so from JENNA on each says the next
name: Jenna "Sheba", Sheba "Piers" and Piers "Alex".
References fdScriptEnd(), fdScriptEndLastingPsynergy(), fdScriptSetMessageId(), fdScriptShowMessageAndWait(), fdScriptStart(), mnMessageArgumentPush() and Sint32.
Referenced by IncreaseItemAndLevelNameCues.
Definition at line 131 of file level.c.
scGetCues
const CUE *scGetCues(void)
The scene's cues: the rooms of names' for any entrance above
ENTRANCE_NAMES_ABOVE, else the debug room's.
References IncreaseItemAndLevelCues, IncreaseItemAndLevelNameCues and MainRoutineStateWork.
Definition at line 148 of file level.c.
dbIncreaseItemAndLevelRaiseMemberLevel
void dbIncreaseItemAndLevelRaiseMemberLevel(Sint32 ownerId, Sint32 amount)
Raises one party member amount levels and works out their new stats.
References gmUnitCalculate(), gmUnitGet(), gmUnitLevelUpTo() and Sint32.
Referenced by dbIncreaseItemAndLevelRaisePartyLevels().
Definition at line 156 of file level.c.
dbIncreaseItemAndLevelRaisePartyLevels
void dbIncreaseItemAndLevelRaisePartyLevels(Sint32 amount)
Raises every party member amount levels.
References dbIncreaseItemAndLevelRaiseMemberLevel(), scFieldPartyListMembers() and Sint32.
Referenced by dbIncreaseItemAndLevelRunLevelEditor().
Definition at line 163 of file level.c.
dbIncreaseItemAndLevelRunLevelEditor
void dbIncreaseItemAndLevelRunLevelEditor(void)
Displays the leader's level and changes the whole party's: talking to
ACTOR_LEVEL_EDITOR shows Raise everyone's level. over the leader's name and
level; Start or Select raises the whole party five levels to the Super Lucky
jingle, A one level to the Lucky one. B closes the window and works out the
stats of Isaac, Garet, Mia and Ivan again.
References dbIncreaseItemAndLevelRaisePartyLevels(), gmUnitCalculate(), gmUnitGet(), IncreaseItemAndLevelLvLabel, MainRoutineStateWork, mnTextDrawMessage(), mnTextDrawNumberInWindow(), mnTextDrawStringAtOffset(), mnTextDrawStringInWindow(), mnWindowClose(), mnWindowCreate(), mnWindowSpriteRedrawSavedRect(), PerWork, Sint32, sySoundPlay() and sySynch().
Referenced by IncreaseItemAndLevelCues.
Definition at line 179 of file level.c.
dbIncreaseItemAndLevelSelectItem
void dbIncreaseItemAndLevelSelectItem(void)
Browses nonempty item definitions and gives the selected item to the party:
talking to ACTOR_ITEM_BROWSER. Up and Down step one number, Right and Left
ten, R and L thirty, passing over numbers whose item has no icon; A gives the
item to the first party member with room, and B, or A with every bag full,
closes the browser.
References gmItemGetDefinition(), gmPartyInventoryAdd(), gmPartyInventoryHasSpace(), IncreaseItemAndLevelItemFull, IncreaseItemAndLevelItemHelp, IncreaseItemAndLevelItemPrompt, mnItemMenuDrawItemDetails(), mnTextDrawMessage(), mnTextDrawMessageAsTiles(), mnTextDrawNumberAtOffset(), mnTextDrawStringInWindow(), mnWindowClose(), mnWindowCreate(), mnWindowSpriteClearList(), mnWindowSpriteRedrawSavedRect(), PerWork, Sint32, syDMAXCopy(), sySoundPlay() and sySynch().
Referenced by IncreaseItemAndLevelCues.
Definition at line 248 of file level.c.
dbIncreaseItemAndLevelRequestExit
void dbIncreaseItemAndLevelRequestExit(Sint32 countdown)
Unused: requests an exit through a window transition over 24 ticks; no cue row names it.
References Sint32 and syImportScriptSetExitRequest().
Definition at line 1141 of file level.c.
scInit
Sint32 scInit(void)
Opens the room through the window transition, and in the debug room draws the cat 1.7 times its size.
References fdActorGetById(), MainRoutineStateWork and Sint32.
Definition at line 1152 of file level.c.
scPrepareMap
Sint32 scPrepareMap(void)
References Sint32.
Definition at line 1190 of file level.c.
Variables in detail
IncreaseItemAndLevelActorPlacements
extern ACTOR_PLACE IncreaseItemAndLevelActorPlacements[]
ACTOR_PLACE IncreaseItemAndLevelActorPlacements[]
The debug room's actors, in the order of INCREASE_ITEM_AND_LEVEL_ACTOR_ID.
Referenced by scGetActorPlacements().
Definition at lines 18 and 459 of file level.c.
IncreaseItemAndLevelFirstNamePlacements
extern ACTOR_PLACE IncreaseItemAndLevelFirstNamePlacements[]
ACTOR_PLACE IncreaseItemAndLevelFirstNamePlacements[]
The first room of names, from Master Poi.
Referenced by scGetActorPlacements().
Definition at lines 19 and 500 of file level.c.
IncreaseItemAndLevelSecondNamePlacements
extern ACTOR_PLACE IncreaseItemAndLevelSecondNamePlacements[]
ACTOR_PLACE IncreaseItemAndLevelSecondNamePlacements[]
The second room of names.
Referenced by scGetActorPlacements().
Definition at lines 20 and 631 of file level.c.
IncreaseItemAndLevelThirdNamePlacements
extern ACTOR_PLACE IncreaseItemAndLevelThirdNamePlacements[]
ACTOR_PLACE IncreaseItemAndLevelThirdNamePlacements[]
The third room of names, from Alex.
Referenced by scGetActorPlacements().
Definition at lines 21 and 762 of file level.c.
IncreaseItemAndLevelFourthNamePlacements
extern ACTOR_PLACE IncreaseItemAndLevelFourthNamePlacements[]
ACTOR_PLACE IncreaseItemAndLevelFourthNamePlacements[]
The fourth room of names.
Referenced by scGetActorPlacements().
Definition at lines 22 and 902 of file level.c.
IncreaseItemAndLevelNameCues
extern CUE IncreaseItemAndLevelNameCues[]
CUE IncreaseItemAndLevelNameCues[]
References dbIncreaseItemAndLevelShowCharacterName().
Referenced by scGetCues().
Definition at lines 23 and 1099 of file level.c.
IncreaseItemAndLevelCues
extern CUE IncreaseItemAndLevelCues[]
CUE IncreaseItemAndLevelCues[]
Talking to each statue, or the cat, runs its tool, and Force at the sun disc statue its test, as in The Broken Seal's Japanese edition.
References dbIncreaseItemAndLevelOpenIconBrowser(), dbIncreaseItemAndLevelOpenPortraitBrowser(), dbIncreaseItemAndLevelRunLevelEditor() and dbIncreaseItemAndLevelSelectItem().
Referenced by scGetCues().
Definition at lines 24 and 1085 of file level.c.
IncreaseItemAndLevelLvLabel
extern char IncreaseItemAndLevelLvLabel[]
char IncreaseItemAndLevelLvLabel[4]
The level editor's label before a member's level.
Referenced by dbIncreaseItemAndLevelRunLevelEditor().
Definition at lines 25 and 400 of file level.c.
IncreaseItemAndLevelItemPrompt
extern char IncreaseItemAndLevelItemPrompt[]
char IncreaseItemAndLevelItemPrompt[12]
The item selector's prompt, before the item number.
Referenced by dbIncreaseItemAndLevelSelectItem().
Definition at lines 26 and 403 of file level.c.
IncreaseItemAndLevelItemHelp
extern char IncreaseItemAndLevelItemHelp[]
char IncreaseItemAndLevelItemHelp[24]
The item selector's help line, while the bags have room.
Referenced by dbIncreaseItemAndLevelSelectItem().
Definition at lines 27 and 406 of file level.c.
IncreaseItemAndLevelItemFull
extern char IncreaseItemAndLevelItemFull[]
char IncreaseItemAndLevelItemFull[20]
The item selector's line when the party's bags are full.
Referenced by dbIncreaseItemAndLevelSelectItem().
Definition at lines 28 and 409 of file level.c.
SceneEntrances
SCENE_ENTRANCE SceneEntrances[]
Referenced by scGetEntrances().
Definition at line 411 of file level.c.
SceneExits
Uint32 SceneExits[]
The room has no exits of its own.
Referenced by scGetExits().
Definition at line 454 of file level.c.