OSDN Git Service

[Refactor] #37353 total_winner を world_type へ移動. / Move total_winner to world_type...
authordeskull <deskull@users.sourceforge.jp>
Thu, 2 Jan 2020 07:16:30 +0000 (16:16 +0900)
committerdeskull <deskull@users.sourceforge.jp>
Thu, 2 Jan 2020 07:16:30 +0000 (16:16 +0900)
15 files changed:
src/birth.c
src/cmd/cmd-basic.c
src/core.c
src/files.c
src/load.c
src/monster1.c
src/player-damage.c
src/player-status.c
src/player-status.h
src/realm-hissatsu.c
src/save.c
src/scores.c
src/view-mainwindow.c
src/wild.c
src/world.h

index 1612569..ef1a61b 100644 (file)
@@ -1793,7 +1793,7 @@ static void player_wipe_without_name(player_type *creature_ptr)
        cheat_turn = FALSE;
 
        /* Assume no winning game */
-       creature_ptr->total_winner = FALSE;
+       current_world_ptr->total_winner = FALSE;
 
        creature_ptr->timewalk = FALSE;
 
index daafc7b..5919a1c 100644 (file)
@@ -2847,7 +2847,7 @@ void do_cmd_suicide(player_type *creature_ptr)
        flush();
 
        /* Verify Retirement */
-       if (creature_ptr->total_winner)
+       if (current_world_ptr->total_winner)
        {
                /* Verify */
                if (!get_check_strict(_("引退しますか? ", "Do you want to retire? "), CHECK_NO_HISTORY)) return;
@@ -2878,7 +2878,7 @@ void do_cmd_suicide(player_type *creature_ptr)
        creature_ptr->last_message = NULL;
 
        /* Hack -- Note *winning* message */
-       if (creature_ptr->total_winner && last_words)
+       if (current_world_ptr->total_winner && last_words)
        {
                char buf[1024] = "";
                play_music(TERM_XTRA_MUSIC_BASIC, MUSIC_BASIC_WINNER);
@@ -2901,7 +2901,7 @@ void do_cmd_suicide(player_type *creature_ptr)
        creature_ptr->is_dead = TRUE;
        creature_ptr->leaving = TRUE;
 
-       if (!creature_ptr->total_winner)
+       if (!current_world_ptr->total_winner)
        {
                exe_write_diary(creature_ptr, NIKKI_BUNSHOU, 0, _("ダンジョンの探索に絶望して自殺した。", "give up all hope to commit suicide."));
                exe_write_diary(creature_ptr, NIKKI_GAMESTART, 1, _("-------- ゲームオーバー --------", "--------   Game  Over   --------"));
index 7b01482..a5f4cde 100644 (file)
@@ -5787,7 +5787,7 @@ void close_game(void)
        if (p_ptr->is_dead)
        {
                /* Handle retirement */
-               if (p_ptr->total_winner) kingly(p_ptr);
+               if (current_world_ptr->total_winner) kingly(p_ptr);
 
                /* Save memories */
                if (!cheat_save || get_check(_("死んだデータをセーブしますか? ", "Save death? ")))
index aee117d..362b3c6 100644 (file)
@@ -3952,7 +3952,7 @@ void display_player(player_type *creature_ptr, int mode)
 
                        if (creature_ptr->is_dead)
                        {
-                               if (creature_ptr->total_winner)
+                               if (current_world_ptr->total_winner)
                                {
 #ifdef JP
                                        sprintf(statmsg, "…あなたは勝利の後%sした。", streq(creature_ptr->died_from, "Seppuku") ? "切腹" : "引退");
@@ -4505,7 +4505,7 @@ static void dump_aux_last_message(FILE *fff)
 {
        if (p_ptr->is_dead)
        {
-               if (!p_ptr->total_winner)
+               if (!current_world_ptr->total_winner)
                {
                        int i;
 
@@ -6187,7 +6187,7 @@ void print_tomb(void)
                }
 
                /* King or Queen */
-               if (p_ptr->total_winner || (p_ptr->lev > PY_MAX_LEVEL))
+               if (current_world_ptr->total_winner || (p_ptr->lev > PY_MAX_LEVEL))
                {
 #ifdef JP
                        /* 英日切り替え */
index a78adaf..4dd9677 100644 (file)
@@ -2261,7 +2261,7 @@ static void rd_extra(player_type *creature_ptr)
 
        /* Special stuff */
        rd_u16b(&creature_ptr->panic_save);
-       rd_u16b(&creature_ptr->total_winner);
+       rd_u16b(&current_world_ptr->total_winner);
        rd_u16b(&current_world_ptr->noscore);
 
 
index 8462763..02f9b3e 100644 (file)
@@ -3092,7 +3092,7 @@ void monster_death(MONSTER_IDX m_idx, bool drop_item)
        if ((m_ptr->r_idx == MON_SERPENT) && !cloned)
        {
                /* Total winner */
-               p_ptr->total_winner = TRUE;
+               current_world_ptr->total_winner = TRUE;
 
                /* Redraw the "title" */
                p_ptr->redraw |= (PR_TITLE);
index 30a4b93..01e3f72 100644 (file)
@@ -511,7 +511,7 @@ int take_hit(player_type *creature_ptr, int damage_type, HIT_POINT damage, concp
                {
                        QUEST_IDX q_idx = quest_number(p_ptr->current_floor_ptr->dun_level);
                        bool seppuku = streq(hit_from, "Seppuku");
-                       bool winning_seppuku = creature_ptr->total_winner && seppuku;
+                       bool winning_seppuku = current_world_ptr->total_winner && seppuku;
 
                        play_music(TERM_XTRA_MUSIC_BASIC, MUSIC_BASIC_GAMEOVER);
 
@@ -540,7 +540,7 @@ int take_hit(player_type *creature_ptr, int damage_type, HIT_POINT damage, concp
                        }
 
                        /* No longer a winner */
-                       creature_ptr->total_winner = FALSE;
+                       current_world_ptr->total_winner = FALSE;
 
                        if (winning_seppuku)
                        {
index 131de5b..650d07a 100644 (file)
@@ -5777,7 +5777,7 @@ long calc_score(player_type *creature_ptr)
        if ((creature_ptr->pseikaku == SEIKAKU_MUNCHKIN) && point)
        {
                point = 1;
-               if (creature_ptr->total_winner) point = 2;
+               if (current_world_ptr->total_winner) point = 2;
        }
        if (easy_band) point = (0 - point);
 
index 9c08ab0..87738d2 100644 (file)
@@ -419,7 +419,6 @@ struct player_type
        concptr last_message;        /* Last message on death or retirement */
        char history[4][60];      /* Textual "history" for the Player */
 
-       u16b total_winner;        /* Total winner */
        u16b panic_save;          /* Panic save */
 
        bool wait_report_score;   /* Waiting to report score */
index 4ce6c89..82e33f1 100644 (file)
@@ -20,6 +20,7 @@
 #include "targeting.h"
 #include "view-mainwindow.h"
 #include "spells-floor.h"
+#include "world.h"
 
 /*!
 * @brief 剣術の各処理を行う
@@ -938,10 +939,10 @@ concptr do_hissatsu_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mo
                        i = inkey();
                        prt("", 0, 0);
                        if (i != '@') return NULL;
-                       if (caster_ptr->total_winner)
+                       if (current_world_ptr->total_winner)
                        {
                                take_hit(caster_ptr, DAMAGE_FORCE, 9999, "Seppuku", -1);
-                               caster_ptr->total_winner = TRUE;
+                               current_world_ptr->total_winner = TRUE;
                        }
                        else
                        {
index ebb50ab..48c0b49 100644 (file)
@@ -824,7 +824,7 @@ static void wr_extra(player_type *creature_ptr)
 
        /* Special stuff */
        wr_u16b(creature_ptr->panic_save);
-       wr_u16b(creature_ptr->total_winner);
+       wr_u16b(current_world_ptr->total_winner);
        wr_u16b(current_world_ptr->noscore);
 
 
index e4177ae..64c036c 100644 (file)
@@ -969,7 +969,7 @@ bool check_score(void)
 #endif
 
        /* Interupted */
-       if (!p_ptr->total_winner && streq(p_ptr->died_from, _("強制終了", "Interrupting")))
+       if (!current_world_ptr->total_winner && streq(p_ptr->died_from, _("強制終了", "Interrupting")))
        {
                msg_print(_("強制終了のためスコアが記録されません。", "Score not registered due to interruption."));
                msg_print(NULL);
@@ -977,7 +977,7 @@ bool check_score(void)
        }
 
        /* Quitter */
-       if (!p_ptr->total_winner && streq(p_ptr->died_from, _("途中終了", "Quitting")))
+       if (!current_world_ptr->total_winner && streq(p_ptr->died_from, _("途中終了", "Quitting")))
        {
                msg_print(_("途中終了のためスコアが記録されません。", "Score not registered due to quitting."));
                msg_print(NULL);
index 2a1e566..1a8a18b 100644 (file)
@@ -749,7 +749,7 @@ static void prt_title(player_type *creature_ptr)
        {
                p = _("[ウィザード]", "[=-WIZARD-=]");
        }
-       else if (creature_ptr->total_winner || (creature_ptr->lev > PY_MAX_LEVEL))
+       else if (current_world_ptr->total_winner || (creature_ptr->lev > PY_MAX_LEVEL))
        {
                if (creature_ptr->arena_number > MAX_ARENA_MONS + 2)
                {
index 9224c5d..b1d6585 100644 (file)
@@ -435,7 +435,7 @@ static void generate_area(floor_type *floor_ptr, POSITION y, POSITION x, bool bo
                }
        }
 
-       if (wilderness[y][x].entrance && !wilderness[y][x].town && (p_ptr->total_winner || !(d_info[wilderness[y][x].entrance].flags1 & DF1_WINNER)))
+       if (wilderness[y][x].entrance && !wilderness[y][x].town && (current_world_ptr->total_winner || !(d_info[wilderness[y][x].entrance].flags1 & DF1_WINNER)))
        {
                int dy, dx;
                u32b state_backup[4];
@@ -732,7 +732,7 @@ void wilderness_gen_small(player_type *creature_ptr, floor_type *floor_ptr)
                        floor_ptr->grid_array[j][i].special = (s16b)wilderness[j][i].town;
                }
                else if (wilderness[j][i].road) floor_ptr->grid_array[j][i].feat = feat_floor;
-               else if (wilderness[j][i].entrance && (creature_ptr->total_winner || !(d_info[wilderness[j][i].entrance].flags1 & DF1_WINNER)))
+               else if (wilderness[j][i].entrance && (current_world_ptr->total_winner || !(d_info[wilderness[j][i].entrance].flags1 & DF1_WINNER)))
                {
                        floor_ptr->grid_array[j][i].feat = feat_entrance;
                        floor_ptr->grid_array[j][i].special = (byte)wilderness[j][i].entrance;
index 3a2f321..70211e0 100644 (file)
@@ -12,6 +12,7 @@ typedef struct {
        GAME_TURN arena_start_turn;             /*!< 闘技場賭博の開始ターン値 */
        u32b start_time;
        u16b noscore;             /* Cheating flags */
+       u16b total_winner;        /* Total winner */
 
        MONSTER_IDX timewalk_m_idx;     /*!< 現在時間停止を行っているモンスターのID */