Merge branch 'NetHack-3.6.2-beta01' into win-minor

This commit is contained in:
nhmall
2018-12-14 23:11:37 -05:00
2 changed files with 57 additions and 41 deletions

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 uhitm.c $NHDT-Date: 1543892215 2018/12/04 02:56:55 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.195 $ */
/* NetHack 3.6 uhitm.c $NHDT-Date: 1544840256 2018/12/15 02:17:36 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.196 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2012. */
/* NetHack may be freely redistributed. See license for details. */
@@ -101,7 +101,7 @@ attack_checks(mtmp, wep)
register struct monst *mtmp;
struct obj *wep; /* uwep for attack(), null for kick_monster() */
{
char qbuf[QBUFSZ];
int glyph;
/* if you're close enough to attack, alert any waiting monster */
mtmp->mstrategy &= ~STRAT_WAITMASK;
@@ -124,6 +124,12 @@ struct obj *wep; /* uwep for attack(), null for kick_monster() */
return FALSE;
}
/* cache the shown glyph;
cases which might change it (by placing or removing
'rembered, unseen monster' glyph or revealing a mimic)
always return without further reference to this */
glyph = glyph_at(bhitpos.x, bhitpos.y);
/* Put up an invisible monster marker, but with exceptions for
* monsters that hide and monsters you've been warned about.
* The former already prints a warning message and
@@ -132,8 +138,8 @@ struct obj *wep; /* uwep for attack(), null for kick_monster() */
* happening two turns in a row. The latter shows a glyph on
* the screen, so you know something is there.
*/
if (!canspotmon(mtmp) && !glyph_is_warning(glyph_at(bhitpos.x, bhitpos.y))
&& !glyph_is_invisible(levl[bhitpos.x][bhitpos.y].glyph)
if (!canspotmon(mtmp)
&& !glyph_is_warning(glyph) && !glyph_is_invisible(glyph)
&& !(!Blind && mtmp->mundetected && hides_under(mtmp->data))) {
pline("Wait! There's %s there you can't see!", something);
map_invisible(bhitpos.x, bhitpos.y);
@@ -146,17 +152,23 @@ struct obj *wep; /* uwep for attack(), null for kick_monster() */
if (!u.ustuck && !mtmp->mflee && dmgtype(mtmp->data, AD_STCK))
u.ustuck = mtmp;
}
/* #H7329 - if hero is on engraved "Elbereth", this will end up
* assessing an alignment penalty and removing the engraving
* even though no attack actually occurs. Since it also angers
* peacefuls, we're operating as if an attack attempt did occur
* and the Elbereth behavior is consistent.
*/
wakeup(mtmp, TRUE); /* always necessary; also un-mimics mimics */
return TRUE;
}
if (mtmp->m_ap_type && !Protection_from_shape_changers && !sensemon(mtmp)
&& !glyph_is_warning(glyph_at(bhitpos.x, bhitpos.y))) {
&& !glyph_is_warning(glyph)) {
/* If a hidden mimic was in a square where a player remembers
* some (probably different) unseen monster, the player is in
* luck--he attacks it even though it's hidden.
*/
if (glyph_is_invisible(levl[mtmp->mx][mtmp->my].glyph)) {
if (glyph_is_invisible(glyph)) {
seemimic(mtmp);
return FALSE;
}
@@ -165,11 +177,11 @@ struct obj *wep; /* uwep for attack(), null for kick_monster() */
}
if (mtmp->mundetected && !canseemon(mtmp)
&& !glyph_is_warning(glyph_at(bhitpos.x, bhitpos.y))
&& !glyph_is_warning(glyph)
&& (hides_under(mtmp->data) || mtmp->data->mlet == S_EEL)) {
mtmp->mundetected = mtmp->msleeping = 0;
newsym(mtmp->mx, mtmp->my);
if (glyph_is_invisible(levl[mtmp->mx][mtmp->my].glyph)) {
if (glyph_is_invisible(glyph)) {
seemimic(mtmp);
return FALSE;
}
@@ -197,14 +209,16 @@ struct obj *wep; /* uwep for attack(), null for kick_monster() */
wakeup(mtmp, TRUE);
}
if (flags.confirm && mtmp->mpeaceful && !Confusion && !Hallucination
&& !Stunned) {
if (flags.confirm && mtmp->mpeaceful
&& !Confusion && !Hallucination && !Stunned) {
/* Intelligent chaotic weapons (Stormbringer) want blood */
if (wep && wep->oartifact == ART_STORMBRINGER) {
override_confirmation = TRUE;
return FALSE;
}
if (canspotmon(mtmp)) {
char qbuf[QBUFSZ];
Sprintf(qbuf, "Really attack %s?", mon_nam(mtmp));
if (!paranoid_query(ParanoidHit, qbuf)) {
context.move = 0;
@@ -329,23 +343,26 @@ register struct monst *mtmp;
/* Intelligent chaotic weapons (Stormbringer) want blood */
if (is_safepet(mtmp) && !context.forcefight) {
if (!uwep || uwep->oartifact != ART_STORMBRINGER) {
/* there are some additional considerations: this won't work
/* There are some additional considerations: this won't work
* if in a shop or Punished or you miss a random roll or
* if you can walk thru walls and your pet cannot (KAA) or
* if your pet is a long worm (unless someone does better).
* there's also a chance of displacing a "frozen" monster.
* if your pet is a long worm with a tail.
* There's also a chance of displacing a "frozen" monster:
* sleeping monsters might magically walk in their sleep.
*/
boolean foo = (Punished || !rn2(7) || is_longworm(mtmp->data)),
boolean foo = (Punished || !rn2(7)
|| (is_longworm(mtmp->data) && mtmp->wormno)),
inshop = FALSE;
char *p;
for (p = in_rooms(mtmp->mx, mtmp->my, SHOPBASE); *p; p++)
if (tended_shop(&rooms[*p - ROOMOFFSET])) {
inshop = TRUE;
break;
}
/* only check for in-shop if don't already have reason to stop */
if (!foo) {
for (p = in_rooms(mtmp->mx, mtmp->my, SHOPBASE); *p; p++)
if (tended_shop(&rooms[*p - ROOMOFFSET])) {
inshop = TRUE;
break;
}
}
if (inshop || foo || (IS_ROCK(levl[u.ux][u.uy].typ)
&& !passes_walls(mtmp->data))) {
char buf[BUFSZ];
@@ -895,7 +912,7 @@ int dieroll;
if (resists_ston(mon))
break;
/* note: hp may be <= 0 even if munstoned==TRUE */
return (boolean) (!DEADMONSTER(mon));
return (boolean) !DEADMONSTER(mon);
#if 0
} else if (touch_petrifies(mdat)) {
; /* maybe turn the corpse into a statue? */

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 wintty.c $NHDT-Date: 1526909614 2018/05/21 13:33:34 $ $NHDT-Branch: NetHack-3.6.2 $:$NHDT-Revision: 1.167 $ */
/* NetHack 3.6 wintty.c $NHDT-Date: 1544842261 2018/12/15 02:51:01 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.188 $ */
/* Copyright (c) David Cohrs, 1991 */
/* NetHack may be freely redistributed. See license for details. */
@@ -3512,31 +3512,30 @@ static struct tty_status_fields
static int hpbar_percent, hpbar_color;
static struct condition_t {
long mask;
const char *text[3]; /* 3: potential display values, progressively
* smaller */
const char *text[3]; /* 3: potential display vals, progressively shorter */
} conditions[] = {
/* The sequence order of these matters */
{ BL_MASK_STONE, {"Stone", "Ston", "Sto"}},
{ BL_MASK_SLIME, {"Slime", "Slim", "Slm"}},
{ BL_MASK_STRNGL, {"Strngl", "Stngl", "Str"}},
{ BL_MASK_FOODPOIS, {"FoodPois", "Fpois", "Poi"}},
{ BL_MASK_TERMILL, {"TermIll" , "Ill", "Ill"}},
{ BL_MASK_BLIND, {"Blind", "Blnd", "Bl"}},
{ BL_MASK_DEAF, {"Deaf", "Def", "Df"}},
{ BL_MASK_STUN, {"Stun", "Stun", "St"}},
{ BL_MASK_CONF, {"Conf", "Cnf", "Cn"}},
{ BL_MASK_HALLU, {"Hallu", "Hal", "Ha"}},
{ BL_MASK_LEV, {"Lev", "Lev", "Lv"}},
{ BL_MASK_FLY, {"Fly", "Fly", "Fl"}},
{ BL_MASK_RIDE, {"Ride", "Rid", "Ri"}},
{ BL_MASK_STONE, { "Stone", "Ston", "Sto" } },
{ BL_MASK_SLIME, { "Slime", "Slim", "Slm" } },
{ BL_MASK_STRNGL, { "Strngl", "Stngl", "Str" } },
{ BL_MASK_FOODPOIS, { "FoodPois", "Fpois", "Poi" } },
{ BL_MASK_TERMILL, { "TermIll" , "Ill", "Ill" } },
{ BL_MASK_BLIND, { "Blind", "Blnd", "Bl" } },
{ BL_MASK_DEAF, { "Deaf", "Def", "Df" } },
{ BL_MASK_STUN, { "Stun", "Stun", "St" } },
{ BL_MASK_CONF, { "Conf", "Cnf", "Cf" } },
{ BL_MASK_HALLU, { "Hallu", "Hal", "Hl" } },
{ BL_MASK_LEV, { "Lev", "Lev", "Lv" } },
{ BL_MASK_FLY, { "Fly", "Fly", "Fl" } },
{ BL_MASK_RIDE, { "Ride", "Rid", "Rd" } },
};
static const char *encvals[3][6] = {
{ "", "Burdened", "Stressed", "Strained", "Overtaxed", "Overloaded"},
{ "", "Burden", "Stress", "Strain", "Overtax", "Overload" },
{ "", "Brd", "Strs", "Strn", "Ovtx", "Ovld" }
{ "", "Burdened", "Stressed", "Strained", "Overtaxed", "Overloaded" },
{ "", "Burden", "Stress", "Strain", "Overtax", "Overload" },
{ "", "Brd", "Strs", "Strn", "Ovtx", "Ovld" }
};
#define MAX_PER_ROW 15
static enum statusfields fieldorder[2][MAX_PER_ROW] = { /* 2: two status lines */
static enum statusfields fieldorder[2][MAX_PER_ROW] = { /* 2: 2 status lines */
{ BL_TITLE, BL_STR, BL_DX, BL_CO, BL_IN, BL_WI, BL_CH, BL_ALIGN,
BL_SCORE, BL_FLUSH, BL_FLUSH, BL_FLUSH, BL_FLUSH, BL_FLUSH,
BL_FLUSH },