OSDN Git Service

Extend features of tiling. (separation of Cell size and Tile size / add offset position.)
[hengband/hengband.git] / src / cmd6.c
index 68b1abd..efb4d51 100644 (file)
@@ -1,19 +1,17 @@
 /*!
- *  @file cmd6.c
- *  @brief ¥×¥ì¥¤¥ä¡¼¤Î¥¢¥¤¥Æ¥à¤Ë´Ø¤¹¤ë¥³¥Þ¥ó¥É¤Î¼ÂÁõ2 / Spell/Prayer commands
- *  @date 2014/01/02
- *  @author
+ * @file cmd6.c
+ * @brief ¥×¥ì¥¤¥ä¡¼¤Î¥¢¥¤¥Æ¥à¤Ë´Ø¤¹¤ë¥³¥Þ¥ó¥É¤Î¼ÂÁõ2 / Spell/Prayer commands
+ * @date 2014/01/27
+ * @author
+ * <pre>
  * Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke
- *
  * This software may be copied and distributed for educational, research,
  * and not for profit purposes provided that this copyright and statement
  * are included in all such copies.  Other copyrights may also apply.
- */
-
-#include "angband.h"
-
-
-/*
+ * 2014 Deskull rearranged comment for Doxygen.\n
+ * </pre>
+ * @details
+ * <pre>
  * This file includes code for eating food, drinking potions,
  * reading scrolls, aiming wands, using staffs, zapping rods,
  * and activating artifacts.
  *
  * Note that food/potions/scrolls no longer use bit-flags for effects,
  * but instead use the "sval" (which is also used to sort the objects).
+ * </pre>
  */
 
+#include "angband.h"
+
 
+/*!
+ * @brief ¿©ÎÁ¤ò¿©¤Ù¤ë¥³¥Þ¥ó¥É¤Î¥µ¥Ö¥ë¡¼¥Á¥ó
+ * @param item ¿©¤Ù¤ë¥ª¥Ö¥¸¥§¥¯¥È¤Î½ê»ýÉÊID
+ * @return ¤Ê¤·
+ */
 static void do_cmd_eat_food_aux(int item)
 {
        int ident, lev;
@@ -633,8 +639,11 @@ msg_print("
 }
 
 
-/*
+/*!
+ * @brief ¥ª¥Ö¥¸¥§¥¯¥È¤ò¥×¥ì¥¤¥ä¡¼¤¬¿©¤Ù¤ë¤³¤È¤¬¤Ç¤­¤ë¤«¤òȽÄꤹ¤ë /
  * Hook to determine if an object is eatable
+ * @param o_ptr È½Äꤷ¤¿¤¤¥ª¥Ö¥¸¥§¥¯¥È¤Î¹½Â¤Âλ²¾È¥Ý¥¤¥ó¥¿
+ * @return ¿©¤Ù¤ë¤³¤È¤¬²Äǽ¤Ê¤é¤ÐTRUE¤òÊÖ¤¹
  */
 static bool item_tester_hook_eatable(object_type *o_ptr)
 {
@@ -672,8 +681,10 @@ static bool item_tester_hook_eatable(object_type *o_ptr)
 }
 
 
-/*
+/*!
+ * @brief ¿©ÎÁ¤ò¿©¤Ù¤ë¥³¥Þ¥ó¥É¤Î¥á¥¤¥ó¥ë¡¼¥Á¥ó /
  * Eat some food (from the pack or floor)
+ * @return ¤Ê¤·
  */
 void do_cmd_eat_food(void)
 {
@@ -705,8 +716,11 @@ void do_cmd_eat_food(void)
 }
 
 
-/*
+/*!
+ * @brief Ìô¤ò°û¤à¥³¥Þ¥ó¥É¤Î¥µ¥Ö¥ë¡¼¥Á¥ó /
  * Quaff a potion (from the pack or the floor)
+ * @param item °û¤àÌô¥ª¥Ö¥¸¥§¥¯¥È¤Î½ê»ýÉÊID
+ * @return ¤Ê¤·
  */
 static void do_cmd_quaff_potion_aux(int item)
 {
@@ -941,7 +955,7 @@ msg_print("
                        break;
 
                case SV_POTION_LOSE_MEMORIES:
-                       if (!p_ptr->hold_life && (p_ptr->exp > 0))
+                       if (!p_ptr->hold_exp && (p_ptr->exp > 0))
                        {
 #ifdef JP
                                msg_print("²áµî¤Îµ­²±¤¬Çö¤ì¤Æ¤¤¤¯µ¤¤¬¤¹¤ë¡£");
@@ -1520,8 +1534,11 @@ msg_print("
 }
 
 
-/*
+/*!
+ * @brief ¥ª¥Ö¥¸¥§¥¯¥È¤ò¥×¥ì¥¤¥ä¡¼¤¬°û¤à¤³¤È¤¬¤Ç¤­¤ë¤«¤òȽÄꤹ¤ë /
  * Hook to determine if an object can be quaffed
+ * @param o_ptr È½Äꤷ¤¿¤¤¥ª¥Ö¥¸¥§¥¯¥È¤Î¹½Â¤Âλ²¾È¥Ý¥¤¥ó¥¿
+ * @return °û¤à¤³¤È¤¬²Äǽ¤Ê¤é¤ÐTRUE¤òÊÖ¤¹
  */
 static bool item_tester_hook_quaff(object_type *o_ptr)
 {
@@ -1532,13 +1549,14 @@ static bool item_tester_hook_quaff(object_type *o_ptr)
                if (o_ptr->tval == TV_FLASK && o_ptr->sval == SV_FLASK_OIL)
                        return TRUE;
        }
-
        return FALSE;
 }
 
 
-/*
+/*!
+ * @brief Ìô¤ò°û¤à¥³¥Þ¥ó¥É¤Î¥á¥¤¥ó¥ë¡¼¥Á¥ó /
  * Quaff some potion (from the pack or floor)
+ * @return ¤Ê¤·
  */
 void do_cmd_quaff_potion(void)
 {
@@ -1569,12 +1587,18 @@ void do_cmd_quaff_potion(void)
 }
 
 
-/*
+/*!
+ * @brief ´¬Êª¤òÆɤॳ¥Þ¥ó¥É¤Î¥µ¥Ö¥ë¡¼¥Á¥ó
  * Read a scroll (from the pack or floor).
- *
+ * @param item Æɤ४¥Ö¥¸¥§¥¯¥È¤Î½ê»ýÉÊID
+ * @param known È½ÌÀºÑ¤Ê¤é¤ÐTRUE
+ * @return ¤Ê¤·
+ * @details
+ * <pre>
  * Certain scrolls can be "aborted" without losing the scroll.  These
  * include scrolls with no effects but recharge or identify, which are
  * cancelled before use.  XXX Reading them still takes a turn, though.
+ * </pre>
  */
 static void do_cmd_read_scroll_aux(int item, bool known)
 {
@@ -2231,9 +2255,11 @@ take_hit(DAMAGE_NOESCAPE, 111+randint1(111), "
        }
 }
 
-
-/*
+/*!
+ * @brief ¥ª¥Ö¥¸¥§¥¯¥È¤ò¥×¥ì¥¤¥ä¡¼¤¬Æɤळ¤È¤¬¤Ç¤­¤ë¤«¤òȽÄꤹ¤ë /
  * Hook to determine if an object is readable
+ * @param o_ptr È½Äꤷ¤¿¤¤¥ª¥Ö¥¸¥§¥¯¥È¤Î¹½Â¤Âλ²¾È¥Ý¥¤¥ó¥¿
+ * @return Æɤळ¤È¤¬²Äǽ¤Ê¤é¤ÐTRUE¤òÊÖ¤¹
  */
 static bool item_tester_hook_readable(object_type *o_ptr)
 {
@@ -2243,7 +2269,11 @@ static bool item_tester_hook_readable(object_type *o_ptr)
        return (FALSE);
 }
 
-
+/*!
+ * @brief Æɤॳ¥Þ¥ó¥É¤Î¥á¥¤¥ó¥ë¡¼¥Á¥ó /
+ * Eat some food (from the pack or floor)
+ * @return ¤Ê¤·
+ */
 void do_cmd_read_scroll(void)
 {
        object_type *o_ptr;
@@ -2318,7 +2348,15 @@ void do_cmd_read_scroll(void)
        do_cmd_read_scroll_aux(item, object_is_aware(o_ptr));
 }
 
-
+/*!
+ * @brief ¾ó¤Î¸ú²Ì¤òȯư¤¹¤ë
+ * @param sval ¥ª¥Ö¥¸¥§¥¯¥È¤Îsval
+ * @param use_charge »ÈÍѲó¿ô¤ò¾ÃÈñ¤·¤¿¤«¤É¤¦¤«¤òÊÖ¤¹»²¾È¥Ý¥¤¥ó¥¿
+ * @param powerful ¶¯ÎÏȯư¾å¤Î½èÍý¤Ê¤é¤ÐTRUE
+ * @param magic ËâÆ»¶ñ½Ñ¾å¤Î½èÍý¤Ê¤é¤ÐTRUE
+ * @param known È½ÌÀºÑ¤Ê¤é¤ÐTRUE
+ * @return È¯Æ°¤Ë¤è¤ê¸ú²ÌÆâÍƤ¬³ÎÄꤷ¤¿¤Ê¤é¤ÐTRUE¤òÊÖ¤¹
+ */
 static int staff_effect(int sval, bool *use_charge, bool powerful, bool magic, bool known)
 {
        int k;
@@ -2680,11 +2718,13 @@ msg_print("
        return ident;
 }
 
-/*
+/*!
+ * @brief ¾ó¤ò»È¤¦¥³¥Þ¥ó¥É¤Î¥µ¥Ö¥ë¡¼¥Á¥ó / 
  * Use a staff.                        -RAK-
- *
+ * @param item »È¤¦¥ª¥Ö¥¸¥§¥¯¥È¤Î½ê»ýÉÊID
+ * @return ¤Ê¤·
+ * @details
  * One charge of one staff disappears.
- *
  * Hack -- staffs of identify can be "cancelled".
  */
 static void do_cmd_use_staff_aux(int item)
@@ -2873,7 +2913,10 @@ static void do_cmd_use_staff_aux(int item)
        }
 }
 
-
+/*!
+ * @brief ¾ó¤ò»È¤¦¥³¥Þ¥ó¥É¤Î¥á¥¤¥ó¥ë¡¼¥Á¥ó /
+ * @return ¤Ê¤·
+ */
 void do_cmd_use_staff(void)
 {
        int  item;
@@ -2901,7 +2944,14 @@ void do_cmd_use_staff(void)
        do_cmd_use_staff_aux(item);
 }
 
-
+/*!
+ * @brief ËâË¡ËÀ¤Î¸ú²Ì¤òȯư¤¹¤ë
+ * @param sval ¥ª¥Ö¥¸¥§¥¯¥È¤Îsval
+ * @param dir È¯Æ°¤ÎÊý¸þID
+ * @param powerful ¶¯ÎÏȯư¾å¤Î½èÍý¤Ê¤é¤ÐTRUE
+ * @param magic ËâÆ»¶ñ½Ñ¾å¤Î½èÍý¤Ê¤é¤ÐTRUE
+ * @return È¯Æ°¤Ë¤è¤ê¸ú²ÌÆâÍƤ¬³ÎÄꤷ¤¿¤Ê¤é¤ÐTRUE¤òÊÖ¤¹
+ */
 static int wand_effect(int sval, int dir, bool powerful, bool magic)
 {
        int ident = FALSE;
@@ -3200,26 +3250,26 @@ msg_print("
        return ident;
 }
 
-
-/*
+/*!
+ * @brief ËâË¡ËÀ¤ò»È¤¦¥³¥Þ¥ó¥É¤Î¥µ¥Ö¥ë¡¼¥Á¥ó / 
  * Aim a wand (from the pack or floor).
- *
+ * @param item »È¤¦¥ª¥Ö¥¸¥§¥¯¥È¤Î½ê»ýÉÊID
+ * @return ¤Ê¤·
+ * @details
+ * <pre>
  * Use a single charge from a single item.
  * Handle "unstacking" in a logical manner.
- *
  * For simplicity, you cannot use a stack of items from the
  * ground.  This would require too much nasty code.
- *
  * There are no wands which can "destroy" themselves, in the inventory
  * or on the ground, so we can ignore this possibility.  Note that this
  * required giving "wand of wonder" the ability to ignore destruction
  * by electric balls.
- *
  * All wands can be "cancelled" at the "Direction?" prompt for free.
- *
  * Note that the basic "bolt" wands do slightly less damage than the
  * basic "bolt" rods, but the basic "ball" wands do the same damage
  * as the basic "ball" rods.
+ * </pre>
  */
 static void do_cmd_aim_wand_aux(int item)
 {
@@ -3376,7 +3426,10 @@ static void do_cmd_aim_wand_aux(int item)
        }
 }
 
-
+/*!
+ * @brief ËâË¡ËÀ¤ò»È¤¦¥³¥Þ¥ó¥É¤Î¥á¥¤¥ó¥ë¡¼¥Á¥ó /
+ * @return ¤Ê¤·
+ */
 void do_cmd_aim_wand(void)
 {
        int     item;
@@ -3405,7 +3458,15 @@ void do_cmd_aim_wand(void)
        do_cmd_aim_wand_aux(item);
 }
 
-
+/*!
+ * @brief ¥í¥Ã¥É¤Î¸ú²Ì¤òȯư¤¹¤ë
+ * @param sval ¥ª¥Ö¥¸¥§¥¯¥È¤Îsval
+ * @param dir È¯Æ°ÌÜɸ¤ÎÊý¸þID
+ * @param use_charge ¥Á¥ã¡¼¥¸¤ò¾ÃÈñ¤·¤¿¤«¤É¤¦¤«¤òÊÖ¤¹»²¾È¥Ý¥¤¥ó¥¿
+ * @param powerful ¶¯ÎÏȯư¾å¤Î½èÍý¤Ê¤é¤ÐTRUE
+ * @param magic ËâÆ»¶ñ½Ñ¾å¤Î½èÍý¤Ê¤é¤ÐTRUE
+ * @return È¯Æ°¤Ë¤è¤ê¸ú²ÌÆâÍƤ¬³ÎÄꤷ¤¿¤Ê¤é¤ÐTRUE¤òÊÖ¤¹
+ */
 static int rod_effect(int sval, int dir, bool *use_charge, bool powerful, bool magic)
 {
        int ident = FALSE;
@@ -3654,15 +3715,18 @@ static int rod_effect(int sval, int dir, bool *use_charge, bool powerful, bool m
        return ident;
 }
 
-/*
+/*!
+ * @brief ËâË¡ËÀ¤ò»È¤¦¥³¥Þ¥ó¥É¤Î¥µ¥Ö¥ë¡¼¥Á¥ó / 
  * Activate (zap) a Rod
- *
+ * @param item »È¤¦¥ª¥Ö¥¸¥§¥¯¥È¤Î½ê»ýÉÊID
+ * @return ¤Ê¤·
+ * @details
+ * <pre>
  * Unstack fully charged rods as needed.
- *
  * Hack -- rods of perception/genocide can be "cancelled"
  * All rods can be cancelled at the "Direction?" prompt
- *
  * pvals are defined for each rod in k_info. -LM-
+ * </pre>
  */
 static void do_cmd_zap_rod_aux(int item)
 {
@@ -3827,7 +3891,10 @@ msg_print("
        p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
 }
 
-
+/*!
+ * @brief ¥í¥Ã¥É¤ò»È¤¦¥³¥Þ¥ó¥É¤Î¥á¥¤¥ó¥ë¡¼¥Á¥ó /
+ * @return ¤Ê¤·
+ */
 void do_cmd_zap_rod(void)
 {
        int item;
@@ -3856,9 +3923,11 @@ void do_cmd_zap_rod(void)
        do_cmd_zap_rod_aux(item);
 }
 
-
-/*
+/*!
+ * @brief ¥ª¥Ö¥¸¥§¥¯¥È¤ò¥×¥ì¥¤¥ä¡¼¤¬ËâÆ»¶ñ¤È¤·¤Æȯư¤Ç¤­¤ë¤«¤òȽÄꤹ¤ë /
  * Hook to determine if an object is activatable
+ * @param o_ptr È½Äꤷ¤¿¤¤¥ª¥Ö¥¸¥§¥¯¥È¤Î¹½Â¤Âλ²¾È¥Ý¥¤¥ó¥¿
+ * @return ËâÆ»¶ñ¤È¤·¤Æȯư²Äǽ¤Ê¤é¤ÐTRUE¤òÊÖ¤¹
  */
 static bool item_tester_hook_activate(object_type *o_ptr)
 {
@@ -3877,9 +3946,11 @@ static bool item_tester_hook_activate(object_type *o_ptr)
        return (FALSE);
 }
 
-
-/*
+/*!
+ * @brief ¡Ø°ì¤Ä¤Î»ØÎء٤θú²Ì½èÍý /
  * Hack -- activate the ring of power
+ * @param dir È¯Æ°¤ÎÊý¸þID
+ * @return ¤Ê¤·
  */
 void ring_of_power(int dir)
 {
@@ -3953,7 +4024,14 @@ void ring_of_power(int dir)
        }
 }
 
-
+/*!
+ * @brief ¥Ú¥Ã¥ÈÆþ¤ê¥â¥ó¥¹¥¿¡¼¥Ü¡¼¥ë¤ò¥½¡¼¥È¤¹¤ë¤¿¤á¤ÎÈæ³Ó´Ø¿ô
+ * @param u ½ê»ýÉÊÇÛÎó¤Î»²¾È¥Ý¥¤¥ó¥¿
+ * @param v Ì¤»ÈÍÑ
+ * @param a ½ê»ýÉÊID1
+ * @param b ½ê»ýÉÊID2
+ * @return 1¤ÎÊý¤¬Âç¤Ç¤¢¤ì¤ÐTRUE
+ */
 static bool ang_sort_comp_pet(vptr u, vptr v, int a, int b)
 {
        u16b *who = (u16b*)(u);
@@ -3985,15 +4063,19 @@ static bool ang_sort_comp_pet(vptr u, vptr v, int a, int b)
 }
 
 
-/*
+/*!
+ * @brief ÁõÈ÷¤òȯư¤¹¤ë¥³¥Þ¥ó¥É¤Î¥µ¥Ö¥ë¡¼¥Á¥ó /
  * Activate a wielded object.  Wielded objects never stack.
  * And even if they did, activatable objects never stack.
- *
+ * @param item È¯Æ°¤¹¤ë¥ª¥Ö¥¸¥§¥¯¥È¤Î½ê»ýÉÊID
+ * @return ¤Ê¤·
+ * @details
+ * <pre>
  * Currently, only (some) artifacts, and Dragon Scale Mail, can be activated.
  * But one could, for example, easily make an activatable "Ring of Plasma".
- *
  * Note that it always takes a turn to activate an artifact, even if
  * the user hits "escape" at the "direction" prompt.
+ * </pre>
  */
 static void do_cmd_activate_aux(int item)
 {
@@ -4330,7 +4412,10 @@ static void do_cmd_activate_aux(int item)
 
 }
 
-
+/*!
+ * @brief ÁõÈ÷¤òȯư¤¹¤ë¥³¥Þ¥ó¥É¤Î¥á¥¤¥ó¥ë¡¼¥Á¥ó /
+ * @return ¤Ê¤·
+ */
 void do_cmd_activate(void)
 {
        int     item;
@@ -4362,8 +4447,11 @@ void do_cmd_activate(void)
 }
 
 
-/*
+/*!
+ * @brief ¥ª¥Ö¥¸¥§¥¯¥È¤ò¥×¥ì¥¤¥ä¡¼¤¬´Ê°×»ÈÍÑ¥³¥Þ¥ó¥É¤ÇÍøÍѤǤ­¤ë¤«¤òȽÄꤹ¤ë /
  * Hook to determine if an object is useable
+ * @param o_ptr È½Äꤷ¤¿¤¤¥ª¥Ö¥¸¥§¥¯¥È¤Î¹½Â¤Âλ²¾È¥Ý¥¤¥ó¥¿
+ * @return ÍøÍѲÄǽ¤Ê¤é¤ÐTRUE¤òÊÖ¤¹
  */
 static bool item_tester_hook_use(object_type *o_ptr)
 {
@@ -4414,8 +4502,11 @@ static bool item_tester_hook_use(object_type *o_ptr)
 }
 
 
-/*
+/*!
+ * @brief ¥¢¥¤¥Æ¥à¤òÈÆÍÑŪ¤Ë¡Ö»È¤¦¡×¥³¥Þ¥ó¥É¤Î¥á¥¤¥ó¥ë¡¼¥Á¥ó /
  * Use an item
+ * @return ¤Ê¤·
+ * @details
  * XXX - Add actions for other item types
  */
 void do_cmd_use(void)
@@ -4556,6 +4647,11 @@ msg_print("
        }
 }
 
+/*!
+ * @brief ËâÆ»¶ñ½Ñ»Õ¤Î¼è¤ê¹þ¤ó¤ÀËâÎÏ°ìÍ÷¤«¤éÁªÂò/±ÜÍ÷¤¹¤ë /
+ * @param only_browse ±ÜÍ÷¤¹¤ë¤À¤±¤Ê¤é¤ÐTRUE
+ * @return ÁªÂò¤·¤¿ËâÎϤÎID¡¢¥­¥ã¥ó¥»¥ë¤Ê¤é¤Ð-1¤òÊÖ¤¹
+ */
 static int select_magic_eater(bool only_browse)
 {
        int ext=0;
@@ -5027,8 +5123,12 @@ static int select_magic_eater(bool only_browse)
 }
 
 
-/*
- *  Use eaten rod, wand or staff
+/*!
+ * @brief ¼è¤ê¹þ¤ó¤ÀËâÎϤòÍøÍѤ¹¤ë¥³¥Þ¥ó¥É¤Î¥á¥¤¥ó¥ë¡¼¥Á¥ó /
+ * Use eaten rod, wand or staff
+ * @param only_browse ±ÜÍ÷¤¹¤ë¤À¤±¤Ê¤é¤ÐTRUE
+ * @param powerful ¶¯ÎÏȯưÃæ¤Î½èÍý¤Ê¤é¤ÐTRUE
+ * @return ¼ÂºÝ¤Ë¥³¥Þ¥ó¥É¤ò¼Â¹Ô¤·¤¿¤Ê¤é¤ÐTRUE¤òÊÖ¤¹¡£
  */
 bool do_cmd_magic_eater(bool only_browse, bool powerful)
 {