summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/cloud.cc
diff options
context:
space:
mode:
authorharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2007-05-01 14:47:53 +0000
committerharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2007-05-01 14:47:53 +0000
commit106fb6de1cf3523c10197dc8e02ec44e94523f18 (patch)
treebe6eba2338470be1467fc89131f20d80878a4906 /crawl-ref/source/cloud.cc
parent83043ea070b1f45c5cad9c7ad1f1844a01079809 (diff)
downloadcrawl-ref-106fb6de1cf3523c10197dc8e02ec44e94523f18.tar.gz
crawl-ref-106fb6de1cf3523c10197dc8e02ec44e94523f18.zip
Type safety, cast cleanups, etc.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1401 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/cloud.cc')
-rw-r--r--crawl-ref/source/cloud.cc20
1 files changed, 16 insertions, 4 deletions
diff --git a/crawl-ref/source/cloud.cc b/crawl-ref/source/cloud.cc
index 8ecfa7b158..1f542523fc 100644
--- a/crawl-ref/source/cloud.cc
+++ b/crawl-ref/source/cloud.cc
@@ -33,7 +33,7 @@ static bool cloud_spreads(const cloud_struct &cloud)
}
}
-static void new_cloud( int cloud, int type, int x, int y, int decay,
+static void new_cloud( int cloud, cloud_type type, int x, int y, int decay,
kill_category whose )
{
ASSERT( env.cloud[ cloud ].type == CLOUD_NONE );
@@ -47,7 +47,7 @@ static void new_cloud( int cloud, int type, int x, int y, int decay,
env.cloud_no++;
}
-static void place_new_cloud(int cltype, int x, int y, int decay,
+static void place_new_cloud(cloud_type cltype, int x, int y, int decay,
kill_category whose)
{
if (env.cloud_no >= MAX_CLOUDS)
@@ -182,7 +182,7 @@ void move_cloud( int cloud, int new_x, int new_y )
// Places a cloud with the given stats assuming one doesn't already
// exist at that point.
-void check_place_cloud( int cl_type, int x, int y, int lifetime,
+void check_place_cloud( cloud_type cl_type, int x, int y, int lifetime,
kill_category whose )
{
if (!in_bounds(x, y) || env.cgrid[x][y] != EMPTY_CLOUD)
@@ -194,7 +194,7 @@ void check_place_cloud( int cl_type, int x, int y, int lifetime,
// Places a cloud with the given stats. May delete old clouds to
// make way if there are too many on level. Will overwrite an old
// cloud under some circumstances.
-void place_cloud(int cl_type, int ctarget_x,
+void place_cloud(cloud_type cl_type, int ctarget_x,
int ctarget_y, int cl_range,
kill_category whose)
{
@@ -273,3 +273,15 @@ bool is_opaque_cloud(unsigned char cloud_idx)
return ( ctype == CLOUD_BLACK_SMOKE ||
(ctype >= CLOUD_GREY_SMOKE && ctype <= CLOUD_STEAM) );
}
+
+cloud_type random_smoke_type()
+{
+ // excludes black (reproducing existing behaviour)
+ switch ( random2(3) )
+ {
+ case 0: return CLOUD_GREY_SMOKE;
+ case 1: return CLOUD_BLUE_SMOKE;
+ case 2: return CLOUD_PURP_SMOKE;
+ }
+ return CLOUD_DEBUGGING;
+}