OSDN Git Service

[Refactor] #40414 Moved concrete spell kinds file (spell-*.c/h) from spell/ to spell...
[hengband/hengband.git] / src / cmd-item / cmd-activate.c
1 /*!
2  * @brief プレイヤーの発動コマンド実装
3  * @date 2018/09/07
4  * @author deskull
5  */
6
7 #include "cmd-item/cmd-activate.h"
8 #include "cmd-io/cmd-save.h"
9 #include "cmd/cmd-basic.h"
10 #include "core/sort.h"
11 #include "effect/effect-characteristics.h"
12 #include "effect/spells-effect-util.h"
13 #include "floor/floor.h"
14 #include "inventory/player-inventory.h"
15 #include "io/files-util.h"
16 #include "io/targeting.h"
17 #include "main/sound-definitions-table.h"
18 #include "monster/monster-status.h"
19 #include "object-enchant/artifact.h"
20 #include "object/item-use-flags.h"
21 #include "object-enchant/object-ego.h"
22 #include "object/object-hook.h"
23 #include "object/object-kind.h"
24 #include "sv-definition/sv-lite-types.h"
25 #include "sv-definition/sv-ring-types.h"
26 #include "player/avatar.h"
27 #include "player/player-damage.h"
28 #include "player/player-effects.h"
29 #include "player/player-races-table.h"
30 #include "spell/process-effect.h"
31 #include "spell-kind/spells-beam.h"
32 #include "spell-kind/spells-detection.h"
33 #include "spell-kind/spells-floor.h"
34 #include "spell-kind/spells-genocide.h"
35 #include "spell/spells-hex.h"
36 #include "spell-kind/spells-launcher.h"
37 #include "spell-kind/spells-lite.h"
38 #include "spell-kind/spells-neighbor.h"
39 #include "spell/spells-object.h"
40 #include "spell-kind/spells-sight.h"
41 #include "spell-kind/spells-specific-bolt.h"
42 #include "spell/spells-status.h"
43 #include "spell/spells-summon.h"
44 #include "spell-kind/spells-teleport.h"
45 #include "spell/spells-type.h"
46 #include "spell/spells2.h"
47 #include "spell/spells3.h"
48 #include "world/world.h"
49
50 /*!
51  * @brief 装備耐性に準じたブレス効果の選択テーブル /
52  * Define flags, effect type, name for dragon breath activation
53  */
54 const dragonbreath_type dragonbreath_info[] = {
55         { TR_RES_ACID, GF_ACID, _("酸", "acid") },
56         { TR_RES_ELEC, GF_ELEC, _("電撃", "lightning") },
57         { TR_RES_FIRE, GF_FIRE, _("火炎", "fire") },
58         { TR_RES_COLD, GF_COLD, _("冷気", "cold") },
59         { TR_RES_POIS, GF_POIS, _("毒", "poison") },
60         { TR_RES_LITE, GF_LITE, _("閃光", "light") },
61         { TR_RES_DARK, GF_DARK, _("暗黒", "dark") },
62         { TR_RES_SHARDS, GF_SHARDS, _("破片", "shard") },
63         { TR_RES_CONF, GF_CONFUSION, _("混乱", "confusion") },
64         { TR_RES_SOUND, GF_SOUND, _("轟音", "sound") },
65         { TR_RES_NEXUS, GF_NEXUS, _("因果混乱", "nexus") },
66         { TR_RES_NETHER, GF_NETHER, _("地獄", "nether") },
67         { TR_RES_CHAOS, GF_CHAOS, _("カオス", "chaos") },
68         { TR_RES_DISEN, GF_DISENCHANT, _("劣化", "disenchant") },
69         { 0, 0, NULL }
70 };
71
72 /*!
73  * @brief アイテムの発動効果テーブル /
74  * Define flags, levels, values of activations
75  */
76 const activation_type activation_info[] =
77 {
78         { "SUNLIGHT", ACT_SUNLIGHT, 10, 250, {10, 0},
79           _("太陽光線", "beam of sunlight") },
80         { "BO_MISS_1", ACT_BO_MISS_1, 10, 250, {2, 0},
81           _("マジック・ミサイル(2d6)", "magic missile (2d6)") },
82         { "BA_POIS_1", ACT_BA_POIS_1, 10, 300, {4, 0},
83           _("悪臭雲(12)", "stinking cloud (12)") },
84         { "BO_ELEC_1", ACT_BO_ELEC_1, 20, 250, {5, 0},
85           _("サンダー・ボルト(4d8)", "lightning bolt (4d8)") },
86         { "BO_ACID_1", ACT_BO_ACID_1, 20, 250, {6, 0},
87           _("アシッド・ボルト(5d8)", "acid bolt (5d8)") },
88         { "BO_COLD_1", ACT_BO_COLD_1, 20, 250, {7, 0},
89           _("アイス・ボルト(6d8)", "frost bolt (6d8)") },
90         { "BO_FIRE_1", ACT_BO_FIRE_1, 20, 250, {8, 0},
91           _("ファイア・ボルト(9d8)", "fire bolt (9d8)") },
92         { "BA_COLD_1", ACT_BA_COLD_1, 30, 750, {6, 0},
93           _("アイス・ボール(48)", "ball of cold (48)") },
94         { "BA_COLD_2", ACT_BA_COLD_2, 40, 1000, {12, 0},
95           _("アイス・ボール(100)", "ball of cold (100)") },
96         { "BA_COLD_3", ACT_BA_COLD_3, 70, 2500, {50, 0},
97           _("巨大アイス・ボール(400)", "ball of cold (400)") },
98         { "BA_FIRE_1", ACT_BA_FIRE_1, 30, 1000, {9, 0},
99           _("ファイア・ボール(72)", "ball of fire (72)") },
100         { "BA_FIRE_2", ACT_BA_FIRE_2, 40, 1500, {15, 0},
101           _("巨大ファイア・ボール(120)", "large fire ball (120)") },
102         { "BA_FIRE_3", ACT_BA_FIRE_3, 60, 1750, {40, 0},
103           _("巨大ファイア・ボール(300)", "fire ball (300)") },
104         { "BA_FIRE_4", ACT_BA_FIRE_4, 40, 1000, {12, 0},
105           _("ファイア・ボール(100)", "fire ball (100)") },
106         { "BA_ELEC_2", ACT_BA_ELEC_2, 40, 1000, {12, 0},
107           _("サンダー・ボール(100)", "ball of lightning (100)") },
108         { "BA_ELEC_3", ACT_BA_ELEC_3, 70, 2500, {70, 0},
109           _("巨大サンダー・ボール(500)", "ball of lightning (500)") },
110         { "BA_ACID_1", ACT_BA_ACID_1, 30, 1000, {12, 0},
111           _("アシッド・ボール(100)", "ball of acid (100)") },
112         { "BA_NUKE_1", ACT_BA_NUKE_1, 50, 1000, {12, 0},
113           _("放射能球(100)", "ball of nuke (100)") },
114         { "HYPODYNAMIA_1", ACT_HYPODYNAMIA_1, 30, 500, {12, 0},
115           _("窒息攻撃(100)", "a strangling attack (100)") },
116         { "HYPODYNAMIA_2", ACT_HYPODYNAMIA_2, 40, 750, {15, 0},
117           _("衰弱の矢(120)", "hypodynamic bolt (120)") },
118         { "DRAIN_1", ACT_DRAIN_1, 40, 1000, {20, 0},
119           _("吸収の矢(3*50)", "drain bolt (3*50)") },
120         { "BO_MISS_2", ACT_BO_MISS_2, 40, 1000, {20, 0},
121           _("矢(150)", "arrows (150)") },
122         { "WHIRLWIND", ACT_WHIRLWIND, 50, 7500, {25, 0},
123           _("カマイタチ", "whirlwind attack") },
124         { "DRAIN_2", ACT_DRAIN_2, 50, 2500, {40, 0},
125           _("吸収の矢(3*100)", "drain bolt (3*100)") },
126         { "CALL_CHAOS", ACT_CALL_CHAOS, 70, 5000, {35, 0},
127           _("混沌召来", "call chaos") },
128         { "ROCKET", ACT_ROCKET, 70, 5000, {20, 0},
129           _("ロケット(120+レベル)", "launch rocket (120+level)") },
130         { "DISP_EVIL", ACT_DISP_EVIL, 50, 4000, {50, 0},
131           _("邪悪退散(x5)", "dispel evil (x5)") },
132         { "BA_MISS_3", ACT_BA_MISS_3, 50, 1500, {50, 0},
133           _("エレメントのブレス(300)", "elemental breath (300)") },
134         { "DISP_GOOD", ACT_DISP_GOOD, 50, 3500, {50, 0},
135           _("善良退散(x5)", "dispel good (x5)") },
136         { "BO_MANA", ACT_BO_MANA, 40, 1500, {20, 0},
137           _("魔法の矢(150)", "a magical arrow (150)") },
138         { "BA_WATER", ACT_BA_WATER, 50, 2000, {25, 0},
139           _("ウォーター・ボール(200)", "water ball (200)") },
140         { "BA_STAR", ACT_BA_STAR, 50, 2200, {25, 0},
141           _("巨大スター・ボール(200)", "large star ball (200)") },
142         { "BA_DARK", ACT_BA_DARK, 50, 2200, {30, 0},
143           _("暗黒の嵐(250)", "darkness storm (250)") },
144         { "BA_MANA", ACT_BA_MANA, 70, 2500, {30, 0},
145           _("魔力の嵐(250)", "a mana storm (250)") },
146         { "PESTICIDE", ACT_PESTICIDE, 10, 500, {10, 0},
147           _("害虫の駆除", "dispel small life") },
148         { "BLINDING_LIGHT", ACT_BLINDING_LIGHT, 30, 5000, {40, 0},
149           _("眩しい光", "blinding light") },
150         { "BIZARRE", ACT_BIZARRE, 90, 10000, {50, 0},
151           _("信じ難いこと", "bizarre things") },
152         { "CAST_BA_STAR", ACT_CAST_BA_STAR, 70, 7500, {100, 0},
153           _("スター・ボール・ダスト(150)", "cast star balls (150)") },
154         { "BLADETURNER", ACT_BLADETURNER, 80, 20000, {80, 0},
155           _("エレメントのブレス(300), 士気高揚、祝福、耐性", "breathe elements (300), hero, bless, and resistance") },
156         { "BR_FIRE", ACT_BR_FIRE, 50, 5000, {-1, 0},
157           _("火炎のブレス (200)", "fire breath (200)") },
158         { "BR_COLD", ACT_BR_COLD, 50, 5000, {-1, 0},
159           _("冷気のブレス (200)", "cold breath (200)") },
160         { "BR_DRAGON", ACT_BR_DRAGON, 70, 10000, { 30, 0 },
161           "" /* built by item_activation_dragon_breath() */ },
162
163         { "CONFUSE", ACT_CONFUSE, 10, 500, {10, 0},
164           _("パニック・モンスター", "confuse monster") },
165         { "SLEEP", ACT_SLEEP, 10, 750, {15, 0},
166           _("周囲のモンスターを眠らせる", "sleep nearby monsters") },
167         { "QUAKE", ACT_QUAKE, 30, 600, {20, 0},
168           _("地震", "earthquake") },
169         { "TERROR", ACT_TERROR, 20, 2500, {-1, 0},
170           _("恐慌", "terror") },
171         { "TELE_AWAY", ACT_TELE_AWAY, 20, 2000, {15, 0},
172           _("テレポート・アウェイ", "teleport away") },
173         { "BANISH_EVIL", ACT_BANISH_EVIL, 40, 2000, {250, 0},
174           _("邪悪消滅", "banish evil") },
175         { "GENOCIDE", ACT_GENOCIDE, 50, 10000, {500, 0},
176           _("抹殺", "genocide") },
177         { "MASS_GENO", ACT_MASS_GENO, 50, 10000, {1000, 0},
178           _("周辺抹殺", "mass genocide") },
179         { "SCARE_AREA", ACT_SCARE_AREA, 20, 2500, {20, 0},
180           _("モンスター恐慌", "frighten monsters") },
181         { "AGGRAVATE", ACT_AGGRAVATE, 0, 100, {0, 0},
182           _("モンスターを怒らせる", "aggravete monsters") },
183
184         { "CHARM_ANIMAL", ACT_CHARM_ANIMAL, 40, 7500, {200, 0},
185           _("動物魅了", "charm animal") },
186         { "CHARM_UNDEAD", ACT_CHARM_UNDEAD, 40, 10000, {333, 0},
187           _("アンデッド従属", "enslave undead") },
188         { "CHARM_OTHER", ACT_CHARM_OTHER, 40, 10000, {400, 0},
189           _("モンスター魅了", "charm monster") },
190         { "CHARM_ANIMALS", ACT_CHARM_ANIMALS, 40, 12500, {500, 0},
191           _("動物友和", "animal friendship") },
192         { "CHARM_OTHERS", ACT_CHARM_OTHERS, 40, 17500, {750, 0},
193           _("周辺魅了", "mass charm") },
194         { "SUMMON_ANIMAL", ACT_SUMMON_ANIMAL, 50, 10000, {200, 300},
195           _("動物召喚", "summon animal") },
196         { "SUMMON_PHANTOM", ACT_SUMMON_PHANTOM, 50, 12000, {200, 200},
197           _("幻霊召喚", "summon phantasmal servant") },
198         { "SUMMON_ELEMENTAL", ACT_SUMMON_ELEMENTAL, 50, 15000, {750, 0},
199           _("エレメンタル召喚", "summon elemental") },
200         { "SUMMON_DEMON", ACT_SUMMON_DEMON, 50, 20000, {666, 0},
201           _("悪魔召喚", "summon demon") },
202         { "SUMMON_UNDEAD", ACT_SUMMON_UNDEAD, 50, 20000, {666, 0},
203           _("アンデッド召喚", "summon undead") },
204         { "SUMMON_HOUND", ACT_SUMMON_HOUND, 50, 15000, {300, 0},
205           _("ハウンド召喚", "summon hound") },
206         { "SUMMON_DAWN", ACT_SUMMON_DAWN, 50, 15000, {500, 0},
207           _("暁の師団召喚", "summon the Legion of the Dawn") },
208         { "SUMMON_OCTOPUS", ACT_SUMMON_OCTOPUS, 50, 15000, {300, 0},
209           _("蛸の大群召喚", "summon octopus") },
210
211         { "CHOIR_SINGS", ACT_CHOIR_SINGS, 60, 20000, {300, 0},
212           _("回復(777)、癒し、士気高揚", "heal 777 hit points, curing and HEROism") },
213         { "CURE_LW", ACT_CURE_LW, 10, 500, {10, 0},
214           _("恐怖除去/体力回復(30)", "remove fear and heal 30 hp") },
215         { "CURE_MW", ACT_CURE_MW, 20, 750, {3, 3},
216           _("傷回復(4d8)", "heal 4d8 and wounds") },
217         { "CURE_POISON", ACT_CURE_POISON, 10, 1000, {5, 0},
218           _("恐怖除去/毒消し", "remove fear and cure poison") },
219         { "REST_LIFE", ACT_REST_EXP, 40, 7500, {450, 0},
220           _("経験値復活", "restore experience") },
221         { "REST_ALL", ACT_REST_ALL, 30, 15000, {750, 0},
222           _("全ステータスと経験値復活", "restore stats and experience") },
223         { "CURE_700", ACT_CURE_700, 40, 10000, {250, 0},
224           _("体力回復(700)", "heal 700 hit points") },
225         { "CURE_1000", ACT_CURE_1000, 50, 15000, {888, 0},
226           _("体力回復(1000)", "heal 1000 hit points") },
227         { "CURING", ACT_CURING, 30, 5000, {100, 0},
228           _("癒し", "curing") },
229         { "CURE_MANA_FULL", ACT_CURE_MANA_FULL, 60, 20000, {777, 0},
230           _("魔力復活", "restore mana") },
231
232         { "ESP", ACT_ESP, 30, 1500, {100, 0},
233           _("テレパシー(期間 25+d30)", "telepathy (dur 25+d30)") },
234         { "BERSERK", ACT_BERSERK, 10, 800, {75, 0},
235           _("狂戦士化(25+d25ターン)", "berserk (25+d25 turns)") },
236         { "PROT_EVIL", ACT_PROT_EVIL, 30, 5000, {100, 0},
237           _("対邪悪結界(期間 3*レベル+d25)", "protect evil (dur level*3 + d25)") },
238         { "RESIST_ALL", ACT_RESIST_ALL, 30, 5000, {111, 0},
239           _("全耐性(期間 20+d20)", "resist elements (dur 20+d20)") },
240         { "SPEED", ACT_SPEED, 40, 15000, {250, 0},
241           _("加速(期間 20+d20)", "speed (dur 20+d20)") },
242         { "XTRA_SPEED", ACT_XTRA_SPEED, 40, 25000, {200, 200},
243           _("加速(期間 75+d75)", "speed (dur 75+d75)") },
244         { "WRAITH", ACT_WRAITH, 90, 25000, {1000, 0},
245           _("幽体化(期間 (レベル/2)+d(レベル/2))", "wraith form (dur level/2 + d(level/2))") },
246         { "INVULN", ACT_INVULN, 90, 25000, {1000, 0},
247           _("無敵化(期間 8+d8)", "invulnerability (dur 8+d8)") },
248         { "HERO", ACT_HERO, 10, 500, {30, 30},
249           _("士気高揚", "heroism") },
250         { "HERO_SPEED", ACT_HERO_SPEED, 30, 20000, {100, 200},
251           _("士気高揚, スピード(期間 50+d50ターン)", "hero and +10 to speed (50)") },
252         { "RESIST_ACID", ACT_RESIST_ACID, 20, 2000, {40, 40},
253           _("酸への耐性(期間 20+d20)", "resist acid (dur 20+d20)") },
254         { "RESIST_FIRE", ACT_RESIST_FIRE, 20, 2000, {40, 40},
255           _("火炎への耐性(期間 20+d20)", "resist fire (dur 20+d20)") },
256         { "RESIST_COLD", ACT_RESIST_COLD, 20, 2000, {40, 40},
257           _("冷気への耐性(期間 20+d20)", "resist cold (dur 20+d20)") },
258         { "RESIST_ELEC", ACT_RESIST_ELEC, 20, 2000, {40, 40},
259           _("電撃への耐性(期間 20+d20)", "resist elec (dur 20+d20)") },
260         { "RESIST_POIS", ACT_RESIST_POIS, 20, 2000, {40, 40},
261           _("毒への耐性(期間 20+d20)", "resist poison (dur 20+d20)") },
262
263         { "LIGHT", ACT_LIGHT, 10, 150, {10, 10},
264           _("イルミネーション", "light area (dam 2d15)") },
265         { "MAP_LIGHT", ACT_MAP_LIGHT, 30, 500, {50, 50},
266           _("魔法の地図と光", "light (dam 2d15) & map area") },
267         { "DETECT_ALL", ACT_DETECT_ALL, 30, 1000, {55, 55},
268           _("全感知", "detection") },
269         { "DETECT_XTRA", ACT_DETECT_XTRA, 50, 12500, {100, 0},
270           _("全感知、探索、*鑑定*", "detection, probing and identify true") },
271         { "ID_FULL", ACT_ID_FULL, 50, 10000, {75, 0},
272           _("*鑑定*", "identify true") },
273         { "ID_PLAIN", ACT_ID_PLAIN, 20, 1250, {10, 0},
274           _("鑑定", "identify spell") },
275         { "RUNE_EXPLO", ACT_RUNE_EXPLO, 40, 4000, {200, 0},
276           _("爆発のルーン", "explosive rune") },
277         { "RUNE_PROT", ACT_RUNE_PROT, 60, 10000, {400, 0},
278           _("守りのルーン", "rune of protection") },
279         { "SATIATE", ACT_SATIATE, 10, 2000, {200, 0},
280           _("空腹充足", "satisfy hunger") },
281         { "DEST_DOOR", ACT_DEST_DOOR, 10, 100, {10, 0},
282           _("ドア破壊", "destroy doors") },
283         { "STONE_MUD", ACT_STONE_MUD, 20, 1000, {3, 0},
284           _("岩石溶解", "stone to mud") },
285         { "RECHARGE", ACT_RECHARGE, 30, 1000, {70, 0},
286           _("魔力充填", "recharging") },
287         { "ALCHEMY", ACT_ALCHEMY, 50, 10000, {500, 0},
288           _("錬金術", "alchemy") },
289         { "DIM_DOOR", ACT_DIM_DOOR, 50, 10000, {100, 0},
290           _("次元の扉", "dimension door") },
291         { "TELEPORT", ACT_TELEPORT, 10, 2000, {25, 0},
292           _("テレポート", "teleport") },
293         { "RECALL", ACT_RECALL, 30, 7500, {200, 0},
294           _("帰還の詔", "word of recall") },
295         { "JUDGE", ACT_JUDGE, 90, 50000, {20, 20},
296           _("体力と引き替えに千里眼と帰還", "a telekinesis (500 lb)") },
297         { "TELEKINESIS", ACT_TELEKINESIS, 20, 5500, {25, 25},
298           _("物体を引き寄せる(重量25kgまで)", "clairvoyance and recall, draining you") },
299         { "DETECT_UNIQUE", ACT_DETECT_UNIQUE, 40, 10000, {200, 0},
300           _("この階にいるユニークモンスターを表示", "list of the uniques on the level") },
301         { "ESCAPE", ACT_ESCAPE, 10, 3000, {35, 0},
302           _("逃走", "a getaway") },
303         { "DISP_CURSE_XTRA", ACT_DISP_CURSE_XTRA, 40, 30000, {0, 0},
304           _("*解呪*と調査", "dispel curse and probing") },
305         { "BRAND_FIRE_BOLTS", ACT_BRAND_FIRE_BOLTS, 40, 20000, {999, 0},
306           _("刃先のファイア・ボルト", "fire branding of bolts") },
307         { "RECHARGE_XTRA", ACT_RECHARGE_XTRA, 70, 30000, {200, 0},
308           _("魔力充填", "recharge item") },
309         { "LORE", ACT_LORE, 10, 30000, {0, 0},
310           _("危険を伴う鑑定", "perilous identify") },
311         { "SHIKOFUMI", ACT_SHIKOFUMI, 10, 10000, {100, 100},
312           _("四股踏み", "shiko") },
313         { "PHASE_DOOR", ACT_PHASE_DOOR, 10, 1500, {10, 0},
314           _("ショート・テレポート", "blink") },
315         { "DETECT_ALL_MONS", ACT_DETECT_ALL_MONS, 30, 3000, {150, 0},
316           _("全モンスター感知", "detect all monsters") },
317         { "ULTIMATE_RESIST", ACT_ULTIMATE_RESIST, 90, 20000, {777, 0},
318           _("士気高揚、祝福、究極の耐性", "hero, bless, and ultimate resistance") },
319
320         { "CAST_OFF", ACT_CAST_OFF, 30, 15000, {100, 0},
321           _("脱衣と小宇宙燃焼", "cast it off and cosmic heroism") },
322         { "FISHING", ACT_FISHING, 0, 100, {0, 0},
323           _("釣りをする", "fishing") },
324         { "INROU", ACT_INROU, 40, 15000, {150, 150},
325           _("例のアレ", "reveal your identity") },
326         { "MURAMASA", ACT_MURAMASA, 0, 0, {-1, 0},
327           _("腕力の上昇", "increase STR") },
328         { "BLOODY_MOON", ACT_BLOODY_MOON, 0, 0, {3333, 0},
329           _("属性変更", "change zokusei") },
330         { "CRIMSON", ACT_CRIMSON, 0, 50000, {15, 0},
331           _("ファイア!", "fire!") },
332
333         { "STRAIN_HASTE", ACT_STRAIN_HASTE, 10, 1000, {120, 100},
334           _("体力と引き換えに加速", "haste with strain") },
335         { "GRAND_CROSS", ACT_GRAND_CROSS, 30, 15000, {250, 200},
336           _("グランド・クロス", "grand cross") },
337         { "TELEPORT_LEVEL", ACT_TELEPORT_LEVEL, 10, 1500, {100, 200},
338           _("テレポート・レベル", "teleort level") },
339         { "ARTS_FALLING_STAR", ACT_FALLING_STAR, 20, 5500, {30, 50},
340           _("魔剣・流れ星", "blade arts 'falling star'") },
341         { NULL, 0, 0, 0, {0, 0},
342           "" }
343 };
344
345 /*!
346  * @brief 装備を発動するコマンドのサブルーチン /
347  * Activate a wielded object.  Wielded objects never stack.
348  * And even if they did, activatable objects never stack.
349  * @param item 発動するオブジェクトの所持品ID
350  * @return なし
351  * @details
352  * <pre>
353  * Currently, only (some) artifacts, and Dragon Scale Mail, can be activated.
354  * But one could, for example, easily make an activatable "Ring of Plasma".
355  * Note that it always takes a turn to activate an artifact, even if
356  * the user hits "escape" at the "direction" prompt.
357  * </pre>
358  */
359 void exe_activate(player_type *user_ptr, INVENTORY_IDX item)
360 {
361         DIRECTION dir;
362         DEPTH lev;
363         int chance, fail;
364         object_type *o_ptr;
365         bool success;
366
367         o_ptr = ref_item(user_ptr, item);
368         take_turn(user_ptr, 100);
369         lev = k_info[o_ptr->k_idx].level;
370
371         /* Hack -- use artifact level instead */
372         if (object_is_fixed_artifact(o_ptr)) lev = a_info[o_ptr->name1].level;
373         else if (object_is_random_artifact(o_ptr))
374         {
375                 const activation_type* const act_ptr = find_activation_info(o_ptr);
376                 if (act_ptr) {
377                         lev = act_ptr->level;
378                 }
379         }
380         else if (((o_ptr->tval == TV_RING) || (o_ptr->tval == TV_AMULET)) && o_ptr->name2) lev = e_info[o_ptr->name2].level;
381
382         /* Base chance of success */
383         chance = user_ptr->skill_dev;
384
385         /* Confusion hurts skill */
386         if (user_ptr->confused) chance = chance / 2;
387
388         fail = lev + 5;
389         if (chance > fail) fail -= (chance - fail) * 2;
390         else chance -= (fail - chance) * 2;
391         if (fail < USE_DEVICE) fail = USE_DEVICE;
392         if (chance < USE_DEVICE) chance = USE_DEVICE;
393
394         if (cmd_limit_time_walk(user_ptr)) return;
395
396         if (user_ptr->pclass == CLASS_BERSERKER) success = FALSE;
397         else if (chance > fail)
398         {
399                 if (randint0(chance * 2) < fail) success = FALSE;
400                 else success = TRUE;
401         }
402         else
403         {
404                 if (randint0(fail * 2) < chance) success = TRUE;
405                 else success = FALSE;
406         }
407
408         /* Roll for usage */
409         if (!success)
410         {
411                 if (flush_failure) flush();
412                 msg_print(_("うまく始動させることができなかった。", "You failed to activate it properly."));
413                 sound(SOUND_FAIL);
414                 return;
415         }
416
417         /* Check the recharge */
418         if (o_ptr->timeout)
419         {
420                 msg_print(_("それは微かに音を立て、輝き、消えた...", "It whines, glows and fades..."));
421                 return;
422         }
423
424         /* Some lights need enough fuel for activation */
425         if (!o_ptr->xtra4 && (o_ptr->tval == TV_FLASK) &&
426                 ((o_ptr->sval == SV_LITE_TORCH) || (o_ptr->sval == SV_LITE_LANTERN)))
427         {
428                 msg_print(_("燃料がない。", "It has no fuel."));
429                 free_turn(user_ptr);
430                 return;
431         }
432
433         /* Activate the artifact */
434         msg_print(_("始動させた...", "You activate it..."));
435
436         sound(SOUND_ZAP);
437
438         /* Activate object */
439         if (activation_index(o_ptr))
440         {
441                 (void)activate_artifact(user_ptr, o_ptr);
442
443                 user_ptr->window |= (PW_INVEN | PW_EQUIP);
444
445                 /* Success */
446                 return;
447         }
448
449         /* Special items */
450         else if (o_ptr->tval == TV_WHISTLE)
451         {
452                 if (music_singing_any(user_ptr)) stop_singing(user_ptr);
453                 if (hex_spelling_any(user_ptr)) stop_hex_spell_all(user_ptr);
454
455                 {
456                         MONSTER_IDX pet_ctr, i;
457                         MONSTER_IDX *who;
458                         int max_pet = 0;
459                         u16b dummy_why;
460
461                         /* Allocate the "who" array */
462                         C_MAKE(who, current_world_ptr->max_m_idx, MONSTER_IDX);
463
464                         /* Process the monsters (backwards) */
465                         for (pet_ctr = user_ptr->current_floor_ptr->m_max - 1; pet_ctr >= 1; pet_ctr--)
466                         {
467                                 if (is_pet(&user_ptr->current_floor_ptr->m_list[pet_ctr]) && (user_ptr->riding != pet_ctr))
468                                         who[max_pet++] = pet_ctr;
469                         }
470
471                         ang_sort(who, &dummy_why, max_pet, ang_sort_comp_pet, ang_sort_swap_hook);
472
473                         /* Process the monsters (backwards) */
474                         for (i = 0; i < max_pet; i++)
475                         {
476                                 pet_ctr = who[i];
477                                 teleport_monster_to(user_ptr, pet_ctr, user_ptr->y, user_ptr->x, 100, TELEPORT_PASSIVE);
478                         }
479
480                         /* Free the "who" array */
481                         C_KILL(who, current_world_ptr->max_m_idx, MONSTER_IDX);
482                 }
483                 o_ptr->timeout = 100 + randint1(100);
484                 return;
485         }
486         else if (o_ptr->tval == TV_CAPTURE)
487         {
488                 if (!o_ptr->pval)
489                 {
490                         bool old_target_pet = target_pet;
491                         target_pet = TRUE;
492                         if (!get_aim_dir(user_ptr, &dir))
493                         {
494                                 target_pet = old_target_pet;
495                                 return;
496                         }
497                         target_pet = old_target_pet;
498
499                         if (fire_ball(user_ptr, GF_CAPTURE, dir, 0, 0))
500                         {
501                                 o_ptr->pval = (PARAMETER_VALUE)cap_mon;
502                                 o_ptr->xtra3 = (XTRA8)cap_mspeed;
503                                 o_ptr->xtra4 = (XTRA16)cap_hp;
504                                 o_ptr->xtra5 = (XTRA16)cap_maxhp;
505                                 if (cap_nickname)
506                                 {
507                                         concptr t;
508                                         char *s;
509                                         char buf[80] = "";
510
511                                         if (o_ptr->inscription)
512                                                 strcpy(buf, quark_str(o_ptr->inscription));
513                                         s = buf;
514                                         for (s = buf; *s && (*s != '#'); s++)
515                                         {
516 #ifdef JP
517                                                 if (iskanji(*s)) s++;
518 #endif
519                                         }
520                                         *s = '#';
521                                         s++;
522 #ifdef JP
523                                         /*nothing*/
524 #else
525                                         *s++ = '\'';
526 #endif
527                                         t = quark_str(cap_nickname);
528                                         while (*t)
529                                         {
530                                                 *s = *t;
531                                                 s++;
532                                                 t++;
533                                         }
534 #ifdef JP
535                                         /*nothing*/
536 #else
537                                         *s++ = '\'';
538 #endif
539                                         *s = '\0';
540                                         o_ptr->inscription = quark_add(buf);
541                                 }
542                         }
543                 }
544                 else
545                 {
546                         success = FALSE;
547                         if (!get_direction(user_ptr, &dir, FALSE, FALSE)) return;
548                         if (monster_can_enter(user_ptr, user_ptr->y + ddy[dir], user_ptr->x + ddx[dir], &r_info[o_ptr->pval], 0))
549                         {
550                                 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)))
551                                 {
552                                         if (o_ptr->xtra3) user_ptr->current_floor_ptr->m_list[hack_m_idx_ii].mspeed = o_ptr->xtra3;
553                                         if (o_ptr->xtra5) user_ptr->current_floor_ptr->m_list[hack_m_idx_ii].max_maxhp = o_ptr->xtra5;
554                                         if (o_ptr->xtra4) user_ptr->current_floor_ptr->m_list[hack_m_idx_ii].hp = o_ptr->xtra4;
555                                         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;
556                                         if (o_ptr->inscription)
557                                         {
558                                                 char buf[80];
559                                                 concptr t;
560 #ifdef JP
561 #else
562                                                 bool quote = FALSE;
563 #endif
564
565                                                 t = quark_str(o_ptr->inscription);
566                                                 for (t = quark_str(o_ptr->inscription); *t && (*t != '#'); t++)
567                                                 {
568 #ifdef JP
569                                                         if (iskanji(*t)) t++;
570 #endif
571                                                 }
572                                                 if (*t)
573                                                 {
574                                                         char *s = buf;
575                                                         t++;
576 #ifdef JP
577                                                         /* nothing */
578 #else
579                                                         if (*t == '\'')
580                                                         {
581                                                                 t++;
582                                                                 quote = TRUE;
583                                                         }
584 #endif
585                                                         while (*t)
586                                                         {
587                                                                 *s = *t;
588                                                                 t++;
589                                                                 s++;
590                                                         }
591 #ifdef JP
592                                                         /* nothing */
593 #else
594                                                         if (quote && *(s - 1) == '\'')
595                                                                 s--;
596 #endif
597                                                         *s = '\0';
598                                                         user_ptr->current_floor_ptr->m_list[hack_m_idx_ii].nickname = quark_add(buf);
599                                                         t = quark_str(o_ptr->inscription);
600                                                         s = buf;
601                                                         while (*t && (*t != '#'))
602                                                         {
603                                                                 *s = *t;
604                                                                 t++;
605                                                                 s++;
606                                                         }
607                                                         *s = '\0';
608                                                         o_ptr->inscription = quark_add(buf);
609                                                 }
610                                         }
611                                         o_ptr->pval = 0;
612                                         o_ptr->xtra3 = 0;
613                                         o_ptr->xtra4 = 0;
614                                         o_ptr->xtra5 = 0;
615                                         success = TRUE;
616                                 }
617                         }
618                         if (!success)
619                                 msg_print(_("おっと、解放に失敗した。", "Oops.  You failed to release your pet."));
620                 }
621                 calc_android_exp(user_ptr);
622                 return;
623         }
624
625         /* Mistake */
626         msg_print(_("おっと、このアイテムは始動できない。", "Oops.  That object cannot be activated."));
627 }
628
629 /*!
630  * @brief 装備を発動するコマンドのメインルーチン /
631  * @param user_ptr プレーヤーへの参照ポインタ
632  * @return なし
633  */
634 void do_cmd_activate(player_type *user_ptr)
635 {
636         OBJECT_IDX item;
637         concptr q, s;
638
639         if (user_ptr->wild_mode) return;
640         if (cmd_limit_arena(user_ptr)) return;
641
642         if (user_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN))
643         {
644                 set_action(user_ptr, ACTION_NONE);
645         }
646
647         item_tester_hook = item_tester_hook_activate;
648
649         q = _("どのアイテムを始動させますか? ", "Activate which item? ");
650         s = _("始動できるアイテムを装備していない。", "You have nothing to activate.");
651
652         if (!choose_object(user_ptr, &item, q, s, (USE_EQUIP | IGNORE_BOTHHAND_SLOT), 0)) return;
653
654         /* Activate the item */
655         exe_activate(user_ptr, item);
656 }
657
658 /*!
659 * @brief 発動によるブレスの属性をアイテムの耐性から選択し、実行を処理する。/ Dragon breath activation
660 * @details 対象となる耐性は dragonbreath_info テーブルを参照のこと。
661 * @param user_ptr プレーヤーへの参照ポインタ
662 * @param o_ptr 対象のオブジェクト構造体ポインタ
663 * @return 発動実行の是非を返す。
664 */
665 static bool activate_dragon_breath(player_type *user_ptr, object_type *o_ptr)
666 {
667         BIT_FLAGS flgs[TR_FLAG_SIZE]; /* for resistance flags */
668         int type[20];
669         concptr name[20];
670         int i, t, n = 0;
671         DIRECTION dir;
672
673         if (!get_aim_dir(user_ptr, &dir)) return FALSE;
674
675         object_flags(o_ptr, flgs);
676
677         for (i = 0; dragonbreath_info[i].flag != 0; i++)
678         {
679                 if (have_flag(flgs, dragonbreath_info[i].flag))
680                 {
681                         type[n] = dragonbreath_info[i].type;
682                         name[n] = dragonbreath_info[i].name;
683                         n++;
684                 }
685         }
686         if (n == 0) return FALSE;
687
688         /* Stop speaking */
689         if (music_singing_any(user_ptr)) stop_singing(user_ptr);
690         if (hex_spelling_any(user_ptr)) stop_hex_spell_all(user_ptr);
691
692         t = randint0(n);
693         msg_format(_("あなたは%sのブレスを吐いた。", "You breathe %s."), name[t]);
694         fire_breath(user_ptr, type[t], dir, 250, 4);
695
696         return TRUE;
697 }
698
699
700 /*!
701  * @brief アイテムの発動効果を処理する。
702  * @param user_ptr プレーヤーへの参照ポインタ
703  * @param o_ptr 対象のオブジェクト構造体ポインタ
704  * @return 発動実行の是非を返す。
705  */
706 bool activate_artifact(player_type *user_ptr, object_type *o_ptr)
707 {
708         PLAYER_LEVEL plev = user_ptr->lev;
709         int k, dummy = 0;
710         DIRECTION dir;
711         concptr name = k_name + k_info[o_ptr->k_idx].name;
712         const activation_type* const act_ptr = find_activation_info(o_ptr);
713         if (!act_ptr) {
714                 /* Maybe forgot adding information to activation_info table ? */
715                 msg_print("Activation information is not found.");
716                 return FALSE;
717         }
718
719         /* Activate for attack */
720         switch (act_ptr->index)
721         {
722         case ACT_SUNLIGHT:
723         {
724                 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
725                 msg_print(_("太陽光線が放たれた。", "A line of sunlight appears."));
726                 (void)lite_line(user_ptr, dir, damroll(6, 8));
727                 break;
728         }
729
730         case ACT_BO_MISS_1:
731         {
732                 msg_print(_("それは眩しいくらいに明るく輝いている...", "It glows extremely brightly..."));
733                 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
734                 fire_bolt(user_ptr, GF_MISSILE, dir, damroll(2, 6));
735                 break;
736         }
737
738         case ACT_BA_POIS_1:
739         {
740                 msg_print(_("それは濃緑色に脈動している...", "It throbs deep green..."));
741                 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
742                 fire_ball(user_ptr, GF_POIS, dir, 12, 3);
743                 break;
744         }
745
746         case ACT_BO_ELEC_1:
747         {
748                 msg_print(_("それは火花に覆われた...", "It is covered in sparks..."));
749                 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
750                 fire_bolt(user_ptr, GF_ELEC, dir, damroll(4, 8));
751                 break;
752         }
753
754         case ACT_BO_ACID_1:
755         {
756                 msg_print(_("それは酸に覆われた...", "It is covered in acid..."));
757                 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
758                 fire_bolt(user_ptr, GF_ACID, dir, damroll(5, 8));
759                 break;
760         }
761
762         case ACT_BO_COLD_1:
763         {
764                 msg_print(_("それは霜に覆われた...", "It is covered in frost..."));
765                 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
766                 fire_bolt(user_ptr, GF_COLD, dir, damroll(6, 8));
767                 break;
768         }
769
770         case ACT_BO_FIRE_1:
771         {
772                 msg_print(_("それは炎に覆われた...", "It is covered in fire..."));
773                 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
774                 fire_bolt(user_ptr, GF_FIRE, dir, damroll(9, 8));
775                 break;
776         }
777
778         case ACT_BA_COLD_1:
779         {
780                 msg_print(_("それは霜に覆われた...", "It is covered in frost..."));
781                 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
782                 fire_ball(user_ptr, GF_COLD, dir, 48, 2);
783                 break;
784         }
785
786         case ACT_BA_COLD_2:
787         {
788                 msg_print(_("それは青く激しく輝いた...", "It glows an intense blue..."));
789                 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
790                 fire_ball(user_ptr, GF_COLD, dir, 100, 2);
791                 break;
792         }
793
794         case ACT_BA_COLD_3:
795         {
796                 msg_print(_("明るく白色に輝いている...", "It glows bright white..."));
797                 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
798                 fire_ball(user_ptr, GF_COLD, dir, 400, 3);
799                 break;
800         }
801
802         case ACT_BA_FIRE_1:
803         {
804                 msg_print(_("それは赤く激しく輝いた...", "It glows an intense red..."));
805                 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
806                 fire_ball(user_ptr, GF_FIRE, dir, 72, 2);
807                 break;
808         }
809
810         case ACT_BA_FIRE_2:
811         {
812                 msg_format(_("%sから炎が吹き出した...", "The %s rages in fire..."), name);
813                 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
814                 fire_ball(user_ptr, GF_FIRE, dir, 120, 3);
815                 break;
816         }
817
818         case ACT_BA_FIRE_3:
819         {
820                 msg_print(_("深赤色に輝いている...", "It glows deep red..."));
821                 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
822                 fire_ball(user_ptr, GF_FIRE, dir, 300, 3);
823                 break;
824         }
825
826         case ACT_BA_FIRE_4:
827         {
828                 msg_print(_("それは赤く激しく輝いた...", "It glows an intense red..."));
829                 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
830                 fire_ball(user_ptr, GF_FIRE, dir, 100, 2);
831                 break;
832         }
833
834         case ACT_BA_ELEC_2:
835         {
836                 msg_print(_("電気がパチパチ音を立てた...", "It crackles with electricity..."));
837                 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
838                 fire_ball(user_ptr, GF_ELEC, dir, 100, 3);
839                 break;
840         }
841
842         case ACT_BA_ELEC_3:
843         {
844                 msg_print(_("深青色に輝いている...", "It glows deep blue..."));
845                 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
846                 fire_ball(user_ptr, GF_ELEC, dir, 500, 3);
847                 break;
848         }
849
850         case ACT_BA_ACID_1:
851         {
852                 msg_print(_("それは黒く激しく輝いた...", "It glows an intense black..."));
853                 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
854                 fire_ball(user_ptr, GF_ACID, dir, 100, 2);
855                 break;
856         }
857
858         case ACT_BA_NUKE_1:
859         {
860                 msg_print(_("それは緑に激しく輝いた...", "It glows an intense green..."));
861                 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
862                 fire_ball(user_ptr, GF_NUKE, dir, 100, 2);
863                 break;
864         }
865
866         case ACT_HYPODYNAMIA_1:
867         {
868                 msg_format(_("あなたは%sに敵を締め殺すよう命じた。", "You order the %s to strangle your opponent."), name);
869                 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
870                 hypodynamic_bolt(user_ptr, dir, 100);
871                 break;
872         }
873
874         case ACT_HYPODYNAMIA_2:
875         {
876                 msg_print(_("黒く輝いている...", "It glows black..."));
877                 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
878                 hypodynamic_bolt(user_ptr, dir, 120);
879                 break;
880         }
881
882         case ACT_DRAIN_1:
883         {
884                 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
885                 for (dummy = 0; dummy < 3; dummy++)
886                 {
887                         if (hypodynamic_bolt(user_ptr, dir, 50))
888                                 hp_player(user_ptr, 50);
889                 }
890                 break;
891         }
892
893         case ACT_BO_MISS_2:
894         {
895                 msg_print(_("魔法のトゲが現れた...", "It grows magical spikes..."));
896                 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
897                 fire_bolt(user_ptr, GF_ARROW, dir, 150);
898                 break;
899         }
900
901         case ACT_WHIRLWIND:
902         {
903                 massacre(user_ptr);
904                 break;
905         }
906
907         case ACT_DRAIN_2:
908         {
909                 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
910                 for (dummy = 0; dummy < 3; dummy++)
911                 {
912                         if (hypodynamic_bolt(user_ptr, dir, 100))
913                                 hp_player(user_ptr, 100);
914                 }
915                 break;
916         }
917
918
919         case ACT_CALL_CHAOS:
920         {
921                 msg_print(_("様々な色の火花を発している...", "It glows in scintillating colours..."));
922                 call_chaos(user_ptr);
923                 break;
924         }
925
926         case ACT_ROCKET:
927         {
928                 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
929                 msg_print(_("ロケットを発射した!", "You launch a rocket!"));
930                 fire_ball(user_ptr, GF_ROCKET, dir, 250 + plev * 3, 2);
931                 break;
932         }
933
934         case ACT_DISP_EVIL:
935         {
936                 msg_print(_("神聖な雰囲気が充満した...", "It floods the area with goodness..."));
937                 dispel_evil(user_ptr, user_ptr->lev * 5);
938                 break;
939         }
940
941         case ACT_BA_MISS_3:
942         {
943                 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
944                 msg_print(_("あなたはエレメントのブレスを吐いた。", "You breathe the elements."));
945                 fire_breath(user_ptr, GF_MISSILE, dir, 300, 4);
946                 break;
947         }
948
949         case ACT_DISP_GOOD:
950         {
951                 msg_print(_("邪悪な雰囲気が充満した...", "It floods the area with evil..."));
952                 dispel_good(user_ptr, user_ptr->lev * 5);
953                 break;
954         }
955
956         case ACT_BO_MANA:
957         {
958                 msg_format(_("%sに魔法のトゲが現れた...", "The %s grows magical spikes..."), name);
959                 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
960                 fire_bolt(user_ptr, GF_ARROW, dir, 150);
961                 break;
962         }
963
964         case ACT_BA_WATER:
965         {
966                 msg_format(_("%sが深い青色に鼓動している...", "The %s throbs deep blue..."), name);
967                 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
968                 fire_ball(user_ptr, GF_WATER, dir, 200, 3);
969                 break;
970         }
971
972         case ACT_BA_DARK:
973         {
974                 msg_format(_("%sが深い闇に覆われた...", "The %s is coverd in pitch-darkness..."), name);
975                 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
976                 fire_ball(user_ptr, GF_DARK, dir, 250, 4);
977                 break;
978         }
979
980         case ACT_BA_MANA:
981         {
982                 msg_format(_("%sが青白く光った...", "The %s glows pale..."), name);
983                 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
984                 fire_ball(user_ptr, GF_MANA, dir, 250, 4);
985                 break;
986         }
987
988         case ACT_PESTICIDE:
989         {
990                 msg_print(_("あなたは害虫を一掃した。", "You exterminate small life."));
991                 (void)dispel_monsters(user_ptr, 4);
992                 break;
993         }
994
995         case ACT_BLINDING_LIGHT:
996         {
997                 msg_format(_("%sが眩しい光で輝いた...", "The %s gleams with blinding light..."), name);
998                 fire_ball(user_ptr, GF_LITE, 0, 300, 6);
999                 confuse_monsters(user_ptr, 3 * user_ptr->lev / 2);
1000                 break;
1001         }
1002
1003         case ACT_BIZARRE:
1004         {
1005                 msg_format(_("%sは漆黒に輝いた...", "The %s glows intensely black..."), name);
1006                 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
1007                 ring_of_power(user_ptr, dir);
1008                 break;
1009         }
1010
1011         case ACT_CAST_BA_STAR:
1012         {
1013                 HIT_POINT num = damroll(5, 3);
1014                 POSITION y = 0, x = 0;
1015                 int attempts;
1016                 msg_format(_("%sが稲妻で覆われた...", "The %s is surrounded by lightning..."), name);
1017                 for (k = 0; k < num; k++)
1018                 {
1019                         attempts = 1000;
1020
1021                         while (attempts--)
1022                         {
1023                                 scatter(user_ptr, &y, &x, user_ptr->y, user_ptr->x, 4, 0);
1024                                 if (!cave_have_flag_bold(user_ptr->current_floor_ptr, y, x, FF_PROJECT)) continue;
1025                                 if (!player_bold(user_ptr, y, x)) break;
1026                         }
1027
1028                         project(user_ptr, 0, 3, y, x, 150, GF_ELEC,
1029                                 (PROJECT_THRU | PROJECT_STOP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL), -1);
1030                 }
1031
1032                 break;
1033         }
1034
1035         case ACT_BLADETURNER:
1036         {
1037                 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
1038                 msg_print(_("あなたはエレメントのブレスを吐いた。", "You breathe the elements."));
1039                 fire_breath(user_ptr, GF_MISSILE, dir, 300, 4);
1040                 msg_print(_("鎧が様々な色に輝いた...", "Your armor glows many colours..."));
1041                 (void)set_afraid(user_ptr, 0);
1042                 (void)set_hero(user_ptr, randint1(50) + 50, FALSE);
1043                 (void)hp_player(user_ptr, 10);
1044                 (void)set_blessed(user_ptr, randint1(50) + 50, FALSE);
1045                 (void)set_oppose_acid(user_ptr, randint1(50) + 50, FALSE);
1046                 (void)set_oppose_elec(user_ptr, randint1(50) + 50, FALSE);
1047                 (void)set_oppose_fire(user_ptr, randint1(50) + 50, FALSE);
1048                 (void)set_oppose_cold(user_ptr, randint1(50) + 50, FALSE);
1049                 (void)set_oppose_pois(user_ptr, randint1(50) + 50, FALSE);
1050                 break;
1051         }
1052
1053         case ACT_BR_FIRE:
1054         {
1055                 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
1056                 fire_breath(user_ptr, GF_FIRE, dir, 200, 2);
1057                 if ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_FLAMES))
1058                 {
1059                         (void)set_oppose_fire(user_ptr, randint1(20) + 20, FALSE);
1060                 }
1061                 break;
1062         }
1063
1064         case ACT_BR_COLD:
1065         {
1066                 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
1067                 fire_breath(user_ptr, GF_COLD, dir, 200, 2);
1068                 if ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_ICE))
1069                 {
1070                         (void)set_oppose_cold(user_ptr, randint1(20) + 20, FALSE);
1071                 }
1072                 break;
1073         }
1074
1075         case ACT_BR_DRAGON:
1076         {
1077                 if (!activate_dragon_breath(user_ptr, o_ptr)) return FALSE;
1078                 break;
1079         }
1080
1081         /* Activate for other offensive action */
1082         case ACT_CONFUSE:
1083         {
1084                 msg_print(_("様々な色の火花を発している...", "It glows in scintillating colours..."));
1085                 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
1086                 confuse_monster(user_ptr, dir, 20);
1087                 break;
1088         }
1089
1090         case ACT_SLEEP:
1091         {
1092                 msg_print(_("深青色に輝いている...", "It glows deep blue..."));
1093                 sleep_monsters_touch(user_ptr);
1094                 break;
1095         }
1096
1097         case ACT_QUAKE:
1098         {
1099                 earthquake(user_ptr, user_ptr->y, user_ptr->x, 5, 0);
1100                 break;
1101         }
1102
1103         case ACT_TERROR:
1104         {
1105                 turn_monsters(user_ptr, 40 + user_ptr->lev);
1106                 break;
1107         }
1108
1109         case ACT_TELE_AWAY:
1110         {
1111                 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
1112                 (void)fire_beam(user_ptr, GF_AWAY_ALL, dir, plev);
1113                 break;
1114         }
1115
1116         case ACT_BANISH_EVIL:
1117         {
1118                 if (banish_evil(user_ptr, 100))
1119                 {
1120                         msg_print(_("アーティファクトの力が邪悪を打ち払った!", "The power of the artifact banishes evil!"));
1121                 }
1122                 break;
1123         }
1124
1125         case ACT_GENOCIDE:
1126         {
1127                 msg_print(_("深青色に輝いている...", "It glows deep blue..."));
1128                 (void)symbol_genocide(user_ptr, 200, TRUE);
1129                 break;
1130         }
1131
1132         case ACT_MASS_GENO:
1133         {
1134                 msg_print(_("ひどく鋭い音が流れ出た...", "It lets out a long, shrill note..."));
1135                 (void)mass_genocide(user_ptr, 200, TRUE);
1136                 break;
1137         }
1138
1139         case ACT_SCARE_AREA:
1140         {
1141                 if (music_singing_any(user_ptr)) stop_singing(user_ptr);
1142                 if (hex_spelling_any(user_ptr)) stop_hex_spell_all(user_ptr);
1143                 msg_print(_("あなたは力強い突風を吹き鳴らした。周囲の敵が震え上っている!",
1144                         "You wind a mighty blast; your enemies tremble!"));
1145                 (void)turn_monsters(user_ptr, (3 * user_ptr->lev / 2) + 10);
1146                 break;
1147         }
1148
1149         case ACT_AGGRAVATE:
1150         {
1151                 if (o_ptr->name1 == ART_HYOUSIGI)
1152                 {
1153                         msg_print(_("拍子木を打った。", "You beat your wooden clappers."));
1154                 }
1155                 else
1156                 {
1157                         msg_format(_("%sは不快な物音を立てた。", "The %s sounds an unpleasant noise."), name);
1158                 }
1159                 aggravate_monsters(user_ptr, 0);
1160                 break;
1161         }
1162
1163         /* Activate for summoning / charming */
1164
1165         case ACT_CHARM_ANIMAL:
1166         {
1167                 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
1168                 (void)charm_animal(user_ptr, dir, plev);
1169                 break;
1170         }
1171
1172         case ACT_CHARM_UNDEAD:
1173         {
1174                 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
1175                 (void)control_one_undead(user_ptr, dir, plev);
1176                 break;
1177         }
1178
1179         case ACT_CHARM_OTHER:
1180         {
1181                 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
1182                 (void)charm_monster(user_ptr, dir, plev * 2);
1183                 break;
1184         }
1185
1186         case ACT_CHARM_ANIMALS:
1187         {
1188                 (void)charm_animals(user_ptr, plev * 2);
1189                 break;
1190         }
1191
1192         case ACT_CHARM_OTHERS:
1193         {
1194                 charm_monsters(user_ptr, plev * 2);
1195                 break;
1196         }
1197
1198         case ACT_SUMMON_ANIMAL:
1199         {
1200                 (void)summon_specific(user_ptr, -1, user_ptr->y, user_ptr->x, plev, SUMMON_ANIMAL_RANGER, (PM_ALLOW_GROUP | PM_FORCE_PET));
1201                 break;
1202         }
1203
1204         case ACT_SUMMON_PHANTOM:
1205         {
1206                 msg_print(_("幻霊を召喚した。", "You summon a phantasmal servant."));
1207                 (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));
1208                 break;
1209         }
1210
1211         case ACT_SUMMON_ELEMENTAL:
1212                 if (!cast_summon_elemental(user_ptr, (plev * 3) / 2)) return FALSE;
1213                 break;
1214
1215         case ACT_SUMMON_DEMON:
1216         {
1217                 cast_summon_demon(user_ptr, (plev * 3) / 2);
1218                 break;
1219         }
1220
1221         case ACT_SUMMON_UNDEAD:
1222                 if (!cast_summon_undead(user_ptr, (plev * 3) / 2)) return FALSE;
1223                 break;
1224
1225         case ACT_SUMMON_HOUND:
1226                 if (!cast_summon_hound(user_ptr, (plev * 3) / 2)) return FALSE;
1227                 break;
1228
1229         case ACT_SUMMON_DAWN:
1230         {
1231                 msg_print(_("暁の師団を召喚した。", "You summon the Legion of the Dawn."));
1232                 (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));
1233                 break;
1234         }
1235
1236         case ACT_SUMMON_OCTOPUS:
1237                 if (!cast_summon_octopus(user_ptr)) return FALSE;
1238                 break;
1239
1240                 /* Activate for healing */
1241
1242         case ACT_CHOIR_SINGS:
1243         {
1244                 msg_print(_("天国の歌が聞こえる...", "A heavenly choir sings..."));
1245                 (void)cure_critical_wounds(user_ptr, 777);
1246                 (void)set_hero(user_ptr, randint1(25) + 25, FALSE);
1247                 break;
1248         }
1249
1250         case ACT_CURE_LW:
1251         {
1252                 (void)set_afraid(user_ptr, 0);
1253                 (void)hp_player(user_ptr, 30);
1254                 break;
1255         }
1256
1257         case ACT_CURE_MW:
1258         {
1259                 msg_print(_("深紫色の光を発している...", "It radiates deep purple..."));
1260                 (void)cure_serious_wounds(user_ptr, 4, 8);
1261                 break;
1262         }
1263
1264         case ACT_CURE_POISON:
1265         {
1266                 msg_print(_("深青色に輝いている...", "It glows deep blue..."));
1267                 (void)set_afraid(user_ptr, 0);
1268                 (void)set_poisoned(user_ptr, 0);
1269                 break;
1270         }
1271
1272         case ACT_REST_EXP:
1273         {
1274                 msg_print(_("深紅に輝いている...", "It glows a deep red..."));
1275                 restore_level(user_ptr);
1276                 break;
1277         }
1278
1279         case ACT_REST_ALL:
1280         {
1281                 msg_print(_("濃緑色に輝いている...", "It glows a deep green..."));
1282                 (void)restore_all_status(user_ptr);
1283                 (void)restore_level(user_ptr);
1284                 break;
1285         }
1286
1287         case ACT_CURE_700:
1288         {
1289                 msg_print(_("深青色に輝いている...", "It glows deep blue..."));
1290                 msg_print(_("体内に暖かい鼓動が感じられる...", "You feel a warm tingling inside..."));
1291                 (void)cure_critical_wounds(user_ptr, 700);
1292                 break;
1293         }
1294
1295         case ACT_CURE_1000:
1296         {
1297                 msg_print(_("白く明るく輝いている...", "It glows a bright white..."));
1298                 msg_print(_("ひじょうに気分がよい...", "You feel much better..."));
1299                 (void)cure_critical_wounds(user_ptr, 1000);
1300                 break;
1301         }
1302
1303         case ACT_CURING:
1304         {
1305                 msg_format(_("%sの優しさに癒される...", "the %s cures you affectionately ..."), name);
1306                 true_healing(user_ptr, 0);
1307                 break;
1308         }
1309
1310         case ACT_CURE_MANA_FULL:
1311         {
1312                 msg_format(_("%sが青白く光った...", "The %s glows pale..."), name);
1313                 restore_mana(user_ptr, TRUE);
1314                 break;
1315         }
1316
1317         /* Activate for timed effect */
1318
1319         case ACT_ESP:
1320         {
1321                 (void)set_tim_esp(user_ptr, randint1(30) + 25, FALSE);
1322                 break;
1323         }
1324
1325         case ACT_BERSERK:
1326         {
1327                 (void)berserk(user_ptr, randint1(25) + 25);
1328                 break;
1329         }
1330
1331         case ACT_PROT_EVIL:
1332         {
1333                 msg_format(_("%sから鋭い音が流れ出た...", "The %s lets out a shrill wail..."), name);
1334                 k = 3 * user_ptr->lev;
1335                 (void)set_protevil(user_ptr, randint1(25) + k, FALSE);
1336                 break;
1337         }
1338
1339         case ACT_RESIST_ALL:
1340         {
1341                 msg_print(_("様々な色に輝いている...", "It glows many colours..."));
1342                 (void)set_oppose_acid(user_ptr, randint1(40) + 40, FALSE);
1343                 (void)set_oppose_elec(user_ptr, randint1(40) + 40, FALSE);
1344                 (void)set_oppose_fire(user_ptr, randint1(40) + 40, FALSE);
1345                 (void)set_oppose_cold(user_ptr, randint1(40) + 40, FALSE);
1346                 (void)set_oppose_pois(user_ptr, randint1(40) + 40, FALSE);
1347                 break;
1348         }
1349
1350         case ACT_SPEED:
1351         {
1352                 msg_print(_("明るく緑色に輝いている...", "It glows bright green..."));
1353                 (void)set_fast(user_ptr, randint1(20) + 20, FALSE);
1354                 break;
1355         }
1356
1357         case ACT_XTRA_SPEED:
1358         {
1359                 msg_print(_("明るく輝いている...", "It glows brightly..."));
1360                 (void)set_fast(user_ptr, randint1(75) + 75, FALSE);
1361                 break;
1362         }
1363
1364         case ACT_WRAITH:
1365         {
1366                 set_wraith_form(user_ptr, randint1(plev / 2) + (plev / 2), FALSE);
1367                 break;
1368         }
1369
1370         case ACT_INVULN:
1371         {
1372                 (void)set_invuln(user_ptr, randint1(8) + 8, FALSE);
1373                 break;
1374         }
1375
1376         case ACT_HERO:
1377         {
1378                 (void)heroism(user_ptr, 25);
1379                 break;
1380         }
1381
1382         case ACT_HERO_SPEED:
1383         {
1384                 (void)set_fast(user_ptr, randint1(50) + 50, FALSE);
1385                 (void)heroism(user_ptr, 50);
1386                 break;
1387         }
1388
1389         case ACT_RESIST_ACID:
1390         {
1391                 msg_format(_("%sが黒く輝いた...", "The %s grows black."), name);
1392                 if ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_ACID))
1393                 {
1394                         if (!get_aim_dir(user_ptr, &dir)) return FALSE;
1395                         fire_ball(user_ptr, GF_ACID, dir, 100, 2);
1396                 }
1397                 (void)set_oppose_acid(user_ptr, randint1(20) + 20, FALSE);
1398                 break;
1399         }
1400
1401         case ACT_RESIST_FIRE:
1402         {
1403                 msg_format(_("%sが赤く輝いた...", "The %s grows red."), name);
1404                 if ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_FLAMES))
1405                 {
1406                         if (!get_aim_dir(user_ptr, &dir)) return FALSE;
1407                         fire_ball(user_ptr, GF_FIRE, dir, 100, 2);
1408                 }
1409                 (void)set_oppose_fire(user_ptr, randint1(20) + 20, FALSE);
1410                 break;
1411         }
1412
1413         case ACT_RESIST_COLD:
1414         {
1415                 msg_format(_("%sが白く輝いた...", "The %s grows white."), name);
1416                 if ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_ICE))
1417                 {
1418                         if (!get_aim_dir(user_ptr, &dir)) return FALSE;
1419                         fire_ball(user_ptr, GF_COLD, dir, 100, 2);
1420                 }
1421                 (void)set_oppose_cold(user_ptr, randint1(20) + 20, FALSE);
1422                 break;
1423         }
1424
1425         case ACT_RESIST_ELEC:
1426         {
1427                 msg_format(_("%sが青く輝いた...", "The %s grows blue."), name);
1428                 if ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_ELEC))
1429                 {
1430                         if (!get_aim_dir(user_ptr, &dir)) return FALSE;
1431                         fire_ball(user_ptr, GF_ELEC, dir, 100, 2);
1432                 }
1433                 (void)set_oppose_elec(user_ptr, randint1(20) + 20, FALSE);
1434                 break;
1435         }
1436
1437         case ACT_RESIST_POIS:
1438         {
1439                 msg_format(_("%sが緑に輝いた...", "The %s grows green."), name);
1440                 (void)set_oppose_pois(user_ptr, randint1(20) + 20, FALSE);
1441                 break;
1442         }
1443
1444         /* Activate for general purpose effect (detection etc.) */
1445
1446         case ACT_LIGHT:
1447         {
1448                 msg_format(_("%sから澄んだ光があふれ出た...", "The %s wells with clear light..."), name);
1449                 lite_area(user_ptr, damroll(2, 15), 3);
1450                 break;
1451         }
1452
1453         case ACT_MAP_LIGHT:
1454         {
1455                 msg_print(_("眩しく輝いた...", "It shines brightly..."));
1456                 map_area(user_ptr, DETECT_RAD_MAP);
1457                 lite_area(user_ptr, damroll(2, 15), 3);
1458                 break;
1459         }
1460
1461         case ACT_DETECT_ALL:
1462         {
1463                 msg_print(_("白く明るく輝いている...", "It glows bright white..."));
1464                 msg_print(_("心にイメージが浮かんできた...", "An image forms in your mind..."));
1465                 detect_all(user_ptr, DETECT_RAD_DEFAULT);
1466                 break;
1467         }
1468
1469         case ACT_DETECT_XTRA:
1470         {
1471                 msg_print(_("明るく輝いている...", "It glows brightly..."));
1472                 detect_all(user_ptr, DETECT_RAD_DEFAULT);
1473                 probing(user_ptr);
1474                 identify_fully(user_ptr, FALSE, 0);
1475                 break;
1476         }
1477
1478         case ACT_ID_FULL:
1479         {
1480                 msg_print(_("黄色く輝いている...", "It glows yellow..."));
1481                 identify_fully(user_ptr, FALSE, 0);
1482                 break;
1483         }
1484
1485         case ACT_ID_PLAIN:
1486         {
1487                 if (!ident_spell(user_ptr, FALSE, 0)) return FALSE;
1488                 break;
1489         }
1490
1491         case ACT_RUNE_EXPLO:
1492         {
1493                 msg_print(_("明るい赤色に輝いている...", "It glows bright red..."));
1494                 explosive_rune(user_ptr, user_ptr->y, user_ptr->x);
1495                 break;
1496         }
1497
1498         case ACT_RUNE_PROT:
1499         {
1500                 msg_print(_("ブルーに明るく輝いている...", "It glows light blue..."));
1501                 warding_glyph(user_ptr);
1502                 break;
1503         }
1504
1505         case ACT_SATIATE:
1506         {
1507                 (void)set_food(user_ptr, PY_FOOD_MAX - 1);
1508                 break;
1509         }
1510
1511         case ACT_DEST_DOOR:
1512         {
1513                 msg_print(_("明るい赤色に輝いている...", "It glows bright red..."));
1514                 destroy_doors_touch(user_ptr);
1515                 break;
1516         }
1517
1518         case ACT_STONE_MUD:
1519         {
1520                 msg_print(_("鼓動している...", "It pulsates..."));
1521                 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
1522                 wall_to_mud(user_ptr, dir, 20 + randint1(30));
1523                 break;
1524         }
1525
1526         case ACT_RECHARGE:
1527         {
1528                 recharge(user_ptr, 130);
1529                 break;
1530         }
1531
1532         case ACT_ALCHEMY:
1533         {
1534                 msg_print(_("明るい黄色に輝いている...", "It glows bright yellow..."));
1535                 (void)alchemy(user_ptr);
1536                 break;
1537         }
1538
1539         case ACT_DIM_DOOR:
1540         {
1541                 msg_print(_("次元の扉が開いた。目的地を選んで下さい。", "You open a dimensional gate. Choose a destination."));
1542                 if (!dimension_door(user_ptr)) return FALSE;
1543                 break;
1544         }
1545
1546
1547         case ACT_TELEPORT:
1548         {
1549                 msg_print(_("周りの空間が歪んでいる...", "It twists space around you..."));
1550                 teleport_player(user_ptr, 100, TELEPORT_SPONTANEOUS);
1551                 break;
1552         }
1553
1554         case ACT_RECALL:
1555         {
1556                 msg_print(_("やわらかな白色に輝いている...", "It glows soft white..."));
1557                 if (!recall_player(user_ptr, randint0(21) + 15)) return FALSE;
1558                 break;
1559         }
1560
1561         case ACT_JUDGE:
1562         {
1563                 msg_format(_("%sは赤く明るく光った!", "The %s flashes bright red!"), name);
1564                 chg_virtue(user_ptr, V_KNOWLEDGE, 1);
1565                 chg_virtue(user_ptr, V_ENLIGHTEN, 1);
1566                 wiz_lite(user_ptr, FALSE);
1567
1568                 msg_format(_("%sはあなたの体力を奪った...", "The %s drains your vitality..."), name);
1569                 take_hit(user_ptr, DAMAGE_LOSELIFE, damroll(3, 8), _("審判の宝石", "the Jewel of Judgement"), -1);
1570
1571                 (void)detect_traps(user_ptr, DETECT_RAD_DEFAULT, TRUE);
1572                 (void)detect_doors(user_ptr, DETECT_RAD_DEFAULT);
1573                 (void)detect_stairs(user_ptr, DETECT_RAD_DEFAULT);
1574
1575                 if (get_check(_("帰還の力を使いますか?", "Activate recall? ")))
1576                 {
1577                         (void)recall_player(user_ptr, randint0(21) + 15);
1578                 }
1579
1580                 break;
1581         }
1582
1583         case ACT_TELEKINESIS:
1584         {
1585                 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
1586                 msg_format(_("%sを伸ばした。", "You stretched your %s."), name);
1587                 fetch(user_ptr, dir, 500, TRUE);
1588                 break;
1589         }
1590
1591         case ACT_DETECT_UNIQUE:
1592         {
1593                 int i;
1594                 monster_type *m_ptr;
1595                 monster_race *r_ptr;
1596                 msg_print(_("奇妙な場所が頭の中に浮かんだ...", "Some strange places show up in your mind. And you see ..."));
1597                 /* Process the monsters (backwards) */
1598                 for (i = user_ptr->current_floor_ptr->m_max - 1; i >= 1; i--)
1599                 {
1600                         m_ptr = &user_ptr->current_floor_ptr->m_list[i];
1601
1602                         /* Ignore "dead" monsters */
1603                         if (!monster_is_valid(m_ptr)) continue;
1604
1605                         r_ptr = &r_info[m_ptr->r_idx];
1606
1607                         if (r_ptr->flags1 & RF1_UNIQUE)
1608                         {
1609                                 msg_format(_("%s. ", "%s. "), r_name + r_ptr->name);
1610                         }
1611                 }
1612                 break;
1613         }
1614
1615         case ACT_ESCAPE:
1616         {
1617                 switch (randint1(13))
1618                 {
1619                 case 1: case 2: case 3: case 4: case 5:
1620                         teleport_player(user_ptr, 10, TELEPORT_SPONTANEOUS);
1621                         break;
1622                 case 6: case 7: case 8: case 9: case 10:
1623                         teleport_player(user_ptr, 222, TELEPORT_SPONTANEOUS);
1624                         break;
1625                 case 11: case 12:
1626                         (void)stair_creation(user_ptr);
1627                         break;
1628                 default:
1629                         if (get_check(_("この階を去りますか?", "Leave this level? ")))
1630                         {
1631                                 if (autosave_l) do_cmd_save_game(user_ptr, TRUE);
1632                                 user_ptr->leaving = TRUE;
1633                         }
1634                 }
1635                 break;
1636         }
1637
1638         case ACT_DISP_CURSE_XTRA:
1639         {
1640                 msg_format(_("%sが真実を照らし出す...", "The %s exhibits the truth..."), name);
1641                 (void)remove_all_curse(user_ptr);
1642                 (void)probing(user_ptr);
1643                 break;
1644         }
1645
1646         case ACT_BRAND_FIRE_BOLTS:
1647         {
1648                 msg_format(_("%sが深紅に輝いた...", "Your %s glows deep red..."), name);
1649                 brand_bolts(user_ptr);
1650                 break;
1651         }
1652
1653         case ACT_RECHARGE_XTRA:
1654         {
1655                 msg_format(_("%sが白く輝いた...", "The %s gleams with blinding light..."), name);
1656                 if (!recharge(user_ptr, 1000)) return FALSE;
1657                 break;
1658         }
1659
1660         case ACT_LORE:
1661                 msg_print(_("石が隠された秘密を写し出した...", "The stone reveals hidden mysteries..."));
1662                 if (!perilous_secrets(user_ptr)) return FALSE;
1663                 break;
1664
1665         case ACT_SHIKOFUMI:
1666         {
1667                 msg_print(_("力強く四股を踏んだ。", "You stamp. (as if you are in a ring.)"));
1668                 (void)set_afraid(user_ptr, 0);
1669                 (void)set_hero(user_ptr, randint1(20) + 20, FALSE);
1670                 dispel_evil(user_ptr, user_ptr->lev * 3);
1671                 break;
1672         }
1673
1674         case ACT_PHASE_DOOR:
1675         {
1676                 teleport_player(user_ptr, 10, TELEPORT_SPONTANEOUS);
1677                 break;
1678         }
1679
1680         case ACT_DETECT_ALL_MONS:
1681         {
1682                 (void)detect_monsters_invis(user_ptr, 255);
1683                 (void)detect_monsters_normal(user_ptr, 255);
1684                 break;
1685         }
1686
1687         case ACT_ULTIMATE_RESIST:
1688         {
1689                 TIME_EFFECT v = randint1(25) + 25;
1690                 (void)set_afraid(user_ptr, 0);
1691                 (void)set_hero(user_ptr, v, FALSE);
1692                 (void)hp_player(user_ptr, 10);
1693                 (void)set_blessed(user_ptr, v, FALSE);
1694                 (void)set_oppose_acid(user_ptr, v, FALSE);
1695                 (void)set_oppose_elec(user_ptr, v, FALSE);
1696                 (void)set_oppose_fire(user_ptr, v, FALSE);
1697                 (void)set_oppose_cold(user_ptr, v, FALSE);
1698                 (void)set_oppose_pois(user_ptr, v, FALSE);
1699                 (void)set_ultimate_res(user_ptr, v, FALSE);
1700                 break;
1701         }
1702
1703         case ACT_CAST_OFF:
1704                 cosmic_cast_off(user_ptr, o_ptr);
1705                 break;
1706
1707         case ACT_FALLING_STAR:
1708         {
1709                 msg_print(_("あなたは妖刀に魅入られた…", "You are enchanted by cursed blade..."));
1710                 msg_print(_("「狂ほしく 血のごとき 月はのぼれり 秘めおきし 魔剣 いずこぞや」", "'Behold the blade arts.'"));
1711                 massacre(user_ptr);
1712                 break;
1713         }
1714
1715         case ACT_GRAND_CROSS:
1716         {
1717                 msg_print(_("「闇に還れ!」", "You say, 'Return to darkness!'"));
1718                 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);
1719                 break;
1720         }
1721
1722         case ACT_TELEPORT_LEVEL:
1723         {
1724                 if (!get_check(_("本当に他の階にテレポートしますか?", "Are you sure? (Teleport Level)"))) return FALSE;
1725                 teleport_level(user_ptr, 0);
1726                 break;
1727         }
1728
1729         case ACT_STRAIN_HASTE:
1730         {
1731                 int t;
1732                 msg_format(_("%sはあなたの体力を奪った...", "The %s drains your vitality..."), name);
1733                 take_hit(user_ptr, DAMAGE_LOSELIFE, damroll(3, 8), _("加速した疲労", "the strain of haste"), -1);
1734                 t = 25 + randint1(25);
1735                 (void)set_fast(user_ptr, user_ptr->fast + t, FALSE);
1736                 break;
1737         }
1738
1739         case ACT_FISHING:
1740                 if (!fishing(user_ptr)) return FALSE;
1741                 break;
1742
1743         case ACT_INROU:
1744                 mitokohmon(user_ptr);
1745                 break;
1746
1747         case ACT_MURAMASA:
1748         {
1749                 /* Only for Muramasa */
1750                 if (o_ptr->name1 != ART_MURAMASA) return FALSE;
1751                 if (get_check(_("本当に使いますか?", "Are you sure?!")))
1752                 {
1753                         msg_print(_("村正が震えた...", "The Muramasa pulsates..."));
1754                         do_inc_stat(user_ptr, A_STR);
1755                         if (one_in_(2))
1756                         {
1757                                 msg_print(_("村正は壊れた!", "The Muramasa is destroyed!"));
1758                                 curse_weapon_object(user_ptr, TRUE, o_ptr);
1759                         }
1760                 }
1761                 break;
1762         }
1763
1764         case ACT_BLOODY_MOON:
1765         {
1766                 /* Only for Bloody Moon */
1767                 if (o_ptr->name1 != ART_BLOOD) return FALSE;
1768                 msg_print(_("鎌が明るく輝いた...", "Your scythe glows brightly!"));
1769                 get_bloody_moon_flags(o_ptr);
1770                 if (user_ptr->prace == RACE_ANDROID) calc_android_exp(user_ptr);
1771                 user_ptr->update |= (PU_BONUS | PU_HP);
1772                 break;
1773         }
1774
1775         case ACT_CRIMSON:
1776                 if (o_ptr->name1 != ART_CRIMSON) return FALSE;
1777                 msg_print(_("せっかくだから『クリムゾン』をぶっぱなすぜ!", "I'll fire CRIMSON! SEKKAKUDAKARA!"));
1778                 if (!fire_crimson(user_ptr)) return FALSE;
1779                 break;
1780
1781         default:
1782         {
1783                 msg_format(_("Unknown activation effect: %d.", "Unknown activation effect: %d."), act_ptr->index);
1784                 return FALSE;
1785         }
1786         }
1787
1788         /* Set activation timeout */
1789         if (act_ptr->timeout.constant >= 0) {
1790                 o_ptr->timeout = (s16b)act_ptr->timeout.constant;
1791                 if (act_ptr->timeout.dice > 0) {
1792                         o_ptr->timeout += randint1(act_ptr->timeout.dice);
1793                 }
1794         }
1795         else {
1796                 /* Activations that have special timeout */
1797                 switch (act_ptr->index) {
1798                 case ACT_BR_FIRE:
1799                         o_ptr->timeout = ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_FLAMES)) ? 200 : 250;
1800                         break;
1801                 case ACT_BR_COLD:
1802                         o_ptr->timeout = ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_ICE)) ? 200 : 250;
1803                         break;
1804                 case ACT_TERROR:
1805                         o_ptr->timeout = 3 * (user_ptr->lev + 10);
1806                         break;
1807                 case ACT_MURAMASA:
1808                         /* Nothing to do */
1809                         break;
1810                 default:
1811                         msg_format("Special timeout is not implemented: %d.", act_ptr->index);
1812                         return FALSE;
1813                 }
1814         }
1815
1816         return TRUE;
1817 }