diff options
author | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-04-14 01:11:22 +0000 |
---|---|---|
committer | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-04-14 01:11:22 +0000 |
commit | 8947c0ad81e7b3f8d2cde4eb1c8c6317d2790f22 (patch) | |
tree | be0d0be6c9d9f50af96219e7500de0f969b3d35f /crawl-ref/source/itemprop.cc | |
parent | bfa3bf4326f3f3671c2eeb020fbfffe9c75b12e3 (diff) | |
download | crawl-ref-8947c0ad81e7b3f8d2cde4eb1c8c6317d2790f22.tar.gz crawl-ref-8947c0ad81e7b3f8d2cde4eb1c8c6317d2790f22.zip |
Let TSO's blessings properly convert demonic weapons into non-demonic
weapons. Note that demon blades now become scimitars. This will be
improved later.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@4224 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/itemprop.cc')
-rw-r--r-- | crawl-ref/source/itemprop.cc | 70 |
1 files changed, 48 insertions, 22 deletions
diff --git a/crawl-ref/source/itemprop.cc b/crawl-ref/source/itemprop.cc index 1feee1460f..966ee4ac7a 100644 --- a/crawl-ref/source/itemprop.cc +++ b/crawl-ref/source/itemprop.cc @@ -895,7 +895,7 @@ int get_ammo_brand( const item_def &item ) special_armour_type get_armour_ego_type( const item_def &item ) { // artefact armours have no ego type, must look up powers separately - if (item.base_type != OBJ_ARMOUR + if (item.base_type != OBJ_ARMOUR || (is_random_artefact( item ) && !is_unrandom_artefact( item ))) { return (SPARM_NORMAL); @@ -904,7 +904,7 @@ special_armour_type get_armour_ego_type( const item_def &item ) return (static_cast<special_armour_type>(item.special)); } -// +// // Armour information and checking functions // bool hide2armour( item_def &item ) @@ -917,36 +917,36 @@ bool hide2armour( item_def &item ) default: return (false); - case ARM_DRAGON_HIDE: - item.sub_type = ARM_DRAGON_ARMOUR; + case ARM_DRAGON_HIDE: + item.sub_type = ARM_DRAGON_ARMOUR; break; - case ARM_TROLL_HIDE: - item.sub_type = ARM_TROLL_LEATHER_ARMOUR; + case ARM_TROLL_HIDE: + item.sub_type = ARM_TROLL_LEATHER_ARMOUR; break; - case ARM_ICE_DRAGON_HIDE: - item.sub_type = ARM_ICE_DRAGON_ARMOUR; + case ARM_ICE_DRAGON_HIDE: + item.sub_type = ARM_ICE_DRAGON_ARMOUR; break; - case ARM_MOTTLED_DRAGON_HIDE: - item.sub_type = ARM_MOTTLED_DRAGON_ARMOUR; + case ARM_MOTTLED_DRAGON_HIDE: + item.sub_type = ARM_MOTTLED_DRAGON_ARMOUR; break; - case ARM_STORM_DRAGON_HIDE: - item.sub_type = ARM_STORM_DRAGON_ARMOUR; + case ARM_STORM_DRAGON_HIDE: + item.sub_type = ARM_STORM_DRAGON_ARMOUR; break; - case ARM_GOLD_DRAGON_HIDE: - item.sub_type = ARM_GOLD_DRAGON_ARMOUR; + case ARM_GOLD_DRAGON_HIDE: + item.sub_type = ARM_GOLD_DRAGON_ARMOUR; break; - case ARM_SWAMP_DRAGON_HIDE: - item.sub_type = ARM_SWAMP_DRAGON_ARMOUR; + case ARM_SWAMP_DRAGON_HIDE: + item.sub_type = ARM_SWAMP_DRAGON_ARMOUR; break; - case ARM_STEAM_DRAGON_HIDE: - item.sub_type = ARM_STEAM_DRAGON_ARMOUR; + case ARM_STEAM_DRAGON_HIDE: + item.sub_type = ARM_STEAM_DRAGON_ARMOUR; break; } @@ -1483,7 +1483,7 @@ hands_reqd_type hands_reqd( const item_def &item, size_type size ) case OBJ_WEAPONS: // Merging staff with magical staves for consistency... doing // as a special case because we want to be very flexible with - // these useful objects (we want spriggans and ogre magi to + // these useful objects (we want spriggans and ogre magi to // be able to use them). if (item.base_type == OBJ_STAVES || item.sub_type == WPN_QUARTERSTAFF) { @@ -1491,7 +1491,7 @@ hands_reqd_type hands_reqd( const item_def &item, size_type size ) ret = HANDS_TWO; else if (size > SIZE_LARGE) ret = HANDS_ONE; - else + else ret = HANDS_HALF; break; } @@ -1536,12 +1536,12 @@ hands_reqd_type hands_reqd( const item_def &item, size_type size ) ret = HANDS_TWO; break; - case OBJ_ARMOUR: // barding and body armours are unwieldy + case OBJ_ARMOUR: // barding and body armours are unwieldy if (item.sub_type == ARM_NAGA_BARDING || item.sub_type == ARM_CENTAUR_BARDING || get_armour_slot( item ) == EQ_BODY_ARMOUR) { - ret = HANDS_TWO; + ret = HANDS_TWO; } break; @@ -1596,6 +1596,32 @@ bool is_demonic( const item_def &item ) return (false); } // end is_demonic() +bool demonic2nondemonic( item_def &item ) +{ + if (item.base_type != OBJ_WEAPONS) + return (false); + + switch (item.sub_type) + { + default: + return (false); + + case WPN_DEMON_BLADE: + item.sub_type = WPN_SCIMITAR; + break; + + case WPN_DEMON_WHIP: + item.sub_type = WPN_WHIP; + break; + + case WPN_DEMON_TRIDENT: + item.sub_type = WPN_TRIDENT; + break; + } + + return (true); +} // end demonic2nondemonic() + int weapon_str_weight( const item_def &wpn ) { ASSERT (wpn.base_type == OBJ_WEAPONS || wpn.base_type == OBJ_STAVES); |