Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Chris-plus-alphanumericgibberish/f2b67fe3a76ccd1fbd69 to your computer and use it in GitHub Desktop.
Save Chris-plus-alphanumericgibberish/f2b67fe3a76ccd1fbd69 to your computer and use it in GitHub Desktop.
Extra attack vs a monster
STATIC_OVL boolean
hitum(mon, tmp, uattk) /* returns TRUE if monster still lives */
struct monst *mon;
int tmp;
struct attack *uattk;
{
boolean malive;
int mhit = (tmp > (dieroll = rnd(20)) || u.uswallow);
if(mhit && is_displacer(mon->data) && rn2(2)){
You("hit a displaced image!");
return TRUE;
}
if(tmp > dieroll) exercise(A_DEX, TRUE);
malive = known_hitum(mon, &mhit, uattk);
(void) passive(mon, mhit, malive, AT_WEAP);
if(u.sealsActive&SEAL_MARIONETTE && uwep){
struct monst *m2 = m_at(mon->mx+u.dx,mon->my+u.dy);
if(!m2 || DEADMONSTER(m2) || m2==mon) return(malive);
int mhit = (tmp > (dieroll = rnd(20)) || u.uswallow);
if(tmp > dieroll) exercise(A_DEX, TRUE);
(void) passive(m2, mhit, known_hitum(m2, &mhit, uattk), AT_WEAP);
}
return(malive);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment