OSDN Git Service

[Refactor] #38844 ambush_flag to player_type.
authordeskull <deskull@users.sourceforge.jp>
Tue, 12 Mar 2019 14:52:21 +0000 (23:52 +0900)
committerdeskull <deskull@users.sourceforge.jp>
Tue, 12 Mar 2019 14:52:21 +0000 (23:52 +0900)
src/externs.h
src/floor-save.c
src/monster-status.c
src/player-move.c
src/types.h
src/variable.c

index 7e71e30..7323739 100644 (file)
@@ -338,7 +338,6 @@ extern u32b start_time;
 extern bool sukekaku;
 extern bool new_mane;
 extern bool mon_fight;
-extern bool ambush_flag;
 extern bool generate_encounter;
 extern concptr screen_dump;
 
index 327aa72..bc8df0f 100644 (file)
@@ -1098,7 +1098,7 @@ void change_floor(void)
        panel_col_max = 0;
 
        /* Mega-Hack -- not ambushed on the wildness? */
-       ambush_flag = FALSE;
+       p_ptr->ambush_flag = FALSE;
 
        /* No saved floors (On the surface etc.) */
        if (!(change_floor_mode & CFM_SAVE_FLOORS) &&
index 3cd495f..2a2f9f3 100644 (file)
@@ -1123,7 +1123,7 @@ bool mon_take_hit(MONSTER_IDX m_idx, HIT_POINT dam, bool *fear, concptr note)
 
                if (!(d_info[p_ptr->dungeon_idx].flags1 & DF1_BEGINNER))
                {
-                       if (!current_floor_ptr->dun_level && !ambush_flag && !p_ptr->inside_arena)
+                       if (!current_floor_ptr->dun_level && !p_ptr->ambush_flag && !p_ptr->inside_arena)
                        {
                                chg_virtue(V_VALOUR, -1);
                        }
index 0a8a791..7622dba 100644 (file)
@@ -936,7 +936,7 @@ void move_player(DIRECTION dir, bool do_pickup, bool break_trap)
                                p_ptr->wilderness_x--;
                                p_ptr->oldpy = current_floor_ptr->height - 2;
                                p_ptr->oldpx = current_floor_ptr->width - 2;
-                               ambush_flag = FALSE;
+                               p_ptr->ambush_flag = FALSE;
                        }
 
                        else if ((y == 0) && (x == MAX_WID - 1))
@@ -945,7 +945,7 @@ void move_player(DIRECTION dir, bool do_pickup, bool break_trap)
                                p_ptr->wilderness_x++;
                                p_ptr->oldpy = current_floor_ptr->height - 2;
                                p_ptr->oldpx = 1;
-                               ambush_flag = FALSE;
+                               p_ptr->ambush_flag = FALSE;
                        }
 
                        else if ((y == MAX_HGT - 1) && (x == 0))
@@ -954,7 +954,7 @@ void move_player(DIRECTION dir, bool do_pickup, bool break_trap)
                                p_ptr->wilderness_x--;
                                p_ptr->oldpy = 1;
                                p_ptr->oldpx = current_floor_ptr->width - 2;
-                               ambush_flag = FALSE;
+                               p_ptr->ambush_flag = FALSE;
                        }
 
                        else if ((y == MAX_HGT - 1) && (x == MAX_WID - 1))
@@ -963,7 +963,7 @@ void move_player(DIRECTION dir, bool do_pickup, bool break_trap)
                                p_ptr->wilderness_x++;
                                p_ptr->oldpy = 1;
                                p_ptr->oldpx = 1;
-                               ambush_flag = FALSE;
+                               p_ptr->ambush_flag = FALSE;
                        }
 
                        else if (y == 0)
@@ -971,7 +971,7 @@ void move_player(DIRECTION dir, bool do_pickup, bool break_trap)
                                p_ptr->wilderness_y--;
                                p_ptr->oldpy = current_floor_ptr->height - 2;
                                p_ptr->oldpx = x;
-                               ambush_flag = FALSE;
+                               p_ptr->ambush_flag = FALSE;
                        }
 
                        else if (y == MAX_HGT - 1)
@@ -979,7 +979,7 @@ void move_player(DIRECTION dir, bool do_pickup, bool break_trap)
                                p_ptr->wilderness_y++;
                                p_ptr->oldpy = 1;
                                p_ptr->oldpx = x;
-                               ambush_flag = FALSE;
+                               p_ptr->ambush_flag = FALSE;
                        }
 
                        else if (x == 0)
@@ -987,7 +987,7 @@ void move_player(DIRECTION dir, bool do_pickup, bool break_trap)
                                p_ptr->wilderness_x--;
                                p_ptr->oldpx = current_floor_ptr->width - 2;
                                p_ptr->oldpy = y;
-                               ambush_flag = FALSE;
+                               p_ptr->ambush_flag = FALSE;
                        }
 
                        else if (x == MAX_WID - 1)
@@ -995,7 +995,7 @@ void move_player(DIRECTION dir, bool do_pickup, bool break_trap)
                                p_ptr->wilderness_x++;
                                p_ptr->oldpx = 1;
                                p_ptr->oldpy = y;
-                               ambush_flag = FALSE;
+                               p_ptr->ambush_flag = FALSE;
                        }
 
                        p_ptr->leaving = TRUE;
index 5684093..9936963 100644 (file)
@@ -1263,6 +1263,7 @@ struct player_type
        bool wait_report_score;   /* Waiting to report score */
        bool is_dead;             /* Player is dead */
        bool now_damaged;
+       bool ambush_flag;
 
        bool wizard;              /* Player is in wizard mode */
 
index 56a3ed2..1e8a32e 100644 (file)
@@ -790,7 +790,6 @@ bool new_mane;
 
 bool mon_fight;
 
-bool ambush_flag;
 bool generate_encounter;
 
 concptr screen_dump = NULL;