OSDN Git Service

[Refactor] #40416 Changed BLOW_METHOD (alias of int) to rbm_type (enum)
authorHourier <hourier@users.sourceforge.jp>
Thu, 21 May 2020 10:14:15 +0000 (19:14 +0900)
committerHourier <hourier@users.sourceforge.jp>
Thu, 21 May 2020 10:14:15 +0000 (19:14 +0900)
src/combat/melee.c
src/combat/monster-attack-types.h
src/dungeon/dungeon-file.c
src/monster/monster-race.h
src/monster/monster1.c
src/system/h-type.h

index e73e92a..559aaaa 100644 (file)
@@ -1942,7 +1942,7 @@ bool make_attack_normal(player_type *target_ptr, MONSTER_IDX m_idx)
 
                /* Extract the attack infomation */
                int effect = r_ptr->blow[ap_cnt].effect;
-               int method = r_ptr->blow[ap_cnt].method;
+               rbm_type method = r_ptr->blow[ap_cnt].method;
                int d_dice = r_ptr->blow[ap_cnt].d_dice;
                int d_side = r_ptr->blow[ap_cnt].d_side;
 
@@ -3694,7 +3694,7 @@ bool monst_attack_monst(player_type *subject_ptr, MONSTER_IDX m_idx, MONSTER_IDX
 
                /* Extract the attack infomation */
                int effect = r_ptr->blow[ap_cnt].effect;
-               int method = r_ptr->blow[ap_cnt].method;
+               rbm_type method = r_ptr->blow[ap_cnt].method;
                int d_dice = r_ptr->blow[ap_cnt].d_dice;
                int d_side = r_ptr->blow[ap_cnt].d_side;
 
index 1c91731..c4b649a 100644 (file)
@@ -4,7 +4,7 @@
  * @note モンスターの打撃方法 / New monster blow methods
  * 打撃の種別に応じて傷と朦朧が発生するかがコメントの通りに決まる
  */
-typedef enum mbm_type {
+typedef enum rbm_type {
     RBM_HIT = 1, /*!< モンスターの攻撃種別:殴る(傷/朦朧が半々) */
     RBM_TOUCH = 2, /*!< モンスターの攻撃種別:触る */
     RBM_PUNCH = 3, /*!< モンスターの攻撃種別:パンチする(朦朧) */
@@ -30,7 +30,7 @@ typedef enum mbm_type {
     RBM_MOAN = 23, /*!< モンスターの攻撃種別:うめく */
     RBM_SHOW = 24, /*!< モンスターの攻撃種別:歌う */
     RBM_SHOOT = 25, /*!< モンスターの攻撃種別:射撃(非打撃) */
-} mbm_type;
+} rbm_type;
 
 #define MAX_MBE 34
 
index d992198..43280a2 100644 (file)
@@ -64,6 +64,7 @@
 #include "floor/wild.h"
 #include "view/display-main-window.h"
 #include "player/player-class.h"
+#include "combat/monster-attack-types.h"
 
 #include "main/init.h"
 
@@ -2395,7 +2396,7 @@ errr parse_r_info(char *buf, header *head)
 
                if (*t == 'd') *t++ = '\0';
 
-               r_ptr->blow[i].method = (BLOW_METHOD)n1;
+               r_ptr->blow[i].method = (rbm_type)n1;
                r_ptr->blow[i].effect = (BLOW_EFFECT)n2;
                r_ptr->blow[i].d_dice = atoi(s);
                r_ptr->blow[i].d_side = atoi(t);
index d2ea5b3..9f17f2d 100644 (file)
@@ -1,5 +1,6 @@
 #pragma once
 #include "util/util.h"
+#include "combat/monster-attack-types.h"
 
 /*
  * Monster blow structure
@@ -11,7 +12,7 @@
  */
 typedef struct monster_blow
 {
-       BLOW_METHOD method;
+    rbm_type method;
        BLOW_EFFECT effect;
        DICE_NUMBER d_dice;
        DICE_SID d_side;
index cb68f60..acc2e33 100644 (file)
@@ -1612,7 +1612,7 @@ static void roff_aux(player_type *player_ptr, MONRACE_IDX r_idx, BIT_FLAGS mode)
                if (r_ptr->blow[m].method == RBM_SHOOT) continue;
                if (!r_ptr->r_blows[m] && !know_everything) continue;
 
-               int method = r_ptr->blow[m].method;
+               rbm_type method = r_ptr->blow[m].method;
                int effect = r_ptr->blow[m].effect;
                int d1 = r_ptr->blow[m].d_dice;
                int d2 = r_ptr->blow[m].d_side;
index 631a542..e90a46c 100644 (file)
@@ -221,7 +221,6 @@ typedef byte FEAT_POWER;   /*!< 地形強度の型定義 */
 
 typedef int QUANTITY; /*!< インターフェース上の指定個数 */
 
-typedef byte BLOW_METHOD; /*!< モンスターの打撃手段ID */
 typedef byte BLOW_EFFECT; /*!< モンスターの打撃効果ID */
 
 typedef int EFFECT_ID; /*!< 効果属性ID */