# evennia.contrib.tutorials.evadventure.objects

All items in the game inherit from a base object. The properties (what you can do with an object, such as wear, wield, eat, drink, kill etc) are all controlled by Tags.

Every object has one of a few obj_type-category tags: - weapon - armor - shield - helmet - consumable (potions, torches etc) - magic (runestones, magic items) - quest (quest-items) - treasure (valuable to sell)

It’s possible for an item to have more than one tag, such as a golden helmet (helmet+treasure) or rune sword (weapon+quest).

class `evennia.contrib.tutorials.evadventure.objects.``EvAdventureObject`(*args, **kwargs)

  Bases: `evennia.objects.objects.DefaultObject`

  Base in-game entity.

  `inventory_use_slot`

    Attribute property descriptor. Allows for specifying Attributes as Django-like ‘fields’ on the class level. Note that while one can set a lock on the Attribute, there is no way to check said lock when accessing via the property - use the full AttributeHandler if you need to do access checks.

    Example:

        class Character(DefaultCharacter):
            foo = AttributeProperty(default="Bar")

  `size`

    Attribute property descriptor. Allows for specifying Attributes as Django-like ‘fields’ on the class level. Note that while one can set a lock on the Attribute, there is no way to check said lock when accessing via the property - use the full AttributeHandler if you need to do access checks.

    Example:

        class Character(DefaultCharacter):
            foo = AttributeProperty(default="Bar")

  `value`

    Attribute property descriptor. Allows for specifying Attributes as Django-like ‘fields’ on the class level. Note that while one can set a lock on the Attribute, there is no way to check said lock when accessing via the property - use the full AttributeHandler if you need to do access checks.

    Example:

        class Character(DefaultCharacter):
            foo = AttributeProperty(default="Bar")

  `obj_type` = 'gear'
  `at_object_creation`()

    Called once, when this object is first created. This is the normal hook to overload for most object types.

  `get_display_header`(looker, **kwargs)

    Get the ‘header’ component of the object description. Called by return_appearance.

    Parameters

      - looker (Object) – Object doing the looking.

      - **kwargs – Arbitrary data for use when overriding.

    Returns

      str – The header display string.

  `get_display_desc`(looker, **kwargs)

    Get the ‘desc’ component of the object description. Called by return_appearance.

    Parameters

      - looker (Object) – Object doing the looking.

      - **kwargs – Arbitrary data for use when overriding.

    Returns

      str – The desc display string..

  `has_obj_type`(objtype)

    Check if object is of a particular type.

    typeobj_enum (enum.ObjType): A type to check, like enums.TypeObj.TREASURE.

  `get_help`()

    Get help text for the item.

    Returns

      str – The help text, by default taken from the .help_text property.

  exception `DoesNotExist`

    Bases: `evennia.objects.objects.DefaultObject.DoesNotExist`

  exception `MultipleObjectsReturned`

    Bases: `evennia.objects.objects.DefaultObject.MultipleObjectsReturned`

  `path` = 'evennia.contrib.tutorials.evadventure.objects.EvAdventureObject'
  `typename` = 'EvAdventureObject'

class `evennia.contrib.tutorials.evadventure.objects.``EvAdventureObjectFiller`(*args, **kwargs)

  Bases: `evennia.contrib.tutorials.evadventure.objects.EvAdventureObject`

  In _Knave_, the inventory slots act as an extra measure of how you are affected by various averse effects. For example, mud or water could fill up some of your inventory slots and make the equipment there unusable until you cleaned it. Inventory is also used to track how long you can stay under water etc - the fewer empty slots you have, the less time you can stay under water due to carrying so much stuff with you.

  This class represents such an effect filling up an empty slot. It has a quality of 0, meaning it’s unusable.

  `obj_type` = 'quest'
  `quality`

    Attribute property descriptor. Allows for specifying Attributes as Django-like ‘fields’ on the class level. Note that while one can set a lock on the Attribute, there is no way to check said lock when accessing via the property - use the full AttributeHandler if you need to do access checks.

    Example:

        class Character(DefaultCharacter):
            foo = AttributeProperty(default="Bar")

  exception `DoesNotExist`

    Bases: `evennia.contrib.tutorials.evadventure.objects.EvAdventureObject.DoesNotExist`

  exception `MultipleObjectsReturned`

    Bases: `evennia.contrib.tutorials.evadventure.objects.EvAdventureObject.MultipleObjectsReturned`

  `path` = 'evennia.contrib.tutorials.evadventure.objects.EvAdventureObjectFiller'
  `typename` = 'EvAdventureObjectFiller'

class `evennia.contrib.tutorials.evadventure.objects.``EvAdventureQuestObject`(*args, **kwargs)

  Bases: `evennia.contrib.tutorials.evadventure.objects.EvAdventureObject`

  A quest object. These cannot be sold and only be used for quest resolution.

  `obj_type` = 'quest'
  `value`

    Attribute property descriptor. Allows for specifying Attributes as Django-like ‘fields’ on the class level. Note that while one can set a lock on the Attribute, there is no way to check said lock when accessing via the property - use the full AttributeHandler if you need to do access checks.

    Example:

        class Character(DefaultCharacter):
            foo = AttributeProperty(default="Bar")

  exception `DoesNotExist`

    Bases: `evennia.contrib.tutorials.evadventure.objects.EvAdventureObject.DoesNotExist`

  exception `MultipleObjectsReturned`

    Bases: `evennia.contrib.tutorials.evadventure.objects.EvAdventureObject.MultipleObjectsReturned`

  `path` = 'evennia.contrib.tutorials.evadventure.objects.EvAdventureQuestObject'
  `typename` = 'EvAdventureQuestObject'

class `evennia.contrib.tutorials.evadventure.objects.``EvAdventureTreasure`(*args, **kwargs)

  Bases: `evennia.contrib.tutorials.evadventure.objects.EvAdventureObject`

  A ‘treasure’ is mainly useful to sell for coin.

  `obj_type` = 'treasure'
  `value`

    Attribute property descriptor. Allows for specifying Attributes as Django-like ‘fields’ on the class level. Note that while one can set a lock on the Attribute, there is no way to check said lock when accessing via the property - use the full AttributeHandler if you need to do access checks.

    Example:

        class Character(DefaultCharacter):
            foo = AttributeProperty(default="Bar")

  exception `DoesNotExist`

    Bases: `evennia.contrib.tutorials.evadventure.objects.EvAdventureObject.DoesNotExist`

  exception `MultipleObjectsReturned`

    Bases: `evennia.contrib.tutorials.evadventure.objects.EvAdventureObject.MultipleObjectsReturned`

  `path` = 'evennia.contrib.tutorials.evadventure.objects.EvAdventureTreasure'
  `typename` = 'EvAdventureTreasure'

class `evennia.contrib.tutorials.evadventure.objects.``EvAdventureConsumable`(*args, **kwargs)

  Bases: `evennia.contrib.tutorials.evadventure.objects.EvAdventureObject`

  Item that can be ‘used up’, like a potion or food. Weapons, armor etc does not have a limited usage in this way.

  `obj_type` = 'consumable'
  `size`

    Attribute property descriptor. Allows for specifying Attributes as Django-like ‘fields’ on the class level. Note that while one can set a lock on the Attribute, there is no way to check said lock when accessing via the property - use the full AttributeHandler if you need to do access checks.

    Example:

        class Character(DefaultCharacter):
            foo = AttributeProperty(default="Bar")

  `uses`

    Attribute property descriptor. Allows for specifying Attributes as Django-like ‘fields’ on the class level. Note that while one can set a lock on the Attribute, there is no way to check said lock when accessing via the property - use the full AttributeHandler if you need to do access checks.

    Example:

        class Character(DefaultCharacter):
            foo = AttributeProperty(default="Bar")

  `at_use`(user, *args, **kwargs)

    Consume a ‘use’ of this item. Once it reaches 0 uses, it should normally not be usable anymore and probably be deleted.

    Parameters

      - user (Object) – The one using the item.

      - *args – Extra arguments depending on the usage and item.

      - **kwargs –

        Extra arguments depending on the usage and item.

  `at_post_use`(user, *args, **kwargs)

    Called after this item was used.

    Parameters

      - user (Object) – The one using the item.

      - *args – Optional arguments.

      - **kwargs –

        Optional arguments.

  exception `DoesNotExist`

    Bases: `evennia.contrib.tutorials.evadventure.objects.EvAdventureObject.DoesNotExist`

  exception `MultipleObjectsReturned`

    Bases: `evennia.contrib.tutorials.evadventure.objects.EvAdventureObject.MultipleObjectsReturned`

  `path` = 'evennia.contrib.tutorials.evadventure.objects.EvAdventureConsumable'
  `typename` = 'EvAdventureConsumable'

class `evennia.contrib.tutorials.evadventure.objects.``WeaponEmptyHand`

  Bases: `object`

  This is a dummy-class loaded when you wield no weapons. We won’t create any db-object for it.

  `obj_type` = 'weapon'
  `key` = 'Empty Fists'
  `inventory_use_slot` = 'weapon_hand'
  `attack_type` = 'strength'
  `defense_type` = 'armor'
  `damage_roll` = '1d4'
  `quality` = 100000

class `evennia.contrib.tutorials.evadventure.objects.``EvAdventureWeapon`(*args, **kwargs)

  Bases: `evennia.contrib.tutorials.evadventure.objects.EvAdventureObject`

  Base weapon class for all EvAdventure weapons.

  `obj_type` = 'weapon'
  `inventory_use_slot`

    Attribute property descriptor. Allows for specifying Attributes as Django-like ‘fields’ on the class level. Note that while one can set a lock on the Attribute, there is no way to check said lock when accessing via the property - use the full AttributeHandler if you need to do access checks.

    Example:

        class Character(DefaultCharacter):
            foo = AttributeProperty(default="Bar")

  `quality`

    Attribute property descriptor. Allows for specifying Attributes as Django-like ‘fields’ on the class level. Note that while one can set a lock on the Attribute, there is no way to check said lock when accessing via the property - use the full AttributeHandler if you need to do access checks.

    Example:

        class Character(DefaultCharacter):
            foo = AttributeProperty(default="Bar")

  `attack_type`

    Attribute property descriptor. Allows for specifying Attributes as Django-like ‘fields’ on the class level. Note that while one can set a lock on the Attribute, there is no way to check said lock when accessing via the property - use the full AttributeHandler if you need to do access checks.

    Example:

        class Character(DefaultCharacter):
            foo = AttributeProperty(default="Bar")

  `defense_type`

    Attribute property descriptor. Allows for specifying Attributes as Django-like ‘fields’ on the class level. Note that while one can set a lock on the Attribute, there is no way to check said lock when accessing via the property - use the full AttributeHandler if you need to do access checks.

    Example:

        class Character(DefaultCharacter):
            foo = AttributeProperty(default="Bar")

  `damage_roll`

    Attribute property descriptor. Allows for specifying Attributes as Django-like ‘fields’ on the class level. Note that while one can set a lock on the Attribute, there is no way to check said lock when accessing via the property - use the full AttributeHandler if you need to do access checks.

    Example:

        class Character(DefaultCharacter):
            foo = AttributeProperty(default="Bar")

  exception `DoesNotExist`

    Bases: `evennia.contrib.tutorials.evadventure.objects.EvAdventureObject.DoesNotExist`

  exception `MultipleObjectsReturned`

    Bases: `evennia.contrib.tutorials.evadventure.objects.EvAdventureObject.MultipleObjectsReturned`

  `path` = 'evennia.contrib.tutorials.evadventure.objects.EvAdventureWeapon'
  `typename` = 'EvAdventureWeapon'

class `evennia.contrib.tutorials.evadventure.objects.``EvAdventureRunestone`(*args, **kwargs)

  Bases: `evennia.contrib.tutorials.evadventure.objects.EvAdventureWeapon`, `evennia.contrib.tutorials.evadventure.objects.EvAdventureConsumable`

  Base class for magic runestones. In _Knave_, every spell is represented by a rune stone that takes up an inventory slot. It is wielded as a weapon in order to create the specific magical effect provided by the stone. Normally each stone can only be used once per day but they are quite powerful (and scales with caster level).

  `obj_type` = (<ObjType.WEAPON: 'weapon'>, <ObjType.MAGIC: 'magic'>)
  `inventory_use_slot` = 'two_handed_weapons'
  `quality`

    Attribute property descriptor. Allows for specifying Attributes as Django-like ‘fields’ on the class level. Note that while one can set a lock on the Attribute, there is no way to check said lock when accessing via the property - use the full AttributeHandler if you need to do access checks.

    Example:

        class Character(DefaultCharacter):
            foo = AttributeProperty(default="Bar")

  `attack_type`

    Attribute property descriptor. Allows for specifying Attributes as Django-like ‘fields’ on the class level. Note that while one can set a lock on the Attribute, there is no way to check said lock when accessing via the property - use the full AttributeHandler if you need to do access checks.

    Example:

        class Character(DefaultCharacter):
            foo = AttributeProperty(default="Bar")

  `defense_type`

    Attribute property descriptor. Allows for specifying Attributes as Django-like ‘fields’ on the class level. Note that while one can set a lock on the Attribute, there is no way to check said lock when accessing via the property - use the full AttributeHandler if you need to do access checks.

    Example:

        class Character(DefaultCharacter):
            foo = AttributeProperty(default="Bar")

  `damage_roll`

    Attribute property descriptor. Allows for specifying Attributes as Django-like ‘fields’ on the class level. Note that while one can set a lock on the Attribute, there is no way to check said lock when accessing via the property - use the full AttributeHandler if you need to do access checks.

    Example:

        class Character(DefaultCharacter):
            foo = AttributeProperty(default="Bar")

  `at_post_use`(user, *args, **kwargs)

    Called after the spell was cast

  `refresh`()
  exception `DoesNotExist`

    Bases: `evennia.contrib.tutorials.evadventure.objects.EvAdventureWeapon.DoesNotExist`, `evennia.contrib.tutorials.evadventure.objects.EvAdventureConsumable.DoesNotExist`

  exception `MultipleObjectsReturned`

    Bases: `evennia.contrib.tutorials.evadventure.objects.EvAdventureWeapon.MultipleObjectsReturned`, `evennia.contrib.tutorials.evadventure.objects.EvAdventureConsumable.MultipleObjectsReturned`

  `path` = 'evennia.contrib.tutorials.evadventure.objects.EvAdventureRunestone'
  `typename` = 'EvAdventureRunestone'

class `evennia.contrib.tutorials.evadventure.objects.``EvAdventureArmor`(*args, **kwargs)

  Bases: `evennia.contrib.tutorials.evadventure.objects.EvAdventureObject`

  Base class for all wearable Armors.

  `obj_type` = 'armor'
  `inventory_use_slot` = 'body'
  `armor`

    Attribute property descriptor. Allows for specifying Attributes as Django-like ‘fields’ on the class level. Note that while one can set a lock on the Attribute, there is no way to check said lock when accessing via the property - use the full AttributeHandler if you need to do access checks.

    Example:

        class Character(DefaultCharacter):
            foo = AttributeProperty(default="Bar")

  `quality`

    Attribute property descriptor. Allows for specifying Attributes as Django-like ‘fields’ on the class level. Note that while one can set a lock on the Attribute, there is no way to check said lock when accessing via the property - use the full AttributeHandler if you need to do access checks.

    Example:

        class Character(DefaultCharacter):
            foo = AttributeProperty(default="Bar")

  exception `DoesNotExist`

    Bases: `evennia.contrib.tutorials.evadventure.objects.EvAdventureObject.DoesNotExist`

  exception `MultipleObjectsReturned`

    Bases: `evennia.contrib.tutorials.evadventure.objects.EvAdventureObject.MultipleObjectsReturned`

  `path` = 'evennia.contrib.tutorials.evadventure.objects.EvAdventureArmor'
  `typename` = 'EvAdventureArmor'

class `evennia.contrib.tutorials.evadventure.objects.``EvAdventureShield`(*args, **kwargs)

  Bases: `evennia.contrib.tutorials.evadventure.objects.EvAdventureArmor`

  Base class for all Shields.

  `obj_type` = 'shield'
  `inventory_use_slot` = 'shield_hand'
  exception `DoesNotExist`

    Bases: `evennia.contrib.tutorials.evadventure.objects.EvAdventureArmor.DoesNotExist`

  exception `MultipleObjectsReturned`

    Bases: `evennia.contrib.tutorials.evadventure.objects.EvAdventureArmor.MultipleObjectsReturned`

  `path` = 'evennia.contrib.tutorials.evadventure.objects.EvAdventureShield'
  `typename` = 'EvAdventureShield'

class `evennia.contrib.tutorials.evadventure.objects.``EvAdventureHelmet`(*args, **kwargs)

  Bases: `evennia.contrib.tutorials.evadventure.objects.EvAdventureArmor`

  Base class for all Helmets.

  `obj_type` = 'helmet'
  `inventory_use_slot` = 'head'
  exception `DoesNotExist`

    Bases: `evennia.contrib.tutorials.evadventure.objects.EvAdventureArmor.DoesNotExist`

  exception `MultipleObjectsReturned`

    Bases: `evennia.contrib.tutorials.evadventure.objects.EvAdventureArmor.MultipleObjectsReturned`

  `path` = 'evennia.contrib.tutorials.evadventure.objects.EvAdventureHelmet'
  `typename` = 'EvAdventureHelmet'