Decompiled source of PEAK CASINO v1.0.0
plugins/PeakCasino.dll
Decompiled a day ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Globalization; using System.IO; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Text; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using ExitGames.Client.Photon; using HarmonyLib; using Microsoft.CodeAnalysis; using PeakCasino.Economy; using PeakCasino.Games; using PeakCasino.Games.Blackjack; using PeakCasino.Games.Blackjack.Localization; using PeakCasino.Games.Roulette; using PeakCasino.Games.Roulette.Localization; using PeakCasino.Games.Slots; using PeakCasino.Games.Slots.Localization; using PeakCasino.Games.Wheel; using PeakCasino.Layout; using PeakCasino.Localization; using PeakCasino.Net; using PeakCasino.Npcs; using Photon.Pun; using Photon.Realtime; using TMPro; using UnityEngine; using UnityEngine.Audio; using UnityEngine.Rendering; using UnityEngine.SceneManagement; using UnityEngine.UI; using Zorro.Core; [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("ThomasAusHH")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyDescription("A full casino in the airport: slot machines, roulette and blackjack with neon signs, a bar, a cashier and casino guests.")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+a0e5513a7fba94920ad8fb39f350036776923a0a")] [assembly: AssemblyProduct("PeakCasino")] [assembly: AssemblyTitle("PeakCasino")] [assembly: AssemblyMetadata("RepositoryUrl", "https://discord.gg/nKUHvzdmVp")] [assembly: AssemblyVersion("1.0.0.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 PeakCasino { public static class CasinoAudio { private static AudioMixerGroup _sfx; private static float _nextSearch; private static AudioSource _ui; private static AudioClip _tick; private static AudioClip _win; private static AudioClip _coin; private static AudioClip _lose; public static AudioMixerGroup SfxGroup { get { if ((Object)(object)_sfx != (Object)null || Time.unscaledTime < _nextSearch) { return _sfx; } _nextSearch = Time.unscaledTime + 5f; try { SFX_Player val = Object.FindFirstObjectByType<SFX_Player>(); if ((Object)(object)val != (Object)null && (Object)(object)val.defaultMixerGroup != (Object)null) { _sfx = val.defaultMixerGroup; } if ((Object)(object)_sfx == (Object)null) { AudioMixerGroup val2 = (((Object)(object)SingletonAsset<StaticReferences>.Instance != (Object)null) ? SingletonAsset<StaticReferences>.Instance.masterMixerGroup : null); AudioMixer val3 = (((Object)(object)val2 != (Object)null) ? val2.audioMixer : null); AudioMixerGroup[] array = (((Object)(object)val3 != (Object)null) ? val3.FindMatchingGroups("SFX") : null); if (array != null && array.Length != 0) { _sfx = array[0]; } } if ((Object)(object)_sfx != (Object)null) { CasinoLog.Info("[Audio] Ausgabe ueber Mixer-Gruppe '" + ((Object)_sfx).name + "'."); } } catch (Exception ex) { CasinoLog.Warning("[Audio] Mixer-Suche fehlgeschlagen: " + ex.Message); } return _sfx; } } public static AudioClip Tick => _tick ?? (_tick = Build("PeakCasino_Tick", 0.05f, (float t, float d) => (float)(Math.Sin((double)(t * 2f) * Math.PI * 1800.0) * 0.5 + (double)Noise(t) * 0.5) * Mathf.Exp((0f - t) * 90f) * 0.8f)); public static AudioClip Win => _win ?? (_win = Build("PeakCasino_Win", 0.9f, delegate(float t, float d) { double num = ((t < 0.18f) ? 523.25 : ((t < 0.36f) ? 659.25 : 783.99)); float num2 = Mathf.Exp((0f - ((t < 0.18f) ? t : ((t < 0.36f) ? (t - 0.18f) : (t - 0.36f)))) * ((t < 0.36f) ? 9f : 3.5f)); return (float)(Math.Sin((double)(t * 2f) * Math.PI * num) * 0.6 + Math.Sin((double)(t * 2f) * Math.PI * num * 2.0) * 0.2) * num2 * 0.7f; })); public static AudioClip Coin => _coin ?? (_coin = Build("PeakCasino_Coin", 0.35f, delegate(float t, float d) { double num = Math.Sin((double)(t * 2f) * Math.PI * 2093.0) * (double)Mathf.Exp((0f - t) * 18f); if (t > 0.07f) { num += Math.Sin((double)((t - 0.07f) * 2f) * Math.PI * 2637.0) * (double)Mathf.Exp((0f - (t - 0.07f)) * 14f); } return (float)num * 0.45f; })); public static AudioClip Lose => _lose ?? (_lose = Build("PeakCasino_Lose", 0.6f, (float t, float d) => (float)Math.Sin((double)(t * 2f) * Math.PI * (double)(330f - t * 160f)) * Mathf.Exp((0f - t) * 4f) * 0.5f)); public static AudioSource Source(GameObject host, float maxDistance) { AudioSource obj = host.AddComponent<AudioSource>(); obj.playOnAwake = false; obj.spatialBlend = 1f; obj.rolloffMode = (AudioRolloffMode)1; obj.minDistance = 1.5f; obj.maxDistance = maxDistance; obj.dopplerLevel = 0f; obj.outputAudioMixerGroup = SfxGroup; return obj; } public static void Play(AudioSource source, AudioClip clip, float volume = 1f, float pitch = 1f) { if (!((Object)(object)source == (Object)null) && !((Object)(object)clip == (Object)null)) { if ((Object)(object)source.outputAudioMixerGroup == (Object)null) { source.outputAudioMixerGroup = SfxGroup; } source.pitch = pitch; source.PlayOneShot(clip, volume * Plugin.SoundVolume.Value); } } public static void PlayUi(AudioClip clip, float volume = 1f) { //IL_0012: 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: Expected O, but got Unknown if ((Object)(object)_ui == (Object)null) { GameObject val = new GameObject("PeakCasino_Audio"); Object.DontDestroyOnLoad((Object)val); _ui = val.AddComponent<AudioSource>(); _ui.playOnAwake = false; _ui.spatialBlend = 0f; } Play(_ui, clip, volume); } private static float Noise(float t) { return Mathf.PerlinNoise(t * 9000f, 0.37f) * 2f - 1f; } private static AudioClip Build(string name, float seconds, Func<float, float, float> sample) { int num = Mathf.CeilToInt(seconds * 44100f); float[] array = new float[num]; for (int i = 0; i < num; i++) { float num2 = (float)i / 44100f; float num3 = Mathf.Clamp01((seconds - num2) / 0.02f); array[i] = Mathf.Clamp(sample(num2, seconds) * num3, -1f, 1f); } AudioClip obj = AudioClip.Create(name, num, 1, 44100, false); obj.SetData(array, 0); return obj; } } internal static class CasinoBundle { private const string ResourceName = "PeakCasino.Assets.peakcasino.bundle"; private static AssetBundle _bundle; private static bool _tried; private static readonly Dictionary<string, GameObject> Prefabs = new Dictionary<string, GameObject>(StringComparer.OrdinalIgnoreCase); private static readonly List<string> Names = new List<string>(); public static IReadOnlyList<string> PrefabNames { get { Ensure(); return Names; } } public static GameObject Get(string name) { Ensure(); if (!Prefabs.TryGetValue(name, out var value)) { return null; } return value; } private static void Ensure() { if (_tried) { return; } _tried = true; try { using Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("PeakCasino.Assets.peakcasino.bundle"); if (stream == null) { CasinoLog.Warning("[Bundle] Kein eingebettetes Bundle."); return; } using MemoryStream memoryStream = new MemoryStream(); stream.CopyTo(memoryStream); byte[] array = memoryStream.ToArray(); _bundle = AssetBundle.LoadFromMemory(array); if ((Object)(object)_bundle == (Object)null) { CasinoLog.Warning($"[Bundle] AssetBundle.LoadFromMemory lieferte null ({array.Length} Bytes)."); return; } GameObject[] array2 = _bundle.LoadAllAssets<GameObject>(); foreach (GameObject val in array2) { RebindShaders(val); Prefabs[((Object)val).name] = val; Names.Add(((Object)val).name); } Names.Sort(StringComparer.OrdinalIgnoreCase); CasinoLog.Info($"[Bundle] Geladen: {array.Length / 1024} KB, {Names.Count} Prefabs."); } catch (Exception arg) { CasinoLog.Error($"[Bundle] Laden fehlgeschlagen: {arg}"); } } private static void RebindShaders(GameObject prefab) { Renderer[] componentsInChildren = prefab.GetComponentsInChildren<Renderer>(true); for (int i = 0; i < componentsInChildren.Length; i++) { Material[] sharedMaterials = componentsInChildren[i].sharedMaterials; foreach (Material val in sharedMaterials) { if (!((Object)(object)val == (Object)null) && !((Object)(object)val.shader == (Object)null)) { Shader val2 = Shader.Find(((Object)val.shader).name); if ((Object)(object)val2 != (Object)null && (Object)(object)val2 != (Object)(object)val.shader) { val.shader = val2; } } } } } } public enum CasinoLogLevel { Error, Warning, Info, Debug } internal static class CasinoLog { private const string Prefix = "[PeakCasino] "; public static void Error(string message) { if (Enabled(CasinoLogLevel.Error)) { Plugin.Log.LogError((object)("[PeakCasino] " + message)); } } public static void Warning(string message) { if (Enabled(CasinoLogLevel.Warning)) { Plugin.Log.LogWarning((object)("[PeakCasino] " + message)); } } public static void Info(string message) { if (Enabled(CasinoLogLevel.Info)) { Plugin.Log.LogInfo((object)("[PeakCasino] " + message)); } } public static void Debug(string message) { if (Enabled(CasinoLogLevel.Debug)) { Plugin.Log.LogInfo((object)("[PeakCasino] " + message)); } } private static bool Enabled(CasinoLogLevel level) { if (Plugin.Log == null) { return false; } CasinoLogLevel casinoLogLevel = ((Plugin.LogLevel != null) ? Plugin.LogLevel.Value : CasinoLogLevel.Info); return level <= casinoLogLevel; } } internal static class Fonts { private static TMP_FontAsset _font; private static bool _searched; public static TMP_FontAsset Font { get { if ((Object)(object)_font != (Object)null || _searched) { return _font; } try { TMP_FontAsset val = null; TMP_FontAsset[] array = Resources.FindObjectsOfTypeAll<TMP_FontAsset>(); foreach (TMP_FontAsset val2 in array) { if (!((Object)(object)val2 == (Object)null)) { string text = ((Object)val2).name.ToLowerInvariant(); if (text.Contains("daruma")) { _font = val2; break; } if ((Object)(object)val == (Object)null && !text.Contains("icon") && !text.Contains("emoji") && !text.Contains("sprite")) { val = val2; } } } if ((Object)(object)_font == (Object)null) { _font = val; } if ((Object)(object)_font != (Object)null) { _searched = true; } } catch (Exception ex) { CasinoLog.Warning("[Fonts] Suche fehlgeschlagen: " + ex.Message); } return _font; } } public static TextMeshPro CreateText(Transform anchor, float widthCm, float heightCm, Color color, float minSize, float maxSize) { //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_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0027: 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_008c: Unknown result type (might be due to invalid IL or missing references) try { GameObject val = new GameObject("Text"); val.transform.SetParent(anchor, false); val.transform.localScale = Vector3.one * 0.01f; TextMeshPro val2 = val.AddComponent<TextMeshPro>(); if ((Object)(object)Font != (Object)null) { ((TMP_Text)val2).font = Font; } ((TMP_Text)val2).rectTransform.sizeDelta = new Vector2(widthCm, heightCm); ((TMP_Text)val2).alignment = (TextAlignmentOptions)514; ((TMP_Text)val2).enableAutoSizing = true; ((TMP_Text)val2).fontSizeMin = minSize; ((TMP_Text)val2).fontSizeMax = maxSize; ((TMP_Text)val2).fontSize = maxSize; ((Graphic)val2).color = color; ((TMP_Text)val2).text = ""; return val2; } catch (Exception ex) { CasinoLog.Warning("[Fonts] Text an '" + ((Object)anchor).name + "' fehlgeschlagen: " + ex.Message); return null; } } } [BepInPlugin("com.thomasaushh.peakcasino", "PEAK CASINO", "1.0.0")] [BepInDependency(/*Could not decode attribute arguments.*/)] public class Plugin : BaseUnityPlugin { public const string PluginGuid = "com.thomasaushh.peakcasino"; public const string PluginName = "PEAK CASINO"; public const string PluginVersion = "1.0.0"; public const string VersionLabel = ""; public const string AirportRemixedGuid = "tony4twentys.Airport_Remixed"; public static string DisplayVersion { get { if (!string.IsNullOrEmpty("")) { return "1.0.0 "; } return "1.0.0"; } } internal static ManualLogSource Log { get; private set; } internal static Plugin Instance { get; private set; } internal static bool AirportRemixed { get; private set; } internal static ConfigEntry<CasinoLogLevel> LogLevel { get; private set; } internal static ConfigEntry<float> SoundVolume { get; private set; } internal static ConfigEntry<float> AttractVolume { get; private set; } internal static ConfigEntry<bool> PeakShader { get; private set; } internal static ConfigEntry<float> BettingSeconds { get; private set; } internal static ConfigEntry<float> TurnSeconds { get; private set; } internal static ConfigEntry<int> MaxChipsPerRound { get; private set; } private void Awake() { //IL_0080: Unknown result type (might be due to invalid IL or missing references) Instance = this; Log = ((BaseUnityPlugin)this).Logger; AirportRemixed = Chainloader.PluginInfos.ContainsKey("tony4twentys.Airport_Remixed"); InitializeConfig(); CasinoLog.Info("PEAK CASINO " + DisplayVersion + " geladen. Airport Remixed: " + (AirportRemixed ? "ja" : "nein") + "."); PeakCasino.Localization.Loc.Initialize(); CasinoNet.Register(); try { new Harmony("com.thomasaushh.peakcasino").PatchAll(typeof(Plugin).Assembly); } catch (Exception arg) { CasinoLog.Error($"[Plugin] Harmony-Patches fehlgeschlagen: {arg}"); } SceneManager.sceneLoaded += OnSceneLoaded; } private void InitializeConfig() { //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Expected O, but got Unknown //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Expected O, but got Unknown //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Expected O, but got Unknown //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Expected O, but got Unknown //IL_0158: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Expected O, but got Unknown LogLevel = ((BaseUnityPlugin)this).Config.Bind<CasinoLogLevel>("Logging", "LogLevel", CasinoLogLevel.Info, "Wie gespraechig der Mod im BepInEx-Log ist."); SoundVolume = ((BaseUnityPlugin)this).Config.Bind<float>("Audio", "Volume", 1f, new ConfigDescription("Lautstaerke der Spiele, zusaetzlich zu Master- und SFX-Regler. 0 = stumm.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 2f), Array.Empty<object>())); AttractVolume = ((BaseUnityPlugin)this).Config.Bind<float>("Audio", "AttractVolume", 0.6f, new ConfigDescription("Lockmelodie der Automaten im Leerlauf, zusaetzlich zu Audio.Volume. 0 = aus.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 2f), Array.Empty<object>())); PeakShader = ((BaseUnityPlugin)this).Config.Bind<bool>("Visuals", "PeakShader", true, "Spiele im Spiel-Look (Shader W/Peak_Standard). Aus = glattes URP-Material."); BettingSeconds = ((BaseUnityPlugin)this).Config.Bind<float>("Tables", "BettingSeconds", 15f, new ConfigDescription("Roulette und Blackjack: Sekunden zum Setzen, bevor die Runde beginnt.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(5f, 60f), Array.Empty<object>())); TurnSeconds = ((BaseUnityPlugin)this).Config.Bind<float>("Tables", "TurnSeconds", 20f, new ConfigDescription("Blackjack: Bedenkzeit je Zug.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(5f, 60f), Array.Empty<object>())); MaxChipsPerRound = ((BaseUnityPlugin)this).Config.Bind<int>("Tables", "MaxChipsPerRound", 20, new ConfigDescription("Hoechstens so viele Tisch-Chips je Spieler und Runde.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 100), Array.Empty<object>())); } private void OnSceneLoaded(Scene scene, LoadSceneMode mode) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) try { if ((int)mode == 0) { CasinoLog.Info("[Plugin] Szene '" + ((Scene)(ref scene)).name + "' geladen."); PeakCasino.Localization.Loc.Refresh(); CasinoBuilder.OnSceneLoaded(((Scene)(ref scene)).name); Shop.OnSceneLoaded(((Scene)(ref scene)).name); } } catch (Exception arg) { CasinoLog.Error($"[Plugin] Fehler in OnSceneLoaded: {arg}"); } } private void Update() { NpcDialog.Update(); } private void OnGUI() { NpcDialog.OnGUI(); Toast.OnGUI(); } private void OnDestroy() { SceneManager.sceneLoaded -= OnSceneLoaded; } } internal static class BuildInfo { public const string Version = "1.0.0"; public const string Label = ""; public const string ProductName = "PEAK CASINO"; } } namespace PeakCasino.Npcs { [HarmonyPatch(typeof(CursorHandler), "Update")] internal static class DialogCursorPatch { [HarmonyPrefix] private static bool Prefix() { //IL_0009: Unknown result type (might be due to invalid IL or missing references) if (!NpcDialog.IsOpen) { return true; } if ((int)Cursor.lockState != 0) { Cursor.lockState = (CursorLockMode)0; } if (!Cursor.visible) { Cursor.visible = true; } return false; } } [HarmonyPatch(typeof(CharacterInput), "Sample")] internal static class DialogInputPatch { private static readonly MethodInfo ResetInput = AccessTools.Method(typeof(CharacterInput), "ResetInput", (Type[])null, (Type[])null); [HarmonyPrefix] private static bool Prefix(CharacterInput __instance) { if (!NpcDialog.IsOpen) { return true; } ResetInput?.Invoke(__instance, null); return false; } } public sealed class NpcBody : MonoBehaviour { private const float SitPoseHeight = 0.44f; private const float ShinLength = 0.285f; private const float WalkSpeed = 1.15f; private const float TurnSpeed = 240f; private Animation _anim; private Coroutine _move; private Coroutine _gesture; private TextMeshPro _bubble; private float _bubbleUntil; private Transform _lookTarget; private float _lookUntil; private float _baseYaw; private float _seatFloorY; private Transform _upperL; private Transform _upperR; private Transform _lowerL; private Transform _lowerR; private Transform _footL; private Transform _footR; public string DisplayName { get; private set; } public bool Sitting { get; private set; } public bool Moving => _move != null; public static NpcBody Spawn(string figure, string displayName, int seed, bool tintClothes, Vector3 pos, float yaw, Transform parent) { //IL_0032: 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_0090: Unknown result type (might be due to invalid IL or missing references) GameObject val = CasinoBundle.Get("Npc_" + figure); if ((Object)(object)val == (Object)null) { CasinoLog.Warning("[Npc] Figur '" + figure + "' fehlt im Bundle."); return null; } GameObject obj = Object.Instantiate<GameObject>(val, pos, Quaternion.Euler(0f, yaw, 0f), parent); ((Object)obj).name = "Npc_" + displayName; NpcLook.Apply(obj, seed, tintClothes); NpcBody npcBody = obj.AddComponent<NpcBody>(); npcBody.DisplayName = displayName; npcBody._baseYaw = yaw; CapsuleCollider obj2 = obj.AddComponent<CapsuleCollider>(); obj2.center = new Vector3(0f, 1.6f, 0f); obj2.height = 3.2f; obj2.radius = 0.4f; return npcBody; } private void Awake() { //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Expected O, but got Unknown _anim = ((Component)this).GetComponent<Animation>(); if ((Object)(object)_anim != (Object)null) { foreach (AnimationState item in _anim) { AnimationState val = item; val.wrapMode = (WrapMode)((val.name == "Idle" || val.name == "Walk") ? 2 : 8); } if ((TrackedReference)(object)_anim["Idle"] != (TrackedReference)null) { _anim["Idle"].normalizedTime = Random.value; } _anim.Play("Idle"); } Transform[] componentsInChildren = ((Component)this).GetComponentsInChildren<Transform>(true); foreach (Transform val2 in componentsInChildren) { switch (((Object)val2).name) { case "UpperLeg.L": _upperL = val2; break; case "UpperLeg.R": _upperR = val2; break; case "LowerLeg.L": _lowerL = val2; break; case "LowerLeg.R": _lowerR = val2; break; case "Foot.L": _footL = val2; break; case "Foot.R": _footR = val2; break; } } } private void BendLegs() { Bend(_upperL, _lowerL, _footL); Bend(_upperR, _lowerR, _footR); } private static void Bend(Transform upper, Transform lower, Transform foot) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001f: 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_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0035: 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_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_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_006e: 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_007e: 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) if (!((Object)(object)upper == (Object)null) && !((Object)(object)lower == (Object)null)) { upper.localRotation *= Quaternion.AngleAxis(-70f, Vector3.right); lower.localRotation *= Quaternion.AngleAxis(75f, Vector3.right); if ((Object)(object)foot != (Object)null) { foot.position = lower.position + lower.up * 0.285f * lower.lossyScale.y / 0.54f; } } } private void Fade(string state, float time = 0.25f) { if (!((Object)(object)_anim == (Object)null) && !((TrackedReference)(object)_anim[state] == (TrackedReference)null)) { _anim[state].time = 0f; _anim.CrossFade(state, time); } } public void Gesture(string state) { if (!((Object)(object)_anim == (Object)null) && !((TrackedReference)(object)_anim[state] == (TrackedReference)null) && !Moving && (!Sitting || !(state != "PickUp"))) { if (_gesture != null) { ((MonoBehaviour)this).StopCoroutine(_gesture); } _gesture = ((MonoBehaviour)this).StartCoroutine(GestureRoutine(state)); } } private IEnumerator GestureRoutine(string state) { if (Sitting) { yield return (object)new WaitForSeconds(0.1f); _gesture = null; yield break; } Fade(state, 0.2f); yield return (object)new WaitForSeconds(_anim[state].length); if (!Sitting && !Moving) { Fade("Idle", 0.3f); } _gesture = null; } public void WalkTo(Vector3 target, float yaw, Action arrived = null) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) if (_move != null) { ((MonoBehaviour)this).StopCoroutine(_move); } _move = ((MonoBehaviour)this).StartCoroutine(WalkRoutine(target, yaw, arrived)); } private IEnumerator WalkRoutine(Vector3 target, float yaw, Action arrived) { //IL_000e: 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) if (Sitting) { yield return StandUpRoutine(); } Vector3 val = target - ((Component)this).transform.position; val.y = 0f; if (((Vector3)(ref val)).sqrMagnitude > 0.01f) { Fade("Walk"); while (true) { Vector3 val2 = target - ((Component)this).transform.position; val2.y = 0f; if (((Vector3)(ref val2)).magnitude < 0.05f) { break; } Quaternion val3 = Quaternion.LookRotation(((Vector3)(ref val2)).normalized, Vector3.up); ((Component)this).transform.rotation = Quaternion.RotateTowards(((Component)this).transform.rotation, val3, 240f * Time.deltaTime); float num = Mathf.Min(((Vector3)(ref val2)).magnitude, 1.15f * Time.deltaTime); Vector3 position = ((Component)this).transform.position + ((Vector3)(ref val2)).normalized * num; position.y = Mathf.MoveTowards(((Component)this).transform.position.y, target.y, num); ((Component)this).transform.position = position; yield return null; } ((Component)this).transform.position = target; } _baseYaw = yaw; Quaternion end = Quaternion.Euler(0f, yaw, 0f); while (Quaternion.Angle(((Component)this).transform.rotation, end) > 1f) { ((Component)this).transform.rotation = Quaternion.RotateTowards(((Component)this).transform.rotation, end, 240f * Time.deltaTime); yield return null; } Fade("Idle"); _move = null; arrived?.Invoke(); } public void Place(Vector3 pos, float yaw) { //IL_0006: 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) ((Component)this).transform.position = pos; ((Component)this).transform.rotation = Quaternion.Euler(0f, yaw, 0f); _baseYaw = yaw; } public void SetWalking(bool walking) { if (!((Object)(object)_anim == (Object)null)) { string text = (walking ? "Walk" : "Idle"); if (!_anim.IsPlaying(text)) { Fade(text); } } } public void SitAt(Vector3 seatFloor, float yaw, float seatHeight) { //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_0030: 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) //IL_004b: Unknown result type (might be due to invalid IL or missing references) if (_move != null) { ((MonoBehaviour)this).StopCoroutine(_move); } _move = null; Sitting = true; _seatFloorY = seatFloor.y; Place(seatFloor + Vector3.up * Mathf.Max(0f, seatHeight - 0.44f), yaw); Fade("Idle", 0.2f); } public void StandUp(Action done = null) { if (!Sitting) { done?.Invoke(); } else { ((MonoBehaviour)this).StartCoroutine(StandUpThen(done)); } } private IEnumerator StandUpThen(Action done) { yield return StandUpRoutine(); done?.Invoke(); } private IEnumerator StandUpRoutine() { Sitting = false; float startY = ((Component)this).transform.position.y; float floorY = _seatFloorY; float t = 0f; while (t < 0.35f) { t += Time.deltaTime; Vector3 position = ((Component)this).transform.position; position.y = Mathf.Lerp(startY, floorY, Mathf.Clamp01(t / 0.35f)); ((Component)this).transform.position = position; yield return null; } Fade("Idle"); } public void LookAt(Transform target, float seconds = 4f) { _lookTarget = target; _lookUntil = Time.time + seconds; } public void Say(string text, float seconds = 4f) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_006e: 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_008d: 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) if ((Object)(object)_bubble == (Object)null) { GameObject val = new GameObject("Bubble"); val.transform.SetParent(((Component)this).transform, false); val.transform.localPosition = new Vector3(0f, 2.55f / Mathf.Max(0.01f, ((Component)this).transform.localScale.y), 0f); val.transform.localScale = Vector3.one / Mathf.Max(0.01f, ((Component)this).transform.localScale.x); _bubble = Fonts.CreateText(val.transform, 200f, 90f, Color.white, 60f, 110f); if ((Object)(object)_bubble != (Object)null) { ((TMP_Text)_bubble).outlineWidth = 0f; ((TMP_Text)_bubble).textWrappingMode = (TextWrappingModes)1; ((TMP_Text)_bubble).alignment = (TextAlignmentOptions)1026; Material fontMaterial = ((TMP_Text)_bubble).fontMaterial; fontMaterial.SetFloat("unity_GUIZTestMode", 8f); fontMaterial.renderQueue = 4000; } } if (!((Object)(object)_bubble == (Object)null)) { ((TMP_Text)_bubble).text = "<mark=#000000B8 padding=\"16,16,8,8\">" + text + "</mark>"; ((Component)_bubble).gameObject.SetActive(true); _bubbleUntil = Time.time + seconds; } } private void LateUpdate() { //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_015f: 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_0170: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: 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_010d: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_013a: 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_00ad: 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_00bc: Unknown result type (might be due to invalid IL or missing references) if (Sitting) { BendLegs(); } if ((Object)(object)_bubble != (Object)null && ((Component)_bubble).gameObject.activeSelf) { if (Time.time > _bubbleUntil) { ((Component)_bubble).gameObject.SetActive(false); } else { Transform val = (((Object)(object)MainCamera.instance != (Object)null) ? ((Component)MainCamera.instance).transform : (((Object)(object)Camera.main != (Object)null) ? ((Component)Camera.main).transform : null)); if ((Object)(object)val != (Object)null) { _bubble.transform.rotation = Quaternion.LookRotation(_bubble.transform.position - val.position, Vector3.up); } } } if (Moving) { return; } Quaternion val3; if ((Object)(object)_lookTarget != (Object)null && Time.time < _lookUntil && !Sitting) { Vector3 val2 = _lookTarget.position - ((Component)this).transform.position; val2.y = 0f; if (((Vector3)(ref val2)).sqrMagnitude < 0.01f) { return; } val3 = Quaternion.LookRotation(((Vector3)(ref val2)).normalized, Vector3.up); } else { val3 = Quaternion.Euler(0f, _baseYaw, 0f); } ((Component)this).transform.rotation = Quaternion.RotateTowards(((Component)this).transform.rotation, val3, 180f * Time.deltaTime); } } public static class NpcDialog { public sealed class Option { public string Text; public bool Enabled = true; public Action Choose; public Option(string text, Action choose, bool enabled = true) { Text = text; Choose = choose; Enabled = enabled; } } private const float MaxDistance = 5f; private static NpcBody _speaker; private static Vector3 _anchor; private static string _title; private static string _body; private static readonly List<Option> Options = new List<Option>(); private static int _openedFrame; private static Texture2D _white; private static GUIStyle _nameStyle; private static GUIStyle _textStyle; private static GUIStyle _optionStyle; public static bool IsOpen { get; private set; } public static void Show(NpcBody speaker, Vector3 anchor, string title, string body, IEnumerable<Option> options) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) _speaker = speaker; _anchor = anchor; _title = title; _body = body; Options.Clear(); Options.AddRange(options); if (!IsOpen) { _openedFrame = Time.frameCount; } IsOpen = true; Character localCharacter = Character.localCharacter; if ((Object)(object)speaker != (Object)null && (Object)(object)localCharacter != (Object)null) { speaker.LookAt(((Component)localCharacter).transform, 3600f); } } public static void Close() { if (IsOpen) { IsOpen = false; if ((Object)(object)_speaker != (Object)null) { _speaker.LookAt(null, 0f); } _speaker = null; Options.Clear(); } } private static void Choose(int index) { if (index < 0 || index >= Options.Count || !Options[index].Enabled) { return; } try { Options[index].Choose?.Invoke(); } catch (Exception arg) { CasinoLog.Error($"[Dialog] {arg}"); Close(); } } public static void Update() { //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) if (!IsOpen) { return; } Character localCharacter = Character.localCharacter; if ((Object)(object)localCharacter == (Object)null || (Object)(object)localCharacter.data == (Object)null || localCharacter.data.dead || Vector3.Distance(localCharacter.Center, _anchor) > 5f) { Close(); } else { if (Time.frameCount == _openedFrame) { return; } try { if (Input.GetKeyDown((KeyCode)27)) { Close(); return; } for (int i = 0; i < Mathf.Min(9, Options.Count); i++) { if (Input.GetKeyDown((KeyCode)(49 + i)) || Input.GetKeyDown((KeyCode)(257 + i))) { Choose(i); break; } } } catch (InvalidOperationException) { } } } private static void Fill(Rect r, Color c) { //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: 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_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Expected O, but got Unknown //IL_0020: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_white == (Object)null) { _white = new Texture2D(1, 1); _white.SetPixel(0, 0, Color.white); _white.Apply(); } Color color = GUI.color; GUI.color = c; GUI.DrawTexture(r, (Texture)(object)_white); GUI.color = color; } public static void OnGUI() { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: 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_004d: Expected O, but got Unknown //IL_005e: 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_006a: 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_007d: Expected O, but got Unknown //IL_00d5: 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_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Expected O, but got Unknown //IL_01c5: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Invalid comparison between Unknown and I4 //IL_008e: 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_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Expected O, but got Unknown //IL_0259: 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_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01e3: Unknown result type (might be due to invalid IL or missing references) //IL_0209: 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_02fe: 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_0318: Invalid comparison between Unknown and I4 //IL_031a: Unknown result type (might be due to invalid IL or missing references) //IL_03a2: 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_03d8: Unknown result type (might be due to invalid IL or missing references) //IL_0406: 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_0380: Unknown result type (might be due to invalid IL or missing references) //IL_0344: Unknown result type (might be due to invalid IL or missing references) if (!IsOpen) { return; } float num = Mathf.Clamp((float)Screen.height / 1080f, 0.75f, 2f); if (_nameStyle == null) { _nameStyle = new GUIStyle(GUI.skin.label) { fontStyle = (FontStyle)1, alignment = (TextAnchor)3 }; } if (_textStyle == null) { _textStyle = new GUIStyle(GUI.skin.label) { wordWrap = true, alignment = (TextAnchor)0, richText = true }; } if (_optionStyle == null) { _optionStyle = new GUIStyle(GUI.skin.label) { alignment = (TextAnchor)3, richText = true }; } _nameStyle.fontSize = Mathf.RoundToInt(22f * num); _nameStyle.normal.textColor = new Color(1f, 0.82f, 0.4f); _textStyle.fontSize = Mathf.RoundToInt(18f * num); _textStyle.normal.textColor = Color.white; _optionStyle.fontSize = Mathf.RoundToInt(17f * num); float num2 = Mathf.Min(780f * num, (float)Screen.width - 40f); float num3 = _textStyle.CalcHeight(new GUIContent(_body), num2 - 48f * num); float num4 = 38f * num; float num5 = 18f * num + 32f * num + num3 + 16f * num + (float)Options.Count * (num4 + 6f * num) + 14f * num; Rect r = default(Rect); ((Rect)(ref r))..ctor(((float)Screen.width - num2) * 0.5f, (float)Screen.height - num5 - 40f * num, num2, num5); if ((int)Event.current.type == 7) { Fill(r, new Color(0.08f, 0.05f, 0.06f, 0.92f)); Fill(new Rect(((Rect)(ref r)).x, ((Rect)(ref r)).y, ((Rect)(ref r)).width, 4f * num), new Color(1f, 0.72f, 0.25f)); } float num6 = ((Rect)(ref r)).y + 16f * num; GUI.Label(new Rect(((Rect)(ref r)).x + 24f * num, num6, num2 - 48f * num, 30f * num), _title, _nameStyle); num6 += 34f * num; GUI.Label(new Rect(((Rect)(ref r)).x + 24f * num, num6, num2 - 48f * num, num3), _body, _textStyle); num6 += num3 + 16f * num; Rect r2 = default(Rect); for (int i = 0; i < Options.Count; i++) { Option option = Options[i]; ((Rect)(ref r2))..ctor(((Rect)(ref r)).x + 24f * num, num6, num2 - 48f * num, num4); bool flag = option.Enabled && ((Rect)(ref r2)).Contains(Event.current.mousePosition); if ((int)Event.current.type == 7) { Fill(r2, flag ? new Color(1f, 0.72f, 0.25f, 0.9f) : new Color(1f, 1f, 1f, option.Enabled ? 0.09f : 0.03f)); } _optionStyle.normal.textColor = (Color)((!option.Enabled) ? new Color(1f, 1f, 1f, 0.35f) : (flag ? Color.black : Color.white)); GUI.Label(new Rect(((Rect)(ref r2)).x + 14f * num, ((Rect)(ref r2)).y, ((Rect)(ref r2)).width - 20f * num, ((Rect)(ref r2)).height), $"{i + 1} {option.Text}", _optionStyle); if ((int)Event.current.type == 0 && Event.current.button == 0 && flag) { Event.current.Use(); Choose(i); break; } num6 += num4 + 6f * num; } } } public static class NpcDirector { private static readonly string[] Names = new string[56] { "Maggie", "Sam", "Lou", "Vito", "Rosa", "Ike", "Dolores", "Frankie", "Mei", "Otto", "Priya", "Hank", "Ines", "Juno", "Kofi", "Lena", "Marco", "Nia", "Oskar", "Pearl", "Quinn", "Ravi", "Sofia", "Tariq", "Uma", "Vince", "Wanda", "Yuki", "Zeke", "Amara", "Bruno", "Celia", "Dmitri", "Esme", "Femi", "Greta", "Hugo", "Ilse", "Jamal", "Kiri", "Lars", "Mina", "Noor", "Olga", "Pablo", "Rina", "Sven", "Tess", "Ulli", "Vera", "Wes", "Xena", "Yara", "Zola", "Bea", "Cyrus" }; private static int _count; private static Transform _root; private static int _seatCounter; public static void Populate(Transform casino, CasinoLayoutData data) { //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_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Expected O, but got Unknown //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Expected O, but got Unknown _count = 0; TablePatrons.Clear(); GameObject val = new GameObject("Npcs"); val.transform.SetParent(casino, false); _root = val.transform; try { foreach (Transform item in casino) { Staff(item); } foreach (GameRegistry.Entry item2 in GameRegistry.All) { Players(item2); } foreach (Transform item3 in casino) { Guests(item3); } Wanderers(data); Watchers(data); } catch (Exception arg) { CasinoLog.Error($"[Npc] Verteilen fehlgeschlagen: {arg}"); } CasinoLog.Info($"[Npc] {_count} NPCs im Casino."); } private static string NextName() { return Names[_count % Names.Length]; } private static NpcBody Make(string role, string[] figures, Vector3 pos, float yaw, int lines, bool tintClothes = true) { //IL_0026: Unknown result type (might be due to invalid IL or missing references) int seed = 1000 + _count * 31; NpcBody npcBody = NpcBody.Spawn(figures[(_count * 7 + 3) % figures.Length], NextName(), seed, tintClothes, pos, yaw, _root); _count++; if ((Object)(object)npcBody == (Object)null) { return null; } NpcTalk npcTalk = ((Component)npcBody).gameObject.AddComponent<NpcTalk>(); npcTalk.Role = role; npcTalk.LineCount = lines; return npcBody; } private static Transform Find(Transform t, string name) { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Expected O, but got Unknown if (((Object)t).name == name) { return t; } foreach (Transform item in t) { Transform val = Find(item, name); if ((Object)(object)val != (Object)null) { return val; } } return null; } private static float Yaw(Transform t) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) Quaternion rotation = t.rotation; return ((Quaternion)(ref rotation)).eulerAngles.y; } private static void Staff(Transform piece) { //IL_0119: 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) //IL_0165: 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_01df: Unknown result type (might be due to invalid IL or missing references) switch (((Object)piece).name) { case "CashierCage": { Cashier component = ((Component)piece).GetComponent<Cashier>(); string[] array2 = new string[2] { "Staff_0", "Staff_1" }; foreach (string name in array2) { Transform val = Find(piece, name); if ((Object)(object)val == (Object)null) { continue; } NpcBody npcBody = Make("cashier", NpcLook.Staff, val.position, Yaw(val), 4, tintClothes: false); if (!((Object)(object)npcBody == (Object)null) && !((Object)(object)component == (Object)null)) { if ((Object)(object)component.Attendant == (Object)null) { component.Attendant = npcBody; } ((Component)npcBody).GetComponent<NpcTalk>().Desk = component; } } break; } case "BarCounter": { Transform val3 = Find(piece, "Staff_0"); if ((Object)(object)val3 != (Object)null) { Make("bartender", new string[2] { "Chef_Male", "Suit_Female" }, val3.position, Yaw(val3), 4, tintClothes: false); } break; } case "Stage": { Transform val2 = Find(piece, "Performer_0"); if ((Object)(object)val2 != (Object)null) { NpcBody npcBody2 = Make("performer", new string[2] { "Kimono_Female", "Suit_Female" }, val2.position, Yaw(val2), 4, tintClothes: false); if ((Object)(object)npcBody2 != (Object)null) { ((Component)npcBody2).gameObject.AddComponent<NpcPerformer>().Setup(piece, val2); } } break; } case "CasinoPortal": { float yaw = Yaw(piece); float[] array = new float[2] { -1.35f, 1.35f }; foreach (float num in array) { Make("bouncer", NpcLook.Staff, piece.TransformPoint(new Vector3(num, 0f, 0.9f)), yaw, 4, tintClothes: false); } break; } } } private static void Players(GameRegistry.Entry game) { //IL_00da: 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) //IL_004b: 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_0060: Unknown result type (might be due to invalid IL or missing references) //IL_006a: 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) //IL_0074: 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_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_0179: 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_01f7: Unknown result type (might be due to invalid IL or missing references) //IL_01fc: Unknown result type (might be due to invalid IL or missing references) //IL_020c: Unknown result type (might be due to invalid IL or missing references) //IL_0211: Unknown result type (might be due to invalid IL or missing references) //IL_0218: 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_022e: Unknown result type (might be due to invalid IL or missing references) //IL_0233: Unknown result type (might be due to invalid IL or missing references) //IL_0238: Unknown result type (might be due to invalid IL or missing references) //IL_0242: Unknown result type (might be due to invalid IL or missing references) //IL_0247: Unknown result type (might be due to invalid IL or missing references) //IL_024c: Unknown result type (might be due to invalid IL or missing references) Transform transform = game.Root.transform; if (game.Game == "jackpot") { return; } if (game.Game == "slots") { if ((game.Id - 1000) % 3 == 0) { Vector3 forward = transform.forward; forward.y = 0f; Vector3 val = transform.position + ((Vector3)(ref forward)).normalized * 0.75f; NpcBody npcBody = Make("slots", NpcLook.Guests, val, Yaw(transform) + 180f, 4); if (!((Object)(object)npcBody == (Object)null)) { ((Component)npcBody).gameObject.AddComponent<SlotPatron>().Setup(game.Id, transform, val); } } return; } Transform val2 = Find(transform, "Dealer"); if ((Object)(object)val2 != (Object)null) { Make("dealer", NpcLook.Staff, val2.position, Yaw(val2), 4, tintClothes: false); } string[] array = ((!(game.Game == "blackjack")) ? new string[2] { "Seat_0", "Seat_2" } : new string[2] { "Seat_1", "Seat_3" }); foreach (string name in array) { Transform val3 = Find(transform, name); if (!((Object)(object)val3 == (Object)null)) { float num = Yaw(val3); Vector3 val4 = Quaternion.Euler(0f, num, 0f) * Vector3.back; NpcBody npcBody2 = Make((game.Game == "blackjack") ? "blackjack" : "roulette", NpcLook.Guests, val3.position, num, 4); if (!((Object)(object)npcBody2 == (Object)null)) { TablePatrons.Add(game.Id, new NpcPatron { Name = npcBody2.DisplayName, Body = npcBody2, Seed = 7 + game.Id * 13 + _count, SeatPos = val3.position, SeatYaw = num, WatchPos = val3.position + val4 * 1.3f + Quaternion.Euler(0f, num, 0f) * Vector3.right * 0.4f }); } } } } private static void Guests(Transform piece) { //IL_0064: 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_0087: 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_00cf: 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) switch (((Object)piece).name) { case "LoungeSofa": case "LoungeChair": { Transform val = Find(piece, "Seat_0"); if (!((Object)(object)val == (Object)null) && _seatCounter++ % 2 == 0) { Make("guest", NpcLook.Guests, piece.position, Yaw(val), 6)?.SitAt(new Vector3(val.position.x, piece.position.y, val.position.z), Yaw(val), 0.51f); } break; } case "BarStool": if (_seatCounter++ % 3 == 0) { Make("guest", NpcLook.Guests, piece.position, Yaw(piece) + 180f, 6)?.SitAt(piece.position, Yaw(piece) + 180f, 0.78f); } break; } } private static void Wanderers(CasinoLayoutData data) { //IL_002b: Unknown result type (might be due to invalid IL or missing references) foreach (CasinoLayoutData.WanderData item in data.Wander) { for (int i = 0; i < item.Count; i++) { NpcBody npcBody = Make("guest", NpcLook.Guests, item.Path[0], 0f, 6); if (npcBody != null) { ((Component)npcBody).gameObject.AddComponent<NpcWanderer>().Setup(item.Path, (float)i / (float)item.Count); } } } } private static void Watchers(CasinoLayoutData data) { //IL_0021: Unknown result type (might be due to invalid IL or missing references) foreach (CasinoLayoutData.WatcherData watcher in data.Watchers) { Make("guest", NpcLook.Guests, watcher.Pos, watcher.Yaw, 6); } } } public static class NpcLook { public static readonly string[] Guests = new string[14] { "Casual_Male", "Casual_Female", "Casual2_Male", "Casual2_Female", "Casual3_Male", "Casual3_Female", "Casual_Bald", "OldClassy_Male", "OldClassy_Female", "Cowboy_Male", "Cowboy_Female", "Kimono_Female", "Suit_Male", "Suit_Female" }; public static readonly string[] Staff = new string[2] { "Suit_Male", "Suit_Female" }; public static readonly Color[] SkinTones = (Color[])(object)new Color[8] { new Color(1f, 0.86f, 0.74f), new Color(0.96f, 0.78f, 0.64f), new Color(0.9f, 0.7f, 0.55f), new Color(0.8f, 0.6f, 0.44f), new Color(0.7f, 0.5f, 0.36f), new Color(0.58f, 0.4f, 0.28f), new Color(0.45f, 0.3f, 0.2f), new Color(0.33f, 0.22f, 0.15f) }; public static readonly Color[] HairColors = (Color[])(object)new Color[7] { new Color(0.1f, 0.07f, 0.05f), new Color(0.28f, 0.17f, 0.09f), new Color(0.5f, 0.32f, 0.16f), new Color(0.85f, 0.7f, 0.4f), new Color(0.6f, 0.2f, 0.1f), new Color(0.75f, 0.75f, 0.75f), new Color(0.2f, 0.2f, 0.22f) }; public static readonly Color[] ShirtColors = (Color[])(object)new Color[8] { new Color(0.75f, 0.15f, 0.2f), new Color(0.2f, 0.35f, 0.7f), new Color(0.15f, 0.5f, 0.35f), new Color(0.85f, 0.75f, 0.3f), new Color(0.55f, 0.3f, 0.65f), new Color(0.9f, 0.9f, 0.88f), new Color(0.15f, 0.15f, 0.18f), new Color(0.95f, 0.55f, 0.25f) }; public static void Apply(GameObject body, int seed, bool tintClothes) { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //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_0052: 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_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: 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_0124: Expected O, but got Unknown //IL_012d: 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) Random random = new Random(seed * 7919 + 17); Color value = SkinTones[random.Next(SkinTones.Length)]; Color value2 = HairColors[random.Next(HairColors.Length)]; Color value3 = ShirtColors[random.Next(ShirtColors.Length)]; bool flag = tintClothes && random.NextDouble() < 0.6; SkinnedMeshRenderer[] componentsInChildren = body.GetComponentsInChildren<SkinnedMeshRenderer>(true); foreach (SkinnedMeshRenderer val in componentsInChildren) { Material[] sharedMaterials = ((Renderer)val).sharedMaterials; for (int j = 0; j < sharedMaterials.Length; j++) { if ((Object)(object)sharedMaterials[j] == (Object)null) { continue; } Color? val2; switch (((Object)sharedMaterials[j]).name) { case "Skin": val2 = value; break; case "Hair": val2 = value2; break; case "Shirt": if (flag) { val2 = value3; break; } goto default; default: val2 = null; break; } Color? val3 = val2; if (val3.HasValue) { MaterialPropertyBlock val4 = new MaterialPropertyBlock(); val4.SetColor("_BaseColor", val3.Value); ((Renderer)val).SetPropertyBlock(val4, j); } } } } } public sealed class NpcPatron { public enum Reaction { Bet, Win, BigWin, Lose, Think } public int Index; public string Name; public NpcBody Body; public int Seed; public Vector3 SeatPos; public float SeatYaw; public Vector3 WatchPos; public bool Playing { get; private set; } = true; public void Join() { //IL_001d: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)Body == (Object)null)) { Playing = true; Body.WalkTo(SeatPos, SeatYaw); } } public void Leave() { //IL_001d: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)Body == (Object)null)) { Playing = false; Body.WalkTo(WatchPos, SeatYaw); } } public void React(Reaction reaction) { if (!((Object)(object)Body == (Object)null)) { switch (reaction) { case Reaction.Bet: Body.Gesture("PickUp"); break; case Reaction.Win: Body.Gesture("Victory"); break; case Reaction.BigWin: Body.Gesture("Victory"); Body.Say("!!!", 2f); break; case Reaction.Lose: Body.Gesture("Defeat"); break; case Reaction.Think: Body.Say("...", 1.2f); break; } } } public bool Wants(float radius = 0.9f) { //IL_003a: 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_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) foreach (Character allCharacter in Character.AllCharacters) { if (!((Object)(object)allCharacter == (Object)null) && !((Object)(object)allCharacter.data == (Object)null) && !allCharacter.data.dead) { Vector3 val = allCharacter.Center - SeatPos; val.y = 0f; if (((Vector3)(ref val)).sqrMagnitude < radius * radius) { return true; } } } return false; } } public static class TablePatrons { private static readonly Dictionary<int, List<NpcPatron>> ByTable = new Dictionary<int, List<NpcPatron>>(); public static void Clear() { ByTable.Clear(); } public static void Add(int tableId, NpcPatron patron) { if (!ByTable.TryGetValue(tableId, out var value)) { value = (ByTable[tableId] = new List<NpcPatron>()); } patron.Index = value.Count; value.Add(patron); } public static IReadOnlyList<NpcPatron> For(int tableId) { if (!ByTable.TryGetValue(tableId, out var value)) { return Array.Empty<NpcPatron>(); } return value; } } public sealed class NpcPerformer : MonoBehaviour { private const float ReturnAfter = 10f; private NpcBody _body; private Transform _stage; private Vector3 _home; private float _homeYaw; private bool _onSpot = true; private float _freeSince; private float _next; private float _nextCheck; private int _line; public void Setup(Transform stage, Transform spot) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000e: 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_001a: 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) _stage = stage; _home = spot.position; Quaternion rotation = spot.rotation; _homeYaw = ((Quaternion)(ref rotation)).eulerAngles.y; } private void Start() { _body = ((Component)this).GetComponent<NpcBody>(); _next = Time.time + Random.Range(2f, 6f); } private bool PlayerOnStage() { //IL_0053: Unknown result type (might be due to invalid IL or missing references) //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_005e: 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_007d: Unknown result type (might be due to invalid IL or missing references) //IL_008a: 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) if ((Object)(object)_stage == (Object)null) { return false; } foreach (Character allCharacter in Character.AllCharacters) { if (!((Object)(object)allCharacter == (Object)null) && !((Object)(object)allCharacter.data == (Object)null) && !allCharacter.data.dead) { Vector3 val = _stage.InverseTransformPoint(allCharacter.Center); if (Mathf.Abs(val.x) < 4.1f && val.z > -2.1f && val.z < 2.4f && val.y > 0.3f && val.y < 3f) { return true; } } } return false; } private void Update() { //IL_007a: 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_008b: 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_00e0: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_body == (Object)null) { return; } if (Time.time >= _nextCheck) { _nextCheck = Time.time + 0.5f; if (PlayerOnStage()) { _freeSince = Time.time; if (_onSpot && !_body.Moving) { _onSpot = false; Vector3 target = _stage.TransformPoint(new Vector3(3.4f, 0.6f, -1.1f)); _body.WalkTo(target, _stage.eulerAngles.y - 60f); } } else if (!_onSpot && !_body.Moving && Time.time - _freeSince > 10f) { _onSpot = true; _body.WalkTo(_home, _homeYaw); } } if (_onSpot && !_body.Moving && !(Time.time < _next)) { _next = Time.time + Random.Range(6f, 11f); _body.Gesture("Victory"); if (Random.value < 0.6f) { _body.Say(PeakCasino.Localization.Loc.T($"npc.performer.{_line++ % 4}"), 3.5f); } } } } public sealed class NpcTalk : MonoBehaviour, IInteractible { public string Role = "guest"; public int LineCount = 4; public Cashier Desk; private int _next; private NpcBody _body; private void Awake() { _body = ((Component)this).GetComponent<NpcBody>(); _next = Mathf.Abs(((Object)this).GetInstanceID()) % 7; } public bool IsInteractible(Character interactor) { if ((Object)(object)interactor != (Object)null && interactor.IsLocal) { return !NpcDialog.IsOpen; } return false; } public void Interact(Character interactor) { if ((Object)(object)Desk != (Object)null) { Desk.Interact(interactor); } else if (!((Object)(object)_body == (Object)null)) { string text = PeakCasino.Localization.Loc.T($"npc.{Role}.{_next % Mathf.Max(1, LineCount)}"); _next++; _body.LookAt(((Component)interactor).transform, 5f); _body.Say(text); if (!_body.Sitting && Random.value < 0.4f) { _body.Gesture("PickUp"); } } } public void HoverEnter() { } public void HoverExit() { } public Vector3 Center() { //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_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) return ((Component)this).transform.position + Vector3.up * 1.4f; } public Transform GetTransform() { return ((Component)this).transform; } public string GetInteractionText() { if (!((Object)(object)Desk != (Object)null)) { return PeakCasino.Localization.Loc.T("npc.talk"); } return PeakCasino.Localization.Loc.T("cashier.talk"); } public string GetName() { if (!((Object)(object)_body != (Object)null)) { return "NPC"; } return _body.DisplayName; } } public sealed class NpcWanderer : MonoBehaviour { private const float Speed = 1f; private readonly List<Vector3> _points = new List<Vector3>(); private readonly List<float> _cumulative = new List<float>(); private float _length; private float _phase; private NpcBody _body; private float _pausedUntil; private double _pauseOffset; private static double Now { get { try { return PhotonNetwork.InRoom ? PhotonNetwork.Time : Time.timeAsDouble; } catch { return Time.timeAsDouble; } } } public void Setup(List<Vector3> points, float phase) { //IL_003a: 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) _body = ((Component)this).GetComponent<NpcBody>(); _points.AddRange(points); _cumulative.Add(0f); for (int i = 0; i < _points.Count; i++) { _length += Vector3.Distance(_points[i], _points[(i + 1) % _points.Count]); _cumulative.Add(_length); } _phase = phase; } public void Pause(float seconds) { _pausedUntil = Time.time + seconds; } private void Update() { //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) //IL_00d4: 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_011a: 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) //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_0125: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_012c: 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_0161: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_017c: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_body == (Object)null || _length <= 0f) { return; } if (Time.time < _pausedUntil) { _pauseOffset += Time.deltaTime; _body.SetWalking(walking: false); return; } float num = (float)(((Now - _pauseOffset) * 1.0 + (double)(_phase * _length)) % (double)_length); if (num < 0f) { num += _length; } int i; for (i = 0; i < _points.Count - 1 && _cumulative[i + 1] < num; i++) { } Vector3 val = _points[i]; Vector3 val2 = _points[(i + 1) % _points.Count]; float num2 = _cumulative[i + 1] - _cumulative[i]; float num3 = ((num2 > 0.001f) ? ((num - _cumulative[i]) / num2) : 0f); Vector3 pos = Vector3.Lerp(val, val2, num3); Vector3 val3 = val2 - val; val3.y = 0f; float y; if (!(((Vector3)(ref val3)).sqrMagnitude > 0.0001f)) { y = ((Component)this).transform.eulerAngles.y; } else { Quaternion val4 = Quaternion.LookRotation(((Vector3)(ref val3)).normalized); y = ((Quaternion)(ref val4)).eulerAngles.y; } float num4 = y; _body.Place(pos, Mathf.LerpAngle(((Component)this).transform.eulerAngles.y, num4, 8f * Time.deltaTime)); _body.SetWalking(walking: true); } } public sealed class SlotPatron : MonoBehaviour { private const float SeatHeight = 0.62f; private const float YieldRadius = 1.2f; private const float ReturnAfter = 10f; private NpcBody _body; private int _machineId; private Transform _machine; private Vector3 _stool; private float _yaw; private Vector3 _watchPos; private bool _seated; private float _freeSince; private float _nextSpin; private float _nextCheck; private bool _wasSpinning; private SlotMachine Machine { get { if (!SlotMachine.Registry.TryGetValue(_machineId, out var value)) { return null; } return value; } } public void Setup(int machineId, Transform machine, Vector3 stool) { //IL_001b: 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_0028: 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_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) //IL_0054: 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_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) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007b: 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_008b: Unknown result type (might be due to invalid IL or missing references) _body = ((Component)this).GetComponent<NpcBody>(); _machineId = machineId; _machine = machine; _stool = stool; Quaternion rotation = machine.rotation; _yaw = ((Quaternion)(ref rotation)).eulerAngles.y + 180f; Vector3 forward = machine.forward; forward.y = 0f; _watchPos = stool + ((Vector3)(ref forward)).normalized * 0.9f + machine.right * 0.6f; _body.SitAt(stool, _yaw, 0.62f); _seated = true; _nextSpin = Time.time + Random.Range(3f, 12f); } private void Update() { if ((Object)(object)_body == (Object)null) { return; } if (Time.time >= _nextCheck) { _nextCheck = Time.time + 0.4f; CheckPlace(); } SlotMachine machine = Machine; if ((Object)(object)machine == (Object)null) { return; } bool flag = machine.State == SlotMachine.MachineState.Spinning; if (_wasSpinning && !flag && machine.LastSpinner == _body.DisplayName && machine.LastPayout > 0) { _body.Say((machine.LastPayout >= machine.LastPrice * 10) ? "JACKPOT!" : ("+" + machine.LastPayout), 2.5f); } _wasSpinning = flag; if (_seated && CasinoNet.IsAuthority && !(Time.time < _nextSpin)) { _nextSpin = Time.time + Random.Range(7f, 18f); if (machine.State == SlotMachine.MachineState.Idle) { machine.TryNpcSpin(_body.DisplayName); } } } private void CheckPlace() { //IL_003c: 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_0047: 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) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) bool flag = false; foreach (Character allCharacter in Character.AllCharacters) { if (!((Object)(object)allCharacter == (Object)null) && !((Object)(object)allCharacter.data == (Object)null) && !allCharacter.data.dead) { Vector3 val = allCharacter.Center - _stool; val.y = 0f; if (((Vector3)(ref val)).sqrMagnitude < 1.44f) { flag = true; break; } } } if (flag) { _freeSince = Time.time; if (_seated && !_body.Moving) { _seated = false; _body.WalkTo(_watchPos, _yaw); } } else if (!_seated && !_body.Moving && Time.time - _freeSince > 10f) { _body.WalkTo(_stool, _yaw, delegate { //IL_0007: Unknown result type (might be due to invalid IL or missing references) _body.SitAt(_stool, _yaw, 0.62f); _seated = true; }); } } } } namespace PeakCasino.Net { public sealed class CasinoNet : IOnEventCallback { public const byte EventCode = 182; private const byte KindCoinState = 1; private const byte KindCoinStateRequest = 2; private const byte KindCoinClaim = 3; private const byte KindCoinGrant = 4; private const byte KindItemSpawn = 5; private static CasinoNet _instance; public static bool IsAuthority { get { try { return !PhotonNetwork.InRoom || PhotonNetwork.IsMasterClient; } catch { return true; } } } public static bool InRoom { get { try { return PhotonNetwork.InRoom; } catch { return false; } } } public static void Register() { if (_instance != null) { return; } _instance = new CasinoNet(); try { PhotonNetwork.AddCallbackTarget((object)_instance); CasinoLog.Info("[Net] Photon-Callback registriert."); } catch (Exception ex) { CasinoLog.Error("[Net] Registrierung fehlgeschlagen: " + ex.Message); _instance = null; } } private static void Send(object[] content, ReceiverGroup receivers, int targetActor = 0) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Expected O, but got Unknown //IL_000d: 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) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) if (!InRoom) { return; } try { object obj; if (targetActor <= 0) { obj = (object)new RaiseEventOptions { Receivers = receivers }; } else { RaiseEventOptions val = new RaiseEventOptions(); val.TargetActors = new int[1] { targetActor }; obj = val; } RaiseEventOptions val2 = (RaiseEventOptions)obj; PhotonNetwork.RaiseEvent((byte)182, (object)content, val2, SendOptions.SendReliable); } catch (Exception ex) { CasinoLog.Warning($"[Net] Senden fehlgeschlagen ({content[0]}): {ex.Message}"); } } public static void SendCoinState(bool[] available, int targetActor = 0) { Send(new object[2] { (byte)1, available }, (ReceiverGroup)0, targetActor); } public static void RequestCoinState() { Send(new object[1] { (byte)2 }, (ReceiverGroup)2); } public static void ClaimCoin(int spot) { Send(new object[2] { (byte)3, spot }, (ReceiverGroup)2); } public static void GrantCoin(int spot, int actor) { Send(new object[2] { (byte)4, spot }, (ReceiverGroup)0, actor); } public static void RequestItemSpawn(string itemName, Vector3 position, Vector3 push) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002e: 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) //IL_0009: Unknown result type (might be due to invalid IL or missing references) if (IsAuthority) { Cashier.SpawnItem(itemName, position, push); return; } Send(new object[4] { (byte)5, itemName, position, push }, (ReceiverGroup)2); } public void OnEvent(EventData photonEvent) { //IL_00dd: 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) if (photonEvent.Code != 182) { return; } try { if (!(photonEvent.CustomData is object[] array) || array.Length == 0) { return; } int sender = photonEvent.Sender; switch ((byte)array[0]) { case 1: CoinField.Instance?.ApplyState((bool[])array[1]); break; case 2: if (PhotonNetwork.IsMasterClient) { CoinField.Instance?.SendStateTo(sender); } break; case 3: if (PhotonNetwork.IsMasterClient) { CoinField.Instance?.HandleClaim((int)array[1], sender); } break; case 4: CoinField.Instance?.ReceiveGrant((int)array[1]); break; case 5: if (PhotonNetwork.IsMasterClient) { Cashier.SpawnItem((string)array[1], (Vector3)array[2], (Vector3)array[3]); } break; } } catch (Exception arg) { CasinoLog.Error($"[Net] Ereignis fehlerhaft: {arg}"); } } } } namespace PeakCasino.Localization { public enum ModLanguage { English, German } public static class Loc { private static readonly Dictionary<string, string> English = StringsEn.Build(); private static readonly Dictionary<string, string> German = StringsDe.Build(); private static ModLanguage _current = ModLanguage.English; private static bool _hooked; public static ModLanguage Current { get { EnsureHooked(); return _current; } } public static event Action LanguageChanged; private static void EnsureHooked() { if (_hooked) { return; } _hooked = true; ReadGameLanguage(); try { LocalizedText.OnLangugageChanged = (Action)Delegate.Combine(LocalizedText.OnLangugageChanged, new Action(OnGameLanguageChanged)); } catch (Exception ex) { CasinoLog.Warning("[Loc] Sprachwechsel-Ereignis nicht erreichbar: " + ex.Message); } } internal static void Initialize() { EnsureHooked(); CasinoLog.Info($"[Loc] Sprache: {_current}"); } internal static void Refresh() { OnGameLanguageChanged(); } private static void OnGameLanguageChanged() { EnsureHooked(); ModLanguage current = _current; ReadGameLanguage(); if (current == _current) { return; } CasinoLog.Info($"[Loc] Sprache gewechselt: {current} -> {_current}"); try { Loc.LanguageChanged?.Invoke(); } catch (Exception arg) { CasinoLog.Error($"[Loc] Fehler beim Sprachwechsel: {arg}"); } } private static void ReadGameLanguage() { //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_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Invalid comparison between Unknown and I4 Language val; try { val = LocalizedText.CURRENT_LANGUAGE; } catch { val = (Language)0; } _current = (((int)val == 3) ? ModLanguage.German : ModLanguage.English); } public static string T(string key) { if (key == null) { return string.Empty; } if (((Current == ModLanguage.German) ? German : English).TryGetValue(key, out var value)) { return value; } if (English.TryGetValue(key, out var value2)) { return value2; } CasinoLog.Warning("[Loc] Unbekannter Schluessel '" + key + "'"); return key; } public static string T(string key, params object[] args) { string text = T(key); try { return string.Format(CultureInfo.InvariantCulture, text, args); } catch (FormatException) { CasinoLog.Warning("[Loc] Platzhalter passen nicht zu '" + key + "': " + text); return text; } } } internal static class StringsDe { public static Dictionary<string, string> Build() { return new Dictionary<string, string> { ["cashier.name"] = "KASSE", ["cashier.exchange"] = "{0} MUENZEN IN {1} CHIPS TAUSCHEN", ["cashier.exchange.none"] = "KEINE MUENZEN - AUF DEM TEPPICH SUCHEN", ["cashier.buy"] = "{0} KAUFEN ({1} CHIPS)", ["cashier.hint"] = "TIPPEN: WEITER | HALTEN: BESTAETIGEN | {0} MUENZEN, {1} CHIPS", ["cashier.poor"] = "ZU WENIG CHIPS", ["cashier.talk"] = "ANSPRECHEN", ["cashier.balance"] = "Du hast {0} Muenzen und {1} Chips.", ["cashier.shop"] = "Ich moechte etwas kaufen...", ["cashier.howto"] = "Wie funktioniert das hier?", ["cashier.bye"] = "Tschuess!", ["cashier.item"] = "{0} - {1} Chips", ["cashier.more"] = "Weitere Sachen...", ["cashier.prev"] = "Vorherige Sachen...", ["cashier.back"] = "Zurueck", ["cashier.shop.more"] = "Noch etwas aus dem Laden", ["npc.cashier.hello"] = "Willkommen im PEAK CASINO! Was kann ich fuer dich tun?", ["npc.cashier.howto"] = "Muenzen liegen auf dem Teppich herum - hier drin und direkt vor dem Eingang. Bring sie mir, ich gebe dir {0} Chips pro Muenze. Mit den Chips spielst du an den Automaten, den Tischen und am Gluecksrad. Und was du gewinnst, kannst du hier fuer lustige Sachen am Flughafen ausgeben!", ["npc.cashier.else"] = "Sonst noch etwas?", ["npc.cashier.shop"] = "Das haben wir da (Seite {0}/{1}). Spass fuer den Flughafen - bleibt hier, wenn du abfliegst.", ["npc.cashier.bye"] = "Viel Glueck!", ["toast.coin"] = "+{0} MUENZEN ({1})", ["toast.exchanged"] = "+{0} CHIPS", ["toast.bought"] = "{0} - VIEL SPASS!", ["toast.poor"] = "Zu wenig Chips ({0} noetig)", ["toast.removed"] = "Casino-Items bleiben am Flughafen ({0} zurueckgegeben)", ["wheel.name"] = "GLUECKSRAD", ["wheel.spin"] = "RAD DREHEN ({0} CHIPS) | DU HAST {1}", ["wheel.busy"] = "DREHT...", ["wheel.win"] = "+{0} CHIPS!", ["wheel.lose"] = "X - DIESMAL NICHT", ["npc.talk"] = "ANSPRECHEN", ["npc.cashier.0"] = "Muenzen auf dem Teppich gefunden? Her damit, ich mache Chips draus.", ["npc.cashier.1"] = "Zehn Chips pro Muenze. Ehrlich. Meistens.", ["npc.cashier.2"] = "Die Ballons gehen am besten. Frag nicht warum.", ["npc.cashier.3"] = "Grosse Gewinner kaufen hier ein. Kleine auch.", ["npc.cashier.exchange"] = "Bitte sehr: {0} Chips. Viel Glueck!", ["npc.cashier.bought"] = "Einmal {0}, kommt sofort!", ["npc.cashier.poor"] = "Tut mir leid, dafuer reichen die Chips nicht.", ["npc.bartender.0"] = "Was darf's sein? Bergwasser auf Eis?", ["npc.bartender.1"] = "Am Gluecksrad hab ich Leute alles verlieren sehen. Und zurueckgewinnen.", ["npc.bartender.2"] = "Die VIP-Tische? Fuenfzig Chips pro Chip. Bring Freunde mit.", ["npc.bartender.3"] = "Bitte nicht auf den Tresen klettern.", ["npc.bouncer.0"] = "Willkommen im PEAK CASINO. Benimm dich.", ["npc.bouncer.1"] = "Hier liegen Muenzen rum. Wer findet, darf behalten.", ["npc.bouncer.2"] = "Die Kasse ist links. Nicht zu verfehlen.", ["npc.bouncer.3"] = "Ich hab dich im Auge, Scout.", ["npc.dealer.0"] = "Machen Sie Ihr Spiel!", ["npc.dealer.1"] = "Das Haus gewinnt immer. Meistens.", ["npc.dealer.2"] = "Setz dich, fuer einen ist immer Platz.", ["npc.dealer.3"] = "Nichts geht mehr... kleiner Scherz, setz ruhig.", ["npc.blackjack.0"] = "Karte! ...nicht hauen, Karte.", ["npc.blackjack.1"] = "Bei siebzehn bleib ich stehen. Immer.", ["npc.blackjack.2"] = "Willst du meinen Platz? Komm her, ich schau zu.", ["npc.blackjack.3"] = "Der Dealer hat heute einen Lauf.", ["npc.roulette.0"] = "Siebzehn. Es ist immer siebzehn.", ["npc.roulette.1"] = "Rot, rot, rot... komm schon, rot!", ["npc.roulette.2"] = "Ich hab einmal alles auf Zero gesetzt. Einmal.", ["npc.roulette.3"] = "Da ist noch Platz, komm ran.", ["npc.slots.0"] = "Psst, gleich zahlt die Maschine. Ich spuer das.", ["npc.slots.1"] = "Drei Siebenen. Mehr will ich nicht.", ["npc.slots.2"] = "Willst du an den Automaten? Bitte, ich mach Pause.", ["npc.slots.3"] = "Schon wieder Totenkoepfe?!", ["npc.guest.0"] = "Schon das Gluecksrad probiert?", ["npc.guest.1"] = "Ich kam wegen des Bergs. Geblieben bin ich wegen der Slots.", ["npc.guest.2"] = "Schau auf die BAGHOLDERS-Tafel - ich bin fast drauf!", ["npc.guest.3"] = "Schoene Aussicht da oben? Keine Ahnung.", ["npc.guest.4"] = "Die VIP-Lounge ist hinten. Ganz schick!", ["npc.guest.5"] = "Drei Muenzen unter einer Palme gefunden. Gluecklicher Tag.", ["npc.performer.0"] = "Danke, PEAK!", ["npc.performer.1"] = "Der naechste Song ist fuer die High Roller!", ["npc.performer.2"] = "Hoert nicht auf zu drehen!", ["npc.performer.3"] = "Zugabe? Na gut!", ["board.empty"] = "NOCH KEINE BAGHOLDER", ["board.row"] = "{0}. {1}<pos=72%>{2}" }; } } internal static class StringsEn { public static Dictionary<string, string> Build() { return new Dictionary<string, string> { ["cashier.name"] = "CASHIER", ["cashier.exchange"] = "EXCHANGE {0} COINS FOR {1} CHIPS", ["cashier.exchange.none"] = "NO COINS - LOOK FOR THEM ON THE CARPET", ["cashier.buy"] = "BUY {0} ({1} CHIPS)", ["cashier.hint"] = "TAP: NEXT | HOLD: CONFIRM | {0} COINS, {1} CHIPS", ["cashier.poor"] = "NOT ENOUGH CHIPS", ["cashier.talk"] = "TALK", ["cashier.balance"] = "You have {0} coins and {1} chips.", ["cashier.shop"] = "I'd like to buy something...", ["cashier.howto"] = "How does this work?", ["cashier.bye"] = "Bye!", ["cashier.item"] = "{0} - {1} chips", ["cashier.more"] = "More items...", ["cashier.prev"] = "Previous items...", ["cashier.back"] = "Back", ["cashier.shop.more"] = "Something else from the shop", ["npc.cashier.hello"] = "Welcome to the PEAK CASINO! What can I do for you?", ["npc.cashier.howto"] = "Coins lie around on the carpet - in here and right outside. Bring them to me and I'll give you {0} chips per coin. Play with the chips at the machines, the tables and the wheel. And whatever you win, you can spend here on fun stuff for the airport!", ["npc.cashier.else"] = "Anything else?", ["npc.cashier.shop"] = "Here's what we have (page {0}/{1}). Fun stuff for the airport - it stays here when you fly.", ["npc.cashier.bye"] = "Good luck out there!", ["toast.coin"] = "+{0} COINS ({1})", ["toast.exchanged"] = "+{0} CHIPS", ["toast.bought"] = "{0} - HAVE FUN!", ["toast.poor"] = "Not enough chips ({0} needed)", ["toast.removed"] = "Casino items stay at the airport ({0} returned)", ["wheel.name"] = "WHEEL OF FORTUNE", ["wheel.spin"] = "SPIN THE WHEEL ({0} CHIPS) | YOU HAVE {1}", ["wheel.busy"] = "SPINNING...", ["wheel.win"] = "+{0} CHIPS!", ["wheel.lose"] = "X - NO LUCK THIS TIME", ["npc.talk"] = "TALK", ["npc.cashier.0"] = "Coins on the carpet? Bring them here, I'll turn them into chips.", ["npc.cashier.1"] = "Ten chips per coin. Fair and square. Mostly.", ["npc.cashier.2"] = "The balloons are very popular. Don't ask why.", ["npc.cashier.3"] = "Big winners shop here. Small winners too.", ["npc.cashier.exchange"] = "There you go: {0} chips. Good luck!", ["npc.cashier.bought"] = "One {0}, coming right up!", ["npc.cashier.poor"] = "Sorry, not enough chips for that one.", ["npc.bartender.0"] = "What'll it be? Mountain water on the rocks?", ["npc.bartender.1"] = "I've seen people lose everything at the wheel. Then win it back.", ["npc.bartender.2"] = "The VIP tables? Fifty chips a pop. Bring friends.", ["npc.bartender.3"] = "No climbing on the bar, please.", ["npc.bouncer.0"] = "Welcome to the PEAK CASINO. Behave.", ["npc.bouncer.1"] = "Coins lie around in here. Finders keepers.", ["npc.bouncer.2"] = "The cashier is on the left side. Can't miss it.", ["npc.bouncer.3"] = "I'm watching you, scout.", ["npc.dealer.0"] = "Place your bets!", ["npc.dealer.1"] = "The house always wins. Usually.", ["npc.dealer.2"] = "Take a seat, there's always room for one more.", ["npc.dealer.3"] = "No more bets... just kidding, go ahead.", ["npc.blackjack.0"] = "Hit me! ...wait, not literally.", ["npc.blackjack.1"] = "I always stand on seventeen. Always.", ["npc.blackjack.2"] = "Want my seat? Just step up, I'll watch.", ["npc.blackjack.3"] = "The dealer is on a hot streak tonight.", ["npc.roulette.0"] = "Seventeen. It's always seventeen.", ["npc.roulette.1"] = "Red, red, red... come on, red!", ["npc.roulette.2"] = "I put everything on zero once. Once.", ["npc.roulette.3"] = "Room for one more, step right up.", ["npc.slots.0"] = "Shh, this machine is about to pay out. I can feel it.", ["npc.slots.1"] = "Three sevens. That's all I ask.", ["npc.slots.2"] = "Want this machine? Go ahead, I'll take a break.", ["npc.slots.3"] = "Skulls again?!", ["npc.guest.0"] = "Have you tried the wheel of fortune?", ["npc.guest.1"] = "I came for the mountain. I stayed for the slots.", ["npc.guest.2"] = "Check the BAGHOLDERS board - I'm almost on it!", ["npc.guest.3"] = "Nice view up there? I wouldn't know.", ["npc.guest.4"] = "The VIP lounge is in the back. Fancy!", ["npc.guest.5"] = "Found three coins under a palm. Lucky day.", ["npc.performer.0"] = "Thank you, PEAK!", ["npc.performer.1"] = "This one's for the high rollers!", ["npc.performer.2"] = "Don't stop spinning!", ["npc.performer.3"] = "Encore? Okay!", ["board.empty"] = "NO BAGHOLDERS YET", ["board.row"] = "{0}. {1}<pos=72%>{2}" }; } } } namespace PeakCasino.Layout { public static class CarpetSurface { public static GameObject Create(Transform parent, CasinoLayoutData.CarpetData carpet) { //IL_0097: 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_00a8: 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_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_00fc: 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_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Expected O, but got Unknown //IL_0133: 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) //IL_0145: 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_0165: 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_017f: Expected O, but got Unknown GameObject val = CasinoBundle.Get(carpet.Prefab); object obj; if (!((Object)(object)val != (Object)null)) { obj = null; } else { Renderer componentInChildren = val.GetComponentInChildren<Renderer>(true); obj = ((componentInChildren != null) ? componentInChildren.sharedMaterial : null); } Material val2 = (Material)obj; if ((Object)(object)val2 == (Object)null) { CasinoLog.Warning("[Carpet] Material von '" + carpet.Prefab + "' fehlt."); return null; } Vector2[] array = carpet.Points.ToArray(); Vector3[] array2 = (Vector3[])(object)new Vector3[array.Length]; Vector2[] array3 = (Vector2[])(object)new Vector2[array.Length]; for (int i = 0; i < array.Length; i++) { array2[i] = new Vector3(array[i].x, 0f, array[i].y); array3[i] = array[i] / carpet.Tile; } int[] array4 = Triangulate(array); if (carpet.Down) { Array.Reverse(array4); } Mesh val3 = new Mesh { name = "Carpet_" + carpet.Prefab, vertices = array2, uv = array3, triangles = array4 }; val3.RecalculateNormals(); val3.RecalculateBounds(); GameObject val4 = new GameObject("Carpet_" + carpet.Prefab); val4.transform.SetParent(parent, false); val4.transform.position = new Vector3(0f, carpet.Y, 0f); val4.AddComponent<MeshFilter>().sharedMesh = val3; ((Renderer)val4.AddComponent<MeshRenderer>()).sharedMaterial = val2; return val4; } private static int[] Triangulate(Vector2[] p) { //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_0187: 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) //IL_0197: Unknown result type (might be due to invalid IL or missing references) int num = p.Length; float num2 = 0f; for (int i = 0; i < num; i++) { num2 += p[i].x * p[(i + 1) % num].y - p[(i + 1) % num].x * p[i].y; } List<int> list = new List<int>(num); for (int j = 0; j < num; j++) { list.Add((num2 > 0f) ? j : (num - 1 - j)); } List<int> list2 = new List<int>(); int num3 = 0; while (list.Count > 3 && num3++ < 10000) { bool flag = false; for (int k = 0; k < list.Count; k++) { int num4 = list[(k + list.Count - 1) % list.Count]; int num5 = list[k]; int num6 = list[(k + 1) % list.Count]; if ((p[num5].x - p[num4].x) * (p[num6].y - p[num4].y) - (p[num5].y - p[num4].y) * (p[num6].x - p[num4].x) <= 1E-06f) { continue; } bool flag2 = false; foreach (int item in list) { if (item != num4 && item != num5 && item != num6 && PointInTri(p[item], p[num4], p[num5], p[num6])) { flag2 = true; break; } } if (!flag2) { list2.Add(num4); list2.Add(num6); list2.Add(num5); list.RemoveAt(k); flag = true; break; } } if (!flag) { break; } } if (list.Count == 3) { list2.Add(list[0]); list2.Add(list[2]); list2.Add(list[1]); } return list2.ToArray(); } private static bool PointInTri(Vector2 p, Vector2 a, Vector2 b, Vector2 c) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000d: 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) //IL_001b: 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_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002e: 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_003e: 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: Unknown result type (might be due to invalid IL or missing references) //IL_0053: 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_0060: 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) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0076: 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_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008b: 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_0098: 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) float num = (p.x - b.x) * (a.y - b.y) - (a.x - b.x) * (p.y - b.y); float num2 = (p.x - c.x) * (b.y - c.y) - (b.x - c.x) * (p.y - c.y); float num3 = (p.x - a.x) * (c.y - a.y) - (c.x - a.x) * (p.y - a.y); if (num < 0f || num2 < 0f || num3 < 0f) { if (!(num > 0f) && !(num2 > 0f)) { return !(num3 > 0f); } return false; } return true; } } public sealed class CasinoAnimator : MonoBehaviour { private const float StepSeconds = 0.14f; private static readonly Color LampOn = new Color(1f, 0.75f, 0.3f) * 2.2f; private static readonly Color LampOff = new Color(1f, 0.75f, 0.3f) * 0.25f; private readonly List<(Renderer renderer, int index)> _lamps = new List<(Renderer, int)>(); private readonly List<(Transform t, Vector3 axis, float speed)> _spinners = new List<(Transform, Vector3, float)>(); private MaterialPropertyBlock _on; private MaterialPropertyBlock _off; private float _next; private int _step; private void Start() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown //IL_0016: 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_002b: Expected O, but got Unknown //IL_0036: 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_005d: Expected O, but got Unknown //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0150: 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 re