2 * @brief プレイヤーの発動コマンド実装
7 #include "cmd-item/cmd-activate.h"
8 #include "art-definition/art-bow-types.h"
9 #include "art-definition/art-sword-types.h"
10 #include "art-definition/art-weapon-types.h"
11 #include "cmd-io/cmd-save.h"
12 #include "cmd/cmd-basic.h"
13 #include "core/sort.h"
14 #include "effect/effect-characteristics.h"
15 #include "effect/spells-effect-util.h"
16 #include "floor/floor.h"
17 #include "inventory/player-inventory.h"
18 #include "io/files-util.h"
19 #include "io/targeting.h"
20 #include "main/sound-definitions-table.h"
21 #include "monster/monster-status.h"
22 #include "object-enchant/artifact.h"
23 #include "object-enchant/dragon-breaths-table.h"
24 #include "object-enchant/object-ego.h"
25 #include "object/item-use-flags.h"
26 #include "object/object-flags.h"
27 #include "object/object-hook.h"
28 #include "object/object-kind.h"
29 #include "object/object-info.h"
30 #include "player/avatar.h"
31 #include "player/player-damage.h"
32 #include "player/player-effects.h"
33 #include "player/player-races-table.h"
34 #include "spell-kind/earthquake.h"
35 #include "spell-kind/spells-beam.h"
36 #include "spell-kind/spells-charm.h"
37 #include "spell-kind/spells-detection.h"
38 #include "spell-kind/spells-floor.h"
39 #include "spell-kind/spells-genocide.h"
40 #include "spell-kind/spells-grid.h"
41 #include "spell-kind/spells-launcher.h"
42 #include "spell-kind/spells-lite.h"
43 #include "spell-kind/spells-neighbor.h"
44 #include "spell-kind/spells-random.h"
45 #include "spell-kind/spells-sight.h"
46 #include "spell-kind/spells-specific-bolt.h"
47 #include "spell-kind/spells-teleport.h"
48 #include "spell-realm/spells-hex.h"
49 #include "spell/process-effect.h"
50 #include "spell/spells-object.h"
51 #include "spell/spells-status.h"
52 #include "spell/spells-summon.h"
53 #include "spell/spells-type.h"
54 #include "spell/spells3.h"
55 #include "sv-definition/sv-lite-types.h"
56 #include "sv-definition/sv-ring-types.h"
57 #include "world/world.h"
60 * @brief アイテムの発動効果テーブル /
61 * Define flags, levels, values of activations
63 const activation_type activation_info[] =
65 { "SUNLIGHT", ACT_SUNLIGHT, 10, 250, {10, 0},
66 _("太陽光線", "beam of sunlight") },
67 { "BO_MISS_1", ACT_BO_MISS_1, 10, 250, {2, 0},
68 _("マジック・ミサイル(2d6)", "magic missile (2d6)") },
69 { "BA_POIS_1", ACT_BA_POIS_1, 10, 300, {4, 0},
70 _("悪臭雲(12)", "stinking cloud (12)") },
71 { "BO_ELEC_1", ACT_BO_ELEC_1, 20, 250, {5, 0},
72 _("サンダー・ボルト(4d8)", "lightning bolt (4d8)") },
73 { "BO_ACID_1", ACT_BO_ACID_1, 20, 250, {6, 0},
74 _("アシッド・ボルト(5d8)", "acid bolt (5d8)") },
75 { "BO_COLD_1", ACT_BO_COLD_1, 20, 250, {7, 0},
76 _("アイス・ボルト(6d8)", "frost bolt (6d8)") },
77 { "BO_FIRE_1", ACT_BO_FIRE_1, 20, 250, {8, 0},
78 _("ファイア・ボルト(9d8)", "fire bolt (9d8)") },
79 { "BA_COLD_1", ACT_BA_COLD_1, 30, 750, {6, 0},
80 _("アイス・ボール(48)", "ball of cold (48)") },
81 { "BA_COLD_2", ACT_BA_COLD_2, 40, 1000, {12, 0},
82 _("アイス・ボール(100)", "ball of cold (100)") },
83 { "BA_COLD_3", ACT_BA_COLD_3, 70, 2500, {50, 0},
84 _("巨大アイス・ボール(400)", "ball of cold (400)") },
85 { "BA_FIRE_1", ACT_BA_FIRE_1, 30, 1000, {9, 0},
86 _("ファイア・ボール(72)", "ball of fire (72)") },
87 { "BA_FIRE_2", ACT_BA_FIRE_2, 40, 1500, {15, 0},
88 _("巨大ファイア・ボール(120)", "large fire ball (120)") },
89 { "BA_FIRE_3", ACT_BA_FIRE_3, 60, 1750, {40, 0},
90 _("巨大ファイア・ボール(300)", "fire ball (300)") },
91 { "BA_FIRE_4", ACT_BA_FIRE_4, 40, 1000, {12, 0},
92 _("ファイア・ボール(100)", "fire ball (100)") },
93 { "BA_ELEC_2", ACT_BA_ELEC_2, 40, 1000, {12, 0},
94 _("サンダー・ボール(100)", "ball of lightning (100)") },
95 { "BA_ELEC_3", ACT_BA_ELEC_3, 70, 2500, {70, 0},
96 _("巨大サンダー・ボール(500)", "ball of lightning (500)") },
97 { "BA_ACID_1", ACT_BA_ACID_1, 30, 1000, {12, 0},
98 _("アシッド・ボール(100)", "ball of acid (100)") },
99 { "BA_NUKE_1", ACT_BA_NUKE_1, 50, 1000, {12, 0},
100 _("放射能球(100)", "ball of nuke (100)") },
101 { "HYPODYNAMIA_1", ACT_HYPODYNAMIA_1, 30, 500, {12, 0},
102 _("窒息攻撃(100)", "a strangling attack (100)") },
103 { "HYPODYNAMIA_2", ACT_HYPODYNAMIA_2, 40, 750, {15, 0},
104 _("衰弱の矢(120)", "hypodynamic bolt (120)") },
105 { "DRAIN_1", ACT_DRAIN_1, 40, 1000, {20, 0},
106 _("吸収の矢(3*50)", "drain bolt (3*50)") },
107 { "BO_MISS_2", ACT_BO_MISS_2, 40, 1000, {20, 0},
108 _("矢(150)", "arrows (150)") },
109 { "WHIRLWIND", ACT_WHIRLWIND, 50, 7500, {25, 0},
110 _("カマイタチ", "whirlwind attack") },
111 { "DRAIN_2", ACT_DRAIN_2, 50, 2500, {40, 0},
112 _("吸収の矢(3*100)", "drain bolt (3*100)") },
113 { "CALL_CHAOS", ACT_CALL_CHAOS, 70, 5000, {35, 0},
114 _("混沌召来", "call chaos") },
115 { "ROCKET", ACT_ROCKET, 70, 5000, {20, 0},
116 _("ロケット(120+レベル)", "launch rocket (120+level)") },
117 { "DISP_EVIL", ACT_DISP_EVIL, 50, 4000, {50, 0},
118 _("邪悪退散(x5)", "dispel evil (x5)") },
119 { "BA_MISS_3", ACT_BA_MISS_3, 50, 1500, {50, 0},
120 _("エレメントのブレス(300)", "elemental breath (300)") },
121 { "DISP_GOOD", ACT_DISP_GOOD, 50, 3500, {50, 0},
122 _("善良退散(x5)", "dispel good (x5)") },
123 { "BO_MANA", ACT_BO_MANA, 40, 1500, {20, 0},
124 _("魔法の矢(150)", "a magical arrow (150)") },
125 { "BA_WATER", ACT_BA_WATER, 50, 2000, {25, 0},
126 _("ウォーター・ボール(200)", "water ball (200)") },
127 { "BA_STAR", ACT_BA_STAR, 50, 2200, {25, 0},
128 _("巨大スター・ボール(200)", "large star ball (200)") },
129 { "BA_DARK", ACT_BA_DARK, 50, 2200, {30, 0},
130 _("暗黒の嵐(250)", "darkness storm (250)") },
131 { "BA_MANA", ACT_BA_MANA, 70, 2500, {30, 0},
132 _("魔力の嵐(250)", "a mana storm (250)") },
133 { "PESTICIDE", ACT_PESTICIDE, 10, 500, {10, 0},
134 _("害虫の駆除", "dispel small life") },
135 { "BLINDING_LIGHT", ACT_BLINDING_LIGHT, 30, 5000, {40, 0},
136 _("眩しい光", "blinding light") },
137 { "BIZARRE", ACT_BIZARRE, 90, 10000, {50, 0},
138 _("信じ難いこと", "bizarre things") },
139 { "CAST_BA_STAR", ACT_CAST_BA_STAR, 70, 7500, {100, 0},
140 _("スター・ボール・ダスト(150)", "cast star balls (150)") },
141 { "BLADETURNER", ACT_BLADETURNER, 80, 20000, {80, 0},
142 _("エレメントのブレス(300), 士気高揚、祝福、耐性", "breathe elements (300), hero, bless, and resistance") },
143 { "BR_FIRE", ACT_BR_FIRE, 50, 5000, {-1, 0},
144 _("火炎のブレス (200)", "fire breath (200)") },
145 { "BR_COLD", ACT_BR_COLD, 50, 5000, {-1, 0},
146 _("冷気のブレス (200)", "cold breath (200)") },
147 { "BR_DRAGON", ACT_BR_DRAGON, 70, 10000, { 30, 0 },
148 "" /* built by item_activation_dragon_breath() */ },
150 { "CONFUSE", ACT_CONFUSE, 10, 500, {10, 0},
151 _("パニック・モンスター", "confuse monster") },
152 { "SLEEP", ACT_SLEEP, 10, 750, {15, 0},
153 _("周囲のモンスターを眠らせる", "sleep nearby monsters") },
154 { "QUAKE", ACT_QUAKE, 30, 600, {20, 0},
155 _("地震", "earthquake") },
156 { "TERROR", ACT_TERROR, 20, 2500, {-1, 0},
158 { "TELE_AWAY", ACT_TELE_AWAY, 20, 2000, {15, 0},
159 _("テレポート・アウェイ", "teleport away") },
160 { "BANISH_EVIL", ACT_BANISH_EVIL, 40, 2000, {250, 0},
161 _("邪悪消滅", "banish evil") },
162 { "GENOCIDE", ACT_GENOCIDE, 50, 10000, {500, 0},
163 _("抹殺", "genocide") },
164 { "MASS_GENO", ACT_MASS_GENO, 50, 10000, {1000, 0},
165 _("周辺抹殺", "mass genocide") },
166 { "SCARE_AREA", ACT_SCARE_AREA, 20, 2500, {20, 0},
167 _("モンスター恐慌", "frighten monsters") },
168 { "AGGRAVATE", ACT_AGGRAVATE, 0, 100, {0, 0},
169 _("モンスターを怒らせる", "aggravete monsters") },
171 { "CHARM_ANIMAL", ACT_CHARM_ANIMAL, 40, 7500, {200, 0},
172 _("動物魅了", "charm animal") },
173 { "CHARM_UNDEAD", ACT_CHARM_UNDEAD, 40, 10000, {333, 0},
174 _("アンデッド従属", "enslave undead") },
175 { "CHARM_OTHER", ACT_CHARM_OTHER, 40, 10000, {400, 0},
176 _("モンスター魅了", "charm monster") },
177 { "CHARM_ANIMALS", ACT_CHARM_ANIMALS, 40, 12500, {500, 0},
178 _("動物友和", "animal friendship") },
179 { "CHARM_OTHERS", ACT_CHARM_OTHERS, 40, 17500, {750, 0},
180 _("周辺魅了", "mass charm") },
181 { "SUMMON_ANIMAL", ACT_SUMMON_ANIMAL, 50, 10000, {200, 300},
182 _("動物召喚", "summon animal") },
183 { "SUMMON_PHANTOM", ACT_SUMMON_PHANTOM, 50, 12000, {200, 200},
184 _("幻霊召喚", "summon phantasmal servant") },
185 { "SUMMON_ELEMENTAL", ACT_SUMMON_ELEMENTAL, 50, 15000, {750, 0},
186 _("エレメンタル召喚", "summon elemental") },
187 { "SUMMON_DEMON", ACT_SUMMON_DEMON, 50, 20000, {666, 0},
188 _("悪魔召喚", "summon demon") },
189 { "SUMMON_UNDEAD", ACT_SUMMON_UNDEAD, 50, 20000, {666, 0},
190 _("アンデッド召喚", "summon undead") },
191 { "SUMMON_HOUND", ACT_SUMMON_HOUND, 50, 15000, {300, 0},
192 _("ハウンド召喚", "summon hound") },
193 { "SUMMON_DAWN", ACT_SUMMON_DAWN, 50, 15000, {500, 0},
194 _("暁の師団召喚", "summon the Legion of the Dawn") },
195 { "SUMMON_OCTOPUS", ACT_SUMMON_OCTOPUS, 50, 15000, {300, 0},
196 _("蛸の大群召喚", "summon octopus") },
198 { "CHOIR_SINGS", ACT_CHOIR_SINGS, 60, 20000, {300, 0},
199 _("回復(777)、癒し、士気高揚", "heal 777 hit points, curing and HEROism") },
200 { "CURE_LW", ACT_CURE_LW, 10, 500, {10, 0},
201 _("恐怖除去/体力回復(30)", "remove fear and heal 30 hp") },
202 { "CURE_MW", ACT_CURE_MW, 20, 750, {3, 3},
203 _("傷回復(4d8)", "heal 4d8 and wounds") },
204 { "CURE_POISON", ACT_CURE_POISON, 10, 1000, {5, 0},
205 _("恐怖除去/毒消し", "remove fear and cure poison") },
206 { "REST_LIFE", ACT_REST_EXP, 40, 7500, {450, 0},
207 _("経験値復活", "restore experience") },
208 { "REST_ALL", ACT_REST_ALL, 30, 15000, {750, 0},
209 _("全ステータスと経験値復活", "restore stats and experience") },
210 { "CURE_700", ACT_CURE_700, 40, 10000, {250, 0},
211 _("体力回復(700)", "heal 700 hit points") },
212 { "CURE_1000", ACT_CURE_1000, 50, 15000, {888, 0},
213 _("体力回復(1000)", "heal 1000 hit points") },
214 { "CURING", ACT_CURING, 30, 5000, {100, 0},
216 { "CURE_MANA_FULL", ACT_CURE_MANA_FULL, 60, 20000, {777, 0},
217 _("魔力復活", "restore mana") },
219 { "ESP", ACT_ESP, 30, 1500, {100, 0},
220 _("テレパシー(期間 25+d30)", "telepathy (dur 25+d30)") },
221 { "BERSERK", ACT_BERSERK, 10, 800, {75, 0},
222 _("狂戦士化(25+d25ターン)", "berserk (25+d25 turns)") },
223 { "PROT_EVIL", ACT_PROT_EVIL, 30, 5000, {100, 0},
224 _("対邪悪結界(期間 3*レベル+d25)", "protect evil (dur level*3 + d25)") },
225 { "RESIST_ALL", ACT_RESIST_ALL, 30, 5000, {111, 0},
226 _("全耐性(期間 20+d20)", "resist elements (dur 20+d20)") },
227 { "SPEED", ACT_SPEED, 40, 15000, {250, 0},
228 _("加速(期間 20+d20)", "speed (dur 20+d20)") },
229 { "XTRA_SPEED", ACT_XTRA_SPEED, 40, 25000, {200, 200},
230 _("加速(期間 75+d75)", "speed (dur 75+d75)") },
231 { "WRAITH", ACT_WRAITH, 90, 25000, {1000, 0},
232 _("幽体化(期間 (レベル/2)+d(レベル/2))", "wraith form (dur level/2 + d(level/2))") },
233 { "INVULN", ACT_INVULN, 90, 25000, {1000, 0},
234 _("無敵化(期間 8+d8)", "invulnerability (dur 8+d8)") },
235 { "HERO", ACT_HERO, 10, 500, {30, 30},
236 _("士気高揚", "heroism") },
237 { "HERO_SPEED", ACT_HERO_SPEED, 30, 20000, {100, 200},
238 _("士気高揚, スピード(期間 50+d50ターン)", "hero and +10 to speed (50)") },
239 { "RESIST_ACID", ACT_RESIST_ACID, 20, 2000, {40, 40},
240 _("酸への耐性(期間 20+d20)", "resist acid (dur 20+d20)") },
241 { "RESIST_FIRE", ACT_RESIST_FIRE, 20, 2000, {40, 40},
242 _("火炎への耐性(期間 20+d20)", "resist fire (dur 20+d20)") },
243 { "RESIST_COLD", ACT_RESIST_COLD, 20, 2000, {40, 40},
244 _("冷気への耐性(期間 20+d20)", "resist cold (dur 20+d20)") },
245 { "RESIST_ELEC", ACT_RESIST_ELEC, 20, 2000, {40, 40},
246 _("電撃への耐性(期間 20+d20)", "resist elec (dur 20+d20)") },
247 { "RESIST_POIS", ACT_RESIST_POIS, 20, 2000, {40, 40},
248 _("毒への耐性(期間 20+d20)", "resist poison (dur 20+d20)") },
250 { "LIGHT", ACT_LIGHT, 10, 150, {10, 10},
251 _("イルミネーション", "light area (dam 2d15)") },
252 { "MAP_LIGHT", ACT_MAP_LIGHT, 30, 500, {50, 50},
253 _("魔法の地図と光", "light (dam 2d15) & map area") },
254 { "DETECT_ALL", ACT_DETECT_ALL, 30, 1000, {55, 55},
255 _("全感知", "detection") },
256 { "DETECT_XTRA", ACT_DETECT_XTRA, 50, 12500, {100, 0},
257 _("全感知、探索、*鑑定*", "detection, probing and identify true") },
258 { "ID_FULL", ACT_ID_FULL, 50, 10000, {75, 0},
259 _("*鑑定*", "identify true") },
260 { "ID_PLAIN", ACT_ID_PLAIN, 20, 1250, {10, 0},
261 _("鑑定", "identify spell") },
262 { "RUNE_EXPLO", ACT_RUNE_EXPLO, 40, 4000, {200, 0},
263 _("爆発のルーン", "explosive rune") },
264 { "RUNE_PROT", ACT_RUNE_PROT, 60, 10000, {400, 0},
265 _("守りのルーン", "rune of protection") },
266 { "SATIATE", ACT_SATIATE, 10, 2000, {200, 0},
267 _("空腹充足", "satisfy hunger") },
268 { "DEST_DOOR", ACT_DEST_DOOR, 10, 100, {10, 0},
269 _("ドア破壊", "destroy doors") },
270 { "STONE_MUD", ACT_STONE_MUD, 20, 1000, {3, 0},
271 _("岩石溶解", "stone to mud") },
272 { "RECHARGE", ACT_RECHARGE, 30, 1000, {70, 0},
273 _("魔力充填", "recharging") },
274 { "ALCHEMY", ACT_ALCHEMY, 50, 10000, {500, 0},
275 _("錬金術", "alchemy") },
276 { "DIM_DOOR", ACT_DIM_DOOR, 50, 10000, {100, 0},
277 _("次元の扉", "dimension door") },
278 { "TELEPORT", ACT_TELEPORT, 10, 2000, {25, 0},
279 _("テレポート", "teleport") },
280 { "RECALL", ACT_RECALL, 30, 7500, {200, 0},
281 _("帰還の詔", "word of recall") },
282 { "JUDGE", ACT_JUDGE, 90, 50000, {20, 20},
283 _("体力と引き替えに千里眼と帰還", "a telekinesis (500 lb)") },
284 { "TELEKINESIS", ACT_TELEKINESIS, 20, 5500, {25, 25},
285 _("物体を引き寄せる(重量25kgまで)", "clairvoyance and recall, draining you") },
286 { "DETECT_UNIQUE", ACT_DETECT_UNIQUE, 40, 10000, {200, 0},
287 _("この階にいるユニークモンスターを表示", "list of the uniques on the level") },
288 { "ESCAPE", ACT_ESCAPE, 10, 3000, {35, 0},
289 _("逃走", "a getaway") },
290 { "DISP_CURSE_XTRA", ACT_DISP_CURSE_XTRA, 40, 30000, {0, 0},
291 _("*解呪*と調査", "dispel curse and probing") },
292 { "BRAND_FIRE_BOLTS", ACT_BRAND_FIRE_BOLTS, 40, 20000, {999, 0},
293 _("刃先のファイア・ボルト", "fire branding of bolts") },
294 { "RECHARGE_XTRA", ACT_RECHARGE_XTRA, 70, 30000, {200, 0},
295 _("魔力充填", "recharge item") },
296 { "LORE", ACT_LORE, 10, 30000, {0, 0},
297 _("危険を伴う鑑定", "perilous identify") },
298 { "SHIKOFUMI", ACT_SHIKOFUMI, 10, 10000, {100, 100},
299 _("四股踏み", "shiko") },
300 { "PHASE_DOOR", ACT_PHASE_DOOR, 10, 1500, {10, 0},
301 _("ショート・テレポート", "blink") },
302 { "DETECT_ALL_MONS", ACT_DETECT_ALL_MONS, 30, 3000, {150, 0},
303 _("全モンスター感知", "detect all monsters") },
304 { "ULTIMATE_RESIST", ACT_ULTIMATE_RESIST, 90, 20000, {777, 0},
305 _("士気高揚、祝福、究極の耐性", "hero, bless, and ultimate resistance") },
307 { "CAST_OFF", ACT_CAST_OFF, 30, 15000, {100, 0},
308 _("脱衣と小宇宙燃焼", "cast it off and cosmic heroism") },
309 { "FISHING", ACT_FISHING, 0, 100, {0, 0},
310 _("釣りをする", "fishing") },
311 { "INROU", ACT_INROU, 40, 15000, {150, 150},
312 _("例のアレ", "reveal your identity") },
313 { "MURAMASA", ACT_MURAMASA, 0, 0, {-1, 0},
314 _("腕力の上昇", "increase STR") },
315 { "BLOODY_MOON", ACT_BLOODY_MOON, 0, 0, {3333, 0},
316 _("属性変更", "change zokusei") },
317 { "CRIMSON", ACT_CRIMSON, 0, 50000, {15, 0},
318 _("ファイア!", "fire!") },
320 { "STRAIN_HASTE", ACT_STRAIN_HASTE, 10, 1000, {120, 100},
321 _("体力と引き換えに加速", "haste with strain") },
322 { "GRAND_CROSS", ACT_GRAND_CROSS, 30, 15000, {250, 200},
323 _("グランド・クロス", "grand cross") },
324 { "TELEPORT_LEVEL", ACT_TELEPORT_LEVEL, 10, 1500, {100, 200},
325 _("テレポート・レベル", "teleort level") },
326 { "ARTS_FALLING_STAR", ACT_FALLING_STAR, 20, 5500, {30, 50},
327 _("魔剣・流れ星", "blade arts 'falling star'") },
328 { NULL, 0, 0, 0, {0, 0},
333 * @brief 装備を発動するコマンドのサブルーチン /
334 * Activate a wielded object. Wielded objects never stack.
335 * And even if they did, activatable objects never stack.
336 * @param item 発動するオブジェクトの所持品ID
340 * Currently, only (some) artifacts, and Dragon Scale Mail, can be activated.
341 * But one could, for example, easily make an activatable "Ring of Plasma".
342 * Note that it always takes a turn to activate an artifact, even if
343 * the user hits "escape" at the "direction" prompt.
346 void exe_activate(player_type *user_ptr, INVENTORY_IDX item)
354 o_ptr = ref_item(user_ptr, item);
355 take_turn(user_ptr, 100);
356 lev = k_info[o_ptr->k_idx].level;
358 /* Hack -- use artifact level instead */
359 if (object_is_fixed_artifact(o_ptr)) lev = a_info[o_ptr->name1].level;
360 else if (object_is_random_artifact(o_ptr))
362 const activation_type* const act_ptr = find_activation_info(o_ptr);
364 lev = act_ptr->level;
367 else if (((o_ptr->tval == TV_RING) || (o_ptr->tval == TV_AMULET)) && o_ptr->name2) lev = e_info[o_ptr->name2].level;
369 /* Base chance of success */
370 chance = user_ptr->skill_dev;
372 /* Confusion hurts skill */
373 if (user_ptr->confused) chance = chance / 2;
376 if (chance > fail) fail -= (chance - fail) * 2;
377 else chance -= (fail - chance) * 2;
378 if (fail < USE_DEVICE) fail = USE_DEVICE;
379 if (chance < USE_DEVICE) chance = USE_DEVICE;
381 if (cmd_limit_time_walk(user_ptr)) return;
383 if (user_ptr->pclass == CLASS_BERSERKER) success = FALSE;
384 else if (chance > fail)
386 if (randint0(chance * 2) < fail) success = FALSE;
391 if (randint0(fail * 2) < chance) success = TRUE;
392 else success = FALSE;
398 if (flush_failure) flush();
399 msg_print(_("うまく始動させることができなかった。", "You failed to activate it properly."));
404 /* Check the recharge */
407 msg_print(_("それは微かに音を立て、輝き、消えた...", "It whines, glows and fades..."));
411 /* Some lights need enough fuel for activation */
412 if (!o_ptr->xtra4 && (o_ptr->tval == TV_FLASK) &&
413 ((o_ptr->sval == SV_LITE_TORCH) || (o_ptr->sval == SV_LITE_LANTERN)))
415 msg_print(_("燃料がない。", "It has no fuel."));
420 /* Activate the artifact */
421 msg_print(_("始動させた...", "You activate it..."));
425 /* Activate object */
426 if (activation_index(o_ptr))
428 (void)activate_artifact(user_ptr, o_ptr);
430 user_ptr->window |= (PW_INVEN | PW_EQUIP);
437 else if (o_ptr->tval == TV_WHISTLE)
439 if (music_singing_any(user_ptr)) stop_singing(user_ptr);
440 if (hex_spelling_any(user_ptr)) stop_hex_spell_all(user_ptr);
443 MONSTER_IDX pet_ctr, i;
448 /* Allocate the "who" array */
449 C_MAKE(who, current_world_ptr->max_m_idx, MONSTER_IDX);
451 /* Process the monsters (backwards) */
452 for (pet_ctr = user_ptr->current_floor_ptr->m_max - 1; pet_ctr >= 1; pet_ctr--)
454 if (is_pet(&user_ptr->current_floor_ptr->m_list[pet_ctr]) && (user_ptr->riding != pet_ctr))
455 who[max_pet++] = pet_ctr;
458 ang_sort(who, &dummy_why, max_pet, ang_sort_comp_pet, ang_sort_swap_hook);
460 /* Process the monsters (backwards) */
461 for (i = 0; i < max_pet; i++)
464 teleport_monster_to(user_ptr, pet_ctr, user_ptr->y, user_ptr->x, 100, TELEPORT_PASSIVE);
467 /* Free the "who" array */
468 C_KILL(who, current_world_ptr->max_m_idx, MONSTER_IDX);
470 o_ptr->timeout = 100 + randint1(100);
473 else if (o_ptr->tval == TV_CAPTURE)
477 bool old_target_pet = target_pet;
479 if (!get_aim_dir(user_ptr, &dir))
481 target_pet = old_target_pet;
484 target_pet = old_target_pet;
486 if (fire_ball(user_ptr, GF_CAPTURE, dir, 0, 0))
488 o_ptr->pval = (PARAMETER_VALUE)cap_mon;
489 o_ptr->xtra3 = (XTRA8)cap_mspeed;
490 o_ptr->xtra4 = (XTRA16)cap_hp;
491 o_ptr->xtra5 = (XTRA16)cap_maxhp;
498 if (o_ptr->inscription)
499 strcpy(buf, quark_str(o_ptr->inscription));
501 for (s = buf; *s && (*s != '#'); s++)
504 if (iskanji(*s)) s++;
514 t = quark_str(cap_nickname);
527 o_ptr->inscription = quark_add(buf);
534 if (!get_direction(user_ptr, &dir, FALSE, FALSE)) return;
535 if (monster_can_enter(user_ptr, user_ptr->y + ddy[dir], user_ptr->x + ddx[dir], &r_info[o_ptr->pval], 0))
537 if (place_monster_aux(user_ptr, 0, user_ptr->y + ddy[dir], user_ptr->x + ddx[dir], o_ptr->pval, (PM_FORCE_PET | PM_NO_KAGE)))
539 if (o_ptr->xtra3) user_ptr->current_floor_ptr->m_list[hack_m_idx_ii].mspeed = o_ptr->xtra3;
540 if (o_ptr->xtra5) user_ptr->current_floor_ptr->m_list[hack_m_idx_ii].max_maxhp = o_ptr->xtra5;
541 if (o_ptr->xtra4) user_ptr->current_floor_ptr->m_list[hack_m_idx_ii].hp = o_ptr->xtra4;
542 user_ptr->current_floor_ptr->m_list[hack_m_idx_ii].maxhp = user_ptr->current_floor_ptr->m_list[hack_m_idx_ii].max_maxhp;
543 if (o_ptr->inscription)
552 t = quark_str(o_ptr->inscription);
553 for (t = quark_str(o_ptr->inscription); *t && (*t != '#'); t++)
556 if (iskanji(*t)) t++;
581 if (quote && *(s - 1) == '\'')
585 user_ptr->current_floor_ptr->m_list[hack_m_idx_ii].nickname = quark_add(buf);
586 t = quark_str(o_ptr->inscription);
588 while (*t && (*t != '#'))
595 o_ptr->inscription = quark_add(buf);
606 msg_print(_("おっと、解放に失敗した。", "Oops. You failed to release your pet."));
608 calc_android_exp(user_ptr);
613 msg_print(_("おっと、このアイテムは始動できない。", "Oops. That object cannot be activated."));
617 * @brief 装備を発動するコマンドのメインルーチン /
618 * @param user_ptr プレーヤーへの参照ポインタ
621 void do_cmd_activate(player_type *user_ptr)
626 if (user_ptr->wild_mode) return;
627 if (cmd_limit_arena(user_ptr)) return;
629 if (user_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN))
631 set_action(user_ptr, ACTION_NONE);
634 item_tester_hook = item_tester_hook_activate;
636 q = _("どのアイテムを始動させますか? ", "Activate which item? ");
637 s = _("始動できるアイテムを装備していない。", "You have nothing to activate.");
639 if (!choose_object(user_ptr, &item, q, s, (USE_EQUIP | IGNORE_BOTHHAND_SLOT), 0)) return;
641 /* Activate the item */
642 exe_activate(user_ptr, item);
646 * @brief 発動によるブレスの属性をアイテムの耐性から選択し、実行を処理する。/ Dragon breath activation
647 * @details 対象となる耐性は dragonbreath_info テーブルを参照のこと。
648 * @param user_ptr プレーヤーへの参照ポインタ
649 * @param o_ptr 対象のオブジェクト構造体ポインタ
650 * @return 発動実行の是非を返す。
652 static bool activate_dragon_breath(player_type *user_ptr, object_type *o_ptr)
654 BIT_FLAGS flgs[TR_FLAG_SIZE]; /* for resistance flags */
660 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
662 object_flags(o_ptr, flgs);
664 for (i = 0; dragonbreath_info[i].flag != 0; i++)
666 if (have_flag(flgs, dragonbreath_info[i].flag))
668 type[n] = dragonbreath_info[i].type;
669 name[n] = dragonbreath_info[i].name;
673 if (n == 0) return FALSE;
676 if (music_singing_any(user_ptr)) stop_singing(user_ptr);
677 if (hex_spelling_any(user_ptr)) stop_hex_spell_all(user_ptr);
680 msg_format(_("あなたは%sのブレスを吐いた。", "You breathe %s."), name[t]);
681 fire_breath(user_ptr, type[t], dir, 250, 4);
688 * @brief アイテムの発動効果を処理する。
689 * @param user_ptr プレーヤーへの参照ポインタ
690 * @param o_ptr 対象のオブジェクト構造体ポインタ
691 * @return 発動実行の是非を返す。
693 bool activate_artifact(player_type *user_ptr, object_type *o_ptr)
695 PLAYER_LEVEL plev = user_ptr->lev;
698 concptr name = k_name + k_info[o_ptr->k_idx].name;
699 const activation_type* const act_ptr = find_activation_info(o_ptr);
701 /* Maybe forgot adding information to activation_info table ? */
702 msg_print("Activation information is not found.");
706 /* Activate for attack */
707 switch (act_ptr->index)
711 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
712 msg_print(_("太陽光線が放たれた。", "A line of sunlight appears."));
713 (void)lite_line(user_ptr, dir, damroll(6, 8));
719 msg_print(_("それは眩しいくらいに明るく輝いている...", "It glows extremely brightly..."));
720 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
721 fire_bolt(user_ptr, GF_MISSILE, dir, damroll(2, 6));
727 msg_print(_("それは濃緑色に脈動している...", "It throbs deep green..."));
728 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
729 fire_ball(user_ptr, GF_POIS, dir, 12, 3);
735 msg_print(_("それは火花に覆われた...", "It is covered in sparks..."));
736 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
737 fire_bolt(user_ptr, GF_ELEC, dir, damroll(4, 8));
743 msg_print(_("それは酸に覆われた...", "It is covered in acid..."));
744 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
745 fire_bolt(user_ptr, GF_ACID, dir, damroll(5, 8));
751 msg_print(_("それは霜に覆われた...", "It is covered in frost..."));
752 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
753 fire_bolt(user_ptr, GF_COLD, dir, damroll(6, 8));
759 msg_print(_("それは炎に覆われた...", "It is covered in fire..."));
760 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
761 fire_bolt(user_ptr, GF_FIRE, dir, damroll(9, 8));
767 msg_print(_("それは霜に覆われた...", "It is covered in frost..."));
768 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
769 fire_ball(user_ptr, GF_COLD, dir, 48, 2);
775 msg_print(_("それは青く激しく輝いた...", "It glows an intense blue..."));
776 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
777 fire_ball(user_ptr, GF_COLD, dir, 100, 2);
783 msg_print(_("明るく白色に輝いている...", "It glows bright white..."));
784 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
785 fire_ball(user_ptr, GF_COLD, dir, 400, 3);
791 msg_print(_("それは赤く激しく輝いた...", "It glows an intense red..."));
792 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
793 fire_ball(user_ptr, GF_FIRE, dir, 72, 2);
799 msg_format(_("%sから炎が吹き出した...", "The %s rages in fire..."), name);
800 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
801 fire_ball(user_ptr, GF_FIRE, dir, 120, 3);
807 msg_print(_("深赤色に輝いている...", "It glows deep red..."));
808 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
809 fire_ball(user_ptr, GF_FIRE, dir, 300, 3);
815 msg_print(_("それは赤く激しく輝いた...", "It glows an intense red..."));
816 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
817 fire_ball(user_ptr, GF_FIRE, dir, 100, 2);
823 msg_print(_("電気がパチパチ音を立てた...", "It crackles with electricity..."));
824 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
825 fire_ball(user_ptr, GF_ELEC, dir, 100, 3);
831 msg_print(_("深青色に輝いている...", "It glows deep blue..."));
832 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
833 fire_ball(user_ptr, GF_ELEC, dir, 500, 3);
839 msg_print(_("それは黒く激しく輝いた...", "It glows an intense black..."));
840 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
841 fire_ball(user_ptr, GF_ACID, dir, 100, 2);
847 msg_print(_("それは緑に激しく輝いた...", "It glows an intense green..."));
848 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
849 fire_ball(user_ptr, GF_NUKE, dir, 100, 2);
853 case ACT_HYPODYNAMIA_1:
855 msg_format(_("あなたは%sに敵を締め殺すよう命じた。", "You order the %s to strangle your opponent."), name);
856 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
857 hypodynamic_bolt(user_ptr, dir, 100);
861 case ACT_HYPODYNAMIA_2:
863 msg_print(_("黒く輝いている...", "It glows black..."));
864 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
865 hypodynamic_bolt(user_ptr, dir, 120);
871 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
872 for (dummy = 0; dummy < 3; dummy++)
874 if (hypodynamic_bolt(user_ptr, dir, 50))
875 hp_player(user_ptr, 50);
882 msg_print(_("魔法のトゲが現れた...", "It grows magical spikes..."));
883 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
884 fire_bolt(user_ptr, GF_ARROW, dir, 150);
896 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
897 for (dummy = 0; dummy < 3; dummy++)
899 if (hypodynamic_bolt(user_ptr, dir, 100))
900 hp_player(user_ptr, 100);
908 msg_print(_("様々な色の火花を発している...", "It glows in scintillating colours..."));
909 call_chaos(user_ptr);
915 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
916 msg_print(_("ロケットを発射した!", "You launch a rocket!"));
917 fire_ball(user_ptr, GF_ROCKET, dir, 250 + plev * 3, 2);
923 msg_print(_("神聖な雰囲気が充満した...", "It floods the area with goodness..."));
924 dispel_evil(user_ptr, user_ptr->lev * 5);
930 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
931 msg_print(_("あなたはエレメントのブレスを吐いた。", "You breathe the elements."));
932 fire_breath(user_ptr, GF_MISSILE, dir, 300, 4);
938 msg_print(_("邪悪な雰囲気が充満した...", "It floods the area with evil..."));
939 dispel_good(user_ptr, user_ptr->lev * 5);
945 msg_format(_("%sに魔法のトゲが現れた...", "The %s grows magical spikes..."), name);
946 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
947 fire_bolt(user_ptr, GF_ARROW, dir, 150);
953 msg_format(_("%sが深い青色に鼓動している...", "The %s throbs deep blue..."), name);
954 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
955 fire_ball(user_ptr, GF_WATER, dir, 200, 3);
961 msg_format(_("%sが深い闇に覆われた...", "The %s is coverd in pitch-darkness..."), name);
962 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
963 fire_ball(user_ptr, GF_DARK, dir, 250, 4);
969 msg_format(_("%sが青白く光った...", "The %s glows pale..."), name);
970 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
971 fire_ball(user_ptr, GF_MANA, dir, 250, 4);
977 msg_print(_("あなたは害虫を一掃した。", "You exterminate small life."));
978 (void)dispel_monsters(user_ptr, 4);
982 case ACT_BLINDING_LIGHT:
984 msg_format(_("%sが眩しい光で輝いた...", "The %s gleams with blinding light..."), name);
985 fire_ball(user_ptr, GF_LITE, 0, 300, 6);
986 confuse_monsters(user_ptr, 3 * user_ptr->lev / 2);
992 msg_format(_("%sは漆黒に輝いた...", "The %s glows intensely black..."), name);
993 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
994 ring_of_power(user_ptr, dir);
998 case ACT_CAST_BA_STAR:
1000 HIT_POINT num = damroll(5, 3);
1001 POSITION y = 0, x = 0;
1003 msg_format(_("%sが稲妻で覆われた...", "The %s is surrounded by lightning..."), name);
1004 for (k = 0; k < num; k++)
1010 scatter(user_ptr, &y, &x, user_ptr->y, user_ptr->x, 4, 0);
1011 if (!cave_have_flag_bold(user_ptr->current_floor_ptr, y, x, FF_PROJECT)) continue;
1012 if (!player_bold(user_ptr, y, x)) break;
1015 project(user_ptr, 0, 3, y, x, 150, GF_ELEC,
1016 (PROJECT_THRU | PROJECT_STOP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL), -1);
1022 case ACT_BLADETURNER:
1024 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
1025 msg_print(_("あなたはエレメントのブレスを吐いた。", "You breathe the elements."));
1026 fire_breath(user_ptr, GF_MISSILE, dir, 300, 4);
1027 msg_print(_("鎧が様々な色に輝いた...", "Your armor glows many colours..."));
1028 (void)set_afraid(user_ptr, 0);
1029 (void)set_hero(user_ptr, randint1(50) + 50, FALSE);
1030 (void)hp_player(user_ptr, 10);
1031 (void)set_blessed(user_ptr, randint1(50) + 50, FALSE);
1032 (void)set_oppose_acid(user_ptr, randint1(50) + 50, FALSE);
1033 (void)set_oppose_elec(user_ptr, randint1(50) + 50, FALSE);
1034 (void)set_oppose_fire(user_ptr, randint1(50) + 50, FALSE);
1035 (void)set_oppose_cold(user_ptr, randint1(50) + 50, FALSE);
1036 (void)set_oppose_pois(user_ptr, randint1(50) + 50, FALSE);
1042 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
1043 fire_breath(user_ptr, GF_FIRE, dir, 200, 2);
1044 if ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_FLAMES))
1046 (void)set_oppose_fire(user_ptr, randint1(20) + 20, FALSE);
1053 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
1054 fire_breath(user_ptr, GF_COLD, dir, 200, 2);
1055 if ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_ICE))
1057 (void)set_oppose_cold(user_ptr, randint1(20) + 20, FALSE);
1064 if (!activate_dragon_breath(user_ptr, o_ptr)) return FALSE;
1068 /* Activate for other offensive action */
1071 msg_print(_("様々な色の火花を発している...", "It glows in scintillating colours..."));
1072 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
1073 confuse_monster(user_ptr, dir, 20);
1079 msg_print(_("深青色に輝いている...", "It glows deep blue..."));
1080 sleep_monsters_touch(user_ptr);
1086 earthquake(user_ptr, user_ptr->y, user_ptr->x, 5, 0);
1092 turn_monsters(user_ptr, 40 + user_ptr->lev);
1098 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
1099 (void)fire_beam(user_ptr, GF_AWAY_ALL, dir, plev);
1103 case ACT_BANISH_EVIL:
1105 if (banish_evil(user_ptr, 100))
1107 msg_print(_("アーティファクトの力が邪悪を打ち払った!", "The power of the artifact banishes evil!"));
1114 msg_print(_("深青色に輝いている...", "It glows deep blue..."));
1115 (void)symbol_genocide(user_ptr, 200, TRUE);
1121 msg_print(_("ひどく鋭い音が流れ出た...", "It lets out a long, shrill note..."));
1122 (void)mass_genocide(user_ptr, 200, TRUE);
1126 case ACT_SCARE_AREA:
1128 if (music_singing_any(user_ptr)) stop_singing(user_ptr);
1129 if (hex_spelling_any(user_ptr)) stop_hex_spell_all(user_ptr);
1130 msg_print(_("あなたは力強い突風を吹き鳴らした。周囲の敵が震え上っている!",
1131 "You wind a mighty blast; your enemies tremble!"));
1132 (void)turn_monsters(user_ptr, (3 * user_ptr->lev / 2) + 10);
1138 if (o_ptr->name1 == ART_HYOUSIGI)
1140 msg_print(_("拍子木を打った。", "You beat your wooden clappers."));
1144 msg_format(_("%sは不快な物音を立てた。", "The %s sounds an unpleasant noise."), name);
1146 aggravate_monsters(user_ptr, 0);
1150 /* Activate for summoning / charming */
1152 case ACT_CHARM_ANIMAL:
1154 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
1155 (void)charm_animal(user_ptr, dir, plev);
1159 case ACT_CHARM_UNDEAD:
1161 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
1162 (void)control_one_undead(user_ptr, dir, plev);
1166 case ACT_CHARM_OTHER:
1168 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
1169 (void)charm_monster(user_ptr, dir, plev * 2);
1173 case ACT_CHARM_ANIMALS:
1175 (void)charm_animals(user_ptr, plev * 2);
1179 case ACT_CHARM_OTHERS:
1181 charm_monsters(user_ptr, plev * 2);
1185 case ACT_SUMMON_ANIMAL:
1187 (void)summon_specific(user_ptr, -1, user_ptr->y, user_ptr->x, plev, SUMMON_ANIMAL_RANGER, (PM_ALLOW_GROUP | PM_FORCE_PET));
1191 case ACT_SUMMON_PHANTOM:
1193 msg_print(_("幻霊を召喚した。", "You summon a phantasmal servant."));
1194 (void)summon_specific(user_ptr, -1, user_ptr->y, user_ptr->x, user_ptr->current_floor_ptr->dun_level, SUMMON_PHANTOM, (PM_ALLOW_GROUP | PM_FORCE_PET));
1198 case ACT_SUMMON_ELEMENTAL:
1199 if (!cast_summon_elemental(user_ptr, (plev * 3) / 2)) return FALSE;
1202 case ACT_SUMMON_DEMON:
1204 cast_summon_demon(user_ptr, (plev * 3) / 2);
1208 case ACT_SUMMON_UNDEAD:
1209 if (!cast_summon_undead(user_ptr, (plev * 3) / 2)) return FALSE;
1212 case ACT_SUMMON_HOUND:
1213 if (!cast_summon_hound(user_ptr, (plev * 3) / 2)) return FALSE;
1216 case ACT_SUMMON_DAWN:
1218 msg_print(_("暁の師団を召喚した。", "You summon the Legion of the Dawn."));
1219 (void)summon_specific(user_ptr, -1, user_ptr->y, user_ptr->x, user_ptr->current_floor_ptr->dun_level, SUMMON_DAWN, (PM_ALLOW_GROUP | PM_FORCE_PET));
1223 case ACT_SUMMON_OCTOPUS:
1224 if (!cast_summon_octopus(user_ptr)) return FALSE;
1227 /* Activate for healing */
1229 case ACT_CHOIR_SINGS:
1231 msg_print(_("天国の歌が聞こえる...", "A heavenly choir sings..."));
1232 (void)cure_critical_wounds(user_ptr, 777);
1233 (void)set_hero(user_ptr, randint1(25) + 25, FALSE);
1239 (void)set_afraid(user_ptr, 0);
1240 (void)hp_player(user_ptr, 30);
1246 msg_print(_("深紫色の光を発している...", "It radiates deep purple..."));
1247 (void)cure_serious_wounds(user_ptr, 4, 8);
1251 case ACT_CURE_POISON:
1253 msg_print(_("深青色に輝いている...", "It glows deep blue..."));
1254 (void)set_afraid(user_ptr, 0);
1255 (void)set_poisoned(user_ptr, 0);
1261 msg_print(_("深紅に輝いている...", "It glows a deep red..."));
1262 restore_level(user_ptr);
1268 msg_print(_("濃緑色に輝いている...", "It glows a deep green..."));
1269 (void)restore_all_status(user_ptr);
1270 (void)restore_level(user_ptr);
1276 msg_print(_("深青色に輝いている...", "It glows deep blue..."));
1277 msg_print(_("体内に暖かい鼓動が感じられる...", "You feel a warm tingling inside..."));
1278 (void)cure_critical_wounds(user_ptr, 700);
1284 msg_print(_("白く明るく輝いている...", "It glows a bright white..."));
1285 msg_print(_("ひじょうに気分がよい...", "You feel much better..."));
1286 (void)cure_critical_wounds(user_ptr, 1000);
1292 msg_format(_("%sの優しさに癒される...", "the %s cures you affectionately ..."), name);
1293 true_healing(user_ptr, 0);
1297 case ACT_CURE_MANA_FULL:
1299 msg_format(_("%sが青白く光った...", "The %s glows pale..."), name);
1300 restore_mana(user_ptr, TRUE);
1304 /* Activate for timed effect */
1308 (void)set_tim_esp(user_ptr, randint1(30) + 25, FALSE);
1314 (void)berserk(user_ptr, randint1(25) + 25);
1320 msg_format(_("%sから鋭い音が流れ出た...", "The %s lets out a shrill wail..."), name);
1321 k = 3 * user_ptr->lev;
1322 (void)set_protevil(user_ptr, randint1(25) + k, FALSE);
1326 case ACT_RESIST_ALL:
1328 msg_print(_("様々な色に輝いている...", "It glows many colours..."));
1329 (void)set_oppose_acid(user_ptr, randint1(40) + 40, FALSE);
1330 (void)set_oppose_elec(user_ptr, randint1(40) + 40, FALSE);
1331 (void)set_oppose_fire(user_ptr, randint1(40) + 40, FALSE);
1332 (void)set_oppose_cold(user_ptr, randint1(40) + 40, FALSE);
1333 (void)set_oppose_pois(user_ptr, randint1(40) + 40, FALSE);
1339 msg_print(_("明るく緑色に輝いている...", "It glows bright green..."));
1340 (void)set_fast(user_ptr, randint1(20) + 20, FALSE);
1344 case ACT_XTRA_SPEED:
1346 msg_print(_("明るく輝いている...", "It glows brightly..."));
1347 (void)set_fast(user_ptr, randint1(75) + 75, FALSE);
1353 set_wraith_form(user_ptr, randint1(plev / 2) + (plev / 2), FALSE);
1359 (void)set_invuln(user_ptr, randint1(8) + 8, FALSE);
1365 (void)heroism(user_ptr, 25);
1369 case ACT_HERO_SPEED:
1371 (void)set_fast(user_ptr, randint1(50) + 50, FALSE);
1372 (void)heroism(user_ptr, 50);
1376 case ACT_RESIST_ACID:
1378 msg_format(_("%sが黒く輝いた...", "The %s grows black."), name);
1379 if ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_ACID))
1381 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
1382 fire_ball(user_ptr, GF_ACID, dir, 100, 2);
1384 (void)set_oppose_acid(user_ptr, randint1(20) + 20, FALSE);
1388 case ACT_RESIST_FIRE:
1390 msg_format(_("%sが赤く輝いた...", "The %s grows red."), name);
1391 if ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_FLAMES))
1393 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
1394 fire_ball(user_ptr, GF_FIRE, dir, 100, 2);
1396 (void)set_oppose_fire(user_ptr, randint1(20) + 20, FALSE);
1400 case ACT_RESIST_COLD:
1402 msg_format(_("%sが白く輝いた...", "The %s grows white."), name);
1403 if ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_ICE))
1405 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
1406 fire_ball(user_ptr, GF_COLD, dir, 100, 2);
1408 (void)set_oppose_cold(user_ptr, randint1(20) + 20, FALSE);
1412 case ACT_RESIST_ELEC:
1414 msg_format(_("%sが青く輝いた...", "The %s grows blue."), name);
1415 if ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_ELEC))
1417 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
1418 fire_ball(user_ptr, GF_ELEC, dir, 100, 2);
1420 (void)set_oppose_elec(user_ptr, randint1(20) + 20, FALSE);
1424 case ACT_RESIST_POIS:
1426 msg_format(_("%sが緑に輝いた...", "The %s grows green."), name);
1427 (void)set_oppose_pois(user_ptr, randint1(20) + 20, FALSE);
1431 /* Activate for general purpose effect (detection etc.) */
1435 msg_format(_("%sから澄んだ光があふれ出た...", "The %s wells with clear light..."), name);
1436 lite_area(user_ptr, damroll(2, 15), 3);
1442 msg_print(_("眩しく輝いた...", "It shines brightly..."));
1443 map_area(user_ptr, DETECT_RAD_MAP);
1444 lite_area(user_ptr, damroll(2, 15), 3);
1448 case ACT_DETECT_ALL:
1450 msg_print(_("白く明るく輝いている...", "It glows bright white..."));
1451 msg_print(_("心にイメージが浮かんできた...", "An image forms in your mind..."));
1452 detect_all(user_ptr, DETECT_RAD_DEFAULT);
1456 case ACT_DETECT_XTRA:
1458 msg_print(_("明るく輝いている...", "It glows brightly..."));
1459 detect_all(user_ptr, DETECT_RAD_DEFAULT);
1461 identify_fully(user_ptr, FALSE, 0);
1467 msg_print(_("黄色く輝いている...", "It glows yellow..."));
1468 identify_fully(user_ptr, FALSE, 0);
1474 if (!ident_spell(user_ptr, FALSE, 0)) return FALSE;
1478 case ACT_RUNE_EXPLO:
1480 msg_print(_("明るい赤色に輝いている...", "It glows bright red..."));
1481 explosive_rune(user_ptr, user_ptr->y, user_ptr->x);
1487 msg_print(_("ブルーに明るく輝いている...", "It glows light blue..."));
1488 warding_glyph(user_ptr);
1494 (void)set_food(user_ptr, PY_FOOD_MAX - 1);
1500 msg_print(_("明るい赤色に輝いている...", "It glows bright red..."));
1501 destroy_doors_touch(user_ptr);
1507 msg_print(_("鼓動している...", "It pulsates..."));
1508 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
1509 wall_to_mud(user_ptr, dir, 20 + randint1(30));
1515 recharge(user_ptr, 130);
1521 msg_print(_("明るい黄色に輝いている...", "It glows bright yellow..."));
1522 (void)alchemy(user_ptr);
1528 msg_print(_("次元の扉が開いた。目的地を選んで下さい。", "You open a dimensional gate. Choose a destination."));
1529 if (!dimension_door(user_ptr)) return FALSE;
1536 msg_print(_("周りの空間が歪んでいる...", "It twists space around you..."));
1537 teleport_player(user_ptr, 100, TELEPORT_SPONTANEOUS);
1543 msg_print(_("やわらかな白色に輝いている...", "It glows soft white..."));
1544 if (!recall_player(user_ptr, randint0(21) + 15)) return FALSE;
1550 msg_format(_("%sは赤く明るく光った!", "The %s flashes bright red!"), name);
1551 chg_virtue(user_ptr, V_KNOWLEDGE, 1);
1552 chg_virtue(user_ptr, V_ENLIGHTEN, 1);
1553 wiz_lite(user_ptr, FALSE);
1555 msg_format(_("%sはあなたの体力を奪った...", "The %s drains your vitality..."), name);
1556 take_hit(user_ptr, DAMAGE_LOSELIFE, damroll(3, 8), _("審判の宝石", "the Jewel of Judgement"), -1);
1558 (void)detect_traps(user_ptr, DETECT_RAD_DEFAULT, TRUE);
1559 (void)detect_doors(user_ptr, DETECT_RAD_DEFAULT);
1560 (void)detect_stairs(user_ptr, DETECT_RAD_DEFAULT);
1562 if (get_check(_("帰還の力を使いますか?", "Activate recall? ")))
1564 (void)recall_player(user_ptr, randint0(21) + 15);
1570 case ACT_TELEKINESIS:
1572 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
1573 msg_format(_("%sを伸ばした。", "You stretched your %s."), name);
1574 fetch(user_ptr, dir, 500, TRUE);
1578 case ACT_DETECT_UNIQUE:
1581 monster_type *m_ptr;
1582 monster_race *r_ptr;
1583 msg_print(_("奇妙な場所が頭の中に浮かんだ...", "Some strange places show up in your mind. And you see ..."));
1584 /* Process the monsters (backwards) */
1585 for (i = user_ptr->current_floor_ptr->m_max - 1; i >= 1; i--)
1587 m_ptr = &user_ptr->current_floor_ptr->m_list[i];
1589 /* Ignore "dead" monsters */
1590 if (!monster_is_valid(m_ptr)) continue;
1592 r_ptr = &r_info[m_ptr->r_idx];
1594 if (r_ptr->flags1 & RF1_UNIQUE)
1596 msg_format(_("%s. ", "%s. "), r_name + r_ptr->name);
1604 switch (randint1(13))
1606 case 1: case 2: case 3: case 4: case 5:
1607 teleport_player(user_ptr, 10, TELEPORT_SPONTANEOUS);
1609 case 6: case 7: case 8: case 9: case 10:
1610 teleport_player(user_ptr, 222, TELEPORT_SPONTANEOUS);
1613 (void)stair_creation(user_ptr);
1616 if (get_check(_("この階を去りますか?", "Leave this level? ")))
1618 if (autosave_l) do_cmd_save_game(user_ptr, TRUE);
1619 user_ptr->leaving = TRUE;
1625 case ACT_DISP_CURSE_XTRA:
1627 msg_format(_("%sが真実を照らし出す...", "The %s exhibits the truth..."), name);
1628 (void)remove_all_curse(user_ptr);
1629 (void)probing(user_ptr);
1633 case ACT_BRAND_FIRE_BOLTS:
1635 msg_format(_("%sが深紅に輝いた...", "Your %s glows deep red..."), name);
1636 brand_bolts(user_ptr);
1640 case ACT_RECHARGE_XTRA:
1642 msg_format(_("%sが白く輝いた...", "The %s gleams with blinding light..."), name);
1643 if (!recharge(user_ptr, 1000)) return FALSE;
1648 msg_print(_("石が隠された秘密を写し出した...", "The stone reveals hidden mysteries..."));
1649 if (!perilous_secrets(user_ptr)) return FALSE;
1654 msg_print(_("力強く四股を踏んだ。", "You stamp. (as if you are in a ring.)"));
1655 (void)set_afraid(user_ptr, 0);
1656 (void)set_hero(user_ptr, randint1(20) + 20, FALSE);
1657 dispel_evil(user_ptr, user_ptr->lev * 3);
1661 case ACT_PHASE_DOOR:
1663 teleport_player(user_ptr, 10, TELEPORT_SPONTANEOUS);
1667 case ACT_DETECT_ALL_MONS:
1669 (void)detect_monsters_invis(user_ptr, 255);
1670 (void)detect_monsters_normal(user_ptr, 255);
1674 case ACT_ULTIMATE_RESIST:
1676 TIME_EFFECT v = randint1(25) + 25;
1677 (void)set_afraid(user_ptr, 0);
1678 (void)set_hero(user_ptr, v, FALSE);
1679 (void)hp_player(user_ptr, 10);
1680 (void)set_blessed(user_ptr, v, FALSE);
1681 (void)set_oppose_acid(user_ptr, v, FALSE);
1682 (void)set_oppose_elec(user_ptr, v, FALSE);
1683 (void)set_oppose_fire(user_ptr, v, FALSE);
1684 (void)set_oppose_cold(user_ptr, v, FALSE);
1685 (void)set_oppose_pois(user_ptr, v, FALSE);
1686 (void)set_ultimate_res(user_ptr, v, FALSE);
1691 cosmic_cast_off(user_ptr, o_ptr);
1694 case ACT_FALLING_STAR:
1696 msg_print(_("あなたは妖刀に魅入られた…", "You are enchanted by cursed blade..."));
1697 msg_print(_("「狂ほしく 血のごとき 月はのぼれり 秘めおきし 魔剣 いずこぞや」", "'Behold the blade arts.'"));
1702 case ACT_GRAND_CROSS:
1704 msg_print(_("「闇に還れ!」", "You say, 'Return to darkness!'"));
1705 project(user_ptr, 0, 8, user_ptr->y, user_ptr->x, (randint1(100) + 200) * 2, GF_HOLY_FIRE, PROJECT_KILL | PROJECT_ITEM | PROJECT_GRID, -1);
1709 case ACT_TELEPORT_LEVEL:
1711 if (!get_check(_("本当に他の階にテレポートしますか?", "Are you sure? (Teleport Level)"))) return FALSE;
1712 teleport_level(user_ptr, 0);
1716 case ACT_STRAIN_HASTE:
1719 msg_format(_("%sはあなたの体力を奪った...", "The %s drains your vitality..."), name);
1720 take_hit(user_ptr, DAMAGE_LOSELIFE, damroll(3, 8), _("加速した疲労", "the strain of haste"), -1);
1721 t = 25 + randint1(25);
1722 (void)set_fast(user_ptr, user_ptr->fast + t, FALSE);
1727 if (!fishing(user_ptr)) return FALSE;
1731 mitokohmon(user_ptr);
1736 /* Only for Muramasa */
1737 if (o_ptr->name1 != ART_MURAMASA) return FALSE;
1738 if (get_check(_("本当に使いますか?", "Are you sure?!")))
1740 msg_print(_("村正が震えた...", "The Muramasa pulsates..."));
1741 do_inc_stat(user_ptr, A_STR);
1744 msg_print(_("村正は壊れた!", "The Muramasa is destroyed!"));
1745 curse_weapon_object(user_ptr, TRUE, o_ptr);
1751 case ACT_BLOODY_MOON:
1753 /* Only for Bloody Moon */
1754 if (o_ptr->name1 != ART_BLOOD) return FALSE;
1755 msg_print(_("鎌が明るく輝いた...", "Your scythe glows brightly!"));
1756 get_bloody_moon_flags(o_ptr);
1757 if (user_ptr->prace == RACE_ANDROID) calc_android_exp(user_ptr);
1758 user_ptr->update |= (PU_BONUS | PU_HP);
1763 if (o_ptr->name1 != ART_CRIMSON) return FALSE;
1764 msg_print(_("せっかくだから『クリムゾン』をぶっぱなすぜ!", "I'll fire CRIMSON! SEKKAKUDAKARA!"));
1765 if (!fire_crimson(user_ptr)) return FALSE;
1770 msg_format(_("Unknown activation effect: %d.", "Unknown activation effect: %d."), act_ptr->index);
1775 /* Set activation timeout */
1776 if (act_ptr->timeout.constant >= 0) {
1777 o_ptr->timeout = (s16b)act_ptr->timeout.constant;
1778 if (act_ptr->timeout.dice > 0) {
1779 o_ptr->timeout += randint1(act_ptr->timeout.dice);
1783 /* Activations that have special timeout */
1784 switch (act_ptr->index) {
1786 o_ptr->timeout = ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_FLAMES)) ? 200 : 250;
1789 o_ptr->timeout = ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_ICE)) ? 200 : 250;
1792 o_ptr->timeout = 3 * (user_ptr->lev + 10);
1798 msg_format("Special timeout is not implemented: %d.", act_ptr->index);