Merge branch 'NetHack-3.6'

This commit is contained in:
nhmall
2019-09-21 10:52:13 -04:00
3 changed files with 41 additions and 18 deletions

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 apply.c $NHDT-Date: 1559670602 2019/06/04 17:50:02 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.274 $ */
/* NetHack 3.6 apply.c $NHDT-Date: 1568922511 2019/09/19 19:48:31 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.277 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2012. */
/* NetHack may be freely redistributed. See license for details. */
@@ -2301,13 +2301,14 @@ static void
use_stone(tstone)
struct obj *tstone;
{
static const char scritch[] = "\"scritch, scritch\"";
static const char allowall[3] = { COIN_CLASS, ALL_CLASSES, 0 };
static const char coins_gems[3] = { COIN_CLASS, GEM_CLASS, 0 };
struct obj *obj;
boolean do_scratch;
const char *streak_color, *choices;
char stonebuf[QBUFSZ];
static const char scritch[] = "\"scritch, scritch\"";
static const char allowall[3] = { COIN_CLASS, ALL_CLASSES, 0 };
static const char coins_gems[3] = { COIN_CLASS, GEM_CLASS, 0 };
int oclass;
/* in case it was acquired while blinded */
if (!Blind)
@@ -2352,7 +2353,14 @@ struct obj *tstone;
do_scratch = FALSE;
streak_color = 0;
switch (obj->oclass) {
oclass = obj->oclass;
/* prevent non-gemstone rings from being treated like gems */
if (oclass == RING_CLASS
&& objects[obj->otyp].oc_material != GEMSTONE
&& objects[obj->otyp].oc_material != MINERAL)
oclass = RANDOM_CLASS; /* something that's neither gem nor ring */
switch (oclass) {
case GEM_CLASS: /* these have class-specific handling below */
case RING_CLASS:
if (tstone->otyp != TOUCHSTONE) {
@@ -3712,25 +3720,34 @@ boolean is_horn;
if (Stoned)
unfixable_trbl++;
if (Slimed)
unfixable_trbl++;
if (Strangled)
unfixable_trbl++;
if (Wounded_legs && !u.usteed)
unfixable_trbl++;
if (Slimed)
unfixable_trbl++;
/* lycanthropy is undesirable, but it doesn't actually make you feel bad */
/* lycanthropy is undesirable, but it doesn't actually make you feel bad
so don't count it as a trouble which can't be fixed */
if (!is_horn || (Confusion & ~TIMEOUT))
/*
* Unicorn horn can fix these when they're timed but not when
* they aren't. Potion of restore ability doesn't touch them,
* so they're always unfixable for the not-unihorn case.
* [Most of these are timed only, so always curable via horn.
* An exception is Stunned, which can be forced On by certain
* polymorph forms (stalker, bats).]
*/
if (Sick && (!is_horn || (Sick & ~TIMEOUT) != 0L))
unfixable_trbl++;
if (!is_horn || (Sick & ~TIMEOUT))
if (Stunned && (!is_horn || (HStun & ~TIMEOUT) != 0L))
unfixable_trbl++;
if (!is_horn || (HHallucination & ~TIMEOUT))
if (Confusion && (!is_horn || (HConfusion & ~TIMEOUT) != 0L))
unfixable_trbl++;
if (!is_horn || (Vomiting & ~TIMEOUT))
if (Hallucination && (!is_horn || (HHallucination & ~TIMEOUT) != 0L))
unfixable_trbl++;
if (!is_horn || (HStun & ~TIMEOUT))
if (Vomiting && (!is_horn || (Vomiting & ~TIMEOUT) != 0L))
unfixable_trbl++;
if (!is_horn || (HDeaf & ~TIMEOUT))
if (Deaf && (!is_horn || (HDeaf & ~TIMEOUT) != 0L))
unfixable_trbl++;
return unfixable_trbl;