OSDN Git Service

[Refactor] #963 Moved calculate_upkeep() from player-status.h to pet-util.h
[hengbandforosx/hengbandosx.git] / src / player / player-status.cpp
index 84b8546..67511eb 100644 (file)
@@ -3219,57 +3219,6 @@ void stop_mouth(player_type *caster_ptr)
         stop_hex_spell_all(caster_ptr);
 }
 
-/*!
- * @brief ペットの維持コスト計算
- * @return 維持コスト(%)
- */
-PERCENTAGE calculate_upkeep(player_type *creature_ptr)
-{
-    MONSTER_IDX m_idx;
-    bool has_a_unique = FALSE;
-    DEPTH total_friend_levels = 0;
-
-    total_friends = 0;
-
-    for (m_idx = creature_ptr->current_floor_ptr->m_max - 1; m_idx >= 1; m_idx--) {
-        monster_type *m_ptr;
-        monster_race *r_ptr;
-
-        m_ptr = &creature_ptr->current_floor_ptr->m_list[m_idx];
-        if (!monster_is_valid(m_ptr))
-            continue;
-        r_ptr = &r_info[m_ptr->r_idx];
-
-        if (is_pet(m_ptr)) {
-            total_friends++;
-            if (any_bits(r_ptr->flags1, RF1_UNIQUE)) {
-                if (creature_ptr->pclass == CLASS_CAVALRY) {
-                    if (creature_ptr->riding == m_idx)
-                        total_friend_levels += (r_ptr->level + 5) * 2;
-                    else if (!has_a_unique && any_bits(r_info[m_ptr->r_idx].flags7, RF7_RIDING))
-                        total_friend_levels += (r_ptr->level + 5) * 7 / 2;
-                    else
-                        total_friend_levels += (r_ptr->level + 5) * 10;
-                    has_a_unique = TRUE;
-                } else
-                    total_friend_levels += (r_ptr->level + 5) * 10;
-            } else
-                total_friend_levels += r_ptr->level;
-        }
-    }
-
-    if (total_friends) {
-        int upkeep_factor;
-        upkeep_factor = (total_friend_levels - (creature_ptr->lev * 80 / (cp_ptr->pet_upkeep_div)));
-        if (upkeep_factor < 0)
-            upkeep_factor = 0;
-        if (upkeep_factor > 1000)
-            upkeep_factor = 1000;
-        return upkeep_factor;
-    } else
-        return 0;
-}
-
 bool music_singing(player_type *caster_ptr, int music_songs)
 {
     return (caster_ptr->pclass == CLASS_BARD) && (caster_ptr->magic_num1[0] == music_songs);