public void ShouldThrowExceptionIfBattleOverAndActionPerformed()
        {
            var g = new Game
            {
                CurrentBattleDetails = new BattleDetails
                {
                    BattleStatus = BattleStatus.InBattle,
                    BattleMode = BattleMode.PlayerVsComputer
                },
                Player = new Player()
            };
            g.Player.SetName("Player");
            g.Player.ChangeAlliance(Alliance.TeamOne);
            g.CurrentBattleDetails.Participants.Add(new Participant
            {
                Character = g.Player,
                Status = ParticipantStatus.InBattle
            });
            var b = new Dumbass();
            b.ChangeAlliance(Alliance.TeamTwo);
            b.SetName("Dumbass");
            g.CurrentBattleDetails.Participants.Add(new Participant
            {
                Character = b,
                Status = ParticipantStatus.InBattle
            });
            g.EndBattle(Alliance.TeamOne);

            g.CurrentBattleDetails.Arena.AddCharacterToArena(g.Player, 0, 0);
            var tile = g.CurrentBattleDetails.Arena.SelectFloorTile(new ArenaFloorPosition(0, 1));
            var actions = g.Player.TargetTileAndSelectActions(tile);
            g.PerformPlayerAction(actions.Find(i => i.Name == "Run"));
        }
 public void ShouldPerformMoveAction()
 {
     var g = new Game
     {
         CurrentBattleDetails = new BattleDetails
         {
             BattleStatus = BattleStatus.InBattle,
             BattleMode = BattleMode.PlayerVsComputer
         },
         Player = new Player()
     };
     g.Player.SetName("Player");
     g.CurrentBattleDetails.Participants.Add(new Participant
     {
         Character = g.Player,
         Status = ParticipantStatus.InBattle
     });
     var b = new Dumbass();
     b.SetName("Dumbass");
     g.CurrentBattleDetails.Participants.Add(new Participant
     {
         Character = b,
         Status = ParticipantStatus.InBattle
     });
     g.CurrentBattleDetails.Arena.AddCharacterToArena(g.Player, Alliance.TeamOne, 0, 0);
     var tile = g.CurrentBattleDetails.Arena.SelectFloorTile(new ArenaFloorPosition(0, 1));
     var actions = g.Player.TargetTileAndSelectActions(tile);
     g.PerformPlayerAction(actions.Find(i => i.Name == "Run"));
     Assert.IsTrue(g.Player.ArenaLocation == tile);
     Assert.IsTrue(g.Player.CurrentAvailableActions == null);
 }
 public void ShouldAddPhysicalDamageToAttack()
 {
     var g = new Game
     {
         CurrentBattleDetails = new BattleDetails
         {
             BattleMode = BattleMode.PlayerVsComputer,
             BattleStatus = BattleStatus.InBattle,
             BattleTurn = Alliance.TeamOne
         },
         Player = new Player()
     };
     EquipmentHelper.EquipEquipment(g.Player, new ReliableTreeBranch());
     g.Player.AddPhysicalDamage(10);
     g.CurrentBattleDetails.Arena.AddCharacterToArena(g.Player, Alliance.TeamOne, 0, 0);
     var o = new Dumbass();
     g.CurrentBattleDetails.Arena.AddCharacterToArena(o, Alliance.TeamTwo, 0, 1);
     var tile = g.CurrentBattleDetails.Arena.SelectFloorTile(new ArenaFloorPosition(0, 1));
     var actions = g.Player.TargetTileAndSelectActions(tile);
     g.PerformPlayerAction(actions.Find(i => i.Name == "Swing"));
     Assert.IsTrue(o.Health == 60);
 }
Ejemplo n.º 4
0
 public void ShouldHealSelfWhenHealCast()
 {
     var g = new Game
     {
         CurrentBattleDetails = new BattleDetails
         {
             BattleMode = BattleMode.PlayerVsComputer,
             BattleStatus = BattleStatus.InBattle,
             BattleTurn = Alliance.TeamOne
         },
         Player = new Player()
     };
     g.Player.LevelUp();
     g.Player.ChooseSkill(new PathOfTheWizard());
     g.CurrentBattleDetails.Arena.AddCharacterToArena(g.Player, Alliance.TeamOne);
     g.Player.AddAction(new LittleHeal());
     var c = new Dumbass();
     g.CurrentBattleDetails.Arena.AddCharacterToArena(c, Alliance.TeamTwo);
     var actions = g.Player.TargetTileAndSelectActions(g.Player.ArenaLocation);
     g.PerformPlayerAction(actions.First(i => i is LittleHeal));
     Assert.IsTrue(g.Player.Health > 100);
 }
        public void ShouldAddMagicDamagePercentageToSpell()
        {
            var g = new Game
            {
                CurrentBattleDetails = new BattleDetails
                {
                    BattleMode = BattleMode.PlayerVsComputer,
                    BattleStatus = BattleStatus.InBattle,
                    BattleTurn = Alliance.TeamOne
                },
                Player = new Player()
            };
            g.Player.LevelUp();
            g.Player.ChooseSkill(new PathOfTheWizard());
            g.Player.SetName("Player");
            g.CurrentBattleDetails.Participants.Add(new Participant
            {
                Status = ParticipantStatus.InBattle,
                Character = g.Player
            });
            g.CurrentBattleDetails.Arena.BuildArenaFloor(10);
            g.Player.AddAction(new SpellSpear());
            g.Player.AddMagicDamageBonusPercent(1000);
            g.CurrentBattleDetails.Arena.AddCharacterToArena(g.Player, Alliance.TeamOne, 0, 0);
            var o = new Dumbass();
            o.SetName("Dumbass");
            g.CurrentBattleDetails.Participants.Add(new Participant
            {
                Status = ParticipantStatus.InBattle,
                Character = o
            });

            g.CurrentBattleDetails.Arena.AddCharacterToArena(o, Alliance.TeamTwo, 0, 1);
            var tile = g.CurrentBattleDetails.Arena.SelectFloorTile(new ArenaFloorPosition(0, 1));
            var actions = g.Player.TargetTileAndSelectActions(tile);
            g.PerformPlayerAction(actions.Find(i => i is SpellSpear));
            Assert.IsTrue(o.Health < 0);
        }
 public void ShouldPerformSwingAttackAction()
 {
     var g = new Game
     {
         CurrentBattleDetails = new BattleDetails
         {
             BattleMode = BattleMode.PlayerVsComputer,
             BattleStatus = BattleStatus.InBattle,
             BattleTurn = Alliance.TeamOne
         },
         Player = new Player()
     };
     g.CurrentBattleDetails.Arena.BuildArenaFloor(10);
     EquipmentHelper.EquipEquipment(g.Player, new Sword());
     g.CurrentBattleDetails.Arena.AddCharacterToArena(g.Player, Alliance.TeamOne, 0, 0);
     var o = new Dumbass();
     Assert.IsTrue(o.Health == 100);
     g.CurrentBattleDetails.Arena.AddCharacterToArena(o, Alliance.TeamTwo, 0, 1);
     var tile = g.CurrentBattleDetails.Arena.SelectFloorTile(new ArenaFloorPosition(0, 1));
     var actions = g.Player.TargetTileAndSelectActions(tile);
     g.PerformPlayerAction(actions.Find(i => i.Name == "Swing"));
     Assert.IsTrue(o.Health < 100);
     Assert.IsTrue(g.Player.CurrentAvailableActions == null);
 }