diff --git a/doc/fixes34.4 b/doc/fixes34.4 index 44a114e8f..d085c27f8 100644 --- a/doc/fixes34.4 +++ b/doc/fixes34.4 @@ -390,6 +390,7 @@ give feedback when a nearby monster grows into a stronger form familiars are now created without any starting inventory using the 'f' command when quiver is empty will fill quiver if player selects a stack of 2 or more items in response to the "what to throw?" prompt +breaking a wand with the apply command has a chance to wrest an extra charge Platform- and/or Interface-Specific New Features diff --git a/src/apply.c b/src/apply.c index 7c2ba7696..b9942c67d 100644 --- a/src/apply.c +++ b/src/apply.c @@ -1,4 +1,4 @@ -/* SCCS Id: @(#)apply.c 3.5 2007/03/07 */ +/* SCCS Id: @(#)apply.c 3.5 2007/05/05 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -2808,10 +2808,19 @@ do_break_wand(obj) freeinv(obj); /* hide it from destroy_item instead... */ setnotworn(obj); /* so we need to do this ourselves */ - if (obj->spe <= 0) { + if (!zappable(obj)) { pline(nothing_else_happens); goto discard_broken_wand; } + /* successful call to zappable() consumes a charge; put it back */ + obj->spe++; + /* might have "wrested" a final charge, taking it from 0 to -1; + if so, we just brought it back up to 0, which wouldn't do much + below so give it 1..3 charges now, usually making it stronger + than an ordinary last charge (the wand is already gone from + inventory, so perm_invent can't accidentally reveal this) */ + if (!obj->spe) obj->spe = rnd(3); + obj->ox = u.ux; obj->oy = u.uy; dmg = obj->spe * 4;