show object symbols in menu headings in menus where those object symbols
act as menu accelerators, toggleable via "menu_objsyms" option
show t-shirt text at end of game inventory disclose
+hitting with a polearm remembers the position of the last monster you hit
Platform- and/or Interface-Specific Fixes
short speciesidx; /* index of above in mons[] (for save/restore) */
};
+struct polearm_info {
+ struct monst *hitmon; /* the monster we tried to hit last */
+ unsigned m_id; /* monster id of hitmon, in save file */
+};
+
struct context_info {
unsigned ident; /* social security number for each monster */
unsigned no_of_wizards; /* 0, 1 or 2 (wizard and his shadow) */
struct book_info spbook;
struct takeoff_info takeoff;
struct warntype_info warntype;
+ struct polearm_info polearm;
};
extern NEARDATA struct context_info context;
* Incrementing EDITLEVEL can be used to force invalidation of old bones
* and save files.
*/
-#define EDITLEVEL 58
+#define EDITLEVEL 59
#define COPYRIGHT_BANNER_A \
"NetHack, Copyright 1985-2015"
int res = 0, typ, max_range, min_range, glyph;
coord cc;
struct monst *mtmp;
+ struct monst *hitm = context.polearm.hitmon;
/* Are you allowed to use the pole? */
if (u.uswallow) {
/* Prompt for a location */
pline(where_to_hit);
- cc.x = u.ux;
- cc.y = u.uy;
+ if (hitm && !DEADMONSTER(hitm) && cansee(hitm->mx, hitm->my)) {
+ cc.x = hitm->mx;
+ cc.y = hitm->my;
+ } else {
+ cc.x = u.ux;
+ cc.y = u.uy;
+ }
if (getpos(&cc, TRUE, "the spot to hit") < 0)
return res; /* ESC; uses turn iff polearm became wielded */
return res;
}
+ context.polearm.hitmon = NULL;
/* Attack the monster there */
bhitpos = cc;
if ((mtmp = m_at(bhitpos.x, bhitpos.y)) != (struct monst *)0) {
if (attack_checks(mtmp, uwep)) return res;
if (overexertion()) return 1; /* burn nutrition; maybe pass out */
+ context.polearm.hitmon = mtmp;
check_caitiff(mtmp);
notonhead = (bhitpos.x != mtmp->mx || bhitpos.y != mtmp->my);
(void) thitmonst(mtmp, uwep);
/* assume this will always return TRUE when changing level */
(void) in_out_region(u.ux, u.uy);
(void) pickup(1);
+ context.polearm.hitmon = NULL;
}
STATIC_OVL void
for (mtmp = &fmon; *mtmp;) {
freetmp = *mtmp;
if (freetmp->mhp <= 0 && !freetmp->isgd) {
+ if (freetmp == context.polearm.hitmon)
+ context.polearm.hitmon = NULL;
*mtmp = freetmp->nmon;
dealloc_monst(freetmp);
count++;
if (mtmp->isshk) restshk(mtmp, ghostly);
if (mtmp->ispriest) restpriest(mtmp, ghostly);
+ if (!ghostly) {
+ if (mtmp->m_id == context.polearm.m_id)
+ context.polearm.hitmon = mtmp;
+ }
mtmp2 = mtmp;
}
if(first && mtmp2->nmon){
}
if (mtmp->minvent)
saveobjchn(fd,mtmp->minvent,mode);
- if (release_data(mode))
+ if (release_data(mode)) {
+ if (mtmp == context.polearm.hitmon) {
+ context.polearm.m_id = mtmp->m_id;
+ context.polearm.hitmon = NULL;
+ }
dealloc_monst(mtmp);
+ }
mtmp = mtmp2;
}
if (perform_bwrite(mode))