• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

変愚蛮怒のメインリポジトリです


Commit MetaInfo

Revisionccaf681cde3d7a91fa887781184390beaa088633 (tree)
Time2019-01-10 13:03:38
AuthorDeskull <deskull@user...>
CommiterDeskull

Log Message

[Refactor] #38852 いくつかの do_cmd_*() をリファクタリング。 / Refactor some do_cmd_*().

Change Summary

Incremental Difference

--- a/src/bldg.c
+++ b/src/bldg.c
@@ -4229,6 +4229,8 @@ static void bldg_process_command(building_type *bldg, int i)
42294229 */
42304230 void do_cmd_quest(void)
42314231 {
4232+ if(p_ptr->wild_mode) return;
4233+
42324234 p_ptr->energy_use = 100;
42334235
42344236 if (!cave_have_flag_bold(p_ptr->y, p_ptr->x, FF_QUEST_ENTER))
@@ -4268,6 +4270,7 @@ void do_cmd_bldg(void)
42684270 bool validcmd;
42694271 building_type *bldg;
42704272
4273+ if(p_ptr->wild_mode) return;
42714274
42724275 p_ptr->energy_use = 100;
42734276
--- a/src/cmd-activate.c
+++ b/src/cmd-activate.c
@@ -366,6 +366,15 @@ void do_cmd_activate(void)
366366 OBJECT_IDX item;
367367 cptr q, s;
368368
369+ if (p_ptr->wild_mode) return;
370+
371+ if (p_ptr->inside_arena)
372+ {
373+ msg_print(_("アリーナが魔法を吸収した!", "The arena absorbs all attempted magic!"));
374+ msg_print(NULL);
375+ return;
376+ }
377+
369378 if (p_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN))
370379 {
371380 set_action(ACTION_NONE);
--- a/src/cmd-pet.c
+++ b/src/cmd-pet.c
@@ -527,6 +527,8 @@ void do_cmd_pet(void)
527527
528528 num = 0;
529529
530+ if(p_ptr->wild_mode) return;
531+
530532 power_desc[num] = _("ペットを放す", "dismiss pets");
531533 powers[num++] = PET_DISMISS;
532534
--- a/src/dungeon.c
+++ b/src/dungeon.c
@@ -4063,21 +4063,21 @@ static void process_command(void)
40634063 /* Enter store */
40644064 case SPECIAL_KEY_STORE:
40654065 {
4066- if (!p_ptr->wild_mode) do_cmd_store();
4066+ do_cmd_store();
40674067 break;
40684068 }
40694069
40704070 /* Enter building -KMW- */
40714071 case SPECIAL_KEY_BUILDING:
40724072 {
4073- if (!p_ptr->wild_mode) do_cmd_bldg();
4073+ do_cmd_bldg();
40744074 break;
40754075 }
40764076
40774077 /* Enter quest level -KMW- */
40784078 case SPECIAL_KEY_QUEST:
40794079 {
4080- if (!p_ptr->wild_mode) do_cmd_quest();
4080+ do_cmd_quest();
40814081 break;
40824082 }
40834083
@@ -4114,7 +4114,6 @@ static void process_command(void)
41144114 change_wild_mode();
41154115 else
41164116 do_cmd_go_down();
4117-
41184117 break;
41194118 }
41204119
@@ -4257,7 +4256,7 @@ static void process_command(void)
42574256 /* Issue a pet command */
42584257 case 'p':
42594258 {
4260- if (!p_ptr->wild_mode) do_cmd_pet();
4259+ do_cmd_pet();
42614260 break;
42624261 }
42634262
@@ -4280,16 +4279,7 @@ static void process_command(void)
42804279 /* Activate an artifact */
42814280 case 'A':
42824281 {
4283- if (!p_ptr->wild_mode)
4284- {
4285- if (!p_ptr->inside_arena)
4286- do_cmd_activate();
4287- else
4288- {
4289- msg_print(_("アリーナが魔法を吸収した!", "The arena absorbs all attempted magic!"));
4290- msg_print(NULL);
4291- }
4292- }
4282+ do_cmd_activate();
42934283 break;
42944284 }
42954285
--- a/src/store.c
+++ b/src/store.c
@@ -4550,6 +4550,7 @@ void do_cmd_store(void)
45504550 bool need_redraw_store_inv; /* To redraw missiles damage and prices in store */
45514551 TERM_LEN w, h;
45524552
4553+ if(p_ptr->wild_mode) return;
45534554 Term_get_size(&w, &h);
45544555
45554556 /* Calculate stocks per 1 page */
Show on old repository browser