diff --git a/QSB/EchoesOfTheEye/GrappleTotemSync/GrappleTotemManager.cs b/QSB/EchoesOfTheEye/GrappleTotemSync/GrappleTotemManager.cs new file mode 100644 index 00000000..ab500335 --- /dev/null +++ b/QSB/EchoesOfTheEye/GrappleTotemSync/GrappleTotemManager.cs @@ -0,0 +1,15 @@ +using Cysharp.Threading.Tasks; +using QSB.EchoesOfTheEye.GrappleTotemSync.WorldObjects; +using QSB.WorldSync; +using System.Threading; + +namespace QSB.EchoesOfTheEye.GrappleTotemSync; + +public class GrappleTotemManager : WorldObjectManager +{ + public override WorldObjectScene WorldObjectScene => WorldObjectScene.SolarSystem; + public override bool DlcOnly => true; + + public override async UniTask BuildWorldObjects(OWScene scene, CancellationToken ct) => + QSBWorldSync.Init(); +} diff --git a/QSB/EchoesOfTheEye/GrappleTotemSync/Patches/GrappleTotemPatches.cs b/QSB/EchoesOfTheEye/GrappleTotemSync/Patches/GrappleTotemPatches.cs new file mode 100644 index 00000000..e3a7a2f2 --- /dev/null +++ b/QSB/EchoesOfTheEye/GrappleTotemSync/Patches/GrappleTotemPatches.cs @@ -0,0 +1,17 @@ +using HarmonyLib; +using QSB.EchoesOfTheEye.LightSensorSync.WorldObjects; +using QSB.Patches; +using QSB.WorldSync; + +namespace QSB.EchoesOfTheEye.GrappleTotemSync.Patches; + +public class GrappleTotemPatches : QSBPatch +{ + public override QSBPatchTypes Type => QSBPatchTypes.OnClientConnect; + + [HarmonyPrefix] + [HarmonyPatch(typeof(LanternZoomPoint), nameof(LanternZoomPoint.OnDetectLight))] + private static bool OnDetectLight(LanternZoomPoint __instance) => + !QSBWorldSync.AllObjectsReady || + __instance._lightSensor.GetWorldObject().IlluminatedByLocal; +} diff --git a/QSB/EchoesOfTheEye/GrappleTotemSync/WorldObjects/QSBGrappleTotem.cs b/QSB/EchoesOfTheEye/GrappleTotemSync/WorldObjects/QSBGrappleTotem.cs new file mode 100644 index 00000000..9087640a --- /dev/null +++ b/QSB/EchoesOfTheEye/GrappleTotemSync/WorldObjects/QSBGrappleTotem.cs @@ -0,0 +1,13 @@ +using QSB.WorldSync; + +namespace QSB.EchoesOfTheEye.GrappleTotemSync.WorldObjects; + +public class QSBGrappleTotem : WorldObject +{ + public override void SendInitialState(uint to) { } + + /// + /// todo grapple visuals + /// + public void DoGrappleAnimation() { } +}