diff options
Diffstat (limited to 'crawl-ref')
-rw-r--r-- | crawl-ref/source/itemprop.cc | 48 | ||||
-rw-r--r-- | crawl-ref/source/itemprop.h | 3 | ||||
-rw-r--r-- | crawl-ref/source/makeitem.cc | 15 | ||||
-rw-r--r-- | crawl-ref/source/religion.cc | 11 |
4 files changed, 63 insertions, 14 deletions
diff --git a/crawl-ref/source/itemprop.cc b/crawl-ref/source/itemprop.cc index aa85b91288..4bbbbec68d 100644 --- a/crawl-ref/source/itemprop.cc +++ b/crawl-ref/source/itemprop.cc @@ -1709,7 +1709,7 @@ bool is_blessed_blade(const item_def &item) return (false); } -bool is_convertible(const item_def &item) +bool is_blessed_blade_convertible(const item_def &item) { return (!is_artefact(item) && (item.base_type == OBJ_WEAPONS @@ -1791,6 +1791,52 @@ bool convert2good(item_def &item, bool allow_blessed) return (true); } +bool convert2bad(item_def &item) +{ + if (item.base_type != OBJ_WEAPONS) + return (false); + + switch (item.sub_type) + { + default: + return (false); + + case WPN_BLESSED_FALCHION: + item.sub_type = WPN_FALCHION; + break; + + case WPN_BLESSED_LONG_SWORD: + item.sub_type = WPN_LONG_SWORD; + break; + + case WPN_BLESSED_SCIMITAR: + item.sub_type = WPN_SCIMITAR; + break; + + case WPN_BLESSED_EUDEMON_BLADE: + item.sub_type = WPN_DEMON_BLADE; + break; + + case WPN_BLESSED_KATANA: + item.sub_type = WPN_KATANA; + break; + + case WPN_BLESSED_DOUBLE_SWORD: + item.sub_type = WPN_DOUBLE_SWORD; + break; + + case WPN_BLESSED_GREAT_SWORD: + item.sub_type = WPN_GREAT_SWORD; + break; + + case WPN_BLESSED_TRIPLE_SWORD: + item.sub_type = WPN_TRIPLE_SWORD; + break; + } + + return (true); +} + int weapon_str_weight( const item_def &wpn ) { ASSERT (wpn.base_type == OBJ_WEAPONS || wpn.base_type == OBJ_STAVES); diff --git a/crawl-ref/source/itemprop.h b/crawl-ref/source/itemprop.h index 045959e3d0..c12d529909 100644 --- a/crawl-ref/source/itemprop.h +++ b/crawl-ref/source/itemprop.h @@ -712,8 +712,9 @@ int double_wpn_awkward_speed( const item_def &item ); bool is_demonic(const item_def &item); bool is_blessed_blade(const item_def &item); -bool is_convertible(const item_def &item); +bool is_blessed_blade_convertible(const item_def &item); bool convert2good(item_def &item, bool allow_blessed = true); +bool convert2bad(item_def &item); int get_vorpal_type( const item_def &item ); int get_damage_type( const item_def &item ); diff --git a/crawl-ref/source/makeitem.cc b/crawl-ref/source/makeitem.cc index ba84d70d98..8d38f422cf 100644 --- a/crawl-ref/source/makeitem.cc +++ b/crawl-ref/source/makeitem.cc @@ -2949,10 +2949,14 @@ static void _give_monster_item(monsters *mon, int thing, mthing.link = NON_ITEM; unset_ident_flags(mthing, ISFLAG_IDENT_MASK); - if (get_weapon_brand(mthing) == SPWPN_HOLY_WRATH - && mons_is_unholy(mon)) + if (mons_is_unholy(mon) + && (is_blessed_blade(mthing) + || get_weapon_brand(mthing) == SPWPN_HOLY_WRATH)) { - set_item_ego_type( mthing, OBJ_WEAPONS, SPWPN_NORMAL ); + if (is_blessed_blade(mthing)) + convert2bad(mthing); + if (get_weapon_brand(mthing) == SPWPN_HOLY_WRATH) + set_item_ego_type(mthing, OBJ_WEAPONS, SPWPN_NORMAL); } unwind_var<int> save_speedinc(mon->speed_increment); @@ -2970,7 +2974,7 @@ static void _give_monster_item(monsters *mon, int thing, ASSERT(holding_monster(mthing) == mon); if (!force_item || mthing.colour == BLACK) - item_colour( mthing ); + item_colour(mthing); } static void _give_scroll(monsters *mon, int level) @@ -3060,7 +3064,8 @@ static void _give_potion(monsters *mon, int level) return; mitm[thing_created].flags = 0; - _give_monster_item(mon, thing_created); + _give_monster_item(mon, thing_created, false, + &monsters::pickup_potion); } } diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc index cabee4b6c3..db37bbdb51 100644 --- a/crawl-ref/source/religion.cc +++ b/crawl-ref/source/religion.cc @@ -3366,12 +3366,9 @@ bool is_holy_item(const item_def& item) switch (item.base_type) { case OBJ_WEAPONS: - { - const int item_brand = get_weapon_brand(item); - - retval = (item_brand == SPWPN_HOLY_WRATH || is_blessed_blade(item)); + retval = (is_blessed_blade(item) + || get_weapon_brand(item) == SPWPN_HOLY_WRATH); break; - } case OBJ_SCROLLS: retval = (item.sub_type == SCR_HOLY_WORD); break; @@ -5945,7 +5942,7 @@ static bool _bless_weapon( god_type god, brand_type brand, int colour ) { convert2good(weap); - if (is_convertible(weap)) + if (is_blessed_blade_convertible(weap)) { origin_acquired(weap, GOD_SHINING_ONE); make_item_blessed_blade(weap); @@ -6046,7 +6043,7 @@ static void _altar_prayer() if (wpn != -1 && (get_weapon_brand(you.inv[wpn]) != SPWPN_HOLY_WRATH - || is_convertible(you.inv[wpn]))) + || is_blessed_blade_convertible(you.inv[wpn]))) { _bless_weapon(GOD_SHINING_ONE, SPWPN_HOLY_WRATH, YELLOW); } |