Improvements

This commit is contained in:
2022-11-26 13:52:38 -05:00
parent 512918f24c
commit cf67a8046b
46 changed files with 56 additions and 79 deletions

View File

@@ -2,6 +2,8 @@ local modpath = minetest.get_modpath("ip_destruction_counter")
destruction_counter = {}
destruction_counter.nodesDestroyed = 0
destruction_counter.pigsKilled = 0
destruction_counter.peopleKilled = 0
local nodesDestroyedByHand = 0
local idText
@@ -51,7 +53,7 @@ function destruction_counter.updateCounter(player)
return
end
local totalDestruction = destruction_counter.nodesDestroyed + math.floor(nodesDestroyedByHand / 10)
local totalDestruction = destruction_counter.nodesDestroyed + destruction_counter.pigsKilled * 20 + destruction_counter.peopleKilled * 10 + math.floor(nodesDestroyedByHand / 10)
local percentage = (totalDestruction / 1000 * 4)
if percentage > 100 then
percentage = 100