mirror of
https://github.com/GTNewHorizons/Binnie.git
synced 2026-11-22 05:02:34 +00:00
Fix Additive Production (#33)
* Fix production modifiers to be additive, fix circuit tooltips for mutation and boolean modifiers * Chocolate frames have left the building kuba told me to kill them * Bruhhhhhhhhhhhh
This commit is contained in:
1 parent
f658e9ec57
commit
22f2eebbd3
11 files changed
+87
-40
No files matched your search
@@ -16,24 +16,40 @@ public class BeeModifierLogic {
|
||||
}
|
||||
|
||||
public float getModifier(EnumBeeModifier modifier, float currentModifier) {
|
||||
if (!modifiers.containsKey(modifier)) {
|
||||
return 1.0f;
|
||||
}
|
||||
|
||||
Float[] values = modifiers.get(modifier);
|
||||
float mult = values[0];
|
||||
float max = values[1];
|
||||
if (max >= 1.0f) {
|
||||
if (max <= currentModifier) {
|
||||
if (modifier == EnumBeeModifier.PRODUCTION) {
|
||||
if (!modifiers.containsKey(modifier)) {
|
||||
return 0.0f;
|
||||
}
|
||||
Float[] values = modifiers.get(modifier);
|
||||
float offset = values[0], max = values[1];
|
||||
if (offset < 0) {// negative modifiers should always apply
|
||||
return offset;
|
||||
}
|
||||
if (currentModifier >= max) {// don't decrease modifiers already over the max, just skip increasing it
|
||||
return 0.0f;
|
||||
}
|
||||
return Math.min(offset, max - currentModifier);
|
||||
} else {
|
||||
if (!modifiers.containsKey(modifier)) {
|
||||
return 1.0f;
|
||||
}
|
||||
return Math.min(max / currentModifier, mult);
|
||||
|
||||
Float[] values = modifiers.get(modifier);
|
||||
float mult = values[0];
|
||||
float max = values[1];
|
||||
if (max >= 1.0f) {
|
||||
if (max <= currentModifier) {
|
||||
return 1.0f;
|
||||
}
|
||||
return Math.min(max / currentModifier, mult);
|
||||
}
|
||||
|
||||
if (max >= currentModifier) {
|
||||
return 1.0f;
|
||||
}
|
||||
return Math.max(max / currentModifier, mult);
|
||||
}
|
||||
|
||||
if (max >= currentModifier) {
|
||||
return 1.0f;
|
||||
}
|
||||
return Math.max(max / currentModifier, mult);
|
||||
}
|
||||
|
||||
public boolean getModifier(EnumBeeBooleanModifier modifier) {
|
||||
|
||||
@@ -1,8 +1,15 @@
|
||||
package binnie.core.genetics;
|
||||
|
||||
import binnie.core.util.I18N;
|
||||
|
||||
public enum EnumBeeBooleanModifier {
|
||||
|
||||
SEALED,
|
||||
SELF_LIGHTED,
|
||||
SUNLIGHT_STIMULATED,
|
||||
HELLISH
|
||||
HELLISH;
|
||||
|
||||
public String getName() {
|
||||
return I18N.localise("binniecore.beebooleanmodifier." + name().toLowerCase());
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user