summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source
diff options
context:
space:
mode:
authorharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2008-09-18 22:01:50 +0000
committerharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2008-09-18 22:01:50 +0000
commit7879cb06150dfe95cc3a6f690f0258936d42ff54 (patch)
treefe446c759c97316e0375dde3d21cfa3548e42194 /crawl-ref/source
parent016c2763cbd5cd0345ad54fed25bbef71c2fcf38 (diff)
downloadcrawl-ref-7879cb06150dfe95cc3a6f690f0258936d42ff54.tar.gz
crawl-ref-7879cb06150dfe95cc3a6f690f0258936d42ff54.zip
[2059553]: recharged wands have their zap counts reinitialized.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6948 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source')
-rw-r--r--crawl-ref/source/effects.cc6
-rw-r--r--crawl-ref/source/item_use.cc3
-rw-r--r--crawl-ref/source/itemname.cc2
-rw-r--r--crawl-ref/source/itemprop.h3
4 files changed, 10 insertions, 4 deletions
diff --git a/crawl-ref/source/effects.cc b/crawl-ref/source/effects.cc
index 154efed495..feb8da6325 100644
--- a/crawl-ref/source/effects.cc
+++ b/crawl-ref/source/effects.cc
@@ -1763,8 +1763,8 @@ bool recharge_wand(int item_slot)
break;
}
- // Don't display zap counts any more.
- wand.plus2 = ZAPCOUNT_UNKNOWN;
+ // Reinitialize zap counts.
+ wand.plus2 = ZAPCOUNT_RECHARGED;
const int new_charges =
std::max<int>(
@@ -1775,7 +1775,7 @@ bool recharge_wand(int item_slot)
const bool charged = new_charges > wand.plus;
- std::string desc = "";
+ std::string desc;
if (charged && item_ident(wand, ISFLAG_KNOW_PLUSES))
{
snprintf(info, INFO_SIZE, " and now has %d charges", new_charges);
diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc
index 80e630bc2d..ac9f0c6e25 100644
--- a/crawl-ref/source/item_use.cc
+++ b/crawl-ref/source/item_use.cc
@@ -3546,6 +3546,9 @@ void zap_wand( int slot )
// Take off a charge.
wand.plus--;
+ // Zap counts count from the last recharge.
+ if (wand.plus2 == ZAPCOUNT_RECHARGED)
+ wand.plus2 = 0;
// Increment zap count.
if (wand.plus2 >= 0)
wand.plus2++;
diff --git a/crawl-ref/source/itemname.cc b/crawl-ref/source/itemname.cc
index af607b4389..2329c7aa6a 100644
--- a/crawl-ref/source/itemname.cc
+++ b/crawl-ref/source/itemname.cc
@@ -1280,6 +1280,8 @@ std::string item_def::name_aux( description_level_type desc,
{
if (item_plus2 == ZAPCOUNT_EMPTY)
buff << " {empty}";
+ else if (item_plus2 == ZAPCOUNT_RECHARGED)
+ buff << " {recharged}";
else if (item_plus2 > 0)
buff << " {zapped: " << item_plus2 << '}';
}
diff --git a/crawl-ref/source/itemprop.h b/crawl-ref/source/itemprop.h
index 0ab26097ed..c31e9e11fa 100644
--- a/crawl-ref/source/itemprop.h
+++ b/crawl-ref/source/itemprop.h
@@ -566,7 +566,8 @@ enum wand_type // mitm[].subtype
enum zap_count_type
{
ZAPCOUNT_EMPTY = -1,
- ZAPCOUNT_UNKNOWN = -2
+ ZAPCOUNT_UNKNOWN = -2,
+ ZAPCOUNT_RECHARGED = -3
};
void init_properties(void);