Exemple #1
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));
            }
        }
        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);
        }
Exemple #3
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));
                }
            }
        }
Exemple #4
0
        public ManagerIsland(ManagerMouse managerMouse)
        {
            GenerateRooms generateRooms = new GenerateRooms();

            rooms = generateRooms.Rooms;

            for (int i = 0; i < rooms.Count; i++)
            {
                managerMap.Add(new ManagerMap(rooms[i]));
            }

            Functions.managerMap = CurrentMap();

            int[] min = new int[2] {
                3, rooms[0].rectangle.Width / 3
            };
            int[] max = new int[2] {
                rooms[0].rectangle.Height / 2 + rooms[0].rectangle.Height / 3, rooms[0].rectangle.Height
            };

            for (int i = 0; i < managerMap.Count; i++)
            {
                Warcraft.MAP_SIZE = rooms[i].rectangle.Width / Warcraft.TILE_SIZE;

                Vector2[] pos = { Vector2.Zero, Vector2.Zero };

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

                for (int j = 0; j < 2; j++)
                {
                    Vector2 place = Functions.CleanHalfPosition(managerMap[i], pos[j]);
                    place = place + new Vector2(rooms[i].rectangle.X, rooms[i].rectangle.Y);

                    ManagerBuildings.goldMines.Add(new Buildings.Neutral.GoldMine((int)(place.X / Warcraft.TILE_SIZE), (int)(place.Y / Warcraft.TILE_SIZE), managerMouse, managerMap[i], null));
                }
            }
        }
        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();
        }
Exemple #6
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));
            //}
        }
Exemple #7
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));
        }
Exemple #8
0
 public ManagerUnits(ManagerMouse managerMouse, ManagerMap managerMap, ManagerBuildings managerBuildings)
 {
     this.managerMouse     = managerMouse;
     this.managerMap       = managerMap;
     this.managerBuildings = managerBuildings;
 }
Exemple #9
0
 public ManagerPlayerBuildings(ManagerMouse managerMouse, ManagerMap managerMap)
     : base(managerMouse, managerMap)
 {
 }
Exemple #10
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);
            }
        }
Exemple #11
0
 public ManagerUI(ManagerMouse managerMouse, ManagerBuildings managerBuildings, ManagerUnits managerUnits, List <ManagerEnemies> managerEnemies)
 {
     ui = new Main(managerUnits, managerBuildings, managerMouse, managerEnemies);
 }
 public ManagerUI(ManagerMouse managerMouse, ManagerBuildings managerBuildings, ManagerUnits managerUnits)
 {
     ui = new Main(managerUnits, managerBuildings, managerMouse);
 }
Exemple #13
0
        public ManagerBuildings(ManagerMouse managerMouse, ManagerMap managerMap)
        {
            this.managerMap = managerMap;

            buildings.Add(new GoldMine(25, 25, managerMouse, managerMap, null));
        }
Exemple #14
0
 public ManagerBuildings(ManagerMouse managerMouse, ManagerMap managerMap)
 {
     this.managerMap = managerMap;
 }