#include "angband.h"
#include "cmd-pet.h"
+#include "monsterrace-hook.h"
/*!
}
}
/* Hack -- no fighting away from player */
- else if ((m_ptr->cdis < t_ptr->cdis) &&
- (t_ptr->cdis > p_ptr->pet_follow_distance))
+ else if ((m_ptr->cdis < t_ptr->cdis) && (t_ptr->cdis > p_ptr->pet_follow_distance))
{
continue;
}
if (p_ptr->riding == m_idx) p_ptr->redraw |= (PR_UHEALTH);
}
- /* Wake it up */
(void)set_monster_csleep(m_idx, 0);
if (p_ptr->riding && (m_idx == p_ptr->riding)) disturb(TRUE, TRUE);
{
msg_format(_("%^sはダメージを受けない。", "%^s is unharmed."), m_name);
}
-
return;
}
}
/* Hurt it */
- m_ptr->hp -= (s16b)dam;
+ m_ptr->hp -= dam;
/* It is dead now... or is it? */
if (m_ptr->hp < 0)
else
{
/* Make a sound */
- if (!monster_living(r_ptr))
+ if (!monster_living(m_ptr->r_idx))
{
sound(SOUND_N_KILL);
}
msg_format(_("%^s%s", "%^s%s"), m_name, note);
}
/* Death by normal attack -- nonliving monster */
- else if (!monster_living(r_ptr))
+ else if (!monster_living(m_ptr->r_idx))
{
msg_format(_("%^sは破壊された。", "%^s is destroyed."), m_name);
}
}
monster_gain_exp(who, m_ptr->r_idx);
-
- /* Generate treasure */
monster_death(m_idx, FALSE);
-
-
delete_monster_idx(m_idx);
/* Not afraid */
monster_race *r_ptr = &r_info[m_ptr->r_idx];
- u16b p_lev, m_lev;
+ PLAYER_LEVEL p_lev;
+ DEPTH m_lev;
HIT_POINT p_chp, p_mhp;
HIT_POINT m_chp, m_mhp;
u32b p_val, m_val;
{
int cost;
- /* Get the location */
y = y1 + ddy_ddd[i];
x = x1 + ddx_ddd[i];
/* Check nearby grids, diagonals first */
for (i = 7; i >= 0; i--)
{
- /* Get the location */
y = y1 + ddy_ddd[i];
x = x1 + ddx_ddd[i];
{
POSITION dis, s;
- /* Get the location */
y = fy + ddy_ddd[i];
x = fx + ddx_ddd[i];
* @param mm 移動方向を返す方向IDの参照ポインタ
* @return 有効方向があった場合TRUEを返す
*/
-static bool get_moves(MONSTER_IDX m_idx, int *mm)
+static bool get_moves(MONSTER_IDX m_idx, DIRECTION *mm)
{
monster_type *m_ptr = &m_list[m_idx];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
/* Monster hits */
if (!effect || check_hit2(power, rlev, ac, MON_STUNNED(m_ptr)))
{
- /* Wake it up */
(void)set_monster_csleep(t_idx, 0);
if (t_ptr->ml)
break;
case BLOW_EFFECT_TYPE_HEAL:
- if ((monster_living(tr_ptr)) && (damage > 2))
+ if ((monster_living(m_idx)) && (damage > 2))
{
bool did_heal = FALSE;
case RBM_ENGULF:
case RBM_CHARGE:
{
- /* Wake it up */
(void)set_monster_csleep(t_idx, 0);
/* Visible monsters */
monster_race *r_ptr = &r_info[m_ptr->r_idx];
monster_race *ap_r_ptr = &r_info[m_ptr->ap_r_idx];
- int i, d;
- POSITION oy, ox, ny, nx;
+ int i, d;
+ POSITION oy, ox, ny, nx;
- int mm[8];
+ DIRECTION mm[8];
cave_type *c_ptr;
feature_type *f_ptr;
if (see_m)
{
char m_name[80];
-
- /* Acquire the monster name */
monster_desc(m_name, m_ptr, 0);
msg_format(_("%sは消え去った!", "%^s disappears!"), m_name);
}
{
bool sad = FALSE;
- if (is_pet(m_ptr) && !(m_ptr->ml))
- sad = TRUE;
+ if (is_pet(m_ptr) && !(m_ptr->ml)) sad = TRUE;
if (see_m)
{
char m_name[80];
-
- /* Acquire the monster name */
monster_desc(m_name, m_ptr, 0);
msg_format(_("%sは消え去った!", "%^s disappears!"), m_name);
delete_monster_idx(m_idx);
-
if (sad)
{
msg_print(_("少しの間悲しい気分になった。", "You feel sad for a moment."));
if (m_ptr->ml)
{
char m_name[80];
-
- /* Acquire the monster name */
monster_desc(m_name, m_ptr, 0);
/* Dump a message */
{
if (r_ptr->freq_spell && (randint1(100) <= r_ptr->freq_spell))
{
- int k, count = 0;
- int rlev = ((r_ptr->level >= 1) ? r_ptr->level : 1);
- u32b p_mode = is_pet(m_ptr) ? PM_FORCE_PET : 0L;
+ int k, count = 0;
+ DEPTH rlev = ((r_ptr->level >= 1) ? r_ptr->level : 1);
+ BIT_FLAGS p_mode = is_pet(m_ptr) ? PM_FORCE_PET : 0L;
for (k = 0; k < 6; k++)
{
/* Give priority to counter attack? */
if (m_ptr->target_y)
{
- int t_m_idx = cave[m_ptr->target_y][m_ptr->target_x].m_idx;
+ MONSTER_IDX t_m_idx = cave[m_ptr->target_y][m_ptr->target_x].m_idx;
/* The monster must be an enemy, and projectable */
- if (t_m_idx &&
- are_enemies(m_ptr, &m_list[t_m_idx]) &&
+ if (t_m_idx && are_enemies(m_ptr, &m_list[t_m_idx]) &&
projectable(m_ptr->fy, m_ptr->fx, m_ptr->target_y, m_ptr->target_x))
{
counterattack = TRUE;
y_ptr->fx = ox;
/* Update the old monster */
- update_mon(c_ptr->m_idx, TRUE);
+ update_monster(c_ptr->m_idx, TRUE);
}
/* Hack -- Update the new location */
/* Move the monster */
m_ptr->fy = ny;
m_ptr->fx = nx;
-
- /* Update the monster */
- update_mon(m_idx, TRUE);
+ update_monster(m_idx, TRUE);
/* Redraw the old grid */
lite_spot(oy, ox);
{
BIT_FLAGS flgs[TR_FLAG_SIZE], flg2 = 0L, flg3 = 0L, flgr = 0L;
char m_name[80], o_name[MAX_NLEN];
-
- /* Acquire object */
object_type *o_ptr = &o_list[this_o_idx];
/* Acquire next object */
/* Acquire the object name */
object_desc(o_name, o_ptr, 0);
-
- /* Acquire the monster name */
monster_desc(m_name, m_ptr, MD_INDEF_HIDDEN);
/* React to objects that hurt the monster */
if (see_m)
{
char m_name[80];
-
- /* Acquire the monster name */
monster_desc(m_name, m_ptr, 0);
/* Dump a message */
monster_type *m_ptr;
monster_race *r_ptr;
- int old_monster_race_idx;
+ MONRACE_IDX old_monster_race_idx;
- u32b old_r_flags1 = 0L;
- u32b old_r_flags2 = 0L;
- u32b old_r_flags3 = 0L;
- u32b old_r_flags4 = 0L;
- u32b old_r_flags5 = 0L;
- u32b old_r_flags6 = 0L;
- u32b old_r_flagsr = 0L;
+ BIT_FLAGS old_r_flags1 = 0L;
+ BIT_FLAGS old_r_flags2 = 0L;
+ BIT_FLAGS old_r_flags3 = 0L;
+ BIT_FLAGS old_r_flags4 = 0L;
+ BIT_FLAGS old_r_flags5 = 0L;
+ BIT_FLAGS old_r_flags6 = 0L;
+ BIT_FLAGS old_r_flagsr = 0L;
- byte old_r_blows0 = 0;
- byte old_r_blows1 = 0;
- byte old_r_blows2 = 0;
- byte old_r_blows3 = 0;
+ byte old_r_blows0 = 0;
+ byte old_r_blows1 = 0;
+ byte old_r_blows2 = 0;
+ byte old_r_blows3 = 0;
- byte old_r_cast_spell = 0;
+ byte old_r_cast_spell = 0;
- int speed;
+ SPEED speed;
/* Clear monster fighting indicator */
mon_fight = FALSE;