OSDN Git Service

[Refactor] #40414 Moved cast_meteor() from spells2.c/h to spells-floor.c/h
authorHourier <hourier@users.sourceforge.jp>
Fri, 5 Jun 2020 12:07:44 +0000 (21:07 +0900)
committerHourier <hourier@users.sourceforge.jp>
Fri, 5 Jun 2020 12:10:38 +0000 (21:10 +0900)
src/realm/realm-trump.c
src/spell-kind/spells-floor.c
src/spell-kind/spells-floor.h
src/spell/spells2.c
src/spell/spells2.h

index 6506786..93ca8e6 100644 (file)
 #include "spell-kind/spells-sight.h"
 #include "spell/spells-status.h"
 #include "spell/spells-summon.h"
+#include "spell-kind/spells-floor.h"
 #include "spell-kind/spells-shuffle.h"
 #include "spell-kind/spells-teleport.h"
 #include "spell/spells-type.h"
-#include "spell/spells2.h"
 #include "spell/spells3.h"
 #include "util/util.h"
 
index 7b41507..e74985f 100644 (file)
@@ -9,6 +9,7 @@
 #include "cmd/cmd-basic.h"
 #include "dungeon/dungeon.h"
 #include "dungeon/quest.h"
+#include "effect/effect-characteristics.h"
 #include "floor/floor-events.h"
 #include "floor/floor-object.h"
 #include "floor/floor-save.h"
 #include "player/player-effects.h"
 #include "player/player-move.h"
 #include "spell-kind/spells-teleport.h"
+#include "spell/process-effect.h"
+#include "spell/spells-type.h"
 #include "util/util.h"
 #include "view/display-main-window.h"
 
 /*
- * Light up the dungeon using "clairvoyance"
- *
- * This function "illuminates" every grid in the dungeon, memorizes all
- * "objects", memorizes all grids as with magic mapping, and, under the
- * standard option settings (view_perma_grids but not view_torch_grids)
- * memorizes all floor grids too.
- *
- * Note that if "view_perma_grids" is not set, we do not memorize floor
- * grids, since this would defeat the purpose of "view_perma_grids", not
- * that anyone seems to play without this option.
- *
- * Note that if "view_torch_grids" is set, we do not memorize floor grids,
- * since this would prevent the use of "view_torch_grids" as a method to
- * keep track of what grids have been observed directly.
+ * @brief 啓蒙/陽光召喚処理
+ * @param caster_ptr プレーヤーへの参照ポインタ
+ * @param ninja 忍者かどうか
+ * @return なし
  */
 void wiz_lite(player_type *caster_ptr, bool ninja)
 {
@@ -1139,3 +1132,45 @@ bool earthquake(player_type *caster_ptr, POSITION cy, POSITION cx, POSITION r, M
        /* Success */
        return TRUE;
 }
+
+/*!
+ * @brief カオス魔法「流星群」の処理としてプレイヤーを中心に隕石落下処理を10+1d10回繰り返す。
+ * / Drop 10+1d10 meteor ball at random places near the player
+ * @param caster_ptr プレーヤーへの参照ポインタ
+ * @param dam ダメージ
+ * @param rad 効力の半径
+ * @return なし
+ */
+void cast_meteor(player_type *caster_ptr, HIT_POINT dam, POSITION rad)
+{
+    int b = 10 + randint1(10);
+    for (int i = 0; i < b; i++) {
+        POSITION y = 0, x = 0;
+        int count;
+
+        for (count = 0; count <= 20; count++) {
+            int dy, dx, d;
+
+            x = caster_ptr->x - 8 + randint0(17);
+            y = caster_ptr->y - 8 + randint0(17);
+            dx = (caster_ptr->x > x) ? (caster_ptr->x - x) : (x - caster_ptr->x);
+            dy = (caster_ptr->y > y) ? (caster_ptr->y - y) : (y - caster_ptr->y);
+            d = (dy > dx) ? (dy + (dx >> 1)) : (dx + (dy >> 1));
+
+            if (d >= 9)
+                continue;
+
+            floor_type *floor_ptr = caster_ptr->current_floor_ptr;
+            if (!in_bounds(floor_ptr, y, x) || !projectable(caster_ptr, caster_ptr->y, caster_ptr->x, y, x)
+                || !cave_have_flag_bold(floor_ptr, y, x, FF_PROJECT))
+                continue;
+
+            break;
+        }
+
+        if (count > 20)
+            continue;
+
+        project(caster_ptr, 0, rad, y, x, dam, GF_METEOR, PROJECT_KILL | PROJECT_JUMP | PROJECT_ITEM, -1);
+    }
+}
index c5decfb..d59f030 100644 (file)
@@ -11,3 +11,4 @@ void stair_creation(player_type *caster_ptr);
 void map_area(player_type *caster_ptr, POSITION range);
 bool destroy_area(player_type *caster_ptr, POSITION y1, POSITION x1, POSITION r, bool in_generate);
 bool earthquake(player_type *caster_ptr, POSITION cy, POSITION cx, POSITION r, MONSTER_IDX m_idx);
+void cast_meteor(player_type *caster_ptr, HIT_POINT dam, POSITION rad);
index 42fb5e1..8b7902f 100644 (file)
 #include "world/world.h"
 
 /*!
-* @brief カオス魔法「流星群」の処理としてプレイヤーを中心に隕石落下処理を10+1d10回繰り返す。
-* / Drop 10+1d10 meteor ball at random places near the player
-* @param caster_ptr プレーヤーへの参照ポインタ
-* @param dam ダメージ
-* @param rad 効力の半径
-* @return なし
-*/
-void cast_meteor(player_type *caster_ptr, HIT_POINT dam, POSITION rad)
-{
-       int b = 10 + randint1(10);
-       for (int i = 0; i < b; i++)
-       {
-               POSITION y = 0, x = 0;
-               int count;
-
-               for (count = 0; count <= 20; count++)
-               {
-                       int dy, dx, d;
-
-                       x = caster_ptr->x - 8 + randint0(17);
-                       y = caster_ptr->y - 8 + randint0(17);
-                       dx = (caster_ptr->x > x) ? (caster_ptr->x - x) : (x - caster_ptr->x);
-                       dy = (caster_ptr->y > y) ? (caster_ptr->y - y) : (y - caster_ptr->y);
-                       d = (dy > dx) ? (dy + (dx >> 1)) : (dx + (dy >> 1));
-
-                       if (d >= 9) continue;
-
-                       floor_type *floor_ptr = caster_ptr->current_floor_ptr;
-                       if (!in_bounds(floor_ptr, y, x) || !projectable(caster_ptr, caster_ptr->y, caster_ptr->x, y, x)
-                               || !cave_have_flag_bold(floor_ptr, y, x, FF_PROJECT)) continue;
-
-                       break;
-               }
-
-               if (count > 20) continue;
-
-               project(caster_ptr, 0, rad, y, x, dam, GF_METEOR, PROJECT_KILL | PROJECT_JUMP | PROJECT_ITEM, -1);
-       }
-}
-
-
-/*!
 * @brief 破邪魔法「神の怒り」の処理としてターゲットを指定した後分解のボールを最大20回発生させる。
 * @param caster_ptr プレーヤーへの参照ポインタ
 * @param dam ダメージ
index 42450c6..74eb8e8 100644 (file)
@@ -4,7 +4,6 @@
 
 bool eat_magic(player_type* caster_ptr, int power);
 void wild_magic(player_type* caster_ptr, int spell);
-void cast_meteor(player_type* caster_ptr, HIT_POINT dam, POSITION rad);
 bool cast_wrath_of_the_god(player_type* caster_ptr, HIT_POINT dam, POSITION rad);
 void cast_wonder(player_type* caster_ptr, DIRECTION dir);
 bool vampirism(player_type* caster_ptr);