home *** CD-ROM | disk | FTP | other *** search
- Rem - Quest -
- Rem
- Rem By Richard!
-
- Dim Dir$(8)
-
- Dim RoomDesc$(24,3)
- Dim RoomMonster(24)
- Dim RoomExit(24,8)
- Dim RoomContent(24)
-
- Dim MonsterName$(10)
- Dim MonsterHP(10)
- Dim MonsterSpeed(10)
- Dim MonsterDamage(10)
- Dim MonsterItem(10)
-
- Dim WeaponName$(7)
- Dim WeaponPower(7)
- Dim WeaponSpeed(7)
-
- Dim LeverMsg$(5,4)
- Dim Lever(5)
- Dim Passage$(5,2)
-
- Dim passable(8)
- Dim DirOrder(8)
- Dim DirKey$(8)
-
- Dim action$(3)
-
- clear$ = ""
-
- Rem Set up to clear the top of the screen
- for t = 1 to 40*3
- clear$ = clear$ + " "
- next t
-
- Rem Read in the 8 cardinal directions
- for direction = 1 to 8
- read Dir$(direction)
- next direction
-
- Rem Read all in all of the room data from the DATA tables
- for room = 1 to 24
- read RoomDesc$(room, 1)
- read RoomDesc$(room, 2)
- read RoomDesc$(room, 3)
- read RoomMonster(room)
- for exit = 1 to 8
- read RoomExit(room, exit)
- next exit
- read RoomContent(room)
- next room
-
- Rem Read in info about the five levers
- for lev = 1 to 5
- read LeverMsg$(lev,1)
- read LeverMsg$(lev,2)
- read LeverMsg$(lev,3)
- read LeverMsg$(lev,4)
- Lever(lev) = 0
- next lev
-
- Rem Read in info on the passageways
- for pass = 1 to 5
- read Passage$(pass,1)
- read Passage$(pass,2)
- next pass
-
- Rem Read in the info for all of the monsters
- for monster = 1 to 10
- read MonsterName$(monster)
- read MonsterHP(monster)
- read MonsterSpeed(monster)
- read MonsterDamage(monster)
- read MonsterItem(monster)
- next monster
-
- Rem Finally, read in the weapon information
- for weapon = 1 to 7
- read WeaponName$(weapon)
- read WeaponPower(weapon)
- read WeaponSpeed(weapon)
- next weapon
-
- Rem read in data used in printing out the keypad
- for order = 1 to 8
- read DirOrder(order)
- next order
-
- for order = 1 to 8
- read DirKey$(order)
- next order
-
- Rem Set up text colors
- colorText = 20
- colorKey = 15
- colorHilite = 7
-
- Rem Give the introduction, if needed
- cls
- introloop:
- TextColor(colorText)
- input "Would you like an introduction (y/n)?",ans$
- if ans$<>"y" and ans$<>"n" then goto introloop
- if ans$="n" then goto skipintro
- print "You are Throg, feared goblin warrior!"
- print "A group of elves, dwarves and gnomes"
- print "have foolishly built a castle on"
- print "Goblin territory."
- print "Your chieftain has given you the"
- print "honor of removing these creatures"
- print "from Goblin lands."
- Gosub WaitForKey
- Cls
- print "Your objective is to slay the High"
- print "Elf King who is locked away inside"
- print "the castle. Improve yourself by"
- print "fighting creatures and getting"
- print "better weapons. When you"
- print "encounter a creature, numbers"
- print "will pop up on your screen - the"
- print "faster you hit them, the better"
- print "your chances of hitting."
- Gosub WaitForKey
- skipintro:
-
- Rem Generate random stats, set up player data
- str = random(15,20)
- dex = random(15,20)
- con = random(15,20)
- hp = con
- xp = 0
- level = 1
- curitem = 1
- room = 1
- dir = 0
- numactions = 1
- actiondone = 1
-
- while 1
- Gosub PrintStatus
- Rem If a move was made, print the room description and check
- Rem for a monster.
- if actiondone then
- gosub PrintRoomDescription
- If RoomMonster(room) <> 0 then
- If RoomMonster(room) < 100 then
- If random(0,5) = 1 then Gosub HandleMonster
- Else
- Gosub HandleMonster
- endif
- Endif
- Endif
-
- actiondone = 0
-
- Rem Get an action key
- a$ = ""
- while a$ = ""
- a$ = inkey$
- wend
-
- Rem is there a lever/switch/button here?
- if a$ = "u" and usable <> -1 then
- actiondone = 1
- if Lever(usable) <> 0 then
- Lever(usable) = 0
- else
- Lever(usable) = 1
- endif
- Position 0,11
- print LeverMsg$(usable,3)
- Gosub WaitForKey
- endif
-
- Rem Was this a movement key? If so, move
- if a$ >= "1" and a$ <= "9" then
- for t = 1 to 8
- if a$ = DirKey$(t) then
- if passable(DirOrder(t)) >= 0 then
- actiondone = 1
- room = passable(DirOrder(t))
- endif
- endif
- next t
- endif
- wend
- end
-
- Rem Add an action to the stringlist
- AddAction:
- action$(numactions) = add$
- numactions = numactions + 1
- return
-
- Rem Print a single direction keypad number
- PrintDirection:
- if passable(dir) >= 0 then
- TextColor(colorHilite)
- else
- TextColor(colorKey)
- endif
- print DirKey$(DirOrder(dir));" ";
- TextColor(colorText)
- if dir = 8 then print action$(1)
- if dir = 3 then print action$(2)
- if dir = 5 then print action$(3)
- if dir = 4 then print " ";
- return
-
- PrintRoomDescription:
- Rem Set up screen
- cls
- color 20
- FillRect 0,0 to 40,47
- color 10
- FillRect 41,0 to 319,47
- color 11
- FillRect 0,48 to 319,111
- color 12
- FillRect 0,112 to 319,206
- color 61
- FillRect 0,207 to 319,239
- color 14
- FillRect 0,144 to 0,160
-
- Rem Print the general room description
- Position 0,4
- TextColor(colorText)
- print RoomDesc$(room,1)
- print RoomDesc$(room,2)
- print RoomDesc$(room,3)
-
- Rem Clear out the action list string
- for t = 1 to 3
- action$(t) = ""
- next t
- numactions = 1
-
- Rem Print out the "special exits"
- for z = 1 to 8
- if RoomExit(room,z) >= 100 and RoomExit(room,z) <> 999 then
- num = int((RoomExit(room,z)/100))
- a$ = ""
- if Lever(num) <> 0 then
- a$ = Passage$(num,2)
- passable(z) = RoomExit(room,z)+1 - ((num)*100)
- else
- a$ = Passage$(num,1)
- passable(z) = -1
- endif
- a$ = a$ + " lies to the "
- if len(a$)+len(Dir$(z)) > 40 then
- print a$
- print Dir$(z)
- else
- print a$;Dir$(z)
- endif
- else
- if RoomExit(room,z) <> 999 then
- passable(z) = RoomExit(room,z)+1
- else
- passable(z) = -1
- endif
- endif
- next z
-
- Rem Print out any special levers/switches/buttons
- usable = -1
- if RoomContent(room) >= 100 then
- num = (RoomContent(room)-100)+1
- Print LeverMsg$(num,Lever(num)+1)
- add$ = " <U>se "+LeverMsg$(num,4)
- gosub AddAction
- usable = num
- endif
-
- Position 0,0
- print Clear$
- Position 0,0
- Rem Print out the keypad directions
- for z = 1 to 8
- dir = DirOrder(z)
- gosub PrintDirection
- next z
- Gosub PrintStatus
- return
-
- Rem Print the player's status
- PrintStatus:
- Position 0,13
- TextColor 20
- print "Str:";str;" Dex:";dex;" HP:";hp;"/";con;" XP:";xp;" "
- TextColor 7
- print WeaponName$(curitem);
- TextColor 20
- print "/Power:";
- TextColor 7
- print WeaponPower(curitem);
- TextColor 20
- print " Speed:";
- TextColor 7
- print WeaponSpeed(curitem);" "
- TextColor 20
- return
-
- Rem If there's a monster, handle combat
- HandleMonster:
- id = RoomMonster(room)+1
- if id >= 100 then id = id - 100
-
- mname$ = MonsterName$(id)
- mdamage = MonsterDamage(id)
- mspeed = MonsterSpeed(id)
- mhp = MonsterHP(id)
- mitem = MonsterItem(id)
- pspeed = int((dex / 4) + WeaponSpeed(curitem))
- pdamage = int(str / 4)
- ratio = pspeed / mspeed
- experience = 0
- timetohit = ratio * 650 * (id + 1)
-
- cls
- Color 101
- FillRect 0,0 to 319,239
- TextColor 7
- Print "- - Combat - -"
- Print "You see a ";mname$
- Gosub WaitForKey
-
- Rem combat loop - keep going while both the monster and the
- Rem Player have hit points
- While hp > 0 and mhp > 0
- Print "It has ";mhp;" hits, you have ";hp;" hits."
- curtimer = timer()
- sequence = 0
- go = 1
- While go
- target = Random(0,9)
- target$ = str$(target)
- Print "Press <";target$;"> "
- a$ = ""
- while a$ = ""
- a$ = inkey$
- Wend
-
- if a$ <> target$ then
- Rem The player presses the wrong key. Extra damage!
- Go = 0
- damage = random(0,mdamage) + 5
- hp = hp - damage
- Print "You mess up your maneuver -"
- Print "The ";mname$;" hits you for ";damage;" points"
- else
- Rem If the player pressed the right key, then either
- Rem the maneuever is complete or it isn't
- sequence = sequence + 1
- if sequence >= id then
- Go = 0
- timeittook = timer() - curtimer
- if timeittook > timetohit then
- Rem Player hit the keys, but not in time...
- damage = random(0,mdamage)
- hp = hp - damage
- Print "You took to long... the ";mname$;" hits for ";damage
- else
- Rem Player hit the keys within the time limit...
- damage = random(1,pdamage) + WeaponPower(curitem)
- mhp = mhp - damage
- go = 0
- Print "You HIT for ";damage;" points"
- experience = experience + id + 1
- Endif
- Endif
- Endif
- Wend
- Wend
-
- Rem Is the monster vanquished? If so, if the monster
- Rem Gad a better weapon, give it to the player. Then,
- Rem divy out the experience.
-
- if hp <= 0 then
- cls
- color 61 'Navy Intel Blue
- FillRect 0,176 to 319,239
- Position 0,11
- TextColor 7 'Sorta White
- Print "You got killed by a ";mname$;"."
- Print "You had ";xp;" experience points."
- Gosub PrintStatus
- end
- Endif
-
- if mhp <= 0 then
- Print "You vanquish the creature."
- if RoomMonster(room) >= 100 then RoomMonster(room) = 0
- if mitem > curitem then
- curitem = mitem
- Print "You pick up a handy ";WeaponName$(curitem)
- endif
- if random(0,3) = 1 then
- Print "You find a healing potion, and quaff it."
- hp = con
- endif
- Print "You gained ";experience;" experience points."
- Gosub GainExperience
-
- Rem Did the player get the king?
- if id = 10 then
- Banner "You WON!"
- end
- Endif
- Endif
-
- rem Gosub PrintStatus
- Gosub WaitForKey
- Gosub PrintRoomDescription
- Return
-
- Rem Every 40 experience points, give the player
- Rem more speed or strength, and more hit points
- GainExperience:
-
- xp = xp + experience
- if xp > level*40 then
- Rem Allow for gaining multiple levels
- for levgain = 1 to (experience/40)+1
- level = level + 1
- event = random(0,1)
- if event = 0 then
- Print "You grow stronger!"
- str = str + 2
- endif
- if event = 1 then
- Print "You get quicker!"
- dex = dex + 2
- endif
- hpadd = random(1,6)
- Print "You gain ";hpadd;" constitution points."
- hp = hp + hpadd
- con = con + hpadd
- next levgain
- endif
- return
-
- Rem Wait for a keypress
- WaitForKey:
- Print "Press <SPACE> to continue"
- While Inkey$ <> " "
- Wend
- Return
-
- Rem Directions
- data "SouthWest", "South", "SouthEast"
- data "West", "East", "NorthWest"
- data "North", "NorthEast"
-
- Rem Room Data
- Rem Room 0 - outside
- data "You are standing next to the moat"
- data "of a large castle. A trail"
- data "goes around both ways."
- data 0
- data 999,999,999,001,007,999,108,999
- data 0
- Rem Room 1 - outside
- data "You are in the southwest corner"
- data "of the castle, outside the moat."
- data "The trail goes north and east."
- data 1
- data 999,999,999,999,000,999,002,999
- data 0
- Rem Room 2 - outside
- data "You are west of the castle,"
- data "standing outside the moat."
- data "The trail goes north and south."
- data 1
- data 999,001,999,999,999,999,003,999
- data 0
- Rem Room 3 - outside
- data "You are northwest of the castle,"
- data "standing outside the moat."
- data "The trail goes south and east."
- data 2
- data 999,002,999,999,004,999,999,999
- data 0
- Rem Room 4 - outside w/ lever
- data "You are north of the castle,"
- data "near the moat. The trail"
- data "continues east and west."
- data 100
- data 999,999,999,003,005,999,999,999
- data 100
- Rem Room 5 - outside
- data "You are northeast of the castle,"
- data "near a moat. The trail goes"
- data "on to the west and south."
- data 1
- data 999,006,999,004,999,999,999,999
- data 0
- Rem Room 6 - outside
- data "You are east of the castle."
- data "A moat is nearby. The trail"
- data "goes north and south."
- data 2
- data 999,007,999,999,999,999,005,999
- data 0
- Rem Room 7 - outside
- data "You are southeast of the"
- data "castle. The trail goes"
- data "to the west and north."
- data 1
- data 999,999,999,000,999,999,006,999
- data 0
- Rem Room 8 - Castle Entrance
- data "You are in the entrance"
- data "to the castle. Hallways"
- data "go north and northeast."
- data 2
- data 999,100,999,999,999,999,012,013
- data 0
- Rem Room 9 - Castle Alcove
- data "You are in a small,"
- data "dimly-lit room. A door"
- data "goes out to the north."
- data 3
- data 999,999,999,999,999,999,013,999
- data 0
- Rem Room 10 - Corridor
- data "This dark, stone corridor"
- data "goes to a door to the east."
- data "The courtyard is north."
- data 2
- data 999,999,999,999,011,999,014,999
- data 0
- Rem Room 11 - Kitchen
- data "This kitchen is filled with"
- data "knives and pieces of meat."
- data "There's a door to the west."
- data 101
- data 999,999,999,010,999,999,999,999
- data 101
- Rem Room 12 - Courtyard
- data "This is a bright green courtyard"
- data "with grass and flowers. Trails"
- data "go north, south and east."
- data 2
- data 999,008,999,999,013,999,016,999
- data 0
- Rem Room 13 - Courtyard
- data "This is a courtyard, with bushes cut"
- data "in the shapes of animals. Paths go"
- data "west, southwest, south and east."
- data 3
- data 008,009,999,012,014,999,999,999
- data 0
- Rem Room 14 - Gazebo
- data "This white gazebo has trails going off"
- data "in many directions. Trails go west,"
- data "south, east, north and northeast."
- data 2
- data 999,010,999,013,015,999,018,019
- data 0
- Rem Room 15 - Dining Room
- data "This dining room contains wooden"
- data "tables and chairs. A doorway"
- data "west goes back to the courtyard."
- data 4
- data 999,999,999,014,999,999,999,999
- data 0
- Rem Room 16 - Courtyard
- data "Wind blows through the trees"
- data "surrounding this courtyard path."
- data "The path winds south and east."
- data 2
- data 999,012,999,999,017,999,999,999
- data 0
- Rem Room 17 - Courtyard
- data "Shrubs and bushes line the path"
- data "through the courtyard. The"
- data "path continues east and west."
- data 2
- data 999,999,999,016,018,220,999,999
- data 0
- Rem Room 18 - Courtyard
- data "You are at a corner in the"
- data "courtyard in the middle of the"
- data "castle. You can go south and west."
- data 2
- data 999,014,999,017,999,999,999,999
- data 0
- Rem Room 19 - Hallway
- data "Empty suits of armor line this"
- data "passageway deeper into the"
- data "castle. A hall goes southwest."
- data 5
- data 014,999,999,999,999,999,323,999
- data 0
- Rem Room 20 - Prison Chamber
- data "This is a dimly lit prison room."
- data "In the flickering torchlight you"
- data "observe a number of empty cells."
- data 106
- data 999,999,217,999,421,999,999,999
- data 102
- Rem Room 21 - Treasure Vault
- data "This is the treasure vault. Gems,"
- data "gold and other precious objects"
- data "line the walls and floor."
- data 108
- data 999,999,999,420,999,999,999,999
- data 104
- Rem Room 22 - Throne Room
- data "This is a large throne room. A large"
- data "throne chair dominates the center of"
- data "the room."
- data 109
- data 999,999,999,999,523,999,999,999
- data 0
- Rem Room 23 - Guard Room
- data "This is the guard room. Racks of"
- data "weapons, bows and arrows line the"
- data "walls."
- data 107
- data 999,319,999,522,999,999,999,999
- data 103
-
- Rem Lever messages
- data "There's a lever next to the moat."
- data "There's a pulled lever next to the moat."
- data "You pull the lever."
- data "the lever"
- data "There's a blue switch on the wall."
- data "There's a thrown blue switch on the wall"
- data "You throw the switch."
- data "the switch"
- data "There's a cord hanging from the ceiling."
- data "There's a cord hanging low from the ceiling."
- data "You pull the cord... you hear a noise."
- data "the cord"
- data "An iron wheel is mounted to a wall."
- data "An iron wheel sits loosely on the wall."
- data "You turn the iron wheel."
- data "the iron wheel"
- data "A jewel is mounted to a control panel."
- data "A glowing jewel is mounted to a control panel."
- data "You touch the jewel."
- data "the jewel"
-
- Rem Passageway messages
- data "An upright drawbridge"
- data "A drawbridge"
- data "A locked stairway door"
- data "An open stairway door"
- data "A closed portcullis"
- data "An open portcullis"
- data "A closed vault "
- data "An open vault "
- data "A shimmering barrier"
- data "An open walkway"
-
- Rem Monster data
- data "Guard Dog"
- data 1,1,1,0
- data "Hungry Wolf"
- data 5,2,2,0
- data "Gnome Guard"
- data 10,3,5,1
- data "Dwarven Warrior"
- data 15,4,8,2
- data "Elven Archer"
- data 25,5,10,3
- data "Gnome Butcher"
- data 40,7,14,4
- data "Dwarf Dungeonmaster"
- data 50,9,20,5
- data "Elven Executioner"
- data 70,12,25,6
- data "Elven Ninja"
- data 100,15,30,7
- data "High Elf King"
- data 150,20,40,0
-
- Rem Weapons
- data "Dagger"
- data 1,1
- data "Mace"
- data 3,4
- data "Broadsword"
- data 4,4
- data "Morning Star"
- data 6,4
- data "Battle Axe"
- data 8,5
- data "Two-Handed Sword"
- data 10,6
- data "Mystic Sword"
- data 12,12
-
- Rem Direction Order
- data 6,7,8,4,5,1,2,3
- data "7","8","9","4","6","1","2","3"