3 * @brief 店の処理 / Store commands
6 * Copyright (c) 1989 James E. Wilson, Robert A. Koeneke\n
7 * This software may be copied and distributed for educational, research, and\n
8 * not for profit purposes provided that this copyright and statement are\n
9 * included in all such copies.\n
10 * 2014 Deskull rearranged comment for Doxygen.
18 #include "cmd-smith.h"
19 #include "cmd-zapwand.h"
20 #include "cmd-magiceat.h"
23 #include "cmd-spell.h"
25 #include "player-status.h"
26 #include "object-flavor.h"
27 #include "object-hook.h"
28 #include "floor-events.h"
31 #include "player-effects.h"
37 * @brief 闘技場のモンスターID及び報酬アイテムテーブル /
38 * Store owners (exactly four "possible" owners per store, chosen randomly)
41 * { name, purse, max greed, min greed, haggle_per, tolerance, race, unused }
43 * Lifted extra shopkeepers from CthAngband (don't you just love open source
44 * development? ;-)). Since this gave less than 32 unique names for some
45 * shops, those have their first x names copied to reach 32.
47 * For the weapon and armour shops, several owners have a limit of 5k.
49 * I want to do 50k owners, but the purse is currently s16b. Perhaps
50 * we should just store 1/10th of the purse?
53 const owner_type owners[MAX_STORES][MAX_OWNERS] =
56 /* General store - 32 unique names */
58 Raistlin は dragonlance の powerful wizard 。
59 Rincewind the Chicken は Terry Pratchett の Discworld の登場人物 上記のパロディ?、
60 { "憶病者ラストリン", 200, 175, 108, 4, 12, RACE_HUMAN},
61 { "Raistlin the Chicken", 200, 175, 108, 4, 12, RACE_HUMAN},
65 { "フレンドリーなビルボ", 200, 170, 108, 5, 15, RACE_HOBBIT},
66 { "憶病者リンスウィンド", 200, 175, 108, 4, 12, RACE_HUMAN},
67 { "背の低いサルタン", 300, 170, 107, 5, 15, RACE_GNOME},
68 { "ハンサムなライア=エル", 300, 165, 107, 6, 18, RACE_ELF},
69 { "親切なファリルマウエン", 250, 170, 108, 5, 15, RACE_HOBBIT},
70 { "臆病者ヴォワラン", 500, 175, 108, 4, 12, RACE_HUMAN},
71 { "チビのエラシュナク", 750, 170, 107, 5, 15, RACE_BEASTMAN},
72 { "ハンサムなグラッグ", 1000, 165, 107, 6, 18, RACE_HALF_TITAN},
73 { "ケチなフォロビア", 250, 170, 108, 5, 15, RACE_HUMAN},
74 { "馬鹿のエリス", 500, 175, 108, 4, 12, RACE_HUMAN},
75 { "腹ペコのフィルバート", 750, 170, 107, 5, 15, RACE_VAMPIRE},
76 { "スナーグル・サシグア", 1000, 165, 107, 6, 18, RACE_MIND_FLAYER},
77 { "長死きエロワーズ", 250, 170, 108, 5, 15, RACE_SPECTRE},
78 { "ノロマのフンディ", 500, 175, 108, 4, 12, RACE_ZOMBIE},
79 { "グランサス", 750, 170, 107, 5, 15, RACE_SKELETON},
80 { "丁寧なロラックス", 1000, 165, 107, 6, 18, RACE_VAMPIRE},
81 { "ブッチ", 250, 170, 108, 5, 15, RACE_HALF_ORC},
82 { "美しきエルベレス", 500, 175, 108, 4, 12, RACE_HIGH_ELF},
83 { "こそこそサーレス", 750, 170, 107, 5, 15, RACE_GNOME},
84 { "ナーロック", 1000, 165, 107, 6, 18, RACE_DWARF},
85 { "チビのヘイネッカ", 250, 170, 108, 5, 15, RACE_GNOME},
86 { "きちがいロワラン", 500, 175, 108, 4, 12, RACE_HALF_GIANT},
87 { "毒息のウート", 750, 170, 107, 5, 15, RACE_DRACONIAN},
88 { "でぶっちょアラァカ", 1000, 165, 107, 6, 18, RACE_DRACONIAN},
89 { "低能なプーゴー", 250, 170, 108, 5, 15, RACE_BEASTMAN},
90 { "フェロールフィリアン", 500, 175, 108, 4, 12, RACE_ELF},
91 { "年寄りマロカ", 750, 170, 107, 5, 15, RACE_GNOME},
92 { "勇敢なサシン", 1000, 165, 107, 6, 18, RACE_HALF_GIANT},
93 { "田舎者アビエマール", 250, 170, 108, 5, 15, RACE_HUMAN},
94 { "貧乏なハーク", 500, 175, 108, 4, 12, RACE_HALF_ORC},
95 { "みじめなソアリン", 750, 170, 107, 5, 15, RACE_ZOMBIE},
96 { "質素なメルラ", 1000, 165, 107, 6, 18, RACE_ELF},
98 { "Bilbo the Friendly", 200, 170, 108, 5, 15, RACE_HOBBIT},
99 { "Rincewind the Chicken", 200, 175, 108, 4, 12, RACE_HUMAN},
100 { "Sultan the Midget", 300, 170, 107, 5, 15, RACE_GNOME},
101 { "Lyar-el the Comely", 300, 165, 107, 6, 18, RACE_ELF},
102 { "Falilmawen the Friendly", 250, 170, 108, 5, 15, RACE_HOBBIT},
103 { "Voirin the Cowardly", 500, 175, 108, 4, 12, RACE_HUMAN},
104 { "Erashnak the Midget", 750, 170, 107, 5, 15, RACE_BEASTMAN},
105 { "Grug the Comely", 1000, 165, 107, 6, 18, RACE_HALF_TITAN},
106 { "Forovir the Cheap", 250, 170, 108, 5, 15, RACE_HUMAN},
107 { "Ellis the Fool", 500, 175, 108, 4, 12, RACE_HUMAN},
108 { "Filbert the Hungry", 750, 170, 107, 5, 15, RACE_VAMPIRE},
109 { "Fthnargl Psathiggua", 1000, 165, 107, 6, 18, RACE_MIND_FLAYER},
110 { "Eloise Long-Dead", 250, 170, 108, 5, 15, RACE_SPECTRE},
111 { "Fundi the Slow", 500, 175, 108, 4, 12, RACE_ZOMBIE},
112 { "Granthus", 750, 170, 107, 5, 15, RACE_SKELETON},
113 { "Lorax the Suave", 1000, 165, 107, 6, 18, RACE_VAMPIRE},
114 { "Butch", 250, 170, 108, 5, 15, RACE_HALF_ORC},
115 { "Elbereth the Beautiful", 500, 175, 108, 4, 12, RACE_HIGH_ELF},
116 { "Sarleth the Sneaky", 750, 170, 107, 5, 15, RACE_GNOME},
117 { "Narlock", 1000, 165, 107, 6, 18, RACE_DWARF},
118 { "Haneka the Small", 250, 170, 108, 5, 15, RACE_GNOME},
119 { "Loirin the Mad", 500, 175, 108, 4, 12, RACE_HALF_GIANT},
120 { "Wuto Poisonbreath", 750, 170, 107, 5, 15, RACE_DRACONIAN},
121 { "Araaka the Rotund", 1000, 165, 107, 6, 18, RACE_DRACONIAN},
122 { "Poogor the Dumb", 250, 170, 108, 5, 15, RACE_BEASTMAN},
123 { "Felorfiliand", 500, 175, 108, 4, 12, RACE_ELF},
124 { "Maroka the Aged", 750, 170, 107, 5, 15, RACE_GNOME},
125 { "Sasin the Bold", 1000, 165, 107, 6, 18, RACE_HALF_GIANT},
126 { "Abiemar the Peasant", 250, 170, 108, 5, 15, RACE_HUMAN},
127 { "Hurk the Poor", 500, 175, 108, 4, 12, RACE_HALF_ORC},
128 { "Soalin the Wretched", 750, 170, 107, 5, 15, RACE_ZOMBIE},
129 { "Merulla the Humble", 1000, 165, 107, 6, 18, RACE_ELF},
133 /* Armoury - 28 unique names */
135 { "醜悪コン=ダー", 5000, 210, 115, 5, 7, RACE_HALF_ORC},
136 { "頑固者ダーグ=ロウ", 10000, 190, 111, 4, 9, RACE_HUMAN},
137 { "賢者デカド", 25000, 200, 112, 4, 10, RACE_DUNADAN},
138 { "鍛冶屋のウィーランド", 30000, 200, 112, 4, 5, RACE_DWARF},
139 { "醜悪コン=ダー", 10000, 210, 115, 5, 7, RACE_HALF_ORC},
140 { "頑固者ダーグ=ロウ", 15000, 190, 111, 4, 9, RACE_HUMAN},
141 { "ハンサムなデカド", 25000, 200, 112, 4, 10, RACE_AMBERITE},
142 { "エロー・ドラゴンスケイル", 30000, 200, 112, 4, 5, RACE_ELF},
143 { "デリカトス", 10000, 210, 115, 5, 7, RACE_SPRITE},
144 { "巨大なグルース", 15000, 190, 111, 4, 9, RACE_HALF_GIANT},
145 { "アニムス", 25000, 200, 112, 4, 10, RACE_GOLEM},
146 { "マルヴァス", 30000, 200, 112, 4, 5, RACE_HALF_TITAN},
147 { "セラクシス", 10000, 210, 115, 5, 7, RACE_ZOMBIE},
148 { "デス・チル", 5000, 190, 111, 4, 9, RACE_SPECTRE},
149 { "微かなドリオス", 25000, 200, 112, 4, 10, RACE_SPECTRE},
150 { "冷たいバスリック", 30000, 200, 112, 4, 5, RACE_VAMPIRE},
151 { "冷酷ヴェンジェラ", 10000, 210, 115, 5, 7, RACE_HALF_TROLL},
152 { "強者ウィラナ", 15000, 190, 111, 4, 9, RACE_HUMAN},
153 { "ヨジョ二世", 25000, 200, 112, 4, 10, RACE_DWARF},
154 { "優しいラナラー", 30000, 200, 112, 4, 5, RACE_AMBERITE},
155 { "不浄のホルバグ", 5000, 210, 115, 5, 7, RACE_HALF_ORC},
156 { "テレパスのエレレン", 15000, 190, 111, 4, 9, RACE_DARK_ELF},
157 { "イスドリリアス", 25000, 200, 112, 4, 10, RACE_SPRITE},
158 { "一つ目ヴェグナー", 5000, 200, 112, 4, 5, RACE_CYCLOPS},
159 { "混沌のロディッシュ", 10000, 210, 115, 5, 7, RACE_BEASTMAN},
160 { "剣豪ヘジン", 15000, 190, 111, 4, 9, RACE_NIBELUNG},
161 { "ずる屋のエルベレリス", 10000, 200, 112, 4, 10, RACE_DARK_ELF},
162 { "インプのザサス", 30000, 200, 112, 4, 5, RACE_IMP},
163 { "醜悪コン=ダー", 5000, 210, 115, 5, 7, RACE_HALF_ORC},
164 { "頑固者ダーグ=ロウ", 10000, 190, 111, 4, 9, RACE_HUMAN},
165 { "ハンサムなデカド", 25000, 200, 112, 4, 10, RACE_AMBERITE},
166 { "鍛冶屋のウィーランド", 30000, 200, 112, 4, 5, RACE_DWARF},
168 { "Kon-Dar the Ugly", 5000, 210, 115, 5, 7, RACE_HALF_ORC},
169 { "Darg-Low the Grim", 10000, 190, 111, 4, 9, RACE_HUMAN},
170 { "Decado the Handsome", 25000, 200, 112, 4, 10, RACE_DUNADAN},
171 { "Wieland the Smith", 30000, 200, 112, 4, 5, RACE_DWARF},
172 { "Kon-Dar the Ugly", 10000, 210, 115, 5, 7, RACE_HALF_ORC},
173 { "Darg-Low the Grim", 15000, 190, 111, 4, 9, RACE_HUMAN},
174 { "Decado the Handsome", 25000, 200, 112, 4, 10, RACE_AMBERITE},
175 { "Elo Dragonscale", 30000, 200, 112, 4, 5, RACE_ELF},
176 { "Delicatus", 10000, 210, 115, 5, 7, RACE_SPRITE},
177 { "Gruce the Huge", 15000, 190, 111, 4, 9, RACE_HALF_GIANT},
178 { "Animus", 25000, 200, 112, 4, 10, RACE_GOLEM},
179 { "Malvus", 30000, 200, 112, 4, 5, RACE_HALF_TITAN},
180 { "Selaxis", 10000, 210, 115, 5, 7, RACE_ZOMBIE},
181 { "Deathchill", 5000, 190, 111, 4, 9, RACE_SPECTRE},
182 { "Drios the Faint", 25000, 200, 112, 4, 10, RACE_SPECTRE},
183 { "Bathric the Cold", 30000, 200, 112, 4, 5, RACE_VAMPIRE},
184 { "Vengella the Cruel", 10000, 210, 115, 5, 7, RACE_HALF_TROLL},
185 { "Wyrana the Mighty", 15000, 190, 111, 4, 9, RACE_HUMAN},
186 { "Yojo II", 25000, 200, 112, 4, 10, RACE_DWARF},
187 { "Ranalar the Sweet", 30000, 200, 112, 4, 5, RACE_AMBERITE},
188 { "Horbag the Unclean", 5000, 210, 115, 5, 7, RACE_HALF_ORC},
189 { "Elelen the Telepath", 15000, 190, 111, 4, 9, RACE_DARK_ELF},
190 { "Isedrelias", 25000, 200, 112, 4, 10, RACE_SPRITE},
191 { "Vegnar One-eye", 5000, 200, 112, 4, 5, RACE_CYCLOPS},
192 { "Rodish the Chaotic", 10000, 210, 115, 5, 7, RACE_BEASTMAN},
193 { "Hesin Swordmaster", 15000, 190, 111, 4, 9, RACE_NIBELUNG},
194 { "Elvererith the Cheat", 10000, 200, 112, 4, 10, RACE_DARK_ELF},
195 { "Zzathath the Imp", 30000, 200, 112, 4, 5, RACE_IMP},
196 { "Kon-Dar the Ugly", 5000, 210, 115, 5, 7, RACE_HALF_ORC},
197 { "Darg-Low the Grim", 10000, 190, 111, 4, 9, RACE_HUMAN},
198 { "Decado the Handsome", 25000, 200, 112, 4, 10, RACE_AMBERITE},
199 { "Wieland the Smith", 30000, 200, 112, 4, 5, RACE_DWARF},
204 /* Weapon Smith - 28 unique names */
206 { "残忍なるアーノルド", 5000, 210, 115, 6, 6, RACE_HALF_TROLL},
207 { "獣殺しのアーンダル", 10000, 185, 110, 5, 9, RACE_HALF_ELF},
208 { "獣マスターのエディー", 25000, 190, 115, 5, 7, RACE_HOBBIT},
209 { "竜殺しのオグライン", 30000, 195, 112, 4, 8, RACE_DWARF},
210 { "熟練者ドリュー", 10000, 210, 115, 6, 6, RACE_HUMAN},
211 { "龍の子オラックス", 15000, 185, 110, 5, 9, RACE_DRACONIAN},
212 { "病気持ちのアンスラックス", 25000, 190, 115, 5, 7, RACE_BEASTMAN},
213 { "頑丈者アルコス", 30000, 195, 112, 4, 8, RACE_DWARF},
214 { "腐れ者のサリアス", 5000, 210, 115, 6, 6, RACE_ZOMBIE},
215 { "晒し骨のトゥエシク", 15000, 185, 110, 5, 9, RACE_SKELETON},
216 { "ビリオス", 25000, 190, 115, 5, 7, RACE_BEASTMAN},
217 { "ファスガル", 30000, 195, 112, 4, 8, RACE_ZOMBIE},
218 { "パラディンのエレフリス", 10000, 210, 115, 6, 6, RACE_BARBARIAN},
219 { "キ'トリッ'ク", 15000, 185, 110, 5, 9, RACE_KLACKON},
220 { "蜘蛛の友ドゥロカス", 25000, 190, 115, 5, 7, RACE_DARK_ELF},
221 { "巨人殺しのフングス", 30000, 195, 112, 4, 8, RACE_DWARF},
222 { "デランサ", 10000, 210, 115, 6, 6, RACE_ELF},
223 { "レンジャーのソルビスタニ", 15000, 185, 110, 5, 9, RACE_HALF_ELF},
224 { "ノロマのゾリル", 25000, 190, 115, 5, 7, RACE_GOLEM},
225 { "イーオン・フラックス", 20000, 195, 112, 4, 8, RACE_HALF_ELF},
226 { "強者ナドック", 10000, 210, 115, 6, 6, RACE_HOBBIT},
227 { "弱虫エラモグ", 15000, 185, 110, 5, 9, RACE_KOBOLD},
228 { "公正なエオウィリス", 25000, 190, 115, 5, 7, RACE_VAMPIRE},
229 { "バルログ殺しのヒュイモグ", 30000, 195, 112, 4, 8, RACE_HALF_ORC},
230 { "冷酷ピーダス", 5000, 210, 115, 6, 6, RACE_HUMAN},
231 { "ヴァモグ スレイヤー", 15000, 185, 110, 5, 9, RACE_HALF_OGRE},
232 { "性悪フーシュナク", 25000, 190, 115, 5, 7, RACE_BEASTMAN},
233 { "舞闘バレン", 30000, 195, 112, 4, 8, RACE_BARBARIAN},
234 { "残忍なるアーノルド", 5000, 210, 115, 6, 6, RACE_BARBARIAN},
235 { "獣殺しのアーンダル", 10000, 185, 110, 5, 9, RACE_HALF_ELF},
236 { "ビーストマスター・エディー", 25000, 190, 115, 5, 7, RACE_HALF_ORC},
237 { "竜殺しのオグライン", 30000, 195, 112, 4, 8, RACE_DWARF},
239 { "Arnold the Beastly", 5000, 210, 115, 6, 6, RACE_BARBARIAN},
240 { "Arndal Beast-Slayer", 10000, 185, 110, 5, 9, RACE_HALF_ELF},
241 { "Eddie Beast-Master", 25000, 190, 115, 5, 7, RACE_HALF_ORC},
242 { "Oglign Dragon-Slayer", 30000, 195, 112, 4, 8, RACE_DWARF},
243 { "Drew the Skilled", 10000, 210, 115, 6, 6, RACE_HUMAN},
244 { "Orrax Dragonson", 15000, 185, 110, 5, 9, RACE_DRACONIAN},
245 { "Anthrax Disease-Carrier", 25000, 190, 115, 5, 7, RACE_BEASTMAN},
246 { "Arkhoth the Stout", 30000, 195, 112, 4, 8, RACE_DWARF},
247 { "Sarlyas the Rotten", 5000, 210, 115, 6, 6, RACE_ZOMBIE},
248 { "Tuethic Bare-Bones", 15000, 185, 110, 5, 9, RACE_SKELETON},
249 { "Bilious", 25000, 190, 115, 5, 7, RACE_BEASTMAN},
250 { "Fasgul", 30000, 195, 112, 4, 8, RACE_ZOMBIE},
251 { "Ellefris the Paladin", 10000, 210, 115, 6, 6, RACE_BARBARIAN},
252 { "K'trrik'k", 15000, 185, 110, 5, 9, RACE_KLACKON},
253 { "Drocus Spiderfriend", 25000, 190, 115, 5, 7, RACE_DARK_ELF},
254 { "Fungus Giant-Slayer", 30000, 195, 112, 4, 8, RACE_DWARF},
255 { "Delantha", 10000, 210, 115, 6, 6, RACE_ELF},
256 { "Solvistani the Ranger", 15000, 185, 110, 5, 9, RACE_HALF_ELF},
257 { "Xoril the Slow", 25000, 190, 115, 5, 7, RACE_GOLEM},
258 { "Aeon Flux", 20000, 195, 112, 4, 8, RACE_HALF_ELF},
259 { "Nadoc the Strong", 10000, 210, 115, 6, 6, RACE_HOBBIT},
260 { "Eramog the Weak", 15000, 185, 110, 5, 9, RACE_KOBOLD},
261 { "Eowilith the Fair", 25000, 190, 115, 5, 7, RACE_VAMPIRE},
262 { "Huimog Balrog-Slayer", 30000, 195, 112, 4, 8, RACE_HALF_ORC},
263 { "Peadus the Cruel", 5000, 210, 115, 6, 6, RACE_HUMAN},
264 { "Vamog Slayer", 15000, 185, 110, 5, 9, RACE_HALF_OGRE},
265 { "Hooshnak the Vicious", 25000, 190, 115, 5, 7, RACE_BEASTMAN},
266 { "Balenn War-Dancer", 30000, 195, 112, 4, 8, RACE_BARBARIAN},
267 { "Arnold the Beastly", 5000, 210, 115, 6, 6, RACE_BARBARIAN},
268 { "Arndal Beast-Slayer", 10000, 185, 110, 5, 9, RACE_HALF_ELF},
269 { "Eddie Beast-Master", 25000, 190, 115, 5, 7, RACE_HALF_ORC},
270 { "Oglign Dragon-Slayer", 30000, 195, 112, 4, 8, RACE_DWARF},
274 /* Temple - 22 unique names */
276 { "質素なルードヴィヒ", 5000, 175, 109, 6, 15, RACE_HUMAN},
277 { "パラディンのガンナー", 10000, 185, 110, 5, 23, RACE_HUMAN},
278 { "選ばれしトリン", 25000, 180, 107, 6, 20, RACE_ELF},
279 { "賢明なるサラストロ", 30000, 185, 109, 5, 15, RACE_DWARF},
280 { "パーシヴァル卿", 25000, 180, 107, 6, 20, RACE_HIGH_ELF},
281 { "神聖なるアセナス", 30000, 185, 109, 5, 15, RACE_HUMAN},
282 { "マッキノン", 10000, 175, 109, 6, 15, RACE_HUMAN},
283 { "謹み婦人", 15000, 185, 110, 5, 23, RACE_HIGH_ELF},
284 { "ドルイドのハシュニック", 25000, 180, 107, 6, 20, RACE_HOBBIT},
285 { "フィナク", 30000, 185, 109, 5, 15, RACE_YEEK},
286 { "クリキック", 10000, 175, 109, 6, 15, RACE_KLACKON},
287 { "荒くれ者モリヴァル", 15000, 185, 110, 5, 23, RACE_ELF},
288 { "暗きホシャック", 25000, 180, 107, 6, 20, RACE_IMP},
289 { "賢者アタール", 30000, 185, 109, 5, 15, RACE_HUMAN},
290 { "清きイベニッド", 10000, 175, 109, 6, 15, RACE_HUMAN},
291 { "エリディシュ", 15000, 185, 110, 5, 23, RACE_HALF_TROLL},
292 { "呪術師ヴルドゥシュ", 25000, 180, 107, 6, 20, RACE_HALF_OGRE},
293 { "狂戦士ハオブ", 30000, 185, 109, 5, 15, RACE_BARBARIAN},
294 { "若きプルーグディシュ", 10000, 175, 109, 6, 15, RACE_HALF_OGRE},
295 { "きちがいラムワイズ", 15000, 185, 110, 5, 23, RACE_YEEK},
296 { "有徳者ムワート", 25000, 180, 107, 6, 20, RACE_KOBOLD},
297 { "弱虫ダードバード", 30000, 185, 109, 5, 15, RACE_SPECTRE},
298 { "質素なルードヴィヒ", 5000, 175, 109, 6, 15, RACE_HUMAN},
299 { "パラディンのガンナー", 10000, 185, 110, 5, 23, RACE_HUMAN},
300 { "選ばれしトリン", 25000, 180, 107, 6, 20, RACE_ELF},
301 { "賢明なるサラストロ", 30000, 185, 109, 5, 15, RACE_DWARF},
302 { "パーシヴァル卿", 25000, 180, 107, 6, 20, RACE_HIGH_ELF},
303 { "神聖なるアセナス", 30000, 185, 109, 5, 15, RACE_HUMAN},
304 { "マッキノン", 10000, 175, 109, 6, 15, RACE_HUMAN},
305 { "謹み婦人", 15000, 185, 110, 5, 23, RACE_HIGH_ELF},
306 { "ドルイドのハシュニック", 25000, 180, 107, 6, 20, RACE_HOBBIT},
307 { "フィナク", 30000, 185, 109, 5, 15, RACE_YEEK},
309 { "Ludwig the Humble", 5000, 175, 109, 6, 15, RACE_DWARF},
310 { "Gunnar the Paladin", 10000, 185, 110, 5, 23, RACE_HALF_TROLL},
311 { "Torin the Chosen", 25000, 180, 107, 6, 20, RACE_HIGH_ELF},
312 { "Sarastro the Wise", 30000, 185, 109, 5, 15, RACE_HUMAN},
313 { "Sir Parsival the Pure", 25000, 180, 107, 6, 20, RACE_HIGH_ELF},
314 { "Asenath the Holy", 30000, 185, 109, 5, 15, RACE_HUMAN},
315 { "McKinnon", 10000, 175, 109, 6, 15, RACE_HUMAN},
316 { "Mistress Chastity", 15000, 185, 110, 5, 23, RACE_HIGH_ELF},
317 { "Hashnik the Druid", 25000, 180, 107, 6, 20, RACE_HOBBIT},
318 { "Finak", 30000, 185, 109, 5, 15, RACE_YEEK},
319 { "Krikkik", 10000, 175, 109, 6, 15, RACE_KLACKON},
320 { "Morival the Wild", 15000, 185, 110, 5, 23, RACE_ELF},
321 { "Hoshak the Dark", 25000, 180, 107, 6, 20, RACE_IMP},
322 { "Atal the Wise", 30000, 185, 109, 5, 15, RACE_HUMAN},
323 { "Ibenidd the Chaste", 10000, 175, 109, 6, 15, RACE_HUMAN},
324 { "Eridish", 15000, 185, 110, 5, 23, RACE_HALF_TROLL},
325 { "Vrudush the Shaman", 25000, 180, 107, 6, 20, RACE_HALF_OGRE},
326 { "Haob the Berserker", 30000, 185, 109, 5, 15, RACE_BARBARIAN},
327 { "Proogdish the Youthfull", 10000, 175, 109, 6, 15, RACE_HALF_OGRE},
328 { "Lumwise the Mad", 15000, 185, 110, 5, 23, RACE_YEEK},
329 { "Muirt the Virtuous", 25000, 180, 107, 6, 20, RACE_KOBOLD},
330 { "Dardobard the Weak", 30000, 185, 109, 5, 15, RACE_SPECTRE},
331 { "Ludwig the Humble", 5000, 175, 109, 6, 15, RACE_DWARF},
332 { "Gunnar the Paladin", 10000, 185, 110, 5, 23, RACE_HALF_TROLL},
333 { "Torin the Chosen", 25000, 180, 107, 6, 20, RACE_HIGH_ELF},
334 { "Sarastro the Wise", 30000, 185, 109, 5, 15, RACE_HUMAN},
335 { "Sir Parsival the Pure", 25000, 180, 107, 6, 20, RACE_HIGH_ELF},
336 { "Asenath the Holy", 30000, 185, 109, 5, 15, RACE_HUMAN},
337 { "McKinnon", 10000, 175, 109, 6, 15, RACE_HUMAN},
338 { "Mistress Chastity", 15000, 185, 110, 5, 23, RACE_HIGH_ELF},
339 { "Hashnik the Druid", 25000, 180, 107, 6, 20, RACE_HOBBIT},
340 { "Finak", 30000, 185, 109, 5, 15, RACE_YEEK},
344 /* Alchemist - 26 unique names */
346 { "化学者マウザー", 10000, 190, 111, 5, 8, RACE_HALF_ELF},
347 { "カオスのウィズル", 10000, 190, 110, 6, 8, RACE_HOBBIT},
348 { "強欲ミダス", 15000, 200, 116, 6, 9, RACE_GNOME},
349 { "貧弱ジャ=ファー", 15000, 220, 111, 4, 9, RACE_ELF},/*FIRST*/
350 { "カカルラカカル", 15000, 200, 116, 6, 9, RACE_KLACKON},
351 { "錬金術師ジャル=エス", 15000, 220, 111, 4, 9, RACE_ELF},
352 { "用心深いファネラス", 10000, 190, 111, 5, 8, RACE_DWARF},
353 { "キチガイのルンシー", 10000, 190, 110, 6, 8, RACE_HUMAN},
354 { "グランブルワース", 15000, 200, 116, 6, 9, RACE_GNOME},
355 { "フリッター", 15000, 220, 111, 4, 9, RACE_SPRITE},
356 { "ザリルス", 10000, 190, 111, 5, 8, RACE_HUMAN},
357 { "古きエグバート", 10000, 190, 110, 6, 8, RACE_DWARF},
358 { "誇り高きヴァリンドラ", 15000, 200, 116, 6, 9, RACE_HIGH_ELF},
359 { "錬金術師タエン", 15000, 220, 111, 4, 9, RACE_HUMAN},
360 { "巧言カイド", 10000, 190, 111, 5, 8, RACE_VAMPIRE},
361 { "暗きフリア", 10000, 190, 110, 6, 8, RACE_NIBELUNG},
362 { "質素なドムリ", 15000, 200, 116, 6, 9, RACE_DWARF},
363 { "魔の子ヤァジュッカ", 15000, 220, 111, 4, 9, RACE_IMP},
364 { "薬草師ジェララルドール", 10000, 190, 111, 5, 8, RACE_HIGH_ELF},
365 { "賢者オレラルダン", 10000, 190, 110, 6, 8, RACE_BARBARIAN},
366 { "デモニシストのフゾグロ", 15000, 200, 116, 6, 9, RACE_IMP},
367 { "錬金術師ドゥリアシュ", 15000, 220, 111, 4, 9, RACE_HALF_ORC},
368 { "強者ネリア", 10000, 190, 111, 5, 8, RACE_CYCLOPS},
369 { "辛口リグナス", 10000, 190, 110, 6, 8, RACE_HALF_ORC},
370 { "ティルバ", 15000, 200, 116, 6, 9, RACE_HOBBIT},
371 { "金持ちミリルドリック", 15000, 220, 111, 4, 9, RACE_HUMAN},
373 { "科学者マウザー", 10000, 190, 111, 5, 8, RACE_HALF_ELF},
374 { "カオスのウィズル", 10000, 190, 110, 6, 8, RACE_HOBBIT},
375 { "強欲ミダス", 15000, 200, 116, 6, 9, RACE_GNOME},
376 { "錬金術師ジャ=ファー", 15000, 220, 111, 4, 9, RACE_ELF},
377 { "カカルラカカル", 15000, 200, 116, 6, 9, RACE_KLACKON},
378 { "錬金術師ジャル=エス", 15000, 220, 111, 4, 9, RACE_ELF},
380 { "Mauser the Chemist", 10000, 190, 111, 5, 8, RACE_HALF_ELF},
381 { "Wizzle the Chaotic", 10000, 190, 110, 6, 8, RACE_HOBBIT},
382 { "Midas the Greedy", 15000, 200, 116, 6, 9, RACE_GNOME},
383 { "Ja-Far the Alchemist", 15000, 220, 111, 4, 9, RACE_ELF},
384 { "Kakalrakakal", 15000, 200, 116, 6, 9, RACE_KLACKON},
385 { "Jal-Eth the Alchemist", 15000, 220, 111, 4, 9, RACE_ELF},
386 { "Fanelath the Cautious", 10000, 190, 111, 5, 8, RACE_DWARF},
387 { "Runcie the Insane", 10000, 190, 110, 6, 8, RACE_HUMAN},
388 { "Grumbleworth", 15000, 200, 116, 6, 9, RACE_GNOME},
389 { "Flitter", 15000, 220, 111, 4, 9, RACE_SPRITE},
390 { "Xarillus", 10000, 190, 111, 5, 8, RACE_HUMAN},
391 { "Egbert the Old", 10000, 190, 110, 6, 8, RACE_DWARF},
392 { "Valindra the Proud", 15000, 200, 116, 6, 9, RACE_HIGH_ELF},
393 { "Taen the Alchemist", 15000, 220, 111, 4, 9, RACE_HUMAN},
394 { "Cayd the Sweet", 10000, 190, 111, 5, 8, RACE_VAMPIRE},
395 { "Fulir the Dark", 10000, 190, 110, 6, 8, RACE_NIBELUNG},
396 { "Domli the Humble", 15000, 200, 116, 6, 9, RACE_DWARF},
397 { "Yaarjukka Demonspawn", 15000, 220, 111, 4, 9, RACE_IMP},
398 { "Gelaraldor the Herbmaster", 10000, 190, 111, 5, 8, RACE_HIGH_ELF},
399 { "Olelaldan the Wise", 10000, 190, 110, 6, 8, RACE_BARBARIAN},
400 { "Fthoglo the Demonicist", 15000, 200, 116, 6, 9, RACE_IMP},
401 { "Dridash the Alchemist", 15000, 220, 111, 4, 9, RACE_HALF_ORC},
402 { "Nelir the Strong", 10000, 190, 111, 5, 8, RACE_CYCLOPS},
403 { "Lignus the Pungent", 10000, 190, 110, 6, 8, RACE_HALF_ORC},
404 { "Tilba", 15000, 200, 116, 6, 9, RACE_HOBBIT},
405 { "Myrildric the Wealthy", 15000, 220, 111, 4, 9, RACE_HUMAN},
407 { "Mauser the Chemist", 10000, 190, 111, 5, 8, RACE_HALF_ELF},
408 { "Wizzle the Chaotic", 10000, 190, 110, 6, 8, RACE_HOBBIT},
409 { "Midas the Greedy", 15000, 200, 116, 6, 9, RACE_GNOME},
410 { "Ja-Far the Alchemist", 15000, 220, 111, 4, 9, RACE_ELF},
411 { "Kakalrakakal", 15000, 200, 116, 6, 9, RACE_KLACKON},
412 { "Jal-Eth the Alchemist", 15000, 220, 111, 4, 9, RACE_ELF},
417 /* Magic Shop - 23 unique names */
419 { "ソーサラーのロ=パン", 20000, 200, 110, 7, 8, RACE_HALF_ELF},
420 { "偉大なるブガービイ", 20000, 215, 113, 6, 10, RACE_GNOME},
421 { "イェンダーの魔法使い", 30000, 200, 110, 7, 10, RACE_HUMAN},
422 { "死霊使いリャク",30000, 175, 110, 5, 11, RACE_HIGH_ELF},
423 { "魔術師スキドゥニー", 15000, 200, 110, 7, 8, RACE_HALF_ELF},
424 { "幻術師キリア", 30000, 200, 110, 7, 10, RACE_HUMAN},
425 { "死霊術師ニッキ", 30000, 175, 110, 5, 11, RACE_DARK_ELF},
426 { "ソロストラン", 15000, 200, 110, 7, 8, RACE_SPRITE},
427 { "烏賊口アチシェ", 20000, 215, 113, 6, 10, RACE_MIND_FLAYER},
428 { "貴族のカザ", 30000, 200, 110, 7, 10, RACE_HIGH_ELF},
429 { "暗きファジル", 30000, 175, 110, 5, 11, RACE_DARK_ELF},
430 { "偉大なるケルドーン", 15000, 200, 110, 7, 8, RACE_DWARF},
431 { "フィランスロプス", 20000, 215, 113, 6, 10, RACE_HOBBIT},
432 { "魔女のアグナー", 30000, 200, 110, 7, 10, RACE_HUMAN},
433 { "死霊術師ビュリアンス", 30000, 175, 110, 5, 11, RACE_BEASTMAN},
434 { "ハイメイジのヴイラク", 15000, 200, 110, 7, 8, RACE_BEASTMAN},
435 { "知恵者マディッシュ", 20000, 215, 113, 6, 10, RACE_BEASTMAN},
436 { "ファレブリンボール", 30000, 200, 110, 7, 10, RACE_HIGH_ELF},
437 { "陰険フェリル=ガンド", 30000, 175, 110, 5, 11, RACE_DARK_ELF},
438 { "呪術師サレゴード", 15000, 200, 110, 7, 8, RACE_BARBARIAN},
439 { "神秘家クトゥアロス", 20000, 215, 113, 6, 10, RACE_MIND_FLAYER},
440 { "幻術師イベリ", 30000, 200, 110, 7, 10, RACE_SKELETON},
441 { "死霊術師ヘトー", 30000, 175, 110, 5, 11, RACE_YEEK},
442 { "魔術師ロ=パン", 20000, 200, 110, 7, 8, RACE_HALF_ELF},
443 { "偉大なるブガービイ", 20000, 215, 113, 6, 10, RACE_GNOME},
444 { "イェンダーの魔法使い", 30000, 200, 110, 7, 10, RACE_HUMAN},
445 { "死霊術師リャク", 30000, 175, 110, 5, 11, RACE_DARK_ELF},
446 { "魔術師スキドゥニー", 15000, 200, 110, 7, 8, RACE_HALF_ELF},
447 { "幻術師キリア", 30000, 200, 110, 7, 10, RACE_HUMAN},
448 { "死霊術師ニッキ", 30000, 175, 110, 5, 11, RACE_DARK_ELF},
449 { "ソロストラン", 15000, 200, 110, 7, 8, RACE_SPRITE},
450 { "烏賊口アチシェ", 20000, 215, 113, 6, 10, RACE_MIND_FLAYER},
452 { "Lo Pan the Sorcerer", 20000, 200, 110, 7, 8, RACE_HALF_ELF},
453 { "Buggerby the Great", 20000, 215, 113, 6, 10, RACE_GNOME},
454 { "The Wizard of Yendor", 30000, 200, 110, 7, 10, RACE_HUMAN},
455 { "Rjak the Necromancer", 30000, 175, 110, 5, 11, RACE_DARK_ELF},
456 { "Skidney the Sorcerer", 15000, 200, 110, 7, 8, RACE_HALF_ELF},
457 { "Kyria the Illusionist", 30000, 200, 110, 7, 10, RACE_HUMAN},
458 { "Nikki the Necromancer", 30000, 175, 110, 5, 11, RACE_DARK_ELF},
459 { "Solostoran", 15000, 200, 110, 7, 8, RACE_SPRITE},
460 { "Achshe the Tentacled", 20000, 215, 113, 6, 10, RACE_MIND_FLAYER},
461 { "Kaza the Noble", 30000, 200, 110, 7, 10, RACE_HIGH_ELF},
462 { "Fazzil the Dark", 30000, 175, 110, 5, 11, RACE_DARK_ELF},
463 { "Keldorn the Grand", 15000, 200, 110, 7, 8, RACE_DWARF},
464 { "Philanthropus", 20000, 215, 113, 6, 10, RACE_HOBBIT},
465 { "Agnar the Enchantress", 30000, 200, 110, 7, 10, RACE_HUMAN},
466 { "Buliance the Necromancer", 30000, 175, 110, 5, 11, RACE_BEASTMAN},
467 { "Vuirak the High-Mage", 15000, 200, 110, 7, 8, RACE_BEASTMAN},
468 { "Madish the Smart", 20000, 215, 113, 6, 10, RACE_BEASTMAN},
469 { "Falebrimbor", 30000, 200, 110, 7, 10, RACE_HIGH_ELF},
470 { "Felil-Gand the Subtle", 30000, 175, 110, 5, 11, RACE_DARK_ELF},
471 { "Thalegord the Shaman", 15000, 200, 110, 7, 8, RACE_BARBARIAN},
472 { "Cthoaloth the Mystic", 20000, 215, 113, 6, 10, RACE_MIND_FLAYER},
473 { "Ibeli the Illusionist", 30000, 200, 110, 7, 10, RACE_SKELETON},
474 { "Heto the Necromancer", 30000, 175, 110, 5, 11, RACE_YEEK},
475 { "Lo Pan the Sorcerer", 20000, 200, 110, 7, 8, RACE_HALF_ELF},
476 { "Buggerby the Great", 20000, 215, 113, 6, 10, RACE_GNOME},
477 { "The Wizard of Yendor", 30000, 200, 110, 7, 10, RACE_HUMAN},
478 { "Rjak the Necromancer", 30000, 175, 110, 5, 11, RACE_DARK_ELF},
479 { "Skidney the Sorcerer", 15000, 200, 110, 7, 8, RACE_HALF_ELF},
480 { "Kyria the Illusionist", 30000, 200, 110, 7, 10, RACE_HUMAN},
481 { "Nikki the Necromancer", 30000, 175, 110, 5, 11, RACE_DARK_ELF},
482 { "Solostoran", 15000, 200, 110, 7, 8, RACE_SPRITE},
483 { "Achshe the Tentacled", 20000, 215, 113, 6, 10, RACE_MIND_FLAYER},
487 /* Black Market - 32 unique names */
489 { "ガリー=ギガズ", 20000, 250, 150, 10, 5, RACE_HALF_TROLL},
490 { "ゴブリンのヒストーア", 20000, 250, 150, 10, 5, RACE_HALF_ORC},
491 { "フェレンギ人クアーク", 30000, 250, 150, 10, 5, RACE_HUMAN},
492 { "公正なる(?)トッピ", 30000, 250, 150, 10, 5, RACE_ELF},
493 { "死人ヴァッサ", 20000, 250, 150, 10, 5, RACE_ZOMBIE},
494 { "裏切り者カイン", 20000, 250, 150, 10, 5, RACE_VAMPIRE},
495 { "ブボニカス", 30000, 250, 150, 10, 5, RACE_BEASTMAN},
496 { "コープスライト", 30000, 250, 150, 10, 5, RACE_SPECTRE},
497 { "血に飢えしパリッシュ", 20000, 250, 150, 10, 5, RACE_VAMPIRE},
498 { "ヴァイル", 20000, 250, 150, 10, 5, RACE_SKELETON},
499 { "信頼のプレンティス", 30000, 250, 150, 10, 5, RACE_SKELETON},
500 { "人間殺しのグリエラ", 30000, 250, 150, 10, 5, RACE_IMP},
501 { "エンジェル", 20000, 250, 150, 10, 5, RACE_VAMPIRE},
502 { "水膨れフロツァム", 20000, 250, 150, 10, 5, RACE_ZOMBIE},
503 { "ニーヴァル", 30000, 250, 150, 10, 5, RACE_VAMPIRE},
504 { "明るいアナスタシア", 30000, 250, 150, 10, 5, RACE_SPECTRE},
505 { "死霊術師チャリティー", 20000, 250, 150, 10, 5, RACE_DARK_ELF},
506 { "ボクサーのプグナシオス", 20000, 250, 150, 10, 5, RACE_HALF_ORC},
507 { "幸運なフットソア", 30000, 250, 150, 10, 5, RACE_BEASTMAN},
508 { "光指のシドリア", 30000, 250, 150, 10, 5, RACE_HUMAN},
509 { "手品師リアソー", 20000, 250, 150, 10, 5, RACE_HOBBIT},
510 { "やりくり上手のジャナッカ", 20000, 250, 150, 10, 5, RACE_GNOME},
511 { "悪党シーナ", 30000, 250, 150, 10, 5, RACE_GNOME},
512 { "大爪アルニッキ", 30000, 250, 150, 10, 5, RACE_DRACONIAN},
513 { "貧乏チャエアンド", 20000, 250, 150, 10, 5, RACE_HUMAN},
514 { "山賊アファードーフ", 20000, 250, 150, 10, 5, RACE_BARBARIAN},
515 { "強欲ラザクスル", 30000, 250, 150, 10, 5, RACE_MIND_FLAYER},
516 { "ファラレウィン", 30000, 250, 150, 10, 5, RACE_SPRITE},
517 { "しわしわヴォスール", 20000, 250, 150, 10, 5, RACE_NIBELUNG},
518 { "ハンサムなアラオード", 20000, 250, 150, 10, 5, RACE_AMBERITE},
519 { "負け犬セラドフリド", 30000, 250, 150, 10, 5, RACE_HUMAN},
520 { "片足のエルーロ", 30000, 250, 150, 10, 5, RACE_HALF_OGRE},
522 { "Gary Gygaz", 20000, 250, 150, 10, 5, RACE_HALF_TROLL},
523 { "Histor the Goblin", 20000, 250, 150, 10, 5, RACE_HALF_ORC},
524 { "Quark the Ferengi", 30000, 250, 150, 10, 5, RACE_DWARF},
525 { "Topi the Fair(?)", 30000, 250, 150, 10, 5, RACE_HUMAN},
526 { "Vhassa the Dead", 20000, 250, 150, 10, 5, RACE_ZOMBIE},
527 { "Kyn the Treacherous", 20000, 250, 150, 10, 5, RACE_VAMPIRE},
528 { "Bubonicus", 30000, 250, 150, 10, 5, RACE_BEASTMAN},
529 { "Corpselight", 30000, 250, 150, 10, 5, RACE_SPECTRE},
530 { "Parrish the Bloodthirsty", 20000, 250, 150, 10, 5, RACE_VAMPIRE},
531 { "Vile", 20000, 250, 150, 10, 5, RACE_SKELETON},
532 { "Prentice the Trusted", 30000, 250, 150, 10, 5, RACE_SKELETON},
533 { "Griella Humanslayer", 30000, 250, 150, 10, 5, RACE_IMP},
534 { "Angel", 20000, 250, 150, 10, 5, RACE_VAMPIRE},
535 { "Flotsam the Bloated", 20000, 250, 150, 10, 5, RACE_ZOMBIE},
536 { "Nieval", 30000, 250, 150, 10, 5, RACE_VAMPIRE},
537 { "Anastasia the Luminous", 30000, 250, 150, 10, 5, RACE_SPECTRE},
538 { "Charity the Necromancer", 20000, 250, 150, 10, 5, RACE_DARK_ELF},
539 { "Pugnacious the Pugilist", 20000, 250, 150, 10, 5, RACE_HALF_ORC},
540 { "Footsore the Lucky", 30000, 250, 150, 10, 5, RACE_BEASTMAN},
541 { "Sidria Lighfingered", 30000, 250, 150, 10, 5, RACE_HUMAN},
542 { "Riatho the Juggler", 20000, 250, 150, 10, 5, RACE_HOBBIT},
543 { "Janaaka the Shifty", 20000, 250, 150, 10, 5, RACE_GNOME},
544 { "Cina the Rogue", 30000, 250, 150, 10, 5, RACE_GNOME},
545 { "Arunikki Greatclaw", 30000, 250, 150, 10, 5, RACE_DRACONIAN},
546 { "Chaeand the Poor", 20000, 250, 150, 10, 5, RACE_HUMAN},
547 { "Afardorf the Brigand", 20000, 250, 150, 10, 5, RACE_BARBARIAN},
548 { "Lathaxl the Greedy", 30000, 250, 150, 10, 5, RACE_MIND_FLAYER},
549 { "Falarewyn", 30000, 250, 150, 10, 5, RACE_SPRITE},
550 { "Vosur the Wrinkled", 20000, 250, 150, 10, 5, RACE_NIBELUNG},
551 { "Araord the Handsome", 20000, 250, 150, 10, 5, RACE_AMBERITE},
552 { "Theradfrid the Loser", 30000, 250, 150, 10, 5, RACE_HUMAN},
553 { "One-Legged Eroolo", 30000, 250, 150, 10, 5, RACE_HALF_OGRE},
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},
588 { "我が家", 0, 100, 100, 0, 99, 99},
589 { "我が家", 0, 100, 100, 0, 99, 99},
590 { "我が家", 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},
621 { "Your home", 0, 100, 100, 0, 99, 99},
622 { "Your home", 0, 100, 100, 0, 99, 99},
623 { "Your home", 0, 100, 100, 0, 99, 99},
629 /* Bookstore - 21 unique names */
631 { "強欲ドラフ", 10000, 175, 108, 4, 12, RACE_HUMAN},
632 { "賢者オドナー", 15000, 120, 105, 6, 16, RACE_HIGH_ELF},
633 { "中立のガンダー", 25000, 120, 110, 7, 19, RACE_DARK_ELF},
634 { "忍耐の人ロ=シャ", 30000, 140, 105, 6, 12, RACE_ELF},
635 { "ランドルフ・カーター", 15000, 175, 108, 4, 12, RACE_HUMAN},
636 { "隼のサライ", 15000, 175, 108, 4, 12, RACE_HUMAN},
637 { "千里眼ボドリル", 20000, 120, 105, 6, 16, RACE_HIGH_ELF},
638 { "沈黙のヴェオロイン", 25000, 120, 110, 7, 19, RACE_ZOMBIE},
639 { "学者のヴァンシラス", 30000, 140, 105, 6, 12, RACE_MIND_FLAYER},
640 { "物書きオセイン", 15000, 175, 108, 4, 12, RACE_SKELETON},
641 { "本の虫オルヴァー", 20000, 120, 105, 6, 16, RACE_VAMPIRE},
642 { "浅井墓男", 25000, 120, 110, 7, 19, RACE_ZOMBIE},
643 { "デスマスク", 30000, 140, 105, 6, 12, RACE_ZOMBIE},
644 { "学者のアスーヌ", 15000, 175, 108, 4, 12, RACE_MIND_FLAYER},
645 { "死人のプリランド", 20000, 120, 105, 6, 16, RACE_ZOMBIE},
646 { "鉄のロナール", 25000, 120, 110, 7, 19, RACE_GOLEM},
648 { "Dolaf the Greedy", 10000, 175, 108, 4, 12, RACE_HUMAN},
649 { "Odnar the Sage", 15000, 120, 105, 6, 16, RACE_HIGH_ELF},
650 { "Gandar the Neutral", 25000, 120, 110, 7, 19, RACE_DARK_ELF},
651 { "Ro-sha the Patient", 30000, 140, 105, 6, 12, RACE_ELF},
652 { "Randolph Carter", 15000, 175, 108, 4, 12, RACE_HUMAN},
653 { "Sarai the Swift", 15000, 175, 108, 4, 12, RACE_HUMAN},
654 { "Bodril the Seer", 20000, 120, 105, 6, 16, RACE_HIGH_ELF},
655 { "Veloin the Quiet", 25000, 120, 110, 7, 19, RACE_ZOMBIE},
656 { "Vanthylas the Learned", 30000, 140, 105, 6, 12, RACE_MIND_FLAYER},
657 { "Ossein the Literate", 15000, 175, 108, 4, 12, RACE_SKELETON},
658 { "Olvar Bookworm", 20000, 120, 105, 6, 16, RACE_VAMPIRE},
659 { "Shallowgrave", 25000, 120, 110, 7, 19, RACE_ZOMBIE},
660 { "Death Mask", 30000, 140, 105, 6, 12, RACE_ZOMBIE},
661 { "Asuunu the Learned", 15000, 175, 108, 4, 12, RACE_MIND_FLAYER},
662 { "Prirand the Dead", 20000, 120, 105, 6, 16, RACE_ZOMBIE},
663 { "Ronar the Iron", 25000, 120, 110, 7, 19, RACE_GOLEM},
666 { "ガリル=ガミル", 30000, 140, 105, 6, 12, RACE_ELF},
667 { "本食いローバグ", 15000, 175, 108, 4, 12, RACE_KOBOLD},
668 { "キリアリキーク", 20000, 120, 105, 6, 16, RACE_KLACKON},
669 { "静かなるリリン", 25000, 120, 110, 7, 19, RACE_DWARF},
670 { "王者イサング", 30000, 140, 105, 6, 12, RACE_HIGH_ELF},
671 { "強欲ドラフ", 10000, 175, 108, 4, 12, RACE_HUMAN},
672 { "賢者オドナー", 15000, 120, 105, 6, 16, RACE_HIGH_ELF},
673 { "中立のガンダー", 25000, 120, 110, 7, 19, RACE_DARK_ELF},
674 { "忍耐の人ロ=シャ", 30000, 140, 105, 6, 12, RACE_ELF},
675 { "ランドルフ・カーター", 15000, 175, 108, 4, 12, RACE_HUMAN},
676 { "隼サライ", 15000, 175, 108, 4, 12, RACE_HUMAN},
677 { "千里眼ボドリル", 20000, 120, 105, 6, 16, RACE_HIGH_ELF},
678 { "沈黙のヴェオロイン", 25000, 120, 110, 7, 19, RACE_ZOMBIE},
679 { "学者のヴァンシラス", 30000, 140, 105, 6, 12, RACE_MIND_FLAYER},
680 { "物書きオセイン", 15000, 175, 108, 4, 12, RACE_SKELETON},
681 { "本の虫オルヴァー", 20000, 120, 105, 6, 16, RACE_VAMPIRE},
683 { "Galil-Gamir", 30000, 140, 105, 6, 12, RACE_ELF},
684 { "Rorbag Book-Eater", 15000, 175, 108, 4, 12, RACE_KOBOLD},
685 { "Kiriarikirk", 20000, 120, 105, 6, 16, RACE_KLACKON},
686 { "Rilin the Quiet", 25000, 120, 110, 7, 19, RACE_DWARF},
687 { "Isung the Lord", 30000, 140, 105, 6, 12, RACE_HIGH_ELF},
688 { "Dolaf the Greedy", 10000, 175, 108, 4, 12, RACE_HUMAN},
689 { "Odnar the Sage", 15000, 120, 105, 6, 16, RACE_HIGH_ELF},
690 { "Gandar the Neutral", 25000, 120, 110, 7, 19, RACE_DARK_ELF},
691 { "Ro-sha the Patient", 30000, 140, 105, 6, 12, RACE_ELF},
692 { "Randolph Carter", 15000, 175, 108, 4, 12, RACE_HUMAN},
693 { "Sarai the Swift", 15000, 175, 108, 4, 12, RACE_HUMAN},
694 { "Bodril the Seer", 20000, 120, 105, 6, 16, RACE_HIGH_ELF},
695 { "Veloin the Quiet", 25000, 120, 110, 7, 19, RACE_ZOMBIE},
696 { "Vanthylas the Learned", 30000, 140, 105, 6, 12, RACE_MIND_FLAYER},
697 { "Ossein the Literate", 15000, 175, 108, 4, 12, RACE_SKELETON},
698 { "Olvar Bookworm", 20000, 120, 105, 6, 16, RACE_VAMPIRE},
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},
734 { "博物館", 0, 100, 100, 0, 99, 99},
735 { "博物館", 0, 100, 100, 0, 99, 99},
736 { "博物館", 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},
767 { "Museum", 0, 100, 100, 0, 99, 99},
768 { "Museum", 0, 100, 100, 0, 99, 99},
769 { "Museum", 0, 100, 100, 0, 99, 99},
776 static int cur_store_num = 0;
777 static int store_top = 0;
778 static int store_bottom = 0;
779 static int xtra_stock = 0;
780 static store_type *st_ptr = NULL;
781 static const owner_type *ot_ptr = NULL;
782 static s16b old_town_num = 0;
783 static s16b inner_town_num = 0;
784 #define RUMOR_CHANCE 8
786 #define MAX_COMMENT_1 6
788 static concptr comment_1[MAX_COMMENT_1] =
809 /*! ブラックマーケット追加メッセージ(承諾) */
810 static concptr comment_1_B[MAX_COMMENT_1] = {
819 #define MAX_COMMENT_2A 2
821 static concptr comment_2a[MAX_COMMENT_2A] =
824 "私の忍耐力を試しているのかい? $%s が最後だ。",
825 "我慢にも限度があるぞ。 $%s が最後だ。"
827 "You try my patience. %s is final.",
828 "My patience grows thin. %s is final."
833 #define MAX_COMMENT_2B 12
835 static concptr comment_2b[MAX_COMMENT_2B] =
838 " $%s ぐらいは出さなきゃダメだよ。",
841 "何て奴だ! $%s 以下はあり得ないぞ。",
842 "それじゃ少なすぎる! $%s は欲しいところだ。",
843 "バカにしている! $%s はもらわないと。",
845 "おいおい! $%s を考えてくれないか?",
846 "1000匹のオークのノミに苦しめられるがいい! $%s だ。",
847 "お前の大切なものに災いあれ! $%s でどうだ。",
848 "モルゴスに賞味されるがいい!本当は $%s なんだろう?",
849 "お前の母親はオーガか! $%s は出すつもりなんだろ?"
851 "I can take no less than %s gold pieces.",
852 "I will accept no less than %s gold pieces.",
853 "Ha! No less than %s gold pieces.",
854 "You knave! No less than %s gold pieces.",
855 "That's a pittance! I want %s gold pieces.",
856 "That's an insult! I want %s gold pieces.",
857 "As if! How about %s gold pieces?",
858 "My arse! How about %s gold pieces?",
859 "May the fleas of 1000 orcs molest you! Try %s gold pieces.",
860 "May your most favourite parts go moldy! Try %s gold pieces.",
861 "May Morgoth find you tasty! Perhaps %s gold pieces?",
862 "Your mother was an Ogre! Perhaps %s gold pieces?"
868 /*! ブラックマーケット用追加メッセージ(売るとき) */
869 static concptr comment_2b_B[MAX_COMMENT_2B] = {
870 "いくら俺様がお人好しとはいえ $%s が限界だね。嫌なら帰りな。",
871 "金がないのかい、あんた?まずは家に帰って $%s 揃えてきな。",
872 "物の価値が分からん奴だな。これは $%s が普通なんだよ。",
873 "俺の付けた値段に文句があるのか? $%s が限界だ。",
874 "ひょっとして新手の冗談かい? $%s 持ってないなら帰りな。",
875 "うちは他の店とは違うんだよ。$%s ぐらいは出しな。",
876 "買う気がないなら帰りな。 $%s だと言っているんだ。",
877 "話にならないね。 $%s くらい持っているんだろ?",
878 "は?なんだそりゃ? $%s の間違いか、ひょっとして?",
879 "出口はあっちだよ。それとも $%s 出せるのかい、あんたに。",
880 "命知らずな奴だな。 $%s 出せば今日の所は勘弁してやるよ。",
881 "うちの店は貧乏人お断りだ。 $%s ぐらい出せないのかい?"
884 #define MAX_COMMENT_3A 2
886 static concptr comment_3a[MAX_COMMENT_3A] =
889 "私の忍耐力を試しているのかい? $%s が最後だ。",
890 "我慢にも限度があるぞ。 $%s が最後だ。"
892 "You try my patience. %s is final.",
893 "My patience grows thin. %s is final."
899 #define MAX_COMMENT_3B 12
901 static concptr comment_3b[MAX_COMMENT_3B] =
904 "本音を言うと $%s でいいんだろ?",
906 " $%s ぐらいなら出してもいいが。",
907 " $%s 以上払うなんて考えられないね。",
908 "まあ落ちついて。 $%s でどうだい?",
909 "そのガラクタなら $%s で引き取るよ。",
910 "それじゃ高すぎる! $%s がいいとこだろ。",
911 "どうせいらないんだろ! $%s でいいだろ?",
912 "だめだめ! $%s がずっとお似合いだよ。",
913 "バカにしている! $%s がせいぜいだ。",
914 " $%s なら嬉しいところだがなあ。",
915 " $%s 、それ以上はビタ一文出さないよ!"
917 "Perhaps %s gold pieces?",
918 "How about %s gold pieces?",
919 "I will pay no more than %s gold pieces.",
920 "I can afford no more than %s gold pieces.",
921 "Be reasonable. How about %s gold pieces?",
922 "I'll buy it as scrap for %s gold pieces.",
923 "That is too much! How about %s gold pieces?",
924 "That looks war surplus! Say %s gold pieces?",
925 "Never! %s is more like it.",
926 "That's an insult! %s is more like it.",
927 "%s gold pieces and be thankful for it!",
928 "%s gold pieces and not a copper more!"
934 /*! ブラックマーケット用追加メッセージ(買い取り) */
935 static concptr comment_3b_B[MAX_COMMENT_3B] = {
936 " $%s ってところだね。そのどうしようもないガラクタは。",
937 "この俺が $%s って言っているんだから、その通りにした方が身のためだぞ。",
938 "俺の優しさに甘えるのもいい加減にしておけ。 $%s だ。",
939 "その品なら $%s で売ってくれているがね、常識ある紳士はみんな。",
940 "こりゃまた、がめつい奴だな。いくら俺が温厚とはいえ $%s が限界だ。",
941 " $%s だ。別に俺はそんなガラクタ欲しくはないんだから。",
942 "俺の鑑定額が気に入らないのか? $%s 、嫌なら帰りな。",
943 " $%s で引き取ってやるよ。喜んで受け取りな、貧乏人。",
944 "物の価値が分からん奴は始末におえんな。それは $%s なんだよ。",
945 "そんなに金が欲しいのか、あんた? $%s で満足できんのか?",
946 "入る店間違えてんじゃないのか? $%s で嫌なら他をあたってくれ。",
947 "俺の言い値にケチをつける奴がいるとは! その度胸に免じて $%s だ。"
950 #define MAX_COMMENT_4A 4
952 static concptr comment_4a[MAX_COMMENT_4A] =
955 "もうたくさんだ!何度も私をわずらわせないでくれ!",
956 "うがー!一日の我慢の限度を超えている!",
957 "もういい!時間の無駄以外のなにものでもない!",
958 "もうやってられないよ!顔も見たくない!"
960 "Enough! You have abused me once too often!",
961 "Arghhh! I have had enough abuse for one day!",
962 "That does it! You shall waste my time no more!",
963 "This is getting nowhere! I'm going to Londis!"
969 /*! ブラックマーケット用追加メッセージ(怒りの頂点) */
970 static concptr comment_4a_B[MAX_COMMENT_4A] = {
971 "なめやがって!温厚な俺様でも限界があるってことを知れ!",
972 "俺をここまで怒らせて...命があるだけでもありがたいと思え!",
973 "ふざけてるのか!冷やかしなら相手を見てからにしろ!",
974 "いいかげんにしろ!今度こんなまねしたらただじゃおかねえぞ!"
977 #define MAX_COMMENT_4B 4
979 static concptr comment_4b[MAX_COMMENT_4B] =
988 "Get out of my sight!",
989 "Begone, you scoundrel!",
996 /*! ブラックマーケット用追加メッセージ(追い出し) */
997 static concptr comment_4b_B[MAX_COMMENT_4B] = {
1004 #define MAX_COMMENT_5 8
1006 static concptr comment_5[MAX_COMMENT_5] =
1020 "You will have to do better than that!",
1021 "Do you wish to do business or not?",
1022 "You've got to be kidding!",
1023 "You'd better be kidding!",
1024 "You try my patience.",
1025 "Hmmm, nice weather we're having."
1031 /*! ブラックマーケット用追加メッセージ(怒り) */
1032 static concptr comment_5_B[MAX_COMMENT_5] = {
1043 #define MAX_COMMENT_6 4
1045 static concptr comment_6[MAX_COMMENT_6] =
1053 "I must have heard you wrong.",
1054 "I'm sorry, I missed that.",
1055 "I'm sorry, what was that?",
1056 "Sorry, what was that again?"
1061 /*** Initialize others ***/
1064 * 店舗で販売するオブジェクトを定義する / Hack -- Objects sold in the stores -- by tval/sval pair.
1066 byte store_table[MAX_STORES][STORE_CHOICES][2] =
1071 { TV_FOOD, SV_FOOD_RATION },
1072 { TV_FOOD, SV_FOOD_RATION },
1073 { TV_FOOD, SV_FOOD_RATION },
1074 { TV_FOOD, SV_FOOD_RATION },
1076 { TV_FOOD, SV_FOOD_RATION },
1077 { TV_FOOD, SV_FOOD_BISCUIT },
1078 { TV_FOOD, SV_FOOD_JERKY },
1079 { TV_FOOD, SV_FOOD_JERKY },
1081 { TV_FOOD, SV_FOOD_PINT_OF_WINE },
1082 { TV_FOOD, SV_FOOD_PINT_OF_ALE },
1083 { TV_LITE, SV_LITE_TORCH },
1084 { TV_LITE, SV_LITE_TORCH },
1086 { TV_LITE, SV_LITE_TORCH },
1087 { TV_LITE, SV_LITE_TORCH },
1088 { TV_LITE, SV_LITE_LANTERN },
1089 { TV_LITE, SV_LITE_LANTERN },
1101 { TV_SHOT, SV_AMMO_NORMAL },
1102 { TV_ARROW, SV_AMMO_NORMAL },
1103 { TV_BOLT, SV_AMMO_NORMAL },
1104 { TV_DIGGING, SV_SHOVEL },
1106 { TV_DIGGING, SV_PICK },
1107 { TV_CLOAK, SV_CLOAK },
1108 { TV_CLOAK, SV_CLOAK },
1109 { TV_CLOAK, SV_FUR_CLOAK },
1111 { TV_FOOD, SV_FOOD_RATION },
1112 { TV_FOOD, SV_FOOD_RATION },
1113 { TV_FOOD, SV_FOOD_RATION },
1114 { TV_FOOD, SV_FOOD_RATION },
1116 { TV_POTION, SV_POTION_WATER },
1117 { TV_POTION, SV_POTION_WATER },
1118 { TV_LITE, SV_LITE_LANTERN },
1119 { TV_LITE, SV_LITE_LANTERN },
1121 { TV_FOOD, SV_FOOD_WAYBREAD },
1122 { TV_FOOD, SV_FOOD_WAYBREAD },
1126 { TV_SHOT, SV_AMMO_NORMAL },
1127 { TV_ARROW, SV_AMMO_NORMAL },
1128 { TV_BOLT, SV_AMMO_NORMAL },
1129 { TV_DIGGING, SV_SHOVEL }
1135 { TV_BOOTS, SV_PAIR_OF_SOFT_LEATHER_BOOTS },
1136 { TV_BOOTS, SV_PAIR_OF_SOFT_LEATHER_BOOTS },
1137 { TV_BOOTS, SV_PAIR_OF_HARD_LEATHER_BOOTS },
1138 { TV_BOOTS, SV_PAIR_OF_HARD_LEATHER_BOOTS },
1140 { TV_HELM, SV_HARD_LEATHER_CAP },
1141 { TV_HELM, SV_HARD_LEATHER_CAP },
1142 { TV_HELM, SV_METAL_CAP },
1143 { TV_HELM, SV_IRON_HELM },
1145 { TV_SOFT_ARMOR, SV_ROBE },
1146 { TV_SOFT_ARMOR, SV_ROBE },
1147 { TV_SOFT_ARMOR, SV_SOFT_LEATHER_ARMOR },
1148 { TV_SOFT_ARMOR, SV_SOFT_LEATHER_ARMOR },
1150 { TV_SOFT_ARMOR, SV_HARD_LEATHER_ARMOR },
1151 { TV_SOFT_ARMOR, SV_HARD_LEATHER_ARMOR },
1152 { TV_SOFT_ARMOR, SV_HARD_STUDDED_LEATHER },
1153 { TV_SOFT_ARMOR, SV_HARD_STUDDED_LEATHER },
1155 { TV_SOFT_ARMOR, SV_RHINO_HIDE_ARMOR },
1156 { TV_SOFT_ARMOR, SV_LEATHER_SCALE_MAIL },
1157 { TV_HARD_ARMOR, SV_METAL_SCALE_MAIL },
1158 { TV_HARD_ARMOR, SV_CHAIN_MAIL },
1160 { TV_HARD_ARMOR, SV_DOUBLE_RING_MAIL },
1161 { TV_HARD_ARMOR, SV_AUGMENTED_CHAIN_MAIL },
1162 { TV_HARD_ARMOR, SV_BAR_CHAIN_MAIL },
1163 { TV_HARD_ARMOR, SV_DOUBLE_CHAIN_MAIL },
1165 { TV_HARD_ARMOR, SV_METAL_BRIGANDINE_ARMOUR },
1166 { TV_HARD_ARMOR, SV_SPLINT_MAIL },
1167 { TV_GLOVES, SV_SET_OF_LEATHER_GLOVES },
1168 { TV_GLOVES, SV_SET_OF_LEATHER_GLOVES },
1170 { TV_GLOVES, SV_SET_OF_GAUNTLETS },
1171 { TV_SHIELD, SV_SMALL_LEATHER_SHIELD },
1172 { TV_SHIELD, SV_LARGE_LEATHER_SHIELD },
1173 { TV_SHIELD, SV_SMALL_METAL_SHIELD },
1175 { TV_BOOTS, SV_PAIR_OF_HARD_LEATHER_BOOTS },
1176 { TV_BOOTS, SV_PAIR_OF_HARD_LEATHER_BOOTS },
1177 { TV_HELM, SV_HARD_LEATHER_CAP },
1178 { TV_HELM, SV_HARD_LEATHER_CAP },
1180 { TV_SOFT_ARMOR, SV_ROBE },
1181 { TV_SOFT_ARMOR, SV_SOFT_LEATHER_ARMOR },
1182 { TV_SOFT_ARMOR, SV_SOFT_LEATHER_ARMOR },
1183 { TV_SOFT_ARMOR, SV_HARD_LEATHER_ARMOR },
1185 { TV_SOFT_ARMOR, SV_LEATHER_JACK },
1186 { TV_HARD_ARMOR, SV_METAL_SCALE_MAIL },
1187 { TV_HARD_ARMOR, SV_CHAIN_MAIL },
1188 { TV_HARD_ARMOR, SV_CHAIN_MAIL },
1190 { TV_GLOVES, SV_SET_OF_LEATHER_GLOVES },
1191 { TV_GLOVES, SV_SET_OF_GAUNTLETS },
1192 { TV_SHIELD, SV_SMALL_LEATHER_SHIELD },
1193 { TV_SHIELD, SV_SMALL_LEATHER_SHIELD }
1199 { TV_SWORD, SV_DAGGER },
1200 { TV_SWORD, SV_MAIN_GAUCHE },
1201 { TV_SWORD, SV_RAPIER },
1202 { TV_SWORD, SV_SMALL_SWORD },
1204 { TV_SWORD, SV_SHORT_SWORD },
1205 { TV_SWORD, SV_SABRE },
1206 { TV_SWORD, SV_CUTLASS },
1207 { TV_SWORD, SV_TULWAR },
1209 { TV_SWORD, SV_BROAD_SWORD },
1210 { TV_SWORD, SV_LONG_SWORD },
1211 { TV_SWORD, SV_SCIMITAR },
1212 { TV_SWORD, SV_KATANA },
1214 { TV_SWORD, SV_BASTARD_SWORD },
1215 { TV_POLEARM, SV_SPEAR },
1216 { TV_POLEARM, SV_AWL_PIKE },
1217 { TV_POLEARM, SV_TRIDENT },
1219 { TV_POLEARM, SV_PIKE },
1220 { TV_POLEARM, SV_BEAKED_AXE },
1221 { TV_POLEARM, SV_BROAD_AXE },
1222 { TV_POLEARM, SV_LANCE },
1224 { TV_POLEARM, SV_BATTLE_AXE },
1225 { TV_POLEARM, SV_HATCHET },
1226 { TV_BOW, SV_SLING },
1227 { TV_BOW, SV_SHORT_BOW },
1229 { TV_BOW, SV_LIGHT_XBOW },
1230 { TV_SHOT, SV_AMMO_NORMAL },
1231 { TV_SHOT, SV_AMMO_NORMAL },
1232 { TV_ARROW, SV_AMMO_NORMAL },
1234 { TV_ARROW, SV_AMMO_NORMAL },
1235 { TV_BOLT, SV_AMMO_NORMAL },
1236 { TV_BOLT, SV_AMMO_NORMAL },
1237 { TV_BOW, SV_LIGHT_XBOW },
1239 { TV_ARROW, SV_AMMO_NORMAL },
1240 { TV_BOLT, SV_AMMO_NORMAL },
1241 { TV_BOW, SV_SHORT_BOW },
1242 { TV_BOW, SV_LIGHT_XBOW },
1244 { TV_SWORD, SV_DAGGER },
1245 { TV_SWORD, SV_TANTO },
1246 { TV_SWORD, SV_RAPIER },
1247 { TV_SWORD, SV_SMALL_SWORD },
1249 { TV_SWORD, SV_SHORT_SWORD },
1250 { TV_SWORD, SV_LONG_SWORD },
1251 { TV_SWORD, SV_SCIMITAR },
1252 { TV_SWORD, SV_BROAD_SWORD },
1254 { TV_HISSATSU_BOOK, 0 },
1255 { TV_HISSATSU_BOOK, 0 },
1256 { TV_HISSATSU_BOOK, 1 },
1257 { TV_HISSATSU_BOOK, 1 },
1263 { TV_HAFTED, SV_NUNCHAKU },
1264 { TV_HAFTED, SV_QUARTERSTAFF },
1265 { TV_HAFTED, SV_MACE },
1266 { TV_HAFTED, SV_BO_STAFF },
1268 { TV_HAFTED, SV_WAR_HAMMER },
1269 { TV_HAFTED, SV_WAR_HAMMER },
1270 { TV_HAFTED, SV_MORNING_STAR },
1271 { TV_HAFTED, SV_FLAIL },
1273 { TV_HAFTED, SV_LEAD_FILLED_MACE },
1274 { TV_SCROLL, SV_SCROLL_REMOVE_CURSE },
1275 { TV_SCROLL, SV_SCROLL_BLESSING },
1276 { TV_SCROLL, SV_SCROLL_HOLY_CHANT },
1278 { TV_POTION, SV_POTION_HEROISM },
1279 { TV_SCROLL, SV_SCROLL_WORD_OF_RECALL },
1280 { TV_SCROLL, SV_SCROLL_WORD_OF_RECALL },
1281 { TV_SCROLL, SV_SCROLL_WORD_OF_RECALL },
1283 { TV_POTION, SV_POTION_CURE_LIGHT },
1284 { TV_POTION, SV_POTION_CURE_SERIOUS },
1285 { TV_POTION, SV_POTION_CURE_SERIOUS },
1286 { TV_POTION, SV_POTION_CURE_CRITICAL },
1288 { TV_POTION, SV_POTION_CURE_CRITICAL },
1289 { TV_POTION, SV_POTION_RESTORE_EXP },
1290 { TV_POTION, SV_POTION_RESTORE_EXP },
1291 { TV_POTION, SV_POTION_RESTORE_EXP },
1293 { TV_LIFE_BOOK, 0 },
1294 { TV_LIFE_BOOK, 0 },
1295 { TV_LIFE_BOOK, 1 },
1296 { TV_LIFE_BOOK, 1 },
1298 { TV_CRUSADE_BOOK, 0 },
1299 { TV_CRUSADE_BOOK, 0 },
1300 { TV_CRUSADE_BOOK, 1 },
1301 { TV_CRUSADE_BOOK, 1 },
1303 { TV_HAFTED, SV_WHIP },
1304 { TV_HAFTED, SV_MACE },
1305 { TV_HAFTED, SV_BALL_AND_CHAIN },
1306 { TV_HAFTED, SV_WAR_HAMMER },
1308 { TV_SCROLL, SV_SCROLL_WORD_OF_RECALL },
1309 { TV_SCROLL, SV_SCROLL_WORD_OF_RECALL },
1310 { TV_SCROLL, SV_SCROLL_WORD_OF_RECALL },
1311 { TV_POTION, SV_POTION_CURE_CRITICAL },
1313 { TV_POTION, SV_POTION_CURE_CRITICAL },
1314 { TV_POTION, SV_POTION_RESTORE_EXP },
1317 { TV_STATUE, SV_ANY },
1319 { TV_SCROLL, SV_SCROLL_REMOVE_CURSE },
1320 { TV_SCROLL, SV_SCROLL_REMOVE_CURSE },
1321 { TV_SCROLL, SV_SCROLL_STAR_REMOVE_CURSE },
1322 { TV_SCROLL, SV_SCROLL_STAR_REMOVE_CURSE }
1328 { TV_SCROLL, SV_SCROLL_ENCHANT_WEAPON_TO_HIT },
1329 { TV_SCROLL, SV_SCROLL_ENCHANT_WEAPON_TO_DAM },
1330 { TV_SCROLL, SV_SCROLL_ENCHANT_ARMOR },
1331 { TV_SCROLL, SV_SCROLL_IDENTIFY },
1333 { TV_SCROLL, SV_SCROLL_IDENTIFY },
1334 { TV_SCROLL, SV_SCROLL_IDENTIFY },
1335 { TV_SCROLL, SV_SCROLL_IDENTIFY },
1336 { TV_SCROLL, SV_SCROLL_LIGHT },
1338 { TV_SCROLL, SV_SCROLL_PHASE_DOOR },
1339 { TV_SCROLL, SV_SCROLL_PHASE_DOOR },
1340 { TV_SCROLL, SV_SCROLL_TELEPORT },
1341 { TV_SCROLL, SV_SCROLL_MONSTER_CONFUSION },
1343 { TV_SCROLL, SV_SCROLL_MAPPING },
1344 { TV_SCROLL, SV_SCROLL_DETECT_GOLD },
1345 { TV_SCROLL, SV_SCROLL_DETECT_ITEM },
1346 { TV_SCROLL, SV_SCROLL_DETECT_TRAP },
1348 { TV_SCROLL, SV_SCROLL_DETECT_INVIS },
1349 { TV_SCROLL, SV_SCROLL_RECHARGING },
1350 { TV_SCROLL, SV_SCROLL_TELEPORT },
1351 { TV_SCROLL, SV_SCROLL_WORD_OF_RECALL },
1353 { TV_SCROLL, SV_SCROLL_WORD_OF_RECALL },
1354 { TV_SCROLL, SV_SCROLL_WORD_OF_RECALL },
1355 { TV_SCROLL, SV_SCROLL_WORD_OF_RECALL },
1356 { TV_SCROLL, SV_SCROLL_TELEPORT },
1358 { TV_SCROLL, SV_SCROLL_TELEPORT },
1359 { TV_POTION, SV_POTION_RES_STR },
1360 { TV_POTION, SV_POTION_RES_INT },
1361 { TV_POTION, SV_POTION_RES_WIS },
1363 { TV_POTION, SV_POTION_RES_DEX },
1364 { TV_POTION, SV_POTION_RES_CON },
1365 { TV_POTION, SV_POTION_RES_CHR },
1366 { TV_SCROLL, SV_SCROLL_IDENTIFY },
1368 { TV_SCROLL, SV_SCROLL_IDENTIFY },
1369 { TV_SCROLL, SV_SCROLL_STAR_IDENTIFY }, /* Yep, occasionally! */
1370 { TV_SCROLL, SV_SCROLL_STAR_IDENTIFY },
1371 { TV_SCROLL, SV_SCROLL_LIGHT },
1373 { TV_POTION, SV_POTION_RES_STR },
1374 { TV_POTION, SV_POTION_RES_INT },
1375 { TV_POTION, SV_POTION_RES_WIS },
1376 { TV_POTION, SV_POTION_RES_DEX },
1378 { TV_POTION, SV_POTION_RES_CON },
1379 { TV_POTION, SV_POTION_RES_CHR },
1380 { TV_SCROLL, SV_SCROLL_ENCHANT_ARMOR },
1381 { TV_SCROLL, SV_SCROLL_ENCHANT_ARMOR },
1383 { TV_SCROLL, SV_SCROLL_RECHARGING },
1384 { TV_SCROLL, SV_SCROLL_PHASE_DOOR },
1385 { TV_SCROLL, SV_SCROLL_ENCHANT_WEAPON_TO_HIT },
1386 { TV_SCROLL, SV_SCROLL_ENCHANT_WEAPON_TO_DAM },
1391 /* Magic-User store */
1393 { TV_RING, SV_RING_PROTECTION },
1394 { TV_RING, SV_RING_LEVITATION_FALL },
1395 { TV_RING, SV_RING_PROTECTION },
1396 { TV_RING, SV_RING_RESIST_FIRE },
1398 { TV_RING, SV_RING_RESIST_COLD },
1399 { TV_AMULET, SV_AMULET_CHARISMA },
1400 { TV_RING, SV_RING_WARNING },
1401 { TV_AMULET, SV_AMULET_RESIST_ACID },
1403 { TV_AMULET, SV_AMULET_SEARCHING },
1404 { TV_WAND, SV_WAND_SLOW_MONSTER },
1405 { TV_WAND, SV_WAND_CONFUSE_MONSTER },
1406 { TV_WAND, SV_WAND_SLEEP_MONSTER },
1408 { TV_WAND, SV_WAND_MAGIC_MISSILE },
1409 { TV_WAND, SV_WAND_STINKING_CLOUD },
1410 { TV_WAND, SV_WAND_WONDER },
1411 { TV_WAND, SV_WAND_DISARMING },
1413 { TV_STAFF, SV_STAFF_LITE },
1414 { TV_STAFF, SV_STAFF_MAPPING },
1415 { TV_STAFF, SV_STAFF_DETECT_TRAP },
1416 { TV_STAFF, SV_STAFF_DETECT_DOOR },
1418 { TV_STAFF, SV_STAFF_DETECT_GOLD },
1419 { TV_STAFF, SV_STAFF_DETECT_ITEM },
1420 { TV_STAFF, SV_STAFF_DETECT_INVIS },
1421 { TV_STAFF, SV_STAFF_DETECT_EVIL },
1423 { TV_STAFF, SV_STAFF_TELEPORTATION },
1424 { TV_STAFF, SV_STAFF_TELEPORTATION },
1425 { TV_STAFF, SV_STAFF_TELEPORTATION },
1426 { TV_STAFF, SV_STAFF_TELEPORTATION },
1428 { TV_STAFF, SV_STAFF_IDENTIFY },
1429 { TV_STAFF, SV_STAFF_IDENTIFY },
1430 { TV_STAFF, SV_STAFF_IDENTIFY },
1432 { TV_STAFF, SV_STAFF_IDENTIFY },
1433 { TV_STAFF, SV_STAFF_REMOVE_CURSE },
1434 { TV_STAFF, SV_STAFF_CURE_LIGHT },
1435 { TV_STAFF, SV_STAFF_PROBING },
1439 { TV_SORCERY_BOOK, 0 },
1440 { TV_SORCERY_BOOK, 0 },
1441 { TV_SORCERY_BOOK, 1 },
1442 { TV_SORCERY_BOOK, 1 },
1444 { TV_ARCANE_BOOK, 0 },
1445 { TV_ARCANE_BOOK, 0 },
1446 { TV_ARCANE_BOOK, 1 },
1447 { TV_ARCANE_BOOK, 1 },
1449 { TV_ARCANE_BOOK, 2 },
1450 { TV_ARCANE_BOOK, 2 },
1451 { TV_ARCANE_BOOK, 3 },
1452 { TV_ARCANE_BOOK, 3 },
1457 /* Black Market (unused) */
1530 { TV_SORCERY_BOOK, 0 },
1531 { TV_SORCERY_BOOK, 0 },
1532 { TV_SORCERY_BOOK, 1 },
1533 { TV_SORCERY_BOOK, 1 },
1535 { TV_NATURE_BOOK, 0 },
1536 { TV_NATURE_BOOK, 0 },
1537 { TV_NATURE_BOOK, 1 },
1538 { TV_NATURE_BOOK, 1 },
1540 { TV_CHAOS_BOOK, 0 },
1541 { TV_CHAOS_BOOK, 0 },
1542 { TV_CHAOS_BOOK, 1 },
1543 { TV_CHAOS_BOOK, 1 },
1545 { TV_DEATH_BOOK, 0 },
1546 { TV_DEATH_BOOK, 0 },
1547 { TV_DEATH_BOOK, 1 },
1548 { TV_DEATH_BOOK, 1 },
1550 { TV_TRUMP_BOOK, 0 }, /* +16 */
1551 { TV_TRUMP_BOOK, 0 },
1552 { TV_TRUMP_BOOK, 1 },
1553 { TV_TRUMP_BOOK, 1 },
1555 { TV_ARCANE_BOOK, 0 },
1556 { TV_ARCANE_BOOK, 1 },
1557 { TV_ARCANE_BOOK, 2 },
1558 { TV_ARCANE_BOOK, 3 },
1560 { TV_CRAFT_BOOK, 0 },
1561 { TV_CRAFT_BOOK, 0 },
1562 { TV_CRAFT_BOOK, 1 },
1563 { TV_CRAFT_BOOK, 1 },
1565 { TV_DAEMON_BOOK, 0 },
1566 { TV_DAEMON_BOOK, 0 },
1567 { TV_DAEMON_BOOK, 1 },
1568 { TV_DAEMON_BOOK, 1 },
1570 { TV_MUSIC_BOOK, 0 },
1571 { TV_MUSIC_BOOK, 0 },
1572 { TV_MUSIC_BOOK, 1 },
1573 { TV_MUSIC_BOOK, 1 },
1582 /* Museum (unused) */
1621 * @brief 取引成功時の店主のメッセージ処理 /
1622 * Successful haggle.
1625 static void say_comment_1(void)
1628 /* ブラックマーケットのときは別のメッセージを出す */
1629 if ( cur_store_num == STORE_BLACK ) {
1630 msg_print(comment_1_B[randint0(MAX_COMMENT_1)]);
1633 msg_print(comment_1[randint0(MAX_COMMENT_1)]);
1636 msg_print(comment_1[randint0(MAX_COMMENT_1)]);
1640 if (one_in_(RUMOR_CHANCE))
1643 msg_print("店主は耳うちした:");
1645 msg_print("The shopkeeper whispers something into your ear:");
1647 display_rumor(TRUE);
1653 * @brief プレイヤーがアイテムを買う時の価格代案メッセージ処理 /
1654 * Continue haggling (player is buying)
1655 * @param value 店主の提示価格
1656 * @param annoyed 店主のいらつき度
1659 static void say_comment_2(PRICE value, int annoyed)
1663 /* Prepare a string to insert */
1664 sprintf(tmp_val, "%ld", (long)value);
1669 /* Formatted message */
1670 msg_format(comment_2a[randint0(MAX_COMMENT_2A)], tmp_val);
1676 /* Formatted message */
1678 /* ブラックマーケットの時は別のメッセージを出す */
1679 if ( cur_store_num == STORE_BLACK ){
1680 msg_format(comment_2b_B[randint0(MAX_COMMENT_2B)], tmp_val);
1683 msg_format(comment_2b[randint0(MAX_COMMENT_2B)], tmp_val);
1686 msg_format(comment_2b[randint0(MAX_COMMENT_2B)], tmp_val);
1694 * @brief プレイヤーがアイテムを売る時の価格代案メッセージ処理 /
1695 * Continue haggling (player is selling)
1696 * @param value 店主の提示価格
1697 * @param annoyed 店主のいらつき度
1700 static void say_comment_3(PRICE value, int annoyed)
1704 /* Prepare a string to insert */
1705 sprintf(tmp_val, "%ld", (long)value);
1710 /* Formatted message */
1711 msg_format(comment_3a[randint0(MAX_COMMENT_3A)], tmp_val);
1717 /* Formatted message */
1719 /* ブラックマーケットの時は別のメッセージを出す */
1720 if ( cur_store_num == STORE_BLACK ){
1721 msg_format(comment_3b_B[randint0(MAX_COMMENT_3B)], tmp_val);
1724 msg_format(comment_3b[randint0(MAX_COMMENT_3B)], tmp_val);
1727 msg_format(comment_3b[randint0(MAX_COMMENT_3B)], tmp_val);
1735 * @brief 店主がプレイヤーを追い出す時のメッセージ処理 /
1736 * Kick 'da bum out. -RAK-
1739 static void say_comment_4(void)
1742 /* ブラックマーケットの時は別のメッセージを出す */
1743 if ( cur_store_num == STORE_BLACK ){
1744 msg_print(comment_4a_B[randint0(MAX_COMMENT_4A)]);
1745 msg_print(comment_4b_B[randint0(MAX_COMMENT_4B)]);
1748 msg_print(comment_4a[randint0(MAX_COMMENT_4A)]);
1749 msg_print(comment_4b[randint0(MAX_COMMENT_4B)]);
1752 msg_print(comment_4a[randint0(MAX_COMMENT_4A)]);
1753 msg_print(comment_4b[randint0(MAX_COMMENT_4B)]);
1760 * @brief 店主がプレイヤーに取り合わない時のメッセージ処理 /
1761 * You are insulting me
1764 static void say_comment_5(void)
1767 /* ブラックマーケットの時は別のメッセージを出す */
1768 if ( cur_store_num == STORE_BLACK ){
1769 msg_print(comment_5_B[randint0(MAX_COMMENT_5)]);
1772 msg_print(comment_5[randint0(MAX_COMMENT_5)]);
1775 msg_print(comment_5[randint0(MAX_COMMENT_5)]);
1782 * @brief 店主がプレイヤーの提示を理解できなかった時のメッセージ処理 /
1783 * That makes no sense.
1786 static void say_comment_6(void)
1788 msg_print(comment_6[randint0(MAX_COMMENT_6)]);
1792 #define MAX_COMMENT_7A 4
1794 static concptr comment_7a[MAX_COMMENT_7A] =
1799 "誰かがむせび泣く声が聞こえる...。",
1804 "You hear someone sobbing...",
1805 "The shopkeeper howls in agony!"
1810 #define MAX_COMMENT_7B 4
1812 static concptr comment_7b[MAX_COMMENT_7B] =
1822 "The shopkeeper curses at you.",
1823 "The shopkeeper glares at you."
1828 #define MAX_COMMENT_7C 4
1830 static concptr comment_7c[MAX_COMMENT_7C] =
1839 "You've made my day!",
1840 "The shopkeeper giggles.",
1841 "The shopkeeper laughs loudly."
1846 #define MAX_COMMENT_7D 4
1848 static concptr comment_7d[MAX_COMMENT_7D] =
1852 "こんなおいしい思いをしたら、真面目に働けなくなるなぁ。",
1857 "I think I'll retire!",
1858 "The shopkeeper jumps for joy.",
1859 "The shopkeeper smiles gleefully."
1866 * @brief 店主が交渉を終えた際の反応を返す処理 /
1867 * Let a shop-keeper React to a purchase
1868 * @param price アイテムの取引額
1869 * @param value アイテムの実際価値
1870 * @param guess 店主が当初予想していた価値
1873 * We paid "price", it was worth "value", and we thought it was worth "guess"
1875 static void purchase_analyze(PRICE price, PRICE value, PRICE guess)
1877 /* Item was worthless, but we bought it */
1878 if ((value <= 0) && (price > value))
1880 msg_print(comment_7a[randint0(MAX_COMMENT_7A)]);
1881 chg_virtue(V_HONOUR, -1);
1882 chg_virtue(V_JUSTICE, -1);
1883 sound(SOUND_STORE1);
1886 /* Item was cheaper than we thought, and we paid more than necessary */
1887 else if ((value < guess) && (price > value))
1889 msg_print(comment_7b[randint0(MAX_COMMENT_7B)]);
1890 chg_virtue(V_JUSTICE, -1);
1891 if (one_in_(4)) chg_virtue(V_HONOUR, -1);
1892 sound(SOUND_STORE2);
1895 /* Item was a good bargain, and we got away with it */
1896 else if ((value > guess) && (value < (4 * guess)) && (price < value))
1898 msg_print(comment_7c[randint0(MAX_COMMENT_7C)]);
1899 if (one_in_(4)) chg_virtue(V_HONOUR, -1);
1900 else if (one_in_(4)) chg_virtue(V_HONOUR, 1);
1901 sound(SOUND_STORE3);
1904 /* Item was a great bargain, and we got away with it */
1905 else if ((value > guess) && (price < value))
1907 msg_print(comment_7d[randint0(MAX_COMMENT_7D)]);
1908 if (one_in_(2)) chg_virtue(V_HONOUR, -1);
1909 if (one_in_(4)) chg_virtue(V_HONOUR, 1);
1910 if (10 * price < value) chg_virtue(V_SACRIFICE, 1);
1911 sound(SOUND_STORE4);
1918 * We store the current "store feat" here so everyone can access it
1920 static int cur_store_feat;
1924 * Buying and selling adjustments for race combinations.
1925 * Entry[owner][player] gives the basic "cost inflation".
1927 static byte rgold_adj[MAX_RACES][MAX_RACES] =
1929 /*Hum, HfE, Elf, Hal, Gno, Dwa, HfO, HfT, Dun, HiE, Barbarian,
1930 HfOg, HGn, HTn, Cyc, Yek, Klc, Kbd, Nbl, DkE, Drc, Mind Flayer,
1931 Imp, Glm, Skl, Zombie, Vampire, Spectre, Fairy, Beastman, Ent,
1932 Angel, Demon, Kutar, Android, Merfolk */
1935 { 100, 105, 105, 110, 113, 115, 120, 125, 100, 105, 100,
1936 124, 120, 110, 125, 115, 120, 120, 120, 120, 115, 120,
1937 115, 105, 125, 125, 125, 125, 105, 120, 105, 95, 140,
1938 100, 120, 110, 105, 110 },
1941 { 110, 100, 100, 105, 110, 120, 125, 130, 110, 100, 110,
1942 120, 115, 108, 115, 110, 110, 120, 120, 115, 115, 110,
1943 120, 110, 110, 110, 120, 110, 100, 125, 100, 95, 140,
1944 110, 115, 110, 110, 110 },
1947 { 110, 105, 100, 105, 110, 120, 125, 130, 110, 100, 110,
1948 120, 120, 105, 120, 110, 105, 125, 125, 110, 115, 108,
1949 120, 115, 110, 110, 120, 110, 100, 125, 100, 95, 140,
1950 110, 110, 105, 110, 110 },
1953 { 115, 110, 105, 95, 105, 110, 115, 130, 115, 105, 115,
1954 125, 120, 120, 125, 115, 110, 120, 120, 120, 115, 115,
1955 120, 110, 120, 120, 130, 110, 110, 130, 110, 95, 140,
1956 115, 120, 105, 115, 105 },
1959 { 115, 115, 110, 105, 95, 110, 115, 130, 115, 110, 115,
1960 120, 125, 110, 120, 110, 105, 120, 110, 110, 105, 110,
1961 120, 101, 110, 110, 120, 120, 115, 130, 115, 95, 140,
1962 115, 110, 110, 115, 110 },
1965 { 115, 120, 120, 110, 110, 95, 125, 135, 115, 120, 115,
1966 125, 140, 130, 130, 120, 115, 115, 115, 135, 125, 120,
1967 120, 105, 115, 115, 115, 115, 120, 130, 120, 95, 140,
1968 115, 110, 115, 115, 120 },
1971 { 115, 120, 125, 115, 115, 130, 110, 115, 115, 125, 115,
1972 110, 110, 120, 110, 120, 125, 115, 115, 110, 120, 110,
1973 115, 125, 120, 120, 115, 120, 125, 115, 125, 95, 140,
1974 115, 110, 115, 115, 125 },
1977 { 110, 115, 115, 110, 110, 130, 110, 110, 110, 115, 110,
1978 110, 115, 120, 110, 120, 120, 110, 110, 110, 115, 110,
1979 110, 115, 112, 112, 115, 112, 120, 110, 120, 95, 140,
1980 110, 110, 115, 110, 130 },
1983 { 100, 105, 105, 110, 113, 115, 120, 125, 100, 105, 100,
1984 120, 120, 105, 120, 115, 105, 115, 120, 110, 105, 105,
1985 120, 105, 120, 120, 125, 120, 105, 135, 105, 95, 140,
1986 100, 110, 110, 100, 110 },
1989 { 110, 105, 100, 105, 110, 120, 125, 130, 110, 100, 110,
1990 125, 125, 101, 120, 115, 110, 115, 125, 110, 110, 110,
1991 125, 115, 120, 120, 125, 120, 100, 125, 100, 95, 140,
1992 110, 110, 105, 110, 110 },
1994 /* Human / Barbarian (copied from human) */
1995 { 100, 105, 105, 110, 113, 115, 120, 125, 100, 105, 100,
1996 124, 120, 110, 125, 115, 120, 120, 120, 120, 115, 120,
1997 115, 105, 125, 125, 130, 125, 115, 120, 115, 95, 140,
1998 100, 120, 110, 100, 110 },
2000 /* Half-Ogre: theoretical, copied from half-troll */
2001 { 110, 115, 115, 110, 110, 130, 110, 110, 110, 115, 110,
2002 110, 115, 120, 110, 120, 120, 110, 110, 110, 115, 110,
2003 110, 115, 112, 112, 115, 112, 120, 110, 120, 95, 140,
2004 110, 110, 115, 110, 120 },
2006 /* Half-Giant: theoretical, copied from half-troll */
2007 { 110, 115, 115, 110, 110, 130, 110, 110, 110, 115, 110,
2008 110, 115, 120, 110, 120, 120, 110, 110, 110, 115, 110,
2009 110, 115, 112, 112, 115, 112, 130, 120, 130, 95, 140,
2010 110, 110, 115, 110, 115 },
2012 /* Half-Titan: theoretical, copied from High_Elf */
2013 { 110, 105, 100, 105, 110, 120, 125, 130, 110, 100, 110,
2014 125, 125, 101, 120, 115, 110, 115, 125, 110, 110, 110,
2015 125, 115, 120, 120, 120, 120, 130, 130, 130, 95, 140,
2016 110, 110, 115, 110, 108 },
2018 /* Cyclops: theoretical, copied from half-troll */
2019 { 110, 115, 115, 110, 110, 130, 110, 110, 110, 115, 110,
2020 110, 115, 120, 110, 120, 120, 110, 110, 110, 115, 110,
2021 110, 115, 112, 112, 115, 112, 130, 130, 130, 95, 140,
2022 110, 110, 115, 110, 115 },
2024 /* Yeek: theoretical, copied from Half-Orc */
2025 { 115, 120, 125, 115, 115, 130, 110, 115, 115, 125, 115,
2026 110, 110, 120, 110, 120, 125, 115, 115, 110, 120, 110,
2027 115, 125, 120, 120, 120, 120, 130, 130, 130, 95, 140,
2028 115, 110, 115, 115, 110 },
2030 /* Klackon: theoretical, copied from Gnome */
2031 { 115, 115, 110, 105, 95, 110, 115, 130, 115, 110, 115,
2032 120, 125, 110, 120, 110, 105, 120, 110, 110, 105, 110,
2033 120, 101, 110, 110, 120, 120, 130, 130, 130, 95, 140,
2034 115, 110, 115, 115, 110 },
2036 /* Kobold: theoretical, copied from Half-Orc */
2037 { 115, 120, 125, 115, 115, 130, 110, 115, 115, 125, 115,
2038 110, 110, 120, 110, 120, 125, 115, 115, 110, 120, 110,
2039 115, 125, 120, 120, 120, 120, 130, 130, 130, 95, 140,
2040 115, 110, 115, 115, 120 },
2042 /* Nibelung: theoretical, copied from Dwarf */
2043 { 115, 120, 120, 110, 110, 95, 125, 135, 115, 120, 115,
2044 125, 140, 130, 130, 120, 115, 115, 115, 135, 125, 120,
2045 120, 105, 115, 115, 120, 120, 130, 130, 130, 95, 140,
2046 115, 135, 115, 115, 120 },
2049 { 110, 110, 110, 115, 120, 130, 115, 115, 120, 110, 115,
2050 115, 115, 116, 115, 120, 120, 115, 115, 101, 110, 110,
2051 110, 110, 112, 122, 110, 110, 110, 115, 110, 120, 120,
2052 110, 101, 115, 110, 115 },
2054 /* Draconian: theoretical, copied from High_Elf */
2055 { 110, 105, 100, 105, 110, 120, 125, 130, 110, 100, 110,
2056 125, 125, 101, 120, 115, 110, 115, 125, 110, 110, 110,
2057 125, 115, 120, 120, 120, 120, 130, 130, 130, 95, 140,
2058 110, 110, 115, 110, 115 },
2060 /* Mind Flayer: theoretical, copied from High_Elf */
2061 { 110, 105, 100, 105, 110, 120, 125, 130, 110, 100, 110,
2062 125, 125, 101, 120, 115, 110, 115, 125, 110, 110, 110,
2063 125, 115, 120, 120, 120, 120, 130, 130, 130, 95, 140,
2064 110, 110, 115, 110, 110 },
2066 /* Imp: theoretical, copied from High_Elf */
2067 { 110, 105, 100, 105, 110, 120, 125, 130, 110, 100, 110,
2068 125, 125, 101, 120, 115, 110, 115, 125, 110, 110, 110,
2069 125, 115, 120, 120, 120, 120, 130, 130, 130, 120, 120,
2070 110, 110, 115, 110, 120 },
2072 /* Golem: theoretical, copied from High_Elf */
2073 { 110, 105, 100, 105, 110, 120, 125, 130, 110, 100, 110,
2074 125, 125, 101, 120, 115, 110, 115, 125, 110, 110, 110,
2075 125, 115, 120, 120, 120, 120, 130, 130, 130, 95, 140,
2076 110, 110, 115, 110, 110 },
2078 /* Skeleton: theoretical, copied from half-orc */
2079 { 115, 120, 125, 115, 115, 130, 110, 115, 115, 125, 115,
2080 110, 110, 120, 110, 120, 125, 115, 115, 110, 120, 110,
2081 115, 125, 120, 120, 120, 120, 130, 130, 130, 120, 120,
2082 115, 110, 125, 115, 110 },
2084 /* Zombie: Theoretical, copied from half-orc */
2085 { 115, 120, 125, 115, 115, 130, 110, 115, 115, 125, 115,
2086 110, 110, 120, 110, 120, 125, 115, 115, 110, 120, 110,
2087 115, 125, 120, 120, 120, 120, 130, 130, 130, 120, 120,
2088 115, 110, 125, 115, 110 },
2090 /* Vampire: Theoretical, copied from half-orc */
2091 { 115, 120, 125, 115, 115, 130, 110, 115, 115, 125, 115,
2092 110, 110, 120, 110, 120, 125, 115, 115, 110, 120, 110,
2093 115, 125, 120, 120, 120, 120, 130, 130, 130, 120, 120,
2094 115, 110, 125, 115, 120 },
2096 /* Spectre: Theoretical, copied from half-orc */
2097 { 115, 120, 125, 115, 115, 130, 110, 115, 115, 125, 115,
2098 110, 110, 120, 110, 120, 125, 115, 115, 110, 120, 110,
2099 115, 125, 120, 120, 120, 120, 130, 130, 130, 120, 120,
2100 115, 110, 125, 115, 110 },
2102 /* Sprite: Theoretical, copied from half-orc */
2103 { 115, 120, 125, 115, 115, 130, 110, 115, 115, 125, 115,
2104 110, 110, 120, 110, 120, 125, 115, 115, 110, 120, 110,
2105 115, 125, 120, 120, 120, 120, 130, 130, 130, 95, 140,
2106 115, 110, 105, 115, 110 },
2108 /* Beastman: Theoretical, copied from half-orc */
2109 { 115, 120, 125, 115, 115, 130, 110, 115, 115, 125, 115,
2110 110, 110, 120, 110, 120, 125, 115, 115, 110, 120, 110,
2111 115, 125, 120, 120, 120, 120, 130, 130, 130, 95, 140,
2112 115, 110, 115, 115, 125 },
2115 { 110, 105, 100, 105, 110, 120, 125, 130, 110, 100, 110,
2116 120, 120, 105, 120, 110, 105, 125, 125, 110, 115, 108,
2117 120, 115, 110, 110, 120, 110, 100, 125, 100, 95, 140,
2118 110, 110, 105, 110, 110 },
2121 { 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95,
2122 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95,
2123 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 160,
2124 95, 95, 95, 95, 95 },
2127 { 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, 140,
2128 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, 140,
2129 140, 140, 140, 140, 140, 140, 140, 140, 140, 160, 120,
2130 140, 140, 140, 140, 140 },
2133 { 100, 105, 105, 110, 113, 115, 120, 125, 100, 105, 100,
2134 124, 120, 110, 125, 115, 120, 120, 120, 120, 115, 120,
2135 115, 105, 125, 125, 125, 125, 105, 120, 105, 95, 140,
2136 100, 120, 110, 100, 110 },
2139 { 110, 110, 110, 115, 120, 130, 115, 115, 120, 110, 115,
2140 115, 115, 116, 115, 120, 120, 115, 115, 101, 110, 110,
2141 110, 110, 112, 122, 110, 110, 110, 115, 110, 120, 120,
2142 110, 101, 115, 110, 115 },
2145 { 110, 110, 105, 105, 110, 115, 115, 115, 110, 105, 110,
2146 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115,
2147 115, 115, 125, 125, 125, 125, 105, 115, 105, 95, 140,
2148 110, 115, 100, 110, 110 },
2151 { 105, 105, 105, 110, 113, 115, 120, 125, 100, 105, 100,
2152 124, 120, 110, 125, 115, 120, 120, 120, 120, 115, 120,
2153 115, 105, 125, 125, 125, 125, 105, 120, 105, 95, 140,
2154 100, 120, 110, 100, 110 },
2157 { 110, 110, 110, 105, 110, 120, 125, 130, 110, 110, 110,
2158 120, 115, 108, 115, 110, 110, 120, 120, 115, 115, 110,
2159 120, 110, 110, 110, 120, 110, 110, 125, 110, 95, 140,
2160 110, 115, 110, 110, 100 },
2166 * @brief 店舗価格を決定する /
2167 * Determine the price of an item (qty one) in a store.
2168 * @param o_ptr 店舗に並べるオブジェクト構造体の参照ポインタ
2169 * @param greed 店主の強欲度
2170 * @param flip TRUEならば店主にとっての買取価格、FALSEなら売出価格を計算
2174 * This function takes into account the player's charisma, and the
2175 * shop-keepers friendliness, and the shop-keeper's base greed, but
2176 * never lets a shop-keeper lose money in a transaction.
2177 * The "greed" value should exceed 100 when the player is "buying" the
2178 * item, and should be less than 100 when the player is "selling" it.
2179 * Hack -- the black market always charges twice as much as it should.
2180 * Charisma adjustment runs from 80 to 130
2181 * Racial adjustment runs from 95 to 130
2182 * Since greed/charisma/racial adjustments are centered at 100, we need
2183 * to adjust (by 200) to extract a usable multiplier. Note that the
2184 * "greed" value is always something (?).
2187 static s32b price_item(object_type *o_ptr, int greed, bool flip)
2194 /* Get the value of one of the items */
2195 price = object_value(o_ptr);
2197 /* Worthless items */
2198 if (price <= 0) return (0L);
2201 /* Compute the racial factor */
2202 factor = rgold_adj[ot_ptr->owner_race][p_ptr->prace];
2204 /* Add in the charisma factor */
2205 factor += adj_chr_gold[p_ptr->stat_ind[A_CHR]];
2208 /* Shop is buying */
2211 /* Adjust for greed */
2212 adjust = 100 + (300 - (greed + factor));
2214 /* Never get "silly" */
2215 if (adjust > 100) adjust = 100;
2217 /* Mega-Hack -- Black market sucks */
2218 if (cur_store_num == STORE_BLACK)
2221 /* Compute the final price (with rounding) */
2222 /* Hack -- prevent underflow */
2223 price = (price * adjust + 50L) / 100L;
2226 /* Shop is selling */
2229 /* Adjust for greed */
2230 adjust = 100 + ((greed + factor) - 300);
2232 /* Never get "silly" */
2233 if (adjust < 100) adjust = 100;
2235 /* Mega-Hack -- Black market sucks */
2236 if (cur_store_num == STORE_BLACK)
2239 /* Compute the final price (with rounding) */
2240 /* Hack -- prevent overflow */
2241 price = (s32b)(((u32b)price * (u32b)adjust + 50UL) / 100UL);
2244 /* Note -- Never become "free" */
2245 if (price <= 0L) return (1L);
2247 /* Return the price */
2253 * @brief 安価な消耗品の販売数を増やし、低確率で割引にする /
2254 * Certain "cheap" objects should be created in "piles"
2255 * @param o_ptr 店舗に並べるオブジェクト構造体の参照ポインタ
2259 * Some objects can be sold at a "discount" (in small piles)
2262 static void mass_produce(object_type *o_ptr)
2265 DISCOUNT_RATE discount = 0;
2267 PRICE cost = object_value(o_ptr);
2270 /* Analyze the type */
2271 switch (o_ptr->tval)
2273 /* Food, Flasks, and Lites */
2278 if (cost <= 5L) size += damroll(3, 5);
2279 if (cost <= 20L) size += damroll(3, 5);
2280 if (cost <= 50L) size += damroll(2, 2);
2287 if (cost <= 60L) size += damroll(3, 5);
2288 if (cost <= 240L) size += damroll(1, 5);
2289 if (o_ptr->sval == SV_SCROLL_STAR_IDENTIFY) size += damroll(3, 5);
2290 if (o_ptr->sval == SV_SCROLL_STAR_REMOVE_CURSE) size += damroll(1, 4);
2295 case TV_SORCERY_BOOK:
2296 case TV_NATURE_BOOK:
2300 case TV_ARCANE_BOOK:
2302 case TV_DAEMON_BOOK:
2303 case TV_CRUSADE_BOOK:
2305 case TV_HISSATSU_BOOK:
2308 if (cost <= 50L) size += damroll(2, 3);
2309 if (cost <= 500L) size += damroll(1, 3);
2327 if (object_is_artifact(o_ptr)) break;
2328 if (object_is_ego(o_ptr)) break;
2329 if (cost <= 10L) size += damroll(3, 5);
2330 if (cost <= 100L) size += damroll(3, 5);
2339 if (cost <= 5L) size += damroll(5, 5);
2340 if (cost <= 50L) size += damroll(5, 5);
2341 if (cost <= 500L) size += damroll(5, 5);
2347 if (cost <= 100L) size += damroll(2, 2);
2348 if (cost <= 1000L) size += damroll(2, 2);
2361 * Because many rods (and a few wands and staffs) are useful mainly
2362 * in quantity, the Black Market will occasionally have a bunch of
2369 if ((cur_store_num == STORE_BLACK) && one_in_(3))
2371 if (cost < 1601L) size += damroll(1, 5);
2372 else if (cost < 3201L) size += damroll(1, 3);
2379 /* Pick a discount */
2384 else if (one_in_(25))
2388 else if (one_in_(150))
2392 else if (one_in_(300))
2396 else if (one_in_(500))
2401 if (o_ptr->art_name)
2406 /* Save the discount */
2407 o_ptr->discount = discount;
2409 /* Save the total pile size */
2410 o_ptr->number = size - (size * discount / 100);
2412 /* Ensure that mass-produced rods and wands get the correct pvals. */
2413 if ((o_ptr->tval == TV_ROD) || (o_ptr->tval == TV_WAND))
2415 o_ptr->pval *= (PARAMETER_VALUE)o_ptr->number;
2422 * @brief 店舗に並べた品を同一品であるかどうか判定する /
2423 * Determine if a store item can "absorb" another item
2424 * @param o_ptr 判定するオブジェクト構造体の参照ポインタ1
2425 * @param j_ptr 判定するオブジェクト構造体の参照ポインタ2
2426 * @return 同一扱いできるならTRUEを返す
2429 * See "object_similar()" for the same function for the "player"
2432 static bool store_object_similar(object_type *o_ptr, object_type *j_ptr)
2436 /* Hack -- Identical items cannot be stacked */
2437 if (o_ptr == j_ptr) return (0);
2439 /* Different objects cannot be stacked */
2440 if (o_ptr->k_idx != j_ptr->k_idx) return (0);
2442 /* Different charges (etc) cannot be stacked, unless wands or rods. */
2443 if ((o_ptr->pval != j_ptr->pval) && (o_ptr->tval != TV_WAND) && (o_ptr->tval != TV_ROD)) return (0);
2445 /* Require many identical values */
2446 if (o_ptr->to_h != j_ptr->to_h) return (0);
2447 if (o_ptr->to_d != j_ptr->to_d) return (0);
2448 if (o_ptr->to_a != j_ptr->to_a) return (0);
2450 /* Require identical "ego-item" names */
2451 if (o_ptr->name2 != j_ptr->name2) return (0);
2453 /* Artifacts don't stack! */
2454 if (object_is_artifact(o_ptr) || object_is_artifact(j_ptr)) return (0);
2456 /* Hack -- Identical art_flags! */
2457 for (i = 0; i < TR_FLAG_SIZE; i++)
2458 if (o_ptr->art_flags[i] != j_ptr->art_flags[i]) return (0);
2460 /* Hack -- Never stack "powerful" items */
2461 if (o_ptr->xtra1 || j_ptr->xtra1) return (0);
2463 /* Hack -- Never stack recharging items */
2464 if (o_ptr->timeout || j_ptr->timeout) return (0);
2466 /* Require many identical values */
2467 if (o_ptr->ac != j_ptr->ac) return (0);
2468 if (o_ptr->dd != j_ptr->dd) return (0);
2469 if (o_ptr->ds != j_ptr->ds) return (0);
2471 /* Hack -- Never stack chests */
2472 if (o_ptr->tval == TV_CHEST) return (0);
2473 if (o_ptr->tval == TV_STATUE) return (0);
2474 if (o_ptr->tval == TV_CAPTURE) return (0);
2476 /* Require matching discounts */
2477 if (o_ptr->discount != j_ptr->discount) return (0);
2479 /* They match, so they must be similar */
2485 * @brief 店舗に並べた品を重ね合わせできるかどうか判定する /
2486 * Allow a store item to absorb another item
2487 * @param o_ptr 判定するオブジェクト構造体の参照ポインタ1
2488 * @param j_ptr 判定するオブジェクト構造体の参照ポインタ2
2489 * @return 重ね合わせできるならTRUEを返す
2492 * See "object_similar()" for the same function for the "player"
2495 static void store_object_absorb(object_type *o_ptr, object_type *j_ptr)
2497 int max_num = (o_ptr->tval == TV_ROD) ?
2498 MIN(99, MAX_SHORT / k_info[o_ptr->k_idx].pval) : 99;
2499 int total = o_ptr->number + j_ptr->number;
2500 int diff = (total > max_num) ? total - max_num : 0;
2502 /* Combine quantity, lose excess items */
2503 o_ptr->number = (total > max_num) ? max_num : total;
2505 /* Hack -- if rods are stacking, add the pvals (maximum timeouts) together. -LM- */
2506 if (o_ptr->tval == TV_ROD)
2508 o_ptr->pval += j_ptr->pval * (j_ptr->number - diff) / j_ptr->number;
2511 /* Hack -- if wands are stacking, combine the charges. -LM- */
2512 if (o_ptr->tval == TV_WAND)
2514 o_ptr->pval += j_ptr->pval * (j_ptr->number - diff) / j_ptr->number;
2520 * @brief 店舗に品を置くスペースがあるかどうかの判定を返す /
2521 * Check to see if the shop will be carrying too many objects -RAK-
2522 * @param o_ptr 店舗に置きたいオブジェクト構造体の参照ポインタ
2523 * @return 置き場がないなら0、重ね合わせできるアイテムがあるなら-1、スペースがあるなら1を返す。
2526 * Note that the shop, just like a player, will not accept things
2527 * it cannot hold. Before, one could "nuke" potions this way.
2528 * Return value is now int:
2530 * -1 : Can be combined to existing slot.
2531 * 1 : Cannot be combined but there are empty spaces.
2534 static int store_check_num(object_type *o_ptr)
2539 /* The "home" acts like the player */
2540 if ((cur_store_num == STORE_HOME) || (cur_store_num == STORE_MUSEUM))
2542 bool old_stack_force_notes = stack_force_notes;
2543 bool old_stack_force_costs = stack_force_costs;
2545 if (cur_store_num != STORE_HOME)
2547 stack_force_notes = FALSE;
2548 stack_force_costs = FALSE;
2551 /* Check all the items */
2552 for (i = 0; i < st_ptr->stock_num; i++)
2554 /* Get the existing item */
2555 j_ptr = &st_ptr->stock[i];
2557 /* Can the new object be combined with the old one? */
2558 if (object_similar(j_ptr, o_ptr))
2560 if (cur_store_num != STORE_HOME)
2562 stack_force_notes = old_stack_force_notes;
2563 stack_force_costs = old_stack_force_costs;
2570 if (cur_store_num != STORE_HOME)
2572 stack_force_notes = old_stack_force_notes;
2573 stack_force_costs = old_stack_force_costs;
2577 /* Normal stores do special stuff */
2580 /* Check all the items */
2581 for (i = 0; i < st_ptr->stock_num; i++)
2583 /* Get the existing item */
2584 j_ptr = &st_ptr->stock[i];
2586 /* Can the new object be combined with the old one? */
2587 if (store_object_similar(j_ptr, o_ptr)) return -1;
2591 /* Free space is always usable */
2593 * オプション powerup_home が設定されていると
2596 if ((cur_store_num == STORE_HOME) && ( powerup_home == FALSE )) {
2597 if (st_ptr->stock_num < ((st_ptr->stock_size) / 10)) {
2602 if (st_ptr->stock_num < st_ptr->stock_size) {
2607 /* But there was no room at the inn... */
2612 * @brief オブジェクトが祝福されているかの判定を返す /
2613 * @param o_ptr 判定したいオブジェクト構造体の参照ポインタ
2614 * @return アイテムが祝福されたアイテムならばTRUEを返す
2616 static bool is_blessed(object_type *o_ptr)
2618 BIT_FLAGS flgs[TR_FLAG_SIZE];
2619 object_flags(o_ptr, flgs);
2620 if (have_flag(flgs, TR_BLESSED)) return (TRUE);
2621 else return (FALSE);
2627 * @brief オブジェクトが所定の店舗で引き取れるかどうかを返す /
2628 * Determine if the current store will purchase the given item
2629 * @param o_ptr 判定したいオブジェクト構造体の参照ポインタ
2630 * @return アイテムが買い取れるならばTRUEを返す
2632 * Note that a shop-keeper must refuse to buy "worthless" items
2634 static bool store_will_buy(object_type *o_ptr)
2636 /* Hack -- The Home is simple */
2637 if ((cur_store_num == STORE_HOME) || (cur_store_num == STORE_MUSEUM)) return (TRUE);
2639 /* Switch on the store */
2640 switch (cur_store_num)
2645 /* Analyze the type */
2646 switch (o_ptr->tval)
2649 if (o_ptr->sval != SV_POTION_WATER) return FALSE;
2661 case TV_BOTTLE: /* 'Green', recycling Angband */
2676 /* Analyze the type */
2677 switch (o_ptr->tval)
2698 /* Analyze the type */
2699 switch (o_ptr->tval)
2708 case TV_HISSATSU_BOOK:
2712 if(o_ptr->sval == SV_WIZSTAFF) return (FALSE);
2724 /* Analyze the type */
2725 switch (o_ptr->tval)
2728 case TV_CRUSADE_BOOK:
2738 monster_race *r_ptr = &r_info[o_ptr->pval];
2741 if (!(r_ptr->flags3 & RF3_EVIL))
2744 if (r_ptr->flags3 & RF3_GOOD) break;
2746 /* Accept animals */
2747 if (r_ptr->flags3 & RF3_ANIMAL) break;
2750 if (my_strchr("?!", r_ptr->d_char)) break;
2756 if (is_blessed(o_ptr)) break;
2765 case STORE_ALCHEMIST:
2767 /* Analyze the type */
2768 switch (o_ptr->tval)
2782 /* Analyze the type */
2783 switch (o_ptr->tval)
2785 case TV_SORCERY_BOOK:
2786 case TV_NATURE_BOOK:
2790 case TV_ARCANE_BOOK:
2792 case TV_DAEMON_BOOK:
2806 if(o_ptr->sval == SV_WIZSTAFF) break;
2807 else return (FALSE);
2814 /* Bookstore Shop */
2817 /* Analyze the type */
2818 switch (o_ptr->tval)
2820 case TV_SORCERY_BOOK:
2821 case TV_NATURE_BOOK:
2826 case TV_ARCANE_BOOK:
2828 case TV_DAEMON_BOOK:
2829 case TV_CRUSADE_BOOK:
2840 /* Ignore "worthless" items */
2841 if (object_value(o_ptr) <= 0) return (FALSE);
2849 * @brief 現在の町の指定された店舗のアイテムを整理する /
2850 * Combine and reorder items in store.
2851 * @param store_num 店舗ID
2852 * @return 実際に整理が行われたならばTRUEを返す。
2854 bool combine_and_reorder_home(int store_num)
2858 object_type forge, *o_ptr, *j_ptr;
2859 bool flag = FALSE, combined;
2860 store_type *old_st_ptr = st_ptr;
2861 bool old_stack_force_notes = stack_force_notes;
2862 bool old_stack_force_costs = stack_force_costs;
2864 st_ptr = &town_info[1].store[store_num];
2865 if (store_num != STORE_HOME)
2867 stack_force_notes = FALSE;
2868 stack_force_costs = FALSE;
2875 /* Combine the items in the home (backwards) */
2876 for (i = st_ptr->stock_num - 1; i > 0; i--)
2878 o_ptr = &st_ptr->stock[i];
2880 /* Skip empty items */
2881 if (!o_ptr->k_idx) continue;
2883 /* Scan the items above that item */
2884 for (j = 0; j < i; j++)
2888 j_ptr = &st_ptr->stock[j];
2890 /* Skip empty items */
2891 if (!j_ptr->k_idx) continue;
2894 * Get maximum number of the stack if these
2895 * are similar, get zero otherwise.
2897 max_num = object_similar_part(j_ptr, o_ptr);
2899 /* Can we (partialy) drop "o_ptr" onto "j_ptr"? */
2900 if (max_num && j_ptr->number < max_num)
2902 if (o_ptr->number + j_ptr->number <= max_num)
2904 /* Add together the item counts */
2905 object_absorb(j_ptr, o_ptr);
2907 /* One object is gone */
2908 st_ptr->stock_num--;
2910 /* Slide everything down */
2911 for (k = i; k < st_ptr->stock_num; k++)
2913 /* Structure copy */
2914 st_ptr->stock[k] = st_ptr->stock[k + 1];
2917 /* Erase the "final" slot */
2918 object_wipe(&st_ptr->stock[k]);
2922 ITEM_NUMBER old_num = o_ptr->number;
2923 ITEM_NUMBER remain = j_ptr->number + o_ptr->number - max_num;
2925 /* Add together the item counts */
2926 object_absorb(j_ptr, o_ptr);
2928 o_ptr->number = remain;
2930 /* Hack -- if rods are stacking, add the pvals (maximum timeouts) and current timeouts together. -LM- */
2931 if (o_ptr->tval == TV_ROD)
2933 o_ptr->pval = o_ptr->pval * remain / old_num;
2934 o_ptr->timeout = o_ptr->timeout * remain / old_num;
2937 /* Hack -- if wands are stacking, combine the charges. -LM- */
2938 else if (o_ptr->tval == TV_WAND)
2940 o_ptr->pval = o_ptr->pval * remain / old_num;
2955 /* Re-order the items in the home (forwards) */
2956 for (i = 0; i < st_ptr->stock_num; i++)
2958 o_ptr = &st_ptr->stock[i];
2960 /* Skip empty slots */
2961 if (!o_ptr->k_idx) continue;
2963 /* Get the "value" of the item */
2964 o_value = object_value(o_ptr);
2966 /* Scan every occupied slot */
2967 for (j = 0; j < st_ptr->stock_num; j++)
2969 if (object_sort_comp(o_ptr, o_value, &st_ptr->stock[j])) break;
2972 /* Never move down */
2973 if (j >= i) continue;
2979 /* Save a copy of the moving item */
2980 object_copy(j_ptr, &st_ptr->stock[i]);
2982 /* Slide the objects */
2983 for (k = i; k > j; k--)
2985 /* Slide the item */
2986 object_copy(&st_ptr->stock[k], &st_ptr->stock[k - 1]);
2989 /* Insert the moving item */
2990 object_copy(&st_ptr->stock[j], j_ptr);
2993 st_ptr = old_st_ptr;
2994 if (store_num != STORE_HOME)
2996 stack_force_notes = old_stack_force_notes;
2997 stack_force_costs = old_stack_force_costs;
3005 * @brief 我が家にオブジェクトを加える /
3006 * Add the item "o_ptr" to the inventory of the "Home"
3007 * @param o_ptr 加えたいオブジェクトの構造体参照ポインタ
3011 * In all cases, return the slot (or -1) where the object was placed
3012 * Note that this is a hacked up version of "inven_carry()".
3013 * Also note that it may not correctly "adapt" to "knowledge" bacoming
3014 * known, the player may have to pick stuff up and drop it again.
3017 static int home_carry(object_type *o_ptr)
3023 bool old_stack_force_notes = stack_force_notes;
3024 bool old_stack_force_costs = stack_force_costs;
3026 if (cur_store_num != STORE_HOME)
3028 stack_force_notes = FALSE;
3029 stack_force_costs = FALSE;
3032 /* Check each existing item (try to combine) */
3033 for (slot = 0; slot < st_ptr->stock_num; slot++)
3035 /* Get the existing item */
3036 j_ptr = &st_ptr->stock[slot];
3038 /* The home acts just like the player */
3039 if (object_similar(j_ptr, o_ptr))
3041 /* Save the new number of items */
3042 object_absorb(j_ptr, o_ptr);
3044 if (cur_store_num != STORE_HOME)
3046 stack_force_notes = old_stack_force_notes;
3047 stack_force_costs = old_stack_force_costs;
3055 if (cur_store_num != STORE_HOME)
3057 stack_force_notes = old_stack_force_notes;
3058 stack_force_costs = old_stack_force_costs;
3063 * 隠し機能: オプション powerup_home が設定されていると
3067 if ((cur_store_num != STORE_HOME) || (powerup_home == TRUE)) {
3068 if (st_ptr->stock_num >= st_ptr->stock_size) {
3073 if (st_ptr->stock_num >= ((st_ptr->stock_size) / 10)) {
3079 /* Determine the "value" of the item */
3080 value = object_value(o_ptr);
3082 /* Check existing slots to see if we must "slide" */
3083 for (slot = 0; slot < st_ptr->stock_num; slot++)
3085 if (object_sort_comp(o_ptr, value, &st_ptr->stock[slot])) break;
3088 /* Slide the others up */
3089 for (i = st_ptr->stock_num; i > slot; i--)
3091 st_ptr->stock[i] = st_ptr->stock[i-1];
3094 /* More stuff now */
3095 st_ptr->stock_num++;
3097 /* Insert the new item */
3098 st_ptr->stock[slot] = *o_ptr;
3100 chg_virtue(V_SACRIFICE, -1);
3102 (void)combine_and_reorder_home(cur_store_num);
3104 /* Return the location */
3110 * @brief 店舗にオブジェクトを加える /
3111 * Add the item "o_ptr" to a real stores inventory.
3112 * @param o_ptr 加えたいオブジェクトの構造体参照ポインタ
3116 * In all cases, return the slot (or -1) where the object was placed
3117 * Note that this is a hacked up version of "inven_carry()".
3118 * Also note that it may not correctly "adapt" to "knowledge" bacoming
3119 * known, the player may have to pick stuff up and drop it again.
3122 static int store_carry(object_type *o_ptr)
3125 PRICE value, j_value;
3129 /* Evaluate the object */
3130 value = object_value(o_ptr);
3132 /* Cursed/Worthless items "disappear" when sold */
3133 if (value <= 0) return (-1);
3135 /* All store items are fully *identified* */
3136 o_ptr->ident |= IDENT_MENTAL;
3138 /* Erase the inscription */
3139 o_ptr->inscription = 0;
3141 /* Erase the "feeling" */
3142 o_ptr->feeling = FEEL_NONE;
3144 /* Check each existing item (try to combine) */
3145 for (slot = 0; slot < st_ptr->stock_num; slot++)
3147 /* Get the existing item */
3148 j_ptr = &st_ptr->stock[slot];
3150 /* Can the existing items be incremented? */
3151 if (store_object_similar(j_ptr, o_ptr))
3153 /* Hack -- extra items disappear */
3154 store_object_absorb(j_ptr, o_ptr);
3162 if (st_ptr->stock_num >= st_ptr->stock_size) return (-1);
3165 /* Check existing slots to see if we must "slide" */
3166 for (slot = 0; slot < st_ptr->stock_num; slot++)
3169 j_ptr = &st_ptr->stock[slot];
3171 /* Objects sort by decreasing type */
3172 if (o_ptr->tval > j_ptr->tval) break;
3173 if (o_ptr->tval < j_ptr->tval) continue;
3175 /* Objects sort by increasing sval */
3176 if (o_ptr->sval < j_ptr->sval) break;
3177 if (o_ptr->sval > j_ptr->sval) continue;
3180 * Hack: otherwise identical rods sort by
3181 * increasing recharge time --dsb
3183 if (o_ptr->tval == TV_ROD)
3185 if (o_ptr->pval < j_ptr->pval) break;
3186 if (o_ptr->pval > j_ptr->pval) continue;
3189 /* Evaluate that slot */
3190 j_value = object_value(j_ptr);
3192 /* Objects sort by decreasing value */
3193 if (value > j_value) break;
3194 if (value < j_value) continue;
3197 /* Slide the others up */
3198 for (i = st_ptr->stock_num; i > slot; i--)
3200 st_ptr->stock[i] = st_ptr->stock[i-1];
3203 /* More stuff now */
3204 st_ptr->stock_num++;
3206 /* Insert the new item */
3207 st_ptr->stock[slot] = *o_ptr;
3209 /* Return the location */
3215 * @brief 店舗のオブジェクト数を増やす /
3216 * Add the item "o_ptr" to a real stores inventory.
3217 * @param item 増やしたいアイテムのID
3222 * Increase, by a given amount, the number of a certain item
3223 * in a certain store. This can result in zero items.
3225 * @todo numは本来ITEM_NUMBER型にしたい。
3227 static void store_item_increase(INVENTORY_IDX item, int num)
3232 o_ptr = &st_ptr->stock[item];
3234 /* Verify the number */
3235 cnt = o_ptr->number + num;
3236 if (cnt > 255) cnt = 255;
3237 else if (cnt < 0) cnt = 0;
3238 num = cnt - o_ptr->number;
3240 /* Save the new number */
3241 o_ptr->number += (ITEM_NUMBER)num;
3246 * @brief 店舗のオブジェクト数を削除する /
3247 * Remove a slot if it is empty
3248 * @param item 削除したいアイテムのID
3251 static void store_item_optimize(INVENTORY_IDX item)
3256 o_ptr = &st_ptr->stock[item];
3259 if (!o_ptr->k_idx) return;
3261 /* Must have no items */
3262 if (o_ptr->number) return;
3265 st_ptr->stock_num--;
3267 /* Slide everyone */
3268 for (j = item; j < st_ptr->stock_num; j++)
3270 st_ptr->stock[j] = st_ptr->stock[j + 1];
3273 /* Nuke the final slot */
3274 object_wipe(&st_ptr->stock[j]);
3278 * @brief ブラックマーケット用の無価値品の排除判定 /
3279 * This function will keep 'crap' out of the black market.
3280 * @param o_ptr 判定したいオブジェクトの構造体参照ポインタ
3281 * @return ブラックマーケットにとって無価値な品ならばTRUEを返す
3284 * Crap is defined as any item that is "available" elsewhere
3285 * Based on a suggestion by "Lee Vogt" <lvogt@cig.mcel.mot.com>
3288 static bool black_market_crap(object_type *o_ptr)
3292 /* Ego items are never crap */
3293 if (object_is_ego(o_ptr)) return (FALSE);
3295 /* Good items are never crap */
3296 if (o_ptr->to_a > 0) return (FALSE);
3297 if (o_ptr->to_h > 0) return (FALSE);
3298 if (o_ptr->to_d > 0) return (FALSE);
3300 /* Check all stores */
3301 for (i = 0; i < MAX_STORES; i++)
3303 if (i == STORE_HOME) continue;
3304 if (i == STORE_MUSEUM) continue;
3306 /* Check every item in the store */
3307 for (j = 0; j < town_info[p_ptr->town_num].store[i].stock_num; j++)
3309 object_type *j_ptr = &town_info[p_ptr->town_num].store[i].stock[j];
3311 /* Duplicate item "type", assume crappy */
3312 if (o_ptr->k_idx == j_ptr->k_idx) return (TRUE);
3322 * @brief 店舗の品揃え変化のためにアイテムを削除する /
3323 * Attempt to delete (some of) a random item from the store
3327 * Hack -- we attempt to "maintain" piles of items when possible.
3330 static void store_delete(void)
3335 /* Pick a random slot */
3336 what = (INVENTORY_IDX)randint0(st_ptr->stock_num);
3338 /* Determine how many items are here */
3339 num = st_ptr->stock[what].number;
3341 /* Hack -- sometimes, only destroy half the items */
3342 if (randint0(100) < 50) num = (num + 1) / 2;
3344 /* Hack -- sometimes, only destroy a single item */
3345 if (randint0(100) < 50) num = 1;
3347 /* Hack -- decrement the maximum timeouts and total charges of rods and wands. -LM- */
3348 if ((st_ptr->stock[what].tval == TV_ROD) || (st_ptr->stock[what].tval == TV_WAND))
3350 st_ptr->stock[what].pval -= num * st_ptr->stock[what].pval / st_ptr->stock[what].number;
3353 /* Actually destroy (part of) the item */
3354 store_item_increase(what, -num);
3355 store_item_optimize(what);
3360 * @brief 店舗の品揃え変化のためにアイテムを追加する /
3361 * Creates a random item and gives it to a store
3365 * This algorithm needs to be rethought. A lot.
3366 * Currently, "normal" stores use a pre-built array.
3367 * Note -- the "level" given to "obj_get_num()" is a "favored"
3368 * level, that is, there is a much higher chance of getting
3369 * items with a level approaching that of the given level...
3370 * Should we check for "permission" to have the given item?
3373 static void store_create(void)
3383 /* Paranoia -- no room left */
3384 if (st_ptr->stock_num >= st_ptr->stock_size) return;
3387 /* Hack -- consider up to four items */
3388 for (tries = 0; tries < 4; tries++)
3391 if (cur_store_num == STORE_BLACK)
3393 /* Pick a level for object/magic */
3394 level = 25 + randint0(25);
3396 /* Random item (usually of given level) */
3397 i = get_obj_num(level);
3399 /* Handle failure */
3406 /* Hack -- Pick an item to sell */
3407 i = st_ptr->table[randint0(st_ptr->table_num)];
3409 /* Hack -- fake level for apply_magic() */
3410 level = rand_range(1, STORE_OBJ_LEVEL);
3415 /* Create a new object of the chosen kind */
3416 object_prep(q_ptr, i);
3418 /* Apply some "low-level" magic (no artifacts) */
3419 apply_magic(q_ptr, level, AM_NO_FIXED_ART);
3421 /* Require valid object */
3422 if (!store_will_buy(q_ptr)) continue;
3424 /* Hack -- Charge lite's */
3425 if (q_ptr->tval == TV_LITE)
3427 if (q_ptr->sval == SV_LITE_TORCH) q_ptr->xtra4 = FUEL_TORCH / 2;
3428 if (q_ptr->sval == SV_LITE_LANTERN) q_ptr->xtra4 = FUEL_LAMP / 2;
3432 /* The item is "known" */
3433 object_known(q_ptr);
3435 /* Mark it storebought */
3436 q_ptr->ident |= IDENT_STORE;
3438 /* Mega-Hack -- no chests in stores */
3439 if (q_ptr->tval == TV_CHEST) continue;
3441 /* Prune the black market */
3442 if (cur_store_num == STORE_BLACK)
3444 /* Hack -- No "crappy" items */
3445 if (black_market_crap(q_ptr)) continue;
3447 /* Hack -- No "cheap" items */
3448 if (object_value(q_ptr) < 10) continue;
3450 /* No "worthless" items */
3451 /* if (object_value(q_ptr) <= 0) continue; */
3454 /* Prune normal stores */
3457 /* No "worthless" items */
3458 if (object_value(q_ptr) <= 0) continue;
3462 /* Mass produce and/or Apply discount */
3463 mass_produce(q_ptr);
3465 /* Attempt to carry the (known) item */
3466 (void)store_carry(q_ptr);
3468 /* Definitely done */
3475 * @brief 店舗の割引対象外にするかどうかを判定 /
3476 * Eliminate need to bargain if player has haggled well in the past
3477 * @param minprice アイテムの最低販売価格
3478 * @return 割引を禁止するならTRUEを返す。
3480 static bool noneedtobargain(PRICE minprice)
3482 PRICE good = st_ptr->good_buy;
3483 PRICE bad = st_ptr->bad_buy;
3485 /* Cheap items are "boring" */
3486 if (minprice < 10L) return (TRUE);
3488 /* Perfect haggling */
3489 if (good == MAX_SHORT) return (TRUE);
3491 /* Reward good haggles, punish bad haggles, notice price */
3492 if (good > ((3 * bad) + (5 + (minprice/50)))) return (TRUE);
3494 /* Return the flag */
3500 * @brief 店主の持つプレイヤーに対する売買の良し悪し経験を記憶する /
3501 * Update the bargain info
3502 * @param price 実際の取引価格
3503 * @param minprice 店主の提示した価格
3507 static void updatebargain(PRICE price, PRICE minprice, int num)
3509 /* Hack -- auto-haggle */
3510 if (!manual_haggle) return;
3512 /* Cheap items are "boring" */
3513 if ((minprice/num) < 10L) return;
3515 /* Count the successful haggles */
3516 if (price == minprice)
3518 /* Just count the good haggles */
3519 if (st_ptr->good_buy < MAX_SHORT)
3525 /* Count the failed haggles */
3528 /* Just count the bad haggles */
3529 if (st_ptr->bad_buy < MAX_SHORT)
3538 * @brief 店の商品リストを再表示する /
3539 * Re-displays a single store entry
3543 static void display_entry(int pos)
3549 GAME_TEXT o_name[MAX_NLEN];
3554 o_ptr = &st_ptr->stock[pos];
3556 /* Get the "offset" */
3557 i = (pos % store_bottom);
3559 /* Label it, clear the line --(-- */
3560 (void)sprintf(out_val, "%c) ", ((i > 25) ? toupper(I2A(i - 26)) : I2A(i)));
3561 prt(out_val, i+6, 0);
3564 if (show_item_graph)
3566 TERM_COLOR a = object_attr(o_ptr);
3567 SYMBOL_CODE c = object_char(o_ptr);
3569 Term_queue_bigchar(cur_col, i + 6, a, c, 0, 0);
3570 if (use_bigtile) cur_col++;
3575 /* Describe an item in the home */
3576 if ((cur_store_num == STORE_HOME) || (cur_store_num == STORE_MUSEUM))
3580 /* Leave room for weights, if necessary -DRS- */
3581 if (show_weights) maxwid -= 10;
3583 object_desc(o_name, o_ptr, 0);
3584 o_name[maxwid] = '\0';
3585 c_put_str(tval_to_attr[o_ptr->tval], o_name, i+6, cur_col);
3590 /* Only show the weight of an individual item */
3591 WEIGHT wgt = o_ptr->weight;
3593 sprintf(out_val, "%3d.%1d kg", lbtokg1(wgt) , lbtokg2(wgt));
3594 put_str(out_val, i+6, 67);
3596 (void)sprintf(out_val, "%3d.%d lb", wgt / 10, wgt % 10);
3597 put_str(out_val, i+6, 68);
3603 /* Describe an item (fully) in a store */
3606 /* Must leave room for the "price" */
3609 /* Leave room for weights, if necessary -DRS- */
3610 if (show_weights) maxwid -= 7;
3612 /* Describe the object (fully) */
3613 object_desc(o_name, o_ptr, 0);
3614 o_name[maxwid] = '\0';
3615 c_put_str(tval_to_attr[o_ptr->tval], o_name, i+6, cur_col);
3620 /* Only show the weight of an individual item */
3621 int wgt = o_ptr->weight;
3623 sprintf(out_val, "%3d.%1d", lbtokg1(wgt) , lbtokg2(wgt) );
3624 put_str(out_val, i+6, 60);
3626 (void)sprintf(out_val, "%3d.%d", wgt / 10, wgt % 10);
3627 put_str(out_val, i+6, 61);
3632 /* Display a "fixed" cost */
3633 if (o_ptr->ident & (IDENT_FIXED))
3635 /* Extract the "minimum" price */
3636 x = price_item(o_ptr, ot_ptr->min_inflate, FALSE);
3638 /* Actually draw the price (not fixed) */
3640 (void)sprintf(out_val, "%9ld固", (long)x);
3642 (void)sprintf(out_val, "%9ld F", (long)x);
3644 put_str(out_val, i+6, 68);
3647 /* Display a "taxed" cost */
3648 else if (!manual_haggle)
3650 /* Extract the "minimum" price */
3651 x = price_item(o_ptr, ot_ptr->min_inflate, FALSE);
3653 /* Hack -- Apply Sales Tax if needed */
3654 if (!noneedtobargain(x)) x += x / 10;
3656 /* Actually draw the price (with tax) */
3657 (void)sprintf(out_val, "%9ld ", (long)x);
3658 put_str(out_val, i+6, 68);
3661 /* Display a "haggle" cost */
3664 /* Extrect the "maximum" price */
3665 x = price_item(o_ptr, ot_ptr->max_inflate, FALSE);
3667 /* Actually draw the price (not fixed) */
3668 (void)sprintf(out_val, "%9ld ", (long)x);
3669 put_str(out_val, i+6, 68);
3676 * @brief 店の商品リストを表示する /
3677 * Displays a store's inventory -RAK-
3680 * All prices are listed as "per individual object". -BEN-
3682 static void display_inventory(void)
3686 /* Display the next 12 items */
3687 for (k = 0; k < store_bottom; k++)
3689 /* Do not display "dead" items */
3690 if (store_top + k >= st_ptr->stock_num) break;
3692 /* Display that line */
3693 display_entry(store_top + k);
3696 /* Erase the extra lines and the "more" prompt */
3697 for (i = k; i < store_bottom + 1; i++) prt("", i + 6, 0);
3699 /* Assume "no current page" */
3701 put_str(" ", 5, 20);
3703 put_str(" ", 5, 20);
3707 /* Visual reminder of "more items" */
3708 if (st_ptr->stock_num > store_bottom)
3710 /* Show "more" reminder (after the last item) */
3711 prt(_("-続く-", "-more-"), k + 6, 3);
3713 /* Indicate the "current page" */
3714 /* Trailing spaces are to display (Page xx) and (Page x) */
3715 put_str(format(_("(%dページ) ", "(Page %d) "), store_top/store_bottom + 1), 5, 20);
3718 if (cur_store_num == STORE_HOME || cur_store_num == STORE_MUSEUM)
3720 k = st_ptr->stock_size;
3722 if (cur_store_num == STORE_HOME && !powerup_home) k /= 10;
3724 put_str(format("アイテム数: %4d/%4d", st_ptr->stock_num, k), 19 + xtra_stock, 27);
3726 put_str(format("Objects: %4d/%4d", st_ptr->stock_num, k), 19 + xtra_stock, 30);
3733 * @brief プレイヤーの所持金を表示する /
3734 * Displays players gold -RAK-
3738 static void store_prt_gold(void)
3742 prt(_("手持ちのお金: ", "Gold Remaining: "), 19 + xtra_stock, 53);
3743 sprintf(out_val, "%9ld", (long)p_ptr->au);
3744 prt(out_val, 19 + xtra_stock, 68);
3748 * @brief 店舗情報全体を表示するメインルーチン /
3749 * Displays store (after clearing screen) -RAK-
3753 static void display_store(void)
3759 /* The "Home" is special */
3760 if (cur_store_num == STORE_HOME)
3762 /* Put the owner name */
3763 put_str(_("我が家", "Your Home"), 3, 31);
3765 /* Label the item descriptions */
3766 put_str(_("アイテムの一覧", "Item Description"), 5, 4);
3768 /* If showing weights, show label */
3771 put_str(_(" 重さ", "Weight"), 5, 70);
3775 /* The "Home" is special */
3776 else if (cur_store_num == STORE_MUSEUM)
3778 /* Put the owner name */
3779 put_str(_("博物館", "Museum"), 3, 31);
3781 /* Label the item descriptions */
3782 put_str(_("アイテムの一覧", "Item Description"), 5, 4);
3784 /* If showing weights, show label */
3787 put_str(_(" 重さ", "Weight"), 5, 70);
3794 concptr store_name = (f_name + f_info[cur_store_feat].name);
3795 concptr owner_name = (ot_ptr->owner_name);
3796 concptr race_name = race_info[ot_ptr->owner_race].title;
3798 /* Put the owner name and race */
3799 sprintf(buf, "%s (%s)", owner_name, race_name);
3800 put_str(buf, 3, 10);
3802 /* Show the max price in the store (above prices) */
3803 sprintf(buf, "%s (%ld)", store_name, (long)(ot_ptr->max_cost));
3806 /* Label the item descriptions */
3807 put_str(_("商品の一覧", "Item Description"), 5, 5);
3810 /* If showing weights, show label */
3813 put_str(_(" 重さ", "Weight"), 5, 60);
3816 /* Label the asking price (in stores) */
3817 put_str(_(" 価格", "Price"), 5, 72);
3820 /* Display the current gold */
3823 /* Draw in the inventory */
3824 display_inventory();
3830 * @brief 店舗からアイテムを選択する /
3831 * Get the ID of a store item and return its value -RAK-
3832 * @param com_val 選択IDを返す参照ポインタ
3833 * @param pmt メッセージキャプション
3836 * @return 実際に選択したらTRUE、キャンセルしたらFALSE
3838 static int get_stock(COMMAND_CODE *com_val, concptr pmt, int i, int j)
3844 /* Get the item index */
3845 if (repeat_pull(com_val))
3847 /* Verify the item */
3848 if ((*com_val >= i) && (*com_val <= j))
3856 /* Assume failure */
3859 /* Build the prompt */
3861 hi = (j > 25) ? toupper(I2A(j - 26)) : I2A(j);
3863 (void)sprintf(out_val, "(%s:%c-%c, ESCで中断) %s",
3864 (((cur_store_num == STORE_HOME) || (cur_store_num == STORE_MUSEUM)) ? "アイテム" : "商品"),
3867 (void)sprintf(out_val, "(Items %c-%c, ESC to exit) %s",
3872 /* Ask until done */
3878 if (!get_com(out_val, &command, FALSE)) break;
3881 if (islower(command))
3883 else if (isupper(command))
3884 k = A2I(tolower(command)) + 26;
3888 /* Legal responses */
3889 if ((k >= i) && (k <= j))
3898 /* Clear the prompt */
3901 if (command == ESCAPE) return (FALSE);
3903 repeat_push(*com_val);
3911 * @brief 店主の不満度を増やし、プレイヤーを締め出す判定と処理を行う /
3912 * Increase the insult counter and get angry if too many -RAK-
3913 * @return プレイヤーを締め出す場合TRUEを返す
3915 static int increase_insults(void)
3917 /* Increase insults */
3918 st_ptr->insult_cur++;
3920 /* Become insulted */
3921 if (st_ptr->insult_cur > ot_ptr->insult_max)
3927 st_ptr->insult_cur = 0;
3928 st_ptr->good_buy = 0;
3929 st_ptr->bad_buy = 0;
3932 st_ptr->store_open = current_world_ptr->game_turn + TURNS_PER_TICK*TOWN_DAWN/8 + randint1(TURNS_PER_TICK*TOWN_DAWN/8);
3944 * @brief 店主の不満度を減らす /
3945 * Decrease insults -RAK-
3946 * @return プレイヤーを締め出す場合TRUEを返す
3948 static void decrease_insults(void)
3950 /* Decrease insults */
3951 if (st_ptr->insult_cur) st_ptr->insult_cur--;
3956 * @brief 店主の不満度が増えた場合のみのメッセージを表示する /
3957 * Have insulted while haggling -RAK-
3958 * @return プレイヤーを締め出す場合TRUEを返す
3960 static int haggle_insults(void)
3962 /* Increase insults */
3963 if (increase_insults()) return (TRUE);
3965 /* Display and flush insult */
3974 * Mega-Hack -- Enable "increments"
3976 static bool allow_inc = FALSE;
3979 * Mega-Hack -- Last "increment" during haggling
3981 static s32b last_inc = 0L;
3985 * @brief 交渉価格を確認と認証の是非を行う /
3988 * @param poffer 別途価格提示をした場合の値を返す参照ポインタ
3989 * @param price 現在の交渉価格
3990 * @param final 最終確定価格ならばTRUE
3991 * @return プレイヤーを締め出す場合TRUEを返す
3993 static int get_haggle(concptr pmt, s32b *poffer, PRICE price, int final)
3998 GAME_TEXT out_val[160];
4000 /* Clear old increment if necessary */
4001 if (!allow_inc) last_inc = 0L;
4006 sprintf(buf, _("%s [承諾] ", "%s [accept] "), pmt);
4009 /* Old (negative) increment, and not final */
4010 else if (last_inc < 0)
4012 sprintf(buf, _("%s [-$%ld] ", "%s [-%ld] "), pmt, (long)(ABS(last_inc)));
4015 /* Old (positive) increment, and not final */
4016 else if (last_inc > 0)
4018 sprintf(buf, _("%s [+$%ld] ", "%s [+%ld] "), pmt, (long)(ABS(last_inc)));
4024 sprintf(buf, "%s ", pmt);
4028 /* Ask until done */
4033 /* Display prompt */
4037 strcpy(out_val, "");
4040 * Ask the user for a response.
4041 * Don't allow to use numpad as cursor key.
4043 res = askfor_aux(out_val, 32, FALSE);
4049 if (!res) return FALSE;
4051 /* Skip leading spaces */
4052 for (p = out_val; *p == ' '; p++) /* loop */;
4054 /* Empty response */
4057 /* Accept current price */
4065 /* Use previous increment */
4066 if (allow_inc && last_inc)
4068 *poffer += last_inc;
4073 /* Normal response */
4076 /* Extract a number */
4079 /* Handle "incremental" number */
4080 if ((*p == '+' || *p == '-'))
4082 /* Allow increments */
4085 /* Use the given "increment" */
4092 /* Handle normal number */
4095 /* Use the given "number" */
4103 msg_print(_("値がおかしいです。", "Invalid response."));
4113 * @brief 店主がプレイヤーからの交渉価格を判断する /
4114 * Receive an offer (from the player)
4116 * @param poffer 店主からの交渉価格を返す参照ポインタ
4117 * @param last_offer 現在の交渉価格
4118 * @param factor 店主の価格基準倍率
4119 * @param price アイテムの実価値
4120 * @param final 最終価格確定ならばTRUE
4121 * @return プレイヤーの価格に対して不服ならばTRUEを返す /
4122 * Return TRUE if offer is NOT okay
4124 static bool receive_offer(concptr pmt, s32b *poffer,
4125 s32b last_offer, int factor,
4126 PRICE price, int final)
4128 /* Haggle till done */
4131 /* Get a haggle (or cancel) */
4132 if (!get_haggle(pmt, poffer, price, final)) return (TRUE);
4134 /* Acceptable offer */
4135 if (((*poffer) * factor) >= (last_offer * factor)) break;
4137 /* Insult, and check for kicked out */
4138 if (haggle_insults()) return (TRUE);
4140 /* Reject offer (correctly) */
4141 (*poffer) = last_offer;
4150 * @brief プレイヤーが購入する時の値切り処理メインルーチン /
4151 * Haggling routine -RAK-
4152 * @param o_ptr オブジェクトの構造体参照ポインタ
4153 * @param price 最終価格を返す参照ポインタ
4154 * @return プレイヤーの価格に対して店主が不服ならばTRUEを返す /
4155 * Return TRUE if purchase is NOT successful
4157 static bool purchase_haggle(object_type *o_ptr, s32b *price)
4159 s32b cur_ask, final_ask;
4160 s32b last_offer, offer;
4162 s32b min_per, max_per;
4163 int flag, loop_flag, noneed;
4164 int annoyed = 0, final = FALSE;
4165 bool cancel = FALSE;
4169 concptr pmt = _("提示価格", "Asking");
4171 /* Extract the starting offer and the final offer */
4172 cur_ask = price_item(o_ptr, ot_ptr->max_inflate, FALSE);
4173 final_ask = price_item(o_ptr, ot_ptr->min_inflate, FALSE);
4175 /* Determine if haggling is necessary */
4176 noneed = noneedtobargain(final_ask);
4178 /* No need to haggle */
4179 if (noneed || !manual_haggle)
4181 /* No need to haggle */
4184 /* Message summary */
4185 msg_print(_("結局この金額にまとまった。", "You eventually agree upon the price."));
4189 /* No haggle option */
4192 /* Message summary */
4193 msg_print(_("すんなりとこの金額にまとまった。", "You quickly agree upon the price."));
4196 /* Apply Sales Tax */
4197 final_ask += final_ask / 10;
4201 cur_ask = final_ask;
4203 /* Go to final offer */
4204 pmt = _("最終提示価格", "Final Offer");
4209 /* Haggle for the whole pile */
4210 cur_ask *= o_ptr->number;
4211 final_ask *= o_ptr->number;
4214 /* Haggle parameters */
4215 min_per = ot_ptr->haggle_per;
4216 max_per = min_per * 3;
4218 /* Mega-Hack -- artificial "last offer" value */
4219 last_offer = object_value(o_ptr) * o_ptr->number;
4220 last_offer = last_offer * (200 - (int)(ot_ptr->max_inflate)) / 100L;
4221 if (last_offer <= 0) last_offer = 1;
4226 /* No incremental haggling yet */
4229 /* Haggle until done */
4230 for (flag = FALSE; !flag; )
4234 while (!flag && loop_flag)
4236 (void)sprintf(out_val, "%s : %ld", pmt, (long)cur_ask);
4237 put_str(out_val, 1, 0);
4238 cancel = receive_offer(_("提示する金額? ", "What do you offer? "), &offer, last_offer, 1, cur_ask, final);
4243 else if (offer > cur_ask)
4248 else if (offer == cur_ask)
4261 x1 = 100 * (offer - last_offer) / (cur_ask - last_offer);
4264 if (haggle_insults())
4270 else if (x1 > max_per)
4273 if (x1 < max_per) x1 = max_per;
4275 x2 = rand_range(x1-2, x1+2);
4276 x3 = ((cur_ask - offer) * x2 / 100L) + 1;
4277 /* don't let the price go up */
4282 if (cur_ask < final_ask)
4285 cur_ask = final_ask;
4286 pmt = _("最終提示価格", "What do you offer? ");
4290 (void)(increase_insults());
4295 else if (offer >= cur_ask)
4306 (void)sprintf(out_val, _("前回の提示金額: $%ld", "Your last offer: %ld"), (long)last_offer);
4307 put_str(out_val, 1, 39);
4308 say_comment_2(cur_ask, annoyed);
4313 if (cancel) return (TRUE);
4315 updatebargain(*price, final_ask, o_ptr->number);
4323 * @brief プレイヤーが売却する時の値切り処理メインルーチン /
4324 * Haggling routine -RAK-
4325 * @param o_ptr オブジェクトの構造体参照ポインタ
4326 * @param price 最終価格を返す参照ポインタ
4327 * @return プレイヤーの価格に対して店主が不服ならばTRUEを返す /
4328 * Return TRUE if purchase is NOT successful
4330 static bool sell_haggle(object_type *o_ptr, s32b *price)
4332 s32b purse, cur_ask, final_ask;
4333 s32b last_offer = 0, offer = 0;
4335 s32b min_per, max_per;
4336 int flag, loop_flag, noneed;
4337 int annoyed = 0, final = FALSE;
4338 bool cancel = FALSE;
4339 concptr pmt = _("提示金額", "Offer");
4345 /* Obtain the starting offer and the final offer */
4346 cur_ask = price_item(o_ptr, ot_ptr->max_inflate, TRUE);
4347 final_ask = price_item(o_ptr, ot_ptr->min_inflate, TRUE);
4349 /* Determine if haggling is necessary */
4350 noneed = noneedtobargain(final_ask);
4352 /* Get the owner's payout limit */
4353 purse = (s32b)(ot_ptr->max_cost);
4355 /* No need to haggle */
4356 if (noneed || !manual_haggle || (final_ask >= purse))
4358 /* Apply Sales Tax (if needed) */
4359 if (!manual_haggle && !noneed)
4361 final_ask -= final_ask / 10;
4364 /* No reason to haggle */
4365 if (final_ask >= purse)
4367 msg_print(_("即座にこの金額にまとまった。", "You instantly agree upon the price."));
4370 /* Offer full purse */
4374 /* No need to haggle */
4377 msg_print(_("結局この金額にまとまった。", "You eventually agree upon the price."));
4381 /* No haggle option */
4384 /* Message summary */
4385 msg_print(_("すんなりとこの金額にまとまった。", "You quickly agree upon the price."));
4390 cur_ask = final_ask;
4394 pmt = _("最終提示金額", "Final Offer");
4397 /* Haggle for the whole pile */
4398 cur_ask *= o_ptr->number;
4399 final_ask *= o_ptr->number;
4402 /* Display commands */
4404 /* Haggling parameters */
4405 min_per = ot_ptr->haggle_per;
4406 max_per = min_per * 3;
4408 /* Mega-Hack -- artificial "last offer" value */
4409 last_offer = object_value(o_ptr) * o_ptr->number;
4410 last_offer = last_offer * ot_ptr->max_inflate / 100L;
4415 /* No incremental haggling yet */
4419 for (flag = FALSE; !flag; )
4425 (void)sprintf(out_val, "%s : %ld", pmt, (long)cur_ask);
4426 put_str(out_val, 1, 0);
4427 cancel = receive_offer(_("提示する価格? ", "What price do you ask? "),
4428 &offer, last_offer, -1, cur_ask, final);
4434 else if (offer < cur_ask)
4437 /* rejected, reset offer for incremental haggling */
4440 else if (offer == cur_ask)
4451 if (flag || !loop_flag) break;
4456 x1 = 100 * (last_offer - offer) / (last_offer - cur_ask);
4459 if (haggle_insults())
4465 else if (x1 > max_per)
4468 if (x1 < max_per) x1 = max_per;
4470 x2 = rand_range(x1-2, x1+2);
4471 x3 = ((offer - cur_ask) * x2 / 100L) + 1;
4472 /* don't let the price go down */
4476 if (cur_ask > final_ask)
4478 cur_ask = final_ask;
4480 pmt = _("最終提示金額", "Final Offer");
4487 /* 追加 $0 で買い取られてしまうのを防止 By FIRST*/
4490 (void)(increase_insults());
4493 else if (offer <= cur_ask)
4504 (void)sprintf(out_val,
4505 _("前回の提示価格 $%ld", "Your last bid %ld"), (long)last_offer);
4506 put_str(out_val, 1, 39);
4507 say_comment_3(cur_ask, annoyed);
4512 if (cancel) return (TRUE);
4514 updatebargain(*price, final_ask, o_ptr->number);
4522 * @brief 店からの購入処理のメインルーチン /
4523 * Buy an item from a store -RAK-
4526 static void store_purchase(void)
4529 COMMAND_CODE item, item_new;
4540 GAME_TEXT o_name[MAX_NLEN];
4544 if (cur_store_num == STORE_MUSEUM)
4546 msg_print(_("博物館から取り出すことはできません。", "Museum."));
4551 if (st_ptr->stock_num <= 0)
4553 if (cur_store_num == STORE_HOME)
4554 msg_print(_("我が家には何も置いてありません。", "Your home is empty."));
4556 msg_print(_("現在商品の在庫を切らしています。", "I am currently out of stock."));
4560 /* Find the number of objects on this and following pages */
4561 i = (st_ptr->stock_num - store_top);
4563 /* And then restrict it to the current page */
4564 if (i > store_bottom) i = store_bottom;
4568 /* ブラックマーケットの時は別のメッセージ */
4569 switch( cur_store_num ) {
4571 sprintf(out_val, "どのアイテムを取りますか? ");
4574 sprintf(out_val, "どれ? ");
4577 sprintf(out_val, "どの品物が欲しいんだい? ");
4581 if (cur_store_num == STORE_HOME)
4583 sprintf(out_val, "Which item do you want to take? ");
4587 sprintf(out_val, "Which item are you interested in? ");
4592 /* Get the item number to be bought */
4593 if (!get_stock(&item, out_val, 0, i - 1)) return;
4595 /* Get the actual index */
4596 item = item + store_top;
4598 /* Get the actual item */
4599 o_ptr = &st_ptr->stock[item];
4601 /* Assume the player wants just one of them */
4605 /* Get a copy of the object */
4606 object_copy(j_ptr, o_ptr);
4609 * If a rod or wand, allocate total maximum timeouts or charges
4610 * between those purchased and left on the shelf.
4612 reduce_charges(j_ptr, o_ptr->number - amt);
4614 /* Modify quantity */
4615 j_ptr->number = amt;
4617 /* Hack -- require room in pack */
4618 if (!inven_carry_okay(j_ptr))
4620 msg_print(_("そんなにアイテムを持てない。", "You cannot carry that many different items."));
4624 /* Determine the "best" price (per item) */
4625 best = price_item(j_ptr, ot_ptr->min_inflate, FALSE);
4627 /* Find out how many the player wants */
4628 if (o_ptr->number > 1)
4630 /* Hack -- note cost of "fixed" items */
4631 if ((cur_store_num != STORE_HOME) &&
4632 (o_ptr->ident & IDENT_FIXED))
4634 msg_format(_("一つにつき $%ldです。", "That costs %ld gold per item."), (long)(best));
4636 amt = get_quantity(NULL, o_ptr->number);
4637 if (amt <= 0) return;
4641 /* Get desired object */
4642 object_copy(j_ptr, o_ptr);
4645 * If a rod or wand, allocate total maximum timeouts or charges
4646 * between those purchased and left on the shelf.
4648 reduce_charges(j_ptr, o_ptr->number - amt);
4650 /* Modify quantity */
4651 j_ptr->number = amt;
4653 /* Hack -- require room in pack */
4654 if (!inven_carry_okay(j_ptr))
4656 msg_print(_("ザックにそのアイテムを入れる隙間がない。", "You cannot carry that many items."));
4660 /* Attempt to buy it */
4661 if (cur_store_num != STORE_HOME)
4663 /* Fixed price, quick buy */
4664 if (o_ptr->ident & (IDENT_FIXED))
4669 /* Go directly to the "best" deal */
4670 price = (best * j_ptr->number);
4676 /* Describe the object (fully) */
4677 object_desc(o_name, j_ptr, 0);
4678 msg_format(_("%s(%c)を購入する。", "Buying %s (%c)."), o_name, I2A(item));
4681 /* Haggle for a final price */
4682 choice = purchase_haggle(j_ptr, &price);
4684 /* Hack -- Got kicked out */
4685 if (st_ptr->store_open >= current_world_ptr->game_turn) return;
4688 /* Player wants it */
4691 /* Fix the item price (if "correctly" haggled) */
4692 if (price == (best * j_ptr->number)) o_ptr->ident |= (IDENT_FIXED);
4694 /* Player can afford it */
4695 if (p_ptr->au >= price)
4700 if (cur_store_num == STORE_BLACK) /* The black market is illegal! */
4701 chg_virtue(V_JUSTICE, -1);
4702 if((o_ptr->tval == TV_BOTTLE) && (cur_store_num != STORE_HOME))
4703 chg_virtue(V_NATURE, -1);
4711 /* Spend the money */
4714 /* Update the display */
4717 /* Hack -- buying an item makes you aware of it */
4718 object_aware(j_ptr);
4720 /* Hack -- clear the "fixed" flag from the item */
4721 j_ptr->ident &= ~(IDENT_FIXED);
4723 /* Describe the transaction */
4724 object_desc(o_name, j_ptr, 0);
4726 msg_format(_("%sを $%ldで購入しました。", "You bought %s for %ld gold."), o_name, (long)price);
4728 strcpy(record_o_name, o_name);
4729 record_turn = current_world_ptr->game_turn;
4731 if (record_buy) do_cmd_write_nikki(NIKKI_BUY, 0, o_name);
4732 object_desc(o_name, o_ptr, OD_NAME_ONLY);
4733 if(record_rand_art && o_ptr->art_name)
4734 do_cmd_write_nikki(NIKKI_ART, 0, o_name);
4736 /* Erase the inscription */
4737 j_ptr->inscription = 0;
4739 /* Erase the "feeling" */
4740 j_ptr->feeling = FEEL_NONE;
4741 j_ptr->ident &= ~(IDENT_STORE);
4742 /* Give it to the player */
4743 item_new = inven_carry(j_ptr);
4745 /* Describe the final result */
4746 object_desc(o_name, &inventory[item_new], 0);
4747 msg_format(_("%s(%c)を手に入れた。", "You have %s (%c)."), o_name, index_to_label(item_new));
4749 /* Auto-inscription */
4750 autopick_alter_item(item_new, FALSE);
4752 /* Now, reduce the original stack's pval. */
4753 if ((o_ptr->tval == TV_ROD) || (o_ptr->tval == TV_WAND))
4755 o_ptr->pval -= j_ptr->pval;
4759 /* Note how many slots the store used to have */
4760 i = st_ptr->stock_num;
4762 /* Remove the bought items from the store */
4763 store_item_increase(item, -amt);
4764 store_item_optimize(item);
4766 /* Store is empty */
4767 if (st_ptr->stock_num == 0)
4770 if (one_in_(STORE_SHUFFLE))
4773 msg_print(_("店主は引退した。", "The shopkeeper retires."));
4775 /* Shuffle the store */
4776 store_shuffle(cur_store_num);
4779 sprintf(buf, "%s (%s)",
4780 ot_ptr->owner_name, race_info[ot_ptr->owner_race].title);
4781 put_str(buf, 3, 10);
4782 sprintf(buf, "%s (%ld)",
4783 (f_name + f_info[cur_store_feat].name), (long)(ot_ptr->max_cost));
4790 msg_print(_("店主は新たな在庫を取り出した。", "The shopkeeper brings out some new stock."));
4794 for (i = 0; i < 10; i++)
4796 /* Maintain the store */
4797 store_maint(p_ptr->town_num, cur_store_num);
4802 display_inventory();
4805 /* The item is gone */
4806 else if (st_ptr->stock_num != i)
4808 /* Pick the correct screen */
4809 if (store_top >= st_ptr->stock_num) store_top -= store_bottom;
4810 display_inventory();
4813 /* Item is still here */
4816 /* Redraw the item */
4817 display_entry(item);
4821 /* Player cannot afford it */
4824 /* Simple message (no insult) */
4825 msg_print(_("お金が足りません。", "You do not have enough gold."));
4830 /* Home is much easier */
4833 bool combined_or_reordered;
4835 /* Distribute charges of wands/rods */
4836 distribute_charges(o_ptr, j_ptr, amt);
4838 /* Give it to the player */
4839 item_new = inven_carry(j_ptr);
4841 /* Describe just the result */
4842 object_desc(o_name, &inventory[item_new], 0);
4844 msg_format(_("%s(%c)を取った。", "You have %s (%c)."), o_name, index_to_label(item_new));
4847 /* Take note if we take the last one */
4848 i = st_ptr->stock_num;
4850 /* Remove the items from the home */
4851 store_item_increase(item, -amt);
4852 store_item_optimize(item);
4854 combined_or_reordered = combine_and_reorder_home(STORE_HOME);
4856 /* Hack -- Item is still here */
4857 if (i == st_ptr->stock_num)
4859 if (combined_or_reordered) display_inventory();
4861 /* Redraw the item */
4862 else display_entry(item);
4865 /* The item is gone */
4869 if (st_ptr->stock_num == 0) store_top = 0;
4871 /* Nothing left on that screen */
4872 else if (store_top >= st_ptr->stock_num) store_top -= store_bottom;
4873 display_inventory();
4875 chg_virtue(V_SACRIFICE, 1);
4879 /* Not kicked out */
4885 * @brief 店からの売却処理のメインルーチン /
4886 * Sell an item to the store (or home)
4889 static void store_sell(void)
4896 PRICE price, value, dummy;
4904 GAME_TEXT o_name[MAX_NLEN];
4907 /* Prepare a prompt */
4908 if (cur_store_num == STORE_HOME)
4909 q = _("どのアイテムを置きますか? ", "Drop which item? ");
4911 else if (cur_store_num == STORE_MUSEUM)
4912 q = _("どのアイテムを寄贈しますか? ", "Give which item? ");
4915 q = _("どのアイテムを売りますか? ", "Sell which item? ");
4917 /* Only allow items the store will buy */
4918 item_tester_hook = store_will_buy;
4920 /* 我が家でおかしなメッセージが出るオリジナルのバグを修正 */
4921 if (cur_store_num == STORE_HOME)
4923 s = _("置けるアイテムを持っていません。", "You don't have any item to drop.");
4925 else if (cur_store_num == STORE_MUSEUM)
4927 s = _("寄贈できるアイテムを持っていません。", "You don't have any item to give.");
4931 s = _("欲しい物がないですねえ。", "You have nothing that I want.");
4934 o_ptr = choose_object(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT));
4937 /* Hack -- Cannot remove cursed items */
4938 if ((item >= INVEN_RARM) && object_is_cursed(o_ptr))
4940 msg_print(_("ふーむ、どうやらそれは呪われているようだね。", "Hmmm, it seems to be cursed."));
4944 /* Assume one item */
4947 if (o_ptr->number > 1)
4949 amt = get_quantity(NULL, o_ptr->number);
4950 if (amt <= 0) return;
4954 /* Get a copy of the object */
4955 object_copy(q_ptr, o_ptr);
4957 /* Modify quantity */
4958 q_ptr->number = amt;
4961 * Hack -- If a rod or wand, allocate total maximum
4962 * timeouts or charges to those being sold. -LM-
4964 if ((o_ptr->tval == TV_ROD) || (o_ptr->tval == TV_WAND))
4966 q_ptr->pval = o_ptr->pval * amt / o_ptr->number;
4969 /* Get a full description */
4970 object_desc(o_name, q_ptr, 0);
4972 /* Remove any inscription, feeling for stores */
4973 if ((cur_store_num != STORE_HOME) && (cur_store_num != STORE_MUSEUM))
4975 q_ptr->inscription = 0;
4976 q_ptr->feeling = FEEL_NONE;
4979 /* Is there room in the store (or the home?) */
4980 if (!store_check_num(q_ptr))
4982 if (cur_store_num == STORE_HOME)
4983 msg_print(_("我が家にはもう置く場所がない。", "Your home is full."));
4985 else if (cur_store_num == STORE_MUSEUM)
4986 msg_print(_("博物館はもう満杯だ。", "Museum is full."));
4989 msg_print(_("すいませんが、店にはもう置く場所がありません。", "I have not the room in my store to keep it."));
4996 if ((cur_store_num != STORE_HOME) && (cur_store_num != STORE_MUSEUM))
4998 /* Describe the transaction */
4999 msg_format(_("%s(%c)を売却する。", "Selling %s (%c)."), o_name, index_to_label(item));
5004 choice = sell_haggle(q_ptr, &price);
5007 if (st_ptr->store_open >= current_world_ptr->game_turn) return;
5019 if (cur_store_num == STORE_BLACK) /* The black market is illegal! */
5020 chg_virtue(V_JUSTICE, -1);
5022 if((o_ptr->tval == TV_BOTTLE) && (cur_store_num != STORE_HOME))
5023 chg_virtue(V_NATURE, 1);
5026 /* Get some money */
5029 /* Update the display */
5032 /* Get the "apparent" value */
5033 dummy = object_value(q_ptr) * q_ptr->number;
5035 identify_item(o_ptr);
5038 /* Get a copy of the object */
5039 object_copy(q_ptr, o_ptr);
5041 /* Modify quantity */
5042 q_ptr->number = amt;
5044 /* Make it look like to be known */
5045 q_ptr->ident |= IDENT_STORE;
5048 * Hack -- If a rod or wand, let the shopkeeper know just
5049 * how many charges he really paid for. -LM-
5051 if ((o_ptr->tval == TV_ROD) || (o_ptr->tval == TV_WAND))
5053 q_ptr->pval = o_ptr->pval * amt / o_ptr->number;
5056 /* Get the "actual" value */
5057 value = object_value(q_ptr) * q_ptr->number;
5059 /* Get the description all over again */
5060 object_desc(o_name, q_ptr, 0);
5062 /* Describe the result (in message buffer) */
5063 msg_format(_("%sを $%ldで売却しました。", "You sold %s for %ld gold."), o_name, (long)price);
5065 if (record_sell) do_cmd_write_nikki(NIKKI_SELL, 0, o_name);
5067 if (!((o_ptr->tval == TV_FIGURINE) && (value > 0)))
5069 /* Analyze the prices (and comment verbally) unless a figurine*/
5070 purchase_analyze(price, value, dummy);
5074 * Hack -- Allocate charges between those wands or rods sold
5075 * and retained, unless all are being sold. -LM-
5077 distribute_charges(o_ptr, q_ptr, amt);
5079 /* Reset timeouts of the sold items */
5082 /* Take the item from the player, describe the result */
5083 inven_item_increase(item, -amt);
5084 inven_item_describe(item);
5086 /* If items remain, auto-inscribe before optimizing */
5087 if (o_ptr->number > 0)
5088 autopick_alter_item(item, FALSE);
5090 inven_item_optimize(item);
5093 /* The store gets that (known) item */
5094 item_pos = store_carry(q_ptr);
5096 /* Re-display if item is now in store */
5099 store_top = (item_pos / store_bottom) * store_bottom;
5100 display_inventory();
5105 /* Player is at museum */
5106 else if (cur_store_num == STORE_MUSEUM)
5108 char o2_name[MAX_NLEN];
5109 object_desc(o2_name, q_ptr, OD_NAME_ONLY);
5111 if (-1 == store_check_num(q_ptr))
5113 msg_print(_("それと同じ品物は既に博物館にあるようです。", "The same object as it is already in the Museum."));
5117 msg_print(_("博物館に寄贈したものは取り出すことができません!!", "You cannot take items which is given to the Museum back!!"));
5120 if (!get_check(format(_("本当に%sを寄贈しますか?", "Really give %s to the Museum? "), o2_name))) return;
5122 identify_item(q_ptr);
5123 q_ptr->ident |= IDENT_MENTAL;
5125 /* Distribute charges of wands/rods */
5126 distribute_charges(o_ptr, q_ptr, amt);
5127 msg_format(_("%sを置いた。(%c)", "You drop %s (%c)."), o_name, index_to_label(item));
5130 /* Take it from the players inventory */
5131 inven_item_increase(item, -amt);
5132 inven_item_describe(item);
5133 inven_item_optimize(item);
5136 /* Let the home carry it */
5137 item_pos = home_carry(q_ptr);
5139 /* Update store display */
5142 store_top = (item_pos / store_bottom) * store_bottom;
5143 display_inventory();
5146 /* Player is at home */
5149 /* Distribute charges of wands/rods */
5150 distribute_charges(o_ptr, q_ptr, amt);
5151 msg_format(_("%sを置いた。(%c)", "You drop %s (%c)."), o_name, index_to_label(item));
5155 /* Take it from the players inventory */
5156 inven_item_increase(item, -amt);
5157 inven_item_describe(item);
5158 inven_item_optimize(item);
5161 /* Let the home carry it */
5162 item_pos = home_carry(q_ptr);
5164 /* Update store display */
5167 store_top = (item_pos / store_bottom) * store_bottom;
5168 display_inventory();
5172 if ((choice == 0) && (item >= INVEN_RARM))
5181 * @brief 店のアイテムを調べるコマンドのメインルーチン /
5182 * Examine an item in a store -JDL-
5185 static void store_examine(void)
5190 GAME_TEXT o_name[MAX_NLEN];
5194 if (st_ptr->stock_num <= 0)
5196 if (cur_store_num == STORE_HOME)
5197 msg_print(_("我が家には何も置いてありません。", "Your home is empty."));
5198 else if (cur_store_num == STORE_MUSEUM)
5199 msg_print(_("博物館には何も置いてありません。", "Museum is empty."));
5201 msg_print(_("現在商品の在庫を切らしています。", "I am currently out of stock."));
5205 /* Find the number of objects on this and following pages */
5206 i = (st_ptr->stock_num - store_top);
5208 /* And then restrict it to the current page */
5209 if (i > store_bottom) i = store_bottom;
5212 sprintf(out_val, _("どれを調べますか?", "Which item do you want to examine? "));
5214 /* Get the item number to be examined */
5215 if (!get_stock(&item, out_val, 0, i - 1)) return;
5217 /* Get the actual index */
5218 item = item + store_top;
5220 /* Get the actual item */
5221 o_ptr = &st_ptr->stock[item];
5223 /* Require full knowledge */
5224 if (!(o_ptr->ident & IDENT_MENTAL))
5226 /* This can only happen in the home */
5227 msg_print(_("このアイテムについて特に知っていることはない。", "You have no special knowledge about that item."));
5231 object_desc(o_name, o_ptr, 0);
5232 msg_format(_("%sを調べている...", "Examining %s..."), o_name);
5234 if (!screen_object(o_ptr, SCROBJ_FORCE_DETAIL))
5235 msg_print(_("特に変わったところはないようだ。", "You see nothing special."));
5242 * @brief 博物館のアイテムを除去するコマンドのメインルーチン /
5243 * Remove an item from museum (Originally from TOband)
5246 static void museum_remove_object(void)
5251 GAME_TEXT o_name[MAX_NLEN];
5255 if (st_ptr->stock_num <= 0)
5257 msg_print(_("博物館には何も置いてありません。", "Museum is empty."));
5261 /* Find the number of objects on this and following pages */
5262 i = st_ptr->stock_num - store_top;
5264 /* And then restrict it to the current page */
5265 if (i > store_bottom) i = store_bottom;
5268 sprintf(out_val, _("どのアイテムの展示をやめさせますか?", "Which item do you want to order to remove? "));
5270 /* Get the item number to be removed */
5271 if (!get_stock(&item, out_val, 0, i - 1)) return;
5273 /* Get the actual index */
5274 item = item + store_top;
5276 /* Get the actual item */
5277 o_ptr = &st_ptr->stock[item];
5279 object_desc(o_name, o_ptr, 0);
5281 msg_print(_("展示をやめさせたアイテムは二度と見ることはできません!", "You cannot see items which is removed from the Museum!"));
5282 if (!get_check(format(_("本当に%sの展示をやめさせますか?", "Really order to remove %s from the Museum? "), o_name))) return;
5284 msg_format(_("%sの展示をやめさせた。", "You ordered to remove %s."), o_name);
5286 /* Remove the items from the home */
5287 store_item_increase(item, -o_ptr->number);
5288 store_item_optimize(item);
5290 (void)combine_and_reorder_home(STORE_MUSEUM);
5292 /* The item is gone */
5295 if (st_ptr->stock_num == 0) store_top = 0;
5297 /* Nothing left on that screen */
5298 else if (store_top >= st_ptr->stock_num) store_top -= store_bottom;
5299 display_inventory();
5306 * Hack -- set this to leave the store
5308 static bool leave_store = FALSE;
5312 * @brief 店舗処理コマンド選択のメインルーチン /
5313 * Process a command in a store
5317 * Note that we must allow the use of a few "special" commands
5318 * in the stores which are not allowed in the dungeon, and we
5319 * must disable some commands which are allowed in the dungeon
5320 * but not in the stores, to prevent chaos.
5323 static void store_process_command(void)
5325 /* Handle repeating the last command */
5328 if (rogue_like_commands && command_cmd == 'l')
5330 command_cmd = 'x'; /* hack! */
5333 /* Parse the command */
5334 switch (command_cmd)
5344 /* 1 ページ戻るコマンド: 我が家のページ数が多いので重宝するはず By BUG */
5347 if (st_ptr->stock_num <= store_bottom) {
5348 msg_print(_("これで全部です。", "Entire inventory is shown."));
5351 store_top -= store_bottom;
5352 if ( store_top < 0 )
5353 store_top = ((st_ptr->stock_num - 1 )/store_bottom) * store_bottom;
5354 if ( (cur_store_num == STORE_HOME) && (powerup_home == FALSE) )
5355 if ( store_top >= store_bottom ) store_top = store_bottom;
5356 display_inventory();
5364 if (st_ptr->stock_num <= store_bottom)
5366 msg_print(_("これで全部です。", "Entire inventory is shown."));
5370 store_top += store_bottom;
5372 * 隠しオプション(powerup_home)がセットされていないときは
5373 * 我が家では 2 ページまでしか表示しない
5375 if ((cur_store_num == STORE_HOME) &&
5376 (powerup_home == FALSE) &&
5377 (st_ptr->stock_num >= STORE_INVEN_MAX))
5379 if (store_top >= (STORE_INVEN_MAX - 1))
5386 if (store_top >= st_ptr->stock_num) store_top = 0;
5389 display_inventory();
5401 /* Get (purchase) */
5428 /*** Inventory Commands ***/
5430 /* Wear/wield equipment */
5437 /* Take off equipment */
5444 /* Destroy an item */
5451 /* Equipment list */
5458 /* Inventory list */
5466 /*** Various commands ***/
5468 /* Identify an object */
5475 /* Hack -- toggle windows */
5478 toggle_inven_equip();
5482 /*** Use various objects ***/
5487 if ( (p_ptr->pclass == CLASS_MINDCRAFTER) ||
5488 (p_ptr->pclass == CLASS_BERSERKER) ||
5489 (p_ptr->pclass == CLASS_NINJA) ||
5490 (p_ptr->pclass == CLASS_MIRROR_MASTER)
5491 ) do_cmd_mind_browse();
5492 else if (p_ptr->pclass == CLASS_SMITH)
5494 else if (p_ptr->pclass == CLASS_MAGIC_EATER)
5495 do_cmd_magic_eater(TRUE, FALSE);
5496 else if (p_ptr->pclass == CLASS_SNIPER)
5497 do_cmd_snipe_browse();
5498 else do_cmd_browse();
5502 /* Inscribe an object */
5509 /* Uninscribe an object */
5512 do_cmd_uninscribe();
5518 /*** Help and Such ***/
5527 /* Identify symbol */
5530 do_cmd_query_symbol();
5534 /* Character description */
5537 p_ptr->town_num = old_town_num;
5538 do_cmd_change_name();
5539 p_ptr->town_num = inner_town_num;
5545 /*** System Commands ***/
5547 /* Hack -- User interface */
5554 /* Single line from a pref file */
5557 p_ptr->town_num = old_town_num;
5559 p_ptr->town_num = inner_town_num;
5563 /* Interact with macros */
5566 p_ptr->town_num = old_town_num;
5568 p_ptr->town_num = inner_town_num;
5572 /* Interact with visuals */
5575 p_ptr->town_num = old_town_num;
5577 p_ptr->town_num = inner_town_num;
5581 /* Interact with colors */
5584 p_ptr->town_num = old_town_num;
5586 p_ptr->town_num = inner_town_num;
5590 /* Interact with options */
5594 (void)combine_and_reorder_home(STORE_HOME);
5600 /*** Misc Commands ***/
5616 /* Repeat level feeling */
5623 /* Show previous message */
5626 do_cmd_message_one();
5630 /* Show previous messages */
5643 /* Check artifacts, uniques etc. */
5650 /* Load "screen dump" */
5653 do_cmd_load_screen();
5657 /* Save "screen dump" */
5660 do_cmd_save_screen();
5664 /* Hack -- Unknown command */
5667 if ((cur_store_num == STORE_MUSEUM) && (command_cmd == 'r'))
5669 museum_remove_object();
5673 msg_print(_("そのコマンドは店の中では使えません。", "That command does not work in stores."));
5682 * @brief 店舗処理全体のメインルーチン /
5683 * Enter a store, and interact with it. *
5687 * Note that we use the standard "request_command()" function
5688 * to get a command, allowing us to use "command_arg" and all
5689 * command macros and other nifty stuff, but we use the special
5690 * "shopping" argument, to force certain commands to be converted
5691 * into other commands, normally, we convert "p" (pray) and "m"
5692 * (cast magic) into "g" (get), and "s" (search) into "d" (drop).
5695 void do_cmd_store(void)
5701 bool need_redraw_store_inv; /* To redraw missiles damage and prices in store */
5704 if(p_ptr->wild_mode) return;
5705 Term_get_size(&w, &h);
5707 /* Calculate stocks per 1 page */
5708 xtra_stock = MIN(14+26, ((h > 24) ? (h - 24) : 0));
5709 store_bottom = MIN_STOCK + xtra_stock;
5711 /* Access the player grid */
5712 g_ptr = ¤t_floor_ptr->grid_array[p_ptr->y][p_ptr->x];
5714 /* Verify a store */
5715 if (!cave_have_flag_grid(g_ptr, FF_STORE))
5717 msg_print(_("ここには店がありません。", "You see no store here."));
5721 /* Extract the store code */
5722 which = f_info[g_ptr->feat].subtype;
5724 old_town_num = p_ptr->town_num;
5725 if ((which == STORE_HOME) || (which == STORE_MUSEUM)) p_ptr->town_num = 1;
5726 if (current_floor_ptr->dun_level) p_ptr->town_num = NO_TOWN;
5727 inner_town_num = p_ptr->town_num;
5729 /* Hack -- Check the "locked doors" */
5730 if ((town_info[p_ptr->town_num].store[which].store_open >= current_world_ptr->game_turn) ||
5733 msg_print(_("ドアに鍵がかかっている。", "The doors are locked."));
5734 p_ptr->town_num = old_town_num;
5738 /* Calculate the number of store maintainances since the last visit */
5739 maintain_num = (current_world_ptr->game_turn - town_info[p_ptr->town_num].store[which].last_visit) / (TURNS_PER_TICK * STORE_TICKS);
5741 /* Maintain the store max. 10 times */
5742 if (maintain_num > 10) maintain_num = 10;
5746 /* Maintain the store */
5747 for (i = 0; i < maintain_num; i++)
5748 store_maint(p_ptr->town_num, which);
5750 /* Save the visit */
5751 town_info[p_ptr->town_num].store[which].last_visit = current_world_ptr->game_turn;
5757 /* Hack -- Character is in "icky" mode */
5758 character_icky = TRUE;
5765 /* Do not expand macros */
5766 get_com_no_macros = TRUE;
5768 /* Save the store number */
5769 cur_store_num = which;
5771 /* Hack -- save the store feature */
5772 cur_store_feat = g_ptr->feat;
5774 /* Save the store and owner pointers */
5775 st_ptr = &town_info[p_ptr->town_num].store[cur_store_num];
5776 ot_ptr = &owners[cur_store_num][st_ptr->owner];
5778 /* Start at the beginning */
5781 play_music(TERM_XTRA_MUSIC_BASIC, MUSIC_BASIC_BUILD);
5786 leave_store = FALSE;
5788 /* Interact with player */
5789 while (!leave_store)
5791 /* Hack -- Clear line 1 */
5795 clear_from(20 + xtra_stock);
5797 /* Basic commands */
5798 prt(_(" ESC) 建物から出る", " ESC) Exit from Building."), 21 + xtra_stock, 0);
5800 /* Browse if necessary */
5801 if (st_ptr->stock_num > store_bottom)
5803 prt(_(" -)前ページ", " -) Previous page"), 22 + xtra_stock, 0);
5804 prt(_(" スペース) 次ページ", " SPACE) Next page"), 23 + xtra_stock, 0);
5808 if (cur_store_num == STORE_HOME)
5810 prt(_("g) アイテムを取る", "g) Get an item."), 21 + xtra_stock, 27);
5811 prt(_("d) アイテムを置く", "d) Drop an item."), 22 + xtra_stock, 27);
5812 prt(_("x) 家のアイテムを調べる", "x) eXamine an item in the home."), 23 + xtra_stock, 27);
5815 /* Museum commands */
5816 else if (cur_store_num == STORE_MUSEUM)
5818 prt(_("d) アイテムを置く", "d) Drop an item."), 21 + xtra_stock, 27);
5819 prt(_("r) アイテムの展示をやめる", "r) order to Remove an item."), 22 + xtra_stock, 27);
5820 prt(_("x) 博物館のアイテムを調べる", "x) eXamine an item in the museum."), 23 + xtra_stock, 27);
5826 prt(_("p) 商品を買う", "p) Purchase an item."), 21 + xtra_stock, 30);
5827 prt(_("s) アイテムを売る", "s) Sell an item."), 22 + xtra_stock, 30);
5828 prt(_("x) 商品を調べる", "x) eXamine an item in the shop"), 23 + xtra_stock,30);
5832 prt(_("i/e) 持ち物/装備の一覧", "i/e) Inventry/Equipment list"), 21 + xtra_stock, 56);
5834 if (rogue_like_commands)
5836 prt(_("w/T) 装備する/はずす", "w/T) Wear/Take off equipment"), 22 + xtra_stock, 56);
5840 prt(_("w/t) 装備する/はずす", "w/t) Wear/Take off equipment"), 22 + xtra_stock, 56);
5844 prt(_("コマンド:", "You may: "), 20 + xtra_stock, 0);
5846 request_command(TRUE);
5848 /* Process the command */
5849 store_process_command();
5852 * Hack -- To redraw missiles damage and prices in store
5853 * If player's charisma changes, or if player changes a bow, PU_BONUS is set
5855 need_redraw_store_inv = (p_ptr->update & PU_BONUS) ? TRUE : FALSE;
5857 /* Hack -- Character is still in "icky" mode */
5858 character_icky = TRUE;
5863 if (inventory[INVEN_PACK].k_idx)
5865 INVENTORY_IDX item = INVEN_PACK;
5867 object_type *o_ptr = &inventory[item];
5869 /* Hack -- Flee from the store */
5870 if (cur_store_num != STORE_HOME)
5872 if (cur_store_num == STORE_MUSEUM)
5873 msg_print(_("ザックからアイテムがあふれそうなので、あわてて博物館から出た...", "Your pack is so full that you flee the Museum..."));
5875 msg_print(_("ザックからアイテムがあふれそうなので、あわてて店から出た...", "Your pack is so full that you flee the store..."));
5881 /* Hack -- Flee from the home */
5882 else if (!store_check_num(o_ptr))
5884 msg_print(_("ザックからアイテムがあふれそうなので、あわてて家から出た...", "Your pack is so full that you flee your home..."));
5889 /* Hack -- Drop items into the home */
5897 GAME_TEXT o_name[MAX_NLEN];
5899 /* Give a message */
5900 msg_print(_("ザックからアイテムがあふれてしまった!", "Your pack overflows!"));
5904 object_copy(q_ptr, o_ptr);
5905 object_desc(o_name, q_ptr, 0);
5907 msg_format(_("%sが落ちた。(%c)", "You drop %s (%c)."), o_name, index_to_label(item));
5909 /* Remove it from the players inventory */
5910 inven_item_increase(item, -255);
5911 inven_item_describe(item);
5912 inven_item_optimize(item);
5915 /* Let the home carry it */
5916 item_pos = home_carry(q_ptr);
5918 /* Redraw the home */
5921 store_top = (item_pos / store_bottom) * store_bottom;
5922 display_inventory();
5927 /* Hack -- Redisplay store prices if charisma changes */
5928 /* Hack -- Redraw missiles damage if player changes bow */
5929 if (need_redraw_store_inv) display_inventory();
5931 /* Hack -- get kicked out of the store */
5932 if (st_ptr->store_open >= current_world_ptr->game_turn) leave_store = TRUE;
5935 select_floor_music();
5937 p_ptr->town_num = old_town_num;
5939 take_turn(p_ptr, 100);
5941 /* Hack -- Character is no longer in "icky" mode */
5942 character_icky = FALSE;
5944 /* Hack -- Cancel automatic command */
5947 /* Hack -- Cancel "see" mode */
5948 command_see = FALSE;
5950 /* Allow expanding macros */
5951 get_com_no_macros = FALSE;
5956 /* Update everything */
5957 p_ptr->update |= (PU_VIEW | PU_LITE | PU_MON_LITE);
5958 p_ptr->update |= (PU_MONSTERS);
5960 /* Redraw entire screen */
5961 p_ptr->redraw |= (PR_BASIC | PR_EXTRA | PR_EQUIPPY);
5962 p_ptr->redraw |= (PR_MAP);
5963 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
5969 * @brief 現在の町の店主を交代させる /
5970 * Shuffle one of the stores.
5971 * @param which 店舗種類のID
5974 void store_shuffle(int which)
5980 if (which == STORE_HOME) return;
5981 if (which == STORE_MUSEUM) return;
5984 /* Save the store index */
5985 cur_store_num = which;
5987 /* Activate that store */
5988 st_ptr = &town_info[p_ptr->town_num].store[cur_store_num];
5991 /* Pick a new owner */
5994 st_ptr->owner = (byte)randint0(MAX_OWNERS);
5995 if (j == st_ptr->owner) continue;
5996 for (i = 1;i < max_towns; i++)
5998 if (i == p_ptr->town_num) continue;
5999 if (st_ptr->owner == town_info[i].store[cur_store_num].owner) break;
6001 if (i == max_towns) break;
6004 /* Activate the new owner */
6005 ot_ptr = &owners[cur_store_num][st_ptr->owner];
6008 /* Reset the owner data */
6009 st_ptr->insult_cur = 0;
6010 st_ptr->store_open = 0;
6011 st_ptr->good_buy = 0;
6012 st_ptr->bad_buy = 0;
6015 /* Hack -- discount all the items */
6016 for (i = 0; i < st_ptr->stock_num; i++)
6020 o_ptr = &st_ptr->stock[i];
6022 if (!object_is_artifact(o_ptr))
6024 /* Hack -- Sell all non-artifact old items for "half price" */
6025 o_ptr->discount = 50;
6027 /* Hack -- Items are no longer "fixed price" */
6028 o_ptr->ident &= ~(IDENT_FIXED);
6030 /* Mega-Hack -- Note that the item is "on sale" */
6031 o_ptr->inscription = quark_add(_("売出中", "on sale"));
6038 * @brief 店の品揃えを変化させる /
6039 * Maintain the inventory at the stores.
6040 * @param town_num 町のID
6041 * @param store_num 店舗種類のID
6044 void store_maint(int town_num, int store_num)
6048 cur_store_num = store_num;
6051 if (store_num == STORE_HOME) return;
6052 if (store_num == STORE_MUSEUM) return;
6054 /* Activate that store */
6055 st_ptr = &town_info[town_num].store[store_num];
6057 /* Activate the owner */
6058 ot_ptr = &owners[store_num][st_ptr->owner];
6060 /* Store keeper forgives the player */
6061 st_ptr->insult_cur = 0;
6063 /* Mega-Hack -- prune the black market */
6064 if (store_num == STORE_BLACK)
6066 /* Destroy crappy black market items */
6067 for (j = st_ptr->stock_num - 1; j >= 0; j--)
6069 object_type *o_ptr = &st_ptr->stock[j];
6071 /* Destroy crappy items */
6072 if (black_market_crap(o_ptr))
6074 /* Destroy the item */
6075 store_item_increase(j, 0 - o_ptr->number);
6076 store_item_optimize(j);
6082 /* Choose the number of slots to keep */
6083 j = st_ptr->stock_num;
6085 /* Sell a few items */
6086 j = j - randint1(STORE_TURNOVER);
6088 /* Never keep more than "STORE_MAX_KEEP" slots */
6089 if (j > STORE_MAX_KEEP) j = STORE_MAX_KEEP;
6091 /* Always "keep" at least "STORE_MIN_KEEP" items */
6092 if (j < STORE_MIN_KEEP) j = STORE_MIN_KEEP;
6094 /* Hack -- prevent "underflow" */
6097 /* Destroy objects until only "j" slots are left */
6098 while (st_ptr->stock_num > j) store_delete();
6101 /* Choose the number of slots to fill */
6102 j = st_ptr->stock_num;
6104 /* Buy some more items */
6105 j = j + randint1(STORE_TURNOVER);
6107 /* Never keep more than "STORE_MAX_KEEP" slots */
6108 if (j > STORE_MAX_KEEP) j = STORE_MAX_KEEP;
6110 /* Always "keep" at least "STORE_MIN_KEEP" items */
6111 if (j < STORE_MIN_KEEP) j = STORE_MIN_KEEP;
6113 /* Hack -- prevent "overflow" */
6114 if (j >= st_ptr->stock_size) j = st_ptr->stock_size - 1;
6116 /* Acquire some new items */
6117 while (st_ptr->stock_num < j) store_create();
6122 * @brief 店舗情報を初期化する /
6123 * Initialize the stores
6124 * @param town_num 町のID
6125 * @param store_num 店舗種類のID
6128 void store_init(int town_num, int store_num)
6131 cur_store_num = store_num;
6133 /* Activate that store */
6134 st_ptr = &town_info[town_num].store[store_num];
6142 st_ptr->owner = (byte)randint0(MAX_OWNERS);
6143 for (i = 1;i < max_towns; i++)
6145 if (i == town_num) continue;
6146 if (st_ptr->owner == town_info[i].store[store_num].owner) break;
6148 if (i == max_towns) break;
6151 /* Activate the new owner */
6152 ot_ptr = &owners[store_num][st_ptr->owner];
6155 /* Initialize the store */
6156 st_ptr->store_open = 0;
6157 st_ptr->insult_cur = 0;
6158 st_ptr->good_buy = 0;
6159 st_ptr->bad_buy = 0;
6161 /* Nothing in stock */
6162 st_ptr->stock_num = 0;
6165 * MEGA-HACK - Last visit to store is
6166 * BEFORE player birth to enable store restocking
6168 st_ptr->last_visit = -10L * TURNS_PER_TICK * STORE_TICKS;
6170 /* Clear any old items */
6171 for (k = 0; k < st_ptr->stock_size; k++)
6173 object_wipe(&st_ptr->stock[k]);
6179 * @brief アイテムを町のブラックマーケットに移動させる /
6180 * @param o_ptr 移動させたいオブジェクトの構造体参照ポインタ
6183 void move_to_black_market(object_type *o_ptr)
6186 if (!p_ptr->town_num) return;
6188 st_ptr = &town_info[p_ptr->town_num].store[STORE_BLACK];
6190 o_ptr->ident |= IDENT_STORE;
6192 (void)store_carry(o_ptr);
6194 object_wipe(o_ptr); /* Don't leave a bogus object behind... */