summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--crawl-ref/docs/crawl_options.txt2
-rw-r--r--crawl-ref/init.txt2
-rw-r--r--crawl-ref/source/acr.cc30
-rw-r--r--crawl-ref/source/direct.cc17
-rw-r--r--crawl-ref/source/initfile.cc2
-rw-r--r--crawl-ref/source/it_use2.cc6
-rw-r--r--crawl-ref/source/monstuff.cc37
-rw-r--r--crawl-ref/source/spells2.cc1
-rw-r--r--crawl-ref/source/terrain.cc26
-rw-r--r--crawl-ref/source/terrain.h3
-rw-r--r--crawl-ref/source/view.cc2
11 files changed, 87 insertions, 41 deletions
diff --git a/crawl-ref/docs/crawl_options.txt b/crawl-ref/docs/crawl_options.txt
index d9cda57df2..4f70b65a21 100644
--- a/crawl-ref/docs/crawl_options.txt
+++ b/crawl-ref/docs/crawl_options.txt
@@ -636,7 +636,7 @@ travel_avoid_terrain = (shallow water | deep water)
travel_avoid_terrain = shallow water, deep water
will prevent travel or explore from going through any water.
-explore_greedy = false
+explore_greedy = true
Greedy explore travels to items that are eligible for autopickup
in addition to exploring the level, but is otherwise identical
to regular explore. Greedy explore is only available with
diff --git a/crawl-ref/init.txt b/crawl-ref/init.txt
index 947485af04..9a6683a87a 100644
--- a/crawl-ref/init.txt
+++ b/crawl-ref/init.txt
@@ -127,7 +127,7 @@ stab_brand = hi:blue
# travel_delay = 20
# travel_avoid_terrain = shallow water
#
-# explore_greedy = true
+# explore_greedy = false
# explore_stop = items,greedy_items,stairs,shops,altars,gates
# tc_reachable = blue
diff --git a/crawl-ref/source/acr.cc b/crawl-ref/source/acr.cc
index 8a1942265a..12806c9024 100644
--- a/crawl-ref/source/acr.cc
+++ b/crawl-ref/source/acr.cc
@@ -3355,33 +3355,6 @@ keycode_type get_next_keycode()
return (keyin);
}
-// Find all connected cells containing ft, starting at d.
-static void _find_connected_identical(coord_def d, dungeon_feature_type ft,
- std::set<coord_def>& out)
-{
- if (grd[d.x][d.y] != ft) return;
- if (out.insert(d).second)
- {
- _find_connected_identical(coord_def(d.x+1, d.y), ft, out);
- _find_connected_identical(coord_def(d.x-1, d.y), ft, out);
- _find_connected_identical(coord_def(d.x, d.y+1), ft, out);
- _find_connected_identical(coord_def(d.x, d.y-1), ft, out);
- }
-}
-
-static std::string get_door_noun(int door_count)
-{
- switch (door_count)
- {
- case 0: return "buggy opening";
- case 1: return "door";
- case 2: return "large door";
- case 3: return "gate";
- default: return "huge gate";
- }
-}
-
-
/*
Opens doors and handles some aspects of untrapping. If either move_x or
move_y are non-zero, the pair carries a specific direction for the door
@@ -3522,7 +3495,8 @@ static void open_door(int move_x, int move_y, bool check_confused)
} // end open_door()
/*
- Similar to open_door. Can you spot the difference?
+ * Similar to open_door. Can you spot the difference?
+ * FIX ME: closing a gate should update all tiles involved!
*/
static void close_door(int door_x, int door_y)
{
diff --git a/crawl-ref/source/direct.cc b/crawl-ref/source/direct.cc
index d46ad84239..d59f2a2f9b 100644
--- a/crawl-ref/source/direct.cc
+++ b/crawl-ref/source/direct.cc
@@ -1429,6 +1429,9 @@ static void describe_feature(int mx, int my, bool oos)
return;
dungeon_feature_type grid = grd[mx][my];
+ if ( grid == DNGN_SECRET_DOOR )
+ grid = grid_secret_door_appearance(mx, my);
+
std::string desc = feature_description(grid);
if (desc.length())
{
@@ -1810,6 +1813,20 @@ std::string feature_description(int mx, int my, bool bloody,
if ( grid == DNGN_SECRET_DOOR )
grid = grid_secret_door_appearance(mx, my);
+ if ( grid == DNGN_OPEN_DOOR || grid == DNGN_CLOSED_DOOR )
+ {
+ std::string desc = (grid == DNGN_OPEN_DOOR) ? "open " : "closed ";
+
+ std::set<coord_def> all_door;
+ _find_connected_identical(coord_def(mx, my), grd[mx][my], all_door);
+ desc += get_door_noun(all_door.size()).c_str();
+
+ if (bloody)
+ desc += ", spattered with blood";
+
+ return feature_do_grammar(dtype, add_stop, false, desc);
+ }
+
switch (grid)
{
case DNGN_TRAP_MECHANICAL:
diff --git a/crawl-ref/source/initfile.cc b/crawl-ref/source/initfile.cc
index 785acb35af..da5415202f 100644
--- a/crawl-ref/source/initfile.cc
+++ b/crawl-ref/source/initfile.cc
@@ -738,7 +738,7 @@ void game_options::reset_options()
explore_stop_prompt = ES_NONE;
explore_item_greed = 10;
- explore_greedy = false;
+ explore_greedy = true;
explore_improved = false;
diff --git a/crawl-ref/source/it_use2.cc b/crawl-ref/source/it_use2.cc
index 36a4b8caba..07d652883f 100644
--- a/crawl-ref/source/it_use2.cc
+++ b/crawl-ref/source/it_use2.cc
@@ -48,7 +48,6 @@ bool potion_effect( potion_type pot_eff, int pow )
{
bool effect = true; // current behaviour is all potions id on quaffing
bool was_known = item_type_known(OBJ_POTIONS, (int) pot_eff);
- int new_value = 0;
if (pow > 150)
pow = 150;
@@ -289,8 +288,9 @@ bool potion_effect( potion_type pot_eff, int pow )
break; // I'll let this slip past robe of archmagi
case POT_MAGIC:
+ {
mpr( "You feel magical!" );
- new_value = 5 + random2avg(19, 2);
+ int new_value = 5 + random2avg(19, 2);
// increase intrinsic MP points
if (you.magic_points + new_value > you.max_magic_points)
@@ -301,7 +301,7 @@ bool potion_effect( potion_type pot_eff, int pow )
inc_mp( new_value, true );
break;
-
+ }
case POT_RESTORE_ABILITIES:
{
bool nothing_happens = true;
diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc
index b3bb6100cc..4e05e773a2 100644
--- a/crawl-ref/source/monstuff.cc
+++ b/crawl-ref/source/monstuff.cc
@@ -5270,22 +5270,47 @@ static bool is_trap_safe(const monsters *monster, const int trap_x,
static void mons_open_door(monsters* monster, const coord_def &pos)
{
- bool was_secret = (grd(pos) == DNGN_SECRET_DOOR);
+ dungeon_feature_type grid = grd(pos);
+ std::string noun = "door";
+ bool was_secret = false;
- if (was_secret && !see_grid(pos))
- set_terrain_changed(pos);
- grd(pos) = DNGN_OPEN_DOOR;
+ if (grid == DNGN_SECRET_DOOR)
+ {
+ grid = grid_secret_door_appearance(pos.x, pos.y);
+ grd(pos) = DNGN_OPEN_DOOR; // just a simple door, no gates etc.
+
+ was_secret = true;
+ if (!see_grid(pos))
+ set_terrain_changed(pos);
+ }
+ else // maybe several connected doors -> gate
+ {
+ std::set<coord_def> all_door;
+ _find_connected_identical(pos, grd(pos), all_door);
+ noun = get_door_noun(all_door.size()).c_str();
+
+ for (std::set<coord_def>::iterator i = all_door.begin();
+ i != all_door.end(); ++i)
+ {
+ const coord_def& dc = *i;
+ grd[dc.x][dc.y] = DNGN_OPEN_DOOR;
+ }
+ }
if (see_grid(pos))
{
viewwindow(true, false);
if (was_secret)
- mpr("The rock wall was actually a secret door!");
+ {
+ mprf("%s was actually a secret door!",
+ feature_description(grid, NUM_TRAPS, false,
+ DESC_CAP_THE, false).c_str());
+ }
if (!you.can_see(monster))
{
- mpr("Something unseen opens the door.");
+ mprf("Something unseen opens the %s.", noun.c_str());
interrupt_activity(AI_FORCE_INTERRUPT);
}
}
diff --git a/crawl-ref/source/spells2.cc b/crawl-ref/source/spells2.cc
index 296fe73e13..152f8e61ab 100644
--- a/crawl-ref/source/spells2.cc
+++ b/crawl-ref/source/spells2.cc
@@ -1031,6 +1031,7 @@ void drain_life(int pow)
hurted = 3 + random2(7) + random2(pow);
hurt_monster(monster, hurted);
+ behaviour_event(monster, ME_WHACK, MHITYOU, you.x_pos, you.y_pos);
hp_gain += hurted;
diff --git a/crawl-ref/source/terrain.cc b/crawl-ref/source/terrain.cc
index 934e9e9b4f..4294d75d77 100644
--- a/crawl-ref/source/terrain.cc
+++ b/crawl-ref/source/terrain.cc
@@ -236,6 +236,32 @@ bool grid_is_branch_stairs( dungeon_feature_type grid )
|| (grid >= DNGN_ENTER_DIS && grid <= DNGN_ENTER_TARTARUS));
}
+// Find all connected cells containing ft, starting at d.
+void _find_connected_identical(coord_def d, dungeon_feature_type ft,
+ std::set<coord_def>& out)
+{
+ if (grd[d.x][d.y] != ft) return;
+ if (out.insert(d).second)
+ {
+ _find_connected_identical(coord_def(d.x+1, d.y), ft, out);
+ _find_connected_identical(coord_def(d.x-1, d.y), ft, out);
+ _find_connected_identical(coord_def(d.x, d.y+1), ft, out);
+ _find_connected_identical(coord_def(d.x, d.y-1), ft, out);
+ }
+}
+
+std::string get_door_noun(int door_count)
+{
+ switch (door_count)
+ {
+ case 0: return "buggy opening";
+ case 1: return "door";
+ case 2: return "large door";
+ case 3: return "gate";
+ default: return "huge gate";
+ }
+}
+
dungeon_feature_type grid_secret_door_appearance( int gx, int gy )
{
dungeon_feature_type ret = DNGN_FLOOR;
diff --git a/crawl-ref/source/terrain.h b/crawl-ref/source/terrain.h
index c4af306e4f..973c25413c 100644
--- a/crawl-ref/source/terrain.h
+++ b/crawl-ref/source/terrain.h
@@ -44,6 +44,9 @@ bool grid_is_watery(dungeon_feature_type grid);
god_type grid_altar_god( dungeon_feature_type grid );
dungeon_feature_type altar_for_god( god_type god );
bool grid_is_branch_stairs( dungeon_feature_type grid );
+void _find_connected_identical(coord_def d, dungeon_feature_type ft,
+ std::set<coord_def>& out);
+std::string get_door_noun(int door_count);
dungeon_feature_type grid_secret_door_appearance( int gx, int gy );
bool grid_destroys_items( dungeon_feature_type grid );
diff --git a/crawl-ref/source/view.cc b/crawl-ref/source/view.cc
index 00a0fa8dd3..aead1830d9 100644
--- a/crawl-ref/source/view.cc
+++ b/crawl-ref/source/view.cc
@@ -4509,7 +4509,7 @@ void viewwindow(bool draw_it, bool do_updates)
&& crawl_view.in_grid_los(gc))
{
const int object = env.show(ep);
- if (object)
+ if (object && Options.tutorial_left)
{
if (grid_is_rock_stair(grd(gc)))
learned_something_new(