-/*!
+/*!
* @file mspells2.c
- * @brief ¥â¥ó¥¹¥¿¡¼ËâË¡¤Î¼ÂÁõ(ÂÐ¥â¥ó¥¹¥¿¡¼½èÍý) / Monster spells (attack monster)
+ * @brief モンスター魔法の実装(対モンスター処理) / Monster spells (attack monster)
* @date 2014/01/17
* @author
* Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke\n
*/
#include "angband.h"
+#include "projection.h"
/*!
- * @brief ¥â¥ó¥¹¥¿¡¼¤¬Å¨ÂÐ¥â¥ó¥¹¥¿¡¼¤Ë¥Ó¡¼¥à¤òÅö¤Æ¤ë¤³¤È²Äǽ¤«¤òȽÄꤹ¤ë /
+ * @brief モンスターが敵対モンスターにビームを当てること可能かを判定する /
* Determine if a beam spell will hit the target.
- * @param y1 »ÏÅÀ¤ÎYºÂɸ
- * @param x1 »ÏÅÀ¤ÎXºÂɸ
- * @param y2 ÌÜɸ¤ÎYºÂɸ
- * @param x2 ÌÜɸ¤ÎXºÂɸ
- * @param m_ptr »ÈÍѤ¹¤ë¥â¥ó¥¹¥¿¡¼¤Î¹½Â¤Âλ²¾È¥Ý¥¤¥ó¥¿
- * @return ¥Ó¡¼¥à¤¬Åþã²Äǽ¤Ê¤é¤ÐTRUE¤òÊÖ¤¹
+ * @param y1 始点のY座標
+ * @param x1 始点のX座標
+ * @param y2 目標のY座標
+ * @param x2 目標のX座標
+ * @param m_ptr 使ç\94¨ã\81\99ã\82\8bã\83¢ã\83³ã\82¹ã\82¿ã\83¼ã\81®æ§\8bé\80 ä½\93å\8f\82ç\85§ã\83\9dã\82¤ã\83³ã\82¿
+ * @return ビームが到達可能ならばTRUEを返す
*/
static bool direct_beam(int y1, int x1, int y2, int x2, monster_type *m_ptr)
{
}
/*!
- * @brief ¥â¥ó¥¹¥¿¡¼¤¬Å¨ÂÐ¥â¥ó¥¹¥¿¡¼¤ËľÀܥ֥쥹¤òÅö¤Æ¤ë¤³¤È¤¬²Äǽ¤«¤òȽÄꤹ¤ë /
+ * @brief モンスターが敵対モンスターに直接ブレスを当てることが可能かを判定する /
* Determine if a breath will hit the target.
- * @param y1 »ÏÅÀ¤ÎYºÂɸ
- * @param x1 »ÏÅÀ¤ÎXºÂɸ
- * @param y2 ÌÜɸ¤ÎYºÂɸ
- * @param x2 ÌÜɸ¤ÎXºÂɸ
- * @param rad Ⱦ·Â
- * @param typ ¸ú²Ì°ÀID
- * @param is_friend TRUE¤Ê¤é¤Ð¡¢¥×¥ì¥¤¥ä¡¼¤ò´¬¤¹þ¤à»þ¤Ë¥Ö¥ì¥¹¤ÎȽÄê¤òFALSE¤Ë¤¹¤ë¡£
- * @return ¥Ö¥ì¥¹¤òľÀÜÅö¤Æ¤é¤ì¤ë¤Ê¤é¤ÐTRUE¤òÊÖ¤¹
+ * @param y1 始点のY座標
+ * @param x1 始点のX座標
+ * @param y2 目標のY座標
+ * @param x2 目標のX座標
+ * @param rad 半径
+ * @param typ 効果属性ID
+ * @param is_friend TRUEならば、プレイヤーを巻き込む時にブレスの判定をFALSEにする。
+ * @return ブレスを直接当てられるならばTRUEを返す
*/
-static bool breath_direct(int y1, int x1, int y2, int x2, int rad, int typ, bool is_friend)
+static bool breath_direct(POSITION y1, POSITION x1, POSITION y2, POSITION x2, POSITION rad, EFFECT_ID typ, bool is_friend)
{
/* Must be the same as projectable() */
int i;
/* Initial grid */
- int y = y1;
- int x = x1;
+ POSITION y = y1;
+ POSITION x = x1;
int grid_n = 0;
u16b grid_g[512];
int grids = 0;
- byte gx[1024], gy[1024];
- byte gm[32];
- int gm_rad = rad;
+ POSITION gx[1024], gy[1024];
+ POSITION gm[32];
+ POSITION gm_rad = rad;
bool hit2 = FALSE;
bool hityou = FALSE;
- int flg;
+ BIT_FLAGS flg;
switch (typ)
{
if (flg & PROJECT_DISI)
{
if (in_disintegration_range(y1, x1, y2, x2) && (distance(y1, x1, y2, x2) <= rad)) hit2 = TRUE;
- if (in_disintegration_range(y1, x1, py, px) && (distance(y1, x1, py, px) <= rad)) hityou = TRUE;
+ if (in_disintegration_range(y1, x1, p_ptr->y, p_ptr->x) && (distance(y1, x1, p_ptr->y, p_ptr->x) <= rad)) hityou = TRUE;
}
else if (flg & PROJECT_LOS)
{
if (los(y1, x1, y2, x2) && (distance(y1, x1, y2, x2) <= rad)) hit2 = TRUE;
- if (los(y1, x1, py, px) && (distance(y1, x1, py, px) <= rad)) hityou = TRUE;
+ if (los(y1, x1, p_ptr->y, p_ptr->x) && (distance(y1, x1, p_ptr->y, p_ptr->x) <= rad)) hityou = TRUE;
}
else
{
if (projectable(y1, x1, y2, x2) && (distance(y1, x1, y2, x2) <= rad)) hit2 = TRUE;
- if (projectable(y1, x1, py, px) && (distance(y1, x1, py, px) <= rad)) hityou = TRUE;
+ if (projectable(y1, x1, p_ptr->y, p_ptr->x) && (distance(y1, x1, p_ptr->y, p_ptr->x) <= rad)) hityou = TRUE;
}
}
else
}
/*!
- * @brief ¥â¥ó¥¹¥¿¡¼¤¬ÆüìǽÎϤÎÌÜɸÃÏÅÀ¤ò·è¤á¤ë½èÍý /
+ * @brief モンスターが特殊能力の目標地点を決める処理 /
* Get the actual center point of ball spells (rad > 1) (originally from TOband)
- * @param sy »ÏÅÀ¤ÎYºÂɸ
- * @param sx »ÏÅÀ¤ÎXºÂɸ
- * @param ty ÌÜɸYºÂɸ¤òÊÖ¤¹»²¾È¥Ý¥¤¥ó¥¿
- * @param tx ÌÜɸXºÂɸ¤òÊÖ¤¹»²¾È¥Ý¥¤¥ó¥¿
- * @param flg ȽÄê¤Î¥Õ¥é¥°ÇÛÎó
- * @return ¤Ê¤·
+ * @param sy 始点のY座標
+ * @param sx 始点のX座標
+ * @param ty ç\9b®æ¨\99Y座æ¨\99ã\82\92è¿\94ã\81\99å\8f\82ç\85§ã\83\9dã\82¤ã\83³ã\82¿
+ * @param tx ç\9b®æ¨\99X座æ¨\99ã\82\92è¿\94ã\81\99å\8f\82ç\85§ã\83\9dã\82¤ã\83³ã\82¿
+ * @param flg 判定のフラグ配列
+ * @return なし
*/
-void get_project_point(int sy, int sx, int *ty, int *tx, int flg)
+void get_project_point(POSITION sy, POSITION sx, POSITION *ty, POSITION *tx, BIT_FLAGS flg)
{
u16b path_g[128];
int path_n, i;
}
/*!
- * @brief ¥â¥ó¥¹¥¿¡¼¤¬Å¨¥â¥ó¥¹¥¿¡¼¤ËËâÎϾõî¤ò»È¤¦¤«¤É¤¦¤«¤òÊÖ¤¹ /
+ * @brief モンスターが敵モンスターに魔力消去を使うかどうかを返す /
* Check should monster cast dispel spell at other monster.
- * @param m_idx ½Ñ¼Ô¤Î¥â¥ó¥¹¥¿¡¼ID
- * @param t_idx ÌÜɸ¤Î¥â¥ó¥¹¥¿¡¼ID
- * @return ËâÎϾõî¤ò»È¤¦¤Ù¤¤Ê¤é¤ÐTRUE¤òÊѤ¨¤¹¡£
+ * @param m_idx è¡\93è\80\85ã\81®ã\83¢ã\83³ã\82¹ã\82¿ã\83¼ID
+ * @param t_idx ç\9b®æ¨\99ã\81®ã\83¢ã\83³ã\82¹ã\82¿ã\83¼ID
+ * @return 魔力消去を使うべきならばTRUEを変えす。
*/
-static bool dispel_check_monster(int m_idx, int t_idx)
+static bool dispel_check_monster(MONSTER_IDX m_idx, MONSTER_IDX t_idx)
{
monster_type *t_ptr = &m_list[t_idx];
}
/*!
- * @brief ¥â¥ó¥¹¥¿¡¼¤¬Å¨¥â¥ó¥¹¥¿¡¼¤ËÆüìǽÎϤò»È¤¦½èÍý¤Î¥á¥¤¥ó¥ë¡¼¥Á¥ó /
+ * @brief モンスターが敵モンスターに特殊能力を使う処理のメインルーチン /
* Monster tries to 'cast a spell' (or breath, etc) at another monster.
- * @param m_idx ½Ñ¼Ô¤Î¥â¥ó¥¹¥¿¡¼ID
- * @return ¼ÂºÝ¤ËÆüìǽÎϤò»È¤Ã¤¿¾ì¹çTRUE¤òÊÖ¤¹
+ * @param m_idx è¡\93è\80\85ã\81®ã\83¢ã\83³ã\82¹ã\82¿ã\83¼ID
+ * @return 実際に特殊能力を使った場合TRUEを返す
* @details
* The player is only disturbed if able to be affected by the spell.
*/
-bool monst_spell_monst(int m_idx)
+bool monst_spell_monst(MONSTER_IDX m_idx)
{
- int y = 0, x = 0;
- int i, k, t_idx = 0;
- int thrown_spell, count = 0;
- int rlev;
- int dam = 0;
+ POSITION y = 0, x = 0;
+ int i, k;
+ MONSTER_IDX target_idx = 0;
+ int thrown_spell;
+ HIT_POINT dam = 0;
int start;
int plus = 1;
- u32b u_mode = 0L;
- int s_num_6 = (easy_band ? 2 : 6);
- int s_num_4 = (easy_band ? 1 : 4);
- int rad = 0; //For elemental balls
byte spell[96], num = 0;
- char m_name[160];
- char t_name[160];
+ GAME_TEXT m_name[160];
+ GAME_TEXT t_name[160];
#ifndef JP
char m_poss[160];
monster_type *t_ptr = NULL;
monster_race *r_ptr = &r_info[m_ptr->r_idx];
- monster_race *tr_ptr = NULL;
u32b f4, f5, f6;
- bool wake_up = FALSE;
- bool fear = FALSE;
-
- bool blind = (p_ptr->blind ? TRUE : FALSE);
-
bool see_m = is_seen(m_ptr);
bool maneable = player_has_los_bold(m_ptr->fy, m_ptr->fx);
- bool see_t;
- bool see_either;
- bool known;
-
bool pet = is_pet(m_ptr);
bool in_no_magic_dungeon = (d_info[dungeon_type].flags1 & DF1_NO_MAGIC) && dun_level
&& (!p_ptr->inside_quest || is_fixed_quest_idx(p_ptr->inside_quest));
bool can_use_lite_area = FALSE;
-
bool can_remember;
- bool resists_tele = FALSE;
-
- /* Prepare flags for summoning */
- if (!pet) u_mode |= PM_ALLOW_UNIQUE;
-
/* Cannot cast spells when confused */
if (MON_CONFUSED(m_ptr)) return (FALSE);
/* Extract the racial spell flags */
f4 = r_ptr->flags4;
- f5 = r_ptr->flags5;
- f6 = r_ptr->flags6;
+ f5 = r_ptr->a_ability_flags1;
+ f6 = r_ptr->a_ability_flags2;
/* Target is given for pet? */
if (pet_t_m_idx && pet)
{
- t_idx = pet_t_m_idx;
- t_ptr = &m_list[t_idx];
+ target_idx = pet_t_m_idx;
+ t_ptr = &m_list[target_idx];
/* Cancel if not projectable (for now) */
- if ((m_idx == t_idx) || !projectable(m_ptr->fy, m_ptr->fx, t_ptr->fy, t_ptr->fx))
+ if ((m_idx == target_idx) || !projectable(m_ptr->fy, m_ptr->fx, t_ptr->fy, t_ptr->fx))
{
- t_idx = 0;
+ target_idx = 0;
}
}
/* Is there counter attack target? */
- if (!t_idx && m_ptr->target_y)
+ if (!target_idx && m_ptr->target_y)
{
- t_idx = cave[m_ptr->target_y][m_ptr->target_x].m_idx;
+ target_idx = cave[m_ptr->target_y][m_ptr->target_x].m_idx;
- if (t_idx)
+ if (target_idx)
{
- t_ptr = &m_list[t_idx];
+ t_ptr = &m_list[target_idx];
/* Cancel if neither enemy nor a given target */
- if ((m_idx == t_idx) ||
- ((t_idx != pet_t_m_idx) && !are_enemies(m_ptr, t_ptr)))
+ if ((m_idx == target_idx) ||
+ ((target_idx != pet_t_m_idx) && !are_enemies(m_ptr, t_ptr)))
{
- t_idx = 0;
+ target_idx = 0;
}
/* Allow only summoning etc.. if not projectable */
}
/* Look for enemies normally */
- if (!t_idx)
+ if (!target_idx)
{
bool success = FALSE;
/* Scan thru all monsters */
for (i = start; ((i < start + m_max) && (i > start - m_max)); i += plus)
{
- int dummy = (i % m_max);
+ MONSTER_IDX dummy = (i % m_max);
if (!dummy) continue;
- t_idx = dummy;
- t_ptr = &m_list[t_idx];
+ target_idx = dummy;
+ t_ptr = &m_list[target_idx];
/* Skip dead monsters */
if (!t_ptr->r_idx) continue;
/* Monster must be 'an enemy' */
- if ((m_idx == t_idx) || !are_enemies(m_ptr, t_ptr)) continue;
+ if ((m_idx == target_idx) || !are_enemies(m_ptr, t_ptr)) continue;
/* Monster must be projectable */
if (!projectable(m_ptr->fy, m_ptr->fx, t_ptr->fy, t_ptr->fx)) continue;
/* OK -- we've got a target */
y = t_ptr->fy;
x = t_ptr->fx;
- tr_ptr = &r_info[t_ptr->r_idx];
/* Forget old counter attack target */
reset_target(m_ptr);
- /* Extract the monster level */
- rlev = ((r_ptr->level >= 1) ? r_ptr->level : 1);
-
/* Remove unimplemented spells */
f6 &= ~(RF6_WORLD | RF6_TRAPS | RF6_FORGET);
(f5 & RF5_BALL_MASK) ||
(f6 & RF6_BALL_MASK))
{
- int real_y = y;
- int real_x = x;
+ POSITION real_y = y;
+ POSITION real_x = x;
get_project_point(m_ptr->fy, m_ptr->fx, &real_y, &real_x, 0L);
- if (projectable(real_y, real_x, py, px))
+ if (projectable(real_y, real_x, p_ptr->y, p_ptr->x))
{
- int dist = distance(real_y, real_x, py, px);
+ int dist = distance(real_y, real_x, p_ptr->y, p_ptr->x);
if (dist <= 2)
{
}
else if (f5 & RF5_BA_LITE)
{
- if ((distance(real_y, real_x, py, px) <= 4) && los(real_y, real_x, py, px))
+ if ((distance(real_y, real_x, p_ptr->y, p_ptr->x) <= 4) && los(real_y, real_x, p_ptr->y, p_ptr->x))
f5 &= ~(RF5_BA_LITE);
}
}
if (f4 & RF4_ROCKET)
{
- int real_y = y;
- int real_x = x;
+ POSITION real_y = y;
+ POSITION real_x = x;
get_project_point(m_ptr->fy, m_ptr->fx, &real_y, &real_x, PROJECT_STOP);
- if (projectable(real_y, real_x, py, px) && (distance(real_y, real_x, py, px) <= 2))
+ if (projectable(real_y, real_x, p_ptr->y, p_ptr->x) && (distance(real_y, real_x, p_ptr->y, p_ptr->x) <= 2))
f4 &= ~(RF4_ROCKET);
}
- if (((f4 & RF4_BEAM_MASK) ||
- (f5 & RF5_BEAM_MASK) ||
- (f6 & RF6_BEAM_MASK)) &&
+ if (((f4 & RF4_BEAM_MASK) || (f5 & RF5_BEAM_MASK) || (f6 & RF6_BEAM_MASK)) &&
!direct_beam(m_ptr->fy, m_ptr->fx, t_ptr->fy, t_ptr->fx, m_ptr))
{
f4 &= ~(RF4_BEAM_MASK);
f6 &= ~(RF6_BEAM_MASK);
}
- if ((f4 & RF4_BREATH_MASK) ||
- (f5 & RF5_BREATH_MASK) ||
- (f6 & RF6_BREATH_MASK))
+ if ((f4 & RF4_BREATH_MASK) || (f5 & RF5_BREATH_MASK) || (f6 & RF6_BREATH_MASK))
{
/* Expected breath radius */
- int rad = (r_ptr->flags2 & RF2_POWERFUL) ? 3 : 2;
+ POSITION rad = (r_ptr->flags2 & RF2_POWERFUL) ? 3 : 2;
if (!breath_direct(m_ptr->fy, m_ptr->fx, t_ptr->fy, t_ptr->fx, rad, 0, TRUE))
{
}
/* Dispel magic */
- if ((f4 & RF4_DISPEL) && !dispel_check_monster(m_idx, t_idx))
+ if ((f4 & RF4_DISPEL) && !dispel_check_monster(m_idx, target_idx))
{
/* Remove dispel spell */
f4 &= ~(RF4_DISPEL);
}
/* Hack -- decline "teleport level" in some case */
- if ((f6 & RF6_TELE_LEVEL) && TELE_LEVEL_IS_INEFF((t_idx == p_ptr->riding) ? 0 : t_idx))
+ if ((f6 & RF6_TELE_LEVEL) && TELE_LEVEL_IS_INEFF((target_idx == p_ptr->riding) ? 0 : target_idx))
{
f6 &= ~(RF6_TELE_LEVEL);
}
/* Extract the "inate" spells */
for (k = 0; k < 32; k++)
{
- if (f4 & (1L << k)) spell[num++] = k + 32 * 3;
+ if (f4 & (1L << k)) spell[num++] = k + RF4_SPELL_START;
}
/* Extract the "normal" spells */
for (k = 0; k < 32; k++)
{
- if (f5 & (1L << k)) spell[num++] = k + 32 * 4;
+ if (f5 & (1L << k)) spell[num++] = k + RF5_SPELL_START;
}
/* Extract the "bizarre" spells */
for (k = 0; k < 32; k++)
{
- if (f6 & (1L << k)) spell[num++] = k + 32 * 5;
+ if (f6 & (1L << k)) spell[num++] = k + RF6_SPELL_START;
}
/* No spells left */
/* Choose a spell to cast */
thrown_spell = spell[randint0(num)];
- see_t = is_seen(t_ptr);
- see_either = (see_m || see_t);
-
- /* Can the player be aware of this attack? */
- known = (m_ptr->cdis <= MAX_SIGHT) || (t_ptr->cdis <= MAX_SIGHT);
-
- if (p_ptr->riding && (m_idx == p_ptr->riding)) disturb(1, 1);
+ if (p_ptr->riding && (m_idx == p_ptr->riding)) disturb(TRUE, TRUE);
/* Check for spell failure (inate attacks never fail) */
if (!spell_is_inate(thrown_spell) && (in_no_magic_dungeon || (MON_STUNNED(m_ptr) && one_in_(2))))
{
- disturb(1, 1);
- /* Message */
- if (see_m) msg_format(_("%^s¤Ï¼öʸ¤ò¾§¤¨¤è¤¦¤È¤·¤¿¤¬¼ºÇÔ¤·¤¿¡£",
+ disturb(TRUE, TRUE);
+ if (see_m) msg_format(_("%^sは呪文を唱えようとしたが失敗した。",
"%^s tries to cast a spell, but fails."), m_name);
return (TRUE);
/* Hex: Anti Magic Barrier */
if (!spell_is_inate(thrown_spell) && magic_barrier(m_idx))
{
- if (see_m) msg_format(_("È¿ËâË¡¥Ð¥ê¥¢¤¬%^s¤Î¼öʸ¤ò¤«¤¾Ã¤·¤¿¡£",
+ if (see_m) msg_format(_("反魔法バリアが%^sの呪文をかき消した。",
"Anti magic barrier cancels the spell which %^s casts."), m_name);
return (TRUE);
}
can_remember = is_original_ap_and_seen(m_ptr);
- switch (thrown_spell)
- {
- case 96 + 0: spell_RF4_SHRIEK(m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF4_SHRIEK */
- case 96 + 1: return FALSE; /* RF4_XXX1 */
- case 96 + 2: spell_RF4_DISPEL(m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF4_DISPEL */
- case 96 + 3: dam = spell_RF4_ROCKET(y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF4_ROCKET */
- case 96 + 4: dam = spell_RF4_SHOOT(y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF4_SHOOT */
- case 96 + 5: return FALSE; /* RF4_XXX2 */
- case 96 + 6: return FALSE; /* RF4_XXX3 */
- case 96 + 7: return FALSE; /* RF4_XXX4 */
- case 96 + 8: dam = spell_RF4_BREATH(GF_ACID, y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF4_BR_ACID */
- case 96 + 9: dam = spell_RF4_BREATH(GF_ELEC, y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF4_BR_ELEC */
- case 96 + 10: dam = spell_RF4_BREATH(GF_FIRE, y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF4_BR_FIRE */
- case 96 + 11: dam = spell_RF4_BREATH(GF_COLD, y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF4_BR_COLD */
- case 96 + 12: dam = spell_RF4_BREATH(GF_POIS, y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF4_BR_POIS */
- case 96 + 13: dam = spell_RF4_BREATH(GF_NETHER, y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF4_BR_NETH */
- case 96 + 14: dam = spell_RF4_BREATH(GF_LITE, y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF4_BR_LITE */
- case 96 + 15: dam = spell_RF4_BREATH(GF_DARK, y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF4_BR_DARK */
- case 96 + 16: dam = spell_RF4_BREATH(GF_CONFUSION, y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF4_BR_CONF */
- case 96 + 17: dam = spell_RF4_BREATH(GF_SOUND, y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF4_BR_SOUN */
- case 96 + 18: dam = spell_RF4_BREATH(GF_CHAOS, y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF4_BR_CHAO */
- case 96 + 19: dam = spell_RF4_BREATH(GF_DISENCHANT, y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF4_BR_DISE */
- case 96 + 20: dam = spell_RF4_BREATH(GF_NEXUS, y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF4_BR_NEXU */
- case 96 + 21: dam = spell_RF4_BREATH(GF_TIME, y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF4_BR_TIME */
- case 96 + 22: dam = spell_RF4_BREATH(GF_INERTIA, y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF4_BR_INER */
- case 96 + 23: dam = spell_RF4_BREATH(GF_GRAVITY, y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF4_BR_GRAV */
- case 96 + 24: dam = spell_RF4_BREATH(GF_SHARDS, y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF4_BR_SHAR */
- case 96 + 25: dam = spell_RF4_BREATH(GF_PLASMA, y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF4_BR_PLAS */
- case 96 + 26: dam = spell_RF4_BREATH(GF_FORCE, y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF4_BR_WALL */
- case 96 + 27: dam = spell_RF4_BREATH(GF_MANA, y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF4_BR_MANA */
- case 96 + 28: dam = spell_RF4_BA_NUKE(y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF4_BA_NUKE */
- case 96 + 29: dam = spell_RF4_BREATH(GF_NUKE, y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF4_BR_NUKE */
- case 96 + 30: dam = spell_RF4_BA_CHAO(y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF4_BA_CHAO */
- case 96 + 31: dam = spell_RF4_BREATH(GF_DISINTEGRATE, y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF4_BR_DISI */
- case 128 + 0: dam = spell_RF5_BA_ACID(y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF5_BA_ACID */
- case 128 + 1: dam = spell_RF5_BA_ELEC(y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF5_BA_ELEC */
- case 128 + 2: dam = spell_RF5_BA_FIRE(y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF5_BA_FIRE */
- case 128 + 3: dam = spell_RF5_BA_COLD(y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF5_BA_COLD */
- case 128 + 4: dam = spell_RF5_BA_POIS(y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF5_BA_POIS */
- case 128 + 5: dam = spell_RF5_BA_NETH(y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF5_BA_NETH */
- case 128 + 6: dam = spell_RF5_BA_WATE(y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF5_BA_WATE */
- case 128 + 7: dam = spell_RF5_BA_MANA(y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF5_BA_MANA */
- case 128 + 8: dam = spell_RF5_BA_DARK(y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF5_BA_DARK */
- case 128 + 9: dam = spell_RF5_DRAIN_MANA(y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF5_DRAIN_MANA */
- case 128 + 10: dam = spell_RF5_MIND_BLAST(y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF5_MIND_BLAST */
- case 128 + 11: dam = spell_RF5_BRAIN_SMASH(y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF5_BRAIN_SMASH */
- case 128 + 12: dam = spell_RF5_CAUSE_1(y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF5_CAUSE_1 */
- case 128 + 13: dam = spell_RF5_CAUSE_2(y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF5_CAUSE_2 */
- case 128 + 14: dam = spell_RF5_CAUSE_3(y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF5_CAUSE_3 */
- case 128 + 15: dam = spell_RF5_CAUSE_4(y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF5_CAUSE_4 */
- case 128 + 16: dam = spell_RF5_BO_ACID(y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF5_BO_ACID */
- case 128 + 17: dam = spell_RF5_BO_ELEC(y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF5_BO_ELEC */
- case 128 + 18: dam = spell_RF5_BO_FIRE(y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF5_BO_FIRE */
- case 128 + 19: dam = spell_RF5_BO_COLD(y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF5_BO_COLD */
- case 128 + 20: dam = spell_RF5_BA_LITE(y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF5_BA_LITE */
- case 128 + 21: dam = spell_RF5_BO_NETH(y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF5_BO_NETH */
- case 128 + 22: dam = spell_RF5_BO_WATE(y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF5_BO_WATE */
- case 128 + 23: dam = spell_RF5_BO_MANA(y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF5_BO_MANA */
- case 128 + 24: dam = spell_RF5_BO_PLAS(y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF5_BO_PLAS */
- case 128 + 25: dam = spell_RF5_BO_ICEE(y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF5_BO_ICEE */
- case 128 + 26: dam = spell_RF5_MISSILE(y, x, m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF5_MISSILE */
-
- /* RF5_SCARE */
- case 128+27:
- if (known)
- {
- if (see_either)
- {
- msg_format(_("%^s¤¬¶²¤í¤·¤²¤Ê¸¸³Ð¤òºî¤ê½Ð¤·¤¿¡£",
- "%^s casts a fearful illusion in front of %s."), m_name, t_name);
- }
- else
- {
- mon_fight = TRUE;
- }
- }
-
- if (tr_ptr->flags3 & RF3_NO_FEAR)
- {
- if (see_t) msg_format(_("%^s¤Ï¶²Éݤò´¶¤¸¤Ê¤¤¡£",
- "%^s refuses to be frightened."), t_name);
-
- }
- else if (tr_ptr->level > randint1((rlev - 10) < 1 ? 1 : (rlev - 10)) + 10)
- {
- if (see_t) msg_format(_("%^s¤Ï¶²Éݤò´¶¤¸¤Ê¤¤¡£",
- "%^s refuses to be frightened."), t_name);
- }
- else
- {
- if (set_monster_monfear(t_idx, MON_MONFEAR(t_ptr) + randint0(4) + 4)) fear = TRUE;
- }
-
- wake_up = TRUE;
-
- break;
-
- /* RF5_BLIND */
- case 128+28:
- if (known)
- {
- if (see_either)
- {
- _(msg_format("%s¤Ï¼öʸ¤ò¾§¤¨¤Æ%s¤ÎÌܤò¾Æ¤ÉÕ¤«¤»¤¿¡£", m_name, t_name),
- msg_format("%^s casts a spell, burning %s%s eyes.", m_name, t_name,
- (streq(t_name, "it") ? "s" : "'s")));
-
- }
- else
- {
- mon_fight = TRUE;
- }
- }
-
- /* Simulate blindness with confusion */
- if (tr_ptr->flags3 & RF3_NO_CONF)
- {
- if (see_t) msg_format(_("%^s¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£", "%^s is unaffected."), t_name);
- }
- else if (tr_ptr->level > randint1((rlev - 10) < 1 ? 1 : (rlev - 10)) + 10)
- {
- if (see_t) msg_format(_("%^s¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£", "%^s is unaffected."), t_name);
- }
- else
- {
- if (see_t) msg_format(_("%^s¤ÏÌܤ¬¸«¤¨¤Ê¤¯¤Ê¤Ã¤¿¡ª ", "%^s is blinded!"), t_name);
-
- (void)set_monster_confused(t_idx, MON_CONFUSED(t_ptr) + 12 + randint0(4));
- }
-
- wake_up = TRUE;
-
- break;
-
- /* RF5_CONF */
- case 128+29:
- if (known)
- {
- if (see_either)
- {
- msg_format(_("%^s¤¬%s¤ÎÁ°¤Ë¸¸ÏÇŪ¤Ê¸¸¤ò¤Ä¤¯¤ê½Ð¤·¤¿¡£",
- "%^s casts a mesmerizing illusion in front of %s."), m_name, t_name);
- }
- else
- {
- mon_fight = TRUE;
- }
- }
-
- if (tr_ptr->flags3 & RF3_NO_CONF)
- {
- if (see_t) msg_format(_("%^s¤ÏÏǤ蘆¤ì¤Ê¤«¤Ã¤¿¡£",
- "%^s disbelieves the feeble spell."), t_name);
- }
- else if (tr_ptr->level > randint1((rlev - 10) < 1 ? 1 : (rlev - 10)) + 10)
- {
- if (see_t) msg_format(_("%^s¤ÏÏǤ蘆¤ì¤Ê¤«¤Ã¤¿¡£",
- "%^s disbelieves the feeble spell."), t_name);
- }
- else
- {
- if (see_t) msg_format(_("%^s¤Ïº®Í𤷤¿¤è¤¦¤À¡£",
- "%^s seems confused."), t_name);
-
- (void)set_monster_confused(t_idx, MON_CONFUSED(t_ptr) + 12 + randint0(4));
- }
-
- wake_up = TRUE;
-
- break;
-
- /* RF5_SLOW */
- case 128+30:
- if (known)
- {
- if (see_either)
- {
- _(msg_format("%s¤¬%s¤Î¶ÚÆù¤«¤éÎϤòµÛ¤¤¤È¤Ã¤¿¡£", m_name, t_name),
- msg_format("%^s drains power from %s%s muscles.", m_name, t_name,
- (streq(t_name, "it") ? "s" : "'s")));
- }
- else
- {
- mon_fight = TRUE;
- }
- }
-
- if (tr_ptr->flags1 & RF1_UNIQUE)
- {
- if (see_t) msg_format(_("%^s¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£",
- "%^s is unaffected."), t_name);
- }
- else if (tr_ptr->level > randint1((rlev - 10) < 1 ? 1 : (rlev - 10)) + 10)
- {
- if (see_t) msg_format(_("%^s¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£",
- "%^s is unaffected."), t_name);
- }
- else
- {
- if (set_monster_slow(t_idx, MON_SLOW(t_ptr) + 50))
- {
- if (see_t) msg_format(_("%s¤ÎÆ°¤¤¬ÃÙ¤¯¤Ê¤Ã¤¿¡£",
- "%^s starts moving slower."), t_name);
- }
- }
-
- wake_up = TRUE;
-
- break;
-
- /* RF5_HOLD */
- case 128+31:
- if (known)
- {
- if (see_either)
- {
- msg_format(_("%^s¤Ï%s¤ò¤¸¤Ã¤È¸«¤Ä¤á¤¿¡£", "%^s stares intently at %s."), m_name, t_name);
- }
- else
- {
- mon_fight = TRUE;
- }
- }
-
- if ((tr_ptr->flags1 & RF1_UNIQUE) ||
- (tr_ptr->flags3 & RF3_NO_STUN))
- {
- if (see_t) msg_format(_("%^s¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£", "%^s is unaffected."), t_name);
- }
- else if (tr_ptr->level > randint1((rlev - 10) < 1 ? 1 : (rlev - 10)) + 10)
- {
- if (see_t) msg_format(_("%^s¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£", "%^s is unaffected."), t_name);
- }
- else
- {
- if (see_t) msg_format(_("%^s¤ÏËãá㤷¤¿¡ª", "%^s is paralyzed!"), t_name);
-
- (void)set_monster_stunned(t_idx, MON_STUNNED(t_ptr) + randint1(4) + 4);
- }
-
- wake_up = TRUE;
-
- break;
-
-
- /* RF6_HASTE */
- case 160+0:
- if (known)
- {
- if (see_m)
- {
- msg_format(_("%^s¤¬¼«Ê¬¤ÎÂΤËÇ°¤òÁ÷¤Ã¤¿¡£", "%^s concentrates on %s body."), m_name);
- }
- else
- {
- mon_fight = TRUE;
- }
- }
-
- /* Allow quick speed increases to base+10 */
- if (set_monster_fast(m_idx, MON_FAST(m_ptr) + 100))
- {
- if (see_m) msg_format(_("%^s¤ÎÆ°¤¤¬Â®¤¯¤Ê¤Ã¤¿¡£", "%^s starts moving faster."), m_name);
- }
- break;
-
- /* RF6_HAND_DOOM */
- case 160+1:
- if (known)
- {
- if (see_m)
- {
- msg_format(_("%^s¤¬%s¤Ë<ÇËÌǤμê>¤òÊü¤Ã¤¿¡ª", "%^s invokes the Hand of Doom upon %s!"), m_name, t_name);
- }
- else
- {
- mon_fight = TRUE;
- }
- }
-
- dam = 20; /* Dummy power */
- breath(y, x, m_idx,GF_HAND_DOOM, dam, 0, FALSE, MS_HAND_DOOM, MONSTER_TO_MONSTER);
-
- break;
-
- /* RF6_HEAL */
- case 160+2:
- if (known)
- {
- if (see_m)
- {
- msg_format(_("%^s¤Ï¼«Ê¬¤Î½ý¤ËÇ°¤ò½¸Ã椷¤¿¡£", "%^s concentrates on %s wounds."), m_name);
- }
- else
- {
- mon_fight = TRUE;
- }
- }
-
- /* Heal some */
- m_ptr->hp += (rlev * 6);
-
- /* Fully healed */
- if (m_ptr->hp >= m_ptr->maxhp)
- {
- /* Fully healed */
- m_ptr->hp = m_ptr->maxhp;
-
- if (known)
- {
- if (see_m)
- {
- msg_format(_("%^s¤Ï´°Á´¤Ë¼£¤Ã¤¿¡ª", "%^s looks completely healed!"), m_name);
- }
- else
- {
- mon_fight = TRUE;
- }
- }
- }
-
- /* Partially healed */
- else if (known)
- {
- if (see_m)
- {
- msg_format(_("%^s¤ÏÂÎÎϤò²óÉü¤·¤¿¤è¤¦¤À¡£", "%^s looks healthier."), m_name);
- }
- else
- {
- mon_fight = TRUE;
- }
- }
-
- /* 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);
-
- /* Cancel fear */
- if (MON_MONFEAR(m_ptr))
- {
- /* Cancel fear */
- (void)set_monster_monfear(m_idx, 0);
-
- /* Message */
- if (see_m) msg_format(_("%^s¤Ïͦµ¤¤ò¼è¤êÌᤷ¤¿¡£", "%^s recovers %s courage."), m_name);
- }
-
- break;
-
- /* RF6_INVULNER */
- case 160+3:
- if (known)
- {
- if (see_m)
- {
- disturb(1, 1);
- msg_format(_("%s¤Ï̵½ý¤Îµå¤Î¼öʸ¤ò¾§¤¨¤¿¡£", "%^s casts a Globe of Invulnerability."), m_name);
- }
- else
- {
- mon_fight = TRUE;
- }
- }
-
- if (!MON_INVULNER(m_ptr)) (void)set_monster_invulner(m_idx, randint1(4) + 4, FALSE);
- break;
-
- /* RF6_BLINK */
- case 160+4:
- if (teleport_barrier(m_idx))
- {
- if (see_m)
- {
- msg_format(_("ËâË¡¤Î¥Ð¥ê¥¢¤¬%^s¤Î¥Æ¥ì¥Ý¡¼¥È¤ò¼ÙË⤷¤¿¡£", "Magic barrier obstructs teleporting of %^s."), m_name);
- }
- }
- else
- {
- if (see_m)
- {
- msg_format(_("%^s¤¬½Ö»þ¤Ë¾Ã¤¨¤¿¡£", "%^s blinks away."), m_name);
- }
- teleport_away(m_idx, 10, 0L);
- }
- break;
-
- /* RF6_TPORT */
- case 160+5:
- if (teleport_barrier(m_idx))
- {
- if (see_m)
- {
- msg_format(_("ËâË¡¤Î¥Ð¥ê¥¢¤¬%^s¤Î¥Æ¥ì¥Ý¡¼¥È¤ò¼ÙË⤷¤¿¡£", "Magic barrier obstructs teleporting of %^s."), m_name);
- }
- }
- else
- {
- if (see_m)
- {
- msg_format(_("%^s¤¬¥Æ¥ì¥Ý¡¼¥È¤·¤¿¡£", "%^s teleports away."), m_name);
- }
- teleport_away_followable(m_idx);
- }
- break;
-
- /* RF6_WORLD */
- case 160+6:
-#if 0
- int who = 0;
- if(m_ptr->r_idx = MON_DIO) who == 1;
- else if(m_ptr->r_idx = MON_WONG) who == 3;
- dam = who;
- if(!process_the_world(randint1(2)+2, who, player_has_los_bold(m_ptr->fy, m_ptr->fx))) return (FALSE);
-#endif
- return FALSE;
-
- /* RF6_SPECIAL */
- case 160+7:
- switch (m_ptr->r_idx)
- {
- case MON_OHMU:
- /* Moved to process_monster(), like multiplication */
- return FALSE;
-
- case MON_ROLENTO:
- if (known)
- {
- if (see_either)
- {
- disturb(1, 1);
-
- msg_format(_("%^s¤Ï¼êÜØÃƤò¤Ð¤é¤Þ¤¤¤¿¡£", "%^s throws some hand grenades."), m_name);
- }
- else
- {
- mon_fight = TRUE;
- }
- }
-
- {
- int num = 1 + randint1(3);
- for (k = 0; k < num; k++)
- {
- count += summon_named_creature(m_idx, y, x, MON_SHURYUUDAN, 0);
- }
- }
-
- if (known && !see_t && count)
- {
- mon_fight = TRUE;
- }
- break;
-
- default:
- if (r_ptr->d_char == 'B')
- {
- if (one_in_(3))
- {
- if (see_m)
- {
- msg_format(_("%^s¤ÏÆÍÁ³µÞ¾å¾º¤·¤Æ»ë³¦¤«¤é¾Ã¤¨¤¿!", "%^s suddenly go out of your sight!"), m_name);
- }
- teleport_away(m_idx, 10, TELEPORT_NONMAGICAL);
- p_ptr->update |= (PU_MONSTERS);
- }
- else
- {
- if (known)
- {
- if (see_either)
- {
- msg_format(_("%^s¤¬%s¤òÄϤó¤Ç¶õÃ椫¤éÅꤲÍî¤È¤·¤¿¡£", "%^s holds %s, and drops from the sky."), m_name, t_name);
- }
- else
- {
- mon_fight = TRUE;
- }
- }
-
- dam = damroll(4, 8);
-
- if (t_idx == p_ptr->riding) teleport_player_to(m_ptr->fy, m_ptr->fx, TELEPORT_NONMAGICAL | TELEPORT_PASSIVE);
- else teleport_monster_to(t_idx, m_ptr->fy, m_ptr->fx, 100, TELEPORT_NONMAGICAL | TELEPORT_PASSIVE);
-
- sound(SOUND_FALL);
-
- if (tr_ptr->flags7 & RF7_CAN_FLY)
- {
- if (see_t) msg_format(_("%^s¤ÏÀŤ«¤ËÃåÃϤ·¤¿¡£", "%^s floats gently down to the ground."), t_name);
- }
- else
- {
- if (see_t) msg_format(_("%^s¤ÏÃÏÌ̤ËᤤĤ±¤é¤ì¤¿¡£", "%^s crashed into the ground."), t_name);
-
- dam += damroll(6, 8);
- }
-
- if (p_ptr->riding == t_idx)
- {
- int get_damage = 0;
-
- /* Mega hack -- this special action deals damage to the player. Therefore the code of "eyeeye" is necessary.
- -- henkma
- */
- get_damage = take_hit(DAMAGE_NOESCAPE, dam, m_name, -1);
- if (p_ptr->tim_eyeeye && get_damage > 0 && !p_ptr->is_dead)
- {
- char m_name_self[80];
-
- /* hisself */
- monster_desc(m_name_self, m_ptr, MD_PRON_VISIBLE | MD_POSSESSIVE | MD_OBJECTIVE);
-
- _(msg_format("¹¶·â¤¬%s¼«¿È¤ò½ý¤Ä¤±¤¿¡ª", m_name),
- msg_format("The attack of %s has wounded %s!", m_name, m_name_self));
-
- project(0, 0, m_ptr->fy, m_ptr->fx, get_damage, GF_MISSILE, PROJECT_KILL, -1);
- set_tim_eyeeye(p_ptr->tim_eyeeye-5, TRUE);
- }
- }
-
- mon_take_hit_mon(t_idx, dam, &fear, extract_note_dies(real_r_ptr(t_ptr)), m_idx);
- }
- break;
- }
-
- /* Something is wrong */
- else return FALSE;
- }
-
- /* done */
- break;
-
- /* RF6_TELE_TO */
- case 160+8:
- if (known)
- {
- if (see_either)
- {
- msg_format(_("%^s¤¬%s¤ò°ú¤Ìᤷ¤¿¡£", "%^s commands %s to return."), m_name, t_name);
- }
- else
- {
- mon_fight = TRUE;
- }
- }
-
- if (tr_ptr->flagsr & RFR_RES_TELE)
- {
- if ((tr_ptr->flags1 & RF1_UNIQUE) || (tr_ptr->flagsr & RFR_RES_ALL))
- {
- if (is_original_ap_and_seen(t_ptr)) tr_ptr->r_flagsr |= RFR_RES_TELE;
- if (see_t)
- {
- msg_format(_("%^s¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£", "%^s is unaffected!"), t_name);
- }
-
- resists_tele = TRUE;
- }
- else if (tr_ptr->level > randint1(100))
- {
- if (is_original_ap_and_seen(t_ptr)) tr_ptr->r_flagsr |= RFR_RES_TELE;
- if (see_t)
- {
- msg_format(_("%^s¤ÏÂÑÀ¤ò»ý¤Ã¤Æ¤¤¤ë¡ª", "%^s resists!"), t_name);
- }
-
- resists_tele = TRUE;
- }
- }
-
- if (!resists_tele)
- {
- if (t_idx == p_ptr->riding) teleport_player_to(m_ptr->fy, m_ptr->fx, TELEPORT_PASSIVE);
- else teleport_monster_to(t_idx, m_ptr->fy, m_ptr->fx, 100, TELEPORT_PASSIVE);
- }
-
- wake_up = TRUE;
- break;
-
- /* RF6_TELE_AWAY */
- case 160+9:
- if (known)
- {
- if (see_either)
- {
- msg_format(_("%^s¤Ï%s¤ò¥Æ¥ì¥Ý¡¼¥È¤µ¤»¤¿¡£", "%^s teleports %s away."), m_name, t_name);
- }
- else
- {
- mon_fight = TRUE;
- }
- }
-
- if (tr_ptr->flagsr & RFR_RES_TELE)
- {
- if ((tr_ptr->flags1 & RF1_UNIQUE) || (tr_ptr->flagsr & RFR_RES_ALL))
- {
- if (is_original_ap_and_seen(t_ptr)) tr_ptr->r_flagsr |= RFR_RES_TELE;
- if (see_t)
- {
- msg_format(_("%^s¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£", "%^s is unaffected!"), t_name);
- }
-
- resists_tele = TRUE;
- }
- else if (tr_ptr->level > randint1(100))
- {
- if (is_original_ap_and_seen(t_ptr)) tr_ptr->r_flagsr |= RFR_RES_TELE;
- if (see_t)
- {
- msg_format(_("%^s¤ÏÂÑÀ¤ò»ý¤Ã¤Æ¤¤¤ë¡ª", "%^s resists!"), t_name);
- }
-
- resists_tele = TRUE;
- }
- }
-
- if (!resists_tele)
- {
- if (t_idx == p_ptr->riding) teleport_player_away(m_idx, MAX_SIGHT * 2 + 5);
- else teleport_away(t_idx, MAX_SIGHT * 2 + 5, TELEPORT_PASSIVE);
- }
-
- wake_up = TRUE;
- break;
-
- /* RF6_TELE_LEVEL */
- case 160+10:
- if (known)
- {
- if (see_either)
- {
- msg_format(_("%^s¤¬%s¤Î¤ò»Ø¤µ¤·¤¿¡£", "%^s gestures at %s's feet."), m_name, t_name);
- }
- else
- {
- mon_fight = TRUE;
- }
- }
-
- if (tr_ptr->flagsr & (RFR_EFF_RES_NEXU_MASK | RFR_RES_TELE))
- {
- if (see_t) msg_format(_("%^s¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£", "%^s is unaffected!"), t_name);
- }
- else if ((tr_ptr->flags1 & RF1_QUESTOR) ||
- (tr_ptr->level > randint1((rlev - 10) < 1 ? 1 : (rlev - 10)) + 10))
- {
- if (see_t) msg_format(_("%^s¤Ï¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª", "%^s resist the effects!"), t_name);
- }
- else teleport_level((t_idx == p_ptr->riding) ? 0 : t_idx);
-
- wake_up = TRUE;
- break;
-
- /* RF6_PSY_SPEAR */
- case 160+11:
- if (known)
- {
- if (see_either)
- {
- msg_format(_("%^s¤¬%s¤Ë¸þ¤«¤Ã¤Æ¸÷¤Î·õ¤òÊü¤Ã¤¿¡£", "%^s throw a Psycho-spear at %s."), m_name, t_name);
- }
- else
- {
- mon_fight = TRUE;
- }
- }
-
- dam = (r_ptr->flags2 & RF2_POWERFUL) ? (randint1(rlev * 2) + 180) : (randint1(rlev * 3 / 2) + 120);
- beam(m_idx, y, x, GF_PSY_SPEAR, dam, MS_PSY_SPEAR, MONSTER_TO_MONSTER);
- break;
-
- /* RF6_DARKNESS */
- case 160+12:
- if (known)
- {
- if (see_m)
- {
- if (can_use_lite_area)
- {
- msg_format(_("%^s¤¬ÊÕ¤ê¤òÌÀ¤ë¤¯¾È¤é¤·¤¿¡£", "%^s cast a spell to light up."), m_name);
- }
- else
- {
- msg_format(_("%^s¤¬°Å°Ç¤ÎÃæ¤Ç¼ê¤ò¿¶¤Ã¤¿¡£", "%^s gestures in shadow."), m_name);
- }
-
- if (see_t)
- {
- if (can_use_lite_area)
- {
- msg_format(_("%^s¤ÏÇò¤¤¸÷¤ËÊñ¤Þ¤ì¤¿¡£", "%^s is surrounded by a white light."), t_name);
- }
- else
- {
- msg_format(_("%^s¤Ï°Å°Ç¤ËÊñ¤Þ¤ì¤¿¡£", "%^s is surrounded by darkness."), t_name);
- }
- }
- }
- else
- {
- mon_fight = TRUE;
- }
- }
-
- if (can_use_lite_area)
- {
- (void)project(m_idx, 3, y, x, 0, GF_LITE_WEAK, PROJECT_GRID | PROJECT_KILL, -1);
- lite_room(y, x);
- }
- else
- {
- (void)project(m_idx, 3, y, x, 0, GF_DARK_WEAK, PROJECT_GRID | PROJECT_KILL, MS_DARKNESS);
- unlite_room(y, x);
- }
-
- break;
-
- /* RF6_TRAPS */
- case 160+13:
-#if 0
- if (known)
- {
- if (see_m)
- {
- msg_format(_("%^s¤¬¼öʸ¤ò¾§¤¨¤Æ¼Ù°¤ËÈù¾Ð¤ó¤À¡£", "%^s casts a spell and cackles evilly."), m_name);
- }
- else
- {
- msg_format(_("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", "%^s mumbles."), m_name);
- }
- }
-
- trap_creation(y, x);
-
- break;
-#else
- /* Not implemented */
- return FALSE;
-#endif
-
- /* RF6_FORGET */
- case 160+14:
- /* Not implemented */
- return FALSE;
-
- /* RF6_RAISE_DEAD */
- case 160+15:
- if (known)
- {
- if (see_either)
- {
- disturb(1, 1);
- if (blind)
- {
- msg_format(_("%^s¤¬²¿¤«¤ò¤Ä¤Ö¤ä¤¤¤¿¡£", "%^s mumbles."), m_name);
- }
- else
- {
- msg_format(_("%^s¤¬»à¼ÔÉü³è¤Î¼öʸ¤ò¾§¤¨¤¿¡£", "%^s casts a spell to revive corpses."), m_name);
- }
- }
- else
- {
- mon_fight = TRUE;
- }
- }
- animate_dead(m_idx, m_ptr->fy, m_ptr->fx);
- break;
-
- /* RF6_S_KIN */
- case 160+16:
- if (known)
- {
- if (see_either)
- {
- disturb(1, 1);
-
- if (m_ptr->r_idx == MON_SERPENT || m_ptr->r_idx == MON_ZOMBI_SERPENT)
- {
- msg_format(_("%^s¤¬¥À¥ó¥¸¥ç¥ó¤Î¼ç¤ò¾¤´¤·¤¿¡£", "%^s magically summons guardians of dungeons."), m_name);
- }
- else
- {
- _(msg_format("%s¤¬ËâË¡¤Ç%s¤ò¾¤´¤·¤¿¡£", m_name, ((r_ptr->flags1 & RF1_UNIQUE) ? "¼ê²¼" : "Ãç´Ö")),
- msg_format("%^s magically summons %s %s.", m_name, m_poss, ((r_ptr->flags1 & RF1_UNIQUE) ? "minions" : "kin")));
- }
-
- }
- else
- {
- mon_fight = TRUE;
- }
- }
-
- switch (m_ptr->r_idx)
- {
- case MON_MENELDOR:
- case MON_GWAIHIR:
- case MON_THORONDOR:
- {
- int num = 4 + randint1(3);
- for (k = 0; k < num; k++)
- {
- count += summon_specific(m_idx, y, x, rlev, SUMMON_EAGLES, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE));
- }
- }
- break;
-
- case MON_BULLGATES:
- {
- int num = 2 + randint1(3);
- for (k = 0; k < num; k++)
- {
- count += summon_named_creature(m_idx, y, x, MON_IE, 0);
- }
- }
- break;
-
- case MON_SERPENT:
- case MON_ZOMBI_SERPENT:
- if (r_info[MON_JORMUNGAND].cur_num < r_info[MON_JORMUNGAND].max_num && one_in_(6))
- {
- if (known && see_t)
- {
- msg_print(_("ÃÏÌ̤«¤é¿å¤¬¿á¤½Ð¤·¤¿¡ª", "Water blew off from the ground!"));
- }
- project(t_idx, 8, y, x, 3, GF_WATER_FLOW, PROJECT_GRID | PROJECT_HIDE, -1);
- }
-
- {
- int num = 2 + randint1(3);
- for (k = 0; k < num; k++)
- {
- count += summon_specific(m_idx, y, x, rlev, SUMMON_GUARDIANS, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE));
- }
- }
- break;
-
- case MON_CALDARM:
- {
- int num = randint1(3);
- for (k = 0; k < num; k++)
- {
- count += summon_named_creature(m_idx, y, x, MON_LOCKE_CLONE, 0);
- }
- }
- break;
-
- case MON_LOUSY:
- {
- int num = 2 + randint1(3);
- for (k = 0; k < num; k++)
- {
- count += summon_specific(m_idx, y, x, rlev, SUMMON_LOUSE, (PM_ALLOW_GROUP));
- }
- }
- break;
-
- default:
- summon_kin_type = r_ptr->d_char;
-
- for (k = 0; k < 4; k++)
- {
- count += summon_specific(m_idx, y, x, rlev, SUMMON_KIN, (PM_ALLOW_GROUP));
- }
- break;
- }
-
- if (known && !see_t && count)
- {
- mon_fight = TRUE;
- }
-
- break;
-
- /* RF6_S_CYBER */
- case 160+17:
- if (known)
- {
- if (see_either)
- {
- disturb(1, 1);
-
- msg_format(_("%^s¤¬¥µ¥¤¥Ð¡¼¥Ç¡¼¥â¥ó¤ò¾¤´¤·¤¿¡ª", "%^s magically summons Cyberdemons!"), m_name);
- }
- else
- {
- mon_fight = TRUE;
- }
- }
-
- if (is_friendly(m_ptr))
- {
- count += summon_specific(m_idx, y, x, rlev, SUMMON_CYBER, (PM_ALLOW_GROUP));
- }
- else
- {
- count += summon_cyber(m_idx, y, x);
- }
-
- if (known && !see_t && count)
- {
- mon_fight = TRUE;
- }
-
- break;
-
- /* RF6_S_MONSTER */
- case 160+18:
- if (known)
- {
- if (see_either)
- {
- disturb(1, 1);
-
- msg_format(_("%^s¤¬ËâË¡¤ÇÃç´Ö¤ò¾¤´¤·¤¿¡ª", "%^s magically summons help!"), m_name);
- }
- else
- {
- mon_fight = TRUE;
- }
- }
-
- count += summon_specific(m_idx, y, x, rlev, 0, (u_mode));
-
- if (known && !see_t && count)
- {
- mon_fight = TRUE;
- }
-
- break;
-
- /* RF6_S_MONSTERS */
- case 160+19:
- if (known)
- {
- if (see_either)
- {
- disturb(1, 1);
-
- msg_format(_("%^s¤¬ËâË¡¤Ç¥â¥ó¥¹¥¿¡¼¤ò¾¤´¤·¤¿¡ª", "%^s magically summons monsters!"), m_name);
- }
- else
- {
- mon_fight = TRUE;
- }
- }
-
- for (k = 0; k < s_num_6; k++)
- {
- count += summon_specific(m_idx, y, x, rlev, 0, (PM_ALLOW_GROUP | u_mode));
- }
-
- if (known && !see_t && count)
- {
- mon_fight = TRUE;
- }
-
- break;
-
- /* RF6_S_ANT */
- case 160+20:
- if (known)
- {
- if (see_either)
- {
- disturb(1, 1);
-
- msg_format(_("%^s¤¬ËâË¡¤Ç¥¢¥ê¤ò¾¤´¤·¤¿¡£", "%^s magically summons ants."), m_name);
- }
- else
- {
- mon_fight = TRUE;
- }
- }
-
- for (k = 0; k < s_num_6; k++)
- {
- count += summon_specific(m_idx, y, x, rlev, SUMMON_ANT, (PM_ALLOW_GROUP));
- }
-
- if (known && !see_t && count)
- {
- mon_fight = TRUE;
- }
-
- break;
-
- /* RF6_S_SPIDER */
- case 160+21:
- if (known)
- {
- if (see_either)
- {
- disturb(1, 1);
-
- msg_format(_("%^s¤¬ËâË¡¤Ç¥¯¥â¤ò¾¤´¤·¤¿¡£", "%^s magically summons spiders."), m_name);
- }
- else
- {
- mon_fight = TRUE;
- }
- }
-
- for (k = 0; k < s_num_6; k++)
- {
- count += summon_specific(m_idx, y, x, rlev, SUMMON_SPIDER, (PM_ALLOW_GROUP));
- }
-
- if (known && !see_t && count)
- {
- mon_fight = TRUE;
- }
-
- break;
-
- /* RF6_S_HOUND */
- case 160+22:
- if (known)
- {
- if (see_either)
- {
- disturb(1, 1);
-
- msg_format(_("%^s¤¬ËâË¡¤Ç¥Ï¥¦¥ó¥É¤ò¾¤´¤·¤¿¡£", "%^s magically summons hounds."), m_name);
- }
- else
- {
- mon_fight = TRUE;
- }
- }
-
- for (k = 0; k < s_num_4; k++)
- {
- count += summon_specific(m_idx, y, x, rlev, SUMMON_HOUND, (PM_ALLOW_GROUP));
- }
-
- if (known && !see_t && count)
- {
- mon_fight = TRUE;
- }
-
- break;
-
- /* RF6_S_HYDRA */
- case 160+23:
- if (known)
- {
- if (see_either)
- {
- disturb(1, 1);
-
- msg_format(_("%^s¤¬ËâË¡¤Ç¥Ò¥É¥é¤ò¾¤´¤·¤¿¡£", "%^s magically summons hydras."), m_name);
- }
- else
- {
- mon_fight = TRUE;
- }
- }
-
- for (k = 0; k < s_num_4; k++)
- {
- count += summon_specific(m_idx, y, x, rlev, SUMMON_HYDRA, (PM_ALLOW_GROUP));
- }
-
- if (known && !see_t && count)
- {
- mon_fight = TRUE;
- }
-
- break;
-
- /* RF6_S_ANGEL */
- case 160+24:
- if (known)
- {
- if (see_either)
- {
- disturb(1, 1);
-
- msg_format(_("%^s¤¬ËâË¡¤ÇÅ·»È¤ò¾¤´¤·¤¿¡ª", "%^s magically summons an angel!"), m_name);
- }
- else
- {
- mon_fight = TRUE;
- }
- }
-
- {
- int num = 1;
-
- if ((r_ptr->flags1 & RF1_UNIQUE) && !easy_band)
- {
- num += r_ptr->level/40;
- }
-
- for (k = 0; k < num; k++)
- {
- count += summon_specific(m_idx, y, x, rlev, SUMMON_ANGEL, (PM_ALLOW_GROUP));
- }
- }
-
- if (known && !see_t && count)
- {
- mon_fight = TRUE;
- }
-
- break;
-
- /* RF6_S_DEMON */
- case 160+25:
- if (known)
- {
- if (see_either)
- {
- disturb(1, 1);
-
- msg_format(_("%^s¤¬ËâË¡¤Çº®Æ٤εÜÄ¤é¥Ç¡¼¥â¥ó¤ò¾¤´¤·¤¿¡ª",
- "%^s magically summons a demon from the Courts of Chaos!"), m_name);
- }
- else
- {
- mon_fight = TRUE;
- }
- }
-
- for (k = 0; k < 1; k++)
- {
- count += summon_specific(m_idx, y, x, rlev, SUMMON_DEMON, (PM_ALLOW_GROUP));
- }
-
- if (known && !see_t && count)
- {
- mon_fight = TRUE;
- }
-
- break;
-
- /* RF6_S_UNDEAD */
- case 160+26:
- if (known)
- {
- if (see_either)
- {
- disturb(1, 1);
-
- msg_format(_("%s¤¬ËâË¡¤Ç¥¢¥ó¥Ç¥Ã¥É¤ò¾¤´¤·¤¿¡£", "%^s magically summons undead."), m_name);
- }
- else
- {
- mon_fight = TRUE;
- }
- }
-
- for (k = 0; k < 1; k++)
- {
- count += summon_specific(m_idx, y, x, rlev, SUMMON_UNDEAD, (PM_ALLOW_GROUP));
- }
-
- if (known && !see_t && count)
- {
- mon_fight = TRUE;
- }
-
- break;
-
- /* RF6_S_DRAGON */
- case 160+27:
- if (known)
- {
- if (see_either)
- {
- disturb(1, 1);
-
- msg_format(_("%^s¤¬ËâË¡¤Ç¥É¥é¥´¥ó¤ò¾¤´¤·¤¿¡ª", "%^s magically summons a dragon!"), m_name);
- }
- else
- {
- mon_fight = TRUE;
- }
- }
-
- for (k = 0; k < 1; k++)
- {
- count += summon_specific(m_idx, y, x, rlev, SUMMON_DRAGON, (PM_ALLOW_GROUP));
- }
-
- if (known && !see_t && count)
- {
- mon_fight = TRUE;
- }
-
- break;
-
- /* RF6_S_HI_UNDEAD */
- case 160+28:
- if (known)
- {
- if (see_either)
- {
- disturb(1, 1);
-
- msg_format(_("%s¤¬ËâË¡¤Ç¥¢¥ó¥Ç¥Ã¥É¤ò¾¤´¤·¤¿¡£", "%^s magically summons undead."), m_name);
- }
- else
- {
- mon_fight = TRUE;
- }
- }
-
- for (k = 0; k < s_num_6; k++)
- {
- count += summon_specific(m_idx, y, x, rlev, SUMMON_HI_UNDEAD, (PM_ALLOW_GROUP | u_mode));
- }
-
- if (known && !see_t && count)
- {
- mon_fight = TRUE;
- }
-
- break;
-
- /* RF6_S_HI_DRAGON */
- case 160+29:
- if (known)
- {
- if (see_either)
- {
- disturb(1, 1);
-
- msg_format(_("%^s¤¬ËâË¡¤Ç¸ÅÂå¥É¥é¥´¥ó¤ò¾¤´¤·¤¿¡ª", "%^s magically summons ancient dragons!"), m_name);
- }
- else
- {
- mon_fight = TRUE;
- }
- }
-
- for (k = 0; k < s_num_4; k++)
- {
- count += summon_specific(m_idx, y, x, rlev, SUMMON_HI_DRAGON, (PM_ALLOW_GROUP | u_mode));
- }
-
- if (known && !see_t && count)
- {
- mon_fight = TRUE;
- }
-
- break;
-
- /* RF6_S_AMBERITES */
- case 160+30:
- if (known)
- {
- if (see_either)
- {
- disturb(1, 1);
-
- msg_format(_("%^s¤¬¥¢¥ó¥Ð¡¼¤Î²¦Â²¤ò¾¤´¤·¤¿¡ª", "%^s magically summons Lords of Amber!"), m_name);
- }
- else
- {
- mon_fight = TRUE;
- }
- }
-
- for (k = 0; k < s_num_4; k++)
- {
- count += summon_specific(m_idx, y, x, rlev, SUMMON_AMBERITES, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE));
- }
-
- if (known && !see_t && count)
- {
- mon_fight = TRUE;
- }
-
- break;
-
- /* RF6_S_UNIQUE */
- case 160+31:
- if (known)
- {
- if (see_either)
- {
- disturb(1, 1);
-
- msg_format(_("%^s¤¬ËâË¡¤ÇÆÃÊ̤ʶ¯Å¨¤ò¾¤´¤·¤¿¡ª", "%^s magically summons special opponents!"), m_name);
- }
- else
- {
- mon_fight = TRUE;
- }
- }
-
- for (k = 0; k < s_num_4; k++)
- {
- count += summon_specific(m_idx, y, x, rlev, SUMMON_UNIQUE, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE));
- }
-
- {
- int non_unique_type = SUMMON_HI_UNDEAD;
-
- if ((m_ptr->sub_align & (SUB_ALIGN_GOOD | SUB_ALIGN_EVIL)) == (SUB_ALIGN_GOOD | SUB_ALIGN_EVIL))
- non_unique_type = 0;
- else if (m_ptr->sub_align & SUB_ALIGN_GOOD)
- non_unique_type = SUMMON_ANGEL;
-
- for (k = count; k < s_num_4; k++)
- {
- count += summon_specific(m_idx, y, x, rlev, non_unique_type, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE));
- }
- }
-
- if (known && !see_t && count)
- {
- mon_fight = TRUE;
- }
-
- break;
- }
-
- if (wake_up) (void)set_monster_csleep(t_idx, 0);
-
- if (fear && see_t)
- {
- msg_format(_("%^s¤Ï¶²Éݤ·¤Æƨ¤²½Ð¤·¤¿¡ª", "%^s flees in terror!"), t_name);
- }
+ dam = monspell_to_monster(thrown_spell, y, x, m_idx, target_idx);
+ if (dam < 0) return FALSE;
if (m_ptr->ml && maneable && !world_monster && !p_ptr->blind && (p_ptr->pclass == CLASS_IMITATOR))
{
p_ptr->mane_dam[i] = p_ptr->mane_dam[i+1];
}
}
- p_ptr->mane_spell[p_ptr->mane_num] = thrown_spell - 96;
+ p_ptr->mane_spell[p_ptr->mane_num] = thrown_spell - RF4_SPELL_START;
p_ptr->mane_dam[p_ptr->mane_num] = dam;
p_ptr->mane_num++;
new_mane = TRUE;
if (can_remember)
{
/* Inate spell */
- if (thrown_spell < 32*4)
+ if (thrown_spell < RF4_SPELL_START + RF4_SPELL_SIZE)
{
- r_ptr->r_flags4 |= (1L << (thrown_spell - 32*3));
+ r_ptr->r_flags4 |= (1L << (thrown_spell - RF4_SPELL_START));
if (r_ptr->r_cast_spell < MAX_UCHAR) r_ptr->r_cast_spell++;
}
/* Bolt or Ball */
- else if (thrown_spell < 32*5)
+ else if (thrown_spell < RF5_SPELL_START + RF5_SPELL_SIZE)
{
- r_ptr->r_flags5 |= (1L << (thrown_spell - 32*4));
+ r_ptr->r_flags5 |= (1L << (thrown_spell - RF5_SPELL_START));
if (r_ptr->r_cast_spell < MAX_UCHAR) r_ptr->r_cast_spell++;
}
/* Special spell */
- else if (thrown_spell < 32*6)
+ else if (thrown_spell < RF6_SPELL_START + RF6_SPELL_SIZE)
{
- r_ptr->r_flags6 |= (1L << (thrown_spell - 32*5));
+ r_ptr->r_flags6 |= (1L << (thrown_spell - RF6_SPELL_START));
if (r_ptr->r_cast_spell < MAX_UCHAR) r_ptr->r_cast_spell++;
}
}