mirror of
https://gitlab.com/lunovox/e-urn.git
synced 2025-03-15 07:21:22 +00:00
59 lines
2.1 KiB
Lua
59 lines
2.1 KiB
Lua
modEUrn.nodeformat = {
|
|
urn= {
|
|
type = "fixed",
|
|
fixed = { {-.5,-.5,-.5, .5,.0,.5} } --Meia Urna
|
|
}
|
|
}
|
|
minetest.register_node("eurn:eurn", {
|
|
description = core.colorize("#00FF00",
|
|
modEUrn.translate("E-URN")
|
|
).."\n\t* "..modEUrn.translate("Colect opinion of player with electronic urn."),
|
|
--inventory_image = minetest.inventorycube("text_eurn_front_1.png"),
|
|
--inventory_image = "text_eurn_front_1.png",
|
|
paramtype = "light",
|
|
sunlight_propagates = true,
|
|
light_source = default.LIGHT_MAX,
|
|
paramtype2 = "facedir",
|
|
--legacy_facedir_simple = true, --<=Nao sei para que serve!
|
|
is_ground_content = false,
|
|
groups = {cracky=1},
|
|
--groups = {cracky=3,oddly_breakable_by_hand=3},
|
|
--sounds = default.node_sound_glass_defaults(),
|
|
node_box = modEUrn.nodeformat.urn,
|
|
selection_box = modEUrn.nodeformat.urn,
|
|
tiles = {
|
|
"text_eurn_top.png", --cima
|
|
"text_eurn_top.png", --baixo
|
|
"text_eurn_side.png", --esquerda
|
|
"text_eurn_side.png", --direita
|
|
"text_eurn_side.png", --atrás
|
|
"text_eurn_front.png" --frente
|
|
},
|
|
|
|
on_place = function(itemstack, placer, pointed_thing)
|
|
return itemstack
|
|
end,
|
|
|
|
on_rightclick = function(pos, node, clicker)
|
|
--[[
|
|
local clickername = clicker:get_player_name()
|
|
local meta = minetest.get_meta(pos)
|
|
--meta:set_string("infotext", modEUrn.translate("PUBLIC ATM\n* Save your money in the ATM, and withdraw your money in your Personal Safe or other ATM in the shops scattered around the map."))
|
|
local opentime = tonumber(meta:get_string("opentime")) or 0
|
|
local now = os.time() --Em milisegundos
|
|
if now >= opentime or modEUrn.canInteract(clickername) then
|
|
modEUrn.showAccountBank.inAtm(clickername, clickername)
|
|
else
|
|
--minetest.sound_play("sfx_failure", {object=clicker, max_hear_distance=5.0,})
|
|
modEUrn.doSoundPlayer(clickername, "sfx_failure", 5)
|
|
minetest.chat_send_player(clickername,
|
|
core.colorize("#00ff00", "["..modEUrn.translate("ATM").."]: ")
|
|
..modEUrn.translate(
|
|
"The ATM will only run %02d seconds after it is installed!"
|
|
):format(opentime - now)
|
|
)
|
|
end
|
|
--modEUrn.debug("on_rightclick() >>> "..modEUrn.getUrlDatabase())
|
|
--]]
|
|
end,
|
|
})
|