OSDN Git Service

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