3 * @brief 店の処理 / Store commands
6 * Copyright (c) 1989 James E. Wilson, Robert A. Koeneke\n
7 * This software may be copied and distributed for educational, research, and\n
8 * not for profit purposes provided that this copyright and statement are\n
9 * included in all such copies.\n
10 * 2014 Deskull rearranged comment for Doxygen.
19 #include "cmd-smith.h"
20 #include "cmd-zapwand.h"
21 #include "cmd-magiceat.h"
25 #include "cmd-spell.h"
27 #include "player-status.h"
28 #include "object-flavor.h"
29 #include "object-hook.h"
30 #include "floor-events.h"
33 #include "player-effects.h"
34 #include "player-race.h"
37 #include "objectkind.h"
39 #include "floor-town.h"
44 * @brief 闘技場のモンスターID及び報酬アイテムテーブル /
45 * Store owners (exactly four "possible" owners per store, chosen randomly)
48 * { name, purse, max greed, min greed, haggle_per, tolerance, race, unused }
50 * Lifted extra shopkeepers from CthAngband (don't you just love open source
51 * development? ;-)). Since this gave less than 32 unique names for some
52 * shops, those have their first x names copied to reach 32.
54 * For the weapon and armour shops, several owners have a limit of 5k.
56 * I want to do 50k owners, but the purse is currently s16b. Perhaps
57 * we should just store 1/10th of the purse?
60 const owner_type owners[MAX_STORES][MAX_OWNERS] =
63 /* General store - 32 unique names */
65 Raistlin は dragonlance の powerful wizard 。
66 Rincewind the Chicken は Terry Pratchett の Discworld の登場人物 上記のパロディ?、
67 { "憶病者ラストリン", 200, 175, 108, 4, 12, RACE_HUMAN},
68 { "Raistlin the Chicken", 200, 175, 108, 4, 12, RACE_HUMAN},
72 { "フレンドリーなビルボ", 200, 170, 108, 5, 15, RACE_HOBBIT},
73 { "憶病者リンスウィンド", 200, 175, 108, 4, 12, RACE_HUMAN},
74 { "背の低いサルタン", 300, 170, 107, 5, 15, RACE_GNOME},
75 { "ハンサムなライア=エル", 300, 165, 107, 6, 18, RACE_ELF},
76 { "親切なファリルマウエン", 250, 170, 108, 5, 15, RACE_HOBBIT},
77 { "臆病者ヴォワラン", 500, 175, 108, 4, 12, RACE_HUMAN},
78 { "チビのエラシュナク", 750, 170, 107, 5, 15, RACE_BEASTMAN},
79 { "ハンサムなグラッグ", 1000, 165, 107, 6, 18, RACE_HALF_TITAN},
80 { "ケチなフォロビア", 250, 170, 108, 5, 15, RACE_HUMAN},
81 { "馬鹿のエリス", 500, 175, 108, 4, 12, RACE_HUMAN},
82 { "腹ペコのフィルバート", 750, 170, 107, 5, 15, RACE_VAMPIRE},
83 { "スナーグル・サシグア", 1000, 165, 107, 6, 18, RACE_MIND_FLAYER},
84 { "長死きエロワーズ", 250, 170, 108, 5, 15, RACE_SPECTRE},
85 { "ノロマのフンディ", 500, 175, 108, 4, 12, RACE_ZOMBIE},
86 { "グランサス", 750, 170, 107, 5, 15, RACE_SKELETON},
87 { "丁寧なロラックス", 1000, 165, 107, 6, 18, RACE_VAMPIRE},
88 { "ブッチ", 250, 170, 108, 5, 15, RACE_HALF_ORC},
89 { "美しきエルベレス", 500, 175, 108, 4, 12, RACE_HIGH_ELF},
90 { "こそこそサーレス", 750, 170, 107, 5, 15, RACE_GNOME},
91 { "ナーロック", 1000, 165, 107, 6, 18, RACE_DWARF},
92 { "チビのヘイネッカ", 250, 170, 108, 5, 15, RACE_GNOME},
93 { "きちがいロワラン", 500, 175, 108, 4, 12, RACE_HALF_GIANT},
94 { "毒息のウート", 750, 170, 107, 5, 15, RACE_DRACONIAN},
95 { "でぶっちょアラァカ", 1000, 165, 107, 6, 18, RACE_DRACONIAN},
96 { "低能なプーゴー", 250, 170, 108, 5, 15, RACE_BEASTMAN},
97 { "フェロールフィリアン", 500, 175, 108, 4, 12, RACE_ELF},
98 { "年寄りマロカ", 750, 170, 107, 5, 15, RACE_GNOME},
99 { "勇敢なサシン", 1000, 165, 107, 6, 18, RACE_HALF_GIANT},
100 { "田舎者アビエマール", 250, 170, 108, 5, 15, RACE_HUMAN},
101 { "貧乏なハーク", 500, 175, 108, 4, 12, RACE_HALF_ORC},
102 { "みじめなソアリン", 750, 170, 107, 5, 15, RACE_ZOMBIE},
103 { "質素なメルラ", 1000, 165, 107, 6, 18, RACE_ELF},
105 { "Bilbo the Friendly", 200, 170, 108, 5, 15, RACE_HOBBIT},
106 { "Rincewind the Chicken", 200, 175, 108, 4, 12, RACE_HUMAN},
107 { "Sultan the Midget", 300, 170, 107, 5, 15, RACE_GNOME},
108 { "Lyar-el the Comely", 300, 165, 107, 6, 18, RACE_ELF},
109 { "Falilmawen the Friendly", 250, 170, 108, 5, 15, RACE_HOBBIT},
110 { "Voirin the Cowardly", 500, 175, 108, 4, 12, RACE_HUMAN},
111 { "Erashnak the Midget", 750, 170, 107, 5, 15, RACE_BEASTMAN},
112 { "Grug the Comely", 1000, 165, 107, 6, 18, RACE_HALF_TITAN},
113 { "Forovir the Cheap", 250, 170, 108, 5, 15, RACE_HUMAN},
114 { "Ellis the Fool", 500, 175, 108, 4, 12, RACE_HUMAN},
115 { "Filbert the Hungry", 750, 170, 107, 5, 15, RACE_VAMPIRE},
116 { "Fthnargl Psathiggua", 1000, 165, 107, 6, 18, RACE_MIND_FLAYER},
117 { "Eloise Long-Dead", 250, 170, 108, 5, 15, RACE_SPECTRE},
118 { "Fundi the Slow", 500, 175, 108, 4, 12, RACE_ZOMBIE},
119 { "Granthus", 750, 170, 107, 5, 15, RACE_SKELETON},
120 { "Lorax the Suave", 1000, 165, 107, 6, 18, RACE_VAMPIRE},
121 { "Butch", 250, 170, 108, 5, 15, RACE_HALF_ORC},
122 { "Elbereth the Beautiful", 500, 175, 108, 4, 12, RACE_HIGH_ELF},
123 { "Sarleth the Sneaky", 750, 170, 107, 5, 15, RACE_GNOME},
124 { "Narlock", 1000, 165, 107, 6, 18, RACE_DWARF},
125 { "Haneka the Small", 250, 170, 108, 5, 15, RACE_GNOME},
126 { "Loirin the Mad", 500, 175, 108, 4, 12, RACE_HALF_GIANT},
127 { "Wuto Poisonbreath", 750, 170, 107, 5, 15, RACE_DRACONIAN},
128 { "Araaka the Rotund", 1000, 165, 107, 6, 18, RACE_DRACONIAN},
129 { "Poogor the Dumb", 250, 170, 108, 5, 15, RACE_BEASTMAN},
130 { "Felorfiliand", 500, 175, 108, 4, 12, RACE_ELF},
131 { "Maroka the Aged", 750, 170, 107, 5, 15, RACE_GNOME},
132 { "Sasin the Bold", 1000, 165, 107, 6, 18, RACE_HALF_GIANT},
133 { "Abiemar the Peasant", 250, 170, 108, 5, 15, RACE_HUMAN},
134 { "Hurk the Poor", 500, 175, 108, 4, 12, RACE_HALF_ORC},
135 { "Soalin the Wretched", 750, 170, 107, 5, 15, RACE_ZOMBIE},
136 { "Merulla the Humble", 1000, 165, 107, 6, 18, RACE_ELF},
140 /* Armoury - 28 unique names */
142 { "醜悪コン=ダー", 5000, 210, 115, 5, 7, RACE_HALF_ORC},
143 { "頑固者ダーグ=ロウ", 10000, 190, 111, 4, 9, RACE_HUMAN},
144 { "賢者デカド", 25000, 200, 112, 4, 10, RACE_DUNADAN},
145 { "鍛冶屋のウィーランド", 30000, 200, 112, 4, 5, RACE_DWARF},
146 { "醜悪コン=ダー", 10000, 210, 115, 5, 7, RACE_HALF_ORC},
147 { "頑固者ダーグ=ロウ", 15000, 190, 111, 4, 9, RACE_HUMAN},
148 { "ハンサムなデカド", 25000, 200, 112, 4, 10, RACE_AMBERITE},
149 { "エロー・ドラゴンスケイル", 30000, 200, 112, 4, 5, RACE_ELF},
150 { "デリカトス", 10000, 210, 115, 5, 7, RACE_SPRITE},
151 { "巨大なグルース", 15000, 190, 111, 4, 9, RACE_HALF_GIANT},
152 { "アニムス", 25000, 200, 112, 4, 10, RACE_GOLEM},
153 { "マルヴァス", 30000, 200, 112, 4, 5, RACE_HALF_TITAN},
154 { "セラクシス", 10000, 210, 115, 5, 7, RACE_ZOMBIE},
155 { "デス・チル", 5000, 190, 111, 4, 9, RACE_SPECTRE},
156 { "微かなドリオス", 25000, 200, 112, 4, 10, RACE_SPECTRE},
157 { "冷たいバスリック", 30000, 200, 112, 4, 5, RACE_VAMPIRE},
158 { "冷酷ヴェンジェラ", 10000, 210, 115, 5, 7, RACE_HALF_TROLL},
159 { "強者ウィラナ", 15000, 190, 111, 4, 9, RACE_HUMAN},
160 { "ヨジョ二世", 25000, 200, 112, 4, 10, RACE_DWARF},
161 { "優しいラナラー", 30000, 200, 112, 4, 5, RACE_AMBERITE},
162 { "不浄のホルバグ", 5000, 210, 115, 5, 7, RACE_HALF_ORC},
163 { "テレパスのエレレン", 15000, 190, 111, 4, 9, RACE_DARK_ELF},
164 { "イスドリリアス", 25000, 200, 112, 4, 10, RACE_SPRITE},
165 { "一つ目ヴェグナー", 5000, 200, 112, 4, 5, RACE_CYCLOPS},
166 { "混沌のロディッシュ", 10000, 210, 115, 5, 7, RACE_BEASTMAN},
167 { "剣豪ヘジン", 15000, 190, 111, 4, 9, RACE_NIBELUNG},
168 { "ずる屋のエルベレリス", 10000, 200, 112, 4, 10, RACE_DARK_ELF},
169 { "インプのザサス", 30000, 200, 112, 4, 5, RACE_IMP},
170 { "醜悪コン=ダー", 5000, 210, 115, 5, 7, RACE_HALF_ORC},
171 { "頑固者ダーグ=ロウ", 10000, 190, 111, 4, 9, RACE_HUMAN},
172 { "ハンサムなデカド", 25000, 200, 112, 4, 10, RACE_AMBERITE},
173 { "鍛冶屋のウィーランド", 30000, 200, 112, 4, 5, RACE_DWARF},
175 { "Kon-Dar the Ugly", 5000, 210, 115, 5, 7, RACE_HALF_ORC},
176 { "Darg-Low the Grim", 10000, 190, 111, 4, 9, RACE_HUMAN},
177 { "Decado the Handsome", 25000, 200, 112, 4, 10, RACE_DUNADAN},
178 { "Wieland the Smith", 30000, 200, 112, 4, 5, RACE_DWARF},
179 { "Kon-Dar the Ugly", 10000, 210, 115, 5, 7, RACE_HALF_ORC},
180 { "Darg-Low the Grim", 15000, 190, 111, 4, 9, RACE_HUMAN},
181 { "Decado the Handsome", 25000, 200, 112, 4, 10, RACE_AMBERITE},
182 { "Elo Dragonscale", 30000, 200, 112, 4, 5, RACE_ELF},
183 { "Delicatus", 10000, 210, 115, 5, 7, RACE_SPRITE},
184 { "Gruce the Huge", 15000, 190, 111, 4, 9, RACE_HALF_GIANT},
185 { "Animus", 25000, 200, 112, 4, 10, RACE_GOLEM},
186 { "Malvus", 30000, 200, 112, 4, 5, RACE_HALF_TITAN},
187 { "Selaxis", 10000, 210, 115, 5, 7, RACE_ZOMBIE},
188 { "Deathchill", 5000, 190, 111, 4, 9, RACE_SPECTRE},
189 { "Drios the Faint", 25000, 200, 112, 4, 10, RACE_SPECTRE},
190 { "Bathric the Cold", 30000, 200, 112, 4, 5, RACE_VAMPIRE},
191 { "Vengella the Cruel", 10000, 210, 115, 5, 7, RACE_HALF_TROLL},
192 { "Wyrana the Mighty", 15000, 190, 111, 4, 9, RACE_HUMAN},
193 { "Yojo II", 25000, 200, 112, 4, 10, RACE_DWARF},
194 { "Ranalar the Sweet", 30000, 200, 112, 4, 5, RACE_AMBERITE},
195 { "Horbag the Unclean", 5000, 210, 115, 5, 7, RACE_HALF_ORC},
196 { "Elelen the Telepath", 15000, 190, 111, 4, 9, RACE_DARK_ELF},
197 { "Isedrelias", 25000, 200, 112, 4, 10, RACE_SPRITE},
198 { "Vegnar One-eye", 5000, 200, 112, 4, 5, RACE_CYCLOPS},
199 { "Rodish the Chaotic", 10000, 210, 115, 5, 7, RACE_BEASTMAN},
200 { "Hesin Swordmaster", 15000, 190, 111, 4, 9, RACE_NIBELUNG},
201 { "Elvererith the Cheat", 10000, 200, 112, 4, 10, RACE_DARK_ELF},
202 { "Zzathath the Imp", 30000, 200, 112, 4, 5, RACE_IMP},
203 { "Kon-Dar the Ugly", 5000, 210, 115, 5, 7, RACE_HALF_ORC},
204 { "Darg-Low the Grim", 10000, 190, 111, 4, 9, RACE_HUMAN},
205 { "Decado the Handsome", 25000, 200, 112, 4, 10, RACE_AMBERITE},
206 { "Wieland the Smith", 30000, 200, 112, 4, 5, RACE_DWARF},
211 /* Weapon Smith - 28 unique names */
213 { "残忍なるアーノルド", 5000, 210, 115, 6, 6, RACE_HALF_TROLL},
214 { "獣殺しのアーンダル", 10000, 185, 110, 5, 9, RACE_HALF_ELF},
215 { "獣マスターのエディー", 25000, 190, 115, 5, 7, RACE_HOBBIT},
216 { "竜殺しのオグライン", 30000, 195, 112, 4, 8, RACE_DWARF},
217 { "熟練者ドリュー", 10000, 210, 115, 6, 6, RACE_HUMAN},
218 { "龍の子オラックス", 15000, 185, 110, 5, 9, RACE_DRACONIAN},
219 { "病気持ちのアンスラックス", 25000, 190, 115, 5, 7, RACE_BEASTMAN},
220 { "頑丈者アルコス", 30000, 195, 112, 4, 8, RACE_DWARF},
221 { "腐れ者のサリアス", 5000, 210, 115, 6, 6, RACE_ZOMBIE},
222 { "晒し骨のトゥエシク", 15000, 185, 110, 5, 9, RACE_SKELETON},
223 { "ビリオス", 25000, 190, 115, 5, 7, RACE_BEASTMAN},
224 { "ファスガル", 30000, 195, 112, 4, 8, RACE_ZOMBIE},
225 { "パラディンのエレフリス", 10000, 210, 115, 6, 6, RACE_BARBARIAN},
226 { "キ'トリッ'ク", 15000, 185, 110, 5, 9, RACE_KLACKON},
227 { "蜘蛛の友ドゥロカス", 25000, 190, 115, 5, 7, RACE_DARK_ELF},
228 { "巨人殺しのフングス", 30000, 195, 112, 4, 8, RACE_DWARF},
229 { "デランサ", 10000, 210, 115, 6, 6, RACE_ELF},
230 { "レンジャーのソルビスタニ", 15000, 185, 110, 5, 9, RACE_HALF_ELF},
231 { "ノロマのゾリル", 25000, 190, 115, 5, 7, RACE_GOLEM},
232 { "イーオン・フラックス", 20000, 195, 112, 4, 8, RACE_HALF_ELF},
233 { "強者ナドック", 10000, 210, 115, 6, 6, RACE_HOBBIT},
234 { "弱虫エラモグ", 15000, 185, 110, 5, 9, RACE_KOBOLD},
235 { "公正なエオウィリス", 25000, 190, 115, 5, 7, RACE_VAMPIRE},
236 { "バルログ殺しのヒュイモグ", 30000, 195, 112, 4, 8, RACE_HALF_ORC},
237 { "冷酷ピーダス", 5000, 210, 115, 6, 6, RACE_HUMAN},
238 { "ヴァモグ スレイヤー", 15000, 185, 110, 5, 9, RACE_HALF_OGRE},
239 { "性悪フーシュナク", 25000, 190, 115, 5, 7, RACE_BEASTMAN},
240 { "舞闘バレン", 30000, 195, 112, 4, 8, RACE_BARBARIAN},
241 { "残忍なるアーノルド", 5000, 210, 115, 6, 6, RACE_BARBARIAN},
242 { "獣殺しのアーンダル", 10000, 185, 110, 5, 9, RACE_HALF_ELF},
243 { "ビーストマスター・エディー", 25000, 190, 115, 5, 7, RACE_HALF_ORC},
244 { "竜殺しのオグライン", 30000, 195, 112, 4, 8, RACE_DWARF},
246 { "Arnold the Beastly", 5000, 210, 115, 6, 6, RACE_BARBARIAN},
247 { "Arndal Beast-Slayer", 10000, 185, 110, 5, 9, RACE_HALF_ELF},
248 { "Eddie Beast-Master", 25000, 190, 115, 5, 7, RACE_HALF_ORC},
249 { "Oglign Dragon-Slayer", 30000, 195, 112, 4, 8, RACE_DWARF},
250 { "Drew the Skilled", 10000, 210, 115, 6, 6, RACE_HUMAN},
251 { "Orrax Dragonson", 15000, 185, 110, 5, 9, RACE_DRACONIAN},
252 { "Anthrax Disease-Carrier", 25000, 190, 115, 5, 7, RACE_BEASTMAN},
253 { "Arkhoth the Stout", 30000, 195, 112, 4, 8, RACE_DWARF},
254 { "Sarlyas the Rotten", 5000, 210, 115, 6, 6, RACE_ZOMBIE},
255 { "Tuethic Bare-Bones", 15000, 185, 110, 5, 9, RACE_SKELETON},
256 { "Bilious", 25000, 190, 115, 5, 7, RACE_BEASTMAN},
257 { "Fasgul", 30000, 195, 112, 4, 8, RACE_ZOMBIE},
258 { "Ellefris the Paladin", 10000, 210, 115, 6, 6, RACE_BARBARIAN},
259 { "K'trrik'k", 15000, 185, 110, 5, 9, RACE_KLACKON},
260 { "Drocus Spiderfriend", 25000, 190, 115, 5, 7, RACE_DARK_ELF},
261 { "Fungus Giant-Slayer", 30000, 195, 112, 4, 8, RACE_DWARF},
262 { "Delantha", 10000, 210, 115, 6, 6, RACE_ELF},
263 { "Solvistani the Ranger", 15000, 185, 110, 5, 9, RACE_HALF_ELF},
264 { "Xoril the Slow", 25000, 190, 115, 5, 7, RACE_GOLEM},
265 { "Aeon Flux", 20000, 195, 112, 4, 8, RACE_HALF_ELF},
266 { "Nadoc the Strong", 10000, 210, 115, 6, 6, RACE_HOBBIT},
267 { "Eramog the Weak", 15000, 185, 110, 5, 9, RACE_KOBOLD},
268 { "Eowilith the Fair", 25000, 190, 115, 5, 7, RACE_VAMPIRE},
269 { "Huimog Balrog-Slayer", 30000, 195, 112, 4, 8, RACE_HALF_ORC},
270 { "Peadus the Cruel", 5000, 210, 115, 6, 6, RACE_HUMAN},
271 { "Vamog Slayer", 15000, 185, 110, 5, 9, RACE_HALF_OGRE},
272 { "Hooshnak the Vicious", 25000, 190, 115, 5, 7, RACE_BEASTMAN},
273 { "Balenn War-Dancer", 30000, 195, 112, 4, 8, RACE_BARBARIAN},
274 { "Arnold the Beastly", 5000, 210, 115, 6, 6, RACE_BARBARIAN},
275 { "Arndal Beast-Slayer", 10000, 185, 110, 5, 9, RACE_HALF_ELF},
276 { "Eddie Beast-Master", 25000, 190, 115, 5, 7, RACE_HALF_ORC},
277 { "Oglign Dragon-Slayer", 30000, 195, 112, 4, 8, RACE_DWARF},
281 /* Temple - 22 unique names */
283 { "質素なルードヴィヒ", 5000, 175, 109, 6, 15, RACE_HUMAN},
284 { "パラディンのガンナー", 10000, 185, 110, 5, 23, RACE_HUMAN},
285 { "選ばれしトリン", 25000, 180, 107, 6, 20, RACE_ELF},
286 { "賢明なるサラストロ", 30000, 185, 109, 5, 15, RACE_DWARF},
287 { "パーシヴァル卿", 25000, 180, 107, 6, 20, RACE_HIGH_ELF},
288 { "神聖なるアセナス", 30000, 185, 109, 5, 15, RACE_HUMAN},
289 { "マッキノン", 10000, 175, 109, 6, 15, RACE_HUMAN},
290 { "謹み婦人", 15000, 185, 110, 5, 23, RACE_HIGH_ELF},
291 { "ドルイドのハシュニック", 25000, 180, 107, 6, 20, RACE_HOBBIT},
292 { "フィナク", 30000, 185, 109, 5, 15, RACE_YEEK},
293 { "クリキック", 10000, 175, 109, 6, 15, RACE_KLACKON},
294 { "荒くれ者モリヴァル", 15000, 185, 110, 5, 23, RACE_ELF},
295 { "暗きホシャック", 25000, 180, 107, 6, 20, RACE_IMP},
296 { "賢者アタール", 30000, 185, 109, 5, 15, RACE_HUMAN},
297 { "清きイベニッド", 10000, 175, 109, 6, 15, RACE_HUMAN},
298 { "エリディシュ", 15000, 185, 110, 5, 23, RACE_HALF_TROLL},
299 { "呪術師ヴルドゥシュ", 25000, 180, 107, 6, 20, RACE_HALF_OGRE},
300 { "狂戦士ハオブ", 30000, 185, 109, 5, 15, RACE_BARBARIAN},
301 { "若きプルーグディシュ", 10000, 175, 109, 6, 15, RACE_HALF_OGRE},
302 { "きちがいラムワイズ", 15000, 185, 110, 5, 23, RACE_YEEK},
303 { "有徳者ムワート", 25000, 180, 107, 6, 20, RACE_KOBOLD},
304 { "弱虫ダードバード", 30000, 185, 109, 5, 15, RACE_SPECTRE},
305 { "質素なルードヴィヒ", 5000, 175, 109, 6, 15, RACE_HUMAN},
306 { "パラディンのガンナー", 10000, 185, 110, 5, 23, RACE_HUMAN},
307 { "選ばれしトリン", 25000, 180, 107, 6, 20, RACE_ELF},
308 { "賢明なるサラストロ", 30000, 185, 109, 5, 15, RACE_DWARF},
309 { "パーシヴァル卿", 25000, 180, 107, 6, 20, RACE_HIGH_ELF},
310 { "神聖なるアセナス", 30000, 185, 109, 5, 15, RACE_HUMAN},
311 { "マッキノン", 10000, 175, 109, 6, 15, RACE_HUMAN},
312 { "謹み婦人", 15000, 185, 110, 5, 23, RACE_HIGH_ELF},
313 { "ドルイドのハシュニック", 25000, 180, 107, 6, 20, RACE_HOBBIT},
314 { "フィナク", 30000, 185, 109, 5, 15, RACE_YEEK},
316 { "Ludwig the Humble", 5000, 175, 109, 6, 15, RACE_DWARF},
317 { "Gunnar the Paladin", 10000, 185, 110, 5, 23, RACE_HALF_TROLL},
318 { "Torin the Chosen", 25000, 180, 107, 6, 20, RACE_HIGH_ELF},
319 { "Sarastro the Wise", 30000, 185, 109, 5, 15, RACE_HUMAN},
320 { "Sir Parsival the Pure", 25000, 180, 107, 6, 20, RACE_HIGH_ELF},
321 { "Asenath the Holy", 30000, 185, 109, 5, 15, RACE_HUMAN},
322 { "McKinnon", 10000, 175, 109, 6, 15, RACE_HUMAN},
323 { "Mistress Chastity", 15000, 185, 110, 5, 23, RACE_HIGH_ELF},
324 { "Hashnik the Druid", 25000, 180, 107, 6, 20, RACE_HOBBIT},
325 { "Finak", 30000, 185, 109, 5, 15, RACE_YEEK},
326 { "Krikkik", 10000, 175, 109, 6, 15, RACE_KLACKON},
327 { "Morival the Wild", 15000, 185, 110, 5, 23, RACE_ELF},
328 { "Hoshak the Dark", 25000, 180, 107, 6, 20, RACE_IMP},
329 { "Atal the Wise", 30000, 185, 109, 5, 15, RACE_HUMAN},
330 { "Ibenidd the Chaste", 10000, 175, 109, 6, 15, RACE_HUMAN},
331 { "Eridish", 15000, 185, 110, 5, 23, RACE_HALF_TROLL},
332 { "Vrudush the Shaman", 25000, 180, 107, 6, 20, RACE_HALF_OGRE},
333 { "Haob the Berserker", 30000, 185, 109, 5, 15, RACE_BARBARIAN},
334 { "Proogdish the Youthfull", 10000, 175, 109, 6, 15, RACE_HALF_OGRE},
335 { "Lumwise the Mad", 15000, 185, 110, 5, 23, RACE_YEEK},
336 { "Muirt the Virtuous", 25000, 180, 107, 6, 20, RACE_KOBOLD},
337 { "Dardobard the Weak", 30000, 185, 109, 5, 15, RACE_SPECTRE},
338 { "Ludwig the Humble", 5000, 175, 109, 6, 15, RACE_DWARF},
339 { "Gunnar the Paladin", 10000, 185, 110, 5, 23, RACE_HALF_TROLL},
340 { "Torin the Chosen", 25000, 180, 107, 6, 20, RACE_HIGH_ELF},
341 { "Sarastro the Wise", 30000, 185, 109, 5, 15, RACE_HUMAN},
342 { "Sir Parsival the Pure", 25000, 180, 107, 6, 20, RACE_HIGH_ELF},
343 { "Asenath the Holy", 30000, 185, 109, 5, 15, RACE_HUMAN},
344 { "McKinnon", 10000, 175, 109, 6, 15, RACE_HUMAN},
345 { "Mistress Chastity", 15000, 185, 110, 5, 23, RACE_HIGH_ELF},
346 { "Hashnik the Druid", 25000, 180, 107, 6, 20, RACE_HOBBIT},
347 { "Finak", 30000, 185, 109, 5, 15, RACE_YEEK},
351 /* Alchemist - 26 unique names */
353 { "化学者マウザー", 10000, 190, 111, 5, 8, RACE_HALF_ELF},
354 { "カオスのウィズル", 10000, 190, 110, 6, 8, RACE_HOBBIT},
355 { "強欲ミダス", 15000, 200, 116, 6, 9, RACE_GNOME},
356 { "貧弱ジャ=ファー", 15000, 220, 111, 4, 9, RACE_ELF},/*FIRST*/
357 { "カカルラカカル", 15000, 200, 116, 6, 9, RACE_KLACKON},
358 { "錬金術師ジャル=エス", 15000, 220, 111, 4, 9, RACE_ELF},
359 { "用心深いファネラス", 10000, 190, 111, 5, 8, RACE_DWARF},
360 { "キチガイのルンシー", 10000, 190, 110, 6, 8, RACE_HUMAN},
361 { "グランブルワース", 15000, 200, 116, 6, 9, RACE_GNOME},
362 { "フリッター", 15000, 220, 111, 4, 9, RACE_SPRITE},
363 { "ザリルス", 10000, 190, 111, 5, 8, RACE_HUMAN},
364 { "古きエグバート", 10000, 190, 110, 6, 8, RACE_DWARF},
365 { "誇り高きヴァリンドラ", 15000, 200, 116, 6, 9, RACE_HIGH_ELF},
366 { "錬金術師タエン", 15000, 220, 111, 4, 9, RACE_HUMAN},
367 { "巧言カイド", 10000, 190, 111, 5, 8, RACE_VAMPIRE},
368 { "暗きフリア", 10000, 190, 110, 6, 8, RACE_NIBELUNG},
369 { "質素なドムリ", 15000, 200, 116, 6, 9, RACE_DWARF},
370 { "魔の子ヤァジュッカ", 15000, 220, 111, 4, 9, RACE_IMP},
371 { "薬草師ジェララルドール", 10000, 190, 111, 5, 8, RACE_HIGH_ELF},
372 { "賢者オレラルダン", 10000, 190, 110, 6, 8, RACE_BARBARIAN},
373 { "デモニシストのフゾグロ", 15000, 200, 116, 6, 9, RACE_IMP},
374 { "錬金術師ドゥリアシュ", 15000, 220, 111, 4, 9, RACE_HALF_ORC},
375 { "強者ネリア", 10000, 190, 111, 5, 8, RACE_CYCLOPS},
376 { "辛口リグナス", 10000, 190, 110, 6, 8, RACE_HALF_ORC},
377 { "ティルバ", 15000, 200, 116, 6, 9, RACE_HOBBIT},
378 { "金持ちミリルドリック", 15000, 220, 111, 4, 9, RACE_HUMAN},
380 { "科学者マウザー", 10000, 190, 111, 5, 8, RACE_HALF_ELF},
381 { "カオスのウィズル", 10000, 190, 110, 6, 8, RACE_HOBBIT},
382 { "強欲ミダス", 15000, 200, 116, 6, 9, RACE_GNOME},
383 { "錬金術師ジャ=ファー", 15000, 220, 111, 4, 9, RACE_ELF},
384 { "カカルラカカル", 15000, 200, 116, 6, 9, RACE_KLACKON},
385 { "錬金術師ジャル=エス", 15000, 220, 111, 4, 9, RACE_ELF},
387 { "Mauser the Chemist", 10000, 190, 111, 5, 8, RACE_HALF_ELF},
388 { "Wizzle the Chaotic", 10000, 190, 110, 6, 8, RACE_HOBBIT},
389 { "Midas the Greedy", 15000, 200, 116, 6, 9, RACE_GNOME},
390 { "Ja-Far the Alchemist", 15000, 220, 111, 4, 9, RACE_ELF},
391 { "Kakalrakakal", 15000, 200, 116, 6, 9, RACE_KLACKON},
392 { "Jal-Eth the Alchemist", 15000, 220, 111, 4, 9, RACE_ELF},
393 { "Fanelath the Cautious", 10000, 190, 111, 5, 8, RACE_DWARF},
394 { "Runcie the Insane", 10000, 190, 110, 6, 8, RACE_HUMAN},
395 { "Grumbleworth", 15000, 200, 116, 6, 9, RACE_GNOME},
396 { "Flitter", 15000, 220, 111, 4, 9, RACE_SPRITE},
397 { "Xarillus", 10000, 190, 111, 5, 8, RACE_HUMAN},
398 { "Egbert the Old", 10000, 190, 110, 6, 8, RACE_DWARF},
399 { "Valindra the Proud", 15000, 200, 116, 6, 9, RACE_HIGH_ELF},
400 { "Taen the Alchemist", 15000, 220, 111, 4, 9, RACE_HUMAN},
401 { "Cayd the Sweet", 10000, 190, 111, 5, 8, RACE_VAMPIRE},
402 { "Fulir the Dark", 10000, 190, 110, 6, 8, RACE_NIBELUNG},
403 { "Domli the Humble", 15000, 200, 116, 6, 9, RACE_DWARF},
404 { "Yaarjukka Demonspawn", 15000, 220, 111, 4, 9, RACE_IMP},
405 { "Gelaraldor the Herbmaster", 10000, 190, 111, 5, 8, RACE_HIGH_ELF},
406 { "Olelaldan the Wise", 10000, 190, 110, 6, 8, RACE_BARBARIAN},
407 { "Fthoglo the Demonicist", 15000, 200, 116, 6, 9, RACE_IMP},
408 { "Dridash the Alchemist", 15000, 220, 111, 4, 9, RACE_HALF_ORC},
409 { "Nelir the Strong", 10000, 190, 111, 5, 8, RACE_CYCLOPS},
410 { "Lignus the Pungent", 10000, 190, 110, 6, 8, RACE_HALF_ORC},
411 { "Tilba", 15000, 200, 116, 6, 9, RACE_HOBBIT},
412 { "Myrildric the Wealthy", 15000, 220, 111, 4, 9, RACE_HUMAN},
414 { "Mauser the Chemist", 10000, 190, 111, 5, 8, RACE_HALF_ELF},
415 { "Wizzle the Chaotic", 10000, 190, 110, 6, 8, RACE_HOBBIT},
416 { "Midas the Greedy", 15000, 200, 116, 6, 9, RACE_GNOME},
417 { "Ja-Far the Alchemist", 15000, 220, 111, 4, 9, RACE_ELF},
418 { "Kakalrakakal", 15000, 200, 116, 6, 9, RACE_KLACKON},
419 { "Jal-Eth the Alchemist", 15000, 220, 111, 4, 9, RACE_ELF},
424 /* Magic Shop - 23 unique names */
426 { "ソーサラーのロ=パン", 20000, 200, 110, 7, 8, RACE_HALF_ELF},
427 { "偉大なるブガービイ", 20000, 215, 113, 6, 10, RACE_GNOME},
428 { "イェンダーの魔法使い", 30000, 200, 110, 7, 10, RACE_HUMAN},
429 { "死霊使いリャク",30000, 175, 110, 5, 11, RACE_HIGH_ELF},
430 { "魔術師スキドゥニー", 15000, 200, 110, 7, 8, RACE_HALF_ELF},
431 { "幻術師キリア", 30000, 200, 110, 7, 10, RACE_HUMAN},
432 { "死霊術師ニッキ", 30000, 175, 110, 5, 11, RACE_DARK_ELF},
433 { "ソロストラン", 15000, 200, 110, 7, 8, RACE_SPRITE},
434 { "烏賊口アチシェ", 20000, 215, 113, 6, 10, RACE_MIND_FLAYER},
435 { "貴族のカザ", 30000, 200, 110, 7, 10, RACE_HIGH_ELF},
436 { "暗きファジル", 30000, 175, 110, 5, 11, RACE_DARK_ELF},
437 { "偉大なるケルドーン", 15000, 200, 110, 7, 8, RACE_DWARF},
438 { "フィランスロプス", 20000, 215, 113, 6, 10, RACE_HOBBIT},
439 { "魔女のアグナー", 30000, 200, 110, 7, 10, RACE_HUMAN},
440 { "死霊術師ビュリアンス", 30000, 175, 110, 5, 11, RACE_BEASTMAN},
441 { "ハイメイジのヴイラク", 15000, 200, 110, 7, 8, RACE_BEASTMAN},
442 { "知恵者マディッシュ", 20000, 215, 113, 6, 10, RACE_BEASTMAN},
443 { "ファレブリンボール", 30000, 200, 110, 7, 10, RACE_HIGH_ELF},
444 { "陰険フェリル=ガンド", 30000, 175, 110, 5, 11, RACE_DARK_ELF},
445 { "呪術師サレゴード", 15000, 200, 110, 7, 8, RACE_BARBARIAN},
446 { "神秘家クトゥアロス", 20000, 215, 113, 6, 10, RACE_MIND_FLAYER},
447 { "幻術師イベリ", 30000, 200, 110, 7, 10, RACE_SKELETON},
448 { "死霊術師ヘトー", 30000, 175, 110, 5, 11, RACE_YEEK},
449 { "魔術師ロ=パン", 20000, 200, 110, 7, 8, RACE_HALF_ELF},
450 { "偉大なるブガービイ", 20000, 215, 113, 6, 10, RACE_GNOME},
451 { "イェンダーの魔法使い", 30000, 200, 110, 7, 10, RACE_HUMAN},
452 { "死霊術師リャク", 30000, 175, 110, 5, 11, RACE_DARK_ELF},
453 { "魔術師スキドゥニー", 15000, 200, 110, 7, 8, RACE_HALF_ELF},
454 { "幻術師キリア", 30000, 200, 110, 7, 10, RACE_HUMAN},
455 { "死霊術師ニッキ", 30000, 175, 110, 5, 11, RACE_DARK_ELF},
456 { "ソロストラン", 15000, 200, 110, 7, 8, RACE_SPRITE},
457 { "烏賊口アチシェ", 20000, 215, 113, 6, 10, RACE_MIND_FLAYER},
459 { "Lo Pan the Sorcerer", 20000, 200, 110, 7, 8, RACE_HALF_ELF},
460 { "Buggerby the Great", 20000, 215, 113, 6, 10, RACE_GNOME},
461 { "The Wizard of Yendor", 30000, 200, 110, 7, 10, RACE_HUMAN},
462 { "Rjak the Necromancer", 30000, 175, 110, 5, 11, RACE_DARK_ELF},
463 { "Skidney the Sorcerer", 15000, 200, 110, 7, 8, RACE_HALF_ELF},
464 { "Kyria the Illusionist", 30000, 200, 110, 7, 10, RACE_HUMAN},
465 { "Nikki the Necromancer", 30000, 175, 110, 5, 11, RACE_DARK_ELF},
466 { "Solostoran", 15000, 200, 110, 7, 8, RACE_SPRITE},
467 { "Achshe the Tentacled", 20000, 215, 113, 6, 10, RACE_MIND_FLAYER},
468 { "Kaza the Noble", 30000, 200, 110, 7, 10, RACE_HIGH_ELF},
469 { "Fazzil the Dark", 30000, 175, 110, 5, 11, RACE_DARK_ELF},
470 { "Keldorn the Grand", 15000, 200, 110, 7, 8, RACE_DWARF},
471 { "Philanthropus", 20000, 215, 113, 6, 10, RACE_HOBBIT},
472 { "Agnar the Enchantress", 30000, 200, 110, 7, 10, RACE_HUMAN},
473 { "Buliance the Necromancer", 30000, 175, 110, 5, 11, RACE_BEASTMAN},
474 { "Vuirak the High-Mage", 15000, 200, 110, 7, 8, RACE_BEASTMAN},
475 { "Madish the Smart", 20000, 215, 113, 6, 10, RACE_BEASTMAN},
476 { "Falebrimbor", 30000, 200, 110, 7, 10, RACE_HIGH_ELF},
477 { "Felil-Gand the Subtle", 30000, 175, 110, 5, 11, RACE_DARK_ELF},
478 { "Thalegord the Shaman", 15000, 200, 110, 7, 8, RACE_BARBARIAN},
479 { "Cthoaloth the Mystic", 20000, 215, 113, 6, 10, RACE_MIND_FLAYER},
480 { "Ibeli the Illusionist", 30000, 200, 110, 7, 10, RACE_SKELETON},
481 { "Heto the Necromancer", 30000, 175, 110, 5, 11, RACE_YEEK},
482 { "Lo Pan the Sorcerer", 20000, 200, 110, 7, 8, RACE_HALF_ELF},
483 { "Buggerby the Great", 20000, 215, 113, 6, 10, RACE_GNOME},
484 { "The Wizard of Yendor", 30000, 200, 110, 7, 10, RACE_HUMAN},
485 { "Rjak the Necromancer", 30000, 175, 110, 5, 11, RACE_DARK_ELF},
486 { "Skidney the Sorcerer", 15000, 200, 110, 7, 8, RACE_HALF_ELF},
487 { "Kyria the Illusionist", 30000, 200, 110, 7, 10, RACE_HUMAN},
488 { "Nikki the Necromancer", 30000, 175, 110, 5, 11, RACE_DARK_ELF},
489 { "Solostoran", 15000, 200, 110, 7, 8, RACE_SPRITE},
490 { "Achshe the Tentacled", 20000, 215, 113, 6, 10, RACE_MIND_FLAYER},
494 /* Black Market - 32 unique names */
496 { "ガリー=ギガズ", 20000, 250, 150, 10, 5, RACE_HALF_TROLL},
497 { "ゴブリンのヒストーア", 20000, 250, 150, 10, 5, RACE_HALF_ORC},
498 { "フェレンギ人クアーク", 30000, 250, 150, 10, 5, RACE_HUMAN},
499 { "公正なる(?)トッピ", 30000, 250, 150, 10, 5, RACE_ELF},
500 { "死人ヴァッサ", 20000, 250, 150, 10, 5, RACE_ZOMBIE},
501 { "裏切り者カイン", 20000, 250, 150, 10, 5, RACE_VAMPIRE},
502 { "ブボニカス", 30000, 250, 150, 10, 5, RACE_BEASTMAN},
503 { "コープスライト", 30000, 250, 150, 10, 5, RACE_SPECTRE},
504 { "血に飢えしパリッシュ", 20000, 250, 150, 10, 5, RACE_VAMPIRE},
505 { "ヴァイル", 20000, 250, 150, 10, 5, RACE_SKELETON},
506 { "信頼のプレンティス", 30000, 250, 150, 10, 5, RACE_SKELETON},
507 { "人間殺しのグリエラ", 30000, 250, 150, 10, 5, RACE_IMP},
508 { "エンジェル", 20000, 250, 150, 10, 5, RACE_VAMPIRE},
509 { "水膨れフロツァム", 20000, 250, 150, 10, 5, RACE_ZOMBIE},
510 { "ニーヴァル", 30000, 250, 150, 10, 5, RACE_VAMPIRE},
511 { "明るいアナスタシア", 30000, 250, 150, 10, 5, RACE_SPECTRE},
512 { "死霊術師チャリティー", 20000, 250, 150, 10, 5, RACE_DARK_ELF},
513 { "ボクサーのプグナシオス", 20000, 250, 150, 10, 5, RACE_HALF_ORC},
514 { "幸運なフットソア", 30000, 250, 150, 10, 5, RACE_BEASTMAN},
515 { "光指のシドリア", 30000, 250, 150, 10, 5, RACE_HUMAN},
516 { "手品師リアソー", 20000, 250, 150, 10, 5, RACE_HOBBIT},
517 { "やりくり上手のジャナッカ", 20000, 250, 150, 10, 5, RACE_GNOME},
518 { "悪党シーナ", 30000, 250, 150, 10, 5, RACE_GNOME},
519 { "大爪アルニッキ", 30000, 250, 150, 10, 5, RACE_DRACONIAN},
520 { "貧乏チャエアンド", 20000, 250, 150, 10, 5, RACE_HUMAN},
521 { "山賊アファードーフ", 20000, 250, 150, 10, 5, RACE_BARBARIAN},
522 { "強欲ラザクスル", 30000, 250, 150, 10, 5, RACE_MIND_FLAYER},
523 { "ファラレウィン", 30000, 250, 150, 10, 5, RACE_SPRITE},
524 { "しわしわヴォスール", 20000, 250, 150, 10, 5, RACE_NIBELUNG},
525 { "ハンサムなアラオード", 20000, 250, 150, 10, 5, RACE_AMBERITE},
526 { "負け犬セラドフリド", 30000, 250, 150, 10, 5, RACE_HUMAN},
527 { "片足のエルーロ", 30000, 250, 150, 10, 5, RACE_HALF_OGRE},
529 { "Gary Gygaz", 20000, 250, 150, 10, 5, RACE_HALF_TROLL},
530 { "Histor the Goblin", 20000, 250, 150, 10, 5, RACE_HALF_ORC},
531 { "Quark the Ferengi", 30000, 250, 150, 10, 5, RACE_DWARF},
532 { "Topi the Fair(?)", 30000, 250, 150, 10, 5, RACE_HUMAN},
533 { "Vhassa the Dead", 20000, 250, 150, 10, 5, RACE_ZOMBIE},
534 { "Kyn the Treacherous", 20000, 250, 150, 10, 5, RACE_VAMPIRE},
535 { "Bubonicus", 30000, 250, 150, 10, 5, RACE_BEASTMAN},
536 { "Corpselight", 30000, 250, 150, 10, 5, RACE_SPECTRE},
537 { "Parrish the Bloodthirsty", 20000, 250, 150, 10, 5, RACE_VAMPIRE},
538 { "Vile", 20000, 250, 150, 10, 5, RACE_SKELETON},
539 { "Prentice the Trusted", 30000, 250, 150, 10, 5, RACE_SKELETON},
540 { "Griella Humanslayer", 30000, 250, 150, 10, 5, RACE_IMP},
541 { "Angel", 20000, 250, 150, 10, 5, RACE_VAMPIRE},
542 { "Flotsam the Bloated", 20000, 250, 150, 10, 5, RACE_ZOMBIE},
543 { "Nieval", 30000, 250, 150, 10, 5, RACE_VAMPIRE},
544 { "Anastasia the Luminous", 30000, 250, 150, 10, 5, RACE_SPECTRE},
545 { "Charity the Necromancer", 20000, 250, 150, 10, 5, RACE_DARK_ELF},
546 { "Pugnacious the Pugilist", 20000, 250, 150, 10, 5, RACE_HALF_ORC},
547 { "Footsore the Lucky", 30000, 250, 150, 10, 5, RACE_BEASTMAN},
548 { "Sidria Lighfingered", 30000, 250, 150, 10, 5, RACE_HUMAN},
549 { "Riatho the Juggler", 20000, 250, 150, 10, 5, RACE_HOBBIT},
550 { "Janaaka the Shifty", 20000, 250, 150, 10, 5, RACE_GNOME},
551 { "Cina the Rogue", 30000, 250, 150, 10, 5, RACE_GNOME},
552 { "Arunikki Greatclaw", 30000, 250, 150, 10, 5, RACE_DRACONIAN},
553 { "Chaeand the Poor", 20000, 250, 150, 10, 5, RACE_HUMAN},
554 { "Afardorf the Brigand", 20000, 250, 150, 10, 5, RACE_BARBARIAN},
555 { "Lathaxl the Greedy", 30000, 250, 150, 10, 5, RACE_MIND_FLAYER},
556 { "Falarewyn", 30000, 250, 150, 10, 5, RACE_SPRITE},
557 { "Vosur the Wrinkled", 20000, 250, 150, 10, 5, RACE_NIBELUNG},
558 { "Araord the Handsome", 20000, 250, 150, 10, 5, RACE_AMBERITE},
559 { "Theradfrid the Loser", 30000, 250, 150, 10, 5, RACE_HUMAN},
560 { "One-Legged Eroolo", 30000, 250, 150, 10, 5, RACE_HALF_OGRE},
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},
594 { "我が家", 0, 100, 100, 0, 99, 99},
595 { "我が家", 0, 100, 100, 0, 99, 99},
596 { "我が家", 0, 100, 100, 0, 99, 99},
597 { "我が家", 0, 100, 100, 0, 99, 99},
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},
627 { "Your home", 0, 100, 100, 0, 99, 99},
628 { "Your home", 0, 100, 100, 0, 99, 99},
629 { "Your home", 0, 100, 100, 0, 99, 99},
630 { "Your home", 0, 100, 100, 0, 99, 99},
636 /* Bookstore - 21 unique names */
638 { "強欲ドラフ", 10000, 175, 108, 4, 12, RACE_HUMAN},
639 { "賢者オドナー", 15000, 120, 105, 6, 16, RACE_HIGH_ELF},
640 { "中立のガンダー", 25000, 120, 110, 7, 19, RACE_DARK_ELF},
641 { "忍耐の人ロ=シャ", 30000, 140, 105, 6, 12, RACE_ELF},
642 { "ランドルフ・カーター", 15000, 175, 108, 4, 12, RACE_HUMAN},
643 { "隼のサライ", 15000, 175, 108, 4, 12, RACE_HUMAN},
644 { "千里眼ボドリル", 20000, 120, 105, 6, 16, RACE_HIGH_ELF},
645 { "沈黙のヴェオロイン", 25000, 120, 110, 7, 19, RACE_ZOMBIE},
646 { "学者のヴァンシラス", 30000, 140, 105, 6, 12, RACE_MIND_FLAYER},
647 { "物書きオセイン", 15000, 175, 108, 4, 12, RACE_SKELETON},
648 { "本の虫オルヴァー", 20000, 120, 105, 6, 16, RACE_VAMPIRE},
649 { "浅井墓男", 25000, 120, 110, 7, 19, RACE_ZOMBIE},
650 { "デスマスク", 30000, 140, 105, 6, 12, RACE_ZOMBIE},
651 { "学者のアスーヌ", 15000, 175, 108, 4, 12, RACE_MIND_FLAYER},
652 { "死人のプリランド", 20000, 120, 105, 6, 16, RACE_ZOMBIE},
653 { "鉄のロナール", 25000, 120, 110, 7, 19, RACE_GOLEM},
655 { "Dolaf the Greedy", 10000, 175, 108, 4, 12, RACE_HUMAN},
656 { "Odnar the Sage", 15000, 120, 105, 6, 16, RACE_HIGH_ELF},
657 { "Gandar the Neutral", 25000, 120, 110, 7, 19, RACE_DARK_ELF},
658 { "Ro-sha the Patient", 30000, 140, 105, 6, 12, RACE_ELF},
659 { "Randolph Carter", 15000, 175, 108, 4, 12, RACE_HUMAN},
660 { "Sarai the Swift", 15000, 175, 108, 4, 12, RACE_HUMAN},
661 { "Bodril the Seer", 20000, 120, 105, 6, 16, RACE_HIGH_ELF},
662 { "Veloin the Quiet", 25000, 120, 110, 7, 19, RACE_ZOMBIE},
663 { "Vanthylas the Learned", 30000, 140, 105, 6, 12, RACE_MIND_FLAYER},
664 { "Ossein the Literate", 15000, 175, 108, 4, 12, RACE_SKELETON},
665 { "Olvar Bookworm", 20000, 120, 105, 6, 16, RACE_VAMPIRE},
666 { "Shallowgrave", 25000, 120, 110, 7, 19, RACE_ZOMBIE},
667 { "Death Mask", 30000, 140, 105, 6, 12, RACE_ZOMBIE},
668 { "Asuunu the Learned", 15000, 175, 108, 4, 12, RACE_MIND_FLAYER},
669 { "Prirand the Dead", 20000, 120, 105, 6, 16, RACE_ZOMBIE},
670 { "Ronar the Iron", 25000, 120, 110, 7, 19, RACE_GOLEM},
673 { "ガリル=ガミル", 30000, 140, 105, 6, 12, RACE_ELF},
674 { "本食いローバグ", 15000, 175, 108, 4, 12, RACE_KOBOLD},
675 { "キリアリキーク", 20000, 120, 105, 6, 16, RACE_KLACKON},
676 { "静かなるリリン", 25000, 120, 110, 7, 19, RACE_DWARF},
677 { "王者イサング", 30000, 140, 105, 6, 12, RACE_HIGH_ELF},
678 { "強欲ドラフ", 10000, 175, 108, 4, 12, RACE_HUMAN},
679 { "賢者オドナー", 15000, 120, 105, 6, 16, RACE_HIGH_ELF},
680 { "中立のガンダー", 25000, 120, 110, 7, 19, RACE_DARK_ELF},
681 { "忍耐の人ロ=シャ", 30000, 140, 105, 6, 12, RACE_ELF},
682 { "ランドルフ・カーター", 15000, 175, 108, 4, 12, RACE_HUMAN},
683 { "隼サライ", 15000, 175, 108, 4, 12, RACE_HUMAN},
684 { "千里眼ボドリル", 20000, 120, 105, 6, 16, RACE_HIGH_ELF},
685 { "沈黙のヴェオロイン", 25000, 120, 110, 7, 19, RACE_ZOMBIE},
686 { "学者のヴァンシラス", 30000, 140, 105, 6, 12, RACE_MIND_FLAYER},
687 { "物書きオセイン", 15000, 175, 108, 4, 12, RACE_SKELETON},
688 { "本の虫オルヴァー", 20000, 120, 105, 6, 16, RACE_VAMPIRE},
690 { "Galil-Gamir", 30000, 140, 105, 6, 12, RACE_ELF},
691 { "Rorbag Book-Eater", 15000, 175, 108, 4, 12, RACE_KOBOLD},
692 { "Kiriarikirk", 20000, 120, 105, 6, 16, RACE_KLACKON},
693 { "Rilin the Quiet", 25000, 120, 110, 7, 19, RACE_DWARF},
694 { "Isung the Lord", 30000, 140, 105, 6, 12, RACE_HIGH_ELF},
695 { "Dolaf the Greedy", 10000, 175, 108, 4, 12, RACE_HUMAN},
696 { "Odnar the Sage", 15000, 120, 105, 6, 16, RACE_HIGH_ELF},
697 { "Gandar the Neutral", 25000, 120, 110, 7, 19, RACE_DARK_ELF},
698 { "Ro-sha the Patient", 30000, 140, 105, 6, 12, RACE_ELF},
699 { "Randolph Carter", 15000, 175, 108, 4, 12, RACE_HUMAN},
700 { "Sarai the Swift", 15000, 175, 108, 4, 12, RACE_HUMAN},
701 { "Bodril the Seer", 20000, 120, 105, 6, 16, RACE_HIGH_ELF},
702 { "Veloin the Quiet", 25000, 120, 110, 7, 19, RACE_ZOMBIE},
703 { "Vanthylas the Learned", 30000, 140, 105, 6, 12, RACE_MIND_FLAYER},
704 { "Ossein the Literate", 15000, 175, 108, 4, 12, RACE_SKELETON},
705 { "Olvar Bookworm", 20000, 120, 105, 6, 16, RACE_VAMPIRE},
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},
740 { "博物館", 0, 100, 100, 0, 99, 99},
741 { "博物館", 0, 100, 100, 0, 99, 99},
742 { "博物館", 0, 100, 100, 0, 99, 99},
743 { "博物館", 0, 100, 100, 0, 99, 99},
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},
773 { "Museum", 0, 100, 100, 0, 99, 99},
774 { "Museum", 0, 100, 100, 0, 99, 99},
775 { "Museum", 0, 100, 100, 0, 99, 99},
776 { "Museum", 0, 100, 100, 0, 99, 99},
783 static int cur_store_num = 0;
784 static int store_top = 0;
785 static int store_bottom = 0;
786 static int xtra_stock = 0;
787 static store_type *st_ptr = NULL;
788 static const owner_type *ot_ptr = NULL;
789 static s16b old_town_num = 0;
790 static s16b inner_town_num = 0;
791 #define RUMOR_CHANCE 8
793 #define MAX_COMMENT_1 6
795 static concptr comment_1[MAX_COMMENT_1] =
816 /*! ブラックマーケット追加メッセージ(承諾) */
817 static concptr comment_1_B[MAX_COMMENT_1] = {
826 #define MAX_COMMENT_2A 2
828 static concptr comment_2a[MAX_COMMENT_2A] =
831 "私の忍耐力を試しているのかい? $%s が最後だ。",
832 "我慢にも限度があるぞ。 $%s が最後だ。"
834 "You try my patience. %s is final.",
835 "My patience grows thin. %s is final."
840 #define MAX_COMMENT_2B 12
842 static concptr comment_2b[MAX_COMMENT_2B] =
845 " $%s ぐらいは出さなきゃダメだよ。",
848 "何て奴だ! $%s 以下はあり得ないぞ。",
849 "それじゃ少なすぎる! $%s は欲しいところだ。",
850 "バカにしている! $%s はもらわないと。",
852 "おいおい! $%s を考えてくれないか?",
853 "1000匹のオークのノミに苦しめられるがいい! $%s だ。",
854 "お前の大切なものに災いあれ! $%s でどうだ。",
855 "モルゴスに賞味されるがいい!本当は $%s なんだろう?",
856 "お前の母親はオーガか! $%s は出すつもりなんだろ?"
858 "I can take no less than %s gold pieces.",
859 "I will accept no less than %s gold pieces.",
860 "Ha! No less than %s gold pieces.",
861 "You knave! No less than %s gold pieces.",
862 "That's a pittance! I want %s gold pieces.",
863 "That's an insult! I want %s gold pieces.",
864 "As if! How about %s gold pieces?",
865 "My arse! How about %s gold pieces?",
866 "May the fleas of 1000 orcs molest you! Try %s gold pieces.",
867 "May your most favourite parts go moldy! Try %s gold pieces.",
868 "May Morgoth find you tasty! Perhaps %s gold pieces?",
869 "Your mother was an Ogre! Perhaps %s gold pieces?"
875 /*! ブラックマーケット用追加メッセージ(売るとき) */
876 static concptr comment_2b_B[MAX_COMMENT_2B] = {
877 "いくら俺様がお人好しとはいえ $%s が限界だね。嫌なら帰りな。",
878 "金がないのかい、あんた?まずは家に帰って $%s 揃えてきな。",
879 "物の価値が分からん奴だな。これは $%s が普通なんだよ。",
880 "俺の付けた値段に文句があるのか? $%s が限界だ。",
881 "ひょっとして新手の冗談かい? $%s 持ってないなら帰りな。",
882 "うちは他の店とは違うんだよ。$%s ぐらいは出しな。",
883 "買う気がないなら帰りな。 $%s だと言っているんだ。",
884 "話にならないね。 $%s くらい持っているんだろ?",
885 "は?なんだそりゃ? $%s の間違いか、ひょっとして?",
886 "出口はあっちだよ。それとも $%s 出せるのかい、あんたに。",
887 "命知らずな奴だな。 $%s 出せば今日の所は勘弁してやるよ。",
888 "うちの店は貧乏人お断りだ。 $%s ぐらい出せないのかい?"
891 #define MAX_COMMENT_3A 2
893 static concptr comment_3a[MAX_COMMENT_3A] =
896 "私の忍耐力を試しているのかい? $%s が最後だ。",
897 "我慢にも限度があるぞ。 $%s が最後だ。"
899 "You try my patience. %s is final.",
900 "My patience grows thin. %s is final."
906 #define MAX_COMMENT_3B 12
908 static concptr comment_3b[MAX_COMMENT_3B] =
911 "本音を言うと $%s でいいんだろ?",
913 " $%s ぐらいなら出してもいいが。",
914 " $%s 以上払うなんて考えられないね。",
915 "まあ落ちついて。 $%s でどうだい?",
916 "そのガラクタなら $%s で引き取るよ。",
917 "それじゃ高すぎる! $%s がいいとこだろ。",
918 "どうせいらないんだろ! $%s でいいだろ?",
919 "だめだめ! $%s がずっとお似合いだよ。",
920 "バカにしている! $%s がせいぜいだ。",
921 " $%s なら嬉しいところだがなあ。",
922 " $%s 、それ以上はビタ一文出さないよ!"
924 "Perhaps %s gold pieces?",
925 "How about %s gold pieces?",
926 "I will pay no more than %s gold pieces.",
927 "I can afford no more than %s gold pieces.",
928 "Be reasonable. How about %s gold pieces?",
929 "I'll buy it as scrap for %s gold pieces.",
930 "That is too much! How about %s gold pieces?",
931 "That looks war surplus! Say %s gold pieces?",
932 "Never! %s is more like it.",
933 "That's an insult! %s is more like it.",
934 "%s gold pieces and be thankful for it!",
935 "%s gold pieces and not a copper more!"
941 /*! ブラックマーケット用追加メッセージ(買い取り) */
942 static concptr comment_3b_B[MAX_COMMENT_3B] = {
943 " $%s ってところだね。そのどうしようもないガラクタは。",
944 "この俺が $%s って言っているんだから、その通りにした方が身のためだぞ。",
945 "俺の優しさに甘えるのもいい加減にしておけ。 $%s だ。",
946 "その品なら $%s で売ってくれているがね、常識ある紳士はみんな。",
947 "こりゃまた、がめつい奴だな。いくら俺が温厚とはいえ $%s が限界だ。",
948 " $%s だ。別に俺はそんなガラクタ欲しくはないんだから。",
949 "俺の鑑定額が気に入らないのか? $%s 、嫌なら帰りな。",
950 " $%s で引き取ってやるよ。喜んで受け取りな、貧乏人。",
951 "物の価値が分からん奴は始末におえんな。それは $%s なんだよ。",
952 "そんなに金が欲しいのか、あんた? $%s で満足できんのか?",
953 "入る店間違えてんじゃないのか? $%s で嫌なら他をあたってくれ。",
954 "俺の言い値にケチをつける奴がいるとは! その度胸に免じて $%s だ。"
957 #define MAX_COMMENT_4A 4
959 static concptr comment_4a[MAX_COMMENT_4A] =
962 "もうたくさんだ!何度も私をわずらわせないでくれ!",
963 "うがー!一日の我慢の限度を超えている!",
964 "もういい!時間の無駄以外のなにものでもない!",
965 "もうやってられないよ!顔も見たくない!"
967 "Enough! You have abused me once too often!",
968 "Arghhh! I have had enough abuse for one day!",
969 "That does it! You shall waste my time no more!",
970 "This is getting nowhere! I'm going to Londis!"
976 /*! ブラックマーケット用追加メッセージ(怒りの頂点) */
977 static concptr comment_4a_B[MAX_COMMENT_4A] = {
978 "なめやがって!温厚な俺様でも限界があるってことを知れ!",
979 "俺をここまで怒らせて...命があるだけでもありがたいと思え!",
980 "ふざけてるのか!冷やかしなら相手を見てからにしろ!",
981 "いいかげんにしろ!今度こんなまねしたらただじゃおかねえぞ!"
984 #define MAX_COMMENT_4B 4
986 static concptr comment_4b[MAX_COMMENT_4B] =
995 "Get out of my sight!",
996 "Begone, you scoundrel!",
1003 /*! ブラックマーケット用追加メッセージ(追い出し) */
1004 static concptr comment_4b_B[MAX_COMMENT_4B] = {
1011 #define MAX_COMMENT_5 8
1013 static concptr comment_5[MAX_COMMENT_5] =
1027 "You will have to do better than that!",
1028 "Do you wish to do business or not?",
1029 "You've got to be kidding!",
1030 "You'd better be kidding!",
1031 "You try my patience.",
1032 "Hmmm, nice weather we're having."
1038 /*! ブラックマーケット用追加メッセージ(怒り) */
1039 static concptr comment_5_B[MAX_COMMENT_5] = {
1050 #define MAX_COMMENT_6 4
1052 static concptr comment_6[MAX_COMMENT_6] =
1060 "I must have heard you wrong.",
1061 "I'm sorry, I missed that.",
1062 "I'm sorry, what was that?",
1063 "Sorry, what was that again?"
1068 /*** Initialize others ***/
1071 * 店舗で販売するオブジェクトを定義する / Hack -- Objects sold in the stores -- by tval/sval pair.
1073 byte store_table[MAX_STORES][STORE_CHOICES][2] =
1078 { TV_FOOD, SV_FOOD_RATION },
1079 { TV_FOOD, SV_FOOD_RATION },
1080 { TV_FOOD, SV_FOOD_RATION },
1081 { TV_FOOD, SV_FOOD_RATION },
1083 { TV_FOOD, SV_FOOD_RATION },
1084 { TV_FOOD, SV_FOOD_BISCUIT },
1085 { TV_FOOD, SV_FOOD_JERKY },
1086 { TV_FOOD, SV_FOOD_JERKY },
1088 { TV_FOOD, SV_FOOD_PINT_OF_WINE },
1089 { TV_FOOD, SV_FOOD_PINT_OF_ALE },
1090 { TV_LITE, SV_LITE_TORCH },
1091 { TV_LITE, SV_LITE_TORCH },
1093 { TV_LITE, SV_LITE_TORCH },
1094 { TV_LITE, SV_LITE_TORCH },
1095 { TV_LITE, SV_LITE_LANTERN },
1096 { TV_LITE, SV_LITE_LANTERN },
1108 { TV_SHOT, SV_AMMO_NORMAL },
1109 { TV_ARROW, SV_AMMO_NORMAL },
1110 { TV_BOLT, SV_AMMO_NORMAL },
1111 { TV_DIGGING, SV_SHOVEL },
1113 { TV_DIGGING, SV_PICK },
1114 { TV_CLOAK, SV_CLOAK },
1115 { TV_CLOAK, SV_CLOAK },
1116 { TV_CLOAK, SV_FUR_CLOAK },
1118 { TV_FOOD, SV_FOOD_RATION },
1119 { TV_FOOD, SV_FOOD_RATION },
1120 { TV_FOOD, SV_FOOD_RATION },
1121 { TV_FOOD, SV_FOOD_RATION },
1123 { TV_POTION, SV_POTION_WATER },
1124 { TV_POTION, SV_POTION_WATER },
1125 { TV_LITE, SV_LITE_LANTERN },
1126 { TV_LITE, SV_LITE_LANTERN },
1128 { TV_FOOD, SV_FOOD_WAYBREAD },
1129 { TV_FOOD, SV_FOOD_WAYBREAD },
1133 { TV_SHOT, SV_AMMO_NORMAL },
1134 { TV_ARROW, SV_AMMO_NORMAL },
1135 { TV_BOLT, SV_AMMO_NORMAL },
1136 { TV_DIGGING, SV_SHOVEL }
1142 { TV_BOOTS, SV_PAIR_OF_SOFT_LEATHER_BOOTS },
1143 { TV_BOOTS, SV_PAIR_OF_SOFT_LEATHER_BOOTS },
1144 { TV_BOOTS, SV_PAIR_OF_HARD_LEATHER_BOOTS },
1145 { TV_BOOTS, SV_PAIR_OF_HARD_LEATHER_BOOTS },
1147 { TV_HELM, SV_HARD_LEATHER_CAP },
1148 { TV_HELM, SV_HARD_LEATHER_CAP },
1149 { TV_HELM, SV_METAL_CAP },
1150 { TV_HELM, SV_IRON_HELM },
1152 { TV_SOFT_ARMOR, SV_ROBE },
1153 { TV_SOFT_ARMOR, SV_ROBE },
1154 { TV_SOFT_ARMOR, SV_SOFT_LEATHER_ARMOR },
1155 { TV_SOFT_ARMOR, SV_SOFT_LEATHER_ARMOR },
1157 { TV_SOFT_ARMOR, SV_HARD_LEATHER_ARMOR },
1158 { TV_SOFT_ARMOR, SV_HARD_LEATHER_ARMOR },
1159 { TV_SOFT_ARMOR, SV_HARD_STUDDED_LEATHER },
1160 { TV_SOFT_ARMOR, SV_HARD_STUDDED_LEATHER },
1162 { TV_SOFT_ARMOR, SV_RHINO_HIDE_ARMOR },
1163 { TV_SOFT_ARMOR, SV_LEATHER_SCALE_MAIL },
1164 { TV_HARD_ARMOR, SV_METAL_SCALE_MAIL },
1165 { TV_HARD_ARMOR, SV_CHAIN_MAIL },
1167 { TV_HARD_ARMOR, SV_DOUBLE_RING_MAIL },
1168 { TV_HARD_ARMOR, SV_AUGMENTED_CHAIN_MAIL },
1169 { TV_HARD_ARMOR, SV_BAR_CHAIN_MAIL },
1170 { TV_HARD_ARMOR, SV_DOUBLE_CHAIN_MAIL },
1172 { TV_HARD_ARMOR, SV_METAL_BRIGANDINE_ARMOUR },
1173 { TV_HARD_ARMOR, SV_SPLINT_MAIL },
1174 { TV_GLOVES, SV_SET_OF_LEATHER_GLOVES },
1175 { TV_GLOVES, SV_SET_OF_LEATHER_GLOVES },
1177 { TV_GLOVES, SV_SET_OF_GAUNTLETS },
1178 { TV_SHIELD, SV_SMALL_LEATHER_SHIELD },
1179 { TV_SHIELD, SV_LARGE_LEATHER_SHIELD },
1180 { TV_SHIELD, SV_SMALL_METAL_SHIELD },
1182 { TV_BOOTS, SV_PAIR_OF_HARD_LEATHER_BOOTS },
1183 { TV_BOOTS, SV_PAIR_OF_HARD_LEATHER_BOOTS },
1184 { TV_HELM, SV_HARD_LEATHER_CAP },
1185 { TV_HELM, SV_HARD_LEATHER_CAP },
1187 { TV_SOFT_ARMOR, SV_ROBE },
1188 { TV_SOFT_ARMOR, SV_SOFT_LEATHER_ARMOR },
1189 { TV_SOFT_ARMOR, SV_SOFT_LEATHER_ARMOR },
1190 { TV_SOFT_ARMOR, SV_HARD_LEATHER_ARMOR },
1192 { TV_SOFT_ARMOR, SV_LEATHER_JACK },
1193 { TV_HARD_ARMOR, SV_METAL_SCALE_MAIL },
1194 { TV_HARD_ARMOR, SV_CHAIN_MAIL },
1195 { TV_HARD_ARMOR, SV_CHAIN_MAIL },
1197 { TV_GLOVES, SV_SET_OF_LEATHER_GLOVES },
1198 { TV_GLOVES, SV_SET_OF_GAUNTLETS },
1199 { TV_SHIELD, SV_SMALL_LEATHER_SHIELD },
1200 { TV_SHIELD, SV_SMALL_LEATHER_SHIELD }
1206 { TV_SWORD, SV_DAGGER },
1207 { TV_SWORD, SV_MAIN_GAUCHE },
1208 { TV_SWORD, SV_RAPIER },
1209 { TV_SWORD, SV_SMALL_SWORD },
1211 { TV_SWORD, SV_SHORT_SWORD },
1212 { TV_SWORD, SV_SABRE },
1213 { TV_SWORD, SV_CUTLASS },
1214 { TV_SWORD, SV_TULWAR },
1216 { TV_SWORD, SV_BROAD_SWORD },
1217 { TV_SWORD, SV_LONG_SWORD },
1218 { TV_SWORD, SV_SCIMITAR },
1219 { TV_SWORD, SV_KATANA },
1221 { TV_SWORD, SV_BASTARD_SWORD },
1222 { TV_POLEARM, SV_SPEAR },
1223 { TV_POLEARM, SV_AWL_PIKE },
1224 { TV_POLEARM, SV_TRIDENT },
1226 { TV_POLEARM, SV_PIKE },
1227 { TV_POLEARM, SV_BEAKED_AXE },
1228 { TV_POLEARM, SV_BROAD_AXE },
1229 { TV_POLEARM, SV_LANCE },
1231 { TV_POLEARM, SV_BATTLE_AXE },
1232 { TV_POLEARM, SV_HATCHET },
1233 { TV_BOW, SV_SLING },
1234 { TV_BOW, SV_SHORT_BOW },
1236 { TV_BOW, SV_LIGHT_XBOW },
1237 { TV_SHOT, SV_AMMO_NORMAL },
1238 { TV_SHOT, SV_AMMO_NORMAL },
1239 { TV_ARROW, SV_AMMO_NORMAL },
1241 { TV_ARROW, SV_AMMO_NORMAL },
1242 { TV_BOLT, SV_AMMO_NORMAL },
1243 { TV_BOLT, SV_AMMO_NORMAL },
1244 { TV_BOW, SV_LIGHT_XBOW },
1246 { TV_ARROW, SV_AMMO_NORMAL },
1247 { TV_BOLT, SV_AMMO_NORMAL },
1248 { TV_BOW, SV_SHORT_BOW },
1249 { TV_BOW, SV_LIGHT_XBOW },
1251 { TV_SWORD, SV_DAGGER },
1252 { TV_SWORD, SV_TANTO },
1253 { TV_SWORD, SV_RAPIER },
1254 { TV_SWORD, SV_SMALL_SWORD },
1256 { TV_SWORD, SV_SHORT_SWORD },
1257 { TV_SWORD, SV_LONG_SWORD },
1258 { TV_SWORD, SV_SCIMITAR },
1259 { TV_SWORD, SV_BROAD_SWORD },
1261 { TV_HISSATSU_BOOK, 0 },
1262 { TV_HISSATSU_BOOK, 0 },
1263 { TV_HISSATSU_BOOK, 1 },
1264 { TV_HISSATSU_BOOK, 1 },
1270 { TV_HAFTED, SV_NUNCHAKU },
1271 { TV_HAFTED, SV_QUARTERSTAFF },
1272 { TV_HAFTED, SV_MACE },
1273 { TV_HAFTED, SV_BO_STAFF },
1275 { TV_HAFTED, SV_WAR_HAMMER },
1276 { TV_HAFTED, SV_WAR_HAMMER },
1277 { TV_HAFTED, SV_MORNING_STAR },
1278 { TV_HAFTED, SV_FLAIL },
1280 { TV_HAFTED, SV_LEAD_FILLED_MACE },
1281 { TV_SCROLL, SV_SCROLL_REMOVE_CURSE },
1282 { TV_SCROLL, SV_SCROLL_BLESSING },
1283 { TV_SCROLL, SV_SCROLL_HOLY_CHANT },
1285 { TV_POTION, SV_POTION_HEROISM },
1286 { TV_SCROLL, SV_SCROLL_WORD_OF_RECALL },
1287 { TV_SCROLL, SV_SCROLL_WORD_OF_RECALL },
1288 { TV_SCROLL, SV_SCROLL_WORD_OF_RECALL },
1290 { TV_POTION, SV_POTION_CURE_LIGHT },
1291 { TV_POTION, SV_POTION_CURE_SERIOUS },
1292 { TV_POTION, SV_POTION_CURE_SERIOUS },
1293 { TV_POTION, SV_POTION_CURE_CRITICAL },
1295 { TV_POTION, SV_POTION_CURE_CRITICAL },
1296 { TV_POTION, SV_POTION_RESTORE_EXP },
1297 { TV_POTION, SV_POTION_RESTORE_EXP },
1298 { TV_POTION, SV_POTION_RESTORE_EXP },
1300 { TV_LIFE_BOOK, 0 },
1301 { TV_LIFE_BOOK, 0 },
1302 { TV_LIFE_BOOK, 1 },
1303 { TV_LIFE_BOOK, 1 },
1305 { TV_CRUSADE_BOOK, 0 },
1306 { TV_CRUSADE_BOOK, 0 },
1307 { TV_CRUSADE_BOOK, 1 },
1308 { TV_CRUSADE_BOOK, 1 },
1310 { TV_HAFTED, SV_WHIP },
1311 { TV_HAFTED, SV_MACE },
1312 { TV_HAFTED, SV_BALL_AND_CHAIN },
1313 { TV_HAFTED, SV_WAR_HAMMER },
1315 { TV_SCROLL, SV_SCROLL_WORD_OF_RECALL },
1316 { TV_SCROLL, SV_SCROLL_WORD_OF_RECALL },
1317 { TV_SCROLL, SV_SCROLL_WORD_OF_RECALL },
1318 { TV_POTION, SV_POTION_CURE_CRITICAL },
1320 { TV_POTION, SV_POTION_CURE_CRITICAL },
1321 { TV_POTION, SV_POTION_RESTORE_EXP },
1324 { TV_STATUE, SV_ANY },
1326 { TV_SCROLL, SV_SCROLL_REMOVE_CURSE },
1327 { TV_SCROLL, SV_SCROLL_REMOVE_CURSE },
1328 { TV_SCROLL, SV_SCROLL_STAR_REMOVE_CURSE },
1329 { TV_SCROLL, SV_SCROLL_STAR_REMOVE_CURSE }
1335 { TV_SCROLL, SV_SCROLL_ENCHANT_WEAPON_TO_HIT },
1336 { TV_SCROLL, SV_SCROLL_ENCHANT_WEAPON_TO_DAM },
1337 { TV_SCROLL, SV_SCROLL_ENCHANT_ARMOR },
1338 { TV_SCROLL, SV_SCROLL_IDENTIFY },
1340 { TV_SCROLL, SV_SCROLL_IDENTIFY },
1341 { TV_SCROLL, SV_SCROLL_IDENTIFY },
1342 { TV_SCROLL, SV_SCROLL_IDENTIFY },
1343 { TV_SCROLL, SV_SCROLL_LIGHT },
1345 { TV_SCROLL, SV_SCROLL_PHASE_DOOR },
1346 { TV_SCROLL, SV_SCROLL_PHASE_DOOR },
1347 { TV_SCROLL, SV_SCROLL_TELEPORT },
1348 { TV_SCROLL, SV_SCROLL_MONSTER_CONFUSION },
1350 { TV_SCROLL, SV_SCROLL_MAPPING },
1351 { TV_SCROLL, SV_SCROLL_DETECT_GOLD },
1352 { TV_SCROLL, SV_SCROLL_DETECT_ITEM },
1353 { TV_SCROLL, SV_SCROLL_DETECT_TRAP },
1355 { TV_SCROLL, SV_SCROLL_DETECT_INVIS },
1356 { TV_SCROLL, SV_SCROLL_RECHARGING },
1357 { TV_SCROLL, SV_SCROLL_TELEPORT },
1358 { TV_SCROLL, SV_SCROLL_WORD_OF_RECALL },
1360 { TV_SCROLL, SV_SCROLL_WORD_OF_RECALL },
1361 { TV_SCROLL, SV_SCROLL_WORD_OF_RECALL },
1362 { TV_SCROLL, SV_SCROLL_WORD_OF_RECALL },
1363 { TV_SCROLL, SV_SCROLL_TELEPORT },
1365 { TV_SCROLL, SV_SCROLL_TELEPORT },
1366 { TV_POTION, SV_POTION_RES_STR },
1367 { TV_POTION, SV_POTION_RES_INT },
1368 { TV_POTION, SV_POTION_RES_WIS },
1370 { TV_POTION, SV_POTION_RES_DEX },
1371 { TV_POTION, SV_POTION_RES_CON },
1372 { TV_POTION, SV_POTION_RES_CHR },
1373 { TV_SCROLL, SV_SCROLL_IDENTIFY },
1375 { TV_SCROLL, SV_SCROLL_IDENTIFY },
1376 { TV_SCROLL, SV_SCROLL_STAR_IDENTIFY }, /* Yep, occasionally! */
1377 { TV_SCROLL, SV_SCROLL_STAR_IDENTIFY },
1378 { TV_SCROLL, SV_SCROLL_LIGHT },
1380 { TV_POTION, SV_POTION_RES_STR },
1381 { TV_POTION, SV_POTION_RES_INT },
1382 { TV_POTION, SV_POTION_RES_WIS },
1383 { TV_POTION, SV_POTION_RES_DEX },
1385 { TV_POTION, SV_POTION_RES_CON },
1386 { TV_POTION, SV_POTION_RES_CHR },
1387 { TV_SCROLL, SV_SCROLL_ENCHANT_ARMOR },
1388 { TV_SCROLL, SV_SCROLL_ENCHANT_ARMOR },
1390 { TV_SCROLL, SV_SCROLL_RECHARGING },
1391 { TV_SCROLL, SV_SCROLL_PHASE_DOOR },
1392 { TV_SCROLL, SV_SCROLL_ENCHANT_WEAPON_TO_HIT },
1393 { TV_SCROLL, SV_SCROLL_ENCHANT_WEAPON_TO_DAM },
1398 /* Magic-User store */
1400 { TV_RING, SV_RING_PROTECTION },
1401 { TV_RING, SV_RING_LEVITATION_FALL },
1402 { TV_RING, SV_RING_PROTECTION },
1403 { TV_RING, SV_RING_RESIST_FIRE },
1405 { TV_RING, SV_RING_RESIST_COLD },
1406 { TV_AMULET, SV_AMULET_CHARISMA },
1407 { TV_RING, SV_RING_WARNING },
1408 { TV_AMULET, SV_AMULET_RESIST_ACID },
1410 { TV_AMULET, SV_AMULET_SEARCHING },
1411 { TV_WAND, SV_WAND_SLOW_MONSTER },
1412 { TV_WAND, SV_WAND_CONFUSE_MONSTER },
1413 { TV_WAND, SV_WAND_SLEEP_MONSTER },
1415 { TV_WAND, SV_WAND_MAGIC_MISSILE },
1416 { TV_WAND, SV_WAND_STINKING_CLOUD },
1417 { TV_WAND, SV_WAND_WONDER },
1418 { TV_WAND, SV_WAND_DISARMING },
1420 { TV_STAFF, SV_STAFF_LITE },
1421 { TV_STAFF, SV_STAFF_MAPPING },
1422 { TV_STAFF, SV_STAFF_DETECT_TRAP },
1423 { TV_STAFF, SV_STAFF_DETECT_DOOR },
1425 { TV_STAFF, SV_STAFF_DETECT_GOLD },
1426 { TV_STAFF, SV_STAFF_DETECT_ITEM },
1427 { TV_STAFF, SV_STAFF_DETECT_INVIS },
1428 { TV_STAFF, SV_STAFF_DETECT_EVIL },
1430 { TV_STAFF, SV_STAFF_TELEPORTATION },
1431 { TV_STAFF, SV_STAFF_TELEPORTATION },
1432 { TV_STAFF, SV_STAFF_TELEPORTATION },
1433 { TV_STAFF, SV_STAFF_TELEPORTATION },
1435 { TV_STAFF, SV_STAFF_IDENTIFY },
1436 { TV_STAFF, SV_STAFF_IDENTIFY },
1437 { TV_STAFF, SV_STAFF_IDENTIFY },
1439 { TV_STAFF, SV_STAFF_IDENTIFY },
1440 { TV_STAFF, SV_STAFF_REMOVE_CURSE },
1441 { TV_STAFF, SV_STAFF_CURE_LIGHT },
1442 { TV_STAFF, SV_STAFF_PROBING },
1446 { TV_SORCERY_BOOK, 0 },
1447 { TV_SORCERY_BOOK, 0 },
1448 { TV_SORCERY_BOOK, 1 },
1449 { TV_SORCERY_BOOK, 1 },
1451 { TV_ARCANE_BOOK, 0 },
1452 { TV_ARCANE_BOOK, 0 },
1453 { TV_ARCANE_BOOK, 1 },
1454 { TV_ARCANE_BOOK, 1 },
1456 { TV_ARCANE_BOOK, 2 },
1457 { TV_ARCANE_BOOK, 2 },
1458 { TV_ARCANE_BOOK, 3 },
1459 { TV_ARCANE_BOOK, 3 },
1464 /* Black Market (unused) */
1537 { TV_SORCERY_BOOK, 0 },
1538 { TV_SORCERY_BOOK, 0 },
1539 { TV_SORCERY_BOOK, 1 },
1540 { TV_SORCERY_BOOK, 1 },
1542 { TV_NATURE_BOOK, 0 },
1543 { TV_NATURE_BOOK, 0 },
1544 { TV_NATURE_BOOK, 1 },
1545 { TV_NATURE_BOOK, 1 },
1547 { TV_CHAOS_BOOK, 0 },
1548 { TV_CHAOS_BOOK, 0 },
1549 { TV_CHAOS_BOOK, 1 },
1550 { TV_CHAOS_BOOK, 1 },
1552 { TV_DEATH_BOOK, 0 },
1553 { TV_DEATH_BOOK, 0 },
1554 { TV_DEATH_BOOK, 1 },
1555 { TV_DEATH_BOOK, 1 },
1557 { TV_TRUMP_BOOK, 0 }, /* +16 */
1558 { TV_TRUMP_BOOK, 0 },
1559 { TV_TRUMP_BOOK, 1 },
1560 { TV_TRUMP_BOOK, 1 },
1562 { TV_ARCANE_BOOK, 0 },
1563 { TV_ARCANE_BOOK, 1 },
1564 { TV_ARCANE_BOOK, 2 },
1565 { TV_ARCANE_BOOK, 3 },
1567 { TV_CRAFT_BOOK, 0 },
1568 { TV_CRAFT_BOOK, 0 },
1569 { TV_CRAFT_BOOK, 1 },
1570 { TV_CRAFT_BOOK, 1 },
1572 { TV_DAEMON_BOOK, 0 },
1573 { TV_DAEMON_BOOK, 0 },
1574 { TV_DAEMON_BOOK, 1 },
1575 { TV_DAEMON_BOOK, 1 },
1577 { TV_MUSIC_BOOK, 0 },
1578 { TV_MUSIC_BOOK, 0 },
1579 { TV_MUSIC_BOOK, 1 },
1580 { TV_MUSIC_BOOK, 1 },
1589 /* Museum (unused) */
1628 * @brief 取引成功時の店主のメッセージ処理 /
1629 * Successful haggle.
1632 static void say_comment_1(void)
1635 /* ブラックマーケットのときは別のメッセージを出す */
1636 if ( cur_store_num == STORE_BLACK ) {
1637 msg_print(comment_1_B[randint0(MAX_COMMENT_1)]);
1640 msg_print(comment_1[randint0(MAX_COMMENT_1)]);
1643 msg_print(comment_1[randint0(MAX_COMMENT_1)]);
1647 if (one_in_(RUMOR_CHANCE))
1650 msg_print("店主は耳うちした:");
1652 msg_print("The shopkeeper whispers something into your ear:");
1654 display_rumor(TRUE);
1660 * @brief プレイヤーがアイテムを買う時の価格代案メッセージ処理 /
1661 * Continue haggling (player is buying)
1662 * @param value 店主の提示価格
1663 * @param annoyed 店主のいらつき度
1666 static void say_comment_2(PRICE value, int annoyed)
1670 /* Prepare a string to insert */
1671 sprintf(tmp_val, "%ld", (long)value);
1676 /* Formatted message */
1677 msg_format(comment_2a[randint0(MAX_COMMENT_2A)], tmp_val);
1683 /* Formatted message */
1685 /* ブラックマーケットの時は別のメッセージを出す */
1686 if ( cur_store_num == STORE_BLACK ){
1687 msg_format(comment_2b_B[randint0(MAX_COMMENT_2B)], tmp_val);
1690 msg_format(comment_2b[randint0(MAX_COMMENT_2B)], tmp_val);
1693 msg_format(comment_2b[randint0(MAX_COMMENT_2B)], tmp_val);
1701 * @brief プレイヤーがアイテムを売る時の価格代案メッセージ処理 /
1702 * Continue haggling (player is selling)
1703 * @param value 店主の提示価格
1704 * @param annoyed 店主のいらつき度
1707 static void say_comment_3(PRICE value, int annoyed)
1711 /* Prepare a string to insert */
1712 sprintf(tmp_val, "%ld", (long)value);
1717 /* Formatted message */
1718 msg_format(comment_3a[randint0(MAX_COMMENT_3A)], tmp_val);
1724 /* Formatted message */
1726 /* ブラックマーケットの時は別のメッセージを出す */
1727 if ( cur_store_num == STORE_BLACK ){
1728 msg_format(comment_3b_B[randint0(MAX_COMMENT_3B)], tmp_val);
1731 msg_format(comment_3b[randint0(MAX_COMMENT_3B)], tmp_val);
1734 msg_format(comment_3b[randint0(MAX_COMMENT_3B)], tmp_val);
1742 * @brief 店主がプレイヤーを追い出す時のメッセージ処理 /
1743 * Kick 'da bum out. -RAK-
1746 static void say_comment_4(void)
1749 /* ブラックマーケットの時は別のメッセージを出す */
1750 if ( cur_store_num == STORE_BLACK ){
1751 msg_print(comment_4a_B[randint0(MAX_COMMENT_4A)]);
1752 msg_print(comment_4b_B[randint0(MAX_COMMENT_4B)]);
1755 msg_print(comment_4a[randint0(MAX_COMMENT_4A)]);
1756 msg_print(comment_4b[randint0(MAX_COMMENT_4B)]);
1759 msg_print(comment_4a[randint0(MAX_COMMENT_4A)]);
1760 msg_print(comment_4b[randint0(MAX_COMMENT_4B)]);
1767 * @brief 店主がプレイヤーに取り合わない時のメッセージ処理 /
1768 * You are insulting me
1771 static void say_comment_5(void)
1774 /* ブラックマーケットの時は別のメッセージを出す */
1775 if ( cur_store_num == STORE_BLACK ){
1776 msg_print(comment_5_B[randint0(MAX_COMMENT_5)]);
1779 msg_print(comment_5[randint0(MAX_COMMENT_5)]);
1782 msg_print(comment_5[randint0(MAX_COMMENT_5)]);
1789 * @brief 店主がプレイヤーの提示を理解できなかった時のメッセージ処理 /
1790 * That makes no sense.
1793 static void say_comment_6(void)
1795 msg_print(comment_6[randint0(MAX_COMMENT_6)]);
1799 #define MAX_COMMENT_7A 4
1801 static concptr comment_7a[MAX_COMMENT_7A] =
1806 "誰かがむせび泣く声が聞こえる...。",
1811 "You hear someone sobbing...",
1812 "The shopkeeper howls in agony!"
1817 #define MAX_COMMENT_7B 4
1819 static concptr comment_7b[MAX_COMMENT_7B] =
1829 "The shopkeeper curses at you.",
1830 "The shopkeeper glares at you."
1835 #define MAX_COMMENT_7C 4
1837 static concptr comment_7c[MAX_COMMENT_7C] =
1846 "You've made my day!",
1847 "The shopkeeper giggles.",
1848 "The shopkeeper laughs loudly."
1853 #define MAX_COMMENT_7D 4
1855 static concptr comment_7d[MAX_COMMENT_7D] =
1859 "こんなおいしい思いをしたら、真面目に働けなくなるなぁ。",
1864 "I think I'll retire!",
1865 "The shopkeeper jumps for joy.",
1866 "The shopkeeper smiles gleefully."
1873 * @brief 店主が交渉を終えた際の反応を返す処理 /
1874 * Let a shop-keeper React to a purchase
1875 * @param price アイテムの取引額
1876 * @param value アイテムの実際価値
1877 * @param guess 店主が当初予想していた価値
1880 * We paid "price", it was worth "value", and we thought it was worth "guess"
1882 static void purchase_analyze(PRICE price, PRICE value, PRICE guess)
1884 /* Item was worthless, but we bought it */
1885 if ((value <= 0) && (price > value))
1887 msg_print(comment_7a[randint0(MAX_COMMENT_7A)]);
1888 chg_virtue(V_HONOUR, -1);
1889 chg_virtue(V_JUSTICE, -1);
1890 sound(SOUND_STORE1);
1893 /* Item was cheaper than we thought, and we paid more than necessary */
1894 else if ((value < guess) && (price > value))
1896 msg_print(comment_7b[randint0(MAX_COMMENT_7B)]);
1897 chg_virtue(V_JUSTICE, -1);
1898 if (one_in_(4)) chg_virtue(V_HONOUR, -1);
1899 sound(SOUND_STORE2);
1902 /* Item was a good bargain, and we got away with it */
1903 else if ((value > guess) && (value < (4 * guess)) && (price < value))
1905 msg_print(comment_7c[randint0(MAX_COMMENT_7C)]);
1906 if (one_in_(4)) chg_virtue(V_HONOUR, -1);
1907 else if (one_in_(4)) chg_virtue(V_HONOUR, 1);
1908 sound(SOUND_STORE3);
1911 /* Item was a great bargain, and we got away with it */
1912 else if ((value > guess) && (price < value))
1914 msg_print(comment_7d[randint0(MAX_COMMENT_7D)]);
1915 if (one_in_(2)) chg_virtue(V_HONOUR, -1);
1916 if (one_in_(4)) chg_virtue(V_HONOUR, 1);
1917 if (10 * price < value) chg_virtue(V_SACRIFICE, 1);
1918 sound(SOUND_STORE4);
1925 * We store the current "store feat" here so everyone can access it
1927 static int cur_store_feat;
1931 * Buying and selling adjustments for race combinations.
1932 * Entry[owner][player] gives the basic "cost inflation".
1934 static byte rgold_adj[MAX_RACES][MAX_RACES] =
1936 /*Hum, HfE, Elf, Hal, Gno, Dwa, HfO, HfT, Dun, HiE, Barbarian,
1937 HfOg, HGn, HTn, Cyc, Yek, Klc, Kbd, Nbl, DkE, Drc, Mind Flayer,
1938 Imp, Glm, Skl, Zombie, Vampire, Spectre, Fairy, Beastman, Ent,
1939 Angel, Demon, Kutar, Android, Merfolk */
1942 { 100, 105, 105, 110, 113, 115, 120, 125, 100, 105, 100,
1943 124, 120, 110, 125, 115, 120, 120, 120, 120, 115, 120,
1944 115, 105, 125, 125, 125, 125, 105, 120, 105, 95, 140,
1945 100, 120, 110, 105, 110 },
1948 { 110, 100, 100, 105, 110, 120, 125, 130, 110, 100, 110,
1949 120, 115, 108, 115, 110, 110, 120, 120, 115, 115, 110,
1950 120, 110, 110, 110, 120, 110, 100, 125, 100, 95, 140,
1951 110, 115, 110, 110, 110 },
1954 { 110, 105, 100, 105, 110, 120, 125, 130, 110, 100, 110,
1955 120, 120, 105, 120, 110, 105, 125, 125, 110, 115, 108,
1956 120, 115, 110, 110, 120, 110, 100, 125, 100, 95, 140,
1957 110, 110, 105, 110, 110 },
1960 { 115, 110, 105, 95, 105, 110, 115, 130, 115, 105, 115,
1961 125, 120, 120, 125, 115, 110, 120, 120, 120, 115, 115,
1962 120, 110, 120, 120, 130, 110, 110, 130, 110, 95, 140,
1963 115, 120, 105, 115, 105 },
1966 { 115, 115, 110, 105, 95, 110, 115, 130, 115, 110, 115,
1967 120, 125, 110, 120, 110, 105, 120, 110, 110, 105, 110,
1968 120, 101, 110, 110, 120, 120, 115, 130, 115, 95, 140,
1969 115, 110, 110, 115, 110 },
1972 { 115, 120, 120, 110, 110, 95, 125, 135, 115, 120, 115,
1973 125, 140, 130, 130, 120, 115, 115, 115, 135, 125, 120,
1974 120, 105, 115, 115, 115, 115, 120, 130, 120, 95, 140,
1975 115, 110, 115, 115, 120 },
1978 { 115, 120, 125, 115, 115, 130, 110, 115, 115, 125, 115,
1979 110, 110, 120, 110, 120, 125, 115, 115, 110, 120, 110,
1980 115, 125, 120, 120, 115, 120, 125, 115, 125, 95, 140,
1981 115, 110, 115, 115, 125 },
1984 { 110, 115, 115, 110, 110, 130, 110, 110, 110, 115, 110,
1985 110, 115, 120, 110, 120, 120, 110, 110, 110, 115, 110,
1986 110, 115, 112, 112, 115, 112, 120, 110, 120, 95, 140,
1987 110, 110, 115, 110, 130 },
1990 { 100, 105, 105, 110, 113, 115, 120, 125, 100, 105, 100,
1991 120, 120, 105, 120, 115, 105, 115, 120, 110, 105, 105,
1992 120, 105, 120, 120, 125, 120, 105, 135, 105, 95, 140,
1993 100, 110, 110, 100, 110 },
1996 { 110, 105, 100, 105, 110, 120, 125, 130, 110, 100, 110,
1997 125, 125, 101, 120, 115, 110, 115, 125, 110, 110, 110,
1998 125, 115, 120, 120, 125, 120, 100, 125, 100, 95, 140,
1999 110, 110, 105, 110, 110 },
2001 /* Human / Barbarian (copied from human) */
2002 { 100, 105, 105, 110, 113, 115, 120, 125, 100, 105, 100,
2003 124, 120, 110, 125, 115, 120, 120, 120, 120, 115, 120,
2004 115, 105, 125, 125, 130, 125, 115, 120, 115, 95, 140,
2005 100, 120, 110, 100, 110 },
2007 /* Half-Ogre: theoretical, copied from half-troll */
2008 { 110, 115, 115, 110, 110, 130, 110, 110, 110, 115, 110,
2009 110, 115, 120, 110, 120, 120, 110, 110, 110, 115, 110,
2010 110, 115, 112, 112, 115, 112, 120, 110, 120, 95, 140,
2011 110, 110, 115, 110, 120 },
2013 /* Half-Giant: theoretical, copied from half-troll */
2014 { 110, 115, 115, 110, 110, 130, 110, 110, 110, 115, 110,
2015 110, 115, 120, 110, 120, 120, 110, 110, 110, 115, 110,
2016 110, 115, 112, 112, 115, 112, 130, 120, 130, 95, 140,
2017 110, 110, 115, 110, 115 },
2019 /* Half-Titan: theoretical, copied from High_Elf */
2020 { 110, 105, 100, 105, 110, 120, 125, 130, 110, 100, 110,
2021 125, 125, 101, 120, 115, 110, 115, 125, 110, 110, 110,
2022 125, 115, 120, 120, 120, 120, 130, 130, 130, 95, 140,
2023 110, 110, 115, 110, 108 },
2025 /* Cyclops: theoretical, copied from half-troll */
2026 { 110, 115, 115, 110, 110, 130, 110, 110, 110, 115, 110,
2027 110, 115, 120, 110, 120, 120, 110, 110, 110, 115, 110,
2028 110, 115, 112, 112, 115, 112, 130, 130, 130, 95, 140,
2029 110, 110, 115, 110, 115 },
2031 /* Yeek: theoretical, copied from Half-Orc */
2032 { 115, 120, 125, 115, 115, 130, 110, 115, 115, 125, 115,
2033 110, 110, 120, 110, 120, 125, 115, 115, 110, 120, 110,
2034 115, 125, 120, 120, 120, 120, 130, 130, 130, 95, 140,
2035 115, 110, 115, 115, 110 },
2037 /* Klackon: theoretical, copied from Gnome */
2038 { 115, 115, 110, 105, 95, 110, 115, 130, 115, 110, 115,
2039 120, 125, 110, 120, 110, 105, 120, 110, 110, 105, 110,
2040 120, 101, 110, 110, 120, 120, 130, 130, 130, 95, 140,
2041 115, 110, 115, 115, 110 },
2043 /* Kobold: theoretical, copied from Half-Orc */
2044 { 115, 120, 125, 115, 115, 130, 110, 115, 115, 125, 115,
2045 110, 110, 120, 110, 120, 125, 115, 115, 110, 120, 110,
2046 115, 125, 120, 120, 120, 120, 130, 130, 130, 95, 140,
2047 115, 110, 115, 115, 120 },
2049 /* Nibelung: theoretical, copied from Dwarf */
2050 { 115, 120, 120, 110, 110, 95, 125, 135, 115, 120, 115,
2051 125, 140, 130, 130, 120, 115, 115, 115, 135, 125, 120,
2052 120, 105, 115, 115, 120, 120, 130, 130, 130, 95, 140,
2053 115, 135, 115, 115, 120 },
2056 { 110, 110, 110, 115, 120, 130, 115, 115, 120, 110, 115,
2057 115, 115, 116, 115, 120, 120, 115, 115, 101, 110, 110,
2058 110, 110, 112, 122, 110, 110, 110, 115, 110, 120, 120,
2059 110, 101, 115, 110, 115 },
2061 /* Draconian: theoretical, copied from High_Elf */
2062 { 110, 105, 100, 105, 110, 120, 125, 130, 110, 100, 110,
2063 125, 125, 101, 120, 115, 110, 115, 125, 110, 110, 110,
2064 125, 115, 120, 120, 120, 120, 130, 130, 130, 95, 140,
2065 110, 110, 115, 110, 115 },
2067 /* Mind Flayer: theoretical, copied from High_Elf */
2068 { 110, 105, 100, 105, 110, 120, 125, 130, 110, 100, 110,
2069 125, 125, 101, 120, 115, 110, 115, 125, 110, 110, 110,
2070 125, 115, 120, 120, 120, 120, 130, 130, 130, 95, 140,
2071 110, 110, 115, 110, 110 },
2073 /* Imp: theoretical, copied from High_Elf */
2074 { 110, 105, 100, 105, 110, 120, 125, 130, 110, 100, 110,
2075 125, 125, 101, 120, 115, 110, 115, 125, 110, 110, 110,
2076 125, 115, 120, 120, 120, 120, 130, 130, 130, 120, 120,
2077 110, 110, 115, 110, 120 },
2079 /* Golem: theoretical, copied from High_Elf */
2080 { 110, 105, 100, 105, 110, 120, 125, 130, 110, 100, 110,
2081 125, 125, 101, 120, 115, 110, 115, 125, 110, 110, 110,
2082 125, 115, 120, 120, 120, 120, 130, 130, 130, 95, 140,
2083 110, 110, 115, 110, 110 },
2085 /* Skeleton: theoretical, copied from half-orc */
2086 { 115, 120, 125, 115, 115, 130, 110, 115, 115, 125, 115,
2087 110, 110, 120, 110, 120, 125, 115, 115, 110, 120, 110,
2088 115, 125, 120, 120, 120, 120, 130, 130, 130, 120, 120,
2089 115, 110, 125, 115, 110 },
2091 /* Zombie: Theoretical, copied from half-orc */
2092 { 115, 120, 125, 115, 115, 130, 110, 115, 115, 125, 115,
2093 110, 110, 120, 110, 120, 125, 115, 115, 110, 120, 110,
2094 115, 125, 120, 120, 120, 120, 130, 130, 130, 120, 120,
2095 115, 110, 125, 115, 110 },
2097 /* Vampire: Theoretical, copied from half-orc */
2098 { 115, 120, 125, 115, 115, 130, 110, 115, 115, 125, 115,
2099 110, 110, 120, 110, 120, 125, 115, 115, 110, 120, 110,
2100 115, 125, 120, 120, 120, 120, 130, 130, 130, 120, 120,
2101 115, 110, 125, 115, 120 },
2103 /* Spectre: Theoretical, copied from half-orc */
2104 { 115, 120, 125, 115, 115, 130, 110, 115, 115, 125, 115,
2105 110, 110, 120, 110, 120, 125, 115, 115, 110, 120, 110,
2106 115, 125, 120, 120, 120, 120, 130, 130, 130, 120, 120,
2107 115, 110, 125, 115, 110 },
2109 /* Sprite: Theoretical, copied from half-orc */
2110 { 115, 120, 125, 115, 115, 130, 110, 115, 115, 125, 115,
2111 110, 110, 120, 110, 120, 125, 115, 115, 110, 120, 110,
2112 115, 125, 120, 120, 120, 120, 130, 130, 130, 95, 140,
2113 115, 110, 105, 115, 110 },
2115 /* Beastman: Theoretical, copied from half-orc */
2116 { 115, 120, 125, 115, 115, 130, 110, 115, 115, 125, 115,
2117 110, 110, 120, 110, 120, 125, 115, 115, 110, 120, 110,
2118 115, 125, 120, 120, 120, 120, 130, 130, 130, 95, 140,
2119 115, 110, 115, 115, 125 },
2122 { 110, 105, 100, 105, 110, 120, 125, 130, 110, 100, 110,
2123 120, 120, 105, 120, 110, 105, 125, 125, 110, 115, 108,
2124 120, 115, 110, 110, 120, 110, 100, 125, 100, 95, 140,
2125 110, 110, 105, 110, 110 },
2128 { 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95,
2129 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95,
2130 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 160,
2131 95, 95, 95, 95, 95 },
2134 { 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, 140,
2135 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, 140,
2136 140, 140, 140, 140, 140, 140, 140, 140, 140, 160, 120,
2137 140, 140, 140, 140, 140 },
2140 { 100, 105, 105, 110, 113, 115, 120, 125, 100, 105, 100,
2141 124, 120, 110, 125, 115, 120, 120, 120, 120, 115, 120,
2142 115, 105, 125, 125, 125, 125, 105, 120, 105, 95, 140,
2143 100, 120, 110, 100, 110 },
2146 { 110, 110, 110, 115, 120, 130, 115, 115, 120, 110, 115,
2147 115, 115, 116, 115, 120, 120, 115, 115, 101, 110, 110,
2148 110, 110, 112, 122, 110, 110, 110, 115, 110, 120, 120,
2149 110, 101, 115, 110, 115 },
2152 { 110, 110, 105, 105, 110, 115, 115, 115, 110, 105, 110,
2153 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115,
2154 115, 115, 125, 125, 125, 125, 105, 115, 105, 95, 140,
2155 110, 115, 100, 110, 110 },
2158 { 105, 105, 105, 110, 113, 115, 120, 125, 100, 105, 100,
2159 124, 120, 110, 125, 115, 120, 120, 120, 120, 115, 120,
2160 115, 105, 125, 125, 125, 125, 105, 120, 105, 95, 140,
2161 100, 120, 110, 100, 110 },
2164 { 110, 110, 110, 105, 110, 120, 125, 130, 110, 110, 110,
2165 120, 115, 108, 115, 110, 110, 120, 120, 115, 115, 110,
2166 120, 110, 110, 110, 120, 110, 110, 125, 110, 95, 140,
2167 110, 115, 110, 110, 100 },
2173 * @brief 店舗価格を決定する /
2174 * Determine the price of an item (qty one) in a store.
2175 * @param o_ptr 店舗に並べるオブジェクト構造体の参照ポインタ
2176 * @param greed 店主の強欲度
2177 * @param flip TRUEならば店主にとっての買取価格、FALSEなら売出価格を計算
2181 * This function takes into account the player's charisma, and the
2182 * shop-keepers friendliness, and the shop-keeper's base greed, but
2183 * never lets a shop-keeper lose money in a transaction.
2184 * The "greed" value should exceed 100 when the player is "buying" the
2185 * item, and should be less than 100 when the player is "selling" it.
2186 * Hack -- the black market always charges twice as much as it should.
2187 * Charisma adjustment runs from 80 to 130
2188 * Racial adjustment runs from 95 to 130
2189 * Since greed/charisma/racial adjustments are centered at 100, we need
2190 * to adjust (by 200) to extract a usable multiplier. Note that the
2191 * "greed" value is always something (?).
2194 static s32b price_item(object_type *o_ptr, int greed, bool flip)
2201 /* Get the value of one of the items */
2202 price = object_value(o_ptr);
2204 /* Worthless items */
2205 if (price <= 0) return (0L);
2208 /* Compute the racial factor */
2209 factor = rgold_adj[ot_ptr->owner_race][p_ptr->prace];
2211 /* Add in the charisma factor */
2212 factor += adj_chr_gold[p_ptr->stat_ind[A_CHR]];
2215 /* Shop is buying */
2218 /* Adjust for greed */
2219 adjust = 100 + (300 - (greed + factor));
2221 /* Never get "silly" */
2222 if (adjust > 100) adjust = 100;
2224 /* Mega-Hack -- Black market sucks */
2225 if (cur_store_num == STORE_BLACK)
2228 /* Compute the final price (with rounding) */
2229 /* Hack -- prevent underflow */
2230 price = (price * adjust + 50L) / 100L;
2233 /* Shop is selling */
2236 /* Adjust for greed */
2237 adjust = 100 + ((greed + factor) - 300);
2239 /* Never get "silly" */
2240 if (adjust < 100) adjust = 100;
2242 /* Mega-Hack -- Black market sucks */
2243 if (cur_store_num == STORE_BLACK)
2246 /* Compute the final price (with rounding) */
2247 /* Hack -- prevent overflow */
2248 price = (s32b)(((u32b)price * (u32b)adjust + 50UL) / 100UL);
2251 /* Note -- Never become "free" */
2252 if (price <= 0L) return (1L);
2254 /* Return the price */
2260 * @brief 安価な消耗品の販売数を増やし、低確率で割引にする /
2261 * Certain "cheap" objects should be created in "piles"
2262 * @param o_ptr 店舗に並べるオブジェクト構造体の参照ポインタ
2266 * Some objects can be sold at a "discount" (in small piles)
2269 static void mass_produce(object_type *o_ptr)
2272 DISCOUNT_RATE discount = 0;
2274 PRICE cost = object_value(o_ptr);
2277 /* Analyze the type */
2278 switch (o_ptr->tval)
2280 /* Food, Flasks, and Lites */
2285 if (cost <= 5L) size += damroll(3, 5);
2286 if (cost <= 20L) size += damroll(3, 5);
2287 if (cost <= 50L) size += damroll(2, 2);
2294 if (cost <= 60L) size += damroll(3, 5);
2295 if (cost <= 240L) size += damroll(1, 5);
2296 if (o_ptr->sval == SV_SCROLL_STAR_IDENTIFY) size += damroll(3, 5);
2297 if (o_ptr->sval == SV_SCROLL_STAR_REMOVE_CURSE) size += damroll(1, 4);
2302 case TV_SORCERY_BOOK:
2303 case TV_NATURE_BOOK:
2307 case TV_ARCANE_BOOK:
2309 case TV_DAEMON_BOOK:
2310 case TV_CRUSADE_BOOK:
2312 case TV_HISSATSU_BOOK:
2315 if (cost <= 50L) size += damroll(2, 3);
2316 if (cost <= 500L) size += damroll(1, 3);
2334 if (object_is_artifact(o_ptr)) break;
2335 if (object_is_ego(o_ptr)) break;
2336 if (cost <= 10L) size += damroll(3, 5);
2337 if (cost <= 100L) size += damroll(3, 5);
2346 if (cost <= 5L) size += damroll(5, 5);
2347 if (cost <= 50L) size += damroll(5, 5);
2348 if (cost <= 500L) size += damroll(5, 5);
2354 if (cost <= 100L) size += damroll(2, 2);
2355 if (cost <= 1000L) size += damroll(2, 2);
2368 * Because many rods (and a few wands and staffs) are useful mainly
2369 * in quantity, the Black Market will occasionally have a bunch of
2376 if ((cur_store_num == STORE_BLACK) && one_in_(3))
2378 if (cost < 1601L) size += damroll(1, 5);
2379 else if (cost < 3201L) size += damroll(1, 3);
2386 /* Pick a discount */
2391 else if (one_in_(25))
2395 else if (one_in_(150))
2399 else if (one_in_(300))
2403 else if (one_in_(500))
2408 if (o_ptr->art_name)
2413 /* Save the discount */
2414 o_ptr->discount = discount;
2416 /* Save the total pile size */
2417 o_ptr->number = size - (size * discount / 100);
2419 /* Ensure that mass-produced rods and wands get the correct pvals. */
2420 if ((o_ptr->tval == TV_ROD) || (o_ptr->tval == TV_WAND))
2422 o_ptr->pval *= (PARAMETER_VALUE)o_ptr->number;
2429 * @brief 店舗に並べた品を同一品であるかどうか判定する /
2430 * Determine if a store item can "absorb" another item
2431 * @param o_ptr 判定するオブジェクト構造体の参照ポインタ1
2432 * @param j_ptr 判定するオブジェクト構造体の参照ポインタ2
2433 * @return 同一扱いできるならTRUEを返す
2436 * See "object_similar()" for the same function for the "player"
2439 static bool store_object_similar(object_type *o_ptr, object_type *j_ptr)
2443 /* Hack -- Identical items cannot be stacked */
2444 if (o_ptr == j_ptr) return (0);
2446 /* Different objects cannot be stacked */
2447 if (o_ptr->k_idx != j_ptr->k_idx) return (0);
2449 /* Different charges (etc) cannot be stacked, unless wands or rods. */
2450 if ((o_ptr->pval != j_ptr->pval) && (o_ptr->tval != TV_WAND) && (o_ptr->tval != TV_ROD)) return (0);
2452 /* Require many identical values */
2453 if (o_ptr->to_h != j_ptr->to_h) return (0);
2454 if (o_ptr->to_d != j_ptr->to_d) return (0);
2455 if (o_ptr->to_a != j_ptr->to_a) return (0);
2457 /* Require identical "ego-item" names */
2458 if (o_ptr->name2 != j_ptr->name2) return (0);
2460 /* Artifacts don't stack! */
2461 if (object_is_artifact(o_ptr) || object_is_artifact(j_ptr)) return (0);
2463 /* Hack -- Identical art_flags! */
2464 for (i = 0; i < TR_FLAG_SIZE; i++)
2465 if (o_ptr->art_flags[i] != j_ptr->art_flags[i]) return (0);
2467 /* Hack -- Never stack "powerful" items */
2468 if (o_ptr->xtra1 || j_ptr->xtra1) return (0);
2470 /* Hack -- Never stack recharging items */
2471 if (o_ptr->timeout || j_ptr->timeout) return (0);
2473 /* Require many identical values */
2474 if (o_ptr->ac != j_ptr->ac) return (0);
2475 if (o_ptr->dd != j_ptr->dd) return (0);
2476 if (o_ptr->ds != j_ptr->ds) return (0);
2478 /* Hack -- Never stack chests */
2479 if (o_ptr->tval == TV_CHEST) return (0);
2480 if (o_ptr->tval == TV_STATUE) return (0);
2481 if (o_ptr->tval == TV_CAPTURE) return (0);
2483 /* Require matching discounts */
2484 if (o_ptr->discount != j_ptr->discount) return (0);
2486 /* They match, so they must be similar */
2492 * @brief 店舗に並べた品を重ね合わせできるかどうか判定する /
2493 * Allow a store item to absorb another item
2494 * @param o_ptr 判定するオブジェクト構造体の参照ポインタ1
2495 * @param j_ptr 判定するオブジェクト構造体の参照ポインタ2
2496 * @return 重ね合わせできるならTRUEを返す
2499 * See "object_similar()" for the same function for the "player"
2502 static void store_object_absorb(object_type *o_ptr, object_type *j_ptr)
2504 int max_num = (o_ptr->tval == TV_ROD) ?
2505 MIN(99, MAX_SHORT / k_info[o_ptr->k_idx].pval) : 99;
2506 int total = o_ptr->number + j_ptr->number;
2507 int diff = (total > max_num) ? total - max_num : 0;
2509 /* Combine quantity, lose excess items */
2510 o_ptr->number = (total > max_num) ? max_num : total;
2512 /* Hack -- if rods are stacking, add the pvals (maximum timeouts) together. -LM- */
2513 if (o_ptr->tval == TV_ROD)
2515 o_ptr->pval += j_ptr->pval * (j_ptr->number - diff) / j_ptr->number;
2518 /* Hack -- if wands are stacking, combine the charges. -LM- */
2519 if (o_ptr->tval == TV_WAND)
2521 o_ptr->pval += j_ptr->pval * (j_ptr->number - diff) / j_ptr->number;
2527 * @brief 店舗に品を置くスペースがあるかどうかの判定を返す /
2528 * Check to see if the shop will be carrying too many objects -RAK-
2529 * @param o_ptr 店舗に置きたいオブジェクト構造体の参照ポインタ
2530 * @return 置き場がないなら0、重ね合わせできるアイテムがあるなら-1、スペースがあるなら1を返す。
2533 * Note that the shop, just like a player, will not accept things
2534 * it cannot hold. Before, one could "nuke" potions this way.
2535 * Return value is now int:
2537 * -1 : Can be combined to existing slot.
2538 * 1 : Cannot be combined but there are empty spaces.
2541 static int store_check_num(object_type *o_ptr)
2546 /* The "home" acts like the player */
2547 if ((cur_store_num == STORE_HOME) || (cur_store_num == STORE_MUSEUM))
2549 bool old_stack_force_notes = stack_force_notes;
2550 bool old_stack_force_costs = stack_force_costs;
2552 if (cur_store_num != STORE_HOME)
2554 stack_force_notes = FALSE;
2555 stack_force_costs = FALSE;
2558 /* Check all the items */
2559 for (i = 0; i < st_ptr->stock_num; i++)
2561 /* Get the existing item */
2562 j_ptr = &st_ptr->stock[i];
2564 /* Can the new object be combined with the old one? */
2565 if (object_similar(j_ptr, o_ptr))
2567 if (cur_store_num != STORE_HOME)
2569 stack_force_notes = old_stack_force_notes;
2570 stack_force_costs = old_stack_force_costs;
2577 if (cur_store_num != STORE_HOME)
2579 stack_force_notes = old_stack_force_notes;
2580 stack_force_costs = old_stack_force_costs;
2584 /* Normal stores do special stuff */
2587 /* Check all the items */
2588 for (i = 0; i < st_ptr->stock_num; i++)
2590 /* Get the existing item */
2591 j_ptr = &st_ptr->stock[i];
2593 /* Can the new object be combined with the old one? */
2594 if (store_object_similar(j_ptr, o_ptr)) return -1;
2598 /* Free space is always usable */
2600 * オプション powerup_home が設定されていると
2603 if ((cur_store_num == STORE_HOME) && ( powerup_home == FALSE )) {
2604 if (st_ptr->stock_num < ((st_ptr->stock_size) / 10)) {
2609 if (st_ptr->stock_num < st_ptr->stock_size) {
2614 /* But there was no room at the inn... */
2619 * @brief オブジェクトが祝福されているかの判定を返す /
2620 * @param o_ptr 判定したいオブジェクト構造体の参照ポインタ
2621 * @return アイテムが祝福されたアイテムならばTRUEを返す
2623 static bool is_blessed(object_type *o_ptr)
2625 BIT_FLAGS flgs[TR_FLAG_SIZE];
2626 object_flags(o_ptr, flgs);
2627 if (have_flag(flgs, TR_BLESSED)) return (TRUE);
2628 else return (FALSE);
2634 * @brief オブジェクトが所定の店舗で引き取れるかどうかを返す /
2635 * Determine if the current store will purchase the given item
2636 * @param o_ptr 判定したいオブジェクト構造体の参照ポインタ
2637 * @return アイテムが買い取れるならばTRUEを返す
2639 * Note that a shop-keeper must refuse to buy "worthless" items
2641 static bool store_will_buy(object_type *o_ptr)
2643 /* Hack -- The Home is simple */
2644 if ((cur_store_num == STORE_HOME) || (cur_store_num == STORE_MUSEUM)) return (TRUE);
2646 /* Switch on the store */
2647 switch (cur_store_num)
2652 /* Analyze the type */
2653 switch (o_ptr->tval)
2656 if (o_ptr->sval != SV_POTION_WATER) return FALSE;
2668 case TV_BOTTLE: /* 'Green', recycling Angband */
2683 /* Analyze the type */
2684 switch (o_ptr->tval)
2705 /* Analyze the type */
2706 switch (o_ptr->tval)
2715 case TV_HISSATSU_BOOK:
2719 if(o_ptr->sval == SV_WIZSTAFF) return (FALSE);
2731 /* Analyze the type */
2732 switch (o_ptr->tval)
2735 case TV_CRUSADE_BOOK:
2745 monster_race *r_ptr = &r_info[o_ptr->pval];
2748 if (!(r_ptr->flags3 & RF3_EVIL))
2751 if (r_ptr->flags3 & RF3_GOOD) break;
2753 /* Accept animals */
2754 if (r_ptr->flags3 & RF3_ANIMAL) break;
2757 if (my_strchr("?!", r_ptr->d_char)) break;
2763 if (is_blessed(o_ptr)) break;
2772 case STORE_ALCHEMIST:
2774 /* Analyze the type */
2775 switch (o_ptr->tval)
2789 /* Analyze the type */
2790 switch (o_ptr->tval)
2792 case TV_SORCERY_BOOK:
2793 case TV_NATURE_BOOK:
2797 case TV_ARCANE_BOOK:
2799 case TV_DAEMON_BOOK:
2813 if(o_ptr->sval == SV_WIZSTAFF) break;
2814 else return (FALSE);
2821 /* Bookstore Shop */
2824 /* Analyze the type */
2825 switch (o_ptr->tval)
2827 case TV_SORCERY_BOOK:
2828 case TV_NATURE_BOOK:
2833 case TV_ARCANE_BOOK:
2835 case TV_DAEMON_BOOK:
2836 case TV_CRUSADE_BOOK:
2847 /* Ignore "worthless" items */
2848 if (object_value(o_ptr) <= 0) return (FALSE);
2856 * @brief 現在の町の指定された店舗のアイテムを整理する /
2857 * Combine and reorder items in store.
2858 * @param store_num 店舗ID
2859 * @return 実際に整理が行われたならばTRUEを返す。
2861 bool combine_and_reorder_home(int store_num)
2865 object_type forge, *o_ptr, *j_ptr;
2866 bool flag = FALSE, combined;
2867 store_type *old_st_ptr = st_ptr;
2868 bool old_stack_force_notes = stack_force_notes;
2869 bool old_stack_force_costs = stack_force_costs;
2871 st_ptr = &town_info[1].store[store_num];
2872 if (store_num != STORE_HOME)
2874 stack_force_notes = FALSE;
2875 stack_force_costs = FALSE;
2882 /* Combine the items in the home (backwards) */
2883 for (i = st_ptr->stock_num - 1; i > 0; i--)
2885 o_ptr = &st_ptr->stock[i];
2887 /* Skip empty items */
2888 if (!o_ptr->k_idx) continue;
2890 /* Scan the items above that item */
2891 for (j = 0; j < i; j++)
2895 j_ptr = &st_ptr->stock[j];
2897 /* Skip empty items */
2898 if (!j_ptr->k_idx) continue;
2901 * Get maximum number of the stack if these
2902 * are similar, get zero otherwise.
2904 max_num = object_similar_part(j_ptr, o_ptr);
2906 /* Can we (partialy) drop "o_ptr" onto "j_ptr"? */
2907 if (max_num && j_ptr->number < max_num)
2909 if (o_ptr->number + j_ptr->number <= max_num)
2911 /* Add together the item counts */
2912 object_absorb(j_ptr, o_ptr);
2914 /* One object is gone */
2915 st_ptr->stock_num--;
2917 /* Slide everything down */
2918 for (k = i; k < st_ptr->stock_num; k++)
2920 /* Structure copy */
2921 st_ptr->stock[k] = st_ptr->stock[k + 1];
2924 /* Erase the "final" slot */
2925 object_wipe(&st_ptr->stock[k]);
2929 ITEM_NUMBER old_num = o_ptr->number;
2930 ITEM_NUMBER remain = j_ptr->number + o_ptr->number - max_num;
2932 /* Add together the item counts */
2933 object_absorb(j_ptr, o_ptr);
2935 o_ptr->number = remain;
2937 /* Hack -- if rods are stacking, add the pvals (maximum timeouts) and current timeouts together. -LM- */
2938 if (o_ptr->tval == TV_ROD)
2940 o_ptr->pval = o_ptr->pval * remain / old_num;
2941 o_ptr->timeout = o_ptr->timeout * remain / old_num;
2944 /* Hack -- if wands are stacking, combine the charges. -LM- */
2945 else if (o_ptr->tval == TV_WAND)
2947 o_ptr->pval = o_ptr->pval * remain / old_num;
2962 /* Re-order the items in the home (forwards) */
2963 for (i = 0; i < st_ptr->stock_num; i++)
2965 o_ptr = &st_ptr->stock[i];
2967 /* Skip empty slots */
2968 if (!o_ptr->k_idx) continue;
2970 /* Get the "value" of the item */
2971 o_value = object_value(o_ptr);
2973 /* Scan every occupied slot */
2974 for (j = 0; j < st_ptr->stock_num; j++)
2976 if (object_sort_comp(o_ptr, o_value, &st_ptr->stock[j])) break;
2979 /* Never move down */
2980 if (j >= i) continue;
2986 /* Save a copy of the moving item */
2987 object_copy(j_ptr, &st_ptr->stock[i]);
2989 /* Slide the objects */
2990 for (k = i; k > j; k--)
2992 /* Slide the item */
2993 object_copy(&st_ptr->stock[k], &st_ptr->stock[k - 1]);
2996 /* Insert the moving item */
2997 object_copy(&st_ptr->stock[j], j_ptr);
3000 st_ptr = old_st_ptr;
3001 if (store_num != STORE_HOME)
3003 stack_force_notes = old_stack_force_notes;
3004 stack_force_costs = old_stack_force_costs;
3012 * @brief 我が家にオブジェクトを加える /
3013 * Add the item "o_ptr" to the p_ptr->inventory_list of the "Home"
3014 * @param o_ptr 加えたいオブジェクトの構造体参照ポインタ
3018 * In all cases, return the slot (or -1) where the object was placed
3019 * Note that this is a hacked up version of "inven_carry()".
3020 * Also note that it may not correctly "adapt" to "knowledge" bacoming
3021 * known, the player may have to pick stuff up and drop it again.
3024 static int home_carry(object_type *o_ptr)
3030 bool old_stack_force_notes = stack_force_notes;
3031 bool old_stack_force_costs = stack_force_costs;
3033 if (cur_store_num != STORE_HOME)
3035 stack_force_notes = FALSE;
3036 stack_force_costs = FALSE;
3039 /* Check each existing item (try to combine) */
3040 for (slot = 0; slot < st_ptr->stock_num; slot++)
3042 /* Get the existing item */
3043 j_ptr = &st_ptr->stock[slot];
3045 /* The home acts just like the player */
3046 if (object_similar(j_ptr, o_ptr))
3048 /* Save the new number of items */
3049 object_absorb(j_ptr, o_ptr);
3051 if (cur_store_num != STORE_HOME)
3053 stack_force_notes = old_stack_force_notes;
3054 stack_force_costs = old_stack_force_costs;
3062 if (cur_store_num != STORE_HOME)
3064 stack_force_notes = old_stack_force_notes;
3065 stack_force_costs = old_stack_force_costs;
3070 * 隠し機能: オプション powerup_home が設定されていると
3074 if ((cur_store_num != STORE_HOME) || (powerup_home == TRUE)) {
3075 if (st_ptr->stock_num >= st_ptr->stock_size) {
3080 if (st_ptr->stock_num >= ((st_ptr->stock_size) / 10)) {
3086 /* Determine the "value" of the item */
3087 value = object_value(o_ptr);
3089 /* Check existing slots to see if we must "slide" */
3090 for (slot = 0; slot < st_ptr->stock_num; slot++)
3092 if (object_sort_comp(o_ptr, value, &st_ptr->stock[slot])) break;
3095 /* Slide the others up */
3096 for (i = st_ptr->stock_num; i > slot; i--)
3098 st_ptr->stock[i] = st_ptr->stock[i-1];
3101 /* More stuff now */
3102 st_ptr->stock_num++;
3104 /* Insert the new item */
3105 st_ptr->stock[slot] = *o_ptr;
3107 chg_virtue(V_SACRIFICE, -1);
3109 (void)combine_and_reorder_home(cur_store_num);
3111 /* Return the location */
3117 * @brief 店舗にオブジェクトを加える /
3118 * Add the item "o_ptr" to a real stores p_ptr->inventory_list.
3119 * @param o_ptr 加えたいオブジェクトの構造体参照ポインタ
3123 * In all cases, return the slot (or -1) where the object was placed
3124 * Note that this is a hacked up version of "inven_carry()".
3125 * Also note that it may not correctly "adapt" to "knowledge" bacoming
3126 * known, the player may have to pick stuff up and drop it again.
3129 static int store_carry(object_type *o_ptr)
3132 PRICE value, j_value;
3136 /* Evaluate the object */
3137 value = object_value(o_ptr);
3139 /* Cursed/Worthless items "disappear" when sold */
3140 if (value <= 0) return (-1);
3142 /* All store items are fully *identified* */
3143 o_ptr->ident |= IDENT_MENTAL;
3145 /* Erase the inscription */
3146 o_ptr->inscription = 0;
3148 /* Erase the "feeling" */
3149 o_ptr->feeling = FEEL_NONE;
3151 /* Check each existing item (try to combine) */
3152 for (slot = 0; slot < st_ptr->stock_num; slot++)
3154 /* Get the existing item */
3155 j_ptr = &st_ptr->stock[slot];
3157 /* Can the existing items be incremented? */
3158 if (store_object_similar(j_ptr, o_ptr))
3160 /* Hack -- extra items disappear */
3161 store_object_absorb(j_ptr, o_ptr);
3169 if (st_ptr->stock_num >= st_ptr->stock_size) return (-1);
3172 /* Check existing slots to see if we must "slide" */
3173 for (slot = 0; slot < st_ptr->stock_num; slot++)
3176 j_ptr = &st_ptr->stock[slot];
3178 /* Objects sort by decreasing type */
3179 if (o_ptr->tval > j_ptr->tval) break;
3180 if (o_ptr->tval < j_ptr->tval) continue;
3182 /* Objects sort by increasing sval */
3183 if (o_ptr->sval < j_ptr->sval) break;
3184 if (o_ptr->sval > j_ptr->sval) continue;
3187 * Hack: otherwise identical rods sort by
3188 * increasing recharge time --dsb
3190 if (o_ptr->tval == TV_ROD)
3192 if (o_ptr->pval < j_ptr->pval) break;
3193 if (o_ptr->pval > j_ptr->pval) continue;
3196 /* Evaluate that slot */
3197 j_value = object_value(j_ptr);
3199 /* Objects sort by decreasing value */
3200 if (value > j_value) break;
3201 if (value < j_value) continue;
3204 /* Slide the others up */
3205 for (i = st_ptr->stock_num; i > slot; i--)
3207 st_ptr->stock[i] = st_ptr->stock[i-1];
3210 /* More stuff now */
3211 st_ptr->stock_num++;
3213 /* Insert the new item */
3214 st_ptr->stock[slot] = *o_ptr;
3216 /* Return the location */
3222 * @brief 店舗のオブジェクト数を増やす /
3223 * Add the item "o_ptr" to a real stores p_ptr->inventory_list.
3224 * @param item 増やしたいアイテムのID
3229 * Increase, by a given amount, the number of a certain item
3230 * in a certain store. This can result in zero items.
3232 * @todo numは本来ITEM_NUMBER型にしたい。
3234 static void store_item_increase(INVENTORY_IDX item, int num)
3239 o_ptr = &st_ptr->stock[item];
3241 /* Verify the number */
3242 cnt = o_ptr->number + num;
3243 if (cnt > 255) cnt = 255;
3244 else if (cnt < 0) cnt = 0;
3245 num = cnt - o_ptr->number;
3247 /* Save the new number */
3248 o_ptr->number += (ITEM_NUMBER)num;
3253 * @brief 店舗のオブジェクト数を削除する /
3254 * Remove a slot if it is empty
3255 * @param item 削除したいアイテムのID
3258 static void store_item_optimize(INVENTORY_IDX item)
3263 o_ptr = &st_ptr->stock[item];
3266 if (!o_ptr->k_idx) return;
3268 /* Must have no items */
3269 if (o_ptr->number) return;
3272 st_ptr->stock_num--;
3274 /* Slide everyone */
3275 for (j = item; j < st_ptr->stock_num; j++)
3277 st_ptr->stock[j] = st_ptr->stock[j + 1];
3280 /* Nuke the final slot */
3281 object_wipe(&st_ptr->stock[j]);
3285 * @brief ブラックマーケット用の無価値品の排除判定 /
3286 * This function will keep 'crap' out of the black market.
3287 * @param o_ptr 判定したいオブジェクトの構造体参照ポインタ
3288 * @return ブラックマーケットにとって無価値な品ならばTRUEを返す
3291 * Crap is defined as any item that is "available" elsewhere
3292 * Based on a suggestion by "Lee Vogt" <lvogt@cig.mcel.mot.com>
3295 static bool black_market_crap(object_type *o_ptr)
3299 /* Ego items are never crap */
3300 if (object_is_ego(o_ptr)) return (FALSE);
3302 /* Good items are never crap */
3303 if (o_ptr->to_a > 0) return (FALSE);
3304 if (o_ptr->to_h > 0) return (FALSE);
3305 if (o_ptr->to_d > 0) return (FALSE);
3307 /* Check all stores */
3308 for (i = 0; i < MAX_STORES; i++)
3310 if (i == STORE_HOME) continue;
3311 if (i == STORE_MUSEUM) continue;
3313 /* Check every item in the store */
3314 for (j = 0; j < town_info[p_ptr->town_num].store[i].stock_num; j++)
3316 object_type *j_ptr = &town_info[p_ptr->town_num].store[i].stock[j];
3318 /* Duplicate item "type", assume crappy */
3319 if (o_ptr->k_idx == j_ptr->k_idx) return (TRUE);
3329 * @brief 店舗の品揃え変化のためにアイテムを削除する /
3330 * Attempt to delete (some of) a random item from the store
3334 * Hack -- we attempt to "maintain" piles of items when possible.
3337 static void store_delete(void)
3342 /* Pick a random slot */
3343 what = (INVENTORY_IDX)randint0(st_ptr->stock_num);
3345 /* Determine how many items are here */
3346 num = st_ptr->stock[what].number;
3348 /* Hack -- sometimes, only destroy half the items */
3349 if (randint0(100) < 50) num = (num + 1) / 2;
3351 /* Hack -- sometimes, only destroy a single item */
3352 if (randint0(100) < 50) num = 1;
3354 /* Hack -- decrement the maximum timeouts and total charges of rods and wands. -LM- */
3355 if ((st_ptr->stock[what].tval == TV_ROD) || (st_ptr->stock[what].tval == TV_WAND))
3357 st_ptr->stock[what].pval -= num * st_ptr->stock[what].pval / st_ptr->stock[what].number;
3360 /* Actually destroy (part of) the item */
3361 store_item_increase(what, -num);
3362 store_item_optimize(what);
3367 * @brief 店舗の品揃え変化のためにアイテムを追加する /
3368 * Creates a random item and gives it to a store
3372 * This algorithm needs to be rethought. A lot.
3373 * Currently, "normal" stores use a pre-built array.
3374 * Note -- the "level" given to "obj_get_num()" is a "favored"
3375 * level, that is, there is a much higher chance of getting
3376 * items with a level approaching that of the given level...
3377 * Should we check for "permission" to have the given item?
3380 static void store_create(void)
3390 /* Paranoia -- no room left */
3391 if (st_ptr->stock_num >= st_ptr->stock_size) return;
3394 /* Hack -- consider up to four items */
3395 for (tries = 0; tries < 4; tries++)
3398 if (cur_store_num == STORE_BLACK)
3400 /* Pick a level for object/magic */
3401 level = 25 + randint0(25);
3403 /* Random item (usually of given level) */
3404 i = get_obj_num(level);
3406 /* Handle failure */
3413 /* Hack -- Pick an item to sell */
3414 i = st_ptr->table[randint0(st_ptr->table_num)];
3416 /* Hack -- fake level for apply_magic() */
3417 level = rand_range(1, STORE_OBJ_LEVEL);
3422 /* Create a new object of the chosen kind */
3423 object_prep(q_ptr, i);
3425 /* Apply some "low-level" magic (no artifacts) */
3426 apply_magic(q_ptr, level, AM_NO_FIXED_ART);
3428 /* Require valid object */
3429 if (!store_will_buy(q_ptr)) continue;
3431 /* Hack -- Charge lite's */
3432 if (q_ptr->tval == TV_LITE)
3434 if (q_ptr->sval == SV_LITE_TORCH) q_ptr->xtra4 = FUEL_TORCH / 2;
3435 if (q_ptr->sval == SV_LITE_LANTERN) q_ptr->xtra4 = FUEL_LAMP / 2;
3439 /* The item is "known" */
3440 object_known(q_ptr);
3442 /* Mark it storebought */
3443 q_ptr->ident |= IDENT_STORE;
3445 /* Mega-Hack -- no chests in stores */
3446 if (q_ptr->tval == TV_CHEST) continue;
3448 /* Prune the black market */
3449 if (cur_store_num == STORE_BLACK)
3451 /* Hack -- No "crappy" items */
3452 if (black_market_crap(q_ptr)) continue;
3454 /* Hack -- No "cheap" items */
3455 if (object_value(q_ptr) < 10) continue;
3457 /* No "worthless" items */
3458 /* if (object_value(q_ptr) <= 0) continue; */
3461 /* Prune normal stores */
3464 /* No "worthless" items */
3465 if (object_value(q_ptr) <= 0) continue;
3469 /* Mass produce and/or Apply discount */
3470 mass_produce(q_ptr);
3472 /* Attempt to carry the (known) item */
3473 (void)store_carry(q_ptr);
3475 /* Definitely done */
3482 * @brief 店舗の割引対象外にするかどうかを判定 /
3483 * Eliminate need to bargain if player has haggled well in the past
3484 * @param minprice アイテムの最低販売価格
3485 * @return 割引を禁止するならTRUEを返す。
3487 static bool noneedtobargain(PRICE minprice)
3489 PRICE good = st_ptr->good_buy;
3490 PRICE bad = st_ptr->bad_buy;
3492 /* Cheap items are "boring" */
3493 if (minprice < 10L) return (TRUE);
3495 /* Perfect haggling */
3496 if (good == MAX_SHORT) return (TRUE);
3498 /* Reward good haggles, punish bad haggles, notice price */
3499 if (good > ((3 * bad) + (5 + (minprice/50)))) return (TRUE);
3501 /* Return the flag */
3507 * @brief 店主の持つプレイヤーに対する売買の良し悪し経験を記憶する /
3508 * Update the bargain info
3509 * @param price 実際の取引価格
3510 * @param minprice 店主の提示した価格
3514 static void updatebargain(PRICE price, PRICE minprice, int num)
3516 /* Hack -- auto-haggle */
3517 if (!manual_haggle) return;
3519 /* Cheap items are "boring" */
3520 if ((minprice/num) < 10L) return;
3522 /* Count the successful haggles */
3523 if (price == minprice)
3525 /* Just count the good haggles */
3526 if (st_ptr->good_buy < MAX_SHORT)
3532 /* Count the failed haggles */
3535 /* Just count the bad haggles */
3536 if (st_ptr->bad_buy < MAX_SHORT)
3545 * @brief 店の商品リストを再表示する /
3546 * Re-displays a single store entry
3550 static void display_entry(int pos)
3556 GAME_TEXT o_name[MAX_NLEN];
3561 o_ptr = &st_ptr->stock[pos];
3563 /* Get the "offset" */
3564 i = (pos % store_bottom);
3566 /* Label it, clear the line --(-- */
3567 (void)sprintf(out_val, "%c) ", ((i > 25) ? toupper(I2A(i - 26)) : I2A(i)));
3568 prt(out_val, i+6, 0);
3571 if (show_item_graph)
3573 TERM_COLOR a = object_attr(o_ptr);
3574 SYMBOL_CODE c = object_char(o_ptr);
3576 Term_queue_bigchar(cur_col, i + 6, a, c, 0, 0);
3577 if (use_bigtile) cur_col++;
3582 /* Describe an item in the home */
3583 if ((cur_store_num == STORE_HOME) || (cur_store_num == STORE_MUSEUM))
3587 /* Leave room for weights, if necessary -DRS- */
3588 if (show_weights) maxwid -= 10;
3590 object_desc(o_name, o_ptr, 0);
3591 o_name[maxwid] = '\0';
3592 c_put_str(tval_to_attr[o_ptr->tval], o_name, i+6, cur_col);
3597 /* Only show the weight of an individual item */
3598 WEIGHT wgt = o_ptr->weight;
3600 sprintf(out_val, "%3d.%1d kg", lbtokg1(wgt) , lbtokg2(wgt));
3601 put_str(out_val, i+6, 67);
3603 (void)sprintf(out_val, "%3d.%d lb", wgt / 10, wgt % 10);
3604 put_str(out_val, i+6, 68);
3610 /* Describe an item (fully) in a store */
3613 /* Must leave room for the "price" */
3616 /* Leave room for weights, if necessary -DRS- */
3617 if (show_weights) maxwid -= 7;
3619 /* Describe the object (fully) */
3620 object_desc(o_name, o_ptr, 0);
3621 o_name[maxwid] = '\0';
3622 c_put_str(tval_to_attr[o_ptr->tval], o_name, i+6, cur_col);
3627 /* Only show the weight of an individual item */
3628 int wgt = o_ptr->weight;
3630 sprintf(out_val, "%3d.%1d", lbtokg1(wgt) , lbtokg2(wgt) );
3631 put_str(out_val, i+6, 60);
3633 (void)sprintf(out_val, "%3d.%d", wgt / 10, wgt % 10);
3634 put_str(out_val, i+6, 61);
3639 /* Display a "fixed" cost */
3640 if (o_ptr->ident & (IDENT_FIXED))
3642 /* Extract the "minimum" price */
3643 x = price_item(o_ptr, ot_ptr->min_inflate, FALSE);
3645 /* Actually draw the price (not fixed) */
3647 (void)sprintf(out_val, "%9ld固", (long)x);
3649 (void)sprintf(out_val, "%9ld F", (long)x);
3651 put_str(out_val, i+6, 68);
3654 /* Display a "taxed" cost */
3655 else if (!manual_haggle)
3657 /* Extract the "minimum" price */
3658 x = price_item(o_ptr, ot_ptr->min_inflate, FALSE);
3660 /* Hack -- Apply Sales Tax if needed */
3661 if (!noneedtobargain(x)) x += x / 10;
3663 /* Actually draw the price (with tax) */
3664 (void)sprintf(out_val, "%9ld ", (long)x);
3665 put_str(out_val, i+6, 68);
3668 /* Display a "haggle" cost */
3671 /* Extrect the "maximum" price */
3672 x = price_item(o_ptr, ot_ptr->max_inflate, FALSE);
3674 /* Actually draw the price (not fixed) */
3675 (void)sprintf(out_val, "%9ld ", (long)x);
3676 put_str(out_val, i+6, 68);
3683 * @brief 店の商品リストを表示する /
3684 * Displays a store's p_ptr->inventory_list -RAK-
3687 * All prices are listed as "per individual object". -BEN-
3689 static void display_inventory(void)
3693 /* Display the next 12 items */
3694 for (k = 0; k < store_bottom; k++)
3696 /* Do not display "dead" items */
3697 if (store_top + k >= st_ptr->stock_num) break;
3699 /* Display that line */
3700 display_entry(store_top + k);
3703 /* Erase the extra lines and the "more" prompt */
3704 for (i = k; i < store_bottom + 1; i++) prt("", i + 6, 0);
3706 /* Assume "no current page" */
3708 put_str(" ", 5, 20);
3710 put_str(" ", 5, 20);
3714 /* Visual reminder of "more items" */
3715 if (st_ptr->stock_num > store_bottom)
3717 /* Show "more" reminder (after the last item) */
3718 prt(_("-続く-", "-more-"), k + 6, 3);
3720 /* Indicate the "current page" */
3721 /* Trailing spaces are to display (Page xx) and (Page x) */
3722 put_str(format(_("(%dページ) ", "(Page %d) "), store_top/store_bottom + 1), 5, 20);
3725 if (cur_store_num == STORE_HOME || cur_store_num == STORE_MUSEUM)
3727 k = st_ptr->stock_size;
3729 if (cur_store_num == STORE_HOME && !powerup_home) k /= 10;
3731 put_str(format("アイテム数: %4d/%4d", st_ptr->stock_num, k), 19 + xtra_stock, 27);
3733 put_str(format("Objects: %4d/%4d", st_ptr->stock_num, k), 19 + xtra_stock, 30);
3740 * @brief プレイヤーの所持金を表示する /
3741 * Displays players gold -RAK-
3745 static void store_prt_gold(void)
3749 prt(_("手持ちのお金: ", "Gold Remaining: "), 19 + xtra_stock, 53);
3750 sprintf(out_val, "%9ld", (long)p_ptr->au);
3751 prt(out_val, 19 + xtra_stock, 68);
3755 * @brief 店舗情報全体を表示するメインルーチン /
3756 * Displays store (after clearing screen) -RAK-
3760 static void display_store(void)
3766 /* The "Home" is special */
3767 if (cur_store_num == STORE_HOME)
3769 /* Put the owner name */
3770 put_str(_("我が家", "Your Home"), 3, 31);
3772 /* Label the item descriptions */
3773 put_str(_("アイテムの一覧", "Item Description"), 5, 4);
3775 /* If showing weights, show label */
3778 put_str(_(" 重さ", "Weight"), 5, 70);
3782 /* The "Home" is special */
3783 else if (cur_store_num == STORE_MUSEUM)
3785 /* Put the owner name */
3786 put_str(_("博物館", "Museum"), 3, 31);
3788 /* Label the item descriptions */
3789 put_str(_("アイテムの一覧", "Item Description"), 5, 4);
3791 /* If showing weights, show label */
3794 put_str(_(" 重さ", "Weight"), 5, 70);
3801 concptr store_name = (f_name + f_info[cur_store_feat].name);
3802 concptr owner_name = (ot_ptr->owner_name);
3803 concptr race_name = race_info[ot_ptr->owner_race].title;
3805 /* Put the owner name and race */
3806 sprintf(buf, "%s (%s)", owner_name, race_name);
3807 put_str(buf, 3, 10);
3809 /* Show the max price in the store (above prices) */
3810 sprintf(buf, "%s (%ld)", store_name, (long)(ot_ptr->max_cost));
3813 /* Label the item descriptions */
3814 put_str(_("商品の一覧", "Item Description"), 5, 5);
3817 /* If showing weights, show label */
3820 put_str(_(" 重さ", "Weight"), 5, 60);
3823 /* Label the asking price (in stores) */
3824 put_str(_(" 価格", "Price"), 5, 72);
3827 /* Display the current gold */
3830 /* Draw in the p_ptr->inventory_list */
3831 display_inventory();
3837 * @brief 店舗からアイテムを選択する /
3838 * Get the ID of a store item and return its value -RAK-
3839 * @param com_val 選択IDを返す参照ポインタ
3840 * @param pmt メッセージキャプション
3843 * @return 実際に選択したらTRUE、キャンセルしたらFALSE
3845 static int get_stock(COMMAND_CODE *com_val, concptr pmt, int i, int j)
3851 /* Get the item index */
3852 if (repeat_pull(com_val))
3854 /* Verify the item */
3855 if ((*com_val >= i) && (*com_val <= j))
3863 /* Assume failure */
3866 /* Build the prompt */
3868 hi = (j > 25) ? toupper(I2A(j - 26)) : I2A(j);
3870 (void)sprintf(out_val, "(%s:%c-%c, ESCで中断) %s",
3871 (((cur_store_num == STORE_HOME) || (cur_store_num == STORE_MUSEUM)) ? "アイテム" : "商品"),
3874 (void)sprintf(out_val, "(Items %c-%c, ESC to exit) %s",
3879 /* Ask until done */
3885 if (!get_com(out_val, &command, FALSE)) break;
3888 if (islower(command))
3890 else if (isupper(command))
3891 k = A2I(tolower(command)) + 26;
3895 /* Legal responses */
3896 if ((k >= i) && (k <= j))
3905 /* Clear the prompt */
3908 if (command == ESCAPE) return (FALSE);
3910 repeat_push(*com_val);
3918 * @brief 店主の不満度を増やし、プレイヤーを締め出す判定と処理を行う /
3919 * Increase the insult counter and get angry if too many -RAK-
3920 * @return プレイヤーを締め出す場合TRUEを返す
3922 static int increase_insults(void)
3924 /* Increase insults */
3925 st_ptr->insult_cur++;
3927 /* Become insulted */
3928 if (st_ptr->insult_cur > ot_ptr->insult_max)
3934 st_ptr->insult_cur = 0;
3935 st_ptr->good_buy = 0;
3936 st_ptr->bad_buy = 0;
3939 st_ptr->store_open = current_world_ptr->game_turn + TURNS_PER_TICK*TOWN_DAWN/8 + randint1(TURNS_PER_TICK*TOWN_DAWN/8);
3951 * @brief 店主の不満度を減らす /
3952 * Decrease insults -RAK-
3953 * @return プレイヤーを締め出す場合TRUEを返す
3955 static void decrease_insults(void)
3957 /* Decrease insults */
3958 if (st_ptr->insult_cur) st_ptr->insult_cur--;
3963 * @brief 店主の不満度が増えた場合のみのメッセージを表示する /
3964 * Have insulted while haggling -RAK-
3965 * @return プレイヤーを締め出す場合TRUEを返す
3967 static int haggle_insults(void)
3969 /* Increase insults */
3970 if (increase_insults()) return (TRUE);
3972 /* Display and flush insult */
3981 * Mega-Hack -- Enable "increments"
3983 static bool allow_inc = FALSE;
3986 * Mega-Hack -- Last "increment" during haggling
3988 static s32b last_inc = 0L;
3992 * @brief 交渉価格を確認と認証の是非を行う /
3995 * @param poffer 別途価格提示をした場合の値を返す参照ポインタ
3996 * @param price 現在の交渉価格
3997 * @param final 最終確定価格ならばTRUE
3998 * @return プレイヤーを締め出す場合TRUEを返す
4000 static int get_haggle(concptr pmt, s32b *poffer, PRICE price, int final)
4005 GAME_TEXT out_val[160];
4007 /* Clear old increment if necessary */
4008 if (!allow_inc) last_inc = 0L;
4013 sprintf(buf, _("%s [承諾] ", "%s [accept] "), pmt);
4016 /* Old (negative) increment, and not final */
4017 else if (last_inc < 0)
4019 sprintf(buf, _("%s [-$%ld] ", "%s [-%ld] "), pmt, (long)(ABS(last_inc)));
4022 /* Old (positive) increment, and not final */
4023 else if (last_inc > 0)
4025 sprintf(buf, _("%s [+$%ld] ", "%s [+%ld] "), pmt, (long)(ABS(last_inc)));
4031 sprintf(buf, "%s ", pmt);
4035 /* Ask until done */
4040 /* Display prompt */
4044 strcpy(out_val, "");
4047 * Ask the user for a response.
4048 * Don't allow to use numpad as cursor key.
4050 res = askfor_aux(out_val, 32, FALSE);
4056 if (!res) return FALSE;
4058 /* Skip leading spaces */
4059 for (p = out_val; *p == ' '; p++) /* loop */;
4061 /* Empty response */
4064 /* Accept current price */
4072 /* Use previous increment */
4073 if (allow_inc && last_inc)
4075 *poffer += last_inc;
4080 /* Normal response */
4083 /* Extract a number */
4086 /* Handle "incremental" number */
4087 if ((*p == '+' || *p == '-'))
4089 /* Allow increments */
4092 /* Use the given "increment" */
4099 /* Handle normal number */
4102 /* Use the given "number" */
4110 msg_print(_("値がおかしいです。", "Invalid response."));
4120 * @brief 店主がプレイヤーからの交渉価格を判断する /
4121 * Receive an offer (from the player)
4123 * @param poffer 店主からの交渉価格を返す参照ポインタ
4124 * @param last_offer 現在の交渉価格
4125 * @param factor 店主の価格基準倍率
4126 * @param price アイテムの実価値
4127 * @param final 最終価格確定ならばTRUE
4128 * @return プレイヤーの価格に対して不服ならばTRUEを返す /
4129 * Return TRUE if offer is NOT okay
4131 static bool receive_offer(concptr pmt, s32b *poffer,
4132 s32b last_offer, int factor,
4133 PRICE price, int final)
4135 /* Haggle till done */
4138 /* Get a haggle (or cancel) */
4139 if (!get_haggle(pmt, poffer, price, final)) return (TRUE);
4141 /* Acceptable offer */
4142 if (((*poffer) * factor) >= (last_offer * factor)) break;
4144 /* Insult, and check for kicked out */
4145 if (haggle_insults()) return (TRUE);
4147 /* Reject offer (correctly) */
4148 (*poffer) = last_offer;
4157 * @brief プレイヤーが購入する時の値切り処理メインルーチン /
4158 * Haggling routine -RAK-
4159 * @param o_ptr オブジェクトの構造体参照ポインタ
4160 * @param price 最終価格を返す参照ポインタ
4161 * @return プレイヤーの価格に対して店主が不服ならばTRUEを返す /
4162 * Return TRUE if purchase is NOT successful
4164 static bool purchase_haggle(object_type *o_ptr, s32b *price)
4166 s32b cur_ask, final_ask;
4167 s32b last_offer, offer;
4169 s32b min_per, max_per;
4170 int flag, loop_flag, noneed;
4171 int annoyed = 0, final = FALSE;
4172 bool cancel = FALSE;
4176 concptr pmt = _("提示価格", "Asking");
4178 /* Extract the starting offer and the final offer */
4179 cur_ask = price_item(o_ptr, ot_ptr->max_inflate, FALSE);
4180 final_ask = price_item(o_ptr, ot_ptr->min_inflate, FALSE);
4182 /* Determine if haggling is necessary */
4183 noneed = noneedtobargain(final_ask);
4185 /* No need to haggle */
4186 if (noneed || !manual_haggle)
4188 /* No need to haggle */
4191 /* Message summary */
4192 msg_print(_("結局この金額にまとまった。", "You eventually agree upon the price."));
4196 /* No haggle option */
4199 /* Message summary */
4200 msg_print(_("すんなりとこの金額にまとまった。", "You quickly agree upon the price."));
4203 /* Apply Sales Tax */
4204 final_ask += final_ask / 10;
4208 cur_ask = final_ask;
4210 /* Go to final offer */
4211 pmt = _("最終提示価格", "Final Offer");
4216 /* Haggle for the whole pile */
4217 cur_ask *= o_ptr->number;
4218 final_ask *= o_ptr->number;
4221 /* Haggle parameters */
4222 min_per = ot_ptr->haggle_per;
4223 max_per = min_per * 3;
4225 /* Mega-Hack -- artificial "last offer" value */
4226 last_offer = object_value(o_ptr) * o_ptr->number;
4227 last_offer = last_offer * (200 - (int)(ot_ptr->max_inflate)) / 100L;
4228 if (last_offer <= 0) last_offer = 1;
4233 /* No incremental haggling yet */
4236 /* Haggle until done */
4237 for (flag = FALSE; !flag; )
4241 while (!flag && loop_flag)
4243 (void)sprintf(out_val, "%s : %ld", pmt, (long)cur_ask);
4244 put_str(out_val, 1, 0);
4245 cancel = receive_offer(_("提示する金額? ", "What do you offer? "), &offer, last_offer, 1, cur_ask, final);
4250 else if (offer > cur_ask)
4255 else if (offer == cur_ask)
4268 x1 = 100 * (offer - last_offer) / (cur_ask - last_offer);
4271 if (haggle_insults())
4277 else if (x1 > max_per)
4280 if (x1 < max_per) x1 = max_per;
4282 x2 = rand_range(x1-2, x1+2);
4283 x3 = ((cur_ask - offer) * x2 / 100L) + 1;
4284 /* don't let the price go up */
4289 if (cur_ask < final_ask)
4292 cur_ask = final_ask;
4293 pmt = _("最終提示価格", "What do you offer? ");
4297 (void)(increase_insults());
4302 else if (offer >= cur_ask)
4313 (void)sprintf(out_val, _("前回の提示金額: $%ld", "Your last offer: %ld"), (long)last_offer);
4314 put_str(out_val, 1, 39);
4315 say_comment_2(cur_ask, annoyed);
4320 if (cancel) return (TRUE);
4322 updatebargain(*price, final_ask, o_ptr->number);
4330 * @brief プレイヤーが売却する時の値切り処理メインルーチン /
4331 * Haggling routine -RAK-
4332 * @param o_ptr オブジェクトの構造体参照ポインタ
4333 * @param price 最終価格を返す参照ポインタ
4334 * @return プレイヤーの価格に対して店主が不服ならばTRUEを返す /
4335 * Return TRUE if purchase is NOT successful
4337 static bool sell_haggle(object_type *o_ptr, s32b *price)
4339 s32b purse, cur_ask, final_ask;
4340 s32b last_offer = 0, offer = 0;
4342 s32b min_per, max_per;
4343 int flag, loop_flag, noneed;
4344 int annoyed = 0, final = FALSE;
4345 bool cancel = FALSE;
4346 concptr pmt = _("提示金額", "Offer");
4352 /* Obtain the starting offer and the final offer */
4353 cur_ask = price_item(o_ptr, ot_ptr->max_inflate, TRUE);
4354 final_ask = price_item(o_ptr, ot_ptr->min_inflate, TRUE);
4356 /* Determine if haggling is necessary */
4357 noneed = noneedtobargain(final_ask);
4359 /* Get the owner's payout limit */
4360 purse = (s32b)(ot_ptr->max_cost);
4362 /* No need to haggle */
4363 if (noneed || !manual_haggle || (final_ask >= purse))
4365 /* Apply Sales Tax (if needed) */
4366 if (!manual_haggle && !noneed)
4368 final_ask -= final_ask / 10;
4371 /* No reason to haggle */
4372 if (final_ask >= purse)
4374 msg_print(_("即座にこの金額にまとまった。", "You instantly agree upon the price."));
4377 /* Offer full purse */
4381 /* No need to haggle */
4384 msg_print(_("結局この金額にまとまった。", "You eventually agree upon the price."));
4388 /* No haggle option */
4391 /* Message summary */
4392 msg_print(_("すんなりとこの金額にまとまった。", "You quickly agree upon the price."));
4397 cur_ask = final_ask;
4401 pmt = _("最終提示金額", "Final Offer");
4404 /* Haggle for the whole pile */
4405 cur_ask *= o_ptr->number;
4406 final_ask *= o_ptr->number;
4409 /* Display commands */
4411 /* Haggling parameters */
4412 min_per = ot_ptr->haggle_per;
4413 max_per = min_per * 3;
4415 /* Mega-Hack -- artificial "last offer" value */
4416 last_offer = object_value(o_ptr) * o_ptr->number;
4417 last_offer = last_offer * ot_ptr->max_inflate / 100L;
4422 /* No incremental haggling yet */
4426 for (flag = FALSE; !flag; )
4432 (void)sprintf(out_val, "%s : %ld", pmt, (long)cur_ask);
4433 put_str(out_val, 1, 0);
4434 cancel = receive_offer(_("提示する価格? ", "What price do you ask? "),
4435 &offer, last_offer, -1, cur_ask, final);
4441 else if (offer < cur_ask)
4444 /* rejected, reset offer for incremental haggling */
4447 else if (offer == cur_ask)
4458 if (flag || !loop_flag) break;
4463 x1 = 100 * (last_offer - offer) / (last_offer - cur_ask);
4466 if (haggle_insults())
4472 else if (x1 > max_per)
4475 if (x1 < max_per) x1 = max_per;
4477 x2 = rand_range(x1-2, x1+2);
4478 x3 = ((offer - cur_ask) * x2 / 100L) + 1;
4479 /* don't let the price go down */
4483 if (cur_ask > final_ask)
4485 cur_ask = final_ask;
4487 pmt = _("最終提示金額", "Final Offer");
4494 /* 追加 $0 で買い取られてしまうのを防止 By FIRST*/
4497 (void)(increase_insults());
4500 else if (offer <= cur_ask)
4511 (void)sprintf(out_val,
4512 _("前回の提示価格 $%ld", "Your last bid %ld"), (long)last_offer);
4513 put_str(out_val, 1, 39);
4514 say_comment_3(cur_ask, annoyed);
4519 if (cancel) return (TRUE);
4521 updatebargain(*price, final_ask, o_ptr->number);
4529 * @brief 店からの購入処理のメインルーチン /
4530 * Buy an item from a store -RAK-
4533 static void store_purchase(void)
4536 COMMAND_CODE item, item_new;
4547 GAME_TEXT o_name[MAX_NLEN];
4551 if (cur_store_num == STORE_MUSEUM)
4553 msg_print(_("博物館から取り出すことはできません。", "Museum."));
4558 if (st_ptr->stock_num <= 0)
4560 if (cur_store_num == STORE_HOME)
4561 msg_print(_("我が家には何も置いてありません。", "Your home is empty."));
4563 msg_print(_("現在商品の在庫を切らしています。", "I am currently out of stock."));
4567 /* Find the number of objects on this and following pages */
4568 i = (st_ptr->stock_num - store_top);
4570 /* And then restrict it to the current page */
4571 if (i > store_bottom) i = store_bottom;
4575 /* ブラックマーケットの時は別のメッセージ */
4576 switch( cur_store_num ) {
4578 sprintf(out_val, "どのアイテムを取りますか? ");
4581 sprintf(out_val, "どれ? ");
4584 sprintf(out_val, "どの品物が欲しいんだい? ");
4588 if (cur_store_num == STORE_HOME)
4590 sprintf(out_val, "Which item do you want to take? ");
4594 sprintf(out_val, "Which item are you interested in? ");
4599 /* Get the item number to be bought */
4600 if (!get_stock(&item, out_val, 0, i - 1)) return;
4602 /* Get the actual index */
4603 item = item + store_top;
4605 /* Get the actual item */
4606 o_ptr = &st_ptr->stock[item];
4608 /* Assume the player wants just one of them */
4612 /* Get a copy of the object */
4613 object_copy(j_ptr, o_ptr);
4616 * If a rod or wand, allocate total maximum timeouts or charges
4617 * between those purchased and left on the shelf.
4619 reduce_charges(j_ptr, o_ptr->number - amt);
4621 /* Modify quantity */
4622 j_ptr->number = amt;
4624 /* Hack -- require room in pack */
4625 if (!inven_carry_okay(j_ptr))
4627 msg_print(_("そんなにアイテムを持てない。", "You cannot carry that many different items."));
4631 /* Determine the "best" price (per item) */
4632 best = price_item(j_ptr, ot_ptr->min_inflate, FALSE);
4634 /* Find out how many the player wants */
4635 if (o_ptr->number > 1)
4637 /* Hack -- note cost of "fixed" items */
4638 if ((cur_store_num != STORE_HOME) &&
4639 (o_ptr->ident & IDENT_FIXED))
4641 msg_format(_("一つにつき $%ldです。", "That costs %ld gold per item."), (long)(best));
4643 amt = get_quantity(NULL, o_ptr->number);
4644 if (amt <= 0) return;
4648 /* Get desired object */
4649 object_copy(j_ptr, o_ptr);
4652 * If a rod or wand, allocate total maximum timeouts or charges
4653 * between those purchased and left on the shelf.
4655 reduce_charges(j_ptr, o_ptr->number - amt);
4657 /* Modify quantity */
4658 j_ptr->number = amt;
4660 /* Hack -- require room in pack */
4661 if (!inven_carry_okay(j_ptr))
4663 msg_print(_("ザックにそのアイテムを入れる隙間がない。", "You cannot carry that many items."));
4667 /* Attempt to buy it */
4668 if (cur_store_num != STORE_HOME)
4670 /* Fixed price, quick buy */
4671 if (o_ptr->ident & (IDENT_FIXED))
4676 /* Go directly to the "best" deal */
4677 price = (best * j_ptr->number);
4683 /* Describe the object (fully) */
4684 object_desc(o_name, j_ptr, 0);
4685 msg_format(_("%s(%c)を購入する。", "Buying %s (%c)."), o_name, I2A(item));
4688 /* Haggle for a final price */
4689 choice = purchase_haggle(j_ptr, &price);
4691 /* Hack -- Got kicked out */
4692 if (st_ptr->store_open >= current_world_ptr->game_turn) return;
4695 /* Player wants it */
4698 /* Fix the item price (if "correctly" haggled) */
4699 if (price == (best * j_ptr->number)) o_ptr->ident |= (IDENT_FIXED);
4701 /* Player can afford it */
4702 if (p_ptr->au >= price)
4707 if (cur_store_num == STORE_BLACK) /* The black market is illegal! */
4708 chg_virtue(V_JUSTICE, -1);
4709 if((o_ptr->tval == TV_BOTTLE) && (cur_store_num != STORE_HOME))
4710 chg_virtue(V_NATURE, -1);
4718 /* Spend the money */
4721 /* Update the display */
4724 /* Hack -- buying an item makes you aware of it */
4725 object_aware(j_ptr);
4727 /* Hack -- clear the "fixed" flag from the item */
4728 j_ptr->ident &= ~(IDENT_FIXED);
4730 /* Describe the transaction */
4731 object_desc(o_name, j_ptr, 0);
4733 msg_format(_("%sを $%ldで購入しました。", "You bought %s for %ld gold."), o_name, (long)price);
4735 strcpy(record_o_name, o_name);
4736 record_turn = current_world_ptr->game_turn;
4738 if (record_buy) do_cmd_write_nikki(NIKKI_BUY, 0, o_name);
4739 object_desc(o_name, o_ptr, OD_NAME_ONLY);
4740 if(record_rand_art && o_ptr->art_name)
4741 do_cmd_write_nikki(NIKKI_ART, 0, o_name);
4743 /* Erase the inscription */
4744 j_ptr->inscription = 0;
4746 /* Erase the "feeling" */
4747 j_ptr->feeling = FEEL_NONE;
4748 j_ptr->ident &= ~(IDENT_STORE);
4749 /* Give it to the player */
4750 item_new = inven_carry(j_ptr);
4752 /* Describe the final result */
4753 object_desc(o_name, &p_ptr->inventory_list[item_new], 0);
4754 msg_format(_("%s(%c)を手に入れた。", "You have %s (%c)."), o_name, index_to_label(item_new));
4756 /* Auto-inscription */
4757 autopick_alter_item(item_new, FALSE);
4759 /* Now, reduce the original stack's pval. */
4760 if ((o_ptr->tval == TV_ROD) || (o_ptr->tval == TV_WAND))
4762 o_ptr->pval -= j_ptr->pval;
4766 /* Note how many slots the store used to have */
4767 i = st_ptr->stock_num;
4769 /* Remove the bought items from the store */
4770 store_item_increase(item, -amt);
4771 store_item_optimize(item);
4773 /* Store is empty */
4774 if (st_ptr->stock_num == 0)
4777 if (one_in_(STORE_SHUFFLE))
4780 msg_print(_("店主は引退した。", "The shopkeeper retires."));
4782 /* Shuffle the store */
4783 store_shuffle(cur_store_num);
4786 sprintf(buf, "%s (%s)",
4787 ot_ptr->owner_name, race_info[ot_ptr->owner_race].title);
4788 put_str(buf, 3, 10);
4789 sprintf(buf, "%s (%ld)",
4790 (f_name + f_info[cur_store_feat].name), (long)(ot_ptr->max_cost));
4797 msg_print(_("店主は新たな在庫を取り出した。", "The shopkeeper brings out some new stock."));
4800 /* New p_ptr->inventory_list */
4801 for (i = 0; i < 10; i++)
4803 /* Maintain the store */
4804 store_maint(p_ptr->town_num, cur_store_num);
4809 display_inventory();
4812 /* The item is gone */
4813 else if (st_ptr->stock_num != i)
4815 /* Pick the correct screen */
4816 if (store_top >= st_ptr->stock_num) store_top -= store_bottom;
4817 display_inventory();
4820 /* Item is still here */
4823 /* Redraw the item */
4824 display_entry(item);
4828 /* Player cannot afford it */
4831 /* Simple message (no insult) */
4832 msg_print(_("お金が足りません。", "You do not have enough gold."));
4837 /* Home is much easier */
4840 bool combined_or_reordered;
4842 /* Distribute charges of wands/rods */
4843 distribute_charges(o_ptr, j_ptr, amt);
4845 /* Give it to the player */
4846 item_new = inven_carry(j_ptr);
4848 /* Describe just the result */
4849 object_desc(o_name, &p_ptr->inventory_list[item_new], 0);
4851 msg_format(_("%s(%c)を取った。", "You have %s (%c)."), o_name, index_to_label(item_new));
4854 /* Take note if we take the last one */
4855 i = st_ptr->stock_num;
4857 /* Remove the items from the home */
4858 store_item_increase(item, -amt);
4859 store_item_optimize(item);
4861 combined_or_reordered = combine_and_reorder_home(STORE_HOME);
4863 /* Hack -- Item is still here */
4864 if (i == st_ptr->stock_num)
4866 if (combined_or_reordered) display_inventory();
4868 /* Redraw the item */
4869 else display_entry(item);
4872 /* The item is gone */
4876 if (st_ptr->stock_num == 0) store_top = 0;
4878 /* Nothing left on that screen */
4879 else if (store_top >= st_ptr->stock_num) store_top -= store_bottom;
4880 display_inventory();
4882 chg_virtue(V_SACRIFICE, 1);
4886 /* Not kicked out */
4892 * @brief 店からの売却処理のメインルーチン /
4893 * Sell an item to the store (or home)
4896 static void store_sell(void)
4903 PRICE price, value, dummy;
4911 GAME_TEXT o_name[MAX_NLEN];
4914 /* Prepare a prompt */
4915 if (cur_store_num == STORE_HOME)
4916 q = _("どのアイテムを置きますか? ", "Drop which item? ");
4918 else if (cur_store_num == STORE_MUSEUM)
4919 q = _("どのアイテムを寄贈しますか? ", "Give which item? ");
4922 q = _("どのアイテムを売りますか? ", "Sell which item? ");
4924 /* Only allow items the store will buy */
4925 item_tester_hook = store_will_buy;
4927 /* 我が家でおかしなメッセージが出るオリジナルのバグを修正 */
4928 if (cur_store_num == STORE_HOME)
4930 s = _("置けるアイテムを持っていません。", "You don't have any item to drop.");
4932 else if (cur_store_num == STORE_MUSEUM)
4934 s = _("寄贈できるアイテムを持っていません。", "You don't have any item to give.");
4938 s = _("欲しい物がないですねえ。", "You have nothing that I want.");
4941 o_ptr = choose_object(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT));
4944 /* Hack -- Cannot remove cursed items */
4945 if ((item >= INVEN_RARM) && object_is_cursed(o_ptr))
4947 msg_print(_("ふーむ、どうやらそれは呪われているようだね。", "Hmmm, it seems to be cursed."));
4951 /* Assume one item */
4954 if (o_ptr->number > 1)
4956 amt = get_quantity(NULL, o_ptr->number);
4957 if (amt <= 0) return;
4961 /* Get a copy of the object */
4962 object_copy(q_ptr, o_ptr);
4964 /* Modify quantity */
4965 q_ptr->number = amt;
4968 * Hack -- If a rod or wand, allocate total maximum
4969 * timeouts or charges to those being sold. -LM-
4971 if ((o_ptr->tval == TV_ROD) || (o_ptr->tval == TV_WAND))
4973 q_ptr->pval = o_ptr->pval * amt / o_ptr->number;
4976 /* Get a full description */
4977 object_desc(o_name, q_ptr, 0);
4979 /* Remove any inscription, feeling for stores */
4980 if ((cur_store_num != STORE_HOME) && (cur_store_num != STORE_MUSEUM))
4982 q_ptr->inscription = 0;
4983 q_ptr->feeling = FEEL_NONE;
4986 /* Is there room in the store (or the home?) */
4987 if (!store_check_num(q_ptr))
4989 if (cur_store_num == STORE_HOME)
4990 msg_print(_("我が家にはもう置く場所がない。", "Your home is full."));
4992 else if (cur_store_num == STORE_MUSEUM)
4993 msg_print(_("博物館はもう満杯だ。", "Museum is full."));
4996 msg_print(_("すいませんが、店にはもう置く場所がありません。", "I have not the room in my store to keep it."));
5003 if ((cur_store_num != STORE_HOME) && (cur_store_num != STORE_MUSEUM))
5005 /* Describe the transaction */
5006 msg_format(_("%s(%c)を売却する。", "Selling %s (%c)."), o_name, index_to_label(item));
5011 choice = sell_haggle(q_ptr, &price);
5014 if (st_ptr->store_open >= current_world_ptr->game_turn) return;
5026 if (cur_store_num == STORE_BLACK) /* The black market is illegal! */
5027 chg_virtue(V_JUSTICE, -1);
5029 if((o_ptr->tval == TV_BOTTLE) && (cur_store_num != STORE_HOME))
5030 chg_virtue(V_NATURE, 1);
5033 /* Get some money */
5036 /* Update the display */
5039 /* Get the "apparent" value */
5040 dummy = object_value(q_ptr) * q_ptr->number;
5042 identify_item(o_ptr);
5045 /* Get a copy of the object */
5046 object_copy(q_ptr, o_ptr);
5048 /* Modify quantity */
5049 q_ptr->number = amt;
5051 /* Make it look like to be known */
5052 q_ptr->ident |= IDENT_STORE;
5055 * Hack -- If a rod or wand, let the shopkeeper know just
5056 * how many charges he really paid for. -LM-
5058 if ((o_ptr->tval == TV_ROD) || (o_ptr->tval == TV_WAND))
5060 q_ptr->pval = o_ptr->pval * amt / o_ptr->number;
5063 /* Get the "actual" value */
5064 value = object_value(q_ptr) * q_ptr->number;
5066 /* Get the description all over again */
5067 object_desc(o_name, q_ptr, 0);
5069 /* Describe the result (in message buffer) */
5070 msg_format(_("%sを $%ldで売却しました。", "You sold %s for %ld gold."), o_name, (long)price);
5072 if (record_sell) do_cmd_write_nikki(NIKKI_SELL, 0, o_name);
5074 if (!((o_ptr->tval == TV_FIGURINE) && (value > 0)))
5076 /* Analyze the prices (and comment verbally) unless a figurine*/
5077 purchase_analyze(price, value, dummy);
5081 * Hack -- Allocate charges between those wands or rods sold
5082 * and retained, unless all are being sold. -LM-
5084 distribute_charges(o_ptr, q_ptr, amt);
5086 /* Reset timeouts of the sold items */
5089 /* Take the item from the player, describe the result */
5090 inven_item_increase(item, -amt);
5091 inven_item_describe(item);
5093 /* If items remain, auto-inscribe before optimizing */
5094 if (o_ptr->number > 0)
5095 autopick_alter_item(item, FALSE);
5097 inven_item_optimize(item);
5100 /* The store gets that (known) item */
5101 item_pos = store_carry(q_ptr);
5103 /* Re-display if item is now in store */
5106 store_top = (item_pos / store_bottom) * store_bottom;
5107 display_inventory();
5112 /* Player is at museum */
5113 else if (cur_store_num == STORE_MUSEUM)
5115 char o2_name[MAX_NLEN];
5116 object_desc(o2_name, q_ptr, OD_NAME_ONLY);
5118 if (-1 == store_check_num(q_ptr))
5120 msg_print(_("それと同じ品物は既に博物館にあるようです。", "The same object as it is already in the Museum."));
5124 msg_print(_("博物館に寄贈したものは取り出すことができません!!", "You cannot take items which is given to the Museum back!!"));
5127 if (!get_check(format(_("本当に%sを寄贈しますか?", "Really give %s to the Museum? "), o2_name))) return;
5129 identify_item(q_ptr);
5130 q_ptr->ident |= IDENT_MENTAL;
5132 /* Distribute charges of wands/rods */
5133 distribute_charges(o_ptr, q_ptr, amt);
5134 msg_format(_("%sを置いた。(%c)", "You drop %s (%c)."), o_name, index_to_label(item));
5137 /* Take it from the players p_ptr->inventory_list */
5138 inven_item_increase(item, -amt);
5139 inven_item_describe(item);
5140 inven_item_optimize(item);
5143 /* Let the home carry it */
5144 item_pos = home_carry(q_ptr);
5146 /* Update store display */
5149 store_top = (item_pos / store_bottom) * store_bottom;
5150 display_inventory();
5153 /* Player is at home */
5156 /* Distribute charges of wands/rods */
5157 distribute_charges(o_ptr, q_ptr, amt);
5158 msg_format(_("%sを置いた。(%c)", "You drop %s (%c)."), o_name, index_to_label(item));
5162 /* Take it from the players p_ptr->inventory_list */
5163 inven_item_increase(item, -amt);
5164 inven_item_describe(item);
5165 inven_item_optimize(item);
5168 /* Let the home carry it */
5169 item_pos = home_carry(q_ptr);
5171 /* Update store display */
5174 store_top = (item_pos / store_bottom) * store_bottom;
5175 display_inventory();
5179 if ((choice == 0) && (item >= INVEN_RARM))
5188 * @brief 店のアイテムを調べるコマンドのメインルーチン /
5189 * Examine an item in a store -JDL-
5192 static void store_examine(void)
5197 GAME_TEXT o_name[MAX_NLEN];
5201 if (st_ptr->stock_num <= 0)
5203 if (cur_store_num == STORE_HOME)
5204 msg_print(_("我が家には何も置いてありません。", "Your home is empty."));
5205 else if (cur_store_num == STORE_MUSEUM)
5206 msg_print(_("博物館には何も置いてありません。", "Museum is empty."));
5208 msg_print(_("現在商品の在庫を切らしています。", "I am currently out of stock."));
5212 /* Find the number of objects on this and following pages */
5213 i = (st_ptr->stock_num - store_top);
5215 /* And then restrict it to the current page */
5216 if (i > store_bottom) i = store_bottom;
5219 sprintf(out_val, _("どれを調べますか?", "Which item do you want to examine? "));
5221 /* Get the item number to be examined */
5222 if (!get_stock(&item, out_val, 0, i - 1)) return;
5224 /* Get the actual index */
5225 item = item + store_top;
5227 /* Get the actual item */
5228 o_ptr = &st_ptr->stock[item];
5230 /* Require full knowledge */
5231 if (!(o_ptr->ident & IDENT_MENTAL))
5233 /* This can only happen in the home */
5234 msg_print(_("このアイテムについて特に知っていることはない。", "You have no special knowledge about that item."));
5238 object_desc(o_name, o_ptr, 0);
5239 msg_format(_("%sを調べている...", "Examining %s..."), o_name);
5241 if (!screen_object(o_ptr, SCROBJ_FORCE_DETAIL))
5242 msg_print(_("特に変わったところはないようだ。", "You see nothing special."));
5249 * @brief 博物館のアイテムを除去するコマンドのメインルーチン /
5250 * Remove an item from museum (Originally from TOband)
5253 static void museum_remove_object(void)
5258 GAME_TEXT o_name[MAX_NLEN];
5262 if (st_ptr->stock_num <= 0)
5264 msg_print(_("博物館には何も置いてありません。", "Museum is empty."));
5268 /* Find the number of objects on this and following pages */
5269 i = st_ptr->stock_num - store_top;
5271 /* And then restrict it to the current page */
5272 if (i > store_bottom) i = store_bottom;
5275 sprintf(out_val, _("どのアイテムの展示をやめさせますか?", "Which item do you want to order to remove? "));
5277 /* Get the item number to be removed */
5278 if (!get_stock(&item, out_val, 0, i - 1)) return;
5280 /* Get the actual index */
5281 item = item + store_top;
5283 /* Get the actual item */
5284 o_ptr = &st_ptr->stock[item];
5286 object_desc(o_name, o_ptr, 0);
5288 msg_print(_("展示をやめさせたアイテムは二度と見ることはできません!", "You cannot see items which is removed from the Museum!"));
5289 if (!get_check(format(_("本当に%sの展示をやめさせますか?", "Really order to remove %s from the Museum? "), o_name))) return;
5291 msg_format(_("%sの展示をやめさせた。", "You ordered to remove %s."), o_name);
5293 /* Remove the items from the home */
5294 store_item_increase(item, -o_ptr->number);
5295 store_item_optimize(item);
5297 (void)combine_and_reorder_home(STORE_MUSEUM);
5299 /* The item is gone */
5302 if (st_ptr->stock_num == 0) store_top = 0;
5304 /* Nothing left on that screen */
5305 else if (store_top >= st_ptr->stock_num) store_top -= store_bottom;
5306 display_inventory();
5313 * Hack -- set this to leave the store
5315 static bool leave_store = FALSE;
5319 * @brief 店舗処理コマンド選択のメインルーチン /
5320 * Process a command in a store
5324 * Note that we must allow the use of a few "special" commands
5325 * in the stores which are not allowed in the dungeon, and we
5326 * must disable some commands which are allowed in the dungeon
5327 * but not in the stores, to prevent chaos.
5330 static void store_process_command(void)
5332 /* Handle repeating the last command */
5335 if (rogue_like_commands && command_cmd == 'l')
5337 command_cmd = 'x'; /* hack! */
5340 /* Parse the command */
5341 switch (command_cmd)
5351 /* 1 ページ戻るコマンド: 我が家のページ数が多いので重宝するはず By BUG */
5354 if (st_ptr->stock_num <= store_bottom) {
5355 msg_print(_("これで全部です。", "Entire p_ptr->inventory_list is shown."));
5358 store_top -= store_bottom;
5359 if ( store_top < 0 )
5360 store_top = ((st_ptr->stock_num - 1 )/store_bottom) * store_bottom;
5361 if ( (cur_store_num == STORE_HOME) && (powerup_home == FALSE) )
5362 if ( store_top >= store_bottom ) store_top = store_bottom;
5363 display_inventory();
5371 if (st_ptr->stock_num <= store_bottom)
5373 msg_print(_("これで全部です。", "Entire p_ptr->inventory_list is shown."));
5377 store_top += store_bottom;
5379 * 隠しオプション(powerup_home)がセットされていないときは
5380 * 我が家では 2 ページまでしか表示しない
5382 if ((cur_store_num == STORE_HOME) &&
5383 (powerup_home == FALSE) &&
5384 (st_ptr->stock_num >= STORE_INVEN_MAX))
5386 if (store_top >= (STORE_INVEN_MAX - 1))
5393 if (store_top >= st_ptr->stock_num) store_top = 0;
5396 display_inventory();
5408 /* Get (purchase) */
5435 /*** Inventory Commands ***/
5437 /* Wear/wield equipment */
5444 /* Take off equipment */
5451 /* Destroy an item */
5458 /* Equipment list */
5465 /* Inventory list */
5473 /*** Various commands ***/
5475 /* Identify an object */
5482 /* Hack -- toggle windows */
5485 toggle_inven_equip();
5489 /*** Use various objects ***/
5494 if ( (p_ptr->pclass == CLASS_MINDCRAFTER) ||
5495 (p_ptr->pclass == CLASS_BERSERKER) ||
5496 (p_ptr->pclass == CLASS_NINJA) ||
5497 (p_ptr->pclass == CLASS_MIRROR_MASTER)
5498 ) do_cmd_mind_browse();
5499 else if (p_ptr->pclass == CLASS_SMITH)
5501 else if (p_ptr->pclass == CLASS_MAGIC_EATER)
5502 do_cmd_magic_eater(TRUE, FALSE);
5503 else if (p_ptr->pclass == CLASS_SNIPER)
5504 do_cmd_snipe_browse();
5505 else do_cmd_browse();
5509 /* Inscribe an object */
5516 /* Uninscribe an object */
5519 do_cmd_uninscribe();
5525 /*** Help and Such ***/
5534 /* Identify symbol */
5537 do_cmd_query_symbol();
5541 /* Character description */
5544 p_ptr->town_num = old_town_num;
5545 do_cmd_change_name();
5546 p_ptr->town_num = inner_town_num;
5552 /*** System Commands ***/
5554 /* Hack -- User interface */
5561 /* Single line from a pref file */
5564 p_ptr->town_num = old_town_num;
5566 p_ptr->town_num = inner_town_num;
5570 /* Interact with macros */
5573 p_ptr->town_num = old_town_num;
5575 p_ptr->town_num = inner_town_num;
5579 /* Interact with visuals */
5582 p_ptr->town_num = old_town_num;
5584 p_ptr->town_num = inner_town_num;
5588 /* Interact with colors */
5591 p_ptr->town_num = old_town_num;
5593 p_ptr->town_num = inner_town_num;
5597 /* Interact with options */
5601 (void)combine_and_reorder_home(STORE_HOME);
5607 /*** Misc Commands ***/
5623 /* Repeat level feeling */
5630 /* Show previous message */
5633 do_cmd_message_one();
5637 /* Show previous messages */
5650 /* Check artifacts, uniques etc. */
5657 /* Load "screen dump" */
5660 do_cmd_load_screen();
5664 /* Save "screen dump" */
5667 do_cmd_save_screen();
5671 /* Hack -- Unknown command */
5674 if ((cur_store_num == STORE_MUSEUM) && (command_cmd == 'r'))
5676 museum_remove_object();
5680 msg_print(_("そのコマンドは店の中では使えません。", "That command does not work in stores."));
5689 * @brief 店舗処理全体のメインルーチン /
5690 * Enter a store, and interact with it. *
5694 * Note that we use the standard "request_command()" function
5695 * to get a command, allowing us to use "command_arg" and all
5696 * command macros and other nifty stuff, but we use the special
5697 * "shopping" argument, to force certain commands to be converted
5698 * into other commands, normally, we convert "p" (pray) and "m"
5699 * (cast magic) into "g" (get), and "s" (search) into "d" (drop).
5702 void do_cmd_store(void)
5708 bool need_redraw_store_inv; /* To redraw missiles damage and prices in store */
5711 if(p_ptr->wild_mode) return;
5712 Term_get_size(&w, &h);
5714 /* Calculate stocks per 1 page */
5715 xtra_stock = MIN(14+26, ((h > 24) ? (h - 24) : 0));
5716 store_bottom = MIN_STOCK + xtra_stock;
5718 /* Access the player grid */
5719 g_ptr = ¤t_floor_ptr->grid_array[p_ptr->y][p_ptr->x];
5721 /* Verify a store */
5722 if (!cave_have_flag_grid(g_ptr, FF_STORE))
5724 msg_print(_("ここには店がありません。", "You see no store here."));
5728 /* Extract the store code */
5729 which = f_info[g_ptr->feat].subtype;
5731 old_town_num = p_ptr->town_num;
5732 if ((which == STORE_HOME) || (which == STORE_MUSEUM)) p_ptr->town_num = 1;
5733 if (current_floor_ptr->dun_level) p_ptr->town_num = NO_TOWN;
5734 inner_town_num = p_ptr->town_num;
5736 /* Hack -- Check the "locked doors" */
5737 if ((town_info[p_ptr->town_num].store[which].store_open >= current_world_ptr->game_turn) ||
5740 msg_print(_("ドアに鍵がかかっている。", "The doors are locked."));
5741 p_ptr->town_num = old_town_num;
5745 /* Calculate the number of store maintainances since the last visit */
5746 maintain_num = (current_world_ptr->game_turn - town_info[p_ptr->town_num].store[which].last_visit) / (TURNS_PER_TICK * STORE_TICKS);
5748 /* Maintain the store max. 10 times */
5749 if (maintain_num > 10) maintain_num = 10;
5753 /* Maintain the store */
5754 for (i = 0; i < maintain_num; i++)
5755 store_maint(p_ptr->town_num, which);
5757 /* Save the visit */
5758 town_info[p_ptr->town_num].store[which].last_visit = current_world_ptr->game_turn;
5764 /* Hack -- Character is in "icky" mode */
5765 character_icky = TRUE;
5772 /* Do not expand macros */
5773 get_com_no_macros = TRUE;
5775 /* Save the store number */
5776 cur_store_num = which;
5778 /* Hack -- save the store feature */
5779 cur_store_feat = g_ptr->feat;
5781 /* Save the store and owner pointers */
5782 st_ptr = &town_info[p_ptr->town_num].store[cur_store_num];
5783 ot_ptr = &owners[cur_store_num][st_ptr->owner];
5785 /* Start at the beginning */
5788 play_music(TERM_XTRA_MUSIC_BASIC, MUSIC_BASIC_BUILD);
5793 leave_store = FALSE;
5795 /* Interact with player */
5796 while (!leave_store)
5798 /* Hack -- Clear line 1 */
5802 clear_from(20 + xtra_stock);
5804 /* Basic commands */
5805 prt(_(" ESC) 建物から出る", " ESC) Exit from Building."), 21 + xtra_stock, 0);
5807 /* Browse if necessary */
5808 if (st_ptr->stock_num > store_bottom)
5810 prt(_(" -)前ページ", " -) Previous page"), 22 + xtra_stock, 0);
5811 prt(_(" スペース) 次ページ", " SPACE) Next page"), 23 + xtra_stock, 0);
5815 if (cur_store_num == STORE_HOME)
5817 prt(_("g) アイテムを取る", "g) Get an item."), 21 + xtra_stock, 27);
5818 prt(_("d) アイテムを置く", "d) Drop an item."), 22 + xtra_stock, 27);
5819 prt(_("x) 家のアイテムを調べる", "x) eXamine an item in the home."), 23 + xtra_stock, 27);
5822 /* Museum commands */
5823 else if (cur_store_num == STORE_MUSEUM)
5825 prt(_("d) アイテムを置く", "d) Drop an item."), 21 + xtra_stock, 27);
5826 prt(_("r) アイテムの展示をやめる", "r) order to Remove an item."), 22 + xtra_stock, 27);
5827 prt(_("x) 博物館のアイテムを調べる", "x) eXamine an item in the museum."), 23 + xtra_stock, 27);
5833 prt(_("p) 商品を買う", "p) Purchase an item."), 21 + xtra_stock, 30);
5834 prt(_("s) アイテムを売る", "s) Sell an item."), 22 + xtra_stock, 30);
5835 prt(_("x) 商品を調べる", "x) eXamine an item in the shop"), 23 + xtra_stock,30);
5839 prt(_("i/e) 持ち物/装備の一覧", "i/e) Inventry/Equipment list"), 21 + xtra_stock, 56);
5841 if (rogue_like_commands)
5843 prt(_("w/T) 装備する/はずす", "w/T) Wear/Take off equipment"), 22 + xtra_stock, 56);
5847 prt(_("w/t) 装備する/はずす", "w/t) Wear/Take off equipment"), 22 + xtra_stock, 56);
5851 prt(_("コマンド:", "You may: "), 20 + xtra_stock, 0);
5853 request_command(TRUE);
5855 /* Process the command */
5856 store_process_command();
5859 * Hack -- To redraw missiles damage and prices in store
5860 * If player's charisma changes, or if player changes a bow, PU_BONUS is set
5862 need_redraw_store_inv = (p_ptr->update & PU_BONUS) ? TRUE : FALSE;
5864 /* Hack -- Character is still in "icky" mode */
5865 character_icky = TRUE;
5870 if (p_ptr->inventory_list[INVEN_PACK].k_idx)
5872 INVENTORY_IDX item = INVEN_PACK;
5874 object_type *o_ptr = &p_ptr->inventory_list[item];
5876 /* Hack -- Flee from the store */
5877 if (cur_store_num != STORE_HOME)
5879 if (cur_store_num == STORE_MUSEUM)
5880 msg_print(_("ザックからアイテムがあふれそうなので、あわてて博物館から出た...", "Your pack is so full that you flee the Museum..."));
5882 msg_print(_("ザックからアイテムがあふれそうなので、あわてて店から出た...", "Your pack is so full that you flee the store..."));
5888 /* Hack -- Flee from the home */
5889 else if (!store_check_num(o_ptr))
5891 msg_print(_("ザックからアイテムがあふれそうなので、あわてて家から出た...", "Your pack is so full that you flee your home..."));
5896 /* Hack -- Drop items into the home */
5904 GAME_TEXT o_name[MAX_NLEN];
5906 /* Give a message */
5907 msg_print(_("ザックからアイテムがあふれてしまった!", "Your pack overflows!"));
5911 object_copy(q_ptr, o_ptr);
5912 object_desc(o_name, q_ptr, 0);
5914 msg_format(_("%sが落ちた。(%c)", "You drop %s (%c)."), o_name, index_to_label(item));
5916 /* Remove it from the players p_ptr->inventory_list */
5917 inven_item_increase(item, -255);
5918 inven_item_describe(item);
5919 inven_item_optimize(item);
5922 /* Let the home carry it */
5923 item_pos = home_carry(q_ptr);
5925 /* Redraw the home */
5928 store_top = (item_pos / store_bottom) * store_bottom;
5929 display_inventory();
5934 /* Hack -- Redisplay store prices if charisma changes */
5935 /* Hack -- Redraw missiles damage if player changes bow */
5936 if (need_redraw_store_inv) display_inventory();
5938 /* Hack -- get kicked out of the store */
5939 if (st_ptr->store_open >= current_world_ptr->game_turn) leave_store = TRUE;
5942 select_floor_music();
5944 p_ptr->town_num = old_town_num;
5946 take_turn(p_ptr, 100);
5948 /* Hack -- Character is no longer in "icky" mode */
5949 character_icky = FALSE;
5951 /* Hack -- Cancel automatic command */
5954 /* Hack -- Cancel "see" mode */
5955 command_see = FALSE;
5957 /* Allow expanding macros */
5958 get_com_no_macros = FALSE;
5963 /* Update everything */
5964 p_ptr->update |= (PU_VIEW | PU_LITE | PU_MON_LITE);
5965 p_ptr->update |= (PU_MONSTERS);
5967 /* Redraw entire screen */
5968 p_ptr->redraw |= (PR_BASIC | PR_EXTRA | PR_EQUIPPY);
5969 p_ptr->redraw |= (PR_MAP);
5970 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
5976 * @brief 現在の町の店主を交代させる /
5977 * Shuffle one of the stores.
5978 * @param which 店舗種類のID
5981 void store_shuffle(int which)
5987 if (which == STORE_HOME) return;
5988 if (which == STORE_MUSEUM) return;
5991 /* Save the store index */
5992 cur_store_num = which;
5994 /* Activate that store */
5995 st_ptr = &town_info[p_ptr->town_num].store[cur_store_num];
5998 /* Pick a new owner */
6001 st_ptr->owner = (byte)randint0(MAX_OWNERS);
6002 if (j == st_ptr->owner) continue;
6003 for (i = 1;i < max_towns; i++)
6005 if (i == p_ptr->town_num) continue;
6006 if (st_ptr->owner == town_info[i].store[cur_store_num].owner) break;
6008 if (i == max_towns) break;
6011 /* Activate the new owner */
6012 ot_ptr = &owners[cur_store_num][st_ptr->owner];
6015 /* Reset the owner data */
6016 st_ptr->insult_cur = 0;
6017 st_ptr->store_open = 0;
6018 st_ptr->good_buy = 0;
6019 st_ptr->bad_buy = 0;
6022 /* Hack -- discount all the items */
6023 for (i = 0; i < st_ptr->stock_num; i++)
6027 o_ptr = &st_ptr->stock[i];
6029 if (!object_is_artifact(o_ptr))
6031 /* Hack -- Sell all non-artifact old items for "half price" */
6032 o_ptr->discount = 50;
6034 /* Hack -- Items are no longer "fixed price" */
6035 o_ptr->ident &= ~(IDENT_FIXED);
6037 /* Mega-Hack -- Note that the item is "on sale" */
6038 o_ptr->inscription = quark_add(_("売出中", "on sale"));
6045 * @brief 店の品揃えを変化させる /
6046 * Maintain the p_ptr->inventory_list at the stores.
6047 * @param town_num 町のID
6048 * @param store_num 店舗種類のID
6051 void store_maint(int town_num, int store_num)
6055 cur_store_num = store_num;
6058 if (store_num == STORE_HOME) return;
6059 if (store_num == STORE_MUSEUM) return;
6061 /* Activate that store */
6062 st_ptr = &town_info[town_num].store[store_num];
6064 /* Activate the owner */
6065 ot_ptr = &owners[store_num][st_ptr->owner];
6067 /* Store keeper forgives the player */
6068 st_ptr->insult_cur = 0;
6070 /* Mega-Hack -- prune the black market */
6071 if (store_num == STORE_BLACK)
6073 /* Destroy crappy black market items */
6074 for (j = st_ptr->stock_num - 1; j >= 0; j--)
6076 object_type *o_ptr = &st_ptr->stock[j];
6078 /* Destroy crappy items */
6079 if (black_market_crap(o_ptr))
6081 /* Destroy the item */
6082 store_item_increase(j, 0 - o_ptr->number);
6083 store_item_optimize(j);
6089 /* Choose the number of slots to keep */
6090 j = st_ptr->stock_num;
6092 /* Sell a few items */
6093 j = j - randint1(STORE_TURNOVER);
6095 /* Never keep more than "STORE_MAX_KEEP" slots */
6096 if (j > STORE_MAX_KEEP) j = STORE_MAX_KEEP;
6098 /* Always "keep" at least "STORE_MIN_KEEP" items */
6099 if (j < STORE_MIN_KEEP) j = STORE_MIN_KEEP;
6101 /* Hack -- prevent "underflow" */
6104 /* Destroy objects until only "j" slots are left */
6105 while (st_ptr->stock_num > j) store_delete();
6108 /* Choose the number of slots to fill */
6109 j = st_ptr->stock_num;
6111 /* Buy some more items */
6112 j = j + randint1(STORE_TURNOVER);
6114 /* Never keep more than "STORE_MAX_KEEP" slots */
6115 if (j > STORE_MAX_KEEP) j = STORE_MAX_KEEP;
6117 /* Always "keep" at least "STORE_MIN_KEEP" items */
6118 if (j < STORE_MIN_KEEP) j = STORE_MIN_KEEP;
6120 /* Hack -- prevent "overflow" */
6121 if (j >= st_ptr->stock_size) j = st_ptr->stock_size - 1;
6123 /* Acquire some new items */
6124 while (st_ptr->stock_num < j) store_create();
6129 * @brief 店舗情報を初期化する /
6130 * Initialize the stores
6131 * @param town_num 町のID
6132 * @param store_num 店舗種類のID
6135 void store_init(int town_num, int store_num)
6138 cur_store_num = store_num;
6140 /* Activate that store */
6141 st_ptr = &town_info[town_num].store[store_num];
6149 st_ptr->owner = (byte)randint0(MAX_OWNERS);
6150 for (i = 1;i < max_towns; i++)
6152 if (i == town_num) continue;
6153 if (st_ptr->owner == town_info[i].store[store_num].owner) break;
6155 if (i == max_towns) break;
6158 /* Activate the new owner */
6159 ot_ptr = &owners[store_num][st_ptr->owner];
6162 /* Initialize the store */
6163 st_ptr->store_open = 0;
6164 st_ptr->insult_cur = 0;
6165 st_ptr->good_buy = 0;
6166 st_ptr->bad_buy = 0;
6168 /* Nothing in stock */
6169 st_ptr->stock_num = 0;
6172 * MEGA-HACK - Last visit to store is
6173 * BEFORE player birth to enable store restocking
6175 st_ptr->last_visit = -10L * TURNS_PER_TICK * STORE_TICKS;
6177 /* Clear any old items */
6178 for (k = 0; k < st_ptr->stock_size; k++)
6180 object_wipe(&st_ptr->stock[k]);
6186 * @brief アイテムを町のブラックマーケットに移動させる /
6187 * @param o_ptr 移動させたいオブジェクトの構造体参照ポインタ
6190 void move_to_black_market(object_type *o_ptr)
6193 if (!p_ptr->town_num) return;
6195 st_ptr = &town_info[p_ptr->town_num].store[STORE_BLACK];
6197 o_ptr->ident |= IDENT_STORE;
6199 (void)store_carry(o_ptr);
6201 object_wipe(o_ptr); /* Don't leave a bogus object behind... */