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"
26 * @brief 闘技場のモンスターID及び報酬アイテムテーブル /
27 * Store owners (exactly four "possible" owners per store, chosen randomly)
30 * { name, purse, max greed, min greed, haggle_per, tolerance, race, unused }
32 * Lifted extra shopkeepers from CthAngband (don't you just love open source
33 * development? ;-)). Since this gave less than 32 unique names for some
34 * shops, those have their first x names copied to reach 32.
36 * For the weapon and armour shops, several owners have a limit of 5k.
38 * I want to do 50k owners, but the purse is currently s16b. Perhaps
39 * we should just store 1/10th of the purse?
42 const owner_type owners[MAX_STORES][MAX_OWNERS] =
45 /* General store - 32 unique names */
47 Raistlin は dragonlance の powerful wizard 。
48 Rincewind the Chicken は Terry Pratchett の Discworld の登場人物 上記のパロディ?、
49 { "憶病者ラストリン", 200, 175, 108, 4, 12, RACE_HUMAN},
50 { "Raistlin the Chicken", 200, 175, 108, 4, 12, RACE_HUMAN},
54 { "フレンドリーなビルボ", 200, 170, 108, 5, 15, RACE_HOBBIT},
55 { "憶病者リンスウィンド", 200, 175, 108, 4, 12, RACE_HUMAN},
56 { "背の低いサルタン", 300, 170, 107, 5, 15, RACE_GNOME},
57 { "ハンサムなライア=エル", 300, 165, 107, 6, 18, RACE_ELF},
58 { "親切なファリルマウエン", 250, 170, 108, 5, 15, RACE_HOBBIT},
59 { "臆病者ヴォワラン", 500, 175, 108, 4, 12, RACE_HUMAN},
60 { "チビのエラシュナク", 750, 170, 107, 5, 15, RACE_BEASTMAN},
61 { "ハンサムなグラッグ", 1000, 165, 107, 6, 18, RACE_HALF_TITAN},
62 { "ケチなフォロビア", 250, 170, 108, 5, 15, RACE_HUMAN},
63 { "馬鹿のエリス", 500, 175, 108, 4, 12, RACE_HUMAN},
64 { "腹ペコのフィルバート", 750, 170, 107, 5, 15, RACE_VAMPIRE},
65 { "スナーグル・サシグア", 1000, 165, 107, 6, 18, RACE_MIND_FLAYER},
66 { "長死きエロワーズ", 250, 170, 108, 5, 15, RACE_SPECTRE},
67 { "ノロマのフンディ", 500, 175, 108, 4, 12, RACE_ZOMBIE},
68 { "グランサス", 750, 170, 107, 5, 15, RACE_SKELETON},
69 { "丁寧なロラックス", 1000, 165, 107, 6, 18, RACE_VAMPIRE},
70 { "ブッチ", 250, 170, 108, 5, 15, RACE_HALF_ORC},
71 { "美しきエルベレス", 500, 175, 108, 4, 12, RACE_HIGH_ELF},
72 { "こそこそサーレス", 750, 170, 107, 5, 15, RACE_GNOME},
73 { "ナーロック", 1000, 165, 107, 6, 18, RACE_DWARF},
74 { "チビのヘイネッカ", 250, 170, 108, 5, 15, RACE_GNOME},
75 { "きちがいロワラン", 500, 175, 108, 4, 12, RACE_HALF_GIANT},
76 { "毒息のウート", 750, 170, 107, 5, 15, RACE_DRACONIAN},
77 { "でぶっちょアラァカ", 1000, 165, 107, 6, 18, RACE_DRACONIAN},
78 { "低能なプーゴー", 250, 170, 108, 5, 15, RACE_BEASTMAN},
79 { "フェロールフィリアン", 500, 175, 108, 4, 12, RACE_ELF},
80 { "年寄りマロカ", 750, 170, 107, 5, 15, RACE_GNOME},
81 { "勇敢なサシン", 1000, 165, 107, 6, 18, RACE_HALF_GIANT},
82 { "田舎者アビエマール", 250, 170, 108, 5, 15, RACE_HUMAN},
83 { "貧乏なハーク", 500, 175, 108, 4, 12, RACE_HALF_ORC},
84 { "みじめなソアリン", 750, 170, 107, 5, 15, RACE_ZOMBIE},
85 { "質素なメルラ", 1000, 165, 107, 6, 18, RACE_ELF},
87 { "Bilbo the Friendly", 200, 170, 108, 5, 15, RACE_HOBBIT},
88 { "Rincewind the Chicken", 200, 175, 108, 4, 12, RACE_HUMAN},
89 { "Sultan the Midget", 300, 170, 107, 5, 15, RACE_GNOME},
90 { "Lyar-el the Comely", 300, 165, 107, 6, 18, RACE_ELF},
91 { "Falilmawen the Friendly", 250, 170, 108, 5, 15, RACE_HOBBIT},
92 { "Voirin the Cowardly", 500, 175, 108, 4, 12, RACE_HUMAN},
93 { "Erashnak the Midget", 750, 170, 107, 5, 15, RACE_BEASTMAN},
94 { "Grug the Comely", 1000, 165, 107, 6, 18, RACE_HALF_TITAN},
95 { "Forovir the Cheap", 250, 170, 108, 5, 15, RACE_HUMAN},
96 { "Ellis the Fool", 500, 175, 108, 4, 12, RACE_HUMAN},
97 { "Filbert the Hungry", 750, 170, 107, 5, 15, RACE_VAMPIRE},
98 { "Fthnargl Psathiggua", 1000, 165, 107, 6, 18, RACE_MIND_FLAYER},
99 { "Eloise Long-Dead", 250, 170, 108, 5, 15, RACE_SPECTRE},
100 { "Fundi the Slow", 500, 175, 108, 4, 12, RACE_ZOMBIE},
101 { "Granthus", 750, 170, 107, 5, 15, RACE_SKELETON},
102 { "Lorax the Suave", 1000, 165, 107, 6, 18, RACE_VAMPIRE},
103 { "Butch", 250, 170, 108, 5, 15, RACE_HALF_ORC},
104 { "Elbereth the Beautiful", 500, 175, 108, 4, 12, RACE_HIGH_ELF},
105 { "Sarleth the Sneaky", 750, 170, 107, 5, 15, RACE_GNOME},
106 { "Narlock", 1000, 165, 107, 6, 18, RACE_DWARF},
107 { "Haneka the Small", 250, 170, 108, 5, 15, RACE_GNOME},
108 { "Loirin the Mad", 500, 175, 108, 4, 12, RACE_HALF_GIANT},
109 { "Wuto Poisonbreath", 750, 170, 107, 5, 15, RACE_DRACONIAN},
110 { "Araaka the Rotund", 1000, 165, 107, 6, 18, RACE_DRACONIAN},
111 { "Poogor the Dumb", 250, 170, 108, 5, 15, RACE_BEASTMAN},
112 { "Felorfiliand", 500, 175, 108, 4, 12, RACE_ELF},
113 { "Maroka the Aged", 750, 170, 107, 5, 15, RACE_GNOME},
114 { "Sasin the Bold", 1000, 165, 107, 6, 18, RACE_HALF_GIANT},
115 { "Abiemar the Peasant", 250, 170, 108, 5, 15, RACE_HUMAN},
116 { "Hurk the Poor", 500, 175, 108, 4, 12, RACE_HALF_ORC},
117 { "Soalin the Wretched", 750, 170, 107, 5, 15, RACE_ZOMBIE},
118 { "Merulla the Humble", 1000, 165, 107, 6, 18, RACE_ELF},
122 /* Armoury - 28 unique names */
124 { "醜悪コン=ダー", 5000, 210, 115, 5, 7, RACE_HALF_ORC},
125 { "頑固者ダーグ=ロウ", 10000, 190, 111, 4, 9, RACE_HUMAN},
126 { "賢者デカド", 25000, 200, 112, 4, 10, RACE_DUNADAN},
127 { "鍛冶屋のウィーランド", 30000, 200, 112, 4, 5, RACE_DWARF},
128 { "醜悪コン=ダー", 10000, 210, 115, 5, 7, RACE_HALF_ORC},
129 { "頑固者ダーグ=ロウ", 15000, 190, 111, 4, 9, RACE_HUMAN},
130 { "ハンサムなデカド", 25000, 200, 112, 4, 10, RACE_AMBERITE},
131 { "エロー・ドラゴンスケイル", 30000, 200, 112, 4, 5, RACE_ELF},
132 { "デリカトス", 10000, 210, 115, 5, 7, RACE_SPRITE},
133 { "巨大なグルース", 15000, 190, 111, 4, 9, RACE_HALF_GIANT},
134 { "アニムス", 25000, 200, 112, 4, 10, RACE_GOLEM},
135 { "マルヴァス", 30000, 200, 112, 4, 5, RACE_HALF_TITAN},
136 { "セラクシス", 10000, 210, 115, 5, 7, RACE_ZOMBIE},
137 { "デス・チル", 5000, 190, 111, 4, 9, RACE_SPECTRE},
138 { "微かなドリオス", 25000, 200, 112, 4, 10, RACE_SPECTRE},
139 { "冷たいバスリック", 30000, 200, 112, 4, 5, RACE_VAMPIRE},
140 { "冷酷ヴェンジェラ", 10000, 210, 115, 5, 7, RACE_HALF_TROLL},
141 { "強者ウィラナ", 15000, 190, 111, 4, 9, RACE_HUMAN},
142 { "ヨジョ二世", 25000, 200, 112, 4, 10, RACE_DWARF},
143 { "優しいラナラー", 30000, 200, 112, 4, 5, RACE_AMBERITE},
144 { "不浄のホルバグ", 5000, 210, 115, 5, 7, RACE_HALF_ORC},
145 { "テレパスのエレレン", 15000, 190, 111, 4, 9, RACE_DARK_ELF},
146 { "イスドリリアス", 25000, 200, 112, 4, 10, RACE_SPRITE},
147 { "一つ目ヴェグナー", 5000, 200, 112, 4, 5, RACE_CYCLOPS},
148 { "混沌のロディッシュ", 10000, 210, 115, 5, 7, RACE_BEASTMAN},
149 { "剣豪ヘジン", 15000, 190, 111, 4, 9, RACE_NIBELUNG},
150 { "ずる屋のエルベレリス", 10000, 200, 112, 4, 10, RACE_DARK_ELF},
151 { "インプのザサス", 30000, 200, 112, 4, 5, RACE_IMP},
152 { "醜悪コン=ダー", 5000, 210, 115, 5, 7, RACE_HALF_ORC},
153 { "頑固者ダーグ=ロウ", 10000, 190, 111, 4, 9, RACE_HUMAN},
154 { "ハンサムなデカド", 25000, 200, 112, 4, 10, RACE_AMBERITE},
155 { "鍛冶屋のウィーランド", 30000, 200, 112, 4, 5, RACE_DWARF},
157 { "Kon-Dar the Ugly", 5000, 210, 115, 5, 7, RACE_HALF_ORC},
158 { "Darg-Low the Grim", 10000, 190, 111, 4, 9, RACE_HUMAN},
159 { "Decado the Handsome", 25000, 200, 112, 4, 10, RACE_DUNADAN},
160 { "Wieland the Smith", 30000, 200, 112, 4, 5, RACE_DWARF},
161 { "Kon-Dar the Ugly", 10000, 210, 115, 5, 7, RACE_HALF_ORC},
162 { "Darg-Low the Grim", 15000, 190, 111, 4, 9, RACE_HUMAN},
163 { "Decado the Handsome", 25000, 200, 112, 4, 10, RACE_AMBERITE},
164 { "Elo Dragonscale", 30000, 200, 112, 4, 5, RACE_ELF},
165 { "Delicatus", 10000, 210, 115, 5, 7, RACE_SPRITE},
166 { "Gruce the Huge", 15000, 190, 111, 4, 9, RACE_HALF_GIANT},
167 { "Animus", 25000, 200, 112, 4, 10, RACE_GOLEM},
168 { "Malvus", 30000, 200, 112, 4, 5, RACE_HALF_TITAN},
169 { "Selaxis", 10000, 210, 115, 5, 7, RACE_ZOMBIE},
170 { "Deathchill", 5000, 190, 111, 4, 9, RACE_SPECTRE},
171 { "Drios the Faint", 25000, 200, 112, 4, 10, RACE_SPECTRE},
172 { "Bathric the Cold", 30000, 200, 112, 4, 5, RACE_VAMPIRE},
173 { "Vengella the Cruel", 10000, 210, 115, 5, 7, RACE_HALF_TROLL},
174 { "Wyrana the Mighty", 15000, 190, 111, 4, 9, RACE_HUMAN},
175 { "Yojo II", 25000, 200, 112, 4, 10, RACE_DWARF},
176 { "Ranalar the Sweet", 30000, 200, 112, 4, 5, RACE_AMBERITE},
177 { "Horbag the Unclean", 5000, 210, 115, 5, 7, RACE_HALF_ORC},
178 { "Elelen the Telepath", 15000, 190, 111, 4, 9, RACE_DARK_ELF},
179 { "Isedrelias", 25000, 200, 112, 4, 10, RACE_SPRITE},
180 { "Vegnar One-eye", 5000, 200, 112, 4, 5, RACE_CYCLOPS},
181 { "Rodish the Chaotic", 10000, 210, 115, 5, 7, RACE_BEASTMAN},
182 { "Hesin Swordmaster", 15000, 190, 111, 4, 9, RACE_NIBELUNG},
183 { "Elvererith the Cheat", 10000, 200, 112, 4, 10, RACE_DARK_ELF},
184 { "Zzathath the Imp", 30000, 200, 112, 4, 5, RACE_IMP},
185 { "Kon-Dar the Ugly", 5000, 210, 115, 5, 7, RACE_HALF_ORC},
186 { "Darg-Low the Grim", 10000, 190, 111, 4, 9, RACE_HUMAN},
187 { "Decado the Handsome", 25000, 200, 112, 4, 10, RACE_AMBERITE},
188 { "Wieland the Smith", 30000, 200, 112, 4, 5, RACE_DWARF},
193 /* Weapon Smith - 28 unique names */
195 { "残忍なるアーノルド", 5000, 210, 115, 6, 6, RACE_HALF_TROLL},
196 { "獣殺しのアーンダル", 10000, 185, 110, 5, 9, RACE_HALF_ELF},
197 { "獣マスターのエディー", 25000, 190, 115, 5, 7, RACE_HOBBIT},
198 { "竜殺しのオグライン", 30000, 195, 112, 4, 8, RACE_DWARF},
199 { "熟練者ドリュー", 10000, 210, 115, 6, 6, RACE_HUMAN},
200 { "龍の子オラックス", 15000, 185, 110, 5, 9, RACE_DRACONIAN},
201 { "病気持ちのアンスラックス", 25000, 190, 115, 5, 7, RACE_BEASTMAN},
202 { "頑丈者アルコス", 30000, 195, 112, 4, 8, RACE_DWARF},
203 { "腐れ者のサリアス", 5000, 210, 115, 6, 6, RACE_ZOMBIE},
204 { "晒し骨のトゥエシク", 15000, 185, 110, 5, 9, RACE_SKELETON},
205 { "ビリオス", 25000, 190, 115, 5, 7, RACE_BEASTMAN},
206 { "ファスガル", 30000, 195, 112, 4, 8, RACE_ZOMBIE},
207 { "パラディンのエレフリス", 10000, 210, 115, 6, 6, RACE_BARBARIAN},
208 { "キ'トリッ'ク", 15000, 185, 110, 5, 9, RACE_KLACKON},
209 { "蜘蛛の友ドゥロカス", 25000, 190, 115, 5, 7, RACE_DARK_ELF},
210 { "巨人殺しのフングス", 30000, 195, 112, 4, 8, RACE_DWARF},
211 { "デランサ", 10000, 210, 115, 6, 6, RACE_ELF},
212 { "レンジャーのソルビスタニ", 15000, 185, 110, 5, 9, RACE_HALF_ELF},
213 { "ノロマのゾリル", 25000, 190, 115, 5, 7, RACE_GOLEM},
214 { "イーオン・フラックス", 20000, 195, 112, 4, 8, RACE_HALF_ELF},
215 { "強者ナドック", 10000, 210, 115, 6, 6, RACE_HOBBIT},
216 { "弱虫エラモグ", 15000, 185, 110, 5, 9, RACE_KOBOLD},
217 { "公正なエオウィリス", 25000, 190, 115, 5, 7, RACE_VAMPIRE},
218 { "バルログ殺しのヒュイモグ", 30000, 195, 112, 4, 8, RACE_HALF_ORC},
219 { "冷酷ピーダス", 5000, 210, 115, 6, 6, RACE_HUMAN},
220 { "ヴァモグ スレイヤー", 15000, 185, 110, 5, 9, RACE_HALF_OGRE},
221 { "性悪フーシュナク", 25000, 190, 115, 5, 7, RACE_BEASTMAN},
222 { "舞闘バレン", 30000, 195, 112, 4, 8, RACE_BARBARIAN},
223 { "残忍なるアーノルド", 5000, 210, 115, 6, 6, RACE_BARBARIAN},
224 { "獣殺しのアーンダル", 10000, 185, 110, 5, 9, RACE_HALF_ELF},
225 { "ビーストマスター・エディー", 25000, 190, 115, 5, 7, RACE_HALF_ORC},
226 { "竜殺しのオグライン", 30000, 195, 112, 4, 8, RACE_DWARF},
228 { "Arnold the Beastly", 5000, 210, 115, 6, 6, RACE_BARBARIAN},
229 { "Arndal Beast-Slayer", 10000, 185, 110, 5, 9, RACE_HALF_ELF},
230 { "Eddie Beast-Master", 25000, 190, 115, 5, 7, RACE_HALF_ORC},
231 { "Oglign Dragon-Slayer", 30000, 195, 112, 4, 8, RACE_DWARF},
232 { "Drew the Skilled", 10000, 210, 115, 6, 6, RACE_HUMAN},
233 { "Orrax Dragonson", 15000, 185, 110, 5, 9, RACE_DRACONIAN},
234 { "Anthrax Disease-Carrier", 25000, 190, 115, 5, 7, RACE_BEASTMAN},
235 { "Arkhoth the Stout", 30000, 195, 112, 4, 8, RACE_DWARF},
236 { "Sarlyas the Rotten", 5000, 210, 115, 6, 6, RACE_ZOMBIE},
237 { "Tuethic Bare-Bones", 15000, 185, 110, 5, 9, RACE_SKELETON},
238 { "Bilious", 25000, 190, 115, 5, 7, RACE_BEASTMAN},
239 { "Fasgul", 30000, 195, 112, 4, 8, RACE_ZOMBIE},
240 { "Ellefris the Paladin", 10000, 210, 115, 6, 6, RACE_BARBARIAN},
241 { "K'trrik'k", 15000, 185, 110, 5, 9, RACE_KLACKON},
242 { "Drocus Spiderfriend", 25000, 190, 115, 5, 7, RACE_DARK_ELF},
243 { "Fungus Giant-Slayer", 30000, 195, 112, 4, 8, RACE_DWARF},
244 { "Delantha", 10000, 210, 115, 6, 6, RACE_ELF},
245 { "Solvistani the Ranger", 15000, 185, 110, 5, 9, RACE_HALF_ELF},
246 { "Xoril the Slow", 25000, 190, 115, 5, 7, RACE_GOLEM},
247 { "Aeon Flux", 20000, 195, 112, 4, 8, RACE_HALF_ELF},
248 { "Nadoc the Strong", 10000, 210, 115, 6, 6, RACE_HOBBIT},
249 { "Eramog the Weak", 15000, 185, 110, 5, 9, RACE_KOBOLD},
250 { "Eowilith the Fair", 25000, 190, 115, 5, 7, RACE_VAMPIRE},
251 { "Huimog Balrog-Slayer", 30000, 195, 112, 4, 8, RACE_HALF_ORC},
252 { "Peadus the Cruel", 5000, 210, 115, 6, 6, RACE_HUMAN},
253 { "Vamog Slayer", 15000, 185, 110, 5, 9, RACE_HALF_OGRE},
254 { "Hooshnak the Vicious", 25000, 190, 115, 5, 7, RACE_BEASTMAN},
255 { "Balenn War-Dancer", 30000, 195, 112, 4, 8, RACE_BARBARIAN},
256 { "Arnold the Beastly", 5000, 210, 115, 6, 6, RACE_BARBARIAN},
257 { "Arndal Beast-Slayer", 10000, 185, 110, 5, 9, RACE_HALF_ELF},
258 { "Eddie Beast-Master", 25000, 190, 115, 5, 7, RACE_HALF_ORC},
259 { "Oglign Dragon-Slayer", 30000, 195, 112, 4, 8, RACE_DWARF},
263 /* Temple - 22 unique names */
265 { "質素なルードヴィヒ", 5000, 175, 109, 6, 15, RACE_HUMAN},
266 { "パラディンのガンナー", 10000, 185, 110, 5, 23, RACE_HUMAN},
267 { "選ばれしトリン", 25000, 180, 107, 6, 20, RACE_ELF},
268 { "賢明なるサラストロ", 30000, 185, 109, 5, 15, RACE_DWARF},
269 { "パーシヴァル卿", 25000, 180, 107, 6, 20, RACE_HIGH_ELF},
270 { "神聖なるアセナス", 30000, 185, 109, 5, 15, RACE_HUMAN},
271 { "マッキノン", 10000, 175, 109, 6, 15, RACE_HUMAN},
272 { "謹み婦人", 15000, 185, 110, 5, 23, RACE_HIGH_ELF},
273 { "ドルイドのハシュニック", 25000, 180, 107, 6, 20, RACE_HOBBIT},
274 { "フィナク", 30000, 185, 109, 5, 15, RACE_YEEK},
275 { "クリキック", 10000, 175, 109, 6, 15, RACE_KLACKON},
276 { "荒くれ者モリヴァル", 15000, 185, 110, 5, 23, RACE_ELF},
277 { "暗きホシャック", 25000, 180, 107, 6, 20, RACE_IMP},
278 { "賢者アタール", 30000, 185, 109, 5, 15, RACE_HUMAN},
279 { "清きイベニッド", 10000, 175, 109, 6, 15, RACE_HUMAN},
280 { "エリディシュ", 15000, 185, 110, 5, 23, RACE_HALF_TROLL},
281 { "呪術師ヴルドゥシュ", 25000, 180, 107, 6, 20, RACE_HALF_OGRE},
282 { "狂戦士ハオブ", 30000, 185, 109, 5, 15, RACE_BARBARIAN},
283 { "若きプルーグディシュ", 10000, 175, 109, 6, 15, RACE_HALF_OGRE},
284 { "きちがいラムワイズ", 15000, 185, 110, 5, 23, RACE_YEEK},
285 { "有徳者ムワート", 25000, 180, 107, 6, 20, RACE_KOBOLD},
286 { "弱虫ダードバード", 30000, 185, 109, 5, 15, RACE_SPECTRE},
287 { "質素なルードヴィヒ", 5000, 175, 109, 6, 15, RACE_HUMAN},
288 { "パラディンのガンナー", 10000, 185, 110, 5, 23, RACE_HUMAN},
289 { "選ばれしトリン", 25000, 180, 107, 6, 20, RACE_ELF},
290 { "賢明なるサラストロ", 30000, 185, 109, 5, 15, RACE_DWARF},
291 { "パーシヴァル卿", 25000, 180, 107, 6, 20, RACE_HIGH_ELF},
292 { "神聖なるアセナス", 30000, 185, 109, 5, 15, RACE_HUMAN},
293 { "マッキノン", 10000, 175, 109, 6, 15, RACE_HUMAN},
294 { "謹み婦人", 15000, 185, 110, 5, 23, RACE_HIGH_ELF},
295 { "ドルイドのハシュニック", 25000, 180, 107, 6, 20, RACE_HOBBIT},
296 { "フィナク", 30000, 185, 109, 5, 15, RACE_YEEK},
298 { "Ludwig the Humble", 5000, 175, 109, 6, 15, RACE_DWARF},
299 { "Gunnar the Paladin", 10000, 185, 110, 5, 23, RACE_HALF_TROLL},
300 { "Torin the Chosen", 25000, 180, 107, 6, 20, RACE_HIGH_ELF},
301 { "Sarastro the Wise", 30000, 185, 109, 5, 15, RACE_HUMAN},
302 { "Sir Parsival the Pure", 25000, 180, 107, 6, 20, RACE_HIGH_ELF},
303 { "Asenath the Holy", 30000, 185, 109, 5, 15, RACE_HUMAN},
304 { "McKinnon", 10000, 175, 109, 6, 15, RACE_HUMAN},
305 { "Mistress Chastity", 15000, 185, 110, 5, 23, RACE_HIGH_ELF},
306 { "Hashnik the Druid", 25000, 180, 107, 6, 20, RACE_HOBBIT},
307 { "Finak", 30000, 185, 109, 5, 15, RACE_YEEK},
308 { "Krikkik", 10000, 175, 109, 6, 15, RACE_KLACKON},
309 { "Morival the Wild", 15000, 185, 110, 5, 23, RACE_ELF},
310 { "Hoshak the Dark", 25000, 180, 107, 6, 20, RACE_IMP},
311 { "Atal the Wise", 30000, 185, 109, 5, 15, RACE_HUMAN},
312 { "Ibenidd the Chaste", 10000, 175, 109, 6, 15, RACE_HUMAN},
313 { "Eridish", 15000, 185, 110, 5, 23, RACE_HALF_TROLL},
314 { "Vrudush the Shaman", 25000, 180, 107, 6, 20, RACE_HALF_OGRE},
315 { "Haob the Berserker", 30000, 185, 109, 5, 15, RACE_BARBARIAN},
316 { "Proogdish the Youthfull", 10000, 175, 109, 6, 15, RACE_HALF_OGRE},
317 { "Lumwise the Mad", 15000, 185, 110, 5, 23, RACE_YEEK},
318 { "Muirt the Virtuous", 25000, 180, 107, 6, 20, RACE_KOBOLD},
319 { "Dardobard the Weak", 30000, 185, 109, 5, 15, RACE_SPECTRE},
320 { "Ludwig the Humble", 5000, 175, 109, 6, 15, RACE_DWARF},
321 { "Gunnar the Paladin", 10000, 185, 110, 5, 23, RACE_HALF_TROLL},
322 { "Torin the Chosen", 25000, 180, 107, 6, 20, RACE_HIGH_ELF},
323 { "Sarastro the Wise", 30000, 185, 109, 5, 15, RACE_HUMAN},
324 { "Sir Parsival the Pure", 25000, 180, 107, 6, 20, RACE_HIGH_ELF},
325 { "Asenath the Holy", 30000, 185, 109, 5, 15, RACE_HUMAN},
326 { "McKinnon", 10000, 175, 109, 6, 15, RACE_HUMAN},
327 { "Mistress Chastity", 15000, 185, 110, 5, 23, RACE_HIGH_ELF},
328 { "Hashnik the Druid", 25000, 180, 107, 6, 20, RACE_HOBBIT},
329 { "Finak", 30000, 185, 109, 5, 15, RACE_YEEK},
333 /* Alchemist - 26 unique names */
335 { "化学者マウザー", 10000, 190, 111, 5, 8, RACE_HALF_ELF},
336 { "カオスのウィズル", 10000, 190, 110, 6, 8, RACE_HOBBIT},
337 { "強欲ミダス", 15000, 200, 116, 6, 9, RACE_GNOME},
338 { "貧弱ジャ=ファー", 15000, 220, 111, 4, 9, RACE_ELF},/*FIRST*/
339 { "カカルラカカル", 15000, 200, 116, 6, 9, RACE_KLACKON},
340 { "錬金術師ジャル=エス", 15000, 220, 111, 4, 9, RACE_ELF},
341 { "用心深いファネラス", 10000, 190, 111, 5, 8, RACE_DWARF},
342 { "キチガイのルンシー", 10000, 190, 110, 6, 8, RACE_HUMAN},
343 { "グランブルワース", 15000, 200, 116, 6, 9, RACE_GNOME},
344 { "フリッター", 15000, 220, 111, 4, 9, RACE_SPRITE},
345 { "ザリルス", 10000, 190, 111, 5, 8, RACE_HUMAN},
346 { "古きエグバート", 10000, 190, 110, 6, 8, RACE_DWARF},
347 { "誇り高きヴァリンドラ", 15000, 200, 116, 6, 9, RACE_HIGH_ELF},
348 { "錬金術師タエン", 15000, 220, 111, 4, 9, RACE_HUMAN},
349 { "巧言カイド", 10000, 190, 111, 5, 8, RACE_VAMPIRE},
350 { "暗きフリア", 10000, 190, 110, 6, 8, RACE_NIBELUNG},
351 { "質素なドムリ", 15000, 200, 116, 6, 9, RACE_DWARF},
352 { "魔の子ヤァジュッカ", 15000, 220, 111, 4, 9, RACE_IMP},
353 { "薬草師ジェララルドール", 10000, 190, 111, 5, 8, RACE_HIGH_ELF},
354 { "賢者オレラルダン", 10000, 190, 110, 6, 8, RACE_BARBARIAN},
355 { "デモニシストのフゾグロ", 15000, 200, 116, 6, 9, RACE_IMP},
356 { "錬金術師ドゥリアシュ", 15000, 220, 111, 4, 9, RACE_HALF_ORC},
357 { "強者ネリア", 10000, 190, 111, 5, 8, RACE_CYCLOPS},
358 { "辛口リグナス", 10000, 190, 110, 6, 8, RACE_HALF_ORC},
359 { "ティルバ", 15000, 200, 116, 6, 9, RACE_HOBBIT},
360 { "金持ちミリルドリック", 15000, 220, 111, 4, 9, RACE_HUMAN},
362 { "科学者マウザー", 10000, 190, 111, 5, 8, RACE_HALF_ELF},
363 { "カオスのウィズル", 10000, 190, 110, 6, 8, RACE_HOBBIT},
364 { "強欲ミダス", 15000, 200, 116, 6, 9, RACE_GNOME},
365 { "錬金術師ジャ=ファー", 15000, 220, 111, 4, 9, RACE_ELF},
366 { "カカルラカカル", 15000, 200, 116, 6, 9, RACE_KLACKON},
367 { "錬金術師ジャル=エス", 15000, 220, 111, 4, 9, RACE_ELF},
369 { "Mauser the Chemist", 10000, 190, 111, 5, 8, RACE_HALF_ELF},
370 { "Wizzle the Chaotic", 10000, 190, 110, 6, 8, RACE_HOBBIT},
371 { "Midas the Greedy", 15000, 200, 116, 6, 9, RACE_GNOME},
372 { "Ja-Far the Alchemist", 15000, 220, 111, 4, 9, RACE_ELF},
373 { "Kakalrakakal", 15000, 200, 116, 6, 9, RACE_KLACKON},
374 { "Jal-Eth the Alchemist", 15000, 220, 111, 4, 9, RACE_ELF},
375 { "Fanelath the Cautious", 10000, 190, 111, 5, 8, RACE_DWARF},
376 { "Runcie the Insane", 10000, 190, 110, 6, 8, RACE_HUMAN},
377 { "Grumbleworth", 15000, 200, 116, 6, 9, RACE_GNOME},
378 { "Flitter", 15000, 220, 111, 4, 9, RACE_SPRITE},
379 { "Xarillus", 10000, 190, 111, 5, 8, RACE_HUMAN},
380 { "Egbert the Old", 10000, 190, 110, 6, 8, RACE_DWARF},
381 { "Valindra the Proud", 15000, 200, 116, 6, 9, RACE_HIGH_ELF},
382 { "Taen the Alchemist", 15000, 220, 111, 4, 9, RACE_HUMAN},
383 { "Cayd the Sweet", 10000, 190, 111, 5, 8, RACE_VAMPIRE},
384 { "Fulir the Dark", 10000, 190, 110, 6, 8, RACE_NIBELUNG},
385 { "Domli the Humble", 15000, 200, 116, 6, 9, RACE_DWARF},
386 { "Yaarjukka Demonspawn", 15000, 220, 111, 4, 9, RACE_IMP},
387 { "Gelaraldor the Herbmaster", 10000, 190, 111, 5, 8, RACE_HIGH_ELF},
388 { "Olelaldan the Wise", 10000, 190, 110, 6, 8, RACE_BARBARIAN},
389 { "Fthoglo the Demonicist", 15000, 200, 116, 6, 9, RACE_IMP},
390 { "Dridash the Alchemist", 15000, 220, 111, 4, 9, RACE_HALF_ORC},
391 { "Nelir the Strong", 10000, 190, 111, 5, 8, RACE_CYCLOPS},
392 { "Lignus the Pungent", 10000, 190, 110, 6, 8, RACE_HALF_ORC},
393 { "Tilba", 15000, 200, 116, 6, 9, RACE_HOBBIT},
394 { "Myrildric the Wealthy", 15000, 220, 111, 4, 9, RACE_HUMAN},
396 { "Mauser the Chemist", 10000, 190, 111, 5, 8, RACE_HALF_ELF},
397 { "Wizzle the Chaotic", 10000, 190, 110, 6, 8, RACE_HOBBIT},
398 { "Midas the Greedy", 15000, 200, 116, 6, 9, RACE_GNOME},
399 { "Ja-Far the Alchemist", 15000, 220, 111, 4, 9, RACE_ELF},
400 { "Kakalrakakal", 15000, 200, 116, 6, 9, RACE_KLACKON},
401 { "Jal-Eth the Alchemist", 15000, 220, 111, 4, 9, RACE_ELF},
406 /* Magic Shop - 23 unique names */
408 { "ソーサラーのロ=パン", 20000, 200, 110, 7, 8, RACE_HALF_ELF},
409 { "偉大なるブガービイ", 20000, 215, 113, 6, 10, RACE_GNOME},
410 { "イェンダーの魔法使い", 30000, 200, 110, 7, 10, RACE_HUMAN},
411 { "死霊使いリャク",30000, 175, 110, 5, 11, RACE_HIGH_ELF},
412 { "魔術師スキドゥニー", 15000, 200, 110, 7, 8, RACE_HALF_ELF},
413 { "幻術師キリア", 30000, 200, 110, 7, 10, RACE_HUMAN},
414 { "死霊術師ニッキ", 30000, 175, 110, 5, 11, RACE_DARK_ELF},
415 { "ソロストラン", 15000, 200, 110, 7, 8, RACE_SPRITE},
416 { "烏賊口アチシェ", 20000, 215, 113, 6, 10, RACE_MIND_FLAYER},
417 { "貴族のカザ", 30000, 200, 110, 7, 10, RACE_HIGH_ELF},
418 { "暗きファジル", 30000, 175, 110, 5, 11, RACE_DARK_ELF},
419 { "偉大なるケルドーン", 15000, 200, 110, 7, 8, RACE_DWARF},
420 { "フィランスロプス", 20000, 215, 113, 6, 10, RACE_HOBBIT},
421 { "魔女のアグナー", 30000, 200, 110, 7, 10, RACE_HUMAN},
422 { "死霊術師ビュリアンス", 30000, 175, 110, 5, 11, RACE_BEASTMAN},
423 { "ハイメイジのヴイラク", 15000, 200, 110, 7, 8, RACE_BEASTMAN},
424 { "知恵者マディッシュ", 20000, 215, 113, 6, 10, RACE_BEASTMAN},
425 { "ファレブリンボール", 30000, 200, 110, 7, 10, RACE_HIGH_ELF},
426 { "陰険フェリル=ガンド", 30000, 175, 110, 5, 11, RACE_DARK_ELF},
427 { "呪術師サレゴード", 15000, 200, 110, 7, 8, RACE_BARBARIAN},
428 { "神秘家クトゥアロス", 20000, 215, 113, 6, 10, RACE_MIND_FLAYER},
429 { "幻術師イベリ", 30000, 200, 110, 7, 10, RACE_SKELETON},
430 { "死霊術師ヘトー", 30000, 175, 110, 5, 11, RACE_YEEK},
431 { "魔術師ロ=パン", 20000, 200, 110, 7, 8, RACE_HALF_ELF},
432 { "偉大なるブガービイ", 20000, 215, 113, 6, 10, RACE_GNOME},
433 { "イェンダーの魔法使い", 30000, 200, 110, 7, 10, RACE_HUMAN},
434 { "死霊術師リャク", 30000, 175, 110, 5, 11, RACE_DARK_ELF},
435 { "魔術師スキドゥニー", 15000, 200, 110, 7, 8, RACE_HALF_ELF},
436 { "幻術師キリア", 30000, 200, 110, 7, 10, RACE_HUMAN},
437 { "死霊術師ニッキ", 30000, 175, 110, 5, 11, RACE_DARK_ELF},
438 { "ソロストラン", 15000, 200, 110, 7, 8, RACE_SPRITE},
439 { "烏賊口アチシェ", 20000, 215, 113, 6, 10, RACE_MIND_FLAYER},
441 { "Lo Pan the Sorcerer", 20000, 200, 110, 7, 8, RACE_HALF_ELF},
442 { "Buggerby the Great", 20000, 215, 113, 6, 10, RACE_GNOME},
443 { "The Wizard of Yendor", 30000, 200, 110, 7, 10, RACE_HUMAN},
444 { "Rjak the Necromancer", 30000, 175, 110, 5, 11, RACE_DARK_ELF},
445 { "Skidney the Sorcerer", 15000, 200, 110, 7, 8, RACE_HALF_ELF},
446 { "Kyria the Illusionist", 30000, 200, 110, 7, 10, RACE_HUMAN},
447 { "Nikki the Necromancer", 30000, 175, 110, 5, 11, RACE_DARK_ELF},
448 { "Solostoran", 15000, 200, 110, 7, 8, RACE_SPRITE},
449 { "Achshe the Tentacled", 20000, 215, 113, 6, 10, RACE_MIND_FLAYER},
450 { "Kaza the Noble", 30000, 200, 110, 7, 10, RACE_HIGH_ELF},
451 { "Fazzil the Dark", 30000, 175, 110, 5, 11, RACE_DARK_ELF},
452 { "Keldorn the Grand", 15000, 200, 110, 7, 8, RACE_DWARF},
453 { "Philanthropus", 20000, 215, 113, 6, 10, RACE_HOBBIT},
454 { "Agnar the Enchantress", 30000, 200, 110, 7, 10, RACE_HUMAN},
455 { "Buliance the Necromancer", 30000, 175, 110, 5, 11, RACE_BEASTMAN},
456 { "Vuirak the High-Mage", 15000, 200, 110, 7, 8, RACE_BEASTMAN},
457 { "Madish the Smart", 20000, 215, 113, 6, 10, RACE_BEASTMAN},
458 { "Falebrimbor", 30000, 200, 110, 7, 10, RACE_HIGH_ELF},
459 { "Felil-Gand the Subtle", 30000, 175, 110, 5, 11, RACE_DARK_ELF},
460 { "Thalegord the Shaman", 15000, 200, 110, 7, 8, RACE_BARBARIAN},
461 { "Cthoaloth the Mystic", 20000, 215, 113, 6, 10, RACE_MIND_FLAYER},
462 { "Ibeli the Illusionist", 30000, 200, 110, 7, 10, RACE_SKELETON},
463 { "Heto the Necromancer", 30000, 175, 110, 5, 11, RACE_YEEK},
464 { "Lo Pan the Sorcerer", 20000, 200, 110, 7, 8, RACE_HALF_ELF},
465 { "Buggerby the Great", 20000, 215, 113, 6, 10, RACE_GNOME},
466 { "The Wizard of Yendor", 30000, 200, 110, 7, 10, RACE_HUMAN},
467 { "Rjak the Necromancer", 30000, 175, 110, 5, 11, RACE_DARK_ELF},
468 { "Skidney the Sorcerer", 15000, 200, 110, 7, 8, RACE_HALF_ELF},
469 { "Kyria the Illusionist", 30000, 200, 110, 7, 10, RACE_HUMAN},
470 { "Nikki the Necromancer", 30000, 175, 110, 5, 11, RACE_DARK_ELF},
471 { "Solostoran", 15000, 200, 110, 7, 8, RACE_SPRITE},
472 { "Achshe the Tentacled", 20000, 215, 113, 6, 10, RACE_MIND_FLAYER},
476 /* Black Market - 32 unique names */
478 { "ガリー=ギガズ", 20000, 250, 150, 10, 5, RACE_HALF_TROLL},
479 { "ゴブリンのヒストーア", 20000, 250, 150, 10, 5, RACE_HALF_ORC},
480 { "フェレンギ人クアーク", 30000, 250, 150, 10, 5, RACE_HUMAN},
481 { "公正なる(?)トッピ", 30000, 250, 150, 10, 5, RACE_ELF},
482 { "死人ヴァッサ", 20000, 250, 150, 10, 5, RACE_ZOMBIE},
483 { "裏切り者カイン", 20000, 250, 150, 10, 5, RACE_VAMPIRE},
484 { "ブボニカス", 30000, 250, 150, 10, 5, RACE_BEASTMAN},
485 { "コープスライト", 30000, 250, 150, 10, 5, RACE_SPECTRE},
486 { "血に飢えしパリッシュ", 20000, 250, 150, 10, 5, RACE_VAMPIRE},
487 { "ヴァイル", 20000, 250, 150, 10, 5, RACE_SKELETON},
488 { "信頼のプレンティス", 30000, 250, 150, 10, 5, RACE_SKELETON},
489 { "人間殺しのグリエラ", 30000, 250, 150, 10, 5, RACE_IMP},
490 { "エンジェル", 20000, 250, 150, 10, 5, RACE_VAMPIRE},
491 { "水膨れフロツァム", 20000, 250, 150, 10, 5, RACE_ZOMBIE},
492 { "ニーヴァル", 30000, 250, 150, 10, 5, RACE_VAMPIRE},
493 { "明るいアナスタシア", 30000, 250, 150, 10, 5, RACE_SPECTRE},
494 { "死霊術師チャリティー", 20000, 250, 150, 10, 5, RACE_DARK_ELF},
495 { "ボクサーのプグナシオス", 20000, 250, 150, 10, 5, RACE_HALF_ORC},
496 { "幸運なフットソア", 30000, 250, 150, 10, 5, RACE_BEASTMAN},
497 { "光指のシドリア", 30000, 250, 150, 10, 5, RACE_HUMAN},
498 { "手品師リアソー", 20000, 250, 150, 10, 5, RACE_HOBBIT},
499 { "やりくり上手のジャナッカ", 20000, 250, 150, 10, 5, RACE_GNOME},
500 { "悪党シーナ", 30000, 250, 150, 10, 5, RACE_GNOME},
501 { "大爪アルニッキ", 30000, 250, 150, 10, 5, RACE_DRACONIAN},
502 { "貧乏チャエアンド", 20000, 250, 150, 10, 5, RACE_HUMAN},
503 { "山賊アファードーフ", 20000, 250, 150, 10, 5, RACE_BARBARIAN},
504 { "強欲ラザクスル", 30000, 250, 150, 10, 5, RACE_MIND_FLAYER},
505 { "ファラレウィン", 30000, 250, 150, 10, 5, RACE_SPRITE},
506 { "しわしわヴォスール", 20000, 250, 150, 10, 5, RACE_NIBELUNG},
507 { "ハンサムなアラオード", 20000, 250, 150, 10, 5, RACE_AMBERITE},
508 { "負け犬セラドフリド", 30000, 250, 150, 10, 5, RACE_HUMAN},
509 { "片足のエルーロ", 30000, 250, 150, 10, 5, RACE_HALF_OGRE},
511 { "Gary Gygaz", 20000, 250, 150, 10, 5, RACE_HALF_TROLL},
512 { "Histor the Goblin", 20000, 250, 150, 10, 5, RACE_HALF_ORC},
513 { "Quark the Ferengi", 30000, 250, 150, 10, 5, RACE_DWARF},
514 { "Topi the Fair(?)", 30000, 250, 150, 10, 5, RACE_HUMAN},
515 { "Vhassa the Dead", 20000, 250, 150, 10, 5, RACE_ZOMBIE},
516 { "Kyn the Treacherous", 20000, 250, 150, 10, 5, RACE_VAMPIRE},
517 { "Bubonicus", 30000, 250, 150, 10, 5, RACE_BEASTMAN},
518 { "Corpselight", 30000, 250, 150, 10, 5, RACE_SPECTRE},
519 { "Parrish the Bloodthirsty", 20000, 250, 150, 10, 5, RACE_VAMPIRE},
520 { "Vile", 20000, 250, 150, 10, 5, RACE_SKELETON},
521 { "Prentice the Trusted", 30000, 250, 150, 10, 5, RACE_SKELETON},
522 { "Griella Humanslayer", 30000, 250, 150, 10, 5, RACE_IMP},
523 { "Angel", 20000, 250, 150, 10, 5, RACE_VAMPIRE},
524 { "Flotsam the Bloated", 20000, 250, 150, 10, 5, RACE_ZOMBIE},
525 { "Nieval", 30000, 250, 150, 10, 5, RACE_VAMPIRE},
526 { "Anastasia the Luminous", 30000, 250, 150, 10, 5, RACE_SPECTRE},
527 { "Charity the Necromancer", 20000, 250, 150, 10, 5, RACE_DARK_ELF},
528 { "Pugnacious the Pugilist", 20000, 250, 150, 10, 5, RACE_HALF_ORC},
529 { "Footsore the Lucky", 30000, 250, 150, 10, 5, RACE_BEASTMAN},
530 { "Sidria Lighfingered", 30000, 250, 150, 10, 5, RACE_HUMAN},
531 { "Riatho the Juggler", 20000, 250, 150, 10, 5, RACE_HOBBIT},
532 { "Janaaka the Shifty", 20000, 250, 150, 10, 5, RACE_GNOME},
533 { "Cina the Rogue", 30000, 250, 150, 10, 5, RACE_GNOME},
534 { "Arunikki Greatclaw", 30000, 250, 150, 10, 5, RACE_DRACONIAN},
535 { "Chaeand the Poor", 20000, 250, 150, 10, 5, RACE_HUMAN},
536 { "Afardorf the Brigand", 20000, 250, 150, 10, 5, RACE_BARBARIAN},
537 { "Lathaxl the Greedy", 30000, 250, 150, 10, 5, RACE_MIND_FLAYER},
538 { "Falarewyn", 30000, 250, 150, 10, 5, RACE_SPRITE},
539 { "Vosur the Wrinkled", 20000, 250, 150, 10, 5, RACE_NIBELUNG},
540 { "Araord the Handsome", 20000, 250, 150, 10, 5, RACE_AMBERITE},
541 { "Theradfrid the Loser", 30000, 250, 150, 10, 5, RACE_HUMAN},
542 { "One-Legged Eroolo", 30000, 250, 150, 10, 5, RACE_HALF_OGRE},
548 { "我が家", 0, 100, 100, 0, 99, 99},
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},
581 { "Your home", 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},
618 /* Bookstore - 21 unique names */
620 { "強欲ドラフ", 10000, 175, 108, 4, 12, RACE_HUMAN},
621 { "賢者オドナー", 15000, 120, 105, 6, 16, RACE_HIGH_ELF},
622 { "中立のガンダー", 25000, 120, 110, 7, 19, RACE_DARK_ELF},
623 { "忍耐の人ロ=シャ", 30000, 140, 105, 6, 12, RACE_ELF},
624 { "ランドルフ・カーター", 15000, 175, 108, 4, 12, RACE_HUMAN},
625 { "隼のサライ", 15000, 175, 108, 4, 12, RACE_HUMAN},
626 { "千里眼ボドリル", 20000, 120, 105, 6, 16, RACE_HIGH_ELF},
627 { "沈黙のヴェオロイン", 25000, 120, 110, 7, 19, RACE_ZOMBIE},
628 { "学者のヴァンシラス", 30000, 140, 105, 6, 12, RACE_MIND_FLAYER},
629 { "物書きオセイン", 15000, 175, 108, 4, 12, RACE_SKELETON},
630 { "本の虫オルヴァー", 20000, 120, 105, 6, 16, RACE_VAMPIRE},
631 { "浅井墓男", 25000, 120, 110, 7, 19, RACE_ZOMBIE},
632 { "デスマスク", 30000, 140, 105, 6, 12, RACE_ZOMBIE},
633 { "学者のアスーヌ", 15000, 175, 108, 4, 12, RACE_MIND_FLAYER},
634 { "死人のプリランド", 20000, 120, 105, 6, 16, RACE_ZOMBIE},
635 { "鉄のロナール", 25000, 120, 110, 7, 19, RACE_GOLEM},
637 { "Dolaf the Greedy", 10000, 175, 108, 4, 12, RACE_HUMAN},
638 { "Odnar the Sage", 15000, 120, 105, 6, 16, RACE_HIGH_ELF},
639 { "Gandar the Neutral", 25000, 120, 110, 7, 19, RACE_DARK_ELF},
640 { "Ro-sha the Patient", 30000, 140, 105, 6, 12, RACE_ELF},
641 { "Randolph Carter", 15000, 175, 108, 4, 12, RACE_HUMAN},
642 { "Sarai the Swift", 15000, 175, 108, 4, 12, RACE_HUMAN},
643 { "Bodril the Seer", 20000, 120, 105, 6, 16, RACE_HIGH_ELF},
644 { "Veloin the Quiet", 25000, 120, 110, 7, 19, RACE_ZOMBIE},
645 { "Vanthylas the Learned", 30000, 140, 105, 6, 12, RACE_MIND_FLAYER},
646 { "Ossein the Literate", 15000, 175, 108, 4, 12, RACE_SKELETON},
647 { "Olvar Bookworm", 20000, 120, 105, 6, 16, RACE_VAMPIRE},
648 { "Shallowgrave", 25000, 120, 110, 7, 19, RACE_ZOMBIE},
649 { "Death Mask", 30000, 140, 105, 6, 12, RACE_ZOMBIE},
650 { "Asuunu the Learned", 15000, 175, 108, 4, 12, RACE_MIND_FLAYER},
651 { "Prirand the Dead", 20000, 120, 105, 6, 16, RACE_ZOMBIE},
652 { "Ronar the Iron", 25000, 120, 110, 7, 19, RACE_GOLEM},
655 { "ガリル=ガミル", 30000, 140, 105, 6, 12, RACE_ELF},
656 { "本食いローバグ", 15000, 175, 108, 4, 12, RACE_KOBOLD},
657 { "キリアリキーク", 20000, 120, 105, 6, 16, RACE_KLACKON},
658 { "静かなるリリン", 25000, 120, 110, 7, 19, RACE_DWARF},
659 { "王者イサング", 30000, 140, 105, 6, 12, RACE_HIGH_ELF},
660 { "強欲ドラフ", 10000, 175, 108, 4, 12, RACE_HUMAN},
661 { "賢者オドナー", 15000, 120, 105, 6, 16, RACE_HIGH_ELF},
662 { "中立のガンダー", 25000, 120, 110, 7, 19, RACE_DARK_ELF},
663 { "忍耐の人ロ=シャ", 30000, 140, 105, 6, 12, RACE_ELF},
664 { "ランドルフ・カーター", 15000, 175, 108, 4, 12, RACE_HUMAN},
665 { "隼サライ", 15000, 175, 108, 4, 12, RACE_HUMAN},
666 { "千里眼ボドリル", 20000, 120, 105, 6, 16, RACE_HIGH_ELF},
667 { "沈黙のヴェオロイン", 25000, 120, 110, 7, 19, RACE_ZOMBIE},
668 { "学者のヴァンシラス", 30000, 140, 105, 6, 12, RACE_MIND_FLAYER},
669 { "物書きオセイン", 15000, 175, 108, 4, 12, RACE_SKELETON},
670 { "本の虫オルヴァー", 20000, 120, 105, 6, 16, RACE_VAMPIRE},
672 { "Galil-Gamir", 30000, 140, 105, 6, 12, RACE_ELF},
673 { "Rorbag Book-Eater", 15000, 175, 108, 4, 12, RACE_KOBOLD},
674 { "Kiriarikirk", 20000, 120, 105, 6, 16, RACE_KLACKON},
675 { "Rilin the Quiet", 25000, 120, 110, 7, 19, RACE_DWARF},
676 { "Isung the Lord", 30000, 140, 105, 6, 12, RACE_HIGH_ELF},
677 { "Dolaf the Greedy", 10000, 175, 108, 4, 12, RACE_HUMAN},
678 { "Odnar the Sage", 15000, 120, 105, 6, 16, RACE_HIGH_ELF},
679 { "Gandar the Neutral", 25000, 120, 110, 7, 19, RACE_DARK_ELF},
680 { "Ro-sha the Patient", 30000, 140, 105, 6, 12, RACE_ELF},
681 { "Randolph Carter", 15000, 175, 108, 4, 12, RACE_HUMAN},
682 { "Sarai the Swift", 15000, 175, 108, 4, 12, RACE_HUMAN},
683 { "Bodril the Seer", 20000, 120, 105, 6, 16, RACE_HIGH_ELF},
684 { "Veloin the Quiet", 25000, 120, 110, 7, 19, RACE_ZOMBIE},
685 { "Vanthylas the Learned", 30000, 140, 105, 6, 12, RACE_MIND_FLAYER},
686 { "Ossein the Literate", 15000, 175, 108, 4, 12, RACE_SKELETON},
687 { "Olvar Bookworm", 20000, 120, 105, 6, 16, RACE_VAMPIRE},
694 { "博物館", 0, 100, 100, 0, 99, 99},
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},
727 { "Museum", 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},
765 static int cur_store_num = 0;
766 static int store_top = 0;
767 static int store_bottom = 0;
768 static int xtra_stock = 0;
769 static store_type *st_ptr = NULL;
770 static const owner_type *ot_ptr = NULL;
771 static s16b old_town_num = 0;
772 static s16b inner_town_num = 0;
773 #define RUMOR_CHANCE 8
775 #define MAX_COMMENT_1 6
777 static concptr comment_1[MAX_COMMENT_1] =
798 /*! ブラックマーケット追加メッセージ(承諾) */
799 static concptr comment_1_B[MAX_COMMENT_1] = {
808 #define MAX_COMMENT_2A 2
810 static concptr comment_2a[MAX_COMMENT_2A] =
813 "私の忍耐力を試しているのかい? $%s が最後だ。",
814 "我慢にも限度があるぞ。 $%s が最後だ。"
816 "You try my patience. %s is final.",
817 "My patience grows thin. %s is final."
822 #define MAX_COMMENT_2B 12
824 static concptr comment_2b[MAX_COMMENT_2B] =
827 " $%s ぐらいは出さなきゃダメだよ。",
830 "何て奴だ! $%s 以下はあり得ないぞ。",
831 "それじゃ少なすぎる! $%s は欲しいところだ。",
832 "バカにしている! $%s はもらわないと。",
834 "おいおい! $%s を考えてくれないか?",
835 "1000匹のオークのノミに苦しめられるがいい! $%s だ。",
836 "お前の大切なものに災いあれ! $%s でどうだ。",
837 "モルゴスに賞味されるがいい!本当は $%s なんだろう?",
838 "お前の母親はオーガか! $%s は出すつもりなんだろ?"
840 "I can take no less than %s gold pieces.",
841 "I will accept no less than %s gold pieces.",
842 "Ha! No less than %s gold pieces.",
843 "You knave! No less than %s gold pieces.",
844 "That's a pittance! I want %s gold pieces.",
845 "That's an insult! I want %s gold pieces.",
846 "As if! How about %s gold pieces?",
847 "My arse! How about %s gold pieces?",
848 "May the fleas of 1000 orcs molest you! Try %s gold pieces.",
849 "May your most favourite parts go moldy! Try %s gold pieces.",
850 "May Morgoth find you tasty! Perhaps %s gold pieces?",
851 "Your mother was an Ogre! Perhaps %s gold pieces?"
857 /*! ブラックマーケット用追加メッセージ(売るとき) */
858 static concptr comment_2b_B[MAX_COMMENT_2B] = {
859 "いくら俺様がお人好しとはいえ $%s が限界だね。嫌なら帰りな。",
860 "金がないのかい、あんた?まずは家に帰って $%s 揃えてきな。",
861 "物の価値が分からん奴だな。これは $%s が普通なんだよ。",
862 "俺の付けた値段に文句があるのか? $%s が限界だ。",
863 "ひょっとして新手の冗談かい? $%s 持ってないなら帰りな。",
864 "うちは他の店とは違うんだよ。$%s ぐらいは出しな。",
865 "買う気がないなら帰りな。 $%s だと言っているんだ。",
866 "話にならないね。 $%s くらい持っているんだろ?",
867 "は?なんだそりゃ? $%s の間違いか、ひょっとして?",
868 "出口はあっちだよ。それとも $%s 出せるのかい、あんたに。",
869 "命知らずな奴だな。 $%s 出せば今日の所は勘弁してやるよ。",
870 "うちの店は貧乏人お断りだ。 $%s ぐらい出せないのかい?"
873 #define MAX_COMMENT_3A 2
875 static concptr comment_3a[MAX_COMMENT_3A] =
878 "私の忍耐力を試しているのかい? $%s が最後だ。",
879 "我慢にも限度があるぞ。 $%s が最後だ。"
881 "You try my patience. %s is final.",
882 "My patience grows thin. %s is final."
888 #define MAX_COMMENT_3B 12
890 static concptr comment_3b[MAX_COMMENT_3B] =
893 "本音を言うと $%s でいいんだろ?",
895 " $%s ぐらいなら出してもいいが。",
896 " $%s 以上払うなんて考えられないね。",
897 "まあ落ちついて。 $%s でどうだい?",
898 "そのガラクタなら $%s で引き取るよ。",
899 "それじゃ高すぎる! $%s がいいとこだろ。",
900 "どうせいらないんだろ! $%s でいいだろ?",
901 "だめだめ! $%s がずっとお似合いだよ。",
902 "バカにしている! $%s がせいぜいだ。",
903 " $%s なら嬉しいところだがなあ。",
904 " $%s 、それ以上はビタ一文出さないよ!"
906 "Perhaps %s gold pieces?",
907 "How about %s gold pieces?",
908 "I will pay no more than %s gold pieces.",
909 "I can afford no more than %s gold pieces.",
910 "Be reasonable. How about %s gold pieces?",
911 "I'll buy it as scrap for %s gold pieces.",
912 "That is too much! How about %s gold pieces?",
913 "That looks war surplus! Say %s gold pieces?",
914 "Never! %s is more like it.",
915 "That's an insult! %s is more like it.",
916 "%s gold pieces and be thankful for it!",
917 "%s gold pieces and not a copper more!"
923 /*! ブラックマーケット用追加メッセージ(買い取り) */
924 static concptr comment_3b_B[MAX_COMMENT_3B] = {
925 " $%s ってところだね。そのどうしようもないガラクタは。",
926 "この俺が $%s って言っているんだから、その通りにした方が身のためだぞ。",
927 "俺の優しさに甘えるのもいい加減にしておけ。 $%s だ。",
928 "その品なら $%s で売ってくれているがね、常識ある紳士はみんな。",
929 "こりゃまた、がめつい奴だな。いくら俺が温厚とはいえ $%s が限界だ。",
930 " $%s だ。別に俺はそんなガラクタ欲しくはないんだから。",
931 "俺の鑑定額が気に入らないのか? $%s 、嫌なら帰りな。",
932 " $%s で引き取ってやるよ。喜んで受け取りな、貧乏人。",
933 "物の価値が分からん奴は始末におえんな。それは $%s なんだよ。",
934 "そんなに金が欲しいのか、あんた? $%s で満足できんのか?",
935 "入る店間違えてんじゃないのか? $%s で嫌なら他をあたってくれ。",
936 "俺の言い値にケチをつける奴がいるとは! その度胸に免じて $%s だ。"
939 #define MAX_COMMENT_4A 4
941 static concptr comment_4a[MAX_COMMENT_4A] =
944 "もうたくさんだ!何度も私をわずらわせないでくれ!",
945 "うがー!一日の我慢の限度を超えている!",
946 "もういい!時間の無駄以外のなにものでもない!",
947 "もうやってられないよ!顔も見たくない!"
949 "Enough! You have abused me once too often!",
950 "Arghhh! I have had enough abuse for one day!",
951 "That does it! You shall waste my time no more!",
952 "This is getting nowhere! I'm going to Londis!"
958 /*! ブラックマーケット用追加メッセージ(怒りの頂点) */
959 static concptr comment_4a_B[MAX_COMMENT_4A] = {
960 "なめやがって!温厚な俺様でも限界があるってことを知れ!",
961 "俺をここまで怒らせて...命があるだけでもありがたいと思え!",
962 "ふざけてるのか!冷やかしなら相手を見てからにしろ!",
963 "いいかげんにしろ!今度こんなまねしたらただじゃおかねえぞ!"
966 #define MAX_COMMENT_4B 4
968 static concptr comment_4b[MAX_COMMENT_4B] =
977 "Get out of my sight!",
978 "Begone, you scoundrel!",
985 /*! ブラックマーケット用追加メッセージ(追い出し) */
986 static concptr comment_4b_B[MAX_COMMENT_4B] = {
993 #define MAX_COMMENT_5 8
995 static concptr comment_5[MAX_COMMENT_5] =
1009 "You will have to do better than that!",
1010 "Do you wish to do business or not?",
1011 "You've got to be kidding!",
1012 "You'd better be kidding!",
1013 "You try my patience.",
1014 "Hmmm, nice weather we're having."
1020 /*! ブラックマーケット用追加メッセージ(怒り) */
1021 static concptr comment_5_B[MAX_COMMENT_5] = {
1032 #define MAX_COMMENT_6 4
1034 static concptr comment_6[MAX_COMMENT_6] =
1042 "I must have heard you wrong.",
1043 "I'm sorry, I missed that.",
1044 "I'm sorry, what was that?",
1045 "Sorry, what was that again?"
1050 /*** Initialize others ***/
1053 * 店舗で販売するオブジェクトを定義する / Hack -- Objects sold in the stores -- by tval/sval pair.
1055 byte store_table[MAX_STORES][STORE_CHOICES][2] =
1060 { TV_FOOD, SV_FOOD_RATION },
1061 { TV_FOOD, SV_FOOD_RATION },
1062 { TV_FOOD, SV_FOOD_RATION },
1063 { TV_FOOD, SV_FOOD_RATION },
1065 { TV_FOOD, SV_FOOD_RATION },
1066 { TV_FOOD, SV_FOOD_BISCUIT },
1067 { TV_FOOD, SV_FOOD_JERKY },
1068 { TV_FOOD, SV_FOOD_JERKY },
1070 { TV_FOOD, SV_FOOD_PINT_OF_WINE },
1071 { TV_FOOD, SV_FOOD_PINT_OF_ALE },
1072 { TV_LITE, SV_LITE_TORCH },
1073 { TV_LITE, SV_LITE_TORCH },
1075 { TV_LITE, SV_LITE_TORCH },
1076 { TV_LITE, SV_LITE_TORCH },
1077 { TV_LITE, SV_LITE_LANTERN },
1078 { TV_LITE, SV_LITE_LANTERN },
1090 { TV_SHOT, SV_AMMO_NORMAL },
1091 { TV_ARROW, SV_AMMO_NORMAL },
1092 { TV_BOLT, SV_AMMO_NORMAL },
1093 { TV_DIGGING, SV_SHOVEL },
1095 { TV_DIGGING, SV_PICK },
1096 { TV_CLOAK, SV_CLOAK },
1097 { TV_CLOAK, SV_CLOAK },
1098 { TV_CLOAK, SV_FUR_CLOAK },
1100 { TV_FOOD, SV_FOOD_RATION },
1101 { TV_FOOD, SV_FOOD_RATION },
1102 { TV_FOOD, SV_FOOD_RATION },
1103 { TV_FOOD, SV_FOOD_RATION },
1105 { TV_POTION, SV_POTION_WATER },
1106 { TV_POTION, SV_POTION_WATER },
1107 { TV_LITE, SV_LITE_LANTERN },
1108 { TV_LITE, SV_LITE_LANTERN },
1110 { TV_FOOD, SV_FOOD_WAYBREAD },
1111 { TV_FOOD, SV_FOOD_WAYBREAD },
1115 { TV_SHOT, SV_AMMO_NORMAL },
1116 { TV_ARROW, SV_AMMO_NORMAL },
1117 { TV_BOLT, SV_AMMO_NORMAL },
1118 { TV_DIGGING, SV_SHOVEL }
1124 { TV_BOOTS, SV_PAIR_OF_SOFT_LEATHER_BOOTS },
1125 { TV_BOOTS, SV_PAIR_OF_SOFT_LEATHER_BOOTS },
1126 { TV_BOOTS, SV_PAIR_OF_HARD_LEATHER_BOOTS },
1127 { TV_BOOTS, SV_PAIR_OF_HARD_LEATHER_BOOTS },
1129 { TV_HELM, SV_HARD_LEATHER_CAP },
1130 { TV_HELM, SV_HARD_LEATHER_CAP },
1131 { TV_HELM, SV_METAL_CAP },
1132 { TV_HELM, SV_IRON_HELM },
1134 { TV_SOFT_ARMOR, SV_ROBE },
1135 { TV_SOFT_ARMOR, SV_ROBE },
1136 { TV_SOFT_ARMOR, SV_SOFT_LEATHER_ARMOR },
1137 { TV_SOFT_ARMOR, SV_SOFT_LEATHER_ARMOR },
1139 { TV_SOFT_ARMOR, SV_HARD_LEATHER_ARMOR },
1140 { TV_SOFT_ARMOR, SV_HARD_LEATHER_ARMOR },
1141 { TV_SOFT_ARMOR, SV_HARD_STUDDED_LEATHER },
1142 { TV_SOFT_ARMOR, SV_HARD_STUDDED_LEATHER },
1144 { TV_SOFT_ARMOR, SV_RHINO_HIDE_ARMOR },
1145 { TV_SOFT_ARMOR, SV_LEATHER_SCALE_MAIL },
1146 { TV_HARD_ARMOR, SV_METAL_SCALE_MAIL },
1147 { TV_HARD_ARMOR, SV_CHAIN_MAIL },
1149 { TV_HARD_ARMOR, SV_DOUBLE_RING_MAIL },
1150 { TV_HARD_ARMOR, SV_AUGMENTED_CHAIN_MAIL },
1151 { TV_HARD_ARMOR, SV_BAR_CHAIN_MAIL },
1152 { TV_HARD_ARMOR, SV_DOUBLE_CHAIN_MAIL },
1154 { TV_HARD_ARMOR, SV_METAL_BRIGANDINE_ARMOUR },
1155 { TV_HARD_ARMOR, SV_SPLINT_MAIL },
1156 { TV_GLOVES, SV_SET_OF_LEATHER_GLOVES },
1157 { TV_GLOVES, SV_SET_OF_LEATHER_GLOVES },
1159 { TV_GLOVES, SV_SET_OF_GAUNTLETS },
1160 { TV_SHIELD, SV_SMALL_LEATHER_SHIELD },
1161 { TV_SHIELD, SV_LARGE_LEATHER_SHIELD },
1162 { TV_SHIELD, SV_SMALL_METAL_SHIELD },
1164 { TV_BOOTS, SV_PAIR_OF_HARD_LEATHER_BOOTS },
1165 { TV_BOOTS, SV_PAIR_OF_HARD_LEATHER_BOOTS },
1166 { TV_HELM, SV_HARD_LEATHER_CAP },
1167 { TV_HELM, SV_HARD_LEATHER_CAP },
1169 { TV_SOFT_ARMOR, SV_ROBE },
1170 { TV_SOFT_ARMOR, SV_SOFT_LEATHER_ARMOR },
1171 { TV_SOFT_ARMOR, SV_SOFT_LEATHER_ARMOR },
1172 { TV_SOFT_ARMOR, SV_HARD_LEATHER_ARMOR },
1174 { TV_SOFT_ARMOR, SV_LEATHER_JACK },
1175 { TV_HARD_ARMOR, SV_METAL_SCALE_MAIL },
1176 { TV_HARD_ARMOR, SV_CHAIN_MAIL },
1177 { TV_HARD_ARMOR, SV_CHAIN_MAIL },
1179 { TV_GLOVES, SV_SET_OF_LEATHER_GLOVES },
1180 { TV_GLOVES, SV_SET_OF_GAUNTLETS },
1181 { TV_SHIELD, SV_SMALL_LEATHER_SHIELD },
1182 { TV_SHIELD, SV_SMALL_LEATHER_SHIELD }
1188 { TV_SWORD, SV_DAGGER },
1189 { TV_SWORD, SV_MAIN_GAUCHE },
1190 { TV_SWORD, SV_RAPIER },
1191 { TV_SWORD, SV_SMALL_SWORD },
1193 { TV_SWORD, SV_SHORT_SWORD },
1194 { TV_SWORD, SV_SABRE },
1195 { TV_SWORD, SV_CUTLASS },
1196 { TV_SWORD, SV_TULWAR },
1198 { TV_SWORD, SV_BROAD_SWORD },
1199 { TV_SWORD, SV_LONG_SWORD },
1200 { TV_SWORD, SV_SCIMITAR },
1201 { TV_SWORD, SV_KATANA },
1203 { TV_SWORD, SV_BASTARD_SWORD },
1204 { TV_POLEARM, SV_SPEAR },
1205 { TV_POLEARM, SV_AWL_PIKE },
1206 { TV_POLEARM, SV_TRIDENT },
1208 { TV_POLEARM, SV_PIKE },
1209 { TV_POLEARM, SV_BEAKED_AXE },
1210 { TV_POLEARM, SV_BROAD_AXE },
1211 { TV_POLEARM, SV_LANCE },
1213 { TV_POLEARM, SV_BATTLE_AXE },
1214 { TV_POLEARM, SV_HATCHET },
1215 { TV_BOW, SV_SLING },
1216 { TV_BOW, SV_SHORT_BOW },
1218 { TV_BOW, SV_LIGHT_XBOW },
1219 { TV_SHOT, SV_AMMO_NORMAL },
1220 { TV_SHOT, SV_AMMO_NORMAL },
1221 { TV_ARROW, SV_AMMO_NORMAL },
1223 { TV_ARROW, SV_AMMO_NORMAL },
1224 { TV_BOLT, SV_AMMO_NORMAL },
1225 { TV_BOLT, SV_AMMO_NORMAL },
1226 { TV_BOW, SV_LIGHT_XBOW },
1228 { TV_ARROW, SV_AMMO_NORMAL },
1229 { TV_BOLT, SV_AMMO_NORMAL },
1230 { TV_BOW, SV_SHORT_BOW },
1231 { TV_BOW, SV_LIGHT_XBOW },
1233 { TV_SWORD, SV_DAGGER },
1234 { TV_SWORD, SV_TANTO },
1235 { TV_SWORD, SV_RAPIER },
1236 { TV_SWORD, SV_SMALL_SWORD },
1238 { TV_SWORD, SV_SHORT_SWORD },
1239 { TV_SWORD, SV_LONG_SWORD },
1240 { TV_SWORD, SV_SCIMITAR },
1241 { TV_SWORD, SV_BROAD_SWORD },
1243 { TV_HISSATSU_BOOK, 0 },
1244 { TV_HISSATSU_BOOK, 0 },
1245 { TV_HISSATSU_BOOK, 1 },
1246 { TV_HISSATSU_BOOK, 1 },
1252 { TV_HAFTED, SV_NUNCHAKU },
1253 { TV_HAFTED, SV_QUARTERSTAFF },
1254 { TV_HAFTED, SV_MACE },
1255 { TV_HAFTED, SV_BO_STAFF },
1257 { TV_HAFTED, SV_WAR_HAMMER },
1258 { TV_HAFTED, SV_WAR_HAMMER },
1259 { TV_HAFTED, SV_MORNING_STAR },
1260 { TV_HAFTED, SV_FLAIL },
1262 { TV_HAFTED, SV_LEAD_FILLED_MACE },
1263 { TV_SCROLL, SV_SCROLL_REMOVE_CURSE },
1264 { TV_SCROLL, SV_SCROLL_BLESSING },
1265 { TV_SCROLL, SV_SCROLL_HOLY_CHANT },
1267 { TV_POTION, SV_POTION_HEROISM },
1268 { TV_SCROLL, SV_SCROLL_WORD_OF_RECALL },
1269 { TV_SCROLL, SV_SCROLL_WORD_OF_RECALL },
1270 { TV_SCROLL, SV_SCROLL_WORD_OF_RECALL },
1272 { TV_POTION, SV_POTION_CURE_LIGHT },
1273 { TV_POTION, SV_POTION_CURE_SERIOUS },
1274 { TV_POTION, SV_POTION_CURE_SERIOUS },
1275 { TV_POTION, SV_POTION_CURE_CRITICAL },
1277 { TV_POTION, SV_POTION_CURE_CRITICAL },
1278 { TV_POTION, SV_POTION_RESTORE_EXP },
1279 { TV_POTION, SV_POTION_RESTORE_EXP },
1280 { TV_POTION, SV_POTION_RESTORE_EXP },
1282 { TV_LIFE_BOOK, 0 },
1283 { TV_LIFE_BOOK, 0 },
1284 { TV_LIFE_BOOK, 1 },
1285 { TV_LIFE_BOOK, 1 },
1287 { TV_CRUSADE_BOOK, 0 },
1288 { TV_CRUSADE_BOOK, 0 },
1289 { TV_CRUSADE_BOOK, 1 },
1290 { TV_CRUSADE_BOOK, 1 },
1292 { TV_HAFTED, SV_WHIP },
1293 { TV_HAFTED, SV_MACE },
1294 { TV_HAFTED, SV_BALL_AND_CHAIN },
1295 { TV_HAFTED, SV_WAR_HAMMER },
1297 { TV_SCROLL, SV_SCROLL_WORD_OF_RECALL },
1298 { TV_SCROLL, SV_SCROLL_WORD_OF_RECALL },
1299 { TV_SCROLL, SV_SCROLL_WORD_OF_RECALL },
1300 { TV_POTION, SV_POTION_CURE_CRITICAL },
1302 { TV_POTION, SV_POTION_CURE_CRITICAL },
1303 { TV_POTION, SV_POTION_RESTORE_EXP },
1306 { TV_STATUE, SV_ANY },
1308 { TV_SCROLL, SV_SCROLL_REMOVE_CURSE },
1309 { TV_SCROLL, SV_SCROLL_REMOVE_CURSE },
1310 { TV_SCROLL, SV_SCROLL_STAR_REMOVE_CURSE },
1311 { TV_SCROLL, SV_SCROLL_STAR_REMOVE_CURSE }
1317 { TV_SCROLL, SV_SCROLL_ENCHANT_WEAPON_TO_HIT },
1318 { TV_SCROLL, SV_SCROLL_ENCHANT_WEAPON_TO_DAM },
1319 { TV_SCROLL, SV_SCROLL_ENCHANT_ARMOR },
1320 { TV_SCROLL, SV_SCROLL_IDENTIFY },
1322 { TV_SCROLL, SV_SCROLL_IDENTIFY },
1323 { TV_SCROLL, SV_SCROLL_IDENTIFY },
1324 { TV_SCROLL, SV_SCROLL_IDENTIFY },
1325 { TV_SCROLL, SV_SCROLL_LIGHT },
1327 { TV_SCROLL, SV_SCROLL_PHASE_DOOR },
1328 { TV_SCROLL, SV_SCROLL_PHASE_DOOR },
1329 { TV_SCROLL, SV_SCROLL_TELEPORT },
1330 { TV_SCROLL, SV_SCROLL_MONSTER_CONFUSION },
1332 { TV_SCROLL, SV_SCROLL_MAPPING },
1333 { TV_SCROLL, SV_SCROLL_DETECT_GOLD },
1334 { TV_SCROLL, SV_SCROLL_DETECT_ITEM },
1335 { TV_SCROLL, SV_SCROLL_DETECT_TRAP },
1337 { TV_SCROLL, SV_SCROLL_DETECT_INVIS },
1338 { TV_SCROLL, SV_SCROLL_RECHARGING },
1339 { TV_SCROLL, SV_SCROLL_TELEPORT },
1340 { TV_SCROLL, SV_SCROLL_WORD_OF_RECALL },
1342 { 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_TELEPORT },
1347 { TV_SCROLL, SV_SCROLL_TELEPORT },
1348 { TV_POTION, SV_POTION_RES_STR },
1349 { TV_POTION, SV_POTION_RES_INT },
1350 { TV_POTION, SV_POTION_RES_WIS },
1352 { TV_POTION, SV_POTION_RES_DEX },
1353 { TV_POTION, SV_POTION_RES_CON },
1354 { TV_POTION, SV_POTION_RES_CHR },
1355 { TV_SCROLL, SV_SCROLL_IDENTIFY },
1357 { TV_SCROLL, SV_SCROLL_IDENTIFY },
1358 { TV_SCROLL, SV_SCROLL_STAR_IDENTIFY }, /* Yep, occasionally! */
1359 { TV_SCROLL, SV_SCROLL_STAR_IDENTIFY },
1360 { TV_SCROLL, SV_SCROLL_LIGHT },
1362 { TV_POTION, SV_POTION_RES_STR },
1363 { TV_POTION, SV_POTION_RES_INT },
1364 { TV_POTION, SV_POTION_RES_WIS },
1365 { TV_POTION, SV_POTION_RES_DEX },
1367 { TV_POTION, SV_POTION_RES_CON },
1368 { TV_POTION, SV_POTION_RES_CHR },
1369 { TV_SCROLL, SV_SCROLL_ENCHANT_ARMOR },
1370 { TV_SCROLL, SV_SCROLL_ENCHANT_ARMOR },
1372 { TV_SCROLL, SV_SCROLL_RECHARGING },
1373 { TV_SCROLL, SV_SCROLL_PHASE_DOOR },
1374 { TV_SCROLL, SV_SCROLL_ENCHANT_WEAPON_TO_HIT },
1375 { TV_SCROLL, SV_SCROLL_ENCHANT_WEAPON_TO_DAM },
1380 /* Magic-User store */
1382 { TV_RING, SV_RING_PROTECTION },
1383 { TV_RING, SV_RING_LEVITATION_FALL },
1384 { TV_RING, SV_RING_PROTECTION },
1385 { TV_RING, SV_RING_RESIST_FIRE },
1387 { TV_RING, SV_RING_RESIST_COLD },
1388 { TV_AMULET, SV_AMULET_CHARISMA },
1389 { TV_RING, SV_RING_WARNING },
1390 { TV_AMULET, SV_AMULET_RESIST_ACID },
1392 { TV_AMULET, SV_AMULET_SEARCHING },
1393 { TV_WAND, SV_WAND_SLOW_MONSTER },
1394 { TV_WAND, SV_WAND_CONFUSE_MONSTER },
1395 { TV_WAND, SV_WAND_SLEEP_MONSTER },
1397 { TV_WAND, SV_WAND_MAGIC_MISSILE },
1398 { TV_WAND, SV_WAND_STINKING_CLOUD },
1399 { TV_WAND, SV_WAND_WONDER },
1400 { TV_WAND, SV_WAND_DISARMING },
1402 { TV_STAFF, SV_STAFF_LITE },
1403 { TV_STAFF, SV_STAFF_MAPPING },
1404 { TV_STAFF, SV_STAFF_DETECT_TRAP },
1405 { TV_STAFF, SV_STAFF_DETECT_DOOR },
1407 { TV_STAFF, SV_STAFF_DETECT_GOLD },
1408 { TV_STAFF, SV_STAFF_DETECT_ITEM },
1409 { TV_STAFF, SV_STAFF_DETECT_INVIS },
1410 { TV_STAFF, SV_STAFF_DETECT_EVIL },
1412 { TV_STAFF, SV_STAFF_TELEPORTATION },
1413 { TV_STAFF, SV_STAFF_TELEPORTATION },
1414 { TV_STAFF, SV_STAFF_TELEPORTATION },
1415 { TV_STAFF, SV_STAFF_TELEPORTATION },
1417 { TV_STAFF, SV_STAFF_IDENTIFY },
1418 { TV_STAFF, SV_STAFF_IDENTIFY },
1419 { TV_STAFF, SV_STAFF_IDENTIFY },
1421 { TV_STAFF, SV_STAFF_IDENTIFY },
1422 { TV_STAFF, SV_STAFF_REMOVE_CURSE },
1423 { TV_STAFF, SV_STAFF_CURE_LIGHT },
1424 { TV_STAFF, SV_STAFF_PROBING },
1428 { TV_SORCERY_BOOK, 0 },
1429 { TV_SORCERY_BOOK, 0 },
1430 { TV_SORCERY_BOOK, 1 },
1431 { TV_SORCERY_BOOK, 1 },
1433 { TV_ARCANE_BOOK, 0 },
1434 { TV_ARCANE_BOOK, 0 },
1435 { TV_ARCANE_BOOK, 1 },
1436 { TV_ARCANE_BOOK, 1 },
1438 { TV_ARCANE_BOOK, 2 },
1439 { TV_ARCANE_BOOK, 2 },
1440 { TV_ARCANE_BOOK, 3 },
1441 { TV_ARCANE_BOOK, 3 },
1446 /* Black Market (unused) */
1519 { TV_SORCERY_BOOK, 0 },
1520 { TV_SORCERY_BOOK, 0 },
1521 { TV_SORCERY_BOOK, 1 },
1522 { TV_SORCERY_BOOK, 1 },
1524 { TV_NATURE_BOOK, 0 },
1525 { TV_NATURE_BOOK, 0 },
1526 { TV_NATURE_BOOK, 1 },
1527 { TV_NATURE_BOOK, 1 },
1529 { TV_CHAOS_BOOK, 0 },
1530 { TV_CHAOS_BOOK, 0 },
1531 { TV_CHAOS_BOOK, 1 },
1532 { TV_CHAOS_BOOK, 1 },
1534 { TV_DEATH_BOOK, 0 },
1535 { TV_DEATH_BOOK, 0 },
1536 { TV_DEATH_BOOK, 1 },
1537 { TV_DEATH_BOOK, 1 },
1539 { TV_TRUMP_BOOK, 0 }, /* +16 */
1540 { TV_TRUMP_BOOK, 0 },
1541 { TV_TRUMP_BOOK, 1 },
1542 { TV_TRUMP_BOOK, 1 },
1544 { TV_ARCANE_BOOK, 0 },
1545 { TV_ARCANE_BOOK, 1 },
1546 { TV_ARCANE_BOOK, 2 },
1547 { TV_ARCANE_BOOK, 3 },
1549 { TV_CRAFT_BOOK, 0 },
1550 { TV_CRAFT_BOOK, 0 },
1551 { TV_CRAFT_BOOK, 1 },
1552 { TV_CRAFT_BOOK, 1 },
1554 { TV_DAEMON_BOOK, 0 },
1555 { TV_DAEMON_BOOK, 0 },
1556 { TV_DAEMON_BOOK, 1 },
1557 { TV_DAEMON_BOOK, 1 },
1559 { TV_MUSIC_BOOK, 0 },
1560 { TV_MUSIC_BOOK, 0 },
1561 { TV_MUSIC_BOOK, 1 },
1562 { TV_MUSIC_BOOK, 1 },
1571 /* Museum (unused) */
1610 * @brief 取引成功時の店主のメッセージ処理 /
1611 * Successful haggle.
1614 static void say_comment_1(void)
1617 /* ブラックマーケットのときは別のメッセージを出す */
1618 if ( cur_store_num == STORE_BLACK ) {
1619 msg_print(comment_1_B[randint0(MAX_COMMENT_1)]);
1622 msg_print(comment_1[randint0(MAX_COMMENT_1)]);
1625 msg_print(comment_1[randint0(MAX_COMMENT_1)]);
1629 if (one_in_(RUMOR_CHANCE))
1632 msg_print("店主は耳うちした:");
1634 msg_print("The shopkeeper whispers something into your ear:");
1636 display_rumor(TRUE);
1642 * @brief プレイヤーがアイテムを買う時の価格代案メッセージ処理 /
1643 * Continue haggling (player is buying)
1644 * @param value 店主の提示価格
1645 * @param annoyed 店主のいらつき度
1648 static void say_comment_2(PRICE value, int annoyed)
1652 /* Prepare a string to insert */
1653 sprintf(tmp_val, "%ld", (long)value);
1658 /* Formatted message */
1659 msg_format(comment_2a[randint0(MAX_COMMENT_2A)], tmp_val);
1665 /* Formatted message */
1667 /* ブラックマーケットの時は別のメッセージを出す */
1668 if ( cur_store_num == STORE_BLACK ){
1669 msg_format(comment_2b_B[randint0(MAX_COMMENT_2B)], tmp_val);
1672 msg_format(comment_2b[randint0(MAX_COMMENT_2B)], tmp_val);
1675 msg_format(comment_2b[randint0(MAX_COMMENT_2B)], tmp_val);
1683 * @brief プレイヤーがアイテムを売る時の価格代案メッセージ処理 /
1684 * Continue haggling (player is selling)
1685 * @param value 店主の提示価格
1686 * @param annoyed 店主のいらつき度
1689 static void say_comment_3(PRICE value, int annoyed)
1693 /* Prepare a string to insert */
1694 sprintf(tmp_val, "%ld", (long)value);
1699 /* Formatted message */
1700 msg_format(comment_3a[randint0(MAX_COMMENT_3A)], tmp_val);
1706 /* Formatted message */
1708 /* ブラックマーケットの時は別のメッセージを出す */
1709 if ( cur_store_num == STORE_BLACK ){
1710 msg_format(comment_3b_B[randint0(MAX_COMMENT_3B)], tmp_val);
1713 msg_format(comment_3b[randint0(MAX_COMMENT_3B)], tmp_val);
1716 msg_format(comment_3b[randint0(MAX_COMMENT_3B)], tmp_val);
1724 * @brief 店主がプレイヤーを追い出す時のメッセージ処理 /
1725 * Kick 'da bum out. -RAK-
1728 static void say_comment_4(void)
1731 /* ブラックマーケットの時は別のメッセージを出す */
1732 if ( cur_store_num == STORE_BLACK ){
1733 msg_print(comment_4a_B[randint0(MAX_COMMENT_4A)]);
1734 msg_print(comment_4b_B[randint0(MAX_COMMENT_4B)]);
1737 msg_print(comment_4a[randint0(MAX_COMMENT_4A)]);
1738 msg_print(comment_4b[randint0(MAX_COMMENT_4B)]);
1741 msg_print(comment_4a[randint0(MAX_COMMENT_4A)]);
1742 msg_print(comment_4b[randint0(MAX_COMMENT_4B)]);
1749 * @brief 店主がプレイヤーに取り合わない時のメッセージ処理 /
1750 * You are insulting me
1753 static void say_comment_5(void)
1756 /* ブラックマーケットの時は別のメッセージを出す */
1757 if ( cur_store_num == STORE_BLACK ){
1758 msg_print(comment_5_B[randint0(MAX_COMMENT_5)]);
1761 msg_print(comment_5[randint0(MAX_COMMENT_5)]);
1764 msg_print(comment_5[randint0(MAX_COMMENT_5)]);
1771 * @brief 店主がプレイヤーの提示を理解できなかった時のメッセージ処理 /
1772 * That makes no sense.
1775 static void say_comment_6(void)
1777 msg_print(comment_6[randint0(MAX_COMMENT_6)]);
1781 #define MAX_COMMENT_7A 4
1783 static concptr comment_7a[MAX_COMMENT_7A] =
1788 "誰かがむせび泣く声が聞こえる...。",
1793 "You hear someone sobbing...",
1794 "The shopkeeper howls in agony!"
1799 #define MAX_COMMENT_7B 4
1801 static concptr comment_7b[MAX_COMMENT_7B] =
1811 "The shopkeeper curses at you.",
1812 "The shopkeeper glares at you."
1817 #define MAX_COMMENT_7C 4
1819 static concptr comment_7c[MAX_COMMENT_7C] =
1828 "You've made my day!",
1829 "The shopkeeper giggles.",
1830 "The shopkeeper laughs loudly."
1835 #define MAX_COMMENT_7D 4
1837 static concptr comment_7d[MAX_COMMENT_7D] =
1841 "こんなおいしい思いをしたら、真面目に働けなくなるなぁ。",
1846 "I think I'll retire!",
1847 "The shopkeeper jumps for joy.",
1848 "The shopkeeper smiles gleefully."
1855 * @brief 店主が交渉を終えた際の反応を返す処理 /
1856 * Let a shop-keeper React to a purchase
1857 * @param price アイテムの取引額
1858 * @param value アイテムの実際価値
1859 * @param guess 店主が当初予想していた価値
1862 * We paid "price", it was worth "value", and we thought it was worth "guess"
1864 static void purchase_analyze(PRICE price, PRICE value, PRICE guess)
1866 /* Item was worthless, but we bought it */
1867 if ((value <= 0) && (price > value))
1869 msg_print(comment_7a[randint0(MAX_COMMENT_7A)]);
1870 chg_virtue(V_HONOUR, -1);
1871 chg_virtue(V_JUSTICE, -1);
1872 sound(SOUND_STORE1);
1875 /* Item was cheaper than we thought, and we paid more than necessary */
1876 else if ((value < guess) && (price > value))
1878 msg_print(comment_7b[randint0(MAX_COMMENT_7B)]);
1879 chg_virtue(V_JUSTICE, -1);
1880 if (one_in_(4)) chg_virtue(V_HONOUR, -1);
1881 sound(SOUND_STORE2);
1884 /* Item was a good bargain, and we got away with it */
1885 else if ((value > guess) && (value < (4 * guess)) && (price < value))
1887 msg_print(comment_7c[randint0(MAX_COMMENT_7C)]);
1888 if (one_in_(4)) chg_virtue(V_HONOUR, -1);
1889 else if (one_in_(4)) chg_virtue(V_HONOUR, 1);
1890 sound(SOUND_STORE3);
1893 /* Item was a great bargain, and we got away with it */
1894 else if ((value > guess) && (price < value))
1896 msg_print(comment_7d[randint0(MAX_COMMENT_7D)]);
1897 if (one_in_(2)) chg_virtue(V_HONOUR, -1);
1898 if (one_in_(4)) chg_virtue(V_HONOUR, 1);
1899 if (10 * price < value) chg_virtue(V_SACRIFICE, 1);
1900 sound(SOUND_STORE4);
1907 * We store the current "store feat" here so everyone can access it
1909 static int cur_store_feat;
1913 * Buying and selling adjustments for race combinations.
1914 * Entry[owner][player] gives the basic "cost inflation".
1916 static byte rgold_adj[MAX_RACES][MAX_RACES] =
1918 /*Hum, HfE, Elf, Hal, Gno, Dwa, HfO, HfT, Dun, HiE, Barbarian,
1919 HfOg, HGn, HTn, Cyc, Yek, Klc, Kbd, Nbl, DkE, Drc, Mind Flayer,
1920 Imp, Glm, Skl, Zombie, Vampire, Spectre, Fairy, Beastman, Ent,
1921 Angel, Demon, Kutar */
1924 { 100, 105, 105, 110, 113, 115, 120, 125, 100, 105, 100,
1925 124, 120, 110, 125, 115, 120, 120, 120, 120, 115, 120,
1926 115, 105, 125, 125, 125, 125, 105, 120, 105, 95, 140,
1927 100, 120, 110, 105 },
1930 { 110, 100, 100, 105, 110, 120, 125, 130, 110, 100, 110,
1931 120, 115, 108, 115, 110, 110, 120, 120, 115, 115, 110,
1932 120, 110, 110, 110, 120, 110, 100, 125, 100, 95, 140,
1933 110, 115, 110, 110 },
1936 { 110, 105, 100, 105, 110, 120, 125, 130, 110, 100, 110,
1937 120, 120, 105, 120, 110, 105, 125, 125, 110, 115, 108,
1938 120, 115, 110, 110, 120, 110, 100, 125, 100, 95, 140,
1939 110, 110, 105, 110 },
1942 { 115, 110, 105, 95, 105, 110, 115, 130, 115, 105, 115,
1943 125, 120, 120, 125, 115, 110, 120, 120, 120, 115, 115,
1944 120, 110, 120, 120, 130, 110, 110, 130, 110, 95, 140,
1945 115, 120, 105, 115 },
1948 { 115, 115, 110, 105, 95, 110, 115, 130, 115, 110, 115,
1949 120, 125, 110, 120, 110, 105, 120, 110, 110, 105, 110,
1950 120, 101, 110, 110, 120, 120, 115, 130, 115, 95, 140,
1951 115, 110, 110, 115 },
1954 { 115, 120, 120, 110, 110, 95, 125, 135, 115, 120, 115,
1955 125, 140, 130, 130, 120, 115, 115, 115, 135, 125, 120,
1956 120, 105, 115, 115, 115, 115, 120, 130, 120, 95, 140,
1957 115, 110, 115, 115 },
1960 { 115, 120, 125, 115, 115, 130, 110, 115, 115, 125, 115,
1961 110, 110, 120, 110, 120, 125, 115, 115, 110, 120, 110,
1962 115, 125, 120, 120, 115, 120, 125, 115, 125, 95, 140,
1963 115, 110, 115, 115 },
1966 { 110, 115, 115, 110, 110, 130, 110, 110, 110, 115, 110,
1967 110, 115, 120, 110, 120, 120, 110, 110, 110, 115, 110,
1968 110, 115, 112, 112, 115, 112, 120, 110, 120, 95, 140,
1969 110, 110, 115, 110 },
1972 { 100, 105, 105, 110, 113, 115, 120, 125, 100, 105, 100,
1973 120, 120, 105, 120, 115, 105, 115, 120, 110, 105, 105,
1974 120, 105, 120, 120, 125, 120, 105, 135, 105, 95, 140,
1975 100, 110, 110, 100 },
1978 { 110, 105, 100, 105, 110, 120, 125, 130, 110, 100, 110,
1979 125, 125, 101, 120, 115, 110, 115, 125, 110, 110, 110,
1980 125, 115, 120, 120, 125, 120, 100, 125, 100, 95, 140,
1981 110, 110, 105, 110 },
1983 /* Human / Barbarian (copied from human) */
1984 { 100, 105, 105, 110, 113, 115, 120, 125, 100, 105, 100,
1985 124, 120, 110, 125, 115, 120, 120, 120, 120, 115, 120,
1986 115, 105, 125, 125, 130, 125, 115, 120, 115, 95, 140,
1987 100, 120, 110, 100 },
1989 /* Half-Ogre: theoretical, copied from half-troll */
1990 { 110, 115, 115, 110, 110, 130, 110, 110, 110, 115, 110,
1991 110, 115, 120, 110, 120, 120, 110, 110, 110, 115, 110,
1992 110, 115, 112, 112, 115, 112, 120, 110, 120, 95, 140,
1993 110, 110, 115, 110 },
1995 /* Half-Giant: theoretical, copied from half-troll */
1996 { 110, 115, 115, 110, 110, 130, 110, 110, 110, 115, 110,
1997 110, 115, 120, 110, 120, 120, 110, 110, 110, 115, 110,
1998 110, 115, 112, 112, 115, 112, 130, 120, 130, 95, 140,
1999 110, 110, 115, 110 },
2001 /* Half-Titan: theoretical, copied from High_Elf */
2002 { 110, 105, 100, 105, 110, 120, 125, 130, 110, 100, 110,
2003 125, 125, 101, 120, 115, 110, 115, 125, 110, 110, 110,
2004 125, 115, 120, 120, 120, 120, 130, 130, 130, 95, 140,
2005 110, 110, 115, 110 },
2007 /* Cyclops: theoretical, copied from half-troll */
2008 { 110, 115, 115, 110, 110, 130, 110, 110, 110, 115, 110,
2009 110, 115, 120, 110, 120, 120, 110, 110, 110, 115, 110,
2010 110, 115, 112, 112, 115, 112, 130, 130, 130, 95, 140,
2011 110, 110, 115, 110 },
2013 /* Yeek: theoretical, copied from Half-Orc */
2014 { 115, 120, 125, 115, 115, 130, 110, 115, 115, 125, 115,
2015 110, 110, 120, 110, 120, 125, 115, 115, 110, 120, 110,
2016 115, 125, 120, 120, 120, 120, 130, 130, 130, 95, 140,
2017 115, 110, 115, 115 },
2019 /* Klackon: theoretical, copied from Gnome */
2020 { 115, 115, 110, 105, 95, 110, 115, 130, 115, 110, 115,
2021 120, 125, 110, 120, 110, 105, 120, 110, 110, 105, 110,
2022 120, 101, 110, 110, 120, 120, 130, 130, 130, 95, 140,
2023 115, 110, 115, 115 },
2025 /* Kobold: theoretical, copied from Half-Orc */
2026 { 115, 120, 125, 115, 115, 130, 110, 115, 115, 125, 115,
2027 110, 110, 120, 110, 120, 125, 115, 115, 110, 120, 110,
2028 115, 125, 120, 120, 120, 120, 130, 130, 130, 95, 140,
2029 115, 110, 115, 115 },
2031 /* Nibelung: theoretical, copied from Dwarf */
2032 { 115, 120, 120, 110, 110, 95, 125, 135, 115, 120, 115,
2033 125, 140, 130, 130, 120, 115, 115, 115, 135, 125, 120,
2034 120, 105, 115, 115, 120, 120, 130, 130, 130, 95, 140,
2035 115, 135, 115, 115 },
2038 { 110, 110, 110, 115, 120, 130, 115, 115, 120, 110, 115,
2039 115, 115, 116, 115, 120, 120, 115, 115, 101, 110, 110,
2040 110, 110, 112, 122, 110, 110, 110, 115, 110, 120, 120,
2041 110, 101, 115, 110 },
2043 /* Draconian: theoretical, copied from High_Elf */
2044 { 110, 105, 100, 105, 110, 120, 125, 130, 110, 100, 110,
2045 125, 125, 101, 120, 115, 110, 115, 125, 110, 110, 110,
2046 125, 115, 120, 120, 120, 120, 130, 130, 130, 95, 140,
2047 110, 110, 115, 110 },
2049 /* Mind Flayer: theoretical, copied from High_Elf */
2050 { 110, 105, 100, 105, 110, 120, 125, 130, 110, 100, 110,
2051 125, 125, 101, 120, 115, 110, 115, 125, 110, 110, 110,
2052 125, 115, 120, 120, 120, 120, 130, 130, 130, 95, 140,
2053 110, 110, 115, 110 },
2055 /* Imp: theoretical, copied from High_Elf */
2056 { 110, 105, 100, 105, 110, 120, 125, 130, 110, 100, 110,
2057 125, 125, 101, 120, 115, 110, 115, 125, 110, 110, 110,
2058 125, 115, 120, 120, 120, 120, 130, 130, 130, 120, 120,
2059 110, 110, 115, 110 },
2061 /* Golem: theoretical, copied from High_Elf */
2062 { 110, 105, 100, 105, 110, 120, 125, 130, 110, 100, 110,
2063 125, 125, 101, 120, 115, 110, 115, 125, 110, 110, 110,
2064 125, 115, 120, 120, 120, 120, 130, 130, 130, 95, 140,
2065 110, 110, 115, 110 },
2067 /* Skeleton: theoretical, copied from half-orc */
2068 { 115, 120, 125, 115, 115, 130, 110, 115, 115, 125, 115,
2069 110, 110, 120, 110, 120, 125, 115, 115, 110, 120, 110,
2070 115, 125, 120, 120, 120, 120, 130, 130, 130, 120, 120,
2071 115, 110, 125, 115 },
2073 /* Zombie: Theoretical, copied from half-orc */
2074 { 115, 120, 125, 115, 115, 130, 110, 115, 115, 125, 115,
2075 110, 110, 120, 110, 120, 125, 115, 115, 110, 120, 110,
2076 115, 125, 120, 120, 120, 120, 130, 130, 130, 120, 120,
2077 115, 110, 125, 115 },
2079 /* Vampire: Theoretical, copied from half-orc */
2080 { 115, 120, 125, 115, 115, 130, 110, 115, 115, 125, 115,
2081 110, 110, 120, 110, 120, 125, 115, 115, 110, 120, 110,
2082 115, 125, 120, 120, 120, 120, 130, 130, 130, 120, 120,
2083 115, 110, 125, 115 },
2085 /* Spectre: Theoretical, copied from half-orc */
2086 { 115, 120, 125, 115, 115, 130, 110, 115, 115, 125, 115,
2087 110, 110, 120, 110, 120, 125, 115, 115, 110, 120, 110,
2088 115, 125, 120, 120, 120, 120, 130, 130, 130, 120, 120,
2089 115, 110, 125, 115 },
2091 /* Sprite: Theoretical, copied from half-orc */
2092 { 115, 120, 125, 115, 115, 130, 110, 115, 115, 125, 115,
2093 110, 110, 120, 110, 120, 125, 115, 115, 110, 120, 110,
2094 115, 125, 120, 120, 120, 120, 130, 130, 130, 95, 140,
2095 115, 110, 105, 115 },
2097 /* Beastman: Theoretical, copied from half-orc */
2098 { 115, 120, 125, 115, 115, 130, 110, 115, 115, 125, 115,
2099 110, 110, 120, 110, 120, 125, 115, 115, 110, 120, 110,
2100 115, 125, 120, 120, 120, 120, 130, 130, 130, 95, 140,
2101 115, 110, 115, 115 },
2104 { 110, 105, 100, 105, 110, 120, 125, 130, 110, 100, 110,
2105 120, 120, 105, 120, 110, 105, 125, 125, 110, 115, 108,
2106 120, 115, 110, 110, 120, 110, 100, 125, 100, 95, 140,
2107 110, 110, 105, 110 },
2110 { 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95,
2111 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95,
2112 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 160,
2116 { 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, 140,
2117 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, 140,
2118 140, 140, 140, 140, 140, 140, 140, 140, 140, 160, 120,
2119 140, 140, 140, 140 },
2122 { 100, 105, 105, 110, 113, 115, 120, 125, 100, 105, 100,
2123 124, 120, 110, 125, 115, 120, 120, 120, 120, 115, 120,
2124 115, 105, 125, 125, 125, 125, 105, 120, 105, 95, 140,
2125 100, 120, 110, 100 },
2128 { 110, 110, 110, 115, 120, 130, 115, 115, 120, 110, 115,
2129 115, 115, 116, 115, 120, 120, 115, 115, 101, 110, 110,
2130 110, 110, 112, 122, 110, 110, 110, 115, 110, 120, 120,
2131 110, 101, 115, 110 },
2134 { 110, 110, 105, 105, 110, 115, 115, 115, 110, 105, 110,
2135 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115,
2136 115, 115, 125, 125, 125, 125, 105, 115, 105, 95, 140,
2137 110, 115, 100, 110 },
2140 { 105, 105, 105, 110, 113, 115, 120, 125, 100, 105, 100,
2141 124, 120, 110, 125, 115, 120, 120, 120, 120, 115, 120,
2142 115, 105, 125, 125, 125, 125, 105, 120, 105, 95, 140,
2143 100, 120, 110, 100 },
2149 * @brief 店舗価格を決定する /
2150 * Determine the price of an item (qty one) in a store.
2151 * @param o_ptr 店舗に並べるオブジェクト構造体の参照ポインタ
2152 * @param greed 店主の強欲度
2153 * @param flip TRUEならば店主にとっての買取価格、FALSEなら売出価格を計算
2157 * This function takes into account the player's charisma, and the
2158 * shop-keepers friendliness, and the shop-keeper's base greed, but
2159 * never lets a shop-keeper lose money in a transaction.
2160 * The "greed" value should exceed 100 when the player is "buying" the
2161 * item, and should be less than 100 when the player is "selling" it.
2162 * Hack -- the black market always charges twice as much as it should.
2163 * Charisma adjustment runs from 80 to 130
2164 * Racial adjustment runs from 95 to 130
2165 * Since greed/charisma/racial adjustments are centered at 100, we need
2166 * to adjust (by 200) to extract a usable multiplier. Note that the
2167 * "greed" value is always something (?).
2170 static s32b price_item(object_type *o_ptr, int greed, bool flip)
2177 /* Get the value of one of the items */
2178 price = object_value(o_ptr);
2180 /* Worthless items */
2181 if (price <= 0) return (0L);
2184 /* Compute the racial factor */
2185 factor = rgold_adj[ot_ptr->owner_race][p_ptr->prace];
2187 /* Add in the charisma factor */
2188 factor += adj_chr_gold[p_ptr->stat_ind[A_CHR]];
2191 /* Shop is buying */
2194 /* Adjust for greed */
2195 adjust = 100 + (300 - (greed + factor));
2197 /* Never get "silly" */
2198 if (adjust > 100) adjust = 100;
2200 /* Mega-Hack -- Black market sucks */
2201 if (cur_store_num == STORE_BLACK)
2204 /* Compute the final price (with rounding) */
2205 /* Hack -- prevent underflow */
2206 price = (price * adjust + 50L) / 100L;
2209 /* Shop is selling */
2212 /* Adjust for greed */
2213 adjust = 100 + ((greed + factor) - 300);
2215 /* Never get "silly" */
2216 if (adjust < 100) adjust = 100;
2218 /* Mega-Hack -- Black market sucks */
2219 if (cur_store_num == STORE_BLACK)
2222 /* Compute the final price (with rounding) */
2223 /* Hack -- prevent overflow */
2224 price = (s32b)(((u32b)price * (u32b)adjust + 50UL) / 100UL);
2227 /* Note -- Never become "free" */
2228 if (price <= 0L) return (1L);
2230 /* Return the price */
2236 * @brief 安価な消耗品の販売数を増やし、低確率で割引にする /
2237 * Certain "cheap" objects should be created in "piles"
2238 * @param o_ptr 店舗に並べるオブジェクト構造体の参照ポインタ
2242 * Some objects can be sold at a "discount" (in small piles)
2245 static void mass_produce(object_type *o_ptr)
2248 DISCOUNT_RATE discount = 0;
2250 s32b cost = object_value(o_ptr);
2253 /* Analyze the type */
2254 switch (o_ptr->tval)
2256 /* Food, Flasks, and Lites */
2261 if (cost <= 5L) size += damroll(3, 5);
2262 if (cost <= 20L) size += damroll(3, 5);
2263 if (cost <= 50L) size += damroll(2, 2);
2270 if (cost <= 60L) size += damroll(3, 5);
2271 if (cost <= 240L) size += damroll(1, 5);
2272 if (o_ptr->sval == SV_SCROLL_STAR_IDENTIFY) size += damroll(3, 5);
2273 if (o_ptr->sval == SV_SCROLL_STAR_REMOVE_CURSE) size += damroll(1, 4);
2278 case TV_SORCERY_BOOK:
2279 case TV_NATURE_BOOK:
2283 case TV_ARCANE_BOOK:
2285 case TV_DAEMON_BOOK:
2286 case TV_CRUSADE_BOOK:
2288 case TV_HISSATSU_BOOK:
2291 if (cost <= 50L) size += damroll(2, 3);
2292 if (cost <= 500L) size += damroll(1, 3);
2310 if (object_is_artifact(o_ptr)) break;
2311 if (object_is_ego(o_ptr)) break;
2312 if (cost <= 10L) size += damroll(3, 5);
2313 if (cost <= 100L) size += damroll(3, 5);
2322 if (cost <= 5L) size += damroll(5, 5);
2323 if (cost <= 50L) size += damroll(5, 5);
2324 if (cost <= 500L) size += damroll(5, 5);
2330 if (cost <= 100L) size += damroll(2, 2);
2331 if (cost <= 1000L) size += damroll(2, 2);
2344 * Because many rods (and a few wands and staffs) are useful mainly
2345 * in quantity, the Black Market will occasionally have a bunch of
2352 if ((cur_store_num == STORE_BLACK) && one_in_(3))
2354 if (cost < 1601L) size += damroll(1, 5);
2355 else if (cost < 3201L) size += damroll(1, 3);
2362 /* Pick a discount */
2367 else if (one_in_(25))
2371 else if (one_in_(150))
2375 else if (one_in_(300))
2379 else if (one_in_(500))
2384 if (o_ptr->art_name)
2389 /* Save the discount */
2390 o_ptr->discount = discount;
2392 /* Save the total pile size */
2393 o_ptr->number = size - (size * discount / 100);
2395 /* Ensure that mass-produced rods and wands get the correct pvals. */
2396 if ((o_ptr->tval == TV_ROD) || (o_ptr->tval == TV_WAND))
2398 o_ptr->pval *= (PARAMETER_VALUE)o_ptr->number;
2405 * @brief 店舗に並べた品を同一品であるかどうか判定する /
2406 * Determine if a store item can "absorb" another item
2407 * @param o_ptr 判定するオブジェクト構造体の参照ポインタ1
2408 * @param j_ptr 判定するオブジェクト構造体の参照ポインタ2
2409 * @return 同一扱いできるならTRUEを返す
2412 * See "object_similar()" for the same function for the "player"
2415 static bool store_object_similar(object_type *o_ptr, object_type *j_ptr)
2419 /* Hack -- Identical items cannot be stacked */
2420 if (o_ptr == j_ptr) return (0);
2422 /* Different objects cannot be stacked */
2423 if (o_ptr->k_idx != j_ptr->k_idx) return (0);
2425 /* Different charges (etc) cannot be stacked, unless wands or rods. */
2426 if ((o_ptr->pval != j_ptr->pval) && (o_ptr->tval != TV_WAND) && (o_ptr->tval != TV_ROD)) return (0);
2428 /* Require many identical values */
2429 if (o_ptr->to_h != j_ptr->to_h) return (0);
2430 if (o_ptr->to_d != j_ptr->to_d) return (0);
2431 if (o_ptr->to_a != j_ptr->to_a) return (0);
2433 /* Require identical "ego-item" names */
2434 if (o_ptr->name2 != j_ptr->name2) return (0);
2436 /* Artifacts don't stack! */
2437 if (object_is_artifact(o_ptr) || object_is_artifact(j_ptr)) return (0);
2439 /* Hack -- Identical art_flags! */
2440 for (i = 0; i < TR_FLAG_SIZE; i++)
2441 if (o_ptr->art_flags[i] != j_ptr->art_flags[i]) return (0);
2443 /* Hack -- Never stack "powerful" items */
2444 if (o_ptr->xtra1 || j_ptr->xtra1) return (0);
2446 /* Hack -- Never stack recharging items */
2447 if (o_ptr->timeout || j_ptr->timeout) return (0);
2449 /* Require many identical values */
2450 if (o_ptr->ac != j_ptr->ac) return (0);
2451 if (o_ptr->dd != j_ptr->dd) return (0);
2452 if (o_ptr->ds != j_ptr->ds) return (0);
2454 /* Hack -- Never stack chests */
2455 if (o_ptr->tval == TV_CHEST) return (0);
2456 if (o_ptr->tval == TV_STATUE) return (0);
2457 if (o_ptr->tval == TV_CAPTURE) return (0);
2459 /* Require matching discounts */
2460 if (o_ptr->discount != j_ptr->discount) return (0);
2462 /* They match, so they must be similar */
2468 * @brief 店舗に並べた品を重ね合わせできるかどうか判定する /
2469 * Allow a store item to absorb another item
2470 * @param o_ptr 判定するオブジェクト構造体の参照ポインタ1
2471 * @param j_ptr 判定するオブジェクト構造体の参照ポインタ2
2472 * @return 重ね合わせできるならTRUEを返す
2475 * See "object_similar()" for the same function for the "player"
2478 static void store_object_absorb(object_type *o_ptr, object_type *j_ptr)
2480 int max_num = (o_ptr->tval == TV_ROD) ?
2481 MIN(99, MAX_SHORT / k_info[o_ptr->k_idx].pval) : 99;
2482 int total = o_ptr->number + j_ptr->number;
2483 int diff = (total > max_num) ? total - max_num : 0;
2485 /* Combine quantity, lose excess items */
2486 o_ptr->number = (total > max_num) ? max_num : total;
2488 /* Hack -- if rods are stacking, add the pvals (maximum timeouts) together. -LM- */
2489 if (o_ptr->tval == TV_ROD)
2491 o_ptr->pval += j_ptr->pval * (j_ptr->number - diff) / j_ptr->number;
2494 /* Hack -- if wands are stacking, combine the charges. -LM- */
2495 if (o_ptr->tval == TV_WAND)
2497 o_ptr->pval += j_ptr->pval * (j_ptr->number - diff) / j_ptr->number;
2503 * @brief 店舗に品を置くスペースがあるかどうかの判定を返す /
2504 * Check to see if the shop will be carrying too many objects -RAK-
2505 * @param o_ptr 店舗に置きたいオブジェクト構造体の参照ポインタ
2506 * @return 置き場がないなら0、重ね合わせできるアイテムがあるなら-1、スペースがあるなら1を返す。
2509 * Note that the shop, just like a player, will not accept things
2510 * it cannot hold. Before, one could "nuke" potions this way.
2511 * Return value is now int:
2513 * -1 : Can be combined to existing slot.
2514 * 1 : Cannot be combined but there are empty spaces.
2517 static int store_check_num(object_type *o_ptr)
2522 /* The "home" acts like the player */
2523 if ((cur_store_num == STORE_HOME) || (cur_store_num == STORE_MUSEUM))
2525 bool old_stack_force_notes = stack_force_notes;
2526 bool old_stack_force_costs = stack_force_costs;
2528 if (cur_store_num != STORE_HOME)
2530 stack_force_notes = FALSE;
2531 stack_force_costs = FALSE;
2534 /* Check all the items */
2535 for (i = 0; i < st_ptr->stock_num; i++)
2537 /* Get the existing item */
2538 j_ptr = &st_ptr->stock[i];
2540 /* Can the new object be combined with the old one? */
2541 if (object_similar(j_ptr, o_ptr))
2543 if (cur_store_num != STORE_HOME)
2545 stack_force_notes = old_stack_force_notes;
2546 stack_force_costs = old_stack_force_costs;
2553 if (cur_store_num != STORE_HOME)
2555 stack_force_notes = old_stack_force_notes;
2556 stack_force_costs = old_stack_force_costs;
2560 /* Normal stores do special stuff */
2563 /* Check all the items */
2564 for (i = 0; i < st_ptr->stock_num; i++)
2566 /* Get the existing item */
2567 j_ptr = &st_ptr->stock[i];
2569 /* Can the new object be combined with the old one? */
2570 if (store_object_similar(j_ptr, o_ptr)) return -1;
2574 /* Free space is always usable */
2576 * オプション powerup_home が設定されていると
2579 if ((cur_store_num == STORE_HOME) && ( powerup_home == FALSE )) {
2580 if (st_ptr->stock_num < ((st_ptr->stock_size) / 10)) {
2585 if (st_ptr->stock_num < st_ptr->stock_size) {
2590 /* But there was no room at the inn... */
2595 * @brief オブジェクトが祝福されているかの判定を返す /
2596 * @param o_ptr 判定したいオブジェクト構造体の参照ポインタ
2597 * @return アイテムが祝福されたアイテムならばTRUEを返す
2599 static bool is_blessed(object_type *o_ptr)
2601 BIT_FLAGS flgs[TR_FLAG_SIZE];
2602 object_flags(o_ptr, flgs);
2603 if (have_flag(flgs, TR_BLESSED)) return (TRUE);
2604 else return (FALSE);
2610 * @brief オブジェクトが所定の店舗で引き取れるかどうかを返す /
2611 * Determine if the current store will purchase the given item
2612 * @param o_ptr 判定したいオブジェクト構造体の参照ポインタ
2613 * @return アイテムが買い取れるならばTRUEを返す
2615 * Note that a shop-keeper must refuse to buy "worthless" items
2617 static bool store_will_buy(object_type *o_ptr)
2619 /* Hack -- The Home is simple */
2620 if ((cur_store_num == STORE_HOME) || (cur_store_num == STORE_MUSEUM)) return (TRUE);
2622 /* Switch on the store */
2623 switch (cur_store_num)
2628 /* Analyze the type */
2629 switch (o_ptr->tval)
2632 if (o_ptr->sval != SV_POTION_WATER) return FALSE;
2644 case TV_BOTTLE: /* 'Green', recycling Angband */
2659 /* Analyze the type */
2660 switch (o_ptr->tval)
2681 /* Analyze the type */
2682 switch (o_ptr->tval)
2691 case TV_HISSATSU_BOOK:
2695 if(o_ptr->sval == SV_WIZSTAFF) return (FALSE);
2707 /* Analyze the type */
2708 switch (o_ptr->tval)
2711 case TV_CRUSADE_BOOK:
2721 monster_race *r_ptr = &r_info[o_ptr->pval];
2724 if (!(r_ptr->flags3 & RF3_EVIL))
2727 if (r_ptr->flags3 & RF3_GOOD) break;
2729 /* Accept animals */
2730 if (r_ptr->flags3 & RF3_ANIMAL) break;
2733 if (my_strchr("?!", r_ptr->d_char)) break;
2739 if (is_blessed(o_ptr)) break;
2748 case STORE_ALCHEMIST:
2750 /* Analyze the type */
2751 switch (o_ptr->tval)
2765 /* Analyze the type */
2766 switch (o_ptr->tval)
2768 case TV_SORCERY_BOOK:
2769 case TV_NATURE_BOOK:
2773 case TV_ARCANE_BOOK:
2775 case TV_DAEMON_BOOK:
2789 if(o_ptr->sval == SV_WIZSTAFF) break;
2790 else return (FALSE);
2797 /* Bookstore Shop */
2800 /* Analyze the type */
2801 switch (o_ptr->tval)
2803 case TV_SORCERY_BOOK:
2804 case TV_NATURE_BOOK:
2809 case TV_ARCANE_BOOK:
2811 case TV_DAEMON_BOOK:
2812 case TV_CRUSADE_BOOK:
2823 /* Ignore "worthless" items */
2824 if (object_value(o_ptr) <= 0) return (FALSE);
2832 * @brief 現在の町の指定された店舗のアイテムを整理する /
2833 * Combine and reorder items in store.
2834 * @param store_num 店舗ID
2835 * @return 実際に整理が行われたならばTRUEを返す。
2837 bool combine_and_reorder_home(int store_num)
2841 object_type forge, *o_ptr, *j_ptr;
2842 bool flag = FALSE, combined;
2843 store_type *old_st_ptr = st_ptr;
2844 bool old_stack_force_notes = stack_force_notes;
2845 bool old_stack_force_costs = stack_force_costs;
2847 st_ptr = &town[1].store[store_num];
2848 if (store_num != STORE_HOME)
2850 stack_force_notes = FALSE;
2851 stack_force_costs = FALSE;
2858 /* Combine the items in the home (backwards) */
2859 for (i = st_ptr->stock_num - 1; i > 0; i--)
2861 o_ptr = &st_ptr->stock[i];
2863 /* Skip empty items */
2864 if (!o_ptr->k_idx) continue;
2866 /* Scan the items above that item */
2867 for (j = 0; j < i; j++)
2871 j_ptr = &st_ptr->stock[j];
2873 /* Skip empty items */
2874 if (!j_ptr->k_idx) continue;
2877 * Get maximum number of the stack if these
2878 * are similar, get zero otherwise.
2880 max_num = object_similar_part(j_ptr, o_ptr);
2882 /* Can we (partialy) drop "o_ptr" onto "j_ptr"? */
2883 if (max_num && j_ptr->number < max_num)
2885 if (o_ptr->number + j_ptr->number <= max_num)
2887 /* Add together the item counts */
2888 object_absorb(j_ptr, o_ptr);
2890 /* One object is gone */
2891 st_ptr->stock_num--;
2893 /* Slide everything down */
2894 for (k = i; k < st_ptr->stock_num; k++)
2896 /* Structure copy */
2897 st_ptr->stock[k] = st_ptr->stock[k + 1];
2900 /* Erase the "final" slot */
2901 object_wipe(&st_ptr->stock[k]);
2905 ITEM_NUMBER old_num = o_ptr->number;
2906 ITEM_NUMBER remain = j_ptr->number + o_ptr->number - max_num;
2908 /* Add together the item counts */
2909 object_absorb(j_ptr, o_ptr);
2911 o_ptr->number = remain;
2913 /* Hack -- if rods are stacking, add the pvals (maximum timeouts) and current timeouts together. -LM- */
2914 if (o_ptr->tval == TV_ROD)
2916 o_ptr->pval = o_ptr->pval * remain / old_num;
2917 o_ptr->timeout = o_ptr->timeout * remain / old_num;
2920 /* Hack -- if wands are stacking, combine the charges. -LM- */
2921 else if (o_ptr->tval == TV_WAND)
2923 o_ptr->pval = o_ptr->pval * remain / old_num;
2938 /* Re-order the items in the home (forwards) */
2939 for (i = 0; i < st_ptr->stock_num; i++)
2941 o_ptr = &st_ptr->stock[i];
2943 /* Skip empty slots */
2944 if (!o_ptr->k_idx) continue;
2946 /* Get the "value" of the item */
2947 o_value = object_value(o_ptr);
2949 /* Scan every occupied slot */
2950 for (j = 0; j < st_ptr->stock_num; j++)
2952 if (object_sort_comp(o_ptr, o_value, &st_ptr->stock[j])) break;
2955 /* Never move down */
2956 if (j >= i) continue;
2962 /* Save a copy of the moving item */
2963 object_copy(j_ptr, &st_ptr->stock[i]);
2965 /* Slide the objects */
2966 for (k = i; k > j; k--)
2968 /* Slide the item */
2969 object_copy(&st_ptr->stock[k], &st_ptr->stock[k - 1]);
2972 /* Insert the moving item */
2973 object_copy(&st_ptr->stock[j], j_ptr);
2976 st_ptr = old_st_ptr;
2977 if (store_num != STORE_HOME)
2979 stack_force_notes = old_stack_force_notes;
2980 stack_force_costs = old_stack_force_costs;
2988 * @brief 我が家にオブジェクトを加える /
2989 * Add the item "o_ptr" to the inventory of the "Home"
2990 * @param o_ptr 加えたいオブジェクトの構造体参照ポインタ
2994 * In all cases, return the slot (or -1) where the object was placed
2995 * Note that this is a hacked up version of "inven_carry()".
2996 * Also note that it may not correctly "adapt" to "knowledge" bacoming
2997 * known, the player may have to pick stuff up and drop it again.
3000 static int home_carry(object_type *o_ptr)
3006 bool old_stack_force_notes = stack_force_notes;
3007 bool old_stack_force_costs = stack_force_costs;
3009 if (cur_store_num != STORE_HOME)
3011 stack_force_notes = FALSE;
3012 stack_force_costs = FALSE;
3015 /* Check each existing item (try to combine) */
3016 for (slot = 0; slot < st_ptr->stock_num; slot++)
3018 /* Get the existing item */
3019 j_ptr = &st_ptr->stock[slot];
3021 /* The home acts just like the player */
3022 if (object_similar(j_ptr, o_ptr))
3024 /* Save the new number of items */
3025 object_absorb(j_ptr, o_ptr);
3027 if (cur_store_num != STORE_HOME)
3029 stack_force_notes = old_stack_force_notes;
3030 stack_force_costs = old_stack_force_costs;
3038 if (cur_store_num != STORE_HOME)
3040 stack_force_notes = old_stack_force_notes;
3041 stack_force_costs = old_stack_force_costs;
3046 * 隠し機能: オプション powerup_home が設定されていると
3050 if ((cur_store_num != STORE_HOME) || (powerup_home == TRUE)) {
3051 if (st_ptr->stock_num >= st_ptr->stock_size) {
3056 if (st_ptr->stock_num >= ((st_ptr->stock_size) / 10)) {
3062 /* Determine the "value" of the item */
3063 value = object_value(o_ptr);
3065 /* Check existing slots to see if we must "slide" */
3066 for (slot = 0; slot < st_ptr->stock_num; slot++)
3068 if (object_sort_comp(o_ptr, value, &st_ptr->stock[slot])) break;
3071 /* Slide the others up */
3072 for (i = st_ptr->stock_num; i > slot; i--)
3074 st_ptr->stock[i] = st_ptr->stock[i-1];
3077 /* More stuff now */
3078 st_ptr->stock_num++;
3080 /* Insert the new item */
3081 st_ptr->stock[slot] = *o_ptr;
3083 chg_virtue(V_SACRIFICE, -1);
3085 (void)combine_and_reorder_home(cur_store_num);
3087 /* Return the location */
3093 * @brief 店舗にオブジェクトを加える /
3094 * Add the item "o_ptr" to a real stores inventory.
3095 * @param o_ptr 加えたいオブジェクトの構造体参照ポインタ
3099 * In all cases, return the slot (or -1) where the object was placed
3100 * Note that this is a hacked up version of "inven_carry()".
3101 * Also note that it may not correctly "adapt" to "knowledge" bacoming
3102 * known, the player may have to pick stuff up and drop it again.
3105 static int store_carry(object_type *o_ptr)
3108 s32b value, j_value;
3112 /* Evaluate the object */
3113 value = object_value(o_ptr);
3115 /* Cursed/Worthless items "disappear" when sold */
3116 if (value <= 0) return (-1);
3118 /* All store items are fully *identified* */
3119 o_ptr->ident |= IDENT_MENTAL;
3121 /* Erase the inscription */
3122 o_ptr->inscription = 0;
3124 /* Erase the "feeling" */
3125 o_ptr->feeling = FEEL_NONE;
3127 /* Check each existing item (try to combine) */
3128 for (slot = 0; slot < st_ptr->stock_num; slot++)
3130 /* Get the existing item */
3131 j_ptr = &st_ptr->stock[slot];
3133 /* Can the existing items be incremented? */
3134 if (store_object_similar(j_ptr, o_ptr))
3136 /* Hack -- extra items disappear */
3137 store_object_absorb(j_ptr, o_ptr);
3145 if (st_ptr->stock_num >= st_ptr->stock_size) return (-1);
3148 /* Check existing slots to see if we must "slide" */
3149 for (slot = 0; slot < st_ptr->stock_num; slot++)
3152 j_ptr = &st_ptr->stock[slot];
3154 /* Objects sort by decreasing type */
3155 if (o_ptr->tval > j_ptr->tval) break;
3156 if (o_ptr->tval < j_ptr->tval) continue;
3158 /* Objects sort by increasing sval */
3159 if (o_ptr->sval < j_ptr->sval) break;
3160 if (o_ptr->sval > j_ptr->sval) continue;
3163 * Hack: otherwise identical rods sort by
3164 * increasing recharge time --dsb
3166 if (o_ptr->tval == TV_ROD)
3168 if (o_ptr->pval < j_ptr->pval) break;
3169 if (o_ptr->pval > j_ptr->pval) continue;
3172 /* Evaluate that slot */
3173 j_value = object_value(j_ptr);
3175 /* Objects sort by decreasing value */
3176 if (value > j_value) break;
3177 if (value < j_value) continue;
3180 /* Slide the others up */
3181 for (i = st_ptr->stock_num; i > slot; i--)
3183 st_ptr->stock[i] = st_ptr->stock[i-1];
3186 /* More stuff now */
3187 st_ptr->stock_num++;
3189 /* Insert the new item */
3190 st_ptr->stock[slot] = *o_ptr;
3192 /* Return the location */
3198 * @brief 店舗のオブジェクト数を増やす /
3199 * Add the item "o_ptr" to a real stores inventory.
3200 * @param item 増やしたいアイテムのID
3205 * Increase, by a given amount, the number of a certain item
3206 * in a certain store. This can result in zero items.
3208 * @todo numは本来ITEM_NUMBER型にしたい。
3210 static void store_item_increase(INVENTORY_IDX item, int num)
3215 o_ptr = &st_ptr->stock[item];
3217 /* Verify the number */
3218 cnt = o_ptr->number + num;
3219 if (cnt > 255) cnt = 255;
3220 else if (cnt < 0) cnt = 0;
3221 num = cnt - o_ptr->number;
3223 /* Save the new number */
3224 o_ptr->number += (ITEM_NUMBER)num;
3229 * @brief 店舗のオブジェクト数を削除する /
3230 * Remove a slot if it is empty
3231 * @param item 削除したいアイテムのID
3234 static void store_item_optimize(INVENTORY_IDX item)
3239 o_ptr = &st_ptr->stock[item];
3242 if (!o_ptr->k_idx) return;
3244 /* Must have no items */
3245 if (o_ptr->number) return;
3248 st_ptr->stock_num--;
3250 /* Slide everyone */
3251 for (j = item; j < st_ptr->stock_num; j++)
3253 st_ptr->stock[j] = st_ptr->stock[j + 1];
3256 /* Nuke the final slot */
3257 object_wipe(&st_ptr->stock[j]);
3261 * @brief ブラックマーケット用の無価値品の排除判定 /
3262 * This function will keep 'crap' out of the black market.
3263 * @param o_ptr 判定したいオブジェクトの構造体参照ポインタ
3264 * @return ブラックマーケットにとって無価値な品ならばTRUEを返す
3267 * Crap is defined as any item that is "available" elsewhere
3268 * Based on a suggestion by "Lee Vogt" <lvogt@cig.mcel.mot.com>
3271 static bool black_market_crap(object_type *o_ptr)
3275 /* Ego items are never crap */
3276 if (object_is_ego(o_ptr)) return (FALSE);
3278 /* Good items are never crap */
3279 if (o_ptr->to_a > 0) return (FALSE);
3280 if (o_ptr->to_h > 0) return (FALSE);
3281 if (o_ptr->to_d > 0) return (FALSE);
3283 /* Check all stores */
3284 for (i = 0; i < MAX_STORES; i++)
3286 if (i == STORE_HOME) continue;
3287 if (i == STORE_MUSEUM) continue;
3289 /* Check every item in the store */
3290 for (j = 0; j < town[p_ptr->town_num].store[i].stock_num; j++)
3292 object_type *j_ptr = &town[p_ptr->town_num].store[i].stock[j];
3294 /* Duplicate item "type", assume crappy */
3295 if (o_ptr->k_idx == j_ptr->k_idx) return (TRUE);
3305 * @brief 店舗の品揃え変化のためにアイテムを削除する /
3306 * Attempt to delete (some of) a random item from the store
3310 * Hack -- we attempt to "maintain" piles of items when possible.
3313 static void store_delete(void)
3318 /* Pick a random slot */
3319 what = (INVENTORY_IDX)randint0(st_ptr->stock_num);
3321 /* Determine how many items are here */
3322 num = st_ptr->stock[what].number;
3324 /* Hack -- sometimes, only destroy half the items */
3325 if (randint0(100) < 50) num = (num + 1) / 2;
3327 /* Hack -- sometimes, only destroy a single item */
3328 if (randint0(100) < 50) num = 1;
3330 /* Hack -- decrement the maximum timeouts and total charges of rods and wands. -LM- */
3331 if ((st_ptr->stock[what].tval == TV_ROD) || (st_ptr->stock[what].tval == TV_WAND))
3333 st_ptr->stock[what].pval -= num * st_ptr->stock[what].pval / st_ptr->stock[what].number;
3336 /* Actually destroy (part of) the item */
3337 store_item_increase(what, -num);
3338 store_item_optimize(what);
3343 * @brief 店舗の品揃え変化のためにアイテムを追加する /
3344 * Creates a random item and gives it to a store
3348 * This algorithm needs to be rethought. A lot.
3349 * Currently, "normal" stores use a pre-built array.
3350 * Note -- the "level" given to "obj_get_num()" is a "favored"
3351 * level, that is, there is a much higher chance of getting
3352 * items with a level approaching that of the given level...
3353 * Should we check for "permission" to have the given item?
3356 static void store_create(void)
3366 /* Paranoia -- no room left */
3367 if (st_ptr->stock_num >= st_ptr->stock_size) return;
3370 /* Hack -- consider up to four items */
3371 for (tries = 0; tries < 4; tries++)
3374 if (cur_store_num == STORE_BLACK)
3376 /* Pick a level for object/magic */
3377 level = 25 + randint0(25);
3379 /* Random item (usually of given level) */
3380 i = get_obj_num(level);
3382 /* Handle failure */
3389 /* Hack -- Pick an item to sell */
3390 i = st_ptr->table[randint0(st_ptr->table_num)];
3392 /* Hack -- fake level for apply_magic() */
3393 level = rand_range(1, STORE_OBJ_LEVEL);
3398 /* Create a new object of the chosen kind */
3399 object_prep(q_ptr, i);
3401 /* Apply some "low-level" magic (no artifacts) */
3402 apply_magic(q_ptr, level, AM_NO_FIXED_ART);
3404 /* Require valid object */
3405 if (!store_will_buy(q_ptr)) continue;
3407 /* Hack -- Charge lite's */
3408 if (q_ptr->tval == TV_LITE)
3410 if (q_ptr->sval == SV_LITE_TORCH) q_ptr->xtra4 = FUEL_TORCH / 2;
3411 if (q_ptr->sval == SV_LITE_LANTERN) q_ptr->xtra4 = FUEL_LAMP / 2;
3415 /* The item is "known" */
3416 object_known(q_ptr);
3418 /* Mark it storebought */
3419 q_ptr->ident |= IDENT_STORE;
3421 /* Mega-Hack -- no chests in stores */
3422 if (q_ptr->tval == TV_CHEST) continue;
3424 /* Prune the black market */
3425 if (cur_store_num == STORE_BLACK)
3427 /* Hack -- No "crappy" items */
3428 if (black_market_crap(q_ptr)) continue;
3430 /* Hack -- No "cheap" items */
3431 if (object_value(q_ptr) < 10) continue;
3433 /* No "worthless" items */
3434 /* if (object_value(q_ptr) <= 0) continue; */
3437 /* Prune normal stores */
3440 /* No "worthless" items */
3441 if (object_value(q_ptr) <= 0) continue;
3445 /* Mass produce and/or Apply discount */
3446 mass_produce(q_ptr);
3448 /* Attempt to carry the (known) item */
3449 (void)store_carry(q_ptr);
3451 /* Definitely done */
3458 * @brief 店舗の割引対象外にするかどうかを判定 /
3459 * Eliminate need to bargain if player has haggled well in the past
3460 * @param minprice アイテムの最低販売価格
3461 * @return 割引を禁止するならTRUEを返す。
3463 static bool noneedtobargain(PRICE minprice)
3465 s32b good = st_ptr->good_buy;
3466 s32b bad = st_ptr->bad_buy;
3468 /* Cheap items are "boring" */
3469 if (minprice < 10L) return (TRUE);
3471 /* Perfect haggling */
3472 if (good == MAX_SHORT) return (TRUE);
3474 /* Reward good haggles, punish bad haggles, notice price */
3475 if (good > ((3 * bad) + (5 + (minprice/50)))) return (TRUE);
3477 /* Return the flag */
3483 * @brief 店主の持つプレイヤーに対する売買の良し悪し経験を記憶する /
3484 * Update the bargain info
3485 * @param price 実際の取引価格
3486 * @param minprice 店主の提示した価格
3490 static void updatebargain(PRICE price, PRICE minprice, int num)
3492 /* Hack -- auto-haggle */
3493 if (!manual_haggle) return;
3495 /* Cheap items are "boring" */
3496 if ((minprice/num) < 10L) return;
3498 /* Count the successful haggles */
3499 if (price == minprice)
3501 /* Just count the good haggles */
3502 if (st_ptr->good_buy < MAX_SHORT)
3508 /* Count the failed haggles */
3511 /* Just count the bad haggles */
3512 if (st_ptr->bad_buy < MAX_SHORT)
3521 * @brief 店の商品リストを再表示する /
3522 * Re-displays a single store entry
3526 static void display_entry(int pos)
3532 GAME_TEXT o_name[MAX_NLEN];
3537 o_ptr = &st_ptr->stock[pos];
3539 /* Get the "offset" */
3540 i = (pos % store_bottom);
3542 /* Label it, clear the line --(-- */
3543 (void)sprintf(out_val, "%c) ", ((i > 25) ? toupper(I2A(i - 26)) : I2A(i)));
3544 prt(out_val, i+6, 0);
3547 if (show_item_graph)
3549 TERM_COLOR a = object_attr(o_ptr);
3550 SYMBOL_CODE c = object_char(o_ptr);
3552 Term_queue_bigchar(cur_col, i + 6, a, c, 0, 0);
3553 if (use_bigtile) cur_col++;
3558 /* Describe an item in the home */
3559 if ((cur_store_num == STORE_HOME) || (cur_store_num == STORE_MUSEUM))
3563 /* Leave room for weights, if necessary -DRS- */
3564 if (show_weights) maxwid -= 10;
3566 object_desc(o_name, o_ptr, 0);
3567 o_name[maxwid] = '\0';
3568 c_put_str(tval_to_attr[o_ptr->tval], o_name, i+6, cur_col);
3573 /* Only show the weight of an individual item */
3574 WEIGHT wgt = o_ptr->weight;
3576 sprintf(out_val, "%3d.%1d kg", lbtokg1(wgt) , lbtokg2(wgt));
3577 put_str(out_val, i+6, 67);
3579 (void)sprintf(out_val, "%3d.%d lb", wgt / 10, wgt % 10);
3580 put_str(out_val, i+6, 68);
3586 /* Describe an item (fully) in a store */
3589 /* Must leave room for the "price" */
3592 /* Leave room for weights, if necessary -DRS- */
3593 if (show_weights) maxwid -= 7;
3595 /* Describe the object (fully) */
3596 object_desc(o_name, o_ptr, 0);
3597 o_name[maxwid] = '\0';
3598 c_put_str(tval_to_attr[o_ptr->tval], o_name, i+6, cur_col);
3603 /* Only show the weight of an individual item */
3604 int wgt = o_ptr->weight;
3606 sprintf(out_val, "%3d.%1d", lbtokg1(wgt) , lbtokg2(wgt) );
3607 put_str(out_val, i+6, 60);
3609 (void)sprintf(out_val, "%3d.%d", wgt / 10, wgt % 10);
3610 put_str(out_val, i+6, 61);
3615 /* Display a "fixed" cost */
3616 if (o_ptr->ident & (IDENT_FIXED))
3618 /* Extract the "minimum" price */
3619 x = price_item(o_ptr, ot_ptr->min_inflate, FALSE);
3621 /* Actually draw the price (not fixed) */
3623 (void)sprintf(out_val, "%9ld固", (long)x);
3625 (void)sprintf(out_val, "%9ld F", (long)x);
3628 put_str(out_val, i+6, 68);
3631 /* Display a "taxed" cost */
3632 else if (!manual_haggle)
3634 /* Extract the "minimum" price */
3635 x = price_item(o_ptr, ot_ptr->min_inflate, FALSE);
3637 /* Hack -- Apply Sales Tax if needed */
3638 if (!noneedtobargain(x)) x += x / 10;
3640 /* Actually draw the price (with tax) */
3641 (void)sprintf(out_val, "%9ld ", (long)x);
3642 put_str(out_val, i+6, 68);
3645 /* Display a "haggle" cost */
3648 /* Extrect the "maximum" price */
3649 x = price_item(o_ptr, ot_ptr->max_inflate, FALSE);
3651 /* Actually draw the price (not fixed) */
3652 (void)sprintf(out_val, "%9ld ", (long)x);
3653 put_str(out_val, i+6, 68);
3660 * @brief 店の商品リストを表示する /
3661 * Displays a store's inventory -RAK-
3664 * All prices are listed as "per individual object". -BEN-
3666 static void display_inventory(void)
3670 /* Display the next 12 items */
3671 for (k = 0; k < store_bottom; k++)
3673 /* Do not display "dead" items */
3674 if (store_top + k >= st_ptr->stock_num) break;
3676 /* Display that line */
3677 display_entry(store_top + k);
3680 /* Erase the extra lines and the "more" prompt */
3681 for (i = k; i < store_bottom + 1; i++) prt("", i + 6, 0);
3683 /* Assume "no current page" */
3685 put_str(" ", 5, 20);
3687 put_str(" ", 5, 20);
3691 /* Visual reminder of "more items" */
3692 if (st_ptr->stock_num > store_bottom)
3694 /* Show "more" reminder (after the last item) */
3696 prt("-続く-", k + 6, 3);
3698 prt("-more-", k + 6, 3);
3702 /* Indicate the "current page" */
3703 /* Trailing spaces are to display (Page xx) and (Page x) */
3705 put_str(format("(%dページ) ", store_top/store_bottom + 1), 5, 20);
3707 put_str(format("(Page %d) ", store_top/store_bottom + 1), 5, 20);
3712 if (cur_store_num == STORE_HOME || cur_store_num == STORE_MUSEUM)
3714 k = st_ptr->stock_size;
3716 if (cur_store_num == STORE_HOME && !powerup_home) k /= 10;
3718 put_str(format("アイテム数: %4d/%4d", st_ptr->stock_num, k), 19 + xtra_stock, 27);
3720 put_str(format("Objects: %4d/%4d", st_ptr->stock_num, k), 19 + xtra_stock, 30);
3727 * @brief プレイヤーの所持金を表示する /
3728 * Displays players gold -RAK-
3732 static void store_prt_gold(void)
3737 prt("手持ちのお金: ", 19 + xtra_stock, 53);
3739 prt("Gold Remaining: ", 19 + xtra_stock, 53);
3743 sprintf(out_val, "%9ld", (long)p_ptr->au);
3744 prt(out_val, 19 + xtra_stock, 68);
3748 * @brief 店舗情報全体を表示するメインルーチン /
3749 * Displays store (after clearing screen) -RAK-
3753 static void display_store(void)
3759 /* The "Home" is special */
3760 if (cur_store_num == STORE_HOME)
3762 /* Put the owner name */
3763 put_str(_("我が家", "Your Home"), 3, 31);
3765 /* Label the item descriptions */
3766 put_str(_("アイテムの一覧", "Item Description"), 5, 4);
3768 /* If showing weights, show label */
3771 put_str(_(" 重さ", "Weight"), 5, 70);
3775 /* The "Home" is special */
3776 else if (cur_store_num == STORE_MUSEUM)
3778 /* Put the owner name */
3779 put_str(_("博物館", "Museum"), 3, 31);
3781 /* Label the item descriptions */
3782 put_str(_("アイテムの一覧", "Item Description"), 5, 4);
3784 /* If showing weights, show label */
3787 put_str(_(" 重さ", "Weight"), 5, 70);
3794 concptr store_name = (f_name + f_info[cur_store_feat].name);
3795 concptr owner_name = (ot_ptr->owner_name);
3796 concptr race_name = race_info[ot_ptr->owner_race].title;
3798 /* Put the owner name and race */
3799 sprintf(buf, "%s (%s)", owner_name, race_name);
3800 put_str(buf, 3, 10);
3802 /* Show the max price in the store (above prices) */
3803 sprintf(buf, "%s (%ld)", store_name, (long)(ot_ptr->max_cost));
3806 /* Label the item descriptions */
3807 put_str(_("商品の一覧", "Item Description"), 5, 5);
3810 /* If showing weights, show label */
3813 put_str(_(" 重さ", "Weight"), 5, 60);
3816 /* Label the asking price (in stores) */
3817 put_str(_(" 価格", "Price"), 5, 72);
3820 /* Display the current gold */
3823 /* Draw in the inventory */
3824 display_inventory();
3830 * @brief 店舗からアイテムを選択する /
3831 * Get the ID of a store item and return its value -RAK-
3832 * @param com_val 選択IDを返す参照ポインタ
3833 * @param pmt メッセージキャプション
3836 * @return 実際に選択したらTRUE、キャンセルしたらFALSE
3838 static int get_stock(COMMAND_CODE *com_val, concptr pmt, int i, int j)
3844 /* Get the item index */
3845 if (repeat_pull(com_val))
3847 /* Verify the item */
3848 if ((*com_val >= i) && (*com_val <= j))
3858 /* Assume failure */
3861 /* Build the prompt */
3863 hi = (j > 25) ? toupper(I2A(j - 26)) : I2A(j);
3865 (void)sprintf(out_val, "(%s:%c-%c, ESCで中断) %s",
3866 (((cur_store_num == STORE_HOME) || (cur_store_num == STORE_MUSEUM)) ? "アイテム" : "商品"),
3869 (void)sprintf(out_val, "(Items %c-%c, ESC to exit) %s",
3874 /* Ask until done */
3880 if (!get_com(out_val, &command, FALSE)) break;
3883 if (islower(command))
3885 else if (isupper(command))
3886 k = A2I(tolower(command)) + 26;
3890 /* Legal responses */
3891 if ((k >= i) && (k <= j))
3900 /* Clear the prompt */
3903 if (command == ESCAPE) return (FALSE);
3905 repeat_push(*com_val);
3913 * @brief 店主の不満度を増やし、プレイヤーを締め出す判定と処理を行う /
3914 * Increase the insult counter and get angry if too many -RAK-
3915 * @return プレイヤーを締め出す場合TRUEを返す
3917 static int increase_insults(void)
3919 /* Increase insults */
3920 st_ptr->insult_cur++;
3922 /* Become insulted */
3923 if (st_ptr->insult_cur > ot_ptr->insult_max)
3929 st_ptr->insult_cur = 0;
3930 st_ptr->good_buy = 0;
3931 st_ptr->bad_buy = 0;
3934 st_ptr->store_open = turn + TURNS_PER_TICK*TOWN_DAWN/8 + randint1(TURNS_PER_TICK*TOWN_DAWN/8);
3946 * @brief 店主の不満度を減らす /
3947 * Decrease insults -RAK-
3948 * @return プレイヤーを締め出す場合TRUEを返す
3950 static void decrease_insults(void)
3952 /* Decrease insults */
3953 if (st_ptr->insult_cur) st_ptr->insult_cur--;
3958 * @brief 店主の不満度が増えた場合のみのメッセージを表示する /
3959 * Have insulted while haggling -RAK-
3960 * @return プレイヤーを締め出す場合TRUEを返す
3962 static int haggle_insults(void)
3964 /* Increase insults */
3965 if (increase_insults()) return (TRUE);
3967 /* Display and flush insult */
3976 * Mega-Hack -- Enable "increments"
3978 static bool allow_inc = FALSE;
3981 * Mega-Hack -- Last "increment" during haggling
3983 static s32b last_inc = 0L;
3987 * @brief 交渉価格を確認と認証の是非を行う /
3990 * @param poffer 別途価格提示をした場合の値を返す参照ポインタ
3991 * @param price 現在の交渉価格
3992 * @param final 最終確定価格ならばTRUE
3993 * @return プレイヤーを締め出す場合TRUEを返す
3995 static int get_haggle(concptr pmt, s32b *poffer, PRICE price, int final)
4005 /* Clear old increment if necessary */
4006 if (!allow_inc) last_inc = 0L;
4013 sprintf(buf, "%s [承諾] ", pmt);
4015 sprintf(buf, "%s [accept] ", pmt);
4020 /* Old (negative) increment, and not final */
4021 else if (last_inc < 0)
4024 sprintf(buf, "%s [-$%ld] ", pmt, (long)(ABS(last_inc)));
4026 sprintf(buf, "%s [-%ld] ", pmt, (long)(ABS(last_inc)));
4031 /* Old (positive) increment, and not final */
4032 else if (last_inc > 0)
4035 sprintf(buf, "%s [+$%ld] ", pmt, (long)(ABS(last_inc)));
4037 sprintf(buf, "%s [+%ld] ", pmt, (long)(ABS(last_inc)));
4045 sprintf(buf, "%s ", pmt);
4053 /* Ask until done */
4058 /* Display prompt */
4062 strcpy(out_val, "");
4065 * Ask the user for a response.
4066 * Don't allow to use numpad as cursor key.
4068 res = askfor_aux(out_val, 32, FALSE);
4074 if (!res) return FALSE;
4076 /* Skip leading spaces */
4077 for (p = out_val; *p == ' '; p++) /* loop */;
4079 /* Empty response */
4082 /* Accept current price */
4090 /* Use previous increment */
4091 if (allow_inc && last_inc)
4093 *poffer += last_inc;
4098 /* Normal response */
4101 /* Extract a number */
4104 /* Handle "incremental" number */
4105 if ((*p == '+' || *p == '-'))
4107 /* Allow increments */
4110 /* Use the given "increment" */
4117 /* Handle normal number */
4120 /* Use the given "number" */
4129 msg_print("値がおかしいです。");
4131 msg_print("Invalid response.");
4143 * @brief 店主がプレイヤーからの交渉価格を判断する /
4144 * Receive an offer (from the player)
4146 * @param poffer 店主からの交渉価格を返す参照ポインタ
4147 * @param last_offer 現在の交渉価格
4148 * @param factor 店主の価格基準倍率
4149 * @param price アイテムの実価値
4150 * @param final 最終価格確定ならばTRUE
4151 * @return プレイヤーの価格に対して不服ならばTRUEを返す /
4152 * Return TRUE if offer is NOT okay
4154 static bool receive_offer(concptr pmt, s32b *poffer,
4155 s32b last_offer, int factor,
4156 PRICE price, int final)
4158 /* Haggle till done */
4161 /* Get a haggle (or cancel) */
4162 if (!get_haggle(pmt, poffer, price, final)) return (TRUE);
4164 /* Acceptable offer */
4165 if (((*poffer) * factor) >= (last_offer * factor)) break;
4167 /* Insult, and check for kicked out */
4168 if (haggle_insults()) return (TRUE);
4170 /* Reject offer (correctly) */
4171 (*poffer) = last_offer;
4180 * @brief プレイヤーが購入する時の値切り処理メインルーチン /
4181 * Haggling routine -RAK-
4182 * @param o_ptr オブジェクトの構造体参照ポインタ
4183 * @param price 最終価格を返す参照ポインタ
4184 * @return プレイヤーの価格に対して店主が不服ならばTRUEを返す /
4185 * Return TRUE if purchase is NOT successful
4187 static bool purchase_haggle(object_type *o_ptr, s32b *price)
4189 s32b cur_ask, final_ask;
4190 s32b last_offer, offer;
4192 s32b min_per, max_per;
4193 int flag, loop_flag, noneed;
4194 int annoyed = 0, final = FALSE;
4196 bool cancel = FALSE;
4199 concptr pmt = "提示価格";
4201 concptr pmt = "Asking";
4211 /* Extract the starting offer and the final offer */
4212 cur_ask = price_item(o_ptr, ot_ptr->max_inflate, FALSE);
4213 final_ask = price_item(o_ptr, ot_ptr->min_inflate, FALSE);
4215 /* Determine if haggling is necessary */
4216 noneed = noneedtobargain(final_ask);
4218 /* No need to haggle */
4219 if (noneed || !manual_haggle)
4221 /* No need to haggle */
4224 /* Message summary */
4226 msg_print("結局この金額にまとまった。");
4228 msg_print("You eventually agree upon the price.");
4234 /* No haggle option */
4237 /* Message summary */
4239 msg_print("すんなりとこの金額にまとまった。");
4241 msg_print("You quickly agree upon the price.");
4246 /* Apply Sales Tax */
4247 final_ask += final_ask / 10;
4251 cur_ask = final_ask;
4253 /* Go to final offer */
4257 pmt = "Final Offer";
4264 /* Haggle for the whole pile */
4265 cur_ask *= o_ptr->number;
4266 final_ask *= o_ptr->number;
4269 /* Haggle parameters */
4270 min_per = ot_ptr->haggle_per;
4271 max_per = min_per * 3;
4273 /* Mega-Hack -- artificial "last offer" value */
4274 last_offer = object_value(o_ptr) * o_ptr->number;
4275 last_offer = last_offer * (200 - (int)(ot_ptr->max_inflate)) / 100L;
4276 if (last_offer <= 0) last_offer = 1;
4281 /* No incremental haggling yet */
4284 /* Haggle until done */
4285 for (flag = FALSE; !flag; )
4289 while (!flag && loop_flag)
4291 (void)sprintf(out_val, "%s : %ld", pmt, (long)cur_ask);
4292 put_str(out_val, 1, 0);
4294 cancel = receive_offer("提示する金額? ",
4296 cancel = receive_offer("What do you offer? ",
4299 &offer, last_offer, 1, cur_ask, final);
4305 else if (offer > cur_ask)
4310 else if (offer == cur_ask)
4323 x1 = 100 * (offer - last_offer) / (cur_ask - last_offer);
4326 if (haggle_insults())
4332 else if (x1 > max_per)
4335 if (x1 < max_per) x1 = max_per;
4337 x2 = rand_range(x1-2, x1+2);
4338 x3 = ((cur_ask - offer) * x2 / 100L) + 1;
4339 /* don't let the price go up */
4344 if (cur_ask < final_ask)
4347 cur_ask = final_ask;
4351 pmt = "Final Offer";
4357 (void)(increase_insults());
4362 else if (offer >= cur_ask)
4374 (void)sprintf(out_val, "前回の提示金額: $%ld",
4376 (void)sprintf(out_val, "Your last offer: %ld",
4380 put_str(out_val, 1, 39);
4381 say_comment_2(cur_ask, annoyed);
4386 if (cancel) return (TRUE);
4388 updatebargain(*price, final_ask, o_ptr->number);
4396 * @brief プレイヤーが売却する時の値切り処理メインルーチン /
4397 * Haggling routine -RAK-
4398 * @param o_ptr オブジェクトの構造体参照ポインタ
4399 * @param price 最終価格を返す参照ポインタ
4400 * @return プレイヤーの価格に対して店主が不服ならばTRUEを返す /
4401 * Return TRUE if purchase is NOT successful
4403 static bool sell_haggle(object_type *o_ptr, s32b *price)
4405 s32b purse, cur_ask, final_ask;
4406 s32b last_offer = 0, offer = 0;
4408 s32b min_per, max_per;
4409 int flag, loop_flag, noneed;
4410 int annoyed = 0, final = FALSE;
4411 bool cancel = FALSE;
4413 concptr pmt = "提示金額";
4415 concptr pmt = "Offer";
4424 /* Obtain the starting offer and the final offer */
4425 cur_ask = price_item(o_ptr, ot_ptr->max_inflate, TRUE);
4426 final_ask = price_item(o_ptr, ot_ptr->min_inflate, TRUE);
4428 /* Determine if haggling is necessary */
4429 noneed = noneedtobargain(final_ask);
4431 /* Get the owner's payout limit */
4432 purse = (s32b)(ot_ptr->max_cost);
4434 /* No need to haggle */
4435 if (noneed || !manual_haggle || (final_ask >= purse))
4437 /* Apply Sales Tax (if needed) */
4438 if (!manual_haggle && !noneed)
4440 final_ask -= final_ask / 10;
4443 /* No reason to haggle */
4444 if (final_ask >= purse)
4447 msg_print("即座にこの金額にまとまった。");
4449 msg_print("You instantly agree upon the price.");
4454 /* Offer full purse */
4458 /* No need to haggle */
4462 msg_print("結局この金額にまとまった。");
4464 msg_print("You eventually agree upon the price.");
4470 /* No haggle option */
4473 /* Message summary */
4475 msg_print("すんなりとこの金額にまとまった。");
4477 msg_print("You quickly agree upon the price.");
4484 cur_ask = final_ask;
4491 pmt = "Final Offer";
4496 /* Haggle for the whole pile */
4497 cur_ask *= o_ptr->number;
4498 final_ask *= o_ptr->number;
4501 /* Display commands */
4503 /* Haggling parameters */
4504 min_per = ot_ptr->haggle_per;
4505 max_per = min_per * 3;
4507 /* Mega-Hack -- artificial "last offer" value */
4508 last_offer = object_value(o_ptr) * o_ptr->number;
4509 last_offer = last_offer * ot_ptr->max_inflate / 100L;
4514 /* No incremental haggling yet */
4518 for (flag = FALSE; !flag; )
4524 (void)sprintf(out_val, "%s : %ld", pmt, (long)cur_ask);
4525 put_str(out_val, 1, 0);
4527 cancel = receive_offer("提示する価格? ",
4529 cancel = receive_offer("What price do you ask? ",
4532 &offer, last_offer, -1, cur_ask, final);
4538 else if (offer < cur_ask)
4541 /* rejected, reset offer for incremental haggling */
4544 else if (offer == cur_ask)
4555 if (flag || !loop_flag) break;
4560 x1 = 100 * (last_offer - offer) / (last_offer - cur_ask);
4563 if (haggle_insults())
4569 else if (x1 > max_per)
4572 if (x1 < max_per) x1 = max_per;
4574 x2 = rand_range(x1-2, x1+2);
4575 x3 = ((offer - cur_ask) * x2 / 100L) + 1;
4576 /* don't let the price go down */
4580 if (cur_ask > final_ask)
4582 cur_ask = final_ask;
4587 pmt = "Final Offer";
4595 /* 追加 $0 で買い取られてしまうのを防止 By FIRST*/
4598 (void)(increase_insults());
4601 else if (offer <= cur_ask)
4612 (void)sprintf(out_val,
4614 "前回の提示価格 $%ld", (long)last_offer);
4616 "Your last bid %ld", (long)last_offer);
4619 put_str(out_val, 1, 39);
4620 say_comment_3(cur_ask, annoyed);
4625 if (cancel) return (TRUE);
4627 updatebargain(*price, final_ask, o_ptr->number);
4635 * @brief 店からの購入処理のメインルーチン /
4636 * Buy an item from a store -RAK-
4639 static void store_purchase(void)
4642 COMMAND_CODE item, item_new;
4653 GAME_TEXT o_name[MAX_NLEN];
4657 if (cur_store_num == STORE_MUSEUM)
4660 msg_print("博物館から取り出すことはできません。");
4662 msg_print("Museum.");
4668 if (st_ptr->stock_num <= 0)
4670 if (cur_store_num == STORE_HOME)
4672 msg_print("我が家には何も置いてありません。");
4674 msg_print("Your home is empty.");
4679 msg_print("現在商品の在庫を切らしています。");
4681 msg_print("I am currently out of stock.");
4688 /* Find the number of objects on this and following pages */
4689 i = (st_ptr->stock_num - store_top);
4691 /* And then restrict it to the current page */
4692 if (i > store_bottom) i = store_bottom;
4696 /* ブラックマーケットの時は別のメッセージ */
4697 switch( cur_store_num ) {
4699 sprintf(out_val, "どのアイテムを取りますか? ");
4702 sprintf(out_val, "どれ? ");
4705 sprintf(out_val, "どの品物が欲しいんだい? ");
4709 if (cur_store_num == STORE_HOME)
4711 sprintf(out_val, "Which item do you want to take? ");
4715 sprintf(out_val, "Which item are you interested in? ");
4720 /* Get the item number to be bought */
4721 if (!get_stock(&item, out_val, 0, i - 1)) return;
4723 /* Get the actual index */
4724 item = item + store_top;
4726 /* Get the actual item */
4727 o_ptr = &st_ptr->stock[item];
4729 /* Assume the player wants just one of them */
4733 /* Get a copy of the object */
4734 object_copy(j_ptr, o_ptr);
4737 * If a rod or wand, allocate total maximum timeouts or charges
4738 * between those purchased and left on the shelf.
4740 reduce_charges(j_ptr, o_ptr->number - amt);
4742 /* Modify quantity */
4743 j_ptr->number = amt;
4745 /* Hack -- require room in pack */
4746 if (!inven_carry_okay(j_ptr))
4748 msg_print(_("そんなにアイテムを持てない。", "You cannot carry that many different items."));
4752 /* Determine the "best" price (per item) */
4753 best = price_item(j_ptr, ot_ptr->min_inflate, FALSE);
4755 /* Find out how many the player wants */
4756 if (o_ptr->number > 1)
4758 /* Hack -- note cost of "fixed" items */
4759 if ((cur_store_num != STORE_HOME) &&
4760 (o_ptr->ident & IDENT_FIXED))
4762 msg_format(_("一つにつき $%ldです。", "That costs %ld gold per item."), (long)(best));
4765 /* Get a quantity */
4766 amt = get_quantity(NULL, o_ptr->number);
4768 /* Allow user abort */
4769 if (amt <= 0) return;
4773 /* Get desired object */
4774 object_copy(j_ptr, o_ptr);
4777 * If a rod or wand, allocate total maximum timeouts or charges
4778 * between those purchased and left on the shelf.
4780 reduce_charges(j_ptr, o_ptr->number - amt);
4782 /* Modify quantity */
4783 j_ptr->number = amt;
4785 /* Hack -- require room in pack */
4786 if (!inven_carry_okay(j_ptr))
4788 msg_print(_("ザックにそのアイテムを入れる隙間がない。", "You cannot carry that many items."));
4792 /* Attempt to buy it */
4793 if (cur_store_num != STORE_HOME)
4795 /* Fixed price, quick buy */
4796 if (o_ptr->ident & (IDENT_FIXED))
4801 /* Go directly to the "best" deal */
4802 price = (best * j_ptr->number);
4808 /* Describe the object (fully) */
4809 object_desc(o_name, j_ptr, 0);
4810 msg_format(_("%s(%c)を購入する。", "Buying %s (%c)."), o_name, I2A(item));
4813 /* Haggle for a final price */
4814 choice = purchase_haggle(j_ptr, &price);
4816 /* Hack -- Got kicked out */
4817 if (st_ptr->store_open >= turn) return;
4820 /* Player wants it */
4823 /* Fix the item price (if "correctly" haggled) */
4824 if (price == (best * j_ptr->number)) o_ptr->ident |= (IDENT_FIXED);
4826 /* Player can afford it */
4827 if (p_ptr->au >= price)
4832 if (cur_store_num == STORE_BLACK) /* The black market is illegal! */
4833 chg_virtue(V_JUSTICE, -1);
4834 if((o_ptr->tval == TV_BOTTLE) && (cur_store_num != STORE_HOME))
4835 chg_virtue(V_NATURE, -1);
4843 /* Spend the money */
4846 /* Update the display */
4849 /* Hack -- buying an item makes you aware of it */
4850 object_aware(j_ptr);
4852 /* Hack -- clear the "fixed" flag from the item */
4853 j_ptr->ident &= ~(IDENT_FIXED);
4855 /* Describe the transaction */
4856 object_desc(o_name, j_ptr, 0);
4858 msg_format(_("%sを $%ldで購入しました。", "You bought %s for %ld gold."), o_name, (long)price);
4860 strcpy(record_o_name, o_name);
4863 if (record_buy) do_cmd_write_nikki(NIKKI_BUY, 0, o_name);
4864 object_desc(o_name, o_ptr, OD_NAME_ONLY);
4865 if(record_rand_art && o_ptr->art_name)
4866 do_cmd_write_nikki(NIKKI_ART, 0, o_name);
4868 /* Erase the inscription */
4869 j_ptr->inscription = 0;
4871 /* Erase the "feeling" */
4872 j_ptr->feeling = FEEL_NONE;
4873 j_ptr->ident &= ~(IDENT_STORE);
4874 /* Give it to the player */
4875 item_new = inven_carry(j_ptr);
4877 /* Describe the final result */
4878 object_desc(o_name, &inventory[item_new], 0);
4879 msg_format(_("%s(%c)を手に入れた。", "You have %s (%c)."), o_name, index_to_label(item_new));
4881 /* Auto-inscription */
4882 autopick_alter_item(item_new, FALSE);
4884 /* Now, reduce the original stack's pval. */
4885 if ((o_ptr->tval == TV_ROD) || (o_ptr->tval == TV_WAND))
4887 o_ptr->pval -= j_ptr->pval;
4891 /* Note how many slots the store used to have */
4892 i = st_ptr->stock_num;
4894 /* Remove the bought items from the store */
4895 store_item_increase(item, -amt);
4896 store_item_optimize(item);
4898 /* Store is empty */
4899 if (st_ptr->stock_num == 0)
4902 if (one_in_(STORE_SHUFFLE))
4905 msg_print(_("店主は引退した。", "The shopkeeper retires."));
4907 /* Shuffle the store */
4908 store_shuffle(cur_store_num);
4911 sprintf(buf, "%s (%s)",
4912 ot_ptr->owner_name, race_info[ot_ptr->owner_race].title);
4913 put_str(buf, 3, 10);
4914 sprintf(buf, "%s (%ld)",
4915 (f_name + f_info[cur_store_feat].name), (long)(ot_ptr->max_cost));
4922 msg_print(_("店主は新たな在庫を取り出した。", "The shopkeeper brings out some new stock."));
4926 for (i = 0; i < 10; i++)
4928 /* Maintain the store */
4929 store_maint(p_ptr->town_num, cur_store_num);
4934 display_inventory();
4937 /* The item is gone */
4938 else if (st_ptr->stock_num != i)
4940 /* Pick the correct screen */
4941 if (store_top >= st_ptr->stock_num) store_top -= store_bottom;
4942 display_inventory();
4945 /* Item is still here */
4948 /* Redraw the item */
4949 display_entry(item);
4953 /* Player cannot afford it */
4956 /* Simple message (no insult) */
4957 msg_print(_("お金が足りません。", "You do not have enough gold."));
4962 /* Home is much easier */
4965 bool combined_or_reordered;
4967 /* Distribute charges of wands/rods */
4968 distribute_charges(o_ptr, j_ptr, amt);
4970 /* Give it to the player */
4971 item_new = inven_carry(j_ptr);
4973 /* Describe just the result */
4974 object_desc(o_name, &inventory[item_new], 0);
4976 msg_format(_("%s(%c)を取った。", "You have %s (%c)."), o_name, index_to_label(item_new));
4979 /* Take note if we take the last one */
4980 i = st_ptr->stock_num;
4982 /* Remove the items from the home */
4983 store_item_increase(item, -amt);
4984 store_item_optimize(item);
4986 combined_or_reordered = combine_and_reorder_home(STORE_HOME);
4988 /* Hack -- Item is still here */
4989 if (i == st_ptr->stock_num)
4991 if (combined_or_reordered) display_inventory();
4993 /* Redraw the item */
4994 else display_entry(item);
4997 /* The item is gone */
5001 if (st_ptr->stock_num == 0) store_top = 0;
5003 /* Nothing left on that screen */
5004 else if (store_top >= st_ptr->stock_num) store_top -= store_bottom;
5005 display_inventory();
5007 chg_virtue(V_SACRIFICE, 1);
5011 /* Not kicked out */
5017 * @brief 店からの売却処理のメインルーチン /
5018 * Sell an item to the store (or home)
5021 static void store_sell(void)
5028 PRICE price, value, dummy;
5037 GAME_TEXT o_name[MAX_NLEN];
5040 /* Prepare a prompt */
5041 if (cur_store_num == STORE_HOME)
5042 q = _("どのアイテムを置きますか? ", "Drop which item? ");
5044 else if (cur_store_num == STORE_MUSEUM)
5045 q = _("どのアイテムを寄贈しますか? ", "Give which item? ");
5048 q = _("どのアイテムを売りますか? ", "Sell which item? ");
5050 /* Only allow items the store will buy */
5051 item_tester_hook = store_will_buy;
5053 /* 我が家でおかしなメッセージが出るオリジナルのバグを修正 */
5054 if (cur_store_num == STORE_HOME)
5056 s = _("置けるアイテムを持っていません。", "You don't have any item to drop.");
5058 else if (cur_store_num == STORE_MUSEUM)
5060 s = _("寄贈できるアイテムを持っていません。", "You don't have any item to give.");
5064 s = _("欲しい物がないですねえ。", "You have nothing that I want.");
5067 o_ptr = choose_object(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT));
5070 /* Hack -- Cannot remove cursed items */
5071 if ((item >= INVEN_RARM) && object_is_cursed(o_ptr))
5073 msg_print(_("ふーむ、どうやらそれは呪われているようだね。", "Hmmm, it seems to be cursed."));
5077 /* Assume one item */
5080 /* Find out how many the player wants (letter means "all") */
5081 if (o_ptr->number > 1)
5083 /* Get a quantity */
5084 amt = get_quantity(NULL, o_ptr->number);
5086 /* Allow user abort */
5087 if (amt <= 0) return;
5091 /* Get a copy of the object */
5092 object_copy(q_ptr, o_ptr);
5094 /* Modify quantity */
5095 q_ptr->number = amt;
5098 * Hack -- If a rod or wand, allocate total maximum
5099 * timeouts or charges to those being sold. -LM-
5101 if ((o_ptr->tval == TV_ROD) || (o_ptr->tval == TV_WAND))
5103 q_ptr->pval = o_ptr->pval * amt / o_ptr->number;
5106 /* Get a full description */
5107 object_desc(o_name, q_ptr, 0);
5109 /* Remove any inscription, feeling for stores */
5110 if ((cur_store_num != STORE_HOME) && (cur_store_num != STORE_MUSEUM))
5112 q_ptr->inscription = 0;
5113 q_ptr->feeling = FEEL_NONE;
5116 /* Is there room in the store (or the home?) */
5117 if (!store_check_num(q_ptr))
5119 if (cur_store_num == STORE_HOME)
5120 msg_print(_("我が家にはもう置く場所がない。", "Your home is full."));
5122 else if (cur_store_num == STORE_MUSEUM)
5123 msg_print(_("博物館はもう満杯だ。", "Museum is full."));
5126 msg_print(_("すいませんが、店にはもう置く場所がありません。", "I have not the room in my store to keep it."));
5133 if ((cur_store_num != STORE_HOME) && (cur_store_num != STORE_MUSEUM))
5135 /* Describe the transaction */
5136 msg_format(_("%s(%c)を売却する。", "Selling %s (%c)."), o_name, index_to_label(item));
5141 choice = sell_haggle(q_ptr, &price);
5144 if (st_ptr->store_open >= turn) return;
5156 if (cur_store_num == STORE_BLACK) /* The black market is illegal! */
5157 chg_virtue(V_JUSTICE, -1);
5159 if((o_ptr->tval == TV_BOTTLE) && (cur_store_num != STORE_HOME))
5160 chg_virtue(V_NATURE, 1);
5163 /* Get some money */
5166 /* Update the display */
5169 /* Get the "apparent" value */
5170 dummy = object_value(q_ptr) * q_ptr->number;
5172 identify_item(o_ptr);
5175 /* Get a copy of the object */
5176 object_copy(q_ptr, o_ptr);
5178 /* Modify quantity */
5179 q_ptr->number = amt;
5181 /* Make it look like to be known */
5182 q_ptr->ident |= IDENT_STORE;
5185 * Hack -- If a rod or wand, let the shopkeeper know just
5186 * how many charges he really paid for. -LM-
5188 if ((o_ptr->tval == TV_ROD) || (o_ptr->tval == TV_WAND))
5190 q_ptr->pval = o_ptr->pval * amt / o_ptr->number;
5193 /* Get the "actual" value */
5194 value = object_value(q_ptr) * q_ptr->number;
5196 /* Get the description all over again */
5197 object_desc(o_name, q_ptr, 0);
5199 /* Describe the result (in message buffer) */
5200 msg_format(_("%sを $%ldで売却しました。", "You sold %s for %ld gold."), o_name, (long)price);
5202 if (record_sell) do_cmd_write_nikki(NIKKI_SELL, 0, o_name);
5204 if (!((o_ptr->tval == TV_FIGURINE) && (value > 0)))
5206 /* Analyze the prices (and comment verbally) unless a figurine*/
5207 purchase_analyze(price, value, dummy);
5211 * Hack -- Allocate charges between those wands or rods sold
5212 * and retained, unless all are being sold. -LM-
5214 distribute_charges(o_ptr, q_ptr, amt);
5216 /* Reset timeouts of the sold items */
5219 /* Take the item from the player, describe the result */
5220 inven_item_increase(item, -amt);
5221 inven_item_describe(item);
5223 /* If items remain, auto-inscribe before optimizing */
5224 if (o_ptr->number > 0)
5225 autopick_alter_item(item, FALSE);
5227 inven_item_optimize(item);
5230 /* The store gets that (known) item */
5231 item_pos = store_carry(q_ptr);
5233 /* Re-display if item is now in store */
5236 store_top = (item_pos / store_bottom) * store_bottom;
5237 display_inventory();
5242 /* Player is at museum */
5243 else if (cur_store_num == STORE_MUSEUM)
5245 char o2_name[MAX_NLEN];
5246 object_desc(o2_name, q_ptr, OD_NAME_ONLY);
5248 if (-1 == store_check_num(q_ptr))
5250 msg_print(_("それと同じ品物は既に博物館にあるようです。", "The same object as it is already in the Museum."));
5254 msg_print(_("博物館に寄贈したものは取り出すことができません!!", "You cannot take items which is given to the Museum back!!"));
5257 if (!get_check(format(_("本当に%sを寄贈しますか?", "Really give %s to the Museum? "), o2_name))) return;
5259 identify_item(q_ptr);
5260 q_ptr->ident |= IDENT_MENTAL;
5262 /* Distribute charges of wands/rods */
5263 distribute_charges(o_ptr, q_ptr, amt);
5264 msg_format(_("%sを置いた。(%c)", "You drop %s (%c)."), o_name, index_to_label(item));
5267 /* Take it from the players inventory */
5268 inven_item_increase(item, -amt);
5269 inven_item_describe(item);
5270 inven_item_optimize(item);
5273 /* Let the home carry it */
5274 item_pos = home_carry(q_ptr);
5276 /* Update store display */
5279 store_top = (item_pos / store_bottom) * store_bottom;
5280 display_inventory();
5283 /* Player is at home */
5286 /* Distribute charges of wands/rods */
5287 distribute_charges(o_ptr, q_ptr, amt);
5288 msg_format(_("%sを置いた。(%c)", "You drop %s (%c)."), o_name, index_to_label(item));
5292 /* Take it from the players inventory */
5293 inven_item_increase(item, -amt);
5294 inven_item_describe(item);
5295 inven_item_optimize(item);
5298 /* Let the home carry it */
5299 item_pos = home_carry(q_ptr);
5301 /* Update store display */
5304 store_top = (item_pos / store_bottom) * store_bottom;
5305 display_inventory();
5309 if ((choice == 0) && (item >= INVEN_RARM))
5318 * @brief 店のアイテムを調べるコマンドのメインルーチン /
5319 * Examine an item in a store -JDL-
5322 static void store_examine(void)
5327 GAME_TEXT o_name[MAX_NLEN];
5331 if (st_ptr->stock_num <= 0)
5333 if (cur_store_num == STORE_HOME)
5334 msg_print(_("我が家には何も置いてありません。", "Your home is empty."));
5335 else if (cur_store_num == STORE_MUSEUM)
5336 msg_print(_("博物館には何も置いてありません。", "Museum is empty."));
5338 msg_print(_("現在商品の在庫を切らしています。", "I am currently out of stock."));
5342 /* Find the number of objects on this and following pages */
5343 i = (st_ptr->stock_num - store_top);
5345 /* And then restrict it to the current page */
5346 if (i > store_bottom) i = store_bottom;
5349 sprintf(out_val, _("どれを調べますか?", "Which item do you want to examine? "));
5351 /* Get the item number to be examined */
5352 if (!get_stock(&item, out_val, 0, i - 1)) return;
5354 /* Get the actual index */
5355 item = item + store_top;
5357 /* Get the actual item */
5358 o_ptr = &st_ptr->stock[item];
5360 /* Require full knowledge */
5361 if (!(o_ptr->ident & IDENT_MENTAL))
5363 /* This can only happen in the home */
5364 msg_print(_("このアイテムについて特に知っていることはない。", "You have no special knowledge about that item."));
5368 object_desc(o_name, o_ptr, 0);
5369 msg_format(_("%sを調べている...", "Examining %s..."), o_name);
5371 if (!screen_object(o_ptr, SCROBJ_FORCE_DETAIL))
5372 msg_print(_("特に変わったところはないようだ。", "You see nothing special."));
5379 * @brief 博物館のアイテムを除去するコマンドのメインルーチン /
5380 * Remove an item from museum (Originally from TOband)
5383 static void museum_remove_object(void)
5388 GAME_TEXT o_name[MAX_NLEN];
5392 if (st_ptr->stock_num <= 0)
5394 msg_print(_("博物館には何も置いてありません。", "Museum is empty."));
5398 /* Find the number of objects on this and following pages */
5399 i = st_ptr->stock_num - store_top;
5401 /* And then restrict it to the current page */
5402 if (i > store_bottom) i = store_bottom;
5405 sprintf(out_val, _("どのアイテムの展示をやめさせますか?", "Which item do you want to order to remove? "));
5407 /* Get the item number to be removed */
5408 if (!get_stock(&item, out_val, 0, i - 1)) return;
5410 /* Get the actual index */
5411 item = item + store_top;
5413 /* Get the actual item */
5414 o_ptr = &st_ptr->stock[item];
5416 object_desc(o_name, o_ptr, 0);
5418 msg_print(_("展示をやめさせたアイテムは二度と見ることはできません!", "You cannot see items which is removed from the Museum!"));
5419 if (!get_check(format(_("本当に%sの展示をやめさせますか?", "Really order to remove %s from the Museum? "), o_name))) return;
5421 msg_format(_("%sの展示をやめさせた。", "You ordered to remove %s."), o_name);
5423 /* Remove the items from the home */
5424 store_item_increase(item, -o_ptr->number);
5425 store_item_optimize(item);
5427 (void)combine_and_reorder_home(STORE_MUSEUM);
5429 /* The item is gone */
5432 if (st_ptr->stock_num == 0) store_top = 0;
5434 /* Nothing left on that screen */
5435 else if (store_top >= st_ptr->stock_num) store_top -= store_bottom;
5436 display_inventory();
5443 * Hack -- set this to leave the store
5445 static bool leave_store = FALSE;
5449 * @brief 店舗処理コマンド選択のメインルーチン /
5450 * Process a command in a store
5454 * Note that we must allow the use of a few "special" commands
5455 * in the stores which are not allowed in the dungeon, and we
5456 * must disable some commands which are allowed in the dungeon
5457 * but not in the stores, to prevent chaos.
5460 static void store_process_command(void)
5462 /* Handle repeating the last command */
5465 if (rogue_like_commands && command_cmd == 'l')
5467 command_cmd = 'x'; /* hack! */
5470 /* Parse the command */
5471 switch (command_cmd)
5481 /* 1 ページ戻るコマンド: 我が家のページ数が多いので重宝するはず By BUG */
5484 if (st_ptr->stock_num <= store_bottom) {
5485 msg_print(_("これで全部です。", "Entire inventory is shown."));
5488 store_top -= store_bottom;
5489 if ( store_top < 0 )
5490 store_top = ((st_ptr->stock_num - 1 )/store_bottom) * store_bottom;
5491 if ( (cur_store_num == STORE_HOME) && (powerup_home == FALSE) )
5492 if ( store_top >= store_bottom ) store_top = store_bottom;
5493 display_inventory();
5501 if (st_ptr->stock_num <= store_bottom)
5503 msg_print(_("これで全部です。", "Entire inventory is shown."));
5507 store_top += store_bottom;
5509 * 隠しオプション(powerup_home)がセットされていないときは
5510 * 我が家では 2 ページまでしか表示しない
5512 if ((cur_store_num == STORE_HOME) &&
5513 (powerup_home == FALSE) &&
5514 (st_ptr->stock_num >= STORE_INVEN_MAX))
5516 if (store_top >= (STORE_INVEN_MAX - 1))
5523 if (store_top >= st_ptr->stock_num) store_top = 0;
5526 display_inventory();
5538 /* Get (purchase) */
5565 /*** Inventory Commands ***/
5567 /* Wear/wield equipment */
5574 /* Take off equipment */
5581 /* Destroy an item */
5588 /* Equipment list */
5595 /* Inventory list */
5603 /*** Various commands ***/
5605 /* Identify an object */
5612 /* Hack -- toggle windows */
5615 toggle_inven_equip();
5619 /*** Use various objects ***/
5624 if ( (p_ptr->pclass == CLASS_MINDCRAFTER) ||
5625 (p_ptr->pclass == CLASS_BERSERKER) ||
5626 (p_ptr->pclass == CLASS_NINJA) ||
5627 (p_ptr->pclass == CLASS_MIRROR_MASTER)
5628 ) do_cmd_mind_browse();
5629 else if (p_ptr->pclass == CLASS_SMITH)
5631 else if (p_ptr->pclass == CLASS_MAGIC_EATER)
5632 do_cmd_magic_eater(TRUE, FALSE);
5633 else if (p_ptr->pclass == CLASS_SNIPER)
5634 do_cmd_snipe_browse();
5635 else do_cmd_browse();
5639 /* Inscribe an object */
5646 /* Uninscribe an object */
5649 do_cmd_uninscribe();
5655 /*** Help and Such ***/
5664 /* Identify symbol */
5667 do_cmd_query_symbol();
5671 /* Character description */
5674 p_ptr->town_num = old_town_num;
5675 do_cmd_change_name();
5676 p_ptr->town_num = inner_town_num;
5682 /*** System Commands ***/
5684 /* Hack -- User interface */
5691 /* Single line from a pref file */
5694 p_ptr->town_num = old_town_num;
5696 p_ptr->town_num = inner_town_num;
5700 /* Interact with macros */
5703 p_ptr->town_num = old_town_num;
5705 p_ptr->town_num = inner_town_num;
5709 /* Interact with visuals */
5712 p_ptr->town_num = old_town_num;
5714 p_ptr->town_num = inner_town_num;
5718 /* Interact with colors */
5721 p_ptr->town_num = old_town_num;
5723 p_ptr->town_num = inner_town_num;
5727 /* Interact with options */
5731 (void)combine_and_reorder_home(STORE_HOME);
5737 /*** Misc Commands ***/
5753 /* Repeat level feeling */
5760 /* Show previous message */
5763 do_cmd_message_one();
5767 /* Show previous messages */
5780 /* Check artifacts, uniques etc. */
5787 /* Load "screen dump" */
5790 do_cmd_load_screen();
5794 /* Save "screen dump" */
5797 do_cmd_save_screen();
5801 /* Hack -- Unknown command */
5804 if ((cur_store_num == STORE_MUSEUM) && (command_cmd == 'r'))
5806 museum_remove_object();
5810 msg_print(_("そのコマンドは店の中では使えません。", "That command does not work in stores."));
5819 * @brief 店舗処理全体のメインルーチン /
5820 * Enter a store, and interact with it. *
5824 * Note that we use the standard "request_command()" function
5825 * to get a command, allowing us to use "command_arg" and all
5826 * command macros and other nifty stuff, but we use the special
5827 * "shopping" argument, to force certain commands to be converted
5828 * into other commands, normally, we convert "p" (pray) and "m"
5829 * (cast magic) into "g" (get), and "s" (search) into "d" (drop).
5832 void do_cmd_store(void)
5838 bool need_redraw_store_inv; /* To redraw missiles damage and prices in store */
5841 if(p_ptr->wild_mode) return;
5842 Term_get_size(&w, &h);
5844 /* Calculate stocks per 1 page */
5845 xtra_stock = MIN(14+26, ((h > 24) ? (h - 24) : 0));
5846 store_bottom = MIN_STOCK + xtra_stock;
5848 /* Access the player grid */
5849 c_ptr = &cave[p_ptr->y][p_ptr->x];
5851 /* Verify a store */
5852 if (!cave_have_flag_grid(c_ptr, FF_STORE))
5854 msg_print(_("ここには店がありません。", "You see no store here."));
5858 /* Extract the store code */
5859 which = f_info[c_ptr->feat].subtype;
5861 old_town_num = p_ptr->town_num;
5862 if ((which == STORE_HOME) || (which == STORE_MUSEUM)) p_ptr->town_num = 1;
5863 if (dun_level) p_ptr->town_num = NO_TOWN;
5864 inner_town_num = p_ptr->town_num;
5866 /* Hack -- Check the "locked doors" */
5867 if ((town[p_ptr->town_num].store[which].store_open >= turn) ||
5870 msg_print(_("ドアに鍵がかかっている。", "The doors are locked."));
5871 p_ptr->town_num = old_town_num;
5875 /* Calculate the number of store maintainances since the last visit */
5876 maintain_num = (turn - town[p_ptr->town_num].store[which].last_visit) / (TURNS_PER_TICK * STORE_TICKS);
5878 /* Maintain the store max. 10 times */
5879 if (maintain_num > 10) maintain_num = 10;
5883 /* Maintain the store */
5884 for (i = 0; i < maintain_num; i++)
5885 store_maint(p_ptr->town_num, which);
5887 /* Save the visit */
5888 town[p_ptr->town_num].store[which].last_visit = turn;
5894 /* Hack -- Character is in "icky" mode */
5895 character_icky = TRUE;
5902 /* Do not expand macros */
5903 get_com_no_macros = TRUE;
5905 /* Save the store number */
5906 cur_store_num = which;
5908 /* Hack -- save the store feature */
5909 cur_store_feat = c_ptr->feat;
5911 /* Save the store and owner pointers */
5912 st_ptr = &town[p_ptr->town_num].store[cur_store_num];
5913 ot_ptr = &owners[cur_store_num][st_ptr->owner];
5915 /* Start at the beginning */
5918 play_music(TERM_XTRA_MUSIC_BASIC, MUSIC_BASIC_BUILD);
5923 leave_store = FALSE;
5925 /* Interact with player */
5926 while (!leave_store)
5928 /* Hack -- Clear line 1 */
5932 clear_from(20 + xtra_stock);
5934 /* Basic commands */
5935 prt(_(" ESC) 建物から出る", " ESC) Exit from Building."), 21 + xtra_stock, 0);
5937 /* Browse if necessary */
5938 if (st_ptr->stock_num > store_bottom)
5940 prt(_(" -)前ページ", " -) Previous page"), 22 + xtra_stock, 0);
5941 prt(_(" スペース) 次ページ", " SPACE) Next page"), 23 + xtra_stock, 0);
5945 if (cur_store_num == STORE_HOME)
5947 prt(_("g) アイテムを取る", "g) Get an item."), 21 + xtra_stock, 27);
5948 prt(_("d) アイテムを置く", "d) Drop an item."), 22 + xtra_stock, 27);
5949 prt(_("x) 家のアイテムを調べる", "x) eXamine an item in the home."), 23 + xtra_stock, 27);
5952 /* Museum commands */
5953 else if (cur_store_num == STORE_MUSEUM)
5955 prt(_("d) アイテムを置く", "d) Drop an item."), 21 + xtra_stock, 27);
5956 prt(_("r) アイテムの展示をやめる", "r) order to Remove an item."), 22 + xtra_stock, 27);
5957 prt(_("x) 博物館のアイテムを調べる", "x) eXamine an item in the museum."), 23 + xtra_stock, 27);
5963 prt(_("p) 商品を買う", "p) Purchase an item."), 21 + xtra_stock, 30);
5964 prt(_("s) アイテムを売る", "s) Sell an item."), 22 + xtra_stock, 30);
5965 prt(_("x) 商品を調べる", "x) eXamine an item in the shop"), 23 + xtra_stock,30);
5969 prt(_("i/e) 持ち物/装備の一覧", "i/e) Inventry/Equipment list"), 21 + xtra_stock, 56);
5971 if (rogue_like_commands)
5973 prt(_("w/T) 装備する/はずす", "w/T) Wear/Take off equipment"), 22 + xtra_stock, 56);
5977 prt(_("w/t) 装備する/はずす", "w/t) Wear/Take off equipment"), 22 + xtra_stock, 56);
5981 prt(_("コマンド:", "You may: "), 20 + xtra_stock, 0);
5983 request_command(TRUE);
5985 /* Process the command */
5986 store_process_command();
5989 * Hack -- To redraw missiles damage and prices in store
5990 * If player's charisma changes, or if player changes a bow, PU_BONUS is set
5992 need_redraw_store_inv = (p_ptr->update & PU_BONUS) ? TRUE : FALSE;
5994 /* Hack -- Character is still in "icky" mode */
5995 character_icky = TRUE;
6000 if (inventory[INVEN_PACK].k_idx)
6002 INVENTORY_IDX item = INVEN_PACK;
6004 object_type *o_ptr = &inventory[item];
6006 /* Hack -- Flee from the store */
6007 if (cur_store_num != STORE_HOME)
6009 if (cur_store_num == STORE_MUSEUM)
6010 msg_print(_("ザックからアイテムがあふれそうなので、あわてて博物館から出た...", "Your pack is so full that you flee the Museum..."));
6012 msg_print(_("ザックからアイテムがあふれそうなので、あわてて店から出た...", "Your pack is so full that you flee the store..."));
6018 /* Hack -- Flee from the home */
6019 else if (!store_check_num(o_ptr))
6021 msg_print(_("ザックからアイテムがあふれそうなので、あわてて家から出た...", "Your pack is so full that you flee your home..."));
6026 /* Hack -- Drop items into the home */
6034 GAME_TEXT o_name[MAX_NLEN];
6036 /* Give a message */
6037 msg_print(_("ザックからアイテムがあふれてしまった!", "Your pack overflows!"));
6041 object_copy(q_ptr, o_ptr);
6042 object_desc(o_name, q_ptr, 0);
6044 msg_format(_("%sが落ちた。(%c)", "You drop %s (%c)."), o_name, index_to_label(item));
6046 /* Remove it from the players inventory */
6047 inven_item_increase(item, -255);
6048 inven_item_describe(item);
6049 inven_item_optimize(item);
6052 /* Let the home carry it */
6053 item_pos = home_carry(q_ptr);
6055 /* Redraw the home */
6058 store_top = (item_pos / store_bottom) * store_bottom;
6059 display_inventory();
6064 /* Hack -- Redisplay store prices if charisma changes */
6065 /* Hack -- Redraw missiles damage if player changes bow */
6066 if (need_redraw_store_inv) display_inventory();
6068 /* Hack -- get kicked out of the store */
6069 if (st_ptr->store_open >= turn) leave_store = TRUE;
6072 select_floor_music();
6074 p_ptr->town_num = old_town_num;
6076 take_turn(p_ptr, 100);;
6078 /* Hack -- Character is no longer in "icky" mode */
6079 character_icky = FALSE;
6081 /* Hack -- Cancel automatic command */
6084 /* Hack -- Cancel "see" mode */
6085 command_see = FALSE;
6087 /* Allow expanding macros */
6088 get_com_no_macros = FALSE;
6093 /* Update everything */
6094 p_ptr->update |= (PU_VIEW | PU_LITE | PU_MON_LITE);
6095 p_ptr->update |= (PU_MONSTERS);
6097 /* Redraw entire screen */
6098 p_ptr->redraw |= (PR_BASIC | PR_EXTRA | PR_EQUIPPY);
6099 p_ptr->redraw |= (PR_MAP);
6100 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
6106 * @brief 現在の町の店主を交代させる /
6107 * Shuffle one of the stores.
6108 * @param which 店舗種類のID
6111 void store_shuffle(int which)
6117 if (which == STORE_HOME) return;
6118 if (which == STORE_MUSEUM) return;
6121 /* Save the store index */
6122 cur_store_num = which;
6124 /* Activate that store */
6125 st_ptr = &town[p_ptr->town_num].store[cur_store_num];
6128 /* Pick a new owner */
6131 st_ptr->owner = (byte)randint0(MAX_OWNERS);
6132 if (j == st_ptr->owner) continue;
6133 for (i = 1;i < max_towns; i++)
6135 if (i == p_ptr->town_num) continue;
6136 if (st_ptr->owner == town[i].store[cur_store_num].owner) break;
6138 if (i == max_towns) break;
6141 /* Activate the new owner */
6142 ot_ptr = &owners[cur_store_num][st_ptr->owner];
6145 /* Reset the owner data */
6146 st_ptr->insult_cur = 0;
6147 st_ptr->store_open = 0;
6148 st_ptr->good_buy = 0;
6149 st_ptr->bad_buy = 0;
6152 /* Hack -- discount all the items */
6153 for (i = 0; i < st_ptr->stock_num; i++)
6157 o_ptr = &st_ptr->stock[i];
6159 if (!object_is_artifact(o_ptr))
6161 /* Hack -- Sell all non-artifact old items for "half price" */
6162 o_ptr->discount = 50;
6164 /* Hack -- Items are no longer "fixed price" */
6165 o_ptr->ident &= ~(IDENT_FIXED);
6167 /* Mega-Hack -- Note that the item is "on sale" */
6168 o_ptr->inscription = quark_add(_("売出中", "on sale"));
6175 * @brief 店の品揃えを変化させる /
6176 * Maintain the inventory at the stores.
6177 * @param town_num 町のID
6178 * @param store_num 店舗種類のID
6181 void store_maint(int town_num, int store_num)
6185 cur_store_num = store_num;
6188 if (store_num == STORE_HOME) return;
6189 if (store_num == STORE_MUSEUM) return;
6191 /* Activate that store */
6192 st_ptr = &town[town_num].store[store_num];
6194 /* Activate the owner */
6195 ot_ptr = &owners[store_num][st_ptr->owner];
6197 /* Store keeper forgives the player */
6198 st_ptr->insult_cur = 0;
6200 /* Mega-Hack -- prune the black market */
6201 if (store_num == STORE_BLACK)
6203 /* Destroy crappy black market items */
6204 for (j = st_ptr->stock_num - 1; j >= 0; j--)
6206 object_type *o_ptr = &st_ptr->stock[j];
6208 /* Destroy crappy items */
6209 if (black_market_crap(o_ptr))
6211 /* Destroy the item */
6212 store_item_increase(j, 0 - o_ptr->number);
6213 store_item_optimize(j);
6219 /* Choose the number of slots to keep */
6220 j = st_ptr->stock_num;
6222 /* Sell a few items */
6223 j = j - randint1(STORE_TURNOVER);
6225 /* Never keep more than "STORE_MAX_KEEP" slots */
6226 if (j > STORE_MAX_KEEP) j = STORE_MAX_KEEP;
6228 /* Always "keep" at least "STORE_MIN_KEEP" items */
6229 if (j < STORE_MIN_KEEP) j = STORE_MIN_KEEP;
6231 /* Hack -- prevent "underflow" */
6234 /* Destroy objects until only "j" slots are left */
6235 while (st_ptr->stock_num > j) store_delete();
6238 /* Choose the number of slots to fill */
6239 j = st_ptr->stock_num;
6241 /* Buy some more items */
6242 j = j + randint1(STORE_TURNOVER);
6244 /* Never keep more than "STORE_MAX_KEEP" slots */
6245 if (j > STORE_MAX_KEEP) j = STORE_MAX_KEEP;
6247 /* Always "keep" at least "STORE_MIN_KEEP" items */
6248 if (j < STORE_MIN_KEEP) j = STORE_MIN_KEEP;
6250 /* Hack -- prevent "overflow" */
6251 if (j >= st_ptr->stock_size) j = st_ptr->stock_size - 1;
6253 /* Acquire some new items */
6254 while (st_ptr->stock_num < j) store_create();
6259 * @brief 店舗情報を初期化する /
6260 * Initialize the stores
6261 * @param town_num 町のID
6262 * @param store_num 店舗種類のID
6265 void store_init(int town_num, int store_num)
6268 cur_store_num = store_num;
6270 /* Activate that store */
6271 st_ptr = &town[town_num].store[store_num];
6279 st_ptr->owner = (byte)randint0(MAX_OWNERS);
6280 for (i = 1;i < max_towns; i++)
6282 if (i == town_num) continue;
6283 if (st_ptr->owner == town[i].store[store_num].owner) break;
6285 if (i == max_towns) break;
6288 /* Activate the new owner */
6289 ot_ptr = &owners[store_num][st_ptr->owner];
6292 /* Initialize the store */
6293 st_ptr->store_open = 0;
6294 st_ptr->insult_cur = 0;
6295 st_ptr->good_buy = 0;
6296 st_ptr->bad_buy = 0;
6298 /* Nothing in stock */
6299 st_ptr->stock_num = 0;
6302 * MEGA-HACK - Last visit to store is
6303 * BEFORE player birth to enable store restocking
6305 st_ptr->last_visit = -10L * TURNS_PER_TICK * STORE_TICKS;
6307 /* Clear any old items */
6308 for (k = 0; k < st_ptr->stock_size; k++)
6310 object_wipe(&st_ptr->stock[k]);
6316 * @brief アイテムを町のブラックマーケットに移動させる /
6317 * @param o_ptr 移動させたいオブジェクトの構造体参照ポインタ
6320 void move_to_black_market(object_type *o_ptr)
6323 if (!p_ptr->town_num) return;
6325 st_ptr = &town[p_ptr->town_num].store[STORE_BLACK];
6327 o_ptr->ident |= IDENT_STORE;
6329 (void)store_carry(o_ptr);
6331 object_wipe(o_ptr); /* Don't leave a bogus object behind... */