OSDN Git Service

[Refactor] #37353 型の置換。 / Type replacement. (BASE_STATUS / A_MAX)
[hengband/hengband.git] / src / object1.c
index db8a781..9de2810 100644 (file)
@@ -12,6 +12,7 @@
  */
 
 #include "angband.h"
+#include "artifact.h"
 
 #if defined(MACINTOSH) || defined(MACH_O_CARBON)
 #ifdef verify
@@ -339,9 +340,9 @@ void object_flags_known(object_type *o_ptr, BIT_FLAGS flgs[TR_FLAG_SIZE])
 /*!
  * @brief オブジェクトの発動効果名称を返す(サブルーチン/ブレス)
  * @param o_ptr 名称を取得する元のオブジェクト構造体参照ポインタ
- * @return cptr 発動名称を返す文字列ポインタ
+ * @return concptr 発動名称を返す文字列ポインタ
  */
-static cptr item_activation_dragon_breath(object_type *o_ptr)
+static concptr item_activation_dragon_breath(object_type *o_ptr)
 {
        static char desc[256];
        BIT_FLAGS flgs[TR_FLAG_SIZE]; /* for resistance flags */
@@ -368,12 +369,12 @@ static cptr item_activation_dragon_breath(object_type *o_ptr)
 /*!
  * @brief オブジェクトの発動効果名称を返す(サブルーチン/汎用)
  * @param o_ptr 名称を取得する元のオブジェクト構造体参照ポインタ
- * @return cptr 発動名称を返す文字列ポインタ
+ * @return concptr 発動名称を返す文字列ポインタ
  */
-static cptr item_activation_aux(object_type *o_ptr)
+static concptr item_activation_aux(object_type *o_ptr)
 {
        static char activation_detail[256];
-       cptr desc;
+       concptr desc;
        char timeout[32];
        int constant, dice;
        const activation_type* const act_ptr = find_activation_info(o_ptr);
@@ -469,13 +470,11 @@ static cptr item_activation_aux(object_type *o_ptr)
  * @brief オブジェクトの発動効果名称を返す(メインルーチン) /
  * Determine the "Activation" (if any) for an artifact Return a string, or NULL for "no activation"
  * @param o_ptr 名称を取得する元のオブジェクト構造体参照ポインタ
- * @return cptr 発動名称を返す文字列ポインタ
+ * @return concptr 発動名称を返す文字列ポインタ
  */
-cptr item_activation(object_type *o_ptr)
+concptr item_activation(object_type *o_ptr)
 {
        BIT_FLAGS flgs[TR_FLAG_SIZE];
-
-       /* Extract the flags */
        object_flags(o_ptr, flgs);
 
        /* Require activation ability */
@@ -516,15 +515,13 @@ bool screen_object(object_type *o_ptr, BIT_FLAGS mode)
        BIT_FLAGS flgs[TR_FLAG_SIZE];
 
        char temp[70 * 20];
-       cptr            info[128];
-       char o_name[MAX_NLEN];
+       concptr            info[128];
+       GAME_TEXT o_name[MAX_NLEN];
        int wid, hgt;
        POSITION rad;
        char desc[256];
 
        int trivial_info = 0;
-
-       /* Extract the flags */
        object_flags(o_ptr, flgs);
 
        /* Extract the description */
@@ -1464,9 +1461,9 @@ s16b wield_slot(object_type *o_ptr)
  * @param i 部位表現を求めるプレイヤーの所持/装備オブジェクトID
  * @return 部位表現の文字列ポインタ
  */
-cptr mention_use(int i)
+concptr mention_use(int i)
 {
-       cptr p;
+       concptr p;
 
        /* Examine the location */
        switch (i)
@@ -1509,9 +1506,9 @@ cptr mention_use(int i)
  * @details
  * Currently, only used for items in the equipment, not inventory.
  */
-cptr describe_use(int i)
+concptr describe_use(int i)
 {
-       cptr p;
+       concptr p;
 
        switch (i)
        {
@@ -1577,7 +1574,7 @@ bool check_book_realm(const OBJECT_TYPE_VALUE book_tval, const OBJECT_SUBTYPE_VA
 bool item_tester_okay(object_type *o_ptr)
 {
        /* Hack -- allow listing empty slots */
-       if (item_tester_full) return (TRUE);
+       // if (item_tester_full) return (TRUE); // TODO:DELETE
 
        /* Require an item */
        if (!o_ptr->k_idx) return (FALSE);
@@ -1620,12 +1617,12 @@ bool item_tester_okay(object_type *o_ptr)
  */
 void display_inven(void)
 {
-       register        int i, n, z = 0;
-       object_type     *o_ptr;
-       TERM_COLOR      attr = TERM_WHITE;
-       char            tmp_val[80];
-       char            o_name[MAX_NLEN];
-       int             wid, hgt;
+       register int i, n, z = 0;
+       object_type *o_ptr;
+       TERM_COLOR attr = TERM_WHITE;
+       char tmp_val[80];
+       GAME_TEXT o_name[MAX_NLEN];
+       TERM_LEN wid, hgt;
 
        Term_get_size(&wid, &hgt);
 
@@ -1719,7 +1716,7 @@ void display_equip(void)
        object_type *o_ptr;
        TERM_COLOR attr = TERM_WHITE;
        char tmp_val[80];
-       char o_name[MAX_NLEN];
+       GAME_TEXT o_name[MAX_NLEN];
        TERM_LEN wid, hgt;
 
        Term_get_size(&wid, &hgt);
@@ -1821,7 +1818,7 @@ static bool get_tag(COMMAND_CODE *cp, char tag, BIT_FLAGS mode)
 {
        COMMAND_CODE i;
        COMMAND_CODE start, end;
-       cptr s;
+       concptr s;
 
        /* Extract index from mode */
        switch (mode)
@@ -1854,7 +1851,7 @@ static bool get_tag(COMMAND_CODE *cp, char tag, BIT_FLAGS mode)
                if (!o_ptr->inscription) continue;
 
                /* Skip non-choice */
-               if (!item_tester_okay(o_ptr)) continue;
+               if (!item_tester_okay(o_ptr) && !(mode & USE_FULL)) continue;
 
                /* Find a '@' */
                s = my_strchr(quark_str(o_ptr->inscription), '@');
@@ -1899,7 +1896,7 @@ static bool get_tag(COMMAND_CODE *cp, char tag, BIT_FLAGS mode)
                if (!o_ptr->inscription) continue;
 
                /* Skip non-choice */
-               if (!item_tester_okay(o_ptr)) continue;
+               if (!item_tester_okay(o_ptr) && !(mode & USE_FULL)) continue;
 
                /* Find a '@' */
                s = my_strchr(quark_str(o_ptr->inscription), '@');
@@ -1946,7 +1943,7 @@ static bool get_tag(COMMAND_CODE *cp, char tag, BIT_FLAGS mode)
 static bool get_tag_floor(COMMAND_CODE *cp, char tag, FLOOR_IDX floor_list[], ITEM_NUMBER floor_num)
 {
        COMMAND_CODE i;
-       cptr s;
+       concptr s;
 
        /**** Find a tag in the form of {@x#} (allow alphabet tag) ***/
 
@@ -2032,7 +2029,7 @@ static bool get_tag_floor(COMMAND_CODE *cp, char tag, FLOOR_IDX floor_list[], IT
  */
 static void prepare_label_string(char *label, BIT_FLAGS mode)
 {
-       cptr alphabet_chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
+       concptr alphabet_chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
        int  offset = (mode == USE_EQUIP) ? INVEN_RARM : 0;
        int  i;
 
@@ -2043,7 +2040,7 @@ static void prepare_label_string(char *label, BIT_FLAGS mode)
        for (i = 0; i < 52; i++)
        {
                COMMAND_CODE index;
-               char c = alphabet_chars[i];
+               SYMBOL_CODE c = alphabet_chars[i];
 
                /* Find a tag with this label */
                if (get_tag(&index, c, mode))
@@ -2070,7 +2067,7 @@ static void prepare_label_string(char *label, BIT_FLAGS mode)
  */
 static void prepare_label_string_floor(char *label, FLOOR_IDX floor_list[], ITEM_NUMBER floor_num)
 {
-       cptr alphabet_chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
+       concptr alphabet_chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
        int  i;
 
        /* Prepare normal labels */
@@ -2080,7 +2077,7 @@ static void prepare_label_string_floor(char *label, FLOOR_IDX floor_list[], ITEM
        for (i = 0; i < 52; i++)
        {
                COMMAND_CODE index;
-               char c = alphabet_chars[i];
+               SYMBOL_CODE c = alphabet_chars[i];
 
                /* Find a tag with this label */
                if (get_tag_floor(&index, c, floor_list, floor_num))
@@ -2103,20 +2100,20 @@ static void prepare_label_string_floor(char *label, FLOOR_IDX floor_list[], ITEM
  * @details
  * Hack -- do not display "trailing" empty slots
  */
-COMMAND_CODE show_inven(int target_item)
+COMMAND_CODE show_inven(int target_item, BIT_FLAGS mode)
 {
        COMMAND_CODE i;
        int j, k, l, z = 0;
        int             col, cur_col, len;
-       object_type     *o_ptr;
-       char            o_name[MAX_NLEN];
+       object_type *o_ptr;
+       GAME_TEXT o_name[MAX_NLEN];
        char            tmp_val[80];
        COMMAND_CODE    out_index[23];
        TERM_COLOR      out_color[23];
        char            out_desc[23][MAX_NLEN];
        COMMAND_CODE target_item_label = 0;
        TERM_LEN wid, hgt;
-       char            inven_label[52 + 1];
+       char inven_label[52 + 1];
 
        /* Starting column */
        col = command_gap;
@@ -2147,7 +2144,7 @@ COMMAND_CODE show_inven(int target_item)
                o_ptr = &inventory[i];
 
                /* Is this item acceptable? */
-               if (!item_tester_okay(o_ptr)) continue;
+               if (!item_tester_okay(o_ptr) && !(mode & USE_FULL)) continue;
 
                object_desc(o_name, o_ptr, 0);
 
@@ -2225,8 +2222,8 @@ COMMAND_CODE show_inven(int target_item)
                /* Display graphics for object, if desired */
                if (show_item_graph)
                {
-                       byte  a = object_attr(o_ptr);
-                       char c = object_char(o_ptr);
+                       TERM_COLOR a = object_attr(o_ptr);
+                       SYMBOL_CODE c = object_char(o_ptr);
                        Term_queue_bigchar(cur_col, j + 1, a, c, 0, 0);
                        if (use_bigtile) cur_col++;
 
@@ -2272,9 +2269,9 @@ COMMAND_CODE show_equip(int target_item, BIT_FLAGS mode)
        COMMAND_CODE i;
        int j, k, l;
        int             col, cur_col, len;
-       object_type     *o_ptr;
+       object_type *o_ptr;
        char            tmp_val[80];
-       char            o_name[MAX_NLEN];
+       GAME_TEXT o_name[MAX_NLEN];
        COMMAND_CODE    out_index[23];
        TERM_COLOR      out_color[23];
        char            out_desc[23][MAX_NLEN];
@@ -2297,11 +2294,10 @@ COMMAND_CODE show_equip(int target_item, BIT_FLAGS mode)
                o_ptr = &inventory[i];
 
                /* Is this item acceptable? */
-               if (!(select_ring_slot ? is_ring_slot(i) : item_tester_okay(o_ptr)) &&
+               if (!(select_ring_slot ? is_ring_slot(i) : item_tester_okay(o_ptr) || (mode & USE_FULL)) &&
                    (!((((i == INVEN_RARM) && p_ptr->hidarite) || ((i == INVEN_LARM) && p_ptr->migite)) && p_ptr->ryoute) ||
                                (mode & IGNORE_BOTHHAND_SLOT))) continue;
 
-               /* Description */
                object_desc(o_name, o_ptr, 0);
 
                if ((((i == INVEN_RARM) && p_ptr->hidarite) || ((i == INVEN_LARM) && p_ptr->migite)) && p_ptr->ryoute)
@@ -2398,8 +2394,8 @@ COMMAND_CODE show_equip(int target_item, BIT_FLAGS mode)
                /* Display graphics for object, if desired */
                if (show_item_graph)
                {
-                       byte a = object_attr(o_ptr);
-                       char c = object_char(o_ptr);
+                       TERM_COLOR a = object_attr(o_ptr);
+                       SYMBOL_CODE c = object_char(o_ptr);
                        Term_queue_bigchar(cur_col, j + 1, a, c, 0, 0);
                        if (use_bigtile) cur_col++;
 
@@ -2493,9 +2489,9 @@ void toggle_inven_equip(void)
  * @return 確認がYesならTRUEを返す。
  * @details The item can be negative to mean "item on floor".
  */
-static bool verify(cptr prompt, INVENTORY_IDX item)
+static bool verify(concptr prompt, INVENTORY_IDX item)
 {
-       char        o_name[MAX_NLEN];
+       GAME_TEXT o_name[MAX_NLEN];
        char        out_val[MAX_NLEN+20];
        object_type *o_ptr;
 
@@ -2530,7 +2526,7 @@ static bool verify(cptr prompt, INVENTORY_IDX item)
  */
 static bool get_item_allow(INVENTORY_IDX item)
 {
-       cptr s;
+       concptr s;
        object_type *o_ptr;
        if (!command_cmd) return TRUE; /* command_cmd is no longer effective */
 
@@ -2669,7 +2665,7 @@ bool can_get_item(void)
  * We always erase the prompt when we are done, leaving a blank line,\n
  * or a warning message, if appropriate, if no items are available.\n
  */
-bool get_item(OBJECT_IDX *cp, cptr pmt, cptr str, BIT_FLAGS mode)
+bool get_item(OBJECT_IDX *cp, concptr pmt, concptr str, BIT_FLAGS mode)
 {
        OBJECT_IDX this_o_idx, next_o_idx = 0;
 
@@ -2731,7 +2727,7 @@ bool get_item(OBJECT_IDX *cp, cptr pmt, cptr str, BIT_FLAGS mode)
                        o_ptr = &o_list[k];
 
                        /* Validate the item */
-                       if (item_tester_okay(o_ptr))
+                       if (item_tester_okay(o_ptr) || (mode & USE_FULL))
                        {
                                /* Forget restrictions */
                                item_tester_tval = 0;
@@ -2802,7 +2798,7 @@ bool get_item(OBJECT_IDX *cp, cptr pmt, cptr str, BIT_FLAGS mode)
        else if (use_menu)
        {
                for (j = 0; j < INVEN_PACK; j++)
-                       if (item_tester_okay(&inventory[j])) max_inven++;
+                       if (item_tester_okay(&inventory[j]) || (mode & USE_FULL)) max_inven++;
        }
 
        /* Restrict inventory indexes */
@@ -2819,7 +2815,7 @@ bool get_item(OBJECT_IDX *cp, cptr pmt, cptr str, BIT_FLAGS mode)
        else if (use_menu)
        {
                for (j = INVEN_RARM; j < INVEN_TOTAL; j++)
-                       if (select_ring_slot ? is_ring_slot(j) : item_tester_okay(&inventory[j])) max_equip++;
+                       if (select_ring_slot ? is_ring_slot(j) : item_tester_okay(&inventory[j]) || (mode & USE_FULL)) max_equip++;
                if (p_ptr->ryoute && !(mode & IGNORE_BOTHHAND_SLOT)) max_equip++;
        }
 
@@ -2850,7 +2846,7 @@ bool get_item(OBJECT_IDX *cp, cptr pmt, cptr str, BIT_FLAGS mode)
                        next_o_idx = o_ptr->next_o_idx;
 
                        /* Accept the item on the floor if legal */
-                       if (item_tester_okay(o_ptr) && (o_ptr->marked & OM_FOUND)) allow_floor = TRUE;
+                       if ((item_tester_okay(o_ptr) || (mode & USE_FULL)) && (o_ptr->marked & OM_FOUND)) allow_floor = TRUE;
                }
        }
 
@@ -2948,7 +2944,7 @@ bool get_item(OBJECT_IDX *cp, cptr pmt, cptr str, BIT_FLAGS mode)
                if (!command_wrk)
                {
                        /* Redraw if needed */
-                       if (command_see) get_item_label = show_inven(menu_line);
+                       if (command_see) get_item_label = show_inven(menu_line, mode);
                }
 
                /* Equipment screen */
@@ -2979,11 +2975,7 @@ bool get_item(OBJECT_IDX *cp, cptr pmt, cptr str, BIT_FLAGS mode)
                        if (!command_see && !use_menu) strcat(out_val, _(" '*'一覧,", " * to see,"));
 
                        /* Append */
-#ifdef JP
-                       if (equip) strcat(out_val, format(" %s 装備品,", use_menu ? "'4'or'6'" : "'/'"));
-#else
-                       if (equip) strcat(out_val, format(" %s for Equip,", use_menu ? "4 or 6" : "/"));
-#endif
+                       if (equip) strcat(out_val, format(_(" %s 装備品,", " %s for Equip,"), use_menu ? _("'4'or'6'", "4 or 6") : _("'/'", "/")));
                }
 
                /* Viewing equipment */
@@ -3007,11 +2999,7 @@ bool get_item(OBJECT_IDX *cp, cptr pmt, cptr str, BIT_FLAGS mode)
                        if (!command_see && !use_menu) strcat(out_val, _(" '*'一覧,", " * to see,"));
 
                        /* Append */
-#ifdef JP
-                       if (inven) strcat(out_val, format(" %s 持ち物,", use_menu ? "'4'or'6'" : "'/'"));
-#else
-                       if (inven) strcat(out_val, format(" %s for Inven,", use_menu ? "4 or 6" : "'/'"));
-#endif
+                       if (inven) strcat(out_val, format(_(" %s 持ち物,", " %s for Inven,"), use_menu ? _("'4'or'6'", "4 or 6") : _("'/'", "'/'")));
                }
 
                /* Indicate legality of the "floor" item */
@@ -3208,7 +3196,7 @@ bool get_item(OBJECT_IDX *cp, cptr pmt, cptr str, BIT_FLAGS mode)
                                                next_o_idx = o_ptr->next_o_idx;
 
                                                /* Validate the item */
-                                               if (!item_tester_okay(o_ptr)) continue;
+                                               if (!item_tester_okay(o_ptr) && !(mode & USE_FULL)) continue;
 
                                                /* Special index */
                                                k = 0 - this_o_idx;
@@ -3452,7 +3440,7 @@ bool get_item(OBJECT_IDX *cp, cptr pmt, cptr str, BIT_FLAGS mode)
 /*
  * Choose an item and get auto-picker entry from it.
  */
-object_type *choose_object(OBJECT_IDX *idx, cptr q, cptr s, BIT_FLAGS option)
+object_type *choose_object(OBJECT_IDX *idx, concptr q, concptr s, BIT_FLAGS option)
 {
        OBJECT_IDX item;
        if (!get_item(&item, q, s, option)) return NULL;
@@ -3538,7 +3526,7 @@ COMMAND_CODE show_floor(int target_item, POSITION y, POSITION x, TERM_LEN *min_w
 
        object_type *o_ptr;
 
-       char o_name[MAX_NLEN];
+       GAME_TEXT o_name[MAX_NLEN];
        char tmp_val[80];
 
        COMMAND_CODE out_index[23];
@@ -3663,7 +3651,7 @@ COMMAND_CODE show_floor(int target_item, POSITION y, POSITION x, TERM_LEN *min_w
  * @param mode オプションフラグ
  * @return プレイヤーによりアイテムが選択されたならTRUEを返す。/
  */
-bool get_item_floor(COMMAND_CODE *cp, cptr pmt, cptr str, BIT_FLAGS mode)
+bool get_item_floor(COMMAND_CODE *cp, concptr pmt, concptr str, BIT_FLAGS mode)
 {
        char n1 = ' ', n2 = ' ', which = ' ';
 
@@ -3742,7 +3730,7 @@ bool get_item_floor(COMMAND_CODE *cp, cptr pmt, cptr str, BIT_FLAGS mode)
                        }
 
                        /* Validate the item */
-                       else if (item_tester_okay(&o_list[0 - (*cp)]))
+                       else if (item_tester_okay(&o_list[0 - (*cp)]) || (mode & USE_FULL))
                        {
                                /* Forget restrictions */
                                item_tester_tval = 0;
@@ -3815,7 +3803,7 @@ bool get_item_floor(COMMAND_CODE *cp, cptr pmt, cptr str, BIT_FLAGS mode)
        else if (use_menu)
        {
                for (j = 0; j < INVEN_PACK; j++)
-                       if (item_tester_okay(&inventory[j])) max_inven++;
+                       if (item_tester_okay(&inventory[j]) || (mode & USE_FULL)) max_inven++;
        }
 
        /* Restrict inventory indexes */
@@ -3832,7 +3820,7 @@ bool get_item_floor(COMMAND_CODE *cp, cptr pmt, cptr str, BIT_FLAGS mode)
        else if (use_menu)
        {
                for (j = INVEN_RARM; j < INVEN_TOTAL; j++)
-                       if (select_ring_slot ? is_ring_slot(j) : item_tester_okay(&inventory[j])) max_equip++;
+                       if (select_ring_slot ? is_ring_slot(j) : item_tester_okay(&inventory[j]) || (mode & USE_FULL)) max_equip++;
                if (p_ptr->ryoute && !(mode & IGNORE_BOTHHAND_SLOT)) max_equip++;
        }
 
@@ -3967,7 +3955,7 @@ bool get_item_floor(COMMAND_CODE *cp, cptr pmt, cptr str, BIT_FLAGS mode)
                        n2 = I2A(i2);
 
                        /* Redraw if needed */
-                       if (command_see) get_item_label = show_inven(menu_line);
+                       if (command_see) get_item_label = show_inven(menu_line, mode);
                }
 
                /* Equipment screen */
@@ -3978,7 +3966,7 @@ bool get_item_floor(COMMAND_CODE *cp, cptr pmt, cptr str, BIT_FLAGS mode)
                        n2 = I2A(e2 - INVEN_RARM);
 
                        /* Redraw if needed */
-                       if (command_see) get_item_label = show_equip(menu_line, 0L);
+                       if (command_see) get_item_label = show_equip(menu_line, mode);
                }
 
                /* Floor screen */
@@ -4808,9 +4796,7 @@ bool get_item_floor(COMMAND_CODE *cp, cptr pmt, cptr str, BIT_FLAGS mode)
 static bool py_pickup_floor_aux(void)
 {
        OBJECT_IDX this_o_idx;
-
-       cptr q, s;
-
+       concptr q, s;
        OBJECT_IDX item;
 
        /* Restrict the choices */
@@ -4820,7 +4806,7 @@ static bool py_pickup_floor_aux(void)
        q = _("どれを拾いますか?", "Get which item? ");
        s = _("もうザックには床にあるどのアイテムも入らない。", "You no longer have any room for the objects on the floor.");
 
-       if (get_item(&item, q, s, (USE_FLOOR)))
+       if (choose_object(&item, q, s, (USE_FLOOR)))
        {
                this_o_idx = 0 - item;
        }
@@ -4846,7 +4832,7 @@ void py_pickup_floor(bool pickup)
 {
        OBJECT_IDX this_o_idx, next_o_idx = 0;
 
-       char o_name[MAX_NLEN];
+       GAME_TEXT o_name[MAX_NLEN];
        object_type *o_ptr;
 
        int floor_num = 0;
@@ -5048,3 +5034,61 @@ void py_pickup_floor(bool pickup)
                }
        }
 }
+
+
+/*!
+ * @brief 矢弾を射撃した場合の破損確率を返す /
+ * Determines the odds of an object breaking when thrown at a monster
+ * @param o_ptr 矢弾のオブジェクト構造体参照ポインタ
+ * @return 破損確率(%)
+ * @details
+ * Note that artifacts never break, see the "drop_near()" function.
+ */
+PERCENTAGE breakage_chance(object_type *o_ptr)
+{
+       PERCENTAGE archer_bonus = (p_ptr->pclass == CLASS_ARCHER ? (PERCENTAGE)(p_ptr->lev - 1) / 7 + 4 : 0);
+
+       /* Examine the snipe type */
+       if (snipe_type)
+       {
+               if (snipe_type == SP_KILL_WALL) return (100);
+               if (snipe_type == SP_EXPLODE) return (100);
+               if (snipe_type == SP_PIERCE) return (100);
+               if (snipe_type == SP_FINAL) return (100);
+               if (snipe_type == SP_NEEDLE) return (100);
+               if (snipe_type == SP_EVILNESS) return (40);
+               if (snipe_type == SP_HOLYNESS) return (40);
+       }
+
+       /* Examine the item type */
+       switch (o_ptr->tval)
+       {
+               /* Always break */
+       case TV_FLASK:
+       case TV_POTION:
+       case TV_BOTTLE:
+       case TV_FOOD:
+       case TV_JUNK:
+               return (100);
+
+               /* Often break */
+       case TV_LITE:
+       case TV_SCROLL:
+       case TV_SKELETON:
+               return (50);
+
+               /* Sometimes break */
+       case TV_WAND:
+       case TV_SPIKE:
+               return (25);
+       case TV_ARROW:
+               return (20 - archer_bonus * 2);
+
+               /* Rarely break */
+       case TV_SHOT:
+       case TV_BOLT:
+               return (10 - archer_bonus);
+       default:
+               return (10);
+       }
+}