should trigger encounters now

This commit is contained in:
Sebastian Bularca
2026-05-06 11:29:50 +02:00
parent 356e07939a
commit 09fe607aab
3 changed files with 4 additions and 10 deletions

View File

@@ -6,15 +6,12 @@ namespace Nox.Game {
public class EncounterHandler {
private readonly ZoneSystem zoneSystem;
private readonly EncounterRegistry encounterRegistry;
private readonly AdventureData adventureData;
private readonly EncounterView encounterView;
private string previousZoneId;
private int previousDay;
public EncounterHandler(ZoneSystem zoneSystem, EncounterRegistry encounterRegistry, EncounterPrefabs encounterPrefabs, AdventureData adventureData) {
public EncounterHandler(ZoneSystem zoneSystem, EncounterRegistry encounterRegistry, EncounterPrefabs encounterPrefabs) {
this.zoneSystem = zoneSystem;
this.encounterRegistry = encounterRegistry;
this.adventureData = adventureData;
encounterView = new EncounterView(encounterPrefabs);
}
@@ -62,7 +59,7 @@ namespace Nox.Game {
if(currentZoneId != previousZoneId) {
if(!string.IsNullOrEmpty(currentZoneId)) {
Debug.Log($"Entered zone: {currentZoneId} (encounter: {zoneContext.encounterTableId}, safe: {zoneContext.isSafe})");
if(ResolveEncounter(zoneContext, currentZoneId, out var encounter)) {
if(ResolveEncounter(zoneContext, zoneContext.encounterTableId, out var encounter)) {
TriggerEncounter(encounter);
}
@@ -86,9 +83,7 @@ namespace Nox.Game {
}
public void CheckForEncounters(Vector3 position) {
if (adventureData.currentDay != previousDay) {
VerifyZones(position);
}
VerifyZones(position);
}
public void Tick() { }