Skip to Content
The Alchemy Project

src/debug/level.c

The debug room Increase item and level, whose actors raise the party's levels, give any item and show the game's icons and portraits.

Macros

NameDescription
#defineITEM_DEBUG_DETAILS_WIDTH JAPANESE_OR(13, 28)The item browser's details window, 28 tiles wide outside Japanese and 13 in it, and how it draws the item's plain name: as tiles outside Japanese, into the window's canvas in it.
#defineITEM_DEBUG_DRAW_ITEM_NAME
#defineDEBUG_ABILITY_COUNT 270The ability browser's numbers, 0 to 269.
#defineLEVEL_EDITOR_SCALEACTOR_LEVEL_EDITOR's scale in 16.16, which the international editions changed (scInit).

Enumerations

NameDescription
enumINCREASE_ITEM_AND_LEVEL_ACTOR_ID { ACTOR_ITEM_BROWSER, ACTOR_ICON_BROWSER, ACTOR_PORTRAIT_BROWS … }The scene's actors, numbering the rows of IncreaseItemAndLevelActorPlacements; the game names none of them, so each is named for what talking to it opens (IncreaseItemAndLevelCues).

Functions

NameDescription
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.
Sint32scInit (void)Sets up the room: the window transition in, the level editor's size, and what each emote bubble shows.
const SCENE_EXIT_REGION *scGetExitRegions (void)The scene has no exit regions: its regions entry returns none.
static voiddbIncreaseItemAndLevelWinceAndSpeak (void)Talking to ACTOR_ELLIPSIS_BUBBLE: a wince pops up over it and it says "I won't stop you, but I wouldn't go unless I had business there." The line is chosen before the bubble, where dbIncreaseItemAndLevelEllipsisAndSpeak chooses it after: the one way the two differ.
static voiddbIncreaseItemAndLevelEllipsisAndSpeak (void)Talking to ACTOR_WINCE_BUBBLE: a "..." pops up over the other bubble, which says the same line.
static voiddbIncreaseItemAndLevelRaiseMemberLevel (Sint32 memberId, Sint32 levels)Raises one party member the given number of levels and works out their new stats.
static voiddbIncreaseItemAndLevelRaisePartyLevels (Sint32 levels)Raises everyone in the party the given number of levels.
static voiddbIncreaseItemAndLevelRunLevelEditor (void)Talking to ACTOR_LEVEL_EDITOR: Raise everyone's level. over the leader's name and level.
static voiddbIncreaseItemAndLevelSelectItem (void)Talking to ACTOR_ITEM_BROWSER: Item No: over an item's name, its icon and what equipping it does, stepping over the numbers with no item.
static voiddbIncreaseItemAndLevelSelectAbility (void)Talking to ACTOR_ABILITY_BROWSER in English and German: Psy No: over an ability's name and its description, stepping over the numbers with no ability; B leaves.
static voiddbIncreaseItemAndLevelRequestExit (void)Unused: requests an exit through TRANSITION_WINDOW over 24 ticks; no script row names it.
static voiddbIncreaseItemAndLevelRunMotionTest (void)Force cast at ACTOR_PORTRAIT_BROWSER in Japanese: Menardi starts walking on the spot and the cat shaking its head, and once Menardi's animation moves on the cat is put at 312x416 on the map.
static voiddbIncreaseItemAndLevelShowGlyphCaptions (void)Force cast at ACTOR_PORTRAIT_BROWSER outside Japanese: a window at the foot of the screen with three rows of the font's letters and marks, left open.
static voiddbIncreaseItemAndLevelKeepPortraitBrowserInPlace (void)Keeps Force from pushing ACTOR_PORTRAIT_BROWSER: 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 intdbIncreaseItemAndLevelOpenIconBrowser (void)Talking to ACTOR_ICON_BROWSER: the icon browser.
static intdbIncreaseItemAndLevelOpenPortraitBrowser (void)Talking to ACTOR_PORTRAIT_BROWSER: the portrait browser.

Variables

NameDescription
extern charIncreaseItemAndLevelLvLabel [4]
extern charIncreaseItemAndLevelItemPrompt [12]
extern charIncreaseItemAndLevelItemHelp [24]
extern charIncreaseItemAndLevelItemFull [20]
extern charIncreaseItemAndLevelPsyPrompt [8]
extern charIncreaseItemAndLevelPsyHelp [12]
extern charIncreaseItemAndLevelGlyphsUpper [28]The glyph captions' first row; it has no I.
extern charIncreaseItemAndLevelGlyphsLower [28]
extern charIncreaseItemAndLevelGlyphsMarks [12]
extern SCENE_ENTRANCEIncreaseItemAndLevelEntrances []
extern Uint32IncreaseItemAndLevelExits []No exits.
extern ACTOR_PLACEIncreaseItemAndLevelActorPlacements []The scene's actors, in the order of INCREASE_ITEM_AND_LEVEL_ACTOR_ID: the item, icon and portrait browsers and the level editor; outside Japanese also the ability browser (reachable in English and German only) and the two emote bubbles.
extern CUEIncreaseItemAndLevelCues []Talking to each actor opens its tool; Force cast at Menardi runs a test of its own.

Description

The debug room Increase item and level, whose actors raise the party's levels, give any item and show the game's icons and portraits.

Macros in detail

ITEM_DEBUG_DETAILS_WIDTH

#define ITEM_DEBUG_DETAILS_WIDTH JAPANESE_OR(13, 28)

The item browser's details window, 28 tiles wide outside Japanese and 13 in it, and how it draws the item's plain name: as tiles outside Japanese, into the window's canvas in it.

Referenced by dbIncreaseItemAndLevelSelectItem().

Definition at line 33 of file level.c.

ITEM_DEBUG_DRAW_ITEM_NAME

#define ITEM_DEBUG_DRAW_ITEM_NAME

Referenced by dbIncreaseItemAndLevelSelectItem().

Definition at line 34 of file level.c.

DEBUG_ABILITY_COUNT

#define DEBUG_ABILITY_COUNT 270

The ability browser's numbers, 0 to 269.

Referenced by dbIncreaseItemAndLevelSelectAbility().

Definition at line 37 of file level.c.

LEVEL_EDITOR_SCALE

#define LEVEL_EDITOR_SCALE

ACTOR_LEVEL_EDITOR's scale in 16.16, which the international editions changed (scInit).

Referenced by scInit().

Definition at line 41 of file level.c.

Enumerations in detail

INCREASE_ITEM_AND_LEVEL_ACTOR_ID

enum INCREASE_ITEM_AND_LEVEL_ACTOR_ID

The scene's actors, numbering the rows of IncreaseItemAndLevelActorPlacements; the game names none of them, so each is named for what talking to it opens (IncreaseItemAndLevelCues).

EnumeratorValueDescription
ACTOR_ITEM_BROWSERACTOR_FIRST_PLACEDdbIncreaseItemAndLevelSelectItem: Item No: over an item's name and what equipping it does, with A:Get Item B:Return.
ACTOR_ICON_BROWSERdbIncreaseItemAndLevelOpenIconBrowser: pages of 32 item icons headed ITEM PAGE:0.
ACTOR_PORTRAIT_BROWSERdbIncreaseItemAndLevelOpenPortraitBrowser: the portraits, Isaac's first, stepped through with Left and Right; Force cast at it runs the Force tests.
ACTOR_LEVEL_EDITORdbIncreaseItemAndLevelRunLevelEditor: Raise everyone's level. over the leader's name and level, A raising it one and Start five.
ACTOR_ABILITY_BROWSERdbIncreaseItemAndLevelSelectAbility: Psy No: over an ability's name, with B:Return.
ACTOR_ELLIPSIS_BUBBLEAn emote bubble standing on its own, showing "...": dbIncreaseItemAndLevelWinceAndSpeak.
ACTOR_WINCE_BUBBLEAn emote bubble standing on its own, showing the wince: dbIncreaseItemAndLevelEllipsisAndSpeak.

Definition at line 47 of file level.c.

Functions in detail

scGetEntrances

const SCENE_ENTRANCE *scGetEntrances(void)

References IncreaseItemAndLevelEntrances.

Definition at lines 11 and 70 of file level.c.

scGetExits

const Uint32 *scGetExits(void)

References IncreaseItemAndLevelExits.

Definition at lines 12 and 81 of file level.c.

scGetActorPlacements

const ACTOR_PLACE *scGetActorPlacements(void)

References IncreaseItemAndLevelActorPlacements.

Definition at lines 13 and 86 of file level.c.

scGetCues

const CUE *scGetCues(void)

References IncreaseItemAndLevelCues.

Definition at lines 14 and 113 of file level.c.

scInit

Sint32 scInit(void)

Sets up the room: the window transition in, the level editor's size, and what each emote bubble shows.

References fdActorGetById(), Sint32 and syImportActorSetAnimation().

Definition at lines 15 and 526 of file level.c.

scGetExitRegions

const SCENE_EXIT_REGION *scGetExitRegions(void)

The scene has no exit regions: its regions entry returns none.

Definition at line 76 of file level.c.

dbIncreaseItemAndLevelWinceAndSpeak

static void dbIncreaseItemAndLevelWinceAndSpeak(void)

Talking to ACTOR_ELLIPSIS_BUBBLE: a wince pops up over it and it says "I won't stop you, but I wouldn't go unless I had business there." The line is chosen before the bubble, where dbIncreaseItemAndLevelEllipsisAndSpeak chooses it after: the one way the two differ.

References fdActorShowEmote(), fdScriptSetMessageId() and fdScriptShowMessageAndWait().

Definition at line 96 of file level.c.

dbIncreaseItemAndLevelEllipsisAndSpeak

static void dbIncreaseItemAndLevelEllipsisAndSpeak(void)

Talking to ACTOR_WINCE_BUBBLE: a "..." pops up over the other bubble, which says the same line.

References fdActorShowEmote(), fdScriptSetMessageId() and fdScriptShowMessageAndWait().

Definition at line 105 of file level.c.

dbIncreaseItemAndLevelRaiseMemberLevel

static void dbIncreaseItemAndLevelRaiseMemberLevel(Sint32 memberId, Sint32 levels)

Raises one party member the given number of levels and works out their new stats.

References gmUnitCalculate(), gmUnitGet(), gmUnitLevelUpTo() and Sint32.

Referenced by dbIncreaseItemAndLevelRaisePartyLevels().

Definition at line 120 of file level.c.

dbIncreaseItemAndLevelRaisePartyLevels

static void dbIncreaseItemAndLevelRaisePartyLevels(Sint32 levels)

Raises everyone in the party the given number of levels.

References dbIncreaseItemAndLevelRaiseMemberLevel(), scFieldPartyListMembers() and Sint32.

Referenced by dbIncreaseItemAndLevelRunLevelEditor().

Definition at line 130 of file level.c.

dbIncreaseItemAndLevelRunLevelEditor

static void dbIncreaseItemAndLevelRunLevelEditor(void)

Talking to ACTOR_LEVEL_EDITOR: Raise everyone's level. over the leader's name and level. A raises the whole party one level, Start or Select five, and B closes the window and works out the four's stats again.

References dbIncreaseItemAndLevelRaisePartyLevels(), gmUnitCalculate(), gmUnitGet(), IncreaseItemAndLevelLvLabel, MainRoutineStateWork, mnTextDrawMessage(), mnTextDrawNumberInWindow(), mnTextDrawStringAtOffset(), mnTextDrawStringInWindow(), mnWindowClose(), mnWindowCreate(), mnWindowSpriteRedrawSavedRect(), PerPush, Sint32, sySoundPlay() and sySynch().

Referenced by IncreaseItemAndLevelCues.

Definition at line 152 of file level.c.

dbIncreaseItemAndLevelSelectItem

static void dbIncreaseItemAndLevelSelectItem(void)

Talking to ACTOR_ITEM_BROWSER: Item No: over an item's name, its icon and what equipping it does, stepping over the numbers with no item. A gives it to the party, and B, or A once the bags are full, leaves.

References gmItemGetDefinition(), gmPartyInventoryAdd(), gmPartyInventoryHasSpace(), IncreaseItemAndLevelItemFull, IncreaseItemAndLevelItemHelp, IncreaseItemAndLevelItemPrompt, mnItemMenuDrawItemDetails(), mnTextDrawMessageAsTiles(), mnTextDrawNumberAtOffset(), mnTextDrawStringInWindow(), mnWindowClose(), mnWindowCreate(), mnWindowSpriteClearList(), mnWindowSpriteRedrawSavedRect(), PerPush, PerRepeat, Sint32, syDMAXCopy(), sySoundPlay() and sySynch().

Referenced by IncreaseItemAndLevelCues.

Definition at line 218 of file level.c.

dbIncreaseItemAndLevelSelectAbility

static void dbIncreaseItemAndLevelSelectAbility(void)

Talking to ACTOR_ABILITY_BROWSER in English and German: Psy No: over an ability's name and its description, stepping over the numbers with no ability; B leaves.

References gmAbilityGetDefinition(), IncreaseItemAndLevelPsyHelp, IncreaseItemAndLevelPsyPrompt, mnTextDrawMessage(), mnTextDrawMessageAsTiles(), mnTextDrawNumberAtOffset(), mnTextDrawStringInWindow(), mnWindowClose(), mnWindowCreate(), mnWindowSpriteClearList(), mnWindowSpriteRedrawSavedRect(), PerPush, PerRepeat, Sint32, syDMAXCopy(), sySoundPlay() and sySynch().

Definition at line 377 of file level.c.

dbIncreaseItemAndLevelRequestExit

static void dbIncreaseItemAndLevelRequestExit(void)

Unused: requests an exit through TRANSITION_WINDOW over 24 ticks; no script row names it.

References syImportScriptSetExitRequest().

Definition at line 517 of file level.c.

dbIncreaseItemAndLevelRunMotionTest

static void dbIncreaseItemAndLevelRunMotionTest(void)

Force cast at ACTOR_PORTRAIT_BROWSER in Japanese: Menardi starts walking on the spot and the cat shaking its head, and once Menardi's animation moves on the cat is put at 312x416 on the map.

References fdActorWaitForAnimationChange(), fdScriptEnd(), fdScriptStart() and syImportActorSetAnimation().

Referenced by IncreaseItemAndLevelCues.

Definition at line 543 of file level.c.

dbIncreaseItemAndLevelShowGlyphCaptions

static void dbIncreaseItemAndLevelShowGlyphCaptions(void)

Force cast at ACTOR_PORTRAIT_BROWSER outside Japanese: a window at the foot of the screen with three rows of the font's letters and marks, left open.

References IncreaseItemAndLevelGlyphsLower, IncreaseItemAndLevelGlyphsMarks, IncreaseItemAndLevelGlyphsUpper, mnTextDrawStringInWindow() and mnWindowCreate().

Definition at line 557 of file level.c.

dbIncreaseItemAndLevelKeepPortraitBrowserInPlace

static void dbIncreaseItemAndLevelKeepPortraitBrowserInPlace(void)

Keeps Force from pushing ACTOR_PORTRAIT_BROWSER: 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 IncreaseItemAndLevelCues.

Definition at line 574 of file level.c.

dbIncreaseItemAndLevelOpenIconBrowser

static int dbIncreaseItemAndLevelOpenIconBrowser(void)

Talking to ACTOR_ICON_BROWSER: the icon browser.

References mnDebugBrowserIcons().

Referenced by IncreaseItemAndLevelCues.

Definition at line 583 of file level.c.

dbIncreaseItemAndLevelOpenPortraitBrowser

static int dbIncreaseItemAndLevelOpenPortraitBrowser(void)

Talking to ACTOR_PORTRAIT_BROWSER: the portrait browser.

References mnDebugBrowserPortraits().

Referenced by IncreaseItemAndLevelCues.

Definition at line 589 of file level.c.

Variables in detail

IncreaseItemAndLevelLvLabel

extern char IncreaseItemAndLevelLvLabel[4]

char IncreaseItemAndLevelLvLabel[4]

Referenced by dbIncreaseItemAndLevelRunLevelEditor().

Definition at lines 16 and 594 of file level.c.

IncreaseItemAndLevelItemPrompt

extern char IncreaseItemAndLevelItemPrompt[12]

char IncreaseItemAndLevelItemPrompt[12]

Referenced by dbIncreaseItemAndLevelSelectItem().

Definition at lines 17 and 596 of file level.c.

IncreaseItemAndLevelItemHelp

extern char IncreaseItemAndLevelItemHelp[24]

char IncreaseItemAndLevelItemHelp[24]

Referenced by dbIncreaseItemAndLevelSelectItem().

Definition at lines 18 and 598 of file level.c.

IncreaseItemAndLevelItemFull

extern char IncreaseItemAndLevelItemFull[20]

char IncreaseItemAndLevelItemFull[20]

Referenced by dbIncreaseItemAndLevelSelectItem().

Definition at lines 19 and 600 of file level.c.

IncreaseItemAndLevelPsyPrompt

extern char IncreaseItemAndLevelPsyPrompt[8]

char IncreaseItemAndLevelPsyPrompt[8]

Referenced by dbIncreaseItemAndLevelSelectAbility().

Definition at lines 20 and 603 of file level.c.

IncreaseItemAndLevelPsyHelp

extern char IncreaseItemAndLevelPsyHelp[12]

char IncreaseItemAndLevelPsyHelp[12]

Referenced by dbIncreaseItemAndLevelSelectAbility().

Definition at lines 21 and 607 of file level.c.

IncreaseItemAndLevelGlyphsUpper

extern char IncreaseItemAndLevelGlyphsUpper[28]

char IncreaseItemAndLevelGlyphsUpper[28]

The glyph captions' first row; it has no I.

Referenced by dbIncreaseItemAndLevelShowGlyphCaptions().

Definition at lines 22 and 612 of file level.c.

IncreaseItemAndLevelGlyphsLower

extern char IncreaseItemAndLevelGlyphsLower[28]

char IncreaseItemAndLevelGlyphsLower[28]

Referenced by dbIncreaseItemAndLevelShowGlyphCaptions().

Definition at lines 23 and 616 of file level.c.

IncreaseItemAndLevelGlyphsMarks

extern char IncreaseItemAndLevelGlyphsMarks[12]

char IncreaseItemAndLevelGlyphsMarks[12]

Referenced by dbIncreaseItemAndLevelShowGlyphCaptions().

Definition at lines 24 and 620 of file level.c.

IncreaseItemAndLevelEntrances

extern SCENE_ENTRANCE IncreaseItemAndLevelEntrances[]

SCENE_ENTRANCE IncreaseItemAndLevelEntrances[]

Referenced by scGetEntrances().

Definition at lines 25 and 623 of file level.c.

IncreaseItemAndLevelExits

extern Uint32 IncreaseItemAndLevelExits[]

Uint32 IncreaseItemAndLevelExits[]

No exits.

Referenced by scGetExits().

Definition at lines 26 and 629 of file level.c.

IncreaseItemAndLevelActorPlacements

extern ACTOR_PLACE IncreaseItemAndLevelActorPlacements[]

ACTOR_PLACE IncreaseItemAndLevelActorPlacements[]

The scene's actors, in the order of INCREASE_ITEM_AND_LEVEL_ACTOR_ID: the item, icon and portrait browsers and the level editor; outside Japanese also the ability browser (reachable in English and German only) and the two emote bubbles.

Referenced by scGetActorPlacements().

Definition at lines 27 and 638 of file level.c.

IncreaseItemAndLevelCues

extern CUE IncreaseItemAndLevelCues[]

CUE IncreaseItemAndLevelCues[]

Talking to each actor opens its tool; Force cast at Menardi runs a test of its own.

References dbIncreaseItemAndLevelKeepPortraitBrowserInPlace(), dbIncreaseItemAndLevelOpenIconBrowser(), dbIncreaseItemAndLevelOpenPortraitBrowser(), dbIncreaseItemAndLevelRunLevelEditor(), dbIncreaseItemAndLevelRunMotionTest() and dbIncreaseItemAndLevelSelectItem().

Referenced by scGetCues().

Definition at lines 28 and 673 of file level.c.