This commit is contained in:
Boki 2026-02-21 23:35:32 -05:00
parent 152c74fa15
commit 5e1b5c2a48
10 changed files with 211 additions and 150 deletions

View file

@ -32,6 +32,9 @@ public class CombatManager
private long _lastOrbitMs;
private int _nextOrbitMs = OrbitStepMinMs;
// Ability rotation — press Q and E every ~6 seconds
private long _lastAbilityMs;
// Chase — walks toward a screen position instead of orbiting
private volatile int _chaseX = -1;
private volatile int _chaseY = -1;
@ -69,6 +72,7 @@ public class CombatManager
public async Task Tick(int x, int y, int jitter = 30)
{
await _flasks.Tick();
await UseAbilities();
if (_chaseX >= 0)
{
@ -210,6 +214,35 @@ public class CombatManager
}
}
/// <summary>
/// Press Q and E abilities every ~6 seconds.
/// </summary>
private async Task UseAbilities()
{
var now = _orbitSw.ElapsedMilliseconds;
if (now - _lastAbilityMs < 6000) return;
_lastAbilityMs = now;
// Release held attacks before abilities
if (_holding)
{
_game.LeftMouseUp();
_game.RightMouseUp();
}
await _game.PressKey(InputSender.VK.Q);
await Helpers.Sleep(Rng.Next(80, 120));
await _game.PressKey(InputSender.VK.E);
await Helpers.Sleep(Rng.Next(80, 120));
// Re-engage attacks
if (_holding)
{
_game.LeftMouseDown();
_game.RightMouseDown();
}
}
/// <summary>
/// Reset state for a new combat phase (releases held buttons if any).
/// </summary>