OSDN Git Service

[Refactor] #1389 Changed monap_type from struct to class MonsterAttackPlayer
[hengbandforosx/hengbandosx.git] / src / monster-attack / monster-attack-lose.cpp
index 4a3d5b2..3ec45ee 100644 (file)
 
 /*!
  * @brief 病気ダメージを計算する (毒耐性があれば、(1d4 + 4) / 9になる。二重耐性なら更に(1d4 + 4) / 9)
- * @param player_ptr ã\83\97ã\83¬ã\83¼ヤーへの参照ポインタ
- * @param monap_ptr ã\83¢ã\83³ã\82¹ã\82¿ã\83¼ã\81\8bã\82\89ã\83\97ã\83¬ã\83¼ヤーへの直接攻撃構造体への参照ポインタ
+ * @param player_ptr ã\83\97ã\83¬ã\82¤ヤーへの参照ポインタ
+ * @param monap_ptr ã\83¢ã\83³ã\82¹ã\82¿ã\83¼ã\81\8bã\82\89ã\83\97ã\83¬ã\82¤ヤーへの直接攻撃構造体への参照ポインタ
  * @details 10% (毒の一次耐性があれば4%、二重耐性ならば1.6%)の確率で耐久が低下し、更に1/10の確率で永久低下する
  */
-void calc_blow_disease(player_type *player_ptr, monap_type *monap_ptr)
+void calc_blow_disease(PlayerType *player_ptr, MonsterAttackPlayer *monap_ptr)
 {
     if (has_resist_pois(player_ptr))
         monap_ptr->damage = monap_ptr->damage * (randint1(4) + 4) / 9;
@@ -29,11 +29,11 @@ void calc_blow_disease(player_type *player_ptr, monap_type *monap_ptr)
     if (player_ptr->is_dead || check_multishadow(player_ptr))
         return;
 
-    if (!(has_resist_pois(player_ptr) || is_oppose_pois(player_ptr)) && set_poisoned(player_ptr, player_ptr->poisoned + randint1(monap_ptr->rlev) + 5))
+    if (!(has_resist_pois(player_ptr) || is_oppose_pois(player_ptr)) && BadStatusSetter(player_ptr).mod_poison(randint1(monap_ptr->rlev) + 5))
         monap_ptr->obvious = true;
 
     bool disease_possibility = randint1(100) > calc_nuke_damage_rate(player_ptr);
-    if (disease_possibility || (randint1(100) > 10) || (player_ptr->prace == player_race_type::ANDROID))
+    if (disease_possibility || (randint1(100) > 10) || (player_ptr->prace == PlayerRaceType::ANDROID))
         return;
 
     bool perm = one_in_(10);
@@ -45,10 +45,10 @@ void calc_blow_disease(player_type *player_ptr, monap_type *monap_ptr)
 
 /*!
  * @brief 腕力低下ダメージを計算する (維持があれば、(1d4 + 4) / 9になる)
- * @param player_ptr ã\83\97ã\83¬ã\83¼ヤーへの参照ポインタ
- * @param monap_ptr ã\83¢ã\83³ã\82¹ã\82¿ã\83¼ã\81\8bã\82\89ã\83\97ã\83¬ã\83¼ヤーへの直接攻撃構造体への参照ポインタ
+ * @param player_ptr ã\83\97ã\83¬ã\82¤ヤーへの参照ポインタ
+ * @param monap_ptr ã\83¢ã\83³ã\82¹ã\82¿ã\83¼ã\81\8bã\82\89ã\83\97ã\83¬ã\82¤ヤーへの直接攻撃構造体への参照ポインタ
  */
-void calc_blow_lose_strength(player_type *player_ptr, monap_type *monap_ptr)
+void calc_blow_lose_strength(PlayerType *player_ptr, MonsterAttackPlayer *monap_ptr)
 {
     if (has_sustain_str(player_ptr))
         monap_ptr->get_damage = monap_ptr->get_damage * (randint1(4) + 4) / 9;
@@ -63,10 +63,10 @@ void calc_blow_lose_strength(player_type *player_ptr, monap_type *monap_ptr)
 
 /*!
  * @brief 知能低下ダメージを計算する (維持があれば、(1d4 + 4) / 9になる)
- * @param player_ptr ã\83\97ã\83¬ã\83¼ヤーへの参照ポインタ
- * @param monap_ptr ã\83¢ã\83³ã\82¹ã\82¿ã\83¼ã\81\8bã\82\89ã\83\97ã\83¬ã\83¼ヤーへの直接攻撃構造体への参照ポインタ
+ * @param player_ptr ã\83\97ã\83¬ã\82¤ヤーへの参照ポインタ
+ * @param monap_ptr ã\83¢ã\83³ã\82¹ã\82¿ã\83¼ã\81\8bã\82\89ã\83\97ã\83¬ã\82¤ヤーへの直接攻撃構造体への参照ポインタ
  */
-void calc_blow_lose_intelligence(player_type *player_ptr, monap_type *monap_ptr)
+void calc_blow_lose_intelligence(PlayerType *player_ptr, MonsterAttackPlayer *monap_ptr)
 {
     if (has_sustain_int(player_ptr))
         monap_ptr->get_damage = monap_ptr->get_damage * (randint1(4) + 4) / 9;
@@ -81,10 +81,10 @@ void calc_blow_lose_intelligence(player_type *player_ptr, monap_type *monap_ptr)
 
 /*!
  * @brief 賢さ低下ダメージを計算する (維持があれば、(1d4 + 4) / 9になる)
- * @param player_ptr ã\83\97ã\83¬ã\83¼ヤーへの参照ポインタ
- * @param monap_ptr ã\83¢ã\83³ã\82¹ã\82¿ã\83¼ã\81\8bã\82\89ã\83\97ã\83¬ã\83¼ヤーへの直接攻撃構造体への参照ポインタ
+ * @param player_ptr ã\83\97ã\83¬ã\82¤ヤーへの参照ポインタ
+ * @param monap_ptr ã\83¢ã\83³ã\82¹ã\82¿ã\83¼ã\81\8bã\82\89ã\83\97ã\83¬ã\82¤ヤーへの直接攻撃構造体への参照ポインタ
  */
-void calc_blow_lose_wisdom(player_type *player_ptr, monap_type *monap_ptr)
+void calc_blow_lose_wisdom(PlayerType *player_ptr, MonsterAttackPlayer *monap_ptr)
 {
     if (has_sustain_wis(player_ptr))
         monap_ptr->get_damage = monap_ptr->get_damage * (randint1(4) + 4) / 9;
@@ -99,10 +99,10 @@ void calc_blow_lose_wisdom(player_type *player_ptr, monap_type *monap_ptr)
 
 /*!
  * @brief 器用低下ダメージを計算する (維持があれば、(1d4 + 4) / 9になる)
- * @param player_ptr ã\83\97ã\83¬ã\83¼ヤーへの参照ポインタ
- * @param monap_ptr ã\83¢ã\83³ã\82¹ã\82¿ã\83¼ã\81\8bã\82\89ã\83\97ã\83¬ã\83¼ヤーへの直接攻撃構造体への参照ポインタ
+ * @param player_ptr ã\83\97ã\83¬ã\82¤ヤーへの参照ポインタ
+ * @param monap_ptr ã\83¢ã\83³ã\82¹ã\82¿ã\83¼ã\81\8bã\82\89ã\83\97ã\83¬ã\82¤ヤーへの直接攻撃構造体への参照ポインタ
  */
-void calc_blow_lose_dexterity(player_type *player_ptr, monap_type *monap_ptr)
+void calc_blow_lose_dexterity(PlayerType *player_ptr, MonsterAttackPlayer *monap_ptr)
 {
     if (has_sustain_dex(player_ptr))
         monap_ptr->get_damage = monap_ptr->get_damage * (randint1(4) + 4) / 9;
@@ -117,10 +117,10 @@ void calc_blow_lose_dexterity(player_type *player_ptr, monap_type *monap_ptr)
 
 /*!
  * @brief 耐久低下ダメージを計算する (維持があれば、(1d4 + 4) / 9になる)
- * @param player_ptr ã\83\97ã\83¬ã\83¼ヤーへの参照ポインタ
- * @param monap_ptr ã\83¢ã\83³ã\82¹ã\82¿ã\83¼ã\81\8bã\82\89ã\83\97ã\83¬ã\83¼ヤーへの直接攻撃構造体への参照ポインタ
+ * @param player_ptr ã\83\97ã\83¬ã\82¤ヤーへの参照ポインタ
+ * @param monap_ptr ã\83¢ã\83³ã\82¹ã\82¿ã\83¼ã\81\8bã\82\89ã\83\97ã\83¬ã\82¤ヤーへの直接攻撃構造体への参照ポインタ
  */
-void calc_blow_lose_constitution(player_type *player_ptr, monap_type *monap_ptr)
+void calc_blow_lose_constitution(PlayerType *player_ptr, MonsterAttackPlayer *monap_ptr)
 {
     if (has_sustain_con(player_ptr))
         monap_ptr->get_damage = monap_ptr->get_damage * (randint1(4) + 4) / 9;
@@ -135,10 +135,10 @@ void calc_blow_lose_constitution(player_type *player_ptr, monap_type *monap_ptr)
 
 /*!
  * @brief 魅力低下ダメージを計算する (維持があれば、(1d4 + 4) / 9になる)
- * @param player_ptr ã\83\97ã\83¬ã\83¼ヤーへの参照ポインタ
- * @param monap_ptr ã\83¢ã\83³ã\82¹ã\82¿ã\83¼ã\81\8bã\82\89ã\83\97ã\83¬ã\83¼ヤーへの直接攻撃構造体への参照ポインタ
+ * @param player_ptr ã\83\97ã\83¬ã\82¤ヤーへの参照ポインタ
+ * @param monap_ptr ã\83¢ã\83³ã\82¹ã\82¿ã\83¼ã\81\8bã\82\89ã\83\97ã\83¬ã\82¤ヤーへの直接攻撃構造体への参照ポインタ
  */
-void calc_blow_lose_charisma(player_type *player_ptr, monap_type *monap_ptr)
+void calc_blow_lose_charisma(PlayerType *player_ptr, MonsterAttackPlayer *monap_ptr)
 {
     if (has_sustain_chr(player_ptr))
         monap_ptr->get_damage = monap_ptr->get_damage * (randint1(4) + 4) / 9;
@@ -153,10 +153,10 @@ void calc_blow_lose_charisma(player_type *player_ptr, monap_type *monap_ptr)
 
 /*!
  * @brief 全能力低下ダメージを計算する (維持があれば、1つに付き-3%軽減する)
- * @param player_ptr ã\83\97ã\83¬ã\83¼ヤーへの参照ポインタ
- * @param monap_ptr ã\83¢ã\83³ã\82¹ã\82¿ã\83¼ã\81\8bã\82\89ã\83\97ã\83¬ã\83¼ヤーへの直接攻撃構造体への参照ポインタ
+ * @param player_ptr ã\83\97ã\83¬ã\82¤ヤーへの参照ポインタ
+ * @param monap_ptr ã\83¢ã\83³ã\82¹ã\82¿ã\83¼ã\81\8bã\82\89ã\83\97ã\83¬ã\82¤ヤーへの直接攻撃構造体への参照ポインタ
  */
-void calc_blow_lose_all(player_type *player_ptr, monap_type *monap_ptr)
+void calc_blow_lose_all(PlayerType *player_ptr, MonsterAttackPlayer *monap_ptr)
 {
     int damage_ratio = 100;
     if (has_sustain_str(player_ptr))