> cat /wizhelp/objects
> _
======================================================================== Creating Objects ======================================================================== Objects include weapons, armor, consumables, and special items. OBJECT STRUCTURE: Objects are Python files in /lib/objects/ that define a load() function. BASIC WEAPON: ```python # /lib/objects/weapons/my_sword.py from lib.models.objects import Weapon def load(): return Weapon( name="flaming sword", description="A sword wreathed in magical flames.", damage=45, # Base damage weight=10, value=500 ) ``` WEAPON TIERS: Weapons use a tier system for balanced damage: - TIER1: 15-35 damage (basic weapons) - TIER2: 30-50 damage (standard weapons) - TIER3: 45-65 damage (good weapons) - TIER4: 60-80 damage (superior weapons) - TIER5: 75-95 damage (legendary weapons) To use tiers: ```python from lib.plugins.tier_plugins.weapon_tier_plugin import TIER3, apply_weapon_tier weapon = Weapon( name="battle sword", damage=0, # Set by tier weight=10, value=400 ) apply_weapon_tier(weapon, TIER3) # 45-65 damage ``` ARMOR TIERS: Armor also uses a tier system: - TIER1: 2 AC (leather, cloth) - TIER2: 5 AC (studded leather, chainmail) - TIER3: 8 AC (scale mail, banded mail) - TIER4: 12 AC (plate mail, battle armor) - TIER5: 18 AC (magical/artifact armor) ```python from lib.plugins.tier_plugins.armor_tier_plugin import TIER3, apply_armor_tier from lib.models.objects import Armor, ArmorSlot armor = Armor( name="scale mail", description="Overlapping metal scales.", armor_class=0, # Set by tier slot=ArmorSlot.BODY, weight=25, value=800 ) apply_armor_tier(armor, TIER3) # 8 AC ``` CONSUMABLES: ```python from lib.models.objects import Consumable class MegaHeal(Consumable): def __init__(self): super().__init__( name="Mega Heal [500]", description="A powerful healing potion.", heal_amount=500, charges=1, value=1000 ) def load(): return MegaHeal() ``` SPECIAL ITEMS: Complex items like teleporters, poison, wands: ```python class PoisonGlob(Consumable): def __init__(self, charges=1): self.charges = charges self.name = f"Poison Glob [{charges}]" self.command_name = "poison" # Custom logic in use() method ``` CLONING ITEMS: clone battle_sword # From /lib/objects/ clone random/heal_100 # From subdirectory clone mike/poison_glob # Special items clone 5000 coins # Create money ITEM PROPERTIES: All items have these basic properties: - takeable: Can be picked up (default: True) - sellable: Can be sold to shops (default: True) - droppable: Can be dropped (default: True) - kept: Marked to prevent accidental selling - weight: How heavy the item is - value: Base price in coins COMBINABLE ITEMS: Some items auto-combine when picked up: - Heals: Stack into higher charge counts - Wands: Combine charges if same type - Poison: Combines applications - Teleporters: Stack charges - Coins: Always combine Special items like Blood cannot be sold or dropped. DIRECTORIES: /weapons/ - Swords, axes, etc. /armor/ - Body, head, ring slots /consumables/ - Heals, wands, potions /special/ - Unique/quest items ========================================================================
> _