Inaddition to combat actions, the player has various actions to help them to explore the dungeon.
(O)pen door. If the player is facing a door and is close enough enough, then set the door to open and re-draw the wall.
5600 K = KR + KF * Q - Q: IF PEEK (NT + K) = 2 THEN IF P(KF) > PEEK (D1 + K) AND P(KF) < PEEK (D2 + K) THEN IF ABS (P(KF - 1) - S(KF)) < 6 THEN POKE NT + K,1:IJ = 0: ON KF GOSUB 5660,5620,5680,5640: GOTO 5605
5603 GOTO 7000
Wall redrawing for door opening.
5605 LR = PEEK (NO + K):NS = KF + 1: IF NS > 3 THEN NS = NS - 4
5607 POKE NT + LR + NS * Q,1:NS = 5: GOSUB 3000: GOTO 7000
5620 XX = V2 - XB - 2
5630 I1 = 3 + IJ:YY = YB - W2 - PEEK (D2 + K):L = PEEK (D2 + K) - PEEK (D1 + K): GOSUB 120: RETURN
5640 XX = V1 - XB: GOTO 5630
5660 YY = YB - W1
5670 I1 = 1 + IJ / 2:XX = V1 - XB + PEEK (D1 + K):L = 2 * ( PEEK (D2 + K) - PEEK (D1 + K)): GOSUB 150: RETURN
5680 YY = YB - W2 - 2: GOTO 5670
(E)xamine the room for secret doors. Roll d40 and compare to intuition + 20. If roll under, then door is revealed. Even with a low intuition score, you are likely to find a door after one or two tries, probably because the game would be incredibly frustrating if the chance was low. The "cost" of searching for secret doors is the risk that wandering monsters will show up.
5700 K = KR + (KF - 1) * Q: IF PEEK (K + NT) = 3 AND RND (1) * 40 < 20 + PEEK (KB + 21) THEN POKE K + NT,2:RF(KF - 1) = 1:QX = 195:QY = 32:Q$ = "A SECRET DOOR!": GOSUB 75:IJ = - 2:LR = KR: ON KF GOSUB 5660,5620,5680,5640: GOTO 7000
5710 QX = 195:QY = 32:Q$ = "NOTHING": GOSUB 75: GOTO 7000
(G)rab treasure. Treasures are points of interest, normally hinted at in the room descriptions. The code first checks that some treasure exists and the player is close enough to it. If they are, room's treasure is cleared, the numerical id is printed, the count in the player inventory is incremented and the weight that the player is carrying is increased. All treasure has weight, but the weight of junk is normally 0. Erase the treasure from the view.
Weights are not terribly consistent.
The grab distance is the same as the trap trigger distance and there is no way to disable a trap and traps if they exactly overlap the treasure will be nearly unavoidable. These, of course, protect the best loot.
Treasures have a type that applies a normally benign effect. Type ids greater than 100 modify player stats. These treasures could be magic books or scrolls. Other non zero treasure types have other side effects activated by the switch-like statment on 5804.
5800 N = PEEK (TR + KR):QY = 32: GOSUB 15010: IF N = 0 OR ABS (XL - PEEK (XR + KR)) > 3 OR ABS (YL - PEEK (YR + KR)) > 3 THEN QX = 195:QY = 32:Q$ = "YOU CAN'T": GOSUB 75: GOTO 7000
5801 POKE TR + KR,0:QX = 195:QY = 32:Q$ = "TREASURE #" + STR$ (N): GOSUB 75: POKE KA + N - 81, PEEK (KA + N - 81) + 1:WC = WC + PEEK (TW + N):QX = 249:QY = 24: GOSUB 15000:Q$ = STR$ (WC): GOSUB 75:IN = 0
5803 GOSUB 680:I = PEEK (TS + N): IF I > 100 THEN J = KB + I - 81: POKE J, PEEK (J) + 1:J = KA + I - 197: POKE J, PEEK (J) + 1: GOTO 7000
5804 ON I + 1 GOTO 7000,5810,5815,5820,5825,5830,5835,5805,5840,5845,5846,12000
0. A good piece mundane loot from level 1.
T18 - Inside the box you find two hundred silver pieces and a diamond ring.
( Weight: 13 Type: Loot )
1. Healing Elixers. Grant the player up to 6 healing potions.
T06 - Finding nothing of value in the room you pour the milky liquid into a waterskin, just in case you happen to be dying of thirst in the desert some day (see Milky white Potion).
( Weight: 1 Type: Elixers )
5810 J = INT ( RND (6) * 6):QX = 195:QY = 112:Q$ = STR$ (J) + " ITEMS": GOSUB 15010: GOSUB 75: POKE KB + 6, PEEK (KB + 6) + J: GOTO 7000
2. Intended for some kind of Magic Shield? Seems to be unused.
5815 PS = 4:SP = SP + 1: GOTO 7000
3. Magic sword. Swords may be cursed and have a bonus between -2 and +4.
From level 1:
T15 - The sword has mithril worked into the blade, the hallmark of magical arms and armor. There are also two gold pieces on the body. ( Weight: 3 Type: Magic Weapon )
5820 QX = 195:QY = 112:Q$ = "USE SWORD?": GOSUB 75: GOSUB 500: IF L = 0 THEN 5820
5821 QY = 112: GOSUB 15010: IF C$ = "Y" THEN PB = PB + SM:SM = ( RND (1) * 4) + ( RND (1) * 4) - 4:PB = PB - SM:WM = AS * (7 + SM) + .5: IF SM > 0 THEN SM = SM - INT (2 - PEEK (KA) / 2): IF SM > 1 THEN QX = 195:QY = 112:Q$ = "IT GLOWS!": GOSUB 75
5822 IF C$ < > "Y" THEN POKE KA + N - 81, PEEK (KA + N - 81) - 1:WC = WC - PEEK (TW + N):QY = 112: GOSUB 15010
5823 GOTO 7000
4. Arrows, From level 1:
T14 - The arrows have silver points. (Weight: 1 Type: Arrows )
5825 J = INT ( RND (1) * 20): GOSUB 60: POKE KB + 13, PEEK (KB + 13) + J: GOSUB 73: GOTO 7000
5. Magic arrows. From level 1
T16 - Inside the cabinet you find arrows with mithril worked into the points.
( Weight: 0 Type: Magic Arrows)
5830 J = INT ( RND (1) * 10): GOSUB 60: POKE KB + 14, PEEK (KB + 14) + J: GOSUB 74: GOTO 7000
6. Improve Armor. A cloak from level 1
T04 - A beautiful cloak, wondrously light, yet tough as nails. ( Weight: 6 Type:Armor )
5835 POKE KA - 90,1:PA = PA + 1: GOTO 7000
7. Improved Querying. Typically magic Talismans.
A haul that includes a talisman from level 2
T07 - After jimmying the lock you find five hundred copper pieces and four hundred silver pieces as well as a porcelain talisman inscribed with mithril runes (see Magic Talisman).
( Weight: 56 Type: Increase Perception )
5805 POKE KA - 89,1: GOTO 7000
8. Protection from Undead. From level 2
T01 - After coaxing open the cabinet you find a silver candelabra, six silver trays and a bronze skull ring with mithril specks for eyes. (Weight: 15 Type: Undead Protection )
5840 POKE KA - 88,1: GOTO 7000
9. Magic boots ( broken?). From level 4:
T05 - The chest holds sixty gold pieces, fifteen small emeralds, an emerald bracelet, two diamond stickpins, two gold chains and a pair of fine leather boots with mithril embedded in the soles (see Magic Boots). ( Weight: 18 Type: Magic Boots )
5845 POKE KA - 87,1: GOTO 7000
10. Set wandering probability to 75%. Attached to certain high value items to make escape from the dungeon more difficult. From level 4, room 25:
T14 - Two large rubies. ( Weight:1 Type: Set Wandering Prob)
Treasure 14 is one of the two "epic" treasures in the game. The room it is situated in has the lengthiest description - this is, after all, the eponymous "Temple of Apshai".....
Room Twenty-five - is a large room with hieroglyphs inscribed in the dark slate walls. Stone benches occupy the western half of the room. Although much worn by wear, strange hieroglyphs and scenes showing intermingled insects and men can be seen carved in the sides and backs of the benches. Blocks of stone, hollowed out on top in the shape of bowls, protrude from the walls at irregular intervals. Ornate black metal braziers hang from the ceiling about the edges of the room. Against the east wall is a raised black marble altar, carved with glyphs that give off a faint, eerie green glow. On the altar itself is a large marble statue of a praying mantis, forelegs outstretched and mandibles open. The eyes of the mantis are great rubies - a fine treasure if you dare grab them! A human skull stares eyelessly from the steps leading to the altar. The doors to the north and south are of brass-bound oak, while the doorway to the east is covered with a worn tapestry.
The other treasure, also on level 4:
T12 - The small sack proves to be more than it appears holding ten thousand silver pieces but weighing much less than one would expect. ( Weight:31 Type: Set Wandering Prob)
5846 PW = 75: POKE KA + 2235,PW: GOTO 7000
(D)rop an item of treasure. The code uses the routine at 70 to ask for id of the treasure to drop. If this is valid and the player is carrying some of the appropriate kind, it is removed from the inventory and the player's weight is adjusted and displayed. If there isn't already a treasure in the room and the treasure being dropped is not of a special type, then place it in the room at the player position.
5850 QX = 195:QY = 112:Q$ = "DROP SOME?": GOSUB 75
5855 GOSUB 70:JJ = 10 * J: GOSUB 70:JJ = JJ + J
5860 IF J > 20 GOTO 5870
5862 I = PEEK (KA + JJ - 81): IF I < 1 GOTO 5870
5864 POKE KA + JJ - 81,I - 1:WC = WC - PEEK (TW + JJ):QY = 112: GOSUB 15010:QX = 249:QY = 24: GOSUB 15000:Q$ = STR$ (WC): GOSUB 75
5866 IF PEEK (TR + KR) = 0 AND PEEK (TS + JJ) = 0 THEN POKE TR + KR,JJ: POKE XR + KR,XL: POKE YR + KR,YL: GOSUB 680
5870 QY = 112: GOSUB 15010: GOTO 7000
(!) speak with monsters. Roll a d100; if this is lower than a third of intelligence and ego, multiplied by the monsters intelligence, then the monster ceases to be hostile. The majority of monsters in Apshai cannot be reasoned with, so this typically has a low chance of success even with high intelligence and ego stats. But it does provide another tactical option.
5900 IF RND (1) * 100 < .3 * ( PEEK (KB + 20) + PEEK (KB + 22)) * PEEK (UI + MQ) THEN IN = 1: GOTO 5910
5905 GOTO 7000
5910 QX = 195:QY = 32:Q$ = "PASS BY": GOSUB 15010: GOSUB 75: GOTO 7000
(H)ealing Salve. If the player has any, decrement the number remaining and jump to the healing code at 6110. Salves increase health by 1.
6100 IF PEEK (KB + 11) > 0 THEN POKE KB + 11, PEEK (KB + 11) - 1:J = 0: GOTO 6110
6105 GOTO 6150
6110 PC = PC + 1 + J: IF PC > PH THEN PC = PH
6130 QY = 112: GOSUB 15010:QX = 249:QY = 8:Q$ = STR$ ( INT (100 * PC / PH + .5)) + "%": GOSUB 15000: GOSUB 75: GOTO 7000
(Y)lixier. These are only found in the dungeon and increase health by 1d6+1. This shares the code above.
6140 I = KB + 6: IF PEEK (I) > 0 THEN POKE I, PEEK (I) - 1:J = RND (1) * 6 + 1: GOTO 6110
6150 QX = 195:QY = 112:Q$ = "NONE LEFT": GOSUB 15010: GOSUB 75: GOTO 5044
(Q)uery for monsters. The classic D&D "listen at doors" mechanic. We check the adjacent room that the player is facing - if it is a room ( i.e. not the dungeon exit ) and it contains a monster, we roll a d1000 and compare it to the square of intuition, plus 700 if our sense have been enhanced via a magic talisman. If we roll under the target, then the name of the monster is revealed.
6200 JJ = PEEK (KB + 21):QY = 32: GOSUB 15010:I = PEEK (NO + KR + Q * KF - Q):MQ = PEEK (MT + I): IF I = 0 OR PEEK (MN + I) = 0 OR RND (1) * 1000 > JJ * JJ + PEEK (KA - 89) * 700 THEN QX = 195:Q$ = "NOTHING": GOSUB 75: GOTO 7000
6210 GOSUB 880:QX = 195:QY = 32: GOSUB 15010:Q$ = A$: GOSUB 75: GOTO 7000
(S)earch for traps. If there is a trap, and we roll a d20 under our intuition score, then the trap is revealed. Use the subroutine at 670 to display it.
6300 IF PEEK (NP + KR) > 0 AND RND (1) * 20 < PEEK (KB + 21) THEN GOSUB 670: GOTO 7000
6310 QX = 195:QY = 32:Q$ = "NOTHING": GOSUB 15010: GOSUB 75: GOTO 7000
Comments