diff options
author | Nicholas Feinberg <pleasingfung@gmail.com> | 2014-06-18 22:07:31 -0700 |
---|---|---|
committer | Nicholas Feinberg <pleasingfung@gmail.com> | 2014-06-18 22:07:46 -0700 |
commit | 407dc70bcfd1aa213d5a673c3cc88b9b6be15bcd (patch) | |
tree | 78816b11aea9dab3d762e0c3a3bf48876a344e0e /crawl-ref/source/religion.cc | |
parent | c530747fc02029b177cd1216f9145b12847b1b62 (diff) | |
download | crawl-ref-407dc70bcfd1aa213d5a673c3cc88b9b6be15bcd.tar.gz crawl-ref-407dc70bcfd1aa213d5a673c3cc88b9b6be15bcd.zip |
Don't let Beogh bless items gifted by the player
Diffstat (limited to 'crawl-ref/source/religion.cc')
-rw-r--r-- | crawl-ref/source/religion.cc | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc index d2264704fc..b707686768 100644 --- a/crawl-ref/source/religion.cc +++ b/crawl-ref/source/religion.cc @@ -1695,11 +1695,16 @@ static string _bless_weapon(monster* mon, bool improve_type = false) item_def& wpn = *wpn_ptr; + if (mon->props.exists("given beogh weapon")) + { + dprf("Can't bless weapons gifted by the player!"); + return ""; + } + const int old_weapon_type = wpn.sub_type; if (improve_type && !is_artefact(wpn) - && x_chance_in_y(mon->hit_dice, 250) - && !mon->props.exists("given beogh weapon")) + && x_chance_in_y(mon->hit_dice, 250)) { wpn.sub_type = _upgrade_weapon_type(wpn.sub_type, mon->inv[MSLOT_SHIELD] != NON_ITEM, @@ -1764,13 +1769,20 @@ static string _bless_armour(monster* mon, bool improve_type = false) armour : shield; item_def& arm(mitm[slot]); + if (slot == shield && mon->props.exists("given beogh shield") + || slot == armour && mon->props.exists("given beogh armour")) + { + dprf("Can't bless armour gifted by the player!"); + return ""; + } + const int old_subtype = arm.sub_type; if (improve_type && !is_artefact(arm) && x_chance_in_y(mon->hit_dice, 250)) { - if (slot == shield && !mon->props.exists("given beogh shield")) + if (slot == shield) _upgrade_shield(arm); - else if (slot == armour && !mon->props.exists("given beogh armour")) + else _upgrade_body_armour(arm); } |