summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--crawl-ref/source/dat/lair.des40
-rw-r--r--crawl-ref/source/dungeon.cc82
-rw-r--r--crawl-ref/source/items.cc1
3 files changed, 63 insertions, 60 deletions
diff --git a/crawl-ref/source/dat/lair.des b/crawl-ref/source/dat/lair.des
index 806e462edd..b6c8da6a2f 100644
--- a/crawl-ref/source/dat/lair.des
+++ b/crawl-ref/source/dat/lair.des
@@ -225,6 +225,7 @@ ENDMAP
#
NAME: Shoal_1
PLACE: Shoal:5
+CHANCE: 0
MONS: cyclops, yaktaur, yaktaur captain
MAP
wwwwwwwwcccccccccccccwwwwwww
@@ -263,6 +264,7 @@ ENDMAP
#
NAME: Shoal_2
PLACE: Shoal:5
+CHANCE: 0
MONS: cyclops,stone giant
SUBST: 1 = 1.
SUBST: W = W:2 w
@@ -300,6 +302,7 @@ ENDMAP
#
NAME: Shoal_3
PLACE: Shoal:5
+CHANCE: 0
KMONS: x:ice statue/orange crystal statue/silver statue
KFEAT: x:O
MAP
@@ -313,6 +316,7 @@ ENDMAP
#
NAME: Shoal_4
PLACE: Shoal:5
+CHANCE: 0
KFEAT: O = w
### KITEM: O = liquid rune of Zot
MAP
@@ -337,15 +341,17 @@ ENDMAP
# Shoal:$ is hand-hacked to force lots of minivaults.
NAME: shoalhut_rune
PLACE: Shoal:$
-TAGS: water_ok has_rune
-MONS: cyclops
-CHANCE: 1000
+TAGS: has_rune
+SHUFFLE: ABCD
+SUBST: A:x, B:x, C:x=, D=+
MAP
- x+x
-xx1xx
-=1O1x
-xx1xx
- xxx
+.xxCxx.
+xx...xx
+x.....x
+B..O..D
+x.....x
+xx...xx
+.xxAxx
ENDMAP
##############################
@@ -354,15 +360,17 @@ ENDMAP
# Shoal:$ is hand-hacked to force lots of minivaults.
NAME: shoalhut_norune
PLACE: Shoal:$
-TAGS: water_ok allow_dup
-MONS: cyclops
-CHANCE: 1000
+TAGS: allow_dup
+SHUFFLE: ABCD
+SUBST: A:x, B:x, C:x=, D=+
MAP
- x+x
-xx.xx
-=.*1x
-xx1xx
- xxx
+.xxCxx.
+xx...xx
+x.....x
+B..|..D
+x.....x
+xx...xx
+.xxAxx
ENDMAP
##############################################################################
diff --git a/crawl-ref/source/dungeon.cc b/crawl-ref/source/dungeon.cc
index bef7c19ec7..7611428cb5 100644
--- a/crawl-ref/source/dungeon.cc
+++ b/crawl-ref/source/dungeon.cc
@@ -119,7 +119,7 @@ static void place_branch_entrances(int dlevel, char level_type);
static void place_special_minivaults(int level_number, int level_type);
static void place_traps( int level_number );
static void prepare_swamp();
-static void prepare_shoals();
+static void prepare_shoals( int level_number );
static void prepare_water( int level_number );
static void check_doors();
static void hide_doors();
@@ -183,13 +183,16 @@ static void jelly_pit(int level_number, spec_room &sr);
static bool build_secondary_vault(int level_number, int vault, int rune_subst = -1);
static bool build_vaults(int level_number, int vault_number, int rune_subst = -1,
bool build_only = false);
-static bool build_minivaults(int level_number, int force_vault);
+static bool build_minivaults(int level_number, int force_vault,
+ coord_def where = coord_def() );
static int vault_grid( vault_placement &,
int level_number, int vx, int vy, int altar_count,
FixedVector < object_class_type, 7 > &acq_item_class,
int vgrid, std::vector<coord_def> &targets,
int &num_runes, int rune_subst = -1, bool foll = false);
+static int dgn_random_map_for_place(bool wantmini);
+
// ALTAR FUNCTIONS
static dungeon_feature_type pick_an_altar();
static void place_altar();
@@ -535,10 +538,7 @@ static void build_dungeon_level(int level_number, int level_type)
if (player_in_branch( BRANCH_SWAMP ))
prepare_swamp();
else if (player_in_branch(BRANCH_SHOALS))
- {
- prepare_shoals();
- place_special_minivaults(level_number, level_type);
- }
+ prepare_shoals( level_number );
place_branch_entrances( level_number, level_type );
@@ -766,7 +766,7 @@ static void place_base_islands(int margin, int num_islands, int estradius,
}
}
-static void prepare_shoals()
+static void prepare_shoals(int level_number)
{
// dpeg's algorithm.
// We could have just used spotty_level() and changed rock to
@@ -860,9 +860,28 @@ static void prepare_shoals()
// Put all the stairs on one island
grd[centres[0].x][centres[0].y] = DNGN_STONE_STAIRS_UP_I;
grd[centres[0].x+1][centres[0].y] = DNGN_STONE_STAIRS_UP_II;
- grd[centres[0].x+2][centres[0].y] = DNGN_STONE_STAIRS_UP_III;
+ grd[centres[0].x-1][centres[0].y] = DNGN_STONE_STAIRS_UP_III;
+
+ // Place the rune
+ int vaultidx;
+ do {
+ vaultidx = dgn_random_map_for_place(true);
+ } while ( vaultidx == -1 ||
+ !map_by_index(vaultidx)->has_tag("has_rune") );
+
+ build_minivaults( level_number, vaultidx,
+ centres[1] - coord_def(3,3) );
- // Minivault creation will place the rune (96.4% of the time)
+ for ( int i = 2; i < num_islands; ++i )
+ {
+ // Place (non-rune) minivaults on the other islands
+ do {
+ vaultidx = dgn_random_map_for_place(true);
+ } while ( vaultidx == -1 ||
+ map_by_index(vaultidx)->has_tag("has_rune") );
+ build_minivaults( level_number, vaultidx,
+ centres[i] - coord_def(3,3) );
+ }
}
else
{
@@ -1174,36 +1193,6 @@ static void place_special_minivaults(int level_number, int level_type)
}
}
- // FIXME hand-hackery for placing minivaults at the bottom of the Shoals.
- if ( (level_id::current().branch == BRANCH_SHOALS) &&
- (level_id::current().depth = branches[BRANCH_SHOALS].depth) )
- {
- int tries = 40;
- int num_to_place = random2(3) + 4;
- for ( int i = 0; i < num_to_place && tries > 0; ++i, --tries )
- {
- const int vault = dgn_random_map_for_place(true);
-
- if (vault == -1)
- {
- --i;
- continue;
- }
-
- // If we've already used this minivault and it doesn't
- // want duplicates, do another iteration.
- if (used.find(vault) != used.end()
- && !map_by_index(vault)->has_tag("allow_dup"))
- {
- --i;
- continue;
- }
-
- build_minivaults(level_number, vault);
- used.insert(vault);
- }
- }
-
int chance = level_number == 0? 50 : 100;
while (chance && random2(100) < chance)
{
@@ -2629,7 +2618,8 @@ static bool find_minivault_place(const vault_placement &place,
return (false);
}
-static bool build_minivaults(int level_number, int force_vault)
+static bool build_minivaults(int level_number, int force_vault,
+ coord_def where)
{
// for some weird reason can't put a vault on level 1, because monster equip
// isn't generated.
@@ -2650,10 +2640,14 @@ static bool build_minivaults(int level_number, int force_vault)
vault_placement place;
vault_main(vgrid, place, force_vault);
- int vx, vy;
int v1x, v1y;
- if (!find_minivault_place(place, v1x, v1y))
+ if ( where.x > 0 && where.y > 0 )
+ {
+ v1x = where.x;
+ v1y = where.y;
+ }
+ else if (!find_minivault_place(place, v1x, v1y))
return (false);
place.x = v1x;
@@ -2677,9 +2671,9 @@ static bool build_minivaults(int level_number, int force_vault)
int num_runes = 0;
// paint the minivault onto the grid
- for (vx = v1x; vx < v1x + place.width; vx++)
+ for (int vx = v1x; vx < v1x + place.width; vx++)
{
- for (vy = v1y; vy < v1y + place.height; vy++)
+ for (int vy = v1y; vy < v1y + place.height; vy++)
{
const int feat = vgrid[vy - v1y][vx - v1x];
if (feat == ' ')
diff --git a/crawl-ref/source/items.cc b/crawl-ref/source/items.cc
index 5a6ffb831d..b83901bf6a 100644
--- a/crawl-ref/source/items.cc
+++ b/crawl-ref/source/items.cc
@@ -1385,6 +1385,7 @@ int move_item_to_player( int obj, int quant_got, bool quiet )
autoinscribe_item( item );
origin_freeze(item, you.x_pos, you.y_pos);
+ check_note_item(item);
item.quantity = quant_got;
dec_mitm_item_quantity( obj, quant_got );