Exemplo n.º 1
0
 public SteelFactory(TextureValue texture, Vector2 position, TextureValue icon, ProjectileManager proj, Stats teamStats) : base(texture, position, icon, proj, teamStats)
 {
     Cost = new Wallet();
     Cost.Deposit(new Iron(), 200);
     Cost.Deposit(new Wood(), 300);
     Cost.Deposit(new Money(), 0);
     productionTypes = new List <IResource>()
     {
         new Steel()
     };
     ProductionAMinute = new List <int>()
     {
         60
     };
     ChargeAMinute = new List <int>()
     {
         5, 10
     };
     ChargeTypes = new List <IResource>()
     {
         new Energy(), new Iron()
     };
     name     = "Steel Factory";
     Position = position;
     Size     = new Vector2(3, 3);
     stats.Add(new Health("Health", 200));
     currentHealth       = 0;
     BuildingDescription = "Used for production of steel, also costs iron for production";
 }
Exemplo n.º 2
0
        public SolarPanel(TextureValue texture, Vector2 position, TextureValue icon, ProjectileManager proj, Stats teamStats) : base(texture, position, icon, proj, teamStats)
        {
            ProductionAMinute = new List <int>()
            {
                60
            };
            productionTypes = new List <IResource>()
            {
                new Energy()
            };

            Cost = new Wallet();
            Cost.Deposit(new Steel(), 200);
            Cost.Deposit(new Money(), 100);
            productionTypes = new List <IResource>()
            {
                new Energy()
            };
            ProductionAMinute = new List <int>()
            {
                60
            };
            name     = "Solar Panel";
            Position = position;
            Size     = new Vector2(2, 4);
            stats.Add(new Health("Health", 200));
            currentHealth       = 0;
            healthBar           = new HealthBar(new Rectangle(new Point((int)position.X, (int)position.Y - 1), new Point((int)(Size.X * 16), (int)(Size.Y))));
            BuildingDescription = "Generates power for the system.";
        }
Exemplo n.º 3
0
 public Lab(TextureValue texture, Vector2 position, TextureValue icon, ProjectileManager proj, Stats teamStats) : base(texture, position, icon, proj, teamStats)
 {
     queueableThings = new List <IQueueable <TextureValue> >();
     queueableThings.Add(new DamageUpgrade(new MeleeDamage("Power", 10), TextureValue.Damage, new Vector2()));
     queueableThings.Add(new InventoryUpgrade(new InventorySpace("InventorySpace", 5), TextureValue.Chest, new Vector2()));
     queueableThings.Add(new BuildUpgrade(new BuildPower("BuildPower", 10), TextureValue.BuildPower, new Vector2()));
     queueableThings.Add(new HarvestUpgrade(new HarvestPower("HarvestPower", 4), TextureValue.HarvestPower, new Vector2()));
     queueableThings.Add(new HealthUpgrade(new Health("Health", 50), TextureValue.Health, new Vector2()));
     Cost = new Wallet();
     Cost.Deposit(new Steel(), 100);
     Cost.Deposit(new Wood(), 200);
     Cost.Deposit(new Money(), 100);
     ChargeAMinute = new List <int>()
     {
         100
     };
     ChargeTypes = new List <IResource>()
     {
         new Energy()
     };
     name     = "Lab";
     Position = position;
     Size     = new Vector2(2, 2);
     stats.Add(new Health("Health", 1000));
     currentHealth       = 0;
     healthBar           = new HealthBar(new Rectangle(new Point((int)position.X, (int)position.Y - 1), new Point((int)(Size.X * 16), (int)(Size.Y))));
     BuildingDescription = "Used to learn technology to improve production.";
 }
Exemplo n.º 4
0
 public HealthUpgrade(Stat upgrade, TextureValue icon, Vector2 position) : base(upgrade, icon, position)
 {
     Cost = new Wallet();
     Cost.Deposit(new Likes(), 2.5f);
     Cost.Deposit(new Money(), 5.0f);
     LearnTime = 10;
 }
Exemplo n.º 5
0
 public Mines(TextureValue texture, Vector2 position, TextureValue icon, ProjectileManager proj, Stats teamStats) : base(texture, position, icon, proj, teamStats)
 {
     ProductionAMinute = new List <int>()
     {
         0
     };
     productionTypes = new List <IResource>()
     {
         new Iron()
     };
     Cost = new Wallet();
     Cost.Deposit(new Iron(), 20);
     Cost.Deposit(new Wood(), 20);
     Cost.Deposit(new Money(), 10);
     ChargeAMinute = new List <int>()
     {
         0
     };
     ChargeTypes = new List <IResource>()
     {
         new Energy()
     };
     name     = "Mines";
     Position = position;
     Size     = new Vector2(1, 1);
     stats.Add(new Health("Health", 200));
     currentHealth = 0;
     tags.Add("Iron Collector");
     healthBar           = new HealthBar(new Rectangle(new Point((int)position.X, (int)position.Y - 1), new Point((int)(Size.X * 16), (int)(Size.Y))));
     BuildingDescription = "Used as a drop off point for iron ore";
 }
Exemplo n.º 6
0
 public InternetCafe(TextureValue texture, Vector2 position, TextureValue icon, ProjectileManager proj, Stats teamStats) : base(texture, position, icon, proj, teamStats)
 {
     ProductionAMinute = new List <int>()
     {
         5, 1
     };
     productionTypes = new List <IResource>()
     {
         new Money(), new Likes()
     };
     Cost = new Wallet();
     Cost.Deposit(new Steel(), 200);
     Cost.Deposit(new Wood(), 100);
     Cost.Deposit(new Iron(), 100);
     ChargeAMinute = new List <int>()
     {
         25
     };
     ChargeTypes = new List <IResource>()
     {
         new Energy()
     };
     name     = "Internet Cafe";
     Position = position;
     stats.Add(new Health("Health", 500));
     currentHealth       = 0;
     healthBar           = new HealthBar(new Rectangle(new Point((int)position.X, (int)position.Y - 1), new Point((int)(Size.X * 16), (int)(Size.Y))));
     BuildingDescription = "Internet Cafe used for units to generate money and likes in.";
 }
Exemplo n.º 7
0
 protected CommandButton(ICommand command, Vector2 position, TextureValue picture, Point size) : base(position, size, Color.White)
 {
     this.bounds   = new Rectangle(position.ToPoint(), Size);
     this.Position = position;
     this.picture  = ContentHandler.DrawnTexture(picture);
     this.command  = command;
     this.Size     = size;
 }
 public ModifiableTile(TextureValue texture, Vector2 position, Stats teamStats, Color color) : base(texture, position, color)
 {
     stats          = new Stats();
     this.TeamStats = teamStats;
     built          = false;
     MapWatcher     = new List <IMapObserver>();
     healthBar      = new HealthBar(new Rectangle(this.Position.ToPoint() - new Point(0, (int)(this.Size.Y * 16 + 1)), Size.ToPoint()));
     tags           = new List <string>();
 }
Exemplo n.º 9
0
 public Overlay(Game game, InputDefinitions input, WorldHandler world, CommandProccesor command) : base(game)
 {
     cp                   = command;
     this.world           = world;
     this.input           = input;
     cp.overlay           = this;
     ZeroVector           = Vector2.Zero;
     currentCursorTexture = TextureValue.Cursor;
     tile                 = world.GetTile(input.InputPos);
     ClickTime            = 0;
 }
 protected HarvestableUnit(TextureValue texture, IResource type, string name, Vector2 size, float totalHealth, float currentHealth, Vector2 position, Color color) : base(texture, position, null, color)
 {
     this.type = type;
     this.name = name;
     this.Size = size;
     stats     = new Stats(new List <Stat>()
     {
         new Health("Health", totalHealth)
     });
     this.CurrentHealth = currentHealth;
     this.Position      = position;
     healthBar          = new HealthBar(new Rectangle(position.ToPoint() - new Point(0, (int)(size.Y * 16 + 1)), size.ToPoint()));
 }
Exemplo n.º 11
0
 public Portal(TextureValue texture, Vector2 position, TextureValue icon, ProjectileManager proj, Stats teamStats, WaveManager wave) : base(texture, position, icon, proj, teamStats)
 {
     energyCost = 0;
     name       = "Portal";
     Position   = position;
     Size       = new Vector2(4, 4);
     stats.Add(new Health("Health", 5000));
     currentHealth = 5000;
     tags.Add("Portal");
     healthBar           = new HealthBar(new Rectangle(new Point((int)position.X, (int)position.Y - 1), new Point((int)(Size.X * 16), (int)(Size.Y))));
     BuildingDescription = "The Portal summons waves";
     this.wave           = wave;
 }
Exemplo n.º 12
0
        public static bool edit(this Material mat, TextureValue property, string name = null)
        {
            var val = mat.Get(property);

            if (name.IsNullOrEmpty())
            {
                name = property.NameForDisplayPEGI();
            }

            if (name.edit(name.Length * pegi.letterSizeInPixels, ref val))
            {
                mat.Set(property, val);
                return(true);
            }

            return(false);
        }
 public ServerFarm(TextureValue texture, Vector2 position, TextureValue icon, ProjectileManager proj, Stats teamStats) : base(texture, position, icon, proj, teamStats)
 {
     Cost = new Wallet();
     Cost.Deposit(new Steel(), 100);
     Cost.Deposit(new Wood(), 200);
     Cost.Deposit(new Money(), 100);
     ChargeAMinute = new List <int>(5);
     ChargeTypes   = new List <IResource>()
     {
         new Energy()
     };
     name     = "Server Farm";
     Position = position;
     Size     = new Vector2(3, 3);
     stats.Add(new Health("Health", 2000));
     healthBar           = new HealthBar(new Rectangle(new Point((int)position.X, (int)position.Y - 1), new Point((int)(Size.X * 16), (int)(Size.Y))));
     BuildingDescription = "Used if a unit cap is implemented, at the moment this is also useless.";
 }
 public PowerSupply(TextureValue texture, Vector2 position, TextureValue icon, ProjectileManager proj, Stats teamStats) : base(texture, position, icon, proj, teamStats)
 {
     Cost = new Wallet();
     Cost.Deposit(new Steel(), 100);
     Cost.Deposit(new Wood(), 200);
     Cost.Deposit(new Money(), 100);
     ChargeAMinute = new List <int>()
     {
         5
     };
     ChargeTypes = new List <IResource>()
     {
         new Energy()
     };
     name     = "Power Supply";
     Position = position;
     Size     = new Vector2(2, 2);
     stats.Add(new Health("Health", 2000));
     healthBar           = new HealthBar(new Rectangle(new Point((int)position.X, (int)position.Y - 1), new Point((int)(Size.X * 16), (int)(Size.Y))));
     BuildingDescription = "Used to hold power if I implement power caps, also useless.";
 }
 public MediaCenter(TextureValue texture, Vector2 position, TextureValue icon, ProjectileManager proj, Stats teamStats) : base(texture, position, icon, proj, teamStats)
 {
     Cost = new Wallet();
     Cost.Deposit(new Steel(), 100);
     Cost.Deposit(new Wood(), 200);
     Cost.Deposit(new Money(), 100);
     ChargeAMinute = new List <int>()
     {
         20
     };
     ChargeTypes = new List <IResource>()
     {
         new Energy()
     };
     name     = "Media Center";
     Position = position;
     Size     = new Vector2(4, 4);
     stats.Add(new Health("Health", 2000));
     currentHealth       = 0;
     healthBar           = new HealthBar(new Rectangle(new Point((int)position.X, (int)position.Y - 1), new Point((int)(Size.X * 16), (int)(Size.Y))));
     BuildingDescription = "In theory suppose to generate content, kinda pointless at this moment";
 }
Exemplo n.º 16
0
 public FireWall(TextureValue texture, Vector2 position, TextureValue icon, ProjectileManager proj, Stats teamStats) : base(texture, position, icon, proj, teamStats)
 {
     Cost = new Wallet();
     Cost.Deposit(new Steel(), 50);
     Cost.Deposit(new Wood(), 10);
     Cost.Deposit(new Money(), 0);
     ChargeAMinute = new List <int>()
     {
         20
     };
     ChargeTypes = new List <IResource>()
     {
         new Energy()
     };
     name     = "Firewall";
     Position = position;
     Size     = new Vector2(1, 1);
     stats.Add(new Health("Health", 2000));
     currentHealth       = 0;
     healthBar           = new HealthBar(new Rectangle(new Point((int)position.X, (int)position.Y - 1), new Point((int)(Size.X * 16), (int)(Size.Y))));
     BuildingDescription = "A wall used to keep enemies away from your buildings";
 }
Exemplo n.º 17
0
 public Center(TextureValue texture, Vector2 position, TextureValue icon, ProjectileManager proj, Stats teamStats) : base(texture, position, icon, proj, teamStats)
 {
     Cost = new Wallet();
     Cost.Deposit(new Steel(), 200);
     Cost.Deposit(new Wood(), 200);
     Cost.Deposit(new Money(), 100);
     ChargeAMinute = new List <int>()
     {
         5
     };
     ChargeTypes = new List <IResource>()
     {
         new Energy()
     };
     name     = "Center";
     Position = position;
     Size     = new Vector2(4, 4);
     stats.Add(new Health("Health", 5000));
     currentHealth = 0;
     tags.Add("Iron Collector");
     tags.Add("Wood Collector");
     healthBar           = new HealthBar(new Rectangle(new Point((int)position.X, (int)position.Y - 1), new Point((int)(Size.X * 16), (int)(Size.Y))));
     BuildingDescription = "The center allows the user to train Civilians";
 }
Exemplo n.º 18
0
 public static Vector2 GetTiling(this Material mat, TextureValue property) => property.GetTiling(mat);
Exemplo n.º 19
0
 public static Vector2 GetOffset(this Material mat, TextureValue property) => property.GetOffset(mat);
 public override Building NewInstace(TextureValue tex, Vector2 position, TextureValue Icon)
 {
     return(new ServerFarm(tex, position, Icon, proj, teamStats));
 }
Exemplo n.º 21
0
        public Ballista(string name, Vector2 size, float totalHealth, float currentHealth, Vector2 position, BaseUnitState state, TextureValue texture, Color color, TextureValue icon, ProjectileManager projectile, float range, Stats teamStats) : base(name, size, totalHealth, currentHealth, position, state, texture, color, icon, range, teamStats)
        {
            Cost = new Wallet();
            Cost.Deposit(new Steel(), 1);
            Cost.Deposit(new Wood(), 5);
            Cost.Deposit(new Money(), 20);

            attack = new Ranged(projectile, TextureValue.Arrow);

            stats.Add(new MeleeDamage("Attack", 50));
            stats.Add(new Health("Health", 10));
            this.projectile = projectile;
        }
 public BackGroundTile(TextureValue texture, Vector2 position, Color color) : base(texture, position, color)
 {
 }
Exemplo n.º 23
0
 public Priest(string name, Vector2 size, float totalHealth, float currentHealth, Vector2 position, BaseUnitState state, TextureValue texture, Color color, TextureValue icon, float range, Stats teamStats) : base(name, size, totalHealth, currentHealth, position, state, texture, color, icon, range, teamStats)
 {
 }
Exemplo n.º 24
0
 public IronVein(TextureValue texture, IResource type, string name, Microsoft.Xna.Framework.Vector2 size, float totalHealth, float currentHealth, Vector2 position, Color color) : base(texture, type, name, size, totalHealth, currentHealth, position, color)
 {
     tags.Add("Iron");
 }
Exemplo n.º 25
0
 public Civilian(string name, Vector2 size, float totalHealth, float currentHealth, Vector2 position, BaseUnitState state, TextureValue texture, TextureValue Icon, float range, ProjectileManager proj, Stats teamStats) : base(name, size, totalHealth, currentHealth, position, state, texture, Color.Blue, Icon, range, teamStats)
 {
     this.proj = proj;
     stats.Add(new BuildPower("Build Power", 10));
     stats.Add(new MeleeDamage("Attack Power", 10));
     stats.Add(new HarvestPower("Harvest Power", 2));
     stats.Add(new InventorySpace("Inventory Space", 10));
     waypoints  = new List <Vector2>();
     zero       = Vector2.Zero;
     xOne       = new Vector2(1, 0);
     yOne       = new Vector2(0, 1);
     toBuild    = new Stack <Building>();
     speed      = 50;
     unitWallet = new UnitWallet(this);
     tags.Add("HasInventoryCap");
     tags.Add("CanAttack");
     tags.Add("HasHealth");
     nextPoint   = TargetPosition = Position;
     Description = "A basic unit able to Harvest resources, and build things\nMinimal Damage";
 }
 public OffensiveUnits(string name, Vector2 size, float totalHealth, float currentHealth, Vector2 position, BaseUnitState state, TextureValue texture, Color color, TextureValue icon, float range, Stats teamstats) : base(name, size, totalHealth, currentHealth, position, state, texture, color, icon, range, teamstats)
 {
     stats.Add(new MeleeDamage("Attack Power", 10));
 }
Exemplo n.º 27
0
 public static void SetTiling(this Material mat, TextureValue property, Vector2 value) =>
 property.SetTiling(mat, value);
Exemplo n.º 28
0
 public Ranged(ProjectileManager shotManager, TextureValue projectile) : base()
 {
     this.shotManager = shotManager;
     this.projectile  = projectile;
 }
Exemplo n.º 29
0
 public Tile(TextureValue texture, Vector2 position, Color color)
 {
     block.texture  = texture;
     this.Position  = position;
     this.tileColor = color;
 }
Exemplo n.º 30
0
 //Probably should add a decorator implementation for ranged and melee units this is just more simple at the moment
 public Mage(string name, Vector2 size, float totalHealth, float currentHealth, Vector2 position, BaseUnitState state, TextureValue texture, Color color, TextureValue icon, ProjectileManager projectile, float range, Stats teamStats) : base(name, size, totalHealth, currentHealth, position, state, texture, color, icon, range, teamStats)
 {
     this.projectile = projectile;
     attack          = new Ranged(projectile, TextureValue.FireBall);
     stats.Add(new MeleeDamage("Attack", 5));
     stats.Add(new Health("Health", 10));
 }