it may not make much sense to use grease on floor boards, but so what? */
| 5627 | |
| 5628 | /* it may not make much sense to use grease on floor boards, but so what? */ |
| 5629 | staticfn int |
| 5630 | disarm_squeaky_board(struct trap *ttmp) |
| 5631 | { |
| 5632 | struct obj *obj; |
| 5633 | boolean bad_tool; |
| 5634 | int fails; |
| 5635 | |
| 5636 | obj = getobj("untrap with", unsqueak_ok, GETOBJ_PROMPT); |
| 5637 | if (!obj) |
| 5638 | return 0; |
| 5639 | |
| 5640 | bad_tool = (obj->cursed |
| 5641 | || ((obj->otyp != POT_OIL || obj->lamplit) |
| 5642 | && (obj->otyp != CAN_OF_GREASE || !obj->spe))); |
| 5643 | fails = try_disarm(ttmp, bad_tool); |
| 5644 | if (fails < 2) |
| 5645 | return fails; |
| 5646 | |
| 5647 | /* successfully used oil or grease to fix squeaky board */ |
| 5648 | if (obj->otyp == CAN_OF_GREASE) { |
| 5649 | consume_obj_charge(obj, TRUE); |
| 5650 | } else { |
| 5651 | useup(obj); /* oil */ |
| 5652 | makeknown(POT_OIL); |
| 5653 | } |
| 5654 | You("repair the squeaky board."); /* no madeby_u */ |
| 5655 | deltrap(ttmp); |
| 5656 | newsym(u.ux + u.dx, u.uy + u.dy); |
| 5657 | more_experienced(1, 5); |
| 5658 | newexplevel(); |
| 5659 | return 1; |
| 5660 | } |
| 5661 | |
| 5662 | /* removes traps that shoot arrows, darts, etc. */ |
| 5663 | staticfn int |
no test coverage detected