Skip to main content

Party and character routines

Routines · Data · Address index

Portraits, swapping and removing characters, hit points, experience and levels, and saving throws. The routines page explains how the entries are written.

0x1ff4e — Party status check​

0x1e8c6 — Redraw every portrait​

0x1f267, 0x1ef59, 0x1f062 — Ask a two-choice question​

  • Ranges: 0x1f267–0x1f55b; 0x1ef59–0x1f061; 0x1f062–0x1f0c2
  • Role: 0x1ef59(window, string) shows a button: it saves the button's area to page 2 through the page copy, unless the button, in the words DS:0xf100–0xf106 (height, width, x, y), is over 84 rows high or 22 columns wide, draws the box and label on page 2 and copies them to the screen. 0x1f062(window) puts the area back under the same condition, when the box closes (0x1f25c, 0x1f54c). 0x1f267(window, string, initial) selects a text window, prints string number string of the list at file offset 0x2c170 and draws two buttons labelled from the table at DS:0x5500 ("Yes" at DS:0x5528, "No" at DS:0x552c). The buttons are 32 × 14 pixels, Yes 8 pixels from the window's left edge and No 40 pixels from its right edge, 21 pixels above its bottom (0x1f2ac–0x1f2e9). initial 1 highlights Yes first, 0 No. In mouse control the button under the pointer is highlighted. A press of either mouse button on a button chooses it. Y chooses Yes, N No, Enter or Space the highlighted button, and keypad 4 or 6 (or the grey arrows) move the highlight; Shift, Ctrl and Alt are ignored (0x1f391), keypad 5 is not handled and Escape does nothing (0x1f39c–0x1f3d5). The highlighted label is drawn in colour 6, the other in 15. The chosen button is shown pressed for a moment. The routine returns 1 for Yes and 0 for No (0x1f551). The defeat sequence calls it with window 14 and string 67.
  • Used by: The game loop › When the party is defeated, The start menu, questions and text › Questions and messages, Texts, Camp menus

0x1be79 — Cancel a swap​

0x1bd9c, 0x1959f — Swap two characters​

0x1c2e1, 0x1c3e6 — Eat the item in hand​

0x1b54d — Saving-throw table lookup​

0x1e67c — Remove a character from the party​

0x1e929 — Character eligibility test​

0x1edfc — Count eligible characters​

0x1ba55 — Experience threshold for a class level​

0x1b5c2, 0x1b5dc — Class components​

0x1b70e — Constitution hit-point modifier​

0x1b73b — Hit points for a level​

0x1b7fd, 0x1b88e, 0x1b94a — Hit-point limits​

  • Ranges: 0x1b7fd–0x1b88d, 0x1b88e–0x1b949, 0x1b94a–0x1ba05
  • Role: 0x1b7fd(type, modifier, level, mode) returns the hit points of one base class: the rolled levels, at most the last rolled level of the hit-point tables, times the hit die (mode 0) or once each (mode 1); plus the fixed gain for each level above; plus level × modifier, except in mode 1 when the modifier is not positive. 0x1b88e (mode 0, maximum) and 0x1b94a (mode 1, minimum) take a class, a constitution and three levels, apply the constitution modifier, add 0x1b7fd over the components and divide by the number of classes. The literal calls of 0x1b88e and 0x1b94a are in modify a character.
  • Comparative source: REF-SCUMM-017, getModifiedHpLimits, getMaxHp and getMinHp.
  • Used by: The creation screen › Modifying a character

0x1ba06 — Strength text​

  • Range: 0x1ba06–0x1ba54
  • Role: Formats a strength for display: %d/%02d when the exceptional strength is positive, 100 being shown as 00, and %d otherwise.
  • Used by: Attributes and classes › Attributes

0x20015 — Adjust hit points​

0x20071, 0x2015f — Award experience​

0x201bc — Gain a level​

0x204da, 0x20574 — Saving throw and damage reduction​

0x1e8df — A character's saving throw against an effect​

0x204a0 — Saving throw against a monster ray​

0x2098e, 0x20854, 0x209fc, 0x209cf — Damage characters​