OSDN Git Service

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