mr:belongings_class
Table of Contents
Belongings Class - Machine Readable Reference
Java Classes
- Belongings.java - Hero's inventory and equipment management
- Implements: Iterable<Item>, Bundlable
- Key constants:
- `BACKPACK_SIZE = 18` - Default backpack capacity
- Key fields:
- `backpack` - Bag instance (Backpack subclass)
- `weapon`, `leftHand`, `armor`, `ring1`, `ring2` - Equipped items
- `availableSlots` - Set of available equipment slots per character
- Key methods:
- `getItemFromSlot(Slot slot)` - Returns equipped item for slot
- `setItemForSlot(EquipableItem item, Slot slot)` - Equips item in slot
- `collect(Item newItem)` - Adds item to backpack
- `removeItem(Item itemToRemove)` - Removes item (unequips if needed)
- `equip(EquipableItem item, Slot slot)` - Handles equip logic with slot conflicts
- `unequip(EquipableItem item)` - Unequips item
- `isEquipped(Item item)` - Checks if item is equipped
- `slotBlocked(Slot slot)` - Checks if slot is blocked
- `charge(boolean full)` / `discharge()` - Wand charge management
- `itemCount()` / `wandCount()` - Inventory statistics
- `setupFromJson(JSONObject desc)` - Loads equipment from JSON
- `storeInBundle(Bundle)` / `restoreFromBundle(Bundle)` - Serialization
- `getAvailableSlots()` - Returns available equipment slots
- `hasSlot(Slot slot)` - Checks if slot is available
- `encumbranceCheck()` - Checks for STR requirement violations
- `identify()` - Identifies all items
- `observe()` - Marks items as observed for badges
- `uncurseEquipped()` / `curseEquipped()` - Curse management on equipped items
- `dropAll()` - Drops all items
- Equipment Slots (enum):
- NONE, WEAPON, LEFT_HAND, ARMOR, ARTIFACT, LEFT_ARTIFACT
JSON Configuration
This entity is implemented in Java, no JSON configuration exists (but supports JSON serialization via setupFromJson)
String Resources
<string name="Belongings_CantWearBoth">You can't wear both %1$s and %2$s</string> <string name="Artifact_Limit">You can't equip more than two artifacts</string>
Lua Scripts
This entity is implemented in Java, no Lua script exists. Lua interface methods exposed via @LuaInterface:
- `slotBlocked(String slot)`
- `itemSlotName(Item item)`
- `getItem(String itemClass)`
- `checkItem(String itemClass)`
- `getItemPartialMatch(String itemClass)`
- `getEquipableItemPartialMatch(String itemClass)`
- `charge(boolean full)`
- `getOwner()`
Related mr Entities
- Backpack (Item) - Hero's main inventory bag
- Bag (Item) - Base container class
- Hero Class - Character classes with different slot availability
Content Verification
- Information source: Java code (Belongings.java)
- Last updated: Based on Remixed Dungeon source code analysis
mr/belongings_class.txt · Last modified: by 127.0.0.1
