-+-+-+-+-+-+-+-+ START OF PART 33 -+-+-+-+-+-+-+-+ X case OMIRROR: X if (nearbymonst()) X return; X if (do_ident) X lprcat("\n\nThere is a mirror here"); X if (do_action) X omirror(); X break; X X case OBANK2: X if (nearbymonst()) X return; X if (do_ident) X lprcat("\n\nYou have found a branch office of the bank of Larn." V); X if (do_action) X prompt_enter(); X break; X X case OBANK: X if (nearbymonst()) X return; X if (do_ident) X lprcat("\n\nYou have found the bank of Larn."); X if (do_action) X prompt_enter(); X break; X X case ODEADFOUNTAIN: X if (nearbymonst()) X return; X if (do_ident) X lprcat("\n\nThere is a dead fountain here"); X break; X X case ODNDSTORE: X if (nearbymonst()) X return; X if (do_ident) X lprcat("\n\nThere is a DND store here."); X if (do_action) X prompt_enter(); X break; X X case OSTAIRSDOWN: /* down */ X if (do_ident) X lprcat("\n\nThere is a circular staircase here"); X if (do_action) X ostairs(-1); X break; X X case OOPENDOOR: X if (do_ident) X lprintf("\n\nYou have found %s", objectname`5Bi`5D); X if (do_action) X o_open_door(); X break; X X case OCLOSEDDOOR: X if (do_ident) X lprintf("\n\nYou have found %s", objectname`5Bi`5D); X if (do_action) X o_closed_door(); X break; X X case OENTRANCE: X if (do_ident) X lprcat("\nYou have found "); X lprcat(objectname`5Bi`5D); X if (do_action) X prompt_enter(); X break; X X case OVOLDOWN: X if (do_ident) X lprcat("\nYou have found "); X lprcat(objectname`5Bi`5D); X if (do_action) X prompt_volshaft(-1); X break; X X case OVOLUP: X if (do_ident) X lprcat("\nYou have found "); X lprcat(objectname`5Bi`5D); X if (do_action) X prompt_volshaft(1); X break; X X case OIVTELETRAP: X if (rnd(11) < 6) X return; X item`5Bplayerx`5D`5Bplayery`5D = OTELEPORTER; X know`5Bplayerx`5D`5Bplayery`5D = KNOWALL; X /* fall through to OTELEPORTER case below!!! */ X X case OTELEPORTER: X lprcat("\nZaaaappp! You've been teleported!\n"); X beep(); X nap(3000); X oteleport(0); X break; X X case OTRAPARROWIV: /* for an arrow trap */ X if (rnd(17) < 13) X return; X item`5Bplayerx`5D`5Bplayery`5D = OTRAPARROW; X know`5Bplayerx`5D`5Bplayery`5D = 0; X /* fall through to OTRAPARROW case below!!! */ X X case OTRAPARROW: X lprcat("\nYou are hit by an arrow"); X beep(); X lastnum = 259; X losehp(rnd(10) + level); X bottomhp(); X return; X X case OIVDARTRAP: /* for a dart trap */ X if (rnd(17) < 13) X return; X item`5Bplayerx`5D`5Bplayery`5D = ODARTRAP; X know`5Bplayerx`5D`5Bplayery`5D = 0; X /* fall through to ODARTTRAP case below!!! */ X X case ODARTRAP: X lprcat("\nYou are hit by a dart"); X beep(); /* for a dart trap */ X lastnum = 260; X losehp(rnd(5)); X if ((--c`5BSTRENGTH`5D) < 3) X c`5BSTRENGTH`5D = 3; X bottomline(); X return; X X case OIVTRAPDOOR: /* for a trap door */ X if (rnd(17) < 13) X return; X item`5Bplayerx`5D`5Bplayery`5D = OTRAPDOOR; X know`5Bplayerx`5D`5Bplayery`5D = KNOWALL; X /* fall through to OTRAPDOOR case below!!! */ X X case OTRAPDOOR: X lastnum = 272; /* a trap door */ X if ((level == MAXLEVEL - 1) `7C`7C (level == MAXLEVEL + MAXVLEVEL - V 1)) X `7B X lprcat("\nYou fell through a bottomless trap door!"); X beep(); X nap(3000); X died(271); X `7D X i = rnd(5 + level); X lprintf("\nYou fall through a trap door! You lose %d hit points.", V (long) i); X beep(); X losehp(i); X nap(2000); X newcavelevel(level + 1); X draws(0, MAXX, 0, MAXY); X bot_linex(); X return; X X case OTRADEPOST: X if (nearbymonst()) X return; X if (do_ident) X lprcat("\nYou have found the Larn trading Post."); X if (do_action) X prompt_enter(); X return; X X case OHOME: X if (nearbymonst()) X return; X if (do_ident) X lprcat("\nYou have found your way home."); X if (do_action) X prompt_enter(); X return; X X case OWALL: X break; X X case OANNIHILATION: X died(283); /* annihilated by sphere of annihilation */ X return; X X case OLRS: X if (nearbymonst()) X return; X if (do_ident) X lprcat("\n\nThere is an LRS office here."); X if (do_action) X prompt_enter(); X break; X X default: X if (do_ident) X `7B X lprintf("\n\nYou have found %s ", objectname`5Bi`5D); X switch (i) X `7B X case ODIAMOND: X case ORUBY: X case OEMERALD: X case OSAPPHIRE: X case OSPIRITSCARAB: X case OORBOFDRAGON: X case OCUBEofUNDEAD: X case ONOTHEFT: X break; X X default: X if (j > 0) X lprintf("+ %d", (long) j); X else X if (j < 0) X lprintf(" %d", (long) j); X break; X `7D X `7D X if (do_pickup) X if (take(i, j) == 0) X forget(); X if (do_action) X `7B X char tempc = 0; X X lprcat("\nDo you want to (t) take it"); X iopts(); X while (tempc != 't' && tempc != 'i' && tempc != '\33') X tempc = ttgetch(); X if (tempc == 't') X `7B X lprcat("take"); X if (take(i, j) == 0) X forget(); X return; X `7D X ignore(); X `7D X break; X `7D; X`7D X X X/* X * subroutine to process the stair cases if dir > 0 the up else down`20 X */ Xstatic ostairs(dir) X int dir; X`7B X register int k; X lprcat("\nDo you (s) stay here "); X if (dir > 0) X lprcat("or (u) go up? "); X else X lprcat("or (d) go down? "); X X while (1) X switch (ttgetch()) X `7B X case '\33': X case 's': X case 'i': X lprcat("stay here"); X return; X X case 'u': X lprcat("go up"); X act_up_stairs(); X return; X X case 'd': X lprcat("go down"); X act_down_stairs(); X return; X `7D; X`7D X X X X/* X * subroutine to handle a teleport trap +/- 1 level maximum`20 X */ Xoteleport(err) X int err; X`7B X register int tmp; X if (err) X if (rnd(151) < 3) X died(264); /* stuck in a rock */ X c`5BTELEFLAG`5D = 1; /* show ?? on bottomline if been teleported * V/ X if (level == 0) X tmp = 0; X else X if (level < MAXLEVEL) X `7B X tmp = rnd(5) + level - 3; X if (tmp >= MAXLEVEL) X tmp = MAXLEVEL - 1; X if (tmp < 1) X tmp = 1; X `7D else X `7B X tmp = rnd(3) + level - 2; X if (tmp >= MAXLEVEL + MAXVLEVEL) X tmp = MAXLEVEL + MAXVLEVEL - 1; X if (tmp < MAXLEVEL) X tmp = MAXLEVEL; X `7D X playerx = rnd(MAXX - 2); X playery = rnd(MAXY - 2); X if (level != tmp) X newcavelevel(tmp); X positionplayer(); X draws(0, MAXX, 0, MAXY); X bot_linex(); X`7D X X X/* X * function to process a potion`20 X */ Xstatic opotion(pot) X int pot; X`7B X lprcat("\nDo you (d) drink it, (t) take it"); X iopts(); X while (1) X switch (ttgetch()) X `7B X case '\33': X case 'i': X ignore(); X return; X X case 'd': X lprcat("drink\n"); X forget(); /* destroy potion */ X quaffpotion(pot, TRUE); X return; X X case 't': X lprcat("take\n"); X if (take(OPOTION, pot) == 0) X forget(); X return; X `7D; X`7D X X/* X * function to drink a potion`20 X * X * Also used to perform the action of a potion without quaffing a potion (se Ve X * invisible capability when drinking from a fountain).`20 X */ Xquaffpotion(pot, set_known) X int pot; X int set_known; X`7B X register int i, j, k; X X /* check for within bounds */ X if (pot < 0 `7C`7C pot >= MAXPOTION) X return; X X /* X * if player is to know this potion (really quaffing one), make it X * known`20 X */ X if (set_known) X potionname`5Bpot`5D`5B0`5D = ' '; X X switch (pot) X `7B X case 0: X lprcat("\nYou fall asleep. . ."); X i = rnd(11) - (c`5BCONSTITUTION`5D >> 2) + 2; X while (--i > 0) X `7B X parse2(); X nap(1000); X `7D X cursors(); X lprcat("\nYou woke up!"); X return; X X case 1: X lprcat("\nYou feel better"); X if (c`5BHP`5D == c`5BHPMAX`5D) X raisemhp(1); X else X if ((c`5BHP`5D += rnd(20) + 20 + c`5BLEVEL`5D) > c`5BHPMAX`5D) X c`5BHP`5D = c`5BHPMAX`5D; X break; X X case 2: X lprcat("\nSuddenly, you feel much more skillful!"); X raiselevel(); X raisemhp(1); X return; X X case 3: X lprcat("\nYou feel strange for a moment"); X c`5Brund(6)`5D++; X break; X X case 4: X lprcat("\nYou feel more self confident!"); X c`5BWISDOM`5D += rnd(2); X break; X X case 5: X lprcat("\nWow! You feel great!"); X if (c`5BSTRENGTH`5D < 12) X c`5BSTRENGTH`5D = 12; X else X c`5BSTRENGTH`5D++; X break; X X case 6: X lprcat("\nYour charm went up by one!"); X c`5BCHARISMA`5D++; X break; X X case 7: X lprcat("\nYou become dizzy!"); X if (--c`5BSTRENGTH`5D < 3) X c`5BSTRENGTH`5D = 3; X break; X X case 8: X lprcat("\nYour intelligence went up by one!"); X c`5BINTELLIGENCE`5D++; X break; X X case 9: X lprcat("\nYou sense the presence of objects!"); X nap(1000); X if (c`5BBLINDCOUNT`5D) X return; X for (i = 0; i < MAXY; i++) X for (j = 0; j < MAXX; j++) X switch (item`5Bj`5D`5Bi`5D) X `7B X case OPLATE: X case OCHAIN: X case OLEATHER: X case ORING: X case OSTUDLEATHER: X case OSPLINT: X case OPLATEARMOR: X case OSSPLATE: X case OSHIELD: X case OSWORDofSLASHING: X case OHAMMER: X case OSWORD: X case O2SWORD: X case OSPEAR: X case ODAGGER: X case OBATTLEAXE: X case OLONGSWORD: X case OFLAIL: X case OLANCE: X case ORINGOFEXTRA: X case OREGENRING: X case OPROTRING: X case OENERGYRING: X case ODEXRING: X case OSTRRING: X case OCLEVERRING: X case ODAMRING: X case OBELT: X case OSCROLL: X case OPOTION: X case OBOOK: X case OCHEST: X case OAMULET: X case OORBOFDRAGON: X case OSPIRITSCARAB: X case OCUBEofUNDEAD: X case ONOTHEFT: X case OCOOKIE: X know`5Bj`5D`5Bi`5D = HAVESEEN; X show1cell(j, i); X break; X `7D X showplayer(); X return; X X case 10: /* monster detection */ X lprcat("\nYou detect the presence of monsters!"); X nap(1000); X if (c`5BBLINDCOUNT`5D) X return; X for (i = 0; i < MAXY; i++) X for (j = 0; j < MAXX; j++) X if (mitem`5Bj`5D`5Bi`5D && (monstnamelist`5Bmitem`5Bj`5D`5Bi V`5D`5D != floorc)) X `7B X know`5Bj`5D`5Bi`5D = HAVESEEN; X show1cell(j, i); X `7D X return; X X case 11: X lprcat("\nYou stagger for a moment . ."); X for (i = 0; i < MAXY; i++) X for (j = 0; j < MAXX; j++) X know`5Bj`5D`5Bi`5D = 0; X nap(1000); X draws(0, MAXX, 0, MAXY); /* potion of forgetfulness */ X return; X X case 12: X lprcat("\nThis potion has no taste to it"); X return; X X case 13: X lprcat("\nYou can't see anything!"); /* blindness */ X c`5BBLINDCOUNT`5D += 500; X return; X X case 14: X lprcat("\nYou feel confused"); X c`5BCONFUSE`5D += 20 + rnd(9); X return; X X case 15: X lprcat("\nWOW!!! You feel Super-fantastic!!!"); X if (c`5BHERO`5D == 0) X for (i = 0; i < 6; i++) X c`5Bi`5D += 11; X c`5BHERO`5D += 250; X break; X X case 16: +-+-+-+-+-+-+-+- END OF PART 33 +-+-+-+-+-+-+-+-