msg_format(_("%sは%sに突き刺さった!", "%s^ is stuck in %s!"), item_name.data(), m_name.data());
}
- const auto pain_message = MonsterPainDescriber(player_ptr, c_mon_ptr->m_idx).describe(tdam);
+ const auto pain_message = MonsterPainDescriber(player_ptr, m_ptr).describe(tdam);
if (pain_message) {
msg_print(*pain_message);
}
if (!em_ptr->note.empty() && em_ptr->seen_msg) {
msg_format("%s^%s", em_ptr->m_name, em_ptr->note.data());
} else if (em_ptr->see_s_msg) {
- const auto pain_message = MonsterPainDescriber(player_ptr, em_ptr->g_ptr->m_idx).describe(em_ptr->dam);
+ const auto pain_message = MonsterPainDescriber(player_ptr, em_ptr->m_ptr).describe(em_ptr->dam);
if (pain_message) {
msg_print(*pain_message);
}
if (!em_ptr->note.empty() && em_ptr->seen) {
msg_format(_("%s%s", "%s^%s"), em_ptr->m_name, em_ptr->note.data());
} else if (em_ptr->known && (em_ptr->dam || !em_ptr->do_fear)) {
- const auto pain_message = MonsterPainDescriber(player_ptr, em_ptr->g_ptr->m_idx).describe(em_ptr->dam);
+ const auto pain_message = MonsterPainDescriber(player_ptr, em_ptr->m_ptr).describe(em_ptr->dam);
if (pain_message) {
msg_print(*pain_message);
}
{
}
-MonsterPainDescriber::MonsterPainDescriber(PlayerType *player_ptr, MONSTER_IDX m_idx)
- : MonsterPainDescriber(player_ptr, &player_ptr->current_floor_ptr->m_list[m_idx])
-{
-}
-
/*!
* @brief ダメージを受けたモンスターの様子を記述する
* @param dam モンスターが受けたダメージ
class MonsterPainDescriber {
public:
MonsterPainDescriber(PlayerType *player_ptr, const MonsterEntity *m_ptr);
- MonsterPainDescriber(PlayerType *player_ptr, MONSTER_IDX m_idx);
std::optional<std::string> describe(int dam);
if (mdp.mon_take_hit(this->m_ptr->get_died_message())) {
return;
}
-
- const auto pain_message = MonsterPainDescriber(player_ptr, this->g_ptr->m_idx).describe(this->tdam);
+ const auto pain_message = MonsterPainDescriber(player_ptr, this->m_ptr).describe(this->tdam);
if (pain_message) {
msg_print(*pain_message);
}