mirror of
https://github.com/exituser/Brewery.git
synced 2026-09-17 05:28:59 +00:00
Reduced Difficulty for small Ingredient amounts
This commit is contained in:
@@ -226,7 +226,7 @@ public class BIngredients {
|
|||||||
badStuff++;
|
badStuff++;
|
||||||
if (badStuff < ingredients.size()) {
|
if (badStuff < ingredients.size()) {
|
||||||
// when there are other ingredients
|
// when there are other ingredients
|
||||||
quality -= count * 2;
|
quality -= count * (recipe.getDifficulty() / 2);
|
||||||
continue;
|
continue;
|
||||||
} else {
|
} else {
|
||||||
// ingredients dont fit at all
|
// ingredients dont fit at all
|
||||||
@@ -234,7 +234,7 @@ public class BIngredients {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// calculate the quality
|
// calculate the quality
|
||||||
quality -= (((float) Math.abs(count - recipe.amountOf(ingredient)) / recipe.allowedCountDiff(recipe.amountOf(ingredient))) * 10.0);
|
quality -= ((float) Math.abs(count - recipe.amountOf(ingredient)) / recipe.allowedCountDiff(recipe.amountOf(ingredient))) * 10.0;
|
||||||
}
|
}
|
||||||
if (quality >= 0) {
|
if (quality >= 0) {
|
||||||
return Math.round(quality);
|
return Math.round(quality);
|
||||||
|
|||||||
@@ -47,7 +47,11 @@ public class BRecipe {
|
|||||||
for (String effectString : effectStringList) {
|
for (String effectString : effectStringList) {
|
||||||
String[] effectSplit = effectString.split("/");
|
String[] effectSplit = effectString.split("/");
|
||||||
String effect = effectSplit[0];
|
String effect = effectSplit[0];
|
||||||
if (effect.equalsIgnoreCase("WEAKNESS") || effect.equalsIgnoreCase("INCREASE_DAMAGE") || effect.equalsIgnoreCase("SLOW") || effect.equalsIgnoreCase("SPEED") || effect.equalsIgnoreCase("REGERATION")) {
|
if (effect.equalsIgnoreCase("WEAKNESS") ||
|
||||||
|
effect.equalsIgnoreCase("INCREASE_DAMAGE") ||
|
||||||
|
effect.equalsIgnoreCase("SLOW") ||
|
||||||
|
effect.equalsIgnoreCase("SPEED") ||
|
||||||
|
effect.equalsIgnoreCase("REGENERATION")) {
|
||||||
// hide these effects as they put crap into lore
|
// hide these effects as they put crap into lore
|
||||||
effect = effect + "X";
|
effect = effect + "X";
|
||||||
}
|
}
|
||||||
@@ -62,6 +66,9 @@ public class BRecipe {
|
|||||||
|
|
||||||
// allowed deviation to the recipes count of ingredients at the given difficulty
|
// allowed deviation to the recipes count of ingredients at the given difficulty
|
||||||
public int allowedCountDiff(int count) {
|
public int allowedCountDiff(int count) {
|
||||||
|
if (count < 8) {
|
||||||
|
count = 8;
|
||||||
|
}
|
||||||
int allowedCountDiff = Math.round((float) ((11.0 - difficulty) * (count / 10.0)));
|
int allowedCountDiff = Math.round((float) ((11.0 - difficulty) * (count / 10.0)));
|
||||||
|
|
||||||
if (allowedCountDiff == 0) {
|
if (allowedCountDiff == 0) {
|
||||||
|
|||||||
Reference in New Issue
Block a user