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.
19 #include "cmd-basic.h"
22 #include "cmd-smith.h"
23 #include "cmd-zapwand.h"
24 #include "cmd-magiceat.h"
28 #include "cmd-spell.h"
30 #include "player-status.h"
31 #include "object-flavor.h"
32 #include "object-hook.h"
33 #include "floor-events.h"
36 #include "player-effects.h"
37 #include "player-race.h"
40 #include "objectkind.h"
42 #include "floor-town.h"
48 * @brief 闘技場のモンスターID及び報酬アイテムテーブル /
49 * Store owners (exactly four "possible" owners per store, chosen randomly)
52 * { name, purse, max greed, min greed, haggle_per, tolerance, race, unused }
54 * Lifted extra shopkeepers from CthAngband (don't you just love open source
55 * development? ;-)). Since this gave less than 32 unique names for some
56 * shops, those have their first x names copied to reach 32.
58 * For the weapon and armour shops, several owners have a limit of 5k.
60 * I want to do 50k owners, but the purse is currently s16b. Perhaps
61 * we should just store 1/10th of the purse?
64 const owner_type owners[MAX_STORES][MAX_OWNERS] =
67 /* General store - 32 unique names */
69 Raistlin は dragonlance の powerful wizard 。
70 Rincewind the Chicken は Terry Pratchett の Discworld の登場人物 上記のパロディ?、
71 { "憶病者ラストリン", 200, 175, 108, 4, 12, RACE_HUMAN},
72 { "Raistlin the Chicken", 200, 175, 108, 4, 12, RACE_HUMAN},
76 { "フレンドリーなビルボ", 200, 170, 108, 5, 15, RACE_HOBBIT},
77 { "憶病者リンスウィンド", 200, 175, 108, 4, 12, RACE_HUMAN},
78 { "背の低いサルタン", 300, 170, 107, 5, 15, RACE_GNOME},
79 { "ハンサムなライア=エル", 300, 165, 107, 6, 18, RACE_ELF},
80 { "親切なファリルマウエン", 250, 170, 108, 5, 15, RACE_HOBBIT},
81 { "臆病者ヴォワラン", 500, 175, 108, 4, 12, RACE_HUMAN},
82 { "チビのエラシュナク", 750, 170, 107, 5, 15, RACE_BEASTMAN},
83 { "ハンサムなグラッグ", 1000, 165, 107, 6, 18, RACE_HALF_TITAN},
84 { "ケチなフォロビア", 250, 170, 108, 5, 15, RACE_HUMAN},
85 { "馬鹿のエリス", 500, 175, 108, 4, 12, RACE_HUMAN},
86 { "腹ペコのフィルバート", 750, 170, 107, 5, 15, RACE_VAMPIRE},
87 { "スナーグル・サシグア", 1000, 165, 107, 6, 18, RACE_MIND_FLAYER},
88 { "長死きエロワーズ", 250, 170, 108, 5, 15, RACE_SPECTRE},
89 { "ノロマのフンディ", 500, 175, 108, 4, 12, RACE_ZOMBIE},
90 { "グランサス", 750, 170, 107, 5, 15, RACE_SKELETON},
91 { "丁寧なロラックス", 1000, 165, 107, 6, 18, RACE_VAMPIRE},
92 { "ブッチ", 250, 170, 108, 5, 15, RACE_HALF_ORC},
93 { "美しきエルベレス", 500, 175, 108, 4, 12, RACE_HIGH_ELF},
94 { "こそこそサーレス", 750, 170, 107, 5, 15, RACE_GNOME},
95 { "ナーロック", 1000, 165, 107, 6, 18, RACE_DWARF},
96 { "チビのヘイネッカ", 250, 170, 108, 5, 15, RACE_GNOME},
97 { "きちがいロワラン", 500, 175, 108, 4, 12, RACE_HALF_GIANT},
98 { "毒息のウート", 750, 170, 107, 5, 15, RACE_DRACONIAN},
99 { "でぶっちょアラァカ", 1000, 165, 107, 6, 18, RACE_DRACONIAN},
100 { "低能なプーゴー", 250, 170, 108, 5, 15, RACE_BEASTMAN},
101 { "フェロールフィリアン", 500, 175, 108, 4, 12, RACE_ELF},
102 { "年寄りマロカ", 750, 170, 107, 5, 15, RACE_GNOME},
103 { "勇敢なサシン", 1000, 165, 107, 6, 18, RACE_HALF_GIANT},
104 { "田舎者アビエマール", 250, 170, 108, 5, 15, RACE_HUMAN},
105 { "貧乏なハーク", 500, 175, 108, 4, 12, RACE_HALF_ORC},
106 { "みじめなソアリン", 750, 170, 107, 5, 15, RACE_ZOMBIE},
107 { "質素なメルラ", 1000, 165, 107, 6, 18, RACE_ELF},
109 { "Bilbo the Friendly", 200, 170, 108, 5, 15, RACE_HOBBIT},
110 { "Rincewind the Chicken", 200, 175, 108, 4, 12, RACE_HUMAN},
111 { "Sultan the Midget", 300, 170, 107, 5, 15, RACE_GNOME},
112 { "Lyar-el the Comely", 300, 165, 107, 6, 18, RACE_ELF},
113 { "Falilmawen the Friendly", 250, 170, 108, 5, 15, RACE_HOBBIT},
114 { "Voirin the Cowardly", 500, 175, 108, 4, 12, RACE_HUMAN},
115 { "Erashnak the Midget", 750, 170, 107, 5, 15, RACE_BEASTMAN},
116 { "Grug the Comely", 1000, 165, 107, 6, 18, RACE_HALF_TITAN},
117 { "Forovir the Cheap", 250, 170, 108, 5, 15, RACE_HUMAN},
118 { "Ellis the Fool", 500, 175, 108, 4, 12, RACE_HUMAN},
119 { "Filbert the Hungry", 750, 170, 107, 5, 15, RACE_VAMPIRE},
120 { "Fthnargl Psathiggua", 1000, 165, 107, 6, 18, RACE_MIND_FLAYER},
121 { "Eloise Long-Dead", 250, 170, 108, 5, 15, RACE_SPECTRE},
122 { "Fundi the Slow", 500, 175, 108, 4, 12, RACE_ZOMBIE},
123 { "Granthus", 750, 170, 107, 5, 15, RACE_SKELETON},
124 { "Lorax the Suave", 1000, 165, 107, 6, 18, RACE_VAMPIRE},
125 { "Butch", 250, 170, 108, 5, 15, RACE_HALF_ORC},
126 { "Elbereth the Beautiful", 500, 175, 108, 4, 12, RACE_HIGH_ELF},
127 { "Sarleth the Sneaky", 750, 170, 107, 5, 15, RACE_GNOME},
128 { "Narlock", 1000, 165, 107, 6, 18, RACE_DWARF},
129 { "Haneka the Small", 250, 170, 108, 5, 15, RACE_GNOME},
130 { "Loirin the Mad", 500, 175, 108, 4, 12, RACE_HALF_GIANT},
131 { "Wuto Poisonbreath", 750, 170, 107, 5, 15, RACE_DRACONIAN},
132 { "Araaka the Rotund", 1000, 165, 107, 6, 18, RACE_DRACONIAN},
133 { "Poogor the Dumb", 250, 170, 108, 5, 15, RACE_BEASTMAN},
134 { "Felorfiliand", 500, 175, 108, 4, 12, RACE_ELF},
135 { "Maroka the Aged", 750, 170, 107, 5, 15, RACE_GNOME},
136 { "Sasin the Bold", 1000, 165, 107, 6, 18, RACE_HALF_GIANT},
137 { "Abiemar the Peasant", 250, 170, 108, 5, 15, RACE_HUMAN},
138 { "Hurk the Poor", 500, 175, 108, 4, 12, RACE_HALF_ORC},
139 { "Soalin the Wretched", 750, 170, 107, 5, 15, RACE_ZOMBIE},
140 { "Merulla the Humble", 1000, 165, 107, 6, 18, RACE_ELF},
144 /* Armoury - 28 unique names */
146 { "醜悪コン=ダー", 5000, 210, 115, 5, 7, RACE_HALF_ORC},
147 { "頑固者ダーグ=ロウ", 10000, 190, 111, 4, 9, RACE_HUMAN},
148 { "賢者デカド", 25000, 200, 112, 4, 10, RACE_DUNADAN},
149 { "鍛冶屋のウィーランド", 30000, 200, 112, 4, 5, RACE_DWARF},
150 { "醜悪コン=ダー", 10000, 210, 115, 5, 7, RACE_HALF_ORC},
151 { "頑固者ダーグ=ロウ", 15000, 190, 111, 4, 9, RACE_HUMAN},
152 { "ハンサムなデカド", 25000, 200, 112, 4, 10, RACE_AMBERITE},
153 { "エロー・ドラゴンスケイル", 30000, 200, 112, 4, 5, RACE_ELF},
154 { "デリカトス", 10000, 210, 115, 5, 7, RACE_SPRITE},
155 { "巨大なグルース", 15000, 190, 111, 4, 9, RACE_HALF_GIANT},
156 { "アニムス", 25000, 200, 112, 4, 10, RACE_GOLEM},
157 { "マルヴァス", 30000, 200, 112, 4, 5, RACE_HALF_TITAN},
158 { "セラクシス", 10000, 210, 115, 5, 7, RACE_ZOMBIE},
159 { "デス・チル", 5000, 190, 111, 4, 9, RACE_SPECTRE},
160 { "微かなドリオス", 25000, 200, 112, 4, 10, RACE_SPECTRE},
161 { "冷たいバスリック", 30000, 200, 112, 4, 5, RACE_VAMPIRE},
162 { "冷酷ヴェンジェラ", 10000, 210, 115, 5, 7, RACE_HALF_TROLL},
163 { "強者ウィラナ", 15000, 190, 111, 4, 9, RACE_HUMAN},
164 { "ヨジョ二世", 25000, 200, 112, 4, 10, RACE_DWARF},
165 { "優しいラナラー", 30000, 200, 112, 4, 5, RACE_AMBERITE},
166 { "不浄のホルバグ", 5000, 210, 115, 5, 7, RACE_HALF_ORC},
167 { "テレパスのエレレン", 15000, 190, 111, 4, 9, RACE_DARK_ELF},
168 { "イスドリリアス", 25000, 200, 112, 4, 10, RACE_SPRITE},
169 { "一つ目ヴェグナー", 5000, 200, 112, 4, 5, RACE_CYCLOPS},
170 { "混沌のロディッシュ", 10000, 210, 115, 5, 7, RACE_BEASTMAN},
171 { "剣豪ヘジン", 15000, 190, 111, 4, 9, RACE_NIBELUNG},
172 { "ずる屋のエルベレリス", 10000, 200, 112, 4, 10, RACE_DARK_ELF},
173 { "インプのザサス", 30000, 200, 112, 4, 5, RACE_IMP},
174 { "醜悪コン=ダー", 5000, 210, 115, 5, 7, RACE_HALF_ORC},
175 { "頑固者ダーグ=ロウ", 10000, 190, 111, 4, 9, RACE_HUMAN},
176 { "ハンサムなデカド", 25000, 200, 112, 4, 10, RACE_AMBERITE},
177 { "鍛冶屋のウィーランド", 30000, 200, 112, 4, 5, RACE_DWARF},
179 { "Kon-Dar the Ugly", 5000, 210, 115, 5, 7, RACE_HALF_ORC},
180 { "Darg-Low the Grim", 10000, 190, 111, 4, 9, RACE_HUMAN},
181 { "Decado the Handsome", 25000, 200, 112, 4, 10, RACE_DUNADAN},
182 { "Wieland the Smith", 30000, 200, 112, 4, 5, RACE_DWARF},
183 { "Kon-Dar the Ugly", 10000, 210, 115, 5, 7, RACE_HALF_ORC},
184 { "Darg-Low the Grim", 15000, 190, 111, 4, 9, RACE_HUMAN},
185 { "Decado the Handsome", 25000, 200, 112, 4, 10, RACE_AMBERITE},
186 { "Elo Dragonscale", 30000, 200, 112, 4, 5, RACE_ELF},
187 { "Delicatus", 10000, 210, 115, 5, 7, RACE_SPRITE},
188 { "Gruce the Huge", 15000, 190, 111, 4, 9, RACE_HALF_GIANT},
189 { "Animus", 25000, 200, 112, 4, 10, RACE_GOLEM},
190 { "Malvus", 30000, 200, 112, 4, 5, RACE_HALF_TITAN},
191 { "Selaxis", 10000, 210, 115, 5, 7, RACE_ZOMBIE},
192 { "Deathchill", 5000, 190, 111, 4, 9, RACE_SPECTRE},
193 { "Drios the Faint", 25000, 200, 112, 4, 10, RACE_SPECTRE},
194 { "Bathric the Cold", 30000, 200, 112, 4, 5, RACE_VAMPIRE},
195 { "Vengella the Cruel", 10000, 210, 115, 5, 7, RACE_HALF_TROLL},
196 { "Wyrana the Mighty", 15000, 190, 111, 4, 9, RACE_HUMAN},
197 { "Yojo II", 25000, 200, 112, 4, 10, RACE_DWARF},
198 { "Ranalar the Sweet", 30000, 200, 112, 4, 5, RACE_AMBERITE},
199 { "Horbag the Unclean", 5000, 210, 115, 5, 7, RACE_HALF_ORC},
200 { "Elelen the Telepath", 15000, 190, 111, 4, 9, RACE_DARK_ELF},
201 { "Isedrelias", 25000, 200, 112, 4, 10, RACE_SPRITE},
202 { "Vegnar One-eye", 5000, 200, 112, 4, 5, RACE_CYCLOPS},
203 { "Rodish the Chaotic", 10000, 210, 115, 5, 7, RACE_BEASTMAN},
204 { "Hesin Swordmaster", 15000, 190, 111, 4, 9, RACE_NIBELUNG},
205 { "Elvererith the Cheat", 10000, 200, 112, 4, 10, RACE_DARK_ELF},
206 { "Zzathath the Imp", 30000, 200, 112, 4, 5, RACE_IMP},
207 { "Kon-Dar the Ugly", 5000, 210, 115, 5, 7, RACE_HALF_ORC},
208 { "Darg-Low the Grim", 10000, 190, 111, 4, 9, RACE_HUMAN},
209 { "Decado the Handsome", 25000, 200, 112, 4, 10, RACE_AMBERITE},
210 { "Wieland the Smith", 30000, 200, 112, 4, 5, RACE_DWARF},
215 /* Weapon Smith - 28 unique names */
217 { "残忍なるアーノルド", 5000, 210, 115, 6, 6, RACE_HALF_TROLL},
218 { "獣殺しのアーンダル", 10000, 185, 110, 5, 9, RACE_HALF_ELF},
219 { "獣マスターのエディー", 25000, 190, 115, 5, 7, RACE_HOBBIT},
220 { "竜殺しのオグライン", 30000, 195, 112, 4, 8, RACE_DWARF},
221 { "熟練者ドリュー", 10000, 210, 115, 6, 6, RACE_HUMAN},
222 { "龍の子オラックス", 15000, 185, 110, 5, 9, RACE_DRACONIAN},
223 { "病気持ちのアンスラックス", 25000, 190, 115, 5, 7, RACE_BEASTMAN},
224 { "頑丈者アルコス", 30000, 195, 112, 4, 8, RACE_DWARF},
225 { "腐れ者のサリアス", 5000, 210, 115, 6, 6, RACE_ZOMBIE},
226 { "晒し骨のトゥエシク", 15000, 185, 110, 5, 9, RACE_SKELETON},
227 { "ビリオス", 25000, 190, 115, 5, 7, RACE_BEASTMAN},
228 { "ファスガル", 30000, 195, 112, 4, 8, RACE_ZOMBIE},
229 { "パラディンのエレフリス", 10000, 210, 115, 6, 6, RACE_BARBARIAN},
230 { "キ'トリッ'ク", 15000, 185, 110, 5, 9, RACE_KLACKON},
231 { "蜘蛛の友ドゥロカス", 25000, 190, 115, 5, 7, RACE_DARK_ELF},
232 { "巨人殺しのフングス", 30000, 195, 112, 4, 8, RACE_DWARF},
233 { "デランサ", 10000, 210, 115, 6, 6, RACE_ELF},
234 { "レンジャーのソルビスタニ", 15000, 185, 110, 5, 9, RACE_HALF_ELF},
235 { "ノロマのゾリル", 25000, 190, 115, 5, 7, RACE_GOLEM},
236 { "イーオン・フラックス", 20000, 195, 112, 4, 8, RACE_HALF_ELF},
237 { "強者ナドック", 10000, 210, 115, 6, 6, RACE_HOBBIT},
238 { "弱虫エラモグ", 15000, 185, 110, 5, 9, RACE_KOBOLD},
239 { "公正なエオウィリス", 25000, 190, 115, 5, 7, RACE_VAMPIRE},
240 { "バルログ殺しのヒュイモグ", 30000, 195, 112, 4, 8, RACE_HALF_ORC},
241 { "冷酷ピーダス", 5000, 210, 115, 6, 6, RACE_HUMAN},
242 { "ヴァモグ スレイヤー", 15000, 185, 110, 5, 9, RACE_HALF_OGRE},
243 { "性悪フーシュナク", 25000, 190, 115, 5, 7, RACE_BEASTMAN},
244 { "舞闘バレン", 30000, 195, 112, 4, 8, RACE_BARBARIAN},
245 { "残忍なるアーノルド", 5000, 210, 115, 6, 6, RACE_BARBARIAN},
246 { "獣殺しのアーンダル", 10000, 185, 110, 5, 9, RACE_HALF_ELF},
247 { "ビーストマスター・エディー", 25000, 190, 115, 5, 7, RACE_HALF_ORC},
248 { "竜殺しのオグライン", 30000, 195, 112, 4, 8, RACE_DWARF},
250 { "Arnold the Beastly", 5000, 210, 115, 6, 6, RACE_BARBARIAN},
251 { "Arndal Beast-Slayer", 10000, 185, 110, 5, 9, RACE_HALF_ELF},
252 { "Eddie Beast-Master", 25000, 190, 115, 5, 7, RACE_HALF_ORC},
253 { "Oglign Dragon-Slayer", 30000, 195, 112, 4, 8, RACE_DWARF},
254 { "Drew the Skilled", 10000, 210, 115, 6, 6, RACE_HUMAN},
255 { "Orrax Dragonson", 15000, 185, 110, 5, 9, RACE_DRACONIAN},
256 { "Anthrax Disease-Carrier", 25000, 190, 115, 5, 7, RACE_BEASTMAN},
257 { "Arkhoth the Stout", 30000, 195, 112, 4, 8, RACE_DWARF},
258 { "Sarlyas the Rotten", 5000, 210, 115, 6, 6, RACE_ZOMBIE},
259 { "Tuethic Bare-Bones", 15000, 185, 110, 5, 9, RACE_SKELETON},
260 { "Bilious", 25000, 190, 115, 5, 7, RACE_BEASTMAN},
261 { "Fasgul", 30000, 195, 112, 4, 8, RACE_ZOMBIE},
262 { "Ellefris the Paladin", 10000, 210, 115, 6, 6, RACE_BARBARIAN},
263 { "K'trrik'k", 15000, 185, 110, 5, 9, RACE_KLACKON},
264 { "Drocus Spiderfriend", 25000, 190, 115, 5, 7, RACE_DARK_ELF},
265 { "Fungus Giant-Slayer", 30000, 195, 112, 4, 8, RACE_DWARF},
266 { "Delantha", 10000, 210, 115, 6, 6, RACE_ELF},
267 { "Solvistani the Ranger", 15000, 185, 110, 5, 9, RACE_HALF_ELF},
268 { "Xoril the Slow", 25000, 190, 115, 5, 7, RACE_GOLEM},
269 { "Aeon Flux", 20000, 195, 112, 4, 8, RACE_HALF_ELF},
270 { "Nadoc the Strong", 10000, 210, 115, 6, 6, RACE_HOBBIT},
271 { "Eramog the Weak", 15000, 185, 110, 5, 9, RACE_KOBOLD},
272 { "Eowilith the Fair", 25000, 190, 115, 5, 7, RACE_VAMPIRE},
273 { "Huimog Balrog-Slayer", 30000, 195, 112, 4, 8, RACE_HALF_ORC},
274 { "Peadus the Cruel", 5000, 210, 115, 6, 6, RACE_HUMAN},
275 { "Vamog Slayer", 15000, 185, 110, 5, 9, RACE_HALF_OGRE},
276 { "Hooshnak the Vicious", 25000, 190, 115, 5, 7, RACE_BEASTMAN},
277 { "Balenn War-Dancer", 30000, 195, 112, 4, 8, RACE_BARBARIAN},
278 { "Arnold the Beastly", 5000, 210, 115, 6, 6, RACE_BARBARIAN},
279 { "Arndal Beast-Slayer", 10000, 185, 110, 5, 9, RACE_HALF_ELF},
280 { "Eddie Beast-Master", 25000, 190, 115, 5, 7, RACE_HALF_ORC},
281 { "Oglign Dragon-Slayer", 30000, 195, 112, 4, 8, RACE_DWARF},
285 /* Temple - 22 unique names */
287 { "質素なルードヴィヒ", 5000, 175, 109, 6, 15, RACE_HUMAN},
288 { "パラディンのガンナー", 10000, 185, 110, 5, 23, RACE_HUMAN},
289 { "選ばれしトリン", 25000, 180, 107, 6, 20, RACE_ELF},
290 { "賢明なるサラストロ", 30000, 185, 109, 5, 15, RACE_DWARF},
291 { "パーシヴァル卿", 25000, 180, 107, 6, 20, RACE_HIGH_ELF},
292 { "神聖なるアセナス", 30000, 185, 109, 5, 15, RACE_HUMAN},
293 { "マッキノン", 10000, 175, 109, 6, 15, RACE_HUMAN},
294 { "謹み婦人", 15000, 185, 110, 5, 23, RACE_HIGH_ELF},
295 { "ドルイドのハシュニック", 25000, 180, 107, 6, 20, RACE_HOBBIT},
296 { "フィナク", 30000, 185, 109, 5, 15, RACE_YEEK},
297 { "クリキック", 10000, 175, 109, 6, 15, RACE_KLACKON},
298 { "荒くれ者モリヴァル", 15000, 185, 110, 5, 23, RACE_ELF},
299 { "暗きホシャック", 25000, 180, 107, 6, 20, RACE_IMP},
300 { "賢者アタール", 30000, 185, 109, 5, 15, RACE_HUMAN},
301 { "清きイベニッド", 10000, 175, 109, 6, 15, RACE_HUMAN},
302 { "エリディシュ", 15000, 185, 110, 5, 23, RACE_HALF_TROLL},
303 { "呪術師ヴルドゥシュ", 25000, 180, 107, 6, 20, RACE_HALF_OGRE},
304 { "狂戦士ハオブ", 30000, 185, 109, 5, 15, RACE_BARBARIAN},
305 { "若きプルーグディシュ", 10000, 175, 109, 6, 15, RACE_HALF_OGRE},
306 { "きちがいラムワイズ", 15000, 185, 110, 5, 23, RACE_YEEK},
307 { "有徳者ムワート", 25000, 180, 107, 6, 20, RACE_KOBOLD},
308 { "弱虫ダードバード", 30000, 185, 109, 5, 15, RACE_SPECTRE},
309 { "質素なルードヴィヒ", 5000, 175, 109, 6, 15, RACE_HUMAN},
310 { "パラディンのガンナー", 10000, 185, 110, 5, 23, RACE_HUMAN},
311 { "選ばれしトリン", 25000, 180, 107, 6, 20, RACE_ELF},
312 { "賢明なるサラストロ", 30000, 185, 109, 5, 15, RACE_DWARF},
313 { "パーシヴァル卿", 25000, 180, 107, 6, 20, RACE_HIGH_ELF},
314 { "神聖なるアセナス", 30000, 185, 109, 5, 15, RACE_HUMAN},
315 { "マッキノン", 10000, 175, 109, 6, 15, RACE_HUMAN},
316 { "謹み婦人", 15000, 185, 110, 5, 23, RACE_HIGH_ELF},
317 { "ドルイドのハシュニック", 25000, 180, 107, 6, 20, RACE_HOBBIT},
318 { "フィナク", 30000, 185, 109, 5, 15, RACE_YEEK},
320 { "Ludwig the Humble", 5000, 175, 109, 6, 15, RACE_DWARF},
321 { "Gunnar the Paladin", 10000, 185, 110, 5, 23, RACE_HALF_TROLL},
322 { "Torin the Chosen", 25000, 180, 107, 6, 20, RACE_HIGH_ELF},
323 { "Sarastro the Wise", 30000, 185, 109, 5, 15, RACE_HUMAN},
324 { "Sir Parsival the Pure", 25000, 180, 107, 6, 20, RACE_HIGH_ELF},
325 { "Asenath the Holy", 30000, 185, 109, 5, 15, RACE_HUMAN},
326 { "McKinnon", 10000, 175, 109, 6, 15, RACE_HUMAN},
327 { "Mistress Chastity", 15000, 185, 110, 5, 23, RACE_HIGH_ELF},
328 { "Hashnik the Druid", 25000, 180, 107, 6, 20, RACE_HOBBIT},
329 { "Finak", 30000, 185, 109, 5, 15, RACE_YEEK},
330 { "Krikkik", 10000, 175, 109, 6, 15, RACE_KLACKON},
331 { "Morival the Wild", 15000, 185, 110, 5, 23, RACE_ELF},
332 { "Hoshak the Dark", 25000, 180, 107, 6, 20, RACE_IMP},
333 { "Atal the Wise", 30000, 185, 109, 5, 15, RACE_HUMAN},
334 { "Ibenidd the Chaste", 10000, 175, 109, 6, 15, RACE_HUMAN},
335 { "Eridish", 15000, 185, 110, 5, 23, RACE_HALF_TROLL},
336 { "Vrudush the Shaman", 25000, 180, 107, 6, 20, RACE_HALF_OGRE},
337 { "Haob the Berserker", 30000, 185, 109, 5, 15, RACE_BARBARIAN},
338 { "Proogdish the Youthfull", 10000, 175, 109, 6, 15, RACE_HALF_OGRE},
339 { "Lumwise the Mad", 15000, 185, 110, 5, 23, RACE_YEEK},
340 { "Muirt the Virtuous", 25000, 180, 107, 6, 20, RACE_KOBOLD},
341 { "Dardobard the Weak", 30000, 185, 109, 5, 15, RACE_SPECTRE},
342 { "Ludwig the Humble", 5000, 175, 109, 6, 15, RACE_DWARF},
343 { "Gunnar the Paladin", 10000, 185, 110, 5, 23, RACE_HALF_TROLL},
344 { "Torin the Chosen", 25000, 180, 107, 6, 20, RACE_HIGH_ELF},
345 { "Sarastro the Wise", 30000, 185, 109, 5, 15, RACE_HUMAN},
346 { "Sir Parsival the Pure", 25000, 180, 107, 6, 20, RACE_HIGH_ELF},
347 { "Asenath the Holy", 30000, 185, 109, 5, 15, RACE_HUMAN},
348 { "McKinnon", 10000, 175, 109, 6, 15, RACE_HUMAN},
349 { "Mistress Chastity", 15000, 185, 110, 5, 23, RACE_HIGH_ELF},
350 { "Hashnik the Druid", 25000, 180, 107, 6, 20, RACE_HOBBIT},
351 { "Finak", 30000, 185, 109, 5, 15, RACE_YEEK},
355 /* Alchemist - 26 unique names */
357 { "化学者マウザー", 10000, 190, 111, 5, 8, RACE_HALF_ELF},
358 { "カオスのウィズル", 10000, 190, 110, 6, 8, RACE_HOBBIT},
359 { "強欲ミダス", 15000, 200, 116, 6, 9, RACE_GNOME},
360 { "貧弱ジャ=ファー", 15000, 220, 111, 4, 9, RACE_ELF},/*FIRST*/
361 { "カカルラカカル", 15000, 200, 116, 6, 9, RACE_KLACKON},
362 { "錬金術師ジャル=エス", 15000, 220, 111, 4, 9, RACE_ELF},
363 { "用心深いファネラス", 10000, 190, 111, 5, 8, RACE_DWARF},
364 { "キチガイのルンシー", 10000, 190, 110, 6, 8, RACE_HUMAN},
365 { "グランブルワース", 15000, 200, 116, 6, 9, RACE_GNOME},
366 { "フリッター", 15000, 220, 111, 4, 9, RACE_SPRITE},
367 { "ザリルス", 10000, 190, 111, 5, 8, RACE_HUMAN},
368 { "古きエグバート", 10000, 190, 110, 6, 8, RACE_DWARF},
369 { "誇り高きヴァリンドラ", 15000, 200, 116, 6, 9, RACE_HIGH_ELF},
370 { "錬金術師タエン", 15000, 220, 111, 4, 9, RACE_HUMAN},
371 { "巧言カイド", 10000, 190, 111, 5, 8, RACE_VAMPIRE},
372 { "暗きフリア", 10000, 190, 110, 6, 8, RACE_NIBELUNG},
373 { "質素なドムリ", 15000, 200, 116, 6, 9, RACE_DWARF},
374 { "魔の子ヤァジュッカ", 15000, 220, 111, 4, 9, RACE_IMP},
375 { "薬草師ジェララルドール", 10000, 190, 111, 5, 8, RACE_HIGH_ELF},
376 { "賢者オレラルダン", 10000, 190, 110, 6, 8, RACE_BARBARIAN},
377 { "デモニシストのフゾグロ", 15000, 200, 116, 6, 9, RACE_IMP},
378 { "錬金術師ドゥリアシュ", 15000, 220, 111, 4, 9, RACE_HALF_ORC},
379 { "強者ネリア", 10000, 190, 111, 5, 8, RACE_CYCLOPS},
380 { "辛口リグナス", 10000, 190, 110, 6, 8, RACE_HALF_ORC},
381 { "ティルバ", 15000, 200, 116, 6, 9, RACE_HOBBIT},
382 { "金持ちミリルドリック", 15000, 220, 111, 4, 9, RACE_HUMAN},
384 { "科学者マウザー", 10000, 190, 111, 5, 8, RACE_HALF_ELF},
385 { "カオスのウィズル", 10000, 190, 110, 6, 8, RACE_HOBBIT},
386 { "強欲ミダス", 15000, 200, 116, 6, 9, RACE_GNOME},
387 { "錬金術師ジャ=ファー", 15000, 220, 111, 4, 9, RACE_ELF},
388 { "カカルラカカル", 15000, 200, 116, 6, 9, RACE_KLACKON},
389 { "錬金術師ジャル=エス", 15000, 220, 111, 4, 9, RACE_ELF},
391 { "Mauser the Chemist", 10000, 190, 111, 5, 8, RACE_HALF_ELF},
392 { "Wizzle the Chaotic", 10000, 190, 110, 6, 8, RACE_HOBBIT},
393 { "Midas the Greedy", 15000, 200, 116, 6, 9, RACE_GNOME},
394 { "Ja-Far the Alchemist", 15000, 220, 111, 4, 9, RACE_ELF},
395 { "Kakalrakakal", 15000, 200, 116, 6, 9, RACE_KLACKON},
396 { "Jal-Eth the Alchemist", 15000, 220, 111, 4, 9, RACE_ELF},
397 { "Fanelath the Cautious", 10000, 190, 111, 5, 8, RACE_DWARF},
398 { "Runcie the Insane", 10000, 190, 110, 6, 8, RACE_HUMAN},
399 { "Grumbleworth", 15000, 200, 116, 6, 9, RACE_GNOME},
400 { "Flitter", 15000, 220, 111, 4, 9, RACE_SPRITE},
401 { "Xarillus", 10000, 190, 111, 5, 8, RACE_HUMAN},
402 { "Egbert the Old", 10000, 190, 110, 6, 8, RACE_DWARF},
403 { "Valindra the Proud", 15000, 200, 116, 6, 9, RACE_HIGH_ELF},
404 { "Taen the Alchemist", 15000, 220, 111, 4, 9, RACE_HUMAN},
405 { "Cayd the Sweet", 10000, 190, 111, 5, 8, RACE_VAMPIRE},
406 { "Fulir the Dark", 10000, 190, 110, 6, 8, RACE_NIBELUNG},
407 { "Domli the Humble", 15000, 200, 116, 6, 9, RACE_DWARF},
408 { "Yaarjukka Demonspawn", 15000, 220, 111, 4, 9, RACE_IMP},
409 { "Gelaraldor the Herbmaster", 10000, 190, 111, 5, 8, RACE_HIGH_ELF},
410 { "Olelaldan the Wise", 10000, 190, 110, 6, 8, RACE_BARBARIAN},
411 { "Fthoglo the Demonicist", 15000, 200, 116, 6, 9, RACE_IMP},
412 { "Dridash the Alchemist", 15000, 220, 111, 4, 9, RACE_HALF_ORC},
413 { "Nelir the Strong", 10000, 190, 111, 5, 8, RACE_CYCLOPS},
414 { "Lignus the Pungent", 10000, 190, 110, 6, 8, RACE_HALF_ORC},
415 { "Tilba", 15000, 200, 116, 6, 9, RACE_HOBBIT},
416 { "Myrildric the Wealthy", 15000, 220, 111, 4, 9, RACE_HUMAN},
418 { "Mauser the Chemist", 10000, 190, 111, 5, 8, RACE_HALF_ELF},
419 { "Wizzle the Chaotic", 10000, 190, 110, 6, 8, RACE_HOBBIT},
420 { "Midas the Greedy", 15000, 200, 116, 6, 9, RACE_GNOME},
421 { "Ja-Far the Alchemist", 15000, 220, 111, 4, 9, RACE_ELF},
422 { "Kakalrakakal", 15000, 200, 116, 6, 9, RACE_KLACKON},
423 { "Jal-Eth the Alchemist", 15000, 220, 111, 4, 9, RACE_ELF},
428 /* Magic Shop - 23 unique names */
430 { "ソーサラーのロ=パン", 20000, 200, 110, 7, 8, RACE_HALF_ELF},
431 { "偉大なるブガービイ", 20000, 215, 113, 6, 10, RACE_GNOME},
432 { "イェンダーの魔法使い", 30000, 200, 110, 7, 10, RACE_HUMAN},
433 { "死霊使いリャク",30000, 175, 110, 5, 11, RACE_HIGH_ELF},
434 { "魔術師スキドゥニー", 15000, 200, 110, 7, 8, RACE_HALF_ELF},
435 { "幻術師キリア", 30000, 200, 110, 7, 10, RACE_HUMAN},
436 { "死霊術師ニッキ", 30000, 175, 110, 5, 11, RACE_DARK_ELF},
437 { "ソロストラン", 15000, 200, 110, 7, 8, RACE_SPRITE},
438 { "烏賊口アチシェ", 20000, 215, 113, 6, 10, RACE_MIND_FLAYER},
439 { "貴族のカザ", 30000, 200, 110, 7, 10, RACE_HIGH_ELF},
440 { "暗きファジル", 30000, 175, 110, 5, 11, RACE_DARK_ELF},
441 { "偉大なるケルドーン", 15000, 200, 110, 7, 8, RACE_DWARF},
442 { "フィランスロプス", 20000, 215, 113, 6, 10, RACE_HOBBIT},
443 { "魔女のアグナー", 30000, 200, 110, 7, 10, RACE_HUMAN},
444 { "死霊術師ビュリアンス", 30000, 175, 110, 5, 11, RACE_BEASTMAN},
445 { "ハイメイジのヴイラク", 15000, 200, 110, 7, 8, RACE_BEASTMAN},
446 { "知恵者マディッシュ", 20000, 215, 113, 6, 10, RACE_BEASTMAN},
447 { "ファレブリンボール", 30000, 200, 110, 7, 10, RACE_HIGH_ELF},
448 { "陰険フェリル=ガンド", 30000, 175, 110, 5, 11, RACE_DARK_ELF},
449 { "呪術師サレゴード", 15000, 200, 110, 7, 8, RACE_BARBARIAN},
450 { "神秘家クトゥアロス", 20000, 215, 113, 6, 10, RACE_MIND_FLAYER},
451 { "幻術師イベリ", 30000, 200, 110, 7, 10, RACE_SKELETON},
452 { "死霊術師ヘトー", 30000, 175, 110, 5, 11, RACE_YEEK},
453 { "魔術師ロ=パン", 20000, 200, 110, 7, 8, RACE_HALF_ELF},
454 { "偉大なるブガービイ", 20000, 215, 113, 6, 10, RACE_GNOME},
455 { "イェンダーの魔法使い", 30000, 200, 110, 7, 10, RACE_HUMAN},
456 { "死霊術師リャク", 30000, 175, 110, 5, 11, RACE_DARK_ELF},
457 { "魔術師スキドゥニー", 15000, 200, 110, 7, 8, RACE_HALF_ELF},
458 { "幻術師キリア", 30000, 200, 110, 7, 10, RACE_HUMAN},
459 { "死霊術師ニッキ", 30000, 175, 110, 5, 11, RACE_DARK_ELF},
460 { "ソロストラン", 15000, 200, 110, 7, 8, RACE_SPRITE},
461 { "烏賊口アチシェ", 20000, 215, 113, 6, 10, RACE_MIND_FLAYER},
463 { "Lo Pan the Sorcerer", 20000, 200, 110, 7, 8, RACE_HALF_ELF},
464 { "Buggerby the Great", 20000, 215, 113, 6, 10, RACE_GNOME},
465 { "The Wizard of Yendor", 30000, 200, 110, 7, 10, RACE_HUMAN},
466 { "Rjak the Necromancer", 30000, 175, 110, 5, 11, RACE_DARK_ELF},
467 { "Skidney the Sorcerer", 15000, 200, 110, 7, 8, RACE_HALF_ELF},
468 { "Kyria the Illusionist", 30000, 200, 110, 7, 10, RACE_HUMAN},
469 { "Nikki the Necromancer", 30000, 175, 110, 5, 11, RACE_DARK_ELF},
470 { "Solostoran", 15000, 200, 110, 7, 8, RACE_SPRITE},
471 { "Achshe the Tentacled", 20000, 215, 113, 6, 10, RACE_MIND_FLAYER},
472 { "Kaza the Noble", 30000, 200, 110, 7, 10, RACE_HIGH_ELF},
473 { "Fazzil the Dark", 30000, 175, 110, 5, 11, RACE_DARK_ELF},
474 { "Keldorn the Grand", 15000, 200, 110, 7, 8, RACE_DWARF},
475 { "Philanthropus", 20000, 215, 113, 6, 10, RACE_HOBBIT},
476 { "Agnar the Enchantress", 30000, 200, 110, 7, 10, RACE_HUMAN},
477 { "Buliance the Necromancer", 30000, 175, 110, 5, 11, RACE_BEASTMAN},
478 { "Vuirak the High-Mage", 15000, 200, 110, 7, 8, RACE_BEASTMAN},
479 { "Madish the Smart", 20000, 215, 113, 6, 10, RACE_BEASTMAN},
480 { "Falebrimbor", 30000, 200, 110, 7, 10, RACE_HIGH_ELF},
481 { "Felil-Gand the Subtle", 30000, 175, 110, 5, 11, RACE_DARK_ELF},
482 { "Thalegord the Shaman", 15000, 200, 110, 7, 8, RACE_BARBARIAN},
483 { "Cthoaloth the Mystic", 20000, 215, 113, 6, 10, RACE_MIND_FLAYER},
484 { "Ibeli the Illusionist", 30000, 200, 110, 7, 10, RACE_SKELETON},
485 { "Heto the Necromancer", 30000, 175, 110, 5, 11, RACE_YEEK},
486 { "Lo Pan the Sorcerer", 20000, 200, 110, 7, 8, RACE_HALF_ELF},
487 { "Buggerby the Great", 20000, 215, 113, 6, 10, RACE_GNOME},
488 { "The Wizard of Yendor", 30000, 200, 110, 7, 10, RACE_HUMAN},
489 { "Rjak the Necromancer", 30000, 175, 110, 5, 11, RACE_DARK_ELF},
490 { "Skidney the Sorcerer", 15000, 200, 110, 7, 8, RACE_HALF_ELF},
491 { "Kyria the Illusionist", 30000, 200, 110, 7, 10, RACE_HUMAN},
492 { "Nikki the Necromancer", 30000, 175, 110, 5, 11, RACE_DARK_ELF},
493 { "Solostoran", 15000, 200, 110, 7, 8, RACE_SPRITE},
494 { "Achshe the Tentacled", 20000, 215, 113, 6, 10, RACE_MIND_FLAYER},
498 /* Black Market - 32 unique names */
500 { "ガリー=ギガズ", 20000, 250, 150, 10, 5, RACE_HALF_TROLL},
501 { "ゴブリンのヒストーア", 20000, 250, 150, 10, 5, RACE_HALF_ORC},
502 { "フェレンギ人クアーク", 30000, 250, 150, 10, 5, RACE_HUMAN},
503 { "公正なる(?)トッピ", 30000, 250, 150, 10, 5, RACE_ELF},
504 { "死人ヴァッサ", 20000, 250, 150, 10, 5, RACE_ZOMBIE},
505 { "裏切り者カイン", 20000, 250, 150, 10, 5, RACE_VAMPIRE},
506 { "ブボニカス", 30000, 250, 150, 10, 5, RACE_BEASTMAN},
507 { "コープスライト", 30000, 250, 150, 10, 5, RACE_SPECTRE},
508 { "血に飢えしパリッシュ", 20000, 250, 150, 10, 5, RACE_VAMPIRE},
509 { "ヴァイル", 20000, 250, 150, 10, 5, RACE_SKELETON},
510 { "信頼のプレンティス", 30000, 250, 150, 10, 5, RACE_SKELETON},
511 { "人間殺しのグリエラ", 30000, 250, 150, 10, 5, RACE_IMP},
512 { "エンジェル", 20000, 250, 150, 10, 5, RACE_VAMPIRE},
513 { "水膨れフロツァム", 20000, 250, 150, 10, 5, RACE_ZOMBIE},
514 { "ニーヴァル", 30000, 250, 150, 10, 5, RACE_VAMPIRE},
515 { "明るいアナスタシア", 30000, 250, 150, 10, 5, RACE_SPECTRE},
516 { "死霊術師チャリティー", 20000, 250, 150, 10, 5, RACE_DARK_ELF},
517 { "ボクサーのプグナシオス", 20000, 250, 150, 10, 5, RACE_HALF_ORC},
518 { "幸運なフットソア", 30000, 250, 150, 10, 5, RACE_BEASTMAN},
519 { "光指のシドリア", 30000, 250, 150, 10, 5, RACE_HUMAN},
520 { "手品師リアソー", 20000, 250, 150, 10, 5, RACE_HOBBIT},
521 { "やりくり上手のジャナッカ", 20000, 250, 150, 10, 5, RACE_GNOME},
522 { "悪党シーナ", 30000, 250, 150, 10, 5, RACE_GNOME},
523 { "大爪アルニッキ", 30000, 250, 150, 10, 5, RACE_DRACONIAN},
524 { "貧乏チャエアンド", 20000, 250, 150, 10, 5, RACE_HUMAN},
525 { "山賊アファードーフ", 20000, 250, 150, 10, 5, RACE_BARBARIAN},
526 { "強欲ラザクスル", 30000, 250, 150, 10, 5, RACE_MIND_FLAYER},
527 { "ファラレウィン", 30000, 250, 150, 10, 5, RACE_SPRITE},
528 { "しわしわヴォスール", 20000, 250, 150, 10, 5, RACE_NIBELUNG},
529 { "ハンサムなアラオード", 20000, 250, 150, 10, 5, RACE_AMBERITE},
530 { "負け犬セラドフリド", 30000, 250, 150, 10, 5, RACE_HUMAN},
531 { "片足のエルーロ", 30000, 250, 150, 10, 5, RACE_HALF_OGRE},
533 { "Gary Gygaz", 20000, 250, 150, 10, 5, RACE_HALF_TROLL},
534 { "Histor the Goblin", 20000, 250, 150, 10, 5, RACE_HALF_ORC},
535 { "Quark the Ferengi", 30000, 250, 150, 10, 5, RACE_DWARF},
536 { "Topi the Fair(?)", 30000, 250, 150, 10, 5, RACE_HUMAN},
537 { "Vhassa the Dead", 20000, 250, 150, 10, 5, RACE_ZOMBIE},
538 { "Kyn the Treacherous", 20000, 250, 150, 10, 5, RACE_VAMPIRE},
539 { "Bubonicus", 30000, 250, 150, 10, 5, RACE_BEASTMAN},
540 { "Corpselight", 30000, 250, 150, 10, 5, RACE_SPECTRE},
541 { "Parrish the Bloodthirsty", 20000, 250, 150, 10, 5, RACE_VAMPIRE},
542 { "Vile", 20000, 250, 150, 10, 5, RACE_SKELETON},
543 { "Prentice the Trusted", 30000, 250, 150, 10, 5, RACE_SKELETON},
544 { "Griella Humanslayer", 30000, 250, 150, 10, 5, RACE_IMP},
545 { "Angel", 20000, 250, 150, 10, 5, RACE_VAMPIRE},
546 { "Flotsam the Bloated", 20000, 250, 150, 10, 5, RACE_ZOMBIE},
547 { "Nieval", 30000, 250, 150, 10, 5, RACE_VAMPIRE},
548 { "Anastasia the Luminous", 30000, 250, 150, 10, 5, RACE_SPECTRE},
549 { "Charity the Necromancer", 20000, 250, 150, 10, 5, RACE_DARK_ELF},
550 { "Pugnacious the Pugilist", 20000, 250, 150, 10, 5, RACE_HALF_ORC},
551 { "Footsore the Lucky", 30000, 250, 150, 10, 5, RACE_BEASTMAN},
552 { "Sidria Lighfingered", 30000, 250, 150, 10, 5, RACE_HUMAN},
553 { "Riatho the Juggler", 20000, 250, 150, 10, 5, RACE_HOBBIT},
554 { "Janaaka the Shifty", 20000, 250, 150, 10, 5, RACE_GNOME},
555 { "Cina the Rogue", 30000, 250, 150, 10, 5, RACE_GNOME},
556 { "Arunikki Greatclaw", 30000, 250, 150, 10, 5, RACE_DRACONIAN},
557 { "Chaeand the Poor", 20000, 250, 150, 10, 5, RACE_HUMAN},
558 { "Afardorf the Brigand", 20000, 250, 150, 10, 5, RACE_BARBARIAN},
559 { "Lathaxl the Greedy", 30000, 250, 150, 10, 5, RACE_MIND_FLAYER},
560 { "Falarewyn", 30000, 250, 150, 10, 5, RACE_SPRITE},
561 { "Vosur the Wrinkled", 20000, 250, 150, 10, 5, RACE_NIBELUNG},
562 { "Araord the Handsome", 20000, 250, 150, 10, 5, RACE_AMBERITE},
563 { "Theradfrid the Loser", 30000, 250, 150, 10, 5, RACE_HUMAN},
564 { "One-Legged Eroolo", 30000, 250, 150, 10, 5, RACE_HALF_OGRE},
570 { "我が家", 0, 100, 100, 0, 99, 99},
571 { "我が家", 0, 100, 100, 0, 99, 99},
572 { "我が家", 0, 100, 100, 0, 99, 99},
573 { "我が家", 0, 100, 100, 0, 99, 99},
574 { "我が家", 0, 100, 100, 0, 99, 99},
575 { "我が家", 0, 100, 100, 0, 99, 99},
576 { "我が家", 0, 100, 100, 0, 99, 99},
577 { "我が家", 0, 100, 100, 0, 99, 99},
578 { "我が家", 0, 100, 100, 0, 99, 99},
579 { "我が家", 0, 100, 100, 0, 99, 99},
580 { "我が家", 0, 100, 100, 0, 99, 99},
581 { "我が家", 0, 100, 100, 0, 99, 99},
582 { "我が家", 0, 100, 100, 0, 99, 99},
583 { "我が家", 0, 100, 100, 0, 99, 99},
584 { "我が家", 0, 100, 100, 0, 99, 99},
585 { "我が家", 0, 100, 100, 0, 99, 99},
586 { "我が家", 0, 100, 100, 0, 99, 99},
587 { "我が家", 0, 100, 100, 0, 99, 99},
588 { "我が家", 0, 100, 100, 0, 99, 99},
589 { "我が家", 0, 100, 100, 0, 99, 99},
590 { "我が家", 0, 100, 100, 0, 99, 99},
591 { "我が家", 0, 100, 100, 0, 99, 99},
592 { "我が家", 0, 100, 100, 0, 99, 99},
593 { "我が家", 0, 100, 100, 0, 99, 99},
594 { "我が家", 0, 100, 100, 0, 99, 99},
595 { "我が家", 0, 100, 100, 0, 99, 99},
596 { "我が家", 0, 100, 100, 0, 99, 99},
597 { "我が家", 0, 100, 100, 0, 99, 99},
598 { "我が家", 0, 100, 100, 0, 99, 99},
599 { "我が家", 0, 100, 100, 0, 99, 99},
600 { "我が家", 0, 100, 100, 0, 99, 99},
601 { "我が家", 0, 100, 100, 0, 99, 99},
603 { "Your home", 0, 100, 100, 0, 99, 99},
604 { "Your home", 0, 100, 100, 0, 99, 99},
605 { "Your home", 0, 100, 100, 0, 99, 99},
606 { "Your home", 0, 100, 100, 0, 99, 99},
607 { "Your home", 0, 100, 100, 0, 99, 99},
608 { "Your home", 0, 100, 100, 0, 99, 99},
609 { "Your home", 0, 100, 100, 0, 99, 99},
610 { "Your home", 0, 100, 100, 0, 99, 99},
611 { "Your home", 0, 100, 100, 0, 99, 99},
612 { "Your home", 0, 100, 100, 0, 99, 99},
613 { "Your home", 0, 100, 100, 0, 99, 99},
614 { "Your home", 0, 100, 100, 0, 99, 99},
615 { "Your home", 0, 100, 100, 0, 99, 99},
616 { "Your home", 0, 100, 100, 0, 99, 99},
617 { "Your home", 0, 100, 100, 0, 99, 99},
618 { "Your home", 0, 100, 100, 0, 99, 99},
619 { "Your home", 0, 100, 100, 0, 99, 99},
620 { "Your home", 0, 100, 100, 0, 99, 99},
621 { "Your home", 0, 100, 100, 0, 99, 99},
622 { "Your home", 0, 100, 100, 0, 99, 99},
623 { "Your home", 0, 100, 100, 0, 99, 99},
624 { "Your home", 0, 100, 100, 0, 99, 99},
625 { "Your home", 0, 100, 100, 0, 99, 99},
626 { "Your home", 0, 100, 100, 0, 99, 99},
627 { "Your home", 0, 100, 100, 0, 99, 99},
628 { "Your home", 0, 100, 100, 0, 99, 99},
629 { "Your home", 0, 100, 100, 0, 99, 99},
630 { "Your home", 0, 100, 100, 0, 99, 99},
631 { "Your home", 0, 100, 100, 0, 99, 99},
632 { "Your home", 0, 100, 100, 0, 99, 99},
633 { "Your home", 0, 100, 100, 0, 99, 99},
634 { "Your home", 0, 100, 100, 0, 99, 99},
640 /* Bookstore - 21 unique names */
642 { "強欲ドラフ", 10000, 175, 108, 4, 12, RACE_HUMAN},
643 { "賢者オドナー", 15000, 120, 105, 6, 16, RACE_HIGH_ELF},
644 { "中立のガンダー", 25000, 120, 110, 7, 19, RACE_DARK_ELF},
645 { "忍耐の人ロ=シャ", 30000, 140, 105, 6, 12, RACE_ELF},
646 { "ランドルフ・カーター", 15000, 175, 108, 4, 12, RACE_HUMAN},
647 { "隼のサライ", 15000, 175, 108, 4, 12, RACE_HUMAN},
648 { "千里眼ボドリル", 20000, 120, 105, 6, 16, RACE_HIGH_ELF},
649 { "沈黙のヴェオロイン", 25000, 120, 110, 7, 19, RACE_ZOMBIE},
650 { "学者のヴァンシラス", 30000, 140, 105, 6, 12, RACE_MIND_FLAYER},
651 { "物書きオセイン", 15000, 175, 108, 4, 12, RACE_SKELETON},
652 { "本の虫オルヴァー", 20000, 120, 105, 6, 16, RACE_VAMPIRE},
653 { "浅井墓男", 25000, 120, 110, 7, 19, RACE_ZOMBIE},
654 { "デスマスク", 30000, 140, 105, 6, 12, RACE_ZOMBIE},
655 { "学者のアスーヌ", 15000, 175, 108, 4, 12, RACE_MIND_FLAYER},
656 { "死人のプリランド", 20000, 120, 105, 6, 16, RACE_ZOMBIE},
657 { "鉄のロナール", 25000, 120, 110, 7, 19, RACE_GOLEM},
659 { "Dolaf the Greedy", 10000, 175, 108, 4, 12, RACE_HUMAN},
660 { "Odnar the Sage", 15000, 120, 105, 6, 16, RACE_HIGH_ELF},
661 { "Gandar the Neutral", 25000, 120, 110, 7, 19, RACE_DARK_ELF},
662 { "Ro-sha the Patient", 30000, 140, 105, 6, 12, RACE_ELF},
663 { "Randolph Carter", 15000, 175, 108, 4, 12, RACE_HUMAN},
664 { "Sarai the Swift", 15000, 175, 108, 4, 12, RACE_HUMAN},
665 { "Bodril the Seer", 20000, 120, 105, 6, 16, RACE_HIGH_ELF},
666 { "Veloin the Quiet", 25000, 120, 110, 7, 19, RACE_ZOMBIE},
667 { "Vanthylas the Learned", 30000, 140, 105, 6, 12, RACE_MIND_FLAYER},
668 { "Ossein the Literate", 15000, 175, 108, 4, 12, RACE_SKELETON},
669 { "Olvar Bookworm", 20000, 120, 105, 6, 16, RACE_VAMPIRE},
670 { "Shallowgrave", 25000, 120, 110, 7, 19, RACE_ZOMBIE},
671 { "Death Mask", 30000, 140, 105, 6, 12, RACE_ZOMBIE},
672 { "Asuunu the Learned", 15000, 175, 108, 4, 12, RACE_MIND_FLAYER},
673 { "Prirand the Dead", 20000, 120, 105, 6, 16, RACE_ZOMBIE},
674 { "Ronar the Iron", 25000, 120, 110, 7, 19, RACE_GOLEM},
677 { "ガリル=ガミル", 30000, 140, 105, 6, 12, RACE_ELF},
678 { "本食いローバグ", 15000, 175, 108, 4, 12, RACE_KOBOLD},
679 { "キリアリキーク", 20000, 120, 105, 6, 16, RACE_KLACKON},
680 { "静かなるリリン", 25000, 120, 110, 7, 19, RACE_DWARF},
681 { "王者イサング", 30000, 140, 105, 6, 12, RACE_HIGH_ELF},
682 { "強欲ドラフ", 10000, 175, 108, 4, 12, RACE_HUMAN},
683 { "賢者オドナー", 15000, 120, 105, 6, 16, RACE_HIGH_ELF},
684 { "中立のガンダー", 25000, 120, 110, 7, 19, RACE_DARK_ELF},
685 { "忍耐の人ロ=シャ", 30000, 140, 105, 6, 12, RACE_ELF},
686 { "ランドルフ・カーター", 15000, 175, 108, 4, 12, RACE_HUMAN},
687 { "隼サライ", 15000, 175, 108, 4, 12, RACE_HUMAN},
688 { "千里眼ボドリル", 20000, 120, 105, 6, 16, RACE_HIGH_ELF},
689 { "沈黙のヴェオロイン", 25000, 120, 110, 7, 19, RACE_ZOMBIE},
690 { "学者のヴァンシラス", 30000, 140, 105, 6, 12, RACE_MIND_FLAYER},
691 { "物書きオセイン", 15000, 175, 108, 4, 12, RACE_SKELETON},
692 { "本の虫オルヴァー", 20000, 120, 105, 6, 16, RACE_VAMPIRE},
694 { "Galil-Gamir", 30000, 140, 105, 6, 12, RACE_ELF},
695 { "Rorbag Book-Eater", 15000, 175, 108, 4, 12, RACE_KOBOLD},
696 { "Kiriarikirk", 20000, 120, 105, 6, 16, RACE_KLACKON},
697 { "Rilin the Quiet", 25000, 120, 110, 7, 19, RACE_DWARF},
698 { "Isung the Lord", 30000, 140, 105, 6, 12, RACE_HIGH_ELF},
699 { "Dolaf the Greedy", 10000, 175, 108, 4, 12, RACE_HUMAN},
700 { "Odnar the Sage", 15000, 120, 105, 6, 16, RACE_HIGH_ELF},
701 { "Gandar the Neutral", 25000, 120, 110, 7, 19, RACE_DARK_ELF},
702 { "Ro-sha the Patient", 30000, 140, 105, 6, 12, RACE_ELF},
703 { "Randolph Carter", 15000, 175, 108, 4, 12, RACE_HUMAN},
704 { "Sarai the Swift", 15000, 175, 108, 4, 12, RACE_HUMAN},
705 { "Bodril the Seer", 20000, 120, 105, 6, 16, RACE_HIGH_ELF},
706 { "Veloin the Quiet", 25000, 120, 110, 7, 19, RACE_ZOMBIE},
707 { "Vanthylas the Learned", 30000, 140, 105, 6, 12, RACE_MIND_FLAYER},
708 { "Ossein the Literate", 15000, 175, 108, 4, 12, RACE_SKELETON},
709 { "Olvar Bookworm", 20000, 120, 105, 6, 16, RACE_VAMPIRE},
716 { "博物館", 0, 100, 100, 0, 99, 99},
717 { "博物館", 0, 100, 100, 0, 99, 99},
718 { "博物館", 0, 100, 100, 0, 99, 99},
719 { "博物館", 0, 100, 100, 0, 99, 99},
720 { "博物館", 0, 100, 100, 0, 99, 99},
721 { "博物館", 0, 100, 100, 0, 99, 99},
722 { "博物館", 0, 100, 100, 0, 99, 99},
723 { "博物館", 0, 100, 100, 0, 99, 99},
724 { "博物館", 0, 100, 100, 0, 99, 99},
725 { "博物館", 0, 100, 100, 0, 99, 99},
726 { "博物館", 0, 100, 100, 0, 99, 99},
727 { "博物館", 0, 100, 100, 0, 99, 99},
728 { "博物館", 0, 100, 100, 0, 99, 99},
729 { "博物館", 0, 100, 100, 0, 99, 99},
730 { "博物館", 0, 100, 100, 0, 99, 99},
731 { "博物館", 0, 100, 100, 0, 99, 99},
732 { "博物館", 0, 100, 100, 0, 99, 99},
733 { "博物館", 0, 100, 100, 0, 99, 99},
734 { "博物館", 0, 100, 100, 0, 99, 99},
735 { "博物館", 0, 100, 100, 0, 99, 99},
736 { "博物館", 0, 100, 100, 0, 99, 99},
737 { "博物館", 0, 100, 100, 0, 99, 99},
738 { "博物館", 0, 100, 100, 0, 99, 99},
739 { "博物館", 0, 100, 100, 0, 99, 99},
740 { "博物館", 0, 100, 100, 0, 99, 99},
741 { "博物館", 0, 100, 100, 0, 99, 99},
742 { "博物館", 0, 100, 100, 0, 99, 99},
743 { "博物館", 0, 100, 100, 0, 99, 99},
744 { "博物館", 0, 100, 100, 0, 99, 99},
745 { "博物館", 0, 100, 100, 0, 99, 99},
746 { "博物館", 0, 100, 100, 0, 99, 99},
747 { "博物館", 0, 100, 100, 0, 99, 99},
749 { "Museum", 0, 100, 100, 0, 99, 99},
750 { "Museum", 0, 100, 100, 0, 99, 99},
751 { "Museum", 0, 100, 100, 0, 99, 99},
752 { "Museum", 0, 100, 100, 0, 99, 99},
753 { "Museum", 0, 100, 100, 0, 99, 99},
754 { "Museum", 0, 100, 100, 0, 99, 99},
755 { "Museum", 0, 100, 100, 0, 99, 99},
756 { "Museum", 0, 100, 100, 0, 99, 99},
757 { "Museum", 0, 100, 100, 0, 99, 99},
758 { "Museum", 0, 100, 100, 0, 99, 99},
759 { "Museum", 0, 100, 100, 0, 99, 99},
760 { "Museum", 0, 100, 100, 0, 99, 99},
761 { "Museum", 0, 100, 100, 0, 99, 99},
762 { "Museum", 0, 100, 100, 0, 99, 99},
763 { "Museum", 0, 100, 100, 0, 99, 99},
764 { "Museum", 0, 100, 100, 0, 99, 99},
765 { "Museum", 0, 100, 100, 0, 99, 99},
766 { "Museum", 0, 100, 100, 0, 99, 99},
767 { "Museum", 0, 100, 100, 0, 99, 99},
768 { "Museum", 0, 100, 100, 0, 99, 99},
769 { "Museum", 0, 100, 100, 0, 99, 99},
770 { "Museum", 0, 100, 100, 0, 99, 99},
771 { "Museum", 0, 100, 100, 0, 99, 99},
772 { "Museum", 0, 100, 100, 0, 99, 99},
773 { "Museum", 0, 100, 100, 0, 99, 99},
774 { "Museum", 0, 100, 100, 0, 99, 99},
775 { "Museum", 0, 100, 100, 0, 99, 99},
776 { "Museum", 0, 100, 100, 0, 99, 99},
777 { "Museum", 0, 100, 100, 0, 99, 99},
778 { "Museum", 0, 100, 100, 0, 99, 99},
779 { "Museum", 0, 100, 100, 0, 99, 99},
780 { "Museum", 0, 100, 100, 0, 99, 99},
787 static int cur_store_num = 0;
788 static int store_top = 0;
789 static int store_bottom = 0;
790 static int xtra_stock = 0;
791 static store_type *st_ptr = NULL;
792 static const owner_type *ot_ptr = NULL;
793 static s16b old_town_num = 0;
794 static s16b inner_town_num = 0;
795 #define RUMOR_CHANCE 8
797 #define MAX_COMMENT_1 6
799 static concptr comment_1[MAX_COMMENT_1] =
820 /*! ブラックマーケット追加メッセージ(承諾) */
821 static concptr comment_1_B[MAX_COMMENT_1] = {
830 #define MAX_COMMENT_2A 2
832 static concptr comment_2a[MAX_COMMENT_2A] =
835 "私の忍耐力を試しているのかい? $%s が最後だ。",
836 "我慢にも限度があるぞ。 $%s が最後だ。"
838 "You try my patience. %s is final.",
839 "My patience grows thin. %s is final."
844 #define MAX_COMMENT_2B 12
846 static concptr comment_2b[MAX_COMMENT_2B] =
849 " $%s ぐらいは出さなきゃダメだよ。",
852 "何て奴だ! $%s 以下はあり得ないぞ。",
853 "それじゃ少なすぎる! $%s は欲しいところだ。",
854 "バカにしている! $%s はもらわないと。",
856 "おいおい! $%s を考えてくれないか?",
857 "1000匹のオークのノミに苦しめられるがいい! $%s だ。",
858 "お前の大切なものに災いあれ! $%s でどうだ。",
859 "モルゴスに賞味されるがいい!本当は $%s なんだろう?",
860 "お前の母親はオーガか! $%s は出すつもりなんだろ?"
862 "I can take no less than %s gold pieces.",
863 "I will accept no less than %s gold pieces.",
864 "Ha! No less than %s gold pieces.",
865 "You knave! No less than %s gold pieces.",
866 "That's a pittance! I want %s gold pieces.",
867 "That's an insult! I want %s gold pieces.",
868 "As if! How about %s gold pieces?",
869 "My arse! How about %s gold pieces?",
870 "May the fleas of 1000 orcs molest you! Try %s gold pieces.",
871 "May your most favourite parts go moldy! Try %s gold pieces.",
872 "May Morgoth find you tasty! Perhaps %s gold pieces?",
873 "Your mother was an Ogre! Perhaps %s gold pieces?"
879 /*! ブラックマーケット用追加メッセージ(売るとき) */
880 static concptr comment_2b_B[MAX_COMMENT_2B] = {
881 "いくら俺様がお人好しとはいえ $%s が限界だね。嫌なら帰りな。",
882 "金がないのかい、あんた?まずは家に帰って $%s 揃えてきな。",
883 "物の価値が分からん奴だな。これは $%s が普通なんだよ。",
884 "俺の付けた値段に文句があるのか? $%s が限界だ。",
885 "ひょっとして新手の冗談かい? $%s 持ってないなら帰りな。",
886 "うちは他の店とは違うんだよ。$%s ぐらいは出しな。",
887 "買う気がないなら帰りな。 $%s だと言っているんだ。",
888 "話にならないね。 $%s くらい持っているんだろ?",
889 "は?なんだそりゃ? $%s の間違いか、ひょっとして?",
890 "出口はあっちだよ。それとも $%s 出せるのかい、あんたに。",
891 "命知らずな奴だな。 $%s 出せば今日の所は勘弁してやるよ。",
892 "うちの店は貧乏人お断りだ。 $%s ぐらい出せないのかい?"
895 #define MAX_COMMENT_3A 2
897 static concptr comment_3a[MAX_COMMENT_3A] =
900 "私の忍耐力を試しているのかい? $%s が最後だ。",
901 "我慢にも限度があるぞ。 $%s が最後だ。"
903 "You try my patience. %s is final.",
904 "My patience grows thin. %s is final."
910 #define MAX_COMMENT_3B 12
912 static concptr comment_3b[MAX_COMMENT_3B] =
915 "本音を言うと $%s でいいんだろ?",
917 " $%s ぐらいなら出してもいいが。",
918 " $%s 以上払うなんて考えられないね。",
919 "まあ落ちついて。 $%s でどうだい?",
920 "そのガラクタなら $%s で引き取るよ。",
921 "それじゃ高すぎる! $%s がいいとこだろ。",
922 "どうせいらないんだろ! $%s でいいだろ?",
923 "だめだめ! $%s がずっとお似合いだよ。",
924 "バカにしている! $%s がせいぜいだ。",
925 " $%s なら嬉しいところだがなあ。",
926 " $%s 、それ以上はビタ一文出さないよ!"
928 "Perhaps %s gold pieces?",
929 "How about %s gold pieces?",
930 "I will pay no more than %s gold pieces.",
931 "I can afford no more than %s gold pieces.",
932 "Be reasonable. How about %s gold pieces?",
933 "I'll buy it as scrap for %s gold pieces.",
934 "That is too much! How about %s gold pieces?",
935 "That looks war surplus! Say %s gold pieces?",
936 "Never! %s is more like it.",
937 "That's an insult! %s is more like it.",
938 "%s gold pieces and be thankful for it!",
939 "%s gold pieces and not a copper more!"
945 /*! ブラックマーケット用追加メッセージ(買い取り) */
946 static concptr comment_3b_B[MAX_COMMENT_3B] = {
947 " $%s ってところだね。そのどうしようもないガラクタは。",
948 "この俺が $%s って言っているんだから、その通りにした方が身のためだぞ。",
949 "俺の優しさに甘えるのもいい加減にしておけ。 $%s だ。",
950 "その品なら $%s で売ってくれているがね、常識ある紳士はみんな。",
951 "こりゃまた、がめつい奴だな。いくら俺が温厚とはいえ $%s が限界だ。",
952 " $%s だ。別に俺はそんなガラクタ欲しくはないんだから。",
953 "俺の鑑定額が気に入らないのか? $%s 、嫌なら帰りな。",
954 " $%s で引き取ってやるよ。喜んで受け取りな、貧乏人。",
955 "物の価値が分からん奴は始末におえんな。それは $%s なんだよ。",
956 "そんなに金が欲しいのか、あんた? $%s で満足できんのか?",
957 "入る店間違えてんじゃないのか? $%s で嫌なら他をあたってくれ。",
958 "俺の言い値にケチをつける奴がいるとは! その度胸に免じて $%s だ。"
961 #define MAX_COMMENT_4A 4
963 static concptr comment_4a[MAX_COMMENT_4A] =
966 "もうたくさんだ!何度も私をわずらわせないでくれ!",
967 "うがー!一日の我慢の限度を超えている!",
968 "もういい!時間の無駄以外のなにものでもない!",
969 "もうやってられないよ!顔も見たくない!"
971 "Enough! You have abused me once too often!",
972 "Arghhh! I have had enough abuse for one day!",
973 "That does it! You shall waste my time no more!",
974 "This is getting nowhere! I'm going to Londis!"
980 /*! ブラックマーケット用追加メッセージ(怒りの頂点) */
981 static concptr comment_4a_B[MAX_COMMENT_4A] = {
982 "なめやがって!温厚な俺様でも限界があるってことを知れ!",
983 "俺をここまで怒らせて...命があるだけでもありがたいと思え!",
984 "ふざけてるのか!冷やかしなら相手を見てからにしろ!",
985 "いいかげんにしろ!今度こんなまねしたらただじゃおかねえぞ!"
988 #define MAX_COMMENT_4B 4
990 static concptr comment_4b[MAX_COMMENT_4B] =
999 "Get out of my sight!",
1000 "Begone, you scoundrel!",
1007 /*! ブラックマーケット用追加メッセージ(追い出し) */
1008 static concptr comment_4b_B[MAX_COMMENT_4B] = {
1015 #define MAX_COMMENT_5 8
1017 static concptr comment_5[MAX_COMMENT_5] =
1031 "You will have to do better than that!",
1032 "Do you wish to do business or not?",
1033 "You've got to be kidding!",
1034 "You'd better be kidding!",
1035 "You try my patience.",
1036 "Hmmm, nice weather we're having."
1042 /*! ブラックマーケット用追加メッセージ(怒り) */
1043 static concptr comment_5_B[MAX_COMMENT_5] = {
1054 #define MAX_COMMENT_6 4
1056 static concptr comment_6[MAX_COMMENT_6] =
1064 "I must have heard you wrong.",
1065 "I'm sorry, I missed that.",
1066 "I'm sorry, what was that?",
1067 "Sorry, what was that again?"
1072 /*** Initialize others ***/
1075 * 店舗で販売するオブジェクトを定義する / Hack -- Objects sold in the stores -- by tval/sval pair.
1077 byte store_table[MAX_STORES][STORE_CHOICES][2] =
1082 { TV_FOOD, SV_FOOD_RATION },
1083 { TV_FOOD, SV_FOOD_RATION },
1084 { TV_FOOD, SV_FOOD_RATION },
1085 { TV_FOOD, SV_FOOD_RATION },
1087 { TV_FOOD, SV_FOOD_RATION },
1088 { TV_FOOD, SV_FOOD_BISCUIT },
1089 { TV_FOOD, SV_FOOD_JERKY },
1090 { TV_FOOD, SV_FOOD_JERKY },
1092 { TV_FOOD, SV_FOOD_PINT_OF_WINE },
1093 { TV_FOOD, SV_FOOD_PINT_OF_ALE },
1094 { TV_LITE, SV_LITE_TORCH },
1095 { TV_LITE, SV_LITE_TORCH },
1097 { TV_LITE, SV_LITE_TORCH },
1098 { TV_LITE, SV_LITE_TORCH },
1099 { TV_LITE, SV_LITE_LANTERN },
1100 { TV_LITE, SV_LITE_LANTERN },
1112 { TV_SHOT, SV_AMMO_NORMAL },
1113 { TV_ARROW, SV_AMMO_NORMAL },
1114 { TV_BOLT, SV_AMMO_NORMAL },
1115 { TV_DIGGING, SV_SHOVEL },
1117 { TV_DIGGING, SV_PICK },
1118 { TV_CLOAK, SV_CLOAK },
1119 { TV_CLOAK, SV_CLOAK },
1120 { TV_CLOAK, SV_FUR_CLOAK },
1122 { TV_FOOD, SV_FOOD_RATION },
1123 { TV_FOOD, SV_FOOD_RATION },
1124 { TV_FOOD, SV_FOOD_RATION },
1125 { TV_FOOD, SV_FOOD_RATION },
1127 { TV_POTION, SV_POTION_WATER },
1128 { TV_POTION, SV_POTION_WATER },
1129 { TV_LITE, SV_LITE_LANTERN },
1130 { TV_LITE, SV_LITE_LANTERN },
1132 { TV_FOOD, SV_FOOD_WAYBREAD },
1133 { TV_FOOD, SV_FOOD_WAYBREAD },
1137 { TV_SHOT, SV_AMMO_NORMAL },
1138 { TV_ARROW, SV_AMMO_NORMAL },
1139 { TV_BOLT, SV_AMMO_NORMAL },
1140 { TV_DIGGING, SV_SHOVEL }
1146 { TV_BOOTS, SV_PAIR_OF_SOFT_LEATHER_BOOTS },
1147 { TV_BOOTS, SV_PAIR_OF_SOFT_LEATHER_BOOTS },
1148 { TV_BOOTS, SV_PAIR_OF_HARD_LEATHER_BOOTS },
1149 { TV_BOOTS, SV_PAIR_OF_HARD_LEATHER_BOOTS },
1151 { TV_HELM, SV_HARD_LEATHER_CAP },
1152 { TV_HELM, SV_HARD_LEATHER_CAP },
1153 { TV_HELM, SV_METAL_CAP },
1154 { TV_HELM, SV_IRON_HELM },
1156 { TV_SOFT_ARMOR, SV_ROBE },
1157 { TV_SOFT_ARMOR, SV_ROBE },
1158 { TV_SOFT_ARMOR, SV_SOFT_LEATHER_ARMOR },
1159 { TV_SOFT_ARMOR, SV_SOFT_LEATHER_ARMOR },
1161 { TV_SOFT_ARMOR, SV_HARD_LEATHER_ARMOR },
1162 { TV_SOFT_ARMOR, SV_HARD_LEATHER_ARMOR },
1163 { TV_SOFT_ARMOR, SV_HARD_STUDDED_LEATHER },
1164 { TV_SOFT_ARMOR, SV_HARD_STUDDED_LEATHER },
1166 { TV_SOFT_ARMOR, SV_RHINO_HIDE_ARMOR },
1167 { TV_SOFT_ARMOR, SV_LEATHER_SCALE_MAIL },
1168 { TV_HARD_ARMOR, SV_METAL_SCALE_MAIL },
1169 { TV_HARD_ARMOR, SV_CHAIN_MAIL },
1171 { TV_HARD_ARMOR, SV_DOUBLE_RING_MAIL },
1172 { TV_HARD_ARMOR, SV_AUGMENTED_CHAIN_MAIL },
1173 { TV_HARD_ARMOR, SV_BAR_CHAIN_MAIL },
1174 { TV_HARD_ARMOR, SV_DOUBLE_CHAIN_MAIL },
1176 { TV_HARD_ARMOR, SV_METAL_BRIGANDINE_ARMOUR },
1177 { TV_HARD_ARMOR, SV_SPLINT_MAIL },
1178 { TV_GLOVES, SV_SET_OF_LEATHER_GLOVES },
1179 { TV_GLOVES, SV_SET_OF_LEATHER_GLOVES },
1181 { TV_GLOVES, SV_SET_OF_GAUNTLETS },
1182 { TV_SHIELD, SV_SMALL_LEATHER_SHIELD },
1183 { TV_SHIELD, SV_LARGE_LEATHER_SHIELD },
1184 { TV_SHIELD, SV_SMALL_METAL_SHIELD },
1186 { TV_BOOTS, SV_PAIR_OF_HARD_LEATHER_BOOTS },
1187 { TV_BOOTS, SV_PAIR_OF_HARD_LEATHER_BOOTS },
1188 { TV_HELM, SV_HARD_LEATHER_CAP },
1189 { TV_HELM, SV_HARD_LEATHER_CAP },
1191 { TV_SOFT_ARMOR, SV_ROBE },
1192 { TV_SOFT_ARMOR, SV_SOFT_LEATHER_ARMOR },
1193 { TV_SOFT_ARMOR, SV_SOFT_LEATHER_ARMOR },
1194 { TV_SOFT_ARMOR, SV_HARD_LEATHER_ARMOR },
1196 { TV_SOFT_ARMOR, SV_LEATHER_JACK },
1197 { TV_HARD_ARMOR, SV_METAL_SCALE_MAIL },
1198 { TV_HARD_ARMOR, SV_CHAIN_MAIL },
1199 { TV_HARD_ARMOR, SV_CHAIN_MAIL },
1201 { TV_GLOVES, SV_SET_OF_LEATHER_GLOVES },
1202 { TV_GLOVES, SV_SET_OF_GAUNTLETS },
1203 { TV_SHIELD, SV_SMALL_LEATHER_SHIELD },
1204 { TV_SHIELD, SV_SMALL_LEATHER_SHIELD }
1210 { TV_SWORD, SV_DAGGER },
1211 { TV_SWORD, SV_MAIN_GAUCHE },
1212 { TV_SWORD, SV_RAPIER },
1213 { TV_SWORD, SV_SMALL_SWORD },
1215 { TV_SWORD, SV_SHORT_SWORD },
1216 { TV_SWORD, SV_SABRE },
1217 { TV_SWORD, SV_CUTLASS },
1218 { TV_SWORD, SV_TULWAR },
1220 { TV_SWORD, SV_BROAD_SWORD },
1221 { TV_SWORD, SV_LONG_SWORD },
1222 { TV_SWORD, SV_SCIMITAR },
1223 { TV_SWORD, SV_KATANA },
1225 { TV_SWORD, SV_BASTARD_SWORD },
1226 { TV_POLEARM, SV_SPEAR },
1227 { TV_POLEARM, SV_AWL_PIKE },
1228 { TV_POLEARM, SV_TRIDENT },
1230 { TV_POLEARM, SV_PIKE },
1231 { TV_POLEARM, SV_BEAKED_AXE },
1232 { TV_POLEARM, SV_BROAD_AXE },
1233 { TV_POLEARM, SV_LANCE },
1235 { TV_POLEARM, SV_BATTLE_AXE },
1236 { TV_POLEARM, SV_HATCHET },
1237 { TV_BOW, SV_SLING },
1238 { TV_BOW, SV_SHORT_BOW },
1240 { TV_BOW, SV_LIGHT_XBOW },
1241 { TV_SHOT, SV_AMMO_NORMAL },
1242 { TV_SHOT, SV_AMMO_NORMAL },
1243 { TV_ARROW, SV_AMMO_NORMAL },
1245 { TV_ARROW, SV_AMMO_NORMAL },
1246 { TV_BOLT, SV_AMMO_NORMAL },
1247 { TV_BOLT, SV_AMMO_NORMAL },
1248 { TV_BOW, SV_LIGHT_XBOW },
1250 { TV_ARROW, SV_AMMO_NORMAL },
1251 { TV_BOLT, SV_AMMO_NORMAL },
1252 { TV_BOW, SV_SHORT_BOW },
1253 { TV_BOW, SV_LIGHT_XBOW },
1255 { TV_SWORD, SV_DAGGER },
1256 { TV_SWORD, SV_TANTO },
1257 { TV_SWORD, SV_RAPIER },
1258 { TV_SWORD, SV_SMALL_SWORD },
1260 { TV_SWORD, SV_SHORT_SWORD },
1261 { TV_SWORD, SV_LONG_SWORD },
1262 { TV_SWORD, SV_SCIMITAR },
1263 { TV_SWORD, SV_BROAD_SWORD },
1265 { TV_HISSATSU_BOOK, 0 },
1266 { TV_HISSATSU_BOOK, 0 },
1267 { TV_HISSATSU_BOOK, 1 },
1268 { TV_HISSATSU_BOOK, 1 },
1274 { TV_HAFTED, SV_NUNCHAKU },
1275 { TV_HAFTED, SV_QUARTERSTAFF },
1276 { TV_HAFTED, SV_MACE },
1277 { TV_HAFTED, SV_BO_STAFF },
1279 { TV_HAFTED, SV_WAR_HAMMER },
1280 { TV_HAFTED, SV_WAR_HAMMER },
1281 { TV_HAFTED, SV_MORNING_STAR },
1282 { TV_HAFTED, SV_FLAIL },
1284 { TV_HAFTED, SV_LEAD_FILLED_MACE },
1285 { TV_SCROLL, SV_SCROLL_REMOVE_CURSE },
1286 { TV_SCROLL, SV_SCROLL_BLESSING },
1287 { TV_SCROLL, SV_SCROLL_HOLY_CHANT },
1289 { TV_POTION, SV_POTION_HEROISM },
1290 { TV_SCROLL, SV_SCROLL_WORD_OF_RECALL },
1291 { TV_SCROLL, SV_SCROLL_WORD_OF_RECALL },
1292 { TV_SCROLL, SV_SCROLL_WORD_OF_RECALL },
1294 { TV_POTION, SV_POTION_CURE_LIGHT },
1295 { TV_POTION, SV_POTION_CURE_SERIOUS },
1296 { TV_POTION, SV_POTION_CURE_SERIOUS },
1297 { TV_POTION, SV_POTION_CURE_CRITICAL },
1299 { TV_POTION, SV_POTION_CURE_CRITICAL },
1300 { TV_POTION, SV_POTION_RESTORE_EXP },
1301 { TV_POTION, SV_POTION_RESTORE_EXP },
1302 { TV_POTION, SV_POTION_RESTORE_EXP },
1304 { TV_LIFE_BOOK, 0 },
1305 { TV_LIFE_BOOK, 0 },
1306 { TV_LIFE_BOOK, 1 },
1307 { TV_LIFE_BOOK, 1 },
1309 { TV_CRUSADE_BOOK, 0 },
1310 { TV_CRUSADE_BOOK, 0 },
1311 { TV_CRUSADE_BOOK, 1 },
1312 { TV_CRUSADE_BOOK, 1 },
1314 { TV_HAFTED, SV_WHIP },
1315 { TV_HAFTED, SV_MACE },
1316 { TV_HAFTED, SV_BALL_AND_CHAIN },
1317 { TV_HAFTED, SV_WAR_HAMMER },
1319 { TV_SCROLL, SV_SCROLL_WORD_OF_RECALL },
1320 { TV_SCROLL, SV_SCROLL_WORD_OF_RECALL },
1321 { TV_SCROLL, SV_SCROLL_WORD_OF_RECALL },
1322 { TV_POTION, SV_POTION_CURE_CRITICAL },
1324 { TV_POTION, SV_POTION_CURE_CRITICAL },
1325 { TV_POTION, SV_POTION_RESTORE_EXP },
1328 { TV_STATUE, SV_ANY },
1330 { TV_SCROLL, SV_SCROLL_REMOVE_CURSE },
1331 { TV_SCROLL, SV_SCROLL_REMOVE_CURSE },
1332 { TV_SCROLL, SV_SCROLL_STAR_REMOVE_CURSE },
1333 { TV_SCROLL, SV_SCROLL_STAR_REMOVE_CURSE }
1339 { TV_SCROLL, SV_SCROLL_ENCHANT_WEAPON_TO_HIT },
1340 { TV_SCROLL, SV_SCROLL_ENCHANT_WEAPON_TO_DAM },
1341 { TV_SCROLL, SV_SCROLL_ENCHANT_ARMOR },
1342 { TV_SCROLL, SV_SCROLL_IDENTIFY },
1344 { TV_SCROLL, SV_SCROLL_IDENTIFY },
1345 { TV_SCROLL, SV_SCROLL_IDENTIFY },
1346 { TV_SCROLL, SV_SCROLL_IDENTIFY },
1347 { TV_SCROLL, SV_SCROLL_LIGHT },
1349 { TV_SCROLL, SV_SCROLL_PHASE_DOOR },
1350 { TV_SCROLL, SV_SCROLL_PHASE_DOOR },
1351 { TV_SCROLL, SV_SCROLL_TELEPORT },
1352 { TV_SCROLL, SV_SCROLL_MONSTER_CONFUSION },
1354 { TV_SCROLL, SV_SCROLL_MAPPING },
1355 { TV_SCROLL, SV_SCROLL_DETECT_GOLD },
1356 { TV_SCROLL, SV_SCROLL_DETECT_ITEM },
1357 { TV_SCROLL, SV_SCROLL_DETECT_TRAP },
1359 { TV_SCROLL, SV_SCROLL_DETECT_INVIS },
1360 { TV_SCROLL, SV_SCROLL_RECHARGING },
1361 { TV_SCROLL, SV_SCROLL_TELEPORT },
1362 { TV_SCROLL, SV_SCROLL_WORD_OF_RECALL },
1364 { TV_SCROLL, SV_SCROLL_WORD_OF_RECALL },
1365 { TV_SCROLL, SV_SCROLL_WORD_OF_RECALL },
1366 { TV_SCROLL, SV_SCROLL_WORD_OF_RECALL },
1367 { TV_SCROLL, SV_SCROLL_TELEPORT },
1369 { TV_SCROLL, SV_SCROLL_TELEPORT },
1370 { TV_POTION, SV_POTION_RES_STR },
1371 { TV_POTION, SV_POTION_RES_INT },
1372 { TV_POTION, SV_POTION_RES_WIS },
1374 { TV_POTION, SV_POTION_RES_DEX },
1375 { TV_POTION, SV_POTION_RES_CON },
1376 { TV_POTION, SV_POTION_RES_CHR },
1377 { TV_SCROLL, SV_SCROLL_IDENTIFY },
1379 { TV_SCROLL, SV_SCROLL_IDENTIFY },
1380 { TV_SCROLL, SV_SCROLL_STAR_IDENTIFY }, /* Yep, occasionally! */
1381 { TV_SCROLL, SV_SCROLL_STAR_IDENTIFY },
1382 { TV_SCROLL, SV_SCROLL_LIGHT },
1384 { TV_POTION, SV_POTION_RES_STR },
1385 { TV_POTION, SV_POTION_RES_INT },
1386 { TV_POTION, SV_POTION_RES_WIS },
1387 { TV_POTION, SV_POTION_RES_DEX },
1389 { TV_POTION, SV_POTION_RES_CON },
1390 { TV_POTION, SV_POTION_RES_CHR },
1391 { TV_SCROLL, SV_SCROLL_ENCHANT_ARMOR },
1392 { TV_SCROLL, SV_SCROLL_ENCHANT_ARMOR },
1394 { TV_SCROLL, SV_SCROLL_RECHARGING },
1395 { TV_SCROLL, SV_SCROLL_PHASE_DOOR },
1396 { TV_SCROLL, SV_SCROLL_ENCHANT_WEAPON_TO_HIT },
1397 { TV_SCROLL, SV_SCROLL_ENCHANT_WEAPON_TO_DAM },
1402 /* Magic-User store */
1404 { TV_RING, SV_RING_PROTECTION },
1405 { TV_RING, SV_RING_LEVITATION_FALL },
1406 { TV_RING, SV_RING_PROTECTION },
1407 { TV_RING, SV_RING_RESIST_FIRE },
1409 { TV_RING, SV_RING_RESIST_COLD },
1410 { TV_AMULET, SV_AMULET_CHARISMA },
1411 { TV_RING, SV_RING_WARNING },
1412 { TV_AMULET, SV_AMULET_RESIST_ACID },
1414 { TV_AMULET, SV_AMULET_SEARCHING },
1415 { TV_WAND, SV_WAND_SLOW_MONSTER },
1416 { TV_WAND, SV_WAND_CONFUSE_MONSTER },
1417 { TV_WAND, SV_WAND_SLEEP_MONSTER },
1419 { TV_WAND, SV_WAND_MAGIC_MISSILE },
1420 { TV_WAND, SV_WAND_STINKING_CLOUD },
1421 { TV_WAND, SV_WAND_WONDER },
1422 { TV_WAND, SV_WAND_DISARMING },
1424 { TV_STAFF, SV_STAFF_LITE },
1425 { TV_STAFF, SV_STAFF_MAPPING },
1426 { TV_STAFF, SV_STAFF_DETECT_TRAP },
1427 { TV_STAFF, SV_STAFF_DETECT_DOOR },
1429 { TV_STAFF, SV_STAFF_DETECT_GOLD },
1430 { TV_STAFF, SV_STAFF_DETECT_ITEM },
1431 { TV_STAFF, SV_STAFF_DETECT_INVIS },
1432 { TV_STAFF, SV_STAFF_DETECT_EVIL },
1434 { TV_STAFF, SV_STAFF_TELEPORTATION },
1435 { TV_STAFF, SV_STAFF_TELEPORTATION },
1436 { TV_STAFF, SV_STAFF_TELEPORTATION },
1437 { TV_STAFF, SV_STAFF_TELEPORTATION },
1439 { TV_STAFF, SV_STAFF_IDENTIFY },
1440 { TV_STAFF, SV_STAFF_IDENTIFY },
1441 { TV_STAFF, SV_STAFF_IDENTIFY },
1443 { TV_STAFF, SV_STAFF_IDENTIFY },
1444 { TV_STAFF, SV_STAFF_REMOVE_CURSE },
1445 { TV_STAFF, SV_STAFF_CURE_LIGHT },
1446 { TV_STAFF, SV_STAFF_PROBING },
1450 { TV_SORCERY_BOOK, 0 },
1451 { TV_SORCERY_BOOK, 0 },
1452 { TV_SORCERY_BOOK, 1 },
1453 { TV_SORCERY_BOOK, 1 },
1455 { TV_ARCANE_BOOK, 0 },
1456 { TV_ARCANE_BOOK, 0 },
1457 { TV_ARCANE_BOOK, 1 },
1458 { TV_ARCANE_BOOK, 1 },
1460 { TV_ARCANE_BOOK, 2 },
1461 { TV_ARCANE_BOOK, 2 },
1462 { TV_ARCANE_BOOK, 3 },
1463 { TV_ARCANE_BOOK, 3 },
1468 /* Black Market (unused) */
1541 { TV_SORCERY_BOOK, 0 },
1542 { TV_SORCERY_BOOK, 0 },
1543 { TV_SORCERY_BOOK, 1 },
1544 { TV_SORCERY_BOOK, 1 },
1546 { TV_NATURE_BOOK, 0 },
1547 { TV_NATURE_BOOK, 0 },
1548 { TV_NATURE_BOOK, 1 },
1549 { TV_NATURE_BOOK, 1 },
1551 { TV_CHAOS_BOOK, 0 },
1552 { TV_CHAOS_BOOK, 0 },
1553 { TV_CHAOS_BOOK, 1 },
1554 { TV_CHAOS_BOOK, 1 },
1556 { TV_DEATH_BOOK, 0 },
1557 { TV_DEATH_BOOK, 0 },
1558 { TV_DEATH_BOOK, 1 },
1559 { TV_DEATH_BOOK, 1 },
1561 { TV_TRUMP_BOOK, 0 }, /* +16 */
1562 { TV_TRUMP_BOOK, 0 },
1563 { TV_TRUMP_BOOK, 1 },
1564 { TV_TRUMP_BOOK, 1 },
1566 { TV_ARCANE_BOOK, 0 },
1567 { TV_ARCANE_BOOK, 1 },
1568 { TV_ARCANE_BOOK, 2 },
1569 { TV_ARCANE_BOOK, 3 },
1571 { TV_CRAFT_BOOK, 0 },
1572 { TV_CRAFT_BOOK, 0 },
1573 { TV_CRAFT_BOOK, 1 },
1574 { TV_CRAFT_BOOK, 1 },
1576 { TV_DAEMON_BOOK, 0 },
1577 { TV_DAEMON_BOOK, 0 },
1578 { TV_DAEMON_BOOK, 1 },
1579 { TV_DAEMON_BOOK, 1 },
1581 { TV_MUSIC_BOOK, 0 },
1582 { TV_MUSIC_BOOK, 0 },
1583 { TV_MUSIC_BOOK, 1 },
1584 { TV_MUSIC_BOOK, 1 },
1593 /* Museum (unused) */
1632 * @brief 取引成功時の店主のメッセージ処理 /
1633 * Successful haggle.
1636 static void say_comment_1(void)
1639 /* ブラックマーケットのときは別のメッセージを出す */
1640 if ( cur_store_num == STORE_BLACK ) {
1641 msg_print(comment_1_B[randint0(MAX_COMMENT_1)]);
1644 msg_print(comment_1[randint0(MAX_COMMENT_1)]);
1647 msg_print(comment_1[randint0(MAX_COMMENT_1)]);
1651 if (one_in_(RUMOR_CHANCE))
1654 msg_print("店主は耳うちした:");
1656 msg_print("The shopkeeper whispers something into your ear:");
1658 display_rumor(TRUE);
1664 * @brief プレイヤーがアイテムを買う時の価格代案メッセージ処理 /
1665 * Continue haggling (player is buying)
1666 * @param value 店主の提示価格
1667 * @param annoyed 店主のいらつき度
1670 static void say_comment_2(PRICE value, int annoyed)
1674 /* Prepare a string to insert */
1675 sprintf(tmp_val, "%ld", (long)value);
1680 /* Formatted message */
1681 msg_format(comment_2a[randint0(MAX_COMMENT_2A)], tmp_val);
1687 /* Formatted message */
1689 /* ブラックマーケットの時は別のメッセージを出す */
1690 if ( cur_store_num == STORE_BLACK ){
1691 msg_format(comment_2b_B[randint0(MAX_COMMENT_2B)], tmp_val);
1694 msg_format(comment_2b[randint0(MAX_COMMENT_2B)], tmp_val);
1697 msg_format(comment_2b[randint0(MAX_COMMENT_2B)], tmp_val);
1705 * @brief プレイヤーがアイテムを売る時の価格代案メッセージ処理 /
1706 * Continue haggling (player is selling)
1707 * @param value 店主の提示価格
1708 * @param annoyed 店主のいらつき度
1711 static void say_comment_3(PRICE value, int annoyed)
1715 /* Prepare a string to insert */
1716 sprintf(tmp_val, "%ld", (long)value);
1721 /* Formatted message */
1722 msg_format(comment_3a[randint0(MAX_COMMENT_3A)], tmp_val);
1728 /* Formatted message */
1730 /* ブラックマーケットの時は別のメッセージを出す */
1731 if ( cur_store_num == STORE_BLACK ){
1732 msg_format(comment_3b_B[randint0(MAX_COMMENT_3B)], tmp_val);
1735 msg_format(comment_3b[randint0(MAX_COMMENT_3B)], tmp_val);
1738 msg_format(comment_3b[randint0(MAX_COMMENT_3B)], tmp_val);
1746 * @brief 店主がプレイヤーを追い出す時のメッセージ処理 /
1747 * Kick 'da bum out. -RAK-
1750 static void say_comment_4(void)
1753 /* ブラックマーケットの時は別のメッセージを出す */
1754 if ( cur_store_num == STORE_BLACK ){
1755 msg_print(comment_4a_B[randint0(MAX_COMMENT_4A)]);
1756 msg_print(comment_4b_B[randint0(MAX_COMMENT_4B)]);
1759 msg_print(comment_4a[randint0(MAX_COMMENT_4A)]);
1760 msg_print(comment_4b[randint0(MAX_COMMENT_4B)]);
1763 msg_print(comment_4a[randint0(MAX_COMMENT_4A)]);
1764 msg_print(comment_4b[randint0(MAX_COMMENT_4B)]);
1771 * @brief 店主がプレイヤーに取り合わない時のメッセージ処理 /
1772 * You are insulting me
1775 static void say_comment_5(void)
1778 /* ブラックマーケットの時は別のメッセージを出す */
1779 if ( cur_store_num == STORE_BLACK ){
1780 msg_print(comment_5_B[randint0(MAX_COMMENT_5)]);
1783 msg_print(comment_5[randint0(MAX_COMMENT_5)]);
1786 msg_print(comment_5[randint0(MAX_COMMENT_5)]);
1793 * @brief 店主がプレイヤーの提示を理解できなかった時のメッセージ処理 /
1794 * That makes no sense.
1797 static void say_comment_6(void)
1799 msg_print(comment_6[randint0(MAX_COMMENT_6)]);
1803 #define MAX_COMMENT_7A 4
1805 static concptr comment_7a[MAX_COMMENT_7A] =
1810 "誰かがむせび泣く声が聞こえる...。",
1815 "You hear someone sobbing...",
1816 "The shopkeeper howls in agony!"
1821 #define MAX_COMMENT_7B 4
1823 static concptr comment_7b[MAX_COMMENT_7B] =
1833 "The shopkeeper curses at you.",
1834 "The shopkeeper glares at you."
1839 #define MAX_COMMENT_7C 4
1841 static concptr comment_7c[MAX_COMMENT_7C] =
1850 "You've made my day!",
1851 "The shopkeeper giggles.",
1852 "The shopkeeper laughs loudly."
1857 #define MAX_COMMENT_7D 4
1859 static concptr comment_7d[MAX_COMMENT_7D] =
1863 "こんなおいしい思いをしたら、真面目に働けなくなるなぁ。",
1868 "I think I'll retire!",
1869 "The shopkeeper jumps for joy.",
1870 "The shopkeeper smiles gleefully."
1877 * @brief 店主が交渉を終えた際の反応を返す処理 /
1878 * Let a shop-keeper React to a purchase
1879 * @param price アイテムの取引額
1880 * @param value アイテムの実際価値
1881 * @param guess 店主が当初予想していた価値
1884 * We paid "price", it was worth "value", and we thought it was worth "guess"
1886 static void purchase_analyze(PRICE price, PRICE value, PRICE guess)
1888 /* Item was worthless, but we bought it */
1889 if ((value <= 0) && (price > value))
1891 msg_print(comment_7a[randint0(MAX_COMMENT_7A)]);
1892 chg_virtue(V_HONOUR, -1);
1893 chg_virtue(V_JUSTICE, -1);
1894 sound(SOUND_STORE1);
1897 /* Item was cheaper than we thought, and we paid more than necessary */
1898 else if ((value < guess) && (price > value))
1900 msg_print(comment_7b[randint0(MAX_COMMENT_7B)]);
1901 chg_virtue(V_JUSTICE, -1);
1902 if (one_in_(4)) chg_virtue(V_HONOUR, -1);
1903 sound(SOUND_STORE2);
1906 /* Item was a good bargain, and we got away with it */
1907 else if ((value > guess) && (value < (4 * guess)) && (price < value))
1909 msg_print(comment_7c[randint0(MAX_COMMENT_7C)]);
1910 if (one_in_(4)) chg_virtue(V_HONOUR, -1);
1911 else if (one_in_(4)) chg_virtue(V_HONOUR, 1);
1912 sound(SOUND_STORE3);
1915 /* Item was a great bargain, and we got away with it */
1916 else if ((value > guess) && (price < value))
1918 msg_print(comment_7d[randint0(MAX_COMMENT_7D)]);
1919 if (one_in_(2)) chg_virtue(V_HONOUR, -1);
1920 if (one_in_(4)) chg_virtue(V_HONOUR, 1);
1921 if (10 * price < value) chg_virtue(V_SACRIFICE, 1);
1922 sound(SOUND_STORE4);
1929 * We store the current "store feat" here so everyone can access it
1931 static int cur_store_feat;
1935 * Buying and selling adjustments for race combinations.
1936 * Entry[owner][player] gives the basic "cost inflation".
1938 static byte rgold_adj[MAX_RACES][MAX_RACES] =
1940 /*Hum, HfE, Elf, Hal, Gno, Dwa, HfO, HfT, Dun, HiE, Barbarian,
1941 HfOg, HGn, HTn, Cyc, Yek, Klc, Kbd, Nbl, DkE, Drc, Mind Flayer,
1942 Imp, Glm, Skl, Zombie, Vampire, Spectre, Fairy, Beastman, Ent,
1943 Angel, Demon, Kutar, Android, Merfolk */
1946 { 100, 105, 105, 110, 113, 115, 120, 125, 100, 105, 100,
1947 124, 120, 110, 125, 115, 120, 120, 120, 120, 115, 120,
1948 115, 105, 125, 125, 125, 125, 105, 120, 105, 95, 140,
1949 100, 120, 110, 105, 110 },
1952 { 110, 100, 100, 105, 110, 120, 125, 130, 110, 100, 110,
1953 120, 115, 108, 115, 110, 110, 120, 120, 115, 115, 110,
1954 120, 110, 110, 110, 120, 110, 100, 125, 100, 95, 140,
1955 110, 115, 110, 110, 110 },
1958 { 110, 105, 100, 105, 110, 120, 125, 130, 110, 100, 110,
1959 120, 120, 105, 120, 110, 105, 125, 125, 110, 115, 108,
1960 120, 115, 110, 110, 120, 110, 100, 125, 100, 95, 140,
1961 110, 110, 105, 110, 110 },
1964 { 115, 110, 105, 95, 105, 110, 115, 130, 115, 105, 115,
1965 125, 120, 120, 125, 115, 110, 120, 120, 120, 115, 115,
1966 120, 110, 120, 120, 130, 110, 110, 130, 110, 95, 140,
1967 115, 120, 105, 115, 105 },
1970 { 115, 115, 110, 105, 95, 110, 115, 130, 115, 110, 115,
1971 120, 125, 110, 120, 110, 105, 120, 110, 110, 105, 110,
1972 120, 101, 110, 110, 120, 120, 115, 130, 115, 95, 140,
1973 115, 110, 110, 115, 110 },
1976 { 115, 120, 120, 110, 110, 95, 125, 135, 115, 120, 115,
1977 125, 140, 130, 130, 120, 115, 115, 115, 135, 125, 120,
1978 120, 105, 115, 115, 115, 115, 120, 130, 120, 95, 140,
1979 115, 110, 115, 115, 120 },
1982 { 115, 120, 125, 115, 115, 130, 110, 115, 115, 125, 115,
1983 110, 110, 120, 110, 120, 125, 115, 115, 110, 120, 110,
1984 115, 125, 120, 120, 115, 120, 125, 115, 125, 95, 140,
1985 115, 110, 115, 115, 125 },
1988 { 110, 115, 115, 110, 110, 130, 110, 110, 110, 115, 110,
1989 110, 115, 120, 110, 120, 120, 110, 110, 110, 115, 110,
1990 110, 115, 112, 112, 115, 112, 120, 110, 120, 95, 140,
1991 110, 110, 115, 110, 130 },
1994 { 100, 105, 105, 110, 113, 115, 120, 125, 100, 105, 100,
1995 120, 120, 105, 120, 115, 105, 115, 120, 110, 105, 105,
1996 120, 105, 120, 120, 125, 120, 105, 135, 105, 95, 140,
1997 100, 110, 110, 100, 110 },
2000 { 110, 105, 100, 105, 110, 120, 125, 130, 110, 100, 110,
2001 125, 125, 101, 120, 115, 110, 115, 125, 110, 110, 110,
2002 125, 115, 120, 120, 125, 120, 100, 125, 100, 95, 140,
2003 110, 110, 105, 110, 110 },
2005 /* Human / Barbarian (copied from human) */
2006 { 100, 105, 105, 110, 113, 115, 120, 125, 100, 105, 100,
2007 124, 120, 110, 125, 115, 120, 120, 120, 120, 115, 120,
2008 115, 105, 125, 125, 130, 125, 115, 120, 115, 95, 140,
2009 100, 120, 110, 100, 110 },
2011 /* Half-Ogre: theoretical, copied from half-troll */
2012 { 110, 115, 115, 110, 110, 130, 110, 110, 110, 115, 110,
2013 110, 115, 120, 110, 120, 120, 110, 110, 110, 115, 110,
2014 110, 115, 112, 112, 115, 112, 120, 110, 120, 95, 140,
2015 110, 110, 115, 110, 120 },
2017 /* Half-Giant: theoretical, copied from half-troll */
2018 { 110, 115, 115, 110, 110, 130, 110, 110, 110, 115, 110,
2019 110, 115, 120, 110, 120, 120, 110, 110, 110, 115, 110,
2020 110, 115, 112, 112, 115, 112, 130, 120, 130, 95, 140,
2021 110, 110, 115, 110, 115 },
2023 /* Half-Titan: theoretical, copied from High_Elf */
2024 { 110, 105, 100, 105, 110, 120, 125, 130, 110, 100, 110,
2025 125, 125, 101, 120, 115, 110, 115, 125, 110, 110, 110,
2026 125, 115, 120, 120, 120, 120, 130, 130, 130, 95, 140,
2027 110, 110, 115, 110, 108 },
2029 /* Cyclops: theoretical, copied from half-troll */
2030 { 110, 115, 115, 110, 110, 130, 110, 110, 110, 115, 110,
2031 110, 115, 120, 110, 120, 120, 110, 110, 110, 115, 110,
2032 110, 115, 112, 112, 115, 112, 130, 130, 130, 95, 140,
2033 110, 110, 115, 110, 115 },
2035 /* Yeek: theoretical, copied from Half-Orc */
2036 { 115, 120, 125, 115, 115, 130, 110, 115, 115, 125, 115,
2037 110, 110, 120, 110, 120, 125, 115, 115, 110, 120, 110,
2038 115, 125, 120, 120, 120, 120, 130, 130, 130, 95, 140,
2039 115, 110, 115, 115, 110 },
2041 /* Klackon: theoretical, copied from Gnome */
2042 { 115, 115, 110, 105, 95, 110, 115, 130, 115, 110, 115,
2043 120, 125, 110, 120, 110, 105, 120, 110, 110, 105, 110,
2044 120, 101, 110, 110, 120, 120, 130, 130, 130, 95, 140,
2045 115, 110, 115, 115, 110 },
2047 /* Kobold: theoretical, copied from Half-Orc */
2048 { 115, 120, 125, 115, 115, 130, 110, 115, 115, 125, 115,
2049 110, 110, 120, 110, 120, 125, 115, 115, 110, 120, 110,
2050 115, 125, 120, 120, 120, 120, 130, 130, 130, 95, 140,
2051 115, 110, 115, 115, 120 },
2053 /* Nibelung: theoretical, copied from Dwarf */
2054 { 115, 120, 120, 110, 110, 95, 125, 135, 115, 120, 115,
2055 125, 140, 130, 130, 120, 115, 115, 115, 135, 125, 120,
2056 120, 105, 115, 115, 120, 120, 130, 130, 130, 95, 140,
2057 115, 135, 115, 115, 120 },
2060 { 110, 110, 110, 115, 120, 130, 115, 115, 120, 110, 115,
2061 115, 115, 116, 115, 120, 120, 115, 115, 101, 110, 110,
2062 110, 110, 112, 122, 110, 110, 110, 115, 110, 120, 120,
2063 110, 101, 115, 110, 115 },
2065 /* Draconian: theoretical, copied from High_Elf */
2066 { 110, 105, 100, 105, 110, 120, 125, 130, 110, 100, 110,
2067 125, 125, 101, 120, 115, 110, 115, 125, 110, 110, 110,
2068 125, 115, 120, 120, 120, 120, 130, 130, 130, 95, 140,
2069 110, 110, 115, 110, 115 },
2071 /* Mind Flayer: theoretical, copied from High_Elf */
2072 { 110, 105, 100, 105, 110, 120, 125, 130, 110, 100, 110,
2073 125, 125, 101, 120, 115, 110, 115, 125, 110, 110, 110,
2074 125, 115, 120, 120, 120, 120, 130, 130, 130, 95, 140,
2075 110, 110, 115, 110, 110 },
2077 /* Imp: theoretical, copied from High_Elf */
2078 { 110, 105, 100, 105, 110, 120, 125, 130, 110, 100, 110,
2079 125, 125, 101, 120, 115, 110, 115, 125, 110, 110, 110,
2080 125, 115, 120, 120, 120, 120, 130, 130, 130, 120, 120,
2081 110, 110, 115, 110, 120 },
2083 /* Golem: theoretical, copied from High_Elf */
2084 { 110, 105, 100, 105, 110, 120, 125, 130, 110, 100, 110,
2085 125, 125, 101, 120, 115, 110, 115, 125, 110, 110, 110,
2086 125, 115, 120, 120, 120, 120, 130, 130, 130, 95, 140,
2087 110, 110, 115, 110, 110 },
2089 /* Skeleton: theoretical, copied from half-orc */
2090 { 115, 120, 125, 115, 115, 130, 110, 115, 115, 125, 115,
2091 110, 110, 120, 110, 120, 125, 115, 115, 110, 120, 110,
2092 115, 125, 120, 120, 120, 120, 130, 130, 130, 120, 120,
2093 115, 110, 125, 115, 110 },
2095 /* Zombie: Theoretical, copied from half-orc */
2096 { 115, 120, 125, 115, 115, 130, 110, 115, 115, 125, 115,
2097 110, 110, 120, 110, 120, 125, 115, 115, 110, 120, 110,
2098 115, 125, 120, 120, 120, 120, 130, 130, 130, 120, 120,
2099 115, 110, 125, 115, 110 },
2101 /* Vampire: Theoretical, copied from half-orc */
2102 { 115, 120, 125, 115, 115, 130, 110, 115, 115, 125, 115,
2103 110, 110, 120, 110, 120, 125, 115, 115, 110, 120, 110,
2104 115, 125, 120, 120, 120, 120, 130, 130, 130, 120, 120,
2105 115, 110, 125, 115, 120 },
2107 /* Spectre: Theoretical, copied from half-orc */
2108 { 115, 120, 125, 115, 115, 130, 110, 115, 115, 125, 115,
2109 110, 110, 120, 110, 120, 125, 115, 115, 110, 120, 110,
2110 115, 125, 120, 120, 120, 120, 130, 130, 130, 120, 120,
2111 115, 110, 125, 115, 110 },
2113 /* Sprite: Theoretical, copied from half-orc */
2114 { 115, 120, 125, 115, 115, 130, 110, 115, 115, 125, 115,
2115 110, 110, 120, 110, 120, 125, 115, 115, 110, 120, 110,
2116 115, 125, 120, 120, 120, 120, 130, 130, 130, 95, 140,
2117 115, 110, 105, 115, 110 },
2119 /* Beastman: Theoretical, copied from half-orc */
2120 { 115, 120, 125, 115, 115, 130, 110, 115, 115, 125, 115,
2121 110, 110, 120, 110, 120, 125, 115, 115, 110, 120, 110,
2122 115, 125, 120, 120, 120, 120, 130, 130, 130, 95, 140,
2123 115, 110, 115, 115, 125 },
2126 { 110, 105, 100, 105, 110, 120, 125, 130, 110, 100, 110,
2127 120, 120, 105, 120, 110, 105, 125, 125, 110, 115, 108,
2128 120, 115, 110, 110, 120, 110, 100, 125, 100, 95, 140,
2129 110, 110, 105, 110, 110 },
2132 { 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95,
2133 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95,
2134 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 160,
2135 95, 95, 95, 95, 95 },
2138 { 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, 140,
2139 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, 140,
2140 140, 140, 140, 140, 140, 140, 140, 140, 140, 160, 120,
2141 140, 140, 140, 140, 140 },
2144 { 100, 105, 105, 110, 113, 115, 120, 125, 100, 105, 100,
2145 124, 120, 110, 125, 115, 120, 120, 120, 120, 115, 120,
2146 115, 105, 125, 125, 125, 125, 105, 120, 105, 95, 140,
2147 100, 120, 110, 100, 110 },
2150 { 110, 110, 110, 115, 120, 130, 115, 115, 120, 110, 115,
2151 115, 115, 116, 115, 120, 120, 115, 115, 101, 110, 110,
2152 110, 110, 112, 122, 110, 110, 110, 115, 110, 120, 120,
2153 110, 101, 115, 110, 115 },
2156 { 110, 110, 105, 105, 110, 115, 115, 115, 110, 105, 110,
2157 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115,
2158 115, 115, 125, 125, 125, 125, 105, 115, 105, 95, 140,
2159 110, 115, 100, 110, 110 },
2162 { 105, 105, 105, 110, 113, 115, 120, 125, 100, 105, 100,
2163 124, 120, 110, 125, 115, 120, 120, 120, 120, 115, 120,
2164 115, 105, 125, 125, 125, 125, 105, 120, 105, 95, 140,
2165 100, 120, 110, 100, 110 },
2168 { 110, 110, 110, 105, 110, 120, 125, 130, 110, 110, 110,
2169 120, 115, 108, 115, 110, 110, 120, 120, 115, 115, 110,
2170 120, 110, 110, 110, 120, 110, 110, 125, 110, 95, 140,
2171 110, 115, 110, 110, 100 },
2177 * @brief 店舗価格を決定する /
2178 * Determine the price of an item (qty one) in a store.
2179 * @param o_ptr 店舗に並べるオブジェクト構造体の参照ポインタ
2180 * @param greed 店主の強欲度
2181 * @param flip TRUEならば店主にとっての買取価格、FALSEなら売出価格を計算
2185 * This function takes into account the player's charisma, and the
2186 * shop-keepers friendliness, and the shop-keeper's base greed, but
2187 * never lets a shop-keeper lose money in a transaction.
2188 * The "greed" value should exceed 100 when the player is "buying" the
2189 * item, and should be less than 100 when the player is "selling" it.
2190 * Hack -- the black market always charges twice as much as it should.
2191 * Charisma adjustment runs from 80 to 130
2192 * Racial adjustment runs from 95 to 130
2193 * Since greed/charisma/racial adjustments are centered at 100, we need
2194 * to adjust (by 200) to extract a usable multiplier. Note that the
2195 * "greed" value is always something (?).
2198 static s32b price_item(object_type *o_ptr, int greed, bool flip)
2205 /* Get the value of one of the items */
2206 price = object_value(o_ptr);
2208 /* Worthless items */
2209 if (price <= 0) return (0L);
2212 /* Compute the racial factor */
2213 factor = rgold_adj[ot_ptr->owner_race][p_ptr->prace];
2215 /* Add in the charisma factor */
2216 factor += adj_chr_gold[p_ptr->stat_ind[A_CHR]];
2219 /* Shop is buying */
2222 /* Adjust for greed */
2223 adjust = 100 + (300 - (greed + factor));
2225 /* Never get "silly" */
2226 if (adjust > 100) adjust = 100;
2228 /* Mega-Hack -- Black market sucks */
2229 if (cur_store_num == STORE_BLACK)
2232 /* Compute the final price (with rounding) */
2233 /* Hack -- prevent underflow */
2234 price = (price * adjust + 50L) / 100L;
2237 /* Shop is selling */
2240 /* Adjust for greed */
2241 adjust = 100 + ((greed + factor) - 300);
2243 /* Never get "silly" */
2244 if (adjust < 100) adjust = 100;
2246 /* Mega-Hack -- Black market sucks */
2247 if (cur_store_num == STORE_BLACK)
2250 /* Compute the final price (with rounding) */
2251 /* Hack -- prevent overflow */
2252 price = (s32b)(((u32b)price * (u32b)adjust + 50UL) / 100UL);
2255 /* Note -- Never become "free" */
2256 if (price <= 0L) return (1L);
2258 /* Return the price */
2264 * @brief 安価な消耗品の販売数を増やし、低確率で割引にする /
2265 * Certain "cheap" objects should be created in "piles"
2266 * @param o_ptr 店舗に並べるオブジェクト構造体の参照ポインタ
2270 * Some objects can be sold at a "discount" (in small piles)
2273 static void mass_produce(object_type *o_ptr)
2276 DISCOUNT_RATE discount = 0;
2278 PRICE cost = object_value(o_ptr);
2281 /* Analyze the type */
2282 switch (o_ptr->tval)
2284 /* Food, Flasks, and Lites */
2289 if (cost <= 5L) size += damroll(3, 5);
2290 if (cost <= 20L) size += damroll(3, 5);
2291 if (cost <= 50L) size += damroll(2, 2);
2298 if (cost <= 60L) size += damroll(3, 5);
2299 if (cost <= 240L) size += damroll(1, 5);
2300 if (o_ptr->sval == SV_SCROLL_STAR_IDENTIFY) size += damroll(3, 5);
2301 if (o_ptr->sval == SV_SCROLL_STAR_REMOVE_CURSE) size += damroll(1, 4);
2306 case TV_SORCERY_BOOK:
2307 case TV_NATURE_BOOK:
2311 case TV_ARCANE_BOOK:
2313 case TV_DAEMON_BOOK:
2314 case TV_CRUSADE_BOOK:
2316 case TV_HISSATSU_BOOK:
2319 if (cost <= 50L) size += damroll(2, 3);
2320 if (cost <= 500L) size += damroll(1, 3);
2338 if (object_is_artifact(o_ptr)) break;
2339 if (object_is_ego(o_ptr)) break;
2340 if (cost <= 10L) size += damroll(3, 5);
2341 if (cost <= 100L) size += damroll(3, 5);
2350 if (cost <= 5L) size += damroll(5, 5);
2351 if (cost <= 50L) size += damroll(5, 5);
2352 if (cost <= 500L) size += damroll(5, 5);
2358 if (cost <= 100L) size += damroll(2, 2);
2359 if (cost <= 1000L) size += damroll(2, 2);
2372 * Because many rods (and a few wands and staffs) are useful mainly
2373 * in quantity, the Black Market will occasionally have a bunch of
2380 if ((cur_store_num == STORE_BLACK) && one_in_(3))
2382 if (cost < 1601L) size += damroll(1, 5);
2383 else if (cost < 3201L) size += damroll(1, 3);
2390 /* Pick a discount */
2395 else if (one_in_(25))
2399 else if (one_in_(150))
2403 else if (one_in_(300))
2407 else if (one_in_(500))
2412 if (o_ptr->art_name)
2417 /* Save the discount */
2418 o_ptr->discount = discount;
2420 /* Save the total pile size */
2421 o_ptr->number = size - (size * discount / 100);
2423 /* Ensure that mass-produced rods and wands get the correct pvals. */
2424 if ((o_ptr->tval == TV_ROD) || (o_ptr->tval == TV_WAND))
2426 o_ptr->pval *= (PARAMETER_VALUE)o_ptr->number;
2433 * @brief 店舗に並べた品を同一品であるかどうか判定する /
2434 * Determine if a store item can "absorb" another item
2435 * @param o_ptr 判定するオブジェクト構造体の参照ポインタ1
2436 * @param j_ptr 判定するオブジェクト構造体の参照ポインタ2
2437 * @return 同一扱いできるならTRUEを返す
2440 * See "object_similar()" for the same function for the "player"
2443 static bool store_object_similar(object_type *o_ptr, object_type *j_ptr)
2447 /* Hack -- Identical items cannot be stacked */
2448 if (o_ptr == j_ptr) return (0);
2450 /* Different objects cannot be stacked */
2451 if (o_ptr->k_idx != j_ptr->k_idx) return (0);
2453 /* Different charges (etc) cannot be stacked, unless wands or rods. */
2454 if ((o_ptr->pval != j_ptr->pval) && (o_ptr->tval != TV_WAND) && (o_ptr->tval != TV_ROD)) return (0);
2456 /* Require many identical values */
2457 if (o_ptr->to_h != j_ptr->to_h) return (0);
2458 if (o_ptr->to_d != j_ptr->to_d) return (0);
2459 if (o_ptr->to_a != j_ptr->to_a) return (0);
2461 /* Require identical "ego-item" names */
2462 if (o_ptr->name2 != j_ptr->name2) return (0);
2464 /* Artifacts don't stack! */
2465 if (object_is_artifact(o_ptr) || object_is_artifact(j_ptr)) return (0);
2467 /* Hack -- Identical art_flags! */
2468 for (i = 0; i < TR_FLAG_SIZE; i++)
2469 if (o_ptr->art_flags[i] != j_ptr->art_flags[i]) return (0);
2471 /* Hack -- Never stack "powerful" items */
2472 if (o_ptr->xtra1 || j_ptr->xtra1) return (0);
2474 /* Hack -- Never stack recharging items */
2475 if (o_ptr->timeout || j_ptr->timeout) return (0);
2477 /* Require many identical values */
2478 if (o_ptr->ac != j_ptr->ac) return (0);
2479 if (o_ptr->dd != j_ptr->dd) return (0);
2480 if (o_ptr->ds != j_ptr->ds) return (0);
2482 /* Hack -- Never stack chests */
2483 if (o_ptr->tval == TV_CHEST) return (0);
2484 if (o_ptr->tval == TV_STATUE) return (0);
2485 if (o_ptr->tval == TV_CAPTURE) return (0);
2487 /* Require matching discounts */
2488 if (o_ptr->discount != j_ptr->discount) return (0);
2490 /* They match, so they must be similar */
2496 * @brief 店舗に並べた品を重ね合わせできるかどうか判定する /
2497 * Allow a store item to absorb another item
2498 * @param o_ptr 判定するオブジェクト構造体の参照ポインタ1
2499 * @param j_ptr 判定するオブジェクト構造体の参照ポインタ2
2500 * @return 重ね合わせできるならTRUEを返す
2503 * See "object_similar()" for the same function for the "player"
2506 static void store_object_absorb(object_type *o_ptr, object_type *j_ptr)
2508 int max_num = (o_ptr->tval == TV_ROD) ?
2509 MIN(99, MAX_SHORT / k_info[o_ptr->k_idx].pval) : 99;
2510 int total = o_ptr->number + j_ptr->number;
2511 int diff = (total > max_num) ? total - max_num : 0;
2513 /* Combine quantity, lose excess items */
2514 o_ptr->number = (total > max_num) ? max_num : total;
2516 /* Hack -- if rods are stacking, add the pvals (maximum timeouts) together. -LM- */
2517 if (o_ptr->tval == TV_ROD)
2519 o_ptr->pval += j_ptr->pval * (j_ptr->number - diff) / j_ptr->number;
2522 /* Hack -- if wands are stacking, combine the charges. -LM- */
2523 if (o_ptr->tval == TV_WAND)
2525 o_ptr->pval += j_ptr->pval * (j_ptr->number - diff) / j_ptr->number;
2531 * @brief 店舗に品を置くスペースがあるかどうかの判定を返す /
2532 * Check to see if the shop will be carrying too many objects -RAK-
2533 * @param o_ptr 店舗に置きたいオブジェクト構造体の参照ポインタ
2534 * @return 置き場がないなら0、重ね合わせできるアイテムがあるなら-1、スペースがあるなら1を返す。
2537 * Note that the shop, just like a player, will not accept things
2538 * it cannot hold. Before, one could "nuke" potions this way.
2539 * Return value is now int:
2541 * -1 : Can be combined to existing slot.
2542 * 1 : Cannot be combined but there are empty spaces.
2545 static int store_check_num(object_type *o_ptr)
2550 /* The "home" acts like the player */
2551 if ((cur_store_num == STORE_HOME) || (cur_store_num == STORE_MUSEUM))
2553 bool old_stack_force_notes = stack_force_notes;
2554 bool old_stack_force_costs = stack_force_costs;
2556 if (cur_store_num != STORE_HOME)
2558 stack_force_notes = FALSE;
2559 stack_force_costs = FALSE;
2562 /* Check all the items */
2563 for (i = 0; i < st_ptr->stock_num; i++)
2565 /* Get the existing item */
2566 j_ptr = &st_ptr->stock[i];
2568 /* Can the new object be combined with the old one? */
2569 if (object_similar(j_ptr, o_ptr))
2571 if (cur_store_num != STORE_HOME)
2573 stack_force_notes = old_stack_force_notes;
2574 stack_force_costs = old_stack_force_costs;
2581 if (cur_store_num != STORE_HOME)
2583 stack_force_notes = old_stack_force_notes;
2584 stack_force_costs = old_stack_force_costs;
2588 /* Normal stores do special stuff */
2591 /* Check all the items */
2592 for (i = 0; i < st_ptr->stock_num; i++)
2594 /* Get the existing item */
2595 j_ptr = &st_ptr->stock[i];
2597 /* Can the new object be combined with the old one? */
2598 if (store_object_similar(j_ptr, o_ptr)) return -1;
2602 /* Free space is always usable */
2604 * オプション powerup_home が設定されていると
2607 if ((cur_store_num == STORE_HOME) && ( powerup_home == FALSE )) {
2608 if (st_ptr->stock_num < ((st_ptr->stock_size) / 10)) {
2613 if (st_ptr->stock_num < st_ptr->stock_size) {
2618 /* But there was no room at the inn... */
2623 * @brief オブジェクトが祝福されているかの判定を返す /
2624 * @param o_ptr 判定したいオブジェクト構造体の参照ポインタ
2625 * @return アイテムが祝福されたアイテムならばTRUEを返す
2627 static bool is_blessed(object_type *o_ptr)
2629 BIT_FLAGS flgs[TR_FLAG_SIZE];
2630 object_flags(o_ptr, flgs);
2631 if (have_flag(flgs, TR_BLESSED)) return (TRUE);
2632 else return (FALSE);
2638 * @brief オブジェクトが所定の店舗で引き取れるかどうかを返す /
2639 * Determine if the current store will purchase the given item
2640 * @param o_ptr 判定したいオブジェクト構造体の参照ポインタ
2641 * @return アイテムが買い取れるならばTRUEを返す
2643 * Note that a shop-keeper must refuse to buy "worthless" items
2645 static bool store_will_buy(object_type *o_ptr)
2647 /* Hack -- The Home is simple */
2648 if ((cur_store_num == STORE_HOME) || (cur_store_num == STORE_MUSEUM)) return (TRUE);
2650 /* Switch on the store */
2651 switch (cur_store_num)
2656 /* Analyze the type */
2657 switch (o_ptr->tval)
2660 if (o_ptr->sval != SV_POTION_WATER) return FALSE;
2672 case TV_BOTTLE: /* 'Green', recycling Angband */
2687 /* Analyze the type */
2688 switch (o_ptr->tval)
2709 /* Analyze the type */
2710 switch (o_ptr->tval)
2719 case TV_HISSATSU_BOOK:
2723 if(o_ptr->sval == SV_WIZSTAFF) return (FALSE);
2735 /* Analyze the type */
2736 switch (o_ptr->tval)
2739 case TV_CRUSADE_BOOK:
2749 monster_race *r_ptr = &r_info[o_ptr->pval];
2752 if (!(r_ptr->flags3 & RF3_EVIL))
2755 if (r_ptr->flags3 & RF3_GOOD) break;
2757 /* Accept animals */
2758 if (r_ptr->flags3 & RF3_ANIMAL) break;
2761 if (my_strchr("?!", r_ptr->d_char)) break;
2767 if (is_blessed(o_ptr)) break;
2776 case STORE_ALCHEMIST:
2778 /* Analyze the type */
2779 switch (o_ptr->tval)
2793 /* Analyze the type */
2794 switch (o_ptr->tval)
2796 case TV_SORCERY_BOOK:
2797 case TV_NATURE_BOOK:
2801 case TV_ARCANE_BOOK:
2803 case TV_DAEMON_BOOK:
2817 if(o_ptr->sval == SV_WIZSTAFF) break;
2818 else return (FALSE);
2825 /* Bookstore Shop */
2828 /* Analyze the type */
2829 switch (o_ptr->tval)
2831 case TV_SORCERY_BOOK:
2832 case TV_NATURE_BOOK:
2837 case TV_ARCANE_BOOK:
2839 case TV_DAEMON_BOOK:
2840 case TV_CRUSADE_BOOK:
2851 /* Ignore "worthless" items */
2852 if (object_value(o_ptr) <= 0) return (FALSE);
2860 * @brief 現在の町の指定された店舗のアイテムを整理する /
2861 * Combine and reorder items in store.
2862 * @param store_num 店舗ID
2863 * @return 実際に整理が行われたならばTRUEを返す。
2865 bool combine_and_reorder_home(int store_num)
2869 object_type forge, *o_ptr, *j_ptr;
2870 bool flag = FALSE, combined;
2871 store_type *old_st_ptr = st_ptr;
2872 bool old_stack_force_notes = stack_force_notes;
2873 bool old_stack_force_costs = stack_force_costs;
2875 st_ptr = &town_info[1].store[store_num];
2876 if (store_num != STORE_HOME)
2878 stack_force_notes = FALSE;
2879 stack_force_costs = FALSE;
2886 /* Combine the items in the home (backwards) */
2887 for (i = st_ptr->stock_num - 1; i > 0; i--)
2889 o_ptr = &st_ptr->stock[i];
2891 /* Skip empty items */
2892 if (!o_ptr->k_idx) continue;
2894 /* Scan the items above that item */
2895 for (j = 0; j < i; j++)
2899 j_ptr = &st_ptr->stock[j];
2901 /* Skip empty items */
2902 if (!j_ptr->k_idx) continue;
2905 * Get maximum number of the stack if these
2906 * are similar, get zero otherwise.
2908 max_num = object_similar_part(j_ptr, o_ptr);
2910 /* Can we (partialy) drop "o_ptr" onto "j_ptr"? */
2911 if (max_num && j_ptr->number < max_num)
2913 if (o_ptr->number + j_ptr->number <= max_num)
2915 /* Add together the item counts */
2916 object_absorb(j_ptr, o_ptr);
2918 /* One object is gone */
2919 st_ptr->stock_num--;
2921 /* Slide everything down */
2922 for (k = i; k < st_ptr->stock_num; k++)
2924 /* Structure copy */
2925 st_ptr->stock[k] = st_ptr->stock[k + 1];
2928 /* Erase the "final" slot */
2929 object_wipe(&st_ptr->stock[k]);
2933 ITEM_NUMBER old_num = o_ptr->number;
2934 ITEM_NUMBER remain = j_ptr->number + o_ptr->number - max_num;
2936 /* Add together the item counts */
2937 object_absorb(j_ptr, o_ptr);
2939 o_ptr->number = remain;
2941 /* Hack -- if rods are stacking, add the pvals (maximum timeouts) and current timeouts together. -LM- */
2942 if (o_ptr->tval == TV_ROD)
2944 o_ptr->pval = o_ptr->pval * remain / old_num;
2945 o_ptr->timeout = o_ptr->timeout * remain / old_num;
2948 /* Hack -- if wands are stacking, combine the charges. -LM- */
2949 else if (o_ptr->tval == TV_WAND)
2951 o_ptr->pval = o_ptr->pval * remain / old_num;
2966 /* Re-order the items in the home (forwards) */
2967 for (i = 0; i < st_ptr->stock_num; i++)
2969 o_ptr = &st_ptr->stock[i];
2971 /* Skip empty slots */
2972 if (!o_ptr->k_idx) continue;
2974 /* Get the "value" of the item */
2975 o_value = object_value(o_ptr);
2977 /* Scan every occupied slot */
2978 for (j = 0; j < st_ptr->stock_num; j++)
2980 if (object_sort_comp(o_ptr, o_value, &st_ptr->stock[j])) break;
2983 /* Never move down */
2984 if (j >= i) continue;
2990 /* Save a copy of the moving item */
2991 object_copy(j_ptr, &st_ptr->stock[i]);
2993 /* Slide the objects */
2994 for (k = i; k > j; k--)
2996 /* Slide the item */
2997 object_copy(&st_ptr->stock[k], &st_ptr->stock[k - 1]);
3000 /* Insert the moving item */
3001 object_copy(&st_ptr->stock[j], j_ptr);
3004 st_ptr = old_st_ptr;
3005 if (store_num != STORE_HOME)
3007 stack_force_notes = old_stack_force_notes;
3008 stack_force_costs = old_stack_force_costs;
3016 * @brief 我が家にオブジェクトを加える /
3017 * Add the item "o_ptr" to the p_ptr->inventory_list of the "Home"
3018 * @param o_ptr 加えたいオブジェクトの構造体参照ポインタ
3022 * In all cases, return the slot (or -1) where the object was placed
3023 * Note that this is a hacked up version of "inven_carry()".
3024 * Also note that it may not correctly "adapt" to "knowledge" bacoming
3025 * known, the player may have to pick stuff up and drop it again.
3028 static int home_carry(object_type *o_ptr)
3034 bool old_stack_force_notes = stack_force_notes;
3035 bool old_stack_force_costs = stack_force_costs;
3037 if (cur_store_num != STORE_HOME)
3039 stack_force_notes = FALSE;
3040 stack_force_costs = FALSE;
3043 /* Check each existing item (try to combine) */
3044 for (slot = 0; slot < st_ptr->stock_num; slot++)
3046 /* Get the existing item */
3047 j_ptr = &st_ptr->stock[slot];
3049 /* The home acts just like the player */
3050 if (object_similar(j_ptr, o_ptr))
3052 /* Save the new number of items */
3053 object_absorb(j_ptr, o_ptr);
3055 if (cur_store_num != STORE_HOME)
3057 stack_force_notes = old_stack_force_notes;
3058 stack_force_costs = old_stack_force_costs;
3066 if (cur_store_num != STORE_HOME)
3068 stack_force_notes = old_stack_force_notes;
3069 stack_force_costs = old_stack_force_costs;
3074 * 隠し機能: オプション powerup_home が設定されていると
3078 if ((cur_store_num != STORE_HOME) || (powerup_home == TRUE)) {
3079 if (st_ptr->stock_num >= st_ptr->stock_size) {
3084 if (st_ptr->stock_num >= ((st_ptr->stock_size) / 10)) {
3090 /* Determine the "value" of the item */
3091 value = object_value(o_ptr);
3093 /* Check existing slots to see if we must "slide" */
3094 for (slot = 0; slot < st_ptr->stock_num; slot++)
3096 if (object_sort_comp(o_ptr, value, &st_ptr->stock[slot])) break;
3099 /* Slide the others up */
3100 for (i = st_ptr->stock_num; i > slot; i--)
3102 st_ptr->stock[i] = st_ptr->stock[i-1];
3105 /* More stuff now */
3106 st_ptr->stock_num++;
3108 /* Insert the new item */
3109 st_ptr->stock[slot] = *o_ptr;
3111 chg_virtue(V_SACRIFICE, -1);
3113 (void)combine_and_reorder_home(cur_store_num);
3115 /* Return the location */
3121 * @brief 店舗にオブジェクトを加える /
3122 * Add the item "o_ptr" to a real stores p_ptr->inventory_list.
3123 * @param o_ptr 加えたいオブジェクトの構造体参照ポインタ
3127 * In all cases, return the slot (or -1) where the object was placed
3128 * Note that this is a hacked up version of "inven_carry()".
3129 * Also note that it may not correctly "adapt" to "knowledge" bacoming
3130 * known, the player may have to pick stuff up and drop it again.
3133 static int store_carry(object_type *o_ptr)
3136 PRICE value, j_value;
3140 /* Evaluate the object */
3141 value = object_value(o_ptr);
3143 /* Cursed/Worthless items "disappear" when sold */
3144 if (value <= 0) return (-1);
3146 /* All store items are fully *identified* */
3147 o_ptr->ident |= IDENT_MENTAL;
3149 /* Erase the inscription */
3150 o_ptr->inscription = 0;
3152 /* Erase the "feeling" */
3153 o_ptr->feeling = FEEL_NONE;
3155 /* Check each existing item (try to combine) */
3156 for (slot = 0; slot < st_ptr->stock_num; slot++)
3158 /* Get the existing item */
3159 j_ptr = &st_ptr->stock[slot];
3161 /* Can the existing items be incremented? */
3162 if (store_object_similar(j_ptr, o_ptr))
3164 /* Hack -- extra items disappear */
3165 store_object_absorb(j_ptr, o_ptr);
3173 if (st_ptr->stock_num >= st_ptr->stock_size) return (-1);
3176 /* Check existing slots to see if we must "slide" */
3177 for (slot = 0; slot < st_ptr->stock_num; slot++)
3180 j_ptr = &st_ptr->stock[slot];
3182 /* Objects sort by decreasing type */
3183 if (o_ptr->tval > j_ptr->tval) break;
3184 if (o_ptr->tval < j_ptr->tval) continue;
3186 /* Objects sort by increasing sval */
3187 if (o_ptr->sval < j_ptr->sval) break;
3188 if (o_ptr->sval > j_ptr->sval) continue;
3191 * Hack: otherwise identical rods sort by
3192 * increasing recharge time --dsb
3194 if (o_ptr->tval == TV_ROD)
3196 if (o_ptr->pval < j_ptr->pval) break;
3197 if (o_ptr->pval > j_ptr->pval) continue;
3200 /* Evaluate that slot */
3201 j_value = object_value(j_ptr);
3203 /* Objects sort by decreasing value */
3204 if (value > j_value) break;
3205 if (value < j_value) continue;
3208 /* Slide the others up */
3209 for (i = st_ptr->stock_num; i > slot; i--)
3211 st_ptr->stock[i] = st_ptr->stock[i-1];
3214 /* More stuff now */
3215 st_ptr->stock_num++;
3217 /* Insert the new item */
3218 st_ptr->stock[slot] = *o_ptr;
3220 /* Return the location */
3226 * @brief 店舗のオブジェクト数を増やす /
3227 * Add the item "o_ptr" to a real stores p_ptr->inventory_list.
3228 * @param item 増やしたいアイテムのID
3233 * Increase, by a given amount, the number of a certain item
3234 * in a certain store. This can result in zero items.
3236 * @todo numは本来ITEM_NUMBER型にしたい。
3238 static void store_item_increase(INVENTORY_IDX item, int num)
3243 o_ptr = &st_ptr->stock[item];
3245 /* Verify the number */
3246 cnt = o_ptr->number + num;
3247 if (cnt > 255) cnt = 255;
3248 else if (cnt < 0) cnt = 0;
3249 num = cnt - o_ptr->number;
3251 /* Save the new number */
3252 o_ptr->number += (ITEM_NUMBER)num;
3257 * @brief 店舗のオブジェクト数を削除する /
3258 * Remove a slot if it is empty
3259 * @param item 削除したいアイテムのID
3262 static void store_item_optimize(INVENTORY_IDX item)
3267 o_ptr = &st_ptr->stock[item];
3270 if (!o_ptr->k_idx) return;
3272 /* Must have no items */
3273 if (o_ptr->number) return;
3276 st_ptr->stock_num--;
3278 /* Slide everyone */
3279 for (j = item; j < st_ptr->stock_num; j++)
3281 st_ptr->stock[j] = st_ptr->stock[j + 1];
3284 /* Nuke the final slot */
3285 object_wipe(&st_ptr->stock[j]);
3289 * @brief ブラックマーケット用の無価値品の排除判定 /
3290 * This function will keep 'crap' out of the black market.
3291 * @param o_ptr 判定したいオブジェクトの構造体参照ポインタ
3292 * @return ブラックマーケットにとって無価値な品ならばTRUEを返す
3295 * Crap is defined as any item that is "available" elsewhere
3296 * Based on a suggestion by "Lee Vogt" <lvogt@cig.mcel.mot.com>
3299 static bool black_market_crap(object_type *o_ptr)
3303 /* Ego items are never crap */
3304 if (object_is_ego(o_ptr)) return (FALSE);
3306 /* Good items are never crap */
3307 if (o_ptr->to_a > 0) return (FALSE);
3308 if (o_ptr->to_h > 0) return (FALSE);
3309 if (o_ptr->to_d > 0) return (FALSE);
3311 /* Check all stores */
3312 for (i = 0; i < MAX_STORES; i++)
3314 if (i == STORE_HOME) continue;
3315 if (i == STORE_MUSEUM) continue;
3317 /* Check every item in the store */
3318 for (j = 0; j < town_info[p_ptr->town_num].store[i].stock_num; j++)
3320 object_type *j_ptr = &town_info[p_ptr->town_num].store[i].stock[j];
3322 /* Duplicate item "type", assume crappy */
3323 if (o_ptr->k_idx == j_ptr->k_idx) return (TRUE);
3333 * @brief 店舗の品揃え変化のためにアイテムを削除する /
3334 * Attempt to delete (some of) a random item from the store
3338 * Hack -- we attempt to "maintain" piles of items when possible.
3341 static void store_delete(void)
3346 /* Pick a random slot */
3347 what = (INVENTORY_IDX)randint0(st_ptr->stock_num);
3349 /* Determine how many items are here */
3350 num = st_ptr->stock[what].number;
3352 /* Hack -- sometimes, only destroy half the items */
3353 if (randint0(100) < 50) num = (num + 1) / 2;
3355 /* Hack -- sometimes, only destroy a single item */
3356 if (randint0(100) < 50) num = 1;
3358 /* Hack -- decrement the maximum timeouts and total charges of rods and wands. -LM- */
3359 if ((st_ptr->stock[what].tval == TV_ROD) || (st_ptr->stock[what].tval == TV_WAND))
3361 st_ptr->stock[what].pval -= num * st_ptr->stock[what].pval / st_ptr->stock[what].number;
3364 /* Actually destroy (part of) the item */
3365 store_item_increase(what, -num);
3366 store_item_optimize(what);
3371 * @brief 店舗の品揃え変化のためにアイテムを追加する /
3372 * Creates a random item and gives it to a store
3376 * This algorithm needs to be rethought. A lot.
3377 * Currently, "normal" stores use a pre-built array.
3378 * Note -- the "level" given to "obj_get_num()" is a "favored"
3379 * level, that is, there is a much higher chance of getting
3380 * items with a level approaching that of the given level...
3381 * Should we check for "permission" to have the given item?
3384 static void store_create(void)
3393 /* Paranoia -- no room left */
3394 if (st_ptr->stock_num >= st_ptr->stock_size) return;
3396 /* Hack -- consider up to four items */
3397 for (tries = 0; tries < 4; tries++)
3400 if (cur_store_num == STORE_BLACK)
3402 /* Pick a level for object/magic */
3403 level = 25 + randint0(25);
3405 /* Random item (usually of given level) */
3406 i = get_obj_num(level, 0x00000000);
3408 /* Handle failure */
3415 /* Hack -- Pick an item to sell */
3416 i = st_ptr->table[randint0(st_ptr->table_num)];
3418 /* Hack -- fake level for apply_magic() */
3419 level = rand_range(1, STORE_OBJ_LEVEL);
3424 /* Create a new object of the chosen kind */
3425 object_prep(q_ptr, i);
3427 /* Apply some "low-level" magic (no artifacts) */
3428 apply_magic(q_ptr, level, AM_NO_FIXED_ART);
3430 /* Require valid object */
3431 if (!store_will_buy(q_ptr)) continue;
3433 /* Hack -- Charge lite's */
3434 if (q_ptr->tval == TV_LITE)
3436 if (q_ptr->sval == SV_LITE_TORCH) q_ptr->xtra4 = FUEL_TORCH / 2;
3437 if (q_ptr->sval == SV_LITE_LANTERN) q_ptr->xtra4 = FUEL_LAMP / 2;
3441 /* The item is "known" */
3442 object_known(q_ptr);
3444 /* Mark it storebought */
3445 q_ptr->ident |= IDENT_STORE;
3447 /* Mega-Hack -- no chests in stores */
3448 if (q_ptr->tval == TV_CHEST) continue;
3450 /* Prune the black market */
3451 if (cur_store_num == STORE_BLACK)
3453 /* Hack -- No "crappy" items */
3454 if (black_market_crap(q_ptr)) continue;
3456 /* Hack -- No "cheap" items */
3457 if (object_value(q_ptr) < 10) continue;
3459 /* No "worthless" items */
3460 /* if (object_value(q_ptr) <= 0) continue; */
3463 /* Prune normal stores */
3466 /* No "worthless" items */
3467 if (object_value(q_ptr) <= 0) continue;
3471 /* Mass produce and/or Apply discount */
3472 mass_produce(q_ptr);
3474 /* Attempt to carry the (known) item */
3475 (void)store_carry(q_ptr);
3477 /* Definitely done */
3484 * @brief 店舗の割引対象外にするかどうかを判定 /
3485 * Eliminate need to bargain if player has haggled well in the past
3486 * @param minprice アイテムの最低販売価格
3487 * @return 割引を禁止するならTRUEを返す。
3489 static bool noneedtobargain(PRICE minprice)
3491 PRICE good = st_ptr->good_buy;
3492 PRICE bad = st_ptr->bad_buy;
3494 /* Cheap items are "boring" */
3495 if (minprice < 10L) return (TRUE);
3497 /* Perfect haggling */
3498 if (good == MAX_SHORT) return (TRUE);
3500 /* Reward good haggles, punish bad haggles, notice price */
3501 if (good > ((3 * bad) + (5 + (minprice/50)))) return (TRUE);
3503 /* Return the flag */
3509 * @brief 店主の持つプレイヤーに対する売買の良し悪し経験を記憶する /
3510 * Update the bargain info
3511 * @param price 実際の取引価格
3512 * @param minprice 店主の提示した価格
3516 static void updatebargain(PRICE price, PRICE minprice, int num)
3518 /* Hack -- auto-haggle */
3519 if (!manual_haggle) return;
3521 /* Cheap items are "boring" */
3522 if ((minprice/num) < 10L) return;
3524 /* Count the successful haggles */
3525 if (price == minprice)
3527 /* Just count the good haggles */
3528 if (st_ptr->good_buy < MAX_SHORT)
3534 /* Count the failed haggles */
3537 /* Just count the bad haggles */
3538 if (st_ptr->bad_buy < MAX_SHORT)
3547 * @brief 店の商品リストを再表示する /
3548 * Re-displays a single store entry
3552 static void display_entry(int pos)
3558 GAME_TEXT o_name[MAX_NLEN];
3563 o_ptr = &st_ptr->stock[pos];
3565 /* Get the "offset" */
3566 i = (pos % store_bottom);
3568 /* Label it, clear the line --(-- */
3569 (void)sprintf(out_val, "%c) ", ((i > 25) ? toupper(I2A(i - 26)) : I2A(i)));
3570 prt(out_val, i+6, 0);
3573 if (show_item_graph)
3575 TERM_COLOR a = object_attr(o_ptr);
3576 SYMBOL_CODE c = object_char(o_ptr);
3578 Term_queue_bigchar(cur_col, i + 6, a, c, 0, 0);
3579 if (use_bigtile) cur_col++;
3584 /* Describe an item in the home */
3585 if ((cur_store_num == STORE_HOME) || (cur_store_num == STORE_MUSEUM))
3589 /* Leave room for weights, if necessary -DRS- */
3590 if (show_weights) maxwid -= 10;
3592 object_desc(o_name, o_ptr, 0);
3593 o_name[maxwid] = '\0';
3594 c_put_str(tval_to_attr[o_ptr->tval], o_name, i+6, cur_col);
3599 /* Only show the weight of an individual item */
3600 WEIGHT wgt = o_ptr->weight;
3602 sprintf(out_val, "%3d.%1d kg", lbtokg1(wgt) , lbtokg2(wgt));
3603 put_str(out_val, i+6, 67);
3605 (void)sprintf(out_val, "%3d.%d lb", wgt / 10, wgt % 10);
3606 put_str(out_val, i+6, 68);
3612 /* Describe an item (fully) in a store */
3615 /* Must leave room for the "price" */
3618 /* Leave room for weights, if necessary -DRS- */
3619 if (show_weights) maxwid -= 7;
3621 /* Describe the object (fully) */
3622 object_desc(o_name, o_ptr, 0);
3623 o_name[maxwid] = '\0';
3624 c_put_str(tval_to_attr[o_ptr->tval], o_name, i+6, cur_col);
3629 /* Only show the weight of an individual item */
3630 int wgt = o_ptr->weight;
3632 sprintf(out_val, "%3d.%1d", lbtokg1(wgt) , lbtokg2(wgt) );
3633 put_str(out_val, i+6, 60);
3635 (void)sprintf(out_val, "%3d.%d", wgt / 10, wgt % 10);
3636 put_str(out_val, i+6, 61);
3641 /* Display a "fixed" cost */
3642 if (o_ptr->ident & (IDENT_FIXED))
3644 /* Extract the "minimum" price */
3645 x = price_item(o_ptr, ot_ptr->min_inflate, FALSE);
3647 /* Actually draw the price (not fixed) */
3649 (void)sprintf(out_val, "%9ld固", (long)x);
3651 (void)sprintf(out_val, "%9ld F", (long)x);
3653 put_str(out_val, i+6, 68);
3656 /* Display a "taxed" cost */
3657 else if (!manual_haggle)
3659 /* Extract the "minimum" price */
3660 x = price_item(o_ptr, ot_ptr->min_inflate, FALSE);
3662 /* Hack -- Apply Sales Tax if needed */
3663 if (!noneedtobargain(x)) x += x / 10;
3665 /* Actually draw the price (with tax) */
3666 (void)sprintf(out_val, "%9ld ", (long)x);
3667 put_str(out_val, i+6, 68);
3670 /* Display a "haggle" cost */
3673 /* Extrect the "maximum" price */
3674 x = price_item(o_ptr, ot_ptr->max_inflate, FALSE);
3676 /* Actually draw the price (not fixed) */
3677 (void)sprintf(out_val, "%9ld ", (long)x);
3678 put_str(out_val, i+6, 68);
3685 * @brief 店の商品リストを表示する /
3686 * Displays a store's p_ptr->inventory_list -RAK-
3689 * All prices are listed as "per individual object". -BEN-
3691 static void display_inventory(void)
3695 /* Display the next 12 items */
3696 for (k = 0; k < store_bottom; k++)
3698 /* Do not display "dead" items */
3699 if (store_top + k >= st_ptr->stock_num) break;
3701 /* Display that line */
3702 display_entry(store_top + k);
3705 /* Erase the extra lines and the "more" prompt */
3706 for (i = k; i < store_bottom + 1; i++) prt("", i + 6, 0);
3708 /* Assume "no current page" */
3710 put_str(" ", 5, 20);
3712 put_str(" ", 5, 20);
3716 /* Visual reminder of "more items" */
3717 if (st_ptr->stock_num > store_bottom)
3719 /* Show "more" reminder (after the last item) */
3720 prt(_("-続く-", "-more-"), k + 6, 3);
3722 /* Indicate the "current page" */
3723 /* Trailing spaces are to display (Page xx) and (Page x) */
3724 put_str(format(_("(%dページ) ", "(Page %d) "), store_top/store_bottom + 1), 5, 20);
3727 if (cur_store_num == STORE_HOME || cur_store_num == STORE_MUSEUM)
3729 k = st_ptr->stock_size;
3731 if (cur_store_num == STORE_HOME && !powerup_home) k /= 10;
3733 put_str(format("アイテム数: %4d/%4d", st_ptr->stock_num, k), 19 + xtra_stock, 27);
3735 put_str(format("Objects: %4d/%4d", st_ptr->stock_num, k), 19 + xtra_stock, 30);
3742 * @brief プレイヤーの所持金を表示する /
3743 * Displays players gold -RAK-
3747 static void store_prt_gold(void)
3751 prt(_("手持ちのお金: ", "Gold Remaining: "), 19 + xtra_stock, 53);
3752 sprintf(out_val, "%9ld", (long)p_ptr->au);
3753 prt(out_val, 19 + xtra_stock, 68);
3757 * @brief 店舗情報全体を表示するメインルーチン /
3758 * Displays store (after clearing screen) -RAK-
3762 static void display_store(void)
3768 /* The "Home" is special */
3769 if (cur_store_num == STORE_HOME)
3771 /* Put the owner name */
3772 put_str(_("我が家", "Your Home"), 3, 31);
3774 /* Label the item descriptions */
3775 put_str(_("アイテムの一覧", "Item Description"), 5, 4);
3777 /* If showing weights, show label */
3780 put_str(_(" 重さ", "Weight"), 5, 70);
3784 /* The "Home" is special */
3785 else if (cur_store_num == STORE_MUSEUM)
3787 /* Put the owner name */
3788 put_str(_("博物館", "Museum"), 3, 31);
3790 /* Label the item descriptions */
3791 put_str(_("アイテムの一覧", "Item Description"), 5, 4);
3793 /* If showing weights, show label */
3796 put_str(_(" 重さ", "Weight"), 5, 70);
3803 concptr store_name = (f_name + f_info[cur_store_feat].name);
3804 concptr owner_name = (ot_ptr->owner_name);
3805 concptr race_name = race_info[ot_ptr->owner_race].title;
3807 /* Put the owner name and race */
3808 sprintf(buf, "%s (%s)", owner_name, race_name);
3809 put_str(buf, 3, 10);
3811 /* Show the max price in the store (above prices) */
3812 sprintf(buf, "%s (%ld)", store_name, (long)(ot_ptr->max_cost));
3815 /* Label the item descriptions */
3816 put_str(_("商品の一覧", "Item Description"), 5, 5);
3819 /* If showing weights, show label */
3822 put_str(_(" 重さ", "Weight"), 5, 60);
3825 /* Label the asking price (in stores) */
3826 put_str(_(" 価格", "Price"), 5, 72);
3829 /* Display the current gold */
3832 /* Draw in the p_ptr->inventory_list */
3833 display_inventory();
3839 * @brief 店舗からアイテムを選択する /
3840 * Get the ID of a store item and return its value -RAK-
3841 * @param com_val 選択IDを返す参照ポインタ
3842 * @param pmt メッセージキャプション
3845 * @return 実際に選択したらTRUE、キャンセルしたらFALSE
3847 static int get_stock(COMMAND_CODE *com_val, concptr pmt, int i, int j)
3853 /* Get the item index */
3854 if (repeat_pull(com_val))
3856 /* Verify the item */
3857 if ((*com_val >= i) && (*com_val <= j))
3865 /* Assume failure */
3868 /* Build the prompt */
3870 hi = (j > 25) ? toupper(I2A(j - 26)) : I2A(j);
3872 (void)sprintf(out_val, "(%s:%c-%c, ESCで中断) %s",
3873 (((cur_store_num == STORE_HOME) || (cur_store_num == STORE_MUSEUM)) ? "アイテム" : "商品"),
3876 (void)sprintf(out_val, "(Items %c-%c, ESC to exit) %s",
3881 /* Ask until done */
3887 if (!get_com(out_val, &command, FALSE)) break;
3890 if (islower(command))
3892 else if (isupper(command))
3893 k = A2I(tolower(command)) + 26;
3897 /* Legal responses */
3898 if ((k >= i) && (k <= j))
3907 /* Clear the prompt */
3910 if (command == ESCAPE) return (FALSE);
3912 repeat_push(*com_val);
3920 * @brief 店主の不満度を増やし、プレイヤーを締め出す判定と処理を行う /
3921 * Increase the insult counter and get angry if too many -RAK-
3922 * @return プレイヤーを締め出す場合TRUEを返す
3924 static int increase_insults(void)
3926 /* Increase insults */
3927 st_ptr->insult_cur++;
3929 /* Become insulted */
3930 if (st_ptr->insult_cur > ot_ptr->insult_max)
3936 st_ptr->insult_cur = 0;
3937 st_ptr->good_buy = 0;
3938 st_ptr->bad_buy = 0;
3941 st_ptr->store_open = current_world_ptr->game_turn + TURNS_PER_TICK*TOWN_DAWN/8 + randint1(TURNS_PER_TICK*TOWN_DAWN/8);
3953 * @brief 店主の不満度を減らす /
3954 * Decrease insults -RAK-
3955 * @return プレイヤーを締め出す場合TRUEを返す
3957 static void decrease_insults(void)
3959 /* Decrease insults */
3960 if (st_ptr->insult_cur) st_ptr->insult_cur--;
3965 * @brief 店主の不満度が増えた場合のみのメッセージを表示する /
3966 * Have insulted while haggling -RAK-
3967 * @return プレイヤーを締め出す場合TRUEを返す
3969 static int haggle_insults(void)
3971 /* Increase insults */
3972 if (increase_insults()) return (TRUE);
3974 /* Display and flush insult */
3983 * Mega-Hack -- Enable "increments"
3985 static bool allow_inc = FALSE;
3988 * Mega-Hack -- Last "increment" during haggling
3990 static s32b last_inc = 0L;
3994 * @brief 交渉価格を確認と認証の是非を行う /
3997 * @param poffer 別途価格提示をした場合の値を返す参照ポインタ
3998 * @param price 現在の交渉価格
3999 * @param final 最終確定価格ならばTRUE
4000 * @return プレイヤーを締め出す場合TRUEを返す
4002 static int get_haggle(concptr pmt, s32b *poffer, PRICE price, int final)
4007 GAME_TEXT out_val[160];
4009 /* Clear old increment if necessary */
4010 if (!allow_inc) last_inc = 0L;
4015 sprintf(buf, _("%s [承諾] ", "%s [accept] "), pmt);
4018 /* Old (negative) increment, and not final */
4019 else if (last_inc < 0)
4021 sprintf(buf, _("%s [-$%ld] ", "%s [-%ld] "), pmt, (long)(ABS(last_inc)));
4024 /* Old (positive) increment, and not final */
4025 else if (last_inc > 0)
4027 sprintf(buf, _("%s [+$%ld] ", "%s [+%ld] "), pmt, (long)(ABS(last_inc)));
4033 sprintf(buf, "%s ", pmt);
4037 /* Ask until done */
4042 /* Display prompt */
4046 strcpy(out_val, "");
4049 * Ask the user for a response.
4050 * Don't allow to use numpad as cursor key.
4052 res = askfor_aux(out_val, 32, FALSE);
4058 if (!res) return FALSE;
4060 /* Skip leading spaces */
4061 for (p = out_val; *p == ' '; p++) /* loop */;
4063 /* Empty response */
4066 /* Accept current price */
4074 /* Use previous increment */
4075 if (allow_inc && last_inc)
4077 *poffer += last_inc;
4082 /* Normal response */
4085 /* Extract a number */
4088 /* Handle "incremental" number */
4089 if ((*p == '+' || *p == '-'))
4091 /* Allow increments */
4094 /* Use the given "increment" */
4101 /* Handle normal number */
4104 /* Use the given "number" */
4112 msg_print(_("値がおかしいです。", "Invalid response."));
4122 * @brief 店主がプレイヤーからの交渉価格を判断する /
4123 * Receive an offer (from the player)
4125 * @param poffer 店主からの交渉価格を返す参照ポインタ
4126 * @param last_offer 現在の交渉価格
4127 * @param factor 店主の価格基準倍率
4128 * @param price アイテムの実価値
4129 * @param final 最終価格確定ならばTRUE
4130 * @return プレイヤーの価格に対して不服ならばTRUEを返す /
4131 * Return TRUE if offer is NOT okay
4133 static bool receive_offer(concptr pmt, s32b *poffer,
4134 s32b last_offer, int factor,
4135 PRICE price, int final)
4137 /* Haggle till done */
4140 /* Get a haggle (or cancel) */
4141 if (!get_haggle(pmt, poffer, price, final)) return (TRUE);
4143 /* Acceptable offer */
4144 if (((*poffer) * factor) >= (last_offer * factor)) break;
4146 /* Insult, and check for kicked out */
4147 if (haggle_insults()) return (TRUE);
4149 /* Reject offer (correctly) */
4150 (*poffer) = last_offer;
4159 * @brief プレイヤーが購入する時の値切り処理メインルーチン /
4160 * Haggling routine -RAK-
4161 * @param o_ptr オブジェクトの構造体参照ポインタ
4162 * @param price 最終価格を返す参照ポインタ
4163 * @return プレイヤーの価格に対して店主が不服ならばTRUEを返す /
4164 * Return TRUE if purchase is NOT successful
4166 static bool purchase_haggle(object_type *o_ptr, s32b *price)
4168 s32b cur_ask, final_ask;
4169 s32b last_offer, offer;
4171 s32b min_per, max_per;
4172 int flag, loop_flag, noneed;
4173 int annoyed = 0, final = FALSE;
4174 bool cancel = FALSE;
4178 concptr pmt = _("提示価格", "Asking");
4180 /* Extract the starting offer and the final offer */
4181 cur_ask = price_item(o_ptr, ot_ptr->max_inflate, FALSE);
4182 final_ask = price_item(o_ptr, ot_ptr->min_inflate, FALSE);
4184 /* Determine if haggling is necessary */
4185 noneed = noneedtobargain(final_ask);
4187 /* No need to haggle */
4188 if (noneed || !manual_haggle)
4190 /* No need to haggle */
4193 /* Message summary */
4194 msg_print(_("結局この金額にまとまった。", "You eventually agree upon the price."));
4198 /* No haggle option */
4201 /* Message summary */
4202 msg_print(_("すんなりとこの金額にまとまった。", "You quickly agree upon the price."));
4205 /* Apply Sales Tax */
4206 final_ask += final_ask / 10;
4210 cur_ask = final_ask;
4212 /* Go to final offer */
4213 pmt = _("最終提示価格", "Final Offer");
4218 /* Haggle for the whole pile */
4219 cur_ask *= o_ptr->number;
4220 final_ask *= o_ptr->number;
4223 /* Haggle parameters */
4224 min_per = ot_ptr->haggle_per;
4225 max_per = min_per * 3;
4227 /* Mega-Hack -- artificial "last offer" value */
4228 last_offer = object_value(o_ptr) * o_ptr->number;
4229 last_offer = last_offer * (200 - (int)(ot_ptr->max_inflate)) / 100L;
4230 if (last_offer <= 0) last_offer = 1;
4235 /* No incremental haggling yet */
4238 /* Haggle until done */
4239 for (flag = FALSE; !flag; )
4243 while (!flag && loop_flag)
4245 (void)sprintf(out_val, "%s : %ld", pmt, (long)cur_ask);
4246 put_str(out_val, 1, 0);
4247 cancel = receive_offer(_("提示する金額? ", "What do you offer? "), &offer, last_offer, 1, cur_ask, final);
4252 else if (offer > cur_ask)
4257 else if (offer == cur_ask)
4270 x1 = 100 * (offer - last_offer) / (cur_ask - last_offer);
4273 if (haggle_insults())
4279 else if (x1 > max_per)
4282 if (x1 < max_per) x1 = max_per;
4284 x2 = rand_range(x1-2, x1+2);
4285 x3 = ((cur_ask - offer) * x2 / 100L) + 1;
4286 /* don't let the price go up */
4291 if (cur_ask < final_ask)
4294 cur_ask = final_ask;
4295 pmt = _("最終提示価格", "What do you offer? ");
4299 (void)(increase_insults());
4304 else if (offer >= cur_ask)
4315 (void)sprintf(out_val, _("前回の提示金額: $%ld", "Your last offer: %ld"), (long)last_offer);
4316 put_str(out_val, 1, 39);
4317 say_comment_2(cur_ask, annoyed);
4322 if (cancel) return (TRUE);
4324 updatebargain(*price, final_ask, o_ptr->number);
4332 * @brief プレイヤーが売却する時の値切り処理メインルーチン /
4333 * Haggling routine -RAK-
4334 * @param o_ptr オブジェクトの構造体参照ポインタ
4335 * @param price 最終価格を返す参照ポインタ
4336 * @return プレイヤーの価格に対して店主が不服ならばTRUEを返す /
4337 * Return TRUE if purchase is NOT successful
4339 static bool sell_haggle(object_type *o_ptr, s32b *price)
4341 s32b purse, cur_ask, final_ask;
4342 s32b last_offer = 0, offer = 0;
4344 s32b min_per, max_per;
4345 int flag, loop_flag, noneed;
4346 int annoyed = 0, final = FALSE;
4347 bool cancel = FALSE;
4348 concptr pmt = _("提示金額", "Offer");
4354 /* Obtain the starting offer and the final offer */
4355 cur_ask = price_item(o_ptr, ot_ptr->max_inflate, TRUE);
4356 final_ask = price_item(o_ptr, ot_ptr->min_inflate, TRUE);
4358 /* Determine if haggling is necessary */
4359 noneed = noneedtobargain(final_ask);
4361 /* Get the owner's payout limit */
4362 purse = (s32b)(ot_ptr->max_cost);
4364 /* No need to haggle */
4365 if (noneed || !manual_haggle || (final_ask >= purse))
4367 /* Apply Sales Tax (if needed) */
4368 if (!manual_haggle && !noneed)
4370 final_ask -= final_ask / 10;
4373 /* No reason to haggle */
4374 if (final_ask >= purse)
4376 msg_print(_("即座にこの金額にまとまった。", "You instantly agree upon the price."));
4379 /* Offer full purse */
4383 /* No need to haggle */
4386 msg_print(_("結局この金額にまとまった。", "You eventually agree upon the price."));
4390 /* No haggle option */
4393 /* Message summary */
4394 msg_print(_("すんなりとこの金額にまとまった。", "You quickly agree upon the price."));
4399 cur_ask = final_ask;
4403 pmt = _("最終提示金額", "Final Offer");
4406 /* Haggle for the whole pile */
4407 cur_ask *= o_ptr->number;
4408 final_ask *= o_ptr->number;
4411 /* Display commands */
4413 /* Haggling parameters */
4414 min_per = ot_ptr->haggle_per;
4415 max_per = min_per * 3;
4417 /* Mega-Hack -- artificial "last offer" value */
4418 last_offer = object_value(o_ptr) * o_ptr->number;
4419 last_offer = last_offer * ot_ptr->max_inflate / 100L;
4424 /* No incremental haggling yet */
4428 for (flag = FALSE; !flag; )
4434 (void)sprintf(out_val, "%s : %ld", pmt, (long)cur_ask);
4435 put_str(out_val, 1, 0);
4436 cancel = receive_offer(_("提示する価格? ", "What price do you ask? "),
4437 &offer, last_offer, -1, cur_ask, final);
4443 else if (offer < cur_ask)
4446 /* rejected, reset offer for incremental haggling */
4449 else if (offer == cur_ask)
4460 if (flag || !loop_flag) break;
4465 x1 = 100 * (last_offer - offer) / (last_offer - cur_ask);
4468 if (haggle_insults())
4474 else if (x1 > max_per)
4477 if (x1 < max_per) x1 = max_per;
4479 x2 = rand_range(x1-2, x1+2);
4480 x3 = ((offer - cur_ask) * x2 / 100L) + 1;
4481 /* don't let the price go down */
4485 if (cur_ask > final_ask)
4487 cur_ask = final_ask;
4489 pmt = _("最終提示金額", "Final Offer");
4496 /* 追加 $0 で買い取られてしまうのを防止 By FIRST*/
4499 (void)(increase_insults());
4502 else if (offer <= cur_ask)
4513 (void)sprintf(out_val,
4514 _("前回の提示価格 $%ld", "Your last bid %ld"), (long)last_offer);
4515 put_str(out_val, 1, 39);
4516 say_comment_3(cur_ask, annoyed);
4521 if (cancel) return (TRUE);
4523 updatebargain(*price, final_ask, o_ptr->number);
4531 * @brief 店からの購入処理のメインルーチン /
4532 * Buy an item from a store -RAK-
4535 static void store_purchase(void)
4538 COMMAND_CODE item, item_new;
4549 GAME_TEXT o_name[MAX_NLEN];
4553 if (cur_store_num == STORE_MUSEUM)
4555 msg_print(_("博物館から取り出すことはできません。", "Museum."));
4560 if (st_ptr->stock_num <= 0)
4562 if (cur_store_num == STORE_HOME)
4563 msg_print(_("我が家には何も置いてありません。", "Your home is empty."));
4565 msg_print(_("現在商品の在庫を切らしています。", "I am currently out of stock."));
4569 /* Find the number of objects on this and following pages */
4570 i = (st_ptr->stock_num - store_top);
4572 /* And then restrict it to the current page */
4573 if (i > store_bottom) i = store_bottom;
4577 /* ブラックマーケットの時は別のメッセージ */
4578 switch( cur_store_num ) {
4580 sprintf(out_val, "どのアイテムを取りますか? ");
4583 sprintf(out_val, "どれ? ");
4586 sprintf(out_val, "どの品物が欲しいんだい? ");
4590 if (cur_store_num == STORE_HOME)
4592 sprintf(out_val, "Which item do you want to take? ");
4596 sprintf(out_val, "Which item are you interested in? ");
4601 /* Get the item number to be bought */
4602 if (!get_stock(&item, out_val, 0, i - 1)) return;
4604 /* Get the actual index */
4605 item = item + store_top;
4607 /* Get the actual item */
4608 o_ptr = &st_ptr->stock[item];
4610 /* Assume the player wants just one of them */
4614 /* Get a copy of the object */
4615 object_copy(j_ptr, o_ptr);
4618 * If a rod or wand, allocate total maximum timeouts or charges
4619 * between those purchased and left on the shelf.
4621 reduce_charges(j_ptr, o_ptr->number - amt);
4623 /* Modify quantity */
4624 j_ptr->number = amt;
4626 /* Hack -- require room in pack */
4627 if (!inven_carry_okay(j_ptr))
4629 msg_print(_("そんなにアイテムを持てない。", "You cannot carry that many different items."));
4633 /* Determine the "best" price (per item) */
4634 best = price_item(j_ptr, ot_ptr->min_inflate, FALSE);
4636 /* Find out how many the player wants */
4637 if (o_ptr->number > 1)
4639 /* Hack -- note cost of "fixed" items */
4640 if ((cur_store_num != STORE_HOME) &&
4641 (o_ptr->ident & IDENT_FIXED))
4643 msg_format(_("一つにつき $%ldです。", "That costs %ld gold per item."), (long)(best));
4645 amt = get_quantity(NULL, o_ptr->number);
4646 if (amt <= 0) return;
4650 /* Get desired object */
4651 object_copy(j_ptr, o_ptr);
4654 * If a rod or wand, allocate total maximum timeouts or charges
4655 * between those purchased and left on the shelf.
4657 reduce_charges(j_ptr, o_ptr->number - amt);
4659 /* Modify quantity */
4660 j_ptr->number = amt;
4662 /* Hack -- require room in pack */
4663 if (!inven_carry_okay(j_ptr))
4665 msg_print(_("ザックにそのアイテムを入れる隙間がない。", "You cannot carry that many items."));
4669 /* Attempt to buy it */
4670 if (cur_store_num != STORE_HOME)
4672 /* Fixed price, quick buy */
4673 if (o_ptr->ident & (IDENT_FIXED))
4678 /* Go directly to the "best" deal */
4679 price = (best * j_ptr->number);
4685 /* Describe the object (fully) */
4686 object_desc(o_name, j_ptr, 0);
4687 msg_format(_("%s(%c)を購入する。", "Buying %s (%c)."), o_name, I2A(item));
4690 /* Haggle for a final price */
4691 choice = purchase_haggle(j_ptr, &price);
4693 /* Hack -- Got kicked out */
4694 if (st_ptr->store_open >= current_world_ptr->game_turn) return;
4697 /* Player wants it */
4700 /* Fix the item price (if "correctly" haggled) */
4701 if (price == (best * j_ptr->number)) o_ptr->ident |= (IDENT_FIXED);
4703 /* Player can afford it */
4704 if (p_ptr->au >= price)
4709 if (cur_store_num == STORE_BLACK) /* The black market is illegal! */
4710 chg_virtue(V_JUSTICE, -1);
4711 if((o_ptr->tval == TV_BOTTLE) && (cur_store_num != STORE_HOME))
4712 chg_virtue(V_NATURE, -1);
4720 /* Spend the money */
4723 /* Update the display */
4726 /* Hack -- buying an item makes you aware of it */
4727 object_aware(j_ptr);
4729 /* Hack -- clear the "fixed" flag from the item */
4730 j_ptr->ident &= ~(IDENT_FIXED);
4732 /* Describe the transaction */
4733 object_desc(o_name, j_ptr, 0);
4735 msg_format(_("%sを $%ldで購入しました。", "You bought %s for %ld gold."), o_name, (long)price);
4737 strcpy(record_o_name, o_name);
4738 record_turn = current_world_ptr->game_turn;
4740 if (record_buy) do_cmd_write_nikki(NIKKI_BUY, 0, o_name);
4741 object_desc(o_name, o_ptr, OD_NAME_ONLY);
4742 if(record_rand_art && o_ptr->art_name)
4743 do_cmd_write_nikki(NIKKI_ART, 0, o_name);
4745 /* Erase the inscription */
4746 j_ptr->inscription = 0;
4748 /* Erase the "feeling" */
4749 j_ptr->feeling = FEEL_NONE;
4750 j_ptr->ident &= ~(IDENT_STORE);
4751 /* Give it to the player */
4752 item_new = inven_carry(j_ptr);
4754 /* Describe the final result */
4755 object_desc(o_name, &p_ptr->inventory_list[item_new], 0);
4756 msg_format(_("%s(%c)を手に入れた。", "You have %s (%c)."), o_name, index_to_label(item_new));
4758 /* Auto-inscription */
4759 autopick_alter_item(item_new, FALSE);
4761 /* Now, reduce the original stack's pval. */
4762 if ((o_ptr->tval == TV_ROD) || (o_ptr->tval == TV_WAND))
4764 o_ptr->pval -= j_ptr->pval;
4768 /* Note how many slots the store used to have */
4769 i = st_ptr->stock_num;
4771 /* Remove the bought items from the store */
4772 store_item_increase(item, -amt);
4773 store_item_optimize(item);
4775 /* Store is empty */
4776 if (st_ptr->stock_num == 0)
4779 if (one_in_(STORE_SHUFFLE))
4782 msg_print(_("店主は引退した。", "The shopkeeper retires."));
4784 /* Shuffle the store */
4785 store_shuffle(cur_store_num);
4788 sprintf(buf, "%s (%s)",
4789 ot_ptr->owner_name, race_info[ot_ptr->owner_race].title);
4790 put_str(buf, 3, 10);
4791 sprintf(buf, "%s (%ld)",
4792 (f_name + f_info[cur_store_feat].name), (long)(ot_ptr->max_cost));
4799 msg_print(_("店主は新たな在庫を取り出した。", "The shopkeeper brings out some new stock."));
4802 /* New p_ptr->inventory_list */
4803 for (i = 0; i < 10; i++)
4805 /* Maintain the store */
4806 store_maint(p_ptr->town_num, cur_store_num);
4811 display_inventory();
4814 /* The item is gone */
4815 else if (st_ptr->stock_num != i)
4817 /* Pick the correct screen */
4818 if (store_top >= st_ptr->stock_num) store_top -= store_bottom;
4819 display_inventory();
4822 /* Item is still here */
4825 /* Redraw the item */
4826 display_entry(item);
4830 /* Player cannot afford it */
4833 /* Simple message (no insult) */
4834 msg_print(_("お金が足りません。", "You do not have enough gold."));
4839 /* Home is much easier */
4842 bool combined_or_reordered;
4844 /* Distribute charges of wands/rods */
4845 distribute_charges(o_ptr, j_ptr, amt);
4847 /* Give it to the player */
4848 item_new = inven_carry(j_ptr);
4850 /* Describe just the result */
4851 object_desc(o_name, &p_ptr->inventory_list[item_new], 0);
4853 msg_format(_("%s(%c)を取った。", "You have %s (%c)."), o_name, index_to_label(item_new));
4856 /* Take note if we take the last one */
4857 i = st_ptr->stock_num;
4859 /* Remove the items from the home */
4860 store_item_increase(item, -amt);
4861 store_item_optimize(item);
4863 combined_or_reordered = combine_and_reorder_home(STORE_HOME);
4865 /* Hack -- Item is still here */
4866 if (i == st_ptr->stock_num)
4868 if (combined_or_reordered) display_inventory();
4870 /* Redraw the item */
4871 else display_entry(item);
4874 /* The item is gone */
4878 if (st_ptr->stock_num == 0) store_top = 0;
4880 /* Nothing left on that screen */
4881 else if (store_top >= st_ptr->stock_num) store_top -= store_bottom;
4882 display_inventory();
4884 chg_virtue(V_SACRIFICE, 1);
4888 /* Not kicked out */
4894 * @brief 店からの売却処理のメインルーチン /
4895 * Sell an item to the store (or home)
4898 static void store_sell(void)
4905 PRICE price, value, dummy;
4913 GAME_TEXT o_name[MAX_NLEN];
4916 /* Prepare a prompt */
4917 if (cur_store_num == STORE_HOME)
4918 q = _("どのアイテムを置きますか? ", "Drop which item? ");
4920 else if (cur_store_num == STORE_MUSEUM)
4921 q = _("どのアイテムを寄贈しますか? ", "Give which item? ");
4924 q = _("どのアイテムを売りますか? ", "Sell which item? ");
4926 /* Only allow items the store will buy */
4927 item_tester_hook = store_will_buy;
4929 /* 我が家でおかしなメッセージが出るオリジナルのバグを修正 */
4930 if (cur_store_num == STORE_HOME)
4932 s = _("置けるアイテムを持っていません。", "You don't have any item to drop.");
4934 else if (cur_store_num == STORE_MUSEUM)
4936 s = _("寄贈できるアイテムを持っていません。", "You don't have any item to give.");
4940 s = _("欲しい物がないですねえ。", "You have nothing that I want.");
4943 o_ptr = choose_object(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT));
4946 /* Hack -- Cannot remove cursed items */
4947 if ((item >= INVEN_RARM) && object_is_cursed(o_ptr))
4949 msg_print(_("ふーむ、どうやらそれは呪われているようだね。", "Hmmm, it seems to be cursed."));
4953 /* Assume one item */
4956 if (o_ptr->number > 1)
4958 amt = get_quantity(NULL, o_ptr->number);
4959 if (amt <= 0) return;
4963 /* Get a copy of the object */
4964 object_copy(q_ptr, o_ptr);
4966 /* Modify quantity */
4967 q_ptr->number = amt;
4970 * Hack -- If a rod or wand, allocate total maximum
4971 * timeouts or charges to those being sold. -LM-
4973 if ((o_ptr->tval == TV_ROD) || (o_ptr->tval == TV_WAND))
4975 q_ptr->pval = o_ptr->pval * amt / o_ptr->number;
4978 /* Get a full description */
4979 object_desc(o_name, q_ptr, 0);
4981 /* Remove any inscription, feeling for stores */
4982 if ((cur_store_num != STORE_HOME) && (cur_store_num != STORE_MUSEUM))
4984 q_ptr->inscription = 0;
4985 q_ptr->feeling = FEEL_NONE;
4988 /* Is there room in the store (or the home?) */
4989 if (!store_check_num(q_ptr))
4991 if (cur_store_num == STORE_HOME)
4992 msg_print(_("我が家にはもう置く場所がない。", "Your home is full."));
4994 else if (cur_store_num == STORE_MUSEUM)
4995 msg_print(_("博物館はもう満杯だ。", "Museum is full."));
4998 msg_print(_("すいませんが、店にはもう置く場所がありません。", "I have not the room in my store to keep it."));
5005 if ((cur_store_num != STORE_HOME) && (cur_store_num != STORE_MUSEUM))
5007 /* Describe the transaction */
5008 msg_format(_("%s(%c)を売却する。", "Selling %s (%c)."), o_name, index_to_label(item));
5013 choice = sell_haggle(q_ptr, &price);
5016 if (st_ptr->store_open >= current_world_ptr->game_turn) return;
5028 if (cur_store_num == STORE_BLACK) /* The black market is illegal! */
5029 chg_virtue(V_JUSTICE, -1);
5031 if((o_ptr->tval == TV_BOTTLE) && (cur_store_num != STORE_HOME))
5032 chg_virtue(V_NATURE, 1);
5035 /* Get some money */
5038 /* Update the display */
5041 /* Get the "apparent" value */
5042 dummy = object_value(q_ptr) * q_ptr->number;
5044 identify_item(o_ptr);
5047 /* Get a copy of the object */
5048 object_copy(q_ptr, o_ptr);
5050 /* Modify quantity */
5051 q_ptr->number = amt;
5053 /* Make it look like to be known */
5054 q_ptr->ident |= IDENT_STORE;
5057 * Hack -- If a rod or wand, let the shopkeeper know just
5058 * how many charges he really paid for. -LM-
5060 if ((o_ptr->tval == TV_ROD) || (o_ptr->tval == TV_WAND))
5062 q_ptr->pval = o_ptr->pval * amt / o_ptr->number;
5065 /* Get the "actual" value */
5066 value = object_value(q_ptr) * q_ptr->number;
5068 /* Get the description all over again */
5069 object_desc(o_name, q_ptr, 0);
5071 /* Describe the result (in message buffer) */
5072 msg_format(_("%sを $%ldで売却しました。", "You sold %s for %ld gold."), o_name, (long)price);
5074 if (record_sell) do_cmd_write_nikki(NIKKI_SELL, 0, o_name);
5076 if (!((o_ptr->tval == TV_FIGURINE) && (value > 0)))
5078 /* Analyze the prices (and comment verbally) unless a figurine*/
5079 purchase_analyze(price, value, dummy);
5083 * Hack -- Allocate charges between those wands or rods sold
5084 * and retained, unless all are being sold. -LM-
5086 distribute_charges(o_ptr, q_ptr, amt);
5088 /* Reset timeouts of the sold items */
5091 /* Take the item from the player, describe the result */
5092 inven_item_increase(item, -amt);
5093 inven_item_describe(item);
5095 /* If items remain, auto-inscribe before optimizing */
5096 if (o_ptr->number > 0)
5097 autopick_alter_item(item, FALSE);
5099 inven_item_optimize(item);
5102 /* The store gets that (known) item */
5103 item_pos = store_carry(q_ptr);
5105 /* Re-display if item is now in store */
5108 store_top = (item_pos / store_bottom) * store_bottom;
5109 display_inventory();
5114 /* Player is at museum */
5115 else if (cur_store_num == STORE_MUSEUM)
5117 char o2_name[MAX_NLEN];
5118 object_desc(o2_name, q_ptr, OD_NAME_ONLY);
5120 if (-1 == store_check_num(q_ptr))
5122 msg_print(_("それと同じ品物は既に博物館にあるようです。", "The same object as it is already in the Museum."));
5126 msg_print(_("博物館に寄贈したものは取り出すことができません!!", "You cannot take items which is given to the Museum back!!"));
5129 if (!get_check(format(_("本当に%sを寄贈しますか?", "Really give %s to the Museum? "), o2_name))) return;
5131 identify_item(q_ptr);
5132 q_ptr->ident |= IDENT_MENTAL;
5134 /* Distribute charges of wands/rods */
5135 distribute_charges(o_ptr, q_ptr, amt);
5136 msg_format(_("%sを置いた。(%c)", "You drop %s (%c)."), o_name, index_to_label(item));
5139 /* Take it from the players p_ptr->inventory_list */
5140 inven_item_increase(item, -amt);
5141 inven_item_describe(item);
5142 inven_item_optimize(item);
5145 /* Let the home carry it */
5146 item_pos = home_carry(q_ptr);
5148 /* Update store display */
5151 store_top = (item_pos / store_bottom) * store_bottom;
5152 display_inventory();
5155 /* Player is at home */
5158 /* Distribute charges of wands/rods */
5159 distribute_charges(o_ptr, q_ptr, amt);
5160 msg_format(_("%sを置いた。(%c)", "You drop %s (%c)."), o_name, index_to_label(item));
5164 /* Take it from the players p_ptr->inventory_list */
5165 inven_item_increase(item, -amt);
5166 inven_item_describe(item);
5167 inven_item_optimize(item);
5170 /* Let the home carry it */
5171 item_pos = home_carry(q_ptr);
5173 /* Update store display */
5176 store_top = (item_pos / store_bottom) * store_bottom;
5177 display_inventory();
5181 if ((choice == 0) && (item >= INVEN_RARM))
5190 * @brief 店のアイテムを調べるコマンドのメインルーチン /
5191 * Examine an item in a store -JDL-
5194 static void store_examine(void)
5199 GAME_TEXT o_name[MAX_NLEN];
5203 if (st_ptr->stock_num <= 0)
5205 if (cur_store_num == STORE_HOME)
5206 msg_print(_("我が家には何も置いてありません。", "Your home is empty."));
5207 else if (cur_store_num == STORE_MUSEUM)
5208 msg_print(_("博物館には何も置いてありません。", "Museum is empty."));
5210 msg_print(_("現在商品の在庫を切らしています。", "I am currently out of stock."));
5214 /* Find the number of objects on this and following pages */
5215 i = (st_ptr->stock_num - store_top);
5217 /* And then restrict it to the current page */
5218 if (i > store_bottom) i = store_bottom;
5221 sprintf(out_val, _("どれを調べますか?", "Which item do you want to examine? "));
5223 /* Get the item number to be examined */
5224 if (!get_stock(&item, out_val, 0, i - 1)) return;
5226 /* Get the actual index */
5227 item = item + store_top;
5229 /* Get the actual item */
5230 o_ptr = &st_ptr->stock[item];
5232 /* Require full knowledge */
5233 if (!(o_ptr->ident & IDENT_MENTAL))
5235 /* This can only happen in the home */
5236 msg_print(_("このアイテムについて特に知っていることはない。", "You have no special knowledge about that item."));
5240 object_desc(o_name, o_ptr, 0);
5241 msg_format(_("%sを調べている...", "Examining %s..."), o_name);
5243 if (!screen_object(o_ptr, SCROBJ_FORCE_DETAIL))
5244 msg_print(_("特に変わったところはないようだ。", "You see nothing special."));
5251 * @brief 博物館のアイテムを除去するコマンドのメインルーチン /
5252 * Remove an item from museum (Originally from TOband)
5255 static void museum_remove_object(void)
5260 GAME_TEXT o_name[MAX_NLEN];
5264 if (st_ptr->stock_num <= 0)
5266 msg_print(_("博物館には何も置いてありません。", "Museum is empty."));
5270 /* Find the number of objects on this and following pages */
5271 i = st_ptr->stock_num - store_top;
5273 /* And then restrict it to the current page */
5274 if (i > store_bottom) i = store_bottom;
5277 sprintf(out_val, _("どのアイテムの展示をやめさせますか?", "Which item do you want to order to remove? "));
5279 /* Get the item number to be removed */
5280 if (!get_stock(&item, out_val, 0, i - 1)) return;
5282 /* Get the actual index */
5283 item = item + store_top;
5285 /* Get the actual item */
5286 o_ptr = &st_ptr->stock[item];
5288 object_desc(o_name, o_ptr, 0);
5290 msg_print(_("展示をやめさせたアイテムは二度と見ることはできません!", "You cannot see items which is removed from the Museum!"));
5291 if (!get_check(format(_("本当に%sの展示をやめさせますか?", "Really order to remove %s from the Museum? "), o_name))) return;
5293 msg_format(_("%sの展示をやめさせた。", "You ordered to remove %s."), o_name);
5295 /* Remove the items from the home */
5296 store_item_increase(item, -o_ptr->number);
5297 store_item_optimize(item);
5299 (void)combine_and_reorder_home(STORE_MUSEUM);
5301 /* The item is gone */
5304 if (st_ptr->stock_num == 0) store_top = 0;
5306 /* Nothing left on that screen */
5307 else if (store_top >= st_ptr->stock_num) store_top -= store_bottom;
5308 display_inventory();
5315 * Hack -- set this to leave the store
5317 static bool leave_store = FALSE;
5321 * @brief 店舗処理コマンド選択のメインルーチン /
5322 * Process a command in a store
5326 * Note that we must allow the use of a few "special" commands
5327 * in the stores which are not allowed in the dungeon, and we
5328 * must disable some commands which are allowed in the dungeon
5329 * but not in the stores, to prevent chaos.
5332 static void store_process_command(void)
5334 /* Handle repeating the last command */
5337 if (rogue_like_commands && command_cmd == 'l')
5339 command_cmd = 'x'; /* hack! */
5342 /* Parse the command */
5343 switch (command_cmd)
5353 /* 1 ページ戻るコマンド: 我が家のページ数が多いので重宝するはず By BUG */
5356 if (st_ptr->stock_num <= store_bottom) {
5357 msg_print(_("これで全部です。", "Entire p_ptr->inventory_list is shown."));
5360 store_top -= store_bottom;
5361 if ( store_top < 0 )
5362 store_top = ((st_ptr->stock_num - 1 )/store_bottom) * store_bottom;
5363 if ( (cur_store_num == STORE_HOME) && (powerup_home == FALSE) )
5364 if ( store_top >= store_bottom ) store_top = store_bottom;
5365 display_inventory();
5373 if (st_ptr->stock_num <= store_bottom)
5375 msg_print(_("これで全部です。", "Entire p_ptr->inventory_list is shown."));
5379 store_top += store_bottom;
5381 * 隠しオプション(powerup_home)がセットされていないときは
5382 * 我が家では 2 ページまでしか表示しない
5384 if ((cur_store_num == STORE_HOME) &&
5385 (powerup_home == FALSE) &&
5386 (st_ptr->stock_num >= STORE_INVEN_MAX))
5388 if (store_top >= (STORE_INVEN_MAX - 1))
5395 if (store_top >= st_ptr->stock_num) store_top = 0;
5398 display_inventory();
5410 /* Get (purchase) */
5437 /*** Inventory Commands ***/
5439 /* Wear/wield equipment */
5446 /* Take off equipment */
5453 /* Destroy an item */
5460 /* Equipment list */
5467 /* Inventory list */
5475 /*** Various commands ***/
5477 /* Identify an object */
5484 /* Hack -- toggle windows */
5487 toggle_inven_equip();
5491 /*** Use various objects ***/
5496 if ( (p_ptr->pclass == CLASS_MINDCRAFTER) ||
5497 (p_ptr->pclass == CLASS_BERSERKER) ||
5498 (p_ptr->pclass == CLASS_NINJA) ||
5499 (p_ptr->pclass == CLASS_MIRROR_MASTER)
5500 ) do_cmd_mind_browse();
5501 else if (p_ptr->pclass == CLASS_SMITH)
5503 else if (p_ptr->pclass == CLASS_MAGIC_EATER)
5504 do_cmd_magic_eater(TRUE, FALSE);
5505 else if (p_ptr->pclass == CLASS_SNIPER)
5506 do_cmd_snipe_browse();
5507 else do_cmd_browse();
5511 /* Inscribe an object */
5518 /* Uninscribe an object */
5521 do_cmd_uninscribe();
5527 /*** Help and Such ***/
5536 /* Identify symbol */
5539 do_cmd_query_symbol();
5543 /* Character description */
5546 p_ptr->town_num = old_town_num;
5547 do_cmd_change_name();
5548 p_ptr->town_num = inner_town_num;
5554 /*** System Commands ***/
5556 /* Hack -- User interface */
5563 /* Single line from a pref file */
5566 p_ptr->town_num = old_town_num;
5568 p_ptr->town_num = inner_town_num;
5572 /* Interact with macros */
5575 p_ptr->town_num = old_town_num;
5577 p_ptr->town_num = inner_town_num;
5581 /* Interact with visuals */
5584 p_ptr->town_num = old_town_num;
5586 p_ptr->town_num = inner_town_num;
5590 /* Interact with colors */
5593 p_ptr->town_num = old_town_num;
5595 p_ptr->town_num = inner_town_num;
5599 /* Interact with options */
5603 (void)combine_and_reorder_home(STORE_HOME);
5609 /*** Misc Commands ***/
5625 /* Repeat level feeling */
5632 /* Show previous message */
5635 do_cmd_message_one();
5639 /* Show previous messages */
5652 /* Check artifacts, uniques etc. */
5659 /* Load "screen dump" */
5662 do_cmd_load_screen();
5666 /* Save "screen dump" */
5669 do_cmd_save_screen();
5673 /* Hack -- Unknown command */
5676 if ((cur_store_num == STORE_MUSEUM) && (command_cmd == 'r'))
5678 museum_remove_object();
5682 msg_print(_("そのコマンドは店の中では使えません。", "That command does not work in stores."));
5691 * @brief 店舗処理全体のメインルーチン /
5692 * Enter a store, and interact with it. *
5696 * Note that we use the standard "request_command()" function
5697 * to get a command, allowing us to use "command_arg" and all
5698 * command macros and other nifty stuff, but we use the special
5699 * "shopping" argument, to force certain commands to be converted
5700 * into other commands, normally, we convert "p" (pray) and "m"
5701 * (cast magic) into "g" (get), and "s" (search) into "d" (drop).
5704 void do_cmd_store(void)
5710 bool need_redraw_store_inv; /* To redraw missiles damage and prices in store */
5713 if(p_ptr->wild_mode) return;
5714 Term_get_size(&w, &h);
5716 /* Calculate stocks per 1 page */
5717 xtra_stock = MIN(14+26, ((h > 24) ? (h - 24) : 0));
5718 store_bottom = MIN_STOCK + xtra_stock;
5720 /* Access the player grid */
5721 g_ptr = ¤t_floor_ptr->grid_array[p_ptr->y][p_ptr->x];
5723 /* Verify a store */
5724 if (!cave_have_flag_grid(g_ptr, FF_STORE))
5726 msg_print(_("ここには店がありません。", "You see no store here."));
5730 /* Extract the store code */
5731 which = f_info[g_ptr->feat].subtype;
5733 old_town_num = p_ptr->town_num;
5734 if ((which == STORE_HOME) || (which == STORE_MUSEUM)) p_ptr->town_num = 1;
5735 if (current_floor_ptr->dun_level) p_ptr->town_num = NO_TOWN;
5736 inner_town_num = p_ptr->town_num;
5738 /* Hack -- Check the "locked doors" */
5739 if ((town_info[p_ptr->town_num].store[which].store_open >= current_world_ptr->game_turn) ||
5742 msg_print(_("ドアに鍵がかかっている。", "The doors are locked."));
5743 p_ptr->town_num = old_town_num;
5747 /* Calculate the number of store maintainances since the last visit */
5748 maintain_num = (current_world_ptr->game_turn - town_info[p_ptr->town_num].store[which].last_visit) / (TURNS_PER_TICK * STORE_TICKS);
5750 /* Maintain the store max. 10 times */
5751 if (maintain_num > 10) maintain_num = 10;
5755 /* Maintain the store */
5756 for (i = 0; i < maintain_num; i++)
5757 store_maint(p_ptr->town_num, which);
5759 /* Save the visit */
5760 town_info[p_ptr->town_num].store[which].last_visit = current_world_ptr->game_turn;
5766 /* Hack -- Character is in "icky" mode */
5767 current_world_ptr->character_icky = TRUE;
5774 /* Do not expand macros */
5775 get_com_no_macros = TRUE;
5777 /* Save the store number */
5778 cur_store_num = which;
5780 /* Hack -- save the store feature */
5781 cur_store_feat = g_ptr->feat;
5783 /* Save the store and owner pointers */
5784 st_ptr = &town_info[p_ptr->town_num].store[cur_store_num];
5785 ot_ptr = &owners[cur_store_num][st_ptr->owner];
5787 /* Start at the beginning */
5790 play_music(TERM_XTRA_MUSIC_BASIC, MUSIC_BASIC_BUILD);
5795 leave_store = FALSE;
5797 /* Interact with player */
5798 while (!leave_store)
5800 /* Hack -- Clear line 1 */
5804 clear_from(20 + xtra_stock);
5806 /* Basic commands */
5807 prt(_(" ESC) 建物から出る", " ESC) Exit from Building."), 21 + xtra_stock, 0);
5809 /* Browse if necessary */
5810 if (st_ptr->stock_num > store_bottom)
5812 prt(_(" -)前ページ", " -) Previous page"), 22 + xtra_stock, 0);
5813 prt(_(" スペース) 次ページ", " SPACE) Next page"), 23 + xtra_stock, 0);
5817 if (cur_store_num == STORE_HOME)
5819 prt(_("g) アイテムを取る", "g) Get an item."), 21 + xtra_stock, 27);
5820 prt(_("d) アイテムを置く", "d) Drop an item."), 22 + xtra_stock, 27);
5821 prt(_("x) 家のアイテムを調べる", "x) eXamine an item in the home."), 23 + xtra_stock, 27);
5824 /* Museum commands */
5825 else if (cur_store_num == STORE_MUSEUM)
5827 prt(_("d) アイテムを置く", "d) Drop an item."), 21 + xtra_stock, 27);
5828 prt(_("r) アイテムの展示をやめる", "r) order to Remove an item."), 22 + xtra_stock, 27);
5829 prt(_("x) 博物館のアイテムを調べる", "x) eXamine an item in the museum."), 23 + xtra_stock, 27);
5835 prt(_("p) 商品を買う", "p) Purchase an item."), 21 + xtra_stock, 30);
5836 prt(_("s) アイテムを売る", "s) Sell an item."), 22 + xtra_stock, 30);
5837 prt(_("x) 商品を調べる", "x) eXamine an item in the shop"), 23 + xtra_stock,30);
5841 prt(_("i/e) 持ち物/装備の一覧", "i/e) Inventry/Equipment list"), 21 + xtra_stock, 56);
5843 if (rogue_like_commands)
5845 prt(_("w/T) 装備する/はずす", "w/T) Wear/Take off equipment"), 22 + xtra_stock, 56);
5849 prt(_("w/t) 装備する/はずす", "w/t) Wear/Take off equipment"), 22 + xtra_stock, 56);
5853 prt(_("コマンド:", "You may: "), 20 + xtra_stock, 0);
5855 request_command(TRUE);
5857 /* Process the command */
5858 store_process_command();
5861 * Hack -- To redraw missiles damage and prices in store
5862 * If player's charisma changes, or if player changes a bow, PU_BONUS is set
5864 need_redraw_store_inv = (p_ptr->update & PU_BONUS) ? TRUE : FALSE;
5866 /* Hack -- Character is still in "icky" mode */
5867 current_world_ptr->character_icky = TRUE;
5872 if (p_ptr->inventory_list[INVEN_PACK].k_idx)
5874 INVENTORY_IDX item = INVEN_PACK;
5876 object_type *o_ptr = &p_ptr->inventory_list[item];
5878 /* Hack -- Flee from the store */
5879 if (cur_store_num != STORE_HOME)
5881 if (cur_store_num == STORE_MUSEUM)
5882 msg_print(_("ザックからアイテムがあふれそうなので、あわてて博物館から出た...", "Your pack is so full that you flee the Museum..."));
5884 msg_print(_("ザックからアイテムがあふれそうなので、あわてて店から出た...", "Your pack is so full that you flee the store..."));
5890 /* Hack -- Flee from the home */
5891 else if (!store_check_num(o_ptr))
5893 msg_print(_("ザックからアイテムがあふれそうなので、あわてて家から出た...", "Your pack is so full that you flee your home..."));
5898 /* Hack -- Drop items into the home */
5906 GAME_TEXT o_name[MAX_NLEN];
5908 /* Give a message */
5909 msg_print(_("ザックからアイテムがあふれてしまった!", "Your pack overflows!"));
5913 object_copy(q_ptr, o_ptr);
5914 object_desc(o_name, q_ptr, 0);
5916 msg_format(_("%sが落ちた。(%c)", "You drop %s (%c)."), o_name, index_to_label(item));
5918 /* Remove it from the players p_ptr->inventory_list */
5919 inven_item_increase(item, -255);
5920 inven_item_describe(item);
5921 inven_item_optimize(item);
5924 /* Let the home carry it */
5925 item_pos = home_carry(q_ptr);
5927 /* Redraw the home */
5930 store_top = (item_pos / store_bottom) * store_bottom;
5931 display_inventory();
5936 /* Hack -- Redisplay store prices if charisma changes */
5937 /* Hack -- Redraw missiles damage if player changes bow */
5938 if (need_redraw_store_inv) display_inventory();
5940 /* Hack -- get kicked out of the store */
5941 if (st_ptr->store_open >= current_world_ptr->game_turn) leave_store = TRUE;
5944 select_floor_music();
5946 p_ptr->town_num = old_town_num;
5948 take_turn(p_ptr, 100);
5950 /* Hack -- Character is no longer in "icky" mode */
5951 current_world_ptr->character_icky = FALSE;
5953 /* Hack -- Cancel automatic command */
5956 /* Hack -- Cancel "see" mode */
5957 command_see = FALSE;
5959 /* Allow expanding macros */
5960 get_com_no_macros = FALSE;
5965 /* Update everything */
5966 p_ptr->update |= (PU_VIEW | PU_LITE | PU_MON_LITE);
5967 p_ptr->update |= (PU_MONSTERS);
5969 /* Redraw entire screen */
5970 p_ptr->redraw |= (PR_BASIC | PR_EXTRA | PR_EQUIPPY);
5971 p_ptr->redraw |= (PR_MAP);
5972 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
5978 * @brief 現在の町の店主を交代させる /
5979 * Shuffle one of the stores.
5980 * @param which 店舗種類のID
5983 void store_shuffle(int which)
5989 if (which == STORE_HOME) return;
5990 if (which == STORE_MUSEUM) return;
5993 /* Save the store index */
5994 cur_store_num = which;
5996 /* Activate that store */
5997 st_ptr = &town_info[p_ptr->town_num].store[cur_store_num];
6000 /* Pick a new owner */
6003 st_ptr->owner = (byte)randint0(MAX_OWNERS);
6004 if (j == st_ptr->owner) continue;
6005 for (i = 1;i < max_towns; i++)
6007 if (i == p_ptr->town_num) continue;
6008 if (st_ptr->owner == town_info[i].store[cur_store_num].owner) break;
6010 if (i == max_towns) break;
6013 /* Activate the new owner */
6014 ot_ptr = &owners[cur_store_num][st_ptr->owner];
6017 /* Reset the owner data */
6018 st_ptr->insult_cur = 0;
6019 st_ptr->store_open = 0;
6020 st_ptr->good_buy = 0;
6021 st_ptr->bad_buy = 0;
6024 /* Hack -- discount all the items */
6025 for (i = 0; i < st_ptr->stock_num; i++)
6029 o_ptr = &st_ptr->stock[i];
6031 if (!object_is_artifact(o_ptr))
6033 /* Hack -- Sell all non-artifact old items for "half price" */
6034 o_ptr->discount = 50;
6036 /* Hack -- Items are no longer "fixed price" */
6037 o_ptr->ident &= ~(IDENT_FIXED);
6039 /* Mega-Hack -- Note that the item is "on sale" */
6040 o_ptr->inscription = quark_add(_("売出中", "on sale"));
6047 * @brief 店の品揃えを変化させる /
6048 * Maintain the p_ptr->inventory_list at the stores.
6049 * @param town_num 町のID
6050 * @param store_num 店舗種類のID
6053 void store_maint(int town_num, int store_num)
6057 cur_store_num = store_num;
6060 if (store_num == STORE_HOME) return;
6061 if (store_num == STORE_MUSEUM) return;
6063 /* Activate that store */
6064 st_ptr = &town_info[town_num].store[store_num];
6066 /* Activate the owner */
6067 ot_ptr = &owners[store_num][st_ptr->owner];
6069 /* Store keeper forgives the player */
6070 st_ptr->insult_cur = 0;
6072 /* Mega-Hack -- prune the black market */
6073 if (store_num == STORE_BLACK)
6075 /* Destroy crappy black market items */
6076 for (j = st_ptr->stock_num - 1; j >= 0; j--)
6078 object_type *o_ptr = &st_ptr->stock[j];
6080 /* Destroy crappy items */
6081 if (black_market_crap(o_ptr))
6083 /* Destroy the item */
6084 store_item_increase(j, 0 - o_ptr->number);
6085 store_item_optimize(j);
6091 /* Choose the number of slots to keep */
6092 j = st_ptr->stock_num;
6094 /* Sell a few items */
6095 j = j - randint1(STORE_TURNOVER);
6097 /* Never keep more than "STORE_MAX_KEEP" slots */
6098 if (j > STORE_MAX_KEEP) j = STORE_MAX_KEEP;
6100 /* Always "keep" at least "STORE_MIN_KEEP" items */
6101 if (j < STORE_MIN_KEEP) j = STORE_MIN_KEEP;
6103 /* Hack -- prevent "underflow" */
6106 /* Destroy objects until only "j" slots are left */
6107 while (st_ptr->stock_num > j) store_delete();
6110 /* Choose the number of slots to fill */
6111 j = st_ptr->stock_num;
6113 /* Buy some more items */
6114 j = j + randint1(STORE_TURNOVER);
6116 /* Never keep more than "STORE_MAX_KEEP" slots */
6117 if (j > STORE_MAX_KEEP) j = STORE_MAX_KEEP;
6119 /* Always "keep" at least "STORE_MIN_KEEP" items */
6120 if (j < STORE_MIN_KEEP) j = STORE_MIN_KEEP;
6122 /* Hack -- prevent "overflow" */
6123 if (j >= st_ptr->stock_size) j = st_ptr->stock_size - 1;
6125 /* Acquire some new items */
6126 while (st_ptr->stock_num < j) store_create();
6131 * @brief 店舗情報を初期化する /
6132 * Initialize the stores
6133 * @param town_num 町のID
6134 * @param store_num 店舗種類のID
6137 void store_init(int town_num, int store_num)
6140 cur_store_num = store_num;
6142 /* Activate that store */
6143 st_ptr = &town_info[town_num].store[store_num];
6151 st_ptr->owner = (byte)randint0(MAX_OWNERS);
6152 for (i = 1;i < max_towns; i++)
6154 if (i == town_num) continue;
6155 if (st_ptr->owner == town_info[i].store[store_num].owner) break;
6157 if (i == max_towns) break;
6160 /* Activate the new owner */
6161 ot_ptr = &owners[store_num][st_ptr->owner];
6164 /* Initialize the store */
6165 st_ptr->store_open = 0;
6166 st_ptr->insult_cur = 0;
6167 st_ptr->good_buy = 0;
6168 st_ptr->bad_buy = 0;
6170 /* Nothing in stock */
6171 st_ptr->stock_num = 0;
6174 * MEGA-HACK - Last visit to store is
6175 * BEFORE player birth to enable store restocking
6177 st_ptr->last_visit = -10L * TURNS_PER_TICK * STORE_TICKS;
6179 /* Clear any old items */
6180 for (k = 0; k < st_ptr->stock_size; k++)
6182 object_wipe(&st_ptr->stock[k]);
6188 * @brief アイテムを町のブラックマーケットに移動させる /
6189 * @param o_ptr 移動させたいオブジェクトの構造体参照ポインタ
6192 void move_to_black_market(object_type *o_ptr)
6195 if (!p_ptr->town_num) return;
6197 st_ptr = &town_info[p_ptr->town_num].store[STORE_BLACK];
6199 o_ptr->ident |= IDENT_STORE;
6201 (void)store_carry(o_ptr);
6203 object_wipe(o_ptr); /* Don't leave a bogus object behind... */