OSDN Git Service

[Refactor] #37353 コメント整理 / Refactor comments.
[hengband/hengband.git] / src / spells3.c
index 88fb914..3612405 100644 (file)
@@ -118,7 +118,7 @@ bool teleport_away(MONSTER_IDX m_idx, POSITION dis, BIT_FLAGS mode)
        reset_target(m_ptr);
 
        /* Update the monster (new location) */
-       update_mon(m_idx, TRUE);
+       update_monster(m_idx, TRUE);
 
        /* Redraw the old grid */
        lite_spot(oy, ox);
@@ -223,7 +223,7 @@ void teleport_monster_to(MONSTER_IDX m_idx, POSITION ty, POSITION tx, int power,
        m_ptr->fx = nx;
 
        /* Update the monster (new location) */
-       update_mon(m_idx, TRUE);
+       update_monster(m_idx, TRUE);
 
        /* Redraw the old grid */
        lite_spot(oy, ox);
@@ -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,10 +1392,7 @@ 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 */
                                        msg_format(_("%^sが目を覚ました。", "%^s wakes up."), m_name);
                                }
                        }
@@ -1481,7 +1478,6 @@ static bool vanish_dungeon(void)
        /* Update the monsters */
        p_ptr->update |= (PU_MONSTERS);
 
-       /* Redraw map */
        p_ptr->redraw |= (PR_MAP);
 
        p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
@@ -1727,7 +1723,6 @@ bool warding_glyph(void)
 
        note_spot(p_ptr->y, p_ptr->x);
 
-       /* Redraw */
        lite_spot(p_ptr->y, p_ptr->x);
 
        return TRUE;
@@ -1754,7 +1749,6 @@ bool place_mirror(void)
 
        note_spot(p_ptr->y, p_ptr->x);
 
-       /* Redraw */
        lite_spot(p_ptr->y, p_ptr->x);
 
        update_local_illumination(p_ptr->y, p_ptr->x);
@@ -1782,7 +1776,6 @@ bool explosive_rune(void)
 
        note_spot(p_ptr->y, p_ptr->x);
        
-       /* Redraw */
        lite_spot(p_ptr->y, p_ptr->x);
 
        return TRUE;
@@ -2221,19 +2214,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);
+       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;
@@ -2242,11 +2229,8 @@ msg_format("%s は明るく輝いた!",
        /* Failure */
        if (!okay)
        {
-               /* Flush */
                if (flush_failure) flush();
-
                msg_print(_("強化に失敗した。", "The enchantment failed."));
-
                if (one_in_(3)) chg_virtue(V_ENCHANT, -1);
        }
        else
@@ -2287,22 +2271,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))
@@ -2310,9 +2289,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;
@@ -2369,18 +2346,14 @@ bool artifact_scroll(void)
        /* Failure */
        if (!okay)
        {
-               /* Flush */
                if (flush_failure) flush();
-
                msg_print(_("強化に失敗した。", "The enchantment failed."));
-
                if (one_in_(3)) chg_virtue(V_ENCHANT, -1);
        }
        else
        {
                if (record_rand_art)
                {
-                       /* Description */
                        object_desc(o_name, o_ptr, OD_NAME_ONLY);
                        do_cmd_write_nikki(NIKKI_ART_SCROLL, 0, o_name);
                }
@@ -2405,7 +2378,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)
@@ -2435,7 +2407,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))
@@ -2503,7 +2474,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)
        {
@@ -2647,11 +2617,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)
        {
@@ -3020,8 +2987,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 */
@@ -3035,22 +3000,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
 
 
@@ -3198,8 +3159,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 */
@@ -3209,11 +3168,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);
@@ -4089,8 +4046,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);
@@ -4300,14 +4255,10 @@ bool brand_bolts(void)
 
                /* Ego-item */
                o_ptr->name2 = EGO_FLAME;
-
-               /* Enchant */
                enchant(o_ptr, randint0(3) + 4, ENCH_TOHIT | ENCH_TODAM);
-
                return (TRUE);
        }
 
-       /* Flush */
        if (flush_failure) flush();
 
        /* Fail */
@@ -4442,7 +4393,6 @@ bool polymorph_monster(POSITION y, POSITION x)
                {
                        for (this_o_idx = back_m.hold_o_idx; this_o_idx; this_o_idx = next_o_idx)
                        {
-                               /* Acquire object */
                                object_type *o_ptr = &o_list[this_o_idx];
 
                                /* Acquire next object */
@@ -4630,8 +4580,6 @@ bool eat_magic(int power)
                                {
                                        object_type forge;
                                        object_type *q_ptr;
-
-                                       /* Get local object */
                                        q_ptr = &forge;
 
                                        /* Obtain a local object */
@@ -5079,7 +5027,7 @@ bool shock_power(void)
                                m_ptr->fy = (byte_hack)ty;
                                m_ptr->fx = (byte_hack)tx;
 
-                               update_mon(m_idx, TRUE);
+                               update_monster(m_idx, TRUE);
                                lite_spot(oy, ox);
                                lite_spot(ty, tx);