OSDN Git Service

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