OSDN Git Service

[Refactor] #40514 reserve_alter_reality() に所要ターン数を引数として追加. / Corrected recall reset...
authordeskull <deskull@users.sourceforge.jp>
Mon, 31 Aug 2020 16:21:21 +0000 (01:21 +0900)
committerdeskull <deskull@users.sourceforge.jp>
Mon, 31 Aug 2020 16:21:21 +0000 (01:21 +0900)
src/mind/mind-mirror-master.c
src/mutation/mutation-processor.c
src/racial/racial-switcher.c
src/realm/realm-chaos.c
src/realm/realm-life.c
src/realm/realm-song.c
src/spell-kind/spells-world.c
src/spell-kind/spells-world.h

index f83b2f7..cc91911 100644 (file)
@@ -515,7 +515,7 @@ bool cast_mirror_spell(player_type *caster_ptr, mind_mirror_master_type spell)
             break;
         }
 
-        reserve_alter_reality(caster_ptr);
+        reserve_alter_reality(caster_ptr, randint0(21) + 15);
         break;
     case MIRROR_TUNNEL:
         msg_print(_("鏡の世界を通り抜け…  ", "You try to enter the mirror..."));
index 8657e19..e79c811 100644 (file)
@@ -392,7 +392,7 @@ 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)
-        reserve_alter_reality(creature_ptr);
+        reserve_alter_reality(creature_ptr, randint0(21) + 15);
 
     if ((creature_ptr->muta2 & MUT2_WARNING) && one_in_(1000)) {
         int danger_amount = 0;
index 975e409..b9c768c 100644 (file)
@@ -296,7 +296,7 @@ bool switch_race_racial_execution(player_type *creature_ptr, const s32b command)
     case RACE_AMBERITE:
         if (command == -1) {
             msg_print(_("あなたは歩き周り始めた。", "You start walking around. "));
-            reserve_alter_reality(creature_ptr);
+            reserve_alter_reality(creature_ptr, randint0(21) + 15);
             return TRUE;
         }
         
index 4f97fe6..a27238a 100644 (file)
@@ -476,7 +476,7 @@ concptr do_chaos_spell(player_type *caster_ptr, SPELL_IDX spell, spell_type mode
                 return info_delay(base, sides);
 
             if (cast) {
-                reserve_alter_reality(caster_ptr);
+                reserve_alter_reality(caster_ptr, randint0(sides) + base);
             }
         }
         break;
index b618933..5a75242 100644 (file)
@@ -415,7 +415,7 @@ concptr do_life_spell(player_type *caster_ptr, SPELL_IDX spell, spell_type mode)
                 return info_delay(base, sides);
 
             if (cast) {
-                reserve_alter_reality(caster_ptr);
+                reserve_alter_reality(caster_ptr, randint0(sides) + base);
             }
         }
         break;
index dc652d7..2e0793e 100644 (file)
@@ -756,7 +756,7 @@ concptr do_music_spell(player_type *caster_ptr, SPELL_IDX spell, spell_type mode
 
             if (cast) {
                 msg_print(_("周囲が変化し始めた...", "You sing of the primeval shaping of Middle-earth..."));
-                reserve_alter_reality(caster_ptr);
+                reserve_alter_reality(caster_ptr, randint0(sides) + base);
             }
         }
         break;
index 291e747..ad6ef58 100644 (file)
@@ -317,21 +317,20 @@ bool tele_town(player_type *caster_ptr)
  * @param caster_ptr プレーヤーへの参照ポインタ
  * @return なし
  */
-void reserve_alter_reality(player_type *caster_ptr)
+void reserve_alter_reality(player_type *caster_ptr, TIME_EFFECT turns)
 {
     if (caster_ptr->current_floor_ptr->inside_arena || ironman_downward) {
         msg_print(_("何も起こらなかった。", "Nothing happens."));
         return;
     }
 
-    if (caster_ptr->alter_reality) {
+    if (caster_ptr->alter_reality || turns == 0) {
         caster_ptr->alter_reality = 0;
         msg_print(_("景色が元に戻った...", "The view around you returns to normal..."));
         caster_ptr->redraw |= PR_STATUS;
         return;
     }
 
-    TIME_EFFECT turns = randint0(21) + 15;
     caster_ptr->alter_reality = turns;
     msg_print(_("回りの景色が変わり始めた...", "The view around you begins to change..."));
     caster_ptr->redraw |= PR_STATUS;
index bd348ec..0f41f5e 100644 (file)
@@ -5,7 +5,7 @@
 void teleport_level(player_type *creature_ptr, MONSTER_IDX m_idx);
 bool teleport_level_other(player_type *caster_ptr);
 bool tele_town(player_type *caster_ptr);
-void reserve_alter_reality(player_type *caster_ptr);
+void reserve_alter_reality(player_type *caster_ptr, TIME_EFFECT turns);
 bool is_teleport_level_ineffective(player_type *caster_ptr, MONSTER_IDX idx);
 bool recall_player(player_type *creature_ptr, TIME_EFFECT turns);
 bool free_level_recall(player_type *creature_ptr);