This commit is contained in:
Freeman 2023-08-27 08:39:31 +02:00
parent 514b0bcd5a
commit 8f29ac6509

@ -125,7 +125,7 @@ if minetest.get_modpath("awards") then
item = drop_vendor,
target = 1,
},
icon = "player_vend_front.png^awards_level1.png",
icon = "player_vend_front.png",
})
awards.register_achievement("fancy_vend:wizard",{
@ -147,27 +147,30 @@ if minetest.get_modpath("awards") then
awards.register_achievement("fancy_vend:seller",{
title = "Seller",
description = "Configure a vendor.",
icon = "player_vend_front.png^awards_level2.png",
icon = "player_vend_front.png",
})
awards.register_achievement("fancy_vend:shop_keeper",{
title = "Shop Keeper",
description = "Configure 10 vendors or depositors.",
icon = "player_vend_front.png^awards_level3.png",
icon = "player_vend_front.png",
secret = true,
})
awards.register_achievement("fancy_vend:merchant",{
title = "Merchant",
description = "Configure 25 vendors or depositors.",
icon = "player_vend_front.png^awards_level4.png",
icon = "player_vend_front.png",
secret = true,
})
awards.register_achievement("fancy_vend:super_merchant",{
title = "Super Merchant",
description = "Configure 100 vendors or depositors. How do you even have this much stuff to sell?",
icon = "player_vend_front.png^awards_level5.png",
icon = "player_vend_front.png",
secret = true,
})
awards.register_achievement("fancy_vend:god_merchant",{
title = "God Merchant",
description = "Configure 9001 vendors or depositors. Ok wot.",
icon = "player_vend_front.png^awards_level6.png",
icon = "player_vend_front.png",
secret = true, -- Oi. Cheater.
})
end
@ -985,42 +988,42 @@ local function refresh_vendor(pos)
if meta:get_string("configured") == "" then
meta:set_string("configured", "true")
-- if minetest.get_modpath("awards") then
-- local name = meta:get_string("owner")
-- local data = awards.player(name)
if minetest.get_modpath("awards") then
local name = meta:get_string("owner")
local data = awards.player(name)
-- -- Ensure fancy_vend_configure table is in data
-- if not data.fancy_vend_configure then
-- data.fancy_vend_configure = {}
-- end
-- Ensure fancy_vend_configure table is in data
if not data.fancy_vend_configure then
data.fancy_vend_configure = {}
end
-- awards.increment_item_counter(data, "fancy_vend_configure", correct_vendor)
awards.increment_item_counter(data, "fancy_vend_configure", correct_vendor)
-- total_item_count = 0
total_item_count = 0
-- for k, v in pairs(data.fancy_vend_configure) do
-- total_item_count = total_item_count + v
-- end
-- for k, v in pairs(data.fancy_vend_configure) do
-- total_item_count = total_item_count + v
-- end
-- if awards.get_item_count(data, "fancy_vend_configure", "fancy_vend:player_vendor") >= 1 then
-- awards.unlock(name, "fancy_vend:seller")
-- end
-- if awards.get_item_count(data, "fancy_vend_configure", "fancy_vend:player_depo") >= 1 then
-- awards.unlock(name, "fancy_vend:trader")
-- end
-- if total_item_count >= 10 then
-- awards.unlock(name, "fancy_vend:shop_keeper")
-- end
-- if total_item_count >= 25 then
-- awards.unlock(name, "fancy_vend:merchant")
-- end
-- if total_item_count >= 100 then
-- awards.unlock(name, "fancy_vend:super_merchant")
-- end
-- if total_item_count >= 9001 then
-- awards.unlock(name, "fancy_vend:god_merchant")
-- end
-- end
if awards.get_item_count(data, "fancy_vend_configure", "fancy_vend:player_vendor") >= 1 then
awards.unlock(name, "fancy_vend:seller")
end
if awards.get_item_count(data, "fancy_vend_configure", "fancy_vend:player_depo") >= 1 then
awards.unlock(name, "fancy_vend:trader")
end
if total_item_count >= 10 then
awards.unlock(name, "fancy_vend:shop_keeper")
end
if total_item_count >= 25 then
awards.unlock(name, "fancy_vend:merchant")
end
if total_item_count >= 100 then
awards.unlock(name, "fancy_vend:super_merchant")
end
if total_item_count >= 9001 then
awards.unlock(name, "fancy_vend:god_merchant")
end
end
end
if settings.depositor then
@ -1474,9 +1477,9 @@ if shopcraft then
minetest.register_craft({
output = "fancy_vend:player_vendor",
recipe = {
{ "mcl_core:gold_ingot", display_node, "mcl_core:gold_ingot"},
{ "mcl_core:diamond", "mesecons:redstone", "mcl_core:diamond"},
{ "mcl_core:gold_ingot","mcl_chests:chest","mcl_core:gold_ingot"},
{ "", display_node, ""},
{ "mesecons:redstone", "mcl_core:emerald", "mesecons:redstone"},
{ "","mcl_chests:chest",""},
}
})
end
@ -1569,7 +1572,7 @@ minetest.register_craft({
recipe = {
{"mcl_core:stick","", "" },
{"", "mcl_core:obsidian","" },
{"", "", "mcl_core:diamond"},
{"", "", "mcl_core:emerald"},
}
})
@ -1578,7 +1581,7 @@ minetest.register_craft({
recipe = {
{"", "", "mcl_core:stick"},
{"", "mcl_core:obsidian","" },
{"mcl_core:diamond","", "" },
{"mcl_core:emerald", "", "" },
}
})