public BuildUnitButtonType(Texture2D texture, Keys hotkey, UnitType unitType) : base(texture, hotkey, unitType.BuildTime) { UnitType = unitType; }
public Unit(UnitType type, Vector2 position, short team, short id) : base(position, type.Size, team) { ID = id; //ID = Player.Players[team].UnitIDCounter++; Player.Players[team].UnitArray[ID] = this; this.type = type; //this.speed = new Vector2(type.MoveSpeed, type.MoveSpeed); MaxSpeed = type.MoveSpeed; acceleration = MaxSpeed * 6f; Texture = type.NormalTexture; //BulletTexture = type.BulletTexture; BulletSize = type.BulletSize; BulletSpeed = type.BulletSpeed; AttackDamage = type.AttackDamage; AttackRange = type.AttackRange; AttackDelay = type.AttackDelay; Hp = MaxHp = type.Hp; Armor = type.Armor; SightRange = type.SightRange; BuildTime = type.BuildTime; SelectionSortValue = type.SelectionSortValue; TargetPriority = type.TargetPriority; //Player.Players[Team].CurrentSupply += type.SupplyCost; AddUnit(this); //InitializeCurrentPathNode(); }
public Unit(UnitType type, Vector2 position, int size) : base(position, size) { this.type = type; AddUnit(this); initializeCurrentPathNode(); }
public Unit(UnitType type, Vector2 position, int size, float speed) : this(type, position, size) { this.speed = new Vector2(speed, speed); }
static UnitType() { MeleeNublet = new UnitType(); MeleeNublet.NormalTexture = Game1.Game.Content.Load<Texture2D>("unit textures/redcircleguy"); MeleeNublet.SelectingTexture = Game1.Game.Content.Load<Texture2D>("unit textures/redcircleguyselected2"); MeleeNublet.SelectedTexture = Game1.Game.Content.Load<Texture2D>("unit textures/redcircleguyselecting2"); //MeleeNublet.BulletTexture = Game1.Game.Content.Load<Texture2D>("boxingglove"); MeleeNublet.BulletType = BulletType.MeleeBullet; MeleeNublet.Name = "Melee Nublet"; MeleeNublet.Size = 20;// 38; MeleeNublet.MoveSpeed = 115;// 140; MeleeNublet.AttackDamage = 6; MeleeNublet.AttackRange = 5; MeleeNublet.AttackDelay = 1000; MeleeNublet.BulletSize = 15; MeleeNublet.BulletSpeed = 200; MeleeNublet.Hp = 100;// 0000; MeleeNublet.Armor = 1; MeleeNublet.SightRange = 5; MeleeNublet.BuildTime = 1250; MeleeNublet.SelectionSortValue = 101; MeleeNublet.TargetPriority = 2; MeleeNublet.SupplyCost = 2; MeleeNublet.RoksCost = 15; RangedNublet = new UnitType(); RangedNublet.NormalTexture = Game1.Game.Content.Load<Texture2D>("unit textures/browncircleguy"); RangedNublet.SelectingTexture = Game1.Game.Content.Load<Texture2D>("unit textures/browncircleguyselected2"); RangedNublet.SelectedTexture = Game1.Game.Content.Load<Texture2D>("unit textures/browncircleguyselecting2"); //RangedNublet.BulletTexture = Game1.Game.Content.Load<Texture2D>("bullet"); RangedNublet.BulletType = BulletType.RangedNubletBullet; RangedNublet.Name = "Ranged Nublet"; RangedNublet.Size = 18; RangedNublet.MoveSpeed = 125;// 150; RangedNublet.AttackDamage = 5; RangedNublet.AttackRange = 50; RangedNublet.AttackDelay = 750; RangedNublet.BulletSize = 7; RangedNublet.BulletSpeed = 200; RangedNublet.Hp = 50; RangedNublet.Armor = 0; RangedNublet.SightRange = 6; RangedNublet.BuildTime = 10000; RangedNublet.SelectionSortValue = 102; RangedNublet.TargetPriority = 2; RangedNublet.SupplyCost = 2; RangedNublet.RoksCost = 10; WorkerNublet = new UnitType(); //WorkerNublet.NormalTexture = Game1.Game.Content.Load<Texture2D>("unit textures/ants/worker ant"); //WorkerNublet.SelectingTexture = Game1.Game.Content.Load<Texture2D>("unit textures/ants/worker ant"); //WorkerNublet.SelectedTexture = Game1.Game.Content.Load<Texture2D>("unit textures/ants/worker ant"); WorkerNublet.NormalTexture = Game1.Game.Content.Load<Texture2D>("unit textures/graycircleguy"); WorkerNublet.SelectingTexture = Game1.Game.Content.Load<Texture2D>("unit textures/graycircleguyselected"); WorkerNublet.SelectedTexture = Game1.Game.Content.Load<Texture2D>("unit textures/graycircleguyselecting"); //WorkerNublet.BulletTexture = Game1.Game.Content.Load<Texture2D>("bullet"); WorkerNublet.BulletType = BulletType.WorkerBullet; WorkerNublet.Name = "Worker Nublet"; WorkerNublet.Size = 16; WorkerNublet.MoveSpeed = 90;// 110; WorkerNublet.AttackDamage = 4; WorkerNublet.AttackRange = 5; WorkerNublet.AttackDelay = 1000; WorkerNublet.BulletSize = 5; WorkerNublet.BulletSpeed = 200; WorkerNublet.Hp = 30; WorkerNublet.Armor = 0; WorkerNublet.SightRange = 5; WorkerNublet.BuildTime = 1000;// 8000; WorkerNublet.SelectionSortValue = 100; WorkerNublet.TargetPriority = 2; WorkerNublet.SupplyCost = 1; WorkerNublet.RoksCost = 1;//8; }