#include "monster/monster-processor.h"
#include "monster/monster-status.h"
#include "monster/monster-util.h"
+#include "pet/pet-util.h"
#include "player/player-status.h"
#include "player/special-defense-types.h"
#include "realm/realm-song-numbers.h"
#include "monster/monster-status.h"
#include "object-enchant/trc-types.h"
#include "pet/pet-fall-off.h"
+#include "pet/pet-util.h"
#include "player-info/avatar.h"
-#include "player/player-status.h"
#include "player/player-status-flags.h"
#include "util/bit-flags-calculator.h"
#include "spell/spells-diceroll.h"
#include "object-enchant/tr-types.h"
#include "object-enchant/trc-types.h"
#include "object/object-flags.h"
+#include "pet/pet-util.h"
#include "player-info/avatar.h"
#include "player/attack-defense-types.h"
#include "player/digestion-processor.h"
#include "monster/monster-info.h"
#include "monster/monster-status.h"
#include "monster/smart-learn-types.h"
-#include "player/player-status.h"
+#include "pet/pet-util.h"
#include "system/floor-type-definition.h"
#include "system/monster-race-definition.h"
#include "system/monster-type-definition.h"
#include "core/player-update-types.h"
#include "core/stuff-handler.h"
#include "grid/grid.h"
+#include "monster-race/monster-race.h"
+#include "monster-race/race-flags1.h"
+#include "monster-race/race-flags7.h"
#include "monster/monster-info.h"
+#include "monster/monster-status.h"
+#include "player/player-class.h"
+#include "system/floor-type-definition.h"
+#include "system/monster-race-definition.h"
+#include "system/monster-type-definition.h"
#include "system/player-type-definition.h"
+#include "util/bit-flags-calculator.h"
#include "world/world.h"
int total_friends = 0;
current_world_ptr->character_xtra = old_character_xtra;
return p_can_enter;
}
+
+/*!
+ * @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;
+}
#pragma once
+#include "system/angband.h"
+
enum pet_command {
PET_DISMISS = 1, /*!< ペットに関するコマンド: ペットを離す */
PET_TARGET = 2, /*!< ペットに関するコマンド: ペットのターゲットを指定 */
typedef struct grid_type grid_type;
typedef struct player_type player_type;
bool can_player_ride_pet(player_type *creature_ptr, grid_type *g_ptr, bool now_riding);
+PERCENTAGE calculate_upkeep(player_type *creature_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);
bool is_in_dungeon(player_type *creature_ptr);
void stop_mouth(player_type *caster_ptr);
-PERCENTAGE calculate_upkeep(player_type *creature_ptr);
bool music_singing(player_type *caster_ptr, int music_songs);
bool music_singing_any(player_type *creature_ptr);
#include "monster/monster-info.h"
#include "monster/monster-util.h"
#include "object-activation/activation-util.h"
-#include "player/player-status.h"
+#include "pet/pet-util.h"
#include "racial/racial-android.h"
#include "spell-kind/spells-launcher.h"
#include "spell/spell-types.h"