OSDN Git Service

[Refactor] #37353 型の置換。 / Type replacement.
[hengband/hengband.git] / src / object1.c
index 75b6ec9..a472034 100644 (file)
@@ -1237,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 */
@@ -1662,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 */
@@ -1758,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 */
@@ -2159,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" */
@@ -2188,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 */
@@ -2232,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 */
@@ -2326,7 +2320,6 @@ COMMAND_CODE show_equip(int target_item)
        /* Starting column */
        col = command_gap;
 
-       /* Get size */
        Term_get_size(&wid, &hgt);
 
        /* Maximal length */
@@ -2407,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 */
@@ -2554,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 */
@@ -2576,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 */
@@ -2752,12 +2740,8 @@ bool get_item(OBJECT_IDX *cp, cptr pmt, cptr str, BIT_FLAGS mode)
        static char prev_tag = '\0';
        char cur_tag = '\0';
 
-#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;
@@ -2782,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 */
@@ -2902,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 */
@@ -2967,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();
        }
 
@@ -3145,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();
                                }
 
@@ -3227,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 */
@@ -3256,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();
                                }
 
@@ -3279,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 */
@@ -3492,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" */
@@ -3531,14 +3498,9 @@ bool get_item(OBJECT_IDX *cp, cptr pmt, cptr str, BIT_FLAGS mode)
                if (command_cmd) prev_tag = cur_tag;
                command_cmd = 0; /* Hack -- command_cmd is no longer effective */
        }
-
-       /* Result */
        return (item);
 }
 
-
-#ifdef ALLOW_EASY_FLOOR
-
 /*!
  * @brief 床下に落ちているオブジェクトの数を返す / scan_floor
  * @param items オブジェクトのIDリストを返すための配列参照ポインタ
@@ -3567,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 */
@@ -3590,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;
 }
 
@@ -3628,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);
 
@@ -3643,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 */
@@ -3686,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 */
@@ -4002,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();
        }
 
@@ -4103,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, " '-'床上,");
+                                       strcat(out_val, _(" '-'床上,", " - for floor,"));
                                else if (allow_equip)
-                                       strcat(out_val, " '4' 床上,");
+                                       strcat(out_val, _(" '4' 床上,", " 4 for floor,"));
                                else
-                                       strcat(out_val, " '4'or'6' 床上,");
-#else
-                               if (!use_menu)
-                                       strcat(out_val, " - for floor,");
-                               else if (allow_equip)
-                                       strcat(out_val, " 4 for floor,");
-                               else
-                                       strcat(out_val, " 4 or 6 for floor,");
-#endif
+                                       strcat(out_val, _(" '4'or'6' 床上,", " 4 or 6 for floor,"));
                        }
                }
 
@@ -4163,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,"));
                        }
                }
 
@@ -4343,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();
                                }
 
@@ -4404,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();
                                }
 
@@ -4487,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 */
@@ -4537,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();
                                }
 
@@ -4587,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();
                                }
 
@@ -4639,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();
                                }
 
@@ -4905,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" */
@@ -4942,8 +4840,6 @@ bool get_item_floor(COMMAND_CODE *cp, cptr pmt, cptr str, BIT_FLAGS mode)
                if (command_cmd) prev_tag = cur_tag;
                command_cmd = 0; /* Hack -- command_cmd is no longer effective */
        }
-
-       /* Result */
        return (item);
 }
 
@@ -5006,7 +4902,6 @@ 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 */
@@ -5085,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);
@@ -5120,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);
@@ -5158,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 */
@@ -5198,5 +5090,3 @@ void py_pickup_floor(bool pickup)
                }
        }
 }
-
-#endif /* ALLOW_EASY_FLOOR */