7 #include "spell-realm/spells-crusade.h"
8 #include "core/disturbance.h"
9 #include "core/stuff-handler.h"
10 #include "effect/attribute-types.h"
11 #include "effect/effect-characteristics.h"
12 #include "effect/effect-processor.h"
13 #include "floor/cave.h"
14 #include "floor/geometry.h"
15 #include "game-option/disturbance-options.h"
16 #include "grid/feature-flag-types.h"
17 #include "spell-realm/spells-crusade.h"
18 #include "spell/range-calc.h"
19 #include "system/floor-type-definition.h"
20 #include "system/grid-type-definition.h"
21 #include "system/player-type-definition.h"
22 #include "system/redrawing-flags-updater.h"
23 #include "target/projection-path-calculator.h"
24 #include "target/target-checker.h"
25 #include "target/target-getter.h"
26 #include "util/bit-flags-calculator.h"
27 #include "view/display-messages.h"
30 * @brief 破邪魔法「神の怒り」の処理としてターゲットを指定した後分解のボールを最大20回発生させる。
31 * @param player_ptr プレイヤーへの参照ポインタ
34 * @return ターゲットを指定し、実行したならばTRUEを返す。
36 bool cast_wrath_of_the_god(PlayerType *player_ptr, int dam, POSITION rad)
39 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)) {
60 mmove2(&ny, &nx, player_ptr->y, player_ptr->x, ty, tx);
61 if (get_max_range(player_ptr) <= distance(player_ptr->y, player_ptr->x, ny, nx)) {
64 if (!cave_has_flag_bold(player_ptr->current_floor_ptr, ny, nx, TerrainCharacteristics::PROJECT)) {
67 if ((dir != 5) && player_ptr->current_floor_ptr->grid_array[ny][nx].m_idx != 0) {
78 int b = 10 + randint1(10);
79 for (int i = 0; i < b; i++) {
80 int count = 20, d = 0;
85 x = tx - 5 + randint0(11);
86 y = ty - 5 + randint0(11);
88 dx = (tx > x) ? (tx - x) : (x - tx);
89 dy = (ty > y) ? (ty - y) : (y - ty);
91 d = (dy > dx) ? (dy + (dx >> 1)) : (dx + (dy >> 1));
101 if (!in_bounds(player_ptr->current_floor_ptr, y, x) || cave_stop_disintegration(player_ptr->current_floor_ptr, y, x) || !in_disintegration_range(player_ptr->current_floor_ptr, ty, tx, y, x)) {
105 project(player_ptr, 0, rad, y, x, dam, AttributeType::DISINTEGRATE, PROJECT_JUMP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL);
112 * @brief 一時的聖なるのオーラの継続時間をセットする / Set "tim_sh_holy", notice observable changes
114 * @param do_dec 現在の継続時間より長い値のみ上書きする
115 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
117 bool set_tim_sh_holy(PlayerType *player_ptr, TIME_EFFECT v, bool do_dec)
120 v = (v > 10000) ? 10000 : (v < 0) ? 0
123 if (player_ptr->is_dead) {
128 if (player_ptr->tim_sh_holy && !do_dec) {
129 if (player_ptr->tim_sh_holy > v) {
132 } else if (!player_ptr->tim_sh_holy) {
133 msg_print(_("体が聖なるオーラで覆われた。", "You are enveloped by a holy aura!"));
137 if (player_ptr->tim_sh_holy) {
138 msg_print(_("聖なるオーラが消えた。", "The holy aura disappeared."));
143 auto &rfu = RedrawingFlagsUpdater::get_instance();
144 player_ptr->tim_sh_holy = v;
145 rfu.set_flag(MainWindowRedrawingFlag::TIMED_EFFECT);
152 disturb(player_ptr, false, false);
155 rfu.set_flag(StatusRecalculatingFlag::BONUS);
156 handle_stuff(player_ptr);
161 * @brief 目には目をの残り時間をセットする / Set "tim_eyeeye", notice observable changes
163 * @param do_dec 現在の継続時間より長い値のみ上書きする
164 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す
165 * @details 呪術領域でも使えるが、汎用性と行数の兼ね合いを考えて破邪側に入れた
167 bool set_tim_eyeeye(PlayerType *player_ptr, TIME_EFFECT v, bool do_dec)
170 v = (v > 10000) ? 10000 : (v < 0) ? 0
173 if (player_ptr->is_dead) {
178 if (player_ptr->tim_eyeeye && !do_dec) {
179 if (player_ptr->tim_eyeeye > v) {
182 } else if (!player_ptr->tim_eyeeye) {
183 msg_print(_("法の守り手になった気がした!", "You feel like a keeper of commandments!"));
187 if (player_ptr->tim_eyeeye) {
188 msg_print(_("懲罰を執行することができなくなった。", "You lost your aura of retribution."));
193 auto &rfu = RedrawingFlagsUpdater::get_instance();
194 player_ptr->tim_eyeeye = v;
195 rfu.set_flag(MainWindowRedrawingFlag::TIMED_EFFECT);
202 disturb(player_ptr, false, false);
205 rfu.set_flag(StatusRecalculatingFlag::BONUS);
206 handle_stuff(player_ptr);