diff options
author | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-02-05 16:48:39 +0000 |
---|---|---|
committer | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-02-05 16:48:39 +0000 |
commit | 3a20b60453e40a3319c4e7aa6ddeb8d80b75cf45 (patch) | |
tree | 98f61f2b6dd07e7f5aab5929a9429c822a3dbfe8 /crawl-ref | |
parent | 825b546178f271424a8e162e9a798a7b06aeeb8e (diff) | |
download | crawl-ref-3a20b60453e40a3319c4e7aa6ddeb8d80b75cf45.tar.gz crawl-ref-3a20b60453e40a3319c4e7aa6ddeb8d80b75cf45.zip |
Clean up armor subtype handling again. There's other code that relies
on the assumption that the normal armours are in ascending order by AC,
from ARM_ROBE to ARM_PLATE_MAIL, so it seems okay to use that for now.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8903 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref')
-rw-r--r-- | crawl-ref/source/makeitem.cc | 28 |
1 files changed, 8 insertions, 20 deletions
diff --git a/crawl-ref/source/makeitem.cc b/crawl-ref/source/makeitem.cc index af3997b067..98bc1b0278 100644 --- a/crawl-ref/source/makeitem.cc +++ b/crawl-ref/source/makeitem.cc @@ -4122,7 +4122,7 @@ void give_armour(monsters *mon, int level) case MONS_RUPERT: case MONS_WAYNE: item.base_type = OBJ_ARMOUR; - item.sub_type = ARM_LEATHER_ARMOUR + random2(4); + item.sub_type = ARM_LEATHER_ARMOUR + random2(4); // up to chain mail break; case MONS_ORC_WARLORD: @@ -4145,7 +4145,7 @@ void give_armour(monsters *mon, int level) case MONS_VAMPIRE_KNIGHT: case MONS_VAULT_GUARD: item.base_type = OBJ_ARMOUR; - item.sub_type = ARM_CHAIN_MAIL + random2(4); + item.sub_type = ARM_CHAIN_MAIL + random2(4); // up to plate mail break; case MONS_ANGEL: @@ -4347,20 +4347,13 @@ armour_type get_random_body_armour_type(int item_level) // FIXME: Need to clean up this mess. armour_type get_random_armour_type(int item_level) { - // Default (lowest-level) armours. - const armour_type defarmours[] = { ARM_ROBE, ARM_LEATHER_ARMOUR, - ARM_RING_MAIL }; - - int armtype = RANDOM_ELEMENT(defarmours); + // Default (lowest-level) armours, up to ring mail. + int armtype = ARM_ROBE + random2(3); if (x_chance_in_y(11 + item_level, 35)) { - // Low-level armours. - const armour_type lowarmours[] = { ARM_ROBE, ARM_LEATHER_ARMOUR, - ARM_RING_MAIL, ARM_SCALE_MAIL, - ARM_CHAIN_MAIL }; - - armtype = RANDOM_ELEMENT(lowarmours); + // Low-level armours, up to chain mail. + armtype = ARM_ROBE + random2(5); if (one_chance_in(4)) armtype = ARM_ANIMAL_SKIN; @@ -4368,13 +4361,8 @@ armour_type get_random_armour_type(int item_level) if (x_chance_in_y(11 + item_level, 60)) { - // Medium-level armours. - const armour_type medarmours[] = { ARM_ROBE, ARM_LEATHER_ARMOUR, - ARM_RING_MAIL, ARM_SCALE_MAIL, - ARM_CHAIN_MAIL, ARM_SPLINT_MAIL, - ARM_BANDED_MAIL, ARM_PLATE_MAIL }; - - armtype = RANDOM_ELEMENT(medarmours); + // Medium-level armours, up to plate mail. + armtype = ARM_ROBE + random2(8); } if (one_chance_in(20) && x_chance_in_y(11 + item_level, 400)) |