X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=src%2Fstore.c;h=c5e93a47b513df9b58c5e89aec4b9a9cca8f7414;hb=5d3509382b96bb3cecc04023caa87c22da6f5943;hp=1ae4132c56e86f1c41922a4b07b524680302d0ea;hpb=56ae7e32ecb8ac689b1e29a6069012c3fc10ff21;p=hengband%2Fhengband.git diff --git a/src/store.c b/src/store.c index 1ae4132c5..c5e93a47b 100644 --- a/src/store.c +++ b/src/store.c @@ -1,25 +1,28 @@ -/* File: store.c */ - -/* - * Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke - * - * This software may be copied and distributed for educational, research, - * and not for profit purposes provided that this copyright and statement - * are included in all such copies. Other copyrights may also apply. +/*! + * @file store.c + * @brief åºã®å¦ç / Store commands + * @date 2014/02/02 + * @author + * Copyright (c) 1989 James E. Wilson, Robert A. Koeneke\n + * This software may be copied and distributed for educational, research, and\n + * not for profit purposes provided that this copyright and statement are\n + * included in all such copies.\n + * 2014 Deskull rearranged comment for Doxygen. */ -/* Purpose: Store commands */ - #include "angband.h" +#include "cmd-item.h" +#include "cmd-zapwand.h" +#include "cmd-magiceat.h" +#define MIN_STOCK 12 -#ifdef JP -/* ²¼¤ÎÊý¤«¤é°ÜÆ°¤·¤Æ¤¤Þ¤·¤¿ */ static int cur_store_num = 0; static int store_top = 0; +static int store_bottom = 0; +static int xtra_stock = 0; static store_type *st_ptr = NULL; -static owner_type *ot_ptr = NULL; -#endif +static const owner_type *ot_ptr = NULL; static s16b old_town_num = 0; static s16b inner_town_num = 0; #define RUMOR_CHANCE 8 @@ -29,12 +32,12 @@ static s16b inner_town_num = 0; static cptr comment_1[MAX_COMMENT_1] = { #ifdef JP - "¥ª¡¼¥±¡¼¤À¡£", - "·ë¹½¤À¡£", - "¤½¤¦¤·¤è¤¦¡ª", - "»¿À®¤À¡ª", - "¤è¤·¡ª", - "¤ï¤«¤Ã¤¿¡ª" + "ãªã¼ã±ã¼ã ã", + "çµæ§ã ã", + "ãããããï¼", + "è³æã ï¼", + "ããï¼", + "ããã£ãï¼" #else "Okay.", "Fine.", @@ -47,14 +50,14 @@ static cptr comment_1[MAX_COMMENT_1] = }; #ifdef JP -/* ¥Ö¥é¥Ã¥¯¥Þ¡¼¥±¥Ã¥ÈÄɲåá¥Ã¥»¡¼¥¸¡Ê¾µÂú¡Ë */ +/*! ãã©ãã¯ãã¼ã±ãã追å ã¡ãã»ã¼ã¸ï¼æ¿è«¾ï¼ */ static cptr comment_1_B[MAX_COMMENT_1] = { - "¤Þ¤¢¡¢¤½¤ì¤Ç¤¤¤¤¤ä¡£", - "º£Æü¤Ï¤½¤ì¤Ç´ªÊÛ¤·¤Æ¤ä¤ë¡£", - "ʬ¤«¤Ã¤¿¤è¡£", - "¤·¤ç¤¦¤¬¤Ê¤¤¡£", - "¤½¤ì¤Ç²æËý¤¹¤ë¤è¡£", - "¤³¤ó¤Ê¤â¤ó¤À¤í¤¦¡£" + "ã¾ããããã§ãããã", + "ä»æ¥ã¯ããã§åå¼ãã¦ããã", + "åãã£ããã", + "ãããããªãã", + "ããã§ææ ¢ãããã", + "ãããªããã ããã" }; #endif #define MAX_COMMENT_2A 2 @@ -62,8 +65,8 @@ static cptr comment_1_B[MAX_COMMENT_1] = { static cptr comment_2a[MAX_COMMENT_2A] = { #ifdef JP - "»ä¤ÎǦÂÑÎϤò»î¤·¤Æ¤¤¤ë¤Î¤«¤¤¡© $%s ¤¬ºÇ¸å¤À¡£", - "²æËý¤Ë¤â¸ÂÅÙ¤¬¤¢¤ë¤¾¡£ $%s ¤¬ºÇ¸å¤À¡£" + "ç§ã®å¿èåã試ãã¦ããã®ããï¼ $%s ãæå¾ã ã", + "ææ ¢ã«ãé度ããããã $%s ãæå¾ã ã" #else "You try my patience. %s is final.", "My patience grows thin. %s is final." @@ -76,18 +79,18 @@ static cptr comment_2a[MAX_COMMENT_2A] = static cptr comment_2b[MAX_COMMENT_2B] = { #ifdef JP - " $%s ¤°¤é¤¤¤Ï½Ð¤µ¤Ê¤¤ã¥À¥á¤À¤è¡£", - " $%s ¤Ê¤é¼õ¤±¼è¤Ã¤Æ¤â¤¤¤¤¤¬¡£", - "¥Ï¡ª $%s °Ê²¼¤Ï¤Ê¤¤¤Í¡£", - "²¿¤ÆÅÛ¤À¡ª $%s °Ê²¼¤Ï¤¢¤êÆÀ¤Ê¤¤¤¾¡£", - "¤½¤ì¤¸¤ã¾¯¤Ê¤¹¤®¤ë¡ª $%s ¤ÏÍߤ·¤¤¤È¤³¤í¤À¡£", - "¥Ð¥«¤Ë¤·¤Æ¤¤¤ë¡ª $%s ¤Ï¤â¤é¤ï¤Ê¤¤¤È¡£", - "±³¤À¤í¤¦¡ª $%s ¤Ç¤É¤¦¤À¤¤¡©", - "¤ª¤¤¤ª¤¤¡ª $%s ¤ò¹Í¤¨¤Æ¤¯¤ì¤Ê¤¤¤«¡©", - "1000ɤ¤Î¥ª¡¼¥¯¤Î¥Î¥ß¤Ë¶ì¤·¤á¤é¤ì¤ë¤¬¤¤¤¤¡ª $%s ¤À¡£", - "¤ªÁ°¤ÎÂçÀڤʤâ¤Î¤ËºÒ¤¤¤¢¤ì¡ª $%s ¤Ç¤É¤¦¤À¡£", - "¥â¥ë¥´¥¹¤Ë¾ÞÌ£¤µ¤ì¤ë¤¬¤¤¤¤¡ªËÜÅö¤Ï $%s ¤Ê¤ó¤À¤í¤¦¡©", - "¤ªÁ°¤ÎÊì¿Æ¤Ï¥ª¡¼¥¬¤«¡ª $%s ¤Ï½Ð¤¹¤Ä¤â¤ê¤Ê¤ó¤À¤í¡©" + " $%s ãããã¯åºããªãããã¡ã ãã", + " $%s ãªãåãåã£ã¦ããããã", + "ãï¼ $%s 以ä¸ã¯ãªããã", + "ä½ã¦å¥´ã ï¼ $%s 以ä¸ã¯ããå¾ãªããã", + "ããããå°ãªãããï¼ $%s ã¯æ¬²ããã¨ããã ã", + "ãã«ã«ãã¦ããï¼ $%s ã¯ããããªãã¨ã", + "åã ããï¼ $%s ã§ã©ãã ãï¼", + "ããããï¼ $%s ãèãã¦ãããªããï¼", + "1000å¹ã®ãªã¼ã¯ã®ããã«è¦ããããããããï¼ $%s ã ã", + "ãåã®å¤§åãªãã®ã«ç½ãããï¼ $%s ã§ã©ãã ã", + "ã¢ã«ã´ã¹ã«è³å³ããããããï¼æ¬å½ã¯ $%s ãªãã ããï¼", + "ãåã®æ¯è¦ªã¯ãªã¼ã¬ãï¼ $%s ã¯åºãã¤ãããªãã ãï¼" #else "I can take no less than %s gold pieces.", "I will accept no less than %s gold pieces.", @@ -106,20 +109,20 @@ static cptr comment_2b[MAX_COMMENT_2B] = }; #ifdef JP -/* ¥Ö¥é¥Ã¥¯¥Þ¡¼¥±¥Ã¥ÈÍÑÄɲåá¥Ã¥»¡¼¥¸¡ÊÇä¤ë¤È¤¡Ë */ +/*! ãã©ãã¯ãã¼ã±ããç¨è¿½å ã¡ãã»ã¼ã¸ï¼å£²ãã¨ãï¼ */ static cptr comment_2b_B[MAX_COMMENT_2B] = { - "¤¤¤¯¤é²¶Íͤ¬¤ª¿Í¹¥¤·¤È¤Ï¤¤¤¨ $%s ¤¬¸Â³¦¤À¤Í¡£·ù¤Ê¤éµ¢¤ê¤Ê¡£", - "¶â¤¬¤Ê¤¤¤Î¤«¤¤¡¢¤¢¤ó¤¿¡©¤Þ¤º¤Ï²È¤Ëµ¢¤Ã¤Æ $%s ·¤¨¤Æ¤¤Ê¡£", - "ʪ¤Î²ÁÃͤ¬Ê¬¤«¤é¤óÅÛ¤À¤Ê¡£¤³¤ì¤Ï $%s ¤¬ÉáÄ̤ʤó¤À¤è¡£", - "²¶¤ÎÉÕ¤±¤¿ÃÍÃʤËʸ¶ç¤¬¤¢¤ë¤Î¤«¡© $%s ¤¬¸Â³¦¤À¡£", - "¤Ò¤ç¤Ã¤È¤·¤Æ¿·¼ê¤Î¾éÃ̤«¤¤¡© $%s »ý¤Ã¤Æ¤Ê¤¤¤Ê¤éµ¢¤ê¤Ê¡£", - "¤¦¤Á¤Ï¾¤ÎŹ¤È¤Ï°ã¤¦¤ó¤À¤è¡£$%s ¤°¤é¤¤¤Ï½Ð¤·¤Ê¡£", - "Ç㤦µ¤¤¬¤Ê¤¤¤Ê¤éµ¢¤ê¤Ê¡£ $%s ¤À¤È¸À¤Ã¤Æ¤¤¤ë¤ó¤À¡£", - "Ïäˤʤé¤Ê¤¤¤Í¡£ $%s ¤¯¤é¤¤»ý¤Ã¤Æ¤¤¤ë¤ó¤À¤í¡©", - "¤Ï¡©¤Ê¤ó¤À¤½¤ê¤ã¡© $%s ¤Î´Ö°ã¤¤¤«¡¢¤Ò¤ç¤Ã¤È¤·¤Æ¡©", - "½Ð¸ý¤Ï¤¢¤Ã¤Á¤À¤è¡£¤½¤ì¤È¤â $%s ½Ð¤»¤ë¤Î¤«¤¤¡¢¤¢¤ó¤¿¤Ë¡£", - "Ì¿ÃΤ餺¤ÊÅÛ¤À¤Ê¡£ $%s ½Ð¤»¤Ðº£Æü¤Î½ê¤Ï´ªÊÛ¤·¤Æ¤ä¤ë¤è¡£", - "¤¦¤Á¤ÎŹ¤ÏÉÏ˳¿Í¤ªÃǤê¤À¡£ $%s ¤°¤é¤¤½Ð¤»¤Ê¤¤¤Î¤«¤¤¡©" + "ããã俺æ§ãã人好ãã¨ã¯ãã $%s ãéçã ããå«ãªã帰ããªã", + "éããªãã®ããããããï¼ã¾ãã¯å®¶ã«å¸°ã£ã¦ $%s æãã¦ããªã", + "ç©ã®ä¾¡å¤ãåããã奴ã ãªããã㯠$%s ãæ®éãªãã ãã", + "俺ã®ä»ããå¤æ®µã«æå¥ãããã®ãï¼ $%s ãéçã ã", + "ã²ãã£ã¨ãã¦æ°æã®åè«ããï¼ $%s æã£ã¦ãªããªã帰ããªã", + "ãã¡ã¯ä»ã®åºã¨ã¯éããã ãã$%s ãããã¯åºããªã", + "è²·ãæ°ããªããªã帰ããªã $%s ã ã¨è¨ã£ã¦ãããã ã", + "話ã«ãªããªããã $%s ãããæã£ã¦ãããã ãï¼", + "ã¯ï¼ãªãã ãããï¼ $%s ã®ééãããã²ãã£ã¨ãã¦ï¼", + "åºå£ã¯ãã£ã¡ã ããããã¨ã $%s åºããã®ããããããã«ã", + "å½ç¥ãããªå¥´ã ãªã $%s åºãã°ä»æ¥ã®æã¯åå¼ãã¦ãããã", + "ãã¡ã®åºã¯è²§ä¹äººãæãã ã $%s ãããåºããªãã®ããï¼" }; #endif #define MAX_COMMENT_3A 2 @@ -127,8 +130,8 @@ static cptr comment_2b_B[MAX_COMMENT_2B] = { static cptr comment_3a[MAX_COMMENT_3A] = { #ifdef JP - "»ä¤ÎǦÂÑÎϤò»î¤·¤Æ¤¤¤ë¤Î¤«¤¤¡© $%s ¤¬ºÇ¸å¤À¡£", - "²æËý¤Ë¤â¸ÂÅÙ¤¬¤¢¤ë¤¾¡£ $%s ¤¬ºÇ¸å¤À¡£" + "ç§ã®å¿èåã試ãã¦ããã®ããï¼ $%s ãæå¾ã ã", + "ææ ¢ã«ãé度ããããã $%s ãæå¾ã ã" #else "You try my patience. %s is final.", "My patience grows thin. %s is final." @@ -142,18 +145,18 @@ static cptr comment_3a[MAX_COMMENT_3A] = static cptr comment_3b[MAX_COMMENT_3B] = { #ifdef JP - "Ëܲ»¤ò¸À¤¦¤È $%s ¤Ç¤¤¤¤¤ó¤À¤í¡©", - " $%s ¤Ç¤É¤¦¤À¤¤¡©", - " $%s ¤°¤é¤¤¤Ê¤é½Ð¤·¤Æ¤â¤¤¤¤¤¬¡£", - " $%s °Ê¾åʧ¤¦¤Ê¤ó¤Æ¹Í¤¨¤é¤ì¤Ê¤¤¤Í¡£", - "¤Þ¤¢Íî¤Á¤Ä¤¤¤Æ¡£ $%s ¤Ç¤É¤¦¤À¤¤¡©", - "¤½¤Î¥¬¥é¥¯¥¿¤Ê¤é $%s ¤Ç°ú¤¼è¤ë¤è¡£", - "¤½¤ì¤¸¤ã¹â¤¹¤®¤ë¡ª $%s ¤¬¤¤¤¤¤È¤³¤À¤í¡£", - "¤É¤¦¤»¤¤¤é¤Ê¤¤¤ó¤À¤í¡ª $%s ¤Ç¤¤¤¤¤À¤í¡©", - "¤À¤á¤À¤á¡ª $%s ¤¬¤º¤Ã¤È¤ª»÷¹ç¤¤¤À¤è¡£", - "¥Ð¥«¤Ë¤·¤Æ¤¤¤ë¡ª $%s ¤¬¤»¤¤¤¼¤¤¤À¡£", - " $%s ¤Ê¤é´ò¤·¤¤¤È¤³¤í¤À¤¬¤Ê¤¢¡£", - " $%s ¡¢¤½¤ì°Ê¾å¤Ï¥Ó¥¿°ìʸ½Ð¤µ¤Ê¤¤¤è¡ª" + "æ¬é³ãè¨ã㨠$%s ã§ãããã ãï¼", + " $%s ã§ã©ãã ãï¼", + " $%s ããããªãåºãã¦ããããã", + " $%s 以ä¸æããªãã¦èããããªããã", + "ã¾ãè½ã¡ã¤ãã¦ã $%s ã§ã©ãã ãï¼", + "ãã®ã¬ã©ã¯ã¿ãªã $%s ã§å¼ãåããã", + "ããããé«ãããï¼ $%s ãããã¨ãã ãã", + "ã©ãããããªããã ãï¼ $%s ã§ããã ãï¼", + "ã ãã ãï¼ $%s ããã£ã¨ãä¼¼åãã ãã", + "ãã«ã«ãã¦ããï¼ $%s ãããããã ã", + " $%s ãªãå¬ããã¨ããã ããªãã", + " $%s ããã以ä¸ã¯ãã¿ä¸æåºããªããï¼" #else "Perhaps %s gold pieces?", "How about %s gold pieces?", @@ -172,20 +175,20 @@ static cptr comment_3b[MAX_COMMENT_3B] = }; #ifdef JP -/* ¥Ö¥é¥Ã¥¯¥Þ¡¼¥±¥Ã¥ÈÍÑÄɲåá¥Ã¥»¡¼¥¸¡ÊÇ㤤¼è¤ê¡Ë */ +/*! ãã©ãã¯ãã¼ã±ããç¨è¿½å ã¡ãã»ã¼ã¸ï¼è²·ãåãï¼ */ static cptr comment_3b_B[MAX_COMMENT_3B] = { - " $%s ¤Ã¤Æ¤È¤³¤í¤À¤Í¡£¤½¤Î¤É¤¦¤·¤è¤¦¤â¤Ê¤¤¥¬¥é¥¯¥¿¤Ï¡£", - "¤³¤Î²¶¤¬ $%s ¤Ã¤Æ¸À¤Ã¤Æ¤¤¤ë¤ó¤À¤«¤é¡¢¤½¤ÎÄ̤ê¤Ë¤·¤¿Êý¤¬¿È¤Î¤¿¤á¤À¤¾¡£", - "²¶¤ÎÍ¥¤·¤µ¤Ë´Å¤¨¤ë¤Î¤â¤¤¤¤²Ã¸º¤Ë¤·¤Æ¤ª¤±¡£ $%s ¤À¡£", - "¤½¤ÎÉʤʤé $%s ¤ÇÇä¤Ã¤Æ¤¯¤ì¤Æ¤¤¤ë¤¬¤Í¡¢¾ï¼±¤¢¤ë¿Â»Î¤Ï¤ß¤ó¤Ê¡£", - "¤³¤ê¤ã¤Þ¤¿¡¢¤¬¤á¤Ä¤¤ÅÛ¤À¤Ê¡£¤¤¤¯¤é²¶¤¬²¹¸ü¤È¤Ï¤¤¤¨ $%s ¤¬¸Â³¦¤À¡£", - " $%s ¤À¡£Ê̤˲¶¤Ï¤½¤ó¤Ê¥¬¥é¥¯¥¿Íߤ·¤¯¤Ï¤Ê¤¤¤ó¤À¤«¤é¡£", - "²¶¤Î´ÕÄê³Û¤¬µ¤¤ËÆþ¤é¤Ê¤¤¤Î¤«¡© $%s ¡¢·ù¤Ê¤éµ¢¤ê¤Ê¡£", - " $%s ¤Ç°ú¤¼è¤Ã¤Æ¤ä¤ë¤è¡£´î¤ó¤Ç¼õ¤±¼è¤ê¤Ê¡¢ÉÏ˳¿Í¡£", - "ʪ¤Î²ÁÃͤ¬Ê¬¤«¤é¤óÅۤϻÏËö¤Ë¤ª¤¨¤ó¤Ê¡£¤½¤ì¤Ï $%s ¤Ê¤ó¤À¤è¡£", - "¤½¤ó¤Ê¤Ë¶â¤¬Íߤ·¤¤¤Î¤«¡¢¤¢¤ó¤¿¡© $%s ¤ÇËþ¤Ǥ¤ó¤Î¤«¡©", - "Æþ¤ëŹ´Ö°ã¤¨¤Æ¤ó¤¸¤ã¤Ê¤¤¤Î¤«¡© $%s ¤Ç·ù¤Ê¤é¾¤ò¤¢¤¿¤Ã¤Æ¤¯¤ì¡£", - "²¶¤Î¸À¤¤Ãͤ˥±¥Á¤ò¤Ä¤±¤ëÅÛ¤¬¤¤¤ë¤È¤Ï¡ª ¤½¤ÎÅÙ¶»¤ËÌȤ¸¤Æ $%s ¤À¡£" + " $%s ã£ã¦ã¨ããã ãããã®ã©ããããããªãã¬ã©ã¯ã¿ã¯ã", + "ãã®ä¿ºã $%s ã£ã¦è¨ã£ã¦ãããã ããããã®éãã«ããæ¹ã身ã®ããã ãã", + "俺ã®åªããã«çããã®ãããå æ¸ã«ãã¦ããã $%s ã ã", + "ãã®åãªã $%s ã§å£²ã£ã¦ããã¦ããããã常èãã紳士ã¯ã¿ããªã", + "ãããã¾ããããã¤ã奴ã ãªãããã俺ã温åã¨ã¯ãã $%s ãéçã ã", + " $%s ã ãå¥ã«ä¿ºã¯ãããªã¬ã©ã¯ã¿æ¬²ããã¯ãªããã ããã", + "俺ã®éå®é¡ãæ°ã«å ¥ããªãã®ãï¼ $%s ãå«ãªã帰ããªã", + " $%s ã§å¼ãåã£ã¦ããããåãã§åãåããªã貧ä¹äººã", + "ç©ã®ä¾¡å¤ãåããã奴ã¯å§æ«ã«ããããªããã㯠$%s ãªãã ãã", + "ãããªã«éã欲ããã®ãããããï¼ $%s ã§æºè¶³ã§ããã®ãï¼", + "å ¥ãåºééãã¦ããããªãã®ãï¼ $%s ã§å«ãªãä»ãããã£ã¦ããã", + "俺ã®è¨ãå¤ã«ã±ããã¤ãã奴ãããã¨ã¯ï¼ ãã®åº¦è¸ã«å ã㦠$%s ã ã" }; #endif #define MAX_COMMENT_4A 4 @@ -193,10 +196,10 @@ static cptr comment_3b_B[MAX_COMMENT_3B] = { static cptr comment_4a[MAX_COMMENT_4A] = { #ifdef JP - "¤â¤¦¤¿¤¯¤µ¤ó¤À¡ª²¿ÅÙ¤â»ä¤ò¤ï¤º¤é¤ï¤»¤Ê¤¤¤Ç¤¯¤ì¡ª", - "¤¦¤¬¡¼¡ª°ìÆü¤Î²æËý¤Î¸ÂÅÙ¤òĶ¤¨¤Æ¤¤¤ë¡ª", - "¤â¤¦¤¤¤¤¡ª»þ´Ö¤Î̵Â̰ʳ°¤Î¤Ê¤Ë¤â¤Î¤Ç¤â¤Ê¤¤¡ª", - "¤â¤¦¤ä¤Ã¤Æ¤é¤ì¤Ê¤¤¤è¡ª´é¤â¸«¤¿¤¯¤Ê¤¤¡ª" + "ããããããã ï¼ä½åº¦ãç§ãããããããªãã§ããï¼", + "ããã¼ï¼ä¸æ¥ã®ææ ¢ã®é度ãè¶ ãã¦ããï¼", + "ããããï¼æéã®ç¡é§ä»¥å¤ã®ãªã«ãã®ã§ããªãï¼", + "ãããã£ã¦ãããªããï¼é¡ãè¦ãããªãï¼" #else "Enough! You have abused me once too often!", "Arghhh! I have had enough abuse for one day!", @@ -207,12 +210,12 @@ static cptr comment_4a[MAX_COMMENT_4A] = }; #ifdef JP -/* ¥Ö¥é¥Ã¥¯¥Þ¡¼¥±¥Ã¥ÈÍÑÄɲåá¥Ã¥»¡¼¥¸¡ÊÅܤê¤ÎĺÅÀ¡Ë */ +/*! ãã©ãã¯ãã¼ã±ããç¨è¿½å ã¡ãã»ã¼ã¸ï¼æãã®é ç¹ï¼ */ static cptr comment_4a_B[MAX_COMMENT_4A] = { - "¤Ê¤á¤ä¤¬¤Ã¤Æ¡ª²¹¸ü¤Ê²¶ÍͤǤâ¸Â³¦¤¬¤¢¤ë¤Ã¤Æ¤³¤È¤òÃΤ졪", - "²¶¤ò¤³¤³¤Þ¤ÇÅܤ餻¤Æ...Ì¿¤¬¤¢¤ë¤À¤±¤Ç¤â¤¢¤ê¤¬¤¿¤¤¤È»×¤¨¡ª", - "¤Õ¤¶¤±¤Æ¤ë¤Î¤«¡ªÎä¤ä¤«¤·¤Ê¤éÁê¼ê¤ò¸«¤Æ¤«¤é¤Ë¤·¤í¡ª", - "¤¤¤¤¤«¤²¤ó¤Ë¤·¤í¡ªº£ÅÙ¤³¤ó¤Ê¤Þ¤Í¤·¤¿¤é¤¿¤À¤¸¤ã¤ª¤«¤Í¤¨¤¾¡ª" + "ãªãããã£ã¦ï¼æ¸©åãªä¿ºæ§ã§ãéçãããã£ã¦ãã¨ãç¥ãï¼", + "俺ãããã¾ã§æããã¦...å½ãããã ãã§ããããããã¨æãï¼", + "ãµããã¦ãã®ãï¼å·ããããªãç¸æãè¦ã¦ããã«ããï¼", + "ãããããã«ããï¼ä»åº¦ãããªã¾ãããããã ãããããããï¼" }; #endif #define MAX_COMMENT_4B 4 @@ -220,10 +223,10 @@ static cptr comment_4a_B[MAX_COMMENT_4A] = { static cptr comment_4b[MAX_COMMENT_4B] = { #ifdef JP - "Ź¤«¤é½Ð¤Æ¹Ô¤±¡ª", - "²¶¤ÎÁ°¤«¤é¾Ã¤¨¼º¤»¤í¡ª", - "¤É¤Ã¤«¤Ë¹Ô¤Ã¤Á¤Þ¤¨¡ª", - "½Ð¤í¡¢½Ð¤í¡¢½Ð¤Æ¹Ô¤±¡ª" + "åºããåºã¦è¡ãï¼", + "俺ã®åããæ¶ã失ããï¼", + "ã©ã£ãã«è¡ã£ã¡ã¾ãï¼", + "åºããåºããåºã¦è¡ãï¼" #else "Leave my store!", "Get out of my sight!", @@ -234,12 +237,12 @@ static cptr comment_4b[MAX_COMMENT_4B] = }; #ifdef JP -/* ¥Ö¥é¥Ã¥¯¥Þ¡¼¥±¥Ã¥ÈÍÑÄɲåá¥Ã¥»¡¼¥¸¡ÊÄɤ¤½Ð¤·¡Ë */ +/*! ãã©ãã¯ãã¼ã±ããç¨è¿½å ã¡ãã»ã¼ã¸ï¼è¿½ãåºãï¼ */ static cptr comment_4b_B[MAX_COMMENT_4B] = { - "ÆóÅ٤Ȥ¦¤Á¤ËÍè¤ë¤ó¤¸¤ã¤Í¤¨¡ª¡ª", - "¤È¤Ã¤È¤È¡¢¤É¤Ã¤«¤Ø¼º¤»¤í¡ª¡ª", - "º£¤¹¤°¾Ã¤¨¼º¤»¤í¡ª¡ª", - "½Ð¤Æ¤¤¤±¡ª½Ð¤Æ¤¤¤±¡ª¡ª" + "äºåº¦ã¨ãã¡ã«æ¥ããããããï¼ï¼", + "ã¨ã£ã¨ã¨ãã©ã£ãã¸å¤±ããï¼ï¼", + "ä»ããæ¶ã失ããï¼ï¼", + "åºã¦ããï¼åºã¦ããï¼ï¼" }; #endif #define MAX_COMMENT_5 8 @@ -247,14 +250,14 @@ static cptr comment_4b_B[MAX_COMMENT_4B] = { static cptr comment_5[MAX_COMMENT_5] = { #ifdef JP - "¹Í¤¨Ä¾¤·¤Æ¤¯¤ì¡£", - "¤½¤ê¤ã¤ª¤«¤·¤¤¡ª", - "¤â¤Ã¤È¿¿ÌÌÌܤ˸À¤Ã¤Æ¤¯¤ì¡ª", - "¸ò¾Ä¤¹¤ëµ¤¤¬¤¢¤ë¤Î¤«¤¤¡©", - "Îä¤ä¤«¤·¤ËÍ褿¤Î¤«¡ª", - "°¤¤¾éÃ̤À¡ª", - "²æËý¤¯¤é¤Ù¤«¤¤¡£", - "¤Õ¡¼¤à¡¢Îɤ¤Å·µ¤¤À¡£" + "èãç´ãã¦ããã", + "ãããããããï¼", + "ãã£ã¨çé¢ç®ã«è¨ã£ã¦ããï¼", + "交æ¸ããæ°ãããã®ããï¼", + "å·ãããã«æ¥ãã®ãï¼", + "æªãåè«ã ï¼", + "ææ ¢ããã¹ããã", + "ãµã¼ããè¯ã天æ°ã ã" #else "Try again.", "Ridiculous!", @@ -269,16 +272,16 @@ static cptr comment_5[MAX_COMMENT_5] = }; #ifdef JP -/* ¥Ö¥é¥Ã¥¯¥Þ¡¼¥±¥Ã¥ÈÍÑÄɲåá¥Ã¥»¡¼¥¸¡ÊÅܤê¡Ë */ +/*! ãã©ãã¯ãã¼ã±ããç¨è¿½å ã¡ãã»ã¼ã¸ï¼æãï¼ */ static cptr comment_5_B[MAX_COMMENT_5] = { - "»þ´Ö¤Î̵Â̤À¤Ê¡¢¤³¤ì¤Ï¡£", - "Ìñ²ð¤Ê¤ªµÒÍͤÀ¤Ê¡ª", - "Ïä·¤Æʬ¤«¤ëÁê¼ê¤¸¤ã¤Ê¤µ¤½¤¦¤À¡£", - "Äˤ¤Ìܤˤ¢¤¤¤¿¤¤¤é¤·¤¤¤Ê¡ª", - "¤Ê¤ó¤Æ¶¯ÍߤÊÅÛ¤À¡ª", - "Ïäˤʤé¤óÇÚ¤À¡ª", - "¤É¤¦¤·¤è¤¦¤â¤Ê¤¤ÉÏ˳¿Í¤À¡ª", - "·ö²Þ¤òÇä¤Ã¤Æ¤¤¤ë¤Î¤«¡©" + "æéã®ç¡é§ã ãªãããã¯ã", + "åä»ãªã客æ§ã ãªï¼", + "話ãã¦åããç¸æãããªãããã ã", + "çãç®ã«ããããããããªï¼", + "ãªãã¦å¼·æ¬²ãªå¥´ã ï¼", + "話ã«ãªãã輩ã ï¼", + "ã©ããããããªã貧ä¹äººã ï¼", + "å§å©ã売ã£ã¦ããã®ãï¼" }; #endif #define MAX_COMMENT_6 4 @@ -286,10 +289,10 @@ static cptr comment_5_B[MAX_COMMENT_5] = { static cptr comment_6[MAX_COMMENT_6] = { #ifdef JP - "¤É¤¦¤ä¤éʹ¤´Ö°ã¤¨¤¿¤é¤·¤¤¡£", - "¼ºÎé¡¢¤è¤¯Ê¹¤³¤¨¤Ê¤«¤Ã¤¿¤è¡£", - "¤¹¤Þ¤Ê¤¤¡¢²¿¤À¤Ã¤Æ¡©", - "°¤¤¡¢¤â¤¦°ìÅÙ¸À¤Ã¤Æ¤¯¤ì¤ë¡©" + "ã©ãããèãééãããããã", + "失礼ãããèãããªãã£ããã", + "ãã¾ãªããä½ã ã£ã¦ï¼", + "æªããããä¸åº¦è¨ã£ã¦ãããï¼" #else "I must have heard you wrong.", "I'm sorry, I missed that.", @@ -301,15 +304,15 @@ static cptr comment_6[MAX_COMMENT_6] = -/* +/*! + * @brief åå¼æåæã®åºä¸»ã®ã¡ãã»ã¼ã¸å¦ç / * Successful haggle. + * @return ãªã */ static void say_comment_1(void) { - char rumour[1024]; - #ifdef JP - /* ¥Ö¥é¥Ã¥¯¥Þ¡¼¥±¥Ã¥È¤Î¤È¤¤ÏÊ̤Υá¥Ã¥»¡¼¥¸¤ò½Ð¤¹ */ + /* ãã©ãã¯ãã¼ã±ããã®ã¨ãã¯å¥ã®ã¡ãã»ã¼ã¸ãåºã */ if ( cur_store_num == STORE_BLACK ) { msg_print(comment_1_B[randint0(MAX_COMMENT_1)]); } @@ -324,27 +327,23 @@ static void say_comment_1(void) if (one_in_(RUMOR_CHANCE)) { #ifdef JP -msg_print("Ź¼ç¤Ï¼ª¤¦¤Á¤·¤¿:"); + msg_print("åºä¸»ã¯è³ãã¡ãã:"); #else msg_print("The shopkeeper whispers something into your ear:"); #endif - - -#ifdef JP -if (!get_rnd_line_jonly("rumors_j.txt", 0, rumour, 10)) -#else - if (!get_rnd_line("rumors.txt", 0, rumour)) -#endif - - msg_print(rumour); + display_rumor(TRUE); } } -/* +/*! + * @brief ãã¬ã¤ã¤ã¼ãã¢ã¤ãã ãè²·ãæã®ä¾¡æ ¼ä»£æ¡ã¡ãã»ã¼ã¸å¦ç / * Continue haggling (player is buying) + * @param value åºä¸»ã®æç¤ºä¾¡æ ¼ + * @param annoyed åºä¸»ã®ããã¤ã度 + * @return ãªã */ -static void say_comment_2(s32b value, int annoyed) +static void say_comment_2(PRICE value, int annoyed) { char tmp_val[80]; @@ -363,7 +362,7 @@ static void say_comment_2(s32b value, int annoyed) { /* Formatted message */ #ifdef JP - /* ¥Ö¥é¥Ã¥¯¥Þ¡¼¥±¥Ã¥È¤Î»þ¤ÏÊ̤Υá¥Ã¥»¡¼¥¸¤ò½Ð¤¹ */ + /* ãã©ãã¯ãã¼ã±ããã®æã¯å¥ã®ã¡ãã»ã¼ã¸ãåºã */ if ( cur_store_num == STORE_BLACK ){ msg_format(comment_2b_B[randint0(MAX_COMMENT_2B)], tmp_val); } @@ -378,10 +377,14 @@ static void say_comment_2(s32b value, int annoyed) } -/* +/*! + * @brief ãã¬ã¤ã¤ã¼ãã¢ã¤ãã ã売ãæã®ä¾¡æ ¼ä»£æ¡ã¡ãã»ã¼ã¸å¦ç / * Continue haggling (player is selling) + * @param value åºä¸»ã®æç¤ºä¾¡æ ¼ + * @param annoyed åºä¸»ã®ããã¤ã度 + * @return ãªã */ -static void say_comment_3(s32b value, int annoyed) +static void say_comment_3(PRICE value, int annoyed) { char tmp_val[80]; @@ -400,7 +403,7 @@ static void say_comment_3(s32b value, int annoyed) { /* Formatted message */ #ifdef JP - /* ¥Ö¥é¥Ã¥¯¥Þ¡¼¥±¥Ã¥È¤Î»þ¤ÏÊ̤Υá¥Ã¥»¡¼¥¸¤ò½Ð¤¹ */ + /* ãã©ãã¯ãã¼ã±ããã®æã¯å¥ã®ã¡ãã»ã¼ã¸ãåºã */ if ( cur_store_num == STORE_BLACK ){ msg_format(comment_3b_B[randint0(MAX_COMMENT_3B)], tmp_val); } @@ -415,13 +418,15 @@ static void say_comment_3(s32b value, int annoyed) } -/* +/*! + * @brief åºä¸»ããã¬ã¤ã¤ã¼ã追ãåºãæã®ã¡ãã»ã¼ã¸å¦ç / * Kick 'da bum out. -RAK- + * @return ãªã */ static void say_comment_4(void) { #ifdef JP - /* ¥Ö¥é¥Ã¥¯¥Þ¡¼¥±¥Ã¥È¤Î»þ¤ÏÊ̤Υá¥Ã¥»¡¼¥¸¤ò½Ð¤¹ */ + /* ãã©ãã¯ãã¼ã±ããã®æã¯å¥ã®ã¡ãã»ã¼ã¸ãåºã */ if ( cur_store_num == STORE_BLACK ){ msg_print(comment_4a_B[randint0(MAX_COMMENT_4A)]); msg_print(comment_4b_B[randint0(MAX_COMMENT_4B)]); @@ -438,13 +443,15 @@ static void say_comment_4(void) } -/* +/*! + * @brief åºä¸»ããã¬ã¤ã¤ã¼ã«åãåããªãæã®ã¡ãã»ã¼ã¸å¦ç / * You are insulting me + * @return ãªã */ static void say_comment_5(void) { #ifdef JP - /* ¥Ö¥é¥Ã¥¯¥Þ¡¼¥±¥Ã¥È¤Î»þ¤ÏÊ̤Υá¥Ã¥»¡¼¥¸¤ò½Ð¤¹ */ + /* ãã©ãã¯ãã¼ã±ããã®æã¯å¥ã®ã¡ãã»ã¼ã¸ãåºã */ if ( cur_store_num == STORE_BLACK ){ msg_print(comment_5_B[randint0(MAX_COMMENT_5)]); } @@ -458,8 +465,10 @@ static void say_comment_5(void) } -/* +/*! + * @brief åºä¸»ããã¬ã¤ã¤ã¼ã®æ示ãç解ã§ããªãã£ãæã®ã¡ãã»ã¼ã¸å¦ç / * That makes no sense. + * @return ãªã */ static void say_comment_6(void) { @@ -467,20 +476,15 @@ static void say_comment_6(void) } - -/* - * Messages for reacting to purchase prices. - */ - #define MAX_COMMENT_7A 4 static cptr comment_7a[MAX_COMMENT_7A] = { #ifdef JP - "¤¦¤ï¤¢¤¢¤¡¤¡¡ª", - "¤Ê¤ó¤Æ¤³¤Ã¤¿¡ª", - "狼¤¬¤à¤»¤Óµã¤¯À¼¤¬Ê¹¤³¤¨¤ë...¡£", - "Ź¼ç¤¬²ù¤·¤²¤Ë¤ï¤á¤¤¤Æ¤¤¤ë¡ª" + "ããããããï¼", + "ãªãã¦ãã£ãï¼", + "誰ããããã³æ³£ã声ãèããã...ã", + "åºä¸»ãæããã«ãããã¦ããï¼" #else "Arrgghh!", "You bastard!", @@ -495,10 +499,10 @@ static cptr comment_7a[MAX_COMMENT_7A] = static cptr comment_7b[MAX_COMMENT_7B] = { #ifdef JP - "¤¯¤½¤¦¡ª", - "¤³¤Î°Ëâ¤á¡ª", - "Ź¼ç¤¬º¨¤á¤·¤½¤¦¤Ë¸«¤Æ¤¤¤ë¡£", - "Ź¼ç¤¬âˤó¤Ç¤¤¤ë¡£" + "ãããï¼", + "ãã®æªéãï¼", + "åºä¸»ãæ¨ããããã«è¦ã¦ããã", + "åºä¸»ãç¨ãã§ããã" #else "Damn!", "You fiend!", @@ -513,10 +517,10 @@ static cptr comment_7b[MAX_COMMENT_7B] = static cptr comment_7c[MAX_COMMENT_7C] = { #ifdef JP - "¤¹¤Ð¤é¤·¤¤¡ª", - "·¯¤¬Å·»È¤Ë¸«¤¨¤ë¤è¡ª", - "Ź¼ç¤¬¥¯¥¹¥¯¥¹¾Ð¤Ã¤Æ¤¤¤ë¡£", - "Ź¼ç¤¬ÂçÀ¼¤Ç¾Ð¤Ã¤Æ¤¤¤ë¡£" + "ãã°ãããï¼", + "åã天使ã«è¦ãããï¼", + "åºä¸»ãã¯ã¹ã¯ã¹ç¬ã£ã¦ããã", + "åºä¸»ã大声ã§ç¬ã£ã¦ããã" #else "Cool!", "You've made my day!", @@ -531,10 +535,10 @@ static cptr comment_7c[MAX_COMMENT_7C] = static cptr comment_7d[MAX_COMMENT_7D] = { #ifdef JP - "¤ä¤Ã¤Û¤¥¡ª", - "¤³¤ó¤Ê¤ª¤¤¤·¤¤»×¤¤¤ò¤·¤¿¤é¡¢¿¿ÌÌÌܤËƯ¤±¤Ê¤¯¤Ê¤ë¤Ê¤¡¡£", - "Ź¼ç¤Ï´ò¤·¤¯¤ÆÄ·¤Í²ó¤Ã¤Æ¤¤¤ë¡£", - "Ź¼ç¤ÏËþÌ̤˾Фߤò¤¿¤¿¤¨¤Æ¤¤¤ë¡£" + "ãã£ã»ã ï¼", + "ãããªããããæããããããçé¢ç®ã«åããªããªããªãã", + "åºä¸»ã¯å¬ããã¦è·³ãåã£ã¦ããã", + "åºä¸»ã¯æºé¢ã«ç¬ã¿ããããã¦ããã" #else "Yipee!", "I think I'll retire!", @@ -545,12 +549,17 @@ static cptr comment_7d[MAX_COMMENT_7D] = }; -/* +/*! + * @brief åºä¸»ã交æ¸ãçµããéã®åå¿ãè¿ãå¦ç / * Let a shop-keeper React to a purchase - * + * @param price ã¢ã¤ãã ã®åå¼é¡ + * @param value ã¢ã¤ãã ã®å®éä¾¡å¤ + * @param guess åºä¸»ãå½åäºæ³ãã¦ããä¾¡å¤ + * @return ãªã + * @details * We paid "price", it was worth "value", and we thought it was worth "guess" */ -static void purchase_analyze(s32b price, s32b value, s32b guess) +static void purchase_analyze(PRICE price, PRICE value, PRICE guess) { /* Item was worthless, but we bought it */ if ((value <= 0) && (price > value)) @@ -561,7 +570,6 @@ static void purchase_analyze(s32b price, s32b value, s32b guess) chg_virtue(V_HONOUR, -1); chg_virtue(V_JUSTICE, -1); - /* Sound */ sound(SOUND_STORE1); } @@ -575,7 +583,6 @@ static void purchase_analyze(s32b price, s32b value, s32b guess) if (one_in_(4)) chg_virtue(V_HONOUR, -1); - /* Sound */ sound(SOUND_STORE2); } @@ -590,7 +597,6 @@ static void purchase_analyze(s32b price, s32b value, s32b guess) else if (one_in_(4)) chg_virtue(V_HONOUR, 1); - /* Sound */ sound(SOUND_STORE3); } @@ -608,43 +614,16 @@ static void purchase_analyze(s32b price, s32b value, s32b guess) if (10 * price < value) chg_virtue(V_SACRIFICE, 1); - /* Sound */ sound(SOUND_STORE4); } } - - -#ifdef JP -/* ÆüËܸìÈǤξì¹ç¤Ï¾å¤ÎÊý¤Ë°ÜÆ°¤·¤Æ¤¢¤ê¤Þ¤¹ */ -#else -/* - * We store the current "store number" here so everyone can access it - */ -static int cur_store_num = 7; - -/* - * We store the current "store page" here so everyone can access it - */ -static int store_top = 0; - -/* - * We store the current "store pointer" here so everyone can access it - */ -static store_type *st_ptr = NULL; - /* - * We store the current "owner type" here so everyone can access it + * We store the current "store feat" here so everyone can access it */ -static owner_type *ot_ptr = NULL; -#endif - - - - - +static int cur_store_feat; /* @@ -656,7 +635,7 @@ static byte rgold_adj[MAX_RACES][MAX_RACES] = /*Hum, HfE, Elf, Hal, Gno, Dwa, HfO, HfT, Dun, HiE, Barbarian, HfOg, HGn, HTn, Cyc, Yek, Klc, Kbd, Nbl, DkE, Drc, Mind Flayer, Imp, Glm, Skl, Zombie, Vampire, Spectre, Fairy, Beastman, Ent, - Angel, Demon, Kuta*/ + Angel, Demon, Kutar */ /* Human */ { 100, 105, 105, 110, 113, 115, 120, 125, 100, 105, 100, @@ -868,7 +847,7 @@ static byte rgold_adj[MAX_RACES][MAX_RACES] = 110, 110, 112, 122, 110, 110, 110, 115, 110, 120, 120, 110, 101, 115, 110 }, - /* Kuta */ + /* Kutar */ { 110, 110, 105, 105, 110, 115, 115, 115, 110, 105, 110, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 125, 125, 125, 125, 105, 115, 105, 95, 140, @@ -883,25 +862,27 @@ static byte rgold_adj[MAX_RACES][MAX_RACES] = - -/* +/*! + * @brief åºèä¾¡æ ¼ã決å®ãã / * Determine the price of an item (qty one) in a store. - * + * @param o_ptr åºèã«ä¸¦ã¹ããªãã¸ã§ã¯ãæ§é ä½ã®åç §ãã¤ã³ã¿ + * @param greed åºä¸»ã®å¼·æ¬²åº¦ + * @param flip TRUEãªãã°åºä¸»ã«ã¨ã£ã¦ã®è²·åä¾¡æ ¼ãFALSEãªã売åºä¾¡æ ¼ãè¨ç® + * @return ãªã + * @details + *
* This function takes into account the player's charisma, and the * shop-keepers friendliness, and the shop-keeper's base greed, but * never lets a shop-keeper lose money in a transaction. - * * The "greed" value should exceed 100 when the player is "buying" the * item, and should be less than 100 when the player is "selling" it. - * * Hack -- the black market always charges twice as much as it should. - * * Charisma adjustment runs from 80 to 130 * Racial adjustment runs from 95 to 130 - * * Since greed/charisma/racial adjustments are centered at 100, we need * to adjust (by 200) to extract a usable multiplier. Note that the * "greed" value is always something (?). + **/ static s32b price_item(object_type *o_ptr, int greed, bool flip) { @@ -968,14 +949,20 @@ static s32b price_item(object_type *o_ptr, int greed, bool flip) } -/* +/*! + * @brief å®ä¾¡ãªæ¶èåã®è²©å£²æ°ãå¢ãããä½ç¢ºçã§å²å¼ã«ãã / * Certain "cheap" objects should be created in "piles" + * @param o_ptr åºèã«ä¸¦ã¹ããªãã¸ã§ã¯ãæ§é ä½ã®åç §ãã¤ã³ã¿ + * @return ãªã + * @details + *
* Some objects can be sold at a "discount" (in small piles) + **/ static void mass_produce(object_type *o_ptr) { int size = 1; - int discount = 0; + DISCOUNT_RATE discount = 0; s32b cost = object_value(o_ptr); @@ -1011,11 +998,12 @@ static void mass_produce(object_type *o_ptr) case TV_DEATH_BOOK: case TV_TRUMP_BOOK: case TV_ARCANE_BOOK: - case TV_ENCHANT_BOOK: + case TV_CRAFT_BOOK: case TV_DAEMON_BOOK: case TV_CRUSADE_BOOK: case TV_MUSIC_BOOK: case TV_HISSATSU_BOOK: + case TV_HEX_BOOK: { if (cost <= 50L) size += damroll(2, 3); if (cost <= 500L) size += damroll(1, 3); @@ -1036,8 +1024,8 @@ static void mass_produce(object_type *o_ptr) case TV_DIGGING: case TV_BOW: { - if (o_ptr->art_name) break; - if (o_ptr->name2) break; + if (object_is_artifact(o_ptr)) break; + if (object_is_ego(o_ptr)) break; if (cost <= 10L) size += damroll(3, 5); if (cost <= 100L) size += damroll(3, 5); break; @@ -1083,12 +1071,6 @@ static void mass_produce(object_type *o_ptr) if (cost < 1601L) size += damroll(1, 5); else if (cost < 3201L) size += damroll(1, 3); } - - /* Ensure that mass-produced rods and wands get the correct pvals. */ - if ((o_ptr->tval == TV_ROD) || (o_ptr->tval == TV_WAND)) - { - o_ptr->pval *= size; - } break; } } @@ -1116,18 +1098,8 @@ static void mass_produce(object_type *o_ptr) discount = 90; } - if (o_ptr->art_name) { - if (cheat_peek && discount) - { -#ifdef JP -msg_print("¥é¥ó¥À¥à¥¢¡¼¥Æ¥£¥Õ¥¡¥¯¥È¤ÏÃÍ°ú¤¤Ê¤·¡£"); -#else - msg_print("No discount on random artifacts."); -#endif - - } discount = 0; } @@ -1136,14 +1108,26 @@ msg_print(" /* Save the total pile size */ o_ptr->number = size - (size * discount / 100); + + /* Ensure that mass-produced rods and wands get the correct pvals. */ + if ((o_ptr->tval == TV_ROD) || (o_ptr->tval == TV_WAND)) + { + o_ptr->pval *= (PARAMETER_VALUE)o_ptr->number; + } } -/* +/*! + * @brief åºèã«ä¸¦ã¹ãåãåä¸åã§ãããã©ããå¤å®ãã / * Determine if a store item can "absorb" another item - * + * @param o_ptr å¤å®ãããªãã¸ã§ã¯ãæ§é ä½ã®åç §ãã¤ã³ã¿1 + * @param j_ptr å¤å®ãããªãã¸ã§ã¯ãæ§é ä½ã®åç §ãã¤ã³ã¿2 + * @return åä¸æ±ãã§ãããªãTRUEãè¿ã + * @details + *
* See "object_similar()" for the same function for the "player" + **/ static bool store_object_similar(object_type *o_ptr, object_type *j_ptr) { @@ -1163,14 +1147,11 @@ static bool store_object_similar(object_type *o_ptr, object_type *j_ptr) if (o_ptr->to_d != j_ptr->to_d) return (0); if (o_ptr->to_a != j_ptr->to_a) return (0); - /* Require identical "artifact" names */ - if (o_ptr->name1 != j_ptr->name1) return (0); - /* Require identical "ego-item" names */ if (o_ptr->name2 != j_ptr->name2) return (0); - /* Random artifacts don't stack !*/ - if (o_ptr->art_name || j_ptr->art_name) return (0); + /* Artifacts don't stack! */ + if (object_is_artifact(o_ptr) || object_is_artifact(j_ptr)) return (0); /* Hack -- Identical art_flags! */ for (i = 0; i < TR_FLAG_SIZE; i++) @@ -1200,8 +1181,16 @@ static bool store_object_similar(object_type *o_ptr, object_type *j_ptr) } -/* +/*! + * @brief åºèã«ä¸¦ã¹ãåãéãåããã§ãããã©ããå¤å®ãã / * Allow a store item to absorb another item + * @param o_ptr å¤å®ãããªãã¸ã§ã¯ãæ§é ä½ã®åç §ãã¤ã³ã¿1 + * @param j_ptr å¤å®ãããªãã¸ã§ã¯ãæ§é ä½ã®åç §ãã¤ã³ã¿2 + * @return éãåããã§ãããªãTRUEãè¿ã + * @details + *
+ * See "object_similar()" for the same function for the "player" + **/ static void store_object_absorb(object_type *o_ptr, object_type *j_ptr) { @@ -1227,15 +1216,20 @@ static void store_object_absorb(object_type *o_ptr, object_type *j_ptr) } -/* +/*! + * @brief åºèã«åãç½®ãã¹ãã¼ã¹ããããã©ããã®å¤å®ãè¿ã / * Check to see if the shop will be carrying too many objects -RAK- + * @param o_ptr åºèã«ç½®ããããªãã¸ã§ã¯ãæ§é ä½ã®åç §ãã¤ã³ã¿ + * @return ç½®ãå ´ããªããªã0ãéãåããã§ããã¢ã¤ãã ããããªã-1ãã¹ãã¼ã¹ããããªã1ãè¿ãã + * @details + *
* Note that the shop, just like a player, will not accept things * it cannot hold. Before, one could "nuke" potions this way. - * * Return value is now int: * 0 : No space * -1 : Can be combined to existing slot. * 1 : Cannot be combined but there are empty spaces. + **/ static int store_check_num(object_type *o_ptr) { @@ -1245,6 +1239,15 @@ static int store_check_num(object_type *o_ptr) /* The "home" acts like the player */ if ((cur_store_num == STORE_HOME) || (cur_store_num == STORE_MUSEUM)) { + bool old_stack_force_notes = stack_force_notes; + bool old_stack_force_costs = stack_force_costs; + + if (cur_store_num != STORE_HOME) + { + stack_force_notes = FALSE; + stack_force_costs = FALSE; + } + /* Check all the items */ for (i = 0; i < st_ptr->stock_num; i++) { @@ -1252,7 +1255,22 @@ static int store_check_num(object_type *o_ptr) j_ptr = &st_ptr->stock[i]; /* Can the new object be combined with the old one? */ - if (object_similar(j_ptr, o_ptr)) return -1; + if (object_similar(j_ptr, o_ptr)) + { + if (cur_store_num != STORE_HOME) + { + stack_force_notes = old_stack_force_notes; + stack_force_costs = old_stack_force_costs; + } + + return -1; + } + } + + if (cur_store_num != STORE_HOME) + { + stack_force_notes = old_stack_force_notes; + stack_force_costs = old_stack_force_costs; } } @@ -1272,8 +1290,8 @@ static int store_check_num(object_type *o_ptr) /* Free space is always usable */ /* - * ¥ª¥×¥·¥ç¥ó powerup_home ¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¤È - * ²æ¤¬²È¤¬ 20 ¥Ú¡¼¥¸¤Þ¤Ç»È¤¨¤ë + * ãªãã·ã§ã³ powerup_home ãè¨å®ããã¦ãã㨠+ * æã家ã 20 ãã¼ã¸ã¾ã§ä½¿ãã */ if ((cur_store_num == STORE_HOME) && ( powerup_home == FALSE )) { if (st_ptr->stock_num < ((st_ptr->stock_size) / 10)) { @@ -1290,10 +1308,14 @@ static int store_check_num(object_type *o_ptr) return 0; } - +/*! + * @brief ãªãã¸ã§ã¯ããç¥ç¦ããã¦ãããã®å¤å®ãè¿ã / + * @param o_ptr å¤å®ããããªãã¸ã§ã¯ãæ§é ä½ã®åç §ãã¤ã³ã¿ + * @return ã¢ã¤ãã ãç¥ç¦ãããã¢ã¤ãã ãªãã°TRUEãè¿ã + */ static bool is_blessed(object_type *o_ptr) { - u32b flgs[TR_FLAG_SIZE]; + BIT_FLAGS flgs[TR_FLAG_SIZE]; object_flags(o_ptr, flgs); if (have_flag(flgs, TR_BLESSED)) return (TRUE); else return (FALSE); @@ -1301,9 +1323,12 @@ static bool is_blessed(object_type *o_ptr) -/* +/*! + * @brief ãªãã¸ã§ã¯ããæå®ã®åºèã§å¼ãåãããã©ãããè¿ã / * Determine if the current store will purchase the given item - * + * @param o_ptr å¤å®ããããªãã¸ã§ã¯ãæ§é ä½ã®åç §ãã¤ã³ã¿ + * @return ã¢ã¤ãã ãè²·ãåãããªãã°TRUEãè¿ã + * @note * Note that a shop-keeper must refuse to buy "worthless" items */ static bool store_will_buy(object_type *o_ptr) @@ -1463,9 +1488,10 @@ static bool store_will_buy(object_type *o_ptr) case TV_DEATH_BOOK: case TV_TRUMP_BOOK: case TV_ARCANE_BOOK: - case TV_ENCHANT_BOOK: + case TV_CRAFT_BOOK: case TV_DAEMON_BOOK: case TV_MUSIC_BOOK: + case TV_HEX_BOOK: case TV_AMULET: case TV_RING: case TV_STAFF: @@ -1498,10 +1524,11 @@ static bool store_will_buy(object_type *o_ptr) case TV_LIFE_BOOK: case TV_TRUMP_BOOK: case TV_ARCANE_BOOK: - case TV_ENCHANT_BOOK: + case TV_CRAFT_BOOK: case TV_DAEMON_BOOK: case TV_CRUSADE_BOOK: case TV_MUSIC_BOOK: + case TV_HEX_BOOK: break; default: return (FALSE); @@ -1510,7 +1537,7 @@ static bool store_will_buy(object_type *o_ptr) } } - /* XXX XXX XXX Ignore "worthless" items */ + /* Ignore "worthless" items */ if (object_value(o_ptr) <= 0) return (FALSE); /* Assume okay */ @@ -1518,24 +1545,192 @@ static bool store_will_buy(object_type *o_ptr) } +/*! + * @brief ç¾å¨ã®çºã®æå®ãããåºèã®ã¢ã¤ãã ãæ´çãã / + * Combine and reorder items in store. + * @param store_num åºèID + * @return å®éã«æ´çãè¡ããããªãã°TRUEãè¿ãã + */ +bool combine_and_reorder_home(int store_num) +{ + int i, j, k; + s32b o_value; + object_type forge, *o_ptr, *j_ptr; + bool flag = FALSE, combined; + store_type *old_st_ptr = st_ptr; + bool old_stack_force_notes = stack_force_notes; + bool old_stack_force_costs = stack_force_costs; + + st_ptr = &town[1].store[store_num]; + if (store_num != STORE_HOME) + { + stack_force_notes = FALSE; + stack_force_costs = FALSE; + } -/* + do + { + combined = FALSE; + + /* Combine the items in the home (backwards) */ + for (i = st_ptr->stock_num - 1; i > 0; i--) + { + o_ptr = &st_ptr->stock[i]; + + /* Skip empty items */ + if (!o_ptr->k_idx) continue; + + /* Scan the items above that item */ + for (j = 0; j < i; j++) + { + int max_num; + + j_ptr = &st_ptr->stock[j]; + + /* Skip empty items */ + if (!j_ptr->k_idx) continue; + + /* + * Get maximum number of the stack if these + * are similar, get zero otherwise. + */ + max_num = object_similar_part(j_ptr, o_ptr); + + /* Can we (partialy) drop "o_ptr" onto "j_ptr"? */ + if (max_num && j_ptr->number < max_num) + { + if (o_ptr->number + j_ptr->number <= max_num) + { + /* Add together the item counts */ + object_absorb(j_ptr, o_ptr); + + /* One object is gone */ + st_ptr->stock_num--; + + /* Slide everything down */ + for (k = i; k < st_ptr->stock_num; k++) + { + /* Structure copy */ + st_ptr->stock[k] = st_ptr->stock[k + 1]; + } + + /* Erase the "final" slot */ + object_wipe(&st_ptr->stock[k]); + } + else + { + ITEM_NUMBER old_num = o_ptr->number; + ITEM_NUMBER remain = j_ptr->number + o_ptr->number - max_num; + + /* Add together the item counts */ + object_absorb(j_ptr, o_ptr); + + o_ptr->number = remain; + + /* Hack -- if rods are stacking, add the pvals (maximum timeouts) and current timeouts together. -LM- */ + if (o_ptr->tval == TV_ROD) + { + o_ptr->pval = o_ptr->pval * remain / old_num; + o_ptr->timeout = o_ptr->timeout * remain / old_num; + } + + /* Hack -- if wands are stacking, combine the charges. -LM- */ + else if (o_ptr->tval == TV_WAND) + { + o_ptr->pval = o_ptr->pval * remain / old_num; + } + } + + /* Take note */ + combined = TRUE; + + break; + } + } + } + + flag |= combined; + } + while (combined); + + /* Re-order the items in the home (forwards) */ + for (i = 0; i < st_ptr->stock_num; i++) + { + o_ptr = &st_ptr->stock[i]; + + /* Skip empty slots */ + if (!o_ptr->k_idx) continue; + + /* Get the "value" of the item */ + o_value = object_value(o_ptr); + + /* Scan every occupied slot */ + for (j = 0; j < st_ptr->stock_num; j++) + { + if (object_sort_comp(o_ptr, o_value, &st_ptr->stock[j])) break; + } + + /* Never move down */ + if (j >= i) continue; + + /* Take note */ + flag = TRUE; + + /* Get local object */ + j_ptr = &forge; + + /* Save a copy of the moving item */ + object_copy(j_ptr, &st_ptr->stock[i]); + + /* Slide the objects */ + for (k = i; k > j; k--) + { + /* Slide the item */ + object_copy(&st_ptr->stock[k], &st_ptr->stock[k - 1]); + } + + /* Insert the moving item */ + object_copy(&st_ptr->stock[j], j_ptr); + } + + st_ptr = old_st_ptr; + if (store_num != STORE_HOME) + { + stack_force_notes = old_stack_force_notes; + stack_force_costs = old_stack_force_costs; + } + + return flag; +} + + +/*! + * @brief æã家ã«ãªãã¸ã§ã¯ããå ãã / * Add the item "o_ptr" to the inventory of the "Home" - * + * @param o_ptr å ããããªãã¸ã§ã¯ãã®æ§é ä½åç §ãã¤ã³ã¿ + * @return åããå ã®ID + * @details + *
* In all cases, return the slot (or -1) where the object was placed - * * Note that this is a hacked up version of "inven_carry()". - * * Also note that it may not correctly "adapt" to "knowledge" bacoming * known, the player may have to pick stuff up and drop it again. + **/ static int home_carry(object_type *o_ptr) { int slot; - s32b value, j_value; + s32b value; int i; object_type *j_ptr; + bool old_stack_force_notes = stack_force_notes; + bool old_stack_force_costs = stack_force_costs; + if (cur_store_num != STORE_HOME) + { + stack_force_notes = FALSE; + stack_force_costs = FALSE; + } /* Check each existing item (try to combine) */ for (slot = 0; slot < st_ptr->stock_num; slot++) @@ -1549,18 +1744,30 @@ static int home_carry(object_type *o_ptr) /* Save the new number of items */ object_absorb(j_ptr, o_ptr); + if (cur_store_num != STORE_HOME) + { + stack_force_notes = old_stack_force_notes; + stack_force_costs = old_stack_force_costs; + } + /* All done */ return (slot); } } + if (cur_store_num != STORE_HOME) + { + stack_force_notes = old_stack_force_notes; + stack_force_costs = old_stack_force_costs; + } + /* No space? */ /* - * ±£¤·µ¡Ç½: ¥ª¥×¥·¥ç¥ó powerup_home ¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¤È - * ²æ¤¬²È¤¬ 20 ¥Ú¡¼¥¸¤Þ¤Ç»È¤¨¤ë + * é ãæ©è½: ãªãã·ã§ã³ powerup_home ãè¨å®ããã¦ãã㨠+ * æã家ã 20 ãã¼ã¸ã¾ã§ä½¿ãã */ /* No space? */ - if ( powerup_home == TRUE) { + if ((cur_store_num != STORE_HOME) || (powerup_home == TRUE)) { if (st_ptr->stock_num >= st_ptr->stock_size) { return (-1); } @@ -1578,50 +1785,7 @@ static int home_carry(object_type *o_ptr) /* Check existing slots to see if we must "slide" */ for (slot = 0; slot < st_ptr->stock_num; slot++) { - /* Get that item */ - j_ptr = &st_ptr->stock[slot]; - - /* Hack -- readable books always come first */ - if ((o_ptr->tval == mp_ptr->spell_book) && - (j_ptr->tval != mp_ptr->spell_book)) break; - if ((j_ptr->tval == mp_ptr->spell_book) && - (o_ptr->tval != mp_ptr->spell_book)) continue; - - /* Objects sort by decreasing type */ - if (o_ptr->tval > j_ptr->tval) break; - if (o_ptr->tval < j_ptr->tval) continue; - - /* Can happen in the home */ - if (!object_aware_p(o_ptr)) continue; - if (!object_aware_p(j_ptr)) break; - - /* Objects sort by increasing sval */ - if (o_ptr->sval < j_ptr->sval) break; - if (o_ptr->sval > j_ptr->sval) continue; - - /* Objects in the home can be unknown */ - if (!object_known_p(o_ptr)) continue; - if (!object_known_p(j_ptr)) break; - - /* - * Hack: otherwise identical rods sort by - * increasing recharge time --dsb - */ - if (o_ptr->tval == TV_ROD) - { - if (o_ptr->pval < j_ptr->pval) break; - if (o_ptr->pval > j_ptr->pval) continue; - } - if ((o_ptr->tval == TV_CORPSE) || (o_ptr->tval == TV_FIGURINE) || (o_ptr->tval == TV_STATUE)) - { - if (r_info[o_ptr->pval].level < r_info[j_ptr->pval].level) break; - if ((r_info[o_ptr->pval].level == r_info[j_ptr->pval].level) && (o_ptr->pval < j_ptr->pval)) break; - } - - /* Objects sort by decreasing value */ - j_value = object_value(j_ptr); - if (value > j_value) break; - if (value < j_value) continue; + if (object_sort_comp(o_ptr, value, &st_ptr->stock[slot])) break; } /* Slide the others up */ @@ -1638,22 +1802,25 @@ static int home_carry(object_type *o_ptr) chg_virtue(V_SACRIFICE, -1); + (void)combine_and_reorder_home(cur_store_num); + /* Return the location */ return (slot); } -/* +/*! + * @brief åºèã«ãªãã¸ã§ã¯ããå ãã / * Add the item "o_ptr" to a real stores inventory. - * - * If the item is "worthless", it is thrown away (except in the home). - * - * If the item cannot be combined with an object already in the inventory, - * make a new slot for it, and calculate its "per item" price. Note that - * this price will be negative, since the price will not be "fixed" yet. - * Adding an item to a "fixed" price stack will not change the fixed price. - * + * @param o_ptr å ããããªãã¸ã§ã¯ãã®æ§é ä½åç §ãã¤ã³ã¿ + * @return åããå ã®ID + * @details + *
* In all cases, return the slot (or -1) where the object was placed + * Note that this is a hacked up version of "inven_carry()". + * Also note that it may not correctly "adapt" to "knowledge" bacoming + * known, the player may have to pick stuff up and drop it again. + **/ static int store_carry(object_type *o_ptr) { @@ -1747,16 +1914,24 @@ static int store_carry(object_type *o_ptr) } -/* +/*! + * @brief åºèã®ãªãã¸ã§ã¯ãæ°ãå¢ãã / + * Add the item "o_ptr" to a real stores inventory. + * @param item å¢ããããã¢ã¤ãã ã®ID + * @param num å¢ããããæ° + * @return ãªã + * @details + *
* Increase, by a given amount, the number of a certain item * in a certain store. This can result in zero items. + *+ * @todo numã¯æ¬æ¥ITEM_NUMBERåã«ãããã */ -static void store_item_increase(int item, int num) +static void store_item_increase(INVENTORY_IDX item, int num) { int cnt; object_type *o_ptr; - /* Get the item */ o_ptr = &st_ptr->stock[item]; /* Verify the number */ @@ -1766,19 +1941,21 @@ static void store_item_increase(int item, int num) num = cnt - o_ptr->number; /* Save the new number */ - o_ptr->number += num; + o_ptr->number += (ITEM_NUMBER)num; } -/* +/*! + * @brief åºèã®ãªãã¸ã§ã¯ãæ°ãåé¤ãã / * Remove a slot if it is empty + * @param item åé¤ãããã¢ã¤ãã ã®ID + * @return ãªã */ -static void store_item_optimize(int item) +static void store_item_optimize(INVENTORY_IDX item) { int j; object_type *o_ptr; - /* Get the item */ o_ptr = &st_ptr->stock[item]; /* Must exist */ @@ -1800,18 +1977,23 @@ static void store_item_optimize(int item) object_wipe(&st_ptr->stock[j]); } - -/* +/*! + * @brief ãã©ãã¯ãã¼ã±ããç¨ã®ç¡ä¾¡å¤åã®æé¤å¤å® / * This function will keep 'crap' out of the black market. + * @param o_ptr å¤å®ããããªãã¸ã§ã¯ãã®æ§é ä½åç §ãã¤ã³ã¿ + * @return ãã©ãã¯ãã¼ã±ããã«ã¨ã£ã¦ç¡ä¾¡å¤ãªåãªãã°TRUEãè¿ã + * @details + *
* Crap is defined as any item that is "available" elsewhere * Based on a suggestion by "Lee Vogt"*/ static bool black_market_crap(object_type *o_ptr) { int i, j; /* Ego items are never crap */ - if (o_ptr->name2) return (FALSE); + if (object_is_ego(o_ptr)) return (FALSE); /* Good items are never crap */ if (o_ptr->to_a > 0) return (FALSE); @@ -1839,16 +2021,22 @@ static bool black_market_crap(object_type *o_ptr) } -/* +/*! + * @brief åºèã®åæãå¤åã®ããã«ã¢ã¤ãã ãåé¤ãã / * Attempt to delete (some of) a random item from the store + * @return ãªã + * @details + *+ *
* Hack -- we attempt to "maintain" piles of items when possible. + **/ static void store_delete(void) { - int what, num; + INVENTORY_IDX what; + int num; /* Pick a random slot */ - what = randint0(st_ptr->stock_num); + what = (INVENTORY_IDX)randint0(st_ptr->stock_num); /* Determine how many items are here */ num = st_ptr->stock[what].number; @@ -1871,20 +2059,25 @@ static void store_delete(void) } -/* +/*! + * @brief åºèã®åæãå¤åã®ããã«ã¢ã¤ãã ã追å ãã / * Creates a random item and gives it to a store + * @return ãªã + * @details + *
* This algorithm needs to be rethought. A lot. * Currently, "normal" stores use a pre-built array. - * * Note -- the "level" given to "obj_get_num()" is a "favored" * level, that is, there is a much higher chance of getting * items with a level approaching that of the given level... - * * Should we check for "permission" to have the given item? + **/ static void store_create(void) { - int i, tries, level; + OBJECT_IDX i; + int tries; + DEPTH level; object_type forge; object_type *q_ptr; @@ -1983,11 +2176,13 @@ static void store_create(void) } - -/* +/*! + * @brief åºèã®å²å¼å¯¾è±¡å¤ã«ãããã©ãããå¤å® / * Eliminate need to bargain if player has haggled well in the past + * @param minprice ã¢ã¤ãã ã®æä½è²©å£²ä¾¡æ ¼ + * @return å²å¼ãç¦æ¢ãããªãTRUEãè¿ãã */ -static bool noneedtobargain(s32b minprice) +static bool noneedtobargain(PRICE minprice) { s32b good = st_ptr->good_buy; s32b bad = st_ptr->bad_buy; @@ -2006,10 +2201,15 @@ static bool noneedtobargain(s32b minprice) } -/* +/*! + * @brief åºä¸»ã®æã¤ãã¬ã¤ã¤ã¼ã«å¯¾ãã売買ã®è¯ãæªãçµé¨ãè¨æ¶ãã / * Update the bargain info + * @param price å®éã®åå¼ä¾¡æ ¼ + * @param minprice åºä¸»ã®æ示ããä¾¡æ ¼ + * @param num å£²è²·æ° + * @return ãªã */ -static void updatebargain(s32b price, s32b minprice, int num) +static void updatebargain(PRICE price, PRICE minprice, int num) { /* Hack -- auto-haggle */ if (!manual_haggle) return; @@ -2039,9 +2239,11 @@ static void updatebargain(s32b price, s32b minprice, int num) } - -/* +/*! + * @brief åºã®ååãªã¹ããå表示ãã / * Re-displays a single store entry + * @param pos è¡¨ç¤ºè¡ + * @return ãªã */ static void display_entry(int pos) { @@ -2052,17 +2254,15 @@ static void display_entry(int pos) char o_name[MAX_NLEN]; char out_val[160]; - int maxwid = 75; - /* Get the item */ o_ptr = &st_ptr->stock[pos]; /* Get the "offset" */ - i = (pos % 12); + i = (pos % store_bottom); /* Label it, clear the line --(-- */ - (void)sprintf(out_val, "%c) ", I2A(i)); + (void)sprintf(out_val, "%c) ", ((i > 25) ? toupper(I2A(i - 26)) : I2A(i))); prt(out_val, i+6, 0); cur_col = 3; @@ -2071,12 +2271,9 @@ static void display_entry(int pos) byte a = object_attr(o_ptr); char c = object_char(o_ptr); -#ifdef AMIGA - if (a & 0x80) - a |= 0x40; -#endif - Term_queue_bigchar(cur_col, i + 6, a, c, 0, 0); + if (use_bigtile) cur_col++; + cur_col += 2; } @@ -2146,7 +2343,7 @@ static void display_entry(int pos) /* Actually draw the price (not fixed) */ #ifdef JP -(void)sprintf(out_val, "%9ld¸Ç", (long)x); +(void)sprintf(out_val, "%9ldåº", (long)x); #else (void)sprintf(out_val, "%9ld F", (long)x); #endif @@ -2182,8 +2379,11 @@ static void display_entry(int pos) } -/* +/*! + * @brief åºã®ååãªã¹ãã表示ãã / * Displays a store's inventory -RAK- + * @return ãªã + * @details * All prices are listed as "per individual object". -BEN- */ static void display_inventory(void) @@ -2191,7 +2391,7 @@ static void display_inventory(void) int i, k; /* Display the next 12 items */ - for (k = 0; k < 12; k++) + for (k = 0; k < store_bottom; k++) { /* Do not display "dead" items */ if (store_top + k >= st_ptr->stock_num) break; @@ -2201,7 +2401,7 @@ static void display_inventory(void) } /* Erase the extra lines and the "more" prompt */ - for (i = k; i < 13; i++) prt("", i + 6, 0); + for (i = k; i < store_bottom + 1; i++) prt("", i + 6, 0); /* Assume "no current page" */ #ifdef JP @@ -2212,11 +2412,11 @@ static void display_inventory(void) /* Visual reminder of "more items" */ - if (st_ptr->stock_num > 12) + if (st_ptr->stock_num > store_bottom) { /* Show "more" reminder (after the last item) */ #ifdef JP - prt("-³¤¯-", k + 6, 3); + prt("-ç¶ã-", k + 6, 3); #else prt("-more-", k + 6, 3); #endif @@ -2225,36 +2425,53 @@ static void display_inventory(void) /* Indicate the "current page" */ /* Trailing spaces are to display (Page xx) and (Page x) */ #ifdef JP - put_str(format("(%d¥Ú¡¼¥¸) ", store_top/12 + 1), 5, 20); + put_str(format("(%dãã¼ã¸) ", store_top/store_bottom + 1), 5, 20); #else - put_str(format("(Page %d) ", store_top/12 + 1), 5, 20); + put_str(format("(Page %d) ", store_top/store_bottom + 1), 5, 20); #endif } + + if (cur_store_num == STORE_HOME || cur_store_num == STORE_MUSEUM) + { + k = st_ptr->stock_size; + + if (cur_store_num == STORE_HOME && !powerup_home) k /= 10; +#ifdef JP + put_str(format("ã¢ã¤ãã æ°: %4d/%4d", st_ptr->stock_num, k), 19 + xtra_stock, 27); +#else + put_str(format("Objects: %4d/%4d", st_ptr->stock_num, k), 19 + xtra_stock, 30); +#endif + } } -/* +/*! + * @brief ãã¬ã¤ã¤ã¼ã®ææéã表示ãã / * Displays players gold -RAK- + * @return ãªã + * @details */ static void store_prt_gold(void) { char out_val[64]; #ifdef JP - prt("¼ê»ý¤Á¤Î¤ª¶â: ", 19, 53); + prt("ææã¡ã®ãé: ", 19 + xtra_stock, 53); #else - prt("Gold Remaining: ", 19, 53); + prt("Gold Remaining: ", 19 + xtra_stock, 53); #endif sprintf(out_val, "%9ld", (long)p_ptr->au); - prt(out_val, 19, 68); + prt(out_val, 19 + xtra_stock, 68); } - -/* +/*! + * @brief åºèæ å ±å ¨ä½ã表示ããã¡ã¤ã³ã«ã¼ãã³ / * Displays store (after clearing screen) -RAK- + * @return ãªã + * @details */ static void display_store(void) { @@ -2269,7 +2486,7 @@ static void display_store(void) { /* Put the owner name */ #ifdef JP - put_str("²æ¤¬²È", 3, 31); + put_str("æã家", 3, 31); #else put_str("Your Home", 3, 30); #endif @@ -2277,7 +2494,7 @@ static void display_store(void) /* Label the item descriptions */ #ifdef JP - put_str("¥¢¥¤¥Æ¥à¤Î°ìÍ÷", 5, 4); + put_str("ã¢ã¤ãã ã®ä¸è¦§", 5, 4); #else put_str("Item Description", 5, 3); #endif @@ -2287,7 +2504,7 @@ static void display_store(void) if (show_weights) { #ifdef JP - put_str("½Å¤µ", 5, 72); + put_str("éã", 5, 72); #else put_str("Weight", 5, 70); #endif @@ -2300,7 +2517,7 @@ static void display_store(void) { /* Put the owner name */ #ifdef JP - put_str("Çîʪ´Û", 3, 31); + put_str("åç©é¤¨", 3, 31); #else put_str("Museum", 3, 30); #endif @@ -2308,7 +2525,7 @@ static void display_store(void) /* Label the item descriptions */ #ifdef JP - put_str("¥¢¥¤¥Æ¥à¤Î°ìÍ÷", 5, 4); + put_str("ã¢ã¤ãã ã®ä¸è¦§", 5, 4); #else put_str("Item Description", 5, 3); #endif @@ -2318,7 +2535,7 @@ static void display_store(void) if (show_weights) { #ifdef JP - put_str("½Å¤µ", 5, 72); + put_str("éã", 5, 72); #else put_str("Weight", 5, 70); #endif @@ -2329,7 +2546,7 @@ static void display_store(void) /* Normal stores */ else { - cptr store_name = (f_name + f_info[FEAT_SHOP_HEAD + cur_store_num].name); + cptr store_name = (f_name + f_info[cur_store_feat].name); cptr owner_name = (ot_ptr->owner_name); cptr race_name = race_info[ot_ptr->owner_race].title; @@ -2343,7 +2560,7 @@ static void display_store(void) /* Label the item descriptions */ #ifdef JP - put_str("¾¦ÉʤΰìÍ÷", 5, 7); + put_str("ååã®ä¸è¦§", 5, 7); #else put_str("Item Description", 5, 3); #endif @@ -2353,7 +2570,7 @@ static void display_store(void) if (show_weights) { #ifdef JP - put_str("½Å¤µ", 5, 62); + put_str("éã", 5, 62); #else put_str("Weight", 5, 60); #endif @@ -2362,7 +2579,7 @@ static void display_store(void) /* Label the asking price (in stores) */ #ifdef JP - put_str("²Á³Ê", 5, 73); + put_str("ä¾¡æ ¼", 5, 73); #else put_str("Price", 5, 72); #endif @@ -2378,16 +2595,20 @@ static void display_store(void) -/* +/*! + * @brief åºèããã¢ã¤ãã ãé¸æãã / * Get the ID of a store item and return its value -RAK- + * @param com_val é¸æIDãè¿ãåç §ãã¤ã³ã¿ + * @param pmt ã¡ãã»ã¼ã¸ãã£ãã·ã§ã³ + * @param i é¸æç¯å²ã®æå°å¤ + * @param j é¸æç¯å²ã®æå¤§å¤ + * @return å®éã«é¸æãããTRUEããã£ã³ã»ã«ãããFALSE */ -static int get_stock(int *com_val, cptr pmt, int i, int j) +static int get_stock(COMMAND_CODE *com_val, cptr pmt, int i, int j) { char command; - char out_val[160]; - -#ifdef ALLOW_REPEAT /* TNB */ + char lo, hi; /* Get the item index */ if (repeat_pull(com_val)) @@ -2400,9 +2621,7 @@ static int get_stock(int *com_val, cptr pmt, int i, int j) } } -#endif /* ALLOW_REPEAT -- TNB */ - - /* Paranoia XXX XXX XXX */ + /* Paranoia */ msg_print(NULL); @@ -2410,26 +2629,33 @@ static int get_stock(int *com_val, cptr pmt, int i, int j) *com_val = (-1); /* Build the prompt */ + lo = I2A(i); + hi = (j > 25) ? toupper(I2A(j - 26)) : I2A(j); #ifdef JP - (void)sprintf(out_val, "(%s:%c-%c, ESC¤ÇÃæÃÇ) %s", - (((cur_store_num == STORE_HOME) || (cur_store_num == STORE_MUSEUM)) ? "¥¢¥¤¥Æ¥à" : "¾¦ÉÊ"), - I2A(i), I2A(j), pmt); + (void)sprintf(out_val, "(%s:%c-%c, ESCã§ä¸æ) %s", + (((cur_store_num == STORE_HOME) || (cur_store_num == STORE_MUSEUM)) ? "ã¢ã¤ãã " : "åå"), + lo, hi, pmt); #else (void)sprintf(out_val, "(Items %c-%c, ESC to exit) %s", - I2A(i), I2A(j), pmt); + lo, hi, pmt); #endif /* Ask until done */ while (TRUE) { - int k; + COMMAND_CODE k; /* Escape */ if (!get_com(out_val, &command, FALSE)) break; /* Convert */ - k = (islower(command) ? A2I(command) : -1); + if (islower(command)) + k = A2I(command); + else if (isupper(command)) + k = A2I(tolower(command)) + 26; + else + k = -1; /* Legal responses */ if ((k >= i) && (k <= j)) @@ -2438,7 +2664,6 @@ static int get_stock(int *com_val, cptr pmt, int i, int j) break; } - /* Oops */ bell(); } @@ -2448,19 +2673,17 @@ static int get_stock(int *com_val, cptr pmt, int i, int j) /* Cancel */ if (command == ESCAPE) return (FALSE); -#ifdef ALLOW_REPEAT /* TNB */ - repeat_push(*com_val); -#endif /* ALLOW_REPEAT -- TNB */ - /* Success */ return (TRUE); } -/* +/*! + * @brief åºä¸»ã®ä¸æºåº¦ãå¢ããããã¬ã¤ã¤ã¼ãç· ãåºãå¤å®ã¨å¦çãè¡ã / * Increase the insult counter and get angry if too many -RAK- + * @return ãã¬ã¤ã¤ã¼ãç· ãåºãå ´åTRUEãè¿ã */ static int increase_insults(void) { @@ -2490,8 +2713,10 @@ static int increase_insults(void) } -/* +/*! + * @brief åºä¸»ã®ä¸æºåº¦ãæ¸ãã / * Decrease insults -RAK- + * @return ãã¬ã¤ã¤ã¼ãç· ãåºãå ´åTRUEãè¿ã */ static void decrease_insults(void) { @@ -2500,8 +2725,10 @@ static void decrease_insults(void) } -/* +/*! + * @brief åºä¸»ã®ä¸æºåº¦ãå¢ããå ´åã®ã¿ã®ã¡ãã»ã¼ã¸ã表示ãã / * Have insulted while haggling -RAK- + * @return ãã¬ã¤ã¤ã¼ãç· ãåºãå ´åTRUEãè¿ã */ static int haggle_insults(void) { @@ -2527,10 +2754,16 @@ static bool allow_inc = FALSE; static s32b last_inc = 0L; -/* +/*! + * @brief 交æ¸ä¾¡æ ¼ã確èªã¨èªè¨¼ã®æ¯éãè¡ã / * Get a haggle + * @param pmt ã¡ãã»ã¼ã¸ + * @param poffer å¥éä¾¡æ ¼æ示ãããå ´åã®å¤ãè¿ãåç §ãã¤ã³ã¿ + * @param price ç¾å¨ã®äº¤æ¸ä¾¡æ ¼ + * @param final æçµç¢ºå®ä¾¡æ ¼ãªãã°TRUE + * @return ãã¬ã¤ã¤ã¼ãç· ãåºãå ´åTRUEãè¿ã */ -static int get_haggle(cptr pmt, s32b *poffer, s32b price, int final) +static int get_haggle(cptr pmt, s32b *poffer, PRICE price, int final) { s32b i; @@ -2548,7 +2781,7 @@ static int get_haggle(cptr pmt, s32b *poffer, s32b price, int final) if (final) { #ifdef JP - sprintf(buf, "%s [¾µÂú] ", pmt); + sprintf(buf, "%s [æ¿è«¾] ", pmt); #else sprintf(buf, "%s [accept] ", pmt); #endif @@ -2584,7 +2817,7 @@ static int get_haggle(cptr pmt, s32b *poffer, s32b price, int final) } - /* Paranoia XXX XXX XXX */ + /* Paranoia */ msg_print(NULL); @@ -2664,7 +2897,7 @@ static int get_haggle(cptr pmt, s32b *poffer, s32b price, int final) /* Warning */ #ifdef JP - msg_print("Ãͤ¬¤ª¤«¤·¤¤¤Ç¤¹¡£"); + msg_print("å¤ãããããã§ãã"); #else msg_print("Invalid response."); #endif @@ -2677,14 +2910,21 @@ static int get_haggle(cptr pmt, s32b *poffer, s32b price, int final) } -/* +/*! + * @brief åºä¸»ããã¬ã¤ã¤ã¼ããã®äº¤æ¸ä¾¡æ ¼ãå¤æãã / * Receive an offer (from the player) - * + * @param pmt ã¡ãã»ã¼ã¸ + * @param poffer åºä¸»ããã®äº¤æ¸ä¾¡æ ¼ãè¿ãåç §ãã¤ã³ã¿ + * @param last_offer ç¾å¨ã®äº¤æ¸ä¾¡æ ¼ + * @param factor åºä¸»ã®ä¾¡æ ¼åºæºåç + * @param price ã¢ã¤ãã ã®å®ä¾¡å¤ + * @param final æçµä¾¡æ ¼ç¢ºå®ãªãã°TRUE + * @return ãã¬ã¤ã¤ã¼ã®ä¾¡æ ¼ã«å¯¾ãã¦ä¸æãªãã°TRUEãè¿ã / * Return TRUE if offer is NOT okay */ static bool receive_offer(cptr pmt, s32b *poffer, s32b last_offer, int factor, - s32b price, int final) + PRICE price, int final) { /* Haggle till done */ while (TRUE) @@ -2707,9 +2947,12 @@ static bool receive_offer(cptr pmt, s32b *poffer, } -/* +/*! + * @brief ãã¬ã¤ã¤ã¼ãè³¼å ¥ããæã®å¤åãå¦çã¡ã¤ã³ã«ã¼ãã³ / * Haggling routine -RAK- - * + * @param o_ptr ãªãã¸ã§ã¯ãã®æ§é ä½åç §ãã¤ã³ã¿ + * @param price æçµä¾¡æ ¼ãè¿ãåç §ãã¤ã³ã¿ + * @return ãã¬ã¤ã¤ã¼ã®ä¾¡æ ¼ã«å¯¾ãã¦åºä¸»ãä¸æãªãã°TRUEãè¿ã / * Return TRUE if purchase is NOT successful */ static bool purchase_haggle(object_type *o_ptr, s32b *price) @@ -2724,7 +2967,7 @@ static bool purchase_haggle(object_type *o_ptr, s32b *price) bool cancel = FALSE; #ifdef JP - cptr pmt = "Ä󼨲Á³Ê"; + cptr pmt = "æç¤ºä¾¡æ ¼"; #else cptr pmt = "Asking"; #endif @@ -2751,7 +2994,7 @@ static bool purchase_haggle(object_type *o_ptr, s32b *price) { /* Message summary */ #ifdef JP - msg_print("·ë¶É¤³¤Î¶â³Û¤Ë¤Þ¤È¤Þ¤Ã¤¿¡£"); + msg_print("çµå±ãã®éé¡ã«ã¾ã¨ã¾ã£ãã"); #else msg_print("You eventually agree upon the price."); #endif @@ -2764,7 +3007,7 @@ static bool purchase_haggle(object_type *o_ptr, s32b *price) { /* Message summary */ #ifdef JP - msg_print("¤¹¤ó¤Ê¤ê¤È¤³¤Î¶â³Û¤Ë¤Þ¤È¤Þ¤Ã¤¿¡£"); + msg_print("ãããªãã¨ãã®éé¡ã«ã¾ã¨ã¾ã£ãã"); #else msg_print("You quickly agree upon the price."); #endif @@ -2780,7 +3023,7 @@ static bool purchase_haggle(object_type *o_ptr, s32b *price) /* Go to final offer */ #ifdef JP - pmt = "ºÇ½ªÄ󼨲Á³Ê"; + pmt = "æçµæç¤ºä¾¡æ ¼"; #else pmt = "Final Offer"; #endif @@ -2819,7 +3062,7 @@ static bool purchase_haggle(object_type *o_ptr, s32b *price) (void)sprintf(out_val, "%s : %ld", pmt, (long)cur_ask); put_str(out_val, 1, 0); #ifdef JP - cancel = receive_offer("Ä󼨤¹¤ë¶â³Û? ", + cancel = receive_offer("æ示ããéé¡? ", #else cancel = receive_offer("What do you offer? ", #endif @@ -2874,7 +3117,7 @@ static bool purchase_haggle(object_type *o_ptr, s32b *price) final = TRUE; cur_ask = final_ask; #ifdef JP - pmt = "ºÇ½ªÄ󼨲Á³Ê"; + pmt = "æçµæç¤ºä¾¡æ ¼"; #else pmt = "Final Offer"; #endif @@ -2899,7 +3142,7 @@ static bool purchase_haggle(object_type *o_ptr, s32b *price) allow_inc = TRUE; prt("", 1, 0); #ifdef JP -(void)sprintf(out_val, "Á°²ó¤ÎÄ󼨶â³Û: $%ld", +(void)sprintf(out_val, "ååã®æ示éé¡: $%ld", #else (void)sprintf(out_val, "Your last offer: %ld", #endif @@ -2922,9 +3165,12 @@ static bool purchase_haggle(object_type *o_ptr, s32b *price) } -/* +/*! + * @brief ãã¬ã¤ã¤ã¼ã売å´ããæã®å¤åãå¦çã¡ã¤ã³ã«ã¼ãã³ / * Haggling routine -RAK- - * + * @param o_ptr ãªãã¸ã§ã¯ãã®æ§é ä½åç §ãã¤ã³ã¿ + * @param price æçµä¾¡æ ¼ãè¿ãåç §ãã¤ã³ã¿ + * @return ãã¬ã¤ã¤ã¼ã®ä¾¡æ ¼ã«å¯¾ãã¦åºä¸»ãä¸æãªãã°TRUEãè¿ã / * Return TRUE if purchase is NOT successful */ static bool sell_haggle(object_type *o_ptr, s32b *price) @@ -2937,7 +3183,7 @@ static bool sell_haggle(object_type *o_ptr, s32b *price) int annoyed = 0, final = FALSE; bool cancel = FALSE; #ifdef JP - cptr pmt = "Ä󼨶â³Û"; + cptr pmt = "æ示éé¡"; #else cptr pmt = "Offer"; #endif @@ -2970,9 +3216,8 @@ static bool sell_haggle(object_type *o_ptr, s32b *price) /* No reason to haggle */ if (final_ask >= purse) { - /* Message */ #ifdef JP - msg_print("¨ºÂ¤Ë¤³¤Î¶â³Û¤Ë¤Þ¤È¤Þ¤Ã¤¿¡£"); + msg_print("å³åº§ã«ãã®éé¡ã«ã¾ã¨ã¾ã£ãã"); #else msg_print("You instantly agree upon the price."); #endif @@ -2986,9 +3231,8 @@ static bool sell_haggle(object_type *o_ptr, s32b *price) /* No need to haggle */ else if (noneed) { - /* Message */ #ifdef JP - msg_print("·ë¶É¤³¤Î¶â³Û¤Ë¤Þ¤È¤Þ¤Ã¤¿¡£"); + msg_print("çµå±ãã®éé¡ã«ã¾ã¨ã¾ã£ãã"); #else msg_print("You eventually agree upon the price."); #endif @@ -3001,7 +3245,7 @@ static bool sell_haggle(object_type *o_ptr, s32b *price) { /* Message summary */ #ifdef JP - msg_print("¤¹¤ó¤Ê¤ê¤È¤³¤Î¶â³Û¤Ë¤Þ¤È¤Þ¤Ã¤¿¡£"); + msg_print("ãããªãã¨ãã®éé¡ã«ã¾ã¨ã¾ã£ãã"); #else msg_print("You quickly agree upon the price."); #endif @@ -3015,7 +3259,7 @@ static bool sell_haggle(object_type *o_ptr, s32b *price) /* Final offer */ final = TRUE; #ifdef JP - pmt = "ºÇ½ªÄ󼨶â³Û"; + pmt = "æçµæ示éé¡"; #else pmt = "Final Offer"; #endif @@ -3027,7 +3271,7 @@ static bool sell_haggle(object_type *o_ptr, s32b *price) final_ask *= o_ptr->number; - /* XXX XXX XXX Display commands */ + /* Display commands */ /* Haggling parameters */ min_per = ot_ptr->haggle_per; @@ -3053,7 +3297,7 @@ static bool sell_haggle(object_type *o_ptr, s32b *price) (void)sprintf(out_val, "%s : %ld", pmt, (long)cur_ask); put_str(out_val, 1, 0); #ifdef JP - cancel = receive_offer("Ä󼨤¹¤ë²Á³Ê? ", + cancel = receive_offer("æ示ããä¾¡æ ¼? ", #else cancel = receive_offer("What price do you ask? ", #endif @@ -3111,7 +3355,7 @@ static bool sell_haggle(object_type *o_ptr, s32b *price) cur_ask = final_ask; final = TRUE; #ifdef JP - pmt = "ºÇ½ªÄ󼨶â³Û"; + pmt = "æçµæ示éé¡"; #else pmt = "Final Offer"; #endif @@ -3121,7 +3365,7 @@ static bool sell_haggle(object_type *o_ptr, s32b *price) { flag = TRUE; #ifdef JP - /* Äɲà $0 ¤ÇÇ㤤¼è¤é¤ì¤Æ¤·¤Þ¤¦¤Î¤òËÉ»ß By FIRST*/ + /* 追å $0 ã§è²·ãåããã¦ãã¾ãã®ãé²æ¢ By FIRST*/ cancel = TRUE; #endif (void)(increase_insults()); @@ -3140,7 +3384,7 @@ static bool sell_haggle(object_type *o_ptr, s32b *price) prt("", 1, 0); (void)sprintf(out_val, #ifdef JP - "Á°²ó¤ÎÄ󼨲Á³Ê $%ld", (long)last_offer); + "ååã®æç¤ºä¾¡æ ¼ $%ld", (long)last_offer); #else "Your last bid %ld", (long)last_offer); #endif @@ -3162,15 +3406,19 @@ static bool sell_haggle(object_type *o_ptr, s32b *price) } -/* +/*! + * @brief åºããã®è³¼å ¥å¦çã®ã¡ã¤ã³ã«ã¼ãã³ / * Buy an item from a store -RAK- + * @return ãªã */ static void store_purchase(void) { - int i, amt, choice; - int item, item_new; + int i, choice; + COMMAND_CODE item, item_new; + + ITEM_NUMBER amt; - s32b price, best; + PRICE price, best; object_type forge; object_type *j_ptr; @@ -3181,11 +3429,10 @@ static void store_purchase(void) char out_val[160]; - if (cur_store_num == STORE_MUSEUM) { #ifdef JP - msg_print("Çîʪ´Û¤«¤é¼è¤ê½Ð¤¹¤³¤È¤Ï¤Ç¤¤Þ¤»¤ó¡£"); + msg_print("åç©é¤¨ããåãåºããã¨ã¯ã§ãã¾ããã"); #else msg_print("Museum."); #endif @@ -3197,14 +3444,14 @@ static void store_purchase(void) { if (cur_store_num == STORE_HOME) #ifdef JP - msg_print("²æ¤¬²È¤Ë¤Ï²¿¤âÃÖ¤¤¤Æ¤¢¤ê¤Þ¤»¤ó¡£"); + msg_print("æã家ã«ã¯ä½ãç½®ãã¦ããã¾ããã"); #else msg_print("Your home is empty."); #endif else #ifdef JP - msg_print("¸½ºß¾¦Éʤκ߸ˤòÀڤ餷¤Æ¤¤¤Þ¤¹¡£"); + msg_print("ç¾å¨ååã®å¨åº«ãåããã¦ãã¾ãã"); #else msg_print("I am currently out of stock."); #endif @@ -3217,20 +3464,20 @@ static void store_purchase(void) i = (st_ptr->stock_num - store_top); /* And then restrict it to the current page */ - if (i > 12) i = 12; + if (i > store_bottom) i = store_bottom; /* Prompt */ #ifdef JP - /* ¥Ö¥é¥Ã¥¯¥Þ¡¼¥±¥Ã¥È¤Î»þ¤ÏÊ̤Υá¥Ã¥»¡¼¥¸ */ + /* ãã©ãã¯ãã¼ã±ããã®æã¯å¥ã®ã¡ãã»ã¼ã¸ */ switch( cur_store_num ) { case 7: - sprintf(out_val, "¤É¤Î¥¢¥¤¥Æ¥à¤ò¼è¤ê¤Þ¤¹¤«? "); + sprintf(out_val, "ã©ã®ã¢ã¤ãã ãåãã¾ãã? "); break; case 6: - sprintf(out_val, "¤É¤ì? "); + sprintf(out_val, "ã©ã? "); break; default: - sprintf(out_val, "¤É¤ÎÉÊʪ¤¬Íߤ·¤¤¤ó¤À¤¤? "); + sprintf(out_val, "ã©ã®åç©ã欲ãããã ã? "); break; } #else @@ -3276,7 +3523,7 @@ static void store_purchase(void) if (!inven_carry_okay(j_ptr)) { #ifdef JP -msg_print("¤½¤ó¤Ê¤Ë¥¢¥¤¥Æ¥à¤ò»ý¤Æ¤Ê¤¤¡£"); +msg_print("ãããªã«ã¢ã¤ãã ãæã¦ãªãã"); #else msg_print("You cannot carry that many different items."); #endif @@ -3295,7 +3542,7 @@ msg_print(" (o_ptr->ident & IDENT_FIXED)) { #ifdef JP -msg_format("°ì¤Ä¤Ë¤Ä¤ $%ld¤Ç¤¹¡£", (long)(best)); +msg_format("ä¸ã¤ã«ã¤ã $%ldã§ãã", (long)(best)); #else msg_format("That costs %ld gold per item.", (long)(best)); #endif @@ -3328,7 +3575,7 @@ msg_format(" if (!inven_carry_okay(j_ptr)) { #ifdef JP - msg_print("¥¶¥Ã¥¯¤Ë¤½¤Î¥¢¥¤¥Æ¥à¤òÆþ¤ì¤ë·ä´Ö¤¬¤Ê¤¤¡£"); + msg_print("ã¶ãã¯ã«ãã®ã¢ã¤ãã ãå ¥ããééããªãã"); #else msg_print("You cannot carry that many items."); #endif @@ -3355,9 +3602,8 @@ msg_format(" /* Describe the object (fully) */ object_desc(o_name, j_ptr, 0); - /* Message */ #ifdef JP -msg_format("%s(%c)¤ò¹ØÆþ¤¹¤ë¡£", o_name, I2A(item)); + msg_format("%s(%c)ãè³¼å ¥ããã", o_name, I2A(item)); #else msg_format("Buying %s (%c).", o_name, I2A(item)); #endif @@ -3409,9 +3655,8 @@ msg_format("%s(%c) /* Describe the transaction */ object_desc(o_name, j_ptr, 0); - /* Message */ #ifdef JP -msg_format("%s¤ò $%ld¤Ç¹ØÆþ¤·¤Þ¤·¤¿¡£", o_name, (long)price); +msg_format("%sã $%ldã§è³¼å ¥ãã¾ããã", o_name, (long)price); #else msg_format("You bought %s for %ld gold.", o_name, (long)price); #endif @@ -3436,9 +3681,8 @@ msg_format("%s /* Describe the final result */ object_desc(o_name, &inventory[item_new], 0); - /* Message */ #ifdef JP - msg_format("%s(%c)¤ò¼ê¤ËÆþ¤ì¤¿¡£", o_name, index_to_label(item_new)); + msg_format("%s(%c)ãæã«å ¥ããã", o_name, index_to_label(item_new)); #else msg_format("You have %s (%c).", o_name, index_to_label(item_new)); @@ -3470,9 +3714,8 @@ msg_format("%s if (one_in_(STORE_SHUFFLE)) { char buf[80]; - /* Message */ #ifdef JP - msg_print("Ź¼ç¤Ï°úÂष¤¿¡£"); + msg_print("åºä¸»ã¯å¼éããã"); #else msg_print("The shopkeeper retires."); #endif @@ -3486,16 +3729,15 @@ msg_format("%s ot_ptr->owner_name, race_info[ot_ptr->owner_race].title); put_str(buf, 3, 10); sprintf(buf, "%s (%ld)", - (f_name + f_info[FEAT_SHOP_HEAD + cur_store_num].name), (long)(ot_ptr->max_cost)); + (f_name + f_info[cur_store_feat].name), (long)(ot_ptr->max_cost)); prt(buf, 3, 50); } /* Maintain */ else { - /* Message */ #ifdef JP - msg_print("Ź¼ç¤Ï¿·¤¿¤Êºß¸Ë¤ò¼è¤ê½Ð¤·¤¿¡£"); + msg_print("åºä¸»ã¯æ°ããªå¨åº«ãåãåºããã"); #else msg_print("The shopkeeper brings out some new stock."); #endif @@ -3520,7 +3762,7 @@ msg_format("%s else if (st_ptr->stock_num != i) { /* Pick the correct screen */ - if (store_top >= st_ptr->stock_num) store_top -= 12; + if (store_top >= st_ptr->stock_num) store_top -= store_bottom; /* Redraw everything */ display_inventory(); @@ -3539,7 +3781,7 @@ msg_format("%s { /* Simple message (no insult) */ #ifdef JP - msg_print("¤ª¶â¤¬Â¤ê¤Þ¤»¤ó¡£"); + msg_print("ãéã足ãã¾ããã"); #else msg_print("You do not have enough gold."); #endif @@ -3551,6 +3793,8 @@ msg_format("%s /* Home is much easier */ else { + bool combined_or_reordered; + /* Distribute charges of wands/rods */ distribute_charges(o_ptr, j_ptr, amt); @@ -3560,9 +3804,8 @@ msg_format("%s /* Describe just the result */ object_desc(o_name, &inventory[item_new], 0); - /* Message */ #ifdef JP - msg_format("%s(%c)¤ò¼è¤Ã¤¿¡£", + msg_format("%s(%c)ãåã£ãã", #else msg_format("You have %s (%c).", #endif @@ -3578,11 +3821,16 @@ msg_format("%s store_item_increase(item, -amt); store_item_optimize(item); + combined_or_reordered = combine_and_reorder_home(STORE_HOME); + /* Hack -- Item is still here */ if (i == st_ptr->stock_num) { + /* Redraw everything */ + if (combined_or_reordered) display_inventory(); + /* Redraw the item */ - display_entry(item); + else display_entry(item); } /* The item is gone */ @@ -3592,7 +3840,7 @@ msg_format("%s if (st_ptr->stock_num == 0) store_top = 0; /* Nothing left on that screen */ - else if (store_top >= st_ptr->stock_num) store_top -= 12; + else if (store_top >= st_ptr->stock_num) store_top -= store_bottom; /* Redraw everything */ display_inventory(); @@ -3606,16 +3854,19 @@ msg_format("%s } -/* +/*! + * @brief åºããã®å£²å´å¦çã®ã¡ã¤ã³ã«ã¼ãã³ / * Sell an item to the store (or home) + * @return ãªã */ static void store_sell(void) { int choice; - int item, item_pos; + OBJECT_IDX item; + int item_pos; int amt; - s32b price, value, dummy; + PRICE price, value, dummy; object_type forge; object_type *q_ptr; @@ -3630,21 +3881,21 @@ static void store_sell(void) /* Prepare a prompt */ if (cur_store_num == STORE_HOME) #ifdef JP - q = "¤É¤Î¥¢¥¤¥Æ¥à¤òÃÖ¤¤Þ¤¹¤«? "; + q = "ã©ã®ã¢ã¤ãã ãç½®ãã¾ãã? "; #else q = "Drop which item? "; #endif else if (cur_store_num == STORE_MUSEUM) #ifdef JP - q = "¤É¤Î¥¢¥¤¥Æ¥à¤ò´ó£¤·¤Þ¤¹¤«? "; + q = "ã©ã®ã¢ã¤ãã ãå¯è´ãã¾ãã? "; #else q = "Give which item? "; #endif else #ifdef JP - q = "¤É¤Î¥¢¥¤¥Æ¥à¤òÇä¤ê¤Þ¤¹¤«? "; + q = "ã©ã®ã¢ã¤ãã ã売ãã¾ãã? "; #else q = "Sell which item? "; #endif @@ -3654,12 +3905,11 @@ static void store_sell(void) /* Only allow items the store will buy */ item_tester_hook = store_will_buy; - /* Get an item */ - /* ²æ¤¬²È¤Ç¤ª¤«¤·¤Ê¥á¥Ã¥»¡¼¥¸¤¬½Ð¤ë¥ª¥ê¥¸¥Ê¥ë¤Î¥Ð¥°¤ò½¤Àµ */ + /* æã家ã§ããããªã¡ãã»ã¼ã¸ãåºããªãªã¸ãã«ã®ãã°ãä¿®æ£ */ if (cur_store_num == STORE_HOME) { #ifdef JP - s = "ÃÖ¤±¤ë¥¢¥¤¥Æ¥à¤ò»ý¤Ã¤Æ¤¤¤Þ¤»¤ó¡£"; + s = "ç½®ããã¢ã¤ãã ãæã£ã¦ãã¾ããã"; #else s = "You don't have any item to drop."; #endif @@ -3667,7 +3917,7 @@ static void store_sell(void) else if (cur_store_num == STORE_MUSEUM) { #ifdef JP - s = "´ó£¤Ç¤¤ë¥¢¥¤¥Æ¥à¤ò»ý¤Ã¤Æ¤¤¤Þ¤»¤ó¡£"; + s = "å¯è´ã§ããã¢ã¤ãã ãæã£ã¦ãã¾ããã"; #else s = "You don't have any item to give."; #endif @@ -3675,7 +3925,7 @@ static void store_sell(void) else { #ifdef JP - s = "Íߤ·¤¤Êª¤¬¤Ê¤¤¤Ç¤¹¤Í¤¨¡£"; + s = "欲ããç©ããªãã§ãããã"; #else s = "You have nothing that I want."; #endif @@ -3697,17 +3947,15 @@ static void store_sell(void) /* Hack -- Cannot remove cursed items */ - if ((item >= INVEN_RARM) && cursed_p(o_ptr)) + if ((item >= INVEN_RARM) && object_is_cursed(o_ptr)) { - /* Oops */ #ifdef JP - msg_print("¤Õ¡¼¤à¡¢¤É¤¦¤ä¤é¤½¤ì¤Ï¼ö¤ï¤ì¤Æ¤¤¤ë¤è¤¦¤À¤Í¡£"); + msg_print("ãµã¼ããã©ãããããã¯åªããã¦ããããã ãã"); #else msg_print("Hmmm, it seems to be cursed."); #endif - /* Nope */ return; } @@ -3758,21 +4006,21 @@ static void store_sell(void) { if (cur_store_num == STORE_HOME) #ifdef JP - msg_print("²æ¤¬²È¤Ë¤Ï¤â¤¦ÃÖ¤¯¾ì½ê¤¬¤Ê¤¤¡£"); + msg_print("æã家ã«ã¯ããç½®ãå ´æããªãã"); #else msg_print("Your home is full."); #endif else if (cur_store_num == STORE_MUSEUM) #ifdef JP - msg_print("Çîʪ´Û¤Ï¤â¤¦ËþÇÕ¤À¡£"); + msg_print("åç©é¤¨ã¯ããæºæ¯ã ã"); #else msg_print("Museum is full."); #endif else #ifdef JP - msg_print("¤¹¤¤¤Þ¤»¤ó¤¬¡¢Å¹¤Ë¤Ï¤â¤¦ÃÖ¤¯¾ì½ê¤¬¤¢¤ê¤Þ¤»¤ó¡£"); + msg_print("ããã¾ããããåºã«ã¯ããç½®ãå ´æãããã¾ããã"); #else msg_print("I have not the room in my store to keep it."); #endif @@ -3786,7 +4034,7 @@ static void store_sell(void) { /* Describe the transaction */ #ifdef JP - msg_format("%s(%c)¤òÇäµÑ¤¹¤ë¡£", o_name, index_to_label(item)); + msg_format("%s(%c)ã売å´ããã", o_name, index_to_label(item)); #else msg_format("Selling %s (%c).", o_name, index_to_label(item)); #endif @@ -3857,7 +4105,7 @@ static void store_sell(void) /* Describe the result (in message buffer) */ #ifdef JP -msg_format("%s¤ò $%ld¤ÇÇäµÑ¤·¤Þ¤·¤¿¡£", o_name, (long)price); +msg_format("%sã $%ldã§å£²å´ãã¾ããã", o_name, (long)price); #else msg_format("You sold %s for %ld gold.", o_name, (long)price); #endif @@ -3898,7 +4146,7 @@ msg_format("%s /* Re-display if item is now in store */ if (item_pos >= 0) { - store_top = (item_pos / 12) * 12; + store_top = (item_pos / store_bottom) * store_bottom; display_inventory(); } } @@ -3913,7 +4161,7 @@ msg_format("%s if (-1 == store_check_num(q_ptr)) { #ifdef JP - msg_print("¤½¤ì¤ÈƱ¤¸ÉÊʪ¤Ï´û¤ËÇîʪ´Û¤Ë¤¢¤ë¤è¤¦¤Ç¤¹¡£"); + msg_print("ããã¨åãåç©ã¯æ¢ã«åç©é¤¨ã«ããããã§ãã"); #else msg_print("The same object as it is already in the Museum."); #endif @@ -3921,13 +4169,13 @@ msg_format("%s else { #ifdef JP - msg_print("Çîʪ´Û¤Ë´ó£¤·¤¿¤â¤Î¤Ï¼è¤ê½Ð¤¹¤³¤È¤¬¤Ç¤¤Þ¤»¤ó¡ª¡ª"); + msg_print("åç©é¤¨ã«å¯è´ãããã®ã¯åãåºããã¨ãã§ãã¾ããï¼ï¼"); #else msg_print("You cannot take items which is given to the Museum back!!"); #endif } #ifdef JP - if (!get_check(format("ËÜÅö¤Ë%s¤ò´ó£¤·¤Þ¤¹¤«¡©", o2_name))) return; + if (!get_check(format("æ¬å½ã«%sãå¯è´ãã¾ããï¼", o2_name))) return; #else if (!get_check(format("Really give %s to the Museum? ", o2_name))) return; #endif @@ -3941,7 +4189,7 @@ msg_format("%s /* Describe */ #ifdef JP - msg_format("%s¤òÃÖ¤¤¤¿¡£(%c)", o_name, index_to_label(item)); + msg_format("%sãç½®ããã(%c)", o_name, index_to_label(item)); #else msg_format("You drop %s (%c).", o_name, index_to_label(item)); #endif @@ -3962,7 +4210,7 @@ msg_format("%s /* Update store display */ if (item_pos >= 0) { - store_top = (item_pos / 12) * 12; + store_top = (item_pos / store_bottom) * store_bottom; display_inventory(); } } @@ -3974,7 +4222,7 @@ msg_format("%s /* Describe */ #ifdef JP - msg_format("%s¤òÃÖ¤¤¤¿¡£(%c)", o_name, index_to_label(item)); + msg_format("%sãç½®ããã(%c)", o_name, index_to_label(item)); #else msg_format("You drop %s (%c).", o_name, index_to_label(item)); #endif @@ -3995,22 +4243,28 @@ msg_format("%s /* Update store display */ if (item_pos >= 0) { - store_top = (item_pos / 12) * 12; + store_top = (item_pos / store_bottom) * store_bottom; display_inventory(); } } - if (item >= INVEN_RARM) calc_android_exp(); - if ((choice == 0) && ((item == INVEN_RARM) || (item == INVEN_LARM))) kamaenaoshi(item); + + if ((choice == 0) && (item >= INVEN_RARM)) + { + calc_android_exp(); + kamaenaoshi(item); + } } -/* +/*! + * @brief åºã®ã¢ã¤ãã ã調ã¹ãã³ãã³ãã®ã¡ã¤ã³ã«ã¼ãã³ / * Examine an item in a store -JDL- + * @return ãªã */ static void store_examine(void) { int i; - int item; + COMMAND_CODE item; object_type *o_ptr; char o_name[MAX_NLEN]; char out_val[160]; @@ -4021,21 +4275,21 @@ static void store_examine(void) { if (cur_store_num == STORE_HOME) #ifdef JP - msg_print("²æ¤¬²È¤Ë¤Ï²¿¤âÃÖ¤¤¤Æ¤¢¤ê¤Þ¤»¤ó¡£"); + msg_print("æã家ã«ã¯ä½ãç½®ãã¦ããã¾ããã"); #else msg_print("Your home is empty."); #endif else if (cur_store_num == STORE_MUSEUM) #ifdef JP - msg_print("Çîʪ´Û¤Ë¤Ï²¿¤âÃÖ¤¤¤Æ¤¢¤ê¤Þ¤»¤ó¡£"); + msg_print("åç©é¤¨ã«ã¯ä½ãç½®ãã¦ããã¾ããã"); #else msg_print("Museum is empty."); #endif else #ifdef JP - msg_print("¸½ºß¾¦Éʤκ߸ˤòÀڤ餷¤Æ¤¤¤Þ¤¹¡£"); + msg_print("ç¾å¨ååã®å¨åº«ãåããã¦ãã¾ãã"); #else msg_print("I am currently out of stock."); #endif @@ -4048,11 +4302,11 @@ static void store_examine(void) i = (st_ptr->stock_num - store_top); /* And then restrict it to the current page */ - if (i > 12) i = 12; + if (i > store_bottom) i = store_bottom; /* Prompt */ #ifdef JP -sprintf(out_val, "¤É¤ì¤òÄ´¤Ù¤Þ¤¹¤«¡©"); +sprintf(out_val, "ã©ãã調ã¹ã¾ããï¼"); #else sprintf(out_val, "Which item do you want to examine? "); #endif @@ -4072,7 +4326,7 @@ sprintf(out_val, " { /* This can only happen in the home */ #ifdef JP -msg_print("¤³¤Î¥¢¥¤¥Æ¥à¤Ë¤Ä¤¤¤ÆÆäËÃΤäƤ¤¤ë¤³¤È¤Ï¤Ê¤¤¡£"); +msg_print("ãã®ã¢ã¤ãã ã«ã¤ãã¦ç¹ã«ç¥ã£ã¦ãããã¨ã¯ãªãã"); #else msg_print("You have no special knowledge about that item."); #endif @@ -4085,16 +4339,16 @@ msg_print(" /* Describe */ #ifdef JP -msg_format("%s¤òÄ´¤Ù¤Æ¤¤¤ë...", o_name); +msg_format("%sã調ã¹ã¦ãã...", o_name); #else msg_format("Examining %s...", o_name); #endif /* Describe it fully */ - if (!screen_object(o_ptr, TRUE)) + if (!screen_object(o_ptr, SCROBJ_FORCE_DETAIL)) #ifdef JP -msg_print("ÆäËÊѤï¤Ã¤¿¤È¤³¤í¤Ï¤Ê¤¤¤è¤¦¤À¡£"); +msg_print("ç¹ã«å¤ãã£ãã¨ããã¯ãªãããã ã"); #else msg_print("You see nothing special."); #endif @@ -4104,29 +4358,114 @@ msg_print(" } +/*! + * @brief åç©é¤¨ã®ã¢ã¤ãã ãé¤å»ããã³ãã³ãã®ã¡ã¤ã³ã«ã¼ãã³ / + * Remove an item from museum (Originally from TOband) + * @return ãªã + */ +static void museum_remove_object(void) +{ + int i; + COMMAND_CODE item; + object_type *o_ptr; + 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 + + return; + } + + /* Find the number of objects on this and following pages */ + i = st_ptr->stock_num - store_top; + + /* And then restrict it to the current page */ + 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 + + /* Get the item number to be removed */ + if (!get_stock(&item, out_val, 0, i - 1)) return; + + /* Get the actual index */ + item = item + store_top; + + /* 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 + +#ifdef JP + msg_format("%sã®å±ç¤ºããããããã", o_name); +#else + msg_format("You ordered to remove %s.", o_name); +#endif + + /* Remove the items from the home */ + store_item_increase(item, -o_ptr->number); + store_item_optimize(item); + + (void)combine_and_reorder_home(STORE_MUSEUM); + + /* The item is gone */ + + /* Nothing left */ + if (st_ptr->stock_num == 0) store_top = 0; + + /* Nothing left on that screen */ + else if (store_top >= st_ptr->stock_num) store_top -= store_bottom; + + /* Redraw everything */ + display_inventory(); + + return; +} + + /* * Hack -- set this to leave the store */ static bool leave_store = FALSE; -/* +/*! + * @brief åºèå¦çã³ãã³ãé¸æã®ã¡ã¤ã³ã«ã¼ãã³ / * Process a command in a store - * + * @return ãªã + * @note + *
* Note that we must allow the use of a few "special" commands * in the stores which are not allowed in the dungeon, and we * must disable some commands which are allowed in the dungeon * but not in the stores, to prevent chaos. + **/ 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! */ @@ -4142,23 +4481,23 @@ static void store_process_command(void) break; } - /* ÆüËܸìÈÇÄɲà */ - /* 1 ¥Ú¡¼¥¸Ìá¤ë¥³¥Þ¥ó¥É: ²æ¤¬²È¤Î¥Ú¡¼¥¸¿ô¤¬Â¿¤¤¤Î¤Ç½ÅÊõ¤¹¤ë¤Ï¤º By BUG */ + /* æ¥æ¬èªç追å */ + /* 1 ãã¼ã¸æ»ãã³ãã³ã: æã家ã®ãã¼ã¸æ°ãå¤ãã®ã§éå®ããã¯ã By BUG */ case '-': { - if (st_ptr->stock_num <= 12) { + if (st_ptr->stock_num <= store_bottom) { #ifdef JP - msg_print("¤³¤ì¤ÇÁ´Éô¤Ç¤¹¡£"); + msg_print("ããã§å ¨é¨ã§ãã"); #else msg_print("Entire inventory is shown."); #endif } else{ - store_top -= 12; + store_top -= store_bottom; if ( store_top < 0 ) - store_top = ((st_ptr->stock_num - 1 )/12) * 12; + store_top = ((st_ptr->stock_num - 1 )/store_bottom) * store_bottom; if ( (cur_store_num == STORE_HOME) && (powerup_home == FALSE) ) - if ( store_top >= 12 ) store_top = 12; + if ( store_top >= store_bottom ) store_top = store_bottom; display_inventory(); } break; @@ -4167,10 +4506,10 @@ static void store_process_command(void) /* Browse */ case ' ': { - if (st_ptr->stock_num <= 12) + if (st_ptr->stock_num <= store_bottom) { #ifdef JP - msg_print("¤³¤ì¤ÇÁ´Éô¤Ç¤¹¡£"); + msg_print("ããã§å ¨é¨ã§ãã"); #else msg_print("Entire inventory is shown."); #endif @@ -4178,10 +4517,10 @@ static void store_process_command(void) } else { - store_top += 12; + store_top += store_bottom; /* - * ±£¤·¥ª¥×¥·¥ç¥ó(powerup_home)¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¤È¤¤Ï - * ²æ¤¬²È¤Ç¤Ï 2 ¥Ú¡¼¥¸¤Þ¤Ç¤·¤«É½¼¨¤·¤Ê¤¤ + * é ããªãã·ã§ã³(powerup_home)ãã»ããããã¦ããªãã¨ã㯠+ * æã家ã§ã¯ 2 ãã¼ã¸ã¾ã§ãã表示ããªã */ if ((cur_store_num == STORE_HOME) && (powerup_home == FALSE) && @@ -4298,7 +4637,18 @@ static void store_process_command(void) /* Browse a book */ case 'b': { - do_cmd_browse(); + if ( (p_ptr->pclass == CLASS_MINDCRAFTER) || + (p_ptr->pclass == CLASS_BERSERKER) || + (p_ptr->pclass == CLASS_NINJA) || + (p_ptr->pclass == CLASS_MIRROR_MASTER) + ) do_cmd_mind_browse(); + else if (p_ptr->pclass == CLASS_SMITH) + do_cmd_kaji(TRUE); + else if (p_ptr->pclass == CLASS_MAGIC_EATER) + do_cmd_magic_eater(TRUE, FALSE); + else if (p_ptr->pclass == CLASS_SNIPER) + do_cmd_snipe_browse(); + else do_cmd_browse(); break; } @@ -4394,6 +4744,9 @@ static void store_process_command(void) case '=': { do_cmd_options(); + (void)combine_and_reorder_home(STORE_HOME); + do_cmd_redraw(); + display_store(); break; } @@ -4464,11 +4817,18 @@ static void store_process_command(void) /* Hack -- Unknown command */ default: { + if ((cur_store_num == STORE_MUSEUM) && (command_cmd == 'r')) + { + museum_remove_object(); + } + else + { #ifdef JP - msg_print("¤½¤Î¥³¥Þ¥ó¥É¤ÏŹ¤ÎÃæ¤Ç¤Ï»È¤¨¤Þ¤»¤ó¡£"); + msg_print("ãã®ã³ãã³ãã¯åºã®ä¸ã§ã¯ä½¿ãã¾ããã"); #else - msg_print("That command does not work in stores."); + msg_print("That command does not work in stores."); #endif + } break; } @@ -4476,15 +4836,19 @@ static void store_process_command(void) } -/* - * Enter a store, and interact with it. - * +/*! + * @brief åºèå¦çå ¨ä½ã®ã¡ã¤ã³ã«ã¼ãã³ / + * Enter a store, and interact with it. * + * @return ãªã + * @note + *
* Note that we use the standard "request_command()" function * to get a command, allowing us to use "command_arg" and all * command macros and other nifty stuff, but we use the special * "shopping" argument, to force certain commands to be converted * into other commands, normally, we convert "p" (pray) and "m" * (cast magic) into "g" (get), and "s" (search) into "d" (drop). + **/ void do_cmd_store(void) { @@ -4493,18 +4857,23 @@ void do_cmd_store(void) int i; cave_type *c_ptr; bool need_redraw_store_inv; /* To redraw missiles damage and prices in store */ + int w, h; + + /* Get term size */ + Term_get_size(&w, &h); + /* Calculate stocks per 1 page */ + xtra_stock = MIN(14+26, ((h > 24) ? (h - 24) : 0)); + store_bottom = MIN_STOCK + xtra_stock; /* Access the player grid */ - c_ptr = &cave[py][px]; + c_ptr = &cave[p_ptr->y][p_ptr->x]; /* Verify a store */ - if (!((c_ptr->feat >= FEAT_SHOP_HEAD) && - (c_ptr->feat <= FEAT_SHOP_TAIL)) && - (c_ptr->feat != FEAT_MUSEUM)) + if (!cave_have_flag_grid(c_ptr, FF_STORE)) { #ifdef JP - msg_print("¤³¤³¤Ë¤ÏŹ¤¬¤¢¤ê¤Þ¤»¤ó¡£"); + msg_print("ããã«ã¯åºãããã¾ããã"); #else msg_print("You see no store here."); #endif @@ -4513,8 +4882,7 @@ void do_cmd_store(void) } /* Extract the store code */ - if (c_ptr->feat == FEAT_MUSEUM) which = STORE_MUSEUM; - else which = (c_ptr->feat - FEAT_SHOP_HEAD); + which = f_info[c_ptr->feat].subtype; old_town_num = p_ptr->town_num; if ((which == STORE_HOME) || (which == STORE_MUSEUM)) p_ptr->town_num = 1; @@ -4526,7 +4894,7 @@ void do_cmd_store(void) (ironman_shops)) { #ifdef JP - msg_print("¥É¥¢¤Ë¸°¤¬¤«¤«¤Ã¤Æ¤¤¤ë¡£"); + msg_print("ãã¢ã«éµãããã£ã¦ããã"); #else msg_print("The doors are locked."); #endif @@ -4571,10 +4939,15 @@ void do_cmd_store(void) /* No automatic command */ command_new = 0; + /* Do not expand macros */ + get_com_no_macros = TRUE; /* Save the store number */ cur_store_num = which; + /* Hack -- save the store feature */ + cur_store_feat = c_ptr->feat; + /* Save the store and owner pointers */ st_ptr = &town[p_ptr->town_num].store[cur_store_num]; ot_ptr = &owners[cur_store_num][st_ptr->owner]; @@ -4583,6 +4956,8 @@ void do_cmd_store(void) /* Start at the beginning */ store_top = 0; + play_music(TERM_XTRA_MUSIC_BASIC, MUSIC_BASIC_BUILD); + /* Display the store */ display_store(); @@ -4596,26 +4971,26 @@ void do_cmd_store(void) prt("", 1, 0); /* Clear */ - clear_from(20); + clear_from(20 + xtra_stock); /* Basic commands */ #ifdef JP - prt(" ESC) ·úʪ¤«¤é½Ð¤ë", 21, 0); + prt(" ESC) 建ç©ããåºã", 21 + xtra_stock, 0); #else - prt(" ESC) Exit from Building.", 21, 0); + prt(" ESC) Exit from Building.", 21 + xtra_stock, 0); #endif /* Browse if necessary */ - if (st_ptr->stock_num > 12) + if (st_ptr->stock_num > store_bottom) { #ifdef JP - prt(" -)Á°¥Ú¡¼¥¸", 22, 0); - prt(" ¥¹¥Ú¡¼¥¹) ¼¡¥Ú¡¼¥¸", 23, 0); + prt(" -)åãã¼ã¸", 22 + xtra_stock, 0); + prt(" ã¹ãã¼ã¹) 次ãã¼ã¸", 23 + xtra_stock, 0); #else - prt(" -) Previous page", 22, 0); - prt(" SPACE) Next page", 23, 0); + prt(" -) Previous page", 22 + xtra_stock, 0); + prt(" SPACE) Next page", 23 + xtra_stock, 0); #endif } @@ -4624,75 +4999,74 @@ void do_cmd_store(void) if (cur_store_num == STORE_HOME) { #ifdef JP - prt("g) ¥¢¥¤¥Æ¥à¤ò¼è¤ë", 21, 27); - prt("d) ¥¢¥¤¥Æ¥à¤òÃÖ¤¯", 22, 27); - prt("x) ²È¤Î¥¢¥¤¥Æ¥à¤òÄ´¤Ù¤ë", 23,27); + prt("g) ã¢ã¤ãã ãåã", 21 + xtra_stock, 27); + prt("d) ã¢ã¤ãã ãç½®ã", 22 + xtra_stock, 27); + prt("x) 家ã®ã¢ã¤ãã ã調ã¹ã", 23 + xtra_stock, 27); #else - prt("g) Get an item.", 21, 27); - prt("d) Drop an item.", 22, 27); - prt("x) eXamine an item in the home.", 23,27); + prt("g) Get an item.", 21 + xtra_stock, 27); + prt("d) Drop an item.", 22 + xtra_stock, 27); + prt("x) eXamine an item in the home.", 23 + xtra_stock, 27); #endif - } /* Museum commands */ else if (cur_store_num == STORE_MUSEUM) { #ifdef JP - prt("d) ¥¢¥¤¥Æ¥à¤òÃÖ¤¯", 21, 27); - prt("x) Çîʪ´Û¤Î¥¢¥¤¥Æ¥à¤òÄ´¤Ù¤ë", 23,27); + prt("d) ã¢ã¤ãã ãç½®ã", 21 + xtra_stock, 27); + prt("r) ã¢ã¤ãã ã®å±ç¤ºãããã", 22 + xtra_stock, 27); + prt("x) åç©é¤¨ã®ã¢ã¤ãã ã調ã¹ã", 23 + xtra_stock, 27); #else - prt("d) Drop an item.", 21, 27); - prt("x) eXamine an item in the museum.", 23,27); + prt("d) Drop an item.", 21 + xtra_stock, 27); + prt("r) order to Remove an item.", 22 + xtra_stock, 27); + prt("x) eXamine an item in the museum.", 23 + xtra_stock, 27); #endif - } - /* Shop commands XXX XXX XXX */ + /* Shop commands */ else { #ifdef JP - prt("p) ¾¦ÉʤòÇ㤦", 21, 30); - prt("s) ¥¢¥¤¥Æ¥à¤òÇä¤ë", 22, 30); - prt("x) ¾¦ÉʤòÄ´¤Ù¤ë", 23,30); + prt("p) ååãè²·ã", 21 + xtra_stock, 30); + prt("s) ã¢ã¤ãã ã売ã", 22 + xtra_stock, 30); + prt("x) ååã調ã¹ã", 23 + xtra_stock,30); #else - prt("p) Purchase an item.", 21, 30); - prt("s) Sell an item.", 22, 30); - prt("x) eXamine an item in the shop", 23,30); + prt("p) Purchase an item.", 21 + xtra_stock, 30); + prt("s) Sell an item.", 22 + xtra_stock, 30); + prt("x) eXamine an item in the shop", 23 + xtra_stock,30); #endif - } #ifdef JP - /* ´ðËÜŪ¤Ê¥³¥Þ¥ó¥É¤ÎÄɲÃɽ¼¨ */ + /* åºæ¬çãªã³ãã³ãã®è¿½å 表示 */ - prt("i/e) »ý¤Áʪ/ÁõÈ÷¤Î°ìÍ÷", 21, 56); + prt("i/e) æã¡ç©/è£ åã®ä¸è¦§", 21 + xtra_stock, 56); - if( rogue_like_commands == TRUE ) + if (rogue_like_commands) { - prt("w/T) ÁõÈ÷¤¹¤ë/¤Ï¤º¤¹", 22, 56); + prt("w/T) è£ åãã/ã¯ãã", 22 + xtra_stock, 56); } else { - prt("w/t) ÁõÈ÷¤¹¤ë/¤Ï¤º¤¹", 22, 56); + prt("w/t) è£ åãã/ã¯ãã", 22 + xtra_stock, 56); } #else - prt("i/e) Inventry/Equipment list", 21, 56); + prt("i/e) Inventry/Equipment list", 21 + xtra_stock, 56); - if( rogue_like_commands == TRUE ) + if (rogue_like_commands) { - prt("w/T) Wear/Take off equipment", 22, 56); + prt("w/T) Wear/Take off equipment", 22 + xtra_stock, 56); } else { - prt("w/t) Wear/Take off equipment", 22, 56); + prt("w/t) Wear/Take off equipment", 22 + xtra_stock, 56); } #endif /* Prompt */ #ifdef JP - prt("¥³¥Þ¥ó¥É:", 20, 0); + prt("ã³ãã³ã:", 20 + xtra_stock, 0); #else - prt("You may: ", 20, 0); + prt("You may: ", 20 + xtra_stock, 0); #endif @@ -4717,22 +5091,21 @@ void do_cmd_store(void) /* Handle stuff */ handle_stuff(); - /* XXX XXX XXX Pack Overflow */ + /* Pack Overflow */ if (inventory[INVEN_PACK].k_idx) { - int item = INVEN_PACK; + INVENTORY_IDX item = INVEN_PACK; object_type *o_ptr = &inventory[item]; /* Hack -- Flee from the store */ if (cur_store_num != STORE_HOME) { - /* Message */ #ifdef JP if (cur_store_num == STORE_MUSEUM) - msg_print("¥¶¥Ã¥¯¤«¤é¥¢¥¤¥Æ¥à¤¬¤¢¤Õ¤ì¤½¤¦¤Ê¤Î¤Ç¡¢¤¢¤ï¤Æ¤ÆÇîʪ´Û¤«¤é½Ð¤¿..."); + msg_print("ã¶ãã¯ããã¢ã¤ãã ãããµããããªã®ã§ãããã¦ã¦åç©é¤¨ããåºã..."); else - msg_print("¥¶¥Ã¥¯¤«¤é¥¢¥¤¥Æ¥à¤¬¤¢¤Õ¤ì¤½¤¦¤Ê¤Î¤Ç¡¢¤¢¤ï¤Æ¤ÆŹ¤«¤é½Ð¤¿..."); + msg_print("ã¶ãã¯ããã¢ã¤ãã ãããµããããªã®ã§ãããã¦ã¦åºããåºã..."); #else if (cur_store_num == STORE_MUSEUM) msg_print("Your pack is so full that you flee the Museum..."); @@ -4748,9 +5121,8 @@ void do_cmd_store(void) /* Hack -- Flee from the home */ else if (!store_check_num(o_ptr)) { - /* Message */ #ifdef JP - msg_print("¥¶¥Ã¥¯¤«¤é¥¢¥¤¥Æ¥à¤¬¤¢¤Õ¤ì¤½¤¦¤Ê¤Î¤Ç¡¢¤¢¤ï¤Æ¤Æ²È¤«¤é½Ð¤¿..."); + msg_print("ã¶ãã¯ããã¢ã¤ãã ãããµããããªã®ã§ãããã¦ã¦å®¶ããåºã..."); #else msg_print("Your pack is so full that you flee your home..."); #endif @@ -4773,7 +5145,7 @@ void do_cmd_store(void) /* Give a message */ #ifdef JP - msg_print("¥¶¥Ã¥¯¤«¤é¥¢¥¤¥Æ¥à¤¬¤¢¤Õ¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª"); + msg_print("ã¶ãã¯ããã¢ã¤ãã ãããµãã¦ãã¾ã£ãï¼"); #else msg_print("Your pack overflows!"); #endif @@ -4788,9 +5160,8 @@ void do_cmd_store(void) /* Describe it */ object_desc(o_name, q_ptr, 0); - /* Message */ #ifdef JP - msg_format("%s¤¬Íî¤Á¤¿¡£(%c)", o_name, index_to_label(item)); + msg_format("%sãè½ã¡ãã(%c)", o_name, index_to_label(item)); #else msg_format("You drop %s (%c).", o_name, index_to_label(item)); #endif @@ -4810,7 +5181,7 @@ void do_cmd_store(void) /* Redraw the home */ if (item_pos >= 0) { - store_top = (item_pos / 12) * 12; + store_top = (item_pos / store_bottom) * store_bottom; display_inventory(); } } @@ -4824,10 +5195,12 @@ void do_cmd_store(void) if (st_ptr->store_open >= turn) leave_store = TRUE; } + select_floor_music(); + p_ptr->town_num = old_town_num; - /* Free turn XXX XXX XXX */ - energy_use = 100; + /* Free turn */ + p_ptr->energy_use = 100; /* Hack -- Character is no longer in "icky" mode */ @@ -4840,8 +5213,10 @@ void do_cmd_store(void) /* Hack -- Cancel "see" mode */ command_see = FALSE; + /* Allow expanding macros */ + get_com_no_macros = FALSE; - /* Flush messages XXX XXX XXX */ + /* Flush messages */ msg_print(NULL); @@ -4859,14 +5234,16 @@ void do_cmd_store(void) /* Redraw map */ p_ptr->redraw |= (PR_MAP); - /* Window stuff */ p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON); } -/* +/*! + * @brief ç¾å¨ã®çºã®åºä¸»ã交代ããã / * Shuffle one of the stores. + * @param which åºè種é¡ã®ID + * @return ãªã */ void store_shuffle(int which) { @@ -4914,10 +5291,9 @@ void store_shuffle(int which) { object_type *o_ptr; - /* Get the item */ o_ptr = &st_ptr->stock[i]; - if (!(artifact_p(o_ptr) || o_ptr->art_name)) + if (!object_is_artifact(o_ptr)) { /* Hack -- Sell all non-artifact old items for "half price" */ o_ptr->discount = 50; @@ -4926,24 +5302,22 @@ void store_shuffle(int which) 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")); } } } -/* +/*! + * @brief åºã®åæããå¤åããã / * Maintain the inventory at the stores. + * @param town_num çºã®ID + * @param store_num åºè種é¡ã®ID + * @return ãªã */ void store_maint(int town_num, int store_num) { - int j; - - int old_rating = rating; + INVENTORY_IDX j; cur_store_num = store_num; @@ -5015,15 +5389,15 @@ void store_maint(int town_num, int store_num) /* Acquire some new items */ while (st_ptr->stock_num < j) store_create(); - - - /* Hack -- Restore the rating */ - rating = old_rating; } -/* +/*! + * @brief åºèæ å ±ãåæåãã / * Initialize the stores + * @param town_num çºã®ID + * @param store_num åºè種é¡ã®ID + * @return ãªã */ void store_init(int town_num, int store_num) { @@ -5076,6 +5450,11 @@ void store_init(int town_num, int store_num) } +/*! + * @brief ã¢ã¤ãã ãçºã®ãã©ãã¯ãã¼ã±ããã«ç§»åããã / + * @param o_ptr 移åãããããªãã¸ã§ã¯ãã®æ§é ä½åç §ãã¤ã³ã¿ + * @return ãªã + */ void move_to_black_market(object_type *o_ptr) { /* Not in town */ @@ -5089,3 +5468,4 @@ void move_to_black_market(object_type *o_ptr) object_wipe(o_ptr); /* Don't leave a bogus object behind... */ } +