Advertisement
Guest User

Untitled

a guest
Jul 17th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.02 KB | None | 0 0
  1. from evennia import DefaultObject, Command, CmdSet, default_cmds, search_object, utils
  2. from evennia.utils.evmenu import EvMenu
  3.  
  4. def menu_start_node(caller):
  5. text = "Are you a god?"
  6. options = ({"desc": "Yes",
  7. "goto": "life"},
  8. {"desc": "Ummm, no",
  9. "exec": **HOW DO I BREAK OUT FROM HERE AND GET TO move_player?**,
  10. "goto": "BADEND"},
  11. {"desc": "Leave Conversation",
  12. "goto": "END"})
  13. return text, options
  14.  
  15. def life(caller):
  16. text = "Oh, alrigtht then, rock on man."
  17. options = ({"desc": "Leave Conversation",
  18. "goto": "END"})
  19. return text, options
  20.  
  21. def END(caller):
  22. text = "We're done talking."
  23. options ()
  24. return text, options
  25.  
  26. def BADEND(caller):
  27. text = "If someone asks if you're a god... you say YES!!!"
  28. options ()
  29. return text, options
  30.  
  31. def move_player(self):
  32. def func(self):
  33. self.caller.msg("You have angered the Scorpion God, he banishes you.")
  34. send_to = self.obj.send_volcano
  35. results = search_object(send_to)
  36. self.caller.move_to(results[0], quiet=True)
  37.  
  38. class CmdTalk(default_cmds.MuxCommand):
  39. key = "talk scorpion god"
  40. alias = ["Talk Scorpion God", "talk Scorpion God", "Talk scorpion god"]
  41. locks = "cmd:all()"
  42. def func(self):
  43. EvMenu(self.caller, "typeclasses.talking_scorpion_god",
  44. startnode="menu_start_node")
  45.  
  46. class ScorpionGodCmdSet(CmdSet):
  47. key = "scorpiongodcmdset"
  48. def at_cmdset_creation(self):
  49. self.add(CmdTalk())
  50.  
  51. class scorpiongodNPC(DefaultObject):
  52. def at_object_creation(self):
  53. self.db.desc = "This guy is a real chatterbox."
  54. self.cmdset.add_default(ScorpionGodCmdSet, permanent=True)
  55. self.locks.add("get:false()")
  56. self.locks.add("view:not tag(defeat, scorpiongod)")
  57. self.db.send_volcano = "#661"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement