forked from Shardstone/trail-into-darkness
Merge branch 'main' of https://git.quiludet.com/uzihead/trail-into-darkness
This commit is contained in:
@@ -120,7 +120,7 @@ namespace Nox.Game {
|
||||
timeHandler ??= new TimeHandler(adventureSettings, adventureData, worldClock);
|
||||
|
||||
zoneSystem ??= new ZoneSystem(mapRef.zonesObjectHolder);
|
||||
encounterHandler = new EncounterHandler(zoneSystem, encounterRegistry, encounterPrefabs, adventureData);
|
||||
encounterHandler = new EncounterHandler(zoneSystem, encounterRegistry, encounterPrefabs);
|
||||
partyMovementHandler ??= new PartyMovementHandler(
|
||||
partyRef,
|
||||
cameraController,
|
||||
|
||||
@@ -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() { }
|
||||
|
||||
@@ -17,7 +17,6 @@ namespace Nox.Game {
|
||||
private Vector3 targetPosition;
|
||||
private bool shouldHover;
|
||||
private MapLocation currentSelectedPoi;
|
||||
private string previousZoneId;
|
||||
private bool hasClicked;
|
||||
private bool skipNextClick;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user