Esempio n. 1
0
        public override IEnumerable <AvoidInfo> OmenHandle(BattleCharacter spellCaster)
        {
            var cached = spellCaster.CastingSpellId;
            var square = Square(spellCaster);
            var result = new List <AvoidInfo>();

            result.Add(AvoidanceManager.AddAvoidPolygon(
                           () => spellCaster.IsValid && spellCaster.CastingSpellId == cached,
                           null,
                           40f,
                           bc => 0f,     //rotation
                           bc => 1.0f,   //scale
                           bc => 15.0f,  //height
                           bc => square, //points
                           bc => spellCaster.Location,
                           () => new[] { spellCaster } //objs
                           ));

            result.Add(AvoidanceManager.AddAvoidPolygon(
                           () => spellCaster.IsValid && spellCaster.CastingSpellId == cached,
                           null,
                           40f,
                           bc => (float)Math.PI, //rotation
                           bc => 1.0f,           //scale
                           bc => 15.0f,          //height
                           bc => square,         //points
                           bc => spellCaster.Location,
                           () => new[] { spellCaster } //objs
                           ));
            result.Add(AvoidanceManager.AddAvoidPolygon(
                           () => spellCaster.IsValid && spellCaster.CastingSpellId == cached,
                           null,
                           40f,
                           bc => - (float)Math.PI / 2, //rotation
                           bc => 1.0f,                 //scale
                           bc => 15.0f,                //height
                           bc => square,               //points
                           bc => spellCaster.Location,
                           () => new[] { spellCaster } //objs
                           ));
            result.Add(AvoidanceManager.AddAvoidPolygon(
                           () => spellCaster.IsValid && spellCaster.CastingSpellId == cached,
                           null,
                           40f,
                           bc => (float)Math.PI / 2, //rotation
                           bc => 1.0f,               //scale
                           bc => 15.0f,              //height
                           bc => square,             //points
                           bc => spellCaster.Location,
                           () => new[] { spellCaster } //objs
                           ));


            return(result);
        }
Esempio n. 2
0
        //public async Task<bool> Handle(SpellCast spellCaster)
        //{

        //    var res = inside(spellCaster.CasterLocation, spellCaster.CasterHeading, spellCaster.Data.EffectRange,
        //        spellCaster.Data.XAxisModified > 0 ? spellCast.Data.XAxisModified : spellCaster.Caster.CombatReach);
        //    if (res.Item1)
        //    {
        //        await Help.MoveTo(res.Item2, spellCaster);
        //    }
        //    return Core.Me.IsMelee();
        //}

        public override IEnumerable <AvoidInfo> OmenHandle(BattleCharacter spellCaster)
        {
            var cached = spellCaster.CastingSpellId;
            //var rotation = Rotation(spellCaster);
            //var cl = spellCaster.SpellCastInfo.CastLocation;
            var square = Square(spellCaster);

            return(new[] { AvoidanceManager.AddAvoidPolygon(
                               () => spellCaster.IsValid && spellCaster.CastingSpellId == cached,
                               null,
                               40f,
                               bc => 0f,     //rotation
                               bc => 1.0f,   //scale
                               bc => 15.0f,  //height
                               bc => square, //points
                               bc => spellCaster.Location,
                               () => new[] { spellCaster } //objs
                               ) });
        }
Esempio n. 3
0
        public override IEnumerable <AvoidInfo> OmenHandle(BattleCharacter spellCaster)
        {
            if (spellCaster.SpellCastInfo.SpellData.EffectRange > 45)
            {
                Logger.Info("Spell range is > 45. Does this require specific logic?");
            }
            //var loc = spellCaster.SpellCastInfo.CastLocation != Vector3.Zero ? spellCaster.SpellCastInfo.CastLocation : spellCaster.Location;

            Vector3 center;
            float   range = 0f;

            if (OmenOverrideManager.TryGetOverride(spellCaster.SpellCastInfo.ActionId, out var omenOverride))
            {
                range = Range(spellCaster, out center, omenOverride.MatrixOverride, omenOverride.RangeOverride);
            }
            else
            {
                range = Range(spellCaster, out center);
            }


            Logger.Info($"Avoid Torus: [{center}][Range: {range}][Middle: {range / 2.5}]");
            var cached = spellCaster.CastingSpellId;
            var points = Torus(range / 2.5f, range);

            return(new[] { AvoidanceManager.AddAvoidPolygon(
                               () => spellCaster.IsValid && spellCaster.CastingSpellId == cached, //can run
                               () => center,                                                      //LeashPoint
                               50f,                                                               //Leash Radius
                               bc => 0f,                                                          // Rotation
                               bc => 1.0f,                                                        // Scale
                               bc => 1.0f,                                                        //height
                               bc => points,                                                      //radiusProducer
                               bc => center,                                                      //locationProducer
                               () => new[] { spellCaster } //collectionProducer
                               ) });
        }