1 #include "store/say-comments.h"
2 #include "main/sound-definitions-table.h"
3 #include "main/sound-of-music.h"
4 #include "store/store-owner-comments.h"
5 #include "store/store-util.h"
6 #include "player-info/avatar.h"
7 #include "store/rumor.h"
8 #include "view/display-messages.h"
10 #define RUMOR_CHANCE 8
13 * @brief 取引成功時の店主のメッセージ処理 /
14 * ブラックマーケットのときは別のメッセージを出す
16 * @param player_ptr プレーヤーへの参照ポインタ
19 void store_owner_says_comment(player_type *player_ptr)
21 if (cur_store_num == STORE_BLACK)
22 msg_print(comment_1_B[randint0(MAX_COMMENT_1)]);
24 msg_print(comment_1[randint0(MAX_COMMENT_1)]);
26 if (one_in_(RUMOR_CHANCE))
28 msg_print(_("店主は耳うちした:", "The shopkeeper whispers something into your ear:"));
29 display_rumor(player_ptr, TRUE);
34 * @brief 店主が交渉を終えた際の反応を返す処理 /
35 * Let a shop-keeper React to a purchase
36 * @param price アイテムの取引額
37 * @param value アイテムの実際価値
38 * @param guess 店主が当初予想していた価値
41 * We paid "price", it was worth "value", and we thought it was worth "guess"
43 void purchase_analyze(player_type *player_ptr, PRICE price, PRICE value, PRICE guess)
45 /* Item was worthless, but we bought it */
46 if ((value <= 0) && (price > value))
48 msg_print(comment_7a[randint0(MAX_COMMENT_7A)]);
49 chg_virtue(player_ptr, V_HONOUR, -1);
50 chg_virtue(player_ptr, V_JUSTICE, -1);
55 /* Item was cheaper than we thought, and we paid more than necessary */
56 if ((value < guess) && (price > value))
58 msg_print(comment_7b[randint0(MAX_COMMENT_7B)]);
59 chg_virtue(player_ptr, V_JUSTICE, -1);
60 if (one_in_(4)) chg_virtue(player_ptr, V_HONOUR, -1);
65 /* Item was a good bargain, and we got away with it */
66 if ((value > guess) && (value < (4 * guess)) && (price < value))
68 msg_print(comment_7c[randint0(MAX_COMMENT_7C)]);
69 if (one_in_(4)) chg_virtue(player_ptr, V_HONOUR, -1);
70 else if (one_in_(4)) chg_virtue(player_ptr, V_HONOUR, 1);
75 /* Item was a great bargain, and we got away with it */
76 if ((value > guess) && (price < value))
78 msg_print(comment_7d[randint0(MAX_COMMENT_7D)]);
79 if (one_in_(2)) chg_virtue(player_ptr, V_HONOUR, -1);
80 if (one_in_(4)) chg_virtue(player_ptr, V_HONOUR, 1);
81 if (10 * price < value) chg_virtue(player_ptr, V_SACRIFICE, 1);