*/
#include "angband.h"
-#include "floor.h"
#include "selfinfo.h"
-#include "spells-summon.h"
#include "patron.h"
#include "mutation.h"
#include "quest.h"
#include "artifact.h"
+#include "player-status.h"
+#include "spells.h"
+#include "spells-object.h"
+#include "spells-summon.h"
+#include "spells-status.h"
+#include "spells-world.h"
+#include "spells-floor.h"
-/*!
- * @brief プレイヤーのヒットダイスを振り直す / Roll the hitdie -- aux of do_cmd_rerate()
- * @return なし
- */
-void do_cmd_rerate_aux(void)
-{
- /* Minimum hitpoints at highest level */
- HIT_POINT min_value = p_ptr->hitdie + ((PY_MAX_LEVEL + 2) * (p_ptr->hitdie + 1)) * 3 / 8;
-
- /* Maximum hitpoints at highest level */
- HIT_POINT max_value = p_ptr->hitdie + ((PY_MAX_LEVEL + 2) * (p_ptr->hitdie + 1)) * 5 / 8;
-
- int i;
-
- /* Rerate */
- while (1)
- {
- /* Pre-calculate level 1 hitdice */
- p_ptr->player_hp[0] = (HIT_POINT)p_ptr->hitdie;
-
- for (i = 1; i < 4; i++)
- {
- p_ptr->player_hp[0] += randint1(p_ptr->hitdie);
- }
-
- /* Roll the hitpoint values */
- for (i = 1; i < PY_MAX_LEVEL; i++)
- {
- p_ptr->player_hp[i] = p_ptr->player_hp[i - 1] + randint1(p_ptr->hitdie);
- }
-
- /* Require "valid" hitpoints at highest level */
- if ((p_ptr->player_hp[PY_MAX_LEVEL - 1] >= min_value) &&
- (p_ptr->player_hp[PY_MAX_LEVEL - 1] <= max_value)) break;
- }
-}
-
-
-/*!
- * @brief プレイヤーのヒットダイスを振り直した後明示を行う / Hack -- Rerate Hitpoints
- * @param display TRUEならば体力ランクを明示する
- * @return なし
- */
-void do_cmd_rerate(bool display)
-{
- PERCENTAGE percent;
-
- /* Rerate */
- 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))));
-
-
- /* Update and redraw hitpoints */
- p_ptr->update |= (PU_HP);
- p_ptr->redraw |= (PR_HP);
- p_ptr->window |= (PW_PLAYER);
- handle_stuff();
-
- if (display)
- {
- msg_format(_("現在の体力ランクは %d/100 です。", "Your life rate is %d/100 now."), percent);
- p_ptr->knowledge |= KNOW_HPRATE;
- }
- else
- {
- msg_print(_("体力ランクが変わった。", "Life rate is changed."));
- p_ptr->knowledge &= ~(KNOW_HPRATE);
- }
-}
+#include "object-hook.h"
+#include "monster-status.h"
+#include "floor.h"
+#include "floor-save.h"
+#include "grid.h"
#ifdef ALLOW_WIZARD
return (TRUE);
}
-
-/*!
- * @brief プレイ日数を変更する / Set gametime.
- * @return 実際に変更を行ったらTRUEを返す
- */
-static bool set_gametime(void)
-{
- int tmp_int = 0;
- char ppp[80], tmp_val[40];
-
- sprintf(ppp, "Dungeon Turn (0-%ld): ", (long)dungeon_turn_limit);
- sprintf(tmp_val, "%ld", (long)dungeon_turn);
- if (!get_string(ppp, tmp_val, 10)) return (FALSE);
- tmp_int = atoi(tmp_val);
-
- /* Verify */
- if (tmp_int >= dungeon_turn_limit) tmp_int = dungeon_turn_limit - 1;
- else if (tmp_int < 0) tmp_int = 0;
- dungeon_turn = turn = tmp_int;
- return (TRUE);
-
-}
-
-
/*!
* @brief 指定されたIDの固定アーティファクトを生成する / Create the artifact of the specified number
* @return なし
msg_print("Allocated.");
}
-
-/*!
- * @brief ウィザードモード用モンスター調査 / Hack -- quick debugging hook
- * @return なし
- */
-static void do_cmd_wiz_hack_ben(void)
-{
- msg_print("Oops.");
- (void)probing();
-}
-
/*!
* @brief ウィザードモード用モンスターの群れ生成 / Summon a horde of monsters
* @return なし
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;
}
* thus accepting the default-values for the remaining values.
* pval comes first now, since it is most important.
* - wiz_reroll_item()
- * apply some magic to the item or turn it into an artifact.
+ * apply some magic to the item or current_world_ptr->game_turn it into an artifact.
* - wiz_roll_item()
* Get some statistics about the rarity of an item:
* We create a lot of fake items and see if they are of the
/*!
* @brief アイテムの質を選択して再生成する /
- * Apply magic to an item or turn it into an artifact. -Bernd-
+ * Apply magic to an item or current_world_ptr->game_turn it into an artifact. -Bernd-
* @param o_ptr 再生成の対象となるアイテム情報の参照ポインタ
* @return なし
*/
case 'w': case 'W':
{
object_prep(q_ptr, o_ptr->k_idx);
- apply_magic(q_ptr, dun_level, AM_NO_FIXED_ART | AM_GOOD | AM_GREAT | AM_CURSED);
+ apply_magic(q_ptr, current_floor_ptr->dun_level, AM_NO_FIXED_ART | AM_GOOD | AM_GREAT | AM_CURSED);
break;
}
/* Apply bad magic, but first clear object */
case 'c': case 'C':
{
object_prep(q_ptr, o_ptr->k_idx);
- apply_magic(q_ptr, dun_level, AM_NO_FIXED_ART | AM_GOOD | AM_CURSED);
+ apply_magic(q_ptr, current_floor_ptr->dun_level, AM_NO_FIXED_ART | AM_GOOD | AM_CURSED);
break;
}
/* Apply normal magic, but first clear object */
case 'n': case 'N':
{
object_prep(q_ptr, o_ptr->k_idx);
- apply_magic(q_ptr, dun_level, AM_NO_FIXED_ART);
+ apply_magic(q_ptr, current_floor_ptr->dun_level, AM_NO_FIXED_ART);
break;
}
/* Apply good magic, but first clear object */
case 'g': case 'G':
{
object_prep(q_ptr, o_ptr->k_idx);
- apply_magic(q_ptr, dun_level, AM_NO_FIXED_ART | AM_GOOD);
+ apply_magic(q_ptr, current_floor_ptr->dun_level, AM_NO_FIXED_ART | AM_GOOD);
break;
}
/* Apply great magic, but first clear object */
case 'e': case 'E':
{
object_prep(q_ptr, o_ptr->k_idx);
- apply_magic(q_ptr, dun_level, AM_NO_FIXED_ART | AM_GOOD | AM_GREAT);
+ apply_magic(q_ptr, current_floor_ptr->dun_level, AM_NO_FIXED_ART | AM_GOOD | AM_GREAT);
break;
}
/* Apply special magic, but first clear object */
case 's': case 'S':
{
object_prep(q_ptr, o_ptr->k_idx);
- apply_magic(q_ptr, dun_level, AM_GOOD | AM_GREAT | AM_SPECIAL);
+ apply_magic(q_ptr, current_floor_ptr->dun_level, AM_GOOD | AM_GREAT | AM_SPECIAL);
/* Failed to create artifact; make a random one */
if (!object_is_artifact(q_ptr)) create_artifact(q_ptr, FALSE);
/* Let us know what we are doing */
msg_format("Creating a lot of %s items. Base level = %d.",
- quality, dun_level);
+ quality, current_floor_ptr->dun_level);
msg_print(NULL);
/* Set counters to zero */
{
/* Extract */
tmp_int = atoi(tmp_val);
-
- /* Paranoia */
if (tmp_int < 1) tmp_int = 1;
if (tmp_int > 99) tmp_int = 99;
q_ptr = &forge;
object_prep(q_ptr, k_idx);
- apply_magic(q_ptr, dun_level, AM_NO_FIXED_ART);
+ apply_magic(q_ptr, current_floor_ptr->dun_level, AM_NO_FIXED_ART);
/* Drop the object from heaven */
(void)drop_near(q_ptr, -1, p_ptr->y, p_ptr->x);
sprintf(ppp, "Jump which dungeon : ");
/* Default */
- sprintf(tmp_val, "%d", dungeon_type);
+ sprintf(tmp_val, "%d", p_ptr->dungeon_idx);
/* Ask for a level */
if (!get_string(ppp, tmp_val, 2)) return;
(int)d_info[tmp_dungeon_type].mindepth, (int)d_info[tmp_dungeon_type].maxdepth);
/* Default */
- sprintf(tmp_val, "%d", (int)dun_level);
+ sprintf(tmp_val, "%d", (int)current_floor_ptr->dun_level);
/* Ask for a level */
if (!get_string(ppp, tmp_val, 10)) return;
/* Extract request */
command_arg = (COMMAND_ARG)atoi(tmp_val);
- dungeon_type = tmp_dungeon_type;
+ p_ptr->dungeon_idx = tmp_dungeon_type;
}
-
- /* Paranoia */
- if (command_arg < d_info[dungeon_type].mindepth) command_arg = 0;
- if (command_arg > d_info[dungeon_type].maxdepth) command_arg = (COMMAND_ARG)d_info[dungeon_type].maxdepth;
+ 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;
/* Accept request */
msg_format("You jump to dungeon level %d.", command_arg);
if (autosave_l) do_cmd_save_game(TRUE);
/* Change level */
- dun_level = command_arg;
+ current_floor_ptr->dun_level = command_arg;
prepare_change_floor_mode(CFM_RAND_PLACE);
- if (!dun_level) dungeon_type = 0;
+ if (!current_floor_ptr->dun_level) p_ptr->dungeon_idx = 0;
p_ptr->inside_arena = FALSE;
p_ptr->wild_mode = FALSE;
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;
* and create a first saved floor
*/
prepare_change_floor_mode(CFM_FIRST_FLOOR);
-
- /* Leaving */
p_ptr->leaving = TRUE;
}
int i;
for (i = 0; i < num; i++)
{
- (void)summon_specific(0, p_ptr->y, p_ptr->x, dun_level, 0, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE), '\0');
+ (void)summon_specific(0, p_ptr->y, p_ptr->x, current_floor_ptr->dun_level, 0, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE), '\0');
}
}
/* Genocide everyone nearby */
for (i = 1; i < m_max; i++)
{
- monster_type *m_ptr = &m_list[i];
-
- /* Paranoia -- Skip dead monsters */
- if (!m_ptr->r_idx) continue;
+ monster_type *m_ptr = ¤t_floor_ptr->m_list[i];
+ if (!monster_is_valid(m_ptr)) continue;
/* Skip the mount */
if (i == p_ptr->riding) continue;
/* Genocide everyone */
for (i = 1; i < m_max; i++)
{
- monster_type *m_ptr = &m_list[i];
-
- /* Paranoia -- Skip dead monsters */
- if (!m_ptr->r_idx) continue;
+ monster_type *m_ptr = ¤t_floor_ptr->m_list[i];
+ if (!monster_is_valid(m_ptr)) continue;
/* Skip the mount */
if (i == p_ptr->riding) continue;
{
static int prev_feat = 0;
static int prev_mimic = 0;
- cave_type *c_ptr;
+ grid_type *g_ptr;
feature_type *f_ptr;
char tmp_val[160];
IDX tmp_feat, tmp_mimic;
if (!tgt_pt(&x, &y)) return;
- c_ptr = &cave[y][x];
+ g_ptr = ¤t_floor_ptr->grid_array[y][x];
/* Default */
sprintf(tmp_val, "%d", prev_feat);
else if (tmp_mimic >= max_f_idx) tmp_mimic = max_f_idx - 1;
cave_set_feat(y, x, tmp_feat);
- c_ptr->mimic = (s16b)tmp_mimic;
+ g_ptr->mimic = (s16b)tmp_mimic;
- f_ptr = &f_info[get_feat_mimic(c_ptr)];
+ f_ptr = &f_info[get_feat_mimic(g_ptr)];
if (have_flag(f_ptr->flags, FF_GLYPH) ||
have_flag(f_ptr->flags, FF_MINOR_GLYPH))
- c_ptr->info |= (CAVE_OBJECT);
+ g_ptr->info |= (CAVE_OBJECT);
else if (have_flag(f_ptr->flags, FF_MIRROR))
- c_ptr->info |= (CAVE_GLOW | CAVE_OBJECT);
+ g_ptr->info |= (CAVE_GLOW | CAVE_OBJECT);
note_spot(y, x);
lite_spot(y, x);
-
- /* Update some things */
p_ptr->update |= (PU_FLOW);
prev_feat = tmp_feat;
/* 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);
/* Hitpoint rerating */
case 'h':
- do_cmd_rerate(TRUE);
+ roll_hitdice(p_ptr, SPOP_DISPLAY_MES | SPOP_DEBUG);
break;
case 'H':
/* Mutation */
case 'M':
- (void)gain_random_mutation(command_arg);
+ (void)gain_mutation(p_ptr, command_arg);
break;
/* Reset Class */
/* Make every dungeon square "known" to test streamers -KMW- */
case 'u':
- for (y = 0; y < cur_hgt; y++)
+ for (y = 0; y < current_floor_ptr->height; y++)
{
- for (x = 0; x < cur_wid; x++)
+ for (x = 0; x < current_floor_ptr->width; x++)
{
- cave[y][x].info |= (CAVE_GLOW | CAVE_MARK);
+ current_floor_ptr->grid_array[y][x].info |= (CAVE_GLOW | CAVE_MARK);
}
}
wiz_lite(FALSE);
/* Hack -- whatever I desire */
case '_':
- do_cmd_wiz_hack_ben();
+ probing();
break;
/* For temporary test. */
/* Hack -- Prevent starvation */
(void)set_food(PY_FOOD_MAX - 1);
- dun_level = 0;
+ current_floor_ptr->dun_level = 0;
creature_ptr->inside_arena = FALSE;
creature_ptr->inside_battle = FALSE;
leaving_quest = 0;
creature_ptr->inside_quest = 0;
- if (dungeon_type) creature_ptr->recall_dungeon = dungeon_type;
- dungeon_type = 0;
+ if (p_ptr->dungeon_idx) creature_ptr->recall_dungeon = p_ptr->dungeon_idx;
+ p_ptr->dungeon_idx = 0;
if (lite_town || vanilla_town)
{
creature_ptr->wilderness_y = 1;
creature_ptr->oldpy = 33;
creature_ptr->oldpx = 131;
}
-
- /* Leaving */
creature_ptr->wild_mode = FALSE;
creature_ptr->leaving = TRUE;