do dipped potion(s) explode? */
| 2414 | |
| 2415 | /* do dipped potion(s) explode? */ |
| 2416 | staticfn boolean |
| 2417 | dip_potion_explosion(struct obj *obj, int dmg) |
| 2418 | { |
| 2419 | if (obj->cursed || obj->otyp == POT_ACID |
| 2420 | || (obj->otyp == POT_OIL && obj->lamplit) |
| 2421 | || !rn2((uarmc && uarmc->otyp == ALCHEMY_SMOCK) ? 30 : 10)) { |
| 2422 | /* it would be better to use up the whole stack in advance |
| 2423 | of the message, but we can't because we need to keep it |
| 2424 | around for potionbreathe() [and we can't set obj->in_use |
| 2425 | to 'amt' because that's not implemented] */ |
| 2426 | obj->in_use = 1; |
| 2427 | pline("%sThey explode!", !Deaf ? "BOOM! " : ""); |
| 2428 | wake_nearto(u.ux, u.uy, (BOLT_LIM + 1) * (BOLT_LIM + 1)); |
| 2429 | exercise(A_STR, FALSE); |
| 2430 | if (!breathless(gy.youmonst.data) || haseyes(gy.youmonst.data)) |
| 2431 | potionbreathe(obj); |
| 2432 | useupall(obj); |
| 2433 | losehp(dmg, /* not physical damage */ |
| 2434 | "alchemic blast", KILLED_BY_AN); |
| 2435 | return TRUE; |
| 2436 | } |
| 2437 | return FALSE; |
| 2438 | } |
| 2439 | |
| 2440 | /* called by dodip() or dip_into() after obj and potion have been chosen */ |
| 2441 | staticfn int |
no test coverage detected