OSDN Git Service

Merge pull request #1522 from Slimebreath6078/feature/Rename_spell_msg
[hengbandforosx/hengbandosx.git] / src / world / world.h
1 #pragma once
2
3 #include "player-info/class-types.h"
4 #include "system/angband.h"
5 #include "util/flag-group.h"
6 #include "util/rng-xoshiro.h"
7
8 #define MAX_BOUNTY 20
9
10 /*!
11  * @brief 世界情報構造体
12  */
13 struct world_type {
14
15     POSITION max_wild_x{}; /*!< Maximum size of the wilderness */
16     POSITION max_wild_y{}; /*!< Maximum size of the wilderness */
17     GAME_TURN game_turn{}; /*!< 画面表示上のゲーム時間基準となるターン / Current game turn */
18     GAME_TURN game_turn_limit{}; /*!< game_turnの最大値 / Limit of game_turn */
19     GAME_TURN dungeon_turn{}; /*!< NASTY生成の計算に関わる内部ターン値 / Game turn in dungeon */
20     GAME_TURN dungeon_turn_limit{}; /*!< dungeon_turnの最大値 / Limit of game_turn in dungeon */
21     GAME_TURN arena_start_turn{}; /*!< 闘技場賭博の開始ターン値 */
22     uint32_t start_time{};
23     uint16_t noscore{}; /* Cheating flags */
24     uint16_t total_winner{}; /* Total winner */
25
26     MONSTER_IDX timewalk_m_idx{}; /*!< 現在時間停止を行っているモンスターのID */
27
28     MONRACE_IDX bounty_r_idx[MAX_BOUNTY]{};
29     MONSTER_IDX today_mon{}; //!< 実際の日替わり賞金首
30
31     uint32_t play_time{}; /*!< 実プレイ時間 */
32
33     Xoshiro128StarStar rng; //!< Uniform random bit generator for <random>
34
35     uint32_t seed_flavor{}; /* Hack -- consistent object colors */
36     uint32_t seed_town{}; /* Hack -- consistent town layout */
37
38     bool is_loading_now{}; /*!< ロード処理中フラグ...ロード直後にcalc_bonus()時の徳変化、及びsanity_blast()による異常を抑止する */
39
40     byte h_ver_major{}; //!< 変愚蛮怒バージョン(メジャー番号) / Hengband version (major ver.)
41     byte h_ver_minor{}; //!< 変愚蛮怒バージョン(マイナー番号) / Hengband version (minor ver.)
42     byte h_ver_patch{}; //!< 変愚蛮怒バージョン(パッチ番号) / Hengband version (patch ver.)
43     byte h_ver_extra{}; //!< 変愚蛮怒バージョン(エクストラ番号) / Hengband version (extra ver.)
44
45     byte sf_extra{}; //!< セーブファイルエンコードキー(XOR)
46
47     uint32_t sf_system{}; //!< OS情報 / OS information
48     uint32_t sf_when{}; //!< 作成日時 / Created Date
49     uint16_t sf_lives{}; //!< このセーブファイルで何人プレイしたか / Number of past "lives" with this file
50     uint16_t sf_saves{}; //!< 現在のプレイで何回セーブしたか / Number of "saves" during this life
51     uint32_t sf_play_time{}; //!< このセーブファイルで遊んだ合計のプレイ時間
52     FlagGroup<player_class_type, MAX_CLASS> sf_winner{}; //!< このセーブファイルで*勝利*した職業
53     FlagGroup<player_class_type, MAX_CLASS> sf_retired{}; //!< このセーブファイルで引退した職業
54
55     bool character_generated{}; /* The character exists */
56     bool character_dungeon{}; /* The character has a dungeon */
57     bool character_loaded{}; /* The character was loaded from a savefile */
58     bool character_saved{}; /* The character was just saved to a savefile */
59
60     byte character_icky_depth{}; /* The game is in an icky full screen mode */
61     bool character_xtra{}; /* The game is in an icky startup mode */
62
63     bool creating_savefile{}; /* New savefile is currently created */
64
65     OBJECT_IDX max_o_idx{}; /*!< Maximum number of objects in the level */
66     MONSTER_IDX max_m_idx{}; /*!< Maximum number of monsters in the level */
67 };
68
69 extern world_type *w_ptr;
70
71 struct player_type;
72 bool is_daytime(void);
73 void extract_day_hour_min(player_type *player_ptr, int *day, int *hour, int *min);
74 void update_playtime(void);
75 void add_winner_class(player_class_type c);
76 void add_retired_class(player_class_type c);
77 bool is_winner_class(player_class_type c);
78 bool is_retired_class(player_class_type c);