avoid all cases where splitting an object would result in two objects being
quivered, wielded or otherwise having its owornflag set
allow 'a' prompt when dropping many objects in shop for credit (Wingnut)
+monsters who get polymorphed while wearing dragon armor turn into dragons
+shape changers can't be killed by system shock when hit by polymorph
+Chromatic Dragon has silver scales too (she reflects)
+being killed when wishing for an artifact should retain that item in bones data
Platform- and/or Interface-Specific Fixes
-/* SCCS Id: @(#)obj.h 3.3 1999/12/13 */
+/* SCCS Id: @(#)obj.h 3.3 2002/01/07 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
#define Is_mbag(otmp) (otmp->otyp == BAG_OF_HOLDING || \
otmp->otyp == BAG_OF_TRICKS)
+/* dragon gear */
+#define Is_dragon_scales(obj) ((obj)->otyp >= GRAY_DRAGON_SCALES && \
+ (obj)->otyp <= YELLOW_DRAGON_SCALES)
+#define Is_dragon_mail(obj) ((obj)->otyp >= GRAY_DRAGON_SCALE_MAIL && \
+ (obj)->otyp <= YELLOW_DRAGON_SCALE_MAIL)
+#define Is_dragon_armor(obj) (Is_dragon_scales(obj) || Is_dragon_mail(obj))
+#define Dragon_scales_to_pm(obj) &mons[PM_GRAY_DRAGON + (obj)->otyp \
+ - GRAY_DRAGON_SCALES]
+#define Dragon_mail_to_pm(obj) &mons[PM_GRAY_DRAGON + (obj)->otyp \
+ - GRAY_DRAGON_SCALE_MAIL]
+#define Dragon_to_scales(pm) (GRAY_DRAGON_SCALES + (pm - mons))
+
/* Light sources */
#define Is_candle(otmp) (otmp->otyp == TALLOW_CANDLE || \
otmp->otyp == WAX_CANDLE)
-/* SCCS Id: @(#)mon.c 3.3 2001/09/06 */
+/* SCCS Id: @(#)mon.c 3.3 2002/01/07 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
if (!rn2(3)) mndx = pick_animal();
break;
case CHAM_ORDINARY:
+ {
+ struct obj *m_armr = which_armor(mon, W_ARM);
+
+ if (m_armr && Is_dragon_scales(m_armr))
+ mndx = Dragon_scales_to_pm(m_armr) - mons;
+ else if (m_armr && Is_dragon_mail(m_armr))
+ mndx = Dragon_mail_to_pm(m_armr) - mons;
+ }
break;
}
#ifdef WIZARD
-/* SCCS Id: @(#)muse.c 3.3 2001/11/19 */
+/* SCCS Id: @(#)muse.c 3.3 2002/01/07 */
/* Copyright (C) 1990 by Ken Arromdee */
/* NetHack may be freely redistributed. See license for details. */
* don't know not to read scrolls, etc....
*/
+STATIC_DCL struct permonst *FDECL(muse_newcham_mon, (struct monst *));
STATIC_DCL int FDECL(precheck, (struct monst *,struct obj *));
STATIC_DCL void FDECL(mzapmsg, (struct monst *,struct obj *,BOOLEAN_P));
STATIC_DCL void FDECL(mreadmsg, (struct monst *,struct obj *));
#undef nomore
}
+/* type of monster to polymorph into; defaults to one suitable for the
+ current level rather than the totally arbitrary choice of newcham() */
+static struct permonst *
+muse_newcham_mon(mon)
+struct monst *mon;
+{
+ struct obj *m_armr;
+
+ if ((m_armr = which_armor(mon, W_ARM)) != 0) {
+ if (Is_dragon_scales(m_armr))
+ return Dragon_scales_to_pm(m_armr);
+ else if (Is_dragon_mail(m_armr))
+ return Dragon_mail_to_pm(m_armr);
+ }
+ return rndmonst();
+}
+
int
use_misc(mtmp)
struct monst *mtmp;
case MUSE_WAN_POLYMORPH:
mzapmsg(mtmp, otmp, TRUE);
otmp->spe--;
- (void) newcham(mtmp, rndmonst(), TRUE);
+ (void) newcham(mtmp, muse_newcham_mon(mtmp), TRUE);
if (oseen) makeknown(WAN_POLYMORPH);
return 2;
case MUSE_POT_POLYMORPH:
mquaffmsg(mtmp, otmp);
if (vismon) pline("%s suddenly mutates!", Monnam(mtmp));
- (void) newcham(mtmp, rndmonst(), FALSE);
+ (void) newcham(mtmp, muse_newcham_mon(mtmp), FALSE);
if (oseen) makeknown(POT_POLYMORPH);
m_useup(mtmp, otmp);
return 2;
if (str)
pline(str, s_suffix(mon_nam(mon)), "armor");
return TRUE;
- } else if (mon->data == &mons[PM_SILVER_DRAGON]) {
+ } else if (mon->data == &mons[PM_SILVER_DRAGON] ||
+ mon->data == &mons[PM_CHROMATIC_DRAGON]) {
/* Silver dragons only reflect when mature; babies do not */
if (str)
pline(str, s_suffix(mon_nam(mon)), "scales");
-/* SCCS Id: @(#)worn.c 3.3 2001/09/05 */
+/* SCCS Id: @(#)worn.c 3.3 2002/01/07 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
if (breakarm(mdat)) {
if ((otmp = which_armor(mon, W_ARM)) != 0) {
- if (vis)
+ if ((Is_dragon_scales(otmp) &&
+ mdat == Dragon_scales_to_pm(otmp)) ||
+ (Is_dragon_mail(otmp) && mdat == Dragon_mail_to_pm(otmp)))
+ ; /* no message here;
+ "the dragon merges with his scaly armor" is odd
+ and the monster's previous form is already gone */
+ else if (vis)
pline("%s breaks out of %s armor!", Monnam(mon), ppronoun);
else
You_hear("a cracking sound.");
-/* SCCS Id: @(#)zap.c 3.3 2001/12/29 */
+/* SCCS Id: @(#)zap.c 3.3 2002/01/07 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
it guard against involuntary polymorph attacks too... */
shieldeff(mtmp->mx, mtmp->my);
} else if (!resist(mtmp, otmp->oclass, 0, NOTELL)) {
- if (!rn2(25)) {
+ /* natural shapechangers aren't affected by system shock
+ (unless protection from shapechangers is interfering
+ with their metabolism...) */
+ if (mtmp->cham == CHAM_ORDINARY && !rn2(25)) {
if (canseemon(mtmp)) {
pline("%s shudders!", Monnam(mtmp));
makeknown(otyp);
u.uconduct.wishes++;
if (otmp != &zeroobj) {
- if(otmp->oartifact && !touch_artifact(otmp,&youmonst))
- dropy(otmp);
- else
+ /* in case touching this object turns out to be fatal */
+ place_object(otmp, u.ux, u.uy);
+
+ if (otmp->oartifact && !touch_artifact(otmp,&youmonst)) {
+ obj_extract_self(otmp); /* remove it from the floor */
+ dropy(otmp); /* now put it back again :-) */
+ } else {
+ obj_extract_self(otmp);
/* The(aobjnam()) is safe since otmp is unidentified -dlc */
(void) hold_another_object(otmp, u.uswallow ?
"Oops! %s out of your reach!" :
Is_airlevel(&u.uz) || u.uinwater ?
"slip" : "drop")),
(const char *)0);
+ }
u.ublesscnt += rn1(100,50); /* the gods take notice */
}
}