3 * @brief 店の処理 / Store commands
6 * Copyright (c) 1989 James E. Wilson, Robert A. Koeneke\n
7 * This software may be copied and distributed for educational, research, and\n
8 * not for profit purposes provided that this copyright and statement are\n
9 * included in all such copies.\n
10 * 2014 Deskull rearranged comment for Doxygen.
18 #include "cmd-smith.h"
19 #include "cmd-zapwand.h"
20 #include "cmd-magiceat.h"
24 #include "cmd-spell.h"
26 #include "player-status.h"
27 #include "object-flavor.h"
28 #include "object-hook.h"
29 #include "floor-events.h"
32 #include "player-effects.h"
35 #include "objectkind.h"
40 * @brief 闘技場のモンスターID及び報酬アイテムテーブル /
41 * Store owners (exactly four "possible" owners per store, chosen randomly)
44 * { name, purse, max greed, min greed, haggle_per, tolerance, race, unused }
46 * Lifted extra shopkeepers from CthAngband (don't you just love open source
47 * development? ;-)). Since this gave less than 32 unique names for some
48 * shops, those have their first x names copied to reach 32.
50 * For the weapon and armour shops, several owners have a limit of 5k.
52 * I want to do 50k owners, but the purse is currently s16b. Perhaps
53 * we should just store 1/10th of the purse?
56 const owner_type owners[MAX_STORES][MAX_OWNERS] =
59 /* General store - 32 unique names */
61 Raistlin は dragonlance の powerful wizard 。
62 Rincewind the Chicken は Terry Pratchett の Discworld の登場人物 上記のパロディ?、
63 { "憶病者ラストリン", 200, 175, 108, 4, 12, RACE_HUMAN},
64 { "Raistlin the Chicken", 200, 175, 108, 4, 12, RACE_HUMAN},
68 { "フレンドリーなビルボ", 200, 170, 108, 5, 15, RACE_HOBBIT},
69 { "憶病者リンスウィンド", 200, 175, 108, 4, 12, RACE_HUMAN},
70 { "背の低いサルタン", 300, 170, 107, 5, 15, RACE_GNOME},
71 { "ハンサムなライア=エル", 300, 165, 107, 6, 18, RACE_ELF},
72 { "親切なファリルマウエン", 250, 170, 108, 5, 15, RACE_HOBBIT},
73 { "臆病者ヴォワラン", 500, 175, 108, 4, 12, RACE_HUMAN},
74 { "チビのエラシュナク", 750, 170, 107, 5, 15, RACE_BEASTMAN},
75 { "ハンサムなグラッグ", 1000, 165, 107, 6, 18, RACE_HALF_TITAN},
76 { "ケチなフォロビア", 250, 170, 108, 5, 15, RACE_HUMAN},
77 { "馬鹿のエリス", 500, 175, 108, 4, 12, RACE_HUMAN},
78 { "腹ペコのフィルバート", 750, 170, 107, 5, 15, RACE_VAMPIRE},
79 { "スナーグル・サシグア", 1000, 165, 107, 6, 18, RACE_MIND_FLAYER},
80 { "長死きエロワーズ", 250, 170, 108, 5, 15, RACE_SPECTRE},
81 { "ノロマのフンディ", 500, 175, 108, 4, 12, RACE_ZOMBIE},
82 { "グランサス", 750, 170, 107, 5, 15, RACE_SKELETON},
83 { "丁寧なロラックス", 1000, 165, 107, 6, 18, RACE_VAMPIRE},
84 { "ブッチ", 250, 170, 108, 5, 15, RACE_HALF_ORC},
85 { "美しきエルベレス", 500, 175, 108, 4, 12, RACE_HIGH_ELF},
86 { "こそこそサーレス", 750, 170, 107, 5, 15, RACE_GNOME},
87 { "ナーロック", 1000, 165, 107, 6, 18, RACE_DWARF},
88 { "チビのヘイネッカ", 250, 170, 108, 5, 15, RACE_GNOME},
89 { "きちがいロワラン", 500, 175, 108, 4, 12, RACE_HALF_GIANT},
90 { "毒息のウート", 750, 170, 107, 5, 15, RACE_DRACONIAN},
91 { "でぶっちょアラァカ", 1000, 165, 107, 6, 18, RACE_DRACONIAN},
92 { "低能なプーゴー", 250, 170, 108, 5, 15, RACE_BEASTMAN},
93 { "フェロールフィリアン", 500, 175, 108, 4, 12, RACE_ELF},
94 { "年寄りマロカ", 750, 170, 107, 5, 15, RACE_GNOME},
95 { "勇敢なサシン", 1000, 165, 107, 6, 18, RACE_HALF_GIANT},
96 { "田舎者アビエマール", 250, 170, 108, 5, 15, RACE_HUMAN},
97 { "貧乏なハーク", 500, 175, 108, 4, 12, RACE_HALF_ORC},
98 { "みじめなソアリン", 750, 170, 107, 5, 15, RACE_ZOMBIE},
99 { "質素なメルラ", 1000, 165, 107, 6, 18, RACE_ELF},
101 { "Bilbo the Friendly", 200, 170, 108, 5, 15, RACE_HOBBIT},
102 { "Rincewind the Chicken", 200, 175, 108, 4, 12, RACE_HUMAN},
103 { "Sultan the Midget", 300, 170, 107, 5, 15, RACE_GNOME},
104 { "Lyar-el the Comely", 300, 165, 107, 6, 18, RACE_ELF},
105 { "Falilmawen the Friendly", 250, 170, 108, 5, 15, RACE_HOBBIT},
106 { "Voirin the Cowardly", 500, 175, 108, 4, 12, RACE_HUMAN},
107 { "Erashnak the Midget", 750, 170, 107, 5, 15, RACE_BEASTMAN},
108 { "Grug the Comely", 1000, 165, 107, 6, 18, RACE_HALF_TITAN},
109 { "Forovir the Cheap", 250, 170, 108, 5, 15, RACE_HUMAN},
110 { "Ellis the Fool", 500, 175, 108, 4, 12, RACE_HUMAN},
111 { "Filbert the Hungry", 750, 170, 107, 5, 15, RACE_VAMPIRE},
112 { "Fthnargl Psathiggua", 1000, 165, 107, 6, 18, RACE_MIND_FLAYER},
113 { "Eloise Long-Dead", 250, 170, 108, 5, 15, RACE_SPECTRE},
114 { "Fundi the Slow", 500, 175, 108, 4, 12, RACE_ZOMBIE},
115 { "Granthus", 750, 170, 107, 5, 15, RACE_SKELETON},
116 { "Lorax the Suave", 1000, 165, 107, 6, 18, RACE_VAMPIRE},
117 { "Butch", 250, 170, 108, 5, 15, RACE_HALF_ORC},
118 { "Elbereth the Beautiful", 500, 175, 108, 4, 12, RACE_HIGH_ELF},
119 { "Sarleth the Sneaky", 750, 170, 107, 5, 15, RACE_GNOME},
120 { "Narlock", 1000, 165, 107, 6, 18, RACE_DWARF},
121 { "Haneka the Small", 250, 170, 108, 5, 15, RACE_GNOME},
122 { "Loirin the Mad", 500, 175, 108, 4, 12, RACE_HALF_GIANT},
123 { "Wuto Poisonbreath", 750, 170, 107, 5, 15, RACE_DRACONIAN},
124 { "Araaka the Rotund", 1000, 165, 107, 6, 18, RACE_DRACONIAN},
125 { "Poogor the Dumb", 250, 170, 108, 5, 15, RACE_BEASTMAN},
126 { "Felorfiliand", 500, 175, 108, 4, 12, RACE_ELF},
127 { "Maroka the Aged", 750, 170, 107, 5, 15, RACE_GNOME},
128 { "Sasin the Bold", 1000, 165, 107, 6, 18, RACE_HALF_GIANT},
129 { "Abiemar the Peasant", 250, 170, 108, 5, 15, RACE_HUMAN},
130 { "Hurk the Poor", 500, 175, 108, 4, 12, RACE_HALF_ORC},
131 { "Soalin the Wretched", 750, 170, 107, 5, 15, RACE_ZOMBIE},
132 { "Merulla the Humble", 1000, 165, 107, 6, 18, RACE_ELF},
136 /* Armoury - 28 unique names */
138 { "醜悪コン=ダー", 5000, 210, 115, 5, 7, RACE_HALF_ORC},
139 { "頑固者ダーグ=ロウ", 10000, 190, 111, 4, 9, RACE_HUMAN},
140 { "賢者デカド", 25000, 200, 112, 4, 10, RACE_DUNADAN},
141 { "鍛冶屋のウィーランド", 30000, 200, 112, 4, 5, RACE_DWARF},
142 { "醜悪コン=ダー", 10000, 210, 115, 5, 7, RACE_HALF_ORC},
143 { "頑固者ダーグ=ロウ", 15000, 190, 111, 4, 9, RACE_HUMAN},
144 { "ハンサムなデカド", 25000, 200, 112, 4, 10, RACE_AMBERITE},
145 { "エロー・ドラゴンスケイル", 30000, 200, 112, 4, 5, RACE_ELF},
146 { "デリカトス", 10000, 210, 115, 5, 7, RACE_SPRITE},
147 { "巨大なグルース", 15000, 190, 111, 4, 9, RACE_HALF_GIANT},
148 { "アニムス", 25000, 200, 112, 4, 10, RACE_GOLEM},
149 { "マルヴァス", 30000, 200, 112, 4, 5, RACE_HALF_TITAN},
150 { "セラクシス", 10000, 210, 115, 5, 7, RACE_ZOMBIE},
151 { "デス・チル", 5000, 190, 111, 4, 9, RACE_SPECTRE},
152 { "微かなドリオス", 25000, 200, 112, 4, 10, RACE_SPECTRE},
153 { "冷たいバスリック", 30000, 200, 112, 4, 5, RACE_VAMPIRE},
154 { "冷酷ヴェンジェラ", 10000, 210, 115, 5, 7, RACE_HALF_TROLL},
155 { "強者ウィラナ", 15000, 190, 111, 4, 9, RACE_HUMAN},
156 { "ヨジョ二世", 25000, 200, 112, 4, 10, RACE_DWARF},
157 { "優しいラナラー", 30000, 200, 112, 4, 5, RACE_AMBERITE},
158 { "不浄のホルバグ", 5000, 210, 115, 5, 7, RACE_HALF_ORC},
159 { "テレパスのエレレン", 15000, 190, 111, 4, 9, RACE_DARK_ELF},
160 { "イスドリリアス", 25000, 200, 112, 4, 10, RACE_SPRITE},
161 { "一つ目ヴェグナー", 5000, 200, 112, 4, 5, RACE_CYCLOPS},
162 { "混沌のロディッシュ", 10000, 210, 115, 5, 7, RACE_BEASTMAN},
163 { "剣豪ヘジン", 15000, 190, 111, 4, 9, RACE_NIBELUNG},
164 { "ずる屋のエルベレリス", 10000, 200, 112, 4, 10, RACE_DARK_ELF},
165 { "インプのザサス", 30000, 200, 112, 4, 5, RACE_IMP},
166 { "醜悪コン=ダー", 5000, 210, 115, 5, 7, RACE_HALF_ORC},
167 { "頑固者ダーグ=ロウ", 10000, 190, 111, 4, 9, RACE_HUMAN},
168 { "ハンサムなデカド", 25000, 200, 112, 4, 10, RACE_AMBERITE},
169 { "鍛冶屋のウィーランド", 30000, 200, 112, 4, 5, RACE_DWARF},
171 { "Kon-Dar the Ugly", 5000, 210, 115, 5, 7, RACE_HALF_ORC},
172 { "Darg-Low the Grim", 10000, 190, 111, 4, 9, RACE_HUMAN},
173 { "Decado the Handsome", 25000, 200, 112, 4, 10, RACE_DUNADAN},
174 { "Wieland the Smith", 30000, 200, 112, 4, 5, RACE_DWARF},
175 { "Kon-Dar the Ugly", 10000, 210, 115, 5, 7, RACE_HALF_ORC},
176 { "Darg-Low the Grim", 15000, 190, 111, 4, 9, RACE_HUMAN},
177 { "Decado the Handsome", 25000, 200, 112, 4, 10, RACE_AMBERITE},
178 { "Elo Dragonscale", 30000, 200, 112, 4, 5, RACE_ELF},
179 { "Delicatus", 10000, 210, 115, 5, 7, RACE_SPRITE},
180 { "Gruce the Huge", 15000, 190, 111, 4, 9, RACE_HALF_GIANT},
181 { "Animus", 25000, 200, 112, 4, 10, RACE_GOLEM},
182 { "Malvus", 30000, 200, 112, 4, 5, RACE_HALF_TITAN},
183 { "Selaxis", 10000, 210, 115, 5, 7, RACE_ZOMBIE},
184 { "Deathchill", 5000, 190, 111, 4, 9, RACE_SPECTRE},
185 { "Drios the Faint", 25000, 200, 112, 4, 10, RACE_SPECTRE},
186 { "Bathric the Cold", 30000, 200, 112, 4, 5, RACE_VAMPIRE},
187 { "Vengella the Cruel", 10000, 210, 115, 5, 7, RACE_HALF_TROLL},
188 { "Wyrana the Mighty", 15000, 190, 111, 4, 9, RACE_HUMAN},
189 { "Yojo II", 25000, 200, 112, 4, 10, RACE_DWARF},
190 { "Ranalar the Sweet", 30000, 200, 112, 4, 5, RACE_AMBERITE},
191 { "Horbag the Unclean", 5000, 210, 115, 5, 7, RACE_HALF_ORC},
192 { "Elelen the Telepath", 15000, 190, 111, 4, 9, RACE_DARK_ELF},
193 { "Isedrelias", 25000, 200, 112, 4, 10, RACE_SPRITE},
194 { "Vegnar One-eye", 5000, 200, 112, 4, 5, RACE_CYCLOPS},
195 { "Rodish the Chaotic", 10000, 210, 115, 5, 7, RACE_BEASTMAN},
196 { "Hesin Swordmaster", 15000, 190, 111, 4, 9, RACE_NIBELUNG},
197 { "Elvererith the Cheat", 10000, 200, 112, 4, 10, RACE_DARK_ELF},
198 { "Zzathath the Imp", 30000, 200, 112, 4, 5, RACE_IMP},
199 { "Kon-Dar the Ugly", 5000, 210, 115, 5, 7, RACE_HALF_ORC},
200 { "Darg-Low the Grim", 10000, 190, 111, 4, 9, RACE_HUMAN},
201 { "Decado the Handsome", 25000, 200, 112, 4, 10, RACE_AMBERITE},
202 { "Wieland the Smith", 30000, 200, 112, 4, 5, RACE_DWARF},
207 /* Weapon Smith - 28 unique names */
209 { "残忍なるアーノルド", 5000, 210, 115, 6, 6, RACE_HALF_TROLL},
210 { "獣殺しのアーンダル", 10000, 185, 110, 5, 9, RACE_HALF_ELF},
211 { "獣マスターのエディー", 25000, 190, 115, 5, 7, RACE_HOBBIT},
212 { "竜殺しのオグライン", 30000, 195, 112, 4, 8, RACE_DWARF},
213 { "熟練者ドリュー", 10000, 210, 115, 6, 6, RACE_HUMAN},
214 { "龍の子オラックス", 15000, 185, 110, 5, 9, RACE_DRACONIAN},
215 { "病気持ちのアンスラックス", 25000, 190, 115, 5, 7, RACE_BEASTMAN},
216 { "頑丈者アルコス", 30000, 195, 112, 4, 8, RACE_DWARF},
217 { "腐れ者のサリアス", 5000, 210, 115, 6, 6, RACE_ZOMBIE},
218 { "晒し骨のトゥエシク", 15000, 185, 110, 5, 9, RACE_SKELETON},
219 { "ビリオス", 25000, 190, 115, 5, 7, RACE_BEASTMAN},
220 { "ファスガル", 30000, 195, 112, 4, 8, RACE_ZOMBIE},
221 { "パラディンのエレフリス", 10000, 210, 115, 6, 6, RACE_BARBARIAN},
222 { "キ'トリッ'ク", 15000, 185, 110, 5, 9, RACE_KLACKON},
223 { "蜘蛛の友ドゥロカス", 25000, 190, 115, 5, 7, RACE_DARK_ELF},
224 { "巨人殺しのフングス", 30000, 195, 112, 4, 8, RACE_DWARF},
225 { "デランサ", 10000, 210, 115, 6, 6, RACE_ELF},
226 { "レンジャーのソルビスタニ", 15000, 185, 110, 5, 9, RACE_HALF_ELF},
227 { "ノロマのゾリル", 25000, 190, 115, 5, 7, RACE_GOLEM},
228 { "イーオン・フラックス", 20000, 195, 112, 4, 8, RACE_HALF_ELF},
229 { "強者ナドック", 10000, 210, 115, 6, 6, RACE_HOBBIT},
230 { "弱虫エラモグ", 15000, 185, 110, 5, 9, RACE_KOBOLD},
231 { "公正なエオウィリス", 25000, 190, 115, 5, 7, RACE_VAMPIRE},
232 { "バルログ殺しのヒュイモグ", 30000, 195, 112, 4, 8, RACE_HALF_ORC},
233 { "冷酷ピーダス", 5000, 210, 115, 6, 6, RACE_HUMAN},
234 { "ヴァモグ スレイヤー", 15000, 185, 110, 5, 9, RACE_HALF_OGRE},
235 { "性悪フーシュナク", 25000, 190, 115, 5, 7, RACE_BEASTMAN},
236 { "舞闘バレン", 30000, 195, 112, 4, 8, RACE_BARBARIAN},
237 { "残忍なるアーノルド", 5000, 210, 115, 6, 6, RACE_BARBARIAN},
238 { "獣殺しのアーンダル", 10000, 185, 110, 5, 9, RACE_HALF_ELF},
239 { "ビーストマスター・エディー", 25000, 190, 115, 5, 7, RACE_HALF_ORC},
240 { "竜殺しのオグライン", 30000, 195, 112, 4, 8, RACE_DWARF},
242 { "Arnold the Beastly", 5000, 210, 115, 6, 6, RACE_BARBARIAN},
243 { "Arndal Beast-Slayer", 10000, 185, 110, 5, 9, RACE_HALF_ELF},
244 { "Eddie Beast-Master", 25000, 190, 115, 5, 7, RACE_HALF_ORC},
245 { "Oglign Dragon-Slayer", 30000, 195, 112, 4, 8, RACE_DWARF},
246 { "Drew the Skilled", 10000, 210, 115, 6, 6, RACE_HUMAN},
247 { "Orrax Dragonson", 15000, 185, 110, 5, 9, RACE_DRACONIAN},
248 { "Anthrax Disease-Carrier", 25000, 190, 115, 5, 7, RACE_BEASTMAN},
249 { "Arkhoth the Stout", 30000, 195, 112, 4, 8, RACE_DWARF},
250 { "Sarlyas the Rotten", 5000, 210, 115, 6, 6, RACE_ZOMBIE},
251 { "Tuethic Bare-Bones", 15000, 185, 110, 5, 9, RACE_SKELETON},
252 { "Bilious", 25000, 190, 115, 5, 7, RACE_BEASTMAN},
253 { "Fasgul", 30000, 195, 112, 4, 8, RACE_ZOMBIE},
254 { "Ellefris the Paladin", 10000, 210, 115, 6, 6, RACE_BARBARIAN},
255 { "K'trrik'k", 15000, 185, 110, 5, 9, RACE_KLACKON},
256 { "Drocus Spiderfriend", 25000, 190, 115, 5, 7, RACE_DARK_ELF},
257 { "Fungus Giant-Slayer", 30000, 195, 112, 4, 8, RACE_DWARF},
258 { "Delantha", 10000, 210, 115, 6, 6, RACE_ELF},
259 { "Solvistani the Ranger", 15000, 185, 110, 5, 9, RACE_HALF_ELF},
260 { "Xoril the Slow", 25000, 190, 115, 5, 7, RACE_GOLEM},
261 { "Aeon Flux", 20000, 195, 112, 4, 8, RACE_HALF_ELF},
262 { "Nadoc the Strong", 10000, 210, 115, 6, 6, RACE_HOBBIT},
263 { "Eramog the Weak", 15000, 185, 110, 5, 9, RACE_KOBOLD},
264 { "Eowilith the Fair", 25000, 190, 115, 5, 7, RACE_VAMPIRE},
265 { "Huimog Balrog-Slayer", 30000, 195, 112, 4, 8, RACE_HALF_ORC},
266 { "Peadus the Cruel", 5000, 210, 115, 6, 6, RACE_HUMAN},
267 { "Vamog Slayer", 15000, 185, 110, 5, 9, RACE_HALF_OGRE},
268 { "Hooshnak the Vicious", 25000, 190, 115, 5, 7, RACE_BEASTMAN},
269 { "Balenn War-Dancer", 30000, 195, 112, 4, 8, RACE_BARBARIAN},
270 { "Arnold the Beastly", 5000, 210, 115, 6, 6, RACE_BARBARIAN},
271 { "Arndal Beast-Slayer", 10000, 185, 110, 5, 9, RACE_HALF_ELF},
272 { "Eddie Beast-Master", 25000, 190, 115, 5, 7, RACE_HALF_ORC},
273 { "Oglign Dragon-Slayer", 30000, 195, 112, 4, 8, RACE_DWARF},
277 /* Temple - 22 unique names */
279 { "質素なルードヴィヒ", 5000, 175, 109, 6, 15, RACE_HUMAN},
280 { "パラディンのガンナー", 10000, 185, 110, 5, 23, RACE_HUMAN},
281 { "選ばれしトリン", 25000, 180, 107, 6, 20, RACE_ELF},
282 { "賢明なるサラストロ", 30000, 185, 109, 5, 15, RACE_DWARF},
283 { "パーシヴァル卿", 25000, 180, 107, 6, 20, RACE_HIGH_ELF},
284 { "神聖なるアセナス", 30000, 185, 109, 5, 15, RACE_HUMAN},
285 { "マッキノン", 10000, 175, 109, 6, 15, RACE_HUMAN},
286 { "謹み婦人", 15000, 185, 110, 5, 23, RACE_HIGH_ELF},
287 { "ドルイドのハシュニック", 25000, 180, 107, 6, 20, RACE_HOBBIT},
288 { "フィナク", 30000, 185, 109, 5, 15, RACE_YEEK},
289 { "クリキック", 10000, 175, 109, 6, 15, RACE_KLACKON},
290 { "荒くれ者モリヴァル", 15000, 185, 110, 5, 23, RACE_ELF},
291 { "暗きホシャック", 25000, 180, 107, 6, 20, RACE_IMP},
292 { "賢者アタール", 30000, 185, 109, 5, 15, RACE_HUMAN},
293 { "清きイベニッド", 10000, 175, 109, 6, 15, RACE_HUMAN},
294 { "エリディシュ", 15000, 185, 110, 5, 23, RACE_HALF_TROLL},
295 { "呪術師ヴルドゥシュ", 25000, 180, 107, 6, 20, RACE_HALF_OGRE},
296 { "狂戦士ハオブ", 30000, 185, 109, 5, 15, RACE_BARBARIAN},
297 { "若きプルーグディシュ", 10000, 175, 109, 6, 15, RACE_HALF_OGRE},
298 { "きちがいラムワイズ", 15000, 185, 110, 5, 23, RACE_YEEK},
299 { "有徳者ムワート", 25000, 180, 107, 6, 20, RACE_KOBOLD},
300 { "弱虫ダードバード", 30000, 185, 109, 5, 15, RACE_SPECTRE},
301 { "質素なルードヴィヒ", 5000, 175, 109, 6, 15, RACE_HUMAN},
302 { "パラディンのガンナー", 10000, 185, 110, 5, 23, RACE_HUMAN},
303 { "選ばれしトリン", 25000, 180, 107, 6, 20, RACE_ELF},
304 { "賢明なるサラストロ", 30000, 185, 109, 5, 15, RACE_DWARF},
305 { "パーシヴァル卿", 25000, 180, 107, 6, 20, RACE_HIGH_ELF},
306 { "神聖なるアセナス", 30000, 185, 109, 5, 15, RACE_HUMAN},
307 { "マッキノン", 10000, 175, 109, 6, 15, RACE_HUMAN},
308 { "謹み婦人", 15000, 185, 110, 5, 23, RACE_HIGH_ELF},
309 { "ドルイドのハシュニック", 25000, 180, 107, 6, 20, RACE_HOBBIT},
310 { "フィナク", 30000, 185, 109, 5, 15, RACE_YEEK},
312 { "Ludwig the Humble", 5000, 175, 109, 6, 15, RACE_DWARF},
313 { "Gunnar the Paladin", 10000, 185, 110, 5, 23, RACE_HALF_TROLL},
314 { "Torin the Chosen", 25000, 180, 107, 6, 20, RACE_HIGH_ELF},
315 { "Sarastro the Wise", 30000, 185, 109, 5, 15, RACE_HUMAN},
316 { "Sir Parsival the Pure", 25000, 180, 107, 6, 20, RACE_HIGH_ELF},
317 { "Asenath the Holy", 30000, 185, 109, 5, 15, RACE_HUMAN},
318 { "McKinnon", 10000, 175, 109, 6, 15, RACE_HUMAN},
319 { "Mistress Chastity", 15000, 185, 110, 5, 23, RACE_HIGH_ELF},
320 { "Hashnik the Druid", 25000, 180, 107, 6, 20, RACE_HOBBIT},
321 { "Finak", 30000, 185, 109, 5, 15, RACE_YEEK},
322 { "Krikkik", 10000, 175, 109, 6, 15, RACE_KLACKON},
323 { "Morival the Wild", 15000, 185, 110, 5, 23, RACE_ELF},
324 { "Hoshak the Dark", 25000, 180, 107, 6, 20, RACE_IMP},
325 { "Atal the Wise", 30000, 185, 109, 5, 15, RACE_HUMAN},
326 { "Ibenidd the Chaste", 10000, 175, 109, 6, 15, RACE_HUMAN},
327 { "Eridish", 15000, 185, 110, 5, 23, RACE_HALF_TROLL},
328 { "Vrudush the Shaman", 25000, 180, 107, 6, 20, RACE_HALF_OGRE},
329 { "Haob the Berserker", 30000, 185, 109, 5, 15, RACE_BARBARIAN},
330 { "Proogdish the Youthfull", 10000, 175, 109, 6, 15, RACE_HALF_OGRE},
331 { "Lumwise the Mad", 15000, 185, 110, 5, 23, RACE_YEEK},
332 { "Muirt the Virtuous", 25000, 180, 107, 6, 20, RACE_KOBOLD},
333 { "Dardobard the Weak", 30000, 185, 109, 5, 15, RACE_SPECTRE},
334 { "Ludwig the Humble", 5000, 175, 109, 6, 15, RACE_DWARF},
335 { "Gunnar the Paladin", 10000, 185, 110, 5, 23, RACE_HALF_TROLL},
336 { "Torin the Chosen", 25000, 180, 107, 6, 20, RACE_HIGH_ELF},
337 { "Sarastro the Wise", 30000, 185, 109, 5, 15, RACE_HUMAN},
338 { "Sir Parsival the Pure", 25000, 180, 107, 6, 20, RACE_HIGH_ELF},
339 { "Asenath the Holy", 30000, 185, 109, 5, 15, RACE_HUMAN},
340 { "McKinnon", 10000, 175, 109, 6, 15, RACE_HUMAN},
341 { "Mistress Chastity", 15000, 185, 110, 5, 23, RACE_HIGH_ELF},
342 { "Hashnik the Druid", 25000, 180, 107, 6, 20, RACE_HOBBIT},
343 { "Finak", 30000, 185, 109, 5, 15, RACE_YEEK},
347 /* Alchemist - 26 unique names */
349 { "化学者マウザー", 10000, 190, 111, 5, 8, RACE_HALF_ELF},
350 { "カオスのウィズル", 10000, 190, 110, 6, 8, RACE_HOBBIT},
351 { "強欲ミダス", 15000, 200, 116, 6, 9, RACE_GNOME},
352 { "貧弱ジャ=ファー", 15000, 220, 111, 4, 9, RACE_ELF},/*FIRST*/
353 { "カカルラカカル", 15000, 200, 116, 6, 9, RACE_KLACKON},
354 { "錬金術師ジャル=エス", 15000, 220, 111, 4, 9, RACE_ELF},
355 { "用心深いファネラス", 10000, 190, 111, 5, 8, RACE_DWARF},
356 { "キチガイのルンシー", 10000, 190, 110, 6, 8, RACE_HUMAN},
357 { "グランブルワース", 15000, 200, 116, 6, 9, RACE_GNOME},
358 { "フリッター", 15000, 220, 111, 4, 9, RACE_SPRITE},
359 { "ザリルス", 10000, 190, 111, 5, 8, RACE_HUMAN},
360 { "古きエグバート", 10000, 190, 110, 6, 8, RACE_DWARF},
361 { "誇り高きヴァリンドラ", 15000, 200, 116, 6, 9, RACE_HIGH_ELF},
362 { "錬金術師タエン", 15000, 220, 111, 4, 9, RACE_HUMAN},
363 { "巧言カイド", 10000, 190, 111, 5, 8, RACE_VAMPIRE},
364 { "暗きフリア", 10000, 190, 110, 6, 8, RACE_NIBELUNG},
365 { "質素なドムリ", 15000, 200, 116, 6, 9, RACE_DWARF},
366 { "魔の子ヤァジュッカ", 15000, 220, 111, 4, 9, RACE_IMP},
367 { "薬草師ジェララルドール", 10000, 190, 111, 5, 8, RACE_HIGH_ELF},
368 { "賢者オレラルダン", 10000, 190, 110, 6, 8, RACE_BARBARIAN},
369 { "デモニシストのフゾグロ", 15000, 200, 116, 6, 9, RACE_IMP},
370 { "錬金術師ドゥリアシュ", 15000, 220, 111, 4, 9, RACE_HALF_ORC},
371 { "強者ネリア", 10000, 190, 111, 5, 8, RACE_CYCLOPS},
372 { "辛口リグナス", 10000, 190, 110, 6, 8, RACE_HALF_ORC},
373 { "ティルバ", 15000, 200, 116, 6, 9, RACE_HOBBIT},
374 { "金持ちミリルドリック", 15000, 220, 111, 4, 9, RACE_HUMAN},
376 { "科学者マウザー", 10000, 190, 111, 5, 8, RACE_HALF_ELF},
377 { "カオスのウィズル", 10000, 190, 110, 6, 8, RACE_HOBBIT},
378 { "強欲ミダス", 15000, 200, 116, 6, 9, RACE_GNOME},
379 { "錬金術師ジャ=ファー", 15000, 220, 111, 4, 9, RACE_ELF},
380 { "カカルラカカル", 15000, 200, 116, 6, 9, RACE_KLACKON},
381 { "錬金術師ジャル=エス", 15000, 220, 111, 4, 9, RACE_ELF},
383 { "Mauser the Chemist", 10000, 190, 111, 5, 8, RACE_HALF_ELF},
384 { "Wizzle the Chaotic", 10000, 190, 110, 6, 8, RACE_HOBBIT},
385 { "Midas the Greedy", 15000, 200, 116, 6, 9, RACE_GNOME},
386 { "Ja-Far the Alchemist", 15000, 220, 111, 4, 9, RACE_ELF},
387 { "Kakalrakakal", 15000, 200, 116, 6, 9, RACE_KLACKON},
388 { "Jal-Eth the Alchemist", 15000, 220, 111, 4, 9, RACE_ELF},
389 { "Fanelath the Cautious", 10000, 190, 111, 5, 8, RACE_DWARF},
390 { "Runcie the Insane", 10000, 190, 110, 6, 8, RACE_HUMAN},
391 { "Grumbleworth", 15000, 200, 116, 6, 9, RACE_GNOME},
392 { "Flitter", 15000, 220, 111, 4, 9, RACE_SPRITE},
393 { "Xarillus", 10000, 190, 111, 5, 8, RACE_HUMAN},
394 { "Egbert the Old", 10000, 190, 110, 6, 8, RACE_DWARF},
395 { "Valindra the Proud", 15000, 200, 116, 6, 9, RACE_HIGH_ELF},
396 { "Taen the Alchemist", 15000, 220, 111, 4, 9, RACE_HUMAN},
397 { "Cayd the Sweet", 10000, 190, 111, 5, 8, RACE_VAMPIRE},
398 { "Fulir the Dark", 10000, 190, 110, 6, 8, RACE_NIBELUNG},
399 { "Domli the Humble", 15000, 200, 116, 6, 9, RACE_DWARF},
400 { "Yaarjukka Demonspawn", 15000, 220, 111, 4, 9, RACE_IMP},
401 { "Gelaraldor the Herbmaster", 10000, 190, 111, 5, 8, RACE_HIGH_ELF},
402 { "Olelaldan the Wise", 10000, 190, 110, 6, 8, RACE_BARBARIAN},
403 { "Fthoglo the Demonicist", 15000, 200, 116, 6, 9, RACE_IMP},
404 { "Dridash the Alchemist", 15000, 220, 111, 4, 9, RACE_HALF_ORC},
405 { "Nelir the Strong", 10000, 190, 111, 5, 8, RACE_CYCLOPS},
406 { "Lignus the Pungent", 10000, 190, 110, 6, 8, RACE_HALF_ORC},
407 { "Tilba", 15000, 200, 116, 6, 9, RACE_HOBBIT},
408 { "Myrildric the Wealthy", 15000, 220, 111, 4, 9, RACE_HUMAN},
410 { "Mauser the Chemist", 10000, 190, 111, 5, 8, RACE_HALF_ELF},
411 { "Wizzle the Chaotic", 10000, 190, 110, 6, 8, RACE_HOBBIT},
412 { "Midas the Greedy", 15000, 200, 116, 6, 9, RACE_GNOME},
413 { "Ja-Far the Alchemist", 15000, 220, 111, 4, 9, RACE_ELF},
414 { "Kakalrakakal", 15000, 200, 116, 6, 9, RACE_KLACKON},
415 { "Jal-Eth the Alchemist", 15000, 220, 111, 4, 9, RACE_ELF},
420 /* Magic Shop - 23 unique names */
422 { "ソーサラーのロ=パン", 20000, 200, 110, 7, 8, RACE_HALF_ELF},
423 { "偉大なるブガービイ", 20000, 215, 113, 6, 10, RACE_GNOME},
424 { "イェンダーの魔法使い", 30000, 200, 110, 7, 10, RACE_HUMAN},
425 { "死霊使いリャク",30000, 175, 110, 5, 11, RACE_HIGH_ELF},
426 { "魔術師スキドゥニー", 15000, 200, 110, 7, 8, RACE_HALF_ELF},
427 { "幻術師キリア", 30000, 200, 110, 7, 10, RACE_HUMAN},
428 { "死霊術師ニッキ", 30000, 175, 110, 5, 11, RACE_DARK_ELF},
429 { "ソロストラン", 15000, 200, 110, 7, 8, RACE_SPRITE},
430 { "烏賊口アチシェ", 20000, 215, 113, 6, 10, RACE_MIND_FLAYER},
431 { "貴族のカザ", 30000, 200, 110, 7, 10, RACE_HIGH_ELF},
432 { "暗きファジル", 30000, 175, 110, 5, 11, RACE_DARK_ELF},
433 { "偉大なるケルドーン", 15000, 200, 110, 7, 8, RACE_DWARF},
434 { "フィランスロプス", 20000, 215, 113, 6, 10, RACE_HOBBIT},
435 { "魔女のアグナー", 30000, 200, 110, 7, 10, RACE_HUMAN},
436 { "死霊術師ビュリアンス", 30000, 175, 110, 5, 11, RACE_BEASTMAN},
437 { "ハイメイジのヴイラク", 15000, 200, 110, 7, 8, RACE_BEASTMAN},
438 { "知恵者マディッシュ", 20000, 215, 113, 6, 10, RACE_BEASTMAN},
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_BARBARIAN},
442 { "神秘家クトゥアロス", 20000, 215, 113, 6, 10, RACE_MIND_FLAYER},
443 { "幻術師イベリ", 30000, 200, 110, 7, 10, RACE_SKELETON},
444 { "死霊術師ヘトー", 30000, 175, 110, 5, 11, RACE_YEEK},
445 { "魔術師ロ=パン", 20000, 200, 110, 7, 8, RACE_HALF_ELF},
446 { "偉大なるブガービイ", 20000, 215, 113, 6, 10, RACE_GNOME},
447 { "イェンダーの魔法使い", 30000, 200, 110, 7, 10, RACE_HUMAN},
448 { "死霊術師リャク", 30000, 175, 110, 5, 11, RACE_DARK_ELF},
449 { "魔術師スキドゥニー", 15000, 200, 110, 7, 8, RACE_HALF_ELF},
450 { "幻術師キリア", 30000, 200, 110, 7, 10, RACE_HUMAN},
451 { "死霊術師ニッキ", 30000, 175, 110, 5, 11, RACE_DARK_ELF},
452 { "ソロストラン", 15000, 200, 110, 7, 8, RACE_SPRITE},
453 { "烏賊口アチシェ", 20000, 215, 113, 6, 10, RACE_MIND_FLAYER},
455 { "Lo Pan the Sorcerer", 20000, 200, 110, 7, 8, RACE_HALF_ELF},
456 { "Buggerby the Great", 20000, 215, 113, 6, 10, RACE_GNOME},
457 { "The Wizard of Yendor", 30000, 200, 110, 7, 10, RACE_HUMAN},
458 { "Rjak the Necromancer", 30000, 175, 110, 5, 11, RACE_DARK_ELF},
459 { "Skidney the Sorcerer", 15000, 200, 110, 7, 8, RACE_HALF_ELF},
460 { "Kyria the Illusionist", 30000, 200, 110, 7, 10, RACE_HUMAN},
461 { "Nikki the Necromancer", 30000, 175, 110, 5, 11, RACE_DARK_ELF},
462 { "Solostoran", 15000, 200, 110, 7, 8, RACE_SPRITE},
463 { "Achshe the Tentacled", 20000, 215, 113, 6, 10, RACE_MIND_FLAYER},
464 { "Kaza the Noble", 30000, 200, 110, 7, 10, RACE_HIGH_ELF},
465 { "Fazzil the Dark", 30000, 175, 110, 5, 11, RACE_DARK_ELF},
466 { "Keldorn the Grand", 15000, 200, 110, 7, 8, RACE_DWARF},
467 { "Philanthropus", 20000, 215, 113, 6, 10, RACE_HOBBIT},
468 { "Agnar the Enchantress", 30000, 200, 110, 7, 10, RACE_HUMAN},
469 { "Buliance the Necromancer", 30000, 175, 110, 5, 11, RACE_BEASTMAN},
470 { "Vuirak the High-Mage", 15000, 200, 110, 7, 8, RACE_BEASTMAN},
471 { "Madish the Smart", 20000, 215, 113, 6, 10, RACE_BEASTMAN},
472 { "Falebrimbor", 30000, 200, 110, 7, 10, RACE_HIGH_ELF},
473 { "Felil-Gand the Subtle", 30000, 175, 110, 5, 11, RACE_DARK_ELF},
474 { "Thalegord the Shaman", 15000, 200, 110, 7, 8, RACE_BARBARIAN},
475 { "Cthoaloth the Mystic", 20000, 215, 113, 6, 10, RACE_MIND_FLAYER},
476 { "Ibeli the Illusionist", 30000, 200, 110, 7, 10, RACE_SKELETON},
477 { "Heto the Necromancer", 30000, 175, 110, 5, 11, RACE_YEEK},
478 { "Lo Pan the Sorcerer", 20000, 200, 110, 7, 8, RACE_HALF_ELF},
479 { "Buggerby the Great", 20000, 215, 113, 6, 10, RACE_GNOME},
480 { "The Wizard of Yendor", 30000, 200, 110, 7, 10, RACE_HUMAN},
481 { "Rjak the Necromancer", 30000, 175, 110, 5, 11, RACE_DARK_ELF},
482 { "Skidney the Sorcerer", 15000, 200, 110, 7, 8, RACE_HALF_ELF},
483 { "Kyria the Illusionist", 30000, 200, 110, 7, 10, RACE_HUMAN},
484 { "Nikki the Necromancer", 30000, 175, 110, 5, 11, RACE_DARK_ELF},
485 { "Solostoran", 15000, 200, 110, 7, 8, RACE_SPRITE},
486 { "Achshe the Tentacled", 20000, 215, 113, 6, 10, RACE_MIND_FLAYER},
490 /* Black Market - 32 unique names */
492 { "ガリー=ギガズ", 20000, 250, 150, 10, 5, RACE_HALF_TROLL},
493 { "ゴブリンのヒストーア", 20000, 250, 150, 10, 5, RACE_HALF_ORC},
494 { "フェレンギ人クアーク", 30000, 250, 150, 10, 5, RACE_HUMAN},
495 { "公正なる(?)トッピ", 30000, 250, 150, 10, 5, RACE_ELF},
496 { "死人ヴァッサ", 20000, 250, 150, 10, 5, RACE_ZOMBIE},
497 { "裏切り者カイン", 20000, 250, 150, 10, 5, RACE_VAMPIRE},
498 { "ブボニカス", 30000, 250, 150, 10, 5, RACE_BEASTMAN},
499 { "コープスライト", 30000, 250, 150, 10, 5, RACE_SPECTRE},
500 { "血に飢えしパリッシュ", 20000, 250, 150, 10, 5, RACE_VAMPIRE},
501 { "ヴァイル", 20000, 250, 150, 10, 5, RACE_SKELETON},
502 { "信頼のプレンティス", 30000, 250, 150, 10, 5, RACE_SKELETON},
503 { "人間殺しのグリエラ", 30000, 250, 150, 10, 5, RACE_IMP},
504 { "エンジェル", 20000, 250, 150, 10, 5, RACE_VAMPIRE},
505 { "水膨れフロツァム", 20000, 250, 150, 10, 5, RACE_ZOMBIE},
506 { "ニーヴァル", 30000, 250, 150, 10, 5, RACE_VAMPIRE},
507 { "明るいアナスタシア", 30000, 250, 150, 10, 5, RACE_SPECTRE},
508 { "死霊術師チャリティー", 20000, 250, 150, 10, 5, RACE_DARK_ELF},
509 { "ボクサーのプグナシオス", 20000, 250, 150, 10, 5, RACE_HALF_ORC},
510 { "幸運なフットソア", 30000, 250, 150, 10, 5, RACE_BEASTMAN},
511 { "光指のシドリア", 30000, 250, 150, 10, 5, RACE_HUMAN},
512 { "手品師リアソー", 20000, 250, 150, 10, 5, RACE_HOBBIT},
513 { "やりくり上手のジャナッカ", 20000, 250, 150, 10, 5, RACE_GNOME},
514 { "悪党シーナ", 30000, 250, 150, 10, 5, RACE_GNOME},
515 { "大爪アルニッキ", 30000, 250, 150, 10, 5, RACE_DRACONIAN},
516 { "貧乏チャエアンド", 20000, 250, 150, 10, 5, RACE_HUMAN},
517 { "山賊アファードーフ", 20000, 250, 150, 10, 5, RACE_BARBARIAN},
518 { "強欲ラザクスル", 30000, 250, 150, 10, 5, RACE_MIND_FLAYER},
519 { "ファラレウィン", 30000, 250, 150, 10, 5, RACE_SPRITE},
520 { "しわしわヴォスール", 20000, 250, 150, 10, 5, RACE_NIBELUNG},
521 { "ハンサムなアラオード", 20000, 250, 150, 10, 5, RACE_AMBERITE},
522 { "負け犬セラドフリド", 30000, 250, 150, 10, 5, RACE_HUMAN},
523 { "片足のエルーロ", 30000, 250, 150, 10, 5, RACE_HALF_OGRE},
525 { "Gary Gygaz", 20000, 250, 150, 10, 5, RACE_HALF_TROLL},
526 { "Histor the Goblin", 20000, 250, 150, 10, 5, RACE_HALF_ORC},
527 { "Quark the Ferengi", 30000, 250, 150, 10, 5, RACE_DWARF},
528 { "Topi the Fair(?)", 30000, 250, 150, 10, 5, RACE_HUMAN},
529 { "Vhassa the Dead", 20000, 250, 150, 10, 5, RACE_ZOMBIE},
530 { "Kyn the Treacherous", 20000, 250, 150, 10, 5, RACE_VAMPIRE},
531 { "Bubonicus", 30000, 250, 150, 10, 5, RACE_BEASTMAN},
532 { "Corpselight", 30000, 250, 150, 10, 5, RACE_SPECTRE},
533 { "Parrish the Bloodthirsty", 20000, 250, 150, 10, 5, RACE_VAMPIRE},
534 { "Vile", 20000, 250, 150, 10, 5, RACE_SKELETON},
535 { "Prentice the Trusted", 30000, 250, 150, 10, 5, RACE_SKELETON},
536 { "Griella Humanslayer", 30000, 250, 150, 10, 5, RACE_IMP},
537 { "Angel", 20000, 250, 150, 10, 5, RACE_VAMPIRE},
538 { "Flotsam the Bloated", 20000, 250, 150, 10, 5, RACE_ZOMBIE},
539 { "Nieval", 30000, 250, 150, 10, 5, RACE_VAMPIRE},
540 { "Anastasia the Luminous", 30000, 250, 150, 10, 5, RACE_SPECTRE},
541 { "Charity the Necromancer", 20000, 250, 150, 10, 5, RACE_DARK_ELF},
542 { "Pugnacious the Pugilist", 20000, 250, 150, 10, 5, RACE_HALF_ORC},
543 { "Footsore the Lucky", 30000, 250, 150, 10, 5, RACE_BEASTMAN},
544 { "Sidria Lighfingered", 30000, 250, 150, 10, 5, RACE_HUMAN},
545 { "Riatho the Juggler", 20000, 250, 150, 10, 5, RACE_HOBBIT},
546 { "Janaaka the Shifty", 20000, 250, 150, 10, 5, RACE_GNOME},
547 { "Cina the Rogue", 30000, 250, 150, 10, 5, RACE_GNOME},
548 { "Arunikki Greatclaw", 30000, 250, 150, 10, 5, RACE_DRACONIAN},
549 { "Chaeand the Poor", 20000, 250, 150, 10, 5, RACE_HUMAN},
550 { "Afardorf the Brigand", 20000, 250, 150, 10, 5, RACE_BARBARIAN},
551 { "Lathaxl the Greedy", 30000, 250, 150, 10, 5, RACE_MIND_FLAYER},
552 { "Falarewyn", 30000, 250, 150, 10, 5, RACE_SPRITE},
553 { "Vosur the Wrinkled", 20000, 250, 150, 10, 5, RACE_NIBELUNG},
554 { "Araord the Handsome", 20000, 250, 150, 10, 5, RACE_AMBERITE},
555 { "Theradfrid the Loser", 30000, 250, 150, 10, 5, RACE_HUMAN},
556 { "One-Legged Eroolo", 30000, 250, 150, 10, 5, RACE_HALF_OGRE},
562 { "我が家", 0, 100, 100, 0, 99, 99},
563 { "我が家", 0, 100, 100, 0, 99, 99},
564 { "我が家", 0, 100, 100, 0, 99, 99},
565 { "我が家", 0, 100, 100, 0, 99, 99},
566 { "我が家", 0, 100, 100, 0, 99, 99},
567 { "我が家", 0, 100, 100, 0, 99, 99},
568 { "我が家", 0, 100, 100, 0, 99, 99},
569 { "我が家", 0, 100, 100, 0, 99, 99},
570 { "我が家", 0, 100, 100, 0, 99, 99},
571 { "我が家", 0, 100, 100, 0, 99, 99},
572 { "我が家", 0, 100, 100, 0, 99, 99},
573 { "我が家", 0, 100, 100, 0, 99, 99},
574 { "我が家", 0, 100, 100, 0, 99, 99},
575 { "我が家", 0, 100, 100, 0, 99, 99},
576 { "我が家", 0, 100, 100, 0, 99, 99},
577 { "我が家", 0, 100, 100, 0, 99, 99},
578 { "我が家", 0, 100, 100, 0, 99, 99},
579 { "我が家", 0, 100, 100, 0, 99, 99},
580 { "我が家", 0, 100, 100, 0, 99, 99},
581 { "我が家", 0, 100, 100, 0, 99, 99},
582 { "我が家", 0, 100, 100, 0, 99, 99},
583 { "我が家", 0, 100, 100, 0, 99, 99},
584 { "我が家", 0, 100, 100, 0, 99, 99},
585 { "我が家", 0, 100, 100, 0, 99, 99},
586 { "我が家", 0, 100, 100, 0, 99, 99},
587 { "我が家", 0, 100, 100, 0, 99, 99},
588 { "我が家", 0, 100, 100, 0, 99, 99},
589 { "我が家", 0, 100, 100, 0, 99, 99},
590 { "我が家", 0, 100, 100, 0, 99, 99},
591 { "我が家", 0, 100, 100, 0, 99, 99},
592 { "我が家", 0, 100, 100, 0, 99, 99},
593 { "我が家", 0, 100, 100, 0, 99, 99},
595 { "Your home", 0, 100, 100, 0, 99, 99},
596 { "Your home", 0, 100, 100, 0, 99, 99},
597 { "Your home", 0, 100, 100, 0, 99, 99},
598 { "Your home", 0, 100, 100, 0, 99, 99},
599 { "Your home", 0, 100, 100, 0, 99, 99},
600 { "Your home", 0, 100, 100, 0, 99, 99},
601 { "Your home", 0, 100, 100, 0, 99, 99},
602 { "Your home", 0, 100, 100, 0, 99, 99},
603 { "Your home", 0, 100, 100, 0, 99, 99},
604 { "Your home", 0, 100, 100, 0, 99, 99},
605 { "Your home", 0, 100, 100, 0, 99, 99},
606 { "Your home", 0, 100, 100, 0, 99, 99},
607 { "Your home", 0, 100, 100, 0, 99, 99},
608 { "Your home", 0, 100, 100, 0, 99, 99},
609 { "Your home", 0, 100, 100, 0, 99, 99},
610 { "Your home", 0, 100, 100, 0, 99, 99},
611 { "Your home", 0, 100, 100, 0, 99, 99},
612 { "Your home", 0, 100, 100, 0, 99, 99},
613 { "Your home", 0, 100, 100, 0, 99, 99},
614 { "Your home", 0, 100, 100, 0, 99, 99},
615 { "Your home", 0, 100, 100, 0, 99, 99},
616 { "Your home", 0, 100, 100, 0, 99, 99},
617 { "Your home", 0, 100, 100, 0, 99, 99},
618 { "Your home", 0, 100, 100, 0, 99, 99},
619 { "Your home", 0, 100, 100, 0, 99, 99},
620 { "Your home", 0, 100, 100, 0, 99, 99},
621 { "Your home", 0, 100, 100, 0, 99, 99},
622 { "Your home", 0, 100, 100, 0, 99, 99},
623 { "Your home", 0, 100, 100, 0, 99, 99},
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},
632 /* Bookstore - 21 unique names */
634 { "強欲ドラフ", 10000, 175, 108, 4, 12, RACE_HUMAN},
635 { "賢者オドナー", 15000, 120, 105, 6, 16, RACE_HIGH_ELF},
636 { "中立のガンダー", 25000, 120, 110, 7, 19, RACE_DARK_ELF},
637 { "忍耐の人ロ=シャ", 30000, 140, 105, 6, 12, RACE_ELF},
638 { "ランドルフ・カーター", 15000, 175, 108, 4, 12, RACE_HUMAN},
639 { "隼のサライ", 15000, 175, 108, 4, 12, RACE_HUMAN},
640 { "千里眼ボドリル", 20000, 120, 105, 6, 16, RACE_HIGH_ELF},
641 { "沈黙のヴェオロイン", 25000, 120, 110, 7, 19, RACE_ZOMBIE},
642 { "学者のヴァンシラス", 30000, 140, 105, 6, 12, RACE_MIND_FLAYER},
643 { "物書きオセイン", 15000, 175, 108, 4, 12, RACE_SKELETON},
644 { "本の虫オルヴァー", 20000, 120, 105, 6, 16, RACE_VAMPIRE},
645 { "浅井墓男", 25000, 120, 110, 7, 19, RACE_ZOMBIE},
646 { "デスマスク", 30000, 140, 105, 6, 12, RACE_ZOMBIE},
647 { "学者のアスーヌ", 15000, 175, 108, 4, 12, RACE_MIND_FLAYER},
648 { "死人のプリランド", 20000, 120, 105, 6, 16, RACE_ZOMBIE},
649 { "鉄のロナール", 25000, 120, 110, 7, 19, RACE_GOLEM},
651 { "Dolaf the Greedy", 10000, 175, 108, 4, 12, RACE_HUMAN},
652 { "Odnar the Sage", 15000, 120, 105, 6, 16, RACE_HIGH_ELF},
653 { "Gandar the Neutral", 25000, 120, 110, 7, 19, RACE_DARK_ELF},
654 { "Ro-sha the Patient", 30000, 140, 105, 6, 12, RACE_ELF},
655 { "Randolph Carter", 15000, 175, 108, 4, 12, RACE_HUMAN},
656 { "Sarai the Swift", 15000, 175, 108, 4, 12, RACE_HUMAN},
657 { "Bodril the Seer", 20000, 120, 105, 6, 16, RACE_HIGH_ELF},
658 { "Veloin the Quiet", 25000, 120, 110, 7, 19, RACE_ZOMBIE},
659 { "Vanthylas the Learned", 30000, 140, 105, 6, 12, RACE_MIND_FLAYER},
660 { "Ossein the Literate", 15000, 175, 108, 4, 12, RACE_SKELETON},
661 { "Olvar Bookworm", 20000, 120, 105, 6, 16, RACE_VAMPIRE},
662 { "Shallowgrave", 25000, 120, 110, 7, 19, RACE_ZOMBIE},
663 { "Death Mask", 30000, 140, 105, 6, 12, RACE_ZOMBIE},
664 { "Asuunu the Learned", 15000, 175, 108, 4, 12, RACE_MIND_FLAYER},
665 { "Prirand the Dead", 20000, 120, 105, 6, 16, RACE_ZOMBIE},
666 { "Ronar the Iron", 25000, 120, 110, 7, 19, RACE_GOLEM},
669 { "ガリル=ガミル", 30000, 140, 105, 6, 12, RACE_ELF},
670 { "本食いローバグ", 15000, 175, 108, 4, 12, RACE_KOBOLD},
671 { "キリアリキーク", 20000, 120, 105, 6, 16, RACE_KLACKON},
672 { "静かなるリリン", 25000, 120, 110, 7, 19, RACE_DWARF},
673 { "王者イサング", 30000, 140, 105, 6, 12, RACE_HIGH_ELF},
674 { "強欲ドラフ", 10000, 175, 108, 4, 12, RACE_HUMAN},
675 { "賢者オドナー", 15000, 120, 105, 6, 16, RACE_HIGH_ELF},
676 { "中立のガンダー", 25000, 120, 110, 7, 19, RACE_DARK_ELF},
677 { "忍耐の人ロ=シャ", 30000, 140, 105, 6, 12, RACE_ELF},
678 { "ランドルフ・カーター", 15000, 175, 108, 4, 12, RACE_HUMAN},
679 { "隼サライ", 15000, 175, 108, 4, 12, RACE_HUMAN},
680 { "千里眼ボドリル", 20000, 120, 105, 6, 16, RACE_HIGH_ELF},
681 { "沈黙のヴェオロイン", 25000, 120, 110, 7, 19, RACE_ZOMBIE},
682 { "学者のヴァンシラス", 30000, 140, 105, 6, 12, RACE_MIND_FLAYER},
683 { "物書きオセイン", 15000, 175, 108, 4, 12, RACE_SKELETON},
684 { "本の虫オルヴァー", 20000, 120, 105, 6, 16, RACE_VAMPIRE},
686 { "Galil-Gamir", 30000, 140, 105, 6, 12, RACE_ELF},
687 { "Rorbag Book-Eater", 15000, 175, 108, 4, 12, RACE_KOBOLD},
688 { "Kiriarikirk", 20000, 120, 105, 6, 16, RACE_KLACKON},
689 { "Rilin the Quiet", 25000, 120, 110, 7, 19, RACE_DWARF},
690 { "Isung the Lord", 30000, 140, 105, 6, 12, RACE_HIGH_ELF},
691 { "Dolaf the Greedy", 10000, 175, 108, 4, 12, RACE_HUMAN},
692 { "Odnar the Sage", 15000, 120, 105, 6, 16, RACE_HIGH_ELF},
693 { "Gandar the Neutral", 25000, 120, 110, 7, 19, RACE_DARK_ELF},
694 { "Ro-sha the Patient", 30000, 140, 105, 6, 12, RACE_ELF},
695 { "Randolph Carter", 15000, 175, 108, 4, 12, RACE_HUMAN},
696 { "Sarai the Swift", 15000, 175, 108, 4, 12, RACE_HUMAN},
697 { "Bodril the Seer", 20000, 120, 105, 6, 16, RACE_HIGH_ELF},
698 { "Veloin the Quiet", 25000, 120, 110, 7, 19, RACE_ZOMBIE},
699 { "Vanthylas the Learned", 30000, 140, 105, 6, 12, RACE_MIND_FLAYER},
700 { "Ossein the Literate", 15000, 175, 108, 4, 12, RACE_SKELETON},
701 { "Olvar Bookworm", 20000, 120, 105, 6, 16, RACE_VAMPIRE},
708 { "博物館", 0, 100, 100, 0, 99, 99},
709 { "博物館", 0, 100, 100, 0, 99, 99},
710 { "博物館", 0, 100, 100, 0, 99, 99},
711 { "博物館", 0, 100, 100, 0, 99, 99},
712 { "博物館", 0, 100, 100, 0, 99, 99},
713 { "博物館", 0, 100, 100, 0, 99, 99},
714 { "博物館", 0, 100, 100, 0, 99, 99},
715 { "博物館", 0, 100, 100, 0, 99, 99},
716 { "博物館", 0, 100, 100, 0, 99, 99},
717 { "博物館", 0, 100, 100, 0, 99, 99},
718 { "博物館", 0, 100, 100, 0, 99, 99},
719 { "博物館", 0, 100, 100, 0, 99, 99},
720 { "博物館", 0, 100, 100, 0, 99, 99},
721 { "博物館", 0, 100, 100, 0, 99, 99},
722 { "博物館", 0, 100, 100, 0, 99, 99},
723 { "博物館", 0, 100, 100, 0, 99, 99},
724 { "博物館", 0, 100, 100, 0, 99, 99},
725 { "博物館", 0, 100, 100, 0, 99, 99},
726 { "博物館", 0, 100, 100, 0, 99, 99},
727 { "博物館", 0, 100, 100, 0, 99, 99},
728 { "博物館", 0, 100, 100, 0, 99, 99},
729 { "博物館", 0, 100, 100, 0, 99, 99},
730 { "博物館", 0, 100, 100, 0, 99, 99},
731 { "博物館", 0, 100, 100, 0, 99, 99},
732 { "博物館", 0, 100, 100, 0, 99, 99},
733 { "博物館", 0, 100, 100, 0, 99, 99},
734 { "博物館", 0, 100, 100, 0, 99, 99},
735 { "博物館", 0, 100, 100, 0, 99, 99},
736 { "博物館", 0, 100, 100, 0, 99, 99},
737 { "博物館", 0, 100, 100, 0, 99, 99},
738 { "博物館", 0, 100, 100, 0, 99, 99},
739 { "博物館", 0, 100, 100, 0, 99, 99},
741 { "Museum", 0, 100, 100, 0, 99, 99},
742 { "Museum", 0, 100, 100, 0, 99, 99},
743 { "Museum", 0, 100, 100, 0, 99, 99},
744 { "Museum", 0, 100, 100, 0, 99, 99},
745 { "Museum", 0, 100, 100, 0, 99, 99},
746 { "Museum", 0, 100, 100, 0, 99, 99},
747 { "Museum", 0, 100, 100, 0, 99, 99},
748 { "Museum", 0, 100, 100, 0, 99, 99},
749 { "Museum", 0, 100, 100, 0, 99, 99},
750 { "Museum", 0, 100, 100, 0, 99, 99},
751 { "Museum", 0, 100, 100, 0, 99, 99},
752 { "Museum", 0, 100, 100, 0, 99, 99},
753 { "Museum", 0, 100, 100, 0, 99, 99},
754 { "Museum", 0, 100, 100, 0, 99, 99},
755 { "Museum", 0, 100, 100, 0, 99, 99},
756 { "Museum", 0, 100, 100, 0, 99, 99},
757 { "Museum", 0, 100, 100, 0, 99, 99},
758 { "Museum", 0, 100, 100, 0, 99, 99},
759 { "Museum", 0, 100, 100, 0, 99, 99},
760 { "Museum", 0, 100, 100, 0, 99, 99},
761 { "Museum", 0, 100, 100, 0, 99, 99},
762 { "Museum", 0, 100, 100, 0, 99, 99},
763 { "Museum", 0, 100, 100, 0, 99, 99},
764 { "Museum", 0, 100, 100, 0, 99, 99},
765 { "Museum", 0, 100, 100, 0, 99, 99},
766 { "Museum", 0, 100, 100, 0, 99, 99},
767 { "Museum", 0, 100, 100, 0, 99, 99},
768 { "Museum", 0, 100, 100, 0, 99, 99},
769 { "Museum", 0, 100, 100, 0, 99, 99},
770 { "Museum", 0, 100, 100, 0, 99, 99},
771 { "Museum", 0, 100, 100, 0, 99, 99},
772 { "Museum", 0, 100, 100, 0, 99, 99},
779 static int cur_store_num = 0;
780 static int store_top = 0;
781 static int store_bottom = 0;
782 static int xtra_stock = 0;
783 static store_type *st_ptr = NULL;
784 static const owner_type *ot_ptr = NULL;
785 static s16b old_town_num = 0;
786 static s16b inner_town_num = 0;
787 #define RUMOR_CHANCE 8
789 #define MAX_COMMENT_1 6
791 static concptr comment_1[MAX_COMMENT_1] =
812 /*! ブラックマーケット追加メッセージ(承諾) */
813 static concptr comment_1_B[MAX_COMMENT_1] = {
822 #define MAX_COMMENT_2A 2
824 static concptr comment_2a[MAX_COMMENT_2A] =
827 "私の忍耐力を試しているのかい? $%s が最後だ。",
828 "我慢にも限度があるぞ。 $%s が最後だ。"
830 "You try my patience. %s is final.",
831 "My patience grows thin. %s is final."
836 #define MAX_COMMENT_2B 12
838 static concptr comment_2b[MAX_COMMENT_2B] =
841 " $%s ぐらいは出さなきゃダメだよ。",
844 "何て奴だ! $%s 以下はあり得ないぞ。",
845 "それじゃ少なすぎる! $%s は欲しいところだ。",
846 "バカにしている! $%s はもらわないと。",
848 "おいおい! $%s を考えてくれないか?",
849 "1000匹のオークのノミに苦しめられるがいい! $%s だ。",
850 "お前の大切なものに災いあれ! $%s でどうだ。",
851 "モルゴスに賞味されるがいい!本当は $%s なんだろう?",
852 "お前の母親はオーガか! $%s は出すつもりなんだろ?"
854 "I can take no less than %s gold pieces.",
855 "I will accept no less than %s gold pieces.",
856 "Ha! No less than %s gold pieces.",
857 "You knave! No less than %s gold pieces.",
858 "That's a pittance! I want %s gold pieces.",
859 "That's an insult! I want %s gold pieces.",
860 "As if! How about %s gold pieces?",
861 "My arse! How about %s gold pieces?",
862 "May the fleas of 1000 orcs molest you! Try %s gold pieces.",
863 "May your most favourite parts go moldy! Try %s gold pieces.",
864 "May Morgoth find you tasty! Perhaps %s gold pieces?",
865 "Your mother was an Ogre! Perhaps %s gold pieces?"
871 /*! ブラックマーケット用追加メッセージ(売るとき) */
872 static concptr comment_2b_B[MAX_COMMENT_2B] = {
873 "いくら俺様がお人好しとはいえ $%s が限界だね。嫌なら帰りな。",
874 "金がないのかい、あんた?まずは家に帰って $%s 揃えてきな。",
875 "物の価値が分からん奴だな。これは $%s が普通なんだよ。",
876 "俺の付けた値段に文句があるのか? $%s が限界だ。",
877 "ひょっとして新手の冗談かい? $%s 持ってないなら帰りな。",
878 "うちは他の店とは違うんだよ。$%s ぐらいは出しな。",
879 "買う気がないなら帰りな。 $%s だと言っているんだ。",
880 "話にならないね。 $%s くらい持っているんだろ?",
881 "は?なんだそりゃ? $%s の間違いか、ひょっとして?",
882 "出口はあっちだよ。それとも $%s 出せるのかい、あんたに。",
883 "命知らずな奴だな。 $%s 出せば今日の所は勘弁してやるよ。",
884 "うちの店は貧乏人お断りだ。 $%s ぐらい出せないのかい?"
887 #define MAX_COMMENT_3A 2
889 static concptr comment_3a[MAX_COMMENT_3A] =
892 "私の忍耐力を試しているのかい? $%s が最後だ。",
893 "我慢にも限度があるぞ。 $%s が最後だ。"
895 "You try my patience. %s is final.",
896 "My patience grows thin. %s is final."
902 #define MAX_COMMENT_3B 12
904 static concptr comment_3b[MAX_COMMENT_3B] =
907 "本音を言うと $%s でいいんだろ?",
909 " $%s ぐらいなら出してもいいが。",
910 " $%s 以上払うなんて考えられないね。",
911 "まあ落ちついて。 $%s でどうだい?",
912 "そのガラクタなら $%s で引き取るよ。",
913 "それじゃ高すぎる! $%s がいいとこだろ。",
914 "どうせいらないんだろ! $%s でいいだろ?",
915 "だめだめ! $%s がずっとお似合いだよ。",
916 "バカにしている! $%s がせいぜいだ。",
917 " $%s なら嬉しいところだがなあ。",
918 " $%s 、それ以上はビタ一文出さないよ!"
920 "Perhaps %s gold pieces?",
921 "How about %s gold pieces?",
922 "I will pay no more than %s gold pieces.",
923 "I can afford no more than %s gold pieces.",
924 "Be reasonable. How about %s gold pieces?",
925 "I'll buy it as scrap for %s gold pieces.",
926 "That is too much! How about %s gold pieces?",
927 "That looks war surplus! Say %s gold pieces?",
928 "Never! %s is more like it.",
929 "That's an insult! %s is more like it.",
930 "%s gold pieces and be thankful for it!",
931 "%s gold pieces and not a copper more!"
937 /*! ブラックマーケット用追加メッセージ(買い取り) */
938 static concptr comment_3b_B[MAX_COMMENT_3B] = {
939 " $%s ってところだね。そのどうしようもないガラクタは。",
940 "この俺が $%s って言っているんだから、その通りにした方が身のためだぞ。",
941 "俺の優しさに甘えるのもいい加減にしておけ。 $%s だ。",
942 "その品なら $%s で売ってくれているがね、常識ある紳士はみんな。",
943 "こりゃまた、がめつい奴だな。いくら俺が温厚とはいえ $%s が限界だ。",
944 " $%s だ。別に俺はそんなガラクタ欲しくはないんだから。",
945 "俺の鑑定額が気に入らないのか? $%s 、嫌なら帰りな。",
946 " $%s で引き取ってやるよ。喜んで受け取りな、貧乏人。",
947 "物の価値が分からん奴は始末におえんな。それは $%s なんだよ。",
948 "そんなに金が欲しいのか、あんた? $%s で満足できんのか?",
949 "入る店間違えてんじゃないのか? $%s で嫌なら他をあたってくれ。",
950 "俺の言い値にケチをつける奴がいるとは! その度胸に免じて $%s だ。"
953 #define MAX_COMMENT_4A 4
955 static concptr comment_4a[MAX_COMMENT_4A] =
958 "もうたくさんだ!何度も私をわずらわせないでくれ!",
959 "うがー!一日の我慢の限度を超えている!",
960 "もういい!時間の無駄以外のなにものでもない!",
961 "もうやってられないよ!顔も見たくない!"
963 "Enough! You have abused me once too often!",
964 "Arghhh! I have had enough abuse for one day!",
965 "That does it! You shall waste my time no more!",
966 "This is getting nowhere! I'm going to Londis!"
972 /*! ブラックマーケット用追加メッセージ(怒りの頂点) */
973 static concptr comment_4a_B[MAX_COMMENT_4A] = {
974 "なめやがって!温厚な俺様でも限界があるってことを知れ!",
975 "俺をここまで怒らせて...命があるだけでもありがたいと思え!",
976 "ふざけてるのか!冷やかしなら相手を見てからにしろ!",
977 "いいかげんにしろ!今度こんなまねしたらただじゃおかねえぞ!"
980 #define MAX_COMMENT_4B 4
982 static concptr comment_4b[MAX_COMMENT_4B] =
991 "Get out of my sight!",
992 "Begone, you scoundrel!",
999 /*! ブラックマーケット用追加メッセージ(追い出し) */
1000 static concptr comment_4b_B[MAX_COMMENT_4B] = {
1007 #define MAX_COMMENT_5 8
1009 static concptr comment_5[MAX_COMMENT_5] =
1023 "You will have to do better than that!",
1024 "Do you wish to do business or not?",
1025 "You've got to be kidding!",
1026 "You'd better be kidding!",
1027 "You try my patience.",
1028 "Hmmm, nice weather we're having."
1034 /*! ブラックマーケット用追加メッセージ(怒り) */
1035 static concptr comment_5_B[MAX_COMMENT_5] = {
1046 #define MAX_COMMENT_6 4
1048 static concptr comment_6[MAX_COMMENT_6] =
1056 "I must have heard you wrong.",
1057 "I'm sorry, I missed that.",
1058 "I'm sorry, what was that?",
1059 "Sorry, what was that again?"
1064 /*** Initialize others ***/
1067 * 店舗で販売するオブジェクトを定義する / Hack -- Objects sold in the stores -- by tval/sval pair.
1069 byte store_table[MAX_STORES][STORE_CHOICES][2] =
1074 { TV_FOOD, SV_FOOD_RATION },
1075 { TV_FOOD, SV_FOOD_RATION },
1076 { TV_FOOD, SV_FOOD_RATION },
1077 { TV_FOOD, SV_FOOD_RATION },
1079 { TV_FOOD, SV_FOOD_RATION },
1080 { TV_FOOD, SV_FOOD_BISCUIT },
1081 { TV_FOOD, SV_FOOD_JERKY },
1082 { TV_FOOD, SV_FOOD_JERKY },
1084 { TV_FOOD, SV_FOOD_PINT_OF_WINE },
1085 { TV_FOOD, SV_FOOD_PINT_OF_ALE },
1086 { TV_LITE, SV_LITE_TORCH },
1087 { TV_LITE, SV_LITE_TORCH },
1089 { TV_LITE, SV_LITE_TORCH },
1090 { TV_LITE, SV_LITE_TORCH },
1091 { TV_LITE, SV_LITE_LANTERN },
1092 { TV_LITE, SV_LITE_LANTERN },
1104 { TV_SHOT, SV_AMMO_NORMAL },
1105 { TV_ARROW, SV_AMMO_NORMAL },
1106 { TV_BOLT, SV_AMMO_NORMAL },
1107 { TV_DIGGING, SV_SHOVEL },
1109 { TV_DIGGING, SV_PICK },
1110 { TV_CLOAK, SV_CLOAK },
1111 { TV_CLOAK, SV_CLOAK },
1112 { TV_CLOAK, SV_FUR_CLOAK },
1114 { TV_FOOD, SV_FOOD_RATION },
1115 { TV_FOOD, SV_FOOD_RATION },
1116 { TV_FOOD, SV_FOOD_RATION },
1117 { TV_FOOD, SV_FOOD_RATION },
1119 { TV_POTION, SV_POTION_WATER },
1120 { TV_POTION, SV_POTION_WATER },
1121 { TV_LITE, SV_LITE_LANTERN },
1122 { TV_LITE, SV_LITE_LANTERN },
1124 { TV_FOOD, SV_FOOD_WAYBREAD },
1125 { TV_FOOD, SV_FOOD_WAYBREAD },
1129 { TV_SHOT, SV_AMMO_NORMAL },
1130 { TV_ARROW, SV_AMMO_NORMAL },
1131 { TV_BOLT, SV_AMMO_NORMAL },
1132 { TV_DIGGING, SV_SHOVEL }
1138 { TV_BOOTS, SV_PAIR_OF_SOFT_LEATHER_BOOTS },
1139 { TV_BOOTS, SV_PAIR_OF_SOFT_LEATHER_BOOTS },
1140 { TV_BOOTS, SV_PAIR_OF_HARD_LEATHER_BOOTS },
1141 { TV_BOOTS, SV_PAIR_OF_HARD_LEATHER_BOOTS },
1143 { TV_HELM, SV_HARD_LEATHER_CAP },
1144 { TV_HELM, SV_HARD_LEATHER_CAP },
1145 { TV_HELM, SV_METAL_CAP },
1146 { TV_HELM, SV_IRON_HELM },
1148 { TV_SOFT_ARMOR, SV_ROBE },
1149 { TV_SOFT_ARMOR, SV_ROBE },
1150 { TV_SOFT_ARMOR, SV_SOFT_LEATHER_ARMOR },
1151 { TV_SOFT_ARMOR, SV_SOFT_LEATHER_ARMOR },
1153 { TV_SOFT_ARMOR, SV_HARD_LEATHER_ARMOR },
1154 { TV_SOFT_ARMOR, SV_HARD_LEATHER_ARMOR },
1155 { TV_SOFT_ARMOR, SV_HARD_STUDDED_LEATHER },
1156 { TV_SOFT_ARMOR, SV_HARD_STUDDED_LEATHER },
1158 { TV_SOFT_ARMOR, SV_RHINO_HIDE_ARMOR },
1159 { TV_SOFT_ARMOR, SV_LEATHER_SCALE_MAIL },
1160 { TV_HARD_ARMOR, SV_METAL_SCALE_MAIL },
1161 { TV_HARD_ARMOR, SV_CHAIN_MAIL },
1163 { TV_HARD_ARMOR, SV_DOUBLE_RING_MAIL },
1164 { TV_HARD_ARMOR, SV_AUGMENTED_CHAIN_MAIL },
1165 { TV_HARD_ARMOR, SV_BAR_CHAIN_MAIL },
1166 { TV_HARD_ARMOR, SV_DOUBLE_CHAIN_MAIL },
1168 { TV_HARD_ARMOR, SV_METAL_BRIGANDINE_ARMOUR },
1169 { TV_HARD_ARMOR, SV_SPLINT_MAIL },
1170 { TV_GLOVES, SV_SET_OF_LEATHER_GLOVES },
1171 { TV_GLOVES, SV_SET_OF_LEATHER_GLOVES },
1173 { TV_GLOVES, SV_SET_OF_GAUNTLETS },
1174 { TV_SHIELD, SV_SMALL_LEATHER_SHIELD },
1175 { TV_SHIELD, SV_LARGE_LEATHER_SHIELD },
1176 { TV_SHIELD, SV_SMALL_METAL_SHIELD },
1178 { TV_BOOTS, SV_PAIR_OF_HARD_LEATHER_BOOTS },
1179 { TV_BOOTS, SV_PAIR_OF_HARD_LEATHER_BOOTS },
1180 { TV_HELM, SV_HARD_LEATHER_CAP },
1181 { TV_HELM, SV_HARD_LEATHER_CAP },
1183 { TV_SOFT_ARMOR, SV_ROBE },
1184 { TV_SOFT_ARMOR, SV_SOFT_LEATHER_ARMOR },
1185 { TV_SOFT_ARMOR, SV_SOFT_LEATHER_ARMOR },
1186 { TV_SOFT_ARMOR, SV_HARD_LEATHER_ARMOR },
1188 { TV_SOFT_ARMOR, SV_LEATHER_JACK },
1189 { TV_HARD_ARMOR, SV_METAL_SCALE_MAIL },
1190 { TV_HARD_ARMOR, SV_CHAIN_MAIL },
1191 { TV_HARD_ARMOR, SV_CHAIN_MAIL },
1193 { TV_GLOVES, SV_SET_OF_LEATHER_GLOVES },
1194 { TV_GLOVES, SV_SET_OF_GAUNTLETS },
1195 { TV_SHIELD, SV_SMALL_LEATHER_SHIELD },
1196 { TV_SHIELD, SV_SMALL_LEATHER_SHIELD }
1202 { TV_SWORD, SV_DAGGER },
1203 { TV_SWORD, SV_MAIN_GAUCHE },
1204 { TV_SWORD, SV_RAPIER },
1205 { TV_SWORD, SV_SMALL_SWORD },
1207 { TV_SWORD, SV_SHORT_SWORD },
1208 { TV_SWORD, SV_SABRE },
1209 { TV_SWORD, SV_CUTLASS },
1210 { TV_SWORD, SV_TULWAR },
1212 { TV_SWORD, SV_BROAD_SWORD },
1213 { TV_SWORD, SV_LONG_SWORD },
1214 { TV_SWORD, SV_SCIMITAR },
1215 { TV_SWORD, SV_KATANA },
1217 { TV_SWORD, SV_BASTARD_SWORD },
1218 { TV_POLEARM, SV_SPEAR },
1219 { TV_POLEARM, SV_AWL_PIKE },
1220 { TV_POLEARM, SV_TRIDENT },
1222 { TV_POLEARM, SV_PIKE },
1223 { TV_POLEARM, SV_BEAKED_AXE },
1224 { TV_POLEARM, SV_BROAD_AXE },
1225 { TV_POLEARM, SV_LANCE },
1227 { TV_POLEARM, SV_BATTLE_AXE },
1228 { TV_POLEARM, SV_HATCHET },
1229 { TV_BOW, SV_SLING },
1230 { TV_BOW, SV_SHORT_BOW },
1232 { TV_BOW, SV_LIGHT_XBOW },
1233 { TV_SHOT, SV_AMMO_NORMAL },
1234 { TV_SHOT, SV_AMMO_NORMAL },
1235 { TV_ARROW, SV_AMMO_NORMAL },
1237 { TV_ARROW, SV_AMMO_NORMAL },
1238 { TV_BOLT, SV_AMMO_NORMAL },
1239 { TV_BOLT, SV_AMMO_NORMAL },
1240 { TV_BOW, SV_LIGHT_XBOW },
1242 { TV_ARROW, SV_AMMO_NORMAL },
1243 { TV_BOLT, SV_AMMO_NORMAL },
1244 { TV_BOW, SV_SHORT_BOW },
1245 { TV_BOW, SV_LIGHT_XBOW },
1247 { TV_SWORD, SV_DAGGER },
1248 { TV_SWORD, SV_TANTO },
1249 { TV_SWORD, SV_RAPIER },
1250 { TV_SWORD, SV_SMALL_SWORD },
1252 { TV_SWORD, SV_SHORT_SWORD },
1253 { TV_SWORD, SV_LONG_SWORD },
1254 { TV_SWORD, SV_SCIMITAR },
1255 { TV_SWORD, SV_BROAD_SWORD },
1257 { TV_HISSATSU_BOOK, 0 },
1258 { TV_HISSATSU_BOOK, 0 },
1259 { TV_HISSATSU_BOOK, 1 },
1260 { TV_HISSATSU_BOOK, 1 },
1266 { TV_HAFTED, SV_NUNCHAKU },
1267 { TV_HAFTED, SV_QUARTERSTAFF },
1268 { TV_HAFTED, SV_MACE },
1269 { TV_HAFTED, SV_BO_STAFF },
1271 { TV_HAFTED, SV_WAR_HAMMER },
1272 { TV_HAFTED, SV_WAR_HAMMER },
1273 { TV_HAFTED, SV_MORNING_STAR },
1274 { TV_HAFTED, SV_FLAIL },
1276 { TV_HAFTED, SV_LEAD_FILLED_MACE },
1277 { TV_SCROLL, SV_SCROLL_REMOVE_CURSE },
1278 { TV_SCROLL, SV_SCROLL_BLESSING },
1279 { TV_SCROLL, SV_SCROLL_HOLY_CHANT },
1281 { TV_POTION, SV_POTION_HEROISM },
1282 { TV_SCROLL, SV_SCROLL_WORD_OF_RECALL },
1283 { TV_SCROLL, SV_SCROLL_WORD_OF_RECALL },
1284 { TV_SCROLL, SV_SCROLL_WORD_OF_RECALL },
1286 { TV_POTION, SV_POTION_CURE_LIGHT },
1287 { TV_POTION, SV_POTION_CURE_SERIOUS },
1288 { TV_POTION, SV_POTION_CURE_SERIOUS },
1289 { TV_POTION, SV_POTION_CURE_CRITICAL },
1291 { TV_POTION, SV_POTION_CURE_CRITICAL },
1292 { TV_POTION, SV_POTION_RESTORE_EXP },
1293 { TV_POTION, SV_POTION_RESTORE_EXP },
1294 { TV_POTION, SV_POTION_RESTORE_EXP },
1296 { TV_LIFE_BOOK, 0 },
1297 { TV_LIFE_BOOK, 0 },
1298 { TV_LIFE_BOOK, 1 },
1299 { TV_LIFE_BOOK, 1 },
1301 { TV_CRUSADE_BOOK, 0 },
1302 { TV_CRUSADE_BOOK, 0 },
1303 { TV_CRUSADE_BOOK, 1 },
1304 { TV_CRUSADE_BOOK, 1 },
1306 { TV_HAFTED, SV_WHIP },
1307 { TV_HAFTED, SV_MACE },
1308 { TV_HAFTED, SV_BALL_AND_CHAIN },
1309 { TV_HAFTED, SV_WAR_HAMMER },
1311 { TV_SCROLL, SV_SCROLL_WORD_OF_RECALL },
1312 { TV_SCROLL, SV_SCROLL_WORD_OF_RECALL },
1313 { TV_SCROLL, SV_SCROLL_WORD_OF_RECALL },
1314 { TV_POTION, SV_POTION_CURE_CRITICAL },
1316 { TV_POTION, SV_POTION_CURE_CRITICAL },
1317 { TV_POTION, SV_POTION_RESTORE_EXP },
1320 { TV_STATUE, SV_ANY },
1322 { TV_SCROLL, SV_SCROLL_REMOVE_CURSE },
1323 { TV_SCROLL, SV_SCROLL_REMOVE_CURSE },
1324 { TV_SCROLL, SV_SCROLL_STAR_REMOVE_CURSE },
1325 { TV_SCROLL, SV_SCROLL_STAR_REMOVE_CURSE }
1331 { TV_SCROLL, SV_SCROLL_ENCHANT_WEAPON_TO_HIT },
1332 { TV_SCROLL, SV_SCROLL_ENCHANT_WEAPON_TO_DAM },
1333 { TV_SCROLL, SV_SCROLL_ENCHANT_ARMOR },
1334 { TV_SCROLL, SV_SCROLL_IDENTIFY },
1336 { TV_SCROLL, SV_SCROLL_IDENTIFY },
1337 { TV_SCROLL, SV_SCROLL_IDENTIFY },
1338 { TV_SCROLL, SV_SCROLL_IDENTIFY },
1339 { TV_SCROLL, SV_SCROLL_LIGHT },
1341 { TV_SCROLL, SV_SCROLL_PHASE_DOOR },
1342 { TV_SCROLL, SV_SCROLL_PHASE_DOOR },
1343 { TV_SCROLL, SV_SCROLL_TELEPORT },
1344 { TV_SCROLL, SV_SCROLL_MONSTER_CONFUSION },
1346 { TV_SCROLL, SV_SCROLL_MAPPING },
1347 { TV_SCROLL, SV_SCROLL_DETECT_GOLD },
1348 { TV_SCROLL, SV_SCROLL_DETECT_ITEM },
1349 { TV_SCROLL, SV_SCROLL_DETECT_TRAP },
1351 { TV_SCROLL, SV_SCROLL_DETECT_INVIS },
1352 { TV_SCROLL, SV_SCROLL_RECHARGING },
1353 { TV_SCROLL, SV_SCROLL_TELEPORT },
1354 { TV_SCROLL, SV_SCROLL_WORD_OF_RECALL },
1356 { TV_SCROLL, SV_SCROLL_WORD_OF_RECALL },
1357 { TV_SCROLL, SV_SCROLL_WORD_OF_RECALL },
1358 { TV_SCROLL, SV_SCROLL_WORD_OF_RECALL },
1359 { TV_SCROLL, SV_SCROLL_TELEPORT },
1361 { TV_SCROLL, SV_SCROLL_TELEPORT },
1362 { TV_POTION, SV_POTION_RES_STR },
1363 { TV_POTION, SV_POTION_RES_INT },
1364 { TV_POTION, SV_POTION_RES_WIS },
1366 { TV_POTION, SV_POTION_RES_DEX },
1367 { TV_POTION, SV_POTION_RES_CON },
1368 { TV_POTION, SV_POTION_RES_CHR },
1369 { TV_SCROLL, SV_SCROLL_IDENTIFY },
1371 { TV_SCROLL, SV_SCROLL_IDENTIFY },
1372 { TV_SCROLL, SV_SCROLL_STAR_IDENTIFY }, /* Yep, occasionally! */
1373 { TV_SCROLL, SV_SCROLL_STAR_IDENTIFY },
1374 { TV_SCROLL, SV_SCROLL_LIGHT },
1376 { TV_POTION, SV_POTION_RES_STR },
1377 { TV_POTION, SV_POTION_RES_INT },
1378 { TV_POTION, SV_POTION_RES_WIS },
1379 { TV_POTION, SV_POTION_RES_DEX },
1381 { TV_POTION, SV_POTION_RES_CON },
1382 { TV_POTION, SV_POTION_RES_CHR },
1383 { TV_SCROLL, SV_SCROLL_ENCHANT_ARMOR },
1384 { TV_SCROLL, SV_SCROLL_ENCHANT_ARMOR },
1386 { TV_SCROLL, SV_SCROLL_RECHARGING },
1387 { TV_SCROLL, SV_SCROLL_PHASE_DOOR },
1388 { TV_SCROLL, SV_SCROLL_ENCHANT_WEAPON_TO_HIT },
1389 { TV_SCROLL, SV_SCROLL_ENCHANT_WEAPON_TO_DAM },
1394 /* Magic-User store */
1396 { TV_RING, SV_RING_PROTECTION },
1397 { TV_RING, SV_RING_LEVITATION_FALL },
1398 { TV_RING, SV_RING_PROTECTION },
1399 { TV_RING, SV_RING_RESIST_FIRE },
1401 { TV_RING, SV_RING_RESIST_COLD },
1402 { TV_AMULET, SV_AMULET_CHARISMA },
1403 { TV_RING, SV_RING_WARNING },
1404 { TV_AMULET, SV_AMULET_RESIST_ACID },
1406 { TV_AMULET, SV_AMULET_SEARCHING },
1407 { TV_WAND, SV_WAND_SLOW_MONSTER },
1408 { TV_WAND, SV_WAND_CONFUSE_MONSTER },
1409 { TV_WAND, SV_WAND_SLEEP_MONSTER },
1411 { TV_WAND, SV_WAND_MAGIC_MISSILE },
1412 { TV_WAND, SV_WAND_STINKING_CLOUD },
1413 { TV_WAND, SV_WAND_WONDER },
1414 { TV_WAND, SV_WAND_DISARMING },
1416 { TV_STAFF, SV_STAFF_LITE },
1417 { TV_STAFF, SV_STAFF_MAPPING },
1418 { TV_STAFF, SV_STAFF_DETECT_TRAP },
1419 { TV_STAFF, SV_STAFF_DETECT_DOOR },
1421 { TV_STAFF, SV_STAFF_DETECT_GOLD },
1422 { TV_STAFF, SV_STAFF_DETECT_ITEM },
1423 { TV_STAFF, SV_STAFF_DETECT_INVIS },
1424 { TV_STAFF, SV_STAFF_DETECT_EVIL },
1426 { TV_STAFF, SV_STAFF_TELEPORTATION },
1427 { TV_STAFF, SV_STAFF_TELEPORTATION },
1428 { TV_STAFF, SV_STAFF_TELEPORTATION },
1429 { TV_STAFF, SV_STAFF_TELEPORTATION },
1431 { TV_STAFF, SV_STAFF_IDENTIFY },
1432 { TV_STAFF, SV_STAFF_IDENTIFY },
1433 { TV_STAFF, SV_STAFF_IDENTIFY },
1435 { TV_STAFF, SV_STAFF_IDENTIFY },
1436 { TV_STAFF, SV_STAFF_REMOVE_CURSE },
1437 { TV_STAFF, SV_STAFF_CURE_LIGHT },
1438 { TV_STAFF, SV_STAFF_PROBING },
1442 { TV_SORCERY_BOOK, 0 },
1443 { TV_SORCERY_BOOK, 0 },
1444 { TV_SORCERY_BOOK, 1 },
1445 { TV_SORCERY_BOOK, 1 },
1447 { TV_ARCANE_BOOK, 0 },
1448 { TV_ARCANE_BOOK, 0 },
1449 { TV_ARCANE_BOOK, 1 },
1450 { TV_ARCANE_BOOK, 1 },
1452 { TV_ARCANE_BOOK, 2 },
1453 { TV_ARCANE_BOOK, 2 },
1454 { TV_ARCANE_BOOK, 3 },
1455 { TV_ARCANE_BOOK, 3 },
1460 /* Black Market (unused) */
1533 { TV_SORCERY_BOOK, 0 },
1534 { TV_SORCERY_BOOK, 0 },
1535 { TV_SORCERY_BOOK, 1 },
1536 { TV_SORCERY_BOOK, 1 },
1538 { TV_NATURE_BOOK, 0 },
1539 { TV_NATURE_BOOK, 0 },
1540 { TV_NATURE_BOOK, 1 },
1541 { TV_NATURE_BOOK, 1 },
1543 { TV_CHAOS_BOOK, 0 },
1544 { TV_CHAOS_BOOK, 0 },
1545 { TV_CHAOS_BOOK, 1 },
1546 { TV_CHAOS_BOOK, 1 },
1548 { TV_DEATH_BOOK, 0 },
1549 { TV_DEATH_BOOK, 0 },
1550 { TV_DEATH_BOOK, 1 },
1551 { TV_DEATH_BOOK, 1 },
1553 { TV_TRUMP_BOOK, 0 }, /* +16 */
1554 { TV_TRUMP_BOOK, 0 },
1555 { TV_TRUMP_BOOK, 1 },
1556 { TV_TRUMP_BOOK, 1 },
1558 { TV_ARCANE_BOOK, 0 },
1559 { TV_ARCANE_BOOK, 1 },
1560 { TV_ARCANE_BOOK, 2 },
1561 { TV_ARCANE_BOOK, 3 },
1563 { TV_CRAFT_BOOK, 0 },
1564 { TV_CRAFT_BOOK, 0 },
1565 { TV_CRAFT_BOOK, 1 },
1566 { TV_CRAFT_BOOK, 1 },
1568 { TV_DAEMON_BOOK, 0 },
1569 { TV_DAEMON_BOOK, 0 },
1570 { TV_DAEMON_BOOK, 1 },
1571 { TV_DAEMON_BOOK, 1 },
1573 { TV_MUSIC_BOOK, 0 },
1574 { TV_MUSIC_BOOK, 0 },
1575 { TV_MUSIC_BOOK, 1 },
1576 { TV_MUSIC_BOOK, 1 },
1585 /* Museum (unused) */
1624 * @brief 取引成功時の店主のメッセージ処理 /
1625 * Successful haggle.
1628 static void say_comment_1(void)
1631 /* ブラックマーケットのときは別のメッセージを出す */
1632 if ( cur_store_num == STORE_BLACK ) {
1633 msg_print(comment_1_B[randint0(MAX_COMMENT_1)]);
1636 msg_print(comment_1[randint0(MAX_COMMENT_1)]);
1639 msg_print(comment_1[randint0(MAX_COMMENT_1)]);
1643 if (one_in_(RUMOR_CHANCE))
1646 msg_print("店主は耳うちした:");
1648 msg_print("The shopkeeper whispers something into your ear:");
1650 display_rumor(TRUE);
1656 * @brief プレイヤーがアイテムを買う時の価格代案メッセージ処理 /
1657 * Continue haggling (player is buying)
1658 * @param value 店主の提示価格
1659 * @param annoyed 店主のいらつき度
1662 static void say_comment_2(PRICE value, int annoyed)
1666 /* Prepare a string to insert */
1667 sprintf(tmp_val, "%ld", (long)value);
1672 /* Formatted message */
1673 msg_format(comment_2a[randint0(MAX_COMMENT_2A)], tmp_val);
1679 /* Formatted message */
1681 /* ブラックマーケットの時は別のメッセージを出す */
1682 if ( cur_store_num == STORE_BLACK ){
1683 msg_format(comment_2b_B[randint0(MAX_COMMENT_2B)], tmp_val);
1686 msg_format(comment_2b[randint0(MAX_COMMENT_2B)], tmp_val);
1689 msg_format(comment_2b[randint0(MAX_COMMENT_2B)], tmp_val);
1697 * @brief プレイヤーがアイテムを売る時の価格代案メッセージ処理 /
1698 * Continue haggling (player is selling)
1699 * @param value 店主の提示価格
1700 * @param annoyed 店主のいらつき度
1703 static void say_comment_3(PRICE value, int annoyed)
1707 /* Prepare a string to insert */
1708 sprintf(tmp_val, "%ld", (long)value);
1713 /* Formatted message */
1714 msg_format(comment_3a[randint0(MAX_COMMENT_3A)], tmp_val);
1720 /* Formatted message */
1722 /* ブラックマーケットの時は別のメッセージを出す */
1723 if ( cur_store_num == STORE_BLACK ){
1724 msg_format(comment_3b_B[randint0(MAX_COMMENT_3B)], tmp_val);
1727 msg_format(comment_3b[randint0(MAX_COMMENT_3B)], tmp_val);
1730 msg_format(comment_3b[randint0(MAX_COMMENT_3B)], tmp_val);
1738 * @brief 店主がプレイヤーを追い出す時のメッセージ処理 /
1739 * Kick 'da bum out. -RAK-
1742 static void say_comment_4(void)
1745 /* ブラックマーケットの時は別のメッセージを出す */
1746 if ( cur_store_num == STORE_BLACK ){
1747 msg_print(comment_4a_B[randint0(MAX_COMMENT_4A)]);
1748 msg_print(comment_4b_B[randint0(MAX_COMMENT_4B)]);
1751 msg_print(comment_4a[randint0(MAX_COMMENT_4A)]);
1752 msg_print(comment_4b[randint0(MAX_COMMENT_4B)]);
1755 msg_print(comment_4a[randint0(MAX_COMMENT_4A)]);
1756 msg_print(comment_4b[randint0(MAX_COMMENT_4B)]);
1763 * @brief 店主がプレイヤーに取り合わない時のメッセージ処理 /
1764 * You are insulting me
1767 static void say_comment_5(void)
1770 /* ブラックマーケットの時は別のメッセージを出す */
1771 if ( cur_store_num == STORE_BLACK ){
1772 msg_print(comment_5_B[randint0(MAX_COMMENT_5)]);
1775 msg_print(comment_5[randint0(MAX_COMMENT_5)]);
1778 msg_print(comment_5[randint0(MAX_COMMENT_5)]);
1785 * @brief 店主がプレイヤーの提示を理解できなかった時のメッセージ処理 /
1786 * That makes no sense.
1789 static void say_comment_6(void)
1791 msg_print(comment_6[randint0(MAX_COMMENT_6)]);
1795 #define MAX_COMMENT_7A 4
1797 static concptr comment_7a[MAX_COMMENT_7A] =
1802 "誰かがむせび泣く声が聞こえる...。",
1807 "You hear someone sobbing...",
1808 "The shopkeeper howls in agony!"
1813 #define MAX_COMMENT_7B 4
1815 static concptr comment_7b[MAX_COMMENT_7B] =
1825 "The shopkeeper curses at you.",
1826 "The shopkeeper glares at you."
1831 #define MAX_COMMENT_7C 4
1833 static concptr comment_7c[MAX_COMMENT_7C] =
1842 "You've made my day!",
1843 "The shopkeeper giggles.",
1844 "The shopkeeper laughs loudly."
1849 #define MAX_COMMENT_7D 4
1851 static concptr comment_7d[MAX_COMMENT_7D] =
1855 "こんなおいしい思いをしたら、真面目に働けなくなるなぁ。",
1860 "I think I'll retire!",
1861 "The shopkeeper jumps for joy.",
1862 "The shopkeeper smiles gleefully."
1869 * @brief 店主が交渉を終えた際の反応を返す処理 /
1870 * Let a shop-keeper React to a purchase
1871 * @param price アイテムの取引額
1872 * @param value アイテムの実際価値
1873 * @param guess 店主が当初予想していた価値
1876 * We paid "price", it was worth "value", and we thought it was worth "guess"
1878 static void purchase_analyze(PRICE price, PRICE value, PRICE guess)
1880 /* Item was worthless, but we bought it */
1881 if ((value <= 0) && (price > value))
1883 msg_print(comment_7a[randint0(MAX_COMMENT_7A)]);
1884 chg_virtue(V_HONOUR, -1);
1885 chg_virtue(V_JUSTICE, -1);
1886 sound(SOUND_STORE1);
1889 /* Item was cheaper than we thought, and we paid more than necessary */
1890 else if ((value < guess) && (price > value))
1892 msg_print(comment_7b[randint0(MAX_COMMENT_7B)]);
1893 chg_virtue(V_JUSTICE, -1);
1894 if (one_in_(4)) chg_virtue(V_HONOUR, -1);
1895 sound(SOUND_STORE2);
1898 /* Item was a good bargain, and we got away with it */
1899 else if ((value > guess) && (value < (4 * guess)) && (price < value))
1901 msg_print(comment_7c[randint0(MAX_COMMENT_7C)]);
1902 if (one_in_(4)) chg_virtue(V_HONOUR, -1);
1903 else if (one_in_(4)) chg_virtue(V_HONOUR, 1);
1904 sound(SOUND_STORE3);
1907 /* Item was a great bargain, and we got away with it */
1908 else if ((value > guess) && (price < value))
1910 msg_print(comment_7d[randint0(MAX_COMMENT_7D)]);
1911 if (one_in_(2)) chg_virtue(V_HONOUR, -1);
1912 if (one_in_(4)) chg_virtue(V_HONOUR, 1);
1913 if (10 * price < value) chg_virtue(V_SACRIFICE, 1);
1914 sound(SOUND_STORE4);
1921 * We store the current "store feat" here so everyone can access it
1923 static int cur_store_feat;
1927 * Buying and selling adjustments for race combinations.
1928 * Entry[owner][player] gives the basic "cost inflation".
1930 static byte rgold_adj[MAX_RACES][MAX_RACES] =
1932 /*Hum, HfE, Elf, Hal, Gno, Dwa, HfO, HfT, Dun, HiE, Barbarian,
1933 HfOg, HGn, HTn, Cyc, Yek, Klc, Kbd, Nbl, DkE, Drc, Mind Flayer,
1934 Imp, Glm, Skl, Zombie, Vampire, Spectre, Fairy, Beastman, Ent,
1935 Angel, Demon, Kutar, Android, Merfolk */
1938 { 100, 105, 105, 110, 113, 115, 120, 125, 100, 105, 100,
1939 124, 120, 110, 125, 115, 120, 120, 120, 120, 115, 120,
1940 115, 105, 125, 125, 125, 125, 105, 120, 105, 95, 140,
1941 100, 120, 110, 105, 110 },
1944 { 110, 100, 100, 105, 110, 120, 125, 130, 110, 100, 110,
1945 120, 115, 108, 115, 110, 110, 120, 120, 115, 115, 110,
1946 120, 110, 110, 110, 120, 110, 100, 125, 100, 95, 140,
1947 110, 115, 110, 110, 110 },
1950 { 110, 105, 100, 105, 110, 120, 125, 130, 110, 100, 110,
1951 120, 120, 105, 120, 110, 105, 125, 125, 110, 115, 108,
1952 120, 115, 110, 110, 120, 110, 100, 125, 100, 95, 140,
1953 110, 110, 105, 110, 110 },
1956 { 115, 110, 105, 95, 105, 110, 115, 130, 115, 105, 115,
1957 125, 120, 120, 125, 115, 110, 120, 120, 120, 115, 115,
1958 120, 110, 120, 120, 130, 110, 110, 130, 110, 95, 140,
1959 115, 120, 105, 115, 105 },
1962 { 115, 115, 110, 105, 95, 110, 115, 130, 115, 110, 115,
1963 120, 125, 110, 120, 110, 105, 120, 110, 110, 105, 110,
1964 120, 101, 110, 110, 120, 120, 115, 130, 115, 95, 140,
1965 115, 110, 110, 115, 110 },
1968 { 115, 120, 120, 110, 110, 95, 125, 135, 115, 120, 115,
1969 125, 140, 130, 130, 120, 115, 115, 115, 135, 125, 120,
1970 120, 105, 115, 115, 115, 115, 120, 130, 120, 95, 140,
1971 115, 110, 115, 115, 120 },
1974 { 115, 120, 125, 115, 115, 130, 110, 115, 115, 125, 115,
1975 110, 110, 120, 110, 120, 125, 115, 115, 110, 120, 110,
1976 115, 125, 120, 120, 115, 120, 125, 115, 125, 95, 140,
1977 115, 110, 115, 115, 125 },
1980 { 110, 115, 115, 110, 110, 130, 110, 110, 110, 115, 110,
1981 110, 115, 120, 110, 120, 120, 110, 110, 110, 115, 110,
1982 110, 115, 112, 112, 115, 112, 120, 110, 120, 95, 140,
1983 110, 110, 115, 110, 130 },
1986 { 100, 105, 105, 110, 113, 115, 120, 125, 100, 105, 100,
1987 120, 120, 105, 120, 115, 105, 115, 120, 110, 105, 105,
1988 120, 105, 120, 120, 125, 120, 105, 135, 105, 95, 140,
1989 100, 110, 110, 100, 110 },
1992 { 110, 105, 100, 105, 110, 120, 125, 130, 110, 100, 110,
1993 125, 125, 101, 120, 115, 110, 115, 125, 110, 110, 110,
1994 125, 115, 120, 120, 125, 120, 100, 125, 100, 95, 140,
1995 110, 110, 105, 110, 110 },
1997 /* Human / Barbarian (copied from human) */
1998 { 100, 105, 105, 110, 113, 115, 120, 125, 100, 105, 100,
1999 124, 120, 110, 125, 115, 120, 120, 120, 120, 115, 120,
2000 115, 105, 125, 125, 130, 125, 115, 120, 115, 95, 140,
2001 100, 120, 110, 100, 110 },
2003 /* Half-Ogre: theoretical, copied from half-troll */
2004 { 110, 115, 115, 110, 110, 130, 110, 110, 110, 115, 110,
2005 110, 115, 120, 110, 120, 120, 110, 110, 110, 115, 110,
2006 110, 115, 112, 112, 115, 112, 120, 110, 120, 95, 140,
2007 110, 110, 115, 110, 120 },
2009 /* Half-Giant: theoretical, copied from half-troll */
2010 { 110, 115, 115, 110, 110, 130, 110, 110, 110, 115, 110,
2011 110, 115, 120, 110, 120, 120, 110, 110, 110, 115, 110,
2012 110, 115, 112, 112, 115, 112, 130, 120, 130, 95, 140,
2013 110, 110, 115, 110, 115 },
2015 /* Half-Titan: theoretical, copied from High_Elf */
2016 { 110, 105, 100, 105, 110, 120, 125, 130, 110, 100, 110,
2017 125, 125, 101, 120, 115, 110, 115, 125, 110, 110, 110,
2018 125, 115, 120, 120, 120, 120, 130, 130, 130, 95, 140,
2019 110, 110, 115, 110, 108 },
2021 /* Cyclops: theoretical, copied from half-troll */
2022 { 110, 115, 115, 110, 110, 130, 110, 110, 110, 115, 110,
2023 110, 115, 120, 110, 120, 120, 110, 110, 110, 115, 110,
2024 110, 115, 112, 112, 115, 112, 130, 130, 130, 95, 140,
2025 110, 110, 115, 110, 115 },
2027 /* Yeek: theoretical, copied from Half-Orc */
2028 { 115, 120, 125, 115, 115, 130, 110, 115, 115, 125, 115,
2029 110, 110, 120, 110, 120, 125, 115, 115, 110, 120, 110,
2030 115, 125, 120, 120, 120, 120, 130, 130, 130, 95, 140,
2031 115, 110, 115, 115, 110 },
2033 /* Klackon: theoretical, copied from Gnome */
2034 { 115, 115, 110, 105, 95, 110, 115, 130, 115, 110, 115,
2035 120, 125, 110, 120, 110, 105, 120, 110, 110, 105, 110,
2036 120, 101, 110, 110, 120, 120, 130, 130, 130, 95, 140,
2037 115, 110, 115, 115, 110 },
2039 /* Kobold: theoretical, copied from Half-Orc */
2040 { 115, 120, 125, 115, 115, 130, 110, 115, 115, 125, 115,
2041 110, 110, 120, 110, 120, 125, 115, 115, 110, 120, 110,
2042 115, 125, 120, 120, 120, 120, 130, 130, 130, 95, 140,
2043 115, 110, 115, 115, 120 },
2045 /* Nibelung: theoretical, copied from Dwarf */
2046 { 115, 120, 120, 110, 110, 95, 125, 135, 115, 120, 115,
2047 125, 140, 130, 130, 120, 115, 115, 115, 135, 125, 120,
2048 120, 105, 115, 115, 120, 120, 130, 130, 130, 95, 140,
2049 115, 135, 115, 115, 120 },
2052 { 110, 110, 110, 115, 120, 130, 115, 115, 120, 110, 115,
2053 115, 115, 116, 115, 120, 120, 115, 115, 101, 110, 110,
2054 110, 110, 112, 122, 110, 110, 110, 115, 110, 120, 120,
2055 110, 101, 115, 110, 115 },
2057 /* Draconian: theoretical, copied from High_Elf */
2058 { 110, 105, 100, 105, 110, 120, 125, 130, 110, 100, 110,
2059 125, 125, 101, 120, 115, 110, 115, 125, 110, 110, 110,
2060 125, 115, 120, 120, 120, 120, 130, 130, 130, 95, 140,
2061 110, 110, 115, 110, 115 },
2063 /* Mind Flayer: theoretical, copied from High_Elf */
2064 { 110, 105, 100, 105, 110, 120, 125, 130, 110, 100, 110,
2065 125, 125, 101, 120, 115, 110, 115, 125, 110, 110, 110,
2066 125, 115, 120, 120, 120, 120, 130, 130, 130, 95, 140,
2067 110, 110, 115, 110, 110 },
2069 /* Imp: theoretical, copied from High_Elf */
2070 { 110, 105, 100, 105, 110, 120, 125, 130, 110, 100, 110,
2071 125, 125, 101, 120, 115, 110, 115, 125, 110, 110, 110,
2072 125, 115, 120, 120, 120, 120, 130, 130, 130, 120, 120,
2073 110, 110, 115, 110, 120 },
2075 /* Golem: theoretical, copied from High_Elf */
2076 { 110, 105, 100, 105, 110, 120, 125, 130, 110, 100, 110,
2077 125, 125, 101, 120, 115, 110, 115, 125, 110, 110, 110,
2078 125, 115, 120, 120, 120, 120, 130, 130, 130, 95, 140,
2079 110, 110, 115, 110, 110 },
2081 /* Skeleton: theoretical, copied from half-orc */
2082 { 115, 120, 125, 115, 115, 130, 110, 115, 115, 125, 115,
2083 110, 110, 120, 110, 120, 125, 115, 115, 110, 120, 110,
2084 115, 125, 120, 120, 120, 120, 130, 130, 130, 120, 120,
2085 115, 110, 125, 115, 110 },
2087 /* Zombie: Theoretical, copied from half-orc */
2088 { 115, 120, 125, 115, 115, 130, 110, 115, 115, 125, 115,
2089 110, 110, 120, 110, 120, 125, 115, 115, 110, 120, 110,
2090 115, 125, 120, 120, 120, 120, 130, 130, 130, 120, 120,
2091 115, 110, 125, 115, 110 },
2093 /* Vampire: Theoretical, copied from half-orc */
2094 { 115, 120, 125, 115, 115, 130, 110, 115, 115, 125, 115,
2095 110, 110, 120, 110, 120, 125, 115, 115, 110, 120, 110,
2096 115, 125, 120, 120, 120, 120, 130, 130, 130, 120, 120,
2097 115, 110, 125, 115, 120 },
2099 /* Spectre: Theoretical, copied from half-orc */
2100 { 115, 120, 125, 115, 115, 130, 110, 115, 115, 125, 115,
2101 110, 110, 120, 110, 120, 125, 115, 115, 110, 120, 110,
2102 115, 125, 120, 120, 120, 120, 130, 130, 130, 120, 120,
2103 115, 110, 125, 115, 110 },
2105 /* Sprite: Theoretical, copied from half-orc */
2106 { 115, 120, 125, 115, 115, 130, 110, 115, 115, 125, 115,
2107 110, 110, 120, 110, 120, 125, 115, 115, 110, 120, 110,
2108 115, 125, 120, 120, 120, 120, 130, 130, 130, 95, 140,
2109 115, 110, 105, 115, 110 },
2111 /* Beastman: Theoretical, copied from half-orc */
2112 { 115, 120, 125, 115, 115, 130, 110, 115, 115, 125, 115,
2113 110, 110, 120, 110, 120, 125, 115, 115, 110, 120, 110,
2114 115, 125, 120, 120, 120, 120, 130, 130, 130, 95, 140,
2115 115, 110, 115, 115, 125 },
2118 { 110, 105, 100, 105, 110, 120, 125, 130, 110, 100, 110,
2119 120, 120, 105, 120, 110, 105, 125, 125, 110, 115, 108,
2120 120, 115, 110, 110, 120, 110, 100, 125, 100, 95, 140,
2121 110, 110, 105, 110, 110 },
2124 { 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95,
2125 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95,
2126 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 160,
2127 95, 95, 95, 95, 95 },
2130 { 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, 140,
2131 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, 140,
2132 140, 140, 140, 140, 140, 140, 140, 140, 140, 160, 120,
2133 140, 140, 140, 140, 140 },
2136 { 100, 105, 105, 110, 113, 115, 120, 125, 100, 105, 100,
2137 124, 120, 110, 125, 115, 120, 120, 120, 120, 115, 120,
2138 115, 105, 125, 125, 125, 125, 105, 120, 105, 95, 140,
2139 100, 120, 110, 100, 110 },
2142 { 110, 110, 110, 115, 120, 130, 115, 115, 120, 110, 115,
2143 115, 115, 116, 115, 120, 120, 115, 115, 101, 110, 110,
2144 110, 110, 112, 122, 110, 110, 110, 115, 110, 120, 120,
2145 110, 101, 115, 110, 115 },
2148 { 110, 110, 105, 105, 110, 115, 115, 115, 110, 105, 110,
2149 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115,
2150 115, 115, 125, 125, 125, 125, 105, 115, 105, 95, 140,
2151 110, 115, 100, 110, 110 },
2154 { 105, 105, 105, 110, 113, 115, 120, 125, 100, 105, 100,
2155 124, 120, 110, 125, 115, 120, 120, 120, 120, 115, 120,
2156 115, 105, 125, 125, 125, 125, 105, 120, 105, 95, 140,
2157 100, 120, 110, 100, 110 },
2160 { 110, 110, 110, 105, 110, 120, 125, 130, 110, 110, 110,
2161 120, 115, 108, 115, 110, 110, 120, 120, 115, 115, 110,
2162 120, 110, 110, 110, 120, 110, 110, 125, 110, 95, 140,
2163 110, 115, 110, 110, 100 },
2169 * @brief 店舗価格を決定する /
2170 * Determine the price of an item (qty one) in a store.
2171 * @param o_ptr 店舗に並べるオブジェクト構造体の参照ポインタ
2172 * @param greed 店主の強欲度
2173 * @param flip TRUEならば店主にとっての買取価格、FALSEなら売出価格を計算
2177 * This function takes into account the player's charisma, and the
2178 * shop-keepers friendliness, and the shop-keeper's base greed, but
2179 * never lets a shop-keeper lose money in a transaction.
2180 * The "greed" value should exceed 100 when the player is "buying" the
2181 * item, and should be less than 100 when the player is "selling" it.
2182 * Hack -- the black market always charges twice as much as it should.
2183 * Charisma adjustment runs from 80 to 130
2184 * Racial adjustment runs from 95 to 130
2185 * Since greed/charisma/racial adjustments are centered at 100, we need
2186 * to adjust (by 200) to extract a usable multiplier. Note that the
2187 * "greed" value is always something (?).
2190 static s32b price_item(object_type *o_ptr, int greed, bool flip)
2197 /* Get the value of one of the items */
2198 price = object_value(o_ptr);
2200 /* Worthless items */
2201 if (price <= 0) return (0L);
2204 /* Compute the racial factor */
2205 factor = rgold_adj[ot_ptr->owner_race][p_ptr->prace];
2207 /* Add in the charisma factor */
2208 factor += adj_chr_gold[p_ptr->stat_ind[A_CHR]];
2211 /* Shop is buying */
2214 /* Adjust for greed */
2215 adjust = 100 + (300 - (greed + factor));
2217 /* Never get "silly" */
2218 if (adjust > 100) adjust = 100;
2220 /* Mega-Hack -- Black market sucks */
2221 if (cur_store_num == STORE_BLACK)
2224 /* Compute the final price (with rounding) */
2225 /* Hack -- prevent underflow */
2226 price = (price * adjust + 50L) / 100L;
2229 /* Shop is selling */
2232 /* Adjust for greed */
2233 adjust = 100 + ((greed + factor) - 300);
2235 /* Never get "silly" */
2236 if (adjust < 100) adjust = 100;
2238 /* Mega-Hack -- Black market sucks */
2239 if (cur_store_num == STORE_BLACK)
2242 /* Compute the final price (with rounding) */
2243 /* Hack -- prevent overflow */
2244 price = (s32b)(((u32b)price * (u32b)adjust + 50UL) / 100UL);
2247 /* Note -- Never become "free" */
2248 if (price <= 0L) return (1L);
2250 /* Return the price */
2256 * @brief 安価な消耗品の販売数を増やし、低確率で割引にする /
2257 * Certain "cheap" objects should be created in "piles"
2258 * @param o_ptr 店舗に並べるオブジェクト構造体の参照ポインタ
2262 * Some objects can be sold at a "discount" (in small piles)
2265 static void mass_produce(object_type *o_ptr)
2268 DISCOUNT_RATE discount = 0;
2270 PRICE cost = object_value(o_ptr);
2273 /* Analyze the type */
2274 switch (o_ptr->tval)
2276 /* Food, Flasks, and Lites */
2281 if (cost <= 5L) size += damroll(3, 5);
2282 if (cost <= 20L) size += damroll(3, 5);
2283 if (cost <= 50L) size += damroll(2, 2);
2290 if (cost <= 60L) size += damroll(3, 5);
2291 if (cost <= 240L) size += damroll(1, 5);
2292 if (o_ptr->sval == SV_SCROLL_STAR_IDENTIFY) size += damroll(3, 5);
2293 if (o_ptr->sval == SV_SCROLL_STAR_REMOVE_CURSE) size += damroll(1, 4);
2298 case TV_SORCERY_BOOK:
2299 case TV_NATURE_BOOK:
2303 case TV_ARCANE_BOOK:
2305 case TV_DAEMON_BOOK:
2306 case TV_CRUSADE_BOOK:
2308 case TV_HISSATSU_BOOK:
2311 if (cost <= 50L) size += damroll(2, 3);
2312 if (cost <= 500L) size += damroll(1, 3);
2330 if (object_is_artifact(o_ptr)) break;
2331 if (object_is_ego(o_ptr)) break;
2332 if (cost <= 10L) size += damroll(3, 5);
2333 if (cost <= 100L) size += damroll(3, 5);
2342 if (cost <= 5L) size += damroll(5, 5);
2343 if (cost <= 50L) size += damroll(5, 5);
2344 if (cost <= 500L) size += damroll(5, 5);
2350 if (cost <= 100L) size += damroll(2, 2);
2351 if (cost <= 1000L) size += damroll(2, 2);
2364 * Because many rods (and a few wands and staffs) are useful mainly
2365 * in quantity, the Black Market will occasionally have a bunch of
2372 if ((cur_store_num == STORE_BLACK) && one_in_(3))
2374 if (cost < 1601L) size += damroll(1, 5);
2375 else if (cost < 3201L) size += damroll(1, 3);
2382 /* Pick a discount */
2387 else if (one_in_(25))
2391 else if (one_in_(150))
2395 else if (one_in_(300))
2399 else if (one_in_(500))
2404 if (o_ptr->art_name)
2409 /* Save the discount */
2410 o_ptr->discount = discount;
2412 /* Save the total pile size */
2413 o_ptr->number = size - (size * discount / 100);
2415 /* Ensure that mass-produced rods and wands get the correct pvals. */
2416 if ((o_ptr->tval == TV_ROD) || (o_ptr->tval == TV_WAND))
2418 o_ptr->pval *= (PARAMETER_VALUE)o_ptr->number;
2425 * @brief 店舗に並べた品を同一品であるかどうか判定する /
2426 * Determine if a store item can "absorb" another item
2427 * @param o_ptr 判定するオブジェクト構造体の参照ポインタ1
2428 * @param j_ptr 判定するオブジェクト構造体の参照ポインタ2
2429 * @return 同一扱いできるならTRUEを返す
2432 * See "object_similar()" for the same function for the "player"
2435 static bool store_object_similar(object_type *o_ptr, object_type *j_ptr)
2439 /* Hack -- Identical items cannot be stacked */
2440 if (o_ptr == j_ptr) return (0);
2442 /* Different objects cannot be stacked */
2443 if (o_ptr->k_idx != j_ptr->k_idx) return (0);
2445 /* Different charges (etc) cannot be stacked, unless wands or rods. */
2446 if ((o_ptr->pval != j_ptr->pval) && (o_ptr->tval != TV_WAND) && (o_ptr->tval != TV_ROD)) return (0);
2448 /* Require many identical values */
2449 if (o_ptr->to_h != j_ptr->to_h) return (0);
2450 if (o_ptr->to_d != j_ptr->to_d) return (0);
2451 if (o_ptr->to_a != j_ptr->to_a) return (0);
2453 /* Require identical "ego-item" names */
2454 if (o_ptr->name2 != j_ptr->name2) return (0);
2456 /* Artifacts don't stack! */
2457 if (object_is_artifact(o_ptr) || object_is_artifact(j_ptr)) return (0);
2459 /* Hack -- Identical art_flags! */
2460 for (i = 0; i < TR_FLAG_SIZE; i++)
2461 if (o_ptr->art_flags[i] != j_ptr->art_flags[i]) return (0);
2463 /* Hack -- Never stack "powerful" items */
2464 if (o_ptr->xtra1 || j_ptr->xtra1) return (0);
2466 /* Hack -- Never stack recharging items */
2467 if (o_ptr->timeout || j_ptr->timeout) return (0);
2469 /* Require many identical values */
2470 if (o_ptr->ac != j_ptr->ac) return (0);
2471 if (o_ptr->dd != j_ptr->dd) return (0);
2472 if (o_ptr->ds != j_ptr->ds) return (0);
2474 /* Hack -- Never stack chests */
2475 if (o_ptr->tval == TV_CHEST) return (0);
2476 if (o_ptr->tval == TV_STATUE) return (0);
2477 if (o_ptr->tval == TV_CAPTURE) return (0);
2479 /* Require matching discounts */
2480 if (o_ptr->discount != j_ptr->discount) return (0);
2482 /* They match, so they must be similar */
2488 * @brief 店舗に並べた品を重ね合わせできるかどうか判定する /
2489 * Allow a store item to absorb another item
2490 * @param o_ptr 判定するオブジェクト構造体の参照ポインタ1
2491 * @param j_ptr 判定するオブジェクト構造体の参照ポインタ2
2492 * @return 重ね合わせできるならTRUEを返す
2495 * See "object_similar()" for the same function for the "player"
2498 static void store_object_absorb(object_type *o_ptr, object_type *j_ptr)
2500 int max_num = (o_ptr->tval == TV_ROD) ?
2501 MIN(99, MAX_SHORT / k_info[o_ptr->k_idx].pval) : 99;
2502 int total = o_ptr->number + j_ptr->number;
2503 int diff = (total > max_num) ? total - max_num : 0;
2505 /* Combine quantity, lose excess items */
2506 o_ptr->number = (total > max_num) ? max_num : total;
2508 /* Hack -- if rods are stacking, add the pvals (maximum timeouts) together. -LM- */
2509 if (o_ptr->tval == TV_ROD)
2511 o_ptr->pval += j_ptr->pval * (j_ptr->number - diff) / j_ptr->number;
2514 /* Hack -- if wands are stacking, combine the charges. -LM- */
2515 if (o_ptr->tval == TV_WAND)
2517 o_ptr->pval += j_ptr->pval * (j_ptr->number - diff) / j_ptr->number;
2523 * @brief 店舗に品を置くスペースがあるかどうかの判定を返す /
2524 * Check to see if the shop will be carrying too many objects -RAK-
2525 * @param o_ptr 店舗に置きたいオブジェクト構造体の参照ポインタ
2526 * @return 置き場がないなら0、重ね合わせできるアイテムがあるなら-1、スペースがあるなら1を返す。
2529 * Note that the shop, just like a player, will not accept things
2530 * it cannot hold. Before, one could "nuke" potions this way.
2531 * Return value is now int:
2533 * -1 : Can be combined to existing slot.
2534 * 1 : Cannot be combined but there are empty spaces.
2537 static int store_check_num(object_type *o_ptr)
2542 /* The "home" acts like the player */
2543 if ((cur_store_num == STORE_HOME) || (cur_store_num == STORE_MUSEUM))
2545 bool old_stack_force_notes = stack_force_notes;
2546 bool old_stack_force_costs = stack_force_costs;
2548 if (cur_store_num != STORE_HOME)
2550 stack_force_notes = FALSE;
2551 stack_force_costs = FALSE;
2554 /* Check all the items */
2555 for (i = 0; i < st_ptr->stock_num; i++)
2557 /* Get the existing item */
2558 j_ptr = &st_ptr->stock[i];
2560 /* Can the new object be combined with the old one? */
2561 if (object_similar(j_ptr, o_ptr))
2563 if (cur_store_num != STORE_HOME)
2565 stack_force_notes = old_stack_force_notes;
2566 stack_force_costs = old_stack_force_costs;
2573 if (cur_store_num != STORE_HOME)
2575 stack_force_notes = old_stack_force_notes;
2576 stack_force_costs = old_stack_force_costs;
2580 /* Normal stores do special stuff */
2583 /* Check all the items */
2584 for (i = 0; i < st_ptr->stock_num; i++)
2586 /* Get the existing item */
2587 j_ptr = &st_ptr->stock[i];
2589 /* Can the new object be combined with the old one? */
2590 if (store_object_similar(j_ptr, o_ptr)) return -1;
2594 /* Free space is always usable */
2596 * オプション powerup_home が設定されていると
2599 if ((cur_store_num == STORE_HOME) && ( powerup_home == FALSE )) {
2600 if (st_ptr->stock_num < ((st_ptr->stock_size) / 10)) {
2605 if (st_ptr->stock_num < st_ptr->stock_size) {
2610 /* But there was no room at the inn... */
2615 * @brief オブジェクトが祝福されているかの判定を返す /
2616 * @param o_ptr 判定したいオブジェクト構造体の参照ポインタ
2617 * @return アイテムが祝福されたアイテムならばTRUEを返す
2619 static bool is_blessed(object_type *o_ptr)
2621 BIT_FLAGS flgs[TR_FLAG_SIZE];
2622 object_flags(o_ptr, flgs);
2623 if (have_flag(flgs, TR_BLESSED)) return (TRUE);
2624 else return (FALSE);
2630 * @brief オブジェクトが所定の店舗で引き取れるかどうかを返す /
2631 * Determine if the current store will purchase the given item
2632 * @param o_ptr 判定したいオブジェクト構造体の参照ポインタ
2633 * @return アイテムが買い取れるならばTRUEを返す
2635 * Note that a shop-keeper must refuse to buy "worthless" items
2637 static bool store_will_buy(object_type *o_ptr)
2639 /* Hack -- The Home is simple */
2640 if ((cur_store_num == STORE_HOME) || (cur_store_num == STORE_MUSEUM)) return (TRUE);
2642 /* Switch on the store */
2643 switch (cur_store_num)
2648 /* Analyze the type */
2649 switch (o_ptr->tval)
2652 if (o_ptr->sval != SV_POTION_WATER) return FALSE;
2664 case TV_BOTTLE: /* 'Green', recycling Angband */
2679 /* Analyze the type */
2680 switch (o_ptr->tval)
2701 /* Analyze the type */
2702 switch (o_ptr->tval)
2711 case TV_HISSATSU_BOOK:
2715 if(o_ptr->sval == SV_WIZSTAFF) return (FALSE);
2727 /* Analyze the type */
2728 switch (o_ptr->tval)
2731 case TV_CRUSADE_BOOK:
2741 monster_race *r_ptr = &r_info[o_ptr->pval];
2744 if (!(r_ptr->flags3 & RF3_EVIL))
2747 if (r_ptr->flags3 & RF3_GOOD) break;
2749 /* Accept animals */
2750 if (r_ptr->flags3 & RF3_ANIMAL) break;
2753 if (my_strchr("?!", r_ptr->d_char)) break;
2759 if (is_blessed(o_ptr)) break;
2768 case STORE_ALCHEMIST:
2770 /* Analyze the type */
2771 switch (o_ptr->tval)
2785 /* Analyze the type */
2786 switch (o_ptr->tval)
2788 case TV_SORCERY_BOOK:
2789 case TV_NATURE_BOOK:
2793 case TV_ARCANE_BOOK:
2795 case TV_DAEMON_BOOK:
2809 if(o_ptr->sval == SV_WIZSTAFF) break;
2810 else return (FALSE);
2817 /* Bookstore Shop */
2820 /* Analyze the type */
2821 switch (o_ptr->tval)
2823 case TV_SORCERY_BOOK:
2824 case TV_NATURE_BOOK:
2829 case TV_ARCANE_BOOK:
2831 case TV_DAEMON_BOOK:
2832 case TV_CRUSADE_BOOK:
2843 /* Ignore "worthless" items */
2844 if (object_value(o_ptr) <= 0) return (FALSE);
2852 * @brief 現在の町の指定された店舗のアイテムを整理する /
2853 * Combine and reorder items in store.
2854 * @param store_num 店舗ID
2855 * @return 実際に整理が行われたならばTRUEを返す。
2857 bool combine_and_reorder_home(int store_num)
2861 object_type forge, *o_ptr, *j_ptr;
2862 bool flag = FALSE, combined;
2863 store_type *old_st_ptr = st_ptr;
2864 bool old_stack_force_notes = stack_force_notes;
2865 bool old_stack_force_costs = stack_force_costs;
2867 st_ptr = &town_info[1].store[store_num];
2868 if (store_num != STORE_HOME)
2870 stack_force_notes = FALSE;
2871 stack_force_costs = FALSE;
2878 /* Combine the items in the home (backwards) */
2879 for (i = st_ptr->stock_num - 1; i > 0; i--)
2881 o_ptr = &st_ptr->stock[i];
2883 /* Skip empty items */
2884 if (!o_ptr->k_idx) continue;
2886 /* Scan the items above that item */
2887 for (j = 0; j < i; j++)
2891 j_ptr = &st_ptr->stock[j];
2893 /* Skip empty items */
2894 if (!j_ptr->k_idx) continue;
2897 * Get maximum number of the stack if these
2898 * are similar, get zero otherwise.
2900 max_num = object_similar_part(j_ptr, o_ptr);
2902 /* Can we (partialy) drop "o_ptr" onto "j_ptr"? */
2903 if (max_num && j_ptr->number < max_num)
2905 if (o_ptr->number + j_ptr->number <= max_num)
2907 /* Add together the item counts */
2908 object_absorb(j_ptr, o_ptr);
2910 /* One object is gone */
2911 st_ptr->stock_num--;
2913 /* Slide everything down */
2914 for (k = i; k < st_ptr->stock_num; k++)
2916 /* Structure copy */
2917 st_ptr->stock[k] = st_ptr->stock[k + 1];
2920 /* Erase the "final" slot */
2921 object_wipe(&st_ptr->stock[k]);
2925 ITEM_NUMBER old_num = o_ptr->number;
2926 ITEM_NUMBER remain = j_ptr->number + o_ptr->number - max_num;
2928 /* Add together the item counts */
2929 object_absorb(j_ptr, o_ptr);
2931 o_ptr->number = remain;
2933 /* Hack -- if rods are stacking, add the pvals (maximum timeouts) and current timeouts together. -LM- */
2934 if (o_ptr->tval == TV_ROD)
2936 o_ptr->pval = o_ptr->pval * remain / old_num;
2937 o_ptr->timeout = o_ptr->timeout * remain / old_num;
2940 /* Hack -- if wands are stacking, combine the charges. -LM- */
2941 else if (o_ptr->tval == TV_WAND)
2943 o_ptr->pval = o_ptr->pval * remain / old_num;
2958 /* Re-order the items in the home (forwards) */
2959 for (i = 0; i < st_ptr->stock_num; i++)
2961 o_ptr = &st_ptr->stock[i];
2963 /* Skip empty slots */
2964 if (!o_ptr->k_idx) continue;
2966 /* Get the "value" of the item */
2967 o_value = object_value(o_ptr);
2969 /* Scan every occupied slot */
2970 for (j = 0; j < st_ptr->stock_num; j++)
2972 if (object_sort_comp(o_ptr, o_value, &st_ptr->stock[j])) break;
2975 /* Never move down */
2976 if (j >= i) continue;
2982 /* Save a copy of the moving item */
2983 object_copy(j_ptr, &st_ptr->stock[i]);
2985 /* Slide the objects */
2986 for (k = i; k > j; k--)
2988 /* Slide the item */
2989 object_copy(&st_ptr->stock[k], &st_ptr->stock[k - 1]);
2992 /* Insert the moving item */
2993 object_copy(&st_ptr->stock[j], j_ptr);
2996 st_ptr = old_st_ptr;
2997 if (store_num != STORE_HOME)
2999 stack_force_notes = old_stack_force_notes;
3000 stack_force_costs = old_stack_force_costs;
3008 * @brief 我が家にオブジェクトを加える /
3009 * Add the item "o_ptr" to the p_ptr->inventory_list of the "Home"
3010 * @param o_ptr 加えたいオブジェクトの構造体参照ポインタ
3014 * In all cases, return the slot (or -1) where the object was placed
3015 * Note that this is a hacked up version of "inven_carry()".
3016 * Also note that it may not correctly "adapt" to "knowledge" bacoming
3017 * known, the player may have to pick stuff up and drop it again.
3020 static int home_carry(object_type *o_ptr)
3026 bool old_stack_force_notes = stack_force_notes;
3027 bool old_stack_force_costs = stack_force_costs;
3029 if (cur_store_num != STORE_HOME)
3031 stack_force_notes = FALSE;
3032 stack_force_costs = FALSE;
3035 /* Check each existing item (try to combine) */
3036 for (slot = 0; slot < st_ptr->stock_num; slot++)
3038 /* Get the existing item */
3039 j_ptr = &st_ptr->stock[slot];
3041 /* The home acts just like the player */
3042 if (object_similar(j_ptr, o_ptr))
3044 /* Save the new number of items */
3045 object_absorb(j_ptr, o_ptr);
3047 if (cur_store_num != STORE_HOME)
3049 stack_force_notes = old_stack_force_notes;
3050 stack_force_costs = old_stack_force_costs;
3058 if (cur_store_num != STORE_HOME)
3060 stack_force_notes = old_stack_force_notes;
3061 stack_force_costs = old_stack_force_costs;
3066 * 隠し機能: オプション powerup_home が設定されていると
3070 if ((cur_store_num != STORE_HOME) || (powerup_home == TRUE)) {
3071 if (st_ptr->stock_num >= st_ptr->stock_size) {
3076 if (st_ptr->stock_num >= ((st_ptr->stock_size) / 10)) {
3082 /* Determine the "value" of the item */
3083 value = object_value(o_ptr);
3085 /* Check existing slots to see if we must "slide" */
3086 for (slot = 0; slot < st_ptr->stock_num; slot++)
3088 if (object_sort_comp(o_ptr, value, &st_ptr->stock[slot])) break;
3091 /* Slide the others up */
3092 for (i = st_ptr->stock_num; i > slot; i--)
3094 st_ptr->stock[i] = st_ptr->stock[i-1];
3097 /* More stuff now */
3098 st_ptr->stock_num++;
3100 /* Insert the new item */
3101 st_ptr->stock[slot] = *o_ptr;
3103 chg_virtue(V_SACRIFICE, -1);
3105 (void)combine_and_reorder_home(cur_store_num);
3107 /* Return the location */
3113 * @brief 店舗にオブジェクトを加える /
3114 * Add the item "o_ptr" to a real stores p_ptr->inventory_list.
3115 * @param o_ptr 加えたいオブジェクトの構造体参照ポインタ
3119 * In all cases, return the slot (or -1) where the object was placed
3120 * Note that this is a hacked up version of "inven_carry()".
3121 * Also note that it may not correctly "adapt" to "knowledge" bacoming
3122 * known, the player may have to pick stuff up and drop it again.
3125 static int store_carry(object_type *o_ptr)
3128 PRICE value, j_value;
3132 /* Evaluate the object */
3133 value = object_value(o_ptr);
3135 /* Cursed/Worthless items "disappear" when sold */
3136 if (value <= 0) return (-1);
3138 /* All store items are fully *identified* */
3139 o_ptr->ident |= IDENT_MENTAL;
3141 /* Erase the inscription */
3142 o_ptr->inscription = 0;
3144 /* Erase the "feeling" */
3145 o_ptr->feeling = FEEL_NONE;
3147 /* Check each existing item (try to combine) */
3148 for (slot = 0; slot < st_ptr->stock_num; slot++)
3150 /* Get the existing item */
3151 j_ptr = &st_ptr->stock[slot];
3153 /* Can the existing items be incremented? */
3154 if (store_object_similar(j_ptr, o_ptr))
3156 /* Hack -- extra items disappear */
3157 store_object_absorb(j_ptr, o_ptr);
3165 if (st_ptr->stock_num >= st_ptr->stock_size) return (-1);
3168 /* Check existing slots to see if we must "slide" */
3169 for (slot = 0; slot < st_ptr->stock_num; slot++)
3172 j_ptr = &st_ptr->stock[slot];
3174 /* Objects sort by decreasing type */
3175 if (o_ptr->tval > j_ptr->tval) break;
3176 if (o_ptr->tval < j_ptr->tval) continue;
3178 /* Objects sort by increasing sval */
3179 if (o_ptr->sval < j_ptr->sval) break;
3180 if (o_ptr->sval > j_ptr->sval) continue;
3183 * Hack: otherwise identical rods sort by
3184 * increasing recharge time --dsb
3186 if (o_ptr->tval == TV_ROD)
3188 if (o_ptr->pval < j_ptr->pval) break;
3189 if (o_ptr->pval > j_ptr->pval) continue;
3192 /* Evaluate that slot */
3193 j_value = object_value(j_ptr);
3195 /* Objects sort by decreasing value */
3196 if (value > j_value) break;
3197 if (value < j_value) continue;
3200 /* Slide the others up */
3201 for (i = st_ptr->stock_num; i > slot; i--)
3203 st_ptr->stock[i] = st_ptr->stock[i-1];
3206 /* More stuff now */
3207 st_ptr->stock_num++;
3209 /* Insert the new item */
3210 st_ptr->stock[slot] = *o_ptr;
3212 /* Return the location */
3218 * @brief 店舗のオブジェクト数を増やす /
3219 * Add the item "o_ptr" to a real stores p_ptr->inventory_list.
3220 * @param item 増やしたいアイテムのID
3225 * Increase, by a given amount, the number of a certain item
3226 * in a certain store. This can result in zero items.
3228 * @todo numは本来ITEM_NUMBER型にしたい。
3230 static void store_item_increase(INVENTORY_IDX item, int num)
3235 o_ptr = &st_ptr->stock[item];
3237 /* Verify the number */
3238 cnt = o_ptr->number + num;
3239 if (cnt > 255) cnt = 255;
3240 else if (cnt < 0) cnt = 0;
3241 num = cnt - o_ptr->number;
3243 /* Save the new number */
3244 o_ptr->number += (ITEM_NUMBER)num;
3249 * @brief 店舗のオブジェクト数を削除する /
3250 * Remove a slot if it is empty
3251 * @param item 削除したいアイテムのID
3254 static void store_item_optimize(INVENTORY_IDX item)
3259 o_ptr = &st_ptr->stock[item];
3262 if (!o_ptr->k_idx) return;
3264 /* Must have no items */
3265 if (o_ptr->number) return;
3268 st_ptr->stock_num--;
3270 /* Slide everyone */
3271 for (j = item; j < st_ptr->stock_num; j++)
3273 st_ptr->stock[j] = st_ptr->stock[j + 1];
3276 /* Nuke the final slot */
3277 object_wipe(&st_ptr->stock[j]);
3281 * @brief ブラックマーケット用の無価値品の排除判定 /
3282 * This function will keep 'crap' out of the black market.
3283 * @param o_ptr 判定したいオブジェクトの構造体参照ポインタ
3284 * @return ブラックマーケットにとって無価値な品ならばTRUEを返す
3287 * Crap is defined as any item that is "available" elsewhere
3288 * Based on a suggestion by "Lee Vogt" <lvogt@cig.mcel.mot.com>
3291 static bool black_market_crap(object_type *o_ptr)
3295 /* Ego items are never crap */
3296 if (object_is_ego(o_ptr)) return (FALSE);
3298 /* Good items are never crap */
3299 if (o_ptr->to_a > 0) return (FALSE);
3300 if (o_ptr->to_h > 0) return (FALSE);
3301 if (o_ptr->to_d > 0) return (FALSE);
3303 /* Check all stores */
3304 for (i = 0; i < MAX_STORES; i++)
3306 if (i == STORE_HOME) continue;
3307 if (i == STORE_MUSEUM) continue;
3309 /* Check every item in the store */
3310 for (j = 0; j < town_info[p_ptr->town_num].store[i].stock_num; j++)
3312 object_type *j_ptr = &town_info[p_ptr->town_num].store[i].stock[j];
3314 /* Duplicate item "type", assume crappy */
3315 if (o_ptr->k_idx == j_ptr->k_idx) return (TRUE);
3325 * @brief 店舗の品揃え変化のためにアイテムを削除する /
3326 * Attempt to delete (some of) a random item from the store
3330 * Hack -- we attempt to "maintain" piles of items when possible.
3333 static void store_delete(void)
3338 /* Pick a random slot */
3339 what = (INVENTORY_IDX)randint0(st_ptr->stock_num);
3341 /* Determine how many items are here */
3342 num = st_ptr->stock[what].number;
3344 /* Hack -- sometimes, only destroy half the items */
3345 if (randint0(100) < 50) num = (num + 1) / 2;
3347 /* Hack -- sometimes, only destroy a single item */
3348 if (randint0(100) < 50) num = 1;
3350 /* Hack -- decrement the maximum timeouts and total charges of rods and wands. -LM- */
3351 if ((st_ptr->stock[what].tval == TV_ROD) || (st_ptr->stock[what].tval == TV_WAND))
3353 st_ptr->stock[what].pval -= num * st_ptr->stock[what].pval / st_ptr->stock[what].number;
3356 /* Actually destroy (part of) the item */
3357 store_item_increase(what, -num);
3358 store_item_optimize(what);
3363 * @brief 店舗の品揃え変化のためにアイテムを追加する /
3364 * Creates a random item and gives it to a store
3368 * This algorithm needs to be rethought. A lot.
3369 * Currently, "normal" stores use a pre-built array.
3370 * Note -- the "level" given to "obj_get_num()" is a "favored"
3371 * level, that is, there is a much higher chance of getting
3372 * items with a level approaching that of the given level...
3373 * Should we check for "permission" to have the given item?
3376 static void store_create(void)
3386 /* Paranoia -- no room left */
3387 if (st_ptr->stock_num >= st_ptr->stock_size) return;
3390 /* Hack -- consider up to four items */
3391 for (tries = 0; tries < 4; tries++)
3394 if (cur_store_num == STORE_BLACK)
3396 /* Pick a level for object/magic */
3397 level = 25 + randint0(25);
3399 /* Random item (usually of given level) */
3400 i = get_obj_num(level);
3402 /* Handle failure */
3409 /* Hack -- Pick an item to sell */
3410 i = st_ptr->table[randint0(st_ptr->table_num)];
3412 /* Hack -- fake level for apply_magic() */
3413 level = rand_range(1, STORE_OBJ_LEVEL);
3418 /* Create a new object of the chosen kind */
3419 object_prep(q_ptr, i);
3421 /* Apply some "low-level" magic (no artifacts) */
3422 apply_magic(q_ptr, level, AM_NO_FIXED_ART);
3424 /* Require valid object */
3425 if (!store_will_buy(q_ptr)) continue;
3427 /* Hack -- Charge lite's */
3428 if (q_ptr->tval == TV_LITE)
3430 if (q_ptr->sval == SV_LITE_TORCH) q_ptr->xtra4 = FUEL_TORCH / 2;
3431 if (q_ptr->sval == SV_LITE_LANTERN) q_ptr->xtra4 = FUEL_LAMP / 2;
3435 /* The item is "known" */
3436 object_known(q_ptr);
3438 /* Mark it storebought */
3439 q_ptr->ident |= IDENT_STORE;
3441 /* Mega-Hack -- no chests in stores */
3442 if (q_ptr->tval == TV_CHEST) continue;
3444 /* Prune the black market */
3445 if (cur_store_num == STORE_BLACK)
3447 /* Hack -- No "crappy" items */
3448 if (black_market_crap(q_ptr)) continue;
3450 /* Hack -- No "cheap" items */
3451 if (object_value(q_ptr) < 10) continue;
3453 /* No "worthless" items */
3454 /* if (object_value(q_ptr) <= 0) continue; */
3457 /* Prune normal stores */
3460 /* No "worthless" items */
3461 if (object_value(q_ptr) <= 0) continue;
3465 /* Mass produce and/or Apply discount */
3466 mass_produce(q_ptr);
3468 /* Attempt to carry the (known) item */
3469 (void)store_carry(q_ptr);
3471 /* Definitely done */
3478 * @brief 店舗の割引対象外にするかどうかを判定 /
3479 * Eliminate need to bargain if player has haggled well in the past
3480 * @param minprice アイテムの最低販売価格
3481 * @return 割引を禁止するならTRUEを返す。
3483 static bool noneedtobargain(PRICE minprice)
3485 PRICE good = st_ptr->good_buy;
3486 PRICE bad = st_ptr->bad_buy;
3488 /* Cheap items are "boring" */
3489 if (minprice < 10L) return (TRUE);
3491 /* Perfect haggling */
3492 if (good == MAX_SHORT) return (TRUE);
3494 /* Reward good haggles, punish bad haggles, notice price */
3495 if (good > ((3 * bad) + (5 + (minprice/50)))) return (TRUE);
3497 /* Return the flag */
3503 * @brief 店主の持つプレイヤーに対する売買の良し悪し経験を記憶する /
3504 * Update the bargain info
3505 * @param price 実際の取引価格
3506 * @param minprice 店主の提示した価格
3510 static void updatebargain(PRICE price, PRICE minprice, int num)
3512 /* Hack -- auto-haggle */
3513 if (!manual_haggle) return;
3515 /* Cheap items are "boring" */
3516 if ((minprice/num) < 10L) return;
3518 /* Count the successful haggles */
3519 if (price == minprice)
3521 /* Just count the good haggles */
3522 if (st_ptr->good_buy < MAX_SHORT)
3528 /* Count the failed haggles */
3531 /* Just count the bad haggles */
3532 if (st_ptr->bad_buy < MAX_SHORT)
3541 * @brief 店の商品リストを再表示する /
3542 * Re-displays a single store entry
3546 static void display_entry(int pos)
3552 GAME_TEXT o_name[MAX_NLEN];
3557 o_ptr = &st_ptr->stock[pos];
3559 /* Get the "offset" */
3560 i = (pos % store_bottom);
3562 /* Label it, clear the line --(-- */
3563 (void)sprintf(out_val, "%c) ", ((i > 25) ? toupper(I2A(i - 26)) : I2A(i)));
3564 prt(out_val, i+6, 0);
3567 if (show_item_graph)
3569 TERM_COLOR a = object_attr(o_ptr);
3570 SYMBOL_CODE c = object_char(o_ptr);
3572 Term_queue_bigchar(cur_col, i + 6, a, c, 0, 0);
3573 if (use_bigtile) cur_col++;
3578 /* Describe an item in the home */
3579 if ((cur_store_num == STORE_HOME) || (cur_store_num == STORE_MUSEUM))
3583 /* Leave room for weights, if necessary -DRS- */
3584 if (show_weights) maxwid -= 10;
3586 object_desc(o_name, o_ptr, 0);
3587 o_name[maxwid] = '\0';
3588 c_put_str(tval_to_attr[o_ptr->tval], o_name, i+6, cur_col);
3593 /* Only show the weight of an individual item */
3594 WEIGHT wgt = o_ptr->weight;
3596 sprintf(out_val, "%3d.%1d kg", lbtokg1(wgt) , lbtokg2(wgt));
3597 put_str(out_val, i+6, 67);
3599 (void)sprintf(out_val, "%3d.%d lb", wgt / 10, wgt % 10);
3600 put_str(out_val, i+6, 68);
3606 /* Describe an item (fully) in a store */
3609 /* Must leave room for the "price" */
3612 /* Leave room for weights, if necessary -DRS- */
3613 if (show_weights) maxwid -= 7;
3615 /* Describe the object (fully) */
3616 object_desc(o_name, o_ptr, 0);
3617 o_name[maxwid] = '\0';
3618 c_put_str(tval_to_attr[o_ptr->tval], o_name, i+6, cur_col);
3623 /* Only show the weight of an individual item */
3624 int wgt = o_ptr->weight;
3626 sprintf(out_val, "%3d.%1d", lbtokg1(wgt) , lbtokg2(wgt) );
3627 put_str(out_val, i+6, 60);
3629 (void)sprintf(out_val, "%3d.%d", wgt / 10, wgt % 10);
3630 put_str(out_val, i+6, 61);
3635 /* Display a "fixed" cost */
3636 if (o_ptr->ident & (IDENT_FIXED))
3638 /* Extract the "minimum" price */
3639 x = price_item(o_ptr, ot_ptr->min_inflate, FALSE);
3641 /* Actually draw the price (not fixed) */
3643 (void)sprintf(out_val, "%9ld固", (long)x);
3645 (void)sprintf(out_val, "%9ld F", (long)x);
3647 put_str(out_val, i+6, 68);
3650 /* Display a "taxed" cost */
3651 else if (!manual_haggle)
3653 /* Extract the "minimum" price */
3654 x = price_item(o_ptr, ot_ptr->min_inflate, FALSE);
3656 /* Hack -- Apply Sales Tax if needed */
3657 if (!noneedtobargain(x)) x += x / 10;
3659 /* Actually draw the price (with tax) */
3660 (void)sprintf(out_val, "%9ld ", (long)x);
3661 put_str(out_val, i+6, 68);
3664 /* Display a "haggle" cost */
3667 /* Extrect the "maximum" price */
3668 x = price_item(o_ptr, ot_ptr->max_inflate, FALSE);
3670 /* Actually draw the price (not fixed) */
3671 (void)sprintf(out_val, "%9ld ", (long)x);
3672 put_str(out_val, i+6, 68);
3679 * @brief 店の商品リストを表示する /
3680 * Displays a store's p_ptr->inventory_list -RAK-
3683 * All prices are listed as "per individual object". -BEN-
3685 static void display_inventory(void)
3689 /* Display the next 12 items */
3690 for (k = 0; k < store_bottom; k++)
3692 /* Do not display "dead" items */
3693 if (store_top + k >= st_ptr->stock_num) break;
3695 /* Display that line */
3696 display_entry(store_top + k);
3699 /* Erase the extra lines and the "more" prompt */
3700 for (i = k; i < store_bottom + 1; i++) prt("", i + 6, 0);
3702 /* Assume "no current page" */
3704 put_str(" ", 5, 20);
3706 put_str(" ", 5, 20);
3710 /* Visual reminder of "more items" */
3711 if (st_ptr->stock_num > store_bottom)
3713 /* Show "more" reminder (after the last item) */
3714 prt(_("-続く-", "-more-"), k + 6, 3);
3716 /* Indicate the "current page" */
3717 /* Trailing spaces are to display (Page xx) and (Page x) */
3718 put_str(format(_("(%dページ) ", "(Page %d) "), store_top/store_bottom + 1), 5, 20);
3721 if (cur_store_num == STORE_HOME || cur_store_num == STORE_MUSEUM)
3723 k = st_ptr->stock_size;
3725 if (cur_store_num == STORE_HOME && !powerup_home) k /= 10;
3727 put_str(format("アイテム数: %4d/%4d", st_ptr->stock_num, k), 19 + xtra_stock, 27);
3729 put_str(format("Objects: %4d/%4d", st_ptr->stock_num, k), 19 + xtra_stock, 30);
3736 * @brief プレイヤーの所持金を表示する /
3737 * Displays players gold -RAK-
3741 static void store_prt_gold(void)
3745 prt(_("手持ちのお金: ", "Gold Remaining: "), 19 + xtra_stock, 53);
3746 sprintf(out_val, "%9ld", (long)p_ptr->au);
3747 prt(out_val, 19 + xtra_stock, 68);
3751 * @brief 店舗情報全体を表示するメインルーチン /
3752 * Displays store (after clearing screen) -RAK-
3756 static void display_store(void)
3762 /* The "Home" is special */
3763 if (cur_store_num == STORE_HOME)
3765 /* Put the owner name */
3766 put_str(_("我が家", "Your Home"), 3, 31);
3768 /* Label the item descriptions */
3769 put_str(_("アイテムの一覧", "Item Description"), 5, 4);
3771 /* If showing weights, show label */
3774 put_str(_(" 重さ", "Weight"), 5, 70);
3778 /* The "Home" is special */
3779 else if (cur_store_num == STORE_MUSEUM)
3781 /* Put the owner name */
3782 put_str(_("博物館", "Museum"), 3, 31);
3784 /* Label the item descriptions */
3785 put_str(_("アイテムの一覧", "Item Description"), 5, 4);
3787 /* If showing weights, show label */
3790 put_str(_(" 重さ", "Weight"), 5, 70);
3797 concptr store_name = (f_name + f_info[cur_store_feat].name);
3798 concptr owner_name = (ot_ptr->owner_name);
3799 concptr race_name = race_info[ot_ptr->owner_race].title;
3801 /* Put the owner name and race */
3802 sprintf(buf, "%s (%s)", owner_name, race_name);
3803 put_str(buf, 3, 10);
3805 /* Show the max price in the store (above prices) */
3806 sprintf(buf, "%s (%ld)", store_name, (long)(ot_ptr->max_cost));
3809 /* Label the item descriptions */
3810 put_str(_("商品の一覧", "Item Description"), 5, 5);
3813 /* If showing weights, show label */
3816 put_str(_(" 重さ", "Weight"), 5, 60);
3819 /* Label the asking price (in stores) */
3820 put_str(_(" 価格", "Price"), 5, 72);
3823 /* Display the current gold */
3826 /* Draw in the p_ptr->inventory_list */
3827 display_inventory();
3833 * @brief 店舗からアイテムを選択する /
3834 * Get the ID of a store item and return its value -RAK-
3835 * @param com_val 選択IDを返す参照ポインタ
3836 * @param pmt メッセージキャプション
3839 * @return 実際に選択したらTRUE、キャンセルしたらFALSE
3841 static int get_stock(COMMAND_CODE *com_val, concptr pmt, int i, int j)
3847 /* Get the item index */
3848 if (repeat_pull(com_val))
3850 /* Verify the item */
3851 if ((*com_val >= i) && (*com_val <= j))
3859 /* Assume failure */
3862 /* Build the prompt */
3864 hi = (j > 25) ? toupper(I2A(j - 26)) : I2A(j);
3866 (void)sprintf(out_val, "(%s:%c-%c, ESCで中断) %s",
3867 (((cur_store_num == STORE_HOME) || (cur_store_num == STORE_MUSEUM)) ? "アイテム" : "商品"),
3870 (void)sprintf(out_val, "(Items %c-%c, ESC to exit) %s",
3875 /* Ask until done */
3881 if (!get_com(out_val, &command, FALSE)) break;
3884 if (islower(command))
3886 else if (isupper(command))
3887 k = A2I(tolower(command)) + 26;
3891 /* Legal responses */
3892 if ((k >= i) && (k <= j))
3901 /* Clear the prompt */
3904 if (command == ESCAPE) return (FALSE);
3906 repeat_push(*com_val);
3914 * @brief 店主の不満度を増やし、プレイヤーを締め出す判定と処理を行う /
3915 * Increase the insult counter and get angry if too many -RAK-
3916 * @return プレイヤーを締め出す場合TRUEを返す
3918 static int increase_insults(void)
3920 /* Increase insults */
3921 st_ptr->insult_cur++;
3923 /* Become insulted */
3924 if (st_ptr->insult_cur > ot_ptr->insult_max)
3930 st_ptr->insult_cur = 0;
3931 st_ptr->good_buy = 0;
3932 st_ptr->bad_buy = 0;
3935 st_ptr->store_open = current_world_ptr->game_turn + TURNS_PER_TICK*TOWN_DAWN/8 + randint1(TURNS_PER_TICK*TOWN_DAWN/8);
3947 * @brief 店主の不満度を減らす /
3948 * Decrease insults -RAK-
3949 * @return プレイヤーを締め出す場合TRUEを返す
3951 static void decrease_insults(void)
3953 /* Decrease insults */
3954 if (st_ptr->insult_cur) st_ptr->insult_cur--;
3959 * @brief 店主の不満度が増えた場合のみのメッセージを表示する /
3960 * Have insulted while haggling -RAK-
3961 * @return プレイヤーを締め出す場合TRUEを返す
3963 static int haggle_insults(void)
3965 /* Increase insults */
3966 if (increase_insults()) return (TRUE);
3968 /* Display and flush insult */
3977 * Mega-Hack -- Enable "increments"
3979 static bool allow_inc = FALSE;
3982 * Mega-Hack -- Last "increment" during haggling
3984 static s32b last_inc = 0L;
3988 * @brief 交渉価格を確認と認証の是非を行う /
3991 * @param poffer 別途価格提示をした場合の値を返す参照ポインタ
3992 * @param price 現在の交渉価格
3993 * @param final 最終確定価格ならばTRUE
3994 * @return プレイヤーを締め出す場合TRUEを返す
3996 static int get_haggle(concptr pmt, s32b *poffer, PRICE price, int final)
4001 GAME_TEXT out_val[160];
4003 /* Clear old increment if necessary */
4004 if (!allow_inc) last_inc = 0L;
4009 sprintf(buf, _("%s [承諾] ", "%s [accept] "), pmt);
4012 /* Old (negative) increment, and not final */
4013 else if (last_inc < 0)
4015 sprintf(buf, _("%s [-$%ld] ", "%s [-%ld] "), pmt, (long)(ABS(last_inc)));
4018 /* Old (positive) increment, and not final */
4019 else if (last_inc > 0)
4021 sprintf(buf, _("%s [+$%ld] ", "%s [+%ld] "), pmt, (long)(ABS(last_inc)));
4027 sprintf(buf, "%s ", pmt);
4031 /* Ask until done */
4036 /* Display prompt */
4040 strcpy(out_val, "");
4043 * Ask the user for a response.
4044 * Don't allow to use numpad as cursor key.
4046 res = askfor_aux(out_val, 32, FALSE);
4052 if (!res) return FALSE;
4054 /* Skip leading spaces */
4055 for (p = out_val; *p == ' '; p++) /* loop */;
4057 /* Empty response */
4060 /* Accept current price */
4068 /* Use previous increment */
4069 if (allow_inc && last_inc)
4071 *poffer += last_inc;
4076 /* Normal response */
4079 /* Extract a number */
4082 /* Handle "incremental" number */
4083 if ((*p == '+' || *p == '-'))
4085 /* Allow increments */
4088 /* Use the given "increment" */
4095 /* Handle normal number */
4098 /* Use the given "number" */
4106 msg_print(_("値がおかしいです。", "Invalid response."));
4116 * @brief 店主がプレイヤーからの交渉価格を判断する /
4117 * Receive an offer (from the player)
4119 * @param poffer 店主からの交渉価格を返す参照ポインタ
4120 * @param last_offer 現在の交渉価格
4121 * @param factor 店主の価格基準倍率
4122 * @param price アイテムの実価値
4123 * @param final 最終価格確定ならばTRUE
4124 * @return プレイヤーの価格に対して不服ならばTRUEを返す /
4125 * Return TRUE if offer is NOT okay
4127 static bool receive_offer(concptr pmt, s32b *poffer,
4128 s32b last_offer, int factor,
4129 PRICE price, int final)
4131 /* Haggle till done */
4134 /* Get a haggle (or cancel) */
4135 if (!get_haggle(pmt, poffer, price, final)) return (TRUE);
4137 /* Acceptable offer */
4138 if (((*poffer) * factor) >= (last_offer * factor)) break;
4140 /* Insult, and check for kicked out */
4141 if (haggle_insults()) return (TRUE);
4143 /* Reject offer (correctly) */
4144 (*poffer) = last_offer;
4153 * @brief プレイヤーが購入する時の値切り処理メインルーチン /
4154 * Haggling routine -RAK-
4155 * @param o_ptr オブジェクトの構造体参照ポインタ
4156 * @param price 最終価格を返す参照ポインタ
4157 * @return プレイヤーの価格に対して店主が不服ならばTRUEを返す /
4158 * Return TRUE if purchase is NOT successful
4160 static bool purchase_haggle(object_type *o_ptr, s32b *price)
4162 s32b cur_ask, final_ask;
4163 s32b last_offer, offer;
4165 s32b min_per, max_per;
4166 int flag, loop_flag, noneed;
4167 int annoyed = 0, final = FALSE;
4168 bool cancel = FALSE;
4172 concptr pmt = _("提示価格", "Asking");
4174 /* Extract the starting offer and the final offer */
4175 cur_ask = price_item(o_ptr, ot_ptr->max_inflate, FALSE);
4176 final_ask = price_item(o_ptr, ot_ptr->min_inflate, FALSE);
4178 /* Determine if haggling is necessary */
4179 noneed = noneedtobargain(final_ask);
4181 /* No need to haggle */
4182 if (noneed || !manual_haggle)
4184 /* No need to haggle */
4187 /* Message summary */
4188 msg_print(_("結局この金額にまとまった。", "You eventually agree upon the price."));
4192 /* No haggle option */
4195 /* Message summary */
4196 msg_print(_("すんなりとこの金額にまとまった。", "You quickly agree upon the price."));
4199 /* Apply Sales Tax */
4200 final_ask += final_ask / 10;
4204 cur_ask = final_ask;
4206 /* Go to final offer */
4207 pmt = _("最終提示価格", "Final Offer");
4212 /* Haggle for the whole pile */
4213 cur_ask *= o_ptr->number;
4214 final_ask *= o_ptr->number;
4217 /* Haggle parameters */
4218 min_per = ot_ptr->haggle_per;
4219 max_per = min_per * 3;
4221 /* Mega-Hack -- artificial "last offer" value */
4222 last_offer = object_value(o_ptr) * o_ptr->number;
4223 last_offer = last_offer * (200 - (int)(ot_ptr->max_inflate)) / 100L;
4224 if (last_offer <= 0) last_offer = 1;
4229 /* No incremental haggling yet */
4232 /* Haggle until done */
4233 for (flag = FALSE; !flag; )
4237 while (!flag && loop_flag)
4239 (void)sprintf(out_val, "%s : %ld", pmt, (long)cur_ask);
4240 put_str(out_val, 1, 0);
4241 cancel = receive_offer(_("提示する金額? ", "What do you offer? "), &offer, last_offer, 1, cur_ask, final);
4246 else if (offer > cur_ask)
4251 else if (offer == cur_ask)
4264 x1 = 100 * (offer - last_offer) / (cur_ask - last_offer);
4267 if (haggle_insults())
4273 else if (x1 > max_per)
4276 if (x1 < max_per) x1 = max_per;
4278 x2 = rand_range(x1-2, x1+2);
4279 x3 = ((cur_ask - offer) * x2 / 100L) + 1;
4280 /* don't let the price go up */
4285 if (cur_ask < final_ask)
4288 cur_ask = final_ask;
4289 pmt = _("最終提示価格", "What do you offer? ");
4293 (void)(increase_insults());
4298 else if (offer >= cur_ask)
4309 (void)sprintf(out_val, _("前回の提示金額: $%ld", "Your last offer: %ld"), (long)last_offer);
4310 put_str(out_val, 1, 39);
4311 say_comment_2(cur_ask, annoyed);
4316 if (cancel) return (TRUE);
4318 updatebargain(*price, final_ask, o_ptr->number);
4326 * @brief プレイヤーが売却する時の値切り処理メインルーチン /
4327 * Haggling routine -RAK-
4328 * @param o_ptr オブジェクトの構造体参照ポインタ
4329 * @param price 最終価格を返す参照ポインタ
4330 * @return プレイヤーの価格に対して店主が不服ならばTRUEを返す /
4331 * Return TRUE if purchase is NOT successful
4333 static bool sell_haggle(object_type *o_ptr, s32b *price)
4335 s32b purse, cur_ask, final_ask;
4336 s32b last_offer = 0, offer = 0;
4338 s32b min_per, max_per;
4339 int flag, loop_flag, noneed;
4340 int annoyed = 0, final = FALSE;
4341 bool cancel = FALSE;
4342 concptr pmt = _("提示金額", "Offer");
4348 /* Obtain the starting offer and the final offer */
4349 cur_ask = price_item(o_ptr, ot_ptr->max_inflate, TRUE);
4350 final_ask = price_item(o_ptr, ot_ptr->min_inflate, TRUE);
4352 /* Determine if haggling is necessary */
4353 noneed = noneedtobargain(final_ask);
4355 /* Get the owner's payout limit */
4356 purse = (s32b)(ot_ptr->max_cost);
4358 /* No need to haggle */
4359 if (noneed || !manual_haggle || (final_ask >= purse))
4361 /* Apply Sales Tax (if needed) */
4362 if (!manual_haggle && !noneed)
4364 final_ask -= final_ask / 10;
4367 /* No reason to haggle */
4368 if (final_ask >= purse)
4370 msg_print(_("即座にこの金額にまとまった。", "You instantly agree upon the price."));
4373 /* Offer full purse */
4377 /* No need to haggle */
4380 msg_print(_("結局この金額にまとまった。", "You eventually agree upon the price."));
4384 /* No haggle option */
4387 /* Message summary */
4388 msg_print(_("すんなりとこの金額にまとまった。", "You quickly agree upon the price."));
4393 cur_ask = final_ask;
4397 pmt = _("最終提示金額", "Final Offer");
4400 /* Haggle for the whole pile */
4401 cur_ask *= o_ptr->number;
4402 final_ask *= o_ptr->number;
4405 /* Display commands */
4407 /* Haggling parameters */
4408 min_per = ot_ptr->haggle_per;
4409 max_per = min_per * 3;
4411 /* Mega-Hack -- artificial "last offer" value */
4412 last_offer = object_value(o_ptr) * o_ptr->number;
4413 last_offer = last_offer * ot_ptr->max_inflate / 100L;
4418 /* No incremental haggling yet */
4422 for (flag = FALSE; !flag; )
4428 (void)sprintf(out_val, "%s : %ld", pmt, (long)cur_ask);
4429 put_str(out_val, 1, 0);
4430 cancel = receive_offer(_("提示する価格? ", "What price do you ask? "),
4431 &offer, last_offer, -1, cur_ask, final);
4437 else if (offer < cur_ask)
4440 /* rejected, reset offer for incremental haggling */
4443 else if (offer == cur_ask)
4454 if (flag || !loop_flag) break;
4459 x1 = 100 * (last_offer - offer) / (last_offer - cur_ask);
4462 if (haggle_insults())
4468 else if (x1 > max_per)
4471 if (x1 < max_per) x1 = max_per;
4473 x2 = rand_range(x1-2, x1+2);
4474 x3 = ((offer - cur_ask) * x2 / 100L) + 1;
4475 /* don't let the price go down */
4479 if (cur_ask > final_ask)
4481 cur_ask = final_ask;
4483 pmt = _("最終提示金額", "Final Offer");
4490 /* 追加 $0 で買い取られてしまうのを防止 By FIRST*/
4493 (void)(increase_insults());
4496 else if (offer <= cur_ask)
4507 (void)sprintf(out_val,
4508 _("前回の提示価格 $%ld", "Your last bid %ld"), (long)last_offer);
4509 put_str(out_val, 1, 39);
4510 say_comment_3(cur_ask, annoyed);
4515 if (cancel) return (TRUE);
4517 updatebargain(*price, final_ask, o_ptr->number);
4525 * @brief 店からの購入処理のメインルーチン /
4526 * Buy an item from a store -RAK-
4529 static void store_purchase(void)
4532 COMMAND_CODE item, item_new;
4543 GAME_TEXT o_name[MAX_NLEN];
4547 if (cur_store_num == STORE_MUSEUM)
4549 msg_print(_("博物館から取り出すことはできません。", "Museum."));
4554 if (st_ptr->stock_num <= 0)
4556 if (cur_store_num == STORE_HOME)
4557 msg_print(_("我が家には何も置いてありません。", "Your home is empty."));
4559 msg_print(_("現在商品の在庫を切らしています。", "I am currently out of stock."));
4563 /* Find the number of objects on this and following pages */
4564 i = (st_ptr->stock_num - store_top);
4566 /* And then restrict it to the current page */
4567 if (i > store_bottom) i = store_bottom;
4571 /* ブラックマーケットの時は別のメッセージ */
4572 switch( cur_store_num ) {
4574 sprintf(out_val, "どのアイテムを取りますか? ");
4577 sprintf(out_val, "どれ? ");
4580 sprintf(out_val, "どの品物が欲しいんだい? ");
4584 if (cur_store_num == STORE_HOME)
4586 sprintf(out_val, "Which item do you want to take? ");
4590 sprintf(out_val, "Which item are you interested in? ");
4595 /* Get the item number to be bought */
4596 if (!get_stock(&item, out_val, 0, i - 1)) return;
4598 /* Get the actual index */
4599 item = item + store_top;
4601 /* Get the actual item */
4602 o_ptr = &st_ptr->stock[item];
4604 /* Assume the player wants just one of them */
4608 /* Get a copy of the object */
4609 object_copy(j_ptr, o_ptr);
4612 * If a rod or wand, allocate total maximum timeouts or charges
4613 * between those purchased and left on the shelf.
4615 reduce_charges(j_ptr, o_ptr->number - amt);
4617 /* Modify quantity */
4618 j_ptr->number = amt;
4620 /* Hack -- require room in pack */
4621 if (!inven_carry_okay(j_ptr))
4623 msg_print(_("そんなにアイテムを持てない。", "You cannot carry that many different items."));
4627 /* Determine the "best" price (per item) */
4628 best = price_item(j_ptr, ot_ptr->min_inflate, FALSE);
4630 /* Find out how many the player wants */
4631 if (o_ptr->number > 1)
4633 /* Hack -- note cost of "fixed" items */
4634 if ((cur_store_num != STORE_HOME) &&
4635 (o_ptr->ident & IDENT_FIXED))
4637 msg_format(_("一つにつき $%ldです。", "That costs %ld gold per item."), (long)(best));
4639 amt = get_quantity(NULL, o_ptr->number);
4640 if (amt <= 0) return;
4644 /* Get desired object */
4645 object_copy(j_ptr, o_ptr);
4648 * If a rod or wand, allocate total maximum timeouts or charges
4649 * between those purchased and left on the shelf.
4651 reduce_charges(j_ptr, o_ptr->number - amt);
4653 /* Modify quantity */
4654 j_ptr->number = amt;
4656 /* Hack -- require room in pack */
4657 if (!inven_carry_okay(j_ptr))
4659 msg_print(_("ザックにそのアイテムを入れる隙間がない。", "You cannot carry that many items."));
4663 /* Attempt to buy it */
4664 if (cur_store_num != STORE_HOME)
4666 /* Fixed price, quick buy */
4667 if (o_ptr->ident & (IDENT_FIXED))
4672 /* Go directly to the "best" deal */
4673 price = (best * j_ptr->number);
4679 /* Describe the object (fully) */
4680 object_desc(o_name, j_ptr, 0);
4681 msg_format(_("%s(%c)を購入する。", "Buying %s (%c)."), o_name, I2A(item));
4684 /* Haggle for a final price */
4685 choice = purchase_haggle(j_ptr, &price);
4687 /* Hack -- Got kicked out */
4688 if (st_ptr->store_open >= current_world_ptr->game_turn) return;
4691 /* Player wants it */
4694 /* Fix the item price (if "correctly" haggled) */
4695 if (price == (best * j_ptr->number)) o_ptr->ident |= (IDENT_FIXED);
4697 /* Player can afford it */
4698 if (p_ptr->au >= price)
4703 if (cur_store_num == STORE_BLACK) /* The black market is illegal! */
4704 chg_virtue(V_JUSTICE, -1);
4705 if((o_ptr->tval == TV_BOTTLE) && (cur_store_num != STORE_HOME))
4706 chg_virtue(V_NATURE, -1);
4714 /* Spend the money */
4717 /* Update the display */
4720 /* Hack -- buying an item makes you aware of it */
4721 object_aware(j_ptr);
4723 /* Hack -- clear the "fixed" flag from the item */
4724 j_ptr->ident &= ~(IDENT_FIXED);
4726 /* Describe the transaction */
4727 object_desc(o_name, j_ptr, 0);
4729 msg_format(_("%sを $%ldで購入しました。", "You bought %s for %ld gold."), o_name, (long)price);
4731 strcpy(record_o_name, o_name);
4732 record_turn = current_world_ptr->game_turn;
4734 if (record_buy) do_cmd_write_nikki(NIKKI_BUY, 0, o_name);
4735 object_desc(o_name, o_ptr, OD_NAME_ONLY);
4736 if(record_rand_art && o_ptr->art_name)
4737 do_cmd_write_nikki(NIKKI_ART, 0, o_name);
4739 /* Erase the inscription */
4740 j_ptr->inscription = 0;
4742 /* Erase the "feeling" */
4743 j_ptr->feeling = FEEL_NONE;
4744 j_ptr->ident &= ~(IDENT_STORE);
4745 /* Give it to the player */
4746 item_new = inven_carry(j_ptr);
4748 /* Describe the final result */
4749 object_desc(o_name, &p_ptr->inventory_list[item_new], 0);
4750 msg_format(_("%s(%c)を手に入れた。", "You have %s (%c)."), o_name, index_to_label(item_new));
4752 /* Auto-inscription */
4753 autopick_alter_item(item_new, FALSE);
4755 /* Now, reduce the original stack's pval. */
4756 if ((o_ptr->tval == TV_ROD) || (o_ptr->tval == TV_WAND))
4758 o_ptr->pval -= j_ptr->pval;
4762 /* Note how many slots the store used to have */
4763 i = st_ptr->stock_num;
4765 /* Remove the bought items from the store */
4766 store_item_increase(item, -amt);
4767 store_item_optimize(item);
4769 /* Store is empty */
4770 if (st_ptr->stock_num == 0)
4773 if (one_in_(STORE_SHUFFLE))
4776 msg_print(_("店主は引退した。", "The shopkeeper retires."));
4778 /* Shuffle the store */
4779 store_shuffle(cur_store_num);
4782 sprintf(buf, "%s (%s)",
4783 ot_ptr->owner_name, race_info[ot_ptr->owner_race].title);
4784 put_str(buf, 3, 10);
4785 sprintf(buf, "%s (%ld)",
4786 (f_name + f_info[cur_store_feat].name), (long)(ot_ptr->max_cost));
4793 msg_print(_("店主は新たな在庫を取り出した。", "The shopkeeper brings out some new stock."));
4796 /* New p_ptr->inventory_list */
4797 for (i = 0; i < 10; i++)
4799 /* Maintain the store */
4800 store_maint(p_ptr->town_num, cur_store_num);
4805 display_inventory();
4808 /* The item is gone */
4809 else if (st_ptr->stock_num != i)
4811 /* Pick the correct screen */
4812 if (store_top >= st_ptr->stock_num) store_top -= store_bottom;
4813 display_inventory();
4816 /* Item is still here */
4819 /* Redraw the item */
4820 display_entry(item);
4824 /* Player cannot afford it */
4827 /* Simple message (no insult) */
4828 msg_print(_("お金が足りません。", "You do not have enough gold."));
4833 /* Home is much easier */
4836 bool combined_or_reordered;
4838 /* Distribute charges of wands/rods */
4839 distribute_charges(o_ptr, j_ptr, amt);
4841 /* Give it to the player */
4842 item_new = inven_carry(j_ptr);
4844 /* Describe just the result */
4845 object_desc(o_name, &p_ptr->inventory_list[item_new], 0);
4847 msg_format(_("%s(%c)を取った。", "You have %s (%c)."), o_name, index_to_label(item_new));
4850 /* Take note if we take the last one */
4851 i = st_ptr->stock_num;
4853 /* Remove the items from the home */
4854 store_item_increase(item, -amt);
4855 store_item_optimize(item);
4857 combined_or_reordered = combine_and_reorder_home(STORE_HOME);
4859 /* Hack -- Item is still here */
4860 if (i == st_ptr->stock_num)
4862 if (combined_or_reordered) display_inventory();
4864 /* Redraw the item */
4865 else display_entry(item);
4868 /* The item is gone */
4872 if (st_ptr->stock_num == 0) store_top = 0;
4874 /* Nothing left on that screen */
4875 else if (store_top >= st_ptr->stock_num) store_top -= store_bottom;
4876 display_inventory();
4878 chg_virtue(V_SACRIFICE, 1);
4882 /* Not kicked out */
4888 * @brief 店からの売却処理のメインルーチン /
4889 * Sell an item to the store (or home)
4892 static void store_sell(void)
4899 PRICE price, value, dummy;
4907 GAME_TEXT o_name[MAX_NLEN];
4910 /* Prepare a prompt */
4911 if (cur_store_num == STORE_HOME)
4912 q = _("どのアイテムを置きますか? ", "Drop which item? ");
4914 else if (cur_store_num == STORE_MUSEUM)
4915 q = _("どのアイテムを寄贈しますか? ", "Give which item? ");
4918 q = _("どのアイテムを売りますか? ", "Sell which item? ");
4920 /* Only allow items the store will buy */
4921 item_tester_hook = store_will_buy;
4923 /* 我が家でおかしなメッセージが出るオリジナルのバグを修正 */
4924 if (cur_store_num == STORE_HOME)
4926 s = _("置けるアイテムを持っていません。", "You don't have any item to drop.");
4928 else if (cur_store_num == STORE_MUSEUM)
4930 s = _("寄贈できるアイテムを持っていません。", "You don't have any item to give.");
4934 s = _("欲しい物がないですねえ。", "You have nothing that I want.");
4937 o_ptr = choose_object(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT));
4940 /* Hack -- Cannot remove cursed items */
4941 if ((item >= INVEN_RARM) && object_is_cursed(o_ptr))
4943 msg_print(_("ふーむ、どうやらそれは呪われているようだね。", "Hmmm, it seems to be cursed."));
4947 /* Assume one item */
4950 if (o_ptr->number > 1)
4952 amt = get_quantity(NULL, o_ptr->number);
4953 if (amt <= 0) return;
4957 /* Get a copy of the object */
4958 object_copy(q_ptr, o_ptr);
4960 /* Modify quantity */
4961 q_ptr->number = amt;
4964 * Hack -- If a rod or wand, allocate total maximum
4965 * timeouts or charges to those being sold. -LM-
4967 if ((o_ptr->tval == TV_ROD) || (o_ptr->tval == TV_WAND))
4969 q_ptr->pval = o_ptr->pval * amt / o_ptr->number;
4972 /* Get a full description */
4973 object_desc(o_name, q_ptr, 0);
4975 /* Remove any inscription, feeling for stores */
4976 if ((cur_store_num != STORE_HOME) && (cur_store_num != STORE_MUSEUM))
4978 q_ptr->inscription = 0;
4979 q_ptr->feeling = FEEL_NONE;
4982 /* Is there room in the store (or the home?) */
4983 if (!store_check_num(q_ptr))
4985 if (cur_store_num == STORE_HOME)
4986 msg_print(_("我が家にはもう置く場所がない。", "Your home is full."));
4988 else if (cur_store_num == STORE_MUSEUM)
4989 msg_print(_("博物館はもう満杯だ。", "Museum is full."));
4992 msg_print(_("すいませんが、店にはもう置く場所がありません。", "I have not the room in my store to keep it."));
4999 if ((cur_store_num != STORE_HOME) && (cur_store_num != STORE_MUSEUM))
5001 /* Describe the transaction */
5002 msg_format(_("%s(%c)を売却する。", "Selling %s (%c)."), o_name, index_to_label(item));
5007 choice = sell_haggle(q_ptr, &price);
5010 if (st_ptr->store_open >= current_world_ptr->game_turn) return;
5022 if (cur_store_num == STORE_BLACK) /* The black market is illegal! */
5023 chg_virtue(V_JUSTICE, -1);
5025 if((o_ptr->tval == TV_BOTTLE) && (cur_store_num != STORE_HOME))
5026 chg_virtue(V_NATURE, 1);
5029 /* Get some money */
5032 /* Update the display */
5035 /* Get the "apparent" value */
5036 dummy = object_value(q_ptr) * q_ptr->number;
5038 identify_item(o_ptr);
5041 /* Get a copy of the object */
5042 object_copy(q_ptr, o_ptr);
5044 /* Modify quantity */
5045 q_ptr->number = amt;
5047 /* Make it look like to be known */
5048 q_ptr->ident |= IDENT_STORE;
5051 * Hack -- If a rod or wand, let the shopkeeper know just
5052 * how many charges he really paid for. -LM-
5054 if ((o_ptr->tval == TV_ROD) || (o_ptr->tval == TV_WAND))
5056 q_ptr->pval = o_ptr->pval * amt / o_ptr->number;
5059 /* Get the "actual" value */
5060 value = object_value(q_ptr) * q_ptr->number;
5062 /* Get the description all over again */
5063 object_desc(o_name, q_ptr, 0);
5065 /* Describe the result (in message buffer) */
5066 msg_format(_("%sを $%ldで売却しました。", "You sold %s for %ld gold."), o_name, (long)price);
5068 if (record_sell) do_cmd_write_nikki(NIKKI_SELL, 0, o_name);
5070 if (!((o_ptr->tval == TV_FIGURINE) && (value > 0)))
5072 /* Analyze the prices (and comment verbally) unless a figurine*/
5073 purchase_analyze(price, value, dummy);
5077 * Hack -- Allocate charges between those wands or rods sold
5078 * and retained, unless all are being sold. -LM-
5080 distribute_charges(o_ptr, q_ptr, amt);
5082 /* Reset timeouts of the sold items */
5085 /* Take the item from the player, describe the result */
5086 inven_item_increase(item, -amt);
5087 inven_item_describe(item);
5089 /* If items remain, auto-inscribe before optimizing */
5090 if (o_ptr->number > 0)
5091 autopick_alter_item(item, FALSE);
5093 inven_item_optimize(item);
5096 /* The store gets that (known) item */
5097 item_pos = store_carry(q_ptr);
5099 /* Re-display if item is now in store */
5102 store_top = (item_pos / store_bottom) * store_bottom;
5103 display_inventory();
5108 /* Player is at museum */
5109 else if (cur_store_num == STORE_MUSEUM)
5111 char o2_name[MAX_NLEN];
5112 object_desc(o2_name, q_ptr, OD_NAME_ONLY);
5114 if (-1 == store_check_num(q_ptr))
5116 msg_print(_("それと同じ品物は既に博物館にあるようです。", "The same object as it is already in the Museum."));
5120 msg_print(_("博物館に寄贈したものは取り出すことができません!!", "You cannot take items which is given to the Museum back!!"));
5123 if (!get_check(format(_("本当に%sを寄贈しますか?", "Really give %s to the Museum? "), o2_name))) return;
5125 identify_item(q_ptr);
5126 q_ptr->ident |= IDENT_MENTAL;
5128 /* Distribute charges of wands/rods */
5129 distribute_charges(o_ptr, q_ptr, amt);
5130 msg_format(_("%sを置いた。(%c)", "You drop %s (%c)."), o_name, index_to_label(item));
5133 /* Take it from the players p_ptr->inventory_list */
5134 inven_item_increase(item, -amt);
5135 inven_item_describe(item);
5136 inven_item_optimize(item);
5139 /* Let the home carry it */
5140 item_pos = home_carry(q_ptr);
5142 /* Update store display */
5145 store_top = (item_pos / store_bottom) * store_bottom;
5146 display_inventory();
5149 /* Player is at home */
5152 /* Distribute charges of wands/rods */
5153 distribute_charges(o_ptr, q_ptr, amt);
5154 msg_format(_("%sを置いた。(%c)", "You drop %s (%c)."), o_name, index_to_label(item));
5158 /* Take it from the players p_ptr->inventory_list */
5159 inven_item_increase(item, -amt);
5160 inven_item_describe(item);
5161 inven_item_optimize(item);
5164 /* Let the home carry it */
5165 item_pos = home_carry(q_ptr);
5167 /* Update store display */
5170 store_top = (item_pos / store_bottom) * store_bottom;
5171 display_inventory();
5175 if ((choice == 0) && (item >= INVEN_RARM))
5184 * @brief 店のアイテムを調べるコマンドのメインルーチン /
5185 * Examine an item in a store -JDL-
5188 static void store_examine(void)
5193 GAME_TEXT o_name[MAX_NLEN];
5197 if (st_ptr->stock_num <= 0)
5199 if (cur_store_num == STORE_HOME)
5200 msg_print(_("我が家には何も置いてありません。", "Your home is empty."));
5201 else if (cur_store_num == STORE_MUSEUM)
5202 msg_print(_("博物館には何も置いてありません。", "Museum is empty."));
5204 msg_print(_("現在商品の在庫を切らしています。", "I am currently out of stock."));
5208 /* Find the number of objects on this and following pages */
5209 i = (st_ptr->stock_num - store_top);
5211 /* And then restrict it to the current page */
5212 if (i > store_bottom) i = store_bottom;
5215 sprintf(out_val, _("どれを調べますか?", "Which item do you want to examine? "));
5217 /* Get the item number to be examined */
5218 if (!get_stock(&item, out_val, 0, i - 1)) return;
5220 /* Get the actual index */
5221 item = item + store_top;
5223 /* Get the actual item */
5224 o_ptr = &st_ptr->stock[item];
5226 /* Require full knowledge */
5227 if (!(o_ptr->ident & IDENT_MENTAL))
5229 /* This can only happen in the home */
5230 msg_print(_("このアイテムについて特に知っていることはない。", "You have no special knowledge about that item."));
5234 object_desc(o_name, o_ptr, 0);
5235 msg_format(_("%sを調べている...", "Examining %s..."), o_name);
5237 if (!screen_object(o_ptr, SCROBJ_FORCE_DETAIL))
5238 msg_print(_("特に変わったところはないようだ。", "You see nothing special."));
5245 * @brief 博物館のアイテムを除去するコマンドのメインルーチン /
5246 * Remove an item from museum (Originally from TOband)
5249 static void museum_remove_object(void)
5254 GAME_TEXT o_name[MAX_NLEN];
5258 if (st_ptr->stock_num <= 0)
5260 msg_print(_("博物館には何も置いてありません。", "Museum is empty."));
5264 /* Find the number of objects on this and following pages */
5265 i = st_ptr->stock_num - store_top;
5267 /* And then restrict it to the current page */
5268 if (i > store_bottom) i = store_bottom;
5271 sprintf(out_val, _("どのアイテムの展示をやめさせますか?", "Which item do you want to order to remove? "));
5273 /* Get the item number to be removed */
5274 if (!get_stock(&item, out_val, 0, i - 1)) return;
5276 /* Get the actual index */
5277 item = item + store_top;
5279 /* Get the actual item */
5280 o_ptr = &st_ptr->stock[item];
5282 object_desc(o_name, o_ptr, 0);
5284 msg_print(_("展示をやめさせたアイテムは二度と見ることはできません!", "You cannot see items which is removed from the Museum!"));
5285 if (!get_check(format(_("本当に%sの展示をやめさせますか?", "Really order to remove %s from the Museum? "), o_name))) return;
5287 msg_format(_("%sの展示をやめさせた。", "You ordered to remove %s."), o_name);
5289 /* Remove the items from the home */
5290 store_item_increase(item, -o_ptr->number);
5291 store_item_optimize(item);
5293 (void)combine_and_reorder_home(STORE_MUSEUM);
5295 /* The item is gone */
5298 if (st_ptr->stock_num == 0) store_top = 0;
5300 /* Nothing left on that screen */
5301 else if (store_top >= st_ptr->stock_num) store_top -= store_bottom;
5302 display_inventory();
5309 * Hack -- set this to leave the store
5311 static bool leave_store = FALSE;
5315 * @brief 店舗処理コマンド選択のメインルーチン /
5316 * Process a command in a store
5320 * Note that we must allow the use of a few "special" commands
5321 * in the stores which are not allowed in the dungeon, and we
5322 * must disable some commands which are allowed in the dungeon
5323 * but not in the stores, to prevent chaos.
5326 static void store_process_command(void)
5328 /* Handle repeating the last command */
5331 if (rogue_like_commands && command_cmd == 'l')
5333 command_cmd = 'x'; /* hack! */
5336 /* Parse the command */
5337 switch (command_cmd)
5347 /* 1 ページ戻るコマンド: 我が家のページ数が多いので重宝するはず By BUG */
5350 if (st_ptr->stock_num <= store_bottom) {
5351 msg_print(_("これで全部です。", "Entire p_ptr->inventory_list is shown."));
5354 store_top -= store_bottom;
5355 if ( store_top < 0 )
5356 store_top = ((st_ptr->stock_num - 1 )/store_bottom) * store_bottom;
5357 if ( (cur_store_num == STORE_HOME) && (powerup_home == FALSE) )
5358 if ( store_top >= store_bottom ) store_top = store_bottom;
5359 display_inventory();
5367 if (st_ptr->stock_num <= store_bottom)
5369 msg_print(_("これで全部です。", "Entire p_ptr->inventory_list is shown."));
5373 store_top += store_bottom;
5375 * 隠しオプション(powerup_home)がセットされていないときは
5376 * 我が家では 2 ページまでしか表示しない
5378 if ((cur_store_num == STORE_HOME) &&
5379 (powerup_home == FALSE) &&
5380 (st_ptr->stock_num >= STORE_INVEN_MAX))
5382 if (store_top >= (STORE_INVEN_MAX - 1))
5389 if (store_top >= st_ptr->stock_num) store_top = 0;
5392 display_inventory();
5404 /* Get (purchase) */
5431 /*** Inventory Commands ***/
5433 /* Wear/wield equipment */
5440 /* Take off equipment */
5447 /* Destroy an item */
5454 /* Equipment list */
5461 /* Inventory list */
5469 /*** Various commands ***/
5471 /* Identify an object */
5478 /* Hack -- toggle windows */
5481 toggle_inven_equip();
5485 /*** Use various objects ***/
5490 if ( (p_ptr->pclass == CLASS_MINDCRAFTER) ||
5491 (p_ptr->pclass == CLASS_BERSERKER) ||
5492 (p_ptr->pclass == CLASS_NINJA) ||
5493 (p_ptr->pclass == CLASS_MIRROR_MASTER)
5494 ) do_cmd_mind_browse();
5495 else if (p_ptr->pclass == CLASS_SMITH)
5497 else if (p_ptr->pclass == CLASS_MAGIC_EATER)
5498 do_cmd_magic_eater(TRUE, FALSE);
5499 else if (p_ptr->pclass == CLASS_SNIPER)
5500 do_cmd_snipe_browse();
5501 else do_cmd_browse();
5505 /* Inscribe an object */
5512 /* Uninscribe an object */
5515 do_cmd_uninscribe();
5521 /*** Help and Such ***/
5530 /* Identify symbol */
5533 do_cmd_query_symbol();
5537 /* Character description */
5540 p_ptr->town_num = old_town_num;
5541 do_cmd_change_name();
5542 p_ptr->town_num = inner_town_num;
5548 /*** System Commands ***/
5550 /* Hack -- User interface */
5557 /* Single line from a pref file */
5560 p_ptr->town_num = old_town_num;
5562 p_ptr->town_num = inner_town_num;
5566 /* Interact with macros */
5569 p_ptr->town_num = old_town_num;
5571 p_ptr->town_num = inner_town_num;
5575 /* Interact with visuals */
5578 p_ptr->town_num = old_town_num;
5580 p_ptr->town_num = inner_town_num;
5584 /* Interact with colors */
5587 p_ptr->town_num = old_town_num;
5589 p_ptr->town_num = inner_town_num;
5593 /* Interact with options */
5597 (void)combine_and_reorder_home(STORE_HOME);
5603 /*** Misc Commands ***/
5619 /* Repeat level feeling */
5626 /* Show previous message */
5629 do_cmd_message_one();
5633 /* Show previous messages */
5646 /* Check artifacts, uniques etc. */
5653 /* Load "screen dump" */
5656 do_cmd_load_screen();
5660 /* Save "screen dump" */
5663 do_cmd_save_screen();
5667 /* Hack -- Unknown command */
5670 if ((cur_store_num == STORE_MUSEUM) && (command_cmd == 'r'))
5672 museum_remove_object();
5676 msg_print(_("そのコマンドは店の中では使えません。", "That command does not work in stores."));
5685 * @brief 店舗処理全体のメインルーチン /
5686 * Enter a store, and interact with it. *
5690 * Note that we use the standard "request_command()" function
5691 * to get a command, allowing us to use "command_arg" and all
5692 * command macros and other nifty stuff, but we use the special
5693 * "shopping" argument, to force certain commands to be converted
5694 * into other commands, normally, we convert "p" (pray) and "m"
5695 * (cast magic) into "g" (get), and "s" (search) into "d" (drop).
5698 void do_cmd_store(void)
5704 bool need_redraw_store_inv; /* To redraw missiles damage and prices in store */
5707 if(p_ptr->wild_mode) return;
5708 Term_get_size(&w, &h);
5710 /* Calculate stocks per 1 page */
5711 xtra_stock = MIN(14+26, ((h > 24) ? (h - 24) : 0));
5712 store_bottom = MIN_STOCK + xtra_stock;
5714 /* Access the player grid */
5715 g_ptr = ¤t_floor_ptr->grid_array[p_ptr->y][p_ptr->x];
5717 /* Verify a store */
5718 if (!cave_have_flag_grid(g_ptr, FF_STORE))
5720 msg_print(_("ここには店がありません。", "You see no store here."));
5724 /* Extract the store code */
5725 which = f_info[g_ptr->feat].subtype;
5727 old_town_num = p_ptr->town_num;
5728 if ((which == STORE_HOME) || (which == STORE_MUSEUM)) p_ptr->town_num = 1;
5729 if (current_floor_ptr->dun_level) p_ptr->town_num = NO_TOWN;
5730 inner_town_num = p_ptr->town_num;
5732 /* Hack -- Check the "locked doors" */
5733 if ((town_info[p_ptr->town_num].store[which].store_open >= current_world_ptr->game_turn) ||
5736 msg_print(_("ドアに鍵がかかっている。", "The doors are locked."));
5737 p_ptr->town_num = old_town_num;
5741 /* Calculate the number of store maintainances since the last visit */
5742 maintain_num = (current_world_ptr->game_turn - town_info[p_ptr->town_num].store[which].last_visit) / (TURNS_PER_TICK * STORE_TICKS);
5744 /* Maintain the store max. 10 times */
5745 if (maintain_num > 10) maintain_num = 10;
5749 /* Maintain the store */
5750 for (i = 0; i < maintain_num; i++)
5751 store_maint(p_ptr->town_num, which);
5753 /* Save the visit */
5754 town_info[p_ptr->town_num].store[which].last_visit = current_world_ptr->game_turn;
5760 /* Hack -- Character is in "icky" mode */
5761 character_icky = TRUE;
5768 /* Do not expand macros */
5769 get_com_no_macros = TRUE;
5771 /* Save the store number */
5772 cur_store_num = which;
5774 /* Hack -- save the store feature */
5775 cur_store_feat = g_ptr->feat;
5777 /* Save the store and owner pointers */
5778 st_ptr = &town_info[p_ptr->town_num].store[cur_store_num];
5779 ot_ptr = &owners[cur_store_num][st_ptr->owner];
5781 /* Start at the beginning */
5784 play_music(TERM_XTRA_MUSIC_BASIC, MUSIC_BASIC_BUILD);
5789 leave_store = FALSE;
5791 /* Interact with player */
5792 while (!leave_store)
5794 /* Hack -- Clear line 1 */
5798 clear_from(20 + xtra_stock);
5800 /* Basic commands */
5801 prt(_(" ESC) 建物から出る", " ESC) Exit from Building."), 21 + xtra_stock, 0);
5803 /* Browse if necessary */
5804 if (st_ptr->stock_num > store_bottom)
5806 prt(_(" -)前ページ", " -) Previous page"), 22 + xtra_stock, 0);
5807 prt(_(" スペース) 次ページ", " SPACE) Next page"), 23 + xtra_stock, 0);
5811 if (cur_store_num == STORE_HOME)
5813 prt(_("g) アイテムを取る", "g) Get an item."), 21 + xtra_stock, 27);
5814 prt(_("d) アイテムを置く", "d) Drop an item."), 22 + xtra_stock, 27);
5815 prt(_("x) 家のアイテムを調べる", "x) eXamine an item in the home."), 23 + xtra_stock, 27);
5818 /* Museum commands */
5819 else if (cur_store_num == STORE_MUSEUM)
5821 prt(_("d) アイテムを置く", "d) Drop an item."), 21 + xtra_stock, 27);
5822 prt(_("r) アイテムの展示をやめる", "r) order to Remove an item."), 22 + xtra_stock, 27);
5823 prt(_("x) 博物館のアイテムを調べる", "x) eXamine an item in the museum."), 23 + xtra_stock, 27);
5829 prt(_("p) 商品を買う", "p) Purchase an item."), 21 + xtra_stock, 30);
5830 prt(_("s) アイテムを売る", "s) Sell an item."), 22 + xtra_stock, 30);
5831 prt(_("x) 商品を調べる", "x) eXamine an item in the shop"), 23 + xtra_stock,30);
5835 prt(_("i/e) 持ち物/装備の一覧", "i/e) Inventry/Equipment list"), 21 + xtra_stock, 56);
5837 if (rogue_like_commands)
5839 prt(_("w/T) 装備する/はずす", "w/T) Wear/Take off equipment"), 22 + xtra_stock, 56);
5843 prt(_("w/t) 装備する/はずす", "w/t) Wear/Take off equipment"), 22 + xtra_stock, 56);
5847 prt(_("コマンド:", "You may: "), 20 + xtra_stock, 0);
5849 request_command(TRUE);
5851 /* Process the command */
5852 store_process_command();
5855 * Hack -- To redraw missiles damage and prices in store
5856 * If player's charisma changes, or if player changes a bow, PU_BONUS is set
5858 need_redraw_store_inv = (p_ptr->update & PU_BONUS) ? TRUE : FALSE;
5860 /* Hack -- Character is still in "icky" mode */
5861 character_icky = TRUE;
5866 if (p_ptr->inventory_list[INVEN_PACK].k_idx)
5868 INVENTORY_IDX item = INVEN_PACK;
5870 object_type *o_ptr = &p_ptr->inventory_list[item];
5872 /* Hack -- Flee from the store */
5873 if (cur_store_num != STORE_HOME)
5875 if (cur_store_num == STORE_MUSEUM)
5876 msg_print(_("ザックからアイテムがあふれそうなので、あわてて博物館から出た...", "Your pack is so full that you flee the Museum..."));
5878 msg_print(_("ザックからアイテムがあふれそうなので、あわてて店から出た...", "Your pack is so full that you flee the store..."));
5884 /* Hack -- Flee from the home */
5885 else if (!store_check_num(o_ptr))
5887 msg_print(_("ザックからアイテムがあふれそうなので、あわてて家から出た...", "Your pack is so full that you flee your home..."));
5892 /* Hack -- Drop items into the home */
5900 GAME_TEXT o_name[MAX_NLEN];
5902 /* Give a message */
5903 msg_print(_("ザックからアイテムがあふれてしまった!", "Your pack overflows!"));
5907 object_copy(q_ptr, o_ptr);
5908 object_desc(o_name, q_ptr, 0);
5910 msg_format(_("%sが落ちた。(%c)", "You drop %s (%c)."), o_name, index_to_label(item));
5912 /* Remove it from the players p_ptr->inventory_list */
5913 inven_item_increase(item, -255);
5914 inven_item_describe(item);
5915 inven_item_optimize(item);
5918 /* Let the home carry it */
5919 item_pos = home_carry(q_ptr);
5921 /* Redraw the home */
5924 store_top = (item_pos / store_bottom) * store_bottom;
5925 display_inventory();
5930 /* Hack -- Redisplay store prices if charisma changes */
5931 /* Hack -- Redraw missiles damage if player changes bow */
5932 if (need_redraw_store_inv) display_inventory();
5934 /* Hack -- get kicked out of the store */
5935 if (st_ptr->store_open >= current_world_ptr->game_turn) leave_store = TRUE;
5938 select_floor_music();
5940 p_ptr->town_num = old_town_num;
5942 take_turn(p_ptr, 100);
5944 /* Hack -- Character is no longer in "icky" mode */
5945 character_icky = FALSE;
5947 /* Hack -- Cancel automatic command */
5950 /* Hack -- Cancel "see" mode */
5951 command_see = FALSE;
5953 /* Allow expanding macros */
5954 get_com_no_macros = FALSE;
5959 /* Update everything */
5960 p_ptr->update |= (PU_VIEW | PU_LITE | PU_MON_LITE);
5961 p_ptr->update |= (PU_MONSTERS);
5963 /* Redraw entire screen */
5964 p_ptr->redraw |= (PR_BASIC | PR_EXTRA | PR_EQUIPPY);
5965 p_ptr->redraw |= (PR_MAP);
5966 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
5972 * @brief 現在の町の店主を交代させる /
5973 * Shuffle one of the stores.
5974 * @param which 店舗種類のID
5977 void store_shuffle(int which)
5983 if (which == STORE_HOME) return;
5984 if (which == STORE_MUSEUM) return;
5987 /* Save the store index */
5988 cur_store_num = which;
5990 /* Activate that store */
5991 st_ptr = &town_info[p_ptr->town_num].store[cur_store_num];
5994 /* Pick a new owner */
5997 st_ptr->owner = (byte)randint0(MAX_OWNERS);
5998 if (j == st_ptr->owner) continue;
5999 for (i = 1;i < max_towns; i++)
6001 if (i == p_ptr->town_num) continue;
6002 if (st_ptr->owner == town_info[i].store[cur_store_num].owner) break;
6004 if (i == max_towns) break;
6007 /* Activate the new owner */
6008 ot_ptr = &owners[cur_store_num][st_ptr->owner];
6011 /* Reset the owner data */
6012 st_ptr->insult_cur = 0;
6013 st_ptr->store_open = 0;
6014 st_ptr->good_buy = 0;
6015 st_ptr->bad_buy = 0;
6018 /* Hack -- discount all the items */
6019 for (i = 0; i < st_ptr->stock_num; i++)
6023 o_ptr = &st_ptr->stock[i];
6025 if (!object_is_artifact(o_ptr))
6027 /* Hack -- Sell all non-artifact old items for "half price" */
6028 o_ptr->discount = 50;
6030 /* Hack -- Items are no longer "fixed price" */
6031 o_ptr->ident &= ~(IDENT_FIXED);
6033 /* Mega-Hack -- Note that the item is "on sale" */
6034 o_ptr->inscription = quark_add(_("売出中", "on sale"));
6041 * @brief 店の品揃えを変化させる /
6042 * Maintain the p_ptr->inventory_list at the stores.
6043 * @param town_num 町のID
6044 * @param store_num 店舗種類のID
6047 void store_maint(int town_num, int store_num)
6051 cur_store_num = store_num;
6054 if (store_num == STORE_HOME) return;
6055 if (store_num == STORE_MUSEUM) return;
6057 /* Activate that store */
6058 st_ptr = &town_info[town_num].store[store_num];
6060 /* Activate the owner */
6061 ot_ptr = &owners[store_num][st_ptr->owner];
6063 /* Store keeper forgives the player */
6064 st_ptr->insult_cur = 0;
6066 /* Mega-Hack -- prune the black market */
6067 if (store_num == STORE_BLACK)
6069 /* Destroy crappy black market items */
6070 for (j = st_ptr->stock_num - 1; j >= 0; j--)
6072 object_type *o_ptr = &st_ptr->stock[j];
6074 /* Destroy crappy items */
6075 if (black_market_crap(o_ptr))
6077 /* Destroy the item */
6078 store_item_increase(j, 0 - o_ptr->number);
6079 store_item_optimize(j);
6085 /* Choose the number of slots to keep */
6086 j = st_ptr->stock_num;
6088 /* Sell a few items */
6089 j = j - randint1(STORE_TURNOVER);
6091 /* Never keep more than "STORE_MAX_KEEP" slots */
6092 if (j > STORE_MAX_KEEP) j = STORE_MAX_KEEP;
6094 /* Always "keep" at least "STORE_MIN_KEEP" items */
6095 if (j < STORE_MIN_KEEP) j = STORE_MIN_KEEP;
6097 /* Hack -- prevent "underflow" */
6100 /* Destroy objects until only "j" slots are left */
6101 while (st_ptr->stock_num > j) store_delete();
6104 /* Choose the number of slots to fill */
6105 j = st_ptr->stock_num;
6107 /* Buy some more items */
6108 j = j + randint1(STORE_TURNOVER);
6110 /* Never keep more than "STORE_MAX_KEEP" slots */
6111 if (j > STORE_MAX_KEEP) j = STORE_MAX_KEEP;
6113 /* Always "keep" at least "STORE_MIN_KEEP" items */
6114 if (j < STORE_MIN_KEEP) j = STORE_MIN_KEEP;
6116 /* Hack -- prevent "overflow" */
6117 if (j >= st_ptr->stock_size) j = st_ptr->stock_size - 1;
6119 /* Acquire some new items */
6120 while (st_ptr->stock_num < j) store_create();
6125 * @brief 店舗情報を初期化する /
6126 * Initialize the stores
6127 * @param town_num 町のID
6128 * @param store_num 店舗種類のID
6131 void store_init(int town_num, int store_num)
6134 cur_store_num = store_num;
6136 /* Activate that store */
6137 st_ptr = &town_info[town_num].store[store_num];
6145 st_ptr->owner = (byte)randint0(MAX_OWNERS);
6146 for (i = 1;i < max_towns; i++)
6148 if (i == town_num) continue;
6149 if (st_ptr->owner == town_info[i].store[store_num].owner) break;
6151 if (i == max_towns) break;
6154 /* Activate the new owner */
6155 ot_ptr = &owners[store_num][st_ptr->owner];
6158 /* Initialize the store */
6159 st_ptr->store_open = 0;
6160 st_ptr->insult_cur = 0;
6161 st_ptr->good_buy = 0;
6162 st_ptr->bad_buy = 0;
6164 /* Nothing in stock */
6165 st_ptr->stock_num = 0;
6168 * MEGA-HACK - Last visit to store is
6169 * BEFORE player birth to enable store restocking
6171 st_ptr->last_visit = -10L * TURNS_PER_TICK * STORE_TICKS;
6173 /* Clear any old items */
6174 for (k = 0; k < st_ptr->stock_size; k++)
6176 object_wipe(&st_ptr->stock[k]);
6182 * @brief アイテムを町のブラックマーケットに移動させる /
6183 * @param o_ptr 移動させたいオブジェクトの構造体参照ポインタ
6186 void move_to_black_market(object_type *o_ptr)
6189 if (!p_ptr->town_num) return;
6191 st_ptr = &town_info[p_ptr->town_num].store[STORE_BLACK];
6193 o_ptr->ident |= IDENT_STORE;
6195 (void)store_carry(o_ptr);
6197 object_wipe(o_ptr); /* Don't leave a bogus object behind... */