evennia.contrib.tutorials.evadventure.characters¶
Character class.
- class evennia.contrib.tutorials.evadventure.characters.LivingMixin[source]¶
Bases:
objectMixin class to use for all living things.
- is_pc = False¶
- property hurt_level¶
String describing how hurt this character is.
- at_looted(looter)[source]¶
Called when being looted (after defeat).
- Parameters:
looter (Object) – The one doing the looting.
- pre_loot(defeated_enemy)[source]¶
Called just before looting an enemy.
- Parameters:
defeated_enemy (Object) – The enemy soon to loot.
- Returns:
bool – If False, no looting is allowed.
- class evennia.contrib.tutorials.evadventure.characters.EvAdventureCharacter(*args, **kwargs)[source]¶
Bases:
LivingMixin,DefaultCharacterA Character for use with EvAdventure.
- is_pc = True¶
- strength¶
AttributeProperty.
- dexterity¶
AttributeProperty.
- constitution¶
AttributeProperty.
- intelligence¶
AttributeProperty.
- wisdom¶
AttributeProperty.
- charisma¶
AttributeProperty.
- hp¶
AttributeProperty.
- hp_max¶
AttributeProperty.
- level¶
AttributeProperty.
- coins¶
AttributeProperty.
- xp¶
AttributeProperty.
- xp_per_level = 1000¶
- property weapon¶
- property armor¶
- at_pre_object_receive(moved_object, source_location, **kwargs)[source]¶
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)[source]¶
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)[source]¶
Hook called when dropping an item. We don’t allow to drop wielded/worn items (need to unwield/remove them first). Return False to
- at_object_leave(moved_object, destination, **kwargs)[source]¶
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()[source]¶
This happens when character drops <= 0 HP. For Characters, this means rolling on the death table.
- add_xp(xp)[source]¶
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)[source]¶
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:
DoesNotExist
- exception MultipleObjectsReturned¶
Bases:
MultipleObjectsReturned
- path = 'evennia.contrib.tutorials.evadventure.characters.EvAdventureCharacter'¶
- typename = 'EvAdventureCharacter'¶