From 25955fa1824fdeee7a028ca53d86c0924befb68b Mon Sep 17 00:00:00 2001 From: nt153133 <52430037+nt153133@users.noreply.github.com> Date: Sat, 26 Oct 2019 20:04:43 -0400 Subject: [PATCH 1/2] Added avoid for Cross shaped avoid. Seems to work well on HoH mob, The aoe effect is plus shaped so a rectangle (taken from lazergeneric) is applied at the 4 rotational spots that correspond to cardinal directions. --- Avoid/CrossGeneric.cs | 83 +++++++++++++++++++++++++++++++++++++++++++ SideStep.csproj | 1 + 2 files changed, 84 insertions(+) create mode 100644 Avoid/CrossGeneric.cs diff --git a/Avoid/CrossGeneric.cs b/Avoid/CrossGeneric.cs new file mode 100644 index 0000000..92a42bd --- /dev/null +++ b/Avoid/CrossGeneric.cs @@ -0,0 +1,83 @@ +using System; +using System.Collections.Generic; +using ff14bot.Managers; +using ff14bot.Objects; +using ff14bot.Pathing.Avoidance; +using Sidestep.Common; +using Sidestep.Interfaces; +using Sidestep.Logging; + +namespace Sidestep.Avoid +{ + [Avoider(AvoiderType.Omen, 188)] + public class CrossGeneric : Omen + { + public override IEnumerable OmenHandle(BattleCharacter spellCaster) + { + var cached = spellCaster.CastingSpellId; + //var rotation = Rotation(spellCaster); + //var cl = spellCaster.SpellCastInfo.CastLocation; + var square = Square(spellCaster); + var result = new List(); + var range = Range(spellCaster, out var center); + + Logger.Info($"Avoid Cross: [{center}][Range: {range}] EffectiveRange [{spellCaster.SpellCastInfo.SpellData.EffectRange}]"); + + result.Add(AvoidanceManager.AddAvoidPolygon( + () => spellCaster.IsValid && spellCaster.CastingSpellId == cached, + null, + 40f, + bc => bc.Heading, //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 => bc.Heading - (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 => bc.Heading - (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 => bc.Heading + (float) Math.PI / 2, //rotation + bc => 1.0f, //scale + bc => 15.0f, //height + bc => square, //points + bc => spellCaster.Location, + () => new[] {spellCaster} //objs + )); + + //Add circle right under mob + result.Add(AvoidanceManager.AddAvoidLocation( + () => spellCaster.IsValid && spellCaster.CastingSpellId == cached, //can run + 3f, + () => spellCaster.Location + )); + + + return result.ToArray(); + } + } +} \ No newline at end of file diff --git a/SideStep.csproj b/SideStep.csproj index 95c92c5..432f83e 100644 --- a/SideStep.csproj +++ b/SideStep.csproj @@ -105,6 +105,7 @@ + From e4d7952179c03834e05dd2d32b8d076511e6058b Mon Sep 17 00:00:00 2001 From: nt153133 <52430037+nt153133@users.noreply.github.com> Date: Sat, 26 Oct 2019 20:08:59 -0400 Subject: [PATCH 2/2] forgot license --- Avoid/CrossGeneric.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Avoid/CrossGeneric.cs b/Avoid/CrossGeneric.cs index 92a42bd..cdbed90 100644 --- a/Avoid/CrossGeneric.cs +++ b/Avoid/CrossGeneric.cs @@ -1,4 +1,12 @@ -using System; +/* +SideStep is licensed under a +Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License. +You should have received a copy of the license along with this +work. If not, see . +Orginal work done by zzi + */ + +using System; using System.Collections.Generic; using ff14bot.Managers; using ff14bot.Objects;