OSDN Git Service

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