#include "cmd-item.h"
#include "cmd-zapwand.h"
#include "cmd-magiceat.h"
+#include "store.h"
#define MIN_STOCK 12
/* Item was worthless, but we bought it */
if ((value <= 0) && (price > value))
{
- /* Comment */
msg_print(comment_7a[randint0(MAX_COMMENT_7A)]);
-
chg_virtue(V_HONOUR, -1);
chg_virtue(V_JUSTICE, -1);
-
sound(SOUND_STORE1);
}
/* Item was cheaper than we thought, and we paid more than necessary */
else if ((value < guess) && (price > value))
{
- /* Comment */
msg_print(comment_7b[randint0(MAX_COMMENT_7B)]);
-
chg_virtue(V_JUSTICE, -1);
- if (one_in_(4))
- chg_virtue(V_HONOUR, -1);
-
+ if (one_in_(4)) chg_virtue(V_HONOUR, -1);
sound(SOUND_STORE2);
}
/* Item was a good bargain, and we got away with it */
else if ((value > guess) && (value < (4 * guess)) && (price < value))
{
- /* Comment */
msg_print(comment_7c[randint0(MAX_COMMENT_7C)]);
-
- if (one_in_(4))
- chg_virtue(V_HONOUR, -1);
- else if (one_in_(4))
- chg_virtue(V_HONOUR, 1);
-
+ if (one_in_(4)) chg_virtue(V_HONOUR, -1);
+ else if (one_in_(4)) chg_virtue(V_HONOUR, 1);
sound(SOUND_STORE3);
}
/* Item was a great bargain, and we got away with it */
else if ((value > guess) && (price < value))
{
- /* Comment */
msg_print(comment_7d[randint0(MAX_COMMENT_7D)]);
-
- if (one_in_(2))
- chg_virtue(V_HONOUR, -1);
- if (one_in_(4))
- chg_virtue(V_HONOUR, 1);
-
- if (10 * price < value)
- chg_virtue(V_SACRIFICE, 1);
-
+ if (one_in_(2)) chg_virtue(V_HONOUR, -1);
+ if (one_in_(4)) chg_virtue(V_HONOUR, 1);
+ if (10 * price < value) chg_virtue(V_SACRIFICE, 1);
sound(SOUND_STORE4);
}
}
/* Combine the items in the home (backwards) */
for (i = st_ptr->stock_num - 1; i > 0; i--)
{
- /* Get the item */
o_ptr = &st_ptr->stock[i];
/* Skip empty items */
{
int max_num;
- /* Get the item */
j_ptr = &st_ptr->stock[j];
/* Skip empty items */
/* Re-order the items in the home (forwards) */
for (i = 0; i < st_ptr->stock_num; i++)
{
- /* Get the item */
o_ptr = &st_ptr->stock[i];
/* Skip empty slots */
/* Take note */
flag = TRUE;
-
- /* Get local object */
j_ptr = &forge;
/* Save a copy of the moving item */
int cnt;
object_type *o_ptr;
- /* Get the item */
o_ptr = &st_ptr->stock[item];
/* Verify the number */
int j;
object_type *o_ptr;
- /* Get the item */
o_ptr = &st_ptr->stock[item];
/* Must exist */
level = rand_range(1, STORE_OBJ_LEVEL);
}
-
- /* Get local object */
q_ptr = &forge;
/* Create a new object of the chosen kind */
char o_name[MAX_NLEN];
char out_val[160];
-
int maxwid = 75;
- /* Get the item */
o_ptr = &st_ptr->stock[pos];
/* Get the "offset" */
/* Leave room for weights, if necessary -DRS- */
if (show_weights) maxwid -= 10;
- /* Describe the object */
object_desc(o_name, o_ptr, 0);
o_name[maxwid] = '\0';
c_put_str(tval_to_attr[o_ptr->tval], o_name, i+6, cur_col);
/* Show weights */
- if (show_weights)
+ if(show_weights)
{
/* Only show the weight of an individual item */
int wgt = o_ptr->weight;
#ifdef JP
- sprintf(out_val, "%3d.%1d kg", lbtokg1(wgt) , lbtokg2(wgt) );
+ sprintf(out_val, "%3d.%1d kg", lbtokg1(wgt) , lbtokg2(wgt));
put_str(out_val, i+6, 67);
#else
(void)sprintf(out_val, "%3d.%d lb", wgt / 10, wgt % 10);
char out_val[160];
char lo, hi;
-#ifdef ALLOW_REPEAT /* TNB */
-
/* Get the item index */
if (repeat_pull(com_val))
{
}
}
-#endif /* ALLOW_REPEAT -- TNB */
-
/* Paranoia */
msg_print(NULL);
/* Cancel */
if (command == ESCAPE) return (FALSE);
-#ifdef ALLOW_REPEAT /* TNB */
-
repeat_push(*com_val);
-#endif /* ALLOW_REPEAT -- TNB */
-
/* Success */
return (TRUE);
}
/* Assume the player wants just one of them */
amt = 1;
-
- /* Get local object */
j_ptr = &forge;
/* Get a copy of the object */
/* Allow user abort */
if (amt <= 0) return;
}
-
- /* Get local object */
j_ptr = &forge;
/* Get desired object */
{
o_ptr->pval -= j_ptr->pval;
}
-
- /* Handle stuff */
handle_stuff();
/* Note how many slots the store used to have */
msg_format("You have %s (%c).",
#endif
o_name, index_to_label(item_new));
-
- /* Handle stuff */
handle_stuff();
/* Take note if we take the last one */
#endif
- /* Nope */
return;
}
/* Allow user abort */
if (amt <= 0) return;
}
-
- /* Get local object */
q_ptr = &forge;
/* Get a copy of the object */
/* Identify it */
identify_item(o_ptr);
-
- /* Get local object */
q_ptr = &forge;
/* Get a copy of the object */
autopick_alter_item(item, FALSE);
inven_item_optimize(item);
-
- /* Handle stuff */
handle_stuff();
/* The store gets that (known) item */
/* Distribute charges of wands/rods */
distribute_charges(o_ptr, q_ptr, amt);
-
- /* Describe */
#ifdef JP
msg_format("%sを置いた。(%c)", o_name, index_to_label(item));
#else
inven_item_increase(item, -amt);
inven_item_describe(item);
inven_item_optimize(item);
-
- /* Handle stuff */
handle_stuff();
/* Let the home carry it */
{
/* Distribute charges of wands/rods */
distribute_charges(o_ptr, q_ptr, amt);
-
- /* Describe */
#ifdef JP
msg_format("%sを置いた。(%c)", o_name, index_to_label(item));
#else
inven_item_increase(item, -amt);
inven_item_describe(item);
inven_item_optimize(item);
-
- /* Handle stuff */
handle_stuff();
/* Let the home carry it */
char o_name[MAX_NLEN];
char out_val[160];
-
/* Empty? */
if (st_ptr->stock_num <= 0)
{
if (cur_store_num == STORE_HOME)
-#ifdef JP
- msg_print("我が家には何も置いてありません。");
-#else
- msg_print("Your home is empty.");
-#endif
-
+ msg_print(_("我が家には何も置いてありません。", "Your home is empty."));
else if (cur_store_num == STORE_MUSEUM)
-#ifdef JP
- msg_print("博物館には何も置いてありません。");
-#else
- msg_print("Museum is empty.");
-#endif
-
+ msg_print(_("博物館には何も置いてありません。", "Museum is empty."));
else
-#ifdef JP
- msg_print("現在商品の在庫を切らしています。");
-#else
- msg_print("I am currently out of stock.");
-#endif
-
+ msg_print(_("現在商品の在庫を切らしています。", "I am currently out of stock."));
return;
}
-
/* Find the number of objects on this and following pages */
i = (st_ptr->stock_num - store_top);
if (i > store_bottom) i = store_bottom;
/* Prompt */
-#ifdef JP
-sprintf(out_val, "どれを調べますか?");
-#else
- sprintf(out_val, "Which item do you want to examine? ");
-#endif
-
+ sprintf(out_val, _("どれを調べますか?", "Which item do you want to examine? "));
/* Get the item number to be examined */
if (!get_stock(&item, out_val, 0, i - 1)) return;
if (!(o_ptr->ident & IDENT_MENTAL))
{
/* This can only happen in the home */
-#ifdef JP
-msg_print("このアイテムについて特に知っていることはない。");
-#else
- msg_print("You have no special knowledge about that item.");
-#endif
-
+ msg_print(_("このアイテムについて特に知っていることはない。", "You have no special knowledge about that item."));
return;
}
- /* Description */
object_desc(o_name, o_ptr, 0);
+ msg_format(_("%sを調べている...", "Examining %s..."), o_name);
- /* Describe */
-#ifdef JP
-msg_format("%sを調べている...", o_name);
-#else
- msg_format("Examining %s...", o_name);
-#endif
-
-
- /* Describe it fully */
if (!screen_object(o_ptr, SCROBJ_FORCE_DETAIL))
-#ifdef JP
-msg_print("特に変わったところはないようだ。");
-#else
- msg_print("You see nothing special.");
-#endif
-
+ msg_print(_("特に変わったところはないようだ。", "You see nothing special."));
return;
}
*/
static void museum_remove_object(void)
{
- int i;
+ int i;
COMMAND_CODE item;
object_type *o_ptr;
- char o_name[MAX_NLEN];
- char out_val[160];
+ char o_name[MAX_NLEN];
+ char out_val[160];
/* Empty? */
if (st_ptr->stock_num <= 0)
{
-#ifdef JP
- msg_print("博物館には何も置いてありません。");
-#else
- msg_print("Museum is empty.");
-#endif
-
+ msg_print(_("博物館には何も置いてありません。", "Museum is empty."));
return;
}
if (i > store_bottom) i = store_bottom;
/* Prompt */
-#ifdef JP
- sprintf(out_val, "どのアイテムの展示をやめさせますか?");
-#else
- sprintf(out_val, "Which item do you want to order to remove? ");
-#endif
+ sprintf(out_val, _("どのアイテムの展示をやめさせますか?", "Which item do you want to order to remove? "));
/* Get the item number to be removed */
if (!get_stock(&item, out_val, 0, i - 1)) return;
/* Get the actual item */
o_ptr = &st_ptr->stock[item];
- /* Description */
object_desc(o_name, o_ptr, 0);
-#ifdef JP
- msg_print("展示をやめさせたアイテムは二度と見ることはできません!");
- if (!get_check(format("本当に%sの展示をやめさせますか?", o_name))) return;
-#else
- msg_print("You cannot see items which is removed from the Museum!");
- if (!get_check(format("Really order to remove %s from the Museum? ", o_name))) return;
-#endif
+ msg_print(_("展示をやめさせたアイテムは二度と見ることはできません!", "You cannot see items which is removed from the Museum!"));
+ if (!get_check(format(_("本当に%sの展示をやめさせますか?", "Really order to remove %s from the Museum? "), o_name))) return;
-#ifdef JP
- msg_format("%sの展示をやめさせた。", o_name);
-#else
- msg_format("You ordered to remove %s.", o_name);
-#endif
+ msg_format(_("%sの展示をやめさせた。", "You ordered to remove %s."), o_name);
/* Remove the items from the home */
store_item_increase(item, -o_ptr->number);
*/
static void store_process_command(void)
{
-#ifdef ALLOW_REPEAT /* TNB */
-
/* Handle repeating the last command */
repeat_check();
-#endif /* ALLOW_REPEAT -- TNB */
-
if (rogue_like_commands && command_cmd == 'l')
{
command_cmd = 'x'; /* hack! */
case '-':
{
if (st_ptr->stock_num <= store_bottom) {
-#ifdef JP
- msg_print("これで全部です。");
-#else
- msg_print("Entire inventory is shown.");
-#endif
+ msg_print(_("これで全部です。", "Entire inventory is shown."));
}
else{
store_top -= store_bottom;
{
if (st_ptr->stock_num <= store_bottom)
{
-#ifdef JP
- msg_print("これで全部です。");
-#else
- msg_print("Entire inventory is shown.");
-#endif
-
+ msg_print(_("これで全部です。", "Entire inventory is shown."));
}
else
{
break;
}
- /* Redraw */
case KTRL('R'):
{
do_cmd_redraw();
break;
}
-
-
/*** Use various objects ***/
/* Browse a book */
}
else
{
-#ifdef JP
- msg_print("そのコマンドは店の中では使えません。");
-#else
- msg_print("That command does not work in stores.");
-#endif
+ msg_print(_("そのコマンドは店の中では使えません。", "That command does not work in stores."));
}
-
break;
}
}
/* Verify a store */
if (!cave_have_flag_grid(c_ptr, FF_STORE))
{
-#ifdef JP
- msg_print("ここには店がありません。");
-#else
- msg_print("You see no store here.");
-#endif
-
+ msg_print(_("ここには店がありません。", "You see no store here."));
return;
}
if ((town[p_ptr->town_num].store[which].store_open >= turn) ||
(ironman_shops))
{
-#ifdef JP
- msg_print("ドアに鍵がかかっている。");
-#else
- msg_print("The doors are locked.");
-#endif
-
+ msg_print(_("ドアに鍵がかかっている。", "The doors are locked."));
p_ptr->town_num = old_town_num;
return;
}
}
#endif
/* Prompt */
-#ifdef JP
- prt("コマンド:", 20 + xtra_stock, 0);
-#else
- prt("You may: ", 20 + xtra_stock, 0);
-#endif
-
+ prt(_("コマンド:", "You may: "), 20 + xtra_stock, 0);
/* Get a command */
request_command(TRUE);
/* Hack -- Character is still in "icky" mode */
character_icky = TRUE;
- /* Notice stuff */
notice_stuff();
-
- /* Handle stuff */
handle_stuff();
/* Pack Overflow */
msg_print("Your pack overflows!");
#endif
-
- /* Get local object */
q_ptr = &forge;
/* Grab a copy of the item */
inven_item_increase(item, -255);
inven_item_describe(item);
inven_item_optimize(item);
-
- /* Handle stuff */
handle_stuff();
/* Let the home carry it */
/* Redraw entire screen */
p_ptr->redraw |= (PR_BASIC | PR_EXTRA | PR_EQUIPPY);
- /* Redraw map */
p_ptr->redraw |= (PR_MAP);
p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
{
object_type *o_ptr;
- /* Get the item */
o_ptr = &st_ptr->stock[i];
if (!object_is_artifact(o_ptr))
o_ptr->ident &= ~(IDENT_FIXED);
/* Mega-Hack -- Note that the item is "on sale" */
-#ifdef JP
- o_ptr->inscription = quark_add("売出中");
-#else
- o_ptr->inscription = quark_add("on sale");
-#endif
+ o_ptr->inscription = quark_add(_("売出中", "on sale"));
}
}
}