1
0
Fork 0
mirror of https://codeberg.org/noisytoot/notnotdnethack.git synced 2025-07-29 08:52:25 +01:00

Some monsters are banished instead of killed.

As pets they are more agressive, and your god doesn't get angry.
This commit is contained in:
chris 2022-05-22 22:12:57 -04:00
parent 788e8679d0
commit 12e9965296
3 changed files with 8 additions and 7 deletions

View file

@ -618,6 +618,7 @@
#define can_breathe(ptr) attacktype(ptr, AT_BREA)
#define taxes_sanity(ptr) (((ptr)->mflagsg & MG_SANLOSS) != 0L)
#define yields_insight(ptr) (((ptr)->mflagsg & MG_INSIGHT) != 0L)
#define banish_kill(mtyp) (mtyp == PM_SECRET_WHISPERER || mtyp == PM_TRUTH_SEER || mtyp == PM_DREAM_EATER || mtyp == PM_VEIL_RENDER)
#define cantwield(ptr) (nohands(ptr))
#define could_twoweap(ptr) attacktype(ptr, AT_XWEP)

View file

@ -3158,10 +3158,10 @@ struct monst * mdef; /* another monster which is next to it */
}
#ifdef ATTACK_PETS
// pets attack hostile monsters
if (magr->mtame && !mdef->mpeaceful && magr->mhp > magr->mhpmax/2)
if (magr->mtame && !mdef->mpeaceful && (magr->mhp > magr->mhpmax/2 || banish_kill(magr->mtyp)))
return ALLOW_M|ALLOW_TM;
// and vice versa, with some limitations that will help your pet survive
if (mdef->mtame && !magr->mpeaceful && mdef->mhp > mdef->mhpmax/2 && !mdef->meating && mdef != u.usteed && !mdef->mflee)
if (mdef->mtame && !magr->mpeaceful && (mdef->mhp > mdef->mhpmax/2 || banish_kill(mdef->mtyp)) && !mdef->meating && mdef != u.usteed && !mdef->mflee)
return ALLOW_M|ALLOW_TM;
#endif /* ATTACK_PETS */
@ -5311,7 +5311,7 @@ int how;
else if ((mdef->wormno ? worm_known(mdef) : cansee(mdef->mx, mdef->my))
&& fltxt)
pline("%s is %s%s%s!", Monnam(mdef),
nonliving(mdef->data) ? "destroyed" : "killed",
banish_kill(mdef->mtyp) ? "banished" : nonliving(mdef->data) ? "destroyed" : "killed",
*fltxt ? " by the " : "",
fltxt
);
@ -5423,7 +5423,7 @@ xkilled(mtmp, dest)
}
if (dest & 1) {
const char *verb = nonliving(mtmp->data) ? "destroy" : "kill";
const char *verb = banish_kill(mtmp->mtyp) ? "banish" : nonliving(mtmp->data) ? "destroy" : "kill";
if (!wasinside && !canspotmon(mtmp))
You("%s it!", verb);
@ -5657,7 +5657,7 @@ cleanup:
if (p_coaligned(mtmp)) u.ublessed = 0;
if (mdat->maligntyp == A_NONE)
adjalign((int)(ALIGNLIM / 4)); /* BIG bonus */
} else if (mtmp->mtame && !Role_if(PM_EXILE)) {
} else if (mtmp->mtame && u.ualign.type != A_VOID && !banish_kill(mtmp->mtyp)) {
adjalign(-15); /* bad!! */
/* your god is mighty displeased... */
if (!Hallucination) You_hear("the rumble of distant thunder...");

View file

@ -1584,9 +1584,9 @@ do_pit: chasm = maketrap(x,y,PIT);
if(!cansee(x,y) || mon)
pline("%s is %sed!",
cansee(x,y) ? "It" : Monnam(mtmp),
nonliving(mtmp->data) ? "destroy" : "kill");
banish_kill(mtmp->mtyp) ? "banish" : nonliving(mtmp->data) ? "destroy" : "kill");
else {
You("%s %s!", nonliving(mtmp->data) ? "destroy" :
You("%s %s!", banish_kill(mtmp->mtyp) ? "banish" : nonliving(mtmp->data) ? "destroy" :
"kill", mtmp->mtame ?
x_monnam(mtmp, ARTICLE_THE, "poor",
M_HAS_NAME(mtmp) ? SUPPRESS_SADDLE : 0, FALSE):