+/*!
+ * @brief \8e©\93®\94j\89ó\82Ì\8eÀ\8ds
+ * @date 2020/04/25
+ * @author Hourier
+ */
#include "angband.h"
#include "autopick/autopick-util.h"
#include "autopick-methods-table.h"
#include "object-flavor.h"
#include "player-move.h"
+
+/*!
+ * @brief \83N\83\89\83X\88Ë\91¶\82Ì\83A\83C\83e\83\80\94j\89ó\82ð\92²\82×\82é
+ * @param player_ptr \83v\83\8c\81[\83\84\81[\82Ö\82Ì\8eQ\8fÆ\83|\83C\83\93\83^
+ * @param o_ptr \83A\83C\83e\83\80\82Ö\82Ì\8eQ\8fÆ\83|\83C\83\93\83^
+ * @return \93Á\95Ê\82È\83N\83\89\83X\81A\82©\82Â\82»\82Ì\83N\83\89\83X\93Á\97L\82Ì\83A\83C\83e\83\80\82Å\82 \82ê\82ÎFALSE\81A\82»\82ê\88È\8aO\82ÍTRUE
+ */
+static bool is_leave_special_item(player_type *player_ptr, object_type *o_ptr)
+{
+ if (!leave_special) return TRUE;
+
+ if (player_ptr->prace == RACE_DEMON)
+ {
+ if (o_ptr->tval == TV_CORPSE &&
+ o_ptr->sval == SV_CORPSE &&
+ my_strchr("pht", r_info[o_ptr->pval].d_char))
+ return FALSE;
+ }
+ else if (player_ptr->pclass == CLASS_ARCHER)
+ {
+ if (o_ptr->tval == TV_SKELETON ||
+ (o_ptr->tval == TV_CORPSE && o_ptr->sval == SV_SKELETON))
+ return FALSE;
+ }
+ else if (player_ptr->pclass == CLASS_NINJA)
+ {
+ if (o_ptr->tval == TV_LITE &&
+ o_ptr->name2 == EGO_LITE_DARKNESS && object_is_known(o_ptr))
+ return FALSE;
+ }
+ else if (player_ptr->pclass == CLASS_BEASTMASTER ||
+ player_ptr->pclass == CLASS_CAVALRY)
+ {
+ if (o_ptr->tval == TV_WAND &&
+ o_ptr->sval == SV_WAND_HEAL_MONSTER && object_is_aware(o_ptr))
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+
/*
* Automatically destroy items in this grid.
*/
if ((o_ptr->tval == TV_CHEST) && o_ptr->pval) return FALSE;
if (leave_wanted)
- {
if (object_is_bounty(o_ptr)) return FALSE;
- }
if (leave_corpse)
if (o_ptr->tval == TV_CORPSE) return FALSE;
if (leave_junk)
if ((o_ptr->tval == TV_SKELETON) || (o_ptr->tval == TV_BOTTLE) || (o_ptr->tval == TV_JUNK) || (o_ptr->tval == TV_STATUE)) return FALSE;
- if (leave_special)
- {
- if (player_ptr->prace == RACE_DEMON)
- {
- if (o_ptr->tval == TV_CORPSE &&
- o_ptr->sval == SV_CORPSE &&
- my_strchr("pht", r_info[o_ptr->pval].d_char))
- return FALSE;
- }
-
- if (player_ptr->pclass == CLASS_ARCHER)
- {
- if (o_ptr->tval == TV_SKELETON ||
- (o_ptr->tval == TV_CORPSE && o_ptr->sval == SV_SKELETON))
- return FALSE;
- }
- else if (player_ptr->pclass == CLASS_NINJA)
- {
- if (o_ptr->tval == TV_LITE &&
- o_ptr->name2 == EGO_LITE_DARKNESS && object_is_known(o_ptr))
- return FALSE;
- }
- else if (player_ptr->pclass == CLASS_BEASTMASTER ||
- player_ptr->pclass == CLASS_CAVALRY)
- {
- if (o_ptr->tval == TV_WAND &&
- o_ptr->sval == SV_WAND_HEAL_MONSTER && object_is_aware(o_ptr))
- return FALSE;
- }
- }
+ if (!is_leave_special_item(player_ptr, o_ptr)) return FALSE;
if (o_ptr->tval == TV_GOLD) return FALSE;