OSDN Git Service

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