Research system changes, unfinished

This commit is contained in:
Anuken
2020-11-14 13:36:43 -05:00
parent 7559996227
commit c96f4609d0
15 changed files with 246 additions and 149 deletions

View File

@@ -617,7 +617,7 @@ public class Block extends UnlockableContent{
public ItemStack[] researchRequirements(){
ItemStack[] out = new ItemStack[requirements.length];
for(int i = 0; i < out.length; i++){
int quantity = 60 + Mathf.round(Mathf.pow(requirements[i].amount, 1.11f) * 20 * researchCostMultiplier, 10);
int quantity = 60 + Mathf.round(Mathf.pow(requirements[i].amount, 1.13f) * 20 * researchCostMultiplier, 10);
out[i] = new ItemStack(requirements[i].item, UI.roundAmount(quantity));
}
@@ -631,6 +631,19 @@ public class Block extends UnlockableContent{
for(ItemStack stack : requirements){
cons.get(stack.item);
}
if(consumes.any()){
//also requires inputs
for(Consume c : consumes.all()){
if(c instanceof ConsumeItems i){
for(ItemStack stack : i.items){
cons.get(stack.item);
}
}else if(c instanceof ConsumeLiquid i){
cons.get(i.liquid);
}
}
}
}
@Override

View File

@@ -101,6 +101,7 @@ public class Consumers{
return (T)map[type.ordinal()];
}
@Nullable
public Consume[] all(){
return results;
}