public Tree GetChaseTree( Hero hero, Target target, TimberChain timberChain, float maxDistanceToEnemy, float minDistanceToHero) { var castRange = timberChain.GetCastRange(); var targetPosition = target.GetPosition(); var targetDistance = target.GetDistance(hero.Position); var ignoreMaxDistance = targetDistance > castRange + 200; var delay = Game.RawGameTime + timberChain.CastPoint + Game.Ping / 1000; var trees = GetAvailableTrees(hero, targetPosition, castRange, delay, timberChain.Speed).ToList(); return (trees.Where( x => (ignoreMaxDistance || x.Distance2D( TimberPrediction.PredictedXYZ( target, timberChain.CastPoint + x.Distance2D(targetPosition) / timberChain.Speed)) <= maxDistanceToEnemy || (target.Hero.GetTurnTime(x.Position) <= 0 && x.Distance2D(targetPosition) < 600)) && x.Distance2D(hero) >= minDistanceToHero) .FirstOrDefault( z => trees.Where(x => !x.Equals(z)) .All( x => x.Distance2D(hero) > 150 && !IsPointOnLine(x.Position, hero.Position, z.Position, 25)))); }
public Tree GetChaseTree( Hero hero, Target target, TimberChain timberChain, float maxDistanceToEnemy, float minDistanceToHero) { var castRange = timberChain.GetCastRange(); var targetPosition = target.GetPosition(); var targetDistance = target.GetDistance(hero.Position); var ignoreMaxDistance = targetDistance > castRange + 200; var delay = Game.RawGameTime + timberChain.CastPoint + Game.Ping / 1000; var trees = GetAvailableTrees(hero, targetPosition, castRange, delay, timberChain.Speed).ToList(); return trees.Where( x => (ignoreMaxDistance || x.Distance2D( TimberPrediction.PredictedXYZ( target, timberChain.CastPoint + x.Distance2D(targetPosition) / timberChain.Speed)) <= maxDistanceToEnemy || (target.Hero.GetTurnTime(x.Position) <= 0 && x.Distance2D(targetPosition) < 600)) && x.Distance2D(hero) >= minDistanceToHero) .FirstOrDefault( z => trees.Where(x => !x.Equals(z)) .All( x => x.Distance2D(hero) > 150 && !IsPointOnLine(x.Position, hero.Position, z.Position, 25))); }
public Tree GetChaseTree( Vector3 hero, Target target, TimberChain timberChain, float maxDistanceToEnemy, float minDistanceToHero) { var castRange = timberChain.GetCastRange(); var targetPosition = target.GetPosition(); var targetDistance = target.GetDistance(hero); var ignoreMaxDistance = targetDistance > castRange + 200; var trees = GetAvailableTrees(hero, targetPosition, castRange).ToList(); return (trees.Where( x => (ignoreMaxDistance || x.Distance2D( TimberPrediction.PredictedXYZ( target, timberChain.CastPoint + x.Distance2D(targetPosition) / timberChain.Speed)) <= maxDistanceToEnemy || (Math.Abs( target.Hero.FindAngleR() - Utils.DegreeToRadian(target.Hero.FindAngleForTurnTime(x.Position))) < 0.3 && x.Distance2D(targetPosition) < targetDistance)) && x.Distance2D(hero) >= minDistanceToHero) .FirstOrDefault( z => trees.Where(x => !x.Equals(z)) .All(x => !IsPointOnLine(x.Position, hero, z.Position, forceRadius: 25)))); }
public Timbersaw(Unit9 owner, MultiSleeper abilitySleeper, Sleeper orbwalkSleeper, ControllableUnitMenu menu) : base(owner, abilitySleeper, orbwalkSleeper, menu) { this.ComboAbilities = new Dictionary <AbilityId, Func <ActiveAbility, UsableAbility> > { { AbilityId.shredder_chakram, x => { var chakram = new Chakram(x); this.chakrams.Add(chakram); return(chakram); } }, { AbilityId.shredder_chakram_2, x => { var chakram = new Chakram(x); this.chakrams.Add(chakram); return(chakram); } }, { AbilityId.shredder_whirling_death, x => this.whirlingDeath = new NukeAbility(x) }, { AbilityId.shredder_timber_chain, x => this.timberChain = new TimberChain(x) }, { AbilityId.item_blink, x => this.blink = new BlinkDaggerTimbersaw(x) }, { AbilityId.item_shivas_guard, x => this.shiva = new DebuffAbility(x) }, { AbilityId.item_sheepstick, x => this.hex = new DisableAbility(x) }, { AbilityId.item_blade_mail, x => this.bladeMail = new ShieldAbility(x) }, }; this.MoveComboAbilities.Add(AbilityId.shredder_timber_chain, x => this.timberChainBlink = new TimberChainBlink(x)); }
public bool CheckTree(Hero hero, Vector3 position, TimberChain timberChain) { var distance = Math.Max(timberChain.GetCastRange(), hero.Distance2D(position)); var endPoint = hero.Position.Extend(position, distance); var delay = Game.RawGameTime + timberChain.CastPoint + Game.Ping / 1000; return(GetAvailableTrees(hero, endPoint, distance, delay, timberChain.Speed) .Any(x => IsPointOnLine(x.Position, hero.Position, endPoint, 20))); }
public bool CheckTree(Hero hero, Vector3 position, TimberChain timberChain) { var distance = Math.Max(timberChain.GetCastRange(), hero.Distance2D(position)); var endPoint = hero.Position.Extend(position, distance); var delay = Game.RawGameTime + timberChain.CastPoint + Game.Ping / 1000; return GetAvailableTrees(hero, endPoint, distance, delay, timberChain.Speed) .Any(x => IsPointOnLine(x.Position, hero.Position, endPoint, 20)); }
public Tree GetDamageTree(Hero hero, Vector3 target, TimberChain timberChain, bool dagger = false) { var delay = Game.RawGameTime + timberChain.CastPoint + Game.Ping / 1000; var trees = GetAvailableTrees(hero, target, timberChain.GetCastRange(), delay, timberChain.Speed).ToList(); return(trees.OrderBy(x => x.Distance2D(target)) .FirstOrDefault( x => trees.Where(z => !z.Equals(x)) .All( z => z.Distance2D(hero) > 150 && !IsPointOnLine(z.Position, hero.Position, x.Position, 25)) && (IsPointOnLine(target, hero.Position, x.Position, timberChain.Radius, false) || x.Distance2D(target) < timberChain.Radius - 50) && (dagger || x.Distance2D(target) < 600))); }
public void OnLoad() { hero = ObjectManager.LocalHero; menuManager = new MenuManager(hero.Name); treeFactory = new TreeFactory(); orbwalker = new Orbwalker(hero); sleeper = new MultiSleeper(); TimberPrediction.OnLoad(); whirlingDeath = new WhirlingDeath(hero.Spellbook.SpellQ); timberChain = new TimberChain(hero.Spellbook.SpellW); chakrams.Add( new Chakram( hero.Spellbook.Spells.First(x => x.Name == "shredder_chakram"), hero.Spellbook.Spells.First(x => x.Name == "shredder_return_chakram"))); }
public TimberChainAbility(IBlink blink, GroupSettings settings) : base(blink) { this.timberChain = (TimberChain)blink; this.settings = new BlinkSettings(settings.Menu, blink); }
public Tree GetDamageTree(Hero hero, Vector3 target, TimberChain timberChain, bool dagger = false) { var delay = Game.RawGameTime + timberChain.CastPoint + Game.Ping / 1000; var trees = GetAvailableTrees(hero, target, timberChain.GetCastRange(), delay, timberChain.Speed).ToList(); return trees.OrderBy(x => x.Distance2D(target)) .FirstOrDefault( x => trees.Where(z => !z.Equals(x)) .All( z => z.Distance2D(hero) > 150 && !IsPointOnLine(z.Position, hero.Position, x.Position, 25)) && (IsPointOnLine(target, hero.Position, x.Position, timberChain.Radius, false) || x.Distance2D(target) < timberChain.Radius - 50) && (dagger || x.Distance2D(target) < 600)); }
public TimberChainObstacle(LinearProjectileEvadable ability, Vector3 startPosition) : base(ability, startPosition) { this.timberChain = (TimberChain)ability.RangedAbility; }