OSDN Git Service

[Refactor] #37353 盲目時のコマンド制限処理を cmd_limit_confused() に統合。 / Integrate command limitat...
[hengband/hengband.git] / src / spells-summon.c
index 9a9fb93..64549e6 100644 (file)
@@ -1,4 +1,5 @@
 #include "angband.h"\r
+#include "spells-summon.h"\r
 \r
 /*!\r
 * @brief トランプ魔法独自の召喚処理を行う / Handle summoning and failure of trump spells\r
@@ -270,3 +271,34 @@ bool summon_kin_player(DEPTH level, POSITION y, POSITION x, BIT_FLAGS mode)
        }\r
        return summon_specific((pet ? -1 : 0), y, x, level, SUMMON_KIN, mode, symbol);\r
 }\r
+\r
+/*!\r
+ * @brief サイバーデーモンの召喚\r
+ * @param who 召喚主のモンスターID(0ならばプレイヤー)\r
+ * @param y 召喚位置Y座標\r
+ * @param x 召喚位置X座標\r
+ * @return 作用が実際にあった場合TRUEを返す\r
+ */\r
+int summon_cyber(MONSTER_IDX who, POSITION y, POSITION x)\r
+{\r
+       int i;\r
+       int max_cyber = (easy_band ? 1 : (dun_level / 50) + randint1(2));\r
+       int count = 0;\r
+       BIT_FLAGS mode = PM_ALLOW_GROUP;\r
+\r
+       /* Summoned by a monster */\r
+       if (who > 0)\r
+       {\r
+               monster_type *m_ptr = &m_list[who];\r
+               if (is_pet(m_ptr)) mode |= PM_FORCE_PET;\r
+       }\r
+\r
+       if (max_cyber > 4) max_cyber = 4;\r
+\r
+       for (i = 0; i < max_cyber; i++)\r
+       {\r
+               count += summon_specific(who, y, x, 100, SUMMON_CYBER, mode, '\0');\r
+       }\r
+\r
+       return count;\r
+}
\ No newline at end of file