Exemplo n.º 1
0
        /// <summary>
        /// Initializes all buildings that belongs to this town.
        /// </summary>
        /// <returns>Array of buildings for the building tree.</returns>
        public Building[] InitializeTownBuildings()
        {
            Building[] buildings = new Building[12];

            buildings[0]  = new TownHall();
            buildings[1]  = new Pallisade();
            buildings[2]  = new Temple();
            buildings[3]  = new DragonTower();
            buildings[4]  = new TrollCave();
            buildings[5]  = new Marketplace();
            buildings[6]  = new BeastRidersGuild();
            buildings[7]  = new CernianCamp();
            buildings[8]  = new TrainingCamp();
            buildings[9]  = new MageTower();
            buildings[10] = new WarriorsCamp();
            buildings[11] = new Workshop();
            return(buildings);
        }
Exemplo n.º 2
0
        public void removeWaves()
        {
            foreach (GameObject obj in this)
            {
                if (obj.Type == "Wave")
                {
                    Wave g = (Wave)obj;

                    obj.IsDead = true;
                }
                if (obj.IsEnemy)
                {
                    Skeleton s = (Skeleton)obj;
                    obj.IsDead = true;
                }
                if (obj.IsTower)
                {
                    MageTower m = (MageTower)obj;
                    obj.IsDead = true;
                }
            }
            lockPlots();
        }
Exemplo n.º 3
0
        void Container_selected(object sender, EventArgs e)
        {
            Container c = (Container)sender;

            if (c.Type == "FireTower")
            {
                Vector2 spawnPoint;
                spawnPoint    = c.Sender.Position;
                spawnPoint.X += 74;
                spawnPoint.Y += 00;
                MageTower tower = new MageTower(FireIdle, 1, 18, 1f, spawnPoint, MapGridBlock, false);
                if (GameRef.player.gold >= tower.Cost)
                {
                    ObjManager.AddLst.Add(tower);
                    GameRef.player.gold -= tower.Cost;
                    StatusBar.Gold      -= tower.Cost;
                    c.sender.HasTower    = true;
                    c.IsEnabled          = true;
                }
                else
                {
                    MessageBox cantAfford = new MessageBox(Content.Load <Texture2D>(@"Ui Content\messageBox"), menuFont, "You Cannot Afford This Tower", new Vector2(0, 600), 2);
                    cantAfford.Color = Color.Red;
                    ObjManager.AddLst.Add(cantAfford);
                }
            }
            else if (c.Type == "IceTower")
            {
                Vector2 spawnPoint;
                spawnPoint    = c.Sender.Position;
                spawnPoint.X += 70;
                spawnPoint.Y -= 23;

                MageTower tower = new MageTower(IceIdle, 2, 10, 1f, spawnPoint, MapGridBlock, true);
                if (tower.Cost <= GameRef.player.gold)
                {
                    ObjManager.AddLst.Add(tower);
                    GameRef.player.gold -= tower.Cost;
                    StatusBar.Gold      -= tower.Cost;
                    c.sender.HasTower    = true;
                    c.IsEnabled          = true;
                }

                else
                {
                    MessageBox cantAfford = new MessageBox(Content.Load <Texture2D>(@"Ui Content\messageBox"), menuFont, "You Cannot Afford This Tower", new Vector2(0, 600), 2);
                    cantAfford.Color = Color.Red;
                    ObjManager.AddLst.Add(cantAfford);
                }
            }
            else if (c.Type == "ArcherTower")
            {
            }
            else if (c.Type == "Artilerty")
            {
            }
            else if (c.Type == "Sell")
            {
            }

            ObjManager.removeConainers();
        }