mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-25 06:35:45 +00:00
qsb raft carriers
This commit is contained in:
parent
fc1ff0210a
commit
712398fb38
10
QSB/EchoesOfTheEye/RaftSync/Messages/RaftUndockMessage.cs
Normal file
10
QSB/EchoesOfTheEye/RaftSync/Messages/RaftUndockMessage.cs
Normal 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();
|
||||
}
|
||||
}
|
@ -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>();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
12
QSB/EchoesOfTheEye/RaftSync/WorldObjects/QSBDamRaftLift.cs
Normal file
12
QSB/EchoesOfTheEye/RaftSync/WorldObjects/QSBDamRaftLift.cs
Normal 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
|
||||
}
|
||||
}
|
||||
}
|
34
QSB/EchoesOfTheEye/RaftSync/WorldObjects/QSBRaftDock.cs
Normal file
34
QSB/EchoesOfTheEye/RaftSync/WorldObjects/QSBRaftDock.cs
Normal 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user