From 596cd9d130fdde67663ba938c1533b5683c18121 Mon Sep 17 00:00:00 2001 From: deskull Date: Wed, 24 Apr 2019 22:10:16 +0900 Subject: [PATCH] =?utf8?q?[Refactor]=20#37353=20player-skill.c/h=20?= =?utf8?q?=E3=82=92=E8=BF=BD=E5=8A=A0=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- Hengband_vcs2017/Hengband/Hengband.vcxproj | 2 ++ Hengband_vcs2017/Hengband/Hengband.vcxproj.filters | 6 ++++ src/Makefile.am | 2 +- src/birth.c | 1 + src/cmd-pet.c | 1 + src/cmd-spell.c | 1 + src/cmd4.c | 1 + src/defines.h | 33 ------------------- src/dungeon-file.c | 1 + src/dungeon.c | 1 + src/externs.h | 2 +- src/files.c | 1 + src/load.c | 1 + src/melee1.c | 5 +-- src/object-hook.c | 1 + src/player-skill.c | 12 +++++++ src/player-skill.h | 38 ++++++++++++++++++++++ src/player-status.c | 3 +- src/realm-hex.c | 1 + src/shoot.c | 1 + src/spells2.c | 1 + src/spells3.c | 1 + src/tables.c | 10 ------ src/types.h | 1 + src/wizard2.c | 1 + 25 files changed, 80 insertions(+), 48 deletions(-) create mode 100644 src/player-skill.c create mode 100644 src/player-skill.h diff --git a/Hengband_vcs2017/Hengband/Hengband.vcxproj b/Hengband_vcs2017/Hengband/Hengband.vcxproj index 3a7041677..cc01e0341 100644 --- a/Hengband_vcs2017/Hengband/Hengband.vcxproj +++ b/Hengband_vcs2017/Hengband/Hengband.vcxproj @@ -171,6 +171,7 @@ + @@ -324,6 +325,7 @@ + diff --git a/Hengband_vcs2017/Hengband/Hengband.vcxproj.filters b/Hengband_vcs2017/Hengband/Hengband.vcxproj.filters index fe277e5ba..c02aa38d6 100644 --- a/Hengband_vcs2017/Hengband/Hengband.vcxproj.filters +++ b/Hengband_vcs2017/Hengband/Hengband.vcxproj.filters @@ -312,6 +312,9 @@ spells + + player + @@ -590,6 +593,9 @@ object + + player + diff --git a/src/Makefile.am b/src/Makefile.am index 9044b48bd..10745070b 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -54,7 +54,7 @@ hengband_SOURCES = \ projection.h projection.c\ \ player-move.c player-move.h player-damage.c player-damage.h player-status.c player-status.h \ - player-effects.c player-effects.h \ + player-effects.c player-effects.h player-skill.c player-skill.h \ \ quest.h quest.c\ \ diff --git a/src/birth.c b/src/birth.c index 49c478643..688222c24 100644 --- a/src/birth.c +++ b/src/birth.c @@ -30,6 +30,7 @@ #include "dungeon-file.h" #include "files.h" #include "birth.h" +#include "player-skill.h" /*! * オートローラーの内容を描画する間隔 / diff --git a/src/cmd-pet.c b/src/cmd-pet.c index eeb758331..f3b9cec36 100644 --- a/src/cmd-pet.c +++ b/src/cmd-pet.c @@ -8,6 +8,7 @@ #include "player-move.h" #include "player-status.h" #include "player-effects.h" +#include "player-skill.h" #include "object-hook.h" #include "monster.h" #include "monster-status.h" diff --git a/src/cmd-spell.c b/src/cmd-spell.c index 571afc1fa..87de89108 100644 --- a/src/cmd-spell.c +++ b/src/cmd-spell.c @@ -29,6 +29,7 @@ #include "avatar.h" #include "player-status.h" #include "player-effects.h" +#include "player-skill.h" #include "object-hook.h" #include "cmd-basic.h" #include "view-mainwindow.h" diff --git a/src/cmd4.c b/src/cmd4.c index ee8b75aae..3b595545b 100644 --- a/src/cmd4.c +++ b/src/cmd4.c @@ -48,6 +48,7 @@ #include "world.h" #include "player-effects.h" #include "player-status.h" +#include "player-skill.h" #include "sort.h" #include "mutation.h" #include "quest.h" diff --git a/src/defines.h b/src/defines.h index 0c6da8122..d336f853c 100644 --- a/src/defines.h +++ b/src/defines.h @@ -2662,41 +2662,8 @@ extern int PlayerUID; #define PARSE_ERROR_UNDEFINED_TERRAIN_TAG 10 #define PARSE_ERROR_MAX 11 -#define GINOU_SUDE 0 -#define GINOU_NITOURYU 1 -#define GINOU_RIDING 2 -#define GINOU_SHIELD 3 -#define GINOU_TEMPMAX 4 #define GINOU_MAX 10 -/* 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 - #define NO_TOWN 6 #define SECRET_TOWN 5 diff --git a/src/dungeon-file.c b/src/dungeon-file.c index 8c0565c79..0525e4969 100644 --- a/src/dungeon-file.c +++ b/src/dungeon-file.c @@ -8,6 +8,7 @@ #include "quest.h" #include "monster.h" #include "files.h" +#include "player-skill.h" dungeon_grid letter[255]; diff --git a/src/dungeon.c b/src/dungeon.c index 01cb003f0..f7414e315 100644 --- a/src/dungeon.c +++ b/src/dungeon.c @@ -59,6 +59,7 @@ #include "monsterrace-hook.h" #include "floor-save.h" #include "feature.h" +#include "player-skill.h" #include "view-mainwindow.h" #include "dungeon-file.h" diff --git a/src/externs.h b/src/externs.h index d8c960307..6e89576fe 100644 --- a/src/externs.h +++ b/src/externs.h @@ -93,7 +93,7 @@ extern const int monk_ave_damage[PY_MAX_LEVEL+1][3]; extern const concptr game_inscriptions[]; extern const kamae kamae_shurui[MAX_KAMAE]; extern const kamae kata_shurui[MAX_KATA]; -extern const concptr exp_level_str[5]; + extern const concptr ident_info[]; extern const mbe_info_type mbe_info[]; diff --git a/src/files.c b/src/files.c index d1d7c353d..2f4fc5cdb 100644 --- a/src/files.c +++ b/src/files.c @@ -46,6 +46,7 @@ #include "dungeon-file.h" #include "init.h" #include "monster-spell.h" +#include "player-skill.h" /* diff --git a/src/load.c b/src/load.c index 9e89a5cd3..e3b8b7dcf 100644 --- a/src/load.c +++ b/src/load.c @@ -65,6 +65,7 @@ #include "cmd-pet.h" #include "dungeon-file.h" #include "files.h" +#include "player-skill.h" /* diff --git a/src/melee1.c b/src/melee1.c index 60befd1b6..f6df731e9 100644 --- a/src/melee1.c +++ b/src/melee1.c @@ -16,14 +16,12 @@ #include "artifact.h" #include "cmd-pet.h" -#include "player-damage.h" #include "monsterrace-hook.h" #include "melee.h" #include "monster.h" #include "monster-status.h" #include "monster-spell.h" #include "avatar.h" -#include "player-status.h" #include "realm-hex.h" #include "object-flavor.h" #include "object-hook.h" @@ -33,6 +31,9 @@ #include "spells.h" #include "files.h" #include "player-effects.h" +#include "player-skill.h" +#include "player-damage.h" +#include "player-status.h" #include "view-mainwindow.h" diff --git a/src/object-hook.c b/src/object-hook.c index 4aee8e881..009be9c0e 100644 --- a/src/object-hook.c +++ b/src/object-hook.c @@ -5,6 +5,7 @@ #include "object-hook.h" #include "monster.h" #include "artifact.h" +#include "player-skill.h" /*! * @brief 対象のアイテムが矢やクロスボウの矢の材料になるかを返す。/ diff --git a/src/player-skill.c b/src/player-skill.c new file mode 100644 index 000000000..db6ddd84e --- /dev/null +++ b/src/player-skill.c @@ -0,0 +1,12 @@ +#include "angband.h" +#include "player-skill.h" + +/*! + * @brief 技能値到達表記テーブル + */ +const concptr exp_level_str[5] = +#ifdef JP +{ "[初心者]", "[入門者]", "[熟練者]", "[エキスパート]", "[達人]" }; +#else +{"[Unskilled]", "[Beginner]", "[Skilled]", "[Expert]", "[Master]"}; +#endif diff --git a/src/player-skill.h b/src/player-skill.h new file mode 100644 index 000000000..1012a5d9d --- /dev/null +++ b/src/player-skill.h @@ -0,0 +1,38 @@ +#pragma once + +extern const concptr exp_level_str[5]; + +#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/player-status.c b/src/player-status.c index 50f115d7c..4a8c55e72 100644 --- a/src/player-status.c +++ b/src/player-status.c @@ -3,6 +3,8 @@ #include "player-move.h" #include "player-status.h" +#include "player-effects.h" +#include "player-skill.h" #include "floor.h" #include "floor-events.h" #include "feature.h" @@ -19,7 +21,6 @@ #include "realm-hex.h" #include "cmd-pet.h" #include "cmd-spell.h" -#include "player-effects.h" /*! * @var horror_desc diff --git a/src/realm-hex.c b/src/realm-hex.c index 8ae967539..1d9d2b04b 100644 --- a/src/realm-hex.c +++ b/src/realm-hex.c @@ -28,6 +28,7 @@ #include "spells.h" #include "player-status.h" #include "player-effects.h" +#include "player-skill.h" #include "realm-hex.h" #include "grid.h" diff --git a/src/shoot.c b/src/shoot.c index b74c4c298..8abb8c5ef 100644 --- a/src/shoot.c +++ b/src/shoot.c @@ -7,6 +7,7 @@ #include "artifact.h" #include "avatar.h" #include "player-status.h" +#include "player-skill.h" #include "object-hook.h" #include "floor.h" #include "grid.h" diff --git a/src/spells2.c b/src/spells2.c index ca5f5c2be..6174ff938 100644 --- a/src/spells2.c +++ b/src/spells2.c @@ -36,6 +36,7 @@ #include "player-move.h" #include "player-status.h" #include "player-effects.h" +#include "player-skill.h" #include "floor-events.h" #include "feature.h" diff --git a/src/spells3.c b/src/spells3.c index 1985af1eb..d54c9fea5 100644 --- a/src/spells3.c +++ b/src/spells3.c @@ -37,6 +37,7 @@ #include "floor-save.h" #include "files.h" #include "player-effects.h" +#include "player-skill.h" #include "view-mainwindow.h" #include "mind.h" #include "wild.h" diff --git a/src/tables.c b/src/tables.c index dab05cf00..d25f95e54 100644 --- a/src/tables.c +++ b/src/tables.c @@ -3819,16 +3819,6 @@ const kamae kata_shurui[MAX_KATA] = #endif }; -/*! - * @brief 技能値到達表記テーブル - */ -const concptr exp_level_str[5]= -#ifdef JP -{"[初心者]", "[入門者]", "[熟練者]", "[エキスパート]", "[達人]"}; -#else -{"[Unskilled]", "[Beginner]", "[Skilled]", "[Expert]", "[Master]"}; -#endif - /*! * @brief シンボル解説テーブル / diff --git a/src/types.h b/src/types.h index fac24cf64..e64912eca 100644 --- a/src/types.h +++ b/src/types.h @@ -47,6 +47,7 @@ #include "h-type.h" #include "defines.h" +//#include "player-skill.h" /*! * @struct feature_state diff --git a/src/wizard2.c b/src/wizard2.c index 89a8b710e..dbcb8a47f 100644 --- a/src/wizard2.c +++ b/src/wizard2.c @@ -20,6 +20,7 @@ #include "artifact.h" #include "player-status.h" #include "player-effects.h" +#include "player-skill.h" #include "spells.h" #include "spells-object.h" -- 2.11.0