fractured by pick-axe or wand of striking or by vault guard or shopkeeper */
| 5534 | |
| 5535 | /* fractured by pick-axe or wand of striking or by vault guard or shopkeeper */ |
| 5536 | void |
| 5537 | fracture_rock(struct obj *obj) /* no texts here! */ |
| 5538 | { |
| 5539 | coordxy x, y; |
| 5540 | boolean by_you = !svc.context.mon_moving; |
| 5541 | |
| 5542 | if (by_you && get_obj_location(obj, &x, &y, 0) && costly_spot(x, y)) { |
| 5543 | struct monst *shkp = 0; |
| 5544 | char objroom = *in_rooms(x, y, SHOPBASE); |
| 5545 | |
| 5546 | if (billable(&shkp, obj, objroom, FALSE)) { |
| 5547 | /* shop message says "you owe <shk> <$> for it!" so we need |
| 5548 | to precede that with a message explaining what "it" is */ |
| 5549 | You("fracture %s %s.", s_suffix(shkname(shkp)), xname(obj)); |
| 5550 | /* breakobj won't destroy fracturing statue or boulder but |
| 5551 | will charge for shop goods */ |
| 5552 | (void) breakobj(obj, x, y, TRUE, FALSE); |
| 5553 | } |
| 5554 | } |
| 5555 | if (by_you && obj->otyp == BOULDER) |
| 5556 | sokoban_guilt(); |
| 5557 | |
| 5558 | obj->otyp = ROCK; |
| 5559 | obj->oclass = GEM_CLASS; |
| 5560 | obj->quan = (long) rn1(60, 7); |
| 5561 | obj->owt = weight(obj); |
| 5562 | obj->dknown = obj->bknown = obj->rknown = 0; |
| 5563 | obj->known = objects[obj->otyp].oc_uses_known ? 0 : 1; |
| 5564 | dealloc_oextra(obj); |
| 5565 | |
| 5566 | if (obj->where == OBJ_FLOOR) { |
| 5567 | obj_extract_self(obj); /* move rocks back on top */ |
| 5568 | place_object(obj, obj->ox, obj->oy); |
| 5569 | if (!does_block(obj->ox, obj->oy, &levl[obj->ox][obj->oy])) { |
| 5570 | unblock_point(obj->ox, obj->oy); |
| 5571 | /* need immediate update in case this is a striking/force bolt |
| 5572 | zap that is about hit more things */ |
| 5573 | vision_recalc(0); |
| 5574 | } |
| 5575 | if (cansee(obj->ox, obj->oy)) |
| 5576 | newsym(obj->ox, obj->oy); |
| 5577 | } |
| 5578 | } |
| 5579 | |
| 5580 | /* handle statue hit by striking/force bolt/pick-axe */ |
| 5581 | boolean |
no test coverage detected