summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2009-07-23 09:53:41 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2009-07-23 09:53:41 +0000
commitd40b5c49a223cb2bdad1e9a0df10631140b700a3 (patch)
tree1ce05afb305aafd41354bba5e853ea79796a819a
parent2487cbfe7787fdd3d8908ec9ad384fbebf30ac9a (diff)
downloadcrawl-ref-d40b5c49a223cb2bdad1e9a0df10631140b700a3.tar.gz
crawl-ref-d40b5c49a223cb2bdad1e9a0df10631140b700a3.zip
* Fix Xom gifts not going Splash! in deep water.
* Limit Xom tele rounds to a maximum of 12 (unlikely, but you know...) * Update player doll for Merfolk entering/leaving water. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@10379 c06c8d41-db1a-0410-9941-cceddc491573
-rw-r--r--crawl-ref/source/player.cc13
-rw-r--r--crawl-ref/source/spells3.cc15
-rw-r--r--crawl-ref/source/xom.cc16
3 files changed, 42 insertions, 2 deletions
diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc
index a1889aee42..a4ecdf499a 100644
--- a/crawl-ref/source/player.cc
+++ b/crawl-ref/source/player.cc
@@ -226,6 +226,9 @@ bool move_player_to_grid( const coord_def& p, bool stepped, bool allow_shift,
}
}
+#ifdef USE_TILE
+ bool need_doll_update = false;
+#endif
// Only consider terrain if player is not levitating.
if (!player_is_airborne())
{
@@ -253,11 +256,17 @@ bool move_player_to_grid( const coord_def& p, bool stepped, bool allow_shift,
mpr("Your legs become a tail as you dive into the water.");
merfolk_start_swimming();
+#ifdef USE_TILE
+ need_doll_update = true;
+#endif
}
else if (!grid_is_water(new_grid) && grid_is_water(old_grid))
{
unmeld_one_equip(EQ_BOOTS);
you.redraw_evasion = true;
+#ifdef USE_TILE
+ need_doll_update = true;
+#endif
}
}
@@ -309,6 +318,10 @@ bool move_player_to_grid( const coord_def& p, bool stepped, bool allow_shift,
// Move the player to new location.
you.moveto(p);
+#ifdef USE_TILE
+ if (need_doll_update)
+ init_player_doll();
+#endif
viewwindow( true, false );
diff --git a/crawl-ref/source/spells3.cc b/crawl-ref/source/spells3.cc
index 3a815e32e8..cd5913a85e 100644
--- a/crawl-ref/source/spells3.cc
+++ b/crawl-ref/source/spells3.cc
@@ -1308,6 +1308,9 @@ static bool _teleport_player( bool allow_control, bool new_abyss_area )
coord_def pos(1, 0);
bool large_change = false;
bool check_ring_TC = false;
+#ifdef USE_TILE
+ const dungeon_feature_type old_grid = grd(you.pos());
+#endif
if (is_controlled)
{
@@ -1457,6 +1460,18 @@ static bool _teleport_player( bool allow_control, bool new_abyss_area )
if (check_ring_TC)
maybe_id_ring_TC();
+#ifdef USE_TILE
+ if (you.species == SP_MERFOLK)
+ {
+ const dungeon_feature_type new_grid = grd(you.pos());
+ if (grid_is_water(old_grid) && !grid_is_water(new_grid)
+ || !grid_is_water(old_grid) && grid_is_water(new_grid))
+ {
+ init_player_doll();
+ }
+ }
+#endif
+
return !is_controlled;
}
diff --git a/crawl-ref/source/xom.cc b/crawl-ref/source/xom.cc
index 74c5af7596..b3ab56009a 100644
--- a/crawl-ref/source/xom.cc
+++ b/crawl-ref/source/xom.cc
@@ -575,6 +575,16 @@ static void _xom_make_item(object_class_type base, int subtype, int power)
items(true, base, subtype, true, power, MAKE_ITEM_RANDOM_RACE,
0, 0, GOD_XOM);
+ if (grid_destroys_items(grd(you.pos())))
+ {
+ if (!silenced(you.pos()))
+ mprf(MSGCH_SOUND, grid_item_destruction_message(grd(you.pos())));
+
+ simple_god_message(" snickers.", GOD_XOM);
+ destroy_item(thing_created, true);
+ thing_created = NON_ITEM;
+ }
+
if (thing_created == NON_ITEM)
{
god_speaks(GOD_XOM, "\"No, never mind.\"");
@@ -1689,7 +1699,8 @@ static bool _xom_is_good(int sever, int tension)
if (one_chance_in(10))
break;
}
- while (x_chance_in_y(3, 4) || player_in_a_dangerous_place());
+ while (x_chance_in_y(3, 4) || count > 7 + random2(5)
+ || player_in_a_dangerous_place());
maybe_update_stashes();
// Take a note.
@@ -2708,7 +2719,8 @@ static bool _xom_is_bad(int sever, int tension)
you_teleport_now(false);
more();
}
- while (x_chance_in_y(3, 4) && !player_in_a_dangerous_place());
+ while (count > 7 + random2(5)
+ || x_chance_in_y(3, 4) && !player_in_a_dangerous_place());
badness = player_in_a_dangerous_place() ? 3 : 1;
maybe_update_stashes();