repl.it
Ruby

No description

fork
loading
Files
  • main.rb
main.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
hp = 100
coins = 0
potion1 = 0
potion2 = 0
sword = 0
shield = 0
armor = 0

puts "Welcome to my text RPG!"
sleep(1)
puts "Would you like to?"
sleep (1)
puts "1. Play"
sleep (1)
puts "2. Credits"
sleep (1)
puts "3. Quit"
input=gets.chomp
if input == '3'
Quit
end
if input == '2'
puts "Coding Kai#2
Story Idea Kai#2
Text Kai#2"
sleep (3)
end
if input == '1'
end
puts "What's your name"
name = gets.chomp
puts "Hi " + name + "."
sleep (1)
puts "" + name + " your adventure begins in a quaint village called Alikar"
sleep(3)
puts "You wake up and the birds are chirping"
sleep(2)
puts "Would you like to?"
sleep(1)
puts "1. Open inventory"
sleep(1)
puts "2. Check your health"
sleep(1)
puts "3. Go downstairs"
sleep(1)
puts "4. Quit"
input = gets.chomp
if input == '1'
puts "You have #{coins} coins #{potion1} health potions #{potion2} luck potions #{sword} swords and #{shield} shields"
sleep(5)
end
if input == '2'
puts "You have #{hp} out of 100 health remaining and #{armor} out of 100 armor."
sleep(3)
end
if input == '3'
end
if input == '4'
Quit
end

sleep (2)
puts "You walk down the stairs and get greeted by your mom"
sleep (2)
puts "Mom: Hi honey how did you sleep"
sleep (2)
puts "1. Good"
sleep (1)
puts "2. Bad"
sleep (1)
puts "3. Walk Away" 
input = gets.chomp
if input == '1'
puts "Mom: That's nice have a good day honey."
end
if input == '2'
puts "Mom: That's not good well try and have a good day."
end
if input == '3'
puts "Mom: HOW DARE YOU WALK AWAY FROM ME!"
sleep(2)
puts "Your mom slapped you."
sleep(2)
puts "Game Over"
sleep(1)
Game Over
end

puts "Would you like to?"
sleep(1)
puts "1. Open inventory"
sleep(1)
puts "2. Check your health"
sleep(1)
puts "3. Go outside"
sleep(1)
puts "4. Quit"
input = gets.chomp
if input == '1'
puts "You have #{coins} coins #{potion1} health potions #{potion2} luck potions #{sword} swords and #{shield} shields"
sleep(5)
end
if input == '2'
puts "You have #{hp} out of 100 health remaining and #{armor} out of 100 armor."
sleep(3)
end
if input == '3'
end
if input == '4'
Quit
end

puts "You walk outside"
sleep (1)
puts "Would you like to?"
sleep(1)
puts "1. Open inventory"
sleep(1)
puts "2. Check your health"
sleep(1)
puts "3. Go into the town"
sleep(1)
puts "4. Quit"
input = gets.chomp
if input == '1'
puts "You have #{coins} coins #{potion1} health potions #{potion2} luck potions #{sword} swords and #{shield} shields"
sleep(5)
end
if input == '2'
puts "You have #{hp} out of 100 health remaining and #{armor} out of 100 armor."
sleep(3)
end
if input == '3'
end
if input == '4'
Quit
end

ruby 2.5.5p157 (2019-03-15 revision 67260) [x86_64-linux]
?