OSDN Git Service

[Fix/Feature] 種族の食料タイプを設定 #820
[hengbandforosx/hengbandosx.git] / src / player / player-race.h
index 9fe51de..83ab2d0 100644 (file)
@@ -1,8 +1,8 @@
 #pragma once
 
+#include <optional>
 #include <unordered_map>
 #include <vector>
-#include <optional>
 
 #include "object-enchant/tr-types.h"
 #include "player-ability/player-ability-types.h"
 #define MIMIC_IS_UNDEAD 0x00000004
 
 /*!
- * プレイヤー種族の生命形態
+ * @brief プレイヤー種族の生命形態
  */
 enum class PlayerRaceLife {
-    LIVING = 0, //生きている
-    UNDEAD = 1, //不死
-    DEMON = 2, //悪魔
-    NONLIVING = 3, //生きてない
+    LIVING = 0, //!< 生きている
+    UNDEAD = 1, //!< 不死
+    DEMON = 2, //!< 悪魔
+    NONLIVING = 3, //!< 生きてない
     MAX
 };
 
+/*!
+ * @brief プレイヤー種族の食料形態
+ */
+enum class PlayerRaceFood {
+    RATION = 0, //!< 食料
+    WATER = 1, //!< 水
+    OIL = 2, //!< 油
+    BLOOD = 3, //!< 血
+    MANA = 4, //!< 魔力
+    CORPSE = 5, //!< 死体(捧げる)
+    MAX
+};
+
+/*!
+ * @brief プレイヤー種族の条件設定構造体
+ */
 struct player_race_condition {
     tr_type type{};
     PLAYER_LEVEL level{};
     std::optional<player_class_type> pclass{};
     bool not_class{};
 
-    player_race_condition(tr_type t, PLAYER_LEVEL l = 1, const std::optional<player_class_type>& c = std::nullopt, bool nc = false)
-        : type(t), level(l), pclass(c), not_class(nc) {}
+    player_race_condition(tr_type t, PLAYER_LEVEL l = 1, const std::optional<player_class_type> &c = std::nullopt, bool nc = false)
+        : type(t)
+        , level(l)
+        , pclass(c)
+        , not_class(nc)
+    {
+    }
 };
 
 /*!
- * p@brief プレイヤー種族構造体 / Player racial info
+ * @brief プレイヤー種族構造体 / Player racial info
  */
 struct player_race {
     concptr title{}; //!< 種族名 / Title of race
@@ -76,7 +97,7 @@ struct player_race {
     byte m_m_wt{}; //!< 体重加算範囲(男) / mod weight (males)
 
     byte f_b_ht{}; //!< 身長最小値(女) / base height (females)
-    byte f_m_ht{}; //!< 身長加算範囲(女) / mod height (females)  
+    byte f_m_ht{}; //!< 身長加算範囲(女) / mod height (females)
     byte f_b_wt{}; //!< 体重最小値(女) / base weight (females)
     byte f_m_wt{}; //!< 体重加算範囲(女) / mod weight (females)
 
@@ -84,6 +105,7 @@ struct player_race {
 
     u32b choice{}; //!< 似つかわしい職業(ミミック時はミミック種族属性) / Legal class choices
     PlayerRaceLife life{}; //!< 生命の形態
+    PlayerRaceFood food{}; //!< 食料の形態
 
     std::vector<player_race_condition> extra_flags;
 };
@@ -96,3 +118,4 @@ bool is_specific_player_race(player_type *creature_ptr, player_race_type prace);
 bool player_race_has_flag(player_type *creature_ptr, tr_type flag, bool base_race = false);
 void add_player_race_flags(player_type *creature_ptr, BIT_FLAGS *flags, bool base_race = false);
 PlayerRaceLife player_race_life(player_type *creature_ptr, bool base_race = false);
+PlayerRaceFood player_race_food(player_type *creature_ptr, bool base_race = false);