woah...wierd
ok a couple of issues
- I find it difficult to use goto's, they are the bastard spawn of the devil and the original basic language
- your use of types is.... most odd - see what I did below
- you reference "stat(class).acc" but you never give a value to the variable 'class', so it defaults to 0, hence tohit = rnd(5)+1+0*0 - may be why opptohit was always > tohit (the same thing happened with the plyrdmg variable) - you DID assign an input value to classc, so I am assuming that is wht you meant to use
that's about it for your code, but when you work out your tohit numbers, you are ensuring that the thief will always have a lower number than the other two classes, the tohit ranges you have specified are:
Ranger - 49>54
Swordsman - 49>54
Thief - 19>24
so that needs a little balancing
this is not exactly the way I would have written it, but I have had a bash at modifying your code as below
RANDOMIZE TIMER()
health = 100
opphealth = 100
type class
str as integer
dex as integer
acc as integer
endtype
dim classes(3) as class
#constant RANGER = 1
#constant SWORDSMAN = 2
#constant THIEF = 3
classes(RANGER).str = 4
classes(RANGER).dex = 7
classes(RANGER).acc = 12
classes(SWORDSMAN).str = 12
classes(SWORDSMAN).dex = 6
classes(SWORDSMAN).acc = 4
classes(THIEF).str = 3
classes(THIEF).dex = 12
classes(THIEF).acc = 6
do
print ""
print "What class do you want?"
print "1.) Ranger"
print "2.) Swordsman"
print "3.) Thief"
input "", playerclass
print "Who would you like to battle?"
print "1.) Ranger"
print "2.) Swordsman"
print "3.) Thief"
input "", oppclass
cls
gosub battle
loop
Battle:
repeat
tohit = rnd(5)+ 1 + (classes(playerclass).acc) * (classes(playerclass).str)
oppTohit = rnd(5) + 1 + (classes(oppclass).acc) * (classes(oppclass).str)
plyrdmg = (classes(playerclass).str)
oppdmg = (classes(oppclass).str)
if tohit > oppTohit then dec opphealth,plyrdmg
if tohit < oppTohit then dec health,oppdmg
cls
print health
print opphealth
wait 200
until (health < 1) or (opphealth < 1)
return
give it a bash and see if you can figure out what I have done
This is not the Sig you are looking for....