shooting range for crossbow isn't affected by strength; multi-shot volley is
right-handed boomerang throw travels counterclockwise
monsters can use ranged attacks over/around boulders, same as hero
+can't drop part of a stack of N weapons welded to hero's hand
Platform- and/or Interface-Specific Fixes
E void VDECL(panic, (const char *,...)) PRINTF_F(1,2);
#if !defined(MAKEDEFS_C) && !defined(LEV_LEX_C)
E void FDECL(done, (int));
-E void FDECL(container_contents, (struct obj *,BOOLEAN_P,BOOLEAN_P));
+E void FDECL(container_contents, (struct obj *,BOOLEAN_P,BOOLEAN_P,BOOLEAN_P));
E void FDECL(terminate, (int));
E int NDECL(num_genocides);
E void FDECL(delayed_killer, (int, int, const char*));
E boolean FDECL(allow_all, (struct obj *));
E boolean FDECL(allow_category, (struct obj *));
E boolean FDECL(is_worn_by_type, (struct obj *));
-#ifdef USE_TRAMPOLI
E int FDECL(ck_bag, (struct obj *));
+#ifdef USE_TRAMPOLI
E int FDECL(in_container, (struct obj *));
E int FDECL(out_container, (struct obj *));
#endif
-/* SCCS Id: @(#)do.c 3.5 2006/07/08 */
+/* SCCS Id: @(#)do.c 3.5 2007/01/02 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
assigninvlet(u_gold); /* might end up as NOINVSYM */
u_gold->nobj = invent;
invent = u_gold;
+ u_gold->where = OBJ_INVENT;
}
#endif
if (retry) {
u_gold = invent;
invent = u_gold->nobj;
u_gold->in_use = FALSE;
+ u_gold->where = OBJ_FREE;
dealloc_obj(u_gold);
update_inventory();
}
-/* SCCS Id: @(#)end.c 3.5 2006/04/14 */
+/* SCCS Id: @(#)end.c 3.5 2007/01/02 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
obj->cknown = obj->lknown = 1;
}
(void) display_inventory((char *)0, TRUE);
- container_contents(invent, TRUE, TRUE);
+ container_contents(invent, TRUE, TRUE, FALSE);
}
if (c == 'q') done_stopprint++;
}
void
-container_contents(list, identified, all_containers)
+container_contents(list, identified, all_containers, reportempty)
struct obj *list;
-boolean identified, all_containers;
+boolean identified, all_containers, reportempty;
{
register struct obj *box, *obj;
char buf[BUFSZ];
display_nhwindow(tmpwin, TRUE);
destroy_nhwindow(tmpwin);
if (all_containers)
- container_contents(box->cobj, identified, TRUE);
- } else {
- if (cat || deadcat) {
- pline("%s%s contains Schroedinger's %scat!",
- (box->quan > 1L) ? "One of the " : "",
- (box->quan > 1L) ? xname(box) : upstart(xname(box)),
- (deadcat) ? "dead " : "");
- display_nhwindow(WIN_MESSAGE, FALSE);
- }
+ container_contents(box->cobj, identified, TRUE,
+ reportempty);
+ } else if (cat || deadcat) {
+ pline("%s Schroedinger's %scat!",
+ Tobjnam(box, "contain"), deadcat ? "dead " : "");
+ display_nhwindow(WIN_MESSAGE, FALSE);
+ } else if (reportempty) {
+ pline("%s is empty.", upstart(thesimpleoname(box)));
+ display_nhwindow(WIN_MESSAGE, FALSE);
}
}
if (!all_containers)
-/* SCCS Id: @(#)invent.c 3.5 2006/11/29 */
+/* SCCS Id: @(#)invent.c 3.5 2007/01/02 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
STATIC_DCL boolean FDECL(worn_wield_only, (struct obj *));
STATIC_DCL boolean FDECL(only_here, (struct obj *));
STATIC_DCL void FDECL(compactify,(char *));
+STATIC_DCL boolean FDECL(splittable, (struct obj *));
STATIC_DCL boolean FDECL(taking_off, (const char *));
STATIC_DCL boolean FDECL(putting_on, (const char *));
STATIC_PTR int FDECL(ckunpaid,(struct obj *));
register int i;
register struct obj *obj;
-#ifdef GOLDOBJ
- /* There is only one of these in inventory... */
- if (otmp->oclass == COIN_CLASS) {
+ /* there should be at most one of these in inventory... */
+ if (otmp->oclass == COIN_CLASS) {
otmp->invlet = GOLD_SYM;
return;
}
-#endif
for(i = 0; i < 52; i++) inuse[i] = FALSE;
for(obj = invent; obj; obj = obj->nobj) if(obj != otmp) {
}
}
+/* some objects shouldn't be split when count given to getobj or askchain */
+STATIC_OVL boolean
+splittable(obj)
+struct obj *obj;
+{
+ return !((obj->otyp == LOADSTONE && obj->cursed) ||
+ (obj == uwep && welded(uwep)));
+}
+
/* match the prompt for either 'T' or 'R' command */
STATIC_OVL boolean
taking_off(action)
if(cnt == 0) return (struct obj *)0;
if(cnt != otmp->quan) {
/* don't split a stack of cursed loadstones */
- if (otmp->otyp == LOADSTONE && otmp->cursed)
+ if (splittable(otmp))
+ otmp = splitobj(otmp, cnt);
+ else if (otmp->otyp == LOADSTONE && otmp->cursed)
/* kludge for canletgo()'s can't-drop-this message */
otmp->corpsenm = (int) cnt;
- else
- otmp = splitobj(otmp, cnt);
}
}
return(otmp);
sym = 'n';
else {
sym = 'y';
- if (yn_number < otmp->quan && !welded(otmp) &&
- (!otmp->cursed || otmp->otyp != LOADSTONE)) {
+ if (yn_number < otmp->quan && splittable(otmp))
otmp = splitobj(otmp, yn_number);
- }
}
}
switch(sym){
STATIC_DCL int FDECL(lift_object, (struct obj *,struct obj *,long *,BOOLEAN_P));
STATIC_DCL boolean FDECL(mbag_explodes, (struct obj *,int));
STATIC_PTR int FDECL(in_container,(struct obj *));
-STATIC_PTR int FDECL(ck_bag,(struct obj *));
STATIC_PTR int FDECL(out_container,(struct obj *));
STATIC_DCL long FDECL(mbag_item_gone, (int,struct obj *));
STATIC_DCL void FDECL(observe_quantum_cat, (struct obj *));
return(current_container ? 1 : -1);
}
-STATIC_PTR int
+int
ck_bag(obj)
struct obj *obj;
{
if (cnt) Strcat(pbuf, "m");
switch (yn_function(qbuf, pbuf, 'n')) {
case ':':
- container_contents(current_container, FALSE, FALSE);
+ container_contents(current_container, FALSE, FALSE, TRUE);
goto ask_again2;
case 'y':
if (query_classes(selection, &one_by_one, &allflag,
assigninvlet(u_gold); /* might end up as NOINVSYM */
u_gold->nobj = invent;
invent = u_gold;
+ u_gold->where = OBJ_INVENT;
}
#endif
add_valid_menu_class(0); /* reset */
u_gold = invent;
invent = u_gold->nobj;
u_gold->in_use = FALSE;
+ u_gold->where = OBJ_FREE;
dealloc_obj(u_gold);
}
#endif