2 * @brief 発動処理その他 (肥大化しがちなので適宜まとまりを別ファイルへ分割すること)
7 #include "object-activation/activation-others.h"
8 #include "artifact/fixed-art-types.h"
9 #include "cmd-io/cmd-save.h"
10 #include "core/asking-player.h"
11 #include "core/hp-mp-processor.h"
12 #include "effect/effect-characteristics.h"
13 #include "effect/effect-processor.h"
14 #include "game-option/special-options.h"
15 #include "monster-race/monster-race.h"
16 #include "monster-race/race-flags1.h"
17 #include "monster-race/race-indice-types.h"
18 #include "monster/monster-status.h"
19 #include "player-attack/player-attack.h"
20 #include "player-info/avatar.h"
21 #include "player/player-damage.h"
22 #include "spell-kind/earthquake.h"
23 #include "spell-kind/magic-item-recharger.h"
24 #include "spell-kind/spells-beam.h"
25 #include "spell-kind/spells-curse-removal.h"
26 #include "spell-kind/spells-detection.h"
27 #include "spell-kind/spells-fetcher.h"
28 #include "spell-kind/spells-floor.h"
29 #include "spell-kind/spells-grid.h"
30 #include "spell-kind/spells-launcher.h"
31 #include "spell-kind/spells-lite.h"
32 #include "spell-kind/spells-neighbor.h"
33 #include "spell-kind/spells-perception.h"
34 #include "spell-kind/spells-random.h"
35 #include "spell-kind/spells-sight.h"
36 #include "spell-kind/spells-teleport.h"
37 #include "spell-kind/spells-world.h"
38 #include "spell-realm/spells-hex.h"
39 #include "spell/spell-types.h"
40 #include "spell/spells-status.h"
41 #include "status/bad-status-setter.h"
42 #include "status/buff-setter.h"
43 #include "system/floor-type-definition.h"
44 #include "system/object-type-definition.h"
45 #include "target/target-getter.h"
46 #include "util/quarks.h"
47 #include "view/display-messages.h"
49 bool activate_sunlight(player_type *user_ptr)
52 if (!get_aim_dir(user_ptr, &dir))
55 msg_print(_("太陽光線が放たれた。", "A line of sunlight appears."));
56 (void)lite_line(user_ptr, dir, damroll(6, 8));
60 bool activate_confusion(player_type *user_ptr)
63 msg_print(_("様々な色の火花を発している...", "It glows in scintillating colours..."));
64 if (!get_aim_dir(user_ptr, &dir))
67 confuse_monster(user_ptr, dir, 20);
71 bool activate_banish_evil(player_type *user_ptr)
73 if (banish_evil(user_ptr, 100))
74 msg_print(_("アーティファクトの力が邪悪を打ち払った!", "The power of the artifact banishes evil!"));
79 bool activate_scare(player_type *user_ptr)
81 if (music_singing_any(user_ptr))
82 stop_singing(user_ptr);
84 if (hex_spelling_any(user_ptr))
85 stop_hex_spell_all(user_ptr);
87 msg_print(_("あなたは力強い突風を吹き鳴らした。周囲の敵が震え上っている!", "You wind a mighty blast; your enemies tremble!"));
88 (void)turn_monsters(user_ptr, (3 * user_ptr->lev / 2) + 10);
92 bool activate_aggravation(player_type *user_ptr, object_type *o_ptr, concptr name)
94 if (o_ptr->name1 == ART_HYOUSIGI)
95 msg_print(_("拍子木を打った。", "You beat your wooden clappers."));
97 msg_format(_("%sは不快な物音を立てた。", "The %s sounds an unpleasant noise."), name);
99 aggravate_monsters(user_ptr, 0);
103 bool activate_stone_mud(player_type *user_ptr)
106 msg_print(_("鼓動している...", "It pulsates..."));
107 if (!get_aim_dir(user_ptr, &dir))
110 wall_to_mud(user_ptr, dir, 20 + randint1(30));
114 bool activate_judgement(player_type *user_ptr, concptr name)
116 msg_format(_("%sは赤く明るく光った!", "The %s flashes bright red!"), name);
117 chg_virtue(user_ptr, V_KNOWLEDGE, 1);
118 chg_virtue(user_ptr, V_ENLIGHTEN, 1);
119 wiz_lite(user_ptr, FALSE);
121 msg_format(_("%sはあなたの体力を奪った...", "The %s drains your vitality..."), name);
122 take_hit(user_ptr, DAMAGE_LOSELIFE, damroll(3, 8), _("審判の宝石", "the Jewel of Judgement"), -1);
124 (void)detect_traps(user_ptr, DETECT_RAD_DEFAULT, TRUE);
125 (void)detect_doors(user_ptr, DETECT_RAD_DEFAULT);
126 (void)detect_stairs(user_ptr, DETECT_RAD_DEFAULT);
128 if (get_check(_("帰還の力を使いますか?", "Activate recall? ")))
129 (void)recall_player(user_ptr, randint0(21) + 15);
134 bool activate_telekinesis(player_type *user_ptr, concptr name)
137 if (!get_aim_dir(user_ptr, &dir))
140 msg_format(_("%sを伸ばした。", "You stretched your %s."), name);
141 fetch_item(user_ptr, dir, 500, TRUE);
145 bool activate_unique_detection(player_type *user_ptr)
149 msg_print(_("奇妙な場所が頭の中に浮かんだ...", "Some strange places show up in your mind. And you see ..."));
150 for (int i = user_ptr->current_floor_ptr->m_max - 1; i >= 1; i--) {
151 m_ptr = &user_ptr->current_floor_ptr->m_list[i];
152 if (!monster_is_valid(m_ptr))
155 r_ptr = &r_info[m_ptr->r_idx];
156 if (r_ptr->flags1 & RF1_UNIQUE)
157 msg_format(_("%s. ", "%s. "), r_name + r_ptr->name);
159 if (m_ptr->r_idx == MON_DIO)
160 msg_print(_("きさま! 見ているなッ!", "You bastard! You're watching me, well watch this!"));
166 bool activate_dispel_curse(player_type *user_ptr, concptr name)
168 msg_format(_("%sが真実を照らし出す...", "The %s exhibits the truth..."), name);
169 (void)remove_all_curse(user_ptr);
170 (void)probing(user_ptr);
174 bool activate_cure_lw(player_type *user_ptr)
176 (void)set_afraid(user_ptr, 0);
177 (void)hp_player(user_ptr, 30);
181 bool activate_grand_cross(player_type *user_ptr)
183 msg_print(_("「闇に還れ!」", "You say, 'Return to darkness!'"));
184 (void)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);
188 bool activate_call_chaos(player_type *user_ptr)
190 msg_print(_("様々な色の火花を発している...", "It glows in scintillating colours..."));
191 call_chaos(user_ptr);
195 bool activate_dispel_evil(player_type *user_ptr)
197 msg_print(_("神聖な雰囲気が充満した...", "It floods the area with goodness..."));
198 dispel_evil(user_ptr, user_ptr->lev * 5);
202 bool activate_dispel_good(player_type *user_ptr)
204 msg_print(_("邪悪な雰囲気が充満した...", "It floods the area with evil..."));
205 dispel_good(user_ptr, user_ptr->lev * 5);
209 bool activate_all_monsters_detection(player_type *user_ptr)
211 (void)detect_monsters_invis(user_ptr, 255);
212 (void)detect_monsters_normal(user_ptr, 255);
216 bool activate_all_detection(player_type *user_ptr)
218 msg_print(_("白く明るく輝いている...", "It glows bright white..."));
219 msg_print(_("心にイメージが浮かんできた...", "An image forms in your mind..."));
220 detect_all(user_ptr, DETECT_RAD_DEFAULT);
224 bool activate_extra_detection(player_type *user_ptr)
226 msg_print(_("明るく輝いている...", "It glows brightly..."));
227 detect_all(user_ptr, DETECT_RAD_DEFAULT);
229 identify_fully(user_ptr, FALSE, TV_NONE);
233 bool activate_fully_identification(player_type *user_ptr)
235 msg_print(_("黄色く輝いている...", "It glows yellow..."));
236 identify_fully(user_ptr, FALSE, TV_NONE);
241 * @brief switch_activation() から個々のスペルへの依存性をなくすためのシンタックスシュガー
242 * @param user_ptr プレーヤーへの参照ポインタ
243 * @return 発動に成功したらTRUE
245 bool activate_identification(player_type *user_ptr) { return ident_spell(user_ptr, FALSE, TV_NONE); }
247 bool activate_pesticide(player_type *user_ptr)
249 msg_print(_("あなたは害虫を一掃した。", "You exterminate some pests."));
250 (void)dispel_monsters(user_ptr, 4);
255 * @brief switch_activation() から個々のスペルへの依存性をなくすためのシンタックスシュガー
256 * @param user_ptr プレーヤーへの参照ポインタ
257 * @return 発動に成功したらTRUE
259 bool activate_whirlwind(player_type *user_ptr)
265 bool activate_blinding_light(player_type *user_ptr, concptr name)
267 msg_format(_("%sが眩しい光で輝いた...", "The %s gleams with blinding light..."), name);
268 (void)fire_ball(user_ptr, GF_LITE, 0, 300, 6);
269 confuse_monsters(user_ptr, 3 * user_ptr->lev / 2);
273 bool activate_sleep(player_type *user_ptr)
275 msg_print(_("深青色に輝いている...", "It glows deep blue..."));
276 sleep_monsters_touch(user_ptr);
280 bool activate_door_destroy(player_type *user_ptr)
282 msg_print(_("明るい赤色に輝いている...", "It glows bright red..."));
283 destroy_doors_touch(user_ptr);
287 bool activate_earthquake(player_type *user_ptr)
289 earthquake(user_ptr, user_ptr->y, user_ptr->x, 5, 0);
293 bool activate_recharge(player_type *user_ptr)
295 recharge(user_ptr, 130);
299 bool activate_recharge_extra(player_type *user_ptr, concptr name)
301 msg_format(_("%sが白く輝いた...", "The %s gleams with blinding light..."), name);
302 return recharge(user_ptr, 1000);
305 bool activate_shikofumi(player_type *user_ptr)
307 msg_print(_("力強く四股を踏んだ。", "You stamp. (as if you are in a ring.)"));
308 (void)set_afraid(user_ptr, 0);
309 (void)set_hero(user_ptr, randint1(20) + 20, FALSE);
310 (void)dispel_evil(user_ptr, user_ptr->lev * 3);
314 bool activate_terror(player_type *user_ptr)
316 turn_monsters(user_ptr, 40 + user_ptr->lev);
320 bool activate_map_light(player_type *user_ptr)
322 msg_print(_("眩しく輝いた...", "It shines brightly..."));
323 map_area(user_ptr, DETECT_RAD_MAP);
324 lite_area(user_ptr, damroll(2, 15), 3);
328 bool activate_exploding_rune(player_type *user_ptr)
330 msg_print(_("明るい赤色に輝いている...", "It glows bright red..."));
331 create_rune_explosion(user_ptr, user_ptr->y, user_ptr->x);
335 bool activate_protection_rune(player_type *user_ptr)
337 msg_print(_("ブルーに明るく輝いている...", "It glows light blue..."));
338 create_rune_protection_one(user_ptr);
342 bool activate_light(player_type *user_ptr, concptr name)
344 msg_format(_("%sから澄んだ光があふれ出た...", "The %s wells with clear light..."), name);
345 (void)lite_area(user_ptr, damroll(2, 15), 3);
349 bool activate_recall(player_type *user_ptr)
351 msg_print(_("やわらかな白色に輝いている...", "It glows soft white..."));
352 return recall_player(user_ptr, randint0(21) + 15);
355 bool activate_tree_creation(player_type *user_ptr, object_type *o_ptr, concptr name)
357 msg_format(_("%s%sから明るい緑の光があふれ出た...", "The %s%s wells with clear light..."), name, quark_str(o_ptr->art_name));
358 return tree_creation(user_ptr, user_ptr->y, user_ptr->x);
361 bool activate_animate_dead(player_type *user_ptr, object_type *o_ptr)
363 msg_print(_("黄金色の光が溢れ出た...", "It emitted a golden light..."));
364 if (o_ptr->name1 > 0)
365 msg_print(_("ぴぴるぴるぴるぴぴるぴ~♪", "Pipiru piru piru pipiru pii"));
367 return animate_dead(user_ptr, 0, user_ptr->y, user_ptr->x);