eurn/item_eurn.lua

61 lines
2.2 KiB
Lua
Raw Normal View History

2023-07-20 10:14:38 -03:00
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(),
2023-07-20 11:11:33 -03:00
drawtype = "nodebox",
2023-07-20 10:14:38 -03:00
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
},
--[[
2023-07-20 10:14:38 -03:00
on_place = function(itemstack, placer, pointed_thing)
return itemstack
end,
--]]
2023-07-20 10:14:38 -03:00
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,
})