summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/dat/clua/lm_fog.lua
diff options
context:
space:
mode:
Diffstat (limited to 'crawl-ref/source/dat/clua/lm_fog.lua')
-rw-r--r--crawl-ref/source/dat/clua/lm_fog.lua21
1 files changed, 18 insertions, 3 deletions
diff --git a/crawl-ref/source/dat/clua/lm_fog.lua b/crawl-ref/source/dat/clua/lm_fog.lua
index 17b80e652e..ace95fec53 100644
--- a/crawl-ref/source/dat/clua/lm_fog.lua
+++ b/crawl-ref/source/dat/clua/lm_fog.lua
@@ -52,6 +52,10 @@
-- start_clouds: The number of clouds to lay when the level containing
-- the cloud machine is entered. This is necessary since clouds
-- are cleared when the player leaves a level.
+-- colour: A string value with which to recolour the cloud.
+-- name: A string value with which to rebrand (specifically, rename) the
+-- cloud in question.
+-- tile: A string value with which to retile the cloud.
-- listener: A table with a function field called 'func'. Will be called
-- whenever the countdown is activated, and whenever the fog
-- machine is reset. It will be called with a reference to the table,
@@ -100,6 +104,9 @@ function FogMachine:new(pars)
m.size_max = pars.size_max or pars.size
m.spread_rate = pars.spread_rate or -1
m.start_clouds = pars.start_clouds or 1
+ m.colour = pars.colour or ""
+ m.name = pars.name or ""
+ m.tile = pars.tile or ""
m.size_buildup_amnt = pars.size_buildup_amnt or 0
m.size_buildup_time = pars.size_buildup_time or 1
@@ -125,9 +132,10 @@ function FogMachine:new(pars)
end
function FogMachine:apply_cloud(point, pow_min, pow_max, pow_rolls,
- size, cloud_type, kill_cat, spread)
+ size, cloud_type, kill_cat, spread, colour,
+ name, tile)
dgn.apply_area_cloud(point.x, point.y, pow_min, pow_max, pow_rolls, size,
- cloud_type, kill_cat, spread)
+ cloud_type, kill_cat, spread, colour, name, tile)
end
function FogMachine:do_fog(point)
@@ -165,7 +173,8 @@ function FogMachine:do_fog(point)
self:apply_cloud(p, self.pow_min, self.pow_max, self.pow_rolls,
crawl.random_range(size_min, size_max, 1),
- self.cloud_type, self.kill_cat, spread)
+ self.cloud_type, self.kill_cat, spread, self.colour,
+ self.name, self.tile)
end
function FogMachine:do_trigger(triggerer, marker, ev)
@@ -225,6 +234,9 @@ function FogMachine:write(marker, th)
file.marshall(th, self.spread_buildup_amnt)
file.marshall(th, self.spread_buildup_time)
file.marshall(th, self.buildup_turns)
+ file.marshall(th, self.colour)
+ file.marshall(th, self.name)
+ file.marshall(th, self.tile)
end
function FogMachine:read(marker, th)
@@ -245,6 +257,9 @@ function FogMachine:read(marker, th)
self.spread_buildup_amnt = file.unmarshall_number(th)
self.spread_buildup_time = file.unmarshall_number(th)
self.buildup_turns = file.unmarshall_number(th)
+ self.colour = file.unmarshall_string(th)
+ self.name = file.unmarshall_string(th)
+ self.tile = file.unmarshall_string(th)
setmetatable(self, FogMachine)