forked from mtcontrib/awards
Readd awards
This commit is contained in:
parent
f84e6d8db5
commit
07997a54f4
4
api.lua
4
api.lua
@ -162,7 +162,7 @@ function awards.register_trigger(tname, tdef)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function def.getDefaultDescription(_)
|
function def.getDefaultDescription(_)
|
||||||
local n = self.trigger.target
|
local n = def.trigger.target
|
||||||
return NS(tdef.auto_description[1], tdef.auto_description[2], n, n)
|
return NS(tdef.auto_description[1], tdef.auto_description[2], n, n)
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -216,7 +216,7 @@ function awards.register_trigger(tname, tdef)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function def.getDefaultDescription(_)
|
function def.getDefaultDescription(_)
|
||||||
local n = self.trigger.target
|
local n = def.trigger.target
|
||||||
if tmp.key then
|
if tmp.key then
|
||||||
local nname = tmp.key
|
local nname = tmp.key
|
||||||
return NS(tdef.auto_description[1],
|
return NS(tdef.auto_description[1],
|
||||||
|
@ -214,9 +214,9 @@ if minetest.get_modpath("default") then
|
|||||||
icon = "default_lava.png",
|
icon = "default_lava.png",
|
||||||
})
|
})
|
||||||
awards.register_on_dig(function(player,data)
|
awards.register_on_dig(function(player,data)
|
||||||
local pos = player:getpos()
|
local pos = player:get_pos()
|
||||||
if pos and (minetest.find_node_near(pos, 1, "default:lava_source") ~= nil or
|
if pos and (minetest.find_node_near(pos, 1, "default:lava_source") or
|
||||||
minetest.find_node_near(pos, 1, "default:lava_flowing") ~= nil) then
|
minetest.find_node_near(pos, 1, "default:lava_flowing")) then
|
||||||
return "award_lavaminer"
|
return "award_lavaminer"
|
||||||
end
|
end
|
||||||
return nil
|
return nil
|
||||||
|
13
init.lua
13
init.lua
@ -28,7 +28,7 @@ dofile(minetest.get_modpath("awards").."/api.lua")
|
|||||||
dofile(minetest.get_modpath("awards").."/chat_commands.lua")
|
dofile(minetest.get_modpath("awards").."/chat_commands.lua")
|
||||||
dofile(minetest.get_modpath("awards").."/gui.lua")
|
dofile(minetest.get_modpath("awards").."/gui.lua")
|
||||||
dofile(minetest.get_modpath("awards").."/triggers.lua")
|
dofile(minetest.get_modpath("awards").."/triggers.lua")
|
||||||
-- dofile(minetest.get_modpath("awards").."/awards.lua")
|
dofile(minetest.get_modpath("awards").."/awards.lua")
|
||||||
|
|
||||||
-- Backwards compatibility
|
-- Backwards compatibility
|
||||||
awards.give_achievement = awards.unlock
|
awards.give_achievement = awards.unlock
|
||||||
@ -41,14 +41,3 @@ awards.register_onChat = awards.register_on_chat
|
|||||||
awards.register_onJoin = awards.register_on_join
|
awards.register_onJoin = awards.register_on_join
|
||||||
awards.register_onCraft = awards.register_on_craft
|
awards.register_onCraft = awards.register_on_craft
|
||||||
awards.def = awards.registered_awards
|
awards.def = awards.registered_awards
|
||||||
|
|
||||||
awards.register_achievement("award_saint_maclou",{
|
|
||||||
title = "Saint-Maclou",
|
|
||||||
description = "Place 20 coal checkers.",
|
|
||||||
icon = "awards_novicebuilder.png",
|
|
||||||
trigger = {
|
|
||||||
type = "dig",
|
|
||||||
node = "default:stone",
|
|
||||||
target = 3,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
Loading…
Reference in New Issue
Block a user