Ejemplo n.º 1
0
        public List <Card> GetMainPlayerCards()
        {
            var knight = new MeleeCreature(
                CreatureType.Knight,
                200,
                10,
                10,
                new Size(150, 150));

            var orc = new MeleeCreature(
                CreatureType.Orc,
                200,
                10,
                10,
                new Size(200, 200));

            var troll = new MeleeCreature(
                CreatureType.Troll,
                200,
                10,
                10,
                new Size(200, 200));

            var darkKnight = new MeleeCreature(
                CreatureType.DarkKnight,
                200,
                10,
                10,
                new Size(150, 150));

            var goblin = new MeleeCreature(
                CreatureType.Goblin,
                200,
                10,
                10,
                new Size(200, 200));

            var goldKnight = new MeleeCreature(
                CreatureType.GoldKnight,
                200,
                10,
                10,
                new Size(150, 150));

            return(new List <Card>
            {
                new Card(knight, 10, 1000),
                new Card(orc, 10, 1000),
                new Card(troll, 10, 1000),
                new Card(darkKnight, 10, 1000),
                new Card(goldKnight, 10, 1000),
                new Card(goblin, 10, 1000),
            });
        }
        /// <inheritdoc />
        public BaseCreature CreateCreature(string name, int atk, int def, int hp, CustomRange dmgRange)
        {
            try
            {
                BaseCreature baseCreature = new GenericCreature(name, atk, def, hp, dmgRange);
                BaseCreature creature     = new MeleeCreature(baseCreature);

                return(creature);
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
                Logger.Log(TraceEventType.Critical, $"Creature creation error. Error message: {e.Message}");
                Logger.Log(TraceEventType.Verbose, $"StackTrace: {e.StackTrace}");
                throw;
            }
        }
Ejemplo n.º 3
0
        public List <Card> GetAICards()
        {
            var knight = new MeleeCreature(
                CreatureType.Knight,
                150,
                15,
                10,
                new Size(150, 150));

            var goldKnight = new MeleeCreature(
                CreatureType.GoldKnight,
                250,
                15,
                10,
                new Size(150, 150));

            return(new List <Card>()
            {
                new Card(knight, 15, 1500),
                new Card(goldKnight, 10, 1000)
            });
        }
Ejemplo n.º 4
0
        public void RightDirectionAttack_Test()
        {
            var game         = GetInitedAndStartedGame();
            var testUnitType = new MeleeCreature(
                CreatureType.Knight,
                10,
                10,
                1,
                new Size(1, 1));

            var firstCreature = testUnitType.CreateCreature(game.FirstPlayer);
            var enemyCreature = testUnitType.CreateCreature(game.SecondPlayer);

            game.PlaceCreatureOnField(firstCreature);
            game.PlaceCreatureOnField(enemyCreature);

            firstCreature.Position = new Point(0, 0);
            enemyCreature.Position = new Point(1, 1);

            firstCreature.Act(game.GetEnemiesOf(game.FirstPlayer));

            Assert.AreEqual(10, enemyCreature.MaxHealth);
            Assert.AreEqual(0, enemyCreature.CurrHealth);
        }