home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Usenet 1994 October
/
usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso
/
games
/
volume7
/
nethack3
/
patch7m
/
patch7.09
Wrap
Text File
|
1990-02-26
|
55KB
|
2,070 lines
*** src/Old/u_init.c Mon Feb 19 19:05:03 1990
--- src/u_init.c Fri Feb 16 18:59:15 1990
***************
*** 14,25 ****
};
static void FDECL(ini_inv, (struct trobj *));
#define UNDEF_TYP 0
#define UNDEF_SPE '\177'
#define UNDEF_BLESS 2
! char *(roles[]) = { /* must all have distinct first letter */
/* roles[2] and [6] are changed for females */
/* in all cases, the corresponding male and female */
/* roles must start with the same letter */
--- 14,27 ----
};
static void FDECL(ini_inv, (struct trobj *));
+ static void FDECL(knows_class,(CHAR_P));
+ static int FDECL(role_index,(CHAR_P));
#define UNDEF_TYP 0
#define UNDEF_SPE '\177'
#define UNDEF_BLESS 2
! const char *(roles[]) = { /* must all have distinct first letter */
/* roles[2] and [6] are changed for females */
/* in all cases, the corresponding male and female */
/* roles must start with the same letter */
***************
*** 235,241 ****
role_index(pc)
char pc;
{
! register char *cp;
if(cp = index(pl_classes, pc))
return(cp - pl_classes);
--- 237,243 ----
role_index(pc)
char pc;
{
! register const char *cp;
if(cp = index(pl_classes, pc))
return(cp - pl_classes);
***************
*** 247,254 ****
{
register int i;
char pick, pc;
!
! Printf("\nNetHack, Copyright 1985, 1986, 1987, 1988, 1989.");
Printf("\n By Stichting Mathematisch Centrum and M. Stephenson.");
Printf("\n See license for details.\n\n");
--- 249,258 ----
{
register int i;
char pick, pc;
! #ifdef __GNULINT__
! pick = i = 0; /* prevent "used before set" warnings */
! #endif
! Printf("\nNetHack, Copyright 1985, 1986, 1987, 1988, 1989, 1990.");
Printf("\n By Stichting Mathematisch Centrum and M. Stephenson.");
Printf("\n See license for details.\n\n");
***************
*** 265,270 ****
--- 269,276 ----
pl_character[0] = pc = 0;
}
+ #ifndef MACOS
+
Printf("\nShall I pick a character for you? [Y,N, or Q(quit)] ");
while(!index("yYnNqQ", (pick = readchar())) && !index(quitchars, pick))
***************
*** 314,319 ****
--- 320,329 ----
}
if(pc == '\n') pc = 0;
+ #else
+ flags.wantspace = FALSE;
+ #endif /* MACOS */
+
beginner:
if(!pc) {
i = rn2(SIZE(roles));
***************
*** 337,343 ****
u.ulevel = 0; /* set up some of the initial attributes */
u.uhp = u.uhpmax = newhp();
! adjabil(1);
u.ulevel = 1;
u.uluck = u.moreluck = 0;
--- 347,353 ----
u.ulevel = 0; /* set up some of the initial attributes */
u.uhp = u.uhpmax = newhp();
! adjabil(0,1);
u.ulevel = 1;
u.uluck = u.moreluck = 0;
***************
*** 469,479 ****
case 'S':
ini_inv(Samurai);
if(!rn2(5)) ini_inv(Blindfold);
- objects[SHORT_SWORD].oc_name = "wakizashi";
- objects[BROADSWORD].oc_name = "ninja-to";
- objects[GLAIVE].oc_name = "naginata";
- /* objects[BOW].oc_name = "yumi"; */
- objects[LOCK_PICK].oc_name = "osaku";
knows_class(WEAPON_SYM);
break;
case 'P':
--- 479,484 ----
*** src/Old/uhitm.c Mon Feb 19 19:05:35 1990
--- src/uhitm.c Sun Feb 4 09:46:50 1990
***************
*** 1,4 ****
! /* SCCS Id: @(#)uhitm.c 3.0 89/11/19
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
--- 1,4 ----
! /* SCCS Id: @(#)uhitm.c 3.0 89/11/27
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
***************
*** 11,16 ****
--- 11,17 ----
#ifdef POLYSELF
static boolean hmonas();
#endif
+ static void nohandglow();
#ifdef WORM
extern boolean notonhead;
***************
*** 77,85 ****
--- 78,93 ----
&& !Hallucination && (!mtmp->mhide || !mtmp->mundetected)
&& (!mtmp->mimic || Protection_from_shape_changers)) {
if (Blind ? Telepat : (!mtmp->minvis || See_invisible)) {
+ #ifdef MACOS
+ char mac_tbuf[80];
+ if(!flags.silent) SysBeep(1);
+ sprintf(mac_tbuf, "Really attack %s?", mon_nam(mtmp));
+ if(UseMacAlertText(128, mac_tbuf) != 1) {
+ #else
pline("Really attack %s? ", mon_nam(mtmp));
(void) fflush(stdout);
if (yn() != 'y') {
+ #endif
flags.move = 0;
return(TRUE);
}
***************
*** 126,132 ****
#endif
/* it is unchivalrous to attack the defenseless or from behind */
if (pl_character[0] == 'K' && u.ualigntyp == U_LAWFUL &&
! (mtmp->mfroz || mtmp->msleep || mtmp->mflee) &&
u.ualign > -10) adjalign(-1);
/* Adjust vs. (and possibly modify) monster state. */
--- 134,140 ----
#endif
/* it is unchivalrous to attack the defenseless or from behind */
if (pl_character[0] == 'K' && u.ualigntyp == U_LAWFUL &&
! (!mtmp->mcanmove || mtmp->msleep || mtmp->mflee) &&
u.ualign > -10) adjalign(-1);
/* Adjust vs. (and possibly modify) monster state. */
***************
*** 138,146 ****
mtmp->msleep = 0;
tmp += 2;
}
! if(mtmp->mfroz) {
tmp += 4;
! if(!rn2(10)) mtmp->mfroz = 0;
}
if (is_orc(mtmp->data) && pl_character[0]=='E') tmp++;
--- 146,157 ----
mtmp->msleep = 0;
tmp += 2;
}
! if(!mtmp->mcanmove) {
tmp += 4;
! if(!rn2(10)) {
! mtmp->mcanmove = 1;
! mtmp->mfrozen = 0;
! }
}
if (is_orc(mtmp->data) && pl_character[0]=='E') tmp++;
***************
*** 184,190 ****
/* andrew@orca: prevent unlimited pick-axe attacks */
u_wipe_engr(3);
! if(mdat->mlet == S_LEPRECHAUN && !mtmp->mfroz && !mtmp->msleep &&
!mtmp->mconf && mtmp->mcansee && !rn2(7) &&
(m_move(mtmp, 0) == 2 || /* he died */
mtmp->mx != u.ux+u.dx || mtmp->my != u.uy+u.dy)) /* he moved */
--- 195,201 ----
/* andrew@orca: prevent unlimited pick-axe attacks */
u_wipe_engr(3);
! if(mdat->mlet == S_LEPRECHAUN && mtmp->mfrozen && !mtmp->msleep &&
!mtmp->mconf && mtmp->mcansee && !rn2(7) &&
(m_move(mtmp, 0) == 2 || /* he died */
mtmp->mx != u.ux+u.dx || mtmp->my != u.uy+u.dy)) /* he moved */
***************
*** 196,203 ****
* cinating.
*/
/* changes by wwp 5/16/85 */
! if (!Blind && !Confusion && !Hallucination && flags.safe_dog &&
! (mdat->mlet == S_DOG || mdat->mlet == S_FELINE) && mtmp->mtame) {
mtmp->mflee = 1;
mtmp->mfleetim = rnd(6);
if (mtmp->mnamelth)
--- 207,215 ----
* cinating.
*/
/* changes by wwp 5/16/85 */
! if (!Confusion && !Hallucination && flags.safe_dog &&
! (Blind ? Telepat : (!mtmp->minvis || See_invisible)) &&
! mtmp->mtame) {
mtmp->mflee = 1;
mtmp->mfleetim = rnd(6);
if (mtmp->mnamelth)
***************
*** 245,251 ****
if(!mhit) {
if(!Blind && flags.verbose) You("miss %s.", mon_nam(mon));
else You("miss it.");
! if(!mon->msleep && !mon->mfroz)
wakeup(mon);
} else {
/* we hit the monster; be careful: it might die! */
--- 257,263 ----
if(!mhit) {
if(!Blind && flags.verbose) You("miss %s.", mon_nam(mon));
else You("miss it.");
! if(!mon->msleep && mon->mcanmove)
wakeup(mon);
} else {
/* we hit the monster; be careful: it might die! */
***************
*** 299,304 ****
--- 311,317 ----
register int thrown;
{
register int tmp;
+ struct permonst *mdat = mon->data;
/* Why all these booleans? This stuff has to be done in the
* following order:
* 1) Know what we're attacking with, and print special hittxt for
***************
*** 313,319 ****
--- 326,334 ----
* kill poison
* 5) Print hit message (depends on 1 and 4)
* 6a) Print poison message (must be done after 5)
+ #if 0
* 6b) Rust weapon (must be done after 5)
+ #endif
* 7) Possibly kill monster (must be done after 6a, 6b)
* 8) Instant-kill from poison (can happen anywhere between 5 and 9)
* 9) Hands not glowing (must be done after 7 and 8)
***************
*** 330,336 ****
wakeup(mon);
if(!obj) {
tmp = rnd(2); /* attack with bare hands */
! if(mon->data == &mons[PM_COCKATRICE] && !uarmg
#ifdef POLYSELF
&& !resists_ston(uasmon)
#endif
--- 345,352 ----
wakeup(mon);
if(!obj) {
tmp = rnd(2); /* attack with bare hands */
! #if 0
! if(mdat == &mons[PM_COCKATRICE] && !uarmg
#ifdef POLYSELF
&& !resists_ston(uasmon)
#endif
***************
*** 342,359 ****
done_in_by(mon);
hittxt = TRUE; /* maybe lifesaved */
}
} else {
if(obj->olet == WEAPON_SYM || obj->otyp == PICK_AXE ||
obj->otyp == UNICORN_HORN || obj->olet == ROCK_SYM) {
! if(obj == uwep && (obj->otyp > VOULGE || obj->otyp < BOOMERANG)
&& obj->otyp != PICK_AXE && obj->otyp != UNICORN_HORN)
tmp = rnd(2);
else {
! tmp = dmgval(obj, mon->data);
#ifdef NAMED_ITEMS
! if(spec_ability(obj, SPFX_DRLI) &&
! !resists_drli(mon->data)) {
if (!Blind) {
pline("The %s blade draws the life from %s!",
Hallucination ? hcolor() : black,
--- 358,375 ----
done_in_by(mon);
hittxt = TRUE; /* maybe lifesaved */
}
+ #endif
} else {
if(obj->olet == WEAPON_SYM || obj->otyp == PICK_AXE ||
obj->otyp == UNICORN_HORN || obj->olet == ROCK_SYM) {
! if(obj == uwep && (obj->otyp >= BOW || obj->otyp < BOOMERANG)
&& obj->otyp != PICK_AXE && obj->otyp != UNICORN_HORN)
tmp = rnd(2);
else {
! tmp = dmgval(obj, mdat);
#ifdef NAMED_ITEMS
! if(spec_ability(obj, SPFX_DRLI) && !resists_drli(mdat)) {
if (!Blind) {
pline("The %s blade draws the life from %s!",
Hallucination ? hcolor() : black,
***************
*** 385,393 ****
ispoisoned = TRUE;
}
if(thrown && obj->otyp == SILVER_ARROW) {
! if (is_were(mon->data) || mon->data->mlet==S_VAMPIRE
! || (mon->data->mlet==S_IMP && mon->data != &mons[PM_TENGU])
! || is_demon(mon->data)) {
silvermsg = TRUE;
tmp += rnd(20);
}
--- 401,409 ----
ispoisoned = TRUE;
}
if(thrown && obj->otyp == SILVER_ARROW) {
! if (is_were(mdat) || mdat->mlet==S_VAMPIRE
! || (mdat->mlet==S_IMP && mdat != &mons[PM_TENGU])
! || is_demon(mdat)) {
silvermsg = TRUE;
tmp += rnd(20);
}
***************
*** 410,416 ****
You("break your mirror. That's bad luck!");
change_luck(-2);
useup(obj);
! return(TRUE);
#endif
case EXPENSIVE_CAMERA:
You("succeed in destroying your camera. Congratulations!");
--- 426,433 ----
You("break your mirror. That's bad luck!");
change_luck(-2);
useup(obj);
! hittxt = TRUE;
! tmp = 1;
#endif
case EXPENSIVE_CAMERA:
You("succeed in destroying your camera. Congratulations!");
***************
*** 420,426 ****
if(obj->corpsenm == PM_COCKATRICE) {
kludge("You hit %s with the cockatrice corpse.",
mon_nam(mon));
! if(resists_ston(mon->data)) {
tmp = 1;
hittxt = TRUE;
break;
--- 437,443 ----
if(obj->corpsenm == PM_COCKATRICE) {
kludge("You hit %s with the cockatrice corpse.",
mon_nam(mon));
! if(resists_ston(mdat)) {
tmp = 1;
hittxt = TRUE;
break;
***************
*** 428,433 ****
--- 445,451 ----
kludge("%s turns to stone.", Monnam(mon));
stoned = TRUE;
xkilled(mon,0);
+ nohandglow();
return(FALSE);
}
tmp = mons[obj->corpsenm].msize + 1;
***************
*** 435,441 ****
case EGG: /* only possible if hand-to-hand */
if(obj->corpsenm > -1
&& obj->corpsenm != PM_COCKATRICE
! && mon->data==&mons[PM_COCKATRICE]) {
kludge("You hit %s with the %s egg%s.",
mon_nam(mon),
mons[obj->corpsenm].mname,
--- 453,459 ----
case EGG: /* only possible if hand-to-hand */
if(obj->corpsenm > -1
&& obj->corpsenm != PM_COCKATRICE
! && mdat == &mons[PM_COCKATRICE]) {
kludge("You hit %s with the %s egg%s.",
mon_nam(mon),
mons[obj->corpsenm].mname,
***************
*** 451,457 ****
tmp = 1;
break;
case CLOVE_OF_GARLIC: /* no effect against demons */
! if(is_undead(mon->data)) mon->mflee = 1;
tmp = 1;
break;
case CREAM_PIE:
--- 469,475 ----
tmp = 1;
break;
case CLOVE_OF_GARLIC: /* no effect against demons */
! if(is_undead(mdat)) mon->mflee = 1;
tmp = 1;
break;
case CREAM_PIE:
***************
*** 468,475 ****
else
pline("The cream pie splashes over %s%s!",
mon_nam(mon),
! (haseyes(mon->data) &&
! mon->data != &mons[PM_FLOATING_EYE])
? "'s face" : "");
if(mon->msleep) mon->msleep = 0;
setmangry(mon);
--- 486,493 ----
else
pline("The cream pie splashes over %s%s!",
mon_nam(mon),
! (haseyes(mdat) &&
! mdat != &mons[PM_FLOATING_EYE])
? "'s face" : "");
if(mon->msleep) mon->msleep = 0;
setmangry(mon);
***************
*** 483,495 ****
break;
#ifdef POLYSELF
case ACID_VENOM: /* only possible if thrown */
! if(resists_acid(mon->data)) {
kludge("Your venom hits %s harmlessly.",
mon_nam(mon));
tmp = 0;
} else {
kludge("Your venom burns %s!", mon_nam(mon));
! tmp = dmgval(obj, mon->data);
}
hittxt = TRUE;
get_dmg_bonus = FALSE;
--- 501,513 ----
break;
#ifdef POLYSELF
case ACID_VENOM: /* only possible if thrown */
! if(resists_acid(mdat)) {
kludge("Your venom hits %s harmlessly.",
mon_nam(mon));
tmp = 0;
} else {
kludge("Your venom burns %s!", mon_nam(mon));
! tmp = dmgval(obj, mdat);
}
hittxt = TRUE;
get_dmg_bonus = FALSE;
***************
*** 513,522 ****
/* If you throw using a propellor, you don't get a strength
* bonus but you do get an increase-damage bonus.
*/
! if(!obj || !uwep ||
(obj->olet != GEM_SYM && obj->olet != WEAPON_SYM) ||
! objects[obj->otyp].w_propellor !=
! -objects[uwep->otyp].w_propellor)
tmp += dbon();
}
--- 531,541 ----
/* If you throw using a propellor, you don't get a strength
* bonus but you do get an increase-damage bonus.
*/
! if(!thrown || !obj || !uwep ||
(obj->olet != GEM_SYM && obj->olet != WEAPON_SYM) ||
! !objects[obj->otyp].w_propellor ||
! (objects[obj->otyp].w_propellor !=
! -objects[uwep->otyp].w_propellor))
tmp += dbon();
}
***************
*** 530,536 ****
}
*/
if (ispoisoned) {
! if(resists_poison(mon->data))
needpoismsg = TRUE;
else if (rn2(10))
tmp += rnd(6);
--- 549,555 ----
}
*/
if (ispoisoned) {
! if(resists_poison(mdat))
needpoismsg = TRUE;
else if (rn2(10))
tmp += rnd(6);
***************
*** 550,558 ****
mon->mflee = 1; /* Rick Richardson */
mon->mfleetim += 10*rnd(tmp);
}
! if((mon->data == &mons[PM_BLACK_PUDDING] ||
! mon->data == &mons[PM_BROWN_PUDDING]) && obj &&
! obj == uwep && objects[obj->otyp].oc_material == METAL
&& mon->mhp > 1 && !thrown && !mon->mcan
/* && !destroyed -- guaranteed by mhp > 1 */ ) {
--- 569,577 ----
mon->mflee = 1; /* Rick Richardson */
mon->mfleetim += 10*rnd(tmp);
}
! if((mdat == &mons[PM_BLACK_PUDDING] || mdat == &mons[PM_BROWN_PUDDING])
! && obj && obj == uwep
! && objects[obj->otyp].oc_material == METAL
&& mon->mhp > 1 && !thrown && !mon->mcan
/* && !destroyed -- guaranteed by mhp > 1 */ ) {
***************
*** 583,611 ****
if (poiskilled) {
pline("The poison was deadly...");
xkilled(mon, 0);
return FALSE;
! } else if (destroyed)
! killed(mon); /* takes care of messages */
! else if(u.umconf && !thrown) {
! if(!Blind) {
! Your("%s stop glowing %s.",
! makeplural(body_part(HAND)),
! Hallucination ? hcolor() : red);
! }
if(!resist(mon, '+', 0, NOTELL)) mon->mconf = 1;
! if(!mon->mstun && !mon->mfroz && !mon->msleep &&
!Blind && mon->mconf)
pline("%s appears confused.", Monnam(mon));
- u.umconf = 0;
}
! if(mon->data == &mons[PM_RUST_MONSTER] && obj && obj == uwep &&
objects[obj->otyp].oc_material == METAL &&
obj->olet == WEAPON_SYM && obj->spe > -2) {
if(obj->rustfree) {
pline("The rust on your %s vanishes instantly!",
is_sword(obj) ? "sword" : "weapon");
! } else if(obj->blessed && rnl(4))
pline("Somehow your %s is not affected!",
is_sword(obj) ? "sword" : "weapon");
else {
--- 602,628 ----
if (poiskilled) {
pline("The poison was deadly...");
xkilled(mon, 0);
+ nohandglow();
return FALSE;
! } else if (destroyed) {
! killed(mon); /* takes care of most messages */
! nohandglow();
! } else if(u.umconf && !thrown) {
! nohandglow();
if(!resist(mon, '+', 0, NOTELL)) mon->mconf = 1;
! if(!mon->mstun && mon->mcanmove && !mon->msleep &&
!Blind && mon->mconf)
pline("%s appears confused.", Monnam(mon));
}
! #if 0
! if(mdat == &mons[PM_RUST_MONSTER] && obj && obj == uwep &&
objects[obj->otyp].oc_material == METAL &&
obj->olet == WEAPON_SYM && obj->spe > -2) {
if(obj->rustfree) {
pline("The rust on your %s vanishes instantly!",
is_sword(obj) ? "sword" : "weapon");
! } else if(obj->blessed && !rnl(4))
pline("Somehow your %s is not affected!",
is_sword(obj) ? "sword" : "weapon");
else {
***************
*** 613,618 ****
--- 630,636 ----
obj->spe--;
}
}
+ #endif
return(destroyed ? FALSE : TRUE);
}
***************
*** 636,643 ****
) {
struct monst *dtmp;
pline("Some hell-p has arrived!");
! /* if((dtmp = makemon(uasmon, u.ux, u.uy)))*/
! if((dtmp = makemon(&mons[ndemon()], u.ux, u.uy)))
(void)tamedog(dtmp, (struct obj *)0);
return(0);
}
--- 654,660 ----
) {
struct monst *dtmp;
pline("Some hell-p has arrived!");
! if((dtmp = makemon(!rn2(6) ? &mons[ndemon()] : uasmon, u.ux, u.uy)))
(void)tamedog(dtmp, (struct obj *)0);
return(0);
}
***************
*** 716,722 ****
int isize = inv_cnt();
stealoid = (struct obj *)0;
! if (is_mercenary(pd)) {
for(otmp = mdef->minvent; otmp; otmp=otmp->nobj)
if (otmp->otyp >= PLATE_MAIL && otmp->otyp
<= ELVEN_CLOAK) stealoid = otmp;
--- 733,739 ----
int isize = inv_cnt();
stealoid = (struct obj *)0;
! if(is_mercenary(pd) && could_seduce(&youmonst,mdef,mattk)){
for(otmp = mdef->minvent; otmp; otmp=otmp->nobj)
if (otmp->otyp >= PLATE_MAIL && otmp->otyp
<= ELVEN_CLOAK) stealoid = otmp;
***************
*** 869,884 ****
u.ustuck = mdef; /* it's now stuck to you */
break;
case AD_PLYS:
! if (!mdef->mfroz && !rn2(3) && tmp < mdef->mhp) {
if (!Blind) pline("%s is frozen by you!", Monnam(mdef));
! mdef->mfroz = 1;
}
case AD_SLEE:
if (!resists_sleep(mdef->data) && !mdef->msleep &&
! !mdef->mfroz) {
if (!Blind)
pline("%s suddenly falls asleep!", Monnam(mdef));
! mdef->msleep = 1;
}
break;
default: tmp = 0;
--- 886,904 ----
u.ustuck = mdef; /* it's now stuck to you */
break;
case AD_PLYS:
! if (mdef->mcanmove && !rn2(3) && tmp < mdef->mhp) {
if (!Blind) pline("%s is frozen by you!", Monnam(mdef));
! mdef->mcanmove = 0;
! mdef->mfrozen = rnd(10);
}
+ break;
case AD_SLEE:
if (!resists_sleep(mdef->data) && !mdef->msleep &&
! mdef->mcanmove) {
if (!Blind)
pline("%s suddenly falls asleep!", Monnam(mdef));
! mdef->mcanmove = 0;
! mdef->mfrozen = rnd(10);
}
break;
default: tmp = 0;
***************
*** 910,916 ****
case AD_BLND:
if(mdef->data->mlet != S_YLIGHT) {
kludge("%s is blinded by your flash of light!", Monnam(mdef));
! if (!mdef->mblinded) {
mdef->mblinded += rn2(25);
mdef->mcansee = 0;
}
--- 930,936 ----
case AD_BLND:
if(mdef->data->mlet != S_YLIGHT) {
kludge("%s is blinded by your flash of light!", Monnam(mdef));
! if (mdef->mcansee) {
mdef->mblinded += rn2(25);
mdef->mcansee = 0;
}
***************
*** 956,964 ****
* after exactly 1 round of attack otherwise. -KAA
*/
! # ifdef WORM
! if(mdef->wormno) return 0;
! # endif
if(u.uhunger < 1500 && !u.uswallow) {
if(mdef->data->mlet != S_COCKATRICE) {
--- 976,983 ----
* after exactly 1 round of attack otherwise. -KAA
*/
! if(mdef->data->msize >= MZ_HUGE) return 0;
!
if(u.uhunger < 1500 && !u.uswallow) {
if(mdef->data->mlet != S_COCKATRICE) {
***************
*** 1046,1061 ****
xkilled(mdef,0);
return(2);
}
! kludge("You regurgitate %s!", mon_nam(mdef));
! if (Blind)
! pline("Obviously, you didn't like its taste.");
! else
! pline("Obviously, you didn't like %s's taste.",
mon_nam(mdef));
} else {
kludge("You bite into %s", mon_nam(mdef));
You("turn to stone...");
! killer = "poor choice of food";
done(STONING);
}
}
--- 1065,1084 ----
xkilled(mdef,0);
return(2);
}
! kludge("You %s %s!", is_animal(uasmon) ? "regurgitate"
! : "expel", mon_nam(mdef));
! if (is_animal(uasmon)) {
! if (Blind)
! pline("Obviously, you didn't like its taste.");
! else
! pline("Obviously, you didn't like %s's taste.",
mon_nam(mdef));
+ }
} else {
kludge("You bite into %s", mon_nam(mdef));
You("turn to stone...");
! killer_format = KILLED_BY;
! killer = "swallowing a cockatrice whole";
done(STONING);
}
}
***************
*** 1134,1141 ****
if (!u.uswallow &&
(compat = could_seduce(&youmonst,
mon, mattk)))
! pline("You %s %s %s.",
! mon->mblinded ? "talk to" : "smile at",
Blind ? "it" : mon_nam(mon),
compat == 2 ? "engagingly" : "seductively");
else if (mattk->aatyp == AT_KICK)
--- 1157,1164 ----
if (!u.uswallow &&
(compat = could_seduce(&youmonst,
mon, mattk)))
! You("%s %s %s.",
! mon->mcansee ? "smile at" : "talk to",
Blind ? "it" : mon_nam(mon),
compat == 2 ? "engagingly" : "seductively");
else if (mattk->aatyp == AT_KICK)
***************
*** 1262,1271 ****
if(mhit && !rn2(6)) {
if (kicked) {
if (uarmf)
! (void) rust_dmg(uarmf, xname(uarmf), 1, TRUE);
} else corrode_weapon();
}
break;
case AD_MAGM:
/* wrath of gods for attacking Oracle */
if(Antimagic) {
--- 1285,1315 ----
if(mhit && !rn2(6)) {
if (kicked) {
if (uarmf)
! (void) rust_dmg(uarmf, xname(uarmf), 3, TRUE);
} else corrode_weapon();
}
break;
+ case AD_STON:
+ if(mhit)
+ if (!kicked)
+ if (!uwep && !uarmg
+ #ifdef POLYSELF
+ && !resists_ston(uasmon)
+ #endif
+ ) {
+ You("turn to stone...");
+ done_in_by(mon);
+ return 2;
+ }
+ break;
+ case AD_RUST:
+ if(mhit)
+ if (kicked) {
+ if (uarmf)
+ (void) rust_dmg(uarmf, xname(uarmf), 1, TRUE);
+ } else
+ corrode_weapon();
+ break;
case AD_MAGM:
/* wrath of gods for attacking Oracle */
if(Antimagic) {
***************
*** 1287,1296 ****
switch(ptr->mattk[i].adtyp) {
! case AD_PLYS: /* specifically floating eye */
! if(canseemon(mon)) {
!
! tmp = -d((int)mon->m_lev+1, (int)ptr->mattk[i].damd);
if(mon->mcansee) {
if(Reflecting & W_AMUL) {
makeknown(AMULET_OF_REFLECTION);
--- 1331,1343 ----
switch(ptr->mattk[i].adtyp) {
! case AD_PLYS:
! tmp = -d((int)mon->m_lev+1, (int)ptr->mattk[i].damd);
! if(ptr == &mons[PM_FLOATING_EYE]) {
! if (!canseemon(mon)) {
! tmp = 0;
! break;
! }
if(mon->mcansee) {
if(Reflecting & W_AMUL) {
makeknown(AMULET_OF_REFLECTION);
***************
*** 1308,1313 ****
--- 1355,1364 ----
pline("%s cannot defend itself.", Amonnam(mon,"blind"));
if(!rn2(500)) change_luck(-1);
}
+ } else { /* gelatinous cube */
+ You("are frozen by %s!", mon_nam(mon));
+ nomul(tmp);
+ tmp = 0;
}
break;
case AD_COLD: /* brown mold or blue jelly */
***************
*** 1350,1361 ****
if(monnear(mon, u.ux, u.uy)) {
tmp = d((int)mon->m_lev+1, (int)ptr->mattk[i].damd);
if(Fire_resistance) {
! shieldeff(u.ux, u.uy);
You("feel mildly warm.");
! #ifdef POLYSELF
! #ifdef GOLEMS
ugolemeffects(AD_FIRE, tmp);
- #endif /* GOLEMS */
#endif
tmp = 0;
break;
--- 1401,1410 ----
if(monnear(mon, u.ux, u.uy)) {
tmp = d((int)mon->m_lev+1, (int)ptr->mattk[i].damd);
if(Fire_resistance) {
! shieldeff(u.ux, u.uy);
You("feel mildly warm.");
! #if defined(POLYSELF) && defined(GOLEMS)
ugolemeffects(AD_FIRE, tmp);
#endif
tmp = 0;
break;
***************
*** 1364,1369 ****
--- 1413,1432 ----
mdamageu(mon, tmp);
}
break;
+ case AD_ELEC:
+ tmp = d((int)mon->m_lev+1, (int)ptr->mattk[i].damd);
+ if(Shock_resistance) {
+ shieldeff(u.ux, u.uy);
+ You("feel a mild tingle.");
+ #if defined(POLYSELF) && defined(GOLEMS)
+ ugolemeffects(AD_ELEC, tmp);
+ #endif
+ tmp = 0;
+ break;
+ }
+ You("are jolted with electricity!");
+ mdamageu(mon, tmp);
+ break;
default:
break;
}
***************
*** 1398,1401 ****
--- 1461,1487 ----
pline("Wait! That's %s!", defmonnam(mtmp));
}
wakeup(mtmp); /* clears mtmp->mimic */
+ }
+
+ static void
+ nohandglow()
+ {
+ if (!u.umconf) return; /* for safety */
+ if (u.umconf == 1) {
+ if (Blind)
+ Your("%s stop tingling.", makeplural(body_part(HAND)));
+ else
+ Your("%s stop glowing %s.",
+ makeplural(body_part(HAND)),
+ Hallucination ? hcolor() : red);
+ } else {
+ if (Blind)
+ pline("The tingling in your %s lessens.",
+ makeplural(body_part(HAND)));
+ else
+ Your("%s no longer glow so brightly %s.",
+ makeplural(body_part(HAND)),
+ Hallucination ? hcolor() : red);
+ }
+ u.umconf--;
}
*** src/Old/unixmain.c Mon Feb 19 19:06:32 1990
--- src/unixmain.c Sun Feb 11 11:29:09 1990
***************
*** 7,16 ****
#include <signal.h>
#include <pwd.h>
char SAVEF[PL_NSIZ + 11] = "save/"; /* save/99999player */
! char *hname = 0; /* name of the game (argv[0] of call) */
char obuf[BUFSIZ]; /* BUFSIZ is defined in stdio.h */
int hackpid = 0; /* current pid */
int locknum = 0; /* max num of players */
--- 7,19 ----
#include <signal.h>
#include <pwd.h>
+ #ifndef O_RDONLY
+ #include <fcntl.h>
+ #endif
char SAVEF[PL_NSIZ + 11] = "save/"; /* save/99999player */
! const char *hname = 0; /* name of the game (argv[0] of call) */
char obuf[BUFSIZ]; /* BUFSIZ is defined in stdio.h */
int hackpid = 0; /* current pid */
int locknum = 0; /* max num of players */
***************
*** 233,239 ****
#ifdef COMPRESS
Strcpy(old,SAVEF);
Strcat(SAVEF,".Z");
! if((fd = open(SAVEF,0)) >= 0) {
(void) close(fd);
Strcpy(cmd, COMPRESS);
Strcat(cmd, " -d "); /* uncompress */
--- 236,242 ----
#ifdef COMPRESS
Strcpy(old,SAVEF);
Strcat(SAVEF,".Z");
! if((fd = open(SAVEF,O_RDONLY)) >= 0) {
(void) close(fd);
Strcpy(cmd, COMPRESS);
Strcat(cmd, " -d "); /* uncompress */
***************
*** 246,252 ****
}
Strcpy(SAVEF,old);
#endif
! if((fd = open(SAVEF,0)) >= 0 &&
(uptodate(fd) || unlink(SAVEF) == 666)) {
#ifdef WIZARD
/* Since wizard is actually flags.debug, restoring might
--- 249,256 ----
}
Strcpy(SAVEF,old);
#endif
! if((fd = open(SAVEF,O_RDONLY)) >= 0 &&
! /* if not up-to-date, quietly unlink file via false condition */
(uptodate(fd) || unlink(SAVEF) == 666)) {
#ifdef WIZARD
/* Since wizard is actually flags.debug, restoring might
***************
*** 254,261 ****
*/
boolean remember_wiz_mode = wizard;
#endif
(void) signal(SIGINT, (SIG_RET_TYPE) done1);
! pline("Restoring old save file...");
(void) fflush(stdout);
if(!dorecover(fd))
goto not_recovered;
--- 258,266 ----
*/
boolean remember_wiz_mode = wizard;
#endif
+ (void) chmod(SAVEF,0); /* disallow parallel restores */
(void) signal(SIGINT, (SIG_RET_TYPE) done1);
! pline("Restoring save file...");
(void) fflush(stdout);
if(!dorecover(fd))
goto not_recovered;
***************
*** 274,279 ****
--- 279,297 ----
pline("Do you want to keep the save file? ");
if(yn() == 'n')
(void) unlink(SAVEF);
+ else {
+ (void) chmod(SAVEF,FCMASK); /* back to readable */
+ # ifdef COMPRESS
+ Strcpy(cmd, COMPRESS);
+ Strcat(cmd, " ");
+ # ifdef COMPRESS_OPTIONS
+ Strcat(cmd, COMPRESS_OPTIONS);
+ Strcat(cmd, " ");
+ # endif
+ Strcat(cmd,SAVEF);
+ (void) system(cmd);
+ # endif
+ }
}
#endif
flags.move = 0;
***************
*** 382,390 ****
if(dir == NULL)
dir = ".";
! if((fd = open(RECORD, 2)) < 0) {
! Printf("Warning: cannot write %s/%s", dir, RECORD);
! getret();
} else
(void) close(fd);
}
--- 400,411 ----
if(dir == NULL)
dir = ".";
! if((fd = open(RECORD, O_RDWR)) < 0) {
! if((fd = open(RECORD, O_CREAT|O_RDWR, FCMASK)) < 0) {
! Printf("Warning: cannot write %s/%s", dir, RECORD);
! getret();
! } else
! (void) close(fd);
} else
(void) close(fd);
}
*** src/Old/unixtty.c Mon Feb 19 19:06:57 1990
--- src/unixtty.c Sun Jan 21 13:58:48 1990
***************
*** 115,121 ****
/* reset terminal to original state */
void
settty(s)
! char *s;
{
clear_screen();
end_screen();
--- 115,121 ----
/* reset terminal to original state */
void
settty(s)
! const char *s;
{
clear_screen();
end_screen();
***************
*** 192,200 ****
/*VARARGS1*/
void
! error VA_DECL(char *,s)
VA_START(s);
! VA_INIT(s, char *);
if(settty_needed)
settty(NULL);
Vprintf(s,VA_ARGS);
--- 192,200 ----
/*VARARGS1*/
void
! error VA_DECL(const char *,s)
VA_START(s);
! VA_INIT(s, const char *);
if(settty_needed)
settty(NULL);
Vprintf(s,VA_ARGS);
*** src/Old/version.c Mon Feb 19 19:07:51 1990
--- src/version.c Mon Feb 12 18:47:37 1990
***************
*** 5,11 ****
#include "hack.h"
#include "date.h"
#ifndef BETA
! #ifdef MSDOS
# include "patchlev.h"
#else
# include "patchlevel.h"
--- 5,11 ----
#include "hack.h"
#include "date.h"
#ifndef BETA
! #if defined(MSDOS) && !defined(AMIGA)
# include "patchlev.h"
#else
# include "patchlevel.h"
***************
*** 51,53 ****
--- 51,222 ----
datestring);
return 0;
}
+
+ #define Next_opt(x) if (next_opt(x)) goto quit;
+ #define Page_line(x) if (page_line(x)) goto quit;
+
+ int
+ doextversion()
+ {
+ set_pager(0);
+ (void)page_line("");
+ Page_line("Options compiled into this version of NetHack");
+ Page_line("(in no particular order):");
+ Page_line("");
+ #ifdef POLYSELF
+ Next_opt("self-polymorphing, ");
+ #endif
+ #ifdef THEOLOGY
+ Next_opt("theology, ");
+ #endif
+ #ifdef SOUNDS
+ Next_opt("sounds, ");
+ #endif
+ #ifdef KICK
+ Next_opt("kicking, ");
+ #endif
+ #ifdef THRONES
+ Next_opt("thrones, ");
+ #endif
+ #ifdef FOUNTAINS
+ Next_opt("fountains, ");
+ #endif
+ #ifdef SINKS
+ Next_opt("sinks, ");
+ #endif
+ #ifdef ALTARS
+ Next_opt("altars, ");
+ #endif
+ #ifdef WALLIFIED_MAZE
+ Next_opt("fancy mazes, ");
+ #endif
+ #ifdef REINCARNATION
+ Next_opt("Rogue level, ");
+ #endif
+ #ifdef STRONGHOLD
+ Next_opt("special levels, ");
+ #endif
+ #ifdef ORACLE
+ Next_opt("oracle, ");
+ #endif
+ #ifdef MEDUSA
+ Next_opt("Medusa, ");
+ #endif
+ #ifdef KOPS
+ Next_opt("Kops, ");
+ #endif
+ #ifdef ARMY
+ Next_opt("armies, ");
+ #endif
+ #ifdef WORM
+ Next_opt("long worms, ");
+ #endif
+ #ifdef GOLEMS
+ Next_opt("golems, ");
+ #endif
+ #ifdef INFERNO
+ Next_opt("inferno, ");
+ #endif
+ #ifdef SEDUCE
+ Next_opt("seduction, ");
+ #endif
+ #ifdef TOLKIEN
+ Next_opt("Tolkien extras, ");
+ #endif
+ #ifdef PROBING
+ Next_opt("wand of probing, ");
+ #endif
+ #ifdef WALKIES
+ Next_opt("leashes, ");
+ #endif
+ #ifdef SHIRT
+ Next_opt("Hawaiian shirt, ");
+ #endif
+ #ifdef MUSIC
+ Next_opt("music, ");
+ #endif
+ #ifdef TUTTI_FRUTTI
+ Next_opt("fruits, ");
+ #endif
+ #ifdef SPELLS
+ Next_opt("spells, ");
+ #endif
+ #ifdef NAMED_ITEMS
+ Next_opt("named items, ");
+ #endif
+ #ifdef ELBERETH
+ Next_opt("Elbereth, ");
+ #endif
+ #ifdef EXPLORE_MODE
+ Next_opt("explore mode, ");
+ #endif
+ #ifdef HARD
+ Next_opt("HARD, ");
+ #endif
+ #ifdef REDO
+ Next_opt("redo-commands, ");
+ #endif
+ #ifdef CLIPPING
+ Next_opt("screen clipping, ");
+ #endif
+ #ifdef TEXTCOLOR
+ Next_opt("color, ");
+ #endif
+ #ifdef DGK
+ Next_opt("Don Kneller's enhancements, ");
+ #endif
+ #ifdef OVERLAY
+ Next_opt("overlays, ");
+ #endif
+ #ifdef SHELL
+ Next_opt("shell command, ");
+ #endif
+ #ifdef MAIL
+ Next_opt("mail, ");
+ #endif
+ #ifdef NEWS
+ Next_opt("news file, ");
+ #endif
+ #ifdef COM_COMPL
+ Next_opt("command line completion, ");
+ #endif
+ #ifdef AMIGA_WBENCH
+ Next_opt("Amiga WorkBench support, ");
+ #endif
+ #ifdef WIZARD
+ Next_opt("wizard mode, ");
+ #endif
+ #ifdef LOGFILE
+ Next_opt("logfile, ");
+ #endif
+ #ifdef TERMLIB
+ Next_opt("termcap file, ");
+ #endif
+ #ifdef TERMINFO
+ Next_opt("terminfo, ");
+ #endif
+ #ifdef ANSI_DEFAULT
+ Next_opt("ANSI default terminal, ");
+ #endif
+ #ifdef COMPRESS
+ Next_opt("compress bones/level/save files, ");
+ #endif
+ Next_opt("basic NetHack features");
+ Next_opt("");
+ set_pager(1);
+ return 0;
+ quit:
+ (void) next_opt("\033");
+ set_pager(2);
+ return 0;
+ }
+
+ #ifdef MSDOS
+ int
+ comp_times(filetime)
+ long filetime;
+ {
+ if(filetime < compiletime) return (1);
+ else return (0);
+ }
+ #endif
*** src/Old/weapon.c Mon Feb 19 19:08:10 1990
--- src/weapon.c Thu Jan 25 22:14:52 1990
***************
*** 9,14 ****
--- 9,16 ----
*/
#include "hack.h"
+ #ifdef OVLB
+
static const char kebabable[] = { S_XORN, S_DRAGON, S_NAGA, S_GIANT, 0 };
/*
***************
*** 168,173 ****
--- 170,178 ----
return;
}
+ #endif /* OVLB */
+ #ifdef OVL0
+
#define Oselect(x) if((otmp = m_carrying(mtmp, x))) return(otmp);
#ifdef TOLKIEN
***************
*** 352,357 ****
--- 357,365 ----
else return(sbon+ACURR(A_DEX)-14);
}
+ #endif /* OVL0 */
+ #ifdef OVL1
+
int
dbon() { /* damage bonus for strength */
#ifdef POLYSELF
***************
*** 367,369 ****
--- 375,379 ----
else if(ACURR(A_STR) < 118) return(5); /* up to 18/99 */
else return(6);
}
+
+ #endif /* OVL1 */
*** src/Old/were.c Mon Feb 19 19:08:33 1990
--- src/were.c Thu Jan 25 22:14:54 1990
***************
*** 4,9 ****
--- 4,13 ----
#include "hack.h"
+ static int FDECL(counter_were,(int));
+
+ #ifdef OVL0
+
void
were_change(mon)
register struct monst *mon;
***************
*** 22,27 ****
--- 26,34 ----
} else if(!rn2(30) || Protection_from_shape_changers) new_were(mon);
}
+ #endif /* OVL0 */
+ #ifdef OVLB
+
static int
counter_were(pm)
int pm;
***************
*** 108,110 ****
--- 115,119 ----
(void) polymon(u.ulycn);
}
#endif
+
+ #endif /* OVLB */
*** src/Old/wield.c Mon Feb 19 19:08:53 1990
--- src/wield.c Sun Jan 21 13:58:49 1990
***************
*** 65,71 ****
You("wield the cockatrice corpse in your bare %s.",
makeplural(body_part(HAND)));
You("turn to stone...");
! killer="cockatrice corpse";
done(STONING);
} else if(uarms && bimanual(wep))
You("cannot wield a two-handed %s and hold a shield.",
--- 65,72 ----
You("wield the cockatrice corpse in your bare %s.",
makeplural(body_part(HAND)));
You("turn to stone...");
! killer_format = KILLED_BY;
! killer="touching a cockatrice corpse";
done(STONING);
} else if(uarms && bimanual(wep))
You("cannot wield a two-handed %s and hold a shield.",
***************
*** 114,120 ****
else if (uwep->spe > -6) {
Your("%s!", aobjnam(uwep, "corrode"));
uwep->spe--;
! } else Your("%s quite rusted now.", aobjnam(uwep, "look"));
}
int
--- 115,121 ----
else if (uwep->spe > -6) {
Your("%s!", aobjnam(uwep, "corrode"));
uwep->spe--;
! } else Your("%s quite rusted now.", aobjnam(uwep, Blind ? "feel" : "look"));
}
int
***************
*** 124,132 ****
{
register const char *color = Hallucination ? hcolor() :
(amount < 0) ? black : blue;
! register char *xtime;
! if(!uwep || (uwep->olet != WEAPON_SYM && uwep->otyp != PICK_AXE)) {
char buf[36];
Sprintf(buf, "Your %s %s.", makeplural(body_part(HAND)),
--- 125,134 ----
{
register const char *color = Hallucination ? hcolor() :
(amount < 0) ? black : blue;
! register const char *xtime;
! if(!uwep || (uwep->olet != WEAPON_SYM && uwep->otyp != PICK_AXE
! && uwep->otyp != UNICORN_HORN)) {
char buf[36];
Sprintf(buf, "Your %s %s.", makeplural(body_part(HAND)),
***************
*** 145,151 ****
if(uwep->otyp == CRYSKNIFE && amount < 0) {
uwep->otyp = WORM_TOOTH;
! Your("weapon looks duller now.");
return(1);
}
#endif
--- 147,153 ----
if(uwep->otyp == CRYSKNIFE && amount < 0) {
uwep->otyp = WORM_TOOTH;
! Your("weapon seems duller now.");
return(1);
}
#endif
*** src/Old/wizard.c Mon Feb 19 19:09:10 1990
--- src/wizard.c Tue Feb 13 18:41:41 1990
***************
*** 1,4 ****
! /* SCCS Id: @(#)wizard.c 3.0 88/04/11
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
--- 1,4 ----
! /* SCCS Id: @(#)wizard.c 3.0 90/01/09
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
***************
*** 8,13 ****
--- 8,15 ----
#include "hack.h"
+ #ifdef OVLB
+
#ifdef HARD
/* TODO: Expand this list. */
static const int nasties[] = {
***************
*** 20,30 ****
};
#endif /* HARD */
! /* TODO: investigate this. */
! static const char wizapp[] = {
! S_HUMAN, S_DEMON, S_VAMPIRE, S_DRAGON, S_TROLL, S_UMBER,
! S_XORN, S_XAN, S_COCKATRICE, S_EYE, S_NAGA, S_TRAPPER,
! /* '1' /* Historical reference */ };
/* If he has found the Amulet, make the wizard appear after some time */
void
--- 22,38 ----
};
#endif /* HARD */
! static const unsigned wizapp[] = {
! PM_HUMAN, PM_WATER_DEMON, PM_VAMPIRE,
! PM_RED_DRAGON, PM_TROLL, PM_UMBER_HULK,
! PM_XORN, PM_XAN, PM_COCKATRICE,
! PM_FLOATING_EYE,
! PM_GUARDIAN_NAGA,
! PM_TRAPPER
! };
!
! #endif /* OVLB */
! #ifdef OVL0
/* If he has found the Amulet, make the wizard appear after some time */
void
***************
*** 39,51 ****
if(u.uhave_amulet) {
mtmp->msleep = 0;
if(dist(mtmp->mx,mtmp->my) > 2)
! pline(
! "You get the creepy feeling that somebody noticed your taking the Amulet."
);
return;
}
}
int
mon_has_amulet(mtmp)
register struct monst *mtmp;
--- 47,62 ----
if(u.uhave_amulet) {
mtmp->msleep = 0;
if(dist(mtmp->mx,mtmp->my) > 2)
! You(
! "get the creepy feeling that somebody noticed your taking the Amulet."
);
return;
}
}
+ #endif /* OVL0 */
+ #ifdef OVLB
+
int
mon_has_amulet(mtmp)
register struct monst *mtmp;
***************
*** 86,91 ****
--- 97,105 ----
/* teleport to it and pick it up */
remove_monster(mtmp->mx, mtmp->my);
place_monster(mtmp, otmp->ox, otmp->oy);
+ if (cansee(mtmp->mx, mtmp->my))
+ pline("%s picks up %s.", Monnam(mtmp),
+ xname(otmp));
freeobj(otmp);
mpickobj(mtmp, otmp);
pmon(mtmp);
***************
*** 100,106 ****
/* secondary goal - stayin' alive */
/* if wounded, hole up on or near the stairs (to block them) */
! if(mtmp->mhp < 20 + rnd(10))
if (mtmp->mx != xupstair && mtmp->my != yupstair)
mnearto(mtmp,xupstair,yupstair,TRUE);
--- 114,121 ----
/* secondary goal - stayin' alive */
/* if wounded, hole up on or near the stairs (to block them) */
! /* unless, of course, there are no stairs (e.g. endlevel */
! if(mtmp->mhp < 20 + rnd(10) && (xupstair || yupstair))
if (mtmp->mx != xupstair && mtmp->my != yupstair)
mnearto(mtmp,xupstair,yupstair,TRUE);
***************
*** 131,138 ****
for(mtmp = fmon; mtmp; mtmp = mtmp->nmon) {
mtmp->msleep = 0;
! if(mtmp->mfroz && !rn2(5))
! mtmp->mfroz = 0;
}
}
--- 146,155 ----
for(mtmp = fmon; mtmp; mtmp = mtmp->nmon) {
mtmp->msleep = 0;
! if(!mtmp->mcanmove && !rn2(5)) {
! mtmp->mfrozen = 0;
! mtmp->mcanmove = 1;
! }
}
}
***************
*** 148,153 ****
--- 165,171 ----
mtmp2->minvent->spe = -1;
}
unpmon(mtmp2);
+ mtmp2->m_ap_type = M_AP_MONSTER;
mtmp2->mappearance = wizapp[rn2(SIZE(wizapp))];
pmon(mtmp2);
}
***************
*** 262,308 ****
const char *random_malediction[] = {
"Hell shall soon claim thy remains,",
! "I chortle at thee, pathetic",
! "Prepare to die,",
"Resistance is useless,",
"Surrender or die, thou",
! "There shall be no mercy, yon",
"Thou shalt repent of thy cunning,",
"Thou art as a flea to me,",
"Thou art doomed,",
"Thy fate is sealed,",
"Verily, thou shalt be one dead"
! /* "Go play leapfrog with a unicorn,", */
};
! /* Insult the player */
void
cuss(mtmp)
register struct monst *mtmp;
{
! switch (rn2(5)) {
! case 0: pline("%s casts aspersions on your ancestry.",
! Monnam(mtmp));
! break;
! case 1: pline("%s laughs fiendishly.", /* typical bad guy action */
! Monnam(mtmp));
! break;
! default:
! if (u.uhave_amulet && !rn2(SIZE(random_insult)))
! pline("\"Relinquish the amulet, %s!\"",
! random_insult[rn2(SIZE(random_insult))]);
! else if (u.uhp < 5 && !rn2(2)) /* Panic */
! pline(rn2(2) ?
! "\"Even now thy life force ebbs, %s!\"" :
! "\"Savor thy breath, %s, it be thine last!\"",
! random_insult[rn2(SIZE(random_insult))]);
! else if (mtmp->mhp < 5 && !rn2(2)) /* Parthian shot */
! pline(rn2(2) ?
! "\"I shall return.\"" :
! "\"I'll be back.\"");
! else
! pline("\"%s %s!\"",
! random_malediction[rn2(SIZE(random_malediction))],
! random_insult[rn2(SIZE(random_insult))]);
}
}
--- 280,357 ----
const char *random_malediction[] = {
"Hell shall soon claim thy remains,",
! "I chortle at thee, thou pathetic",
! "Prepare to die, thou ",
"Resistance is useless,",
"Surrender or die, thou",
! "There shall be no mercy, thou",
"Thou shalt repent of thy cunning,",
"Thou art as a flea to me,",
"Thou art doomed,",
"Thy fate is sealed,",
"Verily, thou shalt be one dead"
! };
!
! #ifdef SOUNDS
! const char *demonic_malediction[] = {
! "I first mistook thee for a statue, when I regarded thy head of stone.",
! "Come here often?",
! "Dost pain excite thee? Wouldst thou prefer the whip?",
! "Thinkest thou it shall tickle as I rip out thy lungs?",
! "Eat slime and die!",
! "Go ahead, fetch thy mama! I shall wait.",
! "Go play leapfrog with a herd of unicorns!",
! "Hast thou been drinking, or art thou always so clumsy?",
! "This time I shall let thee off with a spanking, but let it not happen again.",
! "I've met smarter (and prettier) acid blobs.",
! "Look! Thy bootlace is undone!",
! "Mercy! Dost thou wish me to die of laughter?",
! "Run away! Live to flee another day!",
! "Thou hadst best fight better than thou canst dress!",
! "Twixt thy cousin and thee, Medusa is the prettier.",
! "Methinks thou wert unnaturally interested in yon corpse back there, eh, varlet?",
! "Up thy nose with a rubber hose!",
! "Verily, thy corpse could not smell worse!",
! "Wait! I shall polymorph into a grid bug to give thee a fighting chance!",
! "Why search for the Amulet? Thou wouldst but lose it, cretin.",
};
+ #endif
! /* Insult or intimidate the player */
void
cuss(mtmp)
register struct monst *mtmp;
{
! #ifdef SOUNDS
! if (mtmp->iswiz) {
! #endif
! if (!rn2(5)) /* typical bad guy action */
! pline("%s laughs fiendishly.", Monnam(mtmp));
! else
! if (u.uhave_amulet && !rn2(SIZE(random_insult)))
! pline("\"Relinquish the amulet, %s!\"",
! random_insult[rn2(SIZE(random_insult))]);
! else if (u.uhp < 5 && !rn2(2)) /* Panic */
! pline(rn2(2) ?
! "\"Even now thy life force ebbs, %s!\"" :
! "\"Savor thy breath, %s, it be thine last!\"",
! random_insult[rn2(SIZE(random_insult))]);
! else if (mtmp->mhp < 5 && !rn2(2)) /* Parthian shot */
! verbalize(rn2(2) ?
! "I shall return." :
! "I'll be back.");
! else
! pline("\"%s %s!\"",
! random_malediction[rn2(SIZE(random_malediction))],
! random_insult[rn2(SIZE(random_insult))]);
! #ifdef SOUNDS
! } else {
! if (!rn2(5))
! kludge("%s casts aspersions on your ancestry.", Monnam(mtmp));
! else
! verbalize(demonic_malediction[rn2(SIZE(demonic_malediction))]);
}
+ #endif
}
+
+ #endif /* OVLB */
*** src/Old/worm.c Mon Feb 19 19:09:31 1990
--- src/worm.c Sun Jan 28 19:32:59 1990
***************
*** 7,12 ****
--- 7,36 ----
#ifdef WORM
#include "wseg.h"
+ static void FDECL(remseg,(struct monst *,struct wseg *));
+
+ /* Each tailed worm has a wormno. This is used as an index for the following
+ * arrays:
+ * wsegs: the start of a a linked list of segments, located at the tail.
+ * wheads: the end of a linked list of segments, located at the head. Putting
+ * the tail of the list at the head of the worm and vice versa is an
+ * endless source of confusion, but necessary. From now on, we will use
+ * "start" and "end" to refer to the list, and "head" and "tail" to refer
+ * to the worm.
+ * wgrowtime: obvious.
+ *
+ * When a worm is moved, we add a new segment at the head (end of the list)
+ * and (unless we want it to grow) delete the segment at the tail (beginning
+ * of the list). This new head segment is located in the same square as
+ * the actual head of the worm (thus requiring a special case when setting
+ * level.monsters upon worm movement). If we do want to grow the worm, we
+ * don't delete the tail segment, and we give the worm extra hit points,
+ * which possibly go into its maximum.
+ *
+ * Non-moving worms (worm_nomove) shrink instead of grow as their tails keep
+ * going while their heads are stopped short. Delete the tail segment,
+ * and remove hit points from the worm.
+ */
struct wseg *wsegs[32] = DUMMY, *wheads[32] = DUMMY, *m_atseg = 0;
long wgrowtime[32] = DUMMY;
***************
*** 193,199 ****
--- 217,231 ----
wsegs[tmp2] = wsegs[tmp];
wgrowtime[tmp2] = 0;
}
+ /* do-loop: go from the tail to the head. Segments close to the tail
+ * either die or become part of worm 2. We stop at the hit segment
+ * and this loop never goes down the entire length of the worm.
+ */
do {
+ /* The segment immediately next to (tailwards) the one hit, */
+ /* becoes the head of the new second worm. Note: at this point, */
+ /* wtmp->nseg is the one you hit, wtmp is immediately tailwards, */
+ /* and wtmp->nseg->nseg is immediately headwards. */
if(wtmp->nseg->wx == x && wtmp->nseg->wy == y){
if(tmp2) wheads[tmp2] = wtmp;
wsegs[tmp] = wtmp->nseg->nseg;
***************
*** 202,208 ****
if(tmp2) {
kludge("You cut %s in half.", mon_nam(mtmp));
/* devalue the monster level of both halves of the worm */
! mtmp->m_lev = (mtmp->m_lev <= 2) ? 2 : mtmp->m_lev - 2;
mtmp2->m_lev = mtmp->m_lev;
/* calculate the mhp on the new (lower) monster level */
mtmp2->mhpmax = mtmp2->mhp = d((int)mtmp2->m_lev, 8);
--- 234,240 ----
if(tmp2) {
kludge("You cut %s in half.", mon_nam(mtmp));
/* devalue the monster level of both halves of the worm */
! mtmp->m_lev = (mtmp->m_lev <= 3) ? 2 : mtmp->m_lev - 2;
mtmp2->m_lev = mtmp->m_lev;
/* calculate the mhp on the new (lower) monster level */
mtmp2->mhpmax = mtmp2->mhp = d((int)mtmp2->m_lev, 8);
***************
*** 219,226 ****
--- 251,261 ----
mtmp->mhp /= 2;
return;
}
+ /* Worm segments which are closer to the tail than the one you hit, */
+ /* get either deleted or transferred from the old to new worms */
wtmp2 = wtmp->nseg;
if(!tmp2) remseg(mtmp, wtmp);
+ else place_worm_seg(mtmp2, wtmp->wx, wtmp->wy);
wtmp = wtmp2;
} while(wtmp->nseg);
panic("Cannot find worm segment");
*** src/Old/worn.c Mon Feb 19 19:09:52 1990
--- src/worn.c Mon Jan 22 21:02:41 1990
***************
*** 35,42 ****
register struct obj *obj;
long mask;
{
! register struct worn *wp;
! register struct obj *oobj;
for(wp = worn; wp->w_mask; wp++) if(wp->w_mask & mask) {
oobj = *(wp->w_obj);
--- 35,42 ----
register struct obj *obj;
long mask;
{
! register const struct worn *wp;
! register struct obj *oobj = 0;
for(wp = worn; wp->w_mask; wp++) if(wp->w_mask & mask) {
oobj = *(wp->w_obj);
***************
*** 71,87 ****
*/
if (Inhell && !Fire_resistance) {
pline(crispy);
! killer = "loss of fire protection";
done(BURNING);
/* If we're here they survived with life saving, so put the
* weapon they just unwielded back in their hands...
*/
! if (oobj->otyp != DRAGON_SCALE_MAIL
&& oobj->otyp != RIN_FIRE_RESISTANCE
#ifdef NAMED_ITEMS
&& !defends(AD_FIRE, oobj)
#endif
! && oobj->corpsenm != PM_RED_DRAGON)
impossible("lost FR from a non-FR item?");
setworn(oobj, mask);
}
--- 71,88 ----
*/
if (Inhell && !Fire_resistance) {
pline(crispy);
! killer_format = NO_KILLER_PREFIX;
! killer = self_pronoun("lost %s fire protection in hell","his");
done(BURNING);
/* If we're here they survived with life saving, so put the
* weapon they just unwielded back in their hands...
*/
! if (!oobj || (oobj->otyp != DRAGON_SCALE_MAIL
&& oobj->otyp != RIN_FIRE_RESISTANCE
#ifdef NAMED_ITEMS
&& !defends(AD_FIRE, oobj)
#endif
! && oobj->corpsenm != PM_RED_DRAGON))
impossible("lost FR from a non-FR item?");
setworn(oobj, mask);
}
***************
*** 92,98 ****
setnotworn(obj)
register struct obj *obj;
{
! register struct worn *wp;
if (!obj) return;
for(wp = worn; wp->w_mask; wp++)
--- 93,99 ----
setnotworn(obj)
register struct obj *obj;
{
! register const struct worn *wp;
if (!obj) return;
for(wp = worn; wp->w_mask; wp++)
***************
*** 111,117 ****
*/
if (Inhell && !Fire_resistance && obj->olet != AMULET_SYM) {
pline(crispy);
! killer = "loss of fire protection";
done(BURNING);
/* Survived with lifesaving, etc...; there's no general way
* to undo the setnotworn()--we can't re-wear/wield the
--- 112,119 ----
*/
if (Inhell && !Fire_resistance && obj->olet != AMULET_SYM) {
pline(crispy);
! killer_format = NO_KILLER_PREFIX;
! killer = self_pronoun("lost %s fire protection in hell","his");
done(BURNING);
/* Survived with lifesaving, etc...; there's no general way
* to undo the setnotworn()--we can't re-wear/wield the
*** src/Old/search.c Mon Feb 19 18:58:10 1990
--- src/search.c Sat Feb 3 21:37:33 1990
***************
*** 7,12 ****
--- 7,16 ----
# include "artifact.h"
#endif
+ static void FDECL(findone,(XCHAR_P,XCHAR_P,int *));
+
+ #ifdef OVLB
+
static void
findone(zx,zy,num)
xchar zx,zy;
***************
*** 66,78 ****
num = 0;
for(zy = ly; zy <= hy; zy++)
for(zx = lx; zx <= hx; zx++)
! findone(zx,zy,&num);
for(zy = ly2; zy <= hy2; zy++)
for(zx = lx2; zx <= hx2; zx++)
! findone(zx,zy,&num);
return(num);
}
int
dosearch()
{
--- 70,87 ----
num = 0;
for(zy = ly; zy <= hy; zy++)
for(zx = lx; zx <= hx; zx++)
! if(isok(zx,zy))
! findone(zx,zy,&num);
for(zy = ly2; zy <= hy2; zy++)
for(zx = lx2; zx <= hx2; zx++)
! if(isok(zx,zy))
! findone(zx,zy,&num);
return(num);
}
+ #endif /* OVLB */
+ #ifdef OVL1
+
int
dosearch()
{
***************
*** 98,104 ****
pline("What are you looking for? The exit?");
} else
for(x = u.ux-1; x < u.ux+2; x++)
! for(y = u.uy-1; y < u.uy+2; y++)
if(x != u.ux || y != u.uy) {
if(levl[x][y].typ == SDOOR) {
#ifdef NAMED_ITEMS
--- 107,114 ----
pline("What are you looking for? The exit?");
} else
for(x = u.ux-1; x < u.ux+2; x++)
! for(y = u.uy-1; y < u.uy+2; y++) {
! if(!isok(x,y)) continue;
if(x != u.ux || y != u.uy) {
if(levl[x][y].typ == SDOOR) {
#ifdef NAMED_ITEMS
***************
*** 153,158 ****
--- 163,169 ----
You("find %s posing as a statue.",
defmonnam(mtmp));
delobj(otmp);
+ newsym(x, y);
}
deltrap(trap);
return(1);
***************
*** 164,172 ****
--- 175,187 ----
}
}
}
+ }
return(1);
}
+ #endif /* OVL1 */
+ #ifdef OVLB
+
int
doidtrap() {
register struct trap *trap;
***************
*** 180,186 ****
if(u.dz)
if((u.dz < 0) != (is_maze_lev && trap->ttyp == TRAPDOOR))
continue;
! pline("That is a%s.",traps[ Hallucination ? rn2(TRAPNUM-3)+2 :
trap->ttyp]);
return 0;
}
--- 195,201 ----
if(u.dz)
if((u.dz < 0) != (is_maze_lev && trap->ttyp == TRAPDOOR))
continue;
! pline("That is a%s.",traps[ Hallucination ? rn2(TRAPNUM-3)+3 :
trap->ttyp]);
return 0;
}
***************
*** 188,193 ****
--- 203,211 ----
return 0;
}
+ #endif /* OVLB */
+ #ifdef OVL0
+
void
wakeup(mtmp)
register struct monst *mtmp;
***************
*** 198,203 ****
--- 216,224 ----
if(mtmp->mimic) seemimic(mtmp);
}
+ #endif /* OVL0 */
+ #ifdef OVLB
+
/* NOTE: we must check if(mtmp->mimic) before calling this routine */
void
seemimic(mtmp)
***************
*** 204,210 ****
--- 225,234 ----
register struct monst *mtmp;
{
mtmp->mimic = 0;
+ mtmp->m_ap_type = M_AP_NOTHING;
mtmp->mappearance = 0;
unpmon(mtmp);
pmon(mtmp);
}
+
+ #endif /* OVLB */