Still having problems with this code. Had it working then made some changes and now it prints 0 no matter how I re-arrange it. Any help would be appreciated!!!
// Practice Text RPG
//SETUP THE CHARACTER TYPE
type characterT
name as string
race as string
class as string
condition as string
strength as integer
intelligence as integer
dexterity as integer
constitution as integer
luck as integer
armor_class as integer
hitpoints as integer
spell_points as integer
experience_points as integer
gold as integer
level as integer
spell as integer
items as integer
endtype
plrChar as characterT
//Set up a chracter array that holds every variable from the UDT to define one character.
//Create up to 25 characters
//global dim plrChar(25) as characterT
// CALL THE FUNCTIONS
setUpScreen()
startGameScreen()
wait key
end
//************************************************FUNCTIONS***********************************************************
function setUpScreen()
//DISPLAY SETUP
set display mode 800,600,32
ink rgb(0,255,0),0
set text font "courier new"
set text size 25
endfunction
//************************************************************************************************************************
function startGameScreen()
//START GAME SCREEN SETUP
set text size 20
ink rgb(255,0,0),0
text 181,40,"**************************************"
text 181,50,"*"
text 181,60,"*"
text 181,70,"*"
text 551,50,"*"
text 551,60,"*"
text 551,70,"*"
text 181,80,"**************************************"
set text size 35
ink rgb(0,255,0),0
text 210,50,"Practice Text RPG"
set text size 25
text 255,250,"1.) Start Game"
text 255,280,"2.) Leave Game"
text 315,315,"Choice:"
set cursor 410,315
//SETUP FOR STARTING AND LEAVING GAME
input choice
if choice = 1
cls
mainGameScreen()
adventurersGuildMenu()
else
quit()
ENDIF
endfunction
//**********************************************************************************************************************************
function mainGameScreen()
ink rgb(255,0,0)
line 0,397,410,397
line 0,400,410,400
line 410,0,410,596
line 414,0,414,600
line 0,599,413,599
line 0,596,410,596
set text size 20
ink rgb(0,255,0)
//PARTY SECTION SETUP
text 25,400,"Name"
text 120,400,"Race"
text 200,400,"Class"
text 280,400,"Cond"
text 340,400,"HP"
text 380,400,"SP"
text 0,426,"Test"
text 0,456,"Test"
text 0,486,"Test"
text 0,516,"Test"
text 0,546,"Test"
text 0,576,"Test"
text 95,426,"half-elf"
text 185,426,"Magician"
text 275,426,"alive"
text 335,426,"550"
text 375,426,"550"
ink rgb(255,0,0)
line 90,400,90,596
line 0,420,410,420
line 180,400,180,596
line 270,400,270,596
line 330,400,330,596
line 370,400,370,596
ENDFUNCTION
//*****************************************************************************************************************************************
function adventurersGuildMenu()
ink rgb(0,255,0)
text 420,10,"Brave warrior thou art in the guild of"
text 420,30,"adventurers. What do you wish to do?"
text 420,60,"Create up to 25 characters then create"
text 420,80,"a 6 character party"
text 480,150,"1.) Create A Character"
text 480,170,"2.) Create A Party"
text 480,190,"3.) Save Game"
text 480,210,"4.) Leave Game"
text 480,230,"5.) Enter City"
text 515,300,"Choice: "
set cursor 585,300
input choice:
if choice = 1
cls
mainGameScreen()
createCharacter()
ENDIF
endfunction
//****************************************************************************************************************************************
function createCharacter()
//SETUP THE CREATE CHARACTER SCREEN
randomize timer()
ink rgb(0,255,0),0
text 420,10,"Use the options below to create up to"
text 420,30,"20 characters"
ink rgb(255,0,0),0
line 414,50,800,50
ink rgb(0,255,0),0
set cursor 470,60
//RACES AND CLASSES
text 475,375,"Races"
ink rgb(255,0,0),0
line 415,395,800,395
ink rgb(0,255,0),0
text 475,395,"1) Human"
text 475,415,"2) Elf"
text 475,435,"3) Dwarf"
text 475,455,"4) Hobbit"
text 475,475,"5) Half-Elf"
text 475,495,"6) Gnome"
text 650,375,"Classes"
text 650,395,"1) Warrior"
text 650,415,"2) Paladin"
text 650,435,"3) Rogue"
text 650,455,"4) Bard"
text 650,475,"5) Hunter"
text 650,495,"6) Monk"
text 650,515,"7) Conjurer"
text 650,535,"8) Magician"
text 650,555,"9) Sorcerer"
text 650,575,"10)Wizard"
text 500,555,"Choice:"
//CHARACTER SETUP
//NAME
set cursor 420,60
input "Name:",plrChar.name
//Race setup
text 420,80,"Race:"
set cursor 568,555
input choice
if choice = 1
set cursor 470,80
plrChar.race = "Human"
print plrChar.race
ENDIF
if choice = 2
set cursor 470,80
plrChar.race = "Elf"
print plrChar.race
ENDIF
if choice = 3
set cursor 470,80
plrChar.race = "Dwarf"
print plrChar.race
ENDIF
if choice = 4
set cursor 470,80
plrChar.race = "Hobbit"
print plrChar.race
ENDIF
if choice = 5
set cursor 470,80
plrChar.race = "Half-Elf"
print plrChar.race
ENDIF
if choice = 6
set cursor 470,80
plrChar.race = "Gnome"
print plrChar.race
ENDIF
//CLASS SETUP
text 420,100,"Class:"
set cursor 568,555
ink rgb (0,0,0),
box 565,550,590,590
ink rgb(0,255,0),0
input choice
if choice = 1
set cursor 480,100
plrChar.race = "Warrior"
print plrChar.race
ENDIF
if choice = 2
set cursor 480,100
plrChar.race = "Paladin"
print plrChar.race
ENDIF
if choice = 3
set cursor 480,100
plrChar.race = "Rogue"
print plrChar.race
ENDIF
if choice = 4
set cursor 480,100
plrChar.race = "Bard"
print plrChar.race
ENDIF
if choice = 5
set cursor 480,100
plrChar.race = "Hunter"
print plrChar.race
ENDIF
if choice = 6
set cursor 480,100
plrChar.race = "Monk"
print plrChar.race
ENDIF
if choice = 7
set cursor 480,100
plrChar.race = "Conjuror"
print plrChar.race
ENDIF
if choice = 8
set cursor 480,100
plrChar.race = "Magician"
print plrChar.race
ENDIF
if choice = 9
set cursor 480,100
plrChar.race = "Sorcerer"
print plrChar.race
ENDIF
if choice = 10
set cursor 480,100
plrChar.race = "Wizard"
print plrChar.race
ENDIF
//Roll for attributes
roll:
//STRENGTH
plrChar.strength = rnd(25) + 1
set cursor 420,120
print "Strength(ST):",plrChar.strength
//INTELLIGENCE
plrChar.intelligence = rnd(25)+1
set cursor 420,140
print "Intelligence(IQ):",plrChar.intelligence
//DEXTERITY
plrChar.dexterity = rnd(25)+1
set cursor 420,160
print "Dexterity(DX):",plrChar.dexterity
//CONSTITUTION
plrChar.constitution = rnd(25)+1
set cursor 420,180
print "Constitution(CN):",plrChar.constitution
//LUCK
plrChar.luck = rnd(25)+1
set cursor 420,200
print "Luck(CN):",plrChar.luck
//HITPOINTS
plrChar.hitpoints = rnd(30)+1
set cursor 420,220
print "hitpoints(CN):",plrChar.hitpoints
//RE-POLL FOR ATTRIBUTES
set cursor 420,250
input "Re-roll?:y/n ", a$
if a$ = "y"
ink rgb(0,0,0)
box 420,115,800,275
ink rgb(0,255,0),0
gosub roll:
ENDIF
//Save character
if a$ = "n"
ink rgb(0,0,0)
box 420,240,800,275
ink rgb(0,255,0)
set cursor 420,240
plrChar.armor_class = 10
print "Armor Class(AC):", plrChar.armor_class
set cursor 420,260
//THE CODE IN QUESTION
if plrChar.class = "Wizard" or plrChar.class = "Conjurer" or plrChar.class = "Magician" or plrChar.class = "Sorcerer"
plrChar.spell_points = 10
print "Spell Points(SP):",plrChar.spell_points
else
plrChar.spell_points = 0
print "Spell Points(SP):",plrChar.spell_points
endif
endif
endfunction
//****************************************************************************************************************************************
function quit()
cls
set text size 35
text 200,20,"Practice Text RRPG"
text 200,200,"Thanks for playing.........."
sleep 2000
end
ENDFUNCTION