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-zapwand.h"
16 #include "cmd-magiceat.h"
19 #include "cmd-spell.h"
21 #include "player-status.h"
22 #include "object-hook.h"
27 * @brief 闘技場のモンスターID及び報酬アイテムテーブル /
28 * Store owners (exactly four "possible" owners per store, chosen randomly)
31 * { name, purse, max greed, min greed, haggle_per, tolerance, race, unused }
33 * Lifted extra shopkeepers from CthAngband (don't you just love open source
34 * development? ;-)). Since this gave less than 32 unique names for some
35 * shops, those have their first x names copied to reach 32.
37 * For the weapon and armour shops, several owners have a limit of 5k.
39 * I want to do 50k owners, but the purse is currently s16b. Perhaps
40 * we should just store 1/10th of the purse?
43 const owner_type owners[MAX_STORES][MAX_OWNERS] =
46 /* General store - 32 unique names */
48 Raistlin は dragonlance の powerful wizard 。
49 Rincewind the Chicken は Terry Pratchett の Discworld の登場人物 上記のパロディ?、
50 { "憶病者ラストリン", 200, 175, 108, 4, 12, RACE_HUMAN},
51 { "Raistlin the Chicken", 200, 175, 108, 4, 12, RACE_HUMAN},
55 { "フレンドリーなビルボ", 200, 170, 108, 5, 15, RACE_HOBBIT},
56 { "憶病者リンスウィンド", 200, 175, 108, 4, 12, RACE_HUMAN},
57 { "背の低いサルタン", 300, 170, 107, 5, 15, RACE_GNOME},
58 { "ハンサムなライア=エル", 300, 165, 107, 6, 18, RACE_ELF},
59 { "親切なファリルマウエン", 250, 170, 108, 5, 15, RACE_HOBBIT},
60 { "臆病者ヴォワラン", 500, 175, 108, 4, 12, RACE_HUMAN},
61 { "チビのエラシュナク", 750, 170, 107, 5, 15, RACE_BEASTMAN},
62 { "ハンサムなグラッグ", 1000, 165, 107, 6, 18, RACE_HALF_TITAN},
63 { "ケチなフォロビア", 250, 170, 108, 5, 15, RACE_HUMAN},
64 { "馬鹿のエリス", 500, 175, 108, 4, 12, RACE_HUMAN},
65 { "腹ペコのフィルバート", 750, 170, 107, 5, 15, RACE_VAMPIRE},
66 { "スナーグル・サシグア", 1000, 165, 107, 6, 18, RACE_MIND_FLAYER},
67 { "長死きエロワーズ", 250, 170, 108, 5, 15, RACE_SPECTRE},
68 { "ノロマのフンディ", 500, 175, 108, 4, 12, RACE_ZOMBIE},
69 { "グランサス", 750, 170, 107, 5, 15, RACE_SKELETON},
70 { "丁寧なロラックス", 1000, 165, 107, 6, 18, RACE_VAMPIRE},
71 { "ブッチ", 250, 170, 108, 5, 15, RACE_HALF_ORC},
72 { "美しきエルベレス", 500, 175, 108, 4, 12, RACE_HIGH_ELF},
73 { "こそこそサーレス", 750, 170, 107, 5, 15, RACE_GNOME},
74 { "ナーロック", 1000, 165, 107, 6, 18, RACE_DWARF},
75 { "チビのヘイネッカ", 250, 170, 108, 5, 15, RACE_GNOME},
76 { "きちがいロワラン", 500, 175, 108, 4, 12, RACE_HALF_GIANT},
77 { "毒息のウート", 750, 170, 107, 5, 15, RACE_DRACONIAN},
78 { "でぶっちょアラァカ", 1000, 165, 107, 6, 18, RACE_DRACONIAN},
79 { "低能なプーゴー", 250, 170, 108, 5, 15, RACE_BEASTMAN},
80 { "フェロールフィリアン", 500, 175, 108, 4, 12, RACE_ELF},
81 { "年寄りマロカ", 750, 170, 107, 5, 15, RACE_GNOME},
82 { "勇敢なサシン", 1000, 165, 107, 6, 18, RACE_HALF_GIANT},
83 { "田舎者アビエマール", 250, 170, 108, 5, 15, RACE_HUMAN},
84 { "貧乏なハーク", 500, 175, 108, 4, 12, RACE_HALF_ORC},
85 { "みじめなソアリン", 750, 170, 107, 5, 15, RACE_ZOMBIE},
86 { "質素なメルラ", 1000, 165, 107, 6, 18, RACE_ELF},
88 { "Bilbo the Friendly", 200, 170, 108, 5, 15, RACE_HOBBIT},
89 { "Rincewind the Chicken", 200, 175, 108, 4, 12, RACE_HUMAN},
90 { "Sultan the Midget", 300, 170, 107, 5, 15, RACE_GNOME},
91 { "Lyar-el the Comely", 300, 165, 107, 6, 18, RACE_ELF},
92 { "Falilmawen the Friendly", 250, 170, 108, 5, 15, RACE_HOBBIT},
93 { "Voirin the Cowardly", 500, 175, 108, 4, 12, RACE_HUMAN},
94 { "Erashnak the Midget", 750, 170, 107, 5, 15, RACE_BEASTMAN},
95 { "Grug the Comely", 1000, 165, 107, 6, 18, RACE_HALF_TITAN},
96 { "Forovir the Cheap", 250, 170, 108, 5, 15, RACE_HUMAN},
97 { "Ellis the Fool", 500, 175, 108, 4, 12, RACE_HUMAN},
98 { "Filbert the Hungry", 750, 170, 107, 5, 15, RACE_VAMPIRE},
99 { "Fthnargl Psathiggua", 1000, 165, 107, 6, 18, RACE_MIND_FLAYER},
100 { "Eloise Long-Dead", 250, 170, 108, 5, 15, RACE_SPECTRE},
101 { "Fundi the Slow", 500, 175, 108, 4, 12, RACE_ZOMBIE},
102 { "Granthus", 750, 170, 107, 5, 15, RACE_SKELETON},
103 { "Lorax the Suave", 1000, 165, 107, 6, 18, RACE_VAMPIRE},
104 { "Butch", 250, 170, 108, 5, 15, RACE_HALF_ORC},
105 { "Elbereth the Beautiful", 500, 175, 108, 4, 12, RACE_HIGH_ELF},
106 { "Sarleth the Sneaky", 750, 170, 107, 5, 15, RACE_GNOME},
107 { "Narlock", 1000, 165, 107, 6, 18, RACE_DWARF},
108 { "Haneka the Small", 250, 170, 108, 5, 15, RACE_GNOME},
109 { "Loirin the Mad", 500, 175, 108, 4, 12, RACE_HALF_GIANT},
110 { "Wuto Poisonbreath", 750, 170, 107, 5, 15, RACE_DRACONIAN},
111 { "Araaka the Rotund", 1000, 165, 107, 6, 18, RACE_DRACONIAN},
112 { "Poogor the Dumb", 250, 170, 108, 5, 15, RACE_BEASTMAN},
113 { "Felorfiliand", 500, 175, 108, 4, 12, RACE_ELF},
114 { "Maroka the Aged", 750, 170, 107, 5, 15, RACE_GNOME},
115 { "Sasin the Bold", 1000, 165, 107, 6, 18, RACE_HALF_GIANT},
116 { "Abiemar the Peasant", 250, 170, 108, 5, 15, RACE_HUMAN},
117 { "Hurk the Poor", 500, 175, 108, 4, 12, RACE_HALF_ORC},
118 { "Soalin the Wretched", 750, 170, 107, 5, 15, RACE_ZOMBIE},
119 { "Merulla the Humble", 1000, 165, 107, 6, 18, RACE_ELF},
123 /* Armoury - 28 unique names */
125 { "醜悪コン=ダー", 5000, 210, 115, 5, 7, RACE_HALF_ORC},
126 { "頑固者ダーグ=ロウ", 10000, 190, 111, 4, 9, RACE_HUMAN},
127 { "賢者デカド", 25000, 200, 112, 4, 10, RACE_DUNADAN},
128 { "鍛冶屋のウィーランド", 30000, 200, 112, 4, 5, RACE_DWARF},
129 { "醜悪コン=ダー", 10000, 210, 115, 5, 7, RACE_HALF_ORC},
130 { "頑固者ダーグ=ロウ", 15000, 190, 111, 4, 9, RACE_HUMAN},
131 { "ハンサムなデカド", 25000, 200, 112, 4, 10, RACE_AMBERITE},
132 { "エロー・ドラゴンスケイル", 30000, 200, 112, 4, 5, RACE_ELF},
133 { "デリカトス", 10000, 210, 115, 5, 7, RACE_SPRITE},
134 { "巨大なグルース", 15000, 190, 111, 4, 9, RACE_HALF_GIANT},
135 { "アニムス", 25000, 200, 112, 4, 10, RACE_GOLEM},
136 { "マルヴァス", 30000, 200, 112, 4, 5, RACE_HALF_TITAN},
137 { "セラクシス", 10000, 210, 115, 5, 7, RACE_ZOMBIE},
138 { "デス・チル", 5000, 190, 111, 4, 9, RACE_SPECTRE},
139 { "微かなドリオス", 25000, 200, 112, 4, 10, RACE_SPECTRE},
140 { "冷たいバスリック", 30000, 200, 112, 4, 5, RACE_VAMPIRE},
141 { "冷酷ヴェンジェラ", 10000, 210, 115, 5, 7, RACE_HALF_TROLL},
142 { "強者ウィラナ", 15000, 190, 111, 4, 9, RACE_HUMAN},
143 { "ヨジョ二世", 25000, 200, 112, 4, 10, RACE_DWARF},
144 { "優しいラナラー", 30000, 200, 112, 4, 5, RACE_AMBERITE},
145 { "不浄のホルバグ", 5000, 210, 115, 5, 7, RACE_HALF_ORC},
146 { "テレパスのエレレン", 15000, 190, 111, 4, 9, RACE_DARK_ELF},
147 { "イスドリリアス", 25000, 200, 112, 4, 10, RACE_SPRITE},
148 { "一つ目ヴェグナー", 5000, 200, 112, 4, 5, RACE_CYCLOPS},
149 { "混沌のロディッシュ", 10000, 210, 115, 5, 7, RACE_BEASTMAN},
150 { "剣豪ヘジン", 15000, 190, 111, 4, 9, RACE_NIBELUNG},
151 { "ずる屋のエルベレリス", 10000, 200, 112, 4, 10, RACE_DARK_ELF},
152 { "インプのザサス", 30000, 200, 112, 4, 5, RACE_IMP},
153 { "醜悪コン=ダー", 5000, 210, 115, 5, 7, RACE_HALF_ORC},
154 { "頑固者ダーグ=ロウ", 10000, 190, 111, 4, 9, RACE_HUMAN},
155 { "ハンサムなデカド", 25000, 200, 112, 4, 10, RACE_AMBERITE},
156 { "鍛冶屋のウィーランド", 30000, 200, 112, 4, 5, RACE_DWARF},
158 { "Kon-Dar the Ugly", 5000, 210, 115, 5, 7, RACE_HALF_ORC},
159 { "Darg-Low the Grim", 10000, 190, 111, 4, 9, RACE_HUMAN},
160 { "Decado the Handsome", 25000, 200, 112, 4, 10, RACE_DUNADAN},
161 { "Wieland the Smith", 30000, 200, 112, 4, 5, RACE_DWARF},
162 { "Kon-Dar the Ugly", 10000, 210, 115, 5, 7, RACE_HALF_ORC},
163 { "Darg-Low the Grim", 15000, 190, 111, 4, 9, RACE_HUMAN},
164 { "Decado the Handsome", 25000, 200, 112, 4, 10, RACE_AMBERITE},
165 { "Elo Dragonscale", 30000, 200, 112, 4, 5, RACE_ELF},
166 { "Delicatus", 10000, 210, 115, 5, 7, RACE_SPRITE},
167 { "Gruce the Huge", 15000, 190, 111, 4, 9, RACE_HALF_GIANT},
168 { "Animus", 25000, 200, 112, 4, 10, RACE_GOLEM},
169 { "Malvus", 30000, 200, 112, 4, 5, RACE_HALF_TITAN},
170 { "Selaxis", 10000, 210, 115, 5, 7, RACE_ZOMBIE},
171 { "Deathchill", 5000, 190, 111, 4, 9, RACE_SPECTRE},
172 { "Drios the Faint", 25000, 200, 112, 4, 10, RACE_SPECTRE},
173 { "Bathric the Cold", 30000, 200, 112, 4, 5, RACE_VAMPIRE},
174 { "Vengella the Cruel", 10000, 210, 115, 5, 7, RACE_HALF_TROLL},
175 { "Wyrana the Mighty", 15000, 190, 111, 4, 9, RACE_HUMAN},
176 { "Yojo II", 25000, 200, 112, 4, 10, RACE_DWARF},
177 { "Ranalar the Sweet", 30000, 200, 112, 4, 5, RACE_AMBERITE},
178 { "Horbag the Unclean", 5000, 210, 115, 5, 7, RACE_HALF_ORC},
179 { "Elelen the Telepath", 15000, 190, 111, 4, 9, RACE_DARK_ELF},
180 { "Isedrelias", 25000, 200, 112, 4, 10, RACE_SPRITE},
181 { "Vegnar One-eye", 5000, 200, 112, 4, 5, RACE_CYCLOPS},
182 { "Rodish the Chaotic", 10000, 210, 115, 5, 7, RACE_BEASTMAN},
183 { "Hesin Swordmaster", 15000, 190, 111, 4, 9, RACE_NIBELUNG},
184 { "Elvererith the Cheat", 10000, 200, 112, 4, 10, RACE_DARK_ELF},
185 { "Zzathath the Imp", 30000, 200, 112, 4, 5, RACE_IMP},
186 { "Kon-Dar the Ugly", 5000, 210, 115, 5, 7, RACE_HALF_ORC},
187 { "Darg-Low the Grim", 10000, 190, 111, 4, 9, RACE_HUMAN},
188 { "Decado the Handsome", 25000, 200, 112, 4, 10, RACE_AMBERITE},
189 { "Wieland the Smith", 30000, 200, 112, 4, 5, RACE_DWARF},
194 /* Weapon Smith - 28 unique names */
196 { "残忍なるアーノルド", 5000, 210, 115, 6, 6, RACE_HALF_TROLL},
197 { "獣殺しのアーンダル", 10000, 185, 110, 5, 9, RACE_HALF_ELF},
198 { "獣マスターのエディー", 25000, 190, 115, 5, 7, RACE_HOBBIT},
199 { "竜殺しのオグライン", 30000, 195, 112, 4, 8, RACE_DWARF},
200 { "熟練者ドリュー", 10000, 210, 115, 6, 6, RACE_HUMAN},
201 { "龍の子オラックス", 15000, 185, 110, 5, 9, RACE_DRACONIAN},
202 { "病気持ちのアンスラックス", 25000, 190, 115, 5, 7, RACE_BEASTMAN},
203 { "頑丈者アルコス", 30000, 195, 112, 4, 8, RACE_DWARF},
204 { "腐れ者のサリアス", 5000, 210, 115, 6, 6, RACE_ZOMBIE},
205 { "晒し骨のトゥエシク", 15000, 185, 110, 5, 9, RACE_SKELETON},
206 { "ビリオス", 25000, 190, 115, 5, 7, RACE_BEASTMAN},
207 { "ファスガル", 30000, 195, 112, 4, 8, RACE_ZOMBIE},
208 { "パラディンのエレフリス", 10000, 210, 115, 6, 6, RACE_BARBARIAN},
209 { "キ'トリッ'ク", 15000, 185, 110, 5, 9, RACE_KLACKON},
210 { "蜘蛛の友ドゥロカス", 25000, 190, 115, 5, 7, RACE_DARK_ELF},
211 { "巨人殺しのフングス", 30000, 195, 112, 4, 8, RACE_DWARF},
212 { "デランサ", 10000, 210, 115, 6, 6, RACE_ELF},
213 { "レンジャーのソルビスタニ", 15000, 185, 110, 5, 9, RACE_HALF_ELF},
214 { "ノロマのゾリル", 25000, 190, 115, 5, 7, RACE_GOLEM},
215 { "イーオン・フラックス", 20000, 195, 112, 4, 8, RACE_HALF_ELF},
216 { "強者ナドック", 10000, 210, 115, 6, 6, RACE_HOBBIT},
217 { "弱虫エラモグ", 15000, 185, 110, 5, 9, RACE_KOBOLD},
218 { "公正なエオウィリス", 25000, 190, 115, 5, 7, RACE_VAMPIRE},
219 { "バルログ殺しのヒュイモグ", 30000, 195, 112, 4, 8, RACE_HALF_ORC},
220 { "冷酷ピーダス", 5000, 210, 115, 6, 6, RACE_HUMAN},
221 { "ヴァモグ スレイヤー", 15000, 185, 110, 5, 9, RACE_HALF_OGRE},
222 { "性悪フーシュナク", 25000, 190, 115, 5, 7, RACE_BEASTMAN},
223 { "舞闘バレン", 30000, 195, 112, 4, 8, RACE_BARBARIAN},
224 { "残忍なるアーノルド", 5000, 210, 115, 6, 6, RACE_BARBARIAN},
225 { "獣殺しのアーンダル", 10000, 185, 110, 5, 9, RACE_HALF_ELF},
226 { "ビーストマスター・エディー", 25000, 190, 115, 5, 7, RACE_HALF_ORC},
227 { "竜殺しのオグライン", 30000, 195, 112, 4, 8, RACE_DWARF},
229 { "Arnold the Beastly", 5000, 210, 115, 6, 6, RACE_BARBARIAN},
230 { "Arndal Beast-Slayer", 10000, 185, 110, 5, 9, RACE_HALF_ELF},
231 { "Eddie Beast-Master", 25000, 190, 115, 5, 7, RACE_HALF_ORC},
232 { "Oglign Dragon-Slayer", 30000, 195, 112, 4, 8, RACE_DWARF},
233 { "Drew the Skilled", 10000, 210, 115, 6, 6, RACE_HUMAN},
234 { "Orrax Dragonson", 15000, 185, 110, 5, 9, RACE_DRACONIAN},
235 { "Anthrax Disease-Carrier", 25000, 190, 115, 5, 7, RACE_BEASTMAN},
236 { "Arkhoth the Stout", 30000, 195, 112, 4, 8, RACE_DWARF},
237 { "Sarlyas the Rotten", 5000, 210, 115, 6, 6, RACE_ZOMBIE},
238 { "Tuethic Bare-Bones", 15000, 185, 110, 5, 9, RACE_SKELETON},
239 { "Bilious", 25000, 190, 115, 5, 7, RACE_BEASTMAN},
240 { "Fasgul", 30000, 195, 112, 4, 8, RACE_ZOMBIE},
241 { "Ellefris the Paladin", 10000, 210, 115, 6, 6, RACE_BARBARIAN},
242 { "K'trrik'k", 15000, 185, 110, 5, 9, RACE_KLACKON},
243 { "Drocus Spiderfriend", 25000, 190, 115, 5, 7, RACE_DARK_ELF},
244 { "Fungus Giant-Slayer", 30000, 195, 112, 4, 8, RACE_DWARF},
245 { "Delantha", 10000, 210, 115, 6, 6, RACE_ELF},
246 { "Solvistani the Ranger", 15000, 185, 110, 5, 9, RACE_HALF_ELF},
247 { "Xoril the Slow", 25000, 190, 115, 5, 7, RACE_GOLEM},
248 { "Aeon Flux", 20000, 195, 112, 4, 8, RACE_HALF_ELF},
249 { "Nadoc the Strong", 10000, 210, 115, 6, 6, RACE_HOBBIT},
250 { "Eramog the Weak", 15000, 185, 110, 5, 9, RACE_KOBOLD},
251 { "Eowilith the Fair", 25000, 190, 115, 5, 7, RACE_VAMPIRE},
252 { "Huimog Balrog-Slayer", 30000, 195, 112, 4, 8, RACE_HALF_ORC},
253 { "Peadus the Cruel", 5000, 210, 115, 6, 6, RACE_HUMAN},
254 { "Vamog Slayer", 15000, 185, 110, 5, 9, RACE_HALF_OGRE},
255 { "Hooshnak the Vicious", 25000, 190, 115, 5, 7, RACE_BEASTMAN},
256 { "Balenn War-Dancer", 30000, 195, 112, 4, 8, RACE_BARBARIAN},
257 { "Arnold the Beastly", 5000, 210, 115, 6, 6, RACE_BARBARIAN},
258 { "Arndal Beast-Slayer", 10000, 185, 110, 5, 9, RACE_HALF_ELF},
259 { "Eddie Beast-Master", 25000, 190, 115, 5, 7, RACE_HALF_ORC},
260 { "Oglign Dragon-Slayer", 30000, 195, 112, 4, 8, RACE_DWARF},
264 /* Temple - 22 unique names */
266 { "質素なルードヴィヒ", 5000, 175, 109, 6, 15, RACE_HUMAN},
267 { "パラディンのガンナー", 10000, 185, 110, 5, 23, RACE_HUMAN},
268 { "選ばれしトリン", 25000, 180, 107, 6, 20, RACE_ELF},
269 { "賢明なるサラストロ", 30000, 185, 109, 5, 15, RACE_DWARF},
270 { "パーシヴァル卿", 25000, 180, 107, 6, 20, RACE_HIGH_ELF},
271 { "神聖なるアセナス", 30000, 185, 109, 5, 15, RACE_HUMAN},
272 { "マッキノン", 10000, 175, 109, 6, 15, RACE_HUMAN},
273 { "謹み婦人", 15000, 185, 110, 5, 23, RACE_HIGH_ELF},
274 { "ドルイドのハシュニック", 25000, 180, 107, 6, 20, RACE_HOBBIT},
275 { "フィナク", 30000, 185, 109, 5, 15, RACE_YEEK},
276 { "クリキック", 10000, 175, 109, 6, 15, RACE_KLACKON},
277 { "荒くれ者モリヴァル", 15000, 185, 110, 5, 23, RACE_ELF},
278 { "暗きホシャック", 25000, 180, 107, 6, 20, RACE_IMP},
279 { "賢者アタール", 30000, 185, 109, 5, 15, RACE_HUMAN},
280 { "清きイベニッド", 10000, 175, 109, 6, 15, RACE_HUMAN},
281 { "エリディシュ", 15000, 185, 110, 5, 23, RACE_HALF_TROLL},
282 { "呪術師ヴルドゥシュ", 25000, 180, 107, 6, 20, RACE_HALF_OGRE},
283 { "狂戦士ハオブ", 30000, 185, 109, 5, 15, RACE_BARBARIAN},
284 { "若きプルーグディシュ", 10000, 175, 109, 6, 15, RACE_HALF_OGRE},
285 { "きちがいラムワイズ", 15000, 185, 110, 5, 23, RACE_YEEK},
286 { "有徳者ムワート", 25000, 180, 107, 6, 20, RACE_KOBOLD},
287 { "弱虫ダードバード", 30000, 185, 109, 5, 15, RACE_SPECTRE},
288 { "質素なルードヴィヒ", 5000, 175, 109, 6, 15, RACE_HUMAN},
289 { "パラディンのガンナー", 10000, 185, 110, 5, 23, RACE_HUMAN},
290 { "選ばれしトリン", 25000, 180, 107, 6, 20, RACE_ELF},
291 { "賢明なるサラストロ", 30000, 185, 109, 5, 15, RACE_DWARF},
292 { "パーシヴァル卿", 25000, 180, 107, 6, 20, RACE_HIGH_ELF},
293 { "神聖なるアセナス", 30000, 185, 109, 5, 15, RACE_HUMAN},
294 { "マッキノン", 10000, 175, 109, 6, 15, RACE_HUMAN},
295 { "謹み婦人", 15000, 185, 110, 5, 23, RACE_HIGH_ELF},
296 { "ドルイドのハシュニック", 25000, 180, 107, 6, 20, RACE_HOBBIT},
297 { "フィナク", 30000, 185, 109, 5, 15, RACE_YEEK},
299 { "Ludwig the Humble", 5000, 175, 109, 6, 15, RACE_DWARF},
300 { "Gunnar the Paladin", 10000, 185, 110, 5, 23, RACE_HALF_TROLL},
301 { "Torin the Chosen", 25000, 180, 107, 6, 20, RACE_HIGH_ELF},
302 { "Sarastro the Wise", 30000, 185, 109, 5, 15, RACE_HUMAN},
303 { "Sir Parsival the Pure", 25000, 180, 107, 6, 20, RACE_HIGH_ELF},
304 { "Asenath the Holy", 30000, 185, 109, 5, 15, RACE_HUMAN},
305 { "McKinnon", 10000, 175, 109, 6, 15, RACE_HUMAN},
306 { "Mistress Chastity", 15000, 185, 110, 5, 23, RACE_HIGH_ELF},
307 { "Hashnik the Druid", 25000, 180, 107, 6, 20, RACE_HOBBIT},
308 { "Finak", 30000, 185, 109, 5, 15, RACE_YEEK},
309 { "Krikkik", 10000, 175, 109, 6, 15, RACE_KLACKON},
310 { "Morival the Wild", 15000, 185, 110, 5, 23, RACE_ELF},
311 { "Hoshak the Dark", 25000, 180, 107, 6, 20, RACE_IMP},
312 { "Atal the Wise", 30000, 185, 109, 5, 15, RACE_HUMAN},
313 { "Ibenidd the Chaste", 10000, 175, 109, 6, 15, RACE_HUMAN},
314 { "Eridish", 15000, 185, 110, 5, 23, RACE_HALF_TROLL},
315 { "Vrudush the Shaman", 25000, 180, 107, 6, 20, RACE_HALF_OGRE},
316 { "Haob the Berserker", 30000, 185, 109, 5, 15, RACE_BARBARIAN},
317 { "Proogdish the Youthfull", 10000, 175, 109, 6, 15, RACE_HALF_OGRE},
318 { "Lumwise the Mad", 15000, 185, 110, 5, 23, RACE_YEEK},
319 { "Muirt the Virtuous", 25000, 180, 107, 6, 20, RACE_KOBOLD},
320 { "Dardobard the Weak", 30000, 185, 109, 5, 15, RACE_SPECTRE},
321 { "Ludwig the Humble", 5000, 175, 109, 6, 15, RACE_DWARF},
322 { "Gunnar the Paladin", 10000, 185, 110, 5, 23, RACE_HALF_TROLL},
323 { "Torin the Chosen", 25000, 180, 107, 6, 20, RACE_HIGH_ELF},
324 { "Sarastro the Wise", 30000, 185, 109, 5, 15, RACE_HUMAN},
325 { "Sir Parsival the Pure", 25000, 180, 107, 6, 20, RACE_HIGH_ELF},
326 { "Asenath the Holy", 30000, 185, 109, 5, 15, RACE_HUMAN},
327 { "McKinnon", 10000, 175, 109, 6, 15, RACE_HUMAN},
328 { "Mistress Chastity", 15000, 185, 110, 5, 23, RACE_HIGH_ELF},
329 { "Hashnik the Druid", 25000, 180, 107, 6, 20, RACE_HOBBIT},
330 { "Finak", 30000, 185, 109, 5, 15, RACE_YEEK},
334 /* Alchemist - 26 unique names */
336 { "化学者マウザー", 10000, 190, 111, 5, 8, RACE_HALF_ELF},
337 { "カオスのウィズル", 10000, 190, 110, 6, 8, RACE_HOBBIT},
338 { "強欲ミダス", 15000, 200, 116, 6, 9, RACE_GNOME},
339 { "貧弱ジャ=ファー", 15000, 220, 111, 4, 9, RACE_ELF},/*FIRST*/
340 { "カカルラカカル", 15000, 200, 116, 6, 9, RACE_KLACKON},
341 { "錬金術師ジャル=エス", 15000, 220, 111, 4, 9, RACE_ELF},
342 { "用心深いファネラス", 10000, 190, 111, 5, 8, RACE_DWARF},
343 { "キチガイのルンシー", 10000, 190, 110, 6, 8, RACE_HUMAN},
344 { "グランブルワース", 15000, 200, 116, 6, 9, RACE_GNOME},
345 { "フリッター", 15000, 220, 111, 4, 9, RACE_SPRITE},
346 { "ザリルス", 10000, 190, 111, 5, 8, RACE_HUMAN},
347 { "古きエグバート", 10000, 190, 110, 6, 8, RACE_DWARF},
348 { "誇り高きヴァリンドラ", 15000, 200, 116, 6, 9, RACE_HIGH_ELF},
349 { "錬金術師タエン", 15000, 220, 111, 4, 9, RACE_HUMAN},
350 { "巧言カイド", 10000, 190, 111, 5, 8, RACE_VAMPIRE},
351 { "暗きフリア", 10000, 190, 110, 6, 8, RACE_NIBELUNG},
352 { "質素なドムリ", 15000, 200, 116, 6, 9, RACE_DWARF},
353 { "魔の子ヤァジュッカ", 15000, 220, 111, 4, 9, RACE_IMP},
354 { "薬草師ジェララルドール", 10000, 190, 111, 5, 8, RACE_HIGH_ELF},
355 { "賢者オレラルダン", 10000, 190, 110, 6, 8, RACE_BARBARIAN},
356 { "デモニシストのフゾグロ", 15000, 200, 116, 6, 9, RACE_IMP},
357 { "錬金術師ドゥリアシュ", 15000, 220, 111, 4, 9, RACE_HALF_ORC},
358 { "強者ネリア", 10000, 190, 111, 5, 8, RACE_CYCLOPS},
359 { "辛口リグナス", 10000, 190, 110, 6, 8, RACE_HALF_ORC},
360 { "ティルバ", 15000, 200, 116, 6, 9, RACE_HOBBIT},
361 { "金持ちミリルドリック", 15000, 220, 111, 4, 9, RACE_HUMAN},
363 { "科学者マウザー", 10000, 190, 111, 5, 8, RACE_HALF_ELF},
364 { "カオスのウィズル", 10000, 190, 110, 6, 8, RACE_HOBBIT},
365 { "強欲ミダス", 15000, 200, 116, 6, 9, RACE_GNOME},
366 { "錬金術師ジャ=ファー", 15000, 220, 111, 4, 9, RACE_ELF},
367 { "カカルラカカル", 15000, 200, 116, 6, 9, RACE_KLACKON},
368 { "錬金術師ジャル=エス", 15000, 220, 111, 4, 9, RACE_ELF},
370 { "Mauser the Chemist", 10000, 190, 111, 5, 8, RACE_HALF_ELF},
371 { "Wizzle the Chaotic", 10000, 190, 110, 6, 8, RACE_HOBBIT},
372 { "Midas the Greedy", 15000, 200, 116, 6, 9, RACE_GNOME},
373 { "Ja-Far the Alchemist", 15000, 220, 111, 4, 9, RACE_ELF},
374 { "Kakalrakakal", 15000, 200, 116, 6, 9, RACE_KLACKON},
375 { "Jal-Eth the Alchemist", 15000, 220, 111, 4, 9, RACE_ELF},
376 { "Fanelath the Cautious", 10000, 190, 111, 5, 8, RACE_DWARF},
377 { "Runcie the Insane", 10000, 190, 110, 6, 8, RACE_HUMAN},
378 { "Grumbleworth", 15000, 200, 116, 6, 9, RACE_GNOME},
379 { "Flitter", 15000, 220, 111, 4, 9, RACE_SPRITE},
380 { "Xarillus", 10000, 190, 111, 5, 8, RACE_HUMAN},
381 { "Egbert the Old", 10000, 190, 110, 6, 8, RACE_DWARF},
382 { "Valindra the Proud", 15000, 200, 116, 6, 9, RACE_HIGH_ELF},
383 { "Taen the Alchemist", 15000, 220, 111, 4, 9, RACE_HUMAN},
384 { "Cayd the Sweet", 10000, 190, 111, 5, 8, RACE_VAMPIRE},
385 { "Fulir the Dark", 10000, 190, 110, 6, 8, RACE_NIBELUNG},
386 { "Domli the Humble", 15000, 200, 116, 6, 9, RACE_DWARF},
387 { "Yaarjukka Demonspawn", 15000, 220, 111, 4, 9, RACE_IMP},
388 { "Gelaraldor the Herbmaster", 10000, 190, 111, 5, 8, RACE_HIGH_ELF},
389 { "Olelaldan the Wise", 10000, 190, 110, 6, 8, RACE_BARBARIAN},
390 { "Fthoglo the Demonicist", 15000, 200, 116, 6, 9, RACE_IMP},
391 { "Dridash the Alchemist", 15000, 220, 111, 4, 9, RACE_HALF_ORC},
392 { "Nelir the Strong", 10000, 190, 111, 5, 8, RACE_CYCLOPS},
393 { "Lignus the Pungent", 10000, 190, 110, 6, 8, RACE_HALF_ORC},
394 { "Tilba", 15000, 200, 116, 6, 9, RACE_HOBBIT},
395 { "Myrildric the Wealthy", 15000, 220, 111, 4, 9, RACE_HUMAN},
397 { "Mauser the Chemist", 10000, 190, 111, 5, 8, RACE_HALF_ELF},
398 { "Wizzle the Chaotic", 10000, 190, 110, 6, 8, RACE_HOBBIT},
399 { "Midas the Greedy", 15000, 200, 116, 6, 9, RACE_GNOME},
400 { "Ja-Far the Alchemist", 15000, 220, 111, 4, 9, RACE_ELF},
401 { "Kakalrakakal", 15000, 200, 116, 6, 9, RACE_KLACKON},
402 { "Jal-Eth the Alchemist", 15000, 220, 111, 4, 9, RACE_ELF},
407 /* Magic Shop - 23 unique names */
409 { "ソーサラーのロ=パン", 20000, 200, 110, 7, 8, RACE_HALF_ELF},
410 { "偉大なるブガービイ", 20000, 215, 113, 6, 10, RACE_GNOME},
411 { "イェンダーの魔法使い", 30000, 200, 110, 7, 10, RACE_HUMAN},
412 { "死霊使いリャク",30000, 175, 110, 5, 11, RACE_HIGH_ELF},
413 { "魔術師スキドゥニー", 15000, 200, 110, 7, 8, RACE_HALF_ELF},
414 { "幻術師キリア", 30000, 200, 110, 7, 10, RACE_HUMAN},
415 { "死霊術師ニッキ", 30000, 175, 110, 5, 11, RACE_DARK_ELF},
416 { "ソロストラン", 15000, 200, 110, 7, 8, RACE_SPRITE},
417 { "烏賊口アチシェ", 20000, 215, 113, 6, 10, RACE_MIND_FLAYER},
418 { "貴族のカザ", 30000, 200, 110, 7, 10, RACE_HIGH_ELF},
419 { "暗きファジル", 30000, 175, 110, 5, 11, RACE_DARK_ELF},
420 { "偉大なるケルドーン", 15000, 200, 110, 7, 8, RACE_DWARF},
421 { "フィランスロプス", 20000, 215, 113, 6, 10, RACE_HOBBIT},
422 { "魔女のアグナー", 30000, 200, 110, 7, 10, RACE_HUMAN},
423 { "死霊術師ビュリアンス", 30000, 175, 110, 5, 11, RACE_BEASTMAN},
424 { "ハイメイジのヴイラク", 15000, 200, 110, 7, 8, RACE_BEASTMAN},
425 { "知恵者マディッシュ", 20000, 215, 113, 6, 10, RACE_BEASTMAN},
426 { "ファレブリンボール", 30000, 200, 110, 7, 10, RACE_HIGH_ELF},
427 { "陰険フェリル=ガンド", 30000, 175, 110, 5, 11, RACE_DARK_ELF},
428 { "呪術師サレゴード", 15000, 200, 110, 7, 8, RACE_BARBARIAN},
429 { "神秘家クトゥアロス", 20000, 215, 113, 6, 10, RACE_MIND_FLAYER},
430 { "幻術師イベリ", 30000, 200, 110, 7, 10, RACE_SKELETON},
431 { "死霊術師ヘトー", 30000, 175, 110, 5, 11, RACE_YEEK},
432 { "魔術師ロ=パン", 20000, 200, 110, 7, 8, RACE_HALF_ELF},
433 { "偉大なるブガービイ", 20000, 215, 113, 6, 10, RACE_GNOME},
434 { "イェンダーの魔法使い", 30000, 200, 110, 7, 10, RACE_HUMAN},
435 { "死霊術師リャク", 30000, 175, 110, 5, 11, RACE_DARK_ELF},
436 { "魔術師スキドゥニー", 15000, 200, 110, 7, 8, RACE_HALF_ELF},
437 { "幻術師キリア", 30000, 200, 110, 7, 10, RACE_HUMAN},
438 { "死霊術師ニッキ", 30000, 175, 110, 5, 11, RACE_DARK_ELF},
439 { "ソロストラン", 15000, 200, 110, 7, 8, RACE_SPRITE},
440 { "烏賊口アチシェ", 20000, 215, 113, 6, 10, RACE_MIND_FLAYER},
442 { "Lo Pan the Sorcerer", 20000, 200, 110, 7, 8, RACE_HALF_ELF},
443 { "Buggerby the Great", 20000, 215, 113, 6, 10, RACE_GNOME},
444 { "The Wizard of Yendor", 30000, 200, 110, 7, 10, RACE_HUMAN},
445 { "Rjak the Necromancer", 30000, 175, 110, 5, 11, RACE_DARK_ELF},
446 { "Skidney the Sorcerer", 15000, 200, 110, 7, 8, RACE_HALF_ELF},
447 { "Kyria the Illusionist", 30000, 200, 110, 7, 10, RACE_HUMAN},
448 { "Nikki the Necromancer", 30000, 175, 110, 5, 11, RACE_DARK_ELF},
449 { "Solostoran", 15000, 200, 110, 7, 8, RACE_SPRITE},
450 { "Achshe the Tentacled", 20000, 215, 113, 6, 10, RACE_MIND_FLAYER},
451 { "Kaza the Noble", 30000, 200, 110, 7, 10, RACE_HIGH_ELF},
452 { "Fazzil the Dark", 30000, 175, 110, 5, 11, RACE_DARK_ELF},
453 { "Keldorn the Grand", 15000, 200, 110, 7, 8, RACE_DWARF},
454 { "Philanthropus", 20000, 215, 113, 6, 10, RACE_HOBBIT},
455 { "Agnar the Enchantress", 30000, 200, 110, 7, 10, RACE_HUMAN},
456 { "Buliance the Necromancer", 30000, 175, 110, 5, 11, RACE_BEASTMAN},
457 { "Vuirak the High-Mage", 15000, 200, 110, 7, 8, RACE_BEASTMAN},
458 { "Madish the Smart", 20000, 215, 113, 6, 10, RACE_BEASTMAN},
459 { "Falebrimbor", 30000, 200, 110, 7, 10, RACE_HIGH_ELF},
460 { "Felil-Gand the Subtle", 30000, 175, 110, 5, 11, RACE_DARK_ELF},
461 { "Thalegord the Shaman", 15000, 200, 110, 7, 8, RACE_BARBARIAN},
462 { "Cthoaloth the Mystic", 20000, 215, 113, 6, 10, RACE_MIND_FLAYER},
463 { "Ibeli the Illusionist", 30000, 200, 110, 7, 10, RACE_SKELETON},
464 { "Heto the Necromancer", 30000, 175, 110, 5, 11, RACE_YEEK},
465 { "Lo Pan the Sorcerer", 20000, 200, 110, 7, 8, RACE_HALF_ELF},
466 { "Buggerby the Great", 20000, 215, 113, 6, 10, RACE_GNOME},
467 { "The Wizard of Yendor", 30000, 200, 110, 7, 10, RACE_HUMAN},
468 { "Rjak the Necromancer", 30000, 175, 110, 5, 11, RACE_DARK_ELF},
469 { "Skidney the Sorcerer", 15000, 200, 110, 7, 8, RACE_HALF_ELF},
470 { "Kyria the Illusionist", 30000, 200, 110, 7, 10, RACE_HUMAN},
471 { "Nikki the Necromancer", 30000, 175, 110, 5, 11, RACE_DARK_ELF},
472 { "Solostoran", 15000, 200, 110, 7, 8, RACE_SPRITE},
473 { "Achshe the Tentacled", 20000, 215, 113, 6, 10, RACE_MIND_FLAYER},
477 /* Black Market - 32 unique names */
479 { "ガリー=ギガズ", 20000, 250, 150, 10, 5, RACE_HALF_TROLL},
480 { "ゴブリンのヒストーア", 20000, 250, 150, 10, 5, RACE_HALF_ORC},
481 { "フェレンギ人クアーク", 30000, 250, 150, 10, 5, RACE_HUMAN},
482 { "公正なる(?)トッピ", 30000, 250, 150, 10, 5, RACE_ELF},
483 { "死人ヴァッサ", 20000, 250, 150, 10, 5, RACE_ZOMBIE},
484 { "裏切り者カイン", 20000, 250, 150, 10, 5, RACE_VAMPIRE},
485 { "ブボニカス", 30000, 250, 150, 10, 5, RACE_BEASTMAN},
486 { "コープスライト", 30000, 250, 150, 10, 5, RACE_SPECTRE},
487 { "血に飢えしパリッシュ", 20000, 250, 150, 10, 5, RACE_VAMPIRE},
488 { "ヴァイル", 20000, 250, 150, 10, 5, RACE_SKELETON},
489 { "信頼のプレンティス", 30000, 250, 150, 10, 5, RACE_SKELETON},
490 { "人間殺しのグリエラ", 30000, 250, 150, 10, 5, RACE_IMP},
491 { "エンジェル", 20000, 250, 150, 10, 5, RACE_VAMPIRE},
492 { "水膨れフロツァム", 20000, 250, 150, 10, 5, RACE_ZOMBIE},
493 { "ニーヴァル", 30000, 250, 150, 10, 5, RACE_VAMPIRE},
494 { "明るいアナスタシア", 30000, 250, 150, 10, 5, RACE_SPECTRE},
495 { "死霊術師チャリティー", 20000, 250, 150, 10, 5, RACE_DARK_ELF},
496 { "ボクサーのプグナシオス", 20000, 250, 150, 10, 5, RACE_HALF_ORC},
497 { "幸運なフットソア", 30000, 250, 150, 10, 5, RACE_BEASTMAN},
498 { "光指のシドリア", 30000, 250, 150, 10, 5, RACE_HUMAN},
499 { "手品師リアソー", 20000, 250, 150, 10, 5, RACE_HOBBIT},
500 { "やりくり上手のジャナッカ", 20000, 250, 150, 10, 5, RACE_GNOME},
501 { "悪党シーナ", 30000, 250, 150, 10, 5, RACE_GNOME},
502 { "大爪アルニッキ", 30000, 250, 150, 10, 5, RACE_DRACONIAN},
503 { "貧乏チャエアンド", 20000, 250, 150, 10, 5, RACE_HUMAN},
504 { "山賊アファードーフ", 20000, 250, 150, 10, 5, RACE_BARBARIAN},
505 { "強欲ラザクスル", 30000, 250, 150, 10, 5, RACE_MIND_FLAYER},
506 { "ファラレウィン", 30000, 250, 150, 10, 5, RACE_SPRITE},
507 { "しわしわヴォスール", 20000, 250, 150, 10, 5, RACE_NIBELUNG},
508 { "ハンサムなアラオード", 20000, 250, 150, 10, 5, RACE_AMBERITE},
509 { "負け犬セラドフリド", 30000, 250, 150, 10, 5, RACE_HUMAN},
510 { "片足のエルーロ", 30000, 250, 150, 10, 5, RACE_HALF_OGRE},
512 { "Gary Gygaz", 20000, 250, 150, 10, 5, RACE_HALF_TROLL},
513 { "Histor the Goblin", 20000, 250, 150, 10, 5, RACE_HALF_ORC},
514 { "Quark the Ferengi", 30000, 250, 150, 10, 5, RACE_DWARF},
515 { "Topi the Fair(?)", 30000, 250, 150, 10, 5, RACE_HUMAN},
516 { "Vhassa the Dead", 20000, 250, 150, 10, 5, RACE_ZOMBIE},
517 { "Kyn the Treacherous", 20000, 250, 150, 10, 5, RACE_VAMPIRE},
518 { "Bubonicus", 30000, 250, 150, 10, 5, RACE_BEASTMAN},
519 { "Corpselight", 30000, 250, 150, 10, 5, RACE_SPECTRE},
520 { "Parrish the Bloodthirsty", 20000, 250, 150, 10, 5, RACE_VAMPIRE},
521 { "Vile", 20000, 250, 150, 10, 5, RACE_SKELETON},
522 { "Prentice the Trusted", 30000, 250, 150, 10, 5, RACE_SKELETON},
523 { "Griella Humanslayer", 30000, 250, 150, 10, 5, RACE_IMP},
524 { "Angel", 20000, 250, 150, 10, 5, RACE_VAMPIRE},
525 { "Flotsam the Bloated", 20000, 250, 150, 10, 5, RACE_ZOMBIE},
526 { "Nieval", 30000, 250, 150, 10, 5, RACE_VAMPIRE},
527 { "Anastasia the Luminous", 30000, 250, 150, 10, 5, RACE_SPECTRE},
528 { "Charity the Necromancer", 20000, 250, 150, 10, 5, RACE_DARK_ELF},
529 { "Pugnacious the Pugilist", 20000, 250, 150, 10, 5, RACE_HALF_ORC},
530 { "Footsore the Lucky", 30000, 250, 150, 10, 5, RACE_BEASTMAN},
531 { "Sidria Lighfingered", 30000, 250, 150, 10, 5, RACE_HUMAN},
532 { "Riatho the Juggler", 20000, 250, 150, 10, 5, RACE_HOBBIT},
533 { "Janaaka the Shifty", 20000, 250, 150, 10, 5, RACE_GNOME},
534 { "Cina the Rogue", 30000, 250, 150, 10, 5, RACE_GNOME},
535 { "Arunikki Greatclaw", 30000, 250, 150, 10, 5, RACE_DRACONIAN},
536 { "Chaeand the Poor", 20000, 250, 150, 10, 5, RACE_HUMAN},
537 { "Afardorf the Brigand", 20000, 250, 150, 10, 5, RACE_BARBARIAN},
538 { "Lathaxl the Greedy", 30000, 250, 150, 10, 5, RACE_MIND_FLAYER},
539 { "Falarewyn", 30000, 250, 150, 10, 5, RACE_SPRITE},
540 { "Vosur the Wrinkled", 20000, 250, 150, 10, 5, RACE_NIBELUNG},
541 { "Araord the Handsome", 20000, 250, 150, 10, 5, RACE_AMBERITE},
542 { "Theradfrid the Loser", 30000, 250, 150, 10, 5, RACE_HUMAN},
543 { "One-Legged Eroolo", 30000, 250, 150, 10, 5, RACE_HALF_OGRE},
549 { "我が家", 0, 100, 100, 0, 99, 99},
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},
582 { "Your home", 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},
619 /* Bookstore - 21 unique names */
621 { "強欲ドラフ", 10000, 175, 108, 4, 12, RACE_HUMAN},
622 { "賢者オドナー", 15000, 120, 105, 6, 16, RACE_HIGH_ELF},
623 { "中立のガンダー", 25000, 120, 110, 7, 19, RACE_DARK_ELF},
624 { "忍耐の人ロ=シャ", 30000, 140, 105, 6, 12, RACE_ELF},
625 { "ランドルフ・カーター", 15000, 175, 108, 4, 12, RACE_HUMAN},
626 { "隼のサライ", 15000, 175, 108, 4, 12, RACE_HUMAN},
627 { "千里眼ボドリル", 20000, 120, 105, 6, 16, RACE_HIGH_ELF},
628 { "沈黙のヴェオロイン", 25000, 120, 110, 7, 19, RACE_ZOMBIE},
629 { "学者のヴァンシラス", 30000, 140, 105, 6, 12, RACE_MIND_FLAYER},
630 { "物書きオセイン", 15000, 175, 108, 4, 12, RACE_SKELETON},
631 { "本の虫オルヴァー", 20000, 120, 105, 6, 16, RACE_VAMPIRE},
632 { "浅井墓男", 25000, 120, 110, 7, 19, RACE_ZOMBIE},
633 { "デスマスク", 30000, 140, 105, 6, 12, RACE_ZOMBIE},
634 { "学者のアスーヌ", 15000, 175, 108, 4, 12, RACE_MIND_FLAYER},
635 { "死人のプリランド", 20000, 120, 105, 6, 16, RACE_ZOMBIE},
636 { "鉄のロナール", 25000, 120, 110, 7, 19, RACE_GOLEM},
638 { "Dolaf the Greedy", 10000, 175, 108, 4, 12, RACE_HUMAN},
639 { "Odnar the Sage", 15000, 120, 105, 6, 16, RACE_HIGH_ELF},
640 { "Gandar the Neutral", 25000, 120, 110, 7, 19, RACE_DARK_ELF},
641 { "Ro-sha the Patient", 30000, 140, 105, 6, 12, RACE_ELF},
642 { "Randolph Carter", 15000, 175, 108, 4, 12, RACE_HUMAN},
643 { "Sarai the Swift", 15000, 175, 108, 4, 12, RACE_HUMAN},
644 { "Bodril the Seer", 20000, 120, 105, 6, 16, RACE_HIGH_ELF},
645 { "Veloin the Quiet", 25000, 120, 110, 7, 19, RACE_ZOMBIE},
646 { "Vanthylas the Learned", 30000, 140, 105, 6, 12, RACE_MIND_FLAYER},
647 { "Ossein the Literate", 15000, 175, 108, 4, 12, RACE_SKELETON},
648 { "Olvar Bookworm", 20000, 120, 105, 6, 16, RACE_VAMPIRE},
649 { "Shallowgrave", 25000, 120, 110, 7, 19, RACE_ZOMBIE},
650 { "Death Mask", 30000, 140, 105, 6, 12, RACE_ZOMBIE},
651 { "Asuunu the Learned", 15000, 175, 108, 4, 12, RACE_MIND_FLAYER},
652 { "Prirand the Dead", 20000, 120, 105, 6, 16, RACE_ZOMBIE},
653 { "Ronar the Iron", 25000, 120, 110, 7, 19, RACE_GOLEM},
656 { "ガリル=ガミル", 30000, 140, 105, 6, 12, RACE_ELF},
657 { "本食いローバグ", 15000, 175, 108, 4, 12, RACE_KOBOLD},
658 { "キリアリキーク", 20000, 120, 105, 6, 16, RACE_KLACKON},
659 { "静かなるリリン", 25000, 120, 110, 7, 19, RACE_DWARF},
660 { "王者イサング", 30000, 140, 105, 6, 12, RACE_HIGH_ELF},
661 { "強欲ドラフ", 10000, 175, 108, 4, 12, RACE_HUMAN},
662 { "賢者オドナー", 15000, 120, 105, 6, 16, RACE_HIGH_ELF},
663 { "中立のガンダー", 25000, 120, 110, 7, 19, RACE_DARK_ELF},
664 { "忍耐の人ロ=シャ", 30000, 140, 105, 6, 12, RACE_ELF},
665 { "ランドルフ・カーター", 15000, 175, 108, 4, 12, RACE_HUMAN},
666 { "隼サライ", 15000, 175, 108, 4, 12, RACE_HUMAN},
667 { "千里眼ボドリル", 20000, 120, 105, 6, 16, RACE_HIGH_ELF},
668 { "沈黙のヴェオロイン", 25000, 120, 110, 7, 19, RACE_ZOMBIE},
669 { "学者のヴァンシラス", 30000, 140, 105, 6, 12, RACE_MIND_FLAYER},
670 { "物書きオセイン", 15000, 175, 108, 4, 12, RACE_SKELETON},
671 { "本の虫オルヴァー", 20000, 120, 105, 6, 16, RACE_VAMPIRE},
673 { "Galil-Gamir", 30000, 140, 105, 6, 12, RACE_ELF},
674 { "Rorbag Book-Eater", 15000, 175, 108, 4, 12, RACE_KOBOLD},
675 { "Kiriarikirk", 20000, 120, 105, 6, 16, RACE_KLACKON},
676 { "Rilin the Quiet", 25000, 120, 110, 7, 19, RACE_DWARF},
677 { "Isung the Lord", 30000, 140, 105, 6, 12, RACE_HIGH_ELF},
678 { "Dolaf the Greedy", 10000, 175, 108, 4, 12, RACE_HUMAN},
679 { "Odnar the Sage", 15000, 120, 105, 6, 16, RACE_HIGH_ELF},
680 { "Gandar the Neutral", 25000, 120, 110, 7, 19, RACE_DARK_ELF},
681 { "Ro-sha the Patient", 30000, 140, 105, 6, 12, RACE_ELF},
682 { "Randolph Carter", 15000, 175, 108, 4, 12, RACE_HUMAN},
683 { "Sarai the Swift", 15000, 175, 108, 4, 12, RACE_HUMAN},
684 { "Bodril the Seer", 20000, 120, 105, 6, 16, RACE_HIGH_ELF},
685 { "Veloin the Quiet", 25000, 120, 110, 7, 19, RACE_ZOMBIE},
686 { "Vanthylas the Learned", 30000, 140, 105, 6, 12, RACE_MIND_FLAYER},
687 { "Ossein the Literate", 15000, 175, 108, 4, 12, RACE_SKELETON},
688 { "Olvar Bookworm", 20000, 120, 105, 6, 16, RACE_VAMPIRE},
695 { "博物館", 0, 100, 100, 0, 99, 99},
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},
728 { "Museum", 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},
766 static int cur_store_num = 0;
767 static int store_top = 0;
768 static int store_bottom = 0;
769 static int xtra_stock = 0;
770 static store_type *st_ptr = NULL;
771 static const owner_type *ot_ptr = NULL;
772 static s16b old_town_num = 0;
773 static s16b inner_town_num = 0;
774 #define RUMOR_CHANCE 8
776 #define MAX_COMMENT_1 6
778 static concptr comment_1[MAX_COMMENT_1] =
799 /*! ブラックマーケット追加メッセージ(承諾) */
800 static concptr comment_1_B[MAX_COMMENT_1] = {
809 #define MAX_COMMENT_2A 2
811 static concptr comment_2a[MAX_COMMENT_2A] =
814 "私の忍耐力を試しているのかい? $%s が最後だ。",
815 "我慢にも限度があるぞ。 $%s が最後だ。"
817 "You try my patience. %s is final.",
818 "My patience grows thin. %s is final."
823 #define MAX_COMMENT_2B 12
825 static concptr comment_2b[MAX_COMMENT_2B] =
828 " $%s ぐらいは出さなきゃダメだよ。",
831 "何て奴だ! $%s 以下はあり得ないぞ。",
832 "それじゃ少なすぎる! $%s は欲しいところだ。",
833 "バカにしている! $%s はもらわないと。",
835 "おいおい! $%s を考えてくれないか?",
836 "1000匹のオークのノミに苦しめられるがいい! $%s だ。",
837 "お前の大切なものに災いあれ! $%s でどうだ。",
838 "モルゴスに賞味されるがいい!本当は $%s なんだろう?",
839 "お前の母親はオーガか! $%s は出すつもりなんだろ?"
841 "I can take no less than %s gold pieces.",
842 "I will accept no less than %s gold pieces.",
843 "Ha! No less than %s gold pieces.",
844 "You knave! No less than %s gold pieces.",
845 "That's a pittance! I want %s gold pieces.",
846 "That's an insult! I want %s gold pieces.",
847 "As if! How about %s gold pieces?",
848 "My arse! How about %s gold pieces?",
849 "May the fleas of 1000 orcs molest you! Try %s gold pieces.",
850 "May your most favourite parts go moldy! Try %s gold pieces.",
851 "May Morgoth find you tasty! Perhaps %s gold pieces?",
852 "Your mother was an Ogre! Perhaps %s gold pieces?"
858 /*! ブラックマーケット用追加メッセージ(売るとき) */
859 static concptr comment_2b_B[MAX_COMMENT_2B] = {
860 "いくら俺様がお人好しとはいえ $%s が限界だね。嫌なら帰りな。",
861 "金がないのかい、あんた?まずは家に帰って $%s 揃えてきな。",
862 "物の価値が分からん奴だな。これは $%s が普通なんだよ。",
863 "俺の付けた値段に文句があるのか? $%s が限界だ。",
864 "ひょっとして新手の冗談かい? $%s 持ってないなら帰りな。",
865 "うちは他の店とは違うんだよ。$%s ぐらいは出しな。",
866 "買う気がないなら帰りな。 $%s だと言っているんだ。",
867 "話にならないね。 $%s くらい持っているんだろ?",
868 "は?なんだそりゃ? $%s の間違いか、ひょっとして?",
869 "出口はあっちだよ。それとも $%s 出せるのかい、あんたに。",
870 "命知らずな奴だな。 $%s 出せば今日の所は勘弁してやるよ。",
871 "うちの店は貧乏人お断りだ。 $%s ぐらい出せないのかい?"
874 #define MAX_COMMENT_3A 2
876 static concptr comment_3a[MAX_COMMENT_3A] =
879 "私の忍耐力を試しているのかい? $%s が最後だ。",
880 "我慢にも限度があるぞ。 $%s が最後だ。"
882 "You try my patience. %s is final.",
883 "My patience grows thin. %s is final."
889 #define MAX_COMMENT_3B 12
891 static concptr comment_3b[MAX_COMMENT_3B] =
894 "本音を言うと $%s でいいんだろ?",
896 " $%s ぐらいなら出してもいいが。",
897 " $%s 以上払うなんて考えられないね。",
898 "まあ落ちついて。 $%s でどうだい?",
899 "そのガラクタなら $%s で引き取るよ。",
900 "それじゃ高すぎる! $%s がいいとこだろ。",
901 "どうせいらないんだろ! $%s でいいだろ?",
902 "だめだめ! $%s がずっとお似合いだよ。",
903 "バカにしている! $%s がせいぜいだ。",
904 " $%s なら嬉しいところだがなあ。",
905 " $%s 、それ以上はビタ一文出さないよ!"
907 "Perhaps %s gold pieces?",
908 "How about %s gold pieces?",
909 "I will pay no more than %s gold pieces.",
910 "I can afford no more than %s gold pieces.",
911 "Be reasonable. How about %s gold pieces?",
912 "I'll buy it as scrap for %s gold pieces.",
913 "That is too much! How about %s gold pieces?",
914 "That looks war surplus! Say %s gold pieces?",
915 "Never! %s is more like it.",
916 "That's an insult! %s is more like it.",
917 "%s gold pieces and be thankful for it!",
918 "%s gold pieces and not a copper more!"
924 /*! ブラックマーケット用追加メッセージ(買い取り) */
925 static concptr comment_3b_B[MAX_COMMENT_3B] = {
926 " $%s ってところだね。そのどうしようもないガラクタは。",
927 "この俺が $%s って言っているんだから、その通りにした方が身のためだぞ。",
928 "俺の優しさに甘えるのもいい加減にしておけ。 $%s だ。",
929 "その品なら $%s で売ってくれているがね、常識ある紳士はみんな。",
930 "こりゃまた、がめつい奴だな。いくら俺が温厚とはいえ $%s が限界だ。",
931 " $%s だ。別に俺はそんなガラクタ欲しくはないんだから。",
932 "俺の鑑定額が気に入らないのか? $%s 、嫌なら帰りな。",
933 " $%s で引き取ってやるよ。喜んで受け取りな、貧乏人。",
934 "物の価値が分からん奴は始末におえんな。それは $%s なんだよ。",
935 "そんなに金が欲しいのか、あんた? $%s で満足できんのか?",
936 "入る店間違えてんじゃないのか? $%s で嫌なら他をあたってくれ。",
937 "俺の言い値にケチをつける奴がいるとは! その度胸に免じて $%s だ。"
940 #define MAX_COMMENT_4A 4
942 static concptr comment_4a[MAX_COMMENT_4A] =
945 "もうたくさんだ!何度も私をわずらわせないでくれ!",
946 "うがー!一日の我慢の限度を超えている!",
947 "もういい!時間の無駄以外のなにものでもない!",
948 "もうやってられないよ!顔も見たくない!"
950 "Enough! You have abused me once too often!",
951 "Arghhh! I have had enough abuse for one day!",
952 "That does it! You shall waste my time no more!",
953 "This is getting nowhere! I'm going to Londis!"
959 /*! ブラックマーケット用追加メッセージ(怒りの頂点) */
960 static concptr comment_4a_B[MAX_COMMENT_4A] = {
961 "なめやがって!温厚な俺様でも限界があるってことを知れ!",
962 "俺をここまで怒らせて...命があるだけでもありがたいと思え!",
963 "ふざけてるのか!冷やかしなら相手を見てからにしろ!",
964 "いいかげんにしろ!今度こんなまねしたらただじゃおかねえぞ!"
967 #define MAX_COMMENT_4B 4
969 static concptr comment_4b[MAX_COMMENT_4B] =
978 "Get out of my sight!",
979 "Begone, you scoundrel!",
986 /*! ブラックマーケット用追加メッセージ(追い出し) */
987 static concptr comment_4b_B[MAX_COMMENT_4B] = {
994 #define MAX_COMMENT_5 8
996 static concptr comment_5[MAX_COMMENT_5] =
1010 "You will have to do better than that!",
1011 "Do you wish to do business or not?",
1012 "You've got to be kidding!",
1013 "You'd better be kidding!",
1014 "You try my patience.",
1015 "Hmmm, nice weather we're having."
1021 /*! ブラックマーケット用追加メッセージ(怒り) */
1022 static concptr comment_5_B[MAX_COMMENT_5] = {
1033 #define MAX_COMMENT_6 4
1035 static concptr comment_6[MAX_COMMENT_6] =
1043 "I must have heard you wrong.",
1044 "I'm sorry, I missed that.",
1045 "I'm sorry, what was that?",
1046 "Sorry, what was that again?"
1051 /*** Initialize others ***/
1054 * 店舗で販売するオブジェクトを定義する / Hack -- Objects sold in the stores -- by tval/sval pair.
1056 byte store_table[MAX_STORES][STORE_CHOICES][2] =
1061 { TV_FOOD, SV_FOOD_RATION },
1062 { TV_FOOD, SV_FOOD_RATION },
1063 { TV_FOOD, SV_FOOD_RATION },
1064 { TV_FOOD, SV_FOOD_RATION },
1066 { TV_FOOD, SV_FOOD_RATION },
1067 { TV_FOOD, SV_FOOD_BISCUIT },
1068 { TV_FOOD, SV_FOOD_JERKY },
1069 { TV_FOOD, SV_FOOD_JERKY },
1071 { TV_FOOD, SV_FOOD_PINT_OF_WINE },
1072 { TV_FOOD, SV_FOOD_PINT_OF_ALE },
1073 { TV_LITE, SV_LITE_TORCH },
1074 { TV_LITE, SV_LITE_TORCH },
1076 { TV_LITE, SV_LITE_TORCH },
1077 { TV_LITE, SV_LITE_TORCH },
1078 { TV_LITE, SV_LITE_LANTERN },
1079 { TV_LITE, SV_LITE_LANTERN },
1091 { TV_SHOT, SV_AMMO_NORMAL },
1092 { TV_ARROW, SV_AMMO_NORMAL },
1093 { TV_BOLT, SV_AMMO_NORMAL },
1094 { TV_DIGGING, SV_SHOVEL },
1096 { TV_DIGGING, SV_PICK },
1097 { TV_CLOAK, SV_CLOAK },
1098 { TV_CLOAK, SV_CLOAK },
1099 { TV_CLOAK, SV_FUR_CLOAK },
1101 { TV_FOOD, SV_FOOD_RATION },
1102 { TV_FOOD, SV_FOOD_RATION },
1103 { TV_FOOD, SV_FOOD_RATION },
1104 { TV_FOOD, SV_FOOD_RATION },
1106 { TV_POTION, SV_POTION_WATER },
1107 { TV_POTION, SV_POTION_WATER },
1108 { TV_LITE, SV_LITE_LANTERN },
1109 { TV_LITE, SV_LITE_LANTERN },
1111 { TV_FOOD, SV_FOOD_WAYBREAD },
1112 { TV_FOOD, SV_FOOD_WAYBREAD },
1116 { TV_SHOT, SV_AMMO_NORMAL },
1117 { TV_ARROW, SV_AMMO_NORMAL },
1118 { TV_BOLT, SV_AMMO_NORMAL },
1119 { TV_DIGGING, SV_SHOVEL }
1125 { TV_BOOTS, SV_PAIR_OF_SOFT_LEATHER_BOOTS },
1126 { TV_BOOTS, SV_PAIR_OF_SOFT_LEATHER_BOOTS },
1127 { TV_BOOTS, SV_PAIR_OF_HARD_LEATHER_BOOTS },
1128 { TV_BOOTS, SV_PAIR_OF_HARD_LEATHER_BOOTS },
1130 { TV_HELM, SV_HARD_LEATHER_CAP },
1131 { TV_HELM, SV_HARD_LEATHER_CAP },
1132 { TV_HELM, SV_METAL_CAP },
1133 { TV_HELM, SV_IRON_HELM },
1135 { TV_SOFT_ARMOR, SV_ROBE },
1136 { TV_SOFT_ARMOR, SV_ROBE },
1137 { TV_SOFT_ARMOR, SV_SOFT_LEATHER_ARMOR },
1138 { TV_SOFT_ARMOR, SV_SOFT_LEATHER_ARMOR },
1140 { TV_SOFT_ARMOR, SV_HARD_LEATHER_ARMOR },
1141 { TV_SOFT_ARMOR, SV_HARD_LEATHER_ARMOR },
1142 { TV_SOFT_ARMOR, SV_HARD_STUDDED_LEATHER },
1143 { TV_SOFT_ARMOR, SV_HARD_STUDDED_LEATHER },
1145 { TV_SOFT_ARMOR, SV_RHINO_HIDE_ARMOR },
1146 { TV_SOFT_ARMOR, SV_LEATHER_SCALE_MAIL },
1147 { TV_HARD_ARMOR, SV_METAL_SCALE_MAIL },
1148 { TV_HARD_ARMOR, SV_CHAIN_MAIL },
1150 { TV_HARD_ARMOR, SV_DOUBLE_RING_MAIL },
1151 { TV_HARD_ARMOR, SV_AUGMENTED_CHAIN_MAIL },
1152 { TV_HARD_ARMOR, SV_BAR_CHAIN_MAIL },
1153 { TV_HARD_ARMOR, SV_DOUBLE_CHAIN_MAIL },
1155 { TV_HARD_ARMOR, SV_METAL_BRIGANDINE_ARMOUR },
1156 { TV_HARD_ARMOR, SV_SPLINT_MAIL },
1157 { TV_GLOVES, SV_SET_OF_LEATHER_GLOVES },
1158 { TV_GLOVES, SV_SET_OF_LEATHER_GLOVES },
1160 { TV_GLOVES, SV_SET_OF_GAUNTLETS },
1161 { TV_SHIELD, SV_SMALL_LEATHER_SHIELD },
1162 { TV_SHIELD, SV_LARGE_LEATHER_SHIELD },
1163 { TV_SHIELD, SV_SMALL_METAL_SHIELD },
1165 { TV_BOOTS, SV_PAIR_OF_HARD_LEATHER_BOOTS },
1166 { TV_BOOTS, SV_PAIR_OF_HARD_LEATHER_BOOTS },
1167 { TV_HELM, SV_HARD_LEATHER_CAP },
1168 { TV_HELM, SV_HARD_LEATHER_CAP },
1170 { TV_SOFT_ARMOR, SV_ROBE },
1171 { TV_SOFT_ARMOR, SV_SOFT_LEATHER_ARMOR },
1172 { TV_SOFT_ARMOR, SV_SOFT_LEATHER_ARMOR },
1173 { TV_SOFT_ARMOR, SV_HARD_LEATHER_ARMOR },
1175 { TV_SOFT_ARMOR, SV_LEATHER_JACK },
1176 { TV_HARD_ARMOR, SV_METAL_SCALE_MAIL },
1177 { TV_HARD_ARMOR, SV_CHAIN_MAIL },
1178 { TV_HARD_ARMOR, SV_CHAIN_MAIL },
1180 { TV_GLOVES, SV_SET_OF_LEATHER_GLOVES },
1181 { TV_GLOVES, SV_SET_OF_GAUNTLETS },
1182 { TV_SHIELD, SV_SMALL_LEATHER_SHIELD },
1183 { TV_SHIELD, SV_SMALL_LEATHER_SHIELD }
1189 { TV_SWORD, SV_DAGGER },
1190 { TV_SWORD, SV_MAIN_GAUCHE },
1191 { TV_SWORD, SV_RAPIER },
1192 { TV_SWORD, SV_SMALL_SWORD },
1194 { TV_SWORD, SV_SHORT_SWORD },
1195 { TV_SWORD, SV_SABRE },
1196 { TV_SWORD, SV_CUTLASS },
1197 { TV_SWORD, SV_TULWAR },
1199 { TV_SWORD, SV_BROAD_SWORD },
1200 { TV_SWORD, SV_LONG_SWORD },
1201 { TV_SWORD, SV_SCIMITAR },
1202 { TV_SWORD, SV_KATANA },
1204 { TV_SWORD, SV_BASTARD_SWORD },
1205 { TV_POLEARM, SV_SPEAR },
1206 { TV_POLEARM, SV_AWL_PIKE },
1207 { TV_POLEARM, SV_TRIDENT },
1209 { TV_POLEARM, SV_PIKE },
1210 { TV_POLEARM, SV_BEAKED_AXE },
1211 { TV_POLEARM, SV_BROAD_AXE },
1212 { TV_POLEARM, SV_LANCE },
1214 { TV_POLEARM, SV_BATTLE_AXE },
1215 { TV_POLEARM, SV_HATCHET },
1216 { TV_BOW, SV_SLING },
1217 { TV_BOW, SV_SHORT_BOW },
1219 { TV_BOW, SV_LIGHT_XBOW },
1220 { TV_SHOT, SV_AMMO_NORMAL },
1221 { TV_SHOT, SV_AMMO_NORMAL },
1222 { TV_ARROW, SV_AMMO_NORMAL },
1224 { TV_ARROW, SV_AMMO_NORMAL },
1225 { TV_BOLT, SV_AMMO_NORMAL },
1226 { TV_BOLT, SV_AMMO_NORMAL },
1227 { TV_BOW, SV_LIGHT_XBOW },
1229 { TV_ARROW, SV_AMMO_NORMAL },
1230 { TV_BOLT, SV_AMMO_NORMAL },
1231 { TV_BOW, SV_SHORT_BOW },
1232 { TV_BOW, SV_LIGHT_XBOW },
1234 { TV_SWORD, SV_DAGGER },
1235 { TV_SWORD, SV_TANTO },
1236 { TV_SWORD, SV_RAPIER },
1237 { TV_SWORD, SV_SMALL_SWORD },
1239 { TV_SWORD, SV_SHORT_SWORD },
1240 { TV_SWORD, SV_LONG_SWORD },
1241 { TV_SWORD, SV_SCIMITAR },
1242 { TV_SWORD, SV_BROAD_SWORD },
1244 { TV_HISSATSU_BOOK, 0 },
1245 { TV_HISSATSU_BOOK, 0 },
1246 { TV_HISSATSU_BOOK, 1 },
1247 { TV_HISSATSU_BOOK, 1 },
1253 { TV_HAFTED, SV_NUNCHAKU },
1254 { TV_HAFTED, SV_QUARTERSTAFF },
1255 { TV_HAFTED, SV_MACE },
1256 { TV_HAFTED, SV_BO_STAFF },
1258 { TV_HAFTED, SV_WAR_HAMMER },
1259 { TV_HAFTED, SV_WAR_HAMMER },
1260 { TV_HAFTED, SV_MORNING_STAR },
1261 { TV_HAFTED, SV_FLAIL },
1263 { TV_HAFTED, SV_LEAD_FILLED_MACE },
1264 { TV_SCROLL, SV_SCROLL_REMOVE_CURSE },
1265 { TV_SCROLL, SV_SCROLL_BLESSING },
1266 { TV_SCROLL, SV_SCROLL_HOLY_CHANT },
1268 { TV_POTION, SV_POTION_HEROISM },
1269 { TV_SCROLL, SV_SCROLL_WORD_OF_RECALL },
1270 { TV_SCROLL, SV_SCROLL_WORD_OF_RECALL },
1271 { TV_SCROLL, SV_SCROLL_WORD_OF_RECALL },
1273 { TV_POTION, SV_POTION_CURE_LIGHT },
1274 { TV_POTION, SV_POTION_CURE_SERIOUS },
1275 { TV_POTION, SV_POTION_CURE_SERIOUS },
1276 { TV_POTION, SV_POTION_CURE_CRITICAL },
1278 { TV_POTION, SV_POTION_CURE_CRITICAL },
1279 { TV_POTION, SV_POTION_RESTORE_EXP },
1280 { TV_POTION, SV_POTION_RESTORE_EXP },
1281 { TV_POTION, SV_POTION_RESTORE_EXP },
1283 { TV_LIFE_BOOK, 0 },
1284 { TV_LIFE_BOOK, 0 },
1285 { TV_LIFE_BOOK, 1 },
1286 { TV_LIFE_BOOK, 1 },
1288 { TV_CRUSADE_BOOK, 0 },
1289 { TV_CRUSADE_BOOK, 0 },
1290 { TV_CRUSADE_BOOK, 1 },
1291 { TV_CRUSADE_BOOK, 1 },
1293 { TV_HAFTED, SV_WHIP },
1294 { TV_HAFTED, SV_MACE },
1295 { TV_HAFTED, SV_BALL_AND_CHAIN },
1296 { TV_HAFTED, SV_WAR_HAMMER },
1298 { TV_SCROLL, SV_SCROLL_WORD_OF_RECALL },
1299 { TV_SCROLL, SV_SCROLL_WORD_OF_RECALL },
1300 { TV_SCROLL, SV_SCROLL_WORD_OF_RECALL },
1301 { TV_POTION, SV_POTION_CURE_CRITICAL },
1303 { TV_POTION, SV_POTION_CURE_CRITICAL },
1304 { TV_POTION, SV_POTION_RESTORE_EXP },
1307 { TV_STATUE, SV_ANY },
1309 { TV_SCROLL, SV_SCROLL_REMOVE_CURSE },
1310 { TV_SCROLL, SV_SCROLL_REMOVE_CURSE },
1311 { TV_SCROLL, SV_SCROLL_STAR_REMOVE_CURSE },
1312 { TV_SCROLL, SV_SCROLL_STAR_REMOVE_CURSE }
1318 { TV_SCROLL, SV_SCROLL_ENCHANT_WEAPON_TO_HIT },
1319 { TV_SCROLL, SV_SCROLL_ENCHANT_WEAPON_TO_DAM },
1320 { TV_SCROLL, SV_SCROLL_ENCHANT_ARMOR },
1321 { TV_SCROLL, SV_SCROLL_IDENTIFY },
1323 { TV_SCROLL, SV_SCROLL_IDENTIFY },
1324 { TV_SCROLL, SV_SCROLL_IDENTIFY },
1325 { TV_SCROLL, SV_SCROLL_IDENTIFY },
1326 { TV_SCROLL, SV_SCROLL_LIGHT },
1328 { TV_SCROLL, SV_SCROLL_PHASE_DOOR },
1329 { TV_SCROLL, SV_SCROLL_PHASE_DOOR },
1330 { TV_SCROLL, SV_SCROLL_TELEPORT },
1331 { TV_SCROLL, SV_SCROLL_MONSTER_CONFUSION },
1333 { TV_SCROLL, SV_SCROLL_MAPPING },
1334 { TV_SCROLL, SV_SCROLL_DETECT_GOLD },
1335 { TV_SCROLL, SV_SCROLL_DETECT_ITEM },
1336 { TV_SCROLL, SV_SCROLL_DETECT_TRAP },
1338 { TV_SCROLL, SV_SCROLL_DETECT_INVIS },
1339 { TV_SCROLL, SV_SCROLL_RECHARGING },
1340 { TV_SCROLL, SV_SCROLL_TELEPORT },
1341 { TV_SCROLL, SV_SCROLL_WORD_OF_RECALL },
1343 { 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_TELEPORT },
1348 { TV_SCROLL, SV_SCROLL_TELEPORT },
1349 { TV_POTION, SV_POTION_RES_STR },
1350 { TV_POTION, SV_POTION_RES_INT },
1351 { TV_POTION, SV_POTION_RES_WIS },
1353 { TV_POTION, SV_POTION_RES_DEX },
1354 { TV_POTION, SV_POTION_RES_CON },
1355 { TV_POTION, SV_POTION_RES_CHR },
1356 { TV_SCROLL, SV_SCROLL_IDENTIFY },
1358 { TV_SCROLL, SV_SCROLL_IDENTIFY },
1359 { TV_SCROLL, SV_SCROLL_STAR_IDENTIFY }, /* Yep, occasionally! */
1360 { TV_SCROLL, SV_SCROLL_STAR_IDENTIFY },
1361 { TV_SCROLL, SV_SCROLL_LIGHT },
1363 { TV_POTION, SV_POTION_RES_STR },
1364 { TV_POTION, SV_POTION_RES_INT },
1365 { TV_POTION, SV_POTION_RES_WIS },
1366 { TV_POTION, SV_POTION_RES_DEX },
1368 { TV_POTION, SV_POTION_RES_CON },
1369 { TV_POTION, SV_POTION_RES_CHR },
1370 { TV_SCROLL, SV_SCROLL_ENCHANT_ARMOR },
1371 { TV_SCROLL, SV_SCROLL_ENCHANT_ARMOR },
1373 { TV_SCROLL, SV_SCROLL_RECHARGING },
1374 { TV_SCROLL, SV_SCROLL_PHASE_DOOR },
1375 { TV_SCROLL, SV_SCROLL_ENCHANT_WEAPON_TO_HIT },
1376 { TV_SCROLL, SV_SCROLL_ENCHANT_WEAPON_TO_DAM },
1381 /* Magic-User store */
1383 { TV_RING, SV_RING_PROTECTION },
1384 { TV_RING, SV_RING_LEVITATION_FALL },
1385 { TV_RING, SV_RING_PROTECTION },
1386 { TV_RING, SV_RING_RESIST_FIRE },
1388 { TV_RING, SV_RING_RESIST_COLD },
1389 { TV_AMULET, SV_AMULET_CHARISMA },
1390 { TV_RING, SV_RING_WARNING },
1391 { TV_AMULET, SV_AMULET_RESIST_ACID },
1393 { TV_AMULET, SV_AMULET_SEARCHING },
1394 { TV_WAND, SV_WAND_SLOW_MONSTER },
1395 { TV_WAND, SV_WAND_CONFUSE_MONSTER },
1396 { TV_WAND, SV_WAND_SLEEP_MONSTER },
1398 { TV_WAND, SV_WAND_MAGIC_MISSILE },
1399 { TV_WAND, SV_WAND_STINKING_CLOUD },
1400 { TV_WAND, SV_WAND_WONDER },
1401 { TV_WAND, SV_WAND_DISARMING },
1403 { TV_STAFF, SV_STAFF_LITE },
1404 { TV_STAFF, SV_STAFF_MAPPING },
1405 { TV_STAFF, SV_STAFF_DETECT_TRAP },
1406 { TV_STAFF, SV_STAFF_DETECT_DOOR },
1408 { TV_STAFF, SV_STAFF_DETECT_GOLD },
1409 { TV_STAFF, SV_STAFF_DETECT_ITEM },
1410 { TV_STAFF, SV_STAFF_DETECT_INVIS },
1411 { TV_STAFF, SV_STAFF_DETECT_EVIL },
1413 { TV_STAFF, SV_STAFF_TELEPORTATION },
1414 { TV_STAFF, SV_STAFF_TELEPORTATION },
1415 { TV_STAFF, SV_STAFF_TELEPORTATION },
1416 { TV_STAFF, SV_STAFF_TELEPORTATION },
1418 { TV_STAFF, SV_STAFF_IDENTIFY },
1419 { TV_STAFF, SV_STAFF_IDENTIFY },
1420 { TV_STAFF, SV_STAFF_IDENTIFY },
1422 { TV_STAFF, SV_STAFF_IDENTIFY },
1423 { TV_STAFF, SV_STAFF_REMOVE_CURSE },
1424 { TV_STAFF, SV_STAFF_CURE_LIGHT },
1425 { TV_STAFF, SV_STAFF_PROBING },
1429 { TV_SORCERY_BOOK, 0 },
1430 { TV_SORCERY_BOOK, 0 },
1431 { TV_SORCERY_BOOK, 1 },
1432 { TV_SORCERY_BOOK, 1 },
1434 { TV_ARCANE_BOOK, 0 },
1435 { TV_ARCANE_BOOK, 0 },
1436 { TV_ARCANE_BOOK, 1 },
1437 { TV_ARCANE_BOOK, 1 },
1439 { TV_ARCANE_BOOK, 2 },
1440 { TV_ARCANE_BOOK, 2 },
1441 { TV_ARCANE_BOOK, 3 },
1442 { TV_ARCANE_BOOK, 3 },
1447 /* Black Market (unused) */
1520 { TV_SORCERY_BOOK, 0 },
1521 { TV_SORCERY_BOOK, 0 },
1522 { TV_SORCERY_BOOK, 1 },
1523 { TV_SORCERY_BOOK, 1 },
1525 { TV_NATURE_BOOK, 0 },
1526 { TV_NATURE_BOOK, 0 },
1527 { TV_NATURE_BOOK, 1 },
1528 { TV_NATURE_BOOK, 1 },
1530 { TV_CHAOS_BOOK, 0 },
1531 { TV_CHAOS_BOOK, 0 },
1532 { TV_CHAOS_BOOK, 1 },
1533 { TV_CHAOS_BOOK, 1 },
1535 { TV_DEATH_BOOK, 0 },
1536 { TV_DEATH_BOOK, 0 },
1537 { TV_DEATH_BOOK, 1 },
1538 { TV_DEATH_BOOK, 1 },
1540 { TV_TRUMP_BOOK, 0 }, /* +16 */
1541 { TV_TRUMP_BOOK, 0 },
1542 { TV_TRUMP_BOOK, 1 },
1543 { TV_TRUMP_BOOK, 1 },
1545 { TV_ARCANE_BOOK, 0 },
1546 { TV_ARCANE_BOOK, 1 },
1547 { TV_ARCANE_BOOK, 2 },
1548 { TV_ARCANE_BOOK, 3 },
1550 { TV_CRAFT_BOOK, 0 },
1551 { TV_CRAFT_BOOK, 0 },
1552 { TV_CRAFT_BOOK, 1 },
1553 { TV_CRAFT_BOOK, 1 },
1555 { TV_DAEMON_BOOK, 0 },
1556 { TV_DAEMON_BOOK, 0 },
1557 { TV_DAEMON_BOOK, 1 },
1558 { TV_DAEMON_BOOK, 1 },
1560 { TV_MUSIC_BOOK, 0 },
1561 { TV_MUSIC_BOOK, 0 },
1562 { TV_MUSIC_BOOK, 1 },
1563 { TV_MUSIC_BOOK, 1 },
1572 /* Museum (unused) */
1611 * @brief 取引成功時の店主のメッセージ処理 /
1612 * Successful haggle.
1615 static void say_comment_1(void)
1618 /* ブラックマーケットのときは別のメッセージを出す */
1619 if ( cur_store_num == STORE_BLACK ) {
1620 msg_print(comment_1_B[randint0(MAX_COMMENT_1)]);
1623 msg_print(comment_1[randint0(MAX_COMMENT_1)]);
1626 msg_print(comment_1[randint0(MAX_COMMENT_1)]);
1630 if (one_in_(RUMOR_CHANCE))
1633 msg_print("店主は耳うちした:");
1635 msg_print("The shopkeeper whispers something into your ear:");
1637 display_rumor(TRUE);
1643 * @brief プレイヤーがアイテムを買う時の価格代案メッセージ処理 /
1644 * Continue haggling (player is buying)
1645 * @param value 店主の提示価格
1646 * @param annoyed 店主のいらつき度
1649 static void say_comment_2(PRICE value, int annoyed)
1653 /* Prepare a string to insert */
1654 sprintf(tmp_val, "%ld", (long)value);
1659 /* Formatted message */
1660 msg_format(comment_2a[randint0(MAX_COMMENT_2A)], tmp_val);
1666 /* Formatted message */
1668 /* ブラックマーケットの時は別のメッセージを出す */
1669 if ( cur_store_num == STORE_BLACK ){
1670 msg_format(comment_2b_B[randint0(MAX_COMMENT_2B)], tmp_val);
1673 msg_format(comment_2b[randint0(MAX_COMMENT_2B)], tmp_val);
1676 msg_format(comment_2b[randint0(MAX_COMMENT_2B)], tmp_val);
1684 * @brief プレイヤーがアイテムを売る時の価格代案メッセージ処理 /
1685 * Continue haggling (player is selling)
1686 * @param value 店主の提示価格
1687 * @param annoyed 店主のいらつき度
1690 static void say_comment_3(PRICE value, int annoyed)
1694 /* Prepare a string to insert */
1695 sprintf(tmp_val, "%ld", (long)value);
1700 /* Formatted message */
1701 msg_format(comment_3a[randint0(MAX_COMMENT_3A)], tmp_val);
1707 /* Formatted message */
1709 /* ブラックマーケットの時は別のメッセージを出す */
1710 if ( cur_store_num == STORE_BLACK ){
1711 msg_format(comment_3b_B[randint0(MAX_COMMENT_3B)], tmp_val);
1714 msg_format(comment_3b[randint0(MAX_COMMENT_3B)], tmp_val);
1717 msg_format(comment_3b[randint0(MAX_COMMENT_3B)], tmp_val);
1725 * @brief 店主がプレイヤーを追い出す時のメッセージ処理 /
1726 * Kick 'da bum out. -RAK-
1729 static void say_comment_4(void)
1732 /* ブラックマーケットの時は別のメッセージを出す */
1733 if ( cur_store_num == STORE_BLACK ){
1734 msg_print(comment_4a_B[randint0(MAX_COMMENT_4A)]);
1735 msg_print(comment_4b_B[randint0(MAX_COMMENT_4B)]);
1738 msg_print(comment_4a[randint0(MAX_COMMENT_4A)]);
1739 msg_print(comment_4b[randint0(MAX_COMMENT_4B)]);
1742 msg_print(comment_4a[randint0(MAX_COMMENT_4A)]);
1743 msg_print(comment_4b[randint0(MAX_COMMENT_4B)]);
1750 * @brief 店主がプレイヤーに取り合わない時のメッセージ処理 /
1751 * You are insulting me
1754 static void say_comment_5(void)
1757 /* ブラックマーケットの時は別のメッセージを出す */
1758 if ( cur_store_num == STORE_BLACK ){
1759 msg_print(comment_5_B[randint0(MAX_COMMENT_5)]);
1762 msg_print(comment_5[randint0(MAX_COMMENT_5)]);
1765 msg_print(comment_5[randint0(MAX_COMMENT_5)]);
1772 * @brief 店主がプレイヤーの提示を理解できなかった時のメッセージ処理 /
1773 * That makes no sense.
1776 static void say_comment_6(void)
1778 msg_print(comment_6[randint0(MAX_COMMENT_6)]);
1782 #define MAX_COMMENT_7A 4
1784 static concptr comment_7a[MAX_COMMENT_7A] =
1789 "誰かがむせび泣く声が聞こえる...。",
1794 "You hear someone sobbing...",
1795 "The shopkeeper howls in agony!"
1800 #define MAX_COMMENT_7B 4
1802 static concptr comment_7b[MAX_COMMENT_7B] =
1812 "The shopkeeper curses at you.",
1813 "The shopkeeper glares at you."
1818 #define MAX_COMMENT_7C 4
1820 static concptr comment_7c[MAX_COMMENT_7C] =
1829 "You've made my day!",
1830 "The shopkeeper giggles.",
1831 "The shopkeeper laughs loudly."
1836 #define MAX_COMMENT_7D 4
1838 static concptr comment_7d[MAX_COMMENT_7D] =
1842 "こんなおいしい思いをしたら、真面目に働けなくなるなぁ。",
1847 "I think I'll retire!",
1848 "The shopkeeper jumps for joy.",
1849 "The shopkeeper smiles gleefully."
1856 * @brief 店主が交渉を終えた際の反応を返す処理 /
1857 * Let a shop-keeper React to a purchase
1858 * @param price アイテムの取引額
1859 * @param value アイテムの実際価値
1860 * @param guess 店主が当初予想していた価値
1863 * We paid "price", it was worth "value", and we thought it was worth "guess"
1865 static void purchase_analyze(PRICE price, PRICE value, PRICE guess)
1867 /* Item was worthless, but we bought it */
1868 if ((value <= 0) && (price > value))
1870 msg_print(comment_7a[randint0(MAX_COMMENT_7A)]);
1871 chg_virtue(V_HONOUR, -1);
1872 chg_virtue(V_JUSTICE, -1);
1873 sound(SOUND_STORE1);
1876 /* Item was cheaper than we thought, and we paid more than necessary */
1877 else if ((value < guess) && (price > value))
1879 msg_print(comment_7b[randint0(MAX_COMMENT_7B)]);
1880 chg_virtue(V_JUSTICE, -1);
1881 if (one_in_(4)) chg_virtue(V_HONOUR, -1);
1882 sound(SOUND_STORE2);
1885 /* Item was a good bargain, and we got away with it */
1886 else if ((value > guess) && (value < (4 * guess)) && (price < value))
1888 msg_print(comment_7c[randint0(MAX_COMMENT_7C)]);
1889 if (one_in_(4)) chg_virtue(V_HONOUR, -1);
1890 else if (one_in_(4)) chg_virtue(V_HONOUR, 1);
1891 sound(SOUND_STORE3);
1894 /* Item was a great bargain, and we got away with it */
1895 else if ((value > guess) && (price < value))
1897 msg_print(comment_7d[randint0(MAX_COMMENT_7D)]);
1898 if (one_in_(2)) chg_virtue(V_HONOUR, -1);
1899 if (one_in_(4)) chg_virtue(V_HONOUR, 1);
1900 if (10 * price < value) chg_virtue(V_SACRIFICE, 1);
1901 sound(SOUND_STORE4);
1908 * We store the current "store feat" here so everyone can access it
1910 static int cur_store_feat;
1914 * Buying and selling adjustments for race combinations.
1915 * Entry[owner][player] gives the basic "cost inflation".
1917 static byte rgold_adj[MAX_RACES][MAX_RACES] =
1919 /*Hum, HfE, Elf, Hal, Gno, Dwa, HfO, HfT, Dun, HiE, Barbarian,
1920 HfOg, HGn, HTn, Cyc, Yek, Klc, Kbd, Nbl, DkE, Drc, Mind Flayer,
1921 Imp, Glm, Skl, Zombie, Vampire, Spectre, Fairy, Beastman, Ent,
1922 Angel, Demon, Kutar */
1925 { 100, 105, 105, 110, 113, 115, 120, 125, 100, 105, 100,
1926 124, 120, 110, 125, 115, 120, 120, 120, 120, 115, 120,
1927 115, 105, 125, 125, 125, 125, 105, 120, 105, 95, 140,
1928 100, 120, 110, 105 },
1931 { 110, 100, 100, 105, 110, 120, 125, 130, 110, 100, 110,
1932 120, 115, 108, 115, 110, 110, 120, 120, 115, 115, 110,
1933 120, 110, 110, 110, 120, 110, 100, 125, 100, 95, 140,
1934 110, 115, 110, 110 },
1937 { 110, 105, 100, 105, 110, 120, 125, 130, 110, 100, 110,
1938 120, 120, 105, 120, 110, 105, 125, 125, 110, 115, 108,
1939 120, 115, 110, 110, 120, 110, 100, 125, 100, 95, 140,
1940 110, 110, 105, 110 },
1943 { 115, 110, 105, 95, 105, 110, 115, 130, 115, 105, 115,
1944 125, 120, 120, 125, 115, 110, 120, 120, 120, 115, 115,
1945 120, 110, 120, 120, 130, 110, 110, 130, 110, 95, 140,
1946 115, 120, 105, 115 },
1949 { 115, 115, 110, 105, 95, 110, 115, 130, 115, 110, 115,
1950 120, 125, 110, 120, 110, 105, 120, 110, 110, 105, 110,
1951 120, 101, 110, 110, 120, 120, 115, 130, 115, 95, 140,
1952 115, 110, 110, 115 },
1955 { 115, 120, 120, 110, 110, 95, 125, 135, 115, 120, 115,
1956 125, 140, 130, 130, 120, 115, 115, 115, 135, 125, 120,
1957 120, 105, 115, 115, 115, 115, 120, 130, 120, 95, 140,
1958 115, 110, 115, 115 },
1961 { 115, 120, 125, 115, 115, 130, 110, 115, 115, 125, 115,
1962 110, 110, 120, 110, 120, 125, 115, 115, 110, 120, 110,
1963 115, 125, 120, 120, 115, 120, 125, 115, 125, 95, 140,
1964 115, 110, 115, 115 },
1967 { 110, 115, 115, 110, 110, 130, 110, 110, 110, 115, 110,
1968 110, 115, 120, 110, 120, 120, 110, 110, 110, 115, 110,
1969 110, 115, 112, 112, 115, 112, 120, 110, 120, 95, 140,
1970 110, 110, 115, 110 },
1973 { 100, 105, 105, 110, 113, 115, 120, 125, 100, 105, 100,
1974 120, 120, 105, 120, 115, 105, 115, 120, 110, 105, 105,
1975 120, 105, 120, 120, 125, 120, 105, 135, 105, 95, 140,
1976 100, 110, 110, 100 },
1979 { 110, 105, 100, 105, 110, 120, 125, 130, 110, 100, 110,
1980 125, 125, 101, 120, 115, 110, 115, 125, 110, 110, 110,
1981 125, 115, 120, 120, 125, 120, 100, 125, 100, 95, 140,
1982 110, 110, 105, 110 },
1984 /* Human / Barbarian (copied from human) */
1985 { 100, 105, 105, 110, 113, 115, 120, 125, 100, 105, 100,
1986 124, 120, 110, 125, 115, 120, 120, 120, 120, 115, 120,
1987 115, 105, 125, 125, 130, 125, 115, 120, 115, 95, 140,
1988 100, 120, 110, 100 },
1990 /* Half-Ogre: theoretical, copied from half-troll */
1991 { 110, 115, 115, 110, 110, 130, 110, 110, 110, 115, 110,
1992 110, 115, 120, 110, 120, 120, 110, 110, 110, 115, 110,
1993 110, 115, 112, 112, 115, 112, 120, 110, 120, 95, 140,
1994 110, 110, 115, 110 },
1996 /* Half-Giant: theoretical, copied from half-troll */
1997 { 110, 115, 115, 110, 110, 130, 110, 110, 110, 115, 110,
1998 110, 115, 120, 110, 120, 120, 110, 110, 110, 115, 110,
1999 110, 115, 112, 112, 115, 112, 130, 120, 130, 95, 140,
2000 110, 110, 115, 110 },
2002 /* Half-Titan: theoretical, copied from High_Elf */
2003 { 110, 105, 100, 105, 110, 120, 125, 130, 110, 100, 110,
2004 125, 125, 101, 120, 115, 110, 115, 125, 110, 110, 110,
2005 125, 115, 120, 120, 120, 120, 130, 130, 130, 95, 140,
2006 110, 110, 115, 110 },
2008 /* Cyclops: theoretical, copied from half-troll */
2009 { 110, 115, 115, 110, 110, 130, 110, 110, 110, 115, 110,
2010 110, 115, 120, 110, 120, 120, 110, 110, 110, 115, 110,
2011 110, 115, 112, 112, 115, 112, 130, 130, 130, 95, 140,
2012 110, 110, 115, 110 },
2014 /* Yeek: theoretical, copied from Half-Orc */
2015 { 115, 120, 125, 115, 115, 130, 110, 115, 115, 125, 115,
2016 110, 110, 120, 110, 120, 125, 115, 115, 110, 120, 110,
2017 115, 125, 120, 120, 120, 120, 130, 130, 130, 95, 140,
2018 115, 110, 115, 115 },
2020 /* Klackon: theoretical, copied from Gnome */
2021 { 115, 115, 110, 105, 95, 110, 115, 130, 115, 110, 115,
2022 120, 125, 110, 120, 110, 105, 120, 110, 110, 105, 110,
2023 120, 101, 110, 110, 120, 120, 130, 130, 130, 95, 140,
2024 115, 110, 115, 115 },
2026 /* Kobold: theoretical, copied from Half-Orc */
2027 { 115, 120, 125, 115, 115, 130, 110, 115, 115, 125, 115,
2028 110, 110, 120, 110, 120, 125, 115, 115, 110, 120, 110,
2029 115, 125, 120, 120, 120, 120, 130, 130, 130, 95, 140,
2030 115, 110, 115, 115 },
2032 /* Nibelung: theoretical, copied from Dwarf */
2033 { 115, 120, 120, 110, 110, 95, 125, 135, 115, 120, 115,
2034 125, 140, 130, 130, 120, 115, 115, 115, 135, 125, 120,
2035 120, 105, 115, 115, 120, 120, 130, 130, 130, 95, 140,
2036 115, 135, 115, 115 },
2039 { 110, 110, 110, 115, 120, 130, 115, 115, 120, 110, 115,
2040 115, 115, 116, 115, 120, 120, 115, 115, 101, 110, 110,
2041 110, 110, 112, 122, 110, 110, 110, 115, 110, 120, 120,
2042 110, 101, 115, 110 },
2044 /* Draconian: theoretical, copied from High_Elf */
2045 { 110, 105, 100, 105, 110, 120, 125, 130, 110, 100, 110,
2046 125, 125, 101, 120, 115, 110, 115, 125, 110, 110, 110,
2047 125, 115, 120, 120, 120, 120, 130, 130, 130, 95, 140,
2048 110, 110, 115, 110 },
2050 /* Mind Flayer: theoretical, copied from High_Elf */
2051 { 110, 105, 100, 105, 110, 120, 125, 130, 110, 100, 110,
2052 125, 125, 101, 120, 115, 110, 115, 125, 110, 110, 110,
2053 125, 115, 120, 120, 120, 120, 130, 130, 130, 95, 140,
2054 110, 110, 115, 110 },
2056 /* Imp: theoretical, copied from High_Elf */
2057 { 110, 105, 100, 105, 110, 120, 125, 130, 110, 100, 110,
2058 125, 125, 101, 120, 115, 110, 115, 125, 110, 110, 110,
2059 125, 115, 120, 120, 120, 120, 130, 130, 130, 120, 120,
2060 110, 110, 115, 110 },
2062 /* Golem: theoretical, copied from High_Elf */
2063 { 110, 105, 100, 105, 110, 120, 125, 130, 110, 100, 110,
2064 125, 125, 101, 120, 115, 110, 115, 125, 110, 110, 110,
2065 125, 115, 120, 120, 120, 120, 130, 130, 130, 95, 140,
2066 110, 110, 115, 110 },
2068 /* Skeleton: theoretical, copied from half-orc */
2069 { 115, 120, 125, 115, 115, 130, 110, 115, 115, 125, 115,
2070 110, 110, 120, 110, 120, 125, 115, 115, 110, 120, 110,
2071 115, 125, 120, 120, 120, 120, 130, 130, 130, 120, 120,
2072 115, 110, 125, 115 },
2074 /* Zombie: Theoretical, copied from half-orc */
2075 { 115, 120, 125, 115, 115, 130, 110, 115, 115, 125, 115,
2076 110, 110, 120, 110, 120, 125, 115, 115, 110, 120, 110,
2077 115, 125, 120, 120, 120, 120, 130, 130, 130, 120, 120,
2078 115, 110, 125, 115 },
2080 /* Vampire: Theoretical, copied from half-orc */
2081 { 115, 120, 125, 115, 115, 130, 110, 115, 115, 125, 115,
2082 110, 110, 120, 110, 120, 125, 115, 115, 110, 120, 110,
2083 115, 125, 120, 120, 120, 120, 130, 130, 130, 120, 120,
2084 115, 110, 125, 115 },
2086 /* Spectre: Theoretical, copied from half-orc */
2087 { 115, 120, 125, 115, 115, 130, 110, 115, 115, 125, 115,
2088 110, 110, 120, 110, 120, 125, 115, 115, 110, 120, 110,
2089 115, 125, 120, 120, 120, 120, 130, 130, 130, 120, 120,
2090 115, 110, 125, 115 },
2092 /* Sprite: Theoretical, copied from half-orc */
2093 { 115, 120, 125, 115, 115, 130, 110, 115, 115, 125, 115,
2094 110, 110, 120, 110, 120, 125, 115, 115, 110, 120, 110,
2095 115, 125, 120, 120, 120, 120, 130, 130, 130, 95, 140,
2096 115, 110, 105, 115 },
2098 /* Beastman: Theoretical, copied from half-orc */
2099 { 115, 120, 125, 115, 115, 130, 110, 115, 115, 125, 115,
2100 110, 110, 120, 110, 120, 125, 115, 115, 110, 120, 110,
2101 115, 125, 120, 120, 120, 120, 130, 130, 130, 95, 140,
2102 115, 110, 115, 115 },
2105 { 110, 105, 100, 105, 110, 120, 125, 130, 110, 100, 110,
2106 120, 120, 105, 120, 110, 105, 125, 125, 110, 115, 108,
2107 120, 115, 110, 110, 120, 110, 100, 125, 100, 95, 140,
2108 110, 110, 105, 110 },
2111 { 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95,
2112 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95,
2113 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 160,
2117 { 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, 140,
2118 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, 140,
2119 140, 140, 140, 140, 140, 140, 140, 140, 140, 160, 120,
2120 140, 140, 140, 140 },
2123 { 100, 105, 105, 110, 113, 115, 120, 125, 100, 105, 100,
2124 124, 120, 110, 125, 115, 120, 120, 120, 120, 115, 120,
2125 115, 105, 125, 125, 125, 125, 105, 120, 105, 95, 140,
2126 100, 120, 110, 100 },
2129 { 110, 110, 110, 115, 120, 130, 115, 115, 120, 110, 115,
2130 115, 115, 116, 115, 120, 120, 115, 115, 101, 110, 110,
2131 110, 110, 112, 122, 110, 110, 110, 115, 110, 120, 120,
2132 110, 101, 115, 110 },
2135 { 110, 110, 105, 105, 110, 115, 115, 115, 110, 105, 110,
2136 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115,
2137 115, 115, 125, 125, 125, 125, 105, 115, 105, 95, 140,
2138 110, 115, 100, 110 },
2141 { 105, 105, 105, 110, 113, 115, 120, 125, 100, 105, 100,
2142 124, 120, 110, 125, 115, 120, 120, 120, 120, 115, 120,
2143 115, 105, 125, 125, 125, 125, 105, 120, 105, 95, 140,
2144 100, 120, 110, 100 },
2150 * @brief 店舗価格を決定する /
2151 * Determine the price of an item (qty one) in a store.
2152 * @param o_ptr 店舗に並べるオブジェクト構造体の参照ポインタ
2153 * @param greed 店主の強欲度
2154 * @param flip TRUEならば店主にとっての買取価格、FALSEなら売出価格を計算
2158 * This function takes into account the player's charisma, and the
2159 * shop-keepers friendliness, and the shop-keeper's base greed, but
2160 * never lets a shop-keeper lose money in a transaction.
2161 * The "greed" value should exceed 100 when the player is "buying" the
2162 * item, and should be less than 100 when the player is "selling" it.
2163 * Hack -- the black market always charges twice as much as it should.
2164 * Charisma adjustment runs from 80 to 130
2165 * Racial adjustment runs from 95 to 130
2166 * Since greed/charisma/racial adjustments are centered at 100, we need
2167 * to adjust (by 200) to extract a usable multiplier. Note that the
2168 * "greed" value is always something (?).
2171 static s32b price_item(object_type *o_ptr, int greed, bool flip)
2178 /* Get the value of one of the items */
2179 price = object_value(o_ptr);
2181 /* Worthless items */
2182 if (price <= 0) return (0L);
2185 /* Compute the racial factor */
2186 factor = rgold_adj[ot_ptr->owner_race][p_ptr->prace];
2188 /* Add in the charisma factor */
2189 factor += adj_chr_gold[p_ptr->stat_ind[A_CHR]];
2192 /* Shop is buying */
2195 /* Adjust for greed */
2196 adjust = 100 + (300 - (greed + factor));
2198 /* Never get "silly" */
2199 if (adjust > 100) adjust = 100;
2201 /* Mega-Hack -- Black market sucks */
2202 if (cur_store_num == STORE_BLACK)
2205 /* Compute the final price (with rounding) */
2206 /* Hack -- prevent underflow */
2207 price = (price * adjust + 50L) / 100L;
2210 /* Shop is selling */
2213 /* Adjust for greed */
2214 adjust = 100 + ((greed + factor) - 300);
2216 /* Never get "silly" */
2217 if (adjust < 100) adjust = 100;
2219 /* Mega-Hack -- Black market sucks */
2220 if (cur_store_num == STORE_BLACK)
2223 /* Compute the final price (with rounding) */
2224 /* Hack -- prevent overflow */
2225 price = (s32b)(((u32b)price * (u32b)adjust + 50UL) / 100UL);
2228 /* Note -- Never become "free" */
2229 if (price <= 0L) return (1L);
2231 /* Return the price */
2237 * @brief 安価な消耗品の販売数を増やし、低確率で割引にする /
2238 * Certain "cheap" objects should be created in "piles"
2239 * @param o_ptr 店舗に並べるオブジェクト構造体の参照ポインタ
2243 * Some objects can be sold at a "discount" (in small piles)
2246 static void mass_produce(object_type *o_ptr)
2249 DISCOUNT_RATE discount = 0;
2251 s32b cost = object_value(o_ptr);
2254 /* Analyze the type */
2255 switch (o_ptr->tval)
2257 /* Food, Flasks, and Lites */
2262 if (cost <= 5L) size += damroll(3, 5);
2263 if (cost <= 20L) size += damroll(3, 5);
2264 if (cost <= 50L) size += damroll(2, 2);
2271 if (cost <= 60L) size += damroll(3, 5);
2272 if (cost <= 240L) size += damroll(1, 5);
2273 if (o_ptr->sval == SV_SCROLL_STAR_IDENTIFY) size += damroll(3, 5);
2274 if (o_ptr->sval == SV_SCROLL_STAR_REMOVE_CURSE) size += damroll(1, 4);
2279 case TV_SORCERY_BOOK:
2280 case TV_NATURE_BOOK:
2284 case TV_ARCANE_BOOK:
2286 case TV_DAEMON_BOOK:
2287 case TV_CRUSADE_BOOK:
2289 case TV_HISSATSU_BOOK:
2292 if (cost <= 50L) size += damroll(2, 3);
2293 if (cost <= 500L) size += damroll(1, 3);
2311 if (object_is_artifact(o_ptr)) break;
2312 if (object_is_ego(o_ptr)) break;
2313 if (cost <= 10L) size += damroll(3, 5);
2314 if (cost <= 100L) size += damroll(3, 5);
2323 if (cost <= 5L) size += damroll(5, 5);
2324 if (cost <= 50L) size += damroll(5, 5);
2325 if (cost <= 500L) size += damroll(5, 5);
2331 if (cost <= 100L) size += damroll(2, 2);
2332 if (cost <= 1000L) size += damroll(2, 2);
2345 * Because many rods (and a few wands and staffs) are useful mainly
2346 * in quantity, the Black Market will occasionally have a bunch of
2353 if ((cur_store_num == STORE_BLACK) && one_in_(3))
2355 if (cost < 1601L) size += damroll(1, 5);
2356 else if (cost < 3201L) size += damroll(1, 3);
2363 /* Pick a discount */
2368 else if (one_in_(25))
2372 else if (one_in_(150))
2376 else if (one_in_(300))
2380 else if (one_in_(500))
2385 if (o_ptr->art_name)
2390 /* Save the discount */
2391 o_ptr->discount = discount;
2393 /* Save the total pile size */
2394 o_ptr->number = size - (size * discount / 100);
2396 /* Ensure that mass-produced rods and wands get the correct pvals. */
2397 if ((o_ptr->tval == TV_ROD) || (o_ptr->tval == TV_WAND))
2399 o_ptr->pval *= (PARAMETER_VALUE)o_ptr->number;
2406 * @brief 店舗に並べた品を同一品であるかどうか判定する /
2407 * Determine if a store item can "absorb" another item
2408 * @param o_ptr 判定するオブジェクト構造体の参照ポインタ1
2409 * @param j_ptr 判定するオブジェクト構造体の参照ポインタ2
2410 * @return 同一扱いできるならTRUEを返す
2413 * See "object_similar()" for the same function for the "player"
2416 static bool store_object_similar(object_type *o_ptr, object_type *j_ptr)
2420 /* Hack -- Identical items cannot be stacked */
2421 if (o_ptr == j_ptr) return (0);
2423 /* Different objects cannot be stacked */
2424 if (o_ptr->k_idx != j_ptr->k_idx) return (0);
2426 /* Different charges (etc) cannot be stacked, unless wands or rods. */
2427 if ((o_ptr->pval != j_ptr->pval) && (o_ptr->tval != TV_WAND) && (o_ptr->tval != TV_ROD)) return (0);
2429 /* Require many identical values */
2430 if (o_ptr->to_h != j_ptr->to_h) return (0);
2431 if (o_ptr->to_d != j_ptr->to_d) return (0);
2432 if (o_ptr->to_a != j_ptr->to_a) return (0);
2434 /* Require identical "ego-item" names */
2435 if (o_ptr->name2 != j_ptr->name2) return (0);
2437 /* Artifacts don't stack! */
2438 if (object_is_artifact(o_ptr) || object_is_artifact(j_ptr)) return (0);
2440 /* Hack -- Identical art_flags! */
2441 for (i = 0; i < TR_FLAG_SIZE; i++)
2442 if (o_ptr->art_flags[i] != j_ptr->art_flags[i]) return (0);
2444 /* Hack -- Never stack "powerful" items */
2445 if (o_ptr->xtra1 || j_ptr->xtra1) return (0);
2447 /* Hack -- Never stack recharging items */
2448 if (o_ptr->timeout || j_ptr->timeout) return (0);
2450 /* Require many identical values */
2451 if (o_ptr->ac != j_ptr->ac) return (0);
2452 if (o_ptr->dd != j_ptr->dd) return (0);
2453 if (o_ptr->ds != j_ptr->ds) return (0);
2455 /* Hack -- Never stack chests */
2456 if (o_ptr->tval == TV_CHEST) return (0);
2457 if (o_ptr->tval == TV_STATUE) return (0);
2458 if (o_ptr->tval == TV_CAPTURE) return (0);
2460 /* Require matching discounts */
2461 if (o_ptr->discount != j_ptr->discount) return (0);
2463 /* They match, so they must be similar */
2469 * @brief 店舗に並べた品を重ね合わせできるかどうか判定する /
2470 * Allow a store item to absorb another item
2471 * @param o_ptr 判定するオブジェクト構造体の参照ポインタ1
2472 * @param j_ptr 判定するオブジェクト構造体の参照ポインタ2
2473 * @return 重ね合わせできるならTRUEを返す
2476 * See "object_similar()" for the same function for the "player"
2479 static void store_object_absorb(object_type *o_ptr, object_type *j_ptr)
2481 int max_num = (o_ptr->tval == TV_ROD) ?
2482 MIN(99, MAX_SHORT / k_info[o_ptr->k_idx].pval) : 99;
2483 int total = o_ptr->number + j_ptr->number;
2484 int diff = (total > max_num) ? total - max_num : 0;
2486 /* Combine quantity, lose excess items */
2487 o_ptr->number = (total > max_num) ? max_num : total;
2489 /* Hack -- if rods are stacking, add the pvals (maximum timeouts) together. -LM- */
2490 if (o_ptr->tval == TV_ROD)
2492 o_ptr->pval += j_ptr->pval * (j_ptr->number - diff) / j_ptr->number;
2495 /* Hack -- if wands are stacking, combine the charges. -LM- */
2496 if (o_ptr->tval == TV_WAND)
2498 o_ptr->pval += j_ptr->pval * (j_ptr->number - diff) / j_ptr->number;
2504 * @brief 店舗に品を置くスペースがあるかどうかの判定を返す /
2505 * Check to see if the shop will be carrying too many objects -RAK-
2506 * @param o_ptr 店舗に置きたいオブジェクト構造体の参照ポインタ
2507 * @return 置き場がないなら0、重ね合わせできるアイテムがあるなら-1、スペースがあるなら1を返す。
2510 * Note that the shop, just like a player, will not accept things
2511 * it cannot hold. Before, one could "nuke" potions this way.
2512 * Return value is now int:
2514 * -1 : Can be combined to existing slot.
2515 * 1 : Cannot be combined but there are empty spaces.
2518 static int store_check_num(object_type *o_ptr)
2523 /* The "home" acts like the player */
2524 if ((cur_store_num == STORE_HOME) || (cur_store_num == STORE_MUSEUM))
2526 bool old_stack_force_notes = stack_force_notes;
2527 bool old_stack_force_costs = stack_force_costs;
2529 if (cur_store_num != STORE_HOME)
2531 stack_force_notes = FALSE;
2532 stack_force_costs = FALSE;
2535 /* Check all the items */
2536 for (i = 0; i < st_ptr->stock_num; i++)
2538 /* Get the existing item */
2539 j_ptr = &st_ptr->stock[i];
2541 /* Can the new object be combined with the old one? */
2542 if (object_similar(j_ptr, o_ptr))
2544 if (cur_store_num != STORE_HOME)
2546 stack_force_notes = old_stack_force_notes;
2547 stack_force_costs = old_stack_force_costs;
2554 if (cur_store_num != STORE_HOME)
2556 stack_force_notes = old_stack_force_notes;
2557 stack_force_costs = old_stack_force_costs;
2561 /* Normal stores do special stuff */
2564 /* Check all the items */
2565 for (i = 0; i < st_ptr->stock_num; i++)
2567 /* Get the existing item */
2568 j_ptr = &st_ptr->stock[i];
2570 /* Can the new object be combined with the old one? */
2571 if (store_object_similar(j_ptr, o_ptr)) return -1;
2575 /* Free space is always usable */
2577 * オプション powerup_home が設定されていると
2580 if ((cur_store_num == STORE_HOME) && ( powerup_home == FALSE )) {
2581 if (st_ptr->stock_num < ((st_ptr->stock_size) / 10)) {
2586 if (st_ptr->stock_num < st_ptr->stock_size) {
2591 /* But there was no room at the inn... */
2596 * @brief オブジェクトが祝福されているかの判定を返す /
2597 * @param o_ptr 判定したいオブジェクト構造体の参照ポインタ
2598 * @return アイテムが祝福されたアイテムならばTRUEを返す
2600 static bool is_blessed(object_type *o_ptr)
2602 BIT_FLAGS flgs[TR_FLAG_SIZE];
2603 object_flags(o_ptr, flgs);
2604 if (have_flag(flgs, TR_BLESSED)) return (TRUE);
2605 else return (FALSE);
2611 * @brief オブジェクトが所定の店舗で引き取れるかどうかを返す /
2612 * Determine if the current store will purchase the given item
2613 * @param o_ptr 判定したいオブジェクト構造体の参照ポインタ
2614 * @return アイテムが買い取れるならばTRUEを返す
2616 * Note that a shop-keeper must refuse to buy "worthless" items
2618 static bool store_will_buy(object_type *o_ptr)
2620 /* Hack -- The Home is simple */
2621 if ((cur_store_num == STORE_HOME) || (cur_store_num == STORE_MUSEUM)) return (TRUE);
2623 /* Switch on the store */
2624 switch (cur_store_num)
2629 /* Analyze the type */
2630 switch (o_ptr->tval)
2633 if (o_ptr->sval != SV_POTION_WATER) return FALSE;
2645 case TV_BOTTLE: /* 'Green', recycling Angband */
2660 /* Analyze the type */
2661 switch (o_ptr->tval)
2682 /* Analyze the type */
2683 switch (o_ptr->tval)
2692 case TV_HISSATSU_BOOK:
2696 if(o_ptr->sval == SV_WIZSTAFF) return (FALSE);
2708 /* Analyze the type */
2709 switch (o_ptr->tval)
2712 case TV_CRUSADE_BOOK:
2722 monster_race *r_ptr = &r_info[o_ptr->pval];
2725 if (!(r_ptr->flags3 & RF3_EVIL))
2728 if (r_ptr->flags3 & RF3_GOOD) break;
2730 /* Accept animals */
2731 if (r_ptr->flags3 & RF3_ANIMAL) break;
2734 if (my_strchr("?!", r_ptr->d_char)) break;
2740 if (is_blessed(o_ptr)) break;
2749 case STORE_ALCHEMIST:
2751 /* Analyze the type */
2752 switch (o_ptr->tval)
2766 /* Analyze the type */
2767 switch (o_ptr->tval)
2769 case TV_SORCERY_BOOK:
2770 case TV_NATURE_BOOK:
2774 case TV_ARCANE_BOOK:
2776 case TV_DAEMON_BOOK:
2790 if(o_ptr->sval == SV_WIZSTAFF) break;
2791 else return (FALSE);
2798 /* Bookstore Shop */
2801 /* Analyze the type */
2802 switch (o_ptr->tval)
2804 case TV_SORCERY_BOOK:
2805 case TV_NATURE_BOOK:
2810 case TV_ARCANE_BOOK:
2812 case TV_DAEMON_BOOK:
2813 case TV_CRUSADE_BOOK:
2824 /* Ignore "worthless" items */
2825 if (object_value(o_ptr) <= 0) return (FALSE);
2833 * @brief 現在の町の指定された店舗のアイテムを整理する /
2834 * Combine and reorder items in store.
2835 * @param store_num 店舗ID
2836 * @return 実際に整理が行われたならばTRUEを返す。
2838 bool combine_and_reorder_home(int store_num)
2842 object_type forge, *o_ptr, *j_ptr;
2843 bool flag = FALSE, combined;
2844 store_type *old_st_ptr = st_ptr;
2845 bool old_stack_force_notes = stack_force_notes;
2846 bool old_stack_force_costs = stack_force_costs;
2848 st_ptr = &town_info[1].store[store_num];
2849 if (store_num != STORE_HOME)
2851 stack_force_notes = FALSE;
2852 stack_force_costs = FALSE;
2859 /* Combine the items in the home (backwards) */
2860 for (i = st_ptr->stock_num - 1; i > 0; i--)
2862 o_ptr = &st_ptr->stock[i];
2864 /* Skip empty items */
2865 if (!o_ptr->k_idx) continue;
2867 /* Scan the items above that item */
2868 for (j = 0; j < i; j++)
2872 j_ptr = &st_ptr->stock[j];
2874 /* Skip empty items */
2875 if (!j_ptr->k_idx) continue;
2878 * Get maximum number of the stack if these
2879 * are similar, get zero otherwise.
2881 max_num = object_similar_part(j_ptr, o_ptr);
2883 /* Can we (partialy) drop "o_ptr" onto "j_ptr"? */
2884 if (max_num && j_ptr->number < max_num)
2886 if (o_ptr->number + j_ptr->number <= max_num)
2888 /* Add together the item counts */
2889 object_absorb(j_ptr, o_ptr);
2891 /* One object is gone */
2892 st_ptr->stock_num--;
2894 /* Slide everything down */
2895 for (k = i; k < st_ptr->stock_num; k++)
2897 /* Structure copy */
2898 st_ptr->stock[k] = st_ptr->stock[k + 1];
2901 /* Erase the "final" slot */
2902 object_wipe(&st_ptr->stock[k]);
2906 ITEM_NUMBER old_num = o_ptr->number;
2907 ITEM_NUMBER remain = j_ptr->number + o_ptr->number - max_num;
2909 /* Add together the item counts */
2910 object_absorb(j_ptr, o_ptr);
2912 o_ptr->number = remain;
2914 /* Hack -- if rods are stacking, add the pvals (maximum timeouts) and current timeouts together. -LM- */
2915 if (o_ptr->tval == TV_ROD)
2917 o_ptr->pval = o_ptr->pval * remain / old_num;
2918 o_ptr->timeout = o_ptr->timeout * remain / old_num;
2921 /* Hack -- if wands are stacking, combine the charges. -LM- */
2922 else if (o_ptr->tval == TV_WAND)
2924 o_ptr->pval = o_ptr->pval * remain / old_num;
2939 /* Re-order the items in the home (forwards) */
2940 for (i = 0; i < st_ptr->stock_num; i++)
2942 o_ptr = &st_ptr->stock[i];
2944 /* Skip empty slots */
2945 if (!o_ptr->k_idx) continue;
2947 /* Get the "value" of the item */
2948 o_value = object_value(o_ptr);
2950 /* Scan every occupied slot */
2951 for (j = 0; j < st_ptr->stock_num; j++)
2953 if (object_sort_comp(o_ptr, o_value, &st_ptr->stock[j])) break;
2956 /* Never move down */
2957 if (j >= i) continue;
2963 /* Save a copy of the moving item */
2964 object_copy(j_ptr, &st_ptr->stock[i]);
2966 /* Slide the objects */
2967 for (k = i; k > j; k--)
2969 /* Slide the item */
2970 object_copy(&st_ptr->stock[k], &st_ptr->stock[k - 1]);
2973 /* Insert the moving item */
2974 object_copy(&st_ptr->stock[j], j_ptr);
2977 st_ptr = old_st_ptr;
2978 if (store_num != STORE_HOME)
2980 stack_force_notes = old_stack_force_notes;
2981 stack_force_costs = old_stack_force_costs;
2989 * @brief 我が家にオブジェクトを加える /
2990 * Add the item "o_ptr" to the inventory of the "Home"
2991 * @param o_ptr 加えたいオブジェクトの構造体参照ポインタ
2995 * In all cases, return the slot (or -1) where the object was placed
2996 * Note that this is a hacked up version of "inven_carry()".
2997 * Also note that it may not correctly "adapt" to "knowledge" bacoming
2998 * known, the player may have to pick stuff up and drop it again.
3001 static int home_carry(object_type *o_ptr)
3007 bool old_stack_force_notes = stack_force_notes;
3008 bool old_stack_force_costs = stack_force_costs;
3010 if (cur_store_num != STORE_HOME)
3012 stack_force_notes = FALSE;
3013 stack_force_costs = FALSE;
3016 /* Check each existing item (try to combine) */
3017 for (slot = 0; slot < st_ptr->stock_num; slot++)
3019 /* Get the existing item */
3020 j_ptr = &st_ptr->stock[slot];
3022 /* The home acts just like the player */
3023 if (object_similar(j_ptr, o_ptr))
3025 /* Save the new number of items */
3026 object_absorb(j_ptr, o_ptr);
3028 if (cur_store_num != STORE_HOME)
3030 stack_force_notes = old_stack_force_notes;
3031 stack_force_costs = old_stack_force_costs;
3039 if (cur_store_num != STORE_HOME)
3041 stack_force_notes = old_stack_force_notes;
3042 stack_force_costs = old_stack_force_costs;
3047 * 隠し機能: オプション powerup_home が設定されていると
3051 if ((cur_store_num != STORE_HOME) || (powerup_home == TRUE)) {
3052 if (st_ptr->stock_num >= st_ptr->stock_size) {
3057 if (st_ptr->stock_num >= ((st_ptr->stock_size) / 10)) {
3063 /* Determine the "value" of the item */
3064 value = object_value(o_ptr);
3066 /* Check existing slots to see if we must "slide" */
3067 for (slot = 0; slot < st_ptr->stock_num; slot++)
3069 if (object_sort_comp(o_ptr, value, &st_ptr->stock[slot])) break;
3072 /* Slide the others up */
3073 for (i = st_ptr->stock_num; i > slot; i--)
3075 st_ptr->stock[i] = st_ptr->stock[i-1];
3078 /* More stuff now */
3079 st_ptr->stock_num++;
3081 /* Insert the new item */
3082 st_ptr->stock[slot] = *o_ptr;
3084 chg_virtue(V_SACRIFICE, -1);
3086 (void)combine_and_reorder_home(cur_store_num);
3088 /* Return the location */
3094 * @brief 店舗にオブジェクトを加える /
3095 * Add the item "o_ptr" to a real stores inventory.
3096 * @param o_ptr 加えたいオブジェクトの構造体参照ポインタ
3100 * In all cases, return the slot (or -1) where the object was placed
3101 * Note that this is a hacked up version of "inven_carry()".
3102 * Also note that it may not correctly "adapt" to "knowledge" bacoming
3103 * known, the player may have to pick stuff up and drop it again.
3106 static int store_carry(object_type *o_ptr)
3109 s32b value, j_value;
3113 /* Evaluate the object */
3114 value = object_value(o_ptr);
3116 /* Cursed/Worthless items "disappear" when sold */
3117 if (value <= 0) return (-1);
3119 /* All store items are fully *identified* */
3120 o_ptr->ident |= IDENT_MENTAL;
3122 /* Erase the inscription */
3123 o_ptr->inscription = 0;
3125 /* Erase the "feeling" */
3126 o_ptr->feeling = FEEL_NONE;
3128 /* Check each existing item (try to combine) */
3129 for (slot = 0; slot < st_ptr->stock_num; slot++)
3131 /* Get the existing item */
3132 j_ptr = &st_ptr->stock[slot];
3134 /* Can the existing items be incremented? */
3135 if (store_object_similar(j_ptr, o_ptr))
3137 /* Hack -- extra items disappear */
3138 store_object_absorb(j_ptr, o_ptr);
3146 if (st_ptr->stock_num >= st_ptr->stock_size) return (-1);
3149 /* Check existing slots to see if we must "slide" */
3150 for (slot = 0; slot < st_ptr->stock_num; slot++)
3153 j_ptr = &st_ptr->stock[slot];
3155 /* Objects sort by decreasing type */
3156 if (o_ptr->tval > j_ptr->tval) break;
3157 if (o_ptr->tval < j_ptr->tval) continue;
3159 /* Objects sort by increasing sval */
3160 if (o_ptr->sval < j_ptr->sval) break;
3161 if (o_ptr->sval > j_ptr->sval) continue;
3164 * Hack: otherwise identical rods sort by
3165 * increasing recharge time --dsb
3167 if (o_ptr->tval == TV_ROD)
3169 if (o_ptr->pval < j_ptr->pval) break;
3170 if (o_ptr->pval > j_ptr->pval) continue;
3173 /* Evaluate that slot */
3174 j_value = object_value(j_ptr);
3176 /* Objects sort by decreasing value */
3177 if (value > j_value) break;
3178 if (value < j_value) continue;
3181 /* Slide the others up */
3182 for (i = st_ptr->stock_num; i > slot; i--)
3184 st_ptr->stock[i] = st_ptr->stock[i-1];
3187 /* More stuff now */
3188 st_ptr->stock_num++;
3190 /* Insert the new item */
3191 st_ptr->stock[slot] = *o_ptr;
3193 /* Return the location */
3199 * @brief 店舗のオブジェクト数を増やす /
3200 * Add the item "o_ptr" to a real stores inventory.
3201 * @param item 増やしたいアイテムのID
3206 * Increase, by a given amount, the number of a certain item
3207 * in a certain store. This can result in zero items.
3209 * @todo numは本来ITEM_NUMBER型にしたい。
3211 static void store_item_increase(INVENTORY_IDX item, int num)
3216 o_ptr = &st_ptr->stock[item];
3218 /* Verify the number */
3219 cnt = o_ptr->number + num;
3220 if (cnt > 255) cnt = 255;
3221 else if (cnt < 0) cnt = 0;
3222 num = cnt - o_ptr->number;
3224 /* Save the new number */
3225 o_ptr->number += (ITEM_NUMBER)num;
3230 * @brief 店舗のオブジェクト数を削除する /
3231 * Remove a slot if it is empty
3232 * @param item 削除したいアイテムのID
3235 static void store_item_optimize(INVENTORY_IDX item)
3240 o_ptr = &st_ptr->stock[item];
3243 if (!o_ptr->k_idx) return;
3245 /* Must have no items */
3246 if (o_ptr->number) return;
3249 st_ptr->stock_num--;
3251 /* Slide everyone */
3252 for (j = item; j < st_ptr->stock_num; j++)
3254 st_ptr->stock[j] = st_ptr->stock[j + 1];
3257 /* Nuke the final slot */
3258 object_wipe(&st_ptr->stock[j]);
3262 * @brief ブラックマーケット用の無価値品の排除判定 /
3263 * This function will keep 'crap' out of the black market.
3264 * @param o_ptr 判定したいオブジェクトの構造体参照ポインタ
3265 * @return ブラックマーケットにとって無価値な品ならばTRUEを返す
3268 * Crap is defined as any item that is "available" elsewhere
3269 * Based on a suggestion by "Lee Vogt" <lvogt@cig.mcel.mot.com>
3272 static bool black_market_crap(object_type *o_ptr)
3276 /* Ego items are never crap */
3277 if (object_is_ego(o_ptr)) return (FALSE);
3279 /* Good items are never crap */
3280 if (o_ptr->to_a > 0) return (FALSE);
3281 if (o_ptr->to_h > 0) return (FALSE);
3282 if (o_ptr->to_d > 0) return (FALSE);
3284 /* Check all stores */
3285 for (i = 0; i < MAX_STORES; i++)
3287 if (i == STORE_HOME) continue;
3288 if (i == STORE_MUSEUM) continue;
3290 /* Check every item in the store */
3291 for (j = 0; j < town_info[p_ptr->town_num].store[i].stock_num; j++)
3293 object_type *j_ptr = &town_info[p_ptr->town_num].store[i].stock[j];
3295 /* Duplicate item "type", assume crappy */
3296 if (o_ptr->k_idx == j_ptr->k_idx) return (TRUE);
3306 * @brief 店舗の品揃え変化のためにアイテムを削除する /
3307 * Attempt to delete (some of) a random item from the store
3311 * Hack -- we attempt to "maintain" piles of items when possible.
3314 static void store_delete(void)
3319 /* Pick a random slot */
3320 what = (INVENTORY_IDX)randint0(st_ptr->stock_num);
3322 /* Determine how many items are here */
3323 num = st_ptr->stock[what].number;
3325 /* Hack -- sometimes, only destroy half the items */
3326 if (randint0(100) < 50) num = (num + 1) / 2;
3328 /* Hack -- sometimes, only destroy a single item */
3329 if (randint0(100) < 50) num = 1;
3331 /* Hack -- decrement the maximum timeouts and total charges of rods and wands. -LM- */
3332 if ((st_ptr->stock[what].tval == TV_ROD) || (st_ptr->stock[what].tval == TV_WAND))
3334 st_ptr->stock[what].pval -= num * st_ptr->stock[what].pval / st_ptr->stock[what].number;
3337 /* Actually destroy (part of) the item */
3338 store_item_increase(what, -num);
3339 store_item_optimize(what);
3344 * @brief 店舗の品揃え変化のためにアイテムを追加する /
3345 * Creates a random item and gives it to a store
3349 * This algorithm needs to be rethought. A lot.
3350 * Currently, "normal" stores use a pre-built array.
3351 * Note -- the "level" given to "obj_get_num()" is a "favored"
3352 * level, that is, there is a much higher chance of getting
3353 * items with a level approaching that of the given level...
3354 * Should we check for "permission" to have the given item?
3357 static void store_create(void)
3367 /* Paranoia -- no room left */
3368 if (st_ptr->stock_num >= st_ptr->stock_size) return;
3371 /* Hack -- consider up to four items */
3372 for (tries = 0; tries < 4; tries++)
3375 if (cur_store_num == STORE_BLACK)
3377 /* Pick a level for object/magic */
3378 level = 25 + randint0(25);
3380 /* Random item (usually of given level) */
3381 i = get_obj_num(level);
3383 /* Handle failure */
3390 /* Hack -- Pick an item to sell */
3391 i = st_ptr->table[randint0(st_ptr->table_num)];
3393 /* Hack -- fake level for apply_magic() */
3394 level = rand_range(1, STORE_OBJ_LEVEL);
3399 /* Create a new object of the chosen kind */
3400 object_prep(q_ptr, i);
3402 /* Apply some "low-level" magic (no artifacts) */
3403 apply_magic(q_ptr, level, AM_NO_FIXED_ART);
3405 /* Require valid object */
3406 if (!store_will_buy(q_ptr)) continue;
3408 /* Hack -- Charge lite's */
3409 if (q_ptr->tval == TV_LITE)
3411 if (q_ptr->sval == SV_LITE_TORCH) q_ptr->xtra4 = FUEL_TORCH / 2;
3412 if (q_ptr->sval == SV_LITE_LANTERN) q_ptr->xtra4 = FUEL_LAMP / 2;
3416 /* The item is "known" */
3417 object_known(q_ptr);
3419 /* Mark it storebought */
3420 q_ptr->ident |= IDENT_STORE;
3422 /* Mega-Hack -- no chests in stores */
3423 if (q_ptr->tval == TV_CHEST) continue;
3425 /* Prune the black market */
3426 if (cur_store_num == STORE_BLACK)
3428 /* Hack -- No "crappy" items */
3429 if (black_market_crap(q_ptr)) continue;
3431 /* Hack -- No "cheap" items */
3432 if (object_value(q_ptr) < 10) continue;
3434 /* No "worthless" items */
3435 /* if (object_value(q_ptr) <= 0) continue; */
3438 /* Prune normal stores */
3441 /* No "worthless" items */
3442 if (object_value(q_ptr) <= 0) continue;
3446 /* Mass produce and/or Apply discount */
3447 mass_produce(q_ptr);
3449 /* Attempt to carry the (known) item */
3450 (void)store_carry(q_ptr);
3452 /* Definitely done */
3459 * @brief 店舗の割引対象外にするかどうかを判定 /
3460 * Eliminate need to bargain if player has haggled well in the past
3461 * @param minprice アイテムの最低販売価格
3462 * @return 割引を禁止するならTRUEを返す。
3464 static bool noneedtobargain(PRICE minprice)
3466 s32b good = st_ptr->good_buy;
3467 s32b bad = st_ptr->bad_buy;
3469 /* Cheap items are "boring" */
3470 if (minprice < 10L) return (TRUE);
3472 /* Perfect haggling */
3473 if (good == MAX_SHORT) return (TRUE);
3475 /* Reward good haggles, punish bad haggles, notice price */
3476 if (good > ((3 * bad) + (5 + (minprice/50)))) return (TRUE);
3478 /* Return the flag */
3484 * @brief 店主の持つプレイヤーに対する売買の良し悪し経験を記憶する /
3485 * Update the bargain info
3486 * @param price 実際の取引価格
3487 * @param minprice 店主の提示した価格
3491 static void updatebargain(PRICE price, PRICE minprice, int num)
3493 /* Hack -- auto-haggle */
3494 if (!manual_haggle) return;
3496 /* Cheap items are "boring" */
3497 if ((minprice/num) < 10L) return;
3499 /* Count the successful haggles */
3500 if (price == minprice)
3502 /* Just count the good haggles */
3503 if (st_ptr->good_buy < MAX_SHORT)
3509 /* Count the failed haggles */
3512 /* Just count the bad haggles */
3513 if (st_ptr->bad_buy < MAX_SHORT)
3522 * @brief 店の商品リストを再表示する /
3523 * Re-displays a single store entry
3527 static void display_entry(int pos)
3533 GAME_TEXT o_name[MAX_NLEN];
3538 o_ptr = &st_ptr->stock[pos];
3540 /* Get the "offset" */
3541 i = (pos % store_bottom);
3543 /* Label it, clear the line --(-- */
3544 (void)sprintf(out_val, "%c) ", ((i > 25) ? toupper(I2A(i - 26)) : I2A(i)));
3545 prt(out_val, i+6, 0);
3548 if (show_item_graph)
3550 TERM_COLOR a = object_attr(o_ptr);
3551 SYMBOL_CODE c = object_char(o_ptr);
3553 Term_queue_bigchar(cur_col, i + 6, a, c, 0, 0);
3554 if (use_bigtile) cur_col++;
3559 /* Describe an item in the home */
3560 if ((cur_store_num == STORE_HOME) || (cur_store_num == STORE_MUSEUM))
3564 /* Leave room for weights, if necessary -DRS- */
3565 if (show_weights) maxwid -= 10;
3567 object_desc(o_name, o_ptr, 0);
3568 o_name[maxwid] = '\0';
3569 c_put_str(tval_to_attr[o_ptr->tval], o_name, i+6, cur_col);
3574 /* Only show the weight of an individual item */
3575 WEIGHT wgt = o_ptr->weight;
3577 sprintf(out_val, "%3d.%1d kg", lbtokg1(wgt) , lbtokg2(wgt));
3578 put_str(out_val, i+6, 67);
3580 (void)sprintf(out_val, "%3d.%d lb", wgt / 10, wgt % 10);
3581 put_str(out_val, i+6, 68);
3587 /* Describe an item (fully) in a store */
3590 /* Must leave room for the "price" */
3593 /* Leave room for weights, if necessary -DRS- */
3594 if (show_weights) maxwid -= 7;
3596 /* Describe the object (fully) */
3597 object_desc(o_name, o_ptr, 0);
3598 o_name[maxwid] = '\0';
3599 c_put_str(tval_to_attr[o_ptr->tval], o_name, i+6, cur_col);
3604 /* Only show the weight of an individual item */
3605 int wgt = o_ptr->weight;
3607 sprintf(out_val, "%3d.%1d", lbtokg1(wgt) , lbtokg2(wgt) );
3608 put_str(out_val, i+6, 60);
3610 (void)sprintf(out_val, "%3d.%d", wgt / 10, wgt % 10);
3611 put_str(out_val, i+6, 61);
3616 /* Display a "fixed" cost */
3617 if (o_ptr->ident & (IDENT_FIXED))
3619 /* Extract the "minimum" price */
3620 x = price_item(o_ptr, ot_ptr->min_inflate, FALSE);
3622 /* Actually draw the price (not fixed) */
3624 (void)sprintf(out_val, "%9ld固", (long)x);
3626 (void)sprintf(out_val, "%9ld F", (long)x);
3629 put_str(out_val, i+6, 68);
3632 /* Display a "taxed" cost */
3633 else if (!manual_haggle)
3635 /* Extract the "minimum" price */
3636 x = price_item(o_ptr, ot_ptr->min_inflate, FALSE);
3638 /* Hack -- Apply Sales Tax if needed */
3639 if (!noneedtobargain(x)) x += x / 10;
3641 /* Actually draw the price (with tax) */
3642 (void)sprintf(out_val, "%9ld ", (long)x);
3643 put_str(out_val, i+6, 68);
3646 /* Display a "haggle" cost */
3649 /* Extrect the "maximum" price */
3650 x = price_item(o_ptr, ot_ptr->max_inflate, FALSE);
3652 /* Actually draw the price (not fixed) */
3653 (void)sprintf(out_val, "%9ld ", (long)x);
3654 put_str(out_val, i+6, 68);
3661 * @brief 店の商品リストを表示する /
3662 * Displays a store's inventory -RAK-
3665 * All prices are listed as "per individual object". -BEN-
3667 static void display_inventory(void)
3671 /* Display the next 12 items */
3672 for (k = 0; k < store_bottom; k++)
3674 /* Do not display "dead" items */
3675 if (store_top + k >= st_ptr->stock_num) break;
3677 /* Display that line */
3678 display_entry(store_top + k);
3681 /* Erase the extra lines and the "more" prompt */
3682 for (i = k; i < store_bottom + 1; i++) prt("", i + 6, 0);
3684 /* Assume "no current page" */
3686 put_str(" ", 5, 20);
3688 put_str(" ", 5, 20);
3692 /* Visual reminder of "more items" */
3693 if (st_ptr->stock_num > store_bottom)
3695 /* Show "more" reminder (after the last item) */
3696 prt(_("-続く-", "-more-"), k + 6, 3);
3698 /* Indicate the "current page" */
3699 /* Trailing spaces are to display (Page xx) and (Page x) */
3700 put_str(format(_("(%dページ) ", "(Page %d) "), store_top/store_bottom + 1), 5, 20);
3703 if (cur_store_num == STORE_HOME || cur_store_num == STORE_MUSEUM)
3705 k = st_ptr->stock_size;
3707 if (cur_store_num == STORE_HOME && !powerup_home) k /= 10;
3709 put_str(format("アイテム数: %4d/%4d", st_ptr->stock_num, k), 19 + xtra_stock, 27);
3711 put_str(format("Objects: %4d/%4d", st_ptr->stock_num, k), 19 + xtra_stock, 30);
3718 * @brief プレイヤーの所持金を表示する /
3719 * Displays players gold -RAK-
3723 static void store_prt_gold(void)
3727 prt(_("手持ちのお金: ", "Gold Remaining: "), 19 + xtra_stock, 53);
3728 sprintf(out_val, "%9ld", (long)p_ptr->au);
3729 prt(out_val, 19 + xtra_stock, 68);
3733 * @brief 店舗情報全体を表示するメインルーチン /
3734 * Displays store (after clearing screen) -RAK-
3738 static void display_store(void)
3744 /* The "Home" is special */
3745 if (cur_store_num == STORE_HOME)
3747 /* Put the owner name */
3748 put_str(_("我が家", "Your Home"), 3, 31);
3750 /* Label the item descriptions */
3751 put_str(_("アイテムの一覧", "Item Description"), 5, 4);
3753 /* If showing weights, show label */
3756 put_str(_(" 重さ", "Weight"), 5, 70);
3760 /* The "Home" is special */
3761 else if (cur_store_num == STORE_MUSEUM)
3763 /* Put the owner name */
3764 put_str(_("博物館", "Museum"), 3, 31);
3766 /* Label the item descriptions */
3767 put_str(_("アイテムの一覧", "Item Description"), 5, 4);
3769 /* If showing weights, show label */
3772 put_str(_(" 重さ", "Weight"), 5, 70);
3779 concptr store_name = (f_name + f_info[cur_store_feat].name);
3780 concptr owner_name = (ot_ptr->owner_name);
3781 concptr race_name = race_info[ot_ptr->owner_race].title;
3783 /* Put the owner name and race */
3784 sprintf(buf, "%s (%s)", owner_name, race_name);
3785 put_str(buf, 3, 10);
3787 /* Show the max price in the store (above prices) */
3788 sprintf(buf, "%s (%ld)", store_name, (long)(ot_ptr->max_cost));
3791 /* Label the item descriptions */
3792 put_str(_("商品の一覧", "Item Description"), 5, 5);
3795 /* If showing weights, show label */
3798 put_str(_(" 重さ", "Weight"), 5, 60);
3801 /* Label the asking price (in stores) */
3802 put_str(_(" 価格", "Price"), 5, 72);
3805 /* Display the current gold */
3808 /* Draw in the inventory */
3809 display_inventory();
3815 * @brief 店舗からアイテムを選択する /
3816 * Get the ID of a store item and return its value -RAK-
3817 * @param com_val 選択IDを返す参照ポインタ
3818 * @param pmt メッセージキャプション
3821 * @return 実際に選択したらTRUE、キャンセルしたらFALSE
3823 static int get_stock(COMMAND_CODE *com_val, concptr pmt, int i, int j)
3829 /* Get the item index */
3830 if (repeat_pull(com_val))
3832 /* Verify the item */
3833 if ((*com_val >= i) && (*com_val <= j))
3843 /* Assume failure */
3846 /* Build the prompt */
3848 hi = (j > 25) ? toupper(I2A(j - 26)) : I2A(j);
3850 (void)sprintf(out_val, "(%s:%c-%c, ESCで中断) %s",
3851 (((cur_store_num == STORE_HOME) || (cur_store_num == STORE_MUSEUM)) ? "アイテム" : "商品"),
3854 (void)sprintf(out_val, "(Items %c-%c, ESC to exit) %s",
3859 /* Ask until done */
3865 if (!get_com(out_val, &command, FALSE)) break;
3868 if (islower(command))
3870 else if (isupper(command))
3871 k = A2I(tolower(command)) + 26;
3875 /* Legal responses */
3876 if ((k >= i) && (k <= j))
3885 /* Clear the prompt */
3888 if (command == ESCAPE) return (FALSE);
3890 repeat_push(*com_val);
3898 * @brief 店主の不満度を増やし、プレイヤーを締め出す判定と処理を行う /
3899 * Increase the insult counter and get angry if too many -RAK-
3900 * @return プレイヤーを締め出す場合TRUEを返す
3902 static int increase_insults(void)
3904 /* Increase insults */
3905 st_ptr->insult_cur++;
3907 /* Become insulted */
3908 if (st_ptr->insult_cur > ot_ptr->insult_max)
3914 st_ptr->insult_cur = 0;
3915 st_ptr->good_buy = 0;
3916 st_ptr->bad_buy = 0;
3919 st_ptr->store_open = turn + TURNS_PER_TICK*TOWN_DAWN/8 + randint1(TURNS_PER_TICK*TOWN_DAWN/8);
3931 * @brief 店主の不満度を減らす /
3932 * Decrease insults -RAK-
3933 * @return プレイヤーを締め出す場合TRUEを返す
3935 static void decrease_insults(void)
3937 /* Decrease insults */
3938 if (st_ptr->insult_cur) st_ptr->insult_cur--;
3943 * @brief 店主の不満度が増えた場合のみのメッセージを表示する /
3944 * Have insulted while haggling -RAK-
3945 * @return プレイヤーを締め出す場合TRUEを返す
3947 static int haggle_insults(void)
3949 /* Increase insults */
3950 if (increase_insults()) return (TRUE);
3952 /* Display and flush insult */
3961 * Mega-Hack -- Enable "increments"
3963 static bool allow_inc = FALSE;
3966 * Mega-Hack -- Last "increment" during haggling
3968 static s32b last_inc = 0L;
3972 * @brief 交渉価格を確認と認証の是非を行う /
3975 * @param poffer 別途価格提示をした場合の値を返す参照ポインタ
3976 * @param price 現在の交渉価格
3977 * @param final 最終確定価格ならばTRUE
3978 * @return プレイヤーを締め出す場合TRUEを返す
3980 static int get_haggle(concptr pmt, s32b *poffer, PRICE price, int final)
3987 /* Clear old increment if necessary */
3988 if (!allow_inc) last_inc = 0L;
3993 sprintf(buf, _("%s [承諾] ", "%s [accept] "), pmt);
3996 /* Old (negative) increment, and not final */
3997 else if (last_inc < 0)
3999 sprintf(buf, _("%s [-$%ld] ", "%s [-%ld] "), pmt, (long)(ABS(last_inc)));
4002 /* Old (positive) increment, and not final */
4003 else if (last_inc > 0)
4005 sprintf(buf, _("%s [+$%ld] ", "%s [+%ld] "), pmt, (long)(ABS(last_inc)));
4011 sprintf(buf, "%s ", pmt);
4017 /* Ask until done */
4022 /* Display prompt */
4026 strcpy(out_val, "");
4029 * Ask the user for a response.
4030 * Don't allow to use numpad as cursor key.
4032 res = askfor_aux(out_val, 32, FALSE);
4038 if (!res) return FALSE;
4040 /* Skip leading spaces */
4041 for (p = out_val; *p == ' '; p++) /* loop */;
4043 /* Empty response */
4046 /* Accept current price */
4054 /* Use previous increment */
4055 if (allow_inc && last_inc)
4057 *poffer += last_inc;
4062 /* Normal response */
4065 /* Extract a number */
4068 /* Handle "incremental" number */
4069 if ((*p == '+' || *p == '-'))
4071 /* Allow increments */
4074 /* Use the given "increment" */
4081 /* Handle normal number */
4084 /* Use the given "number" */
4092 msg_print(_("値がおかしいです。", "Invalid response."));
4102 * @brief 店主がプレイヤーからの交渉価格を判断する /
4103 * Receive an offer (from the player)
4105 * @param poffer 店主からの交渉価格を返す参照ポインタ
4106 * @param last_offer 現在の交渉価格
4107 * @param factor 店主の価格基準倍率
4108 * @param price アイテムの実価値
4109 * @param final 最終価格確定ならばTRUE
4110 * @return プレイヤーの価格に対して不服ならばTRUEを返す /
4111 * Return TRUE if offer is NOT okay
4113 static bool receive_offer(concptr pmt, s32b *poffer,
4114 s32b last_offer, int factor,
4115 PRICE price, int final)
4117 /* Haggle till done */
4120 /* Get a haggle (or cancel) */
4121 if (!get_haggle(pmt, poffer, price, final)) return (TRUE);
4123 /* Acceptable offer */
4124 if (((*poffer) * factor) >= (last_offer * factor)) break;
4126 /* Insult, and check for kicked out */
4127 if (haggle_insults()) return (TRUE);
4129 /* Reject offer (correctly) */
4130 (*poffer) = last_offer;
4139 * @brief プレイヤーが購入する時の値切り処理メインルーチン /
4140 * Haggling routine -RAK-
4141 * @param o_ptr オブジェクトの構造体参照ポインタ
4142 * @param price 最終価格を返す参照ポインタ
4143 * @return プレイヤーの価格に対して店主が不服ならばTRUEを返す /
4144 * Return TRUE if purchase is NOT successful
4146 static bool purchase_haggle(object_type *o_ptr, s32b *price)
4148 s32b cur_ask, final_ask;
4149 s32b last_offer, offer;
4151 s32b min_per, max_per;
4152 int flag, loop_flag, noneed;
4153 int annoyed = 0, final = FALSE;
4154 bool cancel = FALSE;
4158 concptr pmt = _("提示価格", "Asking");
4160 /* Extract the starting offer and the final offer */
4161 cur_ask = price_item(o_ptr, ot_ptr->max_inflate, FALSE);
4162 final_ask = price_item(o_ptr, ot_ptr->min_inflate, FALSE);
4164 /* Determine if haggling is necessary */
4165 noneed = noneedtobargain(final_ask);
4167 /* No need to haggle */
4168 if (noneed || !manual_haggle)
4170 /* No need to haggle */
4173 /* Message summary */
4174 msg_print(_("結局この金額にまとまった。", "You eventually agree upon the price."));
4178 /* No haggle option */
4181 /* Message summary */
4182 msg_print(_("すんなりとこの金額にまとまった。", "You quickly agree upon the price."));
4185 /* Apply Sales Tax */
4186 final_ask += final_ask / 10;
4190 cur_ask = final_ask;
4192 /* Go to final offer */
4193 pmt = _("最終提示価格", "Final Offer");
4198 /* Haggle for the whole pile */
4199 cur_ask *= o_ptr->number;
4200 final_ask *= o_ptr->number;
4203 /* Haggle parameters */
4204 min_per = ot_ptr->haggle_per;
4205 max_per = min_per * 3;
4207 /* Mega-Hack -- artificial "last offer" value */
4208 last_offer = object_value(o_ptr) * o_ptr->number;
4209 last_offer = last_offer * (200 - (int)(ot_ptr->max_inflate)) / 100L;
4210 if (last_offer <= 0) last_offer = 1;
4215 /* No incremental haggling yet */
4218 /* Haggle until done */
4219 for (flag = FALSE; !flag; )
4223 while (!flag && loop_flag)
4225 (void)sprintf(out_val, "%s : %ld", pmt, (long)cur_ask);
4226 put_str(out_val, 1, 0);
4227 cancel = receive_offer(_("提示する金額? ", "What do you offer? "), &offer, last_offer, 1, cur_ask, final);
4232 else if (offer > cur_ask)
4237 else if (offer == cur_ask)
4250 x1 = 100 * (offer - last_offer) / (cur_ask - last_offer);
4253 if (haggle_insults())
4259 else if (x1 > max_per)
4262 if (x1 < max_per) x1 = max_per;
4264 x2 = rand_range(x1-2, x1+2);
4265 x3 = ((cur_ask - offer) * x2 / 100L) + 1;
4266 /* don't let the price go up */
4271 if (cur_ask < final_ask)
4274 cur_ask = final_ask;
4275 pmt = _("最終提示価格", "What do you offer? ");
4279 (void)(increase_insults());
4284 else if (offer >= cur_ask)
4295 (void)sprintf(out_val, _("前回の提示金額: $%ld", "Your last offer: %ld"), (long)last_offer);
4296 put_str(out_val, 1, 39);
4297 say_comment_2(cur_ask, annoyed);
4302 if (cancel) return (TRUE);
4304 updatebargain(*price, final_ask, o_ptr->number);
4312 * @brief プレイヤーが売却する時の値切り処理メインルーチン /
4313 * Haggling routine -RAK-
4314 * @param o_ptr オブジェクトの構造体参照ポインタ
4315 * @param price 最終価格を返す参照ポインタ
4316 * @return プレイヤーの価格に対して店主が不服ならばTRUEを返す /
4317 * Return TRUE if purchase is NOT successful
4319 static bool sell_haggle(object_type *o_ptr, s32b *price)
4321 s32b purse, cur_ask, final_ask;
4322 s32b last_offer = 0, offer = 0;
4324 s32b min_per, max_per;
4325 int flag, loop_flag, noneed;
4326 int annoyed = 0, final = FALSE;
4327 bool cancel = FALSE;
4329 concptr pmt = "提示金額";
4331 concptr pmt = "Offer";
4340 /* Obtain the starting offer and the final offer */
4341 cur_ask = price_item(o_ptr, ot_ptr->max_inflate, TRUE);
4342 final_ask = price_item(o_ptr, ot_ptr->min_inflate, TRUE);
4344 /* Determine if haggling is necessary */
4345 noneed = noneedtobargain(final_ask);
4347 /* Get the owner's payout limit */
4348 purse = (s32b)(ot_ptr->max_cost);
4350 /* No need to haggle */
4351 if (noneed || !manual_haggle || (final_ask >= purse))
4353 /* Apply Sales Tax (if needed) */
4354 if (!manual_haggle && !noneed)
4356 final_ask -= final_ask / 10;
4359 /* No reason to haggle */
4360 if (final_ask >= purse)
4363 msg_print("即座にこの金額にまとまった。");
4365 msg_print("You instantly agree upon the price.");
4370 /* Offer full purse */
4374 /* No need to haggle */
4378 msg_print("結局この金額にまとまった。");
4380 msg_print("You eventually agree upon the price.");
4386 /* No haggle option */
4389 /* Message summary */
4391 msg_print("すんなりとこの金額にまとまった。");
4393 msg_print("You quickly agree upon the price.");
4400 cur_ask = final_ask;
4407 pmt = "Final Offer";
4412 /* Haggle for the whole pile */
4413 cur_ask *= o_ptr->number;
4414 final_ask *= o_ptr->number;
4417 /* Display commands */
4419 /* Haggling parameters */
4420 min_per = ot_ptr->haggle_per;
4421 max_per = min_per * 3;
4423 /* Mega-Hack -- artificial "last offer" value */
4424 last_offer = object_value(o_ptr) * o_ptr->number;
4425 last_offer = last_offer * ot_ptr->max_inflate / 100L;
4430 /* No incremental haggling yet */
4434 for (flag = FALSE; !flag; )
4440 (void)sprintf(out_val, "%s : %ld", pmt, (long)cur_ask);
4441 put_str(out_val, 1, 0);
4443 cancel = receive_offer("提示する価格? ",
4445 cancel = receive_offer("What price do you ask? ",
4448 &offer, last_offer, -1, cur_ask, final);
4454 else if (offer < cur_ask)
4457 /* rejected, reset offer for incremental haggling */
4460 else if (offer == cur_ask)
4471 if (flag || !loop_flag) break;
4476 x1 = 100 * (last_offer - offer) / (last_offer - cur_ask);
4479 if (haggle_insults())
4485 else if (x1 > max_per)
4488 if (x1 < max_per) x1 = max_per;
4490 x2 = rand_range(x1-2, x1+2);
4491 x3 = ((offer - cur_ask) * x2 / 100L) + 1;
4492 /* don't let the price go down */
4496 if (cur_ask > final_ask)
4498 cur_ask = final_ask;
4503 pmt = "Final Offer";
4511 /* 追加 $0 で買い取られてしまうのを防止 By FIRST*/
4514 (void)(increase_insults());
4517 else if (offer <= cur_ask)
4528 (void)sprintf(out_val,
4530 "前回の提示価格 $%ld", (long)last_offer);
4532 "Your last bid %ld", (long)last_offer);
4535 put_str(out_val, 1, 39);
4536 say_comment_3(cur_ask, annoyed);
4541 if (cancel) return (TRUE);
4543 updatebargain(*price, final_ask, o_ptr->number);
4551 * @brief 店からの購入処理のメインルーチン /
4552 * Buy an item from a store -RAK-
4555 static void store_purchase(void)
4558 COMMAND_CODE item, item_new;
4569 GAME_TEXT o_name[MAX_NLEN];
4573 if (cur_store_num == STORE_MUSEUM)
4576 msg_print("博物館から取り出すことはできません。");
4578 msg_print("Museum.");
4584 if (st_ptr->stock_num <= 0)
4586 if (cur_store_num == STORE_HOME)
4588 msg_print("我が家には何も置いてありません。");
4590 msg_print("Your home is empty.");
4595 msg_print("現在商品の在庫を切らしています。");
4597 msg_print("I am currently out of stock.");
4604 /* Find the number of objects on this and following pages */
4605 i = (st_ptr->stock_num - store_top);
4607 /* And then restrict it to the current page */
4608 if (i > store_bottom) i = store_bottom;
4612 /* ブラックマーケットの時は別のメッセージ */
4613 switch( cur_store_num ) {
4615 sprintf(out_val, "どのアイテムを取りますか? ");
4618 sprintf(out_val, "どれ? ");
4621 sprintf(out_val, "どの品物が欲しいんだい? ");
4625 if (cur_store_num == STORE_HOME)
4627 sprintf(out_val, "Which item do you want to take? ");
4631 sprintf(out_val, "Which item are you interested in? ");
4636 /* Get the item number to be bought */
4637 if (!get_stock(&item, out_val, 0, i - 1)) return;
4639 /* Get the actual index */
4640 item = item + store_top;
4642 /* Get the actual item */
4643 o_ptr = &st_ptr->stock[item];
4645 /* Assume the player wants just one of them */
4649 /* Get a copy of the object */
4650 object_copy(j_ptr, o_ptr);
4653 * If a rod or wand, allocate total maximum timeouts or charges
4654 * between those purchased and left on the shelf.
4656 reduce_charges(j_ptr, o_ptr->number - amt);
4658 /* Modify quantity */
4659 j_ptr->number = amt;
4661 /* Hack -- require room in pack */
4662 if (!inven_carry_okay(j_ptr))
4664 msg_print(_("そんなにアイテムを持てない。", "You cannot carry that many different items."));
4668 /* Determine the "best" price (per item) */
4669 best = price_item(j_ptr, ot_ptr->min_inflate, FALSE);
4671 /* Find out how many the player wants */
4672 if (o_ptr->number > 1)
4674 /* Hack -- note cost of "fixed" items */
4675 if ((cur_store_num != STORE_HOME) &&
4676 (o_ptr->ident & IDENT_FIXED))
4678 msg_format(_("一つにつき $%ldです。", "That costs %ld gold per item."), (long)(best));
4681 /* Get a quantity */
4682 amt = get_quantity(NULL, o_ptr->number);
4684 /* Allow user abort */
4685 if (amt <= 0) return;
4689 /* Get desired object */
4690 object_copy(j_ptr, o_ptr);
4693 * If a rod or wand, allocate total maximum timeouts or charges
4694 * between those purchased and left on the shelf.
4696 reduce_charges(j_ptr, o_ptr->number - amt);
4698 /* Modify quantity */
4699 j_ptr->number = amt;
4701 /* Hack -- require room in pack */
4702 if (!inven_carry_okay(j_ptr))
4704 msg_print(_("ザックにそのアイテムを入れる隙間がない。", "You cannot carry that many items."));
4708 /* Attempt to buy it */
4709 if (cur_store_num != STORE_HOME)
4711 /* Fixed price, quick buy */
4712 if (o_ptr->ident & (IDENT_FIXED))
4717 /* Go directly to the "best" deal */
4718 price = (best * j_ptr->number);
4724 /* Describe the object (fully) */
4725 object_desc(o_name, j_ptr, 0);
4726 msg_format(_("%s(%c)を購入する。", "Buying %s (%c)."), o_name, I2A(item));
4729 /* Haggle for a final price */
4730 choice = purchase_haggle(j_ptr, &price);
4732 /* Hack -- Got kicked out */
4733 if (st_ptr->store_open >= turn) return;
4736 /* Player wants it */
4739 /* Fix the item price (if "correctly" haggled) */
4740 if (price == (best * j_ptr->number)) o_ptr->ident |= (IDENT_FIXED);
4742 /* Player can afford it */
4743 if (p_ptr->au >= price)
4748 if (cur_store_num == STORE_BLACK) /* The black market is illegal! */
4749 chg_virtue(V_JUSTICE, -1);
4750 if((o_ptr->tval == TV_BOTTLE) && (cur_store_num != STORE_HOME))
4751 chg_virtue(V_NATURE, -1);
4759 /* Spend the money */
4762 /* Update the display */
4765 /* Hack -- buying an item makes you aware of it */
4766 object_aware(j_ptr);
4768 /* Hack -- clear the "fixed" flag from the item */
4769 j_ptr->ident &= ~(IDENT_FIXED);
4771 /* Describe the transaction */
4772 object_desc(o_name, j_ptr, 0);
4774 msg_format(_("%sを $%ldで購入しました。", "You bought %s for %ld gold."), o_name, (long)price);
4776 strcpy(record_o_name, o_name);
4779 if (record_buy) do_cmd_write_nikki(NIKKI_BUY, 0, o_name);
4780 object_desc(o_name, o_ptr, OD_NAME_ONLY);
4781 if(record_rand_art && o_ptr->art_name)
4782 do_cmd_write_nikki(NIKKI_ART, 0, o_name);
4784 /* Erase the inscription */
4785 j_ptr->inscription = 0;
4787 /* Erase the "feeling" */
4788 j_ptr->feeling = FEEL_NONE;
4789 j_ptr->ident &= ~(IDENT_STORE);
4790 /* Give it to the player */
4791 item_new = inven_carry(j_ptr);
4793 /* Describe the final result */
4794 object_desc(o_name, &inventory[item_new], 0);
4795 msg_format(_("%s(%c)を手に入れた。", "You have %s (%c)."), o_name, index_to_label(item_new));
4797 /* Auto-inscription */
4798 autopick_alter_item(item_new, FALSE);
4800 /* Now, reduce the original stack's pval. */
4801 if ((o_ptr->tval == TV_ROD) || (o_ptr->tval == TV_WAND))
4803 o_ptr->pval -= j_ptr->pval;
4807 /* Note how many slots the store used to have */
4808 i = st_ptr->stock_num;
4810 /* Remove the bought items from the store */
4811 store_item_increase(item, -amt);
4812 store_item_optimize(item);
4814 /* Store is empty */
4815 if (st_ptr->stock_num == 0)
4818 if (one_in_(STORE_SHUFFLE))
4821 msg_print(_("店主は引退した。", "The shopkeeper retires."));
4823 /* Shuffle the store */
4824 store_shuffle(cur_store_num);
4827 sprintf(buf, "%s (%s)",
4828 ot_ptr->owner_name, race_info[ot_ptr->owner_race].title);
4829 put_str(buf, 3, 10);
4830 sprintf(buf, "%s (%ld)",
4831 (f_name + f_info[cur_store_feat].name), (long)(ot_ptr->max_cost));
4838 msg_print(_("店主は新たな在庫を取り出した。", "The shopkeeper brings out some new stock."));
4842 for (i = 0; i < 10; i++)
4844 /* Maintain the store */
4845 store_maint(p_ptr->town_num, cur_store_num);
4850 display_inventory();
4853 /* The item is gone */
4854 else if (st_ptr->stock_num != i)
4856 /* Pick the correct screen */
4857 if (store_top >= st_ptr->stock_num) store_top -= store_bottom;
4858 display_inventory();
4861 /* Item is still here */
4864 /* Redraw the item */
4865 display_entry(item);
4869 /* Player cannot afford it */
4872 /* Simple message (no insult) */
4873 msg_print(_("お金が足りません。", "You do not have enough gold."));
4878 /* Home is much easier */
4881 bool combined_or_reordered;
4883 /* Distribute charges of wands/rods */
4884 distribute_charges(o_ptr, j_ptr, amt);
4886 /* Give it to the player */
4887 item_new = inven_carry(j_ptr);
4889 /* Describe just the result */
4890 object_desc(o_name, &inventory[item_new], 0);
4892 msg_format(_("%s(%c)を取った。", "You have %s (%c)."), o_name, index_to_label(item_new));
4895 /* Take note if we take the last one */
4896 i = st_ptr->stock_num;
4898 /* Remove the items from the home */
4899 store_item_increase(item, -amt);
4900 store_item_optimize(item);
4902 combined_or_reordered = combine_and_reorder_home(STORE_HOME);
4904 /* Hack -- Item is still here */
4905 if (i == st_ptr->stock_num)
4907 if (combined_or_reordered) display_inventory();
4909 /* Redraw the item */
4910 else display_entry(item);
4913 /* The item is gone */
4917 if (st_ptr->stock_num == 0) store_top = 0;
4919 /* Nothing left on that screen */
4920 else if (store_top >= st_ptr->stock_num) store_top -= store_bottom;
4921 display_inventory();
4923 chg_virtue(V_SACRIFICE, 1);
4927 /* Not kicked out */
4933 * @brief 店からの売却処理のメインルーチン /
4934 * Sell an item to the store (or home)
4937 static void store_sell(void)
4944 PRICE price, value, dummy;
4953 GAME_TEXT o_name[MAX_NLEN];
4956 /* Prepare a prompt */
4957 if (cur_store_num == STORE_HOME)
4958 q = _("どのアイテムを置きますか? ", "Drop which item? ");
4960 else if (cur_store_num == STORE_MUSEUM)
4961 q = _("どのアイテムを寄贈しますか? ", "Give which item? ");
4964 q = _("どのアイテムを売りますか? ", "Sell which item? ");
4966 /* Only allow items the store will buy */
4967 item_tester_hook = store_will_buy;
4969 /* 我が家でおかしなメッセージが出るオリジナルのバグを修正 */
4970 if (cur_store_num == STORE_HOME)
4972 s = _("置けるアイテムを持っていません。", "You don't have any item to drop.");
4974 else if (cur_store_num == STORE_MUSEUM)
4976 s = _("寄贈できるアイテムを持っていません。", "You don't have any item to give.");
4980 s = _("欲しい物がないですねえ。", "You have nothing that I want.");
4983 o_ptr = choose_object(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT));
4986 /* Hack -- Cannot remove cursed items */
4987 if ((item >= INVEN_RARM) && object_is_cursed(o_ptr))
4989 msg_print(_("ふーむ、どうやらそれは呪われているようだね。", "Hmmm, it seems to be cursed."));
4993 /* Assume one item */
4996 /* Find out how many the player wants (letter means "all") */
4997 if (o_ptr->number > 1)
4999 /* Get a quantity */
5000 amt = get_quantity(NULL, o_ptr->number);
5002 /* Allow user abort */
5003 if (amt <= 0) return;
5007 /* Get a copy of the object */
5008 object_copy(q_ptr, o_ptr);
5010 /* Modify quantity */
5011 q_ptr->number = amt;
5014 * Hack -- If a rod or wand, allocate total maximum
5015 * timeouts or charges to those being sold. -LM-
5017 if ((o_ptr->tval == TV_ROD) || (o_ptr->tval == TV_WAND))
5019 q_ptr->pval = o_ptr->pval * amt / o_ptr->number;
5022 /* Get a full description */
5023 object_desc(o_name, q_ptr, 0);
5025 /* Remove any inscription, feeling for stores */
5026 if ((cur_store_num != STORE_HOME) && (cur_store_num != STORE_MUSEUM))
5028 q_ptr->inscription = 0;
5029 q_ptr->feeling = FEEL_NONE;
5032 /* Is there room in the store (or the home?) */
5033 if (!store_check_num(q_ptr))
5035 if (cur_store_num == STORE_HOME)
5036 msg_print(_("我が家にはもう置く場所がない。", "Your home is full."));
5038 else if (cur_store_num == STORE_MUSEUM)
5039 msg_print(_("博物館はもう満杯だ。", "Museum is full."));
5042 msg_print(_("すいませんが、店にはもう置く場所がありません。", "I have not the room in my store to keep it."));
5049 if ((cur_store_num != STORE_HOME) && (cur_store_num != STORE_MUSEUM))
5051 /* Describe the transaction */
5052 msg_format(_("%s(%c)を売却する。", "Selling %s (%c)."), o_name, index_to_label(item));
5057 choice = sell_haggle(q_ptr, &price);
5060 if (st_ptr->store_open >= turn) return;
5072 if (cur_store_num == STORE_BLACK) /* The black market is illegal! */
5073 chg_virtue(V_JUSTICE, -1);
5075 if((o_ptr->tval == TV_BOTTLE) && (cur_store_num != STORE_HOME))
5076 chg_virtue(V_NATURE, 1);
5079 /* Get some money */
5082 /* Update the display */
5085 /* Get the "apparent" value */
5086 dummy = object_value(q_ptr) * q_ptr->number;
5088 identify_item(o_ptr);
5091 /* Get a copy of the object */
5092 object_copy(q_ptr, o_ptr);
5094 /* Modify quantity */
5095 q_ptr->number = amt;
5097 /* Make it look like to be known */
5098 q_ptr->ident |= IDENT_STORE;
5101 * Hack -- If a rod or wand, let the shopkeeper know just
5102 * how many charges he really paid for. -LM-
5104 if ((o_ptr->tval == TV_ROD) || (o_ptr->tval == TV_WAND))
5106 q_ptr->pval = o_ptr->pval * amt / o_ptr->number;
5109 /* Get the "actual" value */
5110 value = object_value(q_ptr) * q_ptr->number;
5112 /* Get the description all over again */
5113 object_desc(o_name, q_ptr, 0);
5115 /* Describe the result (in message buffer) */
5116 msg_format(_("%sを $%ldで売却しました。", "You sold %s for %ld gold."), o_name, (long)price);
5118 if (record_sell) do_cmd_write_nikki(NIKKI_SELL, 0, o_name);
5120 if (!((o_ptr->tval == TV_FIGURINE) && (value > 0)))
5122 /* Analyze the prices (and comment verbally) unless a figurine*/
5123 purchase_analyze(price, value, dummy);
5127 * Hack -- Allocate charges between those wands or rods sold
5128 * and retained, unless all are being sold. -LM-
5130 distribute_charges(o_ptr, q_ptr, amt);
5132 /* Reset timeouts of the sold items */
5135 /* Take the item from the player, describe the result */
5136 inven_item_increase(item, -amt);
5137 inven_item_describe(item);
5139 /* If items remain, auto-inscribe before optimizing */
5140 if (o_ptr->number > 0)
5141 autopick_alter_item(item, FALSE);
5143 inven_item_optimize(item);
5146 /* The store gets that (known) item */
5147 item_pos = store_carry(q_ptr);
5149 /* Re-display if item is now in store */
5152 store_top = (item_pos / store_bottom) * store_bottom;
5153 display_inventory();
5158 /* Player is at museum */
5159 else if (cur_store_num == STORE_MUSEUM)
5161 char o2_name[MAX_NLEN];
5162 object_desc(o2_name, q_ptr, OD_NAME_ONLY);
5164 if (-1 == store_check_num(q_ptr))
5166 msg_print(_("それと同じ品物は既に博物館にあるようです。", "The same object as it is already in the Museum."));
5170 msg_print(_("博物館に寄贈したものは取り出すことができません!!", "You cannot take items which is given to the Museum back!!"));
5173 if (!get_check(format(_("本当に%sを寄贈しますか?", "Really give %s to the Museum? "), o2_name))) return;
5175 identify_item(q_ptr);
5176 q_ptr->ident |= IDENT_MENTAL;
5178 /* Distribute charges of wands/rods */
5179 distribute_charges(o_ptr, q_ptr, amt);
5180 msg_format(_("%sを置いた。(%c)", "You drop %s (%c)."), o_name, index_to_label(item));
5183 /* Take it from the players inventory */
5184 inven_item_increase(item, -amt);
5185 inven_item_describe(item);
5186 inven_item_optimize(item);
5189 /* Let the home carry it */
5190 item_pos = home_carry(q_ptr);
5192 /* Update store display */
5195 store_top = (item_pos / store_bottom) * store_bottom;
5196 display_inventory();
5199 /* Player is at home */
5202 /* Distribute charges of wands/rods */
5203 distribute_charges(o_ptr, q_ptr, amt);
5204 msg_format(_("%sを置いた。(%c)", "You drop %s (%c)."), o_name, index_to_label(item));
5208 /* Take it from the players inventory */
5209 inven_item_increase(item, -amt);
5210 inven_item_describe(item);
5211 inven_item_optimize(item);
5214 /* Let the home carry it */
5215 item_pos = home_carry(q_ptr);
5217 /* Update store display */
5220 store_top = (item_pos / store_bottom) * store_bottom;
5221 display_inventory();
5225 if ((choice == 0) && (item >= INVEN_RARM))
5234 * @brief 店のアイテムを調べるコマンドのメインルーチン /
5235 * Examine an item in a store -JDL-
5238 static void store_examine(void)
5243 GAME_TEXT o_name[MAX_NLEN];
5247 if (st_ptr->stock_num <= 0)
5249 if (cur_store_num == STORE_HOME)
5250 msg_print(_("我が家には何も置いてありません。", "Your home is empty."));
5251 else if (cur_store_num == STORE_MUSEUM)
5252 msg_print(_("博物館には何も置いてありません。", "Museum is empty."));
5254 msg_print(_("現在商品の在庫を切らしています。", "I am currently out of stock."));
5258 /* Find the number of objects on this and following pages */
5259 i = (st_ptr->stock_num - store_top);
5261 /* And then restrict it to the current page */
5262 if (i > store_bottom) i = store_bottom;
5265 sprintf(out_val, _("どれを調べますか?", "Which item do you want to examine? "));
5267 /* Get the item number to be examined */
5268 if (!get_stock(&item, out_val, 0, i - 1)) return;
5270 /* Get the actual index */
5271 item = item + store_top;
5273 /* Get the actual item */
5274 o_ptr = &st_ptr->stock[item];
5276 /* Require full knowledge */
5277 if (!(o_ptr->ident & IDENT_MENTAL))
5279 /* This can only happen in the home */
5280 msg_print(_("このアイテムについて特に知っていることはない。", "You have no special knowledge about that item."));
5284 object_desc(o_name, o_ptr, 0);
5285 msg_format(_("%sを調べている...", "Examining %s..."), o_name);
5287 if (!screen_object(o_ptr, SCROBJ_FORCE_DETAIL))
5288 msg_print(_("特に変わったところはないようだ。", "You see nothing special."));
5295 * @brief 博物館のアイテムを除去するコマンドのメインルーチン /
5296 * Remove an item from museum (Originally from TOband)
5299 static void museum_remove_object(void)
5304 GAME_TEXT o_name[MAX_NLEN];
5308 if (st_ptr->stock_num <= 0)
5310 msg_print(_("博物館には何も置いてありません。", "Museum is empty."));
5314 /* Find the number of objects on this and following pages */
5315 i = st_ptr->stock_num - store_top;
5317 /* And then restrict it to the current page */
5318 if (i > store_bottom) i = store_bottom;
5321 sprintf(out_val, _("どのアイテムの展示をやめさせますか?", "Which item do you want to order to remove? "));
5323 /* Get the item number to be removed */
5324 if (!get_stock(&item, out_val, 0, i - 1)) return;
5326 /* Get the actual index */
5327 item = item + store_top;
5329 /* Get the actual item */
5330 o_ptr = &st_ptr->stock[item];
5332 object_desc(o_name, o_ptr, 0);
5334 msg_print(_("展示をやめさせたアイテムは二度と見ることはできません!", "You cannot see items which is removed from the Museum!"));
5335 if (!get_check(format(_("本当に%sの展示をやめさせますか?", "Really order to remove %s from the Museum? "), o_name))) return;
5337 msg_format(_("%sの展示をやめさせた。", "You ordered to remove %s."), o_name);
5339 /* Remove the items from the home */
5340 store_item_increase(item, -o_ptr->number);
5341 store_item_optimize(item);
5343 (void)combine_and_reorder_home(STORE_MUSEUM);
5345 /* The item is gone */
5348 if (st_ptr->stock_num == 0) store_top = 0;
5350 /* Nothing left on that screen */
5351 else if (store_top >= st_ptr->stock_num) store_top -= store_bottom;
5352 display_inventory();
5359 * Hack -- set this to leave the store
5361 static bool leave_store = FALSE;
5365 * @brief 店舗処理コマンド選択のメインルーチン /
5366 * Process a command in a store
5370 * Note that we must allow the use of a few "special" commands
5371 * in the stores which are not allowed in the dungeon, and we
5372 * must disable some commands which are allowed in the dungeon
5373 * but not in the stores, to prevent chaos.
5376 static void store_process_command(void)
5378 /* Handle repeating the last command */
5381 if (rogue_like_commands && command_cmd == 'l')
5383 command_cmd = 'x'; /* hack! */
5386 /* Parse the command */
5387 switch (command_cmd)
5397 /* 1 ページ戻るコマンド: 我が家のページ数が多いので重宝するはず By BUG */
5400 if (st_ptr->stock_num <= store_bottom) {
5401 msg_print(_("これで全部です。", "Entire inventory is shown."));
5404 store_top -= store_bottom;
5405 if ( store_top < 0 )
5406 store_top = ((st_ptr->stock_num - 1 )/store_bottom) * store_bottom;
5407 if ( (cur_store_num == STORE_HOME) && (powerup_home == FALSE) )
5408 if ( store_top >= store_bottom ) store_top = store_bottom;
5409 display_inventory();
5417 if (st_ptr->stock_num <= store_bottom)
5419 msg_print(_("これで全部です。", "Entire inventory is shown."));
5423 store_top += store_bottom;
5425 * 隠しオプション(powerup_home)がセットされていないときは
5426 * 我が家では 2 ページまでしか表示しない
5428 if ((cur_store_num == STORE_HOME) &&
5429 (powerup_home == FALSE) &&
5430 (st_ptr->stock_num >= STORE_INVEN_MAX))
5432 if (store_top >= (STORE_INVEN_MAX - 1))
5439 if (store_top >= st_ptr->stock_num) store_top = 0;
5442 display_inventory();
5454 /* Get (purchase) */
5481 /*** Inventory Commands ***/
5483 /* Wear/wield equipment */
5490 /* Take off equipment */
5497 /* Destroy an item */
5504 /* Equipment list */
5511 /* Inventory list */
5519 /*** Various commands ***/
5521 /* Identify an object */
5528 /* Hack -- toggle windows */
5531 toggle_inven_equip();
5535 /*** Use various objects ***/
5540 if ( (p_ptr->pclass == CLASS_MINDCRAFTER) ||
5541 (p_ptr->pclass == CLASS_BERSERKER) ||
5542 (p_ptr->pclass == CLASS_NINJA) ||
5543 (p_ptr->pclass == CLASS_MIRROR_MASTER)
5544 ) do_cmd_mind_browse();
5545 else if (p_ptr->pclass == CLASS_SMITH)
5547 else if (p_ptr->pclass == CLASS_MAGIC_EATER)
5548 do_cmd_magic_eater(TRUE, FALSE);
5549 else if (p_ptr->pclass == CLASS_SNIPER)
5550 do_cmd_snipe_browse();
5551 else do_cmd_browse();
5555 /* Inscribe an object */
5562 /* Uninscribe an object */
5565 do_cmd_uninscribe();
5571 /*** Help and Such ***/
5580 /* Identify symbol */
5583 do_cmd_query_symbol();
5587 /* Character description */
5590 p_ptr->town_num = old_town_num;
5591 do_cmd_change_name();
5592 p_ptr->town_num = inner_town_num;
5598 /*** System Commands ***/
5600 /* Hack -- User interface */
5607 /* Single line from a pref file */
5610 p_ptr->town_num = old_town_num;
5612 p_ptr->town_num = inner_town_num;
5616 /* Interact with macros */
5619 p_ptr->town_num = old_town_num;
5621 p_ptr->town_num = inner_town_num;
5625 /* Interact with visuals */
5628 p_ptr->town_num = old_town_num;
5630 p_ptr->town_num = inner_town_num;
5634 /* Interact with colors */
5637 p_ptr->town_num = old_town_num;
5639 p_ptr->town_num = inner_town_num;
5643 /* Interact with options */
5647 (void)combine_and_reorder_home(STORE_HOME);
5653 /*** Misc Commands ***/
5669 /* Repeat level feeling */
5676 /* Show previous message */
5679 do_cmd_message_one();
5683 /* Show previous messages */
5696 /* Check artifacts, uniques etc. */
5703 /* Load "screen dump" */
5706 do_cmd_load_screen();
5710 /* Save "screen dump" */
5713 do_cmd_save_screen();
5717 /* Hack -- Unknown command */
5720 if ((cur_store_num == STORE_MUSEUM) && (command_cmd == 'r'))
5722 museum_remove_object();
5726 msg_print(_("そのコマンドは店の中では使えません。", "That command does not work in stores."));
5735 * @brief 店舗処理全体のメインルーチン /
5736 * Enter a store, and interact with it. *
5740 * Note that we use the standard "request_command()" function
5741 * to get a command, allowing us to use "command_arg" and all
5742 * command macros and other nifty stuff, but we use the special
5743 * "shopping" argument, to force certain commands to be converted
5744 * into other commands, normally, we convert "p" (pray) and "m"
5745 * (cast magic) into "g" (get), and "s" (search) into "d" (drop).
5748 void do_cmd_store(void)
5754 bool need_redraw_store_inv; /* To redraw missiles damage and prices in store */
5757 if(p_ptr->wild_mode) return;
5758 Term_get_size(&w, &h);
5760 /* Calculate stocks per 1 page */
5761 xtra_stock = MIN(14+26, ((h > 24) ? (h - 24) : 0));
5762 store_bottom = MIN_STOCK + xtra_stock;
5764 /* Access the player grid */
5765 g_ptr = &grid_array[p_ptr->y][p_ptr->x];
5767 /* Verify a store */
5768 if (!cave_have_flag_grid(g_ptr, FF_STORE))
5770 msg_print(_("ここには店がありません。", "You see no store here."));
5774 /* Extract the store code */
5775 which = f_info[g_ptr->feat].subtype;
5777 old_town_num = p_ptr->town_num;
5778 if ((which == STORE_HOME) || (which == STORE_MUSEUM)) p_ptr->town_num = 1;
5779 if (dun_level) p_ptr->town_num = NO_TOWN;
5780 inner_town_num = p_ptr->town_num;
5782 /* Hack -- Check the "locked doors" */
5783 if ((town_info[p_ptr->town_num].store[which].store_open >= turn) ||
5786 msg_print(_("ドアに鍵がかかっている。", "The doors are locked."));
5787 p_ptr->town_num = old_town_num;
5791 /* Calculate the number of store maintainances since the last visit */
5792 maintain_num = (turn - town_info[p_ptr->town_num].store[which].last_visit) / (TURNS_PER_TICK * STORE_TICKS);
5794 /* Maintain the store max. 10 times */
5795 if (maintain_num > 10) maintain_num = 10;
5799 /* Maintain the store */
5800 for (i = 0; i < maintain_num; i++)
5801 store_maint(p_ptr->town_num, which);
5803 /* Save the visit */
5804 town_info[p_ptr->town_num].store[which].last_visit = turn;
5810 /* Hack -- Character is in "icky" mode */
5811 character_icky = TRUE;
5818 /* Do not expand macros */
5819 get_com_no_macros = TRUE;
5821 /* Save the store number */
5822 cur_store_num = which;
5824 /* Hack -- save the store feature */
5825 cur_store_feat = g_ptr->feat;
5827 /* Save the store and owner pointers */
5828 st_ptr = &town_info[p_ptr->town_num].store[cur_store_num];
5829 ot_ptr = &owners[cur_store_num][st_ptr->owner];
5831 /* Start at the beginning */
5834 play_music(TERM_XTRA_MUSIC_BASIC, MUSIC_BASIC_BUILD);
5839 leave_store = FALSE;
5841 /* Interact with player */
5842 while (!leave_store)
5844 /* Hack -- Clear line 1 */
5848 clear_from(20 + xtra_stock);
5850 /* Basic commands */
5851 prt(_(" ESC) 建物から出る", " ESC) Exit from Building."), 21 + xtra_stock, 0);
5853 /* Browse if necessary */
5854 if (st_ptr->stock_num > store_bottom)
5856 prt(_(" -)前ページ", " -) Previous page"), 22 + xtra_stock, 0);
5857 prt(_(" スペース) 次ページ", " SPACE) Next page"), 23 + xtra_stock, 0);
5861 if (cur_store_num == STORE_HOME)
5863 prt(_("g) アイテムを取る", "g) Get an item."), 21 + xtra_stock, 27);
5864 prt(_("d) アイテムを置く", "d) Drop an item."), 22 + xtra_stock, 27);
5865 prt(_("x) 家のアイテムを調べる", "x) eXamine an item in the home."), 23 + xtra_stock, 27);
5868 /* Museum commands */
5869 else if (cur_store_num == STORE_MUSEUM)
5871 prt(_("d) アイテムを置く", "d) Drop an item."), 21 + xtra_stock, 27);
5872 prt(_("r) アイテムの展示をやめる", "r) order to Remove an item."), 22 + xtra_stock, 27);
5873 prt(_("x) 博物館のアイテムを調べる", "x) eXamine an item in the museum."), 23 + xtra_stock, 27);
5879 prt(_("p) 商品を買う", "p) Purchase an item."), 21 + xtra_stock, 30);
5880 prt(_("s) アイテムを売る", "s) Sell an item."), 22 + xtra_stock, 30);
5881 prt(_("x) 商品を調べる", "x) eXamine an item in the shop"), 23 + xtra_stock,30);
5885 prt(_("i/e) 持ち物/装備の一覧", "i/e) Inventry/Equipment list"), 21 + xtra_stock, 56);
5887 if (rogue_like_commands)
5889 prt(_("w/T) 装備する/はずす", "w/T) Wear/Take off equipment"), 22 + xtra_stock, 56);
5893 prt(_("w/t) 装備する/はずす", "w/t) Wear/Take off equipment"), 22 + xtra_stock, 56);
5897 prt(_("コマンド:", "You may: "), 20 + xtra_stock, 0);
5899 request_command(TRUE);
5901 /* Process the command */
5902 store_process_command();
5905 * Hack -- To redraw missiles damage and prices in store
5906 * If player's charisma changes, or if player changes a bow, PU_BONUS is set
5908 need_redraw_store_inv = (p_ptr->update & PU_BONUS) ? TRUE : FALSE;
5910 /* Hack -- Character is still in "icky" mode */
5911 character_icky = TRUE;
5916 if (inventory[INVEN_PACK].k_idx)
5918 INVENTORY_IDX item = INVEN_PACK;
5920 object_type *o_ptr = &inventory[item];
5922 /* Hack -- Flee from the store */
5923 if (cur_store_num != STORE_HOME)
5925 if (cur_store_num == STORE_MUSEUM)
5926 msg_print(_("ザックからアイテムがあふれそうなので、あわてて博物館から出た...", "Your pack is so full that you flee the Museum..."));
5928 msg_print(_("ザックからアイテムがあふれそうなので、あわてて店から出た...", "Your pack is so full that you flee the store..."));
5934 /* Hack -- Flee from the home */
5935 else if (!store_check_num(o_ptr))
5937 msg_print(_("ザックからアイテムがあふれそうなので、あわてて家から出た...", "Your pack is so full that you flee your home..."));
5942 /* Hack -- Drop items into the home */
5950 GAME_TEXT o_name[MAX_NLEN];
5952 /* Give a message */
5953 msg_print(_("ザックからアイテムがあふれてしまった!", "Your pack overflows!"));
5957 object_copy(q_ptr, o_ptr);
5958 object_desc(o_name, q_ptr, 0);
5960 msg_format(_("%sが落ちた。(%c)", "You drop %s (%c)."), o_name, index_to_label(item));
5962 /* Remove it from the players inventory */
5963 inven_item_increase(item, -255);
5964 inven_item_describe(item);
5965 inven_item_optimize(item);
5968 /* Let the home carry it */
5969 item_pos = home_carry(q_ptr);
5971 /* Redraw the home */
5974 store_top = (item_pos / store_bottom) * store_bottom;
5975 display_inventory();
5980 /* Hack -- Redisplay store prices if charisma changes */
5981 /* Hack -- Redraw missiles damage if player changes bow */
5982 if (need_redraw_store_inv) display_inventory();
5984 /* Hack -- get kicked out of the store */
5985 if (st_ptr->store_open >= turn) leave_store = TRUE;
5988 select_floor_music();
5990 p_ptr->town_num = old_town_num;
5992 take_turn(p_ptr, 100);;
5994 /* Hack -- Character is no longer in "icky" mode */
5995 character_icky = FALSE;
5997 /* Hack -- Cancel automatic command */
6000 /* Hack -- Cancel "see" mode */
6001 command_see = FALSE;
6003 /* Allow expanding macros */
6004 get_com_no_macros = FALSE;
6009 /* Update everything */
6010 p_ptr->update |= (PU_VIEW | PU_LITE | PU_MON_LITE);
6011 p_ptr->update |= (PU_MONSTERS);
6013 /* Redraw entire screen */
6014 p_ptr->redraw |= (PR_BASIC | PR_EXTRA | PR_EQUIPPY);
6015 p_ptr->redraw |= (PR_MAP);
6016 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
6022 * @brief 現在の町の店主を交代させる /
6023 * Shuffle one of the stores.
6024 * @param which 店舗種類のID
6027 void store_shuffle(int which)
6033 if (which == STORE_HOME) return;
6034 if (which == STORE_MUSEUM) return;
6037 /* Save the store index */
6038 cur_store_num = which;
6040 /* Activate that store */
6041 st_ptr = &town_info[p_ptr->town_num].store[cur_store_num];
6044 /* Pick a new owner */
6047 st_ptr->owner = (byte)randint0(MAX_OWNERS);
6048 if (j == st_ptr->owner) continue;
6049 for (i = 1;i < max_towns; i++)
6051 if (i == p_ptr->town_num) continue;
6052 if (st_ptr->owner == town_info[i].store[cur_store_num].owner) break;
6054 if (i == max_towns) break;
6057 /* Activate the new owner */
6058 ot_ptr = &owners[cur_store_num][st_ptr->owner];
6061 /* Reset the owner data */
6062 st_ptr->insult_cur = 0;
6063 st_ptr->store_open = 0;
6064 st_ptr->good_buy = 0;
6065 st_ptr->bad_buy = 0;
6068 /* Hack -- discount all the items */
6069 for (i = 0; i < st_ptr->stock_num; i++)
6073 o_ptr = &st_ptr->stock[i];
6075 if (!object_is_artifact(o_ptr))
6077 /* Hack -- Sell all non-artifact old items for "half price" */
6078 o_ptr->discount = 50;
6080 /* Hack -- Items are no longer "fixed price" */
6081 o_ptr->ident &= ~(IDENT_FIXED);
6083 /* Mega-Hack -- Note that the item is "on sale" */
6084 o_ptr->inscription = quark_add(_("売出中", "on sale"));
6091 * @brief 店の品揃えを変化させる /
6092 * Maintain the inventory at the stores.
6093 * @param town_num 町のID
6094 * @param store_num 店舗種類のID
6097 void store_maint(int town_num, int store_num)
6101 cur_store_num = store_num;
6104 if (store_num == STORE_HOME) return;
6105 if (store_num == STORE_MUSEUM) return;
6107 /* Activate that store */
6108 st_ptr = &town_info[town_num].store[store_num];
6110 /* Activate the owner */
6111 ot_ptr = &owners[store_num][st_ptr->owner];
6113 /* Store keeper forgives the player */
6114 st_ptr->insult_cur = 0;
6116 /* Mega-Hack -- prune the black market */
6117 if (store_num == STORE_BLACK)
6119 /* Destroy crappy black market items */
6120 for (j = st_ptr->stock_num - 1; j >= 0; j--)
6122 object_type *o_ptr = &st_ptr->stock[j];
6124 /* Destroy crappy items */
6125 if (black_market_crap(o_ptr))
6127 /* Destroy the item */
6128 store_item_increase(j, 0 - o_ptr->number);
6129 store_item_optimize(j);
6135 /* Choose the number of slots to keep */
6136 j = st_ptr->stock_num;
6138 /* Sell a few items */
6139 j = j - randint1(STORE_TURNOVER);
6141 /* Never keep more than "STORE_MAX_KEEP" slots */
6142 if (j > STORE_MAX_KEEP) j = STORE_MAX_KEEP;
6144 /* Always "keep" at least "STORE_MIN_KEEP" items */
6145 if (j < STORE_MIN_KEEP) j = STORE_MIN_KEEP;
6147 /* Hack -- prevent "underflow" */
6150 /* Destroy objects until only "j" slots are left */
6151 while (st_ptr->stock_num > j) store_delete();
6154 /* Choose the number of slots to fill */
6155 j = st_ptr->stock_num;
6157 /* Buy some more items */
6158 j = j + randint1(STORE_TURNOVER);
6160 /* Never keep more than "STORE_MAX_KEEP" slots */
6161 if (j > STORE_MAX_KEEP) j = STORE_MAX_KEEP;
6163 /* Always "keep" at least "STORE_MIN_KEEP" items */
6164 if (j < STORE_MIN_KEEP) j = STORE_MIN_KEEP;
6166 /* Hack -- prevent "overflow" */
6167 if (j >= st_ptr->stock_size) j = st_ptr->stock_size - 1;
6169 /* Acquire some new items */
6170 while (st_ptr->stock_num < j) store_create();
6175 * @brief 店舗情報を初期化する /
6176 * Initialize the stores
6177 * @param town_num 町のID
6178 * @param store_num 店舗種類のID
6181 void store_init(int town_num, int store_num)
6184 cur_store_num = store_num;
6186 /* Activate that store */
6187 st_ptr = &town_info[town_num].store[store_num];
6195 st_ptr->owner = (byte)randint0(MAX_OWNERS);
6196 for (i = 1;i < max_towns; i++)
6198 if (i == town_num) continue;
6199 if (st_ptr->owner == town_info[i].store[store_num].owner) break;
6201 if (i == max_towns) break;
6204 /* Activate the new owner */
6205 ot_ptr = &owners[store_num][st_ptr->owner];
6208 /* Initialize the store */
6209 st_ptr->store_open = 0;
6210 st_ptr->insult_cur = 0;
6211 st_ptr->good_buy = 0;
6212 st_ptr->bad_buy = 0;
6214 /* Nothing in stock */
6215 st_ptr->stock_num = 0;
6218 * MEGA-HACK - Last visit to store is
6219 * BEFORE player birth to enable store restocking
6221 st_ptr->last_visit = -10L * TURNS_PER_TICK * STORE_TICKS;
6223 /* Clear any old items */
6224 for (k = 0; k < st_ptr->stock_size; k++)
6226 object_wipe(&st_ptr->stock[k]);
6232 * @brief アイテムを町のブラックマーケットに移動させる /
6233 * @param o_ptr 移動させたいオブジェクトの構造体参照ポインタ
6236 void move_to_black_market(object_type *o_ptr)
6239 if (!p_ptr->town_num) return;
6241 st_ptr = &town_info[p_ptr->town_num].store[STORE_BLACK];
6243 o_ptr->ident |= IDENT_STORE;
6245 (void)store_carry(o_ptr);
6247 object_wipe(o_ptr); /* Don't leave a bogus object behind... */