2 * @brief 発動処理その他 (肥大化しがちなので適宜まとまりを別ファイルへ分割すること)
7 #include "object-activation/activation-others.h"
8 #include "artifact/fixed-art-types.h"
9 #include "avatar/avatar.h"
10 #include "cmd-io/cmd-save.h"
11 #include "core/asking-player.h"
12 #include "core/player-redraw-types.h"
13 #include "effect/effect-characteristics.h"
14 #include "effect/effect-processor.h"
15 #include "game-option/special-options.h"
16 #include "hpmp/hp-mp-processor.h"
17 #include "monster-race/monster-race.h"
18 #include "monster-race/race-flags1.h"
19 #include "monster-race/race-indice-types.h"
20 #include "monster/monster-status.h"
21 #include "player-attack/player-attack.h"
22 #include "player/player-damage.h"
23 #include "player/player-status.h"
24 #include "spell-kind/earthquake.h"
25 #include "spell-kind/magic-item-recharger.h"
26 #include "spell-kind/spells-beam.h"
27 #include "spell-kind/spells-curse-removal.h"
28 #include "spell-kind/spells-detection.h"
29 #include "spell-kind/spells-fetcher.h"
30 #include "spell-kind/spells-floor.h"
31 #include "spell-kind/spells-grid.h"
32 #include "spell-kind/spells-launcher.h"
33 #include "spell-kind/spells-lite.h"
34 #include "spell-kind/spells-neighbor.h"
35 #include "spell-kind/spells-perception.h"
36 #include "spell-kind/spells-random.h"
37 #include "spell-kind/spells-sight.h"
38 #include "spell-kind/spells-teleport.h"
39 #include "spell-kind/spells-world.h"
40 #include "spell-realm/spells-hex.h"
41 #include "spell-realm/spells-song.h"
42 #include "effect/attribute-types.h"
43 #include "spell/spells-status.h"
44 #include "status/bad-status-setter.h"
45 #include "status/body-improvement.h"
46 #include "status/buff-setter.h"
47 #include "system/floor-type-definition.h"
48 #include "system/monster-race-definition.h"
49 #include "system/monster-type-definition.h"
50 #include "system/object-type-definition.h"
51 #include "system/player-type-definition.h"
52 #include "target/target-getter.h"
53 #include "util/bit-flags-calculator.h"
54 #include "util/quarks.h"
55 #include "view/display-messages.h"
57 bool activate_sunlight(player_type *player_ptr)
60 if (!get_aim_dir(player_ptr, &dir))
63 msg_print(_("太陽光線が放たれた。", "A line of sunlight appears."));
64 (void)lite_line(player_ptr, dir, damroll(6, 8));
68 bool activate_confusion(player_type *player_ptr)
71 msg_print(_("様々な色の火花を発している...", "It glows in scintillating colours..."));
72 if (!get_aim_dir(player_ptr, &dir))
75 confuse_monster(player_ptr, dir, 20);
79 bool activate_banish_evil(player_type *player_ptr)
81 if (banish_evil(player_ptr, 100))
82 msg_print(_("アーティファクトの力が邪悪を打ち払った!", "The power of the artifact banishes evil!"));
87 bool activate_scare(player_type *player_ptr)
89 if (music_singing_any(player_ptr))
90 stop_singing(player_ptr);
92 if (SpellHex(player_ptr).is_spelling_any()) {
93 (void)SpellHex(player_ptr).stop_all_spells();
96 msg_print(_("あなたは力強い突風を吹き鳴らした。周囲の敵が震え上っている!", "You wind a mighty blast; your enemies tremble!"));
97 (void)turn_monsters(player_ptr, (3 * player_ptr->lev / 2) + 10);
101 bool activate_aggravation(player_type *player_ptr, object_type *o_ptr, concptr name)
103 if (o_ptr->name1 == ART_HYOUSIGI)
104 msg_print(_("拍子木を打った。", "You beat your wooden clappers."));
106 msg_format(_("%sは不快な物音を立てた。", "The %s sounds an unpleasant noise."), name);
108 aggravate_monsters(player_ptr, 0);
112 bool activate_stone_mud(player_type *player_ptr)
115 msg_print(_("鼓動している...", "It pulsates..."));
116 if (!get_aim_dir(player_ptr, &dir))
119 wall_to_mud(player_ptr, dir, 20 + randint1(30));
123 bool activate_judgement(player_type *player_ptr, concptr name)
125 msg_format(_("%sは赤く明るく光った!", "The %s flashes bright red!"), name);
126 chg_virtue(player_ptr, V_KNOWLEDGE, 1);
127 chg_virtue(player_ptr, V_ENLIGHTEN, 1);
128 wiz_lite(player_ptr, false);
130 msg_format(_("%sはあなたの体力を奪った...", "The %s drains your vitality..."), name);
131 take_hit(player_ptr, DAMAGE_LOSELIFE, damroll(3, 8), _("審判の宝石", "the Jewel of Judgement"));
133 (void)detect_traps(player_ptr, DETECT_RAD_DEFAULT, true);
134 (void)detect_doors(player_ptr, DETECT_RAD_DEFAULT);
135 (void)detect_stairs(player_ptr, DETECT_RAD_DEFAULT);
137 if (get_check(_("帰還の力を使いますか?", "Activate recall? ")))
138 (void)recall_player(player_ptr, randint0(21) + 15);
143 bool activate_telekinesis(player_type *player_ptr, concptr name)
146 if (!get_aim_dir(player_ptr, &dir))
149 msg_format(_("%sを伸ばした。", "You stretched your %s."), name);
150 fetch_item(player_ptr, dir, 500, true);
154 bool activate_unique_detection(player_type *player_ptr)
158 msg_print(_("奇妙な場所が頭の中に浮かんだ...", "Some strange places show up in your mind. And you see ..."));
159 for (int i = player_ptr->current_floor_ptr->m_max - 1; i >= 1; i--) {
160 m_ptr = &player_ptr->current_floor_ptr->m_list[i];
161 if (!monster_is_valid(m_ptr))
164 r_ptr = &r_info[m_ptr->r_idx];
165 if (r_ptr->flags1 & RF1_UNIQUE)
166 msg_format(_("%s. ", "%s. "), r_ptr->name.c_str());
168 if (m_ptr->r_idx == MON_DIO)
169 msg_print(_("きさま! 見ているなッ!", "You bastard! You're watching me, well watch this!"));
175 bool activate_dispel_curse(player_type *player_ptr, concptr name)
177 msg_format(_("%sが真実を照らし出す...", "The %s exhibits the truth..."), name);
178 (void)remove_all_curse(player_ptr);
179 (void)probing(player_ptr);
183 bool activate_cure_lw(player_type *player_ptr)
185 (void)BadStatusSetter(player_ptr).afraidness(0);
186 (void)hp_player(player_ptr, 30);
190 bool activate_grand_cross(player_type *player_ptr)
192 msg_print(_("「闇に還れ!」", "You say, 'Return to darkness!'"));
193 (void)project(player_ptr, 0, 8, player_ptr->y, player_ptr->x, (randint1(100) + 200) * 2, AttributeType::HOLY_FIRE, PROJECT_KILL | PROJECT_ITEM | PROJECT_GRID);
197 bool activate_call_chaos(player_type *player_ptr)
199 msg_print(_("様々な色の火花を発している...", "It glows in scintillating colours..."));
200 call_chaos(player_ptr);
204 bool activate_dispel_evil(player_type *player_ptr)
206 msg_print(_("神聖な雰囲気が充満した...", "It floods the area with goodness..."));
207 dispel_evil(player_ptr, player_ptr->lev * 5);
211 bool activate_dispel_good(player_type *player_ptr)
213 msg_print(_("邪悪な雰囲気が充満した...", "It floods the area with evil..."));
214 dispel_good(player_ptr, player_ptr->lev * 5);
218 bool activate_all_monsters_detection(player_type *player_ptr)
220 (void)detect_monsters_invis(player_ptr, 255);
221 (void)detect_monsters_normal(player_ptr, 255);
225 bool activate_all_detection(player_type *player_ptr)
227 msg_print(_("白く明るく輝いている...", "It glows bright white..."));
228 msg_print(_("心にイメージが浮かんできた...", "An image forms in your mind..."));
229 detect_all(player_ptr, DETECT_RAD_DEFAULT);
233 bool activate_extra_detection(player_type *player_ptr)
235 msg_print(_("明るく輝いている...", "It glows brightly..."));
236 detect_all(player_ptr, DETECT_RAD_DEFAULT);
238 identify_fully(player_ptr, false);
242 bool activate_fully_identification(player_type *player_ptr)
244 msg_print(_("黄色く輝いている...", "It glows yellow..."));
245 identify_fully(player_ptr, false);
250 * @brief switch_activation() から個々のスペルへの依存性をなくすためのシンタックスシュガー
251 * @param player_ptr プレイヤーへの参照ポインタ
252 * @return 発動に成功したらTRUE
254 bool activate_identification(player_type *player_ptr)
256 return ident_spell(player_ptr, false);
259 bool activate_pesticide(player_type *player_ptr)
261 msg_print(_("あなたは害虫を一掃した。", "You exterminate some pests."));
262 (void)dispel_monsters(player_ptr, 4);
267 * @brief switch_activation() から個々のスペルへの依存性をなくすためのシンタックスシュガー
268 * @param player_ptr プレイヤーへの参照ポインタ
269 * @return 発動に成功したらTRUE
271 bool activate_whirlwind(player_type *player_ptr)
273 massacre(player_ptr);
277 bool activate_blinding_light(player_type *player_ptr, concptr name)
279 msg_format(_("%sが眩しい光で輝いた...", "The %s gleams with blinding light..."), name);
280 (void)fire_ball(player_ptr, AttributeType::LITE, 0, 300, 6);
281 confuse_monsters(player_ptr, 3 * player_ptr->lev / 2);
285 bool activate_sleep(player_type *player_ptr)
287 msg_print(_("深青色に輝いている...", "It glows deep blue..."));
288 sleep_monsters_touch(player_ptr);
292 bool activate_door_destroy(player_type *player_ptr)
294 msg_print(_("明るい赤色に輝いている...", "It glows bright red..."));
295 destroy_doors_touch(player_ptr);
299 bool activate_earthquake(player_type *player_ptr)
301 earthquake(player_ptr, player_ptr->y, player_ptr->x, 5, 0);
305 bool activate_recharge(player_type *player_ptr)
307 recharge(player_ptr, 130);
311 bool activate_recharge_extra(player_type *player_ptr, concptr name)
313 msg_format(_("%sが白く輝いた...", "The %s gleams with blinding light..."), name);
314 return recharge(player_ptr, 1000);
317 bool activate_shikofumi(player_type *player_ptr)
319 msg_print(_("力強く四股を踏んだ。", "You stamp. (as if you are in a ring.)"));
320 (void)BadStatusSetter(player_ptr).afraidness(0);
321 (void)set_hero(player_ptr, randint1(20) + 20, false);
322 (void)dispel_evil(player_ptr, player_ptr->lev * 3);
326 bool activate_terror(player_type *player_ptr)
328 turn_monsters(player_ptr, 40 + player_ptr->lev);
332 bool activate_map_light(player_type *player_ptr)
334 msg_print(_("眩しく輝いた...", "It shines brightly..."));
335 map_area(player_ptr, DETECT_RAD_MAP);
336 lite_area(player_ptr, damroll(2, 15), 3);
340 bool activate_exploding_rune(player_type *player_ptr)
342 msg_print(_("明るい赤色に輝いている...", "It glows bright red..."));
343 create_rune_explosion(player_ptr, player_ptr->y, player_ptr->x);
347 bool activate_protection_rune(player_type *player_ptr)
349 msg_print(_("ブルーに明るく輝いている...", "It glows light blue..."));
350 create_rune_protection_one(player_ptr);
354 bool activate_protection_elbereth(player_type *player_ptr)
356 BadStatusSetter bss(player_ptr);
357 msg_print(_("エルベレスよ、我を護り給え!", "A Elbereth gilthoniel!"));
358 create_rune_protection_one(player_ptr);
359 (void)bss.afraidness(0);
360 (void)bss.blindness(0);
361 (void)bss.hallucination(0);
362 set_blessed(player_ptr, randint0(25) + 25, true);
363 set_bits(player_ptr->redraw, PR_STATS);
367 bool activate_light(player_type *player_ptr, concptr name)
369 msg_format(_("%sから澄んだ光があふれ出た...", "The %s wells with clear light..."), name);
370 (void)lite_area(player_ptr, damroll(2, 15), 3);
374 bool activate_recall(player_type *player_ptr)
376 msg_print(_("やわらかな白色に輝いている...", "It glows soft white..."));
377 return recall_player(player_ptr, randint0(21) + 15);
380 bool activate_tree_creation(player_type *player_ptr, object_type *o_ptr, concptr name)
382 msg_format(_("%s%sから明るい緑の光があふれ出た...", "The %s%s wells with clear light..."), name, quark_str(o_ptr->art_name));
383 return tree_creation(player_ptr, player_ptr->y, player_ptr->x);
386 bool activate_animate_dead(player_type *player_ptr, object_type *o_ptr)
388 msg_print(_("黄金色の光が溢れ出た...", "It emitted a golden light..."));
389 if (o_ptr->name1 > 0)
390 msg_print(_("ぴぴるぴるぴるぴぴるぴ~♪", "Pipiru piru piru pipiru pii"));
392 return animate_dead(player_ptr, 0, player_ptr->y, player_ptr->x);
395 bool activate_detect_treasure(player_type *player_ptr)
397 msg_print(_("金と銀に彩られている...", "It shines with gold and silver..."));
398 return detect_treasure(player_ptr, DETECT_RAD_DEFAULT);