Skip to content

Commit

Permalink
When declining to kick a monster with confirm on, use no time and don…
Browse files Browse the repository at this point in the history
…'t wake nearby monsters.
  • Loading branch information
sgrunt committed Apr 20, 2012
1 parent f67c847 commit a2ec6da
Showing 1 changed file with 21 additions and 12 deletions.
33 changes: 21 additions & 12 deletions src/dokick.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ static NEARDATA const char *gate_str;
extern boolean notonhead; /* for long worms */

STATIC_DCL void FDECL(kickdmg, (struct monst *, BOOLEAN_P));
STATIC_DCL void FDECL(kick_monster, (XCHAR_P, XCHAR_P));
STATIC_DCL boolean FDECL(kick_monster, (XCHAR_P, XCHAR_P));
STATIC_DCL int FDECL(kick_object, (XCHAR_P, XCHAR_P));
STATIC_DCL char *FDECL(kickstr, (char *));
STATIC_DCL void FDECL(otransit_msg, (struct obj *, BOOLEAN_P, long));
Expand Down Expand Up @@ -115,7 +115,7 @@ register boolean clumsy;
use_skill(kick_skill, 1);
}

STATIC_OVL void
STATIC_OVL boolean
kick_monster(x, y)
register xchar x, y;
{
Expand All @@ -127,7 +127,7 @@ register xchar x, y;

bhitpos.x = x;
bhitpos.y = y;
if (attack_checks(mon, (struct obj *)0)) return;
if (attack_checks(mon, (struct obj *)0)) return FALSE;
setmangry(mon);

/* Kick attacks by kicking monsters are normal attacks, not special.
Expand Down Expand Up @@ -167,15 +167,15 @@ register xchar x, y;
(void)passive(mon, 0, 1, AT_KICK);
}
}
return;
return TRUE;
}

if(Levitation && !rn2(3) && verysmall(mon->data) &&
!is_flyer(mon->data)) {
pline("Floating in the air, you miss wildly!");
exercise(A_DEX, FALSE);
(void) passive(mon, FALSE, 1, AT_KICK);
return;
return TRUE;
}

i = -inv_weight();
Expand All @@ -186,7 +186,7 @@ register xchar x, y;
if(martial() && !rn2(2)) goto doit;
Your("clumsy kick does no damage.");
(void) passive(mon, FALSE, 1, AT_KICK);
return;
return TRUE;
}
if(i < j/10) clumsy = TRUE;
else if(!rn2((i < j/5) ? 2 : 3)) clumsy = TRUE;
Expand All @@ -213,7 +213,7 @@ register xchar x, y;
pline("%s blocks your %skick.", Monnam(mon),
clumsy ? "clumsy " : "");
(void) passive(mon, FALSE, 1, AT_KICK);
return;
return TRUE;
} else {
rloc_to(mon, bypos.x, bypos.y);
if(mon->mx != x || mon->my != y) {
Expand All @@ -231,11 +231,13 @@ register xchar x, y;
clumsy ? "easily" : "nimbly",
clumsy ? "clumsy " : "");
(void) passive(mon, FALSE, 1, AT_KICK);
return;
return TRUE;
}
}
}
kickdmg(mon, clumsy);

return TRUE;
}

/*
Expand Down Expand Up @@ -744,9 +746,6 @@ dokick()
}
}

wake_nearby();
u_wipe_engr(2);

maploc = &levl[x][y];

/* The next five tests should stay in */
Expand All @@ -755,13 +754,19 @@ dokick()

if(MON_AT(x, y)) {
struct permonst *mdat;
boolean ret;

mtmp = m_at(x, y);
mdat = mtmp->data;
if (!mtmp->mpeaceful || !canspotmon(mtmp))
flags.forcefight = TRUE; /* attack even if invisible */
kick_monster(x, y);
ret = kick_monster(x, y);
flags.forcefight = FALSE;
if (!ret) return(0);

wake_nearby();
u_wipe_engr(2);

/* see comment in attack_checks() */
if (!DEADMONSTER(mtmp) &&
(!canspotmon(mtmp) || displaced_image(mtmp))&&
Expand All @@ -783,6 +788,10 @@ dokick()
}
return(1);
}

wake_nearby();
u_wipe_engr(2);

if (glyph_is_invisible(levl[x][y].glyph)) {
unmap_object(x, y);
newsym(x, y);
Expand Down

0 comments on commit a2ec6da

Please sign in to comment.