From 873c4c719875e64421ca5b67d6b1a0b3a3dda7e5 Mon Sep 17 00:00:00 2001 From: Mike Stump Date: Wed, 10 Jan 2024 11:24:26 -0800 Subject: [PATCH] Make power for remote account for distance from controller. --- modules/storage/remote.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/storage/remote.lua b/modules/storage/remote.lua index f3e441c..cc528ff 100644 --- a/modules/storage/remote.lua +++ b/modules/storage/remote.lua @@ -140,7 +140,9 @@ minetest.register_tool("microexpansion:remote", { end local net,cpos = me.get_connected_network(pos) - local charge_to_take = 100 + -- 25 to 1062 eu per operation, rich people pay for distance. + local distance = vector.distance(net.controller_pos, user:get_pos()) + local charge_to_take = math.pow(math.log(distance),2) * 10 if toolmeta.charge < charge_to_take then minetest.chat_send_player(user:get_player_name(), "No power left, recharge in technic battery.")