OSDN Git Service

[Refactor] #37353 ホビットの食用生成を create_ration() に分離。 / Separate Hobbit's racial skill...
authorDeskull <deskull@users.sourceforge.jp>
Wed, 23 Jan 2019 04:19:17 +0000 (13:19 +0900)
committerDeskull <deskull@users.sourceforge.jp>
Wed, 23 Jan 2019 04:19:17 +0000 (13:19 +0900)
src/externs.h
src/racial.c
src/spells2.c

index c30875d..4c9460e 100644 (file)
@@ -990,6 +990,8 @@ extern bool_hack vampirism(void);
 extern bool panic_hit(void);
 extern bool psychometry(void);
 extern bool draconian_breath(player_type *creature_ptr);
+extern bool android_inside_weapon(player_type *creature_ptr);
+extern bool create_ration(player_type *crature_ptr);
 
 /* spells3.c */
 extern bool teleport_away(MONSTER_IDX m_idx, POSITION dis, BIT_FLAGS mode);
index f4f2bb4..2158ae3 100644 (file)
@@ -868,18 +868,7 @@ static bool cmd_racial_power_aux(s32b command)
                        break;
 
                case RACE_HOBBIT:
-                       {
-                               object_type *q_ptr;
-                               object_type forge;
-                               q_ptr = &forge;
-
-                               /* Create the food ration */
-                               object_prep(q_ptr, lookup_kind(TV_FOOD, SV_FOOD_RATION));
-
-                               /* Drop the object from heaven */
-                               (void)drop_near(q_ptr, -1, p_ptr->y, p_ptr->x);
-                               msg_print(_("食事を料理して作った。", "You cook some food."));
-                       }
+                       return create_ration(p_ptr);
                        break;
 
                case RACE_GNOME:
index 4238801..87b2bc0 100644 (file)
@@ -5115,7 +5115,7 @@ bool draconian_breath(player_type *creature_ptr)
        stop_mouth();
        msg_format(_("あなたは%sのブレスを吐いた。", "You breathe %s."), Type_desc);
 
-       fire_breath(Type, creature_ptr->lev, dir, creature_ptr->lev * 2, (creature_ptr->lev / 15) + 1);
+       fire_breath(Type, dir, creature_ptr->lev * 2, (creature_ptr->lev / 15) + 1);
        return TRUE;
 }
 
@@ -5150,3 +5150,18 @@ bool android_inside_weapon(player_type *creature_ptr)
        }
        return TRUE;
 }
+
+bool create_ration(player_type *crature_ptr)
+{
+       object_type *q_ptr;
+       object_type forge;
+       q_ptr = &forge;
+
+       /* Create the food ration */
+       object_prep(q_ptr, lookup_kind(TV_FOOD, SV_FOOD_RATION));
+
+       /* Drop the object from heaven */
+       (void)drop_near(q_ptr, -1, crature_ptr->y, crature_ptr->x);
+       msg_print(_("食事を料理して作った。", "You cook some food."));
+       return TRUE;
+}