home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Usenet 1994 January
/
usenetsourcesnewsgroupsinfomagicjanuary1994.iso
/
sources
/
games
/
volume16
/
nethack31
/
patch2c
/
patches02i
Wrap
Text File
|
1993-06-16
|
57KB
|
2,128 lines
*** /tmp/da11426 Tue Jun 1 16:16:08 1993
--- src/topten.c Tue May 25 15:33:42 1993
***************
*** 36,42 ****
#define POINTSMIN 1 /* must be > 0 */
#define ENTRYMAX 100 /* must be >= 10 */
! #ifndef MICRO
#define PERS_IS_UID /* delete for PERSMAX per name; now per uid */
#endif
struct toptenentry {
--- 36,42 ----
#define POINTSMIN 1 /* must be > 0 */
#define ENTRYMAX 100 /* must be >= 10 */
! #if !defined(MICRO) && !defined(MAC)
#define PERS_IS_UID /* delete for PERSMAX per name; now per uid */
#endif
struct toptenentry {
***************
*** 77,98 ****
/* note: fscanf() below must read the record's terminating newline */
final_fpos = tt->fpos = ftell(rfile);
#endif
#ifdef NO_SCAN_BRACK
if(fscanf(rfile,"%6s %d %d %d %d %d %d %ld%*c%c%c %s %s%*c",
- # define TTFIELDS 13
#else
if(fscanf(rfile, "%6s %d %d %d %d %d %d %ld %c%c %[^,],%[^\n]%*c",
- # define TTFIELDS 12
#endif
tt->date, &tt->uid,
&tt->deathdnum, &tt->deathlev,
&tt->maxlvl, &tt->hp, &tt->maxhp, &tt->points,
&tt->plchar, &tt->sex,
- #ifdef LATTICE /* return value is broken also, sigh */
- tt->name, tt->death) < 1)
- #else
tt->name, tt->death) != TTFIELDS)
- #endif
#undef TTFIELDS
tt->points = 0;
else {
--- 77,93 ----
/* note: fscanf() below must read the record's terminating newline */
final_fpos = tt->fpos = ftell(rfile);
#endif
+ #define TTFIELDS 12
#ifdef NO_SCAN_BRACK
if(fscanf(rfile,"%6s %d %d %d %d %d %d %ld%*c%c%c %s %s%*c",
#else
if(fscanf(rfile, "%6s %d %d %d %d %d %d %ld %c%c %[^,],%[^\n]%*c",
#endif
tt->date, &tt->uid,
&tt->deathdnum, &tt->deathlev,
&tt->maxlvl, &tt->hp, &tt->maxhp, &tt->points,
&tt->plchar, &tt->sex,
tt->name, tt->death) != TTFIELDS)
#undef TTFIELDS
tt->points = 0;
else {
***************
*** 208,217 ****
#if defined(WIZARD) || defined(EXPLORE_MODE)
if (wizard || discover) {
! raw_print("");
! raw_printf(
"Since you were in %s mode, the score list will not be checked.",
wizard ? "wizard" : "discover");
return;
}
#endif
--- 203,214 ----
#if defined(WIZARD) || defined(EXPLORE_MODE)
if (wizard || discover) {
! HUP {
! raw_print("");
! raw_printf(
"Since you were in %s mode, the score list will not be checked.",
wizard ? "wizard" : "discover");
+ }
return;
}
#endif
***************
*** 533,538 ****
--- 530,543 ----
return;
}
+ #ifdef AMIGA
+ {
+ extern winid amii_rawprwin;
+ init_nhwindows();
+ amii_rawprwin = create_nhwindow( NHW_TEXT );
+ }
+ #endif
+
/* If the score list isn't after a game, we never went through */
/* init_dungeons() */
if (wiz1_level.dlevel == 0) init_dungeons();
***************
*** 556,562 ****
--- 561,571 ----
#else
player0 = plname;
if(!*player0)
+ #ifdef AMIGA
+ player0 = "all"; /* single user system */
+ #else
player0 = "hackplayer";
+ #endif
playerct = 1;
players = &player0;
#endif
***************
*** 602,607 ****
--- 611,621 ----
hname);
}
}
+ #ifdef AMIGA
+ display_nhwindow( amii_rawprwin, 1 );
+ destroy_nhwindow( amii_rawprwin );
+ amii_rawprwin = WIN_ERR;
+ #endif
return;
}
***************
*** 651,656 ****
--- 665,675 ----
break;
}
#endif /* nonsense /**/
+ #ifdef AMIGA
+ display_nhwindow( amii_rawprwin, 1 );
+ destroy_nhwindow( amii_rawprwin );
+ amii_rawprwin = WIN_ERR;
+ #endif
}
static int
*** /tmp/da11442 Tue Jun 1 16:16:12 1993
--- src/trap.c Tue Jun 1 10:47:53 1993
***************
*** 1,8 ****
! /* SCCS Id: @(#)trap.c 3.1 93/02/13 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
! #include "hack.h"
#ifdef OVLB
const char *traps[TRAPNUM] = {
--- 1,8 ----
! /* SCCS Id: @(#)trap.c 3.1 93/05/25 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
! #include "hack.h"
#ifdef OVLB
const char *traps[TRAPNUM] = {
***************
*** 125,133 ****
--- 125,135 ----
register int x, y, typ;
{
register struct trap *ttmp;
+ register struct rm *lev;
register boolean oldplace;
if ((ttmp = t_at(x,y)) != 0) {
+ if (ttmp->ttyp == MAGIC_PORTAL) return (struct trap *)0;
oldplace = TRUE;
if (u.utrap && (x == u.ux) && (y == u.uy) &&
((u.utraptype == TT_BEARTRAP && typ != BEAR_TRAP) ||
***************
*** 148,156 ****
case PIT:
case SPIKED_PIT:
case TRAPDOOR:
! levl[x][y].doormask = 0; /* subsumes altarmask, icedpool... */
! if (IS_ROOM(levl[x][y].typ))
! levl[x][y].typ = ROOM;
break;
}
ttmp->tseen = 0;
--- 150,172 ----
case PIT:
case SPIKED_PIT:
case TRAPDOOR:
! lev = &levl[x][y];
! lev->doormask = 0; /* subsumes altarmask, icedpool... */
! if (IS_ROOM(lev->typ)) /* && !IS_AIR(lev->typ) */
! lev->typ = ROOM;
! #if defined(POLYSELF) || defined(MUSE)
! /*
! * some cases which can happen when digging
! * down while phazing thru solid areas
! */
! else if (lev->typ == STONE || lev->typ == SCORR)
! lev->typ = CORR;
! else if (IS_WALL(lev->typ) ||
! IS_DOOR(lev->typ) || lev->typ == SDOOR)
! lev->typ = level.flags.is_maze_lev ? ROOM :
! level.flags.is_cavernous_lev ? CORR : DOOR;
! #endif
! unearth_objs(x, y);
break;
}
ttmp->tseen = 0;
***************
*** 181,187 ****
# endif
tmp2 = !sobj_at(BOULDER,x,y) && (trapok || !t_at(x,y));
tmp3 = !(is_pool(x,y) &&
! !(Levitation || Wwalking || Magical_breathing
# ifdef POLYSELF
|| is_flyer(uasmon) || is_swimmer(uasmon)
|| is_clinger(uasmon)
--- 197,203 ----
# endif
tmp2 = !sobj_at(BOULDER,x,y) && (trapok || !t_at(x,y));
tmp3 = !(is_pool(x,y) &&
! !(Levitation || Wwalking || Amphibious
# ifdef POLYSELF
|| is_flyer(uasmon) || is_swimmer(uasmon)
|| is_clinger(uasmon)
***************
*** 200,206 ****
!MON_AT(x, y) &&
!sobj_at(BOULDER,x,y) && (trapok || !t_at(x,y)) &&
!(is_pool(x,y) &&
! !(Levitation || Wwalking || Magical_breathing
# ifdef POLYSELF
|| is_flyer(uasmon) || is_swimmer(uasmon)
|| is_clinger(uasmon)
--- 216,222 ----
!MON_AT(x, y) &&
!sobj_at(BOULDER,x,y) && (trapok || !t_at(x,y)) &&
!(is_pool(x,y) &&
! !(Levitation || Wwalking || Amphibious
# ifdef POLYSELF
|| is_flyer(uasmon) || is_swimmer(uasmon)
|| is_clinger(uasmon)
***************
*** 273,279 ****
} while(!rn2(4) && newlevel < dunlevs_in_dungeon(&u.uz));
if(td) pline("A trap door opens up under you!");
! else pline("The floor opens up under you!");
if(Levitation || u.ustuck || !Can_fall_thru(&u.uz)
#ifdef POLYSELF
--- 289,295 ----
} while(!rn2(4) && newlevel < dunlevs_in_dungeon(&u.uz));
if(td) pline("A trap door opens up under you!");
! else pline("The %s opens up under you!", surface(u.ux,u.uy));
if(Levitation || u.ustuck || !Can_fall_thru(&u.uz)
#ifdef POLYSELF
***************
*** 937,944 ****
case FIRE_TRAP:
if (in_sight)
! pline("A tower of flame bursts from the floor under %s!",
! mon_nam(mtmp));
if(resists_fire(mptr)) {
if (in_sight) {
shieldeff(mtmp->mx,mtmp->my);
--- 953,960 ----
case FIRE_TRAP:
if (in_sight)
! pline("A tower of flame bursts from the %s under %s!",
! surface(mtmp->mx,mtmp->my), mon_nam(mtmp));
if(resists_fire(mptr)) {
if (in_sight) {
shieldeff(mtmp->mx,mtmp->my);
***************
*** 954,959 ****
--- 970,977 ----
(void) destroy_mitem(mtmp, SCROLL_CLASS, AD_FIRE);
(void) destroy_mitem(mtmp, SPBOOK_CLASS, AD_FIRE);
(void) destroy_mitem(mtmp, POTION_CLASS, AD_FIRE);
+ if (is_ice(mtmp->mx,mtmp->my))
+ melt_ice(mtmp->mx,mtmp->my);
if (in_sight) seetrap(trap);
break;
***************
*** 1055,1060 ****
--- 1073,1079 ----
break;
case TELEP_TRAP:
+ if(tele_restrict(mtmp)) break;
case MAGIC_PORTAL:
#ifdef WALKIES
if(teleport_pet(mtmp)) {
***************
*** 1133,1139 ****
break; /* monsters usually don't set it off */
if(is_flyer(mptr)) {
if (in_sight) {
! pline("A trigger appears in a pile of soil below %s.", Monnam(mtmp));
seetrap(trap);
}
if (rn2(3)) break;
--- 1152,1158 ----
break; /* monsters usually don't set it off */
if(is_flyer(mptr)) {
if (in_sight) {
! pline("A trigger appears in a pile of soil below %s.", mon_nam(mtmp));
seetrap(trap);
}
if (rn2(3)) break;
***************
*** 1345,1353 ****
default:
dotrap(trap);
}
! if(!flags.nopick && OBJ_AT(u.ux, u.uy) &&
! !Is_airlevel(&u.uz) && !Is_waterlevel(&u.uz) &&
! (!is_pool(u.ux,u.uy) || Underwater))
pickup(1);
return 0;
}
--- 1364,1370 ----
default:
dotrap(trap);
}
! if(!Is_airlevel(&u.uz) && !Is_waterlevel(&u.uz))
pickup(1);
return 0;
}
***************
*** 1404,1409 ****
--- 1421,1439 ----
(void) safe_teleds();
}
+ boolean
+ tele_restrict(mon)
+ struct monst *mon;
+ {
+ if(level.flags.noteleport) {
+ if (canseemon(mon))
+ pline("A mysterious force prevents %s from teleporting!",
+ mon_nam(mon));
+ return TRUE;
+ }
+ return FALSE;
+ }
+
void
teleds(nux, nuy)
register int nux,nuy;
***************
*** 1423,1433 ****
u.uundetected = 0;
if (u.usym == S_MIMIC_DEF) u.usym = S_MIMIC;
#endif
- if(Punished) placebc();
if(u.uswallow){
u.uswldtim = u.uswallow = 0;
docrt();
}
initrack(); /* teleports mess up tracking monsters without this */
/*
* Make sure the hero disappears from the old location. This will
--- 1453,1463 ----
u.uundetected = 0;
if (u.usym == S_MIMIC_DEF) u.usym = S_MIMIC;
#endif
if(u.uswallow){
u.uswldtim = u.uswallow = 0;
docrt();
}
+ if(Punished) placebc();
initrack(); /* teleports mess up tracking monsters without this */
/*
* Make sure the hero disappears from the old location. This will
***************
*** 1446,1452 ****
{
struct trap *trap;
boolean castit = FALSE;
! register int sp_no = 0;
trap = t_at(u.ux, u.uy);
if (trap && (!trap->tseen || trap->ttyp != TELEP_TRAP))
--- 1476,1482 ----
{
struct trap *trap;
boolean castit = FALSE;
! register int sp_no = 0, energy;
trap = t_at(u.ux, u.uy);
if (trap && (!trap->tseen || trap->ttyp != TELEP_TRAP))
***************
*** 1503,1514 ****
}
if(!trap && (u.uhunger <= 100 || ACURR(A_STR) < 6)) {
- You("lack the strength for a teleport spell.");
#ifdef WIZARD
! if(!wizard)
#endif
! return(1);
}
if(!trap &&
check_capacity("Your concentration falters from carrying so much."))
return 1;
--- 1533,1563 ----
}
if(!trap && (u.uhunger <= 100 || ACURR(A_STR) < 6)) {
#ifdef WIZARD
! if (!wizard) {
#endif
! You("lack the strength %s.",
! castit ? "for a teleport spell" : "to teleport");
! return 1;
! #ifdef WIZARD
! }
! #endif
}
+
+ energy = objects[SPE_TELEPORT_AWAY].oc_level * 7 / 2 - 2;
+
+ if(!trap && u.uen <= energy) {
+ #ifdef WIZARD
+ if (!wizard) {
+ #endif
+ You("lack the energy %s.",
+ castit ? "for a teleport spell" : "to teleport");
+ return 1;
+ #ifdef WIZARD
+ } else u.uen = energy;
+ #endif
+ }
+
if(!trap &&
check_capacity("Your concentration falters from carrying so much."))
return 1;
***************
*** 1522,1528 ****
if (!wizard)
#endif
return(0);
! }
#ifdef WALKIES
if(next_to_u()) {
#endif
--- 1571,1579 ----
if (!wizard)
#endif
return(0);
! } else if (!trap)
! u.uen -= energy;
!
#ifdef WALKIES
if(next_to_u()) {
#endif
***************
*** 1729,1735 ****
* SCR_FIRE by GAN 11/02/86
*/
! pline("A tower of flame bursts from the floor!");
if(Fire_resistance) {
shieldeff(u.ux, u.uy);
You("are uninjured.");
--- 1780,1786 ----
* SCR_FIRE by GAN 11/02/86
*/
! pline("A tower of flame bursts from the %s!", surface(u.ux,u.uy));
if(Fire_resistance) {
shieldeff(u.ux, u.uy);
You("are uninjured.");
***************
*** 1741,1746 ****
--- 1792,1799 ----
destroy_item(SCROLL_CLASS, AD_FIRE);
destroy_item(SPBOOK_CLASS, AD_FIRE);
destroy_item(POTION_CLASS, AD_FIRE);
+ if (is_ice(u.ux, u.uy))
+ melt_ice(u.ux, u.uy);
}
static void
***************
*** 1888,1895 ****
} else if(is_rustprone(obj) && obj->oeroded < MAX_ERODE &&
!(obj->oerodeproof || (obj->blessed && !rnl(4))) &&
(force || rn2(12) > Luck)) {
! /* all metal stuff and armor except body armor
! protected by oilskin cloak */
if(obj->oclass != ARMOR_CLASS || obj != uarm ||
!uarmc || uarmc->otyp != OILSKIN_CLOAK ||
(uarmc->cursed && !rn2(3)))
--- 1941,1948 ----
} else if(is_rustprone(obj) && obj->oeroded < MAX_ERODE &&
!(obj->oerodeproof || (obj->blessed && !rnl(4))) &&
(force || rn2(12) > Luck)) {
! /* all metal stuff and armor except (body armor
! protected by oilskin cloak) */
if(obj->oclass != ARMOR_CLASS || obj != uarm ||
!uarmc || uarmc->otyp != OILSKIN_CLOAK ||
(uarmc->cursed && !rn2(3)))
***************
*** 1965,1971 ****
#ifdef POLYSELF
is_swimmer(uasmon) ||
#endif
! Magical_breathing)) {
/* water effects on objects every now and then */
if (!rn2(5)) inpool_ok = TRUE;
else return(FALSE);
--- 2018,2024 ----
#ifdef POLYSELF
is_swimmer(uasmon) ||
#endif
! Amphibious)) {
/* water effects on objects every now and then */
if (!rn2(5)) inpool_ok = TRUE;
else return(FALSE);
***************
*** 1972,1979 ****
}
if (!u.uinwater) {
! You("%s into the water!",
! Is_waterlevel(&u.uz) ? "plunge" : "fall");
#ifdef POLYSELF
if(!is_swimmer(uasmon))
#endif
--- 2025,2033 ----
}
if (!u.uinwater) {
! You("%s into the water%c",
! Is_waterlevel(&u.uz) ? "plunge" : "fall",
! Amphibious ? '.' : '!');
#ifdef POLYSELF
if(!is_swimmer(uasmon))
#endif
***************
*** 1992,2005 ****
You("multiply.");
}
}
-
- if(is_swimmer(uasmon) && !inpool_ok) {
- if (Punished) placebc();
- u.uinwater = 1;
- under_water(1);
- vision_full_recalc = 1;
- return(FALSE);
- }
#endif
if (inpool_ok) return(FALSE);
#ifdef WALKIES
--- 2046,2051 ----
***************
*** 2010,2021 ****
unleash_all();
}
#endif
! if (Magical_breathing) {
! pline("But wait!");
! Your("lungs start acting like gills.");
! if (!Is_waterlevel(&u.uz))
! Your("%s the bottom.",Hallucination ? "keel hits" : "feet touch");
! if (Punished) placebc();
u.uinwater = 1;
under_water(1);
vision_full_recalc = 1;
--- 2056,2079 ----
unleash_all();
}
#endif
! if (Amphibious
! #ifdef POLYSELF
! || is_swimmer(uasmon)
! #endif
! ) {
! if (Amphibious) {
! if (flags.verbose)
! pline("But you aren't drowning.");
! if (!Is_waterlevel(&u.uz))
! if (Hallucination)
! Your("keel hits the bottom.");
! else
! You("touch bottom.");
! }
! if (Punished) {
! unplacebc();
! placebc();
! }
u.uinwater = 1;
under_water(1);
vision_full_recalc = 1;
***************
*** 2076,2083 ****
done(DROWNING);
}
u.uinwater = 0;
! You("find yourself back %s.",Is_waterlevel(&u.uz) ?
! "in an air bubble" : "on dry land");
return(TRUE);
}
--- 2134,2141 ----
done(DROWNING);
}
u.uinwater = 0;
! You("find yourself back %s.", Is_waterlevel(&u.uz) ?
! "in an air bubble" : "on land");
return(TRUE);
}
***************
*** 2216,2222 ****
if(!force && (confused || Fumbling ||
rnd(75+level_difficulty()/2) > ch)) {
You("set it off!");
! b_trapped("door");
} else
You("disarm it!");
levl[x][y].doormask &= ~D_TRAPPED;
--- 2274,2280 ----
if(!force && (confused || Fumbling ||
rnd(75+level_difficulty()/2) > ch)) {
You("set it off!");
! b_trapped("door", FINGER);
} else
You("disarm it!");
levl[x][y].doormask &= ~D_TRAPPED;
***************
*** 2327,2333 ****
case 14:
case 13:
You("feel a needle prick your %s.",body_part(bodypart));
! poisoned("needle", A_CON, "poison needle",10);
exercise(A_CON, FALSE);
break;
case 12:
--- 2385,2391 ----
case 14:
case 13:
You("feel a needle prick your %s.",body_part(bodypart));
! poisoned("needle", A_CON, "poisoned needle",10);
exercise(A_CON, FALSE);
break;
case 12:
***************
*** 2343,2348 ****
--- 2401,2408 ----
destroy_item(SCROLL_CLASS, AD_FIRE);
destroy_item(SPBOOK_CLASS, AD_FIRE);
destroy_item(POTION_CLASS, AD_FIRE);
+ if (is_ice(u.ux, u.uy))
+ melt_ice(u.ux, u.uy);
break;
case 8:
case 7:
***************
*** 2422,2440 ****
dealloc_trap(trap);
}
! /* used for doors. can be used for anything else that opens. */
void
! b_trapped(item)
register const char *item;
{
register int lvl = level_difficulty();
! int dmg = rnd(5 + (lvl<5 ? lvl : 2+lvl/2));
pline("KABOOM!! %s was booby-trapped!", The(item));
! if (u.ulevel < 4 && lvl < 3 && !rnl(3))
! You("are shaken, but luckily unhurt.");
! else losehp(dmg, "explosion", KILLED_BY_AN);
exercise(A_STR, FALSE);
make_stunned(HStun + dmg, TRUE);
}
--- 2482,2500 ----
dealloc_trap(trap);
}
! /* used for doors (also tins). can be used for anything else that opens. */
void
! b_trapped(item, bodypart)
register const char *item;
+ register int bodypart;
{
register int lvl = level_difficulty();
! int dmg = rnd(5 + (lvl < 5 ? lvl : 2+lvl/2));
pline("KABOOM!! %s was booby-trapped!", The(item));
! losehp(dmg, "explosion", KILLED_BY_AN);
exercise(A_STR, FALSE);
+ if (bodypart) exercise(A_CON, FALSE);
make_stunned(HStun + dmg, TRUE);
}
*** /tmp/da11450 Tue Jun 1 16:16:16 1993
--- src/u_init.c Tue Apr 27 17:00:42 1993
***************
*** 1,4 ****
! /* SCCS Id: @(#)u_init.c 3.1 93/02/21 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
--- 1,4 ----
! /* SCCS Id: @(#)u_init.c 3.1 93/04/24 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
***************
*** 368,374 ****
* generators are bad enough to seriously skew the
* results if we use rn2(2)... --KAA
*/
!
/*
* Elves are people of music and song, or they are warriors.
* Warriors get mithril coats; non-warriors MAY get an
--- 368,374 ----
* generators are bad enough to seriously skew the
* results if we use rn2(2)... --KAA
*/
! ini_inv(Elf);
/*
* Elves are people of music and song, or they are warriors.
* Warriors get mithril coats; non-warriors MAY get an
***************
*** 375,396 ****
* instrument. We use a kludge to get only non-magic
* instruments.
*/
! if (Elf[E_ARMOR].trotyp == ELVEN_CLOAK) {
! if (!rn2(5)) {
! static int trotyp[] = {
! WOODEN_FLUTE, TOOLED_HORN, WOODEN_HARP,
! BELL, BUGLE, LEATHER_DRUM
! };
!
! Instrument[0].trotyp = trotyp[rn2(SIZE(trotyp))];
! #ifdef DEBUG
! debugpline("Elf got instrument %d",
! Instrument[0].trotyp);
! #endif
! ini_inv(Instrument);
! }
}
- ini_inv(Elf);
if(!rn2(5)) ini_inv(Blindfold);
else if(!rn2(6)) ini_inv(Lamp);
knows_object(ELVEN_SHORT_SWORD);
--- 375,388 ----
* instrument. We use a kludge to get only non-magic
* instruments.
*/
! if (Elf[E_ARMOR].trotyp == ELVEN_CLOAK && !rn2(5)) {
! static int trotyp[] = {
! WOODEN_FLUTE, TOOLED_HORN, WOODEN_HARP,
! BELL, BUGLE, LEATHER_DRUM
! };
! Instrument[0].trotyp = trotyp[rn2(SIZE(trotyp))];
! ini_inv(Instrument);
}
if(!rn2(5)) ini_inv(Blindfold);
else if(!rn2(6)) ini_inv(Lamp);
knows_object(ELVEN_SHORT_SWORD);
*** /tmp/da11458 Tue Jun 1 16:16:19 1993
--- src/uhitm.c Tue Jun 1 14:25:48 1993
***************
*** 323,328 ****
--- 323,330 ----
}
#endif
} else {
+ int oldhp = mon->mhp;
+
/* we hit the monster; be careful: it might die! */
notonhead = (mon->mx != u.ux+u.dx || mon->my != u.uy+u.dy);
if((malive = hmon(mon, uwep, 0)) == TRUE) {
***************
*** 337,343 ****
)
u.ustuck = 0;
}
! if (mon->wormno) cutworm(mon, u.ux+u.dx, u.uy+u.dy, uwep);
}
if(mon->ispriest && !rn2(2)) ghod_hitsu(mon);
if(special) (void) angry_guards(!flags.soundok);
--- 339,350 ----
)
u.ustuck = 0;
}
! /* If no damage was done (Vorpal Blade and not on head)
! * do not cut the worm. We lost the information long ago, so
! * we must do this by checking the hit points.
! */
! if (mon->wormno && mon->mhp < oldhp)
! cutworm(mon, u.ux+u.dx, u.uy+u.dy, uwep);
}
if(mon->ispriest && !rn2(2)) ghod_hitsu(mon);
if(special) (void) angry_guards(!flags.soundok);
***************
*** 1347,1359 ****
if (mon->data == &mons[PM_SHADE])
Your("hug passes harmlessly through %s.",
mon_nam(mon));
! else if (!sticks(mon->data))
if (mon==u.ustuck) {
pline("%s is being %s.", Monnam(mon),
u.umonnum==PM_ROPE_GOLEM ? "choked":
"crushed");
sum[i] = damageum(mon, mattk);
! } else if(sum[i-1] && sum[i-2]) {
You("grab %s!", mon_nam(mon));
u.ustuck = mon;
sum[i] = damageum(mon, mattk);
--- 1354,1366 ----
if (mon->data == &mons[PM_SHADE])
Your("hug passes harmlessly through %s.",
mon_nam(mon));
! else if (!sticks(mon->data) && !u.uswallow)
if (mon==u.ustuck) {
pline("%s is being %s.", Monnam(mon),
u.umonnum==PM_ROPE_GOLEM ? "choked":
"crushed");
sum[i] = damageum(mon, mattk);
! } else if(i >= 2 && sum[i-1] && sum[i-2]) {
You("grab %s!", mon_nam(mon));
u.ustuck = mon;
sum[i] = damageum(mon, mattk);
***************
*** 1526,1532 ****
} else {
You("are frozen by %s gaze!",
s_suffix(mon_nam(mon)));
! nomul((ACURR(A_WIS) > 12 || rn2(4)) ? -tmp : -120);
}
} else {
pline("%s cannot defend itself.",
--- 1533,1539 ----
} else {
You("are frozen by %s gaze!",
s_suffix(mon_nam(mon)));
! nomul((ACURR(A_WIS) > 12 || rn2(4)) ? -tmp : -127);
}
} else {
pline("%s cannot defend itself.",
*** /tmp/da11466 Tue Jun 1 16:16:22 1993
--- src/vault.c Tue Jun 1 12:12:46 1993
***************
*** 1,4 ****
! /* SCCS Id: @(#)vault.c 3.1 93/01/15 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
--- 1,4 ----
! /* SCCS Id: @(#)vault.c 3.1 93/03/30 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
***************
*** 41,47 ****
}
}
levl[fcx][fcy].typ = EGD(grd)->fakecorr[fcbeg].ftyp;
! map_background(fcx,fcy, 1);
if(!ACCESSIBLE(levl[fcx][fcy].typ)) block_point(fcx,fcy);
EGD(grd)->fcbeg++;
}
--- 41,47 ----
}
}
levl[fcx][fcy].typ = EGD(grd)->fakecorr[fcbeg].ftyp;
! map_location(fcx, fcy, 1); /* bypass vision */
if(!ACCESSIBLE(levl[fcx][fcy].typ)) block_point(fcx,fcy);
EGD(grd)->fcbeg++;
}
***************
*** 331,338 ****
if(!IS_WALL(levl[x][y].typ) && !in_fcorridor(grd, x, y)) {
if(MON_AT(x, y) && grd->mx != x && grd->my != y) {
struct monst *mon = m_at(x,y);
! if (mon->data->msound != MS_SILENT)
! yelp(mon);
rloc(mon);
}
if ((gold = g_at(x, y)) != 0) {
--- 331,339 ----
if(!IS_WALL(levl[x][y].typ) && !in_fcorridor(grd, x, y)) {
if(MON_AT(x, y) && grd->mx != x && grd->my != y) {
struct monst *mon = m_at(x,y);
! #ifdef SOUNDS
! yelp(mon);
! #endif
rloc(mon);
}
if ((gold = g_at(x, y)) != 0) {
***************
*** 367,374 ****
if(!IS_WALL(levl[x][y].typ) && !in_fcorridor(grd, x, y)) {
if(MON_AT(x, y) && grd->mx != x && grd->my != y) {
struct monst *mon = m_at(x,y);
! if (mon->data->msound != MS_SILENT)
! yelp(mon);
rloc(mon);
}
if ((gold = g_at(x, y)) != 0) {
--- 368,376 ----
if(!IS_WALL(levl[x][y].typ) && !in_fcorridor(grd, x, y)) {
if(MON_AT(x, y) && grd->mx != x && grd->my != y) {
struct monst *mon = m_at(x,y);
! #ifdef SOUNDS
! yelp(mon);
! #endif
rloc(mon);
}
if ((gold = g_at(x, y)) != 0) {
***************
*** 724,731 ****
register struct obj *obj;
for (obj = invent; obj; obj = obj->nobj)
! if (Is_container(obj))
value += contained_gold(obj);
return(value);
}
--- 726,734 ----
register struct obj *obj;
for (obj = invent; obj; obj = obj->nobj)
! if (Has_contents(obj))
value += contained_gold(obj);
+ /* unknown gold stuck inside statues may cause some consternation... */
return(value);
}
*** /tmp/da11474 Tue Jun 1 16:16:24 1993
--- src/version.c Mon Apr 19 16:59:52 1993
***************
*** 5,11 ****
#include "hack.h"
#include "date.h"
#ifndef BETA
! # if defined(MICRO) && !defined(AMIGA) && !defined(TOS) && !defined(OS2_HPFS)
# include "patchlev.h"
# else
# include "patchlevel.h"
--- 5,11 ----
#include "hack.h"
#include "date.h"
#ifndef BETA
! # ifdef SHORT_FILENAMES
# include "patchlev.h"
# else
# include "patchlevel.h"
***************
*** 16,28 ****
doversion()
{
#ifdef BETA
! pline("%s NetHack Beta Version %s - last build %s.",
#else
! pline("%s NetHack Version %s.%d - last build %s.",
#endif
! PORT_ID, VERSION,
! #ifndef BETA
! PATCHLEVEL,
#endif
BUILD_DATE); /* from date.h, generated by 'makedefs' */
return 0;
--- 16,28 ----
doversion()
{
#ifdef BETA
! pline("%s NetHack Beta Version %d.%d.%d-%d - last build %s.",
#else
! pline("%s NetHack Version %d.%d.%d - last build %s.",
#endif
! PORT_ID, VERSION_MAJOR, VERSION_MINOR, PATCHLEVEL,
! #ifdef BETA
! EDITLEVEL,
#endif
BUILD_DATE); /* from date.h, generated by 'makedefs' */
return 0;
*** /tmp/da11482 Tue Jun 1 16:16:27 1993
--- src/vision.c Mon Mar 29 14:33:20 1993
***************
*** 1,4 ****
! /* SCCS Id: @(#)vision.c 3.1 92/11/14 */
/* Copyright (c) Dean Luick, with acknowledgements to Dave Cohrs, 1990. */
/* NetHack may be freely redistributed. See license for details. */
#include "hack.h"
--- 1,4 ----
! /* SCCS Id: @(#)vision.c 3.1 93/03/28 */
/* Copyright (c) Dean Luick, with acknowledgements to Dave Cohrs, 1990. */
/* NetHack may be freely redistributed. See license for details. */
#include "hack.h"
***************
*** 300,306 ****
char *rmin, *rmax;
{
int rnum = levl[u.ux][u.uy].roomno - ROOMOFFSET; /* no SHARED... */
! int start, stop, in_door;
register int zx, zy;
/* If in a lit room, we are able to see to its boundaries. */
--- 300,306 ----
char *rmin, *rmax;
{
int rnum = levl[u.ux][u.uy].roomno - ROOMOFFSET; /* no SHARED... */
! int start, stop, in_door, xhi, xlo, yhi, ylo;
register int zx, zy;
/* If in a lit room, we are able to see to its boundaries. */
***************
*** 323,333 ****
in_door = levl[u.ux][u.uy].typ == DOOR;
/* Can always see adjacent. */
! for (zy = u.uy-1; zy <= u.uy+1; zy++) {
! rmin[zy] = min(rmin[zy],u.ux-1);
! rmax[zy] = max(rmax[zy],u.ux+1);
! for (zx = u.ux-1; zx <= u.ux+1; zx++) {
next[zy][zx] = COULD_SEE | IN_SIGHT;
/*
* Yuck, update adjacent non-diagonal positions when in a doorway.
--- 323,337 ----
in_door = levl[u.ux][u.uy].typ == DOOR;
/* Can always see adjacent. */
! ylo = max(u.uy - 1, 0);
! yhi = min(u.uy + 1, ROWNO - 1);
! xlo = max(u.ux - 1, 1);
! xhi = min(u.ux + 1, COLNO - 1);
! for (zy = ylo; zy <= yhi; zy++) {
! if (xlo < rmin[zy]) rmin[zy] = xlo;
! if (xhi > rmax[zy]) rmax[zy] = xhi;
! for (zx = xlo; zx <= xhi; zx++) {
next[zy][zx] = COULD_SEE | IN_SIGHT;
/*
* Yuck, update adjacent non-diagonal positions when in a doorway.
*** /tmp/da11490 Tue Jun 1 16:16:31 1993
--- src/weapon.c Wed Mar 3 14:34:34 1993
***************
*** 462,488 ****
mon->weapon_check = NEED_WEAPON;
return 0;
}
-
- /* rearrange a monster's inventory so that wielded weapon is first */
- void
- sort_mwep(mon)
- struct monst *mon;
- {
- struct obj *otmp, *prev, *mw_tmp = MON_WEP(mon);
-
- if (!mw_tmp) return;
- for (otmp = mon->minvent, prev = 0; otmp; otmp = otmp->nobj) {
- if (otmp == mw_tmp) break;
- prev = otmp;
- }
- if (!otmp) {
- MON_NOWEP(mon);
- } else if (prev) {
- prev->nobj = otmp->nobj;
- otmp->nobj = mon->minvent;
- mon->minvent = otmp;
- }
- }
#endif
int
--- 462,467 ----
*** /tmp/da11514 Tue Jun 1 16:16:36 1993
--- src/windows.c Tue Apr 13 17:37:55 1993
***************
*** 17,22 ****
--- 17,25 ----
#endif
#ifdef AMIGA_INTUITION
extern struct window_procs amii_procs ;
+ extern struct window_procs amiv_procs ;
+ extern void NDECL( amii_loadlib );
+ extern void NDECL( amiv_loadlib );
#endif
NEARDATA struct window_procs windowprocs;
***************
*** 36,42 ****
{ & mac_procs , NULL } ,
#endif
#ifdef AMIGA_INTUITION
! { & amii_procs , NULL } ,
#endif
{ 0, 0 } /* must be last */
};
--- 39,51 ----
{ & mac_procs , NULL } ,
#endif
#ifdef AMIGA_INTUITION
! /* A shared library is used for implementing the access to these two
! * different display mechanisms. This means that the function names
! * are actually the same (assembler stubs) and the libraries do different
! * things.
! */
! { & amii_procs , amii_loadlib } ,
! { & amiv_procs , amiv_loadlib } ,
#endif
{ 0, 0 } /* must be last */
};
*** /tmp/da11522 Tue Jun 1 16:16:38 1993
--- src/wizard.c Fri May 28 11:32:12 1993
***************
*** 1,4 ****
! /* SCCS Id: @(#)wizard.c 3.1 92/11/13 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
--- 1,4 ----
! /* SCCS Id: @(#)wizard.c 3.1 93/05/26 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
***************
*** 14,25 ****
#ifdef OVLB
! static short FDECL(which_arti, (UCHAR_P));
static boolean FDECL(mon_has_arti, (struct monst *,SHORT_P));
static struct monst *FDECL(other_mon_has_arti, (struct monst *,SHORT_P));
static struct obj *FDECL(on_ground, (SHORT_P));
! static boolean FDECL(you_have, (UCHAR_P));
! static long FDECL(target_on, (UCHAR_P,struct monst *));
static long FDECL(strategy, (struct monst *));
/* TODO: Expand this list. */
--- 14,25 ----
#ifdef OVLB
! static short FDECL(which_arti, (int));
static boolean FDECL(mon_has_arti, (struct monst *,SHORT_P));
static struct monst *FDECL(other_mon_has_arti, (struct monst *,SHORT_P));
static struct obj *FDECL(on_ground, (SHORT_P));
! static boolean FDECL(you_have, (int));
! static long FDECL(target_on, (int,struct monst *));
static long FDECL(strategy, (struct monst *));
/* TODO: Expand this list. */
***************
*** 135,141 ****
static short
which_arti(mask)
! register uchar mask;
{
switch(mask) {
case M3_WANTSAMUL: return(AMULET_OF_YENDOR);
--- 135,141 ----
static short
which_arti(mask)
! register int mask;
{
switch(mask) {
case M3_WANTSAMUL: return(AMULET_OF_YENDOR);
***************
*** 205,211 ****
static boolean
you_have(mask)
! register uchar mask;
{
switch(mask) {
case M3_WANTSAMUL: return(u.uhave.amulet);
--- 205,211 ----
static boolean
you_have(mask)
! register int mask;
{
switch(mask) {
case M3_WANTSAMUL: return(u.uhave.amulet);
***************
*** 222,228 ****
static long
target_on(mask, mtmp)
! register uchar mask;
register struct monst *mtmp;
{
register short otyp;
--- 222,228 ----
static long
target_on(mask, mtmp)
! register int mask;
register struct monst *mtmp;
{
register short otyp;
***************
*** 329,338 ****
default: /* kill, maim, pillage! */
{
! long where = (mtmp->mstrategy & 0xff000000);
xchar tx = (xchar)((mtmp->mstrategy >> 16) & 0xff),
ty = (xchar)((mtmp->mstrategy >> 8) & 0xff);
! uchar targ = (xchar)(mtmp->mstrategy & 0xff);
struct obj *otmp;
if(!targ) { /* simply wants you to close */
--- 329,338 ----
default: /* kill, maim, pillage! */
{
! long where = (mtmp->mstrategy & 0xff000000L);
xchar tx = (xchar)((mtmp->mstrategy >> 16) & 0xff),
ty = (xchar)((mtmp->mstrategy >> 8) & 0xff);
! int targ = (mtmp->mstrategy & 0xff);
struct obj *otmp;
if(!targ) { /* simply wants you to close */
***************
*** 388,394 ****
{
register struct monst *mtmp2;
! if(mtmp2 = makemon(&mons[PM_WIZARD_OF_YENDOR], u.ux, u.uy)) {
mtmp2->msleep = mtmp2->mtame = mtmp2->mpeaceful = 0;
if (!u.uhave.amulet && rn2(2)) { /* give clone a fake */
mtmp2->minvent = mksobj(FAKE_AMULET_OF_YENDOR, TRUE, FALSE);
--- 388,394 ----
{
register struct monst *mtmp2;
! if ((mtmp2 = makemon(&mons[PM_WIZARD_OF_YENDOR], u.ux, u.uy)) != 0) {
mtmp2->msleep = mtmp2->mtame = mtmp2->mpeaceful = 0;
if (!u.uhave.amulet && rn2(2)) { /* give clone a fake */
mtmp2->minvent = mksobj(FAKE_AMULET_OF_YENDOR, TRUE, FALSE);
***************
*** 435,441 ****
{
register struct monst *mtmp;
! if(mtmp = makemon(&mons[PM_WIZARD_OF_YENDOR], u.ux, u.uy)) {
mtmp->msleep = mtmp->mtame = mtmp->mpeaceful = 0;
set_malign(mtmp);
pline("A voice booms out...");
--- 435,441 ----
{
register struct monst *mtmp;
! if ((mtmp = makemon(&mons[PM_WIZARD_OF_YENDOR], u.ux, u.uy)) != 0) {
mtmp->msleep = mtmp->mtame = mtmp->mpeaceful = 0;
set_malign(mtmp);
pline("A voice booms out...");
*** /tmp/da11538 Tue Jun 1 16:16:43 1993
--- src/worn.c Sat Mar 13 16:33:03 1993
***************
*** 131,138 ****
# ifdef TOURIST
else if (obj->otyp == HAWAIIAN_SHIRT) flag = W_ARMU;
# endif
! else if (is_cloak(obj)) flag = W_ARMC;
! else if (is_helmet(obj)) flag = W_ARMH;
else if (is_shield(obj)) {
if (MON_WEP(mon) && bimanual(MON_WEP(mon)))
continue;
--- 131,141 ----
# ifdef TOURIST
else if (obj->otyp == HAWAIIAN_SHIRT) flag = W_ARMU;
# endif
! else if (is_cloak(obj)) {
! if (cantweararm(mon->data))
! continue;
! flag = W_ARMC;
! } else if (is_helmet(obj)) flag = W_ARMH;
else if (is_shield(obj)) {
if (MON_WEP(mon) && bimanual(MON_WEP(mon)))
continue;
***************
*** 140,152 ****
} else if (is_gloves(obj)) {
if (MON_WEP(mon) && MON_WEP(mon)->cursed)
continue;
! flag = W_ARMG;
! } else if (is_boots(obj)) flag = W_ARMF;
! else if (obj->oclass == ARMOR_CLASS) {
! #ifdef POLYSELF
if (cantweararm(mon->data))
continue;
- #endif
flag = W_ARM;
} else continue;
if (mon->misc_worn_check & flag) continue;
--- 143,156 ----
} else if (is_gloves(obj)) {
if (MON_WEP(mon) && MON_WEP(mon)->cursed)
continue;
! flag = W_ARMG;
! } else if (is_boots(obj)) {
! if (slithy(mon->data) || mon->data->mlet == S_CENTAUR)
! continue;
! flag = W_ARMF;
! } else if (obj->oclass == ARMOR_CLASS) {
if (cantweararm(mon->data))
continue;
flag = W_ARM;
} else continue;
if (mon->misc_worn_check & flag) continue;
***************
*** 310,315 ****
--- 314,322 ----
otmp->owornmask &= ~W_ARMH;
rel_1_obj(mon, otmp);
}
+ }
+ if (nohands(mdat) || verysmall(mdat) || slithy(mdat) ||
+ mdat->mlet == S_CENTAUR) {
if (otmp = which_armor(mon, W_ARMF)) {
if (vis) {
if (is_whirly(mon->data))
*** /tmp/da11554 Tue Jun 1 16:16:47 1993
--- src/zap.c Fri May 28 16:20:14 1993
***************
*** 1,4 ****
! /* SCCS Id: @(#)zap.c 3.1 92/10/21 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
--- 1,4 ----
! /* SCCS Id: @(#)zap.c 3.1 93/05/17 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
***************
*** 19,25 ****
extern boolean m_using;
#endif
- static boolean FDECL(obj_resists, (struct obj *));
static boolean FDECL(obj_shudders, (struct obj *));
static void FDECL(polyuse, (struct obj*, int, int));
static void FDECL(do_osshock, (struct obj *));
--- 19,24 ----
***************
*** 49,55 ****
#define ZT_SPELL(x) (10+(x))
#define ZT_BREATH(x) (20+(x))
! const char *fl[]= {
"magic missile", /* Wands must be 0-9 */
"bolt of fire",
"bolt of cold",
--- 48,54 ----
#define ZT_SPELL(x) (10+(x))
#define ZT_BREATH(x) (20+(x))
! const char *flash_types[] = { /* also used in buzzmu(mcastu.c) */
"magic missile", /* Wands must be 0-9 */
"bolt of fire",
"bolt of cold",
***************
*** 93,104 ****
register struct obj *otmp;
{
register boolean wake = FALSE;
#ifdef MULDGN
boolean dbldam = (pl_character[0] == 'K') && u.uhave.questart;
#endif
register int dmg;
! switch(otmp->otyp) {
case WAN_STRIKING:
case SPE_FORCE_BOLT:
wake = TRUE;
--- 92,104 ----
register struct obj *otmp;
{
register boolean wake = FALSE;
+ register int otyp = otmp->otyp;
#ifdef MULDGN
boolean dbldam = (pl_character[0] == 'K') && u.uhave.questart;
#endif
register int dmg;
! switch(otyp) {
case WAN_STRIKING:
case SPE_FORCE_BOLT:
wake = TRUE;
***************
*** 107,118 ****
#ifdef MULDGN
if(dbldam) dmg *= 2;
#endif
! hit((otmp->otyp == WAN_STRIKING) ? "wand" :
! "spell", mtmp, exclam(dmg));
(void) resist(mtmp, otmp->oclass, dmg, TELL);
! } else miss((otmp->otyp == WAN_STRIKING) ? "wand" :
! "spell", mtmp);
! makeknown(otmp->otyp);
break;
case WAN_SLOW_MONSTER:
case SPE_SLOW_MONSTER:
--- 107,117 ----
#ifdef MULDGN
if(dbldam) dmg *= 2;
#endif
! hit((otyp == WAN_STRIKING) ? "wand" : "spell",
! mtmp, exclam(dmg));
(void) resist(mtmp, otmp->oclass, dmg, TELL);
! } else miss((otyp == WAN_STRIKING) ? "wand" : "spell", mtmp);
! makeknown(otyp);
break;
case WAN_SLOW_MONSTER:
case SPE_SLOW_MONSTER:
***************
*** 153,159 ****
if (!rn2(25)) {
if (canseemon(mtmp)) {
pline("%s shudders!", Monnam(mtmp));
! makeknown(otmp->otyp);
}
/* no corpse after system shock */
xkilled(mtmp, 3);
--- 152,158 ----
if (!rn2(25)) {
if (canseemon(mtmp)) {
pline("%s shudders!", Monnam(mtmp));
! makeknown(otyp);
}
/* no corpse after system shock */
xkilled(mtmp, 3);
***************
*** 160,166 ****
}
else if (newcham(mtmp, (struct permonst *)0) )
if (!Hallucination && (!Blind || sensemon(mtmp)))
! makeknown(otmp->otyp);
}
break;
case WAN_CANCELLATION:
--- 159,165 ----
}
else if (newcham(mtmp, (struct permonst *)0) )
if (!Hallucination && (!Blind || sensemon(mtmp)))
! makeknown(otyp);
}
break;
case WAN_CANCELLATION:
***************
*** 188,194 ****
case WAN_NOTHING:
break;
case WAN_PROBING:
! makeknown(otmp->otyp);
mstatusline(mtmp);
break;
case WAN_OPENING:
--- 187,193 ----
case WAN_NOTHING:
break;
case WAN_PROBING:
! makeknown(otyp);
mstatusline(mtmp);
break;
case WAN_OPENING:
***************
*** 198,211 ****
else pline("%s opens its mouth!", Monnam(mtmp));
}
expels(mtmp, mtmp->data, TRUE);
break;
}
case WAN_LOCKING:
case SPE_KNOCK:
case SPE_WIZARD_LOCK:
break;
default:
! impossible("What an interesting effect (%u)", otmp->otyp);
}
if(wake) {
if(mtmp->mhp > 0) {
--- 197,223 ----
else pline("%s opens its mouth!", Monnam(mtmp));
}
expels(mtmp, mtmp->data, TRUE);
+ }
break;
+ case SPE_HEALING:
+ case SPE_EXTRA_HEALING:
+ mtmp->mhp += (otyp == SPE_HEALING) ? rnd(8) : d(2,8)+2;
+ if (mtmp->mhp > mtmp->mhpmax)
+ mtmp->mhp = mtmp->mhpmax;
+ if (canseemon(mtmp))
+ pline(otyp == SPE_HEALING ? "%s begins to look better." :
+ "%s looks much better.", Monnam(mtmp));
+ if (mtmp->mtame || mtmp->mpeaceful) {
+ adjalign((pl_character[0] == 'H') ? 1 :
+ sgn(u.ualign.type));
}
+ break;
case WAN_LOCKING:
case SPE_KNOCK:
case SPE_WIZARD_LOCK:
break;
default:
! impossible("What an interesting effect (%u)", otyp);
}
if(wake) {
if(mtmp->mhp > 0) {
***************
*** 399,407 ****
uncurse(obj);
}
! static boolean
! obj_resists(obj)
struct obj *obj;
{
if (obj->otyp == AMULET_OF_YENDOR ||
obj->otyp == SPE_BOOK_OF_THE_DEAD ||
--- 411,420 ----
uncurse(obj);
}
! boolean
! obj_resists(obj, ochance, achance)
struct obj *obj;
+ int ochance, achance; /* percent chance for ordinary objects, artifacts */
{
if (obj->otyp == AMULET_OF_YENDOR ||
obj->otyp == SPE_BOOK_OF_THE_DEAD ||
***************
*** 410,418 ****
(obj->otyp == CORPSE && is_rider(&mons[obj->corpsenm]))) {
return TRUE;
} else {
! int chance = rn2(20);
! /* artifacts resist 95% of the time; normal objects 5% */
! return (obj->oartifact ? !!chance : !chance);
}
}
--- 423,431 ----
(obj->otyp == CORPSE && is_rider(&mons[obj->corpsenm]))) {
return TRUE;
} else {
! int chance = rn2(100);
!
! return (chance < (obj->oartifact ? achance : ochance));
}
}
***************
*** 475,481 ****
{
struct permonst *mdat = (struct permonst *)0;
struct monst *mtmp;
! char *material;
int pm_index;
/* no golems if you zap only one object -- not enough stuff */
--- 488,494 ----
{
struct permonst *mdat = (struct permonst *)0;
struct monst *mtmp;
! const char *material;
int pm_index;
/* no golems if you zap only one object -- not enough stuff */
***************
*** 581,593 ****
register int res = 1;
struct obj *otmp2;
! if(obj == uball || obj == uchain)
res = 0;
! else
switch(otmp->otyp) {
case WAN_POLYMORPH:
case SPE_POLYMORPH:
! if (obj_resists(obj)) {
res = 0;
break;
} else if (obj_shudders(obj)) {
--- 594,613 ----
register int res = 1;
struct obj *otmp2;
! if (obj == uball) {
res = 0;
! } else if (obj == uchain) {
! if (otmp->otyp == WAN_OPENING || otmp->otyp == SPE_KNOCK) {
! unpunish();
! res = 1;
! makeknown(otmp->otyp);
! } else
! res = 0;
! } else
switch(otmp->otyp) {
case WAN_POLYMORPH:
case SPE_POLYMORPH:
! if (obj_resists(obj, 5, 95)) {
res = 0;
break;
} else if (obj_shudders(obj)) {
***************
*** 646,651 ****
--- 666,672 ----
otmp2->otyp = LOW_BOOTS;
otmp2->oclass = ARMOR_CLASS;
otmp2->spe = 0;
+ otmp2->oeroded = 0;
otmp2->oerodeproof = TRUE;
otmp2->quan = 1L;
otmp2->cursed = FALSE;
***************
*** 653,659 ****
}
/* no box contents --KAA */
! if (Is_container(otmp2) || otmp2->otyp == STATUE)
delete_contents(otmp2);
/* 'n' merged objects may be fused into 1 object */
--- 674,680 ----
}
/* no box contents --KAA */
! if (Has_contents(otmp2))
delete_contents(otmp2);
/* 'n' merged objects may be fused into 1 object */
***************
*** 676,682 ****
shop_keeper(*in_rooms(obj->ox, obj->oy, SHOPBASE));
if ((!obj->no_charge ||
! (Is_container(obj) &&
(contained_cost(obj, shkp, 0L, FALSE) != 0L)))
&& inhishop(shkp)) {
if(shkp->mpeaceful) {
--- 697,703 ----
shop_keeper(*in_rooms(obj->ox, obj->oy, SHOPBASE));
if ((!obj->no_charge ||
! (Has_contents(obj) &&
(contained_cost(obj, shkp, 0L, FALSE) != 0L)))
&& inhishop(shkp)) {
if(shkp->mpeaceful) {
***************
*** 699,711 ****
fracture_rock(obj);
else if (obj->otyp == STATUE)
(void) break_statue(obj);
! else
res = 0;
makeknown(otmp->otyp);
break;
case WAN_CANCELLATION:
case SPE_CANCELLATION:
cancel_item(obj);
break;
case WAN_TELEPORTATION:
case SPE_TELEPORT_AWAY:
--- 720,745 ----
fracture_rock(obj);
else if (obj->otyp == STATUE)
(void) break_statue(obj);
! else {
! (void)breaks(obj, FALSE);
res = 0;
+ }
makeknown(otmp->otyp);
break;
+ case WAN_DIGGING:
+ case SPE_DIG:
+ /* vaporize boulders */
+ if (obj->otyp == BOULDER) {
+ delobj(obj);
+ res = 0;
+ }
+ break;
case WAN_CANCELLATION:
case SPE_CANCELLATION:
cancel_item(obj);
+ #ifdef TEXTCOLOR
+ newsym(obj->ox,obj->oy); /* might change color */
+ #endif
break;
case WAN_TELEPORTATION:
case SPE_TELEPORT_AWAY:
***************
*** 721,734 ****
break;
case WAN_OPENING:
case SPE_KNOCK:
- /* Zap it at the chain, not the ball */
- if (obj == uchain) {
- unpunish();
- res = 1;
- makeknown(obj->otyp);
- break;
- }
- /* fall through */
case WAN_LOCKING:
case SPE_WIZARD_LOCK:
if(Is_box(obj))
--- 755,760 ----
***************
*** 735,742 ****
res = boxlock(obj, otmp);
else
res = 0;
! if (res /* && obj->oclass == WAND_CLASS */)
! makeknown(obj->otyp);
break;
case WAN_SLOW_MONSTER: /* no effect on objects */
case SPE_SLOW_MONSTER:
--- 761,768 ----
res = boxlock(obj, otmp);
else
res = 0;
! if (res /* && otmp->oclass == WAND_CLASS */)
! makeknown(otmp->otyp);
break;
case WAN_SLOW_MONSTER: /* no effect on objects */
case SPE_SLOW_MONSTER:
***************
*** 743,748 ****
--- 769,776 ----
case WAN_SPEED_MONSTER:
case WAN_NOTHING:
case WAN_PROBING:
+ case SPE_HEALING:
+ case SPE_EXTRA_HEALING:
res = 0;
break;
default:
***************
*** 990,996 ****
case SPE_CANCELLATION:
cancel_monst(&youmonst, obj, TRUE, FALSE, TRUE);
break;
! case WAN_MAKE_INVISIBLE: {
/* have to test before changing HInvis but must change
* HInvis before doing newsym().
*/
--- 1018,1024 ----
case SPE_CANCELLATION:
cancel_monst(&youmonst, obj, TRUE, FALSE, TRUE);
break;
! case WAN_MAKE_INVISIBLE: {
/* have to test before changing HInvis but must change
* HInvis before doing newsym().
*/
***************
*** 1006,1012 ****
}
break;
}
! case WAN_SPEED_MONSTER:
if (!(Fast & INTRINSIC)) {
You("seem to be moving faster.");
makeknown(WAN_SPEED_MONSTER);
--- 1034,1040 ----
}
break;
}
! case WAN_SPEED_MONSTER:
if (!(Fast & INTRINSIC)) {
You("seem to be moving faster.");
makeknown(WAN_SPEED_MONSTER);
***************
*** 1014,1020 ****
}
Fast |= FROMOUTSIDE;
break;
! case WAN_SLEEP:
makeknown(WAN_SLEEP);
case SPE_SLEEP:
if(Sleep_resistance) {
--- 1042,1048 ----
}
Fast |= FROMOUTSIDE;
break;
! case WAN_SLEEP:
makeknown(WAN_SLEEP);
case SPE_SLEEP:
if(Sleep_resistance) {
***************
*** 1067,1075 ****
}
#endif
break;
case SPE_DIG:
case SPE_DETECT_UNSEEN:
- case WAN_DIGGING:
case WAN_NOTHING:
case WAN_OPENING:
case WAN_LOCKING:
--- 1095,1110 ----
}
#endif
break;
+ case SPE_HEALING:
+ case SPE_EXTRA_HEALING:
+ healup(obj->otyp == SPE_HEALING ? rnd(8) : d(2,8)+2,
+ 0, FALSE, FALSE);
+ You(obj->otyp == SPE_HEALING ? "begin to feel better." :
+ "feel a fair bit better.");
+ break;
+ case WAN_DIGGING:
case SPE_DIG:
case SPE_DETECT_UNSEEN:
case WAN_NOTHING:
case WAN_OPENING:
case WAN_LOCKING:
***************
*** 1712,1721 ****
return(cnt);
}
! /* type == 0 to 9 : you shooting a wand */
! /* type == 10 to 19 : you casting a spell */
! /* type == 20 to 29 : you breathing as a monster */
! /* type == -10 to -19 : monster casting spell */
/* type == -20 to -29 : monster breathing at you */
/* type == -30 to -39 : monster shooting a wand (MUSE only) */
/* called with dx = dy = 0 with vertical bolts */
--- 1747,1756 ----
return(cnt);
}
! /* type == 0 to 9 : you shooting a wand */
! /* type == 10 to 19 : you casting a spell */
! /* type == 20 to 29 : you breathing as a monster */
! /* type == -10 to -19 : monster casting spell */
/* type == -20 to -29 : monster breathing at you */
/* type == -30 to -39 : monster shooting a wand (MUSE only) */
/* called with dx = dy = 0 with vertical bolts */
***************
*** 1730,1739 ****
register xchar lsx, lsy;
struct monst *mon;
boolean bodyhit = FALSE, shopdamage = FALSE;
#ifdef MUSE
! register const char *fltxt = fl[(type <= -30) ? abstype : abs(type)];
#else
! register const char *fltxt = fl[abs(type)];
#endif
if(u.uswallow) {
register int tmp;
--- 1765,1776 ----
register xchar lsx, lsy;
struct monst *mon;
boolean bodyhit = FALSE, shopdamage = FALSE;
+ register const char *fltxt;
+
#ifdef MUSE
! fltxt = flash_types[(type <= -30) ? abstype : abs(type)];
#else
! fltxt = flash_types[abs(type)];
#endif
if(u.uswallow) {
register int tmp;
***************
*** 1774,1804 ****
if (type >= 0) mon->data->mflags3 &= ~M3_WAITMASK;
if (rnd(20) < 18 + find_mac(mon)) {
#ifdef MUSE
! struct obj *orefl = which_armor(mon, W_ARMS);
!
! if (orefl && orefl->otyp == SHIELD_OF_REFLECTION) {
if(cansee(mon->mx,mon->my)) {
hit(fltxt, mon, exclam(0));
! pline("But it reflects from %s shield!",
! s_suffix(mon_nam(mon)));
! makeknown(SHIELD_OF_REFLECTION);
! shieldeff(sx, sy);
}
-
dx = -dx;
dy = -dy;
- } else if ((orefl = which_armor(mon, W_AMUL)) &&
- orefl->otyp == AMULET_OF_REFLECTION) {
- if(cansee(mon->mx,mon->my)) {
- hit(fltxt, mon, exclam(0));
- pline("But it reflects from %s amulet!",
- s_suffix(mon_nam(mon)));
- makeknown(AMULET_OF_REFLECTION);
- shieldeff(sx, sy);
- }
-
- dx = -dx;
- dy = -dy;
} else
#endif
{
--- 1811,1824 ----
if (type >= 0) mon->data->mflags3 &= ~M3_WAITMASK;
if (rnd(20) < 18 + find_mac(mon)) {
#ifdef MUSE
! if (mon_reflects(mon, "")) {
if(cansee(mon->mx,mon->my)) {
hit(fltxt, mon, exclam(0));
! shieldeff(mon->mx, mon->my);
! (void) mon_reflects(mon, "But it reflects from %s %s!");
}
dx = -dx;
dy = -dy;
} else
#endif
{
***************
*** 1820,1827 ****
mon->mhp = mon->mhpmax;
break; /* Out of while loop */
}
! if(mon->data == &mons[PM_DEATH] &&
! abs(type)%10 == ZT_DEATH) {
if(cansee(mon->mx,mon->my)) {
hit(fltxt, mon, exclam(tmp));
pline("Death absorbs the deadly %s!",
--- 1840,1846 ----
mon->mhp = mon->mhpmax;
break; /* Out of while loop */
}
! if(mon->data == &mons[PM_DEATH] && abstype == ZT_DEATH) {
if(cansee(mon->mx,mon->my)) {
hit(fltxt, mon, exclam(tmp));
pline("Death absorbs the deadly %s!",
***************
*** 1983,1990 ****
else if(Antimagic) {
shieldeff(sx, sy);
You("aren't affected.");
! } else
! u.uhp = -1;
break;
case ZT_LIGHTNING:
if (Shock_resistance) {
--- 2002,2010 ----
else if(Antimagic) {
shieldeff(sx, sy);
You("aren't affected.");
! break;
! }
! u.uhp = -1;
break;
case ZT_LIGHTNING:
if (Shock_resistance) {
***************
*** 2078,2083 ****
--- 2098,2127 ----
abstype == ZT_DEATH ? "disintegrate" : "destroy");
}
+ void
+ melt_ice(x, y)
+ xchar x, y;
+ {
+ struct rm *lev = &levl[x][y];
+
+ if (lev->typ == DRAWBRIDGE_UP)
+ lev->drawbridgemask &= ~DB_ICE; /* revert to DB_MOAT */
+ else { /* lev->typ == ICE */
+ #ifdef STUPID
+ if (lev->icedpool == ICED_POOL) lev->typ = POOL;
+ else lev->typ = MOAT;
+ #else
+ lev->typ = (lev->icedpool == ICED_POOL ? POOL : MOAT);
+ #endif
+ lev->icedpool = 0;
+ }
+ unearth_objs(x, y);
+ newsym(x,y);
+ if (cansee(x,y)) Norep("The ice crackles and melts.");
+ if (x == u.ux && y == u.uy)
+ spoteffects(); /* possibly drown, notice objects */
+ }
+
/* Burn floor scrolls, evaporate pools, etc... in a single square. Used
* both for normal bolts of fire, cold, etc... and for fireballs.
* Sets shopdamage to TRUE if a shop door is destroyed, and returns the
***************
*** 2096,2116 ****
if(abstype == ZT_FIRE) {
if(is_ice(x, y)) {
! if (lev->typ == DRAWBRIDGE_UP)
! lev->drawbridgemask &= ~DB_ICE; /* revert to DB_MOAT */
! else { /* lev->typ == ICE */
! #ifdef STUPID
! if (lev->icedpool == ICED_POOL) lev->typ = POOL;
! else lev->typ = MOAT;
! #else
! lev->typ = (lev->icedpool == ICED_POOL ? POOL : MOAT);
! #endif
! lev->icedpool = 0;
! }
! newsym(x,y);
! Norep("The ice crackles and melts.");
! if (x == u.ux && y == u.uy)
! spoteffects(); /* possibly drown */
} else if(is_pool(x,y)) {
const char *msgtxt = "You hear hissing gas.";
if(lev->typ != POOL) { /* MOAT or DRAWBRIDGE_UP */
--- 2140,2146 ----
if(abstype == ZT_FIRE) {
if(is_ice(x, y)) {
! melt_ice(x, y);
} else if(is_pool(x,y)) {
const char *msgtxt = "You hear hissing gas.";
if(lev->typ != POOL) { /* MOAT or DRAWBRIDGE_UP */
***************
*** 2121,2127 ****
rangemod -= 3;
lev->typ = ROOM;
ttmp = maketrap(x, y, PIT);
! ttmp->tseen = 1;
if (cansee(x,y)) msgtxt = "The water evaporates.";
}
Norep(msgtxt);
--- 2151,2157 ----
rangemod -= 3;
lev->typ = ROOM;
ttmp = maketrap(x, y, PIT);
! if (ttmp) ttmp->tseen = 1;
if (cansee(x,y)) msgtxt = "The water evaporates.";
}
Norep(msgtxt);
***************
*** 2152,2165 ****
(lev->typ == POOL ? ICED_POOL : ICED_MOAT);
lev->typ = (lava ? ROOM : ICE);
}
! /*
! * Not perfect: There could be stuff on the bottom. If
! * we leave it here, it'll pop to the surface which is
! * strange, so just destroy all the objects at this location.
! * A better solution requires major changes (as usual).
! */
! if(OBJ_AT(x,y))
! delallobj(x,y);
if(cansee(x,y)) {
if(moat)
Norep("The moat is bridged with ice!");
--- 2182,2188 ----
(lev->typ == POOL ? ICED_POOL : ICED_MOAT);
lev->typ = (lava ? ROOM : ICE);
}
! bury_objs(x,y);
if(cansee(x,y)) {
if(moat)
Norep("The moat is bridged with ice!");
***************
*** 2295,2313 ****
} while(!goodpos(tx,ty,(struct monst *)0, (struct permonst *)0));
freeobj(obj);
if (flooreffects(obj, tx, ty, "fall"))
! return;
! if(costly_spot(otx, oty) && (!costly_spot(tx, ty) ||
! !index(in_rooms(tx, ty, 0),
! *in_rooms(otx, oty, 0)))) {
if(costly_spot(u.ux, u.uy) &&
index(u.urooms, *in_rooms(otx, oty, 0)))
addtobill(obj, FALSE, FALSE, FALSE);
else (void)stolen_value(obj, otx, oty, FALSE, FALSE);
}
obj->nobj = fobj;
fobj = obj;
place_object(obj, tx, ty);
- newsym(otx, oty);
newsym(tx,ty);
}
--- 2318,2340 ----
} while(!goodpos(tx,ty,(struct monst *)0, (struct permonst *)0));
freeobj(obj);
if (flooreffects(obj, tx, ty, "fall"))
! return;
! if (otx == 0 && oty == 0) {
! ; /* fell through a trapdoor; no update of old loc needed */
! } else {
! if (costly_spot(otx, oty)
! && (!costly_spot(tx, ty) ||
! !index(in_rooms(tx, ty, 0), *in_rooms(otx, oty, 0)))) {
if(costly_spot(u.ux, u.uy) &&
index(u.urooms, *in_rooms(otx, oty, 0)))
addtobill(obj, FALSE, FALSE, FALSE);
else (void)stolen_value(obj, otx, oty, FALSE, FALSE);
+ }
+ newsym(otx, oty); /* update old location */
}
obj->nobj = fobj;
fobj = obj;
place_object(obj, tx, ty);
newsym(tx,ty);
}