OSDN Git Service

Merge branch 'Feature/Fix-Fall-Horse' into develop/3.0.0.1Alpha
[hengband/hengband.git] / src / combat / shoot.c
index e9dc4e2..e41feaf 100644 (file)
@@ -1,5 +1,5 @@
 #include "combat/shoot.h"
-#include "art-definition/art-bow-types.h"
+#include "artifact/fixed-art-types.h"
 #include "core/player-redraw-types.h"
 #include "core/player-update-types.h"
 #include "core/stuff-handler.h"
@@ -49,6 +49,7 @@
 #include "player/player-class.h"
 #include "player/player-personalities-types.h"
 #include "player/player-skill.h"
+#include "player/player-status-table.h"
 #include "player/player-status.h"
 #include "spell/spell-types.h"
 #include "sv-definition/sv-bow-types.h"
@@ -84,7 +85,7 @@ static MULTIPLY calc_shot_damage_with_slay(player_type *sniper_ptr, object_type
     case TV_SHOT:
     case TV_ARROW:
     case TV_BOLT: {
-        if ((have_flag(flgs, TR_SLAY_ANIMAL)) && (r_ptr->flags3 & RF3_ANIMAL)) {
+        if ((has_flag(flgs, TR_SLAY_ANIMAL)) && (r_ptr->flags3 & RF3_ANIMAL)) {
             if (is_original_ap_and_seen(sniper_ptr, m_ptr)) {
                 r_ptr->r_flags3 |= RF3_ANIMAL;
             }
@@ -92,7 +93,7 @@ static MULTIPLY calc_shot_damage_with_slay(player_type *sniper_ptr, object_type
                 mult = 17;
         }
 
-        if ((have_flag(flgs, TR_KILL_ANIMAL)) && (r_ptr->flags3 & RF3_ANIMAL)) {
+        if ((has_flag(flgs, TR_KILL_ANIMAL)) && (r_ptr->flags3 & RF3_ANIMAL)) {
             if (is_original_ap_and_seen(sniper_ptr, m_ptr)) {
                 r_ptr->r_flags3 |= RF3_ANIMAL;
             }
@@ -100,7 +101,7 @@ static MULTIPLY calc_shot_damage_with_slay(player_type *sniper_ptr, object_type
                 mult = 27;
         }
 
-        if ((have_flag(flgs, TR_SLAY_EVIL)) && (r_ptr->flags3 & RF3_EVIL)) {
+        if ((has_flag(flgs, TR_SLAY_EVIL)) && (r_ptr->flags3 & RF3_EVIL)) {
             if (is_original_ap_and_seen(sniper_ptr, m_ptr)) {
                 r_ptr->r_flags3 |= RF3_EVIL;
             }
@@ -108,7 +109,7 @@ static MULTIPLY calc_shot_damage_with_slay(player_type *sniper_ptr, object_type
                 mult = 15;
         }
 
-        if ((have_flag(flgs, TR_KILL_EVIL)) && (r_ptr->flags3 & RF3_EVIL)) {
+        if ((has_flag(flgs, TR_KILL_EVIL)) && (r_ptr->flags3 & RF3_EVIL)) {
             if (is_original_ap_and_seen(sniper_ptr, m_ptr)) {
                 r_ptr->r_flags3 |= RF3_EVIL;
             }
@@ -116,7 +117,7 @@ static MULTIPLY calc_shot_damage_with_slay(player_type *sniper_ptr, object_type
                 mult = 25;
         }
 
-        if ((have_flag(flgs, TR_SLAY_HUMAN)) && (r_ptr->flags2 & RF2_HUMAN)) {
+        if ((has_flag(flgs, TR_SLAY_HUMAN)) && (r_ptr->flags2 & RF2_HUMAN)) {
             if (is_original_ap_and_seen(sniper_ptr, m_ptr)) {
                 r_ptr->r_flags2 |= RF2_HUMAN;
             }
@@ -124,7 +125,7 @@ static MULTIPLY calc_shot_damage_with_slay(player_type *sniper_ptr, object_type
                 mult = 17;
         }
 
-        if ((have_flag(flgs, TR_KILL_HUMAN)) && (r_ptr->flags2 & RF2_HUMAN)) {
+        if ((has_flag(flgs, TR_KILL_HUMAN)) && (r_ptr->flags2 & RF2_HUMAN)) {
             if (is_original_ap_and_seen(sniper_ptr, m_ptr)) {
                 r_ptr->r_flags2 |= RF2_HUMAN;
             }
@@ -132,7 +133,7 @@ static MULTIPLY calc_shot_damage_with_slay(player_type *sniper_ptr, object_type
                 mult = 27;
         }
 
-        if ((have_flag(flgs, TR_SLAY_UNDEAD)) && (r_ptr->flags3 & RF3_UNDEAD)) {
+        if ((has_flag(flgs, TR_SLAY_UNDEAD)) && (r_ptr->flags3 & RF3_UNDEAD)) {
             if (is_original_ap_and_seen(sniper_ptr, m_ptr)) {
                 r_ptr->r_flags3 |= RF3_UNDEAD;
             }
@@ -140,7 +141,7 @@ static MULTIPLY calc_shot_damage_with_slay(player_type *sniper_ptr, object_type
                 mult = 20;
         }
 
-        if ((have_flag(flgs, TR_KILL_UNDEAD)) && (r_ptr->flags3 & RF3_UNDEAD)) {
+        if ((has_flag(flgs, TR_KILL_UNDEAD)) && (r_ptr->flags3 & RF3_UNDEAD)) {
             if (is_original_ap_and_seen(sniper_ptr, m_ptr)) {
                 r_ptr->r_flags3 |= RF3_UNDEAD;
             }
@@ -148,7 +149,7 @@ static MULTIPLY calc_shot_damage_with_slay(player_type *sniper_ptr, object_type
                 mult = 30;
         }
 
-        if ((have_flag(flgs, TR_SLAY_DEMON)) && (r_ptr->flags3 & RF3_DEMON)) {
+        if ((has_flag(flgs, TR_SLAY_DEMON)) && (r_ptr->flags3 & RF3_DEMON)) {
             if (is_original_ap_and_seen(sniper_ptr, m_ptr)) {
                 r_ptr->r_flags3 |= RF3_DEMON;
             }
@@ -156,7 +157,7 @@ static MULTIPLY calc_shot_damage_with_slay(player_type *sniper_ptr, object_type
                 mult = 20;
         }
 
-        if ((have_flag(flgs, TR_KILL_DEMON)) && (r_ptr->flags3 & RF3_DEMON)) {
+        if ((has_flag(flgs, TR_KILL_DEMON)) && (r_ptr->flags3 & RF3_DEMON)) {
             if (is_original_ap_and_seen(sniper_ptr, m_ptr)) {
                 r_ptr->r_flags3 |= RF3_DEMON;
             }
@@ -164,7 +165,7 @@ static MULTIPLY calc_shot_damage_with_slay(player_type *sniper_ptr, object_type
                 mult = 30;
         }
 
-        if ((have_flag(flgs, TR_SLAY_ORC)) && (r_ptr->flags3 & RF3_ORC)) {
+        if ((has_flag(flgs, TR_SLAY_ORC)) && (r_ptr->flags3 & RF3_ORC)) {
             if (is_original_ap_and_seen(sniper_ptr, m_ptr)) {
                 r_ptr->r_flags3 |= RF3_ORC;
             }
@@ -172,7 +173,7 @@ static MULTIPLY calc_shot_damage_with_slay(player_type *sniper_ptr, object_type
                 mult = 20;
         }
 
-        if ((have_flag(flgs, TR_KILL_ORC)) && (r_ptr->flags3 & RF3_ORC)) {
+        if ((has_flag(flgs, TR_KILL_ORC)) && (r_ptr->flags3 & RF3_ORC)) {
             if (is_original_ap_and_seen(sniper_ptr, m_ptr)) {
                 r_ptr->r_flags3 |= RF3_ORC;
             }
@@ -180,7 +181,7 @@ static MULTIPLY calc_shot_damage_with_slay(player_type *sniper_ptr, object_type
                 mult = 30;
         }
 
-        if ((have_flag(flgs, TR_SLAY_TROLL)) && (r_ptr->flags3 & RF3_TROLL)) {
+        if ((has_flag(flgs, TR_SLAY_TROLL)) && (r_ptr->flags3 & RF3_TROLL)) {
             if (is_original_ap_and_seen(sniper_ptr, m_ptr)) {
                 r_ptr->r_flags3 |= RF3_TROLL;
             }
@@ -189,7 +190,7 @@ static MULTIPLY calc_shot_damage_with_slay(player_type *sniper_ptr, object_type
                 mult = 20;
         }
 
-        if ((have_flag(flgs, TR_KILL_TROLL)) && (r_ptr->flags3 & RF3_TROLL)) {
+        if ((has_flag(flgs, TR_KILL_TROLL)) && (r_ptr->flags3 & RF3_TROLL)) {
             if (is_original_ap_and_seen(sniper_ptr, m_ptr)) {
                 r_ptr->r_flags3 |= RF3_TROLL;
             }
@@ -197,7 +198,7 @@ static MULTIPLY calc_shot_damage_with_slay(player_type *sniper_ptr, object_type
                 mult = 30;
         }
 
-        if ((have_flag(flgs, TR_SLAY_GIANT)) && (r_ptr->flags3 & RF3_GIANT)) {
+        if ((has_flag(flgs, TR_SLAY_GIANT)) && (r_ptr->flags3 & RF3_GIANT)) {
             if (is_original_ap_and_seen(sniper_ptr, m_ptr)) {
                 r_ptr->r_flags3 |= RF3_GIANT;
             }
@@ -205,7 +206,7 @@ static MULTIPLY calc_shot_damage_with_slay(player_type *sniper_ptr, object_type
                 mult = 20;
         }
 
-        if ((have_flag(flgs, TR_KILL_GIANT)) && (r_ptr->flags3 & RF3_GIANT)) {
+        if ((has_flag(flgs, TR_KILL_GIANT)) && (r_ptr->flags3 & RF3_GIANT)) {
             if (is_original_ap_and_seen(sniper_ptr, m_ptr)) {
                 r_ptr->r_flags3 |= RF3_GIANT;
             }
@@ -213,7 +214,7 @@ static MULTIPLY calc_shot_damage_with_slay(player_type *sniper_ptr, object_type
                 mult = 30;
         }
 
-        if ((have_flag(flgs, TR_SLAY_DRAGON)) && (r_ptr->flags3 & RF3_DRAGON)) {
+        if ((has_flag(flgs, TR_SLAY_DRAGON)) && (r_ptr->flags3 & RF3_DRAGON)) {
             if (is_original_ap_and_seen(sniper_ptr, m_ptr)) {
                 r_ptr->r_flags3 |= RF3_DRAGON;
             }
@@ -221,7 +222,7 @@ static MULTIPLY calc_shot_damage_with_slay(player_type *sniper_ptr, object_type
                 mult = 20;
         }
 
-        if ((have_flag(flgs, TR_KILL_DRAGON)) && (r_ptr->flags3 & RF3_DRAGON)) {
+        if ((has_flag(flgs, TR_KILL_DRAGON)) && (r_ptr->flags3 & RF3_DRAGON)) {
             if (is_original_ap_and_seen(sniper_ptr, m_ptr)) {
                 r_ptr->r_flags3 |= RF3_DRAGON;
             }
@@ -231,7 +232,7 @@ static MULTIPLY calc_shot_damage_with_slay(player_type *sniper_ptr, object_type
                 mult *= 5;
         }
 
-        if (have_flag(flgs, TR_BRAND_ACID)) {
+        if (has_flag(flgs, TR_BRAND_ACID)) {
             /* Notice immunity */
             if (r_ptr->flagsr & RFR_EFF_IM_ACID_MASK) {
                 if (is_original_ap_and_seen(sniper_ptr, m_ptr)) {
@@ -243,7 +244,7 @@ static MULTIPLY calc_shot_damage_with_slay(player_type *sniper_ptr, object_type
             }
         }
 
-        if (have_flag(flgs, TR_BRAND_ELEC)) {
+        if (has_flag(flgs, TR_BRAND_ELEC)) {
             /* Notice immunity */
             if (r_ptr->flagsr & RFR_EFF_IM_ELEC_MASK) {
                 if (is_original_ap_and_seen(sniper_ptr, m_ptr)) {
@@ -255,7 +256,7 @@ static MULTIPLY calc_shot_damage_with_slay(player_type *sniper_ptr, object_type
             }
         }
 
-        if (have_flag(flgs, TR_BRAND_FIRE)) {
+        if (has_flag(flgs, TR_BRAND_FIRE)) {
             /* Notice immunity */
             if (r_ptr->flagsr & RFR_EFF_IM_FIRE_MASK) {
                 if (is_original_ap_and_seen(sniper_ptr, m_ptr)) {
@@ -275,7 +276,7 @@ static MULTIPLY calc_shot_damage_with_slay(player_type *sniper_ptr, object_type
             }
         }
 
-        if (have_flag(flgs, TR_BRAND_COLD)) {
+        if (has_flag(flgs, TR_BRAND_COLD)) {
             /* Notice immunity */
             if (r_ptr->flagsr & RFR_EFF_IM_COLD_MASK) {
                 if (is_original_ap_and_seen(sniper_ptr, m_ptr)) {
@@ -295,7 +296,7 @@ static MULTIPLY calc_shot_damage_with_slay(player_type *sniper_ptr, object_type
             }
         }
 
-        if (have_flag(flgs, TR_BRAND_POIS)) {
+        if (has_flag(flgs, TR_BRAND_POIS)) {
             /* Notice immunity */
             if (r_ptr->flagsr & RFR_EFF_IM_POIS_MASK) {
                 if (is_original_ap_and_seen(sniper_ptr, m_ptr)) {
@@ -309,7 +310,7 @@ static MULTIPLY calc_shot_damage_with_slay(player_type *sniper_ptr, object_type
             }
         }
 
-        if ((have_flag(flgs, TR_FORCE_WEAPON)) && (sniper_ptr->csp > (sniper_ptr->msp / 30))) {
+        if ((has_flag(flgs, TR_FORCE_WEAPON)) && (sniper_ptr->csp > (sniper_ptr->msp / 30))) {
             sniper_ptr->csp -= (1 + (sniper_ptr->msp / 30));
             sniper_ptr->redraw |= (PR_MANA);
             mult = mult * 5 / 2;
@@ -513,7 +514,7 @@ void exe_fire(player_type *shooter_ptr, INVENTORY_IDX item, object_type *j_ptr,
             if (snipe_type == SP_KILL_WALL) {
                 g_ptr = &shooter_ptr->current_floor_ptr->grid_array[ny][nx];
 
-                if (cave_have_flag_grid(g_ptr, FF_HURT_ROCK) && !g_ptr->m_idx) {
+                if (cave_has_flag_grid(g_ptr, FF_HURT_ROCK) && !g_ptr->m_idx) {
                     if (g_ptr->info & (CAVE_MARK))
                         msg_print(_("岩が砕け散った。", "Wall rocks were shattered."));
                     /* Forget the wall */
@@ -529,7 +530,7 @@ void exe_fire(player_type *shooter_ptr, INVENTORY_IDX item, object_type *j_ptr,
             }
 
             /* Stopped by walls/doors */
-            if (!cave_have_flag_bold(shooter_ptr->current_floor_ptr, ny, nx, FF_PROJECT) && !shooter_ptr->current_floor_ptr->grid_array[ny][nx].m_idx)
+            if (!cave_has_flag_bold(shooter_ptr->current_floor_ptr, ny, nx, FF_PROJECT) && !shooter_ptr->current_floor_ptr->grid_array[ny][nx].m_idx)
                 break;
 
             /* Advance the distance */
@@ -831,7 +832,7 @@ void exe_fire(player_type *shooter_ptr, INVENTORY_IDX item, object_type *j_ptr,
 
             /* Carry object */
             m_ptr->hold_o_idx = o_idx;
-        } else if (cave_have_flag_bold(shooter_ptr->current_floor_ptr, y, x, FF_PROJECT)) {
+        } else if (cave_has_flag_bold(shooter_ptr->current_floor_ptr, y, x, FF_PROJECT)) {
             /* Drop (or break) near that location */
             (void)drop_near(shooter_ptr, q_ptr, j, y, x);
         } else {