Merge branch 'master' into win32-x64-working
Conflicts: include/hack.h win/X11/winmenu.c win/X11/winstat.c
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.5 decl.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */
|
||||
/* NetHack 3.5 decl.c $NHDT-Date: 1430897862 2015/05/06 07:37:42 $ $NHDT-Branch: master $:$NHDT-Revision: 1.56 $ */
|
||||
/* NetHack 3.5 decl.c $Date: 2012/04/09 02:56:30 $ $Revision: 1.37 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
@@ -331,6 +331,9 @@ NEARDATA struct savefile_info sfrestinfo, sfsaveinfo = {
|
||||
char *ARGV0;
|
||||
#endif
|
||||
|
||||
/* support for lint.h */
|
||||
unsigned nhUse_dummy = 0;
|
||||
|
||||
/* dummy routine used to force linkage */
|
||||
void
|
||||
decl_init()
|
||||
|
||||
@@ -568,6 +568,7 @@ int ttyp;
|
||||
if (!ttmp) return;
|
||||
newobjs = level.objects[x][y];
|
||||
ttmp->madeby_u = madeby_u;
|
||||
ttmp->tseen = 0;
|
||||
if (cansee(x,y)) seetrap(ttmp);
|
||||
else if (madeby_u) feeltrap(ttmp);
|
||||
|
||||
|
||||
3
src/do.c
3
src/do.c
@@ -217,7 +217,8 @@ const char *verb;
|
||||
/* Globby things like puddings might stick together */
|
||||
while (obj && (otmp = obj_nexto_xy(obj->otyp, x, y, obj->o_id)) != (struct obj*)0) {
|
||||
pudding_merge_message(obj, otmp);
|
||||
obj = obj_meld(&obj, &otmp);
|
||||
/* intentionally not getting the melded object; obj_meld may set obj to null. */
|
||||
(void) obj_meld(&obj, &otmp);
|
||||
}
|
||||
return (obj == NULL);
|
||||
}
|
||||
|
||||
@@ -239,10 +239,15 @@ boolean devour;
|
||||
unseen spot to eat the food there, avoid referring to that
|
||||
pet as "it". However, we want "it" if invisible/unsensed
|
||||
pet eats visible food. */
|
||||
if (seeobj || sawpet)
|
||||
pline("%s %s %s.",
|
||||
(sawpet || canspotmon(mtmp)) ? noit_Monnam(mtmp) : "It",
|
||||
devour ? "devours" : "eats", distant_name(obj, doname));
|
||||
if (sawpet || (seeobj && canspotmon(mtmp))) {
|
||||
if (tunnels(mtmp->data))
|
||||
pline("%s digs in.", noit_Monnam(mtmp));
|
||||
else
|
||||
pline("%s %s %s.", noit_Monnam(mtmp),
|
||||
devour ? "devours" : "eats", distant_name(obj, doname));
|
||||
} else if (seeobj)
|
||||
pline("It %s %s.", devour ? "devours" : "eats",
|
||||
distant_name(obj, doname));
|
||||
}
|
||||
if (obj->unpaid) {
|
||||
Strcpy(objnambuf, xname(obj));
|
||||
|
||||
55
src/invent.c
55
src/invent.c
@@ -425,8 +425,8 @@ struct obj *obj;
|
||||
goto added;
|
||||
}
|
||||
/* didn't merge, so insert into chain */
|
||||
assigninvlet(obj);
|
||||
if (flags.invlet_constant || !prev) {
|
||||
if (flags.invlet_constant) assigninvlet(obj);
|
||||
obj->nobj = invent; /* insert at beginning */
|
||||
invent = obj;
|
||||
if (flags.invlet_constant) reorder_invent();
|
||||
@@ -1134,7 +1134,14 @@ register const char *let,*word;
|
||||
}
|
||||
/* they typed a letter (not a space) at the prompt */
|
||||
}
|
||||
if (ilet == def_oc_syms[COIN_CLASS].sym) {
|
||||
/* find the item which was picked */
|
||||
for (otmp = invent; otmp; otmp = otmp->nobj)
|
||||
if (otmp->invlet == ilet) break;
|
||||
/* some items have restrictions */
|
||||
if (ilet == def_oc_syms[COIN_CLASS].sym
|
||||
/* guard against the [hypothetical] chace of having more
|
||||
than one invent slot of gold and picking the non-'$' one */
|
||||
|| (otmp && otmp->oclass == COIN_CLASS)) {
|
||||
if (!usegold) {
|
||||
You("cannot %s gold.", word);
|
||||
return(struct obj *)0;
|
||||
@@ -1156,7 +1163,8 @@ register const char *let,*word;
|
||||
/* permit counts for throwing gold, but don't accept
|
||||
* counts for other things since the throw code will
|
||||
* split off a single item anyway */
|
||||
if (ilet != def_oc_syms[COIN_CLASS].sym)
|
||||
if (ilet != def_oc_syms[COIN_CLASS].sym
|
||||
&& !(otmp && otmp->oclass == COIN_CLASS))
|
||||
allowcnt = 1;
|
||||
if (cnt == 0 && prezero) return (struct obj *)0;
|
||||
if (cnt > 1) {
|
||||
@@ -1166,8 +1174,9 @@ register const char *let,*word;
|
||||
}
|
||||
context.botl = 1; /* May have changed the amount of money */
|
||||
savech(ilet);
|
||||
for (otmp = invent; otmp; otmp = otmp->nobj)
|
||||
if (otmp->invlet == ilet) break;
|
||||
/* [we used to set otmp (by finding ilet in invent) here, but
|
||||
that's been moved above so that otmp can be checked earlier] */
|
||||
/* verify the chosen object */
|
||||
if(!otmp) {
|
||||
You("don't have that object.");
|
||||
if (in_doagain) return((struct obj *) 0);
|
||||
@@ -2958,23 +2967,33 @@ free_invbuf()
|
||||
invbufsiz = 0;
|
||||
}
|
||||
|
||||
/* give consecutive letters to every item in inventory (for !fixinv mode) */
|
||||
/* give consecutive letters to every item in inventory (for !fixinv mode);
|
||||
gold is always forced to '$' slot at head of list */
|
||||
void
|
||||
reassign()
|
||||
{
|
||||
register int i;
|
||||
register struct obj *obj;
|
||||
int i;
|
||||
struct obj *obj, *prevobj, *goldobj;
|
||||
|
||||
for(obj = invent, i = 0; obj; obj = obj->nobj, i++) {
|
||||
if (obj->oclass == COIN_CLASS && obj->invlet == GOLD_SYM)
|
||||
--i; /* keep $ instead of using up i'th letter */
|
||||
else
|
||||
if (i < 52)
|
||||
obj->invlet = (i < 26) ? ('a'+i) : ('A'+i-26);
|
||||
else if (obj->oclass == COIN_CLASS)
|
||||
obj->invlet = GOLD_SYM;
|
||||
else
|
||||
obj->invlet = NOINVSYM;
|
||||
/* first, remove [first instance of] gold from invent, if present */
|
||||
prevobj = goldobj = 0;
|
||||
for (obj = invent; obj; prevobj = obj, obj = obj->nobj)
|
||||
if (obj->oclass == COIN_CLASS) {
|
||||
goldobj = obj;
|
||||
if (prevobj)
|
||||
prevobj->nobj = goldobj->nobj;
|
||||
else
|
||||
invent = goldobj->nobj;
|
||||
break;
|
||||
}
|
||||
/* second, re-letter the rest of the list */
|
||||
for (obj = invent, i = 0; obj; obj = obj->nobj, i++)
|
||||
obj->invlet = (i < 26) ? ('a'+i) : (i < 52) ? ('A'+i-26) : NOINVSYM;
|
||||
/* third, assign gold the "letter" '$' and re-insert it at head */
|
||||
if (goldobj) {
|
||||
goldobj->invlet = GOLD_SYM;
|
||||
goldobj->nobj = invent;
|
||||
invent = goldobj;
|
||||
}
|
||||
if (i >= 52) i = 52 - 1;
|
||||
lastinvnr = i;
|
||||
|
||||
@@ -1818,6 +1818,8 @@ struct permonst _mons2[] = {
|
||||
M3_INFRAVISIBLE|M3_INFRAVISION, HI_LORD),
|
||||
/*
|
||||
* Puddings
|
||||
*
|
||||
* must be in the same order as the pudding globs in objects.c
|
||||
*/
|
||||
MON("gray ooze", S_PUDDING,
|
||||
LVL(3, 1, 8, 0, 0), (G_GENO|G_NOCORPSE|2),
|
||||
|
||||
@@ -675,7 +675,8 @@ OBJECT(OBJ("meat ring", (char *)0),
|
||||
BITS(1,0,0,0,0,0,0,0,0,0,0,0,FLESH),
|
||||
0, FOOD_CLASS, 0, 1, 5, 1, 0, 0, 0, 0, 5, CLR_BROWN),
|
||||
|
||||
/* pudding 'corpses' will turn into these and combine */
|
||||
/* pudding 'corpses' will turn into these and combine.
|
||||
must be in same order as the pudding monsters */
|
||||
FOOD("glob of gray ooze", 0, 2, 20, 0, FLESH, 20, CLR_GRAY),
|
||||
FOOD("glob of brown pudding", 0, 2, 20, 0, FLESH, 20, CLR_BROWN),
|
||||
FOOD("glob of green slime", 0, 2, 20, 0, FLESH, 20, CLR_GREEN),
|
||||
|
||||
@@ -115,6 +115,7 @@ register struct monst *mtmp;
|
||||
tmp = (somegold(money_cnt(invent)) + gold_price - 1) / gold_price;
|
||||
tmp = min(tmp, ygold->quan);
|
||||
if (tmp < ygold->quan) ygold = splitobj(ygold, tmp);
|
||||
else setnotworn(ygold);
|
||||
freeinv(ygold);
|
||||
add_to_minv(mtmp, ygold);
|
||||
Your("purse feels lighter.");
|
||||
|
||||
Reference in New Issue
Block a user