Example #1
0
        public override AttackInfoList Defend(CreepUnitList InRange)
        {
            AttackInfoList infos = new AttackInfoList();
            if (InRange.Count > 3)
            {
                Random rand = new Random();
                int toAtk = rand.Next(2);
                toAtk += 2;

                for (int i = 0; i < toAtk; i++)
                {
                    infos.Add(Defend(InRange[i]));
                }
            }
            else
            {
                for (int i = 0; i < InRange.Count; i++)
                {
                    infos.Add(Defend(InRange[i]));
                }
            }

            return infos;
        }
Example #2
0
        public AttackInfoList StealGold(CreepUnitList InRange)
        {
            AttackInfoList infos = new AttackInfoList();
            if (InRange.Count > 3)
            {
                Random rand = new Random();
                int toSteal = rand.Next(2);
                toSteal += 2;

                for (int i = 0; i < toSteal; i++)
                {
                    infos.Add(StealGold(InRange[i]));
                }
            }
            else
            {
                for (int i = 0; i < InRange.Count; i++)
                {
                    infos.Add(StealGold(InRange[i]));
                }
            }

            return infos;
        }
Example #3
0
        public void NewGame(GameDifficulty Difficulty)
        {
            map = new Map();
            CreepPath = new MapCoordList();
            PlayerUnits = new PlayerUnitDictionary();
            AttackInfos = new AttackInfoList();
            Projectiles = new ProjectileList();

            this.Difficulty = Difficulty;

            if (Difficulty == GameDifficulty.Easy)
            {
                Gold = 250;
                Crystal = 50;
            }
            else if (Difficulty == GameDifficulty.Medium)
            {
                Gold = 150;
                Crystal = 30;
            }
            else if (Difficulty == GameDifficulty.Hard)
            {
                Gold = 75;
                Crystal = 20;
            }

            Wave = 1;
            Score = 0;
            State = GameState.NoAttack;
            LastCombatLog = new CombatLog();
            LoadMap(MapFile);
        }