-+-+-+-+-+-+-+-+ START OF PART 27 -+-+-+-+-+-+-+-+ Xstatic char nobjtab`5B`5D = `7B 0, OSCROLL, OSCROLL, OSCROLL, OSCROLL, OP VOTION, X OPOTION, OPOTION, OPOTION, OGOLDPILE, OGOLDPILE, OGOLDPILE, OGOLDPILE, X OBOOK, OBOOK, OBOOK, OBOOK, ODAGGER, ODAGGER, ODAGGER, OLEATHER, OLEATHE VR, X OLEATHER, OREGENRING, OPROTRING, OENERGYRING, ODEXRING, OSTRRING, OSPEAR V, X OBELT, ORING, OSTUDLEATHER, OSHIELD, OCOOKIE, OFLAIL, OCHAIN, OBATTLEAXE V, X OSPLINT, O2SWORD, OCLEVERRING, OPLATE, OLONGSWORD `7D; X Xnewobject(lev,i) X register int lev,*i; X `7B X register int tmp=33,j; X if (level<0 `7C`7C level>MAXLEVEL+MAXVLEVEL) return(0); /* correct level V? */ X if (lev>6) tmp=41; else if (lev>4) tmp=39; X j = nobjtab`5Btmp=rnd(tmp)`5D; /* the object type */ X switch(tmp) X `7B X case 1: case 2: case 3: case 4: /* scroll */ X *i=newscroll(); break; X case 5: case 6: case 7: case 8: /* potion */ X *i=newpotion(); break; X case 9: case 10: case 11: case 12: /* gold */ X *i=rnd((lev+1)*10)+lev*10+10; break; X case 13: case 14: case 15: case 16: /* book */ X *i=lev; break; X case 17: case 18: case 19: /* dagger */ X if (!(*i=newdagger())) return(0); break; X case 20: case 21: case 22: /* leather armor */ X if (!(*i=newleather())) return(0); break; X case 23: case 32: case 38: /* regen ring, shield, 2-hand sword */ X *i=rund(lev/3+1); break; X case 24: case 26: /* prot ring, dexterity ring */ X *i=rnd(lev/4+1); break; X case 25: /* energy ring */ X *i=rund(lev/4+1); break; X case 27: case 39: /* strength ring, cleverness ring */ X *i=rnd(lev/2+1); break; X case 30: case 34: /* ring mail, flail */ X *i=rund(lev/2+1); break; X case 28: case 36: /* spear, battleaxe */ X *i=rund(lev/3+1); if (*i==0) return(0); break; X case 29: case 31: case 37: /* belt, studded leather, splint */ X *i=rund(lev/2+1); if (*i==0) return(0); break; X case 33: /* fortune cookie */ X *i=0; break; X case 35: /* chain mail */ X *i=newchain(); break; X case 40: /* plate mail */ X *i=newplate(); break; X case 41: /* longsword */ X *i=newsword(); break; X `7D X return(j); X `7D X X/* X * spattack(atckno,xx,yy) Function to process special attacks from monster Vs X * int atckno,xx,yy; X * X * Enter with the special attack number, and the coordinates (xx,yy) X * of the monster that is special attacking X * Returns 1 if must do a show1cell(xx,yy) upon return, 0 otherwise X * X * atckno monster effect X * --------------------------------------------------- X * 0 none X * 1 rust monster eat armor X * 2 hell hound breathe light fire X * 3 dragon breathe fire X * 4 giant centipede weakening sing X * 5 white dragon cold breath X * 6 wraith drain level X * 7 waterlord water gusher X * 8 leprechaun steal gold X * 9 disenchantress disenchant weapon or armor X * 10 ice lizard hits with barbed tail X * 11 umber hulk confusion X * 12 spirit naga cast spells taken from special attacks X * 13 platinum dragon psionics X * 14 nymph steal objects X * 15 bugbear bite X * 16 osequip bite X * X * char rustarm`5BARMORTYPES`5D`5B2`5D; X * special array for maximum rust damage to armor from rustmonster X * format is: `7B armor type , minimum attribute`20 X */ X#define ARMORTYPES 6 X#if __STDC__ Xstatic signed char rustarm`5BARMORTYPES`5D`5B2`5D = X#else Xstatic char rustarm`5BARMORTYPES`5D`5B2`5D = X#endif X `7B OSTUDLEATHER,-2, ORING, -4, X OCHAIN, -5, OSPLINT, -6, X OPLATE, -8, OPLATEARMOR,-9 `7D; Xstatic char spsel`5B`5D = `7B 1, 2, 3, 5, 6, 8, 9, 11, 13, 14 `7D; Xstatic spattack(x,xx,yy) X int x,xx,yy; X `7B X extern char lastmonst`5B`5D ; X register int i,j=0,k,m; X register char *p=0; X if (c`5BCANCELLATION`5D) return(0); X vxy(&xx,&yy); /* verify x & y coordinates */ X switch(x) X `7B X case 1: /* rust your armor, j=1 when rusting has occurred */ X m = k = c`5BWEAR`5D; X if ((i=c`5BSHIELD`5D) != -1) X if (--ivenarg`5Bi`5D < -1) ivenarg`5Bi`5D= -1; else j=1; X if ((j==0) && (k != -1)) X `7B X m = iven`5Bk`5D; X for (i=0; i3) X `7B X p="\nThe %s stung you! You feel weaker"; beep(); X --c`5BSTRENGTH`5D; X `7D X else p="\nThe %s stung you!"; X break; X X case 5: p="\nThe %s blasts you with his cold breath"; X i = rnd(15)+18-c`5BAC`5D; goto spout2; X X case 6: lprintf("\nThe %s drains you of your life energy!",lastm Vonst); X loselevel(); beep(); return(0); X X case 7: p="\nThe %s got you with a gusher!"; X i = rnd(15)+25-c`5BAC`5D; goto spout2; X X case 8: if (c`5BNOTHEFT`5D) return(0); /* he has a device of no V theft */ X if (c`5BGOLD`5D) X `7B X p="\nThe %s hit you -- Your purse feels lighter"; X if (c`5BGOLD`5D>32767) c`5BGOLD`5D>>=1; X else c`5BGOLD`5D -= rnd((int)(1+(c`5BGOLD`5D>>1) V)); X if (c`5BGOLD`5D < 0) c`5BGOLD`5D=0; X `7D X else p="\nThe %s couldn't find any gold to steal"; X lprintf(p,lastmonst); disappear(xx,yy); beep(); X bottomgold(); return(1); X X case 9: for(j=50; ; ) /* disenchant */ X `7B X i=rund(26); m=iven`5Bi`5D; /* randomly select item */ X if (m>0 && ivenarg`5Bi`5D>0 && m!=OSCROLL && m!=OPOTION) X `7B X if ((ivenarg`5Bi`5D -= 3)<0) ivenarg`5Bi`5D=0; X lprintf("\nThe %s hits you -- you feel a sense of lo Vss",lastmonst); X beep(); show3(i); bottomline(); return(0); X `7D X if (--j<=0) X `7B X p="\nThe %s nearly misses"; break; X `7D X break; X `7D `20 X break; X X case 10: p="\nThe %s hit you with his barbed tail"; X i = rnd(25)-c`5BAC`5D; goto spout2; X X case 11: p="\nThe %s has confused you"; beep(); X c`5BCONFUSE`5D+= 10+rnd(10); break; X X case 12: /* performs any number of other special attacks */ X return(spattack(spsel`5Brund(10)`5D,xx,yy)); X X case 13: p="\nThe %s flattens you with his psionics!"; X i = rnd(15)+30-c`5BAC`5D; goto spout2; X X case 14: if (c`5BNOTHEFT`5D) return(0); /* he has device of no th Veft */ X if (emptyhanded()==1) X `7B X p="\nThe %s couldn't find anything to steal"; X break; X `7D X lprintf("\nThe %s picks your pocket and takes:",lastmons Vt); X beep(); X if (stealsomething()==0) lprcat(" nothing"); disappear( Vxx,yy); X bottomline(); return(1); X X case 15: i= rnd(10)+ 5-c`5BAC`5D; X spout3: p="\nThe %s bit you!"; X goto spout2; X X case 16: i= rnd(15)+10-c`5BAC`5D; goto spout3; X `7D; X if (p) `7B lprintf(p,lastmonst); bottomline(); `7D X return(0); X `7D X X/* X * checkloss(x) Routine to subtract hp from user and flag bottomline dis Vplay X * int x; X * X * Routine to subtract hitpoints from the user and flag the bottomline disp Vlay X * Enter with the number of hit points to lose X * Note: if x > c`5BHP`5D this routine could kill the player! X */ Xcheckloss(x) X int x; X `7B X if (x>0) `7B losehp(x); bottomhp(); `7D X `7D $ CALL UNPACK MONSTER.C;1 90083776 $ create 'f' X/* X Monster related definitions X*/ X X#define MAXMONST 56 /* maximum # monsters in the dungeon */ X X/* this is the structure definition of the monster data X*/ Xstruct monst X `7B X char *name; X char level; X short armorclass; X char damage; X char attack; X char defense; X char genocided; X char intelligence; /* monsters intelligence -- used to choose movemen Vt */ X short gold; X short hitpoints; X unsigned long experience; X `7D; X Xextern struct monst monster`5B`5D; X X/* defines for the monsters as objects `20 X*/ X#define BAT 1 X#define GNOME 2 X#define HOBGOBLIN 3 X#define JACKAL 4 X#define KOBOLD 5 X#define ORC 6 X#define SNAKE 7 X#define CENTIPEDE 8 X#define JACULI 9 X#define TROGLODYTE 10 X#define ANT 11 X#define EYE 12`20 X#define LEPRECHAUN 13 X#define NYMPH 14 X#define QUASIT 15`20 X#define RUSTMONSTER 16`20 X#define ZOMBIE 17`20 X#define ASSASSINBUG 18`20 X#define BUGBEAR 19`20 X#define HELLHOUND 20`20 X#define ICELIZARD 21`20 X#define CENTAUR 22`20 X#define TROLL 23`20 X#define YETI 24`20 X#define WHITEDRAGON 25 X#define ELF 26 X#define CUBE 27`20 X#define METAMORPH 28`20 X#define VORTEX 29`20 X#define ZILLER 30`20 X#define VIOLETFUNGI 31`20 X#define WRAITH 32`20 X#define FORVALAKA 33`20 X#define LAMANOBE 34`20 X#define OSEQUIP 35`20 X#define ROTHE 36 X#define XORN 37 X#define VAMPIRE 38 X#define INVISIBLESTALKER 39 X#define POLTERGEIST 40 X#define DISENCHANTRESS 41 X#define SHAMBLINGMOUND 42 X#define YELLOWMOLD 43 X#define UMBERHULK 44 X#define GNOMEKING 45 X#define MIMIC 46 X#define WATERLORD 47 X#define BRONZEDRAGON 48 X#define GREENDRAGON 49 X#define PURPLEWORM 50 X#define XVART 51 X#define SPIRITNAGA 52 X#define SILVERDRAGON 53 X#define PLATINUMDRAGON 54 X#define GREENURCHIN 55 X#define REDDRAGON 56 X#define DEMONLORD 57 X#define DEMONPRINCE 64 $ CALL UNPACK MONSTERS.H;1 255175653 $ create 'f' X/* moreobj.c X X Routines in this file: X X oaltar() X othrone() X odeadthrone() X ochest() X ofountain() X fntchange() X fch() X drink_fountain() X wash_fountain() X enter() X remove_gems() X sit_on_throne() X up_stairs() X down_stairs() X open_something() X close_something() X desecrate_altar() X pray_at_altar() X*/ X#include "header.h" X#include "larndefs.h" X#include "monsters.h" X#include "objects.h" X#include "player.h" X X void specify_object(); Xstatic void specify_obj_nocurs(); Xstatic void specify_obj_cursor(); Xextern int dropflag ; Xstatic void move_cursor(); X X/* X subroutine to process an altar object X*/ Xoaltar() X `7B X unsigned long k; X X lprcat("\nDo you (p) pray (d) desecrate"); iopts(); X while (1) switch(ttgetch()) X `7B X case 'p': X lprcat(" pray\nDo you (m) give money or (j) just pray? "); X while (1) switch(ttgetch()) X `7B X case 'j':`20 X lprcat("\n"); X act_just_pray(); X return; X X case 'm': X act_donation_pray(); X return; X X case '\33': X return; X `7D; X X case 'd': X lprcat(" desecrate"); X act_desecrate_altar(); X return; X X case 'i': X case '\33': X ignore(); X act_ignore_altar(); X return; X `7D; X `7D X X/* X subroutine to process a throne object X*/ Xothrone(arg) X int arg; X `7B X X lprcat("\nDo you (p) pry off jewels, (s) sit down"); iopts(); X while (1) X `7B X while (1) switch(ttgetch()) X `7B X case 'p': `20 X lprcat(" pry off"); `20 X act_remove_gems( arg ); X return; X X case 's': X lprcat(" sit down"); X act_sit_throne( arg ); X return; X X case 'i': X case '\33': ignore(); return; X `7D; X `7D X `7D X Xodeadthrone() X `7B X lprcat("\nDo you (s) sit down"); iopts(); X while (1) X `7B X while (1) switch(ttgetch()) X `7B X case 's': `20 X lprcat(" sit down"); `20 X act_sit_throne(1); X return; X X case 'i': X case '\33': ignore(); return; +-+-+-+-+-+-+-+- END OF PART 27 +-+-+-+-+-+-+-+-