From 46de3e10fcf191d130d8d872b6640adca6e9e443 Mon Sep 17 00:00:00 2001 From: Hourier Date: Thu, 28 May 2020 23:00:51 +0900 Subject: [PATCH] [Refactor] #40399 Separated sv-protector-types.h from object.h --- Hengband/Hengband/Hengband.vcxproj | 1 + Hengband/Hengband/Hengband.vcxproj.filters | 3 ++ src/Makefile.am | 2 +- src/floor/floor-events.c | 1 + src/knowledge/knowledge-inventory.c | 1 + src/market/articles-on-sale.c | 1 + src/monster/monster1.c | 1 + src/object/object-hook.c | 1 + src/object/object1.h | 44 ----------------------- src/object/object2.c | 1 + src/object/sv-protector-types.h | 57 ++++++++++++++++++++++++++++++ src/player/player-effects.c | 1 + src/spell/spells-object.c | 1 + 13 files changed, 70 insertions(+), 45 deletions(-) create mode 100644 src/object/sv-protector-types.h diff --git a/Hengband/Hengband/Hengband.vcxproj b/Hengband/Hengband/Hengband.vcxproj index 6bf013589..f7af47c0e 100644 --- a/Hengband/Hengband/Hengband.vcxproj +++ b/Hengband/Hengband/Hengband.vcxproj @@ -511,6 +511,7 @@ + diff --git a/Hengband/Hengband/Hengband.vcxproj.filters b/Hengband/Hengband/Hengband.vcxproj.filters index 05d6e9716..b76877d48 100644 --- a/Hengband/Hengband/Hengband.vcxproj.filters +++ b/Hengband/Hengband/Hengband.vcxproj.filters @@ -2182,6 +2182,9 @@ object + + object + diff --git a/src/Makefile.am b/src/Makefile.am index c1e4549e9..5eba0bfcd 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -209,7 +209,7 @@ hengband_SOURCES = \ object/object-mark-types.h object/object-util.h \ object/item-apply-magic.h \ object/sv-bow-types.h object/sv-digging-types.h object/sv-other-types.h \ - object/sv-weapon-types.h \ + object/sv-weapon-types.h object/sv-protector-types.h \ object/item-feeling.h object/item-use-flags.h \ \ inventory/simple-appraiser.c inventory/simple-appraiser.h \ diff --git a/src/floor/floor-events.c b/src/floor/floor-events.c index abd3b4757..d9a51dd97 100644 --- a/src/floor/floor-events.c +++ b/src/floor/floor-events.c @@ -16,6 +16,7 @@ #include "player/player-effects.h" #include "object/object-kind.h" #include "object/object-ego.h" +#include "object/sv-protector-types.h" #include "cmd-dump.h" #include "view/display-main-window.h" diff --git a/src/knowledge/knowledge-inventory.c b/src/knowledge/knowledge-inventory.c index cc6344c7f..00dccc27b 100644 --- a/src/knowledge/knowledge-inventory.c +++ b/src/knowledge/knowledge-inventory.c @@ -14,6 +14,7 @@ #include "floor/floor-town.h" #include "object/object-hook.h" #include "object/object-kind.h" +#include "object/sv-protector-types.h" #include "object/tr-types.h" static concptr inven_res_label = _( diff --git a/src/market/articles-on-sale.c b/src/market/articles-on-sale.c index 56945a28a..1694dac5f 100644 --- a/src/market/articles-on-sale.c +++ b/src/market/articles-on-sale.c @@ -4,6 +4,7 @@ #include "object/sv-bow-types.h" #include "object/sv-digging-types.h" #include "object/sv-other-types.h" +#include "object/sv-protector-types.h" #include "object/sv-weapon-types.h" /*! diff --git a/src/monster/monster1.c b/src/monster/monster1.c index b1d87f5b8..107e820fb 100644 --- a/src/monster/monster1.c +++ b/src/monster/monster1.c @@ -46,6 +46,7 @@ #include "combat/monster-attack-types.h" #include "combat/monster-attack-effect.h" #include "object/sv-other-types.h" +#include "object/sv-protector-types.h" #include "object/sv-weapon-types.h" /* diff --git a/src/object/object-hook.c b/src/object/object-hook.c index c6be39fee..eb657d949 100644 --- a/src/object/object-hook.c +++ b/src/object/object-hook.c @@ -6,6 +6,7 @@ #include "object/object-kind.h" #include "object/special-object-flags.h" #include "object/sv-other-types.h" +#include "object/sv-protector-types.h" #include "object/sv-weapon-types.h" #include "object/tr-types.h" #include "monster/monster.h" diff --git a/src/object/object1.h b/src/object/object1.h index 089878236..10487f5c7 100644 --- a/src/object/object1.h +++ b/src/object/object1.h @@ -113,50 +113,6 @@ extern void torch_flags(object_type *o_ptr, BIT_FLAGS *flgs); extern void torch_dice(object_type *o_ptr, DICE_NUMBER *dd, DICE_SID *ds); extern void torch_lost_fuel(object_type *o_ptr); -/* The "sval" codes for TV_SHIELD */ -#define SV_SMALL_LEATHER_SHIELD 2 -#define SV_SMALL_METAL_SHIELD 3 -#define SV_LARGE_LEATHER_SHIELD 4 -#define SV_LARGE_METAL_SHIELD 5 -#define SV_DRAGON_SHIELD 6 -#define SV_KNIGHT_SHIELD 7 -#define SV_MIRROR_SHIELD 10 -#define SV_YATA_MIRROR 50 - -/* The "sval" codes for TV_HELM */ -#define SV_HARD_LEATHER_CAP 2 -#define SV_METAL_CAP 3 -#define SV_JINGASA 4 /* 4 */ -#define SV_IRON_HELM 5 -#define SV_STEEL_HELM 6 -#define SV_DRAGON_HELM 7 -#define SV_KABUTO 8 /* 7 */ - -/* The "sval" codes for TV_CROWN */ -#define SV_IRON_CROWN 10 -#define SV_GOLDEN_CROWN 11 -#define SV_JEWELED_CROWN 12 -#define SV_CHAOS 50 - -/* The "sval" codes for TV_BOOTS */ -#define SV_PAIR_OF_SOFT_LEATHER_BOOTS 2 -#define SV_PAIR_OF_HARD_LEATHER_BOOTS 3 -#define SV_PAIR_OF_DRAGON_GREAVE 4 -#define SV_PAIR_OF_METAL_SHOD_BOOTS 6 - -/* The "sval" codes for TV_CLOAK */ -#define SV_CLOAK 1 -#define SV_ELVEN_CLOAK 2 -#define SV_FUR_CLOAK 3 -#define SV_ETHEREAL_CLOAK 5 -#define SV_SHADOW_CLOAK 6 - -/* The "sval" codes for TV_GLOVES */ -#define SV_SET_OF_LEATHER_GLOVES 1 -#define SV_SET_OF_GAUNTLETS 2 -#define SV_SET_OF_DRAGON_GLOVES 3 -#define SV_SET_OF_CESTI 5 - /* The "sval" codes for TV_SOFT_ARMOR */ #define SV_T_SHIRT 0 #define SV_FILTHY_RAG 1 diff --git a/src/object/object2.c b/src/object/object2.c index a9266465e..4f343ad93 100644 --- a/src/object/object2.c +++ b/src/object/object2.c @@ -36,6 +36,7 @@ #include "object/special-object-flags.h" #include "object/sv-bow-types.h" #include "object/sv-other-types.h" +#include "object/sv-protector-types.h" #include "object/sv-weapon-types.h" #include "object/item-feeling.h" #include "grid/feature.h" diff --git a/src/object/sv-protector-types.h b/src/object/sv-protector-types.h new file mode 100644 index 000000000..b80e9f8a7 --- /dev/null +++ b/src/object/sv-protector-types.h @@ -0,0 +1,57 @@ +#pragma once + +/* The "sval" codes for TV_SHIELD */ +typedef enum sv_shield_type { + SV_SMALL_LEATHER_SHIELD = 2, + SV_SMALL_METAL_SHIELD = 3, + SV_LARGE_LEATHER_SHIELD = 4, + SV_LARGE_METAL_SHIELD = 5, + SV_DRAGON_SHIELD = 6, + SV_KNIGHT_SHIELD = 7, + SV_MIRROR_SHIELD = 10, + SV_YATA_MIRROR = 50, +} sv_shield_type; + +/* The "sval" codes for TV_HELM */ +typedef enum sv_helm_type { + SV_HARD_LEATHER_CAP = 2, + SV_METAL_CAP = 3, + SV_JINGASA = 4, /* 4 */ + SV_IRON_HELM = 5, + SV_STEEL_HELM = 6, + SV_DRAGON_HELM = 7, + SV_KABUTO = 8, /* 7 */ +} sv_helm_type; + +/* The "sval" codes for TV_CROWN */ +typedef enum sv_crown_type { + SV_IRON_CROWN = 10, + SV_GOLDEN_CROWN = 11, + SV_JEWELED_CROWN = 12, + SV_CHAOS = 50, +} sv_crown_type; + +/* The "sval" codes for TV_BOOTS */ +typedef enum sv_boots_type { + SV_PAIR_OF_SOFT_LEATHER_BOOTS = 2, + SV_PAIR_OF_HARD_LEATHER_BOOTS = 3, + SV_PAIR_OF_DRAGON_GREAVE = 4, + SV_PAIR_OF_METAL_SHOD_BOOTS = 6, +} sv_boots_type; + +/* The "sval" codes for TV_CLOAK */ +typedef enum sv_cloak_type { + SV_CLOAK = 1, + SV_ELVEN_CLOAK = 2, + SV_FUR_CLOAK = 3, + SV_ETHEREAL_CLOAK = 5, + SV_SHADOW_CLOAK = 6, +} sv_cloak_type; + +/* The "sval" codes for TV_GLOVES */ +typedef enum sv_gloves_type { + SV_SET_OF_LEATHER_GLOVES = 1, + SV_SET_OF_GAUNTLETS = 2, + SV_SET_OF_DRAGON_GLOVES = 3, + SV_SET_OF_CESTI = 5, +} sv_gloves_type; diff --git a/src/player/player-effects.c b/src/player/player-effects.c index 58c4f78ee..3f43c78c7 100644 --- a/src/player/player-effects.c +++ b/src/player/player-effects.c @@ -35,6 +35,7 @@ #include "object/object-ego.h" #include "object/object-hook.h" #include "object/special-object-flags.h" +#include "object/sv-protector-types.h" #include "object/sv-weapon-types.h" #include "floor/wild.h" #include "spell/spells-floor.h" diff --git a/src/spell/spells-object.c b/src/spell/spells-object.c index ca0c78047..3ca3b0369 100644 --- a/src/spell/spells-object.c +++ b/src/spell/spells-object.c @@ -16,6 +16,7 @@ #include "object/object-flavor.h" #include "object/object-ego.h" #include "object/special-object-flags.h" +#include "object/sv-protector-types.h" #include "object/sv-weapon-types.h" #include "player/player-damage.h" #include "player/player-status.h" -- 2.11.0