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

Commit

Permalink
fix: change the logic of blu.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchiDog1998 committed Jan 27, 2023
1 parent c34156e commit 6d85dd0
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 61 deletions.
47 changes: 2 additions & 45 deletions RotationSolver/Data/StatusID.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1112,50 +1112,7 @@ internal enum StatusID : ushort
/// </summary>
Necrosis = 2965,

#region Crafting
/// <summary>
/// 内静
/// </summary>
InnerQuiet = 251,

/// <summary>
/// 改革
/// </summary>
Innovation = 2189,

/// <summary>
/// 崇敬
/// </summary>
Veneration = 2226,

/// <summary>
/// 阔步
/// </summary>
GreatStrides = 254,

/// <summary>
/// 掌握
/// </summary>
Manipulation = 1164,

/// <summary>
/// 俭约
/// </summary>
WasteNot = 252,

/// <summary>
/// 长期俭约
/// </summary>
WasteNot2 = 257,
MightyGuard = 1719,

/// <summary>
/// 最终确认
/// </summary>
FinalAppraisal = 2190,

/// <summary>
/// 坚信
/// </summary>
MuscleMemory = 2191,
#endregion
IceSpikes = 1307,
}
38 changes: 35 additions & 3 deletions RotationSolver/Rotations/Basic/BLU_Base.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,15 @@ internal enum BLUActionType : byte

public class BLUAction : BaseAction, IBLUAction
{
static readonly StatusID[] NoPhysic = new StatusID[]
{
StatusID.IceSpikes,
};

static readonly StatusID[] NoMagic = new StatusID[]
{
};

private BLUActionType Type;

public unsafe bool OnSlot => ActionUpdater.BluSlots.Any(i => AdjustedID == Service.IconReplacer.OriginalHook(i));
Expand All @@ -54,6 +63,12 @@ internal BLUAction(ActionID actionID, BLUActionType type, bool isFriendly = fals
: base(actionID, isFriendly, shouldEndSpecial, isEot, isTimeline)
{
Type = type;
FilterForTarget = ts => ts.Where(t =>
{
if (t.HasStatus(false, NoPhysic) && Type == BLUActionType.Physical) return false;
if (t.HasStatus(false, NoMagic) && Type == BLUActionType.Magical) return false;
return true;
});
}

public override bool CanUse(out IAction act, bool mustUse = false, bool emptyOrSkipCombo = false, bool skipDisable = false)
Expand All @@ -62,7 +77,6 @@ public override bool CanUse(out IAction act, bool mustUse = false, bool emptyOrS

if (!OnSlot) return false;

//排除其他类型的魔法。
if (AttackType == BLUAttackType.Physical && Type == BLUActionType.Magical) return false;
if (AttackType == BLUAttackType.Magical && Type == BLUActionType.Physical) return false;

Expand Down Expand Up @@ -599,7 +613,13 @@ public override bool CanUse(out IAction act, bool mustUse = false, bool emptyOrS
/// <summary>
/// 强力守护
/// </summary>
public static IBLUAction MightyGuard { get; } = new BLUAction(ActionID.MightyGuard, BLUActionType.None, true);
public static IBLUAction MightyGuard { get; } = new BLUAction(ActionID.MightyGuard, BLUActionType.None, true)
{
StatusProvide = new StatusID[]
{
StatusID.MightyGuard,
},
};

/// <summary>
/// 月之笛
Expand Down Expand Up @@ -736,9 +756,21 @@ private protected override bool MoveGCD(out IAction act)
private protected override bool EmergencyGCD(out IAction act)
{
if (AetherialMimicry.CanUse(out act)) return true;
if (BasicInstinct.CanUse(out act)) return true;
if (BasicInstinct.CanUse(out _))
{
if (MightyGuard.CanUse(out act)) return true;
act = BasicInstinct;
return true;
}
return base.EmergencyGCD(out act);
}

protected static bool AllOnSlot(params IBLUAction[] actions) => actions.All(a => a.OnSlot);
protected static uint OnSlotCount(params IBLUAction[] actions) => (uint)actions.Count(a => a.OnSlot);

public override IBaseAction[] AllActions => base.AllActions.Where(a =>
{
if (a is not BLUAction b) return false;
return b.OnSlot;
}).ToArray();
}
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ internal RoleAction(ActionID actionID, JobRole[] roles, bool isFriendly = false,
/// <summary>
/// 当前这个类所有的BaseAction
/// </summary>
public IBaseAction[] AllActions => GetBaseActions(GetType());
public virtual IBaseAction[] AllActions => GetBaseActions(GetType());

/// <summary>
/// 这个类所有的公开bool值
Expand Down
14 changes: 6 additions & 8 deletions RotationSolver/Rotations/RangedMagicial/BLU/BLU_Default.cs
Original file line number Diff line number Diff line change
Expand Up @@ -139,27 +139,25 @@ private protected override bool HealAreaGCD(out IAction act)
private bool DBlueBreak(out IAction act)
{
act = null;
//if (BlueId == BLUID.Healer && BlueId == BLUID.Tank) return false;
if (!HasHostilesInRange) return false;

if (!AllOnSlot(MoonFlute)) return false;

if (AllOnSlot(TripleTrident) && !TripleTrident.IsCoolingDown)
if (AllOnSlot(TripleTrident) && TripleTrident.WillHaveOneChargeGCD(OnSlotCount(Whistle, Tingle), 0))
{
//口笛
if (Whistle.CanUse(out act)) return true;
//哔哩哔哩
if (!Player.HasStatus(true, StatusID.Tingling) && Player.HasStatus(true, StatusID.Harmonized) && Tingle.CanUse(out act, mustUse: true)) return true;
//鱼叉
if (Player.HasStatus(true, StatusID.WaxingNocturne) && TripleTrident.CanUse(out act, mustUse: true)) return true;
if (TripleTrident.CanUse(out act, mustUse: true)) return true;
}

if (AllOnSlot(Whistle, FinalSting, BasicInstinct) && UseFinalSting)
{
if (HasHostilesInRange && Whistle.CanUse(out act)) return true;
if (Whistle.CanUse(out act)) return true;
//破防
if (Player.HasStatus(true, StatusID.WaxingNocturne) && Offguard.CanUse(out act)) return true;
if (Offguard.CanUse(out act)) return true;
//哔哩哔哩
if (Player.HasStatus(true, StatusID.WaxingNocturne) && Tingle.CanUse(out act)) return true;
if (Tingle.CanUse(out act)) return true;
}

//月笛
Expand Down
3 changes: 3 additions & 0 deletions RotationSolver/Timeline/MajorConditionSet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ namespace RotationSolver.Timeline;

internal class MajorConditionSet
{
/// <summary>
/// Key for action id.
/// </summary>
public Dictionary<uint, ConditionSet> Conditions { get; } = new Dictionary<uint, ConditionSet>();

public string Name;
Expand Down
6 changes: 2 additions & 4 deletions RotationSolver/Windows/RotationConfigWindow_Debug.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,8 @@ private unsafe void DrawDebugTab()

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

Expand Down
1 change: 1 addition & 0 deletions docs/RotationDev/customization.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ Sometimes, for saving the resource. We want to save the value to the field. But
private protected override void UpdateInfo()
{
//Set your value to field here.
base.UpdateInfo();
}
```

Expand Down

0 comments on commit 6d85dd0

Please sign in to comment.