# lights : Light sources match.
# junks : Junk items like Shard of Pottery or etc. match.
# spellbooks : All books match.
-# hafted weapons : Hafted weapons match. For priests.
+# favorite weapons : Weapons suitable for your class (for Priest, Monk,
+# BeastMaster, ForceTrainer, Cavalry, and Ninja)
#
# You may also use keywords which match specified kinds of equipment:
# weapons, armors, missiles, magical devices, lights, junks, spellbooks,
lights : Light sources match.
junks : Junk items like Shard of Pottery or etc. match.
spellbooks : All books match.
- hafted weapons : Hafted weapons match. For priests.
+ favorite weapons : Weapons suitable for your class (for Priest, Monk,
+ BeastMaster, ForceTrainer, Cavalry, and Ninja)
You may also use keywords which match specified kinds of equipment:
weapons, armors, missiles, magical devices, lights, junks, spellbooks,
#define FLG_HELMS 45
#define FLG_GLOVES 46
#define FLG_BOOTS 47
+#define FLG_FAVORITE 48
#ifdef JP
#define KEY_HELMS "³õ"
#define KEY_GLOVES "äƼê"
#define KEY_BOOTS "·¤"
+#define KEY_FAVORITE "ÆÀ°ÕÉð´ï"
#else
#define KEY_HELMS "helms"
#define KEY_GLOVES "gloves"
#define KEY_BOOTS "boots"
+#define KEY_FAVORITE "favorite weapons"
#endif /* JP */
else if (IS_FLG(FLG_HELMS)) ADD_KEY2(KEY_HELMS);
else if (IS_FLG(FLG_GLOVES)) ADD_KEY2(KEY_GLOVES);
else if (IS_FLG(FLG_BOOTS)) ADD_KEY2(KEY_BOOTS);
+ else if (IS_FLG(FLG_FAVORITE)) ADD_KEY2(KEY_FAVORITE);
/* You don't need sepalator after adjective */
/* 'artifact' is not true adjective */
else if (MATCH_KEY2(KEY_HELMS)) ADD_FLG_NOUN(FLG_HELMS);
else if (MATCH_KEY2(KEY_GLOVES)) ADD_FLG_NOUN(FLG_GLOVES);
else if (MATCH_KEY2(KEY_BOOTS)) ADD_FLG_NOUN(FLG_BOOTS);
+ else if (MATCH_KEY2(KEY_FAVORITE)) ADD_FLG_NOUN(FLG_FAVORITE);
/* Last 'keyword' must be at the correct location */
if (*ptr == ':')
/*
+ * Favorite weapons
+ */
+static bool is_favorite(object_type *o_ptr, bool others_ok)
+{
+ /* Only weapons match */
+ switch(o_ptr->tval)
+ {
+ case TV_BOW: case TV_HAFTED: case TV_POLEARM:
+ case TV_SWORD: case TV_DIGGING:
+ break;
+ default: return FALSE;
+ }
+
+ /* Favorite weapons are varied depend on the class */
+ switch (p_ptr->pclass)
+ {
+ case CLASS_PRIEST:
+ {
+ u32b flgs[TR_FLAG_SIZE];
+ object_flags_known(o_ptr, flgs);
+
+ if (!have_flag(flgs, TR_BLESSED) &&
+ !(o_ptr->tval == TV_HAFTED))
+ return FALSE;
+ break;
+ }
+
+ case CLASS_MONK:
+ case CLASS_FORCETRAINER:
+ /* Icky to wield? */
+ if (!(s_info[p_ptr->pclass].w_max[o_ptr->tval-TV_BOW][o_ptr->sval]))
+ return FALSE;
+ break;
+
+ case CLASS_BEASTMASTER:
+ case CLASS_CAVALRY:
+ {
+ u32b flgs[TR_FLAG_SIZE];
+ object_flags_known(o_ptr, flgs);
+
+ /* Is it known to be suitable to using while riding? */
+ if (!(have_flag(flgs, TR_RIDING)))
+ return FALSE;
+
+ break;
+ }
+
+ case CLASS_NINJA:
+ /* Icky to wield? */
+ if (s_info[p_ptr->pclass].w_max[o_ptr->tval-TV_BOW][o_ptr->sval] <= WEAPON_EXP_BEGINNER)
+ return FALSE;
+ break;
+
+ default:
+ /* Non-special class */
+ if (others_ok) return TRUE;
+ else return FALSE;
+ }
+
+ return TRUE;
+}
+
+/*
* A function for Auto-picker/destroyer
* Examine whether the object matches to the entry
*/
if (!(o_ptr->tval == TV_BOOTS))
return FALSE;
}
+ else if (IS_FLG(FLG_FAVORITE))
+ {
+ if (!is_favorite(o_ptr, TRUE))
+ return FALSE;
+ }
/* Keyword don't match */
if (*ptr == '^')
body_str = "äƼê";
else if (IS_FLG(FLG_BOOTS))
body_str = "¥Ö¡¼¥Ä";
+ else if (IS_FLG(FLG_FAVORITE))
+ body_str = "ÆÀ°ÕÉð´ï";
*buff = '\0';
if (!before_n)
body_str = "gloves";
else if (IS_FLG(FLG_BOOTS))
body_str = "boots";
+ else if (IS_FLG(FLG_FAVORITE))
+ body_str = "favorite weapons";
/* Prepare a string for item name */
if (*str)
ADD_FLG(FLG_JUNKS);
else if (o_ptr->tval >= TV_LIFE_BOOK)
ADD_FLG(FLG_SPELLBOOKS);
- else if (o_ptr->tval == TV_HAFTED)
- ADD_FLG(FLG_HAFTED);
+ else if (is_favorite(o_ptr, FALSE))
+ ADD_FLG(FLG_FAVORITE);
else if (o_ptr->tval == TV_POLEARM || o_ptr->tval == TV_SWORD
- || o_ptr->tval == TV_DIGGING)
+ || o_ptr->tval == TV_DIGGING || o_ptr->tval == TV_HAFTED)
ADD_FLG(FLG_WEAPONS);
else if (o_ptr->tval == TV_SHIELD)
ADD_FLG(FLG_SHIELDS);