Ok, so my problem is with this code. I want the if statements with the
variable race to set other variables. Which works as far as I can tell.
But after the if statements the program ends. I want it to continue but
I am stumped about how to go about it. Any help would be appreciated,
thanks.
Also, I need to finish the whole game by the 8th or the 9th of December.
race = “”
health = 0
magic = 0
fatigue = 0
def paws
sleep(0.05)
end
def pause
sleep(0.10)
end
print “W”
pause
print “e”
pause
print “l”
pause
print “c”
pause
print “o”
pause
print “m”
pause
print “e”
pause
print " "
print “T”
pause
print “o”
pause
print " "
pause
print “M”
pause
print “y”
pause
print " "
pause
print “R”
pause
print “P”
pause
print “G”
pause
print “!”
input_needed = gets.chomp
print “W”
paws
print “h”
paws
print “a”
paws
print “t”
paws
print " "
paws
print “r”
paws
print “a”
paws
print “c”
paws
print “e”
paws
print " "
paws
print “a”
paws
print “r”
paws
print “e”
paws
print " "
paws
print “y”
paws
print “o”
paws
print “u”
paws
print “?”
input_needed = gets.chomp
puts “Aelv - 80 HP - 25 MP - 80 - FP”
puts “Elf - 50 HP - 75 MP - 60 FP”
race = gets.chomp
if @race =~ /aelv/ or /Aelv/
health + 70
magic + 25
fatigue + 100
elsif @race =~ /Elf/ or /elf/
health + 50
magic + 75
fatigue + 80
puts “What is your combat specialization?”
sleep(2)
puts “Melee”
puts “Magic”
combat = gets.chomp
if combat $=~/^magic/ or $=~/^Magic/
magic + 25
fatigue + 20
if combat $=~/^Melee/ or $=~/^melee/
health + 15
fatigue + 10
puts “An #{user_race.capitalize} that specializes in #{combat} combat?”
sleep(2)
puts “With stats like those, you won’t have any trouble breaking out of
your cell, ehh…”
sleep(3)
puts “What’s your name again?”
sleep(1)
name = gets.chomp
puts “Well, #{name.capitalize}, your journey begins here.”
sleep(5)
puts “OH! I almost forgot! Your skills. Seeing as you specialize in
#{combat}, maybe you should chose skills”
puts “fall under that category.”
sleep(1)
if combat $=~/^melee/ or $=~/^Melee/
puts “First, you’re weapon skill.”
sleep(1)
puts “Blades”
puts “Axes”
puts “Maces”
weapon_skill = gets.chomp
end
blades = 10
axes = 10
maces = 10
if weapon_skill $=~/^Blades/ or $=~/^blades/
blades + 15
if weapon_skill $=~/^Axes/ or $=~/^axes/
axes + 15
if weapon_skill $=~/^Maces/ or $=~/^maces/
maces + 15
puts “#{weapon_skill}, huh? I figured you a mace user.”
sleep(2)
if combat $=~/^magic/ or $=~/^Magic/
puts “Seeing as you specialize in magic, chose what category.”
sleep (2)
puts “Destruction”
puts “Illusion (used to charm others and perform invisibility spells)”
puts “Alteration (used to frenzy enemies or knock them out)”
magic_skill = gets.chomp
if magic_skill $=~/^destruction/ or $=~/^Destruction/
destruiction + 15
if magic_skill $=~/^illusion/ or $=~/^Illusion/
illusion + 15
if magic_skill $=~/^alteration/ or $=~/^Alteration/
alteration + 15
end
end
end
destruction = 10
illusion = 10
alteration = 10
puts “And now your journey begins. You shall no longer need my, the
anonymous voice inside your code.”
sleep(2)
puts “Good luck! And remember! Your decisions will play a huge part in
the upcoming war.”
end
end
end
end
end
end
end
$end
$end