return FALSE;
}
- if (MON_CSLEEP(m_ptr))
+ if (monster_csleep_remaining(m_ptr))
{
if (!(r_ptr->flags3 & RF3_EVIL) || one_in_(5))
chg_virtue(attacker_ptr, V_COMPASSION, -1);
return FALSE;
}
- if (MON_CSLEEP(m_ptr))
+ if (monster_csleep_remaining(m_ptr))
{
GAME_TEXT m_name[MAX_NLEN];
monster_desc(creature_ptr, m_name, m_ptr, 0);
if (potion_smash_effect(creature_ptr, 0, y, x, q_ptr->k_idx))
{
monster_type *m_ptr = &creature_ptr->current_floor_ptr->m_list[creature_ptr->current_floor_ptr->grid_array[y][x].m_idx];
- if (creature_ptr->current_floor_ptr->grid_array[y][x].m_idx && is_friendly(m_ptr) && !MON_INVULNER(m_ptr))
+ if (creature_ptr->current_floor_ptr->grid_array[y][x].m_idx && is_friendly(m_ptr) && !monster_invulner_remaining(m_ptr))
{
GAME_TEXT m_name[MAX_NLEN];
monster_desc(creature_ptr, m_name, m_ptr, 0);
/* Note the collision */
hit_body = TRUE;
- if (MON_CSLEEP(m_ptr))
+ if (monster_csleep_remaining(m_ptr))
{
if (!(r_ptr->flags3 & RF3_EVIL) || one_in_(5)) chg_virtue(shooter_ptr, V_COMPASSION, -1);
if (!(r_ptr->flags3 & RF3_EVIL) || one_in_(5)) chg_virtue(shooter_ptr, V_HONOUR, -1);
ac /= 8;
}
- if (m_ptr->r_idx == MON_GOEMON && !MON_CSLEEP(m_ptr)) ac *= 3;
+ if (m_ptr->r_idx == MON_GOEMON && !monster_csleep_remaining(m_ptr)) ac *= 3;
/* Invisible monsters are harder to hit */
if (!vis) chance = (chance + 1) / 2;
/* Power competes against armor */
if (randint0(chance) < (ac * 3 / 4))
{
- if (m_ptr->r_idx == MON_GOEMON && !MON_CSLEEP(m_ptr))
+ if (m_ptr->r_idx == MON_GOEMON && !monster_csleep_remaining(m_ptr))
{
GAME_TEXT m_name[MAX_NLEN];
monster_desc(shooter_ptr, m_name, m_ptr, 0);
if (creature_ptr->riding && !creature_ptr->confused && !creature_ptr->blind) {
monster_type *m_ptr = &creature_ptr->current_floor_ptr->m_list[creature_ptr->riding];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
- if (MON_CSLEEP(m_ptr)) {
+ if (monster_csleep_remaining(m_ptr)) {
GAME_TEXT m_name[MAX_NLEN];
(void)set_monster_csleep(creature_ptr, creature_ptr->riding, 0);
monster_desc(creature_ptr, m_name, m_ptr, 0);
msg_format(_("%^sを起こした。", "You have woken %s up."), m_name);
}
- if (MON_STUNNED(m_ptr)) {
+ if (monster_stunned_remaining(m_ptr)) {
if (set_monster_stunned(
- creature_ptr, creature_ptr->riding, (randint0(r_ptr->level) < creature_ptr->skill_exp[GINOU_RIDING]) ? 0 : (MON_STUNNED(m_ptr) - 1))) {
+ creature_ptr, creature_ptr->riding, (randint0(r_ptr->level) < creature_ptr->skill_exp[GINOU_RIDING]) ? 0 : (monster_stunned_remaining(m_ptr) - 1))) {
GAME_TEXT m_name[MAX_NLEN];
monster_desc(creature_ptr, m_name, m_ptr, 0);
msg_format(_("%^sを朦朧状態から立ち直らせた。", "%^s is no longer stunned."), m_name);
}
}
- if (MON_CONFUSED(m_ptr)) {
+ if (monster_confused_remaining(m_ptr)) {
if (set_monster_confused(
- creature_ptr, creature_ptr->riding, (randint0(r_ptr->level) < creature_ptr->skill_exp[GINOU_RIDING]) ? 0 : (MON_CONFUSED(m_ptr) - 1))) {
+ creature_ptr, creature_ptr->riding, (randint0(r_ptr->level) < creature_ptr->skill_exp[GINOU_RIDING]) ? 0 : (monster_confused_remaining(m_ptr) - 1))) {
GAME_TEXT m_name[MAX_NLEN];
monster_desc(creature_ptr, m_name, m_ptr, 0);
msg_format(_("%^sを混乱状態から立ち直らせた。", "%^s is no longer confused."), m_name);
}
}
- if (MON_MONFEAR(m_ptr)) {
+ if (monster_fear_remaining(m_ptr)) {
if (set_monster_monfear(
- creature_ptr, creature_ptr->riding, (randint0(r_ptr->level) < creature_ptr->skill_exp[GINOU_RIDING]) ? 0 : (MON_MONFEAR(m_ptr) - 1))) {
+ creature_ptr, creature_ptr->riding, (randint0(r_ptr->level) < creature_ptr->skill_exp[GINOU_RIDING]) ? 0 : (monster_fear_remaining(m_ptr) - 1))) {
GAME_TEXT m_name[MAX_NLEN];
monster_desc(creature_ptr, m_name, m_ptr, 0);
msg_format(_("%^sを恐怖から立ち直らせた。", "%^s is no longer afraid."), m_name);
if (is_pet(em_ptr->m_ptr)) {
em_ptr->note = _("の動きが速くなった。", " starts moving faster.");
- (void)set_monster_fast(caster_ptr, em_ptr->g_ptr->m_idx, MON_FAST(em_ptr->m_ptr) + 100);
+ (void)set_monster_fast(caster_ptr, em_ptr->g_ptr->m_idx, monster_fast_remaining(em_ptr->m_ptr) + 100);
return TRUE;
}
em_ptr->note = _("を支配した。", " is tamed!");
set_pet(caster_ptr, em_ptr->m_ptr);
- (void)set_monster_fast(caster_ptr, em_ptr->g_ptr->m_idx, MON_FAST(em_ptr->m_ptr) + 100);
+ (void)set_monster_fast(caster_ptr, em_ptr->g_ptr->m_idx, monster_fast_remaining(em_ptr->m_ptr) + 100);
if (is_original_ap_and_seen(caster_ptr, em_ptr->m_ptr))
em_ptr->r_ptr->r_flags3 |= RF3_GOOD;
-#include "system/angband.h"
-#include "effect/effect-monster-util.h"
-#include "effect/effect-monster-oldies.h"
+#include "effect/effect-monster-oldies.h"
#include "floor/floor.h"
#include "monster-race/race-indice-types.h"
#include "monster/monster-status.h"
static void effect_monster_old_heal_recovery(player_type *caster_ptr, effect_monster_type *em_ptr)
{
- if (MON_STUNNED(em_ptr->m_ptr))
+ if (monster_stunned_remaining(em_ptr->m_ptr))
{
if (em_ptr->seen_msg)
msg_format(_("%^sは朦朧状態から立ち直った。", "%^s is no longer stunned."), em_ptr->m_name);
(void)set_monster_stunned(caster_ptr, em_ptr->g_ptr->m_idx, 0);
}
- if (MON_CONFUSED(em_ptr->m_ptr))
+ if (monster_confused_remaining(em_ptr->m_ptr))
{
if (em_ptr->seen_msg)
msg_format(_("%^sは混乱から立ち直った。", "%^s is no longer confused."), em_ptr->m_name);
(void)set_monster_confused(caster_ptr, em_ptr->g_ptr->m_idx, 0);
}
- if (MON_MONFEAR(em_ptr->m_ptr))
+ if (monster_fear_remaining(em_ptr->m_ptr))
{
if (em_ptr->seen_msg)
msg_format(_("%^sは勇気を取り戻した。", "%^s recovers %s courage."), em_ptr->m_name, em_ptr->m_poss);
{
if (em_ptr->seen) em_ptr->obvious = TRUE;
- if (set_monster_fast(caster_ptr, em_ptr->g_ptr->m_idx, MON_FAST(em_ptr->m_ptr) + 100))
+ if (set_monster_fast(caster_ptr, em_ptr->g_ptr->m_idx, monster_fast_remaining(em_ptr->m_ptr) + 100))
{
em_ptr->note = _("の動きが速くなった。", " starts moving faster.");
}
return GF_SWITCH_CONTINUE;
}
- if (set_monster_slow(caster_ptr, em_ptr->g_ptr->m_idx, MON_SLOW(em_ptr->m_ptr) + 50))
+ if (set_monster_slow(caster_ptr, em_ptr->g_ptr->m_idx, monster_slow_remaining(em_ptr->m_ptr) + 50))
em_ptr->note = _("の動きが遅くなった。", " starts moving slower.");
em_ptr->dam = 0;
#pragma once
+#include "system/angband.h"
+#include "effect/effect-monster-util.h"
+
gf_switch_result effect_monster_old_poly(effect_monster_type *em_ptr);
gf_switch_result effect_monster_old_clone(player_type *caster_ptr, effect_monster_type *em_ptr);
gf_switch_result effect_monster_star_heal(player_type *caster_ptr, effect_monster_type *em_ptr);
return GF_SWITCH_CONTINUE;
}
- if (set_monster_slow(caster_ptr, em_ptr->g_ptr->m_idx, MON_SLOW(em_ptr->m_ptr) + 50))
+ if (set_monster_slow(caster_ptr, em_ptr->g_ptr->m_idx, monster_slow_remaining(em_ptr->m_ptr) + 50))
em_ptr->note = _("の動きが遅くなった。", " starts moving slower.");
return GF_SWITCH_CONTINUE;
(em_ptr->r_ptr->level > randint1((em_ptr->dam - 10) < 1 ? 1 : (em_ptr->dam - 10)) + 10))
em_ptr->obvious = FALSE;
- if (set_monster_slow(caster_ptr, em_ptr->g_ptr->m_idx, MON_SLOW(em_ptr->m_ptr) + 50))
+ if (set_monster_slow(caster_ptr, em_ptr->g_ptr->m_idx, monster_slow_remaining(em_ptr->m_ptr) + 50))
em_ptr->note = _("の動きが遅くなった。", " starts moving slower.");
}
em_ptr->do_stun = randint0(8) + 8;
}
- (void)set_monster_slow(caster_ptr, em_ptr->g_ptr->m_idx, MON_SLOW(em_ptr->m_ptr) + 10);
+ (void)set_monster_slow(caster_ptr, em_ptr->g_ptr->m_idx, monster_slow_remaining(em_ptr->m_ptr) + 10);
}
return GF_SWITCH_CONTINUE;
return GF_SWITCH_CONTINUE;
}
- if (MON_CSLEEP(em_ptr->m_ptr))
+ if (monster_csleep_remaining(em_ptr->m_ptr))
{
em_ptr->note = _("には効果がなかった。", " is unaffected.");
em_ptr->dam = 0;
}
else
{
- if (set_monster_slow(caster_ptr, em_ptr->g_ptr->m_idx, MON_SLOW(em_ptr->m_ptr) + 50))
+ if (set_monster_slow(caster_ptr, em_ptr->g_ptr->m_idx, monster_slow_remaining(em_ptr->m_ptr) + 50))
{
em_ptr->note = _("の動きが遅くなった。", " starts moving slower.");
}
* @author Hourier
*/
-#include "system/angband.h"
#include "effect/effect-monster-util.h"
#include "floor/floor.h"
+#include "monster/monster-status.h"
/*!
* @brief affect_monster() に亘ってきた引数をeffect_monster_type構造体に代入する
em_ptr->r_ptr = &r_info[em_ptr->m_ptr->r_idx];
em_ptr->seen = em_ptr->m_ptr->ml;
em_ptr->seen_msg = is_seen(em_ptr->m_ptr);
- em_ptr->slept = (bool)MON_CSLEEP(em_ptr->m_ptr);
+ em_ptr->slept = (bool)monster_csleep_remaining(em_ptr->m_ptr);
em_ptr->obvious = FALSE;
em_ptr->known = ((em_ptr->m_ptr->cdis <= MAX_SIGHT) || caster_ptr->phase_out);
em_ptr->skipped = FALSE;
#pragma once
+#include "system/angband.h"
#include "grid/grid.h"
typedef struct effect_monster_type {
if (em_ptr->seen) em_ptr->obvious = TRUE;
- if (MON_STUNNED(em_ptr->m_ptr))
+ if (monster_stunned_remaining(em_ptr->m_ptr))
{
em_ptr->note = _("はひどくもうろうとした。", " is more dazed.");
- *stun_damage = MON_STUNNED(em_ptr->m_ptr) + (em_ptr->do_stun / 2);
+ *stun_damage = monster_stunned_remaining(em_ptr->m_ptr) + (em_ptr->do_stun / 2);
}
else
{
if (em_ptr->seen) em_ptr->obvious = TRUE;
- if (MON_CONFUSED(em_ptr->m_ptr))
+ if (monster_confused_remaining(em_ptr->m_ptr))
{
em_ptr->note = _("はさらに混乱したようだ。", " looks more confused.");
- *conf_damage = MON_CONFUSED(em_ptr->m_ptr) + (em_ptr->do_conf / 2);
+ *conf_damage = monster_confused_remaining(em_ptr->m_ptr) + (em_ptr->do_conf / 2);
}
else
{
process_monster_teleport(caster_ptr, em_ptr);
if (em_ptr->do_fear == 0) return;
- (void)set_monster_monfear(caster_ptr, em_ptr->g_ptr->m_idx, MON_MONFEAR(em_ptr->m_ptr) + em_ptr->do_fear);
+ (void)set_monster_monfear(caster_ptr, em_ptr->g_ptr->m_idx, monster_fear_remaining(em_ptr->m_ptr) + em_ptr->do_fear);
em_ptr->get_angry = TRUE;
}
int f_flag;
if (rad > 0)
{
- if (!(r_ptr->flags7 & (RF7_SELF_LITE_1 | RF7_SELF_LITE_2)) && (MON_CSLEEP(m_ptr) || (!floor_ptr->dun_level && is_daytime()) || subject_ptr->phase_out)) continue;
+ if (!(r_ptr->flags7 & (RF7_SELF_LITE_1 | RF7_SELF_LITE_2)) && (monster_csleep_remaining(m_ptr) || (!floor_ptr->dun_level && is_daytime()) || subject_ptr->phase_out)) continue;
if (d_info[subject_ptr->dungeon_idx].flags1 & DF1_DARKNESS) rad = 1;
add_mon_lite = mon_lite_hack;
f_flag = FF_LOS;
}
else
{
- if (!(r_ptr->flags7 & (RF7_SELF_DARK_1 | RF7_SELF_DARK_2)) && (MON_CSLEEP(m_ptr) || (!floor_ptr->dun_level && !is_daytime()))) continue;
+ if (!(r_ptr->flags7 & (RF7_SELF_DARK_1 | RF7_SELF_DARK_2)) && (monster_csleep_remaining(m_ptr) || (!floor_ptr->dun_level && !is_daytime()))) continue;
add_mon_lite = mon_dark_hack;
f_flag = FF_PROJECT;
rad = -rad; /* Use absolute value */
POSITION dis = distance(master_ptr->y, master_ptr->x, m_ptr->fy, m_ptr->fx);
/* Confused (etc.) monsters don't follow. */
- if (MON_CONFUSED(m_ptr) || MON_STUNNED(m_ptr) || MON_CSLEEP(m_ptr)) continue;
+ if (monster_confused_remaining(m_ptr) || monster_stunned_remaining(m_ptr) || monster_csleep_remaining(m_ptr)) continue;
/* Pet of other pet don't follow. */
if (m_ptr->parent_m_idx) continue;
if (!monster_is_valid(m_ptr)) continue;
if (is_pet(m_ptr) && i != creature_ptr->riding) have_pet = TRUE;
- if (MON_CSLEEP(m_ptr)) continue;
+ if (monster_csleep_remaining(m_ptr)) continue;
if (m_ptr->cdis > MAX_SIGHT) continue;
if (!is_hostile(m_ptr)) continue;
msg_print(_("敵がすぐ近くにいるときは広域マップに入れない!",
*/
#include "system/angband.h"
-#include "util/util.h"
#include "io/save.h"
-#include "io/load.h"
-#include "io/report.h"
-#include "system/angband-version.h"
-#include "object-enchant/artifact.h"
+#include "birth/quick-start.h"
+#include "cmd-building/cmd-building.h"
#include "core/sort.h"
#include "dungeon/dungeon.h"
#include "dungeon/quest.h"
-#include "store/store.h"
-#include "store/store-util.h"
-#include "floor/wild.h"
-#include "floor/floor.h"
#include "floor/floor-events.h"
#include "floor/floor-town.h"
-#include "io/uid-checker.h"
+#include "floor/floor.h"
+#include "floor/wild.h"
#include "io/files-util.h"
-#include "world/world.h"
-#include "object/object-kind.h"
+#include "io/load.h"
+#include "io/report.h"
+#include "io/uid-checker.h"
#include "monster-race/monster-race.h"
-#include "cmd-building/cmd-building.h"
+#include "monster/monster-status.h"
+#include "object-enchant/artifact.h"
+#include "object/object-kind.h"
+#include "store/store-util.h"
+#include "store/store.h"
+#include "system/angband-version.h"
+#include "util/util.h"
#include "view/display-main-window.h"
-#include "birth/quick-start.h"
+#include "world/world.h"
/*
* Some "local" parameters, used to help write savefiles
BIT_FLAGS flags = 0x00000000;
if (!is_original_ap(m_ptr)) flags |= SAVE_MON_AP_R_IDX;
if (m_ptr->sub_align) flags |= SAVE_MON_SUB_ALIGN;
- if (MON_CSLEEP(m_ptr)) flags |= SAVE_MON_CSLEEP;
- if (MON_FAST(m_ptr)) flags |= SAVE_MON_FAST;
- if (MON_SLOW(m_ptr)) flags |= SAVE_MON_SLOW;
- if (MON_STUNNED(m_ptr)) flags |= SAVE_MON_STUNNED;
- if (MON_CONFUSED(m_ptr)) flags |= SAVE_MON_CONFUSED;
- if (MON_MONFEAR(m_ptr)) flags |= SAVE_MON_MONFEAR;
+ if (monster_csleep_remaining(m_ptr)) flags |= SAVE_MON_CSLEEP;
+ if (monster_fast_remaining(m_ptr)) flags |= SAVE_MON_FAST;
+ if (monster_slow_remaining(m_ptr)) flags |= SAVE_MON_SLOW;
+ if (monster_stunned_remaining(m_ptr)) flags |= SAVE_MON_STUNNED;
+ if (monster_confused_remaining(m_ptr)) flags |= SAVE_MON_CONFUSED;
+ if (monster_fear_remaining(m_ptr)) flags |= SAVE_MON_MONFEAR;
if (m_ptr->target_y) flags |= SAVE_MON_TARGET_Y;
if (m_ptr->target_x) flags |= SAVE_MON_TARGET_X;
- if (MON_INVULNER(m_ptr)) flags |= SAVE_MON_INVULNER;
+ if (monster_invulner_remaining(m_ptr)) flags |= SAVE_MON_INVULNER;
if (m_ptr->smart) flags |= SAVE_MON_SMART;
if (m_ptr->exp) flags |= SAVE_MON_EXP;
if (m_ptr->mflag2) flags |= SAVE_MON_MFLAG2;
monster_type *m_ptr = &creature_ptr->current_floor_ptr->m_list[creature_ptr->riding];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
- if (MON_CONFUSED(m_ptr))
+ if (monster_confused_remaining(m_ptr))
{
/* Standard confusion */
if (randint0(100) < 75)
monster_type *m_ptr = &creature_ptr->current_floor_ptr->m_list[creature_ptr->riding];
monster_desc(creature_ptr, m_name, m_ptr, 0);
- if (MON_CONFUSED(m_ptr))
+ if (monster_confused_remaining(m_ptr))
{
msg_format(_("%sは混乱している。", "%^s is confused."), m_name);
}
monster_type *m_ptr = &creature_ptr->current_floor_ptr->m_list[creature_ptr->riding];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
- if (MON_CONFUSED(m_ptr))
+ if (monster_confused_remaining(m_ptr))
{
/* Standard confusion */
if (randint0(100) < 75)
monster_type *m_ptr = &creature_ptr->current_floor_ptr->m_list[creature_ptr->riding];
monster_desc(creature_ptr, m_name, m_ptr, 0);
- if (MON_CONFUSED(m_ptr))
+ if (monster_confused_remaining(m_ptr))
{
msg_format(_("%sは混乱している。", "%^s is confused."), m_name);
}
*/
static bool process_invulnerability(mam_pp_type *mam_pp_ptr)
{
- if (MON_INVULNER(mam_pp_ptr->m_ptr) && randint0(PENETRATE_INVULNERABILITY))
+ if (monster_invulner_remaining(mam_pp_ptr->m_ptr) && randint0(PENETRATE_INVULNERABILITY))
return FALSE;
if (mam_pp_ptr->seen)
*/
static void cancel_fear_by_pain(player_type *player_ptr, mam_pp_type *mam_pp_ptr)
{
- if (!MON_MONFEAR(mam_pp_ptr->m_ptr) || (mam_pp_ptr->dam <= 0)
- || !set_monster_monfear(player_ptr, mam_pp_ptr->m_idx, MON_MONFEAR(mam_pp_ptr->m_ptr) - randint1(mam_pp_ptr->dam / 4)))
+ if (!monster_fear_remaining(mam_pp_ptr->m_ptr) || (mam_pp_ptr->dam <= 0)
+ || !set_monster_monfear(player_ptr, mam_pp_ptr->m_idx, monster_fear_remaining(mam_pp_ptr->m_ptr) - randint1(mam_pp_ptr->dam / 4)))
return;
*(mam_pp_ptr->fear) = FALSE;
static void make_monster_fear(player_type *player_ptr, mam_pp_type *mam_pp_ptr)
{
monster_race *r_ptr = &r_info[mam_pp_ptr->m_ptr->r_idx];
- if (MON_MONFEAR(mam_pp_ptr->m_ptr) || ((r_ptr->flags3 & RF3_NO_FEAR) == 0))
+ if (monster_fear_remaining(mam_pp_ptr->m_ptr) || ((r_ptr->flags3 & RF3_NO_FEAR) == 0))
return;
int percentage = (100L * mam_pp_ptr->m_ptr->hp) / mam_pp_ptr->m_ptr->maxhp;
static void process_melee(player_type *subject_ptr, mam_type *mam_ptr)
{
- if (mam_ptr->effect && !check_hit_from_monster_to_monster(mam_ptr->power, mam_ptr->rlev, mam_ptr->ac, MON_STUNNED(mam_ptr->m_ptr))) {
+ if (mam_ptr->effect && !check_hit_from_monster_to_monster(mam_ptr->power, mam_ptr->rlev, mam_ptr->ac, monster_stunned_remaining(mam_ptr->m_ptr))) {
describe_monster_missed_monster(subject_ptr, mam_ptr);
return;
}
#include "floor/floor-object.h"
#include "io/targeting.h"
#include "monster-race/race-indice-types.h"
+#include "monster/monster-status.h"
#include "object-enchant/trc-types.h"
#include "object/object-generator.h"
#include "object/object-kind-hook.h"
tmp /= 2;
if (r_ptr->level > (attacker_ptr->lev * attacker_ptr->lev / 20 + 10))
tmp /= 3;
- if (MON_CSLEEP(pa_ptr->m_ptr) && pa_ptr->m_ptr->ml) {
+ if (monster_csleep_remaining(pa_ptr->m_ptr) && pa_ptr->m_ptr->ml) {
/* Can't backstab creatures that we can't see, right? */
pa_ptr->backstab = TRUE;
} else if ((attacker_ptr->special_defense & NINJA_S_STEALTH) && (randint0(tmp) > (r_ptr->level + 20)) && pa_ptr->m_ptr->ml
&& !(r_ptr->flagsr & RFR_RES_ALL)) {
pa_ptr->surprise_attack = TRUE;
- } else if (MON_MONFEAR(pa_ptr->m_ptr) && pa_ptr->m_ptr->ml) {
+ } else if (monster_fear_remaining(pa_ptr->m_ptr) && pa_ptr->m_ptr->ml) {
pa_ptr->stab_fleeing = TRUE;
}
}
}
int tmp = (10 + randint1(15) + attacker_ptr->lev / 5);
- if (MON_STUNNED(pa_ptr->m_ptr)) {
+ if (monster_stunned_remaining(pa_ptr->m_ptr)) {
msg_format(_("%sはひどくもうろうとした。", "%s is more dazed."), pa_ptr->m_name);
tmp /= 2;
} else
msg_format(_("%s はもうろうとした。", "%s is dazed."), pa_ptr->m_name);
- (void)set_monster_stunned(attacker_ptr, pa_ptr->g_ptr->m_idx, MON_STUNNED(pa_ptr->m_ptr) + tmp);
+ (void)set_monster_stunned(attacker_ptr, pa_ptr->g_ptr->m_idx, monster_stunned_remaining(pa_ptr->m_ptr) + tmp);
}
/*!
monster_race *r_ptr = &r_info[pa_ptr->m_ptr->r_idx];
if (stun_effect && ((pa_ptr->attack_damage + attacker_ptr->to_d[pa_ptr->hand]) < pa_ptr->m_ptr->hp)) {
if (attacker_ptr->lev > randint1(r_ptr->level + resist_stun + 10)) {
- if (set_monster_stunned(attacker_ptr, pa_ptr->g_ptr->m_idx, stun_effect + MON_STUNNED(pa_ptr->m_ptr))) {
+ if (set_monster_stunned(attacker_ptr, pa_ptr->g_ptr->m_idx, stun_effect + monster_stunned_remaining(pa_ptr->m_ptr))) {
msg_format(_("%^sはフラフラになった。", "%^s is stunned."), pa_ptr->m_name);
} else {
msg_format(_("%^sはさらにフラフラになった。", "%^s is more stunned."), pa_ptr->m_name);
power = mbe_info[monap_ptr->effect].power;
monap_ptr->ac = target_ptr->ac + target_ptr->to_a;
- if ((monap_ptr->effect == RBE_NONE) || check_hit_from_monster_to_player(target_ptr, power, monap_ptr->rlev, MON_STUNNED(monap_ptr->m_ptr)))
+ if ((monap_ptr->effect == RBE_NONE) || check_hit_from_monster_to_player(target_ptr, power, monap_ptr->rlev, monster_stunned_remaining(monap_ptr->m_ptr)))
if (!process_monster_attack_hit(target_ptr, monap_ptr))
continue;
else
#include "monster-attack/monster-eating.h"
#include "mind/drs-types.h"
#include "mind/mind-mirror-master.h"
+#include "monster/monster-status.h"
#include "player/player-damage.h"
#include "player/player-effects.h"
#include "spell-kind/earthquake.h"
}
case RBE_EAT_GOLD: {
monap_ptr->get_damage += take_hit(target_ptr, DAMAGE_ATTACK, monap_ptr->damage, monap_ptr->ddesc, -1);
- if (MON_CONFUSED(monap_ptr->m_ptr))
+ if (monster_confused_remaining(monap_ptr->m_ptr))
break;
if (target_ptr->is_dead || check_multishadow(target_ptr))
#include "floor/floor.h"
#include "inventory/inventory-object.h"
#include "mind/mind-mirror-master.h"
+#include "monster/monster-status.h"
#include "object/object-flavor.h"
#include "object/object-generator.h"
#include "object/object-hook.h"
*/
bool check_eat_item(player_type *target_ptr, monap_type *monap_ptr)
{
- if (MON_CONFUSED(monap_ptr->m_ptr))
+ if (monster_confused_remaining(monap_ptr->m_ptr))
return FALSE;
if (target_ptr->is_dead || check_multishadow(target_ptr))
turn_flags_ptr->do_move = FALSE;
}
- if (turn_flags_ptr->do_move && ((d_info[target_ptr->dungeon_idx].flags1 & DF1_NO_MELEE) != 0) && !MON_CONFUSED(m_ptr))
+ if (turn_flags_ptr->do_move && ((d_info[target_ptr->dungeon_idx].flags1 & DF1_NO_MELEE) != 0) && !monster_confused_remaining(m_ptr))
{
if (!(r_ptr->flags2 & RF2_STUPID))
turn_flags_ptr->do_move = FALSE;
if ((y_ptr->r_idx == 0) || (y_ptr->hp < 0)) return FALSE;
if (monst_attack_monst(target_ptr, m_idx, g_ptr->m_idx)) return TRUE;
if ((d_info[target_ptr->dungeon_idx].flags1 & DF1_NO_MELEE) == 0) return FALSE;
- if (MON_CONFUSED(m_ptr)) return TRUE;
+ if (monster_confused_remaining(m_ptr)) return TRUE;
if ((r_ptr->flags2 & RF2_STUPID) == 0) return FALSE;
if (is_original_ap_and_seen(target_ptr, m_ptr))
if ((((r_ptr->flags2 & RF2_KILL_BODY) != 0) && ((r_ptr->flags1 & RF1_NEVER_BLOW) == 0) &&
(r_ptr->mexp * r_ptr->level > z_ptr->mexp * z_ptr->level) &&
can_cross && (g_ptr->m_idx != target_ptr->riding)) ||
- are_enemies(target_ptr, m_ptr, y_ptr) || MON_CONFUSED(m_ptr))
+ are_enemies(target_ptr, m_ptr, y_ptr) || monster_confused_remaining(m_ptr))
{
return exe_monster_attack_to_monster(target_ptr, m_idx, g_ptr);
}
monster_type *m_ptr = &target_ptr->current_floor_ptr->m_list[m_idx];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
- if (MON_CONFUSED(m_ptr) || !aware)
+ if (monster_confused_remaining(m_ptr) || !aware)
{
mm[0] = mm[1] = mm[2] = mm[3] = 5;
return TRUE;
if (turn_flags_ptr->is_riding_mon)
{
- if (!target_ptr->riding_ryoute && !MON_MONFEAR(&target_ptr->current_floor_ptr->m_list[target_ptr->riding])) turn_flags_ptr->do_move = FALSE;
+ if (!target_ptr->riding_ryoute && !monster_fear_remaining(&target_ptr->current_floor_ptr->m_list[target_ptr->riding])) turn_flags_ptr->do_move = FALSE;
}
if (!process_post_dig_wall(target_ptr, turn_flags_ptr, m_ptr, ny, nx)) return FALSE;
else
strcpy(m_name, _("それ", "It"));
- if (MON_MONFEAR(m_ptr))
+ if (monster_fear_remaining(m_ptr))
filename = _("monfear_j.txt", "monfear.txt");
else if (is_pet(m_ptr))
filename = _("monpet_j.txt", "monpet.txt");
turn_flags_ptr->see_m = is_seen(m_ptr);
decide_drop_from_monster(target_ptr, m_idx, turn_flags_ptr->is_riding_mon);
- if ((m_ptr->mflag2 & MFLAG2_CHAMELEON) && one_in_(13) && !MON_CSLEEP(m_ptr))
+ if ((m_ptr->mflag2 & MFLAG2_CHAMELEON) && one_in_(13) && !monster_csleep_remaining(m_ptr))
{
choose_new_monster(target_ptr, m_idx, FALSE, 0);
r_ptr = &r_info[m_ptr->r_idx];
if (runaway_monster(target_ptr, turn_flags_ptr, m_idx)) return;
if (!awake_monster(target_ptr, m_idx)) return;
- if (MON_STUNNED(m_ptr))
+ if (monster_stunned_remaining(m_ptr))
{
if (one_in_(2)) return;
}
if (target_ptr->no_flowed && count > 2 && m_ptr->target_y)
m_ptr->mflag2 &= ~MFLAG2_NOFLOW;
- if (!turn_flags_ptr->do_turn && !turn_flags_ptr->do_move && !MON_MONFEAR(m_ptr) && !turn_flags_ptr->is_riding_mon && turn_flags_ptr->aware)
+ if (!turn_flags_ptr->do_turn && !turn_flags_ptr->do_move && !monster_fear_remaining(m_ptr) && !turn_flags_ptr->is_riding_mon && turn_flags_ptr->aware)
{
if (r_ptr->freq_spell && randint1(100) <= r_ptr->freq_spell)
{
{
monster_type *m_ptr = &target_ptr->current_floor_ptr->m_list[m_idx];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
- if (!MON_CSLEEP(m_ptr)) return TRUE;
+ if (!monster_csleep_remaining(m_ptr)) return TRUE;
if (!(target_ptr->cursed & TRC_AGGRAVATE)) return FALSE;
(void)set_monster_csleep(target_ptr, m_idx, 0);
bool process_monster_fear(player_type *target_ptr, turn_flags *turn_flags_ptr, MONSTER_IDX m_idx)
{
monster_type *m_ptr = &target_ptr->current_floor_ptr->m_list[m_idx];
- bool is_battle_determined = !turn_flags_ptr->do_turn && !turn_flags_ptr->do_move && MON_MONFEAR(m_ptr) && turn_flags_ptr->aware;
+ bool is_battle_determined = !turn_flags_ptr->do_turn && !turn_flags_ptr->do_move && monster_fear_remaining(m_ptr) && turn_flags_ptr->aware;
if (!is_battle_determined) return FALSE;
(void)set_monster_monfear(target_ptr, m_idx, 0);
if ((dam == 0) && one_in_(3)) dam = 1;
}
- if (MON_INVULNER(m_ptr))
+ if (monster_invulner_remaining(m_ptr))
{
if (is_psy_spear)
{
if (v)
{
- if (!MON_CSLEEP(m_ptr))
+ if (!monster_csleep_remaining(m_ptr))
{
mproc_add(floor_ptr, m_idx, MTIMED_CSLEEP);
notice = TRUE;
else
{
- if (MON_CSLEEP(m_ptr))
+ if (monster_csleep_remaining(m_ptr))
{
mproc_remove(floor_ptr, m_idx, MTIMED_CSLEEP);
notice = TRUE;
if (v)
{
- if (!MON_FAST(m_ptr))
+ if (!monster_fast_remaining(m_ptr))
{
mproc_add(floor_ptr, m_idx, MTIMED_FAST);
notice = TRUE;
else
{
- if (MON_FAST(m_ptr))
+ if (monster_fast_remaining(m_ptr))
{
mproc_remove(floor_ptr, m_idx, MTIMED_FAST);
notice = TRUE;
if (v)
{
- if (!MON_SLOW(m_ptr))
+ if (!monster_slow_remaining(m_ptr))
{
mproc_add(floor_ptr, m_idx, MTIMED_SLOW);
notice = TRUE;
else
{
- if (MON_SLOW(m_ptr))
+ if (monster_slow_remaining(m_ptr))
{
mproc_remove(floor_ptr, m_idx, MTIMED_SLOW);
notice = TRUE;
if (v)
{
- if (!MON_STUNNED(m_ptr))
+ if (!monster_stunned_remaining(m_ptr))
{
mproc_add(floor_ptr, m_idx, MTIMED_STUNNED);
notice = TRUE;
else
{
- if (MON_STUNNED(m_ptr))
+ if (monster_stunned_remaining(m_ptr))
{
mproc_remove(floor_ptr, m_idx, MTIMED_STUNNED);
notice = TRUE;
if (v)
{
- if (!MON_CONFUSED(m_ptr))
+ if (!monster_confused_remaining(m_ptr))
{
mproc_add(floor_ptr, m_idx, MTIMED_CONFUSED);
notice = TRUE;
else
{
- if (MON_CONFUSED(m_ptr))
+ if (monster_confused_remaining(m_ptr))
{
mproc_remove(floor_ptr, m_idx, MTIMED_CONFUSED);
notice = TRUE;
if (v)
{
- if (!MON_MONFEAR(m_ptr))
+ if (!monster_fear_remaining(m_ptr))
{
mproc_add(floor_ptr, m_idx, MTIMED_MONFEAR);
notice = TRUE;
else
{
- if (MON_MONFEAR(m_ptr))
+ if (monster_fear_remaining(m_ptr))
{
mproc_remove(floor_ptr, m_idx, MTIMED_MONFEAR);
notice = TRUE;
if (v)
{
- if (!MON_INVULNER(m_ptr))
+ if (!monster_invulner_remaining(m_ptr))
{
mproc_add(floor_ptr, m_idx, MTIMED_INVULNER);
notice = TRUE;
else
{
- if (MON_INVULNER(m_ptr))
+ if (monster_invulner_remaining(m_ptr))
{
mproc_remove(floor_ptr, m_idx, MTIMED_INVULNER);
if (energy_need && !target_ptr->wild_mode) m_ptr->energy_need += ENERGY_NEED();
/* Monster wakes up "a little bit" */
/* Still asleep */
- if (!set_monster_csleep(target_ptr, m_idx, MON_CSLEEP(m_ptr) - d))
+ if (!set_monster_csleep(target_ptr, m_idx, monster_csleep_remaining(m_ptr) - d))
{
/* Notice the "not waking up" */
if (is_original_ap_and_seen(target_ptr, m_ptr))
case MTIMED_FAST:
/* Reduce by one, note if expires */
- if (set_monster_fast(target_ptr, m_idx, MON_FAST(m_ptr) - 1))
+ if (set_monster_fast(target_ptr, m_idx, monster_fast_remaining(m_ptr) - 1))
{
if (is_seen(m_ptr))
{
case MTIMED_SLOW:
/* Reduce by one, note if expires */
- if (set_monster_slow(target_ptr, m_idx, MON_SLOW(m_ptr) - 1))
+ if (set_monster_slow(target_ptr, m_idx, monster_slow_remaining(m_ptr) - 1))
{
if (is_seen(m_ptr))
{
int rlev = r_info[m_ptr->r_idx].level;
/* Recover from stun */
- if (set_monster_stunned(target_ptr, m_idx, (randint0(10000) <= rlev * rlev) ? 0 : (MON_STUNNED(m_ptr) - 1)))
+ if (set_monster_stunned(target_ptr, m_idx, (randint0(10000) <= rlev * rlev) ? 0 : (monster_stunned_remaining(m_ptr) - 1)))
{
/* Message if visible */
if (is_seen(m_ptr))
case MTIMED_CONFUSED:
{
/* Reduce the confusion */
- if (!set_monster_confused(target_ptr, m_idx, MON_CONFUSED(m_ptr) - randint1(r_info[m_ptr->r_idx].level / 20 + 1)))
+ if (!set_monster_confused(target_ptr, m_idx, monster_confused_remaining(m_ptr) - randint1(r_info[m_ptr->r_idx].level / 20 + 1)))
break;
/* Message if visible */
if (is_seen(m_ptr))
case MTIMED_MONFEAR:
{
/* Reduce the fear */
- if (!set_monster_monfear(target_ptr, m_idx, MON_MONFEAR(m_ptr) - randint1(r_info[m_ptr->r_idx].level / 20 + 1)))
+ if (!set_monster_monfear(target_ptr, m_idx, monster_fear_remaining(m_ptr) - randint1(r_info[m_ptr->r_idx].level / 20 + 1)))
break;
/* Visual note */
case MTIMED_INVULNER:
{
/* Reduce by one, note if expires */
- if (!set_monster_invulner(target_ptr, m_idx, MON_INVULNER(m_ptr) - 1, TRUE))
+ if (!set_monster_invulner(target_ptr, m_idx, monster_invulner_remaining(m_ptr) - 1, TRUE))
break;
if (is_seen(m_ptr))
}
/* Mega-Hack -- Pain cancels fear */
- if (MON_MONFEAR(m_ptr) && (dam > 0))
+ if (monster_fear_remaining(m_ptr) && (dam > 0))
{
/* Cure fear */
- if (set_monster_monfear(target_ptr, m_idx, MON_MONFEAR(m_ptr) - randint1(dam)))
+ if (set_monster_monfear(target_ptr, m_idx, monster_fear_remaining(m_ptr) - randint1(dam)))
{
/* No more fear */
(*fear) = FALSE;
}
/* Sometimes a monster gets scared by damage */
- if (!MON_MONFEAR(m_ptr) && !(r_ptr->flags3 & (RF3_NO_FEAR)))
+ if (!monster_fear_remaining(m_ptr) && !(r_ptr->flags3 & (RF3_NO_FEAR)))
{
/* Percentage of fully healthy */
int percentage = (100L * m_ptr->hp) / m_ptr->maxhp;
{
return (m_ptr->r_idx != 0);
}
+
+TIME_EFFECT monster_csleep_remaining(monster_type *m_ptr) { return m_ptr->mtimed[MTIMED_CSLEEP]; }
+
+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]; }
+
+TIME_EFFECT monster_stunned_remaining(monster_type* m_ptr) { return m_ptr->mtimed[MTIMED_STUNNED]; }
+
+TIME_EFFECT monster_confused_remaining(monster_type *m_ptr) { return m_ptr->mtimed[MTIMED_CONFUSED]; }
+
+TIME_EFFECT monster_fear_remaining(monster_type *m_ptr) { return m_ptr->mtimed[MTIMED_MONFEAR]; }
+
+TIME_EFFECT monster_invulner_remaining(monster_type *m_ptr) { return m_ptr->mtimed[MTIMED_INVULNER]; }
int get_mproc_idx(floor_type *floor_ptr, MONSTER_IDX m_idx, int mproc_type);
void mproc_init(floor_type *floor_ptr);
void process_monsters_mtimed(player_type *target_ptr, int mtimed_idx);
+
+TIME_EFFECT monster_csleep_remaining(monster_type *m_ptr);
+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);
+TIME_EFFECT monster_fear_remaining(monster_type *m_ptr);
+TIME_EFFECT monster_invulner_remaining(monster_type *m_ptr);
#include "floor/floor.h"
#include "monster/monster-flag-types.h"
#include "monster/monster-safety-hiding.h"
+#include "monster/monster-status.h"
#include "monster/smart-learn-types.h"
#include "mspell/monster-spell.h"
}
if (m_ptr->cdis > MAX_SIGHT + 5) return FALSE;
- if (MON_MONFEAR(m_ptr)) return TRUE;
+ if (monster_fear_remaining(m_ptr)) return TRUE;
if (m_ptr->cdis <= 5) return FALSE;
PLAYER_LEVEL p_lev = target_ptr->lev;
* 引数に入っていたらここには移動させないこと
*/
-#include "system/angband.h"
#include "monster-util.h"
+#include "monster/monster-status.h"
/*!
* @brief ターン経過フラグ構造体の初期化
SPEED speed = m_ptr->mspeed;
if (ironman_nightmare) speed += 5;
- if (MON_FAST(m_ptr)) speed += 10;
- if (MON_SLOW(m_ptr)) speed -= 10;
+ if (monster_fast_remaining(m_ptr)) speed += 10;
+ if (monster_slow_remaining(m_ptr)) speed -= 10;
return speed;
}
#pragma once
+#include "system/angband.h"
+
typedef struct {
bool see_m;
bool aware;
#define MAX_MTIMED 7
-#define MON_CSLEEP(M_PTR) ((M_PTR)->mtimed[MTIMED_CSLEEP])
-#define MON_FAST(M_PTR) ((M_PTR)->mtimed[MTIMED_FAST])
-#define MON_SLOW(M_PTR) ((M_PTR)->mtimed[MTIMED_SLOW])
-#define MON_STUNNED(M_PTR) ((M_PTR)->mtimed[MTIMED_STUNNED])
-#define MON_CONFUSED(M_PTR) ((M_PTR)->mtimed[MTIMED_CONFUSED])
-#define MON_MONFEAR(M_PTR) ((M_PTR)->mtimed[MTIMED_MONFEAR])
-#define MON_INVULNER(M_PTR) ((M_PTR)->mtimed[MTIMED_INVULNER])
-
/*
* Monster information, for a specific monster.
* Note: fy, fx constrain dungeon size to 256x256
real_r_ptr(m_ptr)->cur_num--;
if (r_ptr->flags2 & (RF2_MULTIPLY)) floor_ptr->num_repro--;
- if (MON_CSLEEP(m_ptr)) (void)set_monster_csleep(player_ptr, i, 0);
- if (MON_FAST(m_ptr)) (void)set_monster_fast(player_ptr, i, 0);
- if (MON_SLOW(m_ptr)) (void)set_monster_slow(player_ptr, i, 0);
- if (MON_STUNNED(m_ptr)) (void)set_monster_stunned(player_ptr, i, 0);
- if (MON_CONFUSED(m_ptr)) (void)set_monster_confused(player_ptr, i, 0);
- if (MON_MONFEAR(m_ptr)) (void)set_monster_monfear(player_ptr, i, 0);
- if (MON_INVULNER(m_ptr)) (void)set_monster_invulner(player_ptr, i, 0, FALSE);
+ if (monster_csleep_remaining(m_ptr)) (void)set_monster_csleep(player_ptr, i, 0);
+ if (monster_fast_remaining(m_ptr)) (void)set_monster_fast(player_ptr, i, 0);
+ if (monster_slow_remaining(m_ptr)) (void)set_monster_slow(player_ptr, i, 0);
+ if (monster_stunned_remaining(m_ptr)) (void)set_monster_stunned(player_ptr, i, 0);
+ if (monster_confused_remaining(m_ptr)) (void)set_monster_confused(player_ptr, i, 0);
+ if (monster_fear_remaining(m_ptr)) (void)set_monster_monfear(player_ptr, i, 0);
+ if (monster_invulner_remaining(m_ptr)) (void)set_monster_invulner(player_ptr, i, 0, FALSE);
if (i == target_who) target_who = 0;
if (r_ptr->flags7 & RF7_SELF_LD_MASK)
player_ptr->update |= (PU_MON_LITE);
- else if ((r_ptr->flags7 & RF7_HAS_LD_MASK) && !MON_CSLEEP(m_ptr))
+ else if ((r_ptr->flags7 & RF7_HAS_LD_MASK) && !monster_csleep_remaining(m_ptr))
player_ptr->update |= (PU_MON_LITE);
update_monster(player_ptr, g_ptr->m_idx, TRUE);
_("%^sは恐怖して逃げ出した!", "%^s flees in terror!"), resist, saving_throw, TARGET_TYPE);
if (!resist && !saving_throw) {
- set_monster_monfear(target_ptr, t_idx, MON_MONFEAR(t_ptr) + randint0(4) + 4);
+ set_monster_monfear(target_ptr, t_idx, monster_fear_remaining(t_ptr) + randint0(4) + 4);
}
}
_("%^sには効果がなかった。", "%^s is unaffected."), _("%^sは目が見えなくなった! ", "%^s is blinded!"), resist, saving_throw, TARGET_TYPE);
if (!resist && !saving_throw) {
- (void)set_monster_confused(target_ptr, t_idx, MON_CONFUSED(t_ptr) + 12 + randint0(4));
+ (void)set_monster_confused(target_ptr, t_idx, monster_confused_remaining(t_ptr) + 12 + randint0(4));
}
}
_("%^sは混乱したようだ。", "%^s seems confused."), resist, saving_throw, TARGET_TYPE);
if (!resist && !saving_throw) {
- (void)set_monster_confused(target_ptr, t_idx, MON_CONFUSED(t_ptr) + 12 + randint0(4));
+ (void)set_monster_confused(target_ptr, t_idx, monster_confused_remaining(t_ptr) + 12 + randint0(4));
}
}
resist, saving_throw, TARGET_TYPE);
if (!resist && !saving_throw) {
- (void)set_monster_stunned(target_ptr, t_idx, MON_STUNNED(t_ptr) + randint1(4) + 4);
+ (void)set_monster_stunned(target_ptr, t_idx, monster_stunned_remaining(t_ptr) + randint1(4) + 4);
}
}
_("%^sが自分の体に念を送った。", format("%%^s concentrates on %s body.", m_poss)),
_("%^sが自分の体に念を送った。", format("%%^s concentrates on %s body.", m_poss)), target_ptr->blind > 0, TARGET_TYPE);
- if (set_monster_fast(target_ptr, m_idx, MON_FAST(m_ptr) + 100)) {
+ if (set_monster_fast(target_ptr, m_idx, monster_fast_remaining(m_ptr) + 100)) {
if (TARGET_TYPE == MONSTER_TO_PLAYER || (TARGET_TYPE == MONSTER_TO_MONSTER && see_m))
msg_format(_("%^sの動きが速くなった。", "%^s starts moving faster."), m_name);
}
_("%^sには効果がなかった。", "%^s is unaffected."), _("%sの動きが遅くなった。", "%^s starts moving slower."), resist, saving_throw, TARGET_TYPE);
if (!resist && !saving_throw) {
- set_monster_slow(target_ptr, t_idx, MON_SLOW(t_ptr) + 50);
+ set_monster_slow(target_ptr, t_idx, monster_slow_remaining(t_ptr) + 50);
}
}
if (target_ptr->riding == m_idx)
target_ptr->redraw |= (PR_UHEALTH);
- if (!MON_MONFEAR(m_ptr))
+ if (!monster_fear_remaining(m_ptr))
return;
(void)set_monster_monfear(target_ptr, m_idx, 0);
_("%^sが何かを力強くつぶやいた。", "%^s mumbles powerfully."), _("%sは無傷の球の呪文を唱えた。", "%^s casts a Globe of Invulnerability."),
_("%sは無傷の球の呪文を唱えた。", "%^s casts a Globe of Invulnerability."), !seen, TARGET_TYPE);
- if (!MON_INVULNER(m_ptr))
+ if (!monster_invulner_remaining(m_ptr))
(void)set_monster_invulner(target_ptr, m_idx, randint1(4) + 4, FALSE);
}
*/
#include "system/angband.h"
-#include "util/util.h"
-#include "effect/effect-characteristics.h"
#include "dungeon/dungeon.h"
-#include "grid/grid.h"
-#include "object-enchant/object-curse.h"
#include "dungeon/quest.h"
-#include "player/player-move.h"
-#include "player/player-status.h"
+#include "effect/effect-characteristics.h"
+#include "grid/grid.h"
#include "monster-race/race-indice-types.h"
#include "monster/monster-flag-types.h"
+#include "monster/monster-status.h"
#include "monster/monster.h"
#include "monster/smart-learn-types.h"
+#include "mspell/assign-monster-spell.h"
#include "mspell/monster-spell.h"
-#include "spell/spells-type.h"
-#include "world/world.h"
-#include "realm/realm-song-numbers.h"
-#include "view/display-main-window.h"
-#include "player/player-races-table.h"
+#include "mspell/mspell-learn-checker.h"
+#include "object-enchant/object-curse.h"
#include "player/player-class.h"
+#include "player/player-move.h"
+#include "player/player-races-table.h"
+#include "player/player-status.h"
+#include "realm/realm-song-numbers.h"
+#include "spell-kind/spells-teleport.h"
+#include "spell-realm/spells-hex.h"
#include "spell/process-effect.h"
#include "spell/range-calc.h"
-#include "spell-realm/spells-hex.h"
-#include "spell-kind/spells-teleport.h"
-#include "mspell/mspell-learn-checker.h"
-#include "mspell/assign-monster-spell.h"
+#include "spell/spells-type.h"
+#include "util/util.h"
+#include "view/display-main-window.h"
+#include "world/world.h"
#define DO_SPELL_NONE 0
#define DO_SPELL_BR_LITE 1
if (creature_ptr->riding && (creature_ptr->current_floor_ptr->m_list[creature_ptr->riding].mspeed < 135))
{
- if (MON_FAST(&creature_ptr->current_floor_ptr->m_list[creature_ptr->riding])) return TRUE;
+ if (monster_fast_remaining(&creature_ptr->current_floor_ptr->m_list[creature_ptr->riding])) return TRUE;
}
/* No need to cast dispel spell */
}
/* Hurt badly or afraid, attempt to flee */
- if (((m_ptr->hp < m_ptr->maxhp / 3) || MON_MONFEAR(m_ptr)) && one_in_(2))
+ if (((m_ptr->hp < m_ptr->maxhp / 3) || monster_fear_remaining(m_ptr)) && one_in_(2))
{
/* Choose escape spell if possible */
if (escape_num) return (escape[randint0(escape_num)]);
}
/* Haste self if we aren't already somewhat hasted (rarely) */
- if (haste_num && (randint0(100) < 20) && !MON_FAST(m_ptr))
+ if (haste_num && (randint0(100) < 20) && !monster_fast_remaining(m_ptr))
{
/* Choose haste spell */
return (haste[randint0(haste_num)]);
monster_race *r_ptr = &r_info[m_ptr->r_idx];
/* Cannot cast spells when confused */
- if (MON_CONFUSED(m_ptr))
+ if (monster_confused_remaining(m_ptr))
{
reset_target(m_ptr);
return FALSE;
/* Check for spell failure (inate attacks never fail) */
if (!spell_is_inate(thrown_spell)
- && (in_no_magic_dungeon || (MON_STUNNED(m_ptr) && one_in_(2)) || (randint0(100) < failrate)))
+ && (in_no_magic_dungeon || (monster_stunned_remaining(m_ptr) && one_in_(2)) || (randint0(100) < failrate)))
{
disturb(target_ptr, TRUE, TRUE);
msg_format(_("%^sは呪文を唱えようとしたが失敗した。", "%^s tries to cast a spell, but fails."), m_name);
static bool dispel_check_monster(player_type *target_ptr, MONSTER_IDX m_idx, MONSTER_IDX t_idx)
{
monster_type *t_ptr = &target_ptr->current_floor_ptr->m_list[t_idx];
- if (MON_INVULNER(t_ptr)) return TRUE;
+ if (monster_invulner_remaining(t_ptr)) return TRUE;
- if ((t_ptr->mspeed < 135) && MON_FAST(t_ptr)) return TRUE;
+ if ((t_ptr->mspeed < 135) && monster_fast_remaining(t_ptr)) return TRUE;
/* Riding monster */
if ((t_idx == target_ptr->riding) && dispel_check(target_ptr, m_idx)) return TRUE;
bool can_remember;
/* Cannot cast spells when confused */
- if (MON_CONFUSED(m_ptr)) return FALSE;
+ if (monster_confused_remaining(m_ptr)) return FALSE;
/* Extract the racial spell flags */
BIT_FLAGS f4 = r_ptr->flags4;
if (target_ptr->riding && (m_idx == target_ptr->riding)) disturb(target_ptr, TRUE, TRUE);
/* Check for spell failure (inate attacks never fail) */
- if (!spell_is_inate(thrown_spell) && (in_no_magic_dungeon || (MON_STUNNED(m_ptr) && one_in_(2))))
+ if (!spell_is_inate(thrown_spell) && (in_no_magic_dungeon || (monster_stunned_remaining(m_ptr) && one_in_(2))))
{
disturb(target_ptr, TRUE, TRUE);
if (see_m) msg_format(_("%^sは呪文を唱えようとしたが失敗した。",
#include "monster-attack/monster-attack-effect.h"
#include "monster-attack/monster-attack-types.h"
#include "monster-race/race-indice-types.h"
+#include "monster/monster-status.h"
#include "monster/monster.h"
#include "monster/smart-learn-types.h"
#include "mspell/monster-spell.h"
m_ptr = &creature_ptr->current_floor_ptr->m_list[g_ptr->m_idx];
- if (MON_CSLEEP(m_ptr)) continue;
+ if (monster_csleep_remaining(m_ptr)) continue;
if (!is_hostile(m_ptr)) continue;
r_ptr = &r_info[m_ptr->r_idx];
msg_format(_("%^sには効果がなかった。", "%^s is unaffected."), pa_ptr->m_name);
} else {
msg_format(_("%^sは混乱したようだ。", "%^s appears confused."), pa_ptr->m_name);
- (void)set_monster_confused(attacker_ptr, pa_ptr->g_ptr->m_idx, MON_CONFUSED(pa_ptr->m_ptr) + 10 + randint0(attacker_ptr->lev) / 5);
+ (void)set_monster_confused(attacker_ptr, pa_ptr->g_ptr->m_idx, monster_confused_remaining(pa_ptr->m_ptr) + 10 + randint0(attacker_ptr->lev) / 5);
}
}
can_move = FALSE;
disturb(creature_ptr, FALSE, TRUE);
}
- else if (MON_MONFEAR(riding_m_ptr))
+ else if (monster_fear_remaining(riding_m_ptr))
{
GAME_TEXT steed_name[MAX_NLEN];
monster_desc(creature_ptr, steed_name, riding_m_ptr, 0);
disturb(creature_ptr, FALSE, TRUE);
}
- if (can_move && MON_STUNNED(riding_m_ptr) && one_in_(2))
+ if (can_move && monster_stunned_remaining(riding_m_ptr) && one_in_(2))
{
GAME_TEXT steed_name[MAX_NLEN];
monster_desc(creature_ptr, steed_name, riding_m_ptr, 0);
}
new_speed += (creature_ptr->skill_exp[GINOU_RIDING] + creature_ptr->lev * 160L) / 3200;
- if (MON_FAST(riding_m_ptr)) new_speed += 10;
- if (MON_SLOW(riding_m_ptr)) new_speed -= 10;
+ if (monster_fast_remaining(riding_m_ptr)) new_speed += 10;
+ if (monster_slow_remaining(riding_m_ptr)) new_speed -= 10;
riding_levitation = (riding_r_ptr->flags7 & RF7_CAN_FLY) ? TRUE : FALSE;
if (riding_r_ptr->flags7 & (RF7_CAN_SWIM | RF7_AQUATIC)) creature_ptr->can_swim = TRUE;
msg_format(_("%^sには効果がなかった。", "%^s is unaffected."), m_name);
}
- if (MON_CSLEEP(m_ptr)) {
+ if (monster_csleep_remaining(m_ptr)) {
(void)set_monster_csleep(caster_ptr, m_idx, 0);
if (m_ptr->ml) {
msg_format(_("%^sが目を覚ました。", "%^s wakes up."), m_name);
if (r_ptr->flags2 & (RF2_SMART))
chance = 100;
- if (MON_CSLEEP(m_ptr) && (randint0(100) < chance)) {
+ if (monster_csleep_remaining(m_ptr) && (randint0(100) < chance)) {
(void)set_monster_csleep(caster_ptr, g_ptr->m_idx, 0);
if (m_ptr->ml) {
GAME_TEXT m_name[MAX_NLEN];
continue;
if (m_ptr->cdis < MAX_SIGHT * 2) {
- if (MON_CSLEEP(m_ptr)) {
+ if (monster_csleep_remaining(m_ptr)) {
(void)set_monster_csleep(caster_ptr, i, 0);
sleep = TRUE;
}
if (player_has_los_bold(caster_ptr, m_ptr->fy, m_ptr->fx)) {
if (!is_pet(m_ptr)) {
- (void)set_monster_fast(caster_ptr, i, MON_FAST(m_ptr) + 100);
+ (void)set_monster_fast(caster_ptr, i, monster_fast_remaining(m_ptr) + 100);
speed = TRUE;
}
}
monster_desc(caster_ptr, m_name, m_ptr, MD_IGNORE_HALLU | MD_INDEF_HIDDEN);
speed = m_ptr->mspeed - 110;
- if (MON_FAST(m_ptr))
+ if (monster_fast_remaining(m_ptr))
speed += 10;
- if (MON_SLOW(m_ptr))
+ if (monster_slow_remaining(m_ptr))
speed -= 10;
if (ironman_nightmare)
speed += 5;
strcat(buf, "xxx ");
}
- if (MON_CSLEEP(m_ptr))
+ if (monster_csleep_remaining(m_ptr))
strcat(buf, _("睡眠 ", "sleeping "));
- if (MON_STUNNED(m_ptr))
+ if (monster_stunned_remaining(m_ptr))
strcat(buf, _("朦朧 ", "stunned "));
- if (MON_MONFEAR(m_ptr))
+ if (monster_fear_remaining(m_ptr))
strcat(buf, _("恐怖 ", "scared "));
- if (MON_CONFUSED(m_ptr))
+ if (monster_confused_remaining(m_ptr))
strcat(buf, _("混乱 ", "confused "));
- if (MON_INVULNER(m_ptr))
+ if (monster_invulner_remaining(m_ptr))
strcat(buf, _("無敵 ", "invulnerable "));
buf[strlen(buf) - 1] = '\0';
prt(buf, 0, 0);
bool is_resistible = (r_ptr->a_ability_flags2 & RF6_TPORT) != 0;
is_resistible &= (r_ptr->flagsr & RFR_RES_TELE) == 0;
- is_resistible &= MON_CSLEEP(m_ptr) == 0;
+ is_resistible &= monster_csleep_remaining(m_ptr) == 0;
if (is_resistible) {
teleport_monster_to(creature_ptr, tmp_m_idx, creature_ptr->y, creature_ptr->x, r_ptr->level, TELEPORT_SPONTANEOUS);
}
bool is_resistible = (r_ptr->a_ability_flags2 & RF6_TPORT) != 0;
is_resistible &= (r_ptr->flagsr & RFR_RES_TELE) == 0;
- is_resistible &= MON_CSLEEP(m_ptr) == 0;
+ is_resistible &= monster_csleep_remaining(m_ptr) == 0;
if (is_resistible) {
teleport_monster_to(target_ptr, tmp_m_idx, target_ptr->y, target_ptr->x, r_ptr->level, TELEPORT_SPONTANEOUS);
}
f_ptr = &f_info[g_ptr->feat];
g_ptr->info &= ~(CAVE_ROOM | CAVE_ICKY);
m_ptr = &caster_ptr->current_floor_ptr->m_list[g_ptr->m_idx];
- if (g_ptr->m_idx && MON_CSLEEP(m_ptr))
+ if (g_ptr->m_idx && monster_csleep_remaining(m_ptr))
{
(void)set_monster_csleep(caster_ptr, g_ptr->m_idx, 0);
if (m_ptr->ml)
/*!
- * @file xtra1.c
* @brief プレイヤーのステータス処理 / status
* @date 2018/09/25
* @author
#include "io/targeting.h"
#include "market/arena-info-table.h"
#include "monster/monster-flag-types.h"
+#include "monster/monster-status.h"
#include "monster/monster.h"
#include "monster/smart-learn-types.h"
#include "object/object-flavor.h"
if (player_ptr->riding)
{
monster_type *m_ptr = &floor_ptr->m_list[player_ptr->riding];
- if (MON_FAST(m_ptr) && !MON_SLOW(m_ptr)) attr = TERM_L_BLUE;
- else if (MON_SLOW(m_ptr) && !MON_FAST(m_ptr)) attr = TERM_VIOLET;
+ if (monster_fast_remaining(m_ptr) && !monster_slow_remaining(m_ptr)) attr = TERM_L_BLUE;
+ else if (monster_slow_remaining(m_ptr) && !monster_fast_remaining(m_ptr)) attr = TERM_VIOLET;
else attr = TERM_GREEN;
}
else if ((is_fast && !player_ptr->slow) || player_ptr->lightspeed) attr = TERM_YELLOW;
if (player_ptr->riding)
{
monster_type *m_ptr = &floor_ptr->m_list[player_ptr->riding];
- if (MON_FAST(m_ptr) && !MON_SLOW(m_ptr)) attr = TERM_L_BLUE;
- else if (MON_SLOW(m_ptr) && !MON_FAST(m_ptr)) attr = TERM_VIOLET;
+ if (monster_fast_remaining(m_ptr) && !monster_slow_remaining(m_ptr)) attr = TERM_L_BLUE;
+ else if (monster_slow_remaining(m_ptr) && !monster_fast_remaining(m_ptr)) attr = TERM_VIOLET;
else attr = TERM_RED;
}
else if (is_fast && !player_ptr->slow) attr = TERM_YELLOW;
TERM_COLOR attr = TERM_RED;
/* Invulnerable */
- if (MON_INVULNER(m_ptr)) attr = TERM_WHITE;
+ if (monster_invulner_remaining(m_ptr)) attr = TERM_WHITE;
/* Asleep */
- else if (MON_CSLEEP(m_ptr)) attr = TERM_BLUE;
+ else if (monster_csleep_remaining(m_ptr)) attr = TERM_BLUE;
/* Afraid */
- else if (MON_MONFEAR(m_ptr)) attr = TERM_VIOLET;
+ else if (monster_fear_remaining(m_ptr)) attr = TERM_VIOLET;
/* Healthy */
else if (pct >= 100) attr = TERM_L_GREEN;
#include "view/display-player-middle.h"
#include "combat/shoot.h"
#include "floor/floor.h"
+#include "monster/monster-status.h"
#include "object-enchant/special-object-flags.h"
#include "perception/object-perception.h"
#include "player/player-effects.h"
}
else
{
- if (MON_FAST(&creature_ptr->current_floor_ptr->m_list[creature_ptr->riding])) tmp_speed += 10;
- if (MON_SLOW(&creature_ptr->current_floor_ptr->m_list[creature_ptr->riding])) tmp_speed -= 10;
+ if (monster_fast_remaining(&creature_ptr->current_floor_ptr->m_list[creature_ptr->riding])) tmp_speed += 10;
+ if (monster_slow_remaining(&creature_ptr->current_floor_ptr->m_list[creature_ptr->riding])) tmp_speed -= 10;
}
return tmp_speed;