where the properties are redundant or conflicting with respect to the base jewellery type. Also, add known randart properties boolean vector to unrandarts.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2417 c06c8d41-db1a-0410-9941-cceddc491573
7AWYHENXBDI4OLKU7JD56YAKT5RO6UZ67HEBNPOILXCIFW6BONRAC }int randart_wpn_num_props( const item_def &item ){randart_properties_t proprt;randart_wpn_properties( item, proprt );return randart_wpn_num_props( proprt );}int randart_wpn_num_props( const randart_properties_t &proprt ){int num;for (int i = 0; i < RAP_NUM_PROPERTIES; i++)if (proprt[i] != 0)num++;return num;
}static bool randart_is_redundant( const item_def &item,randart_properties_t &proprt ){if (item.base_type != OBJ_JEWELLERY)return false;randart_prop_type provides = RAP_NUM_PROPERTIES;randart_prop_type provides2 = RAP_NUM_PROPERTIES;switch (item.sub_type){case RING_SUSTAIN_ABILITIES:case RING_SUSTENANCE:case RING_REGENERATION:case RING_TELEPORT_CONTROL:case RING_WIZARDRY:case RING_MAGICAL_POWER:break;case RING_PROTECTION:provides = RAP_AC;break;case RING_FIRE:case RING_PROTECTION_FROM_FIRE:provides = RAP_FIRE;break;case RING_POISON_RESISTANCE:provides = RAP_POISON;break;case RING_ICE:case RING_PROTECTION_FROM_COLD:provides = RAP_COLD;break;case RING_STRENGTH:provides = RAP_STRENGTH;break;case RING_SLAYING:provides = RAP_DAMAGE;provides2 = RAP_ACCURACY;break;case RING_SEE_INVISIBLE:provides = RAP_ACCURACY;break;case RING_INVISIBILITY:provides = RAP_INVISIBLE;break;case RING_HUNGER:provides = RAP_METABOLISM;break;case RING_TELEPORTATION:provides = RAP_CAN_TELEPORT;provides = RAP_CAUSE_TELEPORTATION;break;case RING_EVASION:provides = RAP_EVASION;break;case RING_DEXTERITY:provides = RAP_DEXTERITY;break;case RING_INTELLIGENCE:provides = RAP_INTELLIGENCE;break;case RING_LEVITATION:provides = RAP_LEVITATE;break;case RING_LIFE_PROTECTION:provides = RAP_AC;break;case RING_PROTECTION_FROM_MAGIC:provides = RAP_MAGIC;break;case AMU_RAGE:provides = RAP_BERSERK;break;case AMU_INACCURACY:provides = RAP_ACCURACY;break;case AMU_RESIST_SLOW:case AMU_CLARITY:case AMU_WARDING:case AMU_RESIST_CORROSION:case AMU_THE_GOURMAND:case AMU_CONSERVATION:case AMU_CONTROLLED_FLIGHT:case AMU_RESIST_MUTATION:break;}if (provides == RAP_NUM_PROPERTIES)return false;if (proprt[provides] != 0)return true;if (provides2 == RAP_NUM_PROPERTIES)return false;if (proprt[provides2] != 0)return true;return false;}static bool randart_is_conflicting( const item_def &item,randart_properties_t &proprt ){if (item.base_type != OBJ_JEWELLERY)return false;randart_prop_type conflicts = RAP_NUM_PROPERTIES;switch (item.sub_type){case RING_REGENERATION:case RING_PROTECTION:case RING_PROTECTION_FROM_FIRE:case RING_POISON_RESISTANCE:case RING_PROTECTION_FROM_COLD:case RING_STRENGTH:case RING_SLAYING:case RING_SEE_INVISIBLE:case RING_INVISIBILITY:case RING_HUNGER:case RING_EVASION:case RING_SUSTAIN_ABILITIES:case RING_DEXTERITY:case RING_INTELLIGENCE:case RING_LEVITATION:case RING_LIFE_PROTECTION:case RING_PROTECTION_FROM_MAGIC:break;case RING_SUSTENANCE:conflicts = RAP_METABOLISM;break;case RING_FIRE:case RING_ICE:case RING_WIZARDRY:case RING_MAGICAL_POWER:conflicts = RAP_PREVENT_SPELLCASTING;break;case RING_TELEPORTATION:case RING_TELEPORT_CONTROL:conflicts = RAP_PREVENT_TELEPORTATION;break;case AMU_RESIST_MUTATION:conflicts = RAP_MUTAGENIC;break;case AMU_RAGE:conflicts = RAP_STEALTH;break;case AMU_RESIST_SLOW:case AMU_CLARITY:case AMU_WARDING:case AMU_RESIST_CORROSION:case AMU_THE_GOURMAND:case AMU_CONSERVATION:case AMU_CONTROLLED_FLIGHT:case AMU_INACCURACY:break;}if (conflicts == RAP_NUM_PROPERTIES)return false;if (proprt[conflicts] != 0)return true;return false;