OSDN Git Service

main-win.c のコメントをDoxygen向けに調整。 / Rearrange comments of main-win.c for Doxygen.
[hengband/hengband.git] / src / spells3.c
index 978e579..9c7ffe3 100644 (file)
@@ -27,7 +27,7 @@
  * @param mode オプション
  * @return テレポート先として妥当ならばtrue
  */
-static bool cave_monster_teleportable_bold(MONSTER_IDX m_idx, int y, int x, u32b mode)
+static bool cave_monster_teleportable_bold(MONSTER_IDX m_idx, int y, int x, BIT_FLAGS mode)
 {
        monster_type *m_ptr = &m_list[m_idx];
        cave_type    *c_ptr = &cave[y][x];
@@ -63,7 +63,7 @@ static bool cave_monster_teleportable_bold(MONSTER_IDX m_idx, int y, int x, u32b
  * Attempt to move the monster at least "dis/2" grids away.
  * But allow variation to prevent infinite loops.
  */
-bool teleport_away(MONSTER_IDX m_idx, int dis, u32b mode)
+bool teleport_away(MONSTER_IDX m_idx, int dis, BIT_FLAGS mode)
 {
        int oy, ox, d, i, min;
        int tries = 0;
@@ -178,7 +178,7 @@ bool teleport_away(MONSTER_IDX m_idx, int dis, u32b mode)
  * @param mode オプション
  * @return なし
  */
-void teleport_monster_to(MONSTER_IDX m_idx, POSITION ty, POSITION tx, int power, u32b mode)
+void teleport_monster_to(MONSTER_IDX m_idx, POSITION ty, POSITION tx, int power, BIT_FLAGS mode)
 {
        int ny, nx, oy, ox, d, i, min;
        int attempts = 500;
@@ -278,7 +278,7 @@ void teleport_monster_to(MONSTER_IDX m_idx, POSITION ty, POSITION tx, int power,
  * @param mode オプション
  * @return テレポート先として妥当ならばtrue
  */
-bool cave_player_teleportable_bold(int y, int x, u32b mode)
+bool cave_player_teleportable_bold(int y, int x, BIT_FLAGS mode)
 {
        cave_type    *c_ptr = &cave[y][x];
        feature_type *f_ptr = &f_info[c_ptr->feat];
@@ -344,7 +344,7 @@ bool cave_player_teleportable_bold(int y, int x, u32b mode)
  * </pre>
  */
 
-bool teleport_player_aux(int dis, u32b mode)
+bool teleport_player_aux(int dis, BIT_FLAGS mode)
 {
        int candidates_at[MAX_TELEPORT_DISTANCE + 1];
        int total_candidates, cur_candidates;
@@ -461,7 +461,7 @@ bool teleport_player_aux(int dis, u32b mode)
  * @param mode オプション
  * @return なし
  */
-void teleport_player(int dis, u32b mode)
+void teleport_player(int dis, BIT_FLAGS mode)
 {
        int yy, xx;
 
@@ -556,7 +556,7 @@ void teleport_player_away(MONSTER_IDX m_idx, int dis)
  * This function allows teleporting into vaults (!)
  * </pre>
  */
-void teleport_player_to(POSITION ny, POSITION nx, u32b mode)
+void teleport_player_to(POSITION ny, POSITION nx, BIT_FLAGS mode)
 {
        POSITION y, x;
        int dis = 0, ctr = 0;
@@ -842,8 +842,9 @@ void teleport_level(MONSTER_IDX m_idx)
 DUNGEON_IDX choose_dungeon(cptr note, POSITION y, POSITION x)
 {
        DUNGEON_IDX select_dungeon;
-       int i, num = 0;
-       s16b *dun;
+       DUNGEON_IDX i;
+       int num = 0;
+       DUNGEON_IDX *dun;
 
        /* Hack -- No need to choose dungeon in some case */
        if (lite_town || vanilla_town || ironman_downward)
@@ -1041,7 +1042,7 @@ msg_format("%sの帰還レベルを %d 階にセット。", d_name+d_info[select
  * @return 劣化処理に関するメッセージが発せられた場合はTRUEを返す /
  * Return "TRUE" if the player notices anything
  */
-bool apply_disenchant(int mode)
+bool apply_disenchant(BIT_FLAGS mode)
 {
        int             t = 0;
        object_type     *o_ptr;
@@ -1242,7 +1243,7 @@ void apply_nexus(monster_type *m_ptr)
  */
 void phlogiston(void)
 {
-       int max_flog = 0;
+       GAME_TURN max_flog = 0;
        object_type * o_ptr = &inventory[INVEN_LITE];
 
        /* It's a lamp */
@@ -1271,7 +1272,7 @@ void phlogiston(void)
        }
 
        /* Refuel */
-       o_ptr->xtra4 += (max_flog / 2);
+       o_ptr->xtra4 += (XTRA16)(max_flog / 2);
 
        /* Message */
        msg_print(_("照明用アイテムに燃素を補充した。", "You add phlogiston to your light item."));
@@ -1279,7 +1280,7 @@ void phlogiston(void)
        /* Comment */
        if (o_ptr->xtra4 >= max_flog)
        {
-               o_ptr->xtra4 = max_flog;
+               o_ptr->xtra4 = (XTRA16)max_flog;
                msg_print(_("照明用アイテムは満タンになった。", "Your light item is full."));
        }
 
@@ -1676,13 +1677,13 @@ void call_the_(void)
  * @param require_los 射線の通りを要求するならばTRUE
  * @return なし
  */
-void fetch(int dir, int wgt, bool require_los)
+void fetch(DIRECTION dir, WEIGHT wgt, bool require_los)
 {
-       int             ty, tx;
-       DEPTH i;
-       cave_type       *c_ptr;
-       object_type     *o_ptr;
-       char            o_name[MAX_NLEN];
+       POSITION ty, tx;
+       OBJECT_IDX i;
+       cave_type *c_ptr;
+       object_type *o_ptr;
+       char o_name[MAX_NLEN];
 
        /* Check to see if an object is already there */
        if (cave[p_ptr->y][p_ptr->x].o_idx)
@@ -1764,6 +1765,7 @@ void fetch(int dir, int wgt, bool require_los)
        i = c_ptr->o_idx;
        c_ptr->o_idx = o_ptr->next_o_idx;
        cave[p_ptr->y][p_ptr->x].o_idx = i; /* 'move' it */
+
        o_ptr->next_o_idx = 0;
        o_ptr->iy = (byte)p_ptr->y;
        o_ptr->ix = (byte)p_ptr->x;
@@ -2297,7 +2299,7 @@ bool enchant(object_type *o_ptr, int n, int eflag)
  * Note that "num_ac" requires armour, else weapon
  * Returns TRUE if attempted, FALSE if cancelled
  */
-bool enchant_spell(int num_hit, int num_dam, int num_ac)
+bool enchant_spell(HIT_PROB num_hit, HIT_POINT num_dam, ARMOUR_CLASS num_ac)
 {
        OBJECT_IDX item;
        bool        okay = FALSE;
@@ -3024,7 +3026,7 @@ bool recharge(int power)
                         */
                        if ((o_ptr->tval == TV_STAFF) && (o_ptr->number > 1))
                        {
-                               recharge_amount /= o_ptr->number;
+                               recharge_amount /= (TIME_EFFECT)o_ptr->number;
                                if (recharge_amount < 1) recharge_amount = 1;
                        }
 
@@ -3908,7 +3910,7 @@ int mod_need_mana(int need_mana, int spell, int realm)
  * @return 失敗率(%)
  * @todo 統合を検討
  */
-int mod_spell_chance_1(int chance)
+PERCENTAGE mod_spell_chance_1(PERCENTAGE chance)
 {
        chance += p_ptr->to_m_chance;
 
@@ -3933,7 +3935,7 @@ int mod_spell_chance_1(int chance)
  * Note: variable "chance" cannot be negative.
  * @todo 統合を検討
  */
-int mod_spell_chance_2(int chance)
+PERCENTAGE mod_spell_chance_2(PERCENTAGE chance)
 {
        if (p_ptr->dec_mana) chance--;
 
@@ -3950,12 +3952,12 @@ int mod_spell_chance_2(int chance)
  * @param use_realm 魔法領域ID
  * @return 失敗率(%)
  */
-s16b spell_chance(int spell, int use_realm)
+PERCENTAGE spell_chance(SPELL_IDX spell, REALM_IDX use_realm)
 {
-       int             chance, minfail;
+       PERCENTAGE chance, minfail;
        const magic_type *s_ptr;
-       int             need_mana;
-       int penalty = (mp_ptr->spell_stat == A_WIS) ? 10 : 4;
+       MANA_POINT need_mana;
+       PERCENTAGE penalty = (mp_ptr->spell_stat == A_WIS) ? 10 : 4;
 
 
        /* Paranoia -- must be literate */
@@ -5235,7 +5237,7 @@ bool polymorph_monster(POSITION y, POSITION x)
        /* Handle polymorph */
        if (new_r_idx != old_r_idx)
        {
-               u32b mode = 0L;
+               BIT_FLAGS mode = 0L;
                bool preserve_hold_objects = back_m.hold_o_idx ? TRUE : FALSE;
                s16b this_o_idx, next_o_idx = 0;
 
@@ -5667,7 +5669,7 @@ bool eat_magic(int power)
  * @param mode 召喚オプション
  * @return ターンを消費した場合TRUEを返す
  */
-bool summon_kin_player(int level, int y, int x, u32b mode)
+bool summon_kin_player(int level, int y, int x, BIT_FLAGS mode)
 {
        bool pet = (bool)(mode & PM_FORCE_PET);
        if (!pet) mode |= PM_NO_PET;