Space attack ready tutorial guidance (#8685)

This commit is contained in:
2026-07-17 15:59:09 -07:00
committed by GitHub
parent 4506ea2672
commit fe4e205a07
2 changed files with 13 additions and 2 deletions
@@ -128,7 +128,7 @@ object StrategicTutorialDialogueSelector {
TutorialDialogueContent.attackPrepareTrainDialogueId,
TutorialDialogueContent.attackPrepareArmDialogueId
) &&
wasEmittedBeforeRound(
wasEmittedAtLeastOneFullRoundAgo(
startingState,
TutorialDialogueContent.attackPrepareArmDialogueId,
after.currentRoundId
@@ -157,6 +157,9 @@ object StrategicTutorialDialogueSelector {
private def wasEmittedBeforeRound(state: GameState, dialogueId: String, roundId: Int): Boolean =
state.tutorialState.flatMap(_.emittedRound(dialogueId)).exists(_ < roundId)
private def wasEmittedAtLeastOneFullRoundAgo(state: GameState, dialogueId: String, roundId: Int): Boolean =
state.tutorialState.flatMap(_.emittedRound(dialogueId)).exists(_ <= roundId - 2)
private def shouldOfferPostBattleAlms(before: GameState, after: GameState): Boolean =
before.tutorialState
.flatMap(_.emittedRound(TutorialDialogueContent.postBattleRebuildDialogueId))
@@ -753,7 +753,8 @@ class StrategicTutorialDialogueSelectorTest extends AnyFlatSpec with Matchers {
TutorialDialogueContent.attackPrepareTrainDialogueId,
TutorialDialogueContent.attackPrepareArmDialogueId
)
val throughArm = throughArmSameRound.copy(currentRoundId = 2)
val throughArmNextRound = throughArmSameRound.copy(currentRoundId = 2)
val throughArm = throughArmSameRound.copy(currentRoundId = 3)
val undeveloped = throughArm.copy(
provinces = throughArm.provinces.updated(OnmaaId, borderProvince.copy(support = 39))
)
@@ -778,6 +779,13 @@ class StrategicTutorialDialogueSelectorTest extends AnyFlatSpec with Matchers {
actingFactionId = Some(PlayerFactionId),
provinceId = Some(OnmaaId)
) should not contain TutorialDialogueContent.attackReadyDialogueId
selectedIds(
throughArmNextRound,
throughArmNextRound,
ActionResultType.ArmTroops,
actingFactionId = Some(PlayerFactionId),
provinceId = Some(OnmaaId)
) should not contain TutorialDialogueContent.attackReadyDialogueId
selectedIds(
throughArm,
throughArm,