1 #include "system/angband.h"
2 #include "store/say-comments.h"
3 #include "main/sound-definitions-table.h"
4 #include "store/store-owner-comments.h"
5 #include "store/store-util.h"
6 #include "player/avatar.h"
7 #include "store/rumor.h"
12 * @brief 取引成功時の店主のメッセージ処理 /
13 * ブラックマーケットのときは別のメッセージを出す
15 * @param player_ptr プレーヤーへの参照ポインタ
18 void say_comment_1(player_type *player_ptr)
21 if (cur_store_num == STORE_BLACK)
23 msg_print(comment_1_B[randint0(MAX_COMMENT_1)]);
27 msg_print(comment_1[randint0(MAX_COMMENT_1)]);
30 msg_print(comment_1[randint0(MAX_COMMENT_1)]);
33 if (one_in_(RUMOR_CHANCE))
35 msg_print(_("店主は耳うちした:", "The shopkeeper whispers something into your ear:"));
36 display_rumor(player_ptr, TRUE);
42 * @brief プレイヤーがアイテムを買う時の価格代案メッセージ処理 /
43 * Continue haggling (player is buying)
44 * @param value 店主の提示価格
45 * @param annoyed 店主のいらつき度
48 void say_comment_2(PRICE value, int annoyed)
51 sprintf(tmp_val, "%ld", (long)value);
55 msg_format(comment_2a[randint0(MAX_COMMENT_2A)], tmp_val);
60 if (cur_store_num == STORE_BLACK)
62 msg_format(comment_2b_B[randint0(MAX_COMMENT_2B)], tmp_val);
66 msg_format(comment_2b[randint0(MAX_COMMENT_2B)], tmp_val);
69 msg_format(comment_2b[randint0(MAX_COMMENT_2B)], tmp_val);
75 * @brief プレイヤーがアイテムを売る時の価格代案メッセージ処理 /
76 * ブラックマーケットのときは別のメッセージを出す
77 * Continue haggling (player is selling)
78 * @param value 店主の提示価格
79 * @param annoyed 店主のいらつき度
82 void say_comment_3(PRICE value, int annoyed)
85 sprintf(tmp_val, "%ld", (long)value);
88 msg_format(comment_3a[randint0(MAX_COMMENT_3A)], tmp_val);
93 if (cur_store_num == STORE_BLACK)
95 msg_format(comment_3b_B[randint0(MAX_COMMENT_3B)], tmp_val);
99 msg_format(comment_3b[randint0(MAX_COMMENT_3B)], tmp_val);
102 msg_format(comment_3b[randint0(MAX_COMMENT_3B)], tmp_val);
109 * @brief 店主がプレイヤーを追い出す時のメッセージ処理 /
110 * ブラックマーケットの時は別のメッセージを出す
111 * Kick 'da bum out. -RAK-
114 void say_comment_4(void)
117 if (cur_store_num == STORE_BLACK)
119 msg_print(comment_4a_B[randint0(MAX_COMMENT_4A)]);
120 msg_print(comment_4b_B[randint0(MAX_COMMENT_4B)]);
124 msg_print(comment_4a[randint0(MAX_COMMENT_4A)]);
125 msg_print(comment_4b[randint0(MAX_COMMENT_4B)]);
128 msg_print(comment_4a[randint0(MAX_COMMENT_4A)]);
129 msg_print(comment_4b[randint0(MAX_COMMENT_4B)]);
136 * @brief 店主がプレイヤーに取り合わない時のメッセージ処理 /
137 * ブラックマーケットの時は別のメッセージを出す
138 * You are insulting me
141 void say_comment_5(void)
144 if (cur_store_num == STORE_BLACK)
146 msg_print(comment_5_B[randint0(MAX_COMMENT_5)]);
150 msg_print(comment_5[randint0(MAX_COMMENT_5)]);
153 msg_print(comment_5[randint0(MAX_COMMENT_5)]);
160 * @brief 店主がプレイヤーの提示を理解できなかった時のメッセージ処理 /
161 * That makes no sense.
164 void say_comment_6(void)
166 msg_print(comment_6[randint0(MAX_COMMENT_6)]);
170 * @brief 店主が交渉を終えた際の反応を返す処理 /
171 * Let a shop-keeper React to a purchase
172 * @param price アイテムの取引額
173 * @param value アイテムの実際価値
174 * @param guess 店主が当初予想していた価値
177 * We paid "price", it was worth "value", and we thought it was worth "guess"
179 void purchase_analyze(player_type *player_ptr, PRICE price, PRICE value, PRICE guess)
181 /* Item was worthless, but we bought it */
182 if ((value <= 0) && (price > value))
184 msg_print(comment_7a[randint0(MAX_COMMENT_7A)]);
185 chg_virtue(player_ptr, V_HONOUR, -1);
186 chg_virtue(player_ptr, V_JUSTICE, -1);
191 /* Item was cheaper than we thought, and we paid more than necessary */
192 if ((value < guess) && (price > value))
194 msg_print(comment_7b[randint0(MAX_COMMENT_7B)]);
195 chg_virtue(player_ptr, V_JUSTICE, -1);
196 if (one_in_(4)) chg_virtue(player_ptr, V_HONOUR, -1);
201 /* Item was a good bargain, and we got away with it */
202 if ((value > guess) && (value < (4 * guess)) && (price < value))
204 msg_print(comment_7c[randint0(MAX_COMMENT_7C)]);
205 if (one_in_(4)) chg_virtue(player_ptr, V_HONOUR, -1);
206 else if (one_in_(4)) chg_virtue(player_ptr, V_HONOUR, 1);
211 /* Item was a great bargain, and we got away with it */
212 if ((value > guess) && (price < value))
214 msg_print(comment_7d[randint0(MAX_COMMENT_7D)]);
215 if (one_in_(2)) chg_virtue(player_ptr, V_HONOUR, -1);
216 if (one_in_(4)) chg_virtue(player_ptr, V_HONOUR, 1);
217 if (10 * price < value) chg_virtue(player_ptr, V_SACRIFICE, 1);