OSDN Git Service

[Refactor] #37353 コメント整理 / Refactor comments.
[hengband/hengband.git] / src / spells3.c
index 2c67d44..675e217 100644 (file)
@@ -515,10 +515,10 @@ void teleport_player_to(POSITION ny, POSITION nx, BIT_FLAGS mode)
 void teleport_away_followable(MONSTER_IDX m_idx)
 {
        monster_type *m_ptr = &m_list[m_idx];
-       int          oldfy = m_ptr->fy;
-       int          oldfx = m_ptr->fx;
-       bool         old_ml = m_ptr->ml;
-       int          old_cdis = m_ptr->cdis;
+       POSITION oldfy = m_ptr->fy;
+       POSITION oldfx = m_ptr->fx;
+       bool old_ml = m_ptr->ml;
+       POSITION old_cdis = m_ptr->cdis;
 
        teleport_away(m_idx, MAX_SIGHT * 2 + 5, 0L);
 
@@ -531,7 +531,7 @@ void teleport_away_followable(MONSTER_IDX m_idx)
                {
                        BIT_FLAGS flgs[TR_FLAG_SIZE];
                        object_type *o_ptr;
-                       int i;
+                       INVENTORY_IDX i;
 
                        for (i = INVEN_RARM; i < INVEN_TOTAL; i++)
                        {
@@ -1392,7 +1392,6 @@ static bool vanish_dungeon(void)
                                /* Notice the "waking up" */
                                if (m_ptr->ml)
                                {
-                                       /* Acquire the monster name */
                                        monster_desc(m_name, m_ptr, 0);
 
                                        /* Dump a message */
@@ -2217,18 +2216,13 @@ bool enchant_spell(HIT_PROB num_hit, HIT_POINT num_dam, ARMOUR_CLASS num_ac)
                o_ptr = &o_list[0 - item];
        }
 
-
-       /* Description */
        object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
 #ifdef JP
        msg_format("%s は明るく輝いた!", o_name);
 #else
-       msg_format("%s %s glow%s brightly!",
-                  ((item >= 0) ? "Your" : "The"), o_name,
-                  ((o_ptr->number > 1) ? "" : "s"));
+       msg_format("%s %s glow%s brightly!", ((item >= 0) ? "Your" : "The"), o_name, ((o_ptr->number > 1) ? "" : "s"));
 #endif
 
-
        /* Enchant */
        if (enchant(o_ptr, num_hit, ENCH_TOHIT)) okay = TRUE;
        if (enchant(o_ptr, num_dam, ENCH_TODAM)) okay = TRUE;
@@ -2279,22 +2273,17 @@ bool artifact_scroll(void)
        {
                o_ptr = &inventory[item];
        }
-
        /* Get the item (on the floor) */
        else
        {
                o_ptr = &o_list[0 - item];
        }
 
-
-       /* Description */
        object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
 #ifdef JP
        msg_format("%s は眩い光を発した!",o_name);
 #else
-       msg_format("%s %s radiate%s a blinding light!",
-                 ((item >= 0) ? "Your" : "The"), o_name,
-                 ((o_ptr->number > 1) ? "" : "s"));
+       msg_format("%s %s radiate%s a blinding light!", ((item >= 0) ? "Your" : "The"), o_name, ((o_ptr->number > 1) ? "" : "s"));
 #endif
 
        if (object_is_artifact(o_ptr))
@@ -2302,9 +2291,7 @@ bool artifact_scroll(void)
 #ifdef JP
                msg_format("%sは既に伝説のアイテムです!", o_name  );
 #else
-               msg_format("The %s %s already %s!",
-                   o_name, ((o_ptr->number > 1) ? "are" : "is"),
-                   ((o_ptr->number > 1) ? "artifacts" : "an artifact"));
+               msg_format("The %s %s already %s!", o_name, ((o_ptr->number > 1) ? "are" : "is"), ((o_ptr->number > 1) ? "artifacts" : "an artifact"));
 #endif
 
                okay = FALSE;
@@ -2393,7 +2380,6 @@ bool identify_item(object_type *o_ptr)
        bool old_known = FALSE;
        char o_name[MAX_NLEN];
 
-       /* Description */
        object_desc(o_name, o_ptr, 0);
 
        if (o_ptr->ident & IDENT_KNOWN)
@@ -2423,7 +2409,6 @@ bool identify_item(object_type *o_ptr)
        strcpy(record_o_name, o_name);
        record_turn = turn;
 
-       /* Description */
        object_desc(o_name, o_ptr, OD_NAME_ONLY);
 
        if(record_fix_art && !old_known && object_is_fixed_artifact(o_ptr))
@@ -2491,7 +2476,6 @@ bool ident_spell(bool only_equip)
        /* Identify it */
        old_known = identify_item(o_ptr);
 
-       /* Description */
        object_desc(o_name, o_ptr, 0);
        if (item >= INVEN_RARM)
        {
@@ -2635,11 +2619,8 @@ bool identify_fully(bool only_equip)
 
        /* Mark the item as fully known */
        o_ptr->ident |= (IDENT_MENTAL);
-
-       /* Handle stuff */
        handle_stuff();
 
-       /* Description */
        object_desc(o_name, o_ptr, 0);
        if (item >= INVEN_RARM)
        {
@@ -3008,8 +2989,6 @@ bool bless_weapon(void)
                o_ptr = &o_list[0 - item];
        }
 
-
-       /* Description */
        object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
 
        /* Extract the flags */
@@ -3023,22 +3002,18 @@ bool bless_weapon(void)
                    (o_ptr->curse_flags & TRC_PERMA_CURSE))
                {
 #ifdef JP
-msg_format("%sを覆う黒いオーラは祝福を跳ね返した!",
-    o_name);
+                       msg_format("%sを覆う黒いオーラは祝福を跳ね返した!", o_name);
 #else
-                       msg_format("The black aura on %s %s disrupts the blessing!",
-                           ((item >= 0) ? "your" : "the"), o_name);
+                       msg_format("The black aura on %s %s disrupts the blessing!", ((item >= 0) ? "your" : "the"), o_name);
 #endif
 
                        return TRUE;
                }
 
 #ifdef JP
-msg_format("%s から邪悪なオーラが消えた。",
-    o_name);
+               msg_format("%s から邪悪なオーラが消えた。", o_name);
 #else
-               msg_format("A malignant aura leaves %s %s.",
-                   ((item >= 0) ? "your" : "the"), o_name);
+               msg_format("A malignant aura leaves %s %s.", ((item >= 0) ? "your" : "the"), o_name);
 #endif
 
 
@@ -3186,8 +3161,6 @@ bool pulish_shield(void)
                o_ptr = &o_list[0 - item];
        }
 
-
-       /* Description */
        object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
 
        /* Extract the flags */
@@ -3197,11 +3170,9 @@ bool pulish_shield(void)
            !object_is_cursed(o_ptr) && (o_ptr->sval != SV_MIRROR_SHIELD))
        {
 #ifdef JP
-msg_format("%sは輝いた!", o_name);
+               msg_format("%sは輝いた!", o_name);
 #else
-               msg_format("%s %s shine%s!",
-                   ((item >= 0) ? "Your" : "The"), o_name,
-                   ((o_ptr->number > 1) ? "" : "s"));
+               msg_format("%s %s shine%s!", ((item >= 0) ? "Your" : "The"), o_name, ((o_ptr->number > 1) ? "" : "s"));
 #endif
                o_ptr->name2 = EGO_REFLECTION;
                enchant(o_ptr, randint0(3) + 4, ENCH_TOAC);
@@ -4077,8 +4048,6 @@ bool rustproof(void)
                o_ptr = &o_list[0 - item];
        }
 
-
-       /* Description */
        object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
 
        add_flag(o_ptr->art_flags, TR_IGNORE_ACID);