mirror of
https://github.com/theFox6/microexpansion.git
synced 2024-11-23 07:33:44 +01:00
Make power for remote account for distance from controller.
This commit is contained in:
parent
e6ffb906e4
commit
873c4c7198
@ -140,7 +140,9 @@ minetest.register_tool("microexpansion:remote", {
|
|||||||
end
|
end
|
||||||
local net,cpos = me.get_connected_network(pos)
|
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
|
if toolmeta.charge < charge_to_take then
|
||||||
minetest.chat_send_player(user:get_player_name(), "No power left, recharge in technic battery.")
|
minetest.chat_send_player(user:get_player_name(), "No power left, recharge in technic battery.")
|
||||||
|
Loading…
Reference in New Issue
Block a user