monster mtmp breaks boulder at x,y */
| 140 | |
| 141 | /* monster mtmp breaks boulder at x,y */ |
| 142 | void |
| 143 | m_break_boulder(struct monst *mtmp, coordxy x, coordxy y) |
| 144 | { |
| 145 | struct obj *otmp; |
| 146 | |
| 147 | if (m_can_break_boulder(mtmp) && ((otmp = sobj_at(BOULDER, x, y)) != 0)) { |
| 148 | if (!is_rider(mtmp->data)) { |
| 149 | if (!Deaf && (mdistu(mtmp) < 4*4)) { |
| 150 | if (canspotmon(mtmp)) |
| 151 | set_msg_xy(mtmp->mx, mtmp->my); |
| 152 | pline("%s mutters %s.", |
| 153 | Monnam(mtmp), |
| 154 | mtmp->ispriest ? "a prayer" : "an incantation"); |
| 155 | } |
| 156 | mtmp->mspec_used += rn1(20, 10); |
| 157 | } |
| 158 | if (cansee(x, y)) { |
| 159 | set_msg_xy(x, y); |
| 160 | pline_The("boulder falls apart."); |
| 161 | } |
| 162 | |
| 163 | /* boulders pushed onto shop's boundary or free spot are cases where |
| 164 | an item not in hero's inventory can have its unpaid flag set; |
| 165 | if the boulder isn't already on the bill, don't charge for it */ |
| 166 | if (otmp->unpaid) { |
| 167 | /* remove original from bill + add cloned copy to used-up bill */ |
| 168 | bill_dummy_object(otmp); |
| 169 | } |
| 170 | /* fracturing keeps otmp, changing its otyp from BOULDER to ROCK */ |
| 171 | fracture_rock(otmp); |
| 172 | } |
| 173 | } |
| 174 | |
| 175 | staticfn void |
| 176 | watch_on_duty(struct monst *mtmp) |
no test coverage detected