:global double resources_tier_10
:global double resources_tier_9
:global double resources_tier_8
:global double resources_tier_7
:global double resources_tier_6
:global double resources_tier_5
:global double resources_tier_4
:global double resources_tier_3
:global double resources_tier_2
:global double resources_tier_1
resources_tier_10 = max(0.0,count("ingot",10) + double.max(0.0, count("dust", 10)) + count("ore",10) + (count("lump",9) * 2.0) - 1.0)
resources_tier_9 = max(0.0,count("ingot",9) + double.max(0.0, count("dust", 9)) + count("ore",9) + (count("lump",8) * 2.0) - 1.0)
resources_tier_8 = max(0.0,count("ingot",8) + double.max(0.0, count("dust", 8)) + count("ore",8) + (count("lump",7) * 2.0) - 1.0)
resources_tier_7 = max(0.0,count("ingot",7) + double.max(0.0, count("dust", 7)) + count("ore",7) + (count("lump",6) * 2.0) - 1.0)
resources_tier_6 = max(0.0,count("ingot",6) + double.max(0.0, count("dust", 6)) + count("ore",6) + (count("lump",5) * 2.0) - 1.0)
resources_tier_5 = max(0.0,count("ingot",5) + double.max(0.0, count("dust", 5)) + count("ore",5) + (count("lump",4) * 2.0) - 1.0)
resources_tier_4 = max(0.0,count("ingot",4) + double.max(0.0, count("dust", 4)) + count("ore",4) + (count("lump",3) * 2.0) - 1.0)
resources_tier_3 = max(0.0,count("ingot",3) + double.max(0.0, count("dust", 3)) + count("ore",3) + (count("lump",2) * 2.0) - 1.0)
resources_tier_2 = max(0.0,count("ingot",2) + double.max(0.0, count("dust", 2)) + count("ore",2) + (count("lump",1) * 2.0) - 1.0)
resources_tier_1 = max(0.0,count("ingot",1) + double.max(0.0, count("dust", 1)) + count("ore",1) - 1.0)