OSDN Git Service

[Refactor] #38997 alter_reality() に player_type * 引数を追加して, reserve_alter_reality...
authordeskull <deskull@users.sourceforge.jp>
Sat, 14 Dec 2019 16:20:50 +0000 (01:20 +0900)
committerdeskull <deskull@users.sourceforge.jp>
Sat, 14 Dec 2019 16:20:50 +0000 (01:20 +0900)
src/core.c
src/mind.c
src/racial.c
src/realm-chaos.c
src/realm-life.c
src/realm-song.c
src/spells.h
src/spells3.c

index 3e3d54d..4fcc26b 100644 (file)
@@ -2480,7 +2480,7 @@ static void process_world_aux_mutation(player_type *creature_ptr)
 
        if ((creature_ptr->muta2 & MUT2_WALK_SHAD) && !creature_ptr->anti_magic && one_in_(12000) && !creature_ptr->current_floor_ptr->inside_arena)
        {
-               alter_reality();
+               reserve_alter_reality(creature_ptr);
        }
 
        if ((creature_ptr->muta2 & MUT2_WARNING) && one_in_(1000))
index b8761da..5d6a385 100644 (file)
@@ -1425,7 +1425,7 @@ static bool cast_mirror_spell(player_type *caster_ptr, int spell)
                        msg_print(_("鏡の国の場所がわからない!", "You cannot find out where is the world of mirror!"));
                        break;
                }
-               alter_reality();
+               reserve_alter_reality(caster_ptr);
                break;
                /* mirror tunnel */
        case 16:
index 72da630..f7e61c1 100644 (file)
@@ -677,7 +677,7 @@ static bool exe_racial_power(player_type *creature_ptr, s32b command)
                        if (command == -1)
                        {
                                msg_print(_("あなたは歩き周り始めた。", "You start walking around. "));
-                               alter_reality();
+                               reserve_alter_reality(creature_ptr);
                        }
                        else if (command == -2)
                        {
index 9f4cfb0..f8f2c2e 100644 (file)
@@ -413,7 +413,7 @@ concptr do_chaos_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode)
 
                        if (cast)
                        {
-                               alter_reality();
+                               reserve_alter_reality(caster_ptr);
                        }
                }
                break;
index 5d06126..4da0f70 100644 (file)
@@ -344,7 +344,7 @@ concptr do_life_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode)
 
                        if (cast)
                        {
-                               alter_reality();
+                               reserve_alter_reality(caster_ptr);
                        }
                }
                break;
index 86d2f9f..e5fa781 100644 (file)
@@ -702,7 +702,7 @@ concptr do_music_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode)
                        if (cast)
                        {
                                msg_print(_("周囲が変化し始めた...", "You sing of the primeval shaping of Middle-earth..."));
-                               alter_reality();
+                               reserve_alter_reality(caster_ptr);
                        }
                }
                break;
index f44bbb0..60f088f 100644 (file)
@@ -298,7 +298,7 @@ extern bool reset_recall(void);
 extern bool apply_disenchant(player_type *target_ptr, BIT_FLAGS mode);
 extern void call_the_void(player_type *caster_ptr);
 extern void fetch(player_type *caster_ptr, DIRECTION dir, WEIGHT wgt, bool require_los);
-extern void alter_reality(void);
+extern void reserve_alter_reality(player_type *caster_ptr);
 extern void identify_pack(void);
 extern int remove_curse(player_type *caster_ptr);
 extern int remove_all_curse(player_type *caster_ptr);
index 4a27a21..560ed91 100644 (file)
@@ -1344,29 +1344,29 @@ void fetch(player_type *caster_ptr, DIRECTION dir, WEIGHT wgt, bool require_los)
  * @brief 現実変容処理
  * @return なし
  */
-void alter_reality(void)
+void reserve_alter_reality(player_type *caster_ptr)
 {
        /* Ironman option */
-       if (p_ptr->current_floor_ptr->inside_arena || ironman_downward)
+       if (caster_ptr->current_floor_ptr->inside_arena || ironman_downward)
        {
                msg_print(_("何も起こらなかった。", "Nothing happens."));
                return;
        }
 
-       if (!p_ptr->alter_reality)
+       if (!caster_ptr->alter_reality)
        {
                TIME_EFFECT turns = randint0(21) + 15;
 
-               p_ptr->alter_reality = turns;
+               caster_ptr->alter_reality = turns;
                msg_print(_("回りの景色が変わり始めた...", "The view around you begins to change..."));
 
-               p_ptr->redraw |= (PR_STATUS);
+               caster_ptr->redraw |= (PR_STATUS);
        }
        else
        {
-               p_ptr->alter_reality = 0;
+               caster_ptr->alter_reality = 0;
                msg_print(_("景色が元に戻った...", "The view around you got back..."));
-               p_ptr->redraw |= (PR_STATUS);
+               caster_ptr->redraw |= (PR_STATUS);
        }
        return;
 }