Skip to Content
The Alchemy Project

src/window/screens_battle_targets.c

Choosing a battle target. More…

Included by screens.c.

Structures

NameDescription
structTARGET_TRACKOne of the target cursor's markers: where it stands, its state flags and which listed unit it marks.

Macros

NameDescription
#defineTARGET_SET_DJINNI_WIDTH JAPANESE_OR(8, 9)Widths in tiles that fit each language's text: the "Set Djinni" window (MsgTargetSetDjinni) and the list of conditions an action cures; and the Mystery names' copy, which Japanese decodes raw where the other languages copy it expanded.
#defineTARGET_CONDITION_LIST_WIDTH JAPANESE_OR(14, 16)
#defineTARGET_MYSTERY_NAME_COPY
#defineTARGET_MYSTERY_NAME_CAPACITY JAPANESE_OR(10, 14)
#defineTARGET_SET_DJINNI_WIDTH_ITALIAN 10These editions size the windows by the cartridge's language as it runs: wider for Italian and Spanish.
#defineTARGET_SET_DJINNI_WIDTH_SPANISH 11
#defineTARGET_CONDITION_LIST_WIDTH_SPANISH 17
#defineTARGET_GAUGE_WIDTH 13The HP and PP window's width, and the one-line windows' of a revival or a cure of poison.
#defineTARGET_ONE_LINE_WIDTH 12
#defineTARGET_HELP_COLUMN (back, windowWidth)The help window's column, back tiles left of the aimed party member's; a window windowWidth tiles wide that would run past the screen's right edge stands against it instead.
#defineTARGET_CONDITION_LIST_WINDOW ()
#defineTARGET_NAME_WINDOW_ROW 12The enemy name window, the screen's width from row 12, and the pixels of its interior the name is kept within.
#defineTARGET_NAME_INTERIOR_WIDTH ((DISPLAY_TILE_WIDTH - 2) * 8)
#defineTARGET_VIEW_OFFSET_ENEMIES 16Where the battle view slides while a target is chosen (BATTLE_MENU_STATE.targetViewOffset): 16 pixels down when aiming at the enemies, 2 up when aiming at the party or the user.
#defineTARGET_VIEW_OFFSET_PARTY (-2)
#defineTARGET_MARKERS 6The target cursor's markers: the cursor, and two to each side of it for the units its range covers.
#defineCURSOR_EASING (1 << 0)TARGET_TRACK.flags: easing halfway to its unit each tick, in the current spread, and one tick of staying put.
#defineCURSOR_IN_SPREAD (1 << 1)
#defineCURSOR_HOLD_TICK (1 << 2)
#defineTARGET_REDRAW_SPREAD 1What the selection redraws: the spread's targets and their markers, and at the start every part.
#defineTARGET_REDRAW_ALL 0xFFFF

Functions

NameDescription
Sint32mnBattleTargetRunSelection (Sint32 selection, Sint32 mode, Uint32 spread, Uint32 kind)Lets the player choose the target of an action of unit selection, with a cursor over the aimed unit and smaller markers on the others its range covers.

Description

Choosing a battle target. Part of screens.c.

Macros in detail

TARGET_SET_DJINNI_WIDTH

#define TARGET_SET_DJINNI_WIDTH JAPANESE_OR(8, 9)

Widths in tiles that fit each language's text: the "Set Djinni" window (MsgTargetSetDjinni) and the list of conditions an action cures; and the Mystery names' copy, which Japanese decodes raw where the other languages copy it expanded.

Referenced by mnBattleTargetRunSelection().

Definition at line 7 of file screens_battle_targets.c.

TARGET_CONDITION_LIST_WIDTH

#define TARGET_CONDITION_LIST_WIDTH JAPANESE_OR(14, 16)

Definition at line 8 of file screens_battle_targets.c.

TARGET_MYSTERY_NAME_COPY

#define TARGET_MYSTERY_NAME_COPY

Referenced by mnBattleTargetRunSelection().

Definition at line 9 of file screens_battle_targets.c.

TARGET_MYSTERY_NAME_CAPACITY

#define TARGET_MYSTERY_NAME_CAPACITY JAPANESE_OR(10, 14)

Referenced by mnBattleTargetRunSelection().

Definition at line 11 of file screens_battle_targets.c.

TARGET_SET_DJINNI_WIDTH_ITALIAN

#define TARGET_SET_DJINNI_WIDTH_ITALIAN 10

These editions size the windows by the cartridge's language as it runs: wider for Italian and Spanish.

Referenced by mnBattleTargetRunSelection().

Definition at line 16 of file screens_battle_targets.c.

TARGET_SET_DJINNI_WIDTH_SPANISH

#define TARGET_SET_DJINNI_WIDTH_SPANISH 11

Referenced by mnBattleTargetRunSelection().

Definition at line 17 of file screens_battle_targets.c.

TARGET_CONDITION_LIST_WIDTH_SPANISH

#define TARGET_CONDITION_LIST_WIDTH_SPANISH 17

Definition at line 18 of file screens_battle_targets.c.

TARGET_GAUGE_WIDTH

#define TARGET_GAUGE_WIDTH 13

The HP and PP window's width, and the one-line windows' of a revival or a cure of poison.

Referenced by mnBattleTargetRunSelection().

Definition at line 23 of file screens_battle_targets.c.

TARGET_ONE_LINE_WIDTH

#define TARGET_ONE_LINE_WIDTH 12

Referenced by mnBattleTargetRunSelection().

Definition at line 24 of file screens_battle_targets.c.

TARGET_HELP_COLUMN

#define TARGET_HELP_COLUMN(back, windowWidth)

The help window's column, back tiles left of the aimed party member's; a window windowWidth tiles wide that would run past the screen's right edge stands against it instead.

Referenced by mnBattleTargetRunSelection().

Definition at line 29 of file screens_battle_targets.c.

TARGET_CONDITION_LIST_WINDOW

#define TARGET_CONDITION_LIST_WINDOW()

Referenced by mnBattleTargetRunSelection().

Definition at lines 40 and 71 of file screens_battle_targets.c.

TARGET_NAME_WINDOW_ROW

#define TARGET_NAME_WINDOW_ROW 12

The enemy name window, the screen's width from row 12, and the pixels of its interior the name is kept within.

Referenced by mnBattleTargetRunSelection().

Definition at line 84 of file screens_battle_targets.c.

TARGET_NAME_INTERIOR_WIDTH

#define TARGET_NAME_INTERIOR_WIDTH ((DISPLAY_TILE_WIDTH - 2) * 8)

Referenced by mnBattleTargetRunSelection().

Definition at line 85 of file screens_battle_targets.c.

TARGET_VIEW_OFFSET_ENEMIES

#define TARGET_VIEW_OFFSET_ENEMIES 16

Where the battle view slides while a target is chosen (BATTLE_MENU_STATE.targetViewOffset): 16 pixels down when aiming at the enemies, 2 up when aiming at the party or the user.

Referenced by mnBattleTargetRunSelection().

Definition at line 90 of file screens_battle_targets.c.

TARGET_VIEW_OFFSET_PARTY

#define TARGET_VIEW_OFFSET_PARTY (-2)

Referenced by mnBattleTargetRunSelection().

Definition at line 91 of file screens_battle_targets.c.

TARGET_MARKERS

#define TARGET_MARKERS 6

The target cursor's markers: the cursor, and two to each side of it for the units its range covers.

Referenced by mnBattleTargetRunSelection().

Definition at line 95 of file screens_battle_targets.c.

CURSOR_EASING

#define CURSOR_EASING (1 << 0)

TARGET_TRACK.flags: easing halfway to its unit each tick, in the current spread, and one tick of staying put.

Referenced by mnBattleTargetRunSelection().

Definition at line 111 of file screens_battle_targets.c.

CURSOR_IN_SPREAD

#define CURSOR_IN_SPREAD (1 << 1)

Referenced by mnBattleTargetRunSelection().

Definition at line 112 of file screens_battle_targets.c.

CURSOR_HOLD_TICK

#define CURSOR_HOLD_TICK (1 << 2)

Referenced by mnBattleTargetRunSelection().

Definition at line 113 of file screens_battle_targets.c.

TARGET_REDRAW_SPREAD

#define TARGET_REDRAW_SPREAD 1

What the selection redraws: the spread's targets and their markers, and at the start every part.

Referenced by mnBattleTargetRunSelection().

Definition at line 117 of file screens_battle_targets.c.

TARGET_REDRAW_ALL

#define TARGET_REDRAW_ALL 0xFFFF

Referenced by mnBattleTargetRunSelection().

Definition at line 118 of file screens_battle_targets.c.

Functions in detail

mnBattleTargetRunSelection

Sint32 mnBattleTargetRunSelection(Sint32 selection, Sint32 mode, Uint32 spread, Uint32 kind)

Lets the player choose the target of an action of unit selection, with a cursor over the aimed unit and smaller markers on the others its range covers. mode is the action's targetMode: ABILITY_TARGET_ALLIES the party, ABILITY_TARGET_SELF only selection itself, anything else the enemies. spread is its range: 1 one unit, n the aimed one and n - 1 either side, ABILITY_RANGE_ALL every one (the cursor does not move); 0 counts as 1. kind (BATTLE_TARGET_HINT) is mnBattleClassifyEntryKind's class, or TARGET_HINT_SET_DJINNI: on a party member it opens a window of what the action would do (its HP or PP, the statuses it cures, "Set Djinni"), and a reviving or curing action not aimed at everyone starts on the first party member who needs it. Returns the target chosen, PLACE_PARTY | its party slot or PLACE_ENEMY | its enemy slot, or -1 when cancelled.

References BattleStatusScreenHpString, BattleStatusScreenKpString, BattleStatusScreenPpString, BattleStatusScreenPvString, BattleStatusScreenSlashString, btHighlightSetModesStub(), btMotionProjectCursorPointStub(), gmFlagGetStub(), gmUnitGetStub(), MenuAnimatedCursorTiles, mnTextClearCanvas(), mnTextDrawMessageAsTiles(), mnTextDrawNumberInWindow(), mnTextDrawStringAtOffset(), mnTextDrawWideStringAtOffset(), mnTextGetWideStringWidth(), mnTextSetColor(), mnWindowClose(), mnWindowCreate(), PerPush, PerRepeat, Sint32, syGetLanguage(), syOAMAddSpriteAtDepth(), syOAMMatrixAllocateFromTransform(), sySoundPlayStub(), sySynch(), syVRAMCacheAllocateEntry(), syVRAMCacheFreeEntry(), syVRAMCacheReload(), TickCount and width.

Referenced by mnBattleCollectPartyCommands().

Definition at line 132 of file screens_battle_targets.c.