summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source
diff options
context:
space:
mode:
authorharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2008-06-16 07:31:57 +0000
committerharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2008-06-16 07:31:57 +0000
commit21ea1485ec6e59623bce5d5542600e5b6f8a3c78 (patch)
tree555077fdda091bf4043221dd46ba4e0753436cf3 /crawl-ref/source
parent3dcc9d0f7bccea62a912b438cac19e7d8737ec3c (diff)
downloadcrawl-ref-21ea1485ec6e59623bce5d5542600e5b6f8a3c78.tar.gz
crawl-ref-21ea1485ec6e59623bce5d5542600e5b6f8a3c78.zip
Fix 1994840: good items were never racial boots.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5877 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source')
-rw-r--r--crawl-ref/source/effects.cc2
-rw-r--r--crawl-ref/source/makeitem.cc22
-rw-r--r--crawl-ref/source/religion.cc18
3 files changed, 18 insertions, 24 deletions
diff --git a/crawl-ref/source/effects.cc b/crawl-ref/source/effects.cc
index 5b6174605b..21453bd865 100644
--- a/crawl-ref/source/effects.cc
+++ b/crawl-ref/source/effects.cc
@@ -1523,7 +1523,7 @@ bool acquirement(object_class_type class_wanted, int agent,
class_wanted = OBJ_POTIONS;
thing_created = items( 1, class_wanted, type_wanted, true,
- MAKE_GOOD_ITEM, 250 );
+ MAKE_GOOD_ITEM, MAKE_ITEM_RANDOM_RACE );
if (thing_created == NON_ITEM)
continue;
diff --git a/crawl-ref/source/makeitem.cc b/crawl-ref/source/makeitem.cc
index 1181b9a4bd..e45f4686de 100644
--- a/crawl-ref/source/makeitem.cc
+++ b/crawl-ref/source/makeitem.cc
@@ -2096,6 +2096,8 @@ static void _generate_armour_item(item_def& item, bool allow_uniques,
item.sub_type = ARM_NAGA_BARDING;
else if (one_chance_in(7))
item.sub_type = ARM_CENTAUR_BARDING;
+ else
+ set_equip_race(item, _determine_armour_race(item, item_race));
}
else
set_equip_race(item, _determine_armour_race(item, item_race));
@@ -4212,21 +4214,11 @@ armour_type get_random_armour_type(int item_level)
// same chance each
switch (random2(5))
{
- case 0:
- armtype = ARM_SHIELD;
- break;
- case 1:
- armtype = ARM_CLOAK;
- break;
- case 2:
- armtype = ARM_HELMET;
- break;
- case 3:
- armtype = ARM_GLOVES;
- break;
- case 4:
- armtype = ARM_BOOTS;
- break;
+ case 0: armtype = ARM_SHIELD; break;
+ case 1: armtype = ARM_CLOAK; break;
+ case 2: armtype = ARM_HELMET; break;
+ case 3: armtype = ARM_GLOVES; break;
+ case 4: armtype = ARM_BOOTS; break;
}
if (armtype == ARM_HELMET && one_chance_in(3))
diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc
index d95b1ee2e3..1952300d78 100644
--- a/crawl-ref/source/religion.cc
+++ b/crawl-ref/source/religion.cc
@@ -3746,13 +3746,14 @@ static bool _beogh_retribution()
// Need a species check, in case this retribution is a result of
// drawing the Wrath card.
+ const bool am_orc = (you.species == SP_HILL_ORC);
+
for (int i = 0; i < num_to_create; ++i)
{
// Create item.
int slot = items(0, OBJ_WEAPONS, WPN_CLUB + random2(13),
true, you.experience_level,
- (you.species == SP_HILL_ORC) ?
- MAKE_ITEM_NO_RACE : MAKE_ITEM_ORCISH);
+ am_orc ? MAKE_ITEM_NO_RACE : MAKE_ITEM_ORCISH);
if (slot == -1)
continue;
@@ -3761,8 +3762,7 @@ static bool _beogh_retribution()
// Set item ego type.
set_item_ego_type(item, OBJ_WEAPONS,
- (you.species == SP_HILL_ORC) ?
- SPWPN_ORC_SLAYING : SPWPN_ELECTROCUTION);
+ am_orc ? SPWPN_ORC_SLAYING : SPWPN_ELECTROCUTION);
// Manually override item plusses.
item.plus = random2(3);
@@ -3799,10 +3799,12 @@ static bool _beogh_retribution()
}
if (num_created > 0)
{
- snprintf(info, INFO_SIZE, " throws %s of %s at you.",
- num_created > 1 ? "implements" : "an implement",
- you.species == SP_HILL_ORC ? "orc slaying" : "electrocution");
- simple_god_message(info, god);
+ std::ostringstream msg;
+ msg << " throws "
+ << (num_created > 1 ? "implements" : "an implement")
+ << " of " << (am_orc ? "orc slaying" : "electrocution")
+ << " at you.";
+ simple_god_message(msg.str().c_str(), god);
break;
} // else fall through
}