Skip to content

Commit

Permalink
v1.0.1.0 bugfixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Jukkales committed Apr 10, 2024
1 parent 766a282 commit 9babbc7
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 12 deletions.
2 changes: 1 addition & 1 deletion HoardFarm/HoardFarm.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Authors>Jukkales</Authors>
<Version>1.0.0.0</Version>
<Version>1.0.1.0</Version>
<Description>HoardFarm Dalamud Plugin</Description>
<PackageProjectUrl>https://github.com/Jukkales/HoardFarm</PackageProjectUrl>
</PropertyGroup>
Expand Down
53 changes: 42 additions & 11 deletions HoardFarm/Service/HoardFarmService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public class HoardFarmService : IDisposable
private bool hoardFound;
private bool hoardAvailable;
private bool intuitionUsed;
private bool movingToHoard;
private Vector3 hoardPosition = Vector3.Zero;
// private Collection<uint> chestIds = [];
// private Collection<uint> visitedChestIds = [];
Expand Down Expand Up @@ -91,6 +92,8 @@ private void Reset()
intuitionUsed = false;
hoardFound = false;
hoardPosition = Vector3.Zero;
movingToHoard = false;
hoardAvailable = false;
}

private void OnTimerUpdate(object? sender, ElapsedEventArgs e)
Expand All @@ -99,7 +102,17 @@ private void OnTimerUpdate(object? sender, ElapsedEventArgs e)
{
if (CheckDone())
{
HoardMode = false;
if (InHoH)
{
HoardModeStatus = "Ending";
TaskManager.Abort();
EnqueueImmediate(new LeaveDutyTask());
}
EnqueueImmediate(() =>
{
HoardMode = false;
return true;
});
return;
}
if (!InHoH && !InRubySea && NotBusy() && !KyuseiInteractable())
Expand Down Expand Up @@ -133,30 +146,49 @@ private void OnTimerUpdate(object? sender, ElapsedEventArgs e)

if (hoardPosition != Vector3.Zero)
{
Enqueue(new UsePomanderTask(Pomander.Concealment));
Enqueue(new PathfindTask(hoardPosition, true, 1.5f), 60*1000);
HoardModeStatus = "Move to Hoard";
if (!movingToHoard)
{
Enqueue(new UsePomanderTask(Pomander.Concealment));
Enqueue(new PathfindTask(hoardPosition, true, 1.5f), 60 * 1000);
movingToHoard = true;
HoardModeStatus = "Move to Hoard";
}
}
else
{
HoardModeStatus = "Unreachable";
Enqueue(new LeaveDutyTask());
SessionRuns++;

if (!hoardFound)
{
HoardModeStatus = "Unreachable";
Enqueue(new LeaveDutyTask());
Enqueue(() =>
{
SessionRuns++;
return true;
});
}
}

if (hoardFound)
{
HoardModeStatus = "Leaving";
Enqueue(new LeaveDutyTask());
SessionRuns++;
Enqueue(() =>
{
SessionRuns++;
SessionFoundHoards++;
return true;
});
}
}
else
{
HoardModeStatus = "Leaving";
Enqueue(new LeaveDutyTask());
SessionRuns++;
Enqueue(() =>
{
SessionRuns++;
return true;
});
}
}
}
Expand Down Expand Up @@ -215,7 +247,6 @@ private void OnChatMessage(
{
hoardFound = true;
HoardModeStatus = "Done";
SessionFoundHoards++;
}
}

Expand Down

0 comments on commit 9babbc7

Please sign in to comment.