mirror of
https://codeberg.org/noisytoot/notnotdnethack.git
synced 2025-07-28 16:32:27 +01:00
Continue Neutral Quest improvements
Add shallow puddles -Add arg to is_pool to account for it --Stolen from L's terrain patch Also makes the woods lit in the appropriate neutral levels, and makes the neutral rivers use shallow water Finish rooms in plu village Sum of all spawns neutral outsiders, not golems Fix solid fog effect -It wasn't finding monsters inside it right Make the neutral quest portals visible
This commit is contained in:
parent
837ee58f1e
commit
fb7e9d5623
50 changed files with 683 additions and 215 deletions
include
src
allmain.capply.cball.ccmd.cdbridge.cdig.cdisplay.cdo.cdo_wear.cdog.cdogmove.cdokick.cdrawing.ceat.cengrave.cexplode.cfountain.chack.cinvent.clock.cmakemon.cmhitu.cmklev.cmkmaze.cmkroom.cmon.cmuse.cobjnam.cpager.cpickup.cpolyself.cpotion.cquestpgr.cread.cregion.csit.csounds.csp_lev.csteed.cteleport.ctimeout.ctrap.cuhitm.cvision.cweapon.cwere.czap.c
|
@ -214,7 +214,7 @@
|
|||
* "cover" any objects or traps that might be there.
|
||||
*/
|
||||
#define covers_objects(xx,yy) \
|
||||
((is_pool(xx,yy) && !Underwater && !Is_waterlevel(&u.uz)) || (levl[xx][yy].typ == LAVAPOOL))
|
||||
((is_pool(xx,yy, FALSE) && !Underwater && !Is_waterlevel(&u.uz)) || (levl[xx][yy].typ == LAVAPOOL))
|
||||
|
||||
#define covers_traps(xx,yy) covers_objects(xx,yy)
|
||||
|
||||
|
|
|
@ -239,7 +239,7 @@ E int NDECL(dotravel);
|
|||
|
||||
/* ### dbridge.c ### */
|
||||
|
||||
E boolean FDECL(is_pool, (int,int));
|
||||
E boolean FDECL(is_pool, (int,int, BOOLEAN_P));
|
||||
E boolean FDECL(is_3dwater, (int,int));
|
||||
E boolean FDECL(is_lava, (int,int));
|
||||
E boolean FDECL(is_ice, (int,int));
|
||||
|
@ -2052,6 +2052,7 @@ E void FDECL(split_rects, (NhRect *,NhRect *));
|
|||
E void NDECL(clear_regions);
|
||||
E void NDECL(run_regions);
|
||||
E boolean FDECL(In_fog_cloud, (struct monst *));
|
||||
E boolean FDECL(check_solid_fog_region, (XCHAR_P,XCHAR_P));
|
||||
E boolean FDECL(check_stinking_cloud_region, (XCHAR_P,XCHAR_P));
|
||||
E boolean FDECL(in_out_region, (XCHAR_P,XCHAR_P));
|
||||
E boolean FDECL(m_in_out_region, (struct monst *,XCHAR_P,XCHAR_P));
|
||||
|
|
|
@ -69,6 +69,7 @@ enum {
|
|||
AIR,
|
||||
CLOUD,
|
||||
FOG,
|
||||
PUDDLE,
|
||||
MAX_TYPE
|
||||
};
|
||||
#define INVALID_TYPE 127
|
||||
|
@ -102,6 +103,8 @@ enum {
|
|||
#define IS_FURNITURE(typ) ((typ) >= STAIRS && (typ) <= ALTAR)
|
||||
#define IS_AIR(typ) ((typ) == AIR || (typ) == CLOUD)
|
||||
#define IS_SOFT(typ) ((typ) == AIR || (typ) == CLOUD || IS_POOL(typ))
|
||||
#define IS_PUDDLE(typ) ((typ) == PUDDLE)
|
||||
#define IS_PUDDLE_OR_POOL(typ) (IS_PUDDLE(typ) || IS_POOL(typ))
|
||||
|
||||
/*
|
||||
* The screen symbols may be the default or defined at game startup time.
|
||||
|
@ -156,6 +159,7 @@ enum {
|
|||
S_air,
|
||||
S_cloud,
|
||||
S_fog,
|
||||
S_puddle,
|
||||
S_water,
|
||||
|
||||
/* end dungeon characters, begin traps */
|
||||
|
@ -348,6 +352,7 @@ extern uchar showsymcolors[MAXPCHARS];
|
|||
/*
|
||||
* Room areas may be iced pools
|
||||
*/
|
||||
#define ICED_PUDDLE 4
|
||||
#define ICED_POOL 8
|
||||
#define ICED_MOAT 16
|
||||
|
||||
|
|
|
@ -467,7 +467,7 @@ moveloop()
|
|||
echo_location(i, j);
|
||||
}
|
||||
/*If anything a monster did caused us to get moved out of water, surface*/
|
||||
if(u.usubwater && !is_pool(u.ux, u.uy)){
|
||||
if(u.usubwater && !is_pool(u.ux, u.uy, FALSE)){
|
||||
u.usubwater = 0;
|
||||
vision_full_recalc = 1;
|
||||
vision_recalc(2); /* unsee old position */
|
||||
|
@ -825,7 +825,7 @@ moveloop()
|
|||
if(!Upolyd && Race_if(PM_HALF_DRAGON)) moveamt = (moveamt*2)/3;
|
||||
if(uarmf && uarmf->otyp == STILETTOS && !Flying && !Levitation) moveamt = (moveamt*5)/6;
|
||||
|
||||
if(u.sealsActive&SEAL_EURYNOME && IS_POOL(levl[u.ux][u.uy].typ)){
|
||||
if(u.sealsActive&SEAL_EURYNOME && IS_PUDDLE_OR_POOL(levl[u.ux][u.uy].typ)){
|
||||
if (Very_fast) { /* speed boots or potion */
|
||||
/* average movement is 1.78 times normal */
|
||||
moveamt += 2*NORMAL_SPEED / 3;
|
||||
|
@ -1146,7 +1146,7 @@ moveloop()
|
|||
/* for the moment at least, you're in tiptop shape */
|
||||
wtcap = UNENCUMBERED;
|
||||
} else {
|
||||
if (youracedata->mlet == S_EEL && !is_pool(u.ux,u.uy) && !Is_waterlevel(&u.uz)) {
|
||||
if (youracedata->mlet == S_EEL && !is_pool(u.ux,u.uy, FALSE) && !Is_waterlevel(&u.uz)) {
|
||||
if (u.mh > 1) {
|
||||
u.mh--;
|
||||
flags.botl = 1;
|
||||
|
|
15
src/apply.c
15
src/apply.c
|
@ -1120,7 +1120,8 @@ boolean spiritseal;
|
|||
} else {
|
||||
/* charged Bell of Opening */
|
||||
consume_obj_charge(obj, TRUE);
|
||||
|
||||
|
||||
|
||||
if (u.uswallow) {
|
||||
if (!obj->cursed)
|
||||
(void) openit();
|
||||
|
@ -2151,7 +2152,7 @@ long timeout;
|
|||
Sprintf(carriedby, "%s pack",
|
||||
s_suffix(a_monnam(mon)));
|
||||
}
|
||||
else if (is_pool(mon->mx, mon->my))
|
||||
else if (is_pool(mon->mx, mon->my, FALSE))
|
||||
Strcpy(carriedby, "empty water");
|
||||
else
|
||||
Strcpy(carriedby, "thin air");
|
||||
|
@ -2235,7 +2236,7 @@ struct obj **optr;
|
|||
You("%s and it transforms.",
|
||||
(u.dx||u.dy) ? "set the figurine beside you" :
|
||||
(Weightless || Is_waterlevel(&u.uz) ||
|
||||
is_pool(cc.x, cc.y)) ?
|
||||
is_pool(cc.x, cc.y, TRUE)) ?
|
||||
"release the figurine" :
|
||||
(u.dz < 0 ?
|
||||
"toss the figurine into the air" :
|
||||
|
@ -2966,7 +2967,7 @@ struct obj *otmp;
|
|||
what = "underwater";
|
||||
else if (Levitation)
|
||||
what = "while levitating";
|
||||
else if (is_pool(u.ux, u.uy))
|
||||
else if (is_pool(u.ux, u.uy, TRUE))
|
||||
what = "in water";
|
||||
else if (is_lava(u.ux, u.uy))
|
||||
what = "in lava";
|
||||
|
@ -3110,7 +3111,7 @@ struct obj **optr;
|
|||
what = "underwater";
|
||||
else if (Levitation)
|
||||
what = "while levitating";
|
||||
else if (is_pool(rx, ry))
|
||||
else if (is_pool(rx, ry, TRUE))
|
||||
what = "in water";
|
||||
else if (is_lava(rx, ry))
|
||||
what = "in lava";
|
||||
|
@ -3662,7 +3663,7 @@ use_grapple (obj)
|
|||
}
|
||||
/* FALL THROUGH */
|
||||
case 3: /* Surface */
|
||||
if (IS_AIR(levl[cc.x][cc.y].typ) || is_pool(cc.x, cc.y))
|
||||
if (IS_AIR(levl[cc.x][cc.y].typ) || is_pool(cc.x, cc.y, TRUE))
|
||||
pline_The("hook slices through the %s.", surface(cc.x, cc.y));
|
||||
else {
|
||||
You("are yanked toward the %s!", surface(cc.x, cc.y));
|
||||
|
@ -4459,7 +4460,7 @@ struct obj **optr;
|
|||
You("build a clockwork and %s.",
|
||||
(u.dx||u.dy) ? "set it beside you" :
|
||||
(Weightless || Is_waterlevel(&u.uz) ||
|
||||
is_pool(cc.x, cc.y)) ?
|
||||
is_pool(cc.x, cc.y, TRUE)) ?
|
||||
"release it" :
|
||||
(u.dz < 0 ?
|
||||
"toss it into the air" :
|
||||
|
|
|
@ -561,10 +561,10 @@ drag:
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
if ((is_pool(uchain->ox, uchain->oy) &&
|
||||
if ((is_pool(uchain->ox, uchain->oy, FALSE) &&
|
||||
/* water not mere continuation of previous water */
|
||||
(levl[uchain->ox][uchain->oy].typ == POOL ||
|
||||
!is_pool(uball->ox, uball->oy) ||
|
||||
!is_pool(uball->ox, uball->oy, FALSE) ||
|
||||
levl[uball->ox][uball->oy].typ == POOL))
|
||||
|| ((t = t_at(uchain->ox, uchain->oy)) &&
|
||||
(t->ttyp == PIT ||
|
||||
|
@ -708,7 +708,7 @@ xchar x, y;
|
|||
u.ux0 = u.ux;
|
||||
u.uy0 = u.uy;
|
||||
if (!Levitation && !MON_AT(x, y) && !u.utrap &&
|
||||
(is_pool(x, y) ||
|
||||
(is_pool(x, y, FALSE) ||
|
||||
((t = t_at(x, y)) &&
|
||||
(t->ttyp == PIT || t->ttyp == SPIKED_PIT ||
|
||||
t->ttyp == TRAPDOOR || t->ttyp == HOLE)))) {
|
||||
|
|
|
@ -756,7 +756,7 @@ domonability()
|
|||
(IS_DOOR(levl[u.ux][u.uy].typ) && artifact_door(u.ux, u.uy)) ||
|
||||
(IS_ROCK(lev->typ) && lev->typ != SDOOR &&
|
||||
(lev->wall_info & W_NONDIGGABLE) != 0) ||
|
||||
(is_pool(u.ux, u.uy) || is_lava(u.ux, u.uy)) ||
|
||||
(is_pool(u.ux, u.uy, TRUE) || is_lava(u.ux, u.uy)) ||
|
||||
(lev->typ == DRAWBRIDGE_DOWN ||
|
||||
(is_drawbridge_wall(u.ux, u.uy) >= 0)) ||
|
||||
(boulder_at(u.ux, u.uy)) ||
|
||||
|
|
|
@ -34,14 +34,16 @@ STATIC_DCL void FDECL(do_entity, (struct entity *));
|
|||
#ifdef OVL0
|
||||
|
||||
boolean
|
||||
is_pool(x,y)
|
||||
is_pool(x,y, including_puddles)
|
||||
int x,y;
|
||||
BOOLEAN_P including_puddles;
|
||||
{
|
||||
schar ltyp;
|
||||
|
||||
if (!isok(x,y)) return FALSE;
|
||||
ltyp = levl[x][y].typ;
|
||||
if (ltyp == POOL || ltyp == MOAT || ltyp == WATER) return TRUE;
|
||||
if(including_puddles && ltyp == PUDDLE) return TRUE;
|
||||
if (ltyp == DRAWBRIDGE_UP &&
|
||||
(levl[x][y].drawbridgemask & DB_UNDER) == DB_MOAT) return TRUE;
|
||||
return FALSE;
|
||||
|
@ -377,7 +379,7 @@ int x, y;
|
|||
if(is_3dwater(x, y))
|
||||
return (boolean) ((is_u(etmp) && Amphibious)
|
||||
|| is_swimmer(etmp->edata));
|
||||
if (is_pool(x, y))
|
||||
if (is_pool(x, y, FALSE))
|
||||
return (boolean)((is_u(etmp) &&
|
||||
(Wwalking || Amphibious || Swimming ||
|
||||
Flying || Levitation)) ||
|
||||
|
@ -492,7 +494,7 @@ boolean chunks;
|
|||
else if (is_floater(etmp->edata) ||
|
||||
(is_u(etmp) && Levitation)) /* doesn't require mobility */
|
||||
misses = 3;
|
||||
else if (chunks && is_pool(etmp->ex, etmp->ey))
|
||||
else if (chunks && is_pool(etmp->ex, etmp->ey, FALSE))
|
||||
misses = 2; /* sitting ducks */
|
||||
else
|
||||
misses = 0;
|
||||
|
@ -722,7 +724,7 @@ struct entity *etmp;
|
|||
#ifdef D_DEBUG
|
||||
pline("%s on drawbridge square", E_phrase(etmp, "are"));
|
||||
#endif
|
||||
if (is_pool(etmp->ex, etmp->ey) && !e_inview)
|
||||
if (is_pool(etmp->ex, etmp->ey, TRUE) && !e_inview)
|
||||
if (flags.soundok)
|
||||
You_hear("a splash.");
|
||||
if (e_survives_at(etmp, etmp->ex, etmp->ey)) {
|
||||
|
@ -735,7 +737,7 @@ struct entity *etmp;
|
|||
#ifdef D_DEBUG
|
||||
pline("%s cannot survive on the drawbridge square",Enam(etmp));
|
||||
#endif
|
||||
if (is_pool(etmp->ex, etmp->ey) || is_lava(etmp->ex, etmp->ey))
|
||||
if (is_pool(etmp->ex, etmp->ey, FALSE) || is_lava(etmp->ex, etmp->ey))
|
||||
if (e_inview && !is_u(etmp)) {
|
||||
/* drown() will supply msgs if nec. */
|
||||
boolean lava = is_lava(etmp->ex, etmp->ey);
|
||||
|
@ -752,7 +754,7 @@ struct entity *etmp;
|
|||
killer_format = NO_KILLER_PREFIX;
|
||||
killer = "fell from a drawbridge";
|
||||
e_died(etmp, e_inview ? 3 : 2, /* CRUSHING is arbitrary */
|
||||
(is_pool(etmp->ex, etmp->ey)) ? DROWNING :
|
||||
(is_pool(etmp->ex, etmp->ey, FALSE)) ? DROWNING :
|
||||
(is_lava(etmp->ex, etmp->ey)) ? BURNING :
|
||||
CRUSHING); /*no corpse*/
|
||||
return;
|
||||
|
@ -940,7 +942,7 @@ int x,y;
|
|||
pline("%s hit by a huge chunk of metal!",
|
||||
E_phrase(etmp1, "are"));
|
||||
} else {
|
||||
if (flags.soundok && !is_u(etmp1) && !is_pool(x,y))
|
||||
if (flags.soundok && !is_u(etmp1) && !is_pool(x,y, FALSE))
|
||||
You_hear("a crushing sound.");
|
||||
#ifdef D_DEBUG
|
||||
else
|
||||
|
|
17
src/dig.c
17
src/dig.c
|
@ -221,7 +221,7 @@ dig_check(madeby, verbose, x, y)
|
|||
} else if (madeby == BY_OBJECT &&
|
||||
/* the block against existing traps is mainly to
|
||||
prevent broken wands from turning holes into pits */
|
||||
(ttmp || is_pool(x,y) || is_lava(x,y))) {
|
||||
(ttmp || is_pool(x,y, TRUE) || is_lava(x,y))) {
|
||||
/* digging by player handles pools separately */
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -974,7 +974,7 @@ boolean pit_only;
|
|||
(lev->wall_info & W_NONDIGGABLE) != 0)) {
|
||||
pline_The("%s here is too hard to dig in.", surface(u.ux,u.uy));
|
||||
|
||||
} else if (is_pool(u.ux, u.uy) || is_lava(u.ux, u.uy)) {
|
||||
} else if (is_pool(u.ux, u.uy, TRUE) || is_lava(u.ux, u.uy)) {
|
||||
pline_The("%s sloshes furiously for a moment, then subsides.",
|
||||
is_lava(u.ux, u.uy) ? "lava" : "water");
|
||||
wake_nearby(); /* splashing */
|
||||
|
@ -1132,7 +1132,7 @@ boolean pit_only;
|
|||
pline_The("%s here refuses to open.", surface(u.ux,u.uy));
|
||||
|
||||
return FALSE;
|
||||
} else if (is_pool(u.ux, u.uy) || is_lava(u.ux, u.uy)) {
|
||||
} else if (is_pool(u.ux, u.uy, TRUE) || is_lava(u.ux, u.uy)) {
|
||||
You("can't open a door into a liquid!");
|
||||
} else if (lev->typ == DRAWBRIDGE_DOWN ||
|
||||
(is_drawbridge_wall(u.ux, u.uy) >= 0)) {
|
||||
|
@ -1387,7 +1387,7 @@ openrocktrap()
|
|||
pline_The("%s here refuses to open.", ceiling(u.ux,u.uy));
|
||||
|
||||
return FALSE;
|
||||
} else if (is_pool(u.ux, u.uy) || is_lava(u.ux, u.uy)) {
|
||||
} else if (is_pool(u.ux, u.uy, TRUE) || is_lava(u.ux, u.uy)) {
|
||||
fakerocktrap();
|
||||
return TRUE;
|
||||
} else if (lev->typ == DRAWBRIDGE_DOWN ||
|
||||
|
@ -1727,10 +1727,13 @@ struct obj *obj;
|
|||
You("swing your %s through thin air.", aobjnam(obj, (char *)0));
|
||||
} else if (!can_reach_floor()) {
|
||||
You_cant("reach the %s.", surface(u.ux,u.uy));
|
||||
} else if (is_pool(u.ux, u.uy) || is_lava(u.ux, u.uy)) {
|
||||
} else if (is_pool(u.ux, u.uy, FALSE) || is_lava(u.ux, u.uy)) {
|
||||
/* Monsters which swim also happen not to be able to dig */
|
||||
You("cannot stay under%s long enough.",
|
||||
is_pool(u.ux, u.uy) ? "water" : " the lava");
|
||||
is_pool(u.ux, u.uy, TRUE) ? "water" : " the lava");
|
||||
} else if (IS_PUDDLE(levl[u.ux][u.uy].typ)) {
|
||||
Your("%s against the water's surface.", aobjnam(obj, "splash"));
|
||||
wake_nearby();
|
||||
} else if (digtyp == 2) {
|
||||
Your("%s merely scratches the %s.",
|
||||
aobjnam(obj, (char *)0), surface(u.ux,u.uy));
|
||||
|
@ -2267,7 +2270,7 @@ int y;
|
|||
if(cansee(x, y))
|
||||
pline_The("dust over the %s swirls in the wind.", surface(x,y));
|
||||
|
||||
} else if (is_pool(x, y) || is_lava(x, y)) {
|
||||
} else if (is_pool(x, y, TRUE) || is_lava(x, y)) {
|
||||
pline_The("%s sloshes furiously for a moment, then subsides.",
|
||||
is_lava(x, y) ? "lava" : "water");
|
||||
wake_nearby(); /* splashing */
|
||||
|
|
|
@ -518,7 +518,7 @@ feel_location(x, y)
|
|||
if (glyph_is_invisible(levl[x][y].glyph) && m_at(x,y)) return;
|
||||
|
||||
/* The hero can't feel non pool locations while under water. */
|
||||
if (Underwater && !Is_waterlevel(&u.uz) && !is_pool(x,y))
|
||||
if (Underwater && !Is_waterlevel(&u.uz) && !is_pool(x,y, TRUE))
|
||||
return;
|
||||
|
||||
/* Set the seen vector as if the hero had seen it. It doesn't matter */
|
||||
|
@ -548,7 +548,7 @@ feel_location(x, y)
|
|||
map_object(boulder, 1);
|
||||
} else if (IS_DOOR(lev->typ)) {
|
||||
map_background(x, y, 1);
|
||||
} else if (IS_ROOM(lev->typ) || IS_POOL(lev->typ)) {
|
||||
} else if (IS_ROOM(lev->typ) || IS_PUDDLE_OR_POOL(lev->typ)) {
|
||||
/*
|
||||
* An open room or water location. Normally we wouldn't touch
|
||||
* this, but we have to get rid of remembered boulder symbols.
|
||||
|
@ -645,7 +645,7 @@ echo_location(x, y)
|
|||
register struct monst *mon;
|
||||
|
||||
/* The hero can't feel non pool locations while under water. */
|
||||
if (Underwater && !Is_waterlevel(&u.uz) && !is_pool(x,y))
|
||||
if (Underwater && !Is_waterlevel(&u.uz) && !is_pool(x,y, TRUE))
|
||||
return;
|
||||
|
||||
if (glyph_is_invisible(levl[x][y].glyph) && !(m_at(x,y))) {
|
||||
|
@ -727,7 +727,7 @@ newsym(x,y)
|
|||
if (Underwater && !Is_waterlevel(&u.uz)) {
|
||||
/* don't do anything unless (x,y) is an adjacent underwater position */
|
||||
int dx, dy;
|
||||
if (!is_pool(x,y)) return;
|
||||
if (!is_pool(x,y, TRUE)) return;
|
||||
dx = x - u.ux; if (dx < 0) dx = -dx;
|
||||
dy = y - u.uy; if (dy < 0) dy = -dy;
|
||||
if (dx > 1 || dy > 1) return;
|
||||
|
@ -1127,7 +1127,7 @@ under_water(mode)
|
|||
}
|
||||
for (x = u.ux-1; x <= u.ux+1; x++)
|
||||
for (y = u.uy-1; y <= u.uy+1; y++)
|
||||
if (isok(x,y) && is_pool(x,y)) {
|
||||
if (isok(x,y) && is_pool(x,y, TRUE)) {
|
||||
if (Blind && !(x == u.ux && y == u.uy))
|
||||
show_glyph(x,y,cmap_to_glyph(S_stone));
|
||||
else
|
||||
|
@ -1710,6 +1710,7 @@ back_to_glyph(x,y)
|
|||
case ICE: idx = S_ice; break;
|
||||
case AIR: idx = S_air; break;
|
||||
case CLOUD: idx = S_cloud; break;
|
||||
case PUDDLE: idx = S_puddle; break;
|
||||
case FOG: idx = S_fog; break;
|
||||
case WATER: idx = S_water; break;
|
||||
case DBWALL:
|
||||
|
@ -1824,7 +1825,7 @@ static const char *type_names[MAX_TYPE] = {
|
|||
"DEADTREE", "DOOR", "CORR", "ROOM", "STAIRS",
|
||||
"LADDER", "FOUNTAIN", "THRONE", "SINK",
|
||||
"ALTAR", "ICE", "DRAWBRIDGE_DOWN","AIR",
|
||||
"CLOUD", "FOG"
|
||||
"CLOUD", "FOG", "PUDDLE"
|
||||
};
|
||||
|
||||
|
||||
|
|
17
src/do.c
17
src/do.c
|
@ -64,7 +64,7 @@ boolean pushing;
|
|||
{
|
||||
if (!otmp || !is_boulder(otmp))
|
||||
impossible("Not a boulder?");
|
||||
else if (!Is_waterlevel(&u.uz) && (is_pool(rx,ry) || is_lava(rx,ry))) {
|
||||
else if (!Is_waterlevel(&u.uz) && (is_pool(rx,ry, FALSE) || is_lava(rx,ry))) {
|
||||
boolean lava = is_lava(rx,ry), fills_up;
|
||||
const char *what = waterbody_name(rx,ry);
|
||||
schar ltyp = levl[rx][ry].typ;
|
||||
|
@ -205,10 +205,11 @@ const char *verb;
|
|||
return TRUE;
|
||||
} else if (is_lava(x, y)) {
|
||||
return fire_damage(obj, FALSE, FALSE, x, y);
|
||||
} else if (is_pool(x, y)) {
|
||||
} else if (is_pool(x, y, TRUE)) {
|
||||
/* Reasonably bulky objects (arbitrary) splash when dropped.
|
||||
* If you're floating above the water even small things make noise.
|
||||
* Stuff dropped near fountains always misses */
|
||||
* Stuff dropped near fountains always misses
|
||||
*/
|
||||
if ((Blind || (Levitation || Flying)) && flags.soundok &&
|
||||
((x == u.ux) && (y == u.uy))) {
|
||||
if (!Underwater) {
|
||||
|
@ -218,7 +219,7 @@ const char *verb;
|
|||
pline("Plop!");
|
||||
}
|
||||
}
|
||||
map_background(x, y, 0);
|
||||
//map_background(x, y, 0);
|
||||
newsym(x, y);
|
||||
}
|
||||
return water_damage(obj, FALSE, FALSE, FALSE, (struct monst *) 0);
|
||||
|
@ -1847,7 +1848,7 @@ long timeout;
|
|||
*/
|
||||
if ((
|
||||
(body->where == OBJ_FLOOR || body->where==OBJ_BURIED) &&
|
||||
(is_pool(body->ox, body->oy) || is_lava(body->ox, body->oy) ||
|
||||
(is_pool(body->ox, body->oy, FALSE) || is_lava(body->ox, body->oy) ||
|
||||
is_ice(body->ox, body->oy))
|
||||
) || (
|
||||
(body->where == OBJ_CONTAINED && body->ocontainer->otyp == ICE_BOX)
|
||||
|
@ -1923,7 +1924,7 @@ long timeout;
|
|||
* check for iceboxes here as well.
|
||||
*/
|
||||
if ((body->where == OBJ_FLOOR || body->where==OBJ_BURIED) &&
|
||||
(is_pool(body->ox, body->oy) || is_lava(body->ox, body->oy) ||
|
||||
(is_pool(body->ox, body->oy, FALSE) || is_lava(body->ox, body->oy) ||
|
||||
is_ice(body->ox, body->oy)))
|
||||
pmtype = -1;
|
||||
|
||||
|
@ -1985,7 +1986,7 @@ long timeout;
|
|||
* check for iceboxes here as well.
|
||||
*/
|
||||
if ((body->where == OBJ_FLOOR || body->where==OBJ_BURIED) &&
|
||||
(is_pool(body->ox, body->oy) || is_lava(body->ox, body->oy) ||
|
||||
(is_pool(body->ox, body->oy, FALSE) || is_lava(body->ox, body->oy) ||
|
||||
is_ice(body->ox, body->oy)))
|
||||
pmtype = -1;
|
||||
|
||||
|
@ -2055,7 +2056,7 @@ long timeout;
|
|||
* check for iceboxes here as well.
|
||||
*/
|
||||
if ((body->where == OBJ_FLOOR || body->where==OBJ_BURIED) &&
|
||||
(is_pool(body->ox, body->oy) || is_lava(body->ox, body->oy) ||
|
||||
(is_pool(body->ox, body->oy, FALSE) || is_lava(body->ox, body->oy) ||
|
||||
is_ice(body->ox, body->oy)))
|
||||
pmtype = -1;
|
||||
|
||||
|
|
|
@ -167,7 +167,7 @@ Boots_off()
|
|||
}
|
||||
break;
|
||||
case WATER_WALKING_BOOTS:
|
||||
if (is_pool(u.ux,u.uy) && !Levitation && !Flying &&
|
||||
if (is_pool(u.ux,u.uy, TRUE) && !Levitation && !Flying &&
|
||||
!is_clinger(youracedata) && !cancelled_don) {
|
||||
makeknown(otyp);
|
||||
/* make boots known in case you survive the drowning */
|
||||
|
|
|
@ -130,7 +130,7 @@ boolean quietly;
|
|||
|
||||
if (!mtmp) return (struct monst *)0;
|
||||
|
||||
if (is_pool(mtmp->mx, mtmp->my) && minliquid(mtmp))
|
||||
if (is_pool(mtmp->mx, mtmp->my, FALSE) && minliquid(mtmp))
|
||||
return (struct monst *)0;
|
||||
|
||||
initedog(mtmp);
|
||||
|
|
|
@ -353,7 +353,7 @@ boolean devour;
|
|||
newsym(x, y);
|
||||
newsym(mtmp->mx, mtmp->my);
|
||||
}
|
||||
if (is_pool(x, y) && !Underwater) {
|
||||
if (is_pool(x, y, FALSE) && !Underwater) {
|
||||
/* Don't print obj */
|
||||
/* TODO: Reveal presence of sea monster (especially sharks) */
|
||||
} else
|
||||
|
@ -1267,7 +1267,7 @@ could_reach_item(mon, nx, ny)
|
|||
struct monst *mon;
|
||||
xchar nx, ny;
|
||||
{
|
||||
if ((!is_pool(nx,ny) || is_swimmer(mon->data)) &&
|
||||
if ((!is_pool(nx,ny, FALSE) || is_swimmer(mon->data)) &&
|
||||
(!is_lava(nx,ny) || likes_lava(mon->data)) &&
|
||||
(!boulder_at(nx,ny) || throws_rocks(mon->data)))
|
||||
return TRUE;
|
||||
|
|
13
src/dokick.c
13
src/dokick.c
|
@ -556,7 +556,7 @@ xchar x, y;
|
|||
|
||||
if(martial()) range += rnd(3);
|
||||
|
||||
if (is_pool(x, y)) {
|
||||
if (is_pool(x, y, TRUE)) {
|
||||
/* you're in the water too; significantly reduce range */
|
||||
range = range / 3 + 1; /* {1,2}=>1, {3,4,5}=>2, {6,7,8}=>3 */
|
||||
} else {
|
||||
|
@ -776,12 +776,21 @@ dokick()
|
|||
break;
|
||||
case TT_WEB:
|
||||
case TT_BEARTRAP:
|
||||
case TT_LAVA:
|
||||
You_cant("move your %s!", body_part(LEG));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
no_kick = TRUE;
|
||||
} else if (!rn2(2) && IS_PUDDLE(levl[u.ux][u.uy].typ) &&
|
||||
!Levitation && !Flying && !Wwalking &&
|
||||
/* mud boots negate water resistance */
|
||||
(!uarmf || strncmp(OBJ_DESCR(objects[uarmf->otyp]), "mud ", 4))
|
||||
) {
|
||||
pline_The("water at your %s hinders your ability to kick.",
|
||||
makeplural(body_part(FOOT)));
|
||||
no_kick = TRUE;
|
||||
}
|
||||
|
||||
if (no_kick) {
|
||||
|
@ -874,7 +883,7 @@ dokick()
|
|||
unmap_object(x, y);
|
||||
newsym(x, y);
|
||||
}
|
||||
if (is_pool(x, y) ^ !!u.uinwater) {
|
||||
if ((is_pool(x, y, TRUE)) ^ !!u.uinwater) {
|
||||
/* objects normally can't be removed from water by kicking */
|
||||
You("splash some water around.");
|
||||
return 1;
|
||||
|
|
|
@ -263,6 +263,7 @@ const struct symdef defsyms[MAXPCHARS] = {
|
|||
{' ', "air", C(CLR_CYAN)}, /* open air */
|
||||
{'#', "cloud", C(CLR_GRAY)}, /* [part of] a cloud */
|
||||
/*40*/ {'#', "fog cloud", C(HI_ZAP)}, /* [part of] a cloud */
|
||||
{'~', "shallow water", C(CLR_BLUE)}, /* shallow water */
|
||||
{'}', "water", C(CLR_BLUE)}, /* under water */
|
||||
{'^', "arrow trap", C(HI_METAL)}, /* trap */
|
||||
{'^', "dart trap", C(HI_METAL)}, /* trap */
|
||||
|
@ -271,8 +272,8 @@ const struct symdef defsyms[MAXPCHARS] = {
|
|||
{'^', "bear trap", C(HI_METAL)}, /* trap */
|
||||
{'^', "land mine", C(CLR_RED)}, /* trap */
|
||||
{'^', "rolling boulder trap", C(CLR_GRAY)}, /* trap */
|
||||
{'^', "sleeping gas trap",C(HI_ZAP)}, /* trap */
|
||||
/*50*/ {'^', "rust trap", C(CLR_BLUE)}, /* trap */
|
||||
/*50*/ {'^', "sleeping gas trap",C(HI_ZAP)}, /* trap */
|
||||
{'^', "rust trap", C(CLR_BLUE)}, /* trap */
|
||||
{'^', "fire trap", C(CLR_ORANGE)}, /* trap */
|
||||
{'^', "pit", C(CLR_BLACK)}, /* trap */
|
||||
{'^', "spiked pit", C(CLR_BLACK)}, /* trap */
|
||||
|
@ -281,8 +282,8 @@ const struct symdef defsyms[MAXPCHARS] = {
|
|||
{'^', "teleportation trap", C(CLR_MAGENTA)}, /* trap */
|
||||
{'^', "level teleporter", C(CLR_MAGENTA)}, /* trap */
|
||||
{'^', "magic portal", C(CLR_BRIGHT_MAGENTA)}, /* trap */
|
||||
{'"', "web", C(CLR_GRAY)}, /* web */
|
||||
/*60*/ {'^', "statue trap", C(CLR_GRAY)}, /* trap */
|
||||
/*60*/ {'"', "web", C(CLR_GRAY)}, /* web */
|
||||
{'^', "statue trap", C(CLR_GRAY)}, /* trap */
|
||||
{'^', "magic trap", C(HI_ZAP)}, /* trap */
|
||||
{'^', "anti-magic field", C(HI_ZAP)}, /* trap */
|
||||
{'^', "polymorph trap", C(CLR_BRIGHT_GREEN)}, /* trap */
|
||||
|
@ -291,8 +292,8 @@ const struct symdef defsyms[MAXPCHARS] = {
|
|||
{'\\',"wall", C(CLR_GRAY)}, /* lslant */
|
||||
{'/', "wall", C(CLR_GRAY)}, /* rslant */
|
||||
{'*', "", C(CLR_WHITE)}, /* dig beam */
|
||||
{'!', "", C(CLR_WHITE)}, /* camera flash beam */
|
||||
/*70*/ {')', "", C(HI_WOOD)}, /* boomerang open left */
|
||||
/*70*/ {'!', "", C(CLR_WHITE)}, /* camera flash beam */
|
||||
{')', "", C(HI_WOOD)}, /* boomerang open left */
|
||||
{'(', "", C(HI_WOOD)}, /* boomerang open right */
|
||||
{'0', "", C(HI_ZAP)}, /* 4 magic shield symbols */
|
||||
{'#', "", C(HI_ZAP)},
|
||||
|
@ -301,8 +302,8 @@ const struct symdef defsyms[MAXPCHARS] = {
|
|||
{'/', "", C(CLR_GREEN)}, /* swallow top left */
|
||||
{'-', "", C(CLR_GREEN)}, /* swallow top center */
|
||||
{'\\', "", C(CLR_GREEN)}, /* swallow top right */
|
||||
{'|', "", C(CLR_GREEN)}, /* swallow middle left */
|
||||
/*80*/ {'|', "", C(CLR_GREEN)}, /* swallow middle right */
|
||||
/*80*/ {'|', "", C(CLR_GREEN)}, /* swallow middle left */
|
||||
{'|', "", C(CLR_GREEN)}, /* swallow middle right */
|
||||
{'\\', "", C(CLR_GREEN)}, /* swallow bottom left */
|
||||
{'-', "", C(CLR_GREEN)}, /* swallow bottom center*/
|
||||
{'/', "", C(CLR_GREEN)}, /* swallow bottom right */
|
||||
|
@ -311,8 +312,8 @@ const struct symdef defsyms[MAXPCHARS] = {
|
|||
{'\\', "", C(CLR_ORANGE)}, /* explosion top right */
|
||||
{'|', "", C(CLR_ORANGE)}, /* explosion middle left */
|
||||
{' ', "", C(CLR_ORANGE)}, /* explosion middle center*/
|
||||
{'|', "", C(CLR_ORANGE)}, /* explosion middle right */
|
||||
/*90*/ {'\\', "", C(CLR_ORANGE)}, /* explosion bottom left */
|
||||
/*90*/ {'|', "", C(CLR_ORANGE)}, /* explosion middle right */
|
||||
{'\\', "", C(CLR_ORANGE)}, /* explosion bottom left */
|
||||
{'-', "", C(CLR_ORANGE)}, /* explosion bottom center*/
|
||||
{'/', "", C(CLR_ORANGE)}, /* explosion bottom right */
|
||||
/*
|
||||
|
@ -378,7 +379,8 @@ static glyph_t ibm_graphics[MAXPCHARS] = {
|
|||
g_FILLER(S_air),
|
||||
g_FILLER(S_cloud),
|
||||
g_FILLER(S_fog),
|
||||
/*40*/ 0xf7, /* S_water: meta-w, approx. equals */
|
||||
g_FILLER(S_puddle),
|
||||
0xf7, /* S_water: meta-w, approx. equals */
|
||||
g_FILLER(S_arrow_trap),
|
||||
g_FILLER(S_dart_trap),
|
||||
g_FILLER(S_falling_rock_trap),
|
||||
|
@ -481,7 +483,8 @@ static glyph_t dec_graphics[MAXPCHARS] = {
|
|||
g_FILLER(S_air),
|
||||
g_FILLER(S_cloud),
|
||||
g_FILLER(S_fog),
|
||||
/*40*/ 0xe0, /* S_water: meta-\, diamond */
|
||||
g_FILLER(S_puddle),
|
||||
0xe0, /* S_water: meta-\, diamond */
|
||||
g_FILLER(S_arrow_trap),
|
||||
g_FILLER(S_dart_trap),
|
||||
g_FILLER(S_falling_rock_trap),
|
||||
|
@ -582,7 +585,8 @@ static glyph_t mac_graphics[MAXPCHARS] = {
|
|||
g_FILLER(S_air),
|
||||
g_FILLER(S_cloud),
|
||||
g_FILLER(S_fog),
|
||||
/*40*/ g_FILLER(S_water),
|
||||
g_FILLER(S_puddle),
|
||||
g_FILLER(S_water),
|
||||
g_FILLER(S_arrow_trap),
|
||||
g_FILLER(S_dart_trap),
|
||||
g_FILLER(S_falling_rock_trap),
|
||||
|
@ -685,6 +689,7 @@ static glyph_t utf8_graphics[MAXPCHARS] = {
|
|||
g_FILLER(S_air),
|
||||
g_FILLER(S_cloud),
|
||||
g_FILLER(S_fog),
|
||||
g_FILLER(S_puddle),
|
||||
0x2248, /* S_water: ALMOST EQUAL TO */
|
||||
g_FILLER(S_arrow_trap),
|
||||
g_FILLER(S_dart_trap),
|
||||
|
|
|
@ -4370,7 +4370,7 @@ floorfood(verb,corpsecheck) /* get food from floor or pack */
|
|||
#ifdef STEED
|
||||
(feeding && u.usteed) || /* can't eat off floor while riding */
|
||||
#endif
|
||||
((is_pool(u.ux, u.uy) || is_lava(u.ux, u.uy)) &&
|
||||
((is_pool(u.ux, u.uy, FALSE) || is_lava(u.ux, u.uy)) &&
|
||||
(Wwalking || is_clinger(youracedata) ||
|
||||
(Flying && !Breathless))))
|
||||
goto skipfloor;
|
||||
|
|
|
@ -1221,7 +1221,7 @@ register int x, y;
|
|||
return "maw";
|
||||
else if (IS_AIR(lev->typ) && Weightless)
|
||||
return "air";
|
||||
else if (is_pool(x,y))
|
||||
else if (is_pool(x,y, TRUE))
|
||||
return (Underwater && !Is_waterlevel(&u.uz)) ? "bottom" : "water";
|
||||
else if (is_ice(x,y))
|
||||
return "ice";
|
||||
|
@ -1235,6 +1235,8 @@ register int x, y;
|
|||
return "headstone";
|
||||
else if(IS_FOUNTAIN(levl[x][y].typ))
|
||||
return "fountain";
|
||||
else if(IS_PUDDLE(levl[x][y].typ))
|
||||
return "muddy floor";
|
||||
else if ((IS_ROOM(lev->typ) && !Is_earthlevel(&u.uz)) ||
|
||||
IS_WALL(lev->typ) || IS_DOOR(lev->typ) || lev->typ == SDOOR)
|
||||
return "floor";
|
||||
|
@ -1458,13 +1460,13 @@ register int x,y;
|
|||
/* Sensing an engraving does not require sight,
|
||||
* nor does it necessarily imply comprehension (literacy).
|
||||
*/
|
||||
if(ep && ep->engr_txt[0] && (Underwater || !is_pool(x,y))) {
|
||||
if(ep && ep->engr_txt[0] && (Underwater || !is_pool(x,y, FALSE))) {
|
||||
switch(ep->engr_type) {
|
||||
case DUST:
|
||||
if(!Blind) {
|
||||
sensed = 1;
|
||||
pline("%s is written here in the %s.", Something,
|
||||
is_ice(x,y) ? "frost" : "dust");
|
||||
is_ice(x,y) ? "frost" : is_pool(x,y, TRUE) ? "mud" : "dust");
|
||||
}
|
||||
break;
|
||||
case ENGRAVE:
|
||||
|
@ -1857,10 +1859,10 @@ doengrave()
|
|||
} else if (is_lava(u.ux, u.uy)) {
|
||||
You_cant("write on the lava!");
|
||||
return(0);
|
||||
} /*else if (is_pool(u.ux,u.uy) || IS_FOUNTAIN(levl[u.ux][u.uy].typ)) {
|
||||
} /*else if (is_pool(u.ux,u.uy, FALSE) || IS_FOUNTAIN(levl[u.ux][u.uy].typ)) {
|
||||
You_cant("draw on the water!");
|
||||
return(0);
|
||||
}*/else if(is_pool(u.ux,u.uy) && !u.uinwater){
|
||||
}*/else if(is_pool(u.ux,u.uy, FALSE) && !u.uinwater){
|
||||
You_cant("draw on the water!");
|
||||
return(0);
|
||||
}
|
||||
|
@ -2666,10 +2668,10 @@ doward()
|
|||
} else if (is_lava(u.ux, u.uy)) {
|
||||
You_cant("draw on the lava!");
|
||||
return(0);
|
||||
} /*else if (is_pool(u.ux,u.uy) || IS_FOUNTAIN(levl[u.ux][u.uy].typ)) {
|
||||
} /*else if (is_pool(u.ux,u.uy, FALSE) || IS_FOUNTAIN(levl[u.ux][u.uy].typ)) {
|
||||
You_cant("draw on the water!");
|
||||
return(0);
|
||||
}*/else if(is_pool(u.ux,u.uy) && !u.uinwater){
|
||||
}*/else if(is_pool(u.ux,u.uy, FALSE) && !u.uinwater){
|
||||
You_cant("draw on the water!");
|
||||
return(0);
|
||||
}
|
||||
|
@ -4048,10 +4050,10 @@ doseal()
|
|||
} else if (is_lava(u.ux, u.uy)) {
|
||||
You_cant("draw on the lava!");
|
||||
return(0);
|
||||
} /*else if (is_pool(u.ux,u.uy) || IS_FOUNTAIN(levl[u.ux][u.uy].typ)) {
|
||||
} /*else if (is_pool(u.ux,u.uy, FALSE) || IS_FOUNTAIN(levl[u.ux][u.uy].typ)) {
|
||||
You_cant("draw on the water!");
|
||||
return(0);
|
||||
}*/else if(is_pool(u.ux,u.uy) && !u.uinwater){
|
||||
}*/else if(is_pool(u.ux,u.uy, FALSE) && !u.uinwater){
|
||||
You_cant("draw on the water!");
|
||||
return(0);
|
||||
}
|
||||
|
|
|
@ -454,7 +454,7 @@ boolean yours; /* is it your fault (for killing monsters) */
|
|||
generic = TRUE;
|
||||
}
|
||||
if (flags.soundok)
|
||||
You_hear(is_pool(x, y) ? "a muffled explosion." : "a blast.");
|
||||
You_hear(is_pool(x, y, FALSE) ? "a muffled explosion." : "a blast.");
|
||||
}
|
||||
|
||||
if (dam) for(i = 0; i < area->nlocations; i++) {
|
||||
|
|
|
@ -121,9 +121,8 @@ genericptr_t poolcnt;
|
|||
if (!((*(int *)poolcnt)++))
|
||||
pline("Water gushes forth from the overflowing fountain!");
|
||||
|
||||
/* Put a pool at x, y */
|
||||
levl[x][y].typ = POOL;
|
||||
/* No kelp! */
|
||||
/* Put a puddle at x, y */
|
||||
levl[x][y].typ = PUDDLE;
|
||||
del_engr_ward_at(x, y);
|
||||
water_damage(level.objects[x][y], FALSE, TRUE, FALSE, (struct monst *) 0);
|
||||
|
||||
|
|
44
src/hack.c
44
src/hack.c
|
@ -726,8 +726,8 @@ int mode;
|
|||
|
||||
if ((t && t->tseen) ||
|
||||
(((!Levitation && !Flying &&
|
||||
!is_clinger(youracedata)) || Is_dagon_level(&u.uz)) &&
|
||||
(is_pool(x, y) || is_lava(x, y)) && levl[x][y].seenv))
|
||||
!is_clinger(youracedata)) || is_3dwater(x, y)) &&
|
||||
(is_pool(x, y, TRUE) || is_lava(x, y)) && levl[x][y].seenv))
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
@ -1054,7 +1054,7 @@ domove()
|
|||
if (((trap = t_at(x, y)) && trap->tseen) ||
|
||||
(Blind && !Levitation && !Flying &&
|
||||
!is_clinger(youracedata) &&
|
||||
(is_pool(x, y) || is_lava(x, y)) && levl[x][y].seenv)) {
|
||||
(is_pool(x, y, TRUE) || is_lava(x, y)) && levl[x][y].seenv)) {
|
||||
if(flags.run >= 2) {
|
||||
nomul(0, NULL);
|
||||
flags.move = 0;
|
||||
|
@ -1205,7 +1205,7 @@ domove()
|
|||
You("%s %s.",
|
||||
expl ? "explode at" : "attack",
|
||||
!Underwater ? "thin air" :
|
||||
is_pool(x,y) ? "empty water" : buf);
|
||||
is_pool(x,y, FALSE) ? "empty water" : buf);
|
||||
// unmap_object(x, y); /* known empty -- remove 'I' if present */
|
||||
if (glyph_is_invisible(levl[x][y].glyph)) {
|
||||
unmap_object(x, y);
|
||||
|
@ -1595,7 +1595,7 @@ domove()
|
|||
if (hides_under(youracedata))
|
||||
u.uundetected = OBJ_AT(u.ux, u.uy);
|
||||
else if (youracedata->mlet == S_EEL)
|
||||
u.uundetected = is_pool(u.ux, u.uy) && !Is_waterlevel(&u.uz);
|
||||
u.uundetected = is_pool(u.ux, u.uy, FALSE) && !Is_waterlevel(&u.uz);
|
||||
else if (u.dx || u.dy)
|
||||
u.uundetected = 0;
|
||||
|
||||
|
@ -1702,7 +1702,7 @@ boolean pick;
|
|||
if(u.uinwater) {
|
||||
int was_underwater;
|
||||
|
||||
if (!is_pool(u.ux,u.uy)) {
|
||||
if (!is_pool(u.ux,u.uy, FALSE)) {
|
||||
if (Is_waterlevel(&u.uz))
|
||||
You("pop into an air bubble.");
|
||||
else if (is_lava(u.ux, u.uy))
|
||||
|
@ -1732,7 +1732,7 @@ boolean pick;
|
|||
stillinwater:;
|
||||
if (((!Levitation && !Flying) || is_3dwater(u.ux, u.uy)) && !u.ustuck) {
|
||||
/* limit recursive calls through teleds() */
|
||||
if (is_pool(u.ux, u.uy) || is_lava(u.ux, u.uy)) {
|
||||
if (is_pool(u.ux, u.uy, FALSE) || is_lava(u.ux, u.uy)) {
|
||||
#ifdef STEED
|
||||
if (u.usteed && !is_flyer(u.usteed->data) &&
|
||||
!is_floater(u.usteed->data) &&
|
||||
|
@ -1748,6 +1748,32 @@ stillinwater:;
|
|||
if (lava_effects()) return;
|
||||
} else if (!Wwalking && drown())
|
||||
return;
|
||||
} else if (IS_PUDDLE(levl[u.ux][u.uy].typ) && !Wwalking) {
|
||||
|
||||
/*You("%s through the shallow water.",
|
||||
verysmall(youmonst.data) ? "wade" : "splash");
|
||||
if (!verysmall(youmonst.data) && !rn2(4)) wake_nearby();*/
|
||||
|
||||
if(u.umonnum == PM_GREMLIN)
|
||||
(void)split_mon(&youmonst, (struct monst *)0);
|
||||
else if (u.umonnum == PM_IRON_GOLEM &&
|
||||
/* mud boots keep the feet dry */
|
||||
(!uarmf || strncmp(OBJ_DESCR(objects[uarmf->otyp]), "mud ", 4))) {
|
||||
int dam = rnd(6);
|
||||
Your("%s rust!", makeplural(body_part(FOOT)));
|
||||
if (u.mhmax > dam) u.mhmax -= dam;
|
||||
losehp(dam, "rusting away", KILLED_BY);
|
||||
// } else if (is_longworm(youmonst.data)) { /* water is lethal to Shai-Hulud */
|
||||
// int dam = d(3,12);
|
||||
// if (u.mhmax > dam) u.mhmax -= (dam+1) / 2;
|
||||
// pline_The("water burns your flesh!");
|
||||
// losehp(dam,"contact with water",KILLED_BY);
|
||||
}
|
||||
if (verysmall(youmonst.data)) water_damage(invent, FALSE,FALSE,FALSE,FALSE);
|
||||
#ifdef STEED
|
||||
if (!u.usteed)
|
||||
#endif
|
||||
(void)rust_dmg(uarmf, "boots", 1, TRUE, &youmonst);
|
||||
}
|
||||
}
|
||||
check_special_room(FALSE);
|
||||
|
@ -2137,7 +2163,7 @@ dopickup()
|
|||
return loot_mon(u.ustuck, &tmpcount, (boolean *)0);
|
||||
}
|
||||
}
|
||||
if(is_pool(u.ux, u.uy) && !is_3dwater(u.ux, u.uy)) {
|
||||
if(is_pool(u.ux, u.uy, FALSE) && !is_3dwater(u.ux, u.uy) && !Is_waterlevel(&u.uz)) {//pools (bubble interior) on water level are special
|
||||
if (Wwalking || is_floater(youracedata) || is_clinger(youracedata)
|
||||
|| (Flying && !Breathless)) {
|
||||
You("cannot dive into the water to pick things up.");
|
||||
|
@ -2262,7 +2288,7 @@ bcorr:
|
|||
if(flags.run == 1) goto bcorr; /* if you must */
|
||||
if(x == u.ux+u.dx && y == u.uy+u.dy) goto stop;
|
||||
continue;
|
||||
} else if (is_pool(x,y) || is_lava(x,y)) {
|
||||
} else if (is_pool(x,y, TRUE) || is_lava(x,y)) {
|
||||
/* water and lava only stop you if directly in front, and stop
|
||||
* you even if you are running
|
||||
*/
|
||||
|
|
|
@ -2940,8 +2940,10 @@ char *buf;
|
|||
cmap = S_lava; /* "molten lava" */
|
||||
else if (is_ice(x,y))
|
||||
cmap = S_ice; /* "ice" */
|
||||
else if (is_pool(x,y))
|
||||
else if (is_pool(x,y, FALSE))
|
||||
dfeature = "pool of water";
|
||||
else if (IS_PUDDLE(ltyp))
|
||||
dfeature = "puddle of shallow water";
|
||||
#ifdef SINKS
|
||||
else if (IS_SINK(ltyp))
|
||||
cmap = S_sink; /* "sink" */
|
||||
|
@ -3044,7 +3046,7 @@ boolean picked_some;
|
|||
if (dfeature)
|
||||
Sprintf(fbuf, "There is %s here.", an(dfeature));
|
||||
|
||||
if (!otmp || is_lava(u.ux,u.uy) || (is_pool(u.ux,u.uy) && !Underwater)) {
|
||||
if (!otmp || is_lava(u.ux,u.uy) || (is_pool(u.ux,u.uy, FALSE) && !Underwater)) {
|
||||
if (dfeature) pline1(fbuf);
|
||||
read_engr_at(u.ux, u.uy); /* Eric Backus */
|
||||
if (!skip_objects && (Blind || !dfeature))
|
||||
|
|
|
@ -382,7 +382,7 @@ pick_lock(pick) /* pick a lock with a given object */
|
|||
pline("Doing that would probably melt your %s.",
|
||||
xname(pick));
|
||||
return 0;
|
||||
} else if (is_pool(u.ux, u.uy) && !Underwater) {
|
||||
} else if (is_pool(u.ux, u.uy, FALSE) && !Underwater) {
|
||||
pline_The("water has no lock.");
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -5282,7 +5282,7 @@ register int mmflags;
|
|||
}
|
||||
break;
|
||||
case S_EEL:
|
||||
if (is_pool(x, y))
|
||||
if (is_pool(x, y, FALSE))
|
||||
mtmp->mundetected = TRUE;
|
||||
if(mndx == PM_WATCHER_IN_THE_WATER){
|
||||
mtmp->mhpmax = 3*mtmp->mhpmax;
|
||||
|
|
|
@ -1484,7 +1484,7 @@ hitmu(mtmp, mattk)
|
|||
if ((obj = level.objects[mtmp->mx][mtmp->my]) != 0) {
|
||||
if (Blind && !obj->dknown)
|
||||
what = something;
|
||||
else if (is_pool(mtmp->mx, mtmp->my) && !Underwater)
|
||||
else if (is_pool(mtmp->mx, mtmp->my, TRUE) && !Underwater)
|
||||
what = "the water";
|
||||
else
|
||||
what = doname(obj);
|
||||
|
@ -2423,7 +2423,7 @@ dopois:
|
|||
else u.ustuck = mtmp;
|
||||
}
|
||||
} else if(u.ustuck == mtmp) {
|
||||
if (is_pool(mtmp->mx,mtmp->my) && !Swimming
|
||||
if (is_pool(mtmp->mx,mtmp->my, FALSE) && !Swimming
|
||||
&& !Breathless) {
|
||||
boolean moat =
|
||||
(levl[mtmp->mx][mtmp->my].typ != POOL) &&
|
||||
|
|
59
src/mklev.c
59
src/mklev.c
|
@ -24,6 +24,7 @@ STATIC_DCL void FDECL(mksink,(struct mkroom *));
|
|||
#endif
|
||||
STATIC_DCL void FDECL(mkaltar,(struct mkroom *));
|
||||
STATIC_DCL void FDECL(mkgrave,(struct mkroom *));
|
||||
STATIC_DCL void FDECL(mkpuddles,(struct mkroom *));
|
||||
STATIC_DCL void NDECL(makevtele);
|
||||
STATIC_DCL void NDECL(clear_level_structures);
|
||||
STATIC_DCL void NDECL(makelevel);
|
||||
|
@ -863,10 +864,22 @@ skip0:
|
|||
#ifdef REINCARNATION
|
||||
if(Is_rogue_level(&u.uz)) goto skip_nonrogue;
|
||||
#endif
|
||||
if(!rn2(10)) mkfount(0,croom);
|
||||
/* greater chance of puddles if a water source is nearby */
|
||||
x = 40;
|
||||
if(!rn2(10)) {
|
||||
mkfount(0,croom);
|
||||
x -= 20;
|
||||
}
|
||||
#ifdef SINKS
|
||||
if(!rn2(60)) mksink(croom);
|
||||
if(!rn2(60)) {
|
||||
mksink(croom);
|
||||
x -= 20;
|
||||
}
|
||||
|
||||
if (x < 2) x = 2;
|
||||
#endif
|
||||
if(!rn2(x)) mkpuddles(croom);
|
||||
|
||||
if(!rn2(60)) mkaltar(croom);
|
||||
x = 80 - (depth(&u.uz) * 2);
|
||||
if (x < 2) x = 2;
|
||||
|
@ -1357,7 +1370,7 @@ coord *tm;
|
|||
coord m;
|
||||
|
||||
/* no traps in pools */
|
||||
if (tm && is_pool(tm->x,tm->y)) return;
|
||||
if (tm && is_pool(tm->x,tm->y, TRUE)) return;
|
||||
|
||||
if (num > 0 && num < TRAPNUM) {
|
||||
kind = num;
|
||||
|
@ -1553,6 +1566,44 @@ register struct mkroom *croom;
|
|||
levl[m.x][m.y].altarmask = Align2amask( al );
|
||||
}
|
||||
|
||||
/* make connected spots of shallow water (or pools) and add sea monsters */
|
||||
STATIC_OVL void
|
||||
mkpuddles(croom)
|
||||
register struct mkroom *croom;
|
||||
{
|
||||
coord m;
|
||||
register int tryct = 0;
|
||||
register int puddles = 0; /* how many spaces have we altered? */
|
||||
|
||||
do {
|
||||
if(++tryct > 200) return;
|
||||
if (!somexy(croom, &m))
|
||||
return;
|
||||
} while(occupied(m.x, m.y));
|
||||
|
||||
do {
|
||||
if (levl[m.x][m.y].typ != PUDDLE && levl[m.x][m.y].typ != POOL) {
|
||||
puddles++;
|
||||
levl[m.x][m.y].typ = (depth(&u.uz) > 9 && !rn2(4) ?
|
||||
POOL : PUDDLE);
|
||||
}
|
||||
if (puddles > 4 && depth(&u.uz) > 4) {
|
||||
(void)makemon(levl[m.x][m.y].typ == POOL ? mkclass(S_EEL,0) :
|
||||
&mons[PM_PIRANHA],m.x,m.y,NO_MM_FLAGS);
|
||||
puddles -= 2; /* puddles created should always exceed piranhas */
|
||||
}
|
||||
tryct = 0;
|
||||
do {
|
||||
m.x += sgn(rn2(3)-1);
|
||||
m.y += sgn(rn2(3)-1);
|
||||
} while ((occupied(m.x, m.y) ||
|
||||
m.x < croom->lx || m.x > croom->hx ||
|
||||
m.y < croom->ly || m.y > croom->hy)
|
||||
&& (++tryct <= 27));
|
||||
} while(tryct <= 27);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
mkgrave(croom)
|
||||
struct mkroom *croom;
|
||||
|
@ -1700,7 +1751,7 @@ int dist;
|
|||
|
||||
switch(dist) {
|
||||
case 1: /* fire traps */
|
||||
if (is_pool(x,y)) break;
|
||||
if (is_pool(x,y, TRUE)) break;
|
||||
lev->typ = ROOM;
|
||||
ttmp = maketrap(x, y, FIRE_TRAP);
|
||||
if (ttmp) ttmp->tseen = TRUE;
|
||||
|
|
17
src/mkmaze.c
17
src/mkmaze.c
|
@ -455,7 +455,7 @@ fixup_special()
|
|||
for(x = croom->lx; x <= croom->hx; x++)
|
||||
for(y = croom->ly; y <= croom->hy; y++) {
|
||||
(void) mkgold((long) rn1(300, 600), x, y);
|
||||
if (!rn2(3) && !is_pool(x,y))
|
||||
if (!rn2(3) && !is_pool(x,y, TRUE))
|
||||
(void)maketrap(x, y, rn2(3) ? LANDMINE : SPIKED_PIT);
|
||||
}
|
||||
} else if(urole.neminum == PM_BOLG && In_quest(&u.uz) && Is_qlocate(&u.uz)) {
|
||||
|
@ -642,6 +642,13 @@ register const char *s;
|
|||
}
|
||||
if(In_outlands(&u.uz) && !(u.uz.dlevel == spire_level.dlevel || Is_gatetown(&u.uz) || Is_sumall(&u.uz))){
|
||||
place_neutral_features();
|
||||
if(u.uz.dlevel < gatetown_level.dlevel + 4){
|
||||
for(x = 0; x<COLNO; x++){
|
||||
for(y = 0; y<ROWNO; y++){
|
||||
if(levl[x][y].typ == TREE) levl[x][y].lit = TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if(Is_lolth_level(&u.uz)){
|
||||
int x, y;
|
||||
|
@ -1211,7 +1218,7 @@ water_friction()
|
|||
do {
|
||||
dy = rn2(3) - 1; /* -1, 0, 1 */
|
||||
y = u.uy + dy;
|
||||
} while (dy && (!isok(x,y) || !is_pool(x,y)));
|
||||
} while (dy && (!isok(x,y) || !is_pool(x,y, TRUE)));//can be tossed to shore
|
||||
u.dx = 0;
|
||||
u.dy = dy;
|
||||
eff = TRUE;
|
||||
|
@ -1221,7 +1228,7 @@ water_friction()
|
|||
do {
|
||||
dx = rn2(3) - 1; /* -1 .. 1 */
|
||||
x = u.ux + dx;
|
||||
} while (dx && (!isok(x,y) || !is_pool(x,y)));
|
||||
} while (dx && (!isok(x,y) || !is_pool(x,y, TRUE)));
|
||||
u.dy = 0;
|
||||
u.dx = dx;
|
||||
eff = TRUE;
|
||||
|
@ -1311,11 +1318,11 @@ xchar x,y;
|
|||
(ltyp == DRAWBRIDGE_UP &&
|
||||
(levl[x][y].drawbridgemask & DB_UNDER) == DB_ICE))
|
||||
return "ice";
|
||||
else if (((ltyp != POOL) && (ltyp != WATER) &&
|
||||
else if (((ltyp != POOL) && (ltyp != WATER) && (ltyp != PUDDLE) &&
|
||||
!Is_medusa_level(&u.uz) && !Is_waterlevel(&u.uz) && !Is_juiblex_level(&u.uz)) ||
|
||||
(ltyp == DRAWBRIDGE_UP && (levl[x][y].drawbridgemask & DB_UNDER) == DB_MOAT))
|
||||
return "moat";
|
||||
else if ((ltyp != POOL) && (ltyp != WATER) && Is_juiblex_level(&u.uz))
|
||||
else if ((ltyp != POOL) && (ltyp != WATER) && (ltyp != PUDDLE) && Is_juiblex_level(&u.uz))
|
||||
return "swamp";
|
||||
else if (ltyp == POOL)
|
||||
return "pool of water";
|
||||
|
|
331
src/mkroom.c
331
src/mkroom.c
|
@ -42,6 +42,7 @@ STATIC_DCL void FDECL(neuliquify, (xchar, xchar, boolean));
|
|||
STATIC_DCL struct permonst * NDECL(morguemon);
|
||||
STATIC_DCL struct permonst * NDECL(antholemon);
|
||||
STATIC_DCL struct permonst * NDECL(squadmon);
|
||||
STATIC_DCL struct permonst * NDECL(neu_squadmon);
|
||||
STATIC_DCL void FDECL(save_room, (int,struct mkroom *));
|
||||
STATIC_DCL void FDECL(rest_room, (int,struct mkroom *));
|
||||
#endif /* OVLB */
|
||||
|
@ -1144,7 +1145,7 @@ mkpluvillage()
|
|||
int nshacks, sizebig1, sizebig2, sizetot;
|
||||
struct obj *otmp;
|
||||
struct monst *mon;
|
||||
boolean good=FALSE, okspot, accessible;
|
||||
boolean good=FALSE, okspot, accessible, throne = 0;
|
||||
struct mkroom *croom;
|
||||
while(!good && tries < 50){
|
||||
nshacks = rnd(3) + rn2(3);
|
||||
|
@ -1191,13 +1192,6 @@ mkpluvillage()
|
|||
levl[x+i][y+3].typ = HWALL;
|
||||
levl[x+i][y+3].lit = 1;
|
||||
}
|
||||
for(i=1;i<sizebig1-1;i++){
|
||||
for(j=1+3;j<4+3;j++){
|
||||
levl[x+i][y+j].typ = ROOM;
|
||||
levl[x+i][y+j].lit = 1;
|
||||
// if(rn2(2)) makemon(&mons[PM_PLUMACH], x+i, y+j, 0);
|
||||
}
|
||||
}
|
||||
for(i=1+3;i<4+3;i++){
|
||||
levl[x+sizebig1-1][y+i].typ = VWALL;
|
||||
levl[x+sizebig1-1][y+i].lit = 1;
|
||||
|
@ -1212,9 +1206,96 @@ mkpluvillage()
|
|||
levl[x][y+3].typ = TLCORNER;
|
||||
levl[x][y+3].lit = 1;
|
||||
|
||||
flood_fill_rm(x+1, y+5,
|
||||
nroom+ROOMOFFSET, TRUE, TRUE);
|
||||
add_room(x+1, y+4, x+sizebig1-2, y+6, TRUE, SHOPBASE, TRUE);
|
||||
switch(rn2(7)){
|
||||
case 0: //Random store
|
||||
for(i=1;i<sizebig1-1;i++){
|
||||
for(j=1+3;j<4+3;j++){
|
||||
levl[x+i][y+j].typ = ROOM;
|
||||
levl[x+i][y+j].lit = 1;
|
||||
}
|
||||
}
|
||||
flood_fill_rm(x+1, y+5,
|
||||
nroom+ROOMOFFSET, TRUE, TRUE);
|
||||
add_room(x+1, y+4, x+sizebig1-2, y+6, TRUE, SHOPBASE + rn2(UNIQUESHOP - SHOPBASE), TRUE);
|
||||
break;
|
||||
case 1: //Temple
|
||||
for(i=1;i<sizebig1-1;i++){
|
||||
for(j=1+3;j<4+3;j++){
|
||||
levl[x+i][y+j].typ = ROOM;
|
||||
levl[x+i][y+j].lit = 1;
|
||||
}
|
||||
}
|
||||
flood_fill_rm(x+1, y+5,
|
||||
nroom+ROOMOFFSET, TRUE, TRUE);
|
||||
levl[x+1][y+5].typ = ALTAR;
|
||||
levl[x+1][y+5].altarmask = Align2amask( A_NEUTRAL );
|
||||
add_room(x+1, y+4, x+sizebig1-2, y+6, TRUE, TEMPLE, TRUE);
|
||||
priestini(&u.uz, &rooms[nroom - 1], x+1, y+5, FALSE);
|
||||
levl[x+sizetot-2][y+5].altarmask |= AM_SHRINE;
|
||||
level.flags.has_temple = 1;
|
||||
break;
|
||||
case 2: //Garrison
|
||||
for(i=1;i<sizebig1-1;i++){
|
||||
for(j=1+3;j<4+3;j++){
|
||||
levl[x+i][y+j].typ = ROOM;
|
||||
levl[x+i][y+j].lit = 1;
|
||||
}
|
||||
}
|
||||
flood_fill_rm(x+1, y+5,
|
||||
nroom+ROOMOFFSET, TRUE, TRUE);
|
||||
add_room(x+1, y+4, x+sizebig1-2, y+6, TRUE, BARRACKS, TRUE);
|
||||
break;
|
||||
case 3: //Courtroom
|
||||
for(i=1;i<sizebig1-1;i++){
|
||||
for(j=1+3;j<4+3;j++){
|
||||
levl[x+i][y+j].typ = ROOM;
|
||||
levl[x+i][y+j].lit = 1;
|
||||
}
|
||||
}
|
||||
flood_fill_rm(x+1, y+5,
|
||||
nroom+ROOMOFFSET, TRUE, TRUE);
|
||||
throne = 1;
|
||||
add_room(x+1, y+4, x+sizebig1-2, y+6, TRUE, COURT, TRUE);
|
||||
break;
|
||||
case 4://Normal
|
||||
for(i=1;i<sizebig1-1;i++){
|
||||
for(j=1+3;j<4+3;j++){
|
||||
levl[x+i][y+j].typ = CORR;
|
||||
levl[x+i][y+j].lit = 1;
|
||||
if(rn2(2)) makemon(&mons[PM_PLUMACH], x+i, y+j, 0);
|
||||
if(rn2(2)) mkobj_at((rn2(2) ? WEAPON_CLASS : rn2(2) ? TOOL_CLASS : ARMOR_CLASS), x+i, y+j, FALSE);
|
||||
}
|
||||
}
|
||||
flood_fill_rm(x+1, y+5,
|
||||
nroom+ROOMOFFSET, TRUE, TRUE);
|
||||
add_room(x+1, y+4, x+sizebig1-2, y+6, TRUE, OROOM, TRUE);
|
||||
break;
|
||||
case 5: //Gold vault
|
||||
for(i=1;i<sizebig1-1;i++){
|
||||
for(j=1+3;j<4+3;j++){
|
||||
levl[x+i][y+j].typ = CORR;
|
||||
levl[x+i][y+j].lit = 1;
|
||||
if(rn2(2)) makemon(&mons[PM_GOLD_GOLEM], x+i, y+j, 0);
|
||||
mkgold((long) rn1((10+rnd(10)) * level_difficulty(),10), x+i, y+j);
|
||||
}
|
||||
}
|
||||
flood_fill_rm(x+1, y+5,
|
||||
nroom+ROOMOFFSET, TRUE, TRUE);
|
||||
add_room(x+1, y+4, x+sizebig1-2, y+6, TRUE, OROOM, TRUE);
|
||||
break;
|
||||
case 6://Tool shed
|
||||
for(i=1;i<sizebig1-1;i++){
|
||||
for(j=1+3;j<4+3;j++){
|
||||
levl[x+i][y+j].typ = CORR;
|
||||
levl[x+i][y+j].lit = 1;
|
||||
mkobj_at(TOOL_CLASS, x+i, y+j, FALSE);
|
||||
}
|
||||
}
|
||||
flood_fill_rm(x+1, y+5,
|
||||
nroom+ROOMOFFSET, TRUE, TRUE);
|
||||
add_room(x+1, y+4, x+sizebig1-2, y+6, TRUE, OROOM, TRUE);
|
||||
break;
|
||||
}
|
||||
add_door(x+sizebig1-1,y+5,&rooms[roomnumb]);
|
||||
fill_room(&rooms[roomnumb], FALSE);
|
||||
|
||||
|
@ -1281,17 +1362,17 @@ mkpluvillage()
|
|||
}
|
||||
|
||||
//Make right big building
|
||||
roomnumb = nroom;
|
||||
|
||||
levl[x+sizetot][y+4+3].typ = BRCORNER;
|
||||
levl[x+sizetot][y+4+3].lit = 1;
|
||||
levl[x+sizetot-sizebig2][y+4+3].typ = BLCORNER;
|
||||
levl[x+sizetot-sizebig2][y+4+3].lit = 1;
|
||||
for(i=sizetot-sizebig2+1;i<sizetot;i++){
|
||||
levl[x+i][y+4+3].typ = HWALL;
|
||||
levl[x+i][y+4+3].lit = 1;
|
||||
levl[x+i][y+3].typ = HWALL;
|
||||
}
|
||||
for(i=sizetot-sizebig2+1;i<sizetot;i++){
|
||||
for(j=1+3;j<4+3;j++){
|
||||
levl[x+i][y+j].typ = CORR;
|
||||
if(rn2(2)) makemon(&mons[PM_PLUMACH], x+i, y+j, 0);
|
||||
}
|
||||
levl[x+i][y+3].lit = 1;
|
||||
}
|
||||
for(i=1+3;i<4+3;i++){
|
||||
levl[x+sizetot][y+i].typ = VWALL;
|
||||
|
@ -1306,13 +1387,102 @@ mkpluvillage()
|
|||
levl[x+sizetot][y+3].typ = TRCORNER;
|
||||
levl[x+sizetot][y+3].lit = 1;
|
||||
levl[x+sizetot-sizebig2][y+3].typ = TLCORNER;
|
||||
levl[x+sizetot-sizebig2][y+3].lit = 1;
|
||||
|
||||
// mkgold((long) rn1((10+rnd(10)) * level_difficulty(),10), x+1, y+1);
|
||||
// mkgold((long) rn1((10+rnd(10)) * level_difficulty(),10), x+2, y+1);
|
||||
// mkgold((long) rn1((10+rnd(10)) * level_difficulty(),10), x+1, y+2);
|
||||
// mkgold((long) rn1((10+rnd(10)) * level_difficulty(),10), x+2, y+2);
|
||||
levl[x+sizetot-sizebig2][y+3].lit = 1;
|
||||
|
||||
// switch(rn2(6)){
|
||||
switch(rn2(7)){
|
||||
case 0: //Shop
|
||||
for(i=sizetot-sizebig2+1;i<sizetot;i++){
|
||||
for(j=1+3;j<4+3;j++){
|
||||
levl[x+i][y+j].typ = ROOM;
|
||||
levl[x+i][y+j].lit = 1;
|
||||
}
|
||||
}
|
||||
flood_fill_rm(x+sizetot-1, y+5,
|
||||
nroom+ROOMOFFSET, TRUE, TRUE);
|
||||
add_room(x+sizetot-sizebig2+1, y+4, x+sizetot-1, y+6, TRUE, SHOPBASE + rn2(UNIQUESHOP - SHOPBASE), TRUE);
|
||||
break;
|
||||
case 1: //Temple
|
||||
for(i=sizetot-sizebig2+1;i<sizetot;i++){
|
||||
for(j=1+3;j<4+3;j++){
|
||||
levl[x+i][y+j].typ = ROOM;
|
||||
levl[x+i][y+j].lit = 1;
|
||||
}
|
||||
}
|
||||
flood_fill_rm(x+sizetot-sizebig2+1, y+5,
|
||||
nroom+ROOMOFFSET, TRUE, TRUE);
|
||||
levl[x+sizetot-2][y+5].typ = ALTAR;
|
||||
levl[x+sizetot-2][y+5].altarmask = Align2amask( A_NEUTRAL );
|
||||
add_room(x+sizetot-sizebig2+1, y+4, x+sizetot-1, y+6, TRUE, TEMPLE, TRUE);
|
||||
priestini(&u.uz, &rooms[nroom - 1], x+sizetot-2, y+5, FALSE);
|
||||
levl[x+sizetot-2][y+5].altarmask |= AM_SHRINE;
|
||||
level.flags.has_temple = 1;
|
||||
break;
|
||||
case 2: //Garrison
|
||||
for(i=sizetot-sizebig2+1;i<sizetot;i++){
|
||||
for(j=1+3;j<4+3;j++){
|
||||
levl[x+i][y+j].typ = ROOM;
|
||||
levl[x+i][y+j].lit = 1;
|
||||
}
|
||||
}
|
||||
flood_fill_rm(x+sizetot-sizebig2+1, y+5,
|
||||
nroom+ROOMOFFSET, TRUE, TRUE);
|
||||
add_room(x+sizetot-sizebig2+1, y+4, x+sizetot-1, y+6, TRUE, BARRACKS, TRUE);
|
||||
break;
|
||||
case 3: //Courtroom
|
||||
if(!throne){
|
||||
for(i=sizetot-sizebig2+1;i<sizetot;i++){
|
||||
for(j=1+3;j<4+3;j++){
|
||||
levl[x+i][y+j].typ = ROOM;
|
||||
levl[x+i][y+j].lit = 1;
|
||||
}
|
||||
}
|
||||
flood_fill_rm(x+sizetot-sizebig2+1, y+5,
|
||||
nroom+ROOMOFFSET, TRUE, TRUE);
|
||||
add_room(x+sizetot-sizebig2+1, y+4, x+sizetot-1, y+6, TRUE, COURT, TRUE);
|
||||
break;
|
||||
}
|
||||
case 4: //Normal
|
||||
for(i=sizetot-sizebig2+1;i<sizetot;i++){
|
||||
for(j=1+3;j<4+3;j++){
|
||||
levl[x+i][y+j].typ = CORR;
|
||||
levl[x+i][y+j].lit = 1;
|
||||
if(rn2(2)) makemon(&mons[PM_PLUMACH], x+i, y+j, 0);
|
||||
if(rn2(2)) mkobj_at((rn2(2) ? WEAPON_CLASS : rn2(2) ? TOOL_CLASS : ARMOR_CLASS), x+i, y+j, FALSE);
|
||||
}
|
||||
}
|
||||
flood_fill_rm(x+sizetot-sizebig2+1, y+5,
|
||||
nroom+ROOMOFFSET, TRUE, TRUE);
|
||||
add_room(x+sizetot-sizebig2+1, y+4, x+sizetot-1, y+6, TRUE, OROOM, TRUE);
|
||||
break;
|
||||
case 5: //Gold vault
|
||||
for(i=sizetot-sizebig2+1;i<sizetot;i++){
|
||||
for(j=1+3;j<4+3;j++){
|
||||
levl[x+i][y+j].typ = CORR;
|
||||
levl[x+i][y+j].lit = 1;
|
||||
if(rn2(2)) makemon(&mons[PM_GOLD_GOLEM], x+i, y+j, 0);
|
||||
mkgold((long) rn1((10+rnd(10)) * level_difficulty(),10), x+i, y+j);
|
||||
}
|
||||
}
|
||||
flood_fill_rm(x+sizetot-sizebig2+1, y+5,
|
||||
nroom+ROOMOFFSET, TRUE, TRUE);
|
||||
add_room(x+sizetot-sizebig2+1, y+4, x+sizetot-1, y+6, TRUE, OROOM, TRUE);
|
||||
break;
|
||||
case 6: //Tool shed
|
||||
for(i=sizetot-sizebig2+1;i<sizetot;i++){
|
||||
for(j=1+3;j<4+3;j++){
|
||||
levl[x+i][y+j].typ = CORR;
|
||||
levl[x+i][y+j].lit = 1;
|
||||
mkobj_at(TOOL_CLASS, x+i, y+j, FALSE);
|
||||
}
|
||||
}
|
||||
flood_fill_rm(x+sizetot-sizebig2+1, y+5,
|
||||
nroom+ROOMOFFSET, TRUE, TRUE);
|
||||
add_room(x+sizetot-sizebig2+1, y+4, x+sizetot-1, y+6, TRUE, OROOM, TRUE);
|
||||
break;
|
||||
}
|
||||
add_door(x+sizetot-sizebig2,y+5,&rooms[roomnumb]);
|
||||
fill_room(&rooms[roomnumb], FALSE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1362,12 +1532,13 @@ place_lolth_vaults()
|
|||
void
|
||||
place_neutral_features()
|
||||
{
|
||||
// if(!rn2(10)){
|
||||
if(1){
|
||||
if(!rn2(10)){
|
||||
mkneuriver();
|
||||
}
|
||||
if(1){
|
||||
if(!rn2(10)){
|
||||
mkpluvillage();
|
||||
// } else if(){
|
||||
// mkferufort();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1622,7 +1793,18 @@ struct mkroom *sroom;
|
|||
} while (occupied((xchar)tx, (xchar)ty) && --i > 0);
|
||||
|
||||
levl[tx][ty].typ = THRONE;
|
||||
if(rn2(4)){
|
||||
if(In_outlands(&u.uz)){
|
||||
ctype = PM_AURUMACH;
|
||||
mon = 0;
|
||||
if(!toostrong(ctype,maxmlev+5))
|
||||
mon = makemon(&mons[ctype], tx, ty, NO_MM_FLAGS|MM_NOCOUNTBIRTH);
|
||||
if(mon) {
|
||||
mon->msleeping = 1;
|
||||
if(ctype == PM_DROW_MATRON || ctype == PM_EMBRACED_DROWESS){
|
||||
set_curhouse(mon->mfaction);
|
||||
}
|
||||
}
|
||||
} else if(rn2(4)){
|
||||
/* recalculae minlev to be stricter about weak throne monsters */
|
||||
minmlev = zlevel * 2 / 3;
|
||||
/* allow mildly out-of-depth lords */
|
||||
|
@ -1715,7 +1897,7 @@ struct mkroom *sroom;
|
|||
if(!(Role_if(PM_NOBLEMAN) && In_quest(&u.uz) )){
|
||||
mon = makemon(
|
||||
(type == COURT) ? courtmon(ctype) :
|
||||
(type == BARRACKS) ? squadmon() :
|
||||
(type == BARRACKS) ? (In_outlands(&u.uz) ? neu_squadmon() : squadmon()) :
|
||||
(type == MORGUE) ? morguemon() :
|
||||
(type == BEEHIVE) ?
|
||||
(sx == tx && sy == ty ? &mons[PM_QUEEN_BEE] :
|
||||
|
@ -2115,14 +2297,21 @@ mkswamp() /* Michiel Huisjes & Fred de Wilde */
|
|||
sx, sy, NO_MM_FLAGS);
|
||||
eelct++;
|
||||
}
|
||||
} else
|
||||
if(!rn2(4)) /* swamps tend to be moldy */
|
||||
(void) makemon(mkclass(S_FUNGUS, Inhell ? G_HELL : G_NOHELL),
|
||||
sx, sy, NO_MM_FLAGS);
|
||||
else if(!rn2(6))
|
||||
if (!rn2(2)) /* swamp ferns like swamps */
|
||||
(void) makemon(&mons[PM_SWAMP_FERN],
|
||||
sx, sy, NO_MM_FLAGS);
|
||||
} else {
|
||||
levl[sx][sy].typ = PUDDLE;
|
||||
if(!rn2(4)) /* swamps tend to be moldy */
|
||||
(void) makemon(&mons[!rn2(4) ? PM_GREEN_MOLD :
|
||||
!rn2(3) ? PM_BROWN_MOLD:
|
||||
!rn2(2) ? PM_YELLOW_MOLD:
|
||||
PM_RED_MOLD],
|
||||
sx, sy, NO_MM_FLAGS);
|
||||
else if(!rn2(6)) /* swamp ferns like swamps */
|
||||
(void) makemon(&mons[PM_SWAMP_FERN],
|
||||
sx, sy, NO_MM_FLAGS);
|
||||
else if(!rn2(6)) /* many phantom fungi */
|
||||
(void) makemon(&mons[PM_PHANTOM_FUNGUS],
|
||||
sx, sy, NO_MM_FLAGS);
|
||||
}
|
||||
}
|
||||
level.flags.has_swamp = 1;
|
||||
}
|
||||
|
@ -2295,8 +2484,10 @@ register boolean edge; /* Allows room walls to intrude slightly into river. */
|
|||
register int monster = PM_JELLYFISH;
|
||||
/* Don't liquify shop walls */
|
||||
if (level.flags.has_shop && *in_rooms(x, y, SHOPBASE)) {return;}
|
||||
if (typ!=TREE || (!edge && rn2(6)))
|
||||
{levl[x][y].typ = POOL;}
|
||||
if (typ!=TREE || (!edge && rn2(6))){
|
||||
if(typ == TREE) levl[x][y].typ = POOL;
|
||||
else levl[x][y].typ = PUDDLE;
|
||||
}
|
||||
// else if ((typ == SCORR || typ == CORR || IS_DOOR(typ)
|
||||
// || typ == SDOOR) && !IS_WALL(typ)) {
|
||||
// levl[x][y].typ = ROOM;
|
||||
|
@ -2935,6 +3126,46 @@ courtmon(kingnum)
|
|||
return &mons[PM_DROW_MUMMY];
|
||||
break;
|
||||
|
||||
case PM_AURUMACH:
|
||||
i = rnd(100);
|
||||
if(i>99)
|
||||
return &mons[PM_ARGENACH];
|
||||
else if(i>95)
|
||||
return &mons[PM_ARGENTUM_GOLEM];
|
||||
else if(i>90)
|
||||
return &mons[PM_CUPRILACH];
|
||||
else if(i>80)
|
||||
return &mons[PM_FERRUMACH];
|
||||
else if(i>60)
|
||||
return &mons[PM_PLUMACH];
|
||||
else if(i>50)
|
||||
return &mons[PM_PLAINS_CENTAUR];
|
||||
else if(i>45)
|
||||
return &mons[PM_DRYAD];
|
||||
else if(i>40)
|
||||
return &mons[PM_STONE_GIANT];
|
||||
else if(i>35)
|
||||
return &mons[PM_HILL_GIANT];
|
||||
else if(i>30)
|
||||
return &mons[PM_FROST_GIANT];
|
||||
else if(i>25)
|
||||
return &mons[PM_STORM_GIANT];
|
||||
else if(i>20)
|
||||
return &mons[PM_QUANTUM_MECHANIC];
|
||||
else if(i>15)
|
||||
return &mons[PM_SERPENT_MAN_OF_YOTH];
|
||||
else if(i>10)
|
||||
return &mons[PM_DEEP_ONE];
|
||||
else if(i>7)
|
||||
return &mons[PM_DEEPER_ONE];
|
||||
else if(i>5)
|
||||
return &mons[PM_MIND_FLAYER];
|
||||
else if(i>1)
|
||||
return &mons[PM_HOOLOOVOO];
|
||||
else
|
||||
return &mons[PM_UVUUDAUM];
|
||||
break;
|
||||
|
||||
default:
|
||||
i = rn2(60) + rn2(3*level_difficulty());
|
||||
if (i > 100) return(mkclass(S_DRAGON, Inhell ? G_HELL : G_NOHELL));
|
||||
|
@ -3030,6 +3261,8 @@ static struct {
|
|||
unsigned prob;
|
||||
} squadprob[NSTYPES] = {
|
||||
{PM_SOLDIER, 80}, {PM_SERGEANT, 15}, {PM_LIEUTENANT, 4}, {PM_CAPTAIN, 1}
|
||||
}, neu_squadprob[NSTYPES] = {
|
||||
{PM_FERRUMACH, 80}, {PM_IRON_GOLEM, 15}, {PM_ARGENTUM_GOLEM, 4}, {PM_ARGENACH, 1}
|
||||
};
|
||||
|
||||
STATIC_OVL struct permonst *
|
||||
|
@ -3054,6 +3287,28 @@ gotone:
|
|||
else return((struct permonst *) 0);
|
||||
}
|
||||
|
||||
STATIC_OVL struct permonst *
|
||||
neu_squadmon() /* return soldier types. */
|
||||
{
|
||||
int sel_prob, i, cpro, mndx;
|
||||
|
||||
sel_prob = rnd(80+level_difficulty());
|
||||
|
||||
cpro = 0;
|
||||
for (i = 0; i < NSTYPES; i++) {
|
||||
cpro += neu_squadprob[i].prob;
|
||||
if (cpro > sel_prob) {
|
||||
mndx = neu_squadprob[i].pm;
|
||||
goto gotone;
|
||||
}
|
||||
}
|
||||
mndx = neu_squadprob[rn2(NSTYPES)].pm;
|
||||
gotone:
|
||||
// if (!(mvitals[mndx].mvflags & G_GONE && !In_quest(&u.uz))) return(&mons[mndx]);
|
||||
if (!(mvitals[mndx].mvflags & G_GENOD && !In_quest(&u.uz))) return(&mons[mndx]);//empty if genocided
|
||||
else return((struct permonst *) 0);
|
||||
}
|
||||
|
||||
/*
|
||||
* save_room : A recursive function that saves a room and its subrooms
|
||||
* (if any).
|
||||
|
|
50
src/mon.c
50
src/mon.c
|
@ -338,6 +338,13 @@ register struct monst *mtmp;
|
|||
}
|
||||
goto default_1;
|
||||
|
||||
case PM_WATER_ELEMENTAL:
|
||||
if (levl[mtmp->mx][mtmp->my].typ == ROOM) {
|
||||
levl[mtmp->mx][mtmp->my].typ = PUDDLE;
|
||||
water_damage(level.objects[mtmp->mx][mtmp->my], FALSE, TRUE, level.flags.lethe, 0);
|
||||
}
|
||||
goto default_1;
|
||||
|
||||
case PM_WHITE_UNICORN:
|
||||
case PM_GRAY_UNICORN:
|
||||
case PM_BLACK_UNICORN:
|
||||
|
@ -808,13 +815,15 @@ int
|
|||
minliquid(mtmp)
|
||||
register struct monst *mtmp;
|
||||
{
|
||||
boolean inpool, inlava, infountain;
|
||||
boolean inpool, inlava, infountain, inshallow;
|
||||
|
||||
inpool = is_pool(mtmp->mx,mtmp->my) &&
|
||||
inpool = is_pool(mtmp->mx,mtmp->my, FALSE) &&
|
||||
((!is_flyer(mtmp->data) && !is_floater(mtmp->data)) || is_3dwater(mtmp->mx,mtmp->my));
|
||||
inlava = is_lava(mtmp->mx,mtmp->my) &&
|
||||
inlava = is_lava(mtmp->mx,mtmp->my) &&
|
||||
!is_flyer(mtmp->data) && !is_floater(mtmp->data);
|
||||
infountain = IS_FOUNTAIN(levl[mtmp->mx][mtmp->my].typ);
|
||||
infountain = IS_FOUNTAIN(levl[mtmp->mx][mtmp->my].typ);
|
||||
inshallow = IS_PUDDLE(levl[mtmp->mx][mtmp->my].typ) &&
|
||||
(!is_flyer(mtmp->data) && !is_floater(mtmp->data));
|
||||
|
||||
#ifdef STEED
|
||||
/* Flying and levitation keeps our steed out of the liquid */
|
||||
|
@ -827,22 +836,29 @@ register struct monst *mtmp;
|
|||
* keep going down, and when it gets to 1 hit point the clone
|
||||
* function will fail.
|
||||
*/
|
||||
if (mtmp->data == &mons[PM_GREMLIN] && (inpool || infountain) && rn2(3)) {
|
||||
if (mtmp->data == &mons[PM_GREMLIN] && (inpool || infountain || inshallow) && rn2(3)) {
|
||||
if (split_mon(mtmp, (struct monst *)0))
|
||||
dryup(mtmp->mx, mtmp->my, FALSE);
|
||||
if (inpool) water_damage(mtmp->minvent, FALSE, FALSE, level.flags.lethe, mtmp);
|
||||
return (0);
|
||||
} else if (mtmp->data == &mons[PM_IRON_GOLEM] && inpool && !rn2(5)) {
|
||||
} else if (mtmp->data == &mons[PM_IRON_GOLEM] && ((inpool && !rn2(5)) || inshallow)) {
|
||||
/* rusting requires oxygen and water, so it's faster for shallow water */
|
||||
int dam = d(2,6);
|
||||
if (cansee(mtmp->mx,mtmp->my))
|
||||
pline("%s rusts.", Monnam(mtmp));
|
||||
mtmp->mhp -= dam;
|
||||
if (mtmp->mhpmax > dam) mtmp->mhpmax -= dam;
|
||||
if (mtmp->mhp < 1) {
|
||||
if (canseemon(mtmp)) pline("%s falls to pieces!", Monnam(mtmp));
|
||||
mondead(mtmp);
|
||||
if (mtmp->mhp < 1) return (1);
|
||||
if (mtmp->mhp < 1) {
|
||||
if (mtmp->mtame && !canseemon(mtmp))
|
||||
pline("May %s rust in peace.", mon_nam(mtmp));
|
||||
return (1);
|
||||
}
|
||||
}
|
||||
water_damage(mtmp->minvent, FALSE, FALSE, level.flags.lethe, mtmp);
|
||||
if(inpool) water_damage(which_armor(mtmp, W_ARMF), FALSE, FALSE, level.flags.lethe, mtmp);
|
||||
else water_damage(mtmp->minvent, FALSE, FALSE, level.flags.lethe, mtmp);
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
@ -2025,7 +2041,7 @@ mpickstuff(mtmp, str)
|
|||
!acidic(&mons[otmp->corpsenm])) continue;
|
||||
if (!touch_artifact(otmp, mtmp, FALSE)) continue;
|
||||
if (!can_carry(mtmp,otmp)) continue;
|
||||
if (is_pool(mtmp->mx,mtmp->my)) continue;
|
||||
if (is_pool(mtmp->mx,mtmp->my, FALSE)) continue;
|
||||
#ifdef INVISIBLE_OBJECTS
|
||||
if (otmp->oinvis && !perceives(mtmp->data)) continue;
|
||||
#endif
|
||||
|
@ -2583,7 +2599,7 @@ nexttry: /* eels prefer the water, but if there is no water nearby,
|
|||
//Weeping angels should avoid stepping into corredors, where they can be forced into a standoff.
|
||||
if(quantumlock && IS_ROOM(levl[mon->mx][mon->my].typ) && !IS_ROOM(ntyp) ) continue;
|
||||
|
||||
if((is_pool(nx,ny) == wantpool || poolok) &&
|
||||
if((is_pool(nx,ny, FALSE) == wantpool || poolok) &&
|
||||
(cubewaterok || !is_3dwater(nx,ny)) &&
|
||||
(lavaok || !is_lava(nx,ny))) {
|
||||
int dispx, dispy;
|
||||
|
@ -2716,7 +2732,7 @@ impossible("A monster looked at a very strange trap of type %d.", ttmp->ttyp);
|
|||
cnt++;
|
||||
}
|
||||
}
|
||||
if(!cnt && wantpool && !is_pool(x,y)) {
|
||||
if(!cnt && wantpool && !is_pool(x,y, FALSE)) {
|
||||
wantpool = FALSE;
|
||||
goto nexttry;
|
||||
}
|
||||
|
@ -3891,17 +3907,17 @@ struct monst *mon;
|
|||
the generic fern spore, which guarantees a terrain-appropriate fern */
|
||||
if (mon->data == &mons[PM_DUNGEON_FERN_SPORE]) {
|
||||
/* dungeon ferns cannot reproduce on ice, lava, or water; swamp is okay */
|
||||
if (!is_ice(mm.x, mm.y) && !is_lava(mm.x, mm.y) && !is_pool(mm.x, mm.y))
|
||||
if (!is_ice(mm.x, mm.y) && !is_lava(mm.x, mm.y) && !is_pool(mm.x, mm.y, FALSE))
|
||||
sporetype = 0;
|
||||
else return;
|
||||
if (rn2(3)) return;
|
||||
} else if (mon->data == &mons[PM_SWAMP_FERN_SPORE]) {
|
||||
if (!is_ice(mm.x, mm.y) && !is_lava(mm.x, mm.y) && !is_pool(mm.x, mm.y))
|
||||
if (!is_ice(mm.x, mm.y) && !is_lava(mm.x, mm.y))
|
||||
sporetype = 2;
|
||||
else return;
|
||||
if (rn2(3)) return;
|
||||
} else if (mon->data == &mons[PM_BURNING_FERN_SPORE]) {
|
||||
if (!is_ice(mm.x, mm.y) && !is_pool(mm.x, mm.y))
|
||||
if (!is_ice(mm.x, mm.y) && !is_pool(mm.x, mm.y, TRUE))
|
||||
sporetype = 3;
|
||||
else return;
|
||||
if (rn2(3)) return;
|
||||
|
@ -3938,7 +3954,7 @@ register struct monst *mdef;
|
|||
if (mdef->mhp > 0) return; /* lifesaved */
|
||||
|
||||
if (corpse_chance(mdef, (struct monst *)0, FALSE) &&
|
||||
(accessible(mdef->mx, mdef->my) || is_pool(mdef->mx, mdef->my)))
|
||||
(accessible(mdef->mx, mdef->my) || is_pool(mdef->mx, mdef->my, FALSE)))
|
||||
(void) make_corpse(mdef);
|
||||
}
|
||||
|
||||
|
@ -4476,7 +4492,7 @@ xkilled(mtmp, dest)
|
|||
redisp = TRUE;
|
||||
}
|
||||
#endif
|
||||
if((!accessible(x, y) && !is_pool(x, y)) ||
|
||||
if((!accessible(x, y) && !is_pool(x, y, FALSE)) ||
|
||||
(x == u.ux && y == u.uy)) {
|
||||
/* might be mimic in wall or corpse in lava or on player's spot */
|
||||
redisp = TRUE;
|
||||
|
@ -5390,7 +5406,7 @@ boolean msg; /* "The oldmon turns into a newmon!" */
|
|||
mtmp->perminvis = pm_invisible(mdat);
|
||||
mtmp->minvis = mtmp->invis_blkd ? 0 : mtmp->perminvis;
|
||||
if (!(hides_under(mdat) && OBJ_AT(mtmp->mx, mtmp->my)) &&
|
||||
!(mdat->mlet == S_EEL && is_pool(mtmp->mx, mtmp->my)))
|
||||
!(mdat->mlet == S_EEL && is_pool(mtmp->mx, mtmp->my, FALSE)))
|
||||
mtmp->mundetected = 0;
|
||||
if (u.ustuck == mtmp) {
|
||||
if(u.uswallow) {
|
||||
|
|
|
@ -445,7 +445,7 @@ struct monst *mtmp;
|
|||
/* digging wouldn't be effective; assume they know that */
|
||||
&& !(levl[x][y].wall_info & W_NONDIGGABLE)
|
||||
&& !(Is_botlevel(&u.uz) || In_endgame(&u.uz))
|
||||
&& !(is_ice(x,y) || is_pool(x,y) || is_lava(x,y))
|
||||
&& !(is_ice(x,y) || is_pool(x,y, TRUE) || is_lava(x,y))
|
||||
&& !(mtmp->data == &mons[PM_VLAD_THE_IMPALER]
|
||||
&& In_V_tower(&u.uz))) {
|
||||
m.defensive = obj;
|
||||
|
@ -687,7 +687,7 @@ mon_tele:
|
|||
case MUSE_WAN_CREATE_MONSTER:
|
||||
{ coord cc;
|
||||
/* pm: 0 => random, eel => aquatic, croc => amphibious */
|
||||
struct permonst *pm = !is_pool(mtmp->mx, mtmp->my) ? 0 :
|
||||
struct permonst *pm = !is_pool(mtmp->mx, mtmp->my, FALSE) ? 0 :
|
||||
&mons[u.uinwater ? PM_GIANT_EEL : PM_CROCODILE];
|
||||
struct monst *mon;
|
||||
|
||||
|
@ -709,7 +709,7 @@ mon_tele:
|
|||
if (!rn2(73)) cnt += rnd(4);
|
||||
if (mtmp->mconf || otmp->cursed) cnt += 12;
|
||||
if (mtmp->mconf) pm = fish = &mons[PM_ACID_BLOB];
|
||||
else if (is_pool(mtmp->mx, mtmp->my))
|
||||
else if (is_pool(mtmp->mx, mtmp->my, FALSE))
|
||||
fish = &mons[u.uinwater ? PM_GIANT_EEL : PM_CROCODILE];
|
||||
mreadmsg(mtmp, otmp);
|
||||
while(cnt--) {
|
||||
|
|
|
@ -3437,6 +3437,14 @@ srch:
|
|||
newsym(u.ux, u.uy);
|
||||
return &zeroobj;
|
||||
}
|
||||
if(!BSTRCMP(bp, p-13, "shallow water")) {
|
||||
levl[u.ux][u.uy].typ = PUDDLE;
|
||||
del_engr_at(u.ux, u.uy);
|
||||
pline("Shallow water.");
|
||||
water_damage(level.objects[u.ux][u.uy], FALSE, TRUE, level.flags.lethe, (struct monst *) 0);
|
||||
newsym(u.ux, u.uy);
|
||||
return &zeroobj;
|
||||
}
|
||||
if (!BSTRCMP(bp, p-4, "lava")) { /* also matches "molten lava" */
|
||||
levl[u.ux][u.uy].typ = LAVAPOOL;
|
||||
del_engr_ward_at(u.ux, u.uy);
|
||||
|
|
|
@ -290,7 +290,7 @@ lookat(x, y, buf, monbuf, shapebuff)
|
|||
if(uwep && ((uwep->ovar1 & WARD_THJOFASTAFUR) &&
|
||||
((mtmp)->data->mlet == S_LEPRECHAUN || (mtmp)->data->mlet == S_NYMPH || is_thief((mtmp)->data)))) ways_seen++;
|
||||
if(youracedata == &mons[PM_SHARK] && has_blood_mon(mtmp) &&
|
||||
(mtmp)->mhp < (mtmp)->mhpmax && is_pool(u.ux, u.uy) && is_pool((mtmp)->mx, (mtmp)->my)) ways_seen++;
|
||||
(mtmp)->mhp < (mtmp)->mhpmax && is_pool(u.ux, u.uy, TRUE) && is_pool((mtmp)->mx, (mtmp)->my, TRUE)) ways_seen++;
|
||||
if(MATCH_WARN_OF_MON_STRICT(mtmp)){
|
||||
Sprintf(wbuf, "warned of %s",
|
||||
makeplural(mtmp->data->mname));
|
||||
|
@ -322,7 +322,7 @@ lookat(x, y, buf, monbuf, shapebuff)
|
|||
if (ways_seen-- > 1) Strcat(monbuf, ", ");
|
||||
}
|
||||
if(youracedata == &mons[PM_SHARK] && has_blood_mon(mtmp) &&
|
||||
(mtmp)->mhp < (mtmp)->mhpmax && is_pool(u.ux, u.uy) && is_pool((mtmp)->mx, (mtmp)->my)){
|
||||
(mtmp)->mhp < (mtmp)->mhpmax && is_pool(u.ux, u.uy, TRUE) && is_pool((mtmp)->mx, (mtmp)->my, TRUE)){
|
||||
Sprintf(wbuf, "smell blood in the water");
|
||||
Strcat(monbuf, wbuf);
|
||||
if (ways_seen-- > 1) Strcat(monbuf, ", ");
|
||||
|
@ -374,7 +374,7 @@ lookat(x, y, buf, monbuf, shapebuff)
|
|||
Strcat(buf, " embedded in a wall");
|
||||
else if (closed_door(x,y))
|
||||
Strcat(buf, " embedded in a door");
|
||||
else if (is_pool(x,y))
|
||||
else if (is_pool(x,y, FALSE))
|
||||
Strcat(buf, " in water");
|
||||
else if (is_lava(x,y))
|
||||
Strcat(buf, " in molten lava"); /* [can this ever happen?] */
|
||||
|
@ -1169,7 +1169,8 @@ do_look(quick)
|
|||
/* avoid "an air", "a water", or "a floor of a room" */
|
||||
int article = (i == S_drkroom || i == S_litroom) ? 2 : /* 2=>"the" */
|
||||
!(strcmp(x_str, "air") == 0 || /* 1=>"an" */
|
||||
strcmp(x_str, "water") == 0); /* 0=>(none)*/
|
||||
strcmp(x_str, "shallow water") == 0 || /* 0=>(none)*/
|
||||
strcmp(x_str, "water") == 0);
|
||||
|
||||
if (!found) {
|
||||
if (is_cmap_trap(i)) {
|
||||
|
|
|
@ -411,7 +411,7 @@ int what; /* should be a long */
|
|||
struct trap *ttmp = t_at(u.ux, u.uy);
|
||||
/* no auto-pick if no-pick move, nothing there, or in a pool */
|
||||
if (autopickup && (flags.nopick || !OBJ_AT(u.ux, u.uy) ||
|
||||
(is_pool(u.ux, u.uy) && !Underwater) || is_lava(u.ux, u.uy))) {
|
||||
(is_pool(u.ux, u.uy, FALSE) && !Underwater) || is_lava(u.ux, u.uy))) {
|
||||
read_engr_at(u.ux, u.uy);
|
||||
return (0);
|
||||
}
|
||||
|
@ -1545,7 +1545,7 @@ int x, y;
|
|||
#endif
|
||||
You("cannot reach the %s.", surface(x, y));
|
||||
return FALSE;
|
||||
} else if (is_pool(x, y) || is_lava(x, y)) {
|
||||
} else if (is_pool(x, y, FALSE) || is_lava(x, y)) {
|
||||
/* at present, can't loot in water even when Underwater */
|
||||
You("cannot loot things that are deep in the %s.",
|
||||
is_lava(x, y) ? "lava" : "water");
|
||||
|
|
|
@ -140,7 +140,7 @@ const char *fmt, *arg;
|
|||
}
|
||||
|
||||
if(!Levitation && !u.ustuck &&
|
||||
(is_pool(u.ux,u.uy) || is_lava(u.ux,u.uy)))
|
||||
(is_pool(u.ux,u.uy, TRUE) || is_lava(u.ux,u.uy)))
|
||||
spoteffects(TRUE);
|
||||
|
||||
see_monsters();
|
||||
|
@ -398,7 +398,7 @@ boolean forcecontrol;
|
|||
new_light_source(u.ux, u.uy, new_light,
|
||||
LS_MONSTER, (genericptr_t)&youmonst);
|
||||
}
|
||||
if (is_pool(u.ux,u.uy) && was_floating && !(Levitation || Flying) &&
|
||||
if (is_pool(u.ux,u.uy, FALSE) && was_floating && !(Levitation || Flying) &&
|
||||
!breathless(youmonst.data) && !amphibious(youmonst.data) &&
|
||||
!Swimming) drown();
|
||||
}
|
||||
|
@ -569,7 +569,7 @@ int mntmp;
|
|||
if (hides_under(youmonst.data))
|
||||
u.uundetected = OBJ_AT(u.ux, u.uy);
|
||||
else if (youmonst.data->mlet == S_EEL)
|
||||
u.uundetected = is_pool(u.ux, u.uy);
|
||||
u.uundetected = is_pool(u.ux, u.uy, FALSE);
|
||||
else
|
||||
u.uundetected = 0;
|
||||
|
||||
|
@ -653,7 +653,7 @@ int mntmp;
|
|||
}
|
||||
find_ac();
|
||||
if((!Levitation && !u.ustuck && !Flying &&
|
||||
(is_pool(u.ux,u.uy) || is_lava(u.ux,u.uy))) ||
|
||||
(is_pool(u.ux,u.uy, TRUE) || is_lava(u.ux,u.uy))) ||
|
||||
(Underwater && !Swimming))
|
||||
spoteffects(TRUE);
|
||||
if (Passes_walls && u.utrap && u.utraptype == TT_INFLOOR) {
|
||||
|
|
17
src/potion.c
17
src/potion.c
|
@ -355,10 +355,17 @@ dodrink()
|
|||
#endif
|
||||
|
||||
/* Or are you surrounded by water? */
|
||||
if (Underwater) {
|
||||
if (yn("Drink the water around you?") == 'y') {
|
||||
pline("Do you know what lives in this water!");
|
||||
return 1;
|
||||
if (Underwater || IS_PUDDLE(levl[u.ux][u.uy].typ) ||
|
||||
(is_pool(u.ux,u.uy, FALSE) && Wwalking)) {
|
||||
char buf[BUFSZ], buf2[BUFSZ];
|
||||
|
||||
Sprintf(buf,"at your %s", makeplural(body_part(FOOT)));
|
||||
Sprintf(buf2,"Drink the water %s?",
|
||||
(Underwater || (IS_PUDDLE(levl[u.ux][u.uy].typ) &&
|
||||
verysmall(youmonst.data) && !Wwalking)) ? "around you"
|
||||
: buf);
|
||||
if (yn(buf2) == 'y') {
|
||||
pline("Do you know what lives in this water?!");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2301,7 +2308,7 @@ dodip()
|
|||
dipfountain(obj);
|
||||
return(1);
|
||||
}
|
||||
} else if (is_pool(u.ux,u.uy)) {
|
||||
} else if (is_pool(u.ux,u.uy, TRUE)) {
|
||||
tmp = waterbody_name(u.ux,u.uy);
|
||||
#ifdef PARANOID
|
||||
Sprintf(qbuf, "Dip %s into the %s?", the(xname(obj)), tmp);
|
||||
|
|
|
@ -718,7 +718,7 @@ struct permonst *
|
|||
neutral_montype()
|
||||
{
|
||||
if(on_level(&sum_of_all_level,&u.uz)){
|
||||
return mkclass(S_GOLEM, G_NOHELL|G_HELL);
|
||||
return mkclass(S_NEU_OUTSIDER, G_NOHELL|G_HELL);
|
||||
}
|
||||
if(on_level(&rlyeh_level,&u.uz)){
|
||||
int chance = d(1,100);
|
||||
|
|
|
@ -1904,7 +1904,7 @@ struct obj *sobj;
|
|||
else{
|
||||
engrHere->ward_id = sobj->ovar1;
|
||||
if(sobj->cursed){
|
||||
if(is_pool(u.ux, u.uy)){
|
||||
if(is_pool(u.ux, u.uy, TRUE)){
|
||||
pline("The lines of blood quickly disperse into the water.");
|
||||
break;
|
||||
}
|
||||
|
|
18
src/region.c
18
src/region.c
|
@ -439,7 +439,8 @@ In_fog_cloud(mon)
|
|||
for (i = 0; i < n_regions; i++) {
|
||||
/* Check if player is inside region */
|
||||
f_indx = regions[i]->inside_f;
|
||||
if (f_indx == INSIDE_FOG_CLOUD && mon_in_region(regions[i], mon)){
|
||||
// if (f_indx == INSIDE_FOG_CLOUD && mon_in_region(regions[i], mon)){
|
||||
if (f_indx == INSIDE_FOG_CLOUD && inside_region(regions[i], mon->mx, mon->my)){
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
@ -513,6 +514,21 @@ xchar x, y;
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
boolean
|
||||
check_solid_fog_region(x, y)
|
||||
xchar x, y;
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < n_regions; i++) {
|
||||
if (regions[i]->inside_f == INSIDE_FOG_CLOUD &&
|
||||
inside_region(regions[i], x, y)
|
||||
) {
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* check wether a monster enters/leaves one or more region.
|
||||
*/
|
||||
|
|
|
@ -58,7 +58,7 @@ dosit()
|
|||
else
|
||||
You("are sitting on air.");
|
||||
return 0;
|
||||
} else if (is_pool(u.ux, u.uy) && !Underwater) { /* water walking */
|
||||
} else if (is_pool(u.ux, u.uy, TRUE) && !Underwater) { /* water walking */
|
||||
goto in_water;
|
||||
}
|
||||
|
||||
|
@ -120,7 +120,7 @@ dosit()
|
|||
There("are no cushions floating nearby.");
|
||||
else
|
||||
You("sit down on the muddy bottom.");
|
||||
} else if(is_pool(u.ux, u.uy)) {
|
||||
} else if(is_pool(u.ux, u.uy, TRUE)) {
|
||||
in_water:
|
||||
You("sit in the water.");
|
||||
if (!rn2(10) && uarm)
|
||||
|
|
|
@ -3089,7 +3089,7 @@ int tx,ty;
|
|||
if(u.sealTimeout[EURYNOME-FIRST_SEAL] < moves){
|
||||
//Spirit requires that her seal be drawn before some water.
|
||||
if(isok(tx+(tx-u.ux), ty+(ty-u.uy)) &&
|
||||
IS_POOL(levl[tx+(tx-u.ux)][ty+(ty-u.uy)].typ)
|
||||
IS_PUDDLE_OR_POOL(levl[tx+(tx-u.ux)][ty+(ty-u.uy)].typ)
|
||||
){
|
||||
if(!Blind)
|
||||
You("see a figure dancing, far out upon the waters.");
|
||||
|
|
|
@ -218,11 +218,12 @@ register int humidity;
|
|||
if (humidity & DRY) {
|
||||
typ = levl[x][y].typ;
|
||||
if (typ == ROOM || typ == AIR ||
|
||||
typ == CLOUD || typ == ICE || typ == CORR)
|
||||
typ == CLOUD || typ == ICE ||
|
||||
typ == CORR || typ == PUDDLE)
|
||||
return TRUE;
|
||||
}
|
||||
if (humidity & WET) {
|
||||
if (is_pool(x,y) || is_lava(x,y))
|
||||
if (is_pool(x,y, FALSE) || is_lava(x,y))
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
|
|
|
@ -583,7 +583,7 @@ dismount_steed(reason)
|
|||
|
||||
/* The steed may drop into water/lava */
|
||||
if (!is_flyer(mdat) && !is_floater(mdat) && !is_clinger(mdat)) {
|
||||
if (is_pool(u.ux, u.uy)) {
|
||||
if (is_pool(u.ux, u.uy, FALSE)) {
|
||||
if (!Underwater)
|
||||
pline("%s falls into the %s!", Monnam(mtmp),
|
||||
surface(u.ux, u.uy));
|
||||
|
|
|
@ -61,7 +61,7 @@ unsigned gpflags;
|
|||
if (mtmp == &youmonst)
|
||||
return !!(Amphibious);
|
||||
else return (is_swimmer(mdat) || breathless_mon(mtmp) || amphibious(mdat));
|
||||
} else if (is_pool(x,y) && !ignorewater) {
|
||||
} else if (is_pool(x,y, FALSE) && !ignorewater) {
|
||||
if (mtmp == &youmonst)
|
||||
return !!(HLevitation || Flying || Wwalking ||
|
||||
Swimming || Amphibious);
|
||||
|
@ -78,7 +78,7 @@ unsigned gpflags;
|
|||
if (passes_walls(mdat) && may_passwall(x,y)) return TRUE;
|
||||
}
|
||||
if (!ACCESSIBLE(levl[x][y].typ)) {
|
||||
if (!(is_pool(x,y) && ignorewater)) return FALSE;
|
||||
if (!(is_pool(x,y, FALSE) && ignorewater)) return FALSE;
|
||||
}
|
||||
|
||||
if (closed_door(x, y) && (!mdat || !amorphous(mdat)))
|
||||
|
@ -486,7 +486,7 @@ boolean allow_drag;
|
|||
if (hides_under(youracedata))
|
||||
u.uundetected = OBJ_AT(nux, nuy);
|
||||
else if (youracedata->mlet == S_EEL)
|
||||
u.uundetected = is_pool(nux, nuy);
|
||||
u.uundetected = is_pool(nux, nuy, FALSE);
|
||||
else {
|
||||
u.uundetected = 0;
|
||||
/* mimics stop being unnoticed */
|
||||
|
|
|
@ -503,7 +503,7 @@ nh_timeout()
|
|||
|
||||
if(u.divetimer<=0){
|
||||
You("can't hold your breath any longer.");
|
||||
if((!Swimming && !Amphibious && is_pool(u.ux,u.uy)) || is_3dwater(u.ux,u.uy)) drown();
|
||||
if((!Swimming && !Amphibious && is_pool(u.ux,u.uy, FALSE)) || is_3dwater(u.ux,u.uy)) drown();
|
||||
u.usubwater = 0;
|
||||
vision_full_recalc = 1;
|
||||
vision_recalc(2); /* unsee old position */
|
||||
|
@ -829,7 +829,7 @@ long timeout;
|
|||
losehp(d(2,5), "carrying live explosives", KILLED_BY);
|
||||
break;
|
||||
case OBJ_FLOOR:
|
||||
underwater = is_pool(x, y);
|
||||
underwater = is_pool(x, y, FALSE);
|
||||
if (!silent) {
|
||||
if (x == u.ux && y == u.uy) {
|
||||
if (underwater && (Flying || Levitation))
|
||||
|
@ -1045,7 +1045,7 @@ long timeout;
|
|||
s_suffix(a_monnam(egg->ocarry)));
|
||||
knows_egg = TRUE;
|
||||
}
|
||||
else if (is_pool(mon->mx, mon->my))
|
||||
else if (is_pool(mon->mx, mon->my, FALSE))
|
||||
Strcpy(carriedby, "empty water");
|
||||
else
|
||||
Strcpy(carriedby, "thin air");
|
||||
|
@ -1128,7 +1128,7 @@ slip_or_trip()
|
|||
if (u.usteed) on_foot = FALSE;
|
||||
#endif
|
||||
|
||||
if (otmp && on_foot && !u.uinwater && is_pool(u.ux, u.uy)) otmp = 0;
|
||||
if (otmp && on_foot && !u.uinwater && is_pool(u.ux, u.uy, FALSE)) otmp = 0;
|
||||
|
||||
if (otmp && on_foot) { /* trip over something in particular */
|
||||
/*
|
||||
|
|
52
src/trap.c
52
src/trap.c
|
@ -283,6 +283,14 @@ register int x, y, typ;
|
|||
case ROLLING_BOULDER_TRAP: /* boulder will roll towards trigger */
|
||||
(void) mkroll_launch(ttmp, x, y, BOULDER, 1L);
|
||||
break;
|
||||
case RUST_TRAP:
|
||||
if (!rn2(4)) {
|
||||
del_engr_at(x, y);
|
||||
levl[x][y].typ = PUDDLE;
|
||||
water_damage(level.objects[x][y], FALSE, TRUE, level.flags.lethe, 0);
|
||||
newsym(x, y);
|
||||
}
|
||||
break;
|
||||
case HOLE:
|
||||
case PIT:
|
||||
case SPIKED_PIT:
|
||||
|
@ -312,6 +320,7 @@ register int x, y, typ;
|
|||
break;
|
||||
}
|
||||
if (ttmp->ttyp == HOLE) ttmp->tseen = 1; /* You can't hide a hole */
|
||||
else if (ttmp->ttyp == MAGIC_PORTAL && In_neu(&u.uz)) ttmp->tseen = 1; /* Just make portals known */
|
||||
else ttmp->tseen = 0;
|
||||
ttmp->once = 0;
|
||||
ttmp->madeby_u = 0;
|
||||
|
@ -1675,7 +1684,7 @@ long ocount;
|
|||
cc.x = x; cc.y = y;
|
||||
/* Prevent boulder from being placed on water */
|
||||
if (ttmp->ttyp == ROLLING_BOULDER_TRAP
|
||||
&& is_pool(x+distance*dx,y+distance*dy))
|
||||
&& is_pool(x+distance*dx,y+distance*dy, FALSE))
|
||||
success = FALSE;
|
||||
else success = isclearpath(&cc, distance, dx, dy);
|
||||
if (ttmp->ttyp == ROLLING_BOULDER_TRAP) {
|
||||
|
@ -1991,6 +2000,26 @@ glovecheck: target = which_armor(mtmp, W_ARMG);
|
|||
}
|
||||
case FIRE_TRAP:
|
||||
mfiretrap:
|
||||
if (IS_PUDDLE(levl[mtmp->mx][mtmp->my].typ)) {
|
||||
if (in_sight)
|
||||
pline("A cascade of steamy bubbles erupts from the %s under %s!",
|
||||
surface(mtmp->mx,mtmp->my), mon_nam(mtmp));
|
||||
else if (see_it) You("see a cascade of steamy bubbles erupt from the %s!",
|
||||
surface(mtmp->mx,mtmp->my));
|
||||
if(rn2(2)) {
|
||||
if (in_sight) pline_The("water evaporates!");
|
||||
levl[mtmp->mx][mtmp->my].typ = ROOM;
|
||||
}
|
||||
if (resists_fire(mtmp)) {
|
||||
if (in_sight) {
|
||||
shieldeff(mtmp->mx,mtmp->my);
|
||||
pline("%s is uninjured.", Monnam(mtmp));
|
||||
}
|
||||
} else if (thitm(0, mtmp, (struct obj *)0, rnd(3), FALSE))
|
||||
trapkilled = TRUE;
|
||||
if (see_it) seetrap(trap);
|
||||
break;
|
||||
}
|
||||
if (in_sight)
|
||||
pline("A %s erupts from the %s under %s!",
|
||||
tower_of_flame,
|
||||
|
@ -2505,7 +2534,7 @@ long hmask, emask; /* might cancel timeout */
|
|||
}
|
||||
|
||||
if (Punished && !carried(uball) &&
|
||||
(is_pool(uball->ox, uball->oy) ||
|
||||
(is_pool(uball->ox, uball->oy, FALSE) ||
|
||||
((trap = t_at(uball->ox, uball->oy)) &&
|
||||
((trap->ttyp == PIT) || (trap->ttyp == SPIKED_PIT) ||
|
||||
(trap->ttyp == TRAPDOOR) || (trap->ttyp == HOLE))))) {
|
||||
|
@ -2536,7 +2565,7 @@ long hmask, emask; /* might cancel timeout */
|
|||
* Use knowledge of the two routines as a hack -- this
|
||||
* should really be handled differently -dlc
|
||||
*/
|
||||
if(is_pool(u.ux,u.uy) && !Wwalking && !Swimming && !u.uinwater)
|
||||
if(is_pool(u.ux,u.uy, FALSE) && !Wwalking && !Swimming && !u.uinwater)
|
||||
no_msg = drown();
|
||||
|
||||
if(is_lava(u.ux,u.uy)) {
|
||||
|
@ -2559,7 +2588,7 @@ long hmask, emask; /* might cancel timeout */
|
|||
boolean sokoban_trap = (In_sokoban(&u.uz) && trap);
|
||||
if (Hallucination)
|
||||
pline("Bummer! You've %s.",
|
||||
is_pool(u.ux,u.uy) ?
|
||||
is_pool(u.ux,u.uy, TRUE) ?
|
||||
"splashed down" : sokoban_trap ? "crashed" :
|
||||
"hit the ground");
|
||||
else {
|
||||
|
@ -2624,11 +2653,16 @@ struct obj *box; /* null for floor trap */
|
|||
* to be done upon its contents.
|
||||
*/
|
||||
|
||||
if ((box && !carried(box)) ? is_pool(box->ox, box->oy) : Underwater) {
|
||||
if ((box && !carried(box)) ? (is_pool(box->ox, box->oy, FALSE)) :
|
||||
(Underwater || IS_PUDDLE(levl[u.ux][u.uy].typ))) {
|
||||
pline("A cascade of steamy bubbles erupts from %s!",
|
||||
the(box ? xname(box) : surface(u.ux,u.uy)));
|
||||
if (Fire_resistance) You("are uninjured.");
|
||||
else losehp(rnd(3), "boiling water", KILLED_BY);
|
||||
if (IS_PUDDLE(levl[u.ux][u.uy].typ) && rn2(2)) {
|
||||
pline_The("water evaporates!");
|
||||
levl[u.ux][u.uy].typ = ROOM;
|
||||
}
|
||||
return;
|
||||
}
|
||||
pline("A %s %s from %s!", tower_of_flame,
|
||||
|
@ -2995,7 +3029,9 @@ struct monst *owner;
|
|||
case POTION_CLASS:
|
||||
if (obj->otyp == POT_ACID) {
|
||||
/* damage player/monster? */
|
||||
pline("A potion explodes!");
|
||||
if (cansee(obj->ox,obj->oy) &&
|
||||
obj->where != OBJ_CONTAINED)
|
||||
pline("%s!", aobjnam(obj, "explode"));
|
||||
delobj(obj);
|
||||
obj_destroyed = (obj == obj_original);
|
||||
continue;
|
||||
|
@ -3262,14 +3298,14 @@ drown()
|
|||
You("attempt a teleport spell."); /* utcsri!carroll */
|
||||
if (!level.flags.noteleport) {
|
||||
(void) dotele();
|
||||
if(!is_pool(u.ux,u.uy))
|
||||
if(!is_pool(u.ux,u.uy, FALSE))
|
||||
return(TRUE);
|
||||
} else pline_The("attempted teleport spell fails.");
|
||||
}
|
||||
#ifdef STEED
|
||||
if (u.usteed) {
|
||||
dismount_steed(DISMOUNT_GENERIC);
|
||||
if(!is_pool(u.ux,u.uy))
|
||||
if(!is_pool(u.ux,u.uy, FALSE))
|
||||
return(TRUE);
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -3112,7 +3112,7 @@ register struct attack *mattk;
|
|||
}
|
||||
} else if(u.ustuck == mdef) {
|
||||
/* Monsters don't wear amulets of magical breathing */
|
||||
if (is_pool(u.ux,u.uy) && !is_swimmer(mdef->data) &&
|
||||
if (is_pool(u.ux,u.uy, FALSE) && !is_swimmer(mdef->data) &&
|
||||
!amphibious(mdef->data)) {
|
||||
You("drown %s...", mon_nam(mdef));
|
||||
tmp = mdef->mhp;
|
||||
|
|
|
@ -601,7 +601,7 @@ vision_recalc(control)
|
|||
|
||||
for (row = u.uy-1; row <= u.uy+1; row++)
|
||||
for (col = u.ux-1; col <= u.ux+1; col++) {
|
||||
if (!isok(col,row) || !is_pool(col,row)) continue;
|
||||
if (!isok(col,row) || !is_pool(col,row, TRUE)) continue;
|
||||
|
||||
next_rmin[row] = min(next_rmin[row], col);
|
||||
next_rmax[row] = max(next_rmax[row], col);
|
||||
|
|
|
@ -214,7 +214,7 @@ struct monst *mon;
|
|||
|
||||
/* trident is highly effective against swimmers */
|
||||
if (otmp->otyp == TRIDENT && is_swimmer(ptr)) {
|
||||
if (is_pool(mon->mx, mon->my)) tmp += 4;
|
||||
if (is_pool(mon->mx, mon->my, FALSE)) tmp += 4;
|
||||
else if (ptr->mlet == S_EEL || ptr->mlet == S_SNAKE) tmp += 2;
|
||||
}
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ register struct monst *mon;
|
|||
!(is_yochlol(mon->data) && mon->mhp < .5*mon->mhpmax)
|
||||
) return;
|
||||
|
||||
if(mon->data == &mons[PM_NOVIERE_ELADRIN] && !is_pool(mon->mx, mon->my)) return;
|
||||
if(mon->data == &mons[PM_NOVIERE_ELADRIN] && !is_pool(mon->mx, mon->my, FALSE)) return;
|
||||
|
||||
if (is_human(mon->data)) {
|
||||
if (!Protection_from_shape_changers &&
|
||||
|
|
39
src/zap.c
39
src/zap.c
|
@ -2692,10 +2692,12 @@ struct obj *obj; /* wand or spell */
|
|||
*/
|
||||
e = engr_at(u.ux, u.uy);
|
||||
if (!(e && e->engr_type == ENGRAVE)) {
|
||||
if (is_pool(u.ux, u.uy) || is_ice(u.ux, u.uy))
|
||||
if (is_pool(u.ux, u.uy, FALSE) || is_ice(u.ux, u.uy))
|
||||
pline1(nothing_happens);
|
||||
else
|
||||
pline("Blood %ss %s your %s.",
|
||||
else if (IS_PUDDLE(levl[u.ux][u.uy].typ))
|
||||
pline("The water at your %s turns slightly %s.",
|
||||
makeplural(body_part(FOOT)), hcolor(NH_RED));
|
||||
else pline("Blood %ss %s your %s.",
|
||||
is_lava(u.ux, u.uy) ? "boil" : "pool",
|
||||
Levitation ? "beneath" : "at",
|
||||
makeplural(body_part(FOOT)));
|
||||
|
@ -3147,7 +3149,7 @@ boolean *obj_destroyed;/* has object been deallocated? Pointer to boolean, may b
|
|||
delay_output();
|
||||
/* kicked objects fall in pools */
|
||||
if((weapon == KICKED_WEAPON) &&
|
||||
(is_pool(bhitpos.x, bhitpos.y) ||
|
||||
(is_pool(bhitpos.x, bhitpos.y, TRUE) ||
|
||||
is_lava(bhitpos.x, bhitpos.y)))
|
||||
break;
|
||||
#ifdef SINKS
|
||||
|
@ -4231,25 +4233,28 @@ xchar x, y;
|
|||
else { /* lev->typ == ICE */
|
||||
#ifdef STUPID
|
||||
if (lev->icedpool == ICED_POOL) lev->typ = POOL;
|
||||
if (lev->icedpool == ICED_PUDDLE) lev->typ = PUDDLE;
|
||||
else lev->typ = MOAT;
|
||||
#else
|
||||
lev->typ = (lev->icedpool == ICED_POOL ? POOL : MOAT);
|
||||
lev->typ = (lev->icedpool == ICED_POOL ? POOL :
|
||||
lev->icedpool == ICED_PUDDLE ? PUDDLE : MOAT);
|
||||
#endif
|
||||
lev->icedpool = 0;
|
||||
}
|
||||
obj_ice_effects(x, y, FALSE);
|
||||
unearth_objs(x, y);
|
||||
if (lev->typ != PUDDLE)
|
||||
unearth_objs(x, y);
|
||||
if (Underwater) vision_recalc(1);
|
||||
newsym(x,y);
|
||||
if (cansee(x,y)) Norep("The ice crackles and melts.");
|
||||
if ((otmp = boulder_at(x, y)) != 0) {
|
||||
if (lev->typ != PUDDLE && (otmp = boulder_at(x, y)) != 0) {
|
||||
if (cansee(x,y)) pline("%s settles...", An(xname(otmp)));
|
||||
do {
|
||||
obj_extract_self(otmp); /* boulder isn't being pushed */
|
||||
if (!boulder_hits_pool(otmp, x, y, FALSE))
|
||||
impossible("melt_ice: no pool?");
|
||||
/* try again if there's another boulder and pool didn't fill */
|
||||
} while (is_pool(x,y) && (otmp = boulder_at(x, y)) != 0);
|
||||
} while (is_pool(x,y, FALSE) && (otmp = boulder_at(x, y)) != 0);
|
||||
newsym(x,y);
|
||||
}
|
||||
if (x == u.ux && y == u.uy)
|
||||
|
@ -4283,9 +4288,9 @@ boolean *shopdamage;
|
|||
}
|
||||
if(is_ice(x, y)) {
|
||||
melt_ice(x, y);
|
||||
} else if(is_pool(x,y)) {
|
||||
} else if(is_pool(x,y, TRUE)) {
|
||||
const char *msgtxt = "You hear hissing gas.";
|
||||
if(lev->typ != POOL) { /* MOAT or DRAWBRIDGE_UP */
|
||||
if(lev->typ != POOL || IS_PUDDLE(lev->typ)) { /* MOAT or DRAWBRIDGE_UP */
|
||||
if (cansee(x,y)) msgtxt = "Some water evaporates.";
|
||||
} else {
|
||||
register struct trap *ttmp;
|
||||
|
@ -4303,12 +4308,18 @@ boolean *shopdamage;
|
|||
pline("Steam billows from the fountain.");
|
||||
rangemod -= 1;
|
||||
dryup(x, y, type > 0);
|
||||
} else if (IS_PUDDLE(lev->typ)) {
|
||||
rangemod -= 3;
|
||||
lev->typ = ROOM;
|
||||
if (cansee(x,y)) pline("The water evaporates.");
|
||||
else You_hear("hissing gas.");
|
||||
}
|
||||
}
|
||||
else if(abstype == ZT_COLD && (is_pool(x,y) || is_lava(x,y))) {
|
||||
else if(abstype == ZT_COLD && (is_pool(x,y, TRUE) || is_lava(x,y))) {
|
||||
boolean lava = is_lava(x,y);
|
||||
boolean moat = (!lava && (lev->typ != POOL) &&
|
||||
(lev->typ != WATER) &&
|
||||
(lev->typ != PUDDLE) &&
|
||||
!Is_medusa_level(&u.uz) &&
|
||||
!Is_waterlevel(&u.uz));
|
||||
|
||||
|
@ -4327,10 +4338,12 @@ boolean *shopdamage;
|
|||
} else {
|
||||
if (!lava)
|
||||
lev->icedpool =
|
||||
(lev->typ == POOL ? ICED_POOL : ICED_MOAT);
|
||||
(lev->typ == POOL ? ICED_POOL :
|
||||
lev->typ == PUDDLE ? ICED_PUDDLE : ICED_MOAT);
|
||||
lev->typ = (lava ? ROOM : ICE);
|
||||
}
|
||||
bury_objs(x,y);
|
||||
if (lev->icedpool != ICED_PUDDLE)
|
||||
bury_objs(x,y);
|
||||
if(cansee(x,y)) {
|
||||
if(moat)
|
||||
Norep("The moat is bridged with ice!");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue