NetHack 2.3 Update Pt. 07 of 12

1 view
Skip to first unread message

Mike Stephenson

unread,
Apr 13, 1988, 7:54:52 AM4/13/88
to

Two more today...

-------------------------------cut here---------------------------------------
#! /bin/sh
# This is a shell archive, meaning:
# 1. Remove everything above the #! /bin/sh line.
# 2. Save the resulting text in a file.
# 3. Execute the file with /bin/sh (not csh) to create the files:
# Update.2.3.c
# This archive created: Mon Apr 4 08:52:32 1988
export PATH; PATH=/bin:$PATH
echo shar: extracting "'Update.2.3.c'" '(31961 characters)'
if test -f 'Update.2.3.c'
then
echo shar: will not over-write existing file "'Update.2.3.c'"
else
cat << \SHAR_EOF > 'Update.2.3.c'
*** ./makemon.c.orig Mon Feb 22 08:40:06 1988
--- ./makemon.c Thu Mar 31 09:08:52 1988
***************
*** 1,4
! /* SCCS Id: @(#)makemon.c 2.2 87/11/29
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */

#include "hack.h"

--- 1,4 -----
! /* SCCS Id: @(#)makemon.c 2.3 87/12/12
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */

#include "hack.h"
***************
*** 22,27
# endif
#endif /* KJSMODS /**/

/*
* called with [x,y] = coordinates;
* [0,0] means anyplace

--- 22,37 -----
# endif
#endif /* KJSMODS /**/

+ struct permonst grey_dragon = { "grey dragon", 'D',10,9,-1,20,3,8,0 };
+ struct permonst red_dragon = { "red dragon", 'D',10,9,-1,20,3,8,0 };
+ struct permonst orange_dragon = { "orange dragon",'D',10,9,-1,20,3,8,0 };
+ struct permonst white_dragon = { "white dragon", 'D',10,9,-1,20,3,8,0 };
+ struct permonst black_dragon = { "black dragon", 'D',10,9,-1,20,3,8,0 };
+ struct permonst blue_dragon = { "blue dragon", 'D',10,9,-1,20,3,8,0 };
+ struct permonst green_dragon = { "green dragon", 'D',10,9,-1,20,3,8,0 };
+ struct permonst yellow_dragon = { "yellow dragon",'D',10,9,-1,20,3,8,0 };
+ extern struct permonst pm_gremlin;
+
/*
* called with [x,y] = coordinates;
* [0,0] means anyplace
***************
*** 40,46
boolean anything = (!ptr);
int zlevel = dlevel;
#ifdef BVH
! if(has_amulet()) zlevel = 40;
#endif
/* if a monster already exists at the position, return */
if(x != 0 || y != 0) if(m_at(x,y)) return((struct monst *) 0);

--- 50,56 -----
boolean anything = (!ptr);
int zlevel = dlevel;
#ifdef BVH
! if(has_amulet()) zlevel = MAXLEVEL;
#endif
/* if a monster already exists at the position, return */
if(x != 0 || y != 0) if(m_at(x,y)) return((struct monst *) 0);
***************
*** 112,117
mtmp->mx = x;
mtmp->my = y;
mtmp->mcansee = 1;
if(ptr->mlet == 'M'){
mtmp->mimic = 1;
mtmp->mappearance = ']';

--- 122,147 -----
mtmp->mx = x;
mtmp->my = y;
mtmp->mcansee = 1;
+ if(ptr->mlet == 'D') {
+ mtmp->dragon = rn2(8);
+ switch(mtmp->dragon) {
+ case 0: mtmp->data = &grey_dragon; break;
+ case 1: mtmp->data = &red_dragon; break;
+ case 2: mtmp->data = &orange_dragon; break;
+ case 3: mtmp->data = &white_dragon; break;
+ case 4: mtmp->data = &black_dragon; break;
+ case 5: mtmp->data = &blue_dragon; break;
+ case 6: mtmp->data = &green_dragon; break;
+ case 7: mtmp->data = &yellow_dragon; break;
+ }
+ }
+ /* if gnome, make a gremlin or if gremlin make sure it stays gremlin */
+ if((ptr->mlet == 'G' && zlevel >= 10 && rn2(4)) ||
+ !strcmp(ptr->mname, "gremlin")) {
+ ptr = PM_GREMLIN;
+ mtmp->data = PM_GREMLIN;
+ mtmp->isgremlin = 1;
+ }
if(ptr->mlet == 'M'){
mtmp->mimic = 1;
mtmp->mappearance = ']';
***************
*** 138,143
else {
mtmp->cham = 1;
(void) newcham(mtmp,
&mons[zlevel+14+rn2(CMNUM-14-zlevel)]);
}
#else

--- 168,174 -----
else {
mtmp->cham = 1;
(void) newcham(mtmp,
+ # ifndef RPH
&mons[zlevel+14+rn2(CMNUM-14-zlevel)]);
# else
(struct permonst *)0);
***************
*** 139,144
mtmp->cham = 1;
(void) newcham(mtmp,
&mons[zlevel+14+rn2(CMNUM-14-zlevel)]);
}
#else
mtmp->cham = 1;

--- 170,178 -----
(void) newcham(mtmp,
# ifndef RPH
&mons[zlevel+14+rn2(CMNUM-14-zlevel)]);
+ # else
+ (struct permonst *)0);
+ # endif
}
#else
mtmp->cham = 1;
***************
*** 142,148
}
#else
mtmp->cham = 1;
! (void) newcham(mtmp, &mons[zlevel+14+rn2(CMNUM-14-zlevel)]);
#endif
}
if(ptr->mlet == 'I' || ptr->mlet == ';')

--- 176,187 -----
}
#else
mtmp->cham = 1;
! (void) newcham (mtmp,
! # ifndef RPH
! &mons[zlevel+14+rn2(CMNUM-14-zlevel)]);
! # else
! 0);
! # endif
#endif
}
if(ptr->mlet == 'I' || ptr->mlet == ';')
***************
*** 177,182
#ifdef SAC
|| ptr->mlet == '3'
#endif /* SAC /**/
) {

coord mm;

--- 216,222 -----
#ifdef SAC
|| ptr->mlet == '3'
#endif /* SAC /**/
+ || (ptr->mlet == 'G' && mtmp->isgremlin)
) {

coord mm;
***************
*** 211,217
# endif
# ifdef SAC
case '3': /* Outfit the troops */
! if (!rn2(4)) {
otmp = mksobj(HELMET);
mpickobj(mtmp, otmp); }
if (!rn2(4)) {

--- 251,257 -----
# endif
# ifdef SAC
case '3': /* Outfit the troops */
! if (!rn2(5)) {
otmp = mksobj(HELMET);
mpickobj(mtmp, otmp); }
if (!rn2(5)) {
***************
*** 214,220
if (!rn2(4)) {
otmp = mksobj(HELMET);
mpickobj(mtmp, otmp); }
! if (!rn2(4)) {
otmp = mksobj(CHAIN_MAIL);
mpickobj(mtmp, otmp); }
if (!rn2(3)) {

--- 254,260 -----
if (!rn2(5)) {
otmp = mksobj(HELMET);
mpickobj(mtmp, otmp); }
! if (!rn2(5)) {
otmp = mksobj(CHAIN_MAIL);
mpickobj(mtmp, otmp); }
if (!rn2(4)) {
***************
*** 217,223
if (!rn2(4)) {
otmp = mksobj(CHAIN_MAIL);
mpickobj(mtmp, otmp); }
! if (!rn2(3)) {
otmp = mksobj(DAGGER);
mpickobj(mtmp, otmp); }
if (!rn2(6)) {

--- 257,263 -----
if (!rn2(5)) {
otmp = mksobj(CHAIN_MAIL);
mpickobj(mtmp, otmp); }
! if (!rn2(4)) {
otmp = mksobj(DAGGER);
mpickobj(mtmp, otmp); }
if (!rn2(7)) {
***************
*** 220,226
if (!rn2(3)) {
otmp = mksobj(DAGGER);
mpickobj(mtmp, otmp); }
! if (!rn2(6)) {
otmp = mksobj(SPEAR);
mpickobj(mtmp, otmp); }
if (!rn2(2)) {

--- 260,266 -----
if (!rn2(4)) {
otmp = mksobj(DAGGER);
mpickobj(mtmp, otmp); }
! if (!rn2(7)) {
otmp = mksobj(SPEAR);
mpickobj(mtmp, otmp); }
if (!rn2(3)) {
***************
*** 223,228
if (!rn2(6)) {
otmp = mksobj(SPEAR);
mpickobj(mtmp, otmp); }
if (!rn2(2)) {
otmp = mksobj(TIN);
mpickobj(mtmp, otmp); }

--- 263,271 -----
if (!rn2(7)) {
otmp = mksobj(SPEAR);
mpickobj(mtmp, otmp); }
+ if (!rn2(3)) {
+ otmp = mksobj(K_RATION);
+ mpickobj(mtmp, otmp); }
if (!rn2(2)) {
otmp = mksobj(C_RATION);
mpickobj(mtmp, otmp); }
***************
*** 224,230
otmp = mksobj(SPEAR);
mpickobj(mtmp, otmp); }
if (!rn2(2)) {
! otmp = mksobj(TIN);
mpickobj(mtmp, otmp); }
# endif /* SAC /**/
# ifdef KOPS

--- 267,273 -----
otmp = mksobj(K_RATION);
mpickobj(mtmp, otmp); }
if (!rn2(2)) {
! otmp = mksobj(C_RATION);
mpickobj(mtmp, otmp); }
# endif /* SAC /**/
# ifdef KOPS
*** ./mhitu.c.orig Mon Feb 22 08:40:06 1988
--- ./mhitu.c Thu Mar 31 09:08:57 1988
***************
*** 1,4
! /* SCCS Id: @(#)mhitu.c 2.1 87/10/18
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */

#include "hack.h"

--- 1,4 -----
! /* SCCS Id: @(#)mhitu.c 2.3 88/01/21
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */

#include "hack.h"
***************
*** 8,13
extern char pl_character[];
#endif

/*
* mhitu: monster hits you
* returns 1 if monster dies (e.g. 'y', 'F'), 0 otherwise

--- 8,22 -----
extern char pl_character[];
#endif

+ char *breathe[]= { "fragments",
+ "fire",
+ "sleep gas",
+ "frost",
+ "death",
+ "lightening",
+ "poison gas",
+ "acid" };
+
/*
* mhitu: monster hits you
* returns 1 if monster dies (e.g. 'y', 'F'), 0 otherwise
***************
*** 86,92
tmp += hitu(mtmp,d(mdat->damn,mdat->damd));

ctmp = tmp && !mtmp->mcan &&
! (!uarm || objects[uarm->otyp].a_can < rnd(3) || !rn2(50));
switch(mdat->mlet) {
case '1':
if(wiz_hit(mtmp)) return(1); /* he disappeared */

--- 95,101 -----
tmp += hitu(mtmp,d(mdat->damn,mdat->damd));

ctmp = tmp && !mtmp->mcan &&
! (!uarm || objects[uarm->otyp].a_can < rnz(3));
switch(mdat->mlet) {
case '1':
if(wiz_hit(mtmp)) return(1); /* he disappeared */
***************
*** 92,98
if(wiz_hit(mtmp)) return(1); /* he disappeared */
break;
case '&':
! demon_hit(mtmp);
break;
case ',':
if(tmp) justswld(mtmp,Monnam(mtmp));

--- 101,110 -----
if(wiz_hit(mtmp)) return(1); /* he disappeared */
break;
case '&':
! if(mtmp->isdjinni) {
! (void) hitu(mtmp,d(mdat->damn, mdat->damd));
! (void) hitu(mtmp,d(mdat->damn, mdat->damd));
! } else demon_hit(mtmp);
break;
case ',':
if(tmp) justswld(mtmp,Monnam(mtmp));
***************
*** 102,107
break;
case ';':
if(ctmp) {
if(!u.ustuck && !rn2(10)) {
pline("%s swings itself around you!",
Monnam(mtmp));

--- 114,127 -----
break;
case ';':
if(ctmp) {
+ if (!rn2(6)) {
+ if (!Blind)
+ pline("%s shocks you!", Monnam(mtmp));
+ else pline("It shocks you!");
+ if (Shock_resistance)
+ pline("You aren't affected!");
+ else losehp_m(d(4,6),mtmp);
+ } else
if(!u.ustuck && !rn2(10)) {
pline("%s swings itself around you!",
Monnam(mtmp));
***************
*** 148,155
(void) hitu(mtmp,rnd(8));
break;
}
! kludge("%s breathes fire!",Monnam(mtmp));
! buzz(-1,mtmp->mx,mtmp->my,u.ux-mtmp->mx,u.uy-mtmp->my);
break;
case 'd':
(void) hitu(mtmp,d(2, (flags.moonphase == FULL_MOON) ? 3 : 4));

--- 168,176 -----
(void) hitu(mtmp,rnd(8));
break;
}
! kludge("%s breathes %s!",Monnam(mtmp), breathe[mtmp->dragon]);
! buzz((int) -10 - (mtmp->dragon),
! mtmp->mx,mtmp->my,u.ux-mtmp->mx,u.uy-mtmp->my);
break;
case 'd':
(void) hitu(mtmp,d(2, (flags.moonphase == FULL_MOON) ? 3 : 4));
***************
*** 174,179
}
mondead(mtmp);
return(1);
case 'g':
if(ctmp && multi >= 0 && !rn2(3)) {
/* fix so we don't know what hit us when blind KAA */

--- 195,210 -----
}
mondead(mtmp);
return(1);
+ case 'G':
+ if(!mtmp->isgremlin || mtmp->mcan) break;
+ if(!rn2(10)) {
+ if (Blind)
+ pline("You hear laughter.");
+ else
+ pline("%s chuckles.", Monnam(mtmp));
+ attrcurse();
+ }
+ break;
case 'g':
if(ctmp && multi >= 0 && !rn2(3)) {
/* fix so we do not know what hit us when blind KAA */
***************
*** 176,182
return(1);
case 'g':
if(ctmp && multi >= 0 && !rn2(3)) {
! /* fix so we don't know what hit us when blind KAA */
if (Blind)
pline("You are frozen by its juices!");
else

--- 207,213 -----
break;
case 'g':
if(ctmp && multi >= 0 && !rn2(3)) {
! /* fix so we do not know what hit us when blind KAA */
if (Blind)
pline("You are frozen by its juices!");
else
***************
*** 238,243
#ifdef KAA
&& u.usym == '@'
#endif
&& !uarm && !uarmh && !uarms && !uarmg) {
pline("%s hits! (I hope you don't mind)",
Monnam(mtmp));

--- 269,277 -----
#ifdef KAA
&& u.usym == '@'
#endif
+ #ifdef SHIRT
+ && !uarmu
+ #endif
&& !uarm && !uarmh && !uarms && !uarmg) {
pline("%s hits! (I hope you don't mind)",
Monnam(mtmp));
***************
*** 393,398
(void) hitu(mtmp,d(2,6));
break;
#endif
}
if(u.uhp < 1) done_in_by(mtmp);
return(0);

--- 427,444 -----
(void) hitu(mtmp,d(2,6));
break;
#endif
+ #ifdef STOOGES
+ case '@':
+ if(!mtmp->isstooge) break;
+ if(!tmp) break;
+ if(!rn2(6) && !Blind) {
+ pline ("%s poked you in the eye.", Monnam(mtmp));
+ pline ("You are blinded!");
+ Blinded += rnd(10);
+ seeoff(0);
+ }
+ break;
+ #endif
}
if(u.uhp < 1) done_in_by(mtmp);
return(0);
***************
*** 413,419
mtmp->mundetected = 0;
if(!Blind) {
register struct obj *obj;
! extern char * Xmonnam();
if(obj = o_at(mtmp->mx,mtmp->my))
pline("%s was hidden under %s!",
Xmonnam(mtmp), doname(obj));

--- 459,465 -----
mtmp->mundetected = 0;
if(!Blind) {
register struct obj *obj;
! extern char *Xmonnam();
if(obj = o_at(mtmp->mx,mtmp->my))
pline("%s was hidden under %s!",
Xmonnam(mtmp), doname(obj));
***************
*** 468,474

if(uwep && !strcmp(ONAME(uwep), "Excalibur")) {

! pline("%s looks very angry.", Xmonnam(mtmp, 1));
mtmp->mpeaceful = mtmp->mtame = 0;
return(0);
}

--- 514,520 -----

if(uwep && !strcmp(ONAME(uwep), "Excalibur")) {

! pline("%s looks very angry.", Xmonnam(mtmp));
mtmp->mpeaceful = mtmp->mtame = 0;
return(0);
}
***************
*** 475,481
if(!strcmp(mtmp->data->mname, "demon")) { /* not for regular '&'s */

pline("%s mutters something about awful working conditions.",
! Xmonnam(mtmp, 1));
return(0);
}

--- 521,527 -----
if(!strcmp(mtmp->data->mname, "demon")) { /* not for regular '&'s */

pline("%s mutters something about awful working conditions.",
! Xmonnam(mtmp));
return(0);
}

***************
*** 482,488
/* Slight advantage given. */
if(!strcmp(mtmp->data->mname, "demon prince") && mtmp->minvis) {

! if (!Blind) pline("%s appears before you.", Xmonnam(mtmp, 1));
mtmp->minvis = 0;
pmon(mtmp);
}

--- 528,534 -----
/* Slight advantage given. */
if(!strcmp(mtmp->data->mname, "demon prince") && mtmp->minvis) {

! if (!Blind) pline("%s appears before you.", Xmonnam(mtmp));
mtmp->minvis = 0;
pmon(mtmp);
}
***************
*** 489,495
if(u.usym == '&') { /* Won't blackmail their own. */

pline("%s says, 'Good hunting %s.' and vanishes",
! Xmonnam(mtmp, 1), flags.female ? "Sister" : "Brother");
rloc(mtmp);
return(1);
}

--- 535,541 -----
if(u.usym == '&') { /* Won't blackmail their own. */

pline("%s says, 'Good hunting %s.' and vanishes",
! Xmonnam(mtmp), flags.female ? "Sister" : "Brother");
rloc(mtmp);
return(1);
}
***************
*** 501,507
char buf[80];

pline("%s demands %d Zorkmids for safe passage.",
! Xmonnam(mtmp, 1), demand);
pline("how many will you offer him?");
getlin(buf);
sscanf(buf, "%d", &offer);

--- 547,553 -----
char buf[80];

pline("%s demands %d Zorkmids for safe passage.",
! Xmonnam(mtmp), demand);
pline("how many will you offer him?");
getlin(buf);
sscanf(buf, "%d", &offer);
*** ./mklev.c.orig Mon Feb 22 08:40:06 1988
--- ./mklev.c Thu Mar 31 09:08:55 1988
***************
*** 1,4
! /* SCCS Id: @(#)mklev.c 2.1 87/09/23
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */

#include "hack.h"

--- 1,4 -----
! /* SCCS Id: @(#)mklev.c 2.3 87/12/12
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */

#include "hack.h"
***************
*** 4,11
#include "hack.h"

extern char *getlogin(), *getenv();
! extern struct monst *makemon();
! extern struct obj *mkobj_at();
extern struct trap *maketrap();

#ifdef RPH

--- 4,11 -----
#include "hack.h"

extern char *getlogin(), *getenv();
! extern struct monst *makemon(), *mkmon_at();
! extern struct obj *mkobj_at(), *mksobj_at();
extern struct trap *maketrap();

#ifdef RPH
***************
*** 12,19
extern struct permonst pm_medusa;
#endif

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

#include "mkroom.h"
#define XLIM 4 /* define minimum required space around a room */

--- 12,20 -----
extern struct permonst pm_medusa;
#endif

! #ifdef STOOGES
! extern struct permonst pm_larry, pm_curly, pm_moe;
! #endif

#define somex() ((int)(rand()%(croom->hx-croom->lx+1))+croom->lx)
#define somey() ((int)(rand()%(croom->hy-croom->ly+1))+croom->ly)
***************
*** 15,20
#define somex() ((rand()%(croom->hx-croom->lx+1))+croom->lx)
#define somey() ((rand()%(croom->hy-croom->ly+1))+croom->ly)

#include "mkroom.h"
#define XLIM 4 /* define minimum required space around a room */
#define YLIM 3

--- 16,24 -----
extern struct permonst pm_larry, pm_curly, pm_moe;
#endif

+ #define somex() ((int)(rand()%(croom->hx-croom->lx+1))+croom->lx)
+ #define somey() ((int)(rand()%(croom->hy-croom->ly+1))+croom->ly)
+
#include "mkroom.h"
#define XLIM 4 /* define minimum required space around a room */
#define YLIM 3
***************
*** 60,72
oinit(); /* assign level dependent obj probabilities */
#ifdef RPH
if (u.wiz_level == 0) {
! u.medusa_level = rn1(3,25);
! u.wiz_level = d(3,10) + u.medusa_level;
! # ifdef WIZARD
! if (wizard && dlevel == 1)
! pline ("The wiz is at %d, and the medusa at %d",
! u.wiz_level, u.medusa_level);
! # endif
}
if (dlevel > u.medusa_level) {
makemaz();

--- 64,74 -----
oinit(); /* assign level dependent obj probabilities */
#ifdef RPH
if (u.wiz_level == 0) {
! u.medusa_level = rn1(3, (MAXLEVEL > 30) ? 25 : (MAXLEVEL - 4) );
! u.wiz_level = rn1(MAXLEVEL-u.medusa_level, u.medusa_level)+1;
! #ifdef STOOGES
! u.stooge_level = rn1(6,4);
! #endif
}
if (dlevel > u.medusa_level) {
makemaz();
***************
*** 96,101
mtmp->msleep = 1;
}
#endif
if(nroom > 1) {
troom = croom;
croom = &rooms[rn2(nroom-1)];

--- 98,124 -----
mtmp->msleep = 1;
}
#endif
+ #ifdef STOOGES
+ { struct monst *mtmp;
+ if (dlevel == u.stooge_level) { /* probably should use enexto */
+ mtmp = makemon(PM_MOE, xdnstair, ydnstair);
+ if (mtmp) mtmp->isstooge = 1;
+ if (mtmp) mtmp->mpeaceful = 1;
+ if (goodpos(xdnstair+1, ydnstair))
+ mtmp = makemon(PM_LARRY, xdnstair+1, ydnstair);
+ else if (goodpos(xdnstair-1, ydnstair))
+ mtmp = makemon(PM_LARRY, xdnstair-1, ydnstair);
+ if (mtmp) mtmp->isstooge = 1;
+ if (mtmp) mtmp->mpeaceful = 1;
+ if (goodpos(xdnstair, ydnstair+1))
+ mtmp = makemon(PM_CURLY, xdnstair, ydnstair+1);
+ else if (goodpos(xdnstair, ydnstair-1))
+ mtmp = makemon(PM_CURLY, xdnstair, ydnstair-1);
+ if (mtmp) mtmp->isstooge = 1;
+ if (mtmp) mtmp->mpeaceful = 1;
+ }
+ }
+ #endif
if(nroom > 1) {
troom = croom;
croom = &rooms[rn2(nroom-1)];
***************
*** 136,141
#ifdef FOUNTAINS
if(!rn2(10)) mkfount(0,croom);
#endif
if(!rn2(3)) {
(void) mkobj_at(0, somex(), somey());
tryct = 0;

--- 159,167 -----
#ifdef FOUNTAINS
if(!rn2(10)) mkfount(0,croom);
#endif
+ #ifdef SINKS
+ if(!rn2(80)) mksink(croom);
+ #endif
if(!rn2(3)) {
(void) mkobj_at(0, somex(), somey());
tryct = 0;
***************
*** 168,174
}

#ifdef WIZARD
! if(wizard && getenv("SHOPTYPE")) mkshop(); else
#endif
if(dlevel > 1 && dlevel < 20 && rn2(dlevel) < 3) mkshop();
else

--- 194,200 -----
}

#ifdef WIZARD
! if(wizard && getenv("SHOPTYPE")) mkroom(SHOPBASE); else
#endif
if(dlevel > 1 && dlevel < 20 && rn2(dlevel) < 3) mkroom(SHOPBASE);
else
***************
*** 170,176
#ifdef WIZARD
if(wizard && getenv("SHOPTYPE")) mkshop(); else
#endif
! if(dlevel > 1 && dlevel < 20 && rn2(dlevel) < 3) mkshop();
else
#ifdef NEWCLASS
if(dlevel > 4 && !rn2(6)) mkzoo(COURT);

--- 196,202 -----
#ifdef WIZARD
if(wizard && getenv("SHOPTYPE")) mkroom(SHOPBASE); else
#endif
! if(dlevel > 1 && dlevel < 20 && rn2(dlevel) < 3) mkroom(SHOPBASE);
else
#ifdef NEWCLASS
if(dlevel > 4 && !rn2(6)) mkroom(COURT);
***************
*** 173,179
if(dlevel > 1 && dlevel < 20 && rn2(dlevel) < 3) mkshop();
else
#ifdef NEWCLASS
! if(dlevel > 4 && !rn2(6)) mkzoo(COURT);
#endif
if(dlevel > 6 && !rn2(7)) mkzoo(ZOO);
else

--- 199,206 -----
if(dlevel > 1 && dlevel < 20 && rn2(dlevel) < 3) mkroom(SHOPBASE);
else
#ifdef NEWCLASS
! if(dlevel > 4 && !rn2(6)) mkroom(COURT);
! else
#endif
if(dlevel > 6 && !rn2(7)) mkroom(ZOO);
else
***************
*** 175,181
#ifdef NEWCLASS
if(dlevel > 4 && !rn2(6)) mkzoo(COURT);
#endif
! if(dlevel > 6 && !rn2(7)) mkzoo(ZOO);
else
if(dlevel > 9 && !rn2(5)) mkzoo(BEEHIVE);
else

--- 202,208 -----
if(dlevel > 4 && !rn2(6)) mkroom(COURT);
else
#endif
! if(dlevel > 6 && !rn2(7)) mkroom(ZOO);
else
if(dlevel > 9 && !rn2(5)) mkroom(BEEHIVE);
else
***************
*** 177,183
#endif
if(dlevel > 6 && !rn2(7)) mkzoo(ZOO);
else
! if(dlevel > 9 && !rn2(5)) mkzoo(BEEHIVE);
else
if(dlevel > 11 && !rn2(6)) mkzoo(MORGUE);
else

--- 204,210 -----
#endif
if(dlevel > 6 && !rn2(7)) mkroom(ZOO);
else
! if(dlevel > 9 && !rn2(5)) mkroom(BEEHIVE);
else
if(dlevel > 11 && !rn2(6)) mkroom(MORGUE);
else
***************
*** 179,185
else
if(dlevel > 9 && !rn2(5)) mkzoo(BEEHIVE);
else
! if(dlevel > 11 && !rn2(6)) mkzoo(MORGUE);
else
if(dlevel > 18 && !rn2(6)) mkswamp();
}

--- 206,212 -----
else
if(dlevel > 9 && !rn2(5)) mkroom(BEEHIVE);
else
! if(dlevel > 11 && !rn2(6)) mkroom(MORGUE);
else
#ifdef SAC
if(dlevel > 14 && !rn2(4)) mkroom(BARRACKS);
***************
*** 181,187
else
if(dlevel > 11 && !rn2(6)) mkzoo(MORGUE);
else
! if(dlevel > 18 && !rn2(6)) mkswamp();
}

makerooms() {

--- 208,218 -----
else
if(dlevel > 11 && !rn2(6)) mkroom(MORGUE);
else
! #ifdef SAC
! if(dlevel > 14 && !rn2(4)) mkroom(BARRACKS);
! else
! #endif
! if(dlevel > 18 && !rn2(6)) mkroom(SWAMP);
}

makerooms() {
***************
*** 700,705
#ifdef SPELLS
,""
#endif
};

makeniche(trap_type)

--- 731,745 -----
#ifdef SPELLS
,""
#endif
+ #ifdef KAA
+ ,""
+ #ifdef RPH
+ ,""
+ #endif
+ #endif
+ #ifdef SAC
+ ,""
+ #endif
};

makeniche(trap_type)
***************
*** 777,782
#ifdef NEWCLASS
nospikes, nolevltp,
#endif
tryct = 0;

xchar mx,my;

--- 817,825 -----
#ifdef NEWCLASS
nospikes, nolevltp,
#endif
+ #ifdef SAC
+ nolandmine,
+ #endif
tryct = 0;

xchar mx,my;
***************
*** 791,796
#ifdef SPIDERS
nospider = (dlevel < 7) ? 1 : 0;
#endif
nomimic = (dlevel < 9 || goldseen ) ? 1 : 0;
if(index(fut_geno, 'M')) nomimic = 1;

--- 834,842 -----
#ifdef SPIDERS
nospider = (dlevel < 7) ? 1 : 0;
#endif
+ #ifdef SAC
+ nolandmine = (dlevel < 5) ? 1 : 0;
+ #endif
nomimic = (dlevel < 9 || goldseen ) ? 1 : 0;
if(index(fut_geno, 'M')) nomimic = 1;

***************
*** 805,810
|| (kind == SPIKED_PIT && nospikes)
|| (kind == LEVEL_TELEP && nolevltp)
#endif
) kind = NO_TRAP;
} while(kind == NO_TRAP);
} else kind = num;

--- 851,859 -----
|| (kind == SPIKED_PIT && nospikes)
|| (kind == LEVEL_TELEP && nolevltp)
#endif
+ #ifdef SAC
+ || (kind == LANDMINE && nolandmine)
+ #endif
) kind = NO_TRAP;
} while(kind == NO_TRAP);
} else kind = num;
***************
*** 907,909
}
#endif /* FOUNTAINS /**/

--- 956,986 -----
}
#endif /* FOUNTAINS /**/

+ #ifdef SINKS
+ mksink(croom)
+ register struct mkroom *croom;
+ {
+ register xchar mx,my;
+ register int tryct = 0;
+
+ do {
+ if(++tryct > 200)
+ return;
+ mx = somex();
+ my = somey();
+ } while(t_at(mx, my) || levl[mx][my].typ == STAIRS
+ #ifdef FOUNTAINS
+ || IS_FOUNTAIN(levl[mx][my].typ)
+ #endif
+ #ifdef NEWCLASS
+ || IS_THRONE(levl[mx][my].typ)
+ #endif
+ );
+
+ /* Put a sink at mx, my */
+
+ levl[mx][my].typ = SINK;
+ levl[mx][my].scrsym = SINK_SYM;
+
+ }
+ #endif /* SINKS /**/
*** ./mkmaze.c.orig Thu Mar 31 08:35:21 1988
--- ./mkmaze.c Thu Mar 31 09:08:53 1988
***************
*** 1,4
! /* SCCS Id: @(#)mkmaze.c 2.1 87/10/18
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */

#include "hack.h"

--- 1,4 -----
! /* SCCS Id: @(#)mkmaze.c 2.3 88/03/31
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */

#include "hack.h"
***************
*** 3,9

#include "hack.h"
#include "mkroom.h" /* not really used */
! extern struct monst *makemon();
extern struct permonst pm_wizard;
extern struct obj *mkobj_at();
struct permonst hell_hound =

--- 3,9 -----

#include "hack.h"
#include "mkroom.h" /* not really used */
! extern struct monst *makemon(), *mkmon_at();
extern struct permonst pm_wizard;
extern struct obj *mkobj_at(), *mksobj_at();
struct permonst hell_hound =
***************
*** 5,11
#include "mkroom.h" /* not really used */
extern struct monst *makemon();
extern struct permonst pm_wizard;
! extern struct obj *mkobj_at();
struct permonst hell_hound =
{ "hell hound", 'd', 12, 14, 2, 20, 3, 6, 0 };

--- 5,11 -----
#include "mkroom.h" /* not really used */
extern struct monst *makemon(), *mkmon_at();
extern struct permonst pm_wizard;
! extern struct obj *mkobj_at(), *mksobj_at();
struct permonst hell_hound =
{ "hell hound", 'd', 12, 14, 2, 20, 3, 6, 0 };

*** ./mkobj.c.orig Mon Feb 22 08:40:07 1988
--- ./mkobj.c Thu Mar 31 09:08:55 1988
***************
*** 1,4
! /* SCCS Id: @(#)mkobj.c 2.2 87/11/29
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */

#include "hack.h"

--- 1,4 -----
! /* SCCS Id: @(#)mkobj.c 2.3 88/02/11
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */

#include "hack.h"
***************
*** 129,134
case GEM_SYM:
otmp->quan = rn2(6) ? 1 : 2;
case TOOL_SYM:
case CHAIN_SYM:
case BALL_SYM:
case ROCK_SYM:

--- 129,137 -----
case GEM_SYM:
otmp->quan = rn2(6) ? 1 : 2;
case TOOL_SYM:
+ if(otmp->otyp == LAMP) otmp->spe = rnd(10);
+ else if(otmp->otyp == MAGIC_LAMP) otmp->spe = 1;
+ else if(otmp->otyp == MAGIC_MARKER) otmp->spe = rnd(100);
case CHAIN_SYM:
case BALL_SYM:
case ROCK_SYM:
*** ./mkshop.c.orig Mon Feb 22 08:40:07 1988
--- ./mkshop.c Thu Mar 31 11:19:13 1988
***************
*** 1,4
! /* SCCS Id: @(#)mkshop.c 2.1 87/09/23
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */

#ifndef QUEST

--- 1,4 -----
! /* SCCS Id: @(#)mkshop.c 2.3 87/12/12
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */

/*
***************
*** 1,6
/* SCCS Id: @(#)mkshop.c 2.1 87/09/23
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */

#ifndef QUEST
#include "hack.h"
#include "mkroom.h"

--- 1,17 -----
/* SCCS Id: @(#)mkshop.c 2.3 87/12/12
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */

+ /*
+ * Entry points:
+ * mkroom() -- make and stock a room of a given type
+ * nexttodoor() -- return TRUE if adjacent to a door
+ * has_dnstairs() -- return TRUE if given room has a down staircase
+ * has_upstairs() -- return TRUE if given room has an up staircase
+ * dist2() -- Euclidean square-of-distance function
+ * courtmon() -- generate a court monster
+ *
+ * (note: this module should become mkroom.c in the next major release)
+ */
#ifndef QUEST
#include "hack.h"
#include "mkroom.h"
***************
*** 5,11
#include "hack.h"
#include "mkroom.h"
extern struct monst *makemon();
! extern struct obj *mkobj_at();
extern int nroom;

mkshop(){

--- 16,24 -----
#include "hack.h"
#include "mkroom.h"
extern struct monst *makemon();
! extern struct permonst pm_soldier;
! extern struct obj *mkobj_at(), *mksobj_at();
! extern void stock_room();
extern int nroom;

static boolean
***************
*** 8,13
extern struct obj *mkobj_at();
extern int nroom;

mkshop(){
register struct mkroom *sroom;
int roomno, i = -1;

--- 21,56 -----
extern void stock_room();
extern int nroom;

+ static boolean
+ isbig(sroom)
+ register struct mkroom *sroom;
+ {
+ register int area = (sroom->hx - sroom->lx) * (sroom->hy - sroom->ly);
+ return( area > 20 );
+ }
+
+ void
+ mkroom(roomtype)
+ /* make and stock a room of a given type */
+ int roomtype;
+ {
+ void mkshop(), mkzoo(), mkswamp();
+
+ if (roomtype >= SHOPBASE)
+ mkshop(); /* someday, we should be able to specify shop type */
+ else switch(roomtype)
+ {
+ case COURT: mkzoo(COURT); break;
+ case ZOO: mkzoo(ZOO); break;
+ case BEEHIVE: mkzoo(BEEHIVE); break;
+ case MORGUE: mkzoo(MORGUE); break;
+ case BARRACKS: mkzoo(BARRACKS); break;
+ case SWAMP: mkswamp(); break;
+ default: impossible("Tried to make a room of type %d.", roomtype);
+ }
+ }
+
+ static void
mkshop(){
register struct mkroom *sroom;
int roomno, i = -1;
***************
*** 36,41
return;
}
#endif
if(*ep == 's' || *ep == 'S'){
mkswamp();
return;

--- 79,90 -----
return;
}
#endif
+ #ifdef SAC
+ if(*ep == '3'){
+ mkzoo(BARRACKS);
+ return;
+ }
+ #endif /* SAC */
if(*ep == 's' || *ep == 'S'){
mkswamp();
return;
***************
*** 85,90
stock_room(&(shtypes[i]), sroom);
}

mkzoo(type)
int type;
{

--- 134,140 -----
stock_room(&(shtypes[i]), sroom);
}

+ static void
mkzoo(type)
int type;
{
***************
*** 122,127
#ifdef NEWCLASS
(type == COURT) ? courtmon() :
#endif
(type == MORGUE) ? morguemon() :
(type == BEEHIVE) ? PM_KILLER_BEE : (struct permonst *) 0,
sx, sy);

--- 172,180 -----
#ifdef NEWCLASS
(type == COURT) ? courtmon() :
#endif
+ #ifdef SAC
+ (type == BARRACKS) ? PM_SOLDIER :
+ #endif
(type == MORGUE) ? morguemon() :
(type == BEEHIVE) ? PM_KILLER_BEE : (struct permonst *) 0,
sx, sy);
***************
*** 158,164

}

! struct permonst *
morguemon()
{
extern struct permonst pm_ghost;

--- 211,217 -----

}

! static struct permonst *
morguemon()
{
extern struct permonst pm_ghost;
***************
*** 169,174
return((i < 40) ? PM_GHOST : (i < 60) ? PM_WRAITH : PM_ZOMBIE);
}

mkswamp() /* Michiel Huisjes & Fred de Wilde */
{
register struct mkroom *sroom;

--- 222,228 -----
return((i < 40) ? PM_GHOST : (i < 60) ? PM_WRAITH : PM_ZOMBIE);
}

+ static void
mkswamp() /* Michiel Huisjes & Fred de Wilde */
{
register struct mkroom *sroom;
***************
*** 197,202
}
}

nexttodoor(sx,sy)
register sx,sy;
{

--- 251,257 -----
}
}

+ boolean
nexttodoor(sx,sy)
register sx,sy;
{
***************
*** 205,212
for(dx = -1; dx <= 1; dx++) for(dy = -1; dy <= 1; dy++)
if((lev = &levl[sx+dx][sy+dy])->typ == DOOR ||
lev->typ == SDOOR || lev->typ == LDOOR)
! return(1);
! return(0);
}

has_dnstairs(sroom)

--- 260,267 -----
for(dx = -1; dx <= 1; dx++) for(dy = -1; dy <= 1; dy++)
if((lev = &levl[sx+dx][sy+dy])->typ == DOOR ||
lev->typ == SDOOR || lev->typ == LDOOR)
! return(TRUE);
! return(FALSE);
}

boolean
***************
*** 209,214
return(0);
}

has_dnstairs(sroom)
register struct mkroom *sroom;
{

--- 264,270 -----
return(FALSE);
}

+ boolean
has_dnstairs(sroom)
register struct mkroom *sroom;
{
***************
*** 216,221
sroom->ly <= ydnstair && ydnstair <= sroom->hy);
}

has_upstairs(sroom)
register struct mkroom *sroom;
{

--- 272,278 -----
sroom->ly <= ydnstair && ydnstair <= sroom->hy);
}

+ boolean
has_upstairs(sroom)
register struct mkroom *sroom;
{
***************
*** 223,235
sroom->ly <= yupstair && yupstair <= sroom->hy);
}

! isbig(sroom)
! register struct mkroom *sroom;
! {
! register int area = (sroom->hx - sroom->lx) * (sroom->hy - sroom->ly);
! return( area > 20 );
! }
!
dist2(x0,y0,x1,y1){
return((x0-x1)*(x0-x1) + (y0-y1)*(y0-y1));
}

--- 280,286 -----
sroom->ly <= yupstair && yupstair <= sroom->hy);
}

! int
dist2(x0,y0,x1,y1){
return((x0-x1)*(x0-x1) + (y0-y1)*(y0-y1));
}
***************
*** 234,239
return((x0-x1)*(x0-x1) + (y0-y1)*(y0-y1));
}

sq(a) int a; {
return(a*a);
}

--- 285,291 -----
return((x0-x1)*(x0-x1) + (y0-y1)*(y0-y1));
}

+ static int
sq(a) int a; {
return(a*a);
}
SHAR_EOF
if test 31961 -ne "`wc -c < 'Update.2.3.c'`"
then
echo shar: error transmitting "'Update.2.3.c'" '(should have been 31961 characters)'
fi
fi # end of overwriting check
# End of shell archive
exit 0
--
Mike Stephenson

Mail: Genamation Inc. Phone: (416) 475-9434
351 Steelcase Rd. W
Markham, Ontario. UUCP: uunet!{mnetor,utzoo}!genat!genpyr!mike
Canada L3R 3W1 uunet!{mnetor,utzoo}!genat!mike

Reply all
Reply to author
Forward
0 new messages