public void Setup()
        {
            _input             = new MockInput();
            _output            = new MockOutput();
            _menuManager       = new TestMenuManager(_input, _output);
            _logger            = new EventLogger();
            _mockChanceService = new MockChanceService();
            TestFighterFactory.SetChanceService(_mockChanceService);

            _battleManager = new BattleManager(_mockChanceService, _input, _output);

            _humanPlayer1 = (TestHumanFighter)TestFighterFactory.GetFighter(TestFighterType.TestHuman, 1, "Ted");
            _humanPlayer2 = (TestHumanFighter)TestFighterFactory.GetFighter(TestFighterType.TestHuman, 1, "Jed");

            _humanPlayer2.AddSpell(_fireball);
            _humanPlayer2.SetMana(_fireball.Cost);

            _humanPlayer2.TurnEnded += TurnEndedEvents.RestoreManaOnTurnEnd;

            _enemyPlayer1 = (TestEnemyFighter)TestFighterFactory.GetFighter(TestFighterType.TestEnemy, 1, "Enemy");
            _enemyPlayer2 = (TestEnemyFighter)TestFighterFactory.GetFighter(TestFighterType.TestEnemy, 1, "Enemy");

            _humanTeam = new TestTeam(_menuManager, _humanPlayer1, _humanPlayer2);

            _enemyTeam = new Team(_menuManager, _enemyPlayer1, _enemyPlayer2);
        }
Exemplo n.º 2
0
        public void FighterFactory_CorrectlyRandomizesEggType_IfNoneSpecified()
        {
            TestFighterFactory.SetChanceService(_chanceService);
            _chanceService.PushWhichEventOccurs(0);

            Egg egg = (Egg)FighterFactory.GetFighter(FighterType.Egg, 1);

            Assert.AreEqual(Globals.EggMagicTypes[0], egg.MagicType);
        }
Exemplo n.º 3
0
        public void SetUp()
        {
            _chanceService = new MockChanceService();
            _logger        = new EventLogger();
            TestFighterFactory.SetChanceService(_chanceService);
            _copperBell = new Bell(CopperBellDisplayName, BellType.Copper, new MenuFactory(), _chanceService);
            _silverBell = new Bell(SilverBellDisplayName, BellType.Silver, new MenuFactory(), _chanceService);

            _fighter = (TestHumanFighter)TestFighterFactory.GetFighter(TestFighterType.TestHuman, 1);
        }
Exemplo n.º 4
0
        public void Setup()
        {
            _mockChanceService = new MockChanceService();
            TestFighterFactory.SetChanceService(_mockChanceService);

            _fairy     = (Fairy)TestFighterFactory.GetFighter(TestFighterType.Fairy, 1);
            _fairyTeam = new Team(TestMenuManager.GetTestMenuManager(), _fairy);

            _humanTeam = new Team(new TestMenuManager(new MockInput(), new MockOutput()), (HumanFighter)TestFighterFactory.GetFighter(TestFighterType.HumanControlledPlayer, 1));
        }
Exemplo n.º 5
0
        public void Setup()
        {
            _mockChanceService = new MockChanceService();
            TestFighterFactory.SetChanceService(_mockChanceService);

            _zombie     = (Zombie)TestFighterFactory.GetFighter(TestFighterType.Zombie, 1);
            _zombieTeam = new Team(TestMenuManager.GetTestMenuManager(), _zombie);

            _humanTeam = new Team(new TestMenuManager(new MockInput(), new MockOutput()), (TestHumanFighter)TestFighterFactory.GetFighter(TestFighterType.TestHuman, 1));
        }
        public void Setup()
        {
            _input             = new MockInput();
            _output            = new MockOutput();
            _menuManager       = new TestMenuManager(_input, _output);
            _mockChanceService = new MockChanceService();
            TestFighterFactory.SetChanceService(_mockChanceService);
            FighterFactory.SetInput(_input);
            FighterFactory.SetOutput(_output);

            _fighter = (HumanControlledEnemyFighter)FighterFactory.GetFighter(FighterType.HumanControlledEnemy, 1, "hero");
            _enemy   = (TestEnemyFighter)TestFighterFactory.GetFighter(TestFighterType.TestEnemy, 1, "enemy");
        }
Exemplo n.º 7
0
        public void Setup()
        {
            _input         = new MockInput();
            _output        = new MockOutput();
            _chanceService = new MockChanceService();
            _menuManager   = new TestMenuManager(_input, _output);

            TestFighterFactory.SetChanceService(_chanceService);

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

            _level1Warrior = (Warrior)FighterFactory.GetFighter(FighterType.Warrior, 1);
            _level3Warrior = (Warrior)FighterFactory.GetFighter(FighterType.Warrior, 3);
            _warriorTeam   = new Team(_menuManager, _level1Warrior);
        }
Exemplo n.º 8
0
        public void Setup()
        {
            _input             = new MockInput();
            _output            = new MockOutput();
            _menuManager       = new TestMenuManager(_input, _output);
            _mockChanceService = new MockChanceService();
            TestFighterFactory.SetChanceService(_mockChanceService);

            _fighter = (TestEnemyFighter)TestFighterFactory.GetFighter(TestFighterType.TestEnemy, 1, "hero");
            _enemy1  = (HumanFighter)FighterFactory.GetFighter(FighterType.HumanControlledPlayer, 1, "enemy");
            _enemy2  = (HumanFighter)FighterFactory.GetFighter(FighterType.HumanControlledPlayer, 1, "enemy");

            _ownTeam         = new Team(_menuManager, _fighter);
            _singleEnemyTeam = new Team(_menuManager, _enemy1);
            _doubleEnemyTeam = new Team(_menuManager, _enemy1, _enemy2);
        }
Exemplo n.º 9
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);
        }
Exemplo n.º 10
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);
        }
Exemplo n.º 11
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);
        }
Exemplo n.º 12
0
        public void Setup()
        {
            _input         = new MockInput();
            _output        = new MockOutput();
            _menuManager   = new TestMenuManager(_input, _output);
            _chanceService = new MockChanceService();

            TestFighterFactory.SetChanceService(_chanceService);

            _humanPlayer1 = (TestHumanFighter)TestFighterFactory.GetFighter(TestFighterType.TestHuman, 1, "Ted");
            _humanPlayer2 = (TestHumanFighter)TestFighterFactory.GetFighter(TestFighterType.TestHuman, 1, "Jed");
            _enemyPlayer1 = (TestEnemyFighter)TestFighterFactory.GetFighter(TestFighterType.TestEnemy, 1, DefaultEnemyName);
            _enemyPlayer2 = (TestEnemyFighter)TestFighterFactory.GetFighter(TestFighterType.TestEnemy, 1, DefaultEnemyName);

            _humanTeam = new Team(_menuManager, _humanPlayer1, _humanPlayer2);
            _enemyTeam = new Team(_menuManager, _enemyPlayer1, _enemyPlayer2);

            _humanTeam.InitializeForBattle(_enemyTeam, _input, _output);
        }
Exemplo n.º 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);

            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
            });
        }
Exemplo n.º 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 ";
        }