2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
# File 'lib/modules.rb', line 2
def rest
puts "It will be 15 gold to rest here. will you rest? (yes or no)"
puts "You have #{$player.gold}"
puts ''
response = gets.chomp.downcase
puts''
if response == 'yes' && $player.gold >= 15
$player.gold -= 15
sleep
elsif response == 'yes' && $player.gold < 15
puts 'You set your coin purse on the counter but the distinct lack of coins rustling'
puts 'makes your ears grow red with embarassment. You look at the innkeeper who is'
puts 'looking back at you with an impatient glare. If only you were better at'
puts 'managing your money.'
elsif response == 'no'
puts 'Have a good day.'
else
puts "'I don't know what you are trying to say'"
end
end
|