OSDN Git Service

[Refactor] #37353 コメント整理。 update_mon()をupdate_monster()に改名。 / Refactor comments and...
authorDeskull <deskull@users.sourceforge.jp>
Sat, 1 Dec 2018 10:38:40 +0000 (19:38 +0900)
committerDeskull <deskull@users.sourceforge.jp>
Sat, 1 Dec 2018 10:38:40 +0000 (19:38 +0900)
18 files changed:
src/cave.c
src/cmd1.c
src/cmd2.c
src/cmd4.c
src/dungeon.c
src/externs.h
src/floor-generate.c
src/floor-save.c
src/mind.c
src/monster-process.c
src/monster-status.c
src/monster2.c
src/realm-hissatsu.c
src/spells1.c
src/spells2.c
src/spells3.c
src/wizard1.c
src/xtra2.c

index b3d518c..a9ec76b 100644 (file)
@@ -423,7 +423,7 @@ static bool check_local_illumination(POSITION y, POSITION x)
        if (player_has_los_bold((Y), (X))) \
        { \
                /* Update the monster */ \
-               if (cave[(Y)][(X)].m_idx) update_mon(cave[(Y)][(X)].m_idx, FALSE); \
+               if (cave[(Y)][(X)].m_idx) update_monster(cave[(Y)][(X)].m_idx, FALSE); \
 \
                /* Notice and redraw */ \
                note_spot((Y), (X)); \
@@ -4040,7 +4040,7 @@ void delayed_visual_update(void)
                lite_spot(y, x);
 
                /* Hack -- Visual update of monster on this grid */
-               if (c_ptr->m_idx) update_mon(c_ptr->m_idx, FALSE);
+               if (c_ptr->m_idx) update_monster(c_ptr->m_idx, FALSE);
 
                /* No longer in the array */
                c_ptr->info &= ~(CAVE_NOTE | CAVE_REDRAW);
@@ -4573,9 +4573,7 @@ void cave_set_feat(POSITION y, POSITION x, FEAT_IDX feat)
 
        /* Check for change to boring grid */
        if (!have_flag(f_ptr->flags, FF_REMEMBER)) c_ptr->info &= ~(CAVE_MARK);
-
-       /* Update the monster */
-       if (c_ptr->m_idx) update_mon(c_ptr->m_idx, FALSE);
+       if (c_ptr->m_idx) update_monster(c_ptr->m_idx, FALSE);
 
        note_spot(y, x);
 
@@ -4613,8 +4611,7 @@ void cave_set_feat(POSITION y, POSITION x, FEAT_IDX feat)
 
                        if (player_has_los_grid(cc_ptr))
                        {
-                               /* Update the monster */
-                               if (cc_ptr->m_idx) update_mon(cc_ptr->m_idx, FALSE);
+                               if (cc_ptr->m_idx) update_monster(cc_ptr->m_idx, FALSE);
 
                                note_spot(yy, xx);
 
@@ -4755,9 +4752,7 @@ void remove_mirror(POSITION y, POSITION x)
        {
                c_ptr->info &= ~(CAVE_GLOW);
                if (!view_torch_grids) c_ptr->info &= ~(CAVE_MARK);
-
-               /* Update the monster */
-               if (c_ptr->m_idx) update_mon(c_ptr->m_idx, FALSE);
+               if (c_ptr->m_idx) update_monster(c_ptr->m_idx, FALSE);
 
                update_local_illumination(y, x);
        }
index 5ab57b9..e012601 100644 (file)
@@ -860,7 +860,7 @@ bool move_player_effect(POSITION ny, POSITION nx, BIT_FLAGS mpe_mode)
                                monster_type *om_ptr = &m_list[om_idx];
                                om_ptr->fy = ny;
                                om_ptr->fx = nx;
-                               update_mon(om_idx, TRUE);
+                               update_monster(om_idx, TRUE);
                        }
 
                        if (nm_idx > 0) /* Monster on new spot */
@@ -868,7 +868,7 @@ bool move_player_effect(POSITION ny, POSITION nx, BIT_FLAGS mpe_mode)
                                monster_type *nm_ptr = &m_list[nm_idx];
                                nm_ptr->fy = oy;
                                nm_ptr->fx = ox;
-                               update_mon(nm_idx, TRUE);
+                               update_monster(nm_idx, TRUE);
                        }
                }
 
index 3d7443d..e3ee7a7 100644 (file)
@@ -3169,7 +3169,7 @@ void do_cmd_fire_aux(INVENTORY_IDX item, object_type *j_ptr)
                                                        m_ptr->fy = ny;
 
                                                        /* Update the monster (new location) */
-                                                       update_mon(c_mon_ptr->m_idx, TRUE);
+                                                       update_monster(c_mon_ptr->m_idx, TRUE);
 
                                                        lite_spot(ny, nx);
                                                        lite_spot(oy, ox);
index d4551e5..2e095f2 100644 (file)
@@ -5540,9 +5540,9 @@ static void do_cmd_knowledge_uniques(void)
 
        if (!fff)
        {
-           msg_format(_("一時ファイル %s を作成できませんでした。", "Failed to create temporary file %s."), file_name);
-           msg_print(NULL);
-           return;
+               msg_format(_("一時ファイル %s を作成できませんでした。", "Failed to create temporary file %s."), file_name);
+               msg_print(NULL);
+               return;
        }
 
        /* Allocate the "who" array */
index 168ea6f..b955ce3 100644 (file)
@@ -4702,9 +4702,7 @@ static void process_player(void)
 
                        /* Hack -- Detect monster */
                        m_ptr->mflag2 |= (MFLAG2_MARK | MFLAG2_SHOW);
-
-                       /* Update the monster */
-                       update_mon(i, FALSE);
+                       update_monster(i, FALSE);
                }
                prt_time();
        }
@@ -5160,9 +5158,7 @@ static void process_player(void)
 
                                                        /* Assume invisible */
                                                        m_ptr->ml = FALSE;
-
-                                                       /* Update the monster */
-                                                       update_mon(i, FALSE);
+                                                       update_monster(i, FALSE);
 
                                                        if (p_ptr->health_who == i) p_ptr->redraw |= (PR_HEALTH);
                                                        if (p_ptr->riding == i) p_ptr->redraw |= (PR_UHEALTH);
index ec4ce37..aec455e 100644 (file)
@@ -760,7 +760,7 @@ extern void monster_desc(char *desc, monster_type *m_ptr, BIT_FLAGS mode);
 extern int lore_do_probe(MONRACE_IDX r_idx);
 extern void lore_treasure(MONSTER_IDX m_idx, ITEM_NUMBER num_item, ITEM_NUMBER num_gold);
 extern void sanity_blast(monster_type *m_ptr, bool necro);
-extern void update_mon(MONSTER_IDX m_idx, bool full);
+extern void update_monster(MONSTER_IDX m_idx, bool full);
 extern void update_monsters(bool full);
 extern bool place_monster_aux(MONSTER_IDX who, POSITION y, POSITION x, MONRACE_IDX r_idx, BIT_FLAGS mode);
 extern bool place_monster(POSITION y, POSITION x, BIT_FLAGS mode);
index b1e53d4..809f977 100644 (file)
@@ -1182,9 +1182,7 @@ static void battle_gen(void)
 
                /* Hack -- Detect monster */
                m_ptr->mflag2 |= (MFLAG2_MARK | MFLAG2_SHOW);
-
-               /* Update the monster */
-               update_mon(i, FALSE);
+               update_monster(i, FALSE);
        }
 }
 
index b34ec38..73ef1cb 100644 (file)
@@ -574,9 +574,7 @@ static void place_pet(void)
                                /* Must repair monsters */
                                repair_monsters = TRUE;
                        }
-
-                       /* Update the monster */
-                       update_mon(m_idx, TRUE);
+                       update_monster(m_idx, TRUE);
                        lite_spot(cy, cx);
 
                        /* Pre-calculated in precalc_cur_num_of_pet() */
@@ -728,7 +726,7 @@ static void get_out_monster(void)
                m_ptr->fy = ny;
                m_ptr->fx = nx; 
 
-               /* No need to do update_mon() */
+               /* No need to do update_monster() */
 
                /* Success */
                return;
index 9395e99..7a1ee99 100644 (file)
@@ -1707,7 +1707,7 @@ static bool cast_ninja_spell(int spell)
                (void)set_monster_csleep(m_idx, 0);
 
                /* Update the monster (new location) */
-               update_mon(m_idx, TRUE);
+               update_monster(m_idx, TRUE);
 
                /* Redraw the old grid */
                lite_spot(target_row, target_col);
index a2b9ebf..55eff62 100644 (file)
@@ -3055,7 +3055,7 @@ void process_monster(MONSTER_IDX m_idx)
                                        y_ptr->fx = ox;
 
                                        /* Update the old monster */
-                                       update_mon(c_ptr->m_idx, TRUE);
+                                       update_monster(c_ptr->m_idx, TRUE);
                                }
 
                                /* Hack -- Update the new location */
@@ -3064,9 +3064,7 @@ void process_monster(MONSTER_IDX m_idx)
                                /* Move the monster */
                                m_ptr->fy = ny;
                                m_ptr->fx = nx;
-
-                               /* Update the monster */
-                               update_mon(m_idx, TRUE);
+                               update_monster(m_idx, TRUE);
 
                                /* Redraw the old grid */
                                lite_spot(oy, ox);
index 5f7b5c3..ea38272 100644 (file)
@@ -857,7 +857,7 @@ void monster_gain_exp(MONSTER_IDX m_idx, IDX s_idx)
                        /* Now you feel very close to this pet. */
                        m_ptr->parent_m_idx = 0;
                }
-               update_mon(m_idx, FALSE);
+               update_monster(m_idx, FALSE);
                lite_spot(m_ptr->fy, m_ptr->fx);
        }
        if (m_idx == p_ptr->riding) p_ptr->update |= PU_BONUS;
index bd9126f..05ead33 100644 (file)
@@ -2282,7 +2282,7 @@ void sanity_blast(monster_type *m_ptr, bool necro)
  * "disturb_near" (monster which is "easily" viewable moves in some
  * way).  Note that "moves" includes "appears" and "disappears".
  */
-void update_mon(MONSTER_IDX m_idx, bool full)
+void update_monster(MONSTER_IDX m_idx, bool full)
 {
        monster_type *m_ptr = &m_list[m_idx];
 
@@ -2686,9 +2686,7 @@ void update_monsters(bool full)
 
                /* Skip dead monsters */
                if (!m_ptr->r_idx) continue;
-
-               /* Update the monster */
-               update_mon(i, full);
+               update_monster(i, full);
        }
 }
 
@@ -2821,7 +2819,7 @@ void choose_new_monster(MONSTER_IDX m_idx, bool born, MONRACE_IDX r_idx)
 
        m_ptr->r_idx = r_idx;
        m_ptr->ap_r_idx = r_idx;
-       update_mon(m_idx, FALSE);
+       update_monster(m_idx, FALSE);
        lite_spot(m_ptr->fy, m_ptr->fx);
 
        if ((r_info[old_r_idx].flags7 & (RF7_LITE_MASK | RF7_DARK_MASK)) ||
@@ -3267,9 +3265,7 @@ static bool place_monster_one(MONSTER_IDX who, POSITION y, POSITION x, MONRACE_I
                p_ptr->update |= (PU_MON_LITE);
        else if ((r_ptr->flags7 & RF7_HAS_LD_MASK) && !MON_CSLEEP(m_ptr))
                p_ptr->update |= (PU_MON_LITE);
-
-       /* Update the monster */
-       update_mon(c_ptr->m_idx, TRUE);
+       update_monster(c_ptr->m_idx, TRUE);
 
 
        /* Count the monsters on the level */
index 01350b5..f36d482 100644 (file)
@@ -308,7 +308,7 @@ cptr do_hissatsu_spell(SPELL_IDX spell, BIT_FLAGS mode)
                                        m_ptr->fy = ty;
                                        m_ptr->fx = tx;
 
-                                       update_mon(m_idx, TRUE);
+                                       update_monster(m_idx, TRUE);
                                        lite_spot(oy, ox);
                                        lite_spot(ty, tx);
 
@@ -674,7 +674,7 @@ cptr do_hissatsu_spell(SPELL_IDX spell, BIT_FLAGS mode)
                                m_ptr->fy = ny;
                                m_ptr->fx = nx;
 
-                               update_mon(m_idx, TRUE);
+                               update_monster(m_idx, TRUE);
 
                                /* Redraw the old spot */
                                lite_spot(y, x);
index 7e362f6..e71736d 100644 (file)
@@ -1086,7 +1086,7 @@ static bool project_f(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_P
 
                                /* Mega-Hack -- Update the monster in the affected grid */
                                /* This allows "spear of light" (etc) to work "correctly" */
-                               if (c_ptr->m_idx) update_mon(c_ptr->m_idx, FALSE);
+                               if (c_ptr->m_idx) update_monster(c_ptr->m_idx, FALSE);
 
                                if (p_ptr->special_defense & NINJA_S_STEALTH)
                                {
@@ -1149,7 +1149,7 @@ static bool project_f(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_P
 
                                /* Mega-Hack -- Update the monster in the affected grid */
                                /* This allows "spear of light" (etc) to work "correctly" */
-                               if (c_ptr->m_idx) update_mon(c_ptr->m_idx, FALSE);
+                               if (c_ptr->m_idx) update_monster(c_ptr->m_idx, FALSE);
                        }
 
                        /* All done */
@@ -5025,9 +5025,7 @@ static bool project_m(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_P
        }
 
        /* Verify this code */
-
-       /* Update the monster */
-       if (m_ptr->r_idx) update_mon(c_ptr->m_idx, FALSE);
+       if (m_ptr->r_idx) update_monster(c_ptr->m_idx, FALSE);
 
        /* Redraw the monster grid */
        lite_spot(y, x);
index d8c446d..97f1728 100644 (file)
@@ -378,9 +378,7 @@ bool detect_monsters_normal(POSITION range)
 
                        /* Hack -- Detect monster */
                        m_ptr->mflag2 |= (MFLAG2_MARK | MFLAG2_SHOW);
-
-                       /* Update the monster */
-                       update_mon(i, FALSE);
+                       update_monster(i, FALSE);
                        flag = TRUE;
                }
        }
@@ -437,9 +435,7 @@ bool detect_monsters_invis(POSITION range)
 
                        /* Hack -- Detect monster */
                        m_ptr->mflag2 |= (MFLAG2_MARK | MFLAG2_SHOW);
-
-                       /* Update the monster */
-                       update_mon(i, FALSE);
+                       update_monster(i, FALSE);
                        flag = TRUE;
                }
        }
@@ -501,9 +497,7 @@ bool detect_monsters_evil(POSITION range)
 
                        /* Hack -- Detect monster */
                        m_ptr->mflag2 |= (MFLAG2_MARK | MFLAG2_SHOW);
-
-                       /* Update the monster */
-                       update_mon(i, FALSE);
+                       update_monster(i, FALSE);
                        flag = TRUE;
                }
        }
@@ -557,9 +551,7 @@ bool detect_monsters_nonliving(POSITION range)
 
                        /* Hack -- Detect monster */
                        m_ptr->mflag2 |= (MFLAG2_MARK | MFLAG2_SHOW);
-
-                       /* Update the monster */
-                       update_mon(i, FALSE);
+                       update_monster(i, FALSE);
                        flag = TRUE;
                }
        }
@@ -613,9 +605,7 @@ bool detect_monsters_mind(POSITION range)
 
                        /* Hack -- Detect monster */
                        m_ptr->mflag2 |= (MFLAG2_MARK | MFLAG2_SHOW);
-
-                       /* Update the monster */
-                       update_mon(i, FALSE);
+                       update_monster(i, FALSE);
                        flag = TRUE;
                }
        }
@@ -671,9 +661,7 @@ bool detect_monsters_string(POSITION range, cptr Match)
 
                        /* Hack -- Detect monster */
                        m_ptr->mflag2 |= (MFLAG2_MARK | MFLAG2_SHOW);
-
-                       /* Update the monster */
-                       update_mon(i, FALSE);
+                       update_monster(i, FALSE);
                        flag = TRUE;
                }
        }
@@ -737,9 +725,7 @@ bool detect_monsters_xxx(POSITION range, u32b match_flag)
 
                        /* Hack -- Detect monster */
                        m_ptr->mflag2 |= (MFLAG2_MARK | MFLAG2_SHOW);
-
-                       /* Update the monster */
-                       update_mon(i, FALSE);
+                       update_monster(i, FALSE);
                        flag = TRUE;
                }
        }
@@ -1993,7 +1979,7 @@ bool earthquake_aux(POSITION cy, POSITION cx, POSITION r, MONSTER_IDX m_idx)
                                                m_ptr->fx = sx;
 
                                                /* Update the monster (new location) */
-                                               update_mon(m_idx, TRUE);
+                                               update_monster(m_idx, TRUE);
 
                                                /* Redraw the old grid */
                                                lite_spot(yy, xx);
@@ -2246,9 +2232,7 @@ static void cave_temp_room_lite(void)
                        monster_type    *m_ptr = &m_list[c_ptr->m_idx];
 
                        monster_race    *r_ptr = &r_info[m_ptr->r_idx];
-
-                       /* Update the monster */
-                       update_mon(c_ptr->m_idx, FALSE);
+                       update_monster(c_ptr->m_idx, FALSE);
 
                        /* Stupid monsters rarely wake up */
                        if (r_ptr->flags2 & (RF2_STUPID)) chance = 10;
@@ -2359,8 +2343,7 @@ static void cave_temp_room_unlite(void)
                        /* Process affected monsters */
                        if (c_ptr->m_idx)
                        {
-                               /* Update the monster */
-                               update_mon(c_ptr->m_idx, FALSE);
+                               update_monster(c_ptr->m_idx, FALSE);
                        }
 
                        /* Redraw */
@@ -4025,9 +4008,7 @@ bool rush_attack(bool *mdeath)
 
                /* Move player before updating the monster */
                if (!player_bold(ty, tx)) teleport_player_to(ty, tx, TELEPORT_NONMAGICAL);
-
-               /* Update the monster */
-               update_mon(cave[ny][nx].m_idx, TRUE);
+               update_monster(cave[ny][nx].m_idx, TRUE);
 
                /* Found a monster */
                m_ptr = &m_list[cave[ny][nx].m_idx];
index 8e7a21c..7a2ef24 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);
@@ -5067,7 +5067,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);
 
index f0ca3bd..9f622dd 100644 (file)
@@ -1257,8 +1257,7 @@ static void analyze_misc_magic(object_type *o_ptr, cptr *misc_list)
        misc_list = spoiler_flag_aux(flgs, misc_flags2_desc, misc_list,
                                     N_ELEMENTS(misc_flags2_desc));
 
-       misc_list = spoiler_flag_aux(flgs, misc_flags3_desc, misc_list,
-                                    N_ELEMENTS(misc_flags3_desc));
+       misc_list = spoiler_flag_aux(flgs, misc_flags3_desc, misc_list, N_ELEMENTS(misc_flags3_desc));
 
        /*
         * Glowing artifacts -- small radius light.
@@ -1381,8 +1380,7 @@ static void analyze_misc(object_type *o_ptr, char *misc_desc)
 {
        artifact_type *a_ptr = &a_info[o_ptr->name1];
 
-       sprintf(misc_desc, _("レベル %d, 希少度 %u, %d.%d kg, $%ld", "Level %d, Rarity %u, %d.%d lbs, %ld Gold"),
-               (int)a_ptr->level, a_ptr->rarity,
+       sprintf(misc_desc, _("レベル %d, 希少度 %u, %d.%d kg, $%ld", "Level %d, Rarity %u, %d.%d lbs, %ld Gold"), (int)a_ptr->level, a_ptr->rarity,
 #ifdef JP
                lbtokg1(a_ptr->weight), lbtokg2(a_ptr->weight), (long int)a_ptr->cost);
 #else
@@ -1423,8 +1421,7 @@ static void print_header(void)
 {
        char buf[80];
 
-       sprintf(buf, "Artifact Spoilers for Hengband Version %d.%d.%d",
-               FAKE_VER_MAJOR-10, FAKE_VER_MINOR, FAKE_VER_PATCH);
+       sprintf(buf, "Artifact Spoilers for Hengband Version %d.%d.%d",FAKE_VER_MAJOR-10, FAKE_VER_MINOR, FAKE_VER_PATCH);
        spoiler_underline(buf);
 }
 
index a6ed8e9..36beac4 100644 (file)
@@ -3487,7 +3487,7 @@ static char target_set_aux(POSITION y, POSITION x, BIT_FLAGS mode, cptr info)
  * some form of "scrolling" the map around the cursor.  
  * That is, consider the possibility of "auto-scrolling" the screen
  * while the cursor moves around.  This may require changes in the
- * "update_mon()" code to allow "visibility" even if off panel, and
+ * "update_monster()" code to allow "visibility" even if off panel, and
  * may require dynamic recalculation of the "temp" grid set.
  *
  * Hack -- targeting/observing an "outer border grid" may induce