Guest User

Untitled

a guest
May 25th, 2018
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.37 KB | None | 0 0
  1. puts "Want to play?"
  2. puts"Press any key to continue"
  3. try_again = gets.chomp
  4. while try_again != 'n'
  5. # angerCounter = 0
  6. loop do
  7. # angerCounter += 3
  8. puts "You wake up in a dimmly lit room"
  9. sleep 1
  10. puts "You must select from options provided by questions asked in key momements"
  11. sleep 1
  12. puts "Do you understand?"
  13. sleep 1
  14. puts "Y for yes, N for no"
  15. sleep 1
  16.  
  17. user_input = gets
  18. break if user_input.include? "y"
  19.  
  20. # loop do
  21. # # case angerCounter
  22. # # when 1
  23. # # puts "I would be happy to repeat that"
  24. # # when 2
  25. # # puts "Having some difficulties?"
  26. # # when 3
  27. # # puts "Sigh..."
  28. # end
  29. end
  30. puts "Glad you understand."
  31. sleep 2
  32. puts "What is your name?"
  33. player_name = gets
  34. puts "Greetings #{player_name}"
  35. puts "There is a wrench on the floor\n"
  36. puts "Press 1 if you would like to pick it up.\n"
  37.  
  38. user_input2 = gets
  39. if user_input2.include? "1"
  40. weapon = "wrench"
  41. puts "You have chosen the wrench"
  42. else
  43. puts "You didn't choose anything so you will struggle"
  44. end
  45.  
  46. puts "You leave the room and encounter an masked figure carrying a weapon"
  47. sleep 2
  48. puts "1: Attack 2: Avoid Confrontation "
  49. sleep 2
  50.  
  51.  
  52. # class Character
  53. # attr_reader :health
  54. # def initialize(name = "blank", weapon)
  55. # @name = name
  56. # @weapon = weapon
  57. # @health = 20
  58. # end
  59. # #Need a subclass for any grunts
  60. # #Add a block for battle and damage calculation
  61. # end
  62.  
  63. # class Enemy < Charater
  64. #
  65. # end
  66.  
  67. # player = Character.new(player_name,weapon)
  68. # puts player
  69.  
  70. user_input3 = gets
  71. #Have the enemy play a game with player. Have player guess number between 1 and 3.
  72. #If the player loses twice then allow them to attack with weapon. Gonna need a loop homeslice
  73. if user_input3.include? "1"
  74. "You decide to attack the enemy with your wrench"
  75. elsif user_input3.include? "2"
  76. puts "You turn around and briskly walk down the hall.You are stabbed in the back by the masked figure. Game over."
  77. sleep 3
  78. puts "Would you like to play again? y or n"
  79. try_again = gets.chomp
  80. else
  81. puts "You're dead. Game over"
  82. sleep 3
  83. puts "Would you like to play again? y or n"
  84. try_again = gets.chomp
  85. end
  86.  
  87. puts "The masked man falls to the floor"
  88. puts "You have defeated your foe"
  89. puts "You sprint out of where you've been held captive and are now free"
  90. puts "You win"
  91. puts "Would you like to play again? y or n"
  92. try_again = gets.chomp
  93.  
  94. end
Add Comment
Please, Sign In to add comment