From 3e4e26b227d45f1a3f33a3adf1ff25f3b02a79dc Mon Sep 17 00:00:00 2001 From: zelgadis Date: Tue, 1 Jul 2008 09:26:40 +0000 Subject: Make initial sanctuary be circular in shape rather than square. Remove non-harmless clouds when laying down sanctuary, and don't allow non-harmless clouds to speard into sanctuary or be placed on it. Don't let explosions spread into sanctuary (probably needs a flavour message). If a giant spore or ball lightning somehow explodes while in sanctuary then give a message about Zin containing it's explosion, and skip the call to explosion(). git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6284 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/cloud.cc | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'crawl-ref/source/cloud.cc') diff --git a/crawl-ref/source/cloud.cc b/crawl-ref/source/cloud.cc index 863a6fcc26..aca3710b42 100644 --- a/crawl-ref/source/cloud.cc +++ b/crawl-ref/source/cloud.cc @@ -27,6 +27,7 @@ #include "player.h" #include "stuff.h" #include "terrain.h" +#include "view.h" // Returns true if this cloud spreads out as it dissipates. static unsigned char _actual_spread_rate(cloud_type type, int spread_rate) @@ -96,7 +97,8 @@ static int _spread_cloud(const cloud_struct &cloud) if (!in_bounds(x, y) || env.cgrid[x][y] != EMPTY_CLOUD - || grid_is_solid(grd[x][y])) + || grid_is_solid(grd[x][y]) + || is_sanctuary(x, y) && !is_harmless_cloud(cloud.type)) continue; int newdecay = cloud.decay / 2 + 1; @@ -225,6 +227,9 @@ void place_cloud(cloud_type cl_type, int ctarget_x, int ctarget_y, int cl_range, kill_category whose, int _spread_rate) { + if (is_sanctuary(ctarget_x, ctarget_y) && !is_harmless_cloud(cl_type)) + return; + int cl_new = -1; // more compact {dlb} @@ -586,6 +591,23 @@ bool is_damaging_cloud(cloud_type type, bool temp) } } +bool is_harmless_cloud(cloud_type type) +{ + switch (type) + { + case CLOUD_NONE: + case CLOUD_BLACK_SMOKE: + case CLOUD_GREY_SMOKE: + case CLOUD_BLUE_SMOKE: + case CLOUD_PURP_SMOKE: + case CLOUD_MIST: + case CLOUD_DEBUGGING: + return (true); + default: + return (false); + } +} + std::string cloud_name(cloud_type type) { switch (type) -- cgit v1.2.3-54-g00ecf