From 53aa6239b1e1aa7a8e36db10d6887d7fc3ea2dda Mon Sep 17 00:00:00 2001 From: David Lawrence Ramsey Date: Fri, 30 Oct 2009 10:31:30 -0500 Subject: Add minor cosmetic fixes. --- crawl-ref/source/effects.cc | 14 ++++++++------ crawl-ref/source/itemprop.cc | 16 +++++++++------- crawl-ref/source/makeitem.cc | 29 +++++++++++++---------------- 3 files changed, 30 insertions(+), 29 deletions(-) (limited to 'crawl-ref/source') diff --git a/crawl-ref/source/effects.cc b/crawl-ref/source/effects.cc index 6d53393bbd..cb04f73c17 100644 --- a/crawl-ref/source/effects.cc +++ b/crawl-ref/source/effects.cc @@ -1122,7 +1122,7 @@ static armour_type _acquirement_armour_subtype(bool divine) // Now we'll randomly pick a body armour up to plate mail (light // only in the case of robes or animal skins). Unlike before, now // we're only giving out the finished products here, never the - // hides. -- bwr + // hides. - bwr if (result == NUM_ARMOURS || result == ARM_ROBE) { // Start with normal base armour. @@ -1131,8 +1131,9 @@ static armour_type _acquirement_armour_subtype(bool divine) // Animal skins don't get egos, so make them less likely. result = (one_chance_in(4) ? ARM_ANIMAL_SKIN : ARM_ROBE); - // Armour-restricted species get a bonus chance at troll/dragon - // armour. (In total, the chance is almost 10%.) + // Armour-restricted species get a bonus chance at + // troll/dragon armour. (In total, the chance is almost + // 10%.) if (one_chance_in(20)) { result = static_cast( @@ -1171,9 +1172,10 @@ static armour_type _acquirement_armour_subtype(bool divine) const int num_arms = ARRAYSZ(armours); // Weight sub types relative to (armour skill + 3). - // Actually, the AC improvement is not linear, and we might - // also want to take into account Dodging/Stealth and Strength, - // but this is definitely better than the random chance above. + // Actually, the AC improvement is not linear, and we + // might also want to take into account Dodging/Stealth + // and Strength, but this is definitely better than the + // random chance above. const int skill = std::min(27, you.skills[SK_ARMOUR] + 3); int total = 0; for (int i = 0; i < num_arms; ++i) diff --git a/crawl-ref/source/itemprop.cc b/crawl-ref/source/itemprop.cc index 134e9fb544..0047599d6f 100644 --- a/crawl-ref/source/itemprop.cc +++ b/crawl-ref/source/itemprop.cc @@ -585,21 +585,23 @@ bool item_is_critical(const item_def &item) // Is item something that no one would bother enchanting? bool item_is_mundane(const item_def &item) { - bool retval = false; - switch (item.base_type) { case OBJ_WEAPONS: - retval = (item.sub_type == WPN_CLUB - || item.sub_type == WPN_GIANT_CLUB - || item.sub_type == WPN_GIANT_SPIKED_CLUB - || item.sub_type == WPN_KNIFE); + if (item.sub_type == WPN_CLUB + || item.sub_type == WPN_GIANT_CLUB + || item.sub_type == WPN_GIANT_SPIKED_CLUB + || item.sub_type == WPN_KNIFE) + { + return (true); + } break; + default: break; } - return (retval); + return (false); } void set_ident_flags( item_def &item, unsigned long flags ) diff --git a/crawl-ref/source/makeitem.cc b/crawl-ref/source/makeitem.cc index 45ae4064c6..4c1dc649e4 100644 --- a/crawl-ref/source/makeitem.cc +++ b/crawl-ref/source/makeitem.cc @@ -1548,7 +1548,7 @@ static void _generate_weapon_item(item_def& item, bool allow_uniques, const bool no_brand = item.special == SPWPN_FORBID_BRAND; if (no_brand) - set_item_ego_type( item, OBJ_WEAPONS, SPWPN_NORMAL ); + set_item_ego_type(item, OBJ_WEAPONS, SPWPN_NORMAL); // If it's forced to be a good item, upgrade the worst weapons. if (force_good @@ -1565,9 +1565,9 @@ static void _generate_weapon_item(item_def& item, bool allow_uniques, // If we allow acquirement-type items to be orcish, then there's a // good chance that we'll just strip them of their ego type at the - // bottom of this function. -- bwr - if (force_good && !forced_ego && get_equip_race( item ) == ISFLAG_ORCISH) - set_equip_race( item, ISFLAG_NO_RACE ); + // bottom of this function. - bwr + if (force_good && !forced_ego && get_equip_race(item) == ISFLAG_ORCISH) + set_equip_race(item, ISFLAG_NO_RACE); _weapon_add_racial_modifiers(item); @@ -1580,8 +1580,8 @@ static void _generate_weapon_item(item_def& item, bool allow_uniques, set_item_ego_type(item, OBJ_WEAPONS, _determine_weapon_brand(item, 2+2*you.your_level)); } - item.plus -= 1+random2(3); - item.plus2 -= 1+random2(3); + item.plus -= 1 + random2(3); + item.plus2 -= 1 + random2(3); if (item_level == -5) do_curse_item(item); @@ -1629,10 +1629,10 @@ static void _generate_weapon_item(item_def& item, bool allow_uniques, if (one_chance_in(12)) { // Make a cursed item. - do_curse_item( item ); + do_curse_item(item); item.plus -= random2(4); item.plus2 -= random2(4); - set_item_ego_type( item, OBJ_WEAPONS, SPWPN_NORMAL ); + set_item_ego_type(item, OBJ_WEAPONS, SPWPN_NORMAL); } } @@ -1904,7 +1904,7 @@ static bool _try_make_armour_artefact(item_def& item, int force_type, && one_chance_in(12) && x_chance_in_y(31 + item_level * 3, 3000)) { - return _try_make_item_special_unrand(item, force_type, item_level); + return (_try_make_item_special_unrand(item, force_type, item_level)); } return (false); @@ -2134,7 +2134,6 @@ static void _generate_armour_item(item_def& item, bool allow_uniques, } // If we get here the item is not an artefact. - if (is_helmet(item) && one_chance_in(3)) set_helmet_random_desc(item); @@ -2169,7 +2168,7 @@ static void _generate_armour_item(item_def& item, bool allow_uniques, _determine_armour_ego(item, item.sub_type, 2+2*you.your_level)); } - item.plus -= 1+random2(3); + item.plus -= 1 + random2(3); if (item_level == -5) do_curse_item(item); @@ -2726,7 +2725,7 @@ static void _generate_jewellery_item(item_def& item, bool allow_uniques, } } - // All jewellery base types should now work. -- bwr + // All jewellery base types should now work. - bwr if (allow_uniques && item_level > 2 && x_chance_in_y(101 + item_level * 3, 4000)) { @@ -2742,8 +2741,8 @@ static void _generate_jewellery_item(item_def& item, bool allow_uniques, else if (item.sub_type == RING_HUNGER || item.sub_type == RING_TELEPORTATION || one_chance_in(50)) { - // rings of hunger and teleportation are always cursed {dlb}: - do_curse_item( item ); + // Rings of hunger and teleportation are always cursed {dlb}: + do_curse_item(item); } } @@ -2754,9 +2753,7 @@ static void _generate_misc_item(item_def& item, int force_type, int item_race) else { do - { item.sub_type = random2(NUM_MISCELLANY); - } while // never randomly generated (item.sub_type == MISC_RUNE_OF_ZOT -- cgit v1.2.3-54-g00ecf