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

Commit

Permalink
Merge branch 'testing'
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaksuhn committed Feb 18, 2024
2 parents 85ee8ff + 59daa32 commit ee0f339
Show file tree
Hide file tree
Showing 45 changed files with 570 additions and 796 deletions.
28 changes: 13 additions & 15 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,19 @@ jobs:
submodules: true

- name: Get Tag Name
run: echo "tag=$(echo ${{ github.ref }} | sed 's/refs\/tags\/v//')" >> $GITHUB_ENV
run: |
tag=$(echo ${{ github.ref }} | sed 's/refs\/tags\/v//')
echo "tag=$tag" >> $GITHUB_ENV
if [[ "$tag" == *"-test" ]]; then
branch="testing"
tag=$(echo $tag | sed 's/-test//')
else
branch="latest"
fi
echo "branch=$branch" >> $GITHUB_ENV
echo "tag=$tag" >> $GITHUB_ENV
- name: Set up .NET
uses: actions/setup-dotnet@v3
Expand All @@ -35,20 +47,6 @@ jobs:
- name: Build Project
run: dotnet build --configuration Release RotationSolver/RotationSolver.csproj -p:AssemblyVersion=${{ env.tag }}

- name: Get Tag Name
run: |
tag=$(echo ${{ github.ref }} | sed 's/refs\/tags\/v//')
echo "tag=$tag" >> $GITHUB_ENV
if [[ "$tag" == *"-test" ]]; then
branch="testing"
tag=$(echo $tag | sed 's/-test//')
else
branch="latest"
fi
echo "branch=$branch" >> $GITHUB_ENV
echo "tag=$tag" >> $GITHUB_ENV
- name: Publish Version
uses: PunishXIV/dynamis-action@v1
id: dynamis
Expand Down
2 changes: 1 addition & 1 deletion ECommons
Submodule ECommons updated 139 files
6 changes: 5 additions & 1 deletion Resources/HostileCastingArea.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,13 @@
8028,
8039,
8367,
8521,
8581,
9349,
9414,
9416,
9523,
9568,
9660,
9665,
9670,
Expand All @@ -79,6 +82,7 @@
9828,
9841,
9869,
9990,
10086,
10097,
10284,
Expand Down Expand Up @@ -481,4 +485,4 @@
30288,
28907,
24189
]
]
3 changes: 2 additions & 1 deletion Resources/PriorityStatus.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
[
944
]
1290
]
11 changes: 7 additions & 4 deletions RotationSolver.Basic/Actions/BaseAction_ActionInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -187,10 +187,9 @@ public unsafe virtual bool CanUse(out IAction act, CanUseOption option = CanUseO
Target = target;
AffectedTargets = affectedTargets;

if (!option.HasFlag(CanUseOption.IgnoreTarget)) _targetId = target.ObjectId;
//if (!option.HasFlag(CanUseOption.IgnoreTarget)) _targetId = target.ObjectId; // Disabled because no longer needed?
return true;
}

private bool CheckForCombo()
{
if (ComboIdsNot != null)
Expand Down Expand Up @@ -224,19 +223,23 @@ private bool CheckForCombo()
public unsafe bool Use()
{
var adjustId = AdjustedID;
//Svc.Log.Verbose($"Action use requested for {adjustId}");
if (_action.TargetArea && adjustId == ID)
{
var loc = new FFXIVClientStructs.FFXIV.Common.Math.Vector3() { X = Position.X, Y = Position.Y, Z = Position.Z };

//Svc.Log.Verbose($"Action has a target area, must specify target of {loc.X}, {loc.Y}, {loc.Z}");
return ActionManager.Instance()->UseActionLocation(ActionType.Action, ID, Player.Object.ObjectId, &loc);
}
else if (Svc.Objects.SearchById(_targetId) == null)
else if (Svc.Objects.SearchById(TargetID) == null)
{
//Svc.Log.Verbose($"{TargetID} not found, dropping action");
return false;
}
else
{
return ActionManager.Instance()->UseAction(ActionType.Action, adjustId, _targetId);
//Svc.Log.Verbose($"Using action {adjustId} on target {TargetID}");
return ActionManager.Instance()->UseAction(ActionType.Action, adjustId, TargetID);
}
}
}
17 changes: 0 additions & 17 deletions RotationSolver.Basic/Actions/BaseAction_BasicInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -153,23 +153,6 @@ public bool IsInCooldown
}
}

/// <inheritdoc/>
public bool IsInMistake
{
get => !Service.Config.GlobalConfig.NotInMistakeActions.Contains(ID);
set
{
if (value)
{
Service.Config.GlobalConfig.NotInMistakeActions.Remove(ID);
}
else
{
Service.Config.GlobalConfig.NotInMistakeActions.Add(ID);
}
}
}

/// <summary>
/// Action ID.
/// </summary>
Expand Down
24 changes: 20 additions & 4 deletions RotationSolver.Basic/Actions/BaseAction_Target.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,22 @@ public float TimeToKill
/// <summary>
/// The action's target.
/// </summary>
public BattleChara Target { get; private set; } = Player.Object;
public BattleChara Target { get; private set; }

public uint TargetID
{
get
{
if (Target == null)
{
return Svc.ClientState.LocalPlayer.ObjectId;
}
else
{
return Target.ObjectId;
}
}
}

/// <inheritdoc/>
public BattleChara[] AffectedTargets { get; private set; } = Array.Empty<BattleChara>();
Expand All @@ -64,7 +79,7 @@ public float TimeToKill
/// The position
/// </summary>
public Vector3 Position { get; private set; } = default;
private uint _targetId = Player.Object?.ObjectId ?? 0;
//private uint _targetId = 0;

private Func<IEnumerable<BattleChara>, bool, BattleChara> _choiceTarget = null;

Expand Down Expand Up @@ -107,7 +122,8 @@ internal static bool TankBreakOtherCheck(Job id)
/// <inheritdoc/>
public bool FindTarget(bool mustUse, byte aoeCount, out BattleChara target, out BattleChara[] affectedTargets)
{
aoeCount = Math.Max(aoeCount, mustUse ? (byte)1 : AOECount);
if (aoeCount == 0)
aoeCount = mustUse ? (byte)1 : AOECount;

Position = Player.Object.Position;
var player = Player.Object;
Expand Down Expand Up @@ -442,7 +458,7 @@ private bool TargetHostileManual(BattleChara b, bool mustUse, int aoeCount, out
if (!CanUseTo(b)) return false;
if (ChoiceTarget(TargetFilterFuncEot(new BattleChara[] { b }, mustUse), mustUse) == null) return false;

if (IsSingleTarget)
if (IsSingleTarget || aoeCount == 1)
{
if (!mustUse)
{
Expand Down
4 changes: 0 additions & 4 deletions RotationSolver.Basic/Actions/IBaseAction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@
/// </summary>
public interface IBaseAction : IAction
{
/// <summary>
/// Is in the mistake actions.
/// </summary>
bool IsInMistake { get; set; }

/// <summary>
/// Attack Type
Expand Down
41 changes: 20 additions & 21 deletions RotationSolver.Basic/Configuration/Configs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,6 @@ public class GlobalConfig
public SortedSet<Job> DisabledJobs { get; private set; } = new();
public SortedSet<uint> DisabledActions { get; private set; } = new();
public SortedSet<uint> NotInCoolDownActions { get; private set; } = new();
public SortedSet<uint> NotInMistakeActions { get; private set; } = new();
public SortedSet<uint> DisabledItems { get; private set; } = new();
public SortedSet<uint> NotInCoolDownItems { get; private set; } = new();
public List<ActionEventInfo> Events { get; private set; } = new();
Expand Down Expand Up @@ -260,43 +259,42 @@ public enum PluginConfigInt : byte
public enum PluginConfigBool : byte
{
[Default(true)] DrawIconAnimation,
[Default(true)] AutoOffBetweenArea,
[Default(true)] AutoOffCutScene,
[Default(false)] AutoOffBetweenArea,
[Default(false)] AutoOffCutScene,
[Default(true)] AutoOffWhenDead,
[Default(true)] AutoOffWhenDutyCompleted,
[Default(true)] ChangeTargetForFate,
[Default(true)] MoveTowardsScreenCenter,
[Default(true)] SayOutStateChanged,
[Default(false)] SayOutStateChanged,
[Default(true)] ShowInfoOnDtr,
[Default(false)] HealOutOfCombat,
[Default(true)] ShowInfoOnToast,
[Default(false)] ShowInfoOnToast,
[Default(false)] RaiseAll,

[Default(false)] PoslockCasting,
[Default(false)] PosPassageOfArms,
[Default(true)] PosTenChiJin,
[Default(false)] PosTenChiJin,
[Default(false)] PosFlameThrower,
[Default(false)] PosImprovisation,

[Default(true)] RaisePlayerByCasting,
[Default(true)] RaiseBrinkOfDeath,
[Default(false)] TargetAllSolo,
[Default(true)] AddEnemyListToHostile,
[Default(false)] OnlyAttackInEnemyList,
[Default(false)] UseTinctures,
[Default(false)] UseHealPotions,

[Default(true)] DrawMeleeOffset,

[Default(true)] ShowMoveTarget,
[Default(false)] ShowTargetTimeToKill,
[Default(true)] ShowTarget,
[Default(false)] ShowTarget,
[Default(true)] ChooseAttackMark,
[Default(true)] CanAttackMarkAOE,
[Default(true)] FilterStopMark,
[Default(true)] ShowHostilesIcons,
[Default(false)] ShowHostilesIcons,

[Default(true)] TeachingMode,
[Default(true)] UseOverlayWindow,
[Default(false)] TeachingMode,
[Default(false)] UseOverlayWindow,
[Default(true)] KeyBoardNoise,

[Default(true)] MoveAreaActionFarthest,
Expand All @@ -323,10 +321,10 @@ public enum PluginConfigBool : byte

[Default(false)] ToggleManual,
[Default(false)] ToggleAuto,
[Default(true)] OnlyShowWithHostileOrInDuty,
[Default(false)] OnlyShowWithHostileOrInDuty,
[Default(false)] ShowControlWindow,
[Default(false)] IsControlWindowLock,
[Default(true)] ShowNextActionWindow,
[Default(false)] ShowNextActionWindow,
[Default(false)] IsInfoWindowNoInputs,
[Default(false)] IsInfoWindowNoMove,
[Default(false)] ShowItemsCooldown,
Expand All @@ -339,7 +337,7 @@ public enum PluginConfigBool : byte
[Default(true)] TargetFatePriority,
[Default(true)] TargetHuntingRelicLevePriority,
[Default(true)] TargetQuestPriority,
[Default(true)] ShowToastsAboutDoAction,
[Default(false)] ShowToastsAboutDoAction,

[Default(true)] UseAOEAction,
[Default(false)] UseAOEWhenManual,
Expand All @@ -357,21 +355,23 @@ public enum PluginConfigBool : byte
[Default(false)] TargetAllForFriendly,
[Default(false)] ShowCooldownWindow,

[Default(true)] UseLostActions,
[Default(false)] UseLostFlareStarOnMobs,
[Default(true)] UseLostAssassinationOnMobs,
[Default(true)] LostReflectAutoRefresh,

[Default(true)] RecordCastingArea,

[Default(true)] AutoOffAfterCombat,
[Default(false)] AutoOpenChest,
[Default(true)] AutoCloseChestWindow,

[Default(true)] ShowStateIcon,
[Default(true)] ShowBeneficialPositions,
[Default(false)] ShowBeneficialPositions,
[Default(false)] HideWarning,

[Default(true)] HealWhenNothingTodo,
[Default(true)] UseResourcesAction,
[Default(true)] SayHelloToAll,
[Default(true)] SayHelloToUsers,
[Default(false)] JustSayHelloOnce,

[Default(false)] UseAdditionalConditions,
[Default(false)] OnlyHealSelfWhenNoHealer,
Expand All @@ -394,8 +394,6 @@ public enum PluginConfigFloat : byte
[Default(0.8f, 0f, 1f), Unit(ConfigUnitType.Percent)] HealWhenNothingTodoBelow,
[Default(0.6f, 0f, 1f), Unit(ConfigUnitType.Pixels)] TargetIconSize,

[Default(0f, 0f, 1f), Unit(ConfigUnitType.Percent)] MistakeRatio,

[Default(0.4f, 0f, 1f), Unit(ConfigUnitType.Percent)] HealthTankRatio,
[Default(0.4f, 0f, 1f), Unit(ConfigUnitType.Percent)] HealthHealerRatio,

Expand Down Expand Up @@ -443,6 +441,7 @@ public enum PluginConfigFloat : byte
[Default(24f, 0f, 90f), Unit(ConfigUnitType.Degree)] MoveTargetAngle,
[Default(90f, 10f, 1800f), Unit(ConfigUnitType.Seconds)] BossTimeToKill,
[Default(10f, 0f, 60f), Unit(ConfigUnitType.Seconds)] DyingTimeToKill,
[Default(15f, 0f, 1800f), Unit(ConfigUnitType.Seconds)] LostAssassinationTimeToKill,

[Default(16f, 9.6f, 96f), Unit(ConfigUnitType.Pixels)] CooldownFontSize,

Expand Down
7 changes: 5 additions & 2 deletions RotationSolver.Basic/Configuration/OtherConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ public class OtherConfiguration
{ (uint) ActionID.SteelCyclone, 2},
{ (uint) ActionID.VariantSpiritDart, 1 },
{ (uint) ActionID.VariantSpiritDart2, 1 },
{ (uint) ActionID.LostRampage, 1 },
{ (uint) ActionID.LostBurst, 1 },
{ (uint) ActionID.LostFlarestar, 1 }
};

public static Dictionary<uint, float> ActionTTK = new()
Expand Down Expand Up @@ -235,7 +238,7 @@ private static void InitOne<T>(ref T value, string name, bool download = true)
try
{
using var client = new HttpClient();
var str = client.GetStringAsync($"https://raw.githubusercontent.com/{Service.USERNAME}/{Service.REPO}/main/Resources/{name}.json").Result;
var str = client.GetStringAsync($"https://raw.githubusercontent.com/{Service.USERNAME}/{Service.REPO}/{Service.BRANCH}/Resources/{name}.json").Result;

File.WriteAllText(path, str);
value = JsonConvert.DeserializeObject<T>(str, new JsonSerializerSettings()
Expand All @@ -259,4 +262,4 @@ private static void InitOne<T>(ref T value, string name, bool download = true)
}
}
#pragma warning restore CA2211
#pragma warning restore CS1591 // Missing XML comment for publicly visible type or member
#pragma warning restore CS1591 // Missing XML comment for publicly visible type or member
10 changes: 0 additions & 10 deletions RotationSolver.Basic/Configuration/RotationSolverRecord.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,4 @@ public class RotationSolverRecord
/// How many times have rs clicked for you.
/// </summary>
public uint ClickingCount { get; set; } = 0;

/// <summary>
/// How many times have you greeted the other users.
/// </summary>
public uint SayingHelloCount { get; set; } = 0;

/// <summary>
/// The users that already said hello.
/// </summary>
public HashSet<string> SaidUsers { get; set; } = new HashSet<string>();
}
Loading

0 comments on commit ee0f339

Please sign in to comment.