| 261 | } |
| 262 | |
| 263 | void |
| 264 | expels( |
| 265 | struct monst *mtmp, |
| 266 | struct permonst *mdat, /* if mtmp is polymorphed, mdat != mtmp->data */ |
| 267 | boolean message) |
| 268 | { |
| 269 | disp.botl = TRUE; |
| 270 | if (message) { |
| 271 | if (digests(mdat)) { |
| 272 | You("get regurgitated!"); |
| 273 | } else if (enfolds(mdat)) { |
| 274 | pline_mon(mtmp, "%s unfolds and you are released!", Monnam(mtmp)); |
| 275 | } else { |
| 276 | char blast[40]; |
| 277 | struct attack *attk = attacktype_fordmg(mdat, AT_ENGL, AD_ANY); |
| 278 | |
| 279 | blast[0] = '\0'; |
| 280 | if (!attk) { |
| 281 | impossible("Swallower has no engulfing attack?"); |
| 282 | } else { |
| 283 | if (is_whirly(mdat)) { |
| 284 | switch (attk->adtyp) { |
| 285 | case AD_ELEC: |
| 286 | Strcpy(blast, " in a shower of sparks"); |
| 287 | break; |
| 288 | case AD_COLD: |
| 289 | Strcpy(blast, " in a blast of frost"); |
| 290 | break; |
| 291 | } |
| 292 | } else { |
| 293 | Strcpy(blast, " with a squelch"); |
| 294 | } |
| 295 | You("get expelled from %s%s!", mon_nam(mtmp), blast); |
| 296 | } |
| 297 | } |
| 298 | } |
| 299 | unstuck(mtmp); /* ball&chain returned in unstuck() */ |
| 300 | mnexto(mtmp, RLOC_NOMSG); |
| 301 | newsym(u.ux, u.uy); |
| 302 | /* to cover for a case where mtmp is not in a next square */ |
| 303 | if (um_dist(mtmp->mx, mtmp->my, 1)) |
| 304 | pline("Brrooaa... You land hard at some distance."); |
| 305 | spoteffects(TRUE); |
| 306 | } |
| 307 | |
| 308 | /* select a monster's next attack, possibly substituting for its usual one */ |
| 309 | struct attack * |
no test coverage detected