Esempio n. 1
0
    public void CombatShouldWorkWithTwoOpponentsAndSequentialTurns()
    {
        Globals.Config.ConcurrentTurnsEnabled = false;
        SetupScenarioForTwoZombies(out var zombie1, out var zombie2);

        // The zombies should not perform simultaneously
        GameSystems.D20.Actions.isSimultPerformer(zombie1).Should().BeFalse();
        GameSystems.D20.Actions.isSimultPerformer(zombie2).Should().BeFalse();

        // It should be zombie1's turn, run the game until it's zombie2's turn and check what zombie1 did
        GameSystems.D20.Initiative.CurrentActor.Should().Be(zombie1);
        Game.RunUntil(() => GameSystems.D20.Initiative.CurrentActor == zombie2, 10000);
        CompletedActions.Should()
        .HaveCount(1)
        .And.Contain(action => action.d20APerformer == zombie1 &&
                     action.d20ATarget == _player &&
                     action.d20ActType == D20ActionType.MOVE);
        ActionLog.Clear();

        // Now it's zombie2's turn, run until it's the player's turn and check what zombie2 did
        Game.RunUntil(() => GameSystems.D20.Initiative.CurrentActor == _player, 10000);
        CompletedActions.Should()
        .HaveCount(1)
        .And.Contain(action => action.d20APerformer == zombie2 &&
                     action.d20ATarget == _player &&
                     action.d20ActType == D20ActionType.MOVE);

        // Since both zombies just moved, there should be no combat entries
        CombatLog.Should().BeEmpty();
    }
Esempio n. 2
0
 private async void ReadActionLog()
 {
     ActionLog.Clear();
 }