2015-10-25 02:11:35 +02:00
|
|
|
--
|
|
|
|
-- Achivements mod
|
|
|
|
-- By Kaadmy, for Pixture
|
|
|
|
--
|
|
|
|
|
2019-09-01 01:46:33 +02:00
|
|
|
local COLOR_GOTTEN = "#00FF00"
|
|
|
|
|
2019-08-28 17:31:41 +02:00
|
|
|
local S = minetest.get_translator("achievements")
|
|
|
|
|
2015-10-25 02:11:35 +02:00
|
|
|
achievements = {}
|
|
|
|
|
|
|
|
achievements.achievements = {}
|
|
|
|
achievements.registered_achievements = {}
|
|
|
|
achievements.registered_achievements_list = {}
|
|
|
|
|
2017-05-12 06:24:54 +02:00
|
|
|
local achievements_file = minetest.get_worldpath() .. "/achievements.dat"
|
|
|
|
local saving = false
|
2015-10-25 02:11:35 +02:00
|
|
|
|
|
|
|
local function save_achievements()
|
|
|
|
local f = io.open(achievements_file, "w")
|
|
|
|
|
2017-05-12 04:29:55 +02:00
|
|
|
f:write(minetest.serialize(achievements.achievements))
|
2015-10-25 02:11:35 +02:00
|
|
|
|
|
|
|
io.close(f)
|
2017-05-15 01:06:34 +02:00
|
|
|
|
|
|
|
saving = false
|
2015-10-25 02:11:35 +02:00
|
|
|
end
|
|
|
|
|
2017-05-12 06:24:54 +02:00
|
|
|
local function delayed_save()
|
|
|
|
if not saving then
|
|
|
|
saving = true
|
|
|
|
|
2017-05-15 01:06:34 +02:00
|
|
|
minetest.after(40, save_achievements)
|
2017-05-12 06:24:54 +02:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2015-10-25 02:11:35 +02:00
|
|
|
local function load_achievements()
|
|
|
|
local f = io.open(achievements_file, "r")
|
|
|
|
|
|
|
|
if f then
|
2017-05-12 04:29:55 +02:00
|
|
|
achievements.achievements = minetest.deserialize(f:read("*all"))
|
2015-10-25 02:11:35 +02:00
|
|
|
|
|
|
|
io.close(f)
|
|
|
|
else
|
|
|
|
save_achievements()
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2017-05-16 04:48:28 +02:00
|
|
|
function achievements.register_achievement(name, def)
|
|
|
|
local rd = {
|
|
|
|
title = def.title or name, -- good-looking name of the achievement
|
|
|
|
description = def.description or "The " .. name .. " achievement", -- description of what the achievement is, and how to get it
|
|
|
|
times = def.times or 1, -- how many times to trigger before getting the achievement
|
|
|
|
dignode = def.dignode or nil, -- digging this node also triggers the achievement
|
|
|
|
placenode = def.placenode or nil, -- placing this node also triggers the achievement
|
|
|
|
craftitem = def.craftitem or nil, -- crafting this item also triggers the achievement
|
|
|
|
}
|
|
|
|
|
|
|
|
achievements.registered_achievements[name] = def
|
|
|
|
|
|
|
|
table.insert(achievements.registered_achievements_list, name)
|
|
|
|
end
|
|
|
|
|
2015-10-25 02:11:35 +02:00
|
|
|
function achievements.trigger_achievement(player, aname, times)
|
|
|
|
local name = player:get_player_name()
|
|
|
|
|
2017-05-16 04:48:28 +02:00
|
|
|
times = times or 1
|
|
|
|
|
2015-10-25 02:11:35 +02:00
|
|
|
if achievements.achievements[name][aname] == nil then
|
|
|
|
achievements.achievements[name][aname] = 0
|
|
|
|
end
|
|
|
|
|
|
|
|
if achievements.achievements[name][aname] == -1 then
|
|
|
|
return
|
|
|
|
end
|
|
|
|
|
2017-05-16 04:48:28 +02:00
|
|
|
achievements.achievements[name][aname] = achievements.achievements[name][aname] + times
|
2015-10-25 02:11:35 +02:00
|
|
|
|
|
|
|
if not achievements.registered_achievements[aname] then
|
2017-05-16 04:48:28 +02:00
|
|
|
default.log("[mod:achievements] Cannot find registered achievement "
|
|
|
|
.. aname, "error")
|
2015-10-25 02:11:35 +02:00
|
|
|
return
|
|
|
|
end
|
|
|
|
|
2017-05-16 04:48:28 +02:00
|
|
|
if achievements.achievements[name][aname]
|
|
|
|
>= achievements.registered_achievements[aname].times then
|
2015-10-25 02:11:35 +02:00
|
|
|
achievements.achievements[name][aname] = -1
|
2017-05-16 04:48:28 +02:00
|
|
|
minetest.after(
|
|
|
|
2.0,
|
2019-08-29 17:44:48 +02:00
|
|
|
function(name, aname)
|
2017-05-16 04:48:28 +02:00
|
|
|
minetest.chat_send_all(
|
|
|
|
minetest.colorize(
|
|
|
|
"#0f0",
|
2019-08-29 02:40:36 +02:00
|
|
|
"*** " .. S("@1 has earned the achievement “@2”.",
|
|
|
|
name,
|
|
|
|
achievements.registered_achievements[aname].title)))
|
2019-08-29 17:44:48 +02:00
|
|
|
end, name, aname)
|
2015-10-25 02:11:35 +02:00
|
|
|
end
|
|
|
|
|
2019-09-17 17:14:30 +02:00
|
|
|
if default.ui.current_page[name] == "achievements:achievements" then
|
2019-09-17 17:22:10 +02:00
|
|
|
local form = achievements.get_formspec(name)
|
2019-09-17 17:14:30 +02:00
|
|
|
player:set_inventory_formspec(form)
|
|
|
|
end
|
|
|
|
|
2017-05-12 06:24:54 +02:00
|
|
|
delayed_save()
|
2015-10-25 02:11:35 +02:00
|
|
|
end
|
|
|
|
|
2016-11-14 17:41:47 +01:00
|
|
|
-- Load achievements table
|
|
|
|
|
|
|
|
local function on_load()
|
|
|
|
load_achievements()
|
|
|
|
end
|
|
|
|
|
2017-05-12 06:24:54 +02:00
|
|
|
-- Save achievements table
|
|
|
|
|
|
|
|
local function on_shutdown()
|
|
|
|
save_achievements()
|
|
|
|
end
|
|
|
|
|
2017-05-16 04:59:09 +02:00
|
|
|
-- Joining player
|
2016-11-14 17:41:47 +01:00
|
|
|
|
2017-05-16 04:59:09 +02:00
|
|
|
local function on_joinplayer(player)
|
|
|
|
local name = player:get_player_name()
|
|
|
|
|
|
|
|
if not achievements.achievements[name] then
|
|
|
|
achievements.achievements[name] = {}
|
|
|
|
end
|
2016-11-14 17:41:47 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
-- Interaction callbacks
|
|
|
|
|
2017-05-15 23:14:46 +02:00
|
|
|
local function on_craft(itemstack, player)
|
2015-10-25 02:11:35 +02:00
|
|
|
for aname, def in pairs(achievements.registered_achievements) do
|
|
|
|
if def.craftitem ~= nil then
|
|
|
|
if def.craftitem == itemstack:get_name() then
|
|
|
|
achievements.trigger_achievement(player, aname)
|
|
|
|
else
|
2015-10-25 20:50:07 +01:00
|
|
|
local group = string.match(def.craftitem, "group:(.*)")
|
2015-10-25 02:11:35 +02:00
|
|
|
|
2017-05-12 04:29:55 +02:00
|
|
|
if group and minetest.get_item_group(itemstack:get_name(), group) ~= 0 then
|
2015-10-25 02:11:35 +02:00
|
|
|
achievements.trigger_achievement(player, aname)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
local function on_dig(pos, oldnode, player)
|
|
|
|
for aname, def in pairs(achievements.registered_achievements) do
|
|
|
|
if def.dignode ~= nil then
|
2016-01-06 19:47:47 +01:00
|
|
|
|
2015-10-25 02:11:35 +02:00
|
|
|
if def.dignode == oldnode.name then
|
|
|
|
achievements.trigger_achievement(player, aname)
|
|
|
|
else
|
|
|
|
local group = string.match(def.dignode, "group:(.*)")
|
|
|
|
|
2017-05-12 04:29:55 +02:00
|
|
|
if group and minetest.get_item_group(oldnode.name, group) ~= 0 then
|
2015-10-25 02:11:35 +02:00
|
|
|
achievements.trigger_achievement(player, aname)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
local function on_place(pos, newnode, player, oldnode, itemstack, pointed_thing)
|
|
|
|
for aname, def in pairs(achievements.registered_achievements) do
|
|
|
|
if def.placenode ~= nil then
|
|
|
|
if def.placenode == newnode.name then
|
|
|
|
achievements.trigger_achievement(player, aname)
|
|
|
|
else
|
|
|
|
local group = string.match(def.placenode, "group:(.*)")
|
|
|
|
|
2017-05-12 04:29:55 +02:00
|
|
|
if group and minetest.get_item_group(newnode.name, group) ~= 0 then
|
2015-10-25 02:11:35 +02:00
|
|
|
achievements.trigger_achievement(player, aname)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2016-11-14 17:41:47 +01:00
|
|
|
-- Add callback functions
|
|
|
|
|
2019-08-29 17:44:48 +02:00
|
|
|
minetest.register_on_mods_loaded(on_load)
|
2016-11-14 17:41:47 +01:00
|
|
|
|
2017-05-12 06:24:54 +02:00
|
|
|
minetest.register_on_shutdown(on_shutdown)
|
|
|
|
|
2017-05-16 04:59:09 +02:00
|
|
|
minetest.register_on_joinplayer(on_joinplayer)
|
2016-11-14 17:41:47 +01:00
|
|
|
|
2017-05-12 04:29:55 +02:00
|
|
|
minetest.register_on_dignode(on_dig)
|
|
|
|
minetest.register_on_placenode(on_place)
|
2015-10-25 02:11:35 +02:00
|
|
|
|
2017-05-15 23:14:46 +02:00
|
|
|
crafting.register_on_craft(on_craft)
|
|
|
|
|
2016-11-14 17:41:47 +01:00
|
|
|
-- Formspecs
|
|
|
|
|
2017-05-13 20:50:15 +02:00
|
|
|
local form = default.ui.get_page("default:default")
|
2017-05-16 04:59:09 +02:00
|
|
|
|
2015-10-25 22:18:54 +01:00
|
|
|
form = form .. "tableoptions[background=#DDDDDD30]"
|
2019-09-01 01:46:33 +02:00
|
|
|
form = form .. "tablecolumns[color;text,align=left,width=11;text,align=left,width=28;"
|
2017-05-16 04:48:28 +02:00
|
|
|
.. "text,align=left,width=5]"
|
2017-05-16 04:59:09 +02:00
|
|
|
|
2017-05-13 20:50:15 +02:00
|
|
|
default.ui.register_page("achievements:achievements", form)
|
2015-10-25 02:11:35 +02:00
|
|
|
|
|
|
|
function achievements.get_formspec(name, row)
|
2017-05-16 04:59:09 +02:00
|
|
|
row = row or 1
|
|
|
|
|
|
|
|
if not achievements.achievements[name] then
|
|
|
|
achievements.achievements[name] = {}
|
|
|
|
end
|
2015-10-25 02:11:35 +02:00
|
|
|
|
|
|
|
local achievement_list = ""
|
|
|
|
|
2015-10-25 22:18:54 +01:00
|
|
|
local amt_gotten = 0
|
|
|
|
local amt_progress = 0
|
|
|
|
|
2015-10-25 02:11:35 +02:00
|
|
|
for _, aname in ipairs(achievements.registered_achievements_list) do
|
|
|
|
local def = achievements.registered_achievements[aname]
|
|
|
|
|
2015-10-25 22:18:54 +01:00
|
|
|
local progress = ""
|
2019-09-01 01:46:33 +02:00
|
|
|
local color = ""
|
2015-10-25 02:11:35 +02:00
|
|
|
if achievements.achievements[name][aname] then
|
|
|
|
if achievements.achievements[name][aname] == -1 then
|
2019-08-28 17:31:41 +02:00
|
|
|
progress = S("Gotten")
|
2019-09-01 01:46:33 +02:00
|
|
|
color = COLOR_GOTTEN
|
2015-10-25 22:18:54 +01:00
|
|
|
amt_gotten = amt_gotten + 1
|
2015-10-25 02:11:35 +02:00
|
|
|
else
|
2019-08-29 02:40:36 +02:00
|
|
|
progress = S("@1/@2", achievements.achievements[name][aname], def.times)
|
2015-10-25 22:18:54 +01:00
|
|
|
amt_progress = amt_progress + 1
|
2015-10-25 02:11:35 +02:00
|
|
|
end
|
2015-10-25 22:18:54 +01:00
|
|
|
else
|
2019-08-28 17:31:41 +02:00
|
|
|
progress = S("Missing")
|
2015-10-25 02:11:35 +02:00
|
|
|
end
|
|
|
|
|
2015-10-25 22:18:54 +01:00
|
|
|
if achievement_list ~= "" then
|
|
|
|
achievement_list = achievement_list .. ","
|
2015-10-25 02:11:35 +02:00
|
|
|
end
|
2015-10-25 22:18:54 +01:00
|
|
|
|
2019-09-01 01:46:33 +02:00
|
|
|
achievement_list = achievement_list .. color .. ","
|
2017-05-12 04:29:55 +02:00
|
|
|
achievement_list = achievement_list .. minetest.formspec_escape(def.title) .. ","
|
2017-05-16 04:48:28 +02:00
|
|
|
achievement_list = achievement_list .. minetest.formspec_escape(def.description)
|
|
|
|
.. ","
|
2019-08-28 17:31:41 +02:00
|
|
|
achievement_list = achievement_list .. minetest.formspec_escape(progress)
|
2015-10-25 02:11:35 +02:00
|
|
|
end
|
|
|
|
|
2017-05-13 20:50:15 +02:00
|
|
|
local form = default.ui.get_page("achievements:achievements")
|
2015-10-25 02:11:35 +02:00
|
|
|
|
2019-08-30 01:33:33 +02:00
|
|
|
form = form .. "table[0.25,2.5;7.9,5.5;achievement_list;" .. achievement_list
|
2017-05-16 04:48:28 +02:00
|
|
|
.. ";" .. row .. "]"
|
2015-10-25 02:11:35 +02:00
|
|
|
|
|
|
|
local aname = achievements.registered_achievements_list[row]
|
|
|
|
local def = achievements.registered_achievements[aname]
|
2017-05-10 19:19:28 +02:00
|
|
|
|
2015-10-25 22:18:54 +01:00
|
|
|
local progress = ""
|
2019-09-01 01:46:33 +02:00
|
|
|
local title = def.title
|
|
|
|
local description = def.description
|
2015-10-25 02:11:35 +02:00
|
|
|
if achievements.achievements[name][aname] then
|
|
|
|
if achievements.achievements[name][aname] == -1 then
|
2019-09-01 01:46:33 +02:00
|
|
|
progress = minetest.colorize(COLOR_GOTTEN, S("Gotten"))
|
|
|
|
title = minetest.colorize(COLOR_GOTTEN, title)
|
|
|
|
description = minetest.colorize(COLOR_GOTTEN, description)
|
2015-10-25 02:11:35 +02:00
|
|
|
else
|
2019-09-01 01:46:33 +02:00
|
|
|
progress = S("@1/@2", achievements.achievements[name][aname], def.times)
|
2015-10-25 02:11:35 +02:00
|
|
|
end
|
|
|
|
else
|
2019-08-28 20:49:04 +02:00
|
|
|
progress = S("Missing")
|
2015-10-25 02:11:35 +02:00
|
|
|
end
|
|
|
|
|
2019-09-01 01:46:33 +02:00
|
|
|
local progress_total =
|
|
|
|
S("@1 of @2 achievements gotten, @3 in progress",
|
|
|
|
amt_gotten,
|
|
|
|
#achievements.registered_achievements_list,
|
|
|
|
amt_progress)
|
|
|
|
if amt_gotten == #achievements.registered_achievements_list then
|
|
|
|
progress_total = minetest.colorize(COLOR_GOTTEN, progress_total)
|
|
|
|
end
|
2017-05-16 04:48:28 +02:00
|
|
|
form = form .. "label[0.25,8.15;"
|
2019-09-01 01:46:33 +02:00
|
|
|
.. minetest.formspec_escape(progress_total)
|
|
|
|
.. "]"
|
2015-10-25 22:18:54 +01:00
|
|
|
|
2019-09-01 01:46:33 +02:00
|
|
|
form = form .. "label[0.25,0.25;" .. minetest.formspec_escape(title) .. "]"
|
2017-05-12 04:29:55 +02:00
|
|
|
form = form .. "label[7.25,0.25;" .. minetest.formspec_escape(progress) .. "]"
|
2015-10-25 02:11:35 +02:00
|
|
|
|
2019-09-05 23:23:51 +02:00
|
|
|
-- TODO: Revert this back to a label
|
|
|
|
-- Currently a textarea as a workaround for a bug in Minetest that makes labels too short when translated.
|
|
|
|
form = form .. "textarea[0.75,0.75;7.75,2;;;" .. minetest.formspec_escape(description) .. "]"
|
2015-10-25 02:11:35 +02:00
|
|
|
|
|
|
|
return form
|
|
|
|
end
|
|
|
|
|
|
|
|
local function receive_fields(player, form_name, fields)
|
|
|
|
local name = player:get_player_name()
|
|
|
|
|
2019-09-01 14:49:01 +02:00
|
|
|
local in_achievements_menu = false
|
|
|
|
if form_name == "achievements:achievements" then
|
|
|
|
in_achievements_menu = true
|
|
|
|
elseif form_name ~= "" then
|
|
|
|
return
|
|
|
|
end
|
|
|
|
if fields.quit then
|
|
|
|
return
|
|
|
|
end
|
2015-10-25 02:11:35 +02:00
|
|
|
|
|
|
|
local selected = 1
|
|
|
|
|
2019-09-01 14:49:01 +02:00
|
|
|
if fields.tab_achievements then
|
|
|
|
in_achievements_menu = true
|
|
|
|
end
|
2015-10-25 02:11:35 +02:00
|
|
|
if fields.achievement_list then
|
2019-09-01 14:49:01 +02:00
|
|
|
in_achievements_menu = true
|
2017-05-12 04:29:55 +02:00
|
|
|
local selection = minetest.explode_table_event(fields.achievement_list)
|
2015-10-25 02:11:35 +02:00
|
|
|
|
|
|
|
if selection.type == "CHG" or selection.type == "DCL" then
|
|
|
|
selected = selection.row
|
|
|
|
end
|
|
|
|
|
2019-09-01 14:49:01 +02:00
|
|
|
end
|
|
|
|
if in_achievements_menu then
|
2019-09-17 17:14:30 +02:00
|
|
|
local form = achievements.get_formspec(name, selected)
|
2019-09-01 14:49:01 +02:00
|
|
|
minetest.show_formspec(
|
|
|
|
name,
|
|
|
|
"achievements:achievements",
|
2019-09-17 17:14:30 +02:00
|
|
|
form
|
2019-09-01 14:49:01 +02:00
|
|
|
)
|
2019-09-17 17:14:30 +02:00
|
|
|
player:set_inventory_formspec(form)
|
2019-09-01 14:49:01 +02:00
|
|
|
end
|
2015-10-25 02:11:35 +02:00
|
|
|
end
|
|
|
|
|
2017-05-12 04:29:55 +02:00
|
|
|
minetest.register_on_player_receive_fields(receive_fields)
|
2015-10-25 02:11:35 +02:00
|
|
|
|
2015-10-25 22:18:54 +01:00
|
|
|
--
|
2017-05-10 19:19:28 +02:00
|
|
|
-- Below are the default achievements
|
2015-10-25 22:18:54 +01:00
|
|
|
--
|
|
|
|
|
2019-09-22 02:52:11 +02:00
|
|
|
-- Digging wood
|
2015-10-25 22:18:54 +01:00
|
|
|
|
|
|
|
achievements.register_achievement(
|
2019-09-22 02:52:11 +02:00
|
|
|
"timber",
|
2015-10-25 22:18:54 +01:00
|
|
|
{
|
2019-09-22 02:52:11 +02:00
|
|
|
title = S("Timber"),
|
|
|
|
description = S("Dig a tree trunk."),
|
2015-10-25 22:18:54 +01:00
|
|
|
times = 1,
|
2019-09-22 02:52:11 +02:00
|
|
|
dignode = "group:tree",
|
2017-05-10 19:19:28 +02:00
|
|
|
})
|
2015-10-25 22:18:54 +01:00
|
|
|
|
2019-09-22 02:52:11 +02:00
|
|
|
-- Tools
|
2015-10-25 22:18:54 +01:00
|
|
|
|
|
|
|
achievements.register_achievement(
|
2019-09-22 02:52:11 +02:00
|
|
|
"first_pickaxe",
|
2015-10-25 22:18:54 +01:00
|
|
|
{
|
2019-09-22 02:52:11 +02:00
|
|
|
title = S("My First Pickaxe"),
|
|
|
|
description = S("Craft a pickaxe."),
|
|
|
|
times = 1,
|
|
|
|
craftitem = "group:pickaxe",
|
2017-05-10 19:19:28 +02:00
|
|
|
})
|
2015-10-25 22:18:54 +01:00
|
|
|
|
|
|
|
achievements.register_achievement(
|
2019-09-22 02:52:11 +02:00
|
|
|
"hardened_miner",
|
2015-10-25 22:18:54 +01:00
|
|
|
{
|
2019-09-22 02:52:11 +02:00
|
|
|
title = S("Hardened Miner"),
|
|
|
|
description = S("Craft a carbon steel pickaxe."),
|
|
|
|
times = 1,
|
|
|
|
craftitem = "default:pick_carbon_steel",
|
2017-05-10 19:19:28 +02:00
|
|
|
})
|
2015-10-25 22:18:54 +01:00
|
|
|
|
|
|
|
achievements.register_achievement(
|
2019-09-22 02:52:11 +02:00
|
|
|
"off_to_battle",
|
2015-10-25 22:18:54 +01:00
|
|
|
{
|
2019-09-22 02:52:11 +02:00
|
|
|
title = S("Off to Battle"),
|
|
|
|
description = S("Craft a broadsword."),
|
|
|
|
times = 1,
|
|
|
|
craftitem = "default:broadsword",
|
2017-05-10 19:19:28 +02:00
|
|
|
})
|
2015-10-25 22:18:54 +01:00
|
|
|
|
2017-05-10 19:19:28 +02:00
|
|
|
-- Stone
|
2015-10-25 22:18:54 +01:00
|
|
|
|
|
|
|
achievements.register_achievement(
|
|
|
|
"mineority",
|
|
|
|
{
|
2019-08-28 17:31:41 +02:00
|
|
|
title = S("Mineority"),
|
2019-09-22 02:52:11 +02:00
|
|
|
description = S("Mine a stone."),
|
|
|
|
times = 1,
|
|
|
|
dignode = "default:stone",
|
2017-05-10 19:19:28 +02:00
|
|
|
})
|
2015-10-25 22:18:54 +01:00
|
|
|
|
2017-05-10 19:19:28 +02:00
|
|
|
achievements.register_achievement(
|
2019-09-22 02:52:11 +02:00
|
|
|
"smelting_room",
|
2017-05-10 19:19:28 +02:00
|
|
|
{
|
2019-09-22 02:52:11 +02:00
|
|
|
title = S("Smelting Room"),
|
|
|
|
description = S("Craft a furnace."),
|
|
|
|
times = 1,
|
|
|
|
craftitem = "default:furnace",
|
2017-05-10 19:19:28 +02:00
|
|
|
})
|
|
|
|
|
2019-09-22 02:52:11 +02:00
|
|
|
-- Biomes
|
2015-10-25 22:18:54 +01:00
|
|
|
|
2015-10-25 02:11:35 +02:00
|
|
|
achievements.register_achievement(
|
|
|
|
"gardener",
|
|
|
|
{
|
2019-08-28 17:31:41 +02:00
|
|
|
title = S("Gardener"),
|
2019-09-22 02:52:11 +02:00
|
|
|
description = S("Plant a flower."),
|
|
|
|
times = 1,
|
2015-10-25 22:18:54 +01:00
|
|
|
placenode = "default:flower",
|
2017-05-10 19:19:28 +02:00
|
|
|
})
|
|
|
|
|
|
|
|
achievements.register_achievement(
|
|
|
|
"welcome_to_the_mountains",
|
|
|
|
{
|
2019-09-01 03:37:14 +02:00
|
|
|
title = S("Dry Lands"),
|
2019-08-28 17:31:41 +02:00
|
|
|
description = S("Collect dry grass."),
|
2017-05-10 19:19:28 +02:00
|
|
|
times = 1,
|
|
|
|
dignode = "default:dry_grass",
|
|
|
|
})
|
|
|
|
|
|
|
|
achievements.register_achievement(
|
2019-09-22 02:52:11 +02:00
|
|
|
"drain_the_swamp",
|
2017-05-10 19:19:28 +02:00
|
|
|
{
|
2019-09-22 02:52:11 +02:00
|
|
|
title = S("Drain the Swamp"),
|
|
|
|
description = S("Dig some swamp dirt."),
|
|
|
|
times = 1,
|
|
|
|
dignode = "default:swamp_dirt",
|
2017-05-10 19:19:28 +02:00
|
|
|
})
|
|
|
|
|
2019-09-22 02:52:11 +02:00
|
|
|
-- Farming
|
2017-05-10 19:19:28 +02:00
|
|
|
|
|
|
|
achievements.register_achievement(
|
2019-09-22 02:52:11 +02:00
|
|
|
"fertile",
|
2017-05-10 19:19:28 +02:00
|
|
|
{
|
2019-09-22 02:52:11 +02:00
|
|
|
title = S("Fertile"),
|
|
|
|
description = S("Craft a fertilzer."),
|
|
|
|
times = 1,
|
|
|
|
craftitem = "default:fertilizer",
|
2017-05-10 19:19:28 +02:00
|
|
|
})
|
|
|
|
|
|
|
|
-- Literature
|
|
|
|
|
|
|
|
achievements.register_achievement(
|
|
|
|
"librarian",
|
|
|
|
{
|
2019-08-28 17:31:41 +02:00
|
|
|
title = S("Librarian"),
|
2019-09-22 02:52:11 +02:00
|
|
|
description = S("Craft a bookshelf."),
|
|
|
|
times = 1,
|
2017-05-10 19:19:28 +02:00
|
|
|
craftitem = "default:bookshelf",
|
|
|
|
})
|
|
|
|
|
2016-11-13 22:02:09 +01:00
|
|
|
default.log("mod:achievements", "loaded")
|