more "golem rust in peace"

Be prepared for life-saving to contradict "<mon> falls to pieces".
Purely hypothetically at present (with no plans to change) since
golems don't benefit from amulets of life-saving.
This commit is contained in:
PatR
2020-11-28 02:19:28 -08:00
parent 9ecbee4a4c
commit 5361958bdc
4 changed files with 38 additions and 19 deletions

View File

@@ -1,4 +1,4 @@
/* NetHack 3.7 mhitm.c $NHDT-Date: 1606473486 2020/11/27 10:38:06 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.144 $ */
/* NetHack 3.7 mhitm.c $NHDT-Date: 1606558747 2020/11/28 10:19:07 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.145 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2011. */
/* NetHack may be freely redistributed. See license for details. */
@@ -1022,8 +1022,12 @@ int dieroll;
if (g.vis && canseemon(mdef))
pline("%s is %s!", Monnam(mdef), on_fire(pd, mattk));
if (completelyburns(pd)) { /* paper golem or straw golem */
/* note: the life-saved case is hypothetical because
life-saving doesn't work for golems */
if (g.vis && canseemon(mdef))
pline("%s burns completely!", Monnam(mdef));
pline("%s %s!", Monnam(mdef),
!mlifesaver(mdef) ? "burns completely"
: "is totally engulfed in flames");
monkilled(mdef, (char *) 0, AD_FIRE);
if (!DEADMONSTER(mdef))
return 0;
@@ -1100,7 +1104,8 @@ int dieroll;
break;
if (completelyrusts(pd)) { /* PM_IRON_GOLEM */
if (g.vis && canseemon(mdef))
pline("%s falls to pieces!", Monnam(mdef));
pline("%s %s to pieces!", Monnam(mdef),
!mlifesaver(mdef) ? "falls" : "starts to fall");
monkilled(mdef, (char *) 0, AD_RUST);
if (!DEADMONSTER(mdef))
return 0;
@@ -1121,8 +1126,11 @@ int dieroll;
if (magr->mcan)
break;
if (completelyrots(pd)) { /* PM_WOOD_GOLEM || PM_LEATHER_GOLEM */
/* note: the life-saved case is hypothetical because
life-saving doesn't work for golems */
if (g.vis && canseemon(mdef))
pline("%s falls to pieces!", Monnam(mdef));
pline("%s %s to pieces!", Monnam(mdef),
!mlifesaver(mdef) ? "falls" : "starts to fall");
monkilled(mdef, (char *) 0, AD_DCAY);
if (!DEADMONSTER(mdef))
return 0;

View File

@@ -1,4 +1,4 @@
/* NetHack 3.7 mon.c $NHDT-Date: 1606473489 2020/11/27 10:38:09 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.354 $ */
/* NetHack 3.7 mon.c $NHDT-Date: 1606558762 2020/11/28 10:19:22 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.355 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Derek S. Ray, 2015. */
/* NetHack may be freely redistributed. See license for details. */
@@ -2591,7 +2591,7 @@ int how;
*fltxt ? " by the " : "", fltxt);
else
/* sad feeling is deferred until after potential life-saving */
iflags.sad_feeling = (mdef->mtame != 0);
iflags.sad_feeling = mdef->mtame ? TRUE : FALSE;
/* no corpse if digested or disintegrated or flammable golem burnt up;
no corpse for a paper golem means no scrolls; golems that rust or
@@ -2605,6 +2605,8 @@ int how;
else
mondied(mdef); /* calls mondead() and maybe leaves a corpse */
if (!DEADMONSTER(mdef))
return; /* life-saved */
/* extra message if pet golem is completely destroyed;
if not visible, this will follow "you have a sad feeling" */
if (mdef->mtame) {

View File

@@ -1,4 +1,4 @@
/* NetHack 3.7 trap.c $NHDT-Date: 1604442297 2020/11/03 22:24:57 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.365 $ */
/* NetHack 3.7 trap.c $NHDT-Date: 1606558763 2020/11/28 10:19:23 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.367 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2013. */
/* NetHack may be freely redistributed. See license for details. */
@@ -2369,12 +2369,11 @@ register struct monst *mtmp;
(void) water_damage(target, "shirt", TRUE);
}
if (mptr == &mons[PM_IRON_GOLEM]) {
if (completelyrusts(mptr)) {
if (in_sight)
pline("%s falls to pieces!", Monnam(mtmp));
else if (mtmp->mtame)
pline("May %s rust in peace.", mon_nam(mtmp));
mondied(mtmp);
pline("%s %s to pieces!", Monnam(mtmp),
!mlifesaver(mtmp) ? "falls" : "starts to fall");
monkilled(mtmp, (const char *) 0, AD_RUST);
if (DEADMONSTER(mtmp))
trapkilled = TRUE;
} else if (mptr == &mons[PM_GREMLIN] && rn2(3)) {
@@ -2400,8 +2399,10 @@ register struct monst *mtmp;
int num = d(2, 4), alt;
boolean immolate = FALSE;
/* paper burns very fast, assume straw is tightly
* packed and burns a bit slower */
/* paper burns very fast, assume straw is tightly packed
and burns a bit slower
(note: this is inconsistent with mattackm()'s AD_FIRE
damage where completelyburns() includes straw golem) */
switch (monsndx(mptr)) {
case PM_PAPER_GOLEM:
immolate = TRUE;
@@ -5245,7 +5246,7 @@ boolean nocorpse;
dam = 1;
}
mon->mhp -= dam;
if (DEADMONSTER(mon)) {
if (mon->mhp <= 0) {
int xx = mon->mx, yy = mon->my;
monkilled(mon, "", nocorpse ? -AD_RBRE : AD_PHYS);

View File

@@ -1,4 +1,4 @@
/* NetHack 3.7 uhitm.c $NHDT-Date: 1606473490 2020/11/27 10:38:10 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.243 $ */
/* NetHack 3.7 uhitm.c $NHDT-Date: 1606558760 2020/11/28 10:19:20 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.244 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2012. */
/* NetHack may be freely redistributed. See license for details. */
@@ -1769,7 +1769,11 @@ int specialdmg; /* blessed and/or silver bonus against various things */
pline("%s is %s!", Monnam(mdef), on_fire(pd, mattk));
if (completelyburns(pd)) { /* paper golem or straw golem */
if (!Blind)
pline("%s burns completely!", Monnam(mdef));
/* note: the life-saved case is hypothetical because
life-saving doesn't work for golems */
pline("%s %s!", Monnam(mdef),
!mlifesaver(mdef) ? "burns completely"
: "is totally engulfed in flames");
else
You("smell burning%s.",
(pd == &mons[PM_PAPER_GOLEM]) ? " paper"
@@ -1936,7 +1940,10 @@ int specialdmg; /* blessed and/or silver bonus against various things */
break;
case AD_RUST:
if (completelyrusts(pd)) { /* iron golem */
pline("%s falls to pieces!", Monnam(mdef));
/* note: the life-saved case is hypothetical because
life-saving doesn't work for golems */
pline("%s %s to pieces!", Monnam(mdef),
!mlifesaver(mdef) ? "falls" : "starts to fall");
xkilled(mdef, XKILL_NOMSG);
}
erode_armor(mdef, ERODE_RUST);
@@ -1948,7 +1955,8 @@ int specialdmg; /* blessed and/or silver bonus against various things */
break;
case AD_DCAY:
if (completelyrots(pd)) { /* wood golem or leather golem */
pline("%s falls to pieces!", Monnam(mdef));
pline("%s %s to pieces!", Monnam(mdef),
!mlifesaver(mdef) ? "falls" : "starts to fall");
xkilled(mdef, XKILL_NOMSG);
}
erode_armor(mdef, ERODE_ROT);