Article View: net.sources.games
Article #862hack mods (2 of 6)
From: sshefter
Date: Mon, 30 Mar 1987 20:54
Date: Mon, 30 Mar 1987 20:54
122 lines
4865 bytes
4865 bytes
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
Technical Details
Message-ID:
<2633@yale-celed.yale.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!water!watnot!watmath!clyde!rutgers!husc6!yale!sshefterShow Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: arc1-ca.pugleaf.net!utzoo!utgpu!water!watnot!watmath!clyde!rutgers!husc6!yale!sshefter From: sshefter@yale.UUCP Newsgroups: net.sources.games Subject: hack mods (2 of 6) Message-ID: <2633@yale-celed.yale.UUCP> Date: Mon, 30-Mar-87 15:54:40 EST Article-I.D.: yale-cel.2633 Posted: Mon Mar 30 15:54:40 1987 Date-Received: Wed, 1-Apr-87 00:39:02 EST Reply-To: sshefter@yale-celed.UUCP (Bret A. Shefter) Distribution: world Organization: Yale University Computer Science Dept, New Haven CT Lines: 122