From 1a1d4a7c901ab6dea8f96ea05e8d102504313e08 Mon Sep 17 00:00:00 2001 From: deskull Date: Mon, 17 Jun 2019 23:44:01 +0900 Subject: [PATCH] =?utf8?q?[Refactor]=20#37353=20player=5Ftype=20=E3=81=AE?= =?utf8?q?=E3=80=80=E9=97=98=E6=8A=80=E5=A0=B4=E8=A6=B3=E6=88=A6=E3=83=A2?= =?utf8?q?=E3=83=BC=E3=83=89=E3=83=95=E3=83=A9=E3=82=B0=E5=90=8D=E3=82=92?= =?utf8?q?=20inside=5Farena=20=E3=81=8B=E3=82=89=20phase=5Fout=20=E3=81=AB?= =?utf8?q?=E6=94=B9=E5=90=8D=E3=80=82=20(=E5=8A=B9=E6=9E=9C=E3=81=A8?= =?utf8?q?=E3=81=97=E3=81=A6=E3=81=AF=20MtG=20=E3=81=AE=E5=90=8C=E5=90=8D?= =?utf8?q?=E3=81=AE=E5=8A=B9=E6=9E=9C=E3=81=AB=E8=BF=91=E3=81=84=E3=81=A8?= =?utf8?q?=E5=88=A4=E6=96=AD=E3=80=82=E4=BB=8A=E5=BE=8C=E5=88=A5=E3=81=AE?= =?utf8?q?=E5=BF=9C=E7=94=A8=E3=82=92=E8=80=83=E3=81=88=E3=82=8B)?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/bldg.c | 22 +++++++++++----------- src/core.c | 36 ++++++++++++++++++------------------ src/floor-events.c | 4 ++-- src/floor-generate.c | 2 +- src/floor-save.c | 2 +- src/floor.h | 2 +- src/gamevalue.h | 2 +- src/geometry.h | 2 +- src/load.c | 4 ++-- src/melee1.c | 2 +- src/monster-process.c | 14 +++++++------- src/monster-status.c | 6 +++--- src/monster1.c | 18 +++++++++--------- src/monster2.c | 12 ++++++------ src/mspells1.c | 4 ++-- src/mspells2.c | 6 +++--- src/mspells4.c | 2 +- src/player-status.c | 4 ++-- src/player-status.h | 2 +- src/save.c | 2 +- src/spells-floor.c | 2 +- src/spells.h | 2 +- src/spells1.c | 8 ++++---- src/spells2.c | 10 +++++----- src/spells3.c | 6 +++--- src/util.c | 2 +- src/view-mainwindow.c | 4 ++-- 27 files changed, 91 insertions(+), 91 deletions(-) diff --git a/src/bldg.c b/src/bldg.c index 5832cbf78..fef487b82 100644 --- a/src/bldg.c +++ b/src/bldg.c @@ -1452,7 +1452,7 @@ void update_gambling_monsters(void) int mon_level; int power[4]; bool tekitou; - bool old_inside_battle = p_ptr->inside_battle; + bool old_inside_battle = p_ptr->phase_out; for (i = 0; i < max_d_idx; i++) if (max_dl < max_dlv[i]) max_dl = max_dlv[i]; @@ -1480,9 +1480,9 @@ void update_gambling_monsters(void) while (1) { get_mon_num_prep(monster_can_entry_arena, NULL); - p_ptr->inside_battle = TRUE; + p_ptr->phase_out = TRUE; r_idx = get_mon_num(mon_level); - p_ptr->inside_battle = old_inside_battle; + p_ptr->phase_out = old_inside_battle; if (!r_idx) continue; if ((r_info[r_idx].flags1 & RF1_UNIQUE) || (r_info[r_idx].flags7 & RF7_UNIQUE2)) @@ -1661,10 +1661,10 @@ static bool kakutoujou(void) /* Save the surface floor as saved floor */ prepare_change_floor_mode(CFM_SAVE_FLOORS); - p_ptr->inside_battle = TRUE; + p_ptr->phase_out = TRUE; p_ptr->leaving = TRUE; - p_ptr->leave_bldg = TRUE; + screen_load(); return (TRUE); @@ -4125,13 +4125,13 @@ void do_cmd_bldg(void) return; } - else if (p_ptr->inside_battle) + else if (p_ptr->phase_out) { /* Don't save the arena as saved floor */ prepare_change_floor_mode(CFM_SAVE_FLOORS | CFM_NO_RETURN); p_ptr->leaving = TRUE; - p_ptr->inside_battle = FALSE; + p_ptr->phase_out = FALSE; /* Re-enter the monster arena */ command_new = SPECIAL_KEY_BUILDING; @@ -4175,7 +4175,7 @@ void do_cmd_bldg(void) { p_ptr->leave_bldg = TRUE; p_ptr->inside_arena = FALSE; - p_ptr->inside_battle = FALSE; + p_ptr->phase_out = FALSE; break; } @@ -4226,7 +4226,7 @@ void do_cmd_bldg(void) void determine_today_mon(bool conv_old) { int max_dl = 3, i; - bool old_inside_battle = p_ptr->inside_battle; + bool old_inside_battle = p_ptr->phase_out; monster_race *r_ptr; if (!conv_old) @@ -4239,7 +4239,7 @@ void determine_today_mon(bool conv_old) } else max_dl = MAX(max_dlv[DUNGEON_ANGBAND], 3); - p_ptr->inside_battle = TRUE; + p_ptr->phase_out = TRUE; get_mon_num_prep(NULL, NULL); while (1) @@ -4257,7 +4257,7 @@ void determine_today_mon(bool conv_old) } p_ptr->today_mon = 0; - p_ptr->inside_battle = old_inside_battle; + p_ptr->phase_out = old_inside_battle; } diff --git a/src/core.c b/src/core.c index 87c820314..b0507be7b 100644 --- a/src/core.c +++ b/src/core.c @@ -1265,7 +1265,7 @@ static object_type *choose_cursed_obj_name(BIT_FLAGS flag) static void process_world_aux_digestion(void) { - if (!p_ptr->inside_battle) + if (!p_ptr->phase_out) { /* Digest quickly when gorged */ if (p_ptr->food >= PY_FOOD_MAX) @@ -2149,7 +2149,7 @@ static void process_world_aux_mutation(void) if (!p_ptr->muta2) return; /* No effect on monster arena */ - if (p_ptr->inside_battle) return; + if (p_ptr->phase_out) return; /* No effect on the global map */ if (p_ptr->wild_mode) return; @@ -2593,7 +2593,7 @@ static void process_world_aux_mutation(void) */ static void process_world_aux_curse(void) { - if ((p_ptr->cursed & TRC_P_FLAG_MASK) && !p_ptr->inside_battle && !p_ptr->wild_mode) + if ((p_ptr->cursed & TRC_P_FLAG_MASK) && !p_ptr->phase_out && !p_ptr->wild_mode) { /* * Hack: Uncursed teleporting items (e.g. Trump Weapons) @@ -2938,7 +2938,7 @@ static void process_world_aux_movement(void) * The player is yanked up/down as soon as * he loads the autosaved game. */ - if (autosave_l && (p_ptr->word_recall == 1) && !p_ptr->inside_battle) + if (autosave_l && (p_ptr->word_recall == 1) && !p_ptr->phase_out) do_cmd_save_game(TRUE); /* Count down towards recall */ @@ -3052,7 +3052,7 @@ static void process_world_aux_movement(void) /* Delayed Alter reality */ if (p_ptr->alter_reality) { - if (autosave_l && (p_ptr->alter_reality == 1) && !p_ptr->inside_battle) + if (autosave_l && (p_ptr->alter_reality == 1) && !p_ptr->phase_out) do_cmd_save_game(TRUE); /* Count down towards alter */ @@ -3118,7 +3118,7 @@ static void process_world(void) } /*** Check monster arena ***/ - if (p_ptr->inside_battle && !p_ptr->leaving) + if (p_ptr->phase_out && !p_ptr->leaving) { int i2, j2; int win_m_idx = 0; @@ -3183,7 +3183,7 @@ static void process_world(void) if (current_world_ptr->game_turn % TURNS_PER_TICK) return; /*** Attempt timed autosave ***/ - if (autosave_t && autosave_freq && !p_ptr->inside_battle) + if (autosave_t && autosave_freq && !p_ptr->phase_out) { if (!(current_world_ptr->game_turn % ((s32b)autosave_freq * TURNS_PER_TICK))) do_cmd_save_game(TRUE); @@ -3197,7 +3197,7 @@ static void process_world(void) /*** Handle the wilderness/town (sunshine) ***/ /* While in town/wilderness */ - if (!current_floor_ptr->dun_level && !p_ptr->inside_quest && !p_ptr->inside_battle && !p_ptr->inside_arena) + if (!current_floor_ptr->dun_level && !p_ptr->inside_quest && !p_ptr->phase_out && !p_ptr->inside_arena) { /* Hack -- Daybreak/Nighfall in town */ if (!(current_world_ptr->game_turn % ((TURNS_PER_TICK * TOWN_DAWN) / 2))) @@ -3214,7 +3214,7 @@ static void process_world(void) } /* While in the dungeon (vanilla_town or lite_town mode only) */ - else if ((vanilla_town || (lite_town && !p_ptr->inside_quest && !p_ptr->inside_battle && !p_ptr->inside_arena)) && current_floor_ptr->dun_level) + else if ((vanilla_town || (lite_town && !p_ptr->inside_quest && !p_ptr->phase_out && !p_ptr->inside_arena)) && current_floor_ptr->dun_level) { /*** Shuffle the Storekeepers ***/ @@ -3265,14 +3265,14 @@ static void process_world(void) /* Check for creature generation. */ if (one_in_(d_info[p_ptr->dungeon_idx].max_m_alloc_chance) && - !p_ptr->inside_arena && !p_ptr->inside_quest && !p_ptr->inside_battle) + !p_ptr->inside_arena && !p_ptr->inside_quest && !p_ptr->phase_out) { /* Make a new monster */ (void)alloc_monster(MAX_SIGHT + 5, 0); } /* Hack -- Check for creature regeneration */ - if (!(current_world_ptr->game_turn % (TURNS_PER_TICK * 10)) && !p_ptr->inside_battle) regen_monsters(); + if (!(current_world_ptr->game_turn % (TURNS_PER_TICK * 10)) && !p_ptr->phase_out) regen_monsters(); if (!(current_world_ptr->game_turn % (TURNS_PER_TICK * 3))) regen_captured_monsters(); if (!p_ptr->leaving) @@ -4429,7 +4429,7 @@ static void process_player(void) p_ptr->invoking_midnight_curse = FALSE; } - if (p_ptr->inside_battle) + if (p_ptr->phase_out) { for(m_idx = 1; m_idx < current_floor_ptr->m_max; m_idx++) { @@ -4644,7 +4644,7 @@ static void process_player(void) /* Assume free current_world_ptr->game_turn */ free_turn(p_ptr); - if (p_ptr->inside_battle) + if (p_ptr->phase_out) { /* Place the cursor on the player */ move_cursor_relative(p_ptr->y, p_ptr->x); @@ -4997,7 +4997,7 @@ static void dungeon(bool load_game) !((quest_num == QUEST_OBERON) || (quest_num == QUEST_SERPENT) || !(quest[quest_num].flags & QUEST_FLAG_PRESET)))) do_cmd_feeling(); - if (p_ptr->inside_battle) + if (p_ptr->phase_out) { if (load_game) { @@ -5049,7 +5049,7 @@ static void dungeon(bool load_game) current_world_ptr->is_loading_now = TRUE; - if (p_ptr->energy_need > 0 && !p_ptr->inside_battle && + if (p_ptr->energy_need > 0 && !p_ptr->phase_out && (current_floor_ptr->dun_level || p_ptr->leaving_dungeon || p_ptr->inside_arena)) p_ptr->energy_need = 0; @@ -5063,10 +5063,10 @@ static void dungeon(bool load_game) while (TRUE) { /* Hack -- Compact the monster list occasionally */ - if ((current_floor_ptr->m_cnt + 32 > current_floor_ptr->max_m_idx) && !p_ptr->inside_battle) compact_monsters(64); + if ((current_floor_ptr->m_cnt + 32 > current_floor_ptr->max_m_idx) && !p_ptr->phase_out) compact_monsters(64); /* Hack -- Compress the monster list occasionally */ - if ((current_floor_ptr->m_cnt + 32 < current_floor_ptr->m_max) && !p_ptr->inside_battle) compact_monsters(0); + if ((current_floor_ptr->m_cnt + 32 < current_floor_ptr->m_max) && !p_ptr->phase_out) compact_monsters(0); /* Hack -- Compact the object list occasionally */ @@ -5396,7 +5396,7 @@ void play_game(bool new_game) current_floor_ptr->dun_level = 0; p_ptr->inside_quest = 0; p_ptr->inside_arena = FALSE; - p_ptr->inside_battle = FALSE; + p_ptr->phase_out = FALSE; write_level = TRUE; diff --git a/src/floor-events.c b/src/floor-events.c index 1be04fbfa..9eecdeb8b 100644 --- a/src/floor-events.c +++ b/src/floor-events.c @@ -283,7 +283,7 @@ void update_dungeon_feeling(void) if (!current_floor_ptr->dun_level) return; /* No feeling in the arena */ - if (p_ptr->inside_battle) return; + if (p_ptr->phase_out) return; /* Extract delay time */ delay = MAX(10, 150 - p_ptr->skill_fos) * (150 - current_floor_ptr->dun_level) * TURNS_PER_TICK / 100; @@ -1551,7 +1551,7 @@ void update_mon_lite(void) if (!rad) continue; else if (rad > 0) { - if (!(r_ptr->flags7 & (RF7_SELF_LITE_1 | RF7_SELF_LITE_2)) && (MON_CSLEEP(m_ptr) || (!current_floor_ptr->dun_level && is_daytime()) || p_ptr->inside_battle)) continue; + if (!(r_ptr->flags7 & (RF7_SELF_LITE_1 | RF7_SELF_LITE_2)) && (MON_CSLEEP(m_ptr) || (!current_floor_ptr->dun_level && is_daytime()) || p_ptr->phase_out)) continue; if (d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS) rad = 1; add_mon_lite = mon_lite_hack; f_flag = FF_LOS; diff --git a/src/floor-generate.c b/src/floor-generate.c index e458cd537..bcba35dff 100644 --- a/src/floor-generate.c +++ b/src/floor-generate.c @@ -1412,7 +1412,7 @@ void generate_random_floor(void) } /* Build the battle -KMW- */ - else if (p_ptr->inside_battle) + else if (p_ptr->phase_out) { /* Small arena */ generate_gambling_arena(); diff --git a/src/floor-save.c b/src/floor-save.c index 176f8046a..9d7b62124 100644 --- a/src/floor-save.c +++ b/src/floor-save.c @@ -420,7 +420,7 @@ static void preserve_pet(void) * If player is in wild mode, no pets are preserved * except a monster whom player riding */ - if (!p_ptr->wild_mode && !p_ptr->inside_arena && !p_ptr->inside_battle) + if (!p_ptr->wild_mode && !p_ptr->inside_arena && !p_ptr->phase_out) { for (i = current_floor_ptr->m_max - 1, num = 1; (i >= 1 && num < MAX_PARTY_MON); i--) { diff --git a/src/floor.h b/src/floor.h index dc31414be..0437c76be 100644 --- a/src/floor.h +++ b/src/floor.h @@ -340,7 +340,7 @@ typedef struct { * Note the use of comparison to zero to force a "boolean" result */ #define player_has_los_bold(Y,X) \ - (((current_floor_ptr->grid_array[Y][X].info & (CAVE_VIEW)) != 0) || p_ptr->inside_battle) + (((current_floor_ptr->grid_array[Y][X].info & (CAVE_VIEW)) != 0) || p_ptr->phase_out) /* diff --git a/src/gamevalue.h b/src/gamevalue.h index b6c000d7c..cc7d8f609 100644 --- a/src/gamevalue.h +++ b/src/gamevalue.h @@ -33,7 +33,7 @@ * More maximum values */ #define MAX_SIGHT 20 /*!< プレイヤーの最大視界範囲(マス) / Maximum view distance */ -#define MAX_RANGE (p_ptr->inside_battle ? 36 : 18) /*!< プレイヤーの攻撃射程(マス) / Maximum range (spells, etc) */ +#define MAX_RANGE (p_ptr->phase_out ? 36 : 18) /*!< プレイヤーの攻撃射程(マス) / Maximum range (spells, etc) */ #define AAF_LIMIT 100 /*!< モンスターの限界感知範囲(マス) Limit of sensing radius */ #define MIN_M_ALLOC_TD 4 /*!< 街(昼間)の最低住人配置数 / The town starts out with 4 residents during the day */ diff --git a/src/geometry.h b/src/geometry.h index ad126b4ee..354d2f61e 100644 --- a/src/geometry.h +++ b/src/geometry.h @@ -83,6 +83,6 @@ struct coord * Is the monster seen by the player? */ #define is_seen(A) \ - ((bool)((A)->ml && (!ignore_unview || p_ptr->inside_battle || \ + ((bool)((A)->ml && (!ignore_unview || p_ptr->phase_out || \ (player_can_see_bold((A)->fy, (A)->fx) && projectable(p_ptr->y, p_ptr->x, (A)->fy, (A)->fx))))) diff --git a/src/load.c b/src/load.c index 7f9baa6c5..7c841cab0 100644 --- a/src/load.c +++ b/src/load.c @@ -1967,11 +1967,11 @@ static void rd_extra(void) rd_s16b(&tmp16s); p_ptr->inside_arena = (bool)tmp16s; rd_s16b(&p_ptr->inside_quest); - if (z_older_than(10, 3, 5)) p_ptr->inside_battle = FALSE; + if (z_older_than(10, 3, 5)) p_ptr->phase_out = FALSE; else { rd_s16b(&tmp16s); - p_ptr->inside_battle = (bool)tmp16s; + p_ptr->phase_out = (bool)tmp16s; } rd_byte(&p_ptr->exit_bldg); rd_byte(&tmp8u); diff --git a/src/melee1.c b/src/melee1.c index 6ffc91db5..1f0dcf58d 100644 --- a/src/melee1.c +++ b/src/melee1.c @@ -4813,7 +4813,7 @@ void mon_take_hit_mon(MONSTER_IDX m_idx, HIT_POINT dam, bool *dead, bool *fear, { if (((r_ptr->flags1 & (RF1_UNIQUE | RF1_QUESTOR)) || (r_ptr->flags7 & RF7_NAZGUL)) && - !p_ptr->inside_battle) + !p_ptr->phase_out) { m_ptr->hp = 1; } diff --git a/src/monster-process.c b/src/monster-process.c index 42e65d779..eeb1297b2 100644 --- a/src/monster-process.c +++ b/src/monster-process.c @@ -72,7 +72,7 @@ static bool get_enemy_dir(MONSTER_IDX m_idx, int *mm) } else { - if (p_ptr->inside_battle) + if (p_ptr->phase_out) { start = randint1(current_floor_ptr->m_max-1)+current_floor_ptr->m_max; if(randint0(2)) plus = -1; @@ -1370,7 +1370,7 @@ void process_monster(MONSTER_IDX m_idx) if(dead) return; } - if ((is_pet(m_ptr) || is_friendly(m_ptr)) && ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_NAZGUL)) && !p_ptr->inside_battle) + if ((is_pet(m_ptr) || is_friendly(m_ptr)) && ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_NAZGUL)) && !p_ptr->phase_out) { static int riding_pinch = 0; @@ -1471,7 +1471,7 @@ void process_monster(MONSTER_IDX m_idx) gets_angry = TRUE; } - if (p_ptr->inside_battle) gets_angry = FALSE; + if (p_ptr->phase_out) gets_angry = FALSE; if (gets_angry) { @@ -1532,7 +1532,7 @@ void process_monster(MONSTER_IDX m_idx) /* Hack -- Ohmu scatters molds! */ if (m_ptr->r_idx == MON_OHMU) { - if (!p_ptr->inside_arena && !p_ptr->inside_battle) + if (!p_ptr->inside_arena && !p_ptr->phase_out) { if (r_ptr->freq_spell && (randint1(100) <= r_ptr->freq_spell)) { @@ -1554,7 +1554,7 @@ void process_monster(MONSTER_IDX m_idx) } } - if (!p_ptr->inside_battle) + if (!p_ptr->phase_out) { /* Hack! "Cyber" monster makes noise... */ if (m_ptr->ap_r_idx == MON_CYBER && @@ -2373,7 +2373,7 @@ void process_monster(MONSTER_IDX m_idx) /* Notice changes in view */ if (do_move && ((r_ptr->flags7 & (RF7_SELF_LD_MASK | RF7_HAS_DARK_1 | RF7_HAS_DARK_2)) - || ((r_ptr->flags7 & (RF7_HAS_LITE_1 | RF7_HAS_LITE_2)) && !p_ptr->inside_battle))) + || ((r_ptr->flags7 & (RF7_HAS_LITE_1 | RF7_HAS_LITE_2)) && !p_ptr->phase_out))) { p_ptr->update |= (PU_MON_LITE); } @@ -2568,7 +2568,7 @@ void process_monsters(void) } /* Handle "sight" and "aggravation" */ - else if ((m_ptr->cdis <= MAX_SIGHT || p_ptr->inside_battle) && + else if ((m_ptr->cdis <= MAX_SIGHT || p_ptr->phase_out) && (player_has_los_bold(fy, fx) || (p_ptr->cursed & TRC_AGGRAVATE))) { /* We can "see" or "feel" the player */ diff --git a/src/monster-status.c b/src/monster-status.c index 0de17011d..d7a172f0d 100644 --- a/src/monster-status.c +++ b/src/monster-status.c @@ -120,7 +120,7 @@ static void get_exp_from_mon(HIT_POINT dam, monster_type *m_ptr) u32b div_l; if (!monster_is_valid(m_ptr)) return; - if (is_pet(m_ptr) || p_ptr->inside_battle) return; + if (is_pet(m_ptr) || p_ptr->phase_out) return; /* * - Ratio of monster's level to player's level effects @@ -887,7 +887,7 @@ void monster_gain_exp(MONSTER_IDX m_idx, MONRACE_IDX s_idx) r_ptr = &r_info[m_ptr->r_idx]; s_ptr = &r_info[s_idx]; - if (p_ptr->inside_battle) return; + if (p_ptr->phase_out) return; if (!r_ptr->next_exp) return; @@ -1352,7 +1352,7 @@ bool mon_take_hit(MONSTER_IDX m_idx, HIT_POINT dam, bool *fear, concptr note) monster_death(m_idx, TRUE); /* Mega hack : replace IKETA to BIKETAL */ - if ((m_ptr->r_idx == MON_IKETA) && !(p_ptr->inside_arena || p_ptr->inside_battle)) + if ((m_ptr->r_idx == MON_IKETA) && !(p_ptr->inside_arena || p_ptr->phase_out)) { POSITION dummy_y = m_ptr->fy; POSITION dummy_x = m_ptr->fx; diff --git a/src/monster1.c b/src/monster1.c index bdf977753..784f51c59 100644 --- a/src/monster1.c +++ b/src/monster1.c @@ -2234,7 +2234,7 @@ void set_pet(monster_type *m_ptr) */ void set_hostile(monster_type *m_ptr) { - if (p_ptr->inside_battle) return; + if (p_ptr->phase_out) return; m_ptr->smart &= ~SM_PET; m_ptr->smart &= ~SM_FRIENDLY; } @@ -2248,7 +2248,7 @@ void set_hostile(monster_type *m_ptr) */ void anger_monster(monster_type *m_ptr) { - if (p_ptr->inside_battle) return; + if (p_ptr->phase_out) return; if (is_friendly(m_ptr)) { GAME_TEXT m_name[MAX_NLEN]; @@ -2407,7 +2407,7 @@ bool are_enemies(monster_type *m_ptr, monster_type *n_ptr) monster_race *r_ptr = &r_info[m_ptr->r_idx]; monster_race *s_ptr = &r_info[n_ptr->r_idx]; - if (p_ptr->inside_battle) + if (p_ptr->phase_out) { if (is_pet(m_ptr) || is_pet(n_ptr)) return FALSE; return TRUE; @@ -2541,7 +2541,7 @@ void monster_death(MONSTER_IDX m_idx, bool drop_item) object_type *q_ptr; bool drop_chosen_item = drop_item && !cloned && !p_ptr->inside_arena - && !p_ptr->inside_battle && !is_pet(m_ptr); + && !p_ptr->phase_out && !is_pet(m_ptr); /* The caster is dead? */ if (current_world_ptr->timewalk_m_idx && current_world_ptr->timewalk_m_idx == m_idx) current_world_ptr->timewalk_m_idx = 0; @@ -2634,7 +2634,7 @@ void monster_death(MONSTER_IDX m_idx, bool drop_item) /* Drop a dead corpse? */ if (one_in_(r_ptr->flags1 & RF1_UNIQUE ? 1 : 4) && (r_ptr->flags9 & (RF9_DROP_CORPSE | RF9_DROP_SKELETON)) && - !(p_ptr->inside_arena || p_ptr->inside_battle || cloned || ((m_ptr->r_idx == today_mon) && is_pet(m_ptr)))) + !(p_ptr->inside_arena || p_ptr->phase_out || cloned || ((m_ptr->r_idx == today_mon) && is_pet(m_ptr)))) { /* Assume skeleton */ bool corpse = FALSE; @@ -2682,7 +2682,7 @@ void monster_death(MONSTER_IDX m_idx, bool drop_item) { case MON_PINK_HORROR: /* Pink horrors are replaced with 2 Blue horrors */ - if (!(p_ptr->inside_arena || p_ptr->inside_battle)) + if (!(p_ptr->inside_arena || p_ptr->phase_out)) { bool notice = FALSE; @@ -2741,7 +2741,7 @@ void monster_death(MONSTER_IDX m_idx, bool drop_item) * Mega^3-hack: killing a 'Warrior of the Dawn' is likely to * spawn another in the fallen one's place! */ - if (!p_ptr->inside_arena && !p_ptr->inside_battle) + if (!p_ptr->inside_arena && !p_ptr->phase_out) { if (!one_in_(7)) { @@ -3040,7 +3040,7 @@ void monster_death(MONSTER_IDX m_idx, bool drop_item) if (cloned && !(r_ptr->flags1 & RF1_UNIQUE)) number = 0; /* Clones drop no stuff unless Cloning Pits */ - if (is_pet(m_ptr) || p_ptr->inside_battle || p_ptr->inside_arena) + if (is_pet(m_ptr) || p_ptr->phase_out || p_ptr->inside_arena) number = 0; /* Pets drop no stuff */ if (!drop_item && (r_ptr->d_char != '$')) number = 0; @@ -3088,7 +3088,7 @@ void monster_death(MONSTER_IDX m_idx, bool drop_item) /* Only process "Quest Monsters" */ if (!(r_ptr->flags1 & RF1_QUESTOR)) return; - if (p_ptr->inside_battle) return; + if (p_ptr->phase_out) return; /* Winner? */ if ((m_ptr->r_idx == MON_SERPENT) && !cloned) diff --git a/src/monster2.c b/src/monster2.c index fa82f4af7..96b0dfde6 100644 --- a/src/monster2.c +++ b/src/monster2.c @@ -1063,7 +1063,7 @@ errr get_mon_num_prep(monsterrace_hook_type monster_hook, (get_mon_num2_hook && !((*get_mon_num2_hook)(entry->index)))) continue; - if (!p_ptr->inside_battle && !chameleon_change_m_idx && + if (!p_ptr->phase_out && !chameleon_change_m_idx && summon_specific_type != SUMMON_GUARDIANS) { /* Hack -- don't create questors */ @@ -1083,7 +1083,7 @@ errr get_mon_num_prep(monsterrace_hook_type monster_hook, entry->prob2 = entry->prob1; if (current_floor_ptr->dun_level && (!p_ptr->inside_quest || is_fixed_quest_idx(p_ptr->inside_quest)) && - !restrict_monster_to_dungeon(p_ptr->dungeon_idx, entry->index) && !p_ptr->inside_battle) + !restrict_monster_to_dungeon(p_ptr->dungeon_idx, entry->index) && !p_ptr->phase_out) { int hoge = entry->prob2 * d_info[p_ptr->dungeon_idx].special_div; entry->prob2 = hoge / 64; @@ -1145,7 +1145,7 @@ MONRACE_IDX get_mon_num(DEPTH level) } /* Boost the level */ - if (!p_ptr->inside_battle && !(d_info[p_ptr->dungeon_idx].flags1 & DF1_BEGINNER)) + if (!p_ptr->phase_out && !(d_info[p_ptr->dungeon_idx].flags1 & DF1_BEGINNER)) { /* Nightmare mode allows more out-of depth monsters */ if (ironman_nightmare && !randint0(pls_kakuritu)) @@ -1185,7 +1185,7 @@ MONRACE_IDX get_mon_num(DEPTH level) /* Access the actual race */ r_ptr = &r_info[r_idx]; - if (!p_ptr->inside_battle && !chameleon_change_m_idx) + if (!p_ptr->phase_out && !chameleon_change_m_idx) { /* Hack -- "unique" monsters must be "unique" */ if (((r_ptr->flags1 & (RF1_UNIQUE)) || @@ -1535,7 +1535,7 @@ void monster_desc(char *desc, monster_type *m_ptr, BIT_FLAGS mode) } /* Inside monster arena, and it is not your mount */ - else if (p_ptr->inside_battle && + else if (p_ptr->phase_out && !(p_ptr->riding && (¤t_floor_ptr->m_list[p_ptr->riding] == m_ptr))) { /* It is a fake unique monster */ @@ -2534,7 +2534,7 @@ static bool place_monster_one(MONSTER_IDX who, POSITION y, POSITION x, MONRACE_I if (!monster_can_enter(y, x, r_ptr, 0)) return FALSE; } - if (!p_ptr->inside_battle) + if (!p_ptr->phase_out) { /* Hack -- "unique" monsters must be "unique" */ if (((r_ptr->flags1 & (RF1_UNIQUE)) || diff --git a/src/mspells1.c b/src/mspells1.c index 62158ee66..5a776cb52 100644 --- a/src/mspells1.c +++ b/src/mspells1.c @@ -811,7 +811,7 @@ static bool spell_world(byte spell) */ static bool spell_special(byte spell) { - if (p_ptr->inside_battle) return FALSE; + if (p_ptr->phase_out) return FALSE; if (spell == 160 + 7) return (TRUE); return (FALSE); } @@ -1577,7 +1577,7 @@ bool make_attack_spell(MONSTER_IDX m_idx) /* Remove the "ineffective" spells */ remove_bad_spells(m_idx, &f4, &f5, &f6); - if (p_ptr->inside_arena || p_ptr->inside_battle) + if (p_ptr->inside_arena || p_ptr->phase_out) { f4 &= ~(RF4_SUMMON_MASK); f5 &= ~(RF5_SUMMON_MASK); diff --git a/src/mspells2.c b/src/mspells2.c index ee2e654e9..b2ffc1841 100644 --- a/src/mspells2.c +++ b/src/mspells2.c @@ -354,7 +354,7 @@ bool monst_spell_monst(MONSTER_IDX m_idx) { bool success = FALSE; - if (p_ptr->inside_battle) + if (p_ptr->phase_out) { start = randint1(current_floor_ptr->m_max-1) + current_floor_ptr->m_max; if (randint0(2)) plus = -1; @@ -434,7 +434,7 @@ bool monst_spell_monst(MONSTER_IDX m_idx) f6 &= (RF6_NOMAGIC_MASK); } - if (p_ptr->inside_arena || p_ptr->inside_battle) + if (p_ptr->inside_arena || p_ptr->phase_out) { f4 &= ~(RF4_SUMMON_MASK); f5 &= ~(RF5_SUMMON_MASK); @@ -443,7 +443,7 @@ bool monst_spell_monst(MONSTER_IDX m_idx) if (m_ptr->r_idx == MON_ROLENTO) f6 &= ~(RF6_SPECIAL); } - if (p_ptr->inside_battle && !one_in_(3)) + if (p_ptr->phase_out && !one_in_(3)) { f6 &= ~(RF6_HEAL); } diff --git a/src/mspells4.c b/src/mspells4.c index c2759820a..4a597ae96 100644 --- a/src/mspells4.c +++ b/src/mspells4.c @@ -1947,7 +1947,7 @@ HIT_POINT spell_RF6_SPECIAL_BANORLUPART(MONSTER_IDX m_idx) dummy_hp = (m_ptr->hp + 1) / 2; dummy_maxhp = m_ptr->maxhp / 2; - if (p_ptr->inside_arena || p_ptr->inside_battle || !summon_possible(m_ptr->fy, m_ptr->fx)) + if (p_ptr->inside_arena || p_ptr->phase_out || !summon_possible(m_ptr->fy, m_ptr->fx)) return -1; delete_monster_idx(current_floor_ptr->grid_array[m_ptr->fy][m_ptr->fx].m_idx); diff --git a/src/player-status.c b/src/player-status.c index 893c4866f..522b0bca9 100644 --- a/src/player-status.c +++ b/src/player-status.c @@ -5205,7 +5205,7 @@ void sanity_blast(monster_type *m_ptr, bool necro) { int power = 100; - if (p_ptr->inside_battle || !current_world_ptr->character_dungeon) return; + if (p_ptr->phase_out || !current_world_ptr->character_dungeon) return; if (!necro && m_ptr) { @@ -5847,7 +5847,7 @@ void cheat_death(player_type *creature_ptr) current_floor_ptr->dun_level = 0; creature_ptr->inside_arena = FALSE; - creature_ptr->inside_battle = FALSE; + creature_ptr->phase_out = FALSE; leaving_quest = 0; creature_ptr->inside_quest = 0; if (p_ptr->dungeon_idx) creature_ptr->recall_dungeon = p_ptr->dungeon_idx; diff --git a/src/player-status.h b/src/player-status.h index 9eb7cee6e..6c9135ef4 100644 --- a/src/player-status.h +++ b/src/player-status.h @@ -121,7 +121,7 @@ struct player_type s16b arena_number; /* monster number in arena -KMW- */ bool inside_arena; /* Is character inside arena? */ QUEST_IDX inside_quest; /* Inside quest level */ - bool inside_battle; /* Is character inside tougijou? */ + bool phase_out; /*!< フェイズアウト状態(闘技場観戦状態などに利用、NPCの処理の対象にならず自身もほとんどの行動ができない) */ DUNGEON_IDX dungeon_idx; /* current dungeon index */ POSITION wilderness_x; /* Coordinates in the wilderness */ diff --git a/src/save.c b/src/save.c index fc3b73341..e7d39b910 100644 --- a/src/save.c +++ b/src/save.c @@ -697,7 +697,7 @@ static void wr_extra(void) wr_s16b(p_ptr->arena_number); wr_s16b(p_ptr->inside_arena); wr_s16b(p_ptr->inside_quest); - wr_s16b(p_ptr->inside_battle); + wr_s16b(p_ptr->phase_out); wr_byte(p_ptr->exit_bldg); wr_byte(0); /* Unused */ diff --git a/src/spells-floor.c b/src/spells-floor.c index 181642840..1f36a9bb9 100644 --- a/src/spells-floor.c +++ b/src/spells-floor.c @@ -282,7 +282,7 @@ void stair_creation(void) /* No effect out of standard dungeon floor */ if (!current_floor_ptr->dun_level || (!up && !down) || (p_ptr->inside_quest && is_fixed_quest_idx(p_ptr->inside_quest)) || - p_ptr->inside_arena || p_ptr->inside_battle) + p_ptr->inside_arena || p_ptr->phase_out) { /* arena or quest */ msg_print(_("効果がありません!", "There is no effect!")); diff --git a/src/spells.h b/src/spells.h index 841ebd63a..ea67f941d 100644 --- a/src/spells.h +++ b/src/spells.h @@ -341,7 +341,7 @@ extern bool tele_town(void); /* Is "teleport level" ineffective to this target? */ #define TELE_LEVEL_IS_INEFF(TARGET) \ - (p_ptr->inside_arena || p_ptr->inside_battle || \ + (p_ptr->inside_arena || p_ptr->phase_out || \ (p_ptr->inside_quest && !random_quest_number(current_floor_ptr->dun_level)) || \ (((TARGET) <= 0) && (quest_number(current_floor_ptr->dun_level) || (current_floor_ptr->dun_level >= d_info[p_ptr->dungeon_idx].maxdepth)) && \ (current_floor_ptr->dun_level >= 1) && ironman_downward)) diff --git a/src/spells1.c b/src/spells1.c index a8a8a7698..fbe853a88 100644 --- a/src/spells1.c +++ b/src/spells1.c @@ -597,7 +597,7 @@ static bool project_f(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_P case GF_DARK_WEAK: case GF_DARK: { - bool do_dark = !p_ptr->inside_battle && !is_mirror_grid(g_ptr); + bool do_dark = !p_ptr->phase_out && !is_mirror_grid(g_ptr); int j; /* Turn off the light. */ @@ -1154,7 +1154,7 @@ static bool project_m(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_P bool obvious = FALSE; /* Can the player know about this effect? */ - bool known = ((m_ptr->cdis <= MAX_SIGHT) || p_ptr->inside_battle); + bool known = ((m_ptr->cdis <= MAX_SIGHT) || p_ptr->phase_out); /* Were the effects "irrelevant"? */ bool skipped = FALSE; @@ -3613,7 +3613,7 @@ static bool project_m(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_P if (p_ptr->riding && (g_ptr->m_idx == p_ptr->riding)) do_poly = FALSE; /* "Unique" and "quest" monsters can only be "killed" by the player. */ - if (((r_ptr->flags1 & (RF1_UNIQUE | RF1_QUESTOR)) || (r_ptr->flags7 & RF7_NAZGUL)) && !p_ptr->inside_battle) + if (((r_ptr->flags1 & (RF1_UNIQUE | RF1_QUESTOR)) || (r_ptr->flags7 & RF7_NAZGUL)) && !p_ptr->phase_out) { if (who && (dam > m_ptr->hp)) dam = m_ptr->hp; } @@ -3901,7 +3901,7 @@ static bool project_m(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_P blood_curse_to_enemy(who); } - if (p_ptr->inside_battle) + if (p_ptr->phase_out) { p_ptr->health_who = g_ptr->m_idx; p_ptr->redraw |= (PR_HEALTH); diff --git a/src/spells2.c b/src/spells2.c index 82296d187..52465c707 100644 --- a/src/spells2.c +++ b/src/spells2.c @@ -1033,7 +1033,7 @@ bool genocide_aux(MONSTER_IDX m_idx, int power, bool player_cast, int dam_side, 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(current_floor_ptr->dun_level)) || p_ptr->inside_arena || p_ptr->inside_battle) resist = TRUE; + else if ((p_ptr->inside_quest && !random_quest_number(current_floor_ptr->dun_level)) || p_ptr->inside_arena || p_ptr->phase_out) resist = TRUE; else if (player_cast && (r_ptr->level > randint0(power))) resist = TRUE; else if (player_cast && (m_ptr->mflag2 & MFLAG2_NOGENO)) resist = TRUE; @@ -1112,7 +1112,7 @@ bool symbol_genocide(int power, bool player_cast) bool result = FALSE; /* Prevent genocide in quest levels */ - if ((p_ptr->inside_quest && !random_quest_number(current_floor_ptr->dun_level)) || p_ptr->inside_arena || p_ptr->inside_battle) + if ((p_ptr->inside_quest && !random_quest_number(current_floor_ptr->dun_level)) || p_ptr->inside_arena || p_ptr->phase_out) { msg_print(_("何も起きないようだ……", "It seems nothing happen here...")); return (FALSE); @@ -1156,7 +1156,7 @@ bool mass_genocide(int power, bool player_cast) bool result = FALSE; /* Prevent mass genocide in quest levels */ - if ((p_ptr->inside_quest && !random_quest_number(current_floor_ptr->dun_level)) || p_ptr->inside_arena || p_ptr->inside_battle) + if ((p_ptr->inside_quest && !random_quest_number(current_floor_ptr->dun_level)) || p_ptr->inside_arena || p_ptr->phase_out) { return (FALSE); } @@ -1196,7 +1196,7 @@ bool mass_genocide_undead(int power, bool player_cast) bool result = FALSE; /* Prevent mass genocide in quest levels */ - if ((p_ptr->inside_quest && !random_quest_number(current_floor_ptr->dun_level)) || p_ptr->inside_arena || p_ptr->inside_battle) + if ((p_ptr->inside_quest && !random_quest_number(current_floor_ptr->dun_level)) || p_ptr->inside_arena || p_ptr->phase_out) { return (FALSE); } @@ -4401,7 +4401,7 @@ bool rodeo(player_type *creature_ptr) if (r_ptr->flags1 & RF1_UNIQUE) rlev = rlev * 3 / 2; if (rlev > 60) rlev = 60 + (rlev - 60) / 2; if ((randint1(creature_ptr->skill_exp[GINOU_RIDING] / 120 + creature_ptr->lev * 2 / 3) > rlev) - && one_in_(2) && !creature_ptr->inside_arena && !creature_ptr->inside_battle + && one_in_(2) && !creature_ptr->inside_arena && !creature_ptr->phase_out && !(r_ptr->flags7 & (RF7_GUARDIAN)) && !(r_ptr->flags1 & (RF1_QUESTOR)) && (rlev < creature_ptr->lev * 3 / 2 + randint0(creature_ptr->lev / 5))) { diff --git a/src/spells3.c b/src/spells3.c index de7703573..5fa7de65d 100644 --- a/src/spells3.c +++ b/src/spells3.c @@ -541,7 +541,7 @@ void teleport_away_followable(MONSTER_IDX m_idx) teleport_away(m_idx, MAX_SIGHT * 2 + 5, 0L); - if (old_ml && (old_cdis <= MAX_SIGHT) && !current_world_ptr->timewalk_m_idx && !p_ptr->inside_battle && los(p_ptr->y, p_ptr->x, oldfy, oldfx)) + if (old_ml && (old_cdis <= MAX_SIGHT) && !current_world_ptr->timewalk_m_idx && !p_ptr->phase_out && los(p_ptr->y, p_ptr->x, oldfy, oldfx)) { bool follow = FALSE; @@ -3213,7 +3213,7 @@ bool polymorph_monster(POSITION y, POSITION x) bool health_tracked = (p_ptr->health_who == g_ptr->m_idx) ? TRUE : FALSE; monster_type back_m; - if (p_ptr->inside_arena || p_ptr->inside_battle) return (FALSE); + if (p_ptr->inside_arena || p_ptr->phase_out) return (FALSE); if ((p_ptr->riding == g_ptr->m_idx) || (m_ptr->mflag2 & MFLAG2_KAGE)) return (FALSE); @@ -3968,7 +3968,7 @@ bool tele_town(void) return FALSE; } - if (p_ptr->inside_arena || p_ptr->inside_battle) + if (p_ptr->inside_arena || p_ptr->phase_out) { msg_print(_("この魔法は外でしか使えない!", "This spell can only be used outside!")); return FALSE; diff --git a/src/util.c b/src/util.c index 75da14cf0..915e74aad 100644 --- a/src/util.c +++ b/src/util.c @@ -1824,7 +1824,7 @@ void select_floor_music(void) return; } - if(p_ptr->inside_battle) + if(p_ptr->phase_out) { play_music(TERM_XTRA_MUSIC_BASIC, MUSIC_BASIC_BATTLE); return; diff --git a/src/view-mainwindow.c b/src/view-mainwindow.c index ebee239a5..95b6e496b 100644 --- a/src/view-mainwindow.c +++ b/src/view-mainwindow.c @@ -196,7 +196,7 @@ concptr map_name(void) return _("地上", "Surface"); else if (p_ptr->inside_arena) return _("アリーナ", "Arena"); - else if (p_ptr->inside_battle) + else if (p_ptr->phase_out) return _("闘技場", "Monster Arena"); else if (!current_floor_ptr->dun_level && p_ptr->town_num) return town_info[p_ptr->town_num].name; @@ -1393,7 +1393,7 @@ static void health_redraw(bool riding) m_ptr = ¤t_floor_ptr->m_list[health_who]; - if (p_ptr->wizard && p_ptr->inside_battle) + if (p_ptr->wizard && p_ptr->phase_out) { row = ROW_INFO - 2; col = COL_INFO + 2; -- 2.11.0