Created
February 28, 2017 15:14
-
-
Save aguayma/ce53149a3c85c056d3cafa48b923007c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def game_intro | |
puts "The Dark Knight Returns" | |
end | |
def bats | |
puts " ๐ฆ " * 20 | |
end | |
def new_line | |
puts "" | |
end | |
def choose_sidekick | |
puts "Who will be your sidekick?" | |
new_line | |
puts "Options: Batgirl or Robin" | |
ally = gets.chomp.downcase | |
new_line | |
return ally | |
end | |
def say(name, statement) | |
if name.nil? | |
puts statement | |
else | |
puts "#{name.capitalize}: #{statement}" | |
end | |
end | |
def ally_catch_phrase(ally) | |
if ally == "batgirl" | |
say("batgirl", "I''ll follow your lead!") | |
elsif ally == "robin" | |
say("robin", "Gotham needs us!") | |
else | |
say(nil, "Since you can't decide will give you Robin!") | |
ally = "robin" | |
end | |
end | |
def weapon_select | |
puts "Choose a weapon for your sidekick!" | |
new_line | |
puts "Options: mine detonator, smoke pellets, disruptor" | |
weapon = gets.chomp.downcase | |
# choose weapon | |
valid_weapons = ["mine detonator", "smoke pellets", "disruptor"] | |
until valid_weapons.include?(weapon) | |
puts "Options: mine detonator, smoke pellets, disruptor" | |
weapon = gets.chomp.downcase | |
end | |
return weapon | |
end | |
def weapon_statement(ally, weapon) | |
case weapon | |
when "mine detonator" | |
say "#{ally}: These will come in handy!", "๐ฃ ๐ฃ ๐ฃ" | |
when "smoke pellets" | |
say "#{ally}: They can't beat us if they can't see us!", "๐ฅ ๐" | |
when "disruptor" | |
say "#{ally}: Perfect! We can lock up their firearms!", "๐ ๐ ๐" | |
end | |
end | |
def enemy_select | |
puts "Who should we fight first?" | |
new_line | |
puts "Options: Two Face, Poison Ivy, or Harley Quinn" | |
enemy = gets.chomp.downcase | |
new_line | |
return enemy | |
end | |
def shout(name, catchphrase) | |
if name.nil? | |
puts catchphrase | |
else | |
puts "#{name.capitalize}: #{catchphrase}" | |
end | |
end | |
def enemy_quote(enemy) | |
if enemy == "two face" | |
shout("two face", "Right on time for your own funeral โฐ๏ธ") | |
elsif enemy == "poison ivy" | |
shout("poison ivy", "Let me warm you up with a kiss ๐") | |
elsif enemy == "harley quinn" | |
shout("harley quinn", "You think I'm just a doll, but you're very wrongโ๐โ๏ธ") | |
else | |
say(nil, "Since you can't decide will give you Harley Quinn!") | |
enemy = "harley quinn" | |
shout("harley quinn", "Can we put this on camera for Mr. Jโ๏ธ ๐น") | |
end | |
end | |
def end_game | |
puts " ๐ ๐ฎ Stop playing for now and go read a book! โก๏ธ ๐" | |
end | |
game_intro | |
new_line | |
bats | |
new_line | |
ally = choose_sidekick | |
ally_catch_phrase(ally) | |
new_line | |
bats | |
weapon = weapon_select | |
weapon_statement(ally, weapon) | |
new_line | |
bats | |
new_line | |
enemy = enemy_select | |
enemy_quote(enemy) | |
bats | |
new_line | |
end_game |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment