OSDN Git Service

[Refactor] #37353 メッセージ整理と型の置換 / Refactor messages and type replacement.
[hengband/hengband.git] / src / object1.c
index aeeee1d..a472034 100644 (file)
@@ -29,9 +29,9 @@
  * flag.  This is useful for switching "graphics" on/off.\n
  *\n
  * The features, objects, and monsters, should all be encoded in the\n
- * relevant "font.pref" and/or "graf.prf" files.  XXX XXX XXX\n
+ * relevant "font.pref" and/or "graf.prf" files.  \n
  *\n
- * The "prefs" parameter is no longer meaningful.  XXX XXX XXX\n
+ * The "prefs" parameter is no longer meaningful.  \n
  */
 void reset_visuals(void)
 {
@@ -498,7 +498,6 @@ cptr item_activation(object_type *o_ptr)
                return _("モンスターを捕える、又は解放する。", "captures or releases a monster.");
        }
 
-       /* Oops */
        return _("何も起きない", "Nothing");
 }
 
@@ -1238,7 +1237,6 @@ bool screen_object(object_type *o_ptr, BIT_FLAGS mode)
        /* Save the screen */
        screen_save();
 
-       /* Get size */
        Term_get_size(&wid, &hgt);
 
        /* Display Item name */
@@ -1663,7 +1661,6 @@ void display_inven(void)
        char            o_name[MAX_NLEN];
        int             wid, hgt;
 
-       /* Get size */
        Term_get_size(&wid, &hgt);
 
        /* Find the "final" slot */
@@ -1759,7 +1756,6 @@ void display_equip(void)
        char            o_name[MAX_NLEN];
        int             wid, hgt;
 
-       /* Get size */
        Term_get_size(&wid, &hgt);
 
        /* Display the equipment */
@@ -2160,7 +2156,6 @@ COMMAND_CODE show_inven(int target_item)
        /* Starting column */
        col = command_gap;
 
-       /* Get size */
        Term_get_size(&wid, &hgt);
 
        /* Default "max-length" */
@@ -2189,7 +2184,6 @@ COMMAND_CODE show_inven(int target_item)
                /* Is this item acceptable? */
                if (!item_tester_okay(o_ptr)) continue;
 
-               /* Describe the object */
                object_desc(o_name, o_ptr, 0);
 
                /* Save the object index, color, and description */
@@ -2233,7 +2227,6 @@ COMMAND_CODE show_inven(int target_item)
                /* Get the index */
                i = out_index[j];
 
-               /* Get the item */
                o_ptr = &inventory[i];
 
                /* Clear the line */
@@ -2327,7 +2320,6 @@ COMMAND_CODE show_equip(int target_item)
        /* Starting column */
        col = command_gap;
 
-       /* Get size */
        Term_get_size(&wid, &hgt);
 
        /* Maximal length */
@@ -2408,7 +2400,6 @@ COMMAND_CODE show_equip(int target_item)
                /* Get the index */
                i = out_index[j];
 
-               /* Get the item */
                o_ptr = &inventory[i];
 
                /* Clear the line */
@@ -2555,8 +2546,6 @@ static bool verify(cptr prompt, INVENTORY_IDX item)
        {
                o_ptr = &o_list[0 - item];
        }
-
-       /* Describe */
        object_desc(o_name, o_ptr, 0);
 
        /* Prompt */
@@ -2577,9 +2566,7 @@ static bool verify(cptr prompt, INVENTORY_IDX item)
 static bool get_item_allow(INVENTORY_IDX item)
 {
        cptr s;
-
        object_type *o_ptr;
-
        if (!command_cmd) return TRUE; /* command_cmd is no longer effective */
 
        /* Inventory */
@@ -2750,26 +2737,16 @@ bool get_item(OBJECT_IDX *cp, cptr pmt, cptr str, BIT_FLAGS mode)
        int max_inven = 0;
        int max_equip = 0;
 
-#ifdef ALLOW_REPEAT
-
        static char prev_tag = '\0';
        char cur_tag = '\0';
 
-#endif /* ALLOW_REPEAT */
-
-#ifdef ALLOW_EASY_FLOOR /* TNB */
-
        if (easy_floor || use_menu) return get_item_floor(cp, pmt, str, mode);
 
-#endif /* ALLOW_EASY_FLOOR -- TNB */
-
        /* Extract args */
        if (mode & USE_EQUIP) equip = TRUE;
        if (mode & USE_INVEN) inven = TRUE;
        if (mode & USE_FLOOR) floor = TRUE;
 
-#ifdef ALLOW_REPEAT
-
        /* Get the item index */
        if (repeat_pull(cp))
        {
@@ -2789,8 +2766,6 @@ bool get_item(OBJECT_IDX *cp, cptr pmt, cptr str, BIT_FLAGS mode)
 
                        /* Special index */
                        k = 0 - (*cp);
-
-                       /* Acquire object */
                        o_ptr = &o_list[k];
 
                        /* Validate the item */
@@ -2846,10 +2821,8 @@ bool get_item(OBJECT_IDX *cp, cptr pmt, cptr str, BIT_FLAGS mode)
                }
        }
 
-#endif /* ALLOW_REPEAT */
-
 
-       /* Paranoia XXX XXX XXX */
+       /* Paranoia */
        msg_print(NULL);
 
 
@@ -2911,8 +2884,6 @@ bool get_item(OBJECT_IDX *cp, cptr pmt, cptr str, BIT_FLAGS mode)
                for (this_o_idx = cave[p_ptr->y][p_ptr->x].o_idx; this_o_idx; this_o_idx = next_o_idx)
                {
                        object_type *o_ptr;
-
-                       /* Acquire object */
                        o_ptr = &o_list[this_o_idx];
 
                        /* Acquire next object */
@@ -2929,7 +2900,6 @@ bool get_item(OBJECT_IDX *cp, cptr pmt, cptr str, BIT_FLAGS mode)
                /* Cancel p_ptr->command_see */
                command_see = FALSE;
 
-               /* Oops */
                oops = TRUE;
 
                done = TRUE;
@@ -2977,7 +2947,6 @@ bool get_item(OBJECT_IDX *cp, cptr pmt, cptr str, BIT_FLAGS mode)
        /* Hack -- start out in "display" mode */
        if (command_see)
        {
-               /* Save screen */
                screen_save();
        }
 
@@ -3155,10 +3124,7 @@ bool get_item(OBJECT_IDX *cp, cptr pmt, cptr str, BIT_FLAGS mode)
                                /* Hack -- Fix screen */
                                if (command_see)
                                {
-                                       /* Load screen */
                                        screen_load();
-
-                                       /* Save screen */
                                        screen_save();
                                }
 
@@ -3237,15 +3203,12 @@ bool get_item(OBJECT_IDX *cp, cptr pmt, cptr str, BIT_FLAGS mode)
                                {
                                        /* Flip flag */
                                        command_see = FALSE;
-
-                                       /* Load screen */
                                        screen_load();
                                }
 
                                /* Show the list */
                                else
                                {
-                                       /* Save screen */
                                        screen_save();
 
                                        /* Flip flag */
@@ -3266,10 +3229,7 @@ bool get_item(OBJECT_IDX *cp, cptr pmt, cptr str, BIT_FLAGS mode)
                                /* Hack -- Fix screen */
                                if (command_see)
                                {
-                                       /* Load screen */
                                        screen_load();
-
-                                       /* Save screen */
                                        screen_save();
                                }
 
@@ -3289,8 +3249,6 @@ bool get_item(OBJECT_IDX *cp, cptr pmt, cptr str, BIT_FLAGS mode)
                                        for (this_o_idx = cave[p_ptr->y][p_ptr->x].o_idx; this_o_idx; this_o_idx = next_o_idx)
                                        {
                                                object_type *o_ptr;
-
-                                               /* Acquire object */
                                                o_ptr = &o_list[this_o_idx];
 
                                                /* Acquire next object */
@@ -3319,7 +3277,6 @@ bool get_item(OBJECT_IDX *cp, cptr pmt, cptr str, BIT_FLAGS mode)
                                        if (done) break;
                                }
 
-                               /* Oops */
                                bell();
                                break;
                        }
@@ -3361,9 +3318,7 @@ bool get_item(OBJECT_IDX *cp, cptr pmt, cptr str, BIT_FLAGS mode)
                                (*cp) = k;
                                item = TRUE;
                                done = TRUE;
-#ifdef ALLOW_REPEAT
                                cur_tag = which;
-#endif /* ALLOW_REPEAT */
                                break;
                        }
 
@@ -3446,9 +3401,7 @@ bool get_item(OBJECT_IDX *cp, cptr pmt, cptr str, BIT_FLAGS mode)
                                        (*cp) = k;
                                        item = TRUE;
                                        done = TRUE;
-#ifdef ALLOW_REPEAT
                                        cur_tag = which;
-#endif /* ALLOW_REPEAT */
                                        break;
                                }
 
@@ -3507,7 +3460,6 @@ bool get_item(OBJECT_IDX *cp, cptr pmt, cptr str, BIT_FLAGS mode)
        /* Fix the screen if necessary */
        if (command_see)
        {
-               /* Load screen */
                screen_load();
 
                /* Hack -- Cancel "display" */
@@ -3542,21 +3494,13 @@ bool get_item(OBJECT_IDX *cp, cptr pmt, cptr str, BIT_FLAGS mode)
 
        if (item)
        {
-#ifdef ALLOW_REPEAT
                repeat_push(*cp);
                if (command_cmd) prev_tag = cur_tag;
-#endif /* ALLOW_REPEAT */
-
                command_cmd = 0; /* Hack -- command_cmd is no longer effective */
        }
-
-       /* Result */
        return (item);
 }
 
-
-#ifdef ALLOW_EASY_FLOOR
-
 /*!
  * @brief 床下に落ちているオブジェクトの数を返す / scan_floor
  * @param items オブジェクトのIDリストを返すための配列参照ポインタ
@@ -3585,8 +3529,6 @@ ITEM_NUMBER scan_floor(OBJECT_IDX *items, POSITION y, POSITION x, BIT_FLAGS mode
        for (this_o_idx = cave[y][x].o_idx; this_o_idx; this_o_idx = next_o_idx)
        {
                object_type *o_ptr;
-
-               /* Acquire object */
                o_ptr = &o_list[this_o_idx];
 
                /* Acquire next object */
@@ -3608,8 +3550,6 @@ ITEM_NUMBER scan_floor(OBJECT_IDX *items, POSITION y, POSITION x, BIT_FLAGS mode
                /* Only one */
                if (mode & 0x04) break;
        }
-
-       /* Result */
        return num;
 }
 
@@ -3646,13 +3586,11 @@ COMMAND_CODE show_floor(int target_item, POSITION y, POSITION x, TERM_LEN *min_w
 
        bool dont_need_to_show_weights = TRUE;
 
-       /* Get size */
        Term_get_size(&wid, &hgt);
 
        /* Default length */
        len = MAX((*min_width), 20);
 
-
        /* Scan for objects in the grid, using item_tester_okay() */
        floor_num = scan_floor(floor_list, y, x, 0x03);
 
@@ -3661,7 +3599,6 @@ COMMAND_CODE show_floor(int target_item, POSITION y, POSITION x, TERM_LEN *min_w
        {
                o_ptr = &o_list[floor_list[i]];
 
-               /* Describe the object */
                object_desc(o_name, o_ptr, 0);
 
                /* Save the index */
@@ -3704,7 +3641,6 @@ COMMAND_CODE show_floor(int target_item, POSITION y, POSITION x, TERM_LEN *min_w
                /* Get the index */
                m = floor_list[out_index[j]];
 
-               /* Get the item */
                o_ptr = &o_list[m];
 
                /* Clear the line */
@@ -3798,8 +3734,6 @@ bool get_item_floor(COMMAND_CODE *cp, cptr pmt, cptr str, BIT_FLAGS mode)
        int max_inven = 0;
        int max_equip = 0;
 
-#ifdef ALLOW_REPEAT
-
        static char prev_tag = '\0';
        char cur_tag = '\0';
 
@@ -3894,10 +3828,8 @@ bool get_item_floor(COMMAND_CODE *cp, cptr pmt, cptr str, BIT_FLAGS mode)
                }
        }
 
-#endif /* ALLOW_REPEAT */
 
-
-       /* Paranoia XXX XXX XXX */
+       /* Paranoia */
        msg_print(NULL);
 
 
@@ -3977,7 +3909,6 @@ bool get_item_floor(COMMAND_CODE *cp, cptr pmt, cptr str, BIT_FLAGS mode)
                /* Cancel p_ptr->command_see */
                command_see = FALSE;
 
-               /* Oops */
                oops = TRUE;
 
                done = TRUE;
@@ -4025,7 +3956,6 @@ bool get_item_floor(COMMAND_CODE *cp, cptr pmt, cptr str, BIT_FLAGS mode)
        /* Hack -- start out in "display" mode */
        if (command_see)
        {
-               /* Save screen */
                screen_save();
        }
 
@@ -4126,41 +4056,23 @@ bool get_item_floor(COMMAND_CODE *cp, cptr pmt, cptr str, BIT_FLAGS mode)
                        /* Append */
                        if (allow_equip)
                        {
-#ifdef JP
                                if (!use_menu)
-                                       strcat(out_val, " '/' 装備品,");
+                                       strcat(out_val, _(" '/' 装備品,", " / for Equip,"));
                                else if (allow_floor)
-                                       strcat(out_val, " '6' 装備品,");
+                                       strcat(out_val, _(" '6' 装備品,", " 6 for Equip,"));
                                else
-                                       strcat(out_val, " '4'or'6' 装備品,");
-#else
-                               if (!use_menu)
-                                       strcat(out_val, " / for Equip,");
-                               else if (allow_floor)
-                                       strcat(out_val, " 6 for Equip,");
-                               else
-                                       strcat(out_val, " 4 or 6 for Equip,");
-#endif
+                                       strcat(out_val, _(" '4'or'6' 装備品,", " 4 or 6 for Equip,"));
                        }
 
                        /* Append */
                        if (allow_floor)
                        {
-#ifdef JP
-                               if (!use_menu)
-                                       strcat(out_val, " '-'床上,");
-                               else if (allow_equip)
-                                       strcat(out_val, " '4' 床上,");
-                               else
-                                       strcat(out_val, " '4'or'6' 床上,");
-#else
                                if (!use_menu)
-                                       strcat(out_val, " - for floor,");
+                                       strcat(out_val, _(" '-'床上,", " - for floor,"));
                                else if (allow_equip)
-                                       strcat(out_val, " 4 for floor,");
+                                       strcat(out_val, _(" '4' 床上,", " 4 for floor,"));
                                else
-                                       strcat(out_val, " 4 or 6 for floor,");
-#endif
+                                       strcat(out_val, _(" '4'or'6' 床上,", " 4 or 6 for floor,"));
                        }
                }
 
@@ -4186,41 +4098,23 @@ bool get_item_floor(COMMAND_CODE *cp, cptr pmt, cptr str, BIT_FLAGS mode)
                        /* Append */
                        if (allow_inven)
                        {
-#ifdef JP
                                if (!use_menu)
-                                       strcat(out_val, " '/' 持ち物,");
+                                       strcat(out_val, _(" '/' 持ち物,", " / for Inven,"));
                                else if (allow_floor)
-                                       strcat(out_val, " '4' 持ち物,");
+                                       strcat(out_val, _(" '4' 持ち物,", " 4 for Inven,"));
                                else
-                                       strcat(out_val, " '4'or'6' 持ち物,");
-#else
-                               if (!use_menu)
-                                       strcat(out_val, " / for Inven,");
-                               else if (allow_floor)
-                                       strcat(out_val, " 4 for Inven,");
-                               else
-                                       strcat(out_val, " 4 or 6 for Inven,");
-#endif
+                                       strcat(out_val, _(" '4'or'6' 持ち物,", " 4 or 6 for Inven,"));
                        }
 
                        /* Append */
                        if (allow_floor)
                        {
-#ifdef JP
                                if (!use_menu)
-                                       strcat(out_val, " '-'床上,");
+                                       strcat(out_val, _(" '-'床上,", " - for floor,"));
                                else if (allow_inven)
-                                       strcat(out_val, " '6' 床上,");
+                                       strcat(out_val, _(" '6' 床上,", " 6 for floor,"));
                                else
-                                       strcat(out_val, " '4'or'6' 床上,");
-#else
-                               if (!use_menu)
-                                       strcat(out_val, " - for floor,");
-                               else if (allow_inven)
-                                       strcat(out_val, " 6 for floor,");
-                               else
-                                       strcat(out_val, " 4 or 6 for floor,");
-#endif
+                                       strcat(out_val, _(" '4'or'6' 床上,", " 4 or 6 for floor,"));
                        }
                }
 
@@ -4366,10 +4260,7 @@ bool get_item_floor(COMMAND_CODE *cp, cptr pmt, cptr str, BIT_FLAGS mode)
                                /* Hack -- Fix screen */
                                if (command_see)
                                {
-                                       /* Load screen */
                                        screen_load();
-
-                                       /* Save screen */
                                        screen_save();
                                }
 
@@ -4427,10 +4318,7 @@ bool get_item_floor(COMMAND_CODE *cp, cptr pmt, cptr str, BIT_FLAGS mode)
                                /* Hack -- Fix screen */
                                if (command_see)
                                {
-                                       /* Load screen */
                                        screen_load();
-
-                                       /* Save screen */
                                        screen_save();
                                }
 
@@ -4510,15 +4398,12 @@ bool get_item_floor(COMMAND_CODE *cp, cptr pmt, cptr str, BIT_FLAGS mode)
                                {
                                        /* Flip flag */
                                        command_see = FALSE;
-
-                                       /* Load screen */
                                        screen_load();
                                }
 
                                /* Show the list */
                                else
                                {
-                                       /* Save screen */
                                        screen_save();
 
                                        /* Flip flag */
@@ -4560,10 +4445,7 @@ bool get_item_floor(COMMAND_CODE *cp, cptr pmt, cptr str, BIT_FLAGS mode)
                                /* Hack -- Fix screen */
                                if (command_see)
                                {
-                                       /* Load screen */
                                        screen_load();
-
-                                       /* Save screen */
                                        screen_save();
                                }
 
@@ -4610,10 +4492,7 @@ bool get_item_floor(COMMAND_CODE *cp, cptr pmt, cptr str, BIT_FLAGS mode)
                                /* Hack -- Fix screen */
                                if (command_see)
                                {
-                                       /* Load screen */
                                        screen_load();
-
-                                       /* Save screen */
                                        screen_save();
                                }
 
@@ -4662,10 +4541,7 @@ bool get_item_floor(COMMAND_CODE *cp, cptr pmt, cptr str, BIT_FLAGS mode)
                                /* Hack -- Fix screen */
                                if (command_see)
                                {
-                                       /* Load screen */
                                        screen_load();
-
-                                       /* Save screen */
                                        screen_save();
                                }
 
@@ -4728,9 +4604,7 @@ bool get_item_floor(COMMAND_CODE *cp, cptr pmt, cptr str, BIT_FLAGS mode)
                                (*cp) = k;
                                item = TRUE;
                                done = TRUE;
-#ifdef ALLOW_REPEAT
                                cur_tag = which;
-#endif /* ALLOW_REPEAT */
                                break;
                        }
 
@@ -4839,9 +4713,7 @@ bool get_item_floor(COMMAND_CODE *cp, cptr pmt, cptr str, BIT_FLAGS mode)
                                                (*cp) = k;
                                                item = TRUE;
                                                done = TRUE;
-#ifdef ALLOW_REPEAT
                                                cur_tag = which;
-#endif /* ALLOW_REPEAT */
                                                break;
                                        }
                                }
@@ -4857,9 +4729,7 @@ bool get_item_floor(COMMAND_CODE *cp, cptr pmt, cptr str, BIT_FLAGS mode)
                                                (*cp) = k;
                                                item = TRUE;
                                                done = TRUE;
-#ifdef ALLOW_REPEAT
                                                cur_tag = which;
-#endif /* ALLOW_REPEAT */
                                                break;
                                        }
                                }
@@ -4934,7 +4804,6 @@ bool get_item_floor(COMMAND_CODE *cp, cptr pmt, cptr str, BIT_FLAGS mode)
        /* Fix the screen if necessary */
        if (command_see)
        {
-               /* Load screen */
                screen_load();
 
                /* Hack -- Cancel "display" */
@@ -4967,15 +4836,10 @@ bool get_item_floor(COMMAND_CODE *cp, cptr pmt, cptr str, BIT_FLAGS mode)
 
        if (item)
        {
-#ifdef ALLOW_REPEAT
                repeat_push(*cp);
                if (command_cmd) prev_tag = cur_tag;
-#endif /* ALLOW_REPEAT */
-
                command_cmd = 0; /* Hack -- command_cmd is no longer effective */
        }
-
-       /* Result */
        return (item);
 }
 
@@ -5038,14 +4902,13 @@ void py_pickup_floor(bool pickup)
                /* Access the object */
                o_ptr = &o_list[this_o_idx];
 
-               /* Describe the object */
                object_desc(o_name, o_ptr, 0);
 
                /* Access the next object */
                next_o_idx = o_ptr->next_o_idx;
 
                /* Hack -- disturb */
-               disturb(0, 0);
+               disturb(FALSE, FALSE);
 
                /* Pick up gold */
                if (o_ptr->tval == TV_GOLD)
@@ -5117,7 +4980,6 @@ void py_pickup_floor(bool pickup)
 
 #endif /* ALLOW_EASY_SENSE */
 
-                       /* Describe the object */
                        object_desc(o_name, o_ptr, 0);
 
                        msg_format(_("%sがある。", "You see %s."), o_name);
@@ -5152,7 +5014,6 @@ void py_pickup_floor(bool pickup)
 
 #endif /* ALLOW_EASY_SENSE */
 
-                       /* Describe the object */
                        object_desc(o_name, o_ptr, 0);
 
                        msg_format(_("ザックには%sを入れる隙間がない。", "You have no room for %s."), o_name);
@@ -5190,7 +5051,6 @@ void py_pickup_floor(bool pickup)
 
 #endif /* ALLOW_EASY_SENSE */
 
-                       /* Describe the object */
                        object_desc(o_name, o_ptr, 0);
 
                        /* Build a prompt */
@@ -5230,5 +5090,3 @@ void py_pickup_floor(bool pickup)
                }
        }
 }
-
-#endif /* ALLOW_EASY_FLOOR */