From b799371f064b0e938bb06ac9094d3bc919a6f915 Mon Sep 17 00:00:00 2001 From: Hourier Date: Wed, 6 May 2020 19:41:15 +0900 Subject: [PATCH] [Refactor] #39963 Separated effect-characteristics.h from floor.h --- Hengband/Hengband/Hengband.vcxproj | 1 + Hengband/Hengband/Hengband.vcxproj.filters | 3 +++ src/Makefile.am | 1 + src/cmd/cmd-activate.c | 1 + src/combat/melee.c | 2 +- src/combat/shoot.c | 2 +- src/effect/effect-characteristics.h | 23 +++++++++++++++++++++++ src/effect/effect-feature.c | 1 + src/effect/effect-monster.c | 1 + src/effect/effect-player.c | 1 + src/floor.c | 1 + src/floor.h | 19 ------------------- src/grid.c | 1 + src/mind.c | 2 +- src/monster/monster-move.c | 1 + src/monster1.c | 2 +- src/monster2.c | 2 +- src/mspells1.c | 2 +- src/mspells2.c | 2 +- src/mspells4.c | 2 +- src/object-broken.c | 1 + src/player-move.c | 2 +- src/realm/realm-chaos.c | 1 + src/realm/realm-crusade.c | 2 +- src/realm/realm-death.c | 1 + src/realm/realm-hex.c | 2 +- src/realm/realm-hissatsu.c | 2 +- src/realm/realm-nature.c | 1 + src/realm/realm-song.c | 1 + src/spell/process-effect.c | 1 + src/spells-status.c | 2 +- src/spells1.c | 1 + src/spells2.c | 2 +- src/spells3.c | 2 +- src/trap.c | 2 +- src/view/display-main-window.c | 2 +- 36 files changed, 59 insertions(+), 36 deletions(-) create mode 100644 src/effect/effect-characteristics.h diff --git a/Hengband/Hengband/Hengband.vcxproj b/Hengband/Hengband/Hengband.vcxproj index 806e5e9ae..53b1e674d 100644 --- a/Hengband/Hengband/Hengband.vcxproj +++ b/Hengband/Hengband/Hengband.vcxproj @@ -362,6 +362,7 @@ + diff --git a/Hengband/Hengband/Hengband.vcxproj.filters b/Hengband/Hengband/Hengband.vcxproj.filters index 48ca90a79..8381d9cf8 100644 --- a/Hengband/Hengband/Hengband.vcxproj.filters +++ b/Hengband/Hengband/Hengband.vcxproj.filters @@ -1532,6 +1532,9 @@ spell + + effect + diff --git a/src/Makefile.am b/src/Makefile.am index b512d771b..10e05bb39 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -186,6 +186,7 @@ hengband_SOURCES = \ effect/effect-player-curse.c effect/effect-player-curse.h \ effect/effect-player-spirit.c effect/effect-player-spirit.h \ effect/effect-player-switcher.c effect/effect-player-switcher.h \ + effect/effect-characteristics.h \ \ spell/technic-info-table.c spell/technic-info-table.h \ spell/spells-execution.c spell/spells-execution.h \ diff --git a/src/cmd/cmd-activate.c b/src/cmd/cmd-activate.c index b2586c3c1..d1f22f552 100644 --- a/src/cmd/cmd-activate.c +++ b/src/cmd/cmd-activate.c @@ -33,6 +33,7 @@ #include "effect/spells-effect-util.h" #include "spell/spells-type.h" #include "spell/process-effect.h" +#include "effect/effect-characteristics.h" /*! * @brief 装備耐性に準じたブレス効果の選択テーブル / diff --git a/src/combat/melee.c b/src/combat/melee.c index a72d5b0bb..93cb2835a 100644 --- a/src/combat/melee.c +++ b/src/combat/melee.c @@ -30,7 +30,7 @@ #include "object-hook.h" #include "grid.h" #include "dungeon.h" -#include "floor.h" +#include "effect/effect-characteristics.h" #include "dungeon.h" #include "spell/process-effect.h" #include "spell/spells-type.h" diff --git a/src/combat/shoot.c b/src/combat/shoot.c index 5d17df2ca..f4bf005a6 100644 --- a/src/combat/shoot.c +++ b/src/combat/shoot.c @@ -15,7 +15,7 @@ #include "player-personality.h" #include "object-hook.h" #include "object-broken.h" -#include "floor.h" +#include "effect/effect-characteristics.h" #include "grid.h" #include "object-flavor.h" diff --git a/src/effect/effect-characteristics.h b/src/effect/effect-characteristics.h new file mode 100644 index 000000000..777f54baa --- /dev/null +++ b/src/effect/effect-characteristics.h @@ -0,0 +1,23 @@ +#pragma once + +/* + * project()関数に用いられる、遠隔攻撃特性ビットフラグ / Bit flags for the "project()" function + */ +typedef enum effect_characteristics { + PROJECT_JUMP = 0x0001, /*!< 発動者からの軌跡を持たず、指定地点に直接発生する(予め置いたトラップ、上空からの発生などのイメージ) / Jump directly to the target location (this is a hack) */ + PROJECT_BEAM = 0x0002, /*!< ビーム範囲を持つ。 / Work as a beam weapon (affect every grid passed through) */ + PROJECT_THRU = 0x0004, /*!< 目標地点に到達しても射程と遮蔽の限り引き延ばす。 / Continue "through" the target (used for "bolts"/"beams") */ + PROJECT_STOP = 0x0008, /*!< 道中にプレイヤーかモンスターがいた時点で到達地点を更新して停止する(壁や森はPROJECT_DISIがない限り最初から貫通しない) */ + PROJECT_GRID = 0x0010, /*!< 射程内の地形に影響を及ぼす / Affect each grid in the "blast area" in some way */ + PROJECT_ITEM = 0x0020, /*!< 射程内のアイテムに影響を及ぼす / Affect each object in the "blast area" in some way */ + PROJECT_KILL = 0x0040, /*!< 射程内のモンスターに影響を及ぼす / Affect each monster in the "blast area" in some way */ + PROJECT_HIDE = 0x0080, /*!< 画面上にフィードバック表示させない / Disable "visual" feedback from projection */ + PROJECT_DISI = 0x0100, /*!< 永久壁でない壁を破壊する / Disintegrate non-permanent features */ + PROJECT_PLAYER = 0x0200, /*!< プレーヤー自身をターゲットにする (騎乗中) / Main target is player (used for riding player) */ + PROJECT_AIMED = 0x0400, /*!< / Target is only player or monster, so don't affect another. Depend on PROJECT_PLAYER. (used for minimum (rad == 0) balls on riding player) */ + PROJECT_REFLECTABLE = 0x0800, /*!< 反射可能(ボルト系魔法に利用) / Refrectable spell attacks (used for "bolts") */ + PROJECT_NO_HANGEKI = 0x1000, /*!< 反撃させない / Avoid counter attacks of monsters */ + PROJECT_PATH = 0x2000, /*!< 軌跡の表示 / Only used for printing project path */ + PROJECT_FAST = 0x4000, /*!< 炸裂するまで画面上に表示しない / Hide "visual" of flying bolts until blast */ + PROJECT_LOS = 0x8000 /*!< 視線が通っているか(?) / Line of sight */ +} effect_characteristics; diff --git a/src/effect/effect-feature.c b/src/effect/effect-feature.c index 4f65271b3..f1d30ab31 100644 --- a/src/effect/effect-feature.c +++ b/src/effect/effect-feature.c @@ -8,6 +8,7 @@ #include "world.h" #include "spell/spells-type.h" #include "spell/process-effect.h" // 暫定、後で消す. +#include "effect/effect-characteristics.h" /*! * @brief 汎用的なビーム/ボルト/ボール系による地形効果処理 / We are called from "project()" to "damage" terrain features diff --git a/src/effect/effect-monster.c b/src/effect/effect-monster.c index f3b4920cb..01f242a24 100644 --- a/src/effect/effect-monster.c +++ b/src/effect/effect-monster.c @@ -16,6 +16,7 @@ #include "monster-status.h" #include "avatar.h" #include "spell/spells-type.h" +#include "effect/effect-characteristics.h" /*! * @brief ビーム/ボルト/ボール系魔法によるモンスターへの効果があるかないかを判定する diff --git a/src/effect/effect-player.c b/src/effect/effect-player.c index 3f4f455d0..740544ab2 100644 --- a/src/effect/effect-player.c +++ b/src/effect/effect-player.c @@ -15,6 +15,7 @@ #include "player-move.h" #include "spell/spells-type.h" #include "player-effects.h" +#include "effect/effect-characteristics.h" typedef enum effect_player_check_result { diff --git a/src/floor.c b/src/floor.c index 83a4ec9fc..370242f25 100644 --- a/src/floor.c +++ b/src/floor.c @@ -14,6 +14,7 @@ #include "object/object-kind.h" #include "trap.h" #include "effect/spells-effect-util.h" +#include "effect/effect-characteristics.h" /* * The array of floor [MAX_WID][MAX_HGT]. diff --git a/src/floor.h b/src/floor.h index 230860cc9..7534943c8 100644 --- a/src/floor.h +++ b/src/floor.h @@ -363,25 +363,6 @@ extern void try_door(player_type *player_ptr, POSITION y, POSITION x); extern FEAT_IDX conv_dungeon_feat(floor_type *floor_ptr, FEAT_IDX newfeat); extern void vault_objects(player_type *player_ptr, POSITION y, POSITION x, int num); -/* - * project()関数に用いられる、遠隔攻撃特性ビットフラグ / Bit flags for the "project()" function - */ -#define PROJECT_JUMP 0x0001 /*!< 遠隔攻撃特性: 発動者からの軌跡を持たず、指定地点に直接発生する(予め置いたトラップ、上空からの発生などのイメージ) / Jump directly to the target location (this is a hack) */ -#define PROJECT_BEAM 0x0002 /*!< 遠隔攻撃特性: ビーム範囲を持つ。 / Work as a beam weapon (affect every grid passed through) */ -#define PROJECT_THRU 0x0004 /*!< 遠隔攻撃特性: 目標地点に到達しても射程と遮蔽の限り引き延ばす。 / Continue "through" the target (used for "bolts"/"beams") */ -#define PROJECT_STOP 0x0008 /*!< 遠隔攻撃特性: 道中にプレイヤーかモンスターがいた時点で到達地点を更新して停止する(壁や森はPROJECT_DISIがない限り最初から貫通しない) */ -#define PROJECT_GRID 0x0010 /*!< 遠隔攻撃特性: 射程内の地形に影響を及ぼす / Affect each grid in the "blast area" in some way */ -#define PROJECT_ITEM 0x0020 /*!< 遠隔攻撃特性: 射程内のアイテムに影響を及ぼす / Affect each object in the "blast area" in some way */ -#define PROJECT_KILL 0x0040 /*!< 遠隔攻撃特性: 射程内のモンスターに影響を及ぼす / Affect each monster in the "blast area" in some way */ -#define PROJECT_HIDE 0x0080 /*!< 遠隔攻撃特性: / Hack -- disable "visual" feedback from projection */ -#define PROJECT_DISI 0x0100 /*!< 遠隔攻撃特性: / Disintegrate non-permanent features */ -#define PROJECT_PLAYER 0x0200 /*!< 遠隔攻撃特性: / Main target is player (used for riding player) */ -#define PROJECT_AIMED 0x0400 /*!< 遠隔攻撃特性: / Target is only player or monster, so don't affect another. Depend on PROJECT_PLAYER. (used for minimum (rad == 0) balls on riding player) */ -#define PROJECT_REFLECTABLE 0x0800 /*!< 遠隔攻撃特性: 反射可能(ボルト系魔法に利用) / Refrectable spell attacks (used for "bolts") */ -#define PROJECT_NO_HANGEKI 0x1000 /*!< 遠隔攻撃特性: / Avoid counter attacks of monsters */ -#define PROJECT_PATH 0x2000 /*!< 遠隔攻撃特性: / Only used for printing project path */ -#define PROJECT_FAST 0x4000 /*!< 遠隔攻撃特性: / Hide "visual" of flying bolts until blast */ -#define PROJECT_LOS 0x8000 /*!< 遠隔攻撃特性: / */ extern sint project_path(player_type *player_ptr, u16b *gp, POSITION range, POSITION y1, POSITION x1, POSITION y2, POSITION x2, BIT_FLAGS flg); extern void set_floor(player_type *player_ptr, POSITION x, POSITION y); diff --git a/src/grid.c b/src/grid.c index f5440e917..1b33ddbb1 100644 --- a/src/grid.c +++ b/src/grid.c @@ -37,6 +37,7 @@ #include "view/display-main-window.h" #include "realm/realm-song.h" #include "spell/process-effect.h" +#include "effect/effect-characteristics.h" #define MONSTER_FLOW_DEPTH 32 /*!< 敵のプレイヤーに対する移動道のりの最大値(この値以上は処理を打ち切る) / OPTION: Maximum flow depth when using "MONSTER_FLOW" */ diff --git a/src/mind.c b/src/mind.c index cf0e96e1a..cd5ce16af 100644 --- a/src/mind.c +++ b/src/mind.c @@ -21,7 +21,7 @@ #include "mind.h" -#include "floor.h" +#include "effect/effect-characteristics.h" #include "melee.h" #include "spells-summon.h" #include "avatar.h" diff --git a/src/monster/monster-move.c b/src/monster/monster-move.c index 8729f3b1d..6cf0f1efe 100644 --- a/src/monster/monster-move.c +++ b/src/monster/monster-move.c @@ -15,6 +15,7 @@ #include "player-move.h" #include "spell/spells-type.h" #include "spell/process-effect.h" +#include "effect/effect-characteristics.h" static bool check_hp_for_feat_destruction(feature_type *f_ptr, monster_type *m_ptr) { diff --git a/src/monster1.c b/src/monster1.c index 847d9edee..6a340ba65 100644 --- a/src/monster1.c +++ b/src/monster1.c @@ -19,7 +19,7 @@ #include "cmd/cmd-dump.h" #include "market/building.h" #include "cmd-pet.h" -#include "floor.h" +#include "effect/effect-characteristics.h" #include "object/object-kind-hook.h" #include "player-personality.h" #include "monster.h" diff --git a/src/monster2.c b/src/monster2.c index d3697e857..cb6f6bd61 100644 --- a/src/monster2.c +++ b/src/monster2.c @@ -19,7 +19,7 @@ #include "cmd/cmd-dump.h" #include "cmd-pet.h" #include "dungeon.h" -#include "floor.h" +#include "effect/effect-characteristics.h" #include "object-flavor.h" #include "monsterrace-hook.h" #include "monster-status.h" diff --git a/src/mspells1.c b/src/mspells1.c index 0645a6550..973f434b9 100644 --- a/src/mspells1.c +++ b/src/mspells1.c @@ -41,7 +41,7 @@ #include "angband.h" #include "util.h" -#include "floor.h" +#include "effect/effect-characteristics.h" #include "dungeon.h" #include "grid.h" #include "object-curse.h" diff --git a/src/mspells2.c b/src/mspells2.c index 0ac4bffb1..d278738a3 100644 --- a/src/mspells2.c +++ b/src/mspells2.c @@ -16,7 +16,7 @@ #include "main/sound-definitions-table.h" #include "cmd-pet.h" -#include "floor.h" +#include "effect/effect-characteristics.h" #include "grid.h" #include "quest.h" #include "realm/realm-hex.h" diff --git a/src/mspells4.c b/src/mspells4.c index e01f9657a..02e57f69d 100644 --- a/src/mspells4.c +++ b/src/mspells4.c @@ -9,7 +9,7 @@ #include "util.h" #include "main/sound-definitions-table.h" -#include "floor.h" +#include "effect/effect-characteristics.h" #include "grid.h" #include "spells-summon.h" #include "artifact.h" diff --git a/src/object-broken.c b/src/object-broken.c index f34e095e0..fb89e32f8 100644 --- a/src/object-broken.c +++ b/src/object-broken.c @@ -3,6 +3,7 @@ #include "snipe.h" #include "spell/spells-type.h" #include "spell/process-effect.h" +#include "effect/effect-characteristics.h" /*! * @brief アイテムが酸で破損するかどうかを判定する diff --git a/src/player-move.c b/src/player-move.c index 4daf5366a..fe3fa7b8a 100644 --- a/src/player-move.c +++ b/src/player-move.c @@ -147,7 +147,7 @@ #include "realm/realm-song.h" #include "autopick/autopick.h" #include "dungeon.h" -#include "floor.h" +#include "effect/effect-characteristics.h" #include "melee.h" #include "grid.h" #include "trap.h" diff --git a/src/realm/realm-chaos.c b/src/realm/realm-chaos.c index fed2ce7fc..00cae1a30 100644 --- a/src/realm/realm-chaos.c +++ b/src/realm/realm-chaos.c @@ -14,6 +14,7 @@ #include "realm/realm-chaos.h" #include "spell/spells-type.h" #include "spell/process-effect.h" +#include "effect/effect-characteristics.h" /*! * @brief カオス領域魔法の各処理を行う diff --git a/src/realm/realm-crusade.c b/src/realm/realm-crusade.c index 900291c65..cd7f3b23d 100644 --- a/src/realm/realm-crusade.c +++ b/src/realm/realm-crusade.c @@ -3,7 +3,7 @@ #include "world.h" #include "cmd-spell.h" -#include "floor.h" +#include "effect/effect-characteristics.h" #include "spell/spells-type.h" #include "spells-object.h" #include "spells-summon.h" diff --git a/src/realm/realm-death.c b/src/realm/realm-death.c index c7dcc9e5f..9ae2b247d 100644 --- a/src/realm/realm-death.c +++ b/src/realm/realm-death.c @@ -14,6 +14,7 @@ #include "player-race.h" #include "realm/realm-death.h" #include "spell/process-effect.h" +#include "effect/effect-characteristics.h" /*! * @brief 暗黒領域魔法の各処理を行う diff --git a/src/realm/realm-hex.c b/src/realm/realm-hex.c index 4ad38b6fc..ea1a7cee6 100644 --- a/src/realm/realm-hex.c +++ b/src/realm/realm-hex.c @@ -18,7 +18,7 @@ #include "angband.h" #include "util.h" -#include "floor.h" +#include "effect/effect-characteristics.h" #include "cmd-spell.h" #include "cmd-quaff.h" #include "object-flavor.h" diff --git a/src/realm/realm-hissatsu.c b/src/realm/realm-hissatsu.c index 92a7b2e98..0e6401751 100644 --- a/src/realm/realm-hissatsu.c +++ b/src/realm/realm-hissatsu.c @@ -5,7 +5,7 @@ #include "cmd-spell.h" #include "cmd-basic.h" #include "dungeon.h" -#include "floor.h" +#include "effect/effect-characteristics.h" #include "melee.h" #include "monsterrace-hook.h" #include "artifact.h" diff --git a/src/realm/realm-nature.c b/src/realm/realm-nature.c index 63c5753fe..86d870471 100644 --- a/src/realm/realm-nature.c +++ b/src/realm/realm-nature.c @@ -16,6 +16,7 @@ #include "realm/realm-nature.h" #include "spell/spells-type.h" #include "spell/process-effect.h" +#include "effect/effect-characteristics.h" /*! * @brief 自然領域魔法の各処理を行う diff --git a/src/realm/realm-song.c b/src/realm/realm-song.c index a283393f4..e1b72fee0 100644 --- a/src/realm/realm-song.c +++ b/src/realm/realm-song.c @@ -11,6 +11,7 @@ #include "view/display-main-window.h" #include "realm/realm-song.h" #include "spell/process-effect.h" +#include "effect/effect-characteristics.h" /*! * @brief 歌の開始を処理する / Start singing if the player is a Bard diff --git a/src/spell/process-effect.c b/src/spell/process-effect.c index 09e0a9d83..a06f174e1 100644 --- a/src/spell/process-effect.c +++ b/src/spell/process-effect.c @@ -11,6 +11,7 @@ #include "main/sound-definitions-table.h" #include "spell/spells-type.h" #include "view/display-main-window.h" // 暫定、後で消すかも. +#include "effect/effect-characteristics.h" /*! * @brief 配置した鏡リストの次を取得する / diff --git a/src/spells-status.c b/src/spells-status.c index c973b9c3c..6b671f173 100644 --- a/src/spells-status.c +++ b/src/spells-status.c @@ -4,7 +4,7 @@ #include "cmd-magiceat.h" #include "avatar.h" -#include "floor.h" +#include "effect/effect-characteristics.h" #include "object-flavor.h" #include "player-status.h" #include "player-class.h" diff --git a/src/spells1.c b/src/spells1.c index 344d17fe9..b32fb05b4 100644 --- a/src/spells1.c +++ b/src/spells1.c @@ -26,6 +26,7 @@ #include "effect/effect-feature.h" #include "effect/effect-item.h" #include "effect/effect-monster.h" +#include "effect/effect-characteristics.h" /* * Find the distance from (x, y) to a line. diff --git a/src/spells2.c b/src/spells2.c index 5c9cf940d..06f1e36f3 100644 --- a/src/spells2.c +++ b/src/spells2.c @@ -22,7 +22,7 @@ #include "io/write-diary.h" #include "cmd/cmd-pet.h" #include "cmd/cmd-dump.h" -#include "floor.h" +#include "effect/effect-characteristics.h" #include "grid.h" #include "trap.h" #include "monsterrace-hook.h" diff --git a/src/spells3.c b/src/spells3.c index ad04abef1..6f04fa934 100644 --- a/src/spells3.c +++ b/src/spells3.c @@ -22,7 +22,7 @@ #include "creature.h" #include "dungeon.h" -#include "floor.h" +#include "effect/effect-characteristics.h" #include "floor-town.h" #include "object-boost.h" #include "object-flavor.h" diff --git a/src/trap.c b/src/trap.c index f87eaae64..4d9a4b682 100644 --- a/src/trap.c +++ b/src/trap.c @@ -18,7 +18,7 @@ #include "player-status.h" #include "grid.h" #include "spell/spells-type.h" -#include "floor.h" +#include "effect/effect-characteristics.h" #include "floor-save.h" #include "init.h" #include "files.h" diff --git a/src/view/display-main-window.c b/src/view/display-main-window.c index 27764f0c2..d88bc3c0e 100644 --- a/src/view/display-main-window.c +++ b/src/view/display-main-window.c @@ -41,7 +41,7 @@ #include "grid.h" #include "dungeon.h" -#include "floor.h" +#include "effect/effect-characteristics.h" #include "floor-town.h" #include "feature.h" #include "object/object-kind.h" -- 2.11.0