Example #1
0
        public Projectile(Ability ability, Debuff debuff)
        {
            spell = ability;

            db = debuff;

            activeEmitter = spell.Emitter != null;

            Start = spell.pClass.Position;
            End = new Vector2(InputHandler.EventX, InputHandler.EventY);
            Direction = End - Start;

            damage = ability.Damage;

            if (Direction != Vector2.Zero)
                Direction.Normalize();

            liveTime = new Timer(spell.SpellRange, false);

            if (activeEmitter)
            {
                emitter = new LightEmitter(Main.lightEngine, Start, spell.LightRadius, 1);
                Main.lightEngine.plugEmitter(emitter);
            }

            angle = (float)System.Math.Atan2(Direction.Y, Direction.X);

            if (End == spell.pClass.Position)
            {
                spell.failedCast();
                spell.projectileList.Remove(this);
            }

            spell.pClass.Drain(spell.Cost);
        }
Example #2
0
        public BaseEntity()
        {
            Bounds = Rectangle.Empty;
            Center = Point.Zero;
            Position = Vector2.Zero;

            light = new LightEmitter();
            Alpha = 255;
        }
Example #3
0
        public Player(string Username, int TeamID)
        {
            if (Username.Length > 8 /* or allowed length */) // TODO: Make a checkname() method in server class
            {
                for (int i = 0; i < 8; i++)
                {
                    Name += Username[i]; //Cap the username at 8 characters
                }
            }
            else
            {
                Name = Username;
            }

            Width = 60;
            Height = 100;

            ability = new List<Ability>();

            debuffList = new List<Debuff>();
            buffList = new List<Buff>();

            Regen = new Timer(5, false);

            currentAni = new Animation(5);

            currentAni.buffer.Add(Main.Assets.getTexture(0));

            Team = TeamID;
            Level = 1;
            Exp = 0;
            MoveSpeed = 1f;
            Health = 100;
            BaseHealth = 100;
            maxHealth = (BaseHealth * Level) + HealthStat;
            HP5 = 3;
            Mana = 100;
            BaseMana = 100;
            maxMana = (BaseMana * Level) + ManaStat;
            MP5 = 3;
            visionLayer = 0;
            defaultLayer = visionLayer;
            Bounds = new Rectangle((int)Position.X, (int)Position.Y, Width, Height);
            light = new LightEmitter();

            nameplate = new Nameplate(this);

            autoAttack = new List<Autoattack>();

            AttackSpeed = 0.5f;

            attackDelay = new Timer(AttackSpeed, false);
        }
Example #4
0
        public Fireball(Player player)
            : base(player)
        {
            pClass = player;

            Emitter = new LightEmitter();
            LightRadius = 35f;

            Cost = 20 * pClass.Level;

            image = Main.Assets.getTexture(3);

            Damage = pClass.SpellPower + (10 * pClass.Level);

            Speed = 10f;

            SpellRange = 1f;
            cooldown = new Timer(60, false);
        }
Example #5
0
        public Minion(int TeamID)
        {
            Team = TeamID;

            Width = 32;
            Height = 45;

            //Add preset animation to ani buffer
            //Maxhealth = Base amount * Towers dead
            maxHealth = 100;
            Health = 100;
            Position = new Vector2(150, 150);
            Bounds = new Rectangle((int)Position.X, (int)Position.Y, Width, Height);

            visionLayer = 0; // The minion can be seen by all light emissions
            defaultLayer = 0;

            //else set it to the original layer (ie invis or w/e)

            light = new LightEmitter();
        }
Example #6
0
 public void plugEmitter(LightEmitter e)
 {
     emitters.Add(e);
 }
Example #7
0
 public void destroyEmitter(LightEmitter e)
 {
     fadeEmitter.Add(e);
 }