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.
15 #include "cmd-smith.h"
16 #include "cmd-zapwand.h"
17 #include "cmd-magiceat.h"
20 #include "cmd-spell.h"
22 #include "player-status.h"
23 #include "object-hook.h"
28 * @brief 闘技場のモンスターID及び報酬アイテムテーブル /
29 * Store owners (exactly four "possible" owners per store, chosen randomly)
32 * { name, purse, max greed, min greed, haggle_per, tolerance, race, unused }
34 * Lifted extra shopkeepers from CthAngband (don't you just love open source
35 * development? ;-)). Since this gave less than 32 unique names for some
36 * shops, those have their first x names copied to reach 32.
38 * For the weapon and armour shops, several owners have a limit of 5k.
40 * I want to do 50k owners, but the purse is currently s16b. Perhaps
41 * we should just store 1/10th of the purse?
44 const owner_type owners[MAX_STORES][MAX_OWNERS] =
47 /* General store - 32 unique names */
49 Raistlin は dragonlance の powerful wizard 。
50 Rincewind the Chicken は Terry Pratchett の Discworld の登場人物 上記のパロディ?、
51 { "憶病者ラストリン", 200, 175, 108, 4, 12, RACE_HUMAN},
52 { "Raistlin the Chicken", 200, 175, 108, 4, 12, RACE_HUMAN},
56 { "フレンドリーなビルボ", 200, 170, 108, 5, 15, RACE_HOBBIT},
57 { "憶病者リンスウィンド", 200, 175, 108, 4, 12, RACE_HUMAN},
58 { "背の低いサルタン", 300, 170, 107, 5, 15, RACE_GNOME},
59 { "ハンサムなライア=エル", 300, 165, 107, 6, 18, RACE_ELF},
60 { "親切なファリルマウエン", 250, 170, 108, 5, 15, RACE_HOBBIT},
61 { "臆病者ヴォワラン", 500, 175, 108, 4, 12, RACE_HUMAN},
62 { "チビのエラシュナク", 750, 170, 107, 5, 15, RACE_BEASTMAN},
63 { "ハンサムなグラッグ", 1000, 165, 107, 6, 18, RACE_HALF_TITAN},
64 { "ケチなフォロビア", 250, 170, 108, 5, 15, RACE_HUMAN},
65 { "馬鹿のエリス", 500, 175, 108, 4, 12, RACE_HUMAN},
66 { "腹ペコのフィルバート", 750, 170, 107, 5, 15, RACE_VAMPIRE},
67 { "スナーグル・サシグア", 1000, 165, 107, 6, 18, RACE_MIND_FLAYER},
68 { "長死きエロワーズ", 250, 170, 108, 5, 15, RACE_SPECTRE},
69 { "ノロマのフンディ", 500, 175, 108, 4, 12, RACE_ZOMBIE},
70 { "グランサス", 750, 170, 107, 5, 15, RACE_SKELETON},
71 { "丁寧なロラックス", 1000, 165, 107, 6, 18, RACE_VAMPIRE},
72 { "ブッチ", 250, 170, 108, 5, 15, RACE_HALF_ORC},
73 { "美しきエルベレス", 500, 175, 108, 4, 12, RACE_HIGH_ELF},
74 { "こそこそサーレス", 750, 170, 107, 5, 15, RACE_GNOME},
75 { "ナーロック", 1000, 165, 107, 6, 18, RACE_DWARF},
76 { "チビのヘイネッカ", 250, 170, 108, 5, 15, RACE_GNOME},
77 { "きちがいロワラン", 500, 175, 108, 4, 12, RACE_HALF_GIANT},
78 { "毒息のウート", 750, 170, 107, 5, 15, RACE_DRACONIAN},
79 { "でぶっちょアラァカ", 1000, 165, 107, 6, 18, RACE_DRACONIAN},
80 { "低能なプーゴー", 250, 170, 108, 5, 15, RACE_BEASTMAN},
81 { "フェロールフィリアン", 500, 175, 108, 4, 12, RACE_ELF},
82 { "年寄りマロカ", 750, 170, 107, 5, 15, RACE_GNOME},
83 { "勇敢なサシン", 1000, 165, 107, 6, 18, RACE_HALF_GIANT},
84 { "田舎者アビエマール", 250, 170, 108, 5, 15, RACE_HUMAN},
85 { "貧乏なハーク", 500, 175, 108, 4, 12, RACE_HALF_ORC},
86 { "みじめなソアリン", 750, 170, 107, 5, 15, RACE_ZOMBIE},
87 { "質素なメルラ", 1000, 165, 107, 6, 18, RACE_ELF},
89 { "Bilbo the Friendly", 200, 170, 108, 5, 15, RACE_HOBBIT},
90 { "Rincewind the Chicken", 200, 175, 108, 4, 12, RACE_HUMAN},
91 { "Sultan the Midget", 300, 170, 107, 5, 15, RACE_GNOME},
92 { "Lyar-el the Comely", 300, 165, 107, 6, 18, RACE_ELF},
93 { "Falilmawen the Friendly", 250, 170, 108, 5, 15, RACE_HOBBIT},
94 { "Voirin the Cowardly", 500, 175, 108, 4, 12, RACE_HUMAN},
95 { "Erashnak the Midget", 750, 170, 107, 5, 15, RACE_BEASTMAN},
96 { "Grug the Comely", 1000, 165, 107, 6, 18, RACE_HALF_TITAN},
97 { "Forovir the Cheap", 250, 170, 108, 5, 15, RACE_HUMAN},
98 { "Ellis the Fool", 500, 175, 108, 4, 12, RACE_HUMAN},
99 { "Filbert the Hungry", 750, 170, 107, 5, 15, RACE_VAMPIRE},
100 { "Fthnargl Psathiggua", 1000, 165, 107, 6, 18, RACE_MIND_FLAYER},
101 { "Eloise Long-Dead", 250, 170, 108, 5, 15, RACE_SPECTRE},
102 { "Fundi the Slow", 500, 175, 108, 4, 12, RACE_ZOMBIE},
103 { "Granthus", 750, 170, 107, 5, 15, RACE_SKELETON},
104 { "Lorax the Suave", 1000, 165, 107, 6, 18, RACE_VAMPIRE},
105 { "Butch", 250, 170, 108, 5, 15, RACE_HALF_ORC},
106 { "Elbereth the Beautiful", 500, 175, 108, 4, 12, RACE_HIGH_ELF},
107 { "Sarleth the Sneaky", 750, 170, 107, 5, 15, RACE_GNOME},
108 { "Narlock", 1000, 165, 107, 6, 18, RACE_DWARF},
109 { "Haneka the Small", 250, 170, 108, 5, 15, RACE_GNOME},
110 { "Loirin the Mad", 500, 175, 108, 4, 12, RACE_HALF_GIANT},
111 { "Wuto Poisonbreath", 750, 170, 107, 5, 15, RACE_DRACONIAN},
112 { "Araaka the Rotund", 1000, 165, 107, 6, 18, RACE_DRACONIAN},
113 { "Poogor the Dumb", 250, 170, 108, 5, 15, RACE_BEASTMAN},
114 { "Felorfiliand", 500, 175, 108, 4, 12, RACE_ELF},
115 { "Maroka the Aged", 750, 170, 107, 5, 15, RACE_GNOME},
116 { "Sasin the Bold", 1000, 165, 107, 6, 18, RACE_HALF_GIANT},
117 { "Abiemar the Peasant", 250, 170, 108, 5, 15, RACE_HUMAN},
118 { "Hurk the Poor", 500, 175, 108, 4, 12, RACE_HALF_ORC},
119 { "Soalin the Wretched", 750, 170, 107, 5, 15, RACE_ZOMBIE},
120 { "Merulla the Humble", 1000, 165, 107, 6, 18, RACE_ELF},
124 /* Armoury - 28 unique names */
126 { "醜悪コン=ダー", 5000, 210, 115, 5, 7, RACE_HALF_ORC},
127 { "頑固者ダーグ=ロウ", 10000, 190, 111, 4, 9, RACE_HUMAN},
128 { "賢者デカド", 25000, 200, 112, 4, 10, RACE_DUNADAN},
129 { "鍛冶屋のウィーランド", 30000, 200, 112, 4, 5, RACE_DWARF},
130 { "醜悪コン=ダー", 10000, 210, 115, 5, 7, RACE_HALF_ORC},
131 { "頑固者ダーグ=ロウ", 15000, 190, 111, 4, 9, RACE_HUMAN},
132 { "ハンサムなデカド", 25000, 200, 112, 4, 10, RACE_AMBERITE},
133 { "エロー・ドラゴンスケイル", 30000, 200, 112, 4, 5, RACE_ELF},
134 { "デリカトス", 10000, 210, 115, 5, 7, RACE_SPRITE},
135 { "巨大なグルース", 15000, 190, 111, 4, 9, RACE_HALF_GIANT},
136 { "アニムス", 25000, 200, 112, 4, 10, RACE_GOLEM},
137 { "マルヴァス", 30000, 200, 112, 4, 5, RACE_HALF_TITAN},
138 { "セラクシス", 10000, 210, 115, 5, 7, RACE_ZOMBIE},
139 { "デス・チル", 5000, 190, 111, 4, 9, RACE_SPECTRE},
140 { "微かなドリオス", 25000, 200, 112, 4, 10, RACE_SPECTRE},
141 { "冷たいバスリック", 30000, 200, 112, 4, 5, RACE_VAMPIRE},
142 { "冷酷ヴェンジェラ", 10000, 210, 115, 5, 7, RACE_HALF_TROLL},
143 { "強者ウィラナ", 15000, 190, 111, 4, 9, RACE_HUMAN},
144 { "ヨジョ二世", 25000, 200, 112, 4, 10, RACE_DWARF},
145 { "優しいラナラー", 30000, 200, 112, 4, 5, RACE_AMBERITE},
146 { "不浄のホルバグ", 5000, 210, 115, 5, 7, RACE_HALF_ORC},
147 { "テレパスのエレレン", 15000, 190, 111, 4, 9, RACE_DARK_ELF},
148 { "イスドリリアス", 25000, 200, 112, 4, 10, RACE_SPRITE},
149 { "一つ目ヴェグナー", 5000, 200, 112, 4, 5, RACE_CYCLOPS},
150 { "混沌のロディッシュ", 10000, 210, 115, 5, 7, RACE_BEASTMAN},
151 { "剣豪ヘジン", 15000, 190, 111, 4, 9, RACE_NIBELUNG},
152 { "ずる屋のエルベレリス", 10000, 200, 112, 4, 10, RACE_DARK_ELF},
153 { "インプのザサス", 30000, 200, 112, 4, 5, RACE_IMP},
154 { "醜悪コン=ダー", 5000, 210, 115, 5, 7, RACE_HALF_ORC},
155 { "頑固者ダーグ=ロウ", 10000, 190, 111, 4, 9, RACE_HUMAN},
156 { "ハンサムなデカド", 25000, 200, 112, 4, 10, RACE_AMBERITE},
157 { "鍛冶屋のウィーランド", 30000, 200, 112, 4, 5, RACE_DWARF},
159 { "Kon-Dar the Ugly", 5000, 210, 115, 5, 7, RACE_HALF_ORC},
160 { "Darg-Low the Grim", 10000, 190, 111, 4, 9, RACE_HUMAN},
161 { "Decado the Handsome", 25000, 200, 112, 4, 10, RACE_DUNADAN},
162 { "Wieland the Smith", 30000, 200, 112, 4, 5, RACE_DWARF},
163 { "Kon-Dar the Ugly", 10000, 210, 115, 5, 7, RACE_HALF_ORC},
164 { "Darg-Low the Grim", 15000, 190, 111, 4, 9, RACE_HUMAN},
165 { "Decado the Handsome", 25000, 200, 112, 4, 10, RACE_AMBERITE},
166 { "Elo Dragonscale", 30000, 200, 112, 4, 5, RACE_ELF},
167 { "Delicatus", 10000, 210, 115, 5, 7, RACE_SPRITE},
168 { "Gruce the Huge", 15000, 190, 111, 4, 9, RACE_HALF_GIANT},
169 { "Animus", 25000, 200, 112, 4, 10, RACE_GOLEM},
170 { "Malvus", 30000, 200, 112, 4, 5, RACE_HALF_TITAN},
171 { "Selaxis", 10000, 210, 115, 5, 7, RACE_ZOMBIE},
172 { "Deathchill", 5000, 190, 111, 4, 9, RACE_SPECTRE},
173 { "Drios the Faint", 25000, 200, 112, 4, 10, RACE_SPECTRE},
174 { "Bathric the Cold", 30000, 200, 112, 4, 5, RACE_VAMPIRE},
175 { "Vengella the Cruel", 10000, 210, 115, 5, 7, RACE_HALF_TROLL},
176 { "Wyrana the Mighty", 15000, 190, 111, 4, 9, RACE_HUMAN},
177 { "Yojo II", 25000, 200, 112, 4, 10, RACE_DWARF},
178 { "Ranalar the Sweet", 30000, 200, 112, 4, 5, RACE_AMBERITE},
179 { "Horbag the Unclean", 5000, 210, 115, 5, 7, RACE_HALF_ORC},
180 { "Elelen the Telepath", 15000, 190, 111, 4, 9, RACE_DARK_ELF},
181 { "Isedrelias", 25000, 200, 112, 4, 10, RACE_SPRITE},
182 { "Vegnar One-eye", 5000, 200, 112, 4, 5, RACE_CYCLOPS},
183 { "Rodish the Chaotic", 10000, 210, 115, 5, 7, RACE_BEASTMAN},
184 { "Hesin Swordmaster", 15000, 190, 111, 4, 9, RACE_NIBELUNG},
185 { "Elvererith the Cheat", 10000, 200, 112, 4, 10, RACE_DARK_ELF},
186 { "Zzathath the Imp", 30000, 200, 112, 4, 5, RACE_IMP},
187 { "Kon-Dar the Ugly", 5000, 210, 115, 5, 7, RACE_HALF_ORC},
188 { "Darg-Low the Grim", 10000, 190, 111, 4, 9, RACE_HUMAN},
189 { "Decado the Handsome", 25000, 200, 112, 4, 10, RACE_AMBERITE},
190 { "Wieland the Smith", 30000, 200, 112, 4, 5, RACE_DWARF},
195 /* Weapon Smith - 28 unique names */
197 { "残忍なるアーノルド", 5000, 210, 115, 6, 6, RACE_HALF_TROLL},
198 { "獣殺しのアーンダル", 10000, 185, 110, 5, 9, RACE_HALF_ELF},
199 { "獣マスターのエディー", 25000, 190, 115, 5, 7, RACE_HOBBIT},
200 { "竜殺しのオグライン", 30000, 195, 112, 4, 8, RACE_DWARF},
201 { "熟練者ドリュー", 10000, 210, 115, 6, 6, RACE_HUMAN},
202 { "龍の子オラックス", 15000, 185, 110, 5, 9, RACE_DRACONIAN},
203 { "病気持ちのアンスラックス", 25000, 190, 115, 5, 7, RACE_BEASTMAN},
204 { "頑丈者アルコス", 30000, 195, 112, 4, 8, RACE_DWARF},
205 { "腐れ者のサリアス", 5000, 210, 115, 6, 6, RACE_ZOMBIE},
206 { "晒し骨のトゥエシク", 15000, 185, 110, 5, 9, RACE_SKELETON},
207 { "ビリオス", 25000, 190, 115, 5, 7, RACE_BEASTMAN},
208 { "ファスガル", 30000, 195, 112, 4, 8, RACE_ZOMBIE},
209 { "パラディンのエレフリス", 10000, 210, 115, 6, 6, RACE_BARBARIAN},
210 { "キ'トリッ'ク", 15000, 185, 110, 5, 9, RACE_KLACKON},
211 { "蜘蛛の友ドゥロカス", 25000, 190, 115, 5, 7, RACE_DARK_ELF},
212 { "巨人殺しのフングス", 30000, 195, 112, 4, 8, RACE_DWARF},
213 { "デランサ", 10000, 210, 115, 6, 6, RACE_ELF},
214 { "レンジャーのソルビスタニ", 15000, 185, 110, 5, 9, RACE_HALF_ELF},
215 { "ノロマのゾリル", 25000, 190, 115, 5, 7, RACE_GOLEM},
216 { "イーオン・フラックス", 20000, 195, 112, 4, 8, RACE_HALF_ELF},
217 { "強者ナドック", 10000, 210, 115, 6, 6, RACE_HOBBIT},
218 { "弱虫エラモグ", 15000, 185, 110, 5, 9, RACE_KOBOLD},
219 { "公正なエオウィリス", 25000, 190, 115, 5, 7, RACE_VAMPIRE},
220 { "バルログ殺しのヒュイモグ", 30000, 195, 112, 4, 8, RACE_HALF_ORC},
221 { "冷酷ピーダス", 5000, 210, 115, 6, 6, RACE_HUMAN},
222 { "ヴァモグ スレイヤー", 15000, 185, 110, 5, 9, RACE_HALF_OGRE},
223 { "性悪フーシュナク", 25000, 190, 115, 5, 7, RACE_BEASTMAN},
224 { "舞闘バレン", 30000, 195, 112, 4, 8, RACE_BARBARIAN},
225 { "残忍なるアーノルド", 5000, 210, 115, 6, 6, RACE_BARBARIAN},
226 { "獣殺しのアーンダル", 10000, 185, 110, 5, 9, RACE_HALF_ELF},
227 { "ビーストマスター・エディー", 25000, 190, 115, 5, 7, RACE_HALF_ORC},
228 { "竜殺しのオグライン", 30000, 195, 112, 4, 8, RACE_DWARF},
230 { "Arnold the Beastly", 5000, 210, 115, 6, 6, RACE_BARBARIAN},
231 { "Arndal Beast-Slayer", 10000, 185, 110, 5, 9, RACE_HALF_ELF},
232 { "Eddie Beast-Master", 25000, 190, 115, 5, 7, RACE_HALF_ORC},
233 { "Oglign Dragon-Slayer", 30000, 195, 112, 4, 8, RACE_DWARF},
234 { "Drew the Skilled", 10000, 210, 115, 6, 6, RACE_HUMAN},
235 { "Orrax Dragonson", 15000, 185, 110, 5, 9, RACE_DRACONIAN},
236 { "Anthrax Disease-Carrier", 25000, 190, 115, 5, 7, RACE_BEASTMAN},
237 { "Arkhoth the Stout", 30000, 195, 112, 4, 8, RACE_DWARF},
238 { "Sarlyas the Rotten", 5000, 210, 115, 6, 6, RACE_ZOMBIE},
239 { "Tuethic Bare-Bones", 15000, 185, 110, 5, 9, RACE_SKELETON},
240 { "Bilious", 25000, 190, 115, 5, 7, RACE_BEASTMAN},
241 { "Fasgul", 30000, 195, 112, 4, 8, RACE_ZOMBIE},
242 { "Ellefris the Paladin", 10000, 210, 115, 6, 6, RACE_BARBARIAN},
243 { "K'trrik'k", 15000, 185, 110, 5, 9, RACE_KLACKON},
244 { "Drocus Spiderfriend", 25000, 190, 115, 5, 7, RACE_DARK_ELF},
245 { "Fungus Giant-Slayer", 30000, 195, 112, 4, 8, RACE_DWARF},
246 { "Delantha", 10000, 210, 115, 6, 6, RACE_ELF},
247 { "Solvistani the Ranger", 15000, 185, 110, 5, 9, RACE_HALF_ELF},
248 { "Xoril the Slow", 25000, 190, 115, 5, 7, RACE_GOLEM},
249 { "Aeon Flux", 20000, 195, 112, 4, 8, RACE_HALF_ELF},
250 { "Nadoc the Strong", 10000, 210, 115, 6, 6, RACE_HOBBIT},
251 { "Eramog the Weak", 15000, 185, 110, 5, 9, RACE_KOBOLD},
252 { "Eowilith the Fair", 25000, 190, 115, 5, 7, RACE_VAMPIRE},
253 { "Huimog Balrog-Slayer", 30000, 195, 112, 4, 8, RACE_HALF_ORC},
254 { "Peadus the Cruel", 5000, 210, 115, 6, 6, RACE_HUMAN},
255 { "Vamog Slayer", 15000, 185, 110, 5, 9, RACE_HALF_OGRE},
256 { "Hooshnak the Vicious", 25000, 190, 115, 5, 7, RACE_BEASTMAN},
257 { "Balenn War-Dancer", 30000, 195, 112, 4, 8, RACE_BARBARIAN},
258 { "Arnold the Beastly", 5000, 210, 115, 6, 6, RACE_BARBARIAN},
259 { "Arndal Beast-Slayer", 10000, 185, 110, 5, 9, RACE_HALF_ELF},
260 { "Eddie Beast-Master", 25000, 190, 115, 5, 7, RACE_HALF_ORC},
261 { "Oglign Dragon-Slayer", 30000, 195, 112, 4, 8, RACE_DWARF},
265 /* Temple - 22 unique names */
267 { "質素なルードヴィヒ", 5000, 175, 109, 6, 15, RACE_HUMAN},
268 { "パラディンのガンナー", 10000, 185, 110, 5, 23, RACE_HUMAN},
269 { "選ばれしトリン", 25000, 180, 107, 6, 20, RACE_ELF},
270 { "賢明なるサラストロ", 30000, 185, 109, 5, 15, RACE_DWARF},
271 { "パーシヴァル卿", 25000, 180, 107, 6, 20, RACE_HIGH_ELF},
272 { "神聖なるアセナス", 30000, 185, 109, 5, 15, RACE_HUMAN},
273 { "マッキノン", 10000, 175, 109, 6, 15, RACE_HUMAN},
274 { "謹み婦人", 15000, 185, 110, 5, 23, RACE_HIGH_ELF},
275 { "ドルイドのハシュニック", 25000, 180, 107, 6, 20, RACE_HOBBIT},
276 { "フィナク", 30000, 185, 109, 5, 15, RACE_YEEK},
277 { "クリキック", 10000, 175, 109, 6, 15, RACE_KLACKON},
278 { "荒くれ者モリヴァル", 15000, 185, 110, 5, 23, RACE_ELF},
279 { "暗きホシャック", 25000, 180, 107, 6, 20, RACE_IMP},
280 { "賢者アタール", 30000, 185, 109, 5, 15, RACE_HUMAN},
281 { "清きイベニッド", 10000, 175, 109, 6, 15, RACE_HUMAN},
282 { "エリディシュ", 15000, 185, 110, 5, 23, RACE_HALF_TROLL},
283 { "呪術師ヴルドゥシュ", 25000, 180, 107, 6, 20, RACE_HALF_OGRE},
284 { "狂戦士ハオブ", 30000, 185, 109, 5, 15, RACE_BARBARIAN},
285 { "若きプルーグディシュ", 10000, 175, 109, 6, 15, RACE_HALF_OGRE},
286 { "きちがいラムワイズ", 15000, 185, 110, 5, 23, RACE_YEEK},
287 { "有徳者ムワート", 25000, 180, 107, 6, 20, RACE_KOBOLD},
288 { "弱虫ダードバード", 30000, 185, 109, 5, 15, RACE_SPECTRE},
289 { "質素なルードヴィヒ", 5000, 175, 109, 6, 15, RACE_HUMAN},
290 { "パラディンのガンナー", 10000, 185, 110, 5, 23, RACE_HUMAN},
291 { "選ばれしトリン", 25000, 180, 107, 6, 20, RACE_ELF},
292 { "賢明なるサラストロ", 30000, 185, 109, 5, 15, RACE_DWARF},
293 { "パーシヴァル卿", 25000, 180, 107, 6, 20, RACE_HIGH_ELF},
294 { "神聖なるアセナス", 30000, 185, 109, 5, 15, RACE_HUMAN},
295 { "マッキノン", 10000, 175, 109, 6, 15, RACE_HUMAN},
296 { "謹み婦人", 15000, 185, 110, 5, 23, RACE_HIGH_ELF},
297 { "ドルイドのハシュニック", 25000, 180, 107, 6, 20, RACE_HOBBIT},
298 { "フィナク", 30000, 185, 109, 5, 15, RACE_YEEK},
300 { "Ludwig the Humble", 5000, 175, 109, 6, 15, RACE_DWARF},
301 { "Gunnar the Paladin", 10000, 185, 110, 5, 23, RACE_HALF_TROLL},
302 { "Torin the Chosen", 25000, 180, 107, 6, 20, RACE_HIGH_ELF},
303 { "Sarastro the Wise", 30000, 185, 109, 5, 15, RACE_HUMAN},
304 { "Sir Parsival the Pure", 25000, 180, 107, 6, 20, RACE_HIGH_ELF},
305 { "Asenath the Holy", 30000, 185, 109, 5, 15, RACE_HUMAN},
306 { "McKinnon", 10000, 175, 109, 6, 15, RACE_HUMAN},
307 { "Mistress Chastity", 15000, 185, 110, 5, 23, RACE_HIGH_ELF},
308 { "Hashnik the Druid", 25000, 180, 107, 6, 20, RACE_HOBBIT},
309 { "Finak", 30000, 185, 109, 5, 15, RACE_YEEK},
310 { "Krikkik", 10000, 175, 109, 6, 15, RACE_KLACKON},
311 { "Morival the Wild", 15000, 185, 110, 5, 23, RACE_ELF},
312 { "Hoshak the Dark", 25000, 180, 107, 6, 20, RACE_IMP},
313 { "Atal the Wise", 30000, 185, 109, 5, 15, RACE_HUMAN},
314 { "Ibenidd the Chaste", 10000, 175, 109, 6, 15, RACE_HUMAN},
315 { "Eridish", 15000, 185, 110, 5, 23, RACE_HALF_TROLL},
316 { "Vrudush the Shaman", 25000, 180, 107, 6, 20, RACE_HALF_OGRE},
317 { "Haob the Berserker", 30000, 185, 109, 5, 15, RACE_BARBARIAN},
318 { "Proogdish the Youthfull", 10000, 175, 109, 6, 15, RACE_HALF_OGRE},
319 { "Lumwise the Mad", 15000, 185, 110, 5, 23, RACE_YEEK},
320 { "Muirt the Virtuous", 25000, 180, 107, 6, 20, RACE_KOBOLD},
321 { "Dardobard the Weak", 30000, 185, 109, 5, 15, RACE_SPECTRE},
322 { "Ludwig the Humble", 5000, 175, 109, 6, 15, RACE_DWARF},
323 { "Gunnar the Paladin", 10000, 185, 110, 5, 23, RACE_HALF_TROLL},
324 { "Torin the Chosen", 25000, 180, 107, 6, 20, RACE_HIGH_ELF},
325 { "Sarastro the Wise", 30000, 185, 109, 5, 15, RACE_HUMAN},
326 { "Sir Parsival the Pure", 25000, 180, 107, 6, 20, RACE_HIGH_ELF},
327 { "Asenath the Holy", 30000, 185, 109, 5, 15, RACE_HUMAN},
328 { "McKinnon", 10000, 175, 109, 6, 15, RACE_HUMAN},
329 { "Mistress Chastity", 15000, 185, 110, 5, 23, RACE_HIGH_ELF},
330 { "Hashnik the Druid", 25000, 180, 107, 6, 20, RACE_HOBBIT},
331 { "Finak", 30000, 185, 109, 5, 15, RACE_YEEK},
335 /* Alchemist - 26 unique names */
337 { "化学者マウザー", 10000, 190, 111, 5, 8, RACE_HALF_ELF},
338 { "カオスのウィズル", 10000, 190, 110, 6, 8, RACE_HOBBIT},
339 { "強欲ミダス", 15000, 200, 116, 6, 9, RACE_GNOME},
340 { "貧弱ジャ=ファー", 15000, 220, 111, 4, 9, RACE_ELF},/*FIRST*/
341 { "カカルラカカル", 15000, 200, 116, 6, 9, RACE_KLACKON},
342 { "錬金術師ジャル=エス", 15000, 220, 111, 4, 9, RACE_ELF},
343 { "用心深いファネラス", 10000, 190, 111, 5, 8, RACE_DWARF},
344 { "キチガイのルンシー", 10000, 190, 110, 6, 8, RACE_HUMAN},
345 { "グランブルワース", 15000, 200, 116, 6, 9, RACE_GNOME},
346 { "フリッター", 15000, 220, 111, 4, 9, RACE_SPRITE},
347 { "ザリルス", 10000, 190, 111, 5, 8, RACE_HUMAN},
348 { "古きエグバート", 10000, 190, 110, 6, 8, RACE_DWARF},
349 { "誇り高きヴァリンドラ", 15000, 200, 116, 6, 9, RACE_HIGH_ELF},
350 { "錬金術師タエン", 15000, 220, 111, 4, 9, RACE_HUMAN},
351 { "巧言カイド", 10000, 190, 111, 5, 8, RACE_VAMPIRE},
352 { "暗きフリア", 10000, 190, 110, 6, 8, RACE_NIBELUNG},
353 { "質素なドムリ", 15000, 200, 116, 6, 9, RACE_DWARF},
354 { "魔の子ヤァジュッカ", 15000, 220, 111, 4, 9, RACE_IMP},
355 { "薬草師ジェララルドール", 10000, 190, 111, 5, 8, RACE_HIGH_ELF},
356 { "賢者オレラルダン", 10000, 190, 110, 6, 8, RACE_BARBARIAN},
357 { "デモニシストのフゾグロ", 15000, 200, 116, 6, 9, RACE_IMP},
358 { "錬金術師ドゥリアシュ", 15000, 220, 111, 4, 9, RACE_HALF_ORC},
359 { "強者ネリア", 10000, 190, 111, 5, 8, RACE_CYCLOPS},
360 { "辛口リグナス", 10000, 190, 110, 6, 8, RACE_HALF_ORC},
361 { "ティルバ", 15000, 200, 116, 6, 9, RACE_HOBBIT},
362 { "金持ちミリルドリック", 15000, 220, 111, 4, 9, RACE_HUMAN},
364 { "科学者マウザー", 10000, 190, 111, 5, 8, RACE_HALF_ELF},
365 { "カオスのウィズル", 10000, 190, 110, 6, 8, RACE_HOBBIT},
366 { "強欲ミダス", 15000, 200, 116, 6, 9, RACE_GNOME},
367 { "錬金術師ジャ=ファー", 15000, 220, 111, 4, 9, RACE_ELF},
368 { "カカルラカカル", 15000, 200, 116, 6, 9, RACE_KLACKON},
369 { "錬金術師ジャル=エス", 15000, 220, 111, 4, 9, RACE_ELF},
371 { "Mauser the Chemist", 10000, 190, 111, 5, 8, RACE_HALF_ELF},
372 { "Wizzle the Chaotic", 10000, 190, 110, 6, 8, RACE_HOBBIT},
373 { "Midas the Greedy", 15000, 200, 116, 6, 9, RACE_GNOME},
374 { "Ja-Far the Alchemist", 15000, 220, 111, 4, 9, RACE_ELF},
375 { "Kakalrakakal", 15000, 200, 116, 6, 9, RACE_KLACKON},
376 { "Jal-Eth the Alchemist", 15000, 220, 111, 4, 9, RACE_ELF},
377 { "Fanelath the Cautious", 10000, 190, 111, 5, 8, RACE_DWARF},
378 { "Runcie the Insane", 10000, 190, 110, 6, 8, RACE_HUMAN},
379 { "Grumbleworth", 15000, 200, 116, 6, 9, RACE_GNOME},
380 { "Flitter", 15000, 220, 111, 4, 9, RACE_SPRITE},
381 { "Xarillus", 10000, 190, 111, 5, 8, RACE_HUMAN},
382 { "Egbert the Old", 10000, 190, 110, 6, 8, RACE_DWARF},
383 { "Valindra the Proud", 15000, 200, 116, 6, 9, RACE_HIGH_ELF},
384 { "Taen the Alchemist", 15000, 220, 111, 4, 9, RACE_HUMAN},
385 { "Cayd the Sweet", 10000, 190, 111, 5, 8, RACE_VAMPIRE},
386 { "Fulir the Dark", 10000, 190, 110, 6, 8, RACE_NIBELUNG},
387 { "Domli the Humble", 15000, 200, 116, 6, 9, RACE_DWARF},
388 { "Yaarjukka Demonspawn", 15000, 220, 111, 4, 9, RACE_IMP},
389 { "Gelaraldor the Herbmaster", 10000, 190, 111, 5, 8, RACE_HIGH_ELF},
390 { "Olelaldan the Wise", 10000, 190, 110, 6, 8, RACE_BARBARIAN},
391 { "Fthoglo the Demonicist", 15000, 200, 116, 6, 9, RACE_IMP},
392 { "Dridash the Alchemist", 15000, 220, 111, 4, 9, RACE_HALF_ORC},
393 { "Nelir the Strong", 10000, 190, 111, 5, 8, RACE_CYCLOPS},
394 { "Lignus the Pungent", 10000, 190, 110, 6, 8, RACE_HALF_ORC},
395 { "Tilba", 15000, 200, 116, 6, 9, RACE_HOBBIT},
396 { "Myrildric the Wealthy", 15000, 220, 111, 4, 9, RACE_HUMAN},
398 { "Mauser the Chemist", 10000, 190, 111, 5, 8, RACE_HALF_ELF},
399 { "Wizzle the Chaotic", 10000, 190, 110, 6, 8, RACE_HOBBIT},
400 { "Midas the Greedy", 15000, 200, 116, 6, 9, RACE_GNOME},
401 { "Ja-Far the Alchemist", 15000, 220, 111, 4, 9, RACE_ELF},
402 { "Kakalrakakal", 15000, 200, 116, 6, 9, RACE_KLACKON},
403 { "Jal-Eth the Alchemist", 15000, 220, 111, 4, 9, RACE_ELF},
408 /* Magic Shop - 23 unique names */
410 { "ソーサラーのロ=パン", 20000, 200, 110, 7, 8, RACE_HALF_ELF},
411 { "偉大なるブガービイ", 20000, 215, 113, 6, 10, RACE_GNOME},
412 { "イェンダーの魔法使い", 30000, 200, 110, 7, 10, RACE_HUMAN},
413 { "死霊使いリャク",30000, 175, 110, 5, 11, RACE_HIGH_ELF},
414 { "魔術師スキドゥニー", 15000, 200, 110, 7, 8, RACE_HALF_ELF},
415 { "幻術師キリア", 30000, 200, 110, 7, 10, RACE_HUMAN},
416 { "死霊術師ニッキ", 30000, 175, 110, 5, 11, RACE_DARK_ELF},
417 { "ソロストラン", 15000, 200, 110, 7, 8, RACE_SPRITE},
418 { "烏賊口アチシェ", 20000, 215, 113, 6, 10, RACE_MIND_FLAYER},
419 { "貴族のカザ", 30000, 200, 110, 7, 10, RACE_HIGH_ELF},
420 { "暗きファジル", 30000, 175, 110, 5, 11, RACE_DARK_ELF},
421 { "偉大なるケルドーン", 15000, 200, 110, 7, 8, RACE_DWARF},
422 { "フィランスロプス", 20000, 215, 113, 6, 10, RACE_HOBBIT},
423 { "魔女のアグナー", 30000, 200, 110, 7, 10, RACE_HUMAN},
424 { "死霊術師ビュリアンス", 30000, 175, 110, 5, 11, RACE_BEASTMAN},
425 { "ハイメイジのヴイラク", 15000, 200, 110, 7, 8, RACE_BEASTMAN},
426 { "知恵者マディッシュ", 20000, 215, 113, 6, 10, RACE_BEASTMAN},
427 { "ファレブリンボール", 30000, 200, 110, 7, 10, RACE_HIGH_ELF},
428 { "陰険フェリル=ガンド", 30000, 175, 110, 5, 11, RACE_DARK_ELF},
429 { "呪術師サレゴード", 15000, 200, 110, 7, 8, RACE_BARBARIAN},
430 { "神秘家クトゥアロス", 20000, 215, 113, 6, 10, RACE_MIND_FLAYER},
431 { "幻術師イベリ", 30000, 200, 110, 7, 10, RACE_SKELETON},
432 { "死霊術師ヘトー", 30000, 175, 110, 5, 11, RACE_YEEK},
433 { "魔術師ロ=パン", 20000, 200, 110, 7, 8, RACE_HALF_ELF},
434 { "偉大なるブガービイ", 20000, 215, 113, 6, 10, RACE_GNOME},
435 { "イェンダーの魔法使い", 30000, 200, 110, 7, 10, RACE_HUMAN},
436 { "死霊術師リャク", 30000, 175, 110, 5, 11, RACE_DARK_ELF},
437 { "魔術師スキドゥニー", 15000, 200, 110, 7, 8, RACE_HALF_ELF},
438 { "幻術師キリア", 30000, 200, 110, 7, 10, RACE_HUMAN},
439 { "死霊術師ニッキ", 30000, 175, 110, 5, 11, RACE_DARK_ELF},
440 { "ソロストラン", 15000, 200, 110, 7, 8, RACE_SPRITE},
441 { "烏賊口アチシェ", 20000, 215, 113, 6, 10, RACE_MIND_FLAYER},
443 { "Lo Pan the Sorcerer", 20000, 200, 110, 7, 8, RACE_HALF_ELF},
444 { "Buggerby the Great", 20000, 215, 113, 6, 10, RACE_GNOME},
445 { "The Wizard of Yendor", 30000, 200, 110, 7, 10, RACE_HUMAN},
446 { "Rjak the Necromancer", 30000, 175, 110, 5, 11, RACE_DARK_ELF},
447 { "Skidney the Sorcerer", 15000, 200, 110, 7, 8, RACE_HALF_ELF},
448 { "Kyria the Illusionist", 30000, 200, 110, 7, 10, RACE_HUMAN},
449 { "Nikki the Necromancer", 30000, 175, 110, 5, 11, RACE_DARK_ELF},
450 { "Solostoran", 15000, 200, 110, 7, 8, RACE_SPRITE},
451 { "Achshe the Tentacled", 20000, 215, 113, 6, 10, RACE_MIND_FLAYER},
452 { "Kaza the Noble", 30000, 200, 110, 7, 10, RACE_HIGH_ELF},
453 { "Fazzil the Dark", 30000, 175, 110, 5, 11, RACE_DARK_ELF},
454 { "Keldorn the Grand", 15000, 200, 110, 7, 8, RACE_DWARF},
455 { "Philanthropus", 20000, 215, 113, 6, 10, RACE_HOBBIT},
456 { "Agnar the Enchantress", 30000, 200, 110, 7, 10, RACE_HUMAN},
457 { "Buliance the Necromancer", 30000, 175, 110, 5, 11, RACE_BEASTMAN},
458 { "Vuirak the High-Mage", 15000, 200, 110, 7, 8, RACE_BEASTMAN},
459 { "Madish the Smart", 20000, 215, 113, 6, 10, RACE_BEASTMAN},
460 { "Falebrimbor", 30000, 200, 110, 7, 10, RACE_HIGH_ELF},
461 { "Felil-Gand the Subtle", 30000, 175, 110, 5, 11, RACE_DARK_ELF},
462 { "Thalegord the Shaman", 15000, 200, 110, 7, 8, RACE_BARBARIAN},
463 { "Cthoaloth the Mystic", 20000, 215, 113, 6, 10, RACE_MIND_FLAYER},
464 { "Ibeli the Illusionist", 30000, 200, 110, 7, 10, RACE_SKELETON},
465 { "Heto the Necromancer", 30000, 175, 110, 5, 11, RACE_YEEK},
466 { "Lo Pan the Sorcerer", 20000, 200, 110, 7, 8, RACE_HALF_ELF},
467 { "Buggerby the Great", 20000, 215, 113, 6, 10, RACE_GNOME},
468 { "The Wizard of Yendor", 30000, 200, 110, 7, 10, RACE_HUMAN},
469 { "Rjak the Necromancer", 30000, 175, 110, 5, 11, RACE_DARK_ELF},
470 { "Skidney the Sorcerer", 15000, 200, 110, 7, 8, RACE_HALF_ELF},
471 { "Kyria the Illusionist", 30000, 200, 110, 7, 10, RACE_HUMAN},
472 { "Nikki the Necromancer", 30000, 175, 110, 5, 11, RACE_DARK_ELF},
473 { "Solostoran", 15000, 200, 110, 7, 8, RACE_SPRITE},
474 { "Achshe the Tentacled", 20000, 215, 113, 6, 10, RACE_MIND_FLAYER},
478 /* Black Market - 32 unique names */
480 { "ガリー=ギガズ", 20000, 250, 150, 10, 5, RACE_HALF_TROLL},
481 { "ゴブリンのヒストーア", 20000, 250, 150, 10, 5, RACE_HALF_ORC},
482 { "フェレンギ人クアーク", 30000, 250, 150, 10, 5, RACE_HUMAN},
483 { "公正なる(?)トッピ", 30000, 250, 150, 10, 5, RACE_ELF},
484 { "死人ヴァッサ", 20000, 250, 150, 10, 5, RACE_ZOMBIE},
485 { "裏切り者カイン", 20000, 250, 150, 10, 5, RACE_VAMPIRE},
486 { "ブボニカス", 30000, 250, 150, 10, 5, RACE_BEASTMAN},
487 { "コープスライト", 30000, 250, 150, 10, 5, RACE_SPECTRE},
488 { "血に飢えしパリッシュ", 20000, 250, 150, 10, 5, RACE_VAMPIRE},
489 { "ヴァイル", 20000, 250, 150, 10, 5, RACE_SKELETON},
490 { "信頼のプレンティス", 30000, 250, 150, 10, 5, RACE_SKELETON},
491 { "人間殺しのグリエラ", 30000, 250, 150, 10, 5, RACE_IMP},
492 { "エンジェル", 20000, 250, 150, 10, 5, RACE_VAMPIRE},
493 { "水膨れフロツァム", 20000, 250, 150, 10, 5, RACE_ZOMBIE},
494 { "ニーヴァル", 30000, 250, 150, 10, 5, RACE_VAMPIRE},
495 { "明るいアナスタシア", 30000, 250, 150, 10, 5, RACE_SPECTRE},
496 { "死霊術師チャリティー", 20000, 250, 150, 10, 5, RACE_DARK_ELF},
497 { "ボクサーのプグナシオス", 20000, 250, 150, 10, 5, RACE_HALF_ORC},
498 { "幸運なフットソア", 30000, 250, 150, 10, 5, RACE_BEASTMAN},
499 { "光指のシドリア", 30000, 250, 150, 10, 5, RACE_HUMAN},
500 { "手品師リアソー", 20000, 250, 150, 10, 5, RACE_HOBBIT},
501 { "やりくり上手のジャナッカ", 20000, 250, 150, 10, 5, RACE_GNOME},
502 { "悪党シーナ", 30000, 250, 150, 10, 5, RACE_GNOME},
503 { "大爪アルニッキ", 30000, 250, 150, 10, 5, RACE_DRACONIAN},
504 { "貧乏チャエアンド", 20000, 250, 150, 10, 5, RACE_HUMAN},
505 { "山賊アファードーフ", 20000, 250, 150, 10, 5, RACE_BARBARIAN},
506 { "強欲ラザクスル", 30000, 250, 150, 10, 5, RACE_MIND_FLAYER},
507 { "ファラレウィン", 30000, 250, 150, 10, 5, RACE_SPRITE},
508 { "しわしわヴォスール", 20000, 250, 150, 10, 5, RACE_NIBELUNG},
509 { "ハンサムなアラオード", 20000, 250, 150, 10, 5, RACE_AMBERITE},
510 { "負け犬セラドフリド", 30000, 250, 150, 10, 5, RACE_HUMAN},
511 { "片足のエルーロ", 30000, 250, 150, 10, 5, RACE_HALF_OGRE},
513 { "Gary Gygaz", 20000, 250, 150, 10, 5, RACE_HALF_TROLL},
514 { "Histor the Goblin", 20000, 250, 150, 10, 5, RACE_HALF_ORC},
515 { "Quark the Ferengi", 30000, 250, 150, 10, 5, RACE_DWARF},
516 { "Topi the Fair(?)", 30000, 250, 150, 10, 5, RACE_HUMAN},
517 { "Vhassa the Dead", 20000, 250, 150, 10, 5, RACE_ZOMBIE},
518 { "Kyn the Treacherous", 20000, 250, 150, 10, 5, RACE_VAMPIRE},
519 { "Bubonicus", 30000, 250, 150, 10, 5, RACE_BEASTMAN},
520 { "Corpselight", 30000, 250, 150, 10, 5, RACE_SPECTRE},
521 { "Parrish the Bloodthirsty", 20000, 250, 150, 10, 5, RACE_VAMPIRE},
522 { "Vile", 20000, 250, 150, 10, 5, RACE_SKELETON},
523 { "Prentice the Trusted", 30000, 250, 150, 10, 5, RACE_SKELETON},
524 { "Griella Humanslayer", 30000, 250, 150, 10, 5, RACE_IMP},
525 { "Angel", 20000, 250, 150, 10, 5, RACE_VAMPIRE},
526 { "Flotsam the Bloated", 20000, 250, 150, 10, 5, RACE_ZOMBIE},
527 { "Nieval", 30000, 250, 150, 10, 5, RACE_VAMPIRE},
528 { "Anastasia the Luminous", 30000, 250, 150, 10, 5, RACE_SPECTRE},
529 { "Charity the Necromancer", 20000, 250, 150, 10, 5, RACE_DARK_ELF},
530 { "Pugnacious the Pugilist", 20000, 250, 150, 10, 5, RACE_HALF_ORC},
531 { "Footsore the Lucky", 30000, 250, 150, 10, 5, RACE_BEASTMAN},
532 { "Sidria Lighfingered", 30000, 250, 150, 10, 5, RACE_HUMAN},
533 { "Riatho the Juggler", 20000, 250, 150, 10, 5, RACE_HOBBIT},
534 { "Janaaka the Shifty", 20000, 250, 150, 10, 5, RACE_GNOME},
535 { "Cina the Rogue", 30000, 250, 150, 10, 5, RACE_GNOME},
536 { "Arunikki Greatclaw", 30000, 250, 150, 10, 5, RACE_DRACONIAN},
537 { "Chaeand the Poor", 20000, 250, 150, 10, 5, RACE_HUMAN},
538 { "Afardorf the Brigand", 20000, 250, 150, 10, 5, RACE_BARBARIAN},
539 { "Lathaxl the Greedy", 30000, 250, 150, 10, 5, RACE_MIND_FLAYER},
540 { "Falarewyn", 30000, 250, 150, 10, 5, RACE_SPRITE},
541 { "Vosur the Wrinkled", 20000, 250, 150, 10, 5, RACE_NIBELUNG},
542 { "Araord the Handsome", 20000, 250, 150, 10, 5, RACE_AMBERITE},
543 { "Theradfrid the Loser", 30000, 250, 150, 10, 5, RACE_HUMAN},
544 { "One-Legged Eroolo", 30000, 250, 150, 10, 5, RACE_HALF_OGRE},
550 { "我が家", 0, 100, 100, 0, 99, 99},
551 { "我が家", 0, 100, 100, 0, 99, 99},
552 { "我が家", 0, 100, 100, 0, 99, 99},
553 { "我が家", 0, 100, 100, 0, 99, 99},
554 { "我が家", 0, 100, 100, 0, 99, 99},
555 { "我が家", 0, 100, 100, 0, 99, 99},
556 { "我が家", 0, 100, 100, 0, 99, 99},
557 { "我が家", 0, 100, 100, 0, 99, 99},
558 { "我が家", 0, 100, 100, 0, 99, 99},
559 { "我が家", 0, 100, 100, 0, 99, 99},
560 { "我が家", 0, 100, 100, 0, 99, 99},
561 { "我が家", 0, 100, 100, 0, 99, 99},
562 { "我が家", 0, 100, 100, 0, 99, 99},
563 { "我が家", 0, 100, 100, 0, 99, 99},
564 { "我が家", 0, 100, 100, 0, 99, 99},
565 { "我が家", 0, 100, 100, 0, 99, 99},
566 { "我が家", 0, 100, 100, 0, 99, 99},
567 { "我が家", 0, 100, 100, 0, 99, 99},
568 { "我が家", 0, 100, 100, 0, 99, 99},
569 { "我が家", 0, 100, 100, 0, 99, 99},
570 { "我が家", 0, 100, 100, 0, 99, 99},
571 { "我が家", 0, 100, 100, 0, 99, 99},
572 { "我が家", 0, 100, 100, 0, 99, 99},
573 { "我が家", 0, 100, 100, 0, 99, 99},
574 { "我が家", 0, 100, 100, 0, 99, 99},
575 { "我が家", 0, 100, 100, 0, 99, 99},
576 { "我が家", 0, 100, 100, 0, 99, 99},
577 { "我が家", 0, 100, 100, 0, 99, 99},
578 { "我が家", 0, 100, 100, 0, 99, 99},
579 { "我が家", 0, 100, 100, 0, 99, 99},
580 { "我が家", 0, 100, 100, 0, 99, 99},
581 { "我が家", 0, 100, 100, 0, 99, 99},
583 { "Your home", 0, 100, 100, 0, 99, 99},
584 { "Your home", 0, 100, 100, 0, 99, 99},
585 { "Your home", 0, 100, 100, 0, 99, 99},
586 { "Your home", 0, 100, 100, 0, 99, 99},
587 { "Your home", 0, 100, 100, 0, 99, 99},
588 { "Your home", 0, 100, 100, 0, 99, 99},
589 { "Your home", 0, 100, 100, 0, 99, 99},
590 { "Your home", 0, 100, 100, 0, 99, 99},
591 { "Your home", 0, 100, 100, 0, 99, 99},
592 { "Your home", 0, 100, 100, 0, 99, 99},
593 { "Your home", 0, 100, 100, 0, 99, 99},
594 { "Your home", 0, 100, 100, 0, 99, 99},
595 { "Your home", 0, 100, 100, 0, 99, 99},
596 { "Your home", 0, 100, 100, 0, 99, 99},
597 { "Your home", 0, 100, 100, 0, 99, 99},
598 { "Your home", 0, 100, 100, 0, 99, 99},
599 { "Your home", 0, 100, 100, 0, 99, 99},
600 { "Your home", 0, 100, 100, 0, 99, 99},
601 { "Your home", 0, 100, 100, 0, 99, 99},
602 { "Your home", 0, 100, 100, 0, 99, 99},
603 { "Your home", 0, 100, 100, 0, 99, 99},
604 { "Your home", 0, 100, 100, 0, 99, 99},
605 { "Your home", 0, 100, 100, 0, 99, 99},
606 { "Your home", 0, 100, 100, 0, 99, 99},
607 { "Your home", 0, 100, 100, 0, 99, 99},
608 { "Your home", 0, 100, 100, 0, 99, 99},
609 { "Your home", 0, 100, 100, 0, 99, 99},
610 { "Your home", 0, 100, 100, 0, 99, 99},
611 { "Your home", 0, 100, 100, 0, 99, 99},
612 { "Your home", 0, 100, 100, 0, 99, 99},
613 { "Your home", 0, 100, 100, 0, 99, 99},
614 { "Your home", 0, 100, 100, 0, 99, 99},
620 /* Bookstore - 21 unique names */
622 { "強欲ドラフ", 10000, 175, 108, 4, 12, RACE_HUMAN},
623 { "賢者オドナー", 15000, 120, 105, 6, 16, RACE_HIGH_ELF},
624 { "中立のガンダー", 25000, 120, 110, 7, 19, RACE_DARK_ELF},
625 { "忍耐の人ロ=シャ", 30000, 140, 105, 6, 12, RACE_ELF},
626 { "ランドルフ・カーター", 15000, 175, 108, 4, 12, RACE_HUMAN},
627 { "隼のサライ", 15000, 175, 108, 4, 12, RACE_HUMAN},
628 { "千里眼ボドリル", 20000, 120, 105, 6, 16, RACE_HIGH_ELF},
629 { "沈黙のヴェオロイン", 25000, 120, 110, 7, 19, RACE_ZOMBIE},
630 { "学者のヴァンシラス", 30000, 140, 105, 6, 12, RACE_MIND_FLAYER},
631 { "物書きオセイン", 15000, 175, 108, 4, 12, RACE_SKELETON},
632 { "本の虫オルヴァー", 20000, 120, 105, 6, 16, RACE_VAMPIRE},
633 { "浅井墓男", 25000, 120, 110, 7, 19, RACE_ZOMBIE},
634 { "デスマスク", 30000, 140, 105, 6, 12, RACE_ZOMBIE},
635 { "学者のアスーヌ", 15000, 175, 108, 4, 12, RACE_MIND_FLAYER},
636 { "死人のプリランド", 20000, 120, 105, 6, 16, RACE_ZOMBIE},
637 { "鉄のロナール", 25000, 120, 110, 7, 19, RACE_GOLEM},
639 { "Dolaf the Greedy", 10000, 175, 108, 4, 12, RACE_HUMAN},
640 { "Odnar the Sage", 15000, 120, 105, 6, 16, RACE_HIGH_ELF},
641 { "Gandar the Neutral", 25000, 120, 110, 7, 19, RACE_DARK_ELF},
642 { "Ro-sha the Patient", 30000, 140, 105, 6, 12, RACE_ELF},
643 { "Randolph Carter", 15000, 175, 108, 4, 12, RACE_HUMAN},
644 { "Sarai the Swift", 15000, 175, 108, 4, 12, RACE_HUMAN},
645 { "Bodril the Seer", 20000, 120, 105, 6, 16, RACE_HIGH_ELF},
646 { "Veloin the Quiet", 25000, 120, 110, 7, 19, RACE_ZOMBIE},
647 { "Vanthylas the Learned", 30000, 140, 105, 6, 12, RACE_MIND_FLAYER},
648 { "Ossein the Literate", 15000, 175, 108, 4, 12, RACE_SKELETON},
649 { "Olvar Bookworm", 20000, 120, 105, 6, 16, RACE_VAMPIRE},
650 { "Shallowgrave", 25000, 120, 110, 7, 19, RACE_ZOMBIE},
651 { "Death Mask", 30000, 140, 105, 6, 12, RACE_ZOMBIE},
652 { "Asuunu the Learned", 15000, 175, 108, 4, 12, RACE_MIND_FLAYER},
653 { "Prirand the Dead", 20000, 120, 105, 6, 16, RACE_ZOMBIE},
654 { "Ronar the Iron", 25000, 120, 110, 7, 19, RACE_GOLEM},
657 { "ガリル=ガミル", 30000, 140, 105, 6, 12, RACE_ELF},
658 { "本食いローバグ", 15000, 175, 108, 4, 12, RACE_KOBOLD},
659 { "キリアリキーク", 20000, 120, 105, 6, 16, RACE_KLACKON},
660 { "静かなるリリン", 25000, 120, 110, 7, 19, RACE_DWARF},
661 { "王者イサング", 30000, 140, 105, 6, 12, RACE_HIGH_ELF},
662 { "強欲ドラフ", 10000, 175, 108, 4, 12, RACE_HUMAN},
663 { "賢者オドナー", 15000, 120, 105, 6, 16, RACE_HIGH_ELF},
664 { "中立のガンダー", 25000, 120, 110, 7, 19, RACE_DARK_ELF},
665 { "忍耐の人ロ=シャ", 30000, 140, 105, 6, 12, RACE_ELF},
666 { "ランドルフ・カーター", 15000, 175, 108, 4, 12, RACE_HUMAN},
667 { "隼サライ", 15000, 175, 108, 4, 12, RACE_HUMAN},
668 { "千里眼ボドリル", 20000, 120, 105, 6, 16, RACE_HIGH_ELF},
669 { "沈黙のヴェオロイン", 25000, 120, 110, 7, 19, RACE_ZOMBIE},
670 { "学者のヴァンシラス", 30000, 140, 105, 6, 12, RACE_MIND_FLAYER},
671 { "物書きオセイン", 15000, 175, 108, 4, 12, RACE_SKELETON},
672 { "本の虫オルヴァー", 20000, 120, 105, 6, 16, RACE_VAMPIRE},
674 { "Galil-Gamir", 30000, 140, 105, 6, 12, RACE_ELF},
675 { "Rorbag Book-Eater", 15000, 175, 108, 4, 12, RACE_KOBOLD},
676 { "Kiriarikirk", 20000, 120, 105, 6, 16, RACE_KLACKON},
677 { "Rilin the Quiet", 25000, 120, 110, 7, 19, RACE_DWARF},
678 { "Isung the Lord", 30000, 140, 105, 6, 12, RACE_HIGH_ELF},
679 { "Dolaf the Greedy", 10000, 175, 108, 4, 12, RACE_HUMAN},
680 { "Odnar the Sage", 15000, 120, 105, 6, 16, RACE_HIGH_ELF},
681 { "Gandar the Neutral", 25000, 120, 110, 7, 19, RACE_DARK_ELF},
682 { "Ro-sha the Patient", 30000, 140, 105, 6, 12, RACE_ELF},
683 { "Randolph Carter", 15000, 175, 108, 4, 12, RACE_HUMAN},
684 { "Sarai the Swift", 15000, 175, 108, 4, 12, RACE_HUMAN},
685 { "Bodril the Seer", 20000, 120, 105, 6, 16, RACE_HIGH_ELF},
686 { "Veloin the Quiet", 25000, 120, 110, 7, 19, RACE_ZOMBIE},
687 { "Vanthylas the Learned", 30000, 140, 105, 6, 12, RACE_MIND_FLAYER},
688 { "Ossein the Literate", 15000, 175, 108, 4, 12, RACE_SKELETON},
689 { "Olvar Bookworm", 20000, 120, 105, 6, 16, RACE_VAMPIRE},
696 { "博物館", 0, 100, 100, 0, 99, 99},
697 { "博物館", 0, 100, 100, 0, 99, 99},
698 { "博物館", 0, 100, 100, 0, 99, 99},
699 { "博物館", 0, 100, 100, 0, 99, 99},
700 { "博物館", 0, 100, 100, 0, 99, 99},
701 { "博物館", 0, 100, 100, 0, 99, 99},
702 { "博物館", 0, 100, 100, 0, 99, 99},
703 { "博物館", 0, 100, 100, 0, 99, 99},
704 { "博物館", 0, 100, 100, 0, 99, 99},
705 { "博物館", 0, 100, 100, 0, 99, 99},
706 { "博物館", 0, 100, 100, 0, 99, 99},
707 { "博物館", 0, 100, 100, 0, 99, 99},
708 { "博物館", 0, 100, 100, 0, 99, 99},
709 { "博物館", 0, 100, 100, 0, 99, 99},
710 { "博物館", 0, 100, 100, 0, 99, 99},
711 { "博物館", 0, 100, 100, 0, 99, 99},
712 { "博物館", 0, 100, 100, 0, 99, 99},
713 { "博物館", 0, 100, 100, 0, 99, 99},
714 { "博物館", 0, 100, 100, 0, 99, 99},
715 { "博物館", 0, 100, 100, 0, 99, 99},
716 { "博物館", 0, 100, 100, 0, 99, 99},
717 { "博物館", 0, 100, 100, 0, 99, 99},
718 { "博物館", 0, 100, 100, 0, 99, 99},
719 { "博物館", 0, 100, 100, 0, 99, 99},
720 { "博物館", 0, 100, 100, 0, 99, 99},
721 { "博物館", 0, 100, 100, 0, 99, 99},
722 { "博物館", 0, 100, 100, 0, 99, 99},
723 { "博物館", 0, 100, 100, 0, 99, 99},
724 { "博物館", 0, 100, 100, 0, 99, 99},
725 { "博物館", 0, 100, 100, 0, 99, 99},
726 { "博物館", 0, 100, 100, 0, 99, 99},
727 { "博物館", 0, 100, 100, 0, 99, 99},
729 { "Museum", 0, 100, 100, 0, 99, 99},
730 { "Museum", 0, 100, 100, 0, 99, 99},
731 { "Museum", 0, 100, 100, 0, 99, 99},
732 { "Museum", 0, 100, 100, 0, 99, 99},
733 { "Museum", 0, 100, 100, 0, 99, 99},
734 { "Museum", 0, 100, 100, 0, 99, 99},
735 { "Museum", 0, 100, 100, 0, 99, 99},
736 { "Museum", 0, 100, 100, 0, 99, 99},
737 { "Museum", 0, 100, 100, 0, 99, 99},
738 { "Museum", 0, 100, 100, 0, 99, 99},
739 { "Museum", 0, 100, 100, 0, 99, 99},
740 { "Museum", 0, 100, 100, 0, 99, 99},
741 { "Museum", 0, 100, 100, 0, 99, 99},
742 { "Museum", 0, 100, 100, 0, 99, 99},
743 { "Museum", 0, 100, 100, 0, 99, 99},
744 { "Museum", 0, 100, 100, 0, 99, 99},
745 { "Museum", 0, 100, 100, 0, 99, 99},
746 { "Museum", 0, 100, 100, 0, 99, 99},
747 { "Museum", 0, 100, 100, 0, 99, 99},
748 { "Museum", 0, 100, 100, 0, 99, 99},
749 { "Museum", 0, 100, 100, 0, 99, 99},
750 { "Museum", 0, 100, 100, 0, 99, 99},
751 { "Museum", 0, 100, 100, 0, 99, 99},
752 { "Museum", 0, 100, 100, 0, 99, 99},
753 { "Museum", 0, 100, 100, 0, 99, 99},
754 { "Museum", 0, 100, 100, 0, 99, 99},
755 { "Museum", 0, 100, 100, 0, 99, 99},
756 { "Museum", 0, 100, 100, 0, 99, 99},
757 { "Museum", 0, 100, 100, 0, 99, 99},
758 { "Museum", 0, 100, 100, 0, 99, 99},
759 { "Museum", 0, 100, 100, 0, 99, 99},
760 { "Museum", 0, 100, 100, 0, 99, 99},
767 static int cur_store_num = 0;
768 static int store_top = 0;
769 static int store_bottom = 0;
770 static int xtra_stock = 0;
771 static store_type *st_ptr = NULL;
772 static const owner_type *ot_ptr = NULL;
773 static s16b old_town_num = 0;
774 static s16b inner_town_num = 0;
775 #define RUMOR_CHANCE 8
777 #define MAX_COMMENT_1 6
779 static concptr comment_1[MAX_COMMENT_1] =
800 /*! ブラックマーケット追加メッセージ(承諾) */
801 static concptr comment_1_B[MAX_COMMENT_1] = {
810 #define MAX_COMMENT_2A 2
812 static concptr comment_2a[MAX_COMMENT_2A] =
815 "私の忍耐力を試しているのかい? $%s が最後だ。",
816 "我慢にも限度があるぞ。 $%s が最後だ。"
818 "You try my patience. %s is final.",
819 "My patience grows thin. %s is final."
824 #define MAX_COMMENT_2B 12
826 static concptr comment_2b[MAX_COMMENT_2B] =
829 " $%s ぐらいは出さなきゃダメだよ。",
832 "何て奴だ! $%s 以下はあり得ないぞ。",
833 "それじゃ少なすぎる! $%s は欲しいところだ。",
834 "バカにしている! $%s はもらわないと。",
836 "おいおい! $%s を考えてくれないか?",
837 "1000匹のオークのノミに苦しめられるがいい! $%s だ。",
838 "お前の大切なものに災いあれ! $%s でどうだ。",
839 "モルゴスに賞味されるがいい!本当は $%s なんだろう?",
840 "お前の母親はオーガか! $%s は出すつもりなんだろ?"
842 "I can take no less than %s gold pieces.",
843 "I will accept no less than %s gold pieces.",
844 "Ha! No less than %s gold pieces.",
845 "You knave! No less than %s gold pieces.",
846 "That's a pittance! I want %s gold pieces.",
847 "That's an insult! I want %s gold pieces.",
848 "As if! How about %s gold pieces?",
849 "My arse! How about %s gold pieces?",
850 "May the fleas of 1000 orcs molest you! Try %s gold pieces.",
851 "May your most favourite parts go moldy! Try %s gold pieces.",
852 "May Morgoth find you tasty! Perhaps %s gold pieces?",
853 "Your mother was an Ogre! Perhaps %s gold pieces?"
859 /*! ブラックマーケット用追加メッセージ(売るとき) */
860 static concptr comment_2b_B[MAX_COMMENT_2B] = {
861 "いくら俺様がお人好しとはいえ $%s が限界だね。嫌なら帰りな。",
862 "金がないのかい、あんた?まずは家に帰って $%s 揃えてきな。",
863 "物の価値が分からん奴だな。これは $%s が普通なんだよ。",
864 "俺の付けた値段に文句があるのか? $%s が限界だ。",
865 "ひょっとして新手の冗談かい? $%s 持ってないなら帰りな。",
866 "うちは他の店とは違うんだよ。$%s ぐらいは出しな。",
867 "買う気がないなら帰りな。 $%s だと言っているんだ。",
868 "話にならないね。 $%s くらい持っているんだろ?",
869 "は?なんだそりゃ? $%s の間違いか、ひょっとして?",
870 "出口はあっちだよ。それとも $%s 出せるのかい、あんたに。",
871 "命知らずな奴だな。 $%s 出せば今日の所は勘弁してやるよ。",
872 "うちの店は貧乏人お断りだ。 $%s ぐらい出せないのかい?"
875 #define MAX_COMMENT_3A 2
877 static concptr comment_3a[MAX_COMMENT_3A] =
880 "私の忍耐力を試しているのかい? $%s が最後だ。",
881 "我慢にも限度があるぞ。 $%s が最後だ。"
883 "You try my patience. %s is final.",
884 "My patience grows thin. %s is final."
890 #define MAX_COMMENT_3B 12
892 static concptr comment_3b[MAX_COMMENT_3B] =
895 "本音を言うと $%s でいいんだろ?",
897 " $%s ぐらいなら出してもいいが。",
898 " $%s 以上払うなんて考えられないね。",
899 "まあ落ちついて。 $%s でどうだい?",
900 "そのガラクタなら $%s で引き取るよ。",
901 "それじゃ高すぎる! $%s がいいとこだろ。",
902 "どうせいらないんだろ! $%s でいいだろ?",
903 "だめだめ! $%s がずっとお似合いだよ。",
904 "バカにしている! $%s がせいぜいだ。",
905 " $%s なら嬉しいところだがなあ。",
906 " $%s 、それ以上はビタ一文出さないよ!"
908 "Perhaps %s gold pieces?",
909 "How about %s gold pieces?",
910 "I will pay no more than %s gold pieces.",
911 "I can afford no more than %s gold pieces.",
912 "Be reasonable. How about %s gold pieces?",
913 "I'll buy it as scrap for %s gold pieces.",
914 "That is too much! How about %s gold pieces?",
915 "That looks war surplus! Say %s gold pieces?",
916 "Never! %s is more like it.",
917 "That's an insult! %s is more like it.",
918 "%s gold pieces and be thankful for it!",
919 "%s gold pieces and not a copper more!"
925 /*! ブラックマーケット用追加メッセージ(買い取り) */
926 static concptr comment_3b_B[MAX_COMMENT_3B] = {
927 " $%s ってところだね。そのどうしようもないガラクタは。",
928 "この俺が $%s って言っているんだから、その通りにした方が身のためだぞ。",
929 "俺の優しさに甘えるのもいい加減にしておけ。 $%s だ。",
930 "その品なら $%s で売ってくれているがね、常識ある紳士はみんな。",
931 "こりゃまた、がめつい奴だな。いくら俺が温厚とはいえ $%s が限界だ。",
932 " $%s だ。別に俺はそんなガラクタ欲しくはないんだから。",
933 "俺の鑑定額が気に入らないのか? $%s 、嫌なら帰りな。",
934 " $%s で引き取ってやるよ。喜んで受け取りな、貧乏人。",
935 "物の価値が分からん奴は始末におえんな。それは $%s なんだよ。",
936 "そんなに金が欲しいのか、あんた? $%s で満足できんのか?",
937 "入る店間違えてんじゃないのか? $%s で嫌なら他をあたってくれ。",
938 "俺の言い値にケチをつける奴がいるとは! その度胸に免じて $%s だ。"
941 #define MAX_COMMENT_4A 4
943 static concptr comment_4a[MAX_COMMENT_4A] =
946 "もうたくさんだ!何度も私をわずらわせないでくれ!",
947 "うがー!一日の我慢の限度を超えている!",
948 "もういい!時間の無駄以外のなにものでもない!",
949 "もうやってられないよ!顔も見たくない!"
951 "Enough! You have abused me once too often!",
952 "Arghhh! I have had enough abuse for one day!",
953 "That does it! You shall waste my time no more!",
954 "This is getting nowhere! I'm going to Londis!"
960 /*! ブラックマーケット用追加メッセージ(怒りの頂点) */
961 static concptr comment_4a_B[MAX_COMMENT_4A] = {
962 "なめやがって!温厚な俺様でも限界があるってことを知れ!",
963 "俺をここまで怒らせて...命があるだけでもありがたいと思え!",
964 "ふざけてるのか!冷やかしなら相手を見てからにしろ!",
965 "いいかげんにしろ!今度こんなまねしたらただじゃおかねえぞ!"
968 #define MAX_COMMENT_4B 4
970 static concptr comment_4b[MAX_COMMENT_4B] =
979 "Get out of my sight!",
980 "Begone, you scoundrel!",
987 /*! ブラックマーケット用追加メッセージ(追い出し) */
988 static concptr comment_4b_B[MAX_COMMENT_4B] = {
995 #define MAX_COMMENT_5 8
997 static concptr comment_5[MAX_COMMENT_5] =
1011 "You will have to do better than that!",
1012 "Do you wish to do business or not?",
1013 "You've got to be kidding!",
1014 "You'd better be kidding!",
1015 "You try my patience.",
1016 "Hmmm, nice weather we're having."
1022 /*! ブラックマーケット用追加メッセージ(怒り) */
1023 static concptr comment_5_B[MAX_COMMENT_5] = {
1034 #define MAX_COMMENT_6 4
1036 static concptr comment_6[MAX_COMMENT_6] =
1044 "I must have heard you wrong.",
1045 "I'm sorry, I missed that.",
1046 "I'm sorry, what was that?",
1047 "Sorry, what was that again?"
1052 /*** Initialize others ***/
1055 * 店舗で販売するオブジェクトを定義する / Hack -- Objects sold in the stores -- by tval/sval pair.
1057 byte store_table[MAX_STORES][STORE_CHOICES][2] =
1062 { TV_FOOD, SV_FOOD_RATION },
1063 { TV_FOOD, SV_FOOD_RATION },
1064 { TV_FOOD, SV_FOOD_RATION },
1065 { TV_FOOD, SV_FOOD_RATION },
1067 { TV_FOOD, SV_FOOD_RATION },
1068 { TV_FOOD, SV_FOOD_BISCUIT },
1069 { TV_FOOD, SV_FOOD_JERKY },
1070 { TV_FOOD, SV_FOOD_JERKY },
1072 { TV_FOOD, SV_FOOD_PINT_OF_WINE },
1073 { TV_FOOD, SV_FOOD_PINT_OF_ALE },
1074 { TV_LITE, SV_LITE_TORCH },
1075 { TV_LITE, SV_LITE_TORCH },
1077 { TV_LITE, SV_LITE_TORCH },
1078 { TV_LITE, SV_LITE_TORCH },
1079 { TV_LITE, SV_LITE_LANTERN },
1080 { TV_LITE, SV_LITE_LANTERN },
1092 { TV_SHOT, SV_AMMO_NORMAL },
1093 { TV_ARROW, SV_AMMO_NORMAL },
1094 { TV_BOLT, SV_AMMO_NORMAL },
1095 { TV_DIGGING, SV_SHOVEL },
1097 { TV_DIGGING, SV_PICK },
1098 { TV_CLOAK, SV_CLOAK },
1099 { TV_CLOAK, SV_CLOAK },
1100 { TV_CLOAK, SV_FUR_CLOAK },
1102 { TV_FOOD, SV_FOOD_RATION },
1103 { TV_FOOD, SV_FOOD_RATION },
1104 { TV_FOOD, SV_FOOD_RATION },
1105 { TV_FOOD, SV_FOOD_RATION },
1107 { TV_POTION, SV_POTION_WATER },
1108 { TV_POTION, SV_POTION_WATER },
1109 { TV_LITE, SV_LITE_LANTERN },
1110 { TV_LITE, SV_LITE_LANTERN },
1112 { TV_FOOD, SV_FOOD_WAYBREAD },
1113 { TV_FOOD, SV_FOOD_WAYBREAD },
1117 { TV_SHOT, SV_AMMO_NORMAL },
1118 { TV_ARROW, SV_AMMO_NORMAL },
1119 { TV_BOLT, SV_AMMO_NORMAL },
1120 { TV_DIGGING, SV_SHOVEL }
1126 { TV_BOOTS, SV_PAIR_OF_SOFT_LEATHER_BOOTS },
1127 { TV_BOOTS, SV_PAIR_OF_SOFT_LEATHER_BOOTS },
1128 { TV_BOOTS, SV_PAIR_OF_HARD_LEATHER_BOOTS },
1129 { TV_BOOTS, SV_PAIR_OF_HARD_LEATHER_BOOTS },
1131 { TV_HELM, SV_HARD_LEATHER_CAP },
1132 { TV_HELM, SV_HARD_LEATHER_CAP },
1133 { TV_HELM, SV_METAL_CAP },
1134 { TV_HELM, SV_IRON_HELM },
1136 { TV_SOFT_ARMOR, SV_ROBE },
1137 { TV_SOFT_ARMOR, SV_ROBE },
1138 { TV_SOFT_ARMOR, SV_SOFT_LEATHER_ARMOR },
1139 { TV_SOFT_ARMOR, SV_SOFT_LEATHER_ARMOR },
1141 { TV_SOFT_ARMOR, SV_HARD_LEATHER_ARMOR },
1142 { TV_SOFT_ARMOR, SV_HARD_LEATHER_ARMOR },
1143 { TV_SOFT_ARMOR, SV_HARD_STUDDED_LEATHER },
1144 { TV_SOFT_ARMOR, SV_HARD_STUDDED_LEATHER },
1146 { TV_SOFT_ARMOR, SV_RHINO_HIDE_ARMOR },
1147 { TV_SOFT_ARMOR, SV_LEATHER_SCALE_MAIL },
1148 { TV_HARD_ARMOR, SV_METAL_SCALE_MAIL },
1149 { TV_HARD_ARMOR, SV_CHAIN_MAIL },
1151 { TV_HARD_ARMOR, SV_DOUBLE_RING_MAIL },
1152 { TV_HARD_ARMOR, SV_AUGMENTED_CHAIN_MAIL },
1153 { TV_HARD_ARMOR, SV_BAR_CHAIN_MAIL },
1154 { TV_HARD_ARMOR, SV_DOUBLE_CHAIN_MAIL },
1156 { TV_HARD_ARMOR, SV_METAL_BRIGANDINE_ARMOUR },
1157 { TV_HARD_ARMOR, SV_SPLINT_MAIL },
1158 { TV_GLOVES, SV_SET_OF_LEATHER_GLOVES },
1159 { TV_GLOVES, SV_SET_OF_LEATHER_GLOVES },
1161 { TV_GLOVES, SV_SET_OF_GAUNTLETS },
1162 { TV_SHIELD, SV_SMALL_LEATHER_SHIELD },
1163 { TV_SHIELD, SV_LARGE_LEATHER_SHIELD },
1164 { TV_SHIELD, SV_SMALL_METAL_SHIELD },
1166 { TV_BOOTS, SV_PAIR_OF_HARD_LEATHER_BOOTS },
1167 { TV_BOOTS, SV_PAIR_OF_HARD_LEATHER_BOOTS },
1168 { TV_HELM, SV_HARD_LEATHER_CAP },
1169 { TV_HELM, SV_HARD_LEATHER_CAP },
1171 { TV_SOFT_ARMOR, SV_ROBE },
1172 { TV_SOFT_ARMOR, SV_SOFT_LEATHER_ARMOR },
1173 { TV_SOFT_ARMOR, SV_SOFT_LEATHER_ARMOR },
1174 { TV_SOFT_ARMOR, SV_HARD_LEATHER_ARMOR },
1176 { TV_SOFT_ARMOR, SV_LEATHER_JACK },
1177 { TV_HARD_ARMOR, SV_METAL_SCALE_MAIL },
1178 { TV_HARD_ARMOR, SV_CHAIN_MAIL },
1179 { TV_HARD_ARMOR, SV_CHAIN_MAIL },
1181 { TV_GLOVES, SV_SET_OF_LEATHER_GLOVES },
1182 { TV_GLOVES, SV_SET_OF_GAUNTLETS },
1183 { TV_SHIELD, SV_SMALL_LEATHER_SHIELD },
1184 { TV_SHIELD, SV_SMALL_LEATHER_SHIELD }
1190 { TV_SWORD, SV_DAGGER },
1191 { TV_SWORD, SV_MAIN_GAUCHE },
1192 { TV_SWORD, SV_RAPIER },
1193 { TV_SWORD, SV_SMALL_SWORD },
1195 { TV_SWORD, SV_SHORT_SWORD },
1196 { TV_SWORD, SV_SABRE },
1197 { TV_SWORD, SV_CUTLASS },
1198 { TV_SWORD, SV_TULWAR },
1200 { TV_SWORD, SV_BROAD_SWORD },
1201 { TV_SWORD, SV_LONG_SWORD },
1202 { TV_SWORD, SV_SCIMITAR },
1203 { TV_SWORD, SV_KATANA },
1205 { TV_SWORD, SV_BASTARD_SWORD },
1206 { TV_POLEARM, SV_SPEAR },
1207 { TV_POLEARM, SV_AWL_PIKE },
1208 { TV_POLEARM, SV_TRIDENT },
1210 { TV_POLEARM, SV_PIKE },
1211 { TV_POLEARM, SV_BEAKED_AXE },
1212 { TV_POLEARM, SV_BROAD_AXE },
1213 { TV_POLEARM, SV_LANCE },
1215 { TV_POLEARM, SV_BATTLE_AXE },
1216 { TV_POLEARM, SV_HATCHET },
1217 { TV_BOW, SV_SLING },
1218 { TV_BOW, SV_SHORT_BOW },
1220 { TV_BOW, SV_LIGHT_XBOW },
1221 { TV_SHOT, SV_AMMO_NORMAL },
1222 { TV_SHOT, SV_AMMO_NORMAL },
1223 { TV_ARROW, SV_AMMO_NORMAL },
1225 { TV_ARROW, SV_AMMO_NORMAL },
1226 { TV_BOLT, SV_AMMO_NORMAL },
1227 { TV_BOLT, SV_AMMO_NORMAL },
1228 { TV_BOW, SV_LIGHT_XBOW },
1230 { TV_ARROW, SV_AMMO_NORMAL },
1231 { TV_BOLT, SV_AMMO_NORMAL },
1232 { TV_BOW, SV_SHORT_BOW },
1233 { TV_BOW, SV_LIGHT_XBOW },
1235 { TV_SWORD, SV_DAGGER },
1236 { TV_SWORD, SV_TANTO },
1237 { TV_SWORD, SV_RAPIER },
1238 { TV_SWORD, SV_SMALL_SWORD },
1240 { TV_SWORD, SV_SHORT_SWORD },
1241 { TV_SWORD, SV_LONG_SWORD },
1242 { TV_SWORD, SV_SCIMITAR },
1243 { TV_SWORD, SV_BROAD_SWORD },
1245 { TV_HISSATSU_BOOK, 0 },
1246 { TV_HISSATSU_BOOK, 0 },
1247 { TV_HISSATSU_BOOK, 1 },
1248 { TV_HISSATSU_BOOK, 1 },
1254 { TV_HAFTED, SV_NUNCHAKU },
1255 { TV_HAFTED, SV_QUARTERSTAFF },
1256 { TV_HAFTED, SV_MACE },
1257 { TV_HAFTED, SV_BO_STAFF },
1259 { TV_HAFTED, SV_WAR_HAMMER },
1260 { TV_HAFTED, SV_WAR_HAMMER },
1261 { TV_HAFTED, SV_MORNING_STAR },
1262 { TV_HAFTED, SV_FLAIL },
1264 { TV_HAFTED, SV_LEAD_FILLED_MACE },
1265 { TV_SCROLL, SV_SCROLL_REMOVE_CURSE },
1266 { TV_SCROLL, SV_SCROLL_BLESSING },
1267 { TV_SCROLL, SV_SCROLL_HOLY_CHANT },
1269 { TV_POTION, SV_POTION_HEROISM },
1270 { TV_SCROLL, SV_SCROLL_WORD_OF_RECALL },
1271 { TV_SCROLL, SV_SCROLL_WORD_OF_RECALL },
1272 { TV_SCROLL, SV_SCROLL_WORD_OF_RECALL },
1274 { TV_POTION, SV_POTION_CURE_LIGHT },
1275 { TV_POTION, SV_POTION_CURE_SERIOUS },
1276 { TV_POTION, SV_POTION_CURE_SERIOUS },
1277 { TV_POTION, SV_POTION_CURE_CRITICAL },
1279 { TV_POTION, SV_POTION_CURE_CRITICAL },
1280 { TV_POTION, SV_POTION_RESTORE_EXP },
1281 { TV_POTION, SV_POTION_RESTORE_EXP },
1282 { TV_POTION, SV_POTION_RESTORE_EXP },
1284 { TV_LIFE_BOOK, 0 },
1285 { TV_LIFE_BOOK, 0 },
1286 { TV_LIFE_BOOK, 1 },
1287 { TV_LIFE_BOOK, 1 },
1289 { TV_CRUSADE_BOOK, 0 },
1290 { TV_CRUSADE_BOOK, 0 },
1291 { TV_CRUSADE_BOOK, 1 },
1292 { TV_CRUSADE_BOOK, 1 },
1294 { TV_HAFTED, SV_WHIP },
1295 { TV_HAFTED, SV_MACE },
1296 { TV_HAFTED, SV_BALL_AND_CHAIN },
1297 { TV_HAFTED, SV_WAR_HAMMER },
1299 { TV_SCROLL, SV_SCROLL_WORD_OF_RECALL },
1300 { TV_SCROLL, SV_SCROLL_WORD_OF_RECALL },
1301 { TV_SCROLL, SV_SCROLL_WORD_OF_RECALL },
1302 { TV_POTION, SV_POTION_CURE_CRITICAL },
1304 { TV_POTION, SV_POTION_CURE_CRITICAL },
1305 { TV_POTION, SV_POTION_RESTORE_EXP },
1308 { TV_STATUE, SV_ANY },
1310 { TV_SCROLL, SV_SCROLL_REMOVE_CURSE },
1311 { TV_SCROLL, SV_SCROLL_REMOVE_CURSE },
1312 { TV_SCROLL, SV_SCROLL_STAR_REMOVE_CURSE },
1313 { TV_SCROLL, SV_SCROLL_STAR_REMOVE_CURSE }
1319 { TV_SCROLL, SV_SCROLL_ENCHANT_WEAPON_TO_HIT },
1320 { TV_SCROLL, SV_SCROLL_ENCHANT_WEAPON_TO_DAM },
1321 { TV_SCROLL, SV_SCROLL_ENCHANT_ARMOR },
1322 { TV_SCROLL, SV_SCROLL_IDENTIFY },
1324 { TV_SCROLL, SV_SCROLL_IDENTIFY },
1325 { TV_SCROLL, SV_SCROLL_IDENTIFY },
1326 { TV_SCROLL, SV_SCROLL_IDENTIFY },
1327 { TV_SCROLL, SV_SCROLL_LIGHT },
1329 { TV_SCROLL, SV_SCROLL_PHASE_DOOR },
1330 { TV_SCROLL, SV_SCROLL_PHASE_DOOR },
1331 { TV_SCROLL, SV_SCROLL_TELEPORT },
1332 { TV_SCROLL, SV_SCROLL_MONSTER_CONFUSION },
1334 { TV_SCROLL, SV_SCROLL_MAPPING },
1335 { TV_SCROLL, SV_SCROLL_DETECT_GOLD },
1336 { TV_SCROLL, SV_SCROLL_DETECT_ITEM },
1337 { TV_SCROLL, SV_SCROLL_DETECT_TRAP },
1339 { TV_SCROLL, SV_SCROLL_DETECT_INVIS },
1340 { TV_SCROLL, SV_SCROLL_RECHARGING },
1341 { TV_SCROLL, SV_SCROLL_TELEPORT },
1342 { TV_SCROLL, SV_SCROLL_WORD_OF_RECALL },
1344 { TV_SCROLL, SV_SCROLL_WORD_OF_RECALL },
1345 { TV_SCROLL, SV_SCROLL_WORD_OF_RECALL },
1346 { TV_SCROLL, SV_SCROLL_WORD_OF_RECALL },
1347 { TV_SCROLL, SV_SCROLL_TELEPORT },
1349 { TV_SCROLL, SV_SCROLL_TELEPORT },
1350 { TV_POTION, SV_POTION_RES_STR },
1351 { TV_POTION, SV_POTION_RES_INT },
1352 { TV_POTION, SV_POTION_RES_WIS },
1354 { TV_POTION, SV_POTION_RES_DEX },
1355 { TV_POTION, SV_POTION_RES_CON },
1356 { TV_POTION, SV_POTION_RES_CHR },
1357 { TV_SCROLL, SV_SCROLL_IDENTIFY },
1359 { TV_SCROLL, SV_SCROLL_IDENTIFY },
1360 { TV_SCROLL, SV_SCROLL_STAR_IDENTIFY }, /* Yep, occasionally! */
1361 { TV_SCROLL, SV_SCROLL_STAR_IDENTIFY },
1362 { TV_SCROLL, SV_SCROLL_LIGHT },
1364 { TV_POTION, SV_POTION_RES_STR },
1365 { TV_POTION, SV_POTION_RES_INT },
1366 { TV_POTION, SV_POTION_RES_WIS },
1367 { TV_POTION, SV_POTION_RES_DEX },
1369 { TV_POTION, SV_POTION_RES_CON },
1370 { TV_POTION, SV_POTION_RES_CHR },
1371 { TV_SCROLL, SV_SCROLL_ENCHANT_ARMOR },
1372 { TV_SCROLL, SV_SCROLL_ENCHANT_ARMOR },
1374 { TV_SCROLL, SV_SCROLL_RECHARGING },
1375 { TV_SCROLL, SV_SCROLL_PHASE_DOOR },
1376 { TV_SCROLL, SV_SCROLL_ENCHANT_WEAPON_TO_HIT },
1377 { TV_SCROLL, SV_SCROLL_ENCHANT_WEAPON_TO_DAM },
1382 /* Magic-User store */
1384 { TV_RING, SV_RING_PROTECTION },
1385 { TV_RING, SV_RING_LEVITATION_FALL },
1386 { TV_RING, SV_RING_PROTECTION },
1387 { TV_RING, SV_RING_RESIST_FIRE },
1389 { TV_RING, SV_RING_RESIST_COLD },
1390 { TV_AMULET, SV_AMULET_CHARISMA },
1391 { TV_RING, SV_RING_WARNING },
1392 { TV_AMULET, SV_AMULET_RESIST_ACID },
1394 { TV_AMULET, SV_AMULET_SEARCHING },
1395 { TV_WAND, SV_WAND_SLOW_MONSTER },
1396 { TV_WAND, SV_WAND_CONFUSE_MONSTER },
1397 { TV_WAND, SV_WAND_SLEEP_MONSTER },
1399 { TV_WAND, SV_WAND_MAGIC_MISSILE },
1400 { TV_WAND, SV_WAND_STINKING_CLOUD },
1401 { TV_WAND, SV_WAND_WONDER },
1402 { TV_WAND, SV_WAND_DISARMING },
1404 { TV_STAFF, SV_STAFF_LITE },
1405 { TV_STAFF, SV_STAFF_MAPPING },
1406 { TV_STAFF, SV_STAFF_DETECT_TRAP },
1407 { TV_STAFF, SV_STAFF_DETECT_DOOR },
1409 { TV_STAFF, SV_STAFF_DETECT_GOLD },
1410 { TV_STAFF, SV_STAFF_DETECT_ITEM },
1411 { TV_STAFF, SV_STAFF_DETECT_INVIS },
1412 { TV_STAFF, SV_STAFF_DETECT_EVIL },
1414 { TV_STAFF, SV_STAFF_TELEPORTATION },
1415 { TV_STAFF, SV_STAFF_TELEPORTATION },
1416 { TV_STAFF, SV_STAFF_TELEPORTATION },
1417 { TV_STAFF, SV_STAFF_TELEPORTATION },
1419 { TV_STAFF, SV_STAFF_IDENTIFY },
1420 { TV_STAFF, SV_STAFF_IDENTIFY },
1421 { TV_STAFF, SV_STAFF_IDENTIFY },
1423 { TV_STAFF, SV_STAFF_IDENTIFY },
1424 { TV_STAFF, SV_STAFF_REMOVE_CURSE },
1425 { TV_STAFF, SV_STAFF_CURE_LIGHT },
1426 { TV_STAFF, SV_STAFF_PROBING },
1430 { TV_SORCERY_BOOK, 0 },
1431 { TV_SORCERY_BOOK, 0 },
1432 { TV_SORCERY_BOOK, 1 },
1433 { TV_SORCERY_BOOK, 1 },
1435 { TV_ARCANE_BOOK, 0 },
1436 { TV_ARCANE_BOOK, 0 },
1437 { TV_ARCANE_BOOK, 1 },
1438 { TV_ARCANE_BOOK, 1 },
1440 { TV_ARCANE_BOOK, 2 },
1441 { TV_ARCANE_BOOK, 2 },
1442 { TV_ARCANE_BOOK, 3 },
1443 { TV_ARCANE_BOOK, 3 },
1448 /* Black Market (unused) */
1521 { TV_SORCERY_BOOK, 0 },
1522 { TV_SORCERY_BOOK, 0 },
1523 { TV_SORCERY_BOOK, 1 },
1524 { TV_SORCERY_BOOK, 1 },
1526 { TV_NATURE_BOOK, 0 },
1527 { TV_NATURE_BOOK, 0 },
1528 { TV_NATURE_BOOK, 1 },
1529 { TV_NATURE_BOOK, 1 },
1531 { TV_CHAOS_BOOK, 0 },
1532 { TV_CHAOS_BOOK, 0 },
1533 { TV_CHAOS_BOOK, 1 },
1534 { TV_CHAOS_BOOK, 1 },
1536 { TV_DEATH_BOOK, 0 },
1537 { TV_DEATH_BOOK, 0 },
1538 { TV_DEATH_BOOK, 1 },
1539 { TV_DEATH_BOOK, 1 },
1541 { TV_TRUMP_BOOK, 0 }, /* +16 */
1542 { TV_TRUMP_BOOK, 0 },
1543 { TV_TRUMP_BOOK, 1 },
1544 { TV_TRUMP_BOOK, 1 },
1546 { TV_ARCANE_BOOK, 0 },
1547 { TV_ARCANE_BOOK, 1 },
1548 { TV_ARCANE_BOOK, 2 },
1549 { TV_ARCANE_BOOK, 3 },
1551 { TV_CRAFT_BOOK, 0 },
1552 { TV_CRAFT_BOOK, 0 },
1553 { TV_CRAFT_BOOK, 1 },
1554 { TV_CRAFT_BOOK, 1 },
1556 { TV_DAEMON_BOOK, 0 },
1557 { TV_DAEMON_BOOK, 0 },
1558 { TV_DAEMON_BOOK, 1 },
1559 { TV_DAEMON_BOOK, 1 },
1561 { TV_MUSIC_BOOK, 0 },
1562 { TV_MUSIC_BOOK, 0 },
1563 { TV_MUSIC_BOOK, 1 },
1564 { TV_MUSIC_BOOK, 1 },
1573 /* Museum (unused) */
1612 * @brief 取引成功時の店主のメッセージ処理 /
1613 * Successful haggle.
1616 static void say_comment_1(void)
1619 /* ブラックマーケットのときは別のメッセージを出す */
1620 if ( cur_store_num == STORE_BLACK ) {
1621 msg_print(comment_1_B[randint0(MAX_COMMENT_1)]);
1624 msg_print(comment_1[randint0(MAX_COMMENT_1)]);
1627 msg_print(comment_1[randint0(MAX_COMMENT_1)]);
1631 if (one_in_(RUMOR_CHANCE))
1634 msg_print("店主は耳うちした:");
1636 msg_print("The shopkeeper whispers something into your ear:");
1638 display_rumor(TRUE);
1644 * @brief プレイヤーがアイテムを買う時の価格代案メッセージ処理 /
1645 * Continue haggling (player is buying)
1646 * @param value 店主の提示価格
1647 * @param annoyed 店主のいらつき度
1650 static void say_comment_2(PRICE value, int annoyed)
1654 /* Prepare a string to insert */
1655 sprintf(tmp_val, "%ld", (long)value);
1660 /* Formatted message */
1661 msg_format(comment_2a[randint0(MAX_COMMENT_2A)], tmp_val);
1667 /* Formatted message */
1669 /* ブラックマーケットの時は別のメッセージを出す */
1670 if ( cur_store_num == STORE_BLACK ){
1671 msg_format(comment_2b_B[randint0(MAX_COMMENT_2B)], tmp_val);
1674 msg_format(comment_2b[randint0(MAX_COMMENT_2B)], tmp_val);
1677 msg_format(comment_2b[randint0(MAX_COMMENT_2B)], tmp_val);
1685 * @brief プレイヤーがアイテムを売る時の価格代案メッセージ処理 /
1686 * Continue haggling (player is selling)
1687 * @param value 店主の提示価格
1688 * @param annoyed 店主のいらつき度
1691 static void say_comment_3(PRICE value, int annoyed)
1695 /* Prepare a string to insert */
1696 sprintf(tmp_val, "%ld", (long)value);
1701 /* Formatted message */
1702 msg_format(comment_3a[randint0(MAX_COMMENT_3A)], tmp_val);
1708 /* Formatted message */
1710 /* ブラックマーケットの時は別のメッセージを出す */
1711 if ( cur_store_num == STORE_BLACK ){
1712 msg_format(comment_3b_B[randint0(MAX_COMMENT_3B)], tmp_val);
1715 msg_format(comment_3b[randint0(MAX_COMMENT_3B)], tmp_val);
1718 msg_format(comment_3b[randint0(MAX_COMMENT_3B)], tmp_val);
1726 * @brief 店主がプレイヤーを追い出す時のメッセージ処理 /
1727 * Kick 'da bum out. -RAK-
1730 static void say_comment_4(void)
1733 /* ブラックマーケットの時は別のメッセージを出す */
1734 if ( cur_store_num == STORE_BLACK ){
1735 msg_print(comment_4a_B[randint0(MAX_COMMENT_4A)]);
1736 msg_print(comment_4b_B[randint0(MAX_COMMENT_4B)]);
1739 msg_print(comment_4a[randint0(MAX_COMMENT_4A)]);
1740 msg_print(comment_4b[randint0(MAX_COMMENT_4B)]);
1743 msg_print(comment_4a[randint0(MAX_COMMENT_4A)]);
1744 msg_print(comment_4b[randint0(MAX_COMMENT_4B)]);
1751 * @brief 店主がプレイヤーに取り合わない時のメッセージ処理 /
1752 * You are insulting me
1755 static void say_comment_5(void)
1758 /* ブラックマーケットの時は別のメッセージを出す */
1759 if ( cur_store_num == STORE_BLACK ){
1760 msg_print(comment_5_B[randint0(MAX_COMMENT_5)]);
1763 msg_print(comment_5[randint0(MAX_COMMENT_5)]);
1766 msg_print(comment_5[randint0(MAX_COMMENT_5)]);
1773 * @brief 店主がプレイヤーの提示を理解できなかった時のメッセージ処理 /
1774 * That makes no sense.
1777 static void say_comment_6(void)
1779 msg_print(comment_6[randint0(MAX_COMMENT_6)]);
1783 #define MAX_COMMENT_7A 4
1785 static concptr comment_7a[MAX_COMMENT_7A] =
1790 "誰かがむせび泣く声が聞こえる...。",
1795 "You hear someone sobbing...",
1796 "The shopkeeper howls in agony!"
1801 #define MAX_COMMENT_7B 4
1803 static concptr comment_7b[MAX_COMMENT_7B] =
1813 "The shopkeeper curses at you.",
1814 "The shopkeeper glares at you."
1819 #define MAX_COMMENT_7C 4
1821 static concptr comment_7c[MAX_COMMENT_7C] =
1830 "You've made my day!",
1831 "The shopkeeper giggles.",
1832 "The shopkeeper laughs loudly."
1837 #define MAX_COMMENT_7D 4
1839 static concptr comment_7d[MAX_COMMENT_7D] =
1843 "こんなおいしい思いをしたら、真面目に働けなくなるなぁ。",
1848 "I think I'll retire!",
1849 "The shopkeeper jumps for joy.",
1850 "The shopkeeper smiles gleefully."
1857 * @brief 店主が交渉を終えた際の反応を返す処理 /
1858 * Let a shop-keeper React to a purchase
1859 * @param price アイテムの取引額
1860 * @param value アイテムの実際価値
1861 * @param guess 店主が当初予想していた価値
1864 * We paid "price", it was worth "value", and we thought it was worth "guess"
1866 static void purchase_analyze(PRICE price, PRICE value, PRICE guess)
1868 /* Item was worthless, but we bought it */
1869 if ((value <= 0) && (price > value))
1871 msg_print(comment_7a[randint0(MAX_COMMENT_7A)]);
1872 chg_virtue(V_HONOUR, -1);
1873 chg_virtue(V_JUSTICE, -1);
1874 sound(SOUND_STORE1);
1877 /* Item was cheaper than we thought, and we paid more than necessary */
1878 else if ((value < guess) && (price > value))
1880 msg_print(comment_7b[randint0(MAX_COMMENT_7B)]);
1881 chg_virtue(V_JUSTICE, -1);
1882 if (one_in_(4)) chg_virtue(V_HONOUR, -1);
1883 sound(SOUND_STORE2);
1886 /* Item was a good bargain, and we got away with it */
1887 else if ((value > guess) && (value < (4 * guess)) && (price < value))
1889 msg_print(comment_7c[randint0(MAX_COMMENT_7C)]);
1890 if (one_in_(4)) chg_virtue(V_HONOUR, -1);
1891 else if (one_in_(4)) chg_virtue(V_HONOUR, 1);
1892 sound(SOUND_STORE3);
1895 /* Item was a great bargain, and we got away with it */
1896 else if ((value > guess) && (price < value))
1898 msg_print(comment_7d[randint0(MAX_COMMENT_7D)]);
1899 if (one_in_(2)) chg_virtue(V_HONOUR, -1);
1900 if (one_in_(4)) chg_virtue(V_HONOUR, 1);
1901 if (10 * price < value) chg_virtue(V_SACRIFICE, 1);
1902 sound(SOUND_STORE4);
1909 * We store the current "store feat" here so everyone can access it
1911 static int cur_store_feat;
1915 * Buying and selling adjustments for race combinations.
1916 * Entry[owner][player] gives the basic "cost inflation".
1918 static byte rgold_adj[MAX_RACES][MAX_RACES] =
1920 /*Hum, HfE, Elf, Hal, Gno, Dwa, HfO, HfT, Dun, HiE, Barbarian,
1921 HfOg, HGn, HTn, Cyc, Yek, Klc, Kbd, Nbl, DkE, Drc, Mind Flayer,
1922 Imp, Glm, Skl, Zombie, Vampire, Spectre, Fairy, Beastman, Ent,
1923 Angel, Demon, Kutar, Android, Merfolk */
1926 { 100, 105, 105, 110, 113, 115, 120, 125, 100, 105, 100,
1927 124, 120, 110, 125, 115, 120, 120, 120, 120, 115, 120,
1928 115, 105, 125, 125, 125, 125, 105, 120, 105, 95, 140,
1929 100, 120, 110, 105, 110 },
1932 { 110, 100, 100, 105, 110, 120, 125, 130, 110, 100, 110,
1933 120, 115, 108, 115, 110, 110, 120, 120, 115, 115, 110,
1934 120, 110, 110, 110, 120, 110, 100, 125, 100, 95, 140,
1935 110, 115, 110, 110, 110 },
1938 { 110, 105, 100, 105, 110, 120, 125, 130, 110, 100, 110,
1939 120, 120, 105, 120, 110, 105, 125, 125, 110, 115, 108,
1940 120, 115, 110, 110, 120, 110, 100, 125, 100, 95, 140,
1941 110, 110, 105, 110, 110 },
1944 { 115, 110, 105, 95, 105, 110, 115, 130, 115, 105, 115,
1945 125, 120, 120, 125, 115, 110, 120, 120, 120, 115, 115,
1946 120, 110, 120, 120, 130, 110, 110, 130, 110, 95, 140,
1947 115, 120, 105, 115, 105 },
1950 { 115, 115, 110, 105, 95, 110, 115, 130, 115, 110, 115,
1951 120, 125, 110, 120, 110, 105, 120, 110, 110, 105, 110,
1952 120, 101, 110, 110, 120, 120, 115, 130, 115, 95, 140,
1953 115, 110, 110, 115, 110 },
1956 { 115, 120, 120, 110, 110, 95, 125, 135, 115, 120, 115,
1957 125, 140, 130, 130, 120, 115, 115, 115, 135, 125, 120,
1958 120, 105, 115, 115, 115, 115, 120, 130, 120, 95, 140,
1959 115, 110, 115, 115, 120 },
1962 { 115, 120, 125, 115, 115, 130, 110, 115, 115, 125, 115,
1963 110, 110, 120, 110, 120, 125, 115, 115, 110, 120, 110,
1964 115, 125, 120, 120, 115, 120, 125, 115, 125, 95, 140,
1965 115, 110, 115, 115, 125 },
1968 { 110, 115, 115, 110, 110, 130, 110, 110, 110, 115, 110,
1969 110, 115, 120, 110, 120, 120, 110, 110, 110, 115, 110,
1970 110, 115, 112, 112, 115, 112, 120, 110, 120, 95, 140,
1971 110, 110, 115, 110, 130 },
1974 { 100, 105, 105, 110, 113, 115, 120, 125, 100, 105, 100,
1975 120, 120, 105, 120, 115, 105, 115, 120, 110, 105, 105,
1976 120, 105, 120, 120, 125, 120, 105, 135, 105, 95, 140,
1977 100, 110, 110, 100, 110 },
1980 { 110, 105, 100, 105, 110, 120, 125, 130, 110, 100, 110,
1981 125, 125, 101, 120, 115, 110, 115, 125, 110, 110, 110,
1982 125, 115, 120, 120, 125, 120, 100, 125, 100, 95, 140,
1983 110, 110, 105, 110, 110 },
1985 /* Human / Barbarian (copied from human) */
1986 { 100, 105, 105, 110, 113, 115, 120, 125, 100, 105, 100,
1987 124, 120, 110, 125, 115, 120, 120, 120, 120, 115, 120,
1988 115, 105, 125, 125, 130, 125, 115, 120, 115, 95, 140,
1989 100, 120, 110, 100, 110 },
1991 /* Half-Ogre: theoretical, copied from half-troll */
1992 { 110, 115, 115, 110, 110, 130, 110, 110, 110, 115, 110,
1993 110, 115, 120, 110, 120, 120, 110, 110, 110, 115, 110,
1994 110, 115, 112, 112, 115, 112, 120, 110, 120, 95, 140,
1995 110, 110, 115, 110, 120 },
1997 /* Half-Giant: theoretical, copied from half-troll */
1998 { 110, 115, 115, 110, 110, 130, 110, 110, 110, 115, 110,
1999 110, 115, 120, 110, 120, 120, 110, 110, 110, 115, 110,
2000 110, 115, 112, 112, 115, 112, 130, 120, 130, 95, 140,
2001 110, 110, 115, 110, 115 },
2003 /* Half-Titan: theoretical, copied from High_Elf */
2004 { 110, 105, 100, 105, 110, 120, 125, 130, 110, 100, 110,
2005 125, 125, 101, 120, 115, 110, 115, 125, 110, 110, 110,
2006 125, 115, 120, 120, 120, 120, 130, 130, 130, 95, 140,
2007 110, 110, 115, 110, 108 },
2009 /* Cyclops: theoretical, copied from half-troll */
2010 { 110, 115, 115, 110, 110, 130, 110, 110, 110, 115, 110,
2011 110, 115, 120, 110, 120, 120, 110, 110, 110, 115, 110,
2012 110, 115, 112, 112, 115, 112, 130, 130, 130, 95, 140,
2013 110, 110, 115, 110, 115 },
2015 /* Yeek: theoretical, copied from Half-Orc */
2016 { 115, 120, 125, 115, 115, 130, 110, 115, 115, 125, 115,
2017 110, 110, 120, 110, 120, 125, 115, 115, 110, 120, 110,
2018 115, 125, 120, 120, 120, 120, 130, 130, 130, 95, 140,
2019 115, 110, 115, 115, 110 },
2021 /* Klackon: theoretical, copied from Gnome */
2022 { 115, 115, 110, 105, 95, 110, 115, 130, 115, 110, 115,
2023 120, 125, 110, 120, 110, 105, 120, 110, 110, 105, 110,
2024 120, 101, 110, 110, 120, 120, 130, 130, 130, 95, 140,
2025 115, 110, 115, 115, 110 },
2027 /* Kobold: theoretical, copied from Half-Orc */
2028 { 115, 120, 125, 115, 115, 130, 110, 115, 115, 125, 115,
2029 110, 110, 120, 110, 120, 125, 115, 115, 110, 120, 110,
2030 115, 125, 120, 120, 120, 120, 130, 130, 130, 95, 140,
2031 115, 110, 115, 115, 120 },
2033 /* Nibelung: theoretical, copied from Dwarf */
2034 { 115, 120, 120, 110, 110, 95, 125, 135, 115, 120, 115,
2035 125, 140, 130, 130, 120, 115, 115, 115, 135, 125, 120,
2036 120, 105, 115, 115, 120, 120, 130, 130, 130, 95, 140,
2037 115, 135, 115, 115, 120 },
2040 { 110, 110, 110, 115, 120, 130, 115, 115, 120, 110, 115,
2041 115, 115, 116, 115, 120, 120, 115, 115, 101, 110, 110,
2042 110, 110, 112, 122, 110, 110, 110, 115, 110, 120, 120,
2043 110, 101, 115, 110, 115 },
2045 /* Draconian: theoretical, copied from High_Elf */
2046 { 110, 105, 100, 105, 110, 120, 125, 130, 110, 100, 110,
2047 125, 125, 101, 120, 115, 110, 115, 125, 110, 110, 110,
2048 125, 115, 120, 120, 120, 120, 130, 130, 130, 95, 140,
2049 110, 110, 115, 110, 115 },
2051 /* Mind Flayer: theoretical, copied from High_Elf */
2052 { 110, 105, 100, 105, 110, 120, 125, 130, 110, 100, 110,
2053 125, 125, 101, 120, 115, 110, 115, 125, 110, 110, 110,
2054 125, 115, 120, 120, 120, 120, 130, 130, 130, 95, 140,
2055 110, 110, 115, 110, 110 },
2057 /* Imp: theoretical, copied from High_Elf */
2058 { 110, 105, 100, 105, 110, 120, 125, 130, 110, 100, 110,
2059 125, 125, 101, 120, 115, 110, 115, 125, 110, 110, 110,
2060 125, 115, 120, 120, 120, 120, 130, 130, 130, 120, 120,
2061 110, 110, 115, 110, 120 },
2063 /* Golem: theoretical, copied from High_Elf */
2064 { 110, 105, 100, 105, 110, 120, 125, 130, 110, 100, 110,
2065 125, 125, 101, 120, 115, 110, 115, 125, 110, 110, 110,
2066 125, 115, 120, 120, 120, 120, 130, 130, 130, 95, 140,
2067 110, 110, 115, 110, 110 },
2069 /* Skeleton: theoretical, copied from half-orc */
2070 { 115, 120, 125, 115, 115, 130, 110, 115, 115, 125, 115,
2071 110, 110, 120, 110, 120, 125, 115, 115, 110, 120, 110,
2072 115, 125, 120, 120, 120, 120, 130, 130, 130, 120, 120,
2073 115, 110, 125, 115, 110 },
2075 /* Zombie: Theoretical, copied from half-orc */
2076 { 115, 120, 125, 115, 115, 130, 110, 115, 115, 125, 115,
2077 110, 110, 120, 110, 120, 125, 115, 115, 110, 120, 110,
2078 115, 125, 120, 120, 120, 120, 130, 130, 130, 120, 120,
2079 115, 110, 125, 115, 110 },
2081 /* Vampire: Theoretical, copied from half-orc */
2082 { 115, 120, 125, 115, 115, 130, 110, 115, 115, 125, 115,
2083 110, 110, 120, 110, 120, 125, 115, 115, 110, 120, 110,
2084 115, 125, 120, 120, 120, 120, 130, 130, 130, 120, 120,
2085 115, 110, 125, 115, 120 },
2087 /* Spectre: Theoretical, copied from half-orc */
2088 { 115, 120, 125, 115, 115, 130, 110, 115, 115, 125, 115,
2089 110, 110, 120, 110, 120, 125, 115, 115, 110, 120, 110,
2090 115, 125, 120, 120, 120, 120, 130, 130, 130, 120, 120,
2091 115, 110, 125, 115, 110 },
2093 /* Sprite: Theoretical, copied from half-orc */
2094 { 115, 120, 125, 115, 115, 130, 110, 115, 115, 125, 115,
2095 110, 110, 120, 110, 120, 125, 115, 115, 110, 120, 110,
2096 115, 125, 120, 120, 120, 120, 130, 130, 130, 95, 140,
2097 115, 110, 105, 115, 110 },
2099 /* Beastman: Theoretical, copied from half-orc */
2100 { 115, 120, 125, 115, 115, 130, 110, 115, 115, 125, 115,
2101 110, 110, 120, 110, 120, 125, 115, 115, 110, 120, 110,
2102 115, 125, 120, 120, 120, 120, 130, 130, 130, 95, 140,
2103 115, 110, 115, 115, 125 },
2106 { 110, 105, 100, 105, 110, 120, 125, 130, 110, 100, 110,
2107 120, 120, 105, 120, 110, 105, 125, 125, 110, 115, 108,
2108 120, 115, 110, 110, 120, 110, 100, 125, 100, 95, 140,
2109 110, 110, 105, 110, 110 },
2112 { 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95,
2113 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95,
2114 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 160,
2115 95, 95, 95, 95, 95 },
2118 { 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, 140,
2119 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, 140,
2120 140, 140, 140, 140, 140, 140, 140, 140, 140, 160, 120,
2121 140, 140, 140, 140, 140 },
2124 { 100, 105, 105, 110, 113, 115, 120, 125, 100, 105, 100,
2125 124, 120, 110, 125, 115, 120, 120, 120, 120, 115, 120,
2126 115, 105, 125, 125, 125, 125, 105, 120, 105, 95, 140,
2127 100, 120, 110, 100, 110 },
2130 { 110, 110, 110, 115, 120, 130, 115, 115, 120, 110, 115,
2131 115, 115, 116, 115, 120, 120, 115, 115, 101, 110, 110,
2132 110, 110, 112, 122, 110, 110, 110, 115, 110, 120, 120,
2133 110, 101, 115, 110, 115 },
2136 { 110, 110, 105, 105, 110, 115, 115, 115, 110, 105, 110,
2137 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115,
2138 115, 115, 125, 125, 125, 125, 105, 115, 105, 95, 140,
2139 110, 115, 100, 110, 110 },
2142 { 105, 105, 105, 110, 113, 115, 120, 125, 100, 105, 100,
2143 124, 120, 110, 125, 115, 120, 120, 120, 120, 115, 120,
2144 115, 105, 125, 125, 125, 125, 105, 120, 105, 95, 140,
2145 100, 120, 110, 100, 110 },
2148 { 110, 110, 110, 105, 110, 120, 125, 130, 110, 110, 110,
2149 120, 115, 108, 115, 110, 110, 120, 120, 115, 115, 110,
2150 120, 110, 110, 110, 120, 110, 110, 125, 110, 95, 140,
2151 110, 115, 110, 110, 100 },
2157 * @brief 店舗価格を決定する /
2158 * Determine the price of an item (qty one) in a store.
2159 * @param o_ptr 店舗に並べるオブジェクト構造体の参照ポインタ
2160 * @param greed 店主の強欲度
2161 * @param flip TRUEならば店主にとっての買取価格、FALSEなら売出価格を計算
2165 * This function takes into account the player's charisma, and the
2166 * shop-keepers friendliness, and the shop-keeper's base greed, but
2167 * never lets a shop-keeper lose money in a transaction.
2168 * The "greed" value should exceed 100 when the player is "buying" the
2169 * item, and should be less than 100 when the player is "selling" it.
2170 * Hack -- the black market always charges twice as much as it should.
2171 * Charisma adjustment runs from 80 to 130
2172 * Racial adjustment runs from 95 to 130
2173 * Since greed/charisma/racial adjustments are centered at 100, we need
2174 * to adjust (by 200) to extract a usable multiplier. Note that the
2175 * "greed" value is always something (?).
2178 static s32b price_item(object_type *o_ptr, int greed, bool flip)
2185 /* Get the value of one of the items */
2186 price = object_value(o_ptr);
2188 /* Worthless items */
2189 if (price <= 0) return (0L);
2192 /* Compute the racial factor */
2193 factor = rgold_adj[ot_ptr->owner_race][p_ptr->prace];
2195 /* Add in the charisma factor */
2196 factor += adj_chr_gold[p_ptr->stat_ind[A_CHR]];
2199 /* Shop is buying */
2202 /* Adjust for greed */
2203 adjust = 100 + (300 - (greed + factor));
2205 /* Never get "silly" */
2206 if (adjust > 100) adjust = 100;
2208 /* Mega-Hack -- Black market sucks */
2209 if (cur_store_num == STORE_BLACK)
2212 /* Compute the final price (with rounding) */
2213 /* Hack -- prevent underflow */
2214 price = (price * adjust + 50L) / 100L;
2217 /* Shop is selling */
2220 /* Adjust for greed */
2221 adjust = 100 + ((greed + factor) - 300);
2223 /* Never get "silly" */
2224 if (adjust < 100) adjust = 100;
2226 /* Mega-Hack -- Black market sucks */
2227 if (cur_store_num == STORE_BLACK)
2230 /* Compute the final price (with rounding) */
2231 /* Hack -- prevent overflow */
2232 price = (s32b)(((u32b)price * (u32b)adjust + 50UL) / 100UL);
2235 /* Note -- Never become "free" */
2236 if (price <= 0L) return (1L);
2238 /* Return the price */
2244 * @brief 安価な消耗品の販売数を増やし、低確率で割引にする /
2245 * Certain "cheap" objects should be created in "piles"
2246 * @param o_ptr 店舗に並べるオブジェクト構造体の参照ポインタ
2250 * Some objects can be sold at a "discount" (in small piles)
2253 static void mass_produce(object_type *o_ptr)
2256 DISCOUNT_RATE discount = 0;
2258 PRICE cost = object_value(o_ptr);
2261 /* Analyze the type */
2262 switch (o_ptr->tval)
2264 /* Food, Flasks, and Lites */
2269 if (cost <= 5L) size += damroll(3, 5);
2270 if (cost <= 20L) size += damroll(3, 5);
2271 if (cost <= 50L) size += damroll(2, 2);
2278 if (cost <= 60L) size += damroll(3, 5);
2279 if (cost <= 240L) size += damroll(1, 5);
2280 if (o_ptr->sval == SV_SCROLL_STAR_IDENTIFY) size += damroll(3, 5);
2281 if (o_ptr->sval == SV_SCROLL_STAR_REMOVE_CURSE) size += damroll(1, 4);
2286 case TV_SORCERY_BOOK:
2287 case TV_NATURE_BOOK:
2291 case TV_ARCANE_BOOK:
2293 case TV_DAEMON_BOOK:
2294 case TV_CRUSADE_BOOK:
2296 case TV_HISSATSU_BOOK:
2299 if (cost <= 50L) size += damroll(2, 3);
2300 if (cost <= 500L) size += damroll(1, 3);
2318 if (object_is_artifact(o_ptr)) break;
2319 if (object_is_ego(o_ptr)) break;
2320 if (cost <= 10L) size += damroll(3, 5);
2321 if (cost <= 100L) size += damroll(3, 5);
2330 if (cost <= 5L) size += damroll(5, 5);
2331 if (cost <= 50L) size += damroll(5, 5);
2332 if (cost <= 500L) size += damroll(5, 5);
2338 if (cost <= 100L) size += damroll(2, 2);
2339 if (cost <= 1000L) size += damroll(2, 2);
2352 * Because many rods (and a few wands and staffs) are useful mainly
2353 * in quantity, the Black Market will occasionally have a bunch of
2360 if ((cur_store_num == STORE_BLACK) && one_in_(3))
2362 if (cost < 1601L) size += damroll(1, 5);
2363 else if (cost < 3201L) size += damroll(1, 3);
2370 /* Pick a discount */
2375 else if (one_in_(25))
2379 else if (one_in_(150))
2383 else if (one_in_(300))
2387 else if (one_in_(500))
2392 if (o_ptr->art_name)
2397 /* Save the discount */
2398 o_ptr->discount = discount;
2400 /* Save the total pile size */
2401 o_ptr->number = size - (size * discount / 100);
2403 /* Ensure that mass-produced rods and wands get the correct pvals. */
2404 if ((o_ptr->tval == TV_ROD) || (o_ptr->tval == TV_WAND))
2406 o_ptr->pval *= (PARAMETER_VALUE)o_ptr->number;
2413 * @brief 店舗に並べた品を同一品であるかどうか判定する /
2414 * Determine if a store item can "absorb" another item
2415 * @param o_ptr 判定するオブジェクト構造体の参照ポインタ1
2416 * @param j_ptr 判定するオブジェクト構造体の参照ポインタ2
2417 * @return 同一扱いできるならTRUEを返す
2420 * See "object_similar()" for the same function for the "player"
2423 static bool store_object_similar(object_type *o_ptr, object_type *j_ptr)
2427 /* Hack -- Identical items cannot be stacked */
2428 if (o_ptr == j_ptr) return (0);
2430 /* Different objects cannot be stacked */
2431 if (o_ptr->k_idx != j_ptr->k_idx) return (0);
2433 /* Different charges (etc) cannot be stacked, unless wands or rods. */
2434 if ((o_ptr->pval != j_ptr->pval) && (o_ptr->tval != TV_WAND) && (o_ptr->tval != TV_ROD)) return (0);
2436 /* Require many identical values */
2437 if (o_ptr->to_h != j_ptr->to_h) return (0);
2438 if (o_ptr->to_d != j_ptr->to_d) return (0);
2439 if (o_ptr->to_a != j_ptr->to_a) return (0);
2441 /* Require identical "ego-item" names */
2442 if (o_ptr->name2 != j_ptr->name2) return (0);
2444 /* Artifacts don't stack! */
2445 if (object_is_artifact(o_ptr) || object_is_artifact(j_ptr)) return (0);
2447 /* Hack -- Identical art_flags! */
2448 for (i = 0; i < TR_FLAG_SIZE; i++)
2449 if (o_ptr->art_flags[i] != j_ptr->art_flags[i]) return (0);
2451 /* Hack -- Never stack "powerful" items */
2452 if (o_ptr->xtra1 || j_ptr->xtra1) return (0);
2454 /* Hack -- Never stack recharging items */
2455 if (o_ptr->timeout || j_ptr->timeout) return (0);
2457 /* Require many identical values */
2458 if (o_ptr->ac != j_ptr->ac) return (0);
2459 if (o_ptr->dd != j_ptr->dd) return (0);
2460 if (o_ptr->ds != j_ptr->ds) return (0);
2462 /* Hack -- Never stack chests */
2463 if (o_ptr->tval == TV_CHEST) return (0);
2464 if (o_ptr->tval == TV_STATUE) return (0);
2465 if (o_ptr->tval == TV_CAPTURE) return (0);
2467 /* Require matching discounts */
2468 if (o_ptr->discount != j_ptr->discount) return (0);
2470 /* They match, so they must be similar */
2476 * @brief 店舗に並べた品を重ね合わせできるかどうか判定する /
2477 * Allow a store item to absorb another item
2478 * @param o_ptr 判定するオブジェクト構造体の参照ポインタ1
2479 * @param j_ptr 判定するオブジェクト構造体の参照ポインタ2
2480 * @return 重ね合わせできるならTRUEを返す
2483 * See "object_similar()" for the same function for the "player"
2486 static void store_object_absorb(object_type *o_ptr, object_type *j_ptr)
2488 int max_num = (o_ptr->tval == TV_ROD) ?
2489 MIN(99, MAX_SHORT / k_info[o_ptr->k_idx].pval) : 99;
2490 int total = o_ptr->number + j_ptr->number;
2491 int diff = (total > max_num) ? total - max_num : 0;
2493 /* Combine quantity, lose excess items */
2494 o_ptr->number = (total > max_num) ? max_num : total;
2496 /* Hack -- if rods are stacking, add the pvals (maximum timeouts) together. -LM- */
2497 if (o_ptr->tval == TV_ROD)
2499 o_ptr->pval += j_ptr->pval * (j_ptr->number - diff) / j_ptr->number;
2502 /* Hack -- if wands are stacking, combine the charges. -LM- */
2503 if (o_ptr->tval == TV_WAND)
2505 o_ptr->pval += j_ptr->pval * (j_ptr->number - diff) / j_ptr->number;
2511 * @brief 店舗に品を置くスペースがあるかどうかの判定を返す /
2512 * Check to see if the shop will be carrying too many objects -RAK-
2513 * @param o_ptr 店舗に置きたいオブジェクト構造体の参照ポインタ
2514 * @return 置き場がないなら0、重ね合わせできるアイテムがあるなら-1、スペースがあるなら1を返す。
2517 * Note that the shop, just like a player, will not accept things
2518 * it cannot hold. Before, one could "nuke" potions this way.
2519 * Return value is now int:
2521 * -1 : Can be combined to existing slot.
2522 * 1 : Cannot be combined but there are empty spaces.
2525 static int store_check_num(object_type *o_ptr)
2530 /* The "home" acts like the player */
2531 if ((cur_store_num == STORE_HOME) || (cur_store_num == STORE_MUSEUM))
2533 bool old_stack_force_notes = stack_force_notes;
2534 bool old_stack_force_costs = stack_force_costs;
2536 if (cur_store_num != STORE_HOME)
2538 stack_force_notes = FALSE;
2539 stack_force_costs = FALSE;
2542 /* Check all the items */
2543 for (i = 0; i < st_ptr->stock_num; i++)
2545 /* Get the existing item */
2546 j_ptr = &st_ptr->stock[i];
2548 /* Can the new object be combined with the old one? */
2549 if (object_similar(j_ptr, o_ptr))
2551 if (cur_store_num != STORE_HOME)
2553 stack_force_notes = old_stack_force_notes;
2554 stack_force_costs = old_stack_force_costs;
2561 if (cur_store_num != STORE_HOME)
2563 stack_force_notes = old_stack_force_notes;
2564 stack_force_costs = old_stack_force_costs;
2568 /* Normal stores do special stuff */
2571 /* Check all the items */
2572 for (i = 0; i < st_ptr->stock_num; i++)
2574 /* Get the existing item */
2575 j_ptr = &st_ptr->stock[i];
2577 /* Can the new object be combined with the old one? */
2578 if (store_object_similar(j_ptr, o_ptr)) return -1;
2582 /* Free space is always usable */
2584 * オプション powerup_home が設定されていると
2587 if ((cur_store_num == STORE_HOME) && ( powerup_home == FALSE )) {
2588 if (st_ptr->stock_num < ((st_ptr->stock_size) / 10)) {
2593 if (st_ptr->stock_num < st_ptr->stock_size) {
2598 /* But there was no room at the inn... */
2603 * @brief オブジェクトが祝福されているかの判定を返す /
2604 * @param o_ptr 判定したいオブジェクト構造体の参照ポインタ
2605 * @return アイテムが祝福されたアイテムならばTRUEを返す
2607 static bool is_blessed(object_type *o_ptr)
2609 BIT_FLAGS flgs[TR_FLAG_SIZE];
2610 object_flags(o_ptr, flgs);
2611 if (have_flag(flgs, TR_BLESSED)) return (TRUE);
2612 else return (FALSE);
2618 * @brief オブジェクトが所定の店舗で引き取れるかどうかを返す /
2619 * Determine if the current store will purchase the given item
2620 * @param o_ptr 判定したいオブジェクト構造体の参照ポインタ
2621 * @return アイテムが買い取れるならばTRUEを返す
2623 * Note that a shop-keeper must refuse to buy "worthless" items
2625 static bool store_will_buy(object_type *o_ptr)
2627 /* Hack -- The Home is simple */
2628 if ((cur_store_num == STORE_HOME) || (cur_store_num == STORE_MUSEUM)) return (TRUE);
2630 /* Switch on the store */
2631 switch (cur_store_num)
2636 /* Analyze the type */
2637 switch (o_ptr->tval)
2640 if (o_ptr->sval != SV_POTION_WATER) return FALSE;
2652 case TV_BOTTLE: /* 'Green', recycling Angband */
2667 /* Analyze the type */
2668 switch (o_ptr->tval)
2689 /* Analyze the type */
2690 switch (o_ptr->tval)
2699 case TV_HISSATSU_BOOK:
2703 if(o_ptr->sval == SV_WIZSTAFF) return (FALSE);
2715 /* Analyze the type */
2716 switch (o_ptr->tval)
2719 case TV_CRUSADE_BOOK:
2729 monster_race *r_ptr = &r_info[o_ptr->pval];
2732 if (!(r_ptr->flags3 & RF3_EVIL))
2735 if (r_ptr->flags3 & RF3_GOOD) break;
2737 /* Accept animals */
2738 if (r_ptr->flags3 & RF3_ANIMAL) break;
2741 if (my_strchr("?!", r_ptr->d_char)) break;
2747 if (is_blessed(o_ptr)) break;
2756 case STORE_ALCHEMIST:
2758 /* Analyze the type */
2759 switch (o_ptr->tval)
2773 /* Analyze the type */
2774 switch (o_ptr->tval)
2776 case TV_SORCERY_BOOK:
2777 case TV_NATURE_BOOK:
2781 case TV_ARCANE_BOOK:
2783 case TV_DAEMON_BOOK:
2797 if(o_ptr->sval == SV_WIZSTAFF) break;
2798 else return (FALSE);
2805 /* Bookstore Shop */
2808 /* Analyze the type */
2809 switch (o_ptr->tval)
2811 case TV_SORCERY_BOOK:
2812 case TV_NATURE_BOOK:
2817 case TV_ARCANE_BOOK:
2819 case TV_DAEMON_BOOK:
2820 case TV_CRUSADE_BOOK:
2831 /* Ignore "worthless" items */
2832 if (object_value(o_ptr) <= 0) return (FALSE);
2840 * @brief 現在の町の指定された店舗のアイテムを整理する /
2841 * Combine and reorder items in store.
2842 * @param store_num 店舗ID
2843 * @return 実際に整理が行われたならばTRUEを返す。
2845 bool combine_and_reorder_home(int store_num)
2849 object_type forge, *o_ptr, *j_ptr;
2850 bool flag = FALSE, combined;
2851 store_type *old_st_ptr = st_ptr;
2852 bool old_stack_force_notes = stack_force_notes;
2853 bool old_stack_force_costs = stack_force_costs;
2855 st_ptr = &town_info[1].store[store_num];
2856 if (store_num != STORE_HOME)
2858 stack_force_notes = FALSE;
2859 stack_force_costs = FALSE;
2866 /* Combine the items in the home (backwards) */
2867 for (i = st_ptr->stock_num - 1; i > 0; i--)
2869 o_ptr = &st_ptr->stock[i];
2871 /* Skip empty items */
2872 if (!o_ptr->k_idx) continue;
2874 /* Scan the items above that item */
2875 for (j = 0; j < i; j++)
2879 j_ptr = &st_ptr->stock[j];
2881 /* Skip empty items */
2882 if (!j_ptr->k_idx) continue;
2885 * Get maximum number of the stack if these
2886 * are similar, get zero otherwise.
2888 max_num = object_similar_part(j_ptr, o_ptr);
2890 /* Can we (partialy) drop "o_ptr" onto "j_ptr"? */
2891 if (max_num && j_ptr->number < max_num)
2893 if (o_ptr->number + j_ptr->number <= max_num)
2895 /* Add together the item counts */
2896 object_absorb(j_ptr, o_ptr);
2898 /* One object is gone */
2899 st_ptr->stock_num--;
2901 /* Slide everything down */
2902 for (k = i; k < st_ptr->stock_num; k++)
2904 /* Structure copy */
2905 st_ptr->stock[k] = st_ptr->stock[k + 1];
2908 /* Erase the "final" slot */
2909 object_wipe(&st_ptr->stock[k]);
2913 ITEM_NUMBER old_num = o_ptr->number;
2914 ITEM_NUMBER remain = j_ptr->number + o_ptr->number - max_num;
2916 /* Add together the item counts */
2917 object_absorb(j_ptr, o_ptr);
2919 o_ptr->number = remain;
2921 /* Hack -- if rods are stacking, add the pvals (maximum timeouts) and current timeouts together. -LM- */
2922 if (o_ptr->tval == TV_ROD)
2924 o_ptr->pval = o_ptr->pval * remain / old_num;
2925 o_ptr->timeout = o_ptr->timeout * remain / old_num;
2928 /* Hack -- if wands are stacking, combine the charges. -LM- */
2929 else if (o_ptr->tval == TV_WAND)
2931 o_ptr->pval = o_ptr->pval * remain / old_num;
2946 /* Re-order the items in the home (forwards) */
2947 for (i = 0; i < st_ptr->stock_num; i++)
2949 o_ptr = &st_ptr->stock[i];
2951 /* Skip empty slots */
2952 if (!o_ptr->k_idx) continue;
2954 /* Get the "value" of the item */
2955 o_value = object_value(o_ptr);
2957 /* Scan every occupied slot */
2958 for (j = 0; j < st_ptr->stock_num; j++)
2960 if (object_sort_comp(o_ptr, o_value, &st_ptr->stock[j])) break;
2963 /* Never move down */
2964 if (j >= i) continue;
2970 /* Save a copy of the moving item */
2971 object_copy(j_ptr, &st_ptr->stock[i]);
2973 /* Slide the objects */
2974 for (k = i; k > j; k--)
2976 /* Slide the item */
2977 object_copy(&st_ptr->stock[k], &st_ptr->stock[k - 1]);
2980 /* Insert the moving item */
2981 object_copy(&st_ptr->stock[j], j_ptr);
2984 st_ptr = old_st_ptr;
2985 if (store_num != STORE_HOME)
2987 stack_force_notes = old_stack_force_notes;
2988 stack_force_costs = old_stack_force_costs;
2996 * @brief 我が家にオブジェクトを加える /
2997 * Add the item "o_ptr" to the inventory of the "Home"
2998 * @param o_ptr 加えたいオブジェクトの構造体参照ポインタ
3002 * In all cases, return the slot (or -1) where the object was placed
3003 * Note that this is a hacked up version of "inven_carry()".
3004 * Also note that it may not correctly "adapt" to "knowledge" bacoming
3005 * known, the player may have to pick stuff up and drop it again.
3008 static int home_carry(object_type *o_ptr)
3014 bool old_stack_force_notes = stack_force_notes;
3015 bool old_stack_force_costs = stack_force_costs;
3017 if (cur_store_num != STORE_HOME)
3019 stack_force_notes = FALSE;
3020 stack_force_costs = FALSE;
3023 /* Check each existing item (try to combine) */
3024 for (slot = 0; slot < st_ptr->stock_num; slot++)
3026 /* Get the existing item */
3027 j_ptr = &st_ptr->stock[slot];
3029 /* The home acts just like the player */
3030 if (object_similar(j_ptr, o_ptr))
3032 /* Save the new number of items */
3033 object_absorb(j_ptr, o_ptr);
3035 if (cur_store_num != STORE_HOME)
3037 stack_force_notes = old_stack_force_notes;
3038 stack_force_costs = old_stack_force_costs;
3046 if (cur_store_num != STORE_HOME)
3048 stack_force_notes = old_stack_force_notes;
3049 stack_force_costs = old_stack_force_costs;
3054 * 隠し機能: オプション powerup_home が設定されていると
3058 if ((cur_store_num != STORE_HOME) || (powerup_home == TRUE)) {
3059 if (st_ptr->stock_num >= st_ptr->stock_size) {
3064 if (st_ptr->stock_num >= ((st_ptr->stock_size) / 10)) {
3070 /* Determine the "value" of the item */
3071 value = object_value(o_ptr);
3073 /* Check existing slots to see if we must "slide" */
3074 for (slot = 0; slot < st_ptr->stock_num; slot++)
3076 if (object_sort_comp(o_ptr, value, &st_ptr->stock[slot])) break;
3079 /* Slide the others up */
3080 for (i = st_ptr->stock_num; i > slot; i--)
3082 st_ptr->stock[i] = st_ptr->stock[i-1];
3085 /* More stuff now */
3086 st_ptr->stock_num++;
3088 /* Insert the new item */
3089 st_ptr->stock[slot] = *o_ptr;
3091 chg_virtue(V_SACRIFICE, -1);
3093 (void)combine_and_reorder_home(cur_store_num);
3095 /* Return the location */
3101 * @brief 店舗にオブジェクトを加える /
3102 * Add the item "o_ptr" to a real stores inventory.
3103 * @param o_ptr 加えたいオブジェクトの構造体参照ポインタ
3107 * In all cases, return the slot (or -1) where the object was placed
3108 * Note that this is a hacked up version of "inven_carry()".
3109 * Also note that it may not correctly "adapt" to "knowledge" bacoming
3110 * known, the player may have to pick stuff up and drop it again.
3113 static int store_carry(object_type *o_ptr)
3116 PRICE value, j_value;
3120 /* Evaluate the object */
3121 value = object_value(o_ptr);
3123 /* Cursed/Worthless items "disappear" when sold */
3124 if (value <= 0) return (-1);
3126 /* All store items are fully *identified* */
3127 o_ptr->ident |= IDENT_MENTAL;
3129 /* Erase the inscription */
3130 o_ptr->inscription = 0;
3132 /* Erase the "feeling" */
3133 o_ptr->feeling = FEEL_NONE;
3135 /* Check each existing item (try to combine) */
3136 for (slot = 0; slot < st_ptr->stock_num; slot++)
3138 /* Get the existing item */
3139 j_ptr = &st_ptr->stock[slot];
3141 /* Can the existing items be incremented? */
3142 if (store_object_similar(j_ptr, o_ptr))
3144 /* Hack -- extra items disappear */
3145 store_object_absorb(j_ptr, o_ptr);
3153 if (st_ptr->stock_num >= st_ptr->stock_size) return (-1);
3156 /* Check existing slots to see if we must "slide" */
3157 for (slot = 0; slot < st_ptr->stock_num; slot++)
3160 j_ptr = &st_ptr->stock[slot];
3162 /* Objects sort by decreasing type */
3163 if (o_ptr->tval > j_ptr->tval) break;
3164 if (o_ptr->tval < j_ptr->tval) continue;
3166 /* Objects sort by increasing sval */
3167 if (o_ptr->sval < j_ptr->sval) break;
3168 if (o_ptr->sval > j_ptr->sval) continue;
3171 * Hack: otherwise identical rods sort by
3172 * increasing recharge time --dsb
3174 if (o_ptr->tval == TV_ROD)
3176 if (o_ptr->pval < j_ptr->pval) break;
3177 if (o_ptr->pval > j_ptr->pval) continue;
3180 /* Evaluate that slot */
3181 j_value = object_value(j_ptr);
3183 /* Objects sort by decreasing value */
3184 if (value > j_value) break;
3185 if (value < j_value) continue;
3188 /* Slide the others up */
3189 for (i = st_ptr->stock_num; i > slot; i--)
3191 st_ptr->stock[i] = st_ptr->stock[i-1];
3194 /* More stuff now */
3195 st_ptr->stock_num++;
3197 /* Insert the new item */
3198 st_ptr->stock[slot] = *o_ptr;
3200 /* Return the location */
3206 * @brief 店舗のオブジェクト数を増やす /
3207 * Add the item "o_ptr" to a real stores inventory.
3208 * @param item 増やしたいアイテムのID
3213 * Increase, by a given amount, the number of a certain item
3214 * in a certain store. This can result in zero items.
3216 * @todo numは本来ITEM_NUMBER型にしたい。
3218 static void store_item_increase(INVENTORY_IDX item, int num)
3223 o_ptr = &st_ptr->stock[item];
3225 /* Verify the number */
3226 cnt = o_ptr->number + num;
3227 if (cnt > 255) cnt = 255;
3228 else if (cnt < 0) cnt = 0;
3229 num = cnt - o_ptr->number;
3231 /* Save the new number */
3232 o_ptr->number += (ITEM_NUMBER)num;
3237 * @brief 店舗のオブジェクト数を削除する /
3238 * Remove a slot if it is empty
3239 * @param item 削除したいアイテムのID
3242 static void store_item_optimize(INVENTORY_IDX item)
3247 o_ptr = &st_ptr->stock[item];
3250 if (!o_ptr->k_idx) return;
3252 /* Must have no items */
3253 if (o_ptr->number) return;
3256 st_ptr->stock_num--;
3258 /* Slide everyone */
3259 for (j = item; j < st_ptr->stock_num; j++)
3261 st_ptr->stock[j] = st_ptr->stock[j + 1];
3264 /* Nuke the final slot */
3265 object_wipe(&st_ptr->stock[j]);
3269 * @brief ブラックマーケット用の無価値品の排除判定 /
3270 * This function will keep 'crap' out of the black market.
3271 * @param o_ptr 判定したいオブジェクトの構造体参照ポインタ
3272 * @return ブラックマーケットにとって無価値な品ならばTRUEを返す
3275 * Crap is defined as any item that is "available" elsewhere
3276 * Based on a suggestion by "Lee Vogt" <lvogt@cig.mcel.mot.com>
3279 static bool black_market_crap(object_type *o_ptr)
3283 /* Ego items are never crap */
3284 if (object_is_ego(o_ptr)) return (FALSE);
3286 /* Good items are never crap */
3287 if (o_ptr->to_a > 0) return (FALSE);
3288 if (o_ptr->to_h > 0) return (FALSE);
3289 if (o_ptr->to_d > 0) return (FALSE);
3291 /* Check all stores */
3292 for (i = 0; i < MAX_STORES; i++)
3294 if (i == STORE_HOME) continue;
3295 if (i == STORE_MUSEUM) continue;
3297 /* Check every item in the store */
3298 for (j = 0; j < town_info[p_ptr->town_num].store[i].stock_num; j++)
3300 object_type *j_ptr = &town_info[p_ptr->town_num].store[i].stock[j];
3302 /* Duplicate item "type", assume crappy */
3303 if (o_ptr->k_idx == j_ptr->k_idx) return (TRUE);
3313 * @brief 店舗の品揃え変化のためにアイテムを削除する /
3314 * Attempt to delete (some of) a random item from the store
3318 * Hack -- we attempt to "maintain" piles of items when possible.
3321 static void store_delete(void)
3326 /* Pick a random slot */
3327 what = (INVENTORY_IDX)randint0(st_ptr->stock_num);
3329 /* Determine how many items are here */
3330 num = st_ptr->stock[what].number;
3332 /* Hack -- sometimes, only destroy half the items */
3333 if (randint0(100) < 50) num = (num + 1) / 2;
3335 /* Hack -- sometimes, only destroy a single item */
3336 if (randint0(100) < 50) num = 1;
3338 /* Hack -- decrement the maximum timeouts and total charges of rods and wands. -LM- */
3339 if ((st_ptr->stock[what].tval == TV_ROD) || (st_ptr->stock[what].tval == TV_WAND))
3341 st_ptr->stock[what].pval -= num * st_ptr->stock[what].pval / st_ptr->stock[what].number;
3344 /* Actually destroy (part of) the item */
3345 store_item_increase(what, -num);
3346 store_item_optimize(what);
3351 * @brief 店舗の品揃え変化のためにアイテムを追加する /
3352 * Creates a random item and gives it to a store
3356 * This algorithm needs to be rethought. A lot.
3357 * Currently, "normal" stores use a pre-built array.
3358 * Note -- the "level" given to "obj_get_num()" is a "favored"
3359 * level, that is, there is a much higher chance of getting
3360 * items with a level approaching that of the given level...
3361 * Should we check for "permission" to have the given item?
3364 static void store_create(void)
3374 /* Paranoia -- no room left */
3375 if (st_ptr->stock_num >= st_ptr->stock_size) return;
3378 /* Hack -- consider up to four items */
3379 for (tries = 0; tries < 4; tries++)
3382 if (cur_store_num == STORE_BLACK)
3384 /* Pick a level for object/magic */
3385 level = 25 + randint0(25);
3387 /* Random item (usually of given level) */
3388 i = get_obj_num(level);
3390 /* Handle failure */
3397 /* Hack -- Pick an item to sell */
3398 i = st_ptr->table[randint0(st_ptr->table_num)];
3400 /* Hack -- fake level for apply_magic() */
3401 level = rand_range(1, STORE_OBJ_LEVEL);
3406 /* Create a new object of the chosen kind */
3407 object_prep(q_ptr, i);
3409 /* Apply some "low-level" magic (no artifacts) */
3410 apply_magic(q_ptr, level, AM_NO_FIXED_ART);
3412 /* Require valid object */
3413 if (!store_will_buy(q_ptr)) continue;
3415 /* Hack -- Charge lite's */
3416 if (q_ptr->tval == TV_LITE)
3418 if (q_ptr->sval == SV_LITE_TORCH) q_ptr->xtra4 = FUEL_TORCH / 2;
3419 if (q_ptr->sval == SV_LITE_LANTERN) q_ptr->xtra4 = FUEL_LAMP / 2;
3423 /* The item is "known" */
3424 object_known(q_ptr);
3426 /* Mark it storebought */
3427 q_ptr->ident |= IDENT_STORE;
3429 /* Mega-Hack -- no chests in stores */
3430 if (q_ptr->tval == TV_CHEST) continue;
3432 /* Prune the black market */
3433 if (cur_store_num == STORE_BLACK)
3435 /* Hack -- No "crappy" items */
3436 if (black_market_crap(q_ptr)) continue;
3438 /* Hack -- No "cheap" items */
3439 if (object_value(q_ptr) < 10) continue;
3441 /* No "worthless" items */
3442 /* if (object_value(q_ptr) <= 0) continue; */
3445 /* Prune normal stores */
3448 /* No "worthless" items */
3449 if (object_value(q_ptr) <= 0) continue;
3453 /* Mass produce and/or Apply discount */
3454 mass_produce(q_ptr);
3456 /* Attempt to carry the (known) item */
3457 (void)store_carry(q_ptr);
3459 /* Definitely done */
3466 * @brief 店舗の割引対象外にするかどうかを判定 /
3467 * Eliminate need to bargain if player has haggled well in the past
3468 * @param minprice アイテムの最低販売価格
3469 * @return 割引を禁止するならTRUEを返す。
3471 static bool noneedtobargain(PRICE minprice)
3473 PRICE good = st_ptr->good_buy;
3474 PRICE bad = st_ptr->bad_buy;
3476 /* Cheap items are "boring" */
3477 if (minprice < 10L) return (TRUE);
3479 /* Perfect haggling */
3480 if (good == MAX_SHORT) return (TRUE);
3482 /* Reward good haggles, punish bad haggles, notice price */
3483 if (good > ((3 * bad) + (5 + (minprice/50)))) return (TRUE);
3485 /* Return the flag */
3491 * @brief 店主の持つプレイヤーに対する売買の良し悪し経験を記憶する /
3492 * Update the bargain info
3493 * @param price 実際の取引価格
3494 * @param minprice 店主の提示した価格
3498 static void updatebargain(PRICE price, PRICE minprice, int num)
3500 /* Hack -- auto-haggle */
3501 if (!manual_haggle) return;
3503 /* Cheap items are "boring" */
3504 if ((minprice/num) < 10L) return;
3506 /* Count the successful haggles */
3507 if (price == minprice)
3509 /* Just count the good haggles */
3510 if (st_ptr->good_buy < MAX_SHORT)
3516 /* Count the failed haggles */
3519 /* Just count the bad haggles */
3520 if (st_ptr->bad_buy < MAX_SHORT)
3529 * @brief 店の商品リストを再表示する /
3530 * Re-displays a single store entry
3534 static void display_entry(int pos)
3540 GAME_TEXT o_name[MAX_NLEN];
3545 o_ptr = &st_ptr->stock[pos];
3547 /* Get the "offset" */
3548 i = (pos % store_bottom);
3550 /* Label it, clear the line --(-- */
3551 (void)sprintf(out_val, "%c) ", ((i > 25) ? toupper(I2A(i - 26)) : I2A(i)));
3552 prt(out_val, i+6, 0);
3555 if (show_item_graph)
3557 TERM_COLOR a = object_attr(o_ptr);
3558 SYMBOL_CODE c = object_char(o_ptr);
3560 Term_queue_bigchar(cur_col, i + 6, a, c, 0, 0);
3561 if (use_bigtile) cur_col++;
3566 /* Describe an item in the home */
3567 if ((cur_store_num == STORE_HOME) || (cur_store_num == STORE_MUSEUM))
3571 /* Leave room for weights, if necessary -DRS- */
3572 if (show_weights) maxwid -= 10;
3574 object_desc(o_name, o_ptr, 0);
3575 o_name[maxwid] = '\0';
3576 c_put_str(tval_to_attr[o_ptr->tval], o_name, i+6, cur_col);
3581 /* Only show the weight of an individual item */
3582 WEIGHT wgt = o_ptr->weight;
3584 sprintf(out_val, "%3d.%1d kg", lbtokg1(wgt) , lbtokg2(wgt));
3585 put_str(out_val, i+6, 67);
3587 (void)sprintf(out_val, "%3d.%d lb", wgt / 10, wgt % 10);
3588 put_str(out_val, i+6, 68);
3594 /* Describe an item (fully) in a store */
3597 /* Must leave room for the "price" */
3600 /* Leave room for weights, if necessary -DRS- */
3601 if (show_weights) maxwid -= 7;
3603 /* Describe the object (fully) */
3604 object_desc(o_name, o_ptr, 0);
3605 o_name[maxwid] = '\0';
3606 c_put_str(tval_to_attr[o_ptr->tval], o_name, i+6, cur_col);
3611 /* Only show the weight of an individual item */
3612 int wgt = o_ptr->weight;
3614 sprintf(out_val, "%3d.%1d", lbtokg1(wgt) , lbtokg2(wgt) );
3615 put_str(out_val, i+6, 60);
3617 (void)sprintf(out_val, "%3d.%d", wgt / 10, wgt % 10);
3618 put_str(out_val, i+6, 61);
3623 /* Display a "fixed" cost */
3624 if (o_ptr->ident & (IDENT_FIXED))
3626 /* Extract the "minimum" price */
3627 x = price_item(o_ptr, ot_ptr->min_inflate, FALSE);
3629 /* Actually draw the price (not fixed) */
3631 (void)sprintf(out_val, "%9ld固", (long)x);
3633 (void)sprintf(out_val, "%9ld F", (long)x);
3635 put_str(out_val, i+6, 68);
3638 /* Display a "taxed" cost */
3639 else if (!manual_haggle)
3641 /* Extract the "minimum" price */
3642 x = price_item(o_ptr, ot_ptr->min_inflate, FALSE);
3644 /* Hack -- Apply Sales Tax if needed */
3645 if (!noneedtobargain(x)) x += x / 10;
3647 /* Actually draw the price (with tax) */
3648 (void)sprintf(out_val, "%9ld ", (long)x);
3649 put_str(out_val, i+6, 68);
3652 /* Display a "haggle" cost */
3655 /* Extrect the "maximum" price */
3656 x = price_item(o_ptr, ot_ptr->max_inflate, FALSE);
3658 /* Actually draw the price (not fixed) */
3659 (void)sprintf(out_val, "%9ld ", (long)x);
3660 put_str(out_val, i+6, 68);
3667 * @brief 店の商品リストを表示する /
3668 * Displays a store's inventory -RAK-
3671 * All prices are listed as "per individual object". -BEN-
3673 static void display_inventory(void)
3677 /* Display the next 12 items */
3678 for (k = 0; k < store_bottom; k++)
3680 /* Do not display "dead" items */
3681 if (store_top + k >= st_ptr->stock_num) break;
3683 /* Display that line */
3684 display_entry(store_top + k);
3687 /* Erase the extra lines and the "more" prompt */
3688 for (i = k; i < store_bottom + 1; i++) prt("", i + 6, 0);
3690 /* Assume "no current page" */
3692 put_str(" ", 5, 20);
3694 put_str(" ", 5, 22);
3698 /* Visual reminder of "more items" */
3699 if (st_ptr->stock_num > store_bottom)
3701 /* Show "more" reminder (after the last item) */
3702 prt(_("-続く-", "-more-"), k + 6, 3);
3704 /* Indicate the "current page" */
3705 /* Trailing spaces are to display (Page xx) and (Page x) */
3706 put_str(format(_("(%dページ) ", "(Page %d) "), store_top/store_bottom + 1), 5, _(20, 22));
3709 if (cur_store_num == STORE_HOME || cur_store_num == STORE_MUSEUM)
3711 k = st_ptr->stock_size;
3713 if (cur_store_num == STORE_HOME && !powerup_home) k /= 10;
3715 put_str(format("アイテム数: %4d/%4d", st_ptr->stock_num, k), 19 + xtra_stock, 27);
3717 put_str(format("Objects: %4d/%4d", st_ptr->stock_num, k), 19 + xtra_stock, 30);
3724 * @brief プレイヤーの所持金を表示する /
3725 * Displays players gold -RAK-
3729 static void store_prt_gold(void)
3733 prt(_("手持ちのお金: ", "Gold Remaining: "), 19 + xtra_stock, 53);
3734 sprintf(out_val, "%9ld", (long)p_ptr->au);
3735 prt(out_val, 19 + xtra_stock, 68);
3739 * @brief 店舗情報全体を表示するメインルーチン /
3740 * Displays store (after clearing screen) -RAK-
3744 static void display_store(void)
3750 /* The "Home" is special */
3751 if (cur_store_num == STORE_HOME)
3753 /* Put the owner name */
3754 put_str(_("我が家", "Your Home"), 3, 31);
3756 /* Label the item descriptions */
3757 put_str(_("アイテムの一覧", "Item Description"), 5, 4);
3759 /* If showing weights, show label */
3762 put_str(_(" 重さ", "Weight"), 5, 70);
3766 /* The "Home" is special */
3767 else if (cur_store_num == STORE_MUSEUM)
3769 /* Put the owner name */
3770 put_str(_("博物館", "Museum"), 3, 31);
3772 /* Label the item descriptions */
3773 put_str(_("アイテムの一覧", "Item Description"), 5, 4);
3775 /* If showing weights, show label */
3778 put_str(_(" 重さ", "Weight"), 5, 70);
3785 concptr store_name = (f_name + f_info[cur_store_feat].name);
3786 concptr owner_name = (ot_ptr->owner_name);
3787 concptr race_name = race_info[ot_ptr->owner_race].title;
3789 /* Put the owner name and race */
3790 sprintf(buf, "%s (%s)", owner_name, race_name);
3791 put_str(buf, 3, 10);
3793 /* Show the max price in the store (above prices) */
3794 sprintf(buf, "%s (%ld)", store_name, (long)(ot_ptr->max_cost));
3797 /* Label the item descriptions */
3798 put_str(_("商品の一覧", "Item Description"), 5, 5);
3801 /* If showing weights, show label */
3804 put_str(_(" 重さ", "Weight"), 5, 60);
3807 /* Label the asking price (in stores) */
3808 put_str(_(" 価格", "Price"), 5, 72);
3811 /* Display the current gold */
3814 /* Draw in the inventory */
3815 display_inventory();
3821 * @brief 店舗からアイテムを選択する /
3822 * Get the ID of a store item and return its value -RAK-
3823 * @param com_val 選択IDを返す参照ポインタ
3824 * @param pmt メッセージキャプション
3827 * @return 実際に選択したらTRUE、キャンセルしたらFALSE
3829 static int get_stock(COMMAND_CODE *com_val, concptr pmt, int i, int j)
3835 /* Get the item index */
3836 if (repeat_pull(com_val))
3838 /* Verify the item */
3839 if ((*com_val >= i) && (*com_val <= j))
3847 /* Assume failure */
3850 /* Build the prompt */
3852 hi = (j > 25) ? toupper(I2A(j - 26)) : I2A(j);
3854 (void)sprintf(out_val, "(%s:%c-%c, ESCで中断) %s",
3855 (((cur_store_num == STORE_HOME) || (cur_store_num == STORE_MUSEUM)) ? "アイテム" : "商品"),
3858 (void)sprintf(out_val, "(Items %c-%c, ESC to exit) %s",
3863 /* Ask until done */
3869 if (!get_com(out_val, &command, FALSE)) break;
3872 if (islower(command))
3874 else if (isupper(command))
3875 k = A2I(tolower(command)) + 26;
3879 /* Legal responses */
3880 if ((k >= i) && (k <= j))
3889 /* Clear the prompt */
3892 if (command == ESCAPE) return (FALSE);
3894 repeat_push(*com_val);
3902 * @brief 店主の不満度を増やし、プレイヤーを締め出す判定と処理を行う /
3903 * Increase the insult counter and get angry if too many -RAK-
3904 * @return プレイヤーを締め出す場合TRUEを返す
3906 static int increase_insults(void)
3908 /* Increase insults */
3909 st_ptr->insult_cur++;
3911 /* Become insulted */
3912 if (st_ptr->insult_cur > ot_ptr->insult_max)
3918 st_ptr->insult_cur = 0;
3919 st_ptr->good_buy = 0;
3920 st_ptr->bad_buy = 0;
3923 st_ptr->store_open = current_world_ptr->game_turn + TURNS_PER_TICK*TOWN_DAWN/8 + randint1(TURNS_PER_TICK*TOWN_DAWN/8);
3935 * @brief 店主の不満度を減らす /
3936 * Decrease insults -RAK-
3937 * @return プレイヤーを締め出す場合TRUEを返す
3939 static void decrease_insults(void)
3941 /* Decrease insults */
3942 if (st_ptr->insult_cur) st_ptr->insult_cur--;
3947 * @brief 店主の不満度が増えた場合のみのメッセージを表示する /
3948 * Have insulted while haggling -RAK-
3949 * @return プレイヤーを締め出す場合TRUEを返す
3951 static int haggle_insults(void)
3953 /* Increase insults */
3954 if (increase_insults()) return (TRUE);
3956 /* Display and flush insult */
3965 * Mega-Hack -- Enable "increments"
3967 static bool allow_inc = FALSE;
3970 * Mega-Hack -- Last "increment" during haggling
3972 static s32b last_inc = 0L;
3976 * @brief 交渉価格を確認と認証の是非を行う /
3979 * @param poffer 別途価格提示をした場合の値を返す参照ポインタ
3980 * @param price 現在の交渉価格
3981 * @param final 最終確定価格ならばTRUE
3982 * @return プレイヤーを締め出す場合TRUEを返す
3984 static int get_haggle(concptr pmt, s32b *poffer, PRICE price, int final)
3989 GAME_TEXT out_val[160];
3991 /* Clear old increment if necessary */
3992 if (!allow_inc) last_inc = 0L;
3997 sprintf(buf, _("%s [承諾] ", "%s [accept] "), pmt);
4000 /* Old (negative) increment, and not final */
4001 else if (last_inc < 0)
4003 sprintf(buf, _("%s [-$%ld] ", "%s [-%ld] "), pmt, (long)(ABS(last_inc)));
4006 /* Old (positive) increment, and not final */
4007 else if (last_inc > 0)
4009 sprintf(buf, _("%s [+$%ld] ", "%s [+%ld] "), pmt, (long)(ABS(last_inc)));
4015 sprintf(buf, "%s ", pmt);
4019 /* Ask until done */
4024 /* Display prompt */
4028 strcpy(out_val, "");
4031 * Ask the user for a response.
4032 * Don't allow to use numpad as cursor key.
4034 res = askfor_aux(out_val, 32, FALSE);
4040 if (!res) return FALSE;
4042 /* Skip leading spaces */
4043 for (p = out_val; *p == ' '; p++) /* loop */;
4045 /* Empty response */
4048 /* Accept current price */
4056 /* Use previous increment */
4057 if (allow_inc && last_inc)
4059 *poffer += last_inc;
4064 /* Normal response */
4067 /* Extract a number */
4070 /* Handle "incremental" number */
4071 if ((*p == '+' || *p == '-'))
4073 /* Allow increments */
4076 /* Use the given "increment" */
4083 /* Handle normal number */
4086 /* Use the given "number" */
4094 msg_print(_("値がおかしいです。", "Invalid response."));
4104 * @brief 店主がプレイヤーからの交渉価格を判断する /
4105 * Receive an offer (from the player)
4107 * @param poffer 店主からの交渉価格を返す参照ポインタ
4108 * @param last_offer 現在の交渉価格
4109 * @param factor 店主の価格基準倍率
4110 * @param price アイテムの実価値
4111 * @param final 最終価格確定ならばTRUE
4112 * @return プレイヤーの価格に対して不服ならばTRUEを返す /
4113 * Return TRUE if offer is NOT okay
4115 static bool receive_offer(concptr pmt, s32b *poffer,
4116 s32b last_offer, int factor,
4117 PRICE price, int final)
4119 /* Haggle till done */
4122 /* Get a haggle (or cancel) */
4123 if (!get_haggle(pmt, poffer, price, final)) return (TRUE);
4125 /* Acceptable offer */
4126 if (((*poffer) * factor) >= (last_offer * factor)) break;
4128 /* Insult, and check for kicked out */
4129 if (haggle_insults()) return (TRUE);
4131 /* Reject offer (correctly) */
4132 (*poffer) = last_offer;
4141 * @brief プレイヤーが購入する時の値切り処理メインルーチン /
4142 * Haggling routine -RAK-
4143 * @param o_ptr オブジェクトの構造体参照ポインタ
4144 * @param price 最終価格を返す参照ポインタ
4145 * @return プレイヤーの価格に対して店主が不服ならばTRUEを返す /
4146 * Return TRUE if purchase is NOT successful
4148 static bool purchase_haggle(object_type *o_ptr, s32b *price)
4150 s32b cur_ask, final_ask;
4151 s32b last_offer, offer;
4153 s32b min_per, max_per;
4154 int flag, loop_flag, noneed;
4155 int annoyed = 0, final = FALSE;
4156 bool cancel = FALSE;
4160 concptr pmt = _("提示価格", "Asking");
4162 /* Extract the starting offer and the final offer */
4163 cur_ask = price_item(o_ptr, ot_ptr->max_inflate, FALSE);
4164 final_ask = price_item(o_ptr, ot_ptr->min_inflate, FALSE);
4166 /* Determine if haggling is necessary */
4167 noneed = noneedtobargain(final_ask);
4169 /* No need to haggle */
4170 if (noneed || !manual_haggle)
4172 /* No need to haggle */
4175 /* Message summary */
4176 msg_print(_("結局この金額にまとまった。", "You eventually agree upon the price."));
4180 /* No haggle option */
4183 /* Message summary */
4184 msg_print(_("すんなりとこの金額にまとまった。", "You quickly agree upon the price."));
4187 /* Apply Sales Tax */
4188 final_ask += final_ask / 10;
4192 cur_ask = final_ask;
4194 /* Go to final offer */
4195 pmt = _("最終提示価格", "Final Offer");
4200 /* Haggle for the whole pile */
4201 cur_ask *= o_ptr->number;
4202 final_ask *= o_ptr->number;
4205 /* Haggle parameters */
4206 min_per = ot_ptr->haggle_per;
4207 max_per = min_per * 3;
4209 /* Mega-Hack -- artificial "last offer" value */
4210 last_offer = object_value(o_ptr) * o_ptr->number;
4211 last_offer = last_offer * (200 - (int)(ot_ptr->max_inflate)) / 100L;
4212 if (last_offer <= 0) last_offer = 1;
4217 /* No incremental haggling yet */
4220 /* Haggle until done */
4221 for (flag = FALSE; !flag; )
4225 while (!flag && loop_flag)
4227 (void)sprintf(out_val, "%s : %ld", pmt, (long)cur_ask);
4228 put_str(out_val, 1, 0);
4229 cancel = receive_offer(_("提示する金額? ", "What do you offer? "), &offer, last_offer, 1, cur_ask, final);
4234 else if (offer > cur_ask)
4239 else if (offer == cur_ask)
4252 x1 = 100 * (offer - last_offer) / (cur_ask - last_offer);
4255 if (haggle_insults())
4261 else if (x1 > max_per)
4264 if (x1 < max_per) x1 = max_per;
4266 x2 = rand_range(x1-2, x1+2);
4267 x3 = ((cur_ask - offer) * x2 / 100L) + 1;
4268 /* don't let the price go up */
4273 if (cur_ask < final_ask)
4276 cur_ask = final_ask;
4277 pmt = _("最終提示価格", "What do you offer? ");
4281 (void)(increase_insults());
4286 else if (offer >= cur_ask)
4297 (void)sprintf(out_val, _("前回の提示金額: $%ld", "Your last offer: %ld"), (long)last_offer);
4298 put_str(out_val, 1, 39);
4299 say_comment_2(cur_ask, annoyed);
4304 if (cancel) return (TRUE);
4306 updatebargain(*price, final_ask, o_ptr->number);
4314 * @brief プレイヤーが売却する時の値切り処理メインルーチン /
4315 * Haggling routine -RAK-
4316 * @param o_ptr オブジェクトの構造体参照ポインタ
4317 * @param price 最終価格を返す参照ポインタ
4318 * @return プレイヤーの価格に対して店主が不服ならばTRUEを返す /
4319 * Return TRUE if purchase is NOT successful
4321 static bool sell_haggle(object_type *o_ptr, s32b *price)
4323 s32b purse, cur_ask, final_ask;
4324 s32b last_offer = 0, offer = 0;
4326 s32b min_per, max_per;
4327 int flag, loop_flag, noneed;
4328 int annoyed = 0, final = FALSE;
4329 bool cancel = FALSE;
4330 concptr pmt = _("提示金額", "Offer");
4336 /* Obtain the starting offer and the final offer */
4337 cur_ask = price_item(o_ptr, ot_ptr->max_inflate, TRUE);
4338 final_ask = price_item(o_ptr, ot_ptr->min_inflate, TRUE);
4340 /* Determine if haggling is necessary */
4341 noneed = noneedtobargain(final_ask);
4343 /* Get the owner's payout limit */
4344 purse = (s32b)(ot_ptr->max_cost);
4346 /* No need to haggle */
4347 if (noneed || !manual_haggle || (final_ask >= purse))
4349 /* Apply Sales Tax (if needed) */
4350 if (!manual_haggle && !noneed)
4352 final_ask -= final_ask / 10;
4355 /* No reason to haggle */
4356 if (final_ask >= purse)
4358 msg_print(_("即座にこの金額にまとまった。", "You instantly agree upon the price."));
4361 /* Offer full purse */
4365 /* No need to haggle */
4368 msg_print(_("結局この金額にまとまった。", "You eventually agree upon the price."));
4372 /* No haggle option */
4375 /* Message summary */
4376 msg_print(_("すんなりとこの金額にまとまった。", "You quickly agree upon the price."));
4381 cur_ask = final_ask;
4385 pmt = _("最終提示金額", "Final Offer");
4388 /* Haggle for the whole pile */
4389 cur_ask *= o_ptr->number;
4390 final_ask *= o_ptr->number;
4393 /* Display commands */
4395 /* Haggling parameters */
4396 min_per = ot_ptr->haggle_per;
4397 max_per = min_per * 3;
4399 /* Mega-Hack -- artificial "last offer" value */
4400 last_offer = object_value(o_ptr) * o_ptr->number;
4401 last_offer = last_offer * ot_ptr->max_inflate / 100L;
4406 /* No incremental haggling yet */
4410 for (flag = FALSE; !flag; )
4416 (void)sprintf(out_val, "%s : %ld", pmt, (long)cur_ask);
4417 put_str(out_val, 1, 0);
4418 cancel = receive_offer(_("提示する価格? ", "What price do you ask? "),
4419 &offer, last_offer, -1, cur_ask, final);
4425 else if (offer < cur_ask)
4428 /* rejected, reset offer for incremental haggling */
4431 else if (offer == cur_ask)
4442 if (flag || !loop_flag) break;
4447 x1 = 100 * (last_offer - offer) / (last_offer - cur_ask);
4450 if (haggle_insults())
4456 else if (x1 > max_per)
4459 if (x1 < max_per) x1 = max_per;
4461 x2 = rand_range(x1-2, x1+2);
4462 x3 = ((offer - cur_ask) * x2 / 100L) + 1;
4463 /* don't let the price go down */
4467 if (cur_ask > final_ask)
4469 cur_ask = final_ask;
4471 pmt = _("最終提示金額", "Final Offer");
4478 /* 追加 $0 で買い取られてしまうのを防止 By FIRST*/
4481 (void)(increase_insults());
4484 else if (offer <= cur_ask)
4495 (void)sprintf(out_val,
4496 _("前回の提示価格 $%ld", "Your last bid %ld"), (long)last_offer);
4497 put_str(out_val, 1, 39);
4498 say_comment_3(cur_ask, annoyed);
4503 if (cancel) return (TRUE);
4505 updatebargain(*price, final_ask, o_ptr->number);
4513 * @brief 店からの購入処理のメインルーチン /
4514 * Buy an item from a store -RAK-
4517 static void store_purchase(void)
4520 COMMAND_CODE item, item_new;
4531 GAME_TEXT o_name[MAX_NLEN];
4535 if (cur_store_num == STORE_MUSEUM)
4537 msg_print(_("博物館から取り出すことはできません。", "Museum."));
4542 if (st_ptr->stock_num <= 0)
4544 if (cur_store_num == STORE_HOME)
4545 msg_print(_("我が家には何も置いてありません。", "Your home is empty."));
4547 msg_print(_("現在商品の在庫を切らしています。", "I am currently out of stock."));
4551 /* Find the number of objects on this and following pages */
4552 i = (st_ptr->stock_num - store_top);
4554 /* And then restrict it to the current page */
4555 if (i > store_bottom) i = store_bottom;
4559 /* ブラックマーケットの時は別のメッセージ */
4560 switch( cur_store_num ) {
4562 sprintf(out_val, "どのアイテムを取りますか? ");
4565 sprintf(out_val, "どれ? ");
4568 sprintf(out_val, "どの品物が欲しいんだい? ");
4572 if (cur_store_num == STORE_HOME)
4574 sprintf(out_val, "Which item do you want to take? ");
4578 sprintf(out_val, "Which item are you interested in? ");
4583 /* Get the item number to be bought */
4584 if (!get_stock(&item, out_val, 0, i - 1)) return;
4586 /* Get the actual index */
4587 item = item + store_top;
4589 /* Get the actual item */
4590 o_ptr = &st_ptr->stock[item];
4592 /* Assume the player wants just one of them */
4596 /* Get a copy of the object */
4597 object_copy(j_ptr, o_ptr);
4600 * If a rod or wand, allocate total maximum timeouts or charges
4601 * between those purchased and left on the shelf.
4603 reduce_charges(j_ptr, o_ptr->number - amt);
4605 /* Modify quantity */
4606 j_ptr->number = amt;
4608 /* Hack -- require room in pack */
4609 if (!inven_carry_okay(j_ptr))
4611 msg_print(_("そんなにアイテムを持てない。", "You cannot carry that many different items."));
4615 /* Determine the "best" price (per item) */
4616 best = price_item(j_ptr, ot_ptr->min_inflate, FALSE);
4618 /* Find out how many the player wants */
4619 if (o_ptr->number > 1)
4621 /* Hack -- note cost of "fixed" items */
4622 if ((cur_store_num != STORE_HOME) &&
4623 (o_ptr->ident & IDENT_FIXED))
4625 msg_format(_("一つにつき $%ldです。", "That costs %ld gold per item."), (long)(best));
4627 amt = get_quantity(NULL, o_ptr->number);
4628 if (amt <= 0) return;
4632 /* Get desired object */
4633 object_copy(j_ptr, o_ptr);
4636 * If a rod or wand, allocate total maximum timeouts or charges
4637 * between those purchased and left on the shelf.
4639 reduce_charges(j_ptr, o_ptr->number - amt);
4641 /* Modify quantity */
4642 j_ptr->number = amt;
4644 /* Hack -- require room in pack */
4645 if (!inven_carry_okay(j_ptr))
4647 msg_print(_("ザックにそのアイテムを入れる隙間がない。", "You cannot carry that many items."));
4651 /* Attempt to buy it */
4652 if (cur_store_num != STORE_HOME)
4654 /* Fixed price, quick buy */
4655 if (o_ptr->ident & (IDENT_FIXED))
4660 /* Go directly to the "best" deal */
4661 price = (best * j_ptr->number);
4667 /* Describe the object (fully) */
4668 object_desc(o_name, j_ptr, 0);
4669 msg_format(_("%s(%c)を購入する。", "Buying %s (%c)."), o_name, I2A(item));
4672 /* Haggle for a final price */
4673 choice = purchase_haggle(j_ptr, &price);
4675 /* Hack -- Got kicked out */
4676 if (st_ptr->store_open >= current_world_ptr->game_turn) return;
4679 /* Player wants it */
4682 /* Fix the item price (if "correctly" haggled) */
4683 if (price == (best * j_ptr->number)) o_ptr->ident |= (IDENT_FIXED);
4685 /* Player can afford it */
4686 if (p_ptr->au >= price)
4691 if (cur_store_num == STORE_BLACK) /* The black market is illegal! */
4692 chg_virtue(V_JUSTICE, -1);
4693 if((o_ptr->tval == TV_BOTTLE) && (cur_store_num != STORE_HOME))
4694 chg_virtue(V_NATURE, -1);
4702 /* Spend the money */
4705 /* Update the display */
4708 /* Hack -- buying an item makes you aware of it */
4709 object_aware(j_ptr);
4711 /* Hack -- clear the "fixed" flag from the item */
4712 j_ptr->ident &= ~(IDENT_FIXED);
4714 /* Describe the transaction */
4715 object_desc(o_name, j_ptr, 0);
4717 msg_format(_("%sを $%ldで購入しました。", "You bought %s for %ld gold."), o_name, (long)price);
4719 strcpy(record_o_name, o_name);
4720 record_turn = current_world_ptr->game_turn;
4722 if (record_buy) do_cmd_write_nikki(NIKKI_BUY, 0, o_name);
4723 object_desc(o_name, o_ptr, OD_NAME_ONLY);
4724 if(record_rand_art && o_ptr->art_name)
4725 do_cmd_write_nikki(NIKKI_ART, 0, o_name);
4727 /* Erase the inscription */
4728 j_ptr->inscription = 0;
4730 /* Erase the "feeling" */
4731 j_ptr->feeling = FEEL_NONE;
4732 j_ptr->ident &= ~(IDENT_STORE);
4733 /* Give it to the player */
4734 item_new = inven_carry(j_ptr);
4736 /* Describe the final result */
4737 object_desc(o_name, &inventory[item_new], 0);
4738 msg_format(_("%s(%c)を手に入れた。", "You have %s (%c)."), o_name, index_to_label(item_new));
4740 /* Auto-inscription */
4741 autopick_alter_item(item_new, FALSE);
4743 /* Now, reduce the original stack's pval. */
4744 if ((o_ptr->tval == TV_ROD) || (o_ptr->tval == TV_WAND))
4746 o_ptr->pval -= j_ptr->pval;
4750 /* Note how many slots the store used to have */
4751 i = st_ptr->stock_num;
4753 /* Remove the bought items from the store */
4754 store_item_increase(item, -amt);
4755 store_item_optimize(item);
4757 /* Store is empty */
4758 if (st_ptr->stock_num == 0)
4761 if (one_in_(STORE_SHUFFLE))
4764 msg_print(_("店主は引退した。", "The shopkeeper retires."));
4766 /* Shuffle the store */
4767 store_shuffle(cur_store_num);
4770 sprintf(buf, "%s (%s)",
4771 ot_ptr->owner_name, race_info[ot_ptr->owner_race].title);
4772 put_str(buf, 3, 10);
4773 sprintf(buf, "%s (%ld)",
4774 (f_name + f_info[cur_store_feat].name), (long)(ot_ptr->max_cost));
4781 msg_print(_("店主は新たな在庫を取り出した。", "The shopkeeper brings out some new stock."));
4785 for (i = 0; i < 10; i++)
4787 /* Maintain the store */
4788 store_maint(p_ptr->town_num, cur_store_num);
4793 display_inventory();
4796 /* The item is gone */
4797 else if (st_ptr->stock_num != i)
4799 /* Pick the correct screen */
4800 if (store_top >= st_ptr->stock_num) store_top -= store_bottom;
4801 display_inventory();
4804 /* Item is still here */
4807 /* Redraw the item */
4808 display_entry(item);
4812 /* Player cannot afford it */
4815 /* Simple message (no insult) */
4816 msg_print(_("お金が足りません。", "You do not have enough gold."));
4821 /* Home is much easier */
4824 bool combined_or_reordered;
4826 /* Distribute charges of wands/rods */
4827 distribute_charges(o_ptr, j_ptr, amt);
4829 /* Give it to the player */
4830 item_new = inven_carry(j_ptr);
4832 /* Describe just the result */
4833 object_desc(o_name, &inventory[item_new], 0);
4835 msg_format(_("%s(%c)を取った。", "You have %s (%c)."), o_name, index_to_label(item_new));
4838 /* Take note if we take the last one */
4839 i = st_ptr->stock_num;
4841 /* Remove the items from the home */
4842 store_item_increase(item, -amt);
4843 store_item_optimize(item);
4845 combined_or_reordered = combine_and_reorder_home(STORE_HOME);
4847 /* Hack -- Item is still here */
4848 if (i == st_ptr->stock_num)
4850 if (combined_or_reordered) display_inventory();
4852 /* Redraw the item */
4853 else display_entry(item);
4856 /* The item is gone */
4860 if (st_ptr->stock_num == 0) store_top = 0;
4862 /* Nothing left on that screen */
4863 else if (store_top >= st_ptr->stock_num) store_top -= store_bottom;
4864 display_inventory();
4866 chg_virtue(V_SACRIFICE, 1);
4870 /* Not kicked out */
4876 * @brief 店からの売却処理のメインルーチン /
4877 * Sell an item to the store (or home)
4880 static void store_sell(void)
4887 PRICE price, value, dummy;
4895 GAME_TEXT o_name[MAX_NLEN];
4898 /* Prepare a prompt */
4899 if (cur_store_num == STORE_HOME)
4900 q = _("どのアイテムを置きますか? ", "Drop which item? ");
4902 else if (cur_store_num == STORE_MUSEUM)
4903 q = _("どのアイテムを寄贈しますか? ", "Give which item? ");
4906 q = _("どのアイテムを売りますか? ", "Sell which item? ");
4908 /* Only allow items the store will buy */
4909 item_tester_hook = store_will_buy;
4911 /* 我が家でおかしなメッセージが出るオリジナルのバグを修正 */
4912 if (cur_store_num == STORE_HOME)
4914 s = _("置けるアイテムを持っていません。", "You don't have any item to drop.");
4916 else if (cur_store_num == STORE_MUSEUM)
4918 s = _("寄贈できるアイテムを持っていません。", "You don't have any item to give.");
4922 s = _("欲しい物がないですねえ。", "You have nothing that I want.");
4925 o_ptr = choose_object(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT));
4928 /* Hack -- Cannot remove cursed items */
4929 if ((item >= INVEN_RARM) && object_is_cursed(o_ptr))
4931 msg_print(_("ふーむ、どうやらそれは呪われているようだね。", "Hmmm, it seems to be cursed."));
4935 /* Assume one item */
4938 if (o_ptr->number > 1)
4940 amt = get_quantity(NULL, o_ptr->number);
4941 if (amt <= 0) return;
4945 /* Get a copy of the object */
4946 object_copy(q_ptr, o_ptr);
4948 /* Modify quantity */
4949 q_ptr->number = amt;
4952 * Hack -- If a rod or wand, allocate total maximum
4953 * timeouts or charges to those being sold. -LM-
4955 if ((o_ptr->tval == TV_ROD) || (o_ptr->tval == TV_WAND))
4957 q_ptr->pval = o_ptr->pval * amt / o_ptr->number;
4960 /* Get a full description */
4961 object_desc(o_name, q_ptr, 0);
4963 /* Remove any inscription, feeling for stores */
4964 if ((cur_store_num != STORE_HOME) && (cur_store_num != STORE_MUSEUM))
4966 q_ptr->inscription = 0;
4967 q_ptr->feeling = FEEL_NONE;
4970 /* Is there room in the store (or the home?) */
4971 if (!store_check_num(q_ptr))
4973 if (cur_store_num == STORE_HOME)
4974 msg_print(_("我が家にはもう置く場所がない。", "Your home is full."));
4976 else if (cur_store_num == STORE_MUSEUM)
4977 msg_print(_("博物館はもう満杯だ。", "Museum is full."));
4980 msg_print(_("すいませんが、店にはもう置く場所がありません。", "I have not the room in my store to keep it."));
4987 if ((cur_store_num != STORE_HOME) && (cur_store_num != STORE_MUSEUM))
4989 /* Describe the transaction */
4990 msg_format(_("%s(%c)を売却する。", "Selling %s (%c)."), o_name, index_to_label(item));
4995 choice = sell_haggle(q_ptr, &price);
4998 if (st_ptr->store_open >= current_world_ptr->game_turn) return;
5010 if (cur_store_num == STORE_BLACK) /* The black market is illegal! */
5011 chg_virtue(V_JUSTICE, -1);
5013 if((o_ptr->tval == TV_BOTTLE) && (cur_store_num != STORE_HOME))
5014 chg_virtue(V_NATURE, 1);
5017 /* Get some money */
5020 /* Update the display */
5023 /* Get the "apparent" value */
5024 dummy = object_value(q_ptr) * q_ptr->number;
5026 identify_item(o_ptr);
5029 /* Get a copy of the object */
5030 object_copy(q_ptr, o_ptr);
5032 /* Modify quantity */
5033 q_ptr->number = amt;
5035 /* Make it look like to be known */
5036 q_ptr->ident |= IDENT_STORE;
5039 * Hack -- If a rod or wand, let the shopkeeper know just
5040 * how many charges he really paid for. -LM-
5042 if ((o_ptr->tval == TV_ROD) || (o_ptr->tval == TV_WAND))
5044 q_ptr->pval = o_ptr->pval * amt / o_ptr->number;
5047 /* Get the "actual" value */
5048 value = object_value(q_ptr) * q_ptr->number;
5050 /* Get the description all over again */
5051 object_desc(o_name, q_ptr, 0);
5053 /* Describe the result (in message buffer) */
5054 msg_format(_("%sを $%ldで売却しました。", "You sold %s for %ld gold."), o_name, (long)price);
5056 if (record_sell) do_cmd_write_nikki(NIKKI_SELL, 0, o_name);
5058 if (!((o_ptr->tval == TV_FIGURINE) && (value > 0)))
5060 /* Analyze the prices (and comment verbally) unless a figurine*/
5061 purchase_analyze(price, value, dummy);
5065 * Hack -- Allocate charges between those wands or rods sold
5066 * and retained, unless all are being sold. -LM-
5068 distribute_charges(o_ptr, q_ptr, amt);
5070 /* Reset timeouts of the sold items */
5073 /* Take the item from the player, describe the result */
5074 inven_item_increase(item, -amt);
5075 inven_item_describe(item);
5077 /* If items remain, auto-inscribe before optimizing */
5078 if (o_ptr->number > 0)
5079 autopick_alter_item(item, FALSE);
5081 inven_item_optimize(item);
5084 /* The store gets that (known) item */
5085 item_pos = store_carry(q_ptr);
5087 /* Re-display if item is now in store */
5090 store_top = (item_pos / store_bottom) * store_bottom;
5091 display_inventory();
5096 /* Player is at museum */
5097 else if (cur_store_num == STORE_MUSEUM)
5099 char o2_name[MAX_NLEN];
5100 object_desc(o2_name, q_ptr, OD_NAME_ONLY);
5102 if (-1 == store_check_num(q_ptr))
5104 msg_print(_("それと同じ品物は既に博物館にあるようです。", "The Museum already has one of those items."));
5108 msg_print(_("博物館に寄贈したものは取り出すことができません!!", "You cannot take back items which have been donated to the Museum!!"));
5111 if (!get_check(format(_("本当に%sを寄贈しますか?", "Really give %s to the Museum? "), o2_name))) return;
5113 identify_item(q_ptr);
5114 q_ptr->ident |= IDENT_MENTAL;
5116 /* Distribute charges of wands/rods */
5117 distribute_charges(o_ptr, q_ptr, amt);
5118 msg_format(_("%sを置いた。(%c)", "You drop %s (%c)."), o_name, index_to_label(item));
5121 /* Take it from the players inventory */
5122 inven_item_increase(item, -amt);
5123 inven_item_describe(item);
5124 inven_item_optimize(item);
5127 /* Let the home carry it */
5128 item_pos = home_carry(q_ptr);
5130 /* Update store display */
5133 store_top = (item_pos / store_bottom) * store_bottom;
5134 display_inventory();
5137 /* Player is at home */
5140 /* Distribute charges of wands/rods */
5141 distribute_charges(o_ptr, q_ptr, amt);
5142 msg_format(_("%sを置いた。(%c)", "You drop %s (%c)."), o_name, index_to_label(item));
5146 /* Take it from the players inventory */
5147 inven_item_increase(item, -amt);
5148 inven_item_describe(item);
5149 inven_item_optimize(item);
5152 /* Let the home carry it */
5153 item_pos = home_carry(q_ptr);
5155 /* Update store display */
5158 store_top = (item_pos / store_bottom) * store_bottom;
5159 display_inventory();
5163 if ((choice == 0) && (item >= INVEN_RARM))
5172 * @brief 店のアイテムを調べるコマンドのメインルーチン /
5173 * Examine an item in a store -JDL-
5176 static void store_examine(void)
5181 GAME_TEXT o_name[MAX_NLEN];
5185 if (st_ptr->stock_num <= 0)
5187 if (cur_store_num == STORE_HOME)
5188 msg_print(_("我が家には何も置いてありません。", "Your home is empty."));
5189 else if (cur_store_num == STORE_MUSEUM)
5190 msg_print(_("博物館には何も置いてありません。", "Museum is empty."));
5192 msg_print(_("現在商品の在庫を切らしています。", "I am currently out of stock."));
5196 /* Find the number of objects on this and following pages */
5197 i = (st_ptr->stock_num - store_top);
5199 /* And then restrict it to the current page */
5200 if (i > store_bottom) i = store_bottom;
5203 sprintf(out_val, _("どれを調べますか?", "Which item do you want to examine? "));
5205 /* Get the item number to be examined */
5206 if (!get_stock(&item, out_val, 0, i - 1)) return;
5208 /* Get the actual index */
5209 item = item + store_top;
5211 /* Get the actual item */
5212 o_ptr = &st_ptr->stock[item];
5214 /* Require full knowledge */
5215 if (!(o_ptr->ident & IDENT_MENTAL))
5217 /* This can only happen in the home */
5218 msg_print(_("このアイテムについて特に知っていることはない。", "You have no special knowledge about that item."));
5222 object_desc(o_name, o_ptr, 0);
5223 msg_format(_("%sを調べている...", "Examining %s..."), o_name);
5225 if (!screen_object(o_ptr, SCROBJ_FORCE_DETAIL))
5226 msg_print(_("特に変わったところはないようだ。", "You see nothing special."));
5233 * @brief 博物館のアイテムを除去するコマンドのメインルーチン /
5234 * Remove an item from museum (Originally from TOband)
5237 static void museum_remove_object(void)
5242 GAME_TEXT o_name[MAX_NLEN];
5246 if (st_ptr->stock_num <= 0)
5248 msg_print(_("博物館には何も置いてありません。", "Museum is empty."));
5252 /* Find the number of objects on this and following pages */
5253 i = st_ptr->stock_num - store_top;
5255 /* And then restrict it to the current page */
5256 if (i > store_bottom) i = store_bottom;
5259 sprintf(out_val, _("どのアイテムの展示をやめさせますか?", "Which item do you want to order to remove? "));
5261 /* Get the item number to be removed */
5262 if (!get_stock(&item, out_val, 0, i - 1)) return;
5264 /* Get the actual index */
5265 item = item + store_top;
5267 /* Get the actual item */
5268 o_ptr = &st_ptr->stock[item];
5270 object_desc(o_name, o_ptr, 0);
5272 msg_print(_("展示をやめさせたアイテムは二度と見ることはできません!", "Once removed from the Museum, an item will be gone forever!"));
5273 if (!get_check(format(_("本当に%sの展示をやめさせますか?", "Really order to remove %s from the Museum? "), o_name))) return;
5275 msg_format(_("%sの展示をやめさせた。", "You ordered to remove %s."), o_name);
5277 /* Remove the items from the home */
5278 store_item_increase(item, -o_ptr->number);
5279 store_item_optimize(item);
5281 (void)combine_and_reorder_home(STORE_MUSEUM);
5283 /* The item is gone */
5286 if (st_ptr->stock_num == 0) store_top = 0;
5288 /* Nothing left on that screen */
5289 else if (store_top >= st_ptr->stock_num) store_top -= store_bottom;
5290 display_inventory();
5297 * Hack -- set this to leave the store
5299 static bool leave_store = FALSE;
5303 * @brief 店舗処理コマンド選択のメインルーチン /
5304 * Process a command in a store
5308 * Note that we must allow the use of a few "special" commands
5309 * in the stores which are not allowed in the dungeon, and we
5310 * must disable some commands which are allowed in the dungeon
5311 * but not in the stores, to prevent chaos.
5314 static void store_process_command(void)
5316 /* Handle repeating the last command */
5319 if (rogue_like_commands && command_cmd == 'l')
5321 command_cmd = 'x'; /* hack! */
5324 /* Parse the command */
5325 switch (command_cmd)
5335 /* 1 ページ戻るコマンド: 我が家のページ数が多いので重宝するはず By BUG */
5338 if (st_ptr->stock_num <= store_bottom) {
5339 msg_print(_("これで全部です。", "Entire inventory is shown."));
5342 store_top -= store_bottom;
5343 if ( store_top < 0 )
5344 store_top = ((st_ptr->stock_num - 1 )/store_bottom) * store_bottom;
5345 if ( (cur_store_num == STORE_HOME) && (powerup_home == FALSE) )
5346 if ( store_top >= store_bottom ) store_top = store_bottom;
5347 display_inventory();
5355 if (st_ptr->stock_num <= store_bottom)
5357 msg_print(_("これで全部です。", "Entire inventory is shown."));
5361 store_top += store_bottom;
5363 * 隠しオプション(powerup_home)がセットされていないときは
5364 * 我が家では 2 ページまでしか表示しない
5366 if ((cur_store_num == STORE_HOME) &&
5367 (powerup_home == FALSE) &&
5368 (st_ptr->stock_num >= STORE_INVEN_MAX))
5370 if (store_top >= (STORE_INVEN_MAX - 1))
5377 if (store_top >= st_ptr->stock_num) store_top = 0;
5380 display_inventory();
5392 /* Get (purchase) */
5419 /*** Inventory Commands ***/
5421 /* Wear/wield equipment */
5428 /* Take off equipment */
5435 /* Destroy an item */
5442 /* Equipment list */
5449 /* Inventory list */
5457 /*** Various commands ***/
5459 /* Identify an object */
5466 /* Hack -- toggle windows */
5469 toggle_inven_equip();
5473 /*** Use various objects ***/
5478 if ( (p_ptr->pclass == CLASS_MINDCRAFTER) ||
5479 (p_ptr->pclass == CLASS_BERSERKER) ||
5480 (p_ptr->pclass == CLASS_NINJA) ||
5481 (p_ptr->pclass == CLASS_MIRROR_MASTER)
5482 ) do_cmd_mind_browse();
5483 else if (p_ptr->pclass == CLASS_SMITH)
5485 else if (p_ptr->pclass == CLASS_MAGIC_EATER)
5486 do_cmd_magic_eater(TRUE, FALSE);
5487 else if (p_ptr->pclass == CLASS_SNIPER)
5488 do_cmd_snipe_browse();
5489 else do_cmd_browse();
5493 /* Inscribe an object */
5500 /* Uninscribe an object */
5503 do_cmd_uninscribe();
5509 /*** Help and Such ***/
5518 /* Identify symbol */
5521 do_cmd_query_symbol();
5525 /* Character description */
5528 p_ptr->town_num = old_town_num;
5529 do_cmd_change_name();
5530 p_ptr->town_num = inner_town_num;
5536 /*** System Commands ***/
5538 /* Hack -- User interface */
5545 /* Single line from a pref file */
5548 p_ptr->town_num = old_town_num;
5550 p_ptr->town_num = inner_town_num;
5554 /* Interact with macros */
5557 p_ptr->town_num = old_town_num;
5559 p_ptr->town_num = inner_town_num;
5563 /* Interact with visuals */
5566 p_ptr->town_num = old_town_num;
5568 p_ptr->town_num = inner_town_num;
5572 /* Interact with colors */
5575 p_ptr->town_num = old_town_num;
5577 p_ptr->town_num = inner_town_num;
5581 /* Interact with options */
5585 (void)combine_and_reorder_home(STORE_HOME);
5591 /*** Misc Commands ***/
5607 /* Repeat level feeling */
5614 /* Show previous message */
5617 do_cmd_message_one();
5621 /* Show previous messages */
5634 /* Check artifacts, uniques etc. */
5641 /* Load "screen dump" */
5644 do_cmd_load_screen();
5648 /* Save "screen dump" */
5651 do_cmd_save_screen();
5655 /* Hack -- Unknown command */
5658 if ((cur_store_num == STORE_MUSEUM) && (command_cmd == 'r'))
5660 museum_remove_object();
5664 msg_print(_("そのコマンドは店の中では使えません。", "That command does not work in stores."));
5673 * @brief 店舗処理全体のメインルーチン /
5674 * Enter a store, and interact with it. *
5678 * Note that we use the standard "request_command()" function
5679 * to get a command, allowing us to use "command_arg" and all
5680 * command macros and other nifty stuff, but we use the special
5681 * "shopping" argument, to force certain commands to be converted
5682 * into other commands, normally, we convert "p" (pray) and "m"
5683 * (cast magic) into "g" (get), and "s" (search) into "d" (drop).
5686 void do_cmd_store(void)
5692 bool need_redraw_store_inv; /* To redraw missiles damage and prices in store */
5695 if(p_ptr->wild_mode) return;
5696 Term_get_size(&w, &h);
5698 /* Calculate stocks per 1 page */
5699 xtra_stock = MIN(14+26, ((h > 24) ? (h - 24) : 0));
5700 store_bottom = MIN_STOCK + xtra_stock;
5702 /* Access the player grid */
5703 g_ptr = ¤t_floor_ptr->grid_array[p_ptr->y][p_ptr->x];
5705 /* Verify a store */
5706 if (!cave_have_flag_grid(g_ptr, FF_STORE))
5708 msg_print(_("ここには店がありません。", "You see no store here."));
5712 /* Extract the store code */
5713 which = f_info[g_ptr->feat].subtype;
5715 old_town_num = p_ptr->town_num;
5716 if ((which == STORE_HOME) || (which == STORE_MUSEUM)) p_ptr->town_num = 1;
5717 if (current_floor_ptr->dun_level) p_ptr->town_num = NO_TOWN;
5718 inner_town_num = p_ptr->town_num;
5720 /* Hack -- Check the "locked doors" */
5721 if ((town_info[p_ptr->town_num].store[which].store_open >= current_world_ptr->game_turn) ||
5724 msg_print(_("ドアに鍵がかかっている。", "The doors are locked."));
5725 p_ptr->town_num = old_town_num;
5729 /* Calculate the number of store maintainances since the last visit */
5730 maintain_num = (current_world_ptr->game_turn - town_info[p_ptr->town_num].store[which].last_visit) / (TURNS_PER_TICK * STORE_TICKS);
5732 /* Maintain the store max. 10 times */
5733 if (maintain_num > 10) maintain_num = 10;
5737 /* Maintain the store */
5738 for (i = 0; i < maintain_num; i++)
5739 store_maint(p_ptr->town_num, which);
5741 /* Save the visit */
5742 town_info[p_ptr->town_num].store[which].last_visit = current_world_ptr->game_turn;
5748 /* Hack -- Character is in "icky" mode */
5749 character_icky = TRUE;
5756 /* Do not expand macros */
5757 get_com_no_macros = TRUE;
5759 /* Save the store number */
5760 cur_store_num = which;
5762 /* Hack -- save the store feature */
5763 cur_store_feat = g_ptr->feat;
5765 /* Save the store and owner pointers */
5766 st_ptr = &town_info[p_ptr->town_num].store[cur_store_num];
5767 ot_ptr = &owners[cur_store_num][st_ptr->owner];
5769 /* Start at the beginning */
5772 play_music(TERM_XTRA_MUSIC_BASIC, MUSIC_BASIC_BUILD);
5777 leave_store = FALSE;
5779 /* Interact with player */
5780 while (!leave_store)
5782 /* Hack -- Clear line 1 */
5786 clear_from(20 + xtra_stock);
5788 /* Basic commands */
5789 prt(_(" ESC) 建物から出る", " ESC) Exit from Building."), 21 + xtra_stock, 0);
5791 /* Browse if necessary */
5792 if (st_ptr->stock_num > store_bottom)
5794 prt(_(" -)前ページ", " -) Previous page"), 22 + xtra_stock, 0);
5795 prt(_(" スペース) 次ページ", " SPACE) Next page"), 23 + xtra_stock, 0);
5799 if (cur_store_num == STORE_HOME)
5801 prt(_("g) アイテムを取る", "g) Get an item."), 21 + xtra_stock, 27);
5802 prt(_("d) アイテムを置く", "d) Drop an item."), 22 + xtra_stock, 27);
5803 prt(_("x) 家のアイテムを調べる", "x) eXamine an item in the home."), 23 + xtra_stock, 27);
5806 /* Museum commands */
5807 else if (cur_store_num == STORE_MUSEUM)
5809 prt(_("d) アイテムを置く", "d) Drop an item."), 21 + xtra_stock, 27);
5810 prt(_("r) アイテムの展示をやめる", "r) order to Remove an item."), 22 + xtra_stock, 27);
5811 prt(_("x) 博物館のアイテムを調べる", "x) eXamine an item in the museum."), 23 + xtra_stock, 27);
5817 prt(_("p) 商品を買う", "p) Purchase an item."), 21 + xtra_stock, 30);
5818 prt(_("s) アイテムを売る", "s) Sell an item."), 22 + xtra_stock, 30);
5819 prt(_("x) 商品を調べる", "x) eXamine an item in the shop"), 23 + xtra_stock,30);
5823 prt(_("i/e) 持ち物/装備の一覧", "i/e) Inventry/Equipment list"), 21 + xtra_stock, 56);
5825 if (rogue_like_commands)
5827 prt(_("w/T) 装備する/はずす", "w/T) Wear/Take off equipment"), 22 + xtra_stock, 56);
5831 prt(_("w/t) 装備する/はずす", "w/t) Wear/Take off equipment"), 22 + xtra_stock, 56);
5835 prt(_("コマンド:", "You may: "), 20 + xtra_stock, 0);
5837 request_command(TRUE);
5839 /* Process the command */
5840 store_process_command();
5843 * Hack -- To redraw missiles damage and prices in store
5844 * If player's charisma changes, or if player changes a bow, PU_BONUS is set
5846 need_redraw_store_inv = (p_ptr->update & PU_BONUS) ? TRUE : FALSE;
5848 /* Hack -- Character is still in "icky" mode */
5849 character_icky = TRUE;
5854 if (inventory[INVEN_PACK].k_idx)
5856 INVENTORY_IDX item = INVEN_PACK;
5858 object_type *o_ptr = &inventory[item];
5860 /* Hack -- Flee from the store */
5861 if (cur_store_num != STORE_HOME)
5863 if (cur_store_num == STORE_MUSEUM)
5864 msg_print(_("ザックからアイテムがあふれそうなので、あわてて博物館から出た...", "Your pack is so full that you flee the Museum..."));
5866 msg_print(_("ザックからアイテムがあふれそうなので、あわてて店から出た...", "Your pack is so full that you flee the store..."));
5872 /* Hack -- Flee from the home */
5873 else if (!store_check_num(o_ptr))
5875 msg_print(_("ザックからアイテムがあふれそうなので、あわてて家から出た...", "Your pack is so full that you flee your home..."));
5880 /* Hack -- Drop items into the home */
5888 GAME_TEXT o_name[MAX_NLEN];
5890 /* Give a message */
5891 msg_print(_("ザックからアイテムがあふれてしまった!", "Your pack overflows!"));
5895 object_copy(q_ptr, o_ptr);
5896 object_desc(o_name, q_ptr, 0);
5898 msg_format(_("%sが落ちた。(%c)", "You drop %s (%c)."), o_name, index_to_label(item));
5900 /* Remove it from the players inventory */
5901 inven_item_increase(item, -255);
5902 inven_item_describe(item);
5903 inven_item_optimize(item);
5906 /* Let the home carry it */
5907 item_pos = home_carry(q_ptr);
5909 /* Redraw the home */
5912 store_top = (item_pos / store_bottom) * store_bottom;
5913 display_inventory();
5918 /* Hack -- Redisplay store prices if charisma changes */
5919 /* Hack -- Redraw missiles damage if player changes bow */
5920 if (need_redraw_store_inv) display_inventory();
5922 /* Hack -- get kicked out of the store */
5923 if (st_ptr->store_open >= current_world_ptr->game_turn) leave_store = TRUE;
5926 select_floor_music();
5928 p_ptr->town_num = old_town_num;
5930 take_turn(p_ptr, 100);
5932 /* Hack -- Character is no longer in "icky" mode */
5933 character_icky = FALSE;
5935 /* Hack -- Cancel automatic command */
5938 /* Hack -- Cancel "see" mode */
5939 command_see = FALSE;
5941 /* Allow expanding macros */
5942 get_com_no_macros = FALSE;
5947 /* Update everything */
5948 p_ptr->update |= (PU_VIEW | PU_LITE | PU_MON_LITE);
5949 p_ptr->update |= (PU_MONSTERS);
5951 /* Redraw entire screen */
5952 p_ptr->redraw |= (PR_BASIC | PR_EXTRA | PR_EQUIPPY);
5953 p_ptr->redraw |= (PR_MAP);
5954 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
5960 * @brief 現在の町の店主を交代させる /
5961 * Shuffle one of the stores.
5962 * @param which 店舗種類のID
5965 void store_shuffle(int which)
5971 if (which == STORE_HOME) return;
5972 if (which == STORE_MUSEUM) return;
5975 /* Save the store index */
5976 cur_store_num = which;
5978 /* Activate that store */
5979 st_ptr = &town_info[p_ptr->town_num].store[cur_store_num];
5982 /* Pick a new owner */
5985 st_ptr->owner = (byte)randint0(MAX_OWNERS);
5986 if (j == st_ptr->owner) continue;
5987 for (i = 1;i < max_towns; i++)
5989 if (i == p_ptr->town_num) continue;
5990 if (st_ptr->owner == town_info[i].store[cur_store_num].owner) break;
5992 if (i == max_towns) break;
5995 /* Activate the new owner */
5996 ot_ptr = &owners[cur_store_num][st_ptr->owner];
5999 /* Reset the owner data */
6000 st_ptr->insult_cur = 0;
6001 st_ptr->store_open = 0;
6002 st_ptr->good_buy = 0;
6003 st_ptr->bad_buy = 0;
6006 /* Hack -- discount all the items */
6007 for (i = 0; i < st_ptr->stock_num; i++)
6011 o_ptr = &st_ptr->stock[i];
6013 if (!object_is_artifact(o_ptr))
6015 /* Hack -- Sell all non-artifact old items for "half price" */
6016 o_ptr->discount = 50;
6018 /* Hack -- Items are no longer "fixed price" */
6019 o_ptr->ident &= ~(IDENT_FIXED);
6021 /* Mega-Hack -- Note that the item is "on sale" */
6022 o_ptr->inscription = quark_add(_("売出中", "on sale"));
6029 * @brief 店の品揃えを変化させる /
6030 * Maintain the inventory at the stores.
6031 * @param town_num 町のID
6032 * @param store_num 店舗種類のID
6035 void store_maint(int town_num, int store_num)
6039 cur_store_num = store_num;
6042 if (store_num == STORE_HOME) return;
6043 if (store_num == STORE_MUSEUM) return;
6045 /* Activate that store */
6046 st_ptr = &town_info[town_num].store[store_num];
6048 /* Activate the owner */
6049 ot_ptr = &owners[store_num][st_ptr->owner];
6051 /* Store keeper forgives the player */
6052 st_ptr->insult_cur = 0;
6054 /* Mega-Hack -- prune the black market */
6055 if (store_num == STORE_BLACK)
6057 /* Destroy crappy black market items */
6058 for (j = st_ptr->stock_num - 1; j >= 0; j--)
6060 object_type *o_ptr = &st_ptr->stock[j];
6062 /* Destroy crappy items */
6063 if (black_market_crap(o_ptr))
6065 /* Destroy the item */
6066 store_item_increase(j, 0 - o_ptr->number);
6067 store_item_optimize(j);
6073 /* Choose the number of slots to keep */
6074 j = st_ptr->stock_num;
6076 /* Sell a few items */
6077 j = j - randint1(STORE_TURNOVER);
6079 /* Never keep more than "STORE_MAX_KEEP" slots */
6080 if (j > STORE_MAX_KEEP) j = STORE_MAX_KEEP;
6082 /* Always "keep" at least "STORE_MIN_KEEP" items */
6083 if (j < STORE_MIN_KEEP) j = STORE_MIN_KEEP;
6085 /* Hack -- prevent "underflow" */
6088 /* Destroy objects until only "j" slots are left */
6089 while (st_ptr->stock_num > j) store_delete();
6092 /* Choose the number of slots to fill */
6093 j = st_ptr->stock_num;
6095 /* Buy some more items */
6096 j = j + randint1(STORE_TURNOVER);
6098 /* Never keep more than "STORE_MAX_KEEP" slots */
6099 if (j > STORE_MAX_KEEP) j = STORE_MAX_KEEP;
6101 /* Always "keep" at least "STORE_MIN_KEEP" items */
6102 if (j < STORE_MIN_KEEP) j = STORE_MIN_KEEP;
6104 /* Hack -- prevent "overflow" */
6105 if (j >= st_ptr->stock_size) j = st_ptr->stock_size - 1;
6107 /* Acquire some new items */
6108 while (st_ptr->stock_num < j) store_create();
6113 * @brief 店舗情報を初期化する /
6114 * Initialize the stores
6115 * @param town_num 町のID
6116 * @param store_num 店舗種類のID
6119 void store_init(int town_num, int store_num)
6122 cur_store_num = store_num;
6124 /* Activate that store */
6125 st_ptr = &town_info[town_num].store[store_num];
6133 st_ptr->owner = (byte)randint0(MAX_OWNERS);
6134 for (i = 1;i < max_towns; i++)
6136 if (i == town_num) continue;
6137 if (st_ptr->owner == town_info[i].store[store_num].owner) break;
6139 if (i == max_towns) break;
6142 /* Activate the new owner */
6143 ot_ptr = &owners[store_num][st_ptr->owner];
6146 /* Initialize the store */
6147 st_ptr->store_open = 0;
6148 st_ptr->insult_cur = 0;
6149 st_ptr->good_buy = 0;
6150 st_ptr->bad_buy = 0;
6152 /* Nothing in stock */
6153 st_ptr->stock_num = 0;
6156 * MEGA-HACK - Last visit to store is
6157 * BEFORE player birth to enable store restocking
6159 st_ptr->last_visit = -10L * TURNS_PER_TICK * STORE_TICKS;
6161 /* Clear any old items */
6162 for (k = 0; k < st_ptr->stock_size; k++)
6164 object_wipe(&st_ptr->stock[k]);
6170 * @brief アイテムを町のブラックマーケットに移動させる /
6171 * @param o_ptr 移動させたいオブジェクトの構造体参照ポインタ
6174 void move_to_black_market(object_type *o_ptr)
6177 if (!p_ptr->town_num) return;
6179 st_ptr = &town_info[p_ptr->town_num].store[STORE_BLACK];
6181 o_ptr->ident |= IDENT_STORE;
6183 (void)store_carry(o_ptr);
6185 object_wipe(o_ptr); /* Don't leave a bogus object behind... */