mirror of
https://github.com/mt-mods/currency.git
synced 2024-11-26 06:13:44 +01:00
indenting: spaces -> tabs
This commit is contained in:
parent
3210e9f687
commit
3e2fc7be7b
@ -93,13 +93,13 @@ barter.chest.exchange = function(meta)
|
||||
end
|
||||
|
||||
minetest.register_node("currency:barter", {
|
||||
drawtype = "nodebox",
|
||||
drawtype = "nodebox",
|
||||
description = S("Barter Table"),
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
tiles = {"barter_top.png",
|
||||
"barter_base.png",
|
||||
"barter_side.png"},
|
||||
"barter_base.png",
|
||||
"barter_side.png"},
|
||||
inventory_image = "barter_top.png",
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
|
@ -3,63 +3,63 @@ local MP = minetest.get_modpath(minetest.get_current_modname())
|
||||
local S, NS = dofile(MP.."/intllib.lua")
|
||||
|
||||
minetest.register_craftitem("currency:minegeld_cent_5", {
|
||||
description = S("5 Minegeld cent coin"),
|
||||
inventory_image = "minegeld_cent_5.png",
|
||||
stack_max = 1000,
|
||||
description = S("5 Minegeld cent coin"),
|
||||
inventory_image = "minegeld_cent_5.png",
|
||||
stack_max = 1000,
|
||||
groups = {minegeld = 1}
|
||||
})
|
||||
|
||||
minetest.register_craftitem("currency:minegeld_cent_10", {
|
||||
description = S("10 Minegeld cent coin"),
|
||||
inventory_image = "minegeld_cent_10.png",
|
||||
stack_max = 1000,
|
||||
description = S("10 Minegeld cent coin"),
|
||||
inventory_image = "minegeld_cent_10.png",
|
||||
stack_max = 1000,
|
||||
groups = {minegeld = 1}
|
||||
})
|
||||
|
||||
minetest.register_craftitem("currency:minegeld_cent_25", {
|
||||
description = S("25 Minegeld cent coin"),
|
||||
inventory_image = "minegeld_cent_25.png",
|
||||
stack_max = 1000,
|
||||
description = S("25 Minegeld cent coin"),
|
||||
inventory_image = "minegeld_cent_25.png",
|
||||
stack_max = 1000,
|
||||
groups = {minegeld = 1}
|
||||
})
|
||||
|
||||
minetest.register_craftitem("currency:minegeld", {
|
||||
description = S("1 Minegeld Note"),
|
||||
inventory_image = "minegeld.png",
|
||||
stack_max = 65535,
|
||||
description = S("1 Minegeld Note"),
|
||||
inventory_image = "minegeld.png",
|
||||
stack_max = 65535,
|
||||
groups = {minegeld = 1}
|
||||
})
|
||||
|
||||
minetest.register_craftitem("currency:minegeld_5", {
|
||||
description = S("5 Minegeld Note"),
|
||||
inventory_image = "minegeld_5.png",
|
||||
stack_max = 65535,
|
||||
description = S("5 Minegeld Note"),
|
||||
inventory_image = "minegeld_5.png",
|
||||
stack_max = 65535,
|
||||
groups = {minegeld = 1}
|
||||
})
|
||||
|
||||
minetest.register_craftitem("currency:minegeld_10", {
|
||||
description = S("10 Minegeld Note"),
|
||||
inventory_image = "minegeld_10.png",
|
||||
stack_max = 65535,
|
||||
description = S("10 Minegeld Note"),
|
||||
inventory_image = "minegeld_10.png",
|
||||
stack_max = 65535,
|
||||
groups = {minegeld = 1}
|
||||
})
|
||||
|
||||
minetest.register_craftitem("currency:minegeld_50", {
|
||||
description = S("50 Minegeld Note"),
|
||||
inventory_image = "minegeld_50.png",
|
||||
stack_max = 65535,
|
||||
description = S("50 Minegeld Note"),
|
||||
inventory_image = "minegeld_50.png",
|
||||
stack_max = 65535,
|
||||
groups = {minegeld = 1}
|
||||
})
|
||||
|
||||
minetest.register_craftitem("currency:minegeld_100", {
|
||||
description = S("100 Minegeld Note"),
|
||||
inventory_image = "minegeld_100.png",
|
||||
stack_max = 65535,
|
||||
description = S("100 Minegeld Note"),
|
||||
inventory_image = "minegeld_100.png",
|
||||
stack_max = 65535,
|
||||
groups = {minegeld = 1}
|
||||
})
|
||||
|
||||
minetest.register_craftitem("currency:minegeld_bundle", {
|
||||
description = S("Bundle of random Minegeld notes"),
|
||||
inventory_image = "minegeld_bundle.png",
|
||||
stack_max = 65535,
|
||||
description = S("Bundle of random Minegeld notes"),
|
||||
inventory_image = "minegeld_bundle.png",
|
||||
stack_max = 65535,
|
||||
})
|
||||
|
48
income.lua
48
income.lua
@ -6,33 +6,33 @@ local S, NS = dofile(MP.."/intllib.lua")
|
||||
|
||||
local timer = 0
|
||||
minetest.register_globalstep(function(dtime)
|
||||
timer = timer + dtime;
|
||||
if timer >= 720 then --720 for one day
|
||||
timer = 0
|
||||
for _,player in ipairs(minetest.get_connected_players()) do
|
||||
local name = player:get_player_name()
|
||||
if players_income[name] == nil then
|
||||
players_income[name] = 0
|
||||
end
|
||||
players_income[name] = 1
|
||||
minetest.log("info", "[Currency] "..S("basic income for @1", name))
|
||||
end
|
||||
end
|
||||
timer = timer + dtime;
|
||||
if timer >= 720 then --720 for one day
|
||||
timer = 0
|
||||
for _,player in ipairs(minetest.get_connected_players()) do
|
||||
local name = player:get_player_name()
|
||||
if players_income[name] == nil then
|
||||
players_income[name] = 0
|
||||
end
|
||||
players_income[name] = 1
|
||||
minetest.log("info", "[Currency] "..S("basic income for @1", name))
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
earn_income = function(player)
|
||||
if not player or player.is_fake_player then return end
|
||||
local name = player:get_player_name()
|
||||
if players_income[name] == nil then
|
||||
players_income[name] = 0
|
||||
end
|
||||
if players_income[name] > 0 then
|
||||
count = players_income[name]
|
||||
local inv = player:get_inventory()
|
||||
inv:add_item("main", {name="currency:minegeld_10", count=count})
|
||||
players_income[name] = 0
|
||||
minetest.log("info", "[Currency] "..S("added basic income for @1 to inventory", name))
|
||||
end
|
||||
if not player or player.is_fake_player then return end
|
||||
local name = player:get_player_name()
|
||||
if players_income[name] == nil then
|
||||
players_income[name] = 0
|
||||
end
|
||||
if players_income[name] > 0 then
|
||||
count = players_income[name]
|
||||
local inv = player:get_inventory()
|
||||
inv:add_item("main", {name="currency:minegeld_10", count=count})
|
||||
players_income[name] = 0
|
||||
minetest.log("info", "[Currency] "..S("added basic income for @1 to inventory", name))
|
||||
end
|
||||
end
|
||||
|
||||
minetest.register_on_dignode(function(pos, oldnode, digger)
|
||||
|
10
safe.lua
10
safe.lua
@ -33,7 +33,7 @@ minetest.register_node("currency:safe", {
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
tiles = {"safe_side.png",
|
||||
"safe_side.png",
|
||||
"safe_side.png",
|
||||
"safe_side.png",
|
||||
"safe_side.png",
|
||||
"safe_side.png",
|
||||
@ -66,7 +66,7 @@ minetest.register_node("currency:safe", {
|
||||
end
|
||||
return count
|
||||
end,
|
||||
allow_metadata_inventory_put = function(pos, listname, index, stack, player)
|
||||
allow_metadata_inventory_put = function(pos, listname, index, stack, player)
|
||||
local meta = minetest.get_meta(pos)
|
||||
if not has_safe_privilege(meta, player) then
|
||||
minetest.log("action", S("@1 tried to access a safe belonging to @2 at @3",
|
||||
@ -75,7 +75,7 @@ minetest.register_node("currency:safe", {
|
||||
end
|
||||
return stack:get_count()
|
||||
end,
|
||||
allow_metadata_inventory_take = function(pos, listname, index, stack, player)
|
||||
allow_metadata_inventory_take = function(pos, listname, index, stack, player)
|
||||
local meta = minetest.get_meta(pos)
|
||||
if not has_safe_privilege(meta, player) then
|
||||
minetest.log("action", S("@1 tried to access a safe belonging to @2 at @3",
|
||||
@ -87,10 +87,10 @@ minetest.register_node("currency:safe", {
|
||||
on_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
|
||||
minetest.log("action", S("@1 moves stuff in safe at @2", player:get_player_name(), minetest.pos_to_string(pos)))
|
||||
end,
|
||||
on_metadata_inventory_put = function(pos, listname, index, stack, player)
|
||||
on_metadata_inventory_put = function(pos, listname, index, stack, player)
|
||||
minetest.log("action", S("@1 moves stuff to safe at @2", player:get_player_name(), minetest.pos_to_string(pos)))
|
||||
end,
|
||||
on_metadata_inventory_take = function(pos, listname, index, stack, player)
|
||||
on_metadata_inventory_take = function(pos, listname, index, stack, player)
|
||||
minetest.log("action", S("@1 takes stuff from safe at @2", player:get_player_name(), minetest.pos_to_string(pos)))
|
||||
end,
|
||||
on_rightclick = function(pos, node, clicker)
|
||||
|
Loading…
Reference in New Issue
Block a user