Skip to content
This repository has been archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
Merge pull request #542 from ArchiDog1998/main
Browse files Browse the repository at this point in the history
release plz.
  • Loading branch information
ArchiDog1998 authored Feb 16, 2024
2 parents bbf105c + 206e7a6 commit 9dbf511
Show file tree
Hide file tree
Showing 32 changed files with 228 additions and 290 deletions.
35 changes: 0 additions & 35 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,38 +17,3 @@ jobs:
release-type: node
package-name: release-please-action
default-branch: release

build:
name : build
needs: release-please
if: ${{ needs.release-please.outputs.released }}
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Set up .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 7.0.x

- name: Restore Dependencies
run: dotnet restore

- name: Download Dalamud
run: |
Invoke-WebRequest -Uri https://goatcorp.github.io/dalamud-distrib/latest.zip -OutFile latest.zip
Expand-Archive -Force latest.zip "$env:AppData\XIVLauncher\addon\Hooks\dev"
- name: Build Plugin
run: |
invoke-expression 'dotnet build --no-restore --configuration Release RotationSolver'
- name: publish on version change
id: publish_nuget
uses: alirezanet/publish-nuget@v3.0.4
with:
PROJECT_FILE_PATH: RotationSolver.Basic/RotationSolver.Basic.csproj
VERSION_FILE_PATH: Directory.Build.props
NUGET_KEY: ${{secrets.nuget_api_key}}
4 changes: 2 additions & 2 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
<TargetFramework>net7.0-windows</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Authors>ArchiTed</Authors>
<Version>4.0.0</Version>
<Version>4.0.1</Version>
<PlatformTarget>x64</PlatformTarget>
<Platforms>AnyCPU</Platforms>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>

</PropertyGroup>

<ItemGroup>
<Using Include="System.Numerics" />
<Using Include="System.Reflection" />
Expand Down
2 changes: 1 addition & 1 deletion Resources/RotationSolverRecord.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"ClickingCount": 60443,
"ClickingCount": 61038,
"SayingHelloCount": 13,
"SaidUsers": []
}
1 change: 1 addition & 0 deletions RotationSolver.Basic/Actions/ActionBasicInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ internal readonly bool BasicCheck(bool skipStatusProvideCheck, bool skipCombo, b
&& DataCenter.TimeSinceLastAction.TotalSeconds < 3) return false;

if (!(_action.Setting.ActionCheck?.Invoke() ?? true)) return false;
if (!(_action.Setting.RotationCheck?.Invoke() ?? true)) return false;

return true;
}
Expand Down
2 changes: 1 addition & 1 deletion RotationSolver.Basic/Actions/ActionConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ public bool IsEnabled
public bool ShouldCheckStatus { get; set; } = true;
public float AutoHealRatio { get; set; } = 0.8f;

public bool IsInCooldown { get; set; }
public bool IsInCooldown { get; set; } = true;
public bool IsInMistake { get; set; }
}
10 changes: 5 additions & 5 deletions RotationSolver.Basic/Actions/ActionSetting.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/// </summary>
public class ActionSetting()
{
public ActionID[]? Ninjutsu { get; set; } = null;
public IBaseAction[]? Ninjutsu { get; set; } = null;
public Func<uint?>? MPOverride { get; set; } = null;
public bool IsMeleeRange { get; set; } = false;
public bool StatusFromSelf { get; set; } = true;
Expand All @@ -25,16 +25,16 @@ public class ActionSetting()
/// </summary>
public StatusID[]? StatusNeed { get; set; } = null;

public Func<bool>? ActionCheck { get; set; } = null;

public Func<ActionConfig>? CreateConfig { get; set; } = null;
public Func<bool>? RotationCheck { get; set; } = null;
internal Func<bool>? ActionCheck { get; set; } = null;

internal Func<ActionConfig>? CreateConfig { get; set; } = null;

public bool IsFriendly { get; set; }

private TargetType _type = TargetType.Big;
public TargetType TargetType
{
{
get => IBaseAction.TargetOverride ?? _type;
set => _type = value;
}
Expand Down
36 changes: 33 additions & 3 deletions RotationSolver.Basic/Actions/ActionTargetInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -191,10 +191,38 @@ private readonly bool CheckTimeToKill(GameObject gameObject)
{
return FindTargetArea(canTargets, canAffects, range, player);
}
else if (DataCenter.IsManual)
{
var t = Svc.Targets.Target as BattleChara;

if (t == null) return null;

if (IsSingleTarget)
{
if (canTargets.Contains(Svc.Targets.Target))
{
return new(t, [.. GetAffects(t, canAffects)], t.Position);
}
}
else
{
var effects = GetAffects(t, canAffects).ToArray();
if(effects.Length >= _action.Config.AoeCount)
{
return new(t, effects, t.Position);
}
}
return null;
}

var targets = GetMostCanTargetObjects(canTargets, canAffects,
skipAoeCheck ? 0 : _action.Config.AoeCount);
var target = FindTargetByType(targets, _action.Setting.TargetType, _action.Config.AutoHealRatio, _action.Setting.IsMeleeRange);
var type = _action.Setting.TargetType;
if (type == TargetType.BeAttacked && !_action.Setting.IsFriendly)
{
type = TargetType.Big;
}
var target = FindTargetByType(targets, type, _action.Config.AutoHealRatio, _action.Setting.IsMeleeRange);
if (target == null) return null;

return new(target, [.. GetAffects(target, canAffects)], target.Position);
Expand Down Expand Up @@ -723,10 +751,12 @@ private readonly bool CanGetTarget(GameObject target, GameObject subTarget)
return null;
}

private static BattleChara RandomObject(IEnumerable<BattleChara> objs)
private static BattleChara? RandomObject(IEnumerable<BattleChara> objs)
{
Random ran = new(DateTime.Now.Millisecond);
return objs.ElementAt(ran.Next(objs.Count()));
var count = objs.Count();
if (count == 0) return null;
return objs.ElementAt(ran.Next(count));
}

#endregion
Expand Down
4 changes: 1 addition & 3 deletions RotationSolver.Basic/Actions/BaseAction.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using ECommons.DalamudServices;
using ECommons.GameHelpers;
using FFXIVClientStructs.FFXIV.Client.Game;
using static Dalamud.Interface.Utility.Raii.ImRaii;
using Action = Lumina.Excel.GeneratedSheets.Action;

namespace RotationSolver.Basic.Actions;
Expand Down Expand Up @@ -51,7 +50,6 @@ public bool IsInCooldown

public bool EnoughLevel => Info.EnoughLevel;


public ActionSetting Setting { get; set; }

public ActionConfig Config
Expand All @@ -67,7 +65,7 @@ public ActionConfig Config
}
}

internal BaseAction(ActionID actionID, bool isDutyAction)
public BaseAction(ActionID actionID, bool isDutyAction = false)
{
Action = Service.GetSheet<Action>().GetRow((uint)actionID)!;
TargetInfo = new(this);
Expand Down
5 changes: 3 additions & 2 deletions RotationSolver.Basic/Attributes/UIAttributes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ public class UIAttribute(string name) : Attribute

public enum JobFilterType : byte
{
None,
NoJob,
NoHealer,
Healer,
Expand All @@ -28,12 +29,12 @@ public enum JobFilterType : byte
Melee,
}

[AttributeUsage(AttributeTargets.Field)]
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Property)]
internal class JobConfigAttribute : Attribute
{
}

[AttributeUsage(AttributeTargets.Field)]
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Property)]
internal class JobChoiceConfigAttribute : Attribute
{
}
Expand Down
10 changes: 4 additions & 6 deletions RotationSolver.Basic/Configuration/Configs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public const string
public MacroInfo DutyEnd { get; set; } = new MacroInfo();

[ConditionBool, UI("Show RS logo animation",
Filter =UiWindows)]
Filter = UiWindows)]
private static readonly bool _drawIconAnimation = true;

[ConditionBool, UI("Auto turn off when player is moving between areas.",
Expand Down Expand Up @@ -80,8 +80,6 @@ public const string
Filter =UiInformation)]
private static readonly bool _showInfoOnToast = true;



[ConditionBool, UI("Lock the movement when casting or when doing some actions.",
Description = "LT is for gamepad player", Filter = Extra)]
private static readonly bool _poslockCasting = false;
Expand Down Expand Up @@ -314,7 +312,7 @@ public const string
[ConditionBool, UI("Automatically trigger dps burst phase", Filter = AutoActionCondition)]
private static readonly bool _autoBurst = true;

[ConditionBool, UI("Automatic Heal")]
[ConditionBool, UI("Automatic Heal", Filter = AutoActionCondition)]
private static readonly bool _autoHeal = true;

[ConditionBool, UI("Auto-use abilities", Filter = AutoActionUsage)]
Expand Down Expand Up @@ -713,11 +711,11 @@ public const string
[LinkDescription($"https://raw.githubusercontent.com/{Service.USERNAME}/{Service.REPO}/main/Images/HowAndWhenToClick.svg",
"This plugin helps you to use the right action during the combat. Here is a guide about the different options.")]
[JobConfig, Range(0, 0.5f, ConfigUnitType.Seconds)]
[UI("Action Ahead")]
[UI("Action Ahead", Filter = BasicTimer)]
private readonly float _actionAhead = 0.08f;

[JobConfig, UI("Engage settings", Filter = TargetConfig, PvPFilter = JobFilterType.NoJob)]
private readonly TargetHostileType _hostileType;
private readonly TargetHostileType _hostileType = TargetHostileType.TargetsHaveTarget;

[JobConfig]
private readonly string _PvPRotationChoice = string.Empty;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public interface IRotationConfig
string Value { get; set; }

/// <summary>
/// Happend when it is on the command.
/// Happened when it is on the command.
/// </summary>
/// <param name="set"></param>
/// <param name="str"></param>
Expand Down
12 changes: 8 additions & 4 deletions RotationSolver.Basic/Rotations/Basic/BardRotation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,15 @@ static partial void ModifyWindbitePvE(ref ActionSetting setting)

static partial void ModifyIronJawsPvE(ref ActionSetting setting)
{
setting.TargetStatusNeed = setting.TargetStatusProvide =
[StatusID.VenomousBite, StatusID.CausticBite,
StatusID.Windbite, StatusID.Stormbite];
setting.TargetStatusProvide = [StatusID.VenomousBite, StatusID.CausticBite, StatusID.Windbite, StatusID.Stormbite];
setting.CanTarget = t =>
{
if (t.WillStatusEndGCD(0, 0, true, StatusID.VenomousBite, StatusID.CausticBite)) return false;
if (t.WillStatusEndGCD(0, 0, true, StatusID.Windbite, StatusID.Stormbite)) return false;
return true;
};
}

static partial void ModifyPitchPerfectPvE(ref ActionSetting setting)
{
setting.ActionCheck = () => Song == Song.WANDERER && Repertoire > 0;
Expand Down
Loading

0 comments on commit 9dbf511

Please sign in to comment.