summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2009-07-19 12:46:50 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2009-07-19 12:46:50 +0000
commitc4f7e626b7e1267e6540ed9d6057f7fe34b61c58 (patch)
tree99e4039e9cdfd1accb1e85d4c56b7e15f92297b5
parentf792800793a058d6668908b80b63b16d48ae50ed (diff)
downloadcrawl-ref-c4f7e626b7e1267e6540ed9d6057f7fe34b61c58.tar.gz
crawl-ref-c4f7e626b7e1267e6540ed9d6057f7fe34b61c58.zip
Backport my previous commit (Zot remaining open once entered) to 0.5.
Also replace the (unused) branch entry tile with the new Zot entry tile. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/branches/stone_soup-0.5@10304 c06c8d41-db1a-0410-9941-cceddc491573
-rw-r--r--crawl-ref/source/enum.h2
-rw-r--r--crawl-ref/source/externs.h1
-rw-r--r--crawl-ref/source/items.cc21
-rw-r--r--crawl-ref/source/misc.cc21
-rw-r--r--crawl-ref/source/player.cc1
-rw-r--r--crawl-ref/source/rltiles/dc-dngn.txt18
-rw-r--r--crawl-ref/source/rltiles/dc-dngn/dngn_branch_stairs.pngbin495 -> 0 bytes
-rw-r--r--crawl-ref/source/rltiles/dc-dngn/dngn_enter_zot.pngbin0 -> 743 bytes
-rw-r--r--crawl-ref/source/tags.cc5
-rw-r--r--crawl-ref/source/tags.h4
-rw-r--r--crawl-ref/source/tilepick.cc7
-rw-r--r--crawl-ref/source/xom.cc3
12 files changed, 42 insertions, 41 deletions
diff --git a/crawl-ref/source/enum.h b/crawl-ref/source/enum.h
index 9c136e810a..82ce74b5f6 100644
--- a/crawl-ref/source/enum.h
+++ b/crawl-ref/source/enum.h
@@ -160,7 +160,7 @@ enum attribute_type
ATTR_UNIQUE_RUNES,
ATTR_DEMONIC_RUNES,
ATTR_ABYSSAL_RUNES,
- ATTR_RUNES_IN_ZOT,
+ ATTR_RUNES_IN_ZOT, // Unused but needed for 0.5 save compatibility.
ATTR_WEAPON_SWAP_INTERRUPTED,
ATTR_GOLD_FOUND,
ATTR_PURCHASES, // Gold amount spent at shops.
diff --git a/crawl-ref/source/externs.h b/crawl-ref/source/externs.h
index 730c66f30a..b391c54b3e 100644
--- a/crawl-ref/source/externs.h
+++ b/crawl-ref/source/externs.h
@@ -835,6 +835,7 @@ public:
FixedVector<spell_type, 25> spells;
char spell_no;
game_direction_type char_direction;
+ bool opened_zot;
unsigned short pet_target;
diff --git a/crawl-ref/source/items.cc b/crawl-ref/source/items.cc
index fdc9592185..c4b9a313e4 100644
--- a/crawl-ref/source/items.cc
+++ b/crawl-ref/source/items.cc
@@ -274,9 +274,6 @@ bool dec_mitm_item_quantity( int obj, int amount )
if (mitm[obj].quantity <= amount)
amount = mitm[obj].quantity;
- if (player_in_branch(BRANCH_HALL_OF_ZOT) && is_rune(mitm[obj]))
- you.attribute[ATTR_RUNES_IN_ZOT] -= amount;
-
if (mitm[obj].quantity == amount)
{
destroy_item( obj );
@@ -307,9 +304,6 @@ void inc_inv_item_quantity( int obj, int amount, bool suppress_burden )
void inc_mitm_item_quantity( int obj, int amount )
{
- if (player_in_branch(BRANCH_HALL_OF_ZOT) && is_rune(mitm[obj]))
- you.attribute[ATTR_RUNES_IN_ZOT] += amount;
-
mitm[obj].quantity += amount;
}
@@ -556,9 +550,6 @@ static void _handle_gone_item(const item_def &item)
else
you.attribute[ATTR_DEMONIC_RUNES] -= item.quantity;
}
-
- if (player_in_branch(BRANCH_HALL_OF_ZOT) && !in_inventory(item))
- you.attribute[ATTR_RUNES_IN_ZOT] -= item.quantity;
}
}
@@ -1794,18 +1785,8 @@ bool move_item_to_grid( int *const obj, const coord_def& p )
item.link = igrd(p);
igrd(p) = ob;
- if (is_rune(item))
- {
- if (player_in_branch(BRANCH_HALL_OF_ZOT))
- you.attribute[ATTR_RUNES_IN_ZOT] += item.quantity;
- }
- else if (item.base_type == OBJ_ORBS && you.level_type == LEVEL_DUNGEON)
- {
+ if (item.base_type == OBJ_ORBS && you.level_type == LEVEL_DUNGEON)
set_branch_flags(BFLAG_HAS_ORB);
- }
-
-// if (see_grid(p))
-// StashTrack.update_stash(p);
return (true);
}
diff --git a/crawl-ref/source/misc.cc b/crawl-ref/source/misc.cc
index 296e8f0aee..f62cdd7dec 100644
--- a/crawl-ref/source/misc.cc
+++ b/crawl-ref/source/misc.cc
@@ -1845,16 +1845,20 @@ void up_stairs(dungeon_feature_type force_stair,
viewwindow(true, true);
- // Left Zot without enough runes to get back in (probably because
- // of dropping some runes within Zot), but need to get back in Zot
- // to get the Orb? Xom finds that funny.
+ // Left Zot without enough runes to get back in (because they were
+ // destroyed), but need to get back in Zot to get the Orb?
+ // Xom finds that funny.
if (stair_find == DNGN_RETURN_FROM_ZOT
&& branches[BRANCH_HALL_OF_ZOT].branch_flags & BFLAG_HAS_ORB)
{
int runes_avail = you.attribute[ATTR_UNIQUE_RUNES]
- + you.attribute[ATTR_DEMONIC_RUNES]
- + you.attribute[ATTR_ABYSSAL_RUNES]
- - you.attribute[ATTR_RUNES_IN_ZOT];
+ + you.attribute[ATTR_DEMONIC_RUNES]
+ + you.attribute[ATTR_ABYSSAL_RUNES];
+
+ // In case we've loaded an older save file where opening Zot
+ // wasn't marked.
+ if (!you.opened_zot)
+ you.opened_zot = true;
if (runes_avail < NUMBER_OF_RUNES_NEEDED)
xom_is_stimulated(255, "Xom snickers loudly.", true);
@@ -2102,7 +2106,7 @@ void down_stairs( int old_level, dungeon_feature_type force_stair,
mpr("You fall through a shaft!");
}
- if (stair_find == DNGN_ENTER_ZOT)
+ if (stair_find == DNGN_ENTER_ZOT && !you.opened_zot)
{
const int num_runes = runes_in_pack();
@@ -2120,6 +2124,9 @@ void down_stairs( int old_level, dungeon_feature_type force_stair,
}
return;
}
+ // TODO: This needs a better message!
+ mpr("The gate opens wide!");
+ you.opened_zot = true;
}
// Bail if any markers veto the move.
diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc
index dddf8cd031..643613f8ef 100644
--- a/crawl-ref/source/player.cc
+++ b/crawl-ref/source/player.cc
@@ -5895,6 +5895,7 @@ void player::init()
entry_cause_god = GOD_NO_GOD;
where_are_you = BRANCH_MAIN_DUNGEON;
char_direction = GDT_DESCENDING;
+ opened_zot = false;
prev_targ = MHITNOT;
pet_target = MHITNOT;
diff --git a/crawl-ref/source/rltiles/dc-dngn.txt b/crawl-ref/source/rltiles/dc-dngn.txt
index aaefdab206..4205f072ad 100644
--- a/crawl-ref/source/rltiles/dc-dngn.txt
+++ b/crawl-ref/source/rltiles/dc-dngn.txt
@@ -180,11 +180,11 @@ floor/rough_red3
floor/floor_sand_stone0 FLOOR_SAND_STONE
floor/floor_sand_stone1
floor/floor_sand_stone2
-floor/floor_sand_stone3
-floor/floor_sand_stone4
-floor/floor_sand_stone5
-floor/floor_sand_stone6
-floor/floor_sand_stone7
+floor/floor_sand_stone3
+floor/floor_sand_stone4
+floor/floor_sand_stone5
+floor/floor_sand_stone6
+floor/floor_sand_stone7
wall/wall_yellow_rock0 WALL_YELLOW_ROCK
wall/wall_yellow_rock1
@@ -206,7 +206,7 @@ floor/grass1
floor/grass2
floor/grass_n HALO_GRASS
-floor/grass_ne
+floor/grass_ne
floor/grass_e
floor/grass_se
floor/grass_s
@@ -301,7 +301,7 @@ floor/dirt1
floor/dirt2
floor/dirt_n HALO_DIRT
-floor/dirt_ne
+floor/dirt_ne
floor/dirt_e
floor/dirt_se
floor/dirt_s
@@ -344,8 +344,8 @@ dngn_granite_statue DNGN_GRANITE_STATUE
%rim 1
dngn_enter_hell DNGN_ENTER_HELL
+dngn_enter_zot DNGN_ENTER_ZOT
%rim 0
-dngn_branch_stairs DNGN_BRANCH_STAIRS
dngn_trap_dart DNGN_TRAP_DART
dngn_trap_arrow DNGN_TRAP_ARROW
dngn_trap_spear DNGN_TRAP_SPEAR
@@ -422,7 +422,7 @@ dngn_dry_fountain DNGN_DRY_FOUNTAIN
## Miscellaneous entries that get drawn on the background
dc-misc/blood_red BLOOD
-dc-misc/blood_red1
+dc-misc/blood_red1
dc-misc/blood_red2
dc-misc/blood_red3
dc-misc/blood_red4
diff --git a/crawl-ref/source/rltiles/dc-dngn/dngn_branch_stairs.png b/crawl-ref/source/rltiles/dc-dngn/dngn_branch_stairs.png
deleted file mode 100644
index de52fcbae5..0000000000
--- a/crawl-ref/source/rltiles/dc-dngn/dngn_branch_stairs.png
+++ /dev/null
Binary files differ
diff --git a/crawl-ref/source/rltiles/dc-dngn/dngn_enter_zot.png b/crawl-ref/source/rltiles/dc-dngn/dngn_enter_zot.png
new file mode 100644
index 0000000000..f50faa176d
--- /dev/null
+++ b/crawl-ref/source/rltiles/dc-dngn/dngn_enter_zot.png
Binary files differ
diff --git a/crawl-ref/source/tags.cc b/crawl-ref/source/tags.cc
index ef5eaaf648..4655e72da2 100644
--- a/crawl-ref/source/tags.cc
+++ b/crawl-ref/source/tags.cc
@@ -1,3 +1,4 @@
+
/*
* File: tags.cc
* Summary: Auxilary functions to make savefile versioning simpler.
@@ -835,6 +836,7 @@ static void tag_construct_you(writer &th)
marshallByte(th, you.max_level);
marshallByte(th, you.where_are_you);
marshallByte(th, you.char_direction);
+ marshallByte(th, you.opened_zot);
marshallByte(th, you.your_level);
marshallByte(th, you.is_undead);
marshallByte(th, you.special_wield);
@@ -1251,6 +1253,9 @@ static void tag_read_you(reader &th, char minorVersion)
you.max_level = unmarshallByte(th);
you.where_are_you = static_cast<branch_type>( unmarshallByte(th) );
you.char_direction = static_cast<game_direction_type>(unmarshallByte(th));
+ if (minorVersion >= TAG_MINOR_ZOT_OPEN)
+ you.opened_zot = (bool) unmarshallByte(th);
+
you.your_level = unmarshallByte(th);
you.is_undead = static_cast<undead_state_type>(unmarshallByte(th));
you.special_wield = unmarshallByte(th);
diff --git a/crawl-ref/source/tags.h b/crawl-ref/source/tags.h
index 3ee92cc930..cb727f7a7d 100644
--- a/crawl-ref/source/tags.h
+++ b/crawl-ref/source/tags.h
@@ -63,7 +63,9 @@ enum tag_minor_version
TAG_MINOR_SVNREV = 13, // Added SVN revision
TAG_MINOR_PORTEXT = 14, // Keep track of portal vault extensions.
TAG_MINOR_RELIGION = 15, // Keep track of ghosts' religions.
- TAG_MINOR_VERSION = 15 // Current version. (Keep equal to max.)
+ // Release 0.5.
+ TAG_MINOR_ZOT_OPEN = 16, // Open Zot for good the first time you enter.
+ TAG_MINOR_VERSION = 16 // Current version. (Keep equal to max.)
};
diff --git a/crawl-ref/source/tilepick.cc b/crawl-ref/source/tilepick.cc
index 965cad5ebb..8c290ab2b4 100644
--- a/crawl-ref/source/tilepick.cc
+++ b/crawl-ref/source/tilepick.cc
@@ -2441,7 +2441,6 @@ int tileidx_feature(int object, int gx, int gy)
case DNGN_ENTER_VAULTS:
case DNGN_ENTER_CRYPT:
case DNGN_ENTER_HALL_OF_BLADES:
- case DNGN_ENTER_ZOT:
case DNGN_ENTER_TEMPLE:
case DNGN_ENTER_SNAKE_PIT:
case DNGN_ENTER_ELVEN_HALLS:
@@ -2449,6 +2448,10 @@ int tileidx_feature(int object, int gx, int gy)
case DNGN_ENTER_SWAMP:
case DNGN_ENTER_SHOALS:
return TILE_DNGN_ENTER;
+
+ case DNGN_ENTER_ZOT:
+ return TILE_DNGN_ENTER_ZOT;
+
case DNGN_RETURN_FROM_ORCISH_MINES:
case DNGN_RETURN_FROM_HIVE:
case DNGN_RETURN_FROM_LAIR:
@@ -2648,6 +2651,7 @@ void tileidx_unseen(unsigned int &fg, unsigned int &bg, int ch,
case '\\': fg = TILE_STAFF_OFFSET; break;
case '^': bg = TILE_DNGN_TRAP_ZOT; break;
case '_':
+ case 220:
case 131: fg = TILE_UNSEEN_ALTAR; break;
case '~': fg = TILE_UNSEEN_ITEM; break;
case '{':
@@ -2658,6 +2662,7 @@ void tileidx_unseen(unsigned int &fg, unsigned int &bg, int ch,
case 128: //old
case 254: bg = TILE_DNGN_CLOSED_DOOR; break;
case 129: bg = TILE_DNGN_RETURN; break;
+ case 239:
case 132: fg = TILE_UNSEEN_ENTRANCE; break;
case 136: bg = TILE_DNGN_ENTER; break;
case 141: bg = TILE_DNGN_LAVA; break;
diff --git a/crawl-ref/source/xom.cc b/crawl-ref/source/xom.cc
index 3f5b777fb2..ee26016165 100644
--- a/crawl-ref/source/xom.cc
+++ b/crawl-ref/source/xom.cc
@@ -3065,8 +3065,7 @@ static void _xom_check_less_runes(int runes_gone)
int runes_avail = you.attribute[ATTR_UNIQUE_RUNES]
+ you.attribute[ATTR_DEMONIC_RUNES]
- + you.attribute[ATTR_ABYSSAL_RUNES]
- - you.attribute[ATTR_RUNES_IN_ZOT];
+ + you.attribute[ATTR_ABYSSAL_RUNES];
int was_avail = runes_avail + runes_gone;
// No longer enough available runes to get into Zot.