diff --git a/QSB/EchoesOfTheEye/RaftSync/Messages/RaftUndockMessage.cs b/QSB/EchoesOfTheEye/RaftSync/Messages/RaftUndockMessage.cs new file mode 100644 index 00000000..3f424cfa --- /dev/null +++ b/QSB/EchoesOfTheEye/RaftSync/Messages/RaftUndockMessage.cs @@ -0,0 +1,10 @@ +using QSB.EchoesOfTheEye.RaftSync.WorldObjects; +using QSB.Messaging; + +namespace QSB.EchoesOfTheEye.RaftSync.Messages +{ + public class RaftUndockMessage : QSBWorldObjectMessage + { + public override void OnReceiveRemote() => WorldObject.UndockFromRaftDock(); + } +} diff --git a/QSB/EchoesOfTheEye/RaftSync/RaftManager.cs b/QSB/EchoesOfTheEye/RaftSync/RaftManager.cs index 72094833..4b0b1e68 100644 --- a/QSB/EchoesOfTheEye/RaftSync/RaftManager.cs +++ b/QSB/EchoesOfTheEye/RaftSync/RaftManager.cs @@ -18,6 +18,9 @@ namespace QSB.EchoesOfTheEye.RaftSync Rafts.Clear(); Rafts.AddRange(QSBWorldSync.GetUnityObjects().SortDeterministic()); QSBWorldSync.Init(Rafts); + + QSBWorldSync.Init(); + QSBWorldSync.Init(); } } } diff --git a/QSB/EchoesOfTheEye/RaftSync/WorldObjects/QSBDamRaftLift.cs b/QSB/EchoesOfTheEye/RaftSync/WorldObjects/QSBDamRaftLift.cs new file mode 100644 index 00000000..38e98cc7 --- /dev/null +++ b/QSB/EchoesOfTheEye/RaftSync/WorldObjects/QSBDamRaftLift.cs @@ -0,0 +1,12 @@ +using QSB.WorldSync; + +namespace QSB.EchoesOfTheEye.RaftSync.WorldObjects +{ + public class QSBDamRaftLift : WorldObject + { + public override void SendInitialState(uint to) + { + // todo SendInitialState + } + } +} diff --git a/QSB/EchoesOfTheEye/RaftSync/WorldObjects/QSBRaftDock.cs b/QSB/EchoesOfTheEye/RaftSync/WorldObjects/QSBRaftDock.cs new file mode 100644 index 00000000..088bcd2e --- /dev/null +++ b/QSB/EchoesOfTheEye/RaftSync/WorldObjects/QSBRaftDock.cs @@ -0,0 +1,34 @@ +using QSB.WorldSync; + +namespace QSB.EchoesOfTheEye.RaftSync.WorldObjects +{ + public class QSBRaftDock : WorldObject + { + public override void SendInitialState(uint to) + { + // todo SendInitialState + } + + public void UndockFromRaftDock() + { + if (AttachedObject._raft != null && AttachedObject._state == RaftCarrier.DockState.Docked) + { + AttachedObject._raftUndockCountDown = AttachedObject._raft.dropDelay; + AttachedObject._state = RaftCarrier.DockState.WaitForExit; + AttachedObject._raft.SetRailingRaised(true); + if (AttachedObject._gearInterface != null) + { + AttachedObject._gearInterface.AddRotation(90f); + } + + AttachedObject.enabled = true; + return; + } + + if (AttachedObject._gearInterface != null) + { + AttachedObject._gearInterface.PlayFailure(); + } + } + } +}