OSDN Git Service

[Refactor] #37353 spells.hにスペルに関する共通定義を追加。。 / Add common definition to spells.h.
[hengband/hengband.git] / src / wizard2.c
index 72e7f67..a24a40a 100644 (file)
  */
 
 #include "angband.h"
+#include "floor.h"
 #include "selfinfo.h"
+#include "patron.h"
+#include "mutation.h"
+#include "quest.h"
+#include "artifact.h"
+#include "player-status.h"
 
+#include "spells-object.h"
+#include "spells-summon.h"
 
 /*!
  * @brief プレイヤーのヒットダイスを振り直す / Roll the hitdie -- aux of do_cmd_rerate()
 void do_cmd_rerate_aux(void)
 {
        /* Minimum hitpoints at highest level */
-       int min_value = p_ptr->hitdie + ((PY_MAX_LEVEL + 2) * (p_ptr->hitdie + 1)) * 3 / 8;
+       HIT_POINT min_value = p_ptr->hitdie + ((PY_MAX_LEVEL + 2) * (p_ptr->hitdie + 1)) * 3 / 8;
 
        /* Maximum hitpoints at highest level */
-       int max_value = p_ptr->hitdie + ((PY_MAX_LEVEL + 2) * (p_ptr->hitdie + 1)) * 5 / 8;
+       HIT_POINT max_value = p_ptr->hitdie + ((PY_MAX_LEVEL + 2) * (p_ptr->hitdie + 1)) * 5 / 8;
 
        int i;
 
@@ -65,14 +73,12 @@ void do_cmd_rerate(bool display)
        do_cmd_rerate_aux();
 
        percent = (int)(((long)p_ptr->player_hp[PY_MAX_LEVEL - 1] * 200L) /
-               (2 * p_ptr->hitdie +
-               ((PY_MAX_LEVEL - 1+3) * (p_ptr->hitdie + 1))));
+               (2 * p_ptr->hitdie + ((PY_MAX_LEVEL - 1+3) * (p_ptr->hitdie + 1))));
 
 
        /* Update and redraw hitpoints */
        p_ptr->update |= (PU_HP);
        p_ptr->redraw |= (PR_HP);
-
        p_ptr->window |= (PW_PLAYER);
        handle_stuff();
 
@@ -113,16 +119,9 @@ static bool set_gametime(void)
        int tmp_int = 0;
        char ppp[80], tmp_val[40];
 
-       /* Prompt */
        sprintf(ppp, "Dungeon Turn (0-%ld): ", (long)dungeon_turn_limit);
-
-       /* Default */
        sprintf(tmp_val, "%ld", (long)dungeon_turn);
-
-       /* Query */
        if (!get_string(ppp, tmp_val, 10)) return (FALSE);
-
-       /* Extract */
        tmp_int = atoi(tmp_val);
 
        /* Verify */
@@ -231,7 +230,7 @@ static void prt_alloc(OBJECT_TYPE_VALUE tval, OBJECT_SUBTYPE_VALUE sval, TERM_LE
        u32b rarity[K_MAX_DEPTH];
        u32b total[K_MAX_DEPTH];
        s32b display[22];
-       cptr r = "+---Rate---+";
+       concptr r = "+---Rate---+";
        object_kind *k_ptr;
 
 
@@ -398,7 +397,7 @@ static void do_cmd_wiz_change_aux(void)
                else if (tmp_int < 3) tmp_int = 3;
 
                /* Save it */
-               p_ptr->stat_cur[i] = p_ptr->stat_max[i] = (s16b)tmp_int;
+               p_ptr->stat_cur[i] = p_ptr->stat_max[i] = (BASE_STATUS)tmp_int;
        }
 
 
@@ -450,7 +449,6 @@ static void do_cmd_wiz_change_aux(void)
        /* Save */
        p_ptr->au = tmp_long;
 
-
        /* Default */
        sprintf(tmp_val, "%ld", (long)(p_ptr->max_exp));
 
@@ -628,7 +626,7 @@ static void wiz_display_item(object_type *o_ptr)
 typedef struct tval_desc
 {
        int        tval; /*!< 大項目のID */
-       cptr       desc; /*!< 大項目名 */
+       concptr       desc; /*!< 大項目名 */
 } tval_desc;
 
 /*!
@@ -703,7 +701,7 @@ void strip_name(char *buf, KIND_OBJECT_IDX k_idx)
 
        object_kind *k_ptr = &k_info[k_idx];
 
-       cptr str = (k_name + k_ptr->name);
+       concptr str = (k_name + k_ptr->name);
 
 
        /* Skip past leading characters */
@@ -739,7 +737,7 @@ static KIND_OBJECT_IDX wiz_create_itemtype(void)
        TERM_LEN col, row;
        OBJECT_TYPE_VALUE tval;
 
-       cptr tval_desc;
+       concptr tval_desc;
        char ch;
 
        KIND_OBJECT_IDX choice[80];
@@ -832,7 +830,7 @@ static KIND_OBJECT_IDX wiz_create_itemtype(void)
  */
 static void wiz_tweak_item(object_type *o_ptr)
 {
-       cptr p;
+       concptr p;
        char tmp_val[80];
 
        /* Hack -- leave artifacts alone */
@@ -984,8 +982,6 @@ static void wiz_reroll_item(object_type *o_ptr)
                /* Apply changes */
                object_copy(o_ptr, q_ptr);
                p_ptr->update |= (PU_BONUS);
-
-               /* Combine / Reorder the pack (later) */
                p_ptr->update |= (PU_COMBINE | PU_REORDER);
 
                p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_SPELL | PW_PLAYER);
@@ -1012,16 +1008,16 @@ static void wiz_statistics(object_type *o_ptr)
        u32b test_roll = 1000000;
 
        char ch;
-       cptr quality;
+       concptr quality;
 
        BIT_FLAGS mode;
 
        object_type forge;
        object_type     *q_ptr;
 
-       cptr q = "Rolls: %ld  Correct: %ld  Matches: %ld  Better: %ld  Worse: %ld  Other: %ld";
+       concptr q = "Rolls: %ld  Correct: %ld  Matches: %ld  Better: %ld  Worse: %ld  Other: %ld";
 
-       cptr p = "Enter number of items to roll: ";
+       concptr p = "Enter number of items to roll: ";
        char tmp_val[80];
 
 
@@ -1032,7 +1028,7 @@ static void wiz_statistics(object_type *o_ptr)
        /* Interact */
        while (TRUE)
        {
-               cptr pmt = "Roll for [n]ormal, [g]ood, or [e]xcellent treasure? ";
+               concptr pmt = "Roll for [n]ormal, [g]ood, or [e]xcellent treasure? ";
 
                /* Display item */
                wiz_display_item(o_ptr);
@@ -1247,7 +1243,7 @@ static void do_cmd_wiz_play(void)
        object_type *o_ptr;
        char ch;
        bool changed;
-       cptr q, s;
+       concptr q, s;
 
        q = "Play with which object? ";
        s = "You have nothing to play with.";
@@ -1324,8 +1320,6 @@ static void do_cmd_wiz_play(void)
                object_copy(o_ptr, q_ptr);
 
                p_ptr->update |= (PU_BONUS);
-
-               /* Combine / Reorder the pack (later) */
                p_ptr->update |= (PU_COMBINE | PU_REORDER);
 
                p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_SPELL | PW_PLAYER);
@@ -1480,7 +1474,7 @@ static void do_cmd_wiz_jump(void)
        if (record_stair) do_cmd_write_nikki(NIKKI_WIZ_TELE,0,NULL);
 
        p_ptr->inside_quest = 0;
-       p_ptr->energy_use = 0;
+       free_turn(p_ptr);
 
        /* Prevent energy_need from being too lower than 0 */
        p_ptr->energy_need = 0;
@@ -2097,6 +2091,10 @@ void do_cmd_debug(void)
                break;
        }
 
+       case 'V':
+               do_cmd_wiz_reset_class();
+               break;
+
        /* Not a Wizard Command */
        default:
                msg_print("That is not a valid debug command.");