• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

変愚蛮怒のメインリポジトリです


Commit MetaInfo

Revision1a1d4a7c901ab6dea8f96ea05e8d102504313e08 (tree)
Time2019-06-17 23:48:35
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

[Refactor] #37353 player_type の 闘技場観戦モードフラグ名を inside_arena から phase_out に改名。 (効果としては MtG の同名の効果に近いと判断。今後別の応用を考える)

Change Summary

Incremental Difference

--- a/src/bldg.c
+++ b/src/bldg.c
@@ -1452,7 +1452,7 @@ void update_gambling_monsters(void)
14521452 int mon_level;
14531453 int power[4];
14541454 bool tekitou;
1455- bool old_inside_battle = p_ptr->inside_battle;
1455+ bool old_inside_battle = p_ptr->phase_out;
14561456
14571457 for (i = 0; i < max_d_idx; i++)
14581458 if (max_dl < max_dlv[i]) max_dl = max_dlv[i];
@@ -1480,9 +1480,9 @@ void update_gambling_monsters(void)
14801480 while (1)
14811481 {
14821482 get_mon_num_prep(monster_can_entry_arena, NULL);
1483- p_ptr->inside_battle = TRUE;
1483+ p_ptr->phase_out = TRUE;
14841484 r_idx = get_mon_num(mon_level);
1485- p_ptr->inside_battle = old_inside_battle;
1485+ p_ptr->phase_out = old_inside_battle;
14861486 if (!r_idx) continue;
14871487
14881488 if ((r_info[r_idx].flags1 & RF1_UNIQUE) || (r_info[r_idx].flags7 & RF7_UNIQUE2))
@@ -1661,10 +1661,10 @@ static bool kakutoujou(void)
16611661 /* Save the surface floor as saved floor */
16621662 prepare_change_floor_mode(CFM_SAVE_FLOORS);
16631663
1664- p_ptr->inside_battle = TRUE;
1664+ p_ptr->phase_out = TRUE;
16651665 p_ptr->leaving = TRUE;
1666-
16671666 p_ptr->leave_bldg = TRUE;
1667+
16681668 screen_load();
16691669
16701670 return (TRUE);
@@ -4125,13 +4125,13 @@ void do_cmd_bldg(void)
41254125
41264126 return;
41274127 }
4128- else if (p_ptr->inside_battle)
4128+ else if (p_ptr->phase_out)
41294129 {
41304130 /* Don't save the arena as saved floor */
41314131 prepare_change_floor_mode(CFM_SAVE_FLOORS | CFM_NO_RETURN);
41324132
41334133 p_ptr->leaving = TRUE;
4134- p_ptr->inside_battle = FALSE;
4134+ p_ptr->phase_out = FALSE;
41354135
41364136 /* Re-enter the monster arena */
41374137 command_new = SPECIAL_KEY_BUILDING;
@@ -4175,7 +4175,7 @@ void do_cmd_bldg(void)
41754175 {
41764176 p_ptr->leave_bldg = TRUE;
41774177 p_ptr->inside_arena = FALSE;
4178- p_ptr->inside_battle = FALSE;
4178+ p_ptr->phase_out = FALSE;
41794179 break;
41804180 }
41814181
@@ -4226,7 +4226,7 @@ void do_cmd_bldg(void)
42264226 void determine_today_mon(bool conv_old)
42274227 {
42284228 int max_dl = 3, i;
4229- bool old_inside_battle = p_ptr->inside_battle;
4229+ bool old_inside_battle = p_ptr->phase_out;
42304230 monster_race *r_ptr;
42314231
42324232 if (!conv_old)
@@ -4239,7 +4239,7 @@ void determine_today_mon(bool conv_old)
42394239 }
42404240 else max_dl = MAX(max_dlv[DUNGEON_ANGBAND], 3);
42414241
4242- p_ptr->inside_battle = TRUE;
4242+ p_ptr->phase_out = TRUE;
42434243 get_mon_num_prep(NULL, NULL);
42444244
42454245 while (1)
@@ -4257,7 +4257,7 @@ void determine_today_mon(bool conv_old)
42574257 }
42584258
42594259 p_ptr->today_mon = 0;
4260- p_ptr->inside_battle = old_inside_battle;
4260+ p_ptr->phase_out = old_inside_battle;
42614261 }
42624262
42634263
--- a/src/core.c
+++ b/src/core.c
@@ -1265,7 +1265,7 @@ static object_type *choose_cursed_obj_name(BIT_FLAGS flag)
12651265
12661266 static void process_world_aux_digestion(void)
12671267 {
1268- if (!p_ptr->inside_battle)
1268+ if (!p_ptr->phase_out)
12691269 {
12701270 /* Digest quickly when gorged */
12711271 if (p_ptr->food >= PY_FOOD_MAX)
@@ -2149,7 +2149,7 @@ static void process_world_aux_mutation(void)
21492149 if (!p_ptr->muta2) return;
21502150
21512151 /* No effect on monster arena */
2152- if (p_ptr->inside_battle) return;
2152+ if (p_ptr->phase_out) return;
21532153
21542154 /* No effect on the global map */
21552155 if (p_ptr->wild_mode) return;
@@ -2593,7 +2593,7 @@ static void process_world_aux_mutation(void)
25932593 */
25942594 static void process_world_aux_curse(void)
25952595 {
2596- if ((p_ptr->cursed & TRC_P_FLAG_MASK) && !p_ptr->inside_battle && !p_ptr->wild_mode)
2596+ if ((p_ptr->cursed & TRC_P_FLAG_MASK) && !p_ptr->phase_out && !p_ptr->wild_mode)
25972597 {
25982598 /*
25992599 * Hack: Uncursed teleporting items (e.g. Trump Weapons)
@@ -2938,7 +2938,7 @@ static void process_world_aux_movement(void)
29382938 * The player is yanked up/down as soon as
29392939 * he loads the autosaved game.
29402940 */
2941- if (autosave_l && (p_ptr->word_recall == 1) && !p_ptr->inside_battle)
2941+ if (autosave_l && (p_ptr->word_recall == 1) && !p_ptr->phase_out)
29422942 do_cmd_save_game(TRUE);
29432943
29442944 /* Count down towards recall */
@@ -3052,7 +3052,7 @@ static void process_world_aux_movement(void)
30523052 /* Delayed Alter reality */
30533053 if (p_ptr->alter_reality)
30543054 {
3055- if (autosave_l && (p_ptr->alter_reality == 1) && !p_ptr->inside_battle)
3055+ if (autosave_l && (p_ptr->alter_reality == 1) && !p_ptr->phase_out)
30563056 do_cmd_save_game(TRUE);
30573057
30583058 /* Count down towards alter */
@@ -3118,7 +3118,7 @@ static void process_world(void)
31183118 }
31193119
31203120 /*** Check monster arena ***/
3121- if (p_ptr->inside_battle && !p_ptr->leaving)
3121+ if (p_ptr->phase_out && !p_ptr->leaving)
31223122 {
31233123 int i2, j2;
31243124 int win_m_idx = 0;
@@ -3183,7 +3183,7 @@ static void process_world(void)
31833183 if (current_world_ptr->game_turn % TURNS_PER_TICK) return;
31843184
31853185 /*** Attempt timed autosave ***/
3186- if (autosave_t && autosave_freq && !p_ptr->inside_battle)
3186+ if (autosave_t && autosave_freq && !p_ptr->phase_out)
31873187 {
31883188 if (!(current_world_ptr->game_turn % ((s32b)autosave_freq * TURNS_PER_TICK)))
31893189 do_cmd_save_game(TRUE);
@@ -3197,7 +3197,7 @@ static void process_world(void)
31973197 /*** Handle the wilderness/town (sunshine) ***/
31983198
31993199 /* While in town/wilderness */
3200- if (!current_floor_ptr->dun_level && !p_ptr->inside_quest && !p_ptr->inside_battle && !p_ptr->inside_arena)
3200+ if (!current_floor_ptr->dun_level && !p_ptr->inside_quest && !p_ptr->phase_out && !p_ptr->inside_arena)
32013201 {
32023202 /* Hack -- Daybreak/Nighfall in town */
32033203 if (!(current_world_ptr->game_turn % ((TURNS_PER_TICK * TOWN_DAWN) / 2)))
@@ -3214,7 +3214,7 @@ static void process_world(void)
32143214 }
32153215
32163216 /* While in the dungeon (vanilla_town or lite_town mode only) */
3217- else if ((vanilla_town || (lite_town && !p_ptr->inside_quest && !p_ptr->inside_battle && !p_ptr->inside_arena)) && current_floor_ptr->dun_level)
3217+ else if ((vanilla_town || (lite_town && !p_ptr->inside_quest && !p_ptr->phase_out && !p_ptr->inside_arena)) && current_floor_ptr->dun_level)
32183218 {
32193219 /*** Shuffle the Storekeepers ***/
32203220
@@ -3265,14 +3265,14 @@ static void process_world(void)
32653265
32663266 /* Check for creature generation. */
32673267 if (one_in_(d_info[p_ptr->dungeon_idx].max_m_alloc_chance) &&
3268- !p_ptr->inside_arena && !p_ptr->inside_quest && !p_ptr->inside_battle)
3268+ !p_ptr->inside_arena && !p_ptr->inside_quest && !p_ptr->phase_out)
32693269 {
32703270 /* Make a new monster */
32713271 (void)alloc_monster(MAX_SIGHT + 5, 0);
32723272 }
32733273
32743274 /* Hack -- Check for creature regeneration */
3275- if (!(current_world_ptr->game_turn % (TURNS_PER_TICK * 10)) && !p_ptr->inside_battle) regen_monsters();
3275+ if (!(current_world_ptr->game_turn % (TURNS_PER_TICK * 10)) && !p_ptr->phase_out) regen_monsters();
32763276 if (!(current_world_ptr->game_turn % (TURNS_PER_TICK * 3))) regen_captured_monsters();
32773277
32783278 if (!p_ptr->leaving)
@@ -4429,7 +4429,7 @@ static void process_player(void)
44294429 p_ptr->invoking_midnight_curse = FALSE;
44304430 }
44314431
4432- if (p_ptr->inside_battle)
4432+ if (p_ptr->phase_out)
44334433 {
44344434 for(m_idx = 1; m_idx < current_floor_ptr->m_max; m_idx++)
44354435 {
@@ -4644,7 +4644,7 @@ static void process_player(void)
46444644 /* Assume free current_world_ptr->game_turn */
46454645 free_turn(p_ptr);
46464646
4647- if (p_ptr->inside_battle)
4647+ if (p_ptr->phase_out)
46484648 {
46494649 /* Place the cursor on the player */
46504650 move_cursor_relative(p_ptr->y, p_ptr->x);
@@ -4997,7 +4997,7 @@ static void dungeon(bool load_game)
49974997 !((quest_num == QUEST_OBERON) || (quest_num == QUEST_SERPENT) ||
49984998 !(quest[quest_num].flags & QUEST_FLAG_PRESET)))) do_cmd_feeling();
49994999
5000- if (p_ptr->inside_battle)
5000+ if (p_ptr->phase_out)
50015001 {
50025002 if (load_game)
50035003 {
@@ -5049,7 +5049,7 @@ static void dungeon(bool load_game)
50495049
50505050 current_world_ptr->is_loading_now = TRUE;
50515051
5052- if (p_ptr->energy_need > 0 && !p_ptr->inside_battle &&
5052+ if (p_ptr->energy_need > 0 && !p_ptr->phase_out &&
50535053 (current_floor_ptr->dun_level || p_ptr->leaving_dungeon || p_ptr->inside_arena))
50545054 p_ptr->energy_need = 0;
50555055
@@ -5063,10 +5063,10 @@ static void dungeon(bool load_game)
50635063 while (TRUE)
50645064 {
50655065 /* Hack -- Compact the monster list occasionally */
5066- if ((current_floor_ptr->m_cnt + 32 > current_floor_ptr->max_m_idx) && !p_ptr->inside_battle) compact_monsters(64);
5066+ if ((current_floor_ptr->m_cnt + 32 > current_floor_ptr->max_m_idx) && !p_ptr->phase_out) compact_monsters(64);
50675067
50685068 /* Hack -- Compress the monster list occasionally */
5069- if ((current_floor_ptr->m_cnt + 32 < current_floor_ptr->m_max) && !p_ptr->inside_battle) compact_monsters(0);
5069+ if ((current_floor_ptr->m_cnt + 32 < current_floor_ptr->m_max) && !p_ptr->phase_out) compact_monsters(0);
50705070
50715071
50725072 /* Hack -- Compact the object list occasionally */
@@ -5396,7 +5396,7 @@ void play_game(bool new_game)
53965396 current_floor_ptr->dun_level = 0;
53975397 p_ptr->inside_quest = 0;
53985398 p_ptr->inside_arena = FALSE;
5399- p_ptr->inside_battle = FALSE;
5399+ p_ptr->phase_out = FALSE;
54005400
54015401 write_level = TRUE;
54025402
--- a/src/floor-events.c
+++ b/src/floor-events.c
@@ -283,7 +283,7 @@ void update_dungeon_feeling(void)
283283 if (!current_floor_ptr->dun_level) return;
284284
285285 /* No feeling in the arena */
286- if (p_ptr->inside_battle) return;
286+ if (p_ptr->phase_out) return;
287287
288288 /* Extract delay time */
289289 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)
15511551 if (!rad) continue;
15521552 else if (rad > 0)
15531553 {
1554- 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;
1554+ 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;
15551555 if (d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS) rad = 1;
15561556 add_mon_lite = mon_lite_hack;
15571557 f_flag = FF_LOS;
--- a/src/floor-generate.c
+++ b/src/floor-generate.c
@@ -1412,7 +1412,7 @@ void generate_random_floor(void)
14121412 }
14131413
14141414 /* Build the battle -KMW- */
1415- else if (p_ptr->inside_battle)
1415+ else if (p_ptr->phase_out)
14161416 {
14171417 /* Small arena */
14181418 generate_gambling_arena();
--- a/src/floor-save.c
+++ b/src/floor-save.c
@@ -420,7 +420,7 @@ static void preserve_pet(void)
420420 * If player is in wild mode, no pets are preserved
421421 * except a monster whom player riding
422422 */
423- if (!p_ptr->wild_mode && !p_ptr->inside_arena && !p_ptr->inside_battle)
423+ if (!p_ptr->wild_mode && !p_ptr->inside_arena && !p_ptr->phase_out)
424424 {
425425 for (i = current_floor_ptr->m_max - 1, num = 1; (i >= 1 && num < MAX_PARTY_MON); i--)
426426 {
--- a/src/floor.h
+++ b/src/floor.h
@@ -340,7 +340,7 @@ typedef struct {
340340 * Note the use of comparison to zero to force a "boolean" result
341341 */
342342 #define player_has_los_bold(Y,X) \
343- (((current_floor_ptr->grid_array[Y][X].info & (CAVE_VIEW)) != 0) || p_ptr->inside_battle)
343+ (((current_floor_ptr->grid_array[Y][X].info & (CAVE_VIEW)) != 0) || p_ptr->phase_out)
344344
345345
346346 /*
--- a/src/gamevalue.h
+++ b/src/gamevalue.h
@@ -33,7 +33,7 @@
3333 * More maximum values
3434 */
3535 #define MAX_SIGHT 20 /*!< プレイヤーの最大視界範囲(マス) / Maximum view distance */
36-#define MAX_RANGE (p_ptr->inside_battle ? 36 : 18) /*!< プレイヤーの攻撃射程(マス) / Maximum range (spells, etc) */
36+#define MAX_RANGE (p_ptr->phase_out ? 36 : 18) /*!< プレイヤーの攻撃射程(マス) / Maximum range (spells, etc) */
3737 #define AAF_LIMIT 100 /*!< モンスターの限界感知範囲(マス) Limit of sensing radius */
3838
3939 #define MIN_M_ALLOC_TD 4 /*!< 街(昼間)の最低住人配置数 / The town starts out with 4 residents during the day */
--- a/src/geometry.h
+++ b/src/geometry.h
@@ -83,6 +83,6 @@ struct coord
8383 * Is the monster seen by the player?
8484 */
8585 #define is_seen(A) \
86- ((bool)((A)->ml && (!ignore_unview || p_ptr->inside_battle || \
86+ ((bool)((A)->ml && (!ignore_unview || p_ptr->phase_out || \
8787 (player_can_see_bold((A)->fy, (A)->fx) && projectable(p_ptr->y, p_ptr->x, (A)->fy, (A)->fx)))))
8888
--- a/src/load.c
+++ b/src/load.c
@@ -1967,11 +1967,11 @@ static void rd_extra(void)
19671967 rd_s16b(&tmp16s);
19681968 p_ptr->inside_arena = (bool)tmp16s;
19691969 rd_s16b(&p_ptr->inside_quest);
1970- if (z_older_than(10, 3, 5)) p_ptr->inside_battle = FALSE;
1970+ if (z_older_than(10, 3, 5)) p_ptr->phase_out = FALSE;
19711971 else
19721972 {
19731973 rd_s16b(&tmp16s);
1974- p_ptr->inside_battle = (bool)tmp16s;
1974+ p_ptr->phase_out = (bool)tmp16s;
19751975 }
19761976 rd_byte(&p_ptr->exit_bldg);
19771977 rd_byte(&tmp8u);
--- 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,
48134813 {
48144814 if (((r_ptr->flags1 & (RF1_UNIQUE | RF1_QUESTOR)) ||
48154815 (r_ptr->flags7 & RF7_NAZGUL)) &&
4816- !p_ptr->inside_battle)
4816+ !p_ptr->phase_out)
48174817 {
48184818 m_ptr->hp = 1;
48194819 }
--- 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)
7272 }
7373 else
7474 {
75- if (p_ptr->inside_battle)
75+ if (p_ptr->phase_out)
7676 {
7777 start = randint1(current_floor_ptr->m_max-1)+current_floor_ptr->m_max;
7878 if(randint0(2)) plus = -1;
@@ -1370,7 +1370,7 @@ void process_monster(MONSTER_IDX m_idx)
13701370 if(dead) return;
13711371 }
13721372
1373- if ((is_pet(m_ptr) || is_friendly(m_ptr)) && ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_NAZGUL)) && !p_ptr->inside_battle)
1373+ if ((is_pet(m_ptr) || is_friendly(m_ptr)) && ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_NAZGUL)) && !p_ptr->phase_out)
13741374 {
13751375 static int riding_pinch = 0;
13761376
@@ -1471,7 +1471,7 @@ void process_monster(MONSTER_IDX m_idx)
14711471 gets_angry = TRUE;
14721472 }
14731473
1474- if (p_ptr->inside_battle) gets_angry = FALSE;
1474+ if (p_ptr->phase_out) gets_angry = FALSE;
14751475
14761476 if (gets_angry)
14771477 {
@@ -1532,7 +1532,7 @@ void process_monster(MONSTER_IDX m_idx)
15321532 /* Hack -- Ohmu scatters molds! */
15331533 if (m_ptr->r_idx == MON_OHMU)
15341534 {
1535- if (!p_ptr->inside_arena && !p_ptr->inside_battle)
1535+ if (!p_ptr->inside_arena && !p_ptr->phase_out)
15361536 {
15371537 if (r_ptr->freq_spell && (randint1(100) <= r_ptr->freq_spell))
15381538 {
@@ -1554,7 +1554,7 @@ void process_monster(MONSTER_IDX m_idx)
15541554 }
15551555 }
15561556
1557- if (!p_ptr->inside_battle)
1557+ if (!p_ptr->phase_out)
15581558 {
15591559 /* Hack! "Cyber" monster makes noise... */
15601560 if (m_ptr->ap_r_idx == MON_CYBER &&
@@ -2373,7 +2373,7 @@ void process_monster(MONSTER_IDX m_idx)
23732373
23742374 /* Notice changes in view */
23752375 if (do_move && ((r_ptr->flags7 & (RF7_SELF_LD_MASK | RF7_HAS_DARK_1 | RF7_HAS_DARK_2))
2376- || ((r_ptr->flags7 & (RF7_HAS_LITE_1 | RF7_HAS_LITE_2)) && !p_ptr->inside_battle)))
2376+ || ((r_ptr->flags7 & (RF7_HAS_LITE_1 | RF7_HAS_LITE_2)) && !p_ptr->phase_out)))
23772377 {
23782378 p_ptr->update |= (PU_MON_LITE);
23792379 }
@@ -2568,7 +2568,7 @@ void process_monsters(void)
25682568 }
25692569
25702570 /* Handle "sight" and "aggravation" */
2571- else if ((m_ptr->cdis <= MAX_SIGHT || p_ptr->inside_battle) &&
2571+ else if ((m_ptr->cdis <= MAX_SIGHT || p_ptr->phase_out) &&
25722572 (player_has_los_bold(fy, fx) || (p_ptr->cursed & TRC_AGGRAVATE)))
25732573 {
25742574 /* We can "see" or "feel" the player */
--- 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)
120120 u32b div_l;
121121
122122 if (!monster_is_valid(m_ptr)) return;
123- if (is_pet(m_ptr) || p_ptr->inside_battle) return;
123+ if (is_pet(m_ptr) || p_ptr->phase_out) return;
124124
125125 /*
126126 * - 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)
887887 r_ptr = &r_info[m_ptr->r_idx];
888888 s_ptr = &r_info[s_idx];
889889
890- if (p_ptr->inside_battle) return;
890+ if (p_ptr->phase_out) return;
891891
892892 if (!r_ptr->next_exp) return;
893893
@@ -1352,7 +1352,7 @@ bool mon_take_hit(MONSTER_IDX m_idx, HIT_POINT dam, bool *fear, concptr note)
13521352 monster_death(m_idx, TRUE);
13531353
13541354 /* Mega hack : replace IKETA to BIKETAL */
1355- if ((m_ptr->r_idx == MON_IKETA) && !(p_ptr->inside_arena || p_ptr->inside_battle))
1355+ if ((m_ptr->r_idx == MON_IKETA) && !(p_ptr->inside_arena || p_ptr->phase_out))
13561356 {
13571357 POSITION dummy_y = m_ptr->fy;
13581358 POSITION dummy_x = m_ptr->fx;
--- a/src/monster1.c
+++ b/src/monster1.c
@@ -2234,7 +2234,7 @@ void set_pet(monster_type *m_ptr)
22342234 */
22352235 void set_hostile(monster_type *m_ptr)
22362236 {
2237- if (p_ptr->inside_battle) return;
2237+ if (p_ptr->phase_out) return;
22382238 m_ptr->smart &= ~SM_PET;
22392239 m_ptr->smart &= ~SM_FRIENDLY;
22402240 }
@@ -2248,7 +2248,7 @@ void set_hostile(monster_type *m_ptr)
22482248 */
22492249 void anger_monster(monster_type *m_ptr)
22502250 {
2251- if (p_ptr->inside_battle) return;
2251+ if (p_ptr->phase_out) return;
22522252 if (is_friendly(m_ptr))
22532253 {
22542254 GAME_TEXT m_name[MAX_NLEN];
@@ -2407,7 +2407,7 @@ bool are_enemies(monster_type *m_ptr, monster_type *n_ptr)
24072407 monster_race *r_ptr = &r_info[m_ptr->r_idx];
24082408 monster_race *s_ptr = &r_info[n_ptr->r_idx];
24092409
2410- if (p_ptr->inside_battle)
2410+ if (p_ptr->phase_out)
24112411 {
24122412 if (is_pet(m_ptr) || is_pet(n_ptr)) return FALSE;
24132413 return TRUE;
@@ -2541,7 +2541,7 @@ void monster_death(MONSTER_IDX m_idx, bool drop_item)
25412541 object_type *q_ptr;
25422542
25432543 bool drop_chosen_item = drop_item && !cloned && !p_ptr->inside_arena
2544- && !p_ptr->inside_battle && !is_pet(m_ptr);
2544+ && !p_ptr->phase_out && !is_pet(m_ptr);
25452545
25462546 /* The caster is dead? */
25472547 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)
26342634 /* Drop a dead corpse? */
26352635 if (one_in_(r_ptr->flags1 & RF1_UNIQUE ? 1 : 4) &&
26362636 (r_ptr->flags9 & (RF9_DROP_CORPSE | RF9_DROP_SKELETON)) &&
2637- !(p_ptr->inside_arena || p_ptr->inside_battle || cloned || ((m_ptr->r_idx == today_mon) && is_pet(m_ptr))))
2637+ !(p_ptr->inside_arena || p_ptr->phase_out || cloned || ((m_ptr->r_idx == today_mon) && is_pet(m_ptr))))
26382638 {
26392639 /* Assume skeleton */
26402640 bool corpse = FALSE;
@@ -2682,7 +2682,7 @@ void monster_death(MONSTER_IDX m_idx, bool drop_item)
26822682 {
26832683 case MON_PINK_HORROR:
26842684 /* Pink horrors are replaced with 2 Blue horrors */
2685- if (!(p_ptr->inside_arena || p_ptr->inside_battle))
2685+ if (!(p_ptr->inside_arena || p_ptr->phase_out))
26862686 {
26872687 bool notice = FALSE;
26882688
@@ -2741,7 +2741,7 @@ void monster_death(MONSTER_IDX m_idx, bool drop_item)
27412741 * Mega^3-hack: killing a 'Warrior of the Dawn' is likely to
27422742 * spawn another in the fallen one's place!
27432743 */
2744- if (!p_ptr->inside_arena && !p_ptr->inside_battle)
2744+ if (!p_ptr->inside_arena && !p_ptr->phase_out)
27452745 {
27462746 if (!one_in_(7))
27472747 {
@@ -3040,7 +3040,7 @@ void monster_death(MONSTER_IDX m_idx, bool drop_item)
30403040 if (cloned && !(r_ptr->flags1 & RF1_UNIQUE))
30413041 number = 0; /* Clones drop no stuff unless Cloning Pits */
30423042
3043- if (is_pet(m_ptr) || p_ptr->inside_battle || p_ptr->inside_arena)
3043+ if (is_pet(m_ptr) || p_ptr->phase_out || p_ptr->inside_arena)
30443044 number = 0; /* Pets drop no stuff */
30453045 if (!drop_item && (r_ptr->d_char != '$')) number = 0;
30463046
@@ -3088,7 +3088,7 @@ void monster_death(MONSTER_IDX m_idx, bool drop_item)
30883088
30893089 /* Only process "Quest Monsters" */
30903090 if (!(r_ptr->flags1 & RF1_QUESTOR)) return;
3091- if (p_ptr->inside_battle) return;
3091+ if (p_ptr->phase_out) return;
30923092
30933093 /* Winner? */
30943094 if ((m_ptr->r_idx == MON_SERPENT) && !cloned)
--- a/src/monster2.c
+++ b/src/monster2.c
@@ -1063,7 +1063,7 @@ errr get_mon_num_prep(monsterrace_hook_type monster_hook,
10631063 (get_mon_num2_hook && !((*get_mon_num2_hook)(entry->index))))
10641064 continue;
10651065
1066- if (!p_ptr->inside_battle && !chameleon_change_m_idx &&
1066+ if (!p_ptr->phase_out && !chameleon_change_m_idx &&
10671067 summon_specific_type != SUMMON_GUARDIANS)
10681068 {
10691069 /* Hack -- don't create questors */
@@ -1083,7 +1083,7 @@ errr get_mon_num_prep(monsterrace_hook_type monster_hook,
10831083 entry->prob2 = entry->prob1;
10841084
10851085 if (current_floor_ptr->dun_level && (!p_ptr->inside_quest || is_fixed_quest_idx(p_ptr->inside_quest)) &&
1086- !restrict_monster_to_dungeon(p_ptr->dungeon_idx, entry->index) && !p_ptr->inside_battle)
1086+ !restrict_monster_to_dungeon(p_ptr->dungeon_idx, entry->index) && !p_ptr->phase_out)
10871087 {
10881088 int hoge = entry->prob2 * d_info[p_ptr->dungeon_idx].special_div;
10891089 entry->prob2 = hoge / 64;
@@ -1145,7 +1145,7 @@ MONRACE_IDX get_mon_num(DEPTH level)
11451145 }
11461146
11471147 /* Boost the level */
1148- if (!p_ptr->inside_battle && !(d_info[p_ptr->dungeon_idx].flags1 & DF1_BEGINNER))
1148+ if (!p_ptr->phase_out && !(d_info[p_ptr->dungeon_idx].flags1 & DF1_BEGINNER))
11491149 {
11501150 /* Nightmare mode allows more out-of depth monsters */
11511151 if (ironman_nightmare && !randint0(pls_kakuritu))
@@ -1185,7 +1185,7 @@ MONRACE_IDX get_mon_num(DEPTH level)
11851185 /* Access the actual race */
11861186 r_ptr = &r_info[r_idx];
11871187
1188- if (!p_ptr->inside_battle && !chameleon_change_m_idx)
1188+ if (!p_ptr->phase_out && !chameleon_change_m_idx)
11891189 {
11901190 /* Hack -- "unique" monsters must be "unique" */
11911191 if (((r_ptr->flags1 & (RF1_UNIQUE)) ||
@@ -1535,7 +1535,7 @@ void monster_desc(char *desc, monster_type *m_ptr, BIT_FLAGS mode)
15351535 }
15361536
15371537 /* Inside monster arena, and it is not your mount */
1538- else if (p_ptr->inside_battle &&
1538+ else if (p_ptr->phase_out &&
15391539 !(p_ptr->riding && (&current_floor_ptr->m_list[p_ptr->riding] == m_ptr)))
15401540 {
15411541 /* It is a fake unique monster */
@@ -2534,7 +2534,7 @@ static bool place_monster_one(MONSTER_IDX who, POSITION y, POSITION x, MONRACE_I
25342534 if (!monster_can_enter(y, x, r_ptr, 0)) return FALSE;
25352535 }
25362536
2537- if (!p_ptr->inside_battle)
2537+ if (!p_ptr->phase_out)
25382538 {
25392539 /* Hack -- "unique" monsters must be "unique" */
25402540 if (((r_ptr->flags1 & (RF1_UNIQUE)) ||
--- a/src/mspells1.c
+++ b/src/mspells1.c
@@ -811,7 +811,7 @@ static bool spell_world(byte spell)
811811 */
812812 static bool spell_special(byte spell)
813813 {
814- if (p_ptr->inside_battle) return FALSE;
814+ if (p_ptr->phase_out) return FALSE;
815815 if (spell == 160 + 7) return (TRUE);
816816 return (FALSE);
817817 }
@@ -1577,7 +1577,7 @@ bool make_attack_spell(MONSTER_IDX m_idx)
15771577 /* Remove the "ineffective" spells */
15781578 remove_bad_spells(m_idx, &f4, &f5, &f6);
15791579
1580- if (p_ptr->inside_arena || p_ptr->inside_battle)
1580+ if (p_ptr->inside_arena || p_ptr->phase_out)
15811581 {
15821582 f4 &= ~(RF4_SUMMON_MASK);
15831583 f5 &= ~(RF5_SUMMON_MASK);
--- a/src/mspells2.c
+++ b/src/mspells2.c
@@ -354,7 +354,7 @@ bool monst_spell_monst(MONSTER_IDX m_idx)
354354 {
355355 bool success = FALSE;
356356
357- if (p_ptr->inside_battle)
357+ if (p_ptr->phase_out)
358358 {
359359 start = randint1(current_floor_ptr->m_max-1) + current_floor_ptr->m_max;
360360 if (randint0(2)) plus = -1;
@@ -434,7 +434,7 @@ bool monst_spell_monst(MONSTER_IDX m_idx)
434434 f6 &= (RF6_NOMAGIC_MASK);
435435 }
436436
437- if (p_ptr->inside_arena || p_ptr->inside_battle)
437+ if (p_ptr->inside_arena || p_ptr->phase_out)
438438 {
439439 f4 &= ~(RF4_SUMMON_MASK);
440440 f5 &= ~(RF5_SUMMON_MASK);
@@ -443,7 +443,7 @@ bool monst_spell_monst(MONSTER_IDX m_idx)
443443 if (m_ptr->r_idx == MON_ROLENTO) f6 &= ~(RF6_SPECIAL);
444444 }
445445
446- if (p_ptr->inside_battle && !one_in_(3))
446+ if (p_ptr->phase_out && !one_in_(3))
447447 {
448448 f6 &= ~(RF6_HEAL);
449449 }
--- a/src/mspells4.c
+++ b/src/mspells4.c
@@ -1947,7 +1947,7 @@ HIT_POINT spell_RF6_SPECIAL_BANORLUPART(MONSTER_IDX m_idx)
19471947 dummy_hp = (m_ptr->hp + 1) / 2;
19481948 dummy_maxhp = m_ptr->maxhp / 2;
19491949
1950- if (p_ptr->inside_arena || p_ptr->inside_battle || !summon_possible(m_ptr->fy, m_ptr->fx))
1950+ if (p_ptr->inside_arena || p_ptr->phase_out || !summon_possible(m_ptr->fy, m_ptr->fx))
19511951 return -1;
19521952
19531953 delete_monster_idx(current_floor_ptr->grid_array[m_ptr->fy][m_ptr->fx].m_idx);
--- a/src/player-status.c
+++ b/src/player-status.c
@@ -5205,7 +5205,7 @@ void sanity_blast(monster_type *m_ptr, bool necro)
52055205 {
52065206 int power = 100;
52075207
5208- if (p_ptr->inside_battle || !current_world_ptr->character_dungeon) return;
5208+ if (p_ptr->phase_out || !current_world_ptr->character_dungeon) return;
52095209
52105210 if (!necro && m_ptr)
52115211 {
@@ -5847,7 +5847,7 @@ void cheat_death(player_type *creature_ptr)
58475847
58485848 current_floor_ptr->dun_level = 0;
58495849 creature_ptr->inside_arena = FALSE;
5850- creature_ptr->inside_battle = FALSE;
5850+ creature_ptr->phase_out = FALSE;
58515851 leaving_quest = 0;
58525852 creature_ptr->inside_quest = 0;
58535853 if (p_ptr->dungeon_idx) creature_ptr->recall_dungeon = p_ptr->dungeon_idx;
--- a/src/player-status.h
+++ b/src/player-status.h
@@ -121,7 +121,7 @@ struct player_type
121121 s16b arena_number; /* monster number in arena -KMW- */
122122 bool inside_arena; /* Is character inside arena? */
123123 QUEST_IDX inside_quest; /* Inside quest level */
124- bool inside_battle; /* Is character inside tougijou? */
124+ bool phase_out; /*!< フェイズアウト状態(闘技場観戦状態などに利用、NPCの処理の対象にならず自身もほとんどの行動ができない) */
125125
126126 DUNGEON_IDX dungeon_idx; /* current dungeon index */
127127 POSITION wilderness_x; /* Coordinates in the wilderness */
--- a/src/save.c
+++ b/src/save.c
@@ -697,7 +697,7 @@ static void wr_extra(void)
697697 wr_s16b(p_ptr->arena_number);
698698 wr_s16b(p_ptr->inside_arena);
699699 wr_s16b(p_ptr->inside_quest);
700- wr_s16b(p_ptr->inside_battle);
700+ wr_s16b(p_ptr->phase_out);
701701 wr_byte(p_ptr->exit_bldg);
702702 wr_byte(0); /* Unused */
703703
--- a/src/spells-floor.c
+++ b/src/spells-floor.c
@@ -282,7 +282,7 @@ void stair_creation(void)
282282 /* No effect out of standard dungeon floor */
283283 if (!current_floor_ptr->dun_level || (!up && !down) ||
284284 (p_ptr->inside_quest && is_fixed_quest_idx(p_ptr->inside_quest)) ||
285- p_ptr->inside_arena || p_ptr->inside_battle)
285+ p_ptr->inside_arena || p_ptr->phase_out)
286286 {
287287 /* arena or quest */
288288 msg_print(_("効果がありません!", "There is no effect!"));
--- a/src/spells.h
+++ b/src/spells.h
@@ -341,7 +341,7 @@ extern bool tele_town(void);
341341
342342 /* Is "teleport level" ineffective to this target? */
343343 #define TELE_LEVEL_IS_INEFF(TARGET) \
344- (p_ptr->inside_arena || p_ptr->inside_battle || \
344+ (p_ptr->inside_arena || p_ptr->phase_out || \
345345 (p_ptr->inside_quest && !random_quest_number(current_floor_ptr->dun_level)) || \
346346 (((TARGET) <= 0) && (quest_number(current_floor_ptr->dun_level) || (current_floor_ptr->dun_level >= d_info[p_ptr->dungeon_idx].maxdepth)) && \
347347 (current_floor_ptr->dun_level >= 1) && ironman_downward))
--- 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
597597 case GF_DARK_WEAK:
598598 case GF_DARK:
599599 {
600- bool do_dark = !p_ptr->inside_battle && !is_mirror_grid(g_ptr);
600+ bool do_dark = !p_ptr->phase_out && !is_mirror_grid(g_ptr);
601601 int j;
602602
603603 /* Turn off the light. */
@@ -1154,7 +1154,7 @@ static bool project_m(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_P
11541154 bool obvious = FALSE;
11551155
11561156 /* Can the player know about this effect? */
1157- bool known = ((m_ptr->cdis <= MAX_SIGHT) || p_ptr->inside_battle);
1157+ bool known = ((m_ptr->cdis <= MAX_SIGHT) || p_ptr->phase_out);
11581158
11591159 /* Were the effects "irrelevant"? */
11601160 bool skipped = FALSE;
@@ -3613,7 +3613,7 @@ static bool project_m(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_P
36133613 if (p_ptr->riding && (g_ptr->m_idx == p_ptr->riding)) do_poly = FALSE;
36143614
36153615 /* "Unique" and "quest" monsters can only be "killed" by the player. */
3616- if (((r_ptr->flags1 & (RF1_UNIQUE | RF1_QUESTOR)) || (r_ptr->flags7 & RF7_NAZGUL)) && !p_ptr->inside_battle)
3616+ if (((r_ptr->flags1 & (RF1_UNIQUE | RF1_QUESTOR)) || (r_ptr->flags7 & RF7_NAZGUL)) && !p_ptr->phase_out)
36173617 {
36183618 if (who && (dam > m_ptr->hp)) dam = m_ptr->hp;
36193619 }
@@ -3901,7 +3901,7 @@ static bool project_m(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_P
39013901 blood_curse_to_enemy(who);
39023902 }
39033903
3904- if (p_ptr->inside_battle)
3904+ if (p_ptr->phase_out)
39053905 {
39063906 p_ptr->health_who = g_ptr->m_idx;
39073907 p_ptr->redraw |= (PR_HEALTH);
--- 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,
10331033 if (r_ptr->flags1 & (RF1_UNIQUE | RF1_QUESTOR)) resist = TRUE;
10341034 else if (r_ptr->flags7 & RF7_UNIQUE2) resist = TRUE;
10351035 else if (m_idx == p_ptr->riding) resist = TRUE;
1036- else if ((p_ptr->inside_quest && !random_quest_number(current_floor_ptr->dun_level)) || p_ptr->inside_arena || p_ptr->inside_battle) resist = TRUE;
1036+ else if ((p_ptr->inside_quest && !random_quest_number(current_floor_ptr->dun_level)) || p_ptr->inside_arena || p_ptr->phase_out) resist = TRUE;
10371037 else if (player_cast && (r_ptr->level > randint0(power))) resist = TRUE;
10381038 else if (player_cast && (m_ptr->mflag2 & MFLAG2_NOGENO)) resist = TRUE;
10391039
@@ -1112,7 +1112,7 @@ bool symbol_genocide(int power, bool player_cast)
11121112 bool result = FALSE;
11131113
11141114 /* Prevent genocide in quest levels */
1115- if ((p_ptr->inside_quest && !random_quest_number(current_floor_ptr->dun_level)) || p_ptr->inside_arena || p_ptr->inside_battle)
1115+ if ((p_ptr->inside_quest && !random_quest_number(current_floor_ptr->dun_level)) || p_ptr->inside_arena || p_ptr->phase_out)
11161116 {
11171117 msg_print(_("何も起きないようだ……", "It seems nothing happen here..."));
11181118 return (FALSE);
@@ -1156,7 +1156,7 @@ bool mass_genocide(int power, bool player_cast)
11561156 bool result = FALSE;
11571157
11581158 /* Prevent mass genocide in quest levels */
1159- if ((p_ptr->inside_quest && !random_quest_number(current_floor_ptr->dun_level)) || p_ptr->inside_arena || p_ptr->inside_battle)
1159+ if ((p_ptr->inside_quest && !random_quest_number(current_floor_ptr->dun_level)) || p_ptr->inside_arena || p_ptr->phase_out)
11601160 {
11611161 return (FALSE);
11621162 }
@@ -1196,7 +1196,7 @@ bool mass_genocide_undead(int power, bool player_cast)
11961196 bool result = FALSE;
11971197
11981198 /* Prevent mass genocide in quest levels */
1199- if ((p_ptr->inside_quest && !random_quest_number(current_floor_ptr->dun_level)) || p_ptr->inside_arena || p_ptr->inside_battle)
1199+ if ((p_ptr->inside_quest && !random_quest_number(current_floor_ptr->dun_level)) || p_ptr->inside_arena || p_ptr->phase_out)
12001200 {
12011201 return (FALSE);
12021202 }
@@ -4401,7 +4401,7 @@ bool rodeo(player_type *creature_ptr)
44014401 if (r_ptr->flags1 & RF1_UNIQUE) rlev = rlev * 3 / 2;
44024402 if (rlev > 60) rlev = 60 + (rlev - 60) / 2;
44034403 if ((randint1(creature_ptr->skill_exp[GINOU_RIDING] / 120 + creature_ptr->lev * 2 / 3) > rlev)
4404- && one_in_(2) && !creature_ptr->inside_arena && !creature_ptr->inside_battle
4404+ && one_in_(2) && !creature_ptr->inside_arena && !creature_ptr->phase_out
44054405 && !(r_ptr->flags7 & (RF7_GUARDIAN)) && !(r_ptr->flags1 & (RF1_QUESTOR))
44064406 && (rlev < creature_ptr->lev * 3 / 2 + randint0(creature_ptr->lev / 5)))
44074407 {
--- a/src/spells3.c
+++ b/src/spells3.c
@@ -541,7 +541,7 @@ void teleport_away_followable(MONSTER_IDX m_idx)
541541
542542 teleport_away(m_idx, MAX_SIGHT * 2 + 5, 0L);
543543
544- 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))
544+ 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))
545545 {
546546 bool follow = FALSE;
547547
@@ -3213,7 +3213,7 @@ bool polymorph_monster(POSITION y, POSITION x)
32133213 bool health_tracked = (p_ptr->health_who == g_ptr->m_idx) ? TRUE : FALSE;
32143214 monster_type back_m;
32153215
3216- if (p_ptr->inside_arena || p_ptr->inside_battle) return (FALSE);
3216+ if (p_ptr->inside_arena || p_ptr->phase_out) return (FALSE);
32173217
32183218 if ((p_ptr->riding == g_ptr->m_idx) || (m_ptr->mflag2 & MFLAG2_KAGE)) return (FALSE);
32193219
@@ -3968,7 +3968,7 @@ bool tele_town(void)
39683968 return FALSE;
39693969 }
39703970
3971- if (p_ptr->inside_arena || p_ptr->inside_battle)
3971+ if (p_ptr->inside_arena || p_ptr->phase_out)
39723972 {
39733973 msg_print(_("この魔法は外でしか使えない!", "This spell can only be used outside!"));
39743974 return FALSE;
--- a/src/util.c
+++ b/src/util.c
@@ -1824,7 +1824,7 @@ void select_floor_music(void)
18241824 return;
18251825 }
18261826
1827- if(p_ptr->inside_battle)
1827+ if(p_ptr->phase_out)
18281828 {
18291829 play_music(TERM_XTRA_MUSIC_BASIC, MUSIC_BASIC_BATTLE);
18301830 return;
--- a/src/view-mainwindow.c
+++ b/src/view-mainwindow.c
@@ -196,7 +196,7 @@ concptr map_name(void)
196196 return _("地上", "Surface");
197197 else if (p_ptr->inside_arena)
198198 return _("アリーナ", "Arena");
199- else if (p_ptr->inside_battle)
199+ else if (p_ptr->phase_out)
200200 return _("闘技場", "Monster Arena");
201201 else if (!current_floor_ptr->dun_level && p_ptr->town_num)
202202 return town_info[p_ptr->town_num].name;
@@ -1393,7 +1393,7 @@ static void health_redraw(bool riding)
13931393
13941394 m_ptr = &current_floor_ptr->m_list[health_who];
13951395
1396- if (p_ptr->wizard && p_ptr->inside_battle)
1396+ if (p_ptr->wizard && p_ptr->phase_out)
13971397 {
13981398 row = ROW_INFO - 2;
13991399 col = COL_INFO + 2;
Show on old repository browser