예제 #1
0
파일: Projectile.cs 프로젝트: Czahyl/MOBA
        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);
        }
예제 #2
0
파일: BaseEntity.cs 프로젝트: Czahyl/MOBA
        public BaseEntity()
        {
            Bounds = Rectangle.Empty;
            Center = Point.Zero;
            Position = Vector2.Zero;

            light = new LightEmitter();
            Alpha = 255;
        }
예제 #3
0
파일: Player.cs 프로젝트: Czahyl/MOBA
        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);
        }
예제 #4
0
파일: Fireball.cs 프로젝트: Czahyl/MOBA
        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);
        }
예제 #5
0
파일: Minion.cs 프로젝트: Czahyl/MOBA
        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();
        }
예제 #6
0
파일: LightEngine.cs 프로젝트: Czahyl/MOBA
 public void plugEmitter(LightEmitter e)
 {
     emitters.Add(e);
 }
예제 #7
0
파일: LightEngine.cs 프로젝트: Czahyl/MOBA
 public void destroyEmitter(LightEmitter e)
 {
     fadeEmitter.Add(e);
 }