OSDN Git Service

[Refactor] #37353 exe_spell() を spells1.c/spells.h へ移動. / Move exe_spell() to spells1...
authordeskull <deskull@users.sourceforge.jp>
Tue, 11 Feb 2020 06:06:05 +0000 (15:06 +0900)
committerdeskull <deskull@users.sourceforge.jp>
Tue, 11 Feb 2020 06:06:05 +0000 (15:06 +0900)
src/cmd/cmd-spell.c
src/cmd/cmd-spell.h
src/spells.h
src/spells1.c

index ada2203..5a88587 100644 (file)
 #include "selfinfo.h"
 #include "spells.h"
 #include "spells-summon.h"
-#include "realm.h"
-#include "realm-arcane.h"
-#include "realm-chaos.h"
-#include "realm-craft.h"
-#include "realm-crusade.h"
-#include "realm-daemon.h"
-#include "realm-death.h"
 #include "realm-hex.h"
-#include "realm-hissatsu.h"
-#include "realm-life.h"
-#include "realm-nature.h"
-#include "realm-song.h"
-#include "realm-sorcery.h"
-#include "realm-trump.h"
 #include "mind.h"
 #include "avatar.h"
 #include "player-damage.h"
@@ -265,37 +252,6 @@ static bool spell_okay(player_type *caster_ptr, int spell, bool learned, bool st
        return (!learned);
 }
 
-
-/*!
- * @brief 魔法処理のメインルーチン
- * @param realm 魔法領域のID
- * @param spell 各領域の魔法ID
- * @param mode 求める処理
- * @return 各領域魔法に各種テキストを求めた場合は文字列参照ポインタ、そうでない場合はNULLポインタを返す。
- */
-concptr exe_spell(player_type *caster_ptr, REALM_IDX realm, SPELL_IDX spell, BIT_FLAGS mode)
-{
-       switch (realm)
-       {
-       case REALM_LIFE:     return do_life_spell(caster_ptr, spell, mode);
-       case REALM_SORCERY:  return do_sorcery_spell(caster_ptr, spell, mode);
-       case REALM_NATURE:   return do_nature_spell(caster_ptr, spell, mode);
-       case REALM_CHAOS:    return do_chaos_spell(caster_ptr, spell, mode);
-       case REALM_DEATH:    return do_death_spell(caster_ptr, spell, mode);
-       case REALM_TRUMP:    return do_trump_spell(caster_ptr, spell, mode);
-       case REALM_ARCANE:   return do_arcane_spell(caster_ptr, spell, mode);
-       case REALM_CRAFT:    return do_craft_spell(caster_ptr, spell, mode);
-       case REALM_DAEMON:   return do_daemon_spell(caster_ptr, spell, mode);
-       case REALM_CRUSADE:  return do_crusade_spell(caster_ptr, spell, mode);
-       case REALM_MUSIC:    return do_music_spell(caster_ptr, spell, mode);
-       case REALM_HISSATSU: return do_hissatsu_spell(caster_ptr, spell, mode);
-       case REALM_HEX:      return do_hex_spell(caster_ptr, spell, mode);
-       }
-
-       return NULL;
-}
-
-
 /*!
  * @brief 領域魔法の閲覧、学習、使用選択するインターフェイス処理
  * Allow user to choose a spell/prayer from the given book.
index 80a39af..de991fd 100644 (file)
@@ -9,16 +9,6 @@
 
 extern const u32b fake_spell_flags[4];
 
-
-#define SPELL_NAME   0
-#define SPELL_DESC   1
-#define SPELL_INFO   2
-#define SPELL_CAST   3
-#define SPELL_FAIL   4
-#define SPELL_STOP   5
-#define SPELL_CONT   6
-extern concptr exe_spell(player_type *caster_ptr, REALM_IDX realm, SPELL_IDX spell, BIT_FLAGS mode);
-
 extern concptr info_string_dice(concptr str, DICE_NUMBER dice, DICE_SID sides, int base);
 extern concptr info_damage(DICE_NUMBER dice, DICE_SID sides, int base);
 extern concptr info_duration(int base, DICE_SID sides);
index c30176a..245b3ec 100644 (file)
@@ -1,6 +1,15 @@
 #pragma once
 #include "realm.h"
 
+#define SPELL_NAME   0
+#define SPELL_DESC   1
+#define SPELL_INFO   2
+#define SPELL_CAST   3
+#define SPELL_FAIL   4
+#define SPELL_STOP   5
+#define SPELL_CONT   6
+extern concptr exe_spell(player_type *caster_ptr, REALM_IDX realm, SPELL_IDX spell, BIT_FLAGS mode);
+
 #define DETECT_RAD_DEFAULT 30
 #define DETECT_RAD_MAP     30
 #define DETECT_RAD_ALL     255
index ef346a8..b9a59ad 100644 (file)
 #include "view-mainwindow.h"
 #include "dungeon.h"
 
+#include "realm.h"
+#include "realm-arcane.h"
+#include "realm-chaos.h"
+#include "realm-craft.h"
+#include "realm-crusade.h"
+#include "realm-daemon.h"
+#include "realm-death.h"
+#include "realm-hex.h"
+#include "realm-hissatsu.h"
+#include "realm-life.h"
+#include "realm-nature.h"
+#include "realm-song.h"
+#include "realm-sorcery.h"
+#include "realm-trump.h"
+
 
 static int rakubadam_m; /*!< 振り落とされた際のダメージ量 */
 static int rakubadam_p; /*!< 落馬した際のダメージ量 */
@@ -192,6 +207,34 @@ const magic_type technic_info[NUM_TECHNIC][32] =
 };
 
 
+/*!
+ * @brief 魔法処理のメインルーチン
+ * @param realm 魔法領域のID
+ * @param spell 各領域の魔法ID
+ * @param mode 求める処理
+ * @return 各領域魔法に各種テキストを求めた場合は文字列参照ポインタ、そうでない場合はNULLポインタを返す。
+ */
+concptr exe_spell(player_type *caster_ptr, REALM_IDX realm, SPELL_IDX spell, BIT_FLAGS mode)
+{
+       switch (realm)
+       {
+       case REALM_LIFE:     return do_life_spell(caster_ptr, spell, mode);
+       case REALM_SORCERY:  return do_sorcery_spell(caster_ptr, spell, mode);
+       case REALM_NATURE:   return do_nature_spell(caster_ptr, spell, mode);
+       case REALM_CHAOS:    return do_chaos_spell(caster_ptr, spell, mode);
+       case REALM_DEATH:    return do_death_spell(caster_ptr, spell, mode);
+       case REALM_TRUMP:    return do_trump_spell(caster_ptr, spell, mode);
+       case REALM_ARCANE:   return do_arcane_spell(caster_ptr, spell, mode);
+       case REALM_CRAFT:    return do_craft_spell(caster_ptr, spell, mode);
+       case REALM_DAEMON:   return do_daemon_spell(caster_ptr, spell, mode);
+       case REALM_CRUSADE:  return do_crusade_spell(caster_ptr, spell, mode);
+       case REALM_MUSIC:    return do_music_spell(caster_ptr, spell, mode);
+       case REALM_HISSATSU: return do_hissatsu_spell(caster_ptr, spell, mode);
+       case REALM_HEX:      return do_hex_spell(caster_ptr, spell, mode);
+       }
+
+       return NULL;
+}
 
 /*!
  * @brief 配置した鏡リストの次を取得する /