OSDN Git Service

[Refactor] #37353 take_turn() への移行途中。 / Refactoring to take_turn().
authordeskull <deskull@users.sourceforge.jp>
Wed, 13 Mar 2019 04:50:01 +0000 (13:50 +0900)
committerdeskull <deskull@users.sourceforge.jp>
Wed, 13 Mar 2019 04:50:01 +0000 (13:50 +0900)
src/cmd-item.c
src/mind.c
src/wild.c

index 32ea8c6..dc4d187 100644 (file)
@@ -548,12 +548,12 @@ void do_cmd_takeoff(void)
                else
                {
                        msg_print(_("装備を外せなかった。", "You couldn't remove the equipment."));
-                       p_ptr->energy_use = 50;
+                       take_turn(p_ptr, 50);
                        return;
                }
        }
 
-       p_ptr->energy_use = 50;
+       take_turn(p_ptr, 50);
 
        /* Take off the item */
        (void)inven_takeoff(item, 255);
@@ -600,7 +600,7 @@ void do_cmd_drop(void)
                if (amt <= 0) return;
        }
 
-       p_ptr->energy_use = 50;
+       take_turn(p_ptr, 50);
 
        /* Drop (some of) the item */
        inven_drop(item, amt);
@@ -948,7 +948,7 @@ static void do_cmd_refill_lamp(void)
        o_ptr = choose_object(&item, q, s, (USE_INVEN | USE_FLOOR));
        if (!o_ptr) return;
 
-       p_ptr->energy_use = 50;
+       take_turn(p_ptr, 50);
 
        /* Access the lantern */
        j_ptr = &inventory[INVEN_LITE];
@@ -1015,7 +1015,7 @@ static void do_cmd_refill_torch(void)
        o_ptr = choose_object(&item, q, s, (USE_INVEN | USE_FLOOR));
        if (!o_ptr) return;
 
-       p_ptr->energy_use = 50;
+       take_turn(p_ptr, 50);
 
        /* Access the primary torch */
        j_ptr = &inventory[INVEN_LITE];
index 49b3183..f4417ed 100644 (file)
@@ -1982,11 +1982,14 @@ void do_cmd_mind(void)
        }
 
 
-       take_turn(p_ptr, 100);
        /* teleport from mirror costs small energy */
-       if( on_mirror && p_ptr->pclass == CLASS_MIRROR_MASTER )
+       if(on_mirror && p_ptr->pclass == CLASS_MIRROR_MASTER)
        {
-         if( n==3 || n==5 || n==7 || n==16 ) p_ptr->energy_use = 50;
+         if( n==3 || n==5 || n==7 || n==16 ) take_turn(p_ptr, 50);
+       }
+       else
+       {
+               take_turn(p_ptr, 100);
        }
 
        if ((use_mind == MIND_BERSERKER) || (use_mind == MIND_NINJUTSU))
index 4e75f8c..eb6a746 100644 (file)
@@ -1166,8 +1166,7 @@ bool change_wild_mode(void)
                }
        }
 
-       /* HACK */
-       p_ptr->energy_use = 1000;
+       take_turn(p_ptr, 1000);
 
        /* Remember the position */
        p_ptr->oldpx = p_ptr->x;