Skip to content

Commit

Permalink
HealthPrediction: HasMinionAggro, Orbwalker: Lanefreeze features.
Browse files Browse the repository at this point in the history
  • Loading branch information
DZ191 committed Jun 4, 2015
1 parent 6695389 commit d61ceb2
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
5 changes: 5 additions & 0 deletions HealthPrediction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,11 @@ public static float LaneClearHealthPrediction(Obj_AI_Base unit, int time, int de
return unit.Health - predictedDamage;
}

public static bool HasMinionAggro(Obj_AI_Minion minion)
{
return ActiveAttacks.Values.Any(m => (m.Source is Obj_AI_Minion) && m.Target == minion);
}

private class PredictedDamage
{
public readonly float AnimationTime;
Expand Down
19 changes: 14 additions & 5 deletions Orbwalking.cs
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ public Orbwalker(Menu attachToMenu)
misc.AddItem(
new MenuItem("HoldPosRadius", "Hold Position Radius").SetShared().SetValue(new Slider(0, 0, 250)));
misc.AddItem(new MenuItem("PriorizeFarm", "Priorize farm over harass").SetShared().SetValue(true));
misc.AddItem(new MenuItem("FreezeHealth", "LaneFreeze Damage %").SetShared().SetValue(new Slider(50, 1)));
misc.AddItem(new MenuItem("FreezeHealth", "LaneFreeze Damage %").SetShared().SetValue(new Slider(50, 50)));
misc.AddItem(new MenuItem("PermaShow", "PermaShow").SetShared().SetValue(true)).ValueChanged += (s, args) => {
if (args.GetNewValue<bool>())
{
Expand Down Expand Up @@ -658,16 +658,25 @@ public virtual AttackableUnit GetTarget()
if (ActiveMode == OrbwalkingMode.LaneClear || ActiveMode == OrbwalkingMode.Mixed ||
ActiveMode == OrbwalkingMode.LastHit)
{
foreach (var minion in
var FreezeActive = _config.Item("Freeze").GetValue<KeyBind>().Active && ActiveMode != OrbwalkingMode.LaneClear;
var MinionList =
ObjectManager.Get<Obj_AI_Minion>()
.Where(
minion =>
minion.IsValidTarget() && InAutoAttackRange(minion) &&
minion.Health <
2 *
(ObjectManager.Player.BaseAttackDamage + ObjectManager.Player.FlatPhysicalDamageMod))
)
(ObjectManager.Player.BaseAttackDamage + ObjectManager.Player.FlatPhysicalDamageMod));

if (FreezeActive)
{
MinionList = MinionList.Where(HealthPrediction.HasMinionAggro);
}

foreach (var minion in MinionList)
{
var FreezeDamage = Player.GetAutoAttackDamage(minion, false) * (_config.Item("FreezeHealth").GetValue<Slider>().Value / 100f);

var t = (int)(Player.AttackCastDelay * 1000) - 100 + Game.Ping / 2 +
1000 * (int)Player.Distance(minion) / (int)GetMyProjectileSpeed();
var predHealth = HealthPrediction.GetHealthPrediction(minion, t, FarmDelay);
Expand All @@ -679,7 +688,7 @@ public virtual AttackableUnit GetTarget()
FireOnNonKillableMinion(minion);
}

if (predHealth > 0 && predHealth <= (_config.Item("Freeze").GetValue<KeyBind>().Active ? Player.GetAutoAttackDamage(minion, false) * (_config.Item("FreezeHealth").GetValue<Slider>().Value / 100f) : Player.GetAutoAttackDamage(minion, true)))
if (predHealth > 0 && predHealth <= (FreezeActive ? FreezeDamage : Player.GetAutoAttackDamage(minion, true)))
{
return minion;
}
Expand Down

0 comments on commit d61ceb2

Please sign in to comment.