OSDN Git Service

[Refactor] #40416 Incorporated effect into monap_type and removed the alias of int...
authorHourier <hourier@users.sourceforge.jp>
Sun, 31 May 2020 04:52:40 +0000 (13:52 +0900)
committerHourier <hourier@users.sourceforge.jp>
Sun, 31 May 2020 04:52:40 +0000 (13:52 +0900)
src/combat/melee-util.h
src/combat/monster-attack-effect.h
src/combat/monster-attack-player.c
src/combat/monster-attack-util.h
src/dungeon/dungeon-file.c
src/monster/monster-race.h
src/system/h-type.h

index 5b1a4e4..9122cfc 100644 (file)
@@ -23,7 +23,7 @@ typedef struct mam_type {
     bool touched;
     concptr act;
     spells_type pt;
-    BLOW_EFFECT effect;
+    rbe_type effect;
     ARMOUR_CLASS ac;
     DEPTH rlev;
     bool blinked;
index e3d3b72..d1366f3 100644 (file)
@@ -4,6 +4,7 @@
  * @note モンスターの攻撃効果 / New monster blow effects
  */
 typedef enum rbe_type {
+    RBE_NONE = 0,
     RBE_HURT = 1, /*!< モンスターの攻撃効果: 攻撃する*/
     RBE_POISON = 2, /*!< モンスターの攻撃効果: 毒をくらわす*/
     RBE_UN_BONUS = 3, /*!< モンスターの攻撃効果: 劣化させる*/
index 05aadd1..25101c3 100644 (file)
@@ -323,7 +323,7 @@ bool make_attack_normal(player_type *target_ptr, MONSTER_IDX m_idx)
         HIT_POINT power = 0;
         monap_ptr->damage = 0;
         monap_ptr->act = NULL;
-        int effect = r_ptr->blow[ap_cnt].effect;
+        monap_ptr->effect = r_ptr->blow[ap_cnt].effect;
         monap_ptr->method = r_ptr->blow[ap_cnt].method;
         monap_ptr->d_dice = r_ptr->blow[ap_cnt].d_dice;
         monap_ptr->d_side = r_ptr->blow[ap_cnt].d_side;
@@ -334,9 +334,9 @@ bool make_attack_normal(player_type *target_ptr, MONSTER_IDX m_idx)
         if (monap_ptr->method == RBM_SHOOT)
             continue;
 
-        power = mbe_info[effect].power;
+        power = mbe_info[monap_ptr->effect].power;
         ac = target_ptr->ac + target_ptr->to_a;
-        if (!effect || check_hit_from_monster_to_player(target_ptr, power, monap_ptr->rlev, MON_STUNNED(monap_ptr->m_ptr))) {
+        if (!monap_ptr->effect || check_hit_from_monster_to_player(target_ptr, power, monap_ptr->rlev, MON_STUNNED(monap_ptr->m_ptr))) {
             disturb(target_ptr, TRUE, TRUE);
             if (effect_protecion_from_evil(target_ptr, monap_ptr))
                 continue;
@@ -350,8 +350,8 @@ bool make_attack_normal(player_type *target_ptr, MONSTER_IDX m_idx)
             if (monap_ptr->explode)
                 monap_ptr->damage = 0;
 
-            switch (effect) {
-            case 0: {
+            switch (monap_ptr->effect) {
+            case RBE_NONE: {
                 monap_ptr->obvious = TRUE;
                 monap_ptr->damage = 0;
                 break;
index a618d1f..4d00390 100644 (file)
@@ -23,6 +23,7 @@ typedef struct monap_type {
     object_type *o_ptr;
     bool obvious;
     HIT_POINT damage;
+    rbe_type effect;
 } monap_type;
 
 monap_type *initialize_monap_type(player_type *target_ptr, monap_type *monap_ptr, MONSTER_IDX m_idx);
index 5be74c4..4439bab 100644 (file)
@@ -66,6 +66,7 @@
 #include "floor/wild.h"
 #include "view/display-main-window.h"
 #include "player/player-class.h"
+#include "combat/monster-attack-effect.h"
 #include "combat/monster-attack-types.h"
 
 #include "main/init.h"
@@ -2401,7 +2402,7 @@ errr parse_r_info(char *buf, header *head)
                if (*t == 'd') *t++ = '\0';
 
                r_ptr->blow[i].method = (rbm_type)n1;
-               r_ptr->blow[i].effect = (BLOW_EFFECT)n2;
+               r_ptr->blow[i].effect = (rbe_type)n2;
                r_ptr->blow[i].d_dice = atoi(s);
                r_ptr->blow[i].d_side = atoi(t);
        }
index 9f17f2d..d34137d 100644 (file)
@@ -13,7 +13,7 @@
 typedef struct monster_blow
 {
     rbm_type method;
-       BLOW_EFFECT effect;
+    rbe_type effect;
        DICE_NUMBER d_dice;
        DICE_SID d_side;
 } monster_blow;
index dbbb83f..4ed040d 100644 (file)
@@ -220,8 +220,6 @@ typedef byte FEAT_POWER;   /*!< 地形強度の型定義 */
 
 typedef int QUANTITY; /*!< インターフェース上の指定個数 */
 
-typedef byte BLOW_EFFECT; /*!< モンスターの打撃効果ID */
-
 typedef int EFFECT_ID; /*!< 効果属性ID */
 
 typedef s16b QUEST_TYPE;   /*!< クエストの種別ID */