コード例 #1
0
ファイル: SkillshotDetector.cs プロジェクト: Kysamaa/EloBuddy
 private static void ObjMissileClientOnCreateDelayed(MissileClient missile, SpellData spellData)
 {
     var unit = missile.SpellCaster as AIHeroClient;
         var missilePosition = missile.Position.To2D();
         var unitPosition = missile.StartPosition.To2D();
         var endPos = missile.EndPosition.To2D();
         var direction = (endPos - unitPosition).Normalized();
         if (unitPosition.Distance(endPos) > spellData.Range || spellData.FixedRange)
         {
             endPos = unitPosition + direction * spellData.Range;
         }
         if (spellData.ExtraRange != -1)
         {
             endPos += Math.Min(spellData.ExtraRange, spellData.Range - endPos.Distance(unitPosition)) * direction;
         }
         var castTime = Extensions.GameTimeTickCount - Game.Ping / 2 - (spellData.MissileDelayed ? 0 : spellData.Delay)
                        - (int)(1000 * missilePosition.Distance(unitPosition) / spellData.MissileSpeed);
         TriggerOnDetectSkillshot(DetectionType.RecvPacket, spellData, castTime, unitPosition, endPos, unit);
 }
コード例 #2
0
ファイル: Skillshot.cs プロジェクト: Kysamaa/EloBuddy
 public Skillshot(
     DetectionType detectionType,
     SpellData spellData,
     int startT,
     Vector2 start,
     Vector2 end,
     Obj_AI_Base unit)
 {
     this.DetectionType = detectionType;
     this.SpellData = spellData;
     this.StartTick = startT;
     this.Start = start;
     this.End = end;
     this.Direction = (end - start).Normalized();
     this.Unit = unit;
     switch (spellData.Type)
     {
         case SkillShotType.SkillshotCircle:
             this.Circle = new Geometry.Polygon.Circle(this.CollisionEnd, spellData.Radius, 22);
             break;
         case SkillShotType.SkillshotLine:
         case SkillShotType.SkillshotMissileLine:
             this.Rectangle = new Geometry.Polygon.Rectangle(this.Start, this.CollisionEnd, spellData.Radius);
             break;
         case SkillShotType.SkillshotCone:
             this.Sector = new Geometry.Polygon.Sector(
                 start,
                 this.CollisionEnd - start,
                 spellData.Radius * (float)Math.PI / 180,
                 spellData.Range,
                 22);
             break;
         case SkillShotType.SkillshotRing:
             this.Ring = new Geometry.Polygon.Ring(this.CollisionEnd, spellData.Radius, spellData.RingRadius, 22);
             break;
         case SkillShotType.SkillshotArc:
             this.Arc = new Geometry.Polygon.Arc(
                 start,
                 end,
                 Configs.SkillShotsExtraRadius + (int)ObjectManager.Player.BoundingRadius,
                 22);
             break;
     }
     this.UpdatePolygon();
 }
コード例 #3
0
ファイル: SkillshotDetector.cs プロジェクト: Kysamaa/EloBuddy
 private static void TriggerOnDetectSkillshot(
         DetectionType detectionType,
         SpellData spellData,
         int startT,
         Vector2 start,
         Vector2 end,
         Obj_AI_Base unit)
 {
     if (OnDetectSkillshot != null)
         {
             OnDetectSkillshot(new Skillshot(detectionType, spellData, startT, start, end, unit));
         }
 }
コード例 #4
0
ファイル: EvadeManager.cs プロジェクト: Kysamaa/EloBuddy
 private static void ObjSpellMissileOnCreate(GameObject sender, EventArgs args)
 {
     if (!sender.IsValid<MissileClient>())
     {
         return;
     }
     var missile = (MissileClient)sender;
     if (!missile.SpellCaster.IsValid<AIHeroClient>() || missile.SpellCaster.Team == ObjectManager.Player.Team)
     {
         return;
     }
     var unit = (AIHeroClient)missile.SpellCaster;
     var spellData =
         Spells.FirstOrDefault(
             i =>
             i.SpellNames.Contains(missile.SData.Name.ToLower())
             && Manager.MenuManager.EvadeMenu[i.MissileName].Cast<CheckBox>().CurrentValue);
     if (spellData == null && EloBuddy.SDK.Constants.AutoAttacks.IsAutoAttack(missile.SData) //MenuManager.LaneClearMenu["E"].Cast<CheckBox>().CurrentValue
         && (!missile.SData.Name.ToLower().Contains("crit")
                 ? Manager.MenuManager.EvadeMenu["BAttack"].Cast<CheckBox>().CurrentValue
                   && ObjectManager.Player.HealthPercent < Manager.MenuManager.EvadeMenu["BAttackHpU"].Cast<Slider>().CurrentValue
                 : Manager.MenuManager.EvadeMenu["CAttack"].Cast<CheckBox>().CurrentValue
                   && ObjectManager.Player.HealthPercent < Manager.MenuManager.EvadeMenu["CAttackHpU"].Cast<Slider>().CurrentValue))
     {
         spellData = new SpellData
         { ChampionName = unit.ChampionName, SpellNames = new[] { missile.SData.Name } };
     }
     if (spellData == null || !missile.Target.IsMe)
     {
         return;
     }
     DetectedTargets.Add(new Targets { Start = unit.ServerPosition, Obj = missile });
 }