diff options
Diffstat (limited to 'crawl-ref/source/cloud.cc')
-rw-r--r-- | crawl-ref/source/cloud.cc | 30 |
1 files changed, 26 insertions, 4 deletions
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); |