*/
#include "angband.h"
-#include "generate.h"
+#include "util.h"
+#include "bldg.h"
+
+#include "dungeon.h"
+#include "feature.h"
+#include "floor-generate.h"
#include "trap.h"
#include "mutation.h"
+#include "monster.h"
#include "quest.h"
#include "store.h"
#include "artifact.h"
#include "avatar.h"
#include "spells-status.h"
#include "object-hook.h"
+#include "wild.h"
+#include "patron.h"
+
+#include "floor-save.h"
+#include "floor.h"
+#include "grid.h"
+
+#include "cmd-pet.h"
+#include "dungeon-file.h"
+#include "files.h"
+#include "player-skill.h"
+#include "player-class.h"
+#include "world.h"
+#include "objectkind.h"
+#include "object-ego.h"
/*
add_flag(o_ptr->art_flags, TR_DEC_MANA);
}
}
-
- /* Paranoia */
if (object_is_fixed_artifact(o_ptr))
{
artifact_type *a_ptr;
/* Verify that artifact */
if (!a_ptr->name) o_ptr->name1 = 0;
}
-
- /* Paranoia */
if (object_is_ego(o_ptr))
{
ego_item_type *e_ptr;
}
else
{
- /* Paranoia */
add_flag(o_ptr->art_flags, TR_LITE_M1);
}
}
}
/*!
- * @brief 店置きのアイテムオブジェクトを読み込む / Add the item "o_ptr" to the inventory of the "Home"
+ * @brief 店置きのアイテムオブジェクトを読み込む / Add the item "o_ptr" to the p_ptr->inventory_list of the "Home"
* @param st_ptr 店舗の参照ポインタ
* @param o_ptr アイテムオブジェクト参照ポインタ
* @return なし
for (i = 0; i < MAX_KUBI; i++)
{
/* Is this bounty unique already dead? */
- if (!r_info[kubi_r_idx[i]].max_num) kubi_r_idx[i] += 10000;
+ if (!r_info[current_world_ptr->bounty_r_idx[i]].max_num) current_world_ptr->bounty_r_idx[i] += 10000;
}
}
else
{
for (i = 0; i < MAX_KUBI; i++)
{
- rd_s16b(&kubi_r_idx[i]);
+ rd_s16b(¤t_world_ptr->bounty_r_idx[i]);
}
}
if (z_older_than(10, 0, 3))
{
- battle_monsters();
+ update_gambling_monsters();
}
else
{
}
/* Calc the regeneration modifier for mutations */
- mutant_regenerate_mod = calc_mutant_regenerate_mod();
+ p_ptr->mutant_regenerate_mod = calc_mutant_regenerate_mod();
if (z_older_than(10,0,9))
{
/* Hack -- the two "special seeds" */
- rd_u32b(&seed_flavor);
- rd_u32b(&seed_town);
+ rd_u32b(¤t_world_ptr->seed_flavor);
+ rd_u32b(¤t_world_ptr->seed_town);
/* Special stuff */
case RACE_SKELETON:
case RACE_ZOMBIE:
case RACE_SPECTRE:
- turn_limit = TURNS_PER_TICK * TOWN_DAWN * MAX_DAYS + TURNS_PER_TICK * TOWN_DAWN * 3 / 4;
+ current_world_ptr->game_turn_limit = TURNS_PER_TICK * TOWN_DAWN * MAX_DAYS + TURNS_PER_TICK * TOWN_DAWN * 3 / 4;
break;
default:
- turn_limit = TURNS_PER_TICK * TOWN_DAWN * (MAX_DAYS - 1) + TURNS_PER_TICK * TOWN_DAWN * 3 / 4;
+ current_world_ptr->game_turn_limit = TURNS_PER_TICK * TOWN_DAWN * (MAX_DAYS - 1) + TURNS_PER_TICK * TOWN_DAWN * 3 / 4;
break;
}
- dungeon_turn_limit = TURNS_PER_TICK * TOWN_DAWN * (MAX_DAYS - 1) + TURNS_PER_TICK * TOWN_DAWN * 3 / 4;
+ current_world_ptr->dungeon_turn_limit = TURNS_PER_TICK * TOWN_DAWN * (MAX_DAYS - 1) + TURNS_PER_TICK * TOWN_DAWN * 3 / 4;
/* Turn when level began */
- rd_s32b(&old_turn);
+ rd_s32b(¤t_floor_ptr->generated_turn);
if (h_older_than(1, 7, 0, 4))
{
- p_ptr->feeling_turn = old_turn;
+ p_ptr->feeling_turn = current_floor_ptr->generated_turn;
}
else
{
rd_s32b(&p_ptr->feeling_turn);
}
- /* Current turn */
- rd_s32b(&turn);
+ /* Current current_world_ptr->game_turn */
+ rd_s32b(¤t_world_ptr->game_turn);
if (z_older_than(10, 3, 12))
{
- dungeon_turn = turn;
+ current_world_ptr->dungeon_turn = current_world_ptr->game_turn;
}
- else rd_s32b(&dungeon_turn);
+ else rd_s32b(¤t_world_ptr->dungeon_turn);
if (z_older_than(11, 0, 13))
{
- old_turn /= 2;
+ current_floor_ptr->generated_turn /= 2;
p_ptr->feeling_turn /= 2;
- turn /= 2;
- dungeon_turn /= 2;
+ current_world_ptr->game_turn /= 2;
+ current_world_ptr->dungeon_turn /= 2;
}
if (z_older_than(10, 3, 13))
{
- old_battle = turn;
+ old_battle = current_world_ptr->game_turn;
}
else rd_s32b(&old_battle);
if (z_older_than(10,1,2))
{
- playtime = 0;
+ current_world_ptr->play_time = 0;
}
else
{
- rd_u32b(&playtime);
+ rd_u32b(¤t_world_ptr->play_time);
}
if (z_older_than(10,3,9))
/*!
- * @brief プレイヤーの所持品情報を読み込む / Read the player inventory
+ * @brief プレイヤーの所持品情報を読み込む / Read the player p_ptr->inventory_list
* @return なし
* @details
- * Note that the inventory changed in Angband 2.7.4. Two extra
+ * Note that the p_ptr->inventory_list changed in Angband 2.7.4. Two extra
* pack slots were added and the equipment was rearranged. Note
* that these two features combine when parsing old save-files, in
* which items from the old "aux" slot are "carried", perhaps into
- * one of the two new "inventory" slots.
+ * one of the two new "p_ptr->inventory_list" slots.
*
- * Note that the inventory is "re-sorted" later by "dungeon()".
+ * Note that the p_ptr->inventory_list is "re-sorted" later by "dungeon()".
*/
static errr rd_inventory(void)
{
p_ptr->total_weight = 0;
/* No items */
- inven_cnt = 0;
- equip_cnt = 0;
+ p_ptr->inven_cnt = 0;
+ p_ptr->equip_cnt = 0;
/* Read until done */
while (1)
if (n >= INVEN_RARM)
{
q_ptr->marked |= OM_TOUCHED;
- object_copy(&inventory[n], q_ptr);
+ object_copy(&p_ptr->inventory_list[n], q_ptr);
/* Add the weight */
p_ptr->total_weight += (q_ptr->number * q_ptr->weight);
/* One more item */
- equip_cnt++;
+ p_ptr->equip_cnt++;
}
/* Warning -- backpack is full */
- else if (inven_cnt == INVEN_PACK)
+ else if (p_ptr->inven_cnt == INVEN_PACK)
{
- note(_("持ち物の中のアイテムが多すぎる!", "Too many items in the inventory!"));
+ note(_("持ち物の中のアイテムが多すぎる!", "Too many items in the p_ptr->inventory_list!"));
/* Fail */
return (54);
}
- /* Carry inventory */
+ /* Carry p_ptr->inventory_list */
else
{
/* Get a slot */
n = slot++;
q_ptr->marked |= OM_TOUCHED;
- object_copy(&inventory[n], q_ptr);
+ object_copy(&p_ptr->inventory_list[n], q_ptr);
/* Add the weight */
p_ptr->total_weight += (q_ptr->number * q_ptr->weight);
/* One more item */
- inven_cnt++;
+ p_ptr->inven_cnt++;
}
}
current_floor_ptr->base_level = (DEPTH)tmp16s;
rd_s16b(&tmp16s);
- num_repro = (MONSTER_NUMBER)tmp16s;
+ current_floor_ptr->num_repro = (MONSTER_NUMBER)tmp16s;
rd_s16b(&tmp16s);
p_ptr->y = (POSITION)tmp16s;
rd_s16b(&tmp16s);
p_ptr->x = (POSITION)tmp16s;
if (z_older_than(10, 3, 13) && !current_floor_ptr->dun_level && !p_ptr->inside_arena) {p_ptr->y = 33;p_ptr->x = 131;}
rd_s16b(&tmp16s);
- cur_hgt = (POSITION)tmp16s;
+ current_floor_ptr->height = (POSITION)tmp16s;
rd_s16b(&tmp16s);
- cur_wid = (POSITION)tmp16s;
+ current_floor_ptr->width = (POSITION)tmp16s;
rd_s16b(&tmp16s); /* max_panel_rows */
rd_s16b(&tmp16s); /* max_panel_cols */
#endif
/* Maximal size */
- ymax = cur_hgt;
- xmax = cur_wid;
+ ymax = current_floor_ptr->height;
+ xmax = current_floor_ptr->width;
/*** Run length decoding ***/
rd_u16b(&limit);
/* Verify maximum */
- if (limit > max_o_idx)
+ if (limit > current_floor_ptr->max_o_idx)
{
note(format(_("アイテムの配列が大きすぎる(%d)!", "Too many (%d) object entries!"), limit));
return (151);
/* Acquire place */
- o_ptr = &o_list[o_idx];
+ o_ptr = ¤t_floor_ptr->o_list[o_idx];
/* Read the item */
rd_item(o_ptr);
/* XXX XXX */
- /* Monster */
if (o_ptr->held_m_idx)
{
monster_type *m_ptr;
-
- /* Monster */
- m_ptr = &m_list[o_ptr->held_m_idx];
+ m_ptr = ¤t_floor_ptr->m_list[o_ptr->held_m_idx];
/* Build a stack */
o_ptr->next_o_idx = m_ptr->hold_o_idx;
- /* Place the object */
m_ptr->hold_o_idx = o_idx;
}
/* Build a stack */
o_ptr->next_o_idx = g_ptr->o_idx;
- /* Place the object */
g_ptr->o_idx = o_idx;
}
}
rd_u16b(&limit);
/* Hack -- verify */
- if (limit > max_m_idx)
+ if (limit > current_floor_ptr->max_m_idx)
{
note(format(_("モンスターの配列が大きすぎる(%d)!", "Too many (%d) monster entries!"), limit));
return (161);
/* Acquire monster */
- m_ptr = &m_list[m_idx];
+ m_ptr = ¤t_floor_ptr->m_list[m_idx];
/* Read the monster */
rd_monster(m_ptr);
u32b tmp32u;
u16b limit;
- cave_template_type *templates;
+ grid_template_type *templates;
/*** Wipe all current_floor_ptr->grid_array ***/
rd_s16b(&tmp16s);
current_floor_ptr->base_level = (DEPTH)tmp16s;
rd_s16b(&tmp16s);
- num_repro = (MONSTER_NUMBER)tmp16s;
+ current_floor_ptr->num_repro = (MONSTER_NUMBER)tmp16s;
rd_u16b(&tmp16u);
p_ptr->y = (POSITION)tmp16u;
p_ptr->x = (POSITION)tmp16u;
rd_s16b(&tmp16s);
- cur_hgt = (POSITION)tmp16s;
+ current_floor_ptr->height = (POSITION)tmp16s;
rd_s16b(&tmp16s);
- cur_wid = (POSITION)tmp16s;
+ current_floor_ptr->width = (POSITION)tmp16s;
rd_byte(&p_ptr->feeling);
rd_u16b(&limit);
/* Allocate the "template" array */
- C_MAKE(templates, limit, cave_template_type);
+ C_MAKE(templates, limit, grid_template_type);
/* Read the templates */
for (i = 0; i < limit; i++)
{
- cave_template_type *ct_ptr = &templates[i];
+ grid_template_type *ct_ptr = &templates[i];
/* Read it */
rd_u16b(&tmp16u);
}
/* Maximal size */
- ymax = cur_hgt;
- xmax = cur_wid;
+ ymax = current_floor_ptr->height;
+ xmax = current_floor_ptr->width;
/*** Run length decoding ***/
}
/* Free the "template" array */
- C_KILL(templates, limit, cave_template_type);
+ C_KILL(templates, limit, grid_template_type);
/*** Objects ***/
rd_u16b(&limit);
/* Verify maximum */
- if (limit > max_o_idx) return 151;
+ if (limit > current_floor_ptr->max_o_idx) return 151;
/* Read the dungeon items */
if (i != o_idx) return 152;
/* Acquire place */
- o_ptr = &o_list[o_idx];
+ o_ptr = ¤t_floor_ptr->o_list[o_idx];
/* Read the item */
rd_item(o_ptr);
-
- /* Monster */
if (o_ptr->held_m_idx)
{
monster_type *m_ptr;
-
- /* Monster */
- m_ptr = &m_list[o_ptr->held_m_idx];
+ m_ptr = ¤t_floor_ptr->m_list[o_ptr->held_m_idx];
/* Build a stack */
o_ptr->next_o_idx = m_ptr->hold_o_idx;
- /* Place the object */
m_ptr->hold_o_idx = o_idx;
}
/* Build a stack */
o_ptr->next_o_idx = g_ptr->o_idx;
- /* Place the object */
g_ptr->o_idx = o_idx;
}
}
rd_u16b(&limit);
/* Hack -- verify */
- if (limit > max_m_idx) return 161;
+ if (limit > current_floor_ptr->max_m_idx) return 161;
/* Read the monsters */
for (i = 1; i < limit; i++)
/* Acquire monster */
- m_ptr = &m_list[m_idx];
+ m_ptr = ¤t_floor_ptr->m_list[m_idx];
/* Read the monster */
rd_monster(m_ptr);
if (z_older_than(10, 3, 7)) p_ptr->wild_mode = FALSE;
else rd_byte((byte *)&p_ptr->wild_mode);
- if (z_older_than(10, 3, 7)) ambush_flag = FALSE;
- else rd_byte((byte *)&ambush_flag);
+ if (z_older_than(10, 3, 7)) p_ptr->ambush_flag = FALSE;
+ else rd_byte((byte *)&p_ptr->ambush_flag);
/* Size of the wilderness */
rd_s32b(&wild_x_size);
rd_s32b(&wild_y_size);
/* Incompatible save files */
- if ((wild_x_size > max_wild_x) || (wild_y_size > max_wild_y))
+ if ((wild_x_size > current_world_ptr->max_wild_x) || (wild_y_size > current_world_ptr->max_wild_y))
{
note(format(_("荒野が大きすぎる(%u/%u)!", "Wilderness is too big (%u/%u)!"), wild_x_size, wild_y_size));
return (23);
}
- /* Read the inventory */
+ /* Read the p_ptr->inventory_list */
if (rd_inventory())
{
- note(_("持ち物情報を読み込むことができません", "Unable to read inventory"));
+ note(_("持ち物情報を読み込むことができません", "Unable to read p_ptr->inventory_list"));
return (21);
}
/* Drop permissions */
safe_setuid_drop();
-
- /* Paranoia */
if (!fff) return (-1);
/* Call the sub-function */