From 6c830a628082c7cf24d9c0052e6f6536c9a4077e Mon Sep 17 00:00:00 2001 From: Hourier Date: Thu, 28 May 2020 23:49:13 +0900 Subject: [PATCH] [Refactor] #40399 Separated sv-potion-types.h from object1.h --- Hengband/Hengband/Hengband.vcxproj | 1 + Hengband/Hengband/Hengband.vcxproj.filters | 3 ++ src/Makefile.am | 2 +- src/birth/initial-equipments-table.c | 1 + src/birth/inventory-initializer.c | 1 + src/cmd/cmd-quaff.c | 1 + src/market/arena-info-table.c | 1 + src/market/articles-on-sale.c | 1 + src/market/bounty-prize-table.c | 1 + src/object/object-broken.c | 1 + src/object/object1.h | 69 ---------------------------- src/object/sv-potion-types.h | 72 ++++++++++++++++++++++++++++++ src/store/store-util.c | 1 + 13 files changed, 85 insertions(+), 70 deletions(-) create mode 100644 src/object/sv-potion-types.h diff --git a/Hengband/Hengband/Hengband.vcxproj b/Hengband/Hengband/Hengband.vcxproj index 6585d53c3..518323c30 100644 --- a/Hengband/Hengband/Hengband.vcxproj +++ b/Hengband/Hengband/Hengband.vcxproj @@ -512,6 +512,7 @@ + diff --git a/Hengband/Hengband/Hengband.vcxproj.filters b/Hengband/Hengband/Hengband.vcxproj.filters index 9993c5a9b..c5abac368 100644 --- a/Hengband/Hengband/Hengband.vcxproj.filters +++ b/Hengband/Hengband/Hengband.vcxproj.filters @@ -2191,6 +2191,9 @@ object + + object + diff --git a/src/Makefile.am b/src/Makefile.am index d8114e57b..4b7bdeae0 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -210,7 +210,7 @@ hengband_SOURCES = \ 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-protector-types.h object/sv-armor-types.h \ - object/sv-ring-types.h \ + object/sv-potion-types.h object/sv-ring-types.h \ object/item-feeling.h object/item-use-flags.h \ \ inventory/simple-appraiser.c inventory/simple-appraiser.h \ diff --git a/src/birth/initial-equipments-table.c b/src/birth/initial-equipments-table.c index adc300c48..f489d4504 100644 --- a/src/birth/initial-equipments-table.c +++ b/src/birth/initial-equipments-table.c @@ -2,6 +2,7 @@ #include "birth/initial-equipments-table.h" #include "object/sv-armor-types.h" #include "object/sv-bow-types.h" +#include "object/sv-potion-types.h" #include "object/sv-ring-types.h" #include "object/sv-weapon-types.h" diff --git a/src/birth/inventory-initializer.c b/src/birth/inventory-initializer.c index 75110328d..800b842f2 100644 --- a/src/birth/inventory-initializer.c +++ b/src/birth/inventory-initializer.c @@ -8,6 +8,7 @@ #include "object/object-kind.h" #include "object/sv-bow-types.h" #include "object/sv-other-types.h" +#include "object/sv-potion-types.h" #include "object/sv-ring-types.h" #include "object/sv-weapon-types.h" #include "autopick/autopick.h" diff --git a/src/cmd/cmd-quaff.c b/src/cmd/cmd-quaff.c index 34597ef43..32e9e0f0d 100644 --- a/src/cmd/cmd-quaff.c +++ b/src/cmd/cmd-quaff.c @@ -25,6 +25,7 @@ #include "spell/spells-floor.h" #include "object/item-use-flags.h" #include "object/object-broken.h" +#include "object/sv-potion-types.h" #include "cmd-basic.h" #include "floor/floor.h" #include "object/object-kind.h" diff --git a/src/market/arena-info-table.c b/src/market/arena-info-table.c index d90874da3..df5a73313 100644 --- a/src/market/arena-info-table.c +++ b/src/market/arena-info-table.c @@ -1,5 +1,6 @@ #include "system/angband.h" #include "arena-info-table.h" +#include "object/sv-potion-types.h" #include "object/sv-ring-types.h" /*! diff --git a/src/market/articles-on-sale.c b/src/market/articles-on-sale.c index 7fa3360b0..70aa4b9d0 100644 --- a/src/market/articles-on-sale.c +++ b/src/market/articles-on-sale.c @@ -5,6 +5,7 @@ #include "object/sv-bow-types.h" #include "object/sv-digging-types.h" #include "object/sv-other-types.h" +#include "object/sv-potion-types.h" #include "object/sv-protector-types.h" #include "object/sv-ring-types.h" #include "object/sv-weapon-types.h" diff --git a/src/market/bounty-prize-table.c b/src/market/bounty-prize-table.c index f3b7aa1b3..63ca2dbbd 100644 --- a/src/market/bounty-prize-table.c +++ b/src/market/bounty-prize-table.c @@ -1,6 +1,7 @@ #pragma once #include "market/bounty-prize-table.h" +#include "object/sv-potion-types.h" bounty_prize_type prize_list[MAX_BOUNTY] = { { TV_POTION, SV_POTION_CURING }, diff --git a/src/object/object-broken.c b/src/object/object-broken.c index fb7c8babb..b13a00295 100644 --- a/src/object/object-broken.c +++ b/src/object/object-broken.c @@ -4,6 +4,7 @@ #include "spell/spells-type.h" #include "spell/process-effect.h" #include "effect/effect-characteristics.h" +#include "object/sv-potion-types.h" #include "object/tr-types.h" /*! diff --git a/src/object/object1.h b/src/object/object1.h index dedce8e8a..b5c2ac72e 100644 --- a/src/object/object1.h +++ b/src/object/object1.h @@ -316,75 +316,6 @@ extern void torch_lost_fuel(object_type *o_ptr); #define SV_SCROLL_AMUSEMENT 55 #define SV_SCROLL_STAR_AMUSEMENT 56 -/* The "sval" codes for TV_POTION */ -#define SV_POTION_WATER 0 -#define SV_POTION_APPLE_JUICE 1 -#define SV_POTION_SLIME_MOLD 2 -/* xxx (fixed color) */ -#define SV_POTION_SLOWNESS 4 -#define SV_POTION_SALT_WATER 5 -#define SV_POTION_POISON 6 -#define SV_POTION_BLINDNESS 7 -/* xxx */ -#define SV_POTION_BOOZE 9 -/* xxx */ -#define SV_POTION_SLEEP 11 -/* xxx */ -#define SV_POTION_LOSE_MEMORIES 13 -/* xxx */ -#define SV_POTION_RUINATION 15 -#define SV_POTION_DEC_STR 16 -#define SV_POTION_DEC_INT 17 -#define SV_POTION_DEC_WIS 18 -#define SV_POTION_DEC_DEX 19 -#define SV_POTION_DEC_CON 20 -#define SV_POTION_DEC_CHR 21 -#define SV_POTION_DETONATIONS 22 -#define SV_POTION_DEATH 23 -#define SV_POTION_INFRAVISION 24 -#define SV_POTION_DETECT_INVIS 25 -#define SV_POTION_SLOW_POISON 26 -#define SV_POTION_CURE_POISON 27 -#define SV_POTION_BOLDNESS 28 -#define SV_POTION_SPEED 29 -#define SV_POTION_RESIST_HEAT 30 -#define SV_POTION_RESIST_COLD 31 -#define SV_POTION_HEROISM 32 -#define SV_POTION_BESERK_STRENGTH 33 -#define SV_POTION_CURE_LIGHT 34 -#define SV_POTION_CURE_SERIOUS 35 -#define SV_POTION_CURE_CRITICAL 36 -#define SV_POTION_HEALING 37 -#define SV_POTION_STAR_HEALING 38 -#define SV_POTION_LIFE 39 -#define SV_POTION_RESTORE_MANA 40 -#define SV_POTION_RESTORE_EXP 41 -#define SV_POTION_RES_STR 42 -#define SV_POTION_RES_INT 43 -#define SV_POTION_RES_WIS 44 -#define SV_POTION_RES_DEX 45 -#define SV_POTION_RES_CON 46 -#define SV_POTION_RES_CHR 47 -#define SV_POTION_INC_STR 48 -#define SV_POTION_INC_INT 49 -#define SV_POTION_INC_WIS 50 -#define SV_POTION_INC_DEX 51 -#define SV_POTION_INC_CON 52 -#define SV_POTION_INC_CHR 53 -/* xxx */ -#define SV_POTION_AUGMENTATION 55 -#define SV_POTION_ENLIGHTENMENT 56 -#define SV_POTION_STAR_ENLIGHTENMENT 57 -#define SV_POTION_SELF_KNOWLEDGE 58 -#define SV_POTION_EXPERIENCE 59 -#define SV_POTION_RESISTANCE 60 -#define SV_POTION_CURING 61 -#define SV_POTION_INVULNERABILITY 62 -#define SV_POTION_NEW_LIFE 63 -#define SV_POTION_NEO_TSUYOSHI 64 -#define SV_POTION_TSUYOSHI 65 -#define SV_POTION_POLYMORPH 66 - /* The "sval" codes for TV_FOOD */ #define SV_FOOD_POISON 0 #define SV_FOOD_BLINDNESS 1 diff --git a/src/object/sv-potion-types.h b/src/object/sv-potion-types.h new file mode 100644 index 000000000..b0285d972 --- /dev/null +++ b/src/object/sv-potion-types.h @@ -0,0 +1,72 @@ +#pragma once + +/* The "sval" codes for TV_POTION */ +typedef enum sv_potion_type { + SV_POTION_WATER = 0, + SV_POTION_APPLE_JUICE = 1, + SV_POTION_SLIME_MOLD = 2, + /* xxx (fixed color) */ + SV_POTION_SLOWNESS = 4, + SV_POTION_SALT_WATER = 5, + SV_POTION_POISON = 6, + SV_POTION_BLINDNESS = 7, + /* xxx */ + SV_POTION_BOOZE = 9, + /* xxx */ + SV_POTION_SLEEP = 11, + /* xxx */ + SV_POTION_LOSE_MEMORIES = 13, + /* xxx */ + SV_POTION_RUINATION = 15, + SV_POTION_DEC_STR = 16, + SV_POTION_DEC_INT = 17, + SV_POTION_DEC_WIS = 18, + SV_POTION_DEC_DEX = 19, + SV_POTION_DEC_CON = 20, + SV_POTION_DEC_CHR = 21, + SV_POTION_DETONATIONS = 22, + SV_POTION_DEATH = 23, + SV_POTION_INFRAVISION = 24, + SV_POTION_DETECT_INVIS = 25, + SV_POTION_SLOW_POISON = 26, + SV_POTION_CURE_POISON = 27, + SV_POTION_BOLDNESS = 28, + SV_POTION_SPEED = 29, + SV_POTION_RESIST_HEAT = 30, + SV_POTION_RESIST_COLD = 31, + SV_POTION_HEROISM = 32, + SV_POTION_BESERK_STRENGTH = 33, + SV_POTION_CURE_LIGHT = 34, + SV_POTION_CURE_SERIOUS = 35, + SV_POTION_CURE_CRITICAL = 36, + SV_POTION_HEALING = 37, + SV_POTION_STAR_HEALING = 38, + SV_POTION_LIFE = 39, + SV_POTION_RESTORE_MANA = 40, + SV_POTION_RESTORE_EXP = 41, + SV_POTION_RES_STR = 42, + SV_POTION_RES_INT = 43, + SV_POTION_RES_WIS = 44, + SV_POTION_RES_DEX = 45, + SV_POTION_RES_CON = 46, + SV_POTION_RES_CHR = 47, + SV_POTION_INC_STR = 48, + SV_POTION_INC_INT = 49, + SV_POTION_INC_WIS = 50, + SV_POTION_INC_DEX = 51, + SV_POTION_INC_CON = 52, + SV_POTION_INC_CHR = 53, + /* xxx */ + SV_POTION_AUGMENTATION = 55, + SV_POTION_ENLIGHTENMENT = 56, + SV_POTION_STAR_ENLIGHTENMENT = 57, + SV_POTION_SELF_KNOWLEDGE = 58, + SV_POTION_EXPERIENCE = 59, + SV_POTION_RESISTANCE = 60, + SV_POTION_CURING = 61, + SV_POTION_INVULNERABILITY = 62, + SV_POTION_NEW_LIFE = 63, + SV_POTION_NEO_TSUYOSHI = 64, + SV_POTION_TSUYOSHI = 65, + SV_POTION_POLYMORPH = 66, +} sv_potion_type; diff --git a/src/store/store-util.c b/src/store/store-util.c index ead56761b..8f2be7801 100644 --- a/src/store/store-util.c +++ b/src/store/store-util.c @@ -6,6 +6,7 @@ #include "object/object-kind.h" #include "object/tr-types.h" #include "object/special-object-flags.h" +#include "object/sv-potion-types.h" #include "object/sv-weapon-types.h" int cur_store_num = 0; -- 2.11.0