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

Commit

Permalink
fix: stop casting only effects on hostile targets.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchiDog1998 committed Jul 15, 2023
1 parent f0086b5 commit c488244
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 11 deletions.
13 changes: 9 additions & 4 deletions Resources/AnimationLockTime.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"23": 0.6,
"24": 0.6,
"28": 0.6,
"29": 0.6,
"31": 0.6,
"37": 0.6,
"40": 0.6,
Expand Down Expand Up @@ -100,6 +101,8 @@
"3176": 0.1,
"3538": 0.6,
"3539": 0.6,
"3541": 0.1,
"3542": 0.6,
"3543": 0.6,
"3545": 0.6,
"3546": 0.6,
Expand Down Expand Up @@ -159,7 +162,7 @@
"6993": 2.1,
"7381": 0.6,
"7383": 0.6,
"7384": 0.1,
"7384": 0.6,
"7385": 0.6,
"7386": 0.6,
"7387": 0.6,
Expand Down Expand Up @@ -221,7 +224,7 @@
"7510": 0.1,
"7511": 0.1,
"7513": 0.6,
"7514": 0.1,
"7514": 0.6,
"7517": 0.6,
"7518": 0.6,
"7519": 0.6,
Expand All @@ -248,7 +251,7 @@
"7560": 0.6,
"7561": 0.6,
"7562": 0.6,
"7568": 0.6,
"7568": 0.1,
"7863": 0.6,
"8341": 0.1,
"8570": 0.1,
Expand Down Expand Up @@ -322,6 +325,7 @@
"16457": 0.6,
"16458": 0.6,
"16459": 0.6,
"16460": 0.6,
"16461": 0.6,
"16462": 0.6,
"16464": 0.6,
Expand Down Expand Up @@ -384,6 +388,7 @@
"20250": 0.1,
"20304": 0.6,
"20542": 2.1,
"20710": 0.1,
"20727": 0.6,
"21052": 2.1,
"21054": 2.1,
Expand Down Expand Up @@ -484,7 +489,7 @@
"25788": 0.6,
"25793": 0.1,
"25796": 0.6,
"25797": 0.1,
"25797": 0.6,
"25798": 0.1,
"25799": 0.6,
"25801": 0.6,
Expand Down
4 changes: 4 additions & 0 deletions Resources/HostileCastingArea.json
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@
23367,
23381,
23383,
23470,
23517,
23538,
23541,
Expand Down Expand Up @@ -241,8 +242,10 @@
31780,
31835,
31885,
31900,
31910,
31925,
31926,
31956,
31978,
32059,
Expand All @@ -256,6 +259,7 @@
32785,
32868,
32944,
33024,
33335,
33338,
33343,
Expand Down
2 changes: 1 addition & 1 deletion RotationSolver/Localization/Strings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ internal partial class Strings
public string ConfigWindow_Param_Display { get; set; } = "Display";
public string ConfigWindow_Param_Advanced { get; set; } = "Advanced";
public string ConfigWindow_Param_PoslockCasting { get; set; } = "Lock the movement when casting or some actions.";
public string ConfigWindow_Param_UseStopCasting { get; set; } = "Stops casting when target is dead.";
public string ConfigWindow_Param_UseStopCasting { get; set; } = "Stops casting when hostile target is dead.";
public string ConfigWindow_Param_ShowTooltips { get; set; } = "Show tooltips";
public string ConfigWindow_Param_InDebug { get; set; } = "Debug Mode";

Expand Down
6 changes: 6 additions & 0 deletions RotationSolver/UI/RotationConfigWindow_Debug.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,12 @@ private unsafe void DrawTargetData()
{
ImGui.Text("Owner: " + owner.Name.ToString());
}
if( Svc.Targets.Target is Character c)
{
var s = c.Struct();
ImGui.Text($"Character Mode: {s->Mode}.");
ImGui.Text($"Character Status: {s->StatusFlags}, {s->StatusFlags2}, {s->StatusFlags3}, {s->StatusFlags4}.");
}
}
if (Svc.Targets.Target is BattleChara b)
{
Expand Down
4 changes: 1 addition & 3 deletions RotationSolver/Updaters/MajorUpdater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,9 @@ internal static class MajorUpdater

static bool _showed;
static Exception _threadException;
//static int count = 0;
private static void FrameworkUpdate(Framework framework)
{
//if (count++ > 10) return;
PainterManager.ActionIds.Clear();
RotationSolverPlugin.UpdateDisplayWindow();
if (!IsValid)
{
Expand Down Expand Up @@ -71,7 +70,6 @@ private static void FrameworkUpdate(Framework framework)
{
SocialUpdater.UpdateSocial();
PreviewUpdater.UpdatePreview();
PainterManager.ActionIds.Clear();
if (Service.Config.TeachingMode && ActionUpdater.NextAction!= null)
{
//Sprint action id is 3 however the id in hot bar is 4.
Expand Down
6 changes: 3 additions & 3 deletions RotationSolver/Updaters/PreviewUpdater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ private static void UpdateEntry()
static readonly ByteColor _greenColor = new() { A = 255, R = 60, G = 120, B = 30 };
private static unsafe void UpdateCastBar()
{
var tardead = Service.Config.UseStopCasting && Svc.Objects.SearchById(Player.Object.CastTargetObjectId) is BattleChara b
&& (b is PlayerCharacter ? b.HasStatus(false, StatusID.Raise) : b.CurrentHp == 0);

var tardead = Service.Config.UseStopCasting
&& Svc.Objects.SearchById(Player.Object.CastTargetObjectId) is BattleChara b
&& b.IsNPCEnemy() && b.CurrentHp == 0;

if (_tarStopCastDelay.Delay(tardead))
{
Expand Down
Binary file not shown.

0 comments on commit c488244

Please sign in to comment.