OSDN Git Service

Merge branch 'For2.2.2-Refactoring' into For3.0.0-Artifact-Monster-Addition
authorHourier <hourier@users.sourceforge.jp>
Fri, 23 Oct 2020 14:21:49 +0000 (23:21 +0900)
committerHourier <hourier@users.sourceforge.jp>
Fri, 23 Oct 2020 14:21:49 +0000 (23:21 +0900)
1  2 
src/monster-attack/monster-attack-lose.c
src/monster-attack/monster-attack-switcher.c
src/monster/monster-update.c
src/player-info/resistance-info.c
src/player/player-damage.c

index ced3deb,0000000..c61c3d7
mode 100644,000000..100644
--- /dev/null
@@@ -1,193 -1,0 +1,193 @@@
-     if (is_resist_pois(target_ptr))
 +#include "monster-attack/monster-attack-lose.h"
 +#include "mind/mind-mirror-master.h"
 +#include "monster-attack/monster-attack-status.h"
 +#include "monster-attack/monster-attack-util.h"
 +#include "player/player-damage.h"
 +#include "player/player-status-flags.h"
 +#include "player/player-status-resist.h"
 +#include "status/bad-status-setter.h"
 +#include "status/base-status.h"
 +#include "status/element-resistance.h"
 +#include "view/display-messages.h"
 +
 +/*!
 + * @brief 病気ダメージを計算する (毒耐性があれば、(1d4 + 4) / 9になる。二重耐性なら更に(1d4 + 4) / 9)
 + * @param target_ptr プレーヤーへの参照ポインタ
 + * @param monap_ptr モンスターからプレーヤーへの直接攻撃構造体への参照ポインタ
 + * @return なし
 + * @details 10% (毒の一次耐性があれば4%、二重耐性ならば1.6%)の確率で耐久が低下し、更に1/10の確率で永久低下する
 + */
 +void calc_blow_disease(player_type *target_ptr, monap_type *monap_ptr)
 +{
-     if (is_sustain_str(target_ptr))
++    if (has_resist_pois(target_ptr))
 +        monap_ptr->damage = monap_ptr->damage * (randint1(4) + 4) / 9;
 +
 +    if (is_oppose_pois(target_ptr))
 +        monap_ptr->damage = monap_ptr->damage * (randint1(4) + 4) / 9;
 +
 +    monap_ptr->get_damage += take_hit(target_ptr, DAMAGE_ATTACK, monap_ptr->damage, monap_ptr->ddesc, -1);
 +    if (target_ptr->is_dead || check_multishadow(target_ptr))
 +        return;
 +
 +    if (!(target_ptr->resist_pois || is_oppose_pois(target_ptr)) && set_poisoned(target_ptr, target_ptr->poisoned + randint1(monap_ptr->rlev) + 5))
 +        monap_ptr->obvious = TRUE;
 +
 +    bool disease_possibility = randint1(100) > calc_nuke_damage_rate(target_ptr);
 +    if (disease_possibility || (randint1(100) > 10) || (target_ptr->prace == RACE_ANDROID))
 +        return;
 +
 +    bool perm = one_in_(10);
 +    if (dec_stat(target_ptr, A_CON, randint1(10), perm)) {
 +        msg_print(_("病があなたを蝕んでいる気がする。", "You feel sickly."));
 +        monap_ptr->obvious = TRUE;
 +    }
 +}
 +
 +/*!
 + * @brief 腕力低下ダメージを計算する (維持があれば、(1d4 + 4) / 9になる)
 + * @param target_ptr プレーヤーへの参照ポインタ
 + * @param monap_ptr モンスターからプレーヤーへの直接攻撃構造体への参照ポインタ
 + * @return なし
 + */
 +void calc_blow_lose_strength(player_type *target_ptr, monap_type *monap_ptr)
 +{
-     if (is_sustain_int(target_ptr))
++    if (has_sustain_str(target_ptr))
 +        monap_ptr->get_damage = monap_ptr->get_damage * (randint1(4) + 4) / 9;
 +
 +    monap_ptr->get_damage += take_hit(target_ptr, DAMAGE_ATTACK, monap_ptr->damage, monap_ptr->ddesc, -1);
 +    if (target_ptr->is_dead || check_multishadow(target_ptr))
 +        return;
 +
 +    if (do_dec_stat(target_ptr, A_STR))
 +        monap_ptr->obvious = TRUE;
 +}
 +
 +/*!
 + * @brief 知能低下ダメージを計算する (維持があれば、(1d4 + 4) / 9になる)
 + * @param target_ptr プレーヤーへの参照ポインタ
 + * @param monap_ptr モンスターからプレーヤーへの直接攻撃構造体への参照ポインタ
 + * @return なし
 + */
 +void calc_blow_lose_intelligence(player_type *target_ptr, monap_type *monap_ptr)
 +{
-     if (is_sustain_wis(target_ptr))
++    if (has_sustain_int(target_ptr))
 +        monap_ptr->get_damage = monap_ptr->get_damage * (randint1(4) + 4) / 9;
 +
 +    monap_ptr->get_damage += take_hit(target_ptr, DAMAGE_ATTACK, monap_ptr->damage, monap_ptr->ddesc, -1);
 +    if (target_ptr->is_dead || check_multishadow(target_ptr))
 +        return;
 +
 +    if (do_dec_stat(target_ptr, A_INT))
 +        monap_ptr->obvious = TRUE;
 +}
 +
 +/*!
 + * @brief 賢さ低下ダメージを計算する (維持があれば、(1d4 + 4) / 9になる)
 + * @param target_ptr プレーヤーへの参照ポインタ
 + * @param monap_ptr モンスターからプレーヤーへの直接攻撃構造体への参照ポインタ
 + * @return なし
 + */
 +void calc_blow_lose_wisdom(player_type *target_ptr, monap_type *monap_ptr)
 +{
-     if (is_sustain_dex(target_ptr))
++    if (has_sustain_wis(target_ptr))
 +        monap_ptr->get_damage = monap_ptr->get_damage * (randint1(4) + 4) / 9;
 +
 +    monap_ptr->get_damage += take_hit(target_ptr, DAMAGE_ATTACK, monap_ptr->damage, monap_ptr->ddesc, -1);
 +    if (target_ptr->is_dead || check_multishadow(target_ptr))
 +        return;
 +
 +    if (do_dec_stat(target_ptr, A_WIS))
 +        monap_ptr->obvious = TRUE;
 +}
 +
 +/*!
 + * @brief 器用低下ダメージを計算する (維持があれば、(1d4 + 4) / 9になる)
 + * @param target_ptr プレーヤーへの参照ポインタ
 + * @param monap_ptr モンスターからプレーヤーへの直接攻撃構造体への参照ポインタ
 + * @return なし
 + */
 +void calc_blow_lose_dexterity(player_type *target_ptr, monap_type *monap_ptr)
 +{
-     if (is_sustain_con(target_ptr))
++    if (has_sustain_dex(target_ptr))
 +        monap_ptr->get_damage = monap_ptr->get_damage * (randint1(4) + 4) / 9;
 +
 +    monap_ptr->get_damage += take_hit(target_ptr, DAMAGE_ATTACK, monap_ptr->damage, monap_ptr->ddesc, -1);
 +    if (target_ptr->is_dead || check_multishadow(target_ptr))
 +        return;
 +
 +    if (do_dec_stat(target_ptr, A_DEX))
 +        monap_ptr->obvious = TRUE;
 +}
 +
 +/*!
 + * @brief 耐久低下ダメージを計算する (維持があれば、(1d4 + 4) / 9になる)
 + * @param target_ptr プレーヤーへの参照ポインタ
 + * @param monap_ptr モンスターからプレーヤーへの直接攻撃構造体への参照ポインタ
 + * @return なし
 + */
 +void calc_blow_lose_constitution(player_type *target_ptr, monap_type *monap_ptr)
 +{
-     if (is_sustain_chr(target_ptr))
++    if (has_sustain_con(target_ptr))
 +        monap_ptr->get_damage = monap_ptr->get_damage * (randint1(4) + 4) / 9;
 +
 +    monap_ptr->get_damage += take_hit(target_ptr, DAMAGE_ATTACK, monap_ptr->damage, monap_ptr->ddesc, -1);
 +    if (target_ptr->is_dead || check_multishadow(target_ptr))
 +        return;
 +
 +    if (do_dec_stat(target_ptr, A_CON))
 +        monap_ptr->obvious = TRUE;
 +}
 +
 +/*!
 + * @brief 魅力低下ダメージを計算する (維持があれば、(1d4 + 4) / 9になる)
 + * @param target_ptr プレーヤーへの参照ポインタ
 + * @param monap_ptr モンスターからプレーヤーへの直接攻撃構造体への参照ポインタ
 + * @return なし
 + */
 +void calc_blow_lose_charisma(player_type *target_ptr, monap_type *monap_ptr)
 +{
-     if (is_sustain_str(target_ptr))
++    if (has_sustain_chr(target_ptr))
 +        monap_ptr->get_damage = monap_ptr->get_damage * (randint1(4) + 4) / 9;
 +
 +    monap_ptr->get_damage += take_hit(target_ptr, DAMAGE_ATTACK, monap_ptr->damage, monap_ptr->ddesc, -1);
 +    if (target_ptr->is_dead || check_multishadow(target_ptr))
 +        return;
 +
 +    if (do_dec_stat(target_ptr, A_CHR))
 +        monap_ptr->obvious = TRUE;
 +}
 +
 +/*!
 + * @brief 全能力低下ダメージを計算する (維持があれば、1つに付き-3%軽減する)
 + * @param target_ptr プレーヤーへの参照ポインタ
 + * @param monap_ptr モンスターからプレーヤーへの直接攻撃構造体への参照ポインタ
 + * @return なし
 + */
 +void calc_blow_lose_all(player_type *target_ptr, monap_type *monap_ptr)
 +{
 +    int damage_ratio = 100;
-     if (is_sustain_int(target_ptr))
++    if (has_sustain_str(target_ptr))
 +        damage_ratio -= 3;
 +
-     if (is_sustain_wis(target_ptr))
++    if (has_sustain_int(target_ptr))
 +        damage_ratio -= 3;
 +
-     if (is_sustain_dex(target_ptr))
++    if (has_sustain_wis(target_ptr))
 +        damage_ratio -= 3;
 +
-     if (is_sustain_con(target_ptr))
++    if (has_sustain_dex(target_ptr))
 +        damage_ratio -= 3;
 +
-     if (is_sustain_chr(target_ptr))
++    if (has_sustain_con(target_ptr))
 +        damage_ratio -= 3;
 +
++    if (has_sustain_chr(target_ptr))
 +        damage_ratio -= 3;
 +
 +    monap_ptr->damage = monap_ptr->damage * damage_ratio / 100;
 +    monap_ptr->get_damage += take_hit(target_ptr, DAMAGE_ATTACK, monap_ptr->damage, monap_ptr->ddesc, -1);
 +    if (target_ptr->is_dead || check_multishadow(target_ptr))
 +        return;
 +
 +    process_lose_all_attack(target_ptr, monap_ptr);
 +}
  #include "system/object-type-definition.h"
  #include "view/display-messages.h"
  
-     if (is_resist_disen(target_ptr))
 +/*!
 + * @brief 毒ダメージを計算する
 + * @param target_ptr プレーヤーへの参照ポインタ
 + * @param monap_ptr モンスターからプレーヤーへの直接攻撃構造体への参照ポインタ
 + * @return なし
 + * @detail 減衰の計算式がpoisではなくnukeなのは仕様 (1/3では減衰が強すぎると判断したため)
 + */
 +static void calc_blow_poison(player_type *target_ptr, monap_type *monap_ptr)
 +{
 +    if (monap_ptr->explode)
 +        return;
 +
 +    if (!(target_ptr->resist_pois || is_oppose_pois(target_ptr)) && !check_multishadow(target_ptr)
 +        && set_poisoned(target_ptr, target_ptr->poisoned + randint1(monap_ptr->rlev) + 5))
 +        monap_ptr->obvious = TRUE;
 +
 +    monap_ptr->damage = monap_ptr->damage * calc_nuke_damage_rate(target_ptr) / 100;
 +    monap_ptr->get_damage += take_hit(target_ptr, DAMAGE_ATTACK, monap_ptr->damage, monap_ptr->ddesc, -1);
 +    update_smart_learn(target_ptr, monap_ptr->m_idx, DRS_POIS);
 +}
 +
 +/*!
 + * @brief 劣化ダメージを計算する (耐性があれば、(1d4 + 4) / 9になる)
 + * @param target_ptr プレーヤーへの参照ポインタ
 + * @param monap_ptr モンスターからプレーヤーへの直接攻撃構造体への参照ポインタ
 + * @return なし
 + */
 +static void calc_blow_disenchant(player_type *target_ptr, monap_type *monap_ptr)
 +{
 +    if (monap_ptr->explode)
 +        return;
 +
 +    if (!target_ptr->resist_disen && !check_multishadow(target_ptr) && apply_disenchant(target_ptr, 0)) {
 +        update_creature(target_ptr);
 +        monap_ptr->obvious = TRUE;
 +    }
 +
-     if (is_resist_blind(target_ptr))
++    if (has_resist_disen(target_ptr))
 +        monap_ptr->damage = monap_ptr->damage * (randint1(4) + 4) / 9;
 +
 +    monap_ptr->get_damage += take_hit(target_ptr, DAMAGE_ATTACK, monap_ptr->damage, monap_ptr->ddesc, -1);
 +    update_smart_learn(target_ptr, monap_ptr->m_idx, DRS_DISEN);
 +}
 +
 +/*!
 + * @brief 魔道具吸収ダメージを計算する (消費魔力減少、呪文失敗率減少、魔道具使用能力向上があればそれぞれ-7.5%)
 + * @param target_ptr プレーヤーへの参照ポインタ
 + * @param monap_ptr モンスターからプレーヤーへの直接攻撃構造体への参照ポインタ
 + * @return なし
 + * @detals 魔道具使用能力向上フラグがあれば、吸収対象のアイテムをスキャンされる回数が半分で済む
 + */
 +static void calc_blow_un_power(player_type *target_ptr, monap_type *monap_ptr)
 +{
 +    int damage_ratio = 1000;
 +    if (has_dec_mana(target_ptr))
 +        damage_ratio -= 75;
 +
 +    if (has_easy_spell(target_ptr))
 +        damage_ratio -= 75;
 +
 +    bool is_magic_mastery = has_magic_mastery(target_ptr) != 0;
 +    if (is_magic_mastery)
 +        damage_ratio -= 75;
 +
 +    monap_ptr->damage = monap_ptr->damage * damage_ratio / 1000;
 +    monap_ptr->get_damage += take_hit(target_ptr, DAMAGE_ATTACK, monap_ptr->damage, monap_ptr->ddesc, -1);
 +    if (target_ptr->is_dead || check_multishadow(target_ptr))
 +        return;
 +
 +    int max_draining_item = is_magic_mastery ? 5 : 10;
 +    for (int i = 0; i < max_draining_item; i++) {
 +        INVENTORY_IDX i_idx = (INVENTORY_IDX)randint0(INVEN_PACK);
 +        monap_ptr->o_ptr = &target_ptr->inventory_list[i_idx];
 +        if (monap_ptr->o_ptr->k_idx == 0)
 +            continue;
 +
 +        if (process_un_power(target_ptr, monap_ptr))
 +            break;
 +    }
 +}
 +
 +/*!
 + * @brief 盲目ダメージを計算する (耐性があれば、(1d4 + 3) / 8になる)
 + * @param target_ptr プレーヤーへの参照ポインタ
 + * @param monap_ptr モンスターからプレーヤーへの直接攻撃構造体への参照ポインタ
 + * @return なし
 + */
 +static void calc_blow_blind(player_type *target_ptr, monap_type *monap_ptr)
 +{
-     if (is_resist_conf(target_ptr))
++    if (has_resist_blind(target_ptr))
 +        monap_ptr->damage = monap_ptr->damage * (randint1(4) + 3) / 8;
 +
 +    monap_ptr->get_damage += take_hit(target_ptr, DAMAGE_ATTACK, monap_ptr->damage, monap_ptr->ddesc, -1);
 +    if (target_ptr->is_dead)
 +        return;
 +
 +    process_blind_attack(target_ptr, monap_ptr);
 +    update_smart_learn(target_ptr, monap_ptr->m_idx, DRS_BLIND);
 +}
 +
 +/*!
 + * @brief 混乱ダメージを計算する (耐性があれば、(1d4 + 3) / 8になる)
 + * @param target_ptr プレーヤーへの参照ポインタ
 + * @param monap_ptr モンスターからプレーヤーへの直接攻撃構造体への参照ポインタ
 + * @return なし
 + */
 +static void calc_blow_confusion(player_type *target_ptr, monap_type *monap_ptr)
 +{
 +    if (monap_ptr->explode)
 +        return;
 +
-     if (is_resist_fear(target_ptr))
++    if (has_resist_conf(target_ptr))
 +        monap_ptr->damage = monap_ptr->damage * (randint1(4) + 3) / 8;
 +
 +    monap_ptr->get_damage += take_hit(target_ptr, DAMAGE_ATTACK, monap_ptr->damage, monap_ptr->ddesc, -1);
 +    if (target_ptr->is_dead)
 +        return;
 +
 +    if (!target_ptr->resist_conf && !check_multishadow(target_ptr) && set_confused(target_ptr, target_ptr->confused + 3 + randint1(monap_ptr->rlev)))
 +        monap_ptr->obvious = TRUE;
 +
 +    update_smart_learn(target_ptr, monap_ptr->m_idx, DRS_CONF);
 +}
 +
 +/*!
 + * @brief 恐怖ダメージを計算する (耐性があれば、(1d4 + 3) / 8になる)
 + * @param target_ptr プレーヤーへの参照ポインタ
 + * @param monap_ptr モンスターからプレーヤーへの直接攻撃構造体への参照ポインタ
 + * @return なし
 + */
 +static void calc_blow_fear(player_type *target_ptr, monap_type *monap_ptr)
 +{
-     if (is_resist_neth(target_ptr))
++    if (has_resist_fear(target_ptr))
 +        monap_ptr->damage = monap_ptr->damage * (randint1(4) + 3) / 8;
 +
 +    monap_ptr->get_damage += take_hit(target_ptr, DAMAGE_ATTACK, monap_ptr->damage, monap_ptr->ddesc, -1);
 +    if (target_ptr->is_dead)
 +        return;
 +
 +    process_terrify_attack(target_ptr, monap_ptr);
 +    update_smart_learn(target_ptr, monap_ptr->m_idx, DRS_FEAR);
 +}
 +
 +/*!
 + * @brief 麻痺ダメージを計算する (耐性があれば、(1d4 + 3) / 8になる)
 + * @param target_ptr プレーヤーへの参照ポインタ
 + * @param monap_ptr モンスターからプレーヤーへの直接攻撃構造体への参照ポインタ
 + * @return なし
 + */
 +static void calc_blow_paralysis(player_type *target_ptr, monap_type *monap_ptr)
 +{
 +    if (has_free_act(target_ptr))
 +        monap_ptr->damage = monap_ptr->damage * (randint1(4) + 3) / 8;
 +
 +    monap_ptr->get_damage += take_hit(target_ptr, DAMAGE_ATTACK, monap_ptr->damage, monap_ptr->ddesc, -1);
 +    if (target_ptr->is_dead)
 +        return;
 +
 +    process_paralyze_attack(target_ptr, monap_ptr);
 +    update_smart_learn(target_ptr, monap_ptr->m_idx, DRS_FREE);
 +}
 +
 +/*!
 + * @brief 経験値吸収ダメージを計算する (経験値保持と地獄耐性があれば、それぞれ-7.5%)
 + * @param target_ptr プレーヤーへの参照ポインタ
 + * @param monap_ptr モンスターからプレーヤーへの直接攻撃構造体への参照ポインタ
 + * @return なし
 + */
 +static void calc_blow_drain_exp(player_type *target_ptr, monap_type *monap_ptr, const int drain_value, const int hold_exp_prob)
 +{
 +    s32b d = damroll(drain_value, 6) + (target_ptr->exp / 100) * MON_DRAIN_LIFE;
 +    monap_ptr->obvious = TRUE;
 +    int damage_ratio = 1000;
 +    if (has_hold_exp(target_ptr))
 +        damage_ratio -= 75;
 +
-     if (is_resist_time(target_ptr))
++    if (has_resist_neth(target_ptr))
 +        damage_ratio -= 75;
 +
 +    monap_ptr->damage = monap_ptr->damage * damage_ratio / 1000;
 +    monap_ptr->get_damage += take_hit(target_ptr, DAMAGE_ATTACK, monap_ptr->damage, monap_ptr->ddesc, -1);
 +    if (target_ptr->is_dead || check_multishadow(target_ptr))
 +        return;
 +
 +    (void)drain_exp(target_ptr, d, d / 10, hold_exp_prob);
 +}
 +
 +/*!
 + * @brief 時間逆転ダメージを計算する (耐性があれば、(1d4 + 4) / 9になる)
 + * @param target_ptr プレーヤーへの参照ポインタ
 + * @param monap_ptr モンスターからプレーヤーへの直接攻撃構造体への参照ポインタ
 + * @return なし
 + */
 +static void calc_blow_time(player_type *target_ptr, monap_type *monap_ptr)
 +{
 +    if (monap_ptr->explode)
 +        return;
 +
 +    process_monster_attack_time(target_ptr, monap_ptr);
++    if (has_resist_time(target_ptr))
 +        monap_ptr->damage = monap_ptr->damage * (randint1(4) + 4) / 9;
 +
 +    monap_ptr->get_damage += take_hit(target_ptr, DAMAGE_ATTACK, monap_ptr->damage, monap_ptr->ddesc, -1);
 +}
 +
 +/*!
 + * @brief 生命力吸収ダメージを計算する (経験値維持があれば9/10になる)
 + * @param target_ptr プレーヤーへの参照ポインタ
 + * @param monap_ptr モンスターからプレーヤーへの直接攻撃構造体への参照ポインタ
 + * @return なし
 + */
 +static void calc_blow_drain_life(player_type *target_ptr, monap_type *monap_ptr)
 +{
 +    s32b d = damroll(60, 6) + (target_ptr->exp / 100) * MON_DRAIN_LIFE;
 +    monap_ptr->obvious = TRUE;
 +    if (target_ptr->hold_exp)
 +        monap_ptr->damage = monap_ptr->damage * 9 / 10;
 +
 +    monap_ptr->get_damage += take_hit(target_ptr, DAMAGE_ATTACK, monap_ptr->damage, monap_ptr->ddesc, -1);
 +    if (target_ptr->is_dead || check_multishadow(target_ptr))
 +        return;
 +
 +    bool resist_drain = check_drain_hp(target_ptr, d);
 +    process_drain_life(target_ptr, monap_ptr, resist_drain);
 +}
 +
 +/*!
 + * @brief MPダメージを計算する (消費魔力減少、呪文失敗率減少、魔道具使用能力向上があればそれぞれ-5%)
 + * @param target_ptr プレーヤーへの参照ポインタ
 + * @param monap_ptr モンスターからプレーヤーへの直接攻撃構造体への参照ポインタ
 + * @return なし
 + */
 +static void calc_blow_drain_mana(player_type *target_ptr, monap_type *monap_ptr)
 +{
 +    monap_ptr->obvious = TRUE;
 +    int damage_ratio = 100;
 +    if (has_dec_mana(target_ptr))
 +        damage_ratio -= 5;
 +
 +    if (has_easy_spell(target_ptr))
 +        damage_ratio -= 5;
 +
 +    if (has_magic_mastery(target_ptr))
 +        damage_ratio -= 5;
 +
 +    monap_ptr->damage = monap_ptr->damage * damage_ratio / 100;
 +    process_drain_mana(target_ptr, monap_ptr);
 +    update_smart_learn(target_ptr, monap_ptr->m_idx, DRS_MANA);
 +}
 +
 +static void calc_blow_inertia(player_type *target_ptr, monap_type *monap_ptr)
 +{
 +    if ((target_ptr->fast > 0) || (target_ptr->pspeed >= 130))
 +        monap_ptr->damage = monap_ptr->damage * (randint1(4) + 4) / 9;
 +
 +    monap_ptr->get_damage += take_hit(target_ptr, DAMAGE_ATTACK, monap_ptr->damage, monap_ptr->ddesc, -1);
 +    if (target_ptr->is_dead || check_multishadow(target_ptr))
 +        return;
 +
 +    if (set_slow(target_ptr, (target_ptr->slow + 4 + randint0(monap_ptr->rlev / 10)), FALSE))
 +        monap_ptr->obvious = TRUE;
 +}
 +
  void switch_monster_blow_to_player(player_type *target_ptr, monap_type *monap_ptr)
  {
      switch (monap_ptr->effect) {
Simple merge
@@@ -6,44 -6,44 +6,44 @@@
  
  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++] = _("\82 \82È\82½\82Í\8e_\82É\91Î\82·\82é\8a®\91S\82È\82é\96Æ\89u\82ð\8e\9d\82Á\82Ä\82¢\82é\81B", "You are completely immune to acid.");
 +        si_ptr->info[si_ptr->line++] = _("あなたは酸に対する完全なる免疫を持っている。", "You are completely immune to acid.");
      } else if (creature_ptr->resist_acid && is_oppose_acid(creature_ptr)) {
 -        si_ptr->info[si_ptr->line++] = _("\82 \82È\82½\82Í\8e_\82Ö\82Ì\8b­\97Í\82È\91Ï\90«\82ð\8e\9d\82Á\82Ä\82¢\82é\81B", "You resist acid exceptionally well.");
 +        si_ptr->info[si_ptr->line++] = _("あなたは酸への強力な耐性を持っている。", "You resist acid exceptionally well.");
      } else if (creature_ptr->resist_acid || is_oppose_acid(creature_ptr)) {
 -        si_ptr->info[si_ptr->line++] = _("\82 \82È\82½\82Í\8e_\82Ö\82Ì\91Ï\90«\82ð\8e\9d\82Á\82Ä\82¢\82é\81B", "You are resistant to acid.");
 +        si_ptr->info[si_ptr->line++] = _("あなたは酸への耐性を持っている。", "You are resistant to acid.");
      }
  
-     if (is_immune_elec(creature_ptr)) {
+     if (has_immune_elec(creature_ptr)) {
 -        si_ptr->info[si_ptr->line++] = _("\82 \82È\82½\82Í\93d\8c\82\82É\91Î\82·\82é\8a®\91S\82È\82é\96Æ\89u\82ð\8e\9d\82Á\82Ä\82¢\82é\81B", "You are completely immune to lightning.");
 +        si_ptr->info[si_ptr->line++] = _("あなたは電撃に対する完全なる免疫を持っている。", "You are completely immune to lightning.");
      } else if (creature_ptr->resist_elec && is_oppose_elec(creature_ptr)) {
 -        si_ptr->info[si_ptr->line++] = _("\82 \82È\82½\82Í\93d\8c\82\82Ö\82Ì\8b­\97Í\82È\91Ï\90«\82ð\8e\9d\82Á\82Ä\82¢\82é\81B", "You resist lightning exceptionally well.");
 +        si_ptr->info[si_ptr->line++] = _("あなたは電撃への強力な耐性を持っている。", "You resist lightning exceptionally well.");
      } else if (creature_ptr->resist_elec || is_oppose_elec(creature_ptr)) {
 -        si_ptr->info[si_ptr->line++] = _("\82 \82È\82½\82Í\93d\8c\82\82Ö\82Ì\91Ï\90«\82ð\8e\9d\82Á\82Ä\82¢\82é\81B", "You are resistant to lightning.");
 +        si_ptr->info[si_ptr->line++] = _("あなたは電撃への耐性を持っている。", "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++] = _("\82 \82È\82½\82Í\93d\8c\82\82É\8eã\82¢\81B", "You are susceptible to damage from lightning.");
 +        si_ptr->info[si_ptr->line++] = _("あなたは電撃に弱い。", "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++] = _("\82 \82È\82½\82Í\89Î\82É\91Î\82·\82é\8a®\91S\82È\82é\96Æ\89u\82ð\8e\9d\82Á\82Ä\82¢\82é\81B", "You are completely immune to fire.");
 +        si_ptr->info[si_ptr->line++] = _("あなたは火に対する完全なる免疫を持っている。", "You are completely immune to fire.");
      } else if (creature_ptr->resist_fire && is_oppose_fire(creature_ptr)) {
 -        si_ptr->info[si_ptr->line++] = _("\82 \82È\82½\82Í\89Î\82Ö\82Ì\8b­\97Í\82È\91Ï\90«\82ð\8e\9d\82Á\82Ä\82¢\82é\81B", "You resist fire exceptionally well.");
 +        si_ptr->info[si_ptr->line++] = _("あなたは火への強力な耐性を持っている。", "You resist fire exceptionally well.");
      } else if (creature_ptr->resist_fire || is_oppose_fire(creature_ptr)) {
 -        si_ptr->info[si_ptr->line++] = _("\82 \82È\82½\82Í\89Î\82Ö\82Ì\91Ï\90«\82ð\8e\9d\82Á\82Ä\82¢\82é\81B", "You are resistant to fire.");
 +        si_ptr->info[si_ptr->line++] = _("あなたは火への耐性を持っている。", "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++] = _("\82 \82È\82½\82Í\89Î\82É\8eã\82¢\81B", "You are susceptible to damage from fire.");
 +        si_ptr->info[si_ptr->line++] = _("あなたは火に弱い。", "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++] = _("\82 \82È\82½\82Í\97â\8bC\82É\91Î\82·\82é\8a®\91S\82È\82é\96Æ\89u\82ð\8e\9d\82Á\82Ä\82¢\82é\81B", "You are completely immune to cold.");
 +        si_ptr->info[si_ptr->line++] = _("あなたは冷気に対する完全なる免疫を持っている。", "You are completely immune to cold.");
      } else if (creature_ptr->resist_cold && is_oppose_cold(creature_ptr)) {
 -        si_ptr->info[si_ptr->line++] = _("\82 \82È\82½\82Í\97â\8bC\82Ö\82Ì\8b­\97Í\82È\91Ï\90«\82ð\8e\9d\82Á\82Ä\82¢\82é\81B", "You resist cold exceptionally well.");
 +        si_ptr->info[si_ptr->line++] = _("あなたは冷気への強力な耐性を持っている。", "You resist cold exceptionally well.");
      } else if (creature_ptr->resist_cold || is_oppose_cold(creature_ptr)) {
 -        si_ptr->info[si_ptr->line++] = _("\82 \82È\82½\82Í\97â\8bC\82Ö\82Ì\91Ï\90«\82ð\8e\9d\82Á\82Ä\82¢\82é\81B", "You are resistant to cold.");
 +        si_ptr->info[si_ptr->line++] = _("あなたは冷気への耐性を持っている。", "You are resistant to cold.");
      }
  
      if (creature_ptr->resist_pois && is_oppose_pois(creature_ptr)) {
@@@ -239,9 -262,12 +239,9 @@@ HIT_POINT fire_dam(player_type *creatur
   */
  HIT_POINT cold_dam(player_type *creature_ptr, HIT_POINT dam, concptr kb_str, int monspell, bool aura)
  {
 -    HIT_POINT get_damage;
      int inv = (dam < 30) ? 1 : (dam < 60) ? 2 : 3;
      bool double_resist = is_oppose_cold(creature_ptr);
-     if (is_immune_cold(creature_ptr) || (dam <= 0)) {
 -
 -    /* Total immunity */
+     if (has_immune_cold(creature_ptr) || (dam <= 0)) {
          learn_spell(creature_ptr, monspell);
          return 0;
      }
@@@ -584,10 -654,16 +584,10 @@@ static void process_aura_damage(monster
   */
  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), RF2_AURA_FIRE,
 -    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)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)has_immune_elec(touched_ptr), offsetof(monster_race, flags2), offsetof(monster_race, r_flags2),
 -        RF2_AURA_ELEC,
 -              elec_dam,
 -        _("電撃をくらった!", "You get zapped!"));
++    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), RF3_AURA_COLD,
++    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), RF2_AURA_ELEC,
++    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!"));
  }