qsb raft carriers

This commit is contained in:
JohnCorby 2022-02-27 13:04:32 -08:00
parent fc1ff0210a
commit 712398fb38
4 changed files with 59 additions and 0 deletions

View File

@ -0,0 +1,10 @@
using QSB.EchoesOfTheEye.RaftSync.WorldObjects;
using QSB.Messaging;
namespace QSB.EchoesOfTheEye.RaftSync.Messages
{
public class RaftUndockMessage : QSBWorldObjectMessage<QSBRaftDock>
{
public override void OnReceiveRemote() => WorldObject.UndockFromRaftDock();
}
}

View File

@ -18,6 +18,9 @@ namespace QSB.EchoesOfTheEye.RaftSync
Rafts.Clear();
Rafts.AddRange(QSBWorldSync.GetUnityObjects<RaftController>().SortDeterministic());
QSBWorldSync.Init<QSBRaft, RaftController>(Rafts);
QSBWorldSync.Init<QSBRaftDock, RaftDock>();
QSBWorldSync.Init<QSBDamRaftLift, DamRaftLift>();
}
}
}

View File

@ -0,0 +1,12 @@
using QSB.WorldSync;
namespace QSB.EchoesOfTheEye.RaftSync.WorldObjects
{
public class QSBDamRaftLift : WorldObject<DamRaftLift>
{
public override void SendInitialState(uint to)
{
// todo SendInitialState
}
}
}

View File

@ -0,0 +1,34 @@
using QSB.WorldSync;
namespace QSB.EchoesOfTheEye.RaftSync.WorldObjects
{
public class QSBRaftDock : WorldObject<RaftDock>
{
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();
}
}
}
}