Version 0.41.3
[MineClone/MineClone2/MineClone2-Fixes.git] / mods / HUD / mcl_achievements / init.lua
blob836652705b4aa7a08883a08e7fe07942925f19ca
1 -- Settings
3 -- If true, activates achievements from other Minecraft editions (XBox, PS, etc.)
4 local non_pc_achievements = false
6 local S
7 if minetest.get_modpath("intllib") then
8 S = intllib.Getter()
9 else
10 S = function ( s ) return s end
11 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",
19 trigger = {
20 type = "craft",
21 item = "mcl_crafting_table:crafting_table",
22 target = 1
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",
29 trigger = {
30 type = "craft",
31 item = "mcl_tools:pick_wood",
32 target = 1
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",
39 trigger = {
40 type = "craft",
41 item = "mcl_furnaces:furnace",
42 target = 1
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",
49 trigger = {
50 type = "craft",
51 item = "mcl_farming:hoe_wood",
52 target = 1
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",
59 trigger = {
60 type = "craft",
61 item = "mcl_farming:bread",
62 target = 1
66 awards.register_achievement("mcl:bakeCake", {
67 title = S("The Lie"),
68 description = S("Craft a cake using wheat, sugar, milk and an egg."),
69 icon = "cake.png",
70 trigger = {
71 type = "craft",
72 item = "mcl_cake:cake",
73 target = 1
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",
81 trigger = {
82 type = "craft",
83 item = "mcl_tools:pick_stone",
84 target = 1
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",
91 trigger = {
92 type = "craft",
93 item = "mcl_tools:sword_wood",
94 target = 1
98 awards.register_achievement("mcl:bookcase", {
99 title = S("Librarian"),
100 description = S("Craft a bookshelf."),
101 icon = "default_bookshelf.png",
102 trigger = {
103 type = "craft",
104 item = "mcl_books:bookshelf",
105 target = 1
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",
178 trigger = {
179 type = "place",
180 node = "mcl_dispensers:dispenser",
181 target = 1
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",
190 trigger = {
191 type = "eat",
192 item= "mcl_mobitems:cooked_porkchop",
193 target = 1,
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."),
200 trigger = {
201 type = "eat",
202 item= "mcl_mobitems:cooked_rabbit",
203 target = 1,
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",
210 trigger = {
211 type = "eat",
212 item= "mcl_mobitems:rotten_flesh",
213 target = 1,
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",
220 trigger = {
221 type = "place",
222 node = "mcl_flowerpots:flower_pot",
223 target = 1,
227 awards.register_achievement("mcl:n_emeralds", {
228 title = S("The Haggler"),
229 description = S("Mine emerald ore."),
230 icon = "default_emerald.png",
231 trigger = {
232 type = "dig",
233 node = "mcl_core:stone_with_emerald",
234 target = 1,
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)
245 end)