-/*!
+/*!
* @file mspells1.c
- * @brief ¥â¥ó¥¹¥¿¡¼ËâË¡¤Î¼ÂÁõ / Monster spells (attack player)
+ * @brief モンスター魔法の実装 / Monster spells (attack player)
* @date 2014/01/17
* @author
* Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke\n
/*!
- * @brief ¥â¥ó¥¹¥¿¡¼¤¬¥×¥ì¥¤¥ä¡¼¤Î¼åÅÀ¤ò¤Ä¤¤¤¿ÁªÂò¤ò¼è¤ë¤«¤É¤¦¤«¤ÎȽÄê /
+ * @brief モンスターがプレイヤーの弱点をついた選択を取るかどうかの判定 /
* Internal probability routine
- * @param r_ptr ¥â¥ó¥¹¥¿¡¼¼ï²¤Î¹½Â¤Âλ²¾È¥Ý¥¤¥ó¥¿
- * @param prob ´ðËܳÎΨ(%)
- * @return Ŭ¤·¤¿ÁªÂò¤ò¼è¤ë¤Ê¤é¤ÐTRUE¤òÊÖ¤¹¡£
+ * @param r_ptr ã\83¢ã\83³ã\82¹ã\82¿ã\83¼ç¨®æ\97\8fã\81®æ§\8bé\80 ä½\93å\8f\82ç\85§ã\83\9dã\82¤ã\83³ã\82¿
+ * @param prob 基本確率(%)
+ * @return 適した選択を取るならばTRUEを返す。
*/
static bool int_outof(monster_race *r_ptr, int prob)
{
/*!
- * @brief ¥â¥ó¥¹¥¿¡¼¤ÎËâË¡°ìÍ÷¤«¤éÀï½ÑŪ¤ËŬ¤µ¤Ê¤¤ËâË¡¤ò½ü³°¤¹¤ë /
+ * @brief モンスターの魔法一覧から戦術的に適さない魔法を除外する /
* Remove the "bad" spells from a spell list
- * @param m_idx ¥â¥ó¥¹¥¿¡¼¤Î¹½Â¤Âλ²¾È¥Ý¥¤¥ó¥¿
- * @param f4p ¥â¥ó¥¹¥¿¡¼ËâË¡¤Î¥Õ¥é¥°¥ê¥¹¥È1
- * @param f5p ¥â¥ó¥¹¥¿¡¼ËâË¡¤Î¥Õ¥é¥°¥ê¥¹¥È2
- * @param f6p ¥â¥ó¥¹¥¿¡¼ËâË¡¤Î¥Õ¥é¥°¥ê¥¹¥È3
- * @return ¤Ê¤·
+ * @param m_idx ã\83¢ã\83³ã\82¹ã\82¿ã\83¼ã\81®æ§\8bé\80 ä½\93å\8f\82ç\85§ã\83\9dã\82¤ã\83³ã\82¿
+ * @param f4p モンスター魔法のフラグリスト1
+ * @param f5p モンスター魔法のフラグリスト2
+ * @param f6p モンスター魔法のフラグリスト3
+ * @return なし
*/
-static void remove_bad_spells(int m_idx, u32b *f4p, u32b *f5p, u32b *f6p)
+static void remove_bad_spells(MONSTER_IDX m_idx, u32b *f4p, u32b *f5p, u32b *f6p)
{
monster_type *m_ptr = &m_list[m_idx];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
if (int_outof(r_ptr, 150)) f5 &= ~(RF5_BO_PLAS);
if (int_outof(r_ptr, 150)) f5 &= ~(RF5_BO_ICEE);
if (int_outof(r_ptr, 150)) f5 &= ~(RF5_MISSILE);
- if (int_outof(r_ptr, 150)) f4 &= ~(RF4_SHOOT);
}
if (smart & (SM_IMM_FREE))
/*!
- * @brief ¥â¥ó¥¹¥¿¡¼¤Ë¤È¤Ã¤Æ½êÄê¤ÎÃÏÅÀ¤¬¾¤´Ô¤ËÁê±þ¤·¤¤ÃÏÅÀ¤«¤É¤¦¤«¤òÊÖ¤¹¡£ /
+ * @brief モンスターにとって所定の地点が召還に相応しい地点かどうかを返す。 /
* Determine if there is a space near the player in which a summoned creature can appear
- * @param y1 ȽÄê¤ò¹Ô¤¤¤¿¤¤¥Þ¥¹¤ÎYºÂɸ
- * @param x1 ȽÄê¤ò¹Ô¤¤¤¿¤¤¥Þ¥¹¤ÎXºÂɸ
- * @return ¾¤´Ô¤ËÁê±þ¤·¤¤¤Ê¤é¤ÐTRUE¤òÊÖ¤¹
+ * @param y1 判定を行いたいマスのY座標
+ * @param x1 判定を行いたいマスのX座標
+ * @return 召還に相応しいならばTRUEを返す
*/
bool summon_possible(int y1, int x1)
{
/*!
- * @brief ¥â¥ó¥¹¥¿¡¼¤Ë¤È¤Ã¤Æ»à¼ÔÉü³è¤ò¹Ô¤¦¤Ù¤¾õÂÖ¤«¤É¤¦¤«¤òÊÖ¤¹ /
+ * @brief モンスターにとって死者復活を行うべき状態かどうかを返す /
* Determine if there is a space near the player in which a summoned creature can appear
- * @param m_ptr ȽÄê¤ò¹Ô¤¤¤¿¤¤¥â¥ó¥¹¥¿¡¼¤Î¹½Â¤Âλ²¾È¥Ý¥¤¥ó¥¿
- * @return »à¼ÔÉü³è¤¬Í¸ú¤Ê¾õÂ֤ʤé¤ÐTRUE¤òÊÖ¤¹¡£
+ * @param m_ptr å\88¤å®\9aã\82\92è¡\8cã\81\84ã\81\9fã\81\84ã\83¢ã\83³ã\82¹ã\82¿ã\83¼ã\81®æ§\8bé\80 ä½\93å\8f\82ç\85§ã\83\9dã\82¤ã\83³ã\82¿
+ * @return 死者復活が有効な状態ならばTRUEを返す。
*/
bool raise_possible(monster_type *m_ptr)
{
/*!
- * @brief ¥â¥ó¥¹¥¿¡¼¤Ë¤È¤Ã¤Æ¥Ü¥ë¥È·¿ËâË¡¤¬Í¸ú¤Ê¾õÂÖ¤«¤òÊÖ¤¹ /
+ * @brief モンスターにとってボルト型魔法が有効な状態かを返す /
* Determine if a bolt spell will hit the player.
- * @param y1 ¥Ü¥ë¥ÈËâˡȯ¼ÍÃÏÅÀ¤ÎYºÂɸ
- * @param x1 ¥Ü¥ë¥ÈËâˡȯ¼ÍÃÏÅÀ¤ÎXºÂɸ
- * @param y2 ¥Ü¥ë¥ÈËâË¡ÌÜɸÃÏÅÀ¤ÎYºÂɸ
- * @param x2 ¥Ü¥ë¥ÈËâË¡ÌÜɸÃÏÅÀ¤ÎXºÂɸ
- * @param is_friend ¥â¥ó¥¹¥¿¡¼¤¬¥×¥ì¥¤¥ä¡¼¤Ë³²°Õ¤ò»ý¤¿¤Ê¤¤(¥Ú¥Ã¥È¤«Í§¹¥Åª)¤Ê¤é¤ÐTRUE¤ò¤Ä¤±¤ë
- * @return ¥Ü¥ë¥È·¿ËâË¡¤¬Í¸ú¤Ê¤é¤ÐTRUE¤òÊÖ¤¹¡£
+ * @param y1 ボルト魔法発射地点のY座標
+ * @param x1 ボルト魔法発射地点のX座標
+ * @param y2 ボルト魔法目標地点のY座標
+ * @param x2 ボルト魔法目標地点のX座標
+ * @param is_friend モンスターがプレイヤーに害意を持たない(ペットか友好的)ならばTRUEをつける
+ * @return ボルト型魔法が有効ならばTRUEを返す。
* @details
* Originally, it was possible for a friendly to shoot another friendly.\n
* Change it so a "clean shot" means no equally friendly monster is\n
}
/*!
- * @brief ¥â¥ó¥¹¥¿¡¼¤Î¥Ü¥ë¥È·¿ËâË¡½èÍý /
+ * @brief モンスターのボルト型魔法処理 /
* Cast a bolt at the player Stop if we hit a monster Affect monsters and the player
- * @param m_idx ¥â¥ó¥¹¥¿¡¼¤ÎID
- * @param y ÌÜɸ¤ÎYºÂɸ
- * @param x ÌÜɸ¤ÎXºÂɸ
- * @param typ ¸ú²Ì°ÀID
- * @param dam_hp °ÒÎÏ
- * @param monspell ¥â¥ó¥¹¥¿¡¼ËâË¡¤ÎID
- * @param target_type ¥â¥ó¥¹¥¿¡¼¤«¤é¥â¥ó¥¹¥¿¡¼¤Ø·â¤Ä¤Ê¤éMONSTER_TO_MONSTER¡¢¥â¥ó¥¹¥¿¡¼¤«¤é¥×¥ì¥¤¥ä¡¼¤Ê¤éMONSTER_TO_PLAYER
- * @return ¤Ê¤·
+ * @param m_idx モンスターのID
+ * @param y 目標のY座標
+ * @param x 目標のX座標
+ * @param typ 効果属性ID
+ * @param dam_hp 威力
+ * @param monspell モンスター魔法のID
+ * @param target_type モンスターからモンスターへ撃つならMONSTER_TO_MONSTER、モンスターからプレイヤーならMONSTER_TO_PLAYER
+ * @return なし
*/
-void bolt(int m_idx, int y, int x, int typ, int dam_hp, int monspell, int target_type)
+void bolt(MONSTER_IDX m_idx, int y, int x, int typ, int dam_hp, int monspell, int target_type)
{
- int flg;
+ BIT_FLAGS flg = 0;
bool learnable = spell_learnable(m_idx);
switch (target_type)
}
/*!
- * @brief ¥â¥ó¥¹¥¿¡¼¤Î¥Ó¡¼¥à·¿ËâË¡½èÍý /
- * @param m_idx ¥â¥ó¥¹¥¿¡¼¤ÎID
- * @param y ÌÜɸ¤ÎYºÂɸ
- * @param x ÌÜɸ¤ÎXºÂɸ
- * @param typ ¸ú²Ì°ÀID
- * @param dam_hp °ÒÎÏ
- * @param monspell ¥â¥ó¥¹¥¿¡¼ËâË¡¤ÎID
- * @param target_type ¥â¥ó¥¹¥¿¡¼¤«¤é¥â¥ó¥¹¥¿¡¼¤Ø·â¤Ä¤Ê¤éMONSTER_TO_MONSTER¡¢¥â¥ó¥¹¥¿¡¼¤«¤é¥×¥ì¥¤¥ä¡¼¤Ê¤éMONSTER_TO_PLAYER
- * @return ¤Ê¤·
+ * @brief モンスターのビーム型魔法処理 /
+ * @param m_idx モンスターのID
+ * @param y 目標のY座標
+ * @param x 目標のX座標
+ * @param typ 効果属性ID
+ * @param dam_hp 威力
+ * @param monspell モンスター魔法のID
+ * @param target_type モンスターからモンスターへ撃つならMONSTER_TO_MONSTER、モンスターからプレイヤーならMONSTER_TO_PLAYER
+ * @return なし
*/
-void beam(int m_idx, int y, int x, int typ, int dam_hp, int monspell, int target_type)
+void beam(MONSTER_IDX m_idx, int y, int x, int typ, int dam_hp, int monspell, int target_type)
{
- int flg;
+ BIT_FLAGS flg = 0;
bool learnable = spell_learnable(m_idx);
switch (target_type)
/*!
- * @brief ¥â¥ó¥¹¥¿¡¼¤Î¥Ü¡¼¥ë·¿¡õ¥Ö¥ì¥¹·¿ËâË¡½èÍý /
+ * @brief モンスターのボール型&ブレス型魔法処理 /
* Cast a breath (or ball) attack at the player Pass over any monsters that may be in the way Affect grids, objects, monsters, and the player
- * @param y ÌÜɸÃÏÅÀ¤ÎYºÂɸ
- * @param x ÌÜɸÃÏÅÀ¤ÎXºÂɸ
- * @param m_idx ¥â¥ó¥¹¥¿¡¼¤ÎID
- * @param typ ¸ú²Ì°ÀID
- * @param dam_hp °ÒÎÏ
- * @param rad Ⱦ·Â
- * @param breath TRUE¤Ê¤é¤Ð¥Ö¡¦E¹½èÍ¡¦¡¥ALSE¤Ê¤é¤Ð¥Ü¡¼¡¦EèÍ
- * @param monspell ¥â¥ó¥¹¥¿¡¼ËâË¡¤ÎID
- * @param target_type ¥â¥ó¥¹¥¿¡¼¤«¤é¥â¥ó¥¹¥¿¡¼¤Ø·â¤Ä¤Ê¤éMONSTER_TO_MONSTER¡¢¥â¥ó¥¹¥¿¡¼¤«¤é¥×¥ì¥¤¥ä¡¼¤Ê¤éMONSTER_TO_PLAYER
- * @return ¤Ê¤·
+ * @param y 目標地点のY座標
+ * @param x 目標地点のX座標
+ * @param m_idx モンスターのID
+ * @param typ 効果属性ID
+ * @param dam_hp 威力
+ * @param rad 半径
+ * @param breath TRUEならばブ・E構萢・.ALSEならばボー・E萢
+ * @param monspell モンスター魔法のID
+ * @param target_type モンスターからモンスターへ撃つならMONSTER_TO_MONSTER、モンスターからプレイヤーならMONSTER_TO_PLAYER
+ * @return なし
*/
-void breath(int y, int x, int m_idx, int typ, int dam_hp, int rad, bool breath, int monspell, int target_type)
+void breath(int y, int x, MONSTER_IDX m_idx, int typ, int dam_hp, int rad, bool breath, int monspell, int target_type)
{
monster_type *m_ptr = &m_list[m_idx];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
bool learnable = spell_learnable(m_idx);
- int flg;
+ BIT_FLAGS flg = 0x00;
switch (target_type)
{
}
/*!
- * @brief ¥â¥ó¥¹¥¿¡¼¤Î¥Ü¡¼¥ë·¿¡õ¥Ö¥ì¥¹·¿ËâË¡½èÍý /
- * @param power ¼ö¤¤¤ÎÃʳ¬
- * @param o_ptr ¼ö¤¤¤ò¤«¤±¤é¤ì¤ëÁõÈ÷¥ª¥Ö¥¸¥§¥¯¥È¤Î¹½Â¤Âλ²¾È¥Ý¥¤¥ó¥¿
- * @return Í¿¤¨¤ë¼ö¤¤¤ÎID
+ * @brief モンスターのボール型&ブレス型魔法処理 /
+ * @param power 呪いの段階
+ * @param o_ptr å\91ªã\81\84ã\82\92ã\81\8bã\81\91ã\82\89ã\82\8cã\82\8bè£\85å\82\99ã\82ªã\83\96ã\82¸ã\82§ã\82¯ã\83\88ã\81®æ§\8bé\80 ä½\93å\8f\82ç\85§ã\83\9dã\82¤ã\83³ã\82¿
+ * @return 与える呪いのID
*/
u32b get_curse(int power, object_type *o_ptr)
{
}
/*!
- * @brief ÁõÈ÷¤Ø¤Î¼ö¤¤ÉÕ²ÃȽÄê¤ÈÉղýèÍý /
- * @param chance ¼ö¤¤¤Î´ðËܳÎΨ
- * @param heavy_chance ½Å¤¤¼ö¤¤¤òÁªÂò»è¤ËÆþ¤ì¤ë¤«Èݤ«¡£
- * @return ¤Ê¤·
+ * @brief 装備への呪い付加判定と付加処理 /
+ * @param chance 呪いの基本確率
+ * @param heavy_chance 重い呪いを選択肢に入れるか否か。
+ * @return なし
*/
void curse_equipment(int chance, int heavy_chance)
{
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 (have_flag(oflgs, TR_BLESSED))
{
#ifdef JP
-msg_format("%s¤Ï¼ö¤¤¤òÄ·¤ÍÊÖ¤·¤¿¡ª", o_name,
+ msg_format("祝福された%sは呪いを跳ね返した!", o_name,
#else
- msg_format("Your %s resist%s cursing!", o_name,
+ msg_format("Your blessed %s resist%s cursing!", o_name,
#endif
((o_ptr->number > 1) ? "" : "s"));
if (changed)
{
#ifdef JP
-msg_format("°°Õ¤ËËþ¤Á¤¿¹õ¤¤¥ª¡¼¥é¤¬%s¤ò¤È¤ê¤Þ¤¤¤¿...", o_name);
+msg_format("悪意に満ちた黒いオーラが%sをとりまいた...", o_name);
#else
msg_format("There is a malignant black aura surrounding %s...", o_name);
#endif
/*!
- * @brief IDÃͤ¬Àµ¤·¤¤¥â¥ó¥¹¥¿¡¼ËâË¡ID¤«¤É¤¦¤«¤òÊÖ¤¹ /
+ * @brief ID値が正しいモンスター魔法IDかどうかを返す /
* Return TRUE if a spell is good for hurting the player (directly).
- * @param spell ȽÄêÂоݤÎID
- * @return Àµ¤·¤¤ID¤Ê¤é¤ÐTRUE¤òÊÖ¤¹¡£
+ * @param spell 判定対象のID
+ * @return 正しいIDならばTRUEを返す。
*/
static bool spell_attack(byte spell)
{
/*!
- * @brief IDÃͤ¬ÂàÈòÌÜŪ¤ËŬ¤·¤¿¥â¥ó¥¹¥¿¡¼ËâË¡ID¤«¤É¤¦¤«¤òÊÖ¤¹ /
+ * @brief ID値が退避目的に適したモンスター魔法IDかどうかを返す /
* Return TRUE if a spell is good for escaping.
- * @param spell ȽÄêÂоݤÎID
- * @return Ŭ¤·¤¿ËâË¡¤ÎID¤Ê¤é¤ÐTRUE¤òÊÖ¤¹¡£
+ * @param spell 判定対象のID
+ * @return 適した魔法のIDならばTRUEを返す。
*/
static bool spell_escape(byte spell)
{
}
/*!
- * @brief IDÃͤ¬Ë¸³²ÌÜŪ¤ËŬ¤·¤¿¥â¥ó¥¹¥¿¡¼ËâË¡ID¤«¤É¤¦¤«¤òÊÖ¤¹ /
+ * @brief ID値が妨害目的に適したモンスター魔法IDかどうかを返す /
* Return TRUE if a spell is good for annoying the player.
- * @param spell ȽÄêÂоݤÎID
- * @return Ŭ¤·¤¿ËâË¡¤ÎID¤Ê¤é¤ÐTRUE¤òÊÖ¤¹¡£
+ * @param spell 判定対象のID
+ * @return 適した魔法のIDならばTRUEを返す。
*/
static bool spell_annoy(byte spell)
{
}
/*!
- * @brief IDÃͤ¬¾¤´·¿¤Î¥â¥ó¥¹¥¿¡¼ËâË¡ID¤«¤É¤¦¤«¤òÊÖ¤¹ /
+ * @brief ID値が召喚型のモンスター魔法IDかどうかを返す /
* Return TRUE if a spell is good for annoying the player.
- * @param spell ȽÄêÂоݤÎID
- * @return ¾¤´·¿ËâË¡¤ÎID¤Ê¤é¤ÐTRUE¤òÊÖ¤¹¡£
+ * @param spell 判定対象のID
+ * @return 召喚型魔法のIDならばTRUEを返す。
*/
static bool spell_summon(byte spell)
{
/*!
- * @brief IDÃͤ¬»à¼ÔÉü³è½èÍý¤«¤É¤¦¤«¤òÊÖ¤¹ /
+ * @brief ID値が死者復活処理かどうかを返す /
* Return TRUE if a spell is good for annoying the player.
- * @param spell ȽÄêÂоݤÎID
- * @return »à¼ÔÉü³è¤Î½èÍý¤Ê¤é¤ÐTRUE¤òÊÖ¤¹¡£
+ * @param spell 判定対象のID
+ * @return 死者復活の処理ならばTRUEを返す。
*/
static bool spell_raise(byte spell)
{
}
/*!
- * @brief IDÃͤ¬Àï½ÑŪ¤Ê¥â¥ó¥¹¥¿¡¼ËâË¡ID¤«¤É¤¦¤«¤òÊÖ¤¹ /
+ * @brief ID値が戦術的なモンスター魔法IDかどうかを返す /
* Return TRUE if a spell is good in a tactical situation.
- * @param spell ȽÄêÂоݤÎID
- * @return Àï½ÑŪ¤ÊËâË¡¤ÎID¤Ê¤é¤ÐTRUE¤òÊÖ¤¹¡£
+ * @param spell 判定対象のID
+ * @return 戦術的な魔法のIDならばTRUEを返す。
*/
static bool spell_tactic(byte spell)
{
}
/*!
- * @brief IDÃͤ¬ÌµÅ¨²½¤¹¤ë¥â¥ó¥¹¥¿¡¼ËâË¡ID¤«¤É¤¦¤«¤òÊÖ¤¹ /
+ * @brief ID値が無敵化するモンスター魔法IDかどうかを返す /
* Return TRUE if a spell makes invulnerable.
- * @param spell ȽÄêÂоݤÎID
- * @return ¾¤´·¿ËâË¡¤ÎID¤Ê¤é¤ÐTRUE¤òÊÖ¤¹¡£
+ * @param spell 判定対象のID
+ * @return 召喚型魔法のIDならばTRUEを返す。
*/
static bool spell_invulner(byte spell)
{
}
/*!
- * @brief IDÃͤ¬²Ã®¤¹¤ë¥â¥ó¥¹¥¿¡¼ËâË¡ID¤«¤É¤¦¤«¤òÊÖ¤¹ /
+ * @brief ID値が加速するモンスター魔法IDかどうかを返す /
* Return TRUE if a spell hastes.
- * @param spell ȽÄêÂоݤÎID
- * @return ¾¤´·¿ËâË¡¤ÎID¤Ê¤é¤ÐTRUE¤òÊÖ¤¹¡£
+ * @param spell 判定対象のID
+ * @return 召喚型魔法のIDならばTRUEを返す。
*/
static bool spell_haste(byte spell)
{
/*!
- * @brief IDÃͤ¬»þ´ÖÄä»ß¤ò¹Ô¤¦¥â¥ó¥¹¥¿¡¼ËâË¡ID¤«¤É¤¦¤«¤òÊÖ¤¹ /
+ * @brief ID値が時間停止を行うモンスター魔法IDかどうかを返す /
* Return TRUE if a spell world.
- * @param spell ȽÄêÂоݤÎID
- * @return »þ´ÖÄä»ßËâË¡¤ÎID¤Ê¤é¤ÐTRUE¤òÊÖ¤¹¡£
+ * @param spell 判定対象のID
+ * @return 時間停止魔法のIDならばTRUEを返す。
*/
static bool spell_world(byte spell)
{
/*!
- * @brief IDÃͤ¬ÆÃÊ̸ú²Ì¤Î¥â¥ó¥¹¥¿¡¼ËâË¡ID¤«¤É¤¦¤«¤òÊÖ¤¹ /
+ * @brief ID値が特別効果のモンスター魔法IDかどうかを返す /
* Return TRUE if a spell special.
- * @param spell ȽÄêÂоݤÎID
- * @return ÆÃÊ̸ú²ÌËâË¡¤ÎID¤Ê¤é¤ÐTRUE¤òÊÖ¤¹¡£
+ * @param spell 判定対象のID
+ * @return 特別効果魔法のIDならばTRUEを返す。
*/
static bool spell_special(byte spell)
{
/*!
- * @brief IDÃͤ¬¸÷¤Î·õ¤Î¥â¥ó¥¹¥¿¡¼ËâË¡ID¤«¤É¤¦¤«¤òÊÖ¤¹ /
+ * @brief ID値が光の剣のモンスター魔法IDかどうかを返す /
* Return TRUE if a spell psycho-spear.
- * @param spell ȽÄêÂоݤÎID
- * @return ¸÷¤Î·õ¤ÎID¤Ê¤é¤ÐTRUE¤òÊÖ¤¹¡£
+ * @param spell 判定対象のID
+ * @return 光の剣のIDならばTRUEを返す。
*/
static bool spell_psy_spe(byte spell)
{
/*!
- * @brief IDÃͤ¬¼£ÌþËâË¡¤«¤É¤¦¤«¤òÊÖ¤¹ /
+ * @brief ID値が治癒魔法かどうかを返す /
* Return TRUE if a spell is good for healing.
- * @param spell ȽÄêÂоݤÎID
- * @return ¼£ÌþËâË¡¤ÎID¤Ê¤é¤ÐTRUE¤òÊÖ¤¹¡£
+ * @param spell 判定対象のID
+ * @return 治癒魔法のIDならばTRUEを返す。
*/
static bool spell_heal(byte spell)
{
/*!
- * @brief IDÃͤ¬ËâÎϾõ¤É¤¦¤«¤òÊÖ¤¹ /
+ * @brief ID値が魔力消去かどうかを返す /
* Return TRUE if a spell is good for dispel.
- * @param spell ȽÄêÂоݤÎID
- * @return ËâÎϾõî¤ÎID¤Ê¤é¤ÐTRUE¤òÊÖ¤¹¡£
+ * @param spell 判定対象のID
+ * @return 魔力消去のIDならばTRUEを返す。
*/
static bool spell_dispel(byte spell)
{
/*!
- * @brief ¥â¥ó¥¹¥¿¡¼¤¬¥×¥ì¥¤¥ä¡¼¤ËËâÎϾõî¤òÍ¿¤¨¤ë¤Ù¤¤«¤òȽÄꤹ¤ë¥ë¡¼¥Á¥ó
+ * @brief モンスターがプレイヤーに魔力消去を与えるべきかを判定するルーチン
* Check should monster cast dispel spell.
- * @param m_idx ¥â¥ó¥¹¥¿¡¼¤Î¹½Â¤ÂÎÇÛÎóID
- * @return ËâÎϾõî¤ò¤«¤±¤ë¤Ù¤¤Ê¤éTRUE¤òÊÖ¤¹¡£
+ * @param m_idx モンスターの構造体配列ID
+ * @return 魔力消去をかけるべきならTRUEを返す。
*/
-bool dispel_check(int m_idx)
+bool dispel_check(MONSTER_IDX m_idx)
{
monster_type *m_ptr = &m_list[m_idx];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
/*!
- * @brief ¥â¥ó¥¹¥¿¡¼¤ÎËâË¡ÁªÂò¥ë¡¼¥Á¥ó
+ * @brief モンスターの魔法選択ルーチン
* Have a monster choose a spell from a list of "useful" spells.
- * @param m_idx ¥â¥ó¥¹¥¿¡¼¤Î¹½Â¤ÂÎÇÛÎóID
- * @param spells ¸õÊäËâË¡ID¤ò¤Þ¤È¤á¤¿ÇÛÎó
- * @param num spells¤ÎŤµ
- * @return ÁªÂò¤·¤¿¥â¥ó¥¹¥¿¡¼ËâË¡¤ÎID
+ * @param m_idx モンスターの構造体配列ID
+ * @param spells 候補魔法IDをまとめた配列
+ * @param num spellsの長さ
+ * @return 選択したモンスター魔法のID
* @details
* Note that this list does NOT include spells that will just hit\n
* other monsters, and the list is restricted when the monster is\n
*\n
* This function may well be an efficiency bottleneck.\n
*/
-static int choose_attack_spell(int m_idx, byte spells[], byte num)
+static int choose_attack_spell(MONSTER_IDX m_idx, byte spells[], byte num)
{
monster_type *m_ptr = &m_list[m_idx];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
}
/* Player is close and we have attack spells, blink away */
- if ((distance(py, px, m_ptr->fy, m_ptr->fx) < 4) && (attack_num || (r_ptr->flags6 & RF6_TRAPS)) && (randint0(100) < 75) && !world_monster)
+ if ((distance(p_ptr->y, p_ptr->x, m_ptr->fy, m_ptr->fx) < 4) && (attack_num || (r_ptr->a_ability_flags2 & RF6_TRAPS)) && (randint0(100) < 75) && !world_monster)
{
/* Choose tactical spell */
if (tactic_num) return (tactic[randint0(tactic_num)]);
/*!
- * @brief IDÃͤ¬ÈóËâ½ÑŪ¤ÊÆü쵻ǽ¤«¤É¤¦¤«¤òÊÖ¤¹ /
+ * @brief ID値が非魔術的な特殊技能かどうかを返す /
* Return TRUE if a spell is inate spell.
- * @param spell ȽÄêÂоݤÎID
- * @return ÈóËâ½ÑŪ¤ÊÆü쵻ǽ¤Ê¤é¤ÐTRUE¤òÊÖ¤¹¡£
+ * @param spell 判定対象のID
+ * @return 非魔術的な特殊技能ならばTRUEを返す。
*/
-bool spell_is_inate(u16b spell)
+bool spell_is_inate(SPELL_IDX spell)
{
if (spell < 32 * 4) /* Set RF4 */
{
/*!
- * @brief ¥â¥ó¥¹¥¿¡¼¤¬¥×¥ì¥¤¥ä¡¼¤Ë¥À¥á¡¼¥¸¤òÍ¿¤¨¤ë¤¿¤á¤ÎºÇŬ¤ÊºÂɸ¤ò»»½Ð¤¹¤ë /
- * @param m_ptr µ»Ç½¤ò»ÈÍѤ¹¤ë¥â¥ó¥¹¥¿¡¼¹½Â¤ÂΤλ²¾È¥Ý¥¤¥ó¥¿
- * @param yp ºÇŬ¤ÊÌÜɸÃÏÅÀ¤ÎYºÂɸ¤òÊÖ¤¹»²¾È¥Ý¥¤¥ó¥¿
- * @param xp ºÇŬ¤ÊÌÜɸÃÏÅÀ¤ÎXºÂɸ¤òÊÖ¤¹»²¾È¥Ý¥¤¥ó¥¿
- * @param f_flag ¼ÍÀþ¤ËÆþ¤ì¤ë¤Î¤òÈò¤±¤ëÃÏ·Á¤Î½ê»ý¥Õ¥é¥°
- * @param path_check ¼ÍÀþ¤òȽÄꤹ¤ë¤¿¤á¤Î´Ø¿ô¥Ý¥¤¥ó¥¿
- * @return ͸ú¤ÊºÂɸ¤¬¤¢¤Ã¤¿¾ì¹çTRUE¤òÊÖ¤¹
+ * @brief モンスターがプレイヤーにダメージを与えるための最適な座標を算出する /
+ * @param m_ptr æ\8a\80è\83½ã\82\92使ç\94¨ã\81\99ã\82\8bã\83¢ã\83³ã\82¹ã\82¿ã\83¼æ§\8bé\80 ä½\93ã\81®å\8f\82ç\85§ã\83\9dã\82¤ã\83³ã\82¿
+ * @param yp æ\9c\80é\81©ã\81ªç\9b®æ¨\99å\9c°ç\82¹ã\81®Y座æ¨\99ã\82\92è¿\94ã\81\99å\8f\82ç\85§ã\83\9dã\82¤ã\83³ã\82¿
+ * @param xp æ\9c\80é\81©ã\81ªç\9b®æ¨\99å\9c°ç\82¹ã\81®X座æ¨\99ã\82\92è¿\94ã\81\99å\8f\82ç\85§ã\83\9dã\82¤ã\83³ã\82¿
+ * @param f_flag å°\84ç·\9aã\81«å\85¥ã\82\8cã\82\8bã\81®ã\82\92é\81¿ã\81\91ã\82\8bå\9c°å½¢ã\81®æ\89\80æ\8c\81ã\83\95ã\83©ã\82°
+ * @param path_check å°\84ç·\9aã\82\92å\88¤å®\9aã\81\99ã\82\8bã\81\9fã\82\81ã\81®é\96¢æ\95°ã\83\9dã\82¤ã\83³ã\82¿
+ * @return 有効な座標があった場合TRUEを返す
*/
-static bool adjacent_grid_check(monster_type *m_ptr, int *yp, int *xp,
- int f_flag, bool (*path_check)(int, int, int, int))
+static bool adjacent_grid_check(monster_type *m_ptr, POSITION *yp, POSITION *xp,
+ int f_flag, bool (*path_check)(POSITION, POSITION, POSITION, POSITION))
{
int i;
int tonari;
{-1, 0, 1, -1, 1, -1, 0, 1},
{ 1, 0, -1, 1, -1, 1, 0, -1}};
- if (m_ptr->fy < py && m_ptr->fx < px) tonari = 0;
- else if (m_ptr->fy < py) tonari = 1;
- else if (m_ptr->fx < px) tonari = 2;
+ if (m_ptr->fy < p_ptr->y && m_ptr->fx < p_ptr->x) tonari = 0;
+ else if (m_ptr->fy < p_ptr->y) tonari = 1;
+ else if (m_ptr->fx < p_ptr->x) tonari = 2;
else tonari = 3;
for (i = 0; i < 8; i++)
#define DO_SPELL_BA_LITE 3
/*!
- * @brief ¥â¥ó¥¹¥¿¡¼¤ÎÆü쵻ǽ¥á¥¤¥ó¥ë¡¼¥Á¥ó /
+ * @brief モンスターの特殊技能メインルーチン /
* Creatures can cast spells, shoot missiles, and breathe.
- * @param m_idx ¥â¥ó¥¹¥¿¡¼¹½Â¤ÂÎÇÛÎó¤ÎID
- * @return ¼ÂºÝ¤ËÆü쵻ǽ¤òÍøÍѤ·¤¿¤éTRUE¤òÊÖ¤¹
+ * @param m_idx モンスター構造体配列のID
+ * @return 実際に特殊技能を利用したらTRUEを返す
* @details
* Returns "TRUE" if a spell (or whatever) was (successfully) cast.\n
*\n
* Note the special "MFLAG_NICE" flag, which prevents a monster from using\n
* any spell attacks until the player has had a single chance to move.\n
*/
-bool make_attack_spell(int m_idx)
+bool make_attack_spell(MONSTER_IDX m_idx)
{
- int k, thrown_spell = 0, rlev, failrate;
+ int k;
+ SPELL_IDX thrown_spell = 0;
+ DEPTH rlev;
+ PERCENTAGE failrate;
byte spell[96], num = 0;
- u32b f4, f5, f6;
+ 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];
bool no_inate = FALSE;
bool do_spell = DO_SPELL_NONE;
int dam = 0;
- u32b mode = 0L;
- int s_num_6 = (easy_band ? 2 : 6);
- int s_num_4 = (easy_band ? 1 : 4);
- int rad = 0; //For elemental spells
/* Target location */
- int x = px;
- int y = py;
+ POSITION x = p_ptr->x;
+ POSITION y = p_ptr->y;
/* Target location for lite breath */
- int x_br_lite = 0;
- int y_br_lite = 0;
-
- /* Summon count */
- int count = 0;
-
- /* Extract the blind-ness */
- bool blind = (p_ptr->blind ? TRUE : FALSE);
+ POSITION x_br_lite = 0;
+ POSITION y_br_lite = 0;
/* Extract the "see-able-ness" */
- bool seen = (!blind && m_ptr->ml);
+ bool seen = (!p_ptr->blind && m_ptr->ml);
bool maneable = player_has_los_bold(m_ptr->fy, m_ptr->fx);
/* Check "projectable" */
/* 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;
/*** require projectable player ***/
if (((f4 & RF4_BOLT_MASK) ||
(f5 & RF5_BOLT_MASK) ||
(f6 & RF6_BOLT_MASK)) &&
- !clean_shot(m_ptr->fy, m_ptr->fx, py, px, FALSE))
+ !clean_shot(m_ptr->fy, m_ptr->fx, p_ptr->y, p_ptr->x, FALSE))
{
/* Remove spells that will only hurt friends */
f4 &= ~(RF4_BOLT_MASK);
/* 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 */
{
disturb(1, 1);
/* Message */
- msg_format(_("%^s¤Ï¼öʸ¤ò¾§¤¨¤è¤¦¤È¤·¤¿¤¬¼ºÇÔ¤·¤¿¡£", "%^s tries to cast a spell, but fails."), m_name);
+ 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))
{
- msg_format(_("È¿ËâË¡¥Ð¥ê¥¢¤¬%^s¤Î¼öʸ¤ò¤«¤¾Ã¤·¤¿¡£", "Anti magic barrier cancels the spell which %^s casts."), m_name);
+ msg_format(_("反魔法バリアが%^sの呪文をかき消した。", "Anti magic barrier cancels the spell which %^s casts."), m_name);
return (TRUE);
}