mirror of
https://github.com/DieReicheErethons/Brewery.git
synced 2025-02-03 23:11:19 +01:00
Also for small cooking time
This commit is contained in:
parent
c748e0b7b5
commit
b09131c2e0
@ -247,6 +247,9 @@ public class BIngredients {
|
|||||||
if (!recipe.needsDistilling() == distilled) {
|
if (!recipe.needsDistilling() == distilled) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
if (cookedTime <= 1) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
int quality = 10 - (int) Math.round(((float) Math.abs(cookedTime - recipe.getCookingTime()) / recipe.allowedTimeDiff(recipe.getCookingTime())) * 10.0);
|
int quality = 10 - (int) Math.round(((float) Math.abs(cookedTime - recipe.getCookingTime()) / recipe.allowedTimeDiff(recipe.getCookingTime())) * 10.0);
|
||||||
|
|
||||||
if (quality > 0) {
|
if (quality > 0) {
|
||||||
|
@ -79,11 +79,11 @@ public class BRecipe {
|
|||||||
|
|
||||||
// allowed deviation to the recipes cooking-time at the given difficulty
|
// allowed deviation to the recipes cooking-time at the given difficulty
|
||||||
public int allowedTimeDiff(int time) {
|
public int allowedTimeDiff(int time) {
|
||||||
|
if (time < 8) {
|
||||||
|
time = 8;
|
||||||
|
}
|
||||||
int allowedTimeDiff = Math.round((float) ((11.0 - difficulty) * (time / 10.0)));
|
int allowedTimeDiff = Math.round((float) ((11.0 - difficulty) * (time / 10.0)));
|
||||||
|
|
||||||
while (allowedTimeDiff >= time) {
|
|
||||||
allowedTimeDiff -= 1;
|
|
||||||
}
|
|
||||||
if (allowedTimeDiff == 0) {
|
if (allowedTimeDiff == 0) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user