From a932e29658e6fef6e587c0675a32a64f89783eca Mon Sep 17 00:00:00 2001 From: Hourier Date: Sat, 27 Jun 2020 12:26:44 +0900 Subject: [PATCH] [Refactor] #37353 Adjusted inclusion relationship in market/, monster-attack/, monster/, player/ and realm/ --- src/market/building-util.c | 3 +- src/market/building-util.h | 2 + src/market/gold-magnification-table.c | 3 +- src/market/gold-magnification-table.h | 2 + src/monster-attack/insults-moans.c | 3 +- src/monster-attack/insults-moans.h | 2 + src/monster-attack/monster-attack-types.c | 3 +- src/monster-attack/monster-attack-types.h | 2 + src/monster/horror-descriptions.c | 1 - src/monster/horror-descriptions.h | 2 + src/player/avatar.c | 1 - src/player/avatar.h | 20 ++++---- src/player/player-skill.c | 3 +- src/player/player-skill.h | 78 +++++++++++++++---------------- src/realm/realm-names-table.c | 3 +- src/realm/realm-names-table.h | 2 + 16 files changed, 68 insertions(+), 62 deletions(-) diff --git a/src/market/building-util.c b/src/market/building-util.c index 681ec5131..3b309fc3c 100644 --- a/src/market/building-util.c +++ b/src/market/building-util.c @@ -1,5 +1,4 @@ -#include "system/angband.h" -#include "market/building-util.h" +#include "market/building-util.h" #include "term/screen-processor.h" /*! diff --git a/src/market/building-util.h b/src/market/building-util.h index 264bd016a..e14e2fc7d 100644 --- a/src/market/building-util.h +++ b/src/market/building-util.h @@ -1,4 +1,6 @@ #pragma once +#include "system/angband.h" + void clear_bldg(int min_row, int max_row); void building_prt_gold(player_type *player_ptr); diff --git a/src/market/gold-magnification-table.c b/src/market/gold-magnification-table.c index 5140f2d69..1d3e01900 100644 --- a/src/market/gold-magnification-table.c +++ b/src/market/gold-magnification-table.c @@ -1,5 +1,4 @@ -#include "system/angband.h" -#include "market/gold-magnification-table.h" +#include "market/gold-magnification-table.h" /* * Buying and selling adjustments for race combinations. diff --git a/src/market/gold-magnification-table.h b/src/market/gold-magnification-table.h index 79c930cd0..546292e1c 100644 --- a/src/market/gold-magnification-table.h +++ b/src/market/gold-magnification-table.h @@ -1,3 +1,5 @@ #pragma once +#include "system/angband.h" + byte rgold_adj[MAX_RACES][MAX_RACES]; diff --git a/src/monster-attack/insults-moans.c b/src/monster-attack/insults-moans.c index 6fbd9a5ba..57a109bae 100644 --- a/src/monster-attack/insults-moans.c +++ b/src/monster-attack/insults-moans.c @@ -1,5 +1,4 @@ -#include "system/angband.h" -#include "monster-attack/insults-moans.h" +#include "monster-attack/insults-moans.h" /*! モンスターの侮辱行為メッセージテーブル / Hack -- possible "insult" messages */ concptr desc_insult[MAX_INSULTS] = { diff --git a/src/monster-attack/insults-moans.h b/src/monster-attack/insults-moans.h index d53ad1c41..a52e5ae5d 100644 --- a/src/monster-attack/insults-moans.h +++ b/src/monster-attack/insults-moans.h @@ -1,5 +1,7 @@ #pragma once +#include "system/angband.h" + #define MAX_INSULTS 10 #define MAX_MOANS 4 diff --git a/src/monster-attack/monster-attack-types.c b/src/monster-attack/monster-attack-types.c index ca6ab4017..962c1b9c7 100644 --- a/src/monster-attack/monster-attack-types.c +++ b/src/monster-attack/monster-attack-types.c @@ -1,5 +1,4 @@ -#include "system/angband.h" -#include "monster-attack/monster-attack-types.h" +#include "monster-attack/monster-attack-types.h" #include "spell/spell-types.h" /*! diff --git a/src/monster-attack/monster-attack-types.h b/src/monster-attack/monster-attack-types.h index 85ad40c03..555266ad8 100644 --- a/src/monster-attack/monster-attack-types.h +++ b/src/monster-attack/monster-attack-types.h @@ -1,5 +1,7 @@ #pragma once +#include "system/angband.h" + /*! * @note モンスターの打撃方法 / New monster blow methods * 打撃の種別に応じて傷と朦朧が発生するかがコメントの通りに決まる diff --git a/src/monster/horror-descriptions.c b/src/monster/horror-descriptions.c index 53dc32944..f549ffaae 100644 --- a/src/monster/horror-descriptions.c +++ b/src/monster/horror-descriptions.c @@ -7,7 +7,6 @@ * いくら増やしてもよいが、horror_desc_evil とhorror_desc_neutralの個数は同一にすること */ -#include "system/angband.h" #include "monster/horror-descriptions.h" /*! diff --git a/src/monster/horror-descriptions.h b/src/monster/horror-descriptions.h index f6f5f27e5..e6fb56eb5 100644 --- a/src/monster/horror-descriptions.h +++ b/src/monster/horror-descriptions.h @@ -1,5 +1,7 @@ #pragma once +#include "system/angband.h" + /* ELDRITCH_HORRORによるsanity blast処理に関するメッセージの最大数 / Number of entries in the sanity-blast descriptions */ #define MAX_SAN_HORROR_SUM 20 /*!< 恐ろしい対象の形容数(合計) */ #define MAX_SAN_HORROR_COMMON 5 /*!< 恐ろしい対象の形容数(正常時、邪悪・中立共通) */ diff --git a/src/player/avatar.c b/src/player/avatar.c index dbc108fd7..951b31447 100644 --- a/src/player/avatar.c +++ b/src/player/avatar.c @@ -13,7 +13,6 @@ included in all such copies. */ -#include "system/angband.h" #include "player/avatar.h" #include "realm/realm-names-table.h" #include "player/player-race-types.h" diff --git a/src/player/avatar.h b/src/player/avatar.h index 817212dd8..b5719c274 100644 --- a/src/player/avatar.h +++ b/src/player/avatar.h @@ -1,4 +1,7 @@ -/* avatar.c */ +#pragma once + +#include "system/angband.h" + #define MAX_VIRTUE 18 /*!< 徳定義の最大数 */ #define V_COMPASSION 1 @@ -22,10 +25,11 @@ #define VIRTUE_LARGE 1 #define VIRTUE_SMALL 2 -extern bool compare_virtue(player_type *creature_ptr, int type, int num, int tekitou); -extern int virtue_number(player_type *creature_ptr, int type); -extern concptr virtue[MAX_VIRTUE]; -extern void get_virtues(player_type *creature_ptr); -extern void chg_virtue(player_type *creature_ptr, int virtue, int amount); -extern void set_virtue(player_type *creature_ptr, int virtue, int amount); -extern void dump_virtues(player_type *creature_ptr, FILE *OutFile); + +bool compare_virtue(player_type *creature_ptr, int type, int num, int tekitou); +int virtue_number(player_type *creature_ptr, int type); +concptr virtue[MAX_VIRTUE]; +void get_virtues(player_type *creature_ptr); +void chg_virtue(player_type *creature_ptr, int virtue, int amount); +void set_virtue(player_type *creature_ptr, int virtue, int amount); +void dump_virtues(player_type *creature_ptr, FILE *OutFile); diff --git a/src/player/player-skill.c b/src/player/player-skill.c index 1e2e6286f..6a52eebb1 100644 --- a/src/player/player-skill.c +++ b/src/player/player-skill.c @@ -1,5 +1,4 @@ -#include "system/angband.h" -#include "player/player-skill.h" +#include "player/player-skill.h" /* * The skill table diff --git a/src/player/player-skill.h b/src/player/player-skill.h index 22445f150..a2fa9b77e 100644 --- a/src/player/player-skill.h +++ b/src/player/player-skill.h @@ -1,53 +1,51 @@ #pragma once +#include "system/angband.h" + +#define GINOU_SUDE 0 +#define GINOU_NITOURYU 1 +#define GINOU_RIDING 2 +#define GINOU_SHIELD 3 +#define GINOU_TEMPMAX 4 + +/* Proficiency level */ +#define EXP_LEVEL_UNSKILLED 0 +#define EXP_LEVEL_BEGINNER 1 +#define EXP_LEVEL_SKILLED 2 +#define EXP_LEVEL_EXPERT 3 +#define EXP_LEVEL_MASTER 4 + +/* Proficiency of weapons and misc. skills (except riding) */ +#define WEAPON_EXP_UNSKILLED 0 +#define WEAPON_EXP_BEGINNER 4000 +#define WEAPON_EXP_SKILLED 6000 +#define WEAPON_EXP_EXPERT 7000 +#define WEAPON_EXP_MASTER 8000 + +/* Proficiency of riding */ +#define RIDING_EXP_UNSKILLED 0 +#define RIDING_EXP_BEGINNER 500 +#define RIDING_EXP_SKILLED 2000 +#define RIDING_EXP_EXPERT 5000 +#define RIDING_EXP_MASTER 8000 + +/* Proficiency of spells */ +#define SPELL_EXP_UNSKILLED 0 +#define SPELL_EXP_BEGINNER 900 +#define SPELL_EXP_SKILLED 1200 +#define SPELL_EXP_EXPERT 1400 +#define SPELL_EXP_MASTER 1600 + extern const concptr exp_level_str[5]; /* * Information about "skill" */ - -typedef struct skill_table skill_table; - -struct skill_table -{ +typedef struct skill_table { SUB_EXP w_start[5][64]; /* start weapon exp */ SUB_EXP w_max[5][64]; /* max weapon exp */ SUB_EXP s_start[10]; /* start skill */ SUB_EXP s_max[10]; /* max skill */ -}; +} skill_table; extern skill_table *s_info; - -#define GINOU_SUDE 0 -#define GINOU_NITOURYU 1 -#define GINOU_RIDING 2 -#define GINOU_SHIELD 3 -#define GINOU_TEMPMAX 4 - -/* Proficiency level */ -#define EXP_LEVEL_UNSKILLED 0 -#define EXP_LEVEL_BEGINNER 1 -#define EXP_LEVEL_SKILLED 2 -#define EXP_LEVEL_EXPERT 3 -#define EXP_LEVEL_MASTER 4 - -/* Proficiency of weapons and misc. skills (except riding) */ -#define WEAPON_EXP_UNSKILLED 0 -#define WEAPON_EXP_BEGINNER 4000 -#define WEAPON_EXP_SKILLED 6000 -#define WEAPON_EXP_EXPERT 7000 -#define WEAPON_EXP_MASTER 8000 - -/* Proficiency of riding */ -#define RIDING_EXP_UNSKILLED 0 -#define RIDING_EXP_BEGINNER 500 -#define RIDING_EXP_SKILLED 2000 -#define RIDING_EXP_EXPERT 5000 -#define RIDING_EXP_MASTER 8000 - -/* Proficiency of spells */ -#define SPELL_EXP_UNSKILLED 0 -#define SPELL_EXP_BEGINNER 900 -#define SPELL_EXP_SKILLED 1200 -#define SPELL_EXP_EXPERT 1400 -#define SPELL_EXP_MASTER 1600 diff --git a/src/realm/realm-names-table.c b/src/realm/realm-names-table.c index a964a573c..b9ff10849 100644 --- a/src/realm/realm-names-table.c +++ b/src/realm/realm-names-table.c @@ -1,5 +1,4 @@ -#include "system/angband.h" -#include "realm/realm-names-table.h" +#include "realm/realm-names-table.h" #ifdef JP /*! diff --git a/src/realm/realm-names-table.h b/src/realm/realm-names-table.h index e2af7cb3f..4402f8e2d 100644 --- a/src/realm/realm-names-table.h +++ b/src/realm/realm-names-table.h @@ -1,6 +1,8 @@ #pragma once +#include "system/angband.h" #include "realm/realm-types.h" + #define VALID_REALM (MAX_REALM + MAX_MAGIC - MIN_TECHNIC + 1) #define is_magic(A) ((((A) > REALM_NONE) && ((A) < MAX_MAGIC + 1)) ? TRUE : FALSE) -- 2.11.0