+ * @param mm 移動方向
+ * @param m_idx モンスターID
+ * @return モンスターがペットであればTRUE
+ */
+bool decide_pet_movement_direction(player_type *target_ptr, DIRECTION *mm, MONSTER_IDX m_idx)
+{
+ monster_type *m_ptr = &target_ptr->current_floor_ptr->m_list[m_idx];
+ if (!is_pet(m_ptr)) return FALSE;
+
+ bool avoid = ((target_ptr->pet_follow_distance < 0) && (m_ptr->cdis <= (0 - target_ptr->pet_follow_distance)));
+ bool lonely = (!avoid && (m_ptr->cdis > target_ptr->pet_follow_distance));
+ bool distant = (m_ptr->cdis > PET_SEEK_DIST);
+ mm[0] = mm[1] = mm[2] = mm[3] = 5;
+ if (get_enemy_dir(target_ptr, m_idx, mm)) return TRUE;
+ if (!avoid && !lonely && !distant) return TRUE;
+
+ POSITION dis = target_ptr->pet_follow_distance;
+ if (target_ptr->pet_follow_distance > PET_SEEK_DIST)
+ {
+ target_ptr->pet_follow_distance = PET_SEEK_DIST;
+ }
+
+ (void)get_moves(target_ptr, m_idx, mm);
+ target_ptr->pet_follow_distance = (s16b)dis;
+ return TRUE;
+}
+
+
+/*!
+ * @brief ペットや友好的なモンスターがフロアから逃げる処理を行う
+ * @param target_ptr プレーヤーへの参照ポインタ