mirror of
https://github.com/exituser/Brewery.git
synced 2026-09-17 08:59:01 +00:00
Reduced Difficulty for small Ingredient amounts
This commit is contained in:
@@ -226,7 +226,7 @@ public class BIngredients {
|
||||
badStuff++;
|
||||
if (badStuff < ingredients.size()) {
|
||||
// when there are other ingredients
|
||||
quality -= count * 2;
|
||||
quality -= count * (recipe.getDifficulty() / 2);
|
||||
continue;
|
||||
} else {
|
||||
// ingredients dont fit at all
|
||||
@@ -234,7 +234,7 @@ public class BIngredients {
|
||||
}
|
||||
}
|
||||
// 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) {
|
||||
return Math.round(quality);
|
||||
|
||||
@@ -47,7 +47,11 @@ public class BRecipe {
|
||||
for (String effectString : effectStringList) {
|
||||
String[] effectSplit = effectString.split("/");
|
||||
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
|
||||
effect = effect + "X";
|
||||
}
|
||||
@@ -62,6 +66,9 @@ public class BRecipe {
|
||||
|
||||
// allowed deviation to the recipes count of ingredients at the given difficulty
|
||||
public int allowedCountDiff(int count) {
|
||||
if (count < 8) {
|
||||
count = 8;
|
||||
}
|
||||
int allowedCountDiff = Math.round((float) ((11.0 - difficulty) * (count / 10.0)));
|
||||
|
||||
if (allowedCountDiff == 0) {
|
||||
|
||||
Reference in New Issue
Block a user