Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Character(DefaultCharacter):
- # [...]
- def at_object_creation(self):
- """
- Called only at initial creation. This is a rather silly
- example since ability scores should vary from Character to
- Character and is usually set during some character
- generation step instead.
- """
- #set persistent attributes
- self.db.strength = 5
- self.db.agility = 4
- self.db.magic = 2
- def get_abilities(self):
- """
- Simple access method to return ability
- scores as a tuple (str,agi,mag)
- """
- return self.db.strength, self.db.agility, self.db.magic
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement