Initial Ascend Ailments implementation
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
package net.fretux.ailments.api;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertFalse;
|
||||
import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
|
||||
class AilmentApplicationTest {
|
||||
@Test void timedApplicationRetainsPublicParameters() {
|
||||
AilmentApplication application = AilmentApplication.timed(AilmentType.TAUNT, 100, 2);
|
||||
assertEquals(AilmentType.TAUNT, application.type());
|
||||
assertEquals(100, application.durationTicks());
|
||||
assertEquals(2, application.amplifier());
|
||||
assertFalse(application.isStacking());
|
||||
}
|
||||
|
||||
@Test void stackingIsOnlyAvailableForStackableAilments() {
|
||||
assertTrue(AilmentApplication.stack(AilmentType.BLEED).isStacking());
|
||||
assertTrue(AilmentApplication.stack(AilmentType.SOUL_ROT).isStacking());
|
||||
assertTrue(AilmentApplication.stack(AilmentType.FRACTURE).isStacking());
|
||||
assertThrows(IllegalArgumentException.class, () -> AilmentApplication.stack(AilmentType.FEAR));
|
||||
}
|
||||
|
||||
@Test void timedApplicationRejectsInvalidValues() {
|
||||
assertThrows(IllegalArgumentException.class,
|
||||
() -> AilmentApplication.timed(AilmentType.CHARM, 0, 0));
|
||||
assertThrows(IllegalArgumentException.class,
|
||||
() -> AilmentApplication.timed(AilmentType.CHARM, 20, -1));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package net.fretux.ailments.api;
|
||||
|
||||
import net.fretux.ailments.compat.AscendCompat;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
class AilmentScalingTest {
|
||||
@Test void durationCurveMatchesBalanceTargets() {
|
||||
assertEquals(1.00, AilmentScaling.getDurationMultiplierForArcane(0), 0.001);
|
||||
assertEquals(1.08, AilmentScaling.getDurationMultiplierForArcane(20), 0.01);
|
||||
assertEquals(1.15, AilmentScaling.getDurationMultiplierForArcane(40), 0.01);
|
||||
assertEquals(1.21, AilmentScaling.getDurationMultiplierForArcane(60), 0.011);
|
||||
assertEquals(1.26, AilmentScaling.getDurationMultiplierForArcane(80), 0.011);
|
||||
assertEquals(1.30, AilmentScaling.getDurationMultiplierForArcane(100), 0.001);
|
||||
assertEquals(1.30, AilmentScaling.getDurationMultiplierForArcane(500), 0.001);
|
||||
}
|
||||
|
||||
@Test void absentAscendAndNullSourceAreSafeDefaults() {
|
||||
assertDoesNotThrow(() -> AscendCompat.getArcane(null));
|
||||
assertEquals(0, AscendCompat.getArcane(null));
|
||||
assertEquals(1.0, AilmentScaling.getDurationMultiplier(null), 0.0);
|
||||
assertEquals(160, AilmentScaling.scaleDuration(160, null));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package net.fretux.ailments.api;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
|
||||
class HemorrhageScalingTest {
|
||||
@Test void bleedPotencyAndHemorrhageRateIncreaseWithArcane() {
|
||||
double zeroArcane = AilmentScaling.getPotencyMultiplierForArcane(0, AilmentType.BLEED);
|
||||
double highArcane = AilmentScaling.getPotencyMultiplierForArcane(100, AilmentType.BLEED);
|
||||
assertTrue(highArcane > zeroArcane);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user