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);
|
timeHandler ??= new TimeHandler(adventureSettings, adventureData, worldClock);
|
||||||
|
|
||||||
zoneSystem ??= new ZoneSystem(mapRef.zonesObjectHolder);
|
zoneSystem ??= new ZoneSystem(mapRef.zonesObjectHolder);
|
||||||
encounterHandler = new EncounterHandler(zoneSystem, encounterRegistry, encounterPrefabs, adventureData);
|
encounterHandler = new EncounterHandler(zoneSystem, encounterRegistry, encounterPrefabs);
|
||||||
partyMovementHandler ??= new PartyMovementHandler(
|
partyMovementHandler ??= new PartyMovementHandler(
|
||||||
partyRef,
|
partyRef,
|
||||||
cameraController,
|
cameraController,
|
||||||
|
|||||||
@@ -6,15 +6,12 @@ namespace Nox.Game {
|
|||||||
public class EncounterHandler {
|
public class EncounterHandler {
|
||||||
private readonly ZoneSystem zoneSystem;
|
private readonly ZoneSystem zoneSystem;
|
||||||
private readonly EncounterRegistry encounterRegistry;
|
private readonly EncounterRegistry encounterRegistry;
|
||||||
private readonly AdventureData adventureData;
|
|
||||||
private readonly EncounterView encounterView;
|
private readonly EncounterView encounterView;
|
||||||
private string previousZoneId;
|
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.zoneSystem = zoneSystem;
|
||||||
this.encounterRegistry = encounterRegistry;
|
this.encounterRegistry = encounterRegistry;
|
||||||
this.adventureData = adventureData;
|
|
||||||
encounterView = new EncounterView(encounterPrefabs);
|
encounterView = new EncounterView(encounterPrefabs);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -62,7 +59,7 @@ namespace Nox.Game {
|
|||||||
if(currentZoneId != previousZoneId) {
|
if(currentZoneId != previousZoneId) {
|
||||||
if(!string.IsNullOrEmpty(currentZoneId)) {
|
if(!string.IsNullOrEmpty(currentZoneId)) {
|
||||||
Debug.Log($"Entered zone: {currentZoneId} (encounter: {zoneContext.encounterTableId}, safe: {zoneContext.isSafe})");
|
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);
|
TriggerEncounter(encounter);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -86,10 +83,8 @@ namespace Nox.Game {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void CheckForEncounters(Vector3 position) {
|
public void CheckForEncounters(Vector3 position) {
|
||||||
if (adventureData.currentDay != previousDay) {
|
|
||||||
VerifyZones(position);
|
VerifyZones(position);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
public void Tick() { }
|
public void Tick() { }
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,6 @@ namespace Nox.Game {
|
|||||||
private Vector3 targetPosition;
|
private Vector3 targetPosition;
|
||||||
private bool shouldHover;
|
private bool shouldHover;
|
||||||
private MapLocation currentSelectedPoi;
|
private MapLocation currentSelectedPoi;
|
||||||
private string previousZoneId;
|
|
||||||
private bool hasClicked;
|
private bool hasClicked;
|
||||||
private bool skipNextClick;
|
private bool skipNextClick;
|
||||||
|
|
||||||
|
|||||||
@@ -74,12 +74,6 @@
|
|||||||
"com.unity.nuget.newtonsoft-json": "3.2.1"
|
"com.unity.nuget.newtonsoft-json": "3.2.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"com.jovian.tag-system": {
|
|
||||||
"version": "file:com.jovian.tag-system",
|
|
||||||
"depth": 0,
|
|
||||||
"source": "embedded",
|
|
||||||
"dependencies": {}
|
|
||||||
},
|
|
||||||
"com.jovian.unitypackagesync": {
|
"com.jovian.unitypackagesync": {
|
||||||
"version": "file:com.jovian.unitypackagesync",
|
"version": "file:com.jovian.unitypackagesync",
|
||||||
"depth": 0,
|
"depth": 0,
|
||||||
|
|||||||
Reference in New Issue
Block a user