public void OnTick(EventArgs args) { if (CurrentClones.Count > 0) { CurrentClones.RemoveWhere(o => !o.IsValid || o.IsDead); } }
private void OnTick(EventArgs args) { // Validate clones if (CurrentClones.Count > 0) { CurrentClones.RemoveWhere(o => !o.IsValid || o.IsDead); } }
public void OnDraw(EventArgs args) { if (ShowClones != null && ShowClones.CurrentValue) { foreach (var clone in CurrentClones.Where(o => o.IsVisible && o.IsHPBarRendered)) { var cloneBounding = GetScreenBoudingRectangle(clone); var size = Math.Min(cloneBounding.Width, cloneBounding.Height); var halfSize = size / 2; EloBuddy.SDK.Rendering.Line.DrawLine(CloneLineColor, CloneRevealerLineWidth, cloneBounding.Center - halfSize, cloneBounding.Center + halfSize); EloBuddy.SDK.Rendering.Line.DrawLine(CloneLineColor, CloneRevealerLineWidth, cloneBounding.Center + new Vector2(-halfSize, halfSize), cloneBounding.Center + new Vector2(halfSize, -halfSize)); var realChamp = EntityManager.Heroes.Enemies.Find(o => o.Name == clone.Name); if (realChamp.IsVisible && realChamp.IsHPBarRendered) { var champBounding = GetScreenBoudingRectangle(realChamp); size = Math.Min(champBounding.Width, champBounding.Height) / 2; halfSize = size / 2; EloBuddy.SDK.Rendering.Line.DrawLine(OriginalLineColor, CloneRevealerLineWidth, champBounding.TopLeft + new Vector2(0, halfSize), champBounding.TopLeft, champBounding.TopLeft + new Vector2(halfSize, 0)); EloBuddy.SDK.Rendering.Line.DrawLine(OriginalLineColor, CloneRevealerLineWidth, champBounding.TopRight + new Vector2(-halfSize, 0), champBounding.TopRight, champBounding.TopRight + new Vector2(0, halfSize)); EloBuddy.SDK.Rendering.Line.DrawLine(OriginalLineColor, CloneRevealerLineWidth, champBounding.BottomRight + new Vector2(0, -halfSize), champBounding.BottomRight, champBounding.BottomRight + new Vector2(-halfSize, 0)); EloBuddy.SDK.Rendering.Line.DrawLine(OriginalLineColor, CloneRevealerLineWidth, champBounding.BottomLeft + new Vector2(halfSize, 0), champBounding.BottomLeft, champBounding.BottomLeft + new Vector2(0, -halfSize)); } } } }
public void OnCreate(GameObject sender, EventArgs args) { if (CurrentCloneChampions.Count > 0) { if (sender.IsEnemy) { var baseObject = sender as Obj_AI_Base; if (baseObject != null) { if (CurrentCloneChampions.Any(cloneChamp => baseObject.Name == cloneChamp.Name)) { CurrentClones.Add(baseObject); } } } } }
private void OnCreate(GameObject sender, EventArgs args) { // Check if there are clone champs if (CurrentCloneChampions.Count > 0) { // Check if the created object is an enemy if (sender.IsEnemy) { // Check if the object is a least a base object var baseObject = sender as Obj_AI_Base; if (baseObject != null) { // Check if the base object could be one of the enemy clones if (CurrentCloneChampions.Any(cloneChamp => baseObject.Name == cloneChamp.Name)) { // Add the revealed clone to the current clones CurrentClones.Add(baseObject); } } } } }
private void OnDraw(EventArgs args) { if (ShowClones != null && ShowClones.CurrentValue) { // Get all clones which are visible on screen // ReSharper disable once LoopCanBePartlyConvertedToQuery foreach (var clone in CurrentClones.Where(o => o.IsVisible && o.IsHPBarRendered)) { // Get the screen bounding of the clone var cloneBounding = Utilities.GetScreenBoudingRectangle(clone); // Cross through the clone var size = Math.Min(cloneBounding.Width, cloneBounding.Height); var halfSize = size / 2; // Draw the cross lines Line.DrawLine(CloneLineColor, CloneRevealerLineWidth, cloneBounding.Center - halfSize, cloneBounding.Center + halfSize); Line.DrawLine(CloneLineColor, CloneRevealerLineWidth, cloneBounding.Center + new Vector2(-halfSize, halfSize), cloneBounding.Center + new Vector2(halfSize, -halfSize)); // Check if the real champ is visible aswell var realChamp = EntityManager.Heroes.Enemies.Find(o => o.Name == clone.Name); if (realChamp.IsVisible && realChamp.IsHPBarRendered) { // Get the screen bounding of the real champ var champBounding = Utilities.GetScreenBoudingRectangle(realChamp); // Target the real champ size = Math.Min(champBounding.Width, champBounding.Height) / 2; halfSize = size / 2; // Top left Line.DrawLine(OriginalLineColor, CloneRevealerLineWidth, champBounding.TopLeft + new Vector2(0, halfSize), champBounding.TopLeft, champBounding.TopLeft + new Vector2(halfSize, 0)); // Top right Line.DrawLine(OriginalLineColor, CloneRevealerLineWidth, champBounding.TopRight + new Vector2(-halfSize, 0), champBounding.TopRight, champBounding.TopRight + new Vector2(0, halfSize)); // Bottom right Line.DrawLine(OriginalLineColor, CloneRevealerLineWidth, champBounding.BottomRight + new Vector2(0, -halfSize), champBounding.BottomRight, champBounding.BottomRight + new Vector2(-halfSize, 0)); // Bottom left Line.DrawLine(OriginalLineColor, CloneRevealerLineWidth, champBounding.BottomLeft + new Vector2(halfSize, 0), champBounding.BottomLeft, champBounding.BottomLeft + new Vector2(0, -halfSize)); } } } }