Пример #1
0
        protected void AddSkillShot(string name, Vector2 toPosition, Vector2 endPosition, float range, bool serverOnly = false)
        {
            var record         = SpellRecord.GetSpell(name);
            var position       = new Vector3(Owner.Position.X, Owner.Position.Y, 100);
            var casterPosition = new Vector3(Owner.Position.X, Owner.Position.Y, 100);
            var angle          = Geo.GetAngle(Owner.Position, endPosition);
            var direction      = Geo.GetDirection(angle);
            var velocity       = new Vector3(1, 1, 1) * 100;
            var startPoint     = new Vector3(Owner.Position.X, Owner.Position.Y, 100);
            var endPoint       = new Vector3(endPosition.X, endPosition.Y, 100);


            var skillShot = new SkillShot(Owner.Game.NetIdProvider.PopNextNetId(),
                                          Owner, position.ToVector2(), record.MissileSpeed, record.LineWidth,
                                          OnProjectileReach, direction, range, OnSkillShotRangeReached);


            Owner.Game.AddUnitToTeam(skillShot, Owner.Team.Id);
            Owner.Game.Map.AddUnit(skillShot);

            if (!serverOnly)
            {
                var castInfo = Spell.GetCastInformations(position, endPoint, name, skillShot.NetId);

                Owner.Game.Send(new SpawnProjectileMessage(skillShot.NetId, position, casterPosition,
                                                           direction.ToVector3(), velocity, startPoint, endPoint, casterPosition,
                                                           0, record.MissileSpeed, 1f, 1f, 1f, false, castInfo));
            }
        }
Пример #2
0
    public void UseSkillShot(SkillShot skill)
    {
        foreach(var each in skills)
        {

        }
    }
Пример #3
0
 protected override void AbilityActivate()
 {
     base.AbilityActivate();
     if (Target)
     {
         SkillShot p = (Instantiate(projectile, weapon.transform.position, weapon.transform.
                                    rotation) as GameObject).GetComponent <SkillShot>();
         p.MarkingAttack = true;
         p.speed         = Speed;
         p.damage        = Damage;
         p.target        = Target.transform;
         p.Shooter       = weapon;
         p.effect        = m_effect.CreateEffect();
         p.Fire();
     }
 }
Пример #4
0
        public override void ApplyProjectileEffects(AttackableUnit target, Projectile projectile)
        {
            SkillShot skillShot = projectile as SkillShot;

            float finalDamagePercent = 1 - ((skillShot.GetHittenCount() - 1) * 0.1f);

            finalDamagePercent = Math.Max(finalDamagePercent, 0.3f);

            var ad         = OwnerBonusAD * 1.0f;
            var ap         = OwnerAPTotal * 0.9f;
            var baseDamage = 200 + (Spell.Level * 150);
            var total      = baseDamage + ap + ad;

            total *= finalDamagePercent;
            target.InflictDamages(new Damages(Owner, target, total, false, DamageType.DAMAGE_TYPE_MAGICAL, false));
        }
Пример #5
0
 public virtual void OnSkillShotRangeReached(SkillShot skillShot)
 {
     DestroyProjectile(skillShot, false);
 }
Пример #6
0
 private void OnEnable()
 {
     m_target = (SkillShot)target;
 }
    public void Attack(Vector3 direction)
    {
        SkillShot spawned = Instantiate(m_skillShotPrefab, transform.position, Quaternion.identity) as SkillShot;

        spawned.Shoot(direction, gameObject);
    }