OSDN Git Service

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