use of main.content.enums.entity.UnitEnums.COUNTER_INTERACTION in project Eidolons by IDemiurge.
the class CounterMasterAdvanced method afterRoundEnds.
public static void afterRoundEnds(Unit unit) {
// some interactions should happen immediately - e.g. moist vs blaze
// so we need to Interact, Convert and Transfer... what's the order? probably exactly that!
Map<COUNTER, Integer> map = createCounterMap(unit);
map.forEach((counter, value) -> map.forEach((counter2, value2) -> {
if (counter != counter2) {
COUNTER_INTERACTION interaction = getInteraction(counter, counter2);
int max = getMaxInteractionValue(unit, counter, counter2, value, value2);
interact(counter, counter2, interaction, max, unit);
}
}));
Map<COUNTER, Integer> convertMap = createCounterMap(unit);
map.forEach((counter, value) -> {
COUNTER counter2 = getConvertion(counter);
int max = getMaxConvertionValue(unit, counter, counter2, value);
convertCounters(counter, counter2, max, unit);
});
Map<COUNTER, Integer> transferMap = createCounterMap(unit);
map.forEach((counter, value) -> map.forEach((counter2, value2) -> {
if (counter != counter2) {
COUNTER_INTERACTION interaction = getInteraction(counter, counter2);
int max = getMaxInteractionValue(unit, counter, counter2, value, value2);
interact(counter, counter2, interaction, max, unit);
}
}));
}
Aggregations