OSDN Git Service

[Refactor] #37353 monster_desc() の宣言を monster.h に移動。
[hengband/hengband.git] / src / melee1.c
index 824a3e0..428927a 100644 (file)
@@ -18,7 +18,9 @@
 #include "monsterrace-hook.h"
 #include "melee.h"
 #include "projection.h"
+#include "monster.h"
 #include "monster-status.h"
+#include "monster-spell.h"
 #include "avatar.h"
 #include "player-status.h"
 #include "realm-hex.h"
@@ -106,11 +108,11 @@ static MULTIPLY mult_slaying(MULTIPLY mult, const BIT_FLAGS* flgs, const monster
                const struct slay_table_t* p = &slay_table[i];
 
                if ((have_flag(flgs, p->slay_flag)) &&
-                       (atoffset(u32b, r_ptr, p->flag_offset) & p->affect_race_flag))
+                       (atoffset(BIT_FLAGS, r_ptr, p->flag_offset) & p->affect_race_flag))
                {
                        if (is_original_ap_and_seen(m_ptr))
                        {
-                               atoffset(u32b, r_ptr, p->r_flag_offset) |= p->affect_race_flag;
+                               atoffset(BIT_FLAGS, r_ptr, p->r_flag_offset) |= p->affect_race_flag;
                        }
 
                        mult = MAX(mult, p->slay_mult);
@@ -373,7 +375,7 @@ static MULTIPLY mult_hissatsu(MULTIPLY mult, BIT_FLAGS *flgs, monster_type *m_pt
  * @param tdam 現在算出途中のダメージ値
  * @param m_ptr 目標モンスターの構造体参照ポインタ
  * @param mode 剣術のID
- * @param thrown 射撃処理ならばTRUEを指定する
+ * @param thrown 投擲処理ならばTRUEを指定する
  * @return 総合的なスレイを加味したダメージ値
  * @note
  * Note that "flasks of oil" do NOT do fire damage, although they\n
@@ -392,7 +394,6 @@ HIT_POINT tot_dam_aux(object_type *o_ptr, HIT_POINT tdam, monster_type *m_ptr, B
 
        if (!thrown)
        {
-               /* Magical Swords */
                if (p_ptr->special_attack & (ATTACK_ACID)) add_flag(flgs, TR_BRAND_ACID);
                if (p_ptr->special_attack & (ATTACK_COLD)) add_flag(flgs, TR_BRAND_COLD);
                if (p_ptr->special_attack & (ATTACK_ELEC)) add_flag(flgs, TR_BRAND_ELEC);
@@ -400,10 +401,8 @@ HIT_POINT tot_dam_aux(object_type *o_ptr, HIT_POINT tdam, monster_type *m_ptr, B
                if (p_ptr->special_attack & (ATTACK_POIS)) add_flag(flgs, TR_BRAND_POIS);
        }
 
-       /* Hex - Slay Good (Runesword) */
        if (hex_spelling(HEX_RUNESWORD)) add_flag(flgs, TR_SLAY_GOOD);
 
-       /* Some "weapons" and "ammo" do extra damage */
        switch (o_ptr->tval)
        {
        case TV_SHOT:
@@ -415,19 +414,15 @@ HIT_POINT tot_dam_aux(object_type *o_ptr, HIT_POINT tdam, monster_type *m_ptr, B
        case TV_DIGGING:
        case TV_LITE:
        {
-               /* Slaying */
                mult = mult_slaying(mult, flgs, m_ptr);
 
-               /* Elemental Brand */
                mult = mult_brand(mult, flgs, m_ptr);
 
-               /* Hissatsu */
                if (p_ptr->pclass == CLASS_SAMURAI)
                {
                        mult = mult_hissatsu(mult, flgs, m_ptr, mode);
                }
 
-               /* Force Weapon */
                if ((p_ptr->pclass != CLASS_SAMURAI) && (have_flag(flgs, TR_FORCE_WEAPON)) && (p_ptr->csp > (o_ptr->dd * o_ptr->ds / 5)))
                {
                        p_ptr->csp -= (1 + (o_ptr->dd * o_ptr->ds / 5));
@@ -435,7 +430,6 @@ HIT_POINT tot_dam_aux(object_type *o_ptr, HIT_POINT tdam, monster_type *m_ptr, B
                        mult = mult * 3 / 2 + 20;
                }
 
-               /* Hack -- The Nothung cause special damage to Fafner */
                if ((o_ptr->name1 == ART_NOTHUNG) && (m_ptr->r_idx == MON_FAFNER))
                        mult = 150;
                break;
@@ -443,7 +437,6 @@ HIT_POINT tot_dam_aux(object_type *o_ptr, HIT_POINT tdam, monster_type *m_ptr, B
        }
        if (mult > 150) mult = 150;
 
-       /* Return the total damage */
        return (tdam * mult / 10);
 }
 
@@ -639,21 +632,18 @@ static void touch_zap_player_aux(monster_type *m_ptr, bool immune, int flags_off
 {
        monster_race *r_ptr = &r_info[m_ptr->r_idx];
 
-       if ((atoffset(u32b, r_ptr, flags_offset) & aura_flag) && !immune)
+       if ((atoffset(BIT_FLAGS, r_ptr, flags_offset) & aura_flag) && !immune)
        {
                GAME_TEXT mon_name[MAX_NLEN];
                int aura_damage = damroll(1 + (r_ptr->level / 26), 1 + (r_ptr->level / 17));
 
-               /* Hack -- Get the "died from" name */
-               monster_desc(mon_name, m_ptr, MD_IGNORE_HALLU | MD_ASSUME_VISIBLE | MD_INDEF_VISIBLE);
-
+               monster_desc(mon_name, m_ptr, MD_WRONGDOER_NAME);
                msg_print(message);
-
                dam_func(aura_damage, mon_name, -1, TRUE);
 
                if (is_original_ap_and_seen(m_ptr))
                {
-                       atoffset(u32b, r_ptr, r_flags_offset) |= aura_flag;
+                       atoffset(BIT_FLAGS, r_ptr, r_flags_offset) |= aura_flag;
                }
 
                handle_stuff();
@@ -1933,12 +1923,10 @@ bool make_attack_normal(MONSTER_IDX m_idx)
        /* Extract the effective monster level */
        rlev = ((r_ptr->level >= 1) ? r_ptr->level : 1);
 
-
        /* Get the monster name (or "it") */
        monster_desc(m_name, m_ptr, 0);
 
-       /* Get the "died from" information (i.e. "a kobold") */
-       monster_desc(ddesc, m_ptr, MD_IGNORE_HALLU | MD_ASSUME_VISIBLE | MD_INDEF_VISIBLE);
+       monster_desc(ddesc, m_ptr, MD_WRONGDOER_NAME);
 
        if (p_ptr->special_defense & KATA_IAI)
        {