• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

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


Commit MetaInfo

Revision5dd228e1fd66eff8ddb9b18f869c8e8406621ece (tree)
Time2019-02-28 14:19:16
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

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

Change Summary

Incremental Difference

--- a/src/birth.c
+++ b/src/birth.c
@@ -1905,7 +1905,7 @@ static void init_turn(void)
19051905 current_world_ptr->game_turn_limit = TURNS_PER_TICK * TOWN_DAWN * (MAX_DAYS - 1) + TURNS_PER_TICK * TOWN_DAWN * 3 / 4;
19061906 }
19071907
1908- dungeon_turn = 1;
1908+ current_world_ptr->dungeon_turn = 1;
19091909 dungeon_turn_limit = TURNS_PER_TICK * TOWN_DAWN * (MAX_DAYS - 1) + TURNS_PER_TICK * TOWN_DAWN * 3 / 4;
19101910 }
19111911
--- 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 (dungeon_turn < dungeon_turn_limit)
1951+ if (current_world_ptr->dungeon_turn < dungeon_turn_limit)
19521952 {
1953- dungeon_turn += MIN((current_world_ptr->game_turn - oldturn), TURNS_PER_TICK * 250) * INN_DUNGEON_TURN_ADJ;
1954- if (dungeon_turn > dungeon_turn_limit) dungeon_turn = dungeon_turn_limit;
1953+ 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;
19551955 }
19561956
19571957 prevent_turn_overflow();
--- a/src/defines.h
+++ b/src/defines.h
@@ -313,7 +313,7 @@
313313 */
314314 #define TOWN_DAWN 10000 /*!< 1日分のターン / Number of ticks from dawn to dawn XXX */
315315 #define TURNS_PER_TICK 10L /*!< 時間経過処理を行うターン数の刻み / Number of energy-gain-turns per ticks */
316-#define INN_DUNGEON_TURN_ADJ 10 /*!< 宿屋で時間をつぶした場合に増えるdungeon_turnの倍率 */
316+#define INN_DUNGEON_TURN_ADJ 10 /*!< 宿屋で時間をつぶした場合に増えるcurrent_world_ptr->dungeon_turnの倍率 */
317317 #define MAX_DAYS 20000 /*!< 内部処理中で保持される最大日数 / Maximum days */
318318 #define BREAK_GLYPH 550 /*!< 守りのルーンの強靭度 / Rune of protection resistance */
319319 #define BREAK_MINOR_GLYPH 299 /*!< 爆発のルーンの発動しやすさ / For explosive runes */
--- a/src/dungeon.c
+++ b/src/dungeon.c
@@ -5498,10 +5498,10 @@ static void dungeon(bool load_game)
54985498 /* Count game turns */
54995499 current_world_ptr->game_turn++;
55005500
5501- if (dungeon_turn < dungeon_turn_limit)
5501+ if (current_world_ptr->dungeon_turn < dungeon_turn_limit)
55025502 {
5503- if (!p_ptr->wild_mode || wild_regen) dungeon_turn++;
5504- else if (p_ptr->wild_mode && !(current_world_ptr->game_turn % ((MAX_HGT + MAX_WID) / 2))) dungeon_turn++;
5503+ if (!p_ptr->wild_mode || wild_regen) current_world_ptr->dungeon_turn++;
5504+ else if (p_ptr->wild_mode && !(current_world_ptr->game_turn % ((MAX_HGT + MAX_WID) / 2))) current_world_ptr->dungeon_turn++;
55055505 }
55065506
55075507 prevent_turn_overflow();
--- 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;
164163 extern GAME_TURN dungeon_turn_limit;
165164 extern GAME_TURN old_turn;
166165 extern GAME_TURN old_battle;
--- a/src/load.c
+++ b/src/load.c
@@ -2282,16 +2282,16 @@ static void rd_extra(void)
22822282
22832283 if (z_older_than(10, 3, 12))
22842284 {
2285- dungeon_turn = current_world_ptr->game_turn;
2285+ current_world_ptr->dungeon_turn = current_world_ptr->game_turn;
22862286 }
2287- else rd_s32b(&dungeon_turn);
2287+ else rd_s32b(&current_world_ptr->dungeon_turn);
22882288
22892289 if (z_older_than(11, 0, 13))
22902290 {
22912291 old_turn /= 2;
22922292 p_ptr->feeling_turn /= 2;
22932293 current_world_ptr->game_turn /= 2;
2294- dungeon_turn /= 2;
2294+ current_world_ptr->dungeon_turn /= 2;
22952295 }
22962296
22972297 if (z_older_than(10, 3, 13))
--- a/src/monster2.c
+++ b/src/monster2.c
@@ -1254,8 +1254,8 @@ MONRACE_IDX get_mon_num(DEPTH level)
12541254 int pls_kakuritu, pls_level;
12551255 int delay = mysqrt(level * 10000L) + 400L;
12561256
1257- pls_kakuritu = MAX(NASTY_MON_MAX, NASTY_MON_BASE - ((dungeon_turn / (TURNS_PER_TICK * 5000L) - delay / 10)));
1258- pls_level = MIN(NASTY_MON_PLUS_MAX, 3 + dungeon_turn / (TURNS_PER_TICK * 40000L) - delay / 40 + MIN(5, level / 10)) ;
1257+ pls_kakuritu = MAX(NASTY_MON_MAX, NASTY_MON_BASE - ((current_world_ptr->dungeon_turn / (TURNS_PER_TICK * 5000L) - delay / 10)));
1258+ pls_level = MIN(NASTY_MON_PLUS_MAX, 3 + current_world_ptr->dungeon_turn / (TURNS_PER_TICK * 40000L) - delay / 40 + MIN(5, level / 10)) ;
12591259
12601260 if (d_info[p_ptr->dungeon_idx].flags1 & DF1_MAZE)
12611261 {
--- a/src/save.c
+++ b/src/save.c
@@ -828,7 +828,7 @@ static void wr_extra(void)
828828 /* Current current_world_ptr->game_turn */
829829 wr_s32b(current_world_ptr->game_turn);
830830
831- wr_s32b(dungeon_turn);
831+ wr_s32b(current_world_ptr->dungeon_turn);
832832
833833 wr_s32b(old_battle);
834834
--- a/src/spells-world.c
+++ b/src/spells-world.c
@@ -10,14 +10,14 @@ bool set_gametime(void)
1010 char ppp[80], tmp_val[40];
1111
1212 sprintf(ppp, "Dungeon Turn (0-%ld): ", (long)dungeon_turn_limit);
13- sprintf(tmp_val, "%ld", (long)dungeon_turn);
13+ 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 */
1818 if (tmp_int >= dungeon_turn_limit) tmp_int = dungeon_turn_limit - 1;
1919 else if (tmp_int < 0) tmp_int = 0;
20- dungeon_turn = current_world_ptr->game_turn = tmp_int;
20+ current_world_ptr->dungeon_turn = current_world_ptr->game_turn = tmp_int;
2121 return (TRUE);
2222
2323 }
--- a/src/types.h
+++ b/src/types.h
@@ -1903,5 +1903,6 @@ typedef struct {
19031903 POSITION max_wild_y;
19041904 GAME_TURN game_turn; /*!< 画面表示上のゲーム時間基準となるターン / Current game turn */
19051905 GAME_TURN game_turn_limit; /*!< game_turnの最大値 / Limit of game_turn */
1906+ GAME_TURN dungeon_turn; /*!< NASTY生成の計算に関わる内部ターン値 / Game current_world_ptr->game_turn in dungeon */
19061907
19071908 } world_type;
--- a/src/variable.c
+++ b/src/variable.c
@@ -113,8 +113,7 @@ GAME_TURN resting; /* Current counter for resting, if any */
113113
114114 bool invoking_midnight_curse; /*!< 悪夢モード時の真夜中太古の呪い発生処理フラグ */
115115
116-GAME_TURN dungeon_turn; /*!< NASTY生成の計算に関わる内部ターン値 / Game current_world_ptr->game_turn in dungeon */
117-GAME_TURN dungeon_turn_limit; /*!< dungeon_turnの最大値 / Limit of game current_world_ptr->game_turn in dungeon */
116+GAME_TURN dungeon_turn_limit; /*!< current_world_ptr->dungeon_turnの最大値 / Limit of game current_world_ptr->game_turn in dungeon */
118117 GAME_TURN old_turn; /* Turn when level began */
119118 GAME_TURN old_battle;
120119
@@ -155,6 +154,7 @@ MONSTER_IDX m_cnt = 0; /* Number of live monsters */
155154
156155 MONSTER_IDX hack_m_idx = 0; /* Hack -- see "process_monsters()" */
157156 MONSTER_IDX hack_m_idx_ii = 0;
157+
158158 bool multi_rew = FALSE;
159159 char summon_kin_type; /* Hack, by Julian Lighton: summon 'relatives' */
160160
Show on old repository browser