handle statue hit by striking/force bolt/pick-axe */
| 5579 | |
| 5580 | /* handle statue hit by striking/force bolt/pick-axe */ |
| 5581 | boolean |
| 5582 | break_statue(struct obj *obj) |
| 5583 | { |
| 5584 | /* [obj is assumed to be on floor, so no get_obj_location() needed] */ |
| 5585 | struct trap *trap = t_at(obj->ox, obj->oy); |
| 5586 | struct obj *item; |
| 5587 | boolean by_you = !svc.context.mon_moving; |
| 5588 | |
| 5589 | if (trap && trap->ttyp == STATUE_TRAP |
| 5590 | && activate_statue_trap(trap, obj->ox, obj->oy, TRUE)) |
| 5591 | return FALSE; |
| 5592 | /* drop any objects contained inside the statue */ |
| 5593 | while ((item = obj->cobj) != 0) { |
| 5594 | obj_extract_self(item); |
| 5595 | place_object(item, obj->ox, obj->oy); |
| 5596 | } |
| 5597 | if (by_you && Role_if(PM_ARCHEOLOGIST) |
| 5598 | && (obj->spe & CORPSTAT_HISTORIC)) { |
| 5599 | You_feel("guilty about damaging such a historic statue."); |
| 5600 | adjalign(-1); |
| 5601 | } |
| 5602 | obj->spe = 0; |
| 5603 | fracture_rock(obj); |
| 5604 | return TRUE; |
| 5605 | } |
| 5606 | |
| 5607 | /* Return TRUE if obj is eligible to pass to maybe_destroy_item given |
| 5608 | * the type of elemental damage it's being subjected to. |
no test coverage detected