hazelmud/typeclasses/characters.py

38 lines
1.3 KiB
Python
Raw Normal View History

2024-01-10 06:43:33 +00:00
from evennia.contrib.game_systems.clothing import ClothedCharacter
from evennia.contrib.rpg.traits import TraitHandler
2024-01-12 01:15:24 +00:00
#from evennia.contrib.rpg.traits import TraitProperty
#from evennia.utils import lazy_property
from commands.encounter_cmdset import SetEncounterSpecial
from world.species import SPECIES_CMDSET
CURRENT_VERSION = 1
2024-01-10 06:43:33 +00:00
class Character(ClothedCharacter):
def at_object_creation(self):
self.db.version = 1
self.db.species = 0
2024-01-12 01:15:24 +00:00
# ears = TraitProperty("Ears", trait_type="counter",
# base=0, mod=0, min=0, max=2,
# descs = {0:"human ears", 1:"cat ears", 2:"dog ears"})
# tail = TraitProperty("Tail", trait_type="counter",
# base=0, mod=0, min=0, max=2,
# descs = {0:"no tail", 1:"cat tail", 2:"dog tail"})
def apply_encounter_cmdset(self):
self.cmdset.add(SetEncounterSpecial)
self.cmdset.add(SPECIES_CMDSET[self.db.species])
def revoke_encounter_cmdset(self):
self.cmdset.remove(SPECIES_CMDSET[self.db.species])
self.cmdset.remove(SetEncounterSpecial)
pass
def at_pre_move(self, destination, **kwargs):
if self.ndb.encounter_handler:
self.msg("You would need to leave the encounter first")
return False
return True