Ejemplo n.º 1
0
 public Ability(int type, bool isTargeted, int range, Unit owner)
 {
     _owner = owner;
     _range = range;
     _isTargeted = isTargeted;
     _type = type;
 }
Ejemplo n.º 2
0
 public Projectile(Unit target, int dmg, int x, int y)
 {
     _target = target;
     _dmg = dmg;
     X = x;
     Y = y;
     _direction = new Vector2(target.X - X, target.Y - Y);
 }
Ejemplo n.º 3
0
        public DragonProjectile(Unit target, int dmg, int X, int Y)
            : base(target, dmg, X, Y)
        {
            _sprite = Image.CreateCircle(0, Color.Red);
            _speed = 4;

            SetGraphic(_sprite);
        }
Ejemplo n.º 4
0
        public BuildingProjectile(Unit target, int dmg, int X, int Y)
            : base(target, dmg, X, Y)
        {
            _sprite = Image.CreateCircle(3, Color.Yellow);
            _speed = 4;

            SetGraphic(_sprite);
        }
Ejemplo n.º 5
0
 public void Shoot(Unit target)
 {
     Projectile projectile;
     switch ((int)_projectileType)
     {
         case (int)ProjectileType.unvisible:
             {
                 projectile = new UnvisibleProjectile(target, _dmg, X, Y);
                 break;
             }
         case (int)ProjectileType.simple:
             {
                 projectile = new SimpleProjectile(target, _dmg, X, Y);
                 break;
             }
         case (int)ProjectileType.large:
             {
                 projectile = new LargeProjectile(target, _dmg, X, Y);
                 break;
             }
         case (int)ProjectileType.building:
             {
                 projectile = new BuildingProjectile(target, _dmg, X, Y);
                 break;
             }
         case (int)ProjectileType.none:
             {
                 projectile = new NoProjectile(target, _dmg, X, Y);
                 break;
             }
         case (int)ProjectileType.dragon:
             {
                 projectile = new DragonProjectile(target, _dmg, X, Y);
                 break;
             }
         case (int)ProjectileType.priest:
             {
                 projectile = new PriestProjectile(target, _dmg, X, Y);
                 break;
             }
         default:
             throw new Exception("Unknown weapon type");
     }
     _parent.Add(projectile);
 }
Ejemplo n.º 6
0
 public UnvisibleProjectile(Unit target, int dmg, int X, int Y)
     : base(target, dmg, X, Y)
 {
     _sprite = Image.CreateCircle(0, Color.White);
     _speed = 4;
     SetGraphic(_sprite);
 }
Ejemplo n.º 7
0
        public SimpleProjectile(Unit target, int dmg, int X, int Y)
            : base(target, dmg, X, Y)
        {
            _sprite = Image.CreateCircle(2, Color.Green);
            _speed = 4;

            SetGraphic(_sprite);
        }
Ejemplo n.º 8
0
 public NoProjectile(Unit target, int dmg, int X, int Y)
     : base(target, dmg, X, Y)
 {
 }