Merge branch 'NetHack-3.6.2'

This commit is contained in:
nhmall
2018-09-11 08:50:07 -04:00
21 changed files with 719 additions and 65 deletions

4
src/.gitignore vendored
View File

@@ -7,3 +7,7 @@ Sysunix
nethack
*.o
tiles.bmp
*.moc
graphicschk
nhdat
o

View File

@@ -14,8 +14,10 @@ STATIC_DCL int FDECL(disturb, (struct monst *));
STATIC_DCL void FDECL(release_hero, (struct monst *));
STATIC_DCL void FDECL(distfleeck, (struct monst *, int *, int *, int *));
STATIC_DCL int FDECL(m_arrival, (struct monst *));
STATIC_DCL int FDECL(count_webbing_walls, (XCHAR_P, XCHAR_P));
STATIC_DCL boolean FDECL(stuff_prevents_passage, (struct monst *));
STATIC_DCL int FDECL(vamp_shift, (struct monst *, struct permonst *, BOOLEAN_P));
STATIC_DCL int FDECL(vamp_shift, (struct monst *, struct permonst *,
BOOLEAN_P));
/* True if mtmp died */
boolean
@@ -742,6 +744,24 @@ xchar nix,niy;
return FALSE;
}
/* returns the number of walls in the four cardinal directions that could
hold up a web */
STATIC_OVL int
count_webbing_walls(x, y)
xchar x, y;
{
#define holds_up_web(X, Y) ((!isok((X), (Y)) \
|| IS_ROCK(levl[X][Y].typ) \
|| (levl[X][Y].typ == STAIRS \
&& (X) == xupstair && (Y) == yupstair) \
|| (levl[X][Y].typ == LADDER \
&& (X) == xupladder && (Y) == yupladder) \
|| levl[X][Y].typ == IRONBARS) ? 1 : 0)
return (holds_up_web(x, y - 1) + holds_up_web(x + 1, y)
+ holds_up_web(x, y + 1) + holds_up_web(x - 1, y));
#undef holds_up_web
}
/* Return values:
* 0: did not move, but can still attack and do other stuff.
* 1: moved, possibly can attack.
@@ -1436,6 +1456,27 @@ postmov:
}
}
/* maybe spin a web -- this needs work; if the spider is far away,
it might spin a lot of webs before hero encounters it */
if (webmaker(ptr) && !mtmp->mspec_used && !t_at(mtmp->mx, mtmp->my)) {
struct trap *trap;
int prob = ((ptr == &mons[PM_GIANT_SPIDER]) ? 15 : 5)
* (count_webbing_walls(mtmp->mx, mtmp->my) + 1);
if (rn2(1000) < prob
&& (trap = maketrap(mtmp->mx, mtmp->my, WEB)) != 0) {
mtmp->mspec_used = d(4, 4); /* 4..16 */
if (cansee(mtmp->mx, mtmp->my)) {
char mbuf[BUFSZ];
Strcpy(mbuf,
canspotmon(mtmp) ? y_monnam(mtmp) : something);
pline("%s spins a web.", upstart(mbuf));
trap->tseen = 1;
}
}
}
if (hides_under(ptr) || ptr->mlet == S_EEL) {
/* Always set--or reset--mundetected if it's already hidden
(just in case the object it was hiding under went away);

View File

@@ -778,6 +778,15 @@ initoptions_init()
#endif
#endif /* UNIX || VMS */
#if defined(MSDOS) || defined(WIN32)
/* Use IBM defaults. Can be overridden via config file */
if (!symset[PRIMARY].name) {
load_symset("IBMGraphics_2", PRIMARY);
}
if (!symset[ROGUESET].name) {
load_symset("RogueEpyx", ROGUESET);
}
#endif
#ifdef MAC_GRAPHICS_ENV
if (!symset[PRIMARY].name)
load_symset("MACGraphics", PRIMARY);