Merge branch 'NetHack-3.6.2'

This commit is contained in:
nhmall
2018-09-14 18:27:53 -04:00
9 changed files with 88 additions and 40 deletions

View File

@@ -114,7 +114,9 @@ add window port status_update() value BL_RESET to use as a flag to
for hilite_status of string status fields (title, dungeon-level, alignment),
the types value-goes-up and -down aren't meaningful; treat them as
value-changed if from config file and don't offer as choices with 'O'
spiders will occasionally spin webs when moving around
jumping into or over a Sokoban pit, or over a fire trap, triggers trap twice
mimics created by #wizgenesis could block or not block vision incorrectly
handle monsters inside the invocation area
Fixes to Post-3.6.1 Problems that Were Exposed Via git Repository
@@ -125,6 +127,8 @@ setting the inverse attribute for gold had the space before "$:"
sortloot segfaulted when filtering a subset of items (seen with 'A' command)
tty: turn off an optimization that is the suspected cause of Windows reported
partial status lines following level changes
tty: ensure that current status fields are always copied to prior status
values so that comparisons are correct
Platform- and/or Interface-Specific Fixes
@@ -162,6 +166,7 @@ unix: Makefile.src and Makefile.utl inadvertently relied on a 'gnu make'
Qt: add Qt5 specific hints file for linux and Mac OS X (Ray Chason)
Qt: enable compiling Qt5 on Windows (Ray Chason)
Qt: entering extended commands, hide non-matching ones
Qt: remember tile and font size
General New Features
@@ -179,6 +184,7 @@ make it clear when a leprechaun dodges your attack
wizard mode #wizidentify can now select individual items for permanent
identification and don't display the selection to permanently
identify everything if everything is already fully identified
spiders will occasionally spin webs when moving around
Code Cleanup and Reorganization

View File

@@ -571,7 +571,7 @@ int x, y;
int ox, oy, *range = (int *) arg;
struct obj *obj;
struct monst *mon;
boolean may_pass = TRUE;
boolean may_pass = TRUE, via_jumping, stopping_short;
struct trap *ttmp;
int dmg = 0;
@@ -583,6 +583,8 @@ int x, y;
} else if (*range == 0) {
return FALSE; /* previous step wants to stop now */
}
via_jumping = (EWwalking & I_SPECIAL) != 0L;
stopping_short = (via_jumping && *range < 2);
if (!Passes_walls || !(may_pass = may_passwall(x, y))) {
boolean odoor_diag = (IS_DOOR(levl[x][y].typ)
@@ -710,12 +712,17 @@ int x, y;
vision_recalc(1); /* update for new position */
flush_screen(1);
if (is_pool(x, y) && !u.uinwater
&& ((Is_waterlevel(&u.uz) && levl[x][y].typ == WATER)
|| !(Levitation || Flying || Wwalking))) {
multi = 0; /* can move, so drown() allows crawling out of water */
(void) drown();
return FALSE;
if (is_pool(x, y) && !u.uinwater) {
if ((Is_waterlevel(&u.uz) && levl[x][y].typ == WATER)
|| !(Levitation || Flying || Wwalking)) {
multi = 0; /* can move, so drown() allows crawling out of water */
(void) drown();
return FALSE;
} else if (!Is_waterlevel(&u.uz) && !stopping_short) {
Norep("You move over %s.", an(is_moat(x, y) ? "moat" : "pool"));
}
} else if (is_lava(x, y) && !stopping_short) {
Norep("You move over some lava.");
}
/* FIXME:
@@ -727,7 +734,9 @@ int x, y;
* ones that we have not yet tested.
*/
if ((ttmp = t_at(x, y)) != 0) {
if (ttmp->ttyp == MAGIC_PORTAL) {
if (stopping_short) {
; /* see the comment above hurtle_jump() */
} else if (ttmp->ttyp == MAGIC_PORTAL) {
dotrap(ttmp, 0);
return FALSE;
} else if (ttmp->ttyp == VIBRATING_SQUARE) {
@@ -738,8 +747,10 @@ int x, y;
} else if ((ttmp->ttyp == PIT || ttmp->ttyp == SPIKED_PIT
|| ttmp->ttyp == HOLE || ttmp->ttyp == TRAPDOOR)
&& Sokoban) {
/* Air currents overcome the recoil */
dotrap(ttmp, 0);
/* air currents overcome the recoil in Sokoban;
when jumping, caller performs last step and enters trap */
if (!via_jumping)
dotrap(ttmp, 0);
*range = 0;
return TRUE;
} else {

View File

@@ -2127,16 +2127,12 @@ register struct monst *mtmp;
appear = Is_rogue_level(&u.uz) ? S_hwall : S_hcdoor;
else
appear = Is_rogue_level(&u.uz) ? S_vwall : S_vcdoor;
if (!mtmp->minvis || See_invisible)
block_point(mx, my); /* vision */
} else if (level.flags.is_maze_lev && !In_sokoban(&u.uz) && rn2(2)) {
ap_type = M_AP_OBJECT;
appear = STATUE;
} else if (roomno < 0 && !t_at(mx, my)) {
ap_type = M_AP_OBJECT;
appear = BOULDER;
if (!mtmp->minvis || See_invisible)
block_point(mx, my); /* vision */
} else if (rt == ZOO || rt == VAULT) {
ap_type = M_AP_OBJECT;
appear = GOLD_PIECE;
@@ -2194,6 +2190,9 @@ register struct monst *mtmp;
if (appear == EGG && !can_be_hatched(MCORPSENM(mtmp)))
MCORPSENM(mtmp) = NON_PM; /* revert to generic egg */
}
if (does_block(mx, my, &levl[mx][my]))
block_point(mx, my);
}
/* release monster from bag of tricks; return number of monsters created */

View File

@@ -1736,6 +1736,7 @@ int dist;
struct obj *otmp;
boolean make_rocks;
register struct rm *lev = &levl[x][y];
struct monst *mon;
/* clip at existing map borders if necessary */
if (!within_bounded_area(x, y, x_maze_min + 1, y_maze_min + 1,
@@ -1762,7 +1763,6 @@ int dist;
obfree(otmp, (struct obj *) 0);
}
}
unblock_point(x, y); /* make sure vision knows this location is open */
/* fake out saved state */
lev->seenv = 0;
@@ -1799,6 +1799,20 @@ int dist;
break;
}
if ((mon = m_at(x, y)) != 0) {
/* wake up mimics, don't want to deal with them blocking vision */
if (mon->m_ap_type)
seemimic(mon);
if ((ttmp = t_at(x, y)) != 0)
(void) mintrap(mon);
else
(void) minliquid(mon);
}
if (!does_block(x, y, lev))
unblock_point(x, y); /* make sure vision knows this location is open */
/* display new value of position; could have a monster/object on it */
newsym(x, y);
}

View File

@@ -2550,8 +2550,14 @@ struct _create_particular_data *d;
put_saddle_on_mon(otmp, mtmp);
}
if (d->invisible)
if (d->invisible) {
int mx = mtmp->mx, my = mtmp->my;
mon_set_minvis(mtmp);
if (does_block(mx, my, &levl[mx][my]))
block_point(mx, my);
else
unblock_point(mx, my);
}
if (d->sleeping)
mtmp->msleeping = 1;
madeany = TRUE;

View File

@@ -490,6 +490,10 @@ NetHackQtMainWindow::NetHackQtMainWindow(NetHackQtKeyBuffer& ks) :
addToolBar(toolbar);
menubar = menuBar();
QCoreApplication::setOrganizationName("The NetHack DevTeam");
QCoreApplication::setOrganizationDomain("nethack.org");
QCoreApplication::setApplicationName("NetHack");
setWindowTitle("Qt NetHack");
if ( qt_compact_mode )
setWindowIcon(QIcon(QPixmap(nh_icon_small)));

View File

@@ -36,10 +36,11 @@ int qt_compact_mode = 0;
namespace nethack_qt4 {
#define TILEWMIN 1
#define TILEHMIN 1
#define TILEWMIN 6
#define TILEHMIN 6
NetHackQtSettings::NetHackQtSettings(int w, int h) :
settings(),
tilewidth(this),
tileheight(this),
widthlbl("&Width:",this),
@@ -63,9 +64,9 @@ NetHackQtSettings::NetHackQtSettings(int w, int h) :
heightlbl.setBuddy(&tileheight);
tileheight.setRange(TILEHMIN, 128);
default_fontsize=2;
tilewidth.setValue(16);
tileheight.setValue(16);
tilewidth.setValue(settings.value("tilewidth", 16).toInt());
tileheight.setValue(settings.value("tileheight", 16).toInt());
default_fontsize = settings.value("fontsize", 2).toInt();
// Tile/font sizes read from .nethackrc
if (qt_tilewidth != NULL) {
@@ -100,7 +101,7 @@ NetHackQtSettings::NetHackQtSettings(int w, int h) :
fontsize.addItem("Small");
fontsize.addItem("Tiny");
fontsize.setCurrentIndex(default_fontsize);
connect(&fontsize,SIGNAL(activated(int)),this,SIGNAL(fontChanged()));
connect(&fontsize,SIGNAL(activated(int)),this,SLOT(changedFont()));
QGridLayout* grid = new QGridLayout(this);
grid->addWidget(&whichsize, 0, 0, 1, 2);
@@ -126,11 +127,19 @@ NetHackQtGlyphs& NetHackQtSettings::glyphs()
return *theglyphs;
}
void NetHackQtSettings::changedFont()
{
settings.setValue("fontsize", fontsize.currentIndex());
emit fontChanged();
}
void NetHackQtSettings::resizeTiles()
{
int w = tilewidth.value();
int h = tileheight.value();
settings.setValue("tilewidth", tilewidth.value());
settings.setValue("tileheight", tileheight.value());
theglyphs->setSize(w,h);
emit tilesChanged();
}

View File

@@ -33,6 +33,7 @@ public slots:
void setGlyphSize(bool);
private:
QSettings settings;
QSpinBox tilewidth;
QSpinBox tileheight;
QLabel widthlbl;
@@ -48,6 +49,7 @@ private:
private slots:
void resizeTiles();
void changedFont();
};
extern NetHackQtSettings* qt_settings;

View File

@@ -3837,7 +3837,8 @@ int *topsz, *bottomsz;
tty_status[NOW][idx].y = row;
tty_status[NOW][idx].x = col;
/* evaluate */
/* On a change to the field length, everything
further to the right must be updated as well */
if (tty_status[NOW][idx].lth != tty_status[BEFORE][idx].lth)
update_right = TRUE;
@@ -4129,16 +4130,11 @@ render_status(VOID_ARGS)
for (i = 0; fieldorder[row][i] != BL_FLUSH; ++i) {
int fldidx = fieldorder[row][i];
if (do_field_opt && !tty_status[NOW][fldidx].redraw)
continue;
/*
* Ignore zero length fields. check_fields() didn't count
* them in either.
*/
if (!tty_status[NOW][fldidx].lth && fldidx != BL_CONDITION)
if (!status_activefields[fldidx])
continue;
if (status_activefields[fldidx]) {
if ((tty_status[NOW][fldidx].lth || fldidx == BL_CONDITION)
&& (tty_status[NOW][fldidx].redraw || !do_field_opt)) {
int coloridx = tty_status[NOW][fldidx].color;
int attridx = tty_status[NOW][fldidx].attr;
int x = tty_status[NOW][fldidx].x;
@@ -4296,15 +4292,16 @@ render_status(VOID_ARGS)
End_Attr(attridx);
}
}
/* reset .redraw and .dirty now that they've been rendered */
tty_status[NOW][fldidx].dirty = FALSE;
tty_status[NOW][fldidx].redraw = FALSE;
/*
* Make a copy of the entire tty_status struct for comparison
* of current and previous.
*/
tty_status[BEFORE][fldidx] = tty_status[NOW][fldidx];
}
/* reset .redraw and .dirty now that they've been rendered */
tty_status[NOW][fldidx].dirty = FALSE;
tty_status[NOW][fldidx].redraw = FALSE;
/*
* Make a copy of the entire tty_status struct for comparison
* of current and previous.
*/
tty_status[BEFORE][fldidx] = tty_status[NOW][fldidx];
}
}
if (cond_disp_width[NOW] < cond_width_at_shrink) {