예제 #1
0
        public Skillshot(DetectionType detectionType,
                         SkillshotData skillshotData,
                         int startT,
                         Vector2 startPosition,
                         Vector2 endPosition,
                         Obj_AI_Base caster)
        {
            DetectionType   = detectionType;
            SkillshotData   = skillshotData;
            StartTick       = startT;
            StartPosition   = startPosition;
            EndPosition     = endPosition;
            MissilePosition = startPosition;
            Direction       = (endPosition - startPosition).Normalized();
            Caster          = caster;

            //Create the spatial object for each type of skillshot.
            switch (skillshotData.Type)
            {
            case SkillShotType.SkillshotCircle:
                Circle = new SkillshotGeometry.Circle(CollisionEnd, skillshotData.Radius);
                break;

            case SkillShotType.SkillshotLine:
                Rectangle = new SkillshotGeometry.Rectangle(StartPosition, CollisionEnd, skillshotData.Radius);
                break;

            case SkillShotType.SkillshotMissileLine:
                Rectangle = new SkillshotGeometry.Rectangle(StartPosition, CollisionEnd, skillshotData.Radius);
                break;

            case SkillShotType.SkillshotCone:
                Sector = new SkillshotGeometry.Sector(
                    startPosition, CollisionEnd - startPosition, skillshotData.Radius * (float)Math.PI / 180,
                    skillshotData.Range);
                break;

            case SkillShotType.SkillshotRing:
                Ring = new SkillshotGeometry.Ring(CollisionEnd, skillshotData.Radius, skillshotData.RingRadius);
                break;
            }

            UpdatePolygon(); // Create the polygon
        }
예제 #2
0
        public Skillshot(DetectionType detectionType,
            SkillshotData skillshotData,
            int startT,
            Vector2 startPosition,
            Vector2 endPosition,
            Obj_AI_Base caster)
        {
            DetectionType = detectionType;
            SkillshotData = skillshotData;
            StartTick = startT;
            StartPosition = startPosition;
            EndPosition = endPosition;
            MissilePosition = startPosition;
            Direction = (endPosition - startPosition).Normalized();
            Caster = caster;

            //Create the spatial object for each type of skillshot.
            switch (skillshotData.Type)
            {
                case SkillShotType.SkillshotCircle:
                    Circle = new SkillshotGeometry.Circle(CollisionEnd, skillshotData.Radius);
                    break;
                case SkillShotType.SkillshotLine:
                    Rectangle = new SkillshotGeometry.Rectangle(StartPosition, CollisionEnd, skillshotData.Radius);
                    break;
                case SkillShotType.SkillshotMissileLine:
                    Rectangle = new SkillshotGeometry.Rectangle(StartPosition, CollisionEnd, skillshotData.Radius);
                    break;
                case SkillShotType.SkillshotCone:
                    Sector = new SkillshotGeometry.Sector(
                        startPosition, CollisionEnd - startPosition, skillshotData.Radius*(float) Math.PI/180,
                        skillshotData.Range);
                    break;
                case SkillShotType.SkillshotRing:
                    Ring = new SkillshotGeometry.Ring(CollisionEnd, skillshotData.Radius, skillshotData.RingRadius);
                    break;
            }

            UpdatePolygon(); // Create the polygon
        }