*/
#include "angband.h"
+#include "util.h"
+
+#include "floor.h"
+#include "dungeon.h"
+#include "grid.h"
#include "object-curse.h"
-#include "projection.h"
#include "quest.h"
#include "realm-hex.h"
#include "player-move.h"
+#include "player-status.h"
+#include "monster.h"
+#include "monster-spell.h"
+#include "spells.h"
+#include "world.h"
+#include "realm-song.h"
+#include "view-mainwindow.h"
+#include "player-race.h"
+#include "player-class.h"
/*!
if (smart & (SM_RES_NETH))
{
- if (prace_is_(RACE_SPECTRE))
+ if (PRACE_IS_(p_ptr, RACE_SPECTRE))
{
f4 &= ~(RF4_BR_NETH);
f5 &= ~(RF5_BA_NETH);
if (smart & (SM_RES_DARK))
{
- if (prace_is_(RACE_VAMPIRE))
+ if (PRACE_IS_(p_ptr, RACE_VAMPIRE))
{
f4 &= ~(RF4_BR_DARK);
f5 &= ~(RF5_BA_DARK);
for (x = x1 - 2; x <= x1 + 2; x++)
{
/* Ignore illegal locations */
- if (!in_bounds(y, x)) continue;
+ if (!in_bounds(current_floor_ptr, y, x)) continue;
/* Only check a circular area */
if (distance(y1, x1, y, x)>2) continue;
*/
static bool spell_special(byte spell)
{
- if (p_ptr->inside_battle) return FALSE;
+ if (p_ptr->phase_out) return FALSE;
if (spell == 160 + 7) return (TRUE);
return (FALSE);
}
/* Elemental resistances */
if (r_ptr->flags4 & RF4_BR_ACID)
{
- if (!p_ptr->immune_acid && (p_ptr->oppose_acid || music_singing(MUSIC_RESIST))) return (TRUE);
+ if (!p_ptr->immune_acid && (p_ptr->oppose_acid || music_singing(p_ptr, MUSIC_RESIST))) return (TRUE);
if (p_ptr->special_defense & DEFENSE_ACID) return (TRUE);
}
{
if (!((p_ptr->prace == RACE_DEMON) && p_ptr->lev > 44))
{
- if (!p_ptr->immune_fire && (p_ptr->oppose_fire || music_singing(MUSIC_RESIST))) return (TRUE);
+ if (!p_ptr->immune_fire && (p_ptr->oppose_fire || music_singing(p_ptr, MUSIC_RESIST))) return (TRUE);
if (p_ptr->special_defense & DEFENSE_FIRE) return (TRUE);
}
}
if (r_ptr->flags4 & RF4_BR_ELEC)
{
- if (!p_ptr->immune_elec && (p_ptr->oppose_elec || music_singing(MUSIC_RESIST))) return (TRUE);
+ if (!p_ptr->immune_elec && (p_ptr->oppose_elec || music_singing(p_ptr, MUSIC_RESIST))) return (TRUE);
if (p_ptr->special_defense & DEFENSE_ELEC) return (TRUE);
}
if (r_ptr->flags4 & RF4_BR_COLD)
{
- if (!p_ptr->immune_cold && (p_ptr->oppose_cold || music_singing(MUSIC_RESIST))) return (TRUE);
+ if (!p_ptr->immune_cold && (p_ptr->oppose_cold || music_singing(p_ptr, MUSIC_RESIST))) return (TRUE);
if (p_ptr->special_defense & DEFENSE_COLD) return (TRUE);
}
{
if (!((p_ptr->pclass == CLASS_NINJA) && p_ptr->lev > 44))
{
- if (p_ptr->oppose_pois || music_singing(MUSIC_RESIST)) return (TRUE);
+ if (p_ptr->oppose_pois || music_singing(p_ptr, MUSIC_RESIST)) return (TRUE);
if (p_ptr->special_defense & DEFENSE_POIS) return (TRUE);
}
}
if ((p_ptr->special_attack & ATTACK_COLD) && !(r_ptr->flagsr & RFR_EFF_IM_COLD_MASK)) return (TRUE);
if ((p_ptr->special_attack & ATTACK_POIS) && !(r_ptr->flagsr & RFR_EFF_IM_POIS_MASK)) return (TRUE);
- /* Speed */
if (p_ptr->pspeed < 145)
{
if (IS_FAST()) return (TRUE);
/* Remove the "ineffective" spells */
remove_bad_spells(m_idx, &f4, &f5, &f6);
- if (p_ptr->inside_arena || p_ptr->inside_battle)
+ if (p_ptr->inside_arena || p_ptr->phase_out)
{
f4 &= ~(RF4_SUMMON_MASK);
f5 &= ~(RF5_SUMMON_MASK);
break;
default:
- return FALSE; /* Paranoia */
+ return FALSE;
}
/* Abort if no spell was chosen */
if (!spell_is_inate(thrown_spell)
&& (in_no_magic_dungeon || (MON_STUNNED(m_ptr) && one_in_(2)) || (randint0(100) < failrate)))
{
- disturb(TRUE, TRUE);
+ disturb(p_ptr, TRUE, TRUE);
msg_format(_("%^sは呪文を唱えようとしたが失敗した。", "%^s tries to cast a spell, but fails."), m_name);
return (TRUE);
p_ptr->mane_spell[p_ptr->mane_num] = thrown_spell - 96;
p_ptr->mane_dam[p_ptr->mane_num] = dam;
p_ptr->mane_num++;
- new_mane = TRUE;
+ p_ptr->new_mane = TRUE;
p_ptr->redraw |= (PR_IMITATION);
}