Rounding of research amounts

This commit is contained in:
Anuken
2020-07-26 10:35:47 -04:00
parent 42d7eb4e05
commit 95f7fc1b3b
15 changed files with 60 additions and 22 deletions

View File

@@ -4,6 +4,7 @@ import arc.*;
import arc.math.*;
import arc.struct.*;
import arc.util.ArcAnnotate.*;
import mindustry.core.*;
import mindustry.ctype.*;
import mindustry.game.Objectives.*;
import mindustry.type.*;
@@ -431,7 +432,9 @@ public class TechTree implements ContentList{
requirements = new ItemStack[block.requirements.length];
for(int i = 0; i < requirements.length; i++){
requirements[i] = new ItemStack(block.requirements[i].item, 40 + Mathf.round(Mathf.pow(block.requirements[i].amount, 1.25f) * 20, 10));
int quantity = 40 + Mathf.round(Mathf.pow(block.requirements[i].amount, 1.25f) * 20, 10);
requirements[i] = new ItemStack(block.requirements[i].item, UI.roundAmount(quantity));
}
}else{
requirements = ItemStack.empty;