• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

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


Commit MetaInfo

Revision1f5d3234eb709209948fb86d1a6a6c20c63788fa (tree)
Time2019-01-10 13:13:32
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
@@ -1844,7 +1844,19 @@ void do_cmd_use(void)
18441844 {
18451845 OBJECT_IDX item;
18461846 object_type *o_ptr;
1847- cptr q, s;
1847+ cptr q, s;
1848+
1849+ if (p_ptr->wild_mode)
1850+ {
1851+ return;
1852+ }
1853+
1854+ if (p_ptr->inside_arena)
1855+ {
1856+ msg_print(_("アリーナが魔法を吸収した!", "The arena absorbs all attempted magic!"));
1857+ msg_print(NULL);
1858+ return;
1859+ }
18481860
18491861 if (p_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN))
18501862 {
--- a/src/cmd-zaprod.c
+++ b/src/cmd-zaprod.c
@@ -397,6 +397,18 @@ void do_cmd_zap_rod(void)
397397 OBJECT_IDX item;
398398 cptr q, s;
399399
400+ if (p_ptr->wild_mode)
401+ {
402+ return;
403+ }
404+
405+ if (p_ptr->inside_arena)
406+ {
407+ msg_print(_("アリーナが魔法を吸収した!", "The arena absorbs all attempted magic!"));
408+ msg_print(NULL);
409+ return;
410+ }
411+
400412 if (p_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN))
401413 {
402414 set_action(ACTION_NONE);
--- a/src/cmd-zapwand.c
+++ b/src/cmd-zapwand.c
@@ -454,6 +454,15 @@ void do_cmd_aim_wand(void)
454454 OBJECT_IDX item;
455455 cptr q, s;
456456
457+ if (p_ptr->wild_mode) return;
458+
459+ if (p_ptr->inside_arena)
460+ {
461+ msg_print(_("アリーナが魔法を吸収した!", "The arena absorbs all attempted magic!"));
462+ msg_print(NULL);
463+ return;
464+ }
465+
457466 /* Restrict choices to wands */
458467 item_tester_tval = TV_WAND;
459468
--- a/src/cmd2.c
+++ b/src/cmd2.c
@@ -3139,6 +3139,8 @@ void do_cmd_fire(void)
31393139 object_type *j_ptr, *ammo_ptr;
31403140 cptr q, s;
31413141
3142+ if(p_ptr->wild_mode) return;
3143+
31423144 is_fired = FALSE; /* not fired yet */
31433145
31443146 /* Get the "bow" (if any) */
@@ -3251,6 +3253,7 @@ bool do_cmd_throw(int mult, bool boomerang, OBJECT_IDX shuriken)
32513253 bool come_back = FALSE;
32523254 bool do_drop = TRUE;
32533255
3256+ if (p_ptr->wild_mode) return FALSE;
32543257
32553258 if (p_ptr->special_defense & KATA_MUSOU)
32563259 {
--- a/src/dungeon.c
+++ b/src/dungeon.c
@@ -4300,44 +4300,28 @@ static void process_command(void)
43004300 /* Fire an item */
43014301 case 'f':
43024302 {
4303- if (!p_ptr->wild_mode) do_cmd_fire();
4303+ do_cmd_fire();
43044304 break;
43054305 }
43064306
43074307 /* Throw an item */
43084308 case 'v':
43094309 {
4310- if (!p_ptr->wild_mode) do_cmd_throw(1, FALSE, -1);
4310+ do_cmd_throw(1, FALSE, -1);
43114311 break;
43124312 }
43134313
43144314 /* Aim a wand */
43154315 case 'a':
43164316 {
4317- if (!p_ptr->wild_mode)
4318- {
4319- if (!p_ptr->inside_arena)
4320- do_cmd_aim_wand();
4321- else
4322- {
4323- msg_print(_("アリーナが魔法を吸収した!", "The arena absorbs all attempted magic!"));
4324- msg_print(NULL);
4325- }
4326- }
4317+ do_cmd_aim_wand();
43274318 break;
43284319 }
43294320
43304321 /* Zap a rod */
43314322 case 'z':
43324323 {
4333- if (!p_ptr->wild_mode)
4334- {
4335- if (p_ptr->inside_arena)
4336- {
4337- msg_print(_("アリーナが魔法を吸収した!", "The arena absorbs all attempted magic!"));
4338- msg_print(NULL);
4339- }
4340- else if (use_command && rogue_like_commands)
4324+ if (use_command && rogue_like_commands)
43414325 {
43424326 do_cmd_use();
43434327 }
@@ -4345,7 +4329,6 @@ static void process_command(void)
43454329 {
43464330 do_cmd_zap_rod();
43474331 }
4348- }
43494332 break;
43504333 }
43514334
Show on old repository browser