Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- game_over = false
- def dragon_method
- puts " Danaerys took off with the dragons you want a direct attack or surprise attack?"
- puts " 1: Surprise Attack"
- puts " Any key: Direct Attack"
- attack_choice = gets.chomp.to_i
- if attack_choice == 1
- puts "No coward can rule the Iron Throne"
- game_over = true
- puts "GAME OVER!"
- else
- puts "Good Choice!"
- puts "The lord commander will help you defeat them all!"
- puts "Oops, he betrayed you and took your place!"
- puts "You have been decapitaded for treason."
- game_over = true
- puts "GAME OVER!"
- end
- end
- def horse_method
- puts "Great!"
- puts "You leading now an army and a horse for battle"
- puts " 1: To get more allies!"
- puts " Any key: To march for battle now!"
- horse_attack = gets.chomp.to_i
- if horse_attack == 1
- puts "Congrats you'll join forces with Danaerys and conquered the iron throne"
- puts "LONG LIVE THE KING!"
- else
- puts "This army will not be enough"
- puts "You have been decapitaded for treason."
- game_over = true
- puts "GAME OVER!"
- end
- end
- def play_game
- puts "Welcome to the Game of Thrones"
- puts'<>=======() '
- puts'(/\___ /|\\ ()==========<>_'
- puts' \_/ | \\ //|\ ______/ \)'
- puts' \_| \\ // | \_/'
- puts' \|\/|\_ // /\/'
- puts' (oo)\ \_// /'
- puts' //_/\_\/ / |'
- puts' @@/ |=\ \ |'
- puts' \_=\_ \ |'
- puts' \==\ \|\_ '
- print ">> "
- characters = ["Mother of Dragons", "Lord Commander"]
- puts "Choose Your Character to conquer the Iron Throne!"
- puts " 1: The mother of dragons"
- puts " Any key: The lord commander"
- print ">> "
- character = gets.chomp.to_i - 1
- puts "OK #{characters[character]}, perfect lets begin!"
- puts "Would you like to ride a Horse or a Dragon to get there?"
- print ">> "
- input = gets.chomp
- case input.downcase
- when "dragon"
- dragon_method
- when "horse"
- horse_method
- else
- puts "Please choose a valid option"
- end
- end
- # Call the game
- loop do
- play_game
- p "<>"*20
- p "Game Over!"
- game_over = true
- puts "Do you want to play again?"
- puts "1.- yes | 2.- no"
- response = gets.chomp
- if response == "1"
- game_over = false
- end
- puts `clear`
- break if ( game_over == true )
- end
Add Comment
Please, Sign In to add comment