From 35831b37978388f943e7c7ec80351080f4941ab0 Mon Sep 17 00:00:00 2001 From: Deskull Date: Tue, 20 Nov 2018 23:44:26 +0900 Subject: [PATCH] =?utf8?q?[Refactor]=20#37353=20=E3=82=B3=E3=83=A1?= =?utf8?q?=E3=83=B3=E3=83=88=E3=81=A8=E3=83=A1=E3=83=83=E3=82=BB=E3=83=BC?= =?utf8?q?=E3=82=B8=E6=95=B4=E7=90=86=20/=20Refactor=20comments=20and=20me?= =?utf8?q?ssages.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/cave.c | 2 -- src/floor-generate.c | 1 - src/load.c | 2 -- src/monster2.c | 1 - src/object2.c | 3 --- src/save.c | 1 - src/spells1.c | 1 - src/spells2.c | 35 ++++++----------------------------- 8 files changed, 6 insertions(+), 40 deletions(-) diff --git a/src/cave.c b/src/cave.c index 46a4ca697..9432d404b 100644 --- a/src/cave.c +++ b/src/cave.c @@ -2002,7 +2002,6 @@ void display_map(int *cy, int *cx) { for (j = 0; j < cur_hgt; ++j) { - /* Location */ x = i / xrat + 1; y = j / yrat + 1; @@ -2036,7 +2035,6 @@ void display_map(int *cy, int *cx) { for (i = 0; i < cur_wid; ++i) { - /* Location */ x = i / xrat + 1; y = j / yrat + 1; diff --git a/src/floor-generate.c b/src/floor-generate.c index c60da9f58..7efdd96ab 100644 --- a/src/floor-generate.c +++ b/src/floor-generate.c @@ -306,7 +306,6 @@ static void alloc_object(int set, EFFECT_ID typ, int num) dummy++; - /* Location */ y = randint0(cur_hgt); x = randint0(cur_wid); diff --git a/src/load.c b/src/load.c index 460dc5443..a76591831 100644 --- a/src/load.c +++ b/src/load.c @@ -347,7 +347,6 @@ static void rd_item_old(object_type *o_ptr) /* Kind */ rd_s16b(&o_ptr->k_idx); - /* Location */ rd_byte(&tmp8u); o_ptr->iy = (POSITION)tmp8u; rd_byte(&tmp8u); @@ -628,7 +627,6 @@ static void rd_item(object_type *o_ptr) /* Kind */ rd_s16b(&o_ptr->k_idx); - /* Location */ rd_byte(&tmp8u); o_ptr->iy = (POSITION)tmp8u; rd_byte(&tmp8u); diff --git a/src/monster2.c b/src/monster2.c index 167295319..b6ad372c7 100644 --- a/src/monster2.c +++ b/src/monster2.c @@ -342,7 +342,6 @@ static void compact_monsters_aux(IDX i1, IDX i2) /* Old monster */ m_ptr = &m_list[i1]; - /* Location */ y = m_ptr->fy; x = m_ptr->fx; diff --git a/src/object2.c b/src/object2.c index 321e1d267..93acb50c6 100644 --- a/src/object2.c +++ b/src/object2.c @@ -200,7 +200,6 @@ void delete_object_idx(OBJECT_IDX o_idx) { POSITION y, x; - /* Location */ y = j_ptr->iy; x = j_ptr->ix; @@ -4956,7 +4955,6 @@ void place_object(POSITION y, POSITION x, BIT_FLAGS mode) /* Structure Copy */ object_copy(o_ptr, q_ptr); - /* Location */ o_ptr->iy = y; o_ptr->ix = x; @@ -5187,7 +5185,6 @@ OBJECT_IDX drop_near(object_type *j_ptr, PERCENTAGE chance, POSITION y, POSITION /* Ignore distant grids */ if (d > 10) continue; - /* Location */ ty = y + dy; tx = x + dx; diff --git a/src/save.c b/src/save.c index 7db8b36d8..ad03dde13 100644 --- a/src/save.c +++ b/src/save.c @@ -164,7 +164,6 @@ static void wr_item(object_type *o_ptr) /*** Write only un-obvious elements ***/ wr_s16b(o_ptr->k_idx); - /* Location */ wr_byte((byte_hack)o_ptr->iy); wr_byte((byte_hack)o_ptr->ix); diff --git a/src/spells1.c b/src/spells1.c index a4547676d..8d917e6af 100644 --- a/src/spells1.c +++ b/src/spells1.c @@ -7688,7 +7688,6 @@ bool project(MONSTER_IDX who, POSITION rad, POSITION y, POSITION x, HIT_POINT da /* Player affected one monster (without "jumping") */ if (!who && (project_m_n == 1) && !jump) { - /* Location */ x = project_m_x; y = project_m_y; diff --git a/src/spells2.c b/src/spells2.c index d31dff9d3..cd4dde967 100644 --- a/src/spells2.c +++ b/src/spells2.c @@ -196,7 +196,6 @@ bool detect_objects_gold(POSITION range) /* Skip held objects */ if (o_ptr->held_m_idx) continue; - /* Location */ y = o_ptr->iy; x = o_ptr->ix; @@ -260,7 +259,6 @@ bool detect_objects_normal(POSITION range) /* Skip held objects */ if (o_ptr->held_m_idx) continue; - /* Location */ y = o_ptr->iy; x = o_ptr->ix; @@ -331,7 +329,6 @@ bool detect_objects_magic(POSITION range) /* Skip held objects */ if (o_ptr->held_m_idx) continue; - /* Location */ y = o_ptr->iy; x = o_ptr->ix; @@ -412,7 +409,6 @@ bool detect_monsters_normal(POSITION range) /* Skip dead monsters */ if (!m_ptr->r_idx) continue; - /* Location */ y = m_ptr->fy; x = m_ptr->fx; @@ -472,7 +468,6 @@ bool detect_monsters_invis(POSITION range) /* Skip dead monsters */ if (!m_ptr->r_idx) continue; - /* Location */ y = m_ptr->fy; x = m_ptr->fx; @@ -538,7 +533,6 @@ bool detect_monsters_evil(POSITION range) /* Skip dead monsters */ if (!m_ptr->r_idx) continue; - /* Location */ y = m_ptr->fy; x = m_ptr->fx; @@ -608,7 +602,6 @@ bool detect_monsters_nonliving(POSITION range) /* Skip dead monsters */ if (!m_ptr->r_idx) continue; - /* Location */ y = m_ptr->fy; x = m_ptr->fx; @@ -672,7 +665,6 @@ bool detect_monsters_mind(POSITION range) /* Skip dead monsters */ if (!m_ptr->r_idx) continue; - /* Location */ y = m_ptr->fy; x = m_ptr->fx; @@ -738,7 +730,6 @@ bool detect_monsters_string(POSITION range, cptr Match) /* Skip dead monsters */ if (!m_ptr->r_idx) continue; - /* Location */ y = m_ptr->fy; x = m_ptr->fx; @@ -806,7 +797,6 @@ bool detect_monsters_xxx(POSITION range, u32b match_flag) /* Skip dead monsters */ if (!m_ptr->r_idx) continue; - /* Location */ y = m_ptr->fy; x = m_ptr->fx; @@ -908,9 +898,10 @@ bool detect_all(POSITION range) */ bool project_hack(EFFECT_ID typ, HIT_POINT dam) { - int i, x, y; - int flg = PROJECT_JUMP | PROJECT_KILL | PROJECT_HIDE; - bool obvious = FALSE; + MONSTER_IDX i; + POSITION x, y; + BIT_FLAGS flg = PROJECT_JUMP | PROJECT_KILL | PROJECT_HIDE; + bool obvious = FALSE; /* Mark all (nearby) monsters */ @@ -921,7 +912,6 @@ bool project_hack(EFFECT_ID typ, HIT_POINT dam) /* Paranoia -- Skip dead monsters */ if (!m_ptr->r_idx) continue; - /* Location */ y = m_ptr->fy; x = m_ptr->fx; @@ -943,7 +933,6 @@ bool project_hack(EFFECT_ID typ, HIT_POINT dam) /* Remove mark */ m_ptr->mflag &= ~(MFLAG_TEMP); - /* Location */ y = m_ptr->fy; x = m_ptr->fx; @@ -1081,7 +1070,6 @@ void aggravate_monsters(MONSTER_IDX who) bool sleep = FALSE; bool speed = FALSE; - /* Aggravate everyone nearby */ for (i = 1; i < m_max; i++) { @@ -1117,14 +1105,8 @@ void aggravate_monsters(MONSTER_IDX who) } } - /* Messages */ -#ifdef JP - if (speed) msg_print("付近で何かが突如興奮したような感じを受けた!"); - else if (sleep) msg_print("何かが突如興奮したような騒々しい音が遠くに聞こえた!"); -#else - if (speed) msg_print("You feel a sudden stirring nearby!"); - else if (sleep) msg_print("You hear a sudden stirring in the distance!"); -#endif + if (speed) msg_print(_("付近で何かが突如興奮したような感じを受けた!", "You feel a sudden stirring nearby!")); + else if (sleep) msg_print(_("何かが突如興奮したような騒々しい音が遠くに聞こえた!", "You hear a sudden stirring in the distance!")); if (p_ptr->riding) p_ptr->update |= PU_BONUS; } @@ -1149,15 +1131,10 @@ bool genocide_aux(MONSTER_IDX m_idx, int power, bool player_cast, int dam_side, /* Hack -- Skip Unique Monsters or Quest Monsters */ if (r_ptr->flags1 & (RF1_UNIQUE | RF1_QUESTOR)) resist = TRUE; - else if (r_ptr->flags7 & RF7_UNIQUE2) resist = TRUE; - else if (m_idx == p_ptr->riding) resist = TRUE; - else if ((p_ptr->inside_quest && !random_quest_number(dun_level)) || p_ptr->inside_arena || p_ptr->inside_battle) resist = TRUE; - else if (player_cast && (r_ptr->level > randint0(power))) resist = TRUE; - else if (player_cast && (m_ptr->mflag2 & MFLAG2_NOGENO)) resist = TRUE; /* Delete the monster */ -- 2.11.0