diff options
author | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-03-02 23:47:12 +0000 |
---|---|---|
committer | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-03-02 23:47:12 +0000 |
commit | f07f08abcbc5c34a01a94812d2599831d5d3b063 (patch) | |
tree | 9c9b0af086aa9425c0dbb45b042b9a04c02f8ad5 /crawl-ref/source/item_use.cc | |
parent | 4d6afd27c458eba95a2276e9b3bbfc5c36d9674f (diff) | |
download | crawl-ref-f07f08abcbc5c34a01a94812d2599831d5d3b063.tar.gz crawl-ref-f07f08abcbc5c34a01a94812d2599831d5d3b063.zip |
Display the proper message when using a scroll of Enchant Weapon III on
missiles.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9319 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/item_use.cc')
-rw-r--r-- | crawl-ref/source/item_use.cc | 34 |
1 files changed, 27 insertions, 7 deletions
diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc index aead71c75a..2a38a066b2 100644 --- a/crawl-ref/source/item_use.cc +++ b/crawl-ref/source/item_use.cc @@ -4955,19 +4955,39 @@ void read_scroll(int slot) if (you.weapon()) { item_def& wpn = *you.weapon(); - mprf("%s glows bright yellow for a while.", - wpn.name(DESC_CAP_YOUR).c_str() ); - do_uncurse_item(wpn); - _handle_enchant_weapon( ENCHANT_TO_HIT, true ); + const bool is_cursed = item_cursed(wpn); + + // Get item name now before changing enchantment. + std::string iname = wpn.name(DESC_CAP_YOUR); + + if (wpn.base_type == OBJ_WEAPONS) + { + mprf("%s glows bright yellow for a while.", iname.c_str()); - if (coinflip()) _handle_enchant_weapon( ENCHANT_TO_HIT, true ); - _handle_enchant_weapon( ENCHANT_TO_DAM, true ); + if (coinflip()) + _handle_enchant_weapon( ENCHANT_TO_HIT, true ); - if (coinflip()) _handle_enchant_weapon( ENCHANT_TO_DAM, true ); + + if (coinflip()) + _handle_enchant_weapon( ENCHANT_TO_DAM, true ); + } + else if (wpn.base_type == OBJ_MISSILES) + { + mprf("%s glow%s bright yellow for a while.", iname.c_str(), + wpn.quantity > 1 ? "" : "s"); + + _handle_enchant_weapon( ENCHANT_TO_HIT, true ); + + if (coinflip()) + _handle_enchant_weapon( ENCHANT_TO_HIT, true ); + } + + if (is_cursed) + do_uncurse_item( wpn ); } else { |