- LocationBoard callbacks now only run on the host.
- CameraAnchor now properly syncs followed player data.
This commit is contained in:
@@ -219,17 +219,20 @@ public class GameManagerRound2 : GameManagerBase
|
||||
_Players[1] = _Players[0];
|
||||
}
|
||||
|
||||
HostCardRecoverTheLootInterface RecoverTheLootInterface =
|
||||
(HostCardRecoverTheLootInterface)GetHostCardInterface(RoundSegmentType.RecoverTheLoot);
|
||||
RecoverTheLootInterface.SetComment(_Players[_CurrentPlayerCounter % _Players.Length] + ", you're up first.", COLOR_STANDARD);
|
||||
RecoverTheLootInterface.SetLootButton(_LocationBoard.LootLocation);
|
||||
RecoverTheLootInterface.SetWarrantButton(_LocationBoard.WarrantLocation);
|
||||
RecoverTheLootInterface.SetCrookButton(_LocationBoard.CrookLocation);
|
||||
RecoverTheLootInterface.ActivateAllPanelButtons(true, true);
|
||||
|
||||
for (int i = 0; i < _Landmarks.Length; i++)
|
||||
if (Networking.LocalPlayer == _CaseManager.GetHostOwner())
|
||||
{
|
||||
RecoverTheLootInterface.AddLandmarkName(i, _Landmarks[i]);
|
||||
HostCardRecoverTheLootInterface RecoverTheLootInterface =
|
||||
(HostCardRecoverTheLootInterface)GetHostCardInterface(RoundSegmentType.RecoverTheLoot);
|
||||
RecoverTheLootInterface.SetComment(_Players[_CurrentPlayerCounter % _Players.Length] + ", you're up first.", COLOR_STANDARD);
|
||||
RecoverTheLootInterface.SetLootButton(_LocationBoard.LootLocation);
|
||||
RecoverTheLootInterface.SetWarrantButton(_LocationBoard.WarrantLocation);
|
||||
RecoverTheLootInterface.SetCrookButton(_LocationBoard.CrookLocation);
|
||||
RecoverTheLootInterface.ActivateAllPanelButtons(true, true);
|
||||
|
||||
for (int i = 0; i < _Landmarks.Length; i++)
|
||||
{
|
||||
RecoverTheLootInterface.AddLandmarkName(i, _Landmarks[i]);
|
||||
}
|
||||
}
|
||||
|
||||
_JailPlayer.VideoIndex = (int)_CaseManager.GetCrook();
|
||||
@@ -242,6 +245,8 @@ public class GameManagerRound2 : GameManagerBase
|
||||
|
||||
public void OnTheRightTrack()
|
||||
{
|
||||
if (Networking.LocalPlayer != _CaseManager.GetHostOwner()) return;
|
||||
|
||||
HostCardRecoverTheLootInterface Interface =
|
||||
(HostCardRecoverTheLootInterface)GetHostCardInterface(RoundSegmentType.RecoverTheLoot);
|
||||
Interface.SetComment("On the right track. You get a free turn.", COLOR_GREEN);
|
||||
@@ -251,6 +256,8 @@ public class GameManagerRound2 : GameManagerBase
|
||||
|
||||
public void AlmostThere()
|
||||
{
|
||||
if (Networking.LocalPlayer != _CaseManager.GetHostOwner()) return;
|
||||
|
||||
HostCardRecoverTheLootInterface Interface =
|
||||
(HostCardRecoverTheLootInterface)GetHostCardInterface(RoundSegmentType.RecoverTheLoot);
|
||||
Interface.SetComment("Almost got it. Another free turn.", COLOR_YELLOW);
|
||||
@@ -260,6 +267,8 @@ public class GameManagerRound2 : GameManagerBase
|
||||
|
||||
public void OutOfOrder(PanelType Type)
|
||||
{
|
||||
if (Networking.LocalPlayer != _CaseManager.GetHostOwner()) return;
|
||||
|
||||
HostCardRecoverTheLootInterface Interface =
|
||||
(HostCardRecoverTheLootInterface)GetHostCardInterface(RoundSegmentType.RecoverTheLoot);
|
||||
|
||||
@@ -286,6 +295,8 @@ public class GameManagerRound2 : GameManagerBase
|
||||
// all inputs to prevent messing up the game state.
|
||||
public void NothingThere()
|
||||
{
|
||||
if (Networking.LocalPlayer != _CaseManager.GetHostOwner()) return;
|
||||
|
||||
HostCardRecoverTheLootInterface Interface =
|
||||
(HostCardRecoverTheLootInterface)GetHostCardInterface(RoundSegmentType.RecoverTheLoot);
|
||||
Interface.SetComment("Nothing there.", COLOR_STANDARD);
|
||||
@@ -297,6 +308,8 @@ public class GameManagerRound2 : GameManagerBase
|
||||
|
||||
public void AlreadyTried()
|
||||
{
|
||||
if (Networking.LocalPlayer != _CaseManager.GetHostOwner()) return;
|
||||
|
||||
HostCardRecoverTheLootInterface Interface =
|
||||
(HostCardRecoverTheLootInterface)GetHostCardInterface(RoundSegmentType.RecoverTheLoot);
|
||||
Interface.SetComment("Already tried that one.", COLOR_STANDARD);
|
||||
@@ -308,6 +321,8 @@ public class GameManagerRound2 : GameManagerBase
|
||||
|
||||
public void NiceStrategy()
|
||||
{
|
||||
if (Networking.LocalPlayer != _CaseManager.GetHostOwner()) return;
|
||||
|
||||
HostCardRecoverTheLootInterface Interface =
|
||||
(HostCardRecoverTheLootInterface)GetHostCardInterface(RoundSegmentType.RecoverTheLoot);
|
||||
Interface.SetComment("Nice strategy.", COLOR_GREEN);
|
||||
@@ -321,6 +336,8 @@ public class GameManagerRound2 : GameManagerBase
|
||||
// and should also enable victory animations.
|
||||
public void YoureWinner()
|
||||
{
|
||||
if (Networking.LocalPlayer != _CaseManager.GetHostOwner()) return;
|
||||
|
||||
_RoundIsOver = true;
|
||||
int WinningPlayerNumber = _CurrentPlayerCounter % _Players.Length;
|
||||
string[] Winner = new string[1];
|
||||
@@ -343,7 +360,7 @@ public class GameManagerRound2 : GameManagerBase
|
||||
}
|
||||
public void YoureWinnerDelayedFunctions()
|
||||
{
|
||||
_PlayerConfettiCannons[_CurrentPlayerCounter % _Players.Length].Play();
|
||||
SendCustomNetworkEvent(NetworkEventTarget.All, nameof(YoureWinnerConfettiPlayer));
|
||||
_AudioManager.SendCustomNetworkEvent(NetworkEventTarget.All, "StopMusic");
|
||||
|
||||
SendCustomEventDelayedSeconds(nameof(YoureWinnerDelayedFunctions2), 1.0f);
|
||||
@@ -352,6 +369,11 @@ public class GameManagerRound2 : GameManagerBase
|
||||
{
|
||||
_AudioManager.SendCustomNetworkEvent(NetworkEventTarget.All, "PlayMusic", MusicEventType.YoureWinner);
|
||||
}
|
||||
[NetworkCallable]
|
||||
public void YoureWinnerConfettiPlayer()
|
||||
{
|
||||
_PlayerConfettiCannons[_CurrentPlayerCounter % _Players.Length].Play();
|
||||
}
|
||||
|
||||
|
||||
private void RoundWinner()
|
||||
@@ -432,24 +454,32 @@ public class GameManagerRound2 : GameManagerBase
|
||||
|
||||
public void FoundTheLoot()
|
||||
{
|
||||
_AudioManager.PlaySFX(SFXEventType.TheLoot);
|
||||
if (Networking.LocalPlayer != _CaseManager.GetHostOwner()) return;
|
||||
|
||||
_AudioManager.SendCustomNetworkEvent(NetworkEventTarget.All, "PlaySFX", SFXEventType.TheLoot);
|
||||
SendCustomEventDelayedSeconds(nameof(ActivateAllPanelButtonsExceptTargets_DelayFunction), 1.5f);
|
||||
}
|
||||
|
||||
public void FoundTheWarrant()
|
||||
{
|
||||
_AudioManager.PlaySFX(SFXEventType.TheWarrant);
|
||||
if (Networking.LocalPlayer != _CaseManager.GetHostOwner()) return;
|
||||
|
||||
_AudioManager.SendCustomNetworkEvent(NetworkEventTarget.All, "PlaySFX", SFXEventType.TheWarrant);
|
||||
SendCustomEventDelayedSeconds(nameof(ActivateAllPanelButtonsExceptTargets_DelayFunction), 1.5f);
|
||||
}
|
||||
|
||||
public void FoundTheCrook()
|
||||
{
|
||||
_AudioManager.PlayCrookTheme(_CaseManager.GetCrook());
|
||||
if (Networking.LocalPlayer != _CaseManager.GetHostOwner()) return;
|
||||
|
||||
_AudioManager.SendCustomNetworkEvent(NetworkEventTarget.All, "PlayCrookTheme", _CaseManager.GetCrook());
|
||||
SendCustomEventDelayedSeconds(nameof(ActivateAllPanelButtonsExceptTargets_DelayFunction), 1.5f);
|
||||
}
|
||||
|
||||
public void ActivateAllPanelButtonsExceptTargets_DelayFunction()
|
||||
{
|
||||
if (Networking.LocalPlayer != _CaseManager.GetHostOwner()) return;
|
||||
|
||||
if (!_RoundIsOver)
|
||||
{
|
||||
HostCardRecoverTheLootInterface Interface =
|
||||
|
||||
Reference in New Issue
Block a user