OSDN Git Service

[Refactor] #37353 コメント整理 / Refactor comments.
authorDeskull <deskull@users.sourceforge.jp>
Sat, 17 Nov 2018 09:06:40 +0000 (18:06 +0900)
committerDeskull <deskull@users.sourceforge.jp>
Sat, 17 Nov 2018 09:06:40 +0000 (18:06 +0900)
19 files changed:
src/cmd-activate.c
src/cmd-eat.c
src/cmd-item.c
src/cmd-pet.c
src/cmd-quaff.c
src/cmd-read.c
src/cmd-usestaff.c
src/cmd-zaprod.c
src/cmd-zapwand.c
src/cmd2.c
src/cmd5.c
src/defines.h
src/dungeon.c
src/hissatsu.c
src/mane.c
src/mind.c
src/monster-process.c
src/mspells3.c
src/snipe.c

index 0f72401..60e4643 100644 (file)
@@ -85,7 +85,6 @@ void do_cmd_activate_aux(INVENTORY_IDX item)
                o_ptr = &o_list[0 - item];
        }
 
-       /* Take a turn */
        p_ptr->energy_use = 100;
 
        /* Extract the item level */
index 4b686af..7c7532e 100644 (file)
@@ -37,7 +37,6 @@ void do_cmd_eat_food_aux(INVENTORY_IDX item)
 \r
        sound(SOUND_EAT);\r
 \r
-       /* Take a turn */\r
        p_ptr->energy_use = 100;\r
 \r
        /* Identity not known yet */\r
index e64af19..d1c3837 100644 (file)
@@ -402,7 +402,6 @@ void do_cmd_wield(void)
                autopick_alter_item(item, FALSE);
        }
 
-       /* Take a turn */
        p_ptr->energy_use = 100;
 
        /* Get local object */
@@ -898,7 +897,6 @@ void do_cmd_destroy(void)
        object_desc(o_name, o_ptr, 0);
        o_ptr->number = old_number;
 
-       /* Take a turn */
        p_ptr->energy_use = 100;
 
        /* Artifacts cannot be destroyed */
index e22b0d1..9578670 100644 (file)
@@ -329,7 +329,6 @@ bool do_riding(bool force)
 
                if (c_ptr->m_idx)
                {
-                       /* Take a turn */
                        p_ptr->energy_use = 100;
 
                        /* Message */
index bb8408b..8c62657 100644 (file)
@@ -24,7 +24,6 @@ void do_cmd_quaff_potion_aux(INVENTORY_IDX item)
        object_type forge;\r
        object_type *q_ptr;\r
 \r
-       p_ptr->energy_use = 100; /* Take a turn */\r
 \r
        if (world_player)\r
        {\r
index 348df86..36ab68e 100644 (file)
@@ -41,7 +41,6 @@ void do_cmd_read_scroll_aux(INVENTORY_IDX item, bool known)
        }\r
 \r
 \r
-       /* Take a turn */\r
        p_ptr->energy_use = 100;\r
 \r
        if (world_player)\r
index 2799dbd..1fbf339 100644 (file)
@@ -340,7 +340,6 @@ void do_cmd_use_staff_aux(INVENTORY_IDX item)
        }\r
 \r
 \r
-       /* Take a turn */\r
        p_ptr->energy_use = 100;\r
 \r
        /* Extract the item level */\r
index f27997b..fde4e31 100644 (file)
@@ -295,7 +295,6 @@ void do_cmd_zap_rod_aux(INVENTORY_IDX item)
        }
 
 
-       /* Take a turn */
        p_ptr->energy_use = 100;
 
        /* Extract the item level */
index 8fdf680..8371aac 100644 (file)
@@ -350,7 +350,6 @@ void do_cmd_aim_wand_aux(INVENTORY_IDX item)
        }
        target_pet = old_target_pet;
 
-       /* Take a turn */
        p_ptr->energy_use = 100;
 
        /* Get the level */
index cca333a..bc55c02 100644 (file)
@@ -384,8 +384,6 @@ void do_cmd_search(void)
                /* Cancel the arg */
                command_arg = 0;
        }
-
-       /* Take a turn */
        p_ptr->energy_use = 100;
 
        /* Search */
@@ -447,15 +445,10 @@ static OBJECT_IDX chest_check(POSITION y, POSITION x, bool trapped)
 static bool do_cmd_open_chest(POSITION y, POSITION x, OBJECT_IDX o_idx)
 {
        int i, j;
-
        bool flag = TRUE;
-
        bool more = FALSE;
-
        object_type *o_ptr = &o_list[o_idx];
 
-
-       /* Take a turn */
        p_ptr->energy_use = 100;
 
        /* Attempt to unlock it */
@@ -675,13 +668,9 @@ static bool do_cmd_open_aux(POSITION y, POSITION x)
 
        /* Get requested grid */
        cave_type *c_ptr = &cave[y][x];
-
        feature_type *f_ptr = &f_info[c_ptr->feat];
-
        bool more = FALSE;
 
-
-       /* Take a turn */
        p_ptr->energy_use = 100;
 
        /* Seeing true feature code (ignore mimic) */
@@ -840,7 +829,6 @@ void do_cmd_open(void)
                /* Monster in the way */
                else if (c_ptr->m_idx && p_ptr->riding != c_ptr->m_idx)
                {
-                       /* Take a turn */
                        p_ptr->energy_use = 100;
 
                        /* Message */
@@ -889,7 +877,6 @@ static bool do_cmd_close_aux(POSITION y, POSITION x)
        FEAT_IDX old_feat = c_ptr->feat;
        bool more = FALSE;
 
-       /* Take a turn */
        p_ptr->energy_use = 100;
 
        /* Seeing true feature code (ignore mimic) */
@@ -1001,7 +988,6 @@ void do_cmd_close(void)
                /* Monster in the way */
                else if (c_ptr->m_idx)
                {
-                       /* Take a turn */
                        p_ptr->energy_use = 100;
 
                        /* Message */
@@ -1082,7 +1068,6 @@ static bool do_cmd_tunnel_aux(POSITION y, POSITION x)
        /* Verify legality */
        if (!do_cmd_tunnel_test(y, x)) return (FALSE);
 
-       /* Take a turn */
        p_ptr->energy_use = 100;
 
        /* Get grid */
@@ -1260,7 +1245,6 @@ void do_cmd_tunnel(void)
                /* A monster is in the way */
                else if (c_ptr->m_idx)
                {
-                       /* Take a turn */
                        p_ptr->energy_use = 100;
 
                        /* Message */
@@ -1400,13 +1384,9 @@ bool easy_open_door(POSITION y, POSITION x)
 static bool do_cmd_disarm_chest(POSITION y, POSITION x, OBJECT_IDX o_idx)
 {
        int i, j;
-
        bool more = FALSE;
-
        object_type *o_ptr = &o_list[o_idx];
 
-
-       /* Take a turn */
        p_ptr->energy_use = 100;
 
        /* Get the "disarm" factor */
@@ -1506,15 +1486,12 @@ static bool do_cmd_disarm_aux(POSITION y, POSITION x, DIRECTION dir)
 
        /* Extract trap "power" */
        int power = f_ptr->power;
-
        bool more = FALSE;
 
        /* Get the "disarm" factor */
        int i = p_ptr->skill_dis;
-
        int j;
 
-       /* Take a turn */
        p_ptr->energy_use = 100;
 
        /* Penalize some conditions */
@@ -1732,7 +1709,6 @@ static bool do_cmd_bash_aux(POSITION y, POSITION x, DIRECTION dir)
 
        cptr name = f_name + f_info[get_feat_mimic(c_ptr)].name;
 
-       /* Take a turn */
        p_ptr->energy_use = 100;
 
        /* Message */
@@ -1866,7 +1842,6 @@ void do_cmd_bash(void)
                /* Monster in the way */
                else if (c_ptr->m_idx)
                {
-                       /* Take a turn */
                        p_ptr->energy_use = 100;
 
                        /* Message */
@@ -1948,7 +1923,6 @@ void do_cmd_alter(void)
                feat = get_feat_mimic(c_ptr);
                f_ptr = &f_info[feat];
 
-               /* Take a turn */
                p_ptr->energy_use = 100;
 
                /* Attack monsters */
@@ -2093,7 +2067,6 @@ void do_cmd_spike(void)
                /* Is a monster in the way? */
                else if (c_ptr->m_idx)
                {
-                       /* Take a turn */
                        p_ptr->energy_use = 100;
 
                        /* Message */
@@ -2106,7 +2079,6 @@ void do_cmd_spike(void)
                /* Go for it */
                else
                {
-                       /* Take a turn */
                        p_ptr->energy_use = 100;
 
                        /* Successful jamming */
@@ -2152,7 +2124,6 @@ void do_cmd_walk(bool pickup)
        /* Get a "repeated" direction */
        if (get_rep_dir(&dir, FALSE))
        {
-               /* Take a turn */
                p_ptr->energy_use = 100;
 
                if ((dir != 5) && (p_ptr->special_defense & KATA_MUSOU))
@@ -2257,7 +2228,6 @@ void do_cmd_stay(bool pickup)
                command_arg = 0;
        }
 
-       /* Take a turn */
        p_ptr->energy_use = 100;
 
        if (pickup) mpe_mode |= MPE_DO_PICKUP;
@@ -3677,7 +3647,6 @@ bool do_cmd_throw(int mult, bool boomerang, OBJECT_IDX shuriken)
                p_ptr->redraw |= (PR_EQUIPPY);
        }
 
-       /* Take a turn */
        p_ptr->energy_use = 100;
 
        /* Rogue and Ninja gets bonus */
index 010df70..a74cef5 100644 (file)
@@ -878,7 +878,6 @@ void do_cmd_study(void)
 #endif
        }
 
-       /* Take a turn */
        p_ptr->energy_use = 100;
 
        switch (mp_ptr->spell_book)
@@ -1318,7 +1317,6 @@ void do_cmd_cast(void)
                }
        }
 
-       /* Take a turn */
        p_ptr->energy_use = 100;
 
 
index da9d4c1..03bc760 100644 (file)
 /*
  * Indexes of the various "stats" (hard-coded by savefiles, etc).
  */
-#define A_STR   0
-#define A_INT   1
-#define A_WIS   2
-#define A_DEX   3
-#define A_CON   4
-#define A_CHR   5
+#define A_STR 0
+#define A_INT 1
+#define A_WIS 2
+#define A_DEX 3
+#define A_CON 4
+#define A_CHR 5
+#define A_MAX 6
 
 /*
  * Player sex constants (hard-coded by save-files, arrays, etc)
index 2c01f30..16abf63 100644 (file)
@@ -1466,7 +1466,6 @@ static void process_world_aux_hp_and_sp(void)
                take_hit(DAMAGE_NOESCAPE, dam, _("致命傷", "a fatal wound"), -1);
        }
 
-
        /* (Vampires) Take damage from sunlight */
        if (prace_is_(RACE_VAMPIRE) || (p_ptr->mimic_form == MIMIC_VAMPIRE))
        {
@@ -1477,7 +1476,6 @@ static void process_world_aux_hp_and_sp(void)
                                /* Take damage */
                                msg_print(_("日光があなたのアンデッドの肉体を焼き焦がした!", "The sun's rays scorch your undead flesh!"));
                                take_hit(DAMAGE_NOESCAPE, 1, _("日光", "sunlight"), -1);
-
                                cave_no_regen = TRUE;
                        }
                }
@@ -1518,11 +1516,10 @@ static void process_world_aux_hp_and_sp(void)
 
                if (damage)
                {
-                       if (prace_is_(RACE_ENT)) damage += damage / 3;
-                       if (p_ptr->resist_fire) damage = damage / 3;
-                       if (IS_OPPOSE_FIRE()) damage = damage / 3;
-
-                       if (p_ptr->levitation) damage = damage / 5;
+                       if(prace_is_(RACE_ENT)) damage += damage / 3;
+                       if(p_ptr->resist_fire) damage = damage / 3;
+                       if(IS_OPPOSE_FIRE()) damage = damage / 3;
+                       if(p_ptr->levitation) damage = damage / 5;
 
                        damage = damage / 100 + (randint0(100) < (damage % 100));
 
@@ -1595,11 +1592,9 @@ static void process_world_aux_hp_and_sp(void)
         */
        if (!have_flag(f_ptr->flags, FF_MOVE) && !have_flag(f_ptr->flags, FF_CAN_FLY))
        {
-               if (!IS_INVULN() && !p_ptr->wraith_form && !p_ptr->kabenuke &&
-                   ((p_ptr->chp > (p_ptr->lev / 5)) || !p_ptr->pass_wall))
+               if (!IS_INVULN() && !p_ptr->wraith_form && !p_ptr->kabenuke && ((p_ptr->chp > (p_ptr->lev / 5)) || !p_ptr->pass_wall))
                {
                        cptr dam_desc;
-
                        cave_no_regen = TRUE;
 
                        if (p_ptr->pass_wall)
@@ -2077,13 +2072,11 @@ static void process_world_aux_mutation(void)
        /* No effect on the global map */
        if (p_ptr->wild_mode) return;
 
-
        if ((p_ptr->muta2 & MUT2_BERS_RAGE) && one_in_(3000))
        {
                disturb(0, 1);
                msg_print(_("ウガァァア!", "RAAAAGHH!"));
                msg_print(_("激怒の発作に襲われた!", "You feel a fit of rage coming over you!"));
-
                (void)set_shero(10 + randint1(p_ptr->lev), FALSE);
                (void)set_afraid(0);
        }
@@ -2100,12 +2093,9 @@ static void process_world_aux_mutation(void)
 
        if ((p_ptr->muta2 & MUT2_RTELEPORT) && (randint1(5000) == 88))
        {
-               if (!p_ptr->resist_nexus && !(p_ptr->muta1 & MUT1_VTELEPORT) &&
-                   !p_ptr->anti_tele)
+               if (!p_ptr->resist_nexus && !(p_ptr->muta1 & MUT1_VTELEPORT) && !p_ptr->anti_tele)
                {
                        disturb(0, 1);
-
-                       /* Teleport player */
                        msg_print(_("あなたの位置は突然ひじょうに不確定になった...", "Your position suddenly seems very uncertain..."));
                        msg_print(NULL);
                        teleport_player(40, TELEPORT_PASSIVE);
@@ -2162,9 +2152,7 @@ static void process_world_aux_mutation(void)
        if ((p_ptr->muta2 & MUT2_FLATULENT) && (randint1(3000) == 13))
        {
                disturb(0, 1);
-
                msg_print(_("ブゥーーッ!おっと。", "BRRAAAP! Oops."));
-
                msg_print(NULL);
                fire_ball(GF_POIS, 0, p_ptr->lev, 3);
        }
@@ -2183,8 +2171,7 @@ static void process_world_aux_mutation(void)
                fire_ball(GF_MANA, dire, p_ptr->lev * 2, 3);
        }
 
-       if ((p_ptr->muta2 & MUT2_ATT_DEMON) &&
-           !p_ptr->anti_magic && (randint1(6666) == 666))
+       if ((p_ptr->muta2 & MUT2_ATT_DEMON) && !p_ptr->anti_magic && (randint1(6666) == 666))
        {
                bool pet = one_in_(6);
                BIT_FLAGS mode = PM_ALLOW_GROUP;
@@ -2192,8 +2179,7 @@ static void process_world_aux_mutation(void)
                if (pet) mode |= PM_FORCE_PET;
                else mode |= (PM_ALLOW_UNIQUE | PM_NO_PET);
 
-               if (summon_specific((pet ? -1 : 0), p_ptr->y, p_ptr->x,
-                                   dun_level, SUMMON_DEMON, mode))
+               if (summon_specific((pet ? -1 : 0), p_ptr->y, p_ptr->x, dun_level, SUMMON_DEMON, mode))
                {
                        msg_print(_("あなたはデーモンを引き寄せた!", "You have attracted a demon!"));
                        disturb(0, 1);
@@ -2336,7 +2322,7 @@ static void process_world_aux_mutation(void)
        }
        if ((p_ptr->muta2 & MUT2_WASTING) && one_in_(3000))
        {
-               int which_stat = randint0(6);
+               int which_stat = randint0(A_MAX);
                int sustained = FALSE;
 
                switch (which_stat)
@@ -2592,12 +2578,11 @@ static void process_world_aux_curse(void)
                        (void)activate_ty_curse(FALSE, &count);
                }
                /* Handle experience draining */
-               if (p_ptr->prace != RACE_ANDROID && 
-                       ((p_ptr->cursed & TRC_DRAIN_EXP) && one_in_(4)))
+               if (p_ptr->prace != RACE_ANDROID && ((p_ptr->cursed & TRC_DRAIN_EXP) && one_in_(4)))
                {
-                       p_ptr->exp -= (p_ptr->lev+1)/2;
+                       p_ptr->exp -= (p_ptr->lev + 1) / 2;
                        if (p_ptr->exp < 0) p_ptr->exp = 0;
-                       p_ptr->max_exp -= (p_ptr->lev+1)/2;
+                       p_ptr->max_exp -= (p_ptr->lev + 1) / 2;
                        if (p_ptr->max_exp < 0) p_ptr->max_exp = 0;
                        check_experience();
                }
@@ -4843,9 +4828,9 @@ static void process_player(void)
                        msg_print(NULL);
                        if (r_idx && one_in_(2))
                        {
-                               int y, x;
-                               y = p_ptr->y+ddy[tsuri_dir];
-                               x = p_ptr->x+ddx[tsuri_dir];
+                               POSITION y, x;
+                               y = p_ptr->y + ddy[tsuri_dir];
+                               x = p_ptr->x + ddx[tsuri_dir];
                                if (place_monster_aux(0, y, x, r_idx, PM_NO_KAGE))
                                {
                                        char m_name[80];
@@ -4874,8 +4859,7 @@ static void process_player(void)
                        /* Check for a key */
                        if (inkey())
                        {
-                               /* Flush input */
-                               flush();
+                               flush(); /* Flush input */
 
                                /* Disturb */
                                disturb(0, 1);
@@ -4938,7 +4922,7 @@ static void process_player(void)
                if (MON_MONFEAR(m_ptr))
                {
                        /* Hack -- Recover from fear */
-                       if (set_monster_monfear(p_ptr->riding,
+                       if(set_monster_monfear(p_ptr->riding,
                                (randint0(r_ptr->level) < p_ptr->skill_exp[GINOU_RIDING]) ? 0 : (MON_MONFEAR(m_ptr) - 1)))
                        {
                                char m_name[80];
@@ -4964,10 +4948,7 @@ static void process_player(void)
        }
        if ((p_ptr->pclass == CLASS_FORCETRAINER) && P_PTR_KI)
        {
-               if (P_PTR_KI < 40)
-               {
-                       P_PTR_KI = 0;
-               }
+               if(P_PTR_KI < 40) P_PTR_KI = 0;
                else P_PTR_KI -= 40;
                p_ptr->update |= (PU_BONUS);
        }
@@ -4978,7 +4959,6 @@ static void process_player(void)
 
                /* Convert the unit (1/2^16) to (1/2^32) */
                s64b_LSHIFT(cost, cost_frac, 16);
-
  
                if (s64b_cmp(p_ptr->csp, p_ptr->csp_frac, cost, cost_frac) < 0)
                {
@@ -5033,19 +5013,15 @@ static void process_player(void)
                /* Refresh (optional) */
                if (fresh_before) Term_fresh();
 
-
                /* Hack -- Pack Overflow */
                pack_overflow();
 
-
                /* Hack -- cancel "lurking browse mode" */
                if (!command_new) command_see = FALSE;
 
-
                /* Assume free turn */
                p_ptr->energy_use = 0;
 
-
                if (p_ptr->inside_battle)
                {
                        /* Place the cursor on the player */
@@ -5060,7 +5036,6 @@ static void process_player(void)
                /* Paralyzed or Knocked Out */
                else if (p_ptr->paralyzed || (p_ptr->stun >= 100))
                {
-                       /* Take a turn */
                        p_ptr->energy_use = 100;
                }
 
@@ -5079,14 +5054,12 @@ static void process_player(void)
                                p_ptr->redraw |= (PR_STATE);
                        }
 
-                       /* Take a turn */
                        p_ptr->energy_use = 100;
                }
 
                /* Fishing */
                else if (p_ptr->action == ACTION_FISH)
                {
-                       /* Take a turn */
                        p_ptr->energy_use = 100;
                }
 
index 8c613b9..61bf62a 100644 (file)
@@ -372,7 +372,6 @@ void do_cmd_hissatsu(void)
        /* Cast the spell */
        if (!do_spell(REALM_HISSATSU, n, SPELL_CAST)) return;
 
-       /* Take a turn */
        p_ptr->energy_use = 100;
 
        /* Use some mana */
@@ -479,7 +478,6 @@ void do_cmd_gain_hissatsu(void)
        if (!gain)
                msg_print(_("何も覚えられなかった。", "You were not able to learn any special attacks."));
 
-       /* Take a turn */
        else
                p_ptr->energy_use = 100;
 
index afacfd0..bb735f0 100644 (file)
@@ -1040,7 +1040,6 @@ bool do_cmd_mane(bool baigaesi)
                p_ptr->mane_dam[j] = p_ptr->mane_dam[j+1];
        }
 
-       /* Take a turn */
        p_ptr->energy_use = 100;
 
        /* Window stuff */
index 12aef7a..75322d0 100644 (file)
@@ -2096,7 +2096,6 @@ void do_cmd_mind(void)
        }
 
 
-       /* Take a turn */
        p_ptr->energy_use = 100;
        /* teleport from mirror costs small energy */
        if( on_mirror && p_ptr->pclass == CLASS_MIRROR_MASTER )
index 1ceb5a3..067b2fd 100644 (file)
@@ -2742,7 +2742,6 @@ void process_monster(MONSTER_IDX m_idx)
                                        /* Do not bash the door */
                                        may_bash = FALSE;
 
-                                       /* Take a turn */
                                        do_turn = TRUE;
                                }
 
@@ -2758,7 +2757,6 @@ void process_monster(MONSTER_IDX m_idx)
                                                /* Do not bash the door */
                                                may_bash = FALSE;
 
-                                               /* Take a turn */
                                                do_turn = TRUE;
                                        }
                                }
@@ -3026,7 +3024,6 @@ void process_monster(MONSTER_IDX m_idx)
                        /* Note changes to viewable region */
                        do_view = TRUE;
 
-                       /* Take a turn */
                        do_turn = TRUE;
                }
 
@@ -3064,7 +3061,6 @@ void process_monster(MONSTER_IDX m_idx)
                /* Creature has been allowed move */
                if (do_move)
                {
-                       /* Take a turn */
                        do_turn = TRUE;
 
                        if (have_flag(f_ptr->flags, FF_TREE))
index e2cc270..56a3e97 100644 (file)
@@ -1590,7 +1590,6 @@ bool do_cmd_cast_learned(void)
                }
        }
 
-       /* Take a turn */
        p_ptr->energy_use = 100;
 
        /* Window stuff */
index b0e1c00..f969a8a 100644 (file)
@@ -602,7 +602,6 @@ void do_cmd_snipe(void)
 
        if (!cast) return;
 #if 0
-       /* Take a turn */
        p_ptr->energy_use = 100;
 #endif
        /* Redraw mana */