summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/effects.cc
diff options
context:
space:
mode:
authordolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2009-02-05 17:49:27 +0000
committerdolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2009-02-05 17:49:27 +0000
commit783a80c3a2a1f14ee4e02d1abd9bf9aef50d0595 (patch)
treebd20c9f9b060be5a886c74a08547f318704d274e /crawl-ref/source/effects.cc
parent7ca638385f00f42e37e81e85b6f9d6ff691dc968 (diff)
downloadcrawl-ref-783a80c3a2a1f14ee4e02d1abd9bf9aef50d0595.tar.gz
crawl-ref-783a80c3a2a1f14ee4e02d1abd9bf9aef50d0595.zip
After some thought, remove assumptions about armor subtype order again.
There are still some left, but they're mostly checks for armor greater than plate mail, and they still work with the current code. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8906 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/effects.cc')
-rw-r--r--crawl-ref/source/effects.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/crawl-ref/source/effects.cc b/crawl-ref/source/effects.cc
index d24cc79c5a..082511a093 100644
--- a/crawl-ref/source/effects.cc
+++ b/crawl-ref/source/effects.cc
@@ -958,7 +958,12 @@ static armour_type _acquirement_armour_subtype()
result = coinflip() ? ARM_ROBE : ARM_ANIMAL_SKIN;
else
{
- result = static_cast<armour_type>(ARM_ROBE + random2(8));
+ const armour_type armours[] = { ARM_ROBE, ARM_LEATHER_ARMOUR,
+ ARM_RING_MAIL, ARM_SCALE_MAIL,
+ ARM_CHAIN_MAIL, ARM_SPLINT_MAIL,
+ ARM_BANDED_MAIL, ARM_PLATE_MAIL };
+
+ result = static_cast<armour_type>(RANDOM_ELEMENT(armours));
if (one_chance_in(10) && you.skills[SK_ARMOUR] >= 10)
result = ARM_CRYSTAL_PLATE_MAIL;