Advertisement
Suichiro

Untitled

Sep 21st, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. class Character():
  2.  
  3. # Create a character
  4. def __init__(self, char_name, char_description):
  5. self.name = char_name
  6. self.description = char_description
  7. self.conversation = None
  8.  
  9. # Describe this character
  10. def describe(self):
  11. print( self.name + " is here!" )
  12. print( self.description )
  13.  
  14. # Set what this character will say when talked to
  15. def set_conversation(self, conversation):
  16. self.conversation = conversation
  17.  
  18. # Talk to this character
  19. def talk(self):
  20. if self.conversation is not None:
  21. print("[" + self.name + " says]: " + self.conversation)
  22. else:
  23. print(self.name + " doesn't want to talk to you")
  24.  
  25. # Fight with this character
  26. def fight(self, combat_item):
  27. print(self.name + " doesn't want to fight with you")
  28. return True
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement