Kron by Scimitar Products22nd Apr 2005 0:19
|
---|
Summary Text based game demo. Description *Text Based Demo game I'm making. So far, eveything in the begining is included. You'll know what I'm talking about. Now there is media. (*has been discontinued) Code ` This code was downloaded from The Game Creators ` It is reproduced here with full permission ` http://www.thegamecreators.com remstart This so far is just a demo, so naturally there are a 'few' bugs. Like You have to buy the Tent BEFORE the sword. There are a few 'secrets' which you can find out on your own, or simply look at the code. Have fun, but don't steal the complete game design! remend rem Title ink 25,25 set text size 200 load bitmap "Kron.bmp" wait 3000 set text size 150 rem Info cls 1000 input "Name? ";name$ input "Gender? (male/female) ";gender$ if gender$="male" then oppgen$="female" if gender$="female" then oppgen$="male" money#=100 yhealth#=100 itemclothes$="Traveler Garb" itema$="Watch" cls 1000 rem Game set cursor 130,10 print "KRON, the first complete DarkBasic Text-Based Fantsy game." set cursor 200,50 print "New game. Type [begin] to begin." set cursor 200,65 input "";answer$ if answer$="Secrets!" then gosub Secrets cls 1000 print "Would you like to read the [back story], or [continue]?" input "Read if this is your first time playing. ";answer$ if answer$="back story" then BackStory() : cls 1000 : goto Nicra1 Nicra1: cls 1000 set cursor 250,10 print "Nicra, Aseria" wait 3000 print "The smell of the market draws near." print "You, ";name$;", where traveling to the market, to get somthing...?" wait 2000 print "Ahhh, yes. You were looking for a tent for your travels." wait 1500 repeat NicraTent: print "There a several [stalls] to your left, or you can check the [stores] to your right." print "Type [Inventory] to view inventory. [Leave]?" input "";answer$ if answer$="Inventory" then gosub Inventory if answer$="stalls" then gosub NicraStalls if answer$="stores" then gosub NicraShops until answer$="Leave" cls 1000 if keyitemsa$="" print "You still need a Tent!" goto NicraTent endif repeat print "Where will you go to? [Market]? [Port]? [Homes]?" input "";answer$ if answer$="Market" then goto NicraTent if answer$="Port" then gosub NicraPort if answer$="Homes" then gosub NicraHomes until attemptedmurder#=1 end rem Programs function BackStory() print "The history of Aseria is hazey, littered with wars and strife." print "Though there were many wars, there is only one the people" print "remember: ''The House Wars''. ''The House Wars'' involed" print "the Great Houses Jurian, Kronus, and Whitek." print "the legends tell of a hero, who rose up, and lead" print "a Great House to victory over the others." print "Are you that hero, or are you the villian?" print "Or are you insignifigant? Fate is at hand. What will you do?" wait 15000 endfunction rem Branches `Nicra NicraStalls: repeat print "You take a left turn, and come into the bazzars and stalls of the market." print "There are three stalls of note : [Armory] Surrplus, Essential [Camp] Gear," print "and [Items] Galore! [Go] back?" input "";answer$ if answer$="Armory" then gosub NicraStallsArmory if answer$="Camp" then gosub NicraStallsCamp if answer$="Items" then gosub NicraStallsItems until answer$="Go" cls 1000 return `Armory NicraStallsArmory: if NicraVisitOtherStallsArmory# > 0 print "''I hear you're name's ";NicraNameGiven$;".''" NicraArmoyVisit# = NicraArmoyVisit# + 1 NicraVisitOtherStallsArmory# = NicraVisitOtherStallsArmory# - 1 gosub NicraStallsArmorySkip goto NicraStalls: else NicraVisitOtherStallsCamp# = NicraVisitOtherStallsCamp# + 1 NicraVisitOtherStallsItems# = NicraVisitOtherStallsItems# + 1 endif if NicraArmoyVisit# > 0 print "''Welcome, ";NicraNameGiven$;". What takes your fancy?''" endif if NicraArmoyVisit# = 0 NicraArmoyVisit# = NicraArmoyVisit# + 1 print "As you enter the open stall, a man rumbles up to you and says ''Greetens, errr... Customer!''" wait 2000 input "You say ''The name's ";NicraNameGiven$ wait 200 print "''Great name, ";NicraNameGiven$;". What takes you fancy?''" endif NicraStallsArmorySkip: input "[Sword]40 [Dagger]10 [Plate]30 ";armoryanswer$ if armoryanswer$="Sword" then price#=40 : valueweapon# = price# / 2 if armoryanswer$="Dagger" then price#=10 : valueweapon# = price# / 2 if armoryanswer$="Plate" then price#=30 : valuearmor# = price# / 2 if money# < price# then print "Not enough money." : return if armoryanswer$="Sword" then gosub NicraStallsArmoryBuySword if armoryanswer$="Dagger" then gosub NicraStallsArmoryBuyDagger if armoryanswer$="Plate" then gosub NicraStallsArmoryBuyPlate wait 500 print "You bought ";armoryanswer$;"." wait 1000 cls 1000 return NicraStallsArmoryBuySword: if money# > price# money# = money# - price# weapon$="Sword" endif return NicraStallsArmoryBuyDagger: if money# > price# money# = money# - price# weapon$="Dagger" endif return NicraStallsArmoryBuyPlate: if money# > price# money# = money# - price# armor$="Plate" endif return `Camp NicraStallsCamp: if NicraVisitOtherStallsCamp# > 0 print "''I hear you're name's ";NicraNameGiven$;".''" NicraCampVisit# = NicraCampVisit# + 1 NicraVisitOtherStallsCamp# = NicraVisitOtherStallsCamp# - 1 gosub NicraStallsCampSkip goto NicraStalls else NicraVisitOtherStallsArmory# = NicraVisitOtherStallsArmory# + 1 NicraVisitOtherStallsItems# = NicraVisitOtherStallsItems# + 1 endif if NicraCampVisit# > 0 print "''Welcome, ";NicraNameGiven$;". What takes your fancy?''" endif if NicraCampVisit# = 0 NicraCampVisit# = NicraCampVisit# + 1 print "As you enter the open stall, a man pops up and says ''Greetings, Customer.''" wait 2000 input "You say ''The name's ";NicraNameGiven$ wait 200 print "''Great name, ";NicraNameGiven$;". What takes you fancy?''" endif NicraStallsCampSkip: input "[Tent]60 [Lantern]10 [Medic] Kit 30 ";campanswer$ if campanswer$="Tent" then price#=60 if campanswer$="Lantern" then price#=10 : valueiteml# = price# / 2 if campanswer$="Medic" then price#=30 : valueitemh# = price# / 2 if money# < price# then print "Not enough money." : return if campanswer$="Tent" then gosub NicraStallsCampBuyTent if campanswer$="Lantern" then gosub NicraStallsCampBuyLantern if campanswer$="Medic" then gosub NicraStallsCampBuyMedic wait 500 print "You bought ";campanswer$;"." wait 1000 cls 1000 return NicraStallsCampBuyTent: if money# > price# money# = money# - price# keyitemsa$="Tent" endif return NicraStallsCampBuyLantern: if money# > price# money# = money# - price# iteml$="Lantern" endif return NicraStallsCampBuyMedic: if money# > price# money# = money# - price# itemh$="Medic" endif return `Items NicraStallsItems: if NicraVisitOtherStallsItems# > 0 print "''I hear you're name's ";NicraNameGiven$;".''" NicraItemsVisit# = NicraItemsVisit# + 1 NicraVisitOtherStallsItems# = NicraVisitOtherStallsItems# - 1 gosub NicraStallsItemsSkip goto NicraStalls else NicraVisitOtherStallsArmory# = NicraVisitOtherStallsArmory# + 1 NicraVisitOtherStallsCamp# = NicraVisitOtherStallsCamp# + 1 endif if NicraItemsVisit# > 0 print "''Welcome, ";NicraNameGiven$;". What takes your fancy?''" endif if NicraItemsVisit# = 0 print "As you enter the closed stall, a man approches you and says ''Greetings, Customer," print "I have what you want.''" wait 2000 input "You say ''The name's ";NicraNameGiven$ wait 200 print "''Great name, ";NicraNameGiven$;". What takes you fancy?''" endif NicraStallsItemsSkip: input "[Ring]40 [Lantern]10 [Medic] Kit 30 ";itemsanswer$ if itemsanswer$="Ring" then price#=40 : valuewealthitem# = price# / 2 if itemsanswer$="Lantern" then price#=10 : valueiteml# = price# / 2 if itemsanswer$="Medic" then price#=30 : valueitemh# = price# / 2 if money# < price# then print "Not enough money." : return if itemsanswer$="Ring" then gosub NicraStallsItemsBuyRing if itemsanswer$="Lantern" then gosub NicraStallsItemsBuyLantern if itemsanswer$="Medic" then gosub NicraStallsItemsBuyMedic wait 500 print "You bought ";itemsanswer$;"." wait 1000 cls 1000 return NicraStallsItemsBuyRing: if money# > price# money# = money# - price# wealthitema$="Ring" endif return NicraStallsItemsBuyLantern: if money# > price# money# = money# - price# iteml$="Lantern" endif return NicraStallsItemsBuyMedic: if money# > price# money# = money# - price# itemh$="Medic" endif return `Nicra Shops NicraShops: do print "You make a right turn into a cluster of shops. You see We [Buy]," print "You Sell, and, Items [R'Us]. Leave?" input "";answer$ if answer$="Buy" then gosub NicraShopsBuy if answer$="R'Us" then gosub NicraShopsRUs if answer$="Leave" then return loop NicraShopsBuy: print "''Greetings! What do you have for sale? [Weapon], [Armor]?''" input "";buyanswer$ if buyanswer$="Weapon" buyanswer$=weapon$ gosub NicraShopsBuyWeapon endif if buyanswer$="Armor" buyanswer$=armor$ gosub NicraShopsBuyArmor else print "Do not have armor or weapon." endif return NicraShopsBuyWeapon: weapon$="" print "";money#;"+";valueweapon#;"=" money# = money# + valueweapon# print "";money#;"" wait 1000 cls 1000 return NicraShopsBuyArmor: Armor$="" print "";money#;"+";valuearmor#;"=" money# = money# + valuearmor# print "";money#;"" wait 1000 cls 1000 return NicraShopsRUs: print "''Welcome, what can I do for you?''" print "[Torch]10, [Potion]10?" input "";rusanswer$ if rusanswer$="Torch" then price#=10 : valueiteml# = price# / 2 if rusanswer$="Potion" then price#=10 : valueiteml# = price# / 2 if money# < price# then print "Not engough money." if rusanswer$="Torch" then gosub NicraShopsRUsTorch if rusanswer$="Potion" then gosub NicraShopsRUsPotion wait 300 cls 1000 return NicraShopsRUsTorch: money# = money# - price# iteml$="Torch" return NicraShopsRUsPotion: money# = money# - price# itemh$="Potion" return `Nicra Places NicraPort: cls 1000 return NicraHomes: cls 1000 if money#>40 print "As you step into the residential area, a man bumps into you." print "''Ouch!'' he says as he collides with you. ''Sorry 'bout 'dat.'' And he gathers up his stuff." print "The man retreats down an alley and disappers." wait 1000 cls 1000 mugger#=1 endif if mugger#=1 money#=0 print "Wait a sec'...! You've been mugged!" endif repeat print "There are several [alleys] to your left, and the [houses] to your right. [Leave]?" input "";answer$ if answer$="alleys" then gosub NicraHomesAlleys if answer$="houses" then gosub NicraHomesHouses until answer$="Leave" return NicraHomesAlleys: do print "A dank alley is directly ahead. [Leave]?" input "";answer$ if answer$="Leave" then return loop NicraHomesHouses: do print "You see several [large] houses, and a few [small]er ones in the distance. [Leave]?" input "";answer$ if answer$="large" then gosub NicraHomesHousesLarge if answer$="small" then gosub NicraHomesHousesSmall if answer$="Leave" then return loop NicraHomesHousesLarge: return NicraHomesHousesSmall: return `Weapons BattleItems: if weapon$="LightSword" damage#=100 endif if weapon$="Sword" damage#=10 endif if weapon$="Dagger" damage#=5 endif return if armor$="Plate" armor#=10 endif return `Battle Battle: if battle#=1 print "";Eheatlh#;"-";damage#;"="; Ehealth# = Ehealth# - damage# print "";Ehealth;"" endif if battle#=1 print "";Yheatlh#;"+";armor#;"="; Yhealth# = Yhealth# + armor# print "";Yhealth;"" endif return `Inventory Inventory: print "Type [Exit] to leave." print "Money: ";money# print "";itemclothes$ print "";itema$ print "";itemb$ print "";itemc$ print "";itemh$ print "";iteml$ print "";weapon$ print "";wealthitema$ print "";armor$ print "";keyitemsa$ print "";keyitemsb$ print "";keyitemsc$ input "";answer$ if answer$="Watch" then print "TIME:";get time$() if answer$="Exit" cls 1000 return else goto Inventory endif `Secrets Secrets: cls 1000 repeat print "Type [End] to leave." input "";password$ if password$="NicraEnter" then goto Nicra1 if password$="AllIsCool" then weapon$="LightSword" if password$="PING!!!" then yhealth#= yhealth + 99999999 cls 1000 until password$="End" return |