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.
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.
;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.