interaction.py 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. import time
  2. import print_slow
  3. def processIn(prompt, orderedOptions):
  4. while True:
  5. tmp = str(input(prompt))
  6. for i in range(len(orderedOptions)):
  7. if tmp.lower() == orderedOptions[i].lower():
  8. return i
  9. def response(options, responseType):
  10. if options == ["comfort", "ignore", "demean"]:
  11. if responseType == 0:
  12. print_slow.print_slow("You look fine. You look beautiful Emma. Don't listen to your self hatred.")
  13. print_slow.print_slow("Remember what Alice said? You just have to believe in yourself. You can do it.")
  14. if responseType == 1:
  15. print_slow.print_slow("Look away, look away, look away. Ok. Deep breaths.")
  16. if responseType == 2:
  17. print_slow.print_slow("Wow, you're so pathetic Emma. I can't even look in a god damn mirror anymore?")
  18. print_slow.print_slow("Come on, look up! Look at your ugly face, everyone else has to see it.")
  19. if options == ["play it cool", "be honest"]:
  20. if responseType == 0:
  21. print_slow.print_slow("Mm, politics are weird eh? What do you think about it?")
  22. print_slow.print_slow("This isn't just weird. They're lining the streets with cops for a reason.")
  23. if responseType == 1:
  24. print_slow.print_slow("No I didn't, tell me about it.")
  25. print_slow.print_slow("You really have to keep up with what's happening Emma, it's ridiculous.")
  26. print_slow.print_slow("They're lining the streets with cops, you're not allowed to be in a group of more than five people outside now.")
  27. print_slow.print_slow("I really hope someone does something about it.")
  28. print_slow.print_slow("Anyway, I have to go now, you can always text me!")
  29. if options == ["go up to child", "ignore"]:
  30. if responseType == 0:
  31. print_slow.print_slow("You to child: Hi, are you ok?")
  32. print_slow.print_slow("Child: Yeah, I'm just really upset.")
  33. print_slow.print_slow("Yeah... Well I hope you feel better soon but I really need to go now, bye!")
  34. time.sleep(1)
  35. print_slow.print_slow("Wow, I lied to that kid.")
  36. responseType = 1
  37. if responseType == 1:
  38. print_slow.print_slow("I wish I could help them... Why do I have to be so anxious?")
  39. return 0
  40. def dialogue(position):
  41. if position == "start":
  42. orderedOptions = ["look"] #Options ordered from friendly to
  43. #unfriendly.
  44. processIn("Type \"look\" to look around: ", orderedOptions)
  45. print_slow.print_slow("Ok... A mirror. Wait no, don't look at that!")
  46. orderedOptions = ["comfort", "ignore", "demean"]
  47. tmp = processIn("Options: Comfort, Ignore, or Demean: ", orderedOptions)
  48. response(orderedOptions, tmp)
  49. elif position == "legislation":
  50. orderedOptions = ["play it cool", "be honest"]
  51. tmp = processIn("Options: Be honest or play it cool: ", orderedOptions)
  52. response(orderedOptions, tmp)
  53. elif position == "child":
  54. orderedOptions = ["go up to child", "ignore"]
  55. tmp = processIn("Options: Go up to child, or ignore: ", orderedOptions)
  56. response(orderedOptions, tmp)
  57. return 0