OSDN Git Service

[Refactor] #37353 inkey_* を util.c/h へ移動.
authordeskull <deskull@users.sourceforge.jp>
Mon, 13 May 2019 12:31:23 +0000 (21:31 +0900)
committerdeskull <deskull@users.sourceforge.jp>
Mon, 13 May 2019 12:31:23 +0000 (21:31 +0900)
src/bldg.c
src/core.c
src/externs.h
src/load.c
src/save.c
src/util.c
src/util.h
src/variable.c
src/world.h

index ec813d1..3f72fc6 100644 (file)
@@ -1549,10 +1549,10 @@ static bool kakutoujou(void)
        char out_val[160], tmp_str[80];
        concptr p;
 
-       if ((current_world_ptr->game_turn - old_battle) > TURNS_PER_TICK * 250)
+       if ((current_world_ptr->game_turn - current_world_ptr->arena_start_turn) > TURNS_PER_TICK * 250)
        {
                update_gambling_monsters();
-               old_battle = current_world_ptr->game_turn;
+               current_world_ptr->arena_start_turn = current_world_ptr->game_turn;
        }
 
        screen_save();
index 02937d1..9a8d01a 100644 (file)
@@ -5747,8 +5747,8 @@ void prevent_turn_overflow(void)
        else current_world_ptr->game_turn = 1;
        if (current_floor_ptr->generated_turn > rollback_turns) current_floor_ptr->generated_turn -= rollback_turns;
        else current_floor_ptr->generated_turn = 1;
-       if (old_battle > rollback_turns) old_battle -= rollback_turns;
-       else old_battle = 1;
+       if (current_world_ptr->arena_start_turn > rollback_turns) current_world_ptr->arena_start_turn -= rollback_turns;
+       else current_world_ptr->arena_start_turn = 1;
        if (p_ptr->feeling_turn > rollback_turns) p_ptr->feeling_turn -= rollback_turns;
        else p_ptr->feeling_turn = 1;
 
index 8cf1d34..511af27 100644 (file)
@@ -56,13 +56,8 @@ extern s16b command_new;
 extern bool msg_flag;
 extern s16b running;
 
-extern GAME_TURN old_battle;
-
 extern s16b signal_count;
-extern bool inkey_base;
-extern bool inkey_xtra;
-extern bool inkey_scan;
-extern bool inkey_flag;
+
 extern bool get_com_no_macros;
 extern OBJECT_SUBTYPE_VALUE coin_type;
 
index 6983d91..8c8aec0 100644 (file)
@@ -2322,9 +2322,9 @@ static void rd_extra(void)
 
        if (z_older_than(10, 3, 13))
        {
-               old_battle = current_world_ptr->game_turn;
+               current_world_ptr->arena_start_turn = current_world_ptr->game_turn;
        }
-       else rd_s32b(&old_battle);
+       else rd_s32b(&current_world_ptr->arena_start_turn);
 
        if (z_older_than(10,0,3))
        {
index 8408767..4699916 100644 (file)
@@ -847,7 +847,7 @@ static void wr_extra(void)
 
        wr_s32b(current_world_ptr->dungeon_turn);
 
-       wr_s32b(old_battle);
+       wr_s32b(current_world_ptr->arena_start_turn);
 
        wr_s16b(today_mon);
        wr_s16b(p_ptr->today_mon);
index 8cda666..cae86e7 100644 (file)
@@ -62,6 +62,11 @@ u32b *message__ptr;
  */
 char *message__buf;
 
+bool inkey_base;               /* See the "inkey()" function */
+bool inkey_xtra;               /* See the "inkey()" function */
+bool inkey_scan;               /* See the "inkey()" function */
+bool inkey_flag;               /* See the "inkey()" function */
+
 static int num_more = 0;
 
 /* Save macro trigger string for use in inkey_special() */
index c58c19e..01058f0 100644 (file)
@@ -46,6 +46,11 @@ extern concptr *macro__act;
 extern bool *macro__cmd;
 extern char *macro__buf;
 
+extern bool inkey_base;
+extern bool inkey_xtra;
+extern bool inkey_scan;
+extern bool inkey_flag;
+
 /*
  * Automatically generated "variable" declarations
  */
index e6b1bb9..5089a22 100644 (file)
@@ -30,14 +30,8 @@ bool msg_flag;                       /* Used in msg_print() for "buffering" */
 
 s16b running;                  /* Current counter for running, if any */
 
-GAME_TURN old_battle;
-
 s16b signal_count;             /* Hack -- Count interupts */
 
-bool inkey_base;               /* See the "inkey()" function */
-bool inkey_xtra;               /* See the "inkey()" function */
-bool inkey_scan;               /* See the "inkey()" function */
-bool inkey_flag;               /* See the "inkey()" function */
 bool get_com_no_macros = FALSE;        /* Expand macros in "get_com" or not */
 
 OBJECT_SUBTYPE_VALUE coin_type;        /* Hack -- force coin type */
index f733386..64f15a8 100644 (file)
@@ -1,12 +1,15 @@
 #pragma once
 
 typedef struct {
+
        POSITION max_wild_x; /*!< Maximum size of the wilderness */
        POSITION max_wild_y; /*!< Maximum size of the wilderness */
        GAME_TURN game_turn;                    /*!< 画面表示上のゲーム時間基準となるターン / Current game turn */
        GAME_TURN game_turn_limit;              /*!< game_turnの最大値 / Limit of game_turn */
        GAME_TURN dungeon_turn;                 /*!< NASTY生成の計算に関わる内部ターン値 / Game current_world_ptr->game_turn in dungeon */
        GAME_TURN dungeon_turn_limit;   /*!< dungeon_turnの最大値 / Limit of game_turn in dungeon */
+       GAME_TURN arena_start_turn;             /*!< 闘技場賭博の開始ターン値 */
+
        MONSTER_IDX timewalk_m_idx;     /*!< 現在時間停止を行っているモンスターのID */
 
        MONRACE_IDX bounty_r_idx[MAX_KUBI];