Merge branch 'NetHack-3.6.2'
This commit is contained in:
@@ -303,6 +303,8 @@ limit carrying heavy loads from water to land
|
|||||||
failing to carry a wished-for item behaved differenctly from dropping one
|
failing to carry a wished-for item behaved differenctly from dropping one
|
||||||
life-saving while weak/starving/fainting boosted nutrition without restoring
|
life-saving while weak/starving/fainting boosted nutrition without restoring
|
||||||
lost point of strength, making temporary loss be permanent
|
lost point of strength, making temporary loss be permanent
|
||||||
|
unlike #chat in a shop, walking on an item in a shop failed to include price
|
||||||
|
for hero-owned container holding shop-owned items
|
||||||
|
|
||||||
|
|
||||||
Fixes to Post-3.6.1 Problems that Were Exposed Via git Repository
|
Fixes to Post-3.6.1 Problems that Were Exposed Via git Repository
|
||||||
@@ -458,6 +460,8 @@ being trapped (bear trap, web, molten or solidified lava, chained to buried
|
|||||||
pit ends when either of those starts so doesn't apply)
|
pit ends when either of those starts so doesn't apply)
|
||||||
early level traps are sometimes covered by the remains of fake players
|
early level traps are sometimes covered by the remains of fake players
|
||||||
fake player characters resist Conflict
|
fake player characters resist Conflict
|
||||||
|
when inside a shop, far-look now includes shop prices for items marked as
|
||||||
|
having been seen up close
|
||||||
|
|
||||||
|
|
||||||
NetHack Community Patches (or Variation) Included
|
NetHack Community Patches (or Variation) Included
|
||||||
|
|||||||
11
src/objnam.c
11
src/objnam.c
@@ -1,4 +1,4 @@
|
|||||||
/* NetHack 3.6 objnam.c $NHDT-Date: 1544520422 2018/12/11 09:27:02 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.230 $ */
|
/* NetHack 3.6 objnam.c $NHDT-Date: 1545774525 2018/12/25 21:48:45 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.231 $ */
|
||||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||||
/*-Copyright (c) Robert Patrick Rankin, 2011. */
|
/*-Copyright (c) Robert Patrick Rankin, 2011. */
|
||||||
/* NetHack may be freely redistributed. See license for details. */
|
/* NetHack may be freely redistributed. See license for details. */
|
||||||
@@ -1205,10 +1205,15 @@ unsigned doname_flags;
|
|||||||
obj->unpaid ? "unpaid" : "contents",
|
obj->unpaid ? "unpaid" : "contents",
|
||||||
quotedprice, currency(quotedprice));
|
quotedprice, currency(quotedprice));
|
||||||
} else if (with_price) {
|
} else if (with_price) {
|
||||||
long price = get_cost_of_shop_item(obj);
|
long price = get_cost_of_shop_item(obj); /* updates obj->ox,oy */
|
||||||
|
|
||||||
if (price > 0)
|
if (price > 0L)
|
||||||
Sprintf(eos(bp), " (%ld %s)", price, currency(price));
|
Sprintf(eos(bp), " (%ld %s)", price, currency(price));
|
||||||
|
else if (obj->no_charge /* only set for items on shop floor */
|
||||||
|
&& *u.ushops /* but make sure hero is inside same shop */
|
||||||
|
&& (*in_rooms(u.ux, u.uy, SHOPBASE)
|
||||||
|
== *in_rooms(obj->ox, obj->oy, SHOPBASE)))
|
||||||
|
Strcat(bp, " (no charge)");
|
||||||
}
|
}
|
||||||
if (!strncmp(prefix, "a ", 2)) {
|
if (!strncmp(prefix, "a ", 2)) {
|
||||||
/* save current prefix, without "a "; might be empty */
|
/* save current prefix, without "a "; might be empty */
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/* NetHack 3.6 pager.c $NHDT-Date: 1545595360 2018/12/23 20:02:40 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.144 $ */
|
/* NetHack 3.6 pager.c $NHDT-Date: 1545774524 2018/12/25 21:48:44 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.145 $ */
|
||||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||||
/*-Copyright (c) Robert Patrick Rankin, 2018. */
|
/*-Copyright (c) Robert Patrick Rankin, 2018. */
|
||||||
/* NetHack may be freely redistributed. See license for details. */
|
/* NetHack may be freely redistributed. See license for details. */
|
||||||
@@ -223,7 +223,8 @@ int x, y, glyph;
|
|||||||
|
|
||||||
if (otmp) {
|
if (otmp) {
|
||||||
Strcpy(buf, (otmp->otyp != STRANGE_OBJECT)
|
Strcpy(buf, (otmp->otyp != STRANGE_OBJECT)
|
||||||
? distant_name(otmp, doname_vague_quan)
|
? distant_name(otmp, otmp->dknown ? doname_with_price
|
||||||
|
: doname_vague_quan)
|
||||||
: obj_descr[STRANGE_OBJECT].oc_name);
|
: obj_descr[STRANGE_OBJECT].oc_name);
|
||||||
if (fakeobj)
|
if (fakeobj)
|
||||||
dealloc_obj(otmp), otmp = 0;
|
dealloc_obj(otmp), otmp = 0;
|
||||||
|
|||||||
25
src/shk.c
25
src/shk.c
@@ -1,4 +1,4 @@
|
|||||||
/* NetHack 3.6 shk.c $NHDT-Date: 1545383616 2018/12/21 09:13:36 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.144 $ */
|
/* NetHack 3.6 shk.c $NHDT-Date: 1545774524 2018/12/25 21:48:44 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.145 $ */
|
||||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||||
/*-Copyright (c) Robert Patrick Rankin, 2012. */
|
/*-Copyright (c) Robert Patrick Rankin, 2012. */
|
||||||
/* NetHack may be freely redistributed. See license for details. */
|
/* NetHack may be freely redistributed. See license for details. */
|
||||||
@@ -921,7 +921,7 @@ register struct obj *obj, *merge;
|
|||||||
if (onbill(obj, shkp, TRUE))
|
if (onbill(obj, shkp, TRUE))
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
/* sanity check, more or less */
|
/* sanity check, in case obj is on bill but not marked 'unpaid' */
|
||||||
if (!shkp)
|
if (!shkp)
|
||||||
shkp = shop_keeper(*u.ushops);
|
shkp = shop_keeper(*u.ushops);
|
||||||
/*
|
/*
|
||||||
@@ -1957,8 +1957,8 @@ unsigned id;
|
|||||||
return (struct obj *) 0;
|
return (struct obj *) 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Returns the price of an arbitrary item in the shop.
|
/* Returns the price of an arbitrary item in the shop,
|
||||||
Returns 0 if the item doesn't belong to a shopkeeper. */
|
0 if the item doesn't belong to a shopkeeper or hero is not in the shop. */
|
||||||
long
|
long
|
||||||
get_cost_of_shop_item(obj)
|
get_cost_of_shop_item(obj)
|
||||||
register struct obj *obj;
|
register struct obj *obj;
|
||||||
@@ -1967,16 +1967,12 @@ register struct obj *obj;
|
|||||||
xchar x, y;
|
xchar x, y;
|
||||||
long cost = 0L;
|
long cost = 0L;
|
||||||
|
|
||||||
if (*u.ushops
|
if (*u.ushops && obj->oclass != COIN_CLASS
|
||||||
&& obj->oclass != COIN_CLASS
|
|
||||||
&& obj != uball && obj != uchain
|
&& obj != uball && obj != uchain
|
||||||
&& get_obj_location(obj, &x, &y, 0)
|
&& get_obj_location(obj, &x, &y, 0)
|
||||||
&& (obj->unpaid
|
&& *in_rooms(u.ux, u.uy, SHOPBASE) == *in_rooms(x, y, SHOPBASE)
|
||||||
|| (obj->where == OBJ_FLOOR
|
&& (shkp = shop_keeper(inside_shop(x, y))) != 0 && inhishop(shkp)) {
|
||||||
&& !obj->no_charge && costly_spot(x, y)))
|
cost = obj->no_charge ? 0L : obj->quan * get_cost(obj, shkp);
|
||||||
&& (shkp = shop_keeper(*in_rooms(x, y, SHOPBASE))) != 0
|
|
||||||
&& inhishop(shkp)) {
|
|
||||||
cost = obj->quan * get_cost(obj, shkp);
|
|
||||||
if (Has_contents(obj))
|
if (Has_contents(obj))
|
||||||
cost += contained_cost(obj, shkp, 0L, FALSE, FALSE);
|
cost += contained_cost(obj, shkp, 0L, FALSE, FALSE);
|
||||||
}
|
}
|
||||||
@@ -4156,9 +4152,8 @@ register struct obj *first_obj;
|
|||||||
for (otmp = first_obj; otmp; otmp = otmp->nexthere) {
|
for (otmp = first_obj; otmp; otmp = otmp->nexthere) {
|
||||||
if (otmp->oclass == COIN_CLASS)
|
if (otmp->oclass == COIN_CLASS)
|
||||||
continue;
|
continue;
|
||||||
cost = (otmp->no_charge || otmp == uball || otmp == uchain)
|
cost = (otmp->no_charge || otmp == uball || otmp == uchain) ? 0L
|
||||||
? 0L
|
: get_cost(otmp, shkp);
|
||||||
: get_cost(otmp, (struct monst *) 0);
|
|
||||||
contentsonly = !cost;
|
contentsonly = !cost;
|
||||||
if (Has_contents(otmp))
|
if (Has_contents(otmp))
|
||||||
cost += contained_cost(otmp, shkp, 0L, FALSE, FALSE);
|
cost += contained_cost(otmp, shkp, 0L, FALSE, FALSE);
|
||||||
|
|||||||
Reference in New Issue
Block a user