mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-04 02:47:22 +00:00
grapple totem: only work for local illumination
This commit is contained in:
parent
1af1f5c8c7
commit
1338251ae1
15
QSB/EchoesOfTheEye/GrappleTotemSync/GrappleTotemManager.cs
Normal file
15
QSB/EchoesOfTheEye/GrappleTotemSync/GrappleTotemManager.cs
Normal file
@ -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<QSBGrappleTotem, LanternZoomPoint>();
|
||||
}
|
@ -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<QSBLightSensor>().IlluminatedByLocal;
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
using QSB.WorldSync;
|
||||
|
||||
namespace QSB.EchoesOfTheEye.GrappleTotemSync.WorldObjects;
|
||||
|
||||
public class QSBGrappleTotem : WorldObject<LanternZoomPoint>
|
||||
{
|
||||
public override void SendInitialState(uint to) { }
|
||||
|
||||
/// <summary>
|
||||
/// todo grapple visuals
|
||||
/// </summary>
|
||||
public void DoGrappleAnimation() { }
|
||||
}
|
Loading…
Reference in New Issue
Block a user