OSDN Git Service

(2.2.0.17) avater.cとeffect.c内のC4457警告に対応。 / Deal C4457 warning in avater.c, effect.c.
[hengband/hengband.git] / src / spells3.c
index 9c3f9ad..1ac238a 100644 (file)
@@ -350,10 +350,10 @@ bool teleport_player_aux(int dis, u32b mode)
        int total_candidates, cur_candidates;
        int y = 0, x = 0, min, pick, i;
 
-       int left = MAX(1, px - dis);
-       int right = MIN(cur_wid - 2, px + dis);
-       int top = MAX(1, py - dis);
-       int bottom = MIN(cur_hgt - 2, py + dis);
+       int left = MAX(1, p_ptr->x - dis);
+       int right = MIN(cur_wid - 2, p_ptr->x + dis);
+       int top = MAX(1, p_ptr->y - dis);
+       int bottom = MIN(cur_hgt - 2, p_ptr->y + dis);
 
        if (p_ptr->wild_mode) return FALSE;
 
@@ -382,7 +382,7 @@ bool teleport_player_aux(int dis, u32b mode)
                        if (!cave_player_teleportable_bold(y, x, mode)) continue;
 
                        /* Calculate distance */
-                       d = distance(py, px, y, x);
+                       d = distance(p_ptr->y, p_ptr->x, y, x);
 
                        /* Skip too far locations */
                        if (d > dis) continue;
@@ -421,7 +421,7 @@ bool teleport_player_aux(int dis, u32b mode)
                        if (!cave_player_teleportable_bold(y, x, mode)) continue;
 
                        /* Calculate distance */
-                       d = distance(py, px, y, x);
+                       d = distance(p_ptr->y, p_ptr->x, y, x);
 
                        /* Skip too far locations */
                        if (d > dis) continue;
@@ -445,7 +445,7 @@ bool teleport_player_aux(int dis, u32b mode)
 
 #ifdef JP
        if ((p_ptr->pseikaku == SEIKAKU_COMBAT) || (inventory[INVEN_BOW].name1 == ART_CRIMSON))
-               msg_format("『こっちだぁ、%s』", player_name);
+               msg_format("『こっちだぁ、%s』", p_ptr->name);
 #endif
 
        /* Move the player */
@@ -465,8 +465,8 @@ void teleport_player(int dis, u32b mode)
        int yy, xx;
 
        /* Save the old location */
-       int oy = py;
-       int ox = px;
+       int oy = p_ptr->y;
+       int ox = p_ptr->x;
 
        if (!teleport_player_aux(dis, mode)) return;
 
@@ -490,7 +490,7 @@ void teleport_player(int dis, u32b mode)
                                if ((r_ptr->flags6 & RF6_TPORT) &&
                                    !(r_ptr->flagsr & RFR_RES_TELE))
                                {
-                                       if (!MON_CSLEEP(m_ptr)) teleport_monster_to(tmp_m_idx, py, px, r_ptr->level, 0L);
+                                       if (!MON_CSLEEP(m_ptr)) teleport_monster_to(tmp_m_idx, p_ptr->y, p_ptr->x, r_ptr->level, 0L);
                                }
                        }
                }
@@ -509,8 +509,8 @@ void teleport_player_away(int m_idx, int dis)
        int yy, xx;
 
        /* Save the old location */
-       int oy = py;
-       int ox = px;
+       int oy = p_ptr->y;
+       int ox = p_ptr->x;
 
        if (!teleport_player_aux(dis, TELEPORT_PASSIVE)) return;
 
@@ -534,7 +534,7 @@ void teleport_player_away(int m_idx, int dis)
                                if ((r_ptr->flags6 & RF6_TPORT) &&
                                    !(r_ptr->flagsr & RFR_RES_TELE))
                                {
-                                       if (!MON_CSLEEP(m_ptr)) teleport_monster_to(tmp_m_idx, py, px, r_ptr->level, 0L);
+                                       if (!MON_CSLEEP(m_ptr)) teleport_monster_to(tmp_m_idx, p_ptr->y, p_ptr->x, r_ptr->level, 0L);
                                }
                        }
                }
@@ -608,7 +608,7 @@ void teleport_away_followable(int m_idx)
 
        teleport_away(m_idx, MAX_SIGHT * 2 + 5, 0L);
 
-       if (old_ml && (old_cdis <= MAX_SIGHT) && !world_monster && !p_ptr->inside_battle && los(py, px, oldfy, oldfx))
+       if (old_ml && (old_cdis <= MAX_SIGHT) && !world_monster && !p_ptr->inside_battle && los(p_ptr->y, p_ptr->x, oldfy, oldfx))
        {
                bool follow = FALSE;
 
@@ -713,8 +713,8 @@ void teleport_level(int m_idx)
                        if (!dun_level)
                        {
                                dungeon_type = p_ptr->recall_dungeon;
-                               p_ptr->oldpy = py;
-                               p_ptr->oldpx = px;
+                               p_ptr->oldpy = p_ptr->y;
+                               p_ptr->oldpx = p_ptr->x;
                        }
 
                        if (record_stair) do_cmd_write_nikki(NIKKI_TELE_LEV, 1, NULL);
@@ -831,9 +831,10 @@ void teleport_level(int m_idx)
 
 
 /*!
- * @brief プレイヤー及びモンスターをレベルテレポートさせる /
- * Teleport the player one level up or down (random when legal)
- * @param m_idx テレポートの対象となるモンスターID(0ならばプレイヤー) / If m_idx <= 0, target is player.
+ * @brief これまでに入ったダンジョンの一覧を表示する
+ * @param note ダンジョンに施す処理記述
+ * @param y コンソールY座標
+ * @param x コンソールX座標
  * @return なし
  */
 int choose_dungeon(cptr note, int y, int x)
@@ -913,7 +914,7 @@ int choose_dungeon(cptr note, int y, int x)
 /*!
  * @brief プレイヤーの帰還発動及び中止処理 /
  * Recall the player to town or dungeon
- * @param turn 発動までのターン数
+ * @param turns 発動までのターン数
  * @return 常にTRUEを返す
  */
 bool recall_player(int turns)
@@ -964,7 +965,6 @@ bool recall_player(int turns)
 
 /*!
  * @brief 帰還用メインルーチン
- * @param turn 発動までのターン数
  * @return 常にTRUEを返す
  */
 bool word_of_recall(void)
@@ -1597,7 +1597,7 @@ void call_the_(void)
 
        for (i = 0; i < 9; i++)
        {
-               c_ptr = &cave[py + ddy_ddd[i]][px + ddx_ddd[i]];
+               c_ptr = &cave[p_ptr->y + ddy_ddd[i]][p_ptr->x + ddx_ddd[i]];
 
                if (!cave_have_flag_grid(c_ptr, FF_PROJECT))
                {
@@ -1653,7 +1653,7 @@ void call_the_(void)
                }
                else
                {
-                       if (destroy_area(py, px, 15 + p_ptr->lev + randint0(11), FALSE))
+                       if (destroy_area(p_ptr->y, p_ptr->x, 15 + p_ptr->lev + randint0(11), FALSE))
                                msg_print(_("ダンジョンが崩壊した...", "The dungeon collapses..."));
                        else
                                msg_print(_("ダンジョンは大きく揺れた。", "The dungeon trembles."));
@@ -1680,7 +1680,7 @@ void fetch(int dir, int wgt, bool require_los)
        char            o_name[MAX_NLEN];
 
        /* Check to see if an object is already there */
-       if (cave[py][px].o_idx)
+       if (cave[p_ptr->y][p_ptr->x].o_idx)
        {
                msg_print(_("自分の足の下にある物は取れません。", "You can't fetch when you're already standing on something."));
                return;
@@ -1692,7 +1692,7 @@ void fetch(int dir, int wgt, bool require_los)
                tx = target_col;
                ty = target_row;
 
-               if (distance(py, px, ty, tx) > MAX_RANGE)
+               if (distance(p_ptr->y, p_ptr->x, ty, tx) > MAX_RANGE)
                {
                        msg_print(_("そんなに遠くにある物は取れません!", "You can't fetch something that far away!"));
                        return;
@@ -1722,7 +1722,7 @@ void fetch(int dir, int wgt, bool require_los)
                                msg_print(_("そこはあなたの視界に入っていません。", "You have no direct line of sight to that location."));
                                return;
                        }
-                       else if (!projectable(py, px, ty, tx))
+                       else if (!projectable(p_ptr->y, p_ptr->x, ty, tx))
                        {
                                msg_print(_("そこは壁の向こうです。", "You have no direct line of sight to that location."));
                                return;
@@ -1732,8 +1732,8 @@ void fetch(int dir, int wgt, bool require_los)
        else
        {
                /* Use a direction */
-               ty = py; /* Where to drop the item */
-               tx = px;
+               ty = p_ptr->y; /* Where to drop the item */
+               tx = p_ptr->x;
 
                do
                {
@@ -1741,7 +1741,7 @@ void fetch(int dir, int wgt, bool require_los)
                        tx += ddx[dir];
                        c_ptr = &cave[ty][tx];
 
-                       if ((distance(py, px, ty, tx) > MAX_RANGE) ||
+                       if ((distance(p_ptr->y, p_ptr->x, ty, tx) > MAX_RANGE) ||
                                !cave_have_flag_bold(ty, tx, FF_PROJECT)) return;
                }
                while (!c_ptr->o_idx);
@@ -1758,15 +1758,15 @@ void fetch(int dir, int wgt, bool require_los)
 
        i = c_ptr->o_idx;
        c_ptr->o_idx = o_ptr->next_o_idx;
-       cave[py][px].o_idx = i; /* 'move' it */
+       cave[p_ptr->y][p_ptr->x].o_idx = i; /* 'move' it */
        o_ptr->next_o_idx = 0;
-       o_ptr->iy = (byte)py;
-       o_ptr->ix = (byte)px;
+       o_ptr->iy = (byte)p_ptr->y;
+       o_ptr->ix = (byte)p_ptr->x;
 
        object_desc(o_name, o_ptr, OD_NAME_ONLY);
        msg_format(_("%^sがあなたの足元に飛んできた。", "%^s flies through the air to your feet."), o_name);
 
-       note_spot(py, px);
+       note_spot(p_ptr->y, p_ptr->x);
        p_ptr->redraw |= PR_MAP;
 }
 
@@ -1810,21 +1810,21 @@ void alter_reality(void)
 bool warding_glyph(void)
 {
        /* XXX XXX XXX */
-       if (!cave_clean_bold(py, px))
+       if (!cave_clean_bold(p_ptr->y, p_ptr->x))
        {
                msg_print(_("床上のアイテムが呪文を跳ね返した。", "The object resists the spell."));
                return FALSE;
        }
 
        /* Create a glyph */
-       cave[py][px].info |= CAVE_OBJECT;
-       cave[py][px].mimic = feat_glyph;
+       cave[p_ptr->y][p_ptr->x].info |= CAVE_OBJECT;
+       cave[p_ptr->y][p_ptr->x].mimic = feat_glyph;
 
        /* Notice */
-       note_spot(py, px);
+       note_spot(p_ptr->y, p_ptr->x);
 
        /* Redraw */
-       lite_spot(py, px);
+       lite_spot(p_ptr->y, p_ptr->x);
 
        return TRUE;
 }
@@ -1836,26 +1836,26 @@ bool warding_glyph(void)
 bool place_mirror(void)
 {
        /* XXX XXX XXX */
-       if (!cave_clean_bold(py, px))
+       if (!cave_clean_bold(p_ptr->y, p_ptr->x))
        {
                msg_print(_("床上のアイテムが呪文を跳ね返した。", "The object resists the spell."));
                return FALSE;
        }
 
        /* Create a mirror */
-       cave[py][px].info |= CAVE_OBJECT;
-       cave[py][px].mimic = feat_mirror;
+       cave[p_ptr->y][p_ptr->x].info |= CAVE_OBJECT;
+       cave[p_ptr->y][p_ptr->x].mimic = feat_mirror;
 
        /* Turn on the light */
-       cave[py][px].info |= CAVE_GLOW;
+       cave[p_ptr->y][p_ptr->x].info |= CAVE_GLOW;
 
        /* Notice */
-       note_spot(py, px);
+       note_spot(p_ptr->y, p_ptr->x);
 
        /* Redraw */
-       lite_spot(py, px);
+       lite_spot(p_ptr->y, p_ptr->x);
 
-       update_local_illumination(py, px);
+       update_local_illumination(p_ptr->y, p_ptr->x);
 
        return TRUE;
 }
@@ -1869,21 +1869,21 @@ bool place_mirror(void)
 bool explosive_rune(void)
 {
        /* XXX XXX XXX */
-       if (!cave_clean_bold(py, px))
+       if (!cave_clean_bold(p_ptr->y, p_ptr->x))
        {
                msg_print(_("床上のアイテムが呪文を跳ね返した。", "The object resists the spell."));
                return FALSE;
        }
 
        /* Create a glyph */
-       cave[py][px].info |= CAVE_OBJECT;
-       cave[py][px].mimic = feat_explosive_rune;
+       cave[p_ptr->y][p_ptr->x].info |= CAVE_OBJECT;
+       cave[p_ptr->y][p_ptr->x].mimic = feat_explosive_rune;
 
        /* Notice */
-       note_spot(py, px);
+       note_spot(p_ptr->y, p_ptr->x);
        
        /* Redraw */
-       lite_spot(py, px);
+       lite_spot(p_ptr->y, p_ptr->x);
 
        return TRUE;
 }
@@ -2369,7 +2369,7 @@ msg_format("%s は明るく輝いた!",
 /*!
  * @brief アイテムが並の価値のアイテムかどうか判定する /
  * Check if an object is nameless weapon or armour
- * @param 判定するアイテムの情報参照ポインタ
+ * @param o_ptr 判定するアイテムの情報参照ポインタ
  * @return 並ならばTRUEを返す
  */
 static bool item_tester_hook_nameless_weapon_armour(object_type *o_ptr)
@@ -3646,9 +3646,6 @@ void display_spell_list(void)
            (p_ptr->pclass == CLASS_MIRROR_MASTER) ||
            (p_ptr->pclass == CLASS_FORCETRAINER))
        {
-               int             i;
-               int             y = 1;
-               int             x = 1;
                int             minfail = 0;
                int             plev = p_ptr->lev;
                int             chance = 0;
@@ -3658,6 +3655,9 @@ void display_spell_list(void)
                int             use_mind;
                bool use_hp = FALSE;
 
+               y = 1;
+               x = 1;
+
                /* Display a list of spells */
                prt("", y, x);
                put_str(_("名前", "Name"), y, x + 5);
@@ -3884,9 +3884,13 @@ int mod_need_mana(int need_mana, int spell, int realm)
 }
 
 
-/*
+/*!
+ * @brief 呪文の失敗率修正処理1(呪い、消費魔力減少、呪文簡易化) /
  * Modify spell fail rate
  * Using p_ptr->to_m_chance, p_ptr->dec_mana, p_ptr->easy_spell and p_ptr->heavy_spell
+ * @param chance 修正前失敗率
+ * @return 失敗率(%)
+ * @todo 統合を検討
  */
 int mod_spell_chance_1(int chance)
 {
@@ -3902,10 +3906,16 @@ int mod_spell_chance_1(int chance)
 }
 
 
-/*
+/*!
+ * @brief 呪文の失敗率修正処理2(消費魔力減少、呪い、負値修正) /
+ * Modify spell fail rate
+ * Using p_ptr->to_m_chance, p_ptr->dec_mana, p_ptr->easy_spell and p_ptr->heavy_spell
+ * @param chance 修正前失敗率
+ * @return 失敗率(%)
  * Modify spell fail rate (as "suffix" process)
  * Using p_ptr->dec_mana, p_ptr->easy_spell and p_ptr->heavy_spell
  * Note: variable "chance" cannot be negative.
+ * @todo 統合を検討
  */
 int mod_spell_chance_2(int chance)
 {
@@ -3917,8 +3927,12 @@ int mod_spell_chance_2(int chance)
 }
 
 
-/*
+/*!
+ * @brief 呪文の失敗率計算メインルーチン /
  * Returns spell chance of failure for spell -RAK-
+ * @param spell 呪文ID
+ * @param use_realm 魔法領域ID
+ * @return 失敗率(%)
  */
 s16b spell_chance(int spell, int use_realm)
 {
@@ -4021,11 +4035,16 @@ s16b spell_chance(int spell, int use_realm)
 }
 
 
-
-/*
+/*!
+ * @brief 魔法が利用可能かどうかを返す /
  * Determine if a spell is "okay" for the player to cast or study
  * The spell must be legible, not forgotten, and also, to cast,
  * it must be known, and to study, it must not be known.
+ * @param spell 呪文ID
+ * @param learned 使用可能な判定ならばTRUE、学習可能かどうかの判定ならばFALSE
+ * @param study_pray 祈りの学習判定目的ならばTRUE
+ * @param use_realm 魔法領域ID
+ * @return 失敗率(%)
  */
 bool spell_okay(int spell, bool learned, bool study_pray, int use_realm)
 {
@@ -4070,8 +4089,17 @@ bool spell_okay(int spell, bool learned, bool study_pray, int use_realm)
 }
 
 
-/*
+
+/*!
+ * @brief 呪文情報の表示処理 /
  * Print a list of spells (for browsing or casting or viewing)
+ * @param target_spell 呪文ID
+ * @param spells アクセス開始するスペルの参照ポイント
+ * @param num 表示する
+ * @param y 表示メッセージ左上Y座標
+ * @param x 表示メッセージ左上X座標
+ * @param use_realm 魔法領域ID
+ * @return なし
  */
 void print_spells(int target_spell, byte *spells, int num, int y, int x, int use_realm)
 {
@@ -4233,13 +4261,12 @@ void print_spells(int target_spell, byte *spells, int num, int y, int x, int use
 }
 
 
-/*
+/*!
+ * @brief アイテムが酸で破損するかどうかを判定する
+ * @param o_ptr アイテムの情報参照ポインタ
+ * @return 破損するならばTRUEを返す
  * Note that amulets, rods, and high-level spell books are immune
  * to "inventory damage" of any kind.  Also sling ammo and shovels.
- */
-
-
-/*
  * Does a given class of objects (usually) hate acid?
  * Note that acid can either melt or corrode something.
  */
@@ -4294,8 +4321,11 @@ bool hates_acid(object_type *o_ptr)
 }
 
 
-/*
+/*!
+ * @brief アイテムが電撃で破損するかどうかを判定する /
  * Does a given object (usually) hate electricity?
+ * @param o_ptr アイテムの情報参照ポインタ
+ * @return 破損するならばTRUEを返す
  */
 bool hates_elec(object_type *o_ptr)
 {
@@ -4312,8 +4342,12 @@ bool hates_elec(object_type *o_ptr)
 }
 
 
-/*
+/*!
+ * @brief アイテムが火炎で破損するかどうかを判定する /
  * Does a given object (usually) hate fire?
+ * @param o_ptr アイテムの情報参照ポインタ
+ * @return 破損するならばTRUEを返す
+ * @details
  * Hafted/Polearm weapons have wooden shafts.
  * Arrows/Bows are mostly wooden.
  */
@@ -4372,8 +4406,11 @@ bool hates_fire(object_type *o_ptr)
 }
 
 
-/*
+/*!
+ * @brief アイテムが冷気で破損するかどうかを判定する /
  * Does a given object (usually) hate cold?
+ * @param o_ptr アイテムの情報参照ポインタ
+ * @return 破損するならばTRUEを返す
  */
 bool hates_cold(object_type *o_ptr)
 {
@@ -4391,8 +4428,12 @@ bool hates_cold(object_type *o_ptr)
 }
 
 
-/*
+/*!
+ * @brief アイテムが酸で破損するかどうかを判定する(メインルーチン) /
  * Melt something
+ * @param o_ptr アイテムの情報参照ポインタ
+ * @return 破損するならばTRUEを返す
+ * @todo 統合を検討
  */
 int set_acid_destroy(object_type *o_ptr)
 {
@@ -4404,8 +4445,12 @@ int set_acid_destroy(object_type *o_ptr)
 }
 
 
-/*
+/*!
+ * @brief アイテムが電撃で破損するかどうかを判定する(メインルーチン) /
  * Electrical damage
+ * @param o_ptr アイテムの情報参照ポインタ
+ * @return 破損するならばTRUEを返す
+ * @todo 統合を検討
  */
 int set_elec_destroy(object_type *o_ptr)
 {
@@ -4417,8 +4462,12 @@ int set_elec_destroy(object_type *o_ptr)
 }
 
 
-/*
+/*!
+ * @brief アイテムが火炎で破損するかどうかを判定する(メインルーチン) /
  * Burn something
+ * @param o_ptr アイテムの情報参照ポインタ
+ * @return 破損するならばTRUEを返す
+ * @todo 統合を検討
  */
 int set_fire_destroy(object_type *o_ptr)
 {
@@ -4430,8 +4479,12 @@ int set_fire_destroy(object_type *o_ptr)
 }
 
 
-/*
+/*!
+ * @brief アイテムが冷気で破損するかどうかを判定する(メインルーチン) /
  * Freeze things
+ * @param o_ptr アイテムの情報参照ポインタ
+ * @return 破損するならばTRUEを返す
+ * @todo 統合を検討
  */
 int set_cold_destroy(object_type *o_ptr)
 {
@@ -4443,8 +4496,13 @@ int set_cold_destroy(object_type *o_ptr)
 }
 
 
-/*
+/*!
+ * @brief アイテムが指定確率で破損するかどうかを判定する /
  * Destroys a type of item on a given percent chance
+ * @param typ 破損判定関数ポインタ
+ * @param perc 基本確率
+ * @return 破損したアイテムの数
+ * @details
  * Note that missiles are no longer necessarily all destroyed
  * Destruction taken from "melee.c" code for "stealing".
  * New-style wands and rods handled correctly. -LM-
@@ -4513,7 +4571,7 @@ o_name, index_to_label(i),
                                /* Potions smash open */
                                if (object_is_potion(o_ptr))
                                {
-                                       (void)potion_smash_effect(0, py, px, o_ptr->k_idx);
+                                       (void)potion_smash_effect(0, p_ptr->y, p_ptr->x, o_ptr->k_idx);
                                }
 
                                /* Reduce the charges of rods/wands */
@@ -4534,11 +4592,12 @@ o_name, index_to_label(i),
 }
 
 
-/*
+/*!
+ * @brief 酸攻撃による装備のAC劣化処理 /
  * Acid has hit the player, attempt to affect some armor.
- *
+ * @return ACが実際に劣化したらTRUEを返す
+ * @details
  * Note that the "base armor" of an object never changes.
- *
  * If any armor is damaged (or resists), the player takes less damage.
  */
 static int minus_ac(void)
@@ -4601,8 +4660,14 @@ static int minus_ac(void)
 }
 
 
-/*
+/*!
+ * @brief 酸属性によるプレイヤー損害処理 /
  * Hurt the player with Acid
+ * @param dam 基本ダメージ量
+ * @param kb_str ダメージ原因記述
+ * @param monspell 原因となったモンスター特殊攻撃ID
+ * @param aura オーラよるダメージが原因ならばTRUE
+ * @return 修正HPダメージ量
  */
 int acid_dam(int dam, cptr kb_str, int monspell, bool aura)
 {
@@ -4645,8 +4710,14 @@ int acid_dam(int dam, cptr kb_str, int monspell, bool aura)
 }
 
 
-/*
+/*!
+ * @brief 電撃属性によるプレイヤー損害処理 /
  * Hurt the player with electricity
+ * @param dam 基本ダメージ量
+ * @param kb_str ダメージ原因記述
+ * @param monspell 原因となったモンスター特殊攻撃ID
+ * @param aura オーラよるダメージが原因ならばTRUE
+ * @return 修正HPダメージ量
  */
 int elec_dam(int dam, cptr kb_str, int monspell, bool aura)
 {
@@ -4688,8 +4759,14 @@ int elec_dam(int dam, cptr kb_str, int monspell, bool aura)
 }
 
 
-/*
+/*!
+ * @brief 火炎属性によるプレイヤー損害処理 /
  * Hurt the player with Fire
+ * @param dam 基本ダメージ量
+ * @param kb_str ダメージ原因記述
+ * @param monspell 原因となったモンスター特殊攻撃ID
+ * @param aura オーラよるダメージが原因ならばTRUE
+ * @return 修正HPダメージ量
  */
 int fire_dam(int dam, cptr kb_str, int monspell, bool aura)
 {
@@ -4731,8 +4808,14 @@ int fire_dam(int dam, cptr kb_str, int monspell, bool aura)
 }
 
 
-/*
+/*!
+ * @brief 冷気属性によるプレイヤー損害処理 /
  * Hurt the player with Cold
+ * @param dam 基本ダメージ量
+ * @param kb_str ダメージ原因記述
+ * @param monspell 原因となったモンスター特殊攻撃ID
+ * @param aura オーラよるダメージが原因ならばTRUE
+ * @return 修正HPダメージ量
  */
 int cold_dam(int dam, cptr kb_str, int monspell, bool aura)
 {
@@ -4772,7 +4855,10 @@ int cold_dam(int dam, cptr kb_str, int monspell, bool aura)
        return get_damage;
 }
 
-
+/*!
+ * @brief 防具の錆止め防止処理
+ * @return ターン消費を要する処理を行ったならばTRUEを返す
+ */
 bool rustproof(void)
 {
        int         item;
@@ -4836,8 +4922,10 @@ msg_format("%sは腐食しなくなった。", o_name);
 }
 
 
-/*
+/*!
+ * @brief 防具呪縛処理 /
  * Curse the players armor
+ * @return 実際に呪縛されたらTRUEを返す
  */
 bool curse_armor(void)
 {
@@ -4910,9 +4998,12 @@ msg_format("%sが%sを包み込もうとしたが、%sはそれを跳ね返し
        return (TRUE);
 }
 
-
-/*
+/*!
+ * @brief 武器呪縛処理 /
  * Curse the players weapon
+ * @param force 無条件に呪縛を行うならばTRUE
+ * @param o_ptr 呪縛する武器のアイテム情報参照ポインタ
+ * @return 実際に呪縛されたらTRUEを返す
  */
 bool curse_weapon_object(bool force, object_type *o_ptr)
 {
@@ -4978,6 +5069,13 @@ bool curse_weapon_object(bool force, object_type *o_ptr)
        return (TRUE);
 }
 
+/*!
+ * @brief 武器呪縛処理のメインルーチン /
+ * Curse the players weapon
+ * @param force 無条件に呪縛を行うならばTRUE
+ * @param slot 呪縛する武器の装備スロット
+ * @return 実際に呪縛されたらTRUEを返す
+ */
 bool curse_weapon(bool force, int slot)
 {
        /* Curse the weapon */
@@ -4985,8 +5083,10 @@ bool curse_weapon(bool force, int slot)
 }
 
 
-/*
+/*!
+ * @brief ボルトのエゴ化処理(火炎エゴのみ) /
  * Enchant some bolts
+ * @return 常にTRUEを返す
  */
 bool brand_bolts(void)
 {
@@ -5034,9 +5134,12 @@ bool brand_bolts(void)
 }
 
 
-/*
+/*!
+ * @brief 変身処理向けにモンスターの近隣レベル帯モンスターを返す /
  * Helper function -- return a "nearby" race for polymorphing
- *
+ * @param r_idx 基準となるモンスター種族ID
+ * @return 変更先のモンスター種族ID
+ * @details
  * Note that this function is one of the more "dangerous" ones...
  */
 static s16b poly_r_idx(int r_idx)
@@ -5083,7 +5186,13 @@ static s16b poly_r_idx(int r_idx)
        return (r_idx);
 }
 
-
+/*!
+ * @brief 指定座標にいるモンスターを変身させる /
+ * Helper function -- return a "nearby" race for polymorphing
+ * @param y 指定のY座標
+ * @param x 指定のX座標
+ * @return 実際に変身したらTRUEを返す
+ */
 bool polymorph_monster(int y, int x)
 {
        cave_type *c_ptr = &cave[y][x];
@@ -5181,9 +5290,12 @@ bool polymorph_monster(int y, int x)
        return polymorphed;
 }
 
-
-/*
+/*!
+ * @brief 次元の扉処理 /
  * Dimension Door
+ * @param x テレポート先のX座標
+ * @param y テレポート先のY座標
+ * @return 目標に指定通りテレポートできたならばTRUEを返す
  */
 static bool dimension_door_aux(int x, int y)
 {
@@ -5192,7 +5304,7 @@ static bool dimension_door_aux(int x, int y)
        p_ptr->energy_need += (s16b)((s32b)(60 - plev) * ENERGY_NEED() / 100L);
 
        if (!cave_player_teleportable_bold(y, x, 0L) ||
-           (distance(y, x, py, px) > plev / 2 + 10) ||
+           (distance(y, x, p_ptr->y, p_ptr->x) > plev / 2 + 10) ||
            (!randint0(plev / 10 + 10)))
        {
                p_ptr->energy_need += (s16b)((s32b)(60 - plev) * ENERGY_NEED() / 100L);
@@ -5211,8 +5323,10 @@ static bool dimension_door_aux(int x, int y)
 }
 
 
-/*
+/*!
+ * @brief 次元の扉処理のメインルーチン /
  * Dimension Door
+ * @return ターンを消費した場合TRUEを返す
  */
 bool dimension_door(void)
 {
@@ -5229,8 +5343,10 @@ bool dimension_door(void)
 }
 
 
-/*
+/*!
+ * @brief 鏡抜け処理のメインルーチン /
  * Mirror Master's Dimension Door
+ * @return ターンを消費した場合TRUEを返す
  */
 bool mirror_tunnel(void)
 {
@@ -5246,7 +5362,11 @@ bool mirror_tunnel(void)
        return TRUE;
 }
 
-
+/*!
+ * @brief 魔力食い処理
+ * @param power 基本効力
+ * @return ターンを消費した場合TRUEを返す
+ */
 bool eat_magic(int power)
 {
        object_type * o_ptr;
@@ -5520,7 +5640,14 @@ bool eat_magic(int power)
        return TRUE;
 }
 
-
+/*!
+ * @brief 同族召喚(援軍)処理
+ * @param level 召喚基準レベル
+ * @param y 召喚先Y座標
+ * @param x 召喚先X座標
+ * @param mode 召喚オプション
+ * @return ターンを消費した場合TRUEを返す
+ */
 bool summon_kin_player(int level, int y, int x, u32b mode)
 {
        bool pet = (bool)(mode & PM_FORCE_PET);
@@ -5629,7 +5756,13 @@ bool summon_kin_player(int level, int y, int x, u32b mode)
        return summon_specific((pet ? -1 : 0), y, x, level, SUMMON_KIN, mode);
 }
 
-void massacre(int py, int px)
+/*!
+ * @brief 皆殺し(全方向攻撃)処理
+ * @param py プレイヤーY座標
+ * @param px プレイヤーX座標
+ * @return なし
+ */
+void massacre(void)
 {
        int x, y;
        cave_type       *c_ptr;
@@ -5638,8 +5771,8 @@ void massacre(int py, int px)
 
        for (dir = 0; dir < 8; dir++)
        {
-               y = py + ddy_ddd[dir];
-               x = px + ddx_ddd[dir];
+               y = p_ptr->y + ddy_ddd[dir];
+               x = p_ptr->x + ddx_ddd[dir];
                c_ptr = &cave[y][x];
 
                /* Get the monster */