OSDN Git Service

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