예제 #1
0
        public ControlEffect(FarmUnit unit)
        {
            //this.effects.Add(
            //    new ParticleEffect(
            //        "particles/econ/events/ti7/ti7_hero_effect_light_aura.vpcf",
            //        unit.Unit.BaseUnit,
            //        ParticleAttachment.AbsOriginFollow));

            //this.effects.Add(
            //    new ParticleEffect(
            //        "particles/econ/events/ti7/ti7_hero_effect_aegis_back.vpcf",
            //        unit.Unit.BaseUnit,
            //        ParticleAttachment.AbsOriginFollow));

            //this.effects.Add(
            //    new ParticleEffect(
            //        "particles/econ/events/ti7/ti7_hero_effect_aegis_top.vpcf",
            //        unit.Unit.BaseUnit,
            //        ParticleAttachment.AbsOriginFollow));

            //this.effects.Add(
            //    new ParticleEffect(
            //        "particles/econ/events/ti8/ti8_hero_effect_base_detail.vpcf",
            //        unit.Unit.BaseUnit,
            //        ParticleAttachment.AbsOriginFollow));
        }
예제 #2
0
파일: SiegeCreep.cs 프로젝트: vana41203/O9K
        public override UnitDamage AddDamage(FarmUnit target, float attackStartTime, bool addNext, bool forceRanged)
        {
            var damage = new RangedDamage(this, target, attackStartTime, 15, 0.1f);

            target.IncomingDamage.Add(damage);

            return(damage);
        }
예제 #3
0
 protected UnitDamage(FarmUnit source, FarmUnit target)
 {
     this.Source        = source;
     this.Target        = target;
     this.MinDamage     = source.Unit.GetAttackDamage(target.Unit, DamageValue.Minimum);
     this.MaxDamage     = source.Unit.GetAttackDamage(target.Unit, DamageValue.Maximum);
     this.AverageDamage = (this.MinDamage + this.MaxDamage) / 2;
 }
예제 #4
0
 static void MoveToMouse(FarmUnit unit)
 {
     if (!Utils.SleepCheck($"moveLhCheck{unit.ControlledUnit.Handle}"))
     {
         return;
     }
     Utils.Sleep(250, $"moveLhCheck{unit.ControlledUnit.Handle}");
     unit.ControlledUnit.Move(Game.MousePosition);
 }
예제 #5
0
 public MeleeDamage(
     FarmUnit source,
     FarmUnit target,
     float attackStartTime,
     float additionalTime,
     float additionalIncludeTime = -0.07f)
     : base(source, target)
 {
     this.HitTime     = attackStartTime + source.Unit.GetAttackPoint(target.Unit) + additionalTime;
     this.IncludeTime = this.HitTime + additionalIncludeTime;
 }
예제 #6
0
 public DamageData(FarmUnit source, FarmUnit target)
 {
     if (target.IsTower && target.Unit.HealthPercentage > 10)
     {
         this.AutoAttackDamage = 0;
     }
     else
     {
         this.AutoAttackDamage = source.GetDamage(target);
     }
 }
예제 #7
0
        public DamageData(FarmUnit source, IEnumerable <ActiveAbility> abilities, FarmUnit target)
            : this(source, target)
        {
            if (target.IsAlly || target.IsTower)
            {
                return;
            }

            foreach (var ability in abilities)
            {
                this.AbilityDamage.Add(ability, ability.GetDamage(target.Unit));
            }
        }
예제 #8
0
파일: DamageInfo.cs 프로젝트: vana41203/O9K
        public DamageInfo(FarmUnit unit, FarmUnit target)
        {
            this.Unit            = unit;
            this.Delay           = unit.GetAttackDelay(target);
            this.PredictedHealth = target.GetPredictedHealth(unit, this.Delay);

            if (this.PredictedHealth <= 0)
            {
                this.IsValid = false;
                return;
            }

            this.MinDamage       = unit.GetDamage(target);
            this.IsInAttackRange = unit.Unit.Distance(target.Unit) < unit.Unit.GetAttackRange(target.Unit);
        }
예제 #9
0
        public RangedDamage(
            FarmUnit source,
            FarmUnit target,
            float attackStartTime,
            float additionalRange,
            float additionalTime,
            float additionalIncludeTime = -0.07f)
            : base(source, target)
        {
            var distance = Math.Max(source.Unit.Distance(target.Unit) - target.Unit.HullRadius - additionalRange, 20)
                           / source.Unit.ProjectileSpeed;

            this.hitTime     = attackStartTime + source.Unit.GetAttackPoint(target.Unit) + distance + additionalTime;
            this.includeTime = this.hitTime + additionalIncludeTime;
        }
예제 #10
0
        private void OnUnitAdded(Unit9 unit)
        {
            try
            {
                if (!unit.IsUnit)
                {
                    return;
                }

                FarmUnit farmUnit;

                if (this.unitTypes.TryGetValue(unit.Name, out var type))
                {
                    farmUnit = (FarmUnit)Activator.CreateInstance(type, unit);
                }
                else if (unit.IsLaneCreep)
                {
                    farmUnit = new FarmCreep(unit);
                }
                else if (unit.IsHero)
                {
                    farmUnit = new FarmHero(unit);
                }
                else if (unit.IsTower)
                {
                    farmUnit = new FarmTower(unit);
                }
                else
                {
                    farmUnit = new FarmUnit(unit);
                }

                if (unit.IsMyControllable && unit.AttackCapability != AttackCapability.None &&
                    (unit.UnitState & UnitState.CommandRestricted) == 0)
                {
                    farmUnit.CreateMenu(this.menuManager.UnitSettingsMenu);
                }

                this.units.Add(farmUnit);
            }
            catch (Exception e)
            {
                Logger.Error(e);
            }
        }
예제 #11
0
        public void AttackCanceled(FarmUnit target)
        {
            foreach (var unit in this.units)
            {
                if (unit.Target?.Equals(target) != true)
                {
                    continue;
                }

                if (!unit.AttackSleeper.IsSleeping)
                {
                    continue;
                }

                var delay = (unit.AttackStartTime + unit.GetAttackDelay(target)) - GameManager.RawGameTime;
                if (target.GetPredictedHealth(unit, delay) > unit.GetDamage(target))
                {
                    unit.Stop();
                }
            }
        }
예제 #12
0
 public override int GetMaxDamage(FarmUnit target)
 {
     return(this.Unit.GetAttackDamage(target.Unit, DamageValue.Maximum, this.OrbsDamage()));
 }
예제 #13
0
 public override int GetAverageDamage(FarmUnit target)
 {
     return(this.Unit.GetAttackDamage(target.Unit, DamageValue.Average, this.OrbsDamage()));
 }