MCPcopy Index your code
hub / github.com/NetHack/NetHack / zappable

Function zappable

src/zap.c:2513–2522  ·  view source on GitHub ↗

* zappable - returns 1 if zap is available, 0 otherwise. * it removes a charge from the wand if zappable. * added by GAN 11/03/86 */

Source from the content-addressed store, hash-verified

2511 * added by GAN 11/03/86
2512 */
2513int
2514zappable(struct obj *wand)
2515{
2516 if (wand->spe < 0 || (wand->spe == 0 && rn2(WAND_WREST_CHANCE)))
2517 return 0;
2518 if (wand->spe == 0)
2519 You("wrest one last charge from the worn-out wand.");
2520 wand->spe--;
2521 return 1;
2522}
2523
2524void
2525do_enlightenment_effect(void)

Callers 3

doengrave_sfx_itemFunction · 0.85
dozapFunction · 0.85
do_break_wandFunction · 0.85

Calls 2

rn2Function · 0.85
YouFunction · 0.85

Tested by

no test coverage detected