From 121afdcd3f48b81599ef06e82c3f3d2288c8552c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20P=C3=A9rez-Cerezo?= Date: Sat, 3 Jun 2017 11:51:29 +0200 Subject: Replace interest with basic income, add starting amount of 30 minegeld. --- init.lua | 2 +- interest.lua | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/init.lua b/init.lua index 98dda29..3dab5fd 100644 --- a/init.lua +++ b/init.lua @@ -7,7 +7,7 @@ local modpath = minetest.get_modpath("atm") function atm.showform (player) atm.readaccounts() if not atm.balance[player:get_player_name()] then - atm.balance[player:get_player_name()] = 0 + atm.balance[player:get_player_name()] = 30 end local formspec = "size[8,8.5]".. diff --git a/interest.lua b/interest.lua index b8f8d0c..d1d7980 100644 --- a/interest.lua +++ b/interest.lua @@ -2,13 +2,13 @@ local timer = 0 minetest.register_globalstep(function(dtime) timer = timer + dtime; - if timer >= 3000 then + if timer >= 1000 then timer = 0 atm.readaccounts() for _,player in ipairs(minetest.get_connected_players()) do local name = player:get_player_name() if not (atm.balance[name] == nil) then - atm.balance[name] = math.floor(atm.balance[name] * 1.05) + atm.balance[name] = math.floor(atm.balance[name] + 5) end end atm.saveaccounts() -- cgit v1.2.3