OSDN Git Service

Extend features of tiling. (separation of Cell size and Tile size / add offset position.)
[hengband/hengband.git] / src / avatar.c
index 5ef28a1..5bfa4a5 100644 (file)
@@ -1,28 +1,24 @@
-/* File: avatar.c */
-
-/*
- * Purpose: Enable an Ultima IV style "avatar" game where you try to
- * achieve perfection in various virtues.
- *
- * Topi Ylinen 1998
- * f1toyl@uta.fi
- * topi.ylinen@noodi.fi
- *
- */
+/*!
+    @file avatar.c
+    @brief ¥¦¥ë¥Æ¥£¥Þ£´¤ò»²¹Í¤Ë¤·¤¿ÆÁ¤Î¥·¥¹¥Æ¥à¤Î¼ÂÁõ / Enable an Ultima IV style "avatar" game where you try to achieve perfection in various virtues.
+    @date 2013/12/23
+    @author
+    Topi Ylinen 1998\n
+    f1toyl@uta.fi\n
+    topi.ylinen@noodi.fi\n
+    \n
+    Copyright (c) 1989 James E. Wilson, Christopher J. Stuart
+    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.
+*/
 
-/*
- * Copyright (c) 1989 James E. Wilson, Christopher J. Stuart
- *
- * 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.
- */
 
 #include "angband.h"
 
-
-/* The names of the virtues */
-
+/*!
+ * ÆÁ¤Î̾¾Î / The names of the virtues
+ */
 cptr virtue[MAX_VIRTUE] =
 {
 #ifdef JP
@@ -66,7 +62,15 @@ cptr virtue[MAX_VIRTUE] =
 #endif
 };
 
-
+/*!
+ * @brief ³ºÅö¤ÎÆÁ¤¬¥×¥ì¥¤¥ä¡¼¤Ë»ØÄꤵ¤ì¤Æ¤¤¤ë¤«Èݤ«¤Ë±þ¤¸¤Ä¤Ä¡¢Âç¾®¤òÈæ³Ó¤¹¤ë¡£
+ * @details ÆÁ¤¬¤Ê¤¤¾ì¹ç¤ÏÃÍ0¤È¤·¤ÆÈæ³Ó¤¹¤ë¡£
+ * @param type Èæ³Ó¤·¤¿¤¤ÆÁ¤ÎID
+ * @param num Èæ³Ó´ð½àÃÍ
+ * @param tekitou VIRTUE_LARGE = ´ð½àÃͤè¤êÂ礭¤¤¤« / VIRTUE_SMALL = ´ð½àÃͤè¤ê¾®¤µ¤¤¤«
+ * @return Èæ³Ó¤Î¿¿µ¶ÃͤòÊÖ¤¹
+ * @todo °ú¿ô̾¤òľ¤·¤Æ¤ª¤¯
+ */
 bool compare_virtue(int type, int num, int tekitou)
 {
        int vir;
@@ -88,9 +92,11 @@ bool compare_virtue(int type, int num, int tekitou)
        return FALSE;
 }
 
-
-/* Aux function */
-
+/*!
+ * @brief ¥×¥ì¥¤¥ä¡¼¤Î»ØÄê¤ÎÆÁ¤¬²¿ÈÖÌܤΥ¹¥í¥Ã¥È¤ËÅÐÏ¿¤µ¤ì¤Æ¤¤¤ë¤«¤òÊÖ¤¹¡£ / Aux function
+ * @param type ³Îǧ¤·¤¿¤¤ÆÁ¤ÎID
+ * @return ¥¹¥í¥Ã¥È¤¬¤¢¤ë¤Ê¤é¤Ð¥¹¥í¥Ã¥È¤ÎID(0¡Á7)+1¡¢¤Ê¤¤¾ì¹ç¤Ï0¤òÊÖ¤¹¡£
+ */
 int virtue_number(int type)
 {
        int i;
@@ -105,8 +111,11 @@ int virtue_number(int type)
        return 0;
 }
 
-/* Aux function */
-
+/*!
+ * @brief ¥×¥ì¥¤¥ä¡¼¤Î¿¦¶È¤ä¼ï²¤Ë°Í¸¤·¤Ê¤¤¥é¥ó¥À¥à¤ÊÆÁ¤ò¼èÆÀ¤¹¤ë / Aux function
+ * @param which ³Îǧ¤·¤¿¤¤ÆÁ¤ÎID
+ * @return ¤Ê¤·
+ */
 static void get_random_virtue(int which)
 {
        int type = 0;
@@ -150,6 +159,11 @@ static void get_random_virtue(int which)
        p_ptr->vir_types[which] = type;
 }
 
+/*!
+ * @brief ¥×¥ì¥¤¥ä¡¼¤ÎÁª¤ó¤ÀËâË¡Îΰè¤Ë±þ¤¸¤ÆÂбþ¤¹¤ëÆÁ¤òÊÖ¤¹¡£
+ * @param realm ËâË¡Îΰè¤ÎID
+ * @return Âбþ¤¹¤ëÆÁ¤ÎID
+ */
 static s16b get_realm_virtues(byte realm)
 {
        switch (realm)
@@ -172,7 +186,7 @@ static s16b get_realm_virtues(byte realm)
                return V_KNOWLEDGE;
        case REALM_ARCANE:
                return 0;
-       case REALM_ENCHANT:
+       case REALM_CRAFT:
                if (virtue_number(V_ENCHANT)) return V_INDIVIDUALISM;
                else return V_ENCHANT;
        case REALM_DAEMON:
@@ -181,13 +195,20 @@ static s16b get_realm_virtues(byte realm)
        case REALM_CRUSADE:
                if (virtue_number(V_JUSTICE)) return V_HONOUR;
                else return V_JUSTICE;
+       case REALM_HEX:
+               if (virtue_number(V_COMPASSION)) return V_JUSTICE;
+               else return V_COMPASSION;
        };
 
        return 0;
 }
 
-/* Select virtues & reset values for a new character */
 
+/*!
+ * @brief ºîÀ®Ãæ¤Î¥×¥ì¥¤¥ä¡¼¥­¥ã¥é¥¯¥¿¡¼¤ËÆÁ8¼ïÎà¤òÍ¿¤¨¤ë¡£ / Select virtues & reset values for a new character
+ * @details ¿¦¶È¤Ë±þ¤¸¤Æ1¡Á4¼ï¤¬¸ÇÄê¡¢¼ï²¤Ë±þ¤¸¤Æ1¼ïÎबͿ¤¨¤é¤ì¡¢¸å¤Ï½ÅÊ£¤Ê¤¯¥é¥ó¥À¥à¤ËÁªÂò¤µ¤ì¤ë¡£
+ * @return ¤Ê¤·
+ */
 void get_virtues(void)
 {
        int i = 0, j = 0;
@@ -220,6 +241,7 @@ void get_virtues(void)
                p_ptr->vir_types[i++] = V_TEMPERANCE;
                break;
        case CLASS_ROGUE:
+       case CLASS_SNIPER:
                p_ptr->vir_types[i++] = V_HONOUR;
                break;
        case CLASS_RANGER:
@@ -329,7 +351,7 @@ void get_virtues(void)
        case RACE_HALF_TROLL: case RACE_BARBARIAN:
                p_ptr->vir_types[i++] = V_VALOUR;
                break;
-       case RACE_HIGH_ELF: case RACE_KUTA:
+       case RACE_HIGH_ELF: case RACE_KUTAR:
                p_ptr->vir_types[i++] = V_VITALITY;
                break;
        case RACE_HALF_GIANT: case RACE_GOLEM: case RACE_ANGEL: case RACE_DEMON:
@@ -391,6 +413,13 @@ void get_virtues(void)
        }
 }
 
+/*!
+ * @brief Âбþ¤¹¤ëÆÁ¤ò¥×¥ì¥¤¥ä¡¼¤¬¥¹¥í¥Ã¥È¤ËÅÐÏ¿¤·¤Æ¤¤¤ë¾ì¹ç¤Ë²Ã¸º¤ò¹Ô¤¦¡£
+ * @details ÈϰϤÏ-125¡Á125¡¢´ðËÜŪ¤ËÀäÂÐÃͤ¬Â礭¤¤¤Û¤ÉÀäÂÐÃͤ¬¾å¤¬¤ê¿É¤¯¤Ê¤ë¡£
+ * @param virtue ÆÁ¤ÎID
+ * @param amount ²Ã¸ºÎÌ
+ * @return ¤Ê¤·
+ */
 void chg_virtue(int virtue, int amount)
 {
        int i = 0;
@@ -449,6 +478,12 @@ void chg_virtue(int virtue, int amount)
        }
 }
 
+/*!
+ * @brief Âбþ¤¹¤ëÆÁ¤ò¥×¥ì¥¤¥ä¡¼¤¬¥¹¥í¥Ã¥È¤ËÅÐÏ¿¤·¤Æ¤¤¤ë¾ì¹ç¤Ë¸ÇÄêÃͤò¥»¥Ã¥È¤¹¤ë¡£
+ * @param virtue ÆÁ¤ÎID
+ * @param amount ¥»¥Ã¥È¤·¤¿¤¤ÃÍ¡£
+ * @return ¤Ê¤·
+ */
 void set_virtue(int virtue, int amount)
 {
        int i = 0;
@@ -463,6 +498,11 @@ void set_virtue(int virtue, int amount)
        }
 }
 
+/*!
+ * @brief ÆÁ¤Î¥À¥ó¥×ɽ¼¨¤ò¹Ô¤¦¡£
+ * @param OutFile ¥Õ¥¡¥¤¥ë¥Ý¥¤¥ó¥¿¡£
+ * @return ¤Ê¤·
+ */
 void dump_virtues(FILE *OutFile)
 {
        int v_nr = 0;