This is the code:
Rem Project: Final Dragon
Rem Created: Sunday, July 11, 2010
Rem ***** Main Source File *****
` Make random number picking more random
randomize timer()
input "NEW GAME or LOAD GAME >",startmenu$
gameoptions$=upper$(startmenu$)
if gameoptions$="LOAD GAME"
input "LOAD GAME: Choose file to load (1, 2, or 3) >",loadgame
if loadgame=1
open to read 1, "save1.dat"
read string 1,name$
read string 1,race$
read string 1,ArcheryWeapon$
read string 1,MeleeWeapon$
read string 1,Armor$
read long 1,currenthealth
read long 1,maxhealth
read long 1,defense
read long 1,archery
read long 1,melee
read long 1,normalpotion
read long 1,halfhealpotion
read long 1,fullhealpotion
read long 1,savearea
read long 1,aliceHP
read long 1,alicemax
read long 1,alicedefense
read long 1,alicearchery
read long 1,alicemelee
read string 1,alicearmor$
read string 1,alicemeleeweapon$
read string 1,alicearcheryweapon$
close file 1
gosub Endofgame
input "Hello there, what is your name? ";name$
print "Hello there, "+name$+". I am here to guide you throughout your quest"
print "If the text will not continue, or you are prompted to do so, press any key"
wait key
print "Well done, "+name$+""
wait key
print "Now, to choose a race. Elves are excellent archers, while Drakkens, or"
print "Half-Dragons, are great fighters and usually hold their own in a battle."
print "One of each will join your party later in the game."
do
input "Pick your race ( ELF or DRAKKEN )-> ";race$
` Change user input to higher case letters (using another string)
a$=upper$(race$)
` Define Elf Stats
if a$="ELF"
ArcheryWeapon$="Basic Bow"
MeleeWeapon$="None"
Armor$="Clothes"
currenthealth=1
maxhealth=20
defense=5
archery=10
melee=0
` Leave the DO/LOOP
exit
endif
` Define Drakken Stats
if a$="DRAKKEN"
ArcheryWeapon$="Basic Throwing Knives"
MeleeWeapon$="Basic Sword"
Armor$="Light Leather Armor"
currenthealth=1
maxhealth=50
defense=10
archery=5
melee=5
` Leave the DO/LOOP
exit
endif
` If the user didn't type ELF or DRAKKEN show this (because if they did it would of left the DO/LOOP by now)
print "I am sorry, I did not understand that. Try again."
loop
cls
print "Good choice. My name is Alice and I am Elven. Jason, whom you shall meet"
print "later is Drakken. Welcome to the Tutorial, "+name$+" the "+race$+""
wait key
cls
print "Alice: Dear lord, it looks like you were hurt. Quick, drink this Potion of Full Heal."
` Increase the number of full health potions
inc fullhealpotion
do
input "To drink a potion, type DRINK FULLHEAL > ";actiontutorialcell1$
` Change user input to higher case letters (using another string)
a$=upper$(actiontutorialcell1$)
` Check for DRINK FULLHEAL
if a$="DRINK FULLHEAL"
` Heal player
currenthealth=maxhealth
` Decrease the number of full health potions
dec fullhealpotion
` Leave the DO/LOOP
exit
endif
` Show that the user didn't type it right
print "Try Again"
loop
do
input "Now, type CHECK to check stats > ";actiontutorialcell2$
` Change user input to higher case letters (using another string)
a$=upper$(actiontutorialcell2$)
` Check on CHECK
if a$="CHECK"
cls
print "Melee Weapon: "+MeleeWeapon$
print "Archery Weapon: "+ArcheryWeapon$
print "Armor: "+Armor$
print "HP: "+str$(currenthealth)
print "Max HP: "+str$(maxhealth)
print "Defense: "+str$(defense)
print "Archery Strength: "+str$(archery)
print "Melee Strength: "+str$(melee)
print "Heal Items"
print "Potions: "+str$(normalpotion)
print "Half-Heal Potions: "+str$(halfhealpotion)
print "Full-Heal Potions: "+str$(fullhealpotion)
` Leave the DO/LOOP
exit
endif
` Show that they messed up
print "I did not understand. Try again"
loop
wait key
cls
print "Alice: Now for the final part. I will join your party and help you kill something."
print "I shall guide you through it."
wait key
print "Alice joined the party! You may now check her stats using check outside of"
print "the tutorial"
aliceHP=20
alicemax=20
alicedefense=5
alicearchery=10
alicemelee=5
alicemeleeweapon$="None"
alicearcheryweapon$="Basic Bow"
alicearmor$="Clothes"
do
input "Alice: Type 'look' to look for monsters. > ";action$
` Change user input to higher case letters (using another string)
a$=upper$(action$)
` Check for LOOK and leave the DO/LOOP
if a$="LOOK" then exit
` User messed up again
print "Try that command again"
loop
cls
print "You see a hostile goblin in the area in front of you. Type 'forward' then 'attack goblin'"
print "to attack the goblin. Then, you can use Battle Commands to fight."
do
input "> ",action$
` Change user input to higher case letters (using another string)
a$=upper$(action$)
` Check for FORWARD and leave the DO/LOOP
if a$="FORWARD" then exit
` Show that the user messed up
print "Type FORWARD to get closer to the enemy!"
loop
cls
print "Alice: Now! Attack the goblin!"
do
input "> ",action$
` Change user input to higher case letters (using another string)
a$=upper$(action$)
` Check for ATTACK GOBLIN
if a$="ATTACK GOBLIN"
` Leave the DO/LOOP
exit
endif
cls
print "Alice: No! Type 'attack goblin' now!"
loop
cls
Enemy1Health=25
EnemyStrength=1
print "Alice: Use the on-screen commands to fight!"
` Set starting characters turn (0=Player 1=Alice 2=Enemy)
Turn=0 ` Added this if you want to change it to a 1 or 2 later
do
` Check if it's the Players or Alices turn
if Turn=0 or Turn=1
` Set starting fight style (0=none)
FightStyle=0
` Repeat this...
repeat
` Show whos attacking
print "Current Attacker: ";
if Turn=0 then print "You" else print "Alice"
print "Your HP: "+str$(currenthealth)
print "Alice HP: "+str$(aliceHP)
print "You are fighting a goblin"
input "Battle Command (ATTACK or ARCHERY)-> ";battlecommands$
` Change user input to higher case letters (using another string)
a$=upper$(battlecommands$)
` Check for ATTACK
if a$="ATTACK" then FightStyle=1
` Check for ARCHERY
if a$="ARCHERY" then FightStyle=2
` Yell at the user for not picking ATTACK or ARCHERY
if FightStyle=0 then print "Hey, stop picking your nose and choose ATTACK or ARCHERY!"
` ... until FightStyle is more than zero
until FightStyle>0
endif
` Players turn
if Turn=0
` Check if the current fighting style is ATTACK
if FightStyle=1
` Check if they actually have a melee weapon
if melee>0
` Attack with melee
yourdamage=rnd(melee)
print "You slash at your opponent and deal "+str$(yourdamage)+" damage!"
` Decrease enemy health by yourdamage
dec Enemy1Health,yourdamage
else
` No melee weapon
print "You cannot do that!"
endif
` FightStyle=2 ARCHERY
else
` Check if they actually have an archery weapon
if archery>0
` Attack with archery
yourdamage=rnd(archery)
print "You shoot at your opponent and deal "+str$(yourdamage)+" damage!"
` Decrease enemy health by yourdamage
dec Enemy1Health,yourdamage
else
` No archery weapon
print "You cannot do that!"
endif
endif
endif
` Alices Turn
if Turn=1
` Check if the current fighting style is ATTACK
if FightStyle=1
` Check if they actually have a melee weapon
if alicemelee>0
` Attack with melee
alicedamage=rnd(alicemelee)
print "Alice slashs at your opponent and deals "+str$(alicedamage)+" damage!"
` Decrease enemy health by yourdamage
dec Enemy1Health,alicedamage
else
` No melee weapon
print "Alice cannot do that!"
endif
` FightStyle=2 ARCHERY
else
` Check if they actually have an archery weapon
if alicearchery>0
` Attack with archery
alicedamage=rnd(alicearchery)
print "Alice shoots at your opponent and deals "+str$(alicedamage)+" damage!"
` Decrease enemy health by alicedamage
dec Enemy1Health,alicedamage
else
` No archery weapon
print "Alice cannot do that!"
endif
endif
endif
` Enemys Turn
if Turn=2
` Enemy attack
EnemyDamage=rnd(EnemyStrength)
` Pick either the player or alice to attack
whosAttacked=rnd(1) ` 0=Player 1=Alice
` Check if the player is being attacked
if whosAttacked=0
print "The enemy attacks you and deals "+str$(EnemyDamage)+" damage!"
` Decrease Players health by enemydamage
dec currenthealth,EnemyDamage
else
print "The enemy attacks Alice and deals "+str$(EnemyDamage)+" damage!"
` Decrease Alices health by enemydamage
dec aliceHP,EnemyDamage
endif
endif
` Check if the player is dead
if currenthealth<=0
print "You Are Dead."
` Leave the DO/LOOP
exit
endif
` Check if Alice is dead
if aliceHP<=0
print "Alice has died in battle..."
` Leave the DO/LOOP
exit
endif
` Check if the enemy is dead
if Enemy1Health<=0
print "You slaughter the goblin!"
` Leave the DO/LOOP
exit
endif
` Increase turn
inc Turn
` Check if all characters have had a turn and reset to first characters turn
if Turn=3 then Turn=0
loop
print "Alice: *sigh* Now that that's done... Let's get out of here!"
input "Alice: Type LEAVE to leave the cave! >";actionl$
actionu$=upper$(actionl$)
print "You find yourself outside of a cave, beaten and bruised."
print "The elf who helped you get out, Alice, is beside you."
print "At the moment, noone could guess what would happen to the"
print "two adventurers. Noone could guess the hardships that they go"
print "through. This is the story of "+name$+", Alice, and Jason."
wait key
set text size 40
set text font "arial"
print "FINAL DRAGON"
wait key
set text size 12
set text font "default"
Input "SAVE GAME: Type which slot (1, 2, or 3) to save in. >",saveslot
if saveslot=1
savearea=1
open to write 1,"Save1.dat"
write string 1,name$
write string 1,race$
write string 1,ArcheryWeapon$
write string 1,MeleeWeapon$
write string 1,Armor$
write long 1,currenthealth
write long 1,maxhealth
write long 1,defense
write long 1,archery
write long 1,melee
write long 1,normalpotion
write long 1,halfhealpotion
write long 1,fullhealpotion
write long 1,savearea
write long 1,aliceHP
write long 1,alicemax
write long 1,alicedefense
write long 1,alicearchery
write long 1,alicemelee
write string 1,alicearmor$
write string 1,alicemeleeweapon$
write string 1,alicearcheryweapon$
close file 1
Endofgame:
print "End of current demo. Stats:"
print Name$+" the "+Race$
print "Melee Weapon: "+MeleeWeapon$
print "Archery Weapon: "+ArcheryWeapon$
print "Armor: "+Armor$
print "HP: "+str$(currenthealth)
print "Max HP: "+str$(maxhealth)
print "Defense: "+str$(defense)
print "Archery Strength: "+str$(archery)
print "Melee Strength: "+str$(melee)
print "Alice's Melee Weapon: "+alicemeleeweapon$
print "Alice's Archery Weapon: "+alicearcheryweapon$
print "Alice's Armor: "+alicearmor$
print "Alice's HP: "+str$(alicehealth)
print "Alice's Max HP: "+str$(alicemax)
print "Alice's Defense: "+str$(alicedefense)
print "Alice's Archery Strength: "+str$(alicearchery)
print "Alice's Melee Strength: "+str$(alicemelee)
print "Heal Items"
print "Potions: "+str$(normalpotion)
print "Half-Heal Potions: "+str$(halfhealpotion)
print "Full-Heal Potions: "+str$(fullhealpotion)
wait key
print "Thanks for playing!"
wait key
exit
You: 465 lines!?! Holy crap!
Me: It's a text RPG. It will have a lot of lines, at least more than a normal RPG.