From: Hourier Date: Thu, 28 May 2020 10:09:34 +0000 (+0900) Subject: [Refactor] #40399 Separated trc-types.h from object.h X-Git-Tag: vmacos3.0.0-alpha52~1100 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=4c26cc2263f0a462d566006be3440165ef9a343b;p=hengbandforosx%2Fhengbandosx.git [Refactor] #40399 Separated trc-types.h from object.h --- diff --git a/Hengband/Hengband/Hengband.vcxproj b/Hengband/Hengband/Hengband.vcxproj index ceba4ef5f..3a4771058 100644 --- a/Hengband/Hengband/Hengband.vcxproj +++ b/Hengband/Hengband/Hengband.vcxproj @@ -505,6 +505,7 @@ + diff --git a/Hengband/Hengband/Hengband.vcxproj.filters b/Hengband/Hengband/Hengband.vcxproj.filters index 93c838456..f5f2fa392 100644 --- a/Hengband/Hengband/Hengband.vcxproj.filters +++ b/Hengband/Hengband/Hengband.vcxproj.filters @@ -2155,6 +2155,9 @@ object + + object + diff --git a/src/Makefile.am b/src/Makefile.am index 6eb2d7be0..2e20aaf4c 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -204,7 +204,7 @@ hengband_SOURCES = \ object/object-ego.c object/object-ego.h \ object/warning.c object/warning.h \ object/death-scythe.c object/death-scythe.h \ - object/tr-types.h object/tval-type.h \ + object/tr-types.h object/trc-types.h object/tval-type.h \ object/old-ego-extra-values.h object/special-object-flags.h \ object/object-mark-types.h \ \ diff --git a/src/cmd/cmd-item.c b/src/cmd/cmd-item.c index 15acab6e7..a50be2927 100644 --- a/src/cmd/cmd-item.c +++ b/src/cmd/cmd-item.c @@ -35,6 +35,7 @@ #include "dungeon/quest.h" #include "object/artifact.h" #include "object/special-object-flags.h" +#include "object/trc-types.h" #include "player/avatar.h" #include "player/player-status.h" #include "player/player-effects.h" diff --git a/src/cmd/cmd-smith.c b/src/cmd/cmd-smith.c index 9df0ec8d6..ec58491de 100644 --- a/src/cmd/cmd-smith.c +++ b/src/cmd/cmd-smith.c @@ -14,6 +14,7 @@ #include "view/display-main-window.h" #include "inventory/player-inventory.h" #include "object/tr-types.h" +#include "object/trc-types.h" /*! * エッセンス情報の構造体 / A structure for smithing diff --git a/src/core/hp-mp-processor.c b/src/core/hp-mp-processor.c index 4052d26c8..936583609 100644 --- a/src/core/hp-mp-processor.c +++ b/src/core/hp-mp-processor.c @@ -10,6 +10,7 @@ #include "core/hp-mp-regenerator.h" #include "cmd/cmd-pet.h" #include "player/player-races-table.h" +#include "object/trc-types.h" /*! * @brief 10ゲームターンが進行するごとにプレイヤーのHPとMPの増減処理を行う。 diff --git a/src/effect/effect-monster-charm.c b/src/effect/effect-monster-charm.c index afae5a155..e51a72137 100644 --- a/src/effect/effect-monster-charm.c +++ b/src/effect/effect-monster-charm.c @@ -4,6 +4,7 @@ #include "player/avatar.h" #include "spell/spells-diceroll.h" #include "monster/monster-race-hook.h" +#include "object/trc-types.h" static void effect_monster_charm_resist(player_type *caster_ptr, effect_monster_type *em_ptr) { diff --git a/src/effect/effect-monster-domination.c b/src/effect/effect-monster-domination.c index 808a28d30..823ef0bcd 100644 --- a/src/effect/effect-monster-domination.c +++ b/src/effect/effect-monster-domination.c @@ -8,6 +8,7 @@ #include "cmd/cmd-pet.h" // 暫定、後で消すかも. #include "dungeon/quest.h" #include "monster/monster-race-hook.h" +#include "object/trc-types.h" static void effect_monster_domination_corrupted_addition(player_type *caster_ptr, effect_monster_type *em_ptr) { diff --git a/src/inventory/inventory-curse.c b/src/inventory/inventory-curse.c index ee9bd544f..5459bc2a0 100644 --- a/src/inventory/inventory-curse.c +++ b/src/inventory/inventory-curse.c @@ -15,6 +15,7 @@ #include "object/object-kind.h" #include "player/player-races-table.h" #include "object/tr-types.h" +#include "object/trc-types.h" #define TRC_P_FLAG_MASK \ (TRC_TELEPORT_SELF | TRC_CHAINSWORD | TRC_TY_CURSE | TRC_DRAIN_EXP | TRC_ADD_L_CURSE | TRC_ADD_H_CURSE | TRC_CALL_ANIMAL | TRC_CALL_DEMON \ diff --git a/src/io/load.c b/src/io/load.c index 44e539609..87c8f171f 100644 --- a/src/io/load.c +++ b/src/io/load.c @@ -90,6 +90,7 @@ #include "market/bounty.h" #include "object/tr-types.h" #include "object/object-mark-types.h" +#include "object/trc-types.h" #include "object/old-ego-extra-values.h" // TODO v1.5.0以前のセーブファイルをロードする処理を分離する. /* diff --git a/src/mind/surprise-attack.c b/src/mind/surprise-attack.c index df6ebbf96..2aec092b8 100644 --- a/src/mind/surprise-attack.c +++ b/src/mind/surprise-attack.c @@ -1,5 +1,6 @@ #include "system/angband.h" #include "mind/surprise-attack.h" +#include "object/trc-types.h" /*! * @brief 盗賊と忍者における不意打ち diff --git a/src/monster/monster-process.c b/src/monster/monster-process.c index 04a631be6..4031f4dde 100644 --- a/src/monster/monster-process.c +++ b/src/monster/monster-process.c @@ -36,6 +36,7 @@ #include "monster/monster-status.h" #include "mspell/monster-spell.h" #include "monster/monster-process.h" +#include "object/trc-types.h" void decide_drop_from_monster(player_type *target_ptr, MONSTER_IDX m_idx, bool is_riding_mon); bool process_stealth(player_type *target_ptr, MONSTER_IDX m_idx); diff --git a/src/object/artifact.c b/src/object/artifact.c index 64dabd326..a10f5b5b6 100644 --- a/src/object/artifact.c +++ b/src/object/artifact.c @@ -36,6 +36,7 @@ #include "player/player-personalities-table.h" #include "world/world.h" #include "object/tr-types.h" +#include "object/trc-types.h" /* * The artifact arrays diff --git a/src/object/object-curse.c b/src/object/object-curse.c index 868dd61af..90abac49f 100644 --- a/src/object/object-curse.c +++ b/src/object/object-curse.c @@ -4,6 +4,7 @@ #include "object/object-flavor.h" #include "object/object-hook.h" #include "object/tr-types.h" +#include "object/trc-types.h" #define MAX_CURSE 18 #define TRC_SPECIAL_MASK (TRC_TY_CURSE | TRC_AGGRAVATE) diff --git a/src/object/object.h b/src/object/object.h index 0d0e1adaf..b6df8704c 100644 --- a/src/object/object.h +++ b/src/object/object.h @@ -86,32 +86,6 @@ struct object_type byte feeling; /* Game generated inscription number (eg, pseudo-id) */ BIT_FLAGS art_flags[TR_FLAG_SIZE]; /* Extra Flags for ego and artifacts */ - -#define TRC_CURSED 0x00000001L -#define TRC_HEAVY_CURSE 0x00000002L -#define TRC_PERMA_CURSE 0x00000004L -#define TRC_XXX1 0x00000008L -#define TRC_TY_CURSE 0x00000010L -#define TRC_AGGRAVATE 0x00000020L -#define TRC_DRAIN_EXP 0x00000040L -#define TRC_SLOW_REGEN 0x00000080L -#define TRC_ADD_L_CURSE 0x00000100L -#define TRC_ADD_H_CURSE 0x00000200L -#define TRC_CALL_ANIMAL 0x00000400L -#define TRC_CALL_DEMON 0x00000800L -#define TRC_CALL_DRAGON 0x00001000L -#define TRC_COWARDICE 0x00002000L -#define TRC_TELEPORT 0x00004000L -#define TRC_LOW_MELEE 0x00008000L -#define TRC_LOW_AC 0x00010000L -#define TRC_LOW_MAGIC 0x00020000L -#define TRC_FAST_DIGEST 0x00040000L -#define TRC_DRAIN_HP 0x00080000L -#define TRC_DRAIN_MANA 0x00100000L -#define TRC_CALL_UNDEAD 0x00200000L - -#define TRC_TELEPORT_SELF 0x00000001L -#define TRC_CHAINSWORD 0x00000002L BIT_FLAGS curse_flags; /* Flags for curse */ OBJECT_IDX next_o_idx; /* Next object in stack (if any) */ diff --git a/src/object/object1.c b/src/object/object1.c index 0ba17b10f..4db8db65b 100644 --- a/src/object/object1.c +++ b/src/object/object1.c @@ -34,6 +34,7 @@ #include "combat/snipe.h" #include "view/display-main-window.h" #include "object/tr-types.h" +#include "object/trc-types.h" #if defined(MACH_O_CARBON) #ifdef verify diff --git a/src/object/object2.c b/src/object/object2.c index a6d9b8454..447528891 100644 --- a/src/object/object2.c +++ b/src/object/object2.c @@ -47,6 +47,7 @@ #include "object/object-ego.h" #include "view/display-main-window.h" #include "object/tr-types.h" +#include "object/trc-types.h" /* * todo この説明長すぎ。何とかしたい diff --git a/src/object/trc-types.h b/src/object/trc-types.h new file mode 100644 index 000000000..7d02e61a8 --- /dev/null +++ b/src/object/trc-types.h @@ -0,0 +1,32 @@ +#pragma once + +/* TRCが何の略かは分からない (type / ??? / curse)*/ +typedef enum trc_curse_type { + TRC_CURSED = 0x00000001L, + TRC_HEAVY_CURSE = 0x00000002L, + TRC_PERMA_CURSE = 0x00000004L, + TRC_XXX1 = 0x00000008L, + TRC_TY_CURSE = 0x00000010L, + TRC_AGGRAVATE = 0x00000020L, + TRC_DRAIN_EXP = 0x00000040L, + TRC_SLOW_REGEN = 0x00000080L, + TRC_ADD_L_CURSE = 0x00000100L, + TRC_ADD_H_CURSE = 0x00000200L, + TRC_CALL_ANIMAL = 0x00000400L, + TRC_CALL_DEMON = 0x00000800L, + TRC_CALL_DRAGON = 0x00001000L, + TRC_COWARDICE = 0x00002000L, + TRC_TELEPORT = 0x00004000L, + TRC_LOW_MELEE = 0x00008000L, + TRC_LOW_AC = 0x00010000L, + TRC_LOW_MAGIC = 0x00020000L, + TRC_FAST_DIGEST = 0x00040000L, + TRC_DRAIN_HP = 0x00080000L, + TRC_DRAIN_MANA = 0x00100000L, + TRC_CALL_UNDEAD = 0x00200000L, +} trc_curse_type; + +typedef enum trc_special_type { + TRC_TELEPORT_SELF = 0x00000001L, + TRC_CHAINSWORD = 0x00000002L +} trc_special_type; diff --git a/src/player/digestion-processor.c b/src/player/digestion-processor.c index d421c092a..99887acab 100644 --- a/src/player/digestion-processor.c +++ b/src/player/digestion-processor.c @@ -6,6 +6,7 @@ #include "player/player-effects.h" #include "monster/creature.h" #include "player/player-move.h" +#include "object/trc-types.h" /*! * @brief 10ゲームターンが進行するごとにプレイヤーの腹を減らす diff --git a/src/player/player-status.c b/src/player/player-status.c index 37c9860fb..7acb5c9ef 100644 --- a/src/player/player-status.c +++ b/src/player/player-status.c @@ -56,6 +56,7 @@ #include "mind/racial-force-trainer.h" #include "object/tr-types.h" #include "object/object-mark-types.h" +#include "object/trc-types.h" /*! * @brief 能力値テーブル / Abbreviations of healthy stats diff --git a/src/player/selfinfo.c b/src/player/selfinfo.c index 7d3565086..2534b46b4 100644 --- a/src/player/selfinfo.c +++ b/src/player/selfinfo.c @@ -26,6 +26,7 @@ #include "realm/realm-hex.h" #include "realm/realm-song.h" #include "object/tr-types.h" +#include "object/trc-types.h" /*! * @brief 自己分析処理(Nethackからのアイデア) / self-knowledge... idea from nethack. diff --git a/src/realm/realm-hex.c b/src/realm/realm-hex.c index 0cd92e1e3..c036ec475 100644 --- a/src/realm/realm-hex.c +++ b/src/realm/realm-hex.c @@ -44,6 +44,7 @@ #include "spell/spells2.h" #include "spell/spells3.h" #include "object/tr-types.h" +#include "object/trc-types.h" #define MAX_KEEP 4 /*!<呪術の最大詠唱数 */ diff --git a/src/spell/spells-object.c b/src/spell/spells-object.c index 8e9c55d0e..e13e83c07 100644 --- a/src/spell/spells-object.c +++ b/src/spell/spells-object.c @@ -24,6 +24,7 @@ #include "io/targeting.h" #include "view/display-main-window.h" #include "object/tr-types.h" +#include "object/trc-types.h" typedef struct { diff --git a/src/spell/spells3.c b/src/spell/spells3.c index cc69dbcd7..a4847619e 100644 --- a/src/spell/spells3.c +++ b/src/spell/spells3.c @@ -70,6 +70,7 @@ #include "mind/racial-force-trainer.h" #include "cmd/cmd-attack.h" #include "object/tr-types.h" +#include "object/trc-types.h" #include "object/special-object-flags.h" /*! テレポート先探索の試行数 / Maximum number of tries for teleporting */ diff --git a/src/view/display-characteristic.c b/src/view/display-characteristic.c index 1ecf10e66..e6cfa50b3 100644 --- a/src/view/display-characteristic.c +++ b/src/view/display-characteristic.c @@ -11,6 +11,7 @@ #include "player/race-resistances.h" #include "object/tr-types.h" #include "object/object-flavor.h" +#include "object/trc-types.h" typedef struct { BIT_FLAGS player_flags[TR_FLAG_SIZE]; diff --git a/src/wizard/wizard-special-process.c b/src/wizard/wizard-special-process.c index fc64064ee..1c6eea5b5 100644 --- a/src/wizard/wizard-special-process.c +++ b/src/wizard/wizard-special-process.c @@ -62,6 +62,7 @@ #include "spell/spells3.h" #include "spell/spells-detection.h" #include "player/player-races-table.h" +#include "object/trc-types.h" #define NUM_O_SET 8 #define NUM_O_BIT 32 diff --git a/src/wizard/wizard-spoiler.c b/src/wizard/wizard-spoiler.c index 6a610b9cf..6d06ed482 100644 --- a/src/wizard/wizard-spoiler.c +++ b/src/wizard/wizard-spoiler.c @@ -28,6 +28,7 @@ #include "floor/floor-town.h" #include "io/files-util.h" #include "object/tr-types.h" +#include "object/trc-types.h" #include "object/special-object-flags.h" /*