diff options
author | Stefan O'Rear <stefanor@cox.net> | 2010-01-02 19:06:24 -0800 |
---|---|---|
committer | Stefan O'Rear <stefanor@cox.net> | 2010-01-02 19:12:49 -0800 |
commit | 6ab8afedb152e4f158c702025c03798e74a463a4 (patch) | |
tree | dde1283fd3515bbbd43d0587f25897a8363d1cdf | |
parent | 0dd26495166d2659319d2f4e78f7b68f50e7c355 (diff) | |
download | crawl-ref-6ab8afedb152e4f158c702025c03798e74a463a4.tar.gz crawl-ref-6ab8afedb152e4f158c702025c03798e74a463a4.zip |
Increase effects of Recharging on rods and allow it to affect enchantment (Eronarn).
-rw-r--r-- | crawl-ref/source/effects.cc | 13 | ||||
-rw-r--r-- | crawl-ref/source/itemprop.cc | 4 |
2 files changed, 15 insertions, 2 deletions
diff --git a/crawl-ref/source/effects.cc b/crawl-ref/source/effects.cc index 49702e489c..ac6938ceac 100644 --- a/crawl-ref/source/effects.cc +++ b/crawl-ref/source/effects.cc @@ -2478,7 +2478,7 @@ bool recharge_wand(int item_slot) if (wand.plus2 < MAX_ROD_CHARGE * ROD_CHARGE_MULT) { - wand.plus2 += ROD_CHARGE_MULT; + wand.plus2 += ROD_CHARGE_MULT * random_range(1,2); if (wand.plus2 > MAX_ROD_CHARGE * ROD_CHARGE_MULT) wand.plus2 = MAX_ROD_CHARGE * ROD_CHARGE_MULT; @@ -2492,6 +2492,17 @@ bool recharge_wand(int item_slot) work = true; } + if (short(wand.props["rod_enchantment"]) < MAX_WPN_ENCHANT) + { + static_cast<short&>(wand.props["rod_enchantment"]) + += random_range(1,2); + + if (short(wand.props["rod_enchantment"]) > MAX_WPN_ENCHANT) + wand.props["rod_enchantment"] = short(MAX_WPN_ENCHANT); + + work = true; + } + if (!work) return (false); diff --git a/crawl-ref/source/itemprop.cc b/crawl-ref/source/itemprop.cc index 9856f7260d..f19bea28f1 100644 --- a/crawl-ref/source/itemprop.cc +++ b/crawl-ref/source/itemprop.cc @@ -1096,7 +1096,9 @@ bool item_is_rechargeable(const item_def &it, bool hide_charged, bool weapons) if (item_ident(it, ISFLAG_KNOW_PLUSES)) { return (it.plus2 < MAX_ROD_CHARGE * ROD_CHARGE_MULT - || it.plus < it.plus2); + || it.plus < it.plus2 + || !it.props.exists("rod_enchantment") + || short(it.props["rod_enchantment"]) < MAX_WPN_ENCHANT); } return (true); } |