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.
16 #include "cmd-smith.h"
17 #include "cmd-zapwand.h"
18 #include "cmd-magiceat.h"
21 #include "cmd-spell.h"
23 #include "player-status.h"
24 #include "object-flavor.h"
25 #include "object-hook.h"
26 #include "floor-events.h"
29 #include "player-effects.h"
34 * @brief 闘技場のモンスターID及び報酬アイテムテーブル /
35 * Store owners (exactly four "possible" owners per store, chosen randomly)
38 * { name, purse, max greed, min greed, haggle_per, tolerance, race, unused }
40 * Lifted extra shopkeepers from CthAngband (don't you just love open source
41 * development? ;-)). Since this gave less than 32 unique names for some
42 * shops, those have their first x names copied to reach 32.
44 * For the weapon and armour shops, several owners have a limit of 5k.
46 * I want to do 50k owners, but the purse is currently s16b. Perhaps
47 * we should just store 1/10th of the purse?
50 const owner_type owners[MAX_STORES][MAX_OWNERS] =
53 /* General store - 32 unique names */
55 Raistlin は dragonlance の powerful wizard 。
56 Rincewind the Chicken は Terry Pratchett の Discworld の登場人物 上記のパロディ?、
57 { "憶病者ラストリン", 200, 175, 108, 4, 12, RACE_HUMAN},
58 { "Raistlin the Chicken", 200, 175, 108, 4, 12, RACE_HUMAN},
62 { "フレンドリーなビルボ", 200, 170, 108, 5, 15, RACE_HOBBIT},
63 { "憶病者リンスウィンド", 200, 175, 108, 4, 12, RACE_HUMAN},
64 { "背の低いサルタン", 300, 170, 107, 5, 15, RACE_GNOME},
65 { "ハンサムなライア=エル", 300, 165, 107, 6, 18, RACE_ELF},
66 { "親切なファリルマウエン", 250, 170, 108, 5, 15, RACE_HOBBIT},
67 { "臆病者ヴォワラン", 500, 175, 108, 4, 12, RACE_HUMAN},
68 { "チビのエラシュナク", 750, 170, 107, 5, 15, RACE_BEASTMAN},
69 { "ハンサムなグラッグ", 1000, 165, 107, 6, 18, RACE_HALF_TITAN},
70 { "ケチなフォロビア", 250, 170, 108, 5, 15, RACE_HUMAN},
71 { "馬鹿のエリス", 500, 175, 108, 4, 12, RACE_HUMAN},
72 { "腹ペコのフィルバート", 750, 170, 107, 5, 15, RACE_VAMPIRE},
73 { "スナーグル・サシグア", 1000, 165, 107, 6, 18, RACE_MIND_FLAYER},
74 { "長死きエロワーズ", 250, 170, 108, 5, 15, RACE_SPECTRE},
75 { "ノロマのフンディ", 500, 175, 108, 4, 12, RACE_ZOMBIE},
76 { "グランサス", 750, 170, 107, 5, 15, RACE_SKELETON},
77 { "丁寧なロラックス", 1000, 165, 107, 6, 18, RACE_VAMPIRE},
78 { "ブッチ", 250, 170, 108, 5, 15, RACE_HALF_ORC},
79 { "美しきエルベレス", 500, 175, 108, 4, 12, RACE_HIGH_ELF},
80 { "こそこそサーレス", 750, 170, 107, 5, 15, RACE_GNOME},
81 { "ナーロック", 1000, 165, 107, 6, 18, RACE_DWARF},
82 { "チビのヘイネッカ", 250, 170, 108, 5, 15, RACE_GNOME},
83 { "きちがいロワラン", 500, 175, 108, 4, 12, RACE_HALF_GIANT},
84 { "毒息のウート", 750, 170, 107, 5, 15, RACE_DRACONIAN},
85 { "でぶっちょアラァカ", 1000, 165, 107, 6, 18, RACE_DRACONIAN},
86 { "低能なプーゴー", 250, 170, 108, 5, 15, RACE_BEASTMAN},
87 { "フェロールフィリアン", 500, 175, 108, 4, 12, RACE_ELF},
88 { "年寄りマロカ", 750, 170, 107, 5, 15, RACE_GNOME},
89 { "勇敢なサシン", 1000, 165, 107, 6, 18, RACE_HALF_GIANT},
90 { "田舎者アビエマール", 250, 170, 108, 5, 15, RACE_HUMAN},
91 { "貧乏なハーク", 500, 175, 108, 4, 12, RACE_HALF_ORC},
92 { "みじめなソアリン", 750, 170, 107, 5, 15, RACE_ZOMBIE},
93 { "質素なメルラ", 1000, 165, 107, 6, 18, RACE_ELF},
95 { "Bilbo the Friendly", 200, 170, 108, 5, 15, RACE_HOBBIT},
96 { "Rincewind the Chicken", 200, 175, 108, 4, 12, RACE_HUMAN},
97 { "Sultan the Midget", 300, 170, 107, 5, 15, RACE_GNOME},
98 { "Lyar-el the Comely", 300, 165, 107, 6, 18, RACE_ELF},
99 { "Falilmawen the Friendly", 250, 170, 108, 5, 15, RACE_HOBBIT},
100 { "Voirin the Cowardly", 500, 175, 108, 4, 12, RACE_HUMAN},
101 { "Erashnak the Midget", 750, 170, 107, 5, 15, RACE_BEASTMAN},
102 { "Grug the Comely", 1000, 165, 107, 6, 18, RACE_HALF_TITAN},
103 { "Forovir the Cheap", 250, 170, 108, 5, 15, RACE_HUMAN},
104 { "Ellis the Fool", 500, 175, 108, 4, 12, RACE_HUMAN},
105 { "Filbert the Hungry", 750, 170, 107, 5, 15, RACE_VAMPIRE},
106 { "Fthnargl Psathiggua", 1000, 165, 107, 6, 18, RACE_MIND_FLAYER},
107 { "Eloise Long-Dead", 250, 170, 108, 5, 15, RACE_SPECTRE},
108 { "Fundi the Slow", 500, 175, 108, 4, 12, RACE_ZOMBIE},
109 { "Granthus", 750, 170, 107, 5, 15, RACE_SKELETON},
110 { "Lorax the Suave", 1000, 165, 107, 6, 18, RACE_VAMPIRE},
111 { "Butch", 250, 170, 108, 5, 15, RACE_HALF_ORC},
112 { "Elbereth the Beautiful", 500, 175, 108, 4, 12, RACE_HIGH_ELF},
113 { "Sarleth the Sneaky", 750, 170, 107, 5, 15, RACE_GNOME},
114 { "Narlock", 1000, 165, 107, 6, 18, RACE_DWARF},
115 { "Haneka the Small", 250, 170, 108, 5, 15, RACE_GNOME},
116 { "Loirin the Mad", 500, 175, 108, 4, 12, RACE_HALF_GIANT},
117 { "Wuto Poisonbreath", 750, 170, 107, 5, 15, RACE_DRACONIAN},
118 { "Araaka the Rotund", 1000, 165, 107, 6, 18, RACE_DRACONIAN},
119 { "Poogor the Dumb", 250, 170, 108, 5, 15, RACE_BEASTMAN},
120 { "Felorfiliand", 500, 175, 108, 4, 12, RACE_ELF},
121 { "Maroka the Aged", 750, 170, 107, 5, 15, RACE_GNOME},
122 { "Sasin the Bold", 1000, 165, 107, 6, 18, RACE_HALF_GIANT},
123 { "Abiemar the Peasant", 250, 170, 108, 5, 15, RACE_HUMAN},
124 { "Hurk the Poor", 500, 175, 108, 4, 12, RACE_HALF_ORC},
125 { "Soalin the Wretched", 750, 170, 107, 5, 15, RACE_ZOMBIE},
126 { "Merulla the Humble", 1000, 165, 107, 6, 18, RACE_ELF},
130 /* Armoury - 28 unique names */
132 { "醜悪コン=ダー", 5000, 210, 115, 5, 7, RACE_HALF_ORC},
133 { "頑固者ダーグ=ロウ", 10000, 190, 111, 4, 9, RACE_HUMAN},
134 { "賢者デカド", 25000, 200, 112, 4, 10, RACE_DUNADAN},
135 { "鍛冶屋のウィーランド", 30000, 200, 112, 4, 5, RACE_DWARF},
136 { "醜悪コン=ダー", 10000, 210, 115, 5, 7, RACE_HALF_ORC},
137 { "頑固者ダーグ=ロウ", 15000, 190, 111, 4, 9, RACE_HUMAN},
138 { "ハンサムなデカド", 25000, 200, 112, 4, 10, RACE_AMBERITE},
139 { "エロー・ドラゴンスケイル", 30000, 200, 112, 4, 5, RACE_ELF},
140 { "デリカトス", 10000, 210, 115, 5, 7, RACE_SPRITE},
141 { "巨大なグルース", 15000, 190, 111, 4, 9, RACE_HALF_GIANT},
142 { "アニムス", 25000, 200, 112, 4, 10, RACE_GOLEM},
143 { "マルヴァス", 30000, 200, 112, 4, 5, RACE_HALF_TITAN},
144 { "セラクシス", 10000, 210, 115, 5, 7, RACE_ZOMBIE},
145 { "デス・チル", 5000, 190, 111, 4, 9, RACE_SPECTRE},
146 { "微かなドリオス", 25000, 200, 112, 4, 10, RACE_SPECTRE},
147 { "冷たいバスリック", 30000, 200, 112, 4, 5, RACE_VAMPIRE},
148 { "冷酷ヴェンジェラ", 10000, 210, 115, 5, 7, RACE_HALF_TROLL},
149 { "強者ウィラナ", 15000, 190, 111, 4, 9, RACE_HUMAN},
150 { "ヨジョ二世", 25000, 200, 112, 4, 10, RACE_DWARF},
151 { "優しいラナラー", 30000, 200, 112, 4, 5, RACE_AMBERITE},
152 { "不浄のホルバグ", 5000, 210, 115, 5, 7, RACE_HALF_ORC},
153 { "テレパスのエレレン", 15000, 190, 111, 4, 9, RACE_DARK_ELF},
154 { "イスドリリアス", 25000, 200, 112, 4, 10, RACE_SPRITE},
155 { "一つ目ヴェグナー", 5000, 200, 112, 4, 5, RACE_CYCLOPS},
156 { "混沌のロディッシュ", 10000, 210, 115, 5, 7, RACE_BEASTMAN},
157 { "剣豪ヘジン", 15000, 190, 111, 4, 9, RACE_NIBELUNG},
158 { "ずる屋のエルベレリス", 10000, 200, 112, 4, 10, RACE_DARK_ELF},
159 { "インプのザサス", 30000, 200, 112, 4, 5, RACE_IMP},
160 { "醜悪コン=ダー", 5000, 210, 115, 5, 7, RACE_HALF_ORC},
161 { "頑固者ダーグ=ロウ", 10000, 190, 111, 4, 9, RACE_HUMAN},
162 { "ハンサムなデカド", 25000, 200, 112, 4, 10, RACE_AMBERITE},
163 { "鍛冶屋のウィーランド", 30000, 200, 112, 4, 5, RACE_DWARF},
165 { "Kon-Dar the Ugly", 5000, 210, 115, 5, 7, RACE_HALF_ORC},
166 { "Darg-Low the Grim", 10000, 190, 111, 4, 9, RACE_HUMAN},
167 { "Decado the Handsome", 25000, 200, 112, 4, 10, RACE_DUNADAN},
168 { "Wieland the Smith", 30000, 200, 112, 4, 5, RACE_DWARF},
169 { "Kon-Dar the Ugly", 10000, 210, 115, 5, 7, RACE_HALF_ORC},
170 { "Darg-Low the Grim", 15000, 190, 111, 4, 9, RACE_HUMAN},
171 { "Decado the Handsome", 25000, 200, 112, 4, 10, RACE_AMBERITE},
172 { "Elo Dragonscale", 30000, 200, 112, 4, 5, RACE_ELF},
173 { "Delicatus", 10000, 210, 115, 5, 7, RACE_SPRITE},
174 { "Gruce the Huge", 15000, 190, 111, 4, 9, RACE_HALF_GIANT},
175 { "Animus", 25000, 200, 112, 4, 10, RACE_GOLEM},
176 { "Malvus", 30000, 200, 112, 4, 5, RACE_HALF_TITAN},
177 { "Selaxis", 10000, 210, 115, 5, 7, RACE_ZOMBIE},
178 { "Deathchill", 5000, 190, 111, 4, 9, RACE_SPECTRE},
179 { "Drios the Faint", 25000, 200, 112, 4, 10, RACE_SPECTRE},
180 { "Bathric the Cold", 30000, 200, 112, 4, 5, RACE_VAMPIRE},
181 { "Vengella the Cruel", 10000, 210, 115, 5, 7, RACE_HALF_TROLL},
182 { "Wyrana the Mighty", 15000, 190, 111, 4, 9, RACE_HUMAN},
183 { "Yojo II", 25000, 200, 112, 4, 10, RACE_DWARF},
184 { "Ranalar the Sweet", 30000, 200, 112, 4, 5, RACE_AMBERITE},
185 { "Horbag the Unclean", 5000, 210, 115, 5, 7, RACE_HALF_ORC},
186 { "Elelen the Telepath", 15000, 190, 111, 4, 9, RACE_DARK_ELF},
187 { "Isedrelias", 25000, 200, 112, 4, 10, RACE_SPRITE},
188 { "Vegnar One-eye", 5000, 200, 112, 4, 5, RACE_CYCLOPS},
189 { "Rodish the Chaotic", 10000, 210, 115, 5, 7, RACE_BEASTMAN},
190 { "Hesin Swordmaster", 15000, 190, 111, 4, 9, RACE_NIBELUNG},
191 { "Elvererith the Cheat", 10000, 200, 112, 4, 10, RACE_DARK_ELF},
192 { "Zzathath the Imp", 30000, 200, 112, 4, 5, RACE_IMP},
193 { "Kon-Dar the Ugly", 5000, 210, 115, 5, 7, RACE_HALF_ORC},
194 { "Darg-Low the Grim", 10000, 190, 111, 4, 9, RACE_HUMAN},
195 { "Decado the Handsome", 25000, 200, 112, 4, 10, RACE_AMBERITE},
196 { "Wieland the Smith", 30000, 200, 112, 4, 5, RACE_DWARF},
201 /* Weapon Smith - 28 unique names */
203 { "残忍なるアーノルド", 5000, 210, 115, 6, 6, RACE_HALF_TROLL},
204 { "獣殺しのアーンダル", 10000, 185, 110, 5, 9, RACE_HALF_ELF},
205 { "獣マスターのエディー", 25000, 190, 115, 5, 7, RACE_HOBBIT},
206 { "竜殺しのオグライン", 30000, 195, 112, 4, 8, RACE_DWARF},
207 { "熟練者ドリュー", 10000, 210, 115, 6, 6, RACE_HUMAN},
208 { "龍の子オラックス", 15000, 185, 110, 5, 9, RACE_DRACONIAN},
209 { "病気持ちのアンスラックス", 25000, 190, 115, 5, 7, RACE_BEASTMAN},
210 { "頑丈者アルコス", 30000, 195, 112, 4, 8, RACE_DWARF},
211 { "腐れ者のサリアス", 5000, 210, 115, 6, 6, RACE_ZOMBIE},
212 { "晒し骨のトゥエシク", 15000, 185, 110, 5, 9, RACE_SKELETON},
213 { "ビリオス", 25000, 190, 115, 5, 7, RACE_BEASTMAN},
214 { "ファスガル", 30000, 195, 112, 4, 8, RACE_ZOMBIE},
215 { "パラディンのエレフリス", 10000, 210, 115, 6, 6, RACE_BARBARIAN},
216 { "キ'トリッ'ク", 15000, 185, 110, 5, 9, RACE_KLACKON},
217 { "蜘蛛の友ドゥロカス", 25000, 190, 115, 5, 7, RACE_DARK_ELF},
218 { "巨人殺しのフングス", 30000, 195, 112, 4, 8, RACE_DWARF},
219 { "デランサ", 10000, 210, 115, 6, 6, RACE_ELF},
220 { "レンジャーのソルビスタニ", 15000, 185, 110, 5, 9, RACE_HALF_ELF},
221 { "ノロマのゾリル", 25000, 190, 115, 5, 7, RACE_GOLEM},
222 { "イーオン・フラックス", 20000, 195, 112, 4, 8, RACE_HALF_ELF},
223 { "強者ナドック", 10000, 210, 115, 6, 6, RACE_HOBBIT},
224 { "弱虫エラモグ", 15000, 185, 110, 5, 9, RACE_KOBOLD},
225 { "公正なエオウィリス", 25000, 190, 115, 5, 7, RACE_VAMPIRE},
226 { "バルログ殺しのヒュイモグ", 30000, 195, 112, 4, 8, RACE_HALF_ORC},
227 { "冷酷ピーダス", 5000, 210, 115, 6, 6, RACE_HUMAN},
228 { "ヴァモグ スレイヤー", 15000, 185, 110, 5, 9, RACE_HALF_OGRE},
229 { "性悪フーシュナク", 25000, 190, 115, 5, 7, RACE_BEASTMAN},
230 { "舞闘バレン", 30000, 195, 112, 4, 8, RACE_BARBARIAN},
231 { "残忍なるアーノルド", 5000, 210, 115, 6, 6, RACE_BARBARIAN},
232 { "獣殺しのアーンダル", 10000, 185, 110, 5, 9, RACE_HALF_ELF},
233 { "ビーストマスター・エディー", 25000, 190, 115, 5, 7, RACE_HALF_ORC},
234 { "竜殺しのオグライン", 30000, 195, 112, 4, 8, RACE_DWARF},
236 { "Arnold the Beastly", 5000, 210, 115, 6, 6, RACE_BARBARIAN},
237 { "Arndal Beast-Slayer", 10000, 185, 110, 5, 9, RACE_HALF_ELF},
238 { "Eddie Beast-Master", 25000, 190, 115, 5, 7, RACE_HALF_ORC},
239 { "Oglign Dragon-Slayer", 30000, 195, 112, 4, 8, RACE_DWARF},
240 { "Drew the Skilled", 10000, 210, 115, 6, 6, RACE_HUMAN},
241 { "Orrax Dragonson", 15000, 185, 110, 5, 9, RACE_DRACONIAN},
242 { "Anthrax Disease-Carrier", 25000, 190, 115, 5, 7, RACE_BEASTMAN},
243 { "Arkhoth the Stout", 30000, 195, 112, 4, 8, RACE_DWARF},
244 { "Sarlyas the Rotten", 5000, 210, 115, 6, 6, RACE_ZOMBIE},
245 { "Tuethic Bare-Bones", 15000, 185, 110, 5, 9, RACE_SKELETON},
246 { "Bilious", 25000, 190, 115, 5, 7, RACE_BEASTMAN},
247 { "Fasgul", 30000, 195, 112, 4, 8, RACE_ZOMBIE},
248 { "Ellefris the Paladin", 10000, 210, 115, 6, 6, RACE_BARBARIAN},
249 { "K'trrik'k", 15000, 185, 110, 5, 9, RACE_KLACKON},
250 { "Drocus Spiderfriend", 25000, 190, 115, 5, 7, RACE_DARK_ELF},
251 { "Fungus Giant-Slayer", 30000, 195, 112, 4, 8, RACE_DWARF},
252 { "Delantha", 10000, 210, 115, 6, 6, RACE_ELF},
253 { "Solvistani the Ranger", 15000, 185, 110, 5, 9, RACE_HALF_ELF},
254 { "Xoril the Slow", 25000, 190, 115, 5, 7, RACE_GOLEM},
255 { "Aeon Flux", 20000, 195, 112, 4, 8, RACE_HALF_ELF},
256 { "Nadoc the Strong", 10000, 210, 115, 6, 6, RACE_HOBBIT},
257 { "Eramog the Weak", 15000, 185, 110, 5, 9, RACE_KOBOLD},
258 { "Eowilith the Fair", 25000, 190, 115, 5, 7, RACE_VAMPIRE},
259 { "Huimog Balrog-Slayer", 30000, 195, 112, 4, 8, RACE_HALF_ORC},
260 { "Peadus the Cruel", 5000, 210, 115, 6, 6, RACE_HUMAN},
261 { "Vamog Slayer", 15000, 185, 110, 5, 9, RACE_HALF_OGRE},
262 { "Hooshnak the Vicious", 25000, 190, 115, 5, 7, RACE_BEASTMAN},
263 { "Balenn War-Dancer", 30000, 195, 112, 4, 8, RACE_BARBARIAN},
264 { "Arnold the Beastly", 5000, 210, 115, 6, 6, RACE_BARBARIAN},
265 { "Arndal Beast-Slayer", 10000, 185, 110, 5, 9, RACE_HALF_ELF},
266 { "Eddie Beast-Master", 25000, 190, 115, 5, 7, RACE_HALF_ORC},
267 { "Oglign Dragon-Slayer", 30000, 195, 112, 4, 8, RACE_DWARF},
271 /* Temple - 22 unique names */
273 { "質素なルードヴィヒ", 5000, 175, 109, 6, 15, RACE_HUMAN},
274 { "パラディンのガンナー", 10000, 185, 110, 5, 23, RACE_HUMAN},
275 { "選ばれしトリン", 25000, 180, 107, 6, 20, RACE_ELF},
276 { "賢明なるサラストロ", 30000, 185, 109, 5, 15, RACE_DWARF},
277 { "パーシヴァル卿", 25000, 180, 107, 6, 20, RACE_HIGH_ELF},
278 { "神聖なるアセナス", 30000, 185, 109, 5, 15, RACE_HUMAN},
279 { "マッキノン", 10000, 175, 109, 6, 15, RACE_HUMAN},
280 { "謹み婦人", 15000, 185, 110, 5, 23, RACE_HIGH_ELF},
281 { "ドルイドのハシュニック", 25000, 180, 107, 6, 20, RACE_HOBBIT},
282 { "フィナク", 30000, 185, 109, 5, 15, RACE_YEEK},
283 { "クリキック", 10000, 175, 109, 6, 15, RACE_KLACKON},
284 { "荒くれ者モリヴァル", 15000, 185, 110, 5, 23, RACE_ELF},
285 { "暗きホシャック", 25000, 180, 107, 6, 20, RACE_IMP},
286 { "賢者アタール", 30000, 185, 109, 5, 15, RACE_HUMAN},
287 { "清きイベニッド", 10000, 175, 109, 6, 15, RACE_HUMAN},
288 { "エリディシュ", 15000, 185, 110, 5, 23, RACE_HALF_TROLL},
289 { "呪術師ヴルドゥシュ", 25000, 180, 107, 6, 20, RACE_HALF_OGRE},
290 { "狂戦士ハオブ", 30000, 185, 109, 5, 15, RACE_BARBARIAN},
291 { "若きプルーグディシュ", 10000, 175, 109, 6, 15, RACE_HALF_OGRE},
292 { "きちがいラムワイズ", 15000, 185, 110, 5, 23, RACE_YEEK},
293 { "有徳者ムワート", 25000, 180, 107, 6, 20, RACE_KOBOLD},
294 { "弱虫ダードバード", 30000, 185, 109, 5, 15, RACE_SPECTRE},
295 { "質素なルードヴィヒ", 5000, 175, 109, 6, 15, RACE_HUMAN},
296 { "パラディンのガンナー", 10000, 185, 110, 5, 23, RACE_HUMAN},
297 { "選ばれしトリン", 25000, 180, 107, 6, 20, RACE_ELF},
298 { "賢明なるサラストロ", 30000, 185, 109, 5, 15, RACE_DWARF},
299 { "パーシヴァル卿", 25000, 180, 107, 6, 20, RACE_HIGH_ELF},
300 { "神聖なるアセナス", 30000, 185, 109, 5, 15, RACE_HUMAN},
301 { "マッキノン", 10000, 175, 109, 6, 15, RACE_HUMAN},
302 { "謹み婦人", 15000, 185, 110, 5, 23, RACE_HIGH_ELF},
303 { "ドルイドのハシュニック", 25000, 180, 107, 6, 20, RACE_HOBBIT},
304 { "フィナク", 30000, 185, 109, 5, 15, RACE_YEEK},
306 { "Ludwig the Humble", 5000, 175, 109, 6, 15, RACE_DWARF},
307 { "Gunnar the Paladin", 10000, 185, 110, 5, 23, RACE_HALF_TROLL},
308 { "Torin the Chosen", 25000, 180, 107, 6, 20, RACE_HIGH_ELF},
309 { "Sarastro the Wise", 30000, 185, 109, 5, 15, RACE_HUMAN},
310 { "Sir Parsival the Pure", 25000, 180, 107, 6, 20, RACE_HIGH_ELF},
311 { "Asenath the Holy", 30000, 185, 109, 5, 15, RACE_HUMAN},
312 { "McKinnon", 10000, 175, 109, 6, 15, RACE_HUMAN},
313 { "Mistress Chastity", 15000, 185, 110, 5, 23, RACE_HIGH_ELF},
314 { "Hashnik the Druid", 25000, 180, 107, 6, 20, RACE_HOBBIT},
315 { "Finak", 30000, 185, 109, 5, 15, RACE_YEEK},
316 { "Krikkik", 10000, 175, 109, 6, 15, RACE_KLACKON},
317 { "Morival the Wild", 15000, 185, 110, 5, 23, RACE_ELF},
318 { "Hoshak the Dark", 25000, 180, 107, 6, 20, RACE_IMP},
319 { "Atal the Wise", 30000, 185, 109, 5, 15, RACE_HUMAN},
320 { "Ibenidd the Chaste", 10000, 175, 109, 6, 15, RACE_HUMAN},
321 { "Eridish", 15000, 185, 110, 5, 23, RACE_HALF_TROLL},
322 { "Vrudush the Shaman", 25000, 180, 107, 6, 20, RACE_HALF_OGRE},
323 { "Haob the Berserker", 30000, 185, 109, 5, 15, RACE_BARBARIAN},
324 { "Proogdish the Youthfull", 10000, 175, 109, 6, 15, RACE_HALF_OGRE},
325 { "Lumwise the Mad", 15000, 185, 110, 5, 23, RACE_YEEK},
326 { "Muirt the Virtuous", 25000, 180, 107, 6, 20, RACE_KOBOLD},
327 { "Dardobard the Weak", 30000, 185, 109, 5, 15, RACE_SPECTRE},
328 { "Ludwig the Humble", 5000, 175, 109, 6, 15, RACE_DWARF},
329 { "Gunnar the Paladin", 10000, 185, 110, 5, 23, RACE_HALF_TROLL},
330 { "Torin the Chosen", 25000, 180, 107, 6, 20, RACE_HIGH_ELF},
331 { "Sarastro the Wise", 30000, 185, 109, 5, 15, RACE_HUMAN},
332 { "Sir Parsival the Pure", 25000, 180, 107, 6, 20, RACE_HIGH_ELF},
333 { "Asenath the Holy", 30000, 185, 109, 5, 15, RACE_HUMAN},
334 { "McKinnon", 10000, 175, 109, 6, 15, RACE_HUMAN},
335 { "Mistress Chastity", 15000, 185, 110, 5, 23, RACE_HIGH_ELF},
336 { "Hashnik the Druid", 25000, 180, 107, 6, 20, RACE_HOBBIT},
337 { "Finak", 30000, 185, 109, 5, 15, RACE_YEEK},
341 /* Alchemist - 26 unique names */
343 { "化学者マウザー", 10000, 190, 111, 5, 8, RACE_HALF_ELF},
344 { "カオスのウィズル", 10000, 190, 110, 6, 8, RACE_HOBBIT},
345 { "強欲ミダス", 15000, 200, 116, 6, 9, RACE_GNOME},
346 { "貧弱ジャ=ファー", 15000, 220, 111, 4, 9, RACE_ELF},/*FIRST*/
347 { "カカルラカカル", 15000, 200, 116, 6, 9, RACE_KLACKON},
348 { "錬金術師ジャル=エス", 15000, 220, 111, 4, 9, RACE_ELF},
349 { "用心深いファネラス", 10000, 190, 111, 5, 8, RACE_DWARF},
350 { "キチガイのルンシー", 10000, 190, 110, 6, 8, RACE_HUMAN},
351 { "グランブルワース", 15000, 200, 116, 6, 9, RACE_GNOME},
352 { "フリッター", 15000, 220, 111, 4, 9, RACE_SPRITE},
353 { "ザリルス", 10000, 190, 111, 5, 8, RACE_HUMAN},
354 { "古きエグバート", 10000, 190, 110, 6, 8, RACE_DWARF},
355 { "誇り高きヴァリンドラ", 15000, 200, 116, 6, 9, RACE_HIGH_ELF},
356 { "錬金術師タエン", 15000, 220, 111, 4, 9, RACE_HUMAN},
357 { "巧言カイド", 10000, 190, 111, 5, 8, RACE_VAMPIRE},
358 { "暗きフリア", 10000, 190, 110, 6, 8, RACE_NIBELUNG},
359 { "質素なドムリ", 15000, 200, 116, 6, 9, RACE_DWARF},
360 { "魔の子ヤァジュッカ", 15000, 220, 111, 4, 9, RACE_IMP},
361 { "薬草師ジェララルドール", 10000, 190, 111, 5, 8, RACE_HIGH_ELF},
362 { "賢者オレラルダン", 10000, 190, 110, 6, 8, RACE_BARBARIAN},
363 { "デモニシストのフゾグロ", 15000, 200, 116, 6, 9, RACE_IMP},
364 { "錬金術師ドゥリアシュ", 15000, 220, 111, 4, 9, RACE_HALF_ORC},
365 { "強者ネリア", 10000, 190, 111, 5, 8, RACE_CYCLOPS},
366 { "辛口リグナス", 10000, 190, 110, 6, 8, RACE_HALF_ORC},
367 { "ティルバ", 15000, 200, 116, 6, 9, RACE_HOBBIT},
368 { "金持ちミリルドリック", 15000, 220, 111, 4, 9, RACE_HUMAN},
370 { "科学者マウザー", 10000, 190, 111, 5, 8, RACE_HALF_ELF},
371 { "カオスのウィズル", 10000, 190, 110, 6, 8, RACE_HOBBIT},
372 { "強欲ミダス", 15000, 200, 116, 6, 9, RACE_GNOME},
373 { "錬金術師ジャ=ファー", 15000, 220, 111, 4, 9, RACE_ELF},
374 { "カカルラカカル", 15000, 200, 116, 6, 9, RACE_KLACKON},
375 { "錬金術師ジャル=エス", 15000, 220, 111, 4, 9, RACE_ELF},
377 { "Mauser the Chemist", 10000, 190, 111, 5, 8, RACE_HALF_ELF},
378 { "Wizzle the Chaotic", 10000, 190, 110, 6, 8, RACE_HOBBIT},
379 { "Midas the Greedy", 15000, 200, 116, 6, 9, RACE_GNOME},
380 { "Ja-Far the Alchemist", 15000, 220, 111, 4, 9, RACE_ELF},
381 { "Kakalrakakal", 15000, 200, 116, 6, 9, RACE_KLACKON},
382 { "Jal-Eth the Alchemist", 15000, 220, 111, 4, 9, RACE_ELF},
383 { "Fanelath the Cautious", 10000, 190, 111, 5, 8, RACE_DWARF},
384 { "Runcie the Insane", 10000, 190, 110, 6, 8, RACE_HUMAN},
385 { "Grumbleworth", 15000, 200, 116, 6, 9, RACE_GNOME},
386 { "Flitter", 15000, 220, 111, 4, 9, RACE_SPRITE},
387 { "Xarillus", 10000, 190, 111, 5, 8, RACE_HUMAN},
388 { "Egbert the Old", 10000, 190, 110, 6, 8, RACE_DWARF},
389 { "Valindra the Proud", 15000, 200, 116, 6, 9, RACE_HIGH_ELF},
390 { "Taen the Alchemist", 15000, 220, 111, 4, 9, RACE_HUMAN},
391 { "Cayd the Sweet", 10000, 190, 111, 5, 8, RACE_VAMPIRE},
392 { "Fulir the Dark", 10000, 190, 110, 6, 8, RACE_NIBELUNG},
393 { "Domli the Humble", 15000, 200, 116, 6, 9, RACE_DWARF},
394 { "Yaarjukka Demonspawn", 15000, 220, 111, 4, 9, RACE_IMP},
395 { "Gelaraldor the Herbmaster", 10000, 190, 111, 5, 8, RACE_HIGH_ELF},
396 { "Olelaldan the Wise", 10000, 190, 110, 6, 8, RACE_BARBARIAN},
397 { "Fthoglo the Demonicist", 15000, 200, 116, 6, 9, RACE_IMP},
398 { "Dridash the Alchemist", 15000, 220, 111, 4, 9, RACE_HALF_ORC},
399 { "Nelir the Strong", 10000, 190, 111, 5, 8, RACE_CYCLOPS},
400 { "Lignus the Pungent", 10000, 190, 110, 6, 8, RACE_HALF_ORC},
401 { "Tilba", 15000, 200, 116, 6, 9, RACE_HOBBIT},
402 { "Myrildric the Wealthy", 15000, 220, 111, 4, 9, RACE_HUMAN},
404 { "Mauser the Chemist", 10000, 190, 111, 5, 8, RACE_HALF_ELF},
405 { "Wizzle the Chaotic", 10000, 190, 110, 6, 8, RACE_HOBBIT},
406 { "Midas the Greedy", 15000, 200, 116, 6, 9, RACE_GNOME},
407 { "Ja-Far the Alchemist", 15000, 220, 111, 4, 9, RACE_ELF},
408 { "Kakalrakakal", 15000, 200, 116, 6, 9, RACE_KLACKON},
409 { "Jal-Eth the Alchemist", 15000, 220, 111, 4, 9, RACE_ELF},
414 /* Magic Shop - 23 unique names */
416 { "ソーサラーのロ=パン", 20000, 200, 110, 7, 8, RACE_HALF_ELF},
417 { "偉大なるブガービイ", 20000, 215, 113, 6, 10, RACE_GNOME},
418 { "イェンダーの魔法使い", 30000, 200, 110, 7, 10, RACE_HUMAN},
419 { "死霊使いリャク",30000, 175, 110, 5, 11, RACE_HIGH_ELF},
420 { "魔術師スキドゥニー", 15000, 200, 110, 7, 8, RACE_HALF_ELF},
421 { "幻術師キリア", 30000, 200, 110, 7, 10, RACE_HUMAN},
422 { "死霊術師ニッキ", 30000, 175, 110, 5, 11, RACE_DARK_ELF},
423 { "ソロストラン", 15000, 200, 110, 7, 8, RACE_SPRITE},
424 { "烏賊口アチシェ", 20000, 215, 113, 6, 10, RACE_MIND_FLAYER},
425 { "貴族のカザ", 30000, 200, 110, 7, 10, RACE_HIGH_ELF},
426 { "暗きファジル", 30000, 175, 110, 5, 11, RACE_DARK_ELF},
427 { "偉大なるケルドーン", 15000, 200, 110, 7, 8, RACE_DWARF},
428 { "フィランスロプス", 20000, 215, 113, 6, 10, RACE_HOBBIT},
429 { "魔女のアグナー", 30000, 200, 110, 7, 10, RACE_HUMAN},
430 { "死霊術師ビュリアンス", 30000, 175, 110, 5, 11, RACE_BEASTMAN},
431 { "ハイメイジのヴイラク", 15000, 200, 110, 7, 8, RACE_BEASTMAN},
432 { "知恵者マディッシュ", 20000, 215, 113, 6, 10, RACE_BEASTMAN},
433 { "ファレブリンボール", 30000, 200, 110, 7, 10, RACE_HIGH_ELF},
434 { "陰険フェリル=ガンド", 30000, 175, 110, 5, 11, RACE_DARK_ELF},
435 { "呪術師サレゴード", 15000, 200, 110, 7, 8, RACE_BARBARIAN},
436 { "神秘家クトゥアロス", 20000, 215, 113, 6, 10, RACE_MIND_FLAYER},
437 { "幻術師イベリ", 30000, 200, 110, 7, 10, RACE_SKELETON},
438 { "死霊術師ヘトー", 30000, 175, 110, 5, 11, RACE_YEEK},
439 { "魔術師ロ=パン", 20000, 200, 110, 7, 8, RACE_HALF_ELF},
440 { "偉大なるブガービイ", 20000, 215, 113, 6, 10, RACE_GNOME},
441 { "イェンダーの魔法使い", 30000, 200, 110, 7, 10, RACE_HUMAN},
442 { "死霊術師リャク", 30000, 175, 110, 5, 11, RACE_DARK_ELF},
443 { "魔術師スキドゥニー", 15000, 200, 110, 7, 8, RACE_HALF_ELF},
444 { "幻術師キリア", 30000, 200, 110, 7, 10, RACE_HUMAN},
445 { "死霊術師ニッキ", 30000, 175, 110, 5, 11, RACE_DARK_ELF},
446 { "ソロストラン", 15000, 200, 110, 7, 8, RACE_SPRITE},
447 { "烏賊口アチシェ", 20000, 215, 113, 6, 10, RACE_MIND_FLAYER},
449 { "Lo Pan the Sorcerer", 20000, 200, 110, 7, 8, RACE_HALF_ELF},
450 { "Buggerby the Great", 20000, 215, 113, 6, 10, RACE_GNOME},
451 { "The Wizard of Yendor", 30000, 200, 110, 7, 10, RACE_HUMAN},
452 { "Rjak the Necromancer", 30000, 175, 110, 5, 11, RACE_DARK_ELF},
453 { "Skidney the Sorcerer", 15000, 200, 110, 7, 8, RACE_HALF_ELF},
454 { "Kyria the Illusionist", 30000, 200, 110, 7, 10, RACE_HUMAN},
455 { "Nikki the Necromancer", 30000, 175, 110, 5, 11, RACE_DARK_ELF},
456 { "Solostoran", 15000, 200, 110, 7, 8, RACE_SPRITE},
457 { "Achshe the Tentacled", 20000, 215, 113, 6, 10, RACE_MIND_FLAYER},
458 { "Kaza the Noble", 30000, 200, 110, 7, 10, RACE_HIGH_ELF},
459 { "Fazzil the Dark", 30000, 175, 110, 5, 11, RACE_DARK_ELF},
460 { "Keldorn the Grand", 15000, 200, 110, 7, 8, RACE_DWARF},
461 { "Philanthropus", 20000, 215, 113, 6, 10, RACE_HOBBIT},
462 { "Agnar the Enchantress", 30000, 200, 110, 7, 10, RACE_HUMAN},
463 { "Buliance the Necromancer", 30000, 175, 110, 5, 11, RACE_BEASTMAN},
464 { "Vuirak the High-Mage", 15000, 200, 110, 7, 8, RACE_BEASTMAN},
465 { "Madish the Smart", 20000, 215, 113, 6, 10, RACE_BEASTMAN},
466 { "Falebrimbor", 30000, 200, 110, 7, 10, RACE_HIGH_ELF},
467 { "Felil-Gand the Subtle", 30000, 175, 110, 5, 11, RACE_DARK_ELF},
468 { "Thalegord the Shaman", 15000, 200, 110, 7, 8, RACE_BARBARIAN},
469 { "Cthoaloth the Mystic", 20000, 215, 113, 6, 10, RACE_MIND_FLAYER},
470 { "Ibeli the Illusionist", 30000, 200, 110, 7, 10, RACE_SKELETON},
471 { "Heto the Necromancer", 30000, 175, 110, 5, 11, RACE_YEEK},
472 { "Lo Pan the Sorcerer", 20000, 200, 110, 7, 8, RACE_HALF_ELF},
473 { "Buggerby the Great", 20000, 215, 113, 6, 10, RACE_GNOME},
474 { "The Wizard of Yendor", 30000, 200, 110, 7, 10, RACE_HUMAN},
475 { "Rjak the Necromancer", 30000, 175, 110, 5, 11, RACE_DARK_ELF},
476 { "Skidney the Sorcerer", 15000, 200, 110, 7, 8, RACE_HALF_ELF},
477 { "Kyria the Illusionist", 30000, 200, 110, 7, 10, RACE_HUMAN},
478 { "Nikki the Necromancer", 30000, 175, 110, 5, 11, RACE_DARK_ELF},
479 { "Solostoran", 15000, 200, 110, 7, 8, RACE_SPRITE},
480 { "Achshe the Tentacled", 20000, 215, 113, 6, 10, RACE_MIND_FLAYER},
484 /* Black Market - 32 unique names */
486 { "ガリー=ギガズ", 20000, 250, 150, 10, 5, RACE_HALF_TROLL},
487 { "ゴブリンのヒストーア", 20000, 250, 150, 10, 5, RACE_HALF_ORC},
488 { "フェレンギ人クアーク", 30000, 250, 150, 10, 5, RACE_HUMAN},
489 { "公正なる(?)トッピ", 30000, 250, 150, 10, 5, RACE_ELF},
490 { "死人ヴァッサ", 20000, 250, 150, 10, 5, RACE_ZOMBIE},
491 { "裏切り者カイン", 20000, 250, 150, 10, 5, RACE_VAMPIRE},
492 { "ブボニカス", 30000, 250, 150, 10, 5, RACE_BEASTMAN},
493 { "コープスライト", 30000, 250, 150, 10, 5, RACE_SPECTRE},
494 { "血に飢えしパリッシュ", 20000, 250, 150, 10, 5, RACE_VAMPIRE},
495 { "ヴァイル", 20000, 250, 150, 10, 5, RACE_SKELETON},
496 { "信頼のプレンティス", 30000, 250, 150, 10, 5, RACE_SKELETON},
497 { "人間殺しのグリエラ", 30000, 250, 150, 10, 5, RACE_IMP},
498 { "エンジェル", 20000, 250, 150, 10, 5, RACE_VAMPIRE},
499 { "水膨れフロツァム", 20000, 250, 150, 10, 5, RACE_ZOMBIE},
500 { "ニーヴァル", 30000, 250, 150, 10, 5, RACE_VAMPIRE},
501 { "明るいアナスタシア", 30000, 250, 150, 10, 5, RACE_SPECTRE},
502 { "死霊術師チャリティー", 20000, 250, 150, 10, 5, RACE_DARK_ELF},
503 { "ボクサーのプグナシオス", 20000, 250, 150, 10, 5, RACE_HALF_ORC},
504 { "幸運なフットソア", 30000, 250, 150, 10, 5, RACE_BEASTMAN},
505 { "光指のシドリア", 30000, 250, 150, 10, 5, RACE_HUMAN},
506 { "手品師リアソー", 20000, 250, 150, 10, 5, RACE_HOBBIT},
507 { "やりくり上手のジャナッカ", 20000, 250, 150, 10, 5, RACE_GNOME},
508 { "悪党シーナ", 30000, 250, 150, 10, 5, RACE_GNOME},
509 { "大爪アルニッキ", 30000, 250, 150, 10, 5, RACE_DRACONIAN},
510 { "貧乏チャエアンド", 20000, 250, 150, 10, 5, RACE_HUMAN},
511 { "山賊アファードーフ", 20000, 250, 150, 10, 5, RACE_BARBARIAN},
512 { "強欲ラザクスル", 30000, 250, 150, 10, 5, RACE_MIND_FLAYER},
513 { "ファラレウィン", 30000, 250, 150, 10, 5, RACE_SPRITE},
514 { "しわしわヴォスール", 20000, 250, 150, 10, 5, RACE_NIBELUNG},
515 { "ハンサムなアラオード", 20000, 250, 150, 10, 5, RACE_AMBERITE},
516 { "負け犬セラドフリド", 30000, 250, 150, 10, 5, RACE_HUMAN},
517 { "片足のエルーロ", 30000, 250, 150, 10, 5, RACE_HALF_OGRE},
519 { "Gary Gygaz", 20000, 250, 150, 10, 5, RACE_HALF_TROLL},
520 { "Histor the Goblin", 20000, 250, 150, 10, 5, RACE_HALF_ORC},
521 { "Quark the Ferengi", 30000, 250, 150, 10, 5, RACE_DWARF},
522 { "Topi the Fair(?)", 30000, 250, 150, 10, 5, RACE_HUMAN},
523 { "Vhassa the Dead", 20000, 250, 150, 10, 5, RACE_ZOMBIE},
524 { "Kyn the Treacherous", 20000, 250, 150, 10, 5, RACE_VAMPIRE},
525 { "Bubonicus", 30000, 250, 150, 10, 5, RACE_BEASTMAN},
526 { "Corpselight", 30000, 250, 150, 10, 5, RACE_SPECTRE},
527 { "Parrish the Bloodthirsty", 20000, 250, 150, 10, 5, RACE_VAMPIRE},
528 { "Vile", 20000, 250, 150, 10, 5, RACE_SKELETON},
529 { "Prentice the Trusted", 30000, 250, 150, 10, 5, RACE_SKELETON},
530 { "Griella Humanslayer", 30000, 250, 150, 10, 5, RACE_IMP},
531 { "Angel", 20000, 250, 150, 10, 5, RACE_VAMPIRE},
532 { "Flotsam the Bloated", 20000, 250, 150, 10, 5, RACE_ZOMBIE},
533 { "Nieval", 30000, 250, 150, 10, 5, RACE_VAMPIRE},
534 { "Anastasia the Luminous", 30000, 250, 150, 10, 5, RACE_SPECTRE},
535 { "Charity the Necromancer", 20000, 250, 150, 10, 5, RACE_DARK_ELF},
536 { "Pugnacious the Pugilist", 20000, 250, 150, 10, 5, RACE_HALF_ORC},
537 { "Footsore the Lucky", 30000, 250, 150, 10, 5, RACE_BEASTMAN},
538 { "Sidria Lighfingered", 30000, 250, 150, 10, 5, RACE_HUMAN},
539 { "Riatho the Juggler", 20000, 250, 150, 10, 5, RACE_HOBBIT},
540 { "Janaaka the Shifty", 20000, 250, 150, 10, 5, RACE_GNOME},
541 { "Cina the Rogue", 30000, 250, 150, 10, 5, RACE_GNOME},
542 { "Arunikki Greatclaw", 30000, 250, 150, 10, 5, RACE_DRACONIAN},
543 { "Chaeand the Poor", 20000, 250, 150, 10, 5, RACE_HUMAN},
544 { "Afardorf the Brigand", 20000, 250, 150, 10, 5, RACE_BARBARIAN},
545 { "Lathaxl the Greedy", 30000, 250, 150, 10, 5, RACE_MIND_FLAYER},
546 { "Falarewyn", 30000, 250, 150, 10, 5, RACE_SPRITE},
547 { "Vosur the Wrinkled", 20000, 250, 150, 10, 5, RACE_NIBELUNG},
548 { "Araord the Handsome", 20000, 250, 150, 10, 5, RACE_AMBERITE},
549 { "Theradfrid the Loser", 30000, 250, 150, 10, 5, RACE_HUMAN},
550 { "One-Legged Eroolo", 30000, 250, 150, 10, 5, RACE_HALF_OGRE},
556 { "我が家", 0, 100, 100, 0, 99, 99},
557 { "我が家", 0, 100, 100, 0, 99, 99},
558 { "我が家", 0, 100, 100, 0, 99, 99},
559 { "我が家", 0, 100, 100, 0, 99, 99},
560 { "我が家", 0, 100, 100, 0, 99, 99},
561 { "我が家", 0, 100, 100, 0, 99, 99},
562 { "我が家", 0, 100, 100, 0, 99, 99},
563 { "我が家", 0, 100, 100, 0, 99, 99},
564 { "我が家", 0, 100, 100, 0, 99, 99},
565 { "我が家", 0, 100, 100, 0, 99, 99},
566 { "我が家", 0, 100, 100, 0, 99, 99},
567 { "我が家", 0, 100, 100, 0, 99, 99},
568 { "我が家", 0, 100, 100, 0, 99, 99},
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},
589 { "Your home", 0, 100, 100, 0, 99, 99},
590 { "Your home", 0, 100, 100, 0, 99, 99},
591 { "Your home", 0, 100, 100, 0, 99, 99},
592 { "Your home", 0, 100, 100, 0, 99, 99},
593 { "Your home", 0, 100, 100, 0, 99, 99},
594 { "Your home", 0, 100, 100, 0, 99, 99},
595 { "Your home", 0, 100, 100, 0, 99, 99},
596 { "Your home", 0, 100, 100, 0, 99, 99},
597 { "Your home", 0, 100, 100, 0, 99, 99},
598 { "Your home", 0, 100, 100, 0, 99, 99},
599 { "Your home", 0, 100, 100, 0, 99, 99},
600 { "Your home", 0, 100, 100, 0, 99, 99},
601 { "Your home", 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},
626 /* Bookstore - 21 unique names */
628 { "強欲ドラフ", 10000, 175, 108, 4, 12, RACE_HUMAN},
629 { "賢者オドナー", 15000, 120, 105, 6, 16, RACE_HIGH_ELF},
630 { "中立のガンダー", 25000, 120, 110, 7, 19, RACE_DARK_ELF},
631 { "忍耐の人ロ=シャ", 30000, 140, 105, 6, 12, RACE_ELF},
632 { "ランドルフ・カーター", 15000, 175, 108, 4, 12, RACE_HUMAN},
633 { "隼のサライ", 15000, 175, 108, 4, 12, RACE_HUMAN},
634 { "千里眼ボドリル", 20000, 120, 105, 6, 16, RACE_HIGH_ELF},
635 { "沈黙のヴェオロイン", 25000, 120, 110, 7, 19, RACE_ZOMBIE},
636 { "学者のヴァンシラス", 30000, 140, 105, 6, 12, RACE_MIND_FLAYER},
637 { "物書きオセイン", 15000, 175, 108, 4, 12, RACE_SKELETON},
638 { "本の虫オルヴァー", 20000, 120, 105, 6, 16, RACE_VAMPIRE},
639 { "浅井墓男", 25000, 120, 110, 7, 19, RACE_ZOMBIE},
640 { "デスマスク", 30000, 140, 105, 6, 12, RACE_ZOMBIE},
641 { "学者のアスーヌ", 15000, 175, 108, 4, 12, RACE_MIND_FLAYER},
642 { "死人のプリランド", 20000, 120, 105, 6, 16, RACE_ZOMBIE},
643 { "鉄のロナール", 25000, 120, 110, 7, 19, RACE_GOLEM},
645 { "Dolaf the Greedy", 10000, 175, 108, 4, 12, RACE_HUMAN},
646 { "Odnar the Sage", 15000, 120, 105, 6, 16, RACE_HIGH_ELF},
647 { "Gandar the Neutral", 25000, 120, 110, 7, 19, RACE_DARK_ELF},
648 { "Ro-sha the Patient", 30000, 140, 105, 6, 12, RACE_ELF},
649 { "Randolph Carter", 15000, 175, 108, 4, 12, RACE_HUMAN},
650 { "Sarai the Swift", 15000, 175, 108, 4, 12, RACE_HUMAN},
651 { "Bodril the Seer", 20000, 120, 105, 6, 16, RACE_HIGH_ELF},
652 { "Veloin the Quiet", 25000, 120, 110, 7, 19, RACE_ZOMBIE},
653 { "Vanthylas the Learned", 30000, 140, 105, 6, 12, RACE_MIND_FLAYER},
654 { "Ossein the Literate", 15000, 175, 108, 4, 12, RACE_SKELETON},
655 { "Olvar Bookworm", 20000, 120, 105, 6, 16, RACE_VAMPIRE},
656 { "Shallowgrave", 25000, 120, 110, 7, 19, RACE_ZOMBIE},
657 { "Death Mask", 30000, 140, 105, 6, 12, RACE_ZOMBIE},
658 { "Asuunu the Learned", 15000, 175, 108, 4, 12, RACE_MIND_FLAYER},
659 { "Prirand the Dead", 20000, 120, 105, 6, 16, RACE_ZOMBIE},
660 { "Ronar the Iron", 25000, 120, 110, 7, 19, RACE_GOLEM},
663 { "ガリル=ガミル", 30000, 140, 105, 6, 12, RACE_ELF},
664 { "本食いローバグ", 15000, 175, 108, 4, 12, RACE_KOBOLD},
665 { "キリアリキーク", 20000, 120, 105, 6, 16, RACE_KLACKON},
666 { "静かなるリリン", 25000, 120, 110, 7, 19, RACE_DWARF},
667 { "王者イサング", 30000, 140, 105, 6, 12, RACE_HIGH_ELF},
668 { "強欲ドラフ", 10000, 175, 108, 4, 12, RACE_HUMAN},
669 { "賢者オドナー", 15000, 120, 105, 6, 16, RACE_HIGH_ELF},
670 { "中立のガンダー", 25000, 120, 110, 7, 19, RACE_DARK_ELF},
671 { "忍耐の人ロ=シャ", 30000, 140, 105, 6, 12, RACE_ELF},
672 { "ランドルフ・カーター", 15000, 175, 108, 4, 12, RACE_HUMAN},
673 { "隼サライ", 15000, 175, 108, 4, 12, RACE_HUMAN},
674 { "千里眼ボドリル", 20000, 120, 105, 6, 16, RACE_HIGH_ELF},
675 { "沈黙のヴェオロイン", 25000, 120, 110, 7, 19, RACE_ZOMBIE},
676 { "学者のヴァンシラス", 30000, 140, 105, 6, 12, RACE_MIND_FLAYER},
677 { "物書きオセイン", 15000, 175, 108, 4, 12, RACE_SKELETON},
678 { "本の虫オルヴァー", 20000, 120, 105, 6, 16, RACE_VAMPIRE},
680 { "Galil-Gamir", 30000, 140, 105, 6, 12, RACE_ELF},
681 { "Rorbag Book-Eater", 15000, 175, 108, 4, 12, RACE_KOBOLD},
682 { "Kiriarikirk", 20000, 120, 105, 6, 16, RACE_KLACKON},
683 { "Rilin the Quiet", 25000, 120, 110, 7, 19, RACE_DWARF},
684 { "Isung the Lord", 30000, 140, 105, 6, 12, RACE_HIGH_ELF},
685 { "Dolaf the Greedy", 10000, 175, 108, 4, 12, RACE_HUMAN},
686 { "Odnar the Sage", 15000, 120, 105, 6, 16, RACE_HIGH_ELF},
687 { "Gandar the Neutral", 25000, 120, 110, 7, 19, RACE_DARK_ELF},
688 { "Ro-sha the Patient", 30000, 140, 105, 6, 12, RACE_ELF},
689 { "Randolph Carter", 15000, 175, 108, 4, 12, RACE_HUMAN},
690 { "Sarai the Swift", 15000, 175, 108, 4, 12, RACE_HUMAN},
691 { "Bodril the Seer", 20000, 120, 105, 6, 16, RACE_HIGH_ELF},
692 { "Veloin the Quiet", 25000, 120, 110, 7, 19, RACE_ZOMBIE},
693 { "Vanthylas the Learned", 30000, 140, 105, 6, 12, RACE_MIND_FLAYER},
694 { "Ossein the Literate", 15000, 175, 108, 4, 12, RACE_SKELETON},
695 { "Olvar Bookworm", 20000, 120, 105, 6, 16, RACE_VAMPIRE},
702 { "博物館", 0, 100, 100, 0, 99, 99},
703 { "博物館", 0, 100, 100, 0, 99, 99},
704 { "博物館", 0, 100, 100, 0, 99, 99},
705 { "博物館", 0, 100, 100, 0, 99, 99},
706 { "博物館", 0, 100, 100, 0, 99, 99},
707 { "博物館", 0, 100, 100, 0, 99, 99},
708 { "博物館", 0, 100, 100, 0, 99, 99},
709 { "博物館", 0, 100, 100, 0, 99, 99},
710 { "博物館", 0, 100, 100, 0, 99, 99},
711 { "博物館", 0, 100, 100, 0, 99, 99},
712 { "博物館", 0, 100, 100, 0, 99, 99},
713 { "博物館", 0, 100, 100, 0, 99, 99},
714 { "博物館", 0, 100, 100, 0, 99, 99},
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},
735 { "Museum", 0, 100, 100, 0, 99, 99},
736 { "Museum", 0, 100, 100, 0, 99, 99},
737 { "Museum", 0, 100, 100, 0, 99, 99},
738 { "Museum", 0, 100, 100, 0, 99, 99},
739 { "Museum", 0, 100, 100, 0, 99, 99},
740 { "Museum", 0, 100, 100, 0, 99, 99},
741 { "Museum", 0, 100, 100, 0, 99, 99},
742 { "Museum", 0, 100, 100, 0, 99, 99},
743 { "Museum", 0, 100, 100, 0, 99, 99},
744 { "Museum", 0, 100, 100, 0, 99, 99},
745 { "Museum", 0, 100, 100, 0, 99, 99},
746 { "Museum", 0, 100, 100, 0, 99, 99},
747 { "Museum", 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},
773 static int cur_store_num = 0;
774 static int store_top = 0;
775 static int store_bottom = 0;
776 static int xtra_stock = 0;
777 static store_type *st_ptr = NULL;
778 static const owner_type *ot_ptr = NULL;
779 static s16b old_town_num = 0;
780 static s16b inner_town_num = 0;
781 #define RUMOR_CHANCE 8
783 #define MAX_COMMENT_1 6
785 static concptr comment_1[MAX_COMMENT_1] =
806 /*! ブラックマーケット追加メッセージ(承諾) */
807 static concptr comment_1_B[MAX_COMMENT_1] = {
816 #define MAX_COMMENT_2A 2
818 static concptr comment_2a[MAX_COMMENT_2A] =
821 "私の忍耐力を試しているのかい? $%s が最後だ。",
822 "我慢にも限度があるぞ。 $%s が最後だ。"
824 "You try my patience. %s is final.",
825 "My patience grows thin. %s is final."
830 #define MAX_COMMENT_2B 12
832 static concptr comment_2b[MAX_COMMENT_2B] =
835 " $%s ぐらいは出さなきゃダメだよ。",
838 "何て奴だ! $%s 以下はあり得ないぞ。",
839 "それじゃ少なすぎる! $%s は欲しいところだ。",
840 "バカにしている! $%s はもらわないと。",
842 "おいおい! $%s を考えてくれないか?",
843 "1000匹のオークのノミに苦しめられるがいい! $%s だ。",
844 "お前の大切なものに災いあれ! $%s でどうだ。",
845 "モルゴスに賞味されるがいい!本当は $%s なんだろう?",
846 "お前の母親はオーガか! $%s は出すつもりなんだろ?"
848 "I can take no less than %s gold pieces.",
849 "I will accept no less than %s gold pieces.",
850 "Ha! No less than %s gold pieces.",
851 "You knave! No less than %s gold pieces.",
852 "That's a pittance! I want %s gold pieces.",
853 "That's an insult! I want %s gold pieces.",
854 "As if! How about %s gold pieces?",
855 "My arse! How about %s gold pieces?",
856 "May the fleas of 1000 orcs molest you! Try %s gold pieces.",
857 "May your most favourite parts go moldy! Try %s gold pieces.",
858 "May Morgoth find you tasty! Perhaps %s gold pieces?",
859 "Your mother was an Ogre! Perhaps %s gold pieces?"
865 /*! ブラックマーケット用追加メッセージ(売るとき) */
866 static concptr comment_2b_B[MAX_COMMENT_2B] = {
867 "いくら俺様がお人好しとはいえ $%s が限界だね。嫌なら帰りな。",
868 "金がないのかい、あんた?まずは家に帰って $%s 揃えてきな。",
869 "物の価値が分からん奴だな。これは $%s が普通なんだよ。",
870 "俺の付けた値段に文句があるのか? $%s が限界だ。",
871 "ひょっとして新手の冗談かい? $%s 持ってないなら帰りな。",
872 "うちは他の店とは違うんだよ。$%s ぐらいは出しな。",
873 "買う気がないなら帰りな。 $%s だと言っているんだ。",
874 "話にならないね。 $%s くらい持っているんだろ?",
875 "は?なんだそりゃ? $%s の間違いか、ひょっとして?",
876 "出口はあっちだよ。それとも $%s 出せるのかい、あんたに。",
877 "命知らずな奴だな。 $%s 出せば今日の所は勘弁してやるよ。",
878 "うちの店は貧乏人お断りだ。 $%s ぐらい出せないのかい?"
881 #define MAX_COMMENT_3A 2
883 static concptr comment_3a[MAX_COMMENT_3A] =
886 "私の忍耐力を試しているのかい? $%s が最後だ。",
887 "我慢にも限度があるぞ。 $%s が最後だ。"
889 "You try my patience. %s is final.",
890 "My patience grows thin. %s is final."
896 #define MAX_COMMENT_3B 12
898 static concptr comment_3b[MAX_COMMENT_3B] =
901 "本音を言うと $%s でいいんだろ?",
903 " $%s ぐらいなら出してもいいが。",
904 " $%s 以上払うなんて考えられないね。",
905 "まあ落ちついて。 $%s でどうだい?",
906 "そのガラクタなら $%s で引き取るよ。",
907 "それじゃ高すぎる! $%s がいいとこだろ。",
908 "どうせいらないんだろ! $%s でいいだろ?",
909 "だめだめ! $%s がずっとお似合いだよ。",
910 "バカにしている! $%s がせいぜいだ。",
911 " $%s なら嬉しいところだがなあ。",
912 " $%s 、それ以上はビタ一文出さないよ!"
914 "Perhaps %s gold pieces?",
915 "How about %s gold pieces?",
916 "I will pay no more than %s gold pieces.",
917 "I can afford no more than %s gold pieces.",
918 "Be reasonable. How about %s gold pieces?",
919 "I'll buy it as scrap for %s gold pieces.",
920 "That is too much! How about %s gold pieces?",
921 "That looks war surplus! Say %s gold pieces?",
922 "Never! %s is more like it.",
923 "That's an insult! %s is more like it.",
924 "%s gold pieces and be thankful for it!",
925 "%s gold pieces and not a copper more!"
931 /*! ブラックマーケット用追加メッセージ(買い取り) */
932 static concptr comment_3b_B[MAX_COMMENT_3B] = {
933 " $%s ってところだね。そのどうしようもないガラクタは。",
934 "この俺が $%s って言っているんだから、その通りにした方が身のためだぞ。",
935 "俺の優しさに甘えるのもいい加減にしておけ。 $%s だ。",
936 "その品なら $%s で売ってくれているがね、常識ある紳士はみんな。",
937 "こりゃまた、がめつい奴だな。いくら俺が温厚とはいえ $%s が限界だ。",
938 " $%s だ。別に俺はそんなガラクタ欲しくはないんだから。",
939 "俺の鑑定額が気に入らないのか? $%s 、嫌なら帰りな。",
940 " $%s で引き取ってやるよ。喜んで受け取りな、貧乏人。",
941 "物の価値が分からん奴は始末におえんな。それは $%s なんだよ。",
942 "そんなに金が欲しいのか、あんた? $%s で満足できんのか?",
943 "入る店間違えてんじゃないのか? $%s で嫌なら他をあたってくれ。",
944 "俺の言い値にケチをつける奴がいるとは! その度胸に免じて $%s だ。"
947 #define MAX_COMMENT_4A 4
949 static concptr comment_4a[MAX_COMMENT_4A] =
952 "もうたくさんだ!何度も私をわずらわせないでくれ!",
953 "うがー!一日の我慢の限度を超えている!",
954 "もういい!時間の無駄以外のなにものでもない!",
955 "もうやってられないよ!顔も見たくない!"
957 "Enough! You have abused me once too often!",
958 "Arghhh! I have had enough abuse for one day!",
959 "That does it! You shall waste my time no more!",
960 "This is getting nowhere! I'm going to Londis!"
966 /*! ブラックマーケット用追加メッセージ(怒りの頂点) */
967 static concptr comment_4a_B[MAX_COMMENT_4A] = {
968 "なめやがって!温厚な俺様でも限界があるってことを知れ!",
969 "俺をここまで怒らせて...命があるだけでもありがたいと思え!",
970 "ふざけてるのか!冷やかしなら相手を見てからにしろ!",
971 "いいかげんにしろ!今度こんなまねしたらただじゃおかねえぞ!"
974 #define MAX_COMMENT_4B 4
976 static concptr comment_4b[MAX_COMMENT_4B] =
985 "Get out of my sight!",
986 "Begone, you scoundrel!",
993 /*! ブラックマーケット用追加メッセージ(追い出し) */
994 static concptr comment_4b_B[MAX_COMMENT_4B] = {
1001 #define MAX_COMMENT_5 8
1003 static concptr comment_5[MAX_COMMENT_5] =
1017 "You will have to do better than that!",
1018 "Do you wish to do business or not?",
1019 "You've got to be kidding!",
1020 "You'd better be kidding!",
1021 "You try my patience.",
1022 "Hmmm, nice weather we're having."
1028 /*! ブラックマーケット用追加メッセージ(怒り) */
1029 static concptr comment_5_B[MAX_COMMENT_5] = {
1040 #define MAX_COMMENT_6 4
1042 static concptr comment_6[MAX_COMMENT_6] =
1050 "I must have heard you wrong.",
1051 "I'm sorry, I missed that.",
1052 "I'm sorry, what was that?",
1053 "Sorry, what was that again?"
1058 /*** Initialize others ***/
1061 * 店舗で販売するオブジェクトを定義する / Hack -- Objects sold in the stores -- by tval/sval pair.
1063 byte store_table[MAX_STORES][STORE_CHOICES][2] =
1068 { TV_FOOD, SV_FOOD_RATION },
1069 { TV_FOOD, SV_FOOD_RATION },
1070 { TV_FOOD, SV_FOOD_RATION },
1071 { TV_FOOD, SV_FOOD_RATION },
1073 { TV_FOOD, SV_FOOD_RATION },
1074 { TV_FOOD, SV_FOOD_BISCUIT },
1075 { TV_FOOD, SV_FOOD_JERKY },
1076 { TV_FOOD, SV_FOOD_JERKY },
1078 { TV_FOOD, SV_FOOD_PINT_OF_WINE },
1079 { TV_FOOD, SV_FOOD_PINT_OF_ALE },
1080 { TV_LITE, SV_LITE_TORCH },
1081 { TV_LITE, SV_LITE_TORCH },
1083 { TV_LITE, SV_LITE_TORCH },
1084 { TV_LITE, SV_LITE_TORCH },
1085 { TV_LITE, SV_LITE_LANTERN },
1086 { TV_LITE, SV_LITE_LANTERN },
1098 { TV_SHOT, SV_AMMO_NORMAL },
1099 { TV_ARROW, SV_AMMO_NORMAL },
1100 { TV_BOLT, SV_AMMO_NORMAL },
1101 { TV_DIGGING, SV_SHOVEL },
1103 { TV_DIGGING, SV_PICK },
1104 { TV_CLOAK, SV_CLOAK },
1105 { TV_CLOAK, SV_CLOAK },
1106 { TV_CLOAK, SV_FUR_CLOAK },
1108 { TV_FOOD, SV_FOOD_RATION },
1109 { TV_FOOD, SV_FOOD_RATION },
1110 { TV_FOOD, SV_FOOD_RATION },
1111 { TV_FOOD, SV_FOOD_RATION },
1113 { TV_POTION, SV_POTION_WATER },
1114 { TV_POTION, SV_POTION_WATER },
1115 { TV_LITE, SV_LITE_LANTERN },
1116 { TV_LITE, SV_LITE_LANTERN },
1118 { TV_FOOD, SV_FOOD_WAYBREAD },
1119 { TV_FOOD, SV_FOOD_WAYBREAD },
1123 { TV_SHOT, SV_AMMO_NORMAL },
1124 { TV_ARROW, SV_AMMO_NORMAL },
1125 { TV_BOLT, SV_AMMO_NORMAL },
1126 { TV_DIGGING, SV_SHOVEL }
1132 { TV_BOOTS, SV_PAIR_OF_SOFT_LEATHER_BOOTS },
1133 { TV_BOOTS, SV_PAIR_OF_SOFT_LEATHER_BOOTS },
1134 { TV_BOOTS, SV_PAIR_OF_HARD_LEATHER_BOOTS },
1135 { TV_BOOTS, SV_PAIR_OF_HARD_LEATHER_BOOTS },
1137 { TV_HELM, SV_HARD_LEATHER_CAP },
1138 { TV_HELM, SV_HARD_LEATHER_CAP },
1139 { TV_HELM, SV_METAL_CAP },
1140 { TV_HELM, SV_IRON_HELM },
1142 { TV_SOFT_ARMOR, SV_ROBE },
1143 { TV_SOFT_ARMOR, SV_ROBE },
1144 { TV_SOFT_ARMOR, SV_SOFT_LEATHER_ARMOR },
1145 { TV_SOFT_ARMOR, SV_SOFT_LEATHER_ARMOR },
1147 { TV_SOFT_ARMOR, SV_HARD_LEATHER_ARMOR },
1148 { TV_SOFT_ARMOR, SV_HARD_LEATHER_ARMOR },
1149 { TV_SOFT_ARMOR, SV_HARD_STUDDED_LEATHER },
1150 { TV_SOFT_ARMOR, SV_HARD_STUDDED_LEATHER },
1152 { TV_SOFT_ARMOR, SV_RHINO_HIDE_ARMOR },
1153 { TV_SOFT_ARMOR, SV_LEATHER_SCALE_MAIL },
1154 { TV_HARD_ARMOR, SV_METAL_SCALE_MAIL },
1155 { TV_HARD_ARMOR, SV_CHAIN_MAIL },
1157 { TV_HARD_ARMOR, SV_DOUBLE_RING_MAIL },
1158 { TV_HARD_ARMOR, SV_AUGMENTED_CHAIN_MAIL },
1159 { TV_HARD_ARMOR, SV_BAR_CHAIN_MAIL },
1160 { TV_HARD_ARMOR, SV_DOUBLE_CHAIN_MAIL },
1162 { TV_HARD_ARMOR, SV_METAL_BRIGANDINE_ARMOUR },
1163 { TV_HARD_ARMOR, SV_SPLINT_MAIL },
1164 { TV_GLOVES, SV_SET_OF_LEATHER_GLOVES },
1165 { TV_GLOVES, SV_SET_OF_LEATHER_GLOVES },
1167 { TV_GLOVES, SV_SET_OF_GAUNTLETS },
1168 { TV_SHIELD, SV_SMALL_LEATHER_SHIELD },
1169 { TV_SHIELD, SV_LARGE_LEATHER_SHIELD },
1170 { TV_SHIELD, SV_SMALL_METAL_SHIELD },
1172 { TV_BOOTS, SV_PAIR_OF_HARD_LEATHER_BOOTS },
1173 { TV_BOOTS, SV_PAIR_OF_HARD_LEATHER_BOOTS },
1174 { TV_HELM, SV_HARD_LEATHER_CAP },
1175 { TV_HELM, SV_HARD_LEATHER_CAP },
1177 { TV_SOFT_ARMOR, SV_ROBE },
1178 { TV_SOFT_ARMOR, SV_SOFT_LEATHER_ARMOR },
1179 { TV_SOFT_ARMOR, SV_SOFT_LEATHER_ARMOR },
1180 { TV_SOFT_ARMOR, SV_HARD_LEATHER_ARMOR },
1182 { TV_SOFT_ARMOR, SV_LEATHER_JACK },
1183 { TV_HARD_ARMOR, SV_METAL_SCALE_MAIL },
1184 { TV_HARD_ARMOR, SV_CHAIN_MAIL },
1185 { TV_HARD_ARMOR, SV_CHAIN_MAIL },
1187 { TV_GLOVES, SV_SET_OF_LEATHER_GLOVES },
1188 { TV_GLOVES, SV_SET_OF_GAUNTLETS },
1189 { TV_SHIELD, SV_SMALL_LEATHER_SHIELD },
1190 { TV_SHIELD, SV_SMALL_LEATHER_SHIELD }
1196 { TV_SWORD, SV_DAGGER },
1197 { TV_SWORD, SV_MAIN_GAUCHE },
1198 { TV_SWORD, SV_RAPIER },
1199 { TV_SWORD, SV_SMALL_SWORD },
1201 { TV_SWORD, SV_SHORT_SWORD },
1202 { TV_SWORD, SV_SABRE },
1203 { TV_SWORD, SV_CUTLASS },
1204 { TV_SWORD, SV_TULWAR },
1206 { TV_SWORD, SV_BROAD_SWORD },
1207 { TV_SWORD, SV_LONG_SWORD },
1208 { TV_SWORD, SV_SCIMITAR },
1209 { TV_SWORD, SV_KATANA },
1211 { TV_SWORD, SV_BASTARD_SWORD },
1212 { TV_POLEARM, SV_SPEAR },
1213 { TV_POLEARM, SV_AWL_PIKE },
1214 { TV_POLEARM, SV_TRIDENT },
1216 { TV_POLEARM, SV_PIKE },
1217 { TV_POLEARM, SV_BEAKED_AXE },
1218 { TV_POLEARM, SV_BROAD_AXE },
1219 { TV_POLEARM, SV_LANCE },
1221 { TV_POLEARM, SV_BATTLE_AXE },
1222 { TV_POLEARM, SV_HATCHET },
1223 { TV_BOW, SV_SLING },
1224 { TV_BOW, SV_SHORT_BOW },
1226 { TV_BOW, SV_LIGHT_XBOW },
1227 { TV_SHOT, SV_AMMO_NORMAL },
1228 { TV_SHOT, SV_AMMO_NORMAL },
1229 { TV_ARROW, SV_AMMO_NORMAL },
1231 { TV_ARROW, SV_AMMO_NORMAL },
1232 { TV_BOLT, SV_AMMO_NORMAL },
1233 { TV_BOLT, SV_AMMO_NORMAL },
1234 { TV_BOW, SV_LIGHT_XBOW },
1236 { TV_ARROW, SV_AMMO_NORMAL },
1237 { TV_BOLT, SV_AMMO_NORMAL },
1238 { TV_BOW, SV_SHORT_BOW },
1239 { TV_BOW, SV_LIGHT_XBOW },
1241 { TV_SWORD, SV_DAGGER },
1242 { TV_SWORD, SV_TANTO },
1243 { TV_SWORD, SV_RAPIER },
1244 { TV_SWORD, SV_SMALL_SWORD },
1246 { TV_SWORD, SV_SHORT_SWORD },
1247 { TV_SWORD, SV_LONG_SWORD },
1248 { TV_SWORD, SV_SCIMITAR },
1249 { TV_SWORD, SV_BROAD_SWORD },
1251 { TV_HISSATSU_BOOK, 0 },
1252 { TV_HISSATSU_BOOK, 0 },
1253 { TV_HISSATSU_BOOK, 1 },
1254 { TV_HISSATSU_BOOK, 1 },
1260 { TV_HAFTED, SV_NUNCHAKU },
1261 { TV_HAFTED, SV_QUARTERSTAFF },
1262 { TV_HAFTED, SV_MACE },
1263 { TV_HAFTED, SV_BO_STAFF },
1265 { TV_HAFTED, SV_WAR_HAMMER },
1266 { TV_HAFTED, SV_WAR_HAMMER },
1267 { TV_HAFTED, SV_MORNING_STAR },
1268 { TV_HAFTED, SV_FLAIL },
1270 { TV_HAFTED, SV_LEAD_FILLED_MACE },
1271 { TV_SCROLL, SV_SCROLL_REMOVE_CURSE },
1272 { TV_SCROLL, SV_SCROLL_BLESSING },
1273 { TV_SCROLL, SV_SCROLL_HOLY_CHANT },
1275 { TV_POTION, SV_POTION_HEROISM },
1276 { TV_SCROLL, SV_SCROLL_WORD_OF_RECALL },
1277 { TV_SCROLL, SV_SCROLL_WORD_OF_RECALL },
1278 { TV_SCROLL, SV_SCROLL_WORD_OF_RECALL },
1280 { TV_POTION, SV_POTION_CURE_LIGHT },
1281 { TV_POTION, SV_POTION_CURE_SERIOUS },
1282 { TV_POTION, SV_POTION_CURE_SERIOUS },
1283 { TV_POTION, SV_POTION_CURE_CRITICAL },
1285 { TV_POTION, SV_POTION_CURE_CRITICAL },
1286 { TV_POTION, SV_POTION_RESTORE_EXP },
1287 { TV_POTION, SV_POTION_RESTORE_EXP },
1288 { TV_POTION, SV_POTION_RESTORE_EXP },
1290 { TV_LIFE_BOOK, 0 },
1291 { TV_LIFE_BOOK, 0 },
1292 { TV_LIFE_BOOK, 1 },
1293 { TV_LIFE_BOOK, 1 },
1295 { TV_CRUSADE_BOOK, 0 },
1296 { TV_CRUSADE_BOOK, 0 },
1297 { TV_CRUSADE_BOOK, 1 },
1298 { TV_CRUSADE_BOOK, 1 },
1300 { TV_HAFTED, SV_WHIP },
1301 { TV_HAFTED, SV_MACE },
1302 { TV_HAFTED, SV_BALL_AND_CHAIN },
1303 { TV_HAFTED, SV_WAR_HAMMER },
1305 { TV_SCROLL, SV_SCROLL_WORD_OF_RECALL },
1306 { TV_SCROLL, SV_SCROLL_WORD_OF_RECALL },
1307 { TV_SCROLL, SV_SCROLL_WORD_OF_RECALL },
1308 { TV_POTION, SV_POTION_CURE_CRITICAL },
1310 { TV_POTION, SV_POTION_CURE_CRITICAL },
1311 { TV_POTION, SV_POTION_RESTORE_EXP },
1314 { TV_STATUE, SV_ANY },
1316 { TV_SCROLL, SV_SCROLL_REMOVE_CURSE },
1317 { TV_SCROLL, SV_SCROLL_REMOVE_CURSE },
1318 { TV_SCROLL, SV_SCROLL_STAR_REMOVE_CURSE },
1319 { TV_SCROLL, SV_SCROLL_STAR_REMOVE_CURSE }
1325 { TV_SCROLL, SV_SCROLL_ENCHANT_WEAPON_TO_HIT },
1326 { TV_SCROLL, SV_SCROLL_ENCHANT_WEAPON_TO_DAM },
1327 { TV_SCROLL, SV_SCROLL_ENCHANT_ARMOR },
1328 { TV_SCROLL, SV_SCROLL_IDENTIFY },
1330 { TV_SCROLL, SV_SCROLL_IDENTIFY },
1331 { TV_SCROLL, SV_SCROLL_IDENTIFY },
1332 { TV_SCROLL, SV_SCROLL_IDENTIFY },
1333 { TV_SCROLL, SV_SCROLL_LIGHT },
1335 { TV_SCROLL, SV_SCROLL_PHASE_DOOR },
1336 { TV_SCROLL, SV_SCROLL_PHASE_DOOR },
1337 { TV_SCROLL, SV_SCROLL_TELEPORT },
1338 { TV_SCROLL, SV_SCROLL_MONSTER_CONFUSION },
1340 { TV_SCROLL, SV_SCROLL_MAPPING },
1341 { TV_SCROLL, SV_SCROLL_DETECT_GOLD },
1342 { TV_SCROLL, SV_SCROLL_DETECT_ITEM },
1343 { TV_SCROLL, SV_SCROLL_DETECT_TRAP },
1345 { TV_SCROLL, SV_SCROLL_DETECT_INVIS },
1346 { TV_SCROLL, SV_SCROLL_RECHARGING },
1347 { TV_SCROLL, SV_SCROLL_TELEPORT },
1348 { TV_SCROLL, SV_SCROLL_WORD_OF_RECALL },
1350 { TV_SCROLL, SV_SCROLL_WORD_OF_RECALL },
1351 { TV_SCROLL, SV_SCROLL_WORD_OF_RECALL },
1352 { TV_SCROLL, SV_SCROLL_WORD_OF_RECALL },
1353 { TV_SCROLL, SV_SCROLL_TELEPORT },
1355 { TV_SCROLL, SV_SCROLL_TELEPORT },
1356 { TV_POTION, SV_POTION_RES_STR },
1357 { TV_POTION, SV_POTION_RES_INT },
1358 { TV_POTION, SV_POTION_RES_WIS },
1360 { TV_POTION, SV_POTION_RES_DEX },
1361 { TV_POTION, SV_POTION_RES_CON },
1362 { TV_POTION, SV_POTION_RES_CHR },
1363 { TV_SCROLL, SV_SCROLL_IDENTIFY },
1365 { TV_SCROLL, SV_SCROLL_IDENTIFY },
1366 { TV_SCROLL, SV_SCROLL_STAR_IDENTIFY }, /* Yep, occasionally! */
1367 { TV_SCROLL, SV_SCROLL_STAR_IDENTIFY },
1368 { TV_SCROLL, SV_SCROLL_LIGHT },
1370 { TV_POTION, SV_POTION_RES_STR },
1371 { TV_POTION, SV_POTION_RES_INT },
1372 { TV_POTION, SV_POTION_RES_WIS },
1373 { TV_POTION, SV_POTION_RES_DEX },
1375 { TV_POTION, SV_POTION_RES_CON },
1376 { TV_POTION, SV_POTION_RES_CHR },
1377 { TV_SCROLL, SV_SCROLL_ENCHANT_ARMOR },
1378 { TV_SCROLL, SV_SCROLL_ENCHANT_ARMOR },
1380 { TV_SCROLL, SV_SCROLL_RECHARGING },
1381 { TV_SCROLL, SV_SCROLL_PHASE_DOOR },
1382 { TV_SCROLL, SV_SCROLL_ENCHANT_WEAPON_TO_HIT },
1383 { TV_SCROLL, SV_SCROLL_ENCHANT_WEAPON_TO_DAM },
1388 /* Magic-User store */
1390 { TV_RING, SV_RING_PROTECTION },
1391 { TV_RING, SV_RING_LEVITATION_FALL },
1392 { TV_RING, SV_RING_PROTECTION },
1393 { TV_RING, SV_RING_RESIST_FIRE },
1395 { TV_RING, SV_RING_RESIST_COLD },
1396 { TV_AMULET, SV_AMULET_CHARISMA },
1397 { TV_RING, SV_RING_WARNING },
1398 { TV_AMULET, SV_AMULET_RESIST_ACID },
1400 { TV_AMULET, SV_AMULET_SEARCHING },
1401 { TV_WAND, SV_WAND_SLOW_MONSTER },
1402 { TV_WAND, SV_WAND_CONFUSE_MONSTER },
1403 { TV_WAND, SV_WAND_SLEEP_MONSTER },
1405 { TV_WAND, SV_WAND_MAGIC_MISSILE },
1406 { TV_WAND, SV_WAND_STINKING_CLOUD },
1407 { TV_WAND, SV_WAND_WONDER },
1408 { TV_WAND, SV_WAND_DISARMING },
1410 { TV_STAFF, SV_STAFF_LITE },
1411 { TV_STAFF, SV_STAFF_MAPPING },
1412 { TV_STAFF, SV_STAFF_DETECT_TRAP },
1413 { TV_STAFF, SV_STAFF_DETECT_DOOR },
1415 { TV_STAFF, SV_STAFF_DETECT_GOLD },
1416 { TV_STAFF, SV_STAFF_DETECT_ITEM },
1417 { TV_STAFF, SV_STAFF_DETECT_INVIS },
1418 { TV_STAFF, SV_STAFF_DETECT_EVIL },
1420 { TV_STAFF, SV_STAFF_TELEPORTATION },
1421 { TV_STAFF, SV_STAFF_TELEPORTATION },
1422 { TV_STAFF, SV_STAFF_TELEPORTATION },
1423 { TV_STAFF, SV_STAFF_TELEPORTATION },
1425 { TV_STAFF, SV_STAFF_IDENTIFY },
1426 { TV_STAFF, SV_STAFF_IDENTIFY },
1427 { TV_STAFF, SV_STAFF_IDENTIFY },
1429 { TV_STAFF, SV_STAFF_IDENTIFY },
1430 { TV_STAFF, SV_STAFF_REMOVE_CURSE },
1431 { TV_STAFF, SV_STAFF_CURE_LIGHT },
1432 { TV_STAFF, SV_STAFF_PROBING },
1436 { TV_SORCERY_BOOK, 0 },
1437 { TV_SORCERY_BOOK, 0 },
1438 { TV_SORCERY_BOOK, 1 },
1439 { TV_SORCERY_BOOK, 1 },
1441 { TV_ARCANE_BOOK, 0 },
1442 { TV_ARCANE_BOOK, 0 },
1443 { TV_ARCANE_BOOK, 1 },
1444 { TV_ARCANE_BOOK, 1 },
1446 { TV_ARCANE_BOOK, 2 },
1447 { TV_ARCANE_BOOK, 2 },
1448 { TV_ARCANE_BOOK, 3 },
1449 { TV_ARCANE_BOOK, 3 },
1454 /* Black Market (unused) */
1527 { TV_SORCERY_BOOK, 0 },
1528 { TV_SORCERY_BOOK, 0 },
1529 { TV_SORCERY_BOOK, 1 },
1530 { TV_SORCERY_BOOK, 1 },
1532 { TV_NATURE_BOOK, 0 },
1533 { TV_NATURE_BOOK, 0 },
1534 { TV_NATURE_BOOK, 1 },
1535 { TV_NATURE_BOOK, 1 },
1537 { TV_CHAOS_BOOK, 0 },
1538 { TV_CHAOS_BOOK, 0 },
1539 { TV_CHAOS_BOOK, 1 },
1540 { TV_CHAOS_BOOK, 1 },
1542 { TV_DEATH_BOOK, 0 },
1543 { TV_DEATH_BOOK, 0 },
1544 { TV_DEATH_BOOK, 1 },
1545 { TV_DEATH_BOOK, 1 },
1547 { TV_TRUMP_BOOK, 0 }, /* +16 */
1548 { TV_TRUMP_BOOK, 0 },
1549 { TV_TRUMP_BOOK, 1 },
1550 { TV_TRUMP_BOOK, 1 },
1552 { TV_ARCANE_BOOK, 0 },
1553 { TV_ARCANE_BOOK, 1 },
1554 { TV_ARCANE_BOOK, 2 },
1555 { TV_ARCANE_BOOK, 3 },
1557 { TV_CRAFT_BOOK, 0 },
1558 { TV_CRAFT_BOOK, 0 },
1559 { TV_CRAFT_BOOK, 1 },
1560 { TV_CRAFT_BOOK, 1 },
1562 { TV_DAEMON_BOOK, 0 },
1563 { TV_DAEMON_BOOK, 0 },
1564 { TV_DAEMON_BOOK, 1 },
1565 { TV_DAEMON_BOOK, 1 },
1567 { TV_MUSIC_BOOK, 0 },
1568 { TV_MUSIC_BOOK, 0 },
1569 { TV_MUSIC_BOOK, 1 },
1570 { TV_MUSIC_BOOK, 1 },
1579 /* Museum (unused) */
1618 * @brief 取引成功時の店主のメッセージ処理 /
1619 * Successful haggle.
1622 static void say_comment_1(void)
1625 /* ブラックマーケットのときは別のメッセージを出す */
1626 if ( cur_store_num == STORE_BLACK ) {
1627 msg_print(comment_1_B[randint0(MAX_COMMENT_1)]);
1630 msg_print(comment_1[randint0(MAX_COMMENT_1)]);
1633 msg_print(comment_1[randint0(MAX_COMMENT_1)]);
1637 if (one_in_(RUMOR_CHANCE))
1640 msg_print("店主は耳うちした:");
1642 msg_print("The shopkeeper whispers something into your ear:");
1644 display_rumor(TRUE);
1650 * @brief プレイヤーがアイテムを買う時の価格代案メッセージ処理 /
1651 * Continue haggling (player is buying)
1652 * @param value 店主の提示価格
1653 * @param annoyed 店主のいらつき度
1656 static void say_comment_2(PRICE value, int annoyed)
1660 /* Prepare a string to insert */
1661 sprintf(tmp_val, "%ld", (long)value);
1666 /* Formatted message */
1667 msg_format(comment_2a[randint0(MAX_COMMENT_2A)], tmp_val);
1673 /* Formatted message */
1675 /* ブラックマーケットの時は別のメッセージを出す */
1676 if ( cur_store_num == STORE_BLACK ){
1677 msg_format(comment_2b_B[randint0(MAX_COMMENT_2B)], tmp_val);
1680 msg_format(comment_2b[randint0(MAX_COMMENT_2B)], tmp_val);
1683 msg_format(comment_2b[randint0(MAX_COMMENT_2B)], tmp_val);
1691 * @brief プレイヤーがアイテムを売る時の価格代案メッセージ処理 /
1692 * Continue haggling (player is selling)
1693 * @param value 店主の提示価格
1694 * @param annoyed 店主のいらつき度
1697 static void say_comment_3(PRICE value, int annoyed)
1701 /* Prepare a string to insert */
1702 sprintf(tmp_val, "%ld", (long)value);
1707 /* Formatted message */
1708 msg_format(comment_3a[randint0(MAX_COMMENT_3A)], tmp_val);
1714 /* Formatted message */
1716 /* ブラックマーケットの時は別のメッセージを出す */
1717 if ( cur_store_num == STORE_BLACK ){
1718 msg_format(comment_3b_B[randint0(MAX_COMMENT_3B)], tmp_val);
1721 msg_format(comment_3b[randint0(MAX_COMMENT_3B)], tmp_val);
1724 msg_format(comment_3b[randint0(MAX_COMMENT_3B)], tmp_val);
1732 * @brief 店主がプレイヤーを追い出す時のメッセージ処理 /
1733 * Kick 'da bum out. -RAK-
1736 static void say_comment_4(void)
1739 /* ブラックマーケットの時は別のメッセージを出す */
1740 if ( cur_store_num == STORE_BLACK ){
1741 msg_print(comment_4a_B[randint0(MAX_COMMENT_4A)]);
1742 msg_print(comment_4b_B[randint0(MAX_COMMENT_4B)]);
1745 msg_print(comment_4a[randint0(MAX_COMMENT_4A)]);
1746 msg_print(comment_4b[randint0(MAX_COMMENT_4B)]);
1749 msg_print(comment_4a[randint0(MAX_COMMENT_4A)]);
1750 msg_print(comment_4b[randint0(MAX_COMMENT_4B)]);
1757 * @brief 店主がプレイヤーに取り合わない時のメッセージ処理 /
1758 * You are insulting me
1761 static void say_comment_5(void)
1764 /* ブラックマーケットの時は別のメッセージを出す */
1765 if ( cur_store_num == STORE_BLACK ){
1766 msg_print(comment_5_B[randint0(MAX_COMMENT_5)]);
1769 msg_print(comment_5[randint0(MAX_COMMENT_5)]);
1772 msg_print(comment_5[randint0(MAX_COMMENT_5)]);
1779 * @brief 店主がプレイヤーの提示を理解できなかった時のメッセージ処理 /
1780 * That makes no sense.
1783 static void say_comment_6(void)
1785 msg_print(comment_6[randint0(MAX_COMMENT_6)]);
1789 #define MAX_COMMENT_7A 4
1791 static concptr comment_7a[MAX_COMMENT_7A] =
1796 "誰かがむせび泣く声が聞こえる...。",
1801 "You hear someone sobbing...",
1802 "The shopkeeper howls in agony!"
1807 #define MAX_COMMENT_7B 4
1809 static concptr comment_7b[MAX_COMMENT_7B] =
1819 "The shopkeeper curses at you.",
1820 "The shopkeeper glares at you."
1825 #define MAX_COMMENT_7C 4
1827 static concptr comment_7c[MAX_COMMENT_7C] =
1836 "You've made my day!",
1837 "The shopkeeper giggles.",
1838 "The shopkeeper laughs loudly."
1843 #define MAX_COMMENT_7D 4
1845 static concptr comment_7d[MAX_COMMENT_7D] =
1849 "こんなおいしい思いをしたら、真面目に働けなくなるなぁ。",
1854 "I think I'll retire!",
1855 "The shopkeeper jumps for joy.",
1856 "The shopkeeper smiles gleefully."
1863 * @brief 店主が交渉を終えた際の反応を返す処理 /
1864 * Let a shop-keeper React to a purchase
1865 * @param price アイテムの取引額
1866 * @param value アイテムの実際価値
1867 * @param guess 店主が当初予想していた価値
1870 * We paid "price", it was worth "value", and we thought it was worth "guess"
1872 static void purchase_analyze(PRICE price, PRICE value, PRICE guess)
1874 /* Item was worthless, but we bought it */
1875 if ((value <= 0) && (price > value))
1877 msg_print(comment_7a[randint0(MAX_COMMENT_7A)]);
1878 chg_virtue(V_HONOUR, -1);
1879 chg_virtue(V_JUSTICE, -1);
1880 sound(SOUND_STORE1);
1883 /* Item was cheaper than we thought, and we paid more than necessary */
1884 else if ((value < guess) && (price > value))
1886 msg_print(comment_7b[randint0(MAX_COMMENT_7B)]);
1887 chg_virtue(V_JUSTICE, -1);
1888 if (one_in_(4)) chg_virtue(V_HONOUR, -1);
1889 sound(SOUND_STORE2);
1892 /* Item was a good bargain, and we got away with it */
1893 else if ((value > guess) && (value < (4 * guess)) && (price < value))
1895 msg_print(comment_7c[randint0(MAX_COMMENT_7C)]);
1896 if (one_in_(4)) chg_virtue(V_HONOUR, -1);
1897 else if (one_in_(4)) chg_virtue(V_HONOUR, 1);
1898 sound(SOUND_STORE3);
1901 /* Item was a great bargain, and we got away with it */
1902 else if ((value > guess) && (price < value))
1904 msg_print(comment_7d[randint0(MAX_COMMENT_7D)]);
1905 if (one_in_(2)) chg_virtue(V_HONOUR, -1);
1906 if (one_in_(4)) chg_virtue(V_HONOUR, 1);
1907 if (10 * price < value) chg_virtue(V_SACRIFICE, 1);
1908 sound(SOUND_STORE4);
1915 * We store the current "store feat" here so everyone can access it
1917 static int cur_store_feat;
1921 * Buying and selling adjustments for race combinations.
1922 * Entry[owner][player] gives the basic "cost inflation".
1924 static byte rgold_adj[MAX_RACES][MAX_RACES] =
1926 /*Hum, HfE, Elf, Hal, Gno, Dwa, HfO, HfT, Dun, HiE, Barbarian,
1927 HfOg, HGn, HTn, Cyc, Yek, Klc, Kbd, Nbl, DkE, Drc, Mind Flayer,
1928 Imp, Glm, Skl, Zombie, Vampire, Spectre, Fairy, Beastman, Ent,
1929 Angel, Demon, Kutar, Android, Merfolk */
1932 { 100, 105, 105, 110, 113, 115, 120, 125, 100, 105, 100,
1933 124, 120, 110, 125, 115, 120, 120, 120, 120, 115, 120,
1934 115, 105, 125, 125, 125, 125, 105, 120, 105, 95, 140,
1935 100, 120, 110, 105, 110 },
1938 { 110, 100, 100, 105, 110, 120, 125, 130, 110, 100, 110,
1939 120, 115, 108, 115, 110, 110, 120, 120, 115, 115, 110,
1940 120, 110, 110, 110, 120, 110, 100, 125, 100, 95, 140,
1941 110, 115, 110, 110, 110 },
1944 { 110, 105, 100, 105, 110, 120, 125, 130, 110, 100, 110,
1945 120, 120, 105, 120, 110, 105, 125, 125, 110, 115, 108,
1946 120, 115, 110, 110, 120, 110, 100, 125, 100, 95, 140,
1947 110, 110, 105, 110, 110 },
1950 { 115, 110, 105, 95, 105, 110, 115, 130, 115, 105, 115,
1951 125, 120, 120, 125, 115, 110, 120, 120, 120, 115, 115,
1952 120, 110, 120, 120, 130, 110, 110, 130, 110, 95, 140,
1953 115, 120, 105, 115, 105 },
1956 { 115, 115, 110, 105, 95, 110, 115, 130, 115, 110, 115,
1957 120, 125, 110, 120, 110, 105, 120, 110, 110, 105, 110,
1958 120, 101, 110, 110, 120, 120, 115, 130, 115, 95, 140,
1959 115, 110, 110, 115, 110 },
1962 { 115, 120, 120, 110, 110, 95, 125, 135, 115, 120, 115,
1963 125, 140, 130, 130, 120, 115, 115, 115, 135, 125, 120,
1964 120, 105, 115, 115, 115, 115, 120, 130, 120, 95, 140,
1965 115, 110, 115, 115, 120 },
1968 { 115, 120, 125, 115, 115, 130, 110, 115, 115, 125, 115,
1969 110, 110, 120, 110, 120, 125, 115, 115, 110, 120, 110,
1970 115, 125, 120, 120, 115, 120, 125, 115, 125, 95, 140,
1971 115, 110, 115, 115, 125 },
1974 { 110, 115, 115, 110, 110, 130, 110, 110, 110, 115, 110,
1975 110, 115, 120, 110, 120, 120, 110, 110, 110, 115, 110,
1976 110, 115, 112, 112, 115, 112, 120, 110, 120, 95, 140,
1977 110, 110, 115, 110, 130 },
1980 { 100, 105, 105, 110, 113, 115, 120, 125, 100, 105, 100,
1981 120, 120, 105, 120, 115, 105, 115, 120, 110, 105, 105,
1982 120, 105, 120, 120, 125, 120, 105, 135, 105, 95, 140,
1983 100, 110, 110, 100, 110 },
1986 { 110, 105, 100, 105, 110, 120, 125, 130, 110, 100, 110,
1987 125, 125, 101, 120, 115, 110, 115, 125, 110, 110, 110,
1988 125, 115, 120, 120, 125, 120, 100, 125, 100, 95, 140,
1989 110, 110, 105, 110, 110 },
1991 /* Human / Barbarian (copied from human) */
1992 { 100, 105, 105, 110, 113, 115, 120, 125, 100, 105, 100,
1993 124, 120, 110, 125, 115, 120, 120, 120, 120, 115, 120,
1994 115, 105, 125, 125, 130, 125, 115, 120, 115, 95, 140,
1995 100, 120, 110, 100, 110 },
1997 /* Half-Ogre: theoretical, copied from half-troll */
1998 { 110, 115, 115, 110, 110, 130, 110, 110, 110, 115, 110,
1999 110, 115, 120, 110, 120, 120, 110, 110, 110, 115, 110,
2000 110, 115, 112, 112, 115, 112, 120, 110, 120, 95, 140,
2001 110, 110, 115, 110, 120 },
2003 /* Half-Giant: theoretical, copied from half-troll */
2004 { 110, 115, 115, 110, 110, 130, 110, 110, 110, 115, 110,
2005 110, 115, 120, 110, 120, 120, 110, 110, 110, 115, 110,
2006 110, 115, 112, 112, 115, 112, 130, 120, 130, 95, 140,
2007 110, 110, 115, 110, 115 },
2009 /* Half-Titan: theoretical, copied from High_Elf */
2010 { 110, 105, 100, 105, 110, 120, 125, 130, 110, 100, 110,
2011 125, 125, 101, 120, 115, 110, 115, 125, 110, 110, 110,
2012 125, 115, 120, 120, 120, 120, 130, 130, 130, 95, 140,
2013 110, 110, 115, 110, 108 },
2015 /* Cyclops: theoretical, copied from half-troll */
2016 { 110, 115, 115, 110, 110, 130, 110, 110, 110, 115, 110,
2017 110, 115, 120, 110, 120, 120, 110, 110, 110, 115, 110,
2018 110, 115, 112, 112, 115, 112, 130, 130, 130, 95, 140,
2019 110, 110, 115, 110, 115 },
2021 /* Yeek: theoretical, copied from Half-Orc */
2022 { 115, 120, 125, 115, 115, 130, 110, 115, 115, 125, 115,
2023 110, 110, 120, 110, 120, 125, 115, 115, 110, 120, 110,
2024 115, 125, 120, 120, 120, 120, 130, 130, 130, 95, 140,
2025 115, 110, 115, 115, 110 },
2027 /* Klackon: theoretical, copied from Gnome */
2028 { 115, 115, 110, 105, 95, 110, 115, 130, 115, 110, 115,
2029 120, 125, 110, 120, 110, 105, 120, 110, 110, 105, 110,
2030 120, 101, 110, 110, 120, 120, 130, 130, 130, 95, 140,
2031 115, 110, 115, 115, 110 },
2033 /* Kobold: theoretical, copied from Half-Orc */
2034 { 115, 120, 125, 115, 115, 130, 110, 115, 115, 125, 115,
2035 110, 110, 120, 110, 120, 125, 115, 115, 110, 120, 110,
2036 115, 125, 120, 120, 120, 120, 130, 130, 130, 95, 140,
2037 115, 110, 115, 115, 120 },
2039 /* Nibelung: theoretical, copied from Dwarf */
2040 { 115, 120, 120, 110, 110, 95, 125, 135, 115, 120, 115,
2041 125, 140, 130, 130, 120, 115, 115, 115, 135, 125, 120,
2042 120, 105, 115, 115, 120, 120, 130, 130, 130, 95, 140,
2043 115, 135, 115, 115, 120 },
2046 { 110, 110, 110, 115, 120, 130, 115, 115, 120, 110, 115,
2047 115, 115, 116, 115, 120, 120, 115, 115, 101, 110, 110,
2048 110, 110, 112, 122, 110, 110, 110, 115, 110, 120, 120,
2049 110, 101, 115, 110, 115 },
2051 /* Draconian: theoretical, copied from High_Elf */
2052 { 110, 105, 100, 105, 110, 120, 125, 130, 110, 100, 110,
2053 125, 125, 101, 120, 115, 110, 115, 125, 110, 110, 110,
2054 125, 115, 120, 120, 120, 120, 130, 130, 130, 95, 140,
2055 110, 110, 115, 110, 115 },
2057 /* Mind Flayer: theoretical, copied from High_Elf */
2058 { 110, 105, 100, 105, 110, 120, 125, 130, 110, 100, 110,
2059 125, 125, 101, 120, 115, 110, 115, 125, 110, 110, 110,
2060 125, 115, 120, 120, 120, 120, 130, 130, 130, 95, 140,
2061 110, 110, 115, 110, 110 },
2063 /* Imp: theoretical, copied from High_Elf */
2064 { 110, 105, 100, 105, 110, 120, 125, 130, 110, 100, 110,
2065 125, 125, 101, 120, 115, 110, 115, 125, 110, 110, 110,
2066 125, 115, 120, 120, 120, 120, 130, 130, 130, 120, 120,
2067 110, 110, 115, 110, 120 },
2069 /* Golem: theoretical, copied from High_Elf */
2070 { 110, 105, 100, 105, 110, 120, 125, 130, 110, 100, 110,
2071 125, 125, 101, 120, 115, 110, 115, 125, 110, 110, 110,
2072 125, 115, 120, 120, 120, 120, 130, 130, 130, 95, 140,
2073 110, 110, 115, 110, 110 },
2075 /* Skeleton: theoretical, copied from half-orc */
2076 { 115, 120, 125, 115, 115, 130, 110, 115, 115, 125, 115,
2077 110, 110, 120, 110, 120, 125, 115, 115, 110, 120, 110,
2078 115, 125, 120, 120, 120, 120, 130, 130, 130, 120, 120,
2079 115, 110, 125, 115, 110 },
2081 /* Zombie: Theoretical, copied from half-orc */
2082 { 115, 120, 125, 115, 115, 130, 110, 115, 115, 125, 115,
2083 110, 110, 120, 110, 120, 125, 115, 115, 110, 120, 110,
2084 115, 125, 120, 120, 120, 120, 130, 130, 130, 120, 120,
2085 115, 110, 125, 115, 110 },
2087 /* Vampire: Theoretical, copied from half-orc */
2088 { 115, 120, 125, 115, 115, 130, 110, 115, 115, 125, 115,
2089 110, 110, 120, 110, 120, 125, 115, 115, 110, 120, 110,
2090 115, 125, 120, 120, 120, 120, 130, 130, 130, 120, 120,
2091 115, 110, 125, 115, 120 },
2093 /* Spectre: Theoretical, copied from half-orc */
2094 { 115, 120, 125, 115, 115, 130, 110, 115, 115, 125, 115,
2095 110, 110, 120, 110, 120, 125, 115, 115, 110, 120, 110,
2096 115, 125, 120, 120, 120, 120, 130, 130, 130, 120, 120,
2097 115, 110, 125, 115, 110 },
2099 /* Sprite: Theoretical, copied from half-orc */
2100 { 115, 120, 125, 115, 115, 130, 110, 115, 115, 125, 115,
2101 110, 110, 120, 110, 120, 125, 115, 115, 110, 120, 110,
2102 115, 125, 120, 120, 120, 120, 130, 130, 130, 95, 140,
2103 115, 110, 105, 115, 110 },
2105 /* Beastman: Theoretical, copied from half-orc */
2106 { 115, 120, 125, 115, 115, 130, 110, 115, 115, 125, 115,
2107 110, 110, 120, 110, 120, 125, 115, 115, 110, 120, 110,
2108 115, 125, 120, 120, 120, 120, 130, 130, 130, 95, 140,
2109 115, 110, 115, 115, 125 },
2112 { 110, 105, 100, 105, 110, 120, 125, 130, 110, 100, 110,
2113 120, 120, 105, 120, 110, 105, 125, 125, 110, 115, 108,
2114 120, 115, 110, 110, 120, 110, 100, 125, 100, 95, 140,
2115 110, 110, 105, 110, 110 },
2118 { 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95,
2119 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95,
2120 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 160,
2121 95, 95, 95, 95, 95 },
2124 { 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, 140,
2125 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, 140,
2126 140, 140, 140, 140, 140, 140, 140, 140, 140, 160, 120,
2127 140, 140, 140, 140, 140 },
2130 { 100, 105, 105, 110, 113, 115, 120, 125, 100, 105, 100,
2131 124, 120, 110, 125, 115, 120, 120, 120, 120, 115, 120,
2132 115, 105, 125, 125, 125, 125, 105, 120, 105, 95, 140,
2133 100, 120, 110, 100, 110 },
2136 { 110, 110, 110, 115, 120, 130, 115, 115, 120, 110, 115,
2137 115, 115, 116, 115, 120, 120, 115, 115, 101, 110, 110,
2138 110, 110, 112, 122, 110, 110, 110, 115, 110, 120, 120,
2139 110, 101, 115, 110, 115 },
2142 { 110, 110, 105, 105, 110, 115, 115, 115, 110, 105, 110,
2143 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115,
2144 115, 115, 125, 125, 125, 125, 105, 115, 105, 95, 140,
2145 110, 115, 100, 110, 110 },
2148 { 105, 105, 105, 110, 113, 115, 120, 125, 100, 105, 100,
2149 124, 120, 110, 125, 115, 120, 120, 120, 120, 115, 120,
2150 115, 105, 125, 125, 125, 125, 105, 120, 105, 95, 140,
2151 100, 120, 110, 100, 110 },
2154 { 110, 110, 110, 105, 110, 120, 125, 130, 110, 110, 110,
2155 120, 115, 108, 115, 110, 110, 120, 120, 115, 115, 110,
2156 120, 110, 110, 110, 120, 110, 110, 125, 110, 95, 140,
2157 110, 115, 110, 110, 100 },
2163 * @brief 店舗価格を決定する /
2164 * Determine the price of an item (qty one) in a store.
2165 * @param o_ptr 店舗に並べるオブジェクト構造体の参照ポインタ
2166 * @param greed 店主の強欲度
2167 * @param flip TRUEならば店主にとっての買取価格、FALSEなら売出価格を計算
2171 * This function takes into account the player's charisma, and the
2172 * shop-keepers friendliness, and the shop-keeper's base greed, but
2173 * never lets a shop-keeper lose money in a transaction.
2174 * The "greed" value should exceed 100 when the player is "buying" the
2175 * item, and should be less than 100 when the player is "selling" it.
2176 * Hack -- the black market always charges twice as much as it should.
2177 * Charisma adjustment runs from 80 to 130
2178 * Racial adjustment runs from 95 to 130
2179 * Since greed/charisma/racial adjustments are centered at 100, we need
2180 * to adjust (by 200) to extract a usable multiplier. Note that the
2181 * "greed" value is always something (?).
2184 static s32b price_item(object_type *o_ptr, int greed, bool flip)
2191 /* Get the value of one of the items */
2192 price = object_value(o_ptr);
2194 /* Worthless items */
2195 if (price <= 0) return (0L);
2198 /* Compute the racial factor */
2199 factor = rgold_adj[ot_ptr->owner_race][p_ptr->prace];
2201 /* Add in the charisma factor */
2202 factor += adj_chr_gold[p_ptr->stat_ind[A_CHR]];
2205 /* Shop is buying */
2208 /* Adjust for greed */
2209 adjust = 100 + (300 - (greed + factor));
2211 /* Never get "silly" */
2212 if (adjust > 100) adjust = 100;
2214 /* Mega-Hack -- Black market sucks */
2215 if (cur_store_num == STORE_BLACK)
2218 /* Compute the final price (with rounding) */
2219 /* Hack -- prevent underflow */
2220 price = (price * adjust + 50L) / 100L;
2223 /* Shop is selling */
2226 /* Adjust for greed */
2227 adjust = 100 + ((greed + factor) - 300);
2229 /* Never get "silly" */
2230 if (adjust < 100) adjust = 100;
2232 /* Mega-Hack -- Black market sucks */
2233 if (cur_store_num == STORE_BLACK)
2236 /* Compute the final price (with rounding) */
2237 /* Hack -- prevent overflow */
2238 price = (s32b)(((u32b)price * (u32b)adjust + 50UL) / 100UL);
2241 /* Note -- Never become "free" */
2242 if (price <= 0L) return (1L);
2244 /* Return the price */
2250 * @brief 安価な消耗品の販売数を増やし、低確率で割引にする /
2251 * Certain "cheap" objects should be created in "piles"
2252 * @param o_ptr 店舗に並べるオブジェクト構造体の参照ポインタ
2256 * Some objects can be sold at a "discount" (in small piles)
2259 static void mass_produce(object_type *o_ptr)
2262 DISCOUNT_RATE discount = 0;
2264 PRICE cost = object_value(o_ptr);
2267 /* Analyze the type */
2268 switch (o_ptr->tval)
2270 /* Food, Flasks, and Lites */
2275 if (cost <= 5L) size += damroll(3, 5);
2276 if (cost <= 20L) size += damroll(3, 5);
2277 if (cost <= 50L) size += damroll(2, 2);
2284 if (cost <= 60L) size += damroll(3, 5);
2285 if (cost <= 240L) size += damroll(1, 5);
2286 if (o_ptr->sval == SV_SCROLL_STAR_IDENTIFY) size += damroll(3, 5);
2287 if (o_ptr->sval == SV_SCROLL_STAR_REMOVE_CURSE) size += damroll(1, 4);
2292 case TV_SORCERY_BOOK:
2293 case TV_NATURE_BOOK:
2297 case TV_ARCANE_BOOK:
2299 case TV_DAEMON_BOOK:
2300 case TV_CRUSADE_BOOK:
2302 case TV_HISSATSU_BOOK:
2305 if (cost <= 50L) size += damroll(2, 3);
2306 if (cost <= 500L) size += damroll(1, 3);
2324 if (object_is_artifact(o_ptr)) break;
2325 if (object_is_ego(o_ptr)) break;
2326 if (cost <= 10L) size += damroll(3, 5);
2327 if (cost <= 100L) size += damroll(3, 5);
2336 if (cost <= 5L) size += damroll(5, 5);
2337 if (cost <= 50L) size += damroll(5, 5);
2338 if (cost <= 500L) size += damroll(5, 5);
2344 if (cost <= 100L) size += damroll(2, 2);
2345 if (cost <= 1000L) size += damroll(2, 2);
2358 * Because many rods (and a few wands and staffs) are useful mainly
2359 * in quantity, the Black Market will occasionally have a bunch of
2366 if ((cur_store_num == STORE_BLACK) && one_in_(3))
2368 if (cost < 1601L) size += damroll(1, 5);
2369 else if (cost < 3201L) size += damroll(1, 3);
2376 /* Pick a discount */
2381 else if (one_in_(25))
2385 else if (one_in_(150))
2389 else if (one_in_(300))
2393 else if (one_in_(500))
2398 if (o_ptr->art_name)
2403 /* Save the discount */
2404 o_ptr->discount = discount;
2406 /* Save the total pile size */
2407 o_ptr->number = size - (size * discount / 100);
2409 /* Ensure that mass-produced rods and wands get the correct pvals. */
2410 if ((o_ptr->tval == TV_ROD) || (o_ptr->tval == TV_WAND))
2412 o_ptr->pval *= (PARAMETER_VALUE)o_ptr->number;
2419 * @brief 店舗に並べた品を同一品であるかどうか判定する /
2420 * Determine if a store item can "absorb" another item
2421 * @param o_ptr 判定するオブジェクト構造体の参照ポインタ1
2422 * @param j_ptr 判定するオブジェクト構造体の参照ポインタ2
2423 * @return 同一扱いできるならTRUEを返す
2426 * See "object_similar()" for the same function for the "player"
2429 static bool store_object_similar(object_type *o_ptr, object_type *j_ptr)
2433 /* Hack -- Identical items cannot be stacked */
2434 if (o_ptr == j_ptr) return (0);
2436 /* Different objects cannot be stacked */
2437 if (o_ptr->k_idx != j_ptr->k_idx) return (0);
2439 /* Different charges (etc) cannot be stacked, unless wands or rods. */
2440 if ((o_ptr->pval != j_ptr->pval) && (o_ptr->tval != TV_WAND) && (o_ptr->tval != TV_ROD)) return (0);
2442 /* Require many identical values */
2443 if (o_ptr->to_h != j_ptr->to_h) return (0);
2444 if (o_ptr->to_d != j_ptr->to_d) return (0);
2445 if (o_ptr->to_a != j_ptr->to_a) return (0);
2447 /* Require identical "ego-item" names */
2448 if (o_ptr->name2 != j_ptr->name2) return (0);
2450 /* Artifacts don't stack! */
2451 if (object_is_artifact(o_ptr) || object_is_artifact(j_ptr)) return (0);
2453 /* Hack -- Identical art_flags! */
2454 for (i = 0; i < TR_FLAG_SIZE; i++)
2455 if (o_ptr->art_flags[i] != j_ptr->art_flags[i]) return (0);
2457 /* Hack -- Never stack "powerful" items */
2458 if (o_ptr->xtra1 || j_ptr->xtra1) return (0);
2460 /* Hack -- Never stack recharging items */
2461 if (o_ptr->timeout || j_ptr->timeout) return (0);
2463 /* Require many identical values */
2464 if (o_ptr->ac != j_ptr->ac) return (0);
2465 if (o_ptr->dd != j_ptr->dd) return (0);
2466 if (o_ptr->ds != j_ptr->ds) return (0);
2468 /* Hack -- Never stack chests */
2469 if (o_ptr->tval == TV_CHEST) return (0);
2470 if (o_ptr->tval == TV_STATUE) return (0);
2471 if (o_ptr->tval == TV_CAPTURE) return (0);
2473 /* Require matching discounts */
2474 if (o_ptr->discount != j_ptr->discount) return (0);
2476 /* They match, so they must be similar */
2482 * @brief 店舗に並べた品を重ね合わせできるかどうか判定する /
2483 * Allow a store item to absorb another item
2484 * @param o_ptr 判定するオブジェクト構造体の参照ポインタ1
2485 * @param j_ptr 判定するオブジェクト構造体の参照ポインタ2
2486 * @return 重ね合わせできるならTRUEを返す
2489 * See "object_similar()" for the same function for the "player"
2492 static void store_object_absorb(object_type *o_ptr, object_type *j_ptr)
2494 int max_num = (o_ptr->tval == TV_ROD) ?
2495 MIN(99, MAX_SHORT / k_info[o_ptr->k_idx].pval) : 99;
2496 int total = o_ptr->number + j_ptr->number;
2497 int diff = (total > max_num) ? total - max_num : 0;
2499 /* Combine quantity, lose excess items */
2500 o_ptr->number = (total > max_num) ? max_num : total;
2502 /* Hack -- if rods are stacking, add the pvals (maximum timeouts) together. -LM- */
2503 if (o_ptr->tval == TV_ROD)
2505 o_ptr->pval += j_ptr->pval * (j_ptr->number - diff) / j_ptr->number;
2508 /* Hack -- if wands are stacking, combine the charges. -LM- */
2509 if (o_ptr->tval == TV_WAND)
2511 o_ptr->pval += j_ptr->pval * (j_ptr->number - diff) / j_ptr->number;
2517 * @brief 店舗に品を置くスペースがあるかどうかの判定を返す /
2518 * Check to see if the shop will be carrying too many objects -RAK-
2519 * @param o_ptr 店舗に置きたいオブジェクト構造体の参照ポインタ
2520 * @return 置き場がないなら0、重ね合わせできるアイテムがあるなら-1、スペースがあるなら1を返す。
2523 * Note that the shop, just like a player, will not accept things
2524 * it cannot hold. Before, one could "nuke" potions this way.
2525 * Return value is now int:
2527 * -1 : Can be combined to existing slot.
2528 * 1 : Cannot be combined but there are empty spaces.
2531 static int store_check_num(object_type *o_ptr)
2536 /* The "home" acts like the player */
2537 if ((cur_store_num == STORE_HOME) || (cur_store_num == STORE_MUSEUM))
2539 bool old_stack_force_notes = stack_force_notes;
2540 bool old_stack_force_costs = stack_force_costs;
2542 if (cur_store_num != STORE_HOME)
2544 stack_force_notes = FALSE;
2545 stack_force_costs = FALSE;
2548 /* Check all the items */
2549 for (i = 0; i < st_ptr->stock_num; i++)
2551 /* Get the existing item */
2552 j_ptr = &st_ptr->stock[i];
2554 /* Can the new object be combined with the old one? */
2555 if (object_similar(j_ptr, o_ptr))
2557 if (cur_store_num != STORE_HOME)
2559 stack_force_notes = old_stack_force_notes;
2560 stack_force_costs = old_stack_force_costs;
2567 if (cur_store_num != STORE_HOME)
2569 stack_force_notes = old_stack_force_notes;
2570 stack_force_costs = old_stack_force_costs;
2574 /* Normal stores do special stuff */
2577 /* Check all the items */
2578 for (i = 0; i < st_ptr->stock_num; i++)
2580 /* Get the existing item */
2581 j_ptr = &st_ptr->stock[i];
2583 /* Can the new object be combined with the old one? */
2584 if (store_object_similar(j_ptr, o_ptr)) return -1;
2588 /* Free space is always usable */
2590 * オプション powerup_home が設定されていると
2593 if ((cur_store_num == STORE_HOME) && ( powerup_home == FALSE )) {
2594 if (st_ptr->stock_num < ((st_ptr->stock_size) / 10)) {
2599 if (st_ptr->stock_num < st_ptr->stock_size) {
2604 /* But there was no room at the inn... */
2609 * @brief オブジェクトが祝福されているかの判定を返す /
2610 * @param o_ptr 判定したいオブジェクト構造体の参照ポインタ
2611 * @return アイテムが祝福されたアイテムならばTRUEを返す
2613 static bool is_blessed(object_type *o_ptr)
2615 BIT_FLAGS flgs[TR_FLAG_SIZE];
2616 object_flags(o_ptr, flgs);
2617 if (have_flag(flgs, TR_BLESSED)) return (TRUE);
2618 else return (FALSE);
2624 * @brief オブジェクトが所定の店舗で引き取れるかどうかを返す /
2625 * Determine if the current store will purchase the given item
2626 * @param o_ptr 判定したいオブジェクト構造体の参照ポインタ
2627 * @return アイテムが買い取れるならばTRUEを返す
2629 * Note that a shop-keeper must refuse to buy "worthless" items
2631 static bool store_will_buy(object_type *o_ptr)
2633 /* Hack -- The Home is simple */
2634 if ((cur_store_num == STORE_HOME) || (cur_store_num == STORE_MUSEUM)) return (TRUE);
2636 /* Switch on the store */
2637 switch (cur_store_num)
2642 /* Analyze the type */
2643 switch (o_ptr->tval)
2646 if (o_ptr->sval != SV_POTION_WATER) return FALSE;
2658 case TV_BOTTLE: /* 'Green', recycling Angband */
2673 /* Analyze the type */
2674 switch (o_ptr->tval)
2695 /* Analyze the type */
2696 switch (o_ptr->tval)
2705 case TV_HISSATSU_BOOK:
2709 if(o_ptr->sval == SV_WIZSTAFF) return (FALSE);
2721 /* Analyze the type */
2722 switch (o_ptr->tval)
2725 case TV_CRUSADE_BOOK:
2735 monster_race *r_ptr = &r_info[o_ptr->pval];
2738 if (!(r_ptr->flags3 & RF3_EVIL))
2741 if (r_ptr->flags3 & RF3_GOOD) break;
2743 /* Accept animals */
2744 if (r_ptr->flags3 & RF3_ANIMAL) break;
2747 if (my_strchr("?!", r_ptr->d_char)) break;
2753 if (is_blessed(o_ptr)) break;
2762 case STORE_ALCHEMIST:
2764 /* Analyze the type */
2765 switch (o_ptr->tval)
2779 /* Analyze the type */
2780 switch (o_ptr->tval)
2782 case TV_SORCERY_BOOK:
2783 case TV_NATURE_BOOK:
2787 case TV_ARCANE_BOOK:
2789 case TV_DAEMON_BOOK:
2803 if(o_ptr->sval == SV_WIZSTAFF) break;
2804 else return (FALSE);
2811 /* Bookstore Shop */
2814 /* Analyze the type */
2815 switch (o_ptr->tval)
2817 case TV_SORCERY_BOOK:
2818 case TV_NATURE_BOOK:
2823 case TV_ARCANE_BOOK:
2825 case TV_DAEMON_BOOK:
2826 case TV_CRUSADE_BOOK:
2837 /* Ignore "worthless" items */
2838 if (object_value(o_ptr) <= 0) return (FALSE);
2846 * @brief 現在の町の指定された店舗のアイテムを整理する /
2847 * Combine and reorder items in store.
2848 * @param store_num 店舗ID
2849 * @return 実際に整理が行われたならばTRUEを返す。
2851 bool combine_and_reorder_home(int store_num)
2855 object_type forge, *o_ptr, *j_ptr;
2856 bool flag = FALSE, combined;
2857 store_type *old_st_ptr = st_ptr;
2858 bool old_stack_force_notes = stack_force_notes;
2859 bool old_stack_force_costs = stack_force_costs;
2861 st_ptr = &town_info[1].store[store_num];
2862 if (store_num != STORE_HOME)
2864 stack_force_notes = FALSE;
2865 stack_force_costs = FALSE;
2872 /* Combine the items in the home (backwards) */
2873 for (i = st_ptr->stock_num - 1; i > 0; i--)
2875 o_ptr = &st_ptr->stock[i];
2877 /* Skip empty items */
2878 if (!o_ptr->k_idx) continue;
2880 /* Scan the items above that item */
2881 for (j = 0; j < i; j++)
2885 j_ptr = &st_ptr->stock[j];
2887 /* Skip empty items */
2888 if (!j_ptr->k_idx) continue;
2891 * Get maximum number of the stack if these
2892 * are similar, get zero otherwise.
2894 max_num = object_similar_part(j_ptr, o_ptr);
2896 /* Can we (partialy) drop "o_ptr" onto "j_ptr"? */
2897 if (max_num && j_ptr->number < max_num)
2899 if (o_ptr->number + j_ptr->number <= max_num)
2901 /* Add together the item counts */
2902 object_absorb(j_ptr, o_ptr);
2904 /* One object is gone */
2905 st_ptr->stock_num--;
2907 /* Slide everything down */
2908 for (k = i; k < st_ptr->stock_num; k++)
2910 /* Structure copy */
2911 st_ptr->stock[k] = st_ptr->stock[k + 1];
2914 /* Erase the "final" slot */
2915 object_wipe(&st_ptr->stock[k]);
2919 ITEM_NUMBER old_num = o_ptr->number;
2920 ITEM_NUMBER remain = j_ptr->number + o_ptr->number - max_num;
2922 /* Add together the item counts */
2923 object_absorb(j_ptr, o_ptr);
2925 o_ptr->number = remain;
2927 /* Hack -- if rods are stacking, add the pvals (maximum timeouts) and current timeouts together. -LM- */
2928 if (o_ptr->tval == TV_ROD)
2930 o_ptr->pval = o_ptr->pval * remain / old_num;
2931 o_ptr->timeout = o_ptr->timeout * remain / old_num;
2934 /* Hack -- if wands are stacking, combine the charges. -LM- */
2935 else if (o_ptr->tval == TV_WAND)
2937 o_ptr->pval = o_ptr->pval * remain / old_num;
2952 /* Re-order the items in the home (forwards) */
2953 for (i = 0; i < st_ptr->stock_num; i++)
2955 o_ptr = &st_ptr->stock[i];
2957 /* Skip empty slots */
2958 if (!o_ptr->k_idx) continue;
2960 /* Get the "value" of the item */
2961 o_value = object_value(o_ptr);
2963 /* Scan every occupied slot */
2964 for (j = 0; j < st_ptr->stock_num; j++)
2966 if (object_sort_comp(o_ptr, o_value, &st_ptr->stock[j])) break;
2969 /* Never move down */
2970 if (j >= i) continue;
2976 /* Save a copy of the moving item */
2977 object_copy(j_ptr, &st_ptr->stock[i]);
2979 /* Slide the objects */
2980 for (k = i; k > j; k--)
2982 /* Slide the item */
2983 object_copy(&st_ptr->stock[k], &st_ptr->stock[k - 1]);
2986 /* Insert the moving item */
2987 object_copy(&st_ptr->stock[j], j_ptr);
2990 st_ptr = old_st_ptr;
2991 if (store_num != STORE_HOME)
2993 stack_force_notes = old_stack_force_notes;
2994 stack_force_costs = old_stack_force_costs;
3002 * @brief 我が家にオブジェクトを加える /
3003 * Add the item "o_ptr" to the inventory of the "Home"
3004 * @param o_ptr 加えたいオブジェクトの構造体参照ポインタ
3008 * In all cases, return the slot (or -1) where the object was placed
3009 * Note that this is a hacked up version of "inven_carry()".
3010 * Also note that it may not correctly "adapt" to "knowledge" bacoming
3011 * known, the player may have to pick stuff up and drop it again.
3014 static int home_carry(object_type *o_ptr)
3020 bool old_stack_force_notes = stack_force_notes;
3021 bool old_stack_force_costs = stack_force_costs;
3023 if (cur_store_num != STORE_HOME)
3025 stack_force_notes = FALSE;
3026 stack_force_costs = FALSE;
3029 /* Check each existing item (try to combine) */
3030 for (slot = 0; slot < st_ptr->stock_num; slot++)
3032 /* Get the existing item */
3033 j_ptr = &st_ptr->stock[slot];
3035 /* The home acts just like the player */
3036 if (object_similar(j_ptr, o_ptr))
3038 /* Save the new number of items */
3039 object_absorb(j_ptr, o_ptr);
3041 if (cur_store_num != STORE_HOME)
3043 stack_force_notes = old_stack_force_notes;
3044 stack_force_costs = old_stack_force_costs;
3052 if (cur_store_num != STORE_HOME)
3054 stack_force_notes = old_stack_force_notes;
3055 stack_force_costs = old_stack_force_costs;
3060 * 隠し機能: オプション powerup_home が設定されていると
3064 if ((cur_store_num != STORE_HOME) || (powerup_home == TRUE)) {
3065 if (st_ptr->stock_num >= st_ptr->stock_size) {
3070 if (st_ptr->stock_num >= ((st_ptr->stock_size) / 10)) {
3076 /* Determine the "value" of the item */
3077 value = object_value(o_ptr);
3079 /* Check existing slots to see if we must "slide" */
3080 for (slot = 0; slot < st_ptr->stock_num; slot++)
3082 if (object_sort_comp(o_ptr, value, &st_ptr->stock[slot])) break;
3085 /* Slide the others up */
3086 for (i = st_ptr->stock_num; i > slot; i--)
3088 st_ptr->stock[i] = st_ptr->stock[i-1];
3091 /* More stuff now */
3092 st_ptr->stock_num++;
3094 /* Insert the new item */
3095 st_ptr->stock[slot] = *o_ptr;
3097 chg_virtue(V_SACRIFICE, -1);
3099 (void)combine_and_reorder_home(cur_store_num);
3101 /* Return the location */
3107 * @brief 店舗にオブジェクトを加える /
3108 * Add the item "o_ptr" to a real stores inventory.
3109 * @param o_ptr 加えたいオブジェクトの構造体参照ポインタ
3113 * In all cases, return the slot (or -1) where the object was placed
3114 * Note that this is a hacked up version of "inven_carry()".
3115 * Also note that it may not correctly "adapt" to "knowledge" bacoming
3116 * known, the player may have to pick stuff up and drop it again.
3119 static int store_carry(object_type *o_ptr)
3122 PRICE value, j_value;
3126 /* Evaluate the object */
3127 value = object_value(o_ptr);
3129 /* Cursed/Worthless items "disappear" when sold */
3130 if (value <= 0) return (-1);
3132 /* All store items are fully *identified* */
3133 o_ptr->ident |= IDENT_MENTAL;
3135 /* Erase the inscription */
3136 o_ptr->inscription = 0;
3138 /* Erase the "feeling" */
3139 o_ptr->feeling = FEEL_NONE;
3141 /* Check each existing item (try to combine) */
3142 for (slot = 0; slot < st_ptr->stock_num; slot++)
3144 /* Get the existing item */
3145 j_ptr = &st_ptr->stock[slot];
3147 /* Can the existing items be incremented? */
3148 if (store_object_similar(j_ptr, o_ptr))
3150 /* Hack -- extra items disappear */
3151 store_object_absorb(j_ptr, o_ptr);
3159 if (st_ptr->stock_num >= st_ptr->stock_size) return (-1);
3162 /* Check existing slots to see if we must "slide" */
3163 for (slot = 0; slot < st_ptr->stock_num; slot++)
3166 j_ptr = &st_ptr->stock[slot];
3168 /* Objects sort by decreasing type */
3169 if (o_ptr->tval > j_ptr->tval) break;
3170 if (o_ptr->tval < j_ptr->tval) continue;
3172 /* Objects sort by increasing sval */
3173 if (o_ptr->sval < j_ptr->sval) break;
3174 if (o_ptr->sval > j_ptr->sval) continue;
3177 * Hack: otherwise identical rods sort by
3178 * increasing recharge time --dsb
3180 if (o_ptr->tval == TV_ROD)
3182 if (o_ptr->pval < j_ptr->pval) break;
3183 if (o_ptr->pval > j_ptr->pval) continue;
3186 /* Evaluate that slot */
3187 j_value = object_value(j_ptr);
3189 /* Objects sort by decreasing value */
3190 if (value > j_value) break;
3191 if (value < j_value) continue;
3194 /* Slide the others up */
3195 for (i = st_ptr->stock_num; i > slot; i--)
3197 st_ptr->stock[i] = st_ptr->stock[i-1];
3200 /* More stuff now */
3201 st_ptr->stock_num++;
3203 /* Insert the new item */
3204 st_ptr->stock[slot] = *o_ptr;
3206 /* Return the location */
3212 * @brief 店舗のオブジェクト数を増やす /
3213 * Add the item "o_ptr" to a real stores inventory.
3214 * @param item 増やしたいアイテムのID
3219 * Increase, by a given amount, the number of a certain item
3220 * in a certain store. This can result in zero items.
3222 * @todo numは本来ITEM_NUMBER型にしたい。
3224 static void store_item_increase(INVENTORY_IDX item, int num)
3229 o_ptr = &st_ptr->stock[item];
3231 /* Verify the number */
3232 cnt = o_ptr->number + num;
3233 if (cnt > 255) cnt = 255;
3234 else if (cnt < 0) cnt = 0;
3235 num = cnt - o_ptr->number;
3237 /* Save the new number */
3238 o_ptr->number += (ITEM_NUMBER)num;
3243 * @brief 店舗のオブジェクト数を削除する /
3244 * Remove a slot if it is empty
3245 * @param item 削除したいアイテムのID
3248 static void store_item_optimize(INVENTORY_IDX item)
3253 o_ptr = &st_ptr->stock[item];
3256 if (!o_ptr->k_idx) return;
3258 /* Must have no items */
3259 if (o_ptr->number) return;
3262 st_ptr->stock_num--;
3264 /* Slide everyone */
3265 for (j = item; j < st_ptr->stock_num; j++)
3267 st_ptr->stock[j] = st_ptr->stock[j + 1];
3270 /* Nuke the final slot */
3271 object_wipe(&st_ptr->stock[j]);
3275 * @brief ブラックマーケット用の無価値品の排除判定 /
3276 * This function will keep 'crap' out of the black market.
3277 * @param o_ptr 判定したいオブジェクトの構造体参照ポインタ
3278 * @return ブラックマーケットにとって無価値な品ならばTRUEを返す
3281 * Crap is defined as any item that is "available" elsewhere
3282 * Based on a suggestion by "Lee Vogt" <lvogt@cig.mcel.mot.com>
3285 static bool black_market_crap(object_type *o_ptr)
3289 /* Ego items are never crap */
3290 if (object_is_ego(o_ptr)) return (FALSE);
3292 /* Good items are never crap */
3293 if (o_ptr->to_a > 0) return (FALSE);
3294 if (o_ptr->to_h > 0) return (FALSE);
3295 if (o_ptr->to_d > 0) return (FALSE);
3297 /* Check all stores */
3298 for (i = 0; i < MAX_STORES; i++)
3300 if (i == STORE_HOME) continue;
3301 if (i == STORE_MUSEUM) continue;
3303 /* Check every item in the store */
3304 for (j = 0; j < town_info[p_ptr->town_num].store[i].stock_num; j++)
3306 object_type *j_ptr = &town_info[p_ptr->town_num].store[i].stock[j];
3308 /* Duplicate item "type", assume crappy */
3309 if (o_ptr->k_idx == j_ptr->k_idx) return (TRUE);
3319 * @brief 店舗の品揃え変化のためにアイテムを削除する /
3320 * Attempt to delete (some of) a random item from the store
3324 * Hack -- we attempt to "maintain" piles of items when possible.
3327 static void store_delete(void)
3332 /* Pick a random slot */
3333 what = (INVENTORY_IDX)randint0(st_ptr->stock_num);
3335 /* Determine how many items are here */
3336 num = st_ptr->stock[what].number;
3338 /* Hack -- sometimes, only destroy half the items */
3339 if (randint0(100) < 50) num = (num + 1) / 2;
3341 /* Hack -- sometimes, only destroy a single item */
3342 if (randint0(100) < 50) num = 1;
3344 /* Hack -- decrement the maximum timeouts and total charges of rods and wands. -LM- */
3345 if ((st_ptr->stock[what].tval == TV_ROD) || (st_ptr->stock[what].tval == TV_WAND))
3347 st_ptr->stock[what].pval -= num * st_ptr->stock[what].pval / st_ptr->stock[what].number;
3350 /* Actually destroy (part of) the item */
3351 store_item_increase(what, -num);
3352 store_item_optimize(what);
3357 * @brief 店舗の品揃え変化のためにアイテムを追加する /
3358 * Creates a random item and gives it to a store
3362 * This algorithm needs to be rethought. A lot.
3363 * Currently, "normal" stores use a pre-built array.
3364 * Note -- the "level" given to "obj_get_num()" is a "favored"
3365 * level, that is, there is a much higher chance of getting
3366 * items with a level approaching that of the given level...
3367 * Should we check for "permission" to have the given item?
3370 static void store_create(void)
3380 /* Paranoia -- no room left */
3381 if (st_ptr->stock_num >= st_ptr->stock_size) return;
3384 /* Hack -- consider up to four items */
3385 for (tries = 0; tries < 4; tries++)
3388 if (cur_store_num == STORE_BLACK)
3390 /* Pick a level for object/magic */
3391 level = 25 + randint0(25);
3393 /* Random item (usually of given level) */
3394 i = get_obj_num(level);
3396 /* Handle failure */
3403 /* Hack -- Pick an item to sell */
3404 i = st_ptr->table[randint0(st_ptr->table_num)];
3406 /* Hack -- fake level for apply_magic() */
3407 level = rand_range(1, STORE_OBJ_LEVEL);
3412 /* Create a new object of the chosen kind */
3413 object_prep(q_ptr, i);
3415 /* Apply some "low-level" magic (no artifacts) */
3416 apply_magic(q_ptr, level, AM_NO_FIXED_ART);
3418 /* Require valid object */
3419 if (!store_will_buy(q_ptr)) continue;
3421 /* Hack -- Charge lite's */
3422 if (q_ptr->tval == TV_LITE)
3424 if (q_ptr->sval == SV_LITE_TORCH) q_ptr->xtra4 = FUEL_TORCH / 2;
3425 if (q_ptr->sval == SV_LITE_LANTERN) q_ptr->xtra4 = FUEL_LAMP / 2;
3429 /* The item is "known" */
3430 object_known(q_ptr);
3432 /* Mark it storebought */
3433 q_ptr->ident |= IDENT_STORE;
3435 /* Mega-Hack -- no chests in stores */
3436 if (q_ptr->tval == TV_CHEST) continue;
3438 /* Prune the black market */
3439 if (cur_store_num == STORE_BLACK)
3441 /* Hack -- No "crappy" items */
3442 if (black_market_crap(q_ptr)) continue;
3444 /* Hack -- No "cheap" items */
3445 if (object_value(q_ptr) < 10) continue;
3447 /* No "worthless" items */
3448 /* if (object_value(q_ptr) <= 0) continue; */
3451 /* Prune normal stores */
3454 /* No "worthless" items */
3455 if (object_value(q_ptr) <= 0) continue;
3459 /* Mass produce and/or Apply discount */
3460 mass_produce(q_ptr);
3462 /* Attempt to carry the (known) item */
3463 (void)store_carry(q_ptr);
3465 /* Definitely done */
3472 * @brief 店舗の割引対象外にするかどうかを判定 /
3473 * Eliminate need to bargain if player has haggled well in the past
3474 * @param minprice アイテムの最低販売価格
3475 * @return 割引を禁止するならTRUEを返す。
3477 static bool noneedtobargain(PRICE minprice)
3479 PRICE good = st_ptr->good_buy;
3480 PRICE bad = st_ptr->bad_buy;
3482 /* Cheap items are "boring" */
3483 if (minprice < 10L) return (TRUE);
3485 /* Perfect haggling */
3486 if (good == MAX_SHORT) return (TRUE);
3488 /* Reward good haggles, punish bad haggles, notice price */
3489 if (good > ((3 * bad) + (5 + (minprice/50)))) return (TRUE);
3491 /* Return the flag */
3497 * @brief 店主の持つプレイヤーに対する売買の良し悪し経験を記憶する /
3498 * Update the bargain info
3499 * @param price 実際の取引価格
3500 * @param minprice 店主の提示した価格
3504 static void updatebargain(PRICE price, PRICE minprice, int num)
3506 /* Hack -- auto-haggle */
3507 if (!manual_haggle) return;
3509 /* Cheap items are "boring" */
3510 if ((minprice/num) < 10L) return;
3512 /* Count the successful haggles */
3513 if (price == minprice)
3515 /* Just count the good haggles */
3516 if (st_ptr->good_buy < MAX_SHORT)
3522 /* Count the failed haggles */
3525 /* Just count the bad haggles */
3526 if (st_ptr->bad_buy < MAX_SHORT)
3535 * @brief 店の商品リストを再表示する /
3536 * Re-displays a single store entry
3540 static void display_entry(int pos)
3546 GAME_TEXT o_name[MAX_NLEN];
3551 o_ptr = &st_ptr->stock[pos];
3553 /* Get the "offset" */
3554 i = (pos % store_bottom);
3556 /* Label it, clear the line --(-- */
3557 (void)sprintf(out_val, "%c) ", ((i > 25) ? toupper(I2A(i - 26)) : I2A(i)));
3558 prt(out_val, i+6, 0);
3561 if (show_item_graph)
3563 TERM_COLOR a = object_attr(o_ptr);
3564 SYMBOL_CODE c = object_char(o_ptr);
3566 Term_queue_bigchar(cur_col, i + 6, a, c, 0, 0);
3567 if (use_bigtile) cur_col++;
3572 /* Describe an item in the home */
3573 if ((cur_store_num == STORE_HOME) || (cur_store_num == STORE_MUSEUM))
3577 /* Leave room for weights, if necessary -DRS- */
3578 if (show_weights) maxwid -= 10;
3580 object_desc(o_name, o_ptr, 0);
3581 o_name[maxwid] = '\0';
3582 c_put_str(tval_to_attr[o_ptr->tval], o_name, i+6, cur_col);
3587 /* Only show the weight of an individual item */
3588 WEIGHT wgt = o_ptr->weight;
3590 sprintf(out_val, "%3d.%1d kg", lbtokg1(wgt) , lbtokg2(wgt));
3591 put_str(out_val, i+6, 67);
3593 (void)sprintf(out_val, "%3d.%d lb", wgt / 10, wgt % 10);
3594 put_str(out_val, i+6, 68);
3600 /* Describe an item (fully) in a store */
3603 /* Must leave room for the "price" */
3606 /* Leave room for weights, if necessary -DRS- */
3607 if (show_weights) maxwid -= 7;
3609 /* Describe the object (fully) */
3610 object_desc(o_name, o_ptr, 0);
3611 o_name[maxwid] = '\0';
3612 c_put_str(tval_to_attr[o_ptr->tval], o_name, i+6, cur_col);
3617 /* Only show the weight of an individual item */
3618 int wgt = o_ptr->weight;
3620 sprintf(out_val, "%3d.%1d", lbtokg1(wgt) , lbtokg2(wgt) );
3621 put_str(out_val, i+6, 60);
3623 (void)sprintf(out_val, "%3d.%d", wgt / 10, wgt % 10);
3624 put_str(out_val, i+6, 61);
3629 /* Display a "fixed" cost */
3630 if (o_ptr->ident & (IDENT_FIXED))
3632 /* Extract the "minimum" price */
3633 x = price_item(o_ptr, ot_ptr->min_inflate, FALSE);
3635 /* Actually draw the price (not fixed) */
3637 (void)sprintf(out_val, "%9ld固", (long)x);
3639 (void)sprintf(out_val, "%9ld F", (long)x);
3641 put_str(out_val, i+6, 68);
3644 /* Display a "taxed" cost */
3645 else if (!manual_haggle)
3647 /* Extract the "minimum" price */
3648 x = price_item(o_ptr, ot_ptr->min_inflate, FALSE);
3650 /* Hack -- Apply Sales Tax if needed */
3651 if (!noneedtobargain(x)) x += x / 10;
3653 /* Actually draw the price (with tax) */
3654 (void)sprintf(out_val, "%9ld ", (long)x);
3655 put_str(out_val, i+6, 68);
3658 /* Display a "haggle" cost */
3661 /* Extrect the "maximum" price */
3662 x = price_item(o_ptr, ot_ptr->max_inflate, FALSE);
3664 /* Actually draw the price (not fixed) */
3665 (void)sprintf(out_val, "%9ld ", (long)x);
3666 put_str(out_val, i+6, 68);
3673 * @brief 店の商品リストを表示する /
3674 * Displays a store's inventory -RAK-
3677 * All prices are listed as "per individual object". -BEN-
3679 static void display_inventory(void)
3683 /* Display the next 12 items */
3684 for (k = 0; k < store_bottom; k++)
3686 /* Do not display "dead" items */
3687 if (store_top + k >= st_ptr->stock_num) break;
3689 /* Display that line */
3690 display_entry(store_top + k);
3693 /* Erase the extra lines and the "more" prompt */
3694 for (i = k; i < store_bottom + 1; i++) prt("", i + 6, 0);
3696 /* Assume "no current page" */
3698 put_str(" ", 5, 20);
3700 put_str(" ", 5, 20);
3704 /* Visual reminder of "more items" */
3705 if (st_ptr->stock_num > store_bottom)
3707 /* Show "more" reminder (after the last item) */
3708 prt(_("-続く-", "-more-"), k + 6, 3);
3710 /* Indicate the "current page" */
3711 /* Trailing spaces are to display (Page xx) and (Page x) */
3712 put_str(format(_("(%dページ) ", "(Page %d) "), store_top/store_bottom + 1), 5, 20);
3715 if (cur_store_num == STORE_HOME || cur_store_num == STORE_MUSEUM)
3717 k = st_ptr->stock_size;
3719 if (cur_store_num == STORE_HOME && !powerup_home) k /= 10;
3721 put_str(format("アイテム数: %4d/%4d", st_ptr->stock_num, k), 19 + xtra_stock, 27);
3723 put_str(format("Objects: %4d/%4d", st_ptr->stock_num, k), 19 + xtra_stock, 30);
3730 * @brief プレイヤーの所持金を表示する /
3731 * Displays players gold -RAK-
3735 static void store_prt_gold(void)
3739 prt(_("手持ちのお金: ", "Gold Remaining: "), 19 + xtra_stock, 53);
3740 sprintf(out_val, "%9ld", (long)p_ptr->au);
3741 prt(out_val, 19 + xtra_stock, 68);
3745 * @brief 店舗情報全体を表示するメインルーチン /
3746 * Displays store (after clearing screen) -RAK-
3750 static void display_store(void)
3756 /* The "Home" is special */
3757 if (cur_store_num == STORE_HOME)
3759 /* Put the owner name */
3760 put_str(_("我が家", "Your Home"), 3, 31);
3762 /* Label the item descriptions */
3763 put_str(_("アイテムの一覧", "Item Description"), 5, 4);
3765 /* If showing weights, show label */
3768 put_str(_(" 重さ", "Weight"), 5, 70);
3772 /* The "Home" is special */
3773 else if (cur_store_num == STORE_MUSEUM)
3775 /* Put the owner name */
3776 put_str(_("博物館", "Museum"), 3, 31);
3778 /* Label the item descriptions */
3779 put_str(_("アイテムの一覧", "Item Description"), 5, 4);
3781 /* If showing weights, show label */
3784 put_str(_(" 重さ", "Weight"), 5, 70);
3791 concptr store_name = (f_name + f_info[cur_store_feat].name);
3792 concptr owner_name = (ot_ptr->owner_name);
3793 concptr race_name = race_info[ot_ptr->owner_race].title;
3795 /* Put the owner name and race */
3796 sprintf(buf, "%s (%s)", owner_name, race_name);
3797 put_str(buf, 3, 10);
3799 /* Show the max price in the store (above prices) */
3800 sprintf(buf, "%s (%ld)", store_name, (long)(ot_ptr->max_cost));
3803 /* Label the item descriptions */
3804 put_str(_("商品の一覧", "Item Description"), 5, 5);
3807 /* If showing weights, show label */
3810 put_str(_(" 重さ", "Weight"), 5, 60);
3813 /* Label the asking price (in stores) */
3814 put_str(_(" 価格", "Price"), 5, 72);
3817 /* Display the current gold */
3820 /* Draw in the inventory */
3821 display_inventory();
3827 * @brief 店舗からアイテムを選択する /
3828 * Get the ID of a store item and return its value -RAK-
3829 * @param com_val 選択IDを返す参照ポインタ
3830 * @param pmt メッセージキャプション
3833 * @return 実際に選択したらTRUE、キャンセルしたらFALSE
3835 static int get_stock(COMMAND_CODE *com_val, concptr pmt, int i, int j)
3841 /* Get the item index */
3842 if (repeat_pull(com_val))
3844 /* Verify the item */
3845 if ((*com_val >= i) && (*com_val <= j))
3853 /* Assume failure */
3856 /* Build the prompt */
3858 hi = (j > 25) ? toupper(I2A(j - 26)) : I2A(j);
3860 (void)sprintf(out_val, "(%s:%c-%c, ESCで中断) %s",
3861 (((cur_store_num == STORE_HOME) || (cur_store_num == STORE_MUSEUM)) ? "アイテム" : "商品"),
3864 (void)sprintf(out_val, "(Items %c-%c, ESC to exit) %s",
3869 /* Ask until done */
3875 if (!get_com(out_val, &command, FALSE)) break;
3878 if (islower(command))
3880 else if (isupper(command))
3881 k = A2I(tolower(command)) + 26;
3885 /* Legal responses */
3886 if ((k >= i) && (k <= j))
3895 /* Clear the prompt */
3898 if (command == ESCAPE) return (FALSE);
3900 repeat_push(*com_val);
3908 * @brief 店主の不満度を増やし、プレイヤーを締め出す判定と処理を行う /
3909 * Increase the insult counter and get angry if too many -RAK-
3910 * @return プレイヤーを締め出す場合TRUEを返す
3912 static int increase_insults(void)
3914 /* Increase insults */
3915 st_ptr->insult_cur++;
3917 /* Become insulted */
3918 if (st_ptr->insult_cur > ot_ptr->insult_max)
3924 st_ptr->insult_cur = 0;
3925 st_ptr->good_buy = 0;
3926 st_ptr->bad_buy = 0;
3929 st_ptr->store_open = current_world_ptr->game_turn + TURNS_PER_TICK*TOWN_DAWN/8 + randint1(TURNS_PER_TICK*TOWN_DAWN/8);
3941 * @brief 店主の不満度を減らす /
3942 * Decrease insults -RAK-
3943 * @return プレイヤーを締め出す場合TRUEを返す
3945 static void decrease_insults(void)
3947 /* Decrease insults */
3948 if (st_ptr->insult_cur) st_ptr->insult_cur--;
3953 * @brief 店主の不満度が増えた場合のみのメッセージを表示する /
3954 * Have insulted while haggling -RAK-
3955 * @return プレイヤーを締め出す場合TRUEを返す
3957 static int haggle_insults(void)
3959 /* Increase insults */
3960 if (increase_insults()) return (TRUE);
3962 /* Display and flush insult */
3971 * Mega-Hack -- Enable "increments"
3973 static bool allow_inc = FALSE;
3976 * Mega-Hack -- Last "increment" during haggling
3978 static s32b last_inc = 0L;
3982 * @brief 交渉価格を確認と認証の是非を行う /
3985 * @param poffer 別途価格提示をした場合の値を返す参照ポインタ
3986 * @param price 現在の交渉価格
3987 * @param final 最終確定価格ならばTRUE
3988 * @return プレイヤーを締め出す場合TRUEを返す
3990 static int get_haggle(concptr pmt, s32b *poffer, PRICE price, int final)
3995 GAME_TEXT out_val[160];
3997 /* Clear old increment if necessary */
3998 if (!allow_inc) last_inc = 0L;
4003 sprintf(buf, _("%s [承諾] ", "%s [accept] "), pmt);
4006 /* Old (negative) increment, and not final */
4007 else if (last_inc < 0)
4009 sprintf(buf, _("%s [-$%ld] ", "%s [-%ld] "), pmt, (long)(ABS(last_inc)));
4012 /* Old (positive) increment, and not final */
4013 else if (last_inc > 0)
4015 sprintf(buf, _("%s [+$%ld] ", "%s [+%ld] "), pmt, (long)(ABS(last_inc)));
4021 sprintf(buf, "%s ", pmt);
4025 /* Ask until done */
4030 /* Display prompt */
4034 strcpy(out_val, "");
4037 * Ask the user for a response.
4038 * Don't allow to use numpad as cursor key.
4040 res = askfor_aux(out_val, 32, FALSE);
4046 if (!res) return FALSE;
4048 /* Skip leading spaces */
4049 for (p = out_val; *p == ' '; p++) /* loop */;
4051 /* Empty response */
4054 /* Accept current price */
4062 /* Use previous increment */
4063 if (allow_inc && last_inc)
4065 *poffer += last_inc;
4070 /* Normal response */
4073 /* Extract a number */
4076 /* Handle "incremental" number */
4077 if ((*p == '+' || *p == '-'))
4079 /* Allow increments */
4082 /* Use the given "increment" */
4089 /* Handle normal number */
4092 /* Use the given "number" */
4100 msg_print(_("値がおかしいです。", "Invalid response."));
4110 * @brief 店主がプレイヤーからの交渉価格を判断する /
4111 * Receive an offer (from the player)
4113 * @param poffer 店主からの交渉価格を返す参照ポインタ
4114 * @param last_offer 現在の交渉価格
4115 * @param factor 店主の価格基準倍率
4116 * @param price アイテムの実価値
4117 * @param final 最終価格確定ならばTRUE
4118 * @return プレイヤーの価格に対して不服ならばTRUEを返す /
4119 * Return TRUE if offer is NOT okay
4121 static bool receive_offer(concptr pmt, s32b *poffer,
4122 s32b last_offer, int factor,
4123 PRICE price, int final)
4125 /* Haggle till done */
4128 /* Get a haggle (or cancel) */
4129 if (!get_haggle(pmt, poffer, price, final)) return (TRUE);
4131 /* Acceptable offer */
4132 if (((*poffer) * factor) >= (last_offer * factor)) break;
4134 /* Insult, and check for kicked out */
4135 if (haggle_insults()) return (TRUE);
4137 /* Reject offer (correctly) */
4138 (*poffer) = last_offer;
4147 * @brief プレイヤーが購入する時の値切り処理メインルーチン /
4148 * Haggling routine -RAK-
4149 * @param o_ptr オブジェクトの構造体参照ポインタ
4150 * @param price 最終価格を返す参照ポインタ
4151 * @return プレイヤーの価格に対して店主が不服ならばTRUEを返す /
4152 * Return TRUE if purchase is NOT successful
4154 static bool purchase_haggle(object_type *o_ptr, s32b *price)
4156 s32b cur_ask, final_ask;
4157 s32b last_offer, offer;
4159 s32b min_per, max_per;
4160 int flag, loop_flag, noneed;
4161 int annoyed = 0, final = FALSE;
4162 bool cancel = FALSE;
4166 concptr pmt = _("提示価格", "Asking");
4168 /* Extract the starting offer and the final offer */
4169 cur_ask = price_item(o_ptr, ot_ptr->max_inflate, FALSE);
4170 final_ask = price_item(o_ptr, ot_ptr->min_inflate, FALSE);
4172 /* Determine if haggling is necessary */
4173 noneed = noneedtobargain(final_ask);
4175 /* No need to haggle */
4176 if (noneed || !manual_haggle)
4178 /* No need to haggle */
4181 /* Message summary */
4182 msg_print(_("結局この金額にまとまった。", "You eventually agree upon the price."));
4186 /* No haggle option */
4189 /* Message summary */
4190 msg_print(_("すんなりとこの金額にまとまった。", "You quickly agree upon the price."));
4193 /* Apply Sales Tax */
4194 final_ask += final_ask / 10;
4198 cur_ask = final_ask;
4200 /* Go to final offer */
4201 pmt = _("最終提示価格", "Final Offer");
4206 /* Haggle for the whole pile */
4207 cur_ask *= o_ptr->number;
4208 final_ask *= o_ptr->number;
4211 /* Haggle parameters */
4212 min_per = ot_ptr->haggle_per;
4213 max_per = min_per * 3;
4215 /* Mega-Hack -- artificial "last offer" value */
4216 last_offer = object_value(o_ptr) * o_ptr->number;
4217 last_offer = last_offer * (200 - (int)(ot_ptr->max_inflate)) / 100L;
4218 if (last_offer <= 0) last_offer = 1;
4223 /* No incremental haggling yet */
4226 /* Haggle until done */
4227 for (flag = FALSE; !flag; )
4231 while (!flag && loop_flag)
4233 (void)sprintf(out_val, "%s : %ld", pmt, (long)cur_ask);
4234 put_str(out_val, 1, 0);
4235 cancel = receive_offer(_("提示する金額? ", "What do you offer? "), &offer, last_offer, 1, cur_ask, final);
4240 else if (offer > cur_ask)
4245 else if (offer == cur_ask)
4258 x1 = 100 * (offer - last_offer) / (cur_ask - last_offer);
4261 if (haggle_insults())
4267 else if (x1 > max_per)
4270 if (x1 < max_per) x1 = max_per;
4272 x2 = rand_range(x1-2, x1+2);
4273 x3 = ((cur_ask - offer) * x2 / 100L) + 1;
4274 /* don't let the price go up */
4279 if (cur_ask < final_ask)
4282 cur_ask = final_ask;
4283 pmt = _("最終提示価格", "What do you offer? ");
4287 (void)(increase_insults());
4292 else if (offer >= cur_ask)
4303 (void)sprintf(out_val, _("前回の提示金額: $%ld", "Your last offer: %ld"), (long)last_offer);
4304 put_str(out_val, 1, 39);
4305 say_comment_2(cur_ask, annoyed);
4310 if (cancel) return (TRUE);
4312 updatebargain(*price, final_ask, o_ptr->number);
4320 * @brief プレイヤーが売却する時の値切り処理メインルーチン /
4321 * Haggling routine -RAK-
4322 * @param o_ptr オブジェクトの構造体参照ポインタ
4323 * @param price 最終価格を返す参照ポインタ
4324 * @return プレイヤーの価格に対して店主が不服ならばTRUEを返す /
4325 * Return TRUE if purchase is NOT successful
4327 static bool sell_haggle(object_type *o_ptr, s32b *price)
4329 s32b purse, cur_ask, final_ask;
4330 s32b last_offer = 0, offer = 0;
4332 s32b min_per, max_per;
4333 int flag, loop_flag, noneed;
4334 int annoyed = 0, final = FALSE;
4335 bool cancel = FALSE;
4336 concptr pmt = _("提示金額", "Offer");
4342 /* Obtain the starting offer and the final offer */
4343 cur_ask = price_item(o_ptr, ot_ptr->max_inflate, TRUE);
4344 final_ask = price_item(o_ptr, ot_ptr->min_inflate, TRUE);
4346 /* Determine if haggling is necessary */
4347 noneed = noneedtobargain(final_ask);
4349 /* Get the owner's payout limit */
4350 purse = (s32b)(ot_ptr->max_cost);
4352 /* No need to haggle */
4353 if (noneed || !manual_haggle || (final_ask >= purse))
4355 /* Apply Sales Tax (if needed) */
4356 if (!manual_haggle && !noneed)
4358 final_ask -= final_ask / 10;
4361 /* No reason to haggle */
4362 if (final_ask >= purse)
4364 msg_print(_("即座にこの金額にまとまった。", "You instantly agree upon the price."));
4367 /* Offer full purse */
4371 /* No need to haggle */
4374 msg_print(_("結局この金額にまとまった。", "You eventually agree upon the price."));
4378 /* No haggle option */
4381 /* Message summary */
4382 msg_print(_("すんなりとこの金額にまとまった。", "You quickly agree upon the price."));
4387 cur_ask = final_ask;
4391 pmt = _("最終提示金額", "Final Offer");
4394 /* Haggle for the whole pile */
4395 cur_ask *= o_ptr->number;
4396 final_ask *= o_ptr->number;
4399 /* Display commands */
4401 /* Haggling parameters */
4402 min_per = ot_ptr->haggle_per;
4403 max_per = min_per * 3;
4405 /* Mega-Hack -- artificial "last offer" value */
4406 last_offer = object_value(o_ptr) * o_ptr->number;
4407 last_offer = last_offer * ot_ptr->max_inflate / 100L;
4412 /* No incremental haggling yet */
4416 for (flag = FALSE; !flag; )
4422 (void)sprintf(out_val, "%s : %ld", pmt, (long)cur_ask);
4423 put_str(out_val, 1, 0);
4424 cancel = receive_offer(_("提示する価格? ", "What price do you ask? "),
4425 &offer, last_offer, -1, cur_ask, final);
4431 else if (offer < cur_ask)
4434 /* rejected, reset offer for incremental haggling */
4437 else if (offer == cur_ask)
4448 if (flag || !loop_flag) break;
4453 x1 = 100 * (last_offer - offer) / (last_offer - cur_ask);
4456 if (haggle_insults())
4462 else if (x1 > max_per)
4465 if (x1 < max_per) x1 = max_per;
4467 x2 = rand_range(x1-2, x1+2);
4468 x3 = ((offer - cur_ask) * x2 / 100L) + 1;
4469 /* don't let the price go down */
4473 if (cur_ask > final_ask)
4475 cur_ask = final_ask;
4477 pmt = _("最終提示金額", "Final Offer");
4484 /* 追加 $0 で買い取られてしまうのを防止 By FIRST*/
4487 (void)(increase_insults());
4490 else if (offer <= cur_ask)
4501 (void)sprintf(out_val,
4502 _("前回の提示価格 $%ld", "Your last bid %ld"), (long)last_offer);
4503 put_str(out_val, 1, 39);
4504 say_comment_3(cur_ask, annoyed);
4509 if (cancel) return (TRUE);
4511 updatebargain(*price, final_ask, o_ptr->number);
4519 * @brief 店からの購入処理のメインルーチン /
4520 * Buy an item from a store -RAK-
4523 static void store_purchase(void)
4526 COMMAND_CODE item, item_new;
4537 GAME_TEXT o_name[MAX_NLEN];
4541 if (cur_store_num == STORE_MUSEUM)
4543 msg_print(_("博物館から取り出すことはできません。", "Museum."));
4548 if (st_ptr->stock_num <= 0)
4550 if (cur_store_num == STORE_HOME)
4551 msg_print(_("我が家には何も置いてありません。", "Your home is empty."));
4553 msg_print(_("現在商品の在庫を切らしています。", "I am currently out of stock."));
4557 /* Find the number of objects on this and following pages */
4558 i = (st_ptr->stock_num - store_top);
4560 /* And then restrict it to the current page */
4561 if (i > store_bottom) i = store_bottom;
4565 /* ブラックマーケットの時は別のメッセージ */
4566 switch( cur_store_num ) {
4568 sprintf(out_val, "どのアイテムを取りますか? ");
4571 sprintf(out_val, "どれ? ");
4574 sprintf(out_val, "どの品物が欲しいんだい? ");
4578 if (cur_store_num == STORE_HOME)
4580 sprintf(out_val, "Which item do you want to take? ");
4584 sprintf(out_val, "Which item are you interested in? ");
4589 /* Get the item number to be bought */
4590 if (!get_stock(&item, out_val, 0, i - 1)) return;
4592 /* Get the actual index */
4593 item = item + store_top;
4595 /* Get the actual item */
4596 o_ptr = &st_ptr->stock[item];
4598 /* Assume the player wants just one of them */
4602 /* Get a copy of the object */
4603 object_copy(j_ptr, o_ptr);
4606 * If a rod or wand, allocate total maximum timeouts or charges
4607 * between those purchased and left on the shelf.
4609 reduce_charges(j_ptr, o_ptr->number - amt);
4611 /* Modify quantity */
4612 j_ptr->number = amt;
4614 /* Hack -- require room in pack */
4615 if (!inven_carry_okay(j_ptr))
4617 msg_print(_("そんなにアイテムを持てない。", "You cannot carry that many different items."));
4621 /* Determine the "best" price (per item) */
4622 best = price_item(j_ptr, ot_ptr->min_inflate, FALSE);
4624 /* Find out how many the player wants */
4625 if (o_ptr->number > 1)
4627 /* Hack -- note cost of "fixed" items */
4628 if ((cur_store_num != STORE_HOME) &&
4629 (o_ptr->ident & IDENT_FIXED))
4631 msg_format(_("一つにつき $%ldです。", "That costs %ld gold per item."), (long)(best));
4633 amt = get_quantity(NULL, o_ptr->number);
4634 if (amt <= 0) return;
4638 /* Get desired object */
4639 object_copy(j_ptr, o_ptr);
4642 * If a rod or wand, allocate total maximum timeouts or charges
4643 * between those purchased and left on the shelf.
4645 reduce_charges(j_ptr, o_ptr->number - amt);
4647 /* Modify quantity */
4648 j_ptr->number = amt;
4650 /* Hack -- require room in pack */
4651 if (!inven_carry_okay(j_ptr))
4653 msg_print(_("ザックにそのアイテムを入れる隙間がない。", "You cannot carry that many items."));
4657 /* Attempt to buy it */
4658 if (cur_store_num != STORE_HOME)
4660 /* Fixed price, quick buy */
4661 if (o_ptr->ident & (IDENT_FIXED))
4666 /* Go directly to the "best" deal */
4667 price = (best * j_ptr->number);
4673 /* Describe the object (fully) */
4674 object_desc(o_name, j_ptr, 0);
4675 msg_format(_("%s(%c)を購入する。", "Buying %s (%c)."), o_name, I2A(item));
4678 /* Haggle for a final price */
4679 choice = purchase_haggle(j_ptr, &price);
4681 /* Hack -- Got kicked out */
4682 if (st_ptr->store_open >= current_world_ptr->game_turn) return;
4685 /* Player wants it */
4688 /* Fix the item price (if "correctly" haggled) */
4689 if (price == (best * j_ptr->number)) o_ptr->ident |= (IDENT_FIXED);
4691 /* Player can afford it */
4692 if (p_ptr->au >= price)
4697 if (cur_store_num == STORE_BLACK) /* The black market is illegal! */
4698 chg_virtue(V_JUSTICE, -1);
4699 if((o_ptr->tval == TV_BOTTLE) && (cur_store_num != STORE_HOME))
4700 chg_virtue(V_NATURE, -1);
4708 /* Spend the money */
4711 /* Update the display */
4714 /* Hack -- buying an item makes you aware of it */
4715 object_aware(j_ptr);
4717 /* Hack -- clear the "fixed" flag from the item */
4718 j_ptr->ident &= ~(IDENT_FIXED);
4720 /* Describe the transaction */
4721 object_desc(o_name, j_ptr, 0);
4723 msg_format(_("%sを $%ldで購入しました。", "You bought %s for %ld gold."), o_name, (long)price);
4725 strcpy(record_o_name, o_name);
4726 record_turn = current_world_ptr->game_turn;
4728 if (record_buy) do_cmd_write_nikki(NIKKI_BUY, 0, o_name);
4729 object_desc(o_name, o_ptr, OD_NAME_ONLY);
4730 if(record_rand_art && o_ptr->art_name)
4731 do_cmd_write_nikki(NIKKI_ART, 0, o_name);
4733 /* Erase the inscription */
4734 j_ptr->inscription = 0;
4736 /* Erase the "feeling" */
4737 j_ptr->feeling = FEEL_NONE;
4738 j_ptr->ident &= ~(IDENT_STORE);
4739 /* Give it to the player */
4740 item_new = inven_carry(j_ptr);
4742 /* Describe the final result */
4743 object_desc(o_name, &inventory[item_new], 0);
4744 msg_format(_("%s(%c)を手に入れた。", "You have %s (%c)."), o_name, index_to_label(item_new));
4746 /* Auto-inscription */
4747 autopick_alter_item(item_new, FALSE);
4749 /* Now, reduce the original stack's pval. */
4750 if ((o_ptr->tval == TV_ROD) || (o_ptr->tval == TV_WAND))
4752 o_ptr->pval -= j_ptr->pval;
4756 /* Note how many slots the store used to have */
4757 i = st_ptr->stock_num;
4759 /* Remove the bought items from the store */
4760 store_item_increase(item, -amt);
4761 store_item_optimize(item);
4763 /* Store is empty */
4764 if (st_ptr->stock_num == 0)
4767 if (one_in_(STORE_SHUFFLE))
4770 msg_print(_("店主は引退した。", "The shopkeeper retires."));
4772 /* Shuffle the store */
4773 store_shuffle(cur_store_num);
4776 sprintf(buf, "%s (%s)",
4777 ot_ptr->owner_name, race_info[ot_ptr->owner_race].title);
4778 put_str(buf, 3, 10);
4779 sprintf(buf, "%s (%ld)",
4780 (f_name + f_info[cur_store_feat].name), (long)(ot_ptr->max_cost));
4787 msg_print(_("店主は新たな在庫を取り出した。", "The shopkeeper brings out some new stock."));
4791 for (i = 0; i < 10; i++)
4793 /* Maintain the store */
4794 store_maint(p_ptr->town_num, cur_store_num);
4799 display_inventory();
4802 /* The item is gone */
4803 else if (st_ptr->stock_num != i)
4805 /* Pick the correct screen */
4806 if (store_top >= st_ptr->stock_num) store_top -= store_bottom;
4807 display_inventory();
4810 /* Item is still here */
4813 /* Redraw the item */
4814 display_entry(item);
4818 /* Player cannot afford it */
4821 /* Simple message (no insult) */
4822 msg_print(_("お金が足りません。", "You do not have enough gold."));
4827 /* Home is much easier */
4830 bool combined_or_reordered;
4832 /* Distribute charges of wands/rods */
4833 distribute_charges(o_ptr, j_ptr, amt);
4835 /* Give it to the player */
4836 item_new = inven_carry(j_ptr);
4838 /* Describe just the result */
4839 object_desc(o_name, &inventory[item_new], 0);
4841 msg_format(_("%s(%c)を取った。", "You have %s (%c)."), o_name, index_to_label(item_new));
4844 /* Take note if we take the last one */
4845 i = st_ptr->stock_num;
4847 /* Remove the items from the home */
4848 store_item_increase(item, -amt);
4849 store_item_optimize(item);
4851 combined_or_reordered = combine_and_reorder_home(STORE_HOME);
4853 /* Hack -- Item is still here */
4854 if (i == st_ptr->stock_num)
4856 if (combined_or_reordered) display_inventory();
4858 /* Redraw the item */
4859 else display_entry(item);
4862 /* The item is gone */
4866 if (st_ptr->stock_num == 0) store_top = 0;
4868 /* Nothing left on that screen */
4869 else if (store_top >= st_ptr->stock_num) store_top -= store_bottom;
4870 display_inventory();
4872 chg_virtue(V_SACRIFICE, 1);
4876 /* Not kicked out */
4882 * @brief 店からの売却処理のメインルーチン /
4883 * Sell an item to the store (or home)
4886 static void store_sell(void)
4893 PRICE price, value, dummy;
4901 GAME_TEXT o_name[MAX_NLEN];
4904 /* Prepare a prompt */
4905 if (cur_store_num == STORE_HOME)
4906 q = _("どのアイテムを置きますか? ", "Drop which item? ");
4908 else if (cur_store_num == STORE_MUSEUM)
4909 q = _("どのアイテムを寄贈しますか? ", "Give which item? ");
4912 q = _("どのアイテムを売りますか? ", "Sell which item? ");
4914 /* Only allow items the store will buy */
4915 item_tester_hook = store_will_buy;
4917 /* 我が家でおかしなメッセージが出るオリジナルのバグを修正 */
4918 if (cur_store_num == STORE_HOME)
4920 s = _("置けるアイテムを持っていません。", "You don't have any item to drop.");
4922 else if (cur_store_num == STORE_MUSEUM)
4924 s = _("寄贈できるアイテムを持っていません。", "You don't have any item to give.");
4928 s = _("欲しい物がないですねえ。", "You have nothing that I want.");
4931 o_ptr = choose_object(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT));
4934 /* Hack -- Cannot remove cursed items */
4935 if ((item >= INVEN_RARM) && object_is_cursed(o_ptr))
4937 msg_print(_("ふーむ、どうやらそれは呪われているようだね。", "Hmmm, it seems to be cursed."));
4941 /* Assume one item */
4944 if (o_ptr->number > 1)
4946 amt = get_quantity(NULL, o_ptr->number);
4947 if (amt <= 0) return;
4951 /* Get a copy of the object */
4952 object_copy(q_ptr, o_ptr);
4954 /* Modify quantity */
4955 q_ptr->number = amt;
4958 * Hack -- If a rod or wand, allocate total maximum
4959 * timeouts or charges to those being sold. -LM-
4961 if ((o_ptr->tval == TV_ROD) || (o_ptr->tval == TV_WAND))
4963 q_ptr->pval = o_ptr->pval * amt / o_ptr->number;
4966 /* Get a full description */
4967 object_desc(o_name, q_ptr, 0);
4969 /* Remove any inscription, feeling for stores */
4970 if ((cur_store_num != STORE_HOME) && (cur_store_num != STORE_MUSEUM))
4972 q_ptr->inscription = 0;
4973 q_ptr->feeling = FEEL_NONE;
4976 /* Is there room in the store (or the home?) */
4977 if (!store_check_num(q_ptr))
4979 if (cur_store_num == STORE_HOME)
4980 msg_print(_("我が家にはもう置く場所がない。", "Your home is full."));
4982 else if (cur_store_num == STORE_MUSEUM)
4983 msg_print(_("博物館はもう満杯だ。", "Museum is full."));
4986 msg_print(_("すいませんが、店にはもう置く場所がありません。", "I have not the room in my store to keep it."));
4993 if ((cur_store_num != STORE_HOME) && (cur_store_num != STORE_MUSEUM))
4995 /* Describe the transaction */
4996 msg_format(_("%s(%c)を売却する。", "Selling %s (%c)."), o_name, index_to_label(item));
5001 choice = sell_haggle(q_ptr, &price);
5004 if (st_ptr->store_open >= current_world_ptr->game_turn) return;
5016 if (cur_store_num == STORE_BLACK) /* The black market is illegal! */
5017 chg_virtue(V_JUSTICE, -1);
5019 if((o_ptr->tval == TV_BOTTLE) && (cur_store_num != STORE_HOME))
5020 chg_virtue(V_NATURE, 1);
5023 /* Get some money */
5026 /* Update the display */
5029 /* Get the "apparent" value */
5030 dummy = object_value(q_ptr) * q_ptr->number;
5032 identify_item(o_ptr);
5035 /* Get a copy of the object */
5036 object_copy(q_ptr, o_ptr);
5038 /* Modify quantity */
5039 q_ptr->number = amt;
5041 /* Make it look like to be known */
5042 q_ptr->ident |= IDENT_STORE;
5045 * Hack -- If a rod or wand, let the shopkeeper know just
5046 * how many charges he really paid for. -LM-
5048 if ((o_ptr->tval == TV_ROD) || (o_ptr->tval == TV_WAND))
5050 q_ptr->pval = o_ptr->pval * amt / o_ptr->number;
5053 /* Get the "actual" value */
5054 value = object_value(q_ptr) * q_ptr->number;
5056 /* Get the description all over again */
5057 object_desc(o_name, q_ptr, 0);
5059 /* Describe the result (in message buffer) */
5060 msg_format(_("%sを $%ldで売却しました。", "You sold %s for %ld gold."), o_name, (long)price);
5062 if (record_sell) do_cmd_write_nikki(NIKKI_SELL, 0, o_name);
5064 if (!((o_ptr->tval == TV_FIGURINE) && (value > 0)))
5066 /* Analyze the prices (and comment verbally) unless a figurine*/
5067 purchase_analyze(price, value, dummy);
5071 * Hack -- Allocate charges between those wands or rods sold
5072 * and retained, unless all are being sold. -LM-
5074 distribute_charges(o_ptr, q_ptr, amt);
5076 /* Reset timeouts of the sold items */
5079 /* Take the item from the player, describe the result */
5080 inven_item_increase(item, -amt);
5081 inven_item_describe(item);
5083 /* If items remain, auto-inscribe before optimizing */
5084 if (o_ptr->number > 0)
5085 autopick_alter_item(item, FALSE);
5087 inven_item_optimize(item);
5090 /* The store gets that (known) item */
5091 item_pos = store_carry(q_ptr);
5093 /* Re-display if item is now in store */
5096 store_top = (item_pos / store_bottom) * store_bottom;
5097 display_inventory();
5102 /* Player is at museum */
5103 else if (cur_store_num == STORE_MUSEUM)
5105 char o2_name[MAX_NLEN];
5106 object_desc(o2_name, q_ptr, OD_NAME_ONLY);
5108 if (-1 == store_check_num(q_ptr))
5110 msg_print(_("それと同じ品物は既に博物館にあるようです。", "The same object as it is already in the Museum."));
5114 msg_print(_("博物館に寄贈したものは取り出すことができません!!", "You cannot take items which is given to the Museum back!!"));
5117 if (!get_check(format(_("本当に%sを寄贈しますか?", "Really give %s to the Museum? "), o2_name))) return;
5119 identify_item(q_ptr);
5120 q_ptr->ident |= IDENT_MENTAL;
5122 /* Distribute charges of wands/rods */
5123 distribute_charges(o_ptr, q_ptr, amt);
5124 msg_format(_("%sを置いた。(%c)", "You drop %s (%c)."), o_name, index_to_label(item));
5127 /* Take it from the players inventory */
5128 inven_item_increase(item, -amt);
5129 inven_item_describe(item);
5130 inven_item_optimize(item);
5133 /* Let the home carry it */
5134 item_pos = home_carry(q_ptr);
5136 /* Update store display */
5139 store_top = (item_pos / store_bottom) * store_bottom;
5140 display_inventory();
5143 /* Player is at home */
5146 /* Distribute charges of wands/rods */
5147 distribute_charges(o_ptr, q_ptr, amt);
5148 msg_format(_("%sを置いた。(%c)", "You drop %s (%c)."), o_name, index_to_label(item));
5152 /* Take it from the players inventory */
5153 inven_item_increase(item, -amt);
5154 inven_item_describe(item);
5155 inven_item_optimize(item);
5158 /* Let the home carry it */
5159 item_pos = home_carry(q_ptr);
5161 /* Update store display */
5164 store_top = (item_pos / store_bottom) * store_bottom;
5165 display_inventory();
5169 if ((choice == 0) && (item >= INVEN_RARM))
5178 * @brief 店のアイテムを調べるコマンドのメインルーチン /
5179 * Examine an item in a store -JDL-
5182 static void store_examine(void)
5187 GAME_TEXT o_name[MAX_NLEN];
5191 if (st_ptr->stock_num <= 0)
5193 if (cur_store_num == STORE_HOME)
5194 msg_print(_("我が家には何も置いてありません。", "Your home is empty."));
5195 else if (cur_store_num == STORE_MUSEUM)
5196 msg_print(_("博物館には何も置いてありません。", "Museum is empty."));
5198 msg_print(_("現在商品の在庫を切らしています。", "I am currently out of stock."));
5202 /* Find the number of objects on this and following pages */
5203 i = (st_ptr->stock_num - store_top);
5205 /* And then restrict it to the current page */
5206 if (i > store_bottom) i = store_bottom;
5209 sprintf(out_val, _("どれを調べますか?", "Which item do you want to examine? "));
5211 /* Get the item number to be examined */
5212 if (!get_stock(&item, out_val, 0, i - 1)) return;
5214 /* Get the actual index */
5215 item = item + store_top;
5217 /* Get the actual item */
5218 o_ptr = &st_ptr->stock[item];
5220 /* Require full knowledge */
5221 if (!(o_ptr->ident & IDENT_MENTAL))
5223 /* This can only happen in the home */
5224 msg_print(_("このアイテムについて特に知っていることはない。", "You have no special knowledge about that item."));
5228 object_desc(o_name, o_ptr, 0);
5229 msg_format(_("%sを調べている...", "Examining %s..."), o_name);
5231 if (!screen_object(o_ptr, SCROBJ_FORCE_DETAIL))
5232 msg_print(_("特に変わったところはないようだ。", "You see nothing special."));
5239 * @brief 博物館のアイテムを除去するコマンドのメインルーチン /
5240 * Remove an item from museum (Originally from TOband)
5243 static void museum_remove_object(void)
5248 GAME_TEXT o_name[MAX_NLEN];
5252 if (st_ptr->stock_num <= 0)
5254 msg_print(_("博物館には何も置いてありません。", "Museum is empty."));
5258 /* Find the number of objects on this and following pages */
5259 i = st_ptr->stock_num - store_top;
5261 /* And then restrict it to the current page */
5262 if (i > store_bottom) i = store_bottom;
5265 sprintf(out_val, _("どのアイテムの展示をやめさせますか?", "Which item do you want to order to remove? "));
5267 /* Get the item number to be removed */
5268 if (!get_stock(&item, out_val, 0, i - 1)) return;
5270 /* Get the actual index */
5271 item = item + store_top;
5273 /* Get the actual item */
5274 o_ptr = &st_ptr->stock[item];
5276 object_desc(o_name, o_ptr, 0);
5278 msg_print(_("展示をやめさせたアイテムは二度と見ることはできません!", "You cannot see items which is removed from the Museum!"));
5279 if (!get_check(format(_("本当に%sの展示をやめさせますか?", "Really order to remove %s from the Museum? "), o_name))) return;
5281 msg_format(_("%sの展示をやめさせた。", "You ordered to remove %s."), o_name);
5283 /* Remove the items from the home */
5284 store_item_increase(item, -o_ptr->number);
5285 store_item_optimize(item);
5287 (void)combine_and_reorder_home(STORE_MUSEUM);
5289 /* The item is gone */
5292 if (st_ptr->stock_num == 0) store_top = 0;
5294 /* Nothing left on that screen */
5295 else if (store_top >= st_ptr->stock_num) store_top -= store_bottom;
5296 display_inventory();
5303 * Hack -- set this to leave the store
5305 static bool leave_store = FALSE;
5309 * @brief 店舗処理コマンド選択のメインルーチン /
5310 * Process a command in a store
5314 * Note that we must allow the use of a few "special" commands
5315 * in the stores which are not allowed in the dungeon, and we
5316 * must disable some commands which are allowed in the dungeon
5317 * but not in the stores, to prevent chaos.
5320 static void store_process_command(void)
5322 /* Handle repeating the last command */
5325 if (rogue_like_commands && command_cmd == 'l')
5327 command_cmd = 'x'; /* hack! */
5330 /* Parse the command */
5331 switch (command_cmd)
5341 /* 1 ページ戻るコマンド: 我が家のページ数が多いので重宝するはず By BUG */
5344 if (st_ptr->stock_num <= store_bottom) {
5345 msg_print(_("これで全部です。", "Entire inventory is shown."));
5348 store_top -= store_bottom;
5349 if ( store_top < 0 )
5350 store_top = ((st_ptr->stock_num - 1 )/store_bottom) * store_bottom;
5351 if ( (cur_store_num == STORE_HOME) && (powerup_home == FALSE) )
5352 if ( store_top >= store_bottom ) store_top = store_bottom;
5353 display_inventory();
5361 if (st_ptr->stock_num <= store_bottom)
5363 msg_print(_("これで全部です。", "Entire inventory is shown."));
5367 store_top += store_bottom;
5369 * 隠しオプション(powerup_home)がセットされていないときは
5370 * 我が家では 2 ページまでしか表示しない
5372 if ((cur_store_num == STORE_HOME) &&
5373 (powerup_home == FALSE) &&
5374 (st_ptr->stock_num >= STORE_INVEN_MAX))
5376 if (store_top >= (STORE_INVEN_MAX - 1))
5383 if (store_top >= st_ptr->stock_num) store_top = 0;
5386 display_inventory();
5398 /* Get (purchase) */
5425 /*** Inventory Commands ***/
5427 /* Wear/wield equipment */
5434 /* Take off equipment */
5441 /* Destroy an item */
5448 /* Equipment list */
5455 /* Inventory list */
5463 /*** Various commands ***/
5465 /* Identify an object */
5472 /* Hack -- toggle windows */
5475 toggle_inven_equip();
5479 /*** Use various objects ***/
5484 if ( (p_ptr->pclass == CLASS_MINDCRAFTER) ||
5485 (p_ptr->pclass == CLASS_BERSERKER) ||
5486 (p_ptr->pclass == CLASS_NINJA) ||
5487 (p_ptr->pclass == CLASS_MIRROR_MASTER)
5488 ) do_cmd_mind_browse();
5489 else if (p_ptr->pclass == CLASS_SMITH)
5491 else if (p_ptr->pclass == CLASS_MAGIC_EATER)
5492 do_cmd_magic_eater(TRUE, FALSE);
5493 else if (p_ptr->pclass == CLASS_SNIPER)
5494 do_cmd_snipe_browse();
5495 else do_cmd_browse();
5499 /* Inscribe an object */
5506 /* Uninscribe an object */
5509 do_cmd_uninscribe();
5515 /*** Help and Such ***/
5524 /* Identify symbol */
5527 do_cmd_query_symbol();
5531 /* Character description */
5534 p_ptr->town_num = old_town_num;
5535 do_cmd_change_name();
5536 p_ptr->town_num = inner_town_num;
5542 /*** System Commands ***/
5544 /* Hack -- User interface */
5551 /* Single line from a pref file */
5554 p_ptr->town_num = old_town_num;
5556 p_ptr->town_num = inner_town_num;
5560 /* Interact with macros */
5563 p_ptr->town_num = old_town_num;
5565 p_ptr->town_num = inner_town_num;
5569 /* Interact with visuals */
5572 p_ptr->town_num = old_town_num;
5574 p_ptr->town_num = inner_town_num;
5578 /* Interact with colors */
5581 p_ptr->town_num = old_town_num;
5583 p_ptr->town_num = inner_town_num;
5587 /* Interact with options */
5591 (void)combine_and_reorder_home(STORE_HOME);
5597 /*** Misc Commands ***/
5613 /* Repeat level feeling */
5620 /* Show previous message */
5623 do_cmd_message_one();
5627 /* Show previous messages */
5640 /* Check artifacts, uniques etc. */
5647 /* Load "screen dump" */
5650 do_cmd_load_screen();
5654 /* Save "screen dump" */
5657 do_cmd_save_screen();
5661 /* Hack -- Unknown command */
5664 if ((cur_store_num == STORE_MUSEUM) && (command_cmd == 'r'))
5666 museum_remove_object();
5670 msg_print(_("そのコマンドは店の中では使えません。", "That command does not work in stores."));
5679 * @brief 店舗処理全体のメインルーチン /
5680 * Enter a store, and interact with it. *
5684 * Note that we use the standard "request_command()" function
5685 * to get a command, allowing us to use "command_arg" and all
5686 * command macros and other nifty stuff, but we use the special
5687 * "shopping" argument, to force certain commands to be converted
5688 * into other commands, normally, we convert "p" (pray) and "m"
5689 * (cast magic) into "g" (get), and "s" (search) into "d" (drop).
5692 void do_cmd_store(void)
5698 bool need_redraw_store_inv; /* To redraw missiles damage and prices in store */
5701 if(p_ptr->wild_mode) return;
5702 Term_get_size(&w, &h);
5704 /* Calculate stocks per 1 page */
5705 xtra_stock = MIN(14+26, ((h > 24) ? (h - 24) : 0));
5706 store_bottom = MIN_STOCK + xtra_stock;
5708 /* Access the player grid */
5709 g_ptr = ¤t_floor_ptr->grid_array[p_ptr->y][p_ptr->x];
5711 /* Verify a store */
5712 if (!cave_have_flag_grid(g_ptr, FF_STORE))
5714 msg_print(_("ここには店がありません。", "You see no store here."));
5718 /* Extract the store code */
5719 which = f_info[g_ptr->feat].subtype;
5721 old_town_num = p_ptr->town_num;
5722 if ((which == STORE_HOME) || (which == STORE_MUSEUM)) p_ptr->town_num = 1;
5723 if (current_floor_ptr->dun_level) p_ptr->town_num = NO_TOWN;
5724 inner_town_num = p_ptr->town_num;
5726 /* Hack -- Check the "locked doors" */
5727 if ((town_info[p_ptr->town_num].store[which].store_open >= current_world_ptr->game_turn) ||
5730 msg_print(_("ドアに鍵がかかっている。", "The doors are locked."));
5731 p_ptr->town_num = old_town_num;
5735 /* Calculate the number of store maintainances since the last visit */
5736 maintain_num = (current_world_ptr->game_turn - town_info[p_ptr->town_num].store[which].last_visit) / (TURNS_PER_TICK * STORE_TICKS);
5738 /* Maintain the store max. 10 times */
5739 if (maintain_num > 10) maintain_num = 10;
5743 /* Maintain the store */
5744 for (i = 0; i < maintain_num; i++)
5745 store_maint(p_ptr->town_num, which);
5747 /* Save the visit */
5748 town_info[p_ptr->town_num].store[which].last_visit = current_world_ptr->game_turn;
5754 /* Hack -- Character is in "icky" mode */
5755 character_icky = TRUE;
5762 /* Do not expand macros */
5763 get_com_no_macros = TRUE;
5765 /* Save the store number */
5766 cur_store_num = which;
5768 /* Hack -- save the store feature */
5769 cur_store_feat = g_ptr->feat;
5771 /* Save the store and owner pointers */
5772 st_ptr = &town_info[p_ptr->town_num].store[cur_store_num];
5773 ot_ptr = &owners[cur_store_num][st_ptr->owner];
5775 /* Start at the beginning */
5778 play_music(TERM_XTRA_MUSIC_BASIC, MUSIC_BASIC_BUILD);
5783 leave_store = FALSE;
5785 /* Interact with player */
5786 while (!leave_store)
5788 /* Hack -- Clear line 1 */
5792 clear_from(20 + xtra_stock);
5794 /* Basic commands */
5795 prt(_(" ESC) 建物から出る", " ESC) Exit from Building."), 21 + xtra_stock, 0);
5797 /* Browse if necessary */
5798 if (st_ptr->stock_num > store_bottom)
5800 prt(_(" -)前ページ", " -) Previous page"), 22 + xtra_stock, 0);
5801 prt(_(" スペース) 次ページ", " SPACE) Next page"), 23 + xtra_stock, 0);
5805 if (cur_store_num == STORE_HOME)
5807 prt(_("g) アイテムを取る", "g) Get an item."), 21 + xtra_stock, 27);
5808 prt(_("d) アイテムを置く", "d) Drop an item."), 22 + xtra_stock, 27);
5809 prt(_("x) 家のアイテムを調べる", "x) eXamine an item in the home."), 23 + xtra_stock, 27);
5812 /* Museum commands */
5813 else if (cur_store_num == STORE_MUSEUM)
5815 prt(_("d) アイテムを置く", "d) Drop an item."), 21 + xtra_stock, 27);
5816 prt(_("r) アイテムの展示をやめる", "r) order to Remove an item."), 22 + xtra_stock, 27);
5817 prt(_("x) 博物館のアイテムを調べる", "x) eXamine an item in the museum."), 23 + xtra_stock, 27);
5823 prt(_("p) 商品を買う", "p) Purchase an item."), 21 + xtra_stock, 30);
5824 prt(_("s) アイテムを売る", "s) Sell an item."), 22 + xtra_stock, 30);
5825 prt(_("x) 商品を調べる", "x) eXamine an item in the shop"), 23 + xtra_stock,30);
5829 prt(_("i/e) 持ち物/装備の一覧", "i/e) Inventry/Equipment list"), 21 + xtra_stock, 56);
5831 if (rogue_like_commands)
5833 prt(_("w/T) 装備する/はずす", "w/T) Wear/Take off equipment"), 22 + xtra_stock, 56);
5837 prt(_("w/t) 装備する/はずす", "w/t) Wear/Take off equipment"), 22 + xtra_stock, 56);
5841 prt(_("コマンド:", "You may: "), 20 + xtra_stock, 0);
5843 request_command(TRUE);
5845 /* Process the command */
5846 store_process_command();
5849 * Hack -- To redraw missiles damage and prices in store
5850 * If player's charisma changes, or if player changes a bow, PU_BONUS is set
5852 need_redraw_store_inv = (p_ptr->update & PU_BONUS) ? TRUE : FALSE;
5854 /* Hack -- Character is still in "icky" mode */
5855 character_icky = TRUE;
5860 if (inventory[INVEN_PACK].k_idx)
5862 INVENTORY_IDX item = INVEN_PACK;
5864 object_type *o_ptr = &inventory[item];
5866 /* Hack -- Flee from the store */
5867 if (cur_store_num != STORE_HOME)
5869 if (cur_store_num == STORE_MUSEUM)
5870 msg_print(_("ザックからアイテムがあふれそうなので、あわてて博物館から出た...", "Your pack is so full that you flee the Museum..."));
5872 msg_print(_("ザックからアイテムがあふれそうなので、あわてて店から出た...", "Your pack is so full that you flee the store..."));
5878 /* Hack -- Flee from the home */
5879 else if (!store_check_num(o_ptr))
5881 msg_print(_("ザックからアイテムがあふれそうなので、あわてて家から出た...", "Your pack is so full that you flee your home..."));
5886 /* Hack -- Drop items into the home */
5894 GAME_TEXT o_name[MAX_NLEN];
5896 /* Give a message */
5897 msg_print(_("ザックからアイテムがあふれてしまった!", "Your pack overflows!"));
5901 object_copy(q_ptr, o_ptr);
5902 object_desc(o_name, q_ptr, 0);
5904 msg_format(_("%sが落ちた。(%c)", "You drop %s (%c)."), o_name, index_to_label(item));
5906 /* Remove it from the players inventory */
5907 inven_item_increase(item, -255);
5908 inven_item_describe(item);
5909 inven_item_optimize(item);
5912 /* Let the home carry it */
5913 item_pos = home_carry(q_ptr);
5915 /* Redraw the home */
5918 store_top = (item_pos / store_bottom) * store_bottom;
5919 display_inventory();
5924 /* Hack -- Redisplay store prices if charisma changes */
5925 /* Hack -- Redraw missiles damage if player changes bow */
5926 if (need_redraw_store_inv) display_inventory();
5928 /* Hack -- get kicked out of the store */
5929 if (st_ptr->store_open >= current_world_ptr->game_turn) leave_store = TRUE;
5932 select_floor_music();
5934 p_ptr->town_num = old_town_num;
5936 take_turn(p_ptr, 100);
5938 /* Hack -- Character is no longer in "icky" mode */
5939 character_icky = FALSE;
5941 /* Hack -- Cancel automatic command */
5944 /* Hack -- Cancel "see" mode */
5945 command_see = FALSE;
5947 /* Allow expanding macros */
5948 get_com_no_macros = FALSE;
5953 /* Update everything */
5954 p_ptr->update |= (PU_VIEW | PU_LITE | PU_MON_LITE);
5955 p_ptr->update |= (PU_MONSTERS);
5957 /* Redraw entire screen */
5958 p_ptr->redraw |= (PR_BASIC | PR_EXTRA | PR_EQUIPPY);
5959 p_ptr->redraw |= (PR_MAP);
5960 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
5966 * @brief 現在の町の店主を交代させる /
5967 * Shuffle one of the stores.
5968 * @param which 店舗種類のID
5971 void store_shuffle(int which)
5977 if (which == STORE_HOME) return;
5978 if (which == STORE_MUSEUM) return;
5981 /* Save the store index */
5982 cur_store_num = which;
5984 /* Activate that store */
5985 st_ptr = &town_info[p_ptr->town_num].store[cur_store_num];
5988 /* Pick a new owner */
5991 st_ptr->owner = (byte)randint0(MAX_OWNERS);
5992 if (j == st_ptr->owner) continue;
5993 for (i = 1;i < max_towns; i++)
5995 if (i == p_ptr->town_num) continue;
5996 if (st_ptr->owner == town_info[i].store[cur_store_num].owner) break;
5998 if (i == max_towns) break;
6001 /* Activate the new owner */
6002 ot_ptr = &owners[cur_store_num][st_ptr->owner];
6005 /* Reset the owner data */
6006 st_ptr->insult_cur = 0;
6007 st_ptr->store_open = 0;
6008 st_ptr->good_buy = 0;
6009 st_ptr->bad_buy = 0;
6012 /* Hack -- discount all the items */
6013 for (i = 0; i < st_ptr->stock_num; i++)
6017 o_ptr = &st_ptr->stock[i];
6019 if (!object_is_artifact(o_ptr))
6021 /* Hack -- Sell all non-artifact old items for "half price" */
6022 o_ptr->discount = 50;
6024 /* Hack -- Items are no longer "fixed price" */
6025 o_ptr->ident &= ~(IDENT_FIXED);
6027 /* Mega-Hack -- Note that the item is "on sale" */
6028 o_ptr->inscription = quark_add(_("売出中", "on sale"));
6035 * @brief 店の品揃えを変化させる /
6036 * Maintain the inventory at the stores.
6037 * @param town_num 町のID
6038 * @param store_num 店舗種類のID
6041 void store_maint(int town_num, int store_num)
6045 cur_store_num = store_num;
6048 if (store_num == STORE_HOME) return;
6049 if (store_num == STORE_MUSEUM) return;
6051 /* Activate that store */
6052 st_ptr = &town_info[town_num].store[store_num];
6054 /* Activate the owner */
6055 ot_ptr = &owners[store_num][st_ptr->owner];
6057 /* Store keeper forgives the player */
6058 st_ptr->insult_cur = 0;
6060 /* Mega-Hack -- prune the black market */
6061 if (store_num == STORE_BLACK)
6063 /* Destroy crappy black market items */
6064 for (j = st_ptr->stock_num - 1; j >= 0; j--)
6066 object_type *o_ptr = &st_ptr->stock[j];
6068 /* Destroy crappy items */
6069 if (black_market_crap(o_ptr))
6071 /* Destroy the item */
6072 store_item_increase(j, 0 - o_ptr->number);
6073 store_item_optimize(j);
6079 /* Choose the number of slots to keep */
6080 j = st_ptr->stock_num;
6082 /* Sell a few items */
6083 j = j - randint1(STORE_TURNOVER);
6085 /* Never keep more than "STORE_MAX_KEEP" slots */
6086 if (j > STORE_MAX_KEEP) j = STORE_MAX_KEEP;
6088 /* Always "keep" at least "STORE_MIN_KEEP" items */
6089 if (j < STORE_MIN_KEEP) j = STORE_MIN_KEEP;
6091 /* Hack -- prevent "underflow" */
6094 /* Destroy objects until only "j" slots are left */
6095 while (st_ptr->stock_num > j) store_delete();
6098 /* Choose the number of slots to fill */
6099 j = st_ptr->stock_num;
6101 /* Buy some more items */
6102 j = j + randint1(STORE_TURNOVER);
6104 /* Never keep more than "STORE_MAX_KEEP" slots */
6105 if (j > STORE_MAX_KEEP) j = STORE_MAX_KEEP;
6107 /* Always "keep" at least "STORE_MIN_KEEP" items */
6108 if (j < STORE_MIN_KEEP) j = STORE_MIN_KEEP;
6110 /* Hack -- prevent "overflow" */
6111 if (j >= st_ptr->stock_size) j = st_ptr->stock_size - 1;
6113 /* Acquire some new items */
6114 while (st_ptr->stock_num < j) store_create();
6119 * @brief 店舗情報を初期化する /
6120 * Initialize the stores
6121 * @param town_num 町のID
6122 * @param store_num 店舗種類のID
6125 void store_init(int town_num, int store_num)
6128 cur_store_num = store_num;
6130 /* Activate that store */
6131 st_ptr = &town_info[town_num].store[store_num];
6139 st_ptr->owner = (byte)randint0(MAX_OWNERS);
6140 for (i = 1;i < max_towns; i++)
6142 if (i == town_num) continue;
6143 if (st_ptr->owner == town_info[i].store[store_num].owner) break;
6145 if (i == max_towns) break;
6148 /* Activate the new owner */
6149 ot_ptr = &owners[store_num][st_ptr->owner];
6152 /* Initialize the store */
6153 st_ptr->store_open = 0;
6154 st_ptr->insult_cur = 0;
6155 st_ptr->good_buy = 0;
6156 st_ptr->bad_buy = 0;
6158 /* Nothing in stock */
6159 st_ptr->stock_num = 0;
6162 * MEGA-HACK - Last visit to store is
6163 * BEFORE player birth to enable store restocking
6165 st_ptr->last_visit = -10L * TURNS_PER_TICK * STORE_TICKS;
6167 /* Clear any old items */
6168 for (k = 0; k < st_ptr->stock_size; k++)
6170 object_wipe(&st_ptr->stock[k]);
6176 * @brief アイテムを町のブラックマーケットに移動させる /
6177 * @param o_ptr 移動させたいオブジェクトの構造体参照ポインタ
6180 void move_to_black_market(object_type *o_ptr)
6183 if (!p_ptr->town_num) return;
6185 st_ptr = &town_info[p_ptr->town_num].store[STORE_BLACK];
6187 o_ptr->ident |= IDENT_STORE;
6189 (void)store_carry(o_ptr);
6191 object_wipe(o_ptr); /* Don't leave a bogus object behind... */