Give barbed devils a sticking attack

This commit is contained in:
Pasi Kallinen
2023-10-04 11:09:21 +03:00
parent f83a57c5bf
commit 3946c5a01d
3 changed files with 12 additions and 2 deletions

View File

@@ -3175,16 +3175,22 @@ mhitm_ad_stck(
{
boolean negated = mhitm_mgc_atk_negated(magr, mdef, FALSE);
struct permonst *pd = mdef->data;
boolean barbs = (magr->data == &mons[PM_BARBED_DEVIL]);
if (magr == &gy.youmonst) {
/* uhitm */
if (!negated && !sticks(pd) && next2u(mdef->mx, mdef->my))
if (!negated && !sticks(pd) && next2u(mdef->mx, mdef->my)) {
set_ustuck(mdef); /* it's now stuck to you */
if (barbs)
Your("barbs stick to %s!", y_monnam(mdef));
}
} else if (mdef == &gy.youmonst) {
/* mhitu */
hitmsg(magr, mattk);
if (!negated && !u.ustuck && !sticks(pd)) {
set_ustuck(magr);
if (barbs)
pline("The barbs stick to you!");
}
} else {
/* mhitm */
@@ -5169,6 +5175,9 @@ mhitm_knockback(
You_feel("%s be knocked %s!", some_mon_nam(mdef), knockedhow);
}
if (u.ustuck && (u_def || u_agr))
unstuck(u.ustuck);
/* do the actual knockback effect */
if (u_def) {
if (dismount) {