*/
void teleport_level(PlayerType *player_ptr, MONSTER_IDX m_idx)
{
- GAME_TEXT m_name[160];
+ std::string m_name;
auto see_m = true;
auto &floor_ref = *player_ptr->current_floor_ptr;
if (m_idx <= 0) {
- strcpy(m_name, _("あなた", "you"));
+ m_name = _("あなた", "you");
} else {
auto *m_ptr = &floor_ref.m_list[m_idx];
- monster_desc(player_ptr, m_name, m_ptr, 0);
+ m_name = monster_desc(player_ptr, m_ptr, 0);
see_m = is_seen(player_ptr, m_ptr);
}
if ((ironman_downward && (m_idx <= 0)) || (floor_ref.dun_level <= dungeons_info[player_ptr->dungeon_idx].mindepth)) {
#ifdef JP
if (see_m) {
- msg_format("%^sは床を突き破って沈んでいく。", m_name);
+ msg_format("%^sは床を突き破って沈んでいく。", m_name.data());
}
#else
if (see_m) {
- msg_format("%^s sink%s through the floor.", m_name, (m_idx <= 0) ? "" : "s");
+ msg_format("%^s sink%s through the floor.", m_name.data(), (m_idx <= 0) ? "" : "s");
}
#endif
if (m_idx <= 0) {
} else if (inside_quest(quest_number(player_ptr, floor_ref.dun_level)) || (floor_ref.dun_level >= dungeons_info[player_ptr->dungeon_idx].maxdepth)) {
#ifdef JP
if (see_m) {
- msg_format("%^sは天井を突き破って宙へ浮いていく。", m_name);
+ msg_format("%^sは天井を突き破って宙へ浮いていく。", m_name.data());
}
#else
if (see_m) {
- msg_format("%^s rise%s up through the ceiling.", m_name, (m_idx <= 0) ? "" : "s");
+ msg_format("%^s rise%s up through the ceiling.", m_name.data(), (m_idx <= 0) ? "" : "s");
}
#endif
} else if (go_up) {
#ifdef JP
if (see_m) {
- msg_format("%^sは天井を突き破って宙へ浮いていく。", m_name);
+ msg_format("%^sは天井を突き破って宙へ浮いていく。", m_name.data());
}
#else
if (see_m) {
- msg_format("%^s rise%s up through the ceiling.", m_name, (m_idx <= 0) ? "" : "s");
+ msg_format("%^s rise%s up through the ceiling.", m_name.data(), (m_idx <= 0) ? "" : "s");
}
#endif
} else {
#ifdef JP
if (see_m) {
- msg_format("%^sは床を突き破って沈んでいく。", m_name);
+ msg_format("%^sは床を突き破って沈んでいく。", m_name.data());
}
#else
if (see_m) {
- msg_format("%^s sink%s through the floor.", m_name, (m_idx <= 0) ? "" : "s");
+ msg_format("%^s sink%s through the floor.", m_name.data(), (m_idx <= 0) ? "" : "s");
}
#endif
auto *m_ptr = &floor_ref.m_list[m_idx];
QuestCompletionChecker(player_ptr, m_ptr).complete();
- if (record_named_pet && m_ptr->is_pet() && m_ptr->nickname) {
- char m2_name[MAX_NLEN];
-
- monster_desc(player_ptr, m2_name, m_ptr, MD_INDEF_VISIBLE);
- exe_write_diary(player_ptr, DIARY_NAMED_PET, RECORD_NAMED_PET_TELE_LEVEL, m2_name);
+ if (record_named_pet && m_ptr->is_named_pet()) {
+ const auto m2_name = monster_desc(player_ptr, m_ptr, MD_INDEF_VISIBLE);
+ exe_write_diary(player_ptr, DIARY_NAMED_PET, RECORD_NAMED_PET_TELE_LEVEL, m2_name.data());
}
delete_monster_idx(player_ptr, m_idx);
MonsterRaceInfo *r_ptr;
m_ptr = &player_ptr->current_floor_ptr->m_list[target_m_idx];
r_ptr = &monraces_info[m_ptr->r_idx];
- GAME_TEXT m_name[MAX_NLEN];
- monster_desc(player_ptr, m_name, m_ptr, 0);
- msg_format(_("%^sの足を指さした。", "You gesture at %^s's feet."), m_name);
+ const auto m_name = monster_desc(player_ptr, m_ptr, 0);
+ msg_format(_("%^sの足を指さした。", "You gesture at %^s's feet."), m_name.data());
auto has_immune = r_ptr->resistance_flags.has_any_of(RFR_EFF_RESIST_NEXUS_MASK) || r_ptr->resistance_flags.has(MonsterResistanceType::RESIST_TELEPORT);
if (has_immune || (r_ptr->flags1 & RF1_QUESTOR) || (r_ptr->level + randint1(50) > player_ptr->lev + randint1(60))) {
- msg_format(_("しかし効果がなかった!", "%^s is unaffected!"), m_name);
+ msg_format(_("しかし効果がなかった!", "%^s is unaffected!"), m_name.data());
} else {
teleport_level(player_ptr, target_m_idx);
}