forked from Shardstone/trail-into-darkness
should trigger encounters now
This commit is contained in:
@@ -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() { }
|
||||
|
||||
Reference in New Issue
Block a user