summaryrefslogtreecommitdiffstats
path: root/crawl-ref
diff options
context:
space:
mode:
authorDarshan Shaligram <dshaligram@users.sourceforge.net>2010-01-17 10:36:37 +0530
committerDarshan Shaligram <dshaligram@users.sourceforge.net>2010-01-17 10:38:08 +0530
commit4bbe9c5b6bd9f2d9706148b9e62b2d69e4e9ee0f (patch)
tree53ea693dcca95c646eba9d85f850f85ce300312f /crawl-ref
parentf990094082ee19c60615abe626e832b5f782d06a (diff)
downloadcrawl-ref-4bbe9c5b6bd9f2d9706148b9e62b2d69e4e9ee0f.tar.gz
crawl-ref-4bbe9c5b6bd9f2d9706148b9e62b2d69e4e9ee0f.zip
Burning trees in Swamp produces shallow water. Fire clouds adjacent to watery squares now produce steam.
Diffstat (limited to 'crawl-ref')
-rw-r--r--crawl-ref/source/beam.cc2
-rw-r--r--crawl-ref/source/cloud.cc30
-rw-r--r--crawl-ref/source/dungeon.cc7
-rw-r--r--crawl-ref/source/dungeon.h2
4 files changed, 36 insertions, 5 deletions
diff --git a/crawl-ref/source/beam.cc b/crawl-ref/source/beam.cc
index fdf6d05f96..0fa0b16462 100644
--- a/crawl-ref/source/beam.cc
+++ b/crawl-ref/source/beam.cc
@@ -1849,7 +1849,7 @@ void bolt::fire_wall_effect()
if (is_superhot())
{
// Destroy the wall.
- grd(pos()) = DNGN_FLOOR;
+ grd(pos()) = dgn_tree_base_feature_at(pos());
if (you.see_cell(pos()))
emit_message(MSGCH_PLAIN, "The tree burns like a torch!");
else if (you.can_smell())
diff --git a/crawl-ref/source/cloud.cc b/crawl-ref/source/cloud.cc
index 2e9a5a282e..c7a01066db 100644
--- a/crawl-ref/source/cloud.cc
+++ b/crawl-ref/source/cloud.cc
@@ -112,8 +112,9 @@ static void _new_cloud( int cloud, cloud_type type, const coord_def& p,
static void _place_new_cloud(cloud_type cltype, const coord_def& p, int decay,
kill_category whose, killer_type killer,
- int spread_rate, int colour, std::string name,
- std::string tile)
+ int spread_rate = -1, int colour = -1,
+ std::string name = "",
+ std::string tile = "")
{
if (env.cloud_no >= MAX_CLOUDS)
return;
@@ -185,7 +186,7 @@ static void _spread_fire(const cloud_struct &cloud)
{
if (you.see_cell(*ai))
mpr("The forest fire spreads!");
- grd(*ai) = DNGN_FLOOR;
+ grd(*ai) = dgn_tree_base_feature_at(*ai);
_place_new_cloud( cloud.type, *ai, random2(30)+25, cloud.whose,
cloud.killer, cloud.spread_rate, cloud.colour,
cloud.name, cloud.tile );
@@ -194,6 +195,25 @@ static void _spread_fire(const cloud_struct &cloud)
}
}
+static void _cloud_fire_interacts_with_terrain(const cloud_struct &cloud)
+{
+ for (adjacent_iterator ai(cloud.pos); ai; ++ai)
+ {
+ const coord_def p(*ai);
+ if (feat_is_watery(grd(p)) && env.cgrid(p) == EMPTY_CLOUD)
+ {
+ _place_new_cloud(CLOUD_STEAM, p, cloud.decay / 2 + 1,
+ cloud.whose, cloud.killer);
+ }
+ }
+}
+
+void cloud_interacts_with_terrain(const cloud_struct &cloud)
+{
+ if (cloud.type == CLOUD_FIRE || cloud.type == CLOUD_FOREST_FIRE)
+ _cloud_fire_interacts_with_terrain(cloud);
+}
+
static void _dissipate_cloud(int cloudidx, int dissipate)
{
cloud_struct &cloud = env.cloud[cloudidx];
@@ -228,7 +248,8 @@ void manage_clouds()
// rain and cold clouds dissipate faster over lava.
if (cloud.type == CLOUD_FIRE && grd(cloud.pos) == DNGN_DEEP_WATER)
dissipate *= 4;
- else if ((cloud.type == CLOUD_COLD || cloud.type == CLOUD_RAIN) && grd(cloud.pos) == DNGN_LAVA)
+ else if ((cloud.type == CLOUD_COLD || cloud.type == CLOUD_RAIN)
+ && grd(cloud.pos) == DNGN_LAVA)
dissipate *= 4;
else if (cloud.type == CLOUD_GLOOM)
{
@@ -247,6 +268,7 @@ void manage_clouds()
dissipate /= 20;
}
+ cloud_interacts_with_terrain(cloud);
expose_items_to_element(cloud2beam(cloud.type), cloud.pos, 2);
_dissipate_cloud(i, dissipate);
diff --git a/crawl-ref/source/dungeon.cc b/crawl-ref/source/dungeon.cc
index 94850d8bb8..8c8c1e1ecd 100644
--- a/crawl-ref/source/dungeon.cc
+++ b/crawl-ref/source/dungeon.cc
@@ -8151,6 +8151,13 @@ void dgn_set_lt_callback(std::string level_type_tag,
level_type_post_callbacks[level_type_tag] = callback_name;
}
+dungeon_feature_type dgn_tree_base_feature_at(coord_def c)
+{
+ return (player_in_branch(BRANCH_SWAMP)?
+ DNGN_SHALLOW_WATER :
+ DNGN_FLOOR);
+}
+
////////////////////////////////////////////////////////////////////
// dgn_region
diff --git a/crawl-ref/source/dungeon.h b/crawl-ref/source/dungeon.h
index 29217fba51..165515de3f 100644
--- a/crawl-ref/source/dungeon.h
+++ b/crawl-ref/source/dungeon.h
@@ -226,6 +226,8 @@ int dgn_place_monster(mons_spec &mspec,
bool force_pos = false, bool generate_awake = false,
bool patrolling = false);
+dungeon_feature_type dgn_tree_base_feature_at(coord_def c);
+
class item_list;
void dgn_place_multiple_items(item_list &list,
const coord_def& where,