7 #include "spell-realm/spells-crusade.h"
8 #include "core/disturbance.h"
9 #include "core/player-redraw-types.h"
10 #include "core/player-update-types.h"
11 #include "core/stuff-handler.h"
12 #include "effect/effect-characteristics.h"
13 #include "effect/effect-processor.h"
14 #include "floor/cave.h"
15 #include "floor/geometry.h"
16 #include "game-option/disturbance-options.h"
17 #include "grid/feature-flag-types.h"
18 #include "spell-realm/spells-crusade.h"
19 #include "spell/range-calc.h"
20 #include "effect/attribute-types.h"
21 #include "system/floor-type-definition.h"
22 #include "system/grid-type-definition.h"
23 #include "system/player-type-definition.h"
24 #include "target/projection-path-calculator.h"
25 #include "target/target-checker.h"
26 #include "target/target-getter.h"
27 #include "util/bit-flags-calculator.h"
28 #include "view/display-messages.h"
31 * @brief 破邪魔法「神の怒り」の処理としてターゲットを指定した後分解のボールを最大20回発生させる。
32 * @param player_ptr プレイヤーへの参照ポインタ
35 * @return ターゲットを指定し、実行したならばTRUEを返す。
37 bool cast_wrath_of_the_god(PlayerType *player_ptr, int dam, POSITION rad)
40 if (!get_aim_dir(player_ptr, &dir))
43 POSITION tx = player_ptr->x + 99 * ddx[dir];
44 POSITION ty = player_ptr->y + 99 * ddy[dir];
45 if ((dir == 5) && target_okay(player_ptr)) {
50 POSITION x = player_ptr->x;
51 POSITION y = player_ptr->y;
54 if ((y == ty) && (x == tx))
59 mmove2(&ny, &nx, player_ptr->y, player_ptr->x, ty, tx);
60 if (get_max_range(player_ptr) <= distance(player_ptr->y, player_ptr->x, ny, nx))
62 if (!cave_has_flag_bold(player_ptr->current_floor_ptr, ny, nx, FloorFeatureType::PROJECT))
64 if ((dir != 5) && player_ptr->current_floor_ptr->grid_array[ny][nx].m_idx != 0)
74 int b = 10 + randint1(10);
75 for (int i = 0; i < b; i++) {
76 int count = 20, d = 0;
81 x = tx - 5 + randint0(11);
82 y = ty - 5 + randint0(11);
84 dx = (tx > x) ? (tx - x) : (x - tx);
85 dy = (ty > y) ? (ty - y) : (y - ty);
87 d = (dy > dx) ? (dy + (dx >> 1)) : (dx + (dy >> 1));
95 if (!in_bounds(player_ptr->current_floor_ptr, y, x) || cave_stop_disintegration(player_ptr->current_floor_ptr, y, x)
96 || !in_disintegration_range(player_ptr->current_floor_ptr, ty, tx, y, x))
99 project(player_ptr, 0, rad, y, x, dam, AttributeType::DISINTEGRATE, PROJECT_JUMP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL);
106 * @brief 一時的聖なるのオーラの継続時間をセットする / Set "tim_sh_holy", notice observable changes
108 * @param do_dec 現在の継続時間より長い値のみ上書きする
109 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
111 bool set_tim_sh_holy(PlayerType *player_ptr, TIME_EFFECT v, bool do_dec)
114 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
116 if (player_ptr->is_dead)
120 if (player_ptr->tim_sh_holy && !do_dec) {
121 if (player_ptr->tim_sh_holy > v)
123 } else if (!player_ptr->tim_sh_holy) {
124 msg_print(_("体が聖なるオーラで覆われた。", "You are enveloped by a holy aura!"));
128 if (player_ptr->tim_sh_holy) {
129 msg_print(_("聖なるオーラが消えた。", "The holy aura disappeared."));
134 player_ptr->tim_sh_holy = v;
135 player_ptr->redraw |= (PR_STATUS);
141 disturb(player_ptr, false, false);
142 player_ptr->update |= (PU_BONUS);
143 handle_stuff(player_ptr);
148 * @brief 目には目をの残り時間をセットする / Set "tim_eyeeye", notice observable changes
150 * @param do_dec 現在の継続時間より長い値のみ上書きする
151 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す
152 * @details 呪術領域でも使えるが、汎用性と行数の兼ね合いを考えて破邪側に入れた
154 bool set_tim_eyeeye(PlayerType *player_ptr, TIME_EFFECT v, bool do_dec)
157 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
159 if (player_ptr->is_dead)
163 if (player_ptr->tim_eyeeye && !do_dec) {
164 if (player_ptr->tim_eyeeye > v)
166 } else if (!player_ptr->tim_eyeeye) {
167 msg_print(_("法の守り手になった気がした!", "You feel like a keeper of commandments!"));
171 if (player_ptr->tim_eyeeye) {
172 msg_print(_("懲罰を執行することができなくなった。", "You lost your aura of retribution."));
177 player_ptr->tim_eyeeye = v;
178 player_ptr->redraw |= (PR_STATUS);
184 disturb(player_ptr, false, false);
185 player_ptr->update |= (PU_BONUS);
186 handle_stuff(player_ptr);