Add more achievements to query various skills
This commit is contained in:
parent
8c11897f9d
commit
70ef80488f
@ -101,10 +101,15 @@ function armor.get_groups(player)
|
||||
|
||||
local inv = player:get_inventory()
|
||||
|
||||
local ach_ok = true
|
||||
for slot_index, slot in ipairs(armor.slots) do
|
||||
local itemstack = inv:get_stack("armor", slot_index)
|
||||
local itemname = itemstack:get_name()
|
||||
|
||||
if itemstack:get_name() ~= "armor:"..slot.."_bronze" then
|
||||
ach_ok = false
|
||||
end
|
||||
|
||||
if armor.is_armor(itemname) then
|
||||
local item = minetest.registered_items[itemname]
|
||||
|
||||
@ -124,9 +129,11 @@ function armor.get_groups(player)
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
if ach_ok then
|
||||
achievements.trigger_achievement(player, "full_armor")
|
||||
end
|
||||
|
||||
-- If full set of same armor material, then boost armor by 10%
|
||||
|
||||
@ -264,10 +271,18 @@ end
|
||||
achievements.register_achievement(
|
||||
"armored",
|
||||
{
|
||||
title = S("Armored"),
|
||||
title = S("Armor Smith"),
|
||||
description = S("Craft a piece of armor."),
|
||||
times = 1,
|
||||
craftitem = "group:is_armor",
|
||||
})
|
||||
|
||||
achievements.register_achievement(
|
||||
"full_armor",
|
||||
{
|
||||
title = S("Skin of Bronze"),
|
||||
description = S("Equip a full suit of bronze armor."),
|
||||
times = 1,
|
||||
})
|
||||
|
||||
default.log("mod:armor", "loaded")
|
||||
|
@ -6,7 +6,7 @@ local S = minetest.get_translator("farming")
|
||||
achievements.register_achievement(
|
||||
"farmer",
|
||||
{
|
||||
title = S("Farmer"),
|
||||
title = S("Wannabe Farmer"),
|
||||
description = S("Plant a seed and watch it grow."),
|
||||
times = 1,
|
||||
placenode = "group:seed",
|
||||
|
@ -26,7 +26,7 @@ minetest.register_node(
|
||||
type = "fixed",
|
||||
fixed = {-0.5, -0.5, -0.5, 0.5, -0.5+(4/16), 0.5}
|
||||
},
|
||||
groups = {dig_immediate=2, attached_node=1},
|
||||
groups = {dig_immediate=2, attached_node=1, seed=1},
|
||||
sounds=default.node_sound_leaves_defaults()
|
||||
}
|
||||
)
|
||||
@ -135,7 +135,7 @@ minetest.register_node(
|
||||
type = "fixed",
|
||||
fixed = {-0.5, -0.5, -0.5, 0.5, -0.5+(4/16), 0.5}
|
||||
},
|
||||
groups = {dig_immediate=2, attached_node=1},
|
||||
groups = {dig_immediate=2, attached_node=1, seed=1},
|
||||
sounds=default.node_sound_leaves_defaults()
|
||||
}
|
||||
)
|
||||
|
@ -265,6 +265,7 @@ minetest.register_on_player_receive_fields(
|
||||
inv:add_item("gold_trade_out", trade[3])
|
||||
inv:remove_item("gold_trade_in", trade[1])
|
||||
inv:remove_item("gold_trade_in", trade[2])
|
||||
achievements.trigger_achievement(player, "trader")
|
||||
end
|
||||
end
|
||||
end
|
||||
@ -346,9 +347,8 @@ achievements.register_achievement(
|
||||
"trader",
|
||||
{
|
||||
title = S("Trader"),
|
||||
description = S("Craft a trading book."),
|
||||
description = S("Trade with a villager."),
|
||||
times = 1,
|
||||
craftitem = "gold:trading_book",
|
||||
})
|
||||
|
||||
achievements.register_achievement(
|
||||
|
@ -271,6 +271,15 @@ achievements.register_achievement(
|
||||
times = 1,
|
||||
})
|
||||
|
||||
achievements.register_achievement(
|
||||
"secret_of_jewels",
|
||||
{
|
||||
title = S("The Secret of Jewels"),
|
||||
description = S("Discover the origin of jewels."),
|
||||
times = 1,
|
||||
dignode = "jewels:jewel_ore",
|
||||
})
|
||||
|
||||
-- The tool jewel definitions
|
||||
|
||||
dofile(minetest.get_modpath("jewels").."/jewels.lua")
|
||||
|
@ -102,6 +102,7 @@ minetest.register_tool(
|
||||
burglar,
|
||||
minetest.colorize("#0f0", S("You have broken the lock!")))
|
||||
end
|
||||
achievements.trigger_achievement(player, "burglar")
|
||||
minetest.sound_play({name="locks_unlock",gain=0.8},{pos=pos, max_hear_distance=16})
|
||||
else
|
||||
-- Failure!
|
||||
@ -266,9 +267,8 @@ achievements.register_achievement(
|
||||
"burglar",
|
||||
{
|
||||
title = S("Burglar"),
|
||||
description = S("Craft a lock pick."),
|
||||
description = S("Break into a locked chest."),
|
||||
times = 1,
|
||||
craftitem = "locks:pick",
|
||||
})
|
||||
|
||||
default.log("mod:locks", "loaded")
|
||||
|
@ -42,3 +42,11 @@ achievements.register_achievement(
|
||||
description = S("Tame an animal."),
|
||||
times = 1,
|
||||
})
|
||||
|
||||
achievements.register_achievement(
|
||||
"smalltalk",
|
||||
{
|
||||
title = S("Smalltalk"),
|
||||
description = S("Visit a village and have a nice friendly chat with a villager."),
|
||||
times = 1,
|
||||
})
|
||||
|
@ -151,6 +151,8 @@ for _, npc_type_table in pairs(npc_types) do
|
||||
return
|
||||
end
|
||||
|
||||
achievements.trigger_achievement(clicker, "smalltalk")
|
||||
|
||||
-- Feed to heal npc
|
||||
|
||||
local hp = self.object:get_hp()
|
||||
|
@ -264,6 +264,7 @@ minetest.register_node(
|
||||
local itemname = puncher:get_wielded_item():get_name()
|
||||
|
||||
if itemname == "default:flint_and_steel" then
|
||||
achievements.trigger_achievement(puncher, "boom")
|
||||
tnt.burn(pos)
|
||||
end
|
||||
end,
|
||||
@ -323,20 +324,22 @@ minetest.register_craft(
|
||||
|
||||
local title, desc
|
||||
if tnt_enable then
|
||||
title = S("Boom!")
|
||||
desc = S("Craft TNT.")
|
||||
achievements.register_achievement(
|
||||
"boom",
|
||||
{
|
||||
title = S("Boom!"),
|
||||
description = S("Ignite TNT."),
|
||||
times = 1,
|
||||
})
|
||||
else
|
||||
title = S("Boom?")
|
||||
desc = S("Craft defused TNT.")
|
||||
achievements.register_achievement(
|
||||
"boom",
|
||||
{
|
||||
title = S("Boom?"),
|
||||
description = S("Craft defused TNT."),
|
||||
times = 1,
|
||||
craftitem = "tnt:tnt",
|
||||
})
|
||||
end
|
||||
|
||||
achievements.register_achievement(
|
||||
"boom",
|
||||
{
|
||||
title = title,
|
||||
description = desc,
|
||||
times = 1,
|
||||
craftitem = "tnt:tnt",
|
||||
})
|
||||
|
||||
default.log("mod:tnt", "loaded")
|
||||
|
Loading…
Reference in New Issue
Block a user