Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

NetHack 2.3 Update Pt. 06 of 12

13 views
Skip to first unread message

Mike Stephenson

unread,
Apr 12, 1988, 7:29:35 AM4/12/88
to
-------------------------------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.b
# This archive created: Mon Apr 4 08:52:30 1988
export PATH; PATH=/bin:$PATH
echo shar: extracting "'Update.2.3.b'" '(38558 characters)'
if test -f 'Update.2.3.b'
then
echo shar: will not over-write existing file "'Update.2.3.b'"
else
cat << \SHAR_EOF > 'Update.2.3.b'
*** ./dothrow.c.orig Mon Feb 22 08:40:02 1988
--- ./dothrow.c Tue Feb 2 08:28:47 1988
***************
*** 1,4
! /* SCCS Id: @(#)dothrow.c 2.1 87/11/01
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* dothrow.c - version 1.0 */

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

/* Contains code for 't' (throw) */
***************
*** 1,6
/* SCCS Id: @(#)dothrow.c 2.1 87/11/01
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
- /* dothrow.c - version 1.0 */

/* Contains code for 't' (throw) */

--- 1,5 -----
/* SCCS Id: @(#)dothrow.c 2.3 88/02/02
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */

/* Contains code for 't' (throw) */

***************
*** 158,165
} else if(obj->otyp == MIRROR) {
pline ("The mirror shatters. That's seven years bad luck!");
obfree(obj, Null(obj));
! u.uluck -= 2;
! if ((int)u.uluck < LUCKMIN) u.uluck = LUCKMIN;
#endif
} else if(obj->otyp == EGG) {
pline("\"Splash!\"");

--- 157,163 -----
} else if(obj->otyp == MIRROR) {
pline ("The mirror shatters. That's seven years bad luck!");
obfree(obj, Null(obj));
! change_luck(-2);
#endif
} else if(obj->otyp == EGG) {
pline("\"Splash!\"");
***************
*** 254,260
if(obj->dknown &&
objects[obj->otyp].oc_name_known) {
if(objects[obj->otyp].g_val > 0) {
! u.uluck += 5;
strcat(buf,addluck);
} else
strcat(buf,nogood);

--- 252,258 -----
if(obj->dknown &&
objects[obj->otyp].oc_name_known) {
if(objects[obj->otyp].g_val > 0) {
! change_luck(5);
strcat(buf,addluck);
} else
strcat(buf,nogood);
***************
*** 259,265
} else
strcat(buf,nogood);
} else { /* value unknown to @ */
! u.uluck++;
strcat(buf,addluck);
}
if(u.uluck > LUCKMAX) /* dan@ut-ngp */

--- 257,263 -----
} else
strcat(buf,nogood);
} else { /* value unknown to @ */
! change_luck(1);
strcat(buf,addluck);
}
pline(buf);
***************
*** 262,269
u.uluck++;
strcat(buf,addluck);
}
- if(u.uluck > LUCKMAX) /* dan@ut-ngp */
- u.uluck = LUCKMAX;
pline(buf);
mpickobj(mon, obj);
rloc(mon);

--- 260,265 -----
change_luck(1);
strcat(buf,addluck);
}
pline(buf);
mpickobj(mon, obj);
rloc(mon);
*** ./eat.c.orig Mon Feb 22 08:40:02 1988
--- ./eat.c Wed Dec 16 12:33:42 1987
***************
*** 1,4
! /* SCCS Id: @(#)eat.c 2.2 87/11/29
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */

#include "hack.h"

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

#include "hack.h"
***************
*** 448,453
else if (otmp->otyp == DEAD_GIANT) let='9';
else let = CORPSE_I_TO_C(otmp->otyp);
#endif
if(let != 'a' && moves > otmp->age + 50 + rn2(100)) {
tp++;
pline("Ulch -- that meat was tainted!");

--- 448,456 -----
else if (otmp->otyp == DEAD_GIANT) let='9';
else let = CORPSE_I_TO_C(otmp->otyp);
#endif
+ #ifdef SAC
+ if(otmp->otyp == DEAD_SOLDIER) let='3';
+ #endif /* SAC */
if(let != 'a' && moves > otmp->age + 50 + rn2(100)) {
tp++;
pline("Ulch -- that meat was tainted!");
*** ./end.c.orig Mon Feb 22 08:40:03 1988
--- ./end.c Thu Mar 31 11:37:29 1988
***************
*** 1,4
! /* SCCS Id: @(#)end.c 2.1 87/10/07
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */

#include <stdio.h>

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

#include <stdio.h>
***************
*** 55,62
done_in_by(mtmp)
register struct monst *mtmp;
{
! char *hallmon();
! static char buf[BUFSZ], *prefix;
extern char *eos(), *shkname();
pline("You die ...");
if (Hallucination) {

--- 55,61 -----
done_in_by(mtmp)
register struct monst *mtmp;
{
! static char buf[BUFSZ];
extern char *eos(), *shkname();

pline("You die ...");
***************
*** 58,63
char *hallmon();
static char buf[BUFSZ], *prefix;
extern char *eos(), *shkname();
pline("You die ...");
if (Hallucination) {
Sprintf(buf, "hallucinated %s (actually ", hallmon());

--- 57,63 -----
{
static char buf[BUFSZ];
extern char *eos(), *shkname();
+
pline("You die ...");
Sprintf(buf, "");
if (mtmp->minvis)
***************
*** 59,68
static char buf[BUFSZ], *prefix;
extern char *eos(), *shkname();
pline("You die ...");
! if (Hallucination) {
! Sprintf(buf, "hallucinated %s (actually ", hallmon());
! prefix = (index("aeiou",*mtmp->data->mname) ? "an" : "a");
! }
if(mtmp->data->mlet == ' ') {
if (Hallucination) Sprintf(eos(buf), "the ghost of %s)",
(char *) mtmp->mextra);

--- 59,70 -----
extern char *eos(), *shkname();

pline("You die ...");
! Sprintf(buf, "");
! if (mtmp->minvis)
! Sprintf(eos(buf), "invisible ");
! if (Hallucination)
! Sprintf(eos(buf), "hallucinogen-distorted ");
!
if(mtmp->data->mlet == ' ') {
register char *gn = (char *) mtmp->mextra;
if (!Hallucination && !mtmp->minvis && *gn)
***************
*** 64,82
prefix = (index("aeiou",*mtmp->data->mname) ? "an" : "a");
}
if(mtmp->data->mlet == ' ') {
! if (Hallucination) Sprintf(eos(buf), "the ghost of %s)",
! (char *) mtmp->mextra);
! else Sprintf(buf, "the ghost of %s", (char *) mtmp->mextra);
! } else if(mtmp->mnamelth) {
! if (Hallucination) Sprintf(eos(buf), "%s %s called %s)",
! prefix, mtmp->data->mname,
! NAME(mtmp));
! else Sprintf(buf, "%s called %s",
! mtmp->data->mname, NAME(mtmp));
! } else if(mtmp->minvis) {
! if (Hallucination) Sprintf(eos(buf), "an invisible %s)",
! mtmp->data->mname);
! else Sprintf(buf, "invisible %s", mtmp->data->mname);
} else if(mtmp->isshk) {
if (Hallucination) Sprintf(eos(buf), "%s %s the shopkeeper)",
rn2(2) ? "Mr." : "Ms.",

--- 66,75 -----
Sprintf(eos(buf), "hallucinogen-distorted ");

if(mtmp->data->mlet == ' ') {
! register char *gn = (char *) mtmp->mextra;
! if (!Hallucination && !mtmp->minvis && *gn)
! Sprintf(eos(buf), "the ");
! Sprintf(eos(buf), (*gn ? "ghost of %s" : "ghost%s"), gn);
} else if(mtmp->isshk) {
Sprintf(eos(buf), "%s %s, the shopkeeper)",
(rn2(2) ? "Mr." : "Ms."), shkname(mtmp));
***************
*** 78,93
mtmp->data->mname);
else Sprintf(buf, "invisible %s", mtmp->data->mname);
} else if(mtmp->isshk) {
! if (Hallucination) Sprintf(eos(buf), "%s %s the shopkeeper)",
! rn2(2) ? "Mr." : "Ms.",
! shkname(mtmp));
! else Sprintf(buf, "%s %s, the shopkeeper!",
! rn2(2) ? "Mr." : "Ms.", shkname(mtmp));
! } else {
! if (Hallucination) Sprintf(eos(buf), "%s %s)",
! prefix, mtmp->data->mname);
! else Sprintf(buf, "%s", mtmp->data->mname);
! }
killer = buf;
done("died");
}

--- 71,80 -----
Sprintf(eos(buf), "the ");
Sprintf(eos(buf), (*gn ? "ghost of %s" : "ghost%s"), gn);
} else if(mtmp->isshk) {
! Sprintf(eos(buf), "%s %s, the shopkeeper)",
! (rn2(2) ? "Mr." : "Ms."), shkname(mtmp));
! } else Sprintf(eos(buf), "%s", mtmp->data->mname);
! if (mtmp->mnamelth) Sprintf(eos(buf), " called %s", NAME(mtmp));
killer = buf;
done("died");
}
***************
*** 202,208
#endif
settty((char *) 0); /* does a clear_screen() */
if(!done_stopprint)
! printf("Goodbye %s %s...\n\n", pl_character, plname);
{ long int tmp;
tmp = u.ugold - u.ugold0;
if(tmp < 0)

--- 189,195 -----
#endif
settty((char *) 0); /* does a clear_screen() */
if(!done_stopprint)
! printf("Goodbye %s %s...\n\n", (Badged) ? "Officer" : pl_character, plname);
{ long int tmp;
tmp = u.ugold - u.ugold0;
if(tmp < 0)
***************
*** 306,311
getret(); /* all those pieces of coloured glass ... */
cls();
}
#ifdef WIZARD
if(!wizard)
#endif

--- 293,301 -----
getret(); /* all those pieces of coloured glass ... */
cls();
}
+ #ifdef MSDOSCOLOR
+ end_screen();
+ #endif
#ifdef WIZARD
if(!wizard)
#endif
***************
*** 314,323
#ifdef APOLLO
getret();
#endif
- #ifdef MSDOSCOLOR
- getret();
- end_screen();
- #endif
exit(0);
}
clearlocks(){

--- 304,309 -----
#ifdef APOLLO
getret();
#endif
exit(0);
}
clearlocks(){
***************
*** 351,372
while(*s) s++;
*s++ = c;
*s = 0;
- }
-
- char *
- hallmon()
- {
- register char let;
- register int ct;
- register struct permonst *ptr;
-
- let = rndmonsym();
- for(ct = 0; ct < CMNUM+1 ; ct++) {
- ptr = &mons[ct];
- if(ptr->mlet == let) return(ptr->mname);
-
- }
- return("giant eel");
}

#ifdef KJSMODS

--- 337,342 -----
while(*s) s++;
*s++ = c;
*s = 0;
}

#ifdef KJSMODS
*** ./engrave.c.orig Mon Feb 22 08:40:03 1988
--- ./engrave.c Thu Feb 18 13:26:05 1988
***************
*** 1,4
! /* SCCS Id: @(#)engrave.c 2.0 87/09/14
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */

#include "hack.h"

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

#include "hack.h"
***************
*** 244,249
type = DUST;
} else {
switch(otmp->otyp) {
case WAN_FIRE:
if(!objects[otmp->otyp].oc_name_known) {
pline("The %s is a wand of fire!",

--- 244,258 -----
type = DUST;
} else {
switch(otmp->otyp) {
+ case WAN_LIGHTNING:
+ if(!objects[otmp->otyp].oc_name_known) {
+ pline("The %s is a wand of lightning!",
+ xname(otmp));
+ objects[otmp->otyp].oc_name_known = 1;
+ more_experienced(0,10);
+ }
+ type = BURN;
+ break;
case WAN_FIRE:
if(!objects[otmp->otyp].oc_name_known) {
pline("The %s is a wand of fire!",
***************
*** 390,400
len = strlen(sp);
if(!len || *buf == '\033') {
/* changed by GAN 11/01/86 to not recharge wand */
- if(type == BURN)
- pline("A few sparks fly from the wand of fire.");
- else
- if(otmp->otyp == WAN_DIGGING)
- pline("Gravel flies up from the floor.");
return(1);
}
/* kludge by stewr 870708 */

--- 399,404 -----
len = strlen(sp);
if(!len || *buf == '\033') {
/* changed by GAN 11/01/86 to not recharge wand */
return(1);
}
if(otmp->otyp == WAN_FIRE) {
***************
*** 397,402
pline("Gravel flies up from the floor.");
return(1);
}
/* kludge by stewr 870708 */
for (sptmp = sp, tmp=0; !(tmp == len); sptmp++,tmp++) {
if (((type == DUST) && !rn2(25))

--- 401,420 -----
/* changed by GAN 11/01/86 to not recharge wand */
return(1);
}
+ if(otmp->otyp == WAN_FIRE) {
+ if (!Blind) pline("Flames fly from the wand.");
+ else pline("You feel the wand heat up.");
+ } else if(otmp->otyp == WAN_LIGHTNING) {
+ if (!Blind) {
+ pline("Sparks fly from the wand.");
+ pline("You are blinded by the flashing!");
+ Blinded += rnd(50);
+ seeoff(0);
+ } else pline("You hear crackling!");
+ } else if(otmp->otyp == WAN_DIGGING) {
+ if (!Blind) pline("Gravel flies up from the floor.");
+ else pline("You hear drilling!");
+ }
/* kludge by stewr 870708 */
for (sptmp = sp, tmp=0; !(tmp == len); sptmp++,tmp++) {
if (((type == DUST) && !rn2(25))
*** ./fight.c.orig Mon Feb 22 08:40:04 1988
--- ./fight.c Thu Mar 31 09:08:55 1988
***************
*** 1,4
! /* SCCS Id: @(#)fight.c 2.1 87/10/17
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */

#include <stdio.h>

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

#include <stdio.h>
***************
*** 14,20
extern struct monst *mkmon_at();
#endif
#ifdef RPH
! extern struct obj *mk_named_obj();
#endif

static boolean far_noise;

--- 14,20 -----
extern struct monst *mkmon_at();
#endif
#ifdef RPH
! extern struct obj *mk_named_obj_at();
#endif

static boolean far_noise;
***************
*** 20,25
static boolean far_noise;
static long noisetime;

/* hitmm returns 0 (miss), 1 (hit), or 2 (kill) */
hitmm(magr,mdef) register struct monst *magr,*mdef; {
register struct permonst *pa = magr->data, *pd = mdef->data;

--- 20,64 -----
static boolean far_noise;
static long noisetime;

+ #ifdef STOOGES
+ char random_joke[][30] = {"Why I ought a ...",
+ "You'll get what's comming!",
+ "I'll murder you!",
+ "I get no respect!",
+ "Right in the kisser!",
+ "Wait a minute!",
+ "Take it easy!",
+ "Alright already!",
+ "That's more like it!",
+ "Well excuse me!",
+ "Take that!",
+ "I'll fix you!",
+ "I'm sorry!",
+ "Your mama!",
+ "Shut up!",
+ "Listen you!",
+ "Pardon me!",
+ "Not that!",
+ "Quiet!",
+ "Relax!",
+ "Certainly!",
+ "Ouch!",
+ "What happened?",
+ "What was that for?",
+ "What's the matter with you?",
+ "Oh Yea?",
+ "Wise guy eh?",
+ "How about a knuckle sandwich?",
+ "You coward!",
+ "You rat you!",
+ "You chuckelhead!",
+ "You bonehead!",
+ "You numbskull!",
+ "Nyak Nyak Nyak ...",
+ "Woop Woop Woop Woop ..."};
+ #define RAND_JOKE 35
+ #endif
+
/* hitmm returns 0 (miss), 1 (hit), or 2 (kill) */
hitmm(magr,mdef) register struct monst *magr,*mdef; {
register struct permonst *pa = magr->data, *pd = mdef->data;
***************
*** 53,58
farq ? " in the distance" : "");
}
}
if(hit){
if(magr->data->mlet == 'c' && !magr->cham) {
magr->mhpmax += 3;

--- 92,136 -----
farq ? " in the distance" : "");
}
}
+ #ifdef STOOGES
+ if (hit && magr->isstooge) {
+ if (!rn2(6) && !index("afgvyF",mdef->data->mlet)) {
+ if(vis)
+ pline("%s is poked in the eye!", Monnam(mdef));
+ mdef->mcansee = 0;
+ mdef->mblinded += rnd(10);
+ if (mdef->mblinded <= 0) mdef->mblinded = 127;
+ } else if (vis && mdef->isstooge)
+ switch (rn2(100)) {
+ case 0 : pline("%s is shoved!", Monnam(mdef));
+ break;
+ case 1 : pline("%s is kicked!", Monnam(mdef));
+ break;
+ case 2 : pline("%s is slapped!", Monnam(mdef));
+ break;
+ case 3 : pline("%s is slugged!", Monnam(mdef));
+ break;
+ case 4 : pline("%s is punched!", Monnam(mdef));
+ break;
+ case 5 : pline("%s is pinched!", Monnam(mdef));
+ break;
+ case 6 : pline("But %s dodges!", monnam(mdef));
+ break;
+ case 7 : pline("But %s ducks!", monnam(mdef));
+ break;
+ case 8 : pline("%s gets a black eye!", Monnam(mdef));
+ break;
+ case 9 : pline("%s gets a bloody nose!", Monnam(mdef));
+ break;
+ case 10: pline("%s gets a broken tooth!", Monnam(mdef));
+ break;
+ }
+ if (!rn2(2))
+ stoogejoke();
+ }
+ if (magr->isstooge && mdef->isstooge)
+ return(hit); /* stooges don't damage each other */
+ #endif
if(hit){
if(magr->data->mlet == 'c' && !magr->cham) {
magr->mhpmax += 3;
***************
*** 99,104
* corpse (like Keystone Kops above). */
if(!(pd->mlet == 'r' && dlevel < 4))
#endif
if(letter(pd->mlet) && rn2(3)) {
if (pd->mlet == '1') panic("mondied: making obj '1'");
#ifndef RPH

--- 177,184 -----
* corpse (like Keystone Kops above). */
if(!(pd->mlet == 'r' && dlevel < 4))
#endif
+ if(!(pd->mlet == '&' && mdef->isdjinni)) /* no djinni corpse */
+ if(!(pd->mlet == 'G' && mdef->isgremlin)) /* no gremlin corpse */
if(letter(pd->mlet) && rn2(3)) {
if (pd->mlet == '1') panic("mondied: making obj '1'");
#ifndef RPH
***************
*** 321,326
else if(mon->data->mlet == 'O' && obj->otyp == TWO_HANDED_SWORD
&& !strcmp(ONAME(obj), "Orcrist")) tmp += rnd(10);

} else switch(obj->otyp) {
case HEAVY_IRON_BALL:
tmp = rnd(25); break;

--- 401,409 -----
else if(mon->data->mlet == 'O' && obj->otyp == TWO_HANDED_SWORD
&& !strcmp(ONAME(obj), "Orcrist")) tmp += rnd(10);

+ else if((obj->otyp == SHORT_SWORD || obj->otyp == DAGGER)
+ && !strcmp(ONAME(obj), "Sting")) tmp += rnd(5);
+
} else switch(obj->otyp) {
case HEAVY_IRON_BALL:
tmp = rnd(25); break;
***************
*** 329,336
#ifdef RPH
case MIRROR:
pline("You break your mirror. That's bad luck!");
! u.uluck -= 2;
! if ((int)u.uluck < LUCKMIN) u.uluck = LUCKMIN;
freeinv(obj);
if(obj->owornmask)
setworn((struct obj *) 0, obj->owornmask);

--- 412,418 -----
#ifdef RPH
case MIRROR:
pline("You break your mirror. That's bad luck!");
! change_luck(-2);
freeinv(obj);
if(obj->owornmask)
setworn((struct obj *) 0, obj->owornmask);
***************
*** 466,472
char *dname; /* added by Janet Walz (walz@mimsy) */
mtmp->mflee = 1;
mtmp->mfleetim = rnd(6);
! if (dname = NAME(mtmp))
pline("You stop to avoid hitting %s.",dname);
else
pline("You stop to avoid hitting your dog.");

--- 548,554 -----
char *dname; /* added by Janet Walz (walz@mimsy) */
mtmp->mflee = 1;
mtmp->mfleetim = rnd(6);
! if(*(dname = NAME(mtmp)))
pline("You stop to avoid hitting %s.",dname);
else
pline("You stop to avoid hitting your dog.");
***************
*** 606,612
nomul((u.ulevel > 6 || rn2(4)) ? rn1(20,-21) : -200);
} else {
pline("%s cannot defend itself.", Amonnam(mtmp,"blinded"));
! if(!rn2(500)) if((int)u.uluck > LUCKMIN) u.uluck--;
}
}
return(TRUE);

--- 688,694 -----
nomul((u.ulevel > 6 || rn2(4)) ? rn1(20,-21) : -200);
} else {
pline("%s cannot defend itself.", Amonnam(mtmp,"blinded"));
! if(!rn2(500)) change_luck(-1);
}
}
return(TRUE);
***************
*** 611,613
}
return(TRUE);
}

--- 693,701 -----
}
return(TRUE);
}
+
+ #ifdef STOOGES
+ stoogejoke() { /* have the stooges say something funny */
+ pline("'%s'", random_joke[rn2(RAND_JOKE)]);
+ }
+ #endif
*** ./fountain.c.orig Mon Feb 22 08:40:04 1988
--- ./fountain.c Thu Feb 11 13:39:11 1988
***************
*** 1,5
! /* SCCS Id: @(#)fountain.c 2.1 87/10/19
! /* fountain.c v 1.4.3 */

/*
* Revision 1.4.3 87/11/25 19:16:00 M. Stephenson

--- 1,5 -----
! /* SCCS Id: @(#)fountain.c 2.3 88/01/21
! /* fountain.c v 1.4.4 */

/*
* Revision 1.4.4 88/02/11 08:31:00 M. Stephenson
***************
*** 2,7
/* fountain.c v 1.4.3 */

/*
* Revision 1.4.3 87/11/25 19:16:00 M. Stephenson
* Implemented levitation bug fixes.
*

--- 2,11 -----
/* fountain.c v 1.4.4 */

/*
+ * Revision 1.4.4 88/02/11 08:31:00 M. Stephenson
+ * Implemented "coins" fixes by wood...@bme.unc.edu
+ * Fixed minor bugs.
+ *
* Revision 1.4.3 87/11/25 19:16:00 M. Stephenson
* Implemented levitation bug fixes.
*
***************
*** 5,10
* Revision 1.4.3 87/11/25 19:16:00 M. Stephenson
* Implemented levitation bug fixes.
*
* Revision 1.4.2 87/10/19 11:48:00 M. Stephenson
* Implementation of KJS bug fixes.
*

--- 9,17 -----
* Revision 1.4.3 87/11/25 19:16:00 M. Stephenson
* Implemented levitation bug fixes.
*
+ * Revision 1.4.3 87/11/25 19:16:00 M. Stephenson
+ * Implemented levitation bug fixes.
+ *
* Revision 1.4.2 87/10/19 11:48:00 M. Stephenson
* Implementation of KJS bug fixes.
*
***************
*** 35,42
extern char genocided[];

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

dowatersnakes() /* Fountain of snakes! */ {
register int num = rnd(6);

--- 42,49 -----
extern char genocided[];

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

dowatersnakes() /* Fountain of snakes! */ {
register int num = rnd(6);
***************
*** 313,319
pline("You feel a sudden chill.");
break;
case 28: /* Strange feeling */
! pline("An urge to take a bath nearly overwhelms you.");
break;
case 29: /* You see coins */
pline("Far below you, you see coins glistening in the water.");

--- 320,330 -----
pline("You feel a sudden chill.");
break;
case 28: /* Strange feeling */
! pline("An urge to take a bath overwhelms you.");
! if (u.ugold > 10) {
! u.ugold -= somegold()/10;
! pline("You lost some of your gold in the fountain!");
! }
break;
case 29: /* You see coins */

***************
*** 316,321
pline("An urge to take a bath nearly overwhelms you.");
break;
case 29: /* You see coins */
pline("Far below you, you see coins glistening in the water.");
break;
default:

--- 327,338 -----
}
break;
case 29: /* You see coins */
+
+ /* We make fountains have more coins the closer you are to the
+ * surface. After all, there will have been more people going
+ * by. Just like a shopping mall! Chris Woodbury */
+
+ mkgold((long)(rnd((MAXLEVEL-dlevel)*2)+5),u.ux,u.uy);
pline("Far below you, you see coins glistening in the water.");
break;
default:
*** ./hack.c.orig Mon Feb 22 08:40:04 1988
--- ./hack.c Tue Mar 29 08:36:16 1988
***************
*** 3,9
#include <stdio.h>
#include "hack.h"
#ifdef UNIX
! static char SCCS_Id[] = "@(#)hack.c 2.2\t87/12/01";
#endif
extern char news0();
extern char *nomovemsg;

--- 3,9 -----
#include <stdio.h>
#include "hack.h"
#ifdef UNIX
! static char SCCS_Id[] = "@(#)hack.c 2.3\t88/02/18";
#endif
extern char news0();
extern char *nomovemsg;
***************
*** 244,250
u.utrap--;
#endif
} else {
! pline("You are caught in a beartrap.");
if((u.dx && u.dy) || !rn2(5)) u.utrap--;
}
return;

--- 244,250 -----
u.utrap--;
#endif
} else {
! pline("You are caught in a bear trap.");
if((u.dx && u.dy) || !rn2(5)) u.utrap--;
}
return;
***************
*** 304,309
#ifdef NEWCLASS
|| IS_THRONE(levl[u.ux][u.uy].typ)
#endif
)
nomul(0);
}

--- 304,312 -----
#ifdef NEWCLASS
|| IS_THRONE(levl[u.ux][u.uy].typ)
#endif
+ #ifdef SINKS
+ || IS_SINK(levl[u.ux][u.uy].typ)
+ #endif
)
nomul(0);
}
***************
*** 308,313
nomul(0);
}

if(tmpr->typ == POOL && !Levitation)
drown(); /* not necessarily fatal */

--- 311,320 -----
nomul(0);
}

+ #ifdef SINKS
+ if(IS_SINK(levl[u.ux][u.uy].typ) && Levitation)
+ dosinkfall();
+ #endif
if(tmpr->typ == POOL && !Levitation)
drown(); /* not necessarily fatal */

***************
*** 1044,1046
{
return(10*(1L << (u.ulevel-1)));
}

--- 1051,1087 -----
{
return(10*(1L << (u.ulevel-1)));
}
+
+ change_luck(n)
+ register schar n;
+ {
+ u.uluck += n;
+ if (u.uluck < 0 && u.uluck < LUCKMIN) u.uluck = LUCKMIN;
+ if (u.uluck > 0 && u.uluck > LUCKMAX) u.uluck = LUCKMAX;
+ }
+
+ #ifdef SINKS
+ dosinkfall() {
+ register struct obj *obj;
+ pline("You crash to the floor!");
+ losehp(rn2(15) + 3*u.ulevel,"fall onto a sink");
+ for(obj=fobj; obj; obj=obj->nobj)
+ if(obj->ox == u.ux && obj->oy == u.uy && obj->olet == WEAPON_SYM) {
+ pline("You fell on %s.",doname(obj));
+ losehp(rn2(3),"fall onto a sink");
+ }
+
+ Levitation += 1;
+ if(uleft && uleft->otyp == RIN_LEVITATION) {
+ obj = uleft;
+ ringoff(obj);
+ off_msg(obj);
+ }
+ if(uright && uright->otyp == RIN_LEVITATION) {
+ obj = uright;
+ ringoff(obj);
+ off_msg(obj);
+ }
+ Levitation = 0;
+ }
+ #endif
*** ./hack.h.orig Mon Feb 22 08:40:04 1988
--- ./hack.h Thu Mar 31 11:41:28 1988
***************
*** 1,4
! /* SCCS Id: @(#)hack.h 2.1 87/10/18
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */

#ifndef HACK_H

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

#ifndef HACK_H
***************
*** 4,11
#ifndef HACK_H
#define HACK_H

- #include "extern.h"
-
#ifdef __TURBOC__
/* work around the case-insensitivity of the DOS linker */
#define Amonnam Amonnam_

--- 4,9 -----
#ifndef HACK_H
#define HACK_H

#ifdef __TURBOC__
/* work around the case-insensitivity of the DOS linker */
#define Amonnam Amonnam_
***************
*** 19,24
#define itoa itoa_
#endif


#define Null(type) ((struct type *) 0)

--- 17,23 -----
#define itoa itoa_
#endif

+ #include "extern.h"

#define Null(type) ((struct type *) 0)

*** ./hh.orig Thu Mar 31 13:20:17 1988
--- ./hh Thu Mar 31 13:20:32 1988
***************
*** 41,47
x spells print a list of know spells
X Xcribe transcribe (learn) a spell
z zap zap a wand
! X cast cast a spell
C name name an individual monster (e.g., baptize your dog)
D Drop drop several things
E Engrave write a message in the dust on the floor (E- use fingers)

--- 41,47 -----
x spells print a list of know spells
X Xcribe transcribe (learn) a spell
z zap zap a wand
! Z cast cast a spell
C name name an individual monster (e.g., baptize your dog)
D Drop drop several things
E Engrave write a message in the dust on the floor (E- use fingers)
*** ./invent.c.orig Mon Feb 22 08:40:05 1988
--- ./invent.c Thu Mar 31 09:08:51 1988
***************
*** 1,4
! /* SCCS Id: @(#)invent.c 2.1 87/10/19
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */

#include <stdio.h>

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

#include <stdio.h>
***************
*** 5,10
#include "hack.h"
extern struct obj *splitobj();
extern struct obj zeroobj;
extern char morc;
extern char quitchars[];
static char *xprname();

--- 5,11 -----
#include "hack.h"
extern struct obj *splitobj();
extern struct obj zeroobj;
+ extern void savech();
extern char morc;
extern char quitchars[];
static char *xprname();
***************
*** 811,816
pline("There is an opulent throne here.");
}
#endif
if(u.ux == xupstair && u.uy == yupstair) {
fd++;
pline("There is a stairway up here.");

--- 812,823 -----
pline("There is an opulent throne here.");
}
#endif
+ #ifdef SINKS
+ if(IS_SINK(levl[u.ux][u.uy].typ)) {
+ fd++;
+ pline("There is a kitchen sink here.");
+ }
+ #endif
if(u.ux == xupstair && u.uy == yupstair) {
fd++;
pline("There is a stairway up here.");
***************
*** 941,946
}

doprarm(){
if(!uarm && !uarmg && !uarms && !uarmh)
pline("You are not wearing any armor.");
else {

--- 948,956 -----
}

doprarm(){
+ #ifdef SHIRT
+ if(!uarm && !uarmg && !uarms && !uarmh && !uarmu)
+ #else
if(!uarm && !uarmg && !uarms && !uarmh)
#endif
pline("You are not wearing any armor.");
***************
*** 942,947

doprarm(){
if(!uarm && !uarmg && !uarms && !uarmh)
pline("You are not wearing any armor.");
else {
char lets[6];

--- 952,958 -----
if(!uarm && !uarmg && !uarms && !uarmh && !uarmu)
#else
if(!uarm && !uarmg && !uarms && !uarmh)
+ #endif
pline("You are not wearing any armor.");
else {
#ifdef SHIRT
***************
*** 944,949
if(!uarm && !uarmg && !uarms && !uarmh)
pline("You are not wearing any armor.");
else {
char lets[6];
register int ct = 0;

--- 955,963 -----
#endif
pline("You are not wearing any armor.");
else {
+ #ifdef SHIRT
+ char lets[7];
+ #else
char lets[6];
#endif
register int ct = 0;
***************
*** 945,950
pline("You are not wearing any armor.");
else {
char lets[6];
register int ct = 0;

if(uarm) lets[ct++] = obj_to_let(uarm);

--- 959,965 -----
char lets[7];
#else
char lets[6];
+ #endif
register int ct = 0;

#ifdef SHIRT
***************
*** 947,952
char lets[6];
register int ct = 0;

if(uarm) lets[ct++] = obj_to_let(uarm);
if(uarm2) lets[ct++] = obj_to_let(uarm2);
if(uarmh) lets[ct++] = obj_to_let(uarmh);

--- 962,970 -----
#endif
register int ct = 0;

+ #ifdef SHIRT
+ if(uarmu) lets[ct++] = obj_to_let(uarmu);
+ #endif
if(uarm) lets[ct++] = obj_to_let(uarm);
if(uarm2) lets[ct++] = obj_to_let(uarm2);
if(uarmh) lets[ct++] = obj_to_let(uarmh);
***************
*** 1020,1026
static char *buf = NULL;

if (buf == NULL)
! buf = (char *) alloc (strlen(HI) + strlen(HE) + 15 + 1);

if (pos == NULL) pos = obj_symbols;
if (HI && HE)

--- 1038,1044 -----
static char *buf = NULL;

if (buf == NULL)
! buf = (char *) alloc ((unsigned)(strlen(HI)+strlen(HE)+15+1));

if (pos == NULL) pos = obj_symbols;
if (HI && HE)
*** ./lev.c.orig Mon Feb 22 08:40:05 1988
--- ./lev.c Sun Jan 24 18:30:56 1988
***************
*** 1,4
! /* SCCS Id: @(#)lev.c 2.1 87/10/19
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */

#include <stdio.h>

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

#include <stdio.h>
***************
*** 84,90
savetrapchn(fd, ftrap);
saveobjchn(fd, fobj);
saveobjchn(fd, billobjs);
- billobjs = 0;
save_engravings(fd);
#ifndef QUEST
bwrite(fd,(char *) rooms,sizeof(rooms));

--- 84,89 -----
savetrapchn(fd, ftrap);
saveobjchn(fd, fobj);
saveobjchn(fd, billobjs);
save_engravings(fd);
#ifndef QUEST
bwrite(fd,(char *) rooms,sizeof(rooms));
***************
*** 90,104
bwrite(fd,(char *) rooms,sizeof(rooms));
bwrite(fd,(char *) doors,sizeof(doors));
#endif
- #ifdef DGK
- if (!count_only)
- #endif
- {
- fgold = 0;
- ftrap = 0;
- fmon = 0;
- fobj = 0;
- }
#ifndef NOWORM
bwrite(fd,(char *) wsegs,sizeof(wsegs));
for(tmp=1; tmp<32; tmp++){

--- 89,94 -----
bwrite(fd,(char *) rooms,sizeof(rooms));
bwrite(fd,(char *) doors,sizeof(doors));
#endif
#ifndef NOWORM
bwrite(fd,(char *) wsegs,sizeof(wsegs));
for(tmp=1; tmp<32; tmp++){
***************
*** 159,168
bwrite(fd, (char *) &minusone, sizeof(int));
}

- #ifdef MSDOS
- /* We don't want to save any pointers in any files, so convert
- * the pointers to indices before writing the monsters to disk -dgk
- */
savemonchn(fd,mtmp)
register fd;
register struct monst *mtmp;

--- 149,154 -----
bwrite(fd, (char *) &minusone, sizeof(int));
}

savemonchn(fd,mtmp)
register fd;
register struct monst *mtmp;
***************
*** 170,245
register struct monst *mtmp2;
unsigned xl;
int minusone = -1;
- struct permonst *permonstp;
- int monsindex;
- extern struct permonst li_dog, dog, la_dog;
- #ifdef KAA
- int mi;
- extern struct permonst hell_hound;
- # ifdef HARD
- extern struct permonst d_lord, d_prince;
- # endif
- # ifdef KJSMODS
- extern struct permonst pm_guard, pm_ghost, pm_eel;
- # endif
- #endif /* KAA /**/
-
- while(mtmp) {
- mtmp2 = mtmp->nmon;
- xl = mtmp->mxlth + mtmp->mnamelth;
- bwrite(fd, (char *) &xl, sizeof(int));
- /* store an index where the pointer used to be */
- permonstp = mtmp->data;
- if (permonstp == &li_dog)
- monsindex = mi = -1; /* fake index */
- else if (permonstp == &dog)
- monsindex = --mi; /* fake index */
- else if (permonstp == &la_dog)
- monsindex = --mi; /* fake index */
- #ifdef KAA
- else if (permonstp == &hell_hound)
- monsindex = --mi; /* fake index */
- # ifdef HARD
- else if (permonstp == &d_lord)
- monsindex = --mi; /* fake index */
-
- else if (permonstp == &d_prince)
- monsindex = --mi; /* fake index */
- # endif
- # ifdef KJSMODS
- else if (permonstp == &pm_guard)
- monsindex = -mi; /* fake index */
-
- else if (permonstp == &pm_ghost)
- monsindex = -mi; /* fake index */
-
- else if (permonstp == &pm_eel)
- monsindex = -mi; /* fake index */
- # endif
- #endif
- else
- monsindex = permonstp - &mons[0];
- *((int *)&mtmp->data) = monsindex;
- bwrite(fd, (char *) mtmp, xl + sizeof(struct monst));
- mtmp->data = permonstp; /* restore the pointer */
- if(mtmp->minvent) saveobjchn(fd,mtmp->minvent);
- #ifdef DGK
- if (!count_only)
- #endif
- free((char *) mtmp);
- mtmp = mtmp2;
- }
- bwrite(fd, (char *) &minusone, sizeof(int));
- }
- #else
-
- savemonchn(fd,mtmp)
- register fd;
- register struct monst *mtmp;
- {
- register struct monst *mtmp2;
- unsigned xl;
- int minusone = -1;
struct permonst *monbegin = &mons[0];

bwrite(fd, (char *) &monbegin, sizeof(monbegin));

--- 156,161 -----
register struct monst *mtmp2;
unsigned xl;
int minusone = -1;
struct permonst *monbegin = &mons[0];

bwrite(fd, (char *) &monbegin, sizeof(monbegin));
***************
*** 255,261
}
bwrite(fd, (char *) &minusone, sizeof(int));
}
- #endif

savegoldchn(fd,gold)
register fd;

--- 171,176 -----
}
bwrite(fd, (char *) &minusone, sizeof(int));
}

savegoldchn(fd,gold)
register fd;
***************
*** 323,330
done("tricked");
}

- fgold = 0;
- ftrap = 0;
mread(fd, (char *) levl, sizeof(levl));
#ifdef GRAPHICS
/* Corners are poorly implemented. They only exist in the

--- 238,243 -----
done("tricked");
}

mread(fd, (char *) levl, sizeof(levl));
#ifdef GRAPHICS
/* Corners are poorly implemented. They only exist in the
***************
*** 445,453
}

setgd();
! gold = newgold();
! mread(fd, (char *)gold, sizeof(struct gold));
! while(gold->gx) {
gold->ngold = fgold;
fgold = gold;
gold = newgold();

--- 358,367 -----
}

setgd();
! fgold = 0;
! while(gold = newgold(),
! mread(fd, (char *)gold, sizeof(struct gold)),
! gold->gx) {
gold->ngold = fgold;
fgold = gold;
}
***************
*** 450,457
while(gold->gx) {
gold->ngold = fgold;
fgold = gold;
- gold = newgold();
- mread(fd, (char *)gold, sizeof(struct gold));
}
free((char *) gold);
trap = newtrap();

--- 364,369 -----
gold->gx) {
gold->ngold = fgold;
fgold = gold;
}
free((char *) gold);
ftrap = 0;
***************
*** 454,462
mread(fd, (char *)gold, sizeof(struct gold));
}
free((char *) gold);
! trap = newtrap();
! mread(fd, (char *)trap, sizeof(struct trap));
! while(trap->tx) {
trap->ntrap = ftrap;
ftrap = trap;
trap = newtrap();

--- 366,375 -----
fgold = gold;
}
free((char *) gold);
! ftrap = 0;
! while (trap = newtrap(),
! mread(fd, (char *)trap, sizeof(struct trap)),
! trap->tx) {
trap->ntrap = ftrap;
ftrap = trap;
}
***************
*** 459,466
while(trap->tx) {
trap->ntrap = ftrap;
ftrap = trap;
- trap = newtrap();
- mread(fd, (char *)trap, sizeof(struct trap));
}
free((char *) trap);
fobj = restobjchn(fd);

--- 372,377 -----
trap->tx) {
trap->ntrap = ftrap;
ftrap = trap;
}
free((char *) trap);
fobj = restobjchn(fd);
*** ./makedefs.c.orig Mon Feb 22 08:40:05 1988
--- ./makedefs.c Tue Mar 29 08:37:58 1988
***************
*** 1,5
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
! /* makedefs.c - NetHack version 2.2 */

static char SCCS_Id[] = "@(#)makedefs.c 2.2\t87/11/29";

--- 1,5 -----
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
! /* makedefs.c - NetHack version 2.3 */

static char SCCS_Id[] = "@(#)makedefs.c 2.3\t88/02/18";

***************
*** 1,7
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* makedefs.c - NetHack version 2.2 */

! static char SCCS_Id[] = "@(#)makedefs.c 2.2\t87/11/29";

#include <stdio.h>
#include "config.h"

--- 1,7 -----
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* makedefs.c - NetHack version 2.3 */

! static char SCCS_Id[] = "@(#)makedefs.c 2.3\t88/02/18";

#include <stdio.h>
#include "config.h"
***************
*** 105,110
printf("#define\tPOLY_TRAP\t%d\n", ntrap++);
# endif
#endif
printf("\n#define\tTRAPNUM\t%d\n", ntrap);
fclose(stdin);
fclose(stdout);

--- 105,113 -----
printf("#define\tPOLY_TRAP\t%d\n", ntrap++);
# endif
#endif
+ #ifdef SAC
+ printf("#define\tLANDMINE\t%d\n", ntrap++);
+ #endif /* SAC */
printf("\n#define\tTRAPNUM\t%d\n", ntrap);
fclose(stdin);
fclose(stdout);
***************
*** 236,241
printf("\"\tan amulet (or a web)\n");
else
#endif
#ifdef SPELLS
if (!strcmp(inline, "+ a door"))
printf("+\ta door (or a spell book)\n");

--- 239,249 -----
printf("\"\tan amulet (or a web)\n");
else
#endif
+ #ifdef SINKS
+ if (!strcmp(inline, "# a corridor"))
+ printf("#\ta corridor (or a kitchen sink)\n");
+ else
+ #endif
#ifdef SPELLS
if (!strcmp(inline, "+ a door"))
printf("+\ta door (or a spell book)\n");
***************
*** 256,262
puts(inline);
}
#ifdef SAC
! printf("3\ta soldier\n");
#endif
#ifdef RPH
printf("8\tthe medusa;\n");

--- 264,278 -----
puts(inline);
}
#ifdef SAC
! printf("3\ta soldier;\n");
! printf("\tThe soldiers of Yendor are well-trained in the art of war,\n");
! printf("\tmany trained by the wizard himself. Some say the soldiers\n");
! printf("\tare explorers who were unfortunate enough to be captured,\n");
! printf("\tand put under the wizard's spell. Those who have survived\n");
! printf("\tencounters with soldiers say they travel together in\n");
! printf("\tplatoons, and are fierce fighters. Because of the load of\n");
! printf("\ttheir combat gear, however, one can usually run away from\n");
! printf("\tthem, and doing so is considered a wise thing.\n");
#endif
#ifdef RPH
printf("8\tthe medusa;\n");
***************
*** 398,403
"Poison_resistance", "abcghikqsuvxyADFQSVWXZ&",
"Fire_resistance", "gD&",
"Cold_resistance", "gFY",
"Teleportation", "LNt",
"Teleport_control", "t",
"", "" };

--- 414,420 -----
"Poison_resistance", "abcghikqsuvxyADFQSVWXZ&",
"Fire_resistance", "gD&",
"Cold_resistance", "gFY",
+ "Shock_resistance", "g;",
"Teleportation", "LNt",
"Teleport_control", "t",
"", "" };
SHAR_EOF
if test 38558 -ne "`wc -c < 'Update.2.3.b'`"
then
echo shar: error transmitting "'Update.2.3.b'" '(should have been 38558 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

0 new messages