got detection somewhat working

This commit is contained in:
Boki 2026-02-20 21:57:51 -05:00
parent 40d30115bf
commit c75b2b27f0
10 changed files with 500 additions and 56 deletions

View file

@ -91,11 +91,36 @@ public class BotOrchestrator : IAsyncDisposable
BossRunExecutor = new BossRunExecutor(game, screen, inventory, logWatcher, store.Settings, BossDetector);
logWatcher.AreaEntered += _ => Navigation.Reset();
logWatcher.AreaEntered += area =>
{
Navigation.Reset();
OnAreaEntered(area);
};
logWatcher.Start(); // start early so area events fire even before Bot.Start()
_paused = store.Settings.Paused;
}
// Boss zones → boss name mapping
private static readonly Dictionary<string, string> BossZones = new(StringComparer.OrdinalIgnoreCase)
{
["The Black Cathedral"] = "kulemak",
};
private void OnAreaEntered(string area)
{
if (BossZones.TryGetValue(area, out var boss))
{
BossDetector.SetBoss(boss);
BossDetector.Enabled = true;
Log.Information("Boss zone detected: {Area} → enabling {Boss} detector", area, boss);
}
else if (BossDetector.Enabled)
{
BossDetector.Enabled = false;
Log.Information("Left boss zone → disabling boss detector");
}
}
public bool IsReady => _started;
public bool IsPaused => _paused;