From 49d0204fc4b44257c5db42a0a2cdfc673c1cf62e Mon Sep 17 00:00:00 2001 From: "nethack.rankin" Date: Tue, 8 May 2007 02:02:22 +0000 Subject: [PATCH] breaking empty wands I found a copy of a news posting from 1996 which suggested that using a[pply] to break a wand which has 0 charges should have a chance of wresting out one extra charge, like zapping. That way the player can't destroy spent wands with impunity, and it makes the two wand actions be more consistent. Also, it's trivial to implement. :-) --- doc/fixes34.4 | 1 + src/apply.c | 13 +++++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) 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;