From cfe654ae13c779d29f605de80a74edc57535614f Mon Sep 17 00:00:00 2001 From: deskull Date: Sat, 1 Jun 2019 18:19:06 +0900 Subject: [PATCH] =?utf8?q?[Refactor]=20#37353=20=E8=81=B7=E6=A5=ADID?= =?utf8?q?=E5=AE=9A=E7=BE=A9=E3=82=92=20player-class.h=20=E3=81=B8?= =?utf8?q?=E7=A7=BB=E5=8B=95=EF=BC=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/artifact.c | 1 + src/avatar.c | 1 + src/bldg.c | 3 ++- src/chest.c | 1 + src/cmd-activate.c | 1 + src/cmd-basic.c | 1 + src/cmd-eat.c | 1 + src/cmd-item.c | 1 + src/cmd-quaff.c | 1 + src/cmd-read.c | 1 + src/cmd-usestaff.c | 1 + src/cmd-zaprod.c | 1 + src/cmd-zapwand.c | 1 + src/defines.h | 32 -------------------------------- src/floor-save.c | 1 + src/grid.c | 1 + src/melee1.c | 1 + src/monster1.c | 1 + src/monster2.c | 1 + src/mspells1.c | 1 + src/mspells2.c | 1 + src/mspells4.c | 1 + src/mutation.c | 1 + src/object-flavor.c | 1 + src/object1.c | 1 + src/object2.c | 1 + src/patron.c | 1 + src/player-class.h | 35 ++++++++++++++++++++++++++++++++++- src/player-damage.c | 1 + src/player-move.c | 1 + src/racial.c | 1 + src/realm-crusade.c | 1 + src/realm-trump.c | 1 + src/selfinfo.c | 1 + src/shoot.c | 1 + src/spells-diceroll.c | 1 + src/spells-status.c | 1 + src/spells1.c | 1 + src/spells2.c | 1 + src/store.c | 1 + src/trap.c | 1 + src/util.c | 1 + src/warning.c | 1 + src/wizard2.c | 1 + 44 files changed, 77 insertions(+), 34 deletions(-) diff --git a/src/artifact.c b/src/artifact.c index cee9d96e9..c1604cea3 100644 --- a/src/artifact.c +++ b/src/artifact.c @@ -31,6 +31,7 @@ #include "grid.h" #include "monster.h" #include "view-mainwindow.h" +#include "player-class.h" /* * The artifact arrays diff --git a/src/avatar.c b/src/avatar.c index 4fabcc210..f2042a418 100644 --- a/src/avatar.c +++ b/src/avatar.c @@ -17,6 +17,7 @@ #include "avatar.h" #include "realm.h" #include "player-race.h" +#include "player-class.h" /*! * 徳の名称 / The names of the virtues diff --git a/src/bldg.c b/src/bldg.c index f5aeb3661..cb18dda54 100644 --- a/src/bldg.c +++ b/src/bldg.c @@ -41,14 +41,15 @@ #include "artifact.h" #include "cmd-spell.h" #include "rumor.h" -#include "player-status.h" #include "spells.h" #include "spells-status.h" #include "realm-hex.h" #include "dungeon-file.h" #include "files.h" +#include "player-status.h" #include "player-effects.h" +#include "player-class.h" #include "scores.h" #include "shoot.h" #include "view-mainwindow.h" diff --git a/src/chest.c b/src/chest.c index 4e8d5f5b9..c8dd9c5ec 100644 --- a/src/chest.c +++ b/src/chest.c @@ -8,6 +8,7 @@ #include "trap.h" #include "player-status.h" #include "player-effects.h" +#include "player-class.h" #include "grid.h" #include "realm-song.h" diff --git a/src/cmd-activate.c b/src/cmd-activate.c index e38c51a5d..ff07959de 100644 --- a/src/cmd-activate.c +++ b/src/cmd-activate.c @@ -32,6 +32,7 @@ #include "targeting.h" #include "realm-song.h" #include "player-race.h" +#include "player-class.h" #include "view-mainwindow.h" /*! diff --git a/src/cmd-basic.c b/src/cmd-basic.c index 4316073b9..ff9fc2ea2 100644 --- a/src/cmd-basic.c +++ b/src/cmd-basic.c @@ -40,6 +40,7 @@ #include "feature.h" #include "player-move.h" #include "player-effects.h" +#include "player-class.h" #include "objectkind.h" #include "object-broken.h" #include "object-flavor.h" diff --git a/src/cmd-eat.c b/src/cmd-eat.c index c1ecf546e..ab9912868 100644 --- a/src/cmd-eat.c +++ b/src/cmd-eat.c @@ -18,6 +18,7 @@ #include "player-status.h" #include "player-effects.h" #include "player-race.h" +#include "player-class.h" #include "floor.h" #include "objectkind.h" #include "realm.h" diff --git a/src/cmd-item.c b/src/cmd-item.c index 756845069..ffdc0e464 100644 --- a/src/cmd-item.c +++ b/src/cmd-item.c @@ -37,6 +37,7 @@ #include "avatar.h" #include "player-status.h" #include "player-effects.h" +#include "player-class.h" #include "monster.h" #include "view-mainwindow.h" #include "spells.h" diff --git a/src/cmd-quaff.c b/src/cmd-quaff.c index 501cbb1b2..5d8eb63c6 100644 --- a/src/cmd-quaff.c +++ b/src/cmd-quaff.c @@ -27,6 +27,7 @@ #include "floor.h" #include "objectkind.h" #include "view-mainwindow.h" +#include "player-class.h" /*! * @brief 薬を飲むコマンドのサブルーチン / diff --git a/src/cmd-read.c b/src/cmd-read.c index 7ec84c09f..300a9baeb 100644 --- a/src/cmd-read.c +++ b/src/cmd-read.c @@ -15,6 +15,7 @@ #include "avatar.h" #include "player-status.h" #include "player-effects.h" +#include "player-class.h" #include "rumor.h" #include "realm-hex.h" diff --git a/src/cmd-usestaff.c b/src/cmd-usestaff.c index 8a21324e0..b7bf0b888 100644 --- a/src/cmd-usestaff.c +++ b/src/cmd-usestaff.c @@ -6,6 +6,7 @@ #include "avatar.h" #include "player-status.h" #include "player-effects.h" +#include "player-class.h" #include "spells.h" #include "spells-status.h" #include "spells-floor.h" diff --git a/src/cmd-zaprod.c b/src/cmd-zaprod.c index d45d4c5c4..8414f43f6 100644 --- a/src/cmd-zaprod.c +++ b/src/cmd-zaprod.c @@ -4,6 +4,7 @@ #include "avatar.h" #include "player-status.h" #include "player-effects.h" +#include "player-class.h" #include "objectkind.h" #include "object-hook.h" #include "spells.h" diff --git a/src/cmd-zapwand.c b/src/cmd-zapwand.c index 394207394..3c1fd421a 100644 --- a/src/cmd-zapwand.c +++ b/src/cmd-zapwand.c @@ -6,6 +6,7 @@ #include "spells-status.h" #include "player-status.h" #include "player-effects.h" +#include "player-class.h" #include "objectkind.h" #include "object-hook.h" #include "cmd-basic.h" diff --git a/src/defines.h b/src/defines.h index 54c79e1d2..c8999a5d8 100644 --- a/src/defines.h +++ b/src/defines.h @@ -181,38 +181,6 @@ #define SEX_MALE 1 -/* - * Player class constants (hard-coded by save-files, arrays, etc) - */ -#define CLASS_WARRIOR 0 -#define CLASS_MAGE 1 -#define CLASS_PRIEST 2 -#define CLASS_ROGUE 3 -#define CLASS_RANGER 4 -#define CLASS_PALADIN 5 -#define CLASS_WARRIOR_MAGE 6 -#define CLASS_CHAOS_WARRIOR 7 -#define CLASS_MONK 8 -#define CLASS_MINDCRAFTER 9 -#define CLASS_HIGH_MAGE 10 -#define CLASS_TOURIST 11 -#define CLASS_IMITATOR 12 -#define CLASS_BEASTMASTER 13 -#define CLASS_SORCERER 14 -#define CLASS_ARCHER 15 -#define CLASS_MAGIC_EATER 16 -#define CLASS_BARD 17 -#define CLASS_RED_MAGE 18 -#define CLASS_SAMURAI 19 -#define CLASS_FORCETRAINER 20 -#define CLASS_BLUE_MAGE 21 -#define CLASS_CAVALRY 22 -#define CLASS_BERSERKER 23 -#define CLASS_SMITH 24 -#define CLASS_MIRROR_MASTER 25 -#define CLASS_NINJA 26 -#define CLASS_SNIPER 27 - #define SEIKAKU_FUTUU 0 #define SEIKAKU_CHIKARA 1 #define SEIKAKU_KIREMONO 2 diff --git a/src/floor-save.c b/src/floor-save.c index ad2400f93..4a8163e8f 100644 --- a/src/floor-save.c +++ b/src/floor-save.c @@ -32,6 +32,7 @@ #include "cmd-basic.h" #include "files.h" #include "player-effects.h" +#include "player-class.h" #include "world.h" #include "spells.h" #include "cmd-dump.h" diff --git a/src/grid.c b/src/grid.c index 7b9e49e26..c2df3d0cd 100644 --- a/src/grid.c +++ b/src/grid.c @@ -36,6 +36,7 @@ #include "monster-status.h" #include "player-status.h" #include "player-effects.h" +#include "player-class.h" #include "spells.h" #include "view-mainwindow.h" #include "realm-song.h" diff --git a/src/melee1.c b/src/melee1.c index 5e34b04a4..7247669da 100644 --- a/src/melee1.c +++ b/src/melee1.c @@ -39,6 +39,7 @@ #include "player-damage.h" #include "player-status.h" #include "player-race.h" +#include "player-class.h" #include "view-mainwindow.h" #include "world.h" diff --git a/src/monster1.c b/src/monster1.c index e880bf1c2..4d5bf8617 100644 --- a/src/monster1.c +++ b/src/monster1.c @@ -34,6 +34,7 @@ #include "melee.h" #include "japanese.h" #include "view-mainwindow.h" +#include "player-class.h" /* diff --git a/src/monster2.c b/src/monster2.c index 710306e3c..9c2d8e9d0 100644 --- a/src/monster2.c +++ b/src/monster2.c @@ -28,6 +28,7 @@ #include "player-move.h" #include "player-status.h" #include "player-race.h" +#include "player-class.h" #include "wild.h" #include "warning.h" #include "monster-spell.h" diff --git a/src/mspells1.c b/src/mspells1.c index 51656a1cc..5dbf73815 100644 --- a/src/mspells1.c +++ b/src/mspells1.c @@ -56,6 +56,7 @@ #include "realm-song.h" #include "view-mainwindow.h" #include "player-race.h" +#include "player-class.h" /*! diff --git a/src/mspells2.c b/src/mspells2.c index cb18feaa1..17fd6cd06 100644 --- a/src/mspells2.c +++ b/src/mspells2.c @@ -20,6 +20,7 @@ #include "quest.h" #include "realm-hex.h" #include "player-move.h" +#include "player-class.h" #include "monster.h" #include "monster-status.h" #include "monster-spell.h" diff --git a/src/mspells4.c b/src/mspells4.c index e411b5512..9eb85c6d2 100644 --- a/src/mspells4.c +++ b/src/mspells4.c @@ -14,6 +14,7 @@ #include "spells-summon.h" #include "artifact.h" #include "player-status.h" +#include "player-class.h" #include "realm-hex.h" #include "player-move.h" #include "monster-spell.h" diff --git a/src/mutation.c b/src/mutation.c index 9b2450af1..f923b8604 100644 --- a/src/mutation.c +++ b/src/mutation.c @@ -23,6 +23,7 @@ #include "avatar.h" #include "player-status.h" #include "player-effects.h" +#include "player-class.h" #include "spells-status.h" #include "object-hook.h" #include "spells.h" diff --git a/src/object-flavor.c b/src/object-flavor.c index 26b8137df..77db5be38 100644 --- a/src/object-flavor.c +++ b/src/object-flavor.c @@ -16,6 +16,7 @@ #include "cmd-smith.h" #include "artifact.h" #include "player-status.h" +#include "player-class.h" #include "shoot.h" #include "objectkind.h" #include "object-hook.h" diff --git a/src/object1.c b/src/object1.c index 474f996db..91c556d63 100644 --- a/src/object1.c +++ b/src/object1.c @@ -23,6 +23,7 @@ #include "object-flavor.h" #include "object-hook.h" #include "player-move.h" +#include "player-class.h" #include "monster.h" #include "files.h" #include "term.h" diff --git a/src/object2.c b/src/object2.c index e050f2788..ec3031e67 100644 --- a/src/object2.c +++ b/src/object2.c @@ -36,6 +36,7 @@ #include "player-status.h" #include "player-move.h" #include "player-effects.h" +#include "player-class.h" #include "monster.h" #include "monsterrace-hook.h" #include "object-ego.h" diff --git a/src/patron.c b/src/patron.c index 1b8d3e597..0c3f1beb8 100644 --- a/src/patron.c +++ b/src/patron.c @@ -14,6 +14,7 @@ #include "player-status.h" #include "player-effects.h" #include "player-race.h" +#include "player-class.h" #include "spells.h" #include "spells-summon.h" diff --git a/src/player-class.h b/src/player-class.h index 6390dcfff..b65044b0f 100644 --- a/src/player-class.h +++ b/src/player-class.h @@ -22,10 +22,43 @@ #define CH_HISSATSU 0x10000 #define CH_HEX 0x20000 + + + /* + * Player class constants (hard-coded by save-files, arrays, etc) + */ +#define CLASS_WARRIOR 0 +#define CLASS_MAGE 1 +#define CLASS_PRIEST 2 +#define CLASS_ROGUE 3 +#define CLASS_RANGER 4 +#define CLASS_PALADIN 5 +#define CLASS_WARRIOR_MAGE 6 +#define CLASS_CHAOS_WARRIOR 7 +#define CLASS_MONK 8 +#define CLASS_MINDCRAFTER 9 +#define CLASS_HIGH_MAGE 10 +#define CLASS_TOURIST 11 +#define CLASS_IMITATOR 12 +#define CLASS_BEASTMASTER 13 +#define CLASS_SORCERER 14 +#define CLASS_ARCHER 15 +#define CLASS_MAGIC_EATER 16 +#define CLASS_BARD 17 +#define CLASS_RED_MAGE 18 +#define CLASS_SAMURAI 19 +#define CLASS_FORCETRAINER 20 +#define CLASS_BLUE_MAGE 21 +#define CLASS_CAVALRY 22 +#define CLASS_BERSERKER 23 +#define CLASS_SMITH 24 +#define CLASS_MIRROR_MASTER 25 +#define CLASS_NINJA 26 +#define CLASS_SNIPER 27 + #define IS_WIZARD_CLASS() \ (p_ptr->pclass == CLASS_MAGE || p_ptr->pclass == CLASS_HIGH_MAGE || p_ptr->pclass == CLASS_SORCERER || p_ptr->pclass == CLASS_MAGIC_EATER || p_ptr->pclass == CLASS_BLUE_MAGE) - /* * Information about the player's "magic" * diff --git a/src/player-damage.c b/src/player-damage.c index c1a322d17..be9927cd3 100644 --- a/src/player-damage.c +++ b/src/player-damage.c @@ -9,6 +9,7 @@ #include "object-broken.h" #include "player-status.h" #include "player-effects.h" +#include "player-class.h" #include "monster-spell.h" #include "world.h" #include "view-mainwindow.h" diff --git a/src/player-move.c b/src/player-move.c index 22321e7dd..2d96595eb 100644 --- a/src/player-move.c +++ b/src/player-move.c @@ -155,6 +155,7 @@ #include "player-move.h" #include "player-status.h" #include "player-effects.h" +#include "player-class.h" #include "spells-floor.h" #include "feature.h" #include "warning.h" diff --git a/src/racial.c b/src/racial.c index 023e5ea64..a8850df45 100644 --- a/src/racial.c +++ b/src/racial.c @@ -35,6 +35,7 @@ #include "realm-hex.h" #include "targeting.h" #include "view-mainwindow.h" +#include "player-class.h" /*! * @brief 修行僧の構え設定処理 diff --git a/src/realm-crusade.c b/src/realm-crusade.c index 83db60725..ffaffb6ac 100644 --- a/src/realm-crusade.c +++ b/src/realm-crusade.c @@ -7,6 +7,7 @@ #include "spells.h" #include "spells-summon.h" #include "spells-status.h" +#include "player-class.h" #include "player-effects.h" #include "targeting.h" diff --git a/src/realm-trump.c b/src/realm-trump.c index 3a4496051..48b86b5b7 100644 --- a/src/realm-trump.c +++ b/src/realm-trump.c @@ -7,6 +7,7 @@ #include "spells-summon.h" #include "spells-status.h" #include "player-effects.h" +#include "player-class.h" #include "targeting.h" diff --git a/src/selfinfo.c b/src/selfinfo.c index 797c74e6d..c21bd2652 100644 --- a/src/selfinfo.c +++ b/src/selfinfo.c @@ -19,6 +19,7 @@ #include "player-status.h" #include "player-race.h" +#include "player-class.h" #include "avatar.h" #include "realm.h" #include "realm-hex.h" diff --git a/src/shoot.c b/src/shoot.c index 1c31351d1..c04e50acc 100644 --- a/src/shoot.c +++ b/src/shoot.c @@ -10,6 +10,7 @@ #include "avatar.h" #include "player-status.h" #include "player-skill.h" +#include "player-class.h" #include "object-hook.h" #include "floor.h" #include "grid.h" diff --git a/src/spells-diceroll.c b/src/spells-diceroll.c index 8f2c952c3..ee16ec877 100644 --- a/src/spells-diceroll.c +++ b/src/spells-diceroll.c @@ -4,6 +4,7 @@ #include "monster.h" #include "monsterrace-hook.h" +#include "player-class.h" #include "mutation.h" #include "rooms.h" diff --git a/src/spells-status.c b/src/spells-status.c index d6b7b0521..7c18460a0 100644 --- a/src/spells-status.c +++ b/src/spells-status.c @@ -6,6 +6,7 @@ #include "floor.h" #include "object-flavor.h" #include "player-status.h" +#include "player-class.h" #include "spells-status.h" #include "spells.h" #include "monster.h" diff --git a/src/spells1.c b/src/spells1.c index 2710c48d6..937054c42 100644 --- a/src/spells1.c +++ b/src/spells1.c @@ -24,6 +24,7 @@ #include "player-damage.h" #include "player-effects.h" #include "player-race.h" +#include "player-class.h" #include "monster.h" #include "monster-status.h" diff --git a/src/spells2.c b/src/spells2.c index 0146c2ae7..701ec33be 100644 --- a/src/spells2.c +++ b/src/spells2.c @@ -43,6 +43,7 @@ #include "player-status.h" #include "player-effects.h" #include "player-skill.h" +#include "player-class.h" #include "dungeon.h" #include "floor-events.h" diff --git a/src/store.c b/src/store.c index d2a86be1f..7a3cf4c3c 100644 --- a/src/store.c +++ b/src/store.c @@ -28,6 +28,7 @@ #include "cmd-spell.h" #include "rumor.h" #include "player-status.h" +#include "player-class.h" #include "object-flavor.h" #include "object-hook.h" #include "floor-events.h" diff --git a/src/trap.c b/src/trap.c index 8a87ca21f..fca32fca1 100644 --- a/src/trap.c +++ b/src/trap.c @@ -6,6 +6,7 @@ #include "player-damage.h" #include "player-move.h" #include "player-effects.h" +#include "player-class.h" #include "spells-summon.h" #include "quest.h" #include "artifact.h" diff --git a/src/util.c b/src/util.c index aca90e605..c4367e7a7 100644 --- a/src/util.c +++ b/src/util.c @@ -22,6 +22,7 @@ #include "world.h" #include "cmd-dump.h" #include "japanese.h" +#include "player-class.h" /*! * 10進数から16進数への変換テーブル / diff --git a/src/warning.c b/src/warning.c index 55c115992..5f14bdefd 100644 --- a/src/warning.c +++ b/src/warning.c @@ -15,6 +15,7 @@ #include "object-flavor.h" #include "dungeon.h" #include "player-race.h" +#include "player-class.h" #include "melee.h" #include "realm-song.h" diff --git a/src/wizard2.c b/src/wizard2.c index 9b3399ed2..319aa725b 100644 --- a/src/wizard2.c +++ b/src/wizard2.c @@ -26,6 +26,7 @@ #include "player-status.h" #include "player-effects.h" #include "player-skill.h" +#include "player-class.h" #include "spells.h" #include "spells-object.h" -- 2.11.0