Yet another text based RPG

Miscellaneous Forums/Blitz Showcase/Yet another text based RPG

I'm working on a text RPG (I'm coding it in B+ but it should also work in B3D and BB). I could do with some opinions. It's not complete; but your game is gonna be a dead end if you go anywhere but east when it asks where you go in the intro. It saves and is making pretty good progress.

;TextRPG

SeedRnd MilliSecs()
Global fil,cash=50,name$="",gen$="m",clr$="",age=30,per$="",loc$="Flower Field",wep$="dagger",pop=1
Global occ$=""

If FileType("save.rpg")=1 Then

	fil=OpenFile("save.rpg")
	name=ReadString(fil)
	gen=Chr$(ReadByte(fil))
	age=ReadByte(fil)
	clr=ReadString(fil)
	per=ReadString(fil)
	cash=ReadInt(fil)
	loc=ReadLine(fil)
	wep=ReadString(fil)
	pop=ReadInt(fil)
	occ=ReadString(fil)
	Print "Type end at any time to exit."
	Print "Type save to save your game."
	Print "Type info to find out about yourself."
	Print "Type help to display this message again."
	Print "You currently are at "+loc+"."
	
Else

	Print "Your eyes flicker open."
	Print "You can feel your head throbbing."
	Print ""
	Print "You try to recall your name."
	.n
	name=Input("What is your name? ")
	If name<>"" And name<>" " Then name=name Else Print "Oh, comon, that's no name.":Goto n
	If name="Rich" Or name="Richard" Or name="Richie" Then cash=cash+8
	If name="Sally" Then cash=cash-2
	Print ""
	Print "You must have hit your head hard."
	Print "It even takes effort to remember if you're male or female."
	.gender
	gen=Input("Are you male(m) or female(f)? ")
	If gen<>"m" And gen<>"f" Then Print "Invalid option.":Goto gender
	Print ""
	.old
	age=Input("How old are you? ")
	If age<6 Or age>125 Then Print "Ha! Yea right. Give yourself a more sensible age.":Goto old
	Print ""
	Print "The sky above you is painted a beautiful blue."
	Print "The grass around you is a luscious green.
	Print "The flowers are wonderful shades of red, yellow, violet, and everything between."
	.clr
	clr=Input("You ponder, what color is your favorite? ")
	Select clr
		Case "red","orange","red-orange","pink","light red","flame","crimson","blood"
		Case "yellow","gold","dark yellow","tan","brown","lemon","sunlight"
		Case "green","lime","olive","dark green","light green","grass","tree green","evergreen"
		Case "teal","cyan","sky","aqua","aquamarine"
		Case "blue","navy","sky blue","water","light blue","dark blue","silver","chrome":cash=cash-2
		Case "violet","indigo","purple","magenta","dark purple","dark magenta","light purple"
		Case "white","light grey","light gray","grey","gray","black"
		Default clr=""
	End Select
	If clr="" Then Print "Sorry, "+clr+" is not a recognized color.":Goto clr
	Print "An excellent choice!"
	If clr="gold" Or clr="silver" Then cash=cash+15
	Print ""
	.personal
	per=Input("What would you say your personality is? ")
	Select per
		Case "angry","ashamed","mad","crazy","bashful","happy","jubilant","mellow","cool"
		Case "nerdy","geeky","maniacal","genius","smart","dumb","stupid","lame","sad"
		Case "depressed","insane","curious","cute","aware","popular","naughty","humble"
		Case "boasting","bragging","whimpy","strong","nasty","gross","mean","cruel","kind"
		Case "nice","understanding","generous","greedy","selfish","selfless","lonely"
		Case "social","special","average","normal","solo","antisocial","brave","daring"
		Case "nosy","loving","caring","joyous","funny","comedic","hateful","scornful"
		Case "merciful","graceful","hungry","bored","staightforward","simple","complex"
		Default per=""
	End Select
	If per="" Print "Sorry, but that isn't a valid personality.":Goto personal
	If per="greedy" Then cash=cash+10
	If per="popular" Then cash=cash+12:pop=pop+4
	If per="cruel" Then wep="whip"
	If per="stupid" Or per="dumb" Then wep="sling":pop=pop-1
	If per="merciful" Or per="strong" Then wep="sword"
	If per="bragging" Or per="boasting" Then pop=pop+7

	For newl=1 To 5
	Print ""
	Next
	Print "Your name is "+name+"."
	Print "You are of "+age+" years."
	Print "You are "+per+"."
	Print "Your favorite color is "+clr
	Select gen
		Case "m"
			If age>18 Then Print "You are a man." Else Print "You are a boy."
		Case "f"
			If age>18 Then Print "You are a woman." Else Print "You are a girl."
	End Select
	Print ""
	Print "You discover a pack strapped to your side." 
	Print "In it you see a "+wep+" and "+cash+" silver tokens."
	Print ""
	Print "You decide to get up and explore your surroundings."
	Print "You are presently in a large field covered with flowers."
	If per="curious" Then
		Print "You look around you."
		Print "To the east you notice a large castle."
		Print "To the south you see an orchard and a lone house."
	EndIf
	.goway
	dir$=Input("Which direction do you choose to go? ")
	Select dir
		Case "s","south":Print "You go south."
			Print "You sprint toward a garden in the distance."
			Print "You arriv at the garden, which is full of vegetation."
			north=3
		Case "n","north":Print "You venture north."
			north=0
			Print "You travel until you come across a deep ravine."
			Print "You can find no way across it."
			If per="brave" Or per="daring" Or per="stupid" Then
				.jumpover
				yn$=Input("Do you attempt to jump over the ravine? (y/n) ")
				Select yn
					Case "y":Print "You attempt to jump over."
						If Rand(0,2)=0 Then 
							Print "You made it over!":north=1
						Else 
							Print "You cower at the last second and change your mind."
						EndIf
					Case "n":Print "You decide against it."
					Default:Print "Not a valid response.":Goto jumpover
				End Select
			EndIf
			If north=0 Then Print "You trek back to the field.":Print "":Goto goway
		Case "w","west"
			Print "You go west for a bit until you encoounter a barren desrt."
			Print "It's no use going on from here."
			Print "You turn around and walk back to the field."
			Print ""
			Goto goway
		Case "e","east"
			Print "You walk east. The castle on the horizon begins to get nearer."
			Print "You arrive at Castle Loam."
			north=2
	End Select
	If north=1 Then loc$="The North" 
	If north=2 Then loc$="Castle Loam"
	If north=3 Then loc$="Monk Garden"
	Print ""
	Print "You are ready to begin your quest."
	
	fil=WriteFile("save.rpg")
	save
		
	.cont
	yn$=Input("Continue? (y/n) ")
	Select yn
		Case "y":Print "It is time to live life at "+loc+"!"
		Case "n":End
		Default:Print "Invalid option.":Goto cont
	End Select

EndIf





Repeat
	Select loc
		Case "Castle Loam"
			Print ""
			Print "You may visit these places:"
			Print "armory, bar"
			whr$=Input("Where would you like to go? ")
			Select whr
				Case "armory"
					Print ""
					Print "The owner spys you entering his establishment."
					Print "'Ah, I see you's got a "+wep+".'"
					If pop>10 Then
						Print "'Well if it isn't "+name+"!'"
						Print "'Tell me, what can I do for ye?'"
						If Not wep="shortsword" Then
							Print "'The other day, I picked up dis here beuty.'"
							Print "He shows you a shiny shortsword."
							If cash=>125 Then
								Print "'It'll cost you but 125 silvers'"
								.ss
								yn$=Input("Do you take the man's offer and buy it? (y/n) ")
								Select yn
									Case "y":Print "'It's a deal!'"
										cash=cash-125:wep="shortsword"
									Case "n":Print "'All right. If yer don't want it.'"
										Print "'But I'll save it in case ye ever change yer mind.'"
									Default:Print "'Eh? 'Scuse me? I didrn't quite get that.'":Goto ss
								End Select
							Else
								Print "'Oh, I's sorry, but I'm chargin' 125 silver tokens fer it.'"
								Print "'Ye only got "+cash+".'"
								Print "You look into your pack. You have "+cash+"."
								Print "How would he know that, you wonder."
							EndIf
						Else
							Print "He looks at his stock."
							Print "'I be sorry, but it 'pears I got nothin' t sell.'"
						EndIf
					Else
						Print "'Oh, yer new to town. Sorry, but I don sell to folk like yerself'"
					EndIf
				Case "bar"
					Print "You visit the bar."
					If pop<12 And occ<>"Loam Bar" Then
						Print ""
						Print "The bar owner calls for you to meet him behind the counter."
						Print "'Well yer a mighty fine feller.'"
						Print "'How would ye like it if'n I gave you a job?"
						Print "The man looks around his bar."
						Print "'I really need ye to work fer me.'"
						job$=Input("Accept the man's job offer? (y/n) ")
						Select job
							Case "y":Print "'Aye, thanks for accepting.'"
								pop=pop+3:occ="Loam Bar"
							Default
								Print "He doesn't seem to care what you think. You're hired anyway."
						End Select
					Else
						If occ="Loam Bar" Then
							If Rand(0,1)=0 Then
								Print "The owner walks up to you with some money in his hand."
								Print "'Lucky you, it's payday.'"
								pay=Rand(2,10)
								Print "He gives you "+pay+" silver tokens."
								cash=cash+pay
								Print "The owner goes back to the counter and offers you a menu."
							EndIf
						EndIf
						Print "You see the menu."
						Print "It says:"
						Print ""
						Print "=-------------------="
						Print "= Snakeskin Ale 6st ="
						Print "= Pumpkin Wine 10st ="
						Print "=-------------------="
						Print ""
						Print "You may type anything but s or p to pass."
						yn$=Input("Do you buy Snakeskin Ale(s) or Pumpkin Wine(p)? ")
						Select yn
							Case "s"
								If cash=>6 Then:cash=cash-6:pop=pop+2
									Print "You purchase some Snakeskin Ale. Boy is it tasty!"
								Else
									Print "Sorry, but you haven't enough money.":yn=-1
								EndIf
							Case "p"
								If cash=>10 Then:cash=cash-10:pop=pop+4
									Print "The Pumpikin Wine tastes excellent."
								Else
									Print "Sorry, but you haven't enough money.":yn=-1
								EndIf
							Default:yn=-1
						End Select
						If occ="Loam Bar" And yn<>-1 Then 
							Print "The bar owner looks at you and hands you some money."
							Print "'Ye know, employees get a 2 token discount.'"
							cash=cash+2
						EndIf
						Print "You have "+cash+" silver tokens."
					EndIf
				Case "save"
					save
					Print "Game saved."
				Case "exit","end"
					Print "Exiting game.":Delay 220
					save
					End
				Case "info"
					Print ""
					Print "You have "+cash+" silver tokens."
					Print "Your name is "+name+"."
					Print "You are "+age+" years old."
					Select gen
						Case "m"
							If age>18 Then Print "You are a man." Else Print "You are a boy."
						Case "f"
							If age>18 Then Print "You are a woman." Else Print "You are a girl."
					End Select
					Print "Your favorite color is "+clr+"."
					Print "You are "+per+"."
					Print "You current weapon is: "+wep+"."
					Print "You are at "+loc+"."
				Case "help":help
			End Select
		Case "The North"
		
		Case "Monk Garden"
	
	End Select
Forever


Function help()
	Print ""
	Print "Type end at any time to exit."
	Print "Type save to save your game."
	Print "Type info to find out about yourself."
	Print "Type help to display this message again."
End Function

Function save()
	SeekFile fil,0
	WriteString fil,name
	WriteByte fil,Asc(gen)
	WriteByte fil,age
	WriteString fil,clr
	WriteString fil,per
	WriteInt fil,cash
	WriteLine fil,loc
	WriteString fil,wep
	WriteInt fil,pop
	WriteString fil,occ
End Function


I would appreciate it it you all could tell me if you find any bugs or if something doesn't suit your taste. Everything you type must be in lower case. Also, if you have any ideas, I'm open for suggestions.

BTW: I put in a little cookie for those who read everything. Check the armory and eventually the owner will say something quite hilarious if you meet the right conditions.

Ohhhhh, this reminded me of the very first PC game I played, Star Wars on a 5-1/2" Floppy disk, some 23 years ago, hehehehe. It started my PC Craving that gets worse each day.

Very nice start, the text extends beyond the border of the window though.

You may want to look at colorizing the text, may make it easier to read.

Good job and good start!

Could you tell me what lines go beyond the border? If you're not using B+ you should probably call graphics 800x600 or something.

And about the color, I already am. It looks like it won't be easy though, unfortunately. But I'm gonna try.

I've been hard at work on this RPG, here it is with the Loam Dungeon now added with orks to fight galore! You will need to delete your previous save.rpg file to play properly.

;TextAge RPG
;By B3Dman

;Player stats-
;hp - hitpoints
;maxhp - maximum hitpoints
;atk - base attack damage
;def - max defense against enemy attacks
;spd - determines first attack in a battle, also helps to dodge when high.



AppTitle "TextAge - A Text-Based RPG"
SeedRnd MilliSecs()
Global fil,cash=50,name$="",gen$="m",clr$="",age=30,per$="",loc$="Flower Field",wep$="dagger",pop=1
Global occ$="",hp=15,maxhp=15,dun1st=1,atk=2,def=0,spd=1

If FileType("save.rpg")=1 Then

	fil=OpenFile("save.rpg")
	name=ReadString(fil)
	gen=Chr$(ReadByte(fil))
	age=ReadByte(fil)
	clr=ReadString(fil)
	per=ReadString(fil)
	cash=ReadInt(fil)
	loc=ReadLine(fil)
	wep=ReadString(fil)
	pop=ReadInt(fil)
	occ=ReadString(fil)
	hp=ReadShort(fil)
	maxhp=ReadShort(fil)
	dun1st=ReadByte(fil)
	atk=ReadShort(fil)
	def=ReadShort(fil)
	spd=ReadShort(fil)
	Print "Type end at any time to exit."
	Print "Type save to save your game."
	Print "Type info to find out about yourself."
	Print "Type help to display this message again."
	Print "You currently are at "+loc+"."
	
Else

	Print "Your eyes flicker open."
	Print "You can feel your head throbbing."
	Print ""
	Print "You try to recall your name."
	.n
	name=Input("What is your name? ")
	If name<>"" And name<>" " Then name=name Else Print "Oh, comon, that's no name.":Goto n
	If name="Rich" Or name="Richard" Or name="Richie" Then cash=cash+8
	If name="Sally" Then cash=cash-2
	Print ""
	Print "You must have hit your head hard."
	Print "It even takes effort to remember if you're male or female."
	.gender
	gen=Input("Are you male(m) or female(f)? ")
	If gen<>"m" And gen<>"f" Then Print "Invalid option.":Goto gender
	Print ""
	.old
	age=Input("How old are you? ")
	If age<6 Or age>125 Then Print "Ha! Yea right. Give yourself a more sensible age.":Goto old
	Print ""
	Print "The sky above you is painted a beautiful blue."
	Print "The grass around you is a luscious green.
	Print "The flowers are wonderful shades of red, yellow, violet, and everything between."
	.clr
	clr=Input("You ponder, what color is your favorite? ")
	Select clr
		Case "red","orange","red-orange","pink","light red","flame","crimson","blood"
		Case "yellow","gold","dark yellow","tan","brown","lemon","sunlight":cash=cash+1
		Case "green","lime","olive","dark green","light green","grass","tree green","evergreen"
		Case "teal","cyan","sky","aqua","aquamarine"
		Case "blue","navy","sky blue","water","light blue","dark blue","silver","chrome":cash=cash-2
		Case "violet","indigo","purple","magenta","dark purple","dark magenta","light purple"
		Case "white","light grey","light gray","grey","gray","black"
		Default clr=""
	End Select
	If clr="" Then Print "Sorry, "+clr+" is not a recognized color.":Goto clr
	Print "An excellent choice!"
	If clr="gold" Or clr="silver" Then cash=cash+15
	If clr="blood" Then atk=atk+1
	If clr="white" Then def=def+1
	Print ""
	.personal
	per=Input("What would you say your personality is? ")
	Select per
		Case "angry","ashamed","mad","crazy","bashful","happy","jubilant","mellow","cool"
		Case "nerdy","geeky","maniacal","genius","smart","dumb","stupid","lame","sad"
		Case "depressed","insane","curious","cute","aware","popular","naughty","humble"
		Case "boasting","bragging","whimpy","strong","nasty","gross","mean","cruel","kind"
		Case "nice","understanding","generous","greedy","selfish","selfless","lonely","meek"
		Case "social","special","average","normal","solo","antisocial","brave","daring"
		Case "nosy","loving","caring","joyous","funny","comedic","hateful","scornful"
		Case "merciful","graceful","hungry","bored","staightforward","simple","complex"
		Case "valiant","fearless","agile","athletic","powerful","clumsy","patient","impatient"
		Default per=""
	End Select
	If per="" Print "Sorry, but that isn't a valid personality.":Goto personal
	If per="greedy" Then cash=cash+10
	If per="popular" Then cash=cash+12:pop=pop+4
	If per="cruel" Then wep="whip":atk=atk+1
	If per="stupid" Or per="dumb" Then wep="sling":pop=pop-1
	If per="merciful" Or per="strong" Then wep="sword"
	If per="strong" Or per="powerful" Then atk=atk+2
	If per="bragging" Or per="boasting" Then pop=pop+7
	If per="agile" Or per="athletic" Then wep="knife":spd=spd+1

	For newl=1 To 5
	Print ""
	Next
	Print "Your name is "+name+"."
	Print "You are of "+age+" years."
	Print "You are "+per+"."
	Print "Your favorite color is "+clr
	Select gen
		Case "m"
			If age>18 Then Print "You are a man." Else Print "You are a boy."
		Case "f"
			If age>18 Then Print "You are a woman." Else Print "You are a girl."
	End Select
	Print ""
	Print "You discover a pack strapped to your side." 
	Print "In it you see a "+wep+" and "+cash+" silver tokens."
	Print ""
	Print "You decide to get up and explore your surroundings."
	Print "You are presently in a large field covered with flowers."
	If per="curious" Then
		Print "You look around you."
		Print "To the east you notice a large castle."
		Print "To the south you see an orchard and a lone house."
	EndIf
	.goway
	dir$=Input("Which direction do you choose to go? ")
	Select dir
		Case "s","south":Print "You go south."
			Print "You sprint toward a garden in the distance."
			Print "You arrive at the garden, which is full of vegetation."
			north=3
		Case "n","north":Print "You venture north."
			north=0
			Print "You travel until you come across a deep ravine."
			Print "You can find no way across it."
			If per="brave" Or per="daring" Or per="stupid" Then
				.jumpover
				yn$=Input("Do you attempt to jump over the ravine? (y/n) ")
				Select yn
					Case "y":Print "You attempt to jump over."
						Select per 
							Case "brave","fearless","agile","athletic","strong","solo"
								Print "You made it over!":north=1
							Case "antisocial","valiant","insane","stupid","smart"
								Print "You make it, but just barely.":north=1
							Default:Print "You cower at the last second and change your mind."
						End Select
					Case "n":Print "You decide against it."
					Default:Print "Not a valid response.":Goto jumpover
				End Select
			EndIf
			If north=0 Then Print "You trek back to the field.":Print "":Goto goway
		Case "w","west"
			Print "You go west for a bit until you encoounter a barren desrt."
			Print "It's no use going on from here."
			Print "You turn around and walk back to the field."
			Print ""
			Goto goway
		Case "e","east"
			Print "You walk east. The castle on the horizon begins to get nearer."
			Print "You arrive at Castle Loam."
			north=2
	End Select
	If north=1 Then loc$="The North" 
	If north=2 Then loc$="Castle Loam"
	If north=3 Then loc$="Monk Garden"
	Print ""
	Print "You are ready to begin your quest."
	
	fil=WriteFile("save.rpg")
	save
		
	.cont
	yn$=Input("Continue? (y/n) ")
	Select yn
		Case "y":Print "It is time to live life at "+loc+"!"
		Case "n":End
		Default:Print "Invalid option.":Goto cont
	End Select

EndIf





Repeat
	Select loc
		Case "Castle Loam"
			Print ""
			Print "You may visit these places:"
			Write "armory, bar"
			If pop>20 Then Write ", dungeon":If pop>35 Then Write ", field"
			Print ""
			whr$=Input("Where would you like to go? ")
			Select whr
				Case "armory"
					Print ""
					Print "The owner spys you entering his establishment."
					If pop>10 Then Print "'Well if it isn't "+name+"!'"
					Print "'Ah, I see you's got a "+wep+".'"
					If pop>10 Then
						Print "'Tell me, what can I do for ye?'"
						If Not wep="shortsword" Then
							Print "'The other day, I picked up dis here beuty.'"
							Print "He shows you a shiny shortsword."
							If cash=>125 Then
								Print "'It'll cost you but 125 silvers'"
								.ss
								yn$=Input("Do you take the man's offer and buy it? (y/n) ")
								Select yn
									Case "y":Print "'It's a deal!'"
										cash=cash-125:wep="shortsword"
									Case "n":Print "'All right. If yer don't want it.'"
										Print "'But I'll save it in case ye ever change yer mind.'"
									Default:Print "'Eh? 'Scuse me? I didrn't quite get that.'":Goto ss
								End Select
							Else
								Print "'Oh, I's sorry, but I'm chargin' 125 silver tokens fer it.'"
								Print "'Ye only got "+cash+".'"
								Print "You look into your pack. You have "+cash+"."
								Print "How would he know that, you wonder."
							EndIf
						Else
							Print "He looks at his stock."
							Print "'I be sorry, but it 'pears I got nothin' t sell.'"
						EndIf
					Else
						Print "'Oh, yer new to town. Sorry, but I don sell to folk like yerself'"
					EndIf
				Case "bar"
					Print ""
					Print "You visit the bar."
					If pop<12 And occ="" Then
						Print "The bar owner calls for you to meet him behind the counter."
						Print "'Well yer a mighty fine feller.'"
						Print "'How would ye like it if'n I gave you a job?"
						Print "The man looks around his bar."
						Print "'I really need ye to work fer me.'"
						job$=Input("Accept the man's job offer? (y/n) ")
						Select job
							Case "y":Print "'Aye, thanks for accepting.'"
								pop=pop+3:occ="Bartender"
							Default
								Print "He doesn't seem to care what you think. You're hired anyway."
						End Select
					Else
						If occ="Bartender" Then
							If Rand(0,1)=0 Then
								Print "The owner walks up to you with some money in his hand."
								Print "'Lucky you, it's payday.'"
								pay=Rand(2,7)
								Print "He gives you "+pay+" silver tokens."
								cash=cash+pay
								Print "The owner goes back to the counter and offers you a menu."
							EndIf
						EndIf
						Print "You see the menu."
						Print "It says:"
						Print ""
						Print "=--------------------="
						Print "= Snakeskin Ale 6 st ="
						Print "= Pumpkin Wine 10 st ="
						Print "=--------------------="
						Print ""
						Print "You have "+cash+" silver tokens."
						Print "You may type anything but s or p to pass."
						yn$=Input("Do you buy Snakeskin Ale(s) or Pumpkin Wine(p)? ")
						Select yn
							Case "s"
								If cash=>6 Then:cash=cash-6:pop=pop+2
									Print "You purchase some Snakeskin Ale. Boy is it tasty!"
								Else
									Print "Sorry, but you haven't enough money.":yn=-1
								EndIf
							Case "p"
								If cash=>10 Then:cash=cash-10:pop=pop+4
									Print "The Pumpikin Wine tastes excellent."
								Else
									Print "Sorry, but you haven't enough money.":yn=-1
								EndIf
							Default:yn=-1
						End Select
						If occ="Bartender" And yn<>-1 Then 
							Print "The bar owner looks at you and hands you some money."
							Print "'Ye know, employees get a 2 token discount.'"
							cash=cash+2
						EndIf
						Print "You have "+cash+" silver tokens."
					EndIf
				Case "save"
					save
					Print "Game saved."
				Case "exit","end"
					Print "Exiting game.":Delay 220
					save
					End
				Case "info"
					Print ""
					Print "You have "+cash+" silver tokens."
					Print "Your name is "+name+"."
					Print "You are "+age+" years old."
					Select gen
						Case "m"
							If age>18 Then Print "You are a man." Else Print "You are a boy."
						Case "f"
							If age>18 Then Print "You are a woman." Else Print "You are a girl."
					End Select
					Print "Your favorite color is "+clr+"."
					Print "You are "+per+"."
					Print "Your current weapon is: "+wep+"."
					Print "You are at "+loc+"."
					Print "You are a "+occ+"."
					Print "Your health is: "+hp+"/"+maxhp+"."
				Case "help":help
				Case "dungeon"
					If pop>20 Then
						Print ""
						Print "You walk down a spiral staircase down into the gloomy depths."
						Print "You have arrived at the Loam Dungeon."
						If dun1st=1 Then
							Print "A man weilding a battleaxe strolls casually toward you."
							Print "'Ha! Ye sure do look wimpy!'"
							Print "'It must be ye first time, eh?'"
							Print "'Me name's George. Yerself?'"
							Print "You tell him your name, "+name+"."
							Print "'"+name+"? What a fascinate'n name.'"
							dun1st=0
						Else
							Print "George comes toward you."
							Print "'Greetin's, "+name+"! How's it doin' fer ye?'"
						EndIf
						Print "'Well, anyways, welcom' to th' dungeon!'"
						loc="Loam Dungeon"
					EndIf
			End Select
		Case "Loam Dungeon"
			Print ""
			Print "You may visit these places:"
			Write "ork nest, medic, surface":If pop>32 Then Write ", graveyard"
			Print ""
			whr$=Input("Where to? ")
			Select whr
				Case "medic"
					Print ""
					Print "The doctor who owns the clinic comes up to you."
					Print "'Hello there, "+name+".'"
					If per="generous" Then pay=5 Else pay=8
					Print "'For a measly "+pay+" silver tokens I can restore you 5 health.'"
					Print "Your health is currently "+hp+"/"+maxhp+"."
					.dochealme
					yn$=Input("Accept the doctor's offer? (y/n) ")
					Select yn
						Case "y":cash=cash-pay:Print "You have been restored 5 health."
							Print "Your health is now "+hp+"/"+maxhp+"."
						Case "n":Print "'Very well, then. I'll see you next time.'"
						Default:Print "Invalid response.":Goto dochealme
					End Select
				Case "ork nest"
					Print ""
					Print "You go to the ork nest."
					Print "An ork appears!"
					res=Enemy("ork", 4,8, 1,2, 0,1, 0,3)
					If res=1 Then
						Print "You beat the ork! Congratulations!"
						pay=Rand(1,8)
						Print "The ork had "+pay+" silver tokens."
						cash=cash+pay
						Print "You now have "+cash+" tokens."
					ElseIf res=0:Print "You were bested by the ork. Tough luck!"
						Print "You lost half of your tokens.":cash=cash/2
						Print "You now have "+cash+" tokens."
						hp=1
					ElseIf res=2
						Print "George looks disapointed in you."
						Print "'Ye fled a battle? What a shame.'"
						pay=cash/7
						Print "You lose "+pay+" silver tokens in your recklessness."
						cash=cash-pay:If cash<0 Then cash=0
						Print "You have only "+cash+" tokens now."
					EndIf
				Case "surface"
					Print ""
					Print "You say your bye to George and walk up, back into the sunlight."
					loc="Castle Loam"
					Print "You have arrived at Castle Loam."
				Case "save"
					save
					Print "Game saved."
				Case "exit","end"
					Print "Exiting game.":Delay 220
					save
					End
				Case "info"
					Print ""
					Print "You have "+cash+" silver tokens."
					Print "Your name is "+name+"."
					Print "You are "+age+" years old."
					Select gen
						Case "m"
							If age>18 Then Print "You are a man." Else Print "You are a boy."
						Case "f"
							If age>18 Then Print "You are a woman." Else Print "You are a girl."
					End Select
					Print "Your favorite color is "+clr+"."
					Print "You are "+per+"."
					Print "Your current weapon is: "+wep+"."
					Print "You are at "+loc+"."
					Print "You are a "+occ+"."
					Print "Your health is: "+hp+"/"+maxhp+"."
				Case "help":help
			End Select
		Case "The North"
		
		Case "Monk Garden"
	
	End Select
Forever


Function help()
	Print ""
	Print "Type end at any time to exit."
	Print "Type save to save your game."
	Print "Type info to find out about yourself."
	Print "Type help to display this message again."
End Function

Function enemy%(n$,ihp,ahp,ia,aa,id,ad,is,as)
	Print ""
	ea=Rand(ia,aa):ed=Rand(id,ad):es=Rand(is,as):ehp=Rand(ihp,ahp)
	If es>spd Then turn=0 Else turn=1
	Repeat
		If turn=0
			Print ""
			Print n+": "+ehp+" health left"
			dmg=Rand(ea-2,ea+1)
			If Rand(0,1)=0 Then dmg=dmg-Rand(pdef-1,pdef+1)
			If dmg<0 Then dmg=0
			Print "The "+n+" attacks you for "+dmg+" damage."
			hp=hp-dmg
		Else
			Print ""
			Print "You have "+hp+"/"+maxhp+" health."
			Print "Pick your action"
			Print "Your options are:"
			Print "flee, weapon, punch, guard"
			.attackn
			Print ""
			wht$=Input("What will you do? ")
			pdef=def
			Select wht
				Case "flee"
					success=Rand(0,1):If success Then:Return 2:Else Print "You failed to escape!":EndIf
				Case "punch"
					If Rand(0,3)=0 Then atk=atk+1
					Print "You attempt a punch."
					lik=es-spd:If lik<0 Then lik=0
					lik=Rand(0,lik)
					dmg=Rand(atk-1,atk+1):If dmg<0 Then dmg=0
					If lik=0 Then:ehp=ehp-dmg
						Print "You hit the "+n+" for "+dmg+" damage."
					Else:Print "You missed the "+n+"!":If Rand(0,4)=0 Then spd=spd+1
					EndIf
				Case "guard"
					If Rand(0,3)=0 Then def=def+1
					If Rand(0,2)=0 Then:pdef=def*1.5:Print "You are ready for anything now!"
					Else:pdef=pdef*1.25:Print "You dig your feet into the ground and brace yourself."
					EndIf
				Case "weapon"
					Print "You ready your "+wep+"."
					dmg=WepHit(wep)*(atk/3)
					Print "You attack the enemy for "+dmg+" damage."
					ehp=ehp-dmg
				Default:Print "Invalid action.":Goto attackn
			End Select
		EndIf	
		turn=Abs(turn-1)
		If ehp<1 Then Return 1
		If hp<1 Then
			If Rand(0,5)=0 Then:Print "The "+n+" took away your "+wep+"!"
				Print "You find a stick off the ground and equip it.":wep="stick"
			EndIf
			Return 0
		EndIf
	Forever
End Function

Function save()
	SeekFile fil,0
	WriteString fil,name
	WriteByte fil,Asc(gen)
	WriteByte fil,age
	WriteString fil,clr
	WriteString fil,per
	WriteInt fil,cash
	WriteLine fil,loc
	WriteString fil,wep
	WriteInt fil,pop
	WriteString fil,occ
	WriteShort fil,hp
	WriteShort fil,maxhp
	WriteByte fil,dun1st
	WriteShort fil,atk
	WriteShort fil,def
	WriteShort fil,spd
End Function

Function WepHit%(s$)
	Select s
		Case "stick"
			Return 0+Rand(-0,2)
		Case "sling"
			Return 1+Rand(-0,1)
		Case "dagger"
			Return 3+Rand(-1,1)
		Case "knife"
			Return 4+Rand(-1,0)
		Case "whip"
			Return 4+Rand(-2,2)
		Case "shortsword"
			Return 4+Rand(-1,2)
		Case "sword"
			Return 5+Rand(-1,3)
		Case "lance"
			Return 5+Rand(-0,3)
		Case "rapier"
			Return 7+Rand(-1,1)
		Case "broadsword"
			Return 9+Rand(-4,3)
		Case "longsword"
			Return 9+Rand(-2,3)
		Case "mace"
			Return 8+Rand(-3,4)
		Case "battleaxe"
			Return 10+Rand(-4,10)
		Case "Goldenblade"
			Return 12+Rand(-4,9)
		Case "Ultima Sword"
			Return 17+Rand(-8,12)
	End Select
End Function


My ultimate goal is to make this an RPG unlike so many out there where the only role you play is the one they give you, but this will be one in which there is more freedom in which path you take. I am uncertain if I will have quests of any sort yet. My ultimate goal, though, is to make several locations in the game, such as pubs or arenas, where other players connected to the internet will be there also. I think an arena would be very nice, with players given the ability to combat one another. I dream on though, with networking, aside from 3D coding and applying proper sound and music to my games, is the thing I am worst at.

B3Dman,
Could you tell me what lines go beyond the border? If you're not using B+ you should probably call graphics 800x600 or something.

Why don't you copy the code and change it temporarily yourself! I DID.

What? I'm not sure what that's supposed to mean.

Anyway, here's a better code.

;TextAge RPG
;By B3Dman

;Player stats-
;hp - hitpoints
;maxhp - maximum hitpoints
;atk - base attack damage
;def - max defense against enemy attacks
;spd - determines first attack in a battle, also helps to dodge when high.


Const filname$="save"
AppTitle "TextAge - A Text-Based RPG"
SeedRnd MilliSecs()
Global fil,cash=50,name$="",gen$="m",clr$="",age=30,per$="",loc$="Flower Field",wep$="dagger",pop=1
Global occ$="",hp=15,maxhp=15,dun1st=1,atk=2,def=0,spd=1,oddball=1,reddy4w=0,desert=0

If FileType(filname+".rpg")=1 Then

	fil=OpenFile(filname+".rpg")
	name=ReadString(fil)
	gen=Chr$(ReadByte(fil))
	age=ReadByte(fil)
	clr=ReadString(fil)
	per=ReadString(fil)
	cash=ReadInt(fil)
	loc=ReadLine(fil)
	wep=ReadString(fil)
	pop=ReadInt(fil)
	occ=ReadString(fil)
	hp=ReadShort(fil)
	maxhp=ReadShort(fil)
	dun1st=ReadByte(fil)
	atk=ReadShort(fil)
	def=ReadShort(fil)
	spd=ReadShort(fil)
	oddball=ReadByte(fil)
	reddy4w=ReadByte(fil)
	desert=ReadByte(fil)
	Print "Type end at any time to exit."
	Print "Type save to save your game."
	Print "Type info to find out about yourself."
	Print "Type help to display this message again."
	Print "You currently are at "+loc+"."
	
Else

	Print "Your eyes flicker open."
	Print "You can feel your head throbbing."
	Print ""
	Print "You try to recall your name."
	.n
	name=Input("What is your name? ")
	If name<>"" And name<>" " Then name=name Else Print "Oh, comon, that's no name.":Goto n
	If name="Rich" Or name="Richard" Or name="Richie" Then cash=cash+8
	If name="Poor" Then cash=cash-2
	Print ""
	Print "You must have hit your head hard."
	Print "It even takes effort to remember if you're male or female."
	.gender
	gen=Input("Are you male(m) or female(f)? ")
	If gen<>"m" And gen<>"f" Then Print "Invalid option.":Goto gender
	Print ""
	.old
	age=Input("How old are you? ")
	If age<6 Or age>125 Then Print "Ha! Yea right. Give yourself a more sensible age.":Goto old
	Print ""
	Print "The sky above you is painted a beautiful blue."
	Print "The grass around you is a luscious green.
	Print "The flowers are wonderful shades of red, yellow, violet, and everything between."
	.clr
	clr=Input("You ponder, what color is your favorite? ")
	Select clr
		Case "red","orange","red-orange","pink","light red","flame","crimson","blood"
		Case "yellow","gold","dark yellow","tan","brown","lemon","sunlight":cash=cash+1
		Case "green","lime","olive","dark green","light green","grass","tree green","evergreen"
		Case "teal","cyan","sky","aqua","aquamarine"
		Case "blue","navy","sky blue","water","light blue","dark blue","silver","chrome":cash=cash-2
		Case "violet","indigo","purple","magenta","dark purple","dark magenta","light purple"
		Case "white","light grey","light gray","grey","gray","black"
		Default clr=""
	End Select
	If clr="" Then Print "Sorry, "+clr+" is not a recognized color.":Goto clr
	Print "An excellent choice!"
	If clr="gold" Or clr="silver" Then cash=cash+15
	If clr="blood" Or clr="crimson" Then atk=atk+1
	If clr="white" Then def=def+1
	If clr="sky blue" Or clr="light grey" Or clr="light gray" Then spd=spd+2
	If clr="green" Or clr="olive" Then def=def-1:atk=atk+1
	Print ""
	.personal
	per=Input("What would you say your personality is? ")
	Select per
		Case "angry","ashamed","mad","crazy","bashful","happy","jubilant","mellow","cool"
		Case "nerdy","geeky","maniacal","genius","smart","dumb","stupid","lame","sad"
		Case "depressed","insane","curious","cute","aware","popular","naughty","humble"
		Case "boasting","bragging","whimpy","strong","nasty","gross","mean","cruel","kind"
		Case "nice","understanding","generous","greedy","selfish","selfless","lonely","meek"
		Case "social","special","average","normal","solo","antisocial","brave","daring"
		Case "nosy","loving","caring","joyous","funny","comedic","hateful","scornful"
		Case "merciful","graceful","hungry","bored","staightforward","simple","complex"
		Case "valiant","fearless","agile","athletic","powerful","clumsy","patient","impatient"
		Default per=""
	End Select
	If per="" Print "Sorry, but that isn't a valid personality.":Goto personal
	If per="greedy" Then cash=cash+10
	If per="popular" Then cash=cash+12:pop=pop+4
	If per="cruel" Then wep="whip":atk=atk+1
	If per="stupid" Or per="dumb" Then wep="sling":pop=pop-1
	If per="merciful" Or per="strong" Then wep="sword"
	If per="strong" Or per="powerful" Then atk=atk+2
	If per="bragging" Or per="boasting" Then pop=pop+7
	If per="agile" Or per="athletic" Then wep="knife":spd=spd+1

	For newl=1 To 5
	Print ""
	Next
	Print "Your name is "+name+"."
	Print "You are of "+age+" years."
	Print "You are "+per+"."
	Print "Your favorite color is "+clr+"."
	Select gen
		Case "m"
			If age>18 Then Print "You are a man." Else Print "You are a boy."
		Case "f"
			If age>18 Then Print "You are a woman." Else Print "You are a girl."
	End Select
	Print ""
	Print "You discover a pack strapped to your side." 
	Print "In it you see a "+wep+" and "+cash+" silver tokens."
	Print ""
	Print "You decide to get up and explore your surroundings."
	Print "You are presently in a large field covered with flowers."
	If per="curious" Then
		Print "You look around you."
		Print "To the east you notice a large castle."
		Print "To the south you see an orchard and a lone house."
	EndIf
	.goway
	dir$=Input("Which direction do you choose to go? ")
	Select Lower(dir)
		Case "s","south":Print "You go south."
			Print "You sprint toward a garden in the distance."
			Print "You arrive at the garden, which is full of vegetation."
			north=3
		Case "n","north":Print "You venture north."
			north=0
			Print "You travel until you come across a deep ravine."
			Print "You can find no way across it."
			If per="brave" Or per="daring" Or per="stupid" Then
				.jumpover
				yn$=Input("Do you attempt to jump over the ravine? (y/n) ")
				Select yn
					Case "y":Print "You attempt to jump over."
						Select per 
							Case "brave","fearless","agile","athletic","strong","solo"
								Print "You made it over!":north=1
							Case "antisocial","valiant","insane","stupid","smart"
								Print "You make it, but just barely.":north=1
							Default:Print "You cower at the last second and change your mind."
						End Select
					Case "n":Print "You decide against it."
					Default:Print "Not a valid response.":Goto jumpover
				End Select
			EndIf
			If north=0 Then Print "You trek back to the field.":Print "":Goto goway
		Case "w","west"
			Print "You go west for a bit until you encoounter a barren desrt."
			Print "It's no use going on from here."
			Print "You turn around and walk back to the field."
			Print ""
			Goto goway
		Case "e","east"
			Print "You walk east. The castle on the horizon begins to get nearer."
			Print "You arrive at Castle Loam."
			north=2
		Default:Print "Please choose north, south, east, or west.":Goto goway
	End Select
	If north=1 Then loc$="The North" 
	If north=2 Then loc$="Castle Loam"
	If north=3 Then loc$="Monk Garden"
	Print ""
	Print "You are ready to begin your quest."
	
	fil=WriteFile(filname+".rpg")
	save
		
	.cont
	yn$=Input("Continue? (y/n) ")
	Select yn
		Case "y":Print "It is time to live life at "+loc+"!":help
		Case "n":End
		Default:Print "Invalid option.":Goto cont
	End Select

EndIf





Repeat
	Select loc
		Case "Castle Loam"
			Print ""
			Print "You may visit these places:"
			Write "armory, tavern"
			If pop>20 Then Write ", dungeon":If pop>35 Then Write ", field"
			Print ""
			whr$=Input("Where would you like to go? ")
			Select Lower(whr)
				Case "armory"
					Print ""
					Print "The owner spys you entering his establishment."
					If pop>10 Then Print "'Well if it isn't "+name+"!'"
					Print "'Ah, I see you's got a "+wep+".'"
					If pop>10 Then
						Print "'Tell me, what can I do for ye?'"
						If Not wep="shortsword" Then
							Print "'The other day, I picked up dis here beauty.'"
							Print "He shows you a shiny shortsword."
							If cash=>125 Then
								Print "'It'll cost you but 125 silvers'"
								.ss
								yn$=Input("Do you take the man's offer and buy it? (y/n) ")
								Select yn
									Case "y":Print "'It's a deal!'"
										cash=cash-125:wep="shortsword"
									Case "n":Print "'All right. If yer don't want it.'"
										Print "'But I'll save it in case ye ever change yer mind.'"
									Default:Print "'Eh? 'Scuse me? I didrn't quite get that.'":Goto ss
								End Select
							Else
								Print "'Oh, I's sorry, but I'm chargin' 125 silver tokens fer it.'"
								Print "'Ye only got "+cash+".'"
								Print "You look into your pack. You have "+cash+"."
								Print "How would he know that, you wonder."
							EndIf
						Else
							Print "He looks at his stock."
							Print "'I be sorry, but it 'pears I got nothin' t sell.'"
						EndIf
					Else
						Print "'Oh, yer new to town. Sorry, but I don sell to folk like yerself'"
					EndIf
				Case "tavern"
					Print ""
					Print "You visit the tavern."
					If pop<12 And occ="" Then
						Print "The tavern owner calls for you to meet him behind the counter."
						Print "'Well yer a mighty fine feller.'"
						Print "'How would ye like it if'n I gave you a job?"
						Print "The man looks around his tavern."
						Print "'I really need ye to work fer me.'"
						job$=Input("Accept the man's job offer? (y/n) ")
						Select job
							Case "y":Print "'Aye, thanks for accepting.'"
								pop=pop+3:occ="Tavern employee"
							Default
								Print "He doesn't seem to care what you think. You're hired anyway."
						End Select
					Else
						If occ="Tavern employee" Then
							If Rand(0,1)=0 Then
								Print "The owner walks up to you with some money in his hand."
								Print "'Lucky you, it's payday.'"
								pay=Rand(2,7)
								Print "He gives you "+pay+" silver tokens."
								cash=cash+pay
								Print "The owner goes back to the counter and offers you a menu."
							EndIf
						EndIf
						Print "You see the menu."
						Print "It says:"
						Print ""
						Print "=--------------------="
						Print "= Snakeskin Ale 6 st ="
						Print "= Pumpkin Wine 10 st ="
						Print "=--------------------="
						Print ""
						Print "You have "+cash+" silver tokens."
						Print "You may type anything but s or p to pass."
						yn$=Input("Do you buy Snakeskin Ale(s) or Pumpkin Wine(p)? ")
						Select yn
							Case "s"
								If cash=>6 Then:cash=cash-6:pop=pop+2
									Print "You purchase some Snakeskin Ale. Boy is it tasty!"
								Else
									Print "Sorry, but you haven't enough money.":yn=-1
								EndIf
							Case "p"
								If cash=>10 Then:cash=cash-10:pop=pop+4
									Print "The Pumpikin Wine tastes excellent."
								Else
									Print "Sorry, but you haven't enough money.":yn=-1
								EndIf
							Default:yn=-1
						End Select
						If occ="Tavern employee" And yn<>-1 Then 
							Print "The tavern owner looks at you and hands you some money."
							Print "'Ye know, employees get a 2 token discount.'"
							cash=cash+2
						EndIf
						Print "You have "+cash+" silver tokens."
					EndIf
				Case "save"
					save
					Print "Game saved."
				Case "exit","end"
					Print "Exiting game.":Delay 220
					save
					End
				Case "info"
					Print ""
					Print "You have "+cash+" silver tokens."
					Print "Your name is "+name+"."
					Print "You are "+age+" years old."
					Select gen
						Case "m"
							If age>18 Then Print "You are a man." Else Print "You are a boy."
						Case "f"
							If age>18 Then Print "You are a woman." Else Print "You are a girl."
					End Select
					Print "Your favorite color is "+clr+"."
					Print "You are "+per+"."
					Print "Your current weapon is: "+wep+"."
					Print "You are at "+loc+"."
					Print "You are a "+occ+"."
					Print "Your health is: "+hp+"/"+maxhp+"."
				Case "help":help
				Case "dungeon"
					If pop>20 Then
						Print ""
						Print "You walk down a spiral staircase down into the gloomy depths."
						Print "You have arrived at the Loam Dungeon."
						If dun1st=1 Then
							Print "A man weilding a battleaxe strolls casually toward you."
							Print "'Ha! Ye sure do look wimpy!'"
							Print "'It must be ye first time, eh?'"
							Print "'Me name's George. Yerself?'"
							Print "You tell him your name, "+name+"."
							Select gen
								Case "m":Print "'"+n+"? That is a tough name, ain't it."
									If clr="pink" Then:Print "'Haha! Yer fav'rit color's pink!'"
									Else:Print "You wonder who told him that and promise revenge.":EndIf
								Case "f"
									If per="cruel"Then:Print"'"+n+"? Well don ye hurt me! I's friendly.'"
									Else:Print "Well I say, "+n+", you's the prettiest face I ever saw."
									EndIf
							End Select
							dun1st=0
						Else
							Print "George comes toward you."
							Print "'Greetin's, "+name+"! How's it doin' fer ye?'"
						EndIf
						Print "'Well, anyways, welcom' to th' dungeon!'"
						loc="Loam Dungeon"
					EndIf
				Case "field"
					Print "You go back to the field where you first woke up."
					Print "Confusing memories go through your head."
					loc="Flower Field"
			End Select
		Case "Loam Dungeon"
			Print ""
			Print "You may visit these places:"
			Write "ork nest, medic, surface":If pop>32 Then Write ", ork stronghold"
			Print ""
			whr$=Input("Where to? ")
			Select Lower(whr)
				Case "medic"
					Print ""
					Print "The doctor who owns the clinic comes up to you."
					Print "'Hello there, "+name+".'"
					If per="generous" Then pay=5 Else pay=8
					Print "'For a measly "+pay+" silver tokens I can restore you 5 health.'"
					Print "Your health is currently "+hp+"/"+maxhp+"."
					.dochealme
					yn$=Input("Accept the doctor's offer? (y/n) ")
					Select yn
						Case "y":cash=cash-pay:Print "You have been restored 5 health."
							hp=hp+5:If hp>maxhp Then hp=maxhp
							Print "Your health is now "+hp+"/"+maxhp+"."
						Case "n":Print "'Very well, then. I'll see you next time.'"
						Default:Print "Invalid response.":Goto dochealme
					End Select
				Case "ork nest"
					If Rand(0,17)=0 And occ<>"Ork Hunter" And wep<>"Orkslayer" Then
						Print "George halts you from going into the nest."
						Print "'I's got's t' speak with you, "+name+".'"
						Print "'Our Ork Hunt'r has been slain an' we need a r'placement."
						.steveirwin
						Print ""
						yn$=Input("Change your job to Ork Hunter? (y/n) ")
						occ="Ork Hunter"
						Select yn
							Case "y"
								If gen="m" Then 
									Print "'Aye fellow, ye watch yerself now. Them orks'll be aft'r ye.'"
								Else
									Print "'Oh, a tough lit'le girl, just m' type!'"
									Print "The two of you share a good laugh."
								EndIf
								Print ""
								Print "George hands you a green sword."
								Print "'That there's th' Orkslayer." 
								Print "It's been weilded by every Ork Hunter t' date."
								.Orkslayr
								yn$=Input("Take the Orkslayer and trash your old weapon? (y/n) ")
								Select yn
									Case "y":Print "'That's a mighty fine choice ye made.'"
										Print "'I doubt ye'll regret it.'"
										Print "You give George your "+wep+"."
										Print "'I'll keep yer "+wep+" safe.'"
										wep="Orkslayer"
									Case "n":Print "'All right, but ye's the first t refuse.'":pop=pop+3
									Default:Print "Invalid option.":Goto Orkslayr
								End Select
							Case "n"
								Print "George looks sad."
								Print "'Well if'n ye don wan to. Ye were th' only one that came t mind.'"
							Default:Print "Invalid response.":Goto steveirwin
						End Select
					EndIf
					Print ""
					Print "You go to the ork nest."
					Print "An ork appears!"
					res=Enemy("ork", 4,8, 1,2, 0,1, 0,3)
					If res=1 Then
						Print "You beat the ork! Congratulations!"
						pay=Rand(1,8)
						Print "The ork had "+pay+" silver tokens."
						cash=cash+pay
						If occ="Ork Hunter" Then:cash=cash+2:If Rand(0,2)=0 Then pop=pop+1
						Print "For killing another ork George has paid you 2 extra tokens.":EndIf
						Print "You now have "+cash+" tokens."
					ElseIf res=0:Print "You were bested by the ork. Tough luck!"
						Print "You lost half of your tokens.":cash=cash/2
						Print "You now have "+cash+" tokens."
						hp=1
					ElseIf res=2
						Print "George looks disapointed in you."
						Print "'Ye fled a battle? What a shame.'"
						pay=cash/7:pop=pop-1
						Print "You lose "+pay+" silver tokens in your recklessness."
						cash=cash-pay:If cash<0 Then cash=0
						Print "You have only "+cash+" tokens now."
					EndIf
				Case "surface"
					Print ""
					Print "You say your bye to George and walk up, back into the sunlight."
					loc="Castle Loam"
					Print "You have arrived at Castle Loam."
				Case "save"
					save
					Print "Game saved."
				Case "exit","end"
					Print "Exiting game.":Delay 220
					save
					End
				Case "info"
					Print ""
					Print "You have "+cash+" silver tokens."
					Print "Your name is "+name+"."
					Print "You are "+age+" years old."
					Select gen
						Case "m"
							If age>18 Then Print "You are a man." Else Print "You are a boy."
						Case "f"
							If age>18 Then Print "You are a woman." Else Print "You are a girl."
					End Select
					Print "Your favorite color is "+clr+"."
					Print "You are "+per+"."
					Print "Your current weapon is: "+wep+"."
					Print "You are at "+loc+"."
					Print "You are a "+occ+"."
					Print "Your health is: "+hp+"/"+maxhp+"."
				Case "help":help
				Case "ork stronghold","stronghold"
					Print ""
					Print "After a long journey, you arrive at the orc stronghold."
					Print "An orc comes to attack you! And it's armed with a knife!"
					Print "'Heh heh heh, yer doomed!'"
					nme=enemy("knife ork", 10,40, 1,3, 1,3, 2,8, "knife")
					Select nme
						Case 1:Print "Good job, you slayed the ork!"
							pay=Rand(2,10)
							Print "You have gained "+pay+" tokens for having slayed the knife ork!"
							cash=cash+pay
							If occ="Ork Hunter" Then:pay=Rand(2,10)
								Print "You have been given "+pay+" tokens by George for slaying the ork."
								cash=cash+pay
							EndIf
							Print "You now have "+cash+" silver tokens."
							If Rand(0,2)=0 Then
								Print ""
								Print "The ork's knife is clearly visible."
								Print "You may take it and replace your "+wep+"."
								.taketehkn
								yn$=Input("Take the ork's knife and equip it? (y/n) ")
								Select yn
									Case "y":Print "You take the ork's knife.":wep="knife"
									Case "n":Print "You leave the knife and keep your "+wep+"."
									Default:Print "Not a valid option.":Goto taketehkn
								End Select
							EndIf
						Case 0:Print "Tough luck, the ork beat you."
							debt=cash/3
							cash=cash-debt
							Print "You lost "+debt+" tokens in your loss."
							Print "luckily for you, George saved your life."
							hp=1:pop=pop-Rand(0,2)
						Case 2:Print "You run away from the ork."
							Print ""
							If oddball
								Print "You run into some oddball on your way back to the main dungeon."
								Print "'Hey, you! We fight now!'"
								Select enemy("oddball", 12,14, 1,4, 6,8, "", 0)
									Case 0
										Print "The oddball steals nearly all your money."
										Print cash/1.4+" tokens were stolen."
										cash=cash-(cash/1.4)
										hp=1:pop=pop-1
										Print "Poor you. Literally. You now have "+cash+" tokens."
									Case 1
										Print "Excellent job.":Print "'Please! Mercy!'"
										.mercyodd
										yn$=Input("Do you show mercy and let the oddball live? (y/n) ")
										Select yn
											Case "y":Print "'Oh, thank you kind sir!'"
												Print "He gives you 20 silver tokens as thanks."
												cash=cash+20:pop=pop+3
											Case "n"
												Print "He screams as you murder him with your "+wep+"."
												pop=pop-5:oddball=False
											Default:Print "Invalid response.":Goto mercyodd
										End Select
								End Select
							Else
								Print "The ork steals a great amount of your money as you escape."
								cash=cash-(cash/1.5)
								Print "You now have "+cash+" silver tokens."
							EndIf
					End Select
			End Select
		Case "Flower Field"
			Print ""
			Print "You may travel north, south, east, or west."
			Print "A great ravine is in the north."
			Print "An orchard owned by a monk lies in the south."
			Print "Castle Loam is to the east."
			Print "An enormous desert stretches over the horizon in the west."
			whr$=Input("Which direction do you choose to go? ")
			Select whr
				Case "north","n"
				Case "south","s"
					Print "It takes a lot of sweat, but you finally get to the Monk Garden."
					loc="Monk Garden"
					Print "The monk who lives there seems to be glad to have some company."
					Select per
						Case "solo","antisocial","special"
							Print "'I think we should have a great time together.'"
							Print "The man smiles at you."
						Default:Print "'Righty then, I will get back to work now.'"
							Print "The man waddles off to his garden."
					End Select
				Case "east","e"
					Print ""
					Print "You go to Castle Loam."
					loc="Castle Loam"
				Case "west","w"
					Print "You go to the border of desert and field."
					If reddy4w Then
						Print "You trek across the desert."
						Print "It is a grueling trip and you barely make it."
						Print "You finally arrive at Skull City."
						loc="Skull City"
					Else
						Print "You are not ready to take a journey across a desert such as this."
						Print "You turn back and walk to the field."
					EndIf
				Case "help","info","save","end","exit"
					Print "Sorry, but this feature is not available in the field."
			End Select
		Case "The North"
		
		Case "Monk Garden"
			Print ""
			Print "You can check out the following things:"
			Write "study, garden, monk, field"
			Print ""
			wht$=Input("What would you like to see? ")
			Select Lower(wht)
				Case "study"
					Print ""
					Print "You walk to a small shack that the monk has next to his garden."
					Print "One you arrive inside, there lies before you a vast selection of books."
					Print "The books that stand out to you are titled:"
					Write "Gardening for Dimwits, Dragons or Dandelions"
					If per="curious" Then Write ", The Ork Stronhold" 
					If Rand(0,8)=0 Then desert=1
					If desert=1 Then Write ", Master of the Desert"
					Print ""
					book$=Input("Which book do you inspect? ")
					Print "You reach for the book."
					Select Lower(book)
						Case "gardening for dimwits","gardening","dimwits"
							Print "The book says,"
							Print ""
Print "  Gardening for Dimwits by Henry the Monk"
Print ""
Print "     The flower can be a fascinating thing. Herbs heal"
Print "and trees provide precious resources. Gardening is an"
Print "excellent way to bring all the joys of vegetation to your"
Print "own home. To plant any type of plant, you must first dig"
Print "a hole. The bigger the plant, the bigger you need to dig"
Print "the hole. Next, place the plant in the hole, then cover the"
Print "roots with soil. Water your new friend twice daily and"
Print "make sure it recieves a good amount of sunlight. I wish"
Print "for you a great garden! May the fruits of your labor be"
Print "plenty."
						Case "dragons or dandelions","dragons","dandelions"
							Print "This book looks like a good read."
							Print ""
Print "  Dragons or Dandelions by Alchemedes"
Print ""
Print "     It is often a question of great weight, asked many times"
Print "to various different people and nations. The question is,"
Print "shall we war, or keep peace? War is able to quench a desire"
Print "for action and blood that nothing else can satisfy. But with"
Print "war comes death. Peace, on the other hand, can be much less"
Print "thrilling, but has much less risk of dying involved and has a"
Print "more lasting satisfaction. Peace can be a wonderful thing for"
Print "those who wish for it, but there always is someone who wants"
Print "nothing more than to see peace lovers destroyed. So, what is"
Print "the answer? Often peacable people must resort to using violence"
Print "to win their freedom or to make a point bluntly. Howerver,"
Print "it is best to first try negotiations if one is ever found in"
Print "such a situation. Ask yourself, do you love peace, or do you"
Print "live for war?"
						Case "the ork stronghold","ork stronghold","stronghold"
							Print "You notice that this is a location in Castle Loam underground."
							Print ""
Print "  The Ork Stronghold by George Orkiller"
Print ""
Print "     For years, the orks who dwelled beneath the foundation"
Print "of Castle Loam remained undisturbed. Their culture was"
Print "disturbed when explorers came from Paradise City to get"
Print "away from the ever increasing fueds. When the Castle Loam"
Print "was constructed, the engineers got to work on a basement"
Print "of sorts. Before long, the digging crew ran into an"
Print "enormous cavern estimated to be miles in diameter. Scouts"
Print "sent down to explore the underworld never returned, aside"
Print "from the occasional scout fleeing a mysterious being"
Print "and rushing to get back to the surface. Eventually, an"
Print "agreement was made with the creatures. The two cultures"
Print "would live in peace and would not bother one another"
Print "except for messangers with urgent news. Recently, the treaty"
Print "has begun to fade away, forgotten, and orks are killed"
Print "for no reason beside pleasure alone. The orks have built"
Print "a breathtaking fortress in the Loam underground that not"
Print "a single man has ever even set foot in."
						Case "master of the desert","master","desert"
							Print "You open the book."
							Print ""
Print "  Master of the Desert by Henry the Monk"
Print ""
Print "     This book is currently incomplete."
						Default
							Print "What you gave matches no books; you exit the study."
					End Select
				Case "field"
					Print "'Goodbye, "+name+", see you another time, perhaps."
					Print "You go back to the field.":loc="Flower Field"
				Case "save"
					save
					Print "Game saved."
				Case "exit","end"
					Print "Exiting game.":Delay 220
					save
					End
				Case "info"
					Print ""
					Print "You have "+cash+" silver tokens."
					Print "Your name is "+name+"."
					Print "You are "+age+" years old."
					Select gen
						Case "m"
							If age>18 Then Print "You are a man." Else Print "You are a boy."
						Case "f"
							If age>18 Then Print "You are a woman." Else Print "You are a girl."
					End Select
					Print "Your favorite color is "+clr+"."
					Print "You are "+per+"."
					Print "Your current weapon is: "+wep+"."
					Print "You are at "+loc+"."
					Print "You are a "+occ+"."
					Print "Your health is: "+hp+"/"+maxhp+"."
				Case "help":help
			End Select
		Case "Skull City"
		Default
			Print "":Print ""
			Print "INTERNAL ERROR: NO SUCH LOCATION"
			Print Upper(loc)+" IS NOT A VALID LOCATION
			Print "":Print ""
			Input "You will now be placed in the Flower Field."
			loc="Flower Field"
	End Select
Forever


Function help()
	Print ""
	Print "Type end at any time to exit."
	Print "Type save to save your game."
	Print "Type info to find out about yourself."
	Print "Type help to display this message again."
End Function

Function enemy%(n$,ihp,ahp,ia,aa,id,ad,is,as,w$="",fled=1)
	Print ""
	ea=Rand(ia,aa):ed=Rand(id,ad):es=Rand(is,as):ehp=Rand(ihp,ahp)
	If es>spd Then turn=0 Else turn=1
	Repeat
		If turn=0
			Print n+": "+ehp+" health left"
			If w="" Then dowep=0 Else dowep=Rand(0,1)
			Select dowep
				Case 0
					dmg=Rand(ea-2,ea+1)
					If Rand(0,1)=0 Then dmg=dmg-Rand(pdef-1,pdef+1)
					If dmg<0 Then dmg=0
					If Rand(0,2)=0 Then:Print "The ork missed!":Else
						Print "The "+n+" attacks you for "+dmg+" damage.":hp=hp-dmg
					EndIf
				Case 1
					dmg=WepHit(w)*(atk/3)
					If Rand(0,2)=0 Then 
						Print "The "+n+" failed in its attempt to attack you with the "+w+"."
						dmg=Rand(2,WepHit(w)/2.5)
						Print "The "+n+" caused "+dmg+" damage to itelf."
					Else
						Print "The ork caused "+dmg+" damage to you with its "+w+"."
						hp=hp-dmg
					EndIf	
			End Select
		Else
			Print "You have "+hp+"/"+maxhp+" health."
			Print "Pick your action"
			Print "Your options are:"
			Print "flee, weapon, punch, guard"
			.attackn
			Print ""
			wht$=Input("What will you do? ")
			pdef=def
			Select Lower(wht)
				Case "flee"
					success=Rand(0,1):If success And fled=1	Then
						Return 2:Else Print "You failed to escape!"
					EndIf
				Case "punch"
					If Rand(0,4)=0 Then atk=atk+1
					Print "You attempt a punch."
					lik=es-spd:If lik<0 Then lik=0
					lik=Rand(0,lik)
					dmg=Rand(atk-1,atk+1):If dmg<0 Then dmg=0
					If lik=0 Then:ehp=ehp-dmg
						Print "You hit the "+n+" for "+dmg+" damage."
					Else:Print "You missed the "+n+"!":If Rand(0,4)=0 Then spd=spd+1
					EndIf
				Case "guard"
					If Rand(0,3)=0 Then def=def+1
					If Rand(0,2)=0 Then:pdef=def*1.6:Print "You are ready for anything now!"
					Else:pdef=pdef*1.25:Print "You dig your feet into the ground and brace yourself."
					EndIf
				Case "weapon"
					Print "You ready your "+wep+"."
					If Contains(n,"ork") And wep="Orkslayer" Then
						dmg=Rand(3,26)*(atk/2.5)
						Print "The ork recieves "+dmg+" damage."
						ehp=ehp-dmg
					Else
						If Rand(0,3)=0 Then
							Print "You missed!"
							If per="clumsy" Then dmg=Rand(1,WepHit(wep)) Else dmg=Rand(0,WepHit(wep)/2.5)
							Print "You recived "+dmg+" from the "+n+" in your clumsiness."
						Else
							dmg=WepHit(wep)*(atk/3)
							Print "You attack the enemy for "+dmg+" damage."
							ehp=ehp-dmg
						EndIf				
					EndIf
				Default:Print "Invalid action.":Goto attackn
			End Select
		EndIf	
		turn=Abs(turn-1)
		If ehp<1 Then Return 1
		If hp<1 Then
			If Rand(0,5)=0 Then:Print "The "+n+" took away your "+wep+"!"
				Print "You find a stick off the ground and equip it.":wep="stick"
			EndIf
			Return 0
		EndIf
	Forever
End Function

Function save()
	SeekFile fil,0
	WriteString fil,name
	WriteByte fil,Asc(gen)
	WriteByte fil,age
	WriteString fil,clr
	WriteString fil,per
	WriteInt fil,cash
	WriteLine fil,loc
	WriteString fil,wep
	WriteInt fil,pop
	WriteString fil,occ
	WriteShort fil,hp
	WriteShort fil,maxhp
	WriteByte fil,dun1st
	WriteShort fil,atk
	WriteShort fil,def
	WriteShort fil,spd
	WriteByte fil,oddball
	WriteByte fil,reddy4w
	WriteByte fil,desert
End Function

Function WepHit%(s$)
	Select s
		Case "stick"
			Return 0+Rand(-0,2)
		Case "sling"
			Return 1+Rand(-0,1)
		Case "dagger"
			Return 3+Rand(-1,1)
		Case "knife"
			Return 4+Rand(-1,0)
		Case "whip"
			Return 4+Rand(-2,2)
		Case "shortsword"
			Return 4+Rand(-1,2)
		Case "Orkslayer"
			Return 2+Rand(-1,5)
		Case "sword"
			Return 5+Rand(-1,3)
		Case "lance"
			Return 5+Rand(-0,3)
		Case "rapier"
			Return 7+Rand(-1,1)
		Case "broadsword"
			Return 9+Rand(-4,3)
		Case "longsword"
			Return 9+Rand(-2,3)
		Case "mace"
			Return 8+Rand(-3,4)
		Case "battleaxe"
			Return 10+Rand(-4,10)
		Case "Goldenblade"
			Return 12+Rand(-4,9)
		Case "Ultima Sword"
			Return 17+Rand(-8,12)
	End Select
End Function

Function Contains(strin$,txt$)
	For ri=1 To Len(strin)-Len(txt)
		If Mid(strin,ri,Len(txt))=txt Then Return True
	Next
	Return False
End Function


I added the monk garden although it's not finished and I added some more neat stuff to Castle Loam, such as the Ork Stronghold. Oh, one hint: the oddball is your friend. Show him mercy.

I improved the fighting system slightly and added a new job and a specialized weapon. If you go to the study in the monk's garden, there is one book that you need personality curious to know is there and another that I'll make some event to show it but I'm not sure what it'll be yet. Note that that last book I described is incomplete. I renamed the bar to tavern, to be more accurate. So far if you cross the ravine or if you go to the north you'll be stuck. I fixed a bug where you were not limited to n,s,e,w in the intro also. I did a few general tweaks here and there, and here's this. I'll let the code speak for itself.

suggestions are welcome for ways to make the beginning of the game more exciting.

I found problem. I don't know if you intended this, but every time you type "Tavern" to go to the Tavern, It pays you. So there is virtually no challenge in earning money. Just a comment.

It was intentional. It pays just low enough and just frequently enough to earn you a decent living. Become an Ork Hunter. Then you can start raking in the funds ; ) Although it might be a good idea to change that a bit.

Here's the most recent code. If your get to where you can go to the desert, don't. It's incomplete. I changed the payment for a tavern employee and finished the monk garden (at least for now). I think the beginning of the game should be a bit more fun now. I'm not sure, but I might add a job for you to be a monk later on. So far the only storyline I can think of is to rid Castle Loam of the ork underworld and to restore Skull City to its original peaceful state. And possible to rid the desert of shrews by slaying the queen shrew. I'd like to put a dragon cave in the world someplace too, but I've got no idea where. Probably in the north. I reworked the intro just a little bit also.

Please be sure to report to me any spelling mistakes, punctuation errors, and the like.

And nobody has given me any good suggestions for adding onto the game yet!

[edit]I just improved the Loam Dungeon doctor.[/edit]

;TextAge RPG
;By B3Dman

;Player stats-
;hp - hitpoints
;maxhp - maximum hitpoints
;atk - base attack damage
;def - max defense against enemy attacks
;spd - determines first attack in a battle, also helps to dodge when high.


Const filname$="save"
AppTitle "TextAge - A Text-Based RPG"
SeedRnd MilliSecs()
Global fil,cash=50,name$="",gen$="m",clr$="",age=30,per$="",loc$="Flower Field",wep$="dagger",pop=1
Global occ$="",hp=15,maxhp=15,dun1st=1,atk=2,def=0,spd=1,oddball=1,reddy4n=0,desert=0,hpacks=0

If FileType(filname+".rpg")=1 Then

	fil=OpenFile(filname+".rpg")
	name=ReadString(fil)
	gen=Chr$(ReadByte(fil))
	age=ReadByte(fil)
	clr=ReadString(fil)
	per=ReadString(fil)
	cash=ReadInt(fil)
	loc=ReadLine(fil)
	wep=ReadString(fil)
	pop=ReadInt(fil)
	occ=ReadString(fil)
	hp=ReadShort(fil)
	maxhp=ReadShort(fil)
	dun1st=ReadByte(fil)
	atk=ReadShort(fil)
	def=ReadShort(fil)
	spd=ReadShort(fil)
	oddball=ReadByte(fil)
	reddy4n=ReadByte(fil)
	desert=ReadByte(fil)
	hpacks=ReadInt(fil)
	Print "Type end at any time to exit."
	Print "Type save to save your game."
	Print "Type info to find out about yourself."
	Print "Type help to display this message again."
	Print "You currently are at "+loc+"."
	
Else

	Print "Your eyes flicker open."
	Print "You can feel your head throbbing."
	Print ""
	Print "You try to recall your name."
	.n
	name=Input("What is your name? ")
	If name<>"" And name<>" " Then name=name Else Print "Oh, comon, that's no name.":Goto n
	If name="Rich" Or name="Richard" Or name="Richie" Then cash=cash+8
	If name="Poor" Then cash=cash-2
	Print ""
	Print "You must have hit your head hard."
	Print "It even takes effort to remember if you're male or female."
	.gender
	gen=Input("Are you male(m) or female(f)? ")
	If gen<>"m" And gen<>"f" Then Print "Invalid option.":Goto gender
	Print ""
	.old
	age=Input("How old are you? ")
	If age<6 Or age>125 Then Print "Ha! Yea right. Give yourself a more sensible age.":Goto old
	Print ""
	Print "The sky above you is painted a beautiful blue."
	Print "The grass around you is a luscious green.
	Print "The flowers are wonderful shades of red, yellow, violet, and everything between."
	.clr
	clr=Input("You ponder, what color is your favorite? ")
	Select clr
		Case "red","orange","red-orange","pink","light red","flame","crimson","blood"
		Case "yellow","gold","dark yellow","tan","brown","lemon","sunlight":cash=cash+1
		Case "green","lime","olive","dark green","light green","grass","tree green","evergreen"
		Case "teal","cyan","sky","aqua","aquamarine"
		Case "blue","navy","sky blue","water","light blue","dark blue","silver","chrome":cash=cash-2
		Case "violet","indigo","purple","magenta","dark purple","dark magenta","light purple"
		Case "white","light grey","light gray","grey","gray","black"
		Default clr=""
	End Select
	If clr="" Then Print "Sorry, "+clr+" is not a recognized color.":Goto clr
	Print "An excellent choice!"
	If clr="gold" Or clr="silver" Then cash=cash+15
	If clr="blood" Or clr="crimson" Then atk=atk+1
	If clr="white" Then def=def+1
	If clr="sky blue" Or clr="light grey" Or clr="light gray" Then spd=spd+2
	If clr="green" Or clr="olive" Then def=def-1:atk=atk+1
	Print ""
	.personal
	per=Input("What would you say your personality is? ")
	Select per
		Case "angry","ashamed","mad","crazy","bashful","happy","jubilant","mellow","cool"
		Case "nerdy","geeky","maniacal","genius","smart","dumb","stupid","lame","sad"
		Case "depressed","insane","curious","cute","aware","popular","naughty","humble"
		Case "boasting","bragging","whimpy","strong","nasty","gross","mean","cruel","kind"
		Case "nice","understanding","generous","greedy","selfish","selfless","lonely","meek"
		Case "social","special","average","normal","solo","antisocial","brave","daring"
		Case "nosy","loving","caring","joyous","funny","comedic","hateful","scornful"
		Case "merciful","graceful","hungry","bored","staightforward","simple","complex"
		Case "valiant","fearless","agile","athletic","powerful","clumsy","patient","impatient"
		Default per=""
	End Select
	If per="" Print "Sorry, but that isn't a valid personality.":Goto personal
	If per="greedy" Then cash=cash+10
	If per="popular" Then cash=cash+12:pop=pop+4
	If per="cruel" Then wep="whip":atk=atk+1
	If per="stupid" Or per="dumb" Then wep="sling":pop=pop-1
	If per="merciful" Or per="strong" Then wep="sword"
	If per="strong" Or per="powerful" Then atk=atk+2
	If per="bragging" Or per="boasting" Then pop=pop+7
	If per="agile" Or per="athletic" Then wep="knife":spd=spd+1

	For newl=1 To 5
	Print ""
	Next
	Print "Your name is "+name+"."
	Print "You are of "+age+" years."
	Print "You are "+per+"."
	Print "Your favorite color is "+clr+"."
	Select gen
		Case "m"
			If age>18 Then Print "You are a man." Else Print "You are a boy."
		Case "f"
			If age>18 Then Print "You are a woman." Else Print "You are a girl."
	End Select
	Print ""
	Print "You discover a pack strapped to your side." 
	Print "In it you see a "+wep+" and "+cash+" silver tokens."
	Print ""
	Print "You decide to get up and explore your surroundings."
	Print "You are presently in a large field covered with flowers."
	If per="curious" Then
		Print "You look around you."
		Print "To the east you notice a large castle."
		Print "To the south you see an orchard and a lone house."
	EndIf
	.goway
	dir$=Input("Which direction do you choose to go? ")
	Select Lower(dir)
		Case "s","south":Print "You go south."
			Print "You sprint toward a garden in the distance."
			Print "You arrive at the garden, which is full of vegetation."
			north=3
		Case "n","north":Print "You venture north."
			north=0
			Print "You travel until you come across a deep ravine."
			Print "You can find no way across it."
			Print "Disappointed, you go back to the field."
			If north=0 Then Print "You trek back to the field.":Print "":Goto goway
		Case "w","west"
			Print "You go west for a bit until you encoounter a barren desrt."
			Print "It's no use going on from here."
			Print "You turn around and walk back to the field."
			Print ""
			Goto goway
		Case "e","east"
			Print "You walk east. The castle on the horizon begins to get nearer."
			Print "You arrive at Castle Loam."
			north=2
		Default:Print "Please choose north, south, east, or west.":Goto goway
	End Select
	If north=2 Then loc$="Castle Loam"
	If north=3 Then loc$="Monk Garden"
	Print ""
	Print "You are ready to begin your quest."
	
	fil=WriteFile(filname+".rpg")
	save
		
	.cont
	yn$=Input("Continue? (y/n) ")
	Select yn
		Case "y":Print "It is time to live life at "+loc+"!":help
		Case "n":End
		Default:Print "Invalid option.":Goto cont
	End Select

EndIf





Repeat
	Select loc
		Case "Castle Loam"
			Print ""
			Print "You may visit these places:"
			Write "armory, tavern"
			If pop>20 Then Write ", dungeon":Write ", field"
			Print ""
			whr$=Input("Where would you like to go? ")
			Select Lower(whr)
				Case "armory"
					Print ""
					Print "The owner spys you entering his establishment."
					If pop>10 Then Print "'Well if it isn't "+name+"!'"
					Print "'Ah, I see you's got a "+wep+".'"
					If pop>10 Then
						Print "'Tell me, what can I do for ye?'"
						If Not wep="shortsword" Then
							Print "'The other day, I picked up dis here beauty.'"
							Print "He shows you a shiny shortsword."
							If cash=>125 Then
								Print "'It'll cost you but 125 silvers'"
								.ss
								yn$=Input("Do you take the man's offer and buy it? (y/n) ")
								Select yn
									Case "y":Print "'It's a deal!'"
										cash=cash-125:wep="shortsword"
									Case "n":Print "'All right. If yer don't want it.'"
										Print "'But I'll save it in case ye ever change yer mind.'"
									Default:Print "'Eh? 'Scuse me? I didrn't quite get that.'":Goto ss
								End Select
							Else
								Print "'Oh, I's sorry, but I'm chargin' 125 silver tokens fer it.'"
								Print "'Ye only got "+cash+".'"
								Print "You look into your pack. You have "+cash+"."
								Print "How would he know that, you wonder."
							EndIf
						Else
							Print "He looks at his stock."
							Print "'I be sorry, but it 'pears I got nothin' t sell.'"
						EndIf
					Else
						Print "'Oh, yer new to town. Sorry, but I don sell to folk like yerself'"
					EndIf
				Case "tavern"
					Print ""
					Print "You visit the tavern."
					If pop<12 And occ="" Then
						Print "The tavern owner calls for you to meet him behind the counter."
						Print "'Well yer a mighty fine feller.'"
						Print "'How would ye like it if'n I gave you a job?"
						Print "The man looks around his tavern."
						Print "'I really need ye to work fer me.'"
						job$=Input("Accept the man's job offer? (y/n) ")
						Select job
							Case "y":Print "'Aye, thanks for accepting.'"
								pop=pop+3:occ="Tavern employee"
							Default
								Print "He doesn't seem to care what you think. You're hired anyway."
						End Select
					Else
						If occ="Tavern employee" Then
							If Rand(0,2)=0 Then
								Print "The owner walks up to you with some money in his hand."
								Print "'Lucky you, it's payday.'"
								pay=Rand(2,5)
								Print "He gives you "+pay+" silver tokens."
								cash=cash+pay
								Print "The owner goes back to the counter and offers you a menu."
							EndIf
						EndIf
						Print "You see the menu."
						Print "It says:"
						Print ""
						Print "=--------------------="
						Print "= Snakeskin Ale 6 st ="
						Print "= Pumpkin Wine 10 st ="
						Print "=--------------------="
						Print ""
						Print "You have "+cash+" silver tokens."
						Print "You may type anything but s or p to pass."
						yn$=Input("Do you buy Snakeskin Ale(s) or Pumpkin Wine(p)? ")
						Select yn
							Case "s"
								If cash=>6 Then:cash=cash-6:pop=pop+2
									Print "You purchase some Snakeskin Ale. Boy is it tasty!"
								Else
									Print "Sorry, but you haven't enough money.":yn=-1
								EndIf
							Case "p"
								If cash=>10 Then:cash=cash-10:pop=pop+4
									Print "The Pumpikin Wine tastes excellent."
								Else
									Print "Sorry, but you haven't enough money.":yn=-1
								EndIf
							Default:yn=-1
						End Select
						If occ="Tavern employee" And yn<>-1 Then 
							Print "The tavern owner looks at you and hands you some money."
							Print "'Ye know, employees get a 2 token discount.'"
							cash=cash+2
						EndIf
						Print "You have "+cash+" silver tokens."
					EndIf
				Case "save"
					save
					Print "Game saved."
				Case "exit","end"
					Print "Exiting game.":Delay 220
					save
					End
				Case "info"
					infom
				Case "help":help
				Case "dungeon"
					If pop>20 Then
						Print ""
						Print "You walk down a spiral staircase down into the gloomy depths."
						Print "You have arrived at the Loam Dungeon."
						If dun1st=1 Then
							Print "A man weilding a battleaxe strolls casually toward you."
							Print "'Ha! Ye sure do look wimpy!'"
							Print "'It must be ye first time, eh?'"
							Print "'Me name's George. Yerself?'"
							Print "You tell him your name, "+name+"."
							Select gen
								Case "m":Print "'"+n+"? That is a tough name, ain't it."
									If clr="pink" Then:Print "'Haha! Yer fav'rit color's pink!'"
									Else:Print "You wonder who told him that and promise revenge.":EndIf
								Case "f"
									If per="cruel"Then:Print"'"+n+"? Well don ye hurt me! I's friendly.'"
									Else:Print "Well I say, "+n+", you's the prettiest face I ever saw."
									EndIf
							End Select
							dun1st=0
						Else
							Print "George comes toward you."
							Print "'Greetin's, "+name+"! How's it doin' fer ye?'"
						EndIf
						Print "'Well, anyways, welcom' to th' dungeon!'"
						loc="Loam Dungeon"
					EndIf
				Case "field"
					Print "You go back to the field where you first woke up."
					Print "Confusing memories go through your head."
					loc="Flower Field"
			End Select
		Case "Loam Dungeon"
			Print ""
			Print "You may visit these places:"
			Write "ork nest, medic, surface":If pop>32 Then Write ", ork stronghold"
			Print ""
			whr$=Input("Where to? ")
			Select Lower(whr)
				Case "medic"
					Print ""
					Print "The doctor who owns the clinic comes up to you."
					Print "'Hello there, "+name+".'"
					If per="generous" Then pay=5 Else pay=8
					outofloop=0
					doctor=0
					While hp<maxhp And outofloop=0
						doctor=1
						Print "'For a measly "+pay+" silver tokens I can restore you 5 health.'"
						Print "You have "+cash+" silver tokens."
						Print "Your health is currently "+hp+"/"+maxhp+"."
						.dochealme
						yn$=Input("Accept the doctor's offer? (y/n) ")
						Select yn
							Case "y":cash=cash-pay:Print "You have been restored 5 health."
								hp=hp+5:If hp>maxhp Then hp=maxhp
								Print "Your health is now "+hp+"/"+maxhp+"."
								Print "You now have "+cash+" tokens."
							Case "n":Print "'Very well, then. I'll see you next time.'":outofloop=1
							Default:Print "Invalid response.":Goto dochealme
						End Select
					Wend
					If doctor=0 Then:Print "'You have "+hp+"/"+maxhp+" health.'"
						Print "'You're already at maximum health."
					EndIf
				Case "ork nest"
					If Rand(0,17)=0 And occ<>"Ork Hunter" And wep<>"Orkslayer" Then
						Print "George halts you from going into the nest."
						Print "'I's got's t' speak with you, "+name+".'"
						Print "'Our Ork Hunt'r has been slain an' we need a r'placement."
						.steveirwin
						Print ""
						yn$=Input("Change your job to Ork Hunter? (y/n) ")
						occ="Ork Hunter"
						Select yn
							Case "y"
								If gen="m" Then 
									Print "'Aye fellow, ye watch yerself now. Them orks'll be aft'r ye.'"
								Else
									Print "'Oh, a tough lit'le girl, just m' type!'"
									Print "The two of you share a good laugh."
								EndIf
								Print ""
								Print "George hands you a green sword."
								Print "'That there's th' Orkslayer." 
								Print "It's been weilded by every Ork Hunter t' date."
								.Orkslayr
								yn$=Input("Take the Orkslayer and trash your old weapon? (y/n) ")
								Select yn
									Case "y":Print "'That's a mighty fine choice ye made.'"
										Print "'I doubt ye'll regret it.'"
										Print "You give George your "+wep+"."
										Print "'I'll keep yer "+wep+" safe.'"
										wep="Orkslayer"
									Case "n":Print "'All right, but ye's the first t refuse.'":pop=pop+3
									Default:Print "Invalid option.":Goto Orkslayr
								End Select
							Case "n"
								Print "George looks sad."
								Print "'Well if'n ye don wan to. Ye were th' only one that came t mind.'"
							Default:Print "Invalid response.":Goto steveirwin
						End Select
					EndIf
					Print ""
					Print "You go to the ork nest."
					Print "An ork appears!"
					res=Enemy("ork", 4,8, 1,2, 0,1, 0,3)
					If res=1 Then
						Print "You beat the ork! Congratulations!"
						pay=Rand(1,8)
						Print "The ork had "+pay+" silver tokens."
						cash=cash+pay
						If occ="Ork Hunter" Then:cash=cash+2:If Rand(0,2)=0 Then pop=pop+1
						Print "For killing another ork George has paid you 2 extra tokens.":EndIf
						Print "You now have "+cash+" tokens."
					ElseIf res=0:Print "You were bested by the ork. Tough luck!"
						Print "You lost half of your tokens.":cash=cash/2
						Print "You now have "+cash+" tokens."
						hp=1
					ElseIf res=2
						Print "George looks disapointed in you."
						Print "'Ye fled a battle? What a shame.'"
						pay=cash/7:pop=pop-1
						Print "You lose "+pay+" silver tokens in your recklessness."
						cash=cash-pay:If cash<0 Then cash=0
						Print "You have only "+cash+" tokens now."
					EndIf
				Case "surface"
					Print ""
					Print "You say your bye to George and walk up, back into the sunlight."
					loc="Castle Loam"
					Print "You have arrived at Castle Loam."
				Case "save"
					save
					Print "Game saved."
				Case "exit","end"
					Print "Exiting game.":Delay 220
					save
					End
				Case "info"
					infom
				Case "help":help
				Case "ork stronghold","stronghold"
					Print ""
					Print "After a long journey, you arrive at the orc stronghold."
					Print "An orc comes to attack you! And it's armed with a knife!"
					Print "'Heh heh heh, yer doomed!'"
					nme=enemy("knife ork", 10,40, 1,3, 1,3, 2,8, "knife")
					Select nme
						Case 1:Print "Good job, you slayed the ork!"
							pay=Rand(2,10)
							Print "You have gained "+pay+" tokens for having slayed the knife ork!"
							cash=cash+pay
							pup=Rand(-3,2):If pup>0 Then
								Print"Your battle experience has given you "+pup+" additional hitpoints."
								newhp=maxhp+pup:hp=Float(hp)/Float(maxhp)*Float(newhp):maxhp=newhp
							EndIf 
							If occ="Ork Hunter" Then:pay=Rand(2,10)
								Print "You have been given "+pay+" tokens by George for slaying the ork."
								cash=cash+pay
							EndIf
							Print "You now have "+cash+" silver tokens."
							If Rand(0,2)=0 Then
								Print ""
								Print "The ork's knife is clearly visible."
								Print "You may take it and replace your "+wep+"."
								.taketehkn
								yn$=Input("Take the ork's knife and equip it? (y/n) ")
								Select yn
									Case "y":Print "You take the ork's knife.":wep="knife"
									Case "n":Print "You leave the knife and keep your "+wep+"."
									Default:Print "Not a valid option.":Goto taketehkn
								End Select
							EndIf
						Case 0:Print "Tough luck, the ork beat you."
							debt=cash/3
							cash=cash-debt
							Print "You lost "+debt+" tokens in your loss."
							Print "You now have "+cash+" silver tokens."
							Print "luckily for you, George saved your life."
							hp=1:pop=pop-Rand(0,2)
						Case 2:Print "You run away from the ork."
							Print ""
							If oddball
								Print "You run into some oddball on your way back to the main dungeon."
								Print "'Hey, you! We fight now!'"
								Select enemy("oddball", 12,14, 1,4, 6,8, "", 0)
									Case 0
										Print "The oddball steals nearly all your money."
										Print cash/1.4+" tokens were stolen."
										cash=cash-(cash/1.4)
										hp=1:pop=pop-1
										Print "Poor you. Literally. You now have "+cash+" tokens."
									Case 1
										Print "Excellent job.":Print "'Please! Mercy!'"
										.mercyodd
										yn$=Input("Do you show mercy and let the oddball live? (y/n) ")
										Select yn
											Case "y":Print "'Oh, thank you kind sir!'"
												Print "He gives you 20 silver tokens as thanks."
												cash=cash+20:pop=pop+3
											Case "n"
												Print "He screams as you murder him with your "+wep+"."
												pop=pop-5:oddball=False
											Default:Print "Invalid response.":Goto mercyodd
										End Select
								End Select
							Else
								Print "The ork steals a great amount of your money as you escape."
								cash=cash-(cash/1.5)
								Print "You now have "+cash+" silver tokens."
							EndIf
					End Select
			End Select
		Case "Flower Field"
			Print ""
			Print "You may travel north, south, east, or west."
			Print "A great ravine is in the north."
			Print "An orchard owned by a monk lies in the south."
			Print "Castle Loam is to the east."
			Print "An enormous desert stretches over the horizon in the west."
			whr$=Input("Which direction do you choose to go? ")
			Select whr
				Case "north","n"
				Case "south","s","monk","garden","monk garden"
					Print "It takes a lot of sweat, but you finally get to the Monk Garden."
					loc="Monk Garden"
					Print "The monk who lives there seems to be glad to have some company."
					Select per
						Case "solo","antisocial","special"
							Print "'I think we should have a great time together.'"
							Print "The man smiles at you."
						Default:Print "'Righty then, I will get back to work now.'"
							Print "The man waddles off to his garden."
					End Select
				Case "east","e","castle","loam","castle loam","loam castle"
					Print ""
					Print "You go to Castle Loam."
					loc="Castle Loam"
				Case "west","w","desert"
					Print "You go to the border of desert and field."
					If desert=1 Then
						Print "You trek across the desert."
						desertstorm
						Print "It is a grueling trip and you barely make it."
						Print "You finally arrive at Skull City."
						loc="Skull City"
					Else
						Print "You are not ready to take a journey across a desert such as this."
						Print "You turn back and walk to the field."
					EndIf
				Case "save"
					save
					Print "Game saved."
				Case "exit","end"
					Print "Exiting game.":Delay 220
					save
					End
				Case "info"
					infom
				Case "help":help
			End Select	
		Case "Monk Garden"
			Print ""
			Print "You can check out the following things:"
			Write "study, garden, monk, field"
			Print ""
			wht$=Input("What would you like to see? ")
			Select Lower(wht)
				Case "study"
					Print ""
					Print "You walk to a small shack that the monk has next to his garden."
					Print "One you arrive inside, there lies before you a vast selection of books."
					Print "The books that stand out to you are titled:"
					Write "Gardening for Dimwits,Dragons or Dandelions,The Ork Stronghold" 
					If desert=>1 Then Write ",Master the Desert"
					Print ""
					book$=Input("Which book do you inspect? ")
					Print "You reach for the book."
					Select Lower(book)
						Case "gardening for dimwits","gardening","dimwits"
							Print "The book says,"
							Print ""
Print "  Gardening for Dimwits by Henry the Monk"
Print ""
Print "     The flower can be a fascinating thing. Herbs heal"
Print "and trees provide precious resources. Gardening is an"
Print "excellent way to bring all the joys of vegetation to your"
Print "own home. To plant any type of plant, you must first dig"
Print "a hole. The bigger the plant, the bigger you need to dig"
Print "the hole. Next, place the plant in the hole, then cover the"
Print "roots with soil. Water your new friend twice daily and"
Print "make sure it recieves a good amount of sunlight. I wish"
Print "for you a great garden! May the fruits of your labor be"
Print "plenty."
						Case "dragons or dandelions","dragons","dandelions"
							Print "This book looks like a good read."
							Print ""
Print "  Dragons or Dandelions by Alchemedes"
Print ""
Print "     It is often a question of great weight, asked many times"
Print "to various different people and nations. The question is,"
Print "shall we war, or keep peace? War is able to quench a desire"
Print "for action and blood that nothing else can satisfy. But with"
Print "war comes death. Peace, on the other hand, can be much less"
Print "thrilling, but has much less risk of dying involved and has a"
Print "more lasting satisfaction. Peace can be a wonderful thing for"
Print "those who wish for it, but there always is someone who wants"
Print "nothing more than to see peace lovers destroyed. So, what is"
Print "the answer? Often peacable people must resort to using violence"
Print "to win their freedom or to make a point bluntly. Howerver,"
Print "it is best to first try negotiations if one is ever found in"
Print "such a situation. Ask yourself, do you love peace, or do you"
Print "live for war?"
						Case "the ork stronghold","ork stronghold","stronghold"
							Print "You notice that this is a location in Castle Loam underground."
							Print ""
Print "  The Ork Stronghold by George Orkiller"
Print ""
Print "     For years, the orks who dwelled beneath the foundation"
Print "of Castle Loam remained undisturbed. Their culture was"
Print "disturbed when explorers came from Paradise City to get"
Print "away from the ever increasing fueds. When the Castle Loam"
Print "was constructed, the engineers got to work on a basement"
Print "of sorts. Before long, the digging crew ran into an"
Print "enormous cavern estimated to be miles in diameter. Scouts"
Print "sent down to explore the underworld never returned, aside"
Print "from the occasional scout fleeing a mysterious being"
Print "and rushing to get back to the surface. Eventually, an"
Print "agreement was made with the creatures. The two cultures"
Print "would live in peace and would not bother one another"
Print "except for messangers with urgent news. Recently, the treaty"
Print "has begun to fade away, forgotten, and orks are killed"
Print "for no reason beside pleasure alone. The orks have built"
Print "a breathtaking fortress in the Loam underground that not"
Print "a single man has ever even set foot in."
						Case "master the desert","master","desert"
							If desert=>1 Then
								Print "You open the book."
								Print ""
Print "  Master the Desert by Henry the Monk"
Print ""
Print "     Have you ever wondered what lies behind the great"
Print "desert in the west? Well I shall inform you of all the"
Print "wonders, as well as the dangers, of the Shrew Desert."
Print "Before one is to traverse the desert, you must be prepared"
Print "to face packs of ferocious shrews, the occasional desert"
Print "wolf, and the thieves and robbers who make their camps"
Print "on the fringes of the desert. The Shrew Desert does hide"
Print "some ancient weapons, such as the Sandstorm, an excellent"
Print "sword wielded by a once famous warrior who died while in"
Print "Shrew Desert. And if you are to cross the desert, you will"
Print "arrive at Skull City, whose history is given in The Ork"
Print "Stronghold. Luck be with you who attempt to cross the"
Print "Shrew Desert. I hope that I have prepared you to Master"
Print "the Desert."
desert=1
							Else:Print "What you gave matches no books; you exit the study."
							EndIf
						Default
							Print "What you gave matches no books; you exit the study."
					End Select
				Case "garden"
					Print "The monk notices you coming to his garden."
					Print "'My orchard is doing quite well.'"
					If Rand(0,2)=0 Then:Print "'Would you like to by some healing herbs from me?'"
						Print "You may use healing herbs while in battle to heal some health."
						Print "You currently have "+hpacks+" heals."
						Print "You have "+cash+" tokens and the monk is charging you 15 tokens."
						.buymherb
						Select Input("Buy healing herbs from the monk? (y/n) ")
							Case "y":Print "'Very well.'":hpacks=hpacks+1
								If hpacks>100 Then:Print "You cannot carry any more healing objects."
									hpacks=100
								Else:cash=cash-15:Print "You now have "+cash+" silver tokens.":EndIf
							Case "n":Print "'If you don't want them. I'll just use them myself.'"
							Default:Print "'I'm afraid I don't know what you said.":Goto buymherb
						End Select
					EndIf
				Case "monk"
					Print "You approach the monk."
					Print "'I suppose you seek some wisdom. That I shall give you.'"
					Print ""
					Select Rand(0,14)
						Case 0:Print "'Avoid giants unless you're extremely powerful.'"
							Print "'You will likely be killed.'"
						Case 1:Print "'Ogres hate humans. Ogres kill humans.'"
							If per<>"stupid" And per<>"dumb" Then Print "'Smart humans avoid ogres.'"
						Case 2:Print "'Dragons may seem powerful, but that is not usually true.'"
							Print "'Most of the time they are extremely powerful."
						Case 3:Print "'You will always reap what you sow.'"
						Case 4:Print "'Bears are ferocious animals.'"
							Print "'But they are not that bright.'"
							If per="stupid" Or per="dumb" Or per="special" Then 
								Print "'Much like yourself.'"
							EndIf
						Case 5:Print "'Most orks are not very dangerous. Show them no fear.'"
						Case 6:Print "'Never pick roses by the stem. They have spikes.'"
						Case 7:Print "'"+Rnd(38.0,87.0)+"% of all statistics are made up on the spot.'"
						Case 8:Print "'Never say never.'"
						Case 9:Print "'It's a great shame when mighty warriors are slain.'"
						Case 10:Print "'Hm, some good advice is just on the tip of my tounge.'"
							Print "'But I just can't get it.'"
						Case 11:Print "'Loam Castle's underground dungeon can be quite dangerous.'"
						Case 12:Print "'I wish I could've seen Paradise City with my own eyes.'"
						Case 13:Print"'It's impossible to get across a desert without proper supplies.'"
							Print "'Why you'd need a full supply of water, and a lot more even!'"
							Print "'Why don't you read my book on it in the study?'"
							Print "'It's entitled Master the Desert.'"
							desert=2
						Case 14:Print "'Skull City is a terrible place to be.'"
					End Select
				Case "field"
					Print "'Goodbye, "+name+", see you another time, perhaps.'"
					Print "You go back to the field.":loc="Flower Field"
				Case "save"
					save
					Print "Game saved."
				Case "exit","end"
					Print "Exiting game.":Delay 220
					save
					End
				Case "info"
					infom
				Case "help":help
			End Select
		Case "Skull City"
		Default
			Print "":Print ""
			Print "INTERNAL ERROR: NO SUCH LOCATION"
			Print Upper(loc)+" IS NOT A VALID LOCATION
			Print "":Print ""
			Input "You will now be placed in the Flower Field."
			loc="Flower Field"
	End Select
Forever


Function help()
	Print ""
	Print "Type end at any time to exit."
	Print "Type save to save your game."
	Print "Type info to find out about yourself."
	Print "Type help to display this message again."
End Function

Function infom()
	Print ""
	Print "You have "+cash+" silver tokens."
	Print "Your name is "+name+"."
	Print "You are "+age+" years old."
	Select gen
		Case "m"
			If age>18 Then Print "You are a man." Else Print "You are a boy."
		Case "f"
			If age>18 Then Print "You are a woman." Else Print "You are a girl."
	End Select
	Print "Your favorite color is "+clr+"."
	Print "You are "+per+"."
	Print "Your current weapon is: "+wep+"."
	Print "You are at "+loc+"."
	Print "You are a "+occ+"."
	Print "Your health is: "+hp+"/"+maxhp+"."
	Print "You have "+hpacks+" heals left."
End Function

Function enemy%(n$,ihp,ahp,ia,aa,id,ad,is,as,w$="",fled=1)
	Print ""
	ea=Rand(ia,aa):ed=Rand(id,ad):es=Rand(is,as):ehp=Rand(ihp,ahp)
	If es>spd Then turn=0 Else turn=1
	Repeat
		If turn=0
			Print n+": "+ehp+" health left"
			If w="" Then dowep=0 Else dowep=Rand(0,1)
			Select dowep
				Case 0
					dmg=Rand(ea-2,ea+1)
					If Rand(0,1)=0 Then dmg=dmg-Rand(pdef-1,pdef+1)
					If dmg<0 Then dmg=0
					If Rand(0,2)=0 Then:Print "The ork missed!":Else
						Print "The "+n+" attacks you for "+dmg+" damage.":hp=hp-dmg
					EndIf
				Case 1
					dmg=WepHit(w)*(atk/3)
					If Rand(0,2)=0 Then 
						Print "The "+n+" failed in its attempt to attack you with the "+w+"."
						dmg=Rand(2,WepHit(w)/2.5)
						Print "The "+n+" missed, and in its confusion you caused it "+dmg+" damage."
						Print "The "+n+" now has "+ehp+" health."
						ehp=ehp-dmg
					Else
						Print "The ork caused "+dmg+" damage to you with its "+w+"."
						hp=hp-dmg
					EndIf	
			End Select
		Else
			Print "You have "+hp+"/"+maxhp+" health."
			Print "Pick your action"
			Print "Your options are:"
			Write "flee":If wep<>"" Then Write ", weapon"
			Write", punch, guard":If hpacks>0 Then Write ", heal"
			Print ""
			.attackn
			Print ""
			wht$=Input("What will you do? ")
			pdef=def
			Select Lower(wht)
				Case "flee"
					success=Rand(0,1):If success And fled=1	Then
						Return 2:Else Print "You failed to escape!"
					EndIf
				Case "punch"
					If Rand(0,4)=0 Then atk=atk+1
					Print "You attempt a punch."
					lik=es-spd:If lik<0 Then lik=0
					lik=Rand(0,lik)
					dmg=Rand(atk-1,atk+1):If dmg<0 Then dmg=0
					If lik=0 Then:ehp=ehp-dmg
						Print "You hit the "+n+" for "+dmg+" damage."
					Else:Print "You missed the "+n+"!":If Rand(0,4)=0 Then spd=spd+1
					EndIf
				Case "guard"
					If Rand(0,4)=0 Then def=def+1
					If Rand(0,2)=0 Then:pdef=def*1.6:Print "You are ready for anything now!"
					Else:pdef=pdef*1.25:Print "You dig your feet into the ground and brace yourself."
					EndIf
				Case "weapon"
				If wep<>""
					Print "You ready your "+wep+"."
					If Contains(n,"ork") And wep="Orkslayer" Then
						dmg=WepHit(wep)*(atk/1.8)
						Print "The ork recieves "+dmg+" damage."
						ehp=ehp-dmg
					Else
						If Rand(0,3)=0 Then
							Print "You missed!"
							If per="clumsy" dmg=Rand(1,WepHit(wep)/2.25) Else dmg=Rand(0,WepHit(wep)/2.5)
							Print "You recived "+dmg+" from the "+n+" in your clumsiness."
							Print "You now have "+hp+"/"+maxhp+" health."
							hp=hp-dmg
						Else
							dmg=WepHit(wep)*(atk/2.9)
							Print "You attack the enemy for "+dmg+" damage."
							ehp=ehp-dmg
						EndIf
					EndIf
				Else
					Print "You have no weapon equipped."
					Goto attackn
				EndIf
				Case "heal"
					If hpacks>0 Then
						hpackup=maxhp/7:If maxhp<36 Then hpackup=5
						Print "You heal yourself "+hpackup+" health."
						hp=hp+hpackup:hpacks=hpacks-1
						If Rand(0,11)=0 Then:Print "You miraculously gained an extra max hitpoint!"
							maxhp=maxhp+1:hp=hp+1
						EndIf
						Print "You now have "+hp+" health and "+hpacks+" heals left."
					EndIf
				Default:Print "Invalid action.":Goto attackn
			End Select
		EndIf	
		turn=Abs(turn-1)
		If ehp<1 Then Return 1
		If hp<1 Then
			If Rand(0,5)=0 Then:Print "The "+n+" took away your "+wep+"!"
				If Rand(0,1)=0 Then:Print "You find a stick off the ground and equip it.":wep="stick"
				Else:Print "You are now weaponless.":EndIf
			EndIf
			Return 0
		EndIf
	Forever
End Function

Function save()
	SeekFile fil,0
	WriteString fil,name
	WriteByte fil,Asc(gen)
	WriteByte fil,age
	WriteString fil,clr
	WriteString fil,per
	WriteInt fil,cash
	WriteLine fil,loc
	WriteString fil,wep
	WriteInt fil,pop
	WriteString fil,occ
	WriteShort fil,hp
	WriteShort fil,maxhp
	WriteByte fil,dun1st
	WriteShort fil,atk
	WriteShort fil,def
	WriteShort fil,spd
	WriteByte fil,oddball
	WriteByte fil,reddy4n
	WriteByte fil,desert
	WriteInt fil,hpacks
End Function

Function WepHit%(s$)
	Select s
		Case "stick"
			Return 0+Rand(-0,2)
		Case "sling"
			Return 1+Rand(-0,1)
		Case "claw"
			Return 3+Rand(-2,1)
		Case "dagger"
			Return 3+Rand(-1,1)
		Case "knife"
			Return 4+Rand(-1,0)
		Case "whip"
			Return 4+Rand(-2,2)
		Case "shortsword"
			Return 4+Rand(-1,2)
		Case "hatchet"
			Return 3+Rand(-2,3)
		Case "Orkslayer"
			Return 2+Rand(-1,5)
		Case "sword"
			Return 5+Rand(-1,3)
		Case "lance"
			Return 5+Rand(-0,3)
		Case "rapier"
			Return 7+Rand(-1,1)
		Case "broadsword"
			Return 9+Rand(-4,3)
		Case "longsword"
			Return 9+Rand(-2,3)
		Case "mace"
			Return 8+Rand(-3,4)
		Case "battleaxe"
			Return 10+Rand(-4,10)
		Case "Goldenblade"
			Return 12+Rand(-4,9)
		Case "Sandstorm"
			Return 13+Rand(-3,8)
		Case "Ultima Sword"
			Return 17+Rand(-8,12)
	End Select
End Function

Function Contains(strin$,txt$)
	For ri=1 To Len(strin)-Len(txt)
		If Mid(strin,ri,Len(txt))=txt Then Return True
	Next
	Return False
End Function

Function desertstorm()
	For shrews=1 To Rand(1,6)
		If Rand(0,1)=1 Then:Print "You encounter an angry shrew!"
			Print "There is nowhere to flee to in this fight."
			Select enemy("shrew", 8,15, 0,2, 1,5, "claw", 0)
				Case 1:Print "You kill the shrew and move on."
					If Rand(0,1)=0 Then
						pay=Rand(1,3)
						Print "You find "+pay+" tokens on the dead creature."
						cash=cash+pay
						Print "You now have "+cash+" silver tokens."
					EndIf
				Case 0:Print "A traveller to Loam Castle spots you."
					Print "He is kind enough to hual you back to Loam."
					loc="Castle Loam"
					pay=cash/4
					Print "He's greedy enough to take "+pay+" tokens from your pack."
					cash=cash-pay
					Print "You now have "+cash+" silver tokens."
			End Select
		Else
			txt$=""
			Select Rand(0,4)
				Case 0:txt="stealthily"
				Case 1:txt="easily"
				Case 2:txt="skillfully"
				Case 3:txt="barely"
				Case 4:txt="narrowly"
			End Select
			txt2$=""
			Select Rand(0,2)
				Case 0:txt2="avoid
				Case 1:txt2="prevent"
				Case 2:txt2="escape"
			End Select
			Print "You are able to "+txt+" "+txt2+" an encounter with a shrew."
		EndIf
	Next
End Function


I'm suprised at how difficult it is to restrain myself from playing instead of coding. Usually I have to play to the point where I left off coding before I continue.