OSDN Git Service

[Refactor] #38852 いくつかの do_cmd_*() をリファクタリング。 / Refactor some do_cmd_*().
authorDeskull <deskull@users.sourceforge.jp>
Thu, 10 Jan 2019 04:03:38 +0000 (13:03 +0900)
committerDeskull <deskull@users.sourceforge.jp>
Thu, 10 Jan 2019 04:03:38 +0000 (13:03 +0900)
src/bldg.c
src/cmd-activate.c
src/cmd-pet.c
src/dungeon.c
src/store.c

index 5fa980c..5811663 100644 (file)
@@ -4229,6 +4229,8 @@ static void bldg_process_command(building_type *bldg, int i)
  */
 void do_cmd_quest(void)
 {
+       if(p_ptr->wild_mode) return;
+
        p_ptr->energy_use = 100;
 
        if (!cave_have_flag_bold(p_ptr->y, p_ptr->x, FF_QUEST_ENTER))
@@ -4268,6 +4270,7 @@ void do_cmd_bldg(void)
        bool            validcmd;
        building_type   *bldg;
 
+       if(p_ptr->wild_mode) return;
 
        p_ptr->energy_use = 100;
 
index 2661d25..0cb72ca 100644 (file)
@@ -366,6 +366,15 @@ void do_cmd_activate(void)
        OBJECT_IDX item;
        cptr q, s;
 
+       if (p_ptr->wild_mode) return;
+
+       if (p_ptr->inside_arena)
+       {
+               msg_print(_("アリーナが魔法を吸収した!", "The arena absorbs all attempted magic!"));
+               msg_print(NULL);
+               return;
+       }
+
        if (p_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN))
        {
                set_action(ACTION_NONE);
index 61f8e61..2d0bd7c 100644 (file)
@@ -527,6 +527,8 @@ void do_cmd_pet(void)
 
        num = 0;
 
+       if(p_ptr->wild_mode) return;
+
        power_desc[num] = _("ペットを放す", "dismiss pets");
        powers[num++] = PET_DISMISS;
 
index ef592fb..e4d5811 100644 (file)
@@ -4063,21 +4063,21 @@ static void process_command(void)
                /* Enter store */
                case SPECIAL_KEY_STORE:
                {
-                       if (!p_ptr->wild_mode) do_cmd_store();
+                       do_cmd_store();
                        break;
                }
 
                /* Enter building -KMW- */
                case SPECIAL_KEY_BUILDING:
                {
-                       if (!p_ptr->wild_mode) do_cmd_bldg();
+                       do_cmd_bldg();
                        break;
                }
 
                /* Enter quest level -KMW- */
                case SPECIAL_KEY_QUEST:
                {
-                       if (!p_ptr->wild_mode) do_cmd_quest();
+                       do_cmd_quest();
                        break;
                }
 
@@ -4114,7 +4114,6 @@ static void process_command(void)
                                change_wild_mode();
                        else
                                do_cmd_go_down();
-
                        break;
                }
 
@@ -4257,7 +4256,7 @@ static void process_command(void)
                /* Issue a pet command */
                case 'p':
                {
-                       if (!p_ptr->wild_mode) do_cmd_pet();
+                       do_cmd_pet();
                        break;
                }
 
@@ -4280,16 +4279,7 @@ static void process_command(void)
                /* Activate an artifact */
                case 'A':
                {
-                       if (!p_ptr->wild_mode)
-                       {
-                       if (!p_ptr->inside_arena)
-                               do_cmd_activate();
-                       else
-                       {
-                               msg_print(_("アリーナが魔法を吸収した!", "The arena absorbs all attempted magic!"));
-                               msg_print(NULL);
-                       }
-                       }
+                       do_cmd_activate();
                        break;
                }
 
index 52d7ab2..5298612 100644 (file)
@@ -4550,6 +4550,7 @@ void do_cmd_store(void)
        bool need_redraw_store_inv; /* To redraw missiles damage and prices in store */
        TERM_LEN w, h;
 
+       if(p_ptr->wild_mode) return;
        Term_get_size(&w, &h);
 
        /* Calculate stocks per 1 page */