OSDN Git Service

ダンジョンのフロア間を移動する際に鏡は爆発なしで消えるようにした.
authornothere <nothere@0568b783-4c39-0410-ac80-bf13821ea2a2>
Tue, 26 Aug 2003 07:32:19 +0000 (07:32 +0000)
committernothere <nothere@0568b783-4c39-0410-ac80-bf13821ea2a2>
Tue, 26 Aug 2003 07:32:19 +0000 (07:32 +0000)
src/externs.h
src/floors.c
src/racial.c
src/spells2.c

index c3eeefc..3ccf9ea 100644 (file)
@@ -1088,6 +1088,7 @@ extern bool eat_magic(int power);
 extern void discharge_minion(void);
 extern void kawarimi(bool success);
 extern bool rush_attack(bool *mdeath);
+extern void remove_all_mirrors(bool explode);
 
 /* spells3.c */
 extern bool teleport_away(int m_idx, int dis, bool dec_valour);
index 7221445..91c348e 100644 (file)
@@ -670,6 +670,9 @@ void leave_floor(void)
        /* Preserve pets and prepare to take these to next floor */
        preserve_pet();
 
+       /* Remove all mirrors without explosion */
+       remove_all_mirrors(FALSE);
+
        /* New floor is not yet prepared */
        new_floor_id = 0;
 
index 611ae5e..791a149 100644 (file)
@@ -1282,19 +1282,8 @@ static bool cmd_racial_power_aux(s32b command)
                {
                        if (command == -3)
                        {
-                               int x, y;
-                               for (x = 0; x < cur_wid; x++)
-                               {
-                                       for (y = 0; y < cur_hgt; y++)
-                                       {
-                                               if (is_mirror_grid(&cave[y][x]))
-                                               {
-                                                       remove_mirror(y, x);
-                                                       project(0, 2, y, x, p_ptr->lev / 2 + 5, GF_SHARDS,
-                                                               (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP | PROJECT_NO_HANGEKI), -1);
-                                               }
-                                       }
-                               }
+                               /* Explode all mirrors */
+                               remove_all_mirrors(TRUE);
                        }
                        else if (command == -4)
                        {
index 42e8991..3cb9c24 100644 (file)
@@ -7762,3 +7762,26 @@ bool rush_attack(bool *mdeath)
        if (mdeath) *mdeath = tmp_mdeath;
        return TRUE;
 }
+
+
+/*
+ * Remove all mirrors in this floor
+ */
+void remove_all_mirrors(bool explode)
+{
+       int x, y;
+
+       for (x = 0; x < cur_wid; x++)
+       {
+               for (y = 0; y < cur_hgt; y++)
+               {
+                       if (is_mirror_grid(&cave[y][x]))
+                       {
+                               remove_mirror(y, x);
+                               if (explode)
+                                       project(0, 2, y, x, p_ptr->lev / 2 + 5, GF_SHARDS,
+                                               (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP | PROJECT_NO_HANGEKI), -1);
+                       }
+               }
+       }
+}