OSDN Git Service

[Refactor] #38997 wiz_dark() に player_type * 引数を追加. / Add player_type * argument...
authordeskull <deskull@users.sourceforge.jp>
Sat, 26 Oct 2019 10:37:18 +0000 (19:37 +0900)
committerdeskull <deskull@users.sourceforge.jp>
Sat, 26 Oct 2019 10:37:18 +0000 (19:37 +0900)
src/core.c
src/player-effects.c
src/player-move.c
src/spells-floor.c
src/spells-floor.h
src/spells3.c

index cfaca93..8e5702c 100644 (file)
@@ -2205,9 +2205,9 @@ static void process_world_aux_mutation(player_type *creature_ptr)
                        {
                                msg_print(NULL);
                                if (one_in_(3)) lose_all_info(creature_ptr);
-                               else wiz_dark();
+                               else wiz_dark(creature_ptr);
                                (void)teleport_player_aux(100, TELEPORT_NONMAGICAL | TELEPORT_PASSIVE);
-                               wiz_dark();
+                               wiz_dark(creature_ptr);
                                msg_print(_("あなたは見知らぬ場所で目が醒めた...頭が痛い。", "You wake up somewhere with a sore head..."));
                                msg_print(_("何も覚えていない。どうやってここに来たかも分からない!", "You can't remember a thing, or how you got here!"));
                        }
index ce91346..74021d8 100644 (file)
@@ -3584,7 +3584,7 @@ bool lose_all_info(player_type *creature_ptr)
        creature_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
 
        /* Mega-Hack -- Forget the map */
-       wiz_dark();
+       wiz_dark(creature_ptr);
 
        /* It worked */
        return (TRUE);
index 52e830a..4c37e50 100644 (file)
@@ -663,7 +663,7 @@ bool move_player_effect(player_type *creature_ptr, POSITION ny, POSITION nx, BIT
                if ((!creature_ptr->blind && !no_lite()) || !is_trap(g_ptr->feat)) g_ptr->info &= ~(CAVE_UNSAFE);
 
                /* For get everything when requested hehe I'm *NASTY* */
-               if (p_ptr->current_floor_ptr->dun_level && (d_info[creature_ptr->dungeon_idx].flags1 & DF1_FORGET)) wiz_dark();
+               if (p_ptr->current_floor_ptr->dun_level && (d_info[creature_ptr->dungeon_idx].flags1 & DF1_FORGET)) wiz_dark(creature_ptr);
                if (mpe_mode & MPE_HANDLE_STUFF) handle_stuff();
 
                if (creature_ptr->pclass == CLASS_NINJA)
index 69fcd36..092b28d 100644 (file)
@@ -131,17 +131,17 @@ void wiz_lite(player_type *caster_ptr, bool ninja)
 /*
  * Forget the dungeon map (ala "Thinking of Maud...").
  */
-void wiz_dark(void)
+void wiz_dark(player_type *caster_ptr)
 {
        OBJECT_IDX i;
        POSITION y, x;
 
        /* Forget every grid */
-       for (y = 1; y < p_ptr->current_floor_ptr->height - 1; y++)
+       for (y = 1; y < caster_ptr->current_floor_ptr->height - 1; y++)
        {
-               for (x = 1; x < p_ptr->current_floor_ptr->width - 1; x++)
+               for (x = 1; x < caster_ptr->current_floor_ptr->width - 1; x++)
                {
-                       grid_type *g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
+                       grid_type *g_ptr = &caster_ptr->current_floor_ptr->grid_array[y][x];
 
                        /* Process the grid */
                        g_ptr->info &= ~(CAVE_MARK | CAVE_IN_DETECT | CAVE_KNOWN);
@@ -150,23 +150,23 @@ void wiz_dark(void)
        }
 
        /* Forget every grid on horizontal edge */
-       for (x = 0; x < p_ptr->current_floor_ptr->width; x++)
+       for (x = 0; x < caster_ptr->current_floor_ptr->width; x++)
        {
-               p_ptr->current_floor_ptr->grid_array[0][x].info &= ~(CAVE_MARK);
-               p_ptr->current_floor_ptr->grid_array[p_ptr->current_floor_ptr->height - 1][x].info &= ~(CAVE_MARK);
+               caster_ptr->current_floor_ptr->grid_array[0][x].info &= ~(CAVE_MARK);
+               caster_ptr->current_floor_ptr->grid_array[caster_ptr->current_floor_ptr->height - 1][x].info &= ~(CAVE_MARK);
        }
 
        /* Forget every grid on vertical edge */
-       for (y = 1; y < (p_ptr->current_floor_ptr->height - 1); y++)
+       for (y = 1; y < (caster_ptr->current_floor_ptr->height - 1); y++)
        {
-               p_ptr->current_floor_ptr->grid_array[y][0].info &= ~(CAVE_MARK);
-               p_ptr->current_floor_ptr->grid_array[y][p_ptr->current_floor_ptr->width - 1].info &= ~(CAVE_MARK);
+               caster_ptr->current_floor_ptr->grid_array[y][0].info &= ~(CAVE_MARK);
+               caster_ptr->current_floor_ptr->grid_array[y][caster_ptr->current_floor_ptr->width - 1].info &= ~(CAVE_MARK);
        }
 
        /* Forget all objects */
-       for (i = 1; i < p_ptr->current_floor_ptr->o_max; i++)
+       for (i = 1; i < caster_ptr->current_floor_ptr->o_max; i++)
        {
-               object_type *o_ptr = &p_ptr->current_floor_ptr->o_list[i];
+               object_type *o_ptr = &caster_ptr->current_floor_ptr->o_list[i];
 
                if (!OBJECT_IS_VALID(o_ptr)) continue;
                if (OBJECT_IS_HELD_MONSTER(o_ptr)) continue;
@@ -178,11 +178,11 @@ void wiz_dark(void)
        /* Forget travel route when we have forgotten map */
        forget_travel_flow();
 
-       p_ptr->update |= (PU_UN_VIEW | PU_UN_LITE);
-       p_ptr->update |= (PU_VIEW | PU_LITE | PU_MON_LITE);
-       p_ptr->update |= (PU_MONSTERS);
-       p_ptr->redraw |= (PR_MAP);
-       p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
+       caster_ptr->update |= (PU_UN_VIEW | PU_UN_LITE);
+       caster_ptr->update |= (PU_VIEW | PU_LITE | PU_MON_LITE);
+       caster_ptr->update |= (PU_MONSTERS);
+       caster_ptr->redraw |= (PR_MAP);
+       caster_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
 }
 
 /*!
index 58e1180..8e1765a 100644 (file)
@@ -1,7 +1,7 @@
 #pragma once
 
 extern void wiz_lite(player_type *caster_ptr, bool ninja);
-extern void wiz_dark(void);
+extern void wiz_dark(player_type *caster_ptr);
 extern bool warding_glyph(player_type *caster_ptr);
 extern bool explosive_rune(void);
 extern bool place_mirror(player_type *caster_ptr);
index 34ef9cb..2a998c6 100644 (file)
@@ -3454,9 +3454,9 @@ bool booze(player_type *creature_ptr)
                {
                        ident = TRUE;
                        if (one_in_(3)) lose_all_info(p_ptr);
-                       else wiz_dark();
+                       else wiz_dark(creature_ptr);
                        (void)teleport_player_aux(100, TELEPORT_NONMAGICAL | TELEPORT_PASSIVE);
-                       wiz_dark();
+                       wiz_dark(creature_ptr);
                        msg_print(_("知らない場所で目が醒めた。頭痛がする。", "You wake up somewhere with a sore head..."));
                        msg_print(_("何も思い出せない。どうやってここへ来たのかも分からない!", "You can't remember a thing, or how you got here!"));
                }