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

Commit

Permalink
style: rename a lot.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchiDog1998 committed Jan 23, 2023
1 parent dd517a0 commit f5ff2d9
Show file tree
Hide file tree
Showing 15 changed files with 49 additions and 58 deletions.
11 changes: 9 additions & 2 deletions RotationSolver/Actions/BaseAction/BaseAction_BasicInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ internal partial class BaseAction : IBaseAction

private bool _isFriendly;
private bool _isEot;
Action _action;

private bool ShouldEndSpecial { get; set; }

Expand Down Expand Up @@ -104,8 +105,14 @@ internal virtual unsafe uint MPNeed
}
}


Action _action;
/// <summary>
///
/// </summary>
/// <param name="actionID"></param>
/// <param name="isFriendly">is a friendly or supporting action</param>
/// <param name="shouldEndSpecial">end special after using it</param>
/// <param name="isEot">is hot or dot action</param>
/// <param name="isTimeline">should I put it to the timeline (heal and defense only)</param>
internal BaseAction(ActionID actionID, bool isFriendly = false, bool shouldEndSpecial = false, bool isEot = false, bool isTimeline = false)
{
_action = Service.DataManager.GetExcelSheet<Action>().GetRow((uint)actionID);
Expand Down
2 changes: 1 addition & 1 deletion RotationSolver/Actions/BaseAction/BaseAction_Target.cs
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ private bool TargetAreaFriend(float range, bool mustUse, out BattleChara target)
if (!Service.Configuration.UseGroundBeneficialAbility) return false;

//如果当前目标是Boss且有身位,放他身上。
if (Service.TargetManager.Target is BattleChara b && b.DistanceToPlayer() < range && b.IsBoss() && b.HasLocationSide())
if (Service.TargetManager.Target is BattleChara b && b.DistanceToPlayer() < range && b.IsBoss() && b.HasPositional())
{
target = b;
_position = target.Position;
Expand Down
2 changes: 1 addition & 1 deletion RotationSolver/Helpers/ConfigurationHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public record LocationInfo(EnemyPositional Loc, byte[] Tags);

public static readonly string[] AuthorKeys = new string[]
{
"Ig4lHXUohMZNIeheUtAtRg==",
"Ig4lHXUohMZNIeheUtAtRg==", //ArchiTed
};

public static readonly uint[] BadStatus = new uint[]
Expand Down
2 changes: 1 addition & 1 deletion RotationSolver/Helpers/ObjectHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ private unsafe static BNpcBase GetObjectNPC(this GameObject obj)
return Service.DataManager.GetExcelSheet<BNpcBase>().GetRow(obj.DataId);
}

internal static bool HasLocationSide(this GameObject obj)
internal static bool HasPositional(this GameObject obj)
{
if (obj == null) return false;
return !(obj.GetObjectNPC()?.Unknown10 ?? false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ private protected virtual bool EmergencyAbility(byte abilitiesRemaining, IAction

if (Service.Configuration.AutoUseTrueNorth && abilitiesRemaining == 1 && action.EnermyPositonal != EnemyPositional.None && action.Target != null)
{
if (action.EnermyPositonal != action.Target.FindEnemyLocation() && action.Target.HasLocationSide())
if (action.EnermyPositonal != action.Target.FindEnemyLocation() && action.Target.HasPositional())
{
if (TrueNorth.CanUse(out act, emptyOrSkipCombo: true)) return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
using RotationSolver.Actions.BaseAction;
using RotationSolver.Configuration.RotationConfig;
using RotationSolver.Data;
using RotationSolver.Localization;
using System.Collections.Generic;
using System.Linq;

namespace RotationSolver.Rotations.CustomRotation;

Expand Down Expand Up @@ -55,8 +58,21 @@ public BattleChara MoveTarget
}
}

public string Description => string.Join('\n', DescriptionDict.Select(pair => pair.Key.ToName() + " → " + pair.Value));

/// <summary>
/// Description about the actions.
/// </summary>
public virtual SortedList<DescType, string> DescriptionDict { get; } = new SortedList<DescType, string>();

private protected virtual IRotationConfigSet CreateConfiguration()
{
return new RotationConfigSet(JobIDs[0], RotationName);
}


/// <summary>
/// Update your customized field.
/// </summary>
private protected virtual void UpdateInfo() { }
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,11 @@ private static readonly IBaseItem
//意力
TinctureofIntelligence6 = new BaseItem(36112, 65535);

/// <summary>
/// 是否使用爆发药
/// </summary>
/// <param name="act"></param>
/// <returns></returns>
protected bool UseBreakItem(out IAction act)
protected bool UseBurstItem(out IAction act)
{
act = null;
if (Service.PartyList.Count() < 8) return false;

if (!IsFullParty) return false;
if (Service.ClientState.LocalPlayer.Level < 90) return false;

var role = Job.GetJobRole();
Expand Down
20 changes: 0 additions & 20 deletions RotationSolver/Rotations/CustomRotation/CustomRotation_HelpInfo.cs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ private IAction Invoke()
if (act != null && act is BaseAction GcdAction)
{
//Sayout!
if (GcdAction.EnermyPositonal != EnemyPositional.None && GcdAction.Target.HasLocationSide()
if (GcdAction.EnermyPositonal != EnemyPositional.None && GcdAction.Target.HasPositional()
&& !Player.HasStatus(true, StatusID.TrueNorth))
{
if (CheckAction(GcdAction.ID))
Expand Down
1 change: 0 additions & 1 deletion RotationSolver/Rotations/Healer/SCH/SCH_Default.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ internal sealed class SCH_Default : SCH_Base

public SCH_Default()
{
//防止大仙女吞技能
SummonSeraph.RotationCheck = b => WhisperingDawn.ElapsedAfterGCD(1) || FeyIllumination.ElapsedAfterGCD(1) || FeyBlessing.ElapsedAfterGCD(1);
}
protected override bool CanHealSingleSpell => base.CanHealSingleSpell && (Configs.GetBool("GCDHeal") || TargetUpdater.PartyHealers.Count() < 2);
Expand Down
2 changes: 1 addition & 1 deletion RotationSolver/Rotations/Melee/NIN/NIN_Default.cs
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ private protected override bool AttackAbility(byte abilitiesRemaining, out IActi

if (!IsMoving && TenChiJin.CanUse(out act)) return true;
if (Kassatsu.CanUse(out act)) return true;
if (UseBreakItem(out act)) return true;
if (UseBurstItem(out act)) return true;

if (Bunshin.CanUse(out act)) return true;
if (HellfrogMedium.CanUse(out act)) return true;
Expand Down
7 changes: 2 additions & 5 deletions RotationSolver/Rotations/RangedPhysicial/BRD/BRD_Default.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,16 @@ internal sealed class BRD_Default : BRD_Base

public override string RotationName => "Default";

private protected override IRotationConfigSet CreateConfiguration()
{
return base.CreateConfiguration()
private protected override IRotationConfigSet CreateConfiguration() => base.CreateConfiguration()
.SetBool("BindWAND", false, "Use Raging Strikes on WAND")
.SetCombo("FirstSong", 0, "First Song", "WAND", "MAGE", "ARMY")
.SetFloat("WANDTime", 43, "WAND Time", min: 0, max: 45, speed: 1)
.SetFloat("MAGETime", 34, "MAGE Time", min: 0, max: 45, speed: 1)
.SetFloat("ARMYTime", 43, "ARMY Time", min: 0, max: 45, speed: 1);
}

public override SortedList<DescType, string> DescriptionDict => new()
{
{DescType.Description, $"请确保三首歌时间加在一起等于120秒!"},
{DescType.Description, "Please make sure that the three song times add up to 120 seconds!"},
{DescType.DefenseArea, $"{Troubadour}"},
{DescType.HealSingle, $"{NaturesMinne}"},
};
Expand Down
1 change: 0 additions & 1 deletion RotationSolver/SigReplacers/Watcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ internal static unsafe void Enable()
_receivAbilityHook?.Enable();
}


private static void ReceiveAbilityEffect(uint sourceId, IntPtr sourceCharacter, IntPtr pos, IntPtr effectHeader, IntPtr effectArray, IntPtr effectTrail)
{
_receivAbilityHook.Original(sourceId, sourceCharacter, pos, effectHeader, effectArray, effectTrail);
Expand Down
5 changes: 2 additions & 3 deletions RotationSolver/Updaters/TargetUpdater_Friends.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,8 @@ internal unsafe static void UpdateFriends()
{
#region Friend
var party = Service.PartyList;
PartyMembers = party.Length == 0 ? Service.ClientState.LocalPlayer == null ? new BattleChara[0] : new BattleChara[] { Service.ClientState.LocalPlayer } :
party.Where(obj => obj != null && obj.GameObject is BattleChara)
.Select(obj => obj.GameObject as BattleChara);
PartyMembers = party.Length == 0 ? (Service.ClientState.LocalPlayer == null ? new BattleChara[0] : new BattleChara[] { Service.ClientState.LocalPlayer })
: party.Where(obj => obj != null && obj.GameObject is BattleChara).Select(obj => obj.GameObject as BattleChara);

//添加亲信
PartyMembers = PartyMembers.Union(Service.ObjectTable.Where(obj => obj.SubKind == 9 && obj is BattleChara).Cast<BattleChara>());
Expand Down
24 changes: 11 additions & 13 deletions RotationSolver/Windows/RotationConfigWindow_Debug.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using Dalamud.Game.ClientState.Objects.Types;
using FFXIVClientStructs.FFXIV.Client.Game.Fate;
using ImGuiNET;
using Lumina.Excel.GeneratedSheets;
using RotationSolver.Actions.BaseAction;
using RotationSolver.Data;
using RotationSolver.Helpers;
Expand All @@ -17,24 +18,20 @@ private unsafe void DrawDebugTab()
{
var str = TargetUpdater.EncryptString(Service.ClientState.LocalPlayer);
ImGui.SetNextItemWidth(ImGui.CalcTextSize(str).X + 10);
ImGui.InputText("That is your HASH, send to ArchiTed", ref str, 100);
ImGui.InputText("That is your HASH", ref str, 100);

ImGui.Text("All: " + TargetUpdater.AllTargets.Count().ToString());
ImGui.Text("Hostile: " + TargetUpdater.HostileTargets.Count().ToString());
ImGui.Text("Friends: " + TargetUpdater.PartyMembers.Count().ToString());
if ((IntPtr)FateManager.Instance() != IntPtr.Zero)
{
ImGui.Text("Fate: " + FateManager.Instance()->FateJoined.ToString());
}

if (ImGui.CollapsingHeader("Status from self."))
if (ImGui.CollapsingHeader("Status"))
{
foreach (var item in Service.ClientState.LocalPlayer.StatusList)
foreach (var status in Service.ClientState.LocalPlayer.StatusList)
{
if (item.SourceId == Service.ClientState.LocalPlayer.ObjectId)
{
ImGui.Text(item.GameData.Name + item.StatusId);
}
var source = Service.ObjectTable.SearchById(status.SourceId)?.Name ?? "None";
ImGui.Text($"{status.GameData.Name}: {status.StatusId} From: {source}");
}
}

Expand All @@ -43,18 +40,20 @@ private unsafe void DrawDebugTab()
if (Service.TargetManager.Target is BattleChara b)
{
ImGui.Text("Is Boss: " + b.IsBoss().ToString());
ImGui.Text("Has Side: " + b.HasLocationSide().ToString());
ImGui.Text("Has Positional: " + b.HasPositional().ToString());
ImGui.Text("Is Dying: " + b.IsDying().ToString());

foreach (var status in b.StatusList)
{
if (status.SourceId == Service.ClientState.LocalPlayer.ObjectId)
{
ImGui.Text(status.GameData.Name + status.StatusId);
ImGui.Text($"{status.GameData.Name}: {status.StatusId}");
}
}
}
ImGui.Text("");

ImGui.Text("All: " + TargetUpdater.AllTargets.Count().ToString());
ImGui.Text("Hostile: " + TargetUpdater.HostileTargets.Count().ToString());
foreach (var item in TargetUpdater.HostileTargets)
{
ImGui.Text(item.Name.ToString());
Expand All @@ -66,7 +65,6 @@ private unsafe void DrawDebugTab()
ActionUpdater.NextAction?.Display(false);
ImGui.Text("Ability Remain: " + ActionUpdater.AbilityRemain.ToString());
ImGui.Text("Ability Count: " + ActionUpdater.AbilityRemainCount.ToString());

}

if (ImGui.CollapsingHeader("Last Action"))
Expand Down

0 comments on commit f5ff2d9

Please sign in to comment.