From 15f3e6664e8bc4fc5a4f44f8c9fcecaae9da76fd Mon Sep 17 00:00:00 2001 From: Hourier Date: Tue, 18 Aug 2020 11:04:18 +0900 Subject: [PATCH] [Refactor] #40634 Separated activate_ball_cold_*() from switch_activation() --- src/object-activation/activation-switcher.c | 54 +++++++++++++++++++---------- 1 file changed, 36 insertions(+), 18 deletions(-) diff --git a/src/object-activation/activation-switcher.c b/src/object-activation/activation-switcher.c index d5f050171..83e8b10dc 100644 --- a/src/object-activation/activation-switcher.c +++ b/src/object-activation/activation-switcher.c @@ -183,6 +183,39 @@ bool activate_bolt_fire_1(player_type *user_ptr) return TRUE; } +bool activate_ball_cold_1(player_type *user_ptr) +{ + DIRECTION dir; + msg_print(_("それは霜に覆われた...", "It is covered in frost...")); + if (!get_aim_dir(user_ptr, &dir)) + return FALSE; + + (void)fire_ball(user_ptr, GF_COLD, dir, 48, 2); + return TRUE; +} + +bool activate_ball_cold_2(player_type *user_ptr) +{ + DIRECTION dir; + msg_print(_("それは青く激しく輝いた...", "It glows an intense blue...")); + if (!get_aim_dir(user_ptr, &dir)) + return FALSE; + + (void)fire_ball(user_ptr, GF_COLD, dir, 100, 2); + return TRUE; +} + +bool activate_ball_cold_3(player_type *user_ptr) +{ + DIRECTION dir; + msg_print(_("明るく白色に輝いている...", "It glows bright white...")); + if (!get_aim_dir(user_ptr, &dir)) + return FALSE; + + (void)fire_ball(user_ptr, GF_COLD, dir, 400, 3); + return TRUE; +} + static bool switch_activation(player_type *user_ptr, object_type *o_ptr, const activation_type *const act_ptr, concptr name) { DIRECTION dir; @@ -203,26 +236,11 @@ static bool switch_activation(player_type *user_ptr, object_type *o_ptr, const a case ACT_BO_FIRE_1: return activate_bolt_fire_1(user_ptr); case ACT_BA_COLD_1: - msg_print(_("それは霜に覆われた...", "It is covered in frost...")); - if (!get_aim_dir(user_ptr, &dir)) - return FALSE; - - (void)fire_ball(user_ptr, GF_COLD, dir, 48, 2); - return TRUE; + return activate_ball_cold_1(user_ptr); case ACT_BA_COLD_2: - msg_print(_("それは青く激しく輝いた...", "It glows an intense blue...")); - if (!get_aim_dir(user_ptr, &dir)) - return FALSE; - - (void)fire_ball(user_ptr, GF_COLD, dir, 100, 2); - return TRUE; + return activate_ball_cold_2(user_ptr); case ACT_BA_COLD_3: - msg_print(_("明るく白色に輝いている...", "It glows bright white...")); - if (!get_aim_dir(user_ptr, &dir)) - return FALSE; - - (void)fire_ball(user_ptr, GF_COLD, dir, 400, 3); - return TRUE; + return activate_ball_cold_2(user_ptr); case ACT_BA_FIRE_1: msg_print(_("それは赤く激しく輝いた...", "It glows an intense red...")); if (!get_aim_dir(user_ptr, &dir)) -- 2.11.0