if (em_ptr->m_ptr->is_pet()) {
em_ptr->note = _("の動きが速くなった。", " starts moving faster.");
- (void)set_monster_fast(player_ptr, em_ptr->g_ptr->m_idx, monster_fast_remaining(em_ptr->m_ptr) + 100);
+ (void)set_monster_fast(player_ptr, em_ptr->g_ptr->m_idx, em_ptr->m_ptr->get_remaining_acceleration() + 100);
return true;
}
em_ptr->note = _("を支配した。", " is tamed!");
set_pet(player_ptr, em_ptr->m_ptr);
- (void)set_monster_fast(player_ptr, em_ptr->g_ptr->m_idx, monster_fast_remaining(em_ptr->m_ptr) + 100);
+ (void)set_monster_fast(player_ptr, em_ptr->g_ptr->m_idx, em_ptr->m_ptr->get_remaining_acceleration() + 100);
if (is_original_ap_and_seen(player_ptr, em_ptr->m_ptr)) {
em_ptr->r_ptr->r_kind_flags.set(MonsterKindType::GOOD);
}
em_ptr->obvious = true;
}
- if (set_monster_fast(player_ptr, em_ptr->g_ptr->m_idx, monster_fast_remaining(em_ptr->m_ptr) + 100)) {
+ if (set_monster_fast(player_ptr, em_ptr->g_ptr->m_idx, em_ptr->m_ptr->get_remaining_acceleration() + 100)) {
em_ptr->note = _("の動きが速くなった。", " starts moving faster.");
}
if (m_ptr->is_asleep()) {
(void)set_monster_csleep(player_ptr, i, 0);
}
- if (monster_fast_remaining(m_ptr)) {
+ if (m_ptr->is_accelerated()) {
(void)set_monster_fast(player_ptr, i, 0);
}
if (monster_slow_remaining(m_ptr)) {
speed += 5;
}
- if (monster_fast_remaining(m_ptr)) {
+ if (m_ptr->is_accelerated()) {
speed += 10;
}
if (monster_slow_remaining(m_ptr)) {
v = (v > 200) ? 200 : (v < 0) ? 0
: v;
if (v) {
- if (!monster_fast_remaining(m_ptr)) {
+ if (!m_ptr->is_accelerated()) {
mproc_add(floor_ptr, m_idx, MTIMED_FAST);
notice = true;
}
} else {
- if (monster_fast_remaining(m_ptr)) {
+ if (m_ptr->is_accelerated()) {
mproc_remove(floor_ptr, m_idx, MTIMED_FAST);
notice = true;
}
case MTIMED_FAST:
/* Reduce by one, note if expires */
- if (set_monster_fast(player_ptr, m_idx, monster_fast_remaining(m_ptr) - 1)) {
+ if (set_monster_fast(player_ptr, m_idx, m_ptr->get_remaining_acceleration() - 1)) {
if (is_seen(player_ptr, m_ptr)) {
GAME_TEXT m_name[MAX_NLEN];
monster_desc(player_ptr, m_name, m_ptr, 0);
}
}
-TIME_EFFECT monster_fast_remaining(monster_type *m_ptr)
-{
- return m_ptr->mtimed[MTIMED_FAST];
-}
-
TIME_EFFECT monster_slow_remaining(monster_type *m_ptr)
{
return m_ptr->mtimed[MTIMED_SLOW];
void process_monsters_mtimed(PlayerType *player_ptr, int mtimed_idx);
-TIME_EFFECT monster_fast_remaining(monster_type *m_ptr);
TIME_EFFECT monster_slow_remaining(monster_type *m_ptr);
TIME_EFFECT monster_stunned_remaining(monster_type *m_ptr);
TIME_EFFECT monster_confused_remaining(monster_type *m_ptr);
return true;
}
- if ((t_ptr->mspeed < 135) && monster_fast_remaining(t_ptr)) {
+ if ((t_ptr->mspeed < 135) && t_ptr->is_accelerated()) {
return true;
}
return true;
}
- if (player_ptr->riding && (player_ptr->current_floor_ptr->m_list[player_ptr->riding].mspeed < 135) && monster_fast_remaining(&player_ptr->current_floor_ptr->m_list[player_ptr->riding])) {
+ const auto &m_ref = player_ptr->current_floor_ptr->m_list[player_ptr->riding];
+ if (player_ptr->riding && (player_ptr->current_floor_ptr->m_list[player_ptr->riding].mspeed < 135) && m_ref.is_accelerated()) {
return true;
}
}
}
- if (!haste.empty() && (randint0(100) < 20) && !monster_fast_remaining(m_ptr)) {
+ if (!haste.empty() && (randint0(100) < 20) && !m_ptr->is_accelerated()) {
return haste[randint0(haste.size())];
}
monspell_message_base(player_ptr, m_idx, t_idx, msg, player_ptr->effects()->blindness()->is_blind(), target_type);
- if (set_monster_fast(player_ptr, m_idx, monster_fast_remaining(m_ptr) + 100)) {
+ if (set_monster_fast(player_ptr, m_idx, m_ptr->get_remaining_acceleration() + 100)) {
if (target_type == MONSTER_TO_PLAYER || (target_type == MONSTER_TO_MONSTER && see_m)) {
msg_format(_("%^sの動きが速くなった。", "%^s starts moving faster."), m_name);
}
}
bonus += (this->player_ptr->skill_exp[PlayerSkillKindType::RIDING] + this->player_ptr->lev * 160L) / 3200;
- if (monster_fast_remaining(riding_m_ptr)) {
+ if (riding_m_ptr->is_accelerated()) {
bonus += 10;
}
set_bits(*flags, SaveDataMonsterFlagType::CSLEEP);
}
- if (monster_fast_remaining(m_ptr)) {
+ if (m_ptr->is_accelerated()) {
set_bits(*flags, SaveDataMonsterFlagType::FAST);
}
if (player_has_los_bold(player_ptr, m_ptr->fy, m_ptr->fx)) {
if (!m_ptr->is_pet()) {
- (void)set_monster_fast(player_ptr, i, monster_fast_remaining(m_ptr) + 100);
+ (void)set_monster_fast(player_ptr, i, m_ptr->get_remaining_acceleration() + 100);
speed = true;
}
}
monster_desc(player_ptr, m_name, m_ptr, MD_IGNORE_HALLU | MD_INDEF_HIDDEN);
auto speed = m_ptr->mspeed - 110;
- if (monster_fast_remaining(m_ptr)) {
+ if (m_ptr->is_accelerated()) {
speed += 10;
}
if (monster_slow_remaining(m_ptr)) {
{
return this->get_remaining_sleep() > 0;
}
+
+short monster_type::get_remaining_acceleration() const
+{
+ return this->mtimed[MTIMED_FAST];
+}
+
+bool monster_type::is_accelerated() const
+{
+ return this->get_remaining_acceleration() > 0;
+}
MonsterRaceId get_real_r_idx() const;
monster_race &get_real_r_ref() const;
short get_remaining_sleep() const;
+ short get_remaining_acceleration() const;
bool is_asleep() const;
+ bool is_accelerated() const;
};
tmp_speed = 99;
}
} else {
- if (monster_fast_remaining(&player_ptr->current_floor_ptr->m_list[player_ptr->riding])) {
+ const auto &m_ref = player_ptr->current_floor_ptr->m_list[player_ptr->riding];
+ if (m_ref.is_accelerated()) {
tmp_speed += 10;
}
if (monster_slow_remaining(&player_ptr->current_floor_ptr->m_list[player_ptr->riding])) {
auto is_slow = player_ptr->effects()->deceleration()->is_slow();
if (player_ptr->riding) {
auto *m_ptr = &floor_ptr->m_list[player_ptr->riding];
- if (monster_fast_remaining(m_ptr) && !monster_slow_remaining(m_ptr)) {
+ if (m_ptr->is_accelerated() && !monster_slow_remaining(m_ptr)) {
attr = TERM_L_BLUE;
- } else if (monster_slow_remaining(m_ptr) && !monster_fast_remaining(m_ptr)) {
+ } else if (monster_slow_remaining(m_ptr) && !m_ptr->is_accelerated()) {
attr = TERM_VIOLET;
} else {
attr = TERM_GREEN;
auto is_slow = player_ptr->effects()->deceleration()->is_slow();
if (player_ptr->riding) {
auto *m_ptr = &floor_ptr->m_list[player_ptr->riding];
- if (monster_fast_remaining(m_ptr) && !monster_slow_remaining(m_ptr)) {
+ if (m_ptr->is_accelerated() && !monster_slow_remaining(m_ptr)) {
attr = TERM_L_BLUE;
- } else if (monster_slow_remaining(m_ptr) && !monster_fast_remaining(m_ptr)) {
+ } else if (monster_slow_remaining(m_ptr) && !m_ptr->is_accelerated()) {
attr = TERM_VIOLET;
} else {
attr = TERM_RED;