OSDN Git Service

[Refactor] #37285 Separated specified-summon.c/h from mspell-summon.c/h
authorHourier <hourier@users.sourceforge.jp>
Sun, 19 Jul 2020 13:53:23 +0000 (22:53 +0900)
committerHourier <hourier@users.sourceforge.jp>
Sun, 19 Jul 2020 13:53:23 +0000 (22:53 +0900)
26 files changed:
Hengband/Hengband/Hengband.vcxproj
Hengband/Hengband/Hengband.vcxproj.filters
lib/edit/r_info.txt
src/Makefile.am
src/core/game-play.c
src/effect/effect-monster.c
src/floor/cave.c
src/floor/cave.h
src/floor/floor.c
src/floor/floor.h
src/melee/melee-postprocess.c
src/mind/mind-force-trainer.c
src/monster-attack/monster-attack-processor.c
src/monster-floor/monster-direction.c
src/monster/monster-info.c
src/mspell/mspell-special.c
src/mspell/mspell-summon.c
src/mspell/mspell-summon.h
src/mspell/specified-summon.c [new file with mode: 0644]
src/mspell/specified-summon.h [new file with mode: 0644]
src/player/player-move.c
src/realm/realm-crusade.c
src/realm/realm-hex.c
src/specific-object/chest.c
src/window/main-window-util.c
src/wizard/wizard-spells.c

index fe0e4c4..16e0f80 100644 (file)
     <ClCompile Include="..\..\src\mind\mind-mage.c" />\r
     <ClCompile Include="..\..\src\mind\mind-magic-resistance.c" />\r
     <ClCompile Include="..\..\src\mind\mind-weaponsmith.c" />\r
+    <ClCompile Include="..\..\src\mspell\specified-summon.c" />\r
     <ClCompile Include="..\..\src\racial\racial-kutar.c" />\r
     <ClCompile Include="..\..\src\mind\stances-table.c" />\r
     <ClCompile Include="..\..\src\mspell\mspell-dispel.c" />\r
     <ClInclude Include="..\..\src\mind\mind-mage.h" />\r
     <ClInclude Include="..\..\src\mind\mind-magic-resistance.h" />\r
     <ClInclude Include="..\..\src\mind\mind-weaponsmith.h" />\r
+    <ClInclude Include="..\..\src\mspell\specified-summon.h" />\r
     <ClInclude Include="..\..\src\racial\racial-kutar.h" />\r
     <ClInclude Include="..\..\src\mind\stances-table.h" />\r
     <ClInclude Include="..\..\src\mspell\monster-power-table.h" />\r
index d631b16..3e76ef3 100644 (file)
     <ClCompile Include="..\..\src\blue-magic\blue-magic-breath.c">
       <Filter>blue-magic</Filter>
     </ClCompile>
+    <ClCompile Include="..\..\src\mspell\specified-summon.c">
+      <Filter>mspell</Filter>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="..\..\src\combat\shoot.h">
     <ClInclude Include="..\..\src\blue-magic\blue-magic-breath.h">
       <Filter>blue-magic</Filter>
     </ClInclude>
+    <ClInclude Include="..\..\src\mspell\specified-summon.h">
+      <Filter>mspell</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <None Include="..\..\src\wall.bmp" />
index 6b05d0d..a967bf7 100644 (file)
@@ -23357,7 +23357,7 @@ D:トーテムポール状に積み上がったモアイだ。倒してもきり
 # プチモアイのみ召喚
 N:1162:モアイの総大将『ヴァイフ』
 E:Vaif, the general of Moais
-G:g:d
+G:g:D
 I:120:60d50:25:100:20
 W:49:1:0:11000:0:0
 B:CRUSH:SUPERHURT:12d15
index a99c5cf..9a591c7 100644 (file)
@@ -468,6 +468,7 @@ hengband_SOURCES = \
        mspell/mspell-special.c mspell/mspell-special.h \
        mspell/mspell-status.c mspell/mspell-status.h \
        mspell/mspell-particularity.c mspell/mspell-particularity.h \
+       mspell/specified-summon.c mspell/specified-summon.h \
        mspell/summon-checker.c mspell/summon-checker.h \
        \
        mutation/mutation.c mutation/mutation.h \
index 128428e..3e30b0f 100644 (file)
@@ -28,6 +28,7 @@
 #include "core/window-redrawer.h"
 #include "dungeon/dungeon-processor.h"
 #include "flavor/object-flavor.h"
+#include "floor/cave.h"
 #include "floor/floor-events.h"
 #include "floor/floor-save.h"
 #include "floor/floor-util.h"
index 357a0eb..6f3e4e6 100644 (file)
@@ -11,8 +11,8 @@
 #include "core/window-redrawer.h"
 #include "effect/effect-characteristics.h"
 #include "effect/effect-monster-switcher.h"
+#include "floor/cave.h"
 #include "floor/floor-object.h"
-#include "floor/floor.h"
 #include "game-option/play-record-options.h"
 #include "io/write-diary.h"
 #include "main/sound-definitions-table.h"
index 4055861..ecd1e9d 100644 (file)
@@ -11,6 +11,7 @@
 #include "grid/grid.h"
 #include "system/floor-type-definition.h"
 #include "util/bit-flags-calculator.h"
+#include "world/world.h"
 
 /*
  * Determines if a map location is fully inside the outer walls
@@ -28,6 +29,37 @@ bool in_bounds2(floor_type *floor_ptr, POSITION y, POSITION x) { return (y >= 0)
  */
 bool in_bounds2u(floor_type *floor_ptr, POSITION y, POSITION x) { return (y < floor_ptr->height) && (x < floor_ptr->width); }
 
+/*
+ * Determine if a "legal" grid is an "empty" floor grid
+ * Determine if monsters are allowed to move into a grid
+ *
+ * Line 1 -- forbid non-placement grids
+ * Line 2 -- forbid normal monsters
+ * Line 3 -- forbid the player
+ */
+bool is_cave_empty_bold(player_type *player_ptr, POSITION y, POSITION x)
+{
+    floor_type *floor_ptr = player_ptr->current_floor_ptr;
+    bool is_empty_grid = cave_have_flag_bold(floor_ptr, y, x, FF_PLACE);
+    is_empty_grid &= !(floor_ptr->grid_array[y][x].m_idx);
+    is_empty_grid &= !player_bold(player_ptr, y, x);
+    return is_empty_grid;
+}
+
+/*
+ * Determine if a "legal" grid is an "empty" floor grid
+ * Determine if monster generation is allowed in a grid
+ *
+ * Line 1 -- forbid non-empty grids
+ * Line 2 -- forbid trees while dungeon generation
+ */
+bool is_cave_empty_bold2(player_type *player_ptr, POSITION y, POSITION x)
+{
+    bool is_empty_grid = is_cave_empty_bold(player_ptr, y, x);
+    is_empty_grid &= current_world_ptr->character_dungeon || !cave_have_flag_bold(player_ptr->current_floor_ptr, y, x, FF_TREE);
+    return is_empty_grid;
+}
+
 bool cave_have_flag_bold(floor_type *floor_ptr, POSITION y, POSITION x, feature_flag_type f_idx)
 {
     return have_flag(f_info[floor_ptr->grid_array[y][x].feat].flags, f_idx);
@@ -40,3 +72,8 @@ bool player_has_los_bold(player_type *player_ptr, POSITION y, POSITION x)
 {
     return ((player_ptr->current_floor_ptr->grid_array[y][x].info & CAVE_VIEW) != 0) || player_ptr->phase_out;
 }
+
+/*
+ * Determine if player is on this grid
+ */
+bool player_bold(player_type *player_ptr, POSITION y, POSITION x) { return (y == player_ptr->y) && (x == player_ptr->x); }
index bf4e4f6..7f1a2d0 100644 (file)
@@ -6,5 +6,8 @@ typedef enum feature_flag_type feature_flag_type;
 bool in_bounds(floor_type *floor_ptr, POSITION y, POSITION x);
 bool in_bounds2(floor_type *floor_ptr, POSITION y, POSITION x);
 bool in_bounds2u(floor_type *floor_ptr, POSITION y, POSITION x);
+bool is_cave_empty_bold(player_type *player_ptr, POSITION x, POSITION y);
+bool is_cave_empty_bold2(player_type *player_ptr, POSITION x, POSITION y);
 bool cave_have_flag_bold(floor_type *floor_ptr, POSITION y, POSITION x, feature_flag_type f_idx);
 bool player_has_los_bold(player_type *player_ptr, POSITION y, POSITION x);
+bool player_bold(player_type *player_ptr, POSITION y, POSITION x);
index 6b4cbd6..48b3c83 100644 (file)
@@ -61,39 +61,6 @@ bool pattern_tile(floor_type *floor_ptr, POSITION y, POSITION x)
 }
 
 
-/*
- * Determine if a "legal" grid is an "empty" floor grid
- * Determine if monsters are allowed to move into a grid
- *
- * Line 1 -- forbid non-placement grids
- * Line 2 -- forbid normal monsters
- * Line 3 -- forbid the player
- */
-bool is_cave_empty_bold(player_type *player_ptr, POSITION y, POSITION x)
-{
-       floor_type *floor_ptr = player_ptr->current_floor_ptr;
-       bool is_empty_grid = cave_have_flag_bold(floor_ptr, y, x, FF_PLACE);
-       is_empty_grid &= !(floor_ptr->grid_array[y][x].m_idx);
-       is_empty_grid &= !player_bold(player_ptr, y, x);
-       return is_empty_grid;
-}
-
-
-/*
-  * Determine if a "legal" grid is an "empty" floor grid
-  * Determine if monster generation is allowed in a grid
-  *
-  * Line 1 -- forbid non-empty grids
-  * Line 2 -- forbid trees while dungeon generation
-  */
-bool is_cave_empty_bold2(player_type *player_ptr, POSITION y, POSITION x)
-{
-       bool is_empty_grid = is_cave_empty_bold(player_ptr, y, x);
-       is_empty_grid &= current_world_ptr->character_dungeon || !cave_have_flag_bold(player_ptr->current_floor_ptr, y, x, FF_TREE);
-       return is_empty_grid;
-}
-
-
 /*!
 * @brief 鍵のかかったドアを配置する
 * @param player_ptr プレーヤーへの参照ポインタ
index bdbd2d4..3dcfff2 100644 (file)
@@ -5,12 +5,6 @@
 extern floor_type floor_info;
 
 /*
- * Determine if player is on this grid
- */
-#define player_bold(C,Y,X) \
-       (((Y) == (C)->y) && ((X) == (C)->x))
-
-/*
  * Grid based version of "creature_bold()"
  */
 #define player_grid(C, G) \
@@ -129,8 +123,6 @@ extern floor_type floor_info;
        ((int)((G) % 256U))
 
 bool pattern_tile(floor_type *floor_ptr, POSITION y, POSITION x);
-bool is_cave_empty_bold(player_type *player_ptr, POSITION x, POSITION y);
-bool is_cave_empty_bold2(player_type *player_ptr, POSITION x, POSITION y);
 void update_smell(floor_type *floor_ptr, player_type *subject_ptr);
 void add_door(player_type *player_ptr, POSITION x, POSITION y);
 void place_secret_door(player_type *player_ptr, POSITION y, POSITION x, int type);
index d50be6a..6ed2891 100644 (file)
@@ -13,7 +13,7 @@
 #include "melee/melee-postprocess.h"
 #include "core/disturbance.h"
 #include "core/player-redraw-types.h"
-#include "floor/floor.h"
+#include "floor/cave.h"
 #include "grid/grid.h"
 #include "main/sound-definitions-table.h"
 #include "main/sound-of-music.h"
index a81f134..173847e 100644 (file)
@@ -5,7 +5,7 @@
 #include "core/player-update-types.h"
 #include "core/stuff-handler.h"
 #include "effect/spells-effect-util.h"
-#include "floor/floor.h"
+#include "floor/cave.h"
 #include "floor/geometry.h"
 #include "game-option/disturbance-options.h"
 #include "grid/grid.h"
index 675ed16..ebcbe19 100644 (file)
@@ -6,7 +6,7 @@
 
 #include "monster-attack/monster-attack-processor.h"
 #include "dungeon/dungeon-flag-types.h"
-#include "floor/floor.h"
+#include "floor/cave.h"
 #include "monster/monster-status.h"
 #include "dungeon/dungeon.h"
 #include "monster-attack/monster-attack-player.h"
index 4ef14d5..714dc88 100644 (file)
@@ -5,6 +5,7 @@
  */
 
 #include "monster-floor/monster-direction.h"
+#include "floor/cave.h"
 #include "floor/floor.h"
 #include "monster-race/monster-race.h"
 #include "monster-race/race-flags1.h"
index 2310361..c13fcfa 100644 (file)
@@ -11,7 +11,7 @@
 
 #include "monster/monster-info.h"
 #include "dungeon/quest.h"
-#include "floor/floor.h"
+#include "floor/cave.h"
 #include "floor/wild.h"
 #include "grid/feature.h"
 #include "grid/grid.h"
index a5c12b1..14bf2d0 100644 (file)
@@ -8,7 +8,7 @@
 #include "core/disturbance.h"
 #include "core/player-update-types.h"
 #include "effect/effect-characteristics.h"
-#include "floor/floor.h"
+#include "floor/cave.h"
 #include "grid/grid.h"
 #include "main/sound-definitions-table.h"
 #include "main/sound-of-music.h"
index ab2098f..6f03f51 100644 (file)
@@ -1,7 +1,7 @@
 #include "mspell/mspell-summon.h"
 #include "core/disturbance.h"
 #include "effect/effect-characteristics.h"
-#include "floor/floor.h"
+#include "floor/cave.h"
 #include "game-option/birth-options.h"
 #include "monster-floor/monster-summon.h"
 #include "monster-floor/place-monster-types.h"
@@ -14,6 +14,7 @@
 #include "monster/monster-status.h"
 #include "mspell/mspell-util.h"
 #include "mspell/mspells1.h"
+#include "mspell/specified-summon.h"
 #include "spell-kind/spells-launcher.h"
 #include "spell/process-effect.h"
 #include "spell/spells-summon.h"
@@ -42,140 +43,6 @@ static BIT_FLAGS monster_u_mode(floor_type *floor_ptr, MONSTER_IDX m_idx)
 }
 
 /*!
- * @brief 鷹召喚の処理。 /
- * @param target_ptr プレーヤーへの参照ポインタ
- * @param y 対象の地点のy座標
- * @param x 対象の地点のx座標
- * @param rlev 呪文を唱えるモンスターのレベル
- * @param m_idx 呪文を唱えるモンスターID
- * @return 召喚したモンスターの数を返す。
- */
-MONSTER_NUMBER summon_EAGLE(player_type *target_ptr, POSITION y, POSITION x, int rlev, MONSTER_IDX m_idx)
-{
-    int count = 0;
-    int num = 4 + randint1(3);
-    for (int k = 0; k < num; k++) {
-        count += summon_specific(target_ptr, m_idx, y, x, rlev, SUMMON_EAGLES, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE));
-    }
-
-    return count;
-}
-
-/*!
- * @brief インターネット・エクスプローダー召喚の処理。 /
- * @param target_ptr プレーヤーへの参照ポインタ
- * @param y 対象の地点のy座標
- * @param x 対象の地点のx座標
- * @param rlev 呪文を唱えるモンスターのレベル
- * @param m_idx 呪文を唱えるモンスターID
- * @return 召喚したモンスターの数を返す。
- */
-MONSTER_NUMBER summon_IE(player_type *target_ptr, POSITION y, POSITION x, int rlev, MONSTER_IDX m_idx)
-{
-    int count = 0;
-    int num = 2 + randint1(1 + rlev / 20);
-    for (int k = 0; k < num; k++) {
-        count += summon_named_creature(target_ptr, m_idx, y, x, MON_IE, PM_NONE);
-    }
-
-    return count;
-}
-
-/*!
- * @brief ダンジョンの主召喚の処理。 /
- * @param target_ptr プレーヤーへの参照ポインタ
- * @param y 対象の地点のy座標
- * @param x 対象の地点のx座標
- * @param rlev 呪文を唱えるモンスターのレベル
- * @param m_idx 呪文を唱えるモンスターID
- * @param t_idx 呪文を受けるモンスターID。プレイヤーの場合はdummyで0とする。
- * @param TARGET_TYPE プレイヤーを対象とする場合MONSTER_TO_PLAYER、モンスターを対象とする場合MONSTER_TO_MONSTER
- * @return 召喚したモンスターの数を返す。
- */
-MONSTER_NUMBER summon_guardian(player_type *target_ptr, POSITION y, POSITION x, int rlev, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE)
-{
-    int num = 2 + randint1(3);
-    bool mon_to_mon = (TARGET_TYPE == MONSTER_TO_MONSTER);
-    bool mon_to_player = (TARGET_TYPE == MONSTER_TO_PLAYER);
-
-    if (r_info[MON_JORMUNGAND].cur_num < r_info[MON_JORMUNGAND].max_num && one_in_(6)) {
-        simple_monspell_message(target_ptr, m_idx, t_idx, _("地面から水が吹き出した!", "Water blew off from the ground!"),
-            _("地面から水が吹き出した!", "Water blew off from the ground!"), TARGET_TYPE);
-
-        if (mon_to_player)
-            fire_ball_hide(target_ptr, GF_WATER_FLOW, 0, 3, 8);
-        else if (mon_to_mon)
-            project(target_ptr, t_idx, 8, y, x, 3, GF_WATER_FLOW, PROJECT_GRID | PROJECT_HIDE, -1);
-    }
-
-    int count = 0;
-    for (int k = 0; k < num; k++) {
-        count += summon_specific(target_ptr, m_idx, y, x, rlev, SUMMON_GUARDIANS, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE));
-    }
-
-    return count;
-}
-
-/*!
- * @brief ロックのクローン召喚の処理。 /
- * @param target_ptr プレーヤーへの参照ポインタ
- * @param y 対象の地点のy座標
- * @param x 対象の地点のx座標
- * @param m_idx 呪文を唱えるモンスターID
- * @return 召喚したモンスターの数を返す。
- */
-MONSTER_NUMBER summon_LOCKE_CLONE(player_type *target_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx)
-{
-    int count = 0;
-    int num = randint1(3);
-    for (int k = 0; k < num; k++) {
-        count += summon_named_creature(target_ptr, m_idx, y, x, MON_LOCKE_CLONE, PM_NONE);
-    }
-
-    return count;
-}
-
-/*!
- * @brief シラミ召喚の処理。 /
- * @param target_ptr プレーヤーへの参照ポインタ
- * @param y 対象の地点のy座標
- * @param x 対象の地点のx座標
- * @param rlev 呪文を唱えるモンスターのレベル
- * @param m_idx 呪文を唱えるモンスターID
- * @return 召喚したモンスターの数を返す。
- */
-MONSTER_NUMBER summon_LOUSE(player_type *target_ptr, POSITION y, POSITION x, int rlev, MONSTER_IDX m_idx)
-{
-    int count = 0;
-    int num = 2 + randint1(3);
-    for (int k = 0; k < num; k++) {
-        count += summon_specific(target_ptr, m_idx, y, x, rlev, SUMMON_LOUSE, PM_ALLOW_GROUP);
-    }
-
-    return count;
-}
-
-MONSTER_NUMBER summon_MOAI(player_type* target_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx)
-{
-    int count = 0;
-    int num = 3 + randint1(3);
-    for (int k = 0; k < num; k++)
-        count += summon_named_creature(target_ptr, m_idx, y, x, MON_SMALL_MOAI, PM_NONE);
-
-    return count;
-}
-
-MONSTER_NUMBER summon_DEMON_SLAYER(player_type *target_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx)
-{
-    int count = 0;
-    const int num = 5;
-    for (int k = 0; k < num; k++)
-        count += summon_named_creature(target_ptr, m_idx, y, x, MON_DEMON_SLAYER_MEMBER, PM_NONE);
-
-    return count;
-}
-
-/*!
  * @brief 救援召喚の通常処理。同シンボルのモンスターを召喚する。 /
  * @param target_ptr プレーヤーへの参照ポインタ
  * @param y 対象の地点のy座標
@@ -648,65 +515,6 @@ void spell_RF6_S_DRAGON(player_type *target_ptr, POSITION y, POSITION x, MONSTER
 }
 
 /*!
- * @brief ナズグル戦隊召喚の処理。 /
- * @param target_ptr プレーヤーへの参照ポインタ
- * @param y 対象の地点のy座標
- * @param x 対象の地点のx座標
- * @param m_idx 呪文を唱えるモンスターID
- * @return 召喚したモンスターの数を返す。
- */
-MONSTER_NUMBER summon_NAZGUL(player_type *target_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx)
-{
-    BIT_FLAGS mode = 0L;
-    POSITION cy = y;
-    POSITION cx = x;
-    GAME_TEXT m_name[MAX_NLEN];
-    monster_name(target_ptr, m_idx, m_name);
-
-    if (target_ptr->blind)
-        msg_format(_("%^sが何かをつぶやいた。", "%^s mumbles."), m_name);
-    else
-        msg_format(_("%^sが魔法で幽鬼戦隊を召喚した!", "%^s magically summons rangers of Nazgul!"), m_name);
-
-    msg_print(NULL);
-
-    int count = 0;
-    for (int k = 0; k < 30; k++) {
-        if (!summon_possible(target_ptr, cy, cx) || !is_cave_empty_bold(target_ptr, cy, cx)) {
-            int j;
-            for (j = 100; j > 0; j--) {
-                scatter(target_ptr, &cy, &cx, y, x, 2, 0);
-                if (is_cave_empty_bold(target_ptr, cy, cx))
-                    break;
-            }
-
-            if (!j)
-                break;
-        }
-
-        if (!is_cave_empty_bold(target_ptr, cy, cx))
-            continue;
-
-        if (!summon_named_creature(target_ptr, m_idx, cy, cx, MON_NAZGUL, mode))
-            continue;
-
-        y = cy;
-        x = cx;
-        count++;
-        if (count == 1)
-            msg_format(_("「幽鬼戦隊%d号、ナズグル・ブラック!」", "A Nazgul says 'Nazgul-Rangers Number %d, Nazgul-Black!'"), count);
-        else
-            msg_format(_("「同じく%d号、ナズグル・ブラック!」", "Another one says 'Number %d, Nazgul-Black!'"), count);
-
-        msg_print(NULL);
-    }
-
-    msg_format(_("「%d人そろって、リングレンジャー!」", "They say 'The %d meets! We are the Ring-Ranger!'."), count);
-    msg_print(NULL);
-    return count;
-}
-
-/*!
  * @brief RF6_S_HI_UNDEADの処理。強力なアンデッド召喚。 /
  * @param target_ptr プレーヤーへの参照ポインタ
  * @param y 対象の地点のy座標
index 42ec7bf..54d5e72 100644 (file)
@@ -2,11 +2,6 @@
 
 #include "system/angband.h"
 
-MONSTER_NUMBER summon_EAGLE(player_type* target_ptr, POSITION y, POSITION x, int rlev, MONSTER_IDX m_idx);
-MONSTER_NUMBER summon_IE(player_type* target_ptr, POSITION y, POSITION x, int rlev, MONSTER_IDX m_idx);
-MONSTER_NUMBER summon_guardian(player_type* target_ptr, POSITION y, POSITION x, int rlev, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE);
-MONSTER_NUMBER summon_LOCKE_CLONE(player_type* target_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx);
-MONSTER_NUMBER summon_LOUSE(player_type* target_ptr, POSITION y, POSITION x, int rlev, MONSTER_IDX m_idx);
 MONSTER_NUMBER summon_Kin(player_type* target_ptr, POSITION y, POSITION x, int rlev, MONSTER_IDX m_idx);
 void spell_RF6_S_KIN(player_type* target_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE);
 void spell_RF6_S_CYBER(player_type* target_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE);
@@ -20,7 +15,6 @@ void spell_RF6_S_ANGEL(player_type* target_ptr, POSITION y, POSITION x, MONSTER_
 void spell_RF6_S_DEMON(player_type* target_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE);
 void spell_RF6_S_UNDEAD(player_type* target_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE);
 void spell_RF6_S_DRAGON(player_type* target_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE);
-MONSTER_NUMBER summon_NAZGUL(player_type* target_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx);
 void spell_RF6_S_HI_UNDEAD(player_type* target_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE);
 void spell_RF6_S_HI_DRAGON(player_type* target_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE);
 void spell_RF6_S_AMBERITES(player_type* target_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE);
diff --git a/src/mspell/specified-summon.c b/src/mspell/specified-summon.c
new file mode 100644 (file)
index 0000000..cfed004
--- /dev/null
@@ -0,0 +1,209 @@
+#include "mspell/specified-summon.h"
+#include "effect/effect-characteristics.h"
+#include "floor/cave.h"
+#include "floor/floor.h"
+#include "monster-floor/monster-summon.h"
+#include "monster-floor/place-monster-types.h"
+#include "monster-race/monster-race.h"
+#include "monster-race/race-indice-types.h"
+#include "monster/monster-info.h"
+#include "mspell/mspell-util.h"
+#include "mspell/mspells1.h"
+#include "spell-kind/spells-launcher.h"
+#include "spell/process-effect.h"
+#include "spell/spell-types.h"
+#include "spell/spells-summon.h"
+#include "view/display-messages.h"
+
+/*!
+ * @brief 鷹召喚の処理。 /
+ * @param target_ptr プレーヤーへの参照ポインタ
+ * @param y 対象の地点のy座標
+ * @param x 対象の地点のx座標
+ * @param rlev 呪文を唱えるモンスターのレベル
+ * @param m_idx 呪文を唱えるモンスターID
+ * @return 召喚したモンスターの数を返す。
+ */
+MONSTER_NUMBER summon_EAGLE(player_type *target_ptr, POSITION y, POSITION x, int rlev, MONSTER_IDX m_idx)
+{
+    int count = 0;
+    int num = 4 + randint1(3);
+    for (int k = 0; k < num; k++) {
+        count += summon_specific(target_ptr, m_idx, y, x, rlev, SUMMON_EAGLES, PM_ALLOW_GROUP | PM_ALLOW_UNIQUE);
+    }
+
+    return count;
+}
+
+/*!
+ * @brief インターネット・エクスプローダー召喚の処理。 /
+ * @param target_ptr プレーヤーへの参照ポインタ
+ * @param y 対象の地点のy座標
+ * @param x 対象の地点のx座標
+ * @param rlev 呪文を唱えるモンスターのレベル
+ * @param m_idx 呪文を唱えるモンスターID
+ * @return 召喚したモンスターの数を返す。
+ */
+MONSTER_NUMBER summon_IE(player_type *target_ptr, POSITION y, POSITION x, int rlev, MONSTER_IDX m_idx)
+{
+    int count = 0;
+    int num = 2 + randint1(1 + rlev / 20);
+    for (int k = 0; k < num; k++) {
+        count += summon_named_creature(target_ptr, m_idx, y, x, MON_IE, PM_NONE);
+    }
+
+    return count;
+}
+
+/*!
+ * @brief ダンジョンの主召喚の処理。 /
+ * @param target_ptr プレーヤーへの参照ポインタ
+ * @param y 対象の地点のy座標
+ * @param x 対象の地点のx座標
+ * @param rlev 呪文を唱えるモンスターのレベル
+ * @param m_idx 呪文を唱えるモンスターID
+ * @param t_idx 呪文を受けるモンスターID。プレイヤーの場合はdummyで0とする。
+ * @param TARGET_TYPE プレイヤーを対象とする場合MONSTER_TO_PLAYER、モンスターを対象とする場合MONSTER_TO_MONSTER
+ * @return 召喚したモンスターの数を返す。
+ */
+MONSTER_NUMBER summon_guardian(player_type *target_ptr, POSITION y, POSITION x, int rlev, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE)
+{
+    int num = 2 + randint1(3);
+    bool mon_to_mon = (TARGET_TYPE == MONSTER_TO_MONSTER);
+    bool mon_to_player = (TARGET_TYPE == MONSTER_TO_PLAYER);
+
+    if (r_info[MON_JORMUNGAND].cur_num < r_info[MON_JORMUNGAND].max_num && one_in_(6)) {
+        simple_monspell_message(target_ptr, m_idx, t_idx, _("地面から水が吹き出した!", "Water blew off from the ground!"),
+            _("地面から水が吹き出した!", "Water blew off from the ground!"), TARGET_TYPE);
+
+        if (mon_to_player)
+            fire_ball_hide(target_ptr, GF_WATER_FLOW, 0, 3, 8);
+        else if (mon_to_mon)
+            project(target_ptr, t_idx, 8, y, x, 3, GF_WATER_FLOW, PROJECT_GRID | PROJECT_HIDE, -1);
+    }
+
+    int count = 0;
+    for (int k = 0; k < num; k++) {
+        count += summon_specific(target_ptr, m_idx, y, x, rlev, SUMMON_GUARDIANS, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE));
+    }
+
+    return count;
+}
+
+/*!
+ * @brief ロックのクローン召喚の処理。 /
+ * @param target_ptr プレーヤーへの参照ポインタ
+ * @param y 対象の地点のy座標
+ * @param x 対象の地点のx座標
+ * @param m_idx 呪文を唱えるモンスターID
+ * @return 召喚したモンスターの数を返す。
+ */
+MONSTER_NUMBER summon_LOCKE_CLONE(player_type *target_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx)
+{
+    int count = 0;
+    int num = randint1(3);
+    for (int k = 0; k < num; k++) {
+        count += summon_named_creature(target_ptr, m_idx, y, x, MON_LOCKE_CLONE, PM_NONE);
+    }
+
+    return count;
+}
+
+/*!
+ * @brief シラミ召喚の処理。 /
+ * @param target_ptr プレーヤーへの参照ポインタ
+ * @param y 対象の地点のy座標
+ * @param x 対象の地点のx座標
+ * @param rlev 呪文を唱えるモンスターのレベル
+ * @param m_idx 呪文を唱えるモンスターID
+ * @return 召喚したモンスターの数を返す。
+ */
+MONSTER_NUMBER summon_LOUSE(player_type *target_ptr, POSITION y, POSITION x, int rlev, MONSTER_IDX m_idx)
+{
+    int count = 0;
+    int num = 2 + randint1(3);
+    for (int k = 0; k < num; k++) {
+        count += summon_specific(target_ptr, m_idx, y, x, rlev, SUMMON_LOUSE, PM_ALLOW_GROUP);
+    }
+
+    return count;
+}
+
+MONSTER_NUMBER summon_MOAI(player_type *target_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx)
+{
+    int count = 0;
+    int num = 3 + randint1(3);
+    for (int k = 0; k < num; k++)
+        count += summon_named_creature(target_ptr, m_idx, y, x, MON_SMALL_MOAI, PM_NONE);
+
+    return count;
+}
+
+MONSTER_NUMBER summon_DEMON_SLAYER(player_type *target_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx)
+{
+    int count = 0;
+    const int num = 5;
+    for (int k = 0; k < num; k++)
+        count += summon_named_creature(target_ptr, m_idx, y, x, MON_DEMON_SLAYER_MEMBER, PM_NONE);
+
+    return count;
+}
+
+/*!
+ * @brief ナズグル戦隊召喚の処理。 /
+ * @param target_ptr プレーヤーへの参照ポインタ
+ * @param y 対象の地点のy座標
+ * @param x 対象の地点のx座標
+ * @param m_idx 呪文を唱えるモンスターID
+ * @return 召喚したモンスターの数を返す。
+ */
+MONSTER_NUMBER summon_NAZGUL(player_type *target_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx)
+{
+    BIT_FLAGS mode = 0L;
+    POSITION cy = y;
+    POSITION cx = x;
+    GAME_TEXT m_name[MAX_NLEN];
+    monster_name(target_ptr, m_idx, m_name);
+
+    if (target_ptr->blind)
+        msg_format(_("%^sが何かをつぶやいた。", "%^s mumbles."), m_name);
+    else
+        msg_format(_("%^sが魔法で幽鬼戦隊を召喚した!", "%^s magically summons rangers of Nazgul!"), m_name);
+
+    msg_print(NULL);
+
+    int count = 0;
+    for (int k = 0; k < 30; k++) {
+        if (!summon_possible(target_ptr, cy, cx) || !is_cave_empty_bold(target_ptr, cy, cx)) {
+            int j;
+            for (j = 100; j > 0; j--) {
+                scatter(target_ptr, &cy, &cx, y, x, 2, 0);
+                if (is_cave_empty_bold(target_ptr, cy, cx))
+                    break;
+            }
+
+            if (!j)
+                break;
+        }
+
+        if (!is_cave_empty_bold(target_ptr, cy, cx))
+            continue;
+
+        if (!summon_named_creature(target_ptr, m_idx, cy, cx, MON_NAZGUL, mode))
+            continue;
+
+        y = cy;
+        x = cx;
+        count++;
+        if (count == 1)
+            msg_format(_("「幽鬼戦隊%d号、ナズグル・ブラック!」", "A Nazgul says 'Nazgul-Rangers Number %d, Nazgul-Black!'"), count);
+        else
+            msg_format(_("「同じく%d号、ナズグル・ブラック!」", "Another one says 'Number %d, Nazgul-Black!'"), count);
+
+        msg_print(NULL);
+    }
+
+    msg_format(_("「%d人そろって、リングレンジャー!」", "They say 'The %d meets! We are the Ring-Ranger!'."), count);
+    msg_print(NULL);
+    return count;
+}
diff --git a/src/mspell/specified-summon.h b/src/mspell/specified-summon.h
new file mode 100644 (file)
index 0000000..3c260c4
--- /dev/null
@@ -0,0 +1,12 @@
+#pragma once
+
+#include "system/angband.h"
+
+MONSTER_NUMBER summon_EAGLE(player_type *target_ptr, POSITION y, POSITION x, int rlev, MONSTER_IDX m_idx);
+MONSTER_NUMBER summon_IE(player_type *target_ptr, POSITION y, POSITION x, int rlev, MONSTER_IDX m_idx);
+MONSTER_NUMBER summon_guardian(player_type *target_ptr, POSITION y, POSITION x, int rlev, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE);
+MONSTER_NUMBER summon_LOCKE_CLONE(player_type *target_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx);
+MONSTER_NUMBER summon_LOUSE(player_type *target_ptr, POSITION y, POSITION x, int rlev, MONSTER_IDX m_idx);
+MONSTER_NUMBER summon_MOAI(player_type *target_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx);
+MONSTER_NUMBER summon_DEMON_SLAYER(player_type *target_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx);
+MONSTER_NUMBER summon_NAZGUL(player_type *target_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx);
index bec762a..ff7e65a 100644 (file)
@@ -16,6 +16,7 @@
 #include "dungeon/dungeon.h"
 #include "dungeon/quest.h"
 #include "effect/effect-characteristics.h"
+#include "floor/cave.h"
 #include "floor/floor.h"
 #include "game-option/disturbance-options.h"
 #include "grid/feature.h"
index 45b067b..24d5e92 100644 (file)
@@ -2,6 +2,7 @@
 #include "cmd-action/cmd-spell.h"
 #include "core/hp-mp-processor.h"
 #include "effect/effect-characteristics.h"
+#include "floor/cave.h"
 #include "floor/floor.h"
 #include "io/targeting.h"
 #include "monster-floor/monster-summon.h"
index c1ab8fe..351d431 100644 (file)
@@ -24,7 +24,7 @@
 #include "flavor/flavor-describer.h"
 #include "flavor/object-flavor-types.h"
 #include "floor/floor-object.h"
-#include "floor/floor.h"
+#include "floor/cave.h"
 #include "grid/grid.h"
 #include "inventory/inventory-slot-types.h"
 #include "io/input-key-requester.h"
index 867a1c4..9e94659 100644 (file)
@@ -1,6 +1,6 @@
 #include "specific-object/chest.h"
+#include "floor/cave.h"
 #include "floor/floor-object.h"
-#include "floor/floor.h"
 #include "grid/grid.h"
 #include "grid/trap.h"
 #include "main/sound-definitions-table.h"
index 7661018..afd2d46 100644 (file)
@@ -1,7 +1,7 @@
 #include "window/main-window-util.h"
 #include "flavor/flavor-describer.h"
 #include "flavor/object-flavor-types.h"
-#include "floor/floor.h"
+#include "floor/cave.h"
 #include "floor/geometry.h"
 #include "game-option/map-screen-options.h"
 #include "game-option/special-options.h"
index 2e4c3fc..5fb7c1c 100644 (file)
@@ -7,6 +7,7 @@
 #include "wizard/wizard-spells.h"
 #include "blue-magic/blue-magic-checker.h"
 #include "core/asking-player.h"
+#include "floor/cave.h"
 #include "floor/floor.h"
 #include "io/targeting.h"
 #include "monster-floor/monster-generator.h"