X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=src%2Fobject1.c;h=a47203418db67c47b4226f6e7c67e5b6c478f53e;hb=0929156d1bd378ba13365d0bf5a3224153ae32c6;hp=6c5e085abcaab5c5fd02f464b03268ad0da2499d;hpb=9194abf87f10509314cbe620b909e3445c27f099;p=hengband%2Fhengband.git diff --git a/src/object1.c b/src/object1.c index 6c5e085ab..a47203418 100644 --- a/src/object1.c +++ b/src/object1.c @@ -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 */ @@ -2514,7 +2505,6 @@ void toggle_inven_equip(void) window_flag[j] &= ~(PW_INVEN); window_flag[j] |= (PW_EQUIP); - /* Window stuff */ p_ptr->window |= (PW_EQUIP); } @@ -2525,7 +2515,6 @@ void toggle_inven_equip(void) window_flag[j] &= ~(PW_EQUIP); window_flag[j] |= (PW_INVEN); - /* Window stuff */ p_ptr->window |= (PW_INVEN); } } @@ -2557,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 */ @@ -2579,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,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)) { @@ -2791,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 */ @@ -2848,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); @@ -2913,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 */ @@ -2931,10 +2900,8 @@ 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 */ done = TRUE; if (select_the_force) { @@ -2980,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(); } @@ -3158,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(); } @@ -3240,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 */ @@ -3269,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(); } @@ -3292,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 */ @@ -3322,7 +3277,6 @@ bool get_item(OBJECT_IDX *cp, cptr pmt, cptr str, BIT_FLAGS mode) if (done) break; } - /* Oops */ bell(); break; } @@ -3364,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; } @@ -3449,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; } @@ -3510,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" */ @@ -3534,7 +3483,6 @@ bool get_item(OBJECT_IDX *cp, cptr pmt, cptr str, BIT_FLAGS mode) /* Update */ p_ptr->window |= (PW_INVEN | PW_EQUIP); - /* Window stuff */ window_stuff(); @@ -3546,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リストを返すための配列参照ポインタ @@ -3589,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 */ @@ -3612,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; } @@ -3650,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); @@ -3665,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 */ @@ -3708,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 */ @@ -3802,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'; @@ -3898,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); @@ -3981,10 +3909,8 @@ 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 */ done = TRUE; if (select_the_force) { @@ -4030,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(); } @@ -4131,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,")); } } @@ -4191,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,")); } } @@ -4371,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(); } @@ -4432,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(); } @@ -4515,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 */ @@ -4565,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(); } @@ -4615,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(); } @@ -4667,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(); } @@ -4733,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; } @@ -4844,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; } } @@ -4862,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; } } @@ -4939,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" */ @@ -4961,7 +4825,6 @@ bool get_item_floor(COMMAND_CODE *cp, cptr pmt, cptr str, BIT_FLAGS mode) /* Update */ p_ptr->window |= (PW_INVEN | PW_EQUIP); - /* Window stuff */ window_stuff(); @@ -4973,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); } @@ -5044,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) @@ -5070,7 +4927,6 @@ void py_pickup_floor(bool pickup) /* Redraw gold */ p_ptr->redraw |= (PR_GOLD); - /* Window stuff */ p_ptr->window |= (PW_PLAYER); /* Delete the gold */ @@ -5124,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); @@ -5136,7 +4991,6 @@ void py_pickup_floor(bool pickup) msg_format(_("%d 個のアイテムの山がある。", "You see a pile of %d items."), floor_num); } - /* Done */ return; } @@ -5160,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); @@ -5173,7 +5026,6 @@ void py_pickup_floor(bool pickup) } - /* Done */ return; } @@ -5199,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 */ @@ -5208,7 +5059,6 @@ void py_pickup_floor(bool pickup) /* Ask the user to confirm */ if (!get_check(out_val)) { - /* Done */ return; } } @@ -5240,5 +5090,3 @@ void py_pickup_floor(bool pickup) } } } - -#endif /* ALLOW_EASY_FLOOR */