*/
#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 */
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
{
if (z_older_than(10, 3, 12))
{
- dungeon_turn = current_world_ptr->game_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;
current_world_ptr->game_turn /= 2;
- dungeon_turn /= 2;
+ current_world_ptr->dungeon_turn /= 2;
}
if (z_older_than(10, 3, 13))
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++;
}
}
/* XXX XXX */
- /* Monster */
if (o_ptr->held_m_idx)
{
monster_type *m_ptr;
-
- /* Monster */
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;
}
}
u32b tmp32u;
u16b limit;
- cave_template_type *templates;
+ grid_template_type *templates;
/*** Wipe all current_floor_ptr->grid_array ***/
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);
}
/* Free the "template" array */
- C_KILL(templates, limit, cave_template_type);
+ C_KILL(templates, limit, grid_template_type);
/*** Objects ***/
/* Read the item */
rd_item(o_ptr);
-
- /* Monster */
if (o_ptr->held_m_idx)
{
monster_type *m_ptr;
-
- /* Monster */
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;
}
}
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);
}
- /* 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 */