Merge branch 'NetHack-3.6.2'
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 makemon.c $NHDT-Date: 1550524560 2019/02/18 21:16:00 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.132 $ */
|
||||
/* NetHack 3.6 makemon.c $NHDT-Date: 1555801218 2019/04/20 23:00:18 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.133 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/*-Copyright (c) Robert Patrick Rankin, 2012. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
@@ -1083,7 +1083,7 @@ coord *cc;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
gotgood:
|
||||
gotgood:
|
||||
cc->x = nx;
|
||||
cc->y = ny;
|
||||
return TRUE;
|
||||
@@ -2205,7 +2205,7 @@ register struct monst *mtmp;
|
||||
}
|
||||
} else {
|
||||
s_sym = syms[rn2((int) sizeof(syms))];
|
||||
assign_sym:
|
||||
assign_sym:
|
||||
if (s_sym == MAXOCLASSES || s_sym == MAXOCLASSES + 1) {
|
||||
ap_type = M_AP_FURNITURE;
|
||||
appear = (s_sym == MAXOCLASSES) ? S_upstair : S_dnstair;
|
||||
@@ -2225,12 +2225,21 @@ register struct monst *mtmp;
|
||||
}
|
||||
mtmp->m_ap_type = ap_type;
|
||||
mtmp->mappearance = appear;
|
||||
if (ap_type == M_AP_OBJECT && (appear == STATUE || appear == CORPSE
|
||||
|| appear == FIGURINE || appear == EGG)) {
|
||||
/* when appearing as an object based on a monster type, pick a shape */
|
||||
if (ap_type == M_AP_OBJECT
|
||||
&& (appear == STATUE || appear == FIGURINE
|
||||
|| appear == CORPSE || appear == EGG || appear == TIN)) {
|
||||
int mndx = rndmonnum(),
|
||||
nocorpse_ndx = (g.mvitals[mndx].mvflags & G_NOCORPSE) != 0;
|
||||
|
||||
if (appear == CORPSE && nocorpse_ndx)
|
||||
mndx = rn1(PM_WIZARD - PM_ARCHEOLOGIST + 1, PM_ARCHEOLOGIST);
|
||||
else if ((appear == EGG && !can_be_hatched(mndx))
|
||||
|| (appear == TIN && nocorpse_ndx))
|
||||
mndx = NON_PM; /* revert to generic egg or empty tin */
|
||||
|
||||
newmcorpsenm(mtmp);
|
||||
MCORPSENM(mtmp) = rndmonnum();
|
||||
if (appear == EGG && !can_be_hatched(MCORPSENM(mtmp)))
|
||||
MCORPSENM(mtmp) = NON_PM; /* revert to generic egg */
|
||||
MCORPSENM(mtmp) = mndx;
|
||||
}
|
||||
|
||||
if (does_block(mx, my, &levl[mx][my]))
|
||||
|
||||
11
src/mhitm.c
11
src/mhitm.c
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 mhitm.c $NHDT-Date: 1547118629 2019/01/10 11:10:29 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.112 $ */
|
||||
/* NetHack 3.6 mhitm.c $NHDT-Date: 1555720096 2019/04/20 00:28:16 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.113 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/*-Copyright (c) Robert Patrick Rankin, 2011. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
@@ -1090,6 +1090,7 @@ register struct attack *mattk;
|
||||
if (!cancelled && tmp < mdef->mhp && !tele_restrict(mdef)) {
|
||||
char mdef_Monnam[BUFSZ];
|
||||
boolean wasseen = canspotmon(mdef);
|
||||
|
||||
/* save the name before monster teleports, otherwise
|
||||
we'll get "it" in the suddenly disappears message */
|
||||
if (g.vis && wasseen)
|
||||
@@ -1098,6 +1099,11 @@ register struct attack *mattk;
|
||||
(void) rloc(mdef, TRUE);
|
||||
if (g.vis && wasseen && !canspotmon(mdef) && mdef != u.usteed)
|
||||
pline("%s suddenly disappears!", mdef_Monnam);
|
||||
if (tmp >= mdef->mhp) { /* see hitmu(mhitu.c) */
|
||||
if (mdef->mhp == 1)
|
||||
++mdef->mhp;
|
||||
tmp = mdef->mhp - 1;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case AD_SLEE:
|
||||
@@ -1345,7 +1351,8 @@ register struct attack *mattk;
|
||||
break; /* physical damage only */
|
||||
if (!rn2(4) && !slimeproof(pd)) {
|
||||
if (!munslime(mdef, FALSE) && !DEADMONSTER(mdef)) {
|
||||
if (newcham(mdef, &mons[PM_GREEN_SLIME], FALSE, g.vis && canseemon(mdef)))
|
||||
if (newcham(mdef, &mons[PM_GREEN_SLIME], FALSE,
|
||||
(boolean) (g.vis && canseemon(mdef))))
|
||||
pd = mdef->data;
|
||||
mdef->mstrategy &= ~STRAT_WAITFORU;
|
||||
res = MM_HIT;
|
||||
|
||||
37
src/mhitu.c
37
src/mhitu.c
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 mhitu.c $NHDT-Date: 1547118629 2019/01/10 11:10:29 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.161 $ */
|
||||
/* NetHack 3.6 mhitu.c $NHDT-Date: 1555720104 2019/04/20 00:28:24 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.162 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/*-Copyright (c) Robert Patrick Rankin, 2012. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
@@ -921,7 +921,7 @@ register struct attack *mattk;
|
||||
{
|
||||
struct permonst *mdat = mtmp->data;
|
||||
int uncancelled, ptmp;
|
||||
int dmg, armpro, permdmg;
|
||||
int dmg, armpro, permdmg, tmphp;
|
||||
char buf[BUFSZ];
|
||||
struct permonst *olduasmon = g.youmonst.data;
|
||||
int res;
|
||||
@@ -1396,8 +1396,39 @@ register struct attack *mattk;
|
||||
hitmsg(mtmp, mattk);
|
||||
if (uncancelled) {
|
||||
if (flags.verbose)
|
||||
Your("position suddenly seems very uncertain!");
|
||||
Your("position suddenly seems %suncertain!",
|
||||
(Teleport_control && !Stunned && !unconscious()) ? ""
|
||||
: "very ");
|
||||
tele();
|
||||
/* 3.6.2: make sure damage isn't fatal; previously, it
|
||||
was possible to be teleported and then drop dead at
|
||||
the destination when QM's 1d4 damage gets applied below;
|
||||
even though that wasn't "wrong", it seemed strange,
|
||||
particularly if the teleportation had been controlled
|
||||
[applying the damage first and not teleporting if fatal
|
||||
is another alternative but it has its own complications] */
|
||||
if ((Half_physical_damage ? (dmg - 1) / 2 : dmg)
|
||||
>= (tmphp = (Upolyd ? u.mh : u.uhp))) {
|
||||
dmg = tmphp - 1;
|
||||
if (Half_physical_damage)
|
||||
dmg *= 2; /* doesn't actually increase damage; we only
|
||||
* get here if half the original damage would
|
||||
* would have been fatal, so double reduced
|
||||
* damage will be less than original damage */
|
||||
if (dmg < 1) { /* implies (tmphp <= 1) */
|
||||
dmg = 1;
|
||||
/* this might increase current HP beyond maximum HP but
|
||||
it will be immediately reduced below, so that should
|
||||
be indistinguishable from zero damage; we don't drop
|
||||
damage all the way to zero because that inhibits any
|
||||
passive counterattack if poly'd hero has one */
|
||||
if (Upolyd && u.mh == 1)
|
||||
++u.mh;
|
||||
else if (!Upolyd && u.uhp == 1)
|
||||
++u.uhp;
|
||||
/* [don't set context.botl here] */
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case AD_RUST:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 uhitm.c $NHDT-Date: 1553644725 2019/03/26 23:58:45 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.206 $ */
|
||||
/* NetHack 3.6 uhitm.c $NHDT-Date: 1555720104 2019/04/20 00:28:24 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.207 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/*-Copyright (c) Robert Patrick Rankin, 2012. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
@@ -1737,7 +1737,7 @@ int specialdmg; /* blessed and/or silver bonus against various things */
|
||||
case AD_TLPT:
|
||||
if (tmp <= 0)
|
||||
tmp = 1;
|
||||
if (!negated && tmp < mdef->mhp) {
|
||||
if (!negated) {
|
||||
char nambuf[BUFSZ];
|
||||
boolean u_saw_mon = (canseemon(mdef)
|
||||
|| (u.uswallow && u.ustuck == mdef));
|
||||
@@ -1747,6 +1747,11 @@ int specialdmg; /* blessed and/or silver bonus against various things */
|
||||
if (u_teleport_mon(mdef, FALSE) && u_saw_mon
|
||||
&& !(canseemon(mdef) || (u.uswallow && u.ustuck == mdef)))
|
||||
pline("%s suddenly disappears!", nambuf);
|
||||
if (tmp >= mdef->mhp) { /* see hitmu(mhitu.c) */
|
||||
if (mdef->mhp == 1)
|
||||
++mdef->mhp;
|
||||
tmp = mdef->mhp - 1;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case AD_BLND:
|
||||
|
||||
Reference in New Issue
Block a user