From ef72afc76077aba14272168ea68b6f102e807f8b Mon Sep 17 00:00:00 2001 From: deskull Date: Wed, 21 Oct 2020 00:23:51 +0900 Subject: [PATCH] =?utf8?q?[Refactor]=20#40514=20player-status-flags.c/h=20?= =?utf8?q?=E5=86=85=E3=81=AE=20is=5F*()=20=E9=96=A2=E6=95=B0=E3=82=92=20ha?= =?utf8?q?s=5F*()=20=E3=81=AB=E6=94=B9=E5=90=8D=EF=BC=8E=20/=20Renamed=20i?= =?utf8?q?s=5F*()=20function=20in=20player-status-flags.c/h=20to=20has=5F?= =?utf8?q?=E2=80=8B=E2=80=8B*().?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/action/run-execution.c | 2 +- src/core/hp-mp-processor.c | 14 ++-- src/effect/effect-player-resist-hurt.c | 6 +- src/grid/grid.c | 2 +- src/monster/monster-update.c | 8 +-- src/mspell/element-resistance-checker.c | 8 +-- src/mspell/mspell-judgement.c | 8 +-- src/object-use/read-execution.c | 4 +- src/object/warning.c | 8 +-- src/player-info/resistance-info.c | 12 ++-- src/player/player-damage.c | 10 +-- src/player/player-move.c | 4 +- src/player/player-status-flags.c | 120 ++++++++++++++++---------------- src/player/player-status-flags.h | 110 ++++++++++++++--------------- src/player/player-status-resist.c | 12 ++-- src/player/player-status.c | 96 ++++++++++++------------- src/specific-object/death-scythe.c | 8 +-- 17 files changed, 216 insertions(+), 216 deletions(-) diff --git a/src/action/run-execution.c b/src/action/run-execution.c index 486ca0374..d331c044c 100644 --- a/src/action/run-execution.c +++ b/src/action/run-execution.c @@ -232,7 +232,7 @@ static bool run_test(player_type *creature_ptr) notice = FALSE; } else if (find_ignore_stairs && has_flag(f_ptr->flags, FF_STAIRS)) { notice = FALSE; - } else if (has_flag(f_ptr->flags, FF_LAVA) && (is_immune_fire(creature_ptr) || is_invuln(creature_ptr))) { + } else if (has_flag(f_ptr->flags, FF_LAVA) && (has_immune_fire(creature_ptr) || is_invuln(creature_ptr))) { notice = FALSE; } else if (has_flag(f_ptr->flags, FF_WATER) && has_flag(f_ptr->flags, FF_DEEP) && (creature_ptr->levitation || creature_ptr->can_swim || (creature_ptr->total_weight <= weight_limit(creature_ptr)))) { diff --git a/src/core/hp-mp-processor.c b/src/core/hp-mp-processor.c index f4e8de01f..9341c68ac 100644 --- a/src/core/hp-mp-processor.c +++ b/src/core/hp-mp-processor.c @@ -91,7 +91,7 @@ void process_player_hp_mp(player_type *creature_ptr) } } - if (has_flag(f_ptr->flags, FF_LAVA) && !is_invuln(creature_ptr) && !is_immune_fire(creature_ptr)) { + if (has_flag(f_ptr->flags, FF_LAVA) && !is_invuln(creature_ptr) && !has_immune_fire(creature_ptr)) { int damage = 0; if (has_flag(f_ptr->flags, FF_DEEP)) { @@ -130,7 +130,7 @@ void process_player_hp_mp(player_type *creature_ptr) } } - if (has_flag(f_ptr->flags, FF_COLD_PUDDLE) && !is_invuln(creature_ptr) && !is_immune_cold(creature_ptr)) { + if (has_flag(f_ptr->flags, FF_COLD_PUDDLE) && !is_invuln(creature_ptr) && !has_immune_cold(creature_ptr)) { int damage = 0; if (has_flag(f_ptr->flags, FF_DEEP)) { @@ -165,7 +165,7 @@ void process_player_hp_mp(player_type *creature_ptr) } } - if (has_flag(f_ptr->flags, FF_ELEC_PUDDLE) && !is_invuln(creature_ptr) && !is_immune_elec(creature_ptr)) { + if (has_flag(f_ptr->flags, FF_ELEC_PUDDLE) && !is_invuln(creature_ptr) && !has_immune_elec(creature_ptr)) { int damage = 0; if (has_flag(f_ptr->flags, FF_DEEP)) { @@ -200,7 +200,7 @@ void process_player_hp_mp(player_type *creature_ptr) } } - if (has_flag(f_ptr->flags, FF_ACID_PUDDLE) && !is_invuln(creature_ptr) && !is_immune_acid(creature_ptr)) { + if (has_flag(f_ptr->flags, FF_ACID_PUDDLE) && !is_invuln(creature_ptr) && !has_immune_acid(creature_ptr)) { int damage = 0; if (has_flag(f_ptr->flags, FF_DEEP)) { @@ -282,7 +282,7 @@ void process_player_hp_mp(player_type *creature_ptr) if (creature_ptr->riding) { HIT_POINT damage; - if ((r_info[creature_ptr->current_floor_ptr->m_list[creature_ptr->riding].r_idx].flags2 & RF2_AURA_FIRE) && !is_immune_fire(creature_ptr)) { + if ((r_info[creature_ptr->current_floor_ptr->m_list[creature_ptr->riding].r_idx].flags2 & RF2_AURA_FIRE) && !has_immune_fire(creature_ptr)) { damage = r_info[creature_ptr->current_floor_ptr->m_list[creature_ptr->riding].r_idx].level / 2; if (is_specific_player_race(creature_ptr, RACE_ENT)) damage += damage / 3; @@ -293,7 +293,7 @@ void process_player_hp_mp(player_type *creature_ptr) msg_print(_("熱い!", "It's hot!")); take_hit(creature_ptr, DAMAGE_NOESCAPE, damage, _("炎のオーラ", "Fire aura"), -1); } - if ((r_info[creature_ptr->current_floor_ptr->m_list[creature_ptr->riding].r_idx].flags2 & RF2_AURA_ELEC) && !is_immune_elec(creature_ptr)) { + if ((r_info[creature_ptr->current_floor_ptr->m_list[creature_ptr->riding].r_idx].flags2 & RF2_AURA_ELEC) && !has_immune_elec(creature_ptr)) { damage = r_info[creature_ptr->current_floor_ptr->m_list[creature_ptr->riding].r_idx].level / 2; if (is_specific_player_race(creature_ptr, RACE_ANDROID)) damage += damage / 3; @@ -304,7 +304,7 @@ void process_player_hp_mp(player_type *creature_ptr) msg_print(_("痛い!", "It hurts!")); take_hit(creature_ptr, DAMAGE_NOESCAPE, damage, _("電気のオーラ", "Elec aura"), -1); } - if ((r_info[creature_ptr->current_floor_ptr->m_list[creature_ptr->riding].r_idx].flags3 & RF3_AURA_COLD) && !is_immune_cold(creature_ptr)) { + if ((r_info[creature_ptr->current_floor_ptr->m_list[creature_ptr->riding].r_idx].flags3 & RF3_AURA_COLD) && !has_immune_cold(creature_ptr)) { damage = r_info[creature_ptr->current_floor_ptr->m_list[creature_ptr->riding].r_idx].level / 2; if (creature_ptr->resist_cold) damage = damage / 3; diff --git a/src/effect/effect-player-resist-hurt.c b/src/effect/effect-player-resist-hurt.c index 6f4f06d5a..54b8369ed 100644 --- a/src/effect/effect-player-resist-hurt.c +++ b/src/effect/effect-player-resist-hurt.c @@ -139,7 +139,7 @@ void effect_player_plasma(player_type *target_ptr, effect_player_type *ep_ptr) (void)set_stun(target_ptr, target_ptr->stun + plus_stun); } - if (!(target_ptr->resist_fire || is_oppose_fire(target_ptr) || is_immune_fire(target_ptr))) + if (!(target_ptr->resist_fire || is_oppose_fire(target_ptr) || has_immune_fire(target_ptr))) inventory_damage(target_ptr, set_acid_destroy, 3); } @@ -544,7 +544,7 @@ void effect_player_meteor(player_type *target_ptr, effect_player_type *ep_ptr) ep_ptr->get_damage = take_hit(target_ptr, DAMAGE_ATTACK, ep_ptr->dam, ep_ptr->killer, ep_ptr->monspell); if (!target_ptr->resist_shard || one_in_(13)) { - if (!is_immune_fire(target_ptr)) + if (!has_immune_fire(target_ptr)) inventory_damage(target_ptr, set_fire_destroy, 2); inventory_damage(target_ptr, set_cold_destroy, 2); } @@ -568,7 +568,7 @@ void effect_player_icee(player_type *target_ptr, effect_player_type *ep_ptr) } if ((!(target_ptr->resist_cold || is_oppose_cold(target_ptr))) || one_in_(12)) { - if (!is_immune_cold(target_ptr)) + if (!has_immune_cold(target_ptr)) inventory_damage(target_ptr, set_cold_destroy, 3); } } diff --git a/src/grid/grid.c b/src/grid/grid.c index 5c4bd1c4b..e7104478f 100644 --- a/src/grid/grid.c +++ b/src/grid/grid.c @@ -1151,7 +1151,7 @@ bool cave_player_teleportable_bold(player_type *player_ptr, POSITION y, POSITION return FALSE; } - if (has_flag(f_ptr->flags, FF_LAVA) && !is_immune_fire(player_ptr) && !is_invuln(player_ptr)) { + if (has_flag(f_ptr->flags, FF_LAVA) && !has_immune_fire(player_ptr) && !is_invuln(player_ptr)) { /* Always forbid deep lava */ if (has_flag(f_ptr->flags, FF_DEEP)) return FALSE; diff --git a/src/monster/monster-update.c b/src/monster/monster-update.c index 3105e72cf..b31386b61 100644 --- a/src/monster/monster-update.c +++ b/src/monster/monster-update.c @@ -545,7 +545,7 @@ void update_smart_learn(player_type *player_ptr, MONSTER_IDX m_idx, int what) if (is_oppose_acid(player_ptr)) m_ptr->smart |= SM_OPP_ACID; - if (is_immune_acid(player_ptr)) + if (has_immune_acid(player_ptr)) m_ptr->smart |= SM_IMM_ACID; break; @@ -556,7 +556,7 @@ void update_smart_learn(player_type *player_ptr, MONSTER_IDX m_idx, int what) if (is_oppose_elec(player_ptr)) m_ptr->smart |= SM_OPP_ELEC; - if (is_immune_elec(player_ptr)) + if (has_immune_elec(player_ptr)) m_ptr->smart |= SM_IMM_ELEC; break; @@ -567,7 +567,7 @@ void update_smart_learn(player_type *player_ptr, MONSTER_IDX m_idx, int what) if (is_oppose_fire(player_ptr)) m_ptr->smart |= SM_OPP_FIRE; - if (is_immune_fire(player_ptr)) + if (has_immune_fire(player_ptr)) m_ptr->smart |= SM_IMM_FIRE; break; @@ -578,7 +578,7 @@ void update_smart_learn(player_type *player_ptr, MONSTER_IDX m_idx, int what) if (is_oppose_cold(player_ptr)) m_ptr->smart |= SM_OPP_COLD; - if (is_immune_cold(player_ptr)) + if (has_immune_cold(player_ptr)) m_ptr->smart |= SM_IMM_COLD; break; diff --git a/src/mspell/element-resistance-checker.c b/src/mspell/element-resistance-checker.c index 1bcd2a0cf..69627f1a6 100644 --- a/src/mspell/element-resistance-checker.c +++ b/src/mspell/element-resistance-checker.c @@ -15,7 +15,7 @@ void add_cheat_remove_flags_element(player_type *target_ptr, msr_type *msr_ptr) if (is_oppose_acid(target_ptr)) msr_ptr->smart |= SM_OPP_ACID; - if (is_immune_acid(target_ptr)) + if (has_immune_acid(target_ptr)) msr_ptr->smart |= SM_IMM_ACID; if (target_ptr->resist_elec) @@ -24,7 +24,7 @@ void add_cheat_remove_flags_element(player_type *target_ptr, msr_type *msr_ptr) if (is_oppose_elec(target_ptr)) msr_ptr->smart |= SM_OPP_ELEC; - if (is_immune_elec(target_ptr)) + if (has_immune_elec(target_ptr)) msr_ptr->smart |= SM_IMM_ELEC; if (target_ptr->resist_fire) @@ -33,7 +33,7 @@ void add_cheat_remove_flags_element(player_type *target_ptr, msr_type *msr_ptr) if (is_oppose_fire(target_ptr)) msr_ptr->smart |= SM_OPP_FIRE; - if (is_immune_fire(target_ptr)) + if (has_immune_fire(target_ptr)) msr_ptr->smart |= SM_IMM_FIRE; if (target_ptr->resist_cold) @@ -42,7 +42,7 @@ void add_cheat_remove_flags_element(player_type *target_ptr, msr_type *msr_ptr) if (is_oppose_cold(target_ptr)) msr_ptr->smart |= SM_OPP_COLD; - if (is_immune_cold(target_ptr)) + if (has_immune_cold(target_ptr)) msr_ptr->smart |= SM_IMM_COLD; if (target_ptr->resist_pois) diff --git a/src/mspell/mspell-judgement.c b/src/mspell/mspell-judgement.c index fb996f321..a091d4baa 100644 --- a/src/mspell/mspell-judgement.c +++ b/src/mspell/mspell-judgement.c @@ -255,7 +255,7 @@ bool dispel_check(player_type *creature_ptr, MONSTER_IDX m_idx) monster_type *m_ptr = &creature_ptr->current_floor_ptr->m_list[m_idx]; monster_race *r_ptr = &r_info[m_ptr->r_idx]; if (r_ptr->flags4 & RF4_BR_ACID) { - if (!is_immune_acid(creature_ptr) && (creature_ptr->oppose_acid || music_singing(creature_ptr, MUSIC_RESIST))) + if (!has_immune_acid(creature_ptr) && (creature_ptr->oppose_acid || music_singing(creature_ptr, MUSIC_RESIST))) return TRUE; if (creature_ptr->special_defense & DEFENSE_ACID) @@ -264,7 +264,7 @@ bool dispel_check(player_type *creature_ptr, MONSTER_IDX m_idx) if (r_ptr->flags4 & RF4_BR_FIRE) { if (!((creature_ptr->prace == RACE_BALROG) && creature_ptr->lev > 44)) { - if (!is_immune_fire(creature_ptr) && (creature_ptr->oppose_fire || music_singing(creature_ptr, MUSIC_RESIST))) + if (!has_immune_fire(creature_ptr) && (creature_ptr->oppose_fire || music_singing(creature_ptr, MUSIC_RESIST))) return TRUE; if (creature_ptr->special_defense & DEFENSE_FIRE) @@ -273,7 +273,7 @@ bool dispel_check(player_type *creature_ptr, MONSTER_IDX m_idx) } if (r_ptr->flags4 & RF4_BR_ELEC) { - if (!is_immune_elec(creature_ptr) && (creature_ptr->oppose_elec || music_singing(creature_ptr, MUSIC_RESIST))) + if (!has_immune_elec(creature_ptr) && (creature_ptr->oppose_elec || music_singing(creature_ptr, MUSIC_RESIST))) return TRUE; if (creature_ptr->special_defense & DEFENSE_ELEC) @@ -281,7 +281,7 @@ bool dispel_check(player_type *creature_ptr, MONSTER_IDX m_idx) } if (r_ptr->flags4 & RF4_BR_COLD) { - if (!is_immune_cold(creature_ptr) && (creature_ptr->oppose_cold || music_singing(creature_ptr, MUSIC_RESIST))) + if (!has_immune_cold(creature_ptr) && (creature_ptr->oppose_cold || music_singing(creature_ptr, MUSIC_RESIST))) return TRUE; if (creature_ptr->special_defense & DEFENSE_COLD) diff --git a/src/object-use/read-execution.c b/src/object-use/read-execution.c index 4a2496244..b63e1c634 100644 --- a/src/object-use/read-execution.c +++ b/src/object-use/read-execution.c @@ -414,7 +414,7 @@ void exe_read(player_type *creature_ptr, INVENTORY_IDX item, bool known) } case SV_SCROLL_FIRE: { fire_ball(creature_ptr, GF_FIRE, 0, 666, 4); - if (!(is_oppose_fire(creature_ptr) || creature_ptr->resist_fire || is_immune_fire(creature_ptr))) + if (!(is_oppose_fire(creature_ptr) || creature_ptr->resist_fire || has_immune_fire(creature_ptr))) take_hit(creature_ptr, DAMAGE_NOESCAPE, 50 + randint1(50), _("炎の巻物", "a Scroll of Fire"), -1); ident = TRUE; @@ -422,7 +422,7 @@ void exe_read(player_type *creature_ptr, INVENTORY_IDX item, bool known) } case SV_SCROLL_ICE: { fire_ball(creature_ptr, GF_ICE, 0, 777, 4); - if (!(is_oppose_cold(creature_ptr) || creature_ptr->resist_cold || is_immune_cold(creature_ptr))) + if (!(is_oppose_cold(creature_ptr) || creature_ptr->resist_cold || has_immune_cold(creature_ptr))) take_hit(creature_ptr, DAMAGE_NOESCAPE, 100 + randint1(100), _("氷の巻物", "a Scroll of Ice"), -1); ident = TRUE; diff --git a/src/object/warning.c b/src/object/warning.c index 7e3934631..7aa793576 100644 --- a/src/object/warning.c +++ b/src/object/warning.c @@ -88,7 +88,7 @@ static void spell_damcalc(player_type *target_ptr, monster_type *m_ptr, EFFECT_I /* Vulnerability, resistance and immunity */ switch (typ) { case GF_ELEC: - if (is_immune_elec(target_ptr)) { + if (has_immune_elec(target_ptr)) { ignore_wraith_form = TRUE; } dam = dam * calc_elec_damage_rate(target_ptr) / 100; @@ -99,7 +99,7 @@ static void spell_damcalc(player_type *target_ptr, monster_type *m_ptr, EFFECT_I break; case GF_ACID: - if (is_immune_acid(target_ptr)) { + if (has_immune_acid(target_ptr)) { ignore_wraith_form = TRUE; } dam = dam * calc_acid_damage_rate(target_ptr) / 100; @@ -107,14 +107,14 @@ static void spell_damcalc(player_type *target_ptr, monster_type *m_ptr, EFFECT_I case GF_COLD: case GF_ICE: - if (is_immune_cold(target_ptr)) { + if (has_immune_cold(target_ptr)) { ignore_wraith_form = TRUE; } dam = dam * calc_cold_damage_rate(target_ptr) / 100; break; case GF_FIRE: - if (is_immune_fire(target_ptr)) { + if (has_immune_fire(target_ptr)) { dam = 0; ignore_wraith_form = TRUE; break; diff --git a/src/player-info/resistance-info.c b/src/player-info/resistance-info.c index 2b5abf714..b9982a04c 100644 --- a/src/player-info/resistance-info.c +++ b/src/player-info/resistance-info.c @@ -6,7 +6,7 @@ void set_element_resistance_info(player_type* creature_ptr, self_info_type* si_ptr) { - if (is_immune_acid(creature_ptr)) { + if (has_immune_acid(creature_ptr)) { si_ptr->info[si_ptr->line++] = _("‚ ‚È‚½‚ÍŽ_‚ɑ΂·‚銮‘S‚È‚é–Ɖu‚ðŽ‚Á‚Ä‚¢‚éB", "You are completely immune to acid."); } else if (creature_ptr->resist_acid && is_oppose_acid(creature_ptr)) { si_ptr->info[si_ptr->line++] = _("‚ ‚È‚½‚ÍŽ_‚Ö‚Ì‹­—͂ȑϐ«‚ðŽ‚Á‚Ä‚¢‚éB", "You resist acid exceptionally well."); @@ -14,7 +14,7 @@ void set_element_resistance_info(player_type* creature_ptr, self_info_type* si_p si_ptr->info[si_ptr->line++] = _("‚ ‚È‚½‚ÍŽ_‚ւ̑ϐ«‚ðŽ‚Á‚Ä‚¢‚éB", "You are resistant to acid."); } - if (is_immune_elec(creature_ptr)) { + if (has_immune_elec(creature_ptr)) { si_ptr->info[si_ptr->line++] = _("‚ ‚È‚½‚Í“dŒ‚‚ɑ΂·‚銮‘S‚È‚é–Ɖu‚ðŽ‚Á‚Ä‚¢‚éB", "You are completely immune to lightning."); } else if (creature_ptr->resist_elec && is_oppose_elec(creature_ptr)) { si_ptr->info[si_ptr->line++] = _("‚ ‚È‚½‚Í“dŒ‚‚Ö‚Ì‹­—͂ȑϐ«‚ðŽ‚Á‚Ä‚¢‚éB", "You resist lightning exceptionally well."); @@ -22,11 +22,11 @@ void set_element_resistance_info(player_type* creature_ptr, self_info_type* si_p si_ptr->info[si_ptr->line++] = _("‚ ‚È‚½‚Í“dŒ‚‚ւ̑ϐ«‚ðŽ‚Á‚Ä‚¢‚éB", "You are resistant to lightning."); } - if (is_specific_player_race(creature_ptr, RACE_ANDROID) && !is_immune_elec(creature_ptr)) { + if (is_specific_player_race(creature_ptr, RACE_ANDROID) && !has_immune_elec(creature_ptr)) { si_ptr->info[si_ptr->line++] = _("‚ ‚È‚½‚Í“dŒ‚‚ÉŽã‚¢B", "You are susceptible to damage from lightning."); } - if (is_immune_fire(creature_ptr)) { + if (has_immune_fire(creature_ptr)) { si_ptr->info[si_ptr->line++] = _("‚ ‚È‚½‚͉΂ɑ΂·‚銮‘S‚È‚é–Ɖu‚ðŽ‚Á‚Ä‚¢‚éB", "You are completely immune to fire."); } else if (creature_ptr->resist_fire && is_oppose_fire(creature_ptr)) { si_ptr->info[si_ptr->line++] = _("‚ ‚È‚½‚͉΂ւ̋­—͂ȑϐ«‚ðŽ‚Á‚Ä‚¢‚éB", "You resist fire exceptionally well."); @@ -34,11 +34,11 @@ void set_element_resistance_info(player_type* creature_ptr, self_info_type* si_p si_ptr->info[si_ptr->line++] = _("‚ ‚È‚½‚͉΂ւ̑ϐ«‚ðŽ‚Á‚Ä‚¢‚éB", "You are resistant to fire."); } - if (is_specific_player_race(creature_ptr, RACE_ENT) && !is_immune_fire(creature_ptr)) { + if (is_specific_player_race(creature_ptr, RACE_ENT) && !has_immune_fire(creature_ptr)) { si_ptr->info[si_ptr->line++] = _("‚ ‚È‚½‚͉΂ɎアB", "You are susceptible to damage from fire."); } - if (is_immune_cold(creature_ptr)) { + if (has_immune_cold(creature_ptr)) { si_ptr->info[si_ptr->line++] = _("‚ ‚È‚½‚Í—â‹C‚ɑ΂·‚銮‘S‚È‚é–Ɖu‚ðŽ‚Á‚Ä‚¢‚éB", "You are completely immune to cold."); } else if (creature_ptr->resist_cold && is_oppose_cold(creature_ptr)) { si_ptr->info[si_ptr->line++] = _("‚ ‚È‚½‚Í—â‹C‚Ö‚Ì‹­—͂ȑϐ«‚ðŽ‚Á‚Ä‚¢‚éB", "You resist cold exceptionally well."); diff --git a/src/player/player-damage.c b/src/player/player-damage.c index b1c3b7ee1..1e2775a57 100644 --- a/src/player/player-damage.c +++ b/src/player/player-damage.c @@ -229,7 +229,7 @@ HIT_POINT fire_dam(player_type *creature_ptr, HIT_POINT dam, concptr kb_str, int bool double_resist = is_oppose_fire(creature_ptr); /* Totally immune */ - if (is_immune_fire(creature_ptr) || (dam <= 0)) { + if (has_immune_fire(creature_ptr) || (dam <= 0)) { learn_spell(creature_ptr, monspell); return 0; } @@ -267,7 +267,7 @@ HIT_POINT cold_dam(player_type *creature_ptr, HIT_POINT dam, concptr kb_str, int bool double_resist = is_oppose_cold(creature_ptr); /* Total immunity */ - if (is_immune_cold(creature_ptr) || (dam <= 0)) { + if (has_immune_cold(creature_ptr) || (dam <= 0)) { learn_spell(creature_ptr, monspell); return 0; } @@ -654,15 +654,15 @@ static void process_aura_damage(monster_type *m_ptr, player_type *touched_ptr, b */ void touch_zap_player(monster_type *m_ptr, player_type *touched_ptr) { - process_aura_damage(m_ptr, touched_ptr, (bool)is_immune_fire(touched_ptr), offsetof(monster_race, flags2), offsetof(monster_race, r_flags2), + process_aura_damage(m_ptr, touched_ptr, (bool)has_immune_fire(touched_ptr), offsetof(monster_race, flags2), offsetof(monster_race, r_flags2), RF2_AURA_FIRE, fire_dam, _("突然とても熱くなった!", "You are suddenly very hot!")); - process_aura_damage(m_ptr, touched_ptr, (bool)is_immune_cold(touched_ptr), offsetof(monster_race, flags3), offsetof(monster_race, r_flags3), + process_aura_damage(m_ptr, touched_ptr, (bool)has_immune_cold(touched_ptr), offsetof(monster_race, flags3), offsetof(monster_race, r_flags3), RF3_AURA_COLD, cold_dam, _("突然とても寒くなった!", "You are suddenly very cold!")); - process_aura_damage(m_ptr, touched_ptr, (bool)is_immune_elec(touched_ptr), offsetof(monster_race, flags2), offsetof(monster_race, r_flags2), + process_aura_damage(m_ptr, touched_ptr, (bool)has_immune_elec(touched_ptr), offsetof(monster_race, flags2), offsetof(monster_race, r_flags2), RF2_AURA_ELEC, elec_dam, _("電撃をくらった!", "You get zapped!")); diff --git a/src/player/player-move.c b/src/player/player-move.c index 164491635..3ea88faa9 100644 --- a/src/player/player-move.c +++ b/src/player/player-move.c @@ -278,11 +278,11 @@ bool trap_can_be_ignored(player_type *creature_ptr, FEAT_IDX feat) return TRUE; break; case TRAP_FIRE: - if (is_immune_fire(creature_ptr)) + if (has_immune_fire(creature_ptr)) return TRUE; break; case TRAP_ACID: - if (is_immune_acid(creature_ptr)) + if (has_immune_acid(creature_ptr)) return TRUE; break; case TRAP_BLIND: diff --git a/src/player/player-status-flags.c b/src/player/player-status-flags.c index 95ff28c51..7f2b412c5 100644 --- a/src/player/player-status-flags.c +++ b/src/player/player-status-flags.c @@ -56,7 +56,7 @@ static BIT_FLAGS check_equipment_flags(player_type *creature_ptr, tr_type tr_fla /*! * @brief クリーチャーが壁破壊進行を持っているかを返す。 */ -bool is_kill_wall(player_type *creature_ptr) +bool has_kill_wall(player_type *creature_ptr) { if (creature_ptr->mimic_form == MIMIC_DEMON_LORD || music_singing(creature_ptr, MUSIC_WALL)) { return TRUE; @@ -75,7 +75,7 @@ bool is_kill_wall(player_type *creature_ptr) /*! * @brief クリーチャーが壁通過を持っているかを返す。 */ -bool is_pass_wall(player_type *creature_ptr) +bool has_pass_wall(player_type *creature_ptr) { bool pow = FALSE; @@ -96,7 +96,7 @@ bool is_pass_wall(player_type *creature_ptr) /*! * @brief クリーチャーが強力射を持っているかを返す。 */ -BIT_FLAGS is_xtra_might(player_type *creature_ptr) +BIT_FLAGS has_xtra_might(player_type *creature_ptr) { BIT_FLAGS result = 0L; result |= check_equipment_flags(creature_ptr, TR_XTRA_MIGHT); @@ -106,7 +106,7 @@ BIT_FLAGS is_xtra_might(player_type *creature_ptr) /*! * @brief クリーチャーが邪悪感知を持っているかを返す。 */ -BIT_FLAGS is_esp_evil(player_type *creature_ptr) +BIT_FLAGS has_esp_evil(player_type *creature_ptr) { BIT_FLAGS result = 0L; if (creature_ptr->realm1 == REALM_HEX) { @@ -120,7 +120,7 @@ BIT_FLAGS is_esp_evil(player_type *creature_ptr) /*! * @brief クリーチャーが自然界の動物感知を持っているかを返す。 */ -BIT_FLAGS is_esp_animal(player_type *creature_ptr) +BIT_FLAGS has_esp_animal(player_type *creature_ptr) { BIT_FLAGS result = 0L; result |= check_equipment_flags(creature_ptr, TR_ESP_ANIMAL); @@ -130,77 +130,77 @@ BIT_FLAGS is_esp_animal(player_type *creature_ptr) /*! * @brief クリーチャーがアンデッド感知を持っているかを返す。 */ -BIT_FLAGS is_esp_undead(player_type *creature_ptr) +BIT_FLAGS has_esp_undead(player_type *creature_ptr) { BIT_FLAGS result = 0L; result |= check_equipment_flags(creature_ptr, TR_ESP_UNDEAD); return result; } -BIT_FLAGS is_esp_demon(player_type *creature_ptr) +BIT_FLAGS has_esp_demon(player_type *creature_ptr) { BIT_FLAGS result = 0L; result |= check_equipment_flags(creature_ptr, TR_ESP_DEMON); return result; } -BIT_FLAGS is_esp_orc(player_type *creature_ptr) +BIT_FLAGS has_esp_orc(player_type *creature_ptr) { BIT_FLAGS result = 0L; result |= check_equipment_flags(creature_ptr, TR_ESP_ORC); return result; } -BIT_FLAGS is_esp_troll(player_type *creature_ptr) +BIT_FLAGS has_esp_troll(player_type *creature_ptr) { BIT_FLAGS result = 0L; result |= check_equipment_flags(creature_ptr, TR_ESP_TROLL); return result; } -BIT_FLAGS is_esp_giant(player_type *creature_ptr) +BIT_FLAGS has_esp_giant(player_type *creature_ptr) { BIT_FLAGS result = 0L; result |= check_equipment_flags(creature_ptr, TR_ESP_GIANT); return result; } -BIT_FLAGS is_esp_dragon(player_type *creature_ptr) +BIT_FLAGS has_esp_dragon(player_type *creature_ptr) { BIT_FLAGS result = 0L; result |= check_equipment_flags(creature_ptr, TR_ESP_DRAGON); return result; } -BIT_FLAGS is_esp_human(player_type *creature_ptr) +BIT_FLAGS has_esp_human(player_type *creature_ptr) { BIT_FLAGS result = 0L; result |= check_equipment_flags(creature_ptr, TR_ESP_HUMAN); return result; } -BIT_FLAGS is_esp_good(player_type *creature_ptr) +BIT_FLAGS has_esp_good(player_type *creature_ptr) { BIT_FLAGS result = 0L; result |= check_equipment_flags(creature_ptr, TR_ESP_GOOD); return result; } -BIT_FLAGS is_esp_nonliving(player_type *creature_ptr) +BIT_FLAGS has_esp_nonliving(player_type *creature_ptr) { BIT_FLAGS result = 0L; result |= check_equipment_flags(creature_ptr, TR_ESP_GOOD); return result; } -BIT_FLAGS is_esp_unique(player_type *creature_ptr) +BIT_FLAGS has_esp_unique(player_type *creature_ptr) { BIT_FLAGS result = 0L; result |= check_equipment_flags(creature_ptr, TR_ESP_UNIQUE); return result; } -BIT_FLAGS is_esp_telepathy(player_type *creature_ptr) +BIT_FLAGS has_esp_telepathy(player_type *creature_ptr) { BIT_FLAGS result = 0L; @@ -571,7 +571,7 @@ BIT_FLAGS has_free_act(player_type *creature_ptr) return result; } -BIT_FLAGS is_sustain_str(player_type *creature_ptr) +BIT_FLAGS has_sustain_str(player_type *creature_ptr) { BIT_FLAGS result = 0L; @@ -595,7 +595,7 @@ BIT_FLAGS is_sustain_str(player_type *creature_ptr) return result; } -BIT_FLAGS is_sustain_int(player_type *creature_ptr) +BIT_FLAGS has_sustain_int(player_type *creature_ptr) { BIT_FLAGS result = 0L; @@ -615,7 +615,7 @@ BIT_FLAGS is_sustain_int(player_type *creature_ptr) return result; } -BIT_FLAGS is_sustain_wis(player_type *creature_ptr) +BIT_FLAGS has_sustain_wis(player_type *creature_ptr) { BIT_FLAGS result = 0L; @@ -639,7 +639,7 @@ BIT_FLAGS is_sustain_wis(player_type *creature_ptr) return result; } -BIT_FLAGS is_sustain_dex(player_type *creature_ptr) +BIT_FLAGS has_sustain_dex(player_type *creature_ptr) { BIT_FLAGS result = 0L; if (creature_ptr->pclass == CLASS_BERSERKER) { @@ -661,7 +661,7 @@ BIT_FLAGS is_sustain_dex(player_type *creature_ptr) return result; } -BIT_FLAGS is_sustain_con(player_type *creature_ptr) +BIT_FLAGS has_sustain_con(player_type *creature_ptr) { BIT_FLAGS result = 0L; if (creature_ptr->pclass == CLASS_BERSERKER) { @@ -684,7 +684,7 @@ BIT_FLAGS is_sustain_con(player_type *creature_ptr) return result; } -BIT_FLAGS is_sustain_chr(player_type *creature_ptr) +BIT_FLAGS has_sustain_chr(player_type *creature_ptr) { BIT_FLAGS result = 0L; @@ -934,7 +934,7 @@ void has_extra_blow(player_type *creature_ptr) } } -BIT_FLAGS is_resist_acid(player_type *creature_ptr) +BIT_FLAGS has_resist_acid(player_type *creature_ptr) { BIT_FLAGS result = 0L; @@ -954,13 +954,13 @@ BIT_FLAGS is_resist_acid(player_type *creature_ptr) result |= 0x01 << FLAG_CAUSE_MAGIC_TIME_EFFECT; } - result |= is_immune_acid(creature_ptr); + result |= has_immune_acid(creature_ptr); result |= check_equipment_flags(creature_ptr, TR_RES_ACID); return result; } -BIT_FLAGS is_vuln_acid(player_type *creature_ptr) +BIT_FLAGS has_vuln_acid(player_type *creature_ptr) { BIT_FLAGS result = 0L; if (creature_ptr->muta3 & MUT3_VULN_ELEM) { @@ -973,7 +973,7 @@ BIT_FLAGS is_vuln_acid(player_type *creature_ptr) return result; } -BIT_FLAGS is_resist_elec(player_type *creature_ptr) +BIT_FLAGS has_resist_elec(player_type *creature_ptr) { BIT_FLAGS result = 0L; @@ -992,11 +992,11 @@ BIT_FLAGS is_resist_elec(player_type *creature_ptr) } result |= check_equipment_flags(creature_ptr, TR_RES_ELEC); - result |= is_immune_elec(creature_ptr); + result |= has_immune_elec(creature_ptr); return result; } -BIT_FLAGS is_vuln_elec(player_type *creature_ptr) +BIT_FLAGS has_vuln_elec(player_type *creature_ptr) { BIT_FLAGS result = 0L; if (creature_ptr->muta3 & MUT3_VULN_ELEM) { @@ -1013,7 +1013,7 @@ BIT_FLAGS is_vuln_elec(player_type *creature_ptr) return result; } -BIT_FLAGS is_resist_fire(player_type *creature_ptr) +BIT_FLAGS has_resist_fire(player_type *creature_ptr) { BIT_FLAGS result = 0L; @@ -1038,11 +1038,11 @@ BIT_FLAGS is_resist_fire(player_type *creature_ptr) } result |= check_equipment_flags(creature_ptr, TR_RES_FIRE); - result |= is_immune_fire(creature_ptr); + result |= has_immune_fire(creature_ptr); return result; } -BIT_FLAGS is_vuln_fire(player_type *creature_ptr) +BIT_FLAGS has_vuln_fire(player_type *creature_ptr) { BIT_FLAGS result = 0L; if (creature_ptr->muta3 & MUT3_VULN_ELEM) { @@ -1059,7 +1059,7 @@ BIT_FLAGS is_vuln_fire(player_type *creature_ptr) return result; } -BIT_FLAGS is_resist_cold(player_type *creature_ptr) +BIT_FLAGS has_resist_cold(player_type *creature_ptr) { BIT_FLAGS result = 0L; @@ -1088,11 +1088,11 @@ BIT_FLAGS is_resist_cold(player_type *creature_ptr) } result |= check_equipment_flags(creature_ptr, TR_RES_COLD); - result |= is_immune_cold(creature_ptr); + result |= has_immune_cold(creature_ptr); return result; } -BIT_FLAGS is_vuln_cold(player_type *creature_ptr) +BIT_FLAGS has_vuln_cold(player_type *creature_ptr) { BIT_FLAGS result = 0L; if (creature_ptr->muta3 & MUT3_VULN_ELEM) { @@ -1105,7 +1105,7 @@ BIT_FLAGS is_vuln_cold(player_type *creature_ptr) return result; } -BIT_FLAGS is_resist_pois(player_type *creature_ptr) +BIT_FLAGS has_resist_pois(player_type *creature_ptr) { BIT_FLAGS result = 0L; @@ -1138,7 +1138,7 @@ BIT_FLAGS is_resist_pois(player_type *creature_ptr) return result; } -BIT_FLAGS is_resist_conf(player_type *creature_ptr) +BIT_FLAGS has_resist_conf(player_type *creature_ptr) { BIT_FLAGS result = 0L; @@ -1169,7 +1169,7 @@ BIT_FLAGS is_resist_conf(player_type *creature_ptr) return result; } -BIT_FLAGS is_resist_sound(player_type *creature_ptr) +BIT_FLAGS has_resist_sound(player_type *creature_ptr) { BIT_FLAGS result = 0L; @@ -1193,7 +1193,7 @@ BIT_FLAGS is_resist_sound(player_type *creature_ptr) return result; } -BIT_FLAGS is_resist_lite(player_type *creature_ptr) +BIT_FLAGS has_resist_lite(player_type *creature_ptr) { BIT_FLAGS result = 0L; @@ -1213,7 +1213,7 @@ BIT_FLAGS is_resist_lite(player_type *creature_ptr) return result; } -BIT_FLAGS is_vuln_lite(player_type *creature_ptr) +BIT_FLAGS has_vuln_lite(player_type *creature_ptr) { BIT_FLAGS result = 0L; if (is_specific_player_race(creature_ptr, RACE_S_FAIRY) || is_specific_player_race(creature_ptr, RACE_VAMPIRE) @@ -1228,7 +1228,7 @@ BIT_FLAGS is_vuln_lite(player_type *creature_ptr) return result; } -BIT_FLAGS is_resist_dark(player_type *creature_ptr) +BIT_FLAGS has_resist_dark(player_type *creature_ptr) { BIT_FLAGS result = 0L; @@ -1254,7 +1254,7 @@ BIT_FLAGS is_resist_dark(player_type *creature_ptr) return result; } -BIT_FLAGS is_resist_chaos(player_type *creature_ptr) +BIT_FLAGS has_resist_chaos(player_type *creature_ptr) { BIT_FLAGS result = 0L; @@ -1280,7 +1280,7 @@ BIT_FLAGS is_resist_chaos(player_type *creature_ptr) return result; } -BIT_FLAGS is_resist_disen(player_type *creature_ptr) +BIT_FLAGS has_resist_disen(player_type *creature_ptr) { BIT_FLAGS result = 0L; @@ -1303,7 +1303,7 @@ BIT_FLAGS is_resist_disen(player_type *creature_ptr) return result; } -BIT_FLAGS is_resist_shard(player_type *creature_ptr) +BIT_FLAGS has_resist_shard(player_type *creature_ptr) { BIT_FLAGS result = 0L; @@ -1322,7 +1322,7 @@ BIT_FLAGS is_resist_shard(player_type *creature_ptr) return result; } -BIT_FLAGS is_resist_nexus(player_type *creature_ptr) +BIT_FLAGS has_resist_nexus(player_type *creature_ptr) { BIT_FLAGS result = 0L; @@ -1342,7 +1342,7 @@ BIT_FLAGS is_resist_nexus(player_type *creature_ptr) return result; } -BIT_FLAGS is_resist_blind(player_type *creature_ptr) +BIT_FLAGS has_resist_blind(player_type *creature_ptr) { BIT_FLAGS result = 0L; @@ -1365,7 +1365,7 @@ BIT_FLAGS is_resist_blind(player_type *creature_ptr) return result; } -BIT_FLAGS is_resist_neth(player_type *creature_ptr) +BIT_FLAGS has_resist_neth(player_type *creature_ptr) { BIT_FLAGS result = 0L; @@ -1390,7 +1390,7 @@ BIT_FLAGS is_resist_neth(player_type *creature_ptr) return result; } -BIT_FLAGS is_resist_time(player_type *creature_ptr) +BIT_FLAGS has_resist_time(player_type *creature_ptr) { BIT_FLAGS result = 0L; @@ -1402,7 +1402,7 @@ BIT_FLAGS is_resist_time(player_type *creature_ptr) return result; } -BIT_FLAGS is_resist_water(player_type *creature_ptr) +BIT_FLAGS has_resist_water(player_type *creature_ptr) { BIT_FLAGS result = 0L; @@ -1413,7 +1413,7 @@ BIT_FLAGS is_resist_water(player_type *creature_ptr) return result; } -BIT_FLAGS is_resist_fear(player_type *creature_ptr) +BIT_FLAGS has_resist_fear(player_type *creature_ptr) { BIT_FLAGS result = 0L; @@ -1459,7 +1459,7 @@ BIT_FLAGS is_resist_fear(player_type *creature_ptr) return result; } -BIT_FLAGS is_immune_acid(player_type *creature_ptr) +BIT_FLAGS has_immune_acid(player_type *creature_ptr) { BIT_FLAGS result = 0L; if (!creature_ptr->mimic_form && creature_ptr->prace == RACE_YEEK && creature_ptr->lev > 19) @@ -1474,7 +1474,7 @@ BIT_FLAGS is_immune_acid(player_type *creature_ptr) return result; } -BIT_FLAGS is_immune_elec(player_type *creature_ptr) +BIT_FLAGS has_immune_elec(player_type *creature_ptr) { BIT_FLAGS result = 0L; @@ -1487,7 +1487,7 @@ BIT_FLAGS is_immune_elec(player_type *creature_ptr) return result; } -BIT_FLAGS is_immune_fire(player_type *creature_ptr) +BIT_FLAGS has_immune_fire(player_type *creature_ptr) { BIT_FLAGS result = 0L; @@ -1500,7 +1500,7 @@ BIT_FLAGS is_immune_fire(player_type *creature_ptr) return result; } -BIT_FLAGS is_immune_cold(player_type *creature_ptr) +BIT_FLAGS has_immune_cold(player_type *creature_ptr) { BIT_FLAGS result = 0L; @@ -1513,7 +1513,7 @@ BIT_FLAGS is_immune_cold(player_type *creature_ptr) return result; } -BIT_FLAGS is_immune_dark(player_type *creature_ptr) +BIT_FLAGS has_immune_dark(player_type *creature_ptr) { BIT_FLAGS result = 0L; @@ -1594,7 +1594,7 @@ BIT_FLAGS has_lite(player_type *creature_ptr) return result; } -bool is_disable_two_handed_bonus(player_type *creature_ptr, int i) +bool has_disable_two_handed_bonus(player_type *creature_ptr, int i) { object_type *o_ptr; o_ptr = &creature_ptr->inventory_list[INVEN_RARM + i]; @@ -1606,7 +1606,7 @@ bool is_disable_two_handed_bonus(player_type *creature_ptr, int i) return FALSE; } -bool is_icky_wield_weapon(player_type *creature_ptr, int i) +bool has_icky_wield_weapon(player_type *creature_ptr, int i) { object_type *o_ptr; BIT_FLAGS flgs[TR_FLAG_SIZE]; @@ -1620,13 +1620,13 @@ bool is_icky_wield_weapon(player_type *creature_ptr, int i) return TRUE; } } - if (is_not_monk_weapon(creature_ptr, i) || is_not_ninja_weapon(creature_ptr, i)) { + if (has_not_monk_weapon(creature_ptr, i) || has_not_ninja_weapon(creature_ptr, i)) { return TRUE; } return FALSE; } -bool is_riding_wield_weapon(player_type *creature_ptr, int i) +bool has_riding_wield_weapon(player_type *creature_ptr, int i) { object_type *o_ptr; BIT_FLAGS flgs[TR_FLAG_SIZE]; @@ -1639,7 +1639,7 @@ bool is_riding_wield_weapon(player_type *creature_ptr, int i) return FALSE; } -bool is_not_ninja_weapon(player_type *creature_ptr, int i) +bool has_not_ninja_weapon(player_type *creature_ptr, int i) { tval_type tval = creature_ptr->inventory_list[INVEN_RARM + i].tval - TV_WEAPON_BEGIN; OBJECT_SUBTYPE_VALUE sval = creature_ptr->inventory_list[INVEN_RARM + i].sval; @@ -1647,7 +1647,7 @@ bool is_not_ninja_weapon(player_type *creature_ptr, int i) && !((s_info[CLASS_NINJA].w_max[tval][sval] > WEAPON_EXP_BEGINNER) && (creature_ptr->inventory_list[INVEN_LARM - i].tval != TV_SHIELD)); } -bool is_not_monk_weapon(player_type *creature_ptr, int i) +bool has_not_monk_weapon(player_type *creature_ptr, int i) { tval_type tval = creature_ptr->inventory_list[INVEN_RARM + i].tval - TV_WEAPON_BEGIN; OBJECT_SUBTYPE_VALUE sval = creature_ptr->inventory_list[INVEN_RARM + i].sval; diff --git a/src/player/player-status-flags.h b/src/player/player-status-flags.h index 9506e6735..53a64b4c5 100644 --- a/src/player/player-status-flags.h +++ b/src/player/player-status-flags.h @@ -22,22 +22,22 @@ enum flag_cause { FLAG_CAUSE_MAX = 18 }; -bool is_pass_wall(player_type *creature_ptr); -bool is_kill_wall(player_type *creature_ptr); -BIT_FLAGS is_xtra_might(player_type *creature_ptr); -BIT_FLAGS is_esp_evil(player_type *creature_ptr); -BIT_FLAGS is_esp_animal(player_type *creature_ptr); -BIT_FLAGS is_esp_undead(player_type *creature_ptr); -BIT_FLAGS is_esp_demon(player_type *creature_ptr); -BIT_FLAGS is_esp_orc(player_type *creature_ptr); -BIT_FLAGS is_esp_troll(player_type *creature_ptr); -BIT_FLAGS is_esp_giant(player_type *creature_ptr); -BIT_FLAGS is_esp_dragon(player_type *creature_ptr); -BIT_FLAGS is_esp_human(player_type *creature_ptr); -BIT_FLAGS is_esp_good(player_type *creature_ptr); -BIT_FLAGS is_esp_nonliving(player_type *creature_ptr); -BIT_FLAGS is_esp_unique(player_type *creature_ptr); -BIT_FLAGS is_esp_telepathy(player_type *creature_ptr); +bool has_pass_wall(player_type *creature_ptr); +bool has_kill_wall(player_type *creature_ptr); +BIT_FLAGS has_xtra_might(player_type *creature_ptr); +BIT_FLAGS has_esp_evil(player_type *creature_ptr); +BIT_FLAGS has_esp_animal(player_type *creature_ptr); +BIT_FLAGS has_esp_undead(player_type *creature_ptr); +BIT_FLAGS has_esp_demon(player_type *creature_ptr); +BIT_FLAGS has_esp_orc(player_type *creature_ptr); +BIT_FLAGS has_esp_troll(player_type *creature_ptr); +BIT_FLAGS has_esp_giant(player_type *creature_ptr); +BIT_FLAGS has_esp_dragon(player_type *creature_ptr); +BIT_FLAGS has_esp_human(player_type *creature_ptr); +BIT_FLAGS has_esp_good(player_type *creature_ptr); +BIT_FLAGS has_esp_nonliving(player_type *creature_ptr); +BIT_FLAGS has_esp_unique(player_type *creature_ptr); +BIT_FLAGS has_esp_telepathy(player_type *creature_ptr); BIT_FLAGS has_bless_blade(player_type *creature_ptr); BIT_FLAGS has_easy2_weapon(player_type *creature_ptr); BIT_FLAGS has_down_saving(player_type *creature_ptr); @@ -60,12 +60,12 @@ BIT_FLAGS has_hold_exp(player_type *creature_ptr); BIT_FLAGS has_see_inv(player_type *creature_ptr); BIT_FLAGS has_magic_mastery(player_type *creature_ptr); BIT_FLAGS has_free_act(player_type *creature_ptr); -BIT_FLAGS is_sustain_str(player_type *creature_ptr); -BIT_FLAGS is_sustain_int(player_type *creature_ptr); -BIT_FLAGS is_sustain_wis(player_type *creature_ptr); -BIT_FLAGS is_sustain_dex(player_type *creature_ptr); -BIT_FLAGS is_sustain_con(player_type *creature_ptr); -BIT_FLAGS is_sustain_chr(player_type *creature_ptr); +BIT_FLAGS has_sustain_str(player_type *creature_ptr); +BIT_FLAGS has_sustain_int(player_type *creature_ptr); +BIT_FLAGS has_sustain_wis(player_type *creature_ptr); +BIT_FLAGS has_sustain_dex(player_type *creature_ptr); +BIT_FLAGS has_sustain_con(player_type *creature_ptr); +BIT_FLAGS has_sustain_chr(player_type *creature_ptr); BIT_FLAGS has_levitation(player_type *creature_ptr); void has_can_swim(player_type *creature_ptr); BIT_FLAGS has_slow_digest(player_type *creature_ptr); @@ -73,41 +73,41 @@ BIT_FLAGS has_regenerate(player_type *creature_ptr); void has_curses(player_type *creature_ptr); BIT_FLAGS has_impact(player_type *creature_ptr); void has_extra_blow(player_type *creature_ptr); -BIT_FLAGS is_resist_acid(player_type *creature_ptr); -BIT_FLAGS is_vuln_acid(player_type *creature_ptr); -BIT_FLAGS is_resist_elec(player_type *creature_ptr); -BIT_FLAGS is_vuln_elec(player_type *creature_ptr); -BIT_FLAGS is_resist_fire(player_type *creature_ptr); -BIT_FLAGS is_vuln_fire(player_type *creature_ptr); -BIT_FLAGS is_resist_cold(player_type *creature_ptr); -BIT_FLAGS is_vuln_cold(player_type *creature_ptr); -BIT_FLAGS is_resist_pois(player_type *creature_ptr); -BIT_FLAGS is_resist_conf(player_type *creature_ptr); -BIT_FLAGS is_resist_sound(player_type *creature_ptr); -BIT_FLAGS is_resist_lite(player_type *creature_ptr); -BIT_FLAGS is_vuln_lite(player_type *creature_ptr); -BIT_FLAGS is_resist_dark(player_type *creature_ptr); -BIT_FLAGS is_resist_chaos(player_type *creature_ptr); -BIT_FLAGS is_resist_disen(player_type *creature_ptr); -BIT_FLAGS is_resist_shard(player_type *creature_ptr); -BIT_FLAGS is_resist_nexus(player_type *creature_ptr); -BIT_FLAGS is_resist_blind(player_type *creature_ptr); -BIT_FLAGS is_resist_neth(player_type *creature_ptr); -BIT_FLAGS is_resist_time(player_type *creature_ptr); -BIT_FLAGS is_resist_water(player_type *creature_ptr); -BIT_FLAGS is_resist_fear(player_type *creature_ptr); -BIT_FLAGS is_immune_acid(player_type *creature_ptr); -BIT_FLAGS is_immune_elec(player_type *creature_ptr); -BIT_FLAGS is_immune_fire(player_type *creature_ptr); -BIT_FLAGS is_immune_cold(player_type *creature_ptr); -BIT_FLAGS is_immune_dark(player_type *creature_ptr); +BIT_FLAGS has_resist_acid(player_type *creature_ptr); +BIT_FLAGS has_vuln_acid(player_type *creature_ptr); +BIT_FLAGS has_resist_elec(player_type *creature_ptr); +BIT_FLAGS has_vuln_elec(player_type *creature_ptr); +BIT_FLAGS has_resist_fire(player_type *creature_ptr); +BIT_FLAGS has_vuln_fire(player_type *creature_ptr); +BIT_FLAGS has_resist_cold(player_type *creature_ptr); +BIT_FLAGS has_vuln_cold(player_type *creature_ptr); +BIT_FLAGS has_resist_pois(player_type *creature_ptr); +BIT_FLAGS has_resist_conf(player_type *creature_ptr); +BIT_FLAGS has_resist_sound(player_type *creature_ptr); +BIT_FLAGS has_resist_lite(player_type *creature_ptr); +BIT_FLAGS has_vuln_lite(player_type *creature_ptr); +BIT_FLAGS has_resist_dark(player_type *creature_ptr); +BIT_FLAGS has_resist_chaos(player_type *creature_ptr); +BIT_FLAGS has_resist_disen(player_type *creature_ptr); +BIT_FLAGS has_resist_shard(player_type *creature_ptr); +BIT_FLAGS has_resist_nexus(player_type *creature_ptr); +BIT_FLAGS has_resist_blind(player_type *creature_ptr); +BIT_FLAGS has_resist_neth(player_type *creature_ptr); +BIT_FLAGS has_resist_time(player_type *creature_ptr); +BIT_FLAGS has_resist_water(player_type *creature_ptr); +BIT_FLAGS has_resist_fear(player_type *creature_ptr); +BIT_FLAGS has_immune_acid(player_type *creature_ptr); +BIT_FLAGS has_immune_elec(player_type *creature_ptr); +BIT_FLAGS has_immune_fire(player_type *creature_ptr); +BIT_FLAGS has_immune_cold(player_type *creature_ptr); +BIT_FLAGS has_immune_dark(player_type *creature_ptr); bool has_right_hand_weapon(player_type *creature_ptr); bool has_left_hand_weapon(player_type *creature_ptr); bool has_two_handed_weapons(player_type *creature_ptr); BIT_FLAGS has_lite(player_type *creature_ptr); -bool is_disable_two_handed_bonus(player_type *creature_ptr, int i); -bool is_not_ninja_weapon(player_type *creature_ptr, int i); -bool is_not_monk_weapon(player_type *creature_ptr, int i); -bool is_icky_wield_weapon(player_type *creature_ptr, int i); -bool is_riding_wield_weapon(player_type *creature_ptr, int i); +bool has_disable_two_handed_bonus(player_type *creature_ptr, int i); +bool has_not_ninja_weapon(player_type *creature_ptr, int i); +bool has_not_monk_weapon(player_type *creature_ptr, int i); +bool has_icky_wield_weapon(player_type *creature_ptr, int i); +bool has_riding_wield_weapon(player_type *creature_ptr, int i); bool has_good_luck(player_type *creature_ptr); diff --git a/src/player/player-status-resist.c b/src/player/player-status-resist.c index 0340a74b0..9c740d0a8 100644 --- a/src/player/player-status-resist.c +++ b/src/player/player-status-resist.c @@ -65,11 +65,11 @@ PERCENTAGE calc_acid_damage_rate(player_type *creature_ptr) PERCENTAGE per = 100; int i; - if (is_immune_acid(creature_ptr)) { + if (has_immune_acid(creature_ptr)) { return 0; } - BIT_FLAGS flgs = is_vuln_acid(creature_ptr); + BIT_FLAGS flgs = has_vuln_acid(creature_ptr); for (i = 0; i < FLAG_CAUSE_MAX; i++) { if (flgs & (0x01 << i)) { if (i == FLAG_CAUSE_MUTATION) { @@ -96,11 +96,11 @@ PERCENTAGE calc_elec_damage_rate(player_type *creature_ptr) PERCENTAGE per = 100; int i; - if (is_immune_elec(creature_ptr)) { + if (has_immune_elec(creature_ptr)) { return 0; } - BIT_FLAGS flgs = is_vuln_elec(creature_ptr); + BIT_FLAGS flgs = has_vuln_elec(creature_ptr); for (i = 0; i < FLAG_CAUSE_MAX; i++) { if (flgs & (0x01 << i)) { if (i == FLAG_CAUSE_MUTATION) { @@ -126,7 +126,7 @@ PERCENTAGE calc_fire_damage_rate(player_type *creature_ptr) { PERCENTAGE per = 100; int i; - BIT_FLAGS flgs = is_vuln_fire(creature_ptr); + BIT_FLAGS flgs = has_vuln_fire(creature_ptr); for (i = 0; i < FLAG_CAUSE_MAX; i++) { if (flgs & (0x01 << i)) { if (i == FLAG_CAUSE_MUTATION) { @@ -153,7 +153,7 @@ PERCENTAGE calc_cold_damage_rate(player_type *creature_ptr) { PERCENTAGE per = 100; int i; - BIT_FLAGS flgs = is_vuln_cold(creature_ptr); + BIT_FLAGS flgs = has_vuln_cold(creature_ptr); for (i = 0; i < FLAG_CAUSE_MAX; i++) { if (flgs & (0x01 << i)) { if (i == FLAG_CAUSE_MUTATION) { diff --git a/src/player/player-status.c b/src/player/player-status.c index 55646cc77..057ba4d3c 100644 --- a/src/player/player-status.c +++ b/src/player/player-status.c @@ -319,22 +319,22 @@ void calc_bonuses(player_type *creature_ptr) ARMOUR_CLASS old_dis_ac = creature_ptr->dis_ac; ARMOUR_CLASS old_dis_to_a = creature_ptr->dis_to_a; - creature_ptr->pass_wall = is_pass_wall(creature_ptr); - creature_ptr->kill_wall = is_kill_wall(creature_ptr); - creature_ptr->xtra_might = is_xtra_might(creature_ptr); - creature_ptr->esp_evil = is_esp_evil(creature_ptr); - creature_ptr->esp_animal = is_esp_animal(creature_ptr); - creature_ptr->esp_undead = is_esp_undead(creature_ptr); - creature_ptr->esp_demon = is_esp_demon(creature_ptr); - creature_ptr->esp_orc = is_esp_orc(creature_ptr); - creature_ptr->esp_troll = is_esp_troll(creature_ptr); - creature_ptr->esp_giant = is_esp_giant(creature_ptr); - creature_ptr->esp_dragon = is_esp_dragon(creature_ptr); - creature_ptr->esp_human = is_esp_human(creature_ptr); - creature_ptr->esp_good = is_esp_good(creature_ptr); - creature_ptr->esp_nonliving = is_esp_nonliving(creature_ptr); - creature_ptr->esp_unique = is_esp_unique(creature_ptr); - creature_ptr->telepathy = is_esp_telepathy(creature_ptr); + creature_ptr->pass_wall = has_pass_wall(creature_ptr); + creature_ptr->kill_wall = has_kill_wall(creature_ptr); + creature_ptr->xtra_might = has_xtra_might(creature_ptr); + creature_ptr->esp_evil = has_esp_evil(creature_ptr); + creature_ptr->esp_animal = has_esp_animal(creature_ptr); + creature_ptr->esp_undead = has_esp_undead(creature_ptr); + creature_ptr->esp_demon = has_esp_demon(creature_ptr); + creature_ptr->esp_orc = has_esp_orc(creature_ptr); + creature_ptr->esp_troll = has_esp_troll(creature_ptr); + creature_ptr->esp_giant = has_esp_giant(creature_ptr); + creature_ptr->esp_dragon = has_esp_dragon(creature_ptr); + creature_ptr->esp_human = has_esp_human(creature_ptr); + creature_ptr->esp_good = has_esp_good(creature_ptr); + creature_ptr->esp_nonliving = has_esp_nonliving(creature_ptr); + creature_ptr->esp_unique = has_esp_unique(creature_ptr); + creature_ptr->telepathy = has_esp_telepathy(creature_ptr); creature_ptr->bless_blade = has_bless_blade(creature_ptr); creature_ptr->easy_2weapon = has_easy2_weapon(creature_ptr); creature_ptr->down_saving = has_down_saving(creature_ptr); @@ -354,12 +354,12 @@ void calc_bonuses(player_type *creature_ptr) creature_ptr->hold_exp = has_hold_exp(creature_ptr); creature_ptr->see_inv = has_see_inv(creature_ptr); creature_ptr->free_act = has_free_act(creature_ptr); - creature_ptr->sustain_str = is_sustain_str(creature_ptr); - creature_ptr->sustain_int = is_sustain_int(creature_ptr); - creature_ptr->sustain_wis = is_sustain_wis(creature_ptr); - creature_ptr->sustain_dex = is_sustain_dex(creature_ptr); - creature_ptr->sustain_con = is_sustain_con(creature_ptr); - creature_ptr->sustain_chr = is_sustain_chr(creature_ptr); + creature_ptr->sustain_str = has_sustain_str(creature_ptr); + creature_ptr->sustain_int = has_sustain_int(creature_ptr); + creature_ptr->sustain_wis = has_sustain_wis(creature_ptr); + creature_ptr->sustain_dex = has_sustain_dex(creature_ptr); + creature_ptr->sustain_con = has_sustain_con(creature_ptr); + creature_ptr->sustain_chr = has_sustain_chr(creature_ptr); creature_ptr->levitation = has_levitation(creature_ptr); has_can_swim(creature_ptr); creature_ptr->slow_digest = has_slow_digest(creature_ptr); @@ -367,25 +367,25 @@ void calc_bonuses(player_type *creature_ptr) has_curses(creature_ptr); creature_ptr->impact = has_impact(creature_ptr); has_extra_blow(creature_ptr); - creature_ptr->resist_acid = is_resist_acid(creature_ptr); - creature_ptr->resist_elec = is_resist_elec(creature_ptr); - creature_ptr->resist_fire = is_resist_fire(creature_ptr); - creature_ptr->resist_cold = is_resist_cold(creature_ptr); - creature_ptr->resist_pois = is_resist_pois(creature_ptr); - creature_ptr->resist_conf = is_resist_conf(creature_ptr); - creature_ptr->resist_sound = is_resist_sound(creature_ptr); - creature_ptr->resist_lite = is_resist_lite(creature_ptr); - creature_ptr->resist_dark = is_resist_dark(creature_ptr); - creature_ptr->resist_chaos = is_resist_chaos(creature_ptr); - creature_ptr->resist_disen = is_resist_disen(creature_ptr); - creature_ptr->resist_shard = is_resist_shard(creature_ptr); - creature_ptr->resist_nexus = is_resist_nexus(creature_ptr); - creature_ptr->resist_blind = is_resist_blind(creature_ptr); - creature_ptr->resist_neth = is_resist_neth(creature_ptr); - creature_ptr->resist_time = is_resist_time(creature_ptr); - creature_ptr->resist_fear = is_resist_fear(creature_ptr); - creature_ptr->resist_time = is_resist_time(creature_ptr); - creature_ptr->resist_water = is_resist_water(creature_ptr); + creature_ptr->resist_acid = has_resist_acid(creature_ptr); + creature_ptr->resist_elec = has_resist_elec(creature_ptr); + creature_ptr->resist_fire = has_resist_fire(creature_ptr); + creature_ptr->resist_cold = has_resist_cold(creature_ptr); + creature_ptr->resist_pois = has_resist_pois(creature_ptr); + creature_ptr->resist_conf = has_resist_conf(creature_ptr); + creature_ptr->resist_sound = has_resist_sound(creature_ptr); + creature_ptr->resist_lite = has_resist_lite(creature_ptr); + creature_ptr->resist_dark = has_resist_dark(creature_ptr); + creature_ptr->resist_chaos = has_resist_chaos(creature_ptr); + creature_ptr->resist_disen = has_resist_disen(creature_ptr); + creature_ptr->resist_shard = has_resist_shard(creature_ptr); + creature_ptr->resist_nexus = has_resist_nexus(creature_ptr); + creature_ptr->resist_blind = has_resist_blind(creature_ptr); + creature_ptr->resist_neth = has_resist_neth(creature_ptr); + creature_ptr->resist_time = has_resist_time(creature_ptr); + creature_ptr->resist_fear = has_resist_fear(creature_ptr); + creature_ptr->resist_time = has_resist_time(creature_ptr); + creature_ptr->resist_water = has_resist_water(creature_ptr); creature_ptr->lite = has_lite(creature_ptr); @@ -428,8 +428,8 @@ void calc_bonuses(player_type *creature_ptr) } for (int i = 0; i < 2; i++) { - creature_ptr->icky_wield[i] = is_icky_wield_weapon(creature_ptr, i); - creature_ptr->riding_wield[i] = is_riding_wield_weapon(creature_ptr, i); + creature_ptr->icky_wield[i] = has_icky_wield_weapon(creature_ptr, i); + creature_ptr->riding_wield[i] = has_riding_wield_weapon(creature_ptr, i); creature_ptr->num_blow[i] = calc_num_blow(creature_ptr, i); creature_ptr->to_dd[i] = calc_to_weapon_dice_num(creature_ptr, INVEN_RARM + i); creature_ptr->to_ds[i] = calc_to_weapon_dice_side(creature_ptr, INVEN_RARM + i); @@ -1701,7 +1701,7 @@ static s16b calc_num_blow(player_type *creature_ptr, int i) div = ((o_ptr->weight < wgt) ? wgt : o_ptr->weight); str_index = (adj_str_blow[creature_ptr->stat_ind[A_STR]] * mul / div); - if (has_two_handed_weapons(creature_ptr) && !is_disable_two_handed_bonus(creature_ptr, 0)) + if (has_two_handed_weapons(creature_ptr) && !has_disable_two_handed_bonus(creature_ptr, 0)) str_index++; if (creature_ptr->pclass == CLASS_NINJA) str_index = MAX(0, str_index - 1); @@ -1797,7 +1797,7 @@ static s16b calc_num_blow(player_type *creature_ptr, int i) num_blow += 1 + creature_ptr->extra_blows[0]; } - if (is_not_ninja_weapon(creature_ptr, i)) { + if (has_not_ninja_weapon(creature_ptr, i)) { num_blow /= 2; if (num_blow < 1) num_blow = 1; @@ -2996,7 +2996,7 @@ static s16b calc_to_damage(player_type *creature_ptr, INVENTORY_IDX slot, bool i if (get_default_hand(creature_ptr) == id) { if ((is_martial_arts_mode(creature_ptr) && empty_hands(creature_ptr, FALSE) == (EMPTY_HAND_RARM | EMPTY_HAND_LARM)) - || !is_disable_two_handed_bonus(creature_ptr, 0)) { + || !has_disable_two_handed_bonus(creature_ptr, 0)) { int bonus_to_d = 0; bonus_to_d = ((int)(adj_str_td[creature_ptr->stat_ind[A_STR]]) - 128) / 2; damage += MAX(bonus_to_d, 1); @@ -3107,7 +3107,7 @@ static s16b calc_to_hit(player_type *creature_ptr, INVENTORY_IDX slot, bool is_t hit += (creature_ptr->weapon_exp[tval][sval] - WEAPON_EXP_BEGINNER) / 200; - if (is_not_ninja_weapon(creature_ptr, id) || is_not_monk_weapon(creature_ptr, id)) { + if (has_not_ninja_weapon(creature_ptr, id) || has_not_monk_weapon(creature_ptr, id)) { hit -= 40; } @@ -3118,7 +3118,7 @@ static s16b calc_to_hit(player_type *creature_ptr, INVENTORY_IDX slot, bool is_t } if ((is_martial_arts_mode(creature_ptr) && empty_hands(creature_ptr, FALSE) == (EMPTY_HAND_RARM | EMPTY_HAND_LARM)) - || !is_disable_two_handed_bonus(creature_ptr, 0)) { + || !has_disable_two_handed_bonus(creature_ptr, 0)) { int bonus_to_h = 0; bonus_to_h = ((int)(adj_str_th[creature_ptr->stat_ind[A_STR]]) - 128) + ((int)(adj_dex_th[creature_ptr->stat_ind[A_DEX]]) - 128); hit += MAX(bonus_to_h, 1); diff --git a/src/specific-object/death-scythe.c b/src/specific-object/death-scythe.c index 8f9f4abc0..e7ece76e9 100644 --- a/src/specific-object/death-scythe.c +++ b/src/specific-object/death-scythe.c @@ -87,16 +87,16 @@ static void compensate_death_scythe_reflection_magnification(player_type *attack if ((attacker_ptr->align < 0) && (*magnification < 20)) *magnification = 20; - if (!(attacker_ptr->resist_acid || is_oppose_acid(attacker_ptr) || is_immune_acid(attacker_ptr)) && (*magnification < 25)) + if (!(attacker_ptr->resist_acid || is_oppose_acid(attacker_ptr) || has_immune_acid(attacker_ptr)) && (*magnification < 25)) *magnification = 25; - if (!(attacker_ptr->resist_elec || is_oppose_elec(attacker_ptr) || is_immune_elec(attacker_ptr)) && (*magnification < 25)) + if (!(attacker_ptr->resist_elec || is_oppose_elec(attacker_ptr) || has_immune_elec(attacker_ptr)) && (*magnification < 25)) *magnification = 25; - if (!(attacker_ptr->resist_fire || is_oppose_fire(attacker_ptr) || is_immune_fire(attacker_ptr)) && (*magnification < 25)) + if (!(attacker_ptr->resist_fire || is_oppose_fire(attacker_ptr) || has_immune_fire(attacker_ptr)) && (*magnification < 25)) *magnification = 25; - if (!(attacker_ptr->resist_cold || is_oppose_cold(attacker_ptr) || is_immune_cold(attacker_ptr)) && (*magnification < 25)) + if (!(attacker_ptr->resist_cold || is_oppose_cold(attacker_ptr) || has_immune_cold(attacker_ptr)) && (*magnification < 25)) *magnification = 25; if (!(attacker_ptr->resist_pois || is_oppose_pois(attacker_ptr)) && (*magnification < 25)) -- 2.11.0