This commit is contained in:
Boki 2026-02-22 01:28:40 -05:00
parent 5e1b5c2a48
commit 41b44d4fab
5 changed files with 32 additions and 13 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.3 MiB

After

Width:  |  Height:  |  Size: 7.1 MiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.8 MiB

After

Width:  |  Height:  |  Size: 5.9 MiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 347 KiB

After

Width:  |  Height:  |  Size: 323 KiB

Before After
Before After

View file

@ -236,7 +236,7 @@ public class BossRunExecutor : GameExecutor
Log.Error("Could not find Waypoint nameplate");
return false;
}
await Sleep(500);
await Sleep(1500);
// Template match well-of-souls.png and click
var match = await _screen.TemplateMatch(WellOfSoulsTemplate);
@ -512,7 +512,7 @@ public class BossRunExecutor : GameExecutor
// -- Async combat: combat runs in background, checks run on main thread --
private volatile int _combatTargetX = 1280;
private volatile int _combatTargetY = 720;
private volatile int _combatTargetY = 660;
private volatile int _combatJitter = 30;
/// <summary>
@ -533,7 +533,7 @@ public class BossRunExecutor : GameExecutor
/// Start background combat loop, returning the task and CTS.
/// Caller must cancel + await + ReleaseAll when done.
/// </summary>
private (Task combatTask, CancellationTokenSource cts) StartCombatLoop(int x = 1280, int y = 720, int jitter = 30)
private (Task combatTask, CancellationTokenSource cts) StartCombatLoop(int x = 1280, int y = 660, int jitter = 30)
{
_combatTargetX = x;
_combatTargetY = y;
@ -617,7 +617,7 @@ public class BossRunExecutor : GameExecutor
return null;
const int screenCx = 1280;
const int screenCy = 720;
const int screenCy = 660;
const double screenToWorld = 97.0 / 835.0;
(double X, double Y)? lastBossWorldPos = null;
var yoloLogCount = 0;
@ -685,9 +685,28 @@ public class BossRunExecutor : GameExecutor
_lastDeathCheckMs = 0;
if (await CheckDeath()) { healthbarMissCount = 0; continue; }
Log.Information("Healthbar gone for {N} checks, boss phase over after {Ms}ms, lastBossPos={Boss}",
healthbarMissCount, sw.ElapsedMilliseconds,
lastBossWorldPos != null ? $"({lastBossWorldPos.Value.X:F1},{lastBossWorldPos.Value.Y:F1})" : "null");
Log.Information("Healthbar gone for {N} checks, boss phase over after {Ms}ms",
healthbarMissCount, sw.ElapsedMilliseconds);
// Keep polling YOLO briefly — boss death animation can move it further.
// Use the LAST detection (not furthest) so we end up where the boss actually is.
var postDeathSw = Stopwatch.StartNew();
while (postDeathSw.ElapsedMilliseconds < 2000)
{
if (_stopped) break;
var postSnapshot = _bossDetector.Latest;
if (postSnapshot.Bosses.Count > 0)
{
var boss = postSnapshot.Bosses[0];
var wp = _nav.WorldPosition;
var bx = wp.X + (boss.Cx - screenCx) * screenToWorld;
var by = wp.Y + (boss.Cy - screenCy) * screenToWorld;
lastBossWorldPos = (bx, by);
FightPosition = lastBossWorldPos;
Log.Information("Post-death YOLO: bossWorld=({Bx:F1},{By:F1})", bx, by);
}
await Sleep(100);
}
return lastBossWorldPos;
}
}
@ -754,8 +773,8 @@ public class BossRunExecutor : GameExecutor
/// </summary>
private async Task ClickClosestTemplateToCenter(string templatePath)
{
const int screenCx = 2560 / 2;
const int screenCy = 1440 / 2;
const int screenCx = 1280;
const int screenCy = 660;
// Search center region only to avoid clicking distant matches
var centerRegion = new Region(850, 50, 860, 550);
@ -800,7 +819,7 @@ public class BossRunExecutor : GameExecutor
Log.Information("Walking to world ({X:F0},{Y:F0})", worldX, worldY);
const int screenCx = 1280;
const int screenCy = 720;
const int screenCy = 660;
var sw = Stopwatch.StartNew();
var heldKeys = new HashSet<int>();

View file

@ -42,7 +42,7 @@ public class CombatManager
// Smoothed mouse position — lerps toward target to avoid jitter
private double _smoothX = 1280;
private double _smoothY = 720;
private double _smoothY = 660;
private const double SmoothFactor = 0.25; // 0=no movement, 1=instant snap
public bool IsHolding => _holding;
@ -148,7 +148,7 @@ public class CombatManager
_orbitIndex = -1;
}
const int screenCx = 1280, screenCy = 720;
const int screenCx = 1280, screenCy = 660;
var cx = _chaseX;
var cy = _chaseY;
var dx = cx - screenCx;
@ -256,7 +256,7 @@ public class CombatManager
_holding = false;
_manaStableCount = 0;
_smoothX = 1280;
_smoothY = 720;
_smoothY = 660;
await ReleaseOrbit();
await ReleaseChaseKeys();
_chaseX = -1;