Compare commits

...
2 Commits
Author SHA1 Message Date
adminandClaude Opus 4.5 c8a7992eb0 Fix support=0 not being applied to weak King provinces
The conditional `if po.support > 0` prevented explicitly setting
support to 0. Now support always uses the JSON value directly.
Provinces 37 and 40 already have their support values specified.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-25 17:49:26 -08:00
adminandClaude Opus 4.5 03b864b1e3 Simplify tutorial battle: no attackers can flee
Remove the special case that allowed Ikhaan Tarn to flee.
Now all units in the tutorial battle must fight to the end.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-25 17:36:18 -08:00
2 changed files with 3 additions and 14 deletions
@@ -19,15 +19,10 @@ import net.eagle0.eagle.model.state.{
MovingArmy,
Supplies
}
import net.eagle0.util.hero_generation.LoadedHero
object RequestBattlesAction {
/** Hero IDs used for tutorial reinforcements. These are hardcoded to avoid conflicts with regular hero IDs. */
val TutorialReinforcementHeroIds: Set[Int] = Set(100, 101)
/** Name text ID for Ikhaan Tarn, who is the only unit that can flee in the tutorial battle */
val TarnNameTextId: String = LoadedHero.nameTextId("Ikhaan Tarn")
}
import net.eagle0.eagle.model.state.battalion.BattalionT
import net.eagle0.eagle.model.state.faction.FactionT
@@ -105,14 +100,8 @@ case class RequestBattlesAction(
if gameType == GameType.Tutorial then RequestBattlesAction.TutorialReinforcementHeroIds
else Set.empty[Int]
// For tutorial games, only Ikhaan Tarn can flee - all other units cannot
val canFleeHeroIds =
if gameType == GameType.Tutorial then
heroes.values
.find(_.nameTextId == RequestBattlesAction.TarnNameTextId)
.map(_.id)
.toSet
else Set.empty[Int]
// For tutorial games, no units can flee
val canFleeHeroIds = Set.empty[Int]
ActionResultC(
actionResultType = StartBattle,
@@ -143,7 +143,7 @@ object TutorialGameCreation {
provinceOrders = ProvinceOrderTypeConverter.fromProto(po.orders),
gold = po.gold,
food = po.food,
support = if po.support > 0 then po.support else baseProvince.support,
support = po.support,
economy = if po.economy > 0 then po.economy else baseProvince.economy,
agriculture = if po.agriculture > 0 then po.agriculture else baseProvince.agriculture,
infrastructure = if po.infrastructure > 0 then po.infrastructure else baseProvince.infrastructure