示例#1
0
文件: Burn.cs 项目: Czahyl/MOBA
 public Burn(Player affectedPlayer, Player Owner)
     : base(affectedPlayer, Owner)
 {
     liveTime = new Timer(5, false);
     dotDmg = 5;
     dotTime = new Timer(1, false);
 }
示例#2
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);
        }
示例#3
0
 public ParticlePreset(int burstCount, int minVel, int maxVel, Timer liveTime, float burstRadius)
 {
     this.burstCount = burstCount;
     this.minVel = minVel;
     this.maxVel = maxVel;
     this.liveTime = liveTime;
     this.burstRadius = burstRadius;
 }
示例#4
0
文件: Particle.cs 项目: Czahyl/MOBA
        public Particle(ParticleEngine engine, Vector2 startPos, ParticlePreset preset)
        {
            e = engine;
            settings = preset;
            pos = startPos;
            dir = PickRandomDirection();
            vel = Main.random.Next(settings.minVel, settings.maxVel);

            liveTime = settings.liveTime;
        }
示例#5
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);
        }
示例#6
0
        public LightEngine(Main main, int width, int height)
        {
            m = main;

            for (int x = 0; x < width; x += 8)
            {
                for (int y = 0; y < height; y += 8)
                {
                    shades.Add(new Shade(x, y));
                }
            }

            lag = new Timer(5, true);
        }
示例#7
0
文件: Autoattack.cs 项目: Czahyl/MOBA
        public Autoattack(Vector2 startPos, Player player)
        {
            Start = startPos;
            plr = player;
            image = Main.Assets.getTexture(3);
            End = new Vector2((float)InputHandler.EventX, (float)InputHandler.EventY);

            timer = new Timer(Player.AttRange, false); // Create the live time of the projectile

            Direction = End - Start;

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

            if (Direction != Vector2.Zero)
                Direction.Normalize();
        }
示例#8
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);
        }
示例#9
0
文件: Ability.cs 项目: Czahyl/MOBA
 public virtual void Cast(GameTime gameTime)
 {
     if (!onCooldown)
     {
         cooldown = new Timer(60, false);
         onCooldown = true;
         Selecting = false;
         pClass.canAttack = true;
     }
 }
示例#10
0
文件: Burn.cs 项目: Czahyl/MOBA
 public Burn()
 {
     liveTime = new Timer(5, false);
     dotDmg = 5;
     dotTime = new Timer(1, false);
 }