OSDN Git Service

Went back to using "staffs" as the plural of staff rather than "stave" since saw...
[hengbandforosx/hengbandosx.git] / src / wizard2.c
index 39b4e4d..b95b4fa 100644 (file)
@@ -11,7 +11,6 @@
  */
 
 #include "angband.h"
-#include "floor.h"
 #include "selfinfo.h"
 #include "patron.h"
 #include "mutation.h"
 #include "spells-floor.h"
 
 #include "object-hook.h"
+#include "monster-status.h"
+
+#include "floor.h"
+#include "floor-save.h"
 
 #ifdef ALLOW_WIZARD
 
@@ -1077,8 +1080,6 @@ static void wiz_quantity_item(object_type *o_ptr)
        {
                /* Extract */
                tmp_int = atoi(tmp_val);
-
-               /* Paranoia */
                if (tmp_int < 1) tmp_int = 1;
                if (tmp_int > 99) tmp_int = 99;
 
@@ -1348,8 +1349,6 @@ static void do_cmd_wiz_jump(void)
 
                p_ptr->dungeon_idx = tmp_dungeon_type;
        }
-
-       /* Paranoia */
        if (command_arg < d_info[p_ptr->dungeon_idx].mindepth) command_arg = 0;
        if (command_arg > d_info[p_ptr->dungeon_idx].maxdepth) command_arg = (COMMAND_ARG)d_info[p_ptr->dungeon_idx].maxdepth;
 
@@ -1382,8 +1381,6 @@ static void do_cmd_wiz_jump(void)
         * and create a first saved floor
         */
        prepare_change_floor_mode(CFM_FIRST_FLOOR);
-
-       /* Leaving */
        p_ptr->leaving = TRUE;
 }
 
@@ -1475,9 +1472,7 @@ static void do_cmd_wiz_zap(void)
        for (i = 1; i < m_max; i++)
        {
                monster_type *m_ptr = &current_floor_ptr->m_list[i];
-
-               /* Paranoia -- Skip dead monsters */
-               if (!m_ptr->r_idx) continue;
+               if (!monster_is_valid(m_ptr)) continue;
 
                /* Skip the mount */
                if (i == p_ptr->riding) continue;
@@ -1512,9 +1507,7 @@ static void do_cmd_wiz_zap_all(void)
        for (i = 1; i < m_max; i++)
        {
                monster_type *m_ptr = &current_floor_ptr->m_list[i];
-
-               /* Paranoia -- Skip dead monsters */
-               if (!m_ptr->r_idx) continue;
+               if (!monster_is_valid(m_ptr)) continue;
 
                /* Skip the mount */
                if (i == p_ptr->riding) continue;
@@ -1587,8 +1580,6 @@ static void do_cmd_wiz_create_feature(void)
 
        note_spot(y, x);
        lite_spot(y, x);
-
-       /* Update some things */
        p_ptr->update |= (PU_FLOW);
 
        prev_feat = tmp_feat;
@@ -1666,8 +1657,6 @@ static void do_cmd_dump_options(void)
        /* Free the "exist" array (2-dimension) */
        C_KILL(*exist, NUM_O_BIT * NUM_O_SET, int);
        C_KILL(exist, NUM_O_SET, int *);
-
-       /* Close it */
        my_fclose(fff);
 
        msg_format(_("オプションbit使用状況をファイル %s に書き出しました。", "Option bits usage dump saved to file %s."), buf);
@@ -1834,7 +1823,7 @@ void do_cmd_debug(void)
 
        /* Mutation */
        case 'M':
-               (void)gain_random_mutation(command_arg);
+               (void)gain_mutation(p_ptr, command_arg);
                break;
 
        /* Reset Class */
@@ -2090,8 +2079,6 @@ void cheat_death(player_type *creature_ptr)
                creature_ptr->oldpy = 33;
                creature_ptr->oldpx = 131;
        }
-
-       /* Leaving */
        creature_ptr->wild_mode = FALSE;
        creature_ptr->leaving = TRUE;