use of mcjty.rftoolsdim.dimensions.dimlets.types.DimletType in project RFToolsDimensions by McJty.
the class KnownDimletConfiguration method getRandomPartLists.
public static List<List<ItemStack>> getRandomPartLists() {
if (randomPartLists == null) {
randomPartLists = new ArrayList<>();
randomPartLists.add(Lists.newArrayList(new ItemStack(ModItems.dimletBaseItem), new ItemStack(ModItems.dimletControlCircuitItem, 1, 0), new ItemStack(ModItems.dimletEnergyModuleItem)));
randomPartLists.add(Lists.newArrayList(new ItemStack(ModItems.dimletControlCircuitItem, 1, 1), new ItemStack(ModItems.dimletEnergyModuleItem, 1, 0), new ItemStack(ModItems.dimletMemoryUnitItem, 1, 0)));
randomPartLists.add(Lists.newArrayList(new ItemStack(ModItems.dimletControlCircuitItem, 1, 2)));
ArrayList<ItemStack> list3 = Lists.newArrayList(new ItemStack(ModItems.dimletControlCircuitItem, 1, 3), new ItemStack(ModItems.dimletEnergyModuleItem, 1, 1), new ItemStack(ModItems.dimletMemoryUnitItem, 1, 1));
for (DimletType type : DimletType.values()) {
list3.add(new ItemStack(ModItems.dimletTypeControllerItem, 1, type.ordinal()));
}
randomPartLists.add(list3);
randomPartLists.add(Lists.newArrayList(new ItemStack(ModItems.dimletControlCircuitItem, 1, 4)));
randomPartLists.add(Lists.newArrayList(new ItemStack(ModItems.dimletControlCircuitItem, 1, 5), new ItemStack(ModItems.dimletEnergyModuleItem, 1, 2), new ItemStack(ModItems.dimletMemoryUnitItem, 1, 2)));
randomPartLists.add(Lists.newArrayList(new ItemStack(ModItems.dimletControlCircuitItem, 1, 6)));
}
return randomPartLists;
}
use of mcjty.rftoolsdim.dimensions.dimlets.types.DimletType in project RFToolsDimensions by McJty.
the class DimensionDescriptor method calculateBonus.
private int calculateBonus(List<Pair<DimletKey, List<DimletKey>>> dimlets) {
int rfGain = 0;
for (Pair<DimletKey, List<DimletKey>> dimletWithModifier : dimlets) {
DimletKey key = dimletWithModifier.getLeft();
DimletType type = key.getType();
int c = getMaintenanceCost(type, key);
if (c < 0) {
// This dimlet gives a bonus in cost. This value is a percentage.
rfGain -= c;
}
}
return rfGain;
}
use of mcjty.rftoolsdim.dimensions.dimlets.types.DimletType in project RFToolsDimensions by McJty.
the class DimensionDescriptor method calculateTickCost.
private int calculateTickCost(List<Pair<DimletKey, List<DimletKey>>> dimlets) {
int ticks = DimletCosts.baseDimensionTickCost;
for (Pair<DimletKey, List<DimletKey>> dimletWithModifier : dimlets) {
DimletKey key = dimletWithModifier.getLeft();
DimletType type = key.getType();
List<DimletKey> list = dimletWithModifier.getRight();
if (list != null) {
for (DimletKey modifier : list) {
float mult = type.dimletType.getModifierTickCostFactor(modifier.getType(), key);
ticks += (int) (getTickCost(modifier.getType(), modifier) * mult);
}
}
ticks += getTickCost(type, key);
}
return ticks;
}
use of mcjty.rftoolsdim.dimensions.dimlets.types.DimletType in project RFToolsDimensions by McJty.
the class DimensionDescriptor method calculateMaintenanceRfCost.
// Calculate the maintenance cost of a dimension without bonus dimlets.
private int calculateMaintenanceRfCost(List<Pair<DimletKey, List<DimletKey>>> dimlets) {
int rf = DimletCosts.baseDimensionMaintenanceCost;
for (Pair<DimletKey, List<DimletKey>> dimletWithModifier : dimlets) {
DimletKey key = dimletWithModifier.getLeft();
DimletType type = key.getType();
List<DimletKey> list = dimletWithModifier.getRight();
if (list != null) {
for (DimletKey modifier : list) {
float mult = type.dimletType.getModifierMaintainCostFactor(modifier.getType(), key);
rf += (int) (getMaintenanceCost(modifier.getType(), modifier) * mult);
}
}
int c = getMaintenanceCost(type, key);
if (c > 0) {
rf += c;
}
}
return rf;
}
Aggregations