[net.sources.games] hack mods

sshefter@yale.UUCP (03/30/87)

*** REPLACE THIS LINE WITH YOUR MEmunch, munch, smack gulp <burp>

    The following articles are patches to hack, originally posted by Scott
Turner. The modifications are cumulative (that is, each assumes that you have
installed the previous ones). The sixth article contains some corrections
posted from another source.
							 Spectre
-- 
|========================================================================|
|                                                                        |
| From the only slightly twisted mind of...                              |
|       shefter-bret@yale.ARPA                  * DISCLAIMER *           |
|       shefter@yalecs.BITNET           Whatever you thought I said, it  |
|    ...!ihnp4!hsi!yale!shefter           wasn't what I know I meant.    |
|    ...!{seismo,decvax}!yale!shefter                       - Shadow     |
|                                                                        |
|           "Everybody remember where we parked."                        |
|                                                                        |
|========================================================================|

sshefter@yale.UUCP (03/30/87)

From yale!cmcl2!seismo!columbia!rutgers!sri-spam!sri-unix!hplabs!sdcrdcf!ucla-cs!srt Wed Nov  5 12:40:07 EST 1986

At the request of the DSA (Dungeon Shopkeepers Association), the Wizard
of Yendor recently hired a security force in hopes of cutting down on the
rash of recent thefts.  Unfortunately, the Wizard is notoriously cheap
and the Keystone Kops he hired aren't much of a deterrent.  But they are
quite active!

						-- Scott

------

The following diffs add Keystone Kops to hack.  Hopefully they are pretty
close to the correct lines numbers for a "vanilla" hack, but since I
modified my hack for an Apollo, I can't be certain.  If the numbers are off,
please post any corrections (DON'T send them to me).

Unfortunately, you can't have #ifdefs in def.objects.h, so you have to
manually change the name in line 54 to "dead Kop".

(Sorry, I had to prepend semicolons so the server wouldn't think I was
 quoting an article.)

in hack.mon.c

;212a213
;> #ifndef KOPS
;213a215,217
;> #else KOPS
;>               (index("KBIuy", mdat->mlet) && !rn2(4)) ||
;> #endif KOPS
;585a586,596
;> #ifdef KOPS
;>        if(mtmp->data->mlet == 'K') {
;>            /* When a Kop dies, he probably comes back. */
;>            register int fate = rnd(3);
;>            if(fate == 1) {
;>              /* returns near the stairs */
;>              mkmon_at('K',xdnstair,ydnstair);
;>            } else if(fate == 2) {
;>              /* randomly */
;>              mkmon_at('K',0,0);
;>            }
;>          }
;> #endif KOPS
;
;in hack.monst.c
;
;12a13,15
;> #ifdef KOPS
;>       { "Keystone Kop",       'K',1,6,7,1,4,0 },
;> #else KOPS
;13a17
;> #endif KOPS
;
;in hack.makemon.c:
;40a41,44
;> #ifdef KOPS
;>                        /* Avoid Kops.  Any better way? */
;>                        if(ptr->mlet == 'K') continue;
;> #endif KOPS
;
;in hack.shk.c:
;
;143a144,148
;> #ifdef KOPS
;>                            /* Keystone Kops srt@ucla */
;>                            pline("An alarm sounds throughout the dungeon!");
;>                            pline("The Kops are after you!");
;> #endif KOPS
;153a159,180
;> #ifdef KOPS
;>                      {
;>                       coord enexto();
;>                       coord mm;
;>                       register int cnt = dlevel + rnd(3);
;>                        /* Create a swarm near the staircase */
;>                       mm.x = xdnstair;
;>                       mm.y = ydnstair;
;>                       while(cnt--) {
;>                               mm = enexto(mm.x, mm.y);
;>                               (void) mkmon_at('K', mm.x, mm.y);
;>                        }
;>                        /* Create a swarm near the shopkeeper */
;>                       cnt = dlevel + rnd(3);
;>                       mm.x = shopkeeper->mx;
;>                       mm.y = shopkeeper->my;
;>                       while(cnt--) {
;>                               mm = enexto(mm.x, mm.y);
;>                               (void) mkmon_at('K', mm.x, mm.y);
;>                        }
;>                      }
;> #endif KOPS
;
;in hack.fight.c
;
;72a73,75
;> #ifdef KOPS
;>               if(letter(pd->mlet) && rn2(3) && pd->mlet != 'K'){
;> #else KOPS
;73a77
;> #endif KOPS

    Scott R. Turner
    ARPA:  (now) srt@UCLA-LOCUS.ARPA  (soon) srt@LOCUS.UCLA.EDU
    UUCP:  ...!{cepu,ihnp4,trwspp,ucbvax}!ucla-cs!srt
    DRAGNET:  ...!{channing,streisand,joe-friday}!srt@dragnet-relay.arpa

sshefter@yale.UUCP (03/30/87)

From yale!cmcl2!seismo!columbia!rutgers!sri-spam!sri-unix!hplabs!sdcrdcf!ucla-cs!srt Wed Nov  5 12:40:24 EST 1986

Recently returned dungeon explorers have reported the existence of a strange
new monster in the middle reaches of the dungeon.  Dubbed a "rock mole",
this strange beast lives on rock, boring new corridors through the dungeon
and feasting on the occasional pile of gold.  Novices beware!

------

The following diffs add rock moles to hack.  Line numbers probably presume
that the "Keystone Kop" variant has also been added.  If you make a
corrected diff for a "vanilla" hack please don't bother me with it.  You
may want to post it for the convenience of others.  Again, because you
cannot have #ifdef in def.objects.h, you have to manually change the "dead
giant rat" line to "dead rock mole".

(Sorry, I had to prepend semicolons so the server wouldn't think I was
 quoting an article.)

in hack.monst.c

 18a19
;> #ifndef ROCKMOLE
;19a21
;> #endif ROCKMOLE
;27a30,32
;> #ifdef ROCKMOLE
;>       { "rock mole",          'r',3,3,0,1,6,0 },
;> #endif ROCKMOLE
;
;hack.mon.c
;
;341a342,346
;> #ifdef ROCKMOLE
;        likegold = (index("LODr", msym) != NULL);
;>       likegems = (index("ODu", msym) != NULL);
;>       likeobjs = (mtmp->mhide || msym == 'r');
;> #else ROCKMOLE
; 44a350,351
;> #endif ROCKMOLE
;>
;380a388,390
;> #ifdef ROCKMOLE
;>                msym == 'r' ? ALLOW_WALL :
;> #endif ROCKMOLE
;442a453,476
;> #ifdef ROCKMOLE
;>                /* Maybe a rock mole just ate something? */
;>                if(msym == 'r' && IS_ROCK(levl[mtmp->mx][mtmp->my].typ) &&
;>                   levl[mtmp->mx][mtmp->my].typ != POOL){
;>                    register int pile = rnd(25);
;>                    /* Just ate something. */
;>                    if(levl[mtmp->mx][mtmp->my].typ == 0)
;>                      levl[mtmp->mx][mtmp->my].typ = CORR;
;>                    else if(IS_WALL(levl[mtmp->mx][mtmp->my].typ))
;>                      levl[mtmp->mx][mtmp->my].typ = DOOR;
;>                    mnewsym(mtmp->mx,mtmp->my);
;>                    /* Left behind a pile? */
;>                    if(pile < 5) {
;>                        if(pile == 1)
;>                         mksobj_at(ENORMOUS_ROCK, mtmp->mx, mtmp->my);
;>                       else
;>                         mksobj_at(ROCK, mtmp->mx, mtmp->my);
;>                    }
;>                   if(cansee(mtmp->mx, mtmp->my))
;>                     atl(mtmp->mx,mtmp->my,fobj->olet);
;>                }
;>                /* Maybe a rock mole just ate some gold or armor? */
;>                if(msym == 'r') meatgold(mtmp);
;> #endif ROCKMOLE
;450a485,513
;> #ifdef ROCKMOLE
;>
;> meatgold(mtmp) register struct monst *mtmp; {
;> register struct gold *gold;
;> register int pile;
;> register struct obj *otmp;
;>        /* Eats gold if it is there */
;>       while(gold = g_at(mtmp->mx, mtmp->my)){
;>               freegold(gold);
;>                /* Left behind a pile? */
;>                pile = rnd(25);
;>                if(pile < 3)
;>                  mksobj_at(ROCK, mtmp->mx, mtmp->my);
;>               newsym(mtmp->mx, mtmp->my);
;>         }
;>        /* Eats armor if it is there */
;>        otmp = o_at(mtmp->mx,mtmp->my);
;>        if((otmp) && (otmp->otyp >= PLATE_MAIL) && (otmp->otyp <= RING_MAIL)){
;>               freeobj(otmp);
;>                /* Left behind a pile? */
;>                pile = rnd(25);
;>                if(pile < 3)
;>                   mksobj_at(ROCK, mtmp->mx, mtmp->my);
;>               newsym(mtmp->mx, mtmp->my);
;>         }
;> }
;>
;> #endif ROCKMOLE
;>
;452a516
;> register struct obj *otmp;
;499c563,567
;<       if(!IS_ROCK(ntyp = levl[nx][ny].typ))
;---
;> #ifdef ROCKMOLE
;>       if(!IS_ROCK(ntyp = levl[nx][ny].typ) || (flag & ALLOW_WALL))
;> #else ROCKMOLE
;>       if(!IS_ROCK(ntyp = levl[nx][ny].typ) || (flag & ALLOW_WALL))
;> #endif ROCKMOLE
;
;
;hack.mfndpos.h
;
;10a11
;> #define        ALLOW_WALL      0200000


    Scott R. Turner
    ARPA:  (now) srt@UCLA-LOCUS.ARPA  (soon) srt@LOCUS.UCLA.EDU
    UUCP:  ...!{cepu,ihnp4,trwspp,ucbvax}!ucla-cs!srt
    DRAGNET:  ...!{channing,streisand,joe-friday}!srt@dragnet-relay.arpa

sshefter@yale.UUCP (03/30/87)

From yale!husc6!rutgers!sri-spam!sri-unix!hplabs!sdcrdcf!ucla-cs!srt Wed Nov  5 12:40:35 EST 1986

With increased adventurer traffic in the local dungeon, spots of poor
workmanship have begun to show.  In addition to the well known spots of
collapsing floor, returning adventurers have begun to report floor defects
that sometimes result in an annoying squeak, often at inopportune times.
In addition to that, it appears that the Wizard of Yendor has taken to
sneaking out of his subterranean retreat and leaving behind certain magical
traps.

----

The following mods add two new trap types.  The first is a squeaky board
trap that awakens nearby monsters.  The second is a "magic" trap that
does various weird things.

Again, please note that the line numbers involved may be inaccurate.  They
assume that you have installed the Kop & Rockmole mods.

In hack.trap.c

    19c19,25
    <      " piercer",
    <       " mimic"
    ---
    > #ifdef NEWTRAPS
    >        " magic trap",
    >        " squeaky board",
    >        " piercer",
    >       " mimic"
    > #else NEWTRAPS
    >        " piercer",
    >        " mimic"
    > #endif
    131a138,160
    > #ifdef NEWTRAPS
    >                case MGTRP:
    >                        /* A magic trap. */
    >                        domagictrap();
    >                        break;
    >                case SQBRD: {
    > #include      "def.edog.h"
    >                        register struct monst *mtmp = fmon;
    >                        /* Stepped on a squeaky board. */
    >                        pline("A board underfoot gives off a load squeak!");
    >                        /* Wake up nearby monsters. */
    >                       while(mtmp) {
    >                         if(dist(mtmp->mx,mtmp->my) < u.ulevel*20) {
    >                               if(mtmp->msleep)
    >                                       mtmp->msleep = 0;
    >                               if(mtmp->mtame)
    >                                       EDOG(mtmp)->whistletime = moves;
    >                         }
    >                         mtmp = mtmp->nmon;
    >                       }
    >                        break; }
    > #endif NEWTRAPS
    >
    136c165
    < }
    ---
    > }
    137a167
    >
    220a251,271
    > #ifdef NEWTRAPS
    >                case MGTRP:
    >                        /* A magic trap.  Monsters immune. */
    >                        break;
    >                case SQBRD: {
    >                        register struct monst *ztmp = fmon;
    >                        /* Stepped on a squeaky board. */
    >                        if (in_sight)
    >                           pline("%s steps on a squeaky board.", monnam(mtmp));
    >                        else
    >                           pline("You hear a distant squeak.");
    >                        /* Wake up nearby monsters. */
    >                       while(ztmp) {
    >                         if(dist2(mtmp->mx,mtmp->my,ztmp->mx,ztmp->my) < 40) {
    >                               if(ztmp->msleep)
    >                                       ztmp->msleep = 0;
    >                         }
    >                         ztmp = ztmp->nmon;
    >                       }
    >                        break; }
    > #endif NEWTRAPS
    447a499,582
    >
    > #ifdef NEWTRAPS
    >
    > domagictrap()
    > {
    >        register int fate = rnd(20);
    >
    >        /* What happened to the poor sucker? */
    >
    >        if (fate < 10) {
    >
    >          /* Most of the time, it creates some monsters. */
    >          register int cnt = rnd(4);
    >          pline("You are momentarily blinded by a flash of light!");
    >         Blind += rn1(5,10);
    >         seeoff(0);
    >         while(cnt--)
    >           (void) makemon((struct permonst *) 0, u.ux, u.uy);
    >        }
    >        else
    >          switch (fate) {
    >
    >             case 10:
    >             case 11:
    >                      /* sometimes nothing happens */
    >                        break;
    >             case 12:
    >                      /* a flash of fire */
    >                      {
    >                        register int num = rnd(6);
    >                        pline("A tower of flame bursts from the floor!");
    >                        u.uhpmax--;
    >                        losehp(num,"a burst of flame");
    >                        break;
    >                      }
    >
    >             /* odd feelings */
    >             case 13:   pline("A shiver runs up and down your spine!");
    >                        break;
    >             case 14:   pline("You hear distant howling.");
    >                        break;
    >             case 15:   pline("You suddenly yearn for your distant homeland.");
    >                        break;
    >             case 16:   pline("Your pack shakes violently!");
    >                        break;
    >
    >             /* very occasionally something nice happens. */
    >
    >             case 19:
    >                    /* tame nearby monsters */
    >                   {   register int i,j;
    >                       register boolean confused = (Confusion != 0);
    >                       register int bd = confused ? 5 : 1;
    >                       register struct monst *mtmp;
    >
    >                       for(i = -bd; i <= bd; i++) for(j = -bd; j <= bd; j++)
    >                       if(mtmp = m_at(u.ux+i, u.uy+j))
    >                               (void) tamedog(mtmp, (struct obj *) 0);
    >                       break;
    >                   }
    >
    >             case 20:
    >                    /* uncurse stuff */
    >                   {   register struct obj *obj;
    >                       register boolean confused = (Confusion != 0);
    >                       for(obj = invent; obj ; obj = obj->nobj)
    >                               if(obj->owornmask)
    >                                       obj->cursed = confused;
    >                       if(Punished && !confused) {
    >                               Punished = 0;
    >                               freeobj(uchain);
    >                               unpobj(uchain);
    >                               free((char *) uchain);
    >                               uball->spe = 0;
    >                               uball->owornmask &= ~W_BALL;
    >                               uchain = uball = (struct obj *) 0;
    >                       }
    >                       break;
    >                   }
    >             default: break;
    >          }
    > }
    >
    > #endif

    In def.trap.h

    23a24,35
    >
    >
    > #ifdef NEWTRAPS
    >
    > #define       PIERC           9
    > #define       MIMIC          10       /* used only in mklev.c */
    > #define        MGTRP           7
    > #define        SQBRD           8
    > #define TRAPNUM       11      /* if not less than 32, change sizeof(ttyp) */
    >                               /* see also mtrapseen (bit map) */
    > #else NEWTRAPS
    >
    26,27c38,40
    < #define TRAPNUM       9       /* if not less than 32, change sizeof(ttyp) */
    <                               /* see also mtrapseen (bit map) */
    ---
    > #define TRAPNUM 9
    >
    > #endif NEWTRAPS


    Scott R. Turner
    ARPA:  (now) srt@UCLA-LOCUS.ARPA  (soon) srt@LOCUS.UCLA.EDU
    UUCP:  ...!{cepu,ihnp4,trwspp,ucbvax}!ucla-cs!srt
    DRAGNET:  ...!{channing,streisand,joe-friday}!srt@dragnet-relay.arpa

sshefter@yale.UUCP (03/30/87)

From yale!husc6!rutgers!sri-spam!sri-unix!hplabs!sdcrdcf!ucla-cs!srt Wed Nov  5 12:40:48 EST 1986

Recent seismic activity (no doubt related to the fate of Lumpoc the Tourist,
may his soul rest in piece) has opened up a number of fountains throughout
the local dungeon.  Adventurers are cautioned that the water is known to
well up through an area of intense magical activity, and that drinking from
these fountains can have strange and sometimes deadly effects.

-----

The following mods add fountains to hack.  Note that there is a separate
file "hack.fountain.c" at the end.  You'll have to add that to the Makefile.
Fountains use the symbol "{" and you'll want to modify the file 'data'
accordingly.

  In hack.mklev.c

  103a104,106
  > #ifdef FOUNTAINS
  >                if(rnd(10) == 10) mkfount(0,croom);
  > #endif FOUNTAINS
  739a743,776
  >
  > #ifdef FOUNTAINS
  >
  > mkfount(mazeflag,croom)
  > register struct mkroom *croom;
  > register mazeflag;
  > {
  >       register xchar mx,my;
  >        register int tryct = 0;
  >
  >       do {
  >               if(++tryct > 200)
  >                       return;
  >               if(mazeflag){
  >                       extern coord mazexy();
  >                       coord mm;
  >                       mm = mazexy();
  >                       mx = mm.x;
  >                       my = mm.y;
  >               } else {
  >                       mx = somex();
  >                       my = somey();
  >               }
  >       } while(t_at(mx, my) || levl[mx][my].typ == STAIRS);
  >
  >        /* Put a fountain at mx, my */
  >
  >        levl[mx][my].typ = FOUNTAIN;
  >        levl[mx][my].scrsym = FOUNT_SYM;
  >
  > }
  >
  > #endif FOUNTAINS
  >

  In hack.potions.c

  8a9,11
  > #ifdef FOUNTAINS
  > extern int drinkfountain();
  > #endif FOUNTAINS
  13a17,29
  >
  > #ifdef FOUNTAINS
  >
  >       /* Is there something to drink here, i.e., a fountain? */
  >        if (levl[u.ux][u.uy].typ == FOUNTAIN) {
  >           pline("Drink from the fountain? [ny] ");
  >           if(readchar() == 'y') {
  >             (void) drinkfountain();
  >             return;
  >           }
  >        }
  >
  > #endif FOUNTAINS

The file hack.fountain.c:

/* Code for drinking from fountains.   */
/* Scott R. Turner, srt@ucla, 10/27/86 */

#include "hack.h"

#define somex() ((rand()%(croom->hx-croom->lx+1))+croom->lx)
#define somey() ((rand()%(croom->hy-croom->ly+1))+croom->ly)

drinkfountain(){

       /* What happens when you drink from a fountain? */

       register int fate = rnd(30);

       if (fate < 10) {
	  pline("The cool draught refreshes you.");
	  lesshungry(rnd(10));
       }
       else
	  switch (fate) {

	       case 20: /* Foul water */

			pline("The water is foul!  You gag and vomit.");
			morehungry(rnd(20)+10);
			break;

	       case 21: /* Poisonous */

			pline("The water is contaminated!");
			if (Poison_resistance) {
			   pline("Perhaps it is run off from the nearby orange farm.");
			   losehp(rnd(4),"contaminated water");
			   break;
			}
			losestr(rn1(4,3));
			losehp(rnd(10),"contaminated water");
			break;

	       case 22: /* Fountain of snakes! */ {

			register int num = rnd(6);
			pline("Good Lord!  An endless stream of snakes pours forth!");
			while(num-- > 0) (void) mkmon_at('S',u.ux,u.uy);
			break;
			}

	       case 23: /* Water demon */ {

		       register struct monst *mtmp;
		       pline("You have unleashed a water demon!");
		       mtmp = mkmon_at('&',u.ux,u.uy);
		       if (rnd(100)>97) {
			  char buf[BUFSZ];
			  register struct obj *otmp;
			  extern struct obj *readobjnam(), *addinv();
			 pline("He is grateful for his release.  He grants you a wish!");
			  pline("You may wish for an object. What do you want? ");
			  getlin(buf);
			  if(buf[0] == '\033') buf[0] = 0;
			  otmp = readobjnam(buf);
			  otmp = addinv(otmp);
			  prinv(otmp);
			 mondied(mtmp);
			  break;
		       }
		      }

	       case 24: /* Curse an item... */ {
			register struct obj *obj;
		       pline("The cool draught refreshes you.");
		       morehungry(rnd(20)+10);
		       for(obj = invent; obj ; obj = obj->nobj)
			 if (rnd(5) == 5) {
			    obj->cursed = 1;
			 }
		       break; }

	       case 25: /* See invisible */

			pline("The cool draught refreshes you.");
			See_invisible |= INTRINSIC;
			break;

	       case 26: /* See Monsters */{

		       register struct monst *mtmp;
			if(!fmon) {
			       pline("You feel oddly disturbed.");
			} else {
				cls();
				for(mtmp = fmon; mtmp; mtmp = mtmp->nmon)
					if(mtmp->mx > 0)
						at(mtmp->mx,mtmp->my,mtmp->data->mlet);
				prme();
				pline("You sense the presence of monsters.");
				more();
				docrt();
			}
			break; }

	       case 27: /* Find a gem in the sparkling waters. */

		       pline("You spot a gem in the sparkling waters!");
		       mkobj_at('*',u.ux,u.uy);
		       break;

	       case 28: /* Water Nymph */ {

		       register struct monst *mtmp;
		       pline("You have attracted a water nymph!");
		       mtmp = mkmon_at('N',u.ux,u.uy);
		       mtmp->msleep = 0;
		       break;
		      }

	       case 29: /* Scare */
		    {   register struct monst *mtmp;

		       pline("The cool draught refreshes you.");
			for(mtmp = fmon; mtmp; mtmp = mtmp->nmon)
			  mtmp->mflee = 1;
		   }

	       case 30: /* Gushing forth in this room */

		   {
#include        "def.mkroom.h"
			register int num = rnd(10);
			register xchar mx,my;
		register int tryct = 0;
			register int uroom = inroom(u.ux, u.uy);
			register struct mkroom *croom = &rooms[uroom];

		       pline("Water gushes forth from the overflowing fountain!");

		       while(num--) {
			   do {
			if(++tryct > 200)
				return;
				mx = somex();
				my = somey();
			  } while(t_at(mx, my) || levl[mx][my].typ == STAIRS);

			   /* Put a pool at mx, my */

			  levl[mx][my].typ = POOL;
			  atl(mx,my,POOL_SYM);
		       }

		       break;
		   }
	  }

       if (!rn2(5)) {
	  pline("The fountain dries up!");
	  levl[u.ux][u.uy].typ = ROOM;
       }

}






    Scott R. Turner
    ARPA:  (now) srt@UCLA-LOCUS.ARPA  (soon) srt@LOCUS.UCLA.EDU
    UUCP:  ...!{cepu,ihnp4,trwspp,ucbvax}!ucla-cs!srt
    DRAGNET:  ...!{channing,streisand,joe-friday}!srt@dragnet-relay.arpa

sshefter@yale.UUCP (03/30/87)

From yale!husc6!rutgers!sri-spam!sri-unix!hplabs!sdcrdcf!ucla-cs!srt Wed Nov  5 12:41:03 EST 1986

As wet weather approaches, expect scorpions to leave the damp confines
of the dungeon and migrate south, being replaced by the rapacious and
deadly common dungeon spider.  Considered even more dangerous than
scorpions, the dungeon spider leaves behind it a trail of webs that can
entangle the unwary adventurer and lead to his early demise.  These webs
are especially dangerous in the corridors where they cannot be seen in
the dim light.

-----

Webs are implemented as traps, and appear as '"', so modify the 'data'
file appropriately.

   Manually modify def.objects.h

   in hack.c replacing code near 146

	   /* not attacking an animal, so we try to move */
	   if(u.utrap) {
		   register struct trap *ttmp;
		   ttmp = t_at(u.ux,u.uy);
		  if(ttmp->ttyp == PIT) {
			   pline("You are still in a pit.");
			   u.utrap--;
   #ifdef SPIDERS
		   } else if (ttmp->ttyp == WEB) {
			  pline("You are entangled in a web.");
			  u.utrap--;
			  /* Remove web when destroyed. */
			  if (!u.utrap) {
				  deltrap(ttmp);
			  }
   #endif SPIDERS
		  } else {
			   pline("You are caught in a beartrap.");
			   if((u.dx && u.dy) || !rn2(5)) u.utrap--;
		   }

		   return;
	   }


   in hack.mhitu.c

   255a256,258
   > #ifdef SPIDERS
   >                       poisoned("spider's sting",mdat->mname);
   > #else SPIDERS
   256a260
   > #endif SPIDERS

   in hack.mklev.c

   678a679,681
   > #ifdef SPIDERS
   >               kind = rn2(TRAPNUM - nopierc - nomimic - 1);
   > #else SPIDERS
   680a684
   > #endif SPIDERS

   in hack.mon.c

   258a259,267
   > #ifdef SPIDERS
   >        {
   >          /* You can hide under webs. */
   >         register struct trap *ttmp;
   >         ttmp = t_at(mtmp->mx,mtmp->my);
   >          if (mtmp->mhide && ttmp && ttmp->ttyp == WEB && rn2(10))
   >             return(0);
   >        }
   > #endif SPIDERS
   436a446,457
   > #ifdef SPIDERS
   >                /* Spiders leave web behind. */
   >                if (msym == 's') {
   >                       extern struct trap *maketrap();
   >                       register struct trap *ttmp;
   >                       if (!(ttmp = t_at(omx,omy)) &&
   >                            levl[omx][omy].typ >= CORR) {
   >                           ttmp = maketrap(omx,omy,WEB);
   >                           ttmp->tseen = 1;
   >                        }
   >                }
   > #endif SPIDERS
   921a943,946
   > #ifdef SPIDERS
   >        /* You can hide under webs. */
   >       register struct trap *ttmp;
   >       ttmp = t_at(mtmp->mx,mtmp->my);
   922a948,953
   >               && (!mtmp->mhide ||
   >                    (!o_at(mtmp->mx,mtmp->my) &&
   >                     (!ttmp || ttmp->ttyp != WEB)))
   >               && cansee(mtmp->mx, mtmp->my));
   > #else SPIDERS
   >       return((!mtmp->minvis || See_invisible)
   924a956
   > #endif SPIDERS

   in hack.monst.c

   48a49,51
   > #ifdef SPIDERS
   >       { "spider",             's',5,15,3,1,4,0 },
   > #else SPIDERS
   49a53
   > #endif SPIDERS

   in hack.pri.c

   352c352,355
   <       else if((ttmp = t_at(x,y)) && ttmp->tseen) tmp = '^';
   ---
   > #ifdef SPIDERS
   >        else if((ttmp = t_at(x,y)) && ttmp->ttyp == WEB) tmp = '"';
   > #endif SPIDERS
   >       else if(ttmp && ttmp->tseen) tmp = '^';

   in hack.trap.c

   replacing near top of file:

   char *traps[] = {
	   " bear trap",
	   "n arrow trap",
	   " dart trap",
	   " trapdoor",
	   " teleportation trap",
	   " pit",
	   " sleeping gas trap",
   #ifdef NEWTRAPS
	  " magic trap",
	  " squeaky board",
	   " piercer",
   #ifdef SPIDERS
	   " mimic",
	  " web"
   #else SPIDERS
	   " mimic"
   #endif SPIDERS
   #else NEWTRAPS
	   " piercer",
   #ifdef SPIDERS
	   " mimic",
	  " web"
   #else SPIDERS
	   " mimic"
   #endif SPIDERS
   #endif NEWTRAPS
   };

   160a172,196
   > #ifdef SPIDERS
   >
   >                case WEB:
   >
   >                        /* Our luckless adventurer has stepped into a web. */
   >
   >                        pline("You've stumbled into a spider web!");
   >
   >                        /* Time stuck in the web depends on your strength. */
   >
   >                        if (u.ustr == 3) u.utrap = rn1(6,6);
   >                        else if (u.ustr < 6) u.utrap = rn1(6,4);
   >                        else if (u.ustr < 9) u.utrap = rn1(4,4);
   >                        else if (u.ustr < 12) u.utrap = rn1(4,2);
   >                        else if (u.ustr < 15) u.utrap = rn1(2,2);
   >                        else if (u.ustr < 18) u.utrap = rnd(2);
   >                        else if (u.ustr < 69) u.utrap = 1;
   >                        else {
   >                                u.utrap = 0;
   >                                pline("You tear through the trap!");
   >                                deltrap(trap);
   >                             }
   >                        break;
   > #endif SPIDERS
   >
   271a308,316
   > #ifdef SPIDERS
   >                case WEB:
   >                        /* Monster in a web. */
   >                        if(mtmp->data->mlet != 's') {
   >                          pline("%s is caught in a web!", Monnam(mtmp));
   >                          mtmp->mtrapped = 1;
   >                        }
   >                       break;
   > #endif SPIDERS

   in def.trap.h

   28,29d27
   < #define       PIERC           9
   < #define       MIMIC          10       /* used only in mklev.c */
   31a30,36
   > #define       PIERC           9
   > #define       MIMIC          10       /* used only in mklev.c */
   >
   > #ifdef SPIDERS
   > #define        WEB     11
   > #define        TRAPNUM 12
   > #else SPIDERS
   33a39,40
   > #endif SPIDERS
   >
   37a45,49
   >
   > #ifdef SPIDERS
   > #define        WEB     9
   > #define        TRAPNUM 10
   > #else SPIDERS
   38a51
   > #endif SPIDERS
   42,46d54
   < #ifdef SPIDERS
   <
   < #define        WEB             20      /* should be > TRAPNUM */
   <
   < #endif SPIDERS


    Scott R. Turner
    ARPA:  (now) srt@UCLA-LOCUS.ARPA  (soon) srt@LOCUS.UCLA.EDU
    UUCP:  ...!{cepu,ihnp4,trwspp,ucbvax}!ucla-cs!srt
    DRAGNET:  ...!{channing,streisand,joe-friday}!srt@dragnet-relay.arpa

sshefter@yale.UUCP (03/30/87)

From yale!husc6!panda!genrad!decvax!ucbvax!jade!zircon.berkeley.edu!marcp Sat Dec 13 18:54:39 EST 1986

[ That dead line-eater tasted terrible! ]

Well, hopefully everyone who can is using "Dr. Pain"'s improvements to
hack by now.  I know that I've certainly enjoyed the variety.  Unfortunately,
I'm the kind of person who gets annoyed by the most trivial of things, so
I changed some of my source to make myself feel better.  Thought I'd share
them with you.

DISCLAIMERS:  I am NOT a "hacker", but I do know C fairly well.  I've played
with my changes extensively, and have yet to die from unnatural (ie. segmenta-
tion fault) causes.  This does not mean, of course, that I haven't screwed
up somewhere.  Please post or mail me if you have problems.

MORE DISCLAIMERS:  This is not meant to denigrate "Dr. Pain" in any way.
Remember, any fool (like me) can modify someone else's work, but the real
credit goes to the author of the original.

To start off with, I remember someone mentioning that fire resistance should
be proof against magic traps.  I agree.  Near the end of hack.trap.c, in
the middle of domagictrap(), it should look like this:

	 switch (fate) {
	    case 10:
	    case 11:
		     /* sometimes nothing happens */
		       break;
	    case 12:
		     /* a flash of fire */
		     {
		       register int num = rnd(6);
		       pline("A tower of flame bursts from the floor!");
			if (Fire_resistance) {
				pline("You are uninjured");
			} else {
				u.uhpmax--;
				losehp(num,"a burst of flame");
			}
		       break;
		     }
	    /* odd feelings */
	    case 13:   pline("A shiver runs up and down your spine!");


It always annoyed me that I couldn't run, and automatically stop on fountains,
like I could on stairs.

Around line 265 in hack.c, change the code to look like this:

	u.ux += u.dx;
	u.uy += u.dy;
	if(flags.run) {
		if(tmpr->typ == DOOR ||
		(xupstair == u.ux && yupstair == u.uy) ||
#ifdef FOUNTAINS
		(tmpr->typ == FOUNTAIN) ||
#endif FOUNTAINS
		(xdnstair == u.ux && ydnstair == u.uy))
			nomul(0);
	}

It'll let you run, and stop on fountains.


Something that REALLY got to me was how, because of changes in creating Kops
and rockmoles, monsters started coming on earlier levels.  I dunno, I always
liked having two levels to find eyes before I started getting blinded on
level 3.  And I always liked to read my scrolls on seven, hoping to genocide
cockatrices before I met any face to face.  Surprise!  Anyway, here's a
couple changes that seem to correct it.  If you don't mind the new faces,
then don't use them.

Change the top of hack.monst.c to look like this:

struct permonst mons[CMNUM+2] = {
#ifdef KOPS
      { "Keystone Kop",       'K',1,6,7,1,4,0 },
#else KOPS
	{ "kobold",             'K',1,6,7,1,4,0 },
#endif KOPS
#ifndef ROCKMOLE
	{ "giant rat",          'r',0,12,7,1,3,0 },
#endif ROCKMOLE
	{ "bat",                'B',1,22,8,1,4,0 },
	{ "gnome",              'G',1,6,5,1,6,0 },
	{ "hobgoblin",          'H',1,9,5,1,8,0 },
	{ "jackal",             'J',0,12,7,1,2,0 },
	{ "leprechaun",         'L',5,15,8,1,2,0 },
	{ "acid blob",          'a',2,3,8,0,0,0 },
	{ "floating eye",       'E',2,1,9,0,0,0 },
	{ "homunculus",         'h',2,6,6,1,3,0 },
	{ "imp",                'i',2,6,2,1,4,0 },
	{ "orc",                'O',2,9,6,1,8,0 },
	{ "yellow light",       'y',3,15,0,0,0,0 },
	{ "zombie",             'Z',2,6,8,1,8,0 },
	{ "giant ant",          'A',3,18,3,1,6,0 },
#ifdef ROCKMOLE
      { "rock mole",          'r',3,3,0,1,6,0 },
#endif ROCKMOLE
	{ "fog cloud",          'f',3,1,0,1,6,0 },
	{ "nymph",              'N',6,12,9,1,2,0 },


Then, around line 30 in hack.makemon.c, change the code to look like this:

	} else {
		ct = CMNUM - strlen(fut_geno);
		if(index(fut_geno, 'm')) ct++;  /* make only 1 minotaur */
		if(index(fut_geno, '@')) ct++;
		if(ct <= 0) return(0);            /* no more monsters! */
		tmp = 7;
#ifdef KOPS
		tmp--;
#endif KOPS
#ifdef ROCKMOLE
		if(dlevel<4)tmp--;
#endif ROCKMOLE
		tmp = rn2(ct*dlevel/24 + tmp);
		if(tmp < dlevel - 4) tmp = rn2(ct*dlevel/24 + 12);
		if(tmp >= ct) tmp = rn1(ct - ct/2, ct/2);
		ct = 0;
#ifdef KOPS
		ct++;
#endif KOPS
		for(; ct < CMNUM; ct++){
			ptr = &mons[ct];
			if(index(fut_geno, ptr->mlet))
				continue;
			if(!tmp--) goto gotmon;
		}
		panic("makemon?");
	}
gotmon:

These changes should have makemon() making monsters on the same
levels that they used to be coming in at, instead of things like imps
and homunculi on level one.

Finally, something I was having a lot of problems with, but no one else
mentioned was hassles with two traps that I have, but "Dr. Pain" doesn't:
namely, the spiked pit and level teleporter traps.  This fouled up the
identification of webs, and even crashed occasionally.  For those others
out there who have these traps, the rest of the article is for you.  Those
of you who don't just need one more thing:  in hack.trap.c, the first name
in the list of trap names should be "".  This corresponds to NO_TRAP, which
is 0.  If this is confusing, read on.

This change to hack.trap.c will prevent any seg faults when you
try to identify a web trap.  You MUST have that ' "", ' in the
beginning, regardless of whether you have any new traps or if
you only have 7 or 8.

   char *traps[] = {
	   "",
	   " bear trap",
	   "n arrow trap",
	   " dart trap",
	   " trapdoor",
	   " teleportation trap",
	   " level teleportation trap",
	   " pit",
	   " spiked pit",
	   " sleeping gas trap",
#ifdef NEWTRAPS
	  " magic trap",
	  " squeaky board",
	   " piercer",
	   " mimic",
#ifdef SPIDERS
	  " web"
#endif SPIDERS
#else NEWTRAPS
	   " piercer",
	   " mimic",
#ifdef SPIDERS
	  " web"
#endif SPIDERS
#endif NEWTRAPS
   };

If you don't have the spiked pit and level teleporter, there's no need to
read any further.  I don't think you'll have any problems.

This is what my def.trap.h file looks like with everything:

/* various kinds of traps */
#define NO_TRAP         0
#define BEAR_TRAP       1
#define ARROW_TRAP      2
#define DART_TRAP       3
#define TRAPDOOR        4
#define TELEP_TRAP      5
#define LEVEL_TELEP     6
#define PIT             7
#define SPIKED_PIT      8
#define SLP_GAS_TRAP    9
#ifdef NEWTRAPS
#define MGTRP          10
#define SQBRD          11
#define PIERC          12
#define MIMIC          13       /* used only in mklev.c */
#ifdef SPIDERS
#define WEB            14
#define TRAPNUM       15      /* if not less than 32, change sizeof(ttyp) */
#else SPIDERS
#define TRAPNUM        14
#endif SPIDERS
#else NEWTRAPS
#define PIERC          10
#define MIMIC          11
#ifdef SPIDERS
#define WEB            12
#define TRAPNUM        13
#else SPIDERS
#define TRAPNUM        12
#endif SPIDERS
#endif NEWTRAPS
			       /* see also mtrapseen (bit map) */

I had a bad time with an unpredictable seg fault for a while, but was able
to trace it down to some bitwise operations.  Changing hack.mfndpos.h took
care of it ( I just increased all the numbers).  It should look like this:

#define ALLOW_TRAPS     07777
#define ALLOW_U         010000
#define ALLOW_M         020000
#define ALLOW_TM        040000
#define ALLOW_ALL       (ALLOW_U | ALLOW_M | ALLOW_TM | ALLOW_TRAPS)
#define ALLOW_SSM       0100000
#define ALLOW_ROCK      0200000
#define        ALLOW_WALL      02000000
#define NOTONL          0400000
#define NOGARLIC        01000000

If you don't feel like changing all these numbers, I would recommend killing
your dog immediately and not taming any other monsters for the rest of the
game.

That's it!  Hope this makes your playing different but not too different.

						Marc M. Pack

p.s.  Would someone out there be kind enough to mail me the source to ARC,
for unix and/or the pc? (preferable both)

cantrell@cae780.UUCP (03/31/87)

In article <2632@yale-celed.yale.UUCP> sshefter@yale-celed.UUCP (Bret A. Shefter) writes:
:From yale!cmcl2!seismo!columbia!rutgers!sri-spam!sri-unix!hplabs!sdcrdcf!ucla-cs!srt Wed Nov  5 12:40:07 EST 1986
:
:At the request of the DSA (Dungeon Shopkeepers Association), the Wizard
:of Yendor recently hired a security force in hopes of cutting down on the
:rash of recent thefts.  Unfortunately, the Wizard is notoriously cheap
:and the Keystone Kops he hired aren't much of a deterrent.  But they are
:quite active!
:
:						-- Scott
:
:------
:
:The following diffs add Keystone Kops to hack.  Hopefully they are pretty
:close to the correct lines numbers for a "vanilla" hack, but since I
:modified my hack for an Apollo, I can't be certain.  If the numbers are off,
:please post any corrections (DON'T send them to me).

Could you send a complete source that runs on an Apollo?. I have ported alot
of games for the Apollo and would be willing to exchange tapes.

Sorry to post this, but our system did not know about his host?


----------------------------------------------------------------

FROM:   Keith Cantrell, CAE Systems Division of Tektronix, Inc.
UUCP:   tektronix!cae780!cantrell
        {ihnp4, decvax!decwrl}!amdcad!cae780!cantrell
        {hplabs, resonex, qubix, leadsv}!cae780!cantrell
USMAIL: 8111 L.B.J. Freeway Suite 655 Dallas, Texas 75251
AT&T:   214-669-8161

----------------------------------------------------------------