-+-+-+-+-+-+-+-+ START OF PART 34 -+-+-+-+-+-+-+-+ X lprcat("\nYou have a greater intestinal constitude!"); X c`5BCONSTITUTION`5D++; X break; X X case 17: X lprcat("\nYou now have incredibly bulging muscles!!!"); X if (c`5BGIANTSTR`5D == 0) X c`5BSTREXTRA`5D += 21; X c`5BGIANTSTR`5D += 700; X break; X X case 18: X lprcat("\nYou feel a chill run up your spine!"); X c`5BFIRERESISTANCE`5D += 1000; X break; X X case 19: X lprcat("\nYou feel greedy . . ."); 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 `7B X k = item`5Bj`5D`5Bi`5D; X if ((k == ODIAMOND) `7C`7C X (k == ORUBY) `7C`7C X (k == OEMERALD) `7C`7C X (k == OMAXGOLD) `7C`7C X (k == OSAPPHIRE) `7C`7C X (k == OLARNEYE) `7C`7C X (k == OGOLDPILE)) X `7B X know`5Bj`5D`5Bi`5D = HAVESEEN; X show1cell(j, i); X `7D X `7D X showplayer(); X return; X X case 20: X c`5BHP`5D = c`5BHPMAX`5D; X break; /* instant healing */ X X case 21: X lprcat("\nYou don't seem to be affected"); X return; /* cure dianthroritis */ X X case 22: X lprcat("\nYou feel a sickness engulf you"); /* poison */ X c`5BHALFDAM`5D += 200 + rnd(200); X return; X X case 23: X lprcat("\nYou feel your vision sharpen"); /* see invisible */ X c`5BSEEINVISIBLE`5D += rnd(1000) + 400; X monstnamelist`5BINVISIBLESTALKER`5D = 'I'; X return; X `7D; X bottomline(); /* show new stats */ X return; X`7D X X X/* X * function to process a magic scroll`20 X */ Xstatic oscroll(typ) X int typ; X`7B X lprcat("\nDo you "); X if (c`5BBLINDCOUNT`5D == 0) X lprcat("(r) read it, "); X lprcat("(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 'r': X if (c`5BBLINDCOUNT`5D) X break; X lprcat("read"); X forget(); X if (typ == 2 `7C`7C typ == 15) X `7B X show1cell(playerx, playery); X cursors(); X `7D X /* destroy it */ read_scroll(typ); X return; X X case 't': X lprcat("take"); X if (take(OSCROLL, typ) == 0) X forget(); /* destroy it */ X return; X `7D; X`7D X X/* X * data for the function to read a scroll`20 X */ Xstatic int xh, yh, yl, xl; Xstatic char curse`5B`5D = `7BBLINDCOUNT, CONFUSE, AGGRAVATE, HASTEMONST, IT VCHING, X LAUGHING, DRAINSTRENGTH, CLUMSINESS, INFEEBLEMENT,`2 V0 X HALFDAM`7D; Xstatic char exten`5B`5D = `7BPROTECTIONTIME, DEXCOUNT, STRCOUNT, CHARMCOUNT V, X INVISIBILITY, CANCELLATION, HASTESELF, GLOBE, X SCAREMONST, HOLDMONST, TIMESTOP`7D; Xstatic char time_change`5B`5D = `7BHASTESELF, HERO, ALTPRO, PROTECTIONTIME, V DEXCOUNT, X STRCOUNT, GIANTSTR, CHARMCOUNT, INVISIBILITY, X CANCELLATION,HASTESELF, AGGRAVATE, SCAREMONST, X STEALTH, AWARENESS, HOLDMONST, HASTEMONST, X FIRERESISTANCE, GLOBE, SPIRITPRO, UNDEADPRO, X HALFDAM, SEEINVISIBLE, ITCHING, CLUMSINESS, WT VW`7D; X/* X * function to adjust time when time warping and taking courses in school X */ Xadjtime(tim) X register long tim; X`7B X register int j; X for (j = 0; j < 26; j++)/* adjust time related parameters */ X if (c`5Btime_change`5Bj`5D`5D) X if ((c`5Btime_change`5Bj`5D`5D -= tim) < 1) X c`5Btime_change`5Bj`5D`5D = 1; X regen(); X`7D X X/* X * function to read a scroll`20 X */ Xread_scroll(typ) X int typ; X`7B X register int i, j; X if (typ < 0 `7C`7C typ >= MAXSCROLL) X return; /* be sure we are within bounds */ X scrollname`5Btyp`5D`5B0`5D = ' '; X switch (typ) X `7B X case 0: X lprcat("\nYour armor glows for a moment"); X enchantarmor(); X return; X X case 1: X lprcat("\nYour weapon glows for a moment"); X enchweapon(); X return; /* enchant weapon */ X X case 2: X lprcat("\nYou have been granted enlightenment!"); X yh = min(playery + 7, MAXY); X xh = min(playerx + 25, MAXX); X yl = max(playery - 7, 0); X xl = max(playerx - 25, 0); X for (i = yl; i < yh; i++) X for (j = xl; j < xh; j++) X know`5Bj`5D`5Bi`5D = KNOWALL; X draws(xl, xh, yl, yh); X return; X X case 3: X lprcat("\nThis scroll seems to be blank"); X return; X X case 4: X createmonster(makemonst(level + 1)); X return; /* this one creates a monster */ X X case 5: X something(level); /* create artifact */ X return; X X case 6: X c`5BAGGRAVATE`5D += 800; X return; /* aggravate monsters */ X X case 7: X gtime += (i = rnd(1000) - 850); /* time warp */ X if (i >= 0) X lprintf("\nYou went forward in time by %d mobuls", (long) ((i + V 99) / 100)); X else X lprintf("\nYou went backward in time by %d mobuls", (long) (-(i V + 99) / 100)); X adjtime((long) i); /* adjust time for time warping */ X return; X X case 8: X oteleport(0); X return; /* teleportation */ X X case 9: X c`5BAWARENESS`5D += 1800; X return; /* expanded awareness */ X X case 10: X c`5BHASTEMONST`5D += rnd(55) + 12; X return; /* haste monster */ X X case 11: X for (i = 0; i < MAXY; i++) X for (j = 0; j < MAXX; j++) X if (mitem`5Bj`5D`5Bi`5D) X hitp`5Bj`5D`5Bi`5D = monster`5Bmitem`5Bj`5D`5Bi`5D`5D.hi Vtpoints; X return; /* monster healing */ X case 12: X c`5BSPIRITPRO`5D += 300 + rnd(200); X bottomline(); X return; /* spirit protection */ X X case 13: X c`5BUNDEADPRO`5D += 300 + rnd(200); X bottomline(); X return; /* undead protection */ X X case 14: X c`5BSTEALTH`5D += 250 + rnd(250); X bottomline(); X return; /* stealth */ X X case 15: X lprcat("\nYou have been granted enlightenment!"); /* magic mapping V */ X for (i = 0; i < MAXY; i++) X for (j = 0; j < MAXX; j++) X know`5Bj`5D`5Bi`5D = KNOWALL; X draws(0, MAXX, 0, MAXY); X return; X X case 16: X c`5BHOLDMONST`5D += 30; X bottomline(); X return; /* hold monster */ X X case 17: X for (i = 0; i < 26; i++) /* gem perfection */ X switch (iven`5Bi`5D) X `7B X case ODIAMOND: X case ORUBY: X case OEMERALD: X case OSAPPHIRE: X j = ivenarg`5Bi`5D; X j &= 255; X j <<= 1; X if (j > 255) X j = 255; /* double value */ X ivenarg`5Bi`5D = j; X break; X `7D X break; X X case 18: X for (i = 0; i < 11; i++) X c`5Bexten`5Bi`5D`5D <<= 1; /* spell extension */ X break; X X case 19: X for (i = 0; i < 26; i++) /* identify */ X `7B X if (iven`5Bi`5D == OPOTION) X potionname`5Bivenarg`5Bi`5D`5D`5B0`5D = ' '; X if (iven`5Bi`5D == OSCROLL) X scrollname`5Bivenarg`5Bi`5D`5D`5B0`5D = ' '; X `7D X break; X X case 20: X for (i = 0; i < 10; i++) /* remove curse */ X if (c`5Bcurse`5Bi`5D`5D) X c`5Bcurse`5Bi`5D`5D = 1; X break; X X case 21: X annihilate(); X break; /* scroll of annihilation */ X X case 22: X godirect(22, 150, "The ray hits the %s", 0, ' '); /* pulverization V */ X break; X case 23: X c`5BLIFEPROT`5D++; X break; /* life protection */ X `7D; X`7D X Xstatic opit() X`7B X register int i; X if (rnd(101) < 81) X if (rnd(70) > 9 * c`5BDEXTERITY`5D - packweight() `7C`7C rnd(101) < V 5) X if (level == MAXLEVEL - 1) X obottomless(); X else X if (level == MAXLEVEL + MAXVLEVEL - 1) X obottomless(); X else X `7B X if (rnd(101) < 20) X `7B X i = 0; X lprcat("\nYou fell into a pit! Your fall is cushioned b Vy an unknown force\n"); X `7D else X `7B X i = rnd(level * 3 + 3); X lprintf("\nYou fell into a pit! You suffer %d hit point Vs damage", (long) i); X lastnum = 261; /* if he dies scoreboard X * will say so */ X `7D X losehp(i); X nap(2000); X newcavelevel(level + 1); X draws(0, MAXX, 0, MAXY); X `7D X`7D X Xstatic obottomless() X`7B X lprcat("\nYou fell into a bottomless pit!"); X beep(); X nap(3000); X died(262); X`7D X Xstatic ostatue() X`7B X`7D X Xstatic omirror() X`7B X`7D X Xstatic obook() X`7B X lprcat("\nDo you "); X if (c`5BBLINDCOUNT`5D == 0) X lprcat("(r) read it, "); X lprcat("(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 'r': X if (c`5BBLINDCOUNT`5D) X break; X lprcat("read"); X /* no more book */ readbook(iarg`5Bplayerx`5D`5Bplayery`5D); X forget(); X return; X X case 't': X lprcat("take"); X if (take(OBOOK, iarg`5Bplayerx`5D`5Bplayery`5D) == 0) X forget(); /* no more book */ X return; X `7D; X`7D X X/* X * function to read a book`20 X */ Xreadbook(lev) X register int lev; X`7B X register int i, tmp; X if (lev <= 3) X i = rund((tmp = splev`5Blev`5D) ? tmp : 1); X else X i = rnd((tmp = splev`5Blev`5D - 9) ? tmp : 1) + 9; X spelknow`5Bi`5D = 1; X lprintf("\nSpell \"%s\": %s\n%s", spelcode`5Bi`5D, spelname`5Bi`5D, spe Vldescript`5Bi`5D); X if (rnd(10) == 4) X `7B X lprcat("\nYour int went up by one!"); X c`5BINTELLIGENCE`5D++; X bottomline(); X `7D X`7D X Xstatic ocookie() X`7B X char *p; X lprcat("\nDo you (e) eat 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 'e': X lprcat("eat"); X forget(); /* no more cookie */ X outfortune(); X return; X X case 't': X lprcat("take"); X if (take(OCOOKIE, 0) == 0) X forget(); /* no more book */ X return; X `7D; X`7D X X/* X * routine to pick up some gold -- if arg==OMAXGOLD then the pile is worth X * 100* the argument X */ Xstatic ogold(arg) X int arg; X`7B X register long i; X i = iarg`5Bplayerx`5D`5Bplayery`5D; X if (arg == OMAXGOLD) X i *= 100; X else X if (arg == OKGOLD) X i *= 1000; X else X if (arg == ODGOLD) X i *= 10; X lprintf("\nIt is worth %d!", (long) i); X c`5BGOLD`5D += i; X bottomgold(); X item`5Bplayerx`5D`5Bplayery`5D = know`5Bplayerx`5D`5Bplayery`5D = 0; V /* destroy gold */ X`7D X Xohome() X`7B X register int i; X nosignal = 1; /* disable signals */ X for (i = 0; i < 26; i++) X if (iven`5Bi`5D == OPOTION) X if (ivenarg`5Bi`5D == 21) X `7B X iven`5Bi`5D = 0; /* remove the potion of cure X * dianthroritis from X * inventory */ X clear(); X lprcat("Congratulations. You found a potion of cure dianthr Voritis.\n"); X lprcat("\nFrankly, No one thought you could do it. Boy! Di Vd you surprise them!\n"); X if (gtime > TIMELIMIT) X `7B X lprcat("\nThe doctor has the sad duty to inform you that V your daughter died"); X lprcat("\nbefore your return. There was nothing he coul Vd do without the potion.\n"); X nap(5000); X died(269); X `7D else X `7B X lprcat("\nThe doctor is now administering the potion, an Vd in a few moments\n"); X lprcat("your daughter should be well on her way to recov Very.\n"); X nap(6000); X lprcat("\nThe potion is"); X nap(3000); X lprcat(" working! The doctor thinks that\n"); X lprcat("your daughter will recover in a few days. Congr Vatulations!\n"); X beep(); X nap(5000); X died(263); X `7D X `7D X while (1) X `7B X clear(); X lprintf("Welcome home %s. Latest word from the doctor is not good.\ Vn", logname); X X if (gtime > TIMELIMIT) X `7B X lprcat("\nThe doctor has the sad duty to inform you that your da Vughter died!\n"); X lprcat("You didn't make it in time. There was nothing he could V do without the potion.\n"); X nap(5000); X died(269); X `7D +-+-+-+-+-+-+-+- END OF PART 34 +-+-+-+-+-+-+-+-