From 21db8abd402fdd79148f4b5b838daab30748c7a2 Mon Sep 17 00:00:00 2001 From: deskull Date: Tue, 21 May 2019 22:03:58 +0900 Subject: [PATCH] =?utf8?q?[Refactor]=20#37353=E3=80=80=E6=AD=8C=E3=81=AB?= =?utf8?q?=E9=96=A2=E3=81=99=E3=82=8B=E3=83=9E=E3=82=AF=E3=83=AD=E5=AE=9A?= =?utf8?q?=E7=BE=A9=E3=82=92=20realm-song.h=20=E3=81=B8=E7=A7=BB=E5=8B=95?= =?utf8?q?=EF=BC=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/chest.c | 1 + src/cmd-activate.c | 1 + src/cmd-basic.c | 1 + src/cmd-eat.c | 1 + src/cmd-quaff.c | 1 + src/cmd-read.c | 1 + src/core.c | 1 + src/defines.h | 37 ------------------------------------- src/files.c | 1 + src/grid.c | 1 + src/load.c | 1 + src/melee1.c | 1 + src/mind.c | 1 + src/monster2.c | 1 + src/mspells1.c | 1 + src/player-damage.c | 1 + src/player-effects.c | 1 + src/player-move.c | 1 + src/player-status.c | 1 + src/racial.c | 1 + src/realm-hex.c | 1 + src/realm-song.c | 2 ++ src/realm-song.h | 40 +++++++++++++++++++++++++++++++++++++++- src/selfinfo.c | 1 + src/spells-status.c | 1 + src/spells1.c | 1 + src/spells2.c | 1 + src/trap.c | 1 + src/view-mainwindow.c | 1 + src/warning.c | 1 + 30 files changed, 68 insertions(+), 38 deletions(-) diff --git a/src/chest.c b/src/chest.c index 127587dca..4e8d5f5b9 100644 --- a/src/chest.c +++ b/src/chest.c @@ -9,6 +9,7 @@ #include "player-status.h" #include "player-effects.h" #include "grid.h" +#include "realm-song.h" /*! * @brief 箱からアイテムを引き出す / diff --git a/src/cmd-activate.c b/src/cmd-activate.c index 79c36f12f..dd2f0be15 100644 --- a/src/cmd-activate.c +++ b/src/cmd-activate.c @@ -30,6 +30,7 @@ #include "object-ego.h" #include "grid.h" #include "targeting.h" +#include "realm-song.h" /*! * @brief 装備耐性に準じたブレス効果の選択テーブル / diff --git a/src/cmd-basic.c b/src/cmd-basic.c index 113dd132c..48abec371 100644 --- a/src/cmd-basic.c +++ b/src/cmd-basic.c @@ -33,6 +33,7 @@ #include "avatar.h" #include "player-status.h" #include "realm-hex.h" +#include "realm-song.h" #include "geometry.h" #include "wild.h" #include "grid.h" diff --git a/src/cmd-eat.c b/src/cmd-eat.c index c9be840ec..c3ccfa26b 100644 --- a/src/cmd-eat.c +++ b/src/cmd-eat.c @@ -20,6 +20,7 @@ #include "player-race.h" #include "floor.h" #include "objectkind.h" +#include "realm-song.h" /*! * @brief 食料を食べるコマンドのサブルーチン diff --git a/src/cmd-quaff.c b/src/cmd-quaff.c index a2cf1b432..c398785ff 100644 --- a/src/cmd-quaff.c +++ b/src/cmd-quaff.c @@ -20,6 +20,7 @@ #include "player-effects.h" #include "player-race.h" #include "realm-hex.h" +#include "realm-song.h" #include "spells-floor.h" #include "object-broken.h" #include "cmd-basic.h" diff --git a/src/cmd-read.c b/src/cmd-read.c index c77c3f47e..db9c44100 100644 --- a/src/cmd-read.c +++ b/src/cmd-read.c @@ -28,6 +28,7 @@ #include "files.h" #include "floor.h" #include "objectkind.h" +#include "realm-song.h" /*! * @brief 巻物を読むコマンドのサブルーチン diff --git a/src/core.c b/src/core.c index a6d66588f..701616437 100644 --- a/src/core.c +++ b/src/core.c @@ -81,6 +81,7 @@ #include "autopick.h" #include "save.h" #include "realm.h" +#include "realm-song.h" #include "targeting.h" /*! diff --git a/src/defines.h b/src/defines.h index 5965b1b63..fa1b2a4b0 100644 --- a/src/defines.h +++ b/src/defines.h @@ -2627,43 +2627,6 @@ extern int PlayerUID; #define KNOW_HPRATE 0x02 /* - * Music songs - */ -#define MUSIC_NONE 0 -#define MUSIC_SLOW 1 -#define MUSIC_BLESS 2 -#define MUSIC_STUN 3 -#define MUSIC_L_LIFE 4 -#define MUSIC_FEAR 5 -#define MUSIC_HERO 6 -#define MUSIC_MIND 7 -#define MUSIC_STEALTH 8 -#define MUSIC_ID 9 -#define MUSIC_CONF 10 -#define MUSIC_SOUND 11 -#define MUSIC_CHARM 12 -#define MUSIC_WALL 13 -#define MUSIC_RESIST 14 -#define MUSIC_SPEED 15 -#define MUSIC_DISPEL 16 -#define MUSIC_SARUMAN 17 -#define MUSIC_QUAKE 18 -#define MUSIC_STASIS 19 -#define MUSIC_SHERO 20 -#define MUSIC_H_LIFE 21 -#define MUSIC_INVULN 22 -#define MUSIC_PSI 23 - -#define MUSIC_DETECT 101 - -#define SINGING_SONG_EFFECT(P_PTR) ((P_PTR)->magic_num1[0]) -#define INTERUPTING_SONG_EFFECT(P_PTR) ((P_PTR)->magic_num1[1]) -#define SINGING_COUNT(P_PTR) ((P_PTR)->magic_num1[2]) -#define SINGING_SONG_ID(P_PTR) ((P_PTR)->magic_num2[0]) -#define music_singing(X) ((p_ptr->pclass == CLASS_BARD) && (p_ptr->magic_num1[0] == (X))) -#define music_singing_any() ((p_ptr->pclass == CLASS_BARD) && p_ptr->magic_num1[0]) - -/* * Special essence id for Weapon smith */ #define MIN_SPECIAL_ESSENCE 200 diff --git a/src/files.c b/src/files.c index c65417e16..405fecd45 100644 --- a/src/files.c +++ b/src/files.c @@ -63,6 +63,7 @@ #include "objectkind.h" #include "autopick.h" #include "save.h" +#include "realm-song.h" concptr ANGBAND_DIR; //!< Path name: The main "lib" directory This variable is not actually used anywhere in the code concptr ANGBAND_DIR_APEX; //!< High score files (binary) These files may be portable between platforms diff --git a/src/grid.c b/src/grid.c index 068a9d02f..0a86a8c64 100644 --- a/src/grid.c +++ b/src/grid.c @@ -38,6 +38,7 @@ #include "player-effects.h" #include "spells.h" #include "view-mainwindow.h" +#include "realm-song.h" /*! diff --git a/src/load.c b/src/load.c index 8c8aec084..493648c97 100644 --- a/src/load.c +++ b/src/load.c @@ -82,6 +82,7 @@ #include "object-ego.h" #include "save.h" #include "japanese.h" +#include "realm-song.h" /* * Maximum number of tries for selection of a proper quest monster diff --git a/src/melee1.c b/src/melee1.c index ba8a10bc5..5e34b04a4 100644 --- a/src/melee1.c +++ b/src/melee1.c @@ -24,6 +24,7 @@ #include "monster-spell.h" #include "avatar.h" #include "realm-hex.h" +#include "realm-song.h" #include "object-flavor.h" #include "object-hook.h" #include "grid.h" diff --git a/src/mind.c b/src/mind.c index c539db420..a235aaa9f 100644 --- a/src/mind.c +++ b/src/mind.c @@ -38,6 +38,7 @@ #include "player-effects.h" #include "view-mainwindow.h" #include "targeting.h" +#include "realm-song.h" /*! 特殊技能の一覧テーブル */ mind_power const mind_powers[5] = diff --git a/src/monster2.c b/src/monster2.c index 154c32d5e..ffc1595f3 100644 --- a/src/monster2.c +++ b/src/monster2.c @@ -37,6 +37,7 @@ #include "monsterrace.h" #include "creature.h" #include "targeting.h" +#include "realm-song.h" #define HORDE_NOGOOD 0x01 /*!< (未実装フラグ)HORDE生成でGOODなモンスターの生成を禁止する? */ #define HORDE_NOEVIL 0x02 /*!< (未実装フラグ)HORDE生成でEVILなモンスターの生成を禁止する? */ diff --git a/src/mspells1.c b/src/mspells1.c index 1ba87f431..c36f59dae 100644 --- a/src/mspells1.c +++ b/src/mspells1.c @@ -53,6 +53,7 @@ #include "monster-spell.h" #include "spells.h" #include "world.h" +#include "realm-song.h" /*! diff --git a/src/player-damage.c b/src/player-damage.c index 80af314c7..dc170a0c8 100644 --- a/src/player-damage.c +++ b/src/player-damage.c @@ -1,6 +1,7 @@ #include "angband.h" #include "util.h" +#include "realm-song.h" #include "player-damage.h" #include "artifact.h" #include "object-flavor.h" diff --git a/src/player-effects.c b/src/player-effects.c index 6798b7cee..283a5d0ed 100644 --- a/src/player-effects.c +++ b/src/player-effects.c @@ -29,6 +29,7 @@ #include "quest.h" #include "avatar.h" #include "spells-status.h" +#include "realm-song.h" #include "realm-hex.h" #include "object-ego.h" #include "object-hook.h" diff --git a/src/player-move.c b/src/player-move.c index fd555e15d..22321e7dd 100644 --- a/src/player-move.c +++ b/src/player-move.c @@ -143,6 +143,7 @@ #include "core.h" #include "util.h" +#include "realm-song.h" #include "autopick.h" #include "dungeon.h" #include "floor.h" diff --git a/src/player-status.c b/src/player-status.c index edd358d5b..809ac9151 100644 --- a/src/player-status.c +++ b/src/player-status.c @@ -25,6 +25,7 @@ #include "mutation.h" #include "patron.h" #include "realm-hex.h" +#include "realm-song.h" #include "cmd-pet.h" #include "cmd-spell.h" #include "dungeon.h" diff --git a/src/racial.c b/src/racial.c index e7e384c54..afacb6cd7 100644 --- a/src/racial.c +++ b/src/racial.c @@ -21,6 +21,7 @@ #include "cmd-pet.h" #include "melee.h" #include "object-hook.h" +#include "realm-song.h" #include "mutation.h" #include "player-effects.h" diff --git a/src/realm-hex.c b/src/realm-hex.c index 23afa7dd1..3d96f6d62 100644 --- a/src/realm-hex.c +++ b/src/realm-hex.c @@ -33,6 +33,7 @@ #include "grid.h" #include "monsterrace.h" #include "targeting.h" +#include "realm-song.h" #define MAX_KEEP 4 /*!<呪術の最大詠唱数 */ diff --git a/src/realm-song.c b/src/realm-song.c index 706d1f7ed..1138bed8b 100644 --- a/src/realm-song.c +++ b/src/realm-song.c @@ -1,6 +1,8 @@ #include "angband.h" #include "util.h" +#include "realm-song.h" + #include "cmd-spell.h" #include "spells.h" #include "spells-status.h" diff --git a/src/realm-song.h b/src/realm-song.h index 7642078f1..0a486f398 100644 --- a/src/realm-song.h +++ b/src/realm-song.h @@ -1 +1,39 @@ -extern concptr do_music_spell(SPELL_IDX spell, BIT_FLAGS mode); + +/* + * Music songs + */ +#define MUSIC_NONE 0 +#define MUSIC_SLOW 1 +#define MUSIC_BLESS 2 +#define MUSIC_STUN 3 +#define MUSIC_L_LIFE 4 +#define MUSIC_FEAR 5 +#define MUSIC_HERO 6 +#define MUSIC_MIND 7 +#define MUSIC_STEALTH 8 +#define MUSIC_ID 9 +#define MUSIC_CONF 10 +#define MUSIC_SOUND 11 +#define MUSIC_CHARM 12 +#define MUSIC_WALL 13 +#define MUSIC_RESIST 14 +#define MUSIC_SPEED 15 +#define MUSIC_DISPEL 16 +#define MUSIC_SARUMAN 17 +#define MUSIC_QUAKE 18 +#define MUSIC_STASIS 19 +#define MUSIC_SHERO 20 +#define MUSIC_H_LIFE 21 +#define MUSIC_INVULN 22 +#define MUSIC_PSI 23 + +#define MUSIC_DETECT 101 + +#define SINGING_SONG_EFFECT(P_PTR) ((P_PTR)->magic_num1[0]) +#define INTERUPTING_SONG_EFFECT(P_PTR) ((P_PTR)->magic_num1[1]) +#define SINGING_COUNT(P_PTR) ((P_PTR)->magic_num1[2]) +#define SINGING_SONG_ID(P_PTR) ((P_PTR)->magic_num2[0]) +#define music_singing(X) ((p_ptr->pclass == CLASS_BARD) && (p_ptr->magic_num1[0] == (X))) +#define music_singing_any() ((p_ptr->pclass == CLASS_BARD) && p_ptr->magic_num1[0]) + +extern concptr do_music_spell(SPELL_IDX spell, BIT_FLAGS mode); diff --git a/src/selfinfo.c b/src/selfinfo.c index 91341ac2c..bd343ea5f 100644 --- a/src/selfinfo.c +++ b/src/selfinfo.c @@ -20,6 +20,7 @@ #include "player-status.h" #include "avatar.h" #include "realm-hex.h" +#include "realm-song.h" /*! * @brief 自己分析処理(Nethackからのアイデア) / self-knowledge... idea from nethack. diff --git a/src/spells-status.c b/src/spells-status.c index ed33fa462..18f978a6d 100644 --- a/src/spells-status.c +++ b/src/spells-status.c @@ -13,6 +13,7 @@ #include "player-effects.h" #include "objectkind.h" #include "targeting.h" +#include "realm-song.h" /*! * @brief モンスター回復処理 diff --git a/src/spells1.c b/src/spells1.c index 1742fb0fa..2710c48d6 100644 --- a/src/spells1.c +++ b/src/spells1.c @@ -43,6 +43,7 @@ #include "player-status.h" #include "player-move.h" #include "realm-hex.h" +#include "realm-song.h" #include "object-hook.h" #include "object-broken.h" #include "object-flavor.h" diff --git a/src/spells2.c b/src/spells2.c index 36c07c470..0146c2ae7 100644 --- a/src/spells2.c +++ b/src/spells2.c @@ -51,6 +51,7 @@ #include "objectkind.h" #include "monsterrace.h" #include "targeting.h" +#include "realm-song.h" /*! * @brief プレイヤー周辺の地形を感知する diff --git a/src/trap.c b/src/trap.c index 75af61693..8a87ca21f 100644 --- a/src/trap.c +++ b/src/trap.c @@ -19,6 +19,7 @@ #include "files.h" #include "dungeon.h" #include "world.h" +#include "realm-song.h" static s16b normal_traps[MAX_NORMAL_TRAPS]; diff --git a/src/view-mainwindow.c b/src/view-mainwindow.c index 1f1fc98b2..2e8608b37 100644 --- a/src/view-mainwindow.c +++ b/src/view-mainwindow.c @@ -30,6 +30,7 @@ #include "spells.h" #include "realm-hex.h" +#include "realm-song.h" #include "object-flavor.h" diff --git a/src/warning.c b/src/warning.c index 606066bb4..55c115992 100644 --- a/src/warning.c +++ b/src/warning.c @@ -16,6 +16,7 @@ #include "dungeon.h" #include "player-race.h" #include "melee.h" +#include "realm-song.h" /*! * @brief 警告を放つアイテムを選択する / -- 2.11.0