OSDN Git Service

[Refactor] struct player_type を class PlayerType に置換。
[hengbandforosx/hengbandosx.git] / src / player-ability / player-strength.cpp
index 3c30c12..af8236c 100644 (file)
 #include "system/player-type-definition.h"
 #include "util/bit-flags-calculator.h"
 
+PlayerStrength::PlayerStrength(PlayerType *player_ptr)
+    : PlayerBasicStatistics(player_ptr)
+{
+}
+
 void PlayerStrength::set_locals()
 {
     this->max_value = +99;
@@ -26,22 +31,12 @@ void PlayerStrength::set_locals()
 /*!
  * @brief 腕力補正計算 - 種族
  * @return 腕力補正値
- * @details
- * * 種族による腕力修正値。
- * * エントは別途レベル26,41,46到達ごとに加算(+1)
  */
 int16_t PlayerStrength::race_value()
 {
     int16_t result = PlayerBasicStatistics::race_value();
 
-    if (PlayerRace(this->player_ptr).equals(player_race_type::ENT)) {
-        if (this->player_ptr->lev > 25)
-            result++;
-        if (this->player_ptr->lev > 40)
-            result++;
-        if (this->player_ptr->lev > 45)
-            result++;
-    }
+    result += PlayerRace(this->player_ptr).additional_strength();
 
     return result;
 }
@@ -85,18 +80,18 @@ int16_t PlayerStrength::time_effect_value()
  * * 白虎の構えで加算(+2)
  * * 朱雀の構えで減算(-2)
  */
-int16_t PlayerStrength::battleform_value()
+int16_t PlayerStrength::stance_value()
 {
     int16_t result = 0;
 
     PlayerClass pc(player_ptr);
-    if (pc.samurai_stance_is(SamuraiStance::KOUKIJIN)) {
+    if (pc.samurai_stance_is(SamuraiStanceType::KOUKIJIN)) {
         result += 5;
     }
 
-    if (pc.monk_stance_is(MonkStance::BYAKKO)) {
+    if (pc.monk_stance_is(MonkStanceType::BYAKKO)) {
         result += 2;
-    } else if (pc.monk_stance_is(MonkStance::SUZAKU)) {
+    } else if (pc.monk_stance_is(MonkStanceType::SUZAKU)) {
         result -= 2;
     }
 
@@ -116,11 +111,11 @@ int16_t PlayerStrength::mutation_value()
     int16_t result = 0;
 
     if (this->player_ptr->muta.any()) {
-        if (this->player_ptr->muta.has(MUTA::HYPER_STR)) {
+        if (this->player_ptr->muta.has(PlayerMutationType::HYPER_STR)) {
             result += 4;
         }
 
-        if (this->player_ptr->muta.has(MUTA::PUNY)) {
+        if (this->player_ptr->muta.has(PlayerMutationType::PUNY)) {
             result -= 4;
         }
     }