using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Serialization; using System.Runtime.Versioning; using System.Text; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using ExitGames.Client.Photon; using HarmonyLib; using Microsoft.CodeAnalysis; using Photon.Pun; using Photon.Realtime; using REPOLib.Modules; using REPOLib.Objects.Sdk; using TMPro; using UnityEngine; using UnityEngine.Networking; using UnityEngine.Rendering; using UnityEngine.SceneManagement; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("Empress")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.4.0")] [assembly: AssemblyInformationalVersion("1.0.4")] [assembly: AssemblyProduct("EmpressUmuRace")] [assembly: AssemblyTitle("EmpressUmuRace")] [assembly: AssemblyVersion("1.0.4.0")] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace Empress.REPO.UmuRace { internal static class EmpressUmuAccess { private static readonly FieldInfo EnvironmentSetupDoneField = AccessTools.Field(typeof(EnvironmentDirector), "SetupDone"); private static readonly FieldInfo EnvironmentMainCameraField = AccessTools.Field(typeof(EnvironmentDirector), "MainCamera"); private static readonly FieldInfo EnvironmentAmbientColorField = AccessTools.Field(typeof(EnvironmentDirector), "AmbientColor"); private static readonly FieldInfo EnvironmentAmbientColorNewField = AccessTools.Field(typeof(EnvironmentDirector), "AmbientColorNew"); private static readonly FieldInfo EnvironmentAmbientColorPreviousField = AccessTools.Field(typeof(EnvironmentDirector), "AmbientColorPrevious"); private static readonly FieldInfo EnvironmentAmbientColorAdaptationField = AccessTools.Field(typeof(EnvironmentDirector), "AmbientColorAdaptation"); private static readonly FieldInfo EnvironmentAmbientColorAdaptationNewField = AccessTools.Field(typeof(EnvironmentDirector), "AmbientColorAdaptationNew"); private static readonly FieldInfo EnvironmentAmbientColorAdaptationPreviousField = AccessTools.Field(typeof(EnvironmentDirector), "AmbientColorAdaptationPrevious"); private static readonly FieldInfo EnvironmentDarkAdaptationLerpField = AccessTools.Field(typeof(EnvironmentDirector), "DarkAdaptationLerp"); private static readonly FieldInfo EnvironmentFogColorField = AccessTools.Field(typeof(EnvironmentDirector), "FogColor"); private static readonly FieldInfo EnvironmentFogColorNewField = AccessTools.Field(typeof(EnvironmentDirector), "FogColorNew"); private static readonly FieldInfo EnvironmentFogColorPreviousField = AccessTools.Field(typeof(EnvironmentDirector), "FogColorPrevious"); private static readonly FieldInfo EnvironmentFogStartDistanceField = AccessTools.Field(typeof(EnvironmentDirector), "FogStartDistance"); private static readonly FieldInfo EnvironmentFogStartDistanceNewField = AccessTools.Field(typeof(EnvironmentDirector), "FogStartDistanceNew"); private static readonly FieldInfo EnvironmentFogStartDistancePreviousField = AccessTools.Field(typeof(EnvironmentDirector), "FogStartDistancePrevious"); private static readonly FieldInfo EnvironmentFogEndDistanceField = AccessTools.Field(typeof(EnvironmentDirector), "FogEndDistance"); private static readonly FieldInfo EnvironmentFogEndDistanceNewField = AccessTools.Field(typeof(EnvironmentDirector), "FogEndDistanceNew"); private static readonly FieldInfo EnvironmentFogEndDistancePreviousField = AccessTools.Field(typeof(EnvironmentDirector), "FogEndDistancePrevious"); private static readonly FieldInfo GeneratorAllPlayersReadyField = AccessTools.Field(typeof(LevelGenerator), "AllPlayersReady"); private static readonly FieldInfo GeneratorEnemyReadyField = AccessTools.Field(typeof(LevelGenerator), "EnemyReady"); private static readonly FieldInfo GeneratorModulesSpawnedField = AccessTools.Field(typeof(LevelGenerator), "ModulesSpawned"); private static readonly FieldInfo GeneratorPlayerSpawnedField = AccessTools.Field(typeof(LevelGenerator), "playerSpawned"); private static readonly FieldInfo RunLevelPreviousField = AccessTools.Field(typeof(RunManager), "levelPrevious"); private static readonly FieldInfo ModuleSetupDoneField = AccessTools.Field(typeof(Module), "SetupDone"); private static readonly FieldInfo ModuleStartRoomField = AccessTools.Field(typeof(Module), "StartRoom"); private static readonly FieldInfo ModuleGridXField = AccessTools.Field(typeof(Module), "GridX"); private static readonly FieldInfo ModuleGridYField = AccessTools.Field(typeof(Module), "GridY"); private static readonly FieldInfo ModuleFirstField = AccessTools.Field(typeof(Module), "First"); private static readonly FieldInfo LevelPointInStartRoomField = AccessTools.Field(typeof(LevelPoint), "inStartRoom"); private static readonly FieldRef AvatarIsMovingRef = AccessTools.FieldRefAccess("isMoving"); private static readonly FieldRef AvatarIsSprintingRef = AccessTools.FieldRefAccess("isSprinting"); private static readonly FieldRef AvatarIsCrouchingRef = AccessTools.FieldRefAccess("isCrouching"); private static readonly FieldRef AvatarIsCrawlingRef = AccessTools.FieldRefAccess("isCrawling"); private static readonly FieldRef AvatarIsSlidingRef = AccessTools.FieldRefAccess("isSliding"); private static readonly FieldRef AvatarIsTumblingRef = AccessTools.FieldRefAccess("isTumbling"); private static readonly FieldRef ControllerMovingRef = AccessTools.FieldRefAccess("moving"); private static readonly FieldRef ControllerSprintingRef = AccessTools.FieldRefAccess("sprinting"); private static readonly FieldRef ControllerCrouchingRef = AccessTools.FieldRefAccess("Crouching"); private static readonly FieldRef ControllerCrawlingRef = AccessTools.FieldRefAccess("Crawling"); private static readonly FieldRef ControllerSlidingRef = AccessTools.FieldRefAccess("Sliding"); private static readonly FieldInfo AvatarNameField = AccessTools.Field(typeof(PlayerAvatar), "playerName"); private static readonly FieldInfo AvatarHealthField = AccessTools.Field(typeof(PlayerAvatar), "playerHealth"); private static readonly FieldInfo AvatarRigidbodyField = AccessTools.Field(typeof(PlayerAvatar), "rb"); private static readonly FieldInfo ControllerRigidbodyField = AccessTools.Field(typeof(PlayerController), "rb"); private static readonly FieldInfo ControllerVelocityField = AccessTools.Field(typeof(PlayerController), "Velocity"); private static readonly FieldInfo ControllerVelocityRelativeField = AccessTools.Field(typeof(PlayerController), "VelocityRelative"); private static readonly FieldInfo ControllerVelocityRelativeNewField = AccessTools.Field(typeof(PlayerController), "VelocityRelativeNew"); private static readonly FieldInfo VisualPositionField = AccessTools.Field(typeof(PlayerAvatarVisuals), "visualPosition"); private static readonly FieldInfo VisualPlayerAvatarField = AccessTools.Field(typeof(PlayerAvatarVisuals), "playerAvatar"); private static readonly FieldInfo VisualMeshParentField = AccessTools.Field(typeof(PlayerAvatarVisuals), "meshParent"); private static readonly FieldInfo VisualAnimatorField = AccessTools.Field(typeof(PlayerAvatarVisuals), "animator"); private static readonly FieldInfo VisualLocalVisibilityField = AccessTools.Field(typeof(PlayerAvatarVisuals), "localVisibility"); private static readonly FieldInfo VisualShowSelfOverrideTimerField = AccessTools.Field(typeof(PlayerAvatarVisuals), "showSelfOverrideTimer"); private static readonly MethodInfo ModuleChecklistMethod = AccessTools.Method(typeof(Module), "SetAllChecklist", (Type[])null, (Type[])null); private static readonly MethodInfo GeneratorDoneMethod = AccessTools.Method(typeof(LevelGenerator), "GenerateDone", new Type[1] { typeof(PhotonMessageInfo) }, (Type[])null); private static readonly MethodInfo InputDisableMethod = AccessTools.Method(typeof(PlayerController), "InputDisable", new Type[1] { typeof(float) }, (Type[])null); private static readonly MethodInfo VisualApplyVisibilityBodyMethod = AccessTools.Method(typeof(PlayerAvatarVisuals), "ApplyLocalVisibilityBody", (Type[])null, (Type[])null); private static readonly MethodInfo SteamIdMethod = AccessTools.Method(typeof(SemiFunc), "PlayerGetSteamID", new Type[1] { typeof(PlayerAvatar) }, (Type[])null); private static readonly MethodInfo HurtMethod = AccessTools.Method(typeof(PlayerHealth), "Hurt", new Type[4] { typeof(int), typeof(bool), typeof(int), typeof(bool) }, (Type[])null); private static readonly MethodInfo ExplosionMethod = AccessTools.Method(typeof(ParticleScriptExplosion), "Spawn", new Type[8] { typeof(Vector3), typeof(float), typeof(int), typeof(int), typeof(float), typeof(bool), typeof(bool), typeof(float) }, (Type[])null); private static readonly MethodInfo SyncDictionariesMethod = AccessTools.Method(typeof(PunManager), "SyncAllDictionaries", (Type[])null, (Type[])null); private static readonly MethodInfo[] HideUiMethods = new MethodInfo[8] { AccessTools.Method(typeof(SemiFunc), "UIHideAim", (Type[])null, (Type[])null), AccessTools.Method(typeof(SemiFunc), "UIHideHealth", (Type[])null, (Type[])null), AccessTools.Method(typeof(SemiFunc), "UIHideEnergy", (Type[])null, (Type[])null), AccessTools.Method(typeof(SemiFunc), "UIHideInventory", (Type[])null, (Type[])null), AccessTools.Method(typeof(SemiFunc), "UIHideHaul", (Type[])null, (Type[])null), AccessTools.Method(typeof(SemiFunc), "UIHideGoal", (Type[])null, (Type[])null), AccessTools.Method(typeof(SemiFunc), "UIHideCurrency", (Type[])null, (Type[])null), AccessTools.Method(typeof(SemiFunc), "UIHideShopCost", (Type[])null, (Type[])null) }; private static readonly FieldInfo[] UiInstanceFields = new FieldInfo[8] { AccessTools.Field(typeof(Aim), "instance"), AccessTools.Field(typeof(HealthUI), "instance"), AccessTools.Field(typeof(EnergyUI), "instance"), AccessTools.Field(typeof(InventoryUI), "instance"), AccessTools.Field(typeof(HaulUI), "instance"), AccessTools.Field(typeof(GoalUI), "instance"), AccessTools.Field(typeof(CurrencyUI), "instance"), AccessTools.Field(typeof(ShopCostUI), "instance") }; private static readonly MethodInfo[] UpgradeMethods = new MethodInfo[10] { AccessTools.Method(typeof(PunManager), "UpgradePlayerHealth", new Type[2] { typeof(string), typeof(int) }, (Type[])null), AccessTools.Method(typeof(PunManager), "UpgradePlayerEnergy", new Type[2] { typeof(string), typeof(int) }, (Type[])null), AccessTools.Method(typeof(PunManager), "UpgradePlayerSprintSpeed", new Type[2] { typeof(string), typeof(int) }, (Type[])null), AccessTools.Method(typeof(PunManager), "UpgradePlayerExtraJump", new Type[2] { typeof(string), typeof(int) }, (Type[])null), AccessTools.Method(typeof(PunManager), "UpgradePlayerGrabStrength", new Type[2] { typeof(string), typeof(int) }, (Type[])null), AccessTools.Method(typeof(PunManager), "UpgradePlayerThrowStrength", new Type[2] { typeof(string), typeof(int) }, (Type[])null), AccessTools.Method(typeof(PunManager), "UpgradePlayerGrabRange", new Type[2] { typeof(string), typeof(int) }, (Type[])null), AccessTools.Method(typeof(PunManager), "UpgradePlayerTumbleLaunch", new Type[2] { typeof(string), typeof(int) }, (Type[])null), AccessTools.Method(typeof(PunManager), "UpgradePlayerTumbleClimb", new Type[2] { typeof(string), typeof(int) }, (Type[])null), AccessTools.Method(typeof(PunManager), "UpgradePlayerTumbleWings", new Type[2] { typeof(string), typeof(int) }, (Type[])null) }; private static readonly string[] UpgradeNames = new string[10] { "Health", "Energy", "Sprint Speed", "Extra Jump", "Grab Strength", "Throw Strength", "Grab Range", "Tumble Launch", "Tumble Climb", "Tumble Wings" }; internal static bool GetAllPlayersReady(LevelGenerator generator) { return GetBool(GeneratorAllPlayersReadyField, generator); } internal static int GetPlayerSpawnedCount(LevelGenerator generator) { return GetInt(GeneratorPlayerSpawnedField, generator); } internal static void SetAllPlayersReady(LevelGenerator generator, bool value) { Set(GeneratorAllPlayersReadyField, generator, value); } internal static void SetEnemyReady(LevelGenerator generator, bool value) { Set(GeneratorEnemyReadyField, generator, value); } internal static void SetModulesSpawned(LevelGenerator generator, int value) { Set(GeneratorModulesSpawnedField, generator, value); } internal static void SetPlayerSpawnedCount(LevelGenerator generator, int value) { Set(GeneratorPlayerSpawnedField, generator, value); } internal static void SetLevelPrevious(RunManager manager, Level level) { Set(RunLevelPreviousField, manager, level); } internal static void MarkLevelPointInStartRoom(LevelPoint point, bool value) { Set(LevelPointInStartRoomField, point, value); } internal static void ConfigureStartRoomModule(Module module) { ModuleChecklistMethod?.Invoke(module, null); Set(ModuleSetupDoneField, module, true); Set(ModuleStartRoomField, module, true); Set(ModuleFirstField, module, true); Set(ModuleGridXField, module, 0); Set(ModuleGridYField, module, 0); } internal static void GenerateDone(LevelGenerator generator) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) GeneratorDoneMethod?.Invoke(generator, new object[1] { (object)default(PhotonMessageInfo) }); } internal static void ConfigureEnvironment(EnvironmentDirector director, Color fog, Color ambient, float fogStart, float fogEnd) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) Set(EnvironmentFogColorField, director, fog); Set(EnvironmentFogColorNewField, director, fog); Set(EnvironmentFogColorPreviousField, director, fog); Set(EnvironmentFogStartDistanceField, director, fogStart); Set(EnvironmentFogStartDistanceNewField, director, fogStart); Set(EnvironmentFogStartDistancePreviousField, director, fogStart); Set(EnvironmentFogEndDistanceField, director, fogEnd); Set(EnvironmentFogEndDistanceNewField, director, fogEnd); Set(EnvironmentFogEndDistancePreviousField, director, fogEnd); Set(EnvironmentAmbientColorField, director, ambient); Set(EnvironmentAmbientColorNewField, director, ambient); Set(EnvironmentAmbientColorPreviousField, director, ambient); Set(EnvironmentAmbientColorAdaptationField, director, ambient); Set(EnvironmentAmbientColorAdaptationNewField, director, ambient); Set(EnvironmentAmbientColorAdaptationPreviousField, director, ambient); Set(EnvironmentDarkAdaptationLerpField, director, 0f); Set(EnvironmentSetupDoneField, director, true); if ((Object)(object)Get(EnvironmentMainCameraField, director) == (Object)null) { Set(EnvironmentMainCameraField, director, Camera.main); } } internal static List Players() { if (!((Object)(object)GameDirector.instance != (Object)null) || GameDirector.instance.PlayerList == null) { return new List(); } return GameDirector.instance.PlayerList; } internal static PlayerAvatar LocalAvatar() { if (!((Object)(object)PlayerController.instance != (Object)null)) { return null; } return PlayerController.instance.playerAvatarScript; } internal static PlayerAvatar AvatarByViewId(int viewId) { List list = Players(); for (int i = 0; i < list.Count; i++) { PlayerAvatar val = list[i]; if ((Object)(object)val != (Object)null && (Object)(object)val.photonView != (Object)null && val.photonView.ViewID == viewId) { return val; } } return null; } internal static string PlayerName(PlayerAvatar avatar) { string text = (((Object)(object)avatar != (Object)null) ? (AvatarNameField?.GetValue(avatar) as string) : null); if (!string.IsNullOrWhiteSpace(text)) { return text; } return "Runner"; } internal static GameObject VisualMeshParent(PlayerAvatarVisuals visuals) { return Get(VisualMeshParentField, visuals); } internal static PlayerAvatar VisualPlayerAvatar(PlayerAvatarVisuals visuals) { return Get(VisualPlayerAvatarField, visuals); } internal static Animator VisualAnimator(PlayerAvatarVisuals visuals) { return Get(VisualAnimatorField, visuals); } internal static bool IsLocalVisuals(PlayerAvatarVisuals visuals) { PlayerAvatar val = LocalAvatar(); if ((Object)(object)visuals != (Object)null && (Object)(object)val != (Object)null) { return (Object)(object)visuals == (Object)(object)val.playerAvatarVisuals; } return false; } internal static ShadowCastingMode VisualVisibility(PlayerAvatarVisuals visuals) { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) object obj = ((!((Object)(object)visuals != (Object)null)) ? null : VisualLocalVisibilityField?.GetValue(visuals)); if (obj is ShadowCastingMode) { return (ShadowCastingMode)obj; } return (ShadowCastingMode)3; } internal static void SetVisualVisibility(PlayerAvatarVisuals visuals, ShadowCastingMode mode, bool apply) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Invalid comparison between Unknown and I4 if (!((Object)(object)visuals == (Object)null)) { Set(VisualLocalVisibilityField, visuals, mode); if ((int)mode == 1) { Set(VisualShowSelfOverrideTimerField, visuals, 0.35f); } else { Set(VisualShowSelfOverrideTimerField, visuals, 0f); } if (apply) { VisualApplyVisibilityBodyMethod?.Invoke(visuals, null); } } } internal static void HideVanillaHud() { for (int i = 0; i < HideUiMethods.Length; i++) { if (!(HideUiMethods[i] == null)) { FieldInfo fieldInfo = UiInstanceFields[i]; if (fieldInfo == null || fieldInfo.GetValue(null) != null) { HideUiMethods[i].Invoke(null, null); } } } } internal static void LockControls() { PlayerController instance = PlayerController.instance; if (!((Object)(object)instance == (Object)null)) { InputDisableMethod?.Invoke(instance, new object[1] { 0.25f }); } } internal static void MoveLocal(Vector3 position, Quaternion rotation, Vector3 velocity) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) PlayerController instance = PlayerController.instance; PlayerAvatar val = LocalAvatar(); if (!((Object)(object)instance == (Object)null) && !((Object)(object)val == (Object)null)) { ((Component)instance).transform.SetPositionAndRotation(position, rotation); Rigidbody val2 = Get(ControllerRigidbodyField, instance); if ((Object)(object)val2 != (Object)null) { val2.position = position; val2.rotation = rotation; val2.velocity = velocity; val2.angularVelocity = Vector3.zero; } Set(ControllerVelocityField, instance, velocity); Set(ControllerVelocityRelativeField, instance, velocity); Set(ControllerVelocityRelativeNewField, instance, velocity); ((Component)val).transform.SetPositionAndRotation(position, rotation); if ((Object)(object)val.playerTransform != (Object)null) { val.playerTransform.SetPositionAndRotation(position, rotation); } Rigidbody val3 = Get(AvatarRigidbodyField, val); if ((Object)(object)val3 != (Object)null) { val3.position = position; val3.rotation = rotation; val3.velocity = velocity; val3.angularVelocity = Vector3.zero; } if ((Object)(object)val.playerAvatarVisuals != (Object)null) { ((Component)val.playerAvatarVisuals).transform.position = position; Set(VisualPositionField, val.playerAvatarVisuals, position); } } } internal static void SetRunFlags(PlayerAvatar avatar, bool running) { if (!((Object)(object)avatar == (Object)null)) { AvatarIsCrouchingRef.Invoke(avatar) = false; AvatarIsCrawlingRef.Invoke(avatar) = false; AvatarIsSlidingRef.Invoke(avatar) = false; AvatarIsTumblingRef.Invoke(avatar) = false; AvatarIsSprintingRef.Invoke(avatar) = running; AvatarIsMovingRef.Invoke(avatar) = running; PlayerController instance = PlayerController.instance; if ((Object)(object)instance != (Object)null && (Object)(object)avatar == (Object)(object)LocalAvatar()) { ControllerCrouchingRef.Invoke(instance) = false; ControllerCrawlingRef.Invoke(instance) = false; ControllerSlidingRef.Invoke(instance) = false; ControllerMovingRef.Invoke(instance) = running; ControllerSprintingRef.Invoke(instance) = running; } } } internal static void ForceAnimatorRun(PlayerAvatar avatar, bool running, float intensity) { //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Invalid comparison between Unknown and I4 //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Invalid comparison between Unknown and I4 if ((Object)(object)avatar == (Object)null) { return; } PlayerAvatarVisuals playerAvatarVisuals = avatar.playerAvatarVisuals; Animator val = (((Object)(object)playerAvatarVisuals != (Object)null) ? Get(VisualAnimatorField, playerAvatarVisuals) : null); if ((Object)(object)val == (Object)null || (Object)(object)val.runtimeAnimatorController == (Object)null) { return; } ((Behaviour)val).enabled = true; val.cullingMode = (AnimatorCullingMode)0; AnimatorControllerParameter[] parameters = val.parameters; foreach (AnimatorControllerParameter val2 in parameters) { string text = val2.name.ToLowerInvariant(); if ((int)val2.type == 1) { if (text.Contains("horizontal") || text.Contains("strafe")) { val.SetFloat(val2.nameHash, 0f); } else if (text.Contains("vertical") || text.Contains("forward") || text.Contains("speed") || text.Contains("move") || text.Contains("velocity") || text.Contains("run") || text.Contains("walk") || text.Contains("locomotion") || text.Contains("blend")) { val.SetFloat(val2.nameHash, running ? 1f : 0f); } } else if ((int)val2.type == 4) { if (text.Contains("crouch") || text.Contains("crawl") || text.Contains("slid") || text.Contains("jump") || text.Contains("fall") || text.Contains("tumbl") || text.Contains("turn") || text.Contains("grab") || text.Contains("sit")) { val.SetBool(val2.nameHash, false); } else if (text.Contains("ground")) { val.SetBool(val2.nameHash, true); } else if (text.Contains("sprint") || text.Contains("moving") || text.Contains("move") || text.Contains("walk") || text.Contains("run")) { val.SetBool(val2.nameHash, running); } } } val.speed = (running ? Mathf.Clamp(intensity, 0.9f, 1.9f) : 1f); } internal static void KeepAnimatorAwake(PlayerAvatar avatar) { PlayerAvatarVisuals val = (((Object)(object)avatar != (Object)null) ? avatar.playerAvatarVisuals : null); Animator val2 = (((Object)(object)val != (Object)null) ? Get(VisualAnimatorField, val) : null); if ((Object)(object)val2 != (Object)null) { ((Behaviour)val2).enabled = true; val2.cullingMode = (AnimatorCullingMode)0; } } internal static string ApplyUpgrade(PlayerAvatar winner, int index) { if ((Object)(object)winner == (Object)null || (Object)(object)PunManager.instance == (Object)null) { return "Mystery Upgrade"; } string text = SteamIdMethod?.Invoke(null, new object[1] { winner }) as string; if (string.IsNullOrEmpty(text)) { return "Mystery Upgrade"; } int num = Mathf.Abs(index) % UpgradeMethods.Length; UpgradeMethods[num]?.Invoke(PunManager.instance, new object[2] { text, 1 }); SyncDictionariesMethod?.Invoke(PunManager.instance, null); return UpgradeNames[num]; } internal static string UpgradeName(int index) { return UpgradeNames[Mathf.Abs(index) % UpgradeNames.Length]; } internal static void KillLocalPlayer() { PlayerAvatar val = LocalAvatar(); PlayerHealth val2 = (PlayerHealth)(((Object)(object)val != (Object)null) ? /*isinst with value type is only supported in some contexts*/: null); if ((Object)(object)val2 != (Object)null) { HurtMethod?.Invoke(val2, new object[4] { 9999, false, -1, false }); } } internal static bool SpawnGameExplosion(Vector3 position) { //IL_002d: Unknown result type (might be due to invalid IL or missing references) ParticleScriptExplosion val = Object.FindObjectOfType(true); if ((Object)(object)val == (Object)null || ExplosionMethod == null) { return false; } ExplosionMethod.Invoke(val, new object[8] { position, 6f, 0, 0, 1f, true, false, 1.7f }); return true; } private static T Get(FieldInfo field, object instance) where T : class { if (!(field != null) || instance == null) { return null; } return field.GetValue(instance) as T; } private static bool GetBool(FieldInfo field, object instance) { object obj = ((field != null && instance != null) ? field.GetValue(instance) : null); bool flag = default(bool); int num; if (obj is bool) { flag = (bool)obj; num = 1; } else { num = 0; } return (byte)((uint)num & (flag ? 1u : 0u)) != 0; } private static int GetInt(FieldInfo field, object instance) { object obj = ((field != null && instance != null) ? field.GetValue(instance) : null); if (obj is int) { return (int)obj; } return 0; } private static void Set(FieldInfo field, object instance, object value) { if (field != null && instance != null) { field.SetValue(instance, value); } } } internal static class EmpressUmuAssets { private static readonly List Bundles = new List(); private static readonly List RacePrefabs = new List(); private static readonly Dictionary Clips = new Dictionary(StringComparer.OrdinalIgnoreCase); private static readonly string[] AuthenticAudio = new string[4] { "call_to_post", "gate_open", "race_music", "crowd_cheer" }; private static bool _loaded; private static bool _audioLoaded; internal static Texture2D TurfTexture { get; private set; } internal static Texture2D BaseTexture { get; private set; } internal static Texture2D TurfDetailTexture { get; private set; } internal static IReadOnlyList Prefabs => RacePrefabs; internal static AudioClip Clip(string name) { Clips.TryGetValue(name, out var value); return value; } internal static IEnumerator LoadAudio() { if (_audioLoaded) { yield break; } _audioLoaded = true; string directory = Path.Combine(EmpressUmuRacePlugin.PluginDirectory ?? string.Empty, "audio"); for (int i = 0; i < AuthenticAudio.Length; i++) { string name = AuthenticAudio[i]; string text = Path.Combine(directory, name + ".ogg"); if (!File.Exists(text)) { ManualLogSource log = EmpressUmuRacePlugin.Log; if (log != null) { log.LogError((object)("Authentic Uma audio is missing: " + name)); } continue; } string text2 = "file://" + text; UnityWebRequest request = UnityWebRequestMultimedia.GetAudioClip(text2, (AudioType)14); try { yield return request.SendWebRequest(); if ((int)request.result == 1) { AudioClip content = DownloadHandlerAudioClip.GetContent(request); if ((Object)(object)content != (Object)null) { ((Object)content).name = name; Clips[((Object)content).name] = content; } } else { ManualLogSource log2 = EmpressUmuRacePlugin.Log; if (log2 != null) { log2.LogError((object)("Authentic Uma audio failed to load: " + name + " - " + request.error)); } } } finally { ((IDisposable)request)?.Dispose(); } } ManualLogSource log3 = EmpressUmuRacePlugin.Log; if (log3 != null) { log3.LogInfo((object)("Empress UMU authentic audio loaded: " + Clips.Count + "/" + AuthenticAudio.Length + " clips.")); } } internal static void Load() { if (_loaded) { return; } _loaded = true; string path = Path.Combine(EmpressUmuRacePlugin.PluginDirectory ?? string.Empty, "AssetBundles", "uma"); if (!Directory.Exists(path)) { return; } string[] files = Directory.GetFiles(path); Array.Sort(files, (IComparer?)StringComparer.OrdinalIgnoreCase); for (int i = 0; i < files.Length; i++) { AssetBundle val = AssetBundle.LoadFromFile(files[i]); if ((Object)(object)val != (Object)null) { Bundles.Add(val); } } for (int j = 0; j < Bundles.Count; j++) { string[] allAssetNames = Bundles[j].GetAllAssetNames(); for (int k = 0; k < allAssetNames.Length; k++) { string text = allAssetNames[k].ToLowerInvariant(); if (text.Contains("tex_env_race10005_0000_412_turf00_sub")) { TurfDetailTexture = Bundles[j].LoadAsset(allAssetNames[k]); } else if (text.Contains("tex_env_race10005_0000_412_turf00")) { TurfTexture = Bundles[j].LoadAsset(allAssetNames[k]); } else if (text.Contains("tex_env_race10005_0000_412_base00")) { BaseTexture = Bundles[j].LoadAsset(allAssetNames[k]); } if (text.Contains("pfb_env_race10005_guest000_000") || text.Contains("pfb_env_race10005_prop000_000") || text.Contains("pfb_env_race10005_prop000_001") || text.Contains("pfb_env_race10005_tree001_100")) { GameObject val2 = Bundles[j].LoadAsset(allAssetNames[k]); if ((Object)(object)val2 != (Object)null && !RacePrefabs.Contains(val2)) { RacePrefabs.Add(val2); } } } } ManualLogSource log = EmpressUmuRacePlugin.Log; if (log != null) { log.LogInfo((object)("Empress UMU assets loaded: " + Bundles.Count + " bundles, " + RacePrefabs.Count + " Tokyo prefabs.")); } } } internal sealed class EmpressUmuGate : MonoBehaviour { private Quaternion _closed; private Quaternion _open; private bool _opening; internal void Configure(Quaternion open) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) _closed = ((Component)this).transform.localRotation; _open = open; } internal void Open() { _opening = true; } private void Update() { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) if (_opening) { ((Component)this).transform.localRotation = Quaternion.RotateTowards(((Component)this).transform.localRotation, _open, 240f * Time.deltaTime); if (Quaternion.Angle(((Component)this).transform.localRotation, _open) < 0.5f) { _opening = false; } } } } internal sealed class EmpressUmuCrowdBob : MonoBehaviour { private Vector3 _base; private float _phase; private float _amplitude; private void Start() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) _base = ((Component)this).transform.localPosition; _phase = _base.x * 1.7f + _base.z * 0.9f; _amplitude = 0.22f; } private void Update() { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) float num = Mathf.Abs(Mathf.Sin(Time.time * 3.4f + _phase)) * _amplitude; ((Component)this).transform.localPosition = _base + Vector3.up * num; } } internal sealed class EmpressUmuCourse { internal const float CenterRadiusX = 72f; internal const float CenterRadiusZ = 36f; internal const float TrackWidth = 16f; internal const float TrackY = 0.18f; internal const int Segments = 192; internal readonly List SpawnPositions = new List(); internal readonly List SpawnRotations = new List(); private readonly List _gates = new List(); private Text _scoreText; private readonly Transform _root; private readonly Material _trackMaterial; private readonly Material _grassMaterial; private readonly Material _whiteMaterial; private readonly Material _pinkMaterial; private readonly Material _darkMaterial; private readonly Material _goldMaterial; private EmpressUmuCourse(Transform root) { //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) _root = root; _trackMaterial = Material("Empress Uma Dirt", Color.white, (Texture)(object)CreateDirtTexture(), (Vector2?)new Vector2(24f, 6f)); _grassMaterial = Material("Empress Uma Turf", new Color(0.2f, 0.55f, 0.2f), (Texture)(object)EmpressUmuAssets.TurfTexture, (Vector2?)new Vector2(13f, 7f)); _whiteMaterial = Material("Empress Derby White", new Color(0.95f, 0.97f, 1f)); _pinkMaterial = Material("Empress Derby Pink", new Color(1f, 0.12f, 0.46f)); _darkMaterial = Material("Empress Derby Dark", new Color(0.045f, 0.055f, 0.085f)); _goldMaterial = Material("Empress Derby Gold", new Color(1f, 0.66f, 0.08f)); } internal static EmpressUmuCourse Build(Transform parent) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("Empress Tokyo Racecourse"); val.transform.SetParent(parent, false); EmpressUmuCourse empressUmuCourse = new EmpressUmuCourse(val.transform); empressUmuCourse.BuildGround(); empressUmuCourse.BuildRails(); empressUmuCourse.BuildLaneLines(); empressUmuCourse.BuildFinishLine(); empressUmuCourse.BuildGrandstands(); empressUmuCourse.BuildScoreboard(); empressUmuCourse.BuildCrowd(); empressUmuCourse.BuildUmaScenery(); empressUmuCourse.BuildDecor(); empressUmuCourse.BuildSpawns(); empressUmuCourse.BuildStalls(); return empressUmuCourse; } internal void OpenGates() { for (int i = 0; i < _gates.Count; i++) { if ((Object)(object)_gates[i] != (Object)null) { _gates[i].Open(); } } } internal void SetScoreboard(string text) { if ((Object)(object)_scoreText != (Object)null) { _scoreText.text = text; } } internal static void Evaluate(float progress, float laneOffset, out Vector3 position, out Vector3 tangent) { //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) float num = progress * MathF.PI * 2f - MathF.PI / 2f; float num2 = 72f + laneOffset; float num3 = 36f + laneOffset; position = new Vector3(Mathf.Cos(num) * num2, 0.24000001f, Mathf.Sin(num) * num3); Vector3 val = new Vector3((0f - Mathf.Sin(num)) * num2, 0f, Mathf.Cos(num) * num3); tangent = ((Vector3)(ref val)).normalized; } internal static float LaneOffset(int index, int count) { if (count <= 1) { return 0f; } return Mathf.Lerp(-5.76f, 5.76f, (float)index / (float)(count - 1)); } private void BuildGround() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) Primitive("Empress Stadium Foundation", (PrimitiveType)3, _root, Vector3.zero, new Vector3(260f, 1f, 180f), _grassMaterial).transform.position = new Vector3(0f, -0.55f, 0f); CreateDisc("Empress Turf Infield", 63.52f, 27.52f, 0.15f, _grassMaterial, collider: true); CreateRing("Empress Racing Surface", 64f, 28f, 80f, 44f, 0.18f, _trackMaterial, collider: true); CreateRing("Empress Outer Turf", 80f, 44f, 92f, 56f, 0.13000001f, _grassMaterial, collider: true); } private void BuildRails() { BuildRail(63.52f, 27.52f, 1.25f); BuildRail(80.479996f, 44.48f, 1.45f); } private void BuildRail(float rx, float rz, float height) { //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) Vector3 val = default(Vector3); Vector3 val2 = default(Vector3); for (int i = 0; i < 96; i++) { float num = (float)i * MathF.PI * 2f / 96f; float num2 = (float)(i + 1) * MathF.PI * 2f / 96f; ((Vector3)(ref val))..ctor(Mathf.Cos(num) * rx, 0.18f + height, Mathf.Sin(num) * rz); ((Vector3)(ref val2))..ctor(Mathf.Cos(num2) * rx, 0.18f + height, Mathf.Sin(num2) * rz); Vector3 position = (val + val2) * 0.5f; Transform transform = Primitive("Empress Race Rail", (PrimitiveType)3, _root, position, new Vector3(0.13f, 0.13f, Vector3.Distance(val, val2) + 0.15f), _whiteMaterial).transform; Vector3 val3 = val2 - val; transform.rotation = Quaternion.LookRotation(((Vector3)(ref val3)).normalized, Vector3.up); if ((i & 1) == 0) { Primitive("Empress Rail Post", (PrimitiveType)2, _root, new Vector3(val.x, 0.18f + height * 0.5f, val.z), new Vector3(0.15f, height * 0.5f, 0.15f), _whiteMaterial); } } } private void BuildLaneLines() { //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) Vector3 val = default(Vector3); Vector3 val2 = default(Vector3); for (int i = 1; i < 8; i++) { float num = Mathf.Lerp(-8f, 8f, (float)i / 8f); float num2 = 72f + num; float num3 = 36f + num * 0.55f; for (int j = 0; j < 96; j += 2) { float num4 = (float)j * MathF.PI * 2f / 96f; float num5 = (float)(j + 1) * MathF.PI * 2f / 96f; ((Vector3)(ref val))..ctor(Mathf.Cos(num4) * num2, 0.23500001f, Mathf.Sin(num4) * num3); ((Vector3)(ref val2))..ctor(Mathf.Cos(num5) * num2, 0.23500001f, Mathf.Sin(num5) * num3); Transform transform = Primitive("Empress Lane Dash", (PrimitiveType)3, _root, (val + val2) * 0.5f, new Vector3(0.055f, 0.025f, Vector3.Distance(val, val2) * 0.72f), _whiteMaterial, collider: false).transform; Vector3 val3 = val2 - val; transform.rotation = Quaternion.LookRotation(((Vector3)(ref val3)).normalized, Vector3.up); } } } private void BuildFinishLine() { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_018a: Unknown result type (might be due to invalid IL or missing references) //IL_01a8: Unknown result type (might be due to invalid IL or missing references) //IL_01b8: Unknown result type (might be due to invalid IL or missing references) //IL_01bd: Unknown result type (might be due to invalid IL or missing references) //IL_01d1: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(0f, 0.18f, -36f); for (int i = 0; i < 14; i++) { float num = val.z - 8f + (float)i * 1.2307693f; Material material = ((i % 2 == 0) ? _darkMaterial : _whiteMaterial); Primitive("Empress Finish Check", (PrimitiveType)3, _root, new Vector3(0f, 0.27f, num), new Vector3(0.62f, 0.03f, 1.2307693f), material, collider: false); } Primitive("Empress Finish Pink", (PrimitiveType)3, _root, val + Vector3.up * 0.16f, new Vector3(0.17f, 0.025f, 17f), _pinkMaterial, collider: false); Primitive("Empress Finish Inner", (PrimitiveType)3, _root, val + new Vector3(0f, 4.5f, -9.92f), new Vector3(0.7f, 9f, 0.7f), _pinkMaterial); Primitive("Empress Finish Outer", (PrimitiveType)3, _root, val + new Vector3(0f, 4.5f, 9.92f), new Vector3(0.7f, 9f, 0.7f), _pinkMaterial); Primitive("Empress Finish Header", (PrimitiveType)3, _root, val + new Vector3(0f, 8.4f, 0f), new Vector3(0.85f, 1.25f, 21.6f), _darkMaterial); Primitive("Empress Finish Banner", (PrimitiveType)3, _root, val + new Vector3(0f, 7.1f, 0f), new Vector3(0.3f, 1.4f, 19.2f), _goldMaterial, collider: false); } private void BuildStalls() { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Expected O, but got Unknown //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Expected O, but got Unknown //IL_0191: Unknown result type (might be due to invalid IL or missing references) //IL_01a1: Unknown result type (might be due to invalid IL or missing references) //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01da: Unknown result type (might be due to invalid IL or missing references) //IL_0214: Unknown result type (might be due to invalid IL or missing references) //IL_0228: Unknown result type (might be due to invalid IL or missing references) //IL_025a: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < SpawnPositions.Count; i++) { GameObject val = new GameObject("Empress Starting Stall " + (i + 1)); val.transform.SetParent(_root, false); val.transform.position = SpawnPositions[i]; val.transform.rotation = SpawnRotations[i]; StallPart(val.transform, "Left Wall", new Vector3(-0.85f, 1.15f, -0.2f), new Vector3(0.1f, 2.3f, 2.2f), _darkMaterial); StallPart(val.transform, "Right Wall", new Vector3(0.85f, 1.15f, -0.2f), new Vector3(0.1f, 2.3f, 2.2f), _darkMaterial); StallPart(val.transform, "Back Wall", new Vector3(0f, 1.15f, -1.35f), new Vector3(1.7f, 2.3f, 0.12f), _darkMaterial); StallPart(val.transform, "Roof", new Vector3(0f, 2.55f, -0.2f), new Vector3(1.8f, 0.12f, 2.35f), _darkMaterial); GameObject val2 = new GameObject("Empress Stall Gate"); val2.transform.SetParent(val.transform, false); val2.transform.localPosition = new Vector3(0f, 2.3f, 1.02f); val2.transform.localRotation = Quaternion.identity; StallPart(val2.transform, "Gate Panel", new Vector3(0f, -1f, 0f), new Vector3(1.6f, 2f, 0.08f), _darkMaterial); for (int j = 0; j < 3; j++) { StallPart(val2.transform, "Gate Bar", new Vector3(0f, -0.5f - (float)j * 0.55f, 0.18f), new Vector3(1.64f, 0.09f, 0.06f), _pinkMaterial); } EmpressUmuGate empressUmuGate = val2.AddComponent(); empressUmuGate.Configure(Quaternion.Euler(-88f, 0f, 0f)); _gates.Add(empressUmuGate); } } private void StallPart(Transform parent, string name, Vector3 localPosition, Vector3 scale, Material material) { //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) GameObject obj = GameObject.CreatePrimitive((PrimitiveType)3); ((Object)obj).name = "Empress " + name; Collider component = obj.GetComponent(); if ((Object)(object)component != (Object)null) { Object.Destroy((Object)(object)component); } obj.transform.SetParent(parent, false); obj.transform.localPosition = localPosition; obj.transform.localScale = scale; obj.GetComponent().sharedMaterial = material; } private void BuildGrandstands() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) BuildGrandstand(new Vector3(0f, 0f, 67f), Quaternion.identity, 118f); BuildGrandstand(new Vector3(0f, 0f, -70f), Quaternion.Euler(0f, 180f, 0f), 104f); Primitive("Empress Stadium Tower", (PrimitiveType)3, _root, new Vector3(-103f, 14f, 5f), new Vector3(20f, 28f, 32f), _darkMaterial); for (int i = 0; i < 5; i++) { Primitive("Empress Tower Glass", (PrimitiveType)3, _root, new Vector3(-92.8f, 5f + (float)i * 4.6f, 5f), new Vector3(0.25f, 2.8f, 27f), (i % 2 == 0) ? _pinkMaterial : _goldMaterial, collider: false); } } private void BuildGrandstand(Vector3 origin, Quaternion rotation, float width) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("Empress Tokyo Grandstand"); val.transform.SetParent(_root, false); val.transform.position = origin; val.transform.rotation = rotation; for (int i = 0; i < 8; i++) { Primitive("Empress Stand Tier", (PrimitiveType)3, val.transform, new Vector3(0f, (float)i * 1.05f + 0.5f, (float)i * 1.35f), new Vector3(width, 1f, 2.7f), (i % 2 == 0) ? _whiteMaterial : _darkMaterial).transform.localPosition = new Vector3(0f, (float)i * 1.05f + 0.5f, (float)i * 1.35f); } Primitive("Empress Stand Roof", (PrimitiveType)3, val.transform, new Vector3(0f, 13.5f, 8f), new Vector3(width + 8f, 0.8f, 18f), _darkMaterial).transform.localPosition = new Vector3(0f, 13.5f, 8f); for (int j = -2; j <= 2; j++) { Primitive("Empress Roof Post", (PrimitiveType)3, val.transform, Vector3.zero, new Vector3(0.6f, 13f, 0.6f), _pinkMaterial).transform.localPosition = new Vector3((float)j * width * 0.2f, 6.5f, 1f); } } private void BuildScoreboard() { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Expected O, but got Unknown //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Expected O, but got Unknown //IL_026a: Unknown result type (might be due to invalid IL or missing references) //IL_0280: Unknown result type (might be due to invalid IL or missing references) //IL_028b: Unknown result type (might be due to invalid IL or missing references) //IL_02a0: Unknown result type (might be due to invalid IL or missing references) //IL_02b4: Unknown result type (might be due to invalid IL or missing references) Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(0f, 10f, 5f); Primitive("Empress Infield Scoreboard", (PrimitiveType)3, _root, val, new Vector3(28f, 14f, 1.3f), _darkMaterial); Primitive("Empress Scoreboard Frame", (PrimitiveType)3, _root, val + new Vector3(0f, 0f, -0.72f), new Vector3(30f, 15.5f, 0.3f), _pinkMaterial, collider: false); Primitive("Empress Scoreboard Screen", (PrimitiveType)3, _root, val + new Vector3(0f, 0f, -0.95f), new Vector3(26.5f, 11.5f, 0.2f), _darkMaterial, collider: false); GameObject val2 = new GameObject("Empress Scoreboard Canvas"); val2.transform.SetParent(_root, false); val2.transform.position = val + new Vector3(0f, 0.4f, -1.15f); val2.transform.rotation = Quaternion.Euler(0f, 0f, 0f); val2.transform.localScale = Vector3.one * 0.02f; Canvas obj = val2.AddComponent(); obj.renderMode = (RenderMode)2; ((Component)obj).GetComponent().sizeDelta = new Vector2(1200f, 520f); GameObject val3 = new GameObject("Empress Scoreboard Text"); val3.transform.SetParent(val2.transform, false); _scoreText = val3.AddComponent(); Font val4 = Resources.GetBuiltinResource("LegacyRuntime.ttf") ?? Resources.GetBuiltinResource("Arial.ttf"); if ((Object)(object)val4 == (Object)null) { Font[] array = Resources.FindObjectsOfTypeAll(); for (int i = 0; i < array.Length; i++) { if ((Object)(object)array[i] != (Object)null && array[i].dynamic) { val4 = array[i]; break; } } if ((Object)(object)val4 == (Object)null && array.Length != 0) { val4 = array[0]; } } _scoreText.font = val4; _scoreText.fontSize = 54; _scoreText.fontStyle = (FontStyle)1; _scoreText.alignment = (TextAnchor)1; _scoreText.horizontalOverflow = (HorizontalWrapMode)1; _scoreText.verticalOverflow = (VerticalWrapMode)1; ((Graphic)_scoreText).color = new Color(0.4f, 1f, 0.55f); RectTransform rectTransform = ((Graphic)_scoreText).rectTransform; rectTransform.anchorMin = Vector2.zero; rectTransform.anchorMax = Vector2.one; rectTransform.offsetMin = new Vector2(30f, 20f); rectTransform.offsetMax = new Vector2(-30f, -20f); _scoreText.text = "- EMPRESS UMU DERBY -"; } private void BuildDecor() { //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01a0: Unknown result type (might be due to invalid IL or missing references) //IL_01aa: Unknown result type (might be due to invalid IL or missing references) //IL_01af: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_0232: Unknown result type (might be due to invalid IL or missing references) //IL_0243: Unknown result type (might be due to invalid IL or missing references) //IL_0261: Unknown result type (might be due to invalid IL or missing references) //IL_0272: Unknown result type (might be due to invalid IL or missing references) //IL_0277: Unknown result type (might be due to invalid IL or missing references) //IL_028b: Unknown result type (might be due to invalid IL or missing references) Material[] array = (Material[])(object)new Material[3] { _pinkMaterial, _goldMaterial, _whiteMaterial }; Vector3 position = default(Vector3); for (int i = 0; i < 120; i++) { float num = (float)i / 120f * MathF.PI * 2f; float num2 = 61.920002f; float num3 = 25.92f; ((Vector3)(ref position))..ctor(Mathf.Cos(num) * num2, 0.43f, Mathf.Sin(num) * num3); Primitive("Empress Flower Bed", (PrimitiveType)0, _root, position, new Vector3(0.9f, 0.5f, 0.9f), array[i % array.Length], collider: false); } Vector3 position2 = default(Vector3); for (int j = 0; j < 72; j++) { float num4 = (float)j / 72f * MathF.PI * 2f; float num5 = 83.2f; float num6 = 47.2f; ((Vector3)(ref position2))..ctor(Mathf.Cos(num4) * num5, 0.73f, Mathf.Sin(num4) * num6); Primitive("Empress Hedge", (PrimitiveType)3, _root, position2, new Vector3(2.4f, 1.1f, 1.1f), _grassMaterial, collider: false); } for (int k = 1; k <= 6; k++) { Evaluate((float)k / 8f, 10f, out var position3, out var tangent); position3.y = 1.28f; Primitive("Empress Distance Board", (PrimitiveType)3, _root, position3, new Vector3(1.4f, 2.2f, 0.18f), _whiteMaterial, collider: false).transform.rotation = Quaternion.LookRotation(tangent, Vector3.up); Primitive("Empress Distance Marker", (PrimitiveType)3, _root, position3 + Vector3.up * 0.4f, new Vector3(0.9f, 0.6f, 0.24f), (k % 2 == 0) ? _pinkMaterial : _goldMaterial, collider: false); } Vector3 val = default(Vector3); for (int l = 0; l < 16; l++) { float num7 = Mathf.Lerp(-55f, 55f, (float)l / 15f); ((Vector3)(ref val))..ctor(num7, 15.5f, 67f); Primitive("Empress Flag Pole", (PrimitiveType)2, _root, val, new Vector3(0.12f, 1.6f, 0.12f), _whiteMaterial, collider: false); Primitive("Empress Flag", (PrimitiveType)3, _root, val + new Vector3(0.6f, 0.9f, 0f), new Vector3(1.1f, 0.7f, 0.06f), (l % 2 == 0) ? _pinkMaterial : _goldMaterial, collider: false); } } private void BuildCrowd() { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Unknown result type (might be due to invalid IL or missing references) Color[] array = (Color[])(object)new Color[5] { new Color(1f, 0.2f, 0.48f), new Color(0.2f, 0.75f, 1f), new Color(1f, 0.82f, 0.1f), new Color(0.58f, 0.3f, 1f), Color.white }; Material[] array2 = (Material[])(object)new Material[array.Length]; for (int i = 0; i < array.Length; i++) { array2[i] = Material("Empress Crowd " + i, array[i]); } Random random = new Random(10005); for (int j = -1; j <= 1; j += 2) { for (int k = 0; k < 130; k++) { float num = Mathf.Lerp(-52f, 52f, (float)random.NextDouble()); int num2 = random.Next(0, 8); float num3 = ((j > 0) ? (66f + (float)num2 * 1.35f) : (-69f - (float)num2 * 1.35f)); float num4 = 1.5f + (float)num2 * 1.05f; GameObject obj = Primitive("Empress Race Fan", (PrimitiveType)0, _root, new Vector3(num, num4, num3), new Vector3(0.42f, 0.55f, 0.42f), array2[random.Next(array2.Length)], collider: false); obj.transform.rotation = Quaternion.Euler(0f, (float)random.Next(0, 360), 0f); obj.AddComponent(); } } } private void BuildUmaScenery() { //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) IReadOnlyList prefabs = EmpressUmuAssets.Prefabs; for (int i = 0; i < prefabs.Count; i++) { GameObject val = prefabs[i]; if ((Object)(object)val == (Object)null) { continue; } string text = ((Object)val).name.ToLowerInvariant(); if (text.Contains("guest") || text.Contains("prop")) { GameObject obj = Object.Instantiate(val, _root, false); ((Object)obj).name = "Empress Authentic Tokyo " + ((Object)val).name; obj.transform.localPosition = Vector3.zero; obj.SetActive(true); PrepareImported(obj); } else if (text.Contains("tree")) { Vector3[] array = (Vector3[])(object)new Vector3[4] { new Vector3(-91f, 0f, 47f), new Vector3(91f, 0f, 48f), new Vector3(-94f, 0f, -45f), new Vector3(94f, 0f, -44f) }; for (int j = 0; j < array.Length; j++) { GameObject obj2 = Object.Instantiate(val, _root, false); ((Object)obj2).name = "Empress Authentic Tokyo Tree"; obj2.transform.localPosition = array[j]; obj2.transform.localRotation = Quaternion.Euler(0f, (float)j * 73f, 0f); obj2.SetActive(true); PrepareImported(obj2); } } } } private static void PrepareImported(GameObject instance) { //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Expected O, but got Unknown //IL_00ca: Unknown result type (might be due to invalid IL or missing references) Collider[] componentsInChildren = instance.GetComponentsInChildren(true); for (int i = 0; i < componentsInChildren.Length; i++) { componentsInChildren[i].enabled = false; } Renderer[] componentsInChildren2 = instance.GetComponentsInChildren(true); Shader val = Shader.Find("Standard"); for (int j = 0; j < componentsInChildren2.Length; j++) { Material[] materials = componentsInChildren2[j].materials; for (int k = 0; k < materials.Length; k++) { Material val2 = materials[k]; if ((Object)(object)val2 == (Object)null || (Object)(object)val2.shader == (Object)null || !val2.shader.isSupported || ((Object)val2.shader).name == "Hidden/InternalErrorShader") { Texture mainTexture = (((Object)(object)val2 != (Object)null) ? val2.mainTexture : null); Color color = (((Object)(object)val2 != (Object)null && val2.HasProperty("_Color")) ? val2.color : Color.white); Material val3 = new Material(val) { mainTexture = mainTexture, color = color }; materials[k] = val3; } } componentsInChildren2[j].materials = materials; } } private void BuildSpawns() { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < 12; i++) { float laneOffset = LaneOffset(i, 12); Evaluate(0f, laneOffset, out var position, out var tangent); position -= tangent * 2.8f; SpawnPositions.Add(position); SpawnRotations.Add(Quaternion.LookRotation(tangent, Vector3.up)); } } private static Texture2D CreateDirtTexture() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Expected O, but got Unknown //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) Texture2D val = new Texture2D(128, 128, (TextureFormat)3, true) { name = "Empress Uma Dirt Texture", wrapMode = (TextureWrapMode)0, filterMode = (FilterMode)1 }; Color[] array = (Color[])(object)new Color[16384]; Random random = new Random(10005); for (int i = 0; i < 128; i++) { for (int j = 0; j < 128; j++) { float num = (float)random.NextDouble() * 0.13f; float num2 = Mathf.Sin((float)j * 0.38f) * 0.025f + Mathf.Sin((float)j * 0.09f) * 0.018f; float num3 = 0.78f + num + num2; array[i * 128 + j] = new Color(0.55f * num3, 0.37f * num3, 0.22f * num3, 1f); } } val.SetPixels(array); val.Apply(true, false); return val; } private void CreateRing(string name, float innerX, float innerZ, float outerX, float outerZ, float y, Material material, bool collider) { //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) Vector3[] array = (Vector3[])(object)new Vector3[386]; Vector2[] array2 = (Vector2[])(object)new Vector2[array.Length]; int[] array3 = new int[1152]; for (int i = 0; i <= 192; i++) { float num = (float)i / 192f; float num2 = num * MathF.PI * 2f; array[i * 2] = new Vector3(Mathf.Cos(num2) * innerX, y, Mathf.Sin(num2) * innerZ); array[i * 2 + 1] = new Vector3(Mathf.Cos(num2) * outerX, y, Mathf.Sin(num2) * outerZ); array2[i * 2] = new Vector2(num * 18f, 0f); array2[i * 2 + 1] = new Vector2(num * 18f, 5f); if (i < 192) { int num3 = i * 6; int num4 = (array3[num3] = i * 2); array3[num3 + 1] = num4 + 3; array3[num3 + 2] = num4 + 1; array3[num3 + 3] = num4; array3[num3 + 4] = num4 + 2; array3[num3 + 5] = num4 + 3; } } CreateMeshObject(name, array, array3, array2, material, collider); } private void CreateDisc(string name, float rx, float rz, float y, Material material, bool collider) { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) Vector3[] array = (Vector3[])(object)new Vector3[193]; Vector2[] array2 = (Vector2[])(object)new Vector2[array.Length]; int[] array3 = new int[576]; array[0] = new Vector3(0f, y, 0f); array2[0] = new Vector2(0.5f, 0.5f); for (int i = 0; i < 192; i++) { float num = (float)i * MathF.PI * 2f / 192f; array[i + 1] = new Vector3(Mathf.Cos(num) * rx, y, Mathf.Sin(num) * rz); array2[i + 1] = new Vector2(Mathf.Cos(num) * 0.5f + 0.5f, Mathf.Sin(num) * 0.5f + 0.5f) * 8f; int num2 = i * 3; array3[num2] = 0; array3[num2 + 1] = (i + 1) % 192 + 1; array3[num2 + 2] = i + 1; } CreateMeshObject(name, array, array3, array2, material, collider); } private void CreateMeshObject(string name, Vector3[] vertices, int[] triangles, Vector2[] uv, Material material, bool collider) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Expected O, but got Unknown GameObject val = new GameObject(name); val.transform.SetParent(_root, false); Mesh val2 = new Mesh { name = name + " Mesh" }; val2.vertices = vertices; val2.triangles = triangles; val2.uv = uv; val2.RecalculateNormals(); val2.RecalculateBounds(); val.AddComponent().sharedMesh = val2; ((Renderer)val.AddComponent()).sharedMaterial = material; if (collider) { val.AddComponent().sharedMesh = val2; } } private static GameObject Primitive(string name, PrimitiveType type, Transform parent, Vector3 position, Vector3 scale, Material material, bool collider = true) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) GameObject val = GameObject.CreatePrimitive(type); ((Object)val).name = name; val.transform.SetParent(parent, true); val.transform.position = position; val.transform.localScale = scale; val.GetComponent().sharedMaterial = material; if (!collider) { Collider component = val.GetComponent(); if ((Object)(object)component != (Object)null) { Object.Destroy((Object)(object)component); } } return val; } private static Material Material(string name, Color color, Texture texture = null, Vector2? scale = null) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Expected O, but got Unknown //IL_0031: Unknown result type (might be due to invalid IL or missing references) Material val = new Material(Shader.Find("Standard")) { name = name, color = color, mainTexture = texture }; if (scale.HasValue) { val.mainTextureScale = scale.Value; } val.SetFloat("_Glossiness", 0.18f); return val; } } internal static class EmpressUmuLevelRegistry { private static readonly FieldRef LevelRef = AccessTools.FieldRefAccess("_level"); private static readonly FieldRef> StartRoomsRef = AccessTools.FieldRefAccess>("_startRooms"); private static readonly string[] ModuleFields = new string[12] { "_modulesNormal1", "_modulesNormal2", "_modulesNormal3", "_modulesPassage1", "_modulesPassage2", "_modulesPassage3", "_modulesDeadEnd1", "_modulesDeadEnd2", "_modulesDeadEnd3", "_modulesExtraction1", "_modulesExtraction2", "_modulesExtraction3" }; internal static Level RegisterLevel() { //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_0194: Unknown result type (might be due to invalid IL or missing references) Level val = ScriptableObject.CreateInstance(); ((Object)val).name = "Level - Empress UMU Race"; val.NarrativeName = "Empress UMU Derby"; LevelValuables val2 = ScriptableObject.CreateInstance(); ((Object)val2).name = "Valuables - Empress UMU Race"; val2.tiny = new List(); val2.small = new List(); val2.medium = new List(); val2.big = new List(); val2.wide = new List(); val2.tall = new List(); val2.veryTall = new List(); SetLevelField(val, "ModuleAmount", 0); SetLevelField(val, "PassageMaxAmount", 0); SetLevelField(val, "HasEnemies", false); SetLevelField(val, "ValuablePresets", new List { val2 }); SetLevelField(val, "AmbiencePresets", new List()); SetLevelField(val, "FogColor", (object)new Color(0.58f, 0.72f, 0.88f)); SetLevelField(val, "FogStartDistance", 180f); SetLevelField(val, "FogEndDistance", 650f); SetLevelField(val, "AmbientColor", (object)new Color(0.74f, 0.78f, 0.82f)); SetLevelField(val, "AmbientColorAdaptation", (object)new Color(0.68f, 0.72f, 0.78f)); SetLevelField(val, "ColorTemperature", 4f); SetLevelField(val, "ColorFilter", (object)new Color(1f, 0.98f, 0.94f)); SetLevelField(val, "BloomIntensity", 0.55f); SetLevelField(val, "BloomThreshold", 1.1f); SetLevelField(val, "VignetteIntensity", 0.16f); SetLevelField(val, "VignetteSmoothness", 0.72f); SetLevelField(val, "DiscordIcon", "level"); EnsureLevelFieldInstance(val, "LoadingGraphic01"); EnsureLevelFieldInstance(val, "LoadingGraphic02"); EnsureLevelFieldInstance(val, "LoadingGraphic03"); EnsureLevelFieldInstance(val, "ConnectObject"); EnsureLevelFieldInstance(val, "BlockObject"); LevelContent val3 = ScriptableObject.CreateInstance(); ((Object)val3).name = "Empress UMU Race Content"; LevelRef.Invoke(val3) = val; StartRoomsRef.Invoke(val3) = new List(); for (int i = 0; i < ModuleFields.Length; i++) { AccessTools.Field(typeof(LevelContent), ModuleFields[i])?.SetValue(val3, new List()); } AccessTools.Field(typeof(LevelContent), "_connectObject")?.SetValue(val3, null); AccessTools.Field(typeof(LevelContent), "_blockObject")?.SetValue(val3, null); Levels.RegisterLevel(val3); return val; } private static void SetLevelField(Level level, string fieldName, object value) { FieldInfo fieldInfo = AccessTools.Field(typeof(Level), fieldName); if (fieldInfo != null && value != null && fieldInfo.FieldType.IsInstanceOfType(value)) { fieldInfo.SetValue(level, value); } } private static void EnsureLevelFieldInstance(Level level, string fieldName) { FieldInfo fieldInfo = AccessTools.Field(typeof(Level), fieldName); if (!(fieldInfo == null) && fieldInfo.FieldType.IsClass && !(fieldInfo.FieldType == typeof(string)) && fieldInfo.GetValue(level) == null) { fieldInfo.SetValue(level, FormatterServices.GetUninitializedObject(fieldInfo.FieldType)); } } } [HarmonyPatch(typeof(RunManager), "SetRunLevel")] internal static class EmpressUmuPatchSetRunLevel { private static void Postfix(RunManager __instance) { if (EmpressUmuRacePlugin.Settings != null && EmpressUmuRacePlugin.Settings.ForceLevel.Value && (Object)(object)EmpressUmuRacePlugin.RaceLevel != (Object)null) { __instance.levelCurrent = EmpressUmuRacePlugin.RaceLevel; } } } [HarmonyPatch(typeof(LevelGenerator), "Generate")] internal static class EmpressUmuPatchGenerate { private static bool Prefix(LevelGenerator __instance, ref IEnumerator __result) { if (!EmpressUmuRacePlugin.IsRaceLevel(Object.op_Implicit((Object)(object)RunManager.instance) ? RunManager.instance.levelCurrent : null)) { return true; } __result = EmpressUmuRaceRuntime.EnsureHost().GenerateLevel(__instance); return false; } } [HarmonyPatch(typeof(LevelPoint), "NavMeshCheck")] internal static class EmpressUmuPatchNavMesh { private static bool Prefix(ref IEnumerator __result) { if (!EmpressUmuRacePlugin.IsRaceLevel(Object.op_Implicit((Object)(object)RunManager.instance) ? RunManager.instance.levelCurrent : null)) { return true; } __result = EmpressUmuRaceRuntime.EmptyCoroutine(); return false; } } [HarmonyPatch(typeof(EnvironmentDirector), "Setup")] internal static class EmpressUmuPatchEnvironment { private static bool Prefix(EnvironmentDirector __instance) { //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) if (!EmpressUmuRacePlugin.IsRaceLevel(Object.op_Implicit((Object)(object)LevelGenerator.Instance) ? LevelGenerator.Instance.Level : null)) { return true; } Color val = default(Color); ((Color)(ref val))..ctor(0.58f, 0.72f, 0.88f); Color val2 = default(Color); ((Color)(ref val2))..ctor(0.74f, 0.78f, 0.82f); EmpressUmuAccess.ConfigureEnvironment(__instance, val, val2, 180f, 650f); RenderSettings.fog = true; RenderSettings.fogMode = (FogMode)1; RenderSettings.fogColor = val; RenderSettings.fogStartDistance = 180f; RenderSettings.fogEndDistance = 650f; RenderSettings.ambientLight = val2; RenderSettings.ambientMode = (AmbientMode)3; Camera val3 = (((Object)(object)GameDirector.instance != (Object)null) ? GameDirector.instance.MainCamera : Camera.main); if ((Object)(object)val3 != (Object)null) { val3.clearFlags = (CameraClearFlags)2; val3.backgroundColor = val; val3.farClipPlane = 900f; } return false; } } [HarmonyPatch(typeof(LoadingUI), "LevelAnimationStart")] internal static class EmpressUmuPatchLoading { private static void Postfix(LoadingUI __instance) { //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) if (EmpressUmuRacePlugin.IsRaceLevel(Object.op_Implicit((Object)(object)LevelGenerator.Instance) ? LevelGenerator.Instance.Level : null)) { if ((Object)(object)__instance.levelNumberText != (Object)null) { ((TMP_Text)__instance.levelNumberText).text = "TOKYO RACECOURSE"; ((Graphic)__instance.levelNumberText).color = new Color(1f, 0.38f, 0.58f); } if ((Object)(object)__instance.levelNameText != (Object)null) { ((TMP_Text)__instance.levelNameText).text = "Empress UMU Derby"; ((Graphic)__instance.levelNameText).color = Color.white; } } } } [HarmonyPatch(typeof(LightManager), "HandleLightActivation")] internal static class EmpressUmuPatchLights { private static bool Prefix() { return !EmpressUmuRacePlugin.IsRaceLevel(Object.op_Implicit((Object)(object)RunManager.instance) ? RunManager.instance.levelCurrent : null); } } [HarmonyPatch(typeof(PlayerAvatarVisuals), "ApplyLocalVisibility")] internal static class EmpressUmuPatchLocalVisibility { private static void Prefix(PlayerAvatarVisuals __instance, ref ShadowCastingMode __0) { EmpressUmuRaceRuntime instance = EmpressUmuRaceRuntime.Instance; if ((Object)(object)instance != (Object)null && instance.Active && EmpressUmuAccess.IsLocalVisuals(__instance)) { __0 = (ShadowCastingMode)1; } } } [HarmonyPatch(typeof(PlayerAvatarVisuals), "Update")] internal static class EmpressUmuPatchRunnerAnimation { private static void Prefix(PlayerAvatarVisuals __instance) { EmpressUmuRaceRuntime instance = EmpressUmuRaceRuntime.Instance; if ((Object)(object)instance != (Object)null && instance.Active) { instance.PrepareRunnerAnimation(__instance); } } private static void Postfix(PlayerAvatarVisuals __instance) { EmpressUmuRaceRuntime instance = EmpressUmuRaceRuntime.Instance; if ((Object)(object)instance != (Object)null && instance.Active) { instance.FinalizeRunnerAnimation(__instance); } } } [HarmonyPatch(typeof(PlayerAvatarVisuals), "AnimationLogic")] internal static class EmpressUmuPatchAnimationLogic { private static void Postfix(PlayerAvatarVisuals __instance) { EmpressUmuRaceRuntime instance = EmpressUmuRaceRuntime.Instance; if ((Object)(object)instance != (Object)null && instance.Active) { instance.FinalizeRunnerAnimation(__instance); } } } [HarmonyPatch(typeof(PlayerAvatarVisuals), "ApplyLocalVisibilityBody")] internal static class EmpressUmuPatchLocalVisibilityBody { private static void Prefix(PlayerAvatarVisuals __instance) { EmpressUmuRaceRuntime instance = EmpressUmuRaceRuntime.Instance; if ((Object)(object)instance != (Object)null && instance.Active && EmpressUmuAccess.IsLocalVisuals(__instance)) { EmpressUmuAccess.SetVisualVisibility(__instance, (ShadowCastingMode)1, apply: false); } } } [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInPlugin("com.empress.repo.umurace", "Empress UMU Race", "1.0.4")] public sealed class EmpressUmuRacePlugin : BaseUnityPlugin { public const string PluginGuid = "com.empress.repo.umurace"; public const string PluginName = "Empress UMU Race"; public const string PluginVersion = "1.0.4"; public const string LevelName = "Level - Empress UMU Race"; public const string DisplayName = "Empress UMU Derby"; internal const byte RaceStartEventCode = 197; internal const byte RaceFinishEventCode = 198; private static bool _photonHooked; private static LoadBalancingClient _hookedClient; private Harmony _harmony; internal static EmpressUmuRacePlugin Instance { get; private set; } internal static ManualLogSource Log { get; private set; } internal static EmpressUmuRaceSettings Settings { get; private set; } internal static Level RaceLevel { get; private set; } internal static string PluginDirectory { get; private set; } private void Awake() { //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected O, but got Unknown Instance = this; Log = ((BaseUnityPlugin)this).Logger; PluginDirectory = Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location); Settings = new EmpressUmuRaceSettings(((BaseUnityPlugin)this).Config); ((Component)this).gameObject.transform.parent = null; ((Object)((Component)this).gameObject).hideFlags = (HideFlags)61; Object.DontDestroyOnLoad((Object)(object)((Component)this).gameObject); RaceLevel = EmpressUmuLevelRegistry.RegisterLevel(); _harmony = new Harmony("com.empress.repo.umurace"); _harmony.PatchAll(typeof(EmpressUmuRacePlugin).Assembly); EmpressUmuRaceRuntime.EnsureHost(); ((BaseUnityPlugin)this).Logger.LogInfo((object)"Empress UMU Race v1.0.4 loaded. Level registered: Level - Empress UMU Race"); } private void OnDestroy() { RemovePhotonHook(); } internal static bool IsRaceLevel(Level level) { if ((Object)(object)level != (Object)null) { return ((Object)level).name == "Level - Empress UMU Race"; } return false; } internal static void EnsurePhotonHooked() { if (!PhotonNetwork.InRoom) { return; } LoadBalancingClient networkingClient = PhotonNetwork.NetworkingClient; if (networkingClient != null && (!_photonHooked || _hookedClient != networkingClient)) { if (_hookedClient != null) { _hookedClient.EventReceived -= OnPhotonEvent; } networkingClient.EventReceived -= OnPhotonEvent; networkingClient.EventReceived += OnPhotonEvent; _hookedClient = networkingClient; _photonHooked = true; } } internal static void RemovePhotonHook() { if (_photonHooked) { if (_hookedClient != null) { _hookedClient.EventReceived -= OnPhotonEvent; } _hookedClient = null; _photonHooked = false; } } private static void OnPhotonEvent(EventData ev) { if (!(ev.CustomData is object[] data)) { return; } EmpressUmuRaceRuntime instance = EmpressUmuRaceRuntime.Instance; if (!((Object)(object)instance == (Object)null)) { if (ev.Code == 197) { instance.ReceiveRaceStart(data); } else if (ev.Code == 198) { instance.ReceiveRaceFinish(data); } } } internal static void RaiseToAll(byte code, object[] data) { //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Expected O, but got Unknown //IL_004e: Unknown result type (might be due to invalid IL or missing references) EnsurePhotonHooked(); if (!PhotonNetwork.InRoom) { switch (code) { case 197: EmpressUmuRaceRuntime.Instance?.ReceiveRaceStart(data); break; case 198: EmpressUmuRaceRuntime.Instance?.ReceiveRaceFinish(data); break; } } else { RaiseEventOptions val = new RaiseEventOptions { Receivers = (ReceiverGroup)1 }; PhotonNetwork.RaiseEvent(code, (object)data, val, SendOptions.SendReliable); } } } internal sealed class EmpressUmuRaceSettings { public readonly ConfigEntry ForceLevel; public readonly ConfigEntry Countdown; public readonly ConfigEntry ExitDelay; public readonly ConfigEntry DebugLogs; public EmpressUmuRaceSettings(ConfigFile config) { //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Expected O, but got Unknown //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Expected O, but got Unknown ForceLevel = config.Bind("Level", "ForceLevel", false, "Forces every normal run to load Empress UMU Derby for testing."); Countdown = config.Bind("Race", "Countdown", 10f, new ConfigDescription("Seconds before the gates open.", (AcceptableValueBase)(object)new AcceptableValueRange(3f, 15f), Array.Empty())); ExitDelay = config.Bind("Race", "ExitDelay", 9f, new ConfigDescription("Seconds to show the result before leaving.", (AcceptableValueBase)(object)new AcceptableValueRange(5f, 20f), Array.Empty())); DebugLogs = config.Bind("Debug", "DebugLogs", false, "Logs Empress UMU Race diagnostics."); } } internal sealed class EmpressUmuRaceRuntime : MonoBehaviour { private enum RaceState { Inactive, Waiting, Countdown, Racing, Finished } private struct AbilityProc { internal string Name; internal double Start; internal double End; internal double Boost; } private sealed class Runner { internal int ViewId; internal string Name; internal float Lane; internal float FinishTime; internal float Phase; internal float Progress; internal float Speed; internal float Stamina; internal float Power; internal float Guts; internal float Wit; internal double SimTime; internal double SimProgress; internal AbilityProc[] Procs; internal int ActiveProc; internal float GlowUntil; } private sealed class RunnerGlow { internal GameObject Root; internal Light Light; internal ParticleSystem Particles; } private static readonly AbilityProc[] AbilityCatalog = new AbilityProc[10] { new AbilityProc { Name = "Escape Artist", Start = 0.0, End = 0.17, Boost = 0.3 }, new AbilityProc { Name = "Rushing Gale", Start = 0.05, End = 0.24, Boost = 0.24 }, new AbilityProc { Name = "Corner Adept", Start = 0.28, End = 0.46, Boost = 0.22 }, new AbilityProc { Name = "Professor of Curvature", Start = 0.44, End = 0.6, Boost = 0.23 }, new AbilityProc { Name = "Straightaway Ace", Start = 0.54, End = 0.74, Boost = 0.21 }, new AbilityProc { Name = "Second Wind", Start = 0.6, End = 0.8, Boost = 0.26 }, new AbilityProc { Name = "Uma Overdrive", Start = 0.7, End = 0.86, Boost = 0.27 }, new AbilityProc { Name = "Homestretch Haste", Start = 0.8, End = 0.94, Boost = 0.32 }, new AbilityProc { Name = "Last Spurt", Start = 0.88, End = 1.0, Boost = 0.4 }, new AbilityProc { Name = "Gutsy Finale", Start = 0.9, End = 1.0, Boost = 0.36 } }; private readonly List _runners = new List(); private readonly Dictionary _runnerGlows = new Dictionary(); private readonly List> _announcements = new List>(); private Transform _root; private EmpressUmuCourse _course; private RaceState _state; private int _sceneHandle = -1; private int _seed; private double _raceStartTime; private float _waitingTimer; private float _standingsTimer; private bool _active; private bool _startSent; private bool _finishSent; private bool _leaving; private int _winnerId = -1; private int _lastId = -1; private int _upgradeIndex; private string _upgradeName = string.Empty; private Transform _cameraAnchor; private Transform _cameraPreviousParent; private float _cameraPreviousFov; private bool _cameraActive; private bool _cameraInitialized; private bool _localVisualForced; private bool _localVisualWasVisible; private bool _localAnimatorWasEnabled; private AnimatorCullingMode _localAnimatorCulling; private ShadowCastingMode _localVisibility; private int _cameraOriginalCullingMask = -1; private Vector3 _lastLocalPosition; private bool _haveLastLocalPosition; private GUIStyle _countdownStyle; private GUIStyle _placeStyle; private GUIStyle _smallStyle; private GUIStyle _skillStyle; private AudioSource _sfx; private AudioSource _music; private const float AudioVolume = 0.3f; private static Material _particleMaterial; internal static EmpressUmuRaceRuntime Instance { get; private set; } internal bool Active => _active; internal static EmpressUmuRaceRuntime EnsureHost() { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Expected O, but got Unknown if ((Object)(object)Instance != (Object)null) { return Instance; } GameObject val = new GameObject("Empress UMU Race Runtime"); val.transform.parent = null; ((Object)val).hideFlags = (HideFlags)61; Object.DontDestroyOnLoad((Object)val); Instance = val.AddComponent(); return Instance; } internal static IEnumerator EmptyCoroutine() { yield break; } private void Awake() { Instance = this; } private void Update() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) if (_active && _sceneHandle != -1) { Scene activeScene = SceneManager.GetActiveScene(); if (((Scene)(ref activeScene)).handle != _sceneHandle) { Deactivate(); return; } } if (!_active) { return; } if (!EmpressUmuRacePlugin.IsRaceLevel(Object.op_Implicit((Object)(object)RunManager.instance) ? RunManager.instance.levelCurrent : null)) { Deactivate(); return; } EmpressUmuAccess.LockControls(); _waitingTimer += Time.deltaTime; if (_state == RaceState.Waiting && SemiFunc.IsMasterClientOrSingleplayer() && !_startSent && _waitingTimer >= 6f) { StartRaceHost(); } if (_state == RaceState.Countdown || _state == RaceState.Racing) { UpdateRace(); } else if (_state == RaceState.Finished) { UpdateCamera(); } } private void LateUpdate() { if (_active) { EmpressUmuAccess.HideVanillaHud(); ForceLocalAvatarVisible(visible: true); for (int i = 0; i < _runners.Count; i++) { EmpressUmuAccess.KeepAnimatorAwake(EmpressUmuAccess.AvatarByViewId(_runners[i].ViewId)); } } } internal IEnumerator GenerateLevel(LevelGenerator generator) { EmpressUmuRacePlugin.EnsurePhotonHooked(); EmpressUmuAssets.Load(); yield return ((MonoBehaviour)this).StartCoroutine(EmpressUmuAssets.LoadAudio()); yield return (object)new WaitForSeconds(0.2f); if (!SemiFunc.IsMultiplayer()) { EmpressUmuAccess.SetAllPlayersReady(generator, value: true); } while (!EmpressUmuAccess.GetAllPlayersReady(generator)) { generator.State = (LevelState)1; yield return (object)new WaitForSeconds(0.1f); } generator.Level = RunManager.instance.levelCurrent; EmpressUmuAccess.SetLevelPrevious(RunManager.instance, generator.Level); generator.Generated = false; EmpressUmuAccess.SetEnemyReady(generator, value: true); EmpressUmuAccess.SetModulesSpawned(generator, 0); EmpressUmuAccess.SetPlayerSpawnedCount(generator, 0); generator.LevelPathPoints = new List(); generator.LevelPathTruck = null; generator.State = (LevelState)3; BuildLevel(generator); EmpressUmuRaceRuntime empressUmuRaceRuntime = this; Scene activeScene = SceneManager.GetActiveScene(); empressUmuRaceRuntime._sceneHandle = ((Scene)(ref activeScene)).handle; yield return (object)new WaitForSeconds(0.2f); if (Object.op_Implicit((Object)(object)EnvironmentDirector.Instance)) { EnvironmentDirector.Instance.Setup(); } if (Object.op_Implicit((Object)(object)PostProcessing.Instance)) { PostProcessing.Instance.Setup(); } if (Object.op_Implicit((Object)(object)LevelMusic.instance)) { LevelMusic.instance.Setup(); } if (Object.op_Implicit((Object)(object)ConstantMusic.instance)) { ConstantMusic.instance.Setup(); } if (SemiFunc.IsMasterClientOrSingleplayer()) { generator.NavMeshSetup(); yield return null; while ((Object)(object)GameDirector.instance == (Object)null || GameDirector.instance.PlayerList.Count == 0) { generator.State = (LevelState)12; yield return (object)new WaitForSeconds(0.1f); } generator.PlayerSpawn(); yield return null; while (EmpressUmuAccess.GetPlayerSpawnedCount(generator) < GameDirector.instance.PlayerList.Count) { generator.State = (LevelState)13; yield return (object)new WaitForSeconds(0.1f); } if (SemiFunc.IsMultiplayer()) { generator.PhotonView.RPC("GenerateDone", (RpcTarget)3, Array.Empty()); } else { EmpressUmuAccess.GenerateDone(generator); } } else { while (!generator.Generated) { yield return (object)new WaitForSeconds(0.1f); } } yield return (object)new WaitForSeconds(0.35f); Activate(); } private void BuildLevel(LevelGenerator generator) { //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Expected O, but got Unknown //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Expected O, but got Unknown //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)generator.LevelParent != (Object)null) { for (int num = generator.LevelParent.transform.childCount - 1; num >= 0; num--) { Object.Destroy((Object)(object)((Component)generator.LevelParent.transform.GetChild(num)).gameObject); } } GameObject val = new GameObject("Empress UMU Race Root"); val.transform.SetParent(generator.LevelParent.transform, false); _root = val.transform; GameObject val2 = new GameObject("Empress UMU Race Module"); val2.transform.SetParent(_root, false); val2.AddComponent().ObservedComponents = new List(); EmpressUmuAccess.ConfigureStartRoomModule(val2.AddComponent()); val2.AddComponent(); _course = EmpressUmuCourse.Build(val2.transform); GameObject val3 = new GameObject("Empress UMU Race Room Volume"); val3.transform.SetParent(val2.transform, false); RoomVolume volume = val3.AddComponent(); BoxCollider obj = val3.AddComponent(); ((Collider)obj).isTrigger = true; obj.center = new Vector3(0f, 30f, 0f); obj.size = new Vector3(300f, 100f, 220f); BuildSpawnPoints(val2.transform, volume, generator); BuildLighting(val2.transform); } private void BuildSpawnPoints(Transform parent, RoomVolume volume, LevelGenerator generator) { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < _course.SpawnPositions.Count; i++) { GameObject val = new GameObject("Empress UMU Starting Gate " + (i + 1)); val.transform.SetParent(parent, false); val.transform.localPosition = _course.SpawnPositions[i]; val.transform.localRotation = _course.SpawnRotations[i]; val.AddComponent(); } LevelPoint val2 = CreateLevelPoint(parent, volume, generator, _course.SpawnPositions[0], truck: true); LevelPoint val3 = CreateLevelPoint(parent, volume, generator, _course.SpawnPositions[0] + Vector3.right * 6f, truck: false); val2.ConnectedPoints = new List { val3 }; val3.ConnectedPoints = new List { val2 }; generator.LevelPathTruck = val2; } private static LevelPoint CreateLevelPoint(Transform parent, RoomVolume volume, LevelGenerator generator, Vector3 position, bool truck) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown //IL_001e: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("Empress UMU Level Point"); val.transform.SetParent(parent, false); val.transform.localPosition = position; int num = LayerMask.NameToLayer("Other"); if (num >= 0) { val.layer = num; } SphereCollider obj = val.AddComponent(); ((Collider)obj).isTrigger = true; obj.radius = 0.35f; LevelPoint val2 = val.AddComponent(); val2.ConnectedPoints = new List(); val2.Room = volume; val2.Truck = truck; val2.ModuleConnect = false; EmpressUmuAccess.MarkLevelPointInStartRoom(val2, value: true); generator.LevelPathPoints.Add(val2); return val2; } private static void BuildLighting(Transform parent) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("Empress Tokyo Sun"); val.transform.SetParent(parent, false); val.transform.rotation = Quaternion.Euler(42f, -28f, 0f); Light obj = val.AddComponent(); obj.type = (LightType)1; obj.color = new Color(1f, 0.91f, 0.78f); obj.intensity = 1.15f; obj.shadows = (LightShadows)2; } private void Activate() { //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) _active = true; _state = RaceState.Waiting; _waitingTimer = 0f; _startSent = false; _finishSent = false; _leaving = false; _winnerId = -1; _lastId = -1; _upgradeName = string.Empty; ResetRunnerRigs(); _runners.Clear(); _haveLastLocalPosition = false; EmpressUmuRacePlugin.EnsurePhotonHooked(); EmpressUmuAccess.LockControls(); SemiFunc.UIFocusText("EMPRESS UMU DERBY\nControls locked. Watch your runner.", new Color(1f, 0.25f, 0.52f), Color.white, 5f); } private void Deactivate() { _active = false; _state = RaceState.Inactive; StopMusic(); ResetRunnerRigs(); _runners.Clear(); RestoreCamera(); ForceLocalAvatarVisible(visible: false); _root = null; _course = null; _sceneHandle = -1; EmpressUmuRacePlugin.RemovePhotonHook(); } private void StartRaceHost() { List list = new List(EmpressUmuAccess.Players()); list.RemoveAll((PlayerAvatar player) => (Object)(object)player == (Object)null || (Object)(object)player.photonView == (Object)null || player.photonView.ViewID <= 0); list.Sort((PlayerAvatar a, PlayerAvatar b) => a.photonView.ViewID.CompareTo(b.photonView.ViewID)); if (list.Count != 0) { _startSent = true; _seed = (int)(NetworkNow() * 1000.0) ^ (list.Count * 10005); int[] array = new int[list.Count]; for (int num = 0; num < list.Count; num++) { array[num] = list[num].photonView.ViewID; } double num2 = NetworkNow() + (double)EmpressUmuRacePlugin.Settings.Countdown.Value; EmpressUmuRacePlugin.RaiseToAll(197, new object[3] { num2, _seed, array }); } } internal void ReceiveRaceStart(object[] data) { if (data == null || data.Length < 3) { return; } _raceStartTime = Convert.ToDouble(data[0]); _seed = Convert.ToInt32(data[1]); if (data[2] is int[] array && array.Length != 0) { ResetRunnerRigs(); _runners.Clear(); for (int i = 0; i < array.Length; i++) { PlayerAvatar avatar = EmpressUmuAccess.AvatarByViewId(array[i]); Runner runner = new Runner { ViewId = array[i], Name = EmpressUmuAccess.PlayerName(avatar), Lane = EmpressUmuCourse.LaneOffset(i, array.Length), Phase = Hash01(_seed ^ (array[i] * 7919)) * MathF.PI * 2f, Progress = 0f, ActiveProc = -1, SimTime = 0.0, SimProgress = 0.0 }; RollRunner(runner); runner.FinishTime = SimulateFinishTime(runner); _runners.Add(runner); } _state = RaceState.Countdown; _active = true; _cameraInitialized = false; _haveLastLocalPosition = false; PlaySfx("call_to_post"); } } private void RollRunner(Runner runner) { Random random = new Random(_seed * 486187739 + runner.ViewId * 26700541 + 1013904223); runner.Speed = 0.32f + (float)random.NextDouble() * 0.64f; runner.Power = 0.32f + (float)random.NextDouble() * 0.64f; runner.Stamina = 0.32f + (float)random.NextDouble() * 0.64f; runner.Guts = 0.32f + (float)random.NextDouble() * 0.64f; runner.Wit = 0.32f + (float)random.NextDouble() * 0.64f; int num = 1 + (int)(runner.Wit * 2.4f); List list = new List(); for (int i = 0; i < num; i++) { AbilityProc item = AbilityCatalog[random.Next(AbilityCatalog.Length)]; double num2 = (random.NextDouble() - 0.5) * 0.05; item.Start = Math.Max(0.0, item.Start + num2); item.End = Math.Min(1.0, item.End + num2); item.Boost *= 0.8 + (double)runner.Wit * 0.5; list.Add(item); } runner.Procs = list.ToArray(); } private double RunnerRate(Runner runner, double f) { double num = 1.0 / 42.0; double num2 = 0.84 + (double)runner.Speed * 0.42; double num3 = 1.0; if (f < 0.15) { num3 += (double)runner.Power * 0.45 * (1.0 - f / 0.15); } if (f > 0.6 && f < 0.92) { num3 -= (1.0 - (double)runner.Stamina) * 0.5 * ((f - 0.6) / 0.32); } if (f > 0.9) { num3 += (double)runner.Guts * 0.55 * ((f - 0.9) / 0.1); } if (f > 0.15 && f < 0.85) { num3 += Math.Sin(f * Math.PI * (3.0 + (double)runner.Wit * 4.0) + (double)runner.Phase) * 0.06; } if (runner.Procs != null) { for (int i = 0; i < runner.Procs.Length; i++) { if (f >= runner.Procs[i].Start && f <= runner.Procs[i].End) { num3 += runner.Procs[i].Boost; } } } if (num3 < 0.5) { num3 = 0.5; } return num * num2 * num3; } private float SimulateFinishTime(Runner runner) { double num = 0.0; double num2 = 0.0; while (num2 < 1.0 && num < 120.0) { num2 += RunnerRate(runner, num2) * 0.02; num += 0.02; } return (float)num; } private int ActiveProcIndex(Runner runner, double f) { if (runner.Procs == null) { return -1; } for (int i = 0; i < runner.Procs.Length; i++) { if (f >= runner.Procs[i].Start && f <= runner.Procs[i].End) { return i; } } return -1; } private void UpdateRace() { //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) float num = (float)(NetworkNow() - _raceStartTime); if (num >= 0f && _state == RaceState.Countdown) { _state = RaceState.Racing; _course?.OpenGates(); PlaySfx("gate_open"); PlayMusic("race_music"); SemiFunc.UIFocusText("GATES OPEN!", new Color(1f, 0.25f, 0.52f), Color.white, 1.5f); } for (int i = 0; i < _runners.Count; i++) { AdvanceRunner(_runners[i], num); } UpdateRunnerGlows(); UpdateStandings(); MoveLocalRunner(num); UpdateCamera(); if (_state == RaceState.Racing && SemiFunc.IsMasterClientOrSingleplayer() && !_finishSent) { float num2 = 0f; for (int j = 0; j < _runners.Count; j++) { num2 = Mathf.Max(num2, _runners[j].FinishTime); } if (num >= num2 + 0.35f) { FinishRaceHost(); } } } private void AdvanceRunner(Runner runner, float elapsed) { double num = Math.Max(0.0, elapsed); while (runner.SimTime + 0.02 <= num && runner.SimProgress < 1.14) { double num2 = RunnerRate(runner, Math.Min(runner.SimProgress, 1.0)); if (runner.SimProgress >= 1.0) { num2 *= Math.Exp((0.0 - (runner.SimTime - (double)runner.FinishTime)) * 1.7); } runner.SimProgress += num2 * 0.02; runner.SimTime += 0.02; } runner.Progress = (float)runner.SimProgress; int num3 = ((_state == RaceState.Racing && runner.SimProgress < 1.0) ? ActiveProcIndex(runner, runner.SimProgress) : (-1)); if (num3 != runner.ActiveProc) { if (num3 >= 0) { runner.GlowUntil = Time.time + 1.6f; QueueAnnouncement(runner.Name + " · " + runner.Procs[num3].Name + "!"); } runner.ActiveProc = num3; } } private void QueueAnnouncement(string message) { _announcements.Add(new KeyValuePair(message, Time.time + 2.6f)); while (_announcements.Count > 4) { _announcements.RemoveAt(0); } } private void UpdateStandings() { if (_course == null || _runners.Count == 0) { return; } _standingsTimer -= Time.deltaTime; if (!(_standingsTimer > 0f)) { _standingsTimer = 0.4f; List list = new List(_runners); list.Sort((Runner a, Runner b) => b.SimProgress.CompareTo(a.SimProgress)); StringBuilder stringBuilder = new StringBuilder(); stringBuilder.AppendLine("- EMPRESS UMU DERBY -"); int num = Mathf.Min(6, list.Count); for (int num2 = 0; num2 < num; num2++) { string text = ((list[num2].SimProgress >= 1.0) ? "FIN" : (Mathf.RoundToInt((float)list[num2].SimProgress * 100f) + "%")); stringBuilder.AppendLine(num2 + 1 + ". " + list[num2].Name + " " + text); } _course.SetScoreboard(stringBuilder.ToString()); } } private void MoveLocalRunner(float elapsed) { //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) PlayerAvatar val = EmpressUmuAccess.LocalAvatar(); if ((Object)(object)val == (Object)null || (Object)(object)val.photonView == (Object)null) { return; } Runner runner = RunnerById(val.photonView.ViewID); if (runner != null) { float num = ((elapsed > 0f) ? (Mathf.Sin(elapsed * 0.55f + runner.Phase) * 0.42f) : 0f); EmpressUmuCourse.Evaluate(runner.Progress, runner.Lane + num, out var position, out var tangent); if (elapsed < 0f) { position -= tangent * (2.8f + Mathf.Abs(runner.Lane) * 0.02f); } Quaternion rotation = Quaternion.LookRotation(tangent, Vector3.up); Vector3 velocity = ((_haveLastLocalPosition && Time.deltaTime > 0.0001f) ? ((position - _lastLocalPosition) / Time.deltaTime) : Vector3.zero); _lastLocalPosition = position; _haveLastLocalPosition = true; EmpressUmuAccess.MoveLocal(position, rotation, velocity); } } private void FinishRaceHost() { if (_finishSent || _runners.Count == 0) { return; } _finishSent = true; Runner runner = _runners[0]; Runner runner2 = _runners[0]; for (int i = 1; i < _runners.Count; i++) { if (_runners[i].FinishTime < runner.FinishTime) { runner = _runners[i]; } if (_runners[i].FinishTime > runner2.FinishTime) { runner2 = _runners[i]; } } _upgradeIndex = Mathf.Abs(_seed * 31 + runner.ViewId * 17) % 10; PlayerAvatar winner = EmpressUmuAccess.AvatarByViewId(runner.ViewId); _upgradeName = EmpressUmuAccess.ApplyUpgrade(winner, _upgradeIndex); EmpressUmuRacePlugin.RaiseToAll(198, new object[3] { runner.ViewId, runner2.ViewId, _upgradeIndex }); } internal void ReceiveRaceFinish(object[] data) { //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_020f: Unknown result type (might be due to invalid IL or missing references) //IL_0214: Unknown result type (might be due to invalid IL or missing references) //IL_021e: Unknown result type (might be due to invalid IL or missing references) //IL_0223: Unknown result type (might be due to invalid IL or missing references) if (data == null || data.Length < 3 || _state == RaceState.Finished) { return; } _winnerId = Convert.ToInt32(data[0]); _lastId = Convert.ToInt32(data[1]); _upgradeIndex = Convert.ToInt32(data[2]); _upgradeName = EmpressUmuAccess.UpgradeName(_upgradeIndex); _state = RaceState.Finished; StopMusic(); PlaySfx("crowd_cheer"); PlayerAvatar val = EmpressUmuAccess.LocalAvatar(); if ((Object)(object)val != (Object)null && (Object)(object)val.photonView != (Object)null) { Runner runner = RunnerById(val.photonView.ViewID); if (runner != null) { runner.Progress = 1f; EmpressUmuCourse.Evaluate(1f, runner.Lane, out var position, out var tangent); EmpressUmuAccess.MoveLocal(position, Quaternion.LookRotation(tangent, Vector3.up), Vector3.zero); } } PlayerAvatar val2 = EmpressUmuAccess.AvatarByViewId(_lastId); Vector3 position2 = (((Object)(object)val2 != (Object)null) ? (((Component)val2).transform.position + Vector3.up) : Vector3.zero); if (!EmpressUmuAccess.SpawnGameExplosion(position2)) { ((MonoBehaviour)this).StartCoroutine(SpawnFallbackExplosion(position2)); } PlayerAvatar val3 = EmpressUmuAccess.LocalAvatar(); if ((Object)(object)val3 != (Object)null && (Object)(object)val3.photonView != (Object)null && val3.photonView.ViewID == _lastId) { EmpressUmuAccess.KillLocalPlayer(); } string text = RunnerName(_winnerId); string text2 = RunnerName(_lastId); SemiFunc.UIFocusText(text + " WINS +1 " + _upgradeName + "\n" + text2 + " FINISHED LAST", new Color(1f, 0.68f, 0.12f), Color.white, 7f); if (_course != null) { _course.SetScoreboard("- PHOTO FINISH -\n\nWINNER\n" + text + "\n\n+1 " + _upgradeName); } PlayerAvatar val4 = EmpressUmuAccess.AvatarByViewId(_winnerId); if ((Object)(object)val4 != (Object)null) { ((MonoBehaviour)this).StartCoroutine(SpawnConfetti(((Component)val4).transform.position + Vector3.up * 2.4f)); } if (SemiFunc.IsMasterClientOrSingleplayer() && !_leaving) { ((MonoBehaviour)this).StartCoroutine(LeaveAfterResults()); } } private IEnumerator SpawnConfetti(Vector3 position) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) GameObject confetti = new GameObject("Empress UMU Confetti"); confetti.transform.position = position; ParticleSystem val = confetti.AddComponent(); ApplyParticleMaterial(val); MainModule main = val.main; ((MainModule)(ref main)).duration = 3.5f; ((MainModule)(ref main)).loop = false; ((MainModule)(ref main)).startLifetime = new MinMaxCurve(2.2f, 4.5f); ((MainModule)(ref main)).startSpeed = new MinMaxCurve(6f, 15f); ((MainModule)(ref main)).startSize = new MinMaxCurve(0.14f, 0.4f); ((MainModule)(ref main)).gravityModifier = MinMaxCurve.op_Implicit(0.55f); ((MainModule)(ref main)).maxParticles = 600; ((MainModule)(ref main)).startColor = new MinMaxGradient(new Color(1f, 0.3f, 0.6f), new Color(0.3f, 0.8f, 1f)); EmissionModule emission = val.emission; ((EmissionModule)(ref emission)).rateOverTime = MinMaxCurve.op_Implicit(0f); ((EmissionModule)(ref emission)).SetBursts((Burst[])(object)new Burst[3] { new Burst(0f, (short)220), new Burst(0.4f, (short)180), new Burst(0.9f, (short)160) }); ShapeModule shape = val.shape; ((ShapeModule)(ref shape)).shapeType = (ParticleSystemShapeType)4; ((ShapeModule)(ref shape)).angle = 42f; ((ShapeModule)(ref shape)).radius = 0.6f; val.Play(); yield return (object)new WaitForSeconds(7f); if ((Object)(object)confetti != (Object)null) { Object.Destroy((Object)(object)confetti); } } private IEnumerator LeaveAfterResults() { _leaving = true; yield return (object)new WaitForSeconds(EmpressUmuRacePlugin.Settings.ExitDelay.Value); if ((Object)(object)RunManager.instance != (Object)null && EmpressUmuRacePlugin.IsRaceLevel(RunManager.instance.levelCurrent)) { RunManager.instance.ChangeLevel(true, false, (ChangeLevelType)0); } } private IEnumerator SpawnFallbackExplosion(Vector3 position) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) GameObject explosion = new GameObject("Empress Last Place Explosion"); explosion.transform.position = position; ParticleSystem obj = explosion.AddComponent(); ApplyParticleMaterial(obj); MainModule main = obj.main; ((MainModule)(ref main)).duration = 1.2f; ((MainModule)(ref main)).loop = false; ((MainModule)(ref main)).startLifetime = new MinMaxCurve(0.45f, 1.25f); ((MainModule)(ref main)).startSpeed = new MinMaxCurve(8f, 23f); ((MainModule)(ref main)).startSize = new MinMaxCurve(0.35f, 1.4f); ((MainModule)(ref main)).startColor = new MinMaxGradient(new Color(1f, 0.18f, 0.03f), new Color(1f, 0.86f, 0.12f)); ((MainModule)(ref main)).maxParticles = 240; EmissionModule emission = obj.emission; ((EmissionModule)(ref emission)).rateOverTime = MinMaxCurve.op_Implicit(0f); ((EmissionModule)(ref emission)).SetBurst(0, new Burst(0f, (short)180)); ShapeModule shape = obj.shape; ((ShapeModule)(ref shape)).shapeType = (ParticleSystemShapeType)0; ((ShapeModule)(ref shape)).radius = 0.65f; Light flash = explosion.AddComponent(); flash.type = (LightType)2; flash.color = new Color(1f, 0.2f, 0.03f); flash.range = 28f; flash.intensity = 8f; obj.Play(); if ((Object)(object)GameDirector.instance != (Object)null) { GameDirector.instance.CameraShake.ShakeDistance(6f, 4f, 22f, position, 0.5f); } float time = 0f; while (time < 1.3f) { time += Time.deltaTime; flash.intensity = Mathf.Lerp(8f, 0f, time / 1.3f); yield return null; } Object.Destroy((Object)(object)explosion, 1f); } private void UpdateCamera() { //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_035b: Unknown result type (might be due to invalid IL or missing references) //IL_035d: Unknown result type (might be due to invalid IL or missing references) //IL_035f: Unknown result type (might be due to invalid IL or missing references) //IL_0364: Unknown result type (might be due to invalid IL or missing references) //IL_0368: Unknown result type (might be due to invalid IL or missing references) //IL_036d: Unknown result type (might be due to invalid IL or missing references) //IL_0372: Unknown result type (might be due to invalid IL or missing references) //IL_0377: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_018a: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Unknown result type (might be due to invalid IL or missing references) //IL_0190: Unknown result type (might be due to invalid IL or missing references) //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_03b0: Unknown result type (might be due to invalid IL or missing references) //IL_03b5: Unknown result type (might be due to invalid IL or missing references) //IL_03c2: Unknown result type (might be due to invalid IL or missing references) //IL_03d8: Unknown result type (might be due to invalid IL or missing references) //IL_03dd: Unknown result type (might be due to invalid IL or missing references) //IL_03ea: Unknown result type (might be due to invalid IL or missing references) //IL_0387: Unknown result type (might be due to invalid IL or missing references) //IL_0394: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: Unknown result type (might be due to invalid IL or missing references) //IL_01d9: Unknown result type (might be due to invalid IL or missing references) //IL_01e0: Unknown result type (might be due to invalid IL or missing references) //IL_01e5: Unknown result type (might be due to invalid IL or missing references) //IL_01ea: Unknown result type (might be due to invalid IL or missing references) //IL_01f1: Unknown result type (might be due to invalid IL or missing references) //IL_01f6: Unknown result type (might be due to invalid IL or missing references) //IL_01fb: Unknown result type (might be due to invalid IL or missing references) //IL_0205: Unknown result type (might be due to invalid IL or missing references) //IL_020a: Unknown result type (might be due to invalid IL or missing references) //IL_020f: Unknown result type (might be due to invalid IL or missing references) //IL_021d: Unknown result type (might be due to invalid IL or missing references) //IL_021e: Unknown result type (might be due to invalid IL or missing references) //IL_0225: Unknown result type (might be due to invalid IL or missing references) //IL_022a: Unknown result type (might be due to invalid IL or missing references) //IL_022f: Unknown result type (might be due to invalid IL or missing references) //IL_0236: Unknown result type (might be due to invalid IL or missing references) //IL_023b: Unknown result type (might be due to invalid IL or missing references) //IL_0240: Unknown result type (might be due to invalid IL or missing references) //IL_024a: Unknown result type (might be due to invalid IL or missing references) //IL_024f: Unknown result type (might be due to invalid IL or missing references) //IL_0254: Unknown result type (might be due to invalid IL or missing references) //IL_0262: Unknown result type (might be due to invalid IL or missing references) //IL_0263: Unknown result type (might be due to invalid IL or missing references) //IL_026a: Unknown result type (might be due to invalid IL or missing references) //IL_026f: Unknown result type (might be due to invalid IL or missing references) //IL_0274: Unknown result type (might be due to invalid IL or missing references) //IL_027b: Unknown result type (might be due to invalid IL or missing references) //IL_0280: Unknown result type (might be due to invalid IL or missing references) //IL_0285: Unknown result type (might be due to invalid IL or missing references) //IL_028f: Unknown result type (might be due to invalid IL or missing references) //IL_0294: Unknown result type (might be due to invalid IL or missing references) //IL_0299: Unknown result type (might be due to invalid IL or missing references) //IL_02a7: Unknown result type (might be due to invalid IL or missing references) //IL_02a8: Unknown result type (might be due to invalid IL or missing references) //IL_02af: Unknown result type (might be due to invalid IL or missing references) //IL_02b4: Unknown result type (might be due to invalid IL or missing references) //IL_02b9: Unknown result type (might be due to invalid IL or missing references) //IL_02c3: Unknown result type (might be due to invalid IL or missing references) //IL_02c8: Unknown result type (might be due to invalid IL or missing references) //IL_02cd: Unknown result type (might be due to invalid IL or missing references) //IL_02db: Unknown result type (might be due to invalid IL or missing references) //IL_02dc: Unknown result type (might be due to invalid IL or missing references) //IL_02e3: Unknown result type (might be due to invalid IL or missing references) //IL_02e8: Unknown result type (might be due to invalid IL or missing references) //IL_02ed: Unknown result type (might be due to invalid IL or missing references) //IL_02f4: Unknown result type (might be due to invalid IL or missing references) //IL_02f9: Unknown result type (might be due to invalid IL or missing references) //IL_02fe: Unknown result type (might be due to invalid IL or missing references) //IL_0308: Unknown result type (might be due to invalid IL or missing references) //IL_030d: Unknown result type (might be due to invalid IL or missing references) //IL_0312: Unknown result type (might be due to invalid IL or missing references) //IL_0404: Unknown result type (might be due to invalid IL or missing references) //IL_0414: Unknown result type (might be due to invalid IL or missing references) //IL_031d: Unknown result type (might be due to invalid IL or missing references) //IL_031e: Unknown result type (might be due to invalid IL or missing references) //IL_0328: Unknown result type (might be due to invalid IL or missing references) //IL_032d: Unknown result type (might be due to invalid IL or missing references) //IL_0334: Unknown result type (might be due to invalid IL or missing references) //IL_0339: Unknown result type (might be due to invalid IL or missing references) //IL_033e: Unknown result type (might be due to invalid IL or missing references) //IL_0348: Unknown result type (might be due to invalid IL or missing references) //IL_034d: Unknown result type (might be due to invalid IL or missing references) //IL_0352: Unknown result type (might be due to invalid IL or missing references) //IL_044d: Unknown result type (might be due to invalid IL or missing references) //IL_044f: Unknown result type (might be due to invalid IL or missing references) //IL_0454: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)GameDirector.instance == (Object)null || (Object)(object)GameDirector.instance.MainCamera == (Object)null) { return; } PlayerAvatar val = EmpressUmuAccess.LocalAvatar(); if ((Object)(object)val == (Object)null || (Object)(object)val.photonView == (Object)null) { return; } Runner runner = RunnerById(val.photonView.ViewID); if (runner == null) { return; } EnsureCamera(); if ((Object)(object)_cameraAnchor == (Object)null) { return; } float num = (float)(NetworkNow() - _raceStartTime); EmpressUmuCourse.Evaluate(runner.Progress, runner.Lane, out var position, out var tangent); Vector3 val2 = Vector3.Cross(Vector3.up, tangent); Vector3 normalized = ((Vector3)(ref val2)).normalized; Vector3 val3 = position + Vector3.up * 1.25f; Vector3 val4; float num2; if (_state == RaceState.Countdown) { val4 = position + tangent * 11f + normalized * 2.5f + Vector3.up * 3f; num2 = 54f; } else if (_state == RaceState.Finished) { val4 = position + normalized * 8f - tangent * 3f + Vector3.up * 3.4f; num2 = 48f; } else if (runner.Progress > 0.87f) { val4 = new Vector3(0f, 4.4f, -57f) + normalized * 2f; val3 = position + Vector3.up; num2 = 43f; } else { switch (Mathf.Abs(Mathf.FloorToInt(num / 4.4f)) % 6) { case 0: val4 = position - tangent * 8f + normalized * 1.4f + Vector3.up * 3.1f; num2 = 58f; break; case 1: val4 = position + normalized * 10f - tangent * 1.5f + Vector3.up * 3.6f; num2 = 54f; break; case 2: val4 = position + tangent * 9.5f - normalized * 1.2f + Vector3.up * 2.2f; num2 = 61f; break; case 3: val4 = position - tangent * 4f + Vector3.up * 13f; num2 = 60f; break; case 4: val4 = position - normalized * 14f + tangent * 2f + Vector3.up * 2.1f; num2 = 47f; break; default: val4 = Vector3.Lerp(position, Vector3.zero, 0.42f) - tangent * 5f + Vector3.up * 7f; num2 = 64f; break; } } val2 = val3 - val4; Quaternion val5 = Quaternion.LookRotation(((Vector3)(ref val2)).normalized, Vector3.up); if (!_cameraInitialized) { _cameraAnchor.position = val4; _cameraAnchor.rotation = val5; _cameraInitialized = true; } else { _cameraAnchor.position = Vector3.Lerp(_cameraAnchor.position, val4, 5.5f * Time.deltaTime); _cameraAnchor.rotation = Quaternion.Slerp(_cameraAnchor.rotation, val5, 7f * Time.deltaTime); } Camera mainCamera = GameDirector.instance.MainCamera; ((Component)mainCamera).transform.localPosition = Vector3.zero; ((Component)mainCamera).transform.localRotation = Quaternion.identity; mainCamera.fieldOfView = Mathf.Lerp(mainCamera.fieldOfView, num2, 5f * Time.deltaTime); if ((Object)(object)CameraAim.Instance != (Object)null) { CameraAim.Instance.SetPlayerAim(Quaternion.LookRotation(tangent, Vector3.up), true); CameraAim.Instance.OverridePlayerAimDisable(true); } } private void EnsureCamera() { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Expected O, but got Unknown //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_cameraAnchor == (Object)null) { GameObject val = new GameObject("Empress UMU Broadcast Camera"); ((Object)val).hideFlags = (HideFlags)61; val.transform.SetParent(((Component)this).transform, false); _cameraAnchor = val.transform; } if (!_cameraActive && !((Object)(object)GameDirector.instance == (Object)null) && !((Object)(object)GameDirector.instance.MainCamera == (Object)null)) { Camera mainCamera = GameDirector.instance.MainCamera; _cameraPreviousParent = ((Component)mainCamera).transform.parent; _cameraPreviousFov = mainCamera.fieldOfView; ((Component)mainCamera).transform.SetParent(_cameraAnchor, false); ((Component)mainCamera).transform.localPosition = Vector3.zero; ((Component)mainCamera).transform.localRotation = Quaternion.identity; _cameraActive = true; } } private void RestoreCamera() { //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) if (_cameraActive && (Object)(object)GameDirector.instance != (Object)null && (Object)(object)GameDirector.instance.MainCamera != (Object)null) { Camera mainCamera = GameDirector.instance.MainCamera; Transform val = (Object.op_Implicit((Object)(object)_cameraPreviousParent) ? _cameraPreviousParent : GameDirector.instance.MainCameraParent); ((Component)mainCamera).transform.SetParent(val, false); ((Component)mainCamera).transform.localPosition = Vector3.zero; ((Component)mainCamera).transform.localRotation = Quaternion.identity; mainCamera.fieldOfView = _cameraPreviousFov; } if ((Object)(object)CameraAim.Instance != (Object)null) { CameraAim.Instance.OverridePlayerAimDisableReset(); } _cameraActive = false; _cameraInitialized = false; } private void ForceLocalAvatarVisible(bool visible) { //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) PlayerAvatar val = EmpressUmuAccess.LocalAvatar(); PlayerAvatarVisuals val2 = (((Object)(object)val != (Object)null) ? val.playerAvatarVisuals : null); GameObject val3 = EmpressUmuAccess.VisualMeshParent(val2); Animator val4 = EmpressUmuAccess.VisualAnimator(val2); if ((Object)(object)val2 == (Object)null || (Object)(object)val3 == (Object)null || (Object)(object)val4 == (Object)null) { if (!visible) { _localVisualForced = false; } } else if (visible) { if (!_localVisualForced) { _localVisualForced = true; _localVisualWasVisible = val3.activeSelf; _localAnimatorWasEnabled = ((Behaviour)val4).enabled; _localAnimatorCulling = val4.cullingMode; _localVisibility = EmpressUmuAccess.VisualVisibility(val2); } val3.SetActive(true); ((Behaviour)val4).enabled = true; val4.cullingMode = (AnimatorCullingMode)0; EmpressUmuAccess.SetVisualVisibility(val2, (ShadowCastingMode)1, apply: true); Camera val5 = (((Object)(object)GameDirector.instance != (Object)null) ? GameDirector.instance.MainCamera : Camera.main); if ((Object)(object)val5 != (Object)null) { if (_cameraOriginalCullingMask == -1) { _cameraOriginalCullingMask = val5.cullingMask; } int num = val5.cullingMask; int num2 = LayerMask.NameToLayer("PlayerVisualsLocal"); int num3 = LayerMask.NameToLayer("LocalPlayer"); if (num2 >= 0) { num |= 1 << num2; } if (num3 >= 0) { num |= 1 << num3; } val5.cullingMask = num; } } else if (_localVisualForced) { EmpressUmuAccess.SetVisualVisibility(val2, _localVisibility, apply: true); val3.SetActive(_localVisualWasVisible); ((Behaviour)val4).enabled = _localAnimatorWasEnabled; val4.cullingMode = _localAnimatorCulling; Camera val6 = (((Object)(object)GameDirector.instance != (Object)null) ? GameDirector.instance.MainCamera : Camera.main); if ((Object)(object)val6 != (Object)null && _cameraOriginalCullingMask != -1) { val6.cullingMask = _cameraOriginalCullingMask; } _cameraOriginalCullingMask = -1; _localVisualForced = false; } } internal void PrepareRunnerAnimation(PlayerAvatarVisuals visuals) { PlayerAvatar val = EmpressUmuAccess.VisualPlayerAvatar(visuals); if (!((Object)(object)val == (Object)null) && !((Object)(object)val.photonView == (Object)null)) { Runner runner = RunnerById(val.photonView.ViewID); if (runner != null) { bool running = RunnerIsRunning(runner); EmpressUmuAccess.SetRunFlags(val, running); } } } internal void FinalizeRunnerAnimation(PlayerAvatarVisuals visuals) { PlayerAvatar val = EmpressUmuAccess.VisualPlayerAvatar(visuals); if (!((Object)(object)val == (Object)null) && !((Object)(object)val.photonView == (Object)null)) { Runner runner = RunnerById(val.photonView.ViewID); if (runner != null) { bool running = RunnerIsRunning(runner); float intensity = 1.1f + runner.Speed * 0.5f + ((runner.ActiveProc >= 0) ? 0.25f : 0f); EmpressUmuAccess.ForceAnimatorRun(val, running, intensity); } } } private bool RunnerIsRunning(Runner runner) { if (_state == RaceState.Racing && runner.SimProgress > 0.0001) { return runner.SimProgress < 1.14; } return false; } private void UpdateRunnerGlows() { //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) float time = Time.time; for (int i = 0; i < _runners.Count; i++) { Runner runner = _runners[i]; bool flag = runner.ActiveProc >= 0 || time < runner.GlowUntil; PlayerAvatar val = EmpressUmuAccess.AvatarByViewId(runner.ViewId); if ((Object)(object)val == (Object)null) { continue; } if (!flag) { if (_runnerGlows.TryGetValue(runner.ViewId, out var value) && value.Root.activeSelf) { value.Root.SetActive(false); } continue; } RunnerGlow runnerGlow = ResolveGlow(runner.ViewId); if (runnerGlow == null) { continue; } if (!runnerGlow.Root.activeSelf) { runnerGlow.Root.SetActive(true); if ((Object)(object)runnerGlow.Particles != (Object)null) { runnerGlow.Particles.Play(); } } runnerGlow.Root.transform.position = ((Component)val).transform.position + Vector3.up * 1.1f; } } private RunnerGlow ResolveGlow(int viewId) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Expected O, but got Unknown //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) if (_runnerGlows.TryGetValue(viewId, out var value) && (Object)(object)value.Root != (Object)null) { return value; } GameObject val = new GameObject("Empress UMU Skill Glow"); ((Object)val).hideFlags = (HideFlags)61; Light val2 = val.AddComponent(); val2.type = (LightType)2; val2.color = new Color(1f, 0.82f, 0.28f); val2.range = 6.5f; val2.intensity = 4.2f; ParticleSystem val3 = val.AddComponent(); ApplyParticleMaterial(val3); MainModule main = val3.main; ((MainModule)(ref main)).startLifetime = MinMaxCurve.op_Implicit(0.55f); ((MainModule)(ref main)).startSpeed = MinMaxCurve.op_Implicit(5.5f); ((MainModule)(ref main)).startSize = new MinMaxCurve(0.12f, 0.34f); ((MainModule)(ref main)).startColor = new MinMaxGradient(new Color(1f, 0.85f, 0.3f), new Color(1f, 0.45f, 0.75f)); ((MainModule)(ref main)).maxParticles = 90; EmissionModule emission = val3.emission; ((EmissionModule)(ref emission)).rateOverTime = MinMaxCurve.op_Implicit(55f); ShapeModule shape = val3.shape; ((ShapeModule)(ref shape)).shapeType = (ParticleSystemShapeType)4; ((ShapeModule)(ref shape)).angle = 16f; ((ShapeModule)(ref shape)).radius = 0.35f; RunnerGlow runnerGlow = new RunnerGlow { Root = val, Light = val2, Particles = val3 }; val.SetActive(false); _runnerGlows[viewId] = runnerGlow; return runnerGlow; } private void ResetRunnerRigs() { foreach (RunnerGlow value in _runnerGlows.Values) { if ((Object)(object)value.Root != (Object)null) { Object.Destroy((Object)(object)value.Root); } } _runnerGlows.Clear(); _announcements.Clear(); } private Runner RunnerById(int viewId) { for (int i = 0; i < _runners.Count; i++) { if (_runners[i].ViewId == viewId) { return _runners[i]; } } return null; } private string RunnerName(int viewId) { Runner runner = RunnerById(viewId); if (runner != null) { return runner.Name; } return EmpressUmuAccess.PlayerName(EmpressUmuAccess.AvatarByViewId(viewId)); } private void OnGUI() { //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_01a2: Unknown result type (might be due to invalid IL or missing references) //IL_01e0: Unknown result type (might be due to invalid IL or missing references) if (!_active || _state == RaceState.Inactive) { return; } EnsureGuiStyles(); float num = Mathf.Clamp((float)Screen.height / 1080f, 0.72f, 1.35f); GUI.matrix = Matrix4x4.TRS(Vector3.zero, Quaternion.identity, new Vector3(num, num, 1f)); float num2 = (float)Screen.width / num; float num3 = (float)Screen.height / num; if (_state == RaceState.Waiting) { GUI.Label(new Rect(0f, num3 * 0.14f, num2, 100f), "RUNNERS ENTERING THE GATES", _countdownStyle); return; } if (_state == RaceState.Countdown) { int num4 = Mathf.Max(1, Mathf.CeilToInt((float)(_raceStartTime - NetworkNow()))); GUI.Label(new Rect(0f, num3 * 0.1f, num2, 150f), num4.ToString(), _countdownStyle); } if (_state == RaceState.Racing) { DrawAnnouncements(num2, num3); } else if (_state == RaceState.Finished) { DrawRect(new Rect(num2 * 0.5f - 390f, num3 * 0.34f, 780f, 210f), new Color(0.025f, 0.035f, 0.075f, 0.94f)); GUI.Label(new Rect(num2 * 0.5f - 370f, num3 * 0.36f, 740f, 70f), RunnerName(_winnerId) + " WINS!", _countdownStyle); GUI.Label(new Rect(num2 * 0.5f - 360f, num3 * 0.44f, 720f, 42f), "+1 " + _upgradeName, _placeStyle); GUI.Label(new Rect(num2 * 0.5f - 360f, num3 * 0.5f, 720f, 42f), RunnerName(_lastId) + " · DEAD LAST", _smallStyle); } } private void DrawAnnouncements(float width, float height) { //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) for (int num = _announcements.Count - 1; num >= 0; num--) { if (Time.time >= _announcements[num].Value) { _announcements.RemoveAt(num); } } float num2 = height * 0.2f; Color textColor = default(Color); for (int i = 0; i < _announcements.Count; i++) { float num3 = _announcements[i].Value - Time.time; ((Color)(ref textColor))..ctor(1f, 0.83f, 0.28f, Mathf.Clamp01(num3)); GUIStyle skillStyle = _skillStyle; skillStyle.normal.textColor = textColor; GUI.Label(new Rect(0f, num2, width, 40f), "SKILL " + _announcements[i].Key, skillStyle); num2 += 40f; } } private void EnsureGuiStyles() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) if (_countdownStyle == null) { _countdownStyle = Style(60, (FontStyle)1, (TextAnchor)4, Color.white); _placeStyle = Style(36, (FontStyle)1, (TextAnchor)4, new Color(1f, 0.72f, 0.14f)); _smallStyle = Style(19, (FontStyle)1, (TextAnchor)4, Color.white); _skillStyle = Style(26, (FontStyle)1, (TextAnchor)4, new Color(1f, 0.83f, 0.28f)); } } private static GUIStyle Style(int size, FontStyle fontStyle, TextAnchor anchor, Color color) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown GUIStyle val = new GUIStyle(GUI.skin.label) { fontSize = size, fontStyle = fontStyle, alignment = anchor }; val.normal.textColor = color; val.wordWrap = false; return val; } private static void DrawRect(Rect rect, Color color) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) Color color2 = GUI.color; GUI.color = color; GUI.DrawTexture(rect, (Texture)(object)Texture2D.whiteTexture); GUI.color = color2; } private static Material ParticleMaterial() { //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Expected O, but got Unknown if ((Object)(object)_particleMaterial != (Object)null) { return _particleMaterial; } Shader val = Shader.Find("Legacy Shaders/Particles/Alpha Blended Premultiply"); if ((Object)(object)val == (Object)null) { val = Shader.Find("Legacy Shaders/Particles/Alpha Blended"); } if ((Object)(object)val == (Object)null) { val = Shader.Find("Particles/Standard Unlit"); } if ((Object)(object)val == (Object)null) { val = Shader.Find("Sprites/Default"); } _particleMaterial = new Material(val) { name = "Empress UMU Particle", hideFlags = (HideFlags)61 }; _particleMaterial.mainTexture = (Texture)(object)ParticleTexture(); return _particleMaterial; } private static Texture2D ParticleTexture() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Expected O, but got Unknown //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) Texture2D val = new Texture2D(32, 32, (TextureFormat)4, false) { name = "Empress UMU Dot", hideFlags = (HideFlags)61, wrapMode = (TextureWrapMode)1 }; Vector2 val2 = default(Vector2); ((Vector2)(ref val2))..ctor(16f, 16f); for (int i = 0; i < 32; i++) { for (int j = 0; j < 32; j++) { float num = Vector2.Distance(new Vector2((float)j + 0.5f, (float)i + 0.5f), val2) / 16f; float num2 = Mathf.Clamp01(1f - num); num2 *= num2; val.SetPixel(j, i, new Color(1f, 1f, 1f, num2)); } } val.Apply(); return val; } private static void ApplyParticleMaterial(ParticleSystem particles) { ParticleSystemRenderer component = ((Component)particles).GetComponent(); if ((Object)(object)component != (Object)null) { ((Renderer)component).material = ParticleMaterial(); } } private void EnsureAudio() { if ((Object)(object)_sfx == (Object)null) { _sfx = ((Component)this).gameObject.AddComponent(); _sfx.spatialBlend = 0f; _sfx.playOnAwake = false; _sfx.volume = 0.3f; } if ((Object)(object)_music == (Object)null) { _music = ((Component)this).gameObject.AddComponent(); _music.spatialBlend = 0f; _music.playOnAwake = false; _music.loop = true; _music.volume = 0.3f; } } private void PlaySfx(string clipName) { EnsureAudio(); AudioClip val = EmpressUmuAssets.Clip(clipName); if ((Object)(object)val != (Object)null) { _sfx.PlayOneShot(val, 0.3f); } } private void PlayMusic(string clipName) { EnsureAudio(); AudioClip val = EmpressUmuAssets.Clip(clipName); if (!((Object)(object)val == (Object)null)) { _music.clip = val; _music.volume = 0.3f; _music.Play(); } } private void StopMusic() { if ((Object)(object)_music != (Object)null) { _music.Stop(); } } private static float Hash01(int value) { int num = (value ^ (value >>> 16)) * 2146121005; int num2 = (num ^ (num >>> 15)) * -2073254261; return (float)(uint)((num2 ^ (num2 >>> 16)) & 0xFFFFFF) / 16777215f; } private static double NetworkNow() { if (!PhotonNetwork.InRoom) { return Time.realtimeSinceStartup; } return PhotonNetwork.Time; } } }