3 * @brief 店の処理 / Store commands
6 * Copyright (c) 1989 James E. Wilson, Robert A. Koeneke\n
7 * This software may be copied and distributed for educational, research, and\n
8 * not for profit purposes provided that this copyright and statement are\n
9 * included in all such copies.\n
10 * 2014 Deskull rearranged comment for Doxygen.
18 #include "cmd-smith.h"
19 #include "cmd-zapwand.h"
20 #include "cmd-magiceat.h"
24 #include "cmd-spell.h"
26 #include "player-status.h"
27 #include "object-flavor.h"
28 #include "object-hook.h"
29 #include "floor-events.h"
32 #include "player-effects.h"
33 #include "player-race.h"
36 #include "objectkind.h"
38 #include "floor-town.h"
43 * @brief 闘技場のモンスターID及び報酬アイテムテーブル /
44 * Store owners (exactly four "possible" owners per store, chosen randomly)
47 * { name, purse, max greed, min greed, haggle_per, tolerance, race, unused }
49 * Lifted extra shopkeepers from CthAngband (don't you just love open source
50 * development? ;-)). Since this gave less than 32 unique names for some
51 * shops, those have their first x names copied to reach 32.
53 * For the weapon and armour shops, several owners have a limit of 5k.
55 * I want to do 50k owners, but the purse is currently s16b. Perhaps
56 * we should just store 1/10th of the purse?
59 const owner_type owners[MAX_STORES][MAX_OWNERS] =
62 /* General store - 32 unique names */
64 Raistlin は dragonlance の powerful wizard 。
65 Rincewind the Chicken は Terry Pratchett の Discworld の登場人物 上記のパロディ?、
66 { "憶病者ラストリン", 200, 175, 108, 4, 12, RACE_HUMAN},
67 { "Raistlin the Chicken", 200, 175, 108, 4, 12, RACE_HUMAN},
71 { "フレンドリーなビルボ", 200, 170, 108, 5, 15, RACE_HOBBIT},
72 { "憶病者リンスウィンド", 200, 175, 108, 4, 12, RACE_HUMAN},
73 { "背の低いサルタン", 300, 170, 107, 5, 15, RACE_GNOME},
74 { "ハンサムなライア=エル", 300, 165, 107, 6, 18, RACE_ELF},
75 { "親切なファリルマウエン", 250, 170, 108, 5, 15, RACE_HOBBIT},
76 { "臆病者ヴォワラン", 500, 175, 108, 4, 12, RACE_HUMAN},
77 { "チビのエラシュナク", 750, 170, 107, 5, 15, RACE_BEASTMAN},
78 { "ハンサムなグラッグ", 1000, 165, 107, 6, 18, RACE_HALF_TITAN},
79 { "ケチなフォロビア", 250, 170, 108, 5, 15, RACE_HUMAN},
80 { "馬鹿のエリス", 500, 175, 108, 4, 12, RACE_HUMAN},
81 { "腹ペコのフィルバート", 750, 170, 107, 5, 15, RACE_VAMPIRE},
82 { "スナーグル・サシグア", 1000, 165, 107, 6, 18, RACE_MIND_FLAYER},
83 { "長死きエロワーズ", 250, 170, 108, 5, 15, RACE_SPECTRE},
84 { "ノロマのフンディ", 500, 175, 108, 4, 12, RACE_ZOMBIE},
85 { "グランサス", 750, 170, 107, 5, 15, RACE_SKELETON},
86 { "丁寧なロラックス", 1000, 165, 107, 6, 18, RACE_VAMPIRE},
87 { "ブッチ", 250, 170, 108, 5, 15, RACE_HALF_ORC},
88 { "美しきエルベレス", 500, 175, 108, 4, 12, RACE_HIGH_ELF},
89 { "こそこそサーレス", 750, 170, 107, 5, 15, RACE_GNOME},
90 { "ナーロック", 1000, 165, 107, 6, 18, RACE_DWARF},
91 { "チビのヘイネッカ", 250, 170, 108, 5, 15, RACE_GNOME},
92 { "きちがいロワラン", 500, 175, 108, 4, 12, RACE_HALF_GIANT},
93 { "毒息のウート", 750, 170, 107, 5, 15, RACE_DRACONIAN},
94 { "でぶっちょアラァカ", 1000, 165, 107, 6, 18, RACE_DRACONIAN},
95 { "低能なプーゴー", 250, 170, 108, 5, 15, RACE_BEASTMAN},
96 { "フェロールフィリアン", 500, 175, 108, 4, 12, RACE_ELF},
97 { "年寄りマロカ", 750, 170, 107, 5, 15, RACE_GNOME},
98 { "勇敢なサシン", 1000, 165, 107, 6, 18, RACE_HALF_GIANT},
99 { "田舎者アビエマール", 250, 170, 108, 5, 15, RACE_HUMAN},
100 { "貧乏なハーク", 500, 175, 108, 4, 12, RACE_HALF_ORC},
101 { "みじめなソアリン", 750, 170, 107, 5, 15, RACE_ZOMBIE},
102 { "質素なメルラ", 1000, 165, 107, 6, 18, RACE_ELF},
104 { "Bilbo the Friendly", 200, 170, 108, 5, 15, RACE_HOBBIT},
105 { "Rincewind the Chicken", 200, 175, 108, 4, 12, RACE_HUMAN},
106 { "Sultan the Midget", 300, 170, 107, 5, 15, RACE_GNOME},
107 { "Lyar-el the Comely", 300, 165, 107, 6, 18, RACE_ELF},
108 { "Falilmawen the Friendly", 250, 170, 108, 5, 15, RACE_HOBBIT},
109 { "Voirin the Cowardly", 500, 175, 108, 4, 12, RACE_HUMAN},
110 { "Erashnak the Midget", 750, 170, 107, 5, 15, RACE_BEASTMAN},
111 { "Grug the Comely", 1000, 165, 107, 6, 18, RACE_HALF_TITAN},
112 { "Forovir the Cheap", 250, 170, 108, 5, 15, RACE_HUMAN},
113 { "Ellis the Fool", 500, 175, 108, 4, 12, RACE_HUMAN},
114 { "Filbert the Hungry", 750, 170, 107, 5, 15, RACE_VAMPIRE},
115 { "Fthnargl Psathiggua", 1000, 165, 107, 6, 18, RACE_MIND_FLAYER},
116 { "Eloise Long-Dead", 250, 170, 108, 5, 15, RACE_SPECTRE},
117 { "Fundi the Slow", 500, 175, 108, 4, 12, RACE_ZOMBIE},
118 { "Granthus", 750, 170, 107, 5, 15, RACE_SKELETON},
119 { "Lorax the Suave", 1000, 165, 107, 6, 18, RACE_VAMPIRE},
120 { "Butch", 250, 170, 108, 5, 15, RACE_HALF_ORC},
121 { "Elbereth the Beautiful", 500, 175, 108, 4, 12, RACE_HIGH_ELF},
122 { "Sarleth the Sneaky", 750, 170, 107, 5, 15, RACE_GNOME},
123 { "Narlock", 1000, 165, 107, 6, 18, RACE_DWARF},
124 { "Haneka the Small", 250, 170, 108, 5, 15, RACE_GNOME},
125 { "Loirin the Mad", 500, 175, 108, 4, 12, RACE_HALF_GIANT},
126 { "Wuto Poisonbreath", 750, 170, 107, 5, 15, RACE_DRACONIAN},
127 { "Araaka the Rotund", 1000, 165, 107, 6, 18, RACE_DRACONIAN},
128 { "Poogor the Dumb", 250, 170, 108, 5, 15, RACE_BEASTMAN},
129 { "Felorfiliand", 500, 175, 108, 4, 12, RACE_ELF},
130 { "Maroka the Aged", 750, 170, 107, 5, 15, RACE_GNOME},
131 { "Sasin the Bold", 1000, 165, 107, 6, 18, RACE_HALF_GIANT},
132 { "Abiemar the Peasant", 250, 170, 108, 5, 15, RACE_HUMAN},
133 { "Hurk the Poor", 500, 175, 108, 4, 12, RACE_HALF_ORC},
134 { "Soalin the Wretched", 750, 170, 107, 5, 15, RACE_ZOMBIE},
135 { "Merulla the Humble", 1000, 165, 107, 6, 18, RACE_ELF},
139 /* Armoury - 28 unique names */
141 { "醜悪コン=ダー", 5000, 210, 115, 5, 7, RACE_HALF_ORC},
142 { "頑固者ダーグ=ロウ", 10000, 190, 111, 4, 9, RACE_HUMAN},
143 { "賢者デカド", 25000, 200, 112, 4, 10, RACE_DUNADAN},
144 { "鍛冶屋のウィーランド", 30000, 200, 112, 4, 5, RACE_DWARF},
145 { "醜悪コン=ダー", 10000, 210, 115, 5, 7, RACE_HALF_ORC},
146 { "頑固者ダーグ=ロウ", 15000, 190, 111, 4, 9, RACE_HUMAN},
147 { "ハンサムなデカド", 25000, 200, 112, 4, 10, RACE_AMBERITE},
148 { "エロー・ドラゴンスケイル", 30000, 200, 112, 4, 5, RACE_ELF},
149 { "デリカトス", 10000, 210, 115, 5, 7, RACE_SPRITE},
150 { "巨大なグルース", 15000, 190, 111, 4, 9, RACE_HALF_GIANT},
151 { "アニムス", 25000, 200, 112, 4, 10, RACE_GOLEM},
152 { "マルヴァス", 30000, 200, 112, 4, 5, RACE_HALF_TITAN},
153 { "セラクシス", 10000, 210, 115, 5, 7, RACE_ZOMBIE},
154 { "デス・チル", 5000, 190, 111, 4, 9, RACE_SPECTRE},
155 { "微かなドリオス", 25000, 200, 112, 4, 10, RACE_SPECTRE},
156 { "冷たいバスリック", 30000, 200, 112, 4, 5, RACE_VAMPIRE},
157 { "冷酷ヴェンジェラ", 10000, 210, 115, 5, 7, RACE_HALF_TROLL},
158 { "強者ウィラナ", 15000, 190, 111, 4, 9, RACE_HUMAN},
159 { "ヨジョ二世", 25000, 200, 112, 4, 10, RACE_DWARF},
160 { "優しいラナラー", 30000, 200, 112, 4, 5, RACE_AMBERITE},
161 { "不浄のホルバグ", 5000, 210, 115, 5, 7, RACE_HALF_ORC},
162 { "テレパスのエレレン", 15000, 190, 111, 4, 9, RACE_DARK_ELF},
163 { "イスドリリアス", 25000, 200, 112, 4, 10, RACE_SPRITE},
164 { "一つ目ヴェグナー", 5000, 200, 112, 4, 5, RACE_CYCLOPS},
165 { "混沌のロディッシュ", 10000, 210, 115, 5, 7, RACE_BEASTMAN},
166 { "剣豪ヘジン", 15000, 190, 111, 4, 9, RACE_NIBELUNG},
167 { "ずる屋のエルベレリス", 10000, 200, 112, 4, 10, RACE_DARK_ELF},
168 { "インプのザサス", 30000, 200, 112, 4, 5, RACE_IMP},
169 { "醜悪コン=ダー", 5000, 210, 115, 5, 7, RACE_HALF_ORC},
170 { "頑固者ダーグ=ロウ", 10000, 190, 111, 4, 9, RACE_HUMAN},
171 { "ハンサムなデカド", 25000, 200, 112, 4, 10, RACE_AMBERITE},
172 { "鍛冶屋のウィーランド", 30000, 200, 112, 4, 5, RACE_DWARF},
174 { "Kon-Dar the Ugly", 5000, 210, 115, 5, 7, RACE_HALF_ORC},
175 { "Darg-Low the Grim", 10000, 190, 111, 4, 9, RACE_HUMAN},
176 { "Decado the Handsome", 25000, 200, 112, 4, 10, RACE_DUNADAN},
177 { "Wieland the Smith", 30000, 200, 112, 4, 5, RACE_DWARF},
178 { "Kon-Dar the Ugly", 10000, 210, 115, 5, 7, RACE_HALF_ORC},
179 { "Darg-Low the Grim", 15000, 190, 111, 4, 9, RACE_HUMAN},
180 { "Decado the Handsome", 25000, 200, 112, 4, 10, RACE_AMBERITE},
181 { "Elo Dragonscale", 30000, 200, 112, 4, 5, RACE_ELF},
182 { "Delicatus", 10000, 210, 115, 5, 7, RACE_SPRITE},
183 { "Gruce the Huge", 15000, 190, 111, 4, 9, RACE_HALF_GIANT},
184 { "Animus", 25000, 200, 112, 4, 10, RACE_GOLEM},
185 { "Malvus", 30000, 200, 112, 4, 5, RACE_HALF_TITAN},
186 { "Selaxis", 10000, 210, 115, 5, 7, RACE_ZOMBIE},
187 { "Deathchill", 5000, 190, 111, 4, 9, RACE_SPECTRE},
188 { "Drios the Faint", 25000, 200, 112, 4, 10, RACE_SPECTRE},
189 { "Bathric the Cold", 30000, 200, 112, 4, 5, RACE_VAMPIRE},
190 { "Vengella the Cruel", 10000, 210, 115, 5, 7, RACE_HALF_TROLL},
191 { "Wyrana the Mighty", 15000, 190, 111, 4, 9, RACE_HUMAN},
192 { "Yojo II", 25000, 200, 112, 4, 10, RACE_DWARF},
193 { "Ranalar the Sweet", 30000, 200, 112, 4, 5, RACE_AMBERITE},
194 { "Horbag the Unclean", 5000, 210, 115, 5, 7, RACE_HALF_ORC},
195 { "Elelen the Telepath", 15000, 190, 111, 4, 9, RACE_DARK_ELF},
196 { "Isedrelias", 25000, 200, 112, 4, 10, RACE_SPRITE},
197 { "Vegnar One-eye", 5000, 200, 112, 4, 5, RACE_CYCLOPS},
198 { "Rodish the Chaotic", 10000, 210, 115, 5, 7, RACE_BEASTMAN},
199 { "Hesin Swordmaster", 15000, 190, 111, 4, 9, RACE_NIBELUNG},
200 { "Elvererith the Cheat", 10000, 200, 112, 4, 10, RACE_DARK_ELF},
201 { "Zzathath the Imp", 30000, 200, 112, 4, 5, RACE_IMP},
202 { "Kon-Dar the Ugly", 5000, 210, 115, 5, 7, RACE_HALF_ORC},
203 { "Darg-Low the Grim", 10000, 190, 111, 4, 9, RACE_HUMAN},
204 { "Decado the Handsome", 25000, 200, 112, 4, 10, RACE_AMBERITE},
205 { "Wieland the Smith", 30000, 200, 112, 4, 5, RACE_DWARF},
210 /* Weapon Smith - 28 unique names */
212 { "残忍なるアーノルド", 5000, 210, 115, 6, 6, RACE_HALF_TROLL},
213 { "獣殺しのアーンダル", 10000, 185, 110, 5, 9, RACE_HALF_ELF},
214 { "獣マスターのエディー", 25000, 190, 115, 5, 7, RACE_HOBBIT},
215 { "竜殺しのオグライン", 30000, 195, 112, 4, 8, RACE_DWARF},
216 { "熟練者ドリュー", 10000, 210, 115, 6, 6, RACE_HUMAN},
217 { "龍の子オラックス", 15000, 185, 110, 5, 9, RACE_DRACONIAN},
218 { "病気持ちのアンスラックス", 25000, 190, 115, 5, 7, RACE_BEASTMAN},
219 { "頑丈者アルコス", 30000, 195, 112, 4, 8, RACE_DWARF},
220 { "腐れ者のサリアス", 5000, 210, 115, 6, 6, RACE_ZOMBIE},
221 { "晒し骨のトゥエシク", 15000, 185, 110, 5, 9, RACE_SKELETON},
222 { "ビリオス", 25000, 190, 115, 5, 7, RACE_BEASTMAN},
223 { "ファスガル", 30000, 195, 112, 4, 8, RACE_ZOMBIE},
224 { "パラディンのエレフリス", 10000, 210, 115, 6, 6, RACE_BARBARIAN},
225 { "キ'トリッ'ク", 15000, 185, 110, 5, 9, RACE_KLACKON},
226 { "蜘蛛の友ドゥロカス", 25000, 190, 115, 5, 7, RACE_DARK_ELF},
227 { "巨人殺しのフングス", 30000, 195, 112, 4, 8, RACE_DWARF},
228 { "デランサ", 10000, 210, 115, 6, 6, RACE_ELF},
229 { "レンジャーのソルビスタニ", 15000, 185, 110, 5, 9, RACE_HALF_ELF},
230 { "ノロマのゾリル", 25000, 190, 115, 5, 7, RACE_GOLEM},
231 { "イーオン・フラックス", 20000, 195, 112, 4, 8, RACE_HALF_ELF},
232 { "強者ナドック", 10000, 210, 115, 6, 6, RACE_HOBBIT},
233 { "弱虫エラモグ", 15000, 185, 110, 5, 9, RACE_KOBOLD},
234 { "公正なエオウィリス", 25000, 190, 115, 5, 7, RACE_VAMPIRE},
235 { "バルログ殺しのヒュイモグ", 30000, 195, 112, 4, 8, RACE_HALF_ORC},
236 { "冷酷ピーダス", 5000, 210, 115, 6, 6, RACE_HUMAN},
237 { "ヴァモグ スレイヤー", 15000, 185, 110, 5, 9, RACE_HALF_OGRE},
238 { "性悪フーシュナク", 25000, 190, 115, 5, 7, RACE_BEASTMAN},
239 { "舞闘バレン", 30000, 195, 112, 4, 8, RACE_BARBARIAN},
240 { "残忍なるアーノルド", 5000, 210, 115, 6, 6, RACE_BARBARIAN},
241 { "獣殺しのアーンダル", 10000, 185, 110, 5, 9, RACE_HALF_ELF},
242 { "ビーストマスター・エディー", 25000, 190, 115, 5, 7, RACE_HALF_ORC},
243 { "竜殺しのオグライン", 30000, 195, 112, 4, 8, RACE_DWARF},
245 { "Arnold the Beastly", 5000, 210, 115, 6, 6, RACE_BARBARIAN},
246 { "Arndal Beast-Slayer", 10000, 185, 110, 5, 9, RACE_HALF_ELF},
247 { "Eddie Beast-Master", 25000, 190, 115, 5, 7, RACE_HALF_ORC},
248 { "Oglign Dragon-Slayer", 30000, 195, 112, 4, 8, RACE_DWARF},
249 { "Drew the Skilled", 10000, 210, 115, 6, 6, RACE_HUMAN},
250 { "Orrax Dragonson", 15000, 185, 110, 5, 9, RACE_DRACONIAN},
251 { "Anthrax Disease-Carrier", 25000, 190, 115, 5, 7, RACE_BEASTMAN},
252 { "Arkhoth the Stout", 30000, 195, 112, 4, 8, RACE_DWARF},
253 { "Sarlyas the Rotten", 5000, 210, 115, 6, 6, RACE_ZOMBIE},
254 { "Tuethic Bare-Bones", 15000, 185, 110, 5, 9, RACE_SKELETON},
255 { "Bilious", 25000, 190, 115, 5, 7, RACE_BEASTMAN},
256 { "Fasgul", 30000, 195, 112, 4, 8, RACE_ZOMBIE},
257 { "Ellefris the Paladin", 10000, 210, 115, 6, 6, RACE_BARBARIAN},
258 { "K'trrik'k", 15000, 185, 110, 5, 9, RACE_KLACKON},
259 { "Drocus Spiderfriend", 25000, 190, 115, 5, 7, RACE_DARK_ELF},
260 { "Fungus Giant-Slayer", 30000, 195, 112, 4, 8, RACE_DWARF},
261 { "Delantha", 10000, 210, 115, 6, 6, RACE_ELF},
262 { "Solvistani the Ranger", 15000, 185, 110, 5, 9, RACE_HALF_ELF},
263 { "Xoril the Slow", 25000, 190, 115, 5, 7, RACE_GOLEM},
264 { "Aeon Flux", 20000, 195, 112, 4, 8, RACE_HALF_ELF},
265 { "Nadoc the Strong", 10000, 210, 115, 6, 6, RACE_HOBBIT},
266 { "Eramog the Weak", 15000, 185, 110, 5, 9, RACE_KOBOLD},
267 { "Eowilith the Fair", 25000, 190, 115, 5, 7, RACE_VAMPIRE},
268 { "Huimog Balrog-Slayer", 30000, 195, 112, 4, 8, RACE_HALF_ORC},
269 { "Peadus the Cruel", 5000, 210, 115, 6, 6, RACE_HUMAN},
270 { "Vamog Slayer", 15000, 185, 110, 5, 9, RACE_HALF_OGRE},
271 { "Hooshnak the Vicious", 25000, 190, 115, 5, 7, RACE_BEASTMAN},
272 { "Balenn War-Dancer", 30000, 195, 112, 4, 8, RACE_BARBARIAN},
273 { "Arnold the Beastly", 5000, 210, 115, 6, 6, RACE_BARBARIAN},
274 { "Arndal Beast-Slayer", 10000, 185, 110, 5, 9, RACE_HALF_ELF},
275 { "Eddie Beast-Master", 25000, 190, 115, 5, 7, RACE_HALF_ORC},
276 { "Oglign Dragon-Slayer", 30000, 195, 112, 4, 8, RACE_DWARF},
280 /* Temple - 22 unique names */
282 { "質素なルードヴィヒ", 5000, 175, 109, 6, 15, RACE_HUMAN},
283 { "パラディンのガンナー", 10000, 185, 110, 5, 23, RACE_HUMAN},
284 { "選ばれしトリン", 25000, 180, 107, 6, 20, RACE_ELF},
285 { "賢明なるサラストロ", 30000, 185, 109, 5, 15, RACE_DWARF},
286 { "パーシヴァル卿", 25000, 180, 107, 6, 20, RACE_HIGH_ELF},
287 { "神聖なるアセナス", 30000, 185, 109, 5, 15, RACE_HUMAN},
288 { "マッキノン", 10000, 175, 109, 6, 15, RACE_HUMAN},
289 { "謹み婦人", 15000, 185, 110, 5, 23, RACE_HIGH_ELF},
290 { "ドルイドのハシュニック", 25000, 180, 107, 6, 20, RACE_HOBBIT},
291 { "フィナク", 30000, 185, 109, 5, 15, RACE_YEEK},
292 { "クリキック", 10000, 175, 109, 6, 15, RACE_KLACKON},
293 { "荒くれ者モリヴァル", 15000, 185, 110, 5, 23, RACE_ELF},
294 { "暗きホシャック", 25000, 180, 107, 6, 20, RACE_IMP},
295 { "賢者アタール", 30000, 185, 109, 5, 15, RACE_HUMAN},
296 { "清きイベニッド", 10000, 175, 109, 6, 15, RACE_HUMAN},
297 { "エリディシュ", 15000, 185, 110, 5, 23, RACE_HALF_TROLL},
298 { "呪術師ヴルドゥシュ", 25000, 180, 107, 6, 20, RACE_HALF_OGRE},
299 { "狂戦士ハオブ", 30000, 185, 109, 5, 15, RACE_BARBARIAN},
300 { "若きプルーグディシュ", 10000, 175, 109, 6, 15, RACE_HALF_OGRE},
301 { "きちがいラムワイズ", 15000, 185, 110, 5, 23, RACE_YEEK},
302 { "有徳者ムワート", 25000, 180, 107, 6, 20, RACE_KOBOLD},
303 { "弱虫ダードバード", 30000, 185, 109, 5, 15, RACE_SPECTRE},
304 { "質素なルードヴィヒ", 5000, 175, 109, 6, 15, RACE_HUMAN},
305 { "パラディンのガンナー", 10000, 185, 110, 5, 23, RACE_HUMAN},
306 { "選ばれしトリン", 25000, 180, 107, 6, 20, RACE_ELF},
307 { "賢明なるサラストロ", 30000, 185, 109, 5, 15, RACE_DWARF},
308 { "パーシヴァル卿", 25000, 180, 107, 6, 20, RACE_HIGH_ELF},
309 { "神聖なるアセナス", 30000, 185, 109, 5, 15, RACE_HUMAN},
310 { "マッキノン", 10000, 175, 109, 6, 15, RACE_HUMAN},
311 { "謹み婦人", 15000, 185, 110, 5, 23, RACE_HIGH_ELF},
312 { "ドルイドのハシュニック", 25000, 180, 107, 6, 20, RACE_HOBBIT},
313 { "フィナク", 30000, 185, 109, 5, 15, RACE_YEEK},
315 { "Ludwig the Humble", 5000, 175, 109, 6, 15, RACE_DWARF},
316 { "Gunnar the Paladin", 10000, 185, 110, 5, 23, RACE_HALF_TROLL},
317 { "Torin the Chosen", 25000, 180, 107, 6, 20, RACE_HIGH_ELF},
318 { "Sarastro the Wise", 30000, 185, 109, 5, 15, RACE_HUMAN},
319 { "Sir Parsival the Pure", 25000, 180, 107, 6, 20, RACE_HIGH_ELF},
320 { "Asenath the Holy", 30000, 185, 109, 5, 15, RACE_HUMAN},
321 { "McKinnon", 10000, 175, 109, 6, 15, RACE_HUMAN},
322 { "Mistress Chastity", 15000, 185, 110, 5, 23, RACE_HIGH_ELF},
323 { "Hashnik the Druid", 25000, 180, 107, 6, 20, RACE_HOBBIT},
324 { "Finak", 30000, 185, 109, 5, 15, RACE_YEEK},
325 { "Krikkik", 10000, 175, 109, 6, 15, RACE_KLACKON},
326 { "Morival the Wild", 15000, 185, 110, 5, 23, RACE_ELF},
327 { "Hoshak the Dark", 25000, 180, 107, 6, 20, RACE_IMP},
328 { "Atal the Wise", 30000, 185, 109, 5, 15, RACE_HUMAN},
329 { "Ibenidd the Chaste", 10000, 175, 109, 6, 15, RACE_HUMAN},
330 { "Eridish", 15000, 185, 110, 5, 23, RACE_HALF_TROLL},
331 { "Vrudush the Shaman", 25000, 180, 107, 6, 20, RACE_HALF_OGRE},
332 { "Haob the Berserker", 30000, 185, 109, 5, 15, RACE_BARBARIAN},
333 { "Proogdish the Youthfull", 10000, 175, 109, 6, 15, RACE_HALF_OGRE},
334 { "Lumwise the Mad", 15000, 185, 110, 5, 23, RACE_YEEK},
335 { "Muirt the Virtuous", 25000, 180, 107, 6, 20, RACE_KOBOLD},
336 { "Dardobard the Weak", 30000, 185, 109, 5, 15, RACE_SPECTRE},
337 { "Ludwig the Humble", 5000, 175, 109, 6, 15, RACE_DWARF},
338 { "Gunnar the Paladin", 10000, 185, 110, 5, 23, RACE_HALF_TROLL},
339 { "Torin the Chosen", 25000, 180, 107, 6, 20, RACE_HIGH_ELF},
340 { "Sarastro the Wise", 30000, 185, 109, 5, 15, RACE_HUMAN},
341 { "Sir Parsival the Pure", 25000, 180, 107, 6, 20, RACE_HIGH_ELF},
342 { "Asenath the Holy", 30000, 185, 109, 5, 15, RACE_HUMAN},
343 { "McKinnon", 10000, 175, 109, 6, 15, RACE_HUMAN},
344 { "Mistress Chastity", 15000, 185, 110, 5, 23, RACE_HIGH_ELF},
345 { "Hashnik the Druid", 25000, 180, 107, 6, 20, RACE_HOBBIT},
346 { "Finak", 30000, 185, 109, 5, 15, RACE_YEEK},
350 /* Alchemist - 26 unique names */
352 { "化学者マウザー", 10000, 190, 111, 5, 8, RACE_HALF_ELF},
353 { "カオスのウィズル", 10000, 190, 110, 6, 8, RACE_HOBBIT},
354 { "強欲ミダス", 15000, 200, 116, 6, 9, RACE_GNOME},
355 { "貧弱ジャ=ファー", 15000, 220, 111, 4, 9, RACE_ELF},/*FIRST*/
356 { "カカルラカカル", 15000, 200, 116, 6, 9, RACE_KLACKON},
357 { "錬金術師ジャル=エス", 15000, 220, 111, 4, 9, RACE_ELF},
358 { "用心深いファネラス", 10000, 190, 111, 5, 8, RACE_DWARF},
359 { "キチガイのルンシー", 10000, 190, 110, 6, 8, RACE_HUMAN},
360 { "グランブルワース", 15000, 200, 116, 6, 9, RACE_GNOME},
361 { "フリッター", 15000, 220, 111, 4, 9, RACE_SPRITE},
362 { "ザリルス", 10000, 190, 111, 5, 8, RACE_HUMAN},
363 { "古きエグバート", 10000, 190, 110, 6, 8, RACE_DWARF},
364 { "誇り高きヴァリンドラ", 15000, 200, 116, 6, 9, RACE_HIGH_ELF},
365 { "錬金術師タエン", 15000, 220, 111, 4, 9, RACE_HUMAN},
366 { "巧言カイド", 10000, 190, 111, 5, 8, RACE_VAMPIRE},
367 { "暗きフリア", 10000, 190, 110, 6, 8, RACE_NIBELUNG},
368 { "質素なドムリ", 15000, 200, 116, 6, 9, RACE_DWARF},
369 { "魔の子ヤァジュッカ", 15000, 220, 111, 4, 9, RACE_IMP},
370 { "薬草師ジェララルドール", 10000, 190, 111, 5, 8, RACE_HIGH_ELF},
371 { "賢者オレラルダン", 10000, 190, 110, 6, 8, RACE_BARBARIAN},
372 { "デモニシストのフゾグロ", 15000, 200, 116, 6, 9, RACE_IMP},
373 { "錬金術師ドゥリアシュ", 15000, 220, 111, 4, 9, RACE_HALF_ORC},
374 { "強者ネリア", 10000, 190, 111, 5, 8, RACE_CYCLOPS},
375 { "辛口リグナス", 10000, 190, 110, 6, 8, RACE_HALF_ORC},
376 { "ティルバ", 15000, 200, 116, 6, 9, RACE_HOBBIT},
377 { "金持ちミリルドリック", 15000, 220, 111, 4, 9, RACE_HUMAN},
379 { "科学者マウザー", 10000, 190, 111, 5, 8, RACE_HALF_ELF},
380 { "カオスのウィズル", 10000, 190, 110, 6, 8, RACE_HOBBIT},
381 { "強欲ミダス", 15000, 200, 116, 6, 9, RACE_GNOME},
382 { "錬金術師ジャ=ファー", 15000, 220, 111, 4, 9, RACE_ELF},
383 { "カカルラカカル", 15000, 200, 116, 6, 9, RACE_KLACKON},
384 { "錬金術師ジャル=エス", 15000, 220, 111, 4, 9, RACE_ELF},
386 { "Mauser the Chemist", 10000, 190, 111, 5, 8, RACE_HALF_ELF},
387 { "Wizzle the Chaotic", 10000, 190, 110, 6, 8, RACE_HOBBIT},
388 { "Midas the Greedy", 15000, 200, 116, 6, 9, RACE_GNOME},
389 { "Ja-Far the Alchemist", 15000, 220, 111, 4, 9, RACE_ELF},
390 { "Kakalrakakal", 15000, 200, 116, 6, 9, RACE_KLACKON},
391 { "Jal-Eth the Alchemist", 15000, 220, 111, 4, 9, RACE_ELF},
392 { "Fanelath the Cautious", 10000, 190, 111, 5, 8, RACE_DWARF},
393 { "Runcie the Insane", 10000, 190, 110, 6, 8, RACE_HUMAN},
394 { "Grumbleworth", 15000, 200, 116, 6, 9, RACE_GNOME},
395 { "Flitter", 15000, 220, 111, 4, 9, RACE_SPRITE},
396 { "Xarillus", 10000, 190, 111, 5, 8, RACE_HUMAN},
397 { "Egbert the Old", 10000, 190, 110, 6, 8, RACE_DWARF},
398 { "Valindra the Proud", 15000, 200, 116, 6, 9, RACE_HIGH_ELF},
399 { "Taen the Alchemist", 15000, 220, 111, 4, 9, RACE_HUMAN},
400 { "Cayd the Sweet", 10000, 190, 111, 5, 8, RACE_VAMPIRE},
401 { "Fulir the Dark", 10000, 190, 110, 6, 8, RACE_NIBELUNG},
402 { "Domli the Humble", 15000, 200, 116, 6, 9, RACE_DWARF},
403 { "Yaarjukka Demonspawn", 15000, 220, 111, 4, 9, RACE_IMP},
404 { "Gelaraldor the Herbmaster", 10000, 190, 111, 5, 8, RACE_HIGH_ELF},
405 { "Olelaldan the Wise", 10000, 190, 110, 6, 8, RACE_BARBARIAN},
406 { "Fthoglo the Demonicist", 15000, 200, 116, 6, 9, RACE_IMP},
407 { "Dridash the Alchemist", 15000, 220, 111, 4, 9, RACE_HALF_ORC},
408 { "Nelir the Strong", 10000, 190, 111, 5, 8, RACE_CYCLOPS},
409 { "Lignus the Pungent", 10000, 190, 110, 6, 8, RACE_HALF_ORC},
410 { "Tilba", 15000, 200, 116, 6, 9, RACE_HOBBIT},
411 { "Myrildric the Wealthy", 15000, 220, 111, 4, 9, RACE_HUMAN},
413 { "Mauser the Chemist", 10000, 190, 111, 5, 8, RACE_HALF_ELF},
414 { "Wizzle the Chaotic", 10000, 190, 110, 6, 8, RACE_HOBBIT},
415 { "Midas the Greedy", 15000, 200, 116, 6, 9, RACE_GNOME},
416 { "Ja-Far the Alchemist", 15000, 220, 111, 4, 9, RACE_ELF},
417 { "Kakalrakakal", 15000, 200, 116, 6, 9, RACE_KLACKON},
418 { "Jal-Eth the Alchemist", 15000, 220, 111, 4, 9, RACE_ELF},
423 /* Magic Shop - 23 unique names */
425 { "ソーサラーのロ=パン", 20000, 200, 110, 7, 8, RACE_HALF_ELF},
426 { "偉大なるブガービイ", 20000, 215, 113, 6, 10, RACE_GNOME},
427 { "イェンダーの魔法使い", 30000, 200, 110, 7, 10, RACE_HUMAN},
428 { "死霊使いリャク",30000, 175, 110, 5, 11, RACE_HIGH_ELF},
429 { "魔術師スキドゥニー", 15000, 200, 110, 7, 8, RACE_HALF_ELF},
430 { "幻術師キリア", 30000, 200, 110, 7, 10, RACE_HUMAN},
431 { "死霊術師ニッキ", 30000, 175, 110, 5, 11, RACE_DARK_ELF},
432 { "ソロストラン", 15000, 200, 110, 7, 8, RACE_SPRITE},
433 { "烏賊口アチシェ", 20000, 215, 113, 6, 10, RACE_MIND_FLAYER},
434 { "貴族のカザ", 30000, 200, 110, 7, 10, RACE_HIGH_ELF},
435 { "暗きファジル", 30000, 175, 110, 5, 11, RACE_DARK_ELF},
436 { "偉大なるケルドーン", 15000, 200, 110, 7, 8, RACE_DWARF},
437 { "フィランスロプス", 20000, 215, 113, 6, 10, RACE_HOBBIT},
438 { "魔女のアグナー", 30000, 200, 110, 7, 10, RACE_HUMAN},
439 { "死霊術師ビュリアンス", 30000, 175, 110, 5, 11, RACE_BEASTMAN},
440 { "ハイメイジのヴイラク", 15000, 200, 110, 7, 8, RACE_BEASTMAN},
441 { "知恵者マディッシュ", 20000, 215, 113, 6, 10, RACE_BEASTMAN},
442 { "ファレブリンボール", 30000, 200, 110, 7, 10, RACE_HIGH_ELF},
443 { "陰険フェリル=ガンド", 30000, 175, 110, 5, 11, RACE_DARK_ELF},
444 { "呪術師サレゴード", 15000, 200, 110, 7, 8, RACE_BARBARIAN},
445 { "神秘家クトゥアロス", 20000, 215, 113, 6, 10, RACE_MIND_FLAYER},
446 { "幻術師イベリ", 30000, 200, 110, 7, 10, RACE_SKELETON},
447 { "死霊術師ヘトー", 30000, 175, 110, 5, 11, RACE_YEEK},
448 { "魔術師ロ=パン", 20000, 200, 110, 7, 8, RACE_HALF_ELF},
449 { "偉大なるブガービイ", 20000, 215, 113, 6, 10, RACE_GNOME},
450 { "イェンダーの魔法使い", 30000, 200, 110, 7, 10, RACE_HUMAN},
451 { "死霊術師リャク", 30000, 175, 110, 5, 11, RACE_DARK_ELF},
452 { "魔術師スキドゥニー", 15000, 200, 110, 7, 8, RACE_HALF_ELF},
453 { "幻術師キリア", 30000, 200, 110, 7, 10, RACE_HUMAN},
454 { "死霊術師ニッキ", 30000, 175, 110, 5, 11, RACE_DARK_ELF},
455 { "ソロストラン", 15000, 200, 110, 7, 8, RACE_SPRITE},
456 { "烏賊口アチシェ", 20000, 215, 113, 6, 10, RACE_MIND_FLAYER},
458 { "Lo Pan the Sorcerer", 20000, 200, 110, 7, 8, RACE_HALF_ELF},
459 { "Buggerby the Great", 20000, 215, 113, 6, 10, RACE_GNOME},
460 { "The Wizard of Yendor", 30000, 200, 110, 7, 10, RACE_HUMAN},
461 { "Rjak the Necromancer", 30000, 175, 110, 5, 11, RACE_DARK_ELF},
462 { "Skidney the Sorcerer", 15000, 200, 110, 7, 8, RACE_HALF_ELF},
463 { "Kyria the Illusionist", 30000, 200, 110, 7, 10, RACE_HUMAN},
464 { "Nikki the Necromancer", 30000, 175, 110, 5, 11, RACE_DARK_ELF},
465 { "Solostoran", 15000, 200, 110, 7, 8, RACE_SPRITE},
466 { "Achshe the Tentacled", 20000, 215, 113, 6, 10, RACE_MIND_FLAYER},
467 { "Kaza the Noble", 30000, 200, 110, 7, 10, RACE_HIGH_ELF},
468 { "Fazzil the Dark", 30000, 175, 110, 5, 11, RACE_DARK_ELF},
469 { "Keldorn the Grand", 15000, 200, 110, 7, 8, RACE_DWARF},
470 { "Philanthropus", 20000, 215, 113, 6, 10, RACE_HOBBIT},
471 { "Agnar the Enchantress", 30000, 200, 110, 7, 10, RACE_HUMAN},
472 { "Buliance the Necromancer", 30000, 175, 110, 5, 11, RACE_BEASTMAN},
473 { "Vuirak the High-Mage", 15000, 200, 110, 7, 8, RACE_BEASTMAN},
474 { "Madish the Smart", 20000, 215, 113, 6, 10, RACE_BEASTMAN},
475 { "Falebrimbor", 30000, 200, 110, 7, 10, RACE_HIGH_ELF},
476 { "Felil-Gand the Subtle", 30000, 175, 110, 5, 11, RACE_DARK_ELF},
477 { "Thalegord the Shaman", 15000, 200, 110, 7, 8, RACE_BARBARIAN},
478 { "Cthoaloth the Mystic", 20000, 215, 113, 6, 10, RACE_MIND_FLAYER},
479 { "Ibeli the Illusionist", 30000, 200, 110, 7, 10, RACE_SKELETON},
480 { "Heto the Necromancer", 30000, 175, 110, 5, 11, RACE_YEEK},
481 { "Lo Pan the Sorcerer", 20000, 200, 110, 7, 8, RACE_HALF_ELF},
482 { "Buggerby the Great", 20000, 215, 113, 6, 10, RACE_GNOME},
483 { "The Wizard of Yendor", 30000, 200, 110, 7, 10, RACE_HUMAN},
484 { "Rjak the Necromancer", 30000, 175, 110, 5, 11, RACE_DARK_ELF},
485 { "Skidney the Sorcerer", 15000, 200, 110, 7, 8, RACE_HALF_ELF},
486 { "Kyria the Illusionist", 30000, 200, 110, 7, 10, RACE_HUMAN},
487 { "Nikki the Necromancer", 30000, 175, 110, 5, 11, RACE_DARK_ELF},
488 { "Solostoran", 15000, 200, 110, 7, 8, RACE_SPRITE},
489 { "Achshe the Tentacled", 20000, 215, 113, 6, 10, RACE_MIND_FLAYER},
493 /* Black Market - 32 unique names */
495 { "ガリー=ギガズ", 20000, 250, 150, 10, 5, RACE_HALF_TROLL},
496 { "ゴブリンのヒストーア", 20000, 250, 150, 10, 5, RACE_HALF_ORC},
497 { "フェレンギ人クアーク", 30000, 250, 150, 10, 5, RACE_HUMAN},
498 { "公正なる(?)トッピ", 30000, 250, 150, 10, 5, RACE_ELF},
499 { "死人ヴァッサ", 20000, 250, 150, 10, 5, RACE_ZOMBIE},
500 { "裏切り者カイン", 20000, 250, 150, 10, 5, RACE_VAMPIRE},
501 { "ブボニカス", 30000, 250, 150, 10, 5, RACE_BEASTMAN},
502 { "コープスライト", 30000, 250, 150, 10, 5, RACE_SPECTRE},
503 { "血に飢えしパリッシュ", 20000, 250, 150, 10, 5, RACE_VAMPIRE},
504 { "ヴァイル", 20000, 250, 150, 10, 5, RACE_SKELETON},
505 { "信頼のプレンティス", 30000, 250, 150, 10, 5, RACE_SKELETON},
506 { "人間殺しのグリエラ", 30000, 250, 150, 10, 5, RACE_IMP},
507 { "エンジェル", 20000, 250, 150, 10, 5, RACE_VAMPIRE},
508 { "水膨れフロツァム", 20000, 250, 150, 10, 5, RACE_ZOMBIE},
509 { "ニーヴァル", 30000, 250, 150, 10, 5, RACE_VAMPIRE},
510 { "明るいアナスタシア", 30000, 250, 150, 10, 5, RACE_SPECTRE},
511 { "死霊術師チャリティー", 20000, 250, 150, 10, 5, RACE_DARK_ELF},
512 { "ボクサーのプグナシオス", 20000, 250, 150, 10, 5, RACE_HALF_ORC},
513 { "幸運なフットソア", 30000, 250, 150, 10, 5, RACE_BEASTMAN},
514 { "光指のシドリア", 30000, 250, 150, 10, 5, RACE_HUMAN},
515 { "手品師リアソー", 20000, 250, 150, 10, 5, RACE_HOBBIT},
516 { "やりくり上手のジャナッカ", 20000, 250, 150, 10, 5, RACE_GNOME},
517 { "悪党シーナ", 30000, 250, 150, 10, 5, RACE_GNOME},
518 { "大爪アルニッキ", 30000, 250, 150, 10, 5, RACE_DRACONIAN},
519 { "貧乏チャエアンド", 20000, 250, 150, 10, 5, RACE_HUMAN},
520 { "山賊アファードーフ", 20000, 250, 150, 10, 5, RACE_BARBARIAN},
521 { "強欲ラザクスル", 30000, 250, 150, 10, 5, RACE_MIND_FLAYER},
522 { "ファラレウィン", 30000, 250, 150, 10, 5, RACE_SPRITE},
523 { "しわしわヴォスール", 20000, 250, 150, 10, 5, RACE_NIBELUNG},
524 { "ハンサムなアラオード", 20000, 250, 150, 10, 5, RACE_AMBERITE},
525 { "負け犬セラドフリド", 30000, 250, 150, 10, 5, RACE_HUMAN},
526 { "片足のエルーロ", 30000, 250, 150, 10, 5, RACE_HALF_OGRE},
528 { "Gary Gygaz", 20000, 250, 150, 10, 5, RACE_HALF_TROLL},
529 { "Histor the Goblin", 20000, 250, 150, 10, 5, RACE_HALF_ORC},
530 { "Quark the Ferengi", 30000, 250, 150, 10, 5, RACE_DWARF},
531 { "Topi the Fair(?)", 30000, 250, 150, 10, 5, RACE_HUMAN},
532 { "Vhassa the Dead", 20000, 250, 150, 10, 5, RACE_ZOMBIE},
533 { "Kyn the Treacherous", 20000, 250, 150, 10, 5, RACE_VAMPIRE},
534 { "Bubonicus", 30000, 250, 150, 10, 5, RACE_BEASTMAN},
535 { "Corpselight", 30000, 250, 150, 10, 5, RACE_SPECTRE},
536 { "Parrish the Bloodthirsty", 20000, 250, 150, 10, 5, RACE_VAMPIRE},
537 { "Vile", 20000, 250, 150, 10, 5, RACE_SKELETON},
538 { "Prentice the Trusted", 30000, 250, 150, 10, 5, RACE_SKELETON},
539 { "Griella Humanslayer", 30000, 250, 150, 10, 5, RACE_IMP},
540 { "Angel", 20000, 250, 150, 10, 5, RACE_VAMPIRE},
541 { "Flotsam the Bloated", 20000, 250, 150, 10, 5, RACE_ZOMBIE},
542 { "Nieval", 30000, 250, 150, 10, 5, RACE_VAMPIRE},
543 { "Anastasia the Luminous", 30000, 250, 150, 10, 5, RACE_SPECTRE},
544 { "Charity the Necromancer", 20000, 250, 150, 10, 5, RACE_DARK_ELF},
545 { "Pugnacious the Pugilist", 20000, 250, 150, 10, 5, RACE_HALF_ORC},
546 { "Footsore the Lucky", 30000, 250, 150, 10, 5, RACE_BEASTMAN},
547 { "Sidria Lighfingered", 30000, 250, 150, 10, 5, RACE_HUMAN},
548 { "Riatho the Juggler", 20000, 250, 150, 10, 5, RACE_HOBBIT},
549 { "Janaaka the Shifty", 20000, 250, 150, 10, 5, RACE_GNOME},
550 { "Cina the Rogue", 30000, 250, 150, 10, 5, RACE_GNOME},
551 { "Arunikki Greatclaw", 30000, 250, 150, 10, 5, RACE_DRACONIAN},
552 { "Chaeand the Poor", 20000, 250, 150, 10, 5, RACE_HUMAN},
553 { "Afardorf the Brigand", 20000, 250, 150, 10, 5, RACE_BARBARIAN},
554 { "Lathaxl the Greedy", 30000, 250, 150, 10, 5, RACE_MIND_FLAYER},
555 { "Falarewyn", 30000, 250, 150, 10, 5, RACE_SPRITE},
556 { "Vosur the Wrinkled", 20000, 250, 150, 10, 5, RACE_NIBELUNG},
557 { "Araord the Handsome", 20000, 250, 150, 10, 5, RACE_AMBERITE},
558 { "Theradfrid the Loser", 30000, 250, 150, 10, 5, RACE_HUMAN},
559 { "One-Legged Eroolo", 30000, 250, 150, 10, 5, RACE_HALF_OGRE},
565 { "我が家", 0, 100, 100, 0, 99, 99},
566 { "我が家", 0, 100, 100, 0, 99, 99},
567 { "我が家", 0, 100, 100, 0, 99, 99},
568 { "我が家", 0, 100, 100, 0, 99, 99},
569 { "我が家", 0, 100, 100, 0, 99, 99},
570 { "我が家", 0, 100, 100, 0, 99, 99},
571 { "我が家", 0, 100, 100, 0, 99, 99},
572 { "我が家", 0, 100, 100, 0, 99, 99},
573 { "我が家", 0, 100, 100, 0, 99, 99},
574 { "我が家", 0, 100, 100, 0, 99, 99},
575 { "我が家", 0, 100, 100, 0, 99, 99},
576 { "我が家", 0, 100, 100, 0, 99, 99},
577 { "我が家", 0, 100, 100, 0, 99, 99},
578 { "我が家", 0, 100, 100, 0, 99, 99},
579 { "我が家", 0, 100, 100, 0, 99, 99},
580 { "我が家", 0, 100, 100, 0, 99, 99},
581 { "我が家", 0, 100, 100, 0, 99, 99},
582 { "我が家", 0, 100, 100, 0, 99, 99},
583 { "我が家", 0, 100, 100, 0, 99, 99},
584 { "我が家", 0, 100, 100, 0, 99, 99},
585 { "我が家", 0, 100, 100, 0, 99, 99},
586 { "我が家", 0, 100, 100, 0, 99, 99},
587 { "我が家", 0, 100, 100, 0, 99, 99},
588 { "我が家", 0, 100, 100, 0, 99, 99},
589 { "我が家", 0, 100, 100, 0, 99, 99},
590 { "我が家", 0, 100, 100, 0, 99, 99},
591 { "我が家", 0, 100, 100, 0, 99, 99},
592 { "我が家", 0, 100, 100, 0, 99, 99},
593 { "我が家", 0, 100, 100, 0, 99, 99},
594 { "我が家", 0, 100, 100, 0, 99, 99},
595 { "我が家", 0, 100, 100, 0, 99, 99},
596 { "我が家", 0, 100, 100, 0, 99, 99},
598 { "Your home", 0, 100, 100, 0, 99, 99},
599 { "Your home", 0, 100, 100, 0, 99, 99},
600 { "Your home", 0, 100, 100, 0, 99, 99},
601 { "Your home", 0, 100, 100, 0, 99, 99},
602 { "Your home", 0, 100, 100, 0, 99, 99},
603 { "Your home", 0, 100, 100, 0, 99, 99},
604 { "Your home", 0, 100, 100, 0, 99, 99},
605 { "Your home", 0, 100, 100, 0, 99, 99},
606 { "Your home", 0, 100, 100, 0, 99, 99},
607 { "Your home", 0, 100, 100, 0, 99, 99},
608 { "Your home", 0, 100, 100, 0, 99, 99},
609 { "Your home", 0, 100, 100, 0, 99, 99},
610 { "Your home", 0, 100, 100, 0, 99, 99},
611 { "Your home", 0, 100, 100, 0, 99, 99},
612 { "Your home", 0, 100, 100, 0, 99, 99},
613 { "Your home", 0, 100, 100, 0, 99, 99},
614 { "Your home", 0, 100, 100, 0, 99, 99},
615 { "Your home", 0, 100, 100, 0, 99, 99},
616 { "Your home", 0, 100, 100, 0, 99, 99},
617 { "Your home", 0, 100, 100, 0, 99, 99},
618 { "Your home", 0, 100, 100, 0, 99, 99},
619 { "Your home", 0, 100, 100, 0, 99, 99},
620 { "Your home", 0, 100, 100, 0, 99, 99},
621 { "Your home", 0, 100, 100, 0, 99, 99},
622 { "Your home", 0, 100, 100, 0, 99, 99},
623 { "Your home", 0, 100, 100, 0, 99, 99},
624 { "Your home", 0, 100, 100, 0, 99, 99},
625 { "Your home", 0, 100, 100, 0, 99, 99},
626 { "Your home", 0, 100, 100, 0, 99, 99},
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},
635 /* Bookstore - 21 unique names */
637 { "強欲ドラフ", 10000, 175, 108, 4, 12, RACE_HUMAN},
638 { "賢者オドナー", 15000, 120, 105, 6, 16, RACE_HIGH_ELF},
639 { "中立のガンダー", 25000, 120, 110, 7, 19, RACE_DARK_ELF},
640 { "忍耐の人ロ=シャ", 30000, 140, 105, 6, 12, RACE_ELF},
641 { "ランドルフ・カーター", 15000, 175, 108, 4, 12, RACE_HUMAN},
642 { "隼のサライ", 15000, 175, 108, 4, 12, RACE_HUMAN},
643 { "千里眼ボドリル", 20000, 120, 105, 6, 16, RACE_HIGH_ELF},
644 { "沈黙のヴェオロイン", 25000, 120, 110, 7, 19, RACE_ZOMBIE},
645 { "学者のヴァンシラス", 30000, 140, 105, 6, 12, RACE_MIND_FLAYER},
646 { "物書きオセイン", 15000, 175, 108, 4, 12, RACE_SKELETON},
647 { "本の虫オルヴァー", 20000, 120, 105, 6, 16, RACE_VAMPIRE},
648 { "浅井墓男", 25000, 120, 110, 7, 19, RACE_ZOMBIE},
649 { "デスマスク", 30000, 140, 105, 6, 12, RACE_ZOMBIE},
650 { "学者のアスーヌ", 15000, 175, 108, 4, 12, RACE_MIND_FLAYER},
651 { "死人のプリランド", 20000, 120, 105, 6, 16, RACE_ZOMBIE},
652 { "鉄のロナール", 25000, 120, 110, 7, 19, RACE_GOLEM},
654 { "Dolaf the Greedy", 10000, 175, 108, 4, 12, RACE_HUMAN},
655 { "Odnar the Sage", 15000, 120, 105, 6, 16, RACE_HIGH_ELF},
656 { "Gandar the Neutral", 25000, 120, 110, 7, 19, RACE_DARK_ELF},
657 { "Ro-sha the Patient", 30000, 140, 105, 6, 12, RACE_ELF},
658 { "Randolph Carter", 15000, 175, 108, 4, 12, RACE_HUMAN},
659 { "Sarai the Swift", 15000, 175, 108, 4, 12, RACE_HUMAN},
660 { "Bodril the Seer", 20000, 120, 105, 6, 16, RACE_HIGH_ELF},
661 { "Veloin the Quiet", 25000, 120, 110, 7, 19, RACE_ZOMBIE},
662 { "Vanthylas the Learned", 30000, 140, 105, 6, 12, RACE_MIND_FLAYER},
663 { "Ossein the Literate", 15000, 175, 108, 4, 12, RACE_SKELETON},
664 { "Olvar Bookworm", 20000, 120, 105, 6, 16, RACE_VAMPIRE},
665 { "Shallowgrave", 25000, 120, 110, 7, 19, RACE_ZOMBIE},
666 { "Death Mask", 30000, 140, 105, 6, 12, RACE_ZOMBIE},
667 { "Asuunu the Learned", 15000, 175, 108, 4, 12, RACE_MIND_FLAYER},
668 { "Prirand the Dead", 20000, 120, 105, 6, 16, RACE_ZOMBIE},
669 { "Ronar the Iron", 25000, 120, 110, 7, 19, RACE_GOLEM},
672 { "ガリル=ガミル", 30000, 140, 105, 6, 12, RACE_ELF},
673 { "本食いローバグ", 15000, 175, 108, 4, 12, RACE_KOBOLD},
674 { "キリアリキーク", 20000, 120, 105, 6, 16, RACE_KLACKON},
675 { "静かなるリリン", 25000, 120, 110, 7, 19, RACE_DWARF},
676 { "王者イサング", 30000, 140, 105, 6, 12, RACE_HIGH_ELF},
677 { "強欲ドラフ", 10000, 175, 108, 4, 12, RACE_HUMAN},
678 { "賢者オドナー", 15000, 120, 105, 6, 16, RACE_HIGH_ELF},
679 { "中立のガンダー", 25000, 120, 110, 7, 19, RACE_DARK_ELF},
680 { "忍耐の人ロ=シャ", 30000, 140, 105, 6, 12, RACE_ELF},
681 { "ランドルフ・カーター", 15000, 175, 108, 4, 12, RACE_HUMAN},
682 { "隼サライ", 15000, 175, 108, 4, 12, RACE_HUMAN},
683 { "千里眼ボドリル", 20000, 120, 105, 6, 16, RACE_HIGH_ELF},
684 { "沈黙のヴェオロイン", 25000, 120, 110, 7, 19, RACE_ZOMBIE},
685 { "学者のヴァンシラス", 30000, 140, 105, 6, 12, RACE_MIND_FLAYER},
686 { "物書きオセイン", 15000, 175, 108, 4, 12, RACE_SKELETON},
687 { "本の虫オルヴァー", 20000, 120, 105, 6, 16, RACE_VAMPIRE},
689 { "Galil-Gamir", 30000, 140, 105, 6, 12, RACE_ELF},
690 { "Rorbag Book-Eater", 15000, 175, 108, 4, 12, RACE_KOBOLD},
691 { "Kiriarikirk", 20000, 120, 105, 6, 16, RACE_KLACKON},
692 { "Rilin the Quiet", 25000, 120, 110, 7, 19, RACE_DWARF},
693 { "Isung the Lord", 30000, 140, 105, 6, 12, RACE_HIGH_ELF},
694 { "Dolaf the Greedy", 10000, 175, 108, 4, 12, RACE_HUMAN},
695 { "Odnar the Sage", 15000, 120, 105, 6, 16, RACE_HIGH_ELF},
696 { "Gandar the Neutral", 25000, 120, 110, 7, 19, RACE_DARK_ELF},
697 { "Ro-sha the Patient", 30000, 140, 105, 6, 12, RACE_ELF},
698 { "Randolph Carter", 15000, 175, 108, 4, 12, RACE_HUMAN},
699 { "Sarai the Swift", 15000, 175, 108, 4, 12, RACE_HUMAN},
700 { "Bodril the Seer", 20000, 120, 105, 6, 16, RACE_HIGH_ELF},
701 { "Veloin the Quiet", 25000, 120, 110, 7, 19, RACE_ZOMBIE},
702 { "Vanthylas the Learned", 30000, 140, 105, 6, 12, RACE_MIND_FLAYER},
703 { "Ossein the Literate", 15000, 175, 108, 4, 12, RACE_SKELETON},
704 { "Olvar Bookworm", 20000, 120, 105, 6, 16, RACE_VAMPIRE},
711 { "博物館", 0, 100, 100, 0, 99, 99},
712 { "博物館", 0, 100, 100, 0, 99, 99},
713 { "博物館", 0, 100, 100, 0, 99, 99},
714 { "博物館", 0, 100, 100, 0, 99, 99},
715 { "博物館", 0, 100, 100, 0, 99, 99},
716 { "博物館", 0, 100, 100, 0, 99, 99},
717 { "博物館", 0, 100, 100, 0, 99, 99},
718 { "博物館", 0, 100, 100, 0, 99, 99},
719 { "博物館", 0, 100, 100, 0, 99, 99},
720 { "博物館", 0, 100, 100, 0, 99, 99},
721 { "博物館", 0, 100, 100, 0, 99, 99},
722 { "博物館", 0, 100, 100, 0, 99, 99},
723 { "博物館", 0, 100, 100, 0, 99, 99},
724 { "博物館", 0, 100, 100, 0, 99, 99},
725 { "博物館", 0, 100, 100, 0, 99, 99},
726 { "博物館", 0, 100, 100, 0, 99, 99},
727 { "博物館", 0, 100, 100, 0, 99, 99},
728 { "博物館", 0, 100, 100, 0, 99, 99},
729 { "博物館", 0, 100, 100, 0, 99, 99},
730 { "博物館", 0, 100, 100, 0, 99, 99},
731 { "博物館", 0, 100, 100, 0, 99, 99},
732 { "博物館", 0, 100, 100, 0, 99, 99},
733 { "博物館", 0, 100, 100, 0, 99, 99},
734 { "博物館", 0, 100, 100, 0, 99, 99},
735 { "博物館", 0, 100, 100, 0, 99, 99},
736 { "博物館", 0, 100, 100, 0, 99, 99},
737 { "博物館", 0, 100, 100, 0, 99, 99},
738 { "博物館", 0, 100, 100, 0, 99, 99},
739 { "博物館", 0, 100, 100, 0, 99, 99},
740 { "博物館", 0, 100, 100, 0, 99, 99},
741 { "博物館", 0, 100, 100, 0, 99, 99},
742 { "博物館", 0, 100, 100, 0, 99, 99},
744 { "Museum", 0, 100, 100, 0, 99, 99},
745 { "Museum", 0, 100, 100, 0, 99, 99},
746 { "Museum", 0, 100, 100, 0, 99, 99},
747 { "Museum", 0, 100, 100, 0, 99, 99},
748 { "Museum", 0, 100, 100, 0, 99, 99},
749 { "Museum", 0, 100, 100, 0, 99, 99},
750 { "Museum", 0, 100, 100, 0, 99, 99},
751 { "Museum", 0, 100, 100, 0, 99, 99},
752 { "Museum", 0, 100, 100, 0, 99, 99},
753 { "Museum", 0, 100, 100, 0, 99, 99},
754 { "Museum", 0, 100, 100, 0, 99, 99},
755 { "Museum", 0, 100, 100, 0, 99, 99},
756 { "Museum", 0, 100, 100, 0, 99, 99},
757 { "Museum", 0, 100, 100, 0, 99, 99},
758 { "Museum", 0, 100, 100, 0, 99, 99},
759 { "Museum", 0, 100, 100, 0, 99, 99},
760 { "Museum", 0, 100, 100, 0, 99, 99},
761 { "Museum", 0, 100, 100, 0, 99, 99},
762 { "Museum", 0, 100, 100, 0, 99, 99},
763 { "Museum", 0, 100, 100, 0, 99, 99},
764 { "Museum", 0, 100, 100, 0, 99, 99},
765 { "Museum", 0, 100, 100, 0, 99, 99},
766 { "Museum", 0, 100, 100, 0, 99, 99},
767 { "Museum", 0, 100, 100, 0, 99, 99},
768 { "Museum", 0, 100, 100, 0, 99, 99},
769 { "Museum", 0, 100, 100, 0, 99, 99},
770 { "Museum", 0, 100, 100, 0, 99, 99},
771 { "Museum", 0, 100, 100, 0, 99, 99},
772 { "Museum", 0, 100, 100, 0, 99, 99},
773 { "Museum", 0, 100, 100, 0, 99, 99},
774 { "Museum", 0, 100, 100, 0, 99, 99},
775 { "Museum", 0, 100, 100, 0, 99, 99},
782 static int cur_store_num = 0;
783 static int store_top = 0;
784 static int store_bottom = 0;
785 static int xtra_stock = 0;
786 static store_type *st_ptr = NULL;
787 static const owner_type *ot_ptr = NULL;
788 static s16b old_town_num = 0;
789 static s16b inner_town_num = 0;
790 #define RUMOR_CHANCE 8
792 #define MAX_COMMENT_1 6
794 static concptr comment_1[MAX_COMMENT_1] =
815 /*! ブラックマーケット追加メッセージ(承諾) */
816 static concptr comment_1_B[MAX_COMMENT_1] = {
825 #define MAX_COMMENT_2A 2
827 static concptr comment_2a[MAX_COMMENT_2A] =
830 "私の忍耐力を試しているのかい? $%s が最後だ。",
831 "我慢にも限度があるぞ。 $%s が最後だ。"
833 "You try my patience. %s is final.",
834 "My patience grows thin. %s is final."
839 #define MAX_COMMENT_2B 12
841 static concptr comment_2b[MAX_COMMENT_2B] =
844 " $%s ぐらいは出さなきゃダメだよ。",
847 "何て奴だ! $%s 以下はあり得ないぞ。",
848 "それじゃ少なすぎる! $%s は欲しいところだ。",
849 "バカにしている! $%s はもらわないと。",
851 "おいおい! $%s を考えてくれないか?",
852 "1000匹のオークのノミに苦しめられるがいい! $%s だ。",
853 "お前の大切なものに災いあれ! $%s でどうだ。",
854 "モルゴスに賞味されるがいい!本当は $%s なんだろう?",
855 "お前の母親はオーガか! $%s は出すつもりなんだろ?"
857 "I can take no less than %s gold pieces.",
858 "I will accept no less than %s gold pieces.",
859 "Ha! No less than %s gold pieces.",
860 "You knave! No less than %s gold pieces.",
861 "That's a pittance! I want %s gold pieces.",
862 "That's an insult! I want %s gold pieces.",
863 "As if! How about %s gold pieces?",
864 "My arse! How about %s gold pieces?",
865 "May the fleas of 1000 orcs molest you! Try %s gold pieces.",
866 "May your most favourite parts go moldy! Try %s gold pieces.",
867 "May Morgoth find you tasty! Perhaps %s gold pieces?",
868 "Your mother was an Ogre! Perhaps %s gold pieces?"
874 /*! ブラックマーケット用追加メッセージ(売るとき) */
875 static concptr comment_2b_B[MAX_COMMENT_2B] = {
876 "いくら俺様がお人好しとはいえ $%s が限界だね。嫌なら帰りな。",
877 "金がないのかい、あんた?まずは家に帰って $%s 揃えてきな。",
878 "物の価値が分からん奴だな。これは $%s が普通なんだよ。",
879 "俺の付けた値段に文句があるのか? $%s が限界だ。",
880 "ひょっとして新手の冗談かい? $%s 持ってないなら帰りな。",
881 "うちは他の店とは違うんだよ。$%s ぐらいは出しな。",
882 "買う気がないなら帰りな。 $%s だと言っているんだ。",
883 "話にならないね。 $%s くらい持っているんだろ?",
884 "は?なんだそりゃ? $%s の間違いか、ひょっとして?",
885 "出口はあっちだよ。それとも $%s 出せるのかい、あんたに。",
886 "命知らずな奴だな。 $%s 出せば今日の所は勘弁してやるよ。",
887 "うちの店は貧乏人お断りだ。 $%s ぐらい出せないのかい?"
890 #define MAX_COMMENT_3A 2
892 static concptr comment_3a[MAX_COMMENT_3A] =
895 "私の忍耐力を試しているのかい? $%s が最後だ。",
896 "我慢にも限度があるぞ。 $%s が最後だ。"
898 "You try my patience. %s is final.",
899 "My patience grows thin. %s is final."
905 #define MAX_COMMENT_3B 12
907 static concptr comment_3b[MAX_COMMENT_3B] =
910 "本音を言うと $%s でいいんだろ?",
912 " $%s ぐらいなら出してもいいが。",
913 " $%s 以上払うなんて考えられないね。",
914 "まあ落ちついて。 $%s でどうだい?",
915 "そのガラクタなら $%s で引き取るよ。",
916 "それじゃ高すぎる! $%s がいいとこだろ。",
917 "どうせいらないんだろ! $%s でいいだろ?",
918 "だめだめ! $%s がずっとお似合いだよ。",
919 "バカにしている! $%s がせいぜいだ。",
920 " $%s なら嬉しいところだがなあ。",
921 " $%s 、それ以上はビタ一文出さないよ!"
923 "Perhaps %s gold pieces?",
924 "How about %s gold pieces?",
925 "I will pay no more than %s gold pieces.",
926 "I can afford no more than %s gold pieces.",
927 "Be reasonable. How about %s gold pieces?",
928 "I'll buy it as scrap for %s gold pieces.",
929 "That is too much! How about %s gold pieces?",
930 "That looks war surplus! Say %s gold pieces?",
931 "Never! %s is more like it.",
932 "That's an insult! %s is more like it.",
933 "%s gold pieces and be thankful for it!",
934 "%s gold pieces and not a copper more!"
940 /*! ブラックマーケット用追加メッセージ(買い取り) */
941 static concptr comment_3b_B[MAX_COMMENT_3B] = {
942 " $%s ってところだね。そのどうしようもないガラクタは。",
943 "この俺が $%s って言っているんだから、その通りにした方が身のためだぞ。",
944 "俺の優しさに甘えるのもいい加減にしておけ。 $%s だ。",
945 "その品なら $%s で売ってくれているがね、常識ある紳士はみんな。",
946 "こりゃまた、がめつい奴だな。いくら俺が温厚とはいえ $%s が限界だ。",
947 " $%s だ。別に俺はそんなガラクタ欲しくはないんだから。",
948 "俺の鑑定額が気に入らないのか? $%s 、嫌なら帰りな。",
949 " $%s で引き取ってやるよ。喜んで受け取りな、貧乏人。",
950 "物の価値が分からん奴は始末におえんな。それは $%s なんだよ。",
951 "そんなに金が欲しいのか、あんた? $%s で満足できんのか?",
952 "入る店間違えてんじゃないのか? $%s で嫌なら他をあたってくれ。",
953 "俺の言い値にケチをつける奴がいるとは! その度胸に免じて $%s だ。"
956 #define MAX_COMMENT_4A 4
958 static concptr comment_4a[MAX_COMMENT_4A] =
961 "もうたくさんだ!何度も私をわずらわせないでくれ!",
962 "うがー!一日の我慢の限度を超えている!",
963 "もういい!時間の無駄以外のなにものでもない!",
964 "もうやってられないよ!顔も見たくない!"
966 "Enough! You have abused me once too often!",
967 "Arghhh! I have had enough abuse for one day!",
968 "That does it! You shall waste my time no more!",
969 "This is getting nowhere! I'm going to Londis!"
975 /*! ブラックマーケット用追加メッセージ(怒りの頂点) */
976 static concptr comment_4a_B[MAX_COMMENT_4A] = {
977 "なめやがって!温厚な俺様でも限界があるってことを知れ!",
978 "俺をここまで怒らせて...命があるだけでもありがたいと思え!",
979 "ふざけてるのか!冷やかしなら相手を見てからにしろ!",
980 "いいかげんにしろ!今度こんなまねしたらただじゃおかねえぞ!"
983 #define MAX_COMMENT_4B 4
985 static concptr comment_4b[MAX_COMMENT_4B] =
994 "Get out of my sight!",
995 "Begone, you scoundrel!",
1002 /*! ブラックマーケット用追加メッセージ(追い出し) */
1003 static concptr comment_4b_B[MAX_COMMENT_4B] = {
1010 #define MAX_COMMENT_5 8
1012 static concptr comment_5[MAX_COMMENT_5] =
1026 "You will have to do better than that!",
1027 "Do you wish to do business or not?",
1028 "You've got to be kidding!",
1029 "You'd better be kidding!",
1030 "You try my patience.",
1031 "Hmmm, nice weather we're having."
1037 /*! ブラックマーケット用追加メッセージ(怒り) */
1038 static concptr comment_5_B[MAX_COMMENT_5] = {
1049 #define MAX_COMMENT_6 4
1051 static concptr comment_6[MAX_COMMENT_6] =
1059 "I must have heard you wrong.",
1060 "I'm sorry, I missed that.",
1061 "I'm sorry, what was that?",
1062 "Sorry, what was that again?"
1067 /*** Initialize others ***/
1070 * 店舗で販売するオブジェクトを定義する / Hack -- Objects sold in the stores -- by tval/sval pair.
1072 byte store_table[MAX_STORES][STORE_CHOICES][2] =
1077 { TV_FOOD, SV_FOOD_RATION },
1078 { TV_FOOD, SV_FOOD_RATION },
1079 { TV_FOOD, SV_FOOD_RATION },
1080 { TV_FOOD, SV_FOOD_RATION },
1082 { TV_FOOD, SV_FOOD_RATION },
1083 { TV_FOOD, SV_FOOD_BISCUIT },
1084 { TV_FOOD, SV_FOOD_JERKY },
1085 { TV_FOOD, SV_FOOD_JERKY },
1087 { TV_FOOD, SV_FOOD_PINT_OF_WINE },
1088 { TV_FOOD, SV_FOOD_PINT_OF_ALE },
1089 { TV_LITE, SV_LITE_TORCH },
1090 { TV_LITE, SV_LITE_TORCH },
1092 { TV_LITE, SV_LITE_TORCH },
1093 { TV_LITE, SV_LITE_TORCH },
1094 { TV_LITE, SV_LITE_LANTERN },
1095 { TV_LITE, SV_LITE_LANTERN },
1107 { TV_SHOT, SV_AMMO_NORMAL },
1108 { TV_ARROW, SV_AMMO_NORMAL },
1109 { TV_BOLT, SV_AMMO_NORMAL },
1110 { TV_DIGGING, SV_SHOVEL },
1112 { TV_DIGGING, SV_PICK },
1113 { TV_CLOAK, SV_CLOAK },
1114 { TV_CLOAK, SV_CLOAK },
1115 { TV_CLOAK, SV_FUR_CLOAK },
1117 { TV_FOOD, SV_FOOD_RATION },
1118 { TV_FOOD, SV_FOOD_RATION },
1119 { TV_FOOD, SV_FOOD_RATION },
1120 { TV_FOOD, SV_FOOD_RATION },
1122 { TV_POTION, SV_POTION_WATER },
1123 { TV_POTION, SV_POTION_WATER },
1124 { TV_LITE, SV_LITE_LANTERN },
1125 { TV_LITE, SV_LITE_LANTERN },
1127 { TV_FOOD, SV_FOOD_WAYBREAD },
1128 { TV_FOOD, SV_FOOD_WAYBREAD },
1132 { TV_SHOT, SV_AMMO_NORMAL },
1133 { TV_ARROW, SV_AMMO_NORMAL },
1134 { TV_BOLT, SV_AMMO_NORMAL },
1135 { TV_DIGGING, SV_SHOVEL }
1141 { TV_BOOTS, SV_PAIR_OF_SOFT_LEATHER_BOOTS },
1142 { TV_BOOTS, SV_PAIR_OF_SOFT_LEATHER_BOOTS },
1143 { TV_BOOTS, SV_PAIR_OF_HARD_LEATHER_BOOTS },
1144 { TV_BOOTS, SV_PAIR_OF_HARD_LEATHER_BOOTS },
1146 { TV_HELM, SV_HARD_LEATHER_CAP },
1147 { TV_HELM, SV_HARD_LEATHER_CAP },
1148 { TV_HELM, SV_METAL_CAP },
1149 { TV_HELM, SV_IRON_HELM },
1151 { TV_SOFT_ARMOR, SV_ROBE },
1152 { TV_SOFT_ARMOR, SV_ROBE },
1153 { TV_SOFT_ARMOR, SV_SOFT_LEATHER_ARMOR },
1154 { TV_SOFT_ARMOR, SV_SOFT_LEATHER_ARMOR },
1156 { TV_SOFT_ARMOR, SV_HARD_LEATHER_ARMOR },
1157 { TV_SOFT_ARMOR, SV_HARD_LEATHER_ARMOR },
1158 { TV_SOFT_ARMOR, SV_HARD_STUDDED_LEATHER },
1159 { TV_SOFT_ARMOR, SV_HARD_STUDDED_LEATHER },
1161 { TV_SOFT_ARMOR, SV_RHINO_HIDE_ARMOR },
1162 { TV_SOFT_ARMOR, SV_LEATHER_SCALE_MAIL },
1163 { TV_HARD_ARMOR, SV_METAL_SCALE_MAIL },
1164 { TV_HARD_ARMOR, SV_CHAIN_MAIL },
1166 { TV_HARD_ARMOR, SV_DOUBLE_RING_MAIL },
1167 { TV_HARD_ARMOR, SV_AUGMENTED_CHAIN_MAIL },
1168 { TV_HARD_ARMOR, SV_BAR_CHAIN_MAIL },
1169 { TV_HARD_ARMOR, SV_DOUBLE_CHAIN_MAIL },
1171 { TV_HARD_ARMOR, SV_METAL_BRIGANDINE_ARMOUR },
1172 { TV_HARD_ARMOR, SV_SPLINT_MAIL },
1173 { TV_GLOVES, SV_SET_OF_LEATHER_GLOVES },
1174 { TV_GLOVES, SV_SET_OF_LEATHER_GLOVES },
1176 { TV_GLOVES, SV_SET_OF_GAUNTLETS },
1177 { TV_SHIELD, SV_SMALL_LEATHER_SHIELD },
1178 { TV_SHIELD, SV_LARGE_LEATHER_SHIELD },
1179 { TV_SHIELD, SV_SMALL_METAL_SHIELD },
1181 { TV_BOOTS, SV_PAIR_OF_HARD_LEATHER_BOOTS },
1182 { TV_BOOTS, SV_PAIR_OF_HARD_LEATHER_BOOTS },
1183 { TV_HELM, SV_HARD_LEATHER_CAP },
1184 { TV_HELM, SV_HARD_LEATHER_CAP },
1186 { TV_SOFT_ARMOR, SV_ROBE },
1187 { TV_SOFT_ARMOR, SV_SOFT_LEATHER_ARMOR },
1188 { TV_SOFT_ARMOR, SV_SOFT_LEATHER_ARMOR },
1189 { TV_SOFT_ARMOR, SV_HARD_LEATHER_ARMOR },
1191 { TV_SOFT_ARMOR, SV_LEATHER_JACK },
1192 { TV_HARD_ARMOR, SV_METAL_SCALE_MAIL },
1193 { TV_HARD_ARMOR, SV_CHAIN_MAIL },
1194 { TV_HARD_ARMOR, SV_CHAIN_MAIL },
1196 { TV_GLOVES, SV_SET_OF_LEATHER_GLOVES },
1197 { TV_GLOVES, SV_SET_OF_GAUNTLETS },
1198 { TV_SHIELD, SV_SMALL_LEATHER_SHIELD },
1199 { TV_SHIELD, SV_SMALL_LEATHER_SHIELD }
1205 { TV_SWORD, SV_DAGGER },
1206 { TV_SWORD, SV_MAIN_GAUCHE },
1207 { TV_SWORD, SV_RAPIER },
1208 { TV_SWORD, SV_SMALL_SWORD },
1210 { TV_SWORD, SV_SHORT_SWORD },
1211 { TV_SWORD, SV_SABRE },
1212 { TV_SWORD, SV_CUTLASS },
1213 { TV_SWORD, SV_TULWAR },
1215 { TV_SWORD, SV_BROAD_SWORD },
1216 { TV_SWORD, SV_LONG_SWORD },
1217 { TV_SWORD, SV_SCIMITAR },
1218 { TV_SWORD, SV_KATANA },
1220 { TV_SWORD, SV_BASTARD_SWORD },
1221 { TV_POLEARM, SV_SPEAR },
1222 { TV_POLEARM, SV_AWL_PIKE },
1223 { TV_POLEARM, SV_TRIDENT },
1225 { TV_POLEARM, SV_PIKE },
1226 { TV_POLEARM, SV_BEAKED_AXE },
1227 { TV_POLEARM, SV_BROAD_AXE },
1228 { TV_POLEARM, SV_LANCE },
1230 { TV_POLEARM, SV_BATTLE_AXE },
1231 { TV_POLEARM, SV_HATCHET },
1232 { TV_BOW, SV_SLING },
1233 { TV_BOW, SV_SHORT_BOW },
1235 { TV_BOW, SV_LIGHT_XBOW },
1236 { TV_SHOT, SV_AMMO_NORMAL },
1237 { TV_SHOT, SV_AMMO_NORMAL },
1238 { TV_ARROW, SV_AMMO_NORMAL },
1240 { TV_ARROW, SV_AMMO_NORMAL },
1241 { TV_BOLT, SV_AMMO_NORMAL },
1242 { TV_BOLT, SV_AMMO_NORMAL },
1243 { TV_BOW, SV_LIGHT_XBOW },
1245 { TV_ARROW, SV_AMMO_NORMAL },
1246 { TV_BOLT, SV_AMMO_NORMAL },
1247 { TV_BOW, SV_SHORT_BOW },
1248 { TV_BOW, SV_LIGHT_XBOW },
1250 { TV_SWORD, SV_DAGGER },
1251 { TV_SWORD, SV_TANTO },
1252 { TV_SWORD, SV_RAPIER },
1253 { TV_SWORD, SV_SMALL_SWORD },
1255 { TV_SWORD, SV_SHORT_SWORD },
1256 { TV_SWORD, SV_LONG_SWORD },
1257 { TV_SWORD, SV_SCIMITAR },
1258 { TV_SWORD, SV_BROAD_SWORD },
1260 { TV_HISSATSU_BOOK, 0 },
1261 { TV_HISSATSU_BOOK, 0 },
1262 { TV_HISSATSU_BOOK, 1 },
1263 { TV_HISSATSU_BOOK, 1 },
1269 { TV_HAFTED, SV_NUNCHAKU },
1270 { TV_HAFTED, SV_QUARTERSTAFF },
1271 { TV_HAFTED, SV_MACE },
1272 { TV_HAFTED, SV_BO_STAFF },
1274 { TV_HAFTED, SV_WAR_HAMMER },
1275 { TV_HAFTED, SV_WAR_HAMMER },
1276 { TV_HAFTED, SV_MORNING_STAR },
1277 { TV_HAFTED, SV_FLAIL },
1279 { TV_HAFTED, SV_LEAD_FILLED_MACE },
1280 { TV_SCROLL, SV_SCROLL_REMOVE_CURSE },
1281 { TV_SCROLL, SV_SCROLL_BLESSING },
1282 { TV_SCROLL, SV_SCROLL_HOLY_CHANT },
1284 { TV_POTION, SV_POTION_HEROISM },
1285 { TV_SCROLL, SV_SCROLL_WORD_OF_RECALL },
1286 { TV_SCROLL, SV_SCROLL_WORD_OF_RECALL },
1287 { TV_SCROLL, SV_SCROLL_WORD_OF_RECALL },
1289 { TV_POTION, SV_POTION_CURE_LIGHT },
1290 { TV_POTION, SV_POTION_CURE_SERIOUS },
1291 { TV_POTION, SV_POTION_CURE_SERIOUS },
1292 { TV_POTION, SV_POTION_CURE_CRITICAL },
1294 { TV_POTION, SV_POTION_CURE_CRITICAL },
1295 { TV_POTION, SV_POTION_RESTORE_EXP },
1296 { TV_POTION, SV_POTION_RESTORE_EXP },
1297 { TV_POTION, SV_POTION_RESTORE_EXP },
1299 { TV_LIFE_BOOK, 0 },
1300 { TV_LIFE_BOOK, 0 },
1301 { TV_LIFE_BOOK, 1 },
1302 { TV_LIFE_BOOK, 1 },
1304 { TV_CRUSADE_BOOK, 0 },
1305 { TV_CRUSADE_BOOK, 0 },
1306 { TV_CRUSADE_BOOK, 1 },
1307 { TV_CRUSADE_BOOK, 1 },
1309 { TV_HAFTED, SV_WHIP },
1310 { TV_HAFTED, SV_MACE },
1311 { TV_HAFTED, SV_BALL_AND_CHAIN },
1312 { TV_HAFTED, SV_WAR_HAMMER },
1314 { TV_SCROLL, SV_SCROLL_WORD_OF_RECALL },
1315 { TV_SCROLL, SV_SCROLL_WORD_OF_RECALL },
1316 { TV_SCROLL, SV_SCROLL_WORD_OF_RECALL },
1317 { TV_POTION, SV_POTION_CURE_CRITICAL },
1319 { TV_POTION, SV_POTION_CURE_CRITICAL },
1320 { TV_POTION, SV_POTION_RESTORE_EXP },
1323 { TV_STATUE, SV_ANY },
1325 { TV_SCROLL, SV_SCROLL_REMOVE_CURSE },
1326 { TV_SCROLL, SV_SCROLL_REMOVE_CURSE },
1327 { TV_SCROLL, SV_SCROLL_STAR_REMOVE_CURSE },
1328 { TV_SCROLL, SV_SCROLL_STAR_REMOVE_CURSE }
1334 { TV_SCROLL, SV_SCROLL_ENCHANT_WEAPON_TO_HIT },
1335 { TV_SCROLL, SV_SCROLL_ENCHANT_WEAPON_TO_DAM },
1336 { TV_SCROLL, SV_SCROLL_ENCHANT_ARMOR },
1337 { TV_SCROLL, SV_SCROLL_IDENTIFY },
1339 { TV_SCROLL, SV_SCROLL_IDENTIFY },
1340 { TV_SCROLL, SV_SCROLL_IDENTIFY },
1341 { TV_SCROLL, SV_SCROLL_IDENTIFY },
1342 { TV_SCROLL, SV_SCROLL_LIGHT },
1344 { TV_SCROLL, SV_SCROLL_PHASE_DOOR },
1345 { TV_SCROLL, SV_SCROLL_PHASE_DOOR },
1346 { TV_SCROLL, SV_SCROLL_TELEPORT },
1347 { TV_SCROLL, SV_SCROLL_MONSTER_CONFUSION },
1349 { TV_SCROLL, SV_SCROLL_MAPPING },
1350 { TV_SCROLL, SV_SCROLL_DETECT_GOLD },
1351 { TV_SCROLL, SV_SCROLL_DETECT_ITEM },
1352 { TV_SCROLL, SV_SCROLL_DETECT_TRAP },
1354 { TV_SCROLL, SV_SCROLL_DETECT_INVIS },
1355 { TV_SCROLL, SV_SCROLL_RECHARGING },
1356 { TV_SCROLL, SV_SCROLL_TELEPORT },
1357 { TV_SCROLL, SV_SCROLL_WORD_OF_RECALL },
1359 { 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_TELEPORT },
1364 { TV_SCROLL, SV_SCROLL_TELEPORT },
1365 { TV_POTION, SV_POTION_RES_STR },
1366 { TV_POTION, SV_POTION_RES_INT },
1367 { TV_POTION, SV_POTION_RES_WIS },
1369 { TV_POTION, SV_POTION_RES_DEX },
1370 { TV_POTION, SV_POTION_RES_CON },
1371 { TV_POTION, SV_POTION_RES_CHR },
1372 { TV_SCROLL, SV_SCROLL_IDENTIFY },
1374 { TV_SCROLL, SV_SCROLL_IDENTIFY },
1375 { TV_SCROLL, SV_SCROLL_STAR_IDENTIFY }, /* Yep, occasionally! */
1376 { TV_SCROLL, SV_SCROLL_STAR_IDENTIFY },
1377 { TV_SCROLL, SV_SCROLL_LIGHT },
1379 { TV_POTION, SV_POTION_RES_STR },
1380 { TV_POTION, SV_POTION_RES_INT },
1381 { TV_POTION, SV_POTION_RES_WIS },
1382 { TV_POTION, SV_POTION_RES_DEX },
1384 { TV_POTION, SV_POTION_RES_CON },
1385 { TV_POTION, SV_POTION_RES_CHR },
1386 { TV_SCROLL, SV_SCROLL_ENCHANT_ARMOR },
1387 { TV_SCROLL, SV_SCROLL_ENCHANT_ARMOR },
1389 { TV_SCROLL, SV_SCROLL_RECHARGING },
1390 { TV_SCROLL, SV_SCROLL_PHASE_DOOR },
1391 { TV_SCROLL, SV_SCROLL_ENCHANT_WEAPON_TO_HIT },
1392 { TV_SCROLL, SV_SCROLL_ENCHANT_WEAPON_TO_DAM },
1397 /* Magic-User store */
1399 { TV_RING, SV_RING_PROTECTION },
1400 { TV_RING, SV_RING_LEVITATION_FALL },
1401 { TV_RING, SV_RING_PROTECTION },
1402 { TV_RING, SV_RING_RESIST_FIRE },
1404 { TV_RING, SV_RING_RESIST_COLD },
1405 { TV_AMULET, SV_AMULET_CHARISMA },
1406 { TV_RING, SV_RING_WARNING },
1407 { TV_AMULET, SV_AMULET_RESIST_ACID },
1409 { TV_AMULET, SV_AMULET_SEARCHING },
1410 { TV_WAND, SV_WAND_SLOW_MONSTER },
1411 { TV_WAND, SV_WAND_CONFUSE_MONSTER },
1412 { TV_WAND, SV_WAND_SLEEP_MONSTER },
1414 { TV_WAND, SV_WAND_MAGIC_MISSILE },
1415 { TV_WAND, SV_WAND_STINKING_CLOUD },
1416 { TV_WAND, SV_WAND_WONDER },
1417 { TV_WAND, SV_WAND_DISARMING },
1419 { TV_STAFF, SV_STAFF_LITE },
1420 { TV_STAFF, SV_STAFF_MAPPING },
1421 { TV_STAFF, SV_STAFF_DETECT_TRAP },
1422 { TV_STAFF, SV_STAFF_DETECT_DOOR },
1424 { TV_STAFF, SV_STAFF_DETECT_GOLD },
1425 { TV_STAFF, SV_STAFF_DETECT_ITEM },
1426 { TV_STAFF, SV_STAFF_DETECT_INVIS },
1427 { TV_STAFF, SV_STAFF_DETECT_EVIL },
1429 { TV_STAFF, SV_STAFF_TELEPORTATION },
1430 { TV_STAFF, SV_STAFF_TELEPORTATION },
1431 { TV_STAFF, SV_STAFF_TELEPORTATION },
1432 { TV_STAFF, SV_STAFF_TELEPORTATION },
1434 { TV_STAFF, SV_STAFF_IDENTIFY },
1435 { TV_STAFF, SV_STAFF_IDENTIFY },
1436 { TV_STAFF, SV_STAFF_IDENTIFY },
1438 { TV_STAFF, SV_STAFF_IDENTIFY },
1439 { TV_STAFF, SV_STAFF_REMOVE_CURSE },
1440 { TV_STAFF, SV_STAFF_CURE_LIGHT },
1441 { TV_STAFF, SV_STAFF_PROBING },
1445 { TV_SORCERY_BOOK, 0 },
1446 { TV_SORCERY_BOOK, 0 },
1447 { TV_SORCERY_BOOK, 1 },
1448 { TV_SORCERY_BOOK, 1 },
1450 { TV_ARCANE_BOOK, 0 },
1451 { TV_ARCANE_BOOK, 0 },
1452 { TV_ARCANE_BOOK, 1 },
1453 { TV_ARCANE_BOOK, 1 },
1455 { TV_ARCANE_BOOK, 2 },
1456 { TV_ARCANE_BOOK, 2 },
1457 { TV_ARCANE_BOOK, 3 },
1458 { TV_ARCANE_BOOK, 3 },
1463 /* Black Market (unused) */
1536 { TV_SORCERY_BOOK, 0 },
1537 { TV_SORCERY_BOOK, 0 },
1538 { TV_SORCERY_BOOK, 1 },
1539 { TV_SORCERY_BOOK, 1 },
1541 { TV_NATURE_BOOK, 0 },
1542 { TV_NATURE_BOOK, 0 },
1543 { TV_NATURE_BOOK, 1 },
1544 { TV_NATURE_BOOK, 1 },
1546 { TV_CHAOS_BOOK, 0 },
1547 { TV_CHAOS_BOOK, 0 },
1548 { TV_CHAOS_BOOK, 1 },
1549 { TV_CHAOS_BOOK, 1 },
1551 { TV_DEATH_BOOK, 0 },
1552 { TV_DEATH_BOOK, 0 },
1553 { TV_DEATH_BOOK, 1 },
1554 { TV_DEATH_BOOK, 1 },
1556 { TV_TRUMP_BOOK, 0 }, /* +16 */
1557 { TV_TRUMP_BOOK, 0 },
1558 { TV_TRUMP_BOOK, 1 },
1559 { TV_TRUMP_BOOK, 1 },
1561 { TV_ARCANE_BOOK, 0 },
1562 { TV_ARCANE_BOOK, 1 },
1563 { TV_ARCANE_BOOK, 2 },
1564 { TV_ARCANE_BOOK, 3 },
1566 { TV_CRAFT_BOOK, 0 },
1567 { TV_CRAFT_BOOK, 0 },
1568 { TV_CRAFT_BOOK, 1 },
1569 { TV_CRAFT_BOOK, 1 },
1571 { TV_DAEMON_BOOK, 0 },
1572 { TV_DAEMON_BOOK, 0 },
1573 { TV_DAEMON_BOOK, 1 },
1574 { TV_DAEMON_BOOK, 1 },
1576 { TV_MUSIC_BOOK, 0 },
1577 { TV_MUSIC_BOOK, 0 },
1578 { TV_MUSIC_BOOK, 1 },
1579 { TV_MUSIC_BOOK, 1 },
1588 /* Museum (unused) */
1627 * @brief 取引成功時の店主のメッセージ処理 /
1628 * Successful haggle.
1631 static void say_comment_1(void)
1634 /* ブラックマーケットのときは別のメッセージを出す */
1635 if ( cur_store_num == STORE_BLACK ) {
1636 msg_print(comment_1_B[randint0(MAX_COMMENT_1)]);
1639 msg_print(comment_1[randint0(MAX_COMMENT_1)]);
1642 msg_print(comment_1[randint0(MAX_COMMENT_1)]);
1646 if (one_in_(RUMOR_CHANCE))
1649 msg_print("店主は耳うちした:");
1651 msg_print("The shopkeeper whispers something into your ear:");
1653 display_rumor(TRUE);
1659 * @brief プレイヤーがアイテムを買う時の価格代案メッセージ処理 /
1660 * Continue haggling (player is buying)
1661 * @param value 店主の提示価格
1662 * @param annoyed 店主のいらつき度
1665 static void say_comment_2(PRICE value, int annoyed)
1669 /* Prepare a string to insert */
1670 sprintf(tmp_val, "%ld", (long)value);
1675 /* Formatted message */
1676 msg_format(comment_2a[randint0(MAX_COMMENT_2A)], tmp_val);
1682 /* Formatted message */
1684 /* ブラックマーケットの時は別のメッセージを出す */
1685 if ( cur_store_num == STORE_BLACK ){
1686 msg_format(comment_2b_B[randint0(MAX_COMMENT_2B)], tmp_val);
1689 msg_format(comment_2b[randint0(MAX_COMMENT_2B)], tmp_val);
1692 msg_format(comment_2b[randint0(MAX_COMMENT_2B)], tmp_val);
1700 * @brief プレイヤーがアイテムを売る時の価格代案メッセージ処理 /
1701 * Continue haggling (player is selling)
1702 * @param value 店主の提示価格
1703 * @param annoyed 店主のいらつき度
1706 static void say_comment_3(PRICE value, int annoyed)
1710 /* Prepare a string to insert */
1711 sprintf(tmp_val, "%ld", (long)value);
1716 /* Formatted message */
1717 msg_format(comment_3a[randint0(MAX_COMMENT_3A)], tmp_val);
1723 /* Formatted message */
1725 /* ブラックマーケットの時は別のメッセージを出す */
1726 if ( cur_store_num == STORE_BLACK ){
1727 msg_format(comment_3b_B[randint0(MAX_COMMENT_3B)], tmp_val);
1730 msg_format(comment_3b[randint0(MAX_COMMENT_3B)], tmp_val);
1733 msg_format(comment_3b[randint0(MAX_COMMENT_3B)], tmp_val);
1741 * @brief 店主がプレイヤーを追い出す時のメッセージ処理 /
1742 * Kick 'da bum out. -RAK-
1745 static void say_comment_4(void)
1748 /* ブラックマーケットの時は別のメッセージを出す */
1749 if ( cur_store_num == STORE_BLACK ){
1750 msg_print(comment_4a_B[randint0(MAX_COMMENT_4A)]);
1751 msg_print(comment_4b_B[randint0(MAX_COMMENT_4B)]);
1754 msg_print(comment_4a[randint0(MAX_COMMENT_4A)]);
1755 msg_print(comment_4b[randint0(MAX_COMMENT_4B)]);
1758 msg_print(comment_4a[randint0(MAX_COMMENT_4A)]);
1759 msg_print(comment_4b[randint0(MAX_COMMENT_4B)]);
1766 * @brief 店主がプレイヤーに取り合わない時のメッセージ処理 /
1767 * You are insulting me
1770 static void say_comment_5(void)
1773 /* ブラックマーケットの時は別のメッセージを出す */
1774 if ( cur_store_num == STORE_BLACK ){
1775 msg_print(comment_5_B[randint0(MAX_COMMENT_5)]);
1778 msg_print(comment_5[randint0(MAX_COMMENT_5)]);
1781 msg_print(comment_5[randint0(MAX_COMMENT_5)]);
1788 * @brief 店主がプレイヤーの提示を理解できなかった時のメッセージ処理 /
1789 * That makes no sense.
1792 static void say_comment_6(void)
1794 msg_print(comment_6[randint0(MAX_COMMENT_6)]);
1798 #define MAX_COMMENT_7A 4
1800 static concptr comment_7a[MAX_COMMENT_7A] =
1805 "誰かがむせび泣く声が聞こえる...。",
1810 "You hear someone sobbing...",
1811 "The shopkeeper howls in agony!"
1816 #define MAX_COMMENT_7B 4
1818 static concptr comment_7b[MAX_COMMENT_7B] =
1828 "The shopkeeper curses at you.",
1829 "The shopkeeper glares at you."
1834 #define MAX_COMMENT_7C 4
1836 static concptr comment_7c[MAX_COMMENT_7C] =
1845 "You've made my day!",
1846 "The shopkeeper giggles.",
1847 "The shopkeeper laughs loudly."
1852 #define MAX_COMMENT_7D 4
1854 static concptr comment_7d[MAX_COMMENT_7D] =
1858 "こんなおいしい思いをしたら、真面目に働けなくなるなぁ。",
1863 "I think I'll retire!",
1864 "The shopkeeper jumps for joy.",
1865 "The shopkeeper smiles gleefully."
1872 * @brief 店主が交渉を終えた際の反応を返す処理 /
1873 * Let a shop-keeper React to a purchase
1874 * @param price アイテムの取引額
1875 * @param value アイテムの実際価値
1876 * @param guess 店主が当初予想していた価値
1879 * We paid "price", it was worth "value", and we thought it was worth "guess"
1881 static void purchase_analyze(PRICE price, PRICE value, PRICE guess)
1883 /* Item was worthless, but we bought it */
1884 if ((value <= 0) && (price > value))
1886 msg_print(comment_7a[randint0(MAX_COMMENT_7A)]);
1887 chg_virtue(V_HONOUR, -1);
1888 chg_virtue(V_JUSTICE, -1);
1889 sound(SOUND_STORE1);
1892 /* Item was cheaper than we thought, and we paid more than necessary */
1893 else if ((value < guess) && (price > value))
1895 msg_print(comment_7b[randint0(MAX_COMMENT_7B)]);
1896 chg_virtue(V_JUSTICE, -1);
1897 if (one_in_(4)) chg_virtue(V_HONOUR, -1);
1898 sound(SOUND_STORE2);
1901 /* Item was a good bargain, and we got away with it */
1902 else if ((value > guess) && (value < (4 * guess)) && (price < value))
1904 msg_print(comment_7c[randint0(MAX_COMMENT_7C)]);
1905 if (one_in_(4)) chg_virtue(V_HONOUR, -1);
1906 else if (one_in_(4)) chg_virtue(V_HONOUR, 1);
1907 sound(SOUND_STORE3);
1910 /* Item was a great bargain, and we got away with it */
1911 else if ((value > guess) && (price < value))
1913 msg_print(comment_7d[randint0(MAX_COMMENT_7D)]);
1914 if (one_in_(2)) chg_virtue(V_HONOUR, -1);
1915 if (one_in_(4)) chg_virtue(V_HONOUR, 1);
1916 if (10 * price < value) chg_virtue(V_SACRIFICE, 1);
1917 sound(SOUND_STORE4);
1924 * We store the current "store feat" here so everyone can access it
1926 static int cur_store_feat;
1930 * Buying and selling adjustments for race combinations.
1931 * Entry[owner][player] gives the basic "cost inflation".
1933 static byte rgold_adj[MAX_RACES][MAX_RACES] =
1935 /*Hum, HfE, Elf, Hal, Gno, Dwa, HfO, HfT, Dun, HiE, Barbarian,
1936 HfOg, HGn, HTn, Cyc, Yek, Klc, Kbd, Nbl, DkE, Drc, Mind Flayer,
1937 Imp, Glm, Skl, Zombie, Vampire, Spectre, Fairy, Beastman, Ent,
1938 Angel, Demon, Kutar, Android, Merfolk */
1941 { 100, 105, 105, 110, 113, 115, 120, 125, 100, 105, 100,
1942 124, 120, 110, 125, 115, 120, 120, 120, 120, 115, 120,
1943 115, 105, 125, 125, 125, 125, 105, 120, 105, 95, 140,
1944 100, 120, 110, 105, 110 },
1947 { 110, 100, 100, 105, 110, 120, 125, 130, 110, 100, 110,
1948 120, 115, 108, 115, 110, 110, 120, 120, 115, 115, 110,
1949 120, 110, 110, 110, 120, 110, 100, 125, 100, 95, 140,
1950 110, 115, 110, 110, 110 },
1953 { 110, 105, 100, 105, 110, 120, 125, 130, 110, 100, 110,
1954 120, 120, 105, 120, 110, 105, 125, 125, 110, 115, 108,
1955 120, 115, 110, 110, 120, 110, 100, 125, 100, 95, 140,
1956 110, 110, 105, 110, 110 },
1959 { 115, 110, 105, 95, 105, 110, 115, 130, 115, 105, 115,
1960 125, 120, 120, 125, 115, 110, 120, 120, 120, 115, 115,
1961 120, 110, 120, 120, 130, 110, 110, 130, 110, 95, 140,
1962 115, 120, 105, 115, 105 },
1965 { 115, 115, 110, 105, 95, 110, 115, 130, 115, 110, 115,
1966 120, 125, 110, 120, 110, 105, 120, 110, 110, 105, 110,
1967 120, 101, 110, 110, 120, 120, 115, 130, 115, 95, 140,
1968 115, 110, 110, 115, 110 },
1971 { 115, 120, 120, 110, 110, 95, 125, 135, 115, 120, 115,
1972 125, 140, 130, 130, 120, 115, 115, 115, 135, 125, 120,
1973 120, 105, 115, 115, 115, 115, 120, 130, 120, 95, 140,
1974 115, 110, 115, 115, 120 },
1977 { 115, 120, 125, 115, 115, 130, 110, 115, 115, 125, 115,
1978 110, 110, 120, 110, 120, 125, 115, 115, 110, 120, 110,
1979 115, 125, 120, 120, 115, 120, 125, 115, 125, 95, 140,
1980 115, 110, 115, 115, 125 },
1983 { 110, 115, 115, 110, 110, 130, 110, 110, 110, 115, 110,
1984 110, 115, 120, 110, 120, 120, 110, 110, 110, 115, 110,
1985 110, 115, 112, 112, 115, 112, 120, 110, 120, 95, 140,
1986 110, 110, 115, 110, 130 },
1989 { 100, 105, 105, 110, 113, 115, 120, 125, 100, 105, 100,
1990 120, 120, 105, 120, 115, 105, 115, 120, 110, 105, 105,
1991 120, 105, 120, 120, 125, 120, 105, 135, 105, 95, 140,
1992 100, 110, 110, 100, 110 },
1995 { 110, 105, 100, 105, 110, 120, 125, 130, 110, 100, 110,
1996 125, 125, 101, 120, 115, 110, 115, 125, 110, 110, 110,
1997 125, 115, 120, 120, 125, 120, 100, 125, 100, 95, 140,
1998 110, 110, 105, 110, 110 },
2000 /* Human / Barbarian (copied from human) */
2001 { 100, 105, 105, 110, 113, 115, 120, 125, 100, 105, 100,
2002 124, 120, 110, 125, 115, 120, 120, 120, 120, 115, 120,
2003 115, 105, 125, 125, 130, 125, 115, 120, 115, 95, 140,
2004 100, 120, 110, 100, 110 },
2006 /* Half-Ogre: theoretical, copied from half-troll */
2007 { 110, 115, 115, 110, 110, 130, 110, 110, 110, 115, 110,
2008 110, 115, 120, 110, 120, 120, 110, 110, 110, 115, 110,
2009 110, 115, 112, 112, 115, 112, 120, 110, 120, 95, 140,
2010 110, 110, 115, 110, 120 },
2012 /* Half-Giant: theoretical, copied from half-troll */
2013 { 110, 115, 115, 110, 110, 130, 110, 110, 110, 115, 110,
2014 110, 115, 120, 110, 120, 120, 110, 110, 110, 115, 110,
2015 110, 115, 112, 112, 115, 112, 130, 120, 130, 95, 140,
2016 110, 110, 115, 110, 115 },
2018 /* Half-Titan: theoretical, copied from High_Elf */
2019 { 110, 105, 100, 105, 110, 120, 125, 130, 110, 100, 110,
2020 125, 125, 101, 120, 115, 110, 115, 125, 110, 110, 110,
2021 125, 115, 120, 120, 120, 120, 130, 130, 130, 95, 140,
2022 110, 110, 115, 110, 108 },
2024 /* Cyclops: theoretical, copied from half-troll */
2025 { 110, 115, 115, 110, 110, 130, 110, 110, 110, 115, 110,
2026 110, 115, 120, 110, 120, 120, 110, 110, 110, 115, 110,
2027 110, 115, 112, 112, 115, 112, 130, 130, 130, 95, 140,
2028 110, 110, 115, 110, 115 },
2030 /* Yeek: theoretical, copied from Half-Orc */
2031 { 115, 120, 125, 115, 115, 130, 110, 115, 115, 125, 115,
2032 110, 110, 120, 110, 120, 125, 115, 115, 110, 120, 110,
2033 115, 125, 120, 120, 120, 120, 130, 130, 130, 95, 140,
2034 115, 110, 115, 115, 110 },
2036 /* Klackon: theoretical, copied from Gnome */
2037 { 115, 115, 110, 105, 95, 110, 115, 130, 115, 110, 115,
2038 120, 125, 110, 120, 110, 105, 120, 110, 110, 105, 110,
2039 120, 101, 110, 110, 120, 120, 130, 130, 130, 95, 140,
2040 115, 110, 115, 115, 110 },
2042 /* Kobold: theoretical, copied from Half-Orc */
2043 { 115, 120, 125, 115, 115, 130, 110, 115, 115, 125, 115,
2044 110, 110, 120, 110, 120, 125, 115, 115, 110, 120, 110,
2045 115, 125, 120, 120, 120, 120, 130, 130, 130, 95, 140,
2046 115, 110, 115, 115, 120 },
2048 /* Nibelung: theoretical, copied from Dwarf */
2049 { 115, 120, 120, 110, 110, 95, 125, 135, 115, 120, 115,
2050 125, 140, 130, 130, 120, 115, 115, 115, 135, 125, 120,
2051 120, 105, 115, 115, 120, 120, 130, 130, 130, 95, 140,
2052 115, 135, 115, 115, 120 },
2055 { 110, 110, 110, 115, 120, 130, 115, 115, 120, 110, 115,
2056 115, 115, 116, 115, 120, 120, 115, 115, 101, 110, 110,
2057 110, 110, 112, 122, 110, 110, 110, 115, 110, 120, 120,
2058 110, 101, 115, 110, 115 },
2060 /* Draconian: theoretical, copied from High_Elf */
2061 { 110, 105, 100, 105, 110, 120, 125, 130, 110, 100, 110,
2062 125, 125, 101, 120, 115, 110, 115, 125, 110, 110, 110,
2063 125, 115, 120, 120, 120, 120, 130, 130, 130, 95, 140,
2064 110, 110, 115, 110, 115 },
2066 /* Mind Flayer: theoretical, copied from High_Elf */
2067 { 110, 105, 100, 105, 110, 120, 125, 130, 110, 100, 110,
2068 125, 125, 101, 120, 115, 110, 115, 125, 110, 110, 110,
2069 125, 115, 120, 120, 120, 120, 130, 130, 130, 95, 140,
2070 110, 110, 115, 110, 110 },
2072 /* Imp: theoretical, copied from High_Elf */
2073 { 110, 105, 100, 105, 110, 120, 125, 130, 110, 100, 110,
2074 125, 125, 101, 120, 115, 110, 115, 125, 110, 110, 110,
2075 125, 115, 120, 120, 120, 120, 130, 130, 130, 120, 120,
2076 110, 110, 115, 110, 120 },
2078 /* Golem: theoretical, copied from High_Elf */
2079 { 110, 105, 100, 105, 110, 120, 125, 130, 110, 100, 110,
2080 125, 125, 101, 120, 115, 110, 115, 125, 110, 110, 110,
2081 125, 115, 120, 120, 120, 120, 130, 130, 130, 95, 140,
2082 110, 110, 115, 110, 110 },
2084 /* Skeleton: theoretical, copied from half-orc */
2085 { 115, 120, 125, 115, 115, 130, 110, 115, 115, 125, 115,
2086 110, 110, 120, 110, 120, 125, 115, 115, 110, 120, 110,
2087 115, 125, 120, 120, 120, 120, 130, 130, 130, 120, 120,
2088 115, 110, 125, 115, 110 },
2090 /* Zombie: Theoretical, copied from half-orc */
2091 { 115, 120, 125, 115, 115, 130, 110, 115, 115, 125, 115,
2092 110, 110, 120, 110, 120, 125, 115, 115, 110, 120, 110,
2093 115, 125, 120, 120, 120, 120, 130, 130, 130, 120, 120,
2094 115, 110, 125, 115, 110 },
2096 /* Vampire: Theoretical, copied from half-orc */
2097 { 115, 120, 125, 115, 115, 130, 110, 115, 115, 125, 115,
2098 110, 110, 120, 110, 120, 125, 115, 115, 110, 120, 110,
2099 115, 125, 120, 120, 120, 120, 130, 130, 130, 120, 120,
2100 115, 110, 125, 115, 120 },
2102 /* Spectre: Theoretical, copied from half-orc */
2103 { 115, 120, 125, 115, 115, 130, 110, 115, 115, 125, 115,
2104 110, 110, 120, 110, 120, 125, 115, 115, 110, 120, 110,
2105 115, 125, 120, 120, 120, 120, 130, 130, 130, 120, 120,
2106 115, 110, 125, 115, 110 },
2108 /* Sprite: Theoretical, copied from half-orc */
2109 { 115, 120, 125, 115, 115, 130, 110, 115, 115, 125, 115,
2110 110, 110, 120, 110, 120, 125, 115, 115, 110, 120, 110,
2111 115, 125, 120, 120, 120, 120, 130, 130, 130, 95, 140,
2112 115, 110, 105, 115, 110 },
2114 /* Beastman: Theoretical, copied from half-orc */
2115 { 115, 120, 125, 115, 115, 130, 110, 115, 115, 125, 115,
2116 110, 110, 120, 110, 120, 125, 115, 115, 110, 120, 110,
2117 115, 125, 120, 120, 120, 120, 130, 130, 130, 95, 140,
2118 115, 110, 115, 115, 125 },
2121 { 110, 105, 100, 105, 110, 120, 125, 130, 110, 100, 110,
2122 120, 120, 105, 120, 110, 105, 125, 125, 110, 115, 108,
2123 120, 115, 110, 110, 120, 110, 100, 125, 100, 95, 140,
2124 110, 110, 105, 110, 110 },
2127 { 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95,
2128 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95,
2129 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 160,
2130 95, 95, 95, 95, 95 },
2133 { 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, 140,
2134 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, 140,
2135 140, 140, 140, 140, 140, 140, 140, 140, 140, 160, 120,
2136 140, 140, 140, 140, 140 },
2139 { 100, 105, 105, 110, 113, 115, 120, 125, 100, 105, 100,
2140 124, 120, 110, 125, 115, 120, 120, 120, 120, 115, 120,
2141 115, 105, 125, 125, 125, 125, 105, 120, 105, 95, 140,
2142 100, 120, 110, 100, 110 },
2145 { 110, 110, 110, 115, 120, 130, 115, 115, 120, 110, 115,
2146 115, 115, 116, 115, 120, 120, 115, 115, 101, 110, 110,
2147 110, 110, 112, 122, 110, 110, 110, 115, 110, 120, 120,
2148 110, 101, 115, 110, 115 },
2151 { 110, 110, 105, 105, 110, 115, 115, 115, 110, 105, 110,
2152 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115,
2153 115, 115, 125, 125, 125, 125, 105, 115, 105, 95, 140,
2154 110, 115, 100, 110, 110 },
2157 { 105, 105, 105, 110, 113, 115, 120, 125, 100, 105, 100,
2158 124, 120, 110, 125, 115, 120, 120, 120, 120, 115, 120,
2159 115, 105, 125, 125, 125, 125, 105, 120, 105, 95, 140,
2160 100, 120, 110, 100, 110 },
2163 { 110, 110, 110, 105, 110, 120, 125, 130, 110, 110, 110,
2164 120, 115, 108, 115, 110, 110, 120, 120, 115, 115, 110,
2165 120, 110, 110, 110, 120, 110, 110, 125, 110, 95, 140,
2166 110, 115, 110, 110, 100 },
2172 * @brief 店舗価格を決定する /
2173 * Determine the price of an item (qty one) in a store.
2174 * @param o_ptr 店舗に並べるオブジェクト構造体の参照ポインタ
2175 * @param greed 店主の強欲度
2176 * @param flip TRUEならば店主にとっての買取価格、FALSEなら売出価格を計算
2180 * This function takes into account the player's charisma, and the
2181 * shop-keepers friendliness, and the shop-keeper's base greed, but
2182 * never lets a shop-keeper lose money in a transaction.
2183 * The "greed" value should exceed 100 when the player is "buying" the
2184 * item, and should be less than 100 when the player is "selling" it.
2185 * Hack -- the black market always charges twice as much as it should.
2186 * Charisma adjustment runs from 80 to 130
2187 * Racial adjustment runs from 95 to 130
2188 * Since greed/charisma/racial adjustments are centered at 100, we need
2189 * to adjust (by 200) to extract a usable multiplier. Note that the
2190 * "greed" value is always something (?).
2193 static s32b price_item(object_type *o_ptr, int greed, bool flip)
2200 /* Get the value of one of the items */
2201 price = object_value(o_ptr);
2203 /* Worthless items */
2204 if (price <= 0) return (0L);
2207 /* Compute the racial factor */
2208 factor = rgold_adj[ot_ptr->owner_race][p_ptr->prace];
2210 /* Add in the charisma factor */
2211 factor += adj_chr_gold[p_ptr->stat_ind[A_CHR]];
2214 /* Shop is buying */
2217 /* Adjust for greed */
2218 adjust = 100 + (300 - (greed + factor));
2220 /* Never get "silly" */
2221 if (adjust > 100) adjust = 100;
2223 /* Mega-Hack -- Black market sucks */
2224 if (cur_store_num == STORE_BLACK)
2227 /* Compute the final price (with rounding) */
2228 /* Hack -- prevent underflow */
2229 price = (price * adjust + 50L) / 100L;
2232 /* Shop is selling */
2235 /* Adjust for greed */
2236 adjust = 100 + ((greed + factor) - 300);
2238 /* Never get "silly" */
2239 if (adjust < 100) adjust = 100;
2241 /* Mega-Hack -- Black market sucks */
2242 if (cur_store_num == STORE_BLACK)
2245 /* Compute the final price (with rounding) */
2246 /* Hack -- prevent overflow */
2247 price = (s32b)(((u32b)price * (u32b)adjust + 50UL) / 100UL);
2250 /* Note -- Never become "free" */
2251 if (price <= 0L) return (1L);
2253 /* Return the price */
2259 * @brief 安価な消耗品の販売数を増やし、低確率で割引にする /
2260 * Certain "cheap" objects should be created in "piles"
2261 * @param o_ptr 店舗に並べるオブジェクト構造体の参照ポインタ
2265 * Some objects can be sold at a "discount" (in small piles)
2268 static void mass_produce(object_type *o_ptr)
2271 DISCOUNT_RATE discount = 0;
2273 PRICE cost = object_value(o_ptr);
2276 /* Analyze the type */
2277 switch (o_ptr->tval)
2279 /* Food, Flasks, and Lites */
2284 if (cost <= 5L) size += damroll(3, 5);
2285 if (cost <= 20L) size += damroll(3, 5);
2286 if (cost <= 50L) size += damroll(2, 2);
2293 if (cost <= 60L) size += damroll(3, 5);
2294 if (cost <= 240L) size += damroll(1, 5);
2295 if (o_ptr->sval == SV_SCROLL_STAR_IDENTIFY) size += damroll(3, 5);
2296 if (o_ptr->sval == SV_SCROLL_STAR_REMOVE_CURSE) size += damroll(1, 4);
2301 case TV_SORCERY_BOOK:
2302 case TV_NATURE_BOOK:
2306 case TV_ARCANE_BOOK:
2308 case TV_DAEMON_BOOK:
2309 case TV_CRUSADE_BOOK:
2311 case TV_HISSATSU_BOOK:
2314 if (cost <= 50L) size += damroll(2, 3);
2315 if (cost <= 500L) size += damroll(1, 3);
2333 if (object_is_artifact(o_ptr)) break;
2334 if (object_is_ego(o_ptr)) break;
2335 if (cost <= 10L) size += damroll(3, 5);
2336 if (cost <= 100L) size += damroll(3, 5);
2345 if (cost <= 5L) size += damroll(5, 5);
2346 if (cost <= 50L) size += damroll(5, 5);
2347 if (cost <= 500L) size += damroll(5, 5);
2353 if (cost <= 100L) size += damroll(2, 2);
2354 if (cost <= 1000L) size += damroll(2, 2);
2367 * Because many rods (and a few wands and staffs) are useful mainly
2368 * in quantity, the Black Market will occasionally have a bunch of
2375 if ((cur_store_num == STORE_BLACK) && one_in_(3))
2377 if (cost < 1601L) size += damroll(1, 5);
2378 else if (cost < 3201L) size += damroll(1, 3);
2385 /* Pick a discount */
2390 else if (one_in_(25))
2394 else if (one_in_(150))
2398 else if (one_in_(300))
2402 else if (one_in_(500))
2407 if (o_ptr->art_name)
2412 /* Save the discount */
2413 o_ptr->discount = discount;
2415 /* Save the total pile size */
2416 o_ptr->number = size - (size * discount / 100);
2418 /* Ensure that mass-produced rods and wands get the correct pvals. */
2419 if ((o_ptr->tval == TV_ROD) || (o_ptr->tval == TV_WAND))
2421 o_ptr->pval *= (PARAMETER_VALUE)o_ptr->number;
2428 * @brief 店舗に並べた品を同一品であるかどうか判定する /
2429 * Determine if a store item can "absorb" another item
2430 * @param o_ptr 判定するオブジェクト構造体の参照ポインタ1
2431 * @param j_ptr 判定するオブジェクト構造体の参照ポインタ2
2432 * @return 同一扱いできるならTRUEを返す
2435 * See "object_similar()" for the same function for the "player"
2438 static bool store_object_similar(object_type *o_ptr, object_type *j_ptr)
2442 /* Hack -- Identical items cannot be stacked */
2443 if (o_ptr == j_ptr) return (0);
2445 /* Different objects cannot be stacked */
2446 if (o_ptr->k_idx != j_ptr->k_idx) return (0);
2448 /* Different charges (etc) cannot be stacked, unless wands or rods. */
2449 if ((o_ptr->pval != j_ptr->pval) && (o_ptr->tval != TV_WAND) && (o_ptr->tval != TV_ROD)) return (0);
2451 /* Require many identical values */
2452 if (o_ptr->to_h != j_ptr->to_h) return (0);
2453 if (o_ptr->to_d != j_ptr->to_d) return (0);
2454 if (o_ptr->to_a != j_ptr->to_a) return (0);
2456 /* Require identical "ego-item" names */
2457 if (o_ptr->name2 != j_ptr->name2) return (0);
2459 /* Artifacts don't stack! */
2460 if (object_is_artifact(o_ptr) || object_is_artifact(j_ptr)) return (0);
2462 /* Hack -- Identical art_flags! */
2463 for (i = 0; i < TR_FLAG_SIZE; i++)
2464 if (o_ptr->art_flags[i] != j_ptr->art_flags[i]) return (0);
2466 /* Hack -- Never stack "powerful" items */
2467 if (o_ptr->xtra1 || j_ptr->xtra1) return (0);
2469 /* Hack -- Never stack recharging items */
2470 if (o_ptr->timeout || j_ptr->timeout) return (0);
2472 /* Require many identical values */
2473 if (o_ptr->ac != j_ptr->ac) return (0);
2474 if (o_ptr->dd != j_ptr->dd) return (0);
2475 if (o_ptr->ds != j_ptr->ds) return (0);
2477 /* Hack -- Never stack chests */
2478 if (o_ptr->tval == TV_CHEST) return (0);
2479 if (o_ptr->tval == TV_STATUE) return (0);
2480 if (o_ptr->tval == TV_CAPTURE) return (0);
2482 /* Require matching discounts */
2483 if (o_ptr->discount != j_ptr->discount) return (0);
2485 /* They match, so they must be similar */
2491 * @brief 店舗に並べた品を重ね合わせできるかどうか判定する /
2492 * Allow a store item to absorb another item
2493 * @param o_ptr 判定するオブジェクト構造体の参照ポインタ1
2494 * @param j_ptr 判定するオブジェクト構造体の参照ポインタ2
2495 * @return 重ね合わせできるならTRUEを返す
2498 * See "object_similar()" for the same function for the "player"
2501 static void store_object_absorb(object_type *o_ptr, object_type *j_ptr)
2503 int max_num = (o_ptr->tval == TV_ROD) ?
2504 MIN(99, MAX_SHORT / k_info[o_ptr->k_idx].pval) : 99;
2505 int total = o_ptr->number + j_ptr->number;
2506 int diff = (total > max_num) ? total - max_num : 0;
2508 /* Combine quantity, lose excess items */
2509 o_ptr->number = (total > max_num) ? max_num : total;
2511 /* Hack -- if rods are stacking, add the pvals (maximum timeouts) together. -LM- */
2512 if (o_ptr->tval == TV_ROD)
2514 o_ptr->pval += j_ptr->pval * (j_ptr->number - diff) / j_ptr->number;
2517 /* Hack -- if wands are stacking, combine the charges. -LM- */
2518 if (o_ptr->tval == TV_WAND)
2520 o_ptr->pval += j_ptr->pval * (j_ptr->number - diff) / j_ptr->number;
2526 * @brief 店舗に品を置くスペースがあるかどうかの判定を返す /
2527 * Check to see if the shop will be carrying too many objects -RAK-
2528 * @param o_ptr 店舗に置きたいオブジェクト構造体の参照ポインタ
2529 * @return 置き場がないなら0、重ね合わせできるアイテムがあるなら-1、スペースがあるなら1を返す。
2532 * Note that the shop, just like a player, will not accept things
2533 * it cannot hold. Before, one could "nuke" potions this way.
2534 * Return value is now int:
2536 * -1 : Can be combined to existing slot.
2537 * 1 : Cannot be combined but there are empty spaces.
2540 static int store_check_num(object_type *o_ptr)
2545 /* The "home" acts like the player */
2546 if ((cur_store_num == STORE_HOME) || (cur_store_num == STORE_MUSEUM))
2548 bool old_stack_force_notes = stack_force_notes;
2549 bool old_stack_force_costs = stack_force_costs;
2551 if (cur_store_num != STORE_HOME)
2553 stack_force_notes = FALSE;
2554 stack_force_costs = FALSE;
2557 /* Check all the items */
2558 for (i = 0; i < st_ptr->stock_num; i++)
2560 /* Get the existing item */
2561 j_ptr = &st_ptr->stock[i];
2563 /* Can the new object be combined with the old one? */
2564 if (object_similar(j_ptr, o_ptr))
2566 if (cur_store_num != STORE_HOME)
2568 stack_force_notes = old_stack_force_notes;
2569 stack_force_costs = old_stack_force_costs;
2576 if (cur_store_num != STORE_HOME)
2578 stack_force_notes = old_stack_force_notes;
2579 stack_force_costs = old_stack_force_costs;
2583 /* Normal stores do special stuff */
2586 /* Check all the items */
2587 for (i = 0; i < st_ptr->stock_num; i++)
2589 /* Get the existing item */
2590 j_ptr = &st_ptr->stock[i];
2592 /* Can the new object be combined with the old one? */
2593 if (store_object_similar(j_ptr, o_ptr)) return -1;
2597 /* Free space is always usable */
2599 * オプション powerup_home が設定されていると
2602 if ((cur_store_num == STORE_HOME) && ( powerup_home == FALSE )) {
2603 if (st_ptr->stock_num < ((st_ptr->stock_size) / 10)) {
2608 if (st_ptr->stock_num < st_ptr->stock_size) {
2613 /* But there was no room at the inn... */
2618 * @brief オブジェクトが祝福されているかの判定を返す /
2619 * @param o_ptr 判定したいオブジェクト構造体の参照ポインタ
2620 * @return アイテムが祝福されたアイテムならばTRUEを返す
2622 static bool is_blessed(object_type *o_ptr)
2624 BIT_FLAGS flgs[TR_FLAG_SIZE];
2625 object_flags(o_ptr, flgs);
2626 if (have_flag(flgs, TR_BLESSED)) return (TRUE);
2627 else return (FALSE);
2633 * @brief オブジェクトが所定の店舗で引き取れるかどうかを返す /
2634 * Determine if the current store will purchase the given item
2635 * @param o_ptr 判定したいオブジェクト構造体の参照ポインタ
2636 * @return アイテムが買い取れるならばTRUEを返す
2638 * Note that a shop-keeper must refuse to buy "worthless" items
2640 static bool store_will_buy(object_type *o_ptr)
2642 /* Hack -- The Home is simple */
2643 if ((cur_store_num == STORE_HOME) || (cur_store_num == STORE_MUSEUM)) return (TRUE);
2645 /* Switch on the store */
2646 switch (cur_store_num)
2651 /* Analyze the type */
2652 switch (o_ptr->tval)
2655 if (o_ptr->sval != SV_POTION_WATER) return FALSE;
2667 case TV_BOTTLE: /* 'Green', recycling Angband */
2682 /* Analyze the type */
2683 switch (o_ptr->tval)
2704 /* Analyze the type */
2705 switch (o_ptr->tval)
2714 case TV_HISSATSU_BOOK:
2718 if(o_ptr->sval == SV_WIZSTAFF) return (FALSE);
2730 /* Analyze the type */
2731 switch (o_ptr->tval)
2734 case TV_CRUSADE_BOOK:
2744 monster_race *r_ptr = &r_info[o_ptr->pval];
2747 if (!(r_ptr->flags3 & RF3_EVIL))
2750 if (r_ptr->flags3 & RF3_GOOD) break;
2752 /* Accept animals */
2753 if (r_ptr->flags3 & RF3_ANIMAL) break;
2756 if (my_strchr("?!", r_ptr->d_char)) break;
2762 if (is_blessed(o_ptr)) break;
2771 case STORE_ALCHEMIST:
2773 /* Analyze the type */
2774 switch (o_ptr->tval)
2788 /* Analyze the type */
2789 switch (o_ptr->tval)
2791 case TV_SORCERY_BOOK:
2792 case TV_NATURE_BOOK:
2796 case TV_ARCANE_BOOK:
2798 case TV_DAEMON_BOOK:
2812 if(o_ptr->sval == SV_WIZSTAFF) break;
2813 else return (FALSE);
2820 /* Bookstore Shop */
2823 /* Analyze the type */
2824 switch (o_ptr->tval)
2826 case TV_SORCERY_BOOK:
2827 case TV_NATURE_BOOK:
2832 case TV_ARCANE_BOOK:
2834 case TV_DAEMON_BOOK:
2835 case TV_CRUSADE_BOOK:
2846 /* Ignore "worthless" items */
2847 if (object_value(o_ptr) <= 0) return (FALSE);
2855 * @brief 現在の町の指定された店舗のアイテムを整理する /
2856 * Combine and reorder items in store.
2857 * @param store_num 店舗ID
2858 * @return 実際に整理が行われたならばTRUEを返す。
2860 bool combine_and_reorder_home(int store_num)
2864 object_type forge, *o_ptr, *j_ptr;
2865 bool flag = FALSE, combined;
2866 store_type *old_st_ptr = st_ptr;
2867 bool old_stack_force_notes = stack_force_notes;
2868 bool old_stack_force_costs = stack_force_costs;
2870 st_ptr = &town_info[1].store[store_num];
2871 if (store_num != STORE_HOME)
2873 stack_force_notes = FALSE;
2874 stack_force_costs = FALSE;
2881 /* Combine the items in the home (backwards) */
2882 for (i = st_ptr->stock_num - 1; i > 0; i--)
2884 o_ptr = &st_ptr->stock[i];
2886 /* Skip empty items */
2887 if (!o_ptr->k_idx) continue;
2889 /* Scan the items above that item */
2890 for (j = 0; j < i; j++)
2894 j_ptr = &st_ptr->stock[j];
2896 /* Skip empty items */
2897 if (!j_ptr->k_idx) continue;
2900 * Get maximum number of the stack if these
2901 * are similar, get zero otherwise.
2903 max_num = object_similar_part(j_ptr, o_ptr);
2905 /* Can we (partialy) drop "o_ptr" onto "j_ptr"? */
2906 if (max_num && j_ptr->number < max_num)
2908 if (o_ptr->number + j_ptr->number <= max_num)
2910 /* Add together the item counts */
2911 object_absorb(j_ptr, o_ptr);
2913 /* One object is gone */
2914 st_ptr->stock_num--;
2916 /* Slide everything down */
2917 for (k = i; k < st_ptr->stock_num; k++)
2919 /* Structure copy */
2920 st_ptr->stock[k] = st_ptr->stock[k + 1];
2923 /* Erase the "final" slot */
2924 object_wipe(&st_ptr->stock[k]);
2928 ITEM_NUMBER old_num = o_ptr->number;
2929 ITEM_NUMBER remain = j_ptr->number + o_ptr->number - max_num;
2931 /* Add together the item counts */
2932 object_absorb(j_ptr, o_ptr);
2934 o_ptr->number = remain;
2936 /* Hack -- if rods are stacking, add the pvals (maximum timeouts) and current timeouts together. -LM- */
2937 if (o_ptr->tval == TV_ROD)
2939 o_ptr->pval = o_ptr->pval * remain / old_num;
2940 o_ptr->timeout = o_ptr->timeout * remain / old_num;
2943 /* Hack -- if wands are stacking, combine the charges. -LM- */
2944 else if (o_ptr->tval == TV_WAND)
2946 o_ptr->pval = o_ptr->pval * remain / old_num;
2961 /* Re-order the items in the home (forwards) */
2962 for (i = 0; i < st_ptr->stock_num; i++)
2964 o_ptr = &st_ptr->stock[i];
2966 /* Skip empty slots */
2967 if (!o_ptr->k_idx) continue;
2969 /* Get the "value" of the item */
2970 o_value = object_value(o_ptr);
2972 /* Scan every occupied slot */
2973 for (j = 0; j < st_ptr->stock_num; j++)
2975 if (object_sort_comp(o_ptr, o_value, &st_ptr->stock[j])) break;
2978 /* Never move down */
2979 if (j >= i) continue;
2985 /* Save a copy of the moving item */
2986 object_copy(j_ptr, &st_ptr->stock[i]);
2988 /* Slide the objects */
2989 for (k = i; k > j; k--)
2991 /* Slide the item */
2992 object_copy(&st_ptr->stock[k], &st_ptr->stock[k - 1]);
2995 /* Insert the moving item */
2996 object_copy(&st_ptr->stock[j], j_ptr);
2999 st_ptr = old_st_ptr;
3000 if (store_num != STORE_HOME)
3002 stack_force_notes = old_stack_force_notes;
3003 stack_force_costs = old_stack_force_costs;
3011 * @brief 我が家にオブジェクトを加える /
3012 * Add the item "o_ptr" to the p_ptr->inventory_list of the "Home"
3013 * @param o_ptr 加えたいオブジェクトの構造体参照ポインタ
3017 * In all cases, return the slot (or -1) where the object was placed
3018 * Note that this is a hacked up version of "inven_carry()".
3019 * Also note that it may not correctly "adapt" to "knowledge" bacoming
3020 * known, the player may have to pick stuff up and drop it again.
3023 static int home_carry(object_type *o_ptr)
3029 bool old_stack_force_notes = stack_force_notes;
3030 bool old_stack_force_costs = stack_force_costs;
3032 if (cur_store_num != STORE_HOME)
3034 stack_force_notes = FALSE;
3035 stack_force_costs = FALSE;
3038 /* Check each existing item (try to combine) */
3039 for (slot = 0; slot < st_ptr->stock_num; slot++)
3041 /* Get the existing item */
3042 j_ptr = &st_ptr->stock[slot];
3044 /* The home acts just like the player */
3045 if (object_similar(j_ptr, o_ptr))
3047 /* Save the new number of items */
3048 object_absorb(j_ptr, o_ptr);
3050 if (cur_store_num != STORE_HOME)
3052 stack_force_notes = old_stack_force_notes;
3053 stack_force_costs = old_stack_force_costs;
3061 if (cur_store_num != STORE_HOME)
3063 stack_force_notes = old_stack_force_notes;
3064 stack_force_costs = old_stack_force_costs;
3069 * 隠し機能: オプション powerup_home が設定されていると
3073 if ((cur_store_num != STORE_HOME) || (powerup_home == TRUE)) {
3074 if (st_ptr->stock_num >= st_ptr->stock_size) {
3079 if (st_ptr->stock_num >= ((st_ptr->stock_size) / 10)) {
3085 /* Determine the "value" of the item */
3086 value = object_value(o_ptr);
3088 /* Check existing slots to see if we must "slide" */
3089 for (slot = 0; slot < st_ptr->stock_num; slot++)
3091 if (object_sort_comp(o_ptr, value, &st_ptr->stock[slot])) break;
3094 /* Slide the others up */
3095 for (i = st_ptr->stock_num; i > slot; i--)
3097 st_ptr->stock[i] = st_ptr->stock[i-1];
3100 /* More stuff now */
3101 st_ptr->stock_num++;
3103 /* Insert the new item */
3104 st_ptr->stock[slot] = *o_ptr;
3106 chg_virtue(V_SACRIFICE, -1);
3108 (void)combine_and_reorder_home(cur_store_num);
3110 /* Return the location */
3116 * @brief 店舗にオブジェクトを加える /
3117 * Add the item "o_ptr" to a real stores p_ptr->inventory_list.
3118 * @param o_ptr 加えたいオブジェクトの構造体参照ポインタ
3122 * In all cases, return the slot (or -1) where the object was placed
3123 * Note that this is a hacked up version of "inven_carry()".
3124 * Also note that it may not correctly "adapt" to "knowledge" bacoming
3125 * known, the player may have to pick stuff up and drop it again.
3128 static int store_carry(object_type *o_ptr)
3131 PRICE value, j_value;
3135 /* Evaluate the object */
3136 value = object_value(o_ptr);
3138 /* Cursed/Worthless items "disappear" when sold */
3139 if (value <= 0) return (-1);
3141 /* All store items are fully *identified* */
3142 o_ptr->ident |= IDENT_MENTAL;
3144 /* Erase the inscription */
3145 o_ptr->inscription = 0;
3147 /* Erase the "feeling" */
3148 o_ptr->feeling = FEEL_NONE;
3150 /* Check each existing item (try to combine) */
3151 for (slot = 0; slot < st_ptr->stock_num; slot++)
3153 /* Get the existing item */
3154 j_ptr = &st_ptr->stock[slot];
3156 /* Can the existing items be incremented? */
3157 if (store_object_similar(j_ptr, o_ptr))
3159 /* Hack -- extra items disappear */
3160 store_object_absorb(j_ptr, o_ptr);
3168 if (st_ptr->stock_num >= st_ptr->stock_size) return (-1);
3171 /* Check existing slots to see if we must "slide" */
3172 for (slot = 0; slot < st_ptr->stock_num; slot++)
3175 j_ptr = &st_ptr->stock[slot];
3177 /* Objects sort by decreasing type */
3178 if (o_ptr->tval > j_ptr->tval) break;
3179 if (o_ptr->tval < j_ptr->tval) continue;
3181 /* Objects sort by increasing sval */
3182 if (o_ptr->sval < j_ptr->sval) break;
3183 if (o_ptr->sval > j_ptr->sval) continue;
3186 * Hack: otherwise identical rods sort by
3187 * increasing recharge time --dsb
3189 if (o_ptr->tval == TV_ROD)
3191 if (o_ptr->pval < j_ptr->pval) break;
3192 if (o_ptr->pval > j_ptr->pval) continue;
3195 /* Evaluate that slot */
3196 j_value = object_value(j_ptr);
3198 /* Objects sort by decreasing value */
3199 if (value > j_value) break;
3200 if (value < j_value) continue;
3203 /* Slide the others up */
3204 for (i = st_ptr->stock_num; i > slot; i--)
3206 st_ptr->stock[i] = st_ptr->stock[i-1];
3209 /* More stuff now */
3210 st_ptr->stock_num++;
3212 /* Insert the new item */
3213 st_ptr->stock[slot] = *o_ptr;
3215 /* Return the location */
3221 * @brief 店舗のオブジェクト数を増やす /
3222 * Add the item "o_ptr" to a real stores p_ptr->inventory_list.
3223 * @param item 増やしたいアイテムのID
3228 * Increase, by a given amount, the number of a certain item
3229 * in a certain store. This can result in zero items.
3231 * @todo numは本来ITEM_NUMBER型にしたい。
3233 static void store_item_increase(INVENTORY_IDX item, int num)
3238 o_ptr = &st_ptr->stock[item];
3240 /* Verify the number */
3241 cnt = o_ptr->number + num;
3242 if (cnt > 255) cnt = 255;
3243 else if (cnt < 0) cnt = 0;
3244 num = cnt - o_ptr->number;
3246 /* Save the new number */
3247 o_ptr->number += (ITEM_NUMBER)num;
3252 * @brief 店舗のオブジェクト数を削除する /
3253 * Remove a slot if it is empty
3254 * @param item 削除したいアイテムのID
3257 static void store_item_optimize(INVENTORY_IDX item)
3262 o_ptr = &st_ptr->stock[item];
3265 if (!o_ptr->k_idx) return;
3267 /* Must have no items */
3268 if (o_ptr->number) return;
3271 st_ptr->stock_num--;
3273 /* Slide everyone */
3274 for (j = item; j < st_ptr->stock_num; j++)
3276 st_ptr->stock[j] = st_ptr->stock[j + 1];
3279 /* Nuke the final slot */
3280 object_wipe(&st_ptr->stock[j]);
3284 * @brief ブラックマーケット用の無価値品の排除判定 /
3285 * This function will keep 'crap' out of the black market.
3286 * @param o_ptr 判定したいオブジェクトの構造体参照ポインタ
3287 * @return ブラックマーケットにとって無価値な品ならばTRUEを返す
3290 * Crap is defined as any item that is "available" elsewhere
3291 * Based on a suggestion by "Lee Vogt" <lvogt@cig.mcel.mot.com>
3294 static bool black_market_crap(object_type *o_ptr)
3298 /* Ego items are never crap */
3299 if (object_is_ego(o_ptr)) return (FALSE);
3301 /* Good items are never crap */
3302 if (o_ptr->to_a > 0) return (FALSE);
3303 if (o_ptr->to_h > 0) return (FALSE);
3304 if (o_ptr->to_d > 0) return (FALSE);
3306 /* Check all stores */
3307 for (i = 0; i < MAX_STORES; i++)
3309 if (i == STORE_HOME) continue;
3310 if (i == STORE_MUSEUM) continue;
3312 /* Check every item in the store */
3313 for (j = 0; j < town_info[p_ptr->town_num].store[i].stock_num; j++)
3315 object_type *j_ptr = &town_info[p_ptr->town_num].store[i].stock[j];
3317 /* Duplicate item "type", assume crappy */
3318 if (o_ptr->k_idx == j_ptr->k_idx) return (TRUE);
3328 * @brief 店舗の品揃え変化のためにアイテムを削除する /
3329 * Attempt to delete (some of) a random item from the store
3333 * Hack -- we attempt to "maintain" piles of items when possible.
3336 static void store_delete(void)
3341 /* Pick a random slot */
3342 what = (INVENTORY_IDX)randint0(st_ptr->stock_num);
3344 /* Determine how many items are here */
3345 num = st_ptr->stock[what].number;
3347 /* Hack -- sometimes, only destroy half the items */
3348 if (randint0(100) < 50) num = (num + 1) / 2;
3350 /* Hack -- sometimes, only destroy a single item */
3351 if (randint0(100) < 50) num = 1;
3353 /* Hack -- decrement the maximum timeouts and total charges of rods and wands. -LM- */
3354 if ((st_ptr->stock[what].tval == TV_ROD) || (st_ptr->stock[what].tval == TV_WAND))
3356 st_ptr->stock[what].pval -= num * st_ptr->stock[what].pval / st_ptr->stock[what].number;
3359 /* Actually destroy (part of) the item */
3360 store_item_increase(what, -num);
3361 store_item_optimize(what);
3366 * @brief 店舗の品揃え変化のためにアイテムを追加する /
3367 * Creates a random item and gives it to a store
3371 * This algorithm needs to be rethought. A lot.
3372 * Currently, "normal" stores use a pre-built array.
3373 * Note -- the "level" given to "obj_get_num()" is a "favored"
3374 * level, that is, there is a much higher chance of getting
3375 * items with a level approaching that of the given level...
3376 * Should we check for "permission" to have the given item?
3379 static void store_create(void)
3389 /* Paranoia -- no room left */
3390 if (st_ptr->stock_num >= st_ptr->stock_size) return;
3393 /* Hack -- consider up to four items */
3394 for (tries = 0; tries < 4; tries++)
3397 if (cur_store_num == STORE_BLACK)
3399 /* Pick a level for object/magic */
3400 level = 25 + randint0(25);
3402 /* Random item (usually of given level) */
3403 i = get_obj_num(level);
3405 /* Handle failure */
3412 /* Hack -- Pick an item to sell */
3413 i = st_ptr->table[randint0(st_ptr->table_num)];
3415 /* Hack -- fake level for apply_magic() */
3416 level = rand_range(1, STORE_OBJ_LEVEL);
3421 /* Create a new object of the chosen kind */
3422 object_prep(q_ptr, i);
3424 /* Apply some "low-level" magic (no artifacts) */
3425 apply_magic(q_ptr, level, AM_NO_FIXED_ART);
3427 /* Require valid object */
3428 if (!store_will_buy(q_ptr)) continue;
3430 /* Hack -- Charge lite's */
3431 if (q_ptr->tval == TV_LITE)
3433 if (q_ptr->sval == SV_LITE_TORCH) q_ptr->xtra4 = FUEL_TORCH / 2;
3434 if (q_ptr->sval == SV_LITE_LANTERN) q_ptr->xtra4 = FUEL_LAMP / 2;
3438 /* The item is "known" */
3439 object_known(q_ptr);
3441 /* Mark it storebought */
3442 q_ptr->ident |= IDENT_STORE;
3444 /* Mega-Hack -- no chests in stores */
3445 if (q_ptr->tval == TV_CHEST) continue;
3447 /* Prune the black market */
3448 if (cur_store_num == STORE_BLACK)
3450 /* Hack -- No "crappy" items */
3451 if (black_market_crap(q_ptr)) continue;
3453 /* Hack -- No "cheap" items */
3454 if (object_value(q_ptr) < 10) continue;
3456 /* No "worthless" items */
3457 /* if (object_value(q_ptr) <= 0) continue; */
3460 /* Prune normal stores */
3463 /* No "worthless" items */
3464 if (object_value(q_ptr) <= 0) continue;
3468 /* Mass produce and/or Apply discount */
3469 mass_produce(q_ptr);
3471 /* Attempt to carry the (known) item */
3472 (void)store_carry(q_ptr);
3474 /* Definitely done */
3481 * @brief 店舗の割引対象外にするかどうかを判定 /
3482 * Eliminate need to bargain if player has haggled well in the past
3483 * @param minprice アイテムの最低販売価格
3484 * @return 割引を禁止するならTRUEを返す。
3486 static bool noneedtobargain(PRICE minprice)
3488 PRICE good = st_ptr->good_buy;
3489 PRICE bad = st_ptr->bad_buy;
3491 /* Cheap items are "boring" */
3492 if (minprice < 10L) return (TRUE);
3494 /* Perfect haggling */
3495 if (good == MAX_SHORT) return (TRUE);
3497 /* Reward good haggles, punish bad haggles, notice price */
3498 if (good > ((3 * bad) + (5 + (minprice/50)))) return (TRUE);
3500 /* Return the flag */
3506 * @brief 店主の持つプレイヤーに対する売買の良し悪し経験を記憶する /
3507 * Update the bargain info
3508 * @param price 実際の取引価格
3509 * @param minprice 店主の提示した価格
3513 static void updatebargain(PRICE price, PRICE minprice, int num)
3515 /* Hack -- auto-haggle */
3516 if (!manual_haggle) return;
3518 /* Cheap items are "boring" */
3519 if ((minprice/num) < 10L) return;
3521 /* Count the successful haggles */
3522 if (price == minprice)
3524 /* Just count the good haggles */
3525 if (st_ptr->good_buy < MAX_SHORT)
3531 /* Count the failed haggles */
3534 /* Just count the bad haggles */
3535 if (st_ptr->bad_buy < MAX_SHORT)
3544 * @brief 店の商品リストを再表示する /
3545 * Re-displays a single store entry
3549 static void display_entry(int pos)
3555 GAME_TEXT o_name[MAX_NLEN];
3560 o_ptr = &st_ptr->stock[pos];
3562 /* Get the "offset" */
3563 i = (pos % store_bottom);
3565 /* Label it, clear the line --(-- */
3566 (void)sprintf(out_val, "%c) ", ((i > 25) ? toupper(I2A(i - 26)) : I2A(i)));
3567 prt(out_val, i+6, 0);
3570 if (show_item_graph)
3572 TERM_COLOR a = object_attr(o_ptr);
3573 SYMBOL_CODE c = object_char(o_ptr);
3575 Term_queue_bigchar(cur_col, i + 6, a, c, 0, 0);
3576 if (use_bigtile) cur_col++;
3581 /* Describe an item in the home */
3582 if ((cur_store_num == STORE_HOME) || (cur_store_num == STORE_MUSEUM))
3586 /* Leave room for weights, if necessary -DRS- */
3587 if (show_weights) maxwid -= 10;
3589 object_desc(o_name, o_ptr, 0);
3590 o_name[maxwid] = '\0';
3591 c_put_str(tval_to_attr[o_ptr->tval], o_name, i+6, cur_col);
3596 /* Only show the weight of an individual item */
3597 WEIGHT wgt = o_ptr->weight;
3599 sprintf(out_val, "%3d.%1d kg", lbtokg1(wgt) , lbtokg2(wgt));
3600 put_str(out_val, i+6, 67);
3602 (void)sprintf(out_val, "%3d.%d lb", wgt / 10, wgt % 10);
3603 put_str(out_val, i+6, 68);
3609 /* Describe an item (fully) in a store */
3612 /* Must leave room for the "price" */
3615 /* Leave room for weights, if necessary -DRS- */
3616 if (show_weights) maxwid -= 7;
3618 /* Describe the object (fully) */
3619 object_desc(o_name, o_ptr, 0);
3620 o_name[maxwid] = '\0';
3621 c_put_str(tval_to_attr[o_ptr->tval], o_name, i+6, cur_col);
3626 /* Only show the weight of an individual item */
3627 int wgt = o_ptr->weight;
3629 sprintf(out_val, "%3d.%1d", lbtokg1(wgt) , lbtokg2(wgt) );
3630 put_str(out_val, i+6, 60);
3632 (void)sprintf(out_val, "%3d.%d", wgt / 10, wgt % 10);
3633 put_str(out_val, i+6, 61);
3638 /* Display a "fixed" cost */
3639 if (o_ptr->ident & (IDENT_FIXED))
3641 /* Extract the "minimum" price */
3642 x = price_item(o_ptr, ot_ptr->min_inflate, FALSE);
3644 /* Actually draw the price (not fixed) */
3646 (void)sprintf(out_val, "%9ld固", (long)x);
3648 (void)sprintf(out_val, "%9ld F", (long)x);
3650 put_str(out_val, i+6, 68);
3653 /* Display a "taxed" cost */
3654 else if (!manual_haggle)
3656 /* Extract the "minimum" price */
3657 x = price_item(o_ptr, ot_ptr->min_inflate, FALSE);
3659 /* Hack -- Apply Sales Tax if needed */
3660 if (!noneedtobargain(x)) x += x / 10;
3662 /* Actually draw the price (with tax) */
3663 (void)sprintf(out_val, "%9ld ", (long)x);
3664 put_str(out_val, i+6, 68);
3667 /* Display a "haggle" cost */
3670 /* Extrect the "maximum" price */
3671 x = price_item(o_ptr, ot_ptr->max_inflate, FALSE);
3673 /* Actually draw the price (not fixed) */
3674 (void)sprintf(out_val, "%9ld ", (long)x);
3675 put_str(out_val, i+6, 68);
3682 * @brief 店の商品リストを表示する /
3683 * Displays a store's p_ptr->inventory_list -RAK-
3686 * All prices are listed as "per individual object". -BEN-
3688 static void display_inventory(void)
3692 /* Display the next 12 items */
3693 for (k = 0; k < store_bottom; k++)
3695 /* Do not display "dead" items */
3696 if (store_top + k >= st_ptr->stock_num) break;
3698 /* Display that line */
3699 display_entry(store_top + k);
3702 /* Erase the extra lines and the "more" prompt */
3703 for (i = k; i < store_bottom + 1; i++) prt("", i + 6, 0);
3705 /* Assume "no current page" */
3707 put_str(" ", 5, 20);
3709 put_str(" ", 5, 20);
3713 /* Visual reminder of "more items" */
3714 if (st_ptr->stock_num > store_bottom)
3716 /* Show "more" reminder (after the last item) */
3717 prt(_("-続く-", "-more-"), k + 6, 3);
3719 /* Indicate the "current page" */
3720 /* Trailing spaces are to display (Page xx) and (Page x) */
3721 put_str(format(_("(%dページ) ", "(Page %d) "), store_top/store_bottom + 1), 5, 20);
3724 if (cur_store_num == STORE_HOME || cur_store_num == STORE_MUSEUM)
3726 k = st_ptr->stock_size;
3728 if (cur_store_num == STORE_HOME && !powerup_home) k /= 10;
3730 put_str(format("アイテム数: %4d/%4d", st_ptr->stock_num, k), 19 + xtra_stock, 27);
3732 put_str(format("Objects: %4d/%4d", st_ptr->stock_num, k), 19 + xtra_stock, 30);
3739 * @brief プレイヤーの所持金を表示する /
3740 * Displays players gold -RAK-
3744 static void store_prt_gold(void)
3748 prt(_("手持ちのお金: ", "Gold Remaining: "), 19 + xtra_stock, 53);
3749 sprintf(out_val, "%9ld", (long)p_ptr->au);
3750 prt(out_val, 19 + xtra_stock, 68);
3754 * @brief 店舗情報全体を表示するメインルーチン /
3755 * Displays store (after clearing screen) -RAK-
3759 static void display_store(void)
3765 /* The "Home" is special */
3766 if (cur_store_num == STORE_HOME)
3768 /* Put the owner name */
3769 put_str(_("我が家", "Your Home"), 3, 31);
3771 /* Label the item descriptions */
3772 put_str(_("アイテムの一覧", "Item Description"), 5, 4);
3774 /* If showing weights, show label */
3777 put_str(_(" 重さ", "Weight"), 5, 70);
3781 /* The "Home" is special */
3782 else if (cur_store_num == STORE_MUSEUM)
3784 /* Put the owner name */
3785 put_str(_("博物館", "Museum"), 3, 31);
3787 /* Label the item descriptions */
3788 put_str(_("アイテムの一覧", "Item Description"), 5, 4);
3790 /* If showing weights, show label */
3793 put_str(_(" 重さ", "Weight"), 5, 70);
3800 concptr store_name = (f_name + f_info[cur_store_feat].name);
3801 concptr owner_name = (ot_ptr->owner_name);
3802 concptr race_name = race_info[ot_ptr->owner_race].title;
3804 /* Put the owner name and race */
3805 sprintf(buf, "%s (%s)", owner_name, race_name);
3806 put_str(buf, 3, 10);
3808 /* Show the max price in the store (above prices) */
3809 sprintf(buf, "%s (%ld)", store_name, (long)(ot_ptr->max_cost));
3812 /* Label the item descriptions */
3813 put_str(_("商品の一覧", "Item Description"), 5, 5);
3816 /* If showing weights, show label */
3819 put_str(_(" 重さ", "Weight"), 5, 60);
3822 /* Label the asking price (in stores) */
3823 put_str(_(" 価格", "Price"), 5, 72);
3826 /* Display the current gold */
3829 /* Draw in the p_ptr->inventory_list */
3830 display_inventory();
3836 * @brief 店舗からアイテムを選択する /
3837 * Get the ID of a store item and return its value -RAK-
3838 * @param com_val 選択IDを返す参照ポインタ
3839 * @param pmt メッセージキャプション
3842 * @return 実際に選択したらTRUE、キャンセルしたらFALSE
3844 static int get_stock(COMMAND_CODE *com_val, concptr pmt, int i, int j)
3850 /* Get the item index */
3851 if (repeat_pull(com_val))
3853 /* Verify the item */
3854 if ((*com_val >= i) && (*com_val <= j))
3862 /* Assume failure */
3865 /* Build the prompt */
3867 hi = (j > 25) ? toupper(I2A(j - 26)) : I2A(j);
3869 (void)sprintf(out_val, "(%s:%c-%c, ESCで中断) %s",
3870 (((cur_store_num == STORE_HOME) || (cur_store_num == STORE_MUSEUM)) ? "アイテム" : "商品"),
3873 (void)sprintf(out_val, "(Items %c-%c, ESC to exit) %s",
3878 /* Ask until done */
3884 if (!get_com(out_val, &command, FALSE)) break;
3887 if (islower(command))
3889 else if (isupper(command))
3890 k = A2I(tolower(command)) + 26;
3894 /* Legal responses */
3895 if ((k >= i) && (k <= j))
3904 /* Clear the prompt */
3907 if (command == ESCAPE) return (FALSE);
3909 repeat_push(*com_val);
3917 * @brief 店主の不満度を増やし、プレイヤーを締め出す判定と処理を行う /
3918 * Increase the insult counter and get angry if too many -RAK-
3919 * @return プレイヤーを締め出す場合TRUEを返す
3921 static int increase_insults(void)
3923 /* Increase insults */
3924 st_ptr->insult_cur++;
3926 /* Become insulted */
3927 if (st_ptr->insult_cur > ot_ptr->insult_max)
3933 st_ptr->insult_cur = 0;
3934 st_ptr->good_buy = 0;
3935 st_ptr->bad_buy = 0;
3938 st_ptr->store_open = current_world_ptr->game_turn + TURNS_PER_TICK*TOWN_DAWN/8 + randint1(TURNS_PER_TICK*TOWN_DAWN/8);
3950 * @brief 店主の不満度を減らす /
3951 * Decrease insults -RAK-
3952 * @return プレイヤーを締め出す場合TRUEを返す
3954 static void decrease_insults(void)
3956 /* Decrease insults */
3957 if (st_ptr->insult_cur) st_ptr->insult_cur--;
3962 * @brief 店主の不満度が増えた場合のみのメッセージを表示する /
3963 * Have insulted while haggling -RAK-
3964 * @return プレイヤーを締め出す場合TRUEを返す
3966 static int haggle_insults(void)
3968 /* Increase insults */
3969 if (increase_insults()) return (TRUE);
3971 /* Display and flush insult */
3980 * Mega-Hack -- Enable "increments"
3982 static bool allow_inc = FALSE;
3985 * Mega-Hack -- Last "increment" during haggling
3987 static s32b last_inc = 0L;
3991 * @brief 交渉価格を確認と認証の是非を行う /
3994 * @param poffer 別途価格提示をした場合の値を返す参照ポインタ
3995 * @param price 現在の交渉価格
3996 * @param final 最終確定価格ならばTRUE
3997 * @return プレイヤーを締め出す場合TRUEを返す
3999 static int get_haggle(concptr pmt, s32b *poffer, PRICE price, int final)
4004 GAME_TEXT out_val[160];
4006 /* Clear old increment if necessary */
4007 if (!allow_inc) last_inc = 0L;
4012 sprintf(buf, _("%s [承諾] ", "%s [accept] "), pmt);
4015 /* Old (negative) increment, and not final */
4016 else if (last_inc < 0)
4018 sprintf(buf, _("%s [-$%ld] ", "%s [-%ld] "), pmt, (long)(ABS(last_inc)));
4021 /* Old (positive) increment, and not final */
4022 else if (last_inc > 0)
4024 sprintf(buf, _("%s [+$%ld] ", "%s [+%ld] "), pmt, (long)(ABS(last_inc)));
4030 sprintf(buf, "%s ", pmt);
4034 /* Ask until done */
4039 /* Display prompt */
4043 strcpy(out_val, "");
4046 * Ask the user for a response.
4047 * Don't allow to use numpad as cursor key.
4049 res = askfor_aux(out_val, 32, FALSE);
4055 if (!res) return FALSE;
4057 /* Skip leading spaces */
4058 for (p = out_val; *p == ' '; p++) /* loop */;
4060 /* Empty response */
4063 /* Accept current price */
4071 /* Use previous increment */
4072 if (allow_inc && last_inc)
4074 *poffer += last_inc;
4079 /* Normal response */
4082 /* Extract a number */
4085 /* Handle "incremental" number */
4086 if ((*p == '+' || *p == '-'))
4088 /* Allow increments */
4091 /* Use the given "increment" */
4098 /* Handle normal number */
4101 /* Use the given "number" */
4109 msg_print(_("値がおかしいです。", "Invalid response."));
4119 * @brief 店主がプレイヤーからの交渉価格を判断する /
4120 * Receive an offer (from the player)
4122 * @param poffer 店主からの交渉価格を返す参照ポインタ
4123 * @param last_offer 現在の交渉価格
4124 * @param factor 店主の価格基準倍率
4125 * @param price アイテムの実価値
4126 * @param final 最終価格確定ならばTRUE
4127 * @return プレイヤーの価格に対して不服ならばTRUEを返す /
4128 * Return TRUE if offer is NOT okay
4130 static bool receive_offer(concptr pmt, s32b *poffer,
4131 s32b last_offer, int factor,
4132 PRICE price, int final)
4134 /* Haggle till done */
4137 /* Get a haggle (or cancel) */
4138 if (!get_haggle(pmt, poffer, price, final)) return (TRUE);
4140 /* Acceptable offer */
4141 if (((*poffer) * factor) >= (last_offer * factor)) break;
4143 /* Insult, and check for kicked out */
4144 if (haggle_insults()) return (TRUE);
4146 /* Reject offer (correctly) */
4147 (*poffer) = last_offer;
4156 * @brief プレイヤーが購入する時の値切り処理メインルーチン /
4157 * Haggling routine -RAK-
4158 * @param o_ptr オブジェクトの構造体参照ポインタ
4159 * @param price 最終価格を返す参照ポインタ
4160 * @return プレイヤーの価格に対して店主が不服ならばTRUEを返す /
4161 * Return TRUE if purchase is NOT successful
4163 static bool purchase_haggle(object_type *o_ptr, s32b *price)
4165 s32b cur_ask, final_ask;
4166 s32b last_offer, offer;
4168 s32b min_per, max_per;
4169 int flag, loop_flag, noneed;
4170 int annoyed = 0, final = FALSE;
4171 bool cancel = FALSE;
4175 concptr pmt = _("提示価格", "Asking");
4177 /* Extract the starting offer and the final offer */
4178 cur_ask = price_item(o_ptr, ot_ptr->max_inflate, FALSE);
4179 final_ask = price_item(o_ptr, ot_ptr->min_inflate, FALSE);
4181 /* Determine if haggling is necessary */
4182 noneed = noneedtobargain(final_ask);
4184 /* No need to haggle */
4185 if (noneed || !manual_haggle)
4187 /* No need to haggle */
4190 /* Message summary */
4191 msg_print(_("結局この金額にまとまった。", "You eventually agree upon the price."));
4195 /* No haggle option */
4198 /* Message summary */
4199 msg_print(_("すんなりとこの金額にまとまった。", "You quickly agree upon the price."));
4202 /* Apply Sales Tax */
4203 final_ask += final_ask / 10;
4207 cur_ask = final_ask;
4209 /* Go to final offer */
4210 pmt = _("最終提示価格", "Final Offer");
4215 /* Haggle for the whole pile */
4216 cur_ask *= o_ptr->number;
4217 final_ask *= o_ptr->number;
4220 /* Haggle parameters */
4221 min_per = ot_ptr->haggle_per;
4222 max_per = min_per * 3;
4224 /* Mega-Hack -- artificial "last offer" value */
4225 last_offer = object_value(o_ptr) * o_ptr->number;
4226 last_offer = last_offer * (200 - (int)(ot_ptr->max_inflate)) / 100L;
4227 if (last_offer <= 0) last_offer = 1;
4232 /* No incremental haggling yet */
4235 /* Haggle until done */
4236 for (flag = FALSE; !flag; )
4240 while (!flag && loop_flag)
4242 (void)sprintf(out_val, "%s : %ld", pmt, (long)cur_ask);
4243 put_str(out_val, 1, 0);
4244 cancel = receive_offer(_("提示する金額? ", "What do you offer? "), &offer, last_offer, 1, cur_ask, final);
4249 else if (offer > cur_ask)
4254 else if (offer == cur_ask)
4267 x1 = 100 * (offer - last_offer) / (cur_ask - last_offer);
4270 if (haggle_insults())
4276 else if (x1 > max_per)
4279 if (x1 < max_per) x1 = max_per;
4281 x2 = rand_range(x1-2, x1+2);
4282 x3 = ((cur_ask - offer) * x2 / 100L) + 1;
4283 /* don't let the price go up */
4288 if (cur_ask < final_ask)
4291 cur_ask = final_ask;
4292 pmt = _("最終提示価格", "What do you offer? ");
4296 (void)(increase_insults());
4301 else if (offer >= cur_ask)
4312 (void)sprintf(out_val, _("前回の提示金額: $%ld", "Your last offer: %ld"), (long)last_offer);
4313 put_str(out_val, 1, 39);
4314 say_comment_2(cur_ask, annoyed);
4319 if (cancel) return (TRUE);
4321 updatebargain(*price, final_ask, o_ptr->number);
4329 * @brief プレイヤーが売却する時の値切り処理メインルーチン /
4330 * Haggling routine -RAK-
4331 * @param o_ptr オブジェクトの構造体参照ポインタ
4332 * @param price 最終価格を返す参照ポインタ
4333 * @return プレイヤーの価格に対して店主が不服ならばTRUEを返す /
4334 * Return TRUE if purchase is NOT successful
4336 static bool sell_haggle(object_type *o_ptr, s32b *price)
4338 s32b purse, cur_ask, final_ask;
4339 s32b last_offer = 0, offer = 0;
4341 s32b min_per, max_per;
4342 int flag, loop_flag, noneed;
4343 int annoyed = 0, final = FALSE;
4344 bool cancel = FALSE;
4345 concptr pmt = _("提示金額", "Offer");
4351 /* Obtain the starting offer and the final offer */
4352 cur_ask = price_item(o_ptr, ot_ptr->max_inflate, TRUE);
4353 final_ask = price_item(o_ptr, ot_ptr->min_inflate, TRUE);
4355 /* Determine if haggling is necessary */
4356 noneed = noneedtobargain(final_ask);
4358 /* Get the owner's payout limit */
4359 purse = (s32b)(ot_ptr->max_cost);
4361 /* No need to haggle */
4362 if (noneed || !manual_haggle || (final_ask >= purse))
4364 /* Apply Sales Tax (if needed) */
4365 if (!manual_haggle && !noneed)
4367 final_ask -= final_ask / 10;
4370 /* No reason to haggle */
4371 if (final_ask >= purse)
4373 msg_print(_("即座にこの金額にまとまった。", "You instantly agree upon the price."));
4376 /* Offer full purse */
4380 /* No need to haggle */
4383 msg_print(_("結局この金額にまとまった。", "You eventually agree upon the price."));
4387 /* No haggle option */
4390 /* Message summary */
4391 msg_print(_("すんなりとこの金額にまとまった。", "You quickly agree upon the price."));
4396 cur_ask = final_ask;
4400 pmt = _("最終提示金額", "Final Offer");
4403 /* Haggle for the whole pile */
4404 cur_ask *= o_ptr->number;
4405 final_ask *= o_ptr->number;
4408 /* Display commands */
4410 /* Haggling parameters */
4411 min_per = ot_ptr->haggle_per;
4412 max_per = min_per * 3;
4414 /* Mega-Hack -- artificial "last offer" value */
4415 last_offer = object_value(o_ptr) * o_ptr->number;
4416 last_offer = last_offer * ot_ptr->max_inflate / 100L;
4421 /* No incremental haggling yet */
4425 for (flag = FALSE; !flag; )
4431 (void)sprintf(out_val, "%s : %ld", pmt, (long)cur_ask);
4432 put_str(out_val, 1, 0);
4433 cancel = receive_offer(_("提示する価格? ", "What price do you ask? "),
4434 &offer, last_offer, -1, cur_ask, final);
4440 else if (offer < cur_ask)
4443 /* rejected, reset offer for incremental haggling */
4446 else if (offer == cur_ask)
4457 if (flag || !loop_flag) break;
4462 x1 = 100 * (last_offer - offer) / (last_offer - cur_ask);
4465 if (haggle_insults())
4471 else if (x1 > max_per)
4474 if (x1 < max_per) x1 = max_per;
4476 x2 = rand_range(x1-2, x1+2);
4477 x3 = ((offer - cur_ask) * x2 / 100L) + 1;
4478 /* don't let the price go down */
4482 if (cur_ask > final_ask)
4484 cur_ask = final_ask;
4486 pmt = _("最終提示金額", "Final Offer");
4493 /* 追加 $0 で買い取られてしまうのを防止 By FIRST*/
4496 (void)(increase_insults());
4499 else if (offer <= cur_ask)
4510 (void)sprintf(out_val,
4511 _("前回の提示価格 $%ld", "Your last bid %ld"), (long)last_offer);
4512 put_str(out_val, 1, 39);
4513 say_comment_3(cur_ask, annoyed);
4518 if (cancel) return (TRUE);
4520 updatebargain(*price, final_ask, o_ptr->number);
4528 * @brief 店からの購入処理のメインルーチン /
4529 * Buy an item from a store -RAK-
4532 static void store_purchase(void)
4535 COMMAND_CODE item, item_new;
4546 GAME_TEXT o_name[MAX_NLEN];
4550 if (cur_store_num == STORE_MUSEUM)
4552 msg_print(_("博物館から取り出すことはできません。", "Museum."));
4557 if (st_ptr->stock_num <= 0)
4559 if (cur_store_num == STORE_HOME)
4560 msg_print(_("我が家には何も置いてありません。", "Your home is empty."));
4562 msg_print(_("現在商品の在庫を切らしています。", "I am currently out of stock."));
4566 /* Find the number of objects on this and following pages */
4567 i = (st_ptr->stock_num - store_top);
4569 /* And then restrict it to the current page */
4570 if (i > store_bottom) i = store_bottom;
4574 /* ブラックマーケットの時は別のメッセージ */
4575 switch( cur_store_num ) {
4577 sprintf(out_val, "どのアイテムを取りますか? ");
4580 sprintf(out_val, "どれ? ");
4583 sprintf(out_val, "どの品物が欲しいんだい? ");
4587 if (cur_store_num == STORE_HOME)
4589 sprintf(out_val, "Which item do you want to take? ");
4593 sprintf(out_val, "Which item are you interested in? ");
4598 /* Get the item number to be bought */
4599 if (!get_stock(&item, out_val, 0, i - 1)) return;
4601 /* Get the actual index */
4602 item = item + store_top;
4604 /* Get the actual item */
4605 o_ptr = &st_ptr->stock[item];
4607 /* Assume the player wants just one of them */
4611 /* Get a copy of the object */
4612 object_copy(j_ptr, o_ptr);
4615 * If a rod or wand, allocate total maximum timeouts or charges
4616 * between those purchased and left on the shelf.
4618 reduce_charges(j_ptr, o_ptr->number - amt);
4620 /* Modify quantity */
4621 j_ptr->number = amt;
4623 /* Hack -- require room in pack */
4624 if (!inven_carry_okay(j_ptr))
4626 msg_print(_("そんなにアイテムを持てない。", "You cannot carry that many different items."));
4630 /* Determine the "best" price (per item) */
4631 best = price_item(j_ptr, ot_ptr->min_inflate, FALSE);
4633 /* Find out how many the player wants */
4634 if (o_ptr->number > 1)
4636 /* Hack -- note cost of "fixed" items */
4637 if ((cur_store_num != STORE_HOME) &&
4638 (o_ptr->ident & IDENT_FIXED))
4640 msg_format(_("一つにつき $%ldです。", "That costs %ld gold per item."), (long)(best));
4642 amt = get_quantity(NULL, o_ptr->number);
4643 if (amt <= 0) return;
4647 /* Get desired object */
4648 object_copy(j_ptr, o_ptr);
4651 * If a rod or wand, allocate total maximum timeouts or charges
4652 * between those purchased and left on the shelf.
4654 reduce_charges(j_ptr, o_ptr->number - amt);
4656 /* Modify quantity */
4657 j_ptr->number = amt;
4659 /* Hack -- require room in pack */
4660 if (!inven_carry_okay(j_ptr))
4662 msg_print(_("ザックにそのアイテムを入れる隙間がない。", "You cannot carry that many items."));
4666 /* Attempt to buy it */
4667 if (cur_store_num != STORE_HOME)
4669 /* Fixed price, quick buy */
4670 if (o_ptr->ident & (IDENT_FIXED))
4675 /* Go directly to the "best" deal */
4676 price = (best * j_ptr->number);
4682 /* Describe the object (fully) */
4683 object_desc(o_name, j_ptr, 0);
4684 msg_format(_("%s(%c)を購入する。", "Buying %s (%c)."), o_name, I2A(item));
4687 /* Haggle for a final price */
4688 choice = purchase_haggle(j_ptr, &price);
4690 /* Hack -- Got kicked out */
4691 if (st_ptr->store_open >= current_world_ptr->game_turn) return;
4694 /* Player wants it */
4697 /* Fix the item price (if "correctly" haggled) */
4698 if (price == (best * j_ptr->number)) o_ptr->ident |= (IDENT_FIXED);
4700 /* Player can afford it */
4701 if (p_ptr->au >= price)
4706 if (cur_store_num == STORE_BLACK) /* The black market is illegal! */
4707 chg_virtue(V_JUSTICE, -1);
4708 if((o_ptr->tval == TV_BOTTLE) && (cur_store_num != STORE_HOME))
4709 chg_virtue(V_NATURE, -1);
4717 /* Spend the money */
4720 /* Update the display */
4723 /* Hack -- buying an item makes you aware of it */
4724 object_aware(j_ptr);
4726 /* Hack -- clear the "fixed" flag from the item */
4727 j_ptr->ident &= ~(IDENT_FIXED);
4729 /* Describe the transaction */
4730 object_desc(o_name, j_ptr, 0);
4732 msg_format(_("%sを $%ldで購入しました。", "You bought %s for %ld gold."), o_name, (long)price);
4734 strcpy(record_o_name, o_name);
4735 record_turn = current_world_ptr->game_turn;
4737 if (record_buy) do_cmd_write_nikki(NIKKI_BUY, 0, o_name);
4738 object_desc(o_name, o_ptr, OD_NAME_ONLY);
4739 if(record_rand_art && o_ptr->art_name)
4740 do_cmd_write_nikki(NIKKI_ART, 0, o_name);
4742 /* Erase the inscription */
4743 j_ptr->inscription = 0;
4745 /* Erase the "feeling" */
4746 j_ptr->feeling = FEEL_NONE;
4747 j_ptr->ident &= ~(IDENT_STORE);
4748 /* Give it to the player */
4749 item_new = inven_carry(j_ptr);
4751 /* Describe the final result */
4752 object_desc(o_name, &p_ptr->inventory_list[item_new], 0);
4753 msg_format(_("%s(%c)を手に入れた。", "You have %s (%c)."), o_name, index_to_label(item_new));
4755 /* Auto-inscription */
4756 autopick_alter_item(item_new, FALSE);
4758 /* Now, reduce the original stack's pval. */
4759 if ((o_ptr->tval == TV_ROD) || (o_ptr->tval == TV_WAND))
4761 o_ptr->pval -= j_ptr->pval;
4765 /* Note how many slots the store used to have */
4766 i = st_ptr->stock_num;
4768 /* Remove the bought items from the store */
4769 store_item_increase(item, -amt);
4770 store_item_optimize(item);
4772 /* Store is empty */
4773 if (st_ptr->stock_num == 0)
4776 if (one_in_(STORE_SHUFFLE))
4779 msg_print(_("店主は引退した。", "The shopkeeper retires."));
4781 /* Shuffle the store */
4782 store_shuffle(cur_store_num);
4785 sprintf(buf, "%s (%s)",
4786 ot_ptr->owner_name, race_info[ot_ptr->owner_race].title);
4787 put_str(buf, 3, 10);
4788 sprintf(buf, "%s (%ld)",
4789 (f_name + f_info[cur_store_feat].name), (long)(ot_ptr->max_cost));
4796 msg_print(_("店主は新たな在庫を取り出した。", "The shopkeeper brings out some new stock."));
4799 /* New p_ptr->inventory_list */
4800 for (i = 0; i < 10; i++)
4802 /* Maintain the store */
4803 store_maint(p_ptr->town_num, cur_store_num);
4808 display_inventory();
4811 /* The item is gone */
4812 else if (st_ptr->stock_num != i)
4814 /* Pick the correct screen */
4815 if (store_top >= st_ptr->stock_num) store_top -= store_bottom;
4816 display_inventory();
4819 /* Item is still here */
4822 /* Redraw the item */
4823 display_entry(item);
4827 /* Player cannot afford it */
4830 /* Simple message (no insult) */
4831 msg_print(_("お金が足りません。", "You do not have enough gold."));
4836 /* Home is much easier */
4839 bool combined_or_reordered;
4841 /* Distribute charges of wands/rods */
4842 distribute_charges(o_ptr, j_ptr, amt);
4844 /* Give it to the player */
4845 item_new = inven_carry(j_ptr);
4847 /* Describe just the result */
4848 object_desc(o_name, &p_ptr->inventory_list[item_new], 0);
4850 msg_format(_("%s(%c)を取った。", "You have %s (%c)."), o_name, index_to_label(item_new));
4853 /* Take note if we take the last one */
4854 i = st_ptr->stock_num;
4856 /* Remove the items from the home */
4857 store_item_increase(item, -amt);
4858 store_item_optimize(item);
4860 combined_or_reordered = combine_and_reorder_home(STORE_HOME);
4862 /* Hack -- Item is still here */
4863 if (i == st_ptr->stock_num)
4865 if (combined_or_reordered) display_inventory();
4867 /* Redraw the item */
4868 else display_entry(item);
4871 /* The item is gone */
4875 if (st_ptr->stock_num == 0) store_top = 0;
4877 /* Nothing left on that screen */
4878 else if (store_top >= st_ptr->stock_num) store_top -= store_bottom;
4879 display_inventory();
4881 chg_virtue(V_SACRIFICE, 1);
4885 /* Not kicked out */
4891 * @brief 店からの売却処理のメインルーチン /
4892 * Sell an item to the store (or home)
4895 static void store_sell(void)
4902 PRICE price, value, dummy;
4910 GAME_TEXT o_name[MAX_NLEN];
4913 /* Prepare a prompt */
4914 if (cur_store_num == STORE_HOME)
4915 q = _("どのアイテムを置きますか? ", "Drop which item? ");
4917 else if (cur_store_num == STORE_MUSEUM)
4918 q = _("どのアイテムを寄贈しますか? ", "Give which item? ");
4921 q = _("どのアイテムを売りますか? ", "Sell which item? ");
4923 /* Only allow items the store will buy */
4924 item_tester_hook = store_will_buy;
4926 /* 我が家でおかしなメッセージが出るオリジナルのバグを修正 */
4927 if (cur_store_num == STORE_HOME)
4929 s = _("置けるアイテムを持っていません。", "You don't have any item to drop.");
4931 else if (cur_store_num == STORE_MUSEUM)
4933 s = _("寄贈できるアイテムを持っていません。", "You don't have any item to give.");
4937 s = _("欲しい物がないですねえ。", "You have nothing that I want.");
4940 o_ptr = choose_object(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT));
4943 /* Hack -- Cannot remove cursed items */
4944 if ((item >= INVEN_RARM) && object_is_cursed(o_ptr))
4946 msg_print(_("ふーむ、どうやらそれは呪われているようだね。", "Hmmm, it seems to be cursed."));
4950 /* Assume one item */
4953 if (o_ptr->number > 1)
4955 amt = get_quantity(NULL, o_ptr->number);
4956 if (amt <= 0) return;
4960 /* Get a copy of the object */
4961 object_copy(q_ptr, o_ptr);
4963 /* Modify quantity */
4964 q_ptr->number = amt;
4967 * Hack -- If a rod or wand, allocate total maximum
4968 * timeouts or charges to those being sold. -LM-
4970 if ((o_ptr->tval == TV_ROD) || (o_ptr->tval == TV_WAND))
4972 q_ptr->pval = o_ptr->pval * amt / o_ptr->number;
4975 /* Get a full description */
4976 object_desc(o_name, q_ptr, 0);
4978 /* Remove any inscription, feeling for stores */
4979 if ((cur_store_num != STORE_HOME) && (cur_store_num != STORE_MUSEUM))
4981 q_ptr->inscription = 0;
4982 q_ptr->feeling = FEEL_NONE;
4985 /* Is there room in the store (or the home?) */
4986 if (!store_check_num(q_ptr))
4988 if (cur_store_num == STORE_HOME)
4989 msg_print(_("我が家にはもう置く場所がない。", "Your home is full."));
4991 else if (cur_store_num == STORE_MUSEUM)
4992 msg_print(_("博物館はもう満杯だ。", "Museum is full."));
4995 msg_print(_("すいませんが、店にはもう置く場所がありません。", "I have not the room in my store to keep it."));
5002 if ((cur_store_num != STORE_HOME) && (cur_store_num != STORE_MUSEUM))
5004 /* Describe the transaction */
5005 msg_format(_("%s(%c)を売却する。", "Selling %s (%c)."), o_name, index_to_label(item));
5010 choice = sell_haggle(q_ptr, &price);
5013 if (st_ptr->store_open >= current_world_ptr->game_turn) return;
5025 if (cur_store_num == STORE_BLACK) /* The black market is illegal! */
5026 chg_virtue(V_JUSTICE, -1);
5028 if((o_ptr->tval == TV_BOTTLE) && (cur_store_num != STORE_HOME))
5029 chg_virtue(V_NATURE, 1);
5032 /* Get some money */
5035 /* Update the display */
5038 /* Get the "apparent" value */
5039 dummy = object_value(q_ptr) * q_ptr->number;
5041 identify_item(o_ptr);
5044 /* Get a copy of the object */
5045 object_copy(q_ptr, o_ptr);
5047 /* Modify quantity */
5048 q_ptr->number = amt;
5050 /* Make it look like to be known */
5051 q_ptr->ident |= IDENT_STORE;
5054 * Hack -- If a rod or wand, let the shopkeeper know just
5055 * how many charges he really paid for. -LM-
5057 if ((o_ptr->tval == TV_ROD) || (o_ptr->tval == TV_WAND))
5059 q_ptr->pval = o_ptr->pval * amt / o_ptr->number;
5062 /* Get the "actual" value */
5063 value = object_value(q_ptr) * q_ptr->number;
5065 /* Get the description all over again */
5066 object_desc(o_name, q_ptr, 0);
5068 /* Describe the result (in message buffer) */
5069 msg_format(_("%sを $%ldで売却しました。", "You sold %s for %ld gold."), o_name, (long)price);
5071 if (record_sell) do_cmd_write_nikki(NIKKI_SELL, 0, o_name);
5073 if (!((o_ptr->tval == TV_FIGURINE) && (value > 0)))
5075 /* Analyze the prices (and comment verbally) unless a figurine*/
5076 purchase_analyze(price, value, dummy);
5080 * Hack -- Allocate charges between those wands or rods sold
5081 * and retained, unless all are being sold. -LM-
5083 distribute_charges(o_ptr, q_ptr, amt);
5085 /* Reset timeouts of the sold items */
5088 /* Take the item from the player, describe the result */
5089 inven_item_increase(item, -amt);
5090 inven_item_describe(item);
5092 /* If items remain, auto-inscribe before optimizing */
5093 if (o_ptr->number > 0)
5094 autopick_alter_item(item, FALSE);
5096 inven_item_optimize(item);
5099 /* The store gets that (known) item */
5100 item_pos = store_carry(q_ptr);
5102 /* Re-display if item is now in store */
5105 store_top = (item_pos / store_bottom) * store_bottom;
5106 display_inventory();
5111 /* Player is at museum */
5112 else if (cur_store_num == STORE_MUSEUM)
5114 char o2_name[MAX_NLEN];
5115 object_desc(o2_name, q_ptr, OD_NAME_ONLY);
5117 if (-1 == store_check_num(q_ptr))
5119 msg_print(_("それと同じ品物は既に博物館にあるようです。", "The same object as it is already in the Museum."));
5123 msg_print(_("博物館に寄贈したものは取り出すことができません!!", "You cannot take items which is given to the Museum back!!"));
5126 if (!get_check(format(_("本当に%sを寄贈しますか?", "Really give %s to the Museum? "), o2_name))) return;
5128 identify_item(q_ptr);
5129 q_ptr->ident |= IDENT_MENTAL;
5131 /* Distribute charges of wands/rods */
5132 distribute_charges(o_ptr, q_ptr, amt);
5133 msg_format(_("%sを置いた。(%c)", "You drop %s (%c)."), o_name, index_to_label(item));
5136 /* Take it from the players p_ptr->inventory_list */
5137 inven_item_increase(item, -amt);
5138 inven_item_describe(item);
5139 inven_item_optimize(item);
5142 /* Let the home carry it */
5143 item_pos = home_carry(q_ptr);
5145 /* Update store display */
5148 store_top = (item_pos / store_bottom) * store_bottom;
5149 display_inventory();
5152 /* Player is at home */
5155 /* Distribute charges of wands/rods */
5156 distribute_charges(o_ptr, q_ptr, amt);
5157 msg_format(_("%sを置いた。(%c)", "You drop %s (%c)."), o_name, index_to_label(item));
5161 /* Take it from the players p_ptr->inventory_list */
5162 inven_item_increase(item, -amt);
5163 inven_item_describe(item);
5164 inven_item_optimize(item);
5167 /* Let the home carry it */
5168 item_pos = home_carry(q_ptr);
5170 /* Update store display */
5173 store_top = (item_pos / store_bottom) * store_bottom;
5174 display_inventory();
5178 if ((choice == 0) && (item >= INVEN_RARM))
5187 * @brief 店のアイテムを調べるコマンドのメインルーチン /
5188 * Examine an item in a store -JDL-
5191 static void store_examine(void)
5196 GAME_TEXT o_name[MAX_NLEN];
5200 if (st_ptr->stock_num <= 0)
5202 if (cur_store_num == STORE_HOME)
5203 msg_print(_("我が家には何も置いてありません。", "Your home is empty."));
5204 else if (cur_store_num == STORE_MUSEUM)
5205 msg_print(_("博物館には何も置いてありません。", "Museum is empty."));
5207 msg_print(_("現在商品の在庫を切らしています。", "I am currently out of stock."));
5211 /* Find the number of objects on this and following pages */
5212 i = (st_ptr->stock_num - store_top);
5214 /* And then restrict it to the current page */
5215 if (i > store_bottom) i = store_bottom;
5218 sprintf(out_val, _("どれを調べますか?", "Which item do you want to examine? "));
5220 /* Get the item number to be examined */
5221 if (!get_stock(&item, out_val, 0, i - 1)) return;
5223 /* Get the actual index */
5224 item = item + store_top;
5226 /* Get the actual item */
5227 o_ptr = &st_ptr->stock[item];
5229 /* Require full knowledge */
5230 if (!(o_ptr->ident & IDENT_MENTAL))
5232 /* This can only happen in the home */
5233 msg_print(_("このアイテムについて特に知っていることはない。", "You have no special knowledge about that item."));
5237 object_desc(o_name, o_ptr, 0);
5238 msg_format(_("%sを調べている...", "Examining %s..."), o_name);
5240 if (!screen_object(o_ptr, SCROBJ_FORCE_DETAIL))
5241 msg_print(_("特に変わったところはないようだ。", "You see nothing special."));
5248 * @brief 博物館のアイテムを除去するコマンドのメインルーチン /
5249 * Remove an item from museum (Originally from TOband)
5252 static void museum_remove_object(void)
5257 GAME_TEXT o_name[MAX_NLEN];
5261 if (st_ptr->stock_num <= 0)
5263 msg_print(_("博物館には何も置いてありません。", "Museum is empty."));
5267 /* Find the number of objects on this and following pages */
5268 i = st_ptr->stock_num - store_top;
5270 /* And then restrict it to the current page */
5271 if (i > store_bottom) i = store_bottom;
5274 sprintf(out_val, _("どのアイテムの展示をやめさせますか?", "Which item do you want to order to remove? "));
5276 /* Get the item number to be removed */
5277 if (!get_stock(&item, out_val, 0, i - 1)) return;
5279 /* Get the actual index */
5280 item = item + store_top;
5282 /* Get the actual item */
5283 o_ptr = &st_ptr->stock[item];
5285 object_desc(o_name, o_ptr, 0);
5287 msg_print(_("展示をやめさせたアイテムは二度と見ることはできません!", "You cannot see items which is removed from the Museum!"));
5288 if (!get_check(format(_("本当に%sの展示をやめさせますか?", "Really order to remove %s from the Museum? "), o_name))) return;
5290 msg_format(_("%sの展示をやめさせた。", "You ordered to remove %s."), o_name);
5292 /* Remove the items from the home */
5293 store_item_increase(item, -o_ptr->number);
5294 store_item_optimize(item);
5296 (void)combine_and_reorder_home(STORE_MUSEUM);
5298 /* The item is gone */
5301 if (st_ptr->stock_num == 0) store_top = 0;
5303 /* Nothing left on that screen */
5304 else if (store_top >= st_ptr->stock_num) store_top -= store_bottom;
5305 display_inventory();
5312 * Hack -- set this to leave the store
5314 static bool leave_store = FALSE;
5318 * @brief 店舗処理コマンド選択のメインルーチン /
5319 * Process a command in a store
5323 * Note that we must allow the use of a few "special" commands
5324 * in the stores which are not allowed in the dungeon, and we
5325 * must disable some commands which are allowed in the dungeon
5326 * but not in the stores, to prevent chaos.
5329 static void store_process_command(void)
5331 /* Handle repeating the last command */
5334 if (rogue_like_commands && command_cmd == 'l')
5336 command_cmd = 'x'; /* hack! */
5339 /* Parse the command */
5340 switch (command_cmd)
5350 /* 1 ページ戻るコマンド: 我が家のページ数が多いので重宝するはず By BUG */
5353 if (st_ptr->stock_num <= store_bottom) {
5354 msg_print(_("これで全部です。", "Entire p_ptr->inventory_list is shown."));
5357 store_top -= store_bottom;
5358 if ( store_top < 0 )
5359 store_top = ((st_ptr->stock_num - 1 )/store_bottom) * store_bottom;
5360 if ( (cur_store_num == STORE_HOME) && (powerup_home == FALSE) )
5361 if ( store_top >= store_bottom ) store_top = store_bottom;
5362 display_inventory();
5370 if (st_ptr->stock_num <= store_bottom)
5372 msg_print(_("これで全部です。", "Entire p_ptr->inventory_list is shown."));
5376 store_top += store_bottom;
5378 * 隠しオプション(powerup_home)がセットされていないときは
5379 * 我が家では 2 ページまでしか表示しない
5381 if ((cur_store_num == STORE_HOME) &&
5382 (powerup_home == FALSE) &&
5383 (st_ptr->stock_num >= STORE_INVEN_MAX))
5385 if (store_top >= (STORE_INVEN_MAX - 1))
5392 if (store_top >= st_ptr->stock_num) store_top = 0;
5395 display_inventory();
5407 /* Get (purchase) */
5434 /*** Inventory Commands ***/
5436 /* Wear/wield equipment */
5443 /* Take off equipment */
5450 /* Destroy an item */
5457 /* Equipment list */
5464 /* Inventory list */
5472 /*** Various commands ***/
5474 /* Identify an object */
5481 /* Hack -- toggle windows */
5484 toggle_inven_equip();
5488 /*** Use various objects ***/
5493 if ( (p_ptr->pclass == CLASS_MINDCRAFTER) ||
5494 (p_ptr->pclass == CLASS_BERSERKER) ||
5495 (p_ptr->pclass == CLASS_NINJA) ||
5496 (p_ptr->pclass == CLASS_MIRROR_MASTER)
5497 ) do_cmd_mind_browse();
5498 else if (p_ptr->pclass == CLASS_SMITH)
5500 else if (p_ptr->pclass == CLASS_MAGIC_EATER)
5501 do_cmd_magic_eater(TRUE, FALSE);
5502 else if (p_ptr->pclass == CLASS_SNIPER)
5503 do_cmd_snipe_browse();
5504 else do_cmd_browse();
5508 /* Inscribe an object */
5515 /* Uninscribe an object */
5518 do_cmd_uninscribe();
5524 /*** Help and Such ***/
5533 /* Identify symbol */
5536 do_cmd_query_symbol();
5540 /* Character description */
5543 p_ptr->town_num = old_town_num;
5544 do_cmd_change_name();
5545 p_ptr->town_num = inner_town_num;
5551 /*** System Commands ***/
5553 /* Hack -- User interface */
5560 /* Single line from a pref file */
5563 p_ptr->town_num = old_town_num;
5565 p_ptr->town_num = inner_town_num;
5569 /* Interact with macros */
5572 p_ptr->town_num = old_town_num;
5574 p_ptr->town_num = inner_town_num;
5578 /* Interact with visuals */
5581 p_ptr->town_num = old_town_num;
5583 p_ptr->town_num = inner_town_num;
5587 /* Interact with colors */
5590 p_ptr->town_num = old_town_num;
5592 p_ptr->town_num = inner_town_num;
5596 /* Interact with options */
5600 (void)combine_and_reorder_home(STORE_HOME);
5606 /*** Misc Commands ***/
5622 /* Repeat level feeling */
5629 /* Show previous message */
5632 do_cmd_message_one();
5636 /* Show previous messages */
5649 /* Check artifacts, uniques etc. */
5656 /* Load "screen dump" */
5659 do_cmd_load_screen();
5663 /* Save "screen dump" */
5666 do_cmd_save_screen();
5670 /* Hack -- Unknown command */
5673 if ((cur_store_num == STORE_MUSEUM) && (command_cmd == 'r'))
5675 museum_remove_object();
5679 msg_print(_("そのコマンドは店の中では使えません。", "That command does not work in stores."));
5688 * @brief 店舗処理全体のメインルーチン /
5689 * Enter a store, and interact with it. *
5693 * Note that we use the standard "request_command()" function
5694 * to get a command, allowing us to use "command_arg" and all
5695 * command macros and other nifty stuff, but we use the special
5696 * "shopping" argument, to force certain commands to be converted
5697 * into other commands, normally, we convert "p" (pray) and "m"
5698 * (cast magic) into "g" (get), and "s" (search) into "d" (drop).
5701 void do_cmd_store(void)
5707 bool need_redraw_store_inv; /* To redraw missiles damage and prices in store */
5710 if(p_ptr->wild_mode) return;
5711 Term_get_size(&w, &h);
5713 /* Calculate stocks per 1 page */
5714 xtra_stock = MIN(14+26, ((h > 24) ? (h - 24) : 0));
5715 store_bottom = MIN_STOCK + xtra_stock;
5717 /* Access the player grid */
5718 g_ptr = ¤t_floor_ptr->grid_array[p_ptr->y][p_ptr->x];
5720 /* Verify a store */
5721 if (!cave_have_flag_grid(g_ptr, FF_STORE))
5723 msg_print(_("ここには店がありません。", "You see no store here."));
5727 /* Extract the store code */
5728 which = f_info[g_ptr->feat].subtype;
5730 old_town_num = p_ptr->town_num;
5731 if ((which == STORE_HOME) || (which == STORE_MUSEUM)) p_ptr->town_num = 1;
5732 if (current_floor_ptr->dun_level) p_ptr->town_num = NO_TOWN;
5733 inner_town_num = p_ptr->town_num;
5735 /* Hack -- Check the "locked doors" */
5736 if ((town_info[p_ptr->town_num].store[which].store_open >= current_world_ptr->game_turn) ||
5739 msg_print(_("ドアに鍵がかかっている。", "The doors are locked."));
5740 p_ptr->town_num = old_town_num;
5744 /* Calculate the number of store maintainances since the last visit */
5745 maintain_num = (current_world_ptr->game_turn - town_info[p_ptr->town_num].store[which].last_visit) / (TURNS_PER_TICK * STORE_TICKS);
5747 /* Maintain the store max. 10 times */
5748 if (maintain_num > 10) maintain_num = 10;
5752 /* Maintain the store */
5753 for (i = 0; i < maintain_num; i++)
5754 store_maint(p_ptr->town_num, which);
5756 /* Save the visit */
5757 town_info[p_ptr->town_num].store[which].last_visit = current_world_ptr->game_turn;
5763 /* Hack -- Character is in "icky" mode */
5764 character_icky = TRUE;
5771 /* Do not expand macros */
5772 get_com_no_macros = TRUE;
5774 /* Save the store number */
5775 cur_store_num = which;
5777 /* Hack -- save the store feature */
5778 cur_store_feat = g_ptr->feat;
5780 /* Save the store and owner pointers */
5781 st_ptr = &town_info[p_ptr->town_num].store[cur_store_num];
5782 ot_ptr = &owners[cur_store_num][st_ptr->owner];
5784 /* Start at the beginning */
5787 play_music(TERM_XTRA_MUSIC_BASIC, MUSIC_BASIC_BUILD);
5792 leave_store = FALSE;
5794 /* Interact with player */
5795 while (!leave_store)
5797 /* Hack -- Clear line 1 */
5801 clear_from(20 + xtra_stock);
5803 /* Basic commands */
5804 prt(_(" ESC) 建物から出る", " ESC) Exit from Building."), 21 + xtra_stock, 0);
5806 /* Browse if necessary */
5807 if (st_ptr->stock_num > store_bottom)
5809 prt(_(" -)前ページ", " -) Previous page"), 22 + xtra_stock, 0);
5810 prt(_(" スペース) 次ページ", " SPACE) Next page"), 23 + xtra_stock, 0);
5814 if (cur_store_num == STORE_HOME)
5816 prt(_("g) アイテムを取る", "g) Get an item."), 21 + xtra_stock, 27);
5817 prt(_("d) アイテムを置く", "d) Drop an item."), 22 + xtra_stock, 27);
5818 prt(_("x) 家のアイテムを調べる", "x) eXamine an item in the home."), 23 + xtra_stock, 27);
5821 /* Museum commands */
5822 else if (cur_store_num == STORE_MUSEUM)
5824 prt(_("d) アイテムを置く", "d) Drop an item."), 21 + xtra_stock, 27);
5825 prt(_("r) アイテムの展示をやめる", "r) order to Remove an item."), 22 + xtra_stock, 27);
5826 prt(_("x) 博物館のアイテムを調べる", "x) eXamine an item in the museum."), 23 + xtra_stock, 27);
5832 prt(_("p) 商品を買う", "p) Purchase an item."), 21 + xtra_stock, 30);
5833 prt(_("s) アイテムを売る", "s) Sell an item."), 22 + xtra_stock, 30);
5834 prt(_("x) 商品を調べる", "x) eXamine an item in the shop"), 23 + xtra_stock,30);
5838 prt(_("i/e) 持ち物/装備の一覧", "i/e) Inventry/Equipment list"), 21 + xtra_stock, 56);
5840 if (rogue_like_commands)
5842 prt(_("w/T) 装備する/はずす", "w/T) Wear/Take off equipment"), 22 + xtra_stock, 56);
5846 prt(_("w/t) 装備する/はずす", "w/t) Wear/Take off equipment"), 22 + xtra_stock, 56);
5850 prt(_("コマンド:", "You may: "), 20 + xtra_stock, 0);
5852 request_command(TRUE);
5854 /* Process the command */
5855 store_process_command();
5858 * Hack -- To redraw missiles damage and prices in store
5859 * If player's charisma changes, or if player changes a bow, PU_BONUS is set
5861 need_redraw_store_inv = (p_ptr->update & PU_BONUS) ? TRUE : FALSE;
5863 /* Hack -- Character is still in "icky" mode */
5864 character_icky = TRUE;
5869 if (p_ptr->inventory_list[INVEN_PACK].k_idx)
5871 INVENTORY_IDX item = INVEN_PACK;
5873 object_type *o_ptr = &p_ptr->inventory_list[item];
5875 /* Hack -- Flee from the store */
5876 if (cur_store_num != STORE_HOME)
5878 if (cur_store_num == STORE_MUSEUM)
5879 msg_print(_("ザックからアイテムがあふれそうなので、あわてて博物館から出た...", "Your pack is so full that you flee the Museum..."));
5881 msg_print(_("ザックからアイテムがあふれそうなので、あわてて店から出た...", "Your pack is so full that you flee the store..."));
5887 /* Hack -- Flee from the home */
5888 else if (!store_check_num(o_ptr))
5890 msg_print(_("ザックからアイテムがあふれそうなので、あわてて家から出た...", "Your pack is so full that you flee your home..."));
5895 /* Hack -- Drop items into the home */
5903 GAME_TEXT o_name[MAX_NLEN];
5905 /* Give a message */
5906 msg_print(_("ザックからアイテムがあふれてしまった!", "Your pack overflows!"));
5910 object_copy(q_ptr, o_ptr);
5911 object_desc(o_name, q_ptr, 0);
5913 msg_format(_("%sが落ちた。(%c)", "You drop %s (%c)."), o_name, index_to_label(item));
5915 /* Remove it from the players p_ptr->inventory_list */
5916 inven_item_increase(item, -255);
5917 inven_item_describe(item);
5918 inven_item_optimize(item);
5921 /* Let the home carry it */
5922 item_pos = home_carry(q_ptr);
5924 /* Redraw the home */
5927 store_top = (item_pos / store_bottom) * store_bottom;
5928 display_inventory();
5933 /* Hack -- Redisplay store prices if charisma changes */
5934 /* Hack -- Redraw missiles damage if player changes bow */
5935 if (need_redraw_store_inv) display_inventory();
5937 /* Hack -- get kicked out of the store */
5938 if (st_ptr->store_open >= current_world_ptr->game_turn) leave_store = TRUE;
5941 select_floor_music();
5943 p_ptr->town_num = old_town_num;
5945 take_turn(p_ptr, 100);
5947 /* Hack -- Character is no longer in "icky" mode */
5948 character_icky = FALSE;
5950 /* Hack -- Cancel automatic command */
5953 /* Hack -- Cancel "see" mode */
5954 command_see = FALSE;
5956 /* Allow expanding macros */
5957 get_com_no_macros = FALSE;
5962 /* Update everything */
5963 p_ptr->update |= (PU_VIEW | PU_LITE | PU_MON_LITE);
5964 p_ptr->update |= (PU_MONSTERS);
5966 /* Redraw entire screen */
5967 p_ptr->redraw |= (PR_BASIC | PR_EXTRA | PR_EQUIPPY);
5968 p_ptr->redraw |= (PR_MAP);
5969 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
5975 * @brief 現在の町の店主を交代させる /
5976 * Shuffle one of the stores.
5977 * @param which 店舗種類のID
5980 void store_shuffle(int which)
5986 if (which == STORE_HOME) return;
5987 if (which == STORE_MUSEUM) return;
5990 /* Save the store index */
5991 cur_store_num = which;
5993 /* Activate that store */
5994 st_ptr = &town_info[p_ptr->town_num].store[cur_store_num];
5997 /* Pick a new owner */
6000 st_ptr->owner = (byte)randint0(MAX_OWNERS);
6001 if (j == st_ptr->owner) continue;
6002 for (i = 1;i < max_towns; i++)
6004 if (i == p_ptr->town_num) continue;
6005 if (st_ptr->owner == town_info[i].store[cur_store_num].owner) break;
6007 if (i == max_towns) break;
6010 /* Activate the new owner */
6011 ot_ptr = &owners[cur_store_num][st_ptr->owner];
6014 /* Reset the owner data */
6015 st_ptr->insult_cur = 0;
6016 st_ptr->store_open = 0;
6017 st_ptr->good_buy = 0;
6018 st_ptr->bad_buy = 0;
6021 /* Hack -- discount all the items */
6022 for (i = 0; i < st_ptr->stock_num; i++)
6026 o_ptr = &st_ptr->stock[i];
6028 if (!object_is_artifact(o_ptr))
6030 /* Hack -- Sell all non-artifact old items for "half price" */
6031 o_ptr->discount = 50;
6033 /* Hack -- Items are no longer "fixed price" */
6034 o_ptr->ident &= ~(IDENT_FIXED);
6036 /* Mega-Hack -- Note that the item is "on sale" */
6037 o_ptr->inscription = quark_add(_("売出中", "on sale"));
6044 * @brief 店の品揃えを変化させる /
6045 * Maintain the p_ptr->inventory_list at the stores.
6046 * @param town_num 町のID
6047 * @param store_num 店舗種類のID
6050 void store_maint(int town_num, int store_num)
6054 cur_store_num = store_num;
6057 if (store_num == STORE_HOME) return;
6058 if (store_num == STORE_MUSEUM) return;
6060 /* Activate that store */
6061 st_ptr = &town_info[town_num].store[store_num];
6063 /* Activate the owner */
6064 ot_ptr = &owners[store_num][st_ptr->owner];
6066 /* Store keeper forgives the player */
6067 st_ptr->insult_cur = 0;
6069 /* Mega-Hack -- prune the black market */
6070 if (store_num == STORE_BLACK)
6072 /* Destroy crappy black market items */
6073 for (j = st_ptr->stock_num - 1; j >= 0; j--)
6075 object_type *o_ptr = &st_ptr->stock[j];
6077 /* Destroy crappy items */
6078 if (black_market_crap(o_ptr))
6080 /* Destroy the item */
6081 store_item_increase(j, 0 - o_ptr->number);
6082 store_item_optimize(j);
6088 /* Choose the number of slots to keep */
6089 j = st_ptr->stock_num;
6091 /* Sell a few items */
6092 j = j - randint1(STORE_TURNOVER);
6094 /* Never keep more than "STORE_MAX_KEEP" slots */
6095 if (j > STORE_MAX_KEEP) j = STORE_MAX_KEEP;
6097 /* Always "keep" at least "STORE_MIN_KEEP" items */
6098 if (j < STORE_MIN_KEEP) j = STORE_MIN_KEEP;
6100 /* Hack -- prevent "underflow" */
6103 /* Destroy objects until only "j" slots are left */
6104 while (st_ptr->stock_num > j) store_delete();
6107 /* Choose the number of slots to fill */
6108 j = st_ptr->stock_num;
6110 /* Buy some more items */
6111 j = j + randint1(STORE_TURNOVER);
6113 /* Never keep more than "STORE_MAX_KEEP" slots */
6114 if (j > STORE_MAX_KEEP) j = STORE_MAX_KEEP;
6116 /* Always "keep" at least "STORE_MIN_KEEP" items */
6117 if (j < STORE_MIN_KEEP) j = STORE_MIN_KEEP;
6119 /* Hack -- prevent "overflow" */
6120 if (j >= st_ptr->stock_size) j = st_ptr->stock_size - 1;
6122 /* Acquire some new items */
6123 while (st_ptr->stock_num < j) store_create();
6128 * @brief 店舗情報を初期化する /
6129 * Initialize the stores
6130 * @param town_num 町のID
6131 * @param store_num 店舗種類のID
6134 void store_init(int town_num, int store_num)
6137 cur_store_num = store_num;
6139 /* Activate that store */
6140 st_ptr = &town_info[town_num].store[store_num];
6148 st_ptr->owner = (byte)randint0(MAX_OWNERS);
6149 for (i = 1;i < max_towns; i++)
6151 if (i == town_num) continue;
6152 if (st_ptr->owner == town_info[i].store[store_num].owner) break;
6154 if (i == max_towns) break;
6157 /* Activate the new owner */
6158 ot_ptr = &owners[store_num][st_ptr->owner];
6161 /* Initialize the store */
6162 st_ptr->store_open = 0;
6163 st_ptr->insult_cur = 0;
6164 st_ptr->good_buy = 0;
6165 st_ptr->bad_buy = 0;
6167 /* Nothing in stock */
6168 st_ptr->stock_num = 0;
6171 * MEGA-HACK - Last visit to store is
6172 * BEFORE player birth to enable store restocking
6174 st_ptr->last_visit = -10L * TURNS_PER_TICK * STORE_TICKS;
6176 /* Clear any old items */
6177 for (k = 0; k < st_ptr->stock_size; k++)
6179 object_wipe(&st_ptr->stock[k]);
6185 * @brief アイテムを町のブラックマーケットに移動させる /
6186 * @param o_ptr 移動させたいオブジェクトの構造体参照ポインタ
6189 void move_to_black_market(object_type *o_ptr)
6192 if (!p_ptr->town_num) return;
6194 st_ptr = &town_info[p_ptr->town_num].store[STORE_BLACK];
6196 o_ptr->ident |= IDENT_STORE;
6198 (void)store_carry(o_ptr);
6200 object_wipe(o_ptr); /* Don't leave a bogus object behind... */