Add eat trigger, extend existing triggers, add 9 awards (#35)

* Add eat trigger and 2 new awards
* Add mushroom eating awards
* Add support for counting any eat/dig/craft/place
* Update readme
* Add 4 builder awards
* Update German locale
* Update dependencies
* Fix mistake in German translation
* Revert removal of background
This commit is contained in:
Wuzzy
2016-11-15 01:57:01 +01:00
committed by GitHub
parent ab7206e150
commit 38c504e938
9 changed files with 334 additions and 50 deletions

16
api.lua
View File

@ -115,6 +115,22 @@ function awards.get_item_count(data, field, itemname)
end
end
function awards.get_total_item_count(data, field)
local i = 0
if data and field then
awards.assertPlayer(data)
awards.tbv(data, field)
for mod,_ in pairs(data[field]) do
awards.tbv(data[field], mod)
for item,_ in pairs(data[field][mod]) do
awards.tbv(data[field][mod], item, 0)
i = i + data[field][mod][item]
end
end
end
return i
end
function awards.register_on_unlock(func)
table.insert(awards.on_unlock, func)
end