#include "angband.h"
#include "object-curse.h"
+#include "projection.h"
+#include "quest.h"
+#include "realm-hex.h"
/*!
f5 &= ~(RF5_DRAIN_MANA);
}
- /* XXX XXX XXX No spells left? */
+ /* No spells left? */
/* if (!f4 && !f5 && !f6) ... */
(*f4p) = f4;
/* Scan the pile of objects */
for (this_o_idx = c_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
{
- /* Acquire object */
object_type *o_ptr = &o_list[this_o_idx];
/* Acquire next object */
* @details
* Returns "TRUE" if a spell (or whatever) was (successfully) cast.\n
*\n
- * XXX XXX XXX This function could use some work, but remember to\n
+ * This function could use some work, but remember to\n
* keep it as optimized as possible, while retaining generic code.\n
*\n
* Verify the various "blind-ness" checks in the code.\n
*\n
- * XXX XXX XXX Note that several effects should really not be "seen"\n
+ * Note that several effects should really not be "seen"\n
* if the player is blind. See also "effects.c" for other "mistakes".\n
*\n
* Perhaps monsters should breathe at locations *near* the player,\n
SPELL_IDX thrown_spell = 0;
DEPTH rlev;
PERCENTAGE failrate;
- byte spell[96], num = 0;
+ byte spell[96], num = 0;
BIT_FLAGS f4, f5, f6;
monster_type *m_ptr = &m_list[m_idx];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
- char m_name[80];
+ GAME_TEXT m_name[MAX_NLEN];
#ifndef JP
char m_poss[80];
#endif
bool do_spell = DO_SPELL_NONE;
int dam = 0;
- /* Target location */
POSITION x = p_ptr->x;
POSITION y = p_ptr->y;
/* Check "projectable" */
bool direct;
- bool in_no_magic_dungeon = (d_info[dungeon_type].flags1 & DF1_NO_MAGIC) && dun_level
+ bool in_no_magic_dungeon = (d_info[p_ptr->dungeon_idx].flags1 & DF1_NO_MAGIC) && dun_level
&& (!p_ptr->inside_quest || is_fixed_quest_idx(p_ptr->inside_quest));
bool can_use_lite_area = FALSE;
/* Sometimes forbid inate attacks (breaths) */
if (randint0(100) >= (r_ptr->freq_spell * 2)) no_inate = TRUE;
- /* XXX XXX XXX Handle "track_target" option (?) */
+ /* Handle "track_target" option (?) */
/* Extract the racial spell flags */
}
else if ((f5 & RF5_BA_LITE) && (m_ptr->cdis <= MAX_RANGE))
{
- int by = y, bx = x;
+ POSITION by = y, bx = x;
get_project_point(m_ptr->fy, m_ptr->fx, &by, &bx, 0L);
if ((distance(by, bx, y, x) <= 3) && los(by, bx, y, x) && one_in_(5))
{
reset_target(m_ptr);
- /* Extract the monster level */
rlev = ((r_ptr->level >= 1) ? r_ptr->level : 1);
/* Forbid inate attacks sometimes */
if (!(r_ptr->flags2 & RF2_STUPID))
{
- if (d_info[dungeon_type].flags1 & DF1_DARKNESS) f6 &= ~(RF6_DARKNESS);
+ if (d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS) f6 &= ~(RF6_DARKNESS);
else if ((p_ptr->pclass == CLASS_NINJA) && !can_use_lite_area) f6 &= ~(RF6_DARKNESS);
}
}
if (!spell_is_inate(thrown_spell)
&& (in_no_magic_dungeon || (MON_STUNNED(m_ptr) && one_in_(2)) || (randint0(100) < failrate)))
{
- disturb(1, 1);
+ disturb(TRUE, TRUE);
msg_format(_("%^sは呪文を唱えようとしたが失敗した。", "%^s tries to cast a spell, but fails."), m_name);
return (TRUE);