Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #typeclasses/characters.py
- class Human(Character):
- """
- Implementation of Human Race in Wayward.
- """
- def at_object_creation(self):
- #set persistent attributes
- self.db.hp = 100
- self.db.will = 1
- #commands/command.py
- class MuxCommand(Command):
- def at_post_cmd(self):
- """
- This hook is called after the command has finished executing
- (after self.func()).
- """
- caller = self.caller
- prompt = 'HP: %i WP: %i' % (caller.db.hp, caller.db.will)
- caller.msg(' ')
- caller.msg(prompt=prompt)
- # In multisession mode = 2, the command of connecting account->character (@ic <charactername>) seems to be invoking MuxCommand, but, at the point of its execution, the character's attributes aren't initialized, so my at_post_cmd reference to caller.db.hp doesn't exist. It's a NoneType, not an Int. Maybe? Also, commands that use account, like who, also throw the same way.
Add Comment
Please, Sign In to add comment