3 * @brief 店の処理 / Store commands
6 * Copyright (c) 1989 James E. Wilson, Robert A. Koeneke\n
7 * This software may be copied and distributed for educational, research, and\n
8 * not for profit purposes provided that this copyright and statement are\n
9 * included in all such copies.\n
10 * 2014 Deskull rearranged comment for Doxygen.
18 #include "cmd-basic.h"
21 #include "cmd-smith.h"
22 #include "cmd-zapwand.h"
23 #include "cmd-magiceat.h"
27 #include "cmd-spell.h"
29 #include "player-status.h"
30 #include "object-flavor.h"
31 #include "object-hook.h"
32 #include "floor-events.h"
35 #include "player-effects.h"
36 #include "player-race.h"
39 #include "objectkind.h"
41 #include "floor-town.h"
47 * @brief 闘技場のモンスターID及び報酬アイテムテーブル /
48 * Store owners (exactly four "possible" owners per store, chosen randomly)
51 * { name, purse, max greed, min greed, haggle_per, tolerance, race, unused }
53 * Lifted extra shopkeepers from CthAngband (don't you just love open source
54 * development? ;-)). Since this gave less than 32 unique names for some
55 * shops, those have their first x names copied to reach 32.
57 * For the weapon and armour shops, several owners have a limit of 5k.
59 * I want to do 50k owners, but the purse is currently s16b. Perhaps
60 * we should just store 1/10th of the purse?
63 const owner_type owners[MAX_STORES][MAX_OWNERS] =
66 /* General store - 32 unique names */
68 Raistlin は dragonlance の powerful wizard 。
69 Rincewind the Chicken は Terry Pratchett の Discworld の登場人物 上記のパロディ?、
70 { "憶病者ラストリン", 200, 175, 108, 4, 12, RACE_HUMAN},
71 { "Raistlin the Chicken", 200, 175, 108, 4, 12, RACE_HUMAN},
75 { "フレンドリーなビルボ", 200, 170, 108, 5, 15, RACE_HOBBIT},
76 { "憶病者リンスウィンド", 200, 175, 108, 4, 12, RACE_HUMAN},
77 { "背の低いサルタン", 300, 170, 107, 5, 15, RACE_GNOME},
78 { "ハンサムなライア=エル", 300, 165, 107, 6, 18, RACE_ELF},
79 { "親切なファリルマウエン", 250, 170, 108, 5, 15, RACE_HOBBIT},
80 { "臆病者ヴォワラン", 500, 175, 108, 4, 12, RACE_HUMAN},
81 { "チビのエラシュナク", 750, 170, 107, 5, 15, RACE_BEASTMAN},
82 { "ハンサムなグラッグ", 1000, 165, 107, 6, 18, RACE_HALF_TITAN},
83 { "ケチなフォロビア", 250, 170, 108, 5, 15, RACE_HUMAN},
84 { "馬鹿のエリス", 500, 175, 108, 4, 12, RACE_HUMAN},
85 { "腹ペコのフィルバート", 750, 170, 107, 5, 15, RACE_VAMPIRE},
86 { "スナーグル・サシグア", 1000, 165, 107, 6, 18, RACE_MIND_FLAYER},
87 { "長死きエロワーズ", 250, 170, 108, 5, 15, RACE_SPECTRE},
88 { "ノロマのフンディ", 500, 175, 108, 4, 12, RACE_ZOMBIE},
89 { "グランサス", 750, 170, 107, 5, 15, RACE_SKELETON},
90 { "丁寧なロラックス", 1000, 165, 107, 6, 18, RACE_VAMPIRE},
91 { "ブッチ", 250, 170, 108, 5, 15, RACE_HALF_ORC},
92 { "美しきエルベレス", 500, 175, 108, 4, 12, RACE_HIGH_ELF},
93 { "こそこそサーレス", 750, 170, 107, 5, 15, RACE_GNOME},
94 { "ナーロック", 1000, 165, 107, 6, 18, RACE_DWARF},
95 { "チビのヘイネッカ", 250, 170, 108, 5, 15, RACE_GNOME},
96 { "きちがいロワラン", 500, 175, 108, 4, 12, RACE_HALF_GIANT},
97 { "毒息のウート", 750, 170, 107, 5, 15, RACE_DRACONIAN},
98 { "でぶっちょアラァカ", 1000, 165, 107, 6, 18, RACE_DRACONIAN},
99 { "低能なプーゴー", 250, 170, 108, 5, 15, RACE_BEASTMAN},
100 { "フェロールフィリアン", 500, 175, 108, 4, 12, RACE_ELF},
101 { "年寄りマロカ", 750, 170, 107, 5, 15, RACE_GNOME},
102 { "勇敢なサシン", 1000, 165, 107, 6, 18, RACE_HALF_GIANT},
103 { "田舎者アビエマール", 250, 170, 108, 5, 15, RACE_HUMAN},
104 { "貧乏なハーク", 500, 175, 108, 4, 12, RACE_HALF_ORC},
105 { "みじめなソアリン", 750, 170, 107, 5, 15, RACE_ZOMBIE},
106 { "質素なメルラ", 1000, 165, 107, 6, 18, RACE_ELF},
108 { "Bilbo the Friendly", 200, 170, 108, 5, 15, RACE_HOBBIT},
109 { "Rincewind the Chicken", 200, 175, 108, 4, 12, RACE_HUMAN},
110 { "Sultan the Midget", 300, 170, 107, 5, 15, RACE_GNOME},
111 { "Lyar-el the Comely", 300, 165, 107, 6, 18, RACE_ELF},
112 { "Falilmawen the Friendly", 250, 170, 108, 5, 15, RACE_HOBBIT},
113 { "Voirin the Cowardly", 500, 175, 108, 4, 12, RACE_HUMAN},
114 { "Erashnak the Midget", 750, 170, 107, 5, 15, RACE_BEASTMAN},
115 { "Grug the Comely", 1000, 165, 107, 6, 18, RACE_HALF_TITAN},
116 { "Forovir the Cheap", 250, 170, 108, 5, 15, RACE_HUMAN},
117 { "Ellis the Fool", 500, 175, 108, 4, 12, RACE_HUMAN},
118 { "Filbert the Hungry", 750, 170, 107, 5, 15, RACE_VAMPIRE},
119 { "Fthnargl Psathiggua", 1000, 165, 107, 6, 18, RACE_MIND_FLAYER},
120 { "Eloise Long-Dead", 250, 170, 108, 5, 15, RACE_SPECTRE},
121 { "Fundi the Slow", 500, 175, 108, 4, 12, RACE_ZOMBIE},
122 { "Granthus", 750, 170, 107, 5, 15, RACE_SKELETON},
123 { "Lorax the Suave", 1000, 165, 107, 6, 18, RACE_VAMPIRE},
124 { "Butch", 250, 170, 108, 5, 15, RACE_HALF_ORC},
125 { "Elbereth the Beautiful", 500, 175, 108, 4, 12, RACE_HIGH_ELF},
126 { "Sarleth the Sneaky", 750, 170, 107, 5, 15, RACE_GNOME},
127 { "Narlock", 1000, 165, 107, 6, 18, RACE_DWARF},
128 { "Haneka the Small", 250, 170, 108, 5, 15, RACE_GNOME},
129 { "Loirin the Mad", 500, 175, 108, 4, 12, RACE_HALF_GIANT},
130 { "Wuto Poisonbreath", 750, 170, 107, 5, 15, RACE_DRACONIAN},
131 { "Araaka the Rotund", 1000, 165, 107, 6, 18, RACE_DRACONIAN},
132 { "Poogor the Dumb", 250, 170, 108, 5, 15, RACE_BEASTMAN},
133 { "Felorfiliand", 500, 175, 108, 4, 12, RACE_ELF},
134 { "Maroka the Aged", 750, 170, 107, 5, 15, RACE_GNOME},
135 { "Sasin the Bold", 1000, 165, 107, 6, 18, RACE_HALF_GIANT},
136 { "Abiemar the Peasant", 250, 170, 108, 5, 15, RACE_HUMAN},
137 { "Hurk the Poor", 500, 175, 108, 4, 12, RACE_HALF_ORC},
138 { "Soalin the Wretched", 750, 170, 107, 5, 15, RACE_ZOMBIE},
139 { "Merulla the Humble", 1000, 165, 107, 6, 18, RACE_ELF},
143 /* Armoury - 28 unique names */
145 { "醜悪コン=ダー", 5000, 210, 115, 5, 7, RACE_HALF_ORC},
146 { "頑固者ダーグ=ロウ", 10000, 190, 111, 4, 9, RACE_HUMAN},
147 { "賢者デカド", 25000, 200, 112, 4, 10, RACE_DUNADAN},
148 { "鍛冶屋のウィーランド", 30000, 200, 112, 4, 5, RACE_DWARF},
149 { "醜悪コン=ダー", 10000, 210, 115, 5, 7, RACE_HALF_ORC},
150 { "頑固者ダーグ=ロウ", 15000, 190, 111, 4, 9, RACE_HUMAN},
151 { "ハンサムなデカド", 25000, 200, 112, 4, 10, RACE_AMBERITE},
152 { "エロー・ドラゴンスケイル", 30000, 200, 112, 4, 5, RACE_ELF},
153 { "デリカトス", 10000, 210, 115, 5, 7, RACE_SPRITE},
154 { "巨大なグルース", 15000, 190, 111, 4, 9, RACE_HALF_GIANT},
155 { "アニムス", 25000, 200, 112, 4, 10, RACE_GOLEM},
156 { "マルヴァス", 30000, 200, 112, 4, 5, RACE_HALF_TITAN},
157 { "セラクシス", 10000, 210, 115, 5, 7, RACE_ZOMBIE},
158 { "デス・チル", 5000, 190, 111, 4, 9, RACE_SPECTRE},
159 { "微かなドリオス", 25000, 200, 112, 4, 10, RACE_SPECTRE},
160 { "冷たいバスリック", 30000, 200, 112, 4, 5, RACE_VAMPIRE},
161 { "冷酷ヴェンジェラ", 10000, 210, 115, 5, 7, RACE_HALF_TROLL},
162 { "強者ウィラナ", 15000, 190, 111, 4, 9, RACE_HUMAN},
163 { "ヨジョ二世", 25000, 200, 112, 4, 10, RACE_DWARF},
164 { "優しいラナラー", 30000, 200, 112, 4, 5, RACE_AMBERITE},
165 { "不浄のホルバグ", 5000, 210, 115, 5, 7, RACE_HALF_ORC},
166 { "テレパスのエレレン", 15000, 190, 111, 4, 9, RACE_DARK_ELF},
167 { "イスドリリアス", 25000, 200, 112, 4, 10, RACE_SPRITE},
168 { "一つ目ヴェグナー", 5000, 200, 112, 4, 5, RACE_CYCLOPS},
169 { "混沌のロディッシュ", 10000, 210, 115, 5, 7, RACE_BEASTMAN},
170 { "剣豪ヘジン", 15000, 190, 111, 4, 9, RACE_NIBELUNG},
171 { "ずる屋のエルベレリス", 10000, 200, 112, 4, 10, RACE_DARK_ELF},
172 { "インプのザサス", 30000, 200, 112, 4, 5, RACE_IMP},
173 { "醜悪コン=ダー", 5000, 210, 115, 5, 7, RACE_HALF_ORC},
174 { "頑固者ダーグ=ロウ", 10000, 190, 111, 4, 9, RACE_HUMAN},
175 { "ハンサムなデカド", 25000, 200, 112, 4, 10, RACE_AMBERITE},
176 { "鍛冶屋のウィーランド", 30000, 200, 112, 4, 5, RACE_DWARF},
178 { "Kon-Dar the Ugly", 5000, 210, 115, 5, 7, RACE_HALF_ORC},
179 { "Darg-Low the Grim", 10000, 190, 111, 4, 9, RACE_HUMAN},
180 { "Decado the Handsome", 25000, 200, 112, 4, 10, RACE_DUNADAN},
181 { "Wieland the Smith", 30000, 200, 112, 4, 5, RACE_DWARF},
182 { "Kon-Dar the Ugly", 10000, 210, 115, 5, 7, RACE_HALF_ORC},
183 { "Darg-Low the Grim", 15000, 190, 111, 4, 9, RACE_HUMAN},
184 { "Decado the Handsome", 25000, 200, 112, 4, 10, RACE_AMBERITE},
185 { "Elo Dragonscale", 30000, 200, 112, 4, 5, RACE_ELF},
186 { "Delicatus", 10000, 210, 115, 5, 7, RACE_SPRITE},
187 { "Gruce the Huge", 15000, 190, 111, 4, 9, RACE_HALF_GIANT},
188 { "Animus", 25000, 200, 112, 4, 10, RACE_GOLEM},
189 { "Malvus", 30000, 200, 112, 4, 5, RACE_HALF_TITAN},
190 { "Selaxis", 10000, 210, 115, 5, 7, RACE_ZOMBIE},
191 { "Deathchill", 5000, 190, 111, 4, 9, RACE_SPECTRE},
192 { "Drios the Faint", 25000, 200, 112, 4, 10, RACE_SPECTRE},
193 { "Bathric the Cold", 30000, 200, 112, 4, 5, RACE_VAMPIRE},
194 { "Vengella the Cruel", 10000, 210, 115, 5, 7, RACE_HALF_TROLL},
195 { "Wyrana the Mighty", 15000, 190, 111, 4, 9, RACE_HUMAN},
196 { "Yojo II", 25000, 200, 112, 4, 10, RACE_DWARF},
197 { "Ranalar the Sweet", 30000, 200, 112, 4, 5, RACE_AMBERITE},
198 { "Horbag the Unclean", 5000, 210, 115, 5, 7, RACE_HALF_ORC},
199 { "Elelen the Telepath", 15000, 190, 111, 4, 9, RACE_DARK_ELF},
200 { "Isedrelias", 25000, 200, 112, 4, 10, RACE_SPRITE},
201 { "Vegnar One-eye", 5000, 200, 112, 4, 5, RACE_CYCLOPS},
202 { "Rodish the Chaotic", 10000, 210, 115, 5, 7, RACE_BEASTMAN},
203 { "Hesin Swordmaster", 15000, 190, 111, 4, 9, RACE_NIBELUNG},
204 { "Elvererith the Cheat", 10000, 200, 112, 4, 10, RACE_DARK_ELF},
205 { "Zzathath the Imp", 30000, 200, 112, 4, 5, RACE_IMP},
206 { "Kon-Dar the Ugly", 5000, 210, 115, 5, 7, RACE_HALF_ORC},
207 { "Darg-Low the Grim", 10000, 190, 111, 4, 9, RACE_HUMAN},
208 { "Decado the Handsome", 25000, 200, 112, 4, 10, RACE_AMBERITE},
209 { "Wieland the Smith", 30000, 200, 112, 4, 5, RACE_DWARF},
214 /* Weapon Smith - 28 unique names */
216 { "残忍なるアーノルド", 5000, 210, 115, 6, 6, RACE_HALF_TROLL},
217 { "獣殺しのアーンダル", 10000, 185, 110, 5, 9, RACE_HALF_ELF},
218 { "獣マスターのエディー", 25000, 190, 115, 5, 7, RACE_HOBBIT},
219 { "竜殺しのオグライン", 30000, 195, 112, 4, 8, RACE_DWARF},
220 { "熟練者ドリュー", 10000, 210, 115, 6, 6, RACE_HUMAN},
221 { "龍の子オラックス", 15000, 185, 110, 5, 9, RACE_DRACONIAN},
222 { "病気持ちのアンスラックス", 25000, 190, 115, 5, 7, RACE_BEASTMAN},
223 { "頑丈者アルコス", 30000, 195, 112, 4, 8, RACE_DWARF},
224 { "腐れ者のサリアス", 5000, 210, 115, 6, 6, RACE_ZOMBIE},
225 { "晒し骨のトゥエシク", 15000, 185, 110, 5, 9, RACE_SKELETON},
226 { "ビリオス", 25000, 190, 115, 5, 7, RACE_BEASTMAN},
227 { "ファスガル", 30000, 195, 112, 4, 8, RACE_ZOMBIE},
228 { "パラディンのエレフリス", 10000, 210, 115, 6, 6, RACE_BARBARIAN},
229 { "キ'トリッ'ク", 15000, 185, 110, 5, 9, RACE_KLACKON},
230 { "蜘蛛の友ドゥロカス", 25000, 190, 115, 5, 7, RACE_DARK_ELF},
231 { "巨人殺しのフングス", 30000, 195, 112, 4, 8, RACE_DWARF},
232 { "デランサ", 10000, 210, 115, 6, 6, RACE_ELF},
233 { "レンジャーのソルビスタニ", 15000, 185, 110, 5, 9, RACE_HALF_ELF},
234 { "ノロマのゾリル", 25000, 190, 115, 5, 7, RACE_GOLEM},
235 { "イーオン・フラックス", 20000, 195, 112, 4, 8, RACE_HALF_ELF},
236 { "強者ナドック", 10000, 210, 115, 6, 6, RACE_HOBBIT},
237 { "弱虫エラモグ", 15000, 185, 110, 5, 9, RACE_KOBOLD},
238 { "公正なエオウィリス", 25000, 190, 115, 5, 7, RACE_VAMPIRE},
239 { "バルログ殺しのヒュイモグ", 30000, 195, 112, 4, 8, RACE_HALF_ORC},
240 { "冷酷ピーダス", 5000, 210, 115, 6, 6, RACE_HUMAN},
241 { "ヴァモグ スレイヤー", 15000, 185, 110, 5, 9, RACE_HALF_OGRE},
242 { "性悪フーシュナク", 25000, 190, 115, 5, 7, RACE_BEASTMAN},
243 { "舞闘バレン", 30000, 195, 112, 4, 8, RACE_BARBARIAN},
244 { "残忍なるアーノルド", 5000, 210, 115, 6, 6, RACE_BARBARIAN},
245 { "獣殺しのアーンダル", 10000, 185, 110, 5, 9, RACE_HALF_ELF},
246 { "ビーストマスター・エディー", 25000, 190, 115, 5, 7, RACE_HALF_ORC},
247 { "竜殺しのオグライン", 30000, 195, 112, 4, 8, RACE_DWARF},
249 { "Arnold the Beastly", 5000, 210, 115, 6, 6, RACE_BARBARIAN},
250 { "Arndal Beast-Slayer", 10000, 185, 110, 5, 9, RACE_HALF_ELF},
251 { "Eddie Beast-Master", 25000, 190, 115, 5, 7, RACE_HALF_ORC},
252 { "Oglign Dragon-Slayer", 30000, 195, 112, 4, 8, RACE_DWARF},
253 { "Drew the Skilled", 10000, 210, 115, 6, 6, RACE_HUMAN},
254 { "Orrax Dragonson", 15000, 185, 110, 5, 9, RACE_DRACONIAN},
255 { "Anthrax Disease-Carrier", 25000, 190, 115, 5, 7, RACE_BEASTMAN},
256 { "Arkhoth the Stout", 30000, 195, 112, 4, 8, RACE_DWARF},
257 { "Sarlyas the Rotten", 5000, 210, 115, 6, 6, RACE_ZOMBIE},
258 { "Tuethic Bare-Bones", 15000, 185, 110, 5, 9, RACE_SKELETON},
259 { "Bilious", 25000, 190, 115, 5, 7, RACE_BEASTMAN},
260 { "Fasgul", 30000, 195, 112, 4, 8, RACE_ZOMBIE},
261 { "Ellefris the Paladin", 10000, 210, 115, 6, 6, RACE_BARBARIAN},
262 { "K'trrik'k", 15000, 185, 110, 5, 9, RACE_KLACKON},
263 { "Drocus Spiderfriend", 25000, 190, 115, 5, 7, RACE_DARK_ELF},
264 { "Fungus Giant-Slayer", 30000, 195, 112, 4, 8, RACE_DWARF},
265 { "Delantha", 10000, 210, 115, 6, 6, RACE_ELF},
266 { "Solvistani the Ranger", 15000, 185, 110, 5, 9, RACE_HALF_ELF},
267 { "Xoril the Slow", 25000, 190, 115, 5, 7, RACE_GOLEM},
268 { "Aeon Flux", 20000, 195, 112, 4, 8, RACE_HALF_ELF},
269 { "Nadoc the Strong", 10000, 210, 115, 6, 6, RACE_HOBBIT},
270 { "Eramog the Weak", 15000, 185, 110, 5, 9, RACE_KOBOLD},
271 { "Eowilith the Fair", 25000, 190, 115, 5, 7, RACE_VAMPIRE},
272 { "Huimog Balrog-Slayer", 30000, 195, 112, 4, 8, RACE_HALF_ORC},
273 { "Peadus the Cruel", 5000, 210, 115, 6, 6, RACE_HUMAN},
274 { "Vamog Slayer", 15000, 185, 110, 5, 9, RACE_HALF_OGRE},
275 { "Hooshnak the Vicious", 25000, 190, 115, 5, 7, RACE_BEASTMAN},
276 { "Balenn War-Dancer", 30000, 195, 112, 4, 8, RACE_BARBARIAN},
277 { "Arnold the Beastly", 5000, 210, 115, 6, 6, RACE_BARBARIAN},
278 { "Arndal Beast-Slayer", 10000, 185, 110, 5, 9, RACE_HALF_ELF},
279 { "Eddie Beast-Master", 25000, 190, 115, 5, 7, RACE_HALF_ORC},
280 { "Oglign Dragon-Slayer", 30000, 195, 112, 4, 8, RACE_DWARF},
284 /* Temple - 22 unique names */
286 { "質素なルードヴィヒ", 5000, 175, 109, 6, 15, RACE_HUMAN},
287 { "パラディンのガンナー", 10000, 185, 110, 5, 23, RACE_HUMAN},
288 { "選ばれしトリン", 25000, 180, 107, 6, 20, RACE_ELF},
289 { "賢明なるサラストロ", 30000, 185, 109, 5, 15, RACE_DWARF},
290 { "パーシヴァル卿", 25000, 180, 107, 6, 20, RACE_HIGH_ELF},
291 { "神聖なるアセナス", 30000, 185, 109, 5, 15, RACE_HUMAN},
292 { "マッキノン", 10000, 175, 109, 6, 15, RACE_HUMAN},
293 { "謹み婦人", 15000, 185, 110, 5, 23, RACE_HIGH_ELF},
294 { "ドルイドのハシュニック", 25000, 180, 107, 6, 20, RACE_HOBBIT},
295 { "フィナク", 30000, 185, 109, 5, 15, RACE_YEEK},
296 { "クリキック", 10000, 175, 109, 6, 15, RACE_KLACKON},
297 { "荒くれ者モリヴァル", 15000, 185, 110, 5, 23, RACE_ELF},
298 { "暗きホシャック", 25000, 180, 107, 6, 20, RACE_IMP},
299 { "賢者アタール", 30000, 185, 109, 5, 15, RACE_HUMAN},
300 { "清きイベニッド", 10000, 175, 109, 6, 15, RACE_HUMAN},
301 { "エリディシュ", 15000, 185, 110, 5, 23, RACE_HALF_TROLL},
302 { "呪術師ヴルドゥシュ", 25000, 180, 107, 6, 20, RACE_HALF_OGRE},
303 { "狂戦士ハオブ", 30000, 185, 109, 5, 15, RACE_BARBARIAN},
304 { "若きプルーグディシュ", 10000, 175, 109, 6, 15, RACE_HALF_OGRE},
305 { "きちがいラムワイズ", 15000, 185, 110, 5, 23, RACE_YEEK},
306 { "有徳者ムワート", 25000, 180, 107, 6, 20, RACE_KOBOLD},
307 { "弱虫ダードバード", 30000, 185, 109, 5, 15, RACE_SPECTRE},
308 { "質素なルードヴィヒ", 5000, 175, 109, 6, 15, RACE_HUMAN},
309 { "パラディンのガンナー", 10000, 185, 110, 5, 23, RACE_HUMAN},
310 { "選ばれしトリン", 25000, 180, 107, 6, 20, RACE_ELF},
311 { "賢明なるサラストロ", 30000, 185, 109, 5, 15, RACE_DWARF},
312 { "パーシヴァル卿", 25000, 180, 107, 6, 20, RACE_HIGH_ELF},
313 { "神聖なるアセナス", 30000, 185, 109, 5, 15, RACE_HUMAN},
314 { "マッキノン", 10000, 175, 109, 6, 15, RACE_HUMAN},
315 { "謹み婦人", 15000, 185, 110, 5, 23, RACE_HIGH_ELF},
316 { "ドルイドのハシュニック", 25000, 180, 107, 6, 20, RACE_HOBBIT},
317 { "フィナク", 30000, 185, 109, 5, 15, RACE_YEEK},
319 { "Ludwig the Humble", 5000, 175, 109, 6, 15, RACE_DWARF},
320 { "Gunnar the Paladin", 10000, 185, 110, 5, 23, RACE_HALF_TROLL},
321 { "Torin the Chosen", 25000, 180, 107, 6, 20, RACE_HIGH_ELF},
322 { "Sarastro the Wise", 30000, 185, 109, 5, 15, RACE_HUMAN},
323 { "Sir Parsival the Pure", 25000, 180, 107, 6, 20, RACE_HIGH_ELF},
324 { "Asenath the Holy", 30000, 185, 109, 5, 15, RACE_HUMAN},
325 { "McKinnon", 10000, 175, 109, 6, 15, RACE_HUMAN},
326 { "Mistress Chastity", 15000, 185, 110, 5, 23, RACE_HIGH_ELF},
327 { "Hashnik the Druid", 25000, 180, 107, 6, 20, RACE_HOBBIT},
328 { "Finak", 30000, 185, 109, 5, 15, RACE_YEEK},
329 { "Krikkik", 10000, 175, 109, 6, 15, RACE_KLACKON},
330 { "Morival the Wild", 15000, 185, 110, 5, 23, RACE_ELF},
331 { "Hoshak the Dark", 25000, 180, 107, 6, 20, RACE_IMP},
332 { "Atal the Wise", 30000, 185, 109, 5, 15, RACE_HUMAN},
333 { "Ibenidd the Chaste", 10000, 175, 109, 6, 15, RACE_HUMAN},
334 { "Eridish", 15000, 185, 110, 5, 23, RACE_HALF_TROLL},
335 { "Vrudush the Shaman", 25000, 180, 107, 6, 20, RACE_HALF_OGRE},
336 { "Haob the Berserker", 30000, 185, 109, 5, 15, RACE_BARBARIAN},
337 { "Proogdish the Youthfull", 10000, 175, 109, 6, 15, RACE_HALF_OGRE},
338 { "Lumwise the Mad", 15000, 185, 110, 5, 23, RACE_YEEK},
339 { "Muirt the Virtuous", 25000, 180, 107, 6, 20, RACE_KOBOLD},
340 { "Dardobard the Weak", 30000, 185, 109, 5, 15, RACE_SPECTRE},
341 { "Ludwig the Humble", 5000, 175, 109, 6, 15, RACE_DWARF},
342 { "Gunnar the Paladin", 10000, 185, 110, 5, 23, RACE_HALF_TROLL},
343 { "Torin the Chosen", 25000, 180, 107, 6, 20, RACE_HIGH_ELF},
344 { "Sarastro the Wise", 30000, 185, 109, 5, 15, RACE_HUMAN},
345 { "Sir Parsival the Pure", 25000, 180, 107, 6, 20, RACE_HIGH_ELF},
346 { "Asenath the Holy", 30000, 185, 109, 5, 15, RACE_HUMAN},
347 { "McKinnon", 10000, 175, 109, 6, 15, RACE_HUMAN},
348 { "Mistress Chastity", 15000, 185, 110, 5, 23, RACE_HIGH_ELF},
349 { "Hashnik the Druid", 25000, 180, 107, 6, 20, RACE_HOBBIT},
350 { "Finak", 30000, 185, 109, 5, 15, RACE_YEEK},
354 /* Alchemist - 26 unique names */
356 { "化学者マウザー", 10000, 190, 111, 5, 8, RACE_HALF_ELF},
357 { "カオスのウィズル", 10000, 190, 110, 6, 8, RACE_HOBBIT},
358 { "強欲ミダス", 15000, 200, 116, 6, 9, RACE_GNOME},
359 { "貧弱ジャ=ファー", 15000, 220, 111, 4, 9, RACE_ELF},/*FIRST*/
360 { "カカルラカカル", 15000, 200, 116, 6, 9, RACE_KLACKON},
361 { "錬金術師ジャル=エス", 15000, 220, 111, 4, 9, RACE_ELF},
362 { "用心深いファネラス", 10000, 190, 111, 5, 8, RACE_DWARF},
363 { "キチガイのルンシー", 10000, 190, 110, 6, 8, RACE_HUMAN},
364 { "グランブルワース", 15000, 200, 116, 6, 9, RACE_GNOME},
365 { "フリッター", 15000, 220, 111, 4, 9, RACE_SPRITE},
366 { "ザリルス", 10000, 190, 111, 5, 8, RACE_HUMAN},
367 { "古きエグバート", 10000, 190, 110, 6, 8, RACE_DWARF},
368 { "誇り高きヴァリンドラ", 15000, 200, 116, 6, 9, RACE_HIGH_ELF},
369 { "錬金術師タエン", 15000, 220, 111, 4, 9, RACE_HUMAN},
370 { "巧言カイド", 10000, 190, 111, 5, 8, RACE_VAMPIRE},
371 { "暗きフリア", 10000, 190, 110, 6, 8, RACE_NIBELUNG},
372 { "質素なドムリ", 15000, 200, 116, 6, 9, RACE_DWARF},
373 { "魔の子ヤァジュッカ", 15000, 220, 111, 4, 9, RACE_IMP},
374 { "薬草師ジェララルドール", 10000, 190, 111, 5, 8, RACE_HIGH_ELF},
375 { "賢者オレラルダン", 10000, 190, 110, 6, 8, RACE_BARBARIAN},
376 { "デモニシストのフゾグロ", 15000, 200, 116, 6, 9, RACE_IMP},
377 { "錬金術師ドゥリアシュ", 15000, 220, 111, 4, 9, RACE_HALF_ORC},
378 { "強者ネリア", 10000, 190, 111, 5, 8, RACE_CYCLOPS},
379 { "辛口リグナス", 10000, 190, 110, 6, 8, RACE_HALF_ORC},
380 { "ティルバ", 15000, 200, 116, 6, 9, RACE_HOBBIT},
381 { "金持ちミリルドリック", 15000, 220, 111, 4, 9, RACE_HUMAN},
383 { "科学者マウザー", 10000, 190, 111, 5, 8, RACE_HALF_ELF},
384 { "カオスのウィズル", 10000, 190, 110, 6, 8, RACE_HOBBIT},
385 { "強欲ミダス", 15000, 200, 116, 6, 9, RACE_GNOME},
386 { "錬金術師ジャ=ファー", 15000, 220, 111, 4, 9, RACE_ELF},
387 { "カカルラカカル", 15000, 200, 116, 6, 9, RACE_KLACKON},
388 { "錬金術師ジャル=エス", 15000, 220, 111, 4, 9, RACE_ELF},
390 { "Mauser the Chemist", 10000, 190, 111, 5, 8, RACE_HALF_ELF},
391 { "Wizzle the Chaotic", 10000, 190, 110, 6, 8, RACE_HOBBIT},
392 { "Midas the Greedy", 15000, 200, 116, 6, 9, RACE_GNOME},
393 { "Ja-Far the Alchemist", 15000, 220, 111, 4, 9, RACE_ELF},
394 { "Kakalrakakal", 15000, 200, 116, 6, 9, RACE_KLACKON},
395 { "Jal-Eth the Alchemist", 15000, 220, 111, 4, 9, RACE_ELF},
396 { "Fanelath the Cautious", 10000, 190, 111, 5, 8, RACE_DWARF},
397 { "Runcie the Insane", 10000, 190, 110, 6, 8, RACE_HUMAN},
398 { "Grumbleworth", 15000, 200, 116, 6, 9, RACE_GNOME},
399 { "Flitter", 15000, 220, 111, 4, 9, RACE_SPRITE},
400 { "Xarillus", 10000, 190, 111, 5, 8, RACE_HUMAN},
401 { "Egbert the Old", 10000, 190, 110, 6, 8, RACE_DWARF},
402 { "Valindra the Proud", 15000, 200, 116, 6, 9, RACE_HIGH_ELF},
403 { "Taen the Alchemist", 15000, 220, 111, 4, 9, RACE_HUMAN},
404 { "Cayd the Sweet", 10000, 190, 111, 5, 8, RACE_VAMPIRE},
405 { "Fulir the Dark", 10000, 190, 110, 6, 8, RACE_NIBELUNG},
406 { "Domli the Humble", 15000, 200, 116, 6, 9, RACE_DWARF},
407 { "Yaarjukka Demonspawn", 15000, 220, 111, 4, 9, RACE_IMP},
408 { "Gelaraldor the Herbmaster", 10000, 190, 111, 5, 8, RACE_HIGH_ELF},
409 { "Olelaldan the Wise", 10000, 190, 110, 6, 8, RACE_BARBARIAN},
410 { "Fthoglo the Demonicist", 15000, 200, 116, 6, 9, RACE_IMP},
411 { "Dridash the Alchemist", 15000, 220, 111, 4, 9, RACE_HALF_ORC},
412 { "Nelir the Strong", 10000, 190, 111, 5, 8, RACE_CYCLOPS},
413 { "Lignus the Pungent", 10000, 190, 110, 6, 8, RACE_HALF_ORC},
414 { "Tilba", 15000, 200, 116, 6, 9, RACE_HOBBIT},
415 { "Myrildric the Wealthy", 15000, 220, 111, 4, 9, RACE_HUMAN},
417 { "Mauser the Chemist", 10000, 190, 111, 5, 8, RACE_HALF_ELF},
418 { "Wizzle the Chaotic", 10000, 190, 110, 6, 8, RACE_HOBBIT},
419 { "Midas the Greedy", 15000, 200, 116, 6, 9, RACE_GNOME},
420 { "Ja-Far the Alchemist", 15000, 220, 111, 4, 9, RACE_ELF},
421 { "Kakalrakakal", 15000, 200, 116, 6, 9, RACE_KLACKON},
422 { "Jal-Eth the Alchemist", 15000, 220, 111, 4, 9, RACE_ELF},
427 /* Magic Shop - 23 unique names */
429 { "ソーサラーのロ=パン", 20000, 200, 110, 7, 8, RACE_HALF_ELF},
430 { "偉大なるブガービイ", 20000, 215, 113, 6, 10, RACE_GNOME},
431 { "イェンダーの魔法使い", 30000, 200, 110, 7, 10, RACE_HUMAN},
432 { "死霊使いリャク",30000, 175, 110, 5, 11, RACE_HIGH_ELF},
433 { "魔術師スキドゥニー", 15000, 200, 110, 7, 8, RACE_HALF_ELF},
434 { "幻術師キリア", 30000, 200, 110, 7, 10, RACE_HUMAN},
435 { "死霊術師ニッキ", 30000, 175, 110, 5, 11, RACE_DARK_ELF},
436 { "ソロストラン", 15000, 200, 110, 7, 8, RACE_SPRITE},
437 { "烏賊口アチシェ", 20000, 215, 113, 6, 10, RACE_MIND_FLAYER},
438 { "貴族のカザ", 30000, 200, 110, 7, 10, RACE_HIGH_ELF},
439 { "暗きファジル", 30000, 175, 110, 5, 11, RACE_DARK_ELF},
440 { "偉大なるケルドーン", 15000, 200, 110, 7, 8, RACE_DWARF},
441 { "フィランスロプス", 20000, 215, 113, 6, 10, RACE_HOBBIT},
442 { "魔女のアグナー", 30000, 200, 110, 7, 10, RACE_HUMAN},
443 { "死霊術師ビュリアンス", 30000, 175, 110, 5, 11, RACE_BEASTMAN},
444 { "ハイメイジのヴイラク", 15000, 200, 110, 7, 8, RACE_BEASTMAN},
445 { "知恵者マディッシュ", 20000, 215, 113, 6, 10, RACE_BEASTMAN},
446 { "ファレブリンボール", 30000, 200, 110, 7, 10, RACE_HIGH_ELF},
447 { "陰険フェリル=ガンド", 30000, 175, 110, 5, 11, RACE_DARK_ELF},
448 { "呪術師サレゴード", 15000, 200, 110, 7, 8, RACE_BARBARIAN},
449 { "神秘家クトゥアロス", 20000, 215, 113, 6, 10, RACE_MIND_FLAYER},
450 { "幻術師イベリ", 30000, 200, 110, 7, 10, RACE_SKELETON},
451 { "死霊術師ヘトー", 30000, 175, 110, 5, 11, RACE_YEEK},
452 { "魔術師ロ=パン", 20000, 200, 110, 7, 8, RACE_HALF_ELF},
453 { "偉大なるブガービイ", 20000, 215, 113, 6, 10, RACE_GNOME},
454 { "イェンダーの魔法使い", 30000, 200, 110, 7, 10, RACE_HUMAN},
455 { "死霊術師リャク", 30000, 175, 110, 5, 11, RACE_DARK_ELF},
456 { "魔術師スキドゥニー", 15000, 200, 110, 7, 8, RACE_HALF_ELF},
457 { "幻術師キリア", 30000, 200, 110, 7, 10, RACE_HUMAN},
458 { "死霊術師ニッキ", 30000, 175, 110, 5, 11, RACE_DARK_ELF},
459 { "ソロストラン", 15000, 200, 110, 7, 8, RACE_SPRITE},
460 { "烏賊口アチシェ", 20000, 215, 113, 6, 10, RACE_MIND_FLAYER},
462 { "Lo Pan the Sorcerer", 20000, 200, 110, 7, 8, RACE_HALF_ELF},
463 { "Buggerby the Great", 20000, 215, 113, 6, 10, RACE_GNOME},
464 { "The Wizard of Yendor", 30000, 200, 110, 7, 10, RACE_HUMAN},
465 { "Rjak the Necromancer", 30000, 175, 110, 5, 11, RACE_DARK_ELF},
466 { "Skidney the Sorcerer", 15000, 200, 110, 7, 8, RACE_HALF_ELF},
467 { "Kyria the Illusionist", 30000, 200, 110, 7, 10, RACE_HUMAN},
468 { "Nikki the Necromancer", 30000, 175, 110, 5, 11, RACE_DARK_ELF},
469 { "Solostoran", 15000, 200, 110, 7, 8, RACE_SPRITE},
470 { "Achshe the Tentacled", 20000, 215, 113, 6, 10, RACE_MIND_FLAYER},
471 { "Kaza the Noble", 30000, 200, 110, 7, 10, RACE_HIGH_ELF},
472 { "Fazzil the Dark", 30000, 175, 110, 5, 11, RACE_DARK_ELF},
473 { "Keldorn the Grand", 15000, 200, 110, 7, 8, RACE_DWARF},
474 { "Philanthropus", 20000, 215, 113, 6, 10, RACE_HOBBIT},
475 { "Agnar the Enchantress", 30000, 200, 110, 7, 10, RACE_HUMAN},
476 { "Buliance the Necromancer", 30000, 175, 110, 5, 11, RACE_BEASTMAN},
477 { "Vuirak the High-Mage", 15000, 200, 110, 7, 8, RACE_BEASTMAN},
478 { "Madish the Smart", 20000, 215, 113, 6, 10, RACE_BEASTMAN},
479 { "Falebrimbor", 30000, 200, 110, 7, 10, RACE_HIGH_ELF},
480 { "Felil-Gand the Subtle", 30000, 175, 110, 5, 11, RACE_DARK_ELF},
481 { "Thalegord the Shaman", 15000, 200, 110, 7, 8, RACE_BARBARIAN},
482 { "Cthoaloth the Mystic", 20000, 215, 113, 6, 10, RACE_MIND_FLAYER},
483 { "Ibeli the Illusionist", 30000, 200, 110, 7, 10, RACE_SKELETON},
484 { "Heto the Necromancer", 30000, 175, 110, 5, 11, RACE_YEEK},
485 { "Lo Pan the Sorcerer", 20000, 200, 110, 7, 8, RACE_HALF_ELF},
486 { "Buggerby the Great", 20000, 215, 113, 6, 10, RACE_GNOME},
487 { "The Wizard of Yendor", 30000, 200, 110, 7, 10, RACE_HUMAN},
488 { "Rjak the Necromancer", 30000, 175, 110, 5, 11, RACE_DARK_ELF},
489 { "Skidney the Sorcerer", 15000, 200, 110, 7, 8, RACE_HALF_ELF},
490 { "Kyria the Illusionist", 30000, 200, 110, 7, 10, RACE_HUMAN},
491 { "Nikki the Necromancer", 30000, 175, 110, 5, 11, RACE_DARK_ELF},
492 { "Solostoran", 15000, 200, 110, 7, 8, RACE_SPRITE},
493 { "Achshe the Tentacled", 20000, 215, 113, 6, 10, RACE_MIND_FLAYER},
497 /* Black Market - 32 unique names */
499 { "ガリー=ギガズ", 20000, 250, 150, 10, 5, RACE_HALF_TROLL},
500 { "ゴブリンのヒストーア", 20000, 250, 150, 10, 5, RACE_HALF_ORC},
501 { "フェレンギ人クアーク", 30000, 250, 150, 10, 5, RACE_HUMAN},
502 { "公正なる(?)トッピ", 30000, 250, 150, 10, 5, RACE_ELF},
503 { "死人ヴァッサ", 20000, 250, 150, 10, 5, RACE_ZOMBIE},
504 { "裏切り者カイン", 20000, 250, 150, 10, 5, RACE_VAMPIRE},
505 { "ブボニカス", 30000, 250, 150, 10, 5, RACE_BEASTMAN},
506 { "コープスライト", 30000, 250, 150, 10, 5, RACE_SPECTRE},
507 { "血に飢えしパリッシュ", 20000, 250, 150, 10, 5, RACE_VAMPIRE},
508 { "ヴァイル", 20000, 250, 150, 10, 5, RACE_SKELETON},
509 { "信頼のプレンティス", 30000, 250, 150, 10, 5, RACE_SKELETON},
510 { "人間殺しのグリエラ", 30000, 250, 150, 10, 5, RACE_IMP},
511 { "エンジェル", 20000, 250, 150, 10, 5, RACE_VAMPIRE},
512 { "水膨れフロツァム", 20000, 250, 150, 10, 5, RACE_ZOMBIE},
513 { "ニーヴァル", 30000, 250, 150, 10, 5, RACE_VAMPIRE},
514 { "明るいアナスタシア", 30000, 250, 150, 10, 5, RACE_SPECTRE},
515 { "死霊術師チャリティー", 20000, 250, 150, 10, 5, RACE_DARK_ELF},
516 { "ボクサーのプグナシオス", 20000, 250, 150, 10, 5, RACE_HALF_ORC},
517 { "幸運なフットソア", 30000, 250, 150, 10, 5, RACE_BEASTMAN},
518 { "光指のシドリア", 30000, 250, 150, 10, 5, RACE_HUMAN},
519 { "手品師リアソー", 20000, 250, 150, 10, 5, RACE_HOBBIT},
520 { "やりくり上手のジャナッカ", 20000, 250, 150, 10, 5, RACE_GNOME},
521 { "悪党シーナ", 30000, 250, 150, 10, 5, RACE_GNOME},
522 { "大爪アルニッキ", 30000, 250, 150, 10, 5, RACE_DRACONIAN},
523 { "貧乏チャエアンド", 20000, 250, 150, 10, 5, RACE_HUMAN},
524 { "山賊アファードーフ", 20000, 250, 150, 10, 5, RACE_BARBARIAN},
525 { "強欲ラザクスル", 30000, 250, 150, 10, 5, RACE_MIND_FLAYER},
526 { "ファラレウィン", 30000, 250, 150, 10, 5, RACE_SPRITE},
527 { "しわしわヴォスール", 20000, 250, 150, 10, 5, RACE_NIBELUNG},
528 { "ハンサムなアラオード", 20000, 250, 150, 10, 5, RACE_AMBERITE},
529 { "負け犬セラドフリド", 30000, 250, 150, 10, 5, RACE_HUMAN},
530 { "片足のエルーロ", 30000, 250, 150, 10, 5, RACE_HALF_OGRE},
532 { "Gary Gygaz", 20000, 250, 150, 10, 5, RACE_HALF_TROLL},
533 { "Histor the Goblin", 20000, 250, 150, 10, 5, RACE_HALF_ORC},
534 { "Quark the Ferengi", 30000, 250, 150, 10, 5, RACE_DWARF},
535 { "Topi the Fair(?)", 30000, 250, 150, 10, 5, RACE_HUMAN},
536 { "Vhassa the Dead", 20000, 250, 150, 10, 5, RACE_ZOMBIE},
537 { "Kyn the Treacherous", 20000, 250, 150, 10, 5, RACE_VAMPIRE},
538 { "Bubonicus", 30000, 250, 150, 10, 5, RACE_BEASTMAN},
539 { "Corpselight", 30000, 250, 150, 10, 5, RACE_SPECTRE},
540 { "Parrish the Bloodthirsty", 20000, 250, 150, 10, 5, RACE_VAMPIRE},
541 { "Vile", 20000, 250, 150, 10, 5, RACE_SKELETON},
542 { "Prentice the Trusted", 30000, 250, 150, 10, 5, RACE_SKELETON},
543 { "Griella Humanslayer", 30000, 250, 150, 10, 5, RACE_IMP},
544 { "Angel", 20000, 250, 150, 10, 5, RACE_VAMPIRE},
545 { "Flotsam the Bloated", 20000, 250, 150, 10, 5, RACE_ZOMBIE},
546 { "Nieval", 30000, 250, 150, 10, 5, RACE_VAMPIRE},
547 { "Anastasia the Luminous", 30000, 250, 150, 10, 5, RACE_SPECTRE},
548 { "Charity the Necromancer", 20000, 250, 150, 10, 5, RACE_DARK_ELF},
549 { "Pugnacious the Pugilist", 20000, 250, 150, 10, 5, RACE_HALF_ORC},
550 { "Footsore the Lucky", 30000, 250, 150, 10, 5, RACE_BEASTMAN},
551 { "Sidria Lighfingered", 30000, 250, 150, 10, 5, RACE_HUMAN},
552 { "Riatho the Juggler", 20000, 250, 150, 10, 5, RACE_HOBBIT},
553 { "Janaaka the Shifty", 20000, 250, 150, 10, 5, RACE_GNOME},
554 { "Cina the Rogue", 30000, 250, 150, 10, 5, RACE_GNOME},
555 { "Arunikki Greatclaw", 30000, 250, 150, 10, 5, RACE_DRACONIAN},
556 { "Chaeand the Poor", 20000, 250, 150, 10, 5, RACE_HUMAN},
557 { "Afardorf the Brigand", 20000, 250, 150, 10, 5, RACE_BARBARIAN},
558 { "Lathaxl the Greedy", 30000, 250, 150, 10, 5, RACE_MIND_FLAYER},
559 { "Falarewyn", 30000, 250, 150, 10, 5, RACE_SPRITE},
560 { "Vosur the Wrinkled", 20000, 250, 150, 10, 5, RACE_NIBELUNG},
561 { "Araord the Handsome", 20000, 250, 150, 10, 5, RACE_AMBERITE},
562 { "Theradfrid the Loser", 30000, 250, 150, 10, 5, RACE_HUMAN},
563 { "One-Legged Eroolo", 30000, 250, 150, 10, 5, RACE_HALF_OGRE},
569 { "我が家", 0, 100, 100, 0, 99, 99},
570 { "我が家", 0, 100, 100, 0, 99, 99},
571 { "我が家", 0, 100, 100, 0, 99, 99},
572 { "我が家", 0, 100, 100, 0, 99, 99},
573 { "我が家", 0, 100, 100, 0, 99, 99},
574 { "我が家", 0, 100, 100, 0, 99, 99},
575 { "我が家", 0, 100, 100, 0, 99, 99},
576 { "我が家", 0, 100, 100, 0, 99, 99},
577 { "我が家", 0, 100, 100, 0, 99, 99},
578 { "我が家", 0, 100, 100, 0, 99, 99},
579 { "我が家", 0, 100, 100, 0, 99, 99},
580 { "我が家", 0, 100, 100, 0, 99, 99},
581 { "我が家", 0, 100, 100, 0, 99, 99},
582 { "我が家", 0, 100, 100, 0, 99, 99},
583 { "我が家", 0, 100, 100, 0, 99, 99},
584 { "我が家", 0, 100, 100, 0, 99, 99},
585 { "我が家", 0, 100, 100, 0, 99, 99},
586 { "我が家", 0, 100, 100, 0, 99, 99},
587 { "我が家", 0, 100, 100, 0, 99, 99},
588 { "我が家", 0, 100, 100, 0, 99, 99},
589 { "我が家", 0, 100, 100, 0, 99, 99},
590 { "我が家", 0, 100, 100, 0, 99, 99},
591 { "我が家", 0, 100, 100, 0, 99, 99},
592 { "我が家", 0, 100, 100, 0, 99, 99},
593 { "我が家", 0, 100, 100, 0, 99, 99},
594 { "我が家", 0, 100, 100, 0, 99, 99},
595 { "我が家", 0, 100, 100, 0, 99, 99},
596 { "我が家", 0, 100, 100, 0, 99, 99},
597 { "我が家", 0, 100, 100, 0, 99, 99},
598 { "我が家", 0, 100, 100, 0, 99, 99},
599 { "我が家", 0, 100, 100, 0, 99, 99},
600 { "我が家", 0, 100, 100, 0, 99, 99},
602 { "Your home", 0, 100, 100, 0, 99, 99},
603 { "Your home", 0, 100, 100, 0, 99, 99},
604 { "Your home", 0, 100, 100, 0, 99, 99},
605 { "Your home", 0, 100, 100, 0, 99, 99},
606 { "Your home", 0, 100, 100, 0, 99, 99},
607 { "Your home", 0, 100, 100, 0, 99, 99},
608 { "Your home", 0, 100, 100, 0, 99, 99},
609 { "Your home", 0, 100, 100, 0, 99, 99},
610 { "Your home", 0, 100, 100, 0, 99, 99},
611 { "Your home", 0, 100, 100, 0, 99, 99},
612 { "Your home", 0, 100, 100, 0, 99, 99},
613 { "Your home", 0, 100, 100, 0, 99, 99},
614 { "Your home", 0, 100, 100, 0, 99, 99},
615 { "Your home", 0, 100, 100, 0, 99, 99},
616 { "Your home", 0, 100, 100, 0, 99, 99},
617 { "Your home", 0, 100, 100, 0, 99, 99},
618 { "Your home", 0, 100, 100, 0, 99, 99},
619 { "Your home", 0, 100, 100, 0, 99, 99},
620 { "Your home", 0, 100, 100, 0, 99, 99},
621 { "Your home", 0, 100, 100, 0, 99, 99},
622 { "Your home", 0, 100, 100, 0, 99, 99},
623 { "Your home", 0, 100, 100, 0, 99, 99},
624 { "Your home", 0, 100, 100, 0, 99, 99},
625 { "Your home", 0, 100, 100, 0, 99, 99},
626 { "Your home", 0, 100, 100, 0, 99, 99},
627 { "Your home", 0, 100, 100, 0, 99, 99},
628 { "Your home", 0, 100, 100, 0, 99, 99},
629 { "Your home", 0, 100, 100, 0, 99, 99},
630 { "Your home", 0, 100, 100, 0, 99, 99},
631 { "Your home", 0, 100, 100, 0, 99, 99},
632 { "Your home", 0, 100, 100, 0, 99, 99},
633 { "Your home", 0, 100, 100, 0, 99, 99},
639 /* Bookstore - 21 unique names */
641 { "強欲ドラフ", 10000, 175, 108, 4, 12, RACE_HUMAN},
642 { "賢者オドナー", 15000, 120, 105, 6, 16, RACE_HIGH_ELF},
643 { "中立のガンダー", 25000, 120, 110, 7, 19, RACE_DARK_ELF},
644 { "忍耐の人ロ=シャ", 30000, 140, 105, 6, 12, RACE_ELF},
645 { "ランドルフ・カーター", 15000, 175, 108, 4, 12, RACE_HUMAN},
646 { "隼のサライ", 15000, 175, 108, 4, 12, RACE_HUMAN},
647 { "千里眼ボドリル", 20000, 120, 105, 6, 16, RACE_HIGH_ELF},
648 { "沈黙のヴェオロイン", 25000, 120, 110, 7, 19, RACE_ZOMBIE},
649 { "学者のヴァンシラス", 30000, 140, 105, 6, 12, RACE_MIND_FLAYER},
650 { "物書きオセイン", 15000, 175, 108, 4, 12, RACE_SKELETON},
651 { "本の虫オルヴァー", 20000, 120, 105, 6, 16, RACE_VAMPIRE},
652 { "浅井墓男", 25000, 120, 110, 7, 19, RACE_ZOMBIE},
653 { "デスマスク", 30000, 140, 105, 6, 12, RACE_ZOMBIE},
654 { "学者のアスーヌ", 15000, 175, 108, 4, 12, RACE_MIND_FLAYER},
655 { "死人のプリランド", 20000, 120, 105, 6, 16, RACE_ZOMBIE},
656 { "鉄のロナール", 25000, 120, 110, 7, 19, RACE_GOLEM},
658 { "Dolaf the Greedy", 10000, 175, 108, 4, 12, RACE_HUMAN},
659 { "Odnar the Sage", 15000, 120, 105, 6, 16, RACE_HIGH_ELF},
660 { "Gandar the Neutral", 25000, 120, 110, 7, 19, RACE_DARK_ELF},
661 { "Ro-sha the Patient", 30000, 140, 105, 6, 12, RACE_ELF},
662 { "Randolph Carter", 15000, 175, 108, 4, 12, RACE_HUMAN},
663 { "Sarai the Swift", 15000, 175, 108, 4, 12, RACE_HUMAN},
664 { "Bodril the Seer", 20000, 120, 105, 6, 16, RACE_HIGH_ELF},
665 { "Veloin the Quiet", 25000, 120, 110, 7, 19, RACE_ZOMBIE},
666 { "Vanthylas the Learned", 30000, 140, 105, 6, 12, RACE_MIND_FLAYER},
667 { "Ossein the Literate", 15000, 175, 108, 4, 12, RACE_SKELETON},
668 { "Olvar Bookworm", 20000, 120, 105, 6, 16, RACE_VAMPIRE},
669 { "Shallowgrave", 25000, 120, 110, 7, 19, RACE_ZOMBIE},
670 { "Death Mask", 30000, 140, 105, 6, 12, RACE_ZOMBIE},
671 { "Asuunu the Learned", 15000, 175, 108, 4, 12, RACE_MIND_FLAYER},
672 { "Prirand the Dead", 20000, 120, 105, 6, 16, RACE_ZOMBIE},
673 { "Ronar the Iron", 25000, 120, 110, 7, 19, RACE_GOLEM},
676 { "ガリル=ガミル", 30000, 140, 105, 6, 12, RACE_ELF},
677 { "本食いローバグ", 15000, 175, 108, 4, 12, RACE_KOBOLD},
678 { "キリアリキーク", 20000, 120, 105, 6, 16, RACE_KLACKON},
679 { "静かなるリリン", 25000, 120, 110, 7, 19, RACE_DWARF},
680 { "王者イサング", 30000, 140, 105, 6, 12, RACE_HIGH_ELF},
681 { "強欲ドラフ", 10000, 175, 108, 4, 12, RACE_HUMAN},
682 { "賢者オドナー", 15000, 120, 105, 6, 16, RACE_HIGH_ELF},
683 { "中立のガンダー", 25000, 120, 110, 7, 19, RACE_DARK_ELF},
684 { "忍耐の人ロ=シャ", 30000, 140, 105, 6, 12, RACE_ELF},
685 { "ランドルフ・カーター", 15000, 175, 108, 4, 12, RACE_HUMAN},
686 { "隼サライ", 15000, 175, 108, 4, 12, RACE_HUMAN},
687 { "千里眼ボドリル", 20000, 120, 105, 6, 16, RACE_HIGH_ELF},
688 { "沈黙のヴェオロイン", 25000, 120, 110, 7, 19, RACE_ZOMBIE},
689 { "学者のヴァンシラス", 30000, 140, 105, 6, 12, RACE_MIND_FLAYER},
690 { "物書きオセイン", 15000, 175, 108, 4, 12, RACE_SKELETON},
691 { "本の虫オルヴァー", 20000, 120, 105, 6, 16, RACE_VAMPIRE},
693 { "Galil-Gamir", 30000, 140, 105, 6, 12, RACE_ELF},
694 { "Rorbag Book-Eater", 15000, 175, 108, 4, 12, RACE_KOBOLD},
695 { "Kiriarikirk", 20000, 120, 105, 6, 16, RACE_KLACKON},
696 { "Rilin the Quiet", 25000, 120, 110, 7, 19, RACE_DWARF},
697 { "Isung the Lord", 30000, 140, 105, 6, 12, RACE_HIGH_ELF},
698 { "Dolaf the Greedy", 10000, 175, 108, 4, 12, RACE_HUMAN},
699 { "Odnar the Sage", 15000, 120, 105, 6, 16, RACE_HIGH_ELF},
700 { "Gandar the Neutral", 25000, 120, 110, 7, 19, RACE_DARK_ELF},
701 { "Ro-sha the Patient", 30000, 140, 105, 6, 12, RACE_ELF},
702 { "Randolph Carter", 15000, 175, 108, 4, 12, RACE_HUMAN},
703 { "Sarai the Swift", 15000, 175, 108, 4, 12, RACE_HUMAN},
704 { "Bodril the Seer", 20000, 120, 105, 6, 16, RACE_HIGH_ELF},
705 { "Veloin the Quiet", 25000, 120, 110, 7, 19, RACE_ZOMBIE},
706 { "Vanthylas the Learned", 30000, 140, 105, 6, 12, RACE_MIND_FLAYER},
707 { "Ossein the Literate", 15000, 175, 108, 4, 12, RACE_SKELETON},
708 { "Olvar Bookworm", 20000, 120, 105, 6, 16, RACE_VAMPIRE},
715 { "博物館", 0, 100, 100, 0, 99, 99},
716 { "博物館", 0, 100, 100, 0, 99, 99},
717 { "博物館", 0, 100, 100, 0, 99, 99},
718 { "博物館", 0, 100, 100, 0, 99, 99},
719 { "博物館", 0, 100, 100, 0, 99, 99},
720 { "博物館", 0, 100, 100, 0, 99, 99},
721 { "博物館", 0, 100, 100, 0, 99, 99},
722 { "博物館", 0, 100, 100, 0, 99, 99},
723 { "博物館", 0, 100, 100, 0, 99, 99},
724 { "博物館", 0, 100, 100, 0, 99, 99},
725 { "博物館", 0, 100, 100, 0, 99, 99},
726 { "博物館", 0, 100, 100, 0, 99, 99},
727 { "博物館", 0, 100, 100, 0, 99, 99},
728 { "博物館", 0, 100, 100, 0, 99, 99},
729 { "博物館", 0, 100, 100, 0, 99, 99},
730 { "博物館", 0, 100, 100, 0, 99, 99},
731 { "博物館", 0, 100, 100, 0, 99, 99},
732 { "博物館", 0, 100, 100, 0, 99, 99},
733 { "博物館", 0, 100, 100, 0, 99, 99},
734 { "博物館", 0, 100, 100, 0, 99, 99},
735 { "博物館", 0, 100, 100, 0, 99, 99},
736 { "博物館", 0, 100, 100, 0, 99, 99},
737 { "博物館", 0, 100, 100, 0, 99, 99},
738 { "博物館", 0, 100, 100, 0, 99, 99},
739 { "博物館", 0, 100, 100, 0, 99, 99},
740 { "博物館", 0, 100, 100, 0, 99, 99},
741 { "博物館", 0, 100, 100, 0, 99, 99},
742 { "博物館", 0, 100, 100, 0, 99, 99},
743 { "博物館", 0, 100, 100, 0, 99, 99},
744 { "博物館", 0, 100, 100, 0, 99, 99},
745 { "博物館", 0, 100, 100, 0, 99, 99},
746 { "博物館", 0, 100, 100, 0, 99, 99},
748 { "Museum", 0, 100, 100, 0, 99, 99},
749 { "Museum", 0, 100, 100, 0, 99, 99},
750 { "Museum", 0, 100, 100, 0, 99, 99},
751 { "Museum", 0, 100, 100, 0, 99, 99},
752 { "Museum", 0, 100, 100, 0, 99, 99},
753 { "Museum", 0, 100, 100, 0, 99, 99},
754 { "Museum", 0, 100, 100, 0, 99, 99},
755 { "Museum", 0, 100, 100, 0, 99, 99},
756 { "Museum", 0, 100, 100, 0, 99, 99},
757 { "Museum", 0, 100, 100, 0, 99, 99},
758 { "Museum", 0, 100, 100, 0, 99, 99},
759 { "Museum", 0, 100, 100, 0, 99, 99},
760 { "Museum", 0, 100, 100, 0, 99, 99},
761 { "Museum", 0, 100, 100, 0, 99, 99},
762 { "Museum", 0, 100, 100, 0, 99, 99},
763 { "Museum", 0, 100, 100, 0, 99, 99},
764 { "Museum", 0, 100, 100, 0, 99, 99},
765 { "Museum", 0, 100, 100, 0, 99, 99},
766 { "Museum", 0, 100, 100, 0, 99, 99},
767 { "Museum", 0, 100, 100, 0, 99, 99},
768 { "Museum", 0, 100, 100, 0, 99, 99},
769 { "Museum", 0, 100, 100, 0, 99, 99},
770 { "Museum", 0, 100, 100, 0, 99, 99},
771 { "Museum", 0, 100, 100, 0, 99, 99},
772 { "Museum", 0, 100, 100, 0, 99, 99},
773 { "Museum", 0, 100, 100, 0, 99, 99},
774 { "Museum", 0, 100, 100, 0, 99, 99},
775 { "Museum", 0, 100, 100, 0, 99, 99},
776 { "Museum", 0, 100, 100, 0, 99, 99},
777 { "Museum", 0, 100, 100, 0, 99, 99},
778 { "Museum", 0, 100, 100, 0, 99, 99},
779 { "Museum", 0, 100, 100, 0, 99, 99},
786 static int cur_store_num = 0;
787 static int store_top = 0;
788 static int store_bottom = 0;
789 static int xtra_stock = 0;
790 static store_type *st_ptr = NULL;
791 static const owner_type *ot_ptr = NULL;
792 static s16b old_town_num = 0;
793 static s16b inner_town_num = 0;
794 #define RUMOR_CHANCE 8
796 #define MAX_COMMENT_1 6
798 static concptr comment_1[MAX_COMMENT_1] =
819 /*! ブラックマーケット追加メッセージ(承諾) */
820 static concptr comment_1_B[MAX_COMMENT_1] = {
829 #define MAX_COMMENT_2A 2
831 static concptr comment_2a[MAX_COMMENT_2A] =
834 "私の忍耐力を試しているのかい? $%s が最後だ。",
835 "我慢にも限度があるぞ。 $%s が最後だ。"
837 "You try my patience. %s is final.",
838 "My patience grows thin. %s is final."
843 #define MAX_COMMENT_2B 12
845 static concptr comment_2b[MAX_COMMENT_2B] =
848 " $%s ぐらいは出さなきゃダメだよ。",
851 "何て奴だ! $%s 以下はあり得ないぞ。",
852 "それじゃ少なすぎる! $%s は欲しいところだ。",
853 "バカにしている! $%s はもらわないと。",
855 "おいおい! $%s を考えてくれないか?",
856 "1000匹のオークのノミに苦しめられるがいい! $%s だ。",
857 "お前の大切なものに災いあれ! $%s でどうだ。",
858 "モルゴスに賞味されるがいい!本当は $%s なんだろう?",
859 "お前の母親はオーガか! $%s は出すつもりなんだろ?"
861 "I can take no less than %s gold pieces.",
862 "I will accept no less than %s gold pieces.",
863 "Ha! No less than %s gold pieces.",
864 "You knave! No less than %s gold pieces.",
865 "That's a pittance! I want %s gold pieces.",
866 "That's an insult! I want %s gold pieces.",
867 "As if! How about %s gold pieces?",
868 "My arse! How about %s gold pieces?",
869 "May the fleas of 1000 orcs molest you! Try %s gold pieces.",
870 "May your most favourite parts go moldy! Try %s gold pieces.",
871 "May Morgoth find you tasty! Perhaps %s gold pieces?",
872 "Your mother was an Ogre! Perhaps %s gold pieces?"
878 /*! ブラックマーケット用追加メッセージ(売るとき) */
879 static concptr comment_2b_B[MAX_COMMENT_2B] = {
880 "いくら俺様がお人好しとはいえ $%s が限界だね。嫌なら帰りな。",
881 "金がないのかい、あんた?まずは家に帰って $%s 揃えてきな。",
882 "物の価値が分からん奴だな。これは $%s が普通なんだよ。",
883 "俺の付けた値段に文句があるのか? $%s が限界だ。",
884 "ひょっとして新手の冗談かい? $%s 持ってないなら帰りな。",
885 "うちは他の店とは違うんだよ。$%s ぐらいは出しな。",
886 "買う気がないなら帰りな。 $%s だと言っているんだ。",
887 "話にならないね。 $%s くらい持っているんだろ?",
888 "は?なんだそりゃ? $%s の間違いか、ひょっとして?",
889 "出口はあっちだよ。それとも $%s 出せるのかい、あんたに。",
890 "命知らずな奴だな。 $%s 出せば今日の所は勘弁してやるよ。",
891 "うちの店は貧乏人お断りだ。 $%s ぐらい出せないのかい?"
894 #define MAX_COMMENT_3A 2
896 static concptr comment_3a[MAX_COMMENT_3A] =
899 "私の忍耐力を試しているのかい? $%s が最後だ。",
900 "我慢にも限度があるぞ。 $%s が最後だ。"
902 "You try my patience. %s is final.",
903 "My patience grows thin. %s is final."
909 #define MAX_COMMENT_3B 12
911 static concptr comment_3b[MAX_COMMENT_3B] =
914 "本音を言うと $%s でいいんだろ?",
916 " $%s ぐらいなら出してもいいが。",
917 " $%s 以上払うなんて考えられないね。",
918 "まあ落ちついて。 $%s でどうだい?",
919 "そのガラクタなら $%s で引き取るよ。",
920 "それじゃ高すぎる! $%s がいいとこだろ。",
921 "どうせいらないんだろ! $%s でいいだろ?",
922 "だめだめ! $%s がずっとお似合いだよ。",
923 "バカにしている! $%s がせいぜいだ。",
924 " $%s なら嬉しいところだがなあ。",
925 " $%s 、それ以上はビタ一文出さないよ!"
927 "Perhaps %s gold pieces?",
928 "How about %s gold pieces?",
929 "I will pay no more than %s gold pieces.",
930 "I can afford no more than %s gold pieces.",
931 "Be reasonable. How about %s gold pieces?",
932 "I'll buy it as scrap for %s gold pieces.",
933 "That is too much! How about %s gold pieces?",
934 "That looks war surplus! Say %s gold pieces?",
935 "Never! %s is more like it.",
936 "That's an insult! %s is more like it.",
937 "%s gold pieces and be thankful for it!",
938 "%s gold pieces and not a copper more!"
944 /*! ブラックマーケット用追加メッセージ(買い取り) */
945 static concptr comment_3b_B[MAX_COMMENT_3B] = {
946 " $%s ってところだね。そのどうしようもないガラクタは。",
947 "この俺が $%s って言っているんだから、その通りにした方が身のためだぞ。",
948 "俺の優しさに甘えるのもいい加減にしておけ。 $%s だ。",
949 "その品なら $%s で売ってくれているがね、常識ある紳士はみんな。",
950 "こりゃまた、がめつい奴だな。いくら俺が温厚とはいえ $%s が限界だ。",
951 " $%s だ。別に俺はそんなガラクタ欲しくはないんだから。",
952 "俺の鑑定額が気に入らないのか? $%s 、嫌なら帰りな。",
953 " $%s で引き取ってやるよ。喜んで受け取りな、貧乏人。",
954 "物の価値が分からん奴は始末におえんな。それは $%s なんだよ。",
955 "そんなに金が欲しいのか、あんた? $%s で満足できんのか?",
956 "入る店間違えてんじゃないのか? $%s で嫌なら他をあたってくれ。",
957 "俺の言い値にケチをつける奴がいるとは! その度胸に免じて $%s だ。"
960 #define MAX_COMMENT_4A 4
962 static concptr comment_4a[MAX_COMMENT_4A] =
965 "もうたくさんだ!何度も私をわずらわせないでくれ!",
966 "うがー!一日の我慢の限度を超えている!",
967 "もういい!時間の無駄以外のなにものでもない!",
968 "もうやってられないよ!顔も見たくない!"
970 "Enough! You have abused me once too often!",
971 "Arghhh! I have had enough abuse for one day!",
972 "That does it! You shall waste my time no more!",
973 "This is getting nowhere! I'm going to Londis!"
979 /*! ブラックマーケット用追加メッセージ(怒りの頂点) */
980 static concptr comment_4a_B[MAX_COMMENT_4A] = {
981 "なめやがって!温厚な俺様でも限界があるってことを知れ!",
982 "俺をここまで怒らせて...命があるだけでもありがたいと思え!",
983 "ふざけてるのか!冷やかしなら相手を見てからにしろ!",
984 "いいかげんにしろ!今度こんなまねしたらただじゃおかねえぞ!"
987 #define MAX_COMMENT_4B 4
989 static concptr comment_4b[MAX_COMMENT_4B] =
998 "Get out of my sight!",
999 "Begone, you scoundrel!",
1006 /*! ブラックマーケット用追加メッセージ(追い出し) */
1007 static concptr comment_4b_B[MAX_COMMENT_4B] = {
1014 #define MAX_COMMENT_5 8
1016 static concptr comment_5[MAX_COMMENT_5] =
1030 "You will have to do better than that!",
1031 "Do you wish to do business or not?",
1032 "You've got to be kidding!",
1033 "You'd better be kidding!",
1034 "You try my patience.",
1035 "Hmmm, nice weather we're having."
1041 /*! ブラックマーケット用追加メッセージ(怒り) */
1042 static concptr comment_5_B[MAX_COMMENT_5] = {
1053 #define MAX_COMMENT_6 4
1055 static concptr comment_6[MAX_COMMENT_6] =
1063 "I must have heard you wrong.",
1064 "I'm sorry, I missed that.",
1065 "I'm sorry, what was that?",
1066 "Sorry, what was that again?"
1071 /*** Initialize others ***/
1074 * 店舗で販売するオブジェクトを定義する / Hack -- Objects sold in the stores -- by tval/sval pair.
1076 byte store_table[MAX_STORES][STORE_CHOICES][2] =
1081 { TV_FOOD, SV_FOOD_RATION },
1082 { TV_FOOD, SV_FOOD_RATION },
1083 { TV_FOOD, SV_FOOD_RATION },
1084 { TV_FOOD, SV_FOOD_RATION },
1086 { TV_FOOD, SV_FOOD_RATION },
1087 { TV_FOOD, SV_FOOD_BISCUIT },
1088 { TV_FOOD, SV_FOOD_JERKY },
1089 { TV_FOOD, SV_FOOD_JERKY },
1091 { TV_FOOD, SV_FOOD_PINT_OF_WINE },
1092 { TV_FOOD, SV_FOOD_PINT_OF_ALE },
1093 { TV_LITE, SV_LITE_TORCH },
1094 { TV_LITE, SV_LITE_TORCH },
1096 { TV_LITE, SV_LITE_TORCH },
1097 { TV_LITE, SV_LITE_TORCH },
1098 { TV_LITE, SV_LITE_LANTERN },
1099 { TV_LITE, SV_LITE_LANTERN },
1111 { TV_SHOT, SV_AMMO_NORMAL },
1112 { TV_ARROW, SV_AMMO_NORMAL },
1113 { TV_BOLT, SV_AMMO_NORMAL },
1114 { TV_DIGGING, SV_SHOVEL },
1116 { TV_DIGGING, SV_PICK },
1117 { TV_CLOAK, SV_CLOAK },
1118 { TV_CLOAK, SV_CLOAK },
1119 { TV_CLOAK, SV_FUR_CLOAK },
1121 { TV_FOOD, SV_FOOD_RATION },
1122 { TV_FOOD, SV_FOOD_RATION },
1123 { TV_FOOD, SV_FOOD_RATION },
1124 { TV_FOOD, SV_FOOD_RATION },
1126 { TV_POTION, SV_POTION_WATER },
1127 { TV_POTION, SV_POTION_WATER },
1128 { TV_LITE, SV_LITE_LANTERN },
1129 { TV_LITE, SV_LITE_LANTERN },
1131 { TV_FOOD, SV_FOOD_WAYBREAD },
1132 { TV_FOOD, SV_FOOD_WAYBREAD },
1136 { TV_SHOT, SV_AMMO_NORMAL },
1137 { TV_ARROW, SV_AMMO_NORMAL },
1138 { TV_BOLT, SV_AMMO_NORMAL },
1139 { TV_DIGGING, SV_SHOVEL }
1145 { TV_BOOTS, SV_PAIR_OF_SOFT_LEATHER_BOOTS },
1146 { TV_BOOTS, SV_PAIR_OF_SOFT_LEATHER_BOOTS },
1147 { TV_BOOTS, SV_PAIR_OF_HARD_LEATHER_BOOTS },
1148 { TV_BOOTS, SV_PAIR_OF_HARD_LEATHER_BOOTS },
1150 { TV_HELM, SV_HARD_LEATHER_CAP },
1151 { TV_HELM, SV_HARD_LEATHER_CAP },
1152 { TV_HELM, SV_METAL_CAP },
1153 { TV_HELM, SV_IRON_HELM },
1155 { TV_SOFT_ARMOR, SV_ROBE },
1156 { TV_SOFT_ARMOR, SV_ROBE },
1157 { TV_SOFT_ARMOR, SV_SOFT_LEATHER_ARMOR },
1158 { TV_SOFT_ARMOR, SV_SOFT_LEATHER_ARMOR },
1160 { TV_SOFT_ARMOR, SV_HARD_LEATHER_ARMOR },
1161 { TV_SOFT_ARMOR, SV_HARD_LEATHER_ARMOR },
1162 { TV_SOFT_ARMOR, SV_HARD_STUDDED_LEATHER },
1163 { TV_SOFT_ARMOR, SV_HARD_STUDDED_LEATHER },
1165 { TV_SOFT_ARMOR, SV_RHINO_HIDE_ARMOR },
1166 { TV_SOFT_ARMOR, SV_LEATHER_SCALE_MAIL },
1167 { TV_HARD_ARMOR, SV_METAL_SCALE_MAIL },
1168 { TV_HARD_ARMOR, SV_CHAIN_MAIL },
1170 { TV_HARD_ARMOR, SV_DOUBLE_RING_MAIL },
1171 { TV_HARD_ARMOR, SV_AUGMENTED_CHAIN_MAIL },
1172 { TV_HARD_ARMOR, SV_BAR_CHAIN_MAIL },
1173 { TV_HARD_ARMOR, SV_DOUBLE_CHAIN_MAIL },
1175 { TV_HARD_ARMOR, SV_METAL_BRIGANDINE_ARMOUR },
1176 { TV_HARD_ARMOR, SV_SPLINT_MAIL },
1177 { TV_GLOVES, SV_SET_OF_LEATHER_GLOVES },
1178 { TV_GLOVES, SV_SET_OF_LEATHER_GLOVES },
1180 { TV_GLOVES, SV_SET_OF_GAUNTLETS },
1181 { TV_SHIELD, SV_SMALL_LEATHER_SHIELD },
1182 { TV_SHIELD, SV_LARGE_LEATHER_SHIELD },
1183 { TV_SHIELD, SV_SMALL_METAL_SHIELD },
1185 { TV_BOOTS, SV_PAIR_OF_HARD_LEATHER_BOOTS },
1186 { TV_BOOTS, SV_PAIR_OF_HARD_LEATHER_BOOTS },
1187 { TV_HELM, SV_HARD_LEATHER_CAP },
1188 { TV_HELM, SV_HARD_LEATHER_CAP },
1190 { TV_SOFT_ARMOR, SV_ROBE },
1191 { TV_SOFT_ARMOR, SV_SOFT_LEATHER_ARMOR },
1192 { TV_SOFT_ARMOR, SV_SOFT_LEATHER_ARMOR },
1193 { TV_SOFT_ARMOR, SV_HARD_LEATHER_ARMOR },
1195 { TV_SOFT_ARMOR, SV_LEATHER_JACK },
1196 { TV_HARD_ARMOR, SV_METAL_SCALE_MAIL },
1197 { TV_HARD_ARMOR, SV_CHAIN_MAIL },
1198 { TV_HARD_ARMOR, SV_CHAIN_MAIL },
1200 { TV_GLOVES, SV_SET_OF_LEATHER_GLOVES },
1201 { TV_GLOVES, SV_SET_OF_GAUNTLETS },
1202 { TV_SHIELD, SV_SMALL_LEATHER_SHIELD },
1203 { TV_SHIELD, SV_SMALL_LEATHER_SHIELD }
1209 { TV_SWORD, SV_DAGGER },
1210 { TV_SWORD, SV_MAIN_GAUCHE },
1211 { TV_SWORD, SV_RAPIER },
1212 { TV_SWORD, SV_SMALL_SWORD },
1214 { TV_SWORD, SV_SHORT_SWORD },
1215 { TV_SWORD, SV_SABRE },
1216 { TV_SWORD, SV_CUTLASS },
1217 { TV_SWORD, SV_TULWAR },
1219 { TV_SWORD, SV_BROAD_SWORD },
1220 { TV_SWORD, SV_LONG_SWORD },
1221 { TV_SWORD, SV_SCIMITAR },
1222 { TV_SWORD, SV_KATANA },
1224 { TV_SWORD, SV_BASTARD_SWORD },
1225 { TV_POLEARM, SV_SPEAR },
1226 { TV_POLEARM, SV_AWL_PIKE },
1227 { TV_POLEARM, SV_TRIDENT },
1229 { TV_POLEARM, SV_PIKE },
1230 { TV_POLEARM, SV_BEAKED_AXE },
1231 { TV_POLEARM, SV_BROAD_AXE },
1232 { TV_POLEARM, SV_LANCE },
1234 { TV_POLEARM, SV_BATTLE_AXE },
1235 { TV_POLEARM, SV_HATCHET },
1236 { TV_BOW, SV_SLING },
1237 { TV_BOW, SV_SHORT_BOW },
1239 { TV_BOW, SV_LIGHT_XBOW },
1240 { TV_SHOT, SV_AMMO_NORMAL },
1241 { TV_SHOT, SV_AMMO_NORMAL },
1242 { TV_ARROW, SV_AMMO_NORMAL },
1244 { TV_ARROW, SV_AMMO_NORMAL },
1245 { TV_BOLT, SV_AMMO_NORMAL },
1246 { TV_BOLT, SV_AMMO_NORMAL },
1247 { TV_BOW, SV_LIGHT_XBOW },
1249 { TV_ARROW, SV_AMMO_NORMAL },
1250 { TV_BOLT, SV_AMMO_NORMAL },
1251 { TV_BOW, SV_SHORT_BOW },
1252 { TV_BOW, SV_LIGHT_XBOW },
1254 { TV_SWORD, SV_DAGGER },
1255 { TV_SWORD, SV_TANTO },
1256 { TV_SWORD, SV_RAPIER },
1257 { TV_SWORD, SV_SMALL_SWORD },
1259 { TV_SWORD, SV_SHORT_SWORD },
1260 { TV_SWORD, SV_LONG_SWORD },
1261 { TV_SWORD, SV_SCIMITAR },
1262 { TV_SWORD, SV_BROAD_SWORD },
1264 { TV_HISSATSU_BOOK, 0 },
1265 { TV_HISSATSU_BOOK, 0 },
1266 { TV_HISSATSU_BOOK, 1 },
1267 { TV_HISSATSU_BOOK, 1 },
1273 { TV_HAFTED, SV_NUNCHAKU },
1274 { TV_HAFTED, SV_QUARTERSTAFF },
1275 { TV_HAFTED, SV_MACE },
1276 { TV_HAFTED, SV_BO_STAFF },
1278 { TV_HAFTED, SV_WAR_HAMMER },
1279 { TV_HAFTED, SV_WAR_HAMMER },
1280 { TV_HAFTED, SV_MORNING_STAR },
1281 { TV_HAFTED, SV_FLAIL },
1283 { TV_HAFTED, SV_LEAD_FILLED_MACE },
1284 { TV_SCROLL, SV_SCROLL_REMOVE_CURSE },
1285 { TV_SCROLL, SV_SCROLL_BLESSING },
1286 { TV_SCROLL, SV_SCROLL_HOLY_CHANT },
1288 { TV_POTION, SV_POTION_HEROISM },
1289 { TV_SCROLL, SV_SCROLL_WORD_OF_RECALL },
1290 { TV_SCROLL, SV_SCROLL_WORD_OF_RECALL },
1291 { TV_SCROLL, SV_SCROLL_WORD_OF_RECALL },
1293 { TV_POTION, SV_POTION_CURE_LIGHT },
1294 { TV_POTION, SV_POTION_CURE_SERIOUS },
1295 { TV_POTION, SV_POTION_CURE_SERIOUS },
1296 { TV_POTION, SV_POTION_CURE_CRITICAL },
1298 { TV_POTION, SV_POTION_CURE_CRITICAL },
1299 { TV_POTION, SV_POTION_RESTORE_EXP },
1300 { TV_POTION, SV_POTION_RESTORE_EXP },
1301 { TV_POTION, SV_POTION_RESTORE_EXP },
1303 { TV_LIFE_BOOK, 0 },
1304 { TV_LIFE_BOOK, 0 },
1305 { TV_LIFE_BOOK, 1 },
1306 { TV_LIFE_BOOK, 1 },
1308 { TV_CRUSADE_BOOK, 0 },
1309 { TV_CRUSADE_BOOK, 0 },
1310 { TV_CRUSADE_BOOK, 1 },
1311 { TV_CRUSADE_BOOK, 1 },
1313 { TV_HAFTED, SV_WHIP },
1314 { TV_HAFTED, SV_MACE },
1315 { TV_HAFTED, SV_BALL_AND_CHAIN },
1316 { TV_HAFTED, SV_WAR_HAMMER },
1318 { TV_SCROLL, SV_SCROLL_WORD_OF_RECALL },
1319 { TV_SCROLL, SV_SCROLL_WORD_OF_RECALL },
1320 { TV_SCROLL, SV_SCROLL_WORD_OF_RECALL },
1321 { TV_POTION, SV_POTION_CURE_CRITICAL },
1323 { TV_POTION, SV_POTION_CURE_CRITICAL },
1324 { TV_POTION, SV_POTION_RESTORE_EXP },
1327 { TV_STATUE, SV_ANY },
1329 { TV_SCROLL, SV_SCROLL_REMOVE_CURSE },
1330 { TV_SCROLL, SV_SCROLL_REMOVE_CURSE },
1331 { TV_SCROLL, SV_SCROLL_STAR_REMOVE_CURSE },
1332 { TV_SCROLL, SV_SCROLL_STAR_REMOVE_CURSE }
1338 { TV_SCROLL, SV_SCROLL_ENCHANT_WEAPON_TO_HIT },
1339 { TV_SCROLL, SV_SCROLL_ENCHANT_WEAPON_TO_DAM },
1340 { TV_SCROLL, SV_SCROLL_ENCHANT_ARMOR },
1341 { TV_SCROLL, SV_SCROLL_IDENTIFY },
1343 { TV_SCROLL, SV_SCROLL_IDENTIFY },
1344 { TV_SCROLL, SV_SCROLL_IDENTIFY },
1345 { TV_SCROLL, SV_SCROLL_IDENTIFY },
1346 { TV_SCROLL, SV_SCROLL_LIGHT },
1348 { TV_SCROLL, SV_SCROLL_PHASE_DOOR },
1349 { TV_SCROLL, SV_SCROLL_PHASE_DOOR },
1350 { TV_SCROLL, SV_SCROLL_TELEPORT },
1351 { TV_SCROLL, SV_SCROLL_MONSTER_CONFUSION },
1353 { TV_SCROLL, SV_SCROLL_MAPPING },
1354 { TV_SCROLL, SV_SCROLL_DETECT_GOLD },
1355 { TV_SCROLL, SV_SCROLL_DETECT_ITEM },
1356 { TV_SCROLL, SV_SCROLL_DETECT_TRAP },
1358 { TV_SCROLL, SV_SCROLL_DETECT_INVIS },
1359 { TV_SCROLL, SV_SCROLL_RECHARGING },
1360 { TV_SCROLL, SV_SCROLL_TELEPORT },
1361 { TV_SCROLL, SV_SCROLL_WORD_OF_RECALL },
1363 { TV_SCROLL, SV_SCROLL_WORD_OF_RECALL },
1364 { TV_SCROLL, SV_SCROLL_WORD_OF_RECALL },
1365 { TV_SCROLL, SV_SCROLL_WORD_OF_RECALL },
1366 { TV_SCROLL, SV_SCROLL_TELEPORT },
1368 { TV_SCROLL, SV_SCROLL_TELEPORT },
1369 { TV_POTION, SV_POTION_RES_STR },
1370 { TV_POTION, SV_POTION_RES_INT },
1371 { TV_POTION, SV_POTION_RES_WIS },
1373 { TV_POTION, SV_POTION_RES_DEX },
1374 { TV_POTION, SV_POTION_RES_CON },
1375 { TV_POTION, SV_POTION_RES_CHR },
1376 { TV_SCROLL, SV_SCROLL_IDENTIFY },
1378 { TV_SCROLL, SV_SCROLL_IDENTIFY },
1379 { TV_SCROLL, SV_SCROLL_STAR_IDENTIFY }, /* Yep, occasionally! */
1380 { TV_SCROLL, SV_SCROLL_STAR_IDENTIFY },
1381 { TV_SCROLL, SV_SCROLL_LIGHT },
1383 { TV_POTION, SV_POTION_RES_STR },
1384 { TV_POTION, SV_POTION_RES_INT },
1385 { TV_POTION, SV_POTION_RES_WIS },
1386 { TV_POTION, SV_POTION_RES_DEX },
1388 { TV_POTION, SV_POTION_RES_CON },
1389 { TV_POTION, SV_POTION_RES_CHR },
1390 { TV_SCROLL, SV_SCROLL_ENCHANT_ARMOR },
1391 { TV_SCROLL, SV_SCROLL_ENCHANT_ARMOR },
1393 { TV_SCROLL, SV_SCROLL_RECHARGING },
1394 { TV_SCROLL, SV_SCROLL_PHASE_DOOR },
1395 { TV_SCROLL, SV_SCROLL_ENCHANT_WEAPON_TO_HIT },
1396 { TV_SCROLL, SV_SCROLL_ENCHANT_WEAPON_TO_DAM },
1401 /* Magic-User store */
1403 { TV_RING, SV_RING_PROTECTION },
1404 { TV_RING, SV_RING_LEVITATION_FALL },
1405 { TV_RING, SV_RING_PROTECTION },
1406 { TV_RING, SV_RING_RESIST_FIRE },
1408 { TV_RING, SV_RING_RESIST_COLD },
1409 { TV_AMULET, SV_AMULET_CHARISMA },
1410 { TV_RING, SV_RING_WARNING },
1411 { TV_AMULET, SV_AMULET_RESIST_ACID },
1413 { TV_AMULET, SV_AMULET_SEARCHING },
1414 { TV_WAND, SV_WAND_SLOW_MONSTER },
1415 { TV_WAND, SV_WAND_CONFUSE_MONSTER },
1416 { TV_WAND, SV_WAND_SLEEP_MONSTER },
1418 { TV_WAND, SV_WAND_MAGIC_MISSILE },
1419 { TV_WAND, SV_WAND_STINKING_CLOUD },
1420 { TV_WAND, SV_WAND_WONDER },
1421 { TV_WAND, SV_WAND_DISARMING },
1423 { TV_STAFF, SV_STAFF_LITE },
1424 { TV_STAFF, SV_STAFF_MAPPING },
1425 { TV_STAFF, SV_STAFF_DETECT_TRAP },
1426 { TV_STAFF, SV_STAFF_DETECT_DOOR },
1428 { TV_STAFF, SV_STAFF_DETECT_GOLD },
1429 { TV_STAFF, SV_STAFF_DETECT_ITEM },
1430 { TV_STAFF, SV_STAFF_DETECT_INVIS },
1431 { TV_STAFF, SV_STAFF_DETECT_EVIL },
1433 { TV_STAFF, SV_STAFF_TELEPORTATION },
1434 { TV_STAFF, SV_STAFF_TELEPORTATION },
1435 { TV_STAFF, SV_STAFF_TELEPORTATION },
1436 { TV_STAFF, SV_STAFF_TELEPORTATION },
1438 { TV_STAFF, SV_STAFF_IDENTIFY },
1439 { TV_STAFF, SV_STAFF_IDENTIFY },
1440 { TV_STAFF, SV_STAFF_IDENTIFY },
1442 { TV_STAFF, SV_STAFF_IDENTIFY },
1443 { TV_STAFF, SV_STAFF_REMOVE_CURSE },
1444 { TV_STAFF, SV_STAFF_CURE_LIGHT },
1445 { TV_STAFF, SV_STAFF_PROBING },
1449 { TV_SORCERY_BOOK, 0 },
1450 { TV_SORCERY_BOOK, 0 },
1451 { TV_SORCERY_BOOK, 1 },
1452 { TV_SORCERY_BOOK, 1 },
1454 { TV_ARCANE_BOOK, 0 },
1455 { TV_ARCANE_BOOK, 0 },
1456 { TV_ARCANE_BOOK, 1 },
1457 { TV_ARCANE_BOOK, 1 },
1459 { TV_ARCANE_BOOK, 2 },
1460 { TV_ARCANE_BOOK, 2 },
1461 { TV_ARCANE_BOOK, 3 },
1462 { TV_ARCANE_BOOK, 3 },
1467 /* Black Market (unused) */
1540 { TV_SORCERY_BOOK, 0 },
1541 { TV_SORCERY_BOOK, 0 },
1542 { TV_SORCERY_BOOK, 1 },
1543 { TV_SORCERY_BOOK, 1 },
1545 { TV_NATURE_BOOK, 0 },
1546 { TV_NATURE_BOOK, 0 },
1547 { TV_NATURE_BOOK, 1 },
1548 { TV_NATURE_BOOK, 1 },
1550 { TV_CHAOS_BOOK, 0 },
1551 { TV_CHAOS_BOOK, 0 },
1552 { TV_CHAOS_BOOK, 1 },
1553 { TV_CHAOS_BOOK, 1 },
1555 { TV_DEATH_BOOK, 0 },
1556 { TV_DEATH_BOOK, 0 },
1557 { TV_DEATH_BOOK, 1 },
1558 { TV_DEATH_BOOK, 1 },
1560 { TV_TRUMP_BOOK, 0 }, /* +16 */
1561 { TV_TRUMP_BOOK, 0 },
1562 { TV_TRUMP_BOOK, 1 },
1563 { TV_TRUMP_BOOK, 1 },
1565 { TV_ARCANE_BOOK, 0 },
1566 { TV_ARCANE_BOOK, 1 },
1567 { TV_ARCANE_BOOK, 2 },
1568 { TV_ARCANE_BOOK, 3 },
1570 { TV_CRAFT_BOOK, 0 },
1571 { TV_CRAFT_BOOK, 0 },
1572 { TV_CRAFT_BOOK, 1 },
1573 { TV_CRAFT_BOOK, 1 },
1575 { TV_DAEMON_BOOK, 0 },
1576 { TV_DAEMON_BOOK, 0 },
1577 { TV_DAEMON_BOOK, 1 },
1578 { TV_DAEMON_BOOK, 1 },
1580 { TV_MUSIC_BOOK, 0 },
1581 { TV_MUSIC_BOOK, 0 },
1582 { TV_MUSIC_BOOK, 1 },
1583 { TV_MUSIC_BOOK, 1 },
1592 /* Museum (unused) */
1631 * @brief 取引成功時の店主のメッセージ処理 /
1632 * Successful haggle.
1635 static void say_comment_1(void)
1638 /* ブラックマーケットのときは別のメッセージを出す */
1639 if ( cur_store_num == STORE_BLACK ) {
1640 msg_print(comment_1_B[randint0(MAX_COMMENT_1)]);
1643 msg_print(comment_1[randint0(MAX_COMMENT_1)]);
1646 msg_print(comment_1[randint0(MAX_COMMENT_1)]);
1650 if (one_in_(RUMOR_CHANCE))
1653 msg_print("店主は耳うちした:");
1655 msg_print("The shopkeeper whispers something into your ear:");
1657 display_rumor(TRUE);
1663 * @brief プレイヤーがアイテムを買う時の価格代案メッセージ処理 /
1664 * Continue haggling (player is buying)
1665 * @param value 店主の提示価格
1666 * @param annoyed 店主のいらつき度
1669 static void say_comment_2(PRICE value, int annoyed)
1673 /* Prepare a string to insert */
1674 sprintf(tmp_val, "%ld", (long)value);
1679 /* Formatted message */
1680 msg_format(comment_2a[randint0(MAX_COMMENT_2A)], tmp_val);
1686 /* Formatted message */
1688 /* ブラックマーケットの時は別のメッセージを出す */
1689 if ( cur_store_num == STORE_BLACK ){
1690 msg_format(comment_2b_B[randint0(MAX_COMMENT_2B)], tmp_val);
1693 msg_format(comment_2b[randint0(MAX_COMMENT_2B)], tmp_val);
1696 msg_format(comment_2b[randint0(MAX_COMMENT_2B)], tmp_val);
1704 * @brief プレイヤーがアイテムを売る時の価格代案メッセージ処理 /
1705 * Continue haggling (player is selling)
1706 * @param value 店主の提示価格
1707 * @param annoyed 店主のいらつき度
1710 static void say_comment_3(PRICE value, int annoyed)
1714 /* Prepare a string to insert */
1715 sprintf(tmp_val, "%ld", (long)value);
1720 /* Formatted message */
1721 msg_format(comment_3a[randint0(MAX_COMMENT_3A)], tmp_val);
1727 /* Formatted message */
1729 /* ブラックマーケットの時は別のメッセージを出す */
1730 if ( cur_store_num == STORE_BLACK ){
1731 msg_format(comment_3b_B[randint0(MAX_COMMENT_3B)], tmp_val);
1734 msg_format(comment_3b[randint0(MAX_COMMENT_3B)], tmp_val);
1737 msg_format(comment_3b[randint0(MAX_COMMENT_3B)], tmp_val);
1745 * @brief 店主がプレイヤーを追い出す時のメッセージ処理 /
1746 * Kick 'da bum out. -RAK-
1749 static void say_comment_4(void)
1752 /* ブラックマーケットの時は別のメッセージを出す */
1753 if ( cur_store_num == STORE_BLACK ){
1754 msg_print(comment_4a_B[randint0(MAX_COMMENT_4A)]);
1755 msg_print(comment_4b_B[randint0(MAX_COMMENT_4B)]);
1758 msg_print(comment_4a[randint0(MAX_COMMENT_4A)]);
1759 msg_print(comment_4b[randint0(MAX_COMMENT_4B)]);
1762 msg_print(comment_4a[randint0(MAX_COMMENT_4A)]);
1763 msg_print(comment_4b[randint0(MAX_COMMENT_4B)]);
1770 * @brief 店主がプレイヤーに取り合わない時のメッセージ処理 /
1771 * You are insulting me
1774 static void say_comment_5(void)
1777 /* ブラックマーケットの時は別のメッセージを出す */
1778 if ( cur_store_num == STORE_BLACK ){
1779 msg_print(comment_5_B[randint0(MAX_COMMENT_5)]);
1782 msg_print(comment_5[randint0(MAX_COMMENT_5)]);
1785 msg_print(comment_5[randint0(MAX_COMMENT_5)]);
1792 * @brief 店主がプレイヤーの提示を理解できなかった時のメッセージ処理 /
1793 * That makes no sense.
1796 static void say_comment_6(void)
1798 msg_print(comment_6[randint0(MAX_COMMENT_6)]);
1802 #define MAX_COMMENT_7A 4
1804 static concptr comment_7a[MAX_COMMENT_7A] =
1809 "誰かがむせび泣く声が聞こえる...。",
1814 "You hear someone sobbing...",
1815 "The shopkeeper howls in agony!"
1820 #define MAX_COMMENT_7B 4
1822 static concptr comment_7b[MAX_COMMENT_7B] =
1832 "The shopkeeper curses at you.",
1833 "The shopkeeper glares at you."
1838 #define MAX_COMMENT_7C 4
1840 static concptr comment_7c[MAX_COMMENT_7C] =
1849 "You've made my day!",
1850 "The shopkeeper giggles.",
1851 "The shopkeeper laughs loudly."
1856 #define MAX_COMMENT_7D 4
1858 static concptr comment_7d[MAX_COMMENT_7D] =
1862 "こんなおいしい思いをしたら、真面目に働けなくなるなぁ。",
1867 "I think I'll retire!",
1868 "The shopkeeper jumps for joy.",
1869 "The shopkeeper smiles gleefully."
1876 * @brief 店主が交渉を終えた際の反応を返す処理 /
1877 * Let a shop-keeper React to a purchase
1878 * @param price アイテムの取引額
1879 * @param value アイテムの実際価値
1880 * @param guess 店主が当初予想していた価値
1883 * We paid "price", it was worth "value", and we thought it was worth "guess"
1885 static void purchase_analyze(PRICE price, PRICE value, PRICE guess)
1887 /* Item was worthless, but we bought it */
1888 if ((value <= 0) && (price > value))
1890 msg_print(comment_7a[randint0(MAX_COMMENT_7A)]);
1891 chg_virtue(V_HONOUR, -1);
1892 chg_virtue(V_JUSTICE, -1);
1893 sound(SOUND_STORE1);
1896 /* Item was cheaper than we thought, and we paid more than necessary */
1897 else if ((value < guess) && (price > value))
1899 msg_print(comment_7b[randint0(MAX_COMMENT_7B)]);
1900 chg_virtue(V_JUSTICE, -1);
1901 if (one_in_(4)) chg_virtue(V_HONOUR, -1);
1902 sound(SOUND_STORE2);
1905 /* Item was a good bargain, and we got away with it */
1906 else if ((value > guess) && (value < (4 * guess)) && (price < value))
1908 msg_print(comment_7c[randint0(MAX_COMMENT_7C)]);
1909 if (one_in_(4)) chg_virtue(V_HONOUR, -1);
1910 else if (one_in_(4)) chg_virtue(V_HONOUR, 1);
1911 sound(SOUND_STORE3);
1914 /* Item was a great bargain, and we got away with it */
1915 else if ((value > guess) && (price < value))
1917 msg_print(comment_7d[randint0(MAX_COMMENT_7D)]);
1918 if (one_in_(2)) chg_virtue(V_HONOUR, -1);
1919 if (one_in_(4)) chg_virtue(V_HONOUR, 1);
1920 if (10 * price < value) chg_virtue(V_SACRIFICE, 1);
1921 sound(SOUND_STORE4);
1928 * We store the current "store feat" here so everyone can access it
1930 static int cur_store_feat;
1934 * Buying and selling adjustments for race combinations.
1935 * Entry[owner][player] gives the basic "cost inflation".
1937 static byte rgold_adj[MAX_RACES][MAX_RACES] =
1939 /*Hum, HfE, Elf, Hal, Gno, Dwa, HfO, HfT, Dun, HiE, Barbarian,
1940 HfOg, HGn, HTn, Cyc, Yek, Klc, Kbd, Nbl, DkE, Drc, Mind Flayer,
1941 Imp, Glm, Skl, Zombie, Vampire, Spectre, Fairy, Beastman, Ent,
1942 Angel, Demon, Kutar, Android, Merfolk */
1945 { 100, 105, 105, 110, 113, 115, 120, 125, 100, 105, 100,
1946 124, 120, 110, 125, 115, 120, 120, 120, 120, 115, 120,
1947 115, 105, 125, 125, 125, 125, 105, 120, 105, 95, 140,
1948 100, 120, 110, 105, 110 },
1951 { 110, 100, 100, 105, 110, 120, 125, 130, 110, 100, 110,
1952 120, 115, 108, 115, 110, 110, 120, 120, 115, 115, 110,
1953 120, 110, 110, 110, 120, 110, 100, 125, 100, 95, 140,
1954 110, 115, 110, 110, 110 },
1957 { 110, 105, 100, 105, 110, 120, 125, 130, 110, 100, 110,
1958 120, 120, 105, 120, 110, 105, 125, 125, 110, 115, 108,
1959 120, 115, 110, 110, 120, 110, 100, 125, 100, 95, 140,
1960 110, 110, 105, 110, 110 },
1963 { 115, 110, 105, 95, 105, 110, 115, 130, 115, 105, 115,
1964 125, 120, 120, 125, 115, 110, 120, 120, 120, 115, 115,
1965 120, 110, 120, 120, 130, 110, 110, 130, 110, 95, 140,
1966 115, 120, 105, 115, 105 },
1969 { 115, 115, 110, 105, 95, 110, 115, 130, 115, 110, 115,
1970 120, 125, 110, 120, 110, 105, 120, 110, 110, 105, 110,
1971 120, 101, 110, 110, 120, 120, 115, 130, 115, 95, 140,
1972 115, 110, 110, 115, 110 },
1975 { 115, 120, 120, 110, 110, 95, 125, 135, 115, 120, 115,
1976 125, 140, 130, 130, 120, 115, 115, 115, 135, 125, 120,
1977 120, 105, 115, 115, 115, 115, 120, 130, 120, 95, 140,
1978 115, 110, 115, 115, 120 },
1981 { 115, 120, 125, 115, 115, 130, 110, 115, 115, 125, 115,
1982 110, 110, 120, 110, 120, 125, 115, 115, 110, 120, 110,
1983 115, 125, 120, 120, 115, 120, 125, 115, 125, 95, 140,
1984 115, 110, 115, 115, 125 },
1987 { 110, 115, 115, 110, 110, 130, 110, 110, 110, 115, 110,
1988 110, 115, 120, 110, 120, 120, 110, 110, 110, 115, 110,
1989 110, 115, 112, 112, 115, 112, 120, 110, 120, 95, 140,
1990 110, 110, 115, 110, 130 },
1993 { 100, 105, 105, 110, 113, 115, 120, 125, 100, 105, 100,
1994 120, 120, 105, 120, 115, 105, 115, 120, 110, 105, 105,
1995 120, 105, 120, 120, 125, 120, 105, 135, 105, 95, 140,
1996 100, 110, 110, 100, 110 },
1999 { 110, 105, 100, 105, 110, 120, 125, 130, 110, 100, 110,
2000 125, 125, 101, 120, 115, 110, 115, 125, 110, 110, 110,
2001 125, 115, 120, 120, 125, 120, 100, 125, 100, 95, 140,
2002 110, 110, 105, 110, 110 },
2004 /* Human / Barbarian (copied from human) */
2005 { 100, 105, 105, 110, 113, 115, 120, 125, 100, 105, 100,
2006 124, 120, 110, 125, 115, 120, 120, 120, 120, 115, 120,
2007 115, 105, 125, 125, 130, 125, 115, 120, 115, 95, 140,
2008 100, 120, 110, 100, 110 },
2010 /* Half-Ogre: theoretical, copied from half-troll */
2011 { 110, 115, 115, 110, 110, 130, 110, 110, 110, 115, 110,
2012 110, 115, 120, 110, 120, 120, 110, 110, 110, 115, 110,
2013 110, 115, 112, 112, 115, 112, 120, 110, 120, 95, 140,
2014 110, 110, 115, 110, 120 },
2016 /* Half-Giant: theoretical, copied from half-troll */
2017 { 110, 115, 115, 110, 110, 130, 110, 110, 110, 115, 110,
2018 110, 115, 120, 110, 120, 120, 110, 110, 110, 115, 110,
2019 110, 115, 112, 112, 115, 112, 130, 120, 130, 95, 140,
2020 110, 110, 115, 110, 115 },
2022 /* Half-Titan: theoretical, copied from High_Elf */
2023 { 110, 105, 100, 105, 110, 120, 125, 130, 110, 100, 110,
2024 125, 125, 101, 120, 115, 110, 115, 125, 110, 110, 110,
2025 125, 115, 120, 120, 120, 120, 130, 130, 130, 95, 140,
2026 110, 110, 115, 110, 108 },
2028 /* Cyclops: theoretical, copied from half-troll */
2029 { 110, 115, 115, 110, 110, 130, 110, 110, 110, 115, 110,
2030 110, 115, 120, 110, 120, 120, 110, 110, 110, 115, 110,
2031 110, 115, 112, 112, 115, 112, 130, 130, 130, 95, 140,
2032 110, 110, 115, 110, 115 },
2034 /* Yeek: theoretical, copied from Half-Orc */
2035 { 115, 120, 125, 115, 115, 130, 110, 115, 115, 125, 115,
2036 110, 110, 120, 110, 120, 125, 115, 115, 110, 120, 110,
2037 115, 125, 120, 120, 120, 120, 130, 130, 130, 95, 140,
2038 115, 110, 115, 115, 110 },
2040 /* Klackon: theoretical, copied from Gnome */
2041 { 115, 115, 110, 105, 95, 110, 115, 130, 115, 110, 115,
2042 120, 125, 110, 120, 110, 105, 120, 110, 110, 105, 110,
2043 120, 101, 110, 110, 120, 120, 130, 130, 130, 95, 140,
2044 115, 110, 115, 115, 110 },
2046 /* Kobold: theoretical, copied from Half-Orc */
2047 { 115, 120, 125, 115, 115, 130, 110, 115, 115, 125, 115,
2048 110, 110, 120, 110, 120, 125, 115, 115, 110, 120, 110,
2049 115, 125, 120, 120, 120, 120, 130, 130, 130, 95, 140,
2050 115, 110, 115, 115, 120 },
2052 /* Nibelung: theoretical, copied from Dwarf */
2053 { 115, 120, 120, 110, 110, 95, 125, 135, 115, 120, 115,
2054 125, 140, 130, 130, 120, 115, 115, 115, 135, 125, 120,
2055 120, 105, 115, 115, 120, 120, 130, 130, 130, 95, 140,
2056 115, 135, 115, 115, 120 },
2059 { 110, 110, 110, 115, 120, 130, 115, 115, 120, 110, 115,
2060 115, 115, 116, 115, 120, 120, 115, 115, 101, 110, 110,
2061 110, 110, 112, 122, 110, 110, 110, 115, 110, 120, 120,
2062 110, 101, 115, 110, 115 },
2064 /* Draconian: theoretical, copied from High_Elf */
2065 { 110, 105, 100, 105, 110, 120, 125, 130, 110, 100, 110,
2066 125, 125, 101, 120, 115, 110, 115, 125, 110, 110, 110,
2067 125, 115, 120, 120, 120, 120, 130, 130, 130, 95, 140,
2068 110, 110, 115, 110, 115 },
2070 /* Mind Flayer: theoretical, copied from High_Elf */
2071 { 110, 105, 100, 105, 110, 120, 125, 130, 110, 100, 110,
2072 125, 125, 101, 120, 115, 110, 115, 125, 110, 110, 110,
2073 125, 115, 120, 120, 120, 120, 130, 130, 130, 95, 140,
2074 110, 110, 115, 110, 110 },
2076 /* Imp: theoretical, copied from High_Elf */
2077 { 110, 105, 100, 105, 110, 120, 125, 130, 110, 100, 110,
2078 125, 125, 101, 120, 115, 110, 115, 125, 110, 110, 110,
2079 125, 115, 120, 120, 120, 120, 130, 130, 130, 120, 120,
2080 110, 110, 115, 110, 120 },
2082 /* Golem: theoretical, copied from High_Elf */
2083 { 110, 105, 100, 105, 110, 120, 125, 130, 110, 100, 110,
2084 125, 125, 101, 120, 115, 110, 115, 125, 110, 110, 110,
2085 125, 115, 120, 120, 120, 120, 130, 130, 130, 95, 140,
2086 110, 110, 115, 110, 110 },
2088 /* Skeleton: theoretical, copied from half-orc */
2089 { 115, 120, 125, 115, 115, 130, 110, 115, 115, 125, 115,
2090 110, 110, 120, 110, 120, 125, 115, 115, 110, 120, 110,
2091 115, 125, 120, 120, 120, 120, 130, 130, 130, 120, 120,
2092 115, 110, 125, 115, 110 },
2094 /* Zombie: Theoretical, copied from half-orc */
2095 { 115, 120, 125, 115, 115, 130, 110, 115, 115, 125, 115,
2096 110, 110, 120, 110, 120, 125, 115, 115, 110, 120, 110,
2097 115, 125, 120, 120, 120, 120, 130, 130, 130, 120, 120,
2098 115, 110, 125, 115, 110 },
2100 /* Vampire: Theoretical, copied from half-orc */
2101 { 115, 120, 125, 115, 115, 130, 110, 115, 115, 125, 115,
2102 110, 110, 120, 110, 120, 125, 115, 115, 110, 120, 110,
2103 115, 125, 120, 120, 120, 120, 130, 130, 130, 120, 120,
2104 115, 110, 125, 115, 120 },
2106 /* Spectre: Theoretical, copied from half-orc */
2107 { 115, 120, 125, 115, 115, 130, 110, 115, 115, 125, 115,
2108 110, 110, 120, 110, 120, 125, 115, 115, 110, 120, 110,
2109 115, 125, 120, 120, 120, 120, 130, 130, 130, 120, 120,
2110 115, 110, 125, 115, 110 },
2112 /* Sprite: Theoretical, copied from half-orc */
2113 { 115, 120, 125, 115, 115, 130, 110, 115, 115, 125, 115,
2114 110, 110, 120, 110, 120, 125, 115, 115, 110, 120, 110,
2115 115, 125, 120, 120, 120, 120, 130, 130, 130, 95, 140,
2116 115, 110, 105, 115, 110 },
2118 /* Beastman: Theoretical, copied from half-orc */
2119 { 115, 120, 125, 115, 115, 130, 110, 115, 115, 125, 115,
2120 110, 110, 120, 110, 120, 125, 115, 115, 110, 120, 110,
2121 115, 125, 120, 120, 120, 120, 130, 130, 130, 95, 140,
2122 115, 110, 115, 115, 125 },
2125 { 110, 105, 100, 105, 110, 120, 125, 130, 110, 100, 110,
2126 120, 120, 105, 120, 110, 105, 125, 125, 110, 115, 108,
2127 120, 115, 110, 110, 120, 110, 100, 125, 100, 95, 140,
2128 110, 110, 105, 110, 110 },
2131 { 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95,
2132 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95,
2133 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 160,
2134 95, 95, 95, 95, 95 },
2137 { 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, 140,
2138 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, 140,
2139 140, 140, 140, 140, 140, 140, 140, 140, 140, 160, 120,
2140 140, 140, 140, 140, 140 },
2143 { 100, 105, 105, 110, 113, 115, 120, 125, 100, 105, 100,
2144 124, 120, 110, 125, 115, 120, 120, 120, 120, 115, 120,
2145 115, 105, 125, 125, 125, 125, 105, 120, 105, 95, 140,
2146 100, 120, 110, 100, 110 },
2149 { 110, 110, 110, 115, 120, 130, 115, 115, 120, 110, 115,
2150 115, 115, 116, 115, 120, 120, 115, 115, 101, 110, 110,
2151 110, 110, 112, 122, 110, 110, 110, 115, 110, 120, 120,
2152 110, 101, 115, 110, 115 },
2155 { 110, 110, 105, 105, 110, 115, 115, 115, 110, 105, 110,
2156 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115,
2157 115, 115, 125, 125, 125, 125, 105, 115, 105, 95, 140,
2158 110, 115, 100, 110, 110 },
2161 { 105, 105, 105, 110, 113, 115, 120, 125, 100, 105, 100,
2162 124, 120, 110, 125, 115, 120, 120, 120, 120, 115, 120,
2163 115, 105, 125, 125, 125, 125, 105, 120, 105, 95, 140,
2164 100, 120, 110, 100, 110 },
2167 { 110, 110, 110, 105, 110, 120, 125, 130, 110, 110, 110,
2168 120, 115, 108, 115, 110, 110, 120, 120, 115, 115, 110,
2169 120, 110, 110, 110, 120, 110, 110, 125, 110, 95, 140,
2170 110, 115, 110, 110, 100 },
2176 * @brief 店舗価格を決定する /
2177 * Determine the price of an item (qty one) in a store.
2178 * @param o_ptr 店舗に並べるオブジェクト構造体の参照ポインタ
2179 * @param greed 店主の強欲度
2180 * @param flip TRUEならば店主にとっての買取価格、FALSEなら売出価格を計算
2184 * This function takes into account the player's charisma, and the
2185 * shop-keepers friendliness, and the shop-keeper's base greed, but
2186 * never lets a shop-keeper lose money in a transaction.
2187 * The "greed" value should exceed 100 when the player is "buying" the
2188 * item, and should be less than 100 when the player is "selling" it.
2189 * Hack -- the black market always charges twice as much as it should.
2190 * Charisma adjustment runs from 80 to 130
2191 * Racial adjustment runs from 95 to 130
2192 * Since greed/charisma/racial adjustments are centered at 100, we need
2193 * to adjust (by 200) to extract a usable multiplier. Note that the
2194 * "greed" value is always something (?).
2197 static s32b price_item(object_type *o_ptr, int greed, bool flip)
2204 /* Get the value of one of the items */
2205 price = object_value(o_ptr);
2207 /* Worthless items */
2208 if (price <= 0) return (0L);
2211 /* Compute the racial factor */
2212 factor = rgold_adj[ot_ptr->owner_race][p_ptr->prace];
2214 /* Add in the charisma factor */
2215 factor += adj_chr_gold[p_ptr->stat_ind[A_CHR]];
2218 /* Shop is buying */
2221 /* Adjust for greed */
2222 adjust = 100 + (300 - (greed + factor));
2224 /* Never get "silly" */
2225 if (adjust > 100) adjust = 100;
2227 /* Mega-Hack -- Black market sucks */
2228 if (cur_store_num == STORE_BLACK)
2231 /* Compute the final price (with rounding) */
2232 /* Hack -- prevent underflow */
2233 price = (price * adjust + 50L) / 100L;
2236 /* Shop is selling */
2239 /* Adjust for greed */
2240 adjust = 100 + ((greed + factor) - 300);
2242 /* Never get "silly" */
2243 if (adjust < 100) adjust = 100;
2245 /* Mega-Hack -- Black market sucks */
2246 if (cur_store_num == STORE_BLACK)
2249 /* Compute the final price (with rounding) */
2250 /* Hack -- prevent overflow */
2251 price = (s32b)(((u32b)price * (u32b)adjust + 50UL) / 100UL);
2254 /* Note -- Never become "free" */
2255 if (price <= 0L) return (1L);
2257 /* Return the price */
2263 * @brief 安価な消耗品の販売数を増やし、低確率で割引にする /
2264 * Certain "cheap" objects should be created in "piles"
2265 * @param o_ptr 店舗に並べるオブジェクト構造体の参照ポインタ
2269 * Some objects can be sold at a "discount" (in small piles)
2272 static void mass_produce(object_type *o_ptr)
2275 DISCOUNT_RATE discount = 0;
2277 PRICE cost = object_value(o_ptr);
2280 /* Analyze the type */
2281 switch (o_ptr->tval)
2283 /* Food, Flasks, and Lites */
2288 if (cost <= 5L) size += damroll(3, 5);
2289 if (cost <= 20L) size += damroll(3, 5);
2290 if (cost <= 50L) size += damroll(2, 2);
2297 if (cost <= 60L) size += damroll(3, 5);
2298 if (cost <= 240L) size += damroll(1, 5);
2299 if (o_ptr->sval == SV_SCROLL_STAR_IDENTIFY) size += damroll(3, 5);
2300 if (o_ptr->sval == SV_SCROLL_STAR_REMOVE_CURSE) size += damroll(1, 4);
2305 case TV_SORCERY_BOOK:
2306 case TV_NATURE_BOOK:
2310 case TV_ARCANE_BOOK:
2312 case TV_DAEMON_BOOK:
2313 case TV_CRUSADE_BOOK:
2315 case TV_HISSATSU_BOOK:
2318 if (cost <= 50L) size += damroll(2, 3);
2319 if (cost <= 500L) size += damroll(1, 3);
2337 if (object_is_artifact(o_ptr)) break;
2338 if (object_is_ego(o_ptr)) break;
2339 if (cost <= 10L) size += damroll(3, 5);
2340 if (cost <= 100L) size += damroll(3, 5);
2349 if (cost <= 5L) size += damroll(5, 5);
2350 if (cost <= 50L) size += damroll(5, 5);
2351 if (cost <= 500L) size += damroll(5, 5);
2357 if (cost <= 100L) size += damroll(2, 2);
2358 if (cost <= 1000L) size += damroll(2, 2);
2371 * Because many rods (and a few wands and staffs) are useful mainly
2372 * in quantity, the Black Market will occasionally have a bunch of
2379 if ((cur_store_num == STORE_BLACK) && one_in_(3))
2381 if (cost < 1601L) size += damroll(1, 5);
2382 else if (cost < 3201L) size += damroll(1, 3);
2389 /* Pick a discount */
2394 else if (one_in_(25))
2398 else if (one_in_(150))
2402 else if (one_in_(300))
2406 else if (one_in_(500))
2411 if (o_ptr->art_name)
2416 /* Save the discount */
2417 o_ptr->discount = discount;
2419 /* Save the total pile size */
2420 o_ptr->number = size - (size * discount / 100);
2422 /* Ensure that mass-produced rods and wands get the correct pvals. */
2423 if ((o_ptr->tval == TV_ROD) || (o_ptr->tval == TV_WAND))
2425 o_ptr->pval *= (PARAMETER_VALUE)o_ptr->number;
2432 * @brief 店舗に並べた品を同一品であるかどうか判定する /
2433 * Determine if a store item can "absorb" another item
2434 * @param o_ptr 判定するオブジェクト構造体の参照ポインタ1
2435 * @param j_ptr 判定するオブジェクト構造体の参照ポインタ2
2436 * @return 同一扱いできるならTRUEを返す
2439 * See "object_similar()" for the same function for the "player"
2442 static bool store_object_similar(object_type *o_ptr, object_type *j_ptr)
2446 /* Hack -- Identical items cannot be stacked */
2447 if (o_ptr == j_ptr) return (0);
2449 /* Different objects cannot be stacked */
2450 if (o_ptr->k_idx != j_ptr->k_idx) return (0);
2452 /* Different charges (etc) cannot be stacked, unless wands or rods. */
2453 if ((o_ptr->pval != j_ptr->pval) && (o_ptr->tval != TV_WAND) && (o_ptr->tval != TV_ROD)) return (0);
2455 /* Require many identical values */
2456 if (o_ptr->to_h != j_ptr->to_h) return (0);
2457 if (o_ptr->to_d != j_ptr->to_d) return (0);
2458 if (o_ptr->to_a != j_ptr->to_a) return (0);
2460 /* Require identical "ego-item" names */
2461 if (o_ptr->name2 != j_ptr->name2) return (0);
2463 /* Artifacts don't stack! */
2464 if (object_is_artifact(o_ptr) || object_is_artifact(j_ptr)) return (0);
2466 /* Hack -- Identical art_flags! */
2467 for (i = 0; i < TR_FLAG_SIZE; i++)
2468 if (o_ptr->art_flags[i] != j_ptr->art_flags[i]) return (0);
2470 /* Hack -- Never stack "powerful" items */
2471 if (o_ptr->xtra1 || j_ptr->xtra1) return (0);
2473 /* Hack -- Never stack recharging items */
2474 if (o_ptr->timeout || j_ptr->timeout) return (0);
2476 /* Require many identical values */
2477 if (o_ptr->ac != j_ptr->ac) return (0);
2478 if (o_ptr->dd != j_ptr->dd) return (0);
2479 if (o_ptr->ds != j_ptr->ds) return (0);
2481 /* Hack -- Never stack chests */
2482 if (o_ptr->tval == TV_CHEST) return (0);
2483 if (o_ptr->tval == TV_STATUE) return (0);
2484 if (o_ptr->tval == TV_CAPTURE) return (0);
2486 /* Require matching discounts */
2487 if (o_ptr->discount != j_ptr->discount) return (0);
2489 /* They match, so they must be similar */
2495 * @brief 店舗に並べた品を重ね合わせできるかどうか判定する /
2496 * Allow a store item to absorb another item
2497 * @param o_ptr 判定するオブジェクト構造体の参照ポインタ1
2498 * @param j_ptr 判定するオブジェクト構造体の参照ポインタ2
2499 * @return 重ね合わせできるならTRUEを返す
2502 * See "object_similar()" for the same function for the "player"
2505 static void store_object_absorb(object_type *o_ptr, object_type *j_ptr)
2507 int max_num = (o_ptr->tval == TV_ROD) ?
2508 MIN(99, MAX_SHORT / k_info[o_ptr->k_idx].pval) : 99;
2509 int total = o_ptr->number + j_ptr->number;
2510 int diff = (total > max_num) ? total - max_num : 0;
2512 /* Combine quantity, lose excess items */
2513 o_ptr->number = (total > max_num) ? max_num : total;
2515 /* Hack -- if rods are stacking, add the pvals (maximum timeouts) together. -LM- */
2516 if (o_ptr->tval == TV_ROD)
2518 o_ptr->pval += j_ptr->pval * (j_ptr->number - diff) / j_ptr->number;
2521 /* Hack -- if wands are stacking, combine the charges. -LM- */
2522 if (o_ptr->tval == TV_WAND)
2524 o_ptr->pval += j_ptr->pval * (j_ptr->number - diff) / j_ptr->number;
2530 * @brief 店舗に品を置くスペースがあるかどうかの判定を返す /
2531 * Check to see if the shop will be carrying too many objects -RAK-
2532 * @param o_ptr 店舗に置きたいオブジェクト構造体の参照ポインタ
2533 * @return 置き場がないなら0、重ね合わせできるアイテムがあるなら-1、スペースがあるなら1を返す。
2536 * Note that the shop, just like a player, will not accept things
2537 * it cannot hold. Before, one could "nuke" potions this way.
2538 * Return value is now int:
2540 * -1 : Can be combined to existing slot.
2541 * 1 : Cannot be combined but there are empty spaces.
2544 static int store_check_num(object_type *o_ptr)
2549 /* The "home" acts like the player */
2550 if ((cur_store_num == STORE_HOME) || (cur_store_num == STORE_MUSEUM))
2552 bool old_stack_force_notes = stack_force_notes;
2553 bool old_stack_force_costs = stack_force_costs;
2555 if (cur_store_num != STORE_HOME)
2557 stack_force_notes = FALSE;
2558 stack_force_costs = FALSE;
2561 /* Check all the items */
2562 for (i = 0; i < st_ptr->stock_num; i++)
2564 /* Get the existing item */
2565 j_ptr = &st_ptr->stock[i];
2567 /* Can the new object be combined with the old one? */
2568 if (object_similar(j_ptr, o_ptr))
2570 if (cur_store_num != STORE_HOME)
2572 stack_force_notes = old_stack_force_notes;
2573 stack_force_costs = old_stack_force_costs;
2580 if (cur_store_num != STORE_HOME)
2582 stack_force_notes = old_stack_force_notes;
2583 stack_force_costs = old_stack_force_costs;
2587 /* Normal stores do special stuff */
2590 /* Check all the items */
2591 for (i = 0; i < st_ptr->stock_num; i++)
2593 /* Get the existing item */
2594 j_ptr = &st_ptr->stock[i];
2596 /* Can the new object be combined with the old one? */
2597 if (store_object_similar(j_ptr, o_ptr)) return -1;
2601 /* Free space is always usable */
2603 * オプション powerup_home が設定されていると
2606 if ((cur_store_num == STORE_HOME) && ( powerup_home == FALSE )) {
2607 if (st_ptr->stock_num < ((st_ptr->stock_size) / 10)) {
2612 if (st_ptr->stock_num < st_ptr->stock_size) {
2617 /* But there was no room at the inn... */
2622 * @brief オブジェクトが祝福されているかの判定を返す /
2623 * @param o_ptr 判定したいオブジェクト構造体の参照ポインタ
2624 * @return アイテムが祝福されたアイテムならばTRUEを返す
2626 static bool is_blessed(object_type *o_ptr)
2628 BIT_FLAGS flgs[TR_FLAG_SIZE];
2629 object_flags(o_ptr, flgs);
2630 if (have_flag(flgs, TR_BLESSED)) return (TRUE);
2631 else return (FALSE);
2637 * @brief オブジェクトが所定の店舗で引き取れるかどうかを返す /
2638 * Determine if the current store will purchase the given item
2639 * @param o_ptr 判定したいオブジェクト構造体の参照ポインタ
2640 * @return アイテムが買い取れるならばTRUEを返す
2642 * Note that a shop-keeper must refuse to buy "worthless" items
2644 static bool store_will_buy(object_type *o_ptr)
2646 /* Hack -- The Home is simple */
2647 if ((cur_store_num == STORE_HOME) || (cur_store_num == STORE_MUSEUM)) return (TRUE);
2649 /* Switch on the store */
2650 switch (cur_store_num)
2655 /* Analyze the type */
2656 switch (o_ptr->tval)
2659 if (o_ptr->sval != SV_POTION_WATER) return FALSE;
2671 case TV_BOTTLE: /* 'Green', recycling Angband */
2686 /* Analyze the type */
2687 switch (o_ptr->tval)
2708 /* Analyze the type */
2709 switch (o_ptr->tval)
2718 case TV_HISSATSU_BOOK:
2722 if(o_ptr->sval == SV_WIZSTAFF) return (FALSE);
2734 /* Analyze the type */
2735 switch (o_ptr->tval)
2738 case TV_CRUSADE_BOOK:
2748 monster_race *r_ptr = &r_info[o_ptr->pval];
2751 if (!(r_ptr->flags3 & RF3_EVIL))
2754 if (r_ptr->flags3 & RF3_GOOD) break;
2756 /* Accept animals */
2757 if (r_ptr->flags3 & RF3_ANIMAL) break;
2760 if (my_strchr("?!", r_ptr->d_char)) break;
2766 if (is_blessed(o_ptr)) break;
2775 case STORE_ALCHEMIST:
2777 /* Analyze the type */
2778 switch (o_ptr->tval)
2792 /* Analyze the type */
2793 switch (o_ptr->tval)
2795 case TV_SORCERY_BOOK:
2796 case TV_NATURE_BOOK:
2800 case TV_ARCANE_BOOK:
2802 case TV_DAEMON_BOOK:
2816 if(o_ptr->sval == SV_WIZSTAFF) break;
2817 else return (FALSE);
2824 /* Bookstore Shop */
2827 /* Analyze the type */
2828 switch (o_ptr->tval)
2830 case TV_SORCERY_BOOK:
2831 case TV_NATURE_BOOK:
2836 case TV_ARCANE_BOOK:
2838 case TV_DAEMON_BOOK:
2839 case TV_CRUSADE_BOOK:
2850 /* Ignore "worthless" items */
2851 if (object_value(o_ptr) <= 0) return (FALSE);
2859 * @brief 現在の町の指定された店舗のアイテムを整理する /
2860 * Combine and reorder items in store.
2861 * @param store_num 店舗ID
2862 * @return 実際に整理が行われたならばTRUEを返す。
2864 bool combine_and_reorder_home(int store_num)
2868 object_type forge, *o_ptr, *j_ptr;
2869 bool flag = FALSE, combined;
2870 store_type *old_st_ptr = st_ptr;
2871 bool old_stack_force_notes = stack_force_notes;
2872 bool old_stack_force_costs = stack_force_costs;
2874 st_ptr = &town_info[1].store[store_num];
2875 if (store_num != STORE_HOME)
2877 stack_force_notes = FALSE;
2878 stack_force_costs = FALSE;
2885 /* Combine the items in the home (backwards) */
2886 for (i = st_ptr->stock_num - 1; i > 0; i--)
2888 o_ptr = &st_ptr->stock[i];
2890 /* Skip empty items */
2891 if (!o_ptr->k_idx) continue;
2893 /* Scan the items above that item */
2894 for (j = 0; j < i; j++)
2898 j_ptr = &st_ptr->stock[j];
2900 /* Skip empty items */
2901 if (!j_ptr->k_idx) continue;
2904 * Get maximum number of the stack if these
2905 * are similar, get zero otherwise.
2907 max_num = object_similar_part(j_ptr, o_ptr);
2909 /* Can we (partialy) drop "o_ptr" onto "j_ptr"? */
2910 if (max_num && j_ptr->number < max_num)
2912 if (o_ptr->number + j_ptr->number <= max_num)
2914 /* Add together the item counts */
2915 object_absorb(j_ptr, o_ptr);
2917 /* One object is gone */
2918 st_ptr->stock_num--;
2920 /* Slide everything down */
2921 for (k = i; k < st_ptr->stock_num; k++)
2923 /* Structure copy */
2924 st_ptr->stock[k] = st_ptr->stock[k + 1];
2927 /* Erase the "final" slot */
2928 object_wipe(&st_ptr->stock[k]);
2932 ITEM_NUMBER old_num = o_ptr->number;
2933 ITEM_NUMBER remain = j_ptr->number + o_ptr->number - max_num;
2935 /* Add together the item counts */
2936 object_absorb(j_ptr, o_ptr);
2938 o_ptr->number = remain;
2940 /* Hack -- if rods are stacking, add the pvals (maximum timeouts) and current timeouts together. -LM- */
2941 if (o_ptr->tval == TV_ROD)
2943 o_ptr->pval = o_ptr->pval * remain / old_num;
2944 o_ptr->timeout = o_ptr->timeout * remain / old_num;
2947 /* Hack -- if wands are stacking, combine the charges. -LM- */
2948 else if (o_ptr->tval == TV_WAND)
2950 o_ptr->pval = o_ptr->pval * remain / old_num;
2965 /* Re-order the items in the home (forwards) */
2966 for (i = 0; i < st_ptr->stock_num; i++)
2968 o_ptr = &st_ptr->stock[i];
2970 /* Skip empty slots */
2971 if (!o_ptr->k_idx) continue;
2973 /* Get the "value" of the item */
2974 o_value = object_value(o_ptr);
2976 /* Scan every occupied slot */
2977 for (j = 0; j < st_ptr->stock_num; j++)
2979 if (object_sort_comp(o_ptr, o_value, &st_ptr->stock[j])) break;
2982 /* Never move down */
2983 if (j >= i) continue;
2989 /* Save a copy of the moving item */
2990 object_copy(j_ptr, &st_ptr->stock[i]);
2992 /* Slide the objects */
2993 for (k = i; k > j; k--)
2995 /* Slide the item */
2996 object_copy(&st_ptr->stock[k], &st_ptr->stock[k - 1]);
2999 /* Insert the moving item */
3000 object_copy(&st_ptr->stock[j], j_ptr);
3003 st_ptr = old_st_ptr;
3004 if (store_num != STORE_HOME)
3006 stack_force_notes = old_stack_force_notes;
3007 stack_force_costs = old_stack_force_costs;
3015 * @brief 我が家にオブジェクトを加える /
3016 * Add the item "o_ptr" to the p_ptr->inventory_list of the "Home"
3017 * @param o_ptr 加えたいオブジェクトの構造体参照ポインタ
3021 * In all cases, return the slot (or -1) where the object was placed
3022 * Note that this is a hacked up version of "inven_carry()".
3023 * Also note that it may not correctly "adapt" to "knowledge" bacoming
3024 * known, the player may have to pick stuff up and drop it again.
3027 static int home_carry(object_type *o_ptr)
3033 bool old_stack_force_notes = stack_force_notes;
3034 bool old_stack_force_costs = stack_force_costs;
3036 if (cur_store_num != STORE_HOME)
3038 stack_force_notes = FALSE;
3039 stack_force_costs = FALSE;
3042 /* Check each existing item (try to combine) */
3043 for (slot = 0; slot < st_ptr->stock_num; slot++)
3045 /* Get the existing item */
3046 j_ptr = &st_ptr->stock[slot];
3048 /* The home acts just like the player */
3049 if (object_similar(j_ptr, o_ptr))
3051 /* Save the new number of items */
3052 object_absorb(j_ptr, o_ptr);
3054 if (cur_store_num != STORE_HOME)
3056 stack_force_notes = old_stack_force_notes;
3057 stack_force_costs = old_stack_force_costs;
3065 if (cur_store_num != STORE_HOME)
3067 stack_force_notes = old_stack_force_notes;
3068 stack_force_costs = old_stack_force_costs;
3073 * 隠し機能: オプション powerup_home が設定されていると
3077 if ((cur_store_num != STORE_HOME) || (powerup_home == TRUE)) {
3078 if (st_ptr->stock_num >= st_ptr->stock_size) {
3083 if (st_ptr->stock_num >= ((st_ptr->stock_size) / 10)) {
3089 /* Determine the "value" of the item */
3090 value = object_value(o_ptr);
3092 /* Check existing slots to see if we must "slide" */
3093 for (slot = 0; slot < st_ptr->stock_num; slot++)
3095 if (object_sort_comp(o_ptr, value, &st_ptr->stock[slot])) break;
3098 /* Slide the others up */
3099 for (i = st_ptr->stock_num; i > slot; i--)
3101 st_ptr->stock[i] = st_ptr->stock[i-1];
3104 /* More stuff now */
3105 st_ptr->stock_num++;
3107 /* Insert the new item */
3108 st_ptr->stock[slot] = *o_ptr;
3110 chg_virtue(V_SACRIFICE, -1);
3112 (void)combine_and_reorder_home(cur_store_num);
3114 /* Return the location */
3120 * @brief 店舗にオブジェクトを加える /
3121 * Add the item "o_ptr" to a real stores p_ptr->inventory_list.
3122 * @param o_ptr 加えたいオブジェクトの構造体参照ポインタ
3126 * In all cases, return the slot (or -1) where the object was placed
3127 * Note that this is a hacked up version of "inven_carry()".
3128 * Also note that it may not correctly "adapt" to "knowledge" bacoming
3129 * known, the player may have to pick stuff up and drop it again.
3132 static int store_carry(object_type *o_ptr)
3135 PRICE value, j_value;
3139 /* Evaluate the object */
3140 value = object_value(o_ptr);
3142 /* Cursed/Worthless items "disappear" when sold */
3143 if (value <= 0) return (-1);
3145 /* All store items are fully *identified* */
3146 o_ptr->ident |= IDENT_MENTAL;
3148 /* Erase the inscription */
3149 o_ptr->inscription = 0;
3151 /* Erase the "feeling" */
3152 o_ptr->feeling = FEEL_NONE;
3154 /* Check each existing item (try to combine) */
3155 for (slot = 0; slot < st_ptr->stock_num; slot++)
3157 /* Get the existing item */
3158 j_ptr = &st_ptr->stock[slot];
3160 /* Can the existing items be incremented? */
3161 if (store_object_similar(j_ptr, o_ptr))
3163 /* Hack -- extra items disappear */
3164 store_object_absorb(j_ptr, o_ptr);
3172 if (st_ptr->stock_num >= st_ptr->stock_size) return (-1);
3175 /* Check existing slots to see if we must "slide" */
3176 for (slot = 0; slot < st_ptr->stock_num; slot++)
3179 j_ptr = &st_ptr->stock[slot];
3181 /* Objects sort by decreasing type */
3182 if (o_ptr->tval > j_ptr->tval) break;
3183 if (o_ptr->tval < j_ptr->tval) continue;
3185 /* Objects sort by increasing sval */
3186 if (o_ptr->sval < j_ptr->sval) break;
3187 if (o_ptr->sval > j_ptr->sval) continue;
3190 * Hack: otherwise identical rods sort by
3191 * increasing recharge time --dsb
3193 if (o_ptr->tval == TV_ROD)
3195 if (o_ptr->pval < j_ptr->pval) break;
3196 if (o_ptr->pval > j_ptr->pval) continue;
3199 /* Evaluate that slot */
3200 j_value = object_value(j_ptr);
3202 /* Objects sort by decreasing value */
3203 if (value > j_value) break;
3204 if (value < j_value) continue;
3207 /* Slide the others up */
3208 for (i = st_ptr->stock_num; i > slot; i--)
3210 st_ptr->stock[i] = st_ptr->stock[i-1];
3213 /* More stuff now */
3214 st_ptr->stock_num++;
3216 /* Insert the new item */
3217 st_ptr->stock[slot] = *o_ptr;
3219 /* Return the location */
3225 * @brief 店舗のオブジェクト数を増やす /
3226 * Add the item "o_ptr" to a real stores p_ptr->inventory_list.
3227 * @param item 増やしたいアイテムのID
3232 * Increase, by a given amount, the number of a certain item
3233 * in a certain store. This can result in zero items.
3235 * @todo numは本来ITEM_NUMBER型にしたい。
3237 static void store_item_increase(INVENTORY_IDX item, int num)
3242 o_ptr = &st_ptr->stock[item];
3244 /* Verify the number */
3245 cnt = o_ptr->number + num;
3246 if (cnt > 255) cnt = 255;
3247 else if (cnt < 0) cnt = 0;
3248 num = cnt - o_ptr->number;
3250 /* Save the new number */
3251 o_ptr->number += (ITEM_NUMBER)num;
3256 * @brief 店舗のオブジェクト数を削除する /
3257 * Remove a slot if it is empty
3258 * @param item 削除したいアイテムのID
3261 static void store_item_optimize(INVENTORY_IDX item)
3266 o_ptr = &st_ptr->stock[item];
3269 if (!o_ptr->k_idx) return;
3271 /* Must have no items */
3272 if (o_ptr->number) return;
3275 st_ptr->stock_num--;
3277 /* Slide everyone */
3278 for (j = item; j < st_ptr->stock_num; j++)
3280 st_ptr->stock[j] = st_ptr->stock[j + 1];
3283 /* Nuke the final slot */
3284 object_wipe(&st_ptr->stock[j]);
3288 * @brief ブラックマーケット用の無価値品の排除判定 /
3289 * This function will keep 'crap' out of the black market.
3290 * @param o_ptr 判定したいオブジェクトの構造体参照ポインタ
3291 * @return ブラックマーケットにとって無価値な品ならばTRUEを返す
3294 * Crap is defined as any item that is "available" elsewhere
3295 * Based on a suggestion by "Lee Vogt" <lvogt@cig.mcel.mot.com>
3298 static bool black_market_crap(object_type *o_ptr)
3302 /* Ego items are never crap */
3303 if (object_is_ego(o_ptr)) return (FALSE);
3305 /* Good items are never crap */
3306 if (o_ptr->to_a > 0) return (FALSE);
3307 if (o_ptr->to_h > 0) return (FALSE);
3308 if (o_ptr->to_d > 0) return (FALSE);
3310 /* Check all stores */
3311 for (i = 0; i < MAX_STORES; i++)
3313 if (i == STORE_HOME) continue;
3314 if (i == STORE_MUSEUM) continue;
3316 /* Check every item in the store */
3317 for (j = 0; j < town_info[p_ptr->town_num].store[i].stock_num; j++)
3319 object_type *j_ptr = &town_info[p_ptr->town_num].store[i].stock[j];
3321 /* Duplicate item "type", assume crappy */
3322 if (o_ptr->k_idx == j_ptr->k_idx) return (TRUE);
3332 * @brief 店舗の品揃え変化のためにアイテムを削除する /
3333 * Attempt to delete (some of) a random item from the store
3337 * Hack -- we attempt to "maintain" piles of items when possible.
3340 static void store_delete(void)
3345 /* Pick a random slot */
3346 what = (INVENTORY_IDX)randint0(st_ptr->stock_num);
3348 /* Determine how many items are here */
3349 num = st_ptr->stock[what].number;
3351 /* Hack -- sometimes, only destroy half the items */
3352 if (randint0(100) < 50) num = (num + 1) / 2;
3354 /* Hack -- sometimes, only destroy a single item */
3355 if (randint0(100) < 50) num = 1;
3357 /* Hack -- decrement the maximum timeouts and total charges of rods and wands. -LM- */
3358 if ((st_ptr->stock[what].tval == TV_ROD) || (st_ptr->stock[what].tval == TV_WAND))
3360 st_ptr->stock[what].pval -= num * st_ptr->stock[what].pval / st_ptr->stock[what].number;
3363 /* Actually destroy (part of) the item */
3364 store_item_increase(what, -num);
3365 store_item_optimize(what);
3370 * @brief 店舗の品揃え変化のためにアイテムを追加する /
3371 * Creates a random item and gives it to a store
3375 * This algorithm needs to be rethought. A lot.
3376 * Currently, "normal" stores use a pre-built array.
3377 * Note -- the "level" given to "obj_get_num()" is a "favored"
3378 * level, that is, there is a much higher chance of getting
3379 * items with a level approaching that of the given level...
3380 * Should we check for "permission" to have the given item?
3383 static void store_create(void)
3392 /* Paranoia -- no room left */
3393 if (st_ptr->stock_num >= st_ptr->stock_size) return;
3395 /* Hack -- consider up to four items */
3396 for (tries = 0; tries < 4; tries++)
3399 if (cur_store_num == STORE_BLACK)
3401 /* Pick a level for object/magic */
3402 level = 25 + randint0(25);
3404 /* Random item (usually of given level) */
3405 i = get_obj_num(level, 0x00000000);
3407 /* Handle failure */
3414 /* Hack -- Pick an item to sell */
3415 i = st_ptr->table[randint0(st_ptr->table_num)];
3417 /* Hack -- fake level for apply_magic() */
3418 level = rand_range(1, STORE_OBJ_LEVEL);
3423 /* Create a new object of the chosen kind */
3424 object_prep(q_ptr, i);
3426 /* Apply some "low-level" magic (no artifacts) */
3427 apply_magic(q_ptr, level, AM_NO_FIXED_ART);
3429 /* Require valid object */
3430 if (!store_will_buy(q_ptr)) continue;
3432 /* Hack -- Charge lite's */
3433 if (q_ptr->tval == TV_LITE)
3435 if (q_ptr->sval == SV_LITE_TORCH) q_ptr->xtra4 = FUEL_TORCH / 2;
3436 if (q_ptr->sval == SV_LITE_LANTERN) q_ptr->xtra4 = FUEL_LAMP / 2;
3440 /* The item is "known" */
3441 object_known(q_ptr);
3443 /* Mark it storebought */
3444 q_ptr->ident |= IDENT_STORE;
3446 /* Mega-Hack -- no chests in stores */
3447 if (q_ptr->tval == TV_CHEST) continue;
3449 /* Prune the black market */
3450 if (cur_store_num == STORE_BLACK)
3452 /* Hack -- No "crappy" items */
3453 if (black_market_crap(q_ptr)) continue;
3455 /* Hack -- No "cheap" items */
3456 if (object_value(q_ptr) < 10) continue;
3458 /* No "worthless" items */
3459 /* if (object_value(q_ptr) <= 0) continue; */
3462 /* Prune normal stores */
3465 /* No "worthless" items */
3466 if (object_value(q_ptr) <= 0) continue;
3470 /* Mass produce and/or Apply discount */
3471 mass_produce(q_ptr);
3473 /* Attempt to carry the (known) item */
3474 (void)store_carry(q_ptr);
3476 /* Definitely done */
3483 * @brief 店舗の割引対象外にするかどうかを判定 /
3484 * Eliminate need to bargain if player has haggled well in the past
3485 * @param minprice アイテムの最低販売価格
3486 * @return 割引を禁止するならTRUEを返す。
3488 static bool noneedtobargain(PRICE minprice)
3490 PRICE good = st_ptr->good_buy;
3491 PRICE bad = st_ptr->bad_buy;
3493 /* Cheap items are "boring" */
3494 if (minprice < 10L) return (TRUE);
3496 /* Perfect haggling */
3497 if (good == MAX_SHORT) return (TRUE);
3499 /* Reward good haggles, punish bad haggles, notice price */
3500 if (good > ((3 * bad) + (5 + (minprice/50)))) return (TRUE);
3502 /* Return the flag */
3508 * @brief 店主の持つプレイヤーに対する売買の良し悪し経験を記憶する /
3509 * Update the bargain info
3510 * @param price 実際の取引価格
3511 * @param minprice 店主の提示した価格
3515 static void updatebargain(PRICE price, PRICE minprice, int num)
3517 /* Hack -- auto-haggle */
3518 if (!manual_haggle) return;
3520 /* Cheap items are "boring" */
3521 if ((minprice/num) < 10L) return;
3523 /* Count the successful haggles */
3524 if (price == minprice)
3526 /* Just count the good haggles */
3527 if (st_ptr->good_buy < MAX_SHORT)
3533 /* Count the failed haggles */
3536 /* Just count the bad haggles */
3537 if (st_ptr->bad_buy < MAX_SHORT)
3546 * @brief 店の商品リストを再表示する /
3547 * Re-displays a single store entry
3551 static void display_entry(int pos)
3557 GAME_TEXT o_name[MAX_NLEN];
3562 o_ptr = &st_ptr->stock[pos];
3564 /* Get the "offset" */
3565 i = (pos % store_bottom);
3567 /* Label it, clear the line --(-- */
3568 (void)sprintf(out_val, "%c) ", ((i > 25) ? toupper(I2A(i - 26)) : I2A(i)));
3569 prt(out_val, i+6, 0);
3572 if (show_item_graph)
3574 TERM_COLOR a = object_attr(o_ptr);
3575 SYMBOL_CODE c = object_char(o_ptr);
3577 Term_queue_bigchar(cur_col, i + 6, a, c, 0, 0);
3578 if (use_bigtile) cur_col++;
3583 /* Describe an item in the home */
3584 if ((cur_store_num == STORE_HOME) || (cur_store_num == STORE_MUSEUM))
3588 /* Leave room for weights, if necessary -DRS- */
3589 if (show_weights) maxwid -= 10;
3591 object_desc(o_name, o_ptr, 0);
3592 o_name[maxwid] = '\0';
3593 c_put_str(tval_to_attr[o_ptr->tval], o_name, i+6, cur_col);
3598 /* Only show the weight of an individual item */
3599 WEIGHT wgt = o_ptr->weight;
3601 sprintf(out_val, "%3d.%1d kg", lbtokg1(wgt) , lbtokg2(wgt));
3602 put_str(out_val, i+6, 67);
3604 (void)sprintf(out_val, "%3d.%d lb", wgt / 10, wgt % 10);
3605 put_str(out_val, i+6, 68);
3611 /* Describe an item (fully) in a store */
3614 /* Must leave room for the "price" */
3617 /* Leave room for weights, if necessary -DRS- */
3618 if (show_weights) maxwid -= 7;
3620 /* Describe the object (fully) */
3621 object_desc(o_name, o_ptr, 0);
3622 o_name[maxwid] = '\0';
3623 c_put_str(tval_to_attr[o_ptr->tval], o_name, i+6, cur_col);
3628 /* Only show the weight of an individual item */
3629 int wgt = o_ptr->weight;
3631 sprintf(out_val, "%3d.%1d", lbtokg1(wgt) , lbtokg2(wgt) );
3632 put_str(out_val, i+6, 60);
3634 (void)sprintf(out_val, "%3d.%d", wgt / 10, wgt % 10);
3635 put_str(out_val, i+6, 61);
3640 /* Display a "fixed" cost */
3641 if (o_ptr->ident & (IDENT_FIXED))
3643 /* Extract the "minimum" price */
3644 x = price_item(o_ptr, ot_ptr->min_inflate, FALSE);
3646 /* Actually draw the price (not fixed) */
3648 (void)sprintf(out_val, "%9ld固", (long)x);
3650 (void)sprintf(out_val, "%9ld F", (long)x);
3652 put_str(out_val, i+6, 68);
3655 /* Display a "taxed" cost */
3656 else if (!manual_haggle)
3658 /* Extract the "minimum" price */
3659 x = price_item(o_ptr, ot_ptr->min_inflate, FALSE);
3661 /* Hack -- Apply Sales Tax if needed */
3662 if (!noneedtobargain(x)) x += x / 10;
3664 /* Actually draw the price (with tax) */
3665 (void)sprintf(out_val, "%9ld ", (long)x);
3666 put_str(out_val, i+6, 68);
3669 /* Display a "haggle" cost */
3672 /* Extrect the "maximum" price */
3673 x = price_item(o_ptr, ot_ptr->max_inflate, FALSE);
3675 /* Actually draw the price (not fixed) */
3676 (void)sprintf(out_val, "%9ld ", (long)x);
3677 put_str(out_val, i+6, 68);
3684 * @brief 店の商品リストを表示する /
3685 * Displays a store's p_ptr->inventory_list -RAK-
3688 * All prices are listed as "per individual object". -BEN-
3690 static void display_inventory(void)
3694 /* Display the next 12 items */
3695 for (k = 0; k < store_bottom; k++)
3697 /* Do not display "dead" items */
3698 if (store_top + k >= st_ptr->stock_num) break;
3700 /* Display that line */
3701 display_entry(store_top + k);
3704 /* Erase the extra lines and the "more" prompt */
3705 for (i = k; i < store_bottom + 1; i++) prt("", i + 6, 0);
3707 /* Assume "no current page" */
3709 put_str(" ", 5, 20);
3711 put_str(" ", 5, 20);
3715 /* Visual reminder of "more items" */
3716 if (st_ptr->stock_num > store_bottom)
3718 /* Show "more" reminder (after the last item) */
3719 prt(_("-続く-", "-more-"), k + 6, 3);
3721 /* Indicate the "current page" */
3722 /* Trailing spaces are to display (Page xx) and (Page x) */
3723 put_str(format(_("(%dページ) ", "(Page %d) "), store_top/store_bottom + 1), 5, 20);
3726 if (cur_store_num == STORE_HOME || cur_store_num == STORE_MUSEUM)
3728 k = st_ptr->stock_size;
3730 if (cur_store_num == STORE_HOME && !powerup_home) k /= 10;
3732 put_str(format("アイテム数: %4d/%4d", st_ptr->stock_num, k), 19 + xtra_stock, 27);
3734 put_str(format("Objects: %4d/%4d", st_ptr->stock_num, k), 19 + xtra_stock, 30);
3741 * @brief プレイヤーの所持金を表示する /
3742 * Displays players gold -RAK-
3746 static void store_prt_gold(void)
3750 prt(_("手持ちのお金: ", "Gold Remaining: "), 19 + xtra_stock, 53);
3751 sprintf(out_val, "%9ld", (long)p_ptr->au);
3752 prt(out_val, 19 + xtra_stock, 68);
3756 * @brief 店舗情報全体を表示するメインルーチン /
3757 * Displays store (after clearing screen) -RAK-
3761 static void display_store(void)
3767 /* The "Home" is special */
3768 if (cur_store_num == STORE_HOME)
3770 /* Put the owner name */
3771 put_str(_("我が家", "Your Home"), 3, 31);
3773 /* Label the item descriptions */
3774 put_str(_("アイテムの一覧", "Item Description"), 5, 4);
3776 /* If showing weights, show label */
3779 put_str(_(" 重さ", "Weight"), 5, 70);
3783 /* The "Home" is special */
3784 else if (cur_store_num == STORE_MUSEUM)
3786 /* Put the owner name */
3787 put_str(_("博物館", "Museum"), 3, 31);
3789 /* Label the item descriptions */
3790 put_str(_("アイテムの一覧", "Item Description"), 5, 4);
3792 /* If showing weights, show label */
3795 put_str(_(" 重さ", "Weight"), 5, 70);
3802 concptr store_name = (f_name + f_info[cur_store_feat].name);
3803 concptr owner_name = (ot_ptr->owner_name);
3804 concptr race_name = race_info[ot_ptr->owner_race].title;
3806 /* Put the owner name and race */
3807 sprintf(buf, "%s (%s)", owner_name, race_name);
3808 put_str(buf, 3, 10);
3810 /* Show the max price in the store (above prices) */
3811 sprintf(buf, "%s (%ld)", store_name, (long)(ot_ptr->max_cost));
3814 /* Label the item descriptions */
3815 put_str(_("商品の一覧", "Item Description"), 5, 5);
3818 /* If showing weights, show label */
3821 put_str(_(" 重さ", "Weight"), 5, 60);
3824 /* Label the asking price (in stores) */
3825 put_str(_(" 価格", "Price"), 5, 72);
3828 /* Display the current gold */
3831 /* Draw in the p_ptr->inventory_list */
3832 display_inventory();
3838 * @brief 店舗からアイテムを選択する /
3839 * Get the ID of a store item and return its value -RAK-
3840 * @param com_val 選択IDを返す参照ポインタ
3841 * @param pmt メッセージキャプション
3844 * @return 実際に選択したらTRUE、キャンセルしたらFALSE
3846 static int get_stock(COMMAND_CODE *com_val, concptr pmt, int i, int j)
3852 /* Get the item index */
3853 if (repeat_pull(com_val))
3855 /* Verify the item */
3856 if ((*com_val >= i) && (*com_val <= j))
3864 /* Assume failure */
3867 /* Build the prompt */
3869 hi = (j > 25) ? toupper(I2A(j - 26)) : I2A(j);
3871 (void)sprintf(out_val, "(%s:%c-%c, ESCで中断) %s",
3872 (((cur_store_num == STORE_HOME) || (cur_store_num == STORE_MUSEUM)) ? "アイテム" : "商品"),
3875 (void)sprintf(out_val, "(Items %c-%c, ESC to exit) %s",
3880 /* Ask until done */
3886 if (!get_com(out_val, &command, FALSE)) break;
3889 if (islower(command))
3891 else if (isupper(command))
3892 k = A2I(tolower(command)) + 26;
3896 /* Legal responses */
3897 if ((k >= i) && (k <= j))
3906 /* Clear the prompt */
3909 if (command == ESCAPE) return (FALSE);
3911 repeat_push(*com_val);
3919 * @brief 店主の不満度を増やし、プレイヤーを締め出す判定と処理を行う /
3920 * Increase the insult counter and get angry if too many -RAK-
3921 * @return プレイヤーを締め出す場合TRUEを返す
3923 static int increase_insults(void)
3925 /* Increase insults */
3926 st_ptr->insult_cur++;
3928 /* Become insulted */
3929 if (st_ptr->insult_cur > ot_ptr->insult_max)
3935 st_ptr->insult_cur = 0;
3936 st_ptr->good_buy = 0;
3937 st_ptr->bad_buy = 0;
3940 st_ptr->store_open = current_world_ptr->game_turn + TURNS_PER_TICK*TOWN_DAWN/8 + randint1(TURNS_PER_TICK*TOWN_DAWN/8);
3952 * @brief 店主の不満度を減らす /
3953 * Decrease insults -RAK-
3954 * @return プレイヤーを締め出す場合TRUEを返す
3956 static void decrease_insults(void)
3958 /* Decrease insults */
3959 if (st_ptr->insult_cur) st_ptr->insult_cur--;
3964 * @brief 店主の不満度が増えた場合のみのメッセージを表示する /
3965 * Have insulted while haggling -RAK-
3966 * @return プレイヤーを締め出す場合TRUEを返す
3968 static int haggle_insults(void)
3970 /* Increase insults */
3971 if (increase_insults()) return (TRUE);
3973 /* Display and flush insult */
3982 * Mega-Hack -- Enable "increments"
3984 static bool allow_inc = FALSE;
3987 * Mega-Hack -- Last "increment" during haggling
3989 static s32b last_inc = 0L;
3993 * @brief 交渉価格を確認と認証の是非を行う /
3996 * @param poffer 別途価格提示をした場合の値を返す参照ポインタ
3997 * @param price 現在の交渉価格
3998 * @param final 最終確定価格ならばTRUE
3999 * @return プレイヤーを締め出す場合TRUEを返す
4001 static int get_haggle(concptr pmt, s32b *poffer, PRICE price, int final)
4006 GAME_TEXT out_val[160];
4008 /* Clear old increment if necessary */
4009 if (!allow_inc) last_inc = 0L;
4014 sprintf(buf, _("%s [承諾] ", "%s [accept] "), pmt);
4017 /* Old (negative) increment, and not final */
4018 else if (last_inc < 0)
4020 sprintf(buf, _("%s [-$%ld] ", "%s [-%ld] "), pmt, (long)(ABS(last_inc)));
4023 /* Old (positive) increment, and not final */
4024 else if (last_inc > 0)
4026 sprintf(buf, _("%s [+$%ld] ", "%s [+%ld] "), pmt, (long)(ABS(last_inc)));
4032 sprintf(buf, "%s ", pmt);
4036 /* Ask until done */
4041 /* Display prompt */
4045 strcpy(out_val, "");
4048 * Ask the user for a response.
4049 * Don't allow to use numpad as cursor key.
4051 res = askfor_aux(out_val, 32, FALSE);
4057 if (!res) return FALSE;
4059 /* Skip leading spaces */
4060 for (p = out_val; *p == ' '; p++) /* loop */;
4062 /* Empty response */
4065 /* Accept current price */
4073 /* Use previous increment */
4074 if (allow_inc && last_inc)
4076 *poffer += last_inc;
4081 /* Normal response */
4084 /* Extract a number */
4087 /* Handle "incremental" number */
4088 if ((*p == '+' || *p == '-'))
4090 /* Allow increments */
4093 /* Use the given "increment" */
4100 /* Handle normal number */
4103 /* Use the given "number" */
4111 msg_print(_("値がおかしいです。", "Invalid response."));
4121 * @brief 店主がプレイヤーからの交渉価格を判断する /
4122 * Receive an offer (from the player)
4124 * @param poffer 店主からの交渉価格を返す参照ポインタ
4125 * @param last_offer 現在の交渉価格
4126 * @param factor 店主の価格基準倍率
4127 * @param price アイテムの実価値
4128 * @param final 最終価格確定ならばTRUE
4129 * @return プレイヤーの価格に対して不服ならばTRUEを返す /
4130 * Return TRUE if offer is NOT okay
4132 static bool receive_offer(concptr pmt, s32b *poffer,
4133 s32b last_offer, int factor,
4134 PRICE price, int final)
4136 /* Haggle till done */
4139 /* Get a haggle (or cancel) */
4140 if (!get_haggle(pmt, poffer, price, final)) return (TRUE);
4142 /* Acceptable offer */
4143 if (((*poffer) * factor) >= (last_offer * factor)) break;
4145 /* Insult, and check for kicked out */
4146 if (haggle_insults()) return (TRUE);
4148 /* Reject offer (correctly) */
4149 (*poffer) = last_offer;
4158 * @brief プレイヤーが購入する時の値切り処理メインルーチン /
4159 * Haggling routine -RAK-
4160 * @param o_ptr オブジェクトの構造体参照ポインタ
4161 * @param price 最終価格を返す参照ポインタ
4162 * @return プレイヤーの価格に対して店主が不服ならばTRUEを返す /
4163 * Return TRUE if purchase is NOT successful
4165 static bool purchase_haggle(object_type *o_ptr, s32b *price)
4167 s32b cur_ask, final_ask;
4168 s32b last_offer, offer;
4170 s32b min_per, max_per;
4171 int flag, loop_flag, noneed;
4172 int annoyed = 0, final = FALSE;
4173 bool cancel = FALSE;
4177 concptr pmt = _("提示価格", "Asking");
4179 /* Extract the starting offer and the final offer */
4180 cur_ask = price_item(o_ptr, ot_ptr->max_inflate, FALSE);
4181 final_ask = price_item(o_ptr, ot_ptr->min_inflate, FALSE);
4183 /* Determine if haggling is necessary */
4184 noneed = noneedtobargain(final_ask);
4186 /* No need to haggle */
4187 if (noneed || !manual_haggle)
4189 /* No need to haggle */
4192 /* Message summary */
4193 msg_print(_("結局この金額にまとまった。", "You eventually agree upon the price."));
4197 /* No haggle option */
4200 /* Message summary */
4201 msg_print(_("すんなりとこの金額にまとまった。", "You quickly agree upon the price."));
4204 /* Apply Sales Tax */
4205 final_ask += final_ask / 10;
4209 cur_ask = final_ask;
4211 /* Go to final offer */
4212 pmt = _("最終提示価格", "Final Offer");
4217 /* Haggle for the whole pile */
4218 cur_ask *= o_ptr->number;
4219 final_ask *= o_ptr->number;
4222 /* Haggle parameters */
4223 min_per = ot_ptr->haggle_per;
4224 max_per = min_per * 3;
4226 /* Mega-Hack -- artificial "last offer" value */
4227 last_offer = object_value(o_ptr) * o_ptr->number;
4228 last_offer = last_offer * (200 - (int)(ot_ptr->max_inflate)) / 100L;
4229 if (last_offer <= 0) last_offer = 1;
4234 /* No incremental haggling yet */
4237 /* Haggle until done */
4238 for (flag = FALSE; !flag; )
4242 while (!flag && loop_flag)
4244 (void)sprintf(out_val, "%s : %ld", pmt, (long)cur_ask);
4245 put_str(out_val, 1, 0);
4246 cancel = receive_offer(_("提示する金額? ", "What do you offer? "), &offer, last_offer, 1, cur_ask, final);
4251 else if (offer > cur_ask)
4256 else if (offer == cur_ask)
4269 x1 = 100 * (offer - last_offer) / (cur_ask - last_offer);
4272 if (haggle_insults())
4278 else if (x1 > max_per)
4281 if (x1 < max_per) x1 = max_per;
4283 x2 = rand_range(x1-2, x1+2);
4284 x3 = ((cur_ask - offer) * x2 / 100L) + 1;
4285 /* don't let the price go up */
4290 if (cur_ask < final_ask)
4293 cur_ask = final_ask;
4294 pmt = _("最終提示価格", "What do you offer? ");
4298 (void)(increase_insults());
4303 else if (offer >= cur_ask)
4314 (void)sprintf(out_val, _("前回の提示金額: $%ld", "Your last offer: %ld"), (long)last_offer);
4315 put_str(out_val, 1, 39);
4316 say_comment_2(cur_ask, annoyed);
4321 if (cancel) return (TRUE);
4323 updatebargain(*price, final_ask, o_ptr->number);
4331 * @brief プレイヤーが売却する時の値切り処理メインルーチン /
4332 * Haggling routine -RAK-
4333 * @param o_ptr オブジェクトの構造体参照ポインタ
4334 * @param price 最終価格を返す参照ポインタ
4335 * @return プレイヤーの価格に対して店主が不服ならばTRUEを返す /
4336 * Return TRUE if purchase is NOT successful
4338 static bool sell_haggle(object_type *o_ptr, s32b *price)
4340 s32b purse, cur_ask, final_ask;
4341 s32b last_offer = 0, offer = 0;
4343 s32b min_per, max_per;
4344 int flag, loop_flag, noneed;
4345 int annoyed = 0, final = FALSE;
4346 bool cancel = FALSE;
4347 concptr pmt = _("提示金額", "Offer");
4353 /* Obtain the starting offer and the final offer */
4354 cur_ask = price_item(o_ptr, ot_ptr->max_inflate, TRUE);
4355 final_ask = price_item(o_ptr, ot_ptr->min_inflate, TRUE);
4357 /* Determine if haggling is necessary */
4358 noneed = noneedtobargain(final_ask);
4360 /* Get the owner's payout limit */
4361 purse = (s32b)(ot_ptr->max_cost);
4363 /* No need to haggle */
4364 if (noneed || !manual_haggle || (final_ask >= purse))
4366 /* Apply Sales Tax (if needed) */
4367 if (!manual_haggle && !noneed)
4369 final_ask -= final_ask / 10;
4372 /* No reason to haggle */
4373 if (final_ask >= purse)
4375 msg_print(_("即座にこの金額にまとまった。", "You instantly agree upon the price."));
4378 /* Offer full purse */
4382 /* No need to haggle */
4385 msg_print(_("結局この金額にまとまった。", "You eventually agree upon the price."));
4389 /* No haggle option */
4392 /* Message summary */
4393 msg_print(_("すんなりとこの金額にまとまった。", "You quickly agree upon the price."));
4398 cur_ask = final_ask;
4402 pmt = _("最終提示金額", "Final Offer");
4405 /* Haggle for the whole pile */
4406 cur_ask *= o_ptr->number;
4407 final_ask *= o_ptr->number;
4410 /* Display commands */
4412 /* Haggling parameters */
4413 min_per = ot_ptr->haggle_per;
4414 max_per = min_per * 3;
4416 /* Mega-Hack -- artificial "last offer" value */
4417 last_offer = object_value(o_ptr) * o_ptr->number;
4418 last_offer = last_offer * ot_ptr->max_inflate / 100L;
4423 /* No incremental haggling yet */
4427 for (flag = FALSE; !flag; )
4433 (void)sprintf(out_val, "%s : %ld", pmt, (long)cur_ask);
4434 put_str(out_val, 1, 0);
4435 cancel = receive_offer(_("提示する価格? ", "What price do you ask? "),
4436 &offer, last_offer, -1, cur_ask, final);
4442 else if (offer < cur_ask)
4445 /* rejected, reset offer for incremental haggling */
4448 else if (offer == cur_ask)
4459 if (flag || !loop_flag) break;
4464 x1 = 100 * (last_offer - offer) / (last_offer - cur_ask);
4467 if (haggle_insults())
4473 else if (x1 > max_per)
4476 if (x1 < max_per) x1 = max_per;
4478 x2 = rand_range(x1-2, x1+2);
4479 x3 = ((offer - cur_ask) * x2 / 100L) + 1;
4480 /* don't let the price go down */
4484 if (cur_ask > final_ask)
4486 cur_ask = final_ask;
4488 pmt = _("最終提示金額", "Final Offer");
4495 /* 追加 $0 で買い取られてしまうのを防止 By FIRST*/
4498 (void)(increase_insults());
4501 else if (offer <= cur_ask)
4512 (void)sprintf(out_val,
4513 _("前回の提示価格 $%ld", "Your last bid %ld"), (long)last_offer);
4514 put_str(out_val, 1, 39);
4515 say_comment_3(cur_ask, annoyed);
4520 if (cancel) return (TRUE);
4522 updatebargain(*price, final_ask, o_ptr->number);
4530 * @brief 店からの購入処理のメインルーチン /
4531 * Buy an item from a store -RAK-
4534 static void store_purchase(void)
4537 COMMAND_CODE item, item_new;
4548 GAME_TEXT o_name[MAX_NLEN];
4552 if (cur_store_num == STORE_MUSEUM)
4554 msg_print(_("博物館から取り出すことはできません。", "Museum."));
4559 if (st_ptr->stock_num <= 0)
4561 if (cur_store_num == STORE_HOME)
4562 msg_print(_("我が家には何も置いてありません。", "Your home is empty."));
4564 msg_print(_("現在商品の在庫を切らしています。", "I am currently out of stock."));
4568 /* Find the number of objects on this and following pages */
4569 i = (st_ptr->stock_num - store_top);
4571 /* And then restrict it to the current page */
4572 if (i > store_bottom) i = store_bottom;
4576 /* ブラックマーケットの時は別のメッセージ */
4577 switch( cur_store_num ) {
4579 sprintf(out_val, "どのアイテムを取りますか? ");
4582 sprintf(out_val, "どれ? ");
4585 sprintf(out_val, "どの品物が欲しいんだい? ");
4589 if (cur_store_num == STORE_HOME)
4591 sprintf(out_val, "Which item do you want to take? ");
4595 sprintf(out_val, "Which item are you interested in? ");
4600 /* Get the item number to be bought */
4601 if (!get_stock(&item, out_val, 0, i - 1)) return;
4603 /* Get the actual index */
4604 item = item + store_top;
4606 /* Get the actual item */
4607 o_ptr = &st_ptr->stock[item];
4609 /* Assume the player wants just one of them */
4613 /* Get a copy of the object */
4614 object_copy(j_ptr, o_ptr);
4617 * If a rod or wand, allocate total maximum timeouts or charges
4618 * between those purchased and left on the shelf.
4620 reduce_charges(j_ptr, o_ptr->number - amt);
4622 /* Modify quantity */
4623 j_ptr->number = amt;
4625 /* Hack -- require room in pack */
4626 if (!inven_carry_okay(j_ptr))
4628 msg_print(_("そんなにアイテムを持てない。", "You cannot carry that many different items."));
4632 /* Determine the "best" price (per item) */
4633 best = price_item(j_ptr, ot_ptr->min_inflate, FALSE);
4635 /* Find out how many the player wants */
4636 if (o_ptr->number > 1)
4638 /* Hack -- note cost of "fixed" items */
4639 if ((cur_store_num != STORE_HOME) &&
4640 (o_ptr->ident & IDENT_FIXED))
4642 msg_format(_("一つにつき $%ldです。", "That costs %ld gold per item."), (long)(best));
4644 amt = get_quantity(NULL, o_ptr->number);
4645 if (amt <= 0) return;
4649 /* Get desired object */
4650 object_copy(j_ptr, o_ptr);
4653 * If a rod or wand, allocate total maximum timeouts or charges
4654 * between those purchased and left on the shelf.
4656 reduce_charges(j_ptr, o_ptr->number - amt);
4658 /* Modify quantity */
4659 j_ptr->number = amt;
4661 /* Hack -- require room in pack */
4662 if (!inven_carry_okay(j_ptr))
4664 msg_print(_("ザックにそのアイテムを入れる隙間がない。", "You cannot carry that many items."));
4668 /* Attempt to buy it */
4669 if (cur_store_num != STORE_HOME)
4671 /* Fixed price, quick buy */
4672 if (o_ptr->ident & (IDENT_FIXED))
4677 /* Go directly to the "best" deal */
4678 price = (best * j_ptr->number);
4684 /* Describe the object (fully) */
4685 object_desc(o_name, j_ptr, 0);
4686 msg_format(_("%s(%c)を購入する。", "Buying %s (%c)."), o_name, I2A(item));
4689 /* Haggle for a final price */
4690 choice = purchase_haggle(j_ptr, &price);
4692 /* Hack -- Got kicked out */
4693 if (st_ptr->store_open >= current_world_ptr->game_turn) return;
4696 /* Player wants it */
4699 /* Fix the item price (if "correctly" haggled) */
4700 if (price == (best * j_ptr->number)) o_ptr->ident |= (IDENT_FIXED);
4702 /* Player can afford it */
4703 if (p_ptr->au >= price)
4708 if (cur_store_num == STORE_BLACK) /* The black market is illegal! */
4709 chg_virtue(V_JUSTICE, -1);
4710 if((o_ptr->tval == TV_BOTTLE) && (cur_store_num != STORE_HOME))
4711 chg_virtue(V_NATURE, -1);
4719 /* Spend the money */
4722 /* Update the display */
4725 /* Hack -- buying an item makes you aware of it */
4726 object_aware(j_ptr);
4728 /* Hack -- clear the "fixed" flag from the item */
4729 j_ptr->ident &= ~(IDENT_FIXED);
4731 /* Describe the transaction */
4732 object_desc(o_name, j_ptr, 0);
4734 msg_format(_("%sを $%ldで購入しました。", "You bought %s for %ld gold."), o_name, (long)price);
4736 strcpy(record_o_name, o_name);
4737 record_turn = current_world_ptr->game_turn;
4739 if (record_buy) do_cmd_write_nikki(NIKKI_BUY, 0, o_name);
4740 object_desc(o_name, o_ptr, OD_NAME_ONLY);
4741 if(record_rand_art && o_ptr->art_name)
4742 do_cmd_write_nikki(NIKKI_ART, 0, o_name);
4744 /* Erase the inscription */
4745 j_ptr->inscription = 0;
4747 /* Erase the "feeling" */
4748 j_ptr->feeling = FEEL_NONE;
4749 j_ptr->ident &= ~(IDENT_STORE);
4750 /* Give it to the player */
4751 item_new = inven_carry(j_ptr);
4753 /* Describe the final result */
4754 object_desc(o_name, &p_ptr->inventory_list[item_new], 0);
4755 msg_format(_("%s(%c)を手に入れた。", "You have %s (%c)."), o_name, index_to_label(item_new));
4757 /* Auto-inscription */
4758 autopick_alter_item(item_new, FALSE);
4760 /* Now, reduce the original stack's pval. */
4761 if ((o_ptr->tval == TV_ROD) || (o_ptr->tval == TV_WAND))
4763 o_ptr->pval -= j_ptr->pval;
4767 /* Note how many slots the store used to have */
4768 i = st_ptr->stock_num;
4770 /* Remove the bought items from the store */
4771 store_item_increase(item, -amt);
4772 store_item_optimize(item);
4774 /* Store is empty */
4775 if (st_ptr->stock_num == 0)
4778 if (one_in_(STORE_SHUFFLE))
4781 msg_print(_("店主は引退した。", "The shopkeeper retires."));
4783 /* Shuffle the store */
4784 store_shuffle(cur_store_num);
4787 sprintf(buf, "%s (%s)",
4788 ot_ptr->owner_name, race_info[ot_ptr->owner_race].title);
4789 put_str(buf, 3, 10);
4790 sprintf(buf, "%s (%ld)",
4791 (f_name + f_info[cur_store_feat].name), (long)(ot_ptr->max_cost));
4798 msg_print(_("店主は新たな在庫を取り出した。", "The shopkeeper brings out some new stock."));
4801 /* New p_ptr->inventory_list */
4802 for (i = 0; i < 10; i++)
4804 /* Maintain the store */
4805 store_maint(p_ptr->town_num, cur_store_num);
4810 display_inventory();
4813 /* The item is gone */
4814 else if (st_ptr->stock_num != i)
4816 /* Pick the correct screen */
4817 if (store_top >= st_ptr->stock_num) store_top -= store_bottom;
4818 display_inventory();
4821 /* Item is still here */
4824 /* Redraw the item */
4825 display_entry(item);
4829 /* Player cannot afford it */
4832 /* Simple message (no insult) */
4833 msg_print(_("お金が足りません。", "You do not have enough gold."));
4838 /* Home is much easier */
4841 bool combined_or_reordered;
4843 /* Distribute charges of wands/rods */
4844 distribute_charges(o_ptr, j_ptr, amt);
4846 /* Give it to the player */
4847 item_new = inven_carry(j_ptr);
4849 /* Describe just the result */
4850 object_desc(o_name, &p_ptr->inventory_list[item_new], 0);
4852 msg_format(_("%s(%c)を取った。", "You have %s (%c)."), o_name, index_to_label(item_new));
4855 /* Take note if we take the last one */
4856 i = st_ptr->stock_num;
4858 /* Remove the items from the home */
4859 store_item_increase(item, -amt);
4860 store_item_optimize(item);
4862 combined_or_reordered = combine_and_reorder_home(STORE_HOME);
4864 /* Hack -- Item is still here */
4865 if (i == st_ptr->stock_num)
4867 if (combined_or_reordered) display_inventory();
4869 /* Redraw the item */
4870 else display_entry(item);
4873 /* The item is gone */
4877 if (st_ptr->stock_num == 0) store_top = 0;
4879 /* Nothing left on that screen */
4880 else if (store_top >= st_ptr->stock_num) store_top -= store_bottom;
4881 display_inventory();
4883 chg_virtue(V_SACRIFICE, 1);
4887 /* Not kicked out */
4893 * @brief 店からの売却処理のメインルーチン /
4894 * Sell an item to the store (or home)
4897 static void store_sell(void)
4904 PRICE price, value, dummy;
4912 GAME_TEXT o_name[MAX_NLEN];
4915 /* Prepare a prompt */
4916 if (cur_store_num == STORE_HOME)
4917 q = _("どのアイテムを置きますか? ", "Drop which item? ");
4919 else if (cur_store_num == STORE_MUSEUM)
4920 q = _("どのアイテムを寄贈しますか? ", "Give which item? ");
4923 q = _("どのアイテムを売りますか? ", "Sell which item? ");
4925 /* Only allow items the store will buy */
4926 item_tester_hook = store_will_buy;
4928 /* 我が家でおかしなメッセージが出るオリジナルのバグを修正 */
4929 if (cur_store_num == STORE_HOME)
4931 s = _("置けるアイテムを持っていません。", "You don't have any item to drop.");
4933 else if (cur_store_num == STORE_MUSEUM)
4935 s = _("寄贈できるアイテムを持っていません。", "You don't have any item to give.");
4939 s = _("欲しい物がないですねえ。", "You have nothing that I want.");
4942 o_ptr = choose_object(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT));
4945 /* Hack -- Cannot remove cursed items */
4946 if ((item >= INVEN_RARM) && object_is_cursed(o_ptr))
4948 msg_print(_("ふーむ、どうやらそれは呪われているようだね。", "Hmmm, it seems to be cursed."));
4952 /* Assume one item */
4955 if (o_ptr->number > 1)
4957 amt = get_quantity(NULL, o_ptr->number);
4958 if (amt <= 0) return;
4962 /* Get a copy of the object */
4963 object_copy(q_ptr, o_ptr);
4965 /* Modify quantity */
4966 q_ptr->number = amt;
4969 * Hack -- If a rod or wand, allocate total maximum
4970 * timeouts or charges to those being sold. -LM-
4972 if ((o_ptr->tval == TV_ROD) || (o_ptr->tval == TV_WAND))
4974 q_ptr->pval = o_ptr->pval * amt / o_ptr->number;
4977 /* Get a full description */
4978 object_desc(o_name, q_ptr, 0);
4980 /* Remove any inscription, feeling for stores */
4981 if ((cur_store_num != STORE_HOME) && (cur_store_num != STORE_MUSEUM))
4983 q_ptr->inscription = 0;
4984 q_ptr->feeling = FEEL_NONE;
4987 /* Is there room in the store (or the home?) */
4988 if (!store_check_num(q_ptr))
4990 if (cur_store_num == STORE_HOME)
4991 msg_print(_("我が家にはもう置く場所がない。", "Your home is full."));
4993 else if (cur_store_num == STORE_MUSEUM)
4994 msg_print(_("博物館はもう満杯だ。", "Museum is full."));
4997 msg_print(_("すいませんが、店にはもう置く場所がありません。", "I have not the room in my store to keep it."));
5004 if ((cur_store_num != STORE_HOME) && (cur_store_num != STORE_MUSEUM))
5006 /* Describe the transaction */
5007 msg_format(_("%s(%c)を売却する。", "Selling %s (%c)."), o_name, index_to_label(item));
5012 choice = sell_haggle(q_ptr, &price);
5015 if (st_ptr->store_open >= current_world_ptr->game_turn) return;
5027 if (cur_store_num == STORE_BLACK) /* The black market is illegal! */
5028 chg_virtue(V_JUSTICE, -1);
5030 if((o_ptr->tval == TV_BOTTLE) && (cur_store_num != STORE_HOME))
5031 chg_virtue(V_NATURE, 1);
5034 /* Get some money */
5037 /* Update the display */
5040 /* Get the "apparent" value */
5041 dummy = object_value(q_ptr) * q_ptr->number;
5043 identify_item(o_ptr);
5046 /* Get a copy of the object */
5047 object_copy(q_ptr, o_ptr);
5049 /* Modify quantity */
5050 q_ptr->number = amt;
5052 /* Make it look like to be known */
5053 q_ptr->ident |= IDENT_STORE;
5056 * Hack -- If a rod or wand, let the shopkeeper know just
5057 * how many charges he really paid for. -LM-
5059 if ((o_ptr->tval == TV_ROD) || (o_ptr->tval == TV_WAND))
5061 q_ptr->pval = o_ptr->pval * amt / o_ptr->number;
5064 /* Get the "actual" value */
5065 value = object_value(q_ptr) * q_ptr->number;
5067 /* Get the description all over again */
5068 object_desc(o_name, q_ptr, 0);
5070 /* Describe the result (in message buffer) */
5071 msg_format(_("%sを $%ldで売却しました。", "You sold %s for %ld gold."), o_name, (long)price);
5073 if (record_sell) do_cmd_write_nikki(NIKKI_SELL, 0, o_name);
5075 if (!((o_ptr->tval == TV_FIGURINE) && (value > 0)))
5077 /* Analyze the prices (and comment verbally) unless a figurine*/
5078 purchase_analyze(price, value, dummy);
5082 * Hack -- Allocate charges between those wands or rods sold
5083 * and retained, unless all are being sold. -LM-
5085 distribute_charges(o_ptr, q_ptr, amt);
5087 /* Reset timeouts of the sold items */
5090 /* Take the item from the player, describe the result */
5091 inven_item_increase(item, -amt);
5092 inven_item_describe(item);
5094 /* If items remain, auto-inscribe before optimizing */
5095 if (o_ptr->number > 0)
5096 autopick_alter_item(item, FALSE);
5098 inven_item_optimize(item);
5101 /* The store gets that (known) item */
5102 item_pos = store_carry(q_ptr);
5104 /* Re-display if item is now in store */
5107 store_top = (item_pos / store_bottom) * store_bottom;
5108 display_inventory();
5113 /* Player is at museum */
5114 else if (cur_store_num == STORE_MUSEUM)
5116 char o2_name[MAX_NLEN];
5117 object_desc(o2_name, q_ptr, OD_NAME_ONLY);
5119 if (-1 == store_check_num(q_ptr))
5121 msg_print(_("それと同じ品物は既に博物館にあるようです。", "The same object as it is already in the Museum."));
5125 msg_print(_("博物館に寄贈したものは取り出すことができません!!", "You cannot take items which is given to the Museum back!!"));
5128 if (!get_check(format(_("本当に%sを寄贈しますか?", "Really give %s to the Museum? "), o2_name))) return;
5130 identify_item(q_ptr);
5131 q_ptr->ident |= IDENT_MENTAL;
5133 /* Distribute charges of wands/rods */
5134 distribute_charges(o_ptr, q_ptr, amt);
5135 msg_format(_("%sを置いた。(%c)", "You drop %s (%c)."), o_name, index_to_label(item));
5138 /* Take it from the players p_ptr->inventory_list */
5139 inven_item_increase(item, -amt);
5140 inven_item_describe(item);
5141 inven_item_optimize(item);
5144 /* Let the home carry it */
5145 item_pos = home_carry(q_ptr);
5147 /* Update store display */
5150 store_top = (item_pos / store_bottom) * store_bottom;
5151 display_inventory();
5154 /* Player is at home */
5157 /* Distribute charges of wands/rods */
5158 distribute_charges(o_ptr, q_ptr, amt);
5159 msg_format(_("%sを置いた。(%c)", "You drop %s (%c)."), o_name, index_to_label(item));
5163 /* Take it from the players p_ptr->inventory_list */
5164 inven_item_increase(item, -amt);
5165 inven_item_describe(item);
5166 inven_item_optimize(item);
5169 /* Let the home carry it */
5170 item_pos = home_carry(q_ptr);
5172 /* Update store display */
5175 store_top = (item_pos / store_bottom) * store_bottom;
5176 display_inventory();
5180 if ((choice == 0) && (item >= INVEN_RARM))
5189 * @brief 店のアイテムを調べるコマンドのメインルーチン /
5190 * Examine an item in a store -JDL-
5193 static void store_examine(void)
5198 GAME_TEXT o_name[MAX_NLEN];
5202 if (st_ptr->stock_num <= 0)
5204 if (cur_store_num == STORE_HOME)
5205 msg_print(_("我が家には何も置いてありません。", "Your home is empty."));
5206 else if (cur_store_num == STORE_MUSEUM)
5207 msg_print(_("博物館には何も置いてありません。", "Museum is empty."));
5209 msg_print(_("現在商品の在庫を切らしています。", "I am currently out of stock."));
5213 /* Find the number of objects on this and following pages */
5214 i = (st_ptr->stock_num - store_top);
5216 /* And then restrict it to the current page */
5217 if (i > store_bottom) i = store_bottom;
5220 sprintf(out_val, _("どれを調べますか?", "Which item do you want to examine? "));
5222 /* Get the item number to be examined */
5223 if (!get_stock(&item, out_val, 0, i - 1)) return;
5225 /* Get the actual index */
5226 item = item + store_top;
5228 /* Get the actual item */
5229 o_ptr = &st_ptr->stock[item];
5231 /* Require full knowledge */
5232 if (!(o_ptr->ident & IDENT_MENTAL))
5234 /* This can only happen in the home */
5235 msg_print(_("このアイテムについて特に知っていることはない。", "You have no special knowledge about that item."));
5239 object_desc(o_name, o_ptr, 0);
5240 msg_format(_("%sを調べている...", "Examining %s..."), o_name);
5242 if (!screen_object(o_ptr, SCROBJ_FORCE_DETAIL))
5243 msg_print(_("特に変わったところはないようだ。", "You see nothing special."));
5250 * @brief 博物館のアイテムを除去するコマンドのメインルーチン /
5251 * Remove an item from museum (Originally from TOband)
5254 static void museum_remove_object(void)
5259 GAME_TEXT o_name[MAX_NLEN];
5263 if (st_ptr->stock_num <= 0)
5265 msg_print(_("博物館には何も置いてありません。", "Museum is empty."));
5269 /* Find the number of objects on this and following pages */
5270 i = st_ptr->stock_num - store_top;
5272 /* And then restrict it to the current page */
5273 if (i > store_bottom) i = store_bottom;
5276 sprintf(out_val, _("どのアイテムの展示をやめさせますか?", "Which item do you want to order to remove? "));
5278 /* Get the item number to be removed */
5279 if (!get_stock(&item, out_val, 0, i - 1)) return;
5281 /* Get the actual index */
5282 item = item + store_top;
5284 /* Get the actual item */
5285 o_ptr = &st_ptr->stock[item];
5287 object_desc(o_name, o_ptr, 0);
5289 msg_print(_("展示をやめさせたアイテムは二度と見ることはできません!", "You cannot see items which is removed from the Museum!"));
5290 if (!get_check(format(_("本当に%sの展示をやめさせますか?", "Really order to remove %s from the Museum? "), o_name))) return;
5292 msg_format(_("%sの展示をやめさせた。", "You ordered to remove %s."), o_name);
5294 /* Remove the items from the home */
5295 store_item_increase(item, -o_ptr->number);
5296 store_item_optimize(item);
5298 (void)combine_and_reorder_home(STORE_MUSEUM);
5300 /* The item is gone */
5303 if (st_ptr->stock_num == 0) store_top = 0;
5305 /* Nothing left on that screen */
5306 else if (store_top >= st_ptr->stock_num) store_top -= store_bottom;
5307 display_inventory();
5314 * Hack -- set this to leave the store
5316 static bool leave_store = FALSE;
5320 * @brief 店舗処理コマンド選択のメインルーチン /
5321 * Process a command in a store
5325 * Note that we must allow the use of a few "special" commands
5326 * in the stores which are not allowed in the dungeon, and we
5327 * must disable some commands which are allowed in the dungeon
5328 * but not in the stores, to prevent chaos.
5331 static void store_process_command(void)
5333 /* Handle repeating the last command */
5336 if (rogue_like_commands && command_cmd == 'l')
5338 command_cmd = 'x'; /* hack! */
5341 /* Parse the command */
5342 switch (command_cmd)
5352 /* 1 ページ戻るコマンド: 我が家のページ数が多いので重宝するはず By BUG */
5355 if (st_ptr->stock_num <= store_bottom) {
5356 msg_print(_("これで全部です。", "Entire p_ptr->inventory_list is shown."));
5359 store_top -= store_bottom;
5360 if ( store_top < 0 )
5361 store_top = ((st_ptr->stock_num - 1 )/store_bottom) * store_bottom;
5362 if ( (cur_store_num == STORE_HOME) && (powerup_home == FALSE) )
5363 if ( store_top >= store_bottom ) store_top = store_bottom;
5364 display_inventory();
5372 if (st_ptr->stock_num <= store_bottom)
5374 msg_print(_("これで全部です。", "Entire p_ptr->inventory_list is shown."));
5378 store_top += store_bottom;
5380 * 隠しオプション(powerup_home)がセットされていないときは
5381 * 我が家では 2 ページまでしか表示しない
5383 if ((cur_store_num == STORE_HOME) &&
5384 (powerup_home == FALSE) &&
5385 (st_ptr->stock_num >= STORE_INVEN_MAX))
5387 if (store_top >= (STORE_INVEN_MAX - 1))
5394 if (store_top >= st_ptr->stock_num) store_top = 0;
5397 display_inventory();
5409 /* Get (purchase) */
5436 /*** Inventory Commands ***/
5438 /* Wear/wield equipment */
5445 /* Take off equipment */
5452 /* Destroy an item */
5459 /* Equipment list */
5466 /* Inventory list */
5474 /*** Various commands ***/
5476 /* Identify an object */
5483 /* Hack -- toggle windows */
5486 toggle_inven_equip();
5490 /*** Use various objects ***/
5495 if ( (p_ptr->pclass == CLASS_MINDCRAFTER) ||
5496 (p_ptr->pclass == CLASS_BERSERKER) ||
5497 (p_ptr->pclass == CLASS_NINJA) ||
5498 (p_ptr->pclass == CLASS_MIRROR_MASTER)
5499 ) do_cmd_mind_browse();
5500 else if (p_ptr->pclass == CLASS_SMITH)
5502 else if (p_ptr->pclass == CLASS_MAGIC_EATER)
5503 do_cmd_magic_eater(TRUE, FALSE);
5504 else if (p_ptr->pclass == CLASS_SNIPER)
5505 do_cmd_snipe_browse();
5506 else do_cmd_browse();
5510 /* Inscribe an object */
5517 /* Uninscribe an object */
5520 do_cmd_uninscribe();
5526 /*** Help and Such ***/
5535 /* Identify symbol */
5538 do_cmd_query_symbol();
5542 /* Character description */
5545 p_ptr->town_num = old_town_num;
5546 do_cmd_change_name();
5547 p_ptr->town_num = inner_town_num;
5553 /*** System Commands ***/
5555 /* Hack -- User interface */
5562 /* Single line from a pref file */
5565 p_ptr->town_num = old_town_num;
5567 p_ptr->town_num = inner_town_num;
5571 /* Interact with macros */
5574 p_ptr->town_num = old_town_num;
5576 p_ptr->town_num = inner_town_num;
5580 /* Interact with visuals */
5583 p_ptr->town_num = old_town_num;
5585 p_ptr->town_num = inner_town_num;
5589 /* Interact with colors */
5592 p_ptr->town_num = old_town_num;
5594 p_ptr->town_num = inner_town_num;
5598 /* Interact with options */
5602 (void)combine_and_reorder_home(STORE_HOME);
5608 /*** Misc Commands ***/
5624 /* Repeat level feeling */
5631 /* Show previous message */
5634 do_cmd_message_one();
5638 /* Show previous messages */
5651 /* Check artifacts, uniques etc. */
5658 /* Load "screen dump" */
5661 do_cmd_load_screen();
5665 /* Save "screen dump" */
5668 do_cmd_save_screen();
5672 /* Hack -- Unknown command */
5675 if ((cur_store_num == STORE_MUSEUM) && (command_cmd == 'r'))
5677 museum_remove_object();
5681 msg_print(_("そのコマンドは店の中では使えません。", "That command does not work in stores."));
5690 * @brief 店舗処理全体のメインルーチン /
5691 * Enter a store, and interact with it. *
5695 * Note that we use the standard "request_command()" function
5696 * to get a command, allowing us to use "command_arg" and all
5697 * command macros and other nifty stuff, but we use the special
5698 * "shopping" argument, to force certain commands to be converted
5699 * into other commands, normally, we convert "p" (pray) and "m"
5700 * (cast magic) into "g" (get), and "s" (search) into "d" (drop).
5703 void do_cmd_store(void)
5709 bool need_redraw_store_inv; /* To redraw missiles damage and prices in store */
5712 if(p_ptr->wild_mode) return;
5713 Term_get_size(&w, &h);
5715 /* Calculate stocks per 1 page */
5716 xtra_stock = MIN(14+26, ((h > 24) ? (h - 24) : 0));
5717 store_bottom = MIN_STOCK + xtra_stock;
5719 /* Access the player grid */
5720 g_ptr = ¤t_floor_ptr->grid_array[p_ptr->y][p_ptr->x];
5722 /* Verify a store */
5723 if (!cave_have_flag_grid(g_ptr, FF_STORE))
5725 msg_print(_("ここには店がありません。", "You see no store here."));
5729 /* Extract the store code */
5730 which = f_info[g_ptr->feat].subtype;
5732 old_town_num = p_ptr->town_num;
5733 if ((which == STORE_HOME) || (which == STORE_MUSEUM)) p_ptr->town_num = 1;
5734 if (current_floor_ptr->dun_level) p_ptr->town_num = NO_TOWN;
5735 inner_town_num = p_ptr->town_num;
5737 /* Hack -- Check the "locked doors" */
5738 if ((town_info[p_ptr->town_num].store[which].store_open >= current_world_ptr->game_turn) ||
5741 msg_print(_("ドアに鍵がかかっている。", "The doors are locked."));
5742 p_ptr->town_num = old_town_num;
5746 /* Calculate the number of store maintainances since the last visit */
5747 maintain_num = (current_world_ptr->game_turn - town_info[p_ptr->town_num].store[which].last_visit) / (TURNS_PER_TICK * STORE_TICKS);
5749 /* Maintain the store max. 10 times */
5750 if (maintain_num > 10) maintain_num = 10;
5754 /* Maintain the store */
5755 for (i = 0; i < maintain_num; i++)
5756 store_maint(p_ptr->town_num, which);
5758 /* Save the visit */
5759 town_info[p_ptr->town_num].store[which].last_visit = current_world_ptr->game_turn;
5765 /* Hack -- Character is in "icky" mode */
5766 current_world_ptr->character_icky = TRUE;
5773 /* Do not expand macros */
5774 get_com_no_macros = TRUE;
5776 /* Save the store number */
5777 cur_store_num = which;
5779 /* Hack -- save the store feature */
5780 cur_store_feat = g_ptr->feat;
5782 /* Save the store and owner pointers */
5783 st_ptr = &town_info[p_ptr->town_num].store[cur_store_num];
5784 ot_ptr = &owners[cur_store_num][st_ptr->owner];
5786 /* Start at the beginning */
5789 play_music(TERM_XTRA_MUSIC_BASIC, MUSIC_BASIC_BUILD);
5794 leave_store = FALSE;
5796 /* Interact with player */
5797 while (!leave_store)
5799 /* Hack -- Clear line 1 */
5803 clear_from(20 + xtra_stock);
5805 /* Basic commands */
5806 prt(_(" ESC) 建物から出る", " ESC) Exit from Building."), 21 + xtra_stock, 0);
5808 /* Browse if necessary */
5809 if (st_ptr->stock_num > store_bottom)
5811 prt(_(" -)前ページ", " -) Previous page"), 22 + xtra_stock, 0);
5812 prt(_(" スペース) 次ページ", " SPACE) Next page"), 23 + xtra_stock, 0);
5816 if (cur_store_num == STORE_HOME)
5818 prt(_("g) アイテムを取る", "g) Get an item."), 21 + xtra_stock, 27);
5819 prt(_("d) アイテムを置く", "d) Drop an item."), 22 + xtra_stock, 27);
5820 prt(_("x) 家のアイテムを調べる", "x) eXamine an item in the home."), 23 + xtra_stock, 27);
5823 /* Museum commands */
5824 else if (cur_store_num == STORE_MUSEUM)
5826 prt(_("d) アイテムを置く", "d) Drop an item."), 21 + xtra_stock, 27);
5827 prt(_("r) アイテムの展示をやめる", "r) order to Remove an item."), 22 + xtra_stock, 27);
5828 prt(_("x) 博物館のアイテムを調べる", "x) eXamine an item in the museum."), 23 + xtra_stock, 27);
5834 prt(_("p) 商品を買う", "p) Purchase an item."), 21 + xtra_stock, 30);
5835 prt(_("s) アイテムを売る", "s) Sell an item."), 22 + xtra_stock, 30);
5836 prt(_("x) 商品を調べる", "x) eXamine an item in the shop"), 23 + xtra_stock,30);
5840 prt(_("i/e) 持ち物/装備の一覧", "i/e) Inventry/Equipment list"), 21 + xtra_stock, 56);
5842 if (rogue_like_commands)
5844 prt(_("w/T) 装備する/はずす", "w/T) Wear/Take off equipment"), 22 + xtra_stock, 56);
5848 prt(_("w/t) 装備する/はずす", "w/t) Wear/Take off equipment"), 22 + xtra_stock, 56);
5852 prt(_("コマンド:", "You may: "), 20 + xtra_stock, 0);
5854 request_command(TRUE);
5856 /* Process the command */
5857 store_process_command();
5860 * Hack -- To redraw missiles damage and prices in store
5861 * If player's charisma changes, or if player changes a bow, PU_BONUS is set
5863 need_redraw_store_inv = (p_ptr->update & PU_BONUS) ? TRUE : FALSE;
5865 /* Hack -- Character is still in "icky" mode */
5866 current_world_ptr->character_icky = TRUE;
5871 if (p_ptr->inventory_list[INVEN_PACK].k_idx)
5873 INVENTORY_IDX item = INVEN_PACK;
5875 object_type *o_ptr = &p_ptr->inventory_list[item];
5877 /* Hack -- Flee from the store */
5878 if (cur_store_num != STORE_HOME)
5880 if (cur_store_num == STORE_MUSEUM)
5881 msg_print(_("ザックからアイテムがあふれそうなので、あわてて博物館から出た...", "Your pack is so full that you flee the Museum..."));
5883 msg_print(_("ザックからアイテムがあふれそうなので、あわてて店から出た...", "Your pack is so full that you flee the store..."));
5889 /* Hack -- Flee from the home */
5890 else if (!store_check_num(o_ptr))
5892 msg_print(_("ザックからアイテムがあふれそうなので、あわてて家から出た...", "Your pack is so full that you flee your home..."));
5897 /* Hack -- Drop items into the home */
5905 GAME_TEXT o_name[MAX_NLEN];
5907 /* Give a message */
5908 msg_print(_("ザックからアイテムがあふれてしまった!", "Your pack overflows!"));
5912 object_copy(q_ptr, o_ptr);
5913 object_desc(o_name, q_ptr, 0);
5915 msg_format(_("%sが落ちた。(%c)", "You drop %s (%c)."), o_name, index_to_label(item));
5917 /* Remove it from the players p_ptr->inventory_list */
5918 inven_item_increase(item, -255);
5919 inven_item_describe(item);
5920 inven_item_optimize(item);
5923 /* Let the home carry it */
5924 item_pos = home_carry(q_ptr);
5926 /* Redraw the home */
5929 store_top = (item_pos / store_bottom) * store_bottom;
5930 display_inventory();
5935 /* Hack -- Redisplay store prices if charisma changes */
5936 /* Hack -- Redraw missiles damage if player changes bow */
5937 if (need_redraw_store_inv) display_inventory();
5939 /* Hack -- get kicked out of the store */
5940 if (st_ptr->store_open >= current_world_ptr->game_turn) leave_store = TRUE;
5943 select_floor_music();
5945 p_ptr->town_num = old_town_num;
5947 take_turn(p_ptr, 100);
5949 /* Hack -- Character is no longer in "icky" mode */
5950 current_world_ptr->character_icky = FALSE;
5952 /* Hack -- Cancel automatic command */
5955 /* Hack -- Cancel "see" mode */
5956 command_see = FALSE;
5958 /* Allow expanding macros */
5959 get_com_no_macros = FALSE;
5964 /* Update everything */
5965 p_ptr->update |= (PU_VIEW | PU_LITE | PU_MON_LITE);
5966 p_ptr->update |= (PU_MONSTERS);
5968 /* Redraw entire screen */
5969 p_ptr->redraw |= (PR_BASIC | PR_EXTRA | PR_EQUIPPY);
5970 p_ptr->redraw |= (PR_MAP);
5971 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
5977 * @brief 現在の町の店主を交代させる /
5978 * Shuffle one of the stores.
5979 * @param which 店舗種類のID
5982 void store_shuffle(int which)
5988 if (which == STORE_HOME) return;
5989 if (which == STORE_MUSEUM) return;
5992 /* Save the store index */
5993 cur_store_num = which;
5995 /* Activate that store */
5996 st_ptr = &town_info[p_ptr->town_num].store[cur_store_num];
5999 /* Pick a new owner */
6002 st_ptr->owner = (byte)randint0(MAX_OWNERS);
6003 if (j == st_ptr->owner) continue;
6004 for (i = 1;i < max_towns; i++)
6006 if (i == p_ptr->town_num) continue;
6007 if (st_ptr->owner == town_info[i].store[cur_store_num].owner) break;
6009 if (i == max_towns) break;
6012 /* Activate the new owner */
6013 ot_ptr = &owners[cur_store_num][st_ptr->owner];
6016 /* Reset the owner data */
6017 st_ptr->insult_cur = 0;
6018 st_ptr->store_open = 0;
6019 st_ptr->good_buy = 0;
6020 st_ptr->bad_buy = 0;
6023 /* Hack -- discount all the items */
6024 for (i = 0; i < st_ptr->stock_num; i++)
6028 o_ptr = &st_ptr->stock[i];
6030 if (!object_is_artifact(o_ptr))
6032 /* Hack -- Sell all non-artifact old items for "half price" */
6033 o_ptr->discount = 50;
6035 /* Hack -- Items are no longer "fixed price" */
6036 o_ptr->ident &= ~(IDENT_FIXED);
6038 /* Mega-Hack -- Note that the item is "on sale" */
6039 o_ptr->inscription = quark_add(_("売出中", "on sale"));
6046 * @brief 店の品揃えを変化させる /
6047 * Maintain the p_ptr->inventory_list at the stores.
6048 * @param town_num 町のID
6049 * @param store_num 店舗種類のID
6052 void store_maint(int town_num, int store_num)
6056 cur_store_num = store_num;
6059 if (store_num == STORE_HOME) return;
6060 if (store_num == STORE_MUSEUM) return;
6062 /* Activate that store */
6063 st_ptr = &town_info[town_num].store[store_num];
6065 /* Activate the owner */
6066 ot_ptr = &owners[store_num][st_ptr->owner];
6068 /* Store keeper forgives the player */
6069 st_ptr->insult_cur = 0;
6071 /* Mega-Hack -- prune the black market */
6072 if (store_num == STORE_BLACK)
6074 /* Destroy crappy black market items */
6075 for (j = st_ptr->stock_num - 1; j >= 0; j--)
6077 object_type *o_ptr = &st_ptr->stock[j];
6079 /* Destroy crappy items */
6080 if (black_market_crap(o_ptr))
6082 /* Destroy the item */
6083 store_item_increase(j, 0 - o_ptr->number);
6084 store_item_optimize(j);
6090 /* Choose the number of slots to keep */
6091 j = st_ptr->stock_num;
6093 /* Sell a few items */
6094 j = j - randint1(STORE_TURNOVER);
6096 /* Never keep more than "STORE_MAX_KEEP" slots */
6097 if (j > STORE_MAX_KEEP) j = STORE_MAX_KEEP;
6099 /* Always "keep" at least "STORE_MIN_KEEP" items */
6100 if (j < STORE_MIN_KEEP) j = STORE_MIN_KEEP;
6102 /* Hack -- prevent "underflow" */
6105 /* Destroy objects until only "j" slots are left */
6106 while (st_ptr->stock_num > j) store_delete();
6109 /* Choose the number of slots to fill */
6110 j = st_ptr->stock_num;
6112 /* Buy some more items */
6113 j = j + randint1(STORE_TURNOVER);
6115 /* Never keep more than "STORE_MAX_KEEP" slots */
6116 if (j > STORE_MAX_KEEP) j = STORE_MAX_KEEP;
6118 /* Always "keep" at least "STORE_MIN_KEEP" items */
6119 if (j < STORE_MIN_KEEP) j = STORE_MIN_KEEP;
6121 /* Hack -- prevent "overflow" */
6122 if (j >= st_ptr->stock_size) j = st_ptr->stock_size - 1;
6124 /* Acquire some new items */
6125 while (st_ptr->stock_num < j) store_create();
6130 * @brief 店舗情報を初期化する /
6131 * Initialize the stores
6132 * @param town_num 町のID
6133 * @param store_num 店舗種類のID
6136 void store_init(int town_num, int store_num)
6139 cur_store_num = store_num;
6141 /* Activate that store */
6142 st_ptr = &town_info[town_num].store[store_num];
6150 st_ptr->owner = (byte)randint0(MAX_OWNERS);
6151 for (i = 1;i < max_towns; i++)
6153 if (i == town_num) continue;
6154 if (st_ptr->owner == town_info[i].store[store_num].owner) break;
6156 if (i == max_towns) break;
6159 /* Activate the new owner */
6160 ot_ptr = &owners[store_num][st_ptr->owner];
6163 /* Initialize the store */
6164 st_ptr->store_open = 0;
6165 st_ptr->insult_cur = 0;
6166 st_ptr->good_buy = 0;
6167 st_ptr->bad_buy = 0;
6169 /* Nothing in stock */
6170 st_ptr->stock_num = 0;
6173 * MEGA-HACK - Last visit to store is
6174 * BEFORE player birth to enable store restocking
6176 st_ptr->last_visit = -10L * TURNS_PER_TICK * STORE_TICKS;
6178 /* Clear any old items */
6179 for (k = 0; k < st_ptr->stock_size; k++)
6181 object_wipe(&st_ptr->stock[k]);
6187 * @brief アイテムを町のブラックマーケットに移動させる /
6188 * @param o_ptr 移動させたいオブジェクトの構造体参照ポインタ
6191 void move_to_black_market(object_type *o_ptr)
6194 if (!p_ptr->town_num) return;
6196 st_ptr = &town_info[p_ptr->town_num].store[STORE_BLACK];
6198 o_ptr->ident |= IDENT_STORE;
6200 (void)store_carry(o_ptr);
6202 object_wipe(o_ptr); /* Don't leave a bogus object behind... */