From a47f4556899725659410b14d9766da3b5f2942c8 Mon Sep 17 00:00:00 2001 From: deskull Date: Fri, 31 May 2019 01:25:39 +0900 Subject: [PATCH] =?utf8?q?[Refactor]=20#38844=20reset=5Fconcentrate=20?= =?utf8?q?=E3=82=92=20player=5Ftype=20=E6=A7=8B=E9=80=A0=E4=BD=93=E3=81=B8?= =?utf8?q?=E7=A7=BB=E5=8B=95=EF=BC=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/core.c | 4 ++-- src/externs.h | 2 -- src/player-status.h | 2 ++ src/snipe.c | 4 ++-- src/variable.c | 6 ------ 5 files changed, 6 insertions(+), 12 deletions(-) diff --git a/src/core.c b/src/core.c index 6d55f805e..f90a42504 100644 --- a/src/core.c +++ b/src/core.c @@ -3523,7 +3523,7 @@ static void process_command(void) /* Sniper */ if ((p_ptr->pclass == CLASS_SNIPER) && (p_ptr->concent)) - reset_concent = TRUE; + p_ptr->reset_concent = TRUE; /* Parse the command */ switch (command_cmd) @@ -4896,7 +4896,7 @@ static void process_player(void) } /* Sniper */ - if (p_ptr->energy_use && reset_concent) reset_concentration(TRUE); + if (p_ptr->energy_use && p_ptr->reset_concent) reset_concentration(TRUE); /* Handle "leaving" */ if (p_ptr->leaving) break; diff --git a/src/externs.h b/src/externs.h index e879f250a..79204e68e 100644 --- a/src/externs.h +++ b/src/externs.h @@ -48,8 +48,6 @@ extern const byte adj_chr_chm[]; extern bool repair_monsters; extern bool repair_objects; -extern bool reset_concent; - /* diff --git a/src/player-status.h b/src/player-status.h index cd94b7434..3625d21d5 100644 --- a/src/player-status.h +++ b/src/player-status.h @@ -364,6 +364,8 @@ struct player_type bool now_damaged; bool ambush_flag; + bool reset_concent; /* Concentration reset flag */ + bool wizard; /* Player is in wizard mode */ MONSTER_IDX riding; /* Riding on a monster of this index */ diff --git a/src/snipe.c b/src/snipe.c index d0b58662a..73c7ac1f7 100644 --- a/src/snipe.c +++ b/src/snipe.c @@ -120,7 +120,7 @@ static bool snipe_concentrate(void) if ((int)p_ptr->concent < (2 + (p_ptr->lev + 5) / 10)) p_ptr->concent++; msg_format(_("集中した。(集中度 %d)", "You concentrate deeply. (lvl %d)"), p_ptr->concent); - reset_concent = FALSE; + p_ptr->reset_concent = FALSE; p_ptr->update |= (PU_BONUS | PU_MONSTERS); p_ptr->redraw |= (PR_STATUS); @@ -140,7 +140,7 @@ void reset_concentration(bool msg) } p_ptr->concent = 0; - reset_concent = FALSE; + p_ptr->reset_concent = FALSE; p_ptr->update |= (PU_BONUS | PU_MONSTERS); p_ptr->redraw |= (PR_STATUS); diff --git a/src/variable.c b/src/variable.c index 7772eacec..f22e18a9c 100644 --- a/src/variable.c +++ b/src/variable.c @@ -80,9 +80,3 @@ int server_port; /* for movie */ bool browsing_movie; - - -/* for snipers */ -bool reset_concent = FALSE; /* Concentration reset flag */ - - -- 2.11.0