OSDN Git Service

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