OSDN Git Service

[Refactor] #1710 Definitions QUEST_STATUS_* to enum class QuestStatusType
[hengbandforosx/hengbandosx.git] / src / birth / game-play-initializer.cpp
index cdb2b40..44b7203 100644 (file)
@@ -12,6 +12,7 @@
 #include "monster-race/race-flags7.h"
 #include "object/object-kind.h"
 #include "pet/pet-util.h"
+#include "player-base/player-race.h"
 #include "player-info/race-info.h"
 #include "player-info/race-types.h"
 #include "player/digestion-processor.h"
@@ -48,7 +49,7 @@ void player_wipe_without_name(player_type *player_ptr)
     if (player_ptr->last_message)
         string_free(player_ptr->last_message);
 
-    (void)WIPE(player_ptr, player_type);
+    *player_ptr = {};
 
     // TODO: キャラ作成からゲーム開始までに  current_floor_ptr を参照しなければならない処理は今後整理して外す。
     player_ptr->current_floor_ptr = &floor_info;
@@ -59,7 +60,7 @@ void player_wipe_without_name(player_type *player_ptr)
 
     for (int i = 0; i < max_q_idx; i++) {
         quest_type *const q_ptr = &quest[i];
-        q_ptr->status = QUEST_STATUS_UNTAKEN;
+        q_ptr->status = QuestStatusType::UNTAKEN;
         q_ptr->cur_num = 0;
         q_ptr->max_num = 0;
         q_ptr->type = 0;
@@ -128,7 +129,6 @@ void player_wipe_without_name(player_type *player_ptr)
     player_ptr->panic_save = 0;
 
     w_ptr->noscore = 0;
-    w_ptr->wizard = false;
     player_ptr->wait_report_score = false;
     player_ptr->pet_follow_distance = PET_FOLLOW_DIST;
     player_ptr->pet_extra_flags = (PF_TELEPORT | PF_ATTACK_SPELL | PF_SUMMON_SPELL);
@@ -139,21 +139,11 @@ void player_wipe_without_name(player_type *player_ptr)
     player_ptr->visit = 1;
     player_ptr->wild_mode = false;
 
-    for (int i = 0; i < MAX_SPELLS; i++) {
-        player_ptr->magic_num1[i] = 0;
-        player_ptr->magic_num2[i] = 0;
-    }
-
     player_ptr->max_plv = player_ptr->lev = 1;
     player_ptr->arena_number = 0;
     player_ptr->current_floor_ptr->inside_arena = false;
     player_ptr->current_floor_ptr->inside_quest = 0;
-    for (int i = 0; i < MAX_MANE; i++) {
-        player_ptr->mane_spell[i] = RF_ABILITY::MAX;
-        player_ptr->mane_dam[i] = 0;
-    }
 
-    player_ptr->mane_num = 0;
     player_ptr->exit_bldg = true;
     player_ptr->today_mon = 0;
     update_gambling_monsters(player_ptr);
@@ -191,7 +181,7 @@ void init_dungeon_quests(player_type *player_ptr)
     for (int i = MIN_RANDOM_QUEST + number_of_quests - 1; i >= MIN_RANDOM_QUEST; i--) {
         quest_type *q_ptr = &quest[i];
         monster_race *quest_r_ptr;
-        q_ptr->status = QUEST_STATUS_TAKEN;
+        q_ptr->status = QuestStatusType::TAKEN;
         determine_random_questor(player_ptr, q_ptr);
         quest_r_ptr = &r_info[q_ptr->r_idx];
         quest_r_ptr->flags1 |= RF1_QUESTOR;
@@ -201,11 +191,11 @@ void init_dungeon_quests(player_type *player_ptr)
     init_flags = INIT_ASSIGN;
     floor_ptr->inside_quest = QUEST_OBERON;
     parse_fixed_map(player_ptr, "q_info.txt", 0, 0, 0, 0);
-    quest[QUEST_OBERON].status = QUEST_STATUS_TAKEN;
+    quest[QUEST_OBERON].status = QuestStatusType::TAKEN;
 
     floor_ptr->inside_quest = QUEST_SERPENT;
     parse_fixed_map(player_ptr, "q_info.txt", 0, 0, 0, 0);
-    quest[QUEST_SERPENT].status = QUEST_STATUS_TAKEN;
+    quest[QUEST_SERPENT].status = QuestStatusType::TAKEN;
     floor_ptr->inside_quest = 0;
 }
 
@@ -217,7 +207,7 @@ void init_dungeon_quests(player_type *player_ptr)
  */
 void init_turn(player_type *player_ptr)
 {
-    if (player_race_life(player_ptr) == PlayerRaceLife::UNDEAD) {
+    if (PlayerRace(player_ptr).life() == PlayerRaceLife::UNDEAD) {
         w_ptr->game_turn = (TURNS_PER_TICK * 3 * TOWN_DAWN) / 4 + 1;
         w_ptr->game_turn_limit = TURNS_PER_TICK * TOWN_DAWN * MAX_DAYS + TURNS_PER_TICK * TOWN_DAWN * 3 / 4;
     } else {