more work

This commit is contained in:
JohnCorby 2022-01-12 19:43:48 -08:00
parent 1cd97b5ef6
commit 50ffb7de12
8 changed files with 71 additions and 27 deletions

View File

@ -12,7 +12,9 @@ namespace QSB.TriggerSync
QSBWorldSync.Init<QSBCharacterTrigger, CharacterAnimController>(x => x.playerTrackingZone);
QSBWorldSync.Init<QSBSolanumTrigger, NomaiConversationManager>(x => x._watchPlayerVolume);
QSBWorldSync.Init<QSBVesselCageTrigger, VesselWarpController>(x => x._cageTrigger);
QSBWorldSync.Init<QSBShrineTrigger, QuantumShrine>(x => x._triggerVolume);
QSBWorldSync.Init<QSBMaskZoneTrigger, MaskZoneController>(x => x._maskZoneTrigger);
QSBWorldSync.Init<QSBInflationTrigger, CosmicInflationController>(x => x._smokeSphereTrigger);
}
}
}

View File

@ -1,4 +1,8 @@
namespace QSB.TriggerSync.WorldObjects
using QSB.Animation.NPC.WorldObjects;
using QSB.Player;
using QSB.WorldSync;
namespace QSB.TriggerSync.WorldObjects
{
public class QSBCharacterTrigger : QSBTrigger<CharacterAnimController>
{
@ -9,11 +13,10 @@
AttachedObject.OnExit -= TriggerOwner.OnZoneExit;
}
public override void OnRemoval()
{
base.OnRemoval();
AttachedObject.OnEntry += TriggerOwner.OnZoneEntry;
AttachedObject.OnExit += TriggerOwner.OnZoneExit;
}
protected override void OnEnter(PlayerInfo player)
=> TriggerOwner.GetWorldObject<QSBCharacterAnimController>().AddPlayerToHeadZone(player);
protected override void OnExit(PlayerInfo player)
=> TriggerOwner.GetWorldObject<QSBCharacterAnimController>().RemovePlayerFromHeadZone(player);
}
}

View File

@ -0,0 +1,18 @@
using QSB.EyeOfTheUniverse.CosmicInflation;
using QSB.Player;
namespace QSB.TriggerSync.WorldObjects
{
public class QSBInflationTrigger : QSBTrigger<CosmicInflationController>
{
public override void Init()
{
base.Init();
AttachedObject.OnEntry -= TriggerOwner.OnEnterFogSphere;
}
protected override void OnEnter(PlayerInfo player) => InflationManager.Instance.Enter(player);
protected override void OnExit(PlayerInfo player) { }
}
}

View File

@ -1,4 +1,7 @@
namespace QSB.TriggerSync.WorldObjects
using QSB.EyeOfTheUniverse.MaskSync;
using QSB.Player;
namespace QSB.TriggerSync.WorldObjects
{
public class QSBMaskZoneTrigger : QSBTrigger<MaskZoneController>
{
@ -9,11 +12,8 @@
AttachedObject.OnExit -= TriggerOwner.OnExitMaskZone;
}
public override void OnRemoval()
{
base.OnRemoval();
AttachedObject.OnEntry += TriggerOwner.OnEnterMaskZone;
AttachedObject.OnExit += TriggerOwner.OnExitMaskZone;
}
protected override void OnEnter(PlayerInfo player) => MaskManager.Instance.Enter(player);
protected override void OnExit(PlayerInfo player) => MaskManager.Instance.Exit(player);
}
}

View File

@ -0,0 +1,11 @@
using QSB.Player;
namespace QSB.TriggerSync.WorldObjects
{
public class QSBShrineTrigger : QSBTrigger<QuantumShrine>
{
protected override void OnEnter(PlayerInfo player) => player.IsInShrine = true;
protected override void OnExit(PlayerInfo player) => player.IsInShrine = false;
}
}

View File

@ -1,4 +1,8 @@
namespace QSB.TriggerSync.WorldObjects
using QSB.Animation.NPC.WorldObjects;
using QSB.Player;
using QSB.WorldSync;
namespace QSB.TriggerSync.WorldObjects
{
public class QSBSolanumTrigger : QSBTrigger<NomaiConversationManager>
{
@ -9,11 +13,10 @@
AttachedObject.OnExit -= TriggerOwner.OnExitWatchVolume;
}
public override void OnRemoval()
{
base.OnRemoval();
AttachedObject.OnEntry += TriggerOwner.OnEnterWatchVolume;
AttachedObject.OnExit += TriggerOwner.OnExitWatchVolume;
}
protected override void OnEnter(PlayerInfo player)
=> TriggerOwner.GetWorldObject<QSBSolanumAnimController>().AddPlayerToHeadZone(player);
protected override void OnExit(PlayerInfo player)
=> TriggerOwner.GetWorldObject<QSBSolanumAnimController>().RemovePlayerFromHeadZone(player);
}
}

View File

@ -85,6 +85,7 @@ namespace QSB.TriggerSync.WorldObjects
}
DebugLog.DebugWrite($"{LogName} + {player.PlayerId}");
OnEnter(player);
}
public void Exit(PlayerInfo player)
@ -96,6 +97,11 @@ namespace QSB.TriggerSync.WorldObjects
}
DebugLog.DebugWrite($"{LogName} - {player.PlayerId}");
OnExit(player);
}
protected virtual void OnEnter(PlayerInfo player) { }
protected virtual void OnExit(PlayerInfo player) { }
}
}

View File

@ -1,4 +1,7 @@
namespace QSB.TriggerSync.WorldObjects
using QSB.EyeOfTheUniverse.VesselSync;
using QSB.Player;
namespace QSB.TriggerSync.WorldObjects
{
public class QSBVesselCageTrigger : QSBTrigger<VesselWarpController>
{
@ -8,10 +11,8 @@
AttachedObject.OnExit -= TriggerOwner.OnExitCageTrigger;
}
public override void OnRemoval()
{
base.OnRemoval();
AttachedObject.OnExit += TriggerOwner.OnExitCageTrigger;
}
protected override void OnEnter(PlayerInfo player) => VesselManager.Instance.Enter(player);
protected override void OnExit(PlayerInfo player) => VesselManager.Instance.Exit(player);
}
}