#include "angband.h"
-#ifdef DRS_SMART_OPTIONS
-
/*
* And now for Intelligent monster attacks (including spells).
*
(*f6p) = f6;
}
-#endif /* DRS_SMART_OPTIONS */
-
/*
* Determine if there is a space near the player in which
if (distance(y1, x1, y, x)>2) continue;
/* ...nor on the Pattern */
- if ((cave[y][x].feat >= FEAT_PATTERN_START)
- && (cave[y][x].feat <= FEAT_PATTERN_XTRA2)) continue;
+ if (pattern_tile(y, x)) continue;
- /* Require empty floor grid in line of sight */
- if ((cave_empty_bold(y, x) || (cave[y][x].feat == FEAT_TREES)) && los(y1, x1, y, x) && los(y, x, y1, x1)) return (TRUE);
+ /* Require empty floor grid in line of projection */
+ if (cave_empty_bold(y, x) && projectable(y1, x1, y, x) && projectable(y, x, y1, x1)) return (TRUE);
}
}
{
if (distance(y, x, yy, xx) > 5) continue;
if (!los(y, x, yy, xx)) continue;
+ if (!projectable(y, x, yy, xx)) continue;
c_ptr = &cave[yy][xx];
/* Scan the pile of objects */
case GF_ROCKET:
flg |= PROJECT_STOP;
break;
+ case GF_DRAIN_MANA:
case GF_MIND_BLAST:
case GF_BRAIN_SMASH:
case GF_CAUSE_1:
{
if (new_curse & TRC_HEAVY_MASK) continue;
}
- if (((o_ptr->tval < TV_BOW) || (o_ptr->tval > TV_SWORD)) && (new_curse == TRC_LOW_MELEE)) continue;
- if (((o_ptr->tval < TV_BOOTS) || (o_ptr->tval > TV_DRAG_ARMOR)) && (new_curse == TRC_LOW_AC)) continue;
+ if (new_curse == TRC_LOW_MELEE && !object_is_weapon(o_ptr)) continue;
+ if (new_curse == TRC_LOW_AC && !object_is_armour(o_ptr)) continue;
break;
}
return new_curse;
object_flags(o_ptr, oflgs);
- object_desc(o_name, o_ptr, FALSE, 0);
+ object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
/* Extra, biased saving throw for blessed items */
if (have_flag(oflgs, TR_BLESSED) && (randint1(888) > chance))
}
if ((randint1(100) <= heavy_chance) &&
- (o_ptr->name1 || o_ptr->name2 || o_ptr->art_name))
+ (object_is_artifact(o_ptr) || object_is_ego(o_ptr)))
{
if (!(o_ptr->curse_flags & TRC_HEAVY_CURSE))
changed = TRUE;
}
else
{
- if (!cursed_p(o_ptr))
+ if (!object_is_cursed(o_ptr))
changed = TRUE;
o_ptr->curse_flags |= TRC_CURSED;
}
if (r_ptr->flags4 & RF4_BR_FIRE)
{
- if (!(prace_is_(RACE_DEMON) && p_ptr->lev > 44))
+ 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->special_defense & DEFENSE_FIRE) return (TRUE);
}
+#define DO_SPELL_NONE 0
+#define DO_SPELL_BR_LITE 1
+#define DO_SPELL_BR_DISI 2
+#define DO_SPELL_BA_LITE 3
+
/*
* Creatures can cast spells, shoot missiles, and breathe.
*
char m_poss[80];
#endif
bool no_inate = FALSE;
- bool do_disi = FALSE;
+ bool do_spell = DO_SPELL_NONE;
int dam = 0;
u32b mode = 0L;
int s_num_6 = (easy_band ? 2 : 6);
/* Check path */
if (projectable(m_ptr->fy, m_ptr->fx, y, x))
{
- /* Breath disintegration to the glyph if possible */
- if ((!cave_floor_bold(y,x)) && (r_ptr->flags4 & RF4_BR_DISI) && one_in_(2)) do_disi = TRUE;
+ feature_type *f_ptr = &f_info[cave[y][x].feat];
+
+ if (!have_flag(f_ptr->flags, FF_PROJECT))
+ {
+ /* Breath disintegration to the wall if possible */
+ if ((f4 & RF4_BR_DISI) && have_flag(f_ptr->flags, FF_HURT_DISI) && one_in_(2)) do_spell = DO_SPELL_BR_DISI;
+
+ /* Breath lite to the transparent wall if possible */
+ else if ((f4 & RF4_BR_LITE) && have_flag(f_ptr->flags, FF_LOS) && one_in_(2)) do_spell = DO_SPELL_BR_LITE;
+ }
}
/* Check path to next grid */
{
bool success = FALSE;
- if ((r_ptr->flags4 & RF4_BR_DISI) &&
- (m_ptr->cdis < MAX_RANGE/2) &&
+ if ((f4 & RF4_BR_DISI) && (m_ptr->cdis < MAX_RANGE/2) &&
in_disintegration_range(m_ptr->fy, m_ptr->fx, y, x) &&
(one_in_(10) || (projectable(y, x, m_ptr->fy, m_ptr->fx) && one_in_(2))))
{
- do_disi = TRUE;
+ do_spell = DO_SPELL_BR_DISI;
success = TRUE;
}
- else
+ else if ((f4 & RF4_BR_LITE) && (m_ptr->cdis < MAX_RANGE/2) &&
+ los(m_ptr->fy, m_ptr->fx, y, x) &&
+ (one_in_(10) || (projectable(y, x, m_ptr->fy, m_ptr->fx) && one_in_(2))))
+ {
+ do_spell = DO_SPELL_BR_LITE;
+ success = TRUE;
+ }
+ else if ((f5 & RF5_BA_LITE) && (m_ptr->cdis <= MAX_RANGE))
+ {
+ int 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_(10) || (projectable(y, x, m_ptr->fy, m_ptr->fx) && one_in_(2))))
+ {
+ do_spell = DO_SPELL_BA_LITE;
+ success = TRUE;
+ }
+ }
+
+ if (!success)
{
int i;
int tonari;
/* Access the next grid */
c_ptr = &cave[next_y][next_x];
- /* Skip door, rubble, wall */
- if ((c_ptr->feat >= FEAT_DOOR_HEAD) && (c_ptr->feat <= FEAT_PERM_SOLID)) continue;
-
- /* Skip tree */
- if (c_ptr->feat == FEAT_TREES) continue;
-
- /* Skip mountain */
- if (c_ptr->feat == FEAT_MOUNTAIN) continue;
+ /* Skip door, rubble, wall, tree, mountain, etc. */
+ if (!have_flag(f_flags_grid(c_ptr), FF_PROJECT)) continue;
if (projectable(m_ptr->fy, m_ptr->fx, next_y, next_x))
{
monster_desc(m_poss, m_ptr, MD_PRON_VISIBLE | MD_POSSESSIVE);
#endif
- if (do_disi)
- thrown_spell = 96+31;
- else
+ switch (do_spell)
{
- int attempt = 10;
- while(attempt--)
+ case DO_SPELL_NONE:
{
- thrown_spell = choose_attack_spell(m_idx, spell, num);
- if (thrown_spell) break;
+ int attempt = 10;
+ while (attempt--)
+ {
+ thrown_spell = choose_attack_spell(m_idx, spell, num);
+ if (thrown_spell) break;
+ }
}
+ break;
+
+ case DO_SPELL_BR_LITE:
+ thrown_spell = 96+14; /* RF4_BR_LITE */
+ break;
+
+ case DO_SPELL_BR_DISI:
+ thrown_spell = 96+31; /* RF4_BR_DISI */
+ break;
+
+ case DO_SPELL_BA_LITE:
+ thrown_spell = 128+20; /* RF5_BA_LITE */
+ break;
+
+ default:
+ return FALSE; /* Paranoia */
}
/* Abort if no spell was chosen */
{
if (!direct) return (FALSE);
disturb(1, 0);
- if (p_ptr->csp)
- {
- int r1;
-
- /* Basic message */
-#ifdef JP
-msg_format("%^s¤ËÀº¿À¥¨¥Í¥ë¥®¡¼¤òµÛ¤¤¼è¤é¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª", m_name);
-#else
- msg_format("%^s draws psychic energy from you!", m_name);
-#endif
-
-
- /* Attack power */
- r1 = (randint1(rlev) / 2) + 1;
-
- /* Full drain */
- if (r1 >= p_ptr->csp)
- {
- r1 = p_ptr->csp;
- p_ptr->csp = 0;
- p_ptr->csp_frac = 0;
- }
-
- /* Partial drain */
- else
- {
- p_ptr->csp -= r1;
- }
- learn_spell(MS_DRAIN_MANA);
-
- /* Redraw mana */
- p_ptr->redraw |= (PR_MANA);
-
- /* Window stuff */
- p_ptr->window |= (PW_PLAYER);
- p_ptr->window |= (PW_SPELL);
-
- /* Heal the monster */
- if (m_ptr->hp < m_ptr->maxhp)
- {
- /* Heal */
- m_ptr->hp += (6 * r1);
- if (m_ptr->hp > m_ptr->maxhp) m_ptr->hp = m_ptr->maxhp;
-
- /* Redraw (later) if needed */
- if (p_ptr->health_who == m_idx) p_ptr->redraw |= (PR_HEALTH);
- if (p_ptr->riding == m_idx) p_ptr->redraw |= (PR_UHEALTH);
-
- /* Special message */
- if (seen)
- {
-#ifdef JP
-msg_format("%^s¤Ïµ¤Ê¬¤¬Îɤµ¤½¤¦¤À¡£", m_name);
-#else
- msg_format("%^s appears healthier.", m_name);
-#endif
-
- }
- }
- }
+ dam = (randint1(rlev) / 2) + 1;
+ breath(y, x, m_idx, GF_DRAIN_MANA, dam, 0, FALSE, MS_DRAIN_MANA, learnable);
update_smart_learn(m_idx, DRS_MANA);
break;
}
if (!direct) return (FALSE);
disturb(1, 0);
#ifdef JP
-msg_format("%^s¤¬ÇËÌǤμê¤òÊü¤Ã¤¿¡ª", m_name);
+msg_format("%^s¤¬<ÇËÌǤμê>¤òÊü¤Ã¤¿¡ª", m_name);
#else
msg_format("%^s invokes the Hand of Doom!", m_name);
#endif
#endif
teleport_away(m_idx, 10, FALSE);
- p_ptr->update |= (PU_MONSTERS | PU_MON_LITE);
+ p_ptr->update |= (PU_MONSTERS);
break;
}
for (i=INVEN_RARM;i<INVEN_TOTAL;i++)
{
o_ptr = &inventory[i];
- if(!cursed_p(o_ptr))
+ if (!object_is_cursed(o_ptr))
{
object_flags(o_ptr, flgs);
- if((have_flag(flgs, TR_TELEPORT)) || (p_ptr->muta1 & MUT1_VTELEPORT) || (p_ptr->pclass == CLASS_IMITATOR))
+ if ((have_flag(flgs, TR_TELEPORT)) || (p_ptr->muta1 & MUT1_VTELEPORT) || (p_ptr->pclass == CLASS_IMITATOR))
{
#ifdef JP
- if(get_check_strict("¤Ä¤¤¤Æ¤¤¤¤Þ¤¹¤«¡©", CHECK_OKAY_CANCEL))
+ if (get_check_strict("¤Ä¤¤¤Æ¤¤¤¤Þ¤¹¤«¡©", CHECK_OKAY_CANCEL))
#else
- if(get_check_strict("Do you follow it? ", CHECK_OKAY_CANCEL))
+ if (get_check_strict("Do you follow it? ", CHECK_OKAY_CANCEL))
#endif
{
if (one_in_(3))
{
- teleport_player(200);
+ teleport_player(200, TRUE);
#ifdef JP
msg_print("¼ºÇÔ¡ª");
#else
msg_print("Failed!");
#endif
}
- else teleport_player_to(m_ptr->fy, m_ptr->fx, TRUE);
+ else teleport_player_to(m_ptr->fy, m_ptr->fx, TRUE, FALSE);
p_ptr->energy_need += ENERGY_NEED();
}
break;
msg_format("%^s suddenly go out of your sight!", m_name);
#endif
teleport_away(m_idx, 10, FALSE);
- p_ptr->update |= (PU_MONSTERS | PU_MON_LITE);
+ p_ptr->update |= (PU_MONSTERS);
}
else
{
msg_format("%^s holds you, and drops from the sky.", m_name);
#endif
dam = damroll(4, 8);
- teleport_player_to(m_ptr->fy, m_ptr->fx, FALSE);
+ teleport_player_to(m_ptr->fy, m_ptr->fx, FALSE, TRUE);
sound(SOUND_FALL);
msg_format("%^s commands you to return.", m_name);
#endif
- teleport_player_to(m_ptr->fy, m_ptr->fx, TRUE);
+ teleport_player_to(m_ptr->fy, m_ptr->fx, TRUE, TRUE);
learn_spell(MS_TELE_TO);
break;
}
#endif
learn_spell(MS_TELE_AWAY);
- teleport_player(100);
+ teleport_player(100, TRUE);
break;
}
for (k = 0; k < 30; k++)
{
- if (!summon_possible(cy, cx) || !cave_floor_bold(cy, cx))
+ if (!summon_possible(cy, cx) || !cave_empty_bold(cy, cx))
{
int j;
for (j = 100; j > 0; j--)
{
scatter(&cy, &cx, y, x, 2, 0);
- if (cave_floor_bold(cy, cx)) break;
+ if (cave_empty_bold(cy, cx)) break;
}
if (!j) break;
}
- if (!cave_floor_bold(cy, cx)) continue;
+ if (!cave_empty_bold(cy, cx)) continue;
if (summon_named_creature(m_idx, cy, cx, MON_NAZGUL, mode))
{