switch (o_ptr->xtra2 % 8)
{
case 0: add_flag(o_ptr->art_flags, TR_LEVITATION); break;
- case 1: add_flag(o_ptr->art_flags, TR_LITE); break;
+ case 1: add_flag(o_ptr->art_flags, TR_LITE_1); break;
case 2: add_flag(o_ptr->art_flags, TR_SEE_INVIS); break;
case 3: add_flag(o_ptr->art_flags, TR_WARNING); break;
case 4: add_flag(o_ptr->art_flags, TR_SLOW_DIGEST); break;
o_ptr->art_name = quark_add(buf);
}
else o_ptr->art_name = 0;
+
+ if(h_older_than(2,1,2,3))
+ {
+ u32b flgs[TR_FLAG_SIZE];
+ object_flags(o_ptr, flgs);
+
+ if ((o_ptr->name2 == EGO_DARK) || (o_ptr->name2 == EGO_ANCIENT_CURSE) || (o_ptr->name1 == ART_NIGHT))
+ {
+ add_flag(o_ptr->art_flags, TR_LITE_M1);
+ remove_flag(o_ptr->art_flags, TR_LITE_1);
+ remove_flag(o_ptr->art_flags, TR_LITE_2);
+ remove_flag(o_ptr->art_flags, TR_LITE_3);
+ }
+
+ if (o_ptr->name2 == EGO_LITE_DARKNESS)
+ {
+ if (o_ptr->sval == SV_LITE_TORCH)
+ {
+ add_flag(o_ptr->art_flags, TR_LITE_M1);
+ }
+ else if (o_ptr->sval == SV_LITE_LANTERN)
+ {
+ add_flag(o_ptr->art_flags, TR_LITE_M2);
+ }
+ else if (o_ptr->sval == SV_LITE_FEANOR)
+ {
+ add_flag(o_ptr->art_flags, TR_LITE_M3);
+ }
+ }
+ else if (o_ptr->sval == SV_LITE_TORCH)
+ {
+ add_flag(o_ptr->art_flags, TR_LITE_1);
+ add_flag(o_ptr->art_flags, TR_LITE_FUEL);
+ }
+ else if (o_ptr->sval == SV_LITE_LANTERN)
+ {
+ add_flag(o_ptr->art_flags, TR_LITE_2);
+ add_flag(o_ptr->art_flags, TR_LITE_FUEL);
+ }
+ else if (o_ptr->sval == SV_LITE_FEANOR)
+ {
+ add_flag(o_ptr->art_flags, TR_LITE_2);
+ }
+ else if ((o_ptr->tval == TV_LITE) && object_is_fixed_artifact(o_ptr))
+ {
+ add_flag(o_ptr->art_flags, TR_LITE_3);
+ }
+ }
}
{
rd_s16b(&m_ptr->max_maxhp);
}
+ if(h_older_than(2, 1, 2, 1))
+ {
+ m_ptr->dealt_damage = 0;
+ }
+ else
+ {
+ rd_u32b(&m_ptr->dealt_damage);
+ }
+
rd_s16b(&m_ptr->mtimed[MTIMED_CSLEEP]);
rd_byte(&m_ptr->mspeed);
if (z_older_than(10, 4, 2))
rd_s16b(&m_ptr->hp);
rd_s16b(&m_ptr->maxhp);
rd_s16b(&m_ptr->max_maxhp);
+ if(h_older_than(2, 1, 2, 1))
+ {
+ m_ptr->dealt_damage = 0;
+ }
+ else
+ {
+ rd_u32b(&m_ptr->dealt_damage);
+ }
/* Monster race index of its appearance */
if (flags & SAVE_MON_AP_R_IDX) rd_s16b(&m_ptr->ap_r_idx);
{
rd_u32b(&Rand_state[i]);
}
-
- /* Accept */
- Rand_quick = FALSE;
}
/* More info */
strip_bytes(8);
rd_s16b(&p_ptr->sc);
- strip_bytes(2);
+ rd_s16b(&p_ptr->concent);
/* Read the flags */
strip_bytes(2); /* Old "rest" */
rd_s16b(&p_ptr->energy_need);
if (z_older_than(11, 0, 13))
p_ptr->energy_need = 100 - p_ptr->energy_need;
+ if (h_older_than(2, 1, 2, 0))
+ p_ptr->enchant_energy_need = 0;
+ else
+ rd_s16b(&p_ptr->enchant_energy_need);
rd_s16b(&p_ptr->fast);
rd_s16b(&p_ptr->slow);
/* Wield equipment */
if (n >= INVEN_RARM)
{
+ /* Player touches it */
+ q_ptr->marked |= OM_TOUCHED;
+
/* Copy object */
object_copy(&inventory[n], q_ptr);
/* Get a slot */
n = slot++;
+ /* Player touches it */
+ q_ptr->marked |= OM_TOUCHED;
+
/* Copy object */
object_copy(&inventory[n], q_ptr);
/*** Terrain Feature Indexes (see "lib/edit/f_info.txt") ***/
#define OLD_FEAT_INVIS 0x02
#define OLD_FEAT_GLYPH 0x03
+#define OLD_FEAT_QUEST_ENTER 0x08
+#define OLD_FEAT_QUEST_EXIT 0x09
#define OLD_FEAT_MINOR_GLYPH 0x40
+#define OLD_FEAT_BLDG_1 0x81
#define OLD_FEAT_MIRROR 0xc3
+/* Old quests */
+#define OLD_QUEST_WATER_CAVE 18
+
+/* Quest constants */
+#define QUEST_OLD_CASTLE 27
+#define QUEST_ROYAL_CRYPT 28
+
/*
* Read the dungeon (old method)
*
}
}
+ /* Quest 18 was removed */
+ if (h_older_than(1, 7, 0, 6) && !vanilla_town)
+ {
+ for (y = 0; y < ymax; y++) for (x = 0; x < xmax; x++)
+ {
+ /* Access the cave */
+ c_ptr = &cave[y][x];
+
+ if ((c_ptr->special == OLD_QUEST_WATER_CAVE) && !dun_level)
+ {
+ if (c_ptr->feat == OLD_FEAT_QUEST_ENTER)
+ {
+ c_ptr->feat = feat_tree;
+ c_ptr->special = 0;
+ }
+ else if (c_ptr->feat == OLD_FEAT_BLDG_1)
+ {
+ c_ptr->special = lite_town ? QUEST_OLD_CASTLE : QUEST_ROYAL_CRYPT;
+ }
+ }
+ else if ((c_ptr->feat == OLD_FEAT_QUEST_EXIT) &&
+ (p_ptr->inside_quest == OLD_QUEST_WATER_CAVE))
+ {
+ c_ptr->feat = feat_up_stair;
+ c_ptr->special = 0;
+ }
+ }
+ }
+
/*** Objects ***/
/* Read the item count */
u32b tmp32u;
u16b limit;
- cave_template_type *template;
+ cave_template_type *templates;
/*** Wipe all cave ***/
rd_u16b(&limit);
/* Allocate the "template" array */
- C_MAKE(template, limit, cave_template_type);
+ C_MAKE(templates, limit, cave_template_type);
/* Read the templates */
for (i = 0; i < limit; i++)
{
- cave_template_type *ct_ptr = &template[i];
+ cave_template_type *ct_ptr = &templates[i];
/* Read it */
rd_u16b(&ct_ptr->info);
cave_type *c_ptr = &cave[y][x];
/* Extract cave data */
- c_ptr->info = template[id].info;
- c_ptr->feat = template[id].feat;
- c_ptr->mimic = template[id].mimic;
- c_ptr->special = template[id].special;
+ c_ptr->info = templates[id].info;
+ c_ptr->feat = templates[id].feat;
+ c_ptr->mimic = templates[id].mimic;
+ c_ptr->special = templates[id].special;
/* Advance/Wrap */
if (++x >= xmax)
}
}
+ /* Quest 18 was removed */
+ if (h_older_than(1, 7, 0, 6) && !vanilla_town)
+ {
+ for (y = 0; y < ymax; y++) for (x = 0; x < xmax; x++)
+ {
+ /* Access the cave */
+ cave_type *c_ptr = &cave[y][x];
+
+ if ((c_ptr->special == OLD_QUEST_WATER_CAVE) && !dun_level)
+ {
+ if (c_ptr->feat == OLD_FEAT_QUEST_ENTER)
+ {
+ c_ptr->feat = feat_tree;
+ c_ptr->special = 0;
+ }
+ else if (c_ptr->feat == OLD_FEAT_BLDG_1)
+ {
+ c_ptr->special = lite_town ? QUEST_OLD_CASTLE : QUEST_ROYAL_CRYPT;
+ }
+ }
+ else if ((c_ptr->feat == OLD_FEAT_QUEST_EXIT) &&
+ (p_ptr->inside_quest == OLD_QUEST_WATER_CAVE))
+ {
+ c_ptr->feat = feat_up_stair;
+ c_ptr->special = 0;
+ }
+ }
+ }
+
/* Free the "template" array */
- C_FREE(template, limit, cave_template_type);
+ C_KILL(templates, limit, cave_template_type);
/*** Objects ***/
{
if (i < max_quests)
{
- rd_s16b(&quest[i].status);
- rd_s16b(&quest[i].level);
+ quest_type* const q_ptr = &quest[i];
+
+ rd_s16b(&q_ptr->status);
+ rd_s16b(&q_ptr->level);
if (z_older_than(11, 0, 6))
{
- quest[i].complev = 0;
+ q_ptr->complev = 0;
+ }
+ else
+ {
+ rd_byte(&q_ptr->complev);
+ }
+ if(h_older_than(2, 1, 2, 2))
+ {
+ q_ptr->comptime = 0;
}
else
{
- rd_byte(&quest[i].complev);
+ rd_u32b(&q_ptr->comptime);
}
/* Load quest status if quest is running */
- if (quest[i].status == QUEST_STATUS_TAKEN || (!z_older_than(10, 3, 14) && (quest[i].status == QUEST_STATUS_COMPLETED)) || (!z_older_than(11, 0, 7) && (i >= MIN_RANDOM_QUEST) && (i <= (MIN_RANDOM_QUEST+max_rquests_load))))
+ if ((q_ptr->status == QUEST_STATUS_TAKEN) ||
+ (!z_older_than(10, 3, 14) && (q_ptr->status == QUEST_STATUS_COMPLETED)) ||
+ (!z_older_than(11, 0, 7) && (i >= MIN_RANDOM_QUEST) && (i <= (MIN_RANDOM_QUEST + max_rquests_load))))
{
- rd_s16b(&quest[i].cur_num);
- rd_s16b(&quest[i].max_num);
- rd_s16b(&quest[i].type);
+ rd_s16b(&q_ptr->cur_num);
+ rd_s16b(&q_ptr->max_num);
+ rd_s16b(&q_ptr->type);
/* Load quest monster index */
- rd_s16b(&quest[i].r_idx);
+ rd_s16b(&q_ptr->r_idx);
- if ((quest[i].type == QUEST_TYPE_RANDOM) && (!quest[i].r_idx))
+ if ((q_ptr->type == QUEST_TYPE_RANDOM) && (!q_ptr->r_idx))
{
determine_random_questor(&quest[i]);
}
/* Load quest item index */
- rd_s16b(&quest[i].k_idx);
+ rd_s16b(&q_ptr->k_idx);
- if (quest[i].k_idx)
- a_info[quest[i].k_idx].gen_flags |= TRG_QUESTITEM;
+ if (q_ptr->k_idx)
+ a_info[q_ptr->k_idx].gen_flags |= TRG_QUESTITEM;
- rd_byte(&quest[i].flags);
+ rd_byte(&q_ptr->flags);
if (z_older_than(10, 3, 11))
{
- if (quest[i].flags & QUEST_FLAG_PRESET)
+ if (q_ptr->flags & QUEST_FLAG_PRESET)
{
- quest[i].dungeon = 0;
+ q_ptr->dungeon = 0;
}
else
{
}
else
{
- rd_byte(&quest[i].dungeon);
+ rd_byte(&q_ptr->dungeon);
}
/* Mark uniques */
- if (quest[i].status == QUEST_STATUS_TAKEN || quest[i].status == QUEST_STATUS_UNTAKEN)
- if (r_info[quest[i].r_idx].flags1 & RF1_UNIQUE)
- r_info[quest[i].r_idx].flags1 |= RF1_QUESTOR;
+ if (q_ptr->status == QUEST_STATUS_TAKEN || q_ptr->status == QUEST_STATUS_UNTAKEN)
+ if (r_info[q_ptr->r_idx].flags1 & RF1_UNIQUE)
+ r_info[q_ptr->r_idx].flags1 |= RF1_QUESTOR;
}
}
/* Ignore the empty quests from old versions */
}
}
+ /* Quest 18 was removed */
+ if (h_older_than(1, 7, 0, 6))
+ {
+ (void)WIPE(&quest[OLD_QUEST_WATER_CAVE], quest_type);
+ quest[OLD_QUEST_WATER_CAVE].status = QUEST_STATUS_UNTAKEN;
+ }
+
/* Position in the wilderness */
rd_s32b(&p_ptr->wilderness_x);
rd_s32b(&p_ptr->wilderness_y);
}
}
+ /* Quest 18 was removed */
+ if (h_older_than(1, 7, 0, 6))
+ {
+ if (p_ptr->inside_quest == OLD_QUEST_WATER_CAVE)
+ {
+ dungeon_type = lite_town ? DUNGEON_ANGBAND : DUNGEON_GALGALS;
+ dun_level = 1;
+ p_ptr->inside_quest = 0;
+ }
+ }
+
#ifdef VERIFY_CHECKSUMS