Ejemplo n.º 1
0
        public ManagerPlayerUnits(ManagerMouse managerMouse, ManagerMap managerMap, ManagerBuildings managerBuildings, ManagerEnemies managerEnemies)
            : base(managerMouse, managerMap, managerBuildings)
        {
            managerMouse.MouseClickEventHandler += ManagerMouse_MouseClickEventHandler;

            Vector2 goldMinePos = Functions.CleanHalfPosition(managerMap, ManagerBuildings.goldMines[0].position);

            units.Add(new Peasant(Functions.TilePos(goldMinePos.X), Functions.TilePos(goldMinePos.Y), managerMouse, managerMap, this, managerBuildings));
            units.Add(new Knight(Functions.TilePos(goldMinePos.X) - 2, Functions.TilePos(goldMinePos.Y) - 2, managerMouse, managerMap, this, managerBuildings));

            Vector2 pos  = Vector2.Zero;
            Vector2 last = Vector2.Zero;

            for (int j = 0; j < managerMap.FULL_MAP.Count; j++)
            {
                for (int k = 0; k < managerMap.FULL_MAP[j].Count; k++)
                {
                    if (managerMap.FULL_MAP[j][k].tileType != TileType.WATER && !managerMap.FULL_MAP[j][k].isWall && !managerMap.FULL_MAP[j][k].isWater)
                    {
                        pos = managerMap.FULL_MAP[j][k].position;
                    }

                    last = managerMap.FULL_MAP[j][k].position;
                }
            }

            battleship = new Battleship(Functions.TilePos(pos.X), Functions.TilePos(pos.Y), Functions.TilePos(last.X), managerMouse, managerMap, this, managerBuildings, managerEnemies);
        }
Ejemplo n.º 2
0
        public ManagerEnemies(ManagerMouse managerMouse, ManagerMap managerMap, ManagerBuildings managerBuildings)
        {
            this.managerMap       = managerMap;
            this.managerMouse     = managerMouse;
            this.managerBuildings = managerBuildings;

            for (int i = 0; i < wavesEnemies; i++)
            {
                int spawn     = random.Next(0, 4);
                int armor     = random.Next(0, 20);
                int sight     = random.Next(1, 360);
                int damage    = random.Next(1, 20);
                int precision = random.Next(1, 100);
                int hitPoints = random.Next(1, 200);

                if (random.Next(0, 100) >= 50)
                {
                    InformationUnit info = new InformationUnit("Grunt", Race.ORC, Faction.HORDE, hitPoints, armor, sight, 10, 600, 1, Util.Buildings.NONE, 60, damage, precision, 1, spawn, Util.Units.GRUNT);
                    enemies.Add(new Grunt(info, managerMouse, managerMap, managerBuildings));
                }
                else
                {
                    InformationUnit info = new InformationUnit("Troll Axethrower", Race.ORC, Faction.HORDE, hitPoints, armor, sight, 10, 600, 1, Util.Buildings.NONE, 60, damage, precision, 5, spawn, Util.Units.TROLL_AXETHROWER);
                    enemies.Add(new TrollAxethrower(info, managerMouse, managerMap, managerBuildings));
                }
            }
        }
Ejemplo n.º 3
0
        public ManagerEA(int quantity, ManagerMouse managerMouse, ManagerMap managerMap)
        {
            this.managerMap   = managerMap;
            this.managerMouse = managerMouse;

            for (int i = 0; i < quantity; i++)
            {
                ManagerResources.BOT_GOLD.Add(5000);
                ManagerResources.BOT_WOOD.Add(99999);
                ManagerResources.BOT_FOOD.Add(5);
                ManagerResources.BOT_OIL.Add(99999);

                EA.PeasantController peasantController = new EA.PeasantController(i, managerMap);
                peasantController.SetTownHall(random.Next(0, 4));
                peasantController.SetBaracks(random.Next(0, 500), random.Next(0, 4), random.Next(0, 10), random.Next(0, 10));
                peasantController.SetFarms(random.Next(0, 500), random.Next(0, 4), random.Next(0, 10));
                peasantController.SetMiner(random.Next(0, 500), random.Next(0, 10));

                EA.CityHallController cityHallController = new EA.CityHallController(random.Next(0, 500), random.Next(0, 4), random.Next(0, 4), i, managerMap);

                EA.BarracksController barracksController = new EA.BarracksController(i, managerMap);
                barracksController.SetArcher(random.Next(0, 500), random.Next(0, 4), random.Next(0, 10));
                barracksController.SetWarrior(random.Next(0, 500), random.Next(0, 4), random.Next(0, 10));

                managerEnemies.Add(new ManagerEnemies(managerMouse, managerMap, i));
            }
        }
Ejemplo n.º 4
0
        public ManagerBotsUnits(ManagerMouse managerMouse, ManagerMap managerMap, ManagerBuildings managerBuildings, int index)
            : base(managerMouse, managerMap, managerBuildings)
        {
            this.index = index;

            Vector2 goldMinePos = Functions.CleanHalfPosition(managerMap, ManagerBuildings.goldMines[1].position);

            units.Add(new Peon(Functions.TilePos(goldMinePos.X), Functions.TilePos(goldMinePos.Y), managerMouse, managerMap, this, managerBuildings));

            if (Warcraft.ISLAND == 2)
            {
                units.Add(new Daemon(Functions.TilePos(goldMinePos.X), Functions.TilePos(goldMinePos.Y), managerMouse, managerMap, this));
            }

            AddSkeleton();
        }
Ejemplo n.º 5
0
        public ManagerUnits(ManagerMouse managerMouse, ManagerMap managerMap, ManagerBuildings managerBuildings, ManagerEnemies managerEnemies)
        {
            this.managerMouse     = managerMouse;
            this.managerMap       = managerMap;
            this.managerBuildings = managerBuildings;
            this.managerEnemies   = managerEnemies;

            managerMouse.MouseClickEventHandler += ManagerMouse_MouseClickEventHandler;

            units.Add(new Peasant(23, 23, managerMouse, managerMap, managerBuildings, this));

            //for (int i = 0; i < 40; i++)
            //{
            //    units.Add(new ElvenArcher(24, 23, managerMouse, managerMap, managerBuildings, this));
            //}
        }
Ejemplo n.º 6
0
        public ManagerBotsBuildings(ManagerMouse managerMouse, ManagerMap managerMap, int index)
            : base(managerMouse, managerMap)
        {
            this.index = index;

            int minX = 999, minY = 999;

            for (int i = 0; i < managerMap.FULL_MAP.Count; i++)
            {
                for (int j = 0; j < managerMap.FULL_MAP[i].Count; j++)
                {
                    if (managerMap.FULL_MAP[i][j].tileType != TileType.WATER && !managerMap.FULL_MAP[i][j].isWall && !managerMap.FULL_MAP[i][j].isWater && j < minY)
                    {
                        minX = i;
                        minY = j;
                    }
                }
            }

            this.buildings.Add(new DarkPortal(minX, minY, managerMouse, managerMap, null));
        }
Ejemplo n.º 7
0
 public ManagerUnits(ManagerMouse managerMouse, ManagerMap managerMap, ManagerBuildings managerBuildings)
 {
     this.managerMouse     = managerMouse;
     this.managerMap       = managerMap;
     this.managerBuildings = managerBuildings;
 }
Ejemplo n.º 8
0
 public ManagerPlayerBuildings(ManagerMouse managerMouse, ManagerMap managerMap)
     : base(managerMouse, managerMap)
 {
 }
Ejemplo n.º 9
0
        public ManagerEnemies(ManagerMouse managerMouse, ManagerMap managerMap, int index)
        {
            if (ManagerResources.BOT_FOOD.Count == 0)
            {
                ManagerResources.BOT_GOLD.Add(5000);
                ManagerResources.BOT_WOOD.Add(99999);
                ManagerResources.BOT_FOOD.Add(5);
                ManagerResources.BOT_OIL.Add(99999);
            }
            else
            {
                ManagerResources.BOT_GOLD[0] = 5000;
                ManagerResources.BOT_FOOD[0] = 5;
            }

            this.index            = index;
            this.managerMap       = managerMap;
            this.managerMouse     = managerMouse;
            this.managerBuildings = new ManagerBotsBuildings(managerMouse, managerMap, index);
            this.managerUnits     = new ManagerBotsUnits(managerMouse, managerMap, managerBuildings, index);

            actionsTypes.Add(EA.ActionType.BUILDING);
            actions.Add(0);

            actionsTypes.Add(EA.ActionType.TOWN_HALL);
            actions.Add(0);

            actionsTypes.Add(EA.ActionType.TOWN_HALL);
            actions.Add(0);

            actionsTypes.Add(EA.ActionType.TOWN_HALL);
            actions.Add(0);

            actionsTypes.Add(EA.ActionType.BUILDING);
            actions.Add(2);

            actionsTypes.Add(EA.ActionType.BUILDING);
            actions.Add(2);

            actionsTypes.Add(EA.ActionType.BUILDING);
            actions.Add(1);

            if (Warcraft.ISLAND > 0)
            {
                actionsTypes.Add(EA.ActionType.TOWN_HALL);
                actions.Add(0);

                actionsTypes.Add(EA.ActionType.TOWN_HALL);
                actions.Add(0);
            }

            actionsTypes.Add(EA.ActionType.MINING);
            actions.Add(4);

            actionsTypes.Add(EA.ActionType.MINING);
            actions.Add(4);

            actionsTypes.Add(EA.ActionType.BARRACKS);
            actions.Add(0);

            actionsTypes.Add(EA.ActionType.BARRACKS);
            actions.Add(1);

            if (Warcraft.ISLAND > 0)
            {
                actionsTypes.Add(EA.ActionType.BUILDING);
                actions.Add(5);
            }
        }
Ejemplo n.º 10
0
        public ManagerBuildings(ManagerMouse managerMouse, ManagerMap managerMap)
        {
            this.managerMap = managerMap;

            buildings.Add(new GoldMine(25, 25, managerMouse, managerMap, null));
        }
Ejemplo n.º 11
0
 public ManagerBuildings(ManagerMouse managerMouse, ManagerMap managerMap)
 {
     this.managerMap = managerMap;
 }