• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

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


Commit MetaInfo

Revisione52bcf22c2673c62cec7064d6a5271850dce3507 (tree)
Time2019-01-10 20:56:09
AuthorDeskull <deskull@user...>
CommiterDeskull

Log Message

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

Change Summary

Incremental Difference

--- a/src/cmd-item.c
+++ b/src/cmd-item.c
@@ -1319,6 +1319,8 @@ void do_cmd_refill(void)
13191319 */
13201320 void do_cmd_target(void)
13211321 {
1322+ if (p_ptr->wild_mode) return;
1323+
13221324 /* Target set */
13231325 if (target_set(TARGET_KILL))
13241326 {
--- a/src/cmd-quaff.c
+++ b/src/cmd-quaff.c
@@ -618,6 +618,18 @@ void do_cmd_quaff_potion(void)
618618 OBJECT_IDX item;
619619 cptr q, s;
620620
621+ if (p_ptr->wild_mode)
622+ {
623+ return;
624+ }
625+
626+ if (p_ptr->inside_arena)
627+ {
628+ msg_print(_("アリーナが魔法を吸収した!", "The arena absorbs all attempted magic!"));
629+ msg_print(NULL);
630+ return;
631+ }
632+
621633 if (p_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN))
622634 {
623635 set_action(ACTION_NONE);
--- a/src/cmd-read.c
+++ b/src/cmd-read.c
@@ -612,6 +612,18 @@ void do_cmd_read_scroll(void)
612612 OBJECT_IDX item;
613613 cptr q, s;
614614
615+ if (p_ptr->wild_mode)
616+ {
617+ return;
618+ }
619+
620+ if (p_ptr->inside_arena)
621+ {
622+ msg_print(_("アリーナが魔法を吸収した!", "The arena absorbs all attempted magic!"));
623+ msg_print(NULL);
624+ return;
625+ }
626+
615627 if (p_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN))
616628 {
617629 set_action(ACTION_NONE);
--- a/src/cmd-usestaff.c
+++ b/src/cmd-usestaff.c
@@ -473,6 +473,18 @@ void do_cmd_use_staff(void)
473473 OBJECT_IDX item;
474474 cptr q, s;
475475
476+ if (p_ptr->wild_mode)
477+ {
478+ return;
479+ }
480+
481+ if (p_ptr->inside_arena)
482+ {
483+ msg_print(_("アリーナが魔法を吸収した!", "The arena absorbs all attempted magic!"));
484+ msg_print(NULL);
485+ return;
486+ }
487+
476488 if (p_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN))
477489 {
478490 set_action(ACTION_NONE);
--- a/src/dungeon.c
+++ b/src/dungeon.c
@@ -4335,59 +4335,31 @@ static void process_command(void)
43354335 /* Quaff a potion */
43364336 case 'q':
43374337 {
4338- if (!p_ptr->wild_mode)
4339- {
4340- if (!p_ptr->inside_arena)
4341- do_cmd_quaff_potion();
4342- else
4343- {
4344- msg_print(_("アリーナが魔法を吸収した!", "The arena absorbs all attempted magic!"));
4345- msg_print(NULL);
4346- }
4347- }
4338+ do_cmd_quaff_potion();
43484339 break;
43494340 }
43504341
43514342 /* Read a scroll */
43524343 case 'r':
43534344 {
4354- if (!p_ptr->wild_mode)
4355- {
4356- if (!p_ptr->inside_arena)
4357- do_cmd_read_scroll();
4358- else
4359- {
4360- msg_print(_("アリーナが魔法を吸収した!", "The arena absorbs all attempted magic!"));
4361- msg_print(NULL);
4362- }
4363- }
4345+ do_cmd_read_scroll();
43644346 break;
43654347 }
43664348
43674349 /* Use a staff */
43684350 case 'u':
43694351 {
4370- if (!p_ptr->wild_mode)
4371- {
4372- if (p_ptr->inside_arena)
4373- {
4374- msg_print(_("アリーナが魔法を吸収した!", "The arena absorbs all attempted magic!"));
4375- msg_print(NULL);
4376- }
4377- else if (use_command && !rogue_like_commands)
4378- {
4352+ if (use_command && !rogue_like_commands)
43794353 do_cmd_use();
4380- }
43814354 else
43824355 do_cmd_use_staff();
4383- }
43844356 break;
43854357 }
43864358
43874359 /* Use racial power */
43884360 case 'U':
43894361 {
4390- if (!p_ptr->wild_mode) do_cmd_racial_power();
4362+ do_cmd_racial_power();
43914363 break;
43924364 }
43934365
@@ -4418,7 +4390,7 @@ static void process_command(void)
44184390 /* Target monster or location */
44194391 case '*':
44204392 {
4421- if (!p_ptr->wild_mode) do_cmd_target();
4393+ do_cmd_target();
44224394 break;
44234395 }
44244396
--- a/src/racial.c
+++ b/src/racial.c
@@ -1550,6 +1550,7 @@ void do_cmd_racial_power(void)
15501550 char out_val[160];
15511551 int menu_line = (use_menu ? 1 : 0);
15521552
1553+ if (p_ptr->wild_mode) return;
15531554
15541555 for (num = 0; num < 36; num++)
15551556 {
Show on old repository browser