diff options
author | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-01-22 06:05:50 +0000 |
---|---|---|
committer | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-01-22 06:05:50 +0000 |
commit | 2cbbec1b2a1acbed4db00a41a900e58cd0fbec9d (patch) | |
tree | de39b9836e48b8f4a5e79d05c669ffa881a6c894 /crawl-ref/source | |
parent | a1f59ee435343a6dd58fff2bf161a5470870135f (diff) | |
download | crawl-ref-2cbbec1b2a1acbed4db00a41a900e58cd0fbec9d.tar.gz crawl-ref-2cbbec1b2a1acbed4db00a41a900e58cd0fbec9d.zip |
Various cleanups:
1. Move the blessed eudemon blade down in the weapon_type enum so that
it's with the other blessed weapons, add a WPN_MAX_NONBLESSED parameter
to indicate where the non-blessed weapons end, and make weapon mimics
use it. Mimics can now no longer imitate blessed weapons, which makes
them less of a giveaway, since only the blessed eudemon blade shows up
normally, and it's normally colored yellow, neither of which are true
for mimic versions.
2. Since all non-racial armors are in one contiguous block at the end of
the armour_type enum, and since very little code depends on the armors'
being in a particular order, add an ARM_MAX_RACIAL parameter to indicate
where the potentially racial weapons end, and make set_equip_race() use
it. Also, rearrange the armors a bit in the enum.
3. Since no code depends on the missiles' being in a particular order,
move the non-racial missiles down to the end of the missile_type enum,
add a MI_MAX_RACIAL parameter to indicate where the potentially racial
missiles end, and make set_equip_race() use it.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8681 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source')
-rw-r--r-- | crawl-ref/source/itemprop.cc | 15 | ||||
-rw-r--r-- | crawl-ref/source/itemprop.h | 49 | ||||
-rw-r--r-- | crawl-ref/source/monstuff.cc | 6 |
3 files changed, 32 insertions, 38 deletions
diff --git a/crawl-ref/source/itemprop.cc b/crawl-ref/source/itemprop.cc index 58b01629f0..011e8b06c3 100644 --- a/crawl-ref/source/itemprop.cc +++ b/crawl-ref/source/itemprop.cc @@ -697,24 +697,13 @@ void set_equip_race( item_def &item, unsigned long flags ) break; case OBJ_ARMOUR: - // not hides, dragon armour, crystal plate, or barding - if ((item.sub_type >= ARM_DRAGON_HIDE - && item.sub_type <= ARM_SWAMP_DRAGON_ARMOUR) - || item.sub_type == ARM_CENTAUR_BARDING - || item.sub_type == ARM_NAGA_BARDING) - { + if (item.sub_type > ARM_MAX_RACIAL) return; - } break; case OBJ_MISSILES: - if (item.sub_type == MI_STONE - || item.sub_type == MI_LARGE_ROCK - || item.sub_type == MI_SLING_BULLET - || item.sub_type == MI_THROWING_NET) - { + if (item.sub_type > MI_MAX_RACIAL) return; - } break; default: diff --git a/crawl-ref/source/itemprop.h b/crawl-ref/source/itemprop.h index 8d8b2fe4dc..24b48f4a5b 100644 --- a/crawl-ref/source/itemprop.h +++ b/crawl-ref/source/itemprop.h @@ -24,31 +24,32 @@ enum armour_type ARM_SPLINT_MAIL, // 5 ARM_BANDED_MAIL, ARM_PLATE_MAIL, - ARM_SHIELD, ARM_CLOAK, - ARM_HELMET, // 10 ARM_CAP, - ARM_WIZARD_HAT, + ARM_WIZARD_HAT, // 10 + ARM_HELMET, ARM_GLOVES, ARM_BOOTS, - ARM_BUCKLER, // 15 + ARM_BUCKLER, + ARM_SHIELD, // 15 ARM_LARGE_SHIELD, - ARM_DRAGON_HIDE, - ARM_TROLL_HIDE, + ARM_MAX_RACIAL = ARM_LARGE_SHIELD, ARM_CRYSTAL_PLATE_MAIL, - ARM_DRAGON_ARMOUR, // 20 - ARM_TROLL_LEATHER_ARMOUR, + ARM_ANIMAL_SKIN, + ARM_TROLL_HIDE, + ARM_TROLL_LEATHER_ARMOUR, // 20 + ARM_DRAGON_HIDE, + ARM_DRAGON_ARMOUR, ARM_ICE_DRAGON_HIDE, ARM_ICE_DRAGON_ARMOUR, - ARM_STEAM_DRAGON_HIDE, - ARM_STEAM_DRAGON_ARMOUR, // 25 + ARM_STEAM_DRAGON_HIDE, // 25 + ARM_STEAM_DRAGON_ARMOUR, ARM_MOTTLED_DRAGON_HIDE, ARM_MOTTLED_DRAGON_ARMOUR, ARM_STORM_DRAGON_HIDE, - ARM_STORM_DRAGON_ARMOUR, - ARM_GOLD_DRAGON_HIDE, // 30 + ARM_STORM_DRAGON_ARMOUR, // 30 + ARM_GOLD_DRAGON_HIDE, ARM_GOLD_DRAGON_ARMOUR, - ARM_ANIMAL_SKIN, ARM_SWAMP_DRAGON_HIDE, ARM_SWAMP_DRAGON_ARMOUR, ARM_CENTAUR_BARDING, // 35 @@ -254,14 +255,15 @@ enum misc_item_type enum missile_type { - MI_STONE, // 0 + MI_DART, // 0 + MI_NEEDLE, MI_ARROW, MI_BOLT, - MI_DART, - MI_NEEDLE, - MI_LARGE_ROCK, // 5 - MI_SLING_BULLET, MI_JAVELIN, + MI_MAX_RACIAL = MI_JAVELIN, + MI_STONE, // 5 + MI_LARGE_ROCK, + MI_SLING_BULLET, MI_THROWING_NET, NUM_MISSILES, // 9 MI_NONE // was MI_EGGPLANT... used for launch type detection @@ -474,14 +476,15 @@ enum weapon_type WPN_KNIFE, WPN_BLOWGUN, WPN_FALCHION, - WPN_BLESSED_EUDEMON_BLADE, - WPN_LONGBOW, // 45 - WPN_LAJATANG, + WPN_LONGBOW, + WPN_LAJATANG, // 45 WPN_BARDICHE, + WPN_MAX_NONBLESSED = WPN_BARDICHE, WPN_BLESSED_FALCHION, WPN_BLESSED_LONG_SWORD, - WPN_BLESSED_SCIMITAR, // 50 - WPN_BLESSED_KATANA, + WPN_BLESSED_SCIMITAR, + WPN_BLESSED_KATANA, // 50 + WPN_BLESSED_EUDEMON_BLADE, WPN_BLESSED_DOUBLE_SWORD, WPN_BLESSED_GREAT_SWORD, WPN_BLESSED_TRIPLE_SWORD, diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc index 36f7b060fe..433e9ca86a 100644 --- a/crawl-ref/source/monstuff.cc +++ b/crawl-ref/source/monstuff.cc @@ -119,7 +119,8 @@ void get_mimic_item( const monsters *mimic, item_def &item ) { case MONS_WEAPON_MIMIC: item.base_type = OBJ_WEAPONS; - item.sub_type = (59*mimic->pos().x + 79*mimic->pos().y) % NUM_WEAPONS; + item.sub_type = (59 * mimic->pos().x + 79 * mimic->pos().y) + % (WPN_MAX_NONBLESSED + 1); prop %= 100; @@ -139,7 +140,8 @@ void get_mimic_item( const monsters *mimic, item_def &item ) case MONS_ARMOUR_MIMIC: item.base_type = OBJ_ARMOUR; - item.sub_type = (59*mimic->pos().x + 79*mimic->pos().y) % NUM_ARMOURS; + item.sub_type = (59 * mimic->pos().x + 79 * mimic->pos().y) + % NUM_ARMOURS; prop %= 100; |