Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
91 changes: 91 additions & 0 deletions Avoid/CrossGeneric.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
/*
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 <http://creativecommons.org/licenses/by-nc-sa/4.0/>.
Orginal work done by zzi
*/

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<AvoidInfo> OmenHandle(BattleCharacter spellCaster)
{
var cached = spellCaster.CastingSpellId;
//var rotation = Rotation(spellCaster);
//var cl = spellCaster.SpellCastInfo.CastLocation;
var square = Square(spellCaster);
var result = new List<AvoidInfo>();
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();
}
}
}
1 change: 1 addition & 0 deletions SideStep.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@
<Reference Include="System" />
</ItemGroup>
<ItemGroup>
<Compile Include="Avoid\CrossGeneric.cs" />
<Compile Include="Avoid\LazerGeneric.cs" />
<Compile Include="Avoid\Triangles.cs" />
<Compile Include="Avoid\CircleGeneric.cs" />
Expand Down