Merge branch 'NetHack-3.6'

This commit is contained in:
nhmall
2019-08-02 22:50:13 -04:00
7 changed files with 84 additions and 35 deletions

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 mthrowu.c $NHDT-Date: 1542765360 2018/11/21 01:56:00 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.78 $ */
/* NetHack 3.6 mthrowu.c $NHDT-Date: 1564767726 2019/08/02 17:42:06 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.85 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Pasi Kallinen, 2016. */
/* NetHack may be freely redistributed. See license for details. */
@@ -175,7 +175,10 @@ struct obj *otmp, *mwep;
/* Elven Craftsmanship makes for light, quick bows */
if (otmp->otyp == ELVEN_ARROW && !otmp->cursed)
multishot++;
if (ammo_and_launcher(otmp, uwep) && mwep->otyp == ELVEN_BOW
/* for arrow, we checked bow&arrow when entering block, but for
bow, so far we've only validated that otmp is a weapon stack;
need to verify that it's a stack of arrows rather than darts */
if (mwep && mwep->otyp == ELVEN_BOW && ammo_and_launcher(otmp, mwep)
&& !mwep->cursed)
multishot++;
/* 1/3 of launcher enchantment */

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 pray.c $NHDT-Date: 1562462064 2019/07/07 01:14:24 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.116 $ */
/* NetHack 3.6 pray.c $NHDT-Date: 1564532667 2019/07/31 00:24:27 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.117 $ */
/* Copyright (c) Benson I. Margulies, Mike Stephenson, Steve Linhart, 1989. */
/* NetHack may be freely redistributed. See license for details. */
@@ -765,6 +765,20 @@ gcrownu()
HPoison_resistance |= FROMOUTSIDE;
godvoice(u.ualign.type, (char *) 0);
class_gift = STRANGE_OBJECT;
/* 3.3.[01] had this in the A_NEUTRAL case,
preventing chaotic wizards from receiving a spellbook */
if (Role_if(PM_WIZARD)
&& (!uwep || (uwep->oartifact != ART_VORPAL_BLADE
&& uwep->oartifact != ART_STORMBRINGER))
&& !carrying(SPE_FINGER_OF_DEATH)) {
class_gift = SPE_FINGER_OF_DEATH;
} else if (Role_if(PM_MONK) && (!uwep || !uwep->oartifact)
&& !carrying(SPE_RESTORE_ABILITY)) {
/* monks rarely wield a weapon */
class_gift = SPE_RESTORE_ABILITY;
}
obj = ok_wep(uwep) ? uwep : 0;
already_exists = in_hand = FALSE; /* lint suppression */
switch (u.ualign.type) {
@@ -785,19 +799,13 @@ gcrownu()
already_exists =
exist_artifact(RUNESWORD, artiname(ART_STORMBRINGER));
verbalize("Thou art chosen to %s for My Glory!",
already_exists && !in_hand ? "take lives" : "steal souls");
((already_exists && !in_hand)
|| class_gift != STRANGE_OBJECT) ? "take lives"
: "steal souls");
break;
}
class_gift = STRANGE_OBJECT;
/* 3.3.[01] had this in the A_NEUTRAL case below,
preventing chaotic wizards from receiving a spellbook */
if (Role_if(PM_WIZARD)
&& (!uwep || (uwep->oartifact != ART_VORPAL_BLADE
&& uwep->oartifact != ART_STORMBRINGER))
&& !carrying(SPE_FINGER_OF_DEATH)) {
class_gift = SPE_FINGER_OF_DEATH;
make_splbk:
if (objects[class_gift].oc_class == SPBOOK_CLASS) {
obj = mksobj(class_gift, TRUE, FALSE);
bless(obj);
obj->bknown = 1; /* ok to skip set_bknown() */
@@ -812,11 +820,6 @@ gcrownu()
obj = uwep; /* to be blessed,&c */
break;
}
} else if (Role_if(PM_MONK) && (!uwep || !uwep->oartifact)
&& !carrying(SPE_RESTORE_ABILITY)) {
/* monks rarely wield a weapon */
class_gift = SPE_RESTORE_ABILITY;
goto make_splbk;
}
switch (u.ualign.type) {

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 teleport.c $NHDT-Date: 1561336020 2019/06/24 00:27:00 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.89 $ */
/* NetHack 3.6 teleport.c $NHDT-Date: 1564771880 2019/08/02 18:51:20 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.92 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2011. */
/* NetHack may be freely redistributed. See license for details. */
@@ -1447,6 +1447,9 @@ register struct obj *obj;
g.dndest.nhx, g.dndest.nhy)));
if (flooreffects(obj, tx, ty, "fall")) {
/* update old location since flooreffects() couldn't;
unblock_point() for boulder handled by obj_extract_self() */
newsym(otx, oty);
return FALSE;
} else if (otx == 0 && oty == 0) {
; /* fell through a trap door; no update of old loc needed */
@@ -1463,6 +1466,7 @@ register struct obj *obj;
newsym(otx, oty); /* update old location */
}
place_object(obj, tx, ty);
/* note: block_point() for boulder handled by place_object() */
newsym(tx, ty);
return TRUE;
}

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 timeout.c $NHDT-Date: 1559664953 2019/06/04 16:15:53 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.90 $ */
/* NetHack 3.6 timeout.c $NHDT-Date: 1564269133 2019/07/27 23:12:13 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.91 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2018. */
/* NetHack may be freely redistributed. See license for details. */
@@ -1866,13 +1866,32 @@ short kind;
short func_index;
anything *arg;
{
timer_element *gnu;
timer_element *gnu, *dup;
if (func_index < 0 || func_index >= NUM_TIME_FUNCS)
panic("start_timer");
if (kind < 0 || kind >= NUM_TIMER_KINDS
|| func_index < 0 || func_index >= NUM_TIME_FUNCS)
panic("start_timer (%s: %d)", kind_name(kind), (int) func_index);
gnu = (timer_element *) alloc(sizeof(timer_element));
(void) memset((genericptr_t)gnu, 0, sizeof(timer_element));
/* fail if <arg> already has a <func_index> timer running */
for (dup = g.timer_base; dup; dup = dup->next)
if (dup->kind == kind
&& dup->func_index == func_index
&& dup->arg.a_void == arg->a_void)
break;
if (dup) {
char idbuf[QBUFSZ];
#ifdef VERBOSE_TIMER
Sprintf(idbuf, "%s timer", timeout_funcs[func_index].name);
#else
Sprintf(idbuf, "%s timer (%d)", kind_name(kind), (int) func_index);
#endif
impossible("Attempted to start duplicate %s, aborted.", idbuf);
return FALSE;
}
gnu = (timer_element *) alloc(sizeof *gnu);
(void) memset((genericptr_t) gnu, 0, sizeof *gnu);
gnu->next = 0;
gnu->tid = g.timer_id++;
gnu->timeout = g.monstermoves + when;
@@ -1885,7 +1904,6 @@ anything *arg;
if (kind == TIMER_OBJECT) /* increment object's timed count */
(arg->a_obj)->timed++;
/* should check for duplicates and fail if any */
return TRUE;
}