3 -- If true, activates achievements from other Minecraft editions (XBox, PS, etc.)
4 local non_pc_achievements
= false
7 if minetest
.get_modpath("intllib") then
10 S
= function ( s
) return s
end
13 -- Achievements from PC Edition
15 awards
.register_achievement("mcl_buildWorkBench", {
16 title
= S("Benchmarking"),
17 description
= S("Craft a crafting table from 4 wooden planks."),
18 icon
= "crafting_workbench_front.png",
21 item
= "mcl_crafting_table:crafting_table",
25 awards
.register_achievement("mcl:buildPickaxe", {
26 title
= S("Time to Mine!"),
27 description
= S("Use a crafting table to craft a wooden pickaxe from wooden planks and sticks."),
28 icon
= "default_tool_woodpick.png",
31 item
= "mcl_tools:pick_wood",
35 awards
.register_achievement("mcl:buildFurnace", {
36 title
= S("Hot Topic"),
37 description
= S("Use 8 cobblestones to craft a furnace."),
38 icon
= "default_furnace_front.png",
41 item
= "mcl_furnaces:furnace",
45 awards
.register_achievement("mcl:buildHoe", {
46 title
= S("Time to Farm!"),
47 description
= S("Use a crafting table to craft a wooden hoe from wooden planks and sticks."),
48 icon
= "farming_tool_woodhoe.png",
51 item
= "mcl_farming:hoe_wood",
55 awards
.register_achievement("mcl:makeBread", {
56 title
= S("Bake Bread"),
57 description
= S("Use wheat to craft a bread."),
58 icon
= "farming_bread.png",
61 item
= "mcl_farming:bread",
66 awards
.register_achievement("mcl:bakeCake", {
68 description
= S("Craft a cake using wheat, sugar, milk and an egg."),
72 item
= "mcl_cake:cake",
76 awards
.register_achievement("mcl:buildBetterPickaxe", {
77 title
= S("Getting an Upgrade"),
78 -- TODO: This achievement should support all non-wood pickaxes
79 description
= S("Craft a stone pickaxe using sticks and cobblestone."),
80 icon
= "default_tool_stonepick.png",
83 item
= "mcl_tools:pick_stone",
87 awards
.register_achievement("mcl:buildSword", {
88 title
= S("Time to Strike!"),
89 description
= S("Craft a wooden sword using wooden planks and sticks on a crafting table."),
90 icon
= "default_tool_woodsword.png",
93 item
= "mcl_tools:sword_wood",
98 awards
.register_achievement("mcl:bookcase", {
99 title
= S("Librarian"),
100 description
= S("Craft a bookshelf."),
101 icon
= "default_bookshelf.png",
104 item
= "mcl_books:bookshelf",
109 -- Item pickup achievements: These are awarded when picking up a certain item.
110 -- The achivements are manually given in the mod mcl_item_entity.
111 awards
.register_achievement("mcl:diamonds", {
112 title
= S("DIAMONDS!"),
113 description
= S("Pick up a diamond from the floor."),
114 icon
= "mcl_core_diamond_ore.png",
116 awards
.register_achievement("mcl:blazeRod", {
117 title
= S("Into Fire"),
118 description
= S("Pick up a blaze rod from the floor."),
119 icon
= "mcl_mobitems_blaze_rod.png",
122 awards
.register_achievement("mcl:killCow", {
123 title
= S("Cow Tipper"),
124 description
= S("Pick up leather from the floor.\nHint: Cows and some other animals have a chance to drop leather, when killed."),
125 icon
= "mcl_mobitems_leather.png",
127 awards
.register_achievement("mcl:mineWood", {
128 title
= S("Getting Wood"),
129 description
= S("Pick up a wood item from the ground.\nHint: Punch a tree trunk until it pops out as an item."),
130 icon
= "default_tree.png",
133 -- Smelting achivements: These are awarded when picking up an item from a furnace
134 -- output. They are given in mcl_furnaces.
135 awards
.register_achievement("mcl:acquireIron", {
136 title
= S("Aquire Hardware"),
137 description
= S("Take an iron ingot from a furnace's output slot.\nHint: To smelt an iron ingot, put a fuel (like coal) and iron ore into a furnace."),
138 icon
= "default_steel_ingot.png",
140 awards
.register_achievement("mcl:cookFish", {
141 title
= S("Delicious Fish"),
142 description
= S("Take a cooked fish from a furnace.\nHint: Use a fishing rod to catch a fish and cook it in a furnace."),
143 icon
= "mcl_fishing_fish_cooked.png",
146 -- Other achievements triggered outside of mcl_achievements
148 -- Triggered in mcl_minecarts
149 awards
.register_achievement("mcl:onARail", {
150 title
= S("On A Rail"),
151 description
= S("Travel by minecart for at least 1000 meters from your starting point in a single ride."),
152 icon
= "default_rail.png",
155 -- Triggered in mcl_bows
156 awards
.register_achievement("mcl:snipeSkeleton", {
157 title
= S("Sniper Duel"),
158 -- TODO: This achievement should be for killing, not hitting
159 -- TODO: The range should be 50, not 20. Nerfed because of reduced bow range
160 description
= S("Hit a skeleton, wither skeleton or stray by bow and arrow from a distance of at least 20 meters."),
161 icon
= "mcl_bows_bow.png",
164 -- Triggered in mcl_portals
165 awards
.register_achievement("mcl:buildNetherPortal", {
166 title
= S("Into the Nether"),
167 description
= S("Use obsidian and a fire starter to construct a Nether portal."),
168 icon
= "default_obsidian.png",
171 -- NON-PC ACHIEVEMENTS (XBox, Pocket Edition, etc.)
173 if non_pc_achievements
then
174 awards
.register_achievement("mcl:n_placeDispenser", {
175 title
= S("Dispense With This"),
176 description
= S("Place a dispenser."),
177 icon
= "mcl_dispensers_dispenser_front_horizontal.png",
180 node
= "mcl_dispensers:dispenser",
185 -- FIXME: Eating achievements don't work when you have exactly one of these items on hand
186 awards
.register_achievement("mcl:n_eatPorkchop", {
187 title
= S("Pork Chop"),
188 description
= S("Eat a cooked porkchop."),
189 icon
= "mcl_mobitems_porkchop_cooked.png",
192 item
= "mcl_mobitems:cooked_porkchop",
196 awards
.register_achievement("mcl:n_eatRabbit", {
197 title
= S("Rabbit Season"),
198 icon
= "mcl_mobitems_rabbit_cooked.png",
199 description
= S("Eat a cooked rabbit."),
202 item
= "mcl_mobitems:cooked_rabbit",
206 awards
.register_achievement("mcl:n_eatRottenFlesh", {
207 title
= S("Iron Belly"),
208 description
= S("Get really desperate and eat rotten flesh."),
209 icon
= "mcl_mobitems_rotten_flesh.png",
212 item
= "mcl_mobitems:rotten_flesh",
216 awards
.register_achievement("mcl:n_placeFlowerpot", {
217 title
= S("Pot Planter"),
218 description
= S("Place a flower pot."),
219 icon
= "mcl_flowerpots_flowerpot_inventory.png",
222 node
= "mcl_flowerpots:flower_pot",
227 awards
.register_achievement("mcl:n_emeralds", {
228 title
= S("The Haggler"),
229 description
= S("Mine emerald ore."),
230 icon
= "default_emerald.png",
233 node
= "mcl_core:stone_with_emerald",
239 -- Show achievements formspec when the button was pressed
240 minetest
.register_on_player_receive_fields(function(player
, formname
, fields
)
241 if fields
.__mcl_achievements
then
242 local name
= player
:get_player_name()
243 awards
.show_to(name
, name
, nil, false)