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)[source]

Bases: evennia.objects.objects.DefaultObject

Base in-game entity.

inventory_use_slot

AttributeProperty.

size

AttributeProperty.

value

AttributeProperty.

obj_type = 'gear'
at_object_creation()[source]

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

get_display_header(looker, **kwargs)[source]

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

Parameters
  • looker (DefaultObject) – Object doing the looking.

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

Returns

str – The header display string.

get_display_desc(looker, **kwargs)[source]

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

Parameters
  • looker (DefaultObject) – Object doing the looking.

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

Returns

str – The desc display string.

has_obj_type(objtype)[source]

Check if object is of a particular type.

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

get_help()[source]

Get help text for the item.

Returns

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

at_pre_use(*args, **kwargs)[source]

Called before use. If returning False, usage should be aborted.

use(*args, **kwargs)[source]

Use this object, whatever that may mean.

at_post_use(*args, **kwargs)[source]

Called after use happened.

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)[source]

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

AttributeProperty.

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)[source]

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

AttributeProperty.

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)[source]

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

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

obj_type = 'treasure'
value

AttributeProperty.

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)[source]

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

AttributeProperty.

uses

AttributeProperty.

at_pre_use(user, target=None, *args, **kwargs)[source]

Called before use. If returning False, usage should be aborted.

use(user, target=None, *args, **kwargs)[source]

Use the consumable.

at_post_use(user, *args, **kwargs)[source]

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.EvAdventureWeapon(*args, **kwargs)[source]

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

Base weapon class for all EvAdventure weapons.

obj_type = 'weapon'
inventory_use_slot

AttributeProperty.

quality

AttributeProperty.

attack_type

AttributeProperty.

defense_type

AttributeProperty.

damage_roll

AttributeProperty.

get_display_name(looker=None, **kwargs)[source]

Displays the name of the object in a viewer-aware manner.

Parameters

looker (DefaultObject) – The object or account that is looking at or getting information for this object.

Returns

str – A name to display for this object. By default this returns the .name of the object.

Notes

This function can be extended to change how object names appear to users in character, but it does not change an object’s keys or aliases when searching.

at_pre_use(user, target=None, *args, **kwargs)[source]

Called before use. If returning False, usage should be aborted.

use(attacker, target, *args, advantage=False, disadvantage=False, **kwargs)[source]

When a weapon is used, it attacks an opponent

at_post_use(user, *args, **kwargs)[source]

Called after use happened.

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.EvAdventureThrowable(*args, **kwargs)[source]

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

Something you can throw at an enemy to harm them once, like a knife or exploding potion/grenade.

Note: In Knave, ranged attacks are done with WIS (representing the stillness of your mind?)

obj_type = (<ObjType.THROWABLE: 'throwable'>, <ObjType.WEAPON: 'weapon'>, <ObjType.CONSUMABLE: 'consumable'>)
attack_type

AttributeProperty.

defense_type

AttributeProperty.

damage_roll

AttributeProperty.

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.EvAdventureThrowable'
typename = 'EvAdventureThrowable'
class evennia.contrib.tutorials.evadventure.objects.EvAdventureRunestone(*args, **kwargs)[source]

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

AttributeProperty.

attack_type

AttributeProperty.

defense_type

AttributeProperty.

damage_roll

AttributeProperty.

at_post_use(user, *args, **kwargs)[source]

Called after the spell was cast

refresh()[source]
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)[source]

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

Base class for all wearable Armors.

obj_type = 'armor'
inventory_use_slot = 'body'
armor

AttributeProperty.

quality

AttributeProperty.

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)[source]

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)[source]

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'
class evennia.contrib.tutorials.evadventure.objects.WeaponBareHands(*args, **kwargs)[source]

Bases: evennia.contrib.tutorials.evadventure.objects.EvAdventureWeapon

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

obj_type = 'weapon'
key = 'Bare hands'
inventory_use_slot = 'weapon_hand'
attack_type = 'strength'
defense_type = 'armor'
damage_roll = '1d4'
quality = None
exception DoesNotExist

Bases: evennia.contrib.tutorials.evadventure.objects.EvAdventureWeapon.DoesNotExist

exception MultipleObjectsReturned

Bases: evennia.contrib.tutorials.evadventure.objects.EvAdventureWeapon.MultipleObjectsReturned

path = 'evennia.contrib.tutorials.evadventure.objects.WeaponBareHands'
typename = 'WeaponBareHands'
evennia.contrib.tutorials.evadventure.objects.get_bare_hands()[source]

Get the bare-hands singleton object.

Returns

WeaponBareHands