Add helpless monster macro

This commit is contained in:
Pasi Kallinen
2022-03-18 10:19:04 +02:00
parent 480ba917a1
commit 39acd095b2
21 changed files with 66 additions and 68 deletions

View File

@@ -1325,7 +1325,7 @@ trapeffect_slp_gas_trap(
boolean in_sight = canseemon(mtmp) || (mtmp == u.usteed);
if (!resists_sleep(mtmp) && !breathless(mtmp->data)
&& !mtmp->msleeping && mtmp->mcanmove) {
&& !helpless(mtmp)) {
if (sleep_monst(mtmp, rnd(25), -1) && in_sight) {
pline("%s suddenly falls asleep!", Monnam(mtmp));
seetrap(trap);
@@ -2581,7 +2581,7 @@ steedintrap(struct trap* trap, struct obj* otmp)
break;
case SLP_GAS_TRAP:
if (!resists_sleep(steed) && !breathless(steed->data)
&& !steed->msleeping && steed->mcanmove) {
&& !helpless(steed)) {
if (sleep_monst(steed, rnd(25), -1))
/* no in_sight check here; you can feel it even if blind */
pline("%s suddenly falls asleep!", Monnam(steed));
@@ -4687,7 +4687,7 @@ static void
reward_untrap(struct trap* ttmp, struct monst* mtmp)
{
if (!ttmp->madeby_u) {
if (rnl(10) < 8 && !mtmp->mpeaceful && !mtmp->msleeping
if (rnl(10) < 8 && !mtmp->mpeaceful && !helpless(mtmp)
&& !mtmp->mfrozen && !mindless(mtmp->data)
&& mtmp->data->mlet != S_HUMAN) {
mtmp->mpeaceful = 1;
@@ -4868,7 +4868,7 @@ help_monster_out(
return 1;
/* Will our hero succeed? */
if ((uprob = untrap_prob(ttmp)) && !mtmp->msleeping && mtmp->mcanmove) {
if ((uprob = untrap_prob(ttmp)) && !helpless(mtmp)) {
You("try to reach out your %s, but %s backs away skeptically.",
makeplural(body_part(ARM)), mon_nam(mtmp));
return 1;