Round 3 is now fully implemented. The game can be theoretically finished.

This commit is contained in:
Jamie Greunbaum
2025-06-22 20:51:01 -04:00
parent f69cb5350c
commit 09dcf1a6db
18 changed files with 2147 additions and 291 deletions
@@ -15,7 +15,7 @@ public enum RoundType
None,
LocateTheCrook,
RecoverTheLoot,
ChaseCarmen
CaptureCarmen
}
public enum RoundSegmentType
@@ -30,7 +30,10 @@ public enum RoundSegmentType
Tiebreaker,
RecoverTheLootExplainer,
RecoverTheLoot
RecoverTheLoot,
CaptureCarmenExplainer,
CaptureCarmen
}
@@ -86,7 +89,7 @@ public class GameManagerBase : UdonSharpBehaviour
{
case (int)RoundType.LocateTheCrook: return "Locate The Crook";
case (int)RoundType.RecoverTheLoot: return "Recover The Loot";
case (int)RoundType.ChaseCarmen: return "Chase Carmen";
case (int)RoundType.CaptureCarmen: return "Capture Carmen";
default: return "[[ERROR]]";
}
}
@@ -106,6 +109,9 @@ public class GameManagerBase : UdonSharpBehaviour
case RoundSegmentType.RecoverTheLootExplainer: return "Recover The Loot - Briefing";
case RoundSegmentType.RecoverTheLoot: return "Recover The Loot";
case RoundSegmentType.CaptureCarmenExplainer: return "Capture Carmen - Briefing";
case RoundSegmentType.CaptureCarmen: return "Capture Carmen";
default: return "[[ERROR]]";
}
}
@@ -44,7 +44,7 @@ MonoBehaviour:
Data:
- Name:
Entry: 12
Data: 8
Data: 11
- Name:
Entry: 7
Data:
@@ -296,25 +296,25 @@ MonoBehaviour:
Data:
- Name: $k
Entry: 1
Data: _AudioManager
Data: _Markers
- Name: $v
Entry: 7
Data: 19|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: _AudioManager
Data: _Markers
- Name: <UserType>k__BackingField
Entry: 7
Data: 20|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: AudioManager, Assembly-CSharp
Data: FloorMapMarker[], Assembly-CSharp
- Name:
Entry: 8
Data:
- Name: <SystemType>k__BackingField
Entry: 9
Data: 4
Data: 16
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -356,16 +356,76 @@ MonoBehaviour:
Data:
- Name: $k
Entry: 1
Data: _ActiveMap
Data: _AudioManager
- Name: $v
Entry: 7
Data: 23|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: _ActiveMap
Data: _AudioManager
- Name: <UserType>k__BackingField
Entry: 7
Data: 24|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: AudioManager, Assembly-CSharp
- Name:
Entry: 8
Data:
- Name: <SystemType>k__BackingField
Entry: 9
Data: 4
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
- Name:
Entry: 6
Data:
- Name:
Entry: 8
Data:
- Name: <IsSerialized>k__BackingField
Entry: 5
Data: true
- Name: _fieldAttributes
Entry: 7
Data: 25|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 1
- Name:
Entry: 7
Data: 26|UnityEngine.SerializeField, UnityEngine.CoreModule
- Name:
Entry: 8
Data:
- Name:
Entry: 13
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 7
Data:
- Name: $k
Entry: 1
Data: _ActiveMap
- Name: $v
Entry: 7
Data: 27|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: _ActiveMap
- Name: <UserType>k__BackingField
Entry: 7
Data: 28|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: ContinentMap, Assembly-CSharp
@@ -374,7 +434,7 @@ MonoBehaviour:
Data:
- Name: <SystemType>k__BackingField
Entry: 7
Data: 25|System.RuntimeType, mscorlib
Data: 29|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: System.Int32, mscorlib
@@ -395,7 +455,7 @@ MonoBehaviour:
Data: false
- Name: _fieldAttributes
Entry: 7
Data: 26|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
Data: 30|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 0
@@ -419,13 +479,13 @@ MonoBehaviour:
Data: _ContinentData
- Name: $v
Entry: 7
Data: 27|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
Data: 31|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: _ContinentData
- Name: <UserType>k__BackingField
Entry: 7
Data: 28|System.RuntimeType, mscorlib
Data: 32|System.RuntimeType, mscorlib
- Name:
Entry: 1
Data: VRC.SDK3.Data.DataDictionary, VRCSDK3
@@ -434,7 +494,7 @@ MonoBehaviour:
Data:
- Name: <SystemType>k__BackingField
Entry: 9
Data: 28
Data: 32
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -449,7 +509,7 @@ MonoBehaviour:
Data: false
- Name: _fieldAttributes
Entry: 7
Data: 29|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
Data: 33|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 0
@@ -473,16 +533,16 @@ MonoBehaviour:
Data: _StageIndex
- Name: $v
Entry: 7
Data: 30|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
Data: 34|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: _StageIndex
- Name: <UserType>k__BackingField
Entry: 9
Data: 25
Data: 29
- Name: <SystemType>k__BackingField
Entry: 9
Data: 25
Data: 29
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
@@ -497,7 +557,103 @@ MonoBehaviour:
Data: false
- Name: _fieldAttributes
Entry: 7
Data: 31|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
Data: 35|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 0
- Name:
Entry: 13
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 7
Data:
- Name: $k
Entry: 1
Data: _SuccessCounter
- Name: $v
Entry: 7
Data: 36|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: _SuccessCounter
- Name: <UserType>k__BackingField
Entry: 9
Data: 29
- Name: <SystemType>k__BackingField
Entry: 9
Data: 29
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
- Name:
Entry: 6
Data:
- Name:
Entry: 8
Data:
- Name: <IsSerialized>k__BackingField
Entry: 5
Data: false
- Name: _fieldAttributes
Entry: 7
Data: 37|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 0
- Name:
Entry: 13
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 8
Data:
- Name:
Entry: 7
Data:
- Name: $k
Entry: 1
Data: _FailureCounter
- Name: $v
Entry: 7
Data: 38|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
- Name: <Name>k__BackingField
Entry: 1
Data: _FailureCounter
- Name: <UserType>k__BackingField
Entry: 9
Data: 29
- Name: <SystemType>k__BackingField
Entry: 9
Data: 29
- Name: <SyncMode>k__BackingField
Entry: 7
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
- Name:
Entry: 6
Data:
- Name:
Entry: 8
Data:
- Name: <IsSerialized>k__BackingField
Entry: 5
Data: false
- Name: _fieldAttributes
Entry: 7
Data: 39|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
- Name:
Entry: 12
Data: 0
@@ -2,6 +2,7 @@
using UdonSharp;
using UnityEngine;
using VRC.SDK3.Data;
using VRC.SDK3.UdonNetworkCalling;
public enum ContinentMap
@@ -19,7 +20,9 @@ public enum ContinentMap
public class GameManagerRound3 : GameManagerBase
{
[SerializeField] private CaseManager _CaseManager;
[SerializeField] private FloorMap[] _Maps;
[SerializeField] private FloorMapMarker[] _Markers;
[SerializeField] private AudioManager _AudioManager;
@@ -27,11 +30,15 @@ public class GameManagerRound3 : GameManagerBase
private DataDictionary _ContinentData;
private int _StageIndex = 0;
private int _SuccessCounter = 0;
private int _FailureCounter = 0;
private const int MAX_FAILURE_COUNT = 2;
private const int MAX_SUCCESS_COUNT = 8;
public override void InitialiseGameMode()
{
base.InitialiseGameMode();
}
@@ -45,12 +52,14 @@ public class GameManagerRound3 : GameManagerBase
_ActiveMap = (ContinentMap)(int)_ContinentData["Continent"].Number;
for (int i = 0; i < _Maps.Length; i++)
{
FloorMap Map = _Maps[(int)_ActiveMap];
FloorMap Map = _Maps[i];
if (Map != null)
{
Map.gameObject.SetActive(i == (int)_ActiveMap);
}
}
GetCurrentMap().RandomiseCountries();
}
else
{
@@ -62,37 +71,99 @@ public class GameManagerRound3 : GameManagerBase
private void DisplayBriefing()
{
HostCardRecoverTheLootExplainerInterface RecoverTheLootInterface =
(HostCardRecoverTheLootExplainerInterface)GetHostCardInterface(RoundSegmentType.RecoverTheLootExplainer);
HostCardCaptureCarmenExplainerInterface CaptureCarmenExplainerInterface =
(HostCardCaptureCarmenExplainerInterface)GetHostCardInterface(RoundSegmentType.CaptureCarmenExplainer);
RecoverTheLootInterface.HeaderUI.text = RoundSegmentTypeToString(RoundSegmentType.RecoverTheLootExplainer);
CaptureCarmenExplainerInterface.HeaderUI.text = RoundSegmentTypeToString(RoundSegmentType.CaptureCarmenExplainer);
}
public void BeginRound()
{
UpdateInterface();
GetCurrentMarker().EnablePickup(true);
}
public void CorrectResponse()
{
_AudioManager.PlaySFX(SFXEventType.MapCorrect);
GetCurrentMarker().EnablePickup(false);
_SuccessCounter++;
if (_SuccessCounter >= MAX_SUCCESS_COUNT)
{
Debug.LogError("No error. We won.");
}
else
{
int NextCountry = GetCurrentMap().NextCountry();
_Markers[NextCountry].EnablePickup(true);
UpdateInterface();
}
}
public void IncorrectResponse()
{
_FailureCounter++;
if (_FailureCounter >= MAX_FAILURE_COUNT)
{
_FailureCounter = 0;
GetCurrentMarker().EnablePickup(false);
int NextCountry = GetCurrentMap().NextCountry();
_Markers[NextCountry].EnablePickup(true);
UpdateInterface();
}
_AudioManager.PlaySFX(SFXEventType.MapIncorrect);
}
public FloorMap GetCurrentMap()
{
return _Maps[(int)_ActiveMap];
}
public FloorMapMarker GetCurrentMarker()
{
return _Markers[GetCurrentMap().GetCurrentCountryIndex()];
}
public string GetCurrentCountry()
{
return _Maps[(int)_ActiveMap].GetCurrentCountry();
return GetCurrentMap().GetCurrentCountry();
}
public string GetCurrentCity()
{
return _Maps[(int)_ActiveMap].GetCurrentCity();
return GetCurrentMap().GetCurrentCity();
}
private void UpdateInterface()
{
HostCardCaptureCarmenInterface CaptureCarmenInterface =
(HostCardCaptureCarmenInterface)GetHostCardInterface(RoundSegmentType.CaptureCarmen);
CaptureCarmenInterface.HeaderUI.text = RoundSegmentTypeToString(RoundSegmentType.CaptureCarmen);
CaptureCarmenInterface.CommentUI.text = GetCurrentCity() + ", " + GetCurrentCountry();
}
protected override HostCardInterfaceBase GetHostCardInterface(RoundSegmentType Question)
{
return _HostCard.EnableHostCardDisplay(RoundType.RecoverTheLoot, Question);
return _HostCard.EnableHostCardDisplay(RoundType.CaptureCarmen, Question);
}
protected override void _HostCardUseButtonDown_Internal()
{
//_StageIndex++;
//switch (_StageIndex)
//{
// case 1: DisplayBriefing(); break;
// case 2: BeginRound(); break;
//}
_StageIndex++;
switch (_StageIndex)
{
case 1: DisplayBriefing(); break;
case 2: BeginRound(); break;
}
}
}