Decompiled source of All Monkey Terminal Casino v1.7.2
BRCGambling.dll
Decompiled a week 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.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text; using System.Text.RegularExpressions; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BombRushMP.Common; using BombRushMP.Common.Networking; using BombRushMP.Common.Packets; using BombRushMP.Mono.Runtime; using BombRushMP.Plugin; using BombRushMP.Plugin.Gamemodes; using CommonAPI; using CommonAPI.Phone; using HarmonyLib; using Microsoft.CodeAnalysis; using Reptile; using TMPro; using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.Events; using UnityEngine.Networking; using UnityEngine.UI; using WallPlant; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("BRCGambling")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+d81736754a2c95fe1d69ed24b29e5afe7e3c2c15")] [assembly: AssemblyProduct("BRCGambling")] [assembly: AssemblyTitle("BRCGambling")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } } namespace BRCGambling { public static class PassiveSync { private const string PACKET_ID = "com.chimp.brcgambling.passive"; private const string MSG_HELLO = "PH:"; private const string MSG_STATE = "PS:"; private static Dictionary<ushort, Dictionary<string, GameObject>> remotePassives = new Dictionary<ushort, Dictionary<string, GameObject>>(); public static void Init() { try { ClientController.RegisterCustomPacketHandler("com.chimp.brcgambling.passive", (Action<ushort, byte[]>)OnPacket); ClientController.PlayerDisconnected = (Action<ushort>)Delegate.Combine(ClientController.PlayerDisconnected, new Action<ushort>(OnPlayerDisconnected)); ClientController.ClientStatesUpdate = (Action)Delegate.Combine(ClientController.ClientStatesUpdate, new Action(OnClientStatesUpdate)); } catch (Exception ex) { Debug.Log((object)("[PassiveSync] Init failed: " + ex.Message)); } } public static void Shutdown() { ClientController.UnregisterCustomPacketHandler("com.chimp.brcgambling.passive"); ClientController.PlayerDisconnected = (Action<ushort>)Delegate.Remove(ClientController.PlayerDisconnected, new Action<ushort>(OnPlayerDisconnected)); ClientController.ClientStatesUpdate = (Action)Delegate.Remove(ClientController.ClientStatesUpdate, new Action(OnClientStatesUpdate)); ClearAllRemotePassives(); } private static void OnClientStatesUpdate() { AnnounceState(isHello: true); } public static void AnnounceState(bool isHello = false) { ClientController instance = ClientController.Instance; if (!((Object)(object)instance == (Object)null)) { string localPassiveIds = GetLocalPassiveIds(); string text = (isHello ? "PH:" : "PS:"); instance.BroadcastCustomPacket(Encode(text + localPassiveIds), "com.chimp.brcgambling.passive", (SendModes)2); } } public static void BroadcastStateUpdate() { AnnounceState(); } private static string GetLocalPassiveIds() { if (GamblingSaveData.Instance == null) { return ""; } List<string> list = new List<string>(); foreach (string equippedEffectId in GamblingSaveData.Instance.EquippedEffectIds) { EffectDefinition effectDefinition = EffectRegistry.Get(equippedEffectId); if (effectDefinition != null && effectDefinition.IsPassive) { list.Add(equippedEffectId); } } return string.Join(",", list); } private static void OnPlayerDisconnected(ushort playerId) { ClearRemotePassives(playerId); } private static void OnPacket(ushort sender, byte[] data) { if (sender == (ClientController.Instance?.LocalID ?? 0)) { return; } string text = Decode(data); if (text.StartsWith("PH:")) { string text2 = text.Substring("PH:".Length); string[] ids = (string.IsNullOrEmpty(text2) ? new string[0] : text2.Split(',')); UpdateRemotePassives(sender, ids); ClientController instance = ClientController.Instance; if ((Object)(object)instance != (Object)null) { string localPassiveIds = GetLocalPassiveIds(); instance.SendCustomPacketToPlayer(Encode("PS:" + localPassiveIds), "com.chimp.brcgambling.passive", sender, (SendModes)2); } } else if (text.StartsWith("PS:")) { string text3 = text.Substring("PS:".Length); string[] ids2 = (string.IsNullOrEmpty(text3) ? new string[0] : text3.Split(',')); UpdateRemotePassives(sender, ids2); } } private static void UpdateRemotePassives(ushort playerId, string[] ids) { if (!remotePassives.ContainsKey(playerId)) { remotePassives[playerId] = new Dictionary<string, GameObject>(); } Dictionary<string, GameObject> dictionary = remotePassives[playerId]; HashSet<string> hashSet = new HashSet<string>(ids); List<string> list = new List<string>(); foreach (KeyValuePair<string, GameObject> item in dictionary) { if (!hashSet.Contains(item.Key)) { if ((Object)(object)item.Value != (Object)null) { Object.Destroy((Object)(object)item.Value); } list.Add(item.Key); } } foreach (string item2 in list) { dictionary.Remove(item2); } foreach (string text in ids) { if (!string.IsNullOrEmpty(text) && !dictionary.ContainsKey(text)) { SpawnRemotePassive(playerId, text); } } } private static void SpawnRemotePassive(ushort playerId, string effectId) { if (!GamblingPlugin.ShowOtherPlayerCrowns.Value) { return; } EffectDefinition effectDefinition = EffectRegistry.Get(effectId); if (effectDefinition == null) { return; } ClientController instance = ClientController.Instance; if (!((Object)(object)instance == (Object)null) && instance.Players.TryGetValue(playerId, out var value)) { if ((Object)(object)value.Player == (Object)null) { ((MonoBehaviour)GamblingPlugin.Instance).StartCoroutine(RetrySpawnRemotePassive(playerId, effectId)); } else { SpawnPassiveOnPlayer(playerId, effectId, ((Component)value.Player).transform); } } } private static IEnumerator RetrySpawnRemotePassive(ushort playerId, string effectId) { float timeout = 10f; float elapsed = 0f; while (elapsed < timeout) { yield return (object)new WaitForSeconds(0.5f); elapsed += 0.5f; ClientController cc = ClientController.Instance; if ((Object)(object)cc == (Object)null || (remotePassives.ContainsKey(playerId) && remotePassives[playerId].ContainsKey(effectId)) || !cc.Players.TryGetValue(playerId, out var mpPlayer)) { break; } if ((Object)(object)mpPlayer.Player == (Object)null) { continue; } SpawnPassiveOnPlayer(playerId, effectId, ((Component)mpPlayer.Player).transform); break; } } private static void SpawnPassiveOnPlayer(ushort playerId, string effectId, Transform parent) { EffectDefinition effectDefinition = EffectRegistry.Get(effectId); if (effectDefinition != null && GamblingPlugin.CachedPrefabs.TryGetValue(effectDefinition.PrefabName, out GameObject value)) { GameObject val = Object.Instantiate<GameObject>(value, parent); EffectTriggerManager.ApplyPassiveTransform(effectId, val.transform); ApplyPassiveColor(effectId, val); if (!remotePassives.ContainsKey(playerId)) { remotePassives[playerId] = new Dictionary<string, GameObject>(); } remotePassives[playerId][effectId] = val; } } public static void ApplyPassiveColor(string effectId, GameObject obj) { //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_00ce: Unknown result type (might be due to invalid IL or missing references) if (effectId == "special_badge") { return; } Color crownColor = GamblingPlugin.GetCrownColor(); string value; switch (effectId) { default: return; case "mythic_crown": value = "CrownMat"; break; case "special_bday_hat": value = "BDAY_Mat"; break; case "special_glasses": value = "Glass"; break; case "mythic_pumpkin": value = "Pumpkin emission"; break; case "mythic_skull": value = "Skull_Mat"; break; } Renderer[] componentsInChildren = obj.GetComponentsInChildren<Renderer>(); foreach (Renderer val in componentsInChildren) { Material[] materials = val.materials; foreach (Material val2 in materials) { if (((Object)val2).name.Contains(value)) { val2.color = crownColor; } } } } public static void RefreshRemotePassives() { if (!GamblingPlugin.ShowOtherPlayerCrowns.Value) { ClearAllRemotePassives(); } else { AnnounceState(isHello: true); } } private static void ClearRemotePassives(ushort playerId) { if (!remotePassives.ContainsKey(playerId)) { return; } foreach (KeyValuePair<string, GameObject> item in remotePassives[playerId]) { if ((Object)(object)item.Value != (Object)null) { Object.Destroy((Object)(object)item.Value); } } remotePassives.Remove(playerId); } private static void ClearAllRemotePassives() { foreach (KeyValuePair<ushort, Dictionary<string, GameObject>> remotePassife in remotePassives) { foreach (KeyValuePair<string, GameObject> item in remotePassife.Value) { if ((Object)(object)item.Value != (Object)null) { Object.Destroy((Object)(object)item.Value); } } } remotePassives.Clear(); } private static byte[] Encode(string msg) { using MemoryStream memoryStream = new MemoryStream(); using BinaryWriter binaryWriter = new BinaryWriter(memoryStream); binaryWriter.Write(msg); return memoryStream.ToArray(); } private static string Decode(byte[] data) { using MemoryStream input = new MemoryStream(data); using BinaryReader binaryReader = new BinaryReader(input); return binaryReader.ReadString(); } } public enum EffectTrigger { Looping, OnSpray, OnSprayAttempt, OnJump, OnLand, OnWallPlant, OnBoostTrick, OnSlide, OnGraceEnd, OnGraceStart, OnGraceStartLooping, OnDeath, OnEmote, OnGrind, OnGrindLooping, OnManual, OnBoost, OnBoostLooping, OnComboBank } public enum EffectPosition { Feet, Torso, AboveHead } public class EffectDefinition { public string Id; public string DisplayName; public string PrefabName; public RewardTier Rarity; public EffectPosition Position; public EffectTrigger Trigger; public Vector3 PositionOffset = Vector3.zero; public bool IsPassive = false; public bool IsNew = false; public EffectDefinition(string id, string displayName, string prefabName, RewardTier rarity, EffectPosition position, EffectTrigger trigger, Vector3 offset = default(Vector3)) { //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_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) Id = id; DisplayName = displayName; PrefabName = prefabName; Rarity = rarity; Position = position; Trigger = trigger; PositionOffset = offset; } } public static class EffectRegistry { public static readonly Dictionary<string, EffectDefinition> All = new Dictionary<string, EffectDefinition>(); public static void Register(EffectDefinition def) { All[def.Id] = def; } public static void RegisterNew(EffectDefinition def) { def.IsNew = true; Register(def); } public static EffectDefinition Get(string id) { EffectDefinition value; return All.TryGetValue(id, out value) ? value : null; } public static List<EffectDefinition> GetPool(RewardTier rarity) { List<EffectDefinition> list = new List<EffectDefinition>(); foreach (EffectDefinition value in All.Values) { if (value.Rarity == rarity) { list.Add(value); } } return list; } public static void InitializeDefaults() { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_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_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0069: 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_0090: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00de: 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_0105: 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_012c: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_019d: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_01c4: Unknown result type (might be due to invalid IL or missing references) //IL_01ca: Unknown result type (might be due to invalid IL or missing references) //IL_01ec: Unknown result type (might be due to invalid IL or missing references) //IL_01f2: Unknown result type (might be due to invalid IL or missing references) //IL_0213: Unknown result type (might be due to invalid IL or missing references) //IL_0219: Unknown result type (might be due to invalid IL or missing references) //IL_023b: Unknown result type (might be due to invalid IL or missing references) //IL_0241: Unknown result type (might be due to invalid IL or missing references) //IL_0263: Unknown result type (might be due to invalid IL or missing references) //IL_0269: Unknown result type (might be due to invalid IL or missing references) //IL_028b: Unknown result type (might be due to invalid IL or missing references) //IL_0291: Unknown result type (might be due to invalid IL or missing references) //IL_02b3: Unknown result type (might be due to invalid IL or missing references) //IL_02b9: Unknown result type (might be due to invalid IL or missing references) //IL_02db: Unknown result type (might be due to invalid IL or missing references) //IL_02e1: Unknown result type (might be due to invalid IL or missing references) //IL_0302: Unknown result type (might be due to invalid IL or missing references) //IL_0308: Unknown result type (might be due to invalid IL or missing references) //IL_0329: Unknown result type (might be due to invalid IL or missing references) //IL_032f: Unknown result type (might be due to invalid IL or missing references) //IL_0350: Unknown result type (might be due to invalid IL or missing references) //IL_0356: Unknown result type (might be due to invalid IL or missing references) //IL_0378: Unknown result type (might be due to invalid IL or missing references) //IL_037e: Unknown result type (might be due to invalid IL or missing references) //IL_03a0: Unknown result type (might be due to invalid IL or missing references) //IL_03a6: Unknown result type (might be due to invalid IL or missing references) //IL_03c8: Unknown result type (might be due to invalid IL or missing references) //IL_03ce: Unknown result type (might be due to invalid IL or missing references) //IL_03f0: Unknown result type (might be due to invalid IL or missing references) //IL_03f6: Unknown result type (might be due to invalid IL or missing references) //IL_0418: Unknown result type (might be due to invalid IL or missing references) //IL_041e: Unknown result type (might be due to invalid IL or missing references) //IL_0440: Unknown result type (might be due to invalid IL or missing references) //IL_0446: Unknown result type (might be due to invalid IL or missing references) //IL_0467: Unknown result type (might be due to invalid IL or missing references) //IL_046d: Unknown result type (might be due to invalid IL or missing references) //IL_048f: Unknown result type (might be due to invalid IL or missing references) //IL_0495: Unknown result type (might be due to invalid IL or missing references) //IL_04b7: Unknown result type (might be due to invalid IL or missing references) //IL_04bd: Unknown result type (might be due to invalid IL or missing references) //IL_04de: Unknown result type (might be due to invalid IL or missing references) //IL_04e4: Unknown result type (might be due to invalid IL or missing references) //IL_0505: Unknown result type (might be due to invalid IL or missing references) //IL_050b: Unknown result type (might be due to invalid IL or missing references) //IL_052c: Unknown result type (might be due to invalid IL or missing references) //IL_0532: Unknown result type (might be due to invalid IL or missing references) //IL_0553: Unknown result type (might be due to invalid IL or missing references) //IL_0559: Unknown result type (might be due to invalid IL or missing references) //IL_057a: Unknown result type (might be due to invalid IL or missing references) //IL_0580: Unknown result type (might be due to invalid IL or missing references) //IL_05a1: Unknown result type (might be due to invalid IL or missing references) //IL_05a7: Unknown result type (might be due to invalid IL or missing references) //IL_05c9: Unknown result type (might be due to invalid IL or missing references) //IL_05cf: Unknown result type (might be due to invalid IL or missing references) //IL_05f0: Unknown result type (might be due to invalid IL or missing references) //IL_05f6: Unknown result type (might be due to invalid IL or missing references) //IL_0617: Unknown result type (might be due to invalid IL or missing references) //IL_061d: Unknown result type (might be due to invalid IL or missing references) //IL_063e: Unknown result type (might be due to invalid IL or missing references) //IL_0644: Unknown result type (might be due to invalid IL or missing references) //IL_0665: Unknown result type (might be due to invalid IL or missing references) //IL_066b: Unknown result type (might be due to invalid IL or missing references) //IL_068c: Unknown result type (might be due to invalid IL or missing references) //IL_0692: Unknown result type (might be due to invalid IL or missing references) //IL_06b3: Unknown result type (might be due to invalid IL or missing references) //IL_06b9: Unknown result type (might be due to invalid IL or missing references) //IL_06da: Unknown result type (might be due to invalid IL or missing references) //IL_06e0: Unknown result type (might be due to invalid IL or missing references) //IL_0701: Unknown result type (might be due to invalid IL or missing references) //IL_0707: Unknown result type (might be due to invalid IL or missing references) //IL_0728: Unknown result type (might be due to invalid IL or missing references) //IL_072e: Unknown result type (might be due to invalid IL or missing references) //IL_074f: Unknown result type (might be due to invalid IL or missing references) //IL_0755: Unknown result type (might be due to invalid IL or missing references) //IL_0776: Unknown result type (might be due to invalid IL or missing references) //IL_077c: Unknown result type (might be due to invalid IL or missing references) //IL_079e: Unknown result type (might be due to invalid IL or missing references) //IL_07a4: Unknown result type (might be due to invalid IL or missing references) //IL_07c5: Unknown result type (might be due to invalid IL or missing references) //IL_07cb: Unknown result type (might be due to invalid IL or missing references) //IL_07ec: Unknown result type (might be due to invalid IL or missing references) //IL_07f2: Unknown result type (might be due to invalid IL or missing references) //IL_0813: Unknown result type (might be due to invalid IL or missing references) //IL_0819: Unknown result type (might be due to invalid IL or missing references) //IL_083a: Unknown result type (might be due to invalid IL or missing references) //IL_0840: Unknown result type (might be due to invalid IL or missing references) //IL_0861: Unknown result type (might be due to invalid IL or missing references) //IL_0867: Unknown result type (might be due to invalid IL or missing references) //IL_0888: Unknown result type (might be due to invalid IL or missing references) //IL_088e: Unknown result type (might be due to invalid IL or missing references) //IL_08af: Unknown result type (might be due to invalid IL or missing references) //IL_08b5: Unknown result type (might be due to invalid IL or missing references) //IL_08d6: Unknown result type (might be due to invalid IL or missing references) //IL_08dc: Unknown result type (might be due to invalid IL or missing references) //IL_08fd: Unknown result type (might be due to invalid IL or missing references) //IL_0903: Unknown result type (might be due to invalid IL or missing references) //IL_0924: Unknown result type (might be due to invalid IL or missing references) //IL_092a: Unknown result type (might be due to invalid IL or missing references) //IL_094b: Unknown result type (might be due to invalid IL or missing references) //IL_0951: Unknown result type (might be due to invalid IL or missing references) //IL_0972: Unknown result type (might be due to invalid IL or missing references) //IL_0978: Unknown result type (might be due to invalid IL or missing references) //IL_0999: Unknown result type (might be due to invalid IL or missing references) //IL_099f: Unknown result type (might be due to invalid IL or missing references) //IL_09c0: Unknown result type (might be due to invalid IL or missing references) //IL_09c6: Unknown result type (might be due to invalid IL or missing references) //IL_09e7: Unknown result type (might be due to invalid IL or missing references) //IL_09ed: Unknown result type (might be due to invalid IL or missing references) //IL_0a0e: Unknown result type (might be due to invalid IL or missing references) //IL_0a14: Unknown result type (might be due to invalid IL or missing references) //IL_0a35: Unknown result type (might be due to invalid IL or missing references) //IL_0a3b: Unknown result type (might be due to invalid IL or missing references) //IL_0a5c: Unknown result type (might be due to invalid IL or missing references) //IL_0a62: Unknown result type (might be due to invalid IL or missing references) //IL_0a83: Unknown result type (might be due to invalid IL or missing references) //IL_0a89: Unknown result type (might be due to invalid IL or missing references) //IL_0aaa: Unknown result type (might be due to invalid IL or missing references) //IL_0ab0: Unknown result type (might be due to invalid IL or missing references) //IL_0ad1: Unknown result type (might be due to invalid IL or missing references) //IL_0ad7: Unknown result type (might be due to invalid IL or missing references) //IL_0af9: Unknown result type (might be due to invalid IL or missing references) //IL_0aff: Unknown result type (might be due to invalid IL or missing references) //IL_0b20: Unknown result type (might be due to invalid IL or missing references) //IL_0b26: Unknown result type (might be due to invalid IL or missing references) //IL_0b48: Unknown result type (might be due to invalid IL or missing references) //IL_0b4e: Unknown result type (might be due to invalid IL or missing references) //IL_0b70: Unknown result type (might be due to invalid IL or missing references) //IL_0b76: Unknown result type (might be due to invalid IL or missing references) //IL_0b97: Unknown result type (might be due to invalid IL or missing references) //IL_0b9d: Unknown result type (might be due to invalid IL or missing references) //IL_0bbe: Unknown result type (might be due to invalid IL or missing references) //IL_0bc4: Unknown result type (might be due to invalid IL or missing references) //IL_0be6: Unknown result type (might be due to invalid IL or missing references) //IL_0bec: Unknown result type (might be due to invalid IL or missing references) //IL_0c0e: Unknown result type (might be due to invalid IL or missing references) //IL_0c14: Unknown result type (might be due to invalid IL or missing references) //IL_0c35: Unknown result type (might be due to invalid IL or missing references) //IL_0c3b: Unknown result type (might be due to invalid IL or missing references) //IL_0c5c: Unknown result type (might be due to invalid IL or missing references) //IL_0c62: Unknown result type (might be due to invalid IL or missing references) //IL_0c83: Unknown result type (might be due to invalid IL or missing references) //IL_0c89: Unknown result type (might be due to invalid IL or missing references) //IL_0caa: Unknown result type (might be due to invalid IL or missing references) //IL_0cb0: Unknown result type (might be due to invalid IL or missing references) //IL_0cd1: Unknown result type (might be due to invalid IL or missing references) //IL_0cd7: Unknown result type (might be due to invalid IL or missing references) //IL_0cf8: Unknown result type (might be due to invalid IL or missing references) //IL_0cfe: Unknown result type (might be due to invalid IL or missing references) //IL_0d20: Unknown result type (might be due to invalid IL or missing references) //IL_0d26: Unknown result type (might be due to invalid IL or missing references) //IL_0d47: Unknown result type (might be due to invalid IL or missing references) //IL_0d4d: Unknown result type (might be due to invalid IL or missing references) //IL_0d6e: Unknown result type (might be due to invalid IL or missing references) //IL_0d74: Unknown result type (might be due to invalid IL or missing references) //IL_0d95: Unknown result type (might be due to invalid IL or missing references) //IL_0d9b: Unknown result type (might be due to invalid IL or missing references) //IL_0dbc: Unknown result type (might be due to invalid IL or missing references) //IL_0dc2: Unknown result type (might be due to invalid IL or missing references) //IL_0de3: Unknown result type (might be due to invalid IL or missing references) //IL_0de9: Unknown result type (might be due to invalid IL or missing references) //IL_0e0a: Unknown result type (might be due to invalid IL or missing references) //IL_0e10: Unknown result type (might be due to invalid IL or missing references) //IL_0e31: Unknown result type (might be due to invalid IL or missing references) //IL_0e37: Unknown result type (might be due to invalid IL or missing references) //IL_0e59: Unknown result type (might be due to invalid IL or missing references) //IL_0e5f: Unknown result type (might be due to invalid IL or missing references) //IL_0e80: Unknown result type (might be due to invalid IL or missing references) //IL_0e86: Unknown result type (might be due to invalid IL or missing references) //IL_0ea7: Unknown result type (might be due to invalid IL or missing references) //IL_0ead: Unknown result type (might be due to invalid IL or missing references) //IL_0ece: Unknown result type (might be due to invalid IL or missing references) //IL_0ed4: Unknown result type (might be due to invalid IL or missing references) //IL_0ef5: Unknown result type (might be due to invalid IL or missing references) //IL_0efb: Unknown result type (might be due to invalid IL or missing references) //IL_0f1d: Unknown result type (might be due to invalid IL or missing references) //IL_0f23: Unknown result type (might be due to invalid IL or missing references) //IL_0f44: Unknown result type (might be due to invalid IL or missing references) //IL_0f4a: Unknown result type (might be due to invalid IL or missing references) //IL_0f6b: Unknown result type (might be due to invalid IL or missing references) //IL_0f71: Unknown result type (might be due to invalid IL or missing references) //IL_0f9b: Unknown result type (might be due to invalid IL or missing references) //IL_0fa1: Unknown result type (might be due to invalid IL or missing references) //IL_0fd2: Unknown result type (might be due to invalid IL or missing references) //IL_0fd8: Unknown result type (might be due to invalid IL or missing references) //IL_1009: Unknown result type (might be due to invalid IL or missing references) //IL_100f: Unknown result type (might be due to invalid IL or missing references) //IL_1039: Unknown result type (might be due to invalid IL or missing references) //IL_103f: Unknown result type (might be due to invalid IL or missing references) //IL_106c: Unknown result type (might be due to invalid IL or missing references) //IL_1072: Unknown result type (might be due to invalid IL or missing references) Register(new EffectDefinition("common_skull_head", "Skull Head", "CFXR2 Skull Head Alt 1", RewardTier.Common, EffectPosition.Torso, EffectTrigger.Looping)); Register(new EffectDefinition("common_ground_hit", "Ground Hit", "CFXR2 Ground Hit 1", RewardTier.Common, EffectPosition.Feet, EffectTrigger.OnLand)); Register(new EffectDefinition("common_bubble_breath", "Bubble Breath", "CFXR4 Bubbles Breath Underwater Loop 1", RewardTier.Common, EffectPosition.Feet, EffectTrigger.Looping)); Register(new EffectDefinition("common_flash", "Flash", "CFXR Flash 1", RewardTier.Common, EffectPosition.Torso, EffectTrigger.OnSpray)); Register(new EffectDefinition("common_magic_poof", "Magic Poof", "CFXR Magic Poof 1", RewardTier.Common, EffectPosition.Torso, EffectTrigger.OnSpray)); Register(new EffectDefinition("common_smoke_source", "Smoke Source", "CFXR Smoke Source 3D 1", RewardTier.Common, EffectPosition.Feet, EffectTrigger.Looping)); Register(new EffectDefinition("common_poison_cloud", "Poison Cloud", "CFXR2 Poison Cloud 1", RewardTier.Common, EffectPosition.Torso, EffectTrigger.Looping)); Register(new EffectDefinition("common_ambient_glows", "Ambient Glows", "CFXR3 Ambient Glows 1", RewardTier.Common, EffectPosition.Feet, EffectTrigger.Looping)); Register(new EffectDefinition("common_wallplant_smoke", "Smoke Hit", "CFXR3 Hit Misc F Smoke 1", RewardTier.Common, EffectPosition.Torso, EffectTrigger.OnWallPlant)); RegisterNew(new EffectDefinition("common_debuff", "Debuff", "NEW - Debuff", RewardTier.Common, EffectPosition.Feet, EffectTrigger.OnGrindLooping)); RegisterNew(new EffectDefinition("common_lightning_aura", "Lightning Aura", "NEW - Lightning aura", RewardTier.Common, EffectPosition.Torso, EffectTrigger.OnGraceStartLooping)); RegisterNew(new EffectDefinition("common_electro_hit", "Electro Hit", "NEW - Electro hit", RewardTier.Common, EffectPosition.Torso, EffectTrigger.OnSpray)); RegisterNew(new EffectDefinition("common_explosion", "Explosion", "NEW - Explosion", RewardTier.Common, EffectPosition.Torso, EffectTrigger.OnBoost)); RegisterNew(new EffectDefinition("common_green_hit", "Green Hit", "NEW - Green hit", RewardTier.Common, EffectPosition.Torso, EffectTrigger.OnSpray)); RegisterNew(new EffectDefinition("common_holy_hit", "Holy Hit", "NEW - Holy hit", RewardTier.Common, EffectPosition.Torso, EffectTrigger.OnBoost)); RegisterNew(new EffectDefinition("common_love_hit", "Love Hit", "NEW - Love hit", RewardTier.Common, EffectPosition.Torso, EffectTrigger.OnGrind)); RegisterNew(new EffectDefinition("common_star_hit", "Star Hit", "NEW - Star hit", RewardTier.Common, EffectPosition.Torso, EffectTrigger.OnGrind)); RegisterNew(new EffectDefinition("common_snow_hit", "Snow Hit", "NEW - Snow hit", RewardTier.Common, EffectPosition.Torso, EffectTrigger.OnManual)); RegisterNew(new EffectDefinition("common_stones_hit", "Stones Hit", "NEW - Stones hit", RewardTier.Common, EffectPosition.Torso, EffectTrigger.OnManual)); RegisterNew(new EffectDefinition("common_electro_slash", "Electro Slash", "NEW - Electro slash", RewardTier.Common, EffectPosition.Feet, EffectTrigger.OnSpray)); RegisterNew(new EffectDefinition("common_snow_slash", "Snow Slash", "NEW - Snow slash", RewardTier.Common, EffectPosition.Feet, EffectTrigger.OnSpray)); RegisterNew(new EffectDefinition("common_stone_slash", "Stone Slash", "NEW - Stone slash", RewardTier.Common, EffectPosition.Feet, EffectTrigger.OnSpray)); RegisterNew(new EffectDefinition("common_sparks_blue", "Blue Sparks", "NEW - Sparks blue", RewardTier.Common, EffectPosition.Feet, EffectTrigger.OnGrindLooping)); RegisterNew(new EffectDefinition("common_sparks_pink", "Pink Sparks", "NEW - Sparks pink", RewardTier.Common, EffectPosition.Feet, EffectTrigger.OnGrindLooping)); RegisterNew(new EffectDefinition("common_sparks_green", "Green Sparks", "NEW - Sparks green", RewardTier.Common, EffectPosition.Feet, EffectTrigger.OnGrindLooping)); RegisterNew(new EffectDefinition("common_sparks_explode_blue", "Blue Spark Burst", "NEW - Sparks explode blue", RewardTier.Common, EffectPosition.Torso, EffectTrigger.OnBoost)); RegisterNew(new EffectDefinition("common_sparks_explode_green", "Green Spark Burst", "NEW - Sparks explode green", RewardTier.Common, EffectPosition.Torso, EffectTrigger.OnBoost)); RegisterNew(new EffectDefinition("common_sparks_explode_pink", "Pink Spark Burst", "NEW - Sparks explode pink", RewardTier.Common, EffectPosition.Torso, EffectTrigger.OnEmote)); RegisterNew(new EffectDefinition("common_sparks_explode_red", "Red Spark Burst", "NEW - Sparks explode red", RewardTier.Common, EffectPosition.Torso, EffectTrigger.OnSpray)); RegisterNew(new EffectDefinition("common_sparks_explode_white", "White Spark Burst", "NEW - Sparks explode white", RewardTier.Common, EffectPosition.Torso, EffectTrigger.OnComboBank)); RegisterNew(new EffectDefinition("common_sparks_explode_yellow", "Yellow Spark Burst", "NEW - Sparks explode yellow", RewardTier.Common, EffectPosition.Torso, EffectTrigger.OnEmote)); Register(new EffectDefinition("rare_fire_hit", "Fire Hit", "CFXR3 Hit Fire B (Air) 1", RewardTier.Rare, EffectPosition.Torso, EffectTrigger.OnSpray)); Register(new EffectDefinition("rare_sun", "Sun", "CFXR4 Sun 1", RewardTier.Rare, EffectPosition.Feet, EffectTrigger.Looping)); Register(new EffectDefinition("rare_electric_hit", "Electric Hit", "CFXR3 Hit Electric C (Air) 1", RewardTier.Rare, EffectPosition.Torso, EffectTrigger.OnSpray)); Register(new EffectDefinition("rare_explosion", "Explosion", "CFXR Explosion Smoke 2 Solo (HDR) 1", RewardTier.Rare, EffectPosition.Torso, EffectTrigger.OnGraceEnd)); Register(new EffectDefinition("rare_firework_shoot", "Firework Shoot", "CFXR4 Firework HDR Shoot Single (Random Color) 1", RewardTier.Rare, EffectPosition.Feet, EffectTrigger.OnSpray)); Register(new EffectDefinition("rare_water_splash", "Water Splash", "CFXR Water Splash (Smaller) 1", RewardTier.Rare, EffectPosition.Feet, EffectTrigger.OnLand)); Register(new EffectDefinition("rare_broken_heart", "Broken Heart", "CFXR2 Broken Heart 1", RewardTier.Rare, EffectPosition.Torso, EffectTrigger.OnDeath)); Register(new EffectDefinition("rare_smoke_hit", "Smoke Hit", "CFXR3 Hit Misc A 1", RewardTier.Rare, EffectPosition.Torso, EffectTrigger.OnSpray)); Register(new EffectDefinition("rare_rain_fall", "Rain Fall", "CFXR4 Rain Falling 1", RewardTier.Rare, EffectPosition.AboveHead, EffectTrigger.Looping)); Register(new EffectDefinition("rare_ice_trail_wide", "Ice Trail (Wide)", "CFXR4 Sword Trail ICE (360 Thin Spiral) 1", RewardTier.Rare, EffectPosition.Torso, EffectTrigger.OnSpray)); Register(new EffectDefinition("rare_ice_trail_small", "Ice Trail (Small)", "CFXR4 Sword Trail ICE (360 Spiral) 1", RewardTier.Rare, EffectPosition.Torso, EffectTrigger.OnSpray)); Register(new EffectDefinition("rare_ice_hit", "Ice Hit", "CFXR4 Sword Hit ICE (Cross) 1", RewardTier.Rare, EffectPosition.Torso, EffectTrigger.OnSpray)); Register(new EffectDefinition("rare_fire_trail_wide", "Fire Trail (Wide)", "CFXR4 Sword Trail FIRE (360 Thin Spiral) 1", RewardTier.Rare, EffectPosition.Torso, EffectTrigger.OnSpray)); Register(new EffectDefinition("rare_fire_trail_small", "Fire Trail (Small)", "CFXR4 Sword Trail FIRE (360 Spiral) 1", RewardTier.Rare, EffectPosition.Torso, EffectTrigger.OnSpray)); Register(new EffectDefinition("rare_fire_sword_hit", "Fire Hit (Sword)", "CFXR4 Sword Hit FIRE (Cross) 1", RewardTier.Rare, EffectPosition.Torso, EffectTrigger.OnSpray)); RegisterNew(new EffectDefinition("rare_aoe_slash_blue", "Blue AoE Slash", "NEW - AoE slash blue", RewardTier.Rare, EffectPosition.Torso, EffectTrigger.OnSpray)); RegisterNew(new EffectDefinition("rare_aoe_slash_green", "Green AoE Slash", "NEW - AoE slash green", RewardTier.Rare, EffectPosition.Torso, EffectTrigger.OnSpray)); RegisterNew(new EffectDefinition("rare_aoe_slash_orange", "Orange AoE Slash", "NEW - AoE slash orange", RewardTier.Rare, EffectPosition.Torso, EffectTrigger.OnSpray)); RegisterNew(new EffectDefinition("rare_healing", "Healing", "NEW - Healing", RewardTier.Rare, EffectPosition.Feet, EffectTrigger.OnBoostLooping)); RegisterNew(new EffectDefinition("rare_magic_shield_blue", "Blue Magic Shield", "NEW - Magic shield blue", RewardTier.Rare, EffectPosition.Feet, EffectTrigger.OnSlide)); RegisterNew(new EffectDefinition("rare_magic_shield_yellow", "Yellow Magic Shield", "NEW - Magic shield yellow", RewardTier.Rare, EffectPosition.Feet, EffectTrigger.OnSlide)); RegisterNew(new EffectDefinition("rare_magic_shield_pink", "Pink Magic Shield", "NEW - Magic shield pink", RewardTier.Rare, EffectPosition.Feet, EffectTrigger.OnSlide)); RegisterNew(new EffectDefinition("rare_charge_slash_blue", "Blue Charge Slash", "NEW - Charge slash blue", RewardTier.Rare, EffectPosition.Torso, EffectTrigger.OnBoostTrick)); RegisterNew(new EffectDefinition("rare_charge_slash_purple", "Purple Charge Slash", "NEW - Charge slash purple", RewardTier.Rare, EffectPosition.Torso, EffectTrigger.OnBoostTrick)); RegisterNew(new EffectDefinition("rare_charge_slash_red", "Red Charge Slash", "NEW - Charge slash red", RewardTier.Rare, EffectPosition.Torso, EffectTrigger.OnBoostTrick)); Register(new EffectDefinition("epic_big_explosion_smoke", "Big Explosion Smoke", "CFXR Explosion 2", RewardTier.Epic, EffectPosition.Torso, EffectTrigger.OnGraceEnd)); Register(new EffectDefinition("epic_fire_explosion", "Fire Explosion", "CFXR3 Fire Explosion B 1", RewardTier.Epic, EffectPosition.Torso, EffectTrigger.OnSpray)); Register(new EffectDefinition("epic_firework", "Firework", "CFXR4 Firework 1 Cyan-Purple (HDR) 1", RewardTier.Epic, EffectPosition.Torso, EffectTrigger.OnSpray)); Register(new EffectDefinition("epic_hit_ice", "Hit Ice", "CFXR3 Hit Ice B (Air) 1", RewardTier.Epic, EffectPosition.Torso, EffectTrigger.OnBoostTrick)); Register(new EffectDefinition("epic_falling_stars", "Falling Stars", "CFXR4 Falling Stars 1", RewardTier.Epic, EffectPosition.AboveHead, EffectTrigger.Looping)); Register(new EffectDefinition("epic_cartoon_fight", "Cartoon Fight", "CFXR2 Cartoon Fight (Loop) 1", RewardTier.Epic, EffectPosition.Torso, EffectTrigger.OnSpray)); Register(new EffectDefinition("epic_word_wow", "WOW", "CFXR3 _WOW_ 1", RewardTier.Epic, EffectPosition.Torso, EffectTrigger.OnBoostTrick)); Register(new EffectDefinition("epic_word_wham", "WHAM", "CFXR2 _WHAM_ 4", RewardTier.Epic, EffectPosition.Torso, EffectTrigger.OnBoostTrick)); Register(new EffectDefinition("epic_word_cursed", "CURSED", "CFXR2 _CURSED_ 1", RewardTier.Epic, EffectPosition.Torso, EffectTrigger.OnSpray)); Register(new EffectDefinition("epic_word_slash", "SLASH", "CFXR _SLASH_ 1", RewardTier.Epic, EffectPosition.Torso, EffectTrigger.OnSpray)); Register(new EffectDefinition("epic_word_pow", "POW", "CFXR _POW_ 1", RewardTier.Epic, EffectPosition.Torso, EffectTrigger.OnWallPlant)); Register(new EffectDefinition("epic_word_boom", "BOOM", "CFXR _BOOM_ 1", RewardTier.Epic, EffectPosition.Torso, EffectTrigger.OnGraceEnd)); Register(new EffectDefinition("epic_word_boing", "BOING", "CFXR _BOING_ 1", RewardTier.Epic, EffectPosition.Torso, EffectTrigger.OnJump)); Register(new EffectDefinition("epic_hit_leaves", "Hit Leaves", "CFXR3 Hit Leaves A (Lit) 1", RewardTier.Epic, EffectPosition.Torso, EffectTrigger.OnSpray)); Register(new EffectDefinition("epic_water_ripples", "Water Ripples", "CFXR Water Ripples 1", RewardTier.Epic, EffectPosition.Feet, EffectTrigger.OnLand)); RegisterNew(new EffectDefinition("epic_laser_aoe", "Laser AoE", "NEW - Laser AOE", RewardTier.Epic, EffectPosition.Feet, EffectTrigger.OnGraceStartLooping)); RegisterNew(new EffectDefinition("epic_plexus_aoe", "Plexus AoE", "NEW - Plexus AoE", RewardTier.Epic, EffectPosition.Torso, EffectTrigger.OnBoostTrick)); RegisterNew(new EffectDefinition("epic_red_energy_explosion", "Red Energy Explosion", "NEW - Red energy explosion", RewardTier.Epic, EffectPosition.Feet, EffectTrigger.OnComboBank)); RegisterNew(new EffectDefinition("epic_love_aura", "Love Aura", "NEW - Love aura", RewardTier.Epic, EffectPosition.Feet, EffectTrigger.OnBoostLooping)); RegisterNew(new EffectDefinition("epic_portal_blue", "Blue Portal", "NEW - Portal blue", RewardTier.Epic, EffectPosition.Feet, EffectTrigger.OnGraceEnd)); RegisterNew(new EffectDefinition("epic_portal_green", "Green Portal", "NEW - Portal green", RewardTier.Epic, EffectPosition.Feet, EffectTrigger.OnGraceEnd)); RegisterNew(new EffectDefinition("epic_portal_red", "Red Portal", "NEW - Portal red", RewardTier.Epic, EffectPosition.Feet, EffectTrigger.OnGraceStartLooping)); RegisterNew(new EffectDefinition("epic_portal_yellow", "Yellow Portal", "NEW - Portal yellow", RewardTier.Epic, EffectPosition.Feet, EffectTrigger.OnGraceStartLooping)); Register(new EffectDefinition("legendary_fire", "Fire", "CFXR Fire 1", RewardTier.Legendary, EffectPosition.Feet, EffectTrigger.Looping)); Register(new EffectDefinition("legendary_souls_escape", "Souls Escape", "CFXR2 Souls Escape 1", RewardTier.Legendary, EffectPosition.Feet, EffectTrigger.Looping)); Register(new EffectDefinition("legendary_purple_explosion", "Purple Explosion", "CFXR2 WW Enemy Explosion 1", RewardTier.Legendary, EffectPosition.Torso, EffectTrigger.OnGraceEnd)); Register(new EffectDefinition("legendary_electrified", "Electrified", "CFXR Electrified 4", RewardTier.Legendary, EffectPosition.Torso, EffectTrigger.Looping)); Register(new EffectDefinition("legendary_cartoon_explosion", "Explosion", "CFXR2 WW Explosion 1", RewardTier.Legendary, EffectPosition.Feet, EffectTrigger.OnGraceEnd)); Register(new EffectDefinition("legendary_yellow_hit", "Yellow Hit", "CFXR Hit D 3D (Yellow) 1", RewardTier.Legendary, EffectPosition.Torso, EffectTrigger.OnBoostTrick)); Register(new EffectDefinition("legendary_glowing_impact", "Glowing Impact", "CFXR Impact Glowing HDR (Blue) 1", RewardTier.Legendary, EffectPosition.Torso, EffectTrigger.OnEmote)); Register(new EffectDefinition("legendary_hit_light", "Hit Light", "CFXR3 Hit Light B (Air) 1", RewardTier.Legendary, EffectPosition.Torso, EffectTrigger.OnSpray)); Register(new EffectDefinition("legendary_light_glow", "Light Glow", "CFXR3 LightGlow A (Loop) 1", RewardTier.Legendary, EffectPosition.Torso, EffectTrigger.Looping)); Register(new EffectDefinition("legendary_magic_aura", "Magic Aura", "CFXR3 Magic Aura A (Runic) 1", RewardTier.Legendary, EffectPosition.Feet, EffectTrigger.Looping)); Register(new EffectDefinition("legendary_shiny_aura", "Shiny Aura", "CFXR2 Shiny Item (Loop) 1", RewardTier.Legendary, EffectPosition.Torso, EffectTrigger.Looping)); Register(new EffectDefinition("legendary_leaves_shield", "Leaves Shield", "CFXR3 Shield Leaves A (Lit) 1", RewardTier.Legendary, EffectPosition.Feet, EffectTrigger.Looping)); Register(new EffectDefinition("legendary_bouncing_glow_bubble", "Bouncing Glow Bubble", "CFXR4 Bouncing Glows Bubble (Blue Purple) 1", RewardTier.Legendary, EffectPosition.Torso, EffectTrigger.Looping)); Register(new EffectDefinition("legendary_fire_breath", "Fire Breath", "CFXR Fire Breath 1", RewardTier.Legendary, EffectPosition.Feet, EffectTrigger.Looping)); RegisterNew(new EffectDefinition("legendary_buff", "Buff", "NEW - Buff", RewardTier.Legendary, EffectPosition.Feet, EffectTrigger.OnBoostLooping)); RegisterNew(new EffectDefinition("legendary_plexus", "Plexus", "NEW - Plexus", RewardTier.Legendary, EffectPosition.Feet, EffectTrigger.Looping)); RegisterNew(new EffectDefinition("legendary_star_aura", "Star Aura", "NEW - Star aura", RewardTier.Legendary, EffectPosition.Feet, EffectTrigger.Looping)); RegisterNew(new EffectDefinition("legendary_freeze_circle", "Freeze Circle", "NEW - Freeze circle", RewardTier.Legendary, EffectPosition.Feet, EffectTrigger.OnSprayAttempt)); RegisterNew(new EffectDefinition("legendary_healing_circle", "Healing Circle", "NEW - Healing circle", RewardTier.Legendary, EffectPosition.Feet, EffectTrigger.OnSprayAttempt)); RegisterNew(new EffectDefinition("legendary_magic_circle", "Magic Circle", "NEW - Magic circle", RewardTier.Legendary, EffectPosition.Feet, EffectTrigger.OnEmote)); RegisterNew(new EffectDefinition("legendary_magic_circle_2", "Magic Circle 2", "NEW - Magic circle 2", RewardTier.Legendary, EffectPosition.Feet, EffectTrigger.OnSprayAttempt)); EffectDefinition effectDefinition = new EffectDefinition("mythic_crown", "Mythic Crown", "MythicCrown", RewardTier.Mythic, EffectPosition.AboveHead, EffectTrigger.Looping); effectDefinition.IsPassive = true; Register(effectDefinition); EffectDefinition effectDefinition2 = new EffectDefinition("mythic_pumpkin", "Jack O'Lantern", "Pumpkin", RewardTier.Mythic, EffectPosition.AboveHead, EffectTrigger.Looping); effectDefinition2.IsPassive = true; effectDefinition2.IsNew = true; Register(effectDefinition2); EffectDefinition effectDefinition3 = new EffectDefinition("mythic_skull", "Skull Mask", "Skull", RewardTier.Mythic, EffectPosition.AboveHead, EffectTrigger.Looping); effectDefinition3.IsPassive = true; effectDefinition3.IsNew = true; Register(effectDefinition3); EffectDefinition effectDefinition4 = new EffectDefinition("special_bday_hat", "Birthday Hat", "BDAY", RewardTier.Special, EffectPosition.AboveHead, EffectTrigger.Looping); effectDefinition4.IsPassive = true; Register(effectDefinition4); EffectDefinition effectDefinition5 = new EffectDefinition("special_badge", "AMT Badge", "AMT_Badge", RewardTier.Special, EffectPosition.Torso, EffectTrigger.Looping); effectDefinition5.IsPassive = true; Register(effectDefinition5); EffectDefinition effectDefinition6 = new EffectDefinition("special_glasses", "Glasses", "glasses", RewardTier.Special, EffectPosition.AboveHead, EffectTrigger.Looping); effectDefinition6.IsPassive = true; Register(effectDefinition6); } } public class GamblingSaveData : CustomSaveData { public bool HasReceivedStartingRep = false; public int Rep = 0; public List<string> OwnedEffectIds = new List<string>(); public List<string> EquippedEffectIds = new List<string>(); public const int MaxEquipped = 5; public int TotalCasesOpened = 0; public long TotalRepEarned = 0L; public long TotalRepSpent = 0L; public float BiggestComboScore = 0f; public int GraceWins = 0; public int GraceLosses = 0; public int WagerWins = 0; public int WagerLosses = 0; public int BiggestWagerWon = 0; public int RarestItemRank = 0; public string RarestItemName = ""; public string RarestItemRarity = ""; public int BlackjackLosses = 0; public long BlackjackNetRep = 0L; private bool isDirty = false; public static GamblingSaveData Instance { get; private set; } public bool IsEquipped(string effectId) { return EquippedEffectIds.Contains(effectId); } public GamblingSaveData() : base("BRCGambling", "gambling_save_{0}.dat") { Instance = this; } public static void Register() { new GamblingSaveData(); } public override void Initialize() { if (!HasReceivedStartingRep) { Rep = 500; HasReceivedStartingRep = true; ((CustomSaveData)this).Save(); } } public override void Read(BinaryReader reader) { Rep = reader.ReadInt32(); int num = reader.ReadInt32(); OwnedEffectIds = new List<string>(); for (int i = 0; i < num; i++) { OwnedEffectIds.Add(reader.ReadString()); } int num2 = reader.ReadInt32(); EquippedEffectIds = new List<string>(); for (int j = 0; j < num2; j++) { EquippedEffectIds.Add(reader.ReadString()); } if (reader.BaseStream.Position < reader.BaseStream.Length) { HasReceivedStartingRep = reader.ReadBoolean(); } else { HasReceivedStartingRep = true; } if (reader.BaseStream.Position < reader.BaseStream.Length) { TotalCasesOpened = reader.ReadInt32(); } if (reader.BaseStream.Position < reader.BaseStream.Length) { TotalRepEarned = reader.ReadInt64(); } if (reader.BaseStream.Position < reader.BaseStream.Length) { TotalRepSpent = reader.ReadInt64(); } if (reader.BaseStream.Position < reader.BaseStream.Length) { BiggestComboScore = reader.ReadSingle(); } if (reader.BaseStream.Position < reader.BaseStream.Length) { GraceWins = reader.ReadInt32(); } if (reader.BaseStream.Position < reader.BaseStream.Length) { GraceLosses = reader.ReadInt32(); } if (reader.BaseStream.Position < reader.BaseStream.Length) { WagerWins = reader.ReadInt32(); } if (reader.BaseStream.Position < reader.BaseStream.Length) { WagerLosses = reader.ReadInt32(); } if (reader.BaseStream.Position < reader.BaseStream.Length) { BiggestWagerWon = reader.ReadInt32(); } if (reader.BaseStream.Position < reader.BaseStream.Length) { RarestItemRank = reader.ReadInt32(); } if (reader.BaseStream.Position < reader.BaseStream.Length) { RarestItemName = reader.ReadString(); } if (reader.BaseStream.Position < reader.BaseStream.Length) { RarestItemRarity = reader.ReadString(); } if (reader.BaseStream.Position < reader.BaseStream.Length) { BlackjackLosses = reader.ReadInt32(); } if (reader.BaseStream.Position < reader.BaseStream.Length) { BlackjackNetRep = reader.ReadInt64(); } } public override void Write(BinaryWriter writer) { writer.Write(Rep); writer.Write(OwnedEffectIds.Count); foreach (string ownedEffectId in OwnedEffectIds) { writer.Write(ownedEffectId); } writer.Write(EquippedEffectIds.Count); foreach (string equippedEffectId in EquippedEffectIds) { writer.Write(equippedEffectId); } writer.Write(HasReceivedStartingRep); writer.Write(TotalCasesOpened); writer.Write(TotalRepEarned); writer.Write(TotalRepSpent); writer.Write(BiggestComboScore); writer.Write(GraceWins); writer.Write(GraceLosses); writer.Write(WagerWins); writer.Write(WagerLosses); writer.Write(BiggestWagerWon); writer.Write(RarestItemRank); writer.Write(RarestItemName); writer.Write(RarestItemRarity); writer.Write(BlackjackLosses); writer.Write(BlackjackNetRep); } public void TrackRarestItem(EffectDefinition def) { int rarityRank = GetRarityRank(def.Rarity); if (rarityRank > RarestItemRank) { RarestItemRank = rarityRank; RarestItemName = def.DisplayName; RarestItemRarity = def.Rarity.ToString(); } } public static int GetRarityRank(RewardTier rarity) { return rarity switch { RewardTier.Common => 1, RewardTier.Rare => 2, RewardTier.Epic => 3, RewardTier.Legendary => 4, RewardTier.Mythic => 5, RewardTier.Special => 6, _ => 0, }; } public void AddEffect(string effectId) { if (!OwnedEffectIds.Contains(effectId)) { OwnedEffectIds.Add(effectId); EffectDefinition effectDefinition = EffectRegistry.Get(effectId); if (effectDefinition != null) { TrackRarestItem(effectDefinition); } } MarkDirty(); ((CustomSaveData)this).Save(); } public bool TryEquip(string effectId) { if (IsEquipped(effectId)) { return true; } bool flag = EffectRegistry.Get(effectId)?.IsPassive ?? false; if (!flag) { int num = (from id in EquippedEffectIds select EffectRegistry.Get(id) into d where d != null && !d.IsPassive select d).Count(); if (num >= 5) { return false; } } EquippedEffectIds.Add(effectId); ((CustomSaveData)this).Save(); EffectTriggerManager.RefreshLoopingEffects(); if (flag) { PassiveSync.BroadcastStateUpdate(); } return true; } public void Unequip(string effectId) { bool flag = EffectRegistry.Get(effectId)?.IsPassive ?? false; EquippedEffectIds.Remove(effectId); ((CustomSaveData)this).Save(); EffectTriggerManager.RefreshLoopingEffects(); if (flag) { PassiveSync.BroadcastStateUpdate(); } } public void RemoveEffect(string effectId) { bool flag = EffectRegistry.Get(effectId)?.IsPassive ?? false; bool flag2 = IsEquipped(effectId); OwnedEffectIds.Remove(effectId); EquippedEffectIds.Remove(effectId); ((CustomSaveData)this).Save(); EffectTriggerManager.RefreshLoopingEffects(); if (flag && flag2) { PassiveSync.BroadcastStateUpdate(); } } public void MarkDirty() { isDirty = true; } public void SaveIfDirty() { if (isDirty) { isDirty = false; ((CustomSaveData)this).Save(); } } } public class AppCaseOpening : CustomApp { public override void OnAppInit() { ((CustomApp)this).OnAppInit(); ((CustomApp)this).CreateTitleBar("Opening...", (Sprite)null, 80f); } } public class AppGambling : CustomApp { private enum AppScreen { MainMenu, CaseOpening, Inventory, ItemConfirm, Result, BlackjackBet, BlackjackGame, BlackjackResult, WagerMain, WagerLobby, Stats, Redeem } private PhoneButton repDisplayButton; public static AppGambling Instance; private BlackjackGame currentBlackjackGame; private BlackjackOverlay currentBlackjackOverlay; private int savedInventoryIndex = 0; private int savedBlackjackBetIndex = 0; private int savedWagerLobbyIndex = 0; private int currentBet = 60; private const int BetIncrement = 20; private const int MinBet = 60; private const int MaxBet = 50000; private bool blackjackAnimating = false; private bool quickOpenEnabled = false; private AppScreen currentScreen = AppScreen.MainMenu; private EffectDefinition currentConfirmDef; private const string COLOR_HEADER = "#1A1A4E"; private const string COLOR_DIVIDER = "#2A2A6E"; private const string COLOR_REP = "#FFD700"; private const string COLOR_POSITIVE = "#44FF44"; private const string COLOR_NEGATIVE = "#FF4444"; private const string COLOR_WAGER = "#FF8800"; private const string COLOR_CASE = "#88CCFF"; private const string COLOR_INVENTORY = "#CC44FF"; private const string COLOR_BLACKJACK = "#44FF44"; private const string COLOR_DESC = "#888888"; private const string COLOR_REDEEM = "#FFD700"; private const int MultiOpenCount = 10; internal const string RedeemUrl = "https://script.google.com/macros/s/AKfycbw5o0iymgetqflC2AxscMtq6KkRjgPCPHLsUENp5nhXxE11RJ2v93wTfkgccDwTyaM/exec"; private const int RedeemTimeoutSeconds = 20; private static bool redeemInProgress; private static int MultiOpenCost => GamblingManager.SpinCost * 10; private static string SupportId { get { string text = SystemInfo.deviceUniqueIdentifier ?? ""; return ((text.Length > 8) ? text.Substring(0, 8) : text).ToUpperInvariant(); } } private static string SupportHint => "<color=#888888>Never got your reward? Send chimp the code and your Support ID: </color><color=#FFD700>" + SupportId + "</color>"; public static void Initialize() { PhoneAPI.RegisterApp<AppGambling>("Gambling!", GamblingPlugin.AppIcon); } public override void OnAppInit() { RedeemClaims.ConfirmAll(); Instance = this; ((CustomApp)this).OnAppInit(); ((CustomApp)this).CreateTitleBar("Monkey Casino", GamblingPlugin.AppIcon, 80f); base.ScrollView = PhoneScrollView.Create((CustomApp)(object)this, 275f, 1600f); WagerSync.OnLobbyUpdated = delegate { if (currentScreen == AppScreen.WagerLobby) { ShowWagerLobby(); } else if (currentScreen == AppScreen.WagerMain) { ShowWagerMain(); } }; WagerSync.OnKicked = delegate { currentScreen = AppScreen.WagerMain; base.ScrollView.RemoveAllButtons(); SimplePhoneButton val = PhoneUIUtility.CreateSimpleButton("Back"); ((PhoneButton)val).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val).OnConfirm, (Action)delegate { ShowMainMenu(); }); base.ScrollView.AddButton((PhoneButton)(object)val); AddHeader("Wager Race"); AddDescription("You were kicked from the wager lobby."); AddDescription("Host a new lobby or join another one."); }; WagerSync.OnResolve = delegate(ushort winnerId, int matched, string winnerName) { ShowWagerResult(winnerId, matched, winnerName); }; ShowMainMenu(); } private void AddHeader(string text) { SimplePhoneButton val = PhoneUIUtility.CreateSimpleButton("<color=#1A1A4E>── " + text + " ──</color>"); base.ScrollView.AddButton((PhoneButton)(object)val); } private void AddDivider(string text) { SimplePhoneButton val = PhoneUIUtility.CreateSimpleButton("<color=#2A2A6E>── " + text + " ──</color>"); base.ScrollView.AddButton((PhoneButton)(object)val); } private void AddDescription(string text) { //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) SimplePhoneButton val = PhoneUIUtility.CreateSimpleButton("<color=#888888>" + text + "</color>"); TextMeshProUGUI componentInChildren = ((Component)val).GetComponentInChildren<TextMeshProUGUI>(); if ((Object)(object)componentInChildren != (Object)null) { ((TMP_Text)componentInChildren).enableWordWrapping = true; ((TMP_Text)componentInChildren).ForceMeshUpdate(false, false); RectTransform component = ((Component)val).GetComponent<RectTransform>(); if ((Object)(object)component != (Object)null) { component.sizeDelta = new Vector2(component.sizeDelta.x, ((TMP_Text)componentInChildren).preferredHeight + 16f); } } base.ScrollView.AddButton((PhoneButton)(object)val); } private void RestoreIndex(int index) { base.ScrollView.SelectedIndex = Mathf.Clamp(index, 0, base.ScrollView.Buttons.Count - 1); base.ScrollView.UpdateButtons(); } private void ShowMainMenu() { currentScreen = AppScreen.MainMenu; base.ScrollView.RemoveAllButtons(); int num = GamblingManager.Rep / GamblingManager.SpinCost; repDisplayButton = (PhoneButton)(object)PhoneUIUtility.CreateSimpleButton(string.Format("<color={0}>REP: {1} ({2} cases)</color>", "#FFD700", GamblingManager.Rep, num)); base.ScrollView.AddButton(repDisplayButton); SimplePhoneButton val = PhoneUIUtility.CreateSimpleButton("<color=#88CCFF>Open Spray Case</color>"); ((PhoneButton)val).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val).OnConfirm, (Action)delegate { ShowCaseOpening(); }); base.ScrollView.AddButton((PhoneButton)(object)val); SimplePhoneButton val2 = PhoneUIUtility.CreateSimpleButton("<color=#CC44FF>Inventory</color>"); ((PhoneButton)val2).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val2).OnConfirm, (Action)delegate { ShowInventory(); }); base.ScrollView.AddButton((PhoneButton)(object)val2); SimplePhoneButton val3 = PhoneUIUtility.CreateSimpleButton("<color=#44FF44>Blackjack</color>"); ((PhoneButton)val3).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val3).OnConfirm, (Action)delegate { ShowBlackjackBet(); }); base.ScrollView.AddButton((PhoneButton)(object)val3); SimplePhoneButton val4 = PhoneUIUtility.CreateSimpleButton("<color=#FF8800>Wager Race</color>"); ((PhoneButton)val4).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val4).OnConfirm, (Action)delegate { ShowWagerMain(); }); base.ScrollView.AddButton((PhoneButton)(object)val4); SimplePhoneButton val5 = PhoneUIUtility.CreateSimpleButton("<color=#FFD700>Redeem Code</color>"); ((PhoneButton)val5).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val5).OnConfirm, (Action)delegate { TextInput.Instance.ShowOkCancel((Action<string>)delegate(string text) { StartRedeem(text.Trim()); }, (Action<string>)delegate { }, (Func<string, bool>)((string text) => text.Length > 0), "Enter your redemption code.", 30, "AMT-XXXXX-XXXXX", ""); }); base.ScrollView.AddButton((PhoneButton)(object)val5); SimplePhoneButton val6 = PhoneUIUtility.CreateSimpleButton("<color=#888888>Stats</color>"); ((PhoneButton)val6).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val6).OnConfirm, (Action)delegate { ShowStats(); }); base.ScrollView.AddButton((PhoneButton)(object)val6); RestoreIndex(1); } private void ShowCaseOpening(bool selectMulti = false) { currentScreen = AppScreen.CaseOpening; base.ScrollView.RemoveAllButtons(); SimplePhoneButton val = PhoneUIUtility.CreateSimpleButton("Back"); ((PhoneButton)val).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val).OnConfirm, (Action)delegate { ShowMainMenu(); }); base.ScrollView.AddButton((PhoneButton)(object)val); int num = -1; int num2 = -1; if (GamblingManager.Rep >= GamblingManager.SpinCost) { num = base.ScrollView.Buttons.Count; SimplePhoneButton val2 = PhoneUIUtility.CreateSimpleButton(string.Format("<color={0}>Open Case ({1} REP)</color>", "#88CCFF", GamblingManager.SpinCost)); ((PhoneButton)val2).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val2).OnConfirm, (Action)delegate { OpenSingleCase(); }); base.ScrollView.AddButton((PhoneButton)(object)val2); } else { SimplePhoneButton val3 = PhoneUIUtility.CreateSimpleButton("<color=#FF4444>Not enough REP, boss up and get some.</color>"); base.ScrollView.AddButton((PhoneButton)(object)val3); } if (GamblingManager.Rep >= MultiOpenCost) { num2 = base.ScrollView.Buttons.Count; SimplePhoneButton val4 = PhoneUIUtility.CreateSimpleButton(string.Format("<color={0}>Open x{1} Cases ({2} REP)</color>", "#88CCFF", 10, MultiOpenCost)); ((PhoneButton)val4).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val4).OnConfirm, (Action)delegate { OpenMultiCase(); }); base.ScrollView.AddButton((PhoneButton)(object)val4); } SimplePhoneButton val5 = PhoneUIUtility.CreateSimpleButton(quickOpenEnabled ? "<color=#44FF44>Quick Open: ON</color>" : "<color=#888888>Quick Open: OFF</color>"); ((PhoneButton)val5).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val5).OnConfirm, (Action)delegate { int selectedIndex = base.ScrollView.SelectedIndex; quickOpenEnabled = !quickOpenEnabled; ShowCaseOpening(); RestoreIndex(selectedIndex); }); base.ScrollView.AddButton((PhoneButton)(object)val5); int num3 = GamblingManager.Rep / GamblingManager.SpinCost; repDisplayButton = (PhoneButton)(object)PhoneUIUtility.CreateSimpleButton(string.Format("<color={0}>REP: {1} ({2} cases)</color>", "#FFD700", GamblingManager.Rep, num3)); base.ScrollView.AddButton(repDisplayButton); AddDescription(quickOpenEnabled ? "Quick Open: fast spins and a short summary. Duplicates are sold automatically." : "Duplicates are sold automatically."); if (selectMulti && num2 >= 0) { RestoreIndex(num2); } else if (num >= 0) { RestoreIndex(num); } } private void OpenSingleCase() { if (GamblingManager.Rep >= GamblingManager.SpinCost) { GamblingManager.Rep -= GamblingManager.SpinCost; ShowOpeningLabel("Opening..."); ((MonoBehaviour)this).StartCoroutine(LaunchOverlay(quickOpenEnabled)); } } private void OpenMultiCase() { if (GamblingManager.Rep >= MultiOpenCost) { GamblingManager.Rep -= MultiOpenCost; ShowOpeningLabel($"Opening {10} cases..."); ((MonoBehaviour)this).StartCoroutine(LaunchMultiOverlay(quickOpenEnabled)); } } private void ShowOpeningLabel(string text) { base.ScrollView.RemoveAllButtons(); base.ScrollView.AddButton((PhoneButton)(object)PhoneUIUtility.CreateSimpleButton(text)); } private IEnumerator LaunchOverlay(bool fast = false) { GamblingSaveData.Instance.TotalCasesOpened++; yield return null; CaseOpeningOverlay.Create((MonoBehaviour)(object)this, fast, delegate(RewardTier result, EffectDefinition effect) { ShowCaseResults(new List<(RewardTier, EffectDefinition)> { (result, effect) }, multi: false); }); } private IEnumerator LaunchMultiOverlay(bool fast = false) { GamblingSaveData.Instance.TotalCasesOpened += 10; yield return null; CaseOpeningOverlay.CreateMulti((MonoBehaviour)(object)this, fast, delegate(List<(RewardTier, EffectDefinition)> results) { ShowCaseResults(results, multi: true); }); } private void ShowCaseResults(List<(RewardTier tier, EffectDefinition effect)> results, bool multi) { currentScreen = AppScreen.Result; base.ScrollView.RemoveAllButtons(); List<EffectDefinition> list = new List<EffectDefinition>(); List<EffectDefinition> list2 = new List<EffectDefinition>(); foreach (var result in results) { var (rewardTier, effect) = result; if (effect != null) { if (GamblingSaveData.Instance.OwnedEffectIds.Contains(effect.Id) || list.Any((EffectDefinition e) => e.Id == effect.Id)) { list2.Add(effect); } else { list.Add(effect); } } } foreach (EffectDefinition item in list) { GamblingSaveData.Instance.AddEffect(item.Id); } int num = list2.Sum((EffectDefinition d) => GamblingManager.GetSellValue(d.Rarity)); if (num > 0) { GamblingManager.Rep += num; } SimplePhoneButton val = PhoneUIUtility.CreateSimpleButton("Back"); ((PhoneButton)val).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val).OnConfirm, (Action)delegate { ShowCaseOpening(multi); }); base.ScrollView.AddButton((PhoneButton)(object)val); int num2 = (multi ? MultiOpenCost : GamblingManager.SpinCost); if (GamblingManager.Rep >= num2) { string text = (multi ? $"Open x{10} again ({num2} REP)" : $"Open again ({num2} REP)"); SimplePhoneButton val2 = PhoneUIUtility.CreateSimpleButton("<color=#88CCFF>" + text + "</color>"); ((PhoneButton)val2).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val2).OnConfirm, (Action)delegate { if (multi) { OpenMultiCase(); } else { OpenSingleCase(); } }); base.ScrollView.AddButton((PhoneButton)(object)val2); } foreach (EffectDefinition item2 in list.OrderByDescending((EffectDefinition i) => GamblingSaveData.GetRarityRank(i.Rarity))) { base.ScrollView.AddButton((PhoneButton)(object)PhoneUIUtility.CreateSimpleButton("<color=#44FF44>NEW!</color> " + FormatItem(item2))); } if (!multi) { if (list2.Count == 1) { base.ScrollView.AddButton((PhoneButton)(object)PhoneUIUtility.CreateSimpleButton(FormatItem(list2[0]) + " <color=#888888>duplicate, sold for</color> " + string.Format("<color={0}>+{1} REP</color>", "#FFD700", num))); } } else { if (list.Count == 0) { base.ScrollView.AddButton((PhoneButton)(object)PhoneUIUtility.CreateSimpleButton("<color=#888888>No new items this time.</color>")); } if (list2.Count > 0) { base.ScrollView.AddButton((PhoneButton)(object)PhoneUIUtility.CreateSimpleButton(string.Format("{0} duplicate{1} sold for ", list2.Count, (list2.Count > 1) ? "s" : "") + string.Format("<color={0}>+{1} REP</color>", "#FFD700", num))); if (!quickOpenEnabled) { AddDivider("Sold"); var orderedEnumerable = from d in list2 group d by d.Id into g select new { Def = g.First(), Count = g.Count() } into g orderby GamblingSaveData.GetRarityRank(g.Def.Rarity) descending, g.Def.DisplayName select g; foreach (var item3 in orderedEnumerable) { int num3 = GamblingManager.GetSellValue(item3.Def.Rarity) * item3.Count; string text2 = ((item3.Count > 1) ? $" x{item3.Count}" : ""); base.ScrollView.AddButton((PhoneButton)(object)PhoneUIUtility.CreateSimpleButton(string.Format("{0}{1} <color={2}>(+{3} REP)</color>", FormatItem(item3.Def), text2, "#888888", num3))); } } } } if (multi || results.Count <= 0) { return; } var (rewardTier2, effectDefinition) = results[0]; if (rewardTier2 == RewardTier.Epic || rewardTier2 == RewardTier.Legendary || rewardTier2 == RewardTier.Mythic) { string text3 = ((effectDefinition != null) ? effectDefinition.DisplayName : "Unknown Item"); string text4 = rewardTier2 switch { RewardTier.Legendary => "You opened a <color=yellow>LEGENDARY " + text3 + "</color>", RewardTier.Mythic => "<color=white>- MYTHIC - " + text3 + " has been unboxed!</color>", _ => "You opened a <color=red>EPIC " + text3 + "</color>", }; ChatUI instance = ChatUI.Instance; if ((Object)(object)instance != (Object)null && GamblingPlugin.ShowChatMessages.Value) { instance.AddMessage(text4); } } } private string FormatItem(EffectDefinition def) { string text = ((def.Rarity == RewardTier.Mythic) ? "* MYTHIC *" : $"[{def.Rarity}]"); return "<color=" + GetRarityColor(def.Rarity) + ">" + text + " " + def.DisplayName + "</color>"; } private string GetRarityColor(RewardTier rarity) { return rarity switch { RewardTier.Legendary => "#FFD700", RewardTier.Epic => "#FF4444", RewardTier.Rare => "#CC44FF", RewardTier.Common => "#4488FF", RewardTier.Mythic => "#FFFFFF", RewardTier.Special => "#44FF88", _ => "#FFFFFF", }; } private void ShowInventory() { currentScreen = AppScreen.Inventory; base.ScrollView.RemoveAllButtons(); SimplePhoneButton val = PhoneUIUtility.CreateSimpleButton("Back"); ((PhoneButton)val).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val).OnConfirm, (Action)delegate { ShowMainMenu(); }); base.ScrollView.AddButton((PhoneButton)(object)val); AddHeader("Inventory"); int num = (from id in GamblingSaveData.Instance.EquippedEffectIds select EffectRegistry.Get(id) into d where d != null && !d.IsPassive select d).Count(); SimplePhoneButton val2 = PhoneUIUtility.CreateSimpleButton($"Equipped: {num}/{5}"); base.ScrollView.AddButton((PhoneButton)(object)val2); if (GamblingSaveData.Instance.OwnedEffectIds.Count == 0) { AddDescription("No items owned yet. Open a case!"); return; } int num2 = 0; int num3 = 0; int num4 = 0; int num5 = 0; int num6 = 0; int num7 = 0; foreach (string ownedEffectId in GamblingSaveData.Instance.OwnedEffectIds) { EffectDefinition effectDefinition = EffectRegistry.Get(ownedEffectId); if (effectDefinition != null) { switch (effectDefinition.Rarity) { case RewardTier.Common: num2++; break; case RewardTier.Rare: num3++; break; case RewardTier.Epic: num4++; break; case RewardTier.Legendary: num5++; break; case RewardTier.Mythic: num6++; break; case RewardTier.Special: num7++; break; } } } AddDivider("Browse by Rarity"); if (num7 > 0) { SimplePhoneButton val3 = PhoneUIUtility.CreateSimpleButton(string.Format("<color=#44FF88>[Special] — {0} item{1}</color>", num7, (num7 > 1) ? "s" : "")); ((PhoneButton)val3).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val3).OnConfirm, (Action)delegate { ShowInventoryRarity(RewardTier.Special); }); base.ScrollView.AddButton((PhoneButton)(object)val3); } if (num6 > 0) { SimplePhoneButton val4 = PhoneUIUtility.CreateSimpleButton(string.Format("<color=#FFFFFF>[Mythic] — {0} item{1}</color>", num6, (num6 > 1) ? "s" : "")); ((PhoneButton)val4).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val4).OnConfirm, (Action)delegate { ShowInventoryRarity(RewardTier.Mythic); }); base.ScrollView.AddButton((PhoneButton)(object)val4); } if (num5 > 0) { int num8 = (from id in GamblingSaveData.Instance.EquippedEffectIds select EffectRegistry.Get(id) into d where d != null && d.Rarity == RewardTier.Legendary select d).Count(); string arg = ((num8 > 0) ? $" <color=#44FF44>({num8} equipped)</color>" : ""); SimplePhoneButton val5 = PhoneUIUtility.CreateSimpleButton(string.Format("<color=#FFD700>[Legendary] — {0} item{1}</color>{2}", num5, (num5 > 1) ? "s" : "", arg)); ((PhoneButton)val5).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val5).OnConfirm, (Action)delegate { ShowInventoryRarity(RewardTier.Legendary); }); base.ScrollView.AddButton((PhoneButton)(object)val5); } if (num4 > 0) { int num9 = (from id in GamblingSaveData.Instance.EquippedEffectIds select EffectRegistry.Get(id) into d where d != null && d.Rarity == RewardTier.Epic select d).Count(); string arg2 = ((num9 > 0) ? $" <color=#44FF44>({num9} equipped)</color>" : ""); SimplePhoneButton val6 = PhoneUIUtility.CreateSimpleButton(string.Format("<color=#FF4444>[Epic] — {0} item{1}</color>{2}", num4, (num4 > 1) ? "s" : "", arg2)); ((PhoneButton)val6).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val6).OnConfirm, (Action)delegate { ShowInventoryRarity(RewardTier.Epic); }); base.ScrollView.AddButton((PhoneButton)(object)val6); } if (num3 > 0) { int num10 = (from id in GamblingSaveData.Instance.EquippedEffectIds select EffectRegistry.Get(id) into d where d != null && d.Rarity == RewardTier.Rare select d).Count(); string arg3 = ((num10 > 0) ? $" <color=#44FF44>({num10} equipped)</color>" : ""); SimplePhoneButton val7 = PhoneUIUtility.CreateSimpleButton(string.Format("<color=#CC44FF>[Rare] — {0} item{1}</color>{2}", num3, (num3 > 1) ? "s" : "", arg3)); ((PhoneButton)val7).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val7).OnConfirm, (Action)delegate { ShowInventoryRarity(RewardTier.Rare); }); base.ScrollView.AddButton((PhoneButton)(object)val7); } if (num2 > 0) { int num11 = (from id in GamblingSaveData.Instance.EquippedEffectIds select EffectRegistry.Get(id) into d where d != null && d.Rarity == RewardTier.Common select d).Count(); string arg4 = ((num11 > 0) ? $" <color=#44FF44>({num11} equipped)</color>" : ""); SimplePhoneButton val8 = PhoneUIUtility.CreateSimpleButton(string.Format("<color=#4488FF>[Common] — {0} item{1}</color>{2}", num2, (num2 > 1) ? "s" : "", arg4)); ((PhoneButton)val8).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val8).OnConfirm, (Action)delegate { ShowInventoryRarity(RewardTier.Common); }); base.ScrollView.AddButton((PhoneButton)(object)val8); } } private void ShowInventoryRarity(RewardTier rarity) { currentScreen = AppScreen.Inventory; base.ScrollView.RemoveAllButtons(); SimplePhoneButton val = PhoneUIUtility.CreateSimpleButton("Back"); ((PhoneButton)val).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val).OnConfirm, (Action)delegate { ShowInventory(); }); base.ScrollView.AddButton((PhoneButton)(object)val); string rarityColor = GetRarityColor(rarity); AddHeader($"{rarity} Effects"); IOrderedEnumerable<EffectDefinition> orderedEnumerable = from id in GamblingSaveData.Instance.OwnedEffectIds select EffectRegistry.Get(id) into effectDefinition where effectDefinition != null && effectDefinition.Rarity == rarity orderby effectDefinition.DisplayName select effectDefinition; foreach (EffectDefinition def in orderedEnumerable) { string text = (GamblingSaveData.Instance.IsEquipped(def.Id) ? " <color=#44FF44>(Equipped)</color>" : ""); string triggerDescription = GetTriggerDescription(def.Trigger); string text2 = (def.IsNew ? " <color=#8B8000>[NEW]</color>" : ""); string text3 = "<color=" + rarityColor + ">" + def.DisplayName + "</color>" + text2 + text + " <color=#888888>" + triggerDescription + "</color>"; SimplePhoneButton val2 = PhoneUIUtility.CreateSimpleButton(text3); ((PhoneButton)val2).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val2).OnConfirm, (Action)delegate { savedInventoryIndex = base.ScrollView.SelectedIndex; ShowItemConfirm(def); }); base.ScrollView.AddButton((PhoneButton)(object)val2); } } private string GetTriggerDescription(EffectTrigger trigger) { return trigger switch { EffectTrigger.Looping => "— always on", EffectTrigger.OnSpray => "— on graffiti", EffectTrigger.OnSprayAttempt => "— on spray press", EffectTrigger.OnJump => "— on jump", EffectTrigger.OnLand => "— on land", EffectTrigger.OnWallPlant => "— on wall plant", EffectTrigger.OnBoostTrick => "— on boost trick", EffectTrigger.OnBoost => "— on boost", EffectTrigger.OnBoostLooping => "— while boosting", EffectTrigger.OnSlide => "— on slide", EffectTrigger.OnGraceEnd => "— on grace end", EffectTrigger.OnGraceStart => "— on grace start", EffectTrigger.OnGraceStartLooping => "— during grace", EffectTrigger.OnDeath => "— on death", EffectTrigger.OnEmote => "— on emote", EffectTrigger.OnGrind => "— on grind start", EffectTrigger.OnGrindLooping => "— while grinding", EffectTrigger.OnManual => "— on manual", EffectTrigger.OnComboBank => "— on combo bank", _ => "", }; } private void ShowItemConfirm(EffectDefinition def) { savedInventoryIndex = base.ScrollView.SelectedIndex; currentScreen = AppScreen.ItemConfirm; currentConfirmDef = def; base.ScrollView.RemoveAllButtons(); SimplePhoneButton val = PhoneUIUtility.CreateSimpleButton("Back"); ((PhoneButton)val).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val).OnConfirm, (Action)delegate { ShowInventoryRarity(def.Rarity); RestoreIndex(savedInventoryIndex); }); base.ScrollView.AddButton((PhoneButton)(object)val); string rarityColor = GetRarityColor(def.Rarity); SimplePhoneButton val2 = PhoneUIUtility.CreateSimpleButton($"<color={rarityColor}>[{def.Rarity}] {def.DisplayName}</color>"); base.ScrollView.AddButton((PhoneButton)(object)val2); if (GamblingSaveData.Instance.IsEquipped(def.Id)) { SimplePhoneButton val3 = PhoneUIUtility.CreateSimpleButton("Unequip"); ((PhoneButton)val3).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val3).OnConfirm, (Action)delegate { GamblingSaveData.Instance.Unequip(def.Id); ShowInventory(); RestoreIndex(savedInventoryIndex); }); base.ScrollView.AddButton((PhoneButton)(object)val3); if (def.Rarity != RewardTier.Special && def.Rarity != RewardTier.Mythic) { SimplePhoneButton val4 = PhoneUIUtility.CreateSimpleButton("Unequip to sell this item."); base.ScrollView.AddButton((PhoneButton)(object)val4); } return; } if (def.IsPassive || (from id in GamblingSaveData.Instance.EquippedEffectIds select EffectRegistry.Get(id) into d where d != null && !d.IsPassive select d).Count() < 5) { SimplePhoneButton val5 = PhoneUIUtility.CreateSimpleButton("Equip"); ((PhoneButton)val5).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val5).OnConfirm, (Action)delegate { GamblingSaveData.Instance.TryEquip(def.Id); ShowInventory(); RestoreIndex(savedInventoryIndex); }); base.ScrollView.AddButton((PhoneButton)(object)val5); } else { SimplePhoneButton val6 = PhoneUIUtility.CreateSimpleButton("You need to unequip an effect first."); base.ScrollView.AddButton((PhoneButton)(object)val6); } if (def.Rarity == RewardTier.Special || def.Rarity == RewardTier.Mythic) { SimplePhoneButton val7 = PhoneUIUtility.CreateSimpleButton("<color=#FF4444>This item cannot be sold.</color>"); base.ScrollView.AddButton((PhoneButton)(object)val7); return; } int sellValue = GamblingManager.GetSellValue(def.Rarity); SimplePhoneButton val8 = PhoneUIUtility.CreateSimpleButton($"Sell for {sellValue} REP"); ((PhoneButton)val8).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val8).OnConfirm, (Action)delegate { TextInput.Instance.ShowOkCancel((Action<string>)delegate { GamblingSaveData.Instance.RemoveEffect(def.Id); GamblingManager.Rep += sellValue; ShowInventory(); }, (Action<string>)delegate { }, (Func<string, bool>)((string text) => true), $"Sell {def.DisplayName} for {sellValue} REP? This cannot be undone.", 1, "", ""); }); base.ScrollView.AddButton((PhoneButton)(object)val8); } public static void RefreshRepDisplay() { if (!((Object)(object)Instance == (Object)null) && !((Object)(object)Instance.repDisplayButton == (Object)null)) { TextMeshProUGUI componentInChildren = ((Component)Instance.repDisplayButton).GetComponentInChildren<TextMeshProUGUI>(); if ((Object)(object)componentInChildren != (Object)null) { int num = GamblingManager.Rep / GamblingManager.SpinCost; ((TMP_Text)componentInChildren).text = string.Format("<color={0}>REP: {1} ({2} cases)</color>", "#FFD700", GamblingManager.Rep, num); } } } private void StartRedeem(string code) { if (redeemInProgress) { ShowRedeemScreen("<color=#888888>Already redeeming a code, hang on...</color>"); } else { ((MonoBehaviour)GamblingPlugin.Instance).StartCoroutine(RedeemCodeCoroutine(code)); } } private IEnumerator RedeemCodeCoroutine(string code) { redeemInProgress = true; ShowRedeemScreen("Redeeming...", "<color=#888888>You can close the phone, the reward is still applied.</color>"); string machineId = SystemInfo.deviceUniqueIdentifier; string url = "https://script.google.com/macros/s/AKfycbw5o0iymgetqflC2AxscMtq6KkRjgPCPHLsUENp5nhXxE11RJ2v93wTfkgccDwTyaM/exec?key=" + UnityWebRequest.EscapeURL(code) + "&machineId=" + UnityWebRequest.EscapeURL(machineId) + "&v=2"; string json = null; string error = null; UnityWebRequest request = UnityWebRequest.Get(url); try { request.timeout = 20; yield return request.SendWebRequest(); if ((int)request.result == 1) { json = request.downloadHandler.text; } else { error = request.error; } } finally { ((IDisposable)request)?.Dispose(); } string message; try { if (json == null) { Debug.LogWarning((object)("[BRCGambling] Redeem request failed: " + error + " (support ID " + SupportId + ")")); message = "<color=#FF4444>Network error or timeout. Try again later.</color>\n" + SupportHint; } else { message = ApplyRedeemResponse(json); } } catch (Exception ex) { Exception e = ex; Debug.LogError((object)$"[BRCGambling] Redeem failed (support ID {SupportId}). Response: {json}\n{e}"); message = "<color=#FF4444>Something went wrong. Check your inventory/REP.</color>\n" + SupportHint; } finally { redeemInProgress = false; GamblingSaveData instance = GamblingSaveData.Instance; if (instance != null) { ((CustomSaveData)instance).Save(); } } if (currentScreen == AppScreen.Redeem) { ShowRedeemScreen(message); } if (!((Behaviour)this).isActiveAndEnabled) { ChatUI instance2 = ChatUI.Instance; if (instance2 != null) { instance2.AddMessage(message); } } } private void ShowRedeemScreen(params string[] lines) { currentScreen = AppScreen.Redeem; base.ScrollView.RemoveAllButtons(); SimplePhoneButton val = PhoneUIUtility.CreateSimpleButton("Back"); ((PhoneButton)val).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val).OnConfirm, (Action)delegate { ShowMainMenu(); }); base.ScrollView.AddButton((PhoneButton)(object)val); AddHeader("Redeem Code"); foreach (string text in lines) { if (string.IsNullOrEmpty(text)) { continue; } string[] array = text.Split('\n'); foreach (string text2 in array) { if (text2.Length > 0) { AddWrapped(text2); } } } } private void AddWrapped(string text) { //IL_0042: 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) SimplePhoneButton val = PhoneUIUtility.CreateSimpleButton(text); TextMeshProUGUI componentInChildren = ((Component)val).GetComponentInChildren<TextMeshProUGUI>(); if ((Object)(object)componentInChildren != (Object)null) { ((TMP_Text)componentInChildren).enableWordWrapping = true; ((TMP_Text)componentInChildren).ForceMeshUpdate(false, false); RectTransform component = ((Component)val).GetComponent<RectTransform>(); if ((Object)(object)component != (Object)null) { component.sizeDelta = new Vector2(component.sizeDelta.x, ((TMP_Text)componentInChildren).preferredHeight + 16f); } } base.ScrollView.AddButton((PhoneButton)(object)val); } private string ApplyRedeemResponse(string json) { if (json.Contains("needs_support")) { return "<color=#FF4444>This reward couldn't be delivered automatically.</color>\n" + SupportHint; } if (json.Contains("already_redeemed")) { return "<color=#FF4444>This code has already been used.</color>"; } if (json.Contains("invalid_key")) { return "<color=#FF4444>Invalid code.</color>"; } if (!json.Contains("\"success\":true")) { Debug.LogWarning((object)("[BRCGambling] Unexpected redeem response: " + json)); return "<color=#FF4444>Something went wrong. Try again.</color>"; } string text = ExtractJsonString(json, "claimId"); if (text != null && RedeemClaims.IsPaid(text)) { RedeemClaims.ConfirmAll(); return "<color=#888888>You already received this reward.</color>"; } string result = GrantRedeemPurpose(json); if (text != null) { ((CustomSaveData)GamblingSaveData.Instance).Save(); RedeemClaims.MarkPaid(text); RedeemClaims.ConfirmAll(); } return result; } private static string ExtractJsonString(string json, string field) { Match match = Regex.Match(json, "\"" + field + "\"\\s*:\\s*\"([^\"]+)\""); return match.Success ? match.Groups[1].Value : null; } private string GrantRedeemPurpose(string json) { if (HasPurpose(json, "rep_200")) { GamblingManager.Rep += 200; return "<color=#44FF44>Code redeemed! +200 REP!</color>"; } if (HasPurpose(json, "rep_10000")) { GamblingManager.Rep += 10000; return "<color=#44FF44>Code redeemed! +10000 REP!</color>"; } if (HasPurpose(json, "rep_5000_halloween")) { GamblingManager.Rep += 5000; return "<color=#FF8800>Happy Halloween! +5000 REP!</color>"; } if (HasPurpose(json, "mythic_crown")) { return GrantItem("mythic_crown", 10000, "#FFFFFF", "* MYTHIC * Mythic Crown added to inventory!", "You already own the crown! +10,000 REP instead."); } if (HasPurpose(json, "special_bday_hat")) { return GrantItem("special_bday_hat", 5000, "#44FF88", "[Special] Birthday Hat added to inventory!", "You already have the Birthday Hat! +5000 REP instead."); } if (HasPurpose(json, "special_badge")) { return GrantItem("special_badge", 5000, "#44FF88", "[Special] AMT Badge added to inventory!", "You already have the badge! +5000 REP instead."); } if (HasPurpose(json, "special_glasses")) { return GrantItem("special_glasses", 5000, "#44FF88", "[Special] Glasses added to inventory!", "You already have the glasses! +5000 REP instead."); } if (HasPurpose(json, "mythic_pumpkin")) { return GrantItem("mythic_pumpkin", 5000, "#FF8800", "[Mythic] Jack O'Lantern added to inventory!", "You already have the Jack O'Lantern! +5000 REP instead."); } if (HasPurpose(json, "mythic_skull")) { return GrantItem("mythic_skull", 5000, "#AAAAAA", "[Mythic] Skull Mask added to inventory!", "You already have the Skull Mask! +5000 REP instead."); } Debug.LogWarning((object)("[BRCGambling] Redeem succeeded with an unknown purpose: " + json)); return "<color=#44FF44>Code redeemed!</color>"; } private static bool HasPurpose(string json, string purpose) { return json.Contains("\"purpose\":\"" + purpose + "\""); } private string GrantItem(string effectId, int repIfOwned, string color, string addedText, string ownedText) { if (!GamblingSaveData.Instance.OwnedEffectIds.Contains(effectId)) { GamblingSaveData.Instance.AddEffect(effectId); return "<color=" + color + ">" + addedText + "</color>"; } GamblingManager.Rep += repIfOwned; return "<color=" + color + ">" + ownedText + "</color>"; } private void ShowBlackjackBet() { currentScreen = AppScreen.BlackjackBet; if ((Object)(object)currentBlackjackOverlay != (Object)null) { currentBlackjackOverlay.Cleanup(); currentBlackjackOverlay = null; } currentBet = Mathf.Clamp(currentBet, 60, Mathf.Min(50000, GamblingManager.Rep)); base.ScrollView.RemoveAllButtons(); SimplePhoneButton val = PhoneUIUtility.CreateSimpleButton("Back"); ((PhoneButton)val).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val).OnConfirm, (Action)delegate { ShowMainMenu(); }); base.ScrollView.AddButton((PhoneButton)(object)val); AddHeader("Blackjack"); SimplePhoneButton val2 = PhoneUIUtility.CreateSimpleButton($"Your REP: {GamblingManager.Rep}"); base.ScrollView.AddButton((PhoneButton)(object)val2); SimplePhoneButton val3 = PhoneUIUtility.CreateSimpleButton($"Bet: {currentBet} REP"); base.ScrollView.AddButton((PhoneButton)(object)val3); SimplePhoneButton val4 = PhoneUIUtility.CreateSimpleButton(string.Format("<color={0}>+ {1} REP</color>", "#44FF44", 20)); ((PhoneButton)val4).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val4).OnConfirm, (Action)delegate { ((CustomApp)this).PlaySelectSFX(); int selectedIndex = base.ScrollView.SelectedIndex; currentBet = Mathf.Min(currentBet + 20, Mathf.Min(50000, GamblingManager.Rep)); ShowBlackjackBet(); RestoreIndex(selectedIndex); }); base.ScrollView.AddButton((PhoneButton)(object)val4); SimplePhoneButton val5 = PhoneUIUtility.CreateSimpleButton(string.Format("<color={0}>- {1} REP</color>", "#FF4444", 20)); ((PhoneButton)val5).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val5).OnConfirm, (Action)delegate { ((CustomApp)this).PlaySelectSFX(); int selectedIndex = base.ScrollView.SelectedIndex; currentBet = Mathf.Max(currentBet - 20, 60); ShowBlackjackBet(); RestoreIndex(selectedIndex); }); base.ScrollView.AddButton((PhoneButton)(object)val5); SimplePhoneButton val6 = PhoneUIUtility.CreateSimpleButton("<color=#888888>Enter custom bet</color>"); ((PhoneButton)val6).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val6).OnConfirm, (Action)delegate { int result; TextInput.Instance.ShowOkCancel((Action<string>)delegate(string text) { if (int.TryParse(text, out result)) { currentBet = Mathf.Clamp(result, 60, Mathf.Min(50000, GamblingManager.Rep)); ShowBlackjackBet(); } }, (Action<string>)delegate { }, (Func<string, bool>)((string text) => int.TryParse(text, out result) && result >= 60 && result <= 50000), $"Enter bet amount ({60} - {50000} REP).", 6, currentBet.ToString(), currentBet.ToString()); }); base.ScrollView.AddButton((PhoneButton)(object)val6); if (GamblingManager.Rep >= 60) { SimplePhoneButton val7 = PhoneUIUtility.CreateSimpleButton("<color=#FFD700>DEAL</color>"); ((PhoneButton)val7).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val7).OnConfirm, (Action)delegate { if (GamblingManager.Rep >= currentBet) { ((CustomApp)this).PlayConfirmSFX(); savedBlackjackBetIndex = base.ScrollView.SelectedIndex; GamblingManager.Rep -= currentBet; currentBlackjackGame = new BlackjackGame(); currentBlackjackGame.StartGame(currentBet); ShowBlackjackGame(); } }); base.ScrollView.AddButton((PhoneButton)(object)val7); } else { SimplePhoneButton val8 = PhoneUIUtility.CreateSimpleButton("<color=#FF4444>Not enough REP to play!</color>"); base.ScrollView.AddButton((PhoneButton)(object)val8); } } private void ShowBlackjackGame() { currentScreen = AppScreen.BlackjackGame; blackjackAnimating = true; base.ScrollView.RemoveAllButtons(); SimplePhoneButton val = PhoneUIUtility.CreateSimpleButton("Dealing cards..."); base.ScrollView.AddButton((PhoneButton)(object)val); currentBlackjackOverlay = BlackjackOverlay.Create((MonoBehaviour)(object)this, currentBlackjackGame, delegate { blackjackAnimating = false; if (currentBlackjackGame.Result != BlackjackResult.None) { HandleBlackjackEnd(); } else { ShowBlackjackActions(); } }); } private void ShowBlackjackActions() { base.ScrollView.RemoveAllButtons(); SimplePhoneButton val = PhoneUIUtility.CreateSimpleButton("Hit"); ((PhoneButton)val).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val).OnConfirm, (Action)delegate { if (!blackjackAnimating) { blackjackAnimating = true; currentBlackjackGame.Hit(); currentBlackjackOverlay.TriggerHit(delegate { blackjackAnimating = false; if (currentBlackjackGame.Result != BlackjackResult.None) { HandleBlackjackEnd(); } else { ShowBlackjackActions(); } }); } }); base.ScrollView.AddButton((PhoneButton)(object)val); SimplePhoneButton val2 = PhoneUIUtility.CreateSimpleButton("Stand"); ((PhoneButton)val2).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val2).OnConfirm, (Action)delegate { if (!blackjackAnimating) { blackjackAnimating = true; int count = currentBlackjackGame.DealerHand.Count; currentBlackjackGame.Stand(); currentBlackjackOverlay.TriggerStand(count, delegate { HandleBlackjackEnd(); }); } }); base.ScrollView.AddButton((PhoneButton)(object)val2); } private void HandleBlackjackEnd() { blackjackAnimating = true; BlackjackResult result = currentBlackjackGame.Result; int num = 0; switch (result) { case BlackjackResult.PlayerBlackjack: num = Mathf.RoundToInt((float)currentBlackjackGame.Bet * 1.5f); GamblingManager.Rep += currentBlackjackGame.Bet + num; GamblingSaveData.Instance.BlackjackNetRep += currentBlackjackGame.Bet + num; break; case BlackjackResult.PlayerWin: case BlackjackResult.DealerBust: num = currentBlackjackGame.Bet; GamblingManager.Rep += currentBlackjackGame.Bet + num; GamblingSaveData.Instance.BlackjackNetRep += currentBlackjackGame.Bet + num; break; case BlackjackResult.Push: GamblingManager.Rep += currentBlackjackGame.Bet; break; case BlackjackResult.DealerWin: case BlackjackResult.PlayerBust: GamblingSaveData.Instance.BlackjackLosses++; GamblingSaveData.Instance.BlackjackNetRep -= currentBlackjackGame.Bet; break; } currentBlackjackOverlay.TriggerResult(result, num, delegate { blackjackAnimating = false; currentBlackjackOverlay.Cleanup(); currentBlackjackOverlay = null; ShowBlackjackBet(); RestoreIndex(savedBlackjackBetIndex); }); } private void ShowWagerMain() { currentScreen = AppScreen.WagerMain; base.ScrollView.RemoveAllButtons(); SimplePhoneButton val = PhoneUIUtility.CreateSimpleButton("Back"); ((PhoneButton)val).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val).OnConfirm, (Action)delegate { ShowMainMenu(); }); base.ScrollView.AddButton((PhoneButton)(object)val); AddHeader("Wager Race"); SimplePhoneButton val2 = PhoneUIUtility.CreateSimpleButton("<color=#99FF99>How wager races work →</color>"); ((PhoneButton)val2).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val2).OnConfirm, (Action)delegate { InfoOverlay.Show((MonoBehaviour)(object)this, "HOW WAGER RACES WORK", new string[10] { "1. Host or join a wager lobby.", "2. Set your wager amount.", "3. Press Ready Up.", "4. Host locks the lobby when all ready.", "5. Exit the casino app.", "6. Start a grace through ACN as normal.", "7. Winner gets the matched pot automatically.", "", "The lobby stays active until the", "grace ends — do not close it!" }); }); base.ScrollView.AddButton((PhoneButton)(object)val2); if (WagerLobbyManager.State != WagerLobbyState.Idle) { SimplePhoneButton val3 = PhoneUIUtility.CreateSimpleButton("<color=#FF8800>View Current Lobby</color>"); ((PhoneButton)val3).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val3).OnConfirm, (Action)delegate { ShowWagerLobby(); }); base.ScrollView.AddButton((PhoneButton)(object)val3); return; } AddDivider("Host a Lobby"); SimplePhoneButton val4 = PhoneUIUtility.CreateSimpleButton("Host Public Lobby"); ((PhoneButton)val4).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val4).OnConfirm, (Action)delegate { WagerSync.CreateLobby(isPublic: true); ShowWagerLobby(); }); base.ScrollView.AddButton((PhoneButton)(object)val4); SimplePhoneButton val5 = PhoneUIUtility.CreateSimpleButton("Host Private Lobby"); ((PhoneButton)val5).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val5).OnConfirm, (Action)delegate { WagerSync.CreateLobby(isPublic: false); ShowWagerLobby(); }); base.ScrollView.AddButton((PhoneButton)(object)val5); AddDivider("Join a Lobby"); ClientController instance = ClientController.Instance; if ((Object)(object)instance != (Object)null && WagerLobbyManager.HostId != 0 && WagerLobbyManager.IsPublic && !WagerLobbyManager.LocalPlayerInLobby()) { SimplePhoneButton val6 = PhoneUIUtility.CreateSimpleButton("<color=#44FF44>Join Available Public Lobby</color>"); ((PhoneButton)val6).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val6).OnConfirm, (Action)delegate { WagerSync.RequestJoin(); ShowWagerLobby(); }); base.ScrollView.AddButton((PhoneButton)(object)val6); } else if ((Object)(object)instance == (Object)null) { SimplePhoneButton val7 = PhoneUIUtility.CreateSimpleButton("<color=#888888>ACN multiplayer required.</color>"); base.ScrollView.AddButton((PhoneButton)(object)val7); }