diff options
author | Wuzzy <wuzzy2@mail.ru> | 2016-11-15 01:57:01 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-11-15 01:57:01 +0100 |
commit | 38c504e938e169e0337591b7ffe13863ff21250d (patch) | |
tree | e35f4fdc8eda2f3eb67f2ee7bf806bbe7304efff /init.lua | |
parent | ab7206e15050b050257c7e45b804dc9b1352d41d (diff) |
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
Diffstat (limited to 'init.lua')
-rw-r--r-- | init.lua | 105 |
1 files changed, 105 insertions, 0 deletions
@@ -684,6 +684,17 @@ if minetest.get_modpath("default") then target = 40 } }) + + awards.register_achievement("award_apples", { + title = S("Yummy!"), + description = S("Eat 80 apples."), + icon = "default_apple.png", + trigger = { + type = "eat", + item = "default:apple", + target = 80 + } + }) end if minetest.get_modpath("vessels") then @@ -743,6 +754,17 @@ if minetest.get_modpath("farming") then } }) + awards.register_achievement("award_bread", { + title = S("Baker"), + description = S("Eat 10 loaves of bread."), + icon = "farming_bread.png", + trigger = { + type = "eat", + item = "farming:bread", + target = 10 + } + }) + end if minetest.get_modpath("wool") and minetest.get_modpath("farming") then @@ -829,3 +851,86 @@ if minetest.get_modpath("dye") then } }) end + +if minetest.get_modpath("flowers") then + awards.register_achievement("awards_brown_mushroom1", { + title = S("Tasty Mushrooms"), + description = S("Eat 3 brown mushrooms."), + icon = "flowers_mushroom_brown.png^awards_level1.png", + trigger = { + type = "eat", + item= "flowers:mushroom_brown", + target = 3, + } + }) + awards.register_achievement("awards_brown_mushroom2", { + title = S("Mushroom Lover"), + description = S("Eat 33 brown mushrooms."), + icon = "flowers_mushroom_brown.png^awards_level2.png", + trigger = { + type = "eat", + item= "flowers:mushroom_brown", + target = 33, + } + }) + awards.register_achievement("awards_brown_mushroom3", { + title = S("Underground Mushroom Farmer"), + description = S("Eat 333 brown mushrooms."), + icon = "flowers_mushroom_brown.png^awards_level3.png", + trigger = { + type = "eat", + item= "flowers:mushroom_brown", + target = 333, + } + }) +end + +-- This ensures the following code is executed after all items have been registered +minetest.after(0, function() + -- Check whether there is at least one node which can be built by the player + local building_is_possible = false + for _, def in pairs(minetest.registered_nodes) do + if (def.description and def.pointable ~= false and not def.groups.not_in_creative_inventory) then + building_is_possible = true + break + end + end + + -- The following awards require at least one node which can be built + if not building_is_possible then + return + end + + awards.register_achievement("awards_builder1", { + title = S("Builder"), + icon = "awards_house.png^awards_level1.png", + trigger = { + type = "place", + target = 1000, + }, + }) + awards.register_achievement("awards_builder2", { + title = S("Constructor"), + icon = "awards_house.png^awards_level2.png", + trigger = { + type = "place", + target = 5000, + }, + }) + awards.register_achievement("awards_builder3", { + title = S("Architect"), + icon = "awards_house.png^awards_level3.png", + trigger = { + type = "place", + target = 10000, + }, + }) + awards.register_achievement("awards_builder4", { + title = S("Master Architect"), + icon = "awards_house.png^awards_level4.png", + trigger = { + type = "place", + target = 25000, + }, + }) +end) |