# evennia.contrib.tutorials.evadventure.characters

Character class.

class `evennia.contrib.tutorials.evadventure.characters.``LivingMixin`

  Bases: `object`

  Mixin class to use for all living things.

  `is_pc` = False
  property `hurt_level`

    String describing how hurt this character is.

  `heal`(hp, healer=None)

    Heal by a certain amount of HP.

  `at_damage`(damage, attacker=None)

    Called when attacked and taking damage.

  `at_defeat`()

    Called when this living thing reaches HP 0.

  `at_death`()

    Called when this living thing dies.

  `at_pay`(amount)

    Get coins, but no more than we actually have.

  `at_looted`(looter)

    Called when being looted (after defeat).

    Parameters

      looter (Object) – The one doing the looting.

  `pre_loot`(defeated_enemy)

    Called just before looting an enemy.

    Parameters

      defeated_enemy (Object) – The enemy soon to loot.

    Returns

      bool – If False, no looting is allowed.

  `at_do_loot`(defeated_enemy)

    Called when looting another entity.

    Parameters

      defeated_enemy – The thing to loot.

  `post_loot`(defeated_enemy)

    Called just after having looted an enemy.

    Parameters

      defeated_enemy (Object) – The enemy just looted.

class `evennia.contrib.tutorials.evadventure.characters.``EvAdventureCharacter`(*args, **kwargs)

  Bases: `evennia.contrib.tutorials.evadventure.characters.LivingMixin`, `evennia.objects.objects.DefaultCharacter`

  A Character for use with EvAdventure.

  `is_pc` = True
  `strength`

    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")

  `dexterity`

    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")

  `constitution`

    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")

  `intelligence`

    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")

  `wisdom`

    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")

  `charisma`

    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")

  `hp`

    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")

  `hp_max`

    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")

  `level`

    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")

  `coins`

    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")

  `xp`

    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")

  `xp_per_level` = 1000
  `equipment`

    Allows to access equipment like char.equipment.worn

  `quests`

    Access and track quests

  property `weapon`
  property `armor`
  `at_pre_object_receive`(moved_object, source_location, **kwargs)

    Hook called by Evennia before moving an object here. Return False to abort move.

    Parameters

      - moved_object (Object) – Object to move into this one (that is, into inventory).

      - source_location (Object) – Source location moved from.

      - **kwargs – Passed from move operation; the move_type is useful; if someone is giving us something (move_type==’give’) we want to ask first.

    Returns

      bool – If move should be allowed or not.

  `at_object_receive`(moved_object, source_location, **kwargs)

    Hook called by Evennia as an object is moved here. We make sure it’s added to the equipment handler.

    Parameters

      - moved_object (Object) – Object to move into this one (that is, into inventory).

      - source_location (Object) – Source location moved from.

      - **kwargs – Passed from move operation; unused here.

  `at_pre_object_leave`(leaving_object, destination, **kwargs)

    Hook called when dropping an item. We don’t allow to drop weilded/worn items (need to unwield/remove them first). Return False to

  `at_object_leave`(moved_object, destination, **kwargs)

    Called just before an object leaves from inside this object

    Parameters

      - moved_obj (Object) – The object leaving

      - destination (Object) – Where moved_obj is going.

      - **kwargs (dict) – Arbitrary, optional arguments for users overriding the call (unused by default).

  `at_defeat`()

    This happens when character drops <= 0 HP. For Characters, this means rolling on the death table.

  `at_death`()

    Called when character dies.

  `at_pre_loot`()

    Called before allowing to loot. Return False to block enemy looting.

  `at_looted`(looter)

    Called when being looted.

  `add_xp`(xp)

    Add new XP.

    Parameters

      xp (int) – The amount of gained XP.

    Returns

      bool – If a new level was reached or not.

    Notes

    level 1 -> 2 = 1000 XP level 2 -> 3 = 2000 XP etc

  `level_up`(*abilities)

    Perform the level-up action.

    Parameters

      *abilities (str) – A set of abilities (like ‘strength’, ‘dexterity’ (normally 3) to upgrade by 1. Max is usually +10.

    Notes

    We block increases above a certain value, but we don’t raise an error here, that will need to be done earlier, when the user selects the ability to increase.

  exception `DoesNotExist`

    Bases: `evennia.objects.objects.DefaultCharacter.DoesNotExist`

  exception `MultipleObjectsReturned`

    Bases: `evennia.objects.objects.DefaultCharacter.MultipleObjectsReturned`

  `path` = 'evennia.contrib.tutorials.evadventure.characters.EvAdventureCharacter'
  `typename` = 'EvAdventureCharacter'

`evennia.contrib.tutorials.evadventure.characters.``get_character_sheet`(character)

  Generate a character sheet. This is grouped in a class in order to make it easier to override the look of the sheet.