diff options
author | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-04-23 21:32:46 +0000 |
---|---|---|
committer | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-04-23 21:32:46 +0000 |
commit | a18f14bd135fc1fb5f8948234d744dc0dc143854 (patch) | |
tree | c91999bfef76df9420efcaa9556a5e4382803528 /crawl-ref | |
parent | 21d4017df995d2281a25ac062a64a1a86ec4621e (diff) | |
download | crawl-ref-a18f14bd135fc1fb5f8948234d744dc0dc143854.tar.gz crawl-ref-a18f14bd135fc1fb5f8948234d744dc0dc143854.zip |
Allow the weapon enchantment blessing tp work on a monster's alternate
weapon.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@4562 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref')
-rw-r--r-- | crawl-ref/source/religion.cc | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc index 444b4096ca..c16c26c2c9 100644 --- a/crawl-ref/source/religion.cc +++ b/crawl-ref/source/religion.cc @@ -797,13 +797,22 @@ static bool _blessing_wpn(monsters *mon) { // Pick a monster's weapon. const int weapon = mon->inv[MSLOT_WEAPON]; + const int alt_weapon = mon->inv[MSLOT_ALT_WEAPON]; - if (weapon == NON_ITEM) + if (weapon == NON_ITEM && alt_weapon == NON_ITEM) return false; bool success; - item_def& wpn(mitm[weapon]); + int slot; + + do + { + slot = (coinflip()) ? weapon : alt_weapon; + } + while (slot == NON_ITEM); + + item_def& wpn(mitm[slot]); // And enchant or uncurse it. success = enchant_weapon((coinflip()) ? ENCHANT_TO_HIT |