MCPcopy Create free account
hub / github.com/NetHack/NetHack / disarm_squeaky_board

Function disarm_squeaky_board

src/trap.c:5629–5660  ·  view source on GitHub ↗

it may not make much sense to use grease on floor boards, but so what? */

Source from the content-addressed store, hash-verified

5627
5628/* it may not make much sense to use grease on floor boards, but so what? */
5629staticfn int
5630disarm_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. */
5663staticfn int

Callers 1

untrapFunction · 0.85

Calls 9

getobjFunction · 0.85
try_disarmFunction · 0.85
consume_obj_chargeFunction · 0.85
useupFunction · 0.85
YouFunction · 0.85
deltrapFunction · 0.85
newsymFunction · 0.85
more_experiencedFunction · 0.85
newexplevelFunction · 0.85

Tested by

no test coverage detected