summaryrefslogtreecommitdiffhomepage
path: root/not/World.lua
diff options
context:
space:
mode:
authorAki <nthirtyone@gmail.com>2017-09-13 04:40:40 +0200
committerAki <nthirtyone@gmail.com>2017-09-13 04:40:40 +0200
commita0bbf9f36db30b0c6de3480f525ee69698ba18f9 (patch)
treec0347c55c10b1cad8640aa788e154715da174e64 /not/World.lua
parented16d208863944f64ce42298132597345cb749bb (diff)
downloadroflnauts-a0bbf9f36db30b0c6de3480f525ee69698ba18f9.zip
roflnauts-a0bbf9f36db30b0c6de3480f525ee69698ba18f9.tar.gz
roflnauts-a0bbf9f36db30b0c6de3480f525ee69698ba18f9.tar.bz2
> inb4 Multiple generators
CloudGenerator now counts only clouds spawned by itself
Diffstat (limited to 'not/World.lua')
-rw-r--r--not/World.lua6
1 files changed, 6 insertions, 0 deletions
diff --git a/not/World.lua b/not/World.lua
index 853d75b..f576fca 100644
--- a/not/World.lua
+++ b/not/World.lua
@@ -222,6 +222,12 @@ function World:getCloudsCount ()
end)
end
+function World:getCloudsCountFrom (generator)
+ return self:countEntities(function (entity)
+ return entity:is(Cloud) and entity.generator == generator
+ end)
+end
+
function World:getNautsAll ()
return self:getEntities(function (entity)
return entity:is(require("not.Hero")) and not entity.body:isDestroyed()