// Token: 0x06000295 RID: 661 RVA: 0x000109A0 File Offset: 0x0000EBA0 public bool ShouldReturnChakram(TargetManager targetManager, int damagingChakrams) { if (base.Sleeper.IsSleeping || !this.chakram.ReturnChakram.CanBeCasted(true)) { return(false); } Unit9 target = targetManager.Target; if (this.IsDamaging(targetManager)) { if (target.Health < (float)(base.Ability.GetDamage(target) / 2 * damagingChakrams)) { return(true); } if (target.GetAngle(this.castPosition, false) < 0.75f) { return(false); } if (target.IsMoving && target.Distance(this.castPosition) > base.Ability.Radius - 50f) { return(true); } } else if (target.GetAngle(this.castPosition, false) > 0.5f) { return(true); } return(false); }
public override bool CanBeCasted(Unit9 ally, Unit9 enemy, IObstacle obstacle) { if (!this.IsAbilityEnabled(obstacle)) { return(false); } if (!ally.Equals(this.Owner)) { return(false); } if (!this.Ability.CanBeCasted()) { return(false); } var angle = ally.GetAngle(enemy.Position); if (angle < 1) { return(false); } if (this.Owner.IsStunned || this.Owner.IsChanneling) { return(false); } return(true); }
// Token: 0x060008C1 RID: 2241 RVA: 0x000275C8 File Offset: 0x000257C8 public override bool Use(Unit9 target, ComboModeMenu menu, params AbilityId[] except) { foreach (IGrouping <Unit9, OldBlinkAbility> grouping in from x in base.Abilities where x.Ability.IsValid group x by x.Ability.Owner) { Unit9 key = grouping.Key; foreach (OldBlinkAbility oldBlinkAbility in grouping) { if (!except.Contains(oldBlinkAbility.Ability.Id) && oldBlinkAbility.CanBeCasted(menu)) { Vector3 blinkPosition = this.GetBlinkPosition(key, target, menu); if (!blinkPosition.IsZero && key.Distance(blinkPosition) <= oldBlinkAbility.Blink.Range) { if (oldBlinkAbility.Blink.PositionCast && oldBlinkAbility.Use(blinkPosition)) { return(true); } if ((double)key.GetAngle(blinkPosition, false) < 0.2 && oldBlinkAbility.Use(key)) { return(true); } } } } } return(false); }
// Token: 0x06000305 RID: 773 RVA: 0x0001246C File Offset: 0x0001066C public override bool UseAbility(TargetManager targetManager, Sleeper comboSleeper, bool aoe) { Unit9 target = targetManager.Target; Vector3 position = target.Position; Vector3 position2 = base.Owner.Position; float num = base.Owner.Distance(target); if (num > this.menuMaxCastRange) { return(false); } Ability9 ability = base.Owner.Abilities.FirstOrDefault((Ability9 x) => x.Id == AbilityId.storm_spirit_static_remnant); Ability9 ability2 = base.Owner.Abilities.FirstOrDefault((Ability9 x) => x.Id == AbilityId.storm_spirit_electric_vortex); float attackRange = base.Owner.GetAttackRange(target, 0f); bool flag = num < attackRange; float maxCastRange = this.ball.MaxCastRange; PredictionInput9 predictionInput = base.Ability.GetPredictionInput(targetManager.Target, null); predictionInput.CastRange = maxCastRange; predictionInput.Range = maxCastRange; predictionInput.Radius = 1f; predictionInput.Delay += 0.3f; Vector3 castPosition = base.Ability.GetPredictionOutput(predictionInput).CastPosition; if (ability != null && ability.CanBeCasted(true) && num > 200f) { if (((target.GetImmobilityDuration() > 0.5f && !target.HasModifier("modifier_storm_spirit_electric_vortex_pull")) || !base.Owner.IsVisibleToEnemies) && (float)this.ball.GetRemainingMana(castPosition) > ability.ManaCost) { return(this.UseAbility(targetManager, comboSleeper, castPosition)); } if (ability2 != null && ability2.CanBeCasted(true) && (float)this.ball.GetRemainingMana(castPosition) > ability.ManaCost + ability2.ManaCost && target.GetAngle(position2, false) > 1.5f) { return(this.UseAbility(targetManager, comboSleeper, castPosition)); } } if (!flag) { Vector3 toPosition = Vector3Extensions.Extend2D(castPosition, position2, attackRange - 100f); return(this.UseAbility(targetManager, comboSleeper, toPosition)); } if (!this.maxDamage || !base.Owner.CanAttack(target, 0f)) { return(false); } if (target.IsRanged || target.GetAngle(base.Owner, false) > 1f) { Vector3 vector = Vector3Extensions.Extend2D(castPosition, position2, attackRange - 50f); Vector3 vector2 = Vector3Extensions.Extend2D(position2, castPosition, 100f); Vector3 toPosition2 = (castPosition.Distance2D(vector, false) < castPosition.Distance2D(vector2, false)) ? vector : vector2; return(this.UseAbility(targetManager, comboSleeper, toPosition2)); } if (!target.IsStunned && !target.IsDisarmed) { Vector3 vector3 = Vector3Extensions.Extend2D(position, position2, attackRange - 100f); Vector3 vector4 = Vector3Extensions.Extend2D(position, position2, 300f); Vector3 toPosition3 = (position2.Distance2D(vector3, false) < position2.Distance2D(vector4, false)) ? vector3 : vector4; return(this.UseAbility(targetManager, comboSleeper, toPosition3)); } return(false); }
// Token: 0x06000A13 RID: 2579 RVA: 0x0002BF58 File Offset: 0x0002A158 public bool UseForceStaffAway(ForceStaff force, int range) { if (!this.CanBeCasted(force, true, true, true, true)) { return(false); } Unit9 target = this.TargetManager.Target; if (target.IsRanged || target.IsStunned || target.IsRooted || target.IsHexed || target.IsDisarmed) { return(false); } Unit9 owner = force.Ability.Owner; if (target.Distance(owner) > (float)range) { return(false); } Vector3 mousePosition = Game.MousePosition; if (owner.GetAngle(mousePosition, false) > 1f) { owner.BaseUnit.Move(mousePosition); UpdateManager.BeginInvoke(delegate { force.Ability.UseAbility(owner, false, false); }, 200); return(true); } return(false); }
// Token: 0x06000A12 RID: 2578 RVA: 0x0002BE6C File Offset: 0x0002A06C public bool UseDoubleBlinkCombo(ForceStaff force, BlinkAbility blink, float minDistance = 0f) { if (!this.CanBeCasted(force, false, true, true, true) || !this.CanBeCasted(blink, false, true, true, true)) { return(false); } Unit9 target = this.TargetManager.Target; Unit9 owner = force.Ability.Owner; if (owner.Distance(target) < minDistance || owner.Distance(target) < blink.Ability.Range) { return(false); } float num = blink.Ability.Range + force.Ability.Range; if (owner.Distance(target) > num) { return(false); } if (owner.GetAngle(target.Position, false) > 0.5f) { owner.BaseUnit.Move(target.Position); this.comboSleeper.Sleep(0.1f); return(false); } force.Ability.UseAbility(owner, false, false); this.comboSleeper.Sleep(force.Ability.GetCastDelay() + 0.3f); return(false); }
// Token: 0x060009C3 RID: 2499 RVA: 0x0002A788 File Offset: 0x00028988 public override bool UseAbility(TargetManager targetManager, Sleeper comboSleeper, bool aoe) { Unit9 target = targetManager.Target; float attackRange = base.Owner.GetAttackRange(target, 0f); float num = target.Distance(base.Owner); if (num <= attackRange + 100f) { return(false); } if (num <= attackRange + 250f && base.Owner.Speed > targetManager.Target.Speed + 50f) { return(false); } Vector3 vector = (target.GetAngle(base.Owner, false) < 1f) ? Vector3Extensions.Extend2D(target.Position, EntityManager9.EnemyFountain, 100f) : target.GetPredictedPosition(base.Ability.CastPoint + 0.3f); if (base.Owner.Distance(vector) > base.Ability.CastRange) { return(false); } if (!base.Ability.UseAbility(vector, false, false)) { return(false); } float castDelay = base.Ability.GetCastDelay(target); comboSleeper.Sleep(castDelay); base.Sleeper.Sleep(castDelay + 0.5f); base.OrbwalkSleeper.Sleep(castDelay); return(true); }
// Token: 0x060008C2 RID: 2242 RVA: 0x00027720 File Offset: 0x00025920 public bool Use(Hero9 target, ComboModeMenu menu, float useRange, float blinkRange) { foreach (IGrouping <Unit9, OldBlinkAbility> grouping in from x in base.Abilities where x.Ability.IsValid group x by x.Ability.Owner) { Unit9 key = grouping.Key; if (key.Distance(target) >= useRange) { foreach (OldBlinkAbility oldBlinkAbility in grouping) { if (oldBlinkAbility.CanBeCasted(menu)) { Vector3 vector = Vector3Extensions.Extend2D(target.Position, key.Position, blinkRange); if (key.Distance(vector) <= oldBlinkAbility.Blink.Range) { if (oldBlinkAbility.Blink.PositionCast && oldBlinkAbility.Use(vector)) { return(true); } if ((double)key.GetAngle(vector, false) < 0.2 && oldBlinkAbility.Use(key)) { return(true); } } } } } } return(false); }
// Token: 0x06000CE6 RID: 3302 RVA: 0x0000B977 File Offset: 0x00009B77 public override int GetDamage(Unit9 unit) { if ((double)unit.GetAngle(base.Owner.Position, false) < 1.5) { return(0); } return(base.GetDamage(unit)); }
public override int GetDamage(Unit9 unit) { if (unit.GetAngle(this.Owner.Position) < 1.5) { return(0); } return(base.GetDamage(unit)); }
// Token: 0x06000A7F RID: 2687 RVA: 0x0002D244 File Offset: 0x0002B444 public override bool ShouldCast(TargetManager targetManager) { if (!base.ShouldCast(targetManager)) { return(false); } Unit9 target = targetManager.Target; return((target.IsMoving && target.GetAngle(base.Owner.Position, false) >= 1f) || !base.Owner.CanAttack(target, 0f)); }
private void AttackStarted(Unit9 unit) { if (this.attackSleeper.IsSleeping(unit.Handle) || !unit.IsAlive) { return; } if (!unit.IsControllable && unit.IsHero) { unit.Target = EntityManager9.Units .Where(x => x.IsAlive && !x.IsAlly(unit) && x.Distance(unit) <= unit.GetAttackRange(x, 25)) .OrderBy(x => unit.GetAngle(x.Position)) .FirstOrDefault(x => unit.GetAngle(x.Position) < 0.35f); } unit.IsAttacking = true; this.attackSleeper.Sleep(unit.Handle, unit.GetAttackPoint()); this.AttackStart?.Invoke(unit); }
public override float GetEvadeTime(Unit9 ally, bool blink) { if (this.Projectile == null) { var range = 100; if (ally.IsMoving) { if (ally.GetAngle(this.Position) < 1) { range += 25; } else { range -= 25; } } var distance = Math.Max(ally.Distance(this.Position) - ((Game.Ping / 1000) * this.Speed) - range, 0); return((this.EndCastTime + (distance / this.Speed)) - Game.RawGameTime); } if (this.Projectile.IsValid) { var range = 50; if (ally.IsMoving) { if (ally.GetAngle(this.Projectile.Position) < 1) { range += 25; } else { range -= 25; } } return(Math.Max(ally.Distance(this.Projectile.Position) - ((Game.Ping / 1000) * this.Speed) - range, 0) / this.Speed); } return(0); }
private bool?UseSingleBlink(Unit9 owner, IEnumerable <OldBlinkAbility> blinkAbilities, Vector3 position, float distance) { foreach (var blinkAbility in blinkAbilities) { if (blinkAbility.Blink.Range < distance) { continue; } switch (blinkAbility.Blink.BlinkType) { case BlinkType.Blink: { if (!blinkAbility.Use(position)) { return(false); } if (blinkAbility.Ability.Speed <= 0) { return(true); } return(null); } case BlinkType.Leap: { if (owner.GetAngle(position) > 0.2) { owner.BaseUnit.Move(owner.Position.Extend2D(position, 25)); this.OrbwalkSleeper.Sleep(owner.Handle, owner.GetTurnTime(position)); return(null); } if (!blinkAbility.Use(owner)) { return(false); } if (blinkAbility.Ability.Speed <= 0) { return(true); } return(null); } } } return(false); }
// Token: 0x060003B4 RID: 948 RVA: 0x0001CEDC File Offset: 0x0001B0DC private void AttackStarted(Unit9 unit) { if (this.attackSleeper.IsSleeping(unit.Handle) || !unit.IsAlive) { return; } if (!unit.IsControllable && unit.IsHero) { unit.Target = (from x in EntityManager9.Units where x.IsAlive && !x.IsAlly(unit) && x.Distance(unit) <= unit.GetAttackRange(x, 25f) orderby unit.GetAngle(x.Position, false) select x).FirstOrDefault((Unit9 x) => unit.GetAngle(x.Position, false) < 0.35f); } unit.IsAttacking = true; this.attackSleeper.Sleep(unit.Handle, unit.GetAttackPoint(null)); UnitMonitor.EventHandler attackStart = this.AttackStart; if (attackStart == null) { return; } attackStart(unit); }
// Token: 0x0600070D RID: 1805 RVA: 0x00021360 File Offset: 0x0001F560 public bool?BodyBlock(TargetManager targetManager, Vector3 blockPosition, ComboModeMenu menu) { if (!this.Owner.CanMove(true) || this.MoveSleeper.IsSleeping) { return(new bool?(false)); } Unit9 target = targetManager.Target; float angle = target.GetAngle(this.Owner.Position, false); if ((double)angle > 1.2) { if (this.Owner.Speed <= target.Speed + 35f) { return(null); } float num = angle * 0.6f; Vector3 vector = target.InFront((float)this.BodyBlockRange, MathUtil.RadiansToDegrees(num), true); Vector3 vector2 = target.InFront((float)this.BodyBlockRange, MathUtil.RadiansToDegrees(-num), true); if (this.Move((this.Owner.Distance(vector) < this.Owner.Distance(vector2)) ? vector : vector2)) { this.MoveSleeper.Sleep(0.1f); return(new bool?(true)); } return(new bool?(false)); } else if ((double)angle < 0.36) { if (!target.IsMoving && this.CanAttack(target, 400f)) { return(new bool?(this.Attack(target, menu))); } if (this.Owner.IsMoving && !this.AttackSleeper.IsSleeping) { this.MoveSleeper.Sleep(0.2f); return(new bool?(this.Owner.BaseUnit.Stop())); } return(new bool?(false)); } else { if (this.Move(Vector3Extensions.Extend2D(target.Position, blockPosition, (float)this.BodyBlockRange))) { this.MoveSleeper.Sleep(0.1f); return(new bool?(true)); } return(new bool?(false)); } }
public override bool CanBeCasted(Unit9 ally, Unit9 enemy, IObstacle obstacle) { if (!base.CanBeCasted(ally, enemy, obstacle)) { return(false); } switch (obstacle.EvadableAbility.Ability.Id) { case AbilityId.slark_pounce: { var center = this.Pounce?.GetControlPoint(3); if (center == null) { return(false); } if (ally.Distance(center.Value) < 370) { return(false); } this.usePosition = ally.Position.Extend2D(center.Value, 20); return(true); } case AbilityId.disruptor_kinetic_field: { var center = this.KineticField?.Owner.Position; if (center == null) { return(false); } var distance = ally.Distance(center.Value); if (distance < 325 || distance > 340 || ally.GetAngle(center.Value) < 2) { return(false); } this.usePosition = ally.Position.Extend2D(center.Value, 20); return(true); } } return(false); }
// Token: 0x06000FE5 RID: 4069 RVA: 0x00028814 File Offset: 0x00026A14 public float AmplifierValue(Unit9 source, Unit9 target) { if (!this.CanBeCasted(true)) { return(0f); } float angle = target.GetAngle(source.Position, false); if ((double)angle <= 1.1) { return(0f); } if ((double)angle <= 1.9) { return(this.sideAmplifierData.GetValue(this.Level) / -100f); } return(this.backAmplifierData.GetValue(this.Level) / -100f); }
// Token: 0x060008C7 RID: 2247 RVA: 0x00027A9C File Offset: 0x00025C9C private bool?UseSingleBlink(Unit9 owner, IEnumerable <OldBlinkAbility> blinkAbilities, Vector3 position, float distance) { foreach (OldBlinkAbility oldBlinkAbility in blinkAbilities) { if (oldBlinkAbility.Blink.Range >= distance) { BlinkType blinkType = oldBlinkAbility.Blink.BlinkType; if (blinkType != null) { if (blinkType == 1) { if ((double)owner.GetAngle(position, false) > 0.2) { owner.BaseUnit.Move(Vector3Extensions.Extend2D(owner.Position, position, 25f)); base.OrbwalkSleeper.Sleep(owner.Handle, owner.GetTurnTime(position)); return(null); } if (!oldBlinkAbility.Use(owner)) { return(new bool?(false)); } if (oldBlinkAbility.Ability.Speed <= 0f) { return(new bool?(true)); } return(null); } } else { if (!oldBlinkAbility.Use(position)) { return(new bool?(false)); } if (oldBlinkAbility.Ability.Speed <= 0f) { return(new bool?(true)); } return(null); } } } return(new bool?(false)); }
// Token: 0x06000A74 RID: 2676 RVA: 0x0002D05C File Offset: 0x0002B25C public virtual bool UseAbilityOnTarget(TargetManager targetManager, Sleeper comboSleeper) { Unit9 target = targetManager.Target; if (target.GetAngle(base.Owner.Position, false) > 0.3f) { return(false); } if (target.Distance(base.Owner) > base.Ability.Range + 100f) { return(false); } if (!base.Ability.UseAbility(target, false, false)) { return(false); } comboSleeper.Sleep(base.Ability.GetHitTime(target.Position)); base.Sleeper.Sleep(base.Ability.GetCastDelay() + 0.5f); return(true); }
public float AmplifierValue(Unit9 source, Unit9 target) { if (!this.CanBeCasted()) { return(0); } var angle = target.GetAngle(source.Position); if (angle <= 1.1) { return(this.frontAmplifierData.GetValue(this.Level) / -100); } if (angle <= 1.9) { return(this.sideAmplifierData.GetValue(this.Level) / -100); } return(0); }
public override float GetEvadeTime(Unit9 ally, bool blink) { if (this.Projectile.IsValid) { var range = 75; if (ally.IsMoving) { if (ally.GetAngle(this.Projectile.Position) < 1) { range += 25; } else { range -= 25; } } return(Math.Max(ally.Distance(this.Projectile.Position) - ((GameManager.Ping / 1000) * this.Speed) - range, 0) / this.Speed); } return(0); }
// Token: 0x06000296 RID: 662 RVA: 0x00010A50 File Offset: 0x0000EC50 public override bool UseAbility(TargetManager targetManager, Sleeper comboSleeper, bool aoe) { Unit9 target = targetManager.Target; PredictionInput9 predictionInput = base.Ability.GetPredictionInput(target, targetManager.EnemyHeroes); if (target.GetAngle(base.Owner.Position, false) > 2f) { predictionInput.Delay += 0.5f; } PredictionOutput9 predictionOutput = base.Ability.GetPredictionOutput(predictionInput); this.castPosition = predictionOutput.CastPosition; if (!base.Ability.UseAbility(this.castPosition, false, false)) { return(false); } float castDelay = base.Ability.GetCastDelay(this.castPosition); comboSleeper.Sleep(castDelay); base.Sleeper.Sleep(base.Ability.GetHitTime(this.castPosition)); base.OrbwalkSleeper.Sleep(castDelay); return(true); }
// Token: 0x0600038C RID: 908 RVA: 0x00014284 File Offset: 0x00012484 public override bool Combo(TargetManager targetManager, ComboModeMenu comboModeMenu) { AbilityHelper abilityHelper = new AbilityHelper(targetManager, comboModeMenu, this); Unit9 target = targetManager.Target; if (this.UltCombo(targetManager, abilityHelper)) { return(true); } if (abilityHelper.UseAbility(this.hex, true)) { return(true); } if (abilityHelper.UseAbility(this.bloodthorn, true)) { return(true); } if (abilityHelper.UseAbility(this.orchid, true)) { return(true); } if (abilityHelper.UseAbility(this.veil, true)) { return(true); } if (abilityHelper.UseAbility(this.nullifier, true)) { return(true); } if (abilityHelper.UseAbility(this.ethereal, true)) { return(true); } if (abilityHelper.UseAbility(this.pike, 800f, 400f)) { return(true); } if (abilityHelper.CanBeCasted(this.pike, true, true, true, true) && !base.MoveSleeper.IsSleeping && this.pike.UseAbilityOnTarget(targetManager, base.ComboSleeper)) { return(true); } if (abilityHelper.UseAbility(this.manta, base.Owner.GetAttackRange(null, 0f))) { return(true); } IEnumerable <NukeAbility> enumerable; if (target.GetAngle(base.Owner.Position, false) <= 1f && target.IsMoving) { enumerable = from x in this.razes orderby x.Ability.Id descending select x; } else { enumerable = from x in this.razes orderby x.Ability.Id select x; } foreach (NukeAbility nukeAbility in enumerable) { if (abilityHelper.CanBeCasted(nukeAbility, true, true, true, true) && !this.RazeCanWaitAttack(nukeAbility, target) && abilityHelper.UseAbility(nukeAbility, true)) { return(true); } } return(false); }
Damage IHasPassiveDamageIncrease.GetRawDamage(Unit9 unit, float?remainingHealth) { var damage = new Damage(); if (!unit.IsBuilding && !unit.IsAlly(this.Owner) && !this.Owner.IsIllusion && unit.GetAngle(this.Owner) > 2) { damage[this.DamageType] = this.DamageData.GetValue(this.Level) * this.Owner.TotalAgility; } return(damage); }
// Token: 0x06000503 RID: 1283 RVA: 0x0001A11C File Offset: 0x0001831C public bool CancelChanneling(TargetManager targetManager) { if (!base.Ability.IsChanneling || !base.Ability.BaseAbility.IsChanneling) { return(false); } Unit9 target = targetManager.Target; if (target.IsStunned || target.IsRooted) { return(false); } float num = base.Owner.Distance(this.castPosition) / base.Ability.Speed; Polygon polygon = new Polygon.Circle(this.castPosition, base.Ability.Radius, 20); Polygon.Circle circle = new Polygon.Circle(this.castPosition, base.Ability.Radius - num * target.Speed - 75f, 20); PredictionInput9 predictionInput = base.Ability.GetPredictionInput(target, null); predictionInput.Delay = this.primalSpring.ChannelTime - base.Ability.BaseAbility.ChannelTime + num; PredictionOutput9 predictionOutput = base.Ability.GetPredictionOutput(predictionInput); return(((!polygon.IsInside(predictionOutput.TargetPosition) && !circle.IsInside(target.Position) && target.GetAngle(this.castPosition, false) > 1.5f) || (float)this.primalSpring.GetCurrentDamage(target) > target.Health) && base.Owner.BaseUnit.Stop()); }
// Token: 0x06000298 RID: 664 RVA: 0x00010B14 File Offset: 0x0000ED14 public override bool CanHit(TargetManager targetManager, IComboModeMenu comboMenu) { Unit9 target = targetManager.Target; PredictionInput9 predictionInput = base.Ability.GetPredictionInput(target, null); predictionInput.Delay += base.Owner.Distance(target) / base.Ability.Speed; PredictionOutput9 predictionOutput = base.Ability.GetPredictionOutput(predictionInput); Vector3 ownerPosition = base.Owner.Position; this.castPosition = predictionOutput.CastPosition; Polygon.Rectangle polygon = new Polygon.Rectangle(ownerPosition, this.castPosition, this.timberChain.ChainRadius); Tree[] array = (from x in this.trees where x.IsValid && x.IsAlive && x.Distance2D(ownerPosition) < this.Ability.CastRange select x).ToArray <Tree>(); foreach (Tree tree3 in array) { if (polygon.IsInside(tree3.Position)) { return(false); } } Vector3 end = Vector3Extensions.Extend2D(ownerPosition, this.castPosition, base.Ability.CastRange); polygon = new Polygon.Rectangle(this.castPosition, end, this.timberChain.Radius); foreach (Tree tree2 in array) { if (polygon.IsInside(tree2.Position)) { this.castPosition = tree2.Position; return(true); } } if (base.Ability.Level < 4u || ownerPosition.Distance2D(this.castPosition, false) < 400f) { return(false); } IEnumerable <Tree> source = array; Func <Tree, float> < > 9__1; Func <Tree, float> keySelector; if ((keySelector = < > 9__1) == null) { keySelector = (< > 9__1 = ((Tree x) => x.Distance2D(this.castPosition))); } using (IEnumerator <Tree> enumerator = source.OrderBy(keySelector).GetEnumerator()) { while (enumerator.MoveNext()) { Tree tree = enumerator.Current; Vector3 position = tree.Position; if ((position.Distance2D(this.castPosition, false) <= 500f || target.GetAngle(position, false) <= 0.75f) && ownerPosition.Distance2D(this.castPosition, false) >= position.Distance2D(this.castPosition, false)) { polygon = new Polygon.Rectangle(ownerPosition, position, this.timberChain.ChainRadius); if (!array.Any((Tree x) => !x.Equals(tree) && polygon.IsInside(x.Position))) { this.castPosition = position; return(true); } } } } return(false); }
// Token: 0x060002DF RID: 735 RVA: 0x00011C48 File Offset: 0x0000FE48 public override bool ShouldCast(TargetManager targetManager) { Unit9 target = targetManager.Target; Modifier modifier = target.GetModifier(base.Debuff.DebuffModifierName); return((modifier == null || modifier.RemainingTime <= 2.5f) && !target.IsDarkPactProtected && !target.IsInvulnerable && !target.IsRooted && !target.IsStunned && !target.IsHexed && !targetManager.TargetSleeper.IsSleeping && (this.trap.IsFullyCharged || (base.Owner.Distance(target) > base.Ability.Radius * 0.6f && target.GetAngle(base.Owner.Position, false) > 2f))); }