Пример #1
0
        public InformationUnit(string name, Race race, Faction faction, float hitPoints, int armor, int sight, int movementSpeed,
                               int costGold, int costFood, Util.Buildings produceAt, int buildTime, int damage, int range, Util.Units type, int piercing)
        {
            Name = name;

            Race    = race;
            Faction = faction;

            HitPoints      = hitPoints;
            HitPointsTotal = HitPoints;
            Armor          = armor;
            Sight          = sight;
            MovementSpeed  = movementSpeed;
            Range          = range;

            CostGold  = costGold;
            CostFood  = costFood;
            ProduceAt = produceAt;
            BuildTime = buildTime;

            Damage   = damage;
            Piercing = piercing;

            Type = type;
        }
        public InformationUnit(string name, Race race, Faction faction, float hitPoints, int armor, int sight, int movementSpeed,
                               int costGold, int costFood, Util.Buildings produceAt, int buildTime, int damage, int precision, int range,
                               int spawn, Util.Units type)
        {
            Name = name;

            Race    = race;
            Faction = faction;

            HitPoints      = Math.Min(200, Math.Max(hitPoints, 1));
            HitPointsTotal = HitPoints;
            Armor          = Math.Min(20, Math.Max(armor, 0));
            Sight          = Math.Min(360, Math.Max(sight, 1));
            MovementSpeed  = movementSpeed;
            Range          = range;

            CostGold  = costGold;
            CostFood  = costFood;
            ProduceAt = produceAt;
            BuildTime = buildTime;

            Damage    = Math.Min(20, Math.Max(damage, 0));
            Precision = Math.Min(100, Math.Max(precision, 1));

            Spawn = Math.Min(4, Math.Max(spawn, 0));

            Type = type;
        }
Пример #3
0
        public BuilderUnits(Util.Units type, ManagerUnits managerUnits, InformationUnit informationUnit)
        {
            this.informationUnit = informationUnit;
            this.type            = type;

            this.managerUnits = managerUnits;
        }
Пример #4
0
        public override void Factory(Util.Units type, int x, int y, int targetX, int targetY)
        {
            if (type == Util.Units.PEON)
            {
                units.Add(new Peon(x, y, managerMouse, managerMap, this, managerBuildings));
            }
            else if (type == Util.Units.TROLL_AXETHROWER)
            {
                units.Add(new TrollAxethrower(x, y, managerMouse, managerMap, this));
            }
            else if (type == Util.Units.GRUNT)
            {
                units.Add(new Grunt(x, y, managerMouse, managerMap, this));
            }

            if (type != Util.Units.PEON)
            {
                Random rng = new Random();
                if (rng.NextDouble() > 0.5)
                {
                    defense.Add(units.Count - 1);
                }
                else
                {
                    attack.Add(units.Count - 1);
                }
            }

            units[units.Count - 1].Move(targetX, targetY);

            LoadContent();
        }
Пример #5
0
        public InformationBuilding(string name, int hitPoints, int costGold, int costFood, Util.Units creates, int buildTime, Util.Buildings type)
        {
            Name = name;

            HitPoints = hitPoints;

            CostGold  = costGold;
            CostFood  = costFood;
            Creates   = creates;
            BuildTime = buildTime;

            Type = type;
        }
Пример #6
0
        public override void Factory(Util.Units type, int x, int y, int targetX, int targetY)
        {
            if (type == Util.Units.PEASANT)
            {
                units.Add(new Peasant(x, y, managerMouse, managerMap, this, managerBuildings));
            }
            else if (type == Util.Units.ELVEN_ARCHER)
            {
                units.Add(new ElvenArcher(x, y, managerMouse, managerMap, this));
            }
            else if (type == Util.Units.FOOTMAN)
            {
                units.Add(new Footman(x, y, managerMouse, managerMap, this));
            }

            units[units.Count - 1].Move(targetX, targetY);

            LoadContent();
        }
Пример #7
0
 public abstract void Factory(Util.Units type, int x, int y, int targetX, int targetY);
 public BuilderUnits(Util.Units type, InformationUnit informationUnit)
 {
     this.informationUnit = informationUnit;
     this.type            = type;
 }