2 * @brief プレイヤーの発動コマンド実装
7 #include "cmd-item/cmd-activate.h"
8 #include "cmd-io/cmd-save.h"
9 #include "cmd/cmd-basic.h"
10 #include "core/sort.h"
11 #include "effect/effect-characteristics.h"
12 #include "effect/spells-effect-util.h"
13 #include "floor/floor.h"
14 #include "inventory/player-inventory.h"
15 #include "io/files-util.h"
16 #include "io/targeting.h"
17 #include "main/sound-definitions-table.h"
18 #include "monster/monster-status.h"
19 #include "object-enchant/artifact.h"
20 #include "object/item-use-flags.h"
21 #include "object-enchant/object-ego.h"
22 #include "object/object-hook.h"
23 #include "object/object-kind.h"
24 #include "sv-definition/sv-lite-types.h"
25 #include "sv-definition/sv-ring-types.h"
26 #include "player/avatar.h"
27 #include "player/player-damage.h"
28 #include "player/player-effects.h"
29 #include "player/player-races-table.h"
30 #include "spell/process-effect.h"
31 #include "spell-kind/spells-beam.h"
32 #include "spell-kind/spells-chaos.h"
33 #include "spell-kind/spells-charm.h"
34 #include "spell-kind/spells-detection.h"
35 #include "spell-kind/spells-floor.h"
36 #include "spell-kind/spells-genocide.h"
37 #include "spell-realm/spells-hex.h"
38 #include "spell-kind/spells-launcher.h"
39 #include "spell-kind/spells-lite.h"
40 #include "spell-kind/spells-neighbor.h"
41 #include "spell/spells-object.h"
42 #include "spell-kind/spells-sight.h"
43 #include "spell-kind/spells-specific-bolt.h"
44 #include "spell/spells-status.h"
45 #include "spell/spells-summon.h"
46 #include "spell-kind/spells-teleport.h"
47 #include "spell/spells-type.h"
48 #include "spell/spells3.h"
49 #include "world/world.h"
52 * @brief 装備耐性に準じたブレス効果の選択テーブル /
53 * Define flags, effect type, name for dragon breath activation
55 const dragonbreath_type dragonbreath_info[] = {
56 { TR_RES_ACID, GF_ACID, _("酸", "acid") },
57 { TR_RES_ELEC, GF_ELEC, _("電撃", "lightning") },
58 { TR_RES_FIRE, GF_FIRE, _("火炎", "fire") },
59 { TR_RES_COLD, GF_COLD, _("冷気", "cold") },
60 { TR_RES_POIS, GF_POIS, _("毒", "poison") },
61 { TR_RES_LITE, GF_LITE, _("閃光", "light") },
62 { TR_RES_DARK, GF_DARK, _("暗黒", "dark") },
63 { TR_RES_SHARDS, GF_SHARDS, _("破片", "shard") },
64 { TR_RES_CONF, GF_CONFUSION, _("混乱", "confusion") },
65 { TR_RES_SOUND, GF_SOUND, _("轟音", "sound") },
66 { TR_RES_NEXUS, GF_NEXUS, _("因果混乱", "nexus") },
67 { TR_RES_NETHER, GF_NETHER, _("地獄", "nether") },
68 { TR_RES_CHAOS, GF_CHAOS, _("カオス", "chaos") },
69 { TR_RES_DISEN, GF_DISENCHANT, _("劣化", "disenchant") },
74 * @brief アイテムの発動効果テーブル /
75 * Define flags, levels, values of activations
77 const activation_type activation_info[] =
79 { "SUNLIGHT", ACT_SUNLIGHT, 10, 250, {10, 0},
80 _("太陽光線", "beam of sunlight") },
81 { "BO_MISS_1", ACT_BO_MISS_1, 10, 250, {2, 0},
82 _("マジック・ミサイル(2d6)", "magic missile (2d6)") },
83 { "BA_POIS_1", ACT_BA_POIS_1, 10, 300, {4, 0},
84 _("悪臭雲(12)", "stinking cloud (12)") },
85 { "BO_ELEC_1", ACT_BO_ELEC_1, 20, 250, {5, 0},
86 _("サンダー・ボルト(4d8)", "lightning bolt (4d8)") },
87 { "BO_ACID_1", ACT_BO_ACID_1, 20, 250, {6, 0},
88 _("アシッド・ボルト(5d8)", "acid bolt (5d8)") },
89 { "BO_COLD_1", ACT_BO_COLD_1, 20, 250, {7, 0},
90 _("アイス・ボルト(6d8)", "frost bolt (6d8)") },
91 { "BO_FIRE_1", ACT_BO_FIRE_1, 20, 250, {8, 0},
92 _("ファイア・ボルト(9d8)", "fire bolt (9d8)") },
93 { "BA_COLD_1", ACT_BA_COLD_1, 30, 750, {6, 0},
94 _("アイス・ボール(48)", "ball of cold (48)") },
95 { "BA_COLD_2", ACT_BA_COLD_2, 40, 1000, {12, 0},
96 _("アイス・ボール(100)", "ball of cold (100)") },
97 { "BA_COLD_3", ACT_BA_COLD_3, 70, 2500, {50, 0},
98 _("巨大アイス・ボール(400)", "ball of cold (400)") },
99 { "BA_FIRE_1", ACT_BA_FIRE_1, 30, 1000, {9, 0},
100 _("ファイア・ボール(72)", "ball of fire (72)") },
101 { "BA_FIRE_2", ACT_BA_FIRE_2, 40, 1500, {15, 0},
102 _("巨大ファイア・ボール(120)", "large fire ball (120)") },
103 { "BA_FIRE_3", ACT_BA_FIRE_3, 60, 1750, {40, 0},
104 _("巨大ファイア・ボール(300)", "fire ball (300)") },
105 { "BA_FIRE_4", ACT_BA_FIRE_4, 40, 1000, {12, 0},
106 _("ファイア・ボール(100)", "fire ball (100)") },
107 { "BA_ELEC_2", ACT_BA_ELEC_2, 40, 1000, {12, 0},
108 _("サンダー・ボール(100)", "ball of lightning (100)") },
109 { "BA_ELEC_3", ACT_BA_ELEC_3, 70, 2500, {70, 0},
110 _("巨大サンダー・ボール(500)", "ball of lightning (500)") },
111 { "BA_ACID_1", ACT_BA_ACID_1, 30, 1000, {12, 0},
112 _("アシッド・ボール(100)", "ball of acid (100)") },
113 { "BA_NUKE_1", ACT_BA_NUKE_1, 50, 1000, {12, 0},
114 _("放射能球(100)", "ball of nuke (100)") },
115 { "HYPODYNAMIA_1", ACT_HYPODYNAMIA_1, 30, 500, {12, 0},
116 _("窒息攻撃(100)", "a strangling attack (100)") },
117 { "HYPODYNAMIA_2", ACT_HYPODYNAMIA_2, 40, 750, {15, 0},
118 _("衰弱の矢(120)", "hypodynamic bolt (120)") },
119 { "DRAIN_1", ACT_DRAIN_1, 40, 1000, {20, 0},
120 _("吸収の矢(3*50)", "drain bolt (3*50)") },
121 { "BO_MISS_2", ACT_BO_MISS_2, 40, 1000, {20, 0},
122 _("矢(150)", "arrows (150)") },
123 { "WHIRLWIND", ACT_WHIRLWIND, 50, 7500, {25, 0},
124 _("カマイタチ", "whirlwind attack") },
125 { "DRAIN_2", ACT_DRAIN_2, 50, 2500, {40, 0},
126 _("吸収の矢(3*100)", "drain bolt (3*100)") },
127 { "CALL_CHAOS", ACT_CALL_CHAOS, 70, 5000, {35, 0},
128 _("混沌召来", "call chaos") },
129 { "ROCKET", ACT_ROCKET, 70, 5000, {20, 0},
130 _("ロケット(120+レベル)", "launch rocket (120+level)") },
131 { "DISP_EVIL", ACT_DISP_EVIL, 50, 4000, {50, 0},
132 _("邪悪退散(x5)", "dispel evil (x5)") },
133 { "BA_MISS_3", ACT_BA_MISS_3, 50, 1500, {50, 0},
134 _("エレメントのブレス(300)", "elemental breath (300)") },
135 { "DISP_GOOD", ACT_DISP_GOOD, 50, 3500, {50, 0},
136 _("善良退散(x5)", "dispel good (x5)") },
137 { "BO_MANA", ACT_BO_MANA, 40, 1500, {20, 0},
138 _("魔法の矢(150)", "a magical arrow (150)") },
139 { "BA_WATER", ACT_BA_WATER, 50, 2000, {25, 0},
140 _("ウォーター・ボール(200)", "water ball (200)") },
141 { "BA_STAR", ACT_BA_STAR, 50, 2200, {25, 0},
142 _("巨大スター・ボール(200)", "large star ball (200)") },
143 { "BA_DARK", ACT_BA_DARK, 50, 2200, {30, 0},
144 _("暗黒の嵐(250)", "darkness storm (250)") },
145 { "BA_MANA", ACT_BA_MANA, 70, 2500, {30, 0},
146 _("魔力の嵐(250)", "a mana storm (250)") },
147 { "PESTICIDE", ACT_PESTICIDE, 10, 500, {10, 0},
148 _("害虫の駆除", "dispel small life") },
149 { "BLINDING_LIGHT", ACT_BLINDING_LIGHT, 30, 5000, {40, 0},
150 _("眩しい光", "blinding light") },
151 { "BIZARRE", ACT_BIZARRE, 90, 10000, {50, 0},
152 _("信じ難いこと", "bizarre things") },
153 { "CAST_BA_STAR", ACT_CAST_BA_STAR, 70, 7500, {100, 0},
154 _("スター・ボール・ダスト(150)", "cast star balls (150)") },
155 { "BLADETURNER", ACT_BLADETURNER, 80, 20000, {80, 0},
156 _("エレメントのブレス(300), 士気高揚、祝福、耐性", "breathe elements (300), hero, bless, and resistance") },
157 { "BR_FIRE", ACT_BR_FIRE, 50, 5000, {-1, 0},
158 _("火炎のブレス (200)", "fire breath (200)") },
159 { "BR_COLD", ACT_BR_COLD, 50, 5000, {-1, 0},
160 _("冷気のブレス (200)", "cold breath (200)") },
161 { "BR_DRAGON", ACT_BR_DRAGON, 70, 10000, { 30, 0 },
162 "" /* built by item_activation_dragon_breath() */ },
164 { "CONFUSE", ACT_CONFUSE, 10, 500, {10, 0},
165 _("パニック・モンスター", "confuse monster") },
166 { "SLEEP", ACT_SLEEP, 10, 750, {15, 0},
167 _("周囲のモンスターを眠らせる", "sleep nearby monsters") },
168 { "QUAKE", ACT_QUAKE, 30, 600, {20, 0},
169 _("地震", "earthquake") },
170 { "TERROR", ACT_TERROR, 20, 2500, {-1, 0},
172 { "TELE_AWAY", ACT_TELE_AWAY, 20, 2000, {15, 0},
173 _("テレポート・アウェイ", "teleport away") },
174 { "BANISH_EVIL", ACT_BANISH_EVIL, 40, 2000, {250, 0},
175 _("邪悪消滅", "banish evil") },
176 { "GENOCIDE", ACT_GENOCIDE, 50, 10000, {500, 0},
177 _("抹殺", "genocide") },
178 { "MASS_GENO", ACT_MASS_GENO, 50, 10000, {1000, 0},
179 _("周辺抹殺", "mass genocide") },
180 { "SCARE_AREA", ACT_SCARE_AREA, 20, 2500, {20, 0},
181 _("モンスター恐慌", "frighten monsters") },
182 { "AGGRAVATE", ACT_AGGRAVATE, 0, 100, {0, 0},
183 _("モンスターを怒らせる", "aggravete monsters") },
185 { "CHARM_ANIMAL", ACT_CHARM_ANIMAL, 40, 7500, {200, 0},
186 _("動物魅了", "charm animal") },
187 { "CHARM_UNDEAD", ACT_CHARM_UNDEAD, 40, 10000, {333, 0},
188 _("アンデッド従属", "enslave undead") },
189 { "CHARM_OTHER", ACT_CHARM_OTHER, 40, 10000, {400, 0},
190 _("モンスター魅了", "charm monster") },
191 { "CHARM_ANIMALS", ACT_CHARM_ANIMALS, 40, 12500, {500, 0},
192 _("動物友和", "animal friendship") },
193 { "CHARM_OTHERS", ACT_CHARM_OTHERS, 40, 17500, {750, 0},
194 _("周辺魅了", "mass charm") },
195 { "SUMMON_ANIMAL", ACT_SUMMON_ANIMAL, 50, 10000, {200, 300},
196 _("動物召喚", "summon animal") },
197 { "SUMMON_PHANTOM", ACT_SUMMON_PHANTOM, 50, 12000, {200, 200},
198 _("幻霊召喚", "summon phantasmal servant") },
199 { "SUMMON_ELEMENTAL", ACT_SUMMON_ELEMENTAL, 50, 15000, {750, 0},
200 _("エレメンタル召喚", "summon elemental") },
201 { "SUMMON_DEMON", ACT_SUMMON_DEMON, 50, 20000, {666, 0},
202 _("悪魔召喚", "summon demon") },
203 { "SUMMON_UNDEAD", ACT_SUMMON_UNDEAD, 50, 20000, {666, 0},
204 _("アンデッド召喚", "summon undead") },
205 { "SUMMON_HOUND", ACT_SUMMON_HOUND, 50, 15000, {300, 0},
206 _("ハウンド召喚", "summon hound") },
207 { "SUMMON_DAWN", ACT_SUMMON_DAWN, 50, 15000, {500, 0},
208 _("暁の師団召喚", "summon the Legion of the Dawn") },
209 { "SUMMON_OCTOPUS", ACT_SUMMON_OCTOPUS, 50, 15000, {300, 0},
210 _("蛸の大群召喚", "summon octopus") },
212 { "CHOIR_SINGS", ACT_CHOIR_SINGS, 60, 20000, {300, 0},
213 _("回復(777)、癒し、士気高揚", "heal 777 hit points, curing and HEROism") },
214 { "CURE_LW", ACT_CURE_LW, 10, 500, {10, 0},
215 _("恐怖除去/体力回復(30)", "remove fear and heal 30 hp") },
216 { "CURE_MW", ACT_CURE_MW, 20, 750, {3, 3},
217 _("傷回復(4d8)", "heal 4d8 and wounds") },
218 { "CURE_POISON", ACT_CURE_POISON, 10, 1000, {5, 0},
219 _("恐怖除去/毒消し", "remove fear and cure poison") },
220 { "REST_LIFE", ACT_REST_EXP, 40, 7500, {450, 0},
221 _("経験値復活", "restore experience") },
222 { "REST_ALL", ACT_REST_ALL, 30, 15000, {750, 0},
223 _("全ステータスと経験値復活", "restore stats and experience") },
224 { "CURE_700", ACT_CURE_700, 40, 10000, {250, 0},
225 _("体力回復(700)", "heal 700 hit points") },
226 { "CURE_1000", ACT_CURE_1000, 50, 15000, {888, 0},
227 _("体力回復(1000)", "heal 1000 hit points") },
228 { "CURING", ACT_CURING, 30, 5000, {100, 0},
230 { "CURE_MANA_FULL", ACT_CURE_MANA_FULL, 60, 20000, {777, 0},
231 _("魔力復活", "restore mana") },
233 { "ESP", ACT_ESP, 30, 1500, {100, 0},
234 _("テレパシー(期間 25+d30)", "telepathy (dur 25+d30)") },
235 { "BERSERK", ACT_BERSERK, 10, 800, {75, 0},
236 _("狂戦士化(25+d25ターン)", "berserk (25+d25 turns)") },
237 { "PROT_EVIL", ACT_PROT_EVIL, 30, 5000, {100, 0},
238 _("対邪悪結界(期間 3*レベル+d25)", "protect evil (dur level*3 + d25)") },
239 { "RESIST_ALL", ACT_RESIST_ALL, 30, 5000, {111, 0},
240 _("全耐性(期間 20+d20)", "resist elements (dur 20+d20)") },
241 { "SPEED", ACT_SPEED, 40, 15000, {250, 0},
242 _("加速(期間 20+d20)", "speed (dur 20+d20)") },
243 { "XTRA_SPEED", ACT_XTRA_SPEED, 40, 25000, {200, 200},
244 _("加速(期間 75+d75)", "speed (dur 75+d75)") },
245 { "WRAITH", ACT_WRAITH, 90, 25000, {1000, 0},
246 _("幽体化(期間 (レベル/2)+d(レベル/2))", "wraith form (dur level/2 + d(level/2))") },
247 { "INVULN", ACT_INVULN, 90, 25000, {1000, 0},
248 _("無敵化(期間 8+d8)", "invulnerability (dur 8+d8)") },
249 { "HERO", ACT_HERO, 10, 500, {30, 30},
250 _("士気高揚", "heroism") },
251 { "HERO_SPEED", ACT_HERO_SPEED, 30, 20000, {100, 200},
252 _("士気高揚, スピード(期間 50+d50ターン)", "hero and +10 to speed (50)") },
253 { "RESIST_ACID", ACT_RESIST_ACID, 20, 2000, {40, 40},
254 _("酸への耐性(期間 20+d20)", "resist acid (dur 20+d20)") },
255 { "RESIST_FIRE", ACT_RESIST_FIRE, 20, 2000, {40, 40},
256 _("火炎への耐性(期間 20+d20)", "resist fire (dur 20+d20)") },
257 { "RESIST_COLD", ACT_RESIST_COLD, 20, 2000, {40, 40},
258 _("冷気への耐性(期間 20+d20)", "resist cold (dur 20+d20)") },
259 { "RESIST_ELEC", ACT_RESIST_ELEC, 20, 2000, {40, 40},
260 _("電撃への耐性(期間 20+d20)", "resist elec (dur 20+d20)") },
261 { "RESIST_POIS", ACT_RESIST_POIS, 20, 2000, {40, 40},
262 _("毒への耐性(期間 20+d20)", "resist poison (dur 20+d20)") },
264 { "LIGHT", ACT_LIGHT, 10, 150, {10, 10},
265 _("イルミネーション", "light area (dam 2d15)") },
266 { "MAP_LIGHT", ACT_MAP_LIGHT, 30, 500, {50, 50},
267 _("魔法の地図と光", "light (dam 2d15) & map area") },
268 { "DETECT_ALL", ACT_DETECT_ALL, 30, 1000, {55, 55},
269 _("全感知", "detection") },
270 { "DETECT_XTRA", ACT_DETECT_XTRA, 50, 12500, {100, 0},
271 _("全感知、探索、*鑑定*", "detection, probing and identify true") },
272 { "ID_FULL", ACT_ID_FULL, 50, 10000, {75, 0},
273 _("*鑑定*", "identify true") },
274 { "ID_PLAIN", ACT_ID_PLAIN, 20, 1250, {10, 0},
275 _("鑑定", "identify spell") },
276 { "RUNE_EXPLO", ACT_RUNE_EXPLO, 40, 4000, {200, 0},
277 _("爆発のルーン", "explosive rune") },
278 { "RUNE_PROT", ACT_RUNE_PROT, 60, 10000, {400, 0},
279 _("守りのルーン", "rune of protection") },
280 { "SATIATE", ACT_SATIATE, 10, 2000, {200, 0},
281 _("空腹充足", "satisfy hunger") },
282 { "DEST_DOOR", ACT_DEST_DOOR, 10, 100, {10, 0},
283 _("ドア破壊", "destroy doors") },
284 { "STONE_MUD", ACT_STONE_MUD, 20, 1000, {3, 0},
285 _("岩石溶解", "stone to mud") },
286 { "RECHARGE", ACT_RECHARGE, 30, 1000, {70, 0},
287 _("魔力充填", "recharging") },
288 { "ALCHEMY", ACT_ALCHEMY, 50, 10000, {500, 0},
289 _("錬金術", "alchemy") },
290 { "DIM_DOOR", ACT_DIM_DOOR, 50, 10000, {100, 0},
291 _("次元の扉", "dimension door") },
292 { "TELEPORT", ACT_TELEPORT, 10, 2000, {25, 0},
293 _("テレポート", "teleport") },
294 { "RECALL", ACT_RECALL, 30, 7500, {200, 0},
295 _("帰還の詔", "word of recall") },
296 { "JUDGE", ACT_JUDGE, 90, 50000, {20, 20},
297 _("体力と引き替えに千里眼と帰還", "a telekinesis (500 lb)") },
298 { "TELEKINESIS", ACT_TELEKINESIS, 20, 5500, {25, 25},
299 _("物体を引き寄せる(重量25kgまで)", "clairvoyance and recall, draining you") },
300 { "DETECT_UNIQUE", ACT_DETECT_UNIQUE, 40, 10000, {200, 0},
301 _("この階にいるユニークモンスターを表示", "list of the uniques on the level") },
302 { "ESCAPE", ACT_ESCAPE, 10, 3000, {35, 0},
303 _("逃走", "a getaway") },
304 { "DISP_CURSE_XTRA", ACT_DISP_CURSE_XTRA, 40, 30000, {0, 0},
305 _("*解呪*と調査", "dispel curse and probing") },
306 { "BRAND_FIRE_BOLTS", ACT_BRAND_FIRE_BOLTS, 40, 20000, {999, 0},
307 _("刃先のファイア・ボルト", "fire branding of bolts") },
308 { "RECHARGE_XTRA", ACT_RECHARGE_XTRA, 70, 30000, {200, 0},
309 _("魔力充填", "recharge item") },
310 { "LORE", ACT_LORE, 10, 30000, {0, 0},
311 _("危険を伴う鑑定", "perilous identify") },
312 { "SHIKOFUMI", ACT_SHIKOFUMI, 10, 10000, {100, 100},
313 _("四股踏み", "shiko") },
314 { "PHASE_DOOR", ACT_PHASE_DOOR, 10, 1500, {10, 0},
315 _("ショート・テレポート", "blink") },
316 { "DETECT_ALL_MONS", ACT_DETECT_ALL_MONS, 30, 3000, {150, 0},
317 _("全モンスター感知", "detect all monsters") },
318 { "ULTIMATE_RESIST", ACT_ULTIMATE_RESIST, 90, 20000, {777, 0},
319 _("士気高揚、祝福、究極の耐性", "hero, bless, and ultimate resistance") },
321 { "CAST_OFF", ACT_CAST_OFF, 30, 15000, {100, 0},
322 _("脱衣と小宇宙燃焼", "cast it off and cosmic heroism") },
323 { "FISHING", ACT_FISHING, 0, 100, {0, 0},
324 _("釣りをする", "fishing") },
325 { "INROU", ACT_INROU, 40, 15000, {150, 150},
326 _("例のアレ", "reveal your identity") },
327 { "MURAMASA", ACT_MURAMASA, 0, 0, {-1, 0},
328 _("腕力の上昇", "increase STR") },
329 { "BLOODY_MOON", ACT_BLOODY_MOON, 0, 0, {3333, 0},
330 _("属性変更", "change zokusei") },
331 { "CRIMSON", ACT_CRIMSON, 0, 50000, {15, 0},
332 _("ファイア!", "fire!") },
334 { "STRAIN_HASTE", ACT_STRAIN_HASTE, 10, 1000, {120, 100},
335 _("体力と引き換えに加速", "haste with strain") },
336 { "GRAND_CROSS", ACT_GRAND_CROSS, 30, 15000, {250, 200},
337 _("グランド・クロス", "grand cross") },
338 { "TELEPORT_LEVEL", ACT_TELEPORT_LEVEL, 10, 1500, {100, 200},
339 _("テレポート・レベル", "teleort level") },
340 { "ARTS_FALLING_STAR", ACT_FALLING_STAR, 20, 5500, {30, 50},
341 _("魔剣・流れ星", "blade arts 'falling star'") },
342 { NULL, 0, 0, 0, {0, 0},
347 * @brief 装備を発動するコマンドのサブルーチン /
348 * Activate a wielded object. Wielded objects never stack.
349 * And even if they did, activatable objects never stack.
350 * @param item 発動するオブジェクトの所持品ID
354 * Currently, only (some) artifacts, and Dragon Scale Mail, can be activated.
355 * But one could, for example, easily make an activatable "Ring of Plasma".
356 * Note that it always takes a turn to activate an artifact, even if
357 * the user hits "escape" at the "direction" prompt.
360 void exe_activate(player_type *user_ptr, INVENTORY_IDX item)
368 o_ptr = ref_item(user_ptr, item);
369 take_turn(user_ptr, 100);
370 lev = k_info[o_ptr->k_idx].level;
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))
376 const activation_type* const act_ptr = find_activation_info(o_ptr);
378 lev = act_ptr->level;
381 else if (((o_ptr->tval == TV_RING) || (o_ptr->tval == TV_AMULET)) && o_ptr->name2) lev = e_info[o_ptr->name2].level;
383 /* Base chance of success */
384 chance = user_ptr->skill_dev;
386 /* Confusion hurts skill */
387 if (user_ptr->confused) chance = chance / 2;
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;
395 if (cmd_limit_time_walk(user_ptr)) return;
397 if (user_ptr->pclass == CLASS_BERSERKER) success = FALSE;
398 else if (chance > fail)
400 if (randint0(chance * 2) < fail) success = FALSE;
405 if (randint0(fail * 2) < chance) success = TRUE;
406 else success = FALSE;
412 if (flush_failure) flush();
413 msg_print(_("うまく始動させることができなかった。", "You failed to activate it properly."));
418 /* Check the recharge */
421 msg_print(_("それは微かに音を立て、輝き、消えた...", "It whines, glows and fades..."));
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)))
429 msg_print(_("燃料がない。", "It has no fuel."));
434 /* Activate the artifact */
435 msg_print(_("始動させた...", "You activate it..."));
439 /* Activate object */
440 if (activation_index(o_ptr))
442 (void)activate_artifact(user_ptr, o_ptr);
444 user_ptr->window |= (PW_INVEN | PW_EQUIP);
451 else if (o_ptr->tval == TV_WHISTLE)
453 if (music_singing_any(user_ptr)) stop_singing(user_ptr);
454 if (hex_spelling_any(user_ptr)) stop_hex_spell_all(user_ptr);
457 MONSTER_IDX pet_ctr, i;
462 /* Allocate the "who" array */
463 C_MAKE(who, current_world_ptr->max_m_idx, MONSTER_IDX);
465 /* Process the monsters (backwards) */
466 for (pet_ctr = user_ptr->current_floor_ptr->m_max - 1; pet_ctr >= 1; pet_ctr--)
468 if (is_pet(&user_ptr->current_floor_ptr->m_list[pet_ctr]) && (user_ptr->riding != pet_ctr))
469 who[max_pet++] = pet_ctr;
472 ang_sort(who, &dummy_why, max_pet, ang_sort_comp_pet, ang_sort_swap_hook);
474 /* Process the monsters (backwards) */
475 for (i = 0; i < max_pet; i++)
478 teleport_monster_to(user_ptr, pet_ctr, user_ptr->y, user_ptr->x, 100, TELEPORT_PASSIVE);
481 /* Free the "who" array */
482 C_KILL(who, current_world_ptr->max_m_idx, MONSTER_IDX);
484 o_ptr->timeout = 100 + randint1(100);
487 else if (o_ptr->tval == TV_CAPTURE)
491 bool old_target_pet = target_pet;
493 if (!get_aim_dir(user_ptr, &dir))
495 target_pet = old_target_pet;
498 target_pet = old_target_pet;
500 if (fire_ball(user_ptr, GF_CAPTURE, dir, 0, 0))
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;
512 if (o_ptr->inscription)
513 strcpy(buf, quark_str(o_ptr->inscription));
515 for (s = buf; *s && (*s != '#'); s++)
518 if (iskanji(*s)) s++;
528 t = quark_str(cap_nickname);
541 o_ptr->inscription = quark_add(buf);
548 if (!get_direction(user_ptr, &dir, FALSE, FALSE)) return;
549 if (monster_can_enter(user_ptr, user_ptr->y + ddy[dir], user_ptr->x + ddx[dir], &r_info[o_ptr->pval], 0))
551 if (place_monster_aux(user_ptr, 0, user_ptr->y + ddy[dir], user_ptr->x + ddx[dir], o_ptr->pval, (PM_FORCE_PET | PM_NO_KAGE)))
553 if (o_ptr->xtra3) user_ptr->current_floor_ptr->m_list[hack_m_idx_ii].mspeed = o_ptr->xtra3;
554 if (o_ptr->xtra5) user_ptr->current_floor_ptr->m_list[hack_m_idx_ii].max_maxhp = o_ptr->xtra5;
555 if (o_ptr->xtra4) user_ptr->current_floor_ptr->m_list[hack_m_idx_ii].hp = o_ptr->xtra4;
556 user_ptr->current_floor_ptr->m_list[hack_m_idx_ii].maxhp = user_ptr->current_floor_ptr->m_list[hack_m_idx_ii].max_maxhp;
557 if (o_ptr->inscription)
566 t = quark_str(o_ptr->inscription);
567 for (t = quark_str(o_ptr->inscription); *t && (*t != '#'); t++)
570 if (iskanji(*t)) t++;
595 if (quote && *(s - 1) == '\'')
599 user_ptr->current_floor_ptr->m_list[hack_m_idx_ii].nickname = quark_add(buf);
600 t = quark_str(o_ptr->inscription);
602 while (*t && (*t != '#'))
609 o_ptr->inscription = quark_add(buf);
620 msg_print(_("おっと、解放に失敗した。", "Oops. You failed to release your pet."));
622 calc_android_exp(user_ptr);
627 msg_print(_("おっと、このアイテムは始動できない。", "Oops. That object cannot be activated."));
631 * @brief 装備を発動するコマンドのメインルーチン /
632 * @param user_ptr プレーヤーへの参照ポインタ
635 void do_cmd_activate(player_type *user_ptr)
640 if (user_ptr->wild_mode) return;
641 if (cmd_limit_arena(user_ptr)) return;
643 if (user_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN))
645 set_action(user_ptr, ACTION_NONE);
648 item_tester_hook = item_tester_hook_activate;
650 q = _("どのアイテムを始動させますか? ", "Activate which item? ");
651 s = _("始動できるアイテムを装備していない。", "You have nothing to activate.");
653 if (!choose_object(user_ptr, &item, q, s, (USE_EQUIP | IGNORE_BOTHHAND_SLOT), 0)) return;
655 /* Activate the item */
656 exe_activate(user_ptr, item);
660 * @brief 発動によるブレスの属性をアイテムの耐性から選択し、実行を処理する。/ Dragon breath activation
661 * @details 対象となる耐性は dragonbreath_info テーブルを参照のこと。
662 * @param user_ptr プレーヤーへの参照ポインタ
663 * @param o_ptr 対象のオブジェクト構造体ポインタ
664 * @return 発動実行の是非を返す。
666 static bool activate_dragon_breath(player_type *user_ptr, object_type *o_ptr)
668 BIT_FLAGS flgs[TR_FLAG_SIZE]; /* for resistance flags */
674 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
676 object_flags(o_ptr, flgs);
678 for (i = 0; dragonbreath_info[i].flag != 0; i++)
680 if (have_flag(flgs, dragonbreath_info[i].flag))
682 type[n] = dragonbreath_info[i].type;
683 name[n] = dragonbreath_info[i].name;
687 if (n == 0) return FALSE;
690 if (music_singing_any(user_ptr)) stop_singing(user_ptr);
691 if (hex_spelling_any(user_ptr)) stop_hex_spell_all(user_ptr);
694 msg_format(_("あなたは%sのブレスを吐いた。", "You breathe %s."), name[t]);
695 fire_breath(user_ptr, type[t], dir, 250, 4);
702 * @brief アイテムの発動効果を処理する。
703 * @param user_ptr プレーヤーへの参照ポインタ
704 * @param o_ptr 対象のオブジェクト構造体ポインタ
705 * @return 発動実行の是非を返す。
707 bool activate_artifact(player_type *user_ptr, object_type *o_ptr)
709 PLAYER_LEVEL plev = user_ptr->lev;
712 concptr name = k_name + k_info[o_ptr->k_idx].name;
713 const activation_type* const act_ptr = find_activation_info(o_ptr);
715 /* Maybe forgot adding information to activation_info table ? */
716 msg_print("Activation information is not found.");
720 /* Activate for attack */
721 switch (act_ptr->index)
725 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
726 msg_print(_("太陽光線が放たれた。", "A line of sunlight appears."));
727 (void)lite_line(user_ptr, dir, damroll(6, 8));
733 msg_print(_("それは眩しいくらいに明るく輝いている...", "It glows extremely brightly..."));
734 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
735 fire_bolt(user_ptr, GF_MISSILE, dir, damroll(2, 6));
741 msg_print(_("それは濃緑色に脈動している...", "It throbs deep green..."));
742 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
743 fire_ball(user_ptr, GF_POIS, dir, 12, 3);
749 msg_print(_("それは火花に覆われた...", "It is covered in sparks..."));
750 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
751 fire_bolt(user_ptr, GF_ELEC, dir, damroll(4, 8));
757 msg_print(_("それは酸に覆われた...", "It is covered in acid..."));
758 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
759 fire_bolt(user_ptr, GF_ACID, dir, damroll(5, 8));
765 msg_print(_("それは霜に覆われた...", "It is covered in frost..."));
766 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
767 fire_bolt(user_ptr, GF_COLD, dir, damroll(6, 8));
773 msg_print(_("それは炎に覆われた...", "It is covered in fire..."));
774 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
775 fire_bolt(user_ptr, GF_FIRE, dir, damroll(9, 8));
781 msg_print(_("それは霜に覆われた...", "It is covered in frost..."));
782 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
783 fire_ball(user_ptr, GF_COLD, dir, 48, 2);
789 msg_print(_("それは青く激しく輝いた...", "It glows an intense blue..."));
790 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
791 fire_ball(user_ptr, GF_COLD, dir, 100, 2);
797 msg_print(_("明るく白色に輝いている...", "It glows bright white..."));
798 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
799 fire_ball(user_ptr, GF_COLD, dir, 400, 3);
805 msg_print(_("それは赤く激しく輝いた...", "It glows an intense red..."));
806 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
807 fire_ball(user_ptr, GF_FIRE, dir, 72, 2);
813 msg_format(_("%sから炎が吹き出した...", "The %s rages in fire..."), name);
814 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
815 fire_ball(user_ptr, GF_FIRE, dir, 120, 3);
821 msg_print(_("深赤色に輝いている...", "It glows deep red..."));
822 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
823 fire_ball(user_ptr, GF_FIRE, dir, 300, 3);
829 msg_print(_("それは赤く激しく輝いた...", "It glows an intense red..."));
830 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
831 fire_ball(user_ptr, GF_FIRE, dir, 100, 2);
837 msg_print(_("電気がパチパチ音を立てた...", "It crackles with electricity..."));
838 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
839 fire_ball(user_ptr, GF_ELEC, dir, 100, 3);
845 msg_print(_("深青色に輝いている...", "It glows deep blue..."));
846 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
847 fire_ball(user_ptr, GF_ELEC, dir, 500, 3);
853 msg_print(_("それは黒く激しく輝いた...", "It glows an intense black..."));
854 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
855 fire_ball(user_ptr, GF_ACID, dir, 100, 2);
861 msg_print(_("それは緑に激しく輝いた...", "It glows an intense green..."));
862 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
863 fire_ball(user_ptr, GF_NUKE, dir, 100, 2);
867 case ACT_HYPODYNAMIA_1:
869 msg_format(_("あなたは%sに敵を締め殺すよう命じた。", "You order the %s to strangle your opponent."), name);
870 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
871 hypodynamic_bolt(user_ptr, dir, 100);
875 case ACT_HYPODYNAMIA_2:
877 msg_print(_("黒く輝いている...", "It glows black..."));
878 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
879 hypodynamic_bolt(user_ptr, dir, 120);
885 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
886 for (dummy = 0; dummy < 3; dummy++)
888 if (hypodynamic_bolt(user_ptr, dir, 50))
889 hp_player(user_ptr, 50);
896 msg_print(_("魔法のトゲが現れた...", "It grows magical spikes..."));
897 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
898 fire_bolt(user_ptr, GF_ARROW, dir, 150);
910 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
911 for (dummy = 0; dummy < 3; dummy++)
913 if (hypodynamic_bolt(user_ptr, dir, 100))
914 hp_player(user_ptr, 100);
922 msg_print(_("様々な色の火花を発している...", "It glows in scintillating colours..."));
923 call_chaos(user_ptr);
929 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
930 msg_print(_("ロケットを発射した!", "You launch a rocket!"));
931 fire_ball(user_ptr, GF_ROCKET, dir, 250 + plev * 3, 2);
937 msg_print(_("神聖な雰囲気が充満した...", "It floods the area with goodness..."));
938 dispel_evil(user_ptr, user_ptr->lev * 5);
944 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
945 msg_print(_("あなたはエレメントのブレスを吐いた。", "You breathe the elements."));
946 fire_breath(user_ptr, GF_MISSILE, dir, 300, 4);
952 msg_print(_("邪悪な雰囲気が充満した...", "It floods the area with evil..."));
953 dispel_good(user_ptr, user_ptr->lev * 5);
959 msg_format(_("%sに魔法のトゲが現れた...", "The %s grows magical spikes..."), name);
960 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
961 fire_bolt(user_ptr, GF_ARROW, dir, 150);
967 msg_format(_("%sが深い青色に鼓動している...", "The %s throbs deep blue..."), name);
968 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
969 fire_ball(user_ptr, GF_WATER, dir, 200, 3);
975 msg_format(_("%sが深い闇に覆われた...", "The %s is coverd in pitch-darkness..."), name);
976 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
977 fire_ball(user_ptr, GF_DARK, dir, 250, 4);
983 msg_format(_("%sが青白く光った...", "The %s glows pale..."), name);
984 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
985 fire_ball(user_ptr, GF_MANA, dir, 250, 4);
991 msg_print(_("あなたは害虫を一掃した。", "You exterminate small life."));
992 (void)dispel_monsters(user_ptr, 4);
996 case ACT_BLINDING_LIGHT:
998 msg_format(_("%sが眩しい光で輝いた...", "The %s gleams with blinding light..."), name);
999 fire_ball(user_ptr, GF_LITE, 0, 300, 6);
1000 confuse_monsters(user_ptr, 3 * user_ptr->lev / 2);
1006 msg_format(_("%sは漆黒に輝いた...", "The %s glows intensely black..."), name);
1007 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
1008 ring_of_power(user_ptr, dir);
1012 case ACT_CAST_BA_STAR:
1014 HIT_POINT num = damroll(5, 3);
1015 POSITION y = 0, x = 0;
1017 msg_format(_("%sが稲妻で覆われた...", "The %s is surrounded by lightning..."), name);
1018 for (k = 0; k < num; k++)
1024 scatter(user_ptr, &y, &x, user_ptr->y, user_ptr->x, 4, 0);
1025 if (!cave_have_flag_bold(user_ptr->current_floor_ptr, y, x, FF_PROJECT)) continue;
1026 if (!player_bold(user_ptr, y, x)) break;
1029 project(user_ptr, 0, 3, y, x, 150, GF_ELEC,
1030 (PROJECT_THRU | PROJECT_STOP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL), -1);
1036 case ACT_BLADETURNER:
1038 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
1039 msg_print(_("あなたはエレメントのブレスを吐いた。", "You breathe the elements."));
1040 fire_breath(user_ptr, GF_MISSILE, dir, 300, 4);
1041 msg_print(_("鎧が様々な色に輝いた...", "Your armor glows many colours..."));
1042 (void)set_afraid(user_ptr, 0);
1043 (void)set_hero(user_ptr, randint1(50) + 50, FALSE);
1044 (void)hp_player(user_ptr, 10);
1045 (void)set_blessed(user_ptr, randint1(50) + 50, FALSE);
1046 (void)set_oppose_acid(user_ptr, randint1(50) + 50, FALSE);
1047 (void)set_oppose_elec(user_ptr, randint1(50) + 50, FALSE);
1048 (void)set_oppose_fire(user_ptr, randint1(50) + 50, FALSE);
1049 (void)set_oppose_cold(user_ptr, randint1(50) + 50, FALSE);
1050 (void)set_oppose_pois(user_ptr, randint1(50) + 50, FALSE);
1056 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
1057 fire_breath(user_ptr, GF_FIRE, dir, 200, 2);
1058 if ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_FLAMES))
1060 (void)set_oppose_fire(user_ptr, randint1(20) + 20, FALSE);
1067 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
1068 fire_breath(user_ptr, GF_COLD, dir, 200, 2);
1069 if ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_ICE))
1071 (void)set_oppose_cold(user_ptr, randint1(20) + 20, FALSE);
1078 if (!activate_dragon_breath(user_ptr, o_ptr)) return FALSE;
1082 /* Activate for other offensive action */
1085 msg_print(_("様々な色の火花を発している...", "It glows in scintillating colours..."));
1086 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
1087 confuse_monster(user_ptr, dir, 20);
1093 msg_print(_("深青色に輝いている...", "It glows deep blue..."));
1094 sleep_monsters_touch(user_ptr);
1100 earthquake(user_ptr, user_ptr->y, user_ptr->x, 5, 0);
1106 turn_monsters(user_ptr, 40 + user_ptr->lev);
1112 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
1113 (void)fire_beam(user_ptr, GF_AWAY_ALL, dir, plev);
1117 case ACT_BANISH_EVIL:
1119 if (banish_evil(user_ptr, 100))
1121 msg_print(_("アーティファクトの力が邪悪を打ち払った!", "The power of the artifact banishes evil!"));
1128 msg_print(_("深青色に輝いている...", "It glows deep blue..."));
1129 (void)symbol_genocide(user_ptr, 200, TRUE);
1135 msg_print(_("ひどく鋭い音が流れ出た...", "It lets out a long, shrill note..."));
1136 (void)mass_genocide(user_ptr, 200, TRUE);
1140 case ACT_SCARE_AREA:
1142 if (music_singing_any(user_ptr)) stop_singing(user_ptr);
1143 if (hex_spelling_any(user_ptr)) stop_hex_spell_all(user_ptr);
1144 msg_print(_("あなたは力強い突風を吹き鳴らした。周囲の敵が震え上っている!",
1145 "You wind a mighty blast; your enemies tremble!"));
1146 (void)turn_monsters(user_ptr, (3 * user_ptr->lev / 2) + 10);
1152 if (o_ptr->name1 == ART_HYOUSIGI)
1154 msg_print(_("拍子木を打った。", "You beat your wooden clappers."));
1158 msg_format(_("%sは不快な物音を立てた。", "The %s sounds an unpleasant noise."), name);
1160 aggravate_monsters(user_ptr, 0);
1164 /* Activate for summoning / charming */
1166 case ACT_CHARM_ANIMAL:
1168 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
1169 (void)charm_animal(user_ptr, dir, plev);
1173 case ACT_CHARM_UNDEAD:
1175 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
1176 (void)control_one_undead(user_ptr, dir, plev);
1180 case ACT_CHARM_OTHER:
1182 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
1183 (void)charm_monster(user_ptr, dir, plev * 2);
1187 case ACT_CHARM_ANIMALS:
1189 (void)charm_animals(user_ptr, plev * 2);
1193 case ACT_CHARM_OTHERS:
1195 charm_monsters(user_ptr, plev * 2);
1199 case ACT_SUMMON_ANIMAL:
1201 (void)summon_specific(user_ptr, -1, user_ptr->y, user_ptr->x, plev, SUMMON_ANIMAL_RANGER, (PM_ALLOW_GROUP | PM_FORCE_PET));
1205 case ACT_SUMMON_PHANTOM:
1207 msg_print(_("幻霊を召喚した。", "You summon a phantasmal servant."));
1208 (void)summon_specific(user_ptr, -1, user_ptr->y, user_ptr->x, user_ptr->current_floor_ptr->dun_level, SUMMON_PHANTOM, (PM_ALLOW_GROUP | PM_FORCE_PET));
1212 case ACT_SUMMON_ELEMENTAL:
1213 if (!cast_summon_elemental(user_ptr, (plev * 3) / 2)) return FALSE;
1216 case ACT_SUMMON_DEMON:
1218 cast_summon_demon(user_ptr, (plev * 3) / 2);
1222 case ACT_SUMMON_UNDEAD:
1223 if (!cast_summon_undead(user_ptr, (plev * 3) / 2)) return FALSE;
1226 case ACT_SUMMON_HOUND:
1227 if (!cast_summon_hound(user_ptr, (plev * 3) / 2)) return FALSE;
1230 case ACT_SUMMON_DAWN:
1232 msg_print(_("暁の師団を召喚した。", "You summon the Legion of the Dawn."));
1233 (void)summon_specific(user_ptr, -1, user_ptr->y, user_ptr->x, user_ptr->current_floor_ptr->dun_level, SUMMON_DAWN, (PM_ALLOW_GROUP | PM_FORCE_PET));
1237 case ACT_SUMMON_OCTOPUS:
1238 if (!cast_summon_octopus(user_ptr)) return FALSE;
1241 /* Activate for healing */
1243 case ACT_CHOIR_SINGS:
1245 msg_print(_("天国の歌が聞こえる...", "A heavenly choir sings..."));
1246 (void)cure_critical_wounds(user_ptr, 777);
1247 (void)set_hero(user_ptr, randint1(25) + 25, FALSE);
1253 (void)set_afraid(user_ptr, 0);
1254 (void)hp_player(user_ptr, 30);
1260 msg_print(_("深紫色の光を発している...", "It radiates deep purple..."));
1261 (void)cure_serious_wounds(user_ptr, 4, 8);
1265 case ACT_CURE_POISON:
1267 msg_print(_("深青色に輝いている...", "It glows deep blue..."));
1268 (void)set_afraid(user_ptr, 0);
1269 (void)set_poisoned(user_ptr, 0);
1275 msg_print(_("深紅に輝いている...", "It glows a deep red..."));
1276 restore_level(user_ptr);
1282 msg_print(_("濃緑色に輝いている...", "It glows a deep green..."));
1283 (void)restore_all_status(user_ptr);
1284 (void)restore_level(user_ptr);
1290 msg_print(_("深青色に輝いている...", "It glows deep blue..."));
1291 msg_print(_("体内に暖かい鼓動が感じられる...", "You feel a warm tingling inside..."));
1292 (void)cure_critical_wounds(user_ptr, 700);
1298 msg_print(_("白く明るく輝いている...", "It glows a bright white..."));
1299 msg_print(_("ひじょうに気分がよい...", "You feel much better..."));
1300 (void)cure_critical_wounds(user_ptr, 1000);
1306 msg_format(_("%sの優しさに癒される...", "the %s cures you affectionately ..."), name);
1307 true_healing(user_ptr, 0);
1311 case ACT_CURE_MANA_FULL:
1313 msg_format(_("%sが青白く光った...", "The %s glows pale..."), name);
1314 restore_mana(user_ptr, TRUE);
1318 /* Activate for timed effect */
1322 (void)set_tim_esp(user_ptr, randint1(30) + 25, FALSE);
1328 (void)berserk(user_ptr, randint1(25) + 25);
1334 msg_format(_("%sから鋭い音が流れ出た...", "The %s lets out a shrill wail..."), name);
1335 k = 3 * user_ptr->lev;
1336 (void)set_protevil(user_ptr, randint1(25) + k, FALSE);
1340 case ACT_RESIST_ALL:
1342 msg_print(_("様々な色に輝いている...", "It glows many colours..."));
1343 (void)set_oppose_acid(user_ptr, randint1(40) + 40, FALSE);
1344 (void)set_oppose_elec(user_ptr, randint1(40) + 40, FALSE);
1345 (void)set_oppose_fire(user_ptr, randint1(40) + 40, FALSE);
1346 (void)set_oppose_cold(user_ptr, randint1(40) + 40, FALSE);
1347 (void)set_oppose_pois(user_ptr, randint1(40) + 40, FALSE);
1353 msg_print(_("明るく緑色に輝いている...", "It glows bright green..."));
1354 (void)set_fast(user_ptr, randint1(20) + 20, FALSE);
1358 case ACT_XTRA_SPEED:
1360 msg_print(_("明るく輝いている...", "It glows brightly..."));
1361 (void)set_fast(user_ptr, randint1(75) + 75, FALSE);
1367 set_wraith_form(user_ptr, randint1(plev / 2) + (plev / 2), FALSE);
1373 (void)set_invuln(user_ptr, randint1(8) + 8, FALSE);
1379 (void)heroism(user_ptr, 25);
1383 case ACT_HERO_SPEED:
1385 (void)set_fast(user_ptr, randint1(50) + 50, FALSE);
1386 (void)heroism(user_ptr, 50);
1390 case ACT_RESIST_ACID:
1392 msg_format(_("%sが黒く輝いた...", "The %s grows black."), name);
1393 if ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_ACID))
1395 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
1396 fire_ball(user_ptr, GF_ACID, dir, 100, 2);
1398 (void)set_oppose_acid(user_ptr, randint1(20) + 20, FALSE);
1402 case ACT_RESIST_FIRE:
1404 msg_format(_("%sが赤く輝いた...", "The %s grows red."), name);
1405 if ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_FLAMES))
1407 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
1408 fire_ball(user_ptr, GF_FIRE, dir, 100, 2);
1410 (void)set_oppose_fire(user_ptr, randint1(20) + 20, FALSE);
1414 case ACT_RESIST_COLD:
1416 msg_format(_("%sが白く輝いた...", "The %s grows white."), name);
1417 if ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_ICE))
1419 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
1420 fire_ball(user_ptr, GF_COLD, dir, 100, 2);
1422 (void)set_oppose_cold(user_ptr, randint1(20) + 20, FALSE);
1426 case ACT_RESIST_ELEC:
1428 msg_format(_("%sが青く輝いた...", "The %s grows blue."), name);
1429 if ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_ELEC))
1431 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
1432 fire_ball(user_ptr, GF_ELEC, dir, 100, 2);
1434 (void)set_oppose_elec(user_ptr, randint1(20) + 20, FALSE);
1438 case ACT_RESIST_POIS:
1440 msg_format(_("%sが緑に輝いた...", "The %s grows green."), name);
1441 (void)set_oppose_pois(user_ptr, randint1(20) + 20, FALSE);
1445 /* Activate for general purpose effect (detection etc.) */
1449 msg_format(_("%sから澄んだ光があふれ出た...", "The %s wells with clear light..."), name);
1450 lite_area(user_ptr, damroll(2, 15), 3);
1456 msg_print(_("眩しく輝いた...", "It shines brightly..."));
1457 map_area(user_ptr, DETECT_RAD_MAP);
1458 lite_area(user_ptr, damroll(2, 15), 3);
1462 case ACT_DETECT_ALL:
1464 msg_print(_("白く明るく輝いている...", "It glows bright white..."));
1465 msg_print(_("心にイメージが浮かんできた...", "An image forms in your mind..."));
1466 detect_all(user_ptr, DETECT_RAD_DEFAULT);
1470 case ACT_DETECT_XTRA:
1472 msg_print(_("明るく輝いている...", "It glows brightly..."));
1473 detect_all(user_ptr, DETECT_RAD_DEFAULT);
1475 identify_fully(user_ptr, FALSE, 0);
1481 msg_print(_("黄色く輝いている...", "It glows yellow..."));
1482 identify_fully(user_ptr, FALSE, 0);
1488 if (!ident_spell(user_ptr, FALSE, 0)) return FALSE;
1492 case ACT_RUNE_EXPLO:
1494 msg_print(_("明るい赤色に輝いている...", "It glows bright red..."));
1495 explosive_rune(user_ptr, user_ptr->y, user_ptr->x);
1501 msg_print(_("ブルーに明るく輝いている...", "It glows light blue..."));
1502 warding_glyph(user_ptr);
1508 (void)set_food(user_ptr, PY_FOOD_MAX - 1);
1514 msg_print(_("明るい赤色に輝いている...", "It glows bright red..."));
1515 destroy_doors_touch(user_ptr);
1521 msg_print(_("鼓動している...", "It pulsates..."));
1522 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
1523 wall_to_mud(user_ptr, dir, 20 + randint1(30));
1529 recharge(user_ptr, 130);
1535 msg_print(_("明るい黄色に輝いている...", "It glows bright yellow..."));
1536 (void)alchemy(user_ptr);
1542 msg_print(_("次元の扉が開いた。目的地を選んで下さい。", "You open a dimensional gate. Choose a destination."));
1543 if (!dimension_door(user_ptr)) return FALSE;
1550 msg_print(_("周りの空間が歪んでいる...", "It twists space around you..."));
1551 teleport_player(user_ptr, 100, TELEPORT_SPONTANEOUS);
1557 msg_print(_("やわらかな白色に輝いている...", "It glows soft white..."));
1558 if (!recall_player(user_ptr, randint0(21) + 15)) return FALSE;
1564 msg_format(_("%sは赤く明るく光った!", "The %s flashes bright red!"), name);
1565 chg_virtue(user_ptr, V_KNOWLEDGE, 1);
1566 chg_virtue(user_ptr, V_ENLIGHTEN, 1);
1567 wiz_lite(user_ptr, FALSE);
1569 msg_format(_("%sはあなたの体力を奪った...", "The %s drains your vitality..."), name);
1570 take_hit(user_ptr, DAMAGE_LOSELIFE, damroll(3, 8), _("審判の宝石", "the Jewel of Judgement"), -1);
1572 (void)detect_traps(user_ptr, DETECT_RAD_DEFAULT, TRUE);
1573 (void)detect_doors(user_ptr, DETECT_RAD_DEFAULT);
1574 (void)detect_stairs(user_ptr, DETECT_RAD_DEFAULT);
1576 if (get_check(_("帰還の力を使いますか?", "Activate recall? ")))
1578 (void)recall_player(user_ptr, randint0(21) + 15);
1584 case ACT_TELEKINESIS:
1586 if (!get_aim_dir(user_ptr, &dir)) return FALSE;
1587 msg_format(_("%sを伸ばした。", "You stretched your %s."), name);
1588 fetch(user_ptr, dir, 500, TRUE);
1592 case ACT_DETECT_UNIQUE:
1595 monster_type *m_ptr;
1596 monster_race *r_ptr;
1597 msg_print(_("奇妙な場所が頭の中に浮かんだ...", "Some strange places show up in your mind. And you see ..."));
1598 /* Process the monsters (backwards) */
1599 for (i = user_ptr->current_floor_ptr->m_max - 1; i >= 1; i--)
1601 m_ptr = &user_ptr->current_floor_ptr->m_list[i];
1603 /* Ignore "dead" monsters */
1604 if (!monster_is_valid(m_ptr)) continue;
1606 r_ptr = &r_info[m_ptr->r_idx];
1608 if (r_ptr->flags1 & RF1_UNIQUE)
1610 msg_format(_("%s. ", "%s. "), r_name + r_ptr->name);
1618 switch (randint1(13))
1620 case 1: case 2: case 3: case 4: case 5:
1621 teleport_player(user_ptr, 10, TELEPORT_SPONTANEOUS);
1623 case 6: case 7: case 8: case 9: case 10:
1624 teleport_player(user_ptr, 222, TELEPORT_SPONTANEOUS);
1627 (void)stair_creation(user_ptr);
1630 if (get_check(_("この階を去りますか?", "Leave this level? ")))
1632 if (autosave_l) do_cmd_save_game(user_ptr, TRUE);
1633 user_ptr->leaving = TRUE;
1639 case ACT_DISP_CURSE_XTRA:
1641 msg_format(_("%sが真実を照らし出す...", "The %s exhibits the truth..."), name);
1642 (void)remove_all_curse(user_ptr);
1643 (void)probing(user_ptr);
1647 case ACT_BRAND_FIRE_BOLTS:
1649 msg_format(_("%sが深紅に輝いた...", "Your %s glows deep red..."), name);
1650 brand_bolts(user_ptr);
1654 case ACT_RECHARGE_XTRA:
1656 msg_format(_("%sが白く輝いた...", "The %s gleams with blinding light..."), name);
1657 if (!recharge(user_ptr, 1000)) return FALSE;
1662 msg_print(_("石が隠された秘密を写し出した...", "The stone reveals hidden mysteries..."));
1663 if (!perilous_secrets(user_ptr)) return FALSE;
1668 msg_print(_("力強く四股を踏んだ。", "You stamp. (as if you are in a ring.)"));
1669 (void)set_afraid(user_ptr, 0);
1670 (void)set_hero(user_ptr, randint1(20) + 20, FALSE);
1671 dispel_evil(user_ptr, user_ptr->lev * 3);
1675 case ACT_PHASE_DOOR:
1677 teleport_player(user_ptr, 10, TELEPORT_SPONTANEOUS);
1681 case ACT_DETECT_ALL_MONS:
1683 (void)detect_monsters_invis(user_ptr, 255);
1684 (void)detect_monsters_normal(user_ptr, 255);
1688 case ACT_ULTIMATE_RESIST:
1690 TIME_EFFECT v = randint1(25) + 25;
1691 (void)set_afraid(user_ptr, 0);
1692 (void)set_hero(user_ptr, v, FALSE);
1693 (void)hp_player(user_ptr, 10);
1694 (void)set_blessed(user_ptr, v, FALSE);
1695 (void)set_oppose_acid(user_ptr, v, FALSE);
1696 (void)set_oppose_elec(user_ptr, v, FALSE);
1697 (void)set_oppose_fire(user_ptr, v, FALSE);
1698 (void)set_oppose_cold(user_ptr, v, FALSE);
1699 (void)set_oppose_pois(user_ptr, v, FALSE);
1700 (void)set_ultimate_res(user_ptr, v, FALSE);
1705 cosmic_cast_off(user_ptr, o_ptr);
1708 case ACT_FALLING_STAR:
1710 msg_print(_("あなたは妖刀に魅入られた…", "You are enchanted by cursed blade..."));
1711 msg_print(_("「狂ほしく 血のごとき 月はのぼれり 秘めおきし 魔剣 いずこぞや」", "'Behold the blade arts.'"));
1716 case ACT_GRAND_CROSS:
1718 msg_print(_("「闇に還れ!」", "You say, 'Return to darkness!'"));
1719 project(user_ptr, 0, 8, user_ptr->y, user_ptr->x, (randint1(100) + 200) * 2, GF_HOLY_FIRE, PROJECT_KILL | PROJECT_ITEM | PROJECT_GRID, -1);
1723 case ACT_TELEPORT_LEVEL:
1725 if (!get_check(_("本当に他の階にテレポートしますか?", "Are you sure? (Teleport Level)"))) return FALSE;
1726 teleport_level(user_ptr, 0);
1730 case ACT_STRAIN_HASTE:
1733 msg_format(_("%sはあなたの体力を奪った...", "The %s drains your vitality..."), name);
1734 take_hit(user_ptr, DAMAGE_LOSELIFE, damroll(3, 8), _("加速した疲労", "the strain of haste"), -1);
1735 t = 25 + randint1(25);
1736 (void)set_fast(user_ptr, user_ptr->fast + t, FALSE);
1741 if (!fishing(user_ptr)) return FALSE;
1745 mitokohmon(user_ptr);
1750 /* Only for Muramasa */
1751 if (o_ptr->name1 != ART_MURAMASA) return FALSE;
1752 if (get_check(_("本当に使いますか?", "Are you sure?!")))
1754 msg_print(_("村正が震えた...", "The Muramasa pulsates..."));
1755 do_inc_stat(user_ptr, A_STR);
1758 msg_print(_("村正は壊れた!", "The Muramasa is destroyed!"));
1759 curse_weapon_object(user_ptr, TRUE, o_ptr);
1765 case ACT_BLOODY_MOON:
1767 /* Only for Bloody Moon */
1768 if (o_ptr->name1 != ART_BLOOD) return FALSE;
1769 msg_print(_("鎌が明るく輝いた...", "Your scythe glows brightly!"));
1770 get_bloody_moon_flags(o_ptr);
1771 if (user_ptr->prace == RACE_ANDROID) calc_android_exp(user_ptr);
1772 user_ptr->update |= (PU_BONUS | PU_HP);
1777 if (o_ptr->name1 != ART_CRIMSON) return FALSE;
1778 msg_print(_("せっかくだから『クリムゾン』をぶっぱなすぜ!", "I'll fire CRIMSON! SEKKAKUDAKARA!"));
1779 if (!fire_crimson(user_ptr)) return FALSE;
1784 msg_format(_("Unknown activation effect: %d.", "Unknown activation effect: %d."), act_ptr->index);
1789 /* Set activation timeout */
1790 if (act_ptr->timeout.constant >= 0) {
1791 o_ptr->timeout = (s16b)act_ptr->timeout.constant;
1792 if (act_ptr->timeout.dice > 0) {
1793 o_ptr->timeout += randint1(act_ptr->timeout.dice);
1797 /* Activations that have special timeout */
1798 switch (act_ptr->index) {
1800 o_ptr->timeout = ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_FLAMES)) ? 200 : 250;
1803 o_ptr->timeout = ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_ICE)) ? 200 : 250;
1806 o_ptr->timeout = 3 * (user_ptr->lev + 10);
1812 msg_format("Special timeout is not implemented: %d.", act_ptr->index);