Пример #1
0
        public void Setup()
        {
            _fighter = new TestHumanFighter("Hero", 1);
            _fighter.SetHealth(FighterHealth);
            _fighter.SetMana(FighterMana);
            _fighter.SetStrength(FighterAttack);
            _fighter.SetDefense(FighterDefense);
            _fighter.SetSpeed(FighterSpeed);
            _fighter.SetEvade(FighterEvade);
            _fighter.SetLuck(FighterLuck);

            _factoryFighter = (TestHumanFighter)TestFighterFactory.GetFighter(TestFighterType.TestHuman, 1, "Ted");
            _factoryFighter.AddSpell(SpellFactory.GetSpell(MagicType.Fire, 1));
            _enemy             = (TestEnemyFighter)TestFighterFactory.GetFighter(TestFighterType.TestEnemy, 1, "enemy");
            _armoredEnemy      = (TestEnemyFighter)TestFighterFactory.GetFighter(TestFighterType.TestEnemy, 1, "armored");
            _superArmoredEnemy = (TestEnemyFighter)TestFighterFactory.GetFighter(TestFighterType.TestEnemy, 1, "super armored");

            _input         = new MockInput();
            _output        = new MockOutput();
            _menuManager   = new TestMenuManager(_input, _output);
            _chanceService = new MockChanceService();

            _battleManager = new TestBattleManager(_chanceService, _input, _output);

            var humanTeam = new Team(_menuManager, _fighter);

            _battleManager.SetHumanTeam(humanTeam);

            var enemyTeam = new Team(_menuManager, _enemy);

            _battleManager.SetEnemyTeam(enemyTeam);

            _battleManager.SetConfig(new BattleManagerBattleConfiguration());
        }
        public void KilledEvent_CorrectlyThrowsException_BattleManagerSubscribestoNonFighrerEntity()
        {
            TestBattleManager testBattleManager = new TestBattleManager(_mockChanceService, _input, _output);

            testBattleManager.SetConfig(new BattleManagerBattleConfiguration());

            Assert.Throws <InvalidOperationException>(
                () => testBattleManager.TestPrintKilledMessage(_input, new KilledEventArgs()));
        }
Пример #3
0
        public void SetUp()
        {
            _chanceService = new MockChanceService();
            _output        = new MockOutput();
            _input         = new MockInput();

            _team1Fighter = (TestEnemyFighter)TestFighterFactory.GetFighter(TestFighterType.TestEnemy, 1);
            _team2Fighter = (TestEnemyFighter)TestFighterFactory.GetFighter(TestFighterType.TestEnemy, 1);

            _team1 = new Team(TestMenuManager.GetTestMenuManager(), _team1Fighter);
            _team2 = new Team(TestMenuManager.GetTestMenuManager(), _team2Fighter);

            _battleManager = new TestBattleManager(_chanceService, _input, _output);
        }
Пример #4
0
        public void Setup()
        {
            _input         = new MockInput();
            _output        = new MockOutput();
            _menuManager   = new TestMenuManager(_input, _output);
            _chanceService = new MockChanceService();
            _battleManager = new TestBattleManager(_chanceService, _input, _output);
            _logger        = new EventLogger();

            _humanFighter = new TestHumanFighter("foo", 1);
            _humanTeam    = new TestTeam(_humanFighter);

            _enemy     = (TestEnemyFighter)TestFighterFactory.GetFighter(TestFighterType.TestEnemy, 1);
            _enemyTeam = new Team(_menuManager, _enemy);
        }
Пример #5
0
        public void Setup()
        {
            _logger      = new EventLogger();
            _input       = new MockInput();
            _output      = new MockOutput();
            _menuManager = new TestMenuManager(_input, _output);

            _chanceService = new MockChanceService();
            TestFighterFactory.SetChanceService(_chanceService);

            _shade1 = (Shade)FighterFactory.GetFighter(FighterType.Shade, 1);
            _shade2 = (Shade)FighterFactory.GetFighter(FighterType.Shade, 1);
            _shade3 = (Shade)FighterFactory.GetFighter(FighterType.Shade, 1);
            _shades = new List <Shade> {
                _shade1, _shade2, _shade3
            };
            _shadeGrouping = new ShadeFighterGrouping(_chanceService, _shades.ToArray());
            _shadeTeam     = new Team(TestMenuManager.GetTestMenuManager(), _shadeGrouping);

            _humanFighter = (TestHumanFighter)TestFighterFactory.GetFighter(TestFighterType.TestHuman, 1);
            _humanFighter.SetSpeed(_shade1.Speed + 1);
            _humanTeam = new Team(_menuManager, _humanFighter);

            List <BattleMove> executableMoves = _shade1.GetExecutableMoves(_humanTeam);

            _absorptionMoveIndex    = executableMoves.FindIndex(bm => bm.MoveType == BattleMoveType.AbsorbShade);
            _malevolenceChargeIndex = executableMoves.FindIndex(bm => bm.MoveType == BattleMoveType.Special);
            _malevolenceAttackIndex = executableMoves.FindIndex(bm => bm.MoveType == BattleMoveType.ConditionalPowerAttack);
            _darkFogIndex           = executableMoves.FindIndex(bm => bm is StatusMove);

            _malevolenceChargeMove = executableMoves[_malevolenceChargeIndex];
            _malevolenceAttackMove = executableMoves[_malevolenceAttackIndex];
            _shadeAbsorbingMove    = executableMoves[_absorptionMoveIndex];

            Shade fooShade = new Shade(1, _chanceService, 1);
            Team  fooTeam  = new Team(TestMenuManager.GetTestMenuManager(), fooShade);

            fooShade.SetTeam(fooTeam);
            List <BattleMove> fooExecutableAttacks = fooShade.GetExecutableMoves(_humanTeam);

            _malevolenceAttackNoAbsorptionMoveIndex =
                fooExecutableAttacks.FindIndex(bm => bm.MoveType == BattleMoveType.ConditionalPowerAttack);
            _malevolenceChargeNoAbsorptionMoveIndex =
                fooExecutableAttacks.FindIndex(bm => bm.MoveType == BattleMoveType.Special);

            _battleManager = new TestBattleManager(_chanceService, _input, _output);
        }
Пример #6
0
        public void Setup()
        {
            _input         = new MockInput();
            _output        = new MockOutput();
            _chanceService = new MockChanceService();
            _menuManager   = new TestMenuManager(_input, _output);
            _battleManager = new TestBattleManager(_chanceService, _input, _output);

            TestFighterFactory.SetChanceService(_chanceService);

            _humanFighter = (TestHumanFighter)TestFighterFactory.GetFighter(TestFighterType.TestHuman, 1);
            _humanTeam    = new Team(_menuManager, _humanFighter);

            _level1ShieldGuy = (ShieldGuy)FighterFactory.GetFighter(FighterType.ShieldGuy, 1);
            _ally1           = (TestEnemyFighter)TestFighterFactory.GetFighter(TestFighterType.TestEnemy, 1);
            _ally2           = (TestEnemyFighter)TestFighterFactory.GetFighter(TestFighterType.TestEnemy, 1);
            _shieldGuyTeam   = new Team(_menuManager, _level1ShieldGuy, _ally1, _ally2);
        }
Пример #7
0
        public void Setup()
        {
            _output        = new MockOutput();
            _input         = new MockInput();
            _menuManager   = new TestMenuManager(_input, _output);
            _chanceService = new MockChanceService();

            _battleManager = new TestBattleManager(_chanceService, _input, _output);

            TestFighterFactory.SetChanceService(_chanceService);

            _kiki      = (DancerBoss)FighterFactory.GetFighter(FighterType.DancerBoss, 1, fighterClass: FighterClass.BossDancerKiki);
            _riki      = (DancerBoss)FighterFactory.GetFighter(FighterType.DancerBoss, 1, fighterClass: FighterClass.BossDancerRiki);
            _enemyTeam = new Team(_menuManager, _kiki, _riki);

            _hero      = (TestHumanFighter)TestFighterFactory.GetFighter(TestFighterType.TestHuman, 1, "Hero");
            _sidekick  = (TestHumanFighter)TestFighterFactory.GetFighter(TestFighterType.TestHuman, 1, "SideKick");
            _humanTeam = new Team(new TestMenuManager(new MockInput(), new MockOutput()), _hero, _sidekick);
        }
Пример #8
0
        public void TearDown()
        {
            _chanceService = null;
            _output        = null;
            _input         = null;
            _battleManager = null;
            _config        = null;

            _regionFactory   = null;
            _regionManager   = null;
            _groupingFactory = null;

            _teamFactory = null;
            _mapManager  = null;

            _humanFighter1 = null;
            _humanFighter2 = null;
            _humanTeam     = null;
        }
        public void Setup()
        {
            _logger        = new EventLogger();
            _input         = new MockInput();
            _output        = new MockOutput();
            _menuManager   = new TestMenuManager(_input, _output);
            _chanceService = new MockChanceService();
            _battleManager = new TestBattleManager(_chanceService, _input, _output);

            _evadeButDoNotCounterStatus = new AutoEvadeStatus(1, false);
            _evadeAndCounterStatus      = new AutoEvadeStatus(1, true);

            _humanFighter = new TestHumanFighter("foo", 1);
            _humanTeam    = new TestTeam(_humanFighter);

            _enemy     = (TestEnemyFighter)TestFighterFactory.GetFighter(TestFighterType.TestEnemy, 1);
            _enemyTeam = new Team(_menuManager, _enemy);

            _doNothing = new DoNothingMove();
        }
Пример #10
0
        public void Setup()
        {
            _input       = new MockInput();
            _output      = new MockOutput();
            _menuManager = new TestMenuManager(_input, _output);

            _chanceService = new MockChanceService();

            _battleManager = new TestBattleManager(_chanceService, _input, _output);

            TestFighterFactory.SetChanceService(_chanceService);

            _barbarian = (Barbarian)FighterFactory.GetFighter(FighterType.Barbarian, 1);
            _enemyTeam = new Team(_menuManager, _barbarian);

            _hero      = (TestHumanFighter)TestFighterFactory.GetFighter(TestFighterType.TestHuman, 1, "Hero");
            _sidekick  = (TestHumanFighter)TestFighterFactory.GetFighter(TestFighterType.TestHuman, 1, "SideKick");
            _humanTeam = new TestTeam(new List <HumanFighter> {
                _hero, _sidekick
            });
        }
Пример #11
0
        public void SetUp()
        {
            _chanceService = new MockChanceService();
            _output        = new MockOutput();
            _input         = new MockInput();
            _battleManager = new TestBattleManager(_chanceService, _input, _output);
            _config        = new SilentBattleConfiguration();
            _battleManager.SetConfig(_config);

            _teamFactory     = new TestTeamFactory(_chanceService);
            _mapManager      = new MockMapManager();
            _decisionManager = new MockDecisionManager(new GodRelationshipManager());
            _regionFactory   = new MockRegionFactory(_decisionManager);
            _groupingFactory = new GroupingFactory(_chanceService, _teamFactory, new FighterFactory());

            _humanFighter1 = (TestHumanFighter)TestFighterFactory.GetFighter(TestFighterType.TestHuman, 1);
            _humanFighter2 = (TestHumanFighter)TestFighterFactory.GetFighter(TestFighterType.TestHuman, 1);
            _humanTeam     = new Team(TestMenuManager.GetTestMenuManager(), _humanFighter1, _humanFighter2);

            _oneEnemyTeam = GetSingleEnemyTeam();
        }
Пример #12
0
        public void SetUp()
        {
            _output        = new MockOutput();
            _input         = new MockInput();
            _menuManager   = new TestMenuManager(_input, _output);
            _chanceService = new MockChanceService();
            _battleManager = new TestBattleManager(_chanceService, _input, _output);
            _logger        = new EventLogger();

            _human     = (TestHumanFighter)TestFighterFactory.GetFighter(TestFighterType.TestHuman, 1);
            _enemy     = (TestEnemyFighter)TestFighterFactory.GetFighter(TestFighterType.TestEnemy, 1);
            _humanTeam = new TestTeam(_human);
            _enemyTeam = new Team(_menuManager, _enemy);

            _human.SetSpeed(10);
            _enemy.SetSpeed(0);

            doNothing = new DoNothingMove();
            _enemy.SetMove(doNothing);

            _fireballSpell = SpellFactory.GetSpell(MagicType.Fire, 1);
        }
Пример #13
0
        public void SetUp()
        {
            _input         = new MockInput();
            _output        = new MockOutput();
            _menuManager   = new TestMenuManager(_input, _output);
            _chanceService = new MockChanceService();
            _battleManager = new TestBattleManager(_chanceService, _input, _output);
            _combiner      = new TestFieldEffectCombiner();
            _logger        = new EventLogger();

            _enemy1 = (TestEnemyFighter)TestFighterFactory.GetFighter(TestFighterType.TestEnemy, 1);
            _enemy1.SetDefense(OriginalDefense);
            _enemy2 = (TestEnemyFighter)TestFighterFactory.GetFighter(TestFighterType.TestEnemy, 1);
            _enemy2.SetDefense(OriginalDefense);

            _enemyTeam = new Team(_menuManager, _enemy1, _enemy2);

            _human1 = (TestHumanFighter)TestFighterFactory.GetFighter(TestFighterType.TestHuman, 1);
            _human1.SetDefense(OriginalDefense);
            _human2 = (TestHumanFighter)TestFighterFactory.GetFighter(TestFighterType.TestHuman, 1);
            _human2.SetDefense(OriginalDefense);

            _humanTeam = new TestTeam(_human1, _human2);

            _testTechnique = (TestDanceMove)TestMoveFactory.Get(TargetType.Field, moveType: BattleMoveType.Dance);
            _testTechnique.AddEffect(_raiseTeamDefense50Percent);
            _testTechnique.AddEffect(_lowerEnemyDefense50Percent);
            _testTechnique.SetDuration(_testTechniqueDefaultDuration);
            _testTechnique.SetDanceEffect(DanceEffectType.Fire);

            var firstTurn = (TestDoNothingMove)TestMoveFactory.Get(moveType: BattleMoveType.DoNothing);

            firstTurn.SetMessage(FirstTurnMessage);
            _testTechnique.AddMove(firstTurn);
            var secondTurn = (TestDoNothingMove)TestMoveFactory.Get(moveType: BattleMoveType.DoNothing);

            secondTurn.SetMessage("Continue the Defense dance");
            _testTechnique.AddMove(secondTurn);
        }
Пример #14
0
        public void Setup()
        {
            _input       = new MockInput();
            _output      = new MockOutput();
            _menuManager = new TestMenuManager(_input, _output);

            _chanceService = new MockChanceService();

            _battleManager = new TestBattleManager(_chanceService, _input, _output);

            TestFighterFactory.SetChanceService(_chanceService);

            _chicken   = (MegaChicken)FighterFactory.GetFighter(FighterType.MegaChicken, 1);
            _enemyTeam = new Team(_menuManager, _chicken);

            _hero      = (TestHumanFighter)TestFighterFactory.GetFighter(TestFighterType.TestHuman, 1, "Hero");
            _sidekick  = (TestHumanFighter)TestFighterFactory.GetFighter(TestFighterType.TestHuman, 1, "SideKick");
            _humanTeam = new TestTeam(new List <HumanFighter> {
                _hero, _sidekick
            });

            _castPrefix = $"{_chicken.DisplayName} draws in the power of its magic eggs, sacrificing them and casts ";
        }