#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"
#include "effect/effect-characteristics.h"
+#include "effect/effect-processor.h"
#include "effect/spells-effect-util.h"
#include "flavor/flavor-describer.h"
#include "flavor/object-flavor-types.h"
+#include "floor/cave.h"
#include "floor/floor-object.h"
#include "game-option/cheat-types.h"
#include "game-option/special-options.h"
-#include "grid/feature.h"
#include "grid/feature-flag-types.h"
+#include "grid/feature.h"
#include "grid/grid.h"
#include "inventory/inventory-object.h"
#include "inventory/inventory-slot-types.h"
#include "io/cursor.h"
#include "io/screen-util.h"
-#include "io/targeting.h"
#include "main/sound-definitions-table.h"
#include "main/sound-of-music.h"
#include "mind/mind-sniper.h"
#include "monster-race/race-indice-types.h"
#include "monster/monster-describer.h"
#include "monster/monster-info.h"
+#include "monster/monster-status-setter.h"
#include "monster/monster-status.h"
#include "monster/monster-update.h"
#include "object-enchant/tr-types.h"
#include "object/object-info.h"
#include "object/object-kind.h"
#include "object/object-mark-types.h"
-#include "player/avatar.h"
+#include "player-info/avatar.h"
#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/process-effect.h"
#include "spell/spell-types.h"
#include "sv-definition/sv-bow-types.h"
#include "system/artifact-type-definition.h"
#include "system/floor-type-definition.h"
+#include "target/projection-path-calculator.h"
+#include "target/target-checker.h"
+#include "target/target-getter.h"
#include "util/bit-flags-calculator.h"
#include "view/display-messages.h"
#include "wizard/wizard-messages.h"
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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)) {
}
}
- 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)) {
}
}
- 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)) {
}
}
- 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)) {
}
}
- 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)) {
}
}
- 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;
}
/* Get projection path length */
- tdis = project_path(shooter_ptr, path_g, project_length, shooter_ptr->y, shooter_ptr->x, ty, tx, PROJECT_PATH | PROJECT_THRU) - 1;
+ tdis = projection_path(shooter_ptr, path_g, project_length, shooter_ptr->y, shooter_ptr->x, ty, tx, PROJECT_PATH | PROJECT_THRU) - 1;
project_length = 0; /* reset to default */
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 */
}
/* 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 */
/* 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 {