From b7c355192067ac1b9be7a75d79ce9d36253ef932 Mon Sep 17 00:00:00 2001 From: Deskull Date: Sun, 23 Dec 2018 17:54:13 +0900 Subject: [PATCH] =?utf8?q?[Refactor]=20#37481=20melee.h=E3=82=92=E5=AE=9A?= =?utf8?q?=E7=BE=A9=E3=80=82=20\=20Add=20melee.h.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- Hengband_vcs2017/Hengband/Hengband.vcxproj | 1 + src/Makefile.am | 3 ++- src/bldg.c | 2 ++ src/cmd-pet.c | 1 + src/cmd1.c | 1 + src/cmd2.c | 4 +--- src/externs.h | 7 ------- src/melee1.c | 9 --------- src/mind.c | 3 +-- src/monster-process.c | 1 + src/racial.c | 2 +- src/realm-hissatsu.c | 1 + src/spells1.c | 1 + src/spells2.c | 1 + src/spells3.c | 1 + 15 files changed, 15 insertions(+), 23 deletions(-) diff --git a/Hengband_vcs2017/Hengband/Hengband.vcxproj b/Hengband_vcs2017/Hengband/Hengband.vcxproj index 006ed9d91..f67a20e22 100644 --- a/Hengband_vcs2017/Hengband/Hengband.vcxproj +++ b/Hengband_vcs2017/Hengband/Hengband.vcxproj @@ -275,6 +275,7 @@ + diff --git a/src/Makefile.am b/src/Makefile.am index f84e01d63..161b5e617 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -17,7 +17,8 @@ hengband_SOURCES = \ generate.h grid.c grid.h h-basic.h h-config.h h-define.h hissatsu.c \ history.h history.c \ h-system.h h-type.h inet.c init1.c init2.c init.h japanese.c load.c \ - main.c main-x11.c main-gcu.c mane.c melee1.c mind.c \ + main.c main-x11.c main-gcu.c mane.c \ + melee.h melee1.c mind.c \ monsterrace-hook.c monsterrace-hook.h monster-process.c \ monster-process.h monster-status.c monster-status.h monster1.c \ monster2.c mspells1.c mspells2.c mspells3.c mspells4.c mutation.c \ diff --git a/src/bldg.c b/src/bldg.c index 7cc9c92af..82f179812 100644 --- a/src/bldg.c +++ b/src/bldg.c @@ -14,6 +14,8 @@ #include "angband.h" #include "object-hook.h" +#include "melee.h" + /*! * ループ中で / hack as in leave_store in store.c diff --git a/src/cmd-pet.c b/src/cmd-pet.c index d74baff0e..4c2dea2b7 100644 --- a/src/cmd-pet.c +++ b/src/cmd-pet.c @@ -1,4 +1,5 @@ #include "angband.h" +#include "melee.h" /*! * @brief プレイヤーの騎乗/下馬処理判定 diff --git a/src/cmd1.c b/src/cmd1.c index 5efc9be34..415107e9d 100644 --- a/src/cmd1.c +++ b/src/cmd1.c @@ -140,6 +140,7 @@ */ #include "angband.h" +#include "melee.h" #include "trap.h" diff --git a/src/cmd2.c b/src/cmd2.c index dd1acac8e..8bb63afd5 100644 --- a/src/cmd2.c +++ b/src/cmd2.c @@ -12,6 +12,7 @@ #include "angband.h" #include "chest.h" +#include "melee.h" #include "object-hook.h" /*! @@ -806,10 +807,7 @@ void do_cmd_open(void) else if (c_ptr->m_idx && p_ptr->riding != c_ptr->m_idx) { p_ptr->energy_use = 100; - msg_print(_("モンスターが立ちふさがっている!", "There is a monster in the way!")); - - /* Attack */ py_attack(y, x, 0); } diff --git a/src/externs.h b/src/externs.h index 66583b2aa..c639cc220 100644 --- a/src/externs.h +++ b/src/externs.h @@ -522,7 +522,6 @@ extern bool cave_monster_teleportable_bold(MONSTER_IDX m_idx, POSITION y, POSITI extern bool cave_player_teleportable_bold(POSITION y, POSITION x, BIT_FLAGS mode); /* cmd1.c */ -extern bool test_hit_norm(int chance, ARMOUR_CLASS ac, int vis); extern HIT_POINT critical_shot(WEIGHT weight, int plus_ammo, int plus_bow, HIT_POINT dam); extern HIT_POINT tot_dam_aux(object_type *o_ptr, HIT_POINT tdam, monster_type *m_ptr, BIT_FLAGS mode, bool thrown); extern void search(void); @@ -697,14 +696,8 @@ extern cptr get_check_sum(void); extern errr rd_savefile_new(void); extern bool load_floor(saved_floor_type *sf_ptr, BIT_FLAGS mode); -/* melee1.c */ -PERCENTAGE hit_chance(HIT_PROB to_h, ARMOUR_CLASS ac); - /* monster-process.c */ extern bool test_hit_fire(int chance, monster_type *m_ptr, int vis, char* o_name); -extern HIT_POINT critical_norm(WEIGHT weight, int plus, HIT_POINT dam, s16b meichuu, BIT_FLAGS mode); -extern bool py_attack(POSITION y, POSITION x, BIT_FLAGS mode); -extern bool make_attack_normal(MONSTER_IDX m_idx); extern void process_monsters(void); extern void process_monster(MONSTER_IDX m_idx); extern int get_mproc_idx(MONSTER_IDX m_idx, int mproc_type); diff --git a/src/melee1.c b/src/melee1.c index 30846f880..cd44772f9 100644 --- a/src/melee1.c +++ b/src/melee1.c @@ -207,8 +207,6 @@ static int check_hit(int power, DEPTH level, int stun) return (FALSE); } - - /*! モンスターの侮辱行為メッセージテーブル / Hack -- possible "insult" messages */ static cptr desc_insult[] = { @@ -238,7 +236,6 @@ static cptr desc_insult[] = }; - /*! マゴットのぼやきメッセージテーブル / Hack -- possible "insult" messages */ static cptr desc_moan[] = { @@ -256,7 +253,6 @@ static cptr desc_moan[] = }; - /*! * @brief 敵オーラによるプレイヤーのダメージ処理(補助) * @param m_ptr オーラを持つモンスターの構造体参照ポインタ @@ -294,9 +290,6 @@ static void touch_zap_player_aux(monster_type *m_ptr, bool immune, int flags_off } } - - - /*! * @brief 敵オーラによるプレイヤーのダメージ処理(メイン) * @param m_ptr オーラを持つモンスターの構造体参照ポインタ @@ -1340,7 +1333,6 @@ static void py_attack_aux(POSITION y, POSITION x, bool *fear, bool *mdeath, s16b } } - /*! * @brief プレイヤーの打撃処理メインルーチン * @param y 攻撃目標のY座標 @@ -1535,7 +1527,6 @@ bool py_attack(POSITION y, POSITION x, BIT_FLAGS mode) return mdeath; } - /*! * @brief モンスターからプレイヤーへの打撃処理 / Attack the player via physical attacks. * @param m_idx 打撃を行うモンスターのID diff --git a/src/mind.c b/src/mind.c index ac8cf2f0f..76daf0c8f 100644 --- a/src/mind.c +++ b/src/mind.c @@ -14,9 +14,8 @@ * 特殊技能を揃えて実装している。 */ - - #include "angband.h" +#include "melee.h" /*! 特殊技能の一覧テーブル */ mind_power const mind_powers[5] = diff --git a/src/monster-process.c b/src/monster-process.c index b0701640d..e583a8a60 100644 --- a/src/monster-process.c +++ b/src/monster-process.c @@ -16,6 +16,7 @@ #include "angband.h" #include "cmd-pet.h" #include "monsterrace-hook.h" +#include "melee.h" /*! diff --git a/src/racial.c b/src/racial.c index 6d388a41f..a0f778cdf 100644 --- a/src/racial.c +++ b/src/racial.c @@ -14,7 +14,7 @@ #include "cmd-magiceat.h" #include "cmd-zapwand.h" #include "cmd-pet.h" - +#include "melee.h" #include "object-hook.h" /*! diff --git a/src/realm-hissatsu.c b/src/realm-hissatsu.c index 19c2d8867..3668b78ef 100644 --- a/src/realm-hissatsu.c +++ b/src/realm-hissatsu.c @@ -1,5 +1,6 @@ #include "angband.h" #include "cmd-spell.h" +#include "melee.h" #include "monsterrace-hook.h" /*! diff --git a/src/spells1.c b/src/spells1.c index 795119593..41d8e4834 100644 --- a/src/spells1.c +++ b/src/spells1.c @@ -17,6 +17,7 @@ #include "object-curse.h" #include "player-damage.h" #include "monsterrace-hook.h" +#include "melee.h" static int rakubadam_m; /*!< 振り落とされた際のダメージ量 */ diff --git a/src/spells2.c b/src/spells2.c index 74cb059d9..4fc42aca4 100644 --- a/src/spells2.c +++ b/src/spells2.c @@ -15,6 +15,7 @@ #include "grid.h" #include "trap.h" #include "monsterrace-hook.h" +#include "melee.h" /*! diff --git a/src/spells3.c b/src/spells3.c index 361240594..e69cb77ce 100644 --- a/src/spells3.c +++ b/src/spells3.c @@ -13,6 +13,7 @@ #include "angband.h" #include "object-hook.h" +#include "melee.h" /*! テレポート先探索の試行数 / Maximum number of tries for teleporting */ #define MAX_TRIES 100 -- 2.11.0