Skip to main content

The inventory

Items · What worn items change · InventorySlotMask

In brief​

Each character has 27 inventory slots: two hands, a backpack of fourteen slots, a quiver, five slots of worn equipment, three belt slots and two rings. A slot accepts an item when the masks of the slot and of the item's type share a bit. The player carries one item at a time on the pointer, or moves it with the keyboard; a cursed item cannot leave a hand. Some items need the first hand or both hands, which can make the second hand unusable.

The 27 inventory slots of a character, grouped by use. Slots 0 and 1 are the two hands. Slots 2 to 15 are the backpack and accept any item. Slot 16 is the quiver, which holds a pile of arrows. Slots 17 to 21 hold body armour, bracers, a helmet, an amulet or necklace, and boots. Slot 22, the top belt slot, accepts any item; slots 23 and 24 accept small items. Slots 25 and 26 hold rings.
Most slots take one sort of item; the backpack and the top belt slot take any.

Inventory slots​

Each character has 27 inventory slots. A slot accepts the item types whose InventorySlotMask shares a bit with the slot's own mask:1

SlotsHoldsMask
0, 1The two handsINVENTORY_SLOT_HAND
2–15The backpack: any itemall bits
16The quiver: a pile of arrowsINVENTORY_SLOT_QUIVER
17Body armour, robe or cloakINVENTORY_SLOT_BODY_ARMOUR
18BracersINVENTORY_SLOT_BRACERS
19HelmetINVENTORY_SLOT_HELMET
20Amulet or necklaceINVENTORY_SLOT_NECK
21BootsINVENTORY_SLOT_BOOTS
22Belt: any item (see below)all bits
23, 24Belt: small itemsINVENTORY_SLOT_BELT
25, 26RingsINVENTORY_SLOT_RING

In the original data, every item that fits some slot can also be held in a hand, and the weapons conjured by spells fit no slot at all; the item catalogue gives the mask of each item type. The quiver is not a single item: slot 16 holds the first arrow of a pile, the other arrows are chained to it, and the inventory page shows how many there are.

Anomaly

The top belt slot, 22, accepts any item, like the backpack, while the two belt slots below it accept only small items. Armour, a shield or a two-handed weapon can be stored there. A faithful reimplementation keeps the mask of slot 22 as it is.

Anomaly

ANOMALY-154 — Horns fit the two ring slots: the mask of ITEM_TYPE_HORN has INVENTORY_SLOT_RING, which only the two ring types otherwise have. No rule reads a horn there: the search for a worn ring needs an ITEM_TYPE_RING and the defense an ITEM_KIND_WORN item, so the only effect in play is one more place to store a horn (inferred). A faithful reimplementation keeps the bit in the horn's mask.2

Moving and equipping items​

With a mouse, the player carries one item at a time on the pointer. On the inventory page of a character, clicking a slot exchanges the carried item with the slot's item; clicking the quiver takes its top arrow when the pointer is empty, or adds the carried arrow to the pile. Clicking a hand on a portrait with the left button exchanges the carried item with that hand; the other button uses the item (inferred from the button code tested). With the keyboard, the selected hand or slot plays the role of the pointer: an item given to it that it cannot take falls on the floor of the party's block, in one of the two front quarters chosen at random.3

When an item reaches the pointer, or the selected slot in keyboard control, the message area at the bottom of the screen shows "name taken.". The message appears only while that message area is the active text window, that is during ordinary play and on the inventory page, not in the camp menus, dialogues or character creation, and not for an item the selected slot refused.4

The game refuses a move:

  • when the item does not fit the slot: "You can't put that item there.";
  • when a character's class may not wear the body armour: "name can't wear that type of armor.";
  • when a hand holds a cursed item (ITEM_RUNTIME_CURSED), which cannot be taken out or replaced: a cursed weapon gives "name cannot release the weapon! It is cursed!", any other cursed item in a hand stays without a message.

On a portrait, refused exchanges give no message; that exchange compares only the hand bits of the masks and applies no class rule. No class rule applies to slots other than the body armour, and no rule on two-handed weapons applies when an item is moved: those rules decide what the item does once in place. Every exchange made by the player, on the inventory page or on a portrait, computes the character's defense again.

The curse binds only the two hands. A cursed item in any other slot moves like any other item: the amulet of resurrection, a cursed item of level 12, can be put on the neck and taken off again. Only the keyboard's drop and throw refuse a cursed item wherever it is (see items on the floor). A conjured weapon is cursed and its type has mask 0: it can neither be released from its hand nor placed in any slot.5

The selected character​

The game keeps one selected character. In keyboard control it is the character whose hand or slot the keys move between, and a frame marks the selected hand. With the mouse, it is the last present character whose portrait box the player clicked, anywhere in the box, since the box's own button is tested before the name, face and hand buttons and lets the click through to them; the inventory page's previous and next buttons also change it. After two characters swap places, the selection is the place clicked second, which then holds the character clicked first. It is character 0 at the start of a game and after a character is removed. In mouse play nothing on the screen appears to mark it outside the inventory page; this is inferred from the drawing code, which shows the selection only on that page and in keyboard control. The selected character is the one whose inventory page is shown, and the thrower of an item thrown from the pointer; using a hand item does not depend on it.6

Two hands​

Each item type says how many hands it needs (hand_requirement_raw); the item catalogue gives it for each type:7

NeedsEffect on the second hand
any handcan be used from the second hand
first handa weapon that needs it cannot be used from the second hand
both handsin the first hand, makes the second hand unusable

The second hand cannot be used while the first holds an item needing both hands, even when the second is empty, nor while it holds a weapon that needs the first hand. A hand also cannot be used with an item the character's class may not use. The portrait draws a hand that cannot be used, or that is recovering from its last use, as unavailable.

Sources​

Locations refer to the game executable reference.

Footnotes​

  1. Inventory-slot masks, inventory page layout and the placement check. ↩

  2. The horn's record in the item-type records, tested by the placement check; look for a worn ring and recompute a character's defense. ↩

  3. Click an inventory slot, swap the held item with a portrait hand, inventory buttons, give the held item and the inventory messages. ↩

  4. Give the held item, select a text window and the text windows. ↩

  5. The placement check, swap the held item with a portrait hand, keyboard drop and throw and reserve a conjured-weapon type; the amulet is record 407 of the reference ITEM.DAT. ↩

  6. The selected character, select a character by its box, set the selected character, build the main button list, process the button list and the inventory buttons. ↩

  7. Hand checks and draw a portrait hand. ↩