Lower high loyalty display threshold (#8767)

This commit is contained in:
2026-07-24 07:14:59 -07:00
committed by GitHub
parent a588c2dd9c
commit a148a8a2a3
3 changed files with 19 additions and 1 deletions
@@ -124,7 +124,7 @@ object HeroUtils {
scWithRanges(
hero.loyalty.floor.toInt,
minMedium = 50,
minHigh = 80
minHigh = 71
)
)
@@ -12,5 +12,6 @@ scala_test(
"//src/main/scala/net/eagle0/eagle/model/state/faction/concrete",
"//src/main/scala/net/eagle0/eagle/model/state/hero",
"//src/main/scala/net/eagle0/eagle/model/state/hero/concrete",
"//src/main/scala/net/eagle0/eagle/model/view/stat_with_condition",
],
)
@@ -9,6 +9,7 @@ import net.eagle0.eagle.library.settings.{
import net.eagle0.eagle.model.state.faction.concrete.FactionC
import net.eagle0.eagle.model.state.hero.concrete.HeroC
import net.eagle0.eagle.model.state.hero.Profession.{Mage, NoProfession}
import net.eagle0.eagle.model.view.stat_with_condition.{Condition, StatWithCondition}
import org.scalatest.flatspec.AnyFlatSpec
import org.scalatest.matchers.should.Matchers
import org.scalatest.BeforeAndAfterEach
@@ -92,4 +93,20 @@ class HeroUtilsTest extends AnyFlatSpec with Matchers with BeforeAndAfterEach {
val hero = HeroC(id = 1, agility = 50, wisdom = 50, profession = NoProfession)
HeroUtils.startFireCapable(hero) shouldBe false
}
"loyaltyAsStatWithCondition" should "classify loyalty 70 as medium" in {
val hero = HeroC(id = vassalId, loyalty = 70, profession = NoProfession)
HeroUtils.loyaltyAsStatWithCondition(hero, Vector(faction)) should contain(
StatWithCondition(stat = 70, condition = Condition.Medium)
)
}
it should "classify loyalty 71 as high" in {
val hero = HeroC(id = vassalId, loyalty = 71, profession = NoProfession)
HeroUtils.loyaltyAsStatWithCondition(hero, Vector(faction)) should contain(
StatWithCondition(stat = 71, condition = Condition.High)
)
}
}