コード例 #1
0
        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.Circle(this.CollisionEnd, spellData.Radius);
                break;

            case SkillShotType.SkillshotLine:
                this.Rectangle = new Geometry.Rectangle(this.Start, this.CollisionEnd, spellData.Radius);
                break;

            case SkillShotType.SkillshotMissileLine:
                this.Rectangle = new Geometry.Rectangle(this.Start, this.CollisionEnd, spellData.Radius);
                break;

            case SkillShotType.SkillshotCone:
                this.Sector = new Geometry.Sector(
                    start,
                    this.CollisionEnd - start,
                    spellData.Radius * (float)Math.PI / 180,
                    spellData.Range);
                break;

            case SkillShotType.SkillshotRing:
                this.Ring = new Geometry.Ring(this.CollisionEnd, spellData.Radius, spellData.RingRadius);
                break;

            case SkillShotType.SkillshotArc:
                this.Arc = new Geometry.Arc(
                    start,
                    end,
                    Config.SkillShotsExtraRadius + (int)ObjectManager.Player.BoundingRadius);
                break;
            }
            this.UpdatePolygon();
        }
コード例 #2
0
ファイル: Skillshot.cs プロジェクト: q51251/ProjectFiora
 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.Circle(this.CollisionEnd, spellData.Radius);
             break;
         case SkillShotType.SkillshotLine:
             this.Rectangle = new Geometry.Rectangle(this.Start, this.CollisionEnd, spellData.Radius);
             break;
         case SkillShotType.SkillshotMissileLine:
             this.Rectangle = new Geometry.Rectangle(this.Start, this.CollisionEnd, spellData.Radius);
             break;
         case SkillShotType.SkillshotCone:
             this.Sector = new Geometry.Sector(
                 start,
                 this.CollisionEnd - start,
                 spellData.Radius * (float)Math.PI / 180,
                 spellData.Range);
             break;
         case SkillShotType.SkillshotRing:
             this.Ring = new Geometry.Ring(this.CollisionEnd, spellData.Radius, spellData.RingRadius);
             break;
         case SkillShotType.SkillshotArc:
             this.Arc = new Geometry.Arc(
                 start,
                 end,
                 Config.SkillShotsExtraRadius + (int)ObjectManager.Player.BoundingRadius);
             break;
     }
     this.UpdatePolygon();
 }