OSDN Git Service

[Refactor] #37353 型の置換。 / Type replacement. (PERCENTAGE)
authordeskull <deskull@users.sourceforge.jp>
Wed, 13 Mar 2019 14:02:44 +0000 (23:02 +0900)
committerdeskull <deskull@users.sourceforge.jp>
Wed, 13 Mar 2019 14:02:44 +0000 (23:02 +0900)
src/artifact.c
src/mane.c
src/mind.c
src/monster1.c
src/spells2.c
src/spells3.c

index fc7285f..16ca064 100644 (file)
@@ -241,7 +241,7 @@ void one_ability(object_type *o_ptr)
 void one_activation(object_type *o_ptr)
 {
        int type = 0;
-       int chance = 0;
+       PERCENTAGE chance = 0;
 
        while (randint1(100) >= chance)
        {
index d4e6d45..6a7b5dc 100644 (file)
@@ -89,9 +89,9 @@ static int get_mane_power(int *sn, bool baigaesi)
        int             num = 0;
        TERM_LEN y = 1;
        TERM_LEN x = 18;
-       int             minfail = 0;
+       PERCENTAGE minfail = 0;
        PLAYER_LEVEL plev = p_ptr->lev;
-       int             chance = 0;
+       PERCENTAGE chance = 0;
        int             ask;
        char            choice;
        char            out_val[160];
@@ -909,9 +909,9 @@ static bool use_mane(int spell)
  */
 bool do_cmd_mane(bool baigaesi)
 {
-       int             n = 0, j;
-       int             chance;
-       int             minfail = 0;
+       int n = 0, j;
+       PERCENTAGE chance;
+       PERCENTAGE minfail = 0;
        PLAYER_LEVEL plev = p_ptr->lev;
        monster_power   spell;
        bool            cast;
index f4417ed..2b010b2 100644 (file)
@@ -680,9 +680,9 @@ static bool_hack get_mind_power(SPELL_IDX *sn, bool only_browse)
        int             num = 0;
        TERM_LEN y = 1;
        TERM_LEN x = 10;
-       int             minfail = 0;
+       PERCENTAGE minfail = 0;
        PLAYER_LEVEL plev = p_ptr->lev;
-       int             chance = 0;
+       PERCENTAGE chance = 0;
        int             ask = TRUE;
        char            choice;
        char            out_val[160];
@@ -1753,8 +1753,8 @@ void do_cmd_mind(void)
 {
        SPELL_IDX n = 0;
        int b = 0;
-       int             chance;
-       int             minfail = 0;
+       PERCENTAGE chance;
+       PERCENTAGE minfail = 0;
        PLAYER_LEVEL plev = p_ptr->lev;
        int             old_csp = p_ptr->csp;
        mind_type       spell;
@@ -1953,24 +1953,24 @@ void do_cmd_mind(void)
                switch(use_mind)
                {
                case MIND_MINDCRAFTER:
-                       /* Cast the spell */
+                       
                        cast = cast_mindcrafter_spell(n);
                        break;
                case MIND_KI:
-                       /* Cast the spell */
+                       
                        cast = cast_force_spell(n);
                        break;
                case MIND_BERSERKER:
-                       /* Cast the spell */
+                       
                        cast = cast_berserk_spell(n);
                        break;
                case MIND_MIRROR_MASTER:
-                       /* Cast the spell */
+                       
                        if( is_mirror_grid(&current_floor_ptr->grid_array[p_ptr->y][p_ptr->x]) )on_mirror = TRUE;
                        cast = cast_mirror_spell(n);
                        break;
                case MIND_NINJUTSU:
-                       /* Cast the spell */
+                       
                        cast = cast_ninja_spell(n);
                        break;
                default:
index 3e1c11e..c3f06d7 100644 (file)
@@ -2975,7 +2975,7 @@ void monster_death(MONSTER_IDX m_idx, bool drop_item)
        if (drop_chosen_item)
        {
                ARTIFACT_IDX a_idx = 0;
-               int chance = 0;
+               PERCENTAGE chance = 0;
 
                for (i = 0; i < 4; i++)
                {
index c24357f..839ee1d 100644 (file)
@@ -2210,7 +2210,7 @@ static void cave_temp_room_lite(void)
                /* Process affected monsters */
                if (g_ptr->m_idx)
                {
-                       int chance = 25;
+                       PERCENTAGE chance = 25;
                        monster_type    *m_ptr = &current_floor_ptr->m_list[g_ptr->m_idx];
                        monster_race    *r_ptr = &r_info[m_ptr->r_idx];
                        update_monster(g_ptr->m_idx, FALSE);
index 4fecbdf..a3f462e 100644 (file)
@@ -2652,9 +2652,9 @@ void display_spell_list(void)
            (p_ptr->pclass == CLASS_MIRROR_MASTER) ||
            (p_ptr->pclass == CLASS_FORCETRAINER))
        {
-               int             minfail = 0;
+               PERCENTAGE minfail = 0;
                PLAYER_LEVEL plev = p_ptr->lev;
-               int             chance = 0;
+               PERCENTAGE chance = 0;
                mind_type       spell;
                char            comment[80];
                char            psi_desc[80];