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)); }
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); }
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; }
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); }
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; }
public DamageData(FarmUnit source, FarmUnit target) { if (target.IsTower && target.Unit.HealthPercentage > 10) { this.AutoAttackDamage = 0; } else { this.AutoAttackDamage = source.GetDamage(target); } }
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)); } }
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); }
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; }
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); } }
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(); } } }
public override int GetMaxDamage(FarmUnit target) { return(this.Unit.GetAttackDamage(target.Unit, DamageValue.Maximum, this.OrbsDamage())); }
public override int GetAverageDamage(FarmUnit target) { return(this.Unit.GetAttackDamage(target.Unit, DamageValue.Average, this.OrbsDamage())); }