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

Commit

Permalink
fix: fix some condition for status.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchiDog1998 committed Jan 31, 2023
1 parent f9dbd57 commit 5858428
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 33 deletions.
3 changes: 2 additions & 1 deletion RotationSolver/Data/ObjectListDelay.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,13 @@ public void Delay(IEnumerable<T> originData)
}
revealTime.Add(item.ObjectId, time);

if (time > now)
if (now > time)
{
outList.Add(item);
}
}

_list = outList;
_revealTime = revealTime;
}

Expand Down
2 changes: 2 additions & 0 deletions RotationSolver/Data/StatusID.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1117,4 +1117,6 @@ internal enum StatusID : ushort
IceSpikes = 1307,

RespellingSpray = 556,

StoneSkin = 151,
}
9 changes: 8 additions & 1 deletion RotationSolver/Helpers/StatusHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,16 @@ private static IEnumerable<Status> GetAllStatus(this BattleChara obj, bool isFro
|| status.SourceObject?.OwnerId == Service.ClientState.LocalPlayer.ObjectId : true);
}

static readonly StatusID[] invincibalStatus = new StatusID[]
{
StatusID.StoneSkin,
};

internal static bool IsInvincible(this Status status)
{
if (status.GameData.Icon == 15024) return true;
return false;

return invincibalStatus.Any(id => (uint)id == status.StatusId);
}

static readonly StatusID[] dangeriousStatus = new StatusID[]
Expand Down Expand Up @@ -159,6 +165,7 @@ internal static bool IsInvincible(this Status status)

internal static bool IsDangerous(this Status status)
{
if(status.StackCount > 2) return true;
return dangeriousStatus.Any(id => (uint)id == status.StatusId);
}
}
12 changes: 8 additions & 4 deletions RotationSolver/Localization/Localization.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,18 @@
"Configwindow_Param_UseOverlayWindow": "Display top overlay",
"Configwindow_Param_UseOverlayWindowDesc": "This window is currently used to cue the body position in advance.",
"Configwindow_Param_Basic": "Basic",
"Configwindow_Param_WeaponDelay": "Set the range of random delay for GCD in second.",
"Configwindow_Param_DeathDelay": "Set the range of random delay for raising deaths in second.",
"Configwindow_Param_HostileDelay": "Set the range of random delay for finding hostile targets in second.",
"Configwindow_Param_WeaponFaster": "Set the time advance of use actions",
"Configwindow_Param_WeaponInterval": "Set the interval between abilities using",
"Configwindow_Param_InterruptibleTime": "Set the delay of interrupting",
"Configwindow_Param_SpecialDuration": "Set the duration of special windows set by commands",
"Configwindow_Param_AddDotGCDCount": "Set GCD advance of DOT refresh",
"Configwindow_Param_AutoOffBetweenArea": "Turn off when player is between area.",
"Configwindow_Param_Delay": "Delay",
"Configwindow_Param_WeaponDelay": "Set the range of random delay for GCD in second.",
"Configwindow_Param_DeathDelay": "Set the range of random delay for raising deaths in second.",
"Configwindow_Param_HostileDelay": "Set the range of random delay for finding hostile targets in second.",
"Configwindow_Param_InterruptDelay": "Set the range of random delay for interrupting hostile targets in second.",
"Configwindow_Param_WeakenDelay": "Set the range of random delay for esuna weakens in second.",
"Configwindow_Param_HealDelay": "Set the range of random delay for healing people in second.",
"Configwindow_Param_Display": "Display",
"Configwindow_Param_PoslockCasting": "Lock the movement when casting",
"Configwindow_Param_PoslockModifier": "Set the modifier key to unlock the movement temporary",
Expand Down Expand Up @@ -103,6 +106,7 @@
"Configwindow_Param_UseItemDesc": "Use poison, WIP",
"Configwindow_Param_Conditon": "Condition",
"Configwindow_Param_StartOnCountdown": "Turn on auto-rotation on countdown",
"Configwindow_Param_InterruptibleMoreCheck": "Interrupt the action with action type check.",
"Configwindow_Param_HealOutOfCombat": "Heal party members outside of combat.",
"Configwindow_Param_HealthDifference": "Set the HP standard deviation threshold for using AOE heal (ability & spell)",
"Configwindow_Param_HealthAreaAbility": "Set the HP threshold for using AOE healing ability",
Expand Down
2 changes: 1 addition & 1 deletion RotationSolver/Rotations/Basic/DNC_Base.cs
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ internal abstract class DNC_Base : CustomRotation.CustomRotation
!b.HasStatus(false, StatusID.Weakness, StatusID.BrinkofDeath)
//Remove other partner.
&& !b.HasStatus(false, StatusID.ClosedPosition2) | b.HasStatus(true, StatusID.ClosedPosition2)
).ToArray();
);

return Targets.GetJobCategory(JobRole.Melee, JobRole.RangedMagicial, JobRole.RangedPhysical).FirstOrDefault();
},
Expand Down
19 changes: 1 addition & 18 deletions RotationSolver/Rotations/RangedPhysicial/DNC/DNC_Default.cs
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ private bool AttackGCD(out IAction act, bool breaking)
private bool UseStandardStep(out IAction act)
{
if (!StandardStep.CanUse(out act, mustUse: true)) return false;
if(Player.WillStatusEndGCD(2, 0, true, StatusID.StandardFinish)) return true;

//等级低于玩家太多不跳舞,都直接秒了还跳啥舞
if (Level - Target.Level > 10) return false;
Expand All @@ -168,24 +169,6 @@ private bool UseStandardStep(out IAction act)
return true;
}

/// <summary>
/// 结束舞步
/// </summary>
/// <param name="act"></param>
/// <returns></returns>
private bool UseFinishStepGCD(out IAction act)
{
if (!FinishStepGCD(out act)) return false;

if (Target.IsBoss()) return true;

if (Windmill.CanUse(out _)) return true;

if (TargetUpdater.HostileTargets.GetObjectInRadius(25).Count() >= 3) return false;

return false;
}

/// <summary>
/// 应急换舞伴
/// </summary>
Expand Down
7 changes: 2 additions & 5 deletions RotationSolver/Updaters/ActionUpdater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -188,11 +188,8 @@ internal unsafe static void DoAction()

//GCD
var canUseGCD = WeaponRemain <= Service.Configuration.WeaponFaster;
if (canUseGCD)
{
if (_GCDDelay.Delay(canUseGCD)) RSCommands.DoAnAction(true);
return;
}
if (_GCDDelay.Delay(canUseGCD)) RSCommands.DoAnAction(true);
if (canUseGCD) return;

//要超出GCD了,那就不放技能了。
if (WeaponRemain < Service.Configuration.WeaponInterval
Expand Down
6 changes: 3 additions & 3 deletions RotationSolver/Windows/RotationConfigWindow_Param.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,13 @@ private void DrawParamBasic()
private void DrawParamDelay()
{
DrawRangedFloat(LocalizationManager.RightLang.Configwindow_Param_WeaponDelay,
ref Service.Configuration.WeaponDelayMin, ref Service.Configuration.WeaponDelayMax, max: 1);
ref Service.Configuration.WeaponDelayMin, ref Service.Configuration.WeaponDelayMax, speed: 0.002f, max: 1);

DrawRangedFloat(LocalizationManager.RightLang.Configwindow_Param_HostileDelay,
ref Service.Configuration.HostileDelayMin, ref Service.Configuration.HostileDelayMax);

DrawRangedFloat(LocalizationManager.RightLang.Configwindow_Param_InterruptDelay,
ref Service.Configuration.InterruptDelayMin, ref Service.Configuration.InterruptDelayMin);
ref Service.Configuration.InterruptDelayMin, ref Service.Configuration.InterruptDelayMax);

DrawRangedFloat(LocalizationManager.RightLang.Configwindow_Param_DeathDelay,
ref Service.Configuration.DeathDelayMin, ref Service.Configuration.DeathDelayMax);
Expand Down Expand Up @@ -397,7 +397,7 @@ private static void DrawCheckBox(string name, ref bool value, string description
}
}

private static void DrawRangedFloat(string name, ref float minValue, ref float maxValue, float speed = 0.002f, float min = 0, float max = 3, string description = "")
private static void DrawRangedFloat(string name, ref float minValue, ref float maxValue, float speed = 0.01f, float min = 0, float max = 3, string description = "")
{
ImGui.SetNextItemWidth(100);
if (ImGui.DragFloatRange2(name, ref minValue, ref maxValue, speed, min, max))
Expand Down

0 comments on commit 5858428

Please sign in to comment.