/* Wake it up */
(void)set_monster_csleep(m_idx, 0);
- if (p_ptr->riding && (m_idx == p_ptr->riding)) disturb(1, 1);
+ if (p_ptr->riding && (m_idx == p_ptr->riding)) disturb(TRUE, TRUE);
if (MON_INVULNER(m_ptr) && randint0(PENETRATE_INVULNERABILITY))
{
/* Generate treasure */
monster_death(m_idx, FALSE);
- /* Delete the monster */
+
delete_monster_idx(m_idx);
/* Not afraid */
/* Hack -- note fear */
(*fear) = TRUE;
- /* XXX XXX XXX Hack -- Add some timed fear */
+ /* Hack -- Add some timed fear */
(void)set_monster_monfear(m_idx, (randint1(10) +
(((dam >= m_ptr->hp) && (percentage > 7)) ?
20 : ((11 - percentage) * 5))));
/* Check nearby grids, diagonals first */
for (i = 7; i >= 0; i--)
{
- int dis, s;
+ POSITION dis, s;
/* Get the location */
y = fy + ddy_ddd[i];
* It is probably better to replace these arrays with code to compute
* the relevant arrays, even if the storage is pre-allocated in hard
* coded sizes. At the very least, code should be included which is
- * able to generate and dump these arrays (ala "los()"). XXX XXX XXX
+ * able to generate and dump these arrays (ala "los()").
*
- * Also, the storage needs could be halved by using bytes. XXX XXX XXX
+ * Also, the storage needs could be halved by using bytes.
*
* These arrays could be combined into two big arrays, using sub-arrays
* to hold the offsets and lengths of each portion of the sub-arrays, and
- * this could perhaps also be used somehow in the "look" code. XXX XXX XXX
+ * this could perhaps also be used somehow in the "look" code.
*/
-static sint d_off_y_0[] =
-{ 0 };
-
-static sint d_off_x_0[] =
-{ 0 };
-
-
-static sint d_off_y_1[] =
-{ -1, -1, -1, 0, 0, 1, 1, 1, 0 };
-
-static sint d_off_x_1[] =
-{ -1, 0, 1, -1, 1, -1, 0, 1, 0 };
-
+static sint d_off_y_0[] = { 0 };
+static sint d_off_x_0[] = { 0 };
-static sint d_off_y_2[] =
-{ -1, -1, -2, -2, -2, 0, 0, 1, 1, 2, 2, 2, 0 };
+static sint d_off_y_1[] = { -1, -1, -1, 0, 0, 1, 1, 1, 0 };
+static sint d_off_x_1[] = { -1, 0, 1, -1, 1, -1, 0, 1, 0 };
-static sint d_off_x_2[] =
-{ -2, 2, -1, 0, 1, -2, 2, -2, 2, -1, 0, 1, 0 };
+static sint d_off_y_2[] = { -1, -1, -2, -2, -2, 0, 0, 1, 1, 2, 2, 2, 0 };
+static sint d_off_x_2[] = { -2, 2, -1, 0, 1, -2, 2, -2, 2, -1, 0, 1, 0 };
+static sint d_off_y_3[] = { -1, -1, -2, -2, -3, -3, -3, 0, 0, 1, 1, 2, 2, 3, 3, 3, 0 };
+static sint d_off_x_3[] = { -3, 3, -2, 2, -1, 0, 1, -3, 3, -3, 3, -2, 2, -1, 0, 1, 0 };
-static sint d_off_y_3[] =
-{ -1, -1, -2, -2, -3, -3, -3, 0, 0, 1, 1, 2, 2,
- 3, 3, 3, 0 };
-
-static sint d_off_x_3[] =
-{ -3, 3, -2, 2, -1, 0, 1, -3, 3, -3, 3, -2, 2,
- -1, 0, 1, 0 };
-
-
-static sint d_off_y_4[] =
-{ -1, -1, -2, -2, -3, -3, -3, -3, -4, -4, -4, 0,
- 0, 1, 1, 2, 2, 3, 3, 3, 3, 4, 4, 4, 0 };
-
-static sint d_off_x_4[] =
-{ -4, 4, -3, 3, -2, -3, 2, 3, -1, 0, 1, -4, 4,
- -4, 4, -3, 3, -2, -3, 2, 3, -1, 0, 1, 0 };
+static sint d_off_y_4[] = { -1, -1, -2, -2, -3, -3, -3, -3, -4, -4, -4, 0, 0, 1, 1, 2, 2, 3, 3, 3, 3, 4, 4, 4, 0 };
+static sint d_off_x_4[] = { -4, 4, -3, 3, -2, -3, 2, 3, -1, 0, 1, -4, 4, -4, 4, -3, 3, -2, -3, 2, 3, -1, 0, 1, 0 };
static sint d_off_y_5[] =
y = m_ptr->fy - y2;
x = m_ptr->fx - x2;
- /* Done */
done = TRUE;
}
}
* @param stun 攻撃側モンスターが朦朧状態ならTRUEを返す
* @return 命中ならばTRUEを返す
*/
-static int check_hit2(int power, int level, int ac, int stun)
+static int check_hit2(int power, DEPTH level, ARMOUR_CLASS ac, int stun)
{
int i, k;
* @param t_idx 目標側モンスターの参照ID
* @return 実際に打撃処理が行われた場合TRUEを返す
*/
-static bool monst_attack_monst(MONSTER_IDX m_idx, IDX t_idx)
+static bool monst_attack_monst(MONSTER_IDX m_idx, MONSTER_IDX t_idx)
{
monster_type *m_ptr = &m_list[m_idx];
monster_type *t_ptr = &m_list[t_idx];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
monster_race *tr_ptr = &r_info[t_ptr->r_idx];
- int ap_cnt;
- int ac, rlev, pt;
+ ARMOUR_CLASS ap_cnt;
+ ARMOUR_CLASS ac;
+ DEPTH rlev;
+ int pt;
char m_name[80], t_name[80];
char temp[MAX_NLEN];
bool blinked;
mon_fight = TRUE;
}
- if (p_ptr->riding && (m_idx == p_ptr->riding)) disturb(1, 1);
+ if (p_ptr->riding && (m_idx == p_ptr->riding)) disturb(TRUE, TRUE);
/* Scan through all four blows */
for (ap_cnt = 0; ap_cnt < 4; ap_cnt++)
case RBM_EXPLODE:
{
- if (see_either) disturb(1, 1);
+ if (see_either) disturb(TRUE, TRUE);
act = _("爆発した。", "explodes.");
explode = TRUE;
touched = FALSE;
}
}
- /* Message */
if (act && see_either)
{
#ifdef JP
/* Visible monsters */
if (see_m)
{
- /* Message */
#ifdef JP
- msg_format("%sは%^sの攻撃をかわした。", t_name,m_name);
+ msg_format("%sは%^sの攻撃をかわした。", t_name, m_name);
#else
msg_format("%^s misses %s.", m_name, t_name);
#endif
* fixate on opening a door even if they cannot open it. Actually,\n
* the same thing happens to normal monsters when they hit a door\n
*\n
- * XXX XXX XXX In addition, monsters which *cannot* open or bash\n
+ * In addition, monsters which *cannot* open or bash\n
* down a door will still stand there trying to open it...\n
*\n
* XXX Technically, need to check for monster in the way\n
do_cmd_write_nikki(NIKKI_NAMED_PET, RECORD_NAMED_PET_LOSE_PARENT, m_name);
}
- /* Delete the monster */
+
delete_monster_idx(m_idx);
return;
/* Acquire the monster name */
monster_desc(m_name, m_ptr, 0);
- /* Oops */
msg_format(_("%sは消え去った!", "%^s disappears!"), m_name);
}
/* Generate treasure, etc */
monster_death(m_idx, FALSE);
- /* Delete the monster */
+
delete_monster_idx(m_idx);
if (sad)
msg_format(_("%sは傷の痛さの余りあなたの束縛から逃れようとしている。",
"%^s seems to be in so much pain, and trying to escape from your restriction."), m_name);
riding_pinch++;
- disturb(1, 1);
+ disturb(TRUE, TRUE);
}
else
{
if (avoid || lonely || distant)
{
/* Remember the leash length */
- int dis = p_ptr->pet_follow_distance;
+ POSITION dis = p_ptr->pet_follow_distance;
/* Hack -- adjust follow distance temporarily */
if (p_ptr->pet_follow_distance > PET_SEEK_DIST)
/* Do not bash the door */
may_bash = FALSE;
- /* Take a turn */
do_turn = TRUE;
}
/* Locked doors (not jammed) */
else
{
- /* Try to unlock it XXX XXX XXX */
+ /* Try to unlock it */
if (randint0(m_ptr->hp / 10) > f_ptr->power)
{
/* Unlock the door */
/* Do not bash the door */
may_bash = FALSE;
- /* Take a turn */
do_turn = TRUE;
}
}
if (may_bash && (r_ptr->flags2 & RF2_BASH_DOOR) && have_flag(f_ptr->flags, FF_BASH) &&
(!is_pet(m_ptr) || (p_ptr->pet_extra_flags & PF_OPEN_DOORS)))
{
- /* Attempt to Bash XXX XXX XXX */
+ /* Attempt to Bash */
if (check_hp_for_feat_destruction(f_ptr, m_ptr) && (randint0(m_ptr->hp / 10) > f_ptr->power))
{
- /* Message */
if (have_flag(f_ptr->flags, FF_GLASS))
msg_print(_("ガラスが砕ける音がした!", "You hear a glass was crashed!"));
else
msg_print(_("ドアを叩き開ける音がした!", "You hear a door burst open!"));
/* Disturb (sometimes) */
- if (disturb_minor) disturb(0, 0);
+ if (disturb_minor) disturb(FALSE, FALSE);
/* The door was bashed open */
did_bash_door = TRUE;
/* Allow movement */
do_move = TRUE;
- /* Notice */
note_spot(ny, nx);
}
}
/* Wake up the moved monster */
(void)set_monster_csleep(c_ptr->m_idx, 0);
- /* XXX XXX XXX Message */
+ /* Message */
}
}
/* Note changes to viewable region */
do_view = TRUE;
- /* Take a turn */
do_turn = TRUE;
}
/* Creature has been allowed move */
if (do_move)
{
- /* Take a turn */
do_turn = TRUE;
if (have_flag(f_ptr->flags, FF_TREE))
(disturb_near && (m_ptr->mflag & MFLAG_VIEW) && projectable(p_ptr->y, p_ptr->x, m_ptr->fy, m_ptr->fx)) ||
(disturb_high && ap_r_ptr->r_tkills && ap_r_ptr->level >= p_ptr->lev)))
{
- /* Disturb */
if (is_hostile(m_ptr))
- disturb(0, 1);
+ disturb(FALSE, TRUE);
}
/* Take or Kill objects on the floor */
if (c_ptr->o_idx && (r_ptr->flags2 & (RF2_TAKE_ITEM | RF2_KILL_ITEM)) &&
(!is_pet(m_ptr) || ((p_ptr->pet_extra_flags & PF_PICKUP_ITEMS) && (r_ptr->flags2 & RF2_TAKE_ITEM))))
{
- s16b this_o_idx, next_o_idx;
+ OBJECT_IDX this_o_idx, next_o_idx;
bool do_take = (r_ptr->flags2 & RF2_TAKE_ITEM) ? TRUE : FALSE;
/* Scan all objects in the grid */
for (this_o_idx = c_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
{
- u32b flgs[TR_FLAG_SIZE], flg2 = 0L, flg3 = 0L, flgr = 0L;
+ BIT_FLAGS flgs[TR_FLAG_SIZE], flg2 = 0L, flg3 = 0L, flgr = 0L;
char m_name[80], o_name[MAX_NLEN];
/* Acquire object */
msg_format(_("%^sが%sを破壊した。", "%^s destroys %s."), m_name, o_name);
}
- /* Delete the object */
delete_object_idx(this_o_idx);
}
}
/* Update some things */
p_ptr->update |= (PU_FLOW);
- /* Window stuff */
p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
}
if (m_ptr->ml) chg_virtue(V_COMPASSION, -1);
- /* XXX XXX XXX Actually do something now (?) */
+ /* Actually do something now (?) */
}
}
(old_r_blows3 != r_ptr->r_blows[3]) ||
(old_r_cast_spell != r_ptr->r_cast_spell))
{
- /* Window stuff */
p_ptr->window |= (PW_MONSTER);
}
}