mirror of
https://github.com/nolen777/eagle0.git
synced 2026-07-28 20:55:44 +00:00
Space attack ready tutorial guidance (#8685)
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user