From 98225695dd8c03500d7d823ed8b711f8bcd70e4d Mon Sep 17 00:00:00 2001 From: Deskull Date: Wed, 23 Jan 2019 13:19:17 +0900 Subject: [PATCH] =?utf8?q?[Refactor]=20#37353=20=E3=83=9B=E3=83=93?= =?utf8?q?=E3=83=83=E3=83=88=E3=81=AE=E9=A3=9F=E7=94=A8=E7=94=9F=E6=88=90?= =?utf8?q?=E3=82=92=20create=5Fration()=20=E3=81=AB=E5=88=86=E9=9B=A2?= =?utf8?q?=E3=80=82=20/=20Separate=20Hobbit's=20racial=20skill=20to=20crea?= =?utf8?q?te=5Fration().?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/externs.h | 2 ++ src/racial.c | 13 +------------ src/spells2.c | 17 ++++++++++++++++- 3 files changed, 19 insertions(+), 13 deletions(-) diff --git a/src/externs.h b/src/externs.h index c30875df1..4c9460e51 100644 --- a/src/externs.h +++ b/src/externs.h @@ -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); diff --git a/src/racial.c b/src/racial.c index f4f2bb41f..2158ae39f 100644 --- a/src/racial.c +++ b/src/racial.c @@ -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: diff --git a/src/spells2.c b/src/spells2.c index 4238801b0..87b2bc0e4 100644 --- a/src/spells2.c +++ b/src/spells2.c @@ -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; +} -- 2.11.0