• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

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


Commit MetaInfo

Revision1cf31e3075839e3dbed0161a000497a91b6ae3cb (tree)
Time2019-02-28 20:44:39
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

[Refactor] #38995 world_type 構造体に dungeon_turn_limit を取り込む。 / Move dungeon_turn_limit to world_type structure.

Change Summary

Incremental Difference

--- a/src/birth.c
+++ b/src/birth.c
@@ -1906,7 +1906,7 @@ static void init_turn(void)
19061906 }
19071907
19081908 current_world_ptr->dungeon_turn = 1;
1909- dungeon_turn_limit = TURNS_PER_TICK * TOWN_DAWN * (MAX_DAYS - 1) + TURNS_PER_TICK * TOWN_DAWN * 3 / 4;
1909+ current_world_ptr->dungeon_turn_limit = TURNS_PER_TICK * TOWN_DAWN * (MAX_DAYS - 1) + TURNS_PER_TICK * TOWN_DAWN * 3 / 4;
19101910 }
19111911
19121912
--- a/src/bldg.c
+++ b/src/bldg.c
@@ -1948,10 +1948,10 @@ static bool inn_comm(int cmd)
19481948 do_cmd_write_nikki(NIKKI_BUNSHOU, 0, _("宿屋に泊まった。", "stay over night at the inn."));
19491949
19501950 current_world_ptr->game_turn = (current_world_ptr->game_turn / (TURNS_PER_TICK * TOWN_DAWN / 2) + 1) * (TURNS_PER_TICK * TOWN_DAWN / 2);
1951- if (current_world_ptr->dungeon_turn < dungeon_turn_limit)
1951+ if (current_world_ptr->dungeon_turn < current_world_ptr->dungeon_turn_limit)
19521952 {
19531953 current_world_ptr->dungeon_turn += MIN((current_world_ptr->game_turn - oldturn), TURNS_PER_TICK * 250) * INN_DUNGEON_TURN_ADJ;
1954- if (current_world_ptr->dungeon_turn > dungeon_turn_limit) current_world_ptr->dungeon_turn = dungeon_turn_limit;
1954+ if (current_world_ptr->dungeon_turn > current_world_ptr->dungeon_turn_limit) current_world_ptr->dungeon_turn = current_world_ptr->dungeon_turn_limit;
19551955 }
19561956
19571957 prevent_turn_overflow();
--- a/src/dungeon.c
+++ b/src/dungeon.c
@@ -5498,7 +5498,7 @@ static void dungeon(bool load_game)
54985498 /* Count game turns */
54995499 current_world_ptr->game_turn++;
55005500
5501- if (current_world_ptr->dungeon_turn < dungeon_turn_limit)
5501+ if (current_world_ptr->dungeon_turn < current_world_ptr->dungeon_turn_limit)
55025502 {
55035503 if (!p_ptr->wild_mode || wild_regen) current_world_ptr->dungeon_turn++;
55045504 else if (p_ptr->wild_mode && !(current_world_ptr->game_turn % ((MAX_HGT + MAX_WID) / 2))) current_world_ptr->dungeon_turn++;
--- a/src/externs.h
+++ b/src/externs.h
@@ -160,7 +160,6 @@ extern bool msg_flag;
160160 extern s16b running;
161161 extern GAME_TURN resting;
162162 extern bool invoking_midnight_curse;
163-extern GAME_TURN dungeon_turn_limit;
164163 extern GAME_TURN old_turn;
165164 extern GAME_TURN old_battle;
166165 extern bool use_sound;
--- a/src/load.c
+++ b/src/load.c
@@ -2262,7 +2262,7 @@ static void rd_extra(void)
22622262 current_world_ptr->game_turn_limit = TURNS_PER_TICK * TOWN_DAWN * (MAX_DAYS - 1) + TURNS_PER_TICK * TOWN_DAWN * 3 / 4;
22632263 break;
22642264 }
2265- dungeon_turn_limit = TURNS_PER_TICK * TOWN_DAWN * (MAX_DAYS - 1) + TURNS_PER_TICK * TOWN_DAWN * 3 / 4;
2265+ current_world_ptr->dungeon_turn_limit = TURNS_PER_TICK * TOWN_DAWN * (MAX_DAYS - 1) + TURNS_PER_TICK * TOWN_DAWN * 3 / 4;
22662266
22672267 /* Turn when level began */
22682268 rd_s32b(&old_turn);
--- a/src/spells-world.c
+++ b/src/spells-world.c
@@ -9,13 +9,13 @@ bool set_gametime(void)
99 int tmp_int = 0;
1010 char ppp[80], tmp_val[40];
1111
12- sprintf(ppp, "Dungeon Turn (0-%ld): ", (long)dungeon_turn_limit);
12+ sprintf(ppp, "Dungeon Turn (0-%ld): ", (long)current_world_ptr->dungeon_turn_limit);
1313 sprintf(tmp_val, "%ld", (long)current_world_ptr->dungeon_turn);
1414 if (!get_string(ppp, tmp_val, 10)) return (FALSE);
1515 tmp_int = atoi(tmp_val);
1616
1717 /* Verify */
18- if (tmp_int >= dungeon_turn_limit) tmp_int = dungeon_turn_limit - 1;
18+ if (tmp_int >= current_world_ptr->dungeon_turn_limit) tmp_int = current_world_ptr->dungeon_turn_limit - 1;
1919 else if (tmp_int < 0) tmp_int = 0;
2020 current_world_ptr->dungeon_turn = current_world_ptr->game_turn = tmp_int;
2121 return (TRUE);
--- a/src/types.h
+++ b/src/types.h
@@ -1904,5 +1904,6 @@ typedef struct {
19041904 GAME_TURN game_turn; /*!< 画面表示上のゲーム時間基準となるターン / Current game turn */
19051905 GAME_TURN game_turn_limit; /*!< game_turnの最大値 / Limit of game_turn */
19061906 GAME_TURN dungeon_turn; /*!< NASTY生成の計算に関わる内部ターン値 / Game current_world_ptr->game_turn in dungeon */
1907+ GAME_TURN dungeon_turn_limit; /*!< dungeon_turnの最大値 / Limit of game_turn in dungeon */
19071908
19081909 } world_type;
--- a/src/variable.c
+++ b/src/variable.c
@@ -113,7 +113,6 @@ GAME_TURN resting; /* Current counter for resting, if any */
113113
114114 bool invoking_midnight_curse; /*!< 悪夢モード時の真夜中太古の呪い発生処理フラグ */
115115
116-GAME_TURN dungeon_turn_limit; /*!< current_world_ptr->dungeon_turnの最大値 / Limit of game current_world_ptr->game_turn in dungeon */
117116 GAME_TURN old_turn; /* Turn when level began */
118117 GAME_TURN old_battle;
119118
Show on old repository browser