Large monster can knock back smaller ones

When a monster at least two sizes larger hits another one,
there's a chance the smaller defender will be knocked back.

This applies also to hero, attacking when polymorphed to
a large monster, or defending from a large monster.

Most of the monsters that can knock back are giants and dragons.

Idea and some of the code from EvilHack.
This commit is contained in:
Pasi Kallinen
2022-07-18 23:01:08 +03:00
parent 7bf02ade48
commit 0bca93be87
5 changed files with 103 additions and 2 deletions

View File

@@ -946,6 +946,9 @@ mdamagem(struct monst *magr, struct monst *mdef,
}
mhitm_adtyping(magr, mattk, mdef, &mhm);
(void) mhitm_knockback(magr, mdef, mattk, &mhm.hitflags, (MON_WEP(magr) != 0));
if (mhm.done)
return mhm.hitflags;