summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/effects.cc
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-12-16 12:13:09 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-12-16 12:13:09 +0000
commitcfe2ed148efb0396116f923423e691f6a72c7421 (patch)
tree75389b885ad951db1162f8ac5929c88eb7ae857c /crawl-ref/source/effects.cc
parent8376e440396796e596cdd49b0d539b5fb48f16f0 (diff)
downloadcrawl-ref-cfe2ed148efb0396116f923423e691f6a72c7421.tar.gz
crawl-ref-cfe2ed148efb0396116f923423e691f6a72c7421.zip
Fixed acquirement not generating footwear.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3079 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/effects.cc')
-rw-r--r--crawl-ref/source/effects.cc14
1 files changed, 12 insertions, 2 deletions
diff --git a/crawl-ref/source/effects.cc b/crawl-ref/source/effects.cc
index 5b9c309cf9..93b9eceaee 100644
--- a/crawl-ref/source/effects.cc
+++ b/crawl-ref/source/effects.cc
@@ -664,6 +664,15 @@ void random_uselessness(unsigned char ru, unsigned char sc_read_2)
return;
} // end random_uselessness()
+static armour_type random_nonbody_armour_type()
+{
+ const armour_type at =
+ static_cast<armour_type>(
+ random_choose(ARM_SHIELD, ARM_CLOAK, ARM_HELMET,
+ ARM_GLOVES, ARM_BOOTS, -1));
+ return (at);
+}
+
static int find_acquirement_subtype(object_class_type class_wanted,
int &quantity)
{
@@ -857,7 +866,8 @@ static int find_acquirement_subtype(object_class_type class_wanted,
// one type of item for most of them. -- bwr
//
// OBJ_RANDOM is body armour and handled below
- type_wanted = (coinflip()) ? OBJ_RANDOM : ARM_SHIELD + random2(5);
+ type_wanted = (coinflip())? OBJ_RANDOM :
+ static_cast<int>(random_nonbody_armour_type());
// some species specific fitting problems
switch (you.species)
@@ -933,7 +943,7 @@ static int find_acquirement_subtype(object_class_type class_wanted,
|| you.species == SP_SPRIGGAN
|| you.mutation[MUT_HORNS]))
{
- type_wanted = ARM_CAP;
+ type_wanted = coinflip()? ARM_CAP : ARM_WIZARD_HAT;
}
// Now we'll randomly pick a body armour (light only in the