+ /* Analyze pval bonus for normal object */
+ switch (o_ptr->tval)
+ {
+ case TV_SHOT:
+ case TV_ARROW:
+ case TV_BOLT:
+ case TV_BOW:
+ case TV_DIGGING:
+ case TV_HAFTED:
+ case TV_POLEARM:
+ case TV_SWORD:
+ case TV_BOOTS:
+ case TV_GLOVES:
+ case TV_HELM:
+ case TV_CROWN:
+ case TV_SHIELD:
+ case TV_CLOAK:
+ case TV_SOFT_ARMOR:
+ case TV_HARD_ARMOR:
+ case TV_DRAG_ARMOR:
+ case TV_LITE:
+ case TV_AMULET:
+ case TV_RING:
+ /* No pval */
+ if (!o_ptr->pval) break;
+
+ /* Hack -- Negative "pval" is always bad */
+ if (o_ptr->pval < 0) return (0L);
+
+ /* Give credit for stat bonuses */
+ if (have_flag(flgs, TR_STR)) value += (o_ptr->pval * 200L);
+ if (have_flag(flgs, TR_INT)) value += (o_ptr->pval * 200L);
+ if (have_flag(flgs, TR_WIS)) value += (o_ptr->pval * 200L);
+ if (have_flag(flgs, TR_DEX)) value += (o_ptr->pval * 200L);
+ if (have_flag(flgs, TR_CON)) value += (o_ptr->pval * 200L);
+ if (have_flag(flgs, TR_CHR)) value += (o_ptr->pval * 200L);
+
+ /* Give credit for stealth and searching */
+ if (have_flag(flgs, TR_MAGIC_MASTERY)) value += (o_ptr->pval * 100);
+ if (have_flag(flgs, TR_STEALTH)) value += (o_ptr->pval * 100L);
+ if (have_flag(flgs, TR_SEARCH)) value += (o_ptr->pval * 100L);
+
+ /* Give credit for infra-vision and tunneling */
+ if (have_flag(flgs, TR_INFRA)) value += (o_ptr->pval * 50L);
+ if (have_flag(flgs, TR_TUNNEL)) value += (o_ptr->pval * 50L);
+
+ /* Give credit for extra attacks */
+ if (have_flag(flgs, TR_BLOWS)) value += (o_ptr->pval * 5000L);
+
+ /* Give credit for speed bonus */
+ if (have_flag(flgs, TR_SPEED)) value += (o_ptr->pval * 10000L);
+
+ break;
+ }
+