using System; using System.Diagnostics; using System.IO; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Logging; using GameNetcodeStuff; using HarmonyLib; using Microsoft.CodeAnalysis; using UnityEngine; using UnityEngine.Events; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("LGUSportsbook")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+8c5521e37f37e3d76518a16d04e5d1051842f105")] [assembly: AssemblyProduct("LGUSportsbook")] [assembly: AssemblyTitle("LGUSportsbook")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace LGUSportsbook { [BepInPlugin("com.y4ngz.lgusportsbook", "LGUSportsbook", "0.1.0")] [BepInDependency(/*Could not decode attribute arguments.*/)] public class Plugin : BaseUnityPlugin { public const string PLUGIN_GUID = "com.y4ngz.lgusportsbook"; public const string PLUGIN_NAME = "LGUSportsbook"; public const string PLUGIN_VERSION = "0.1.0"; private const string LETHAL_CASINO_GUID = "mrgrm7.LethalCasino"; private const string BUNDLE_FILENAME = "sportsbook.lethalbundle"; internal static ManualLogSource Log; public static AssetBundle SportsbookBundle; public static GameObject Y4NGZ_MarqueePrefab; public static GameObject SportsbookCounterPrefab; public static GameObject FrozenHoarderBugPrefab; private Harmony _harmony; internal static Plugin Instance { get; private set; } private void Awake() { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Expected O, but got Unknown Instance = this; Log = ((BaseUnityPlugin)this).Logger; LoadBundle(); NetcodeWeaver(); _harmony = new Harmony("com.y4ngz.lgusportsbook"); _harmony.PatchAll(Assembly.GetExecutingAssembly()); Log.LogInfo((object)"LGUSportsbook 0.1.0 loaded."); } private void LoadBundle() { string text = Path.Combine(Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location), "sportsbook.lethalbundle"); if (!File.Exists(text)) { Log.LogError((object)("Bundle not found at " + text + ". Sign + counter visuals will be skipped.")); return; } SportsbookBundle = AssetBundle.LoadFromFile(text); if ((Object)(object)SportsbookBundle == (Object)null) { Log.LogError((object)("Failed to load bundle: " + text)); return; } Y4NGZ_MarqueePrefab = SportsbookBundle.LoadAsset("Y4NGZ_Marquee"); SportsbookCounterPrefab = SportsbookBundle.LoadAsset("SportsbookCounter"); FrozenHoarderBugPrefab = SportsbookBundle.LoadAsset("FrozenHoarderBug"); if ((Object)(object)Y4NGZ_MarqueePrefab == (Object)null) { Log.LogWarning((object)"Y4NGZ_Marquee not found in bundle."); } if ((Object)(object)SportsbookCounterPrefab == (Object)null) { Log.LogWarning((object)"SportsbookCounter not found in bundle."); } } private static void NetcodeWeaver() { Type[] types = Assembly.GetExecutingAssembly().GetTypes(); for (int i = 0; i < types.Length; i++) { MethodInfo[] methods = types[i].GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic); foreach (MethodInfo methodInfo in methods) { if (methodInfo.GetCustomAttributes(typeof(RuntimeInitializeOnLoadMethodAttribute), inherit: false).Length != 0) { methodInfo.Invoke(null, null); } } } } } public static class MyPluginInfo { public const string PLUGIN_GUID = "LGUSportsbook"; public const string PLUGIN_NAME = "LGUSportsbook"; public const string PLUGIN_VERSION = "1.0.0"; } } namespace LGUSportsbook.Patches { [HarmonyPatch] internal static class CasinoBuildingPatch { private static readonly string[] LetterChildren = new string[6] { "LettersBulb01_C", "LettersBulb01_A (2)", "LettersBulb01_S", "LettersBulb01_I", "LettersBulb01_N", "LettersBulb01_O" }; private static readonly Vector3 MarqueeLocalPos = new Vector3(-2.95f, 7.1f, 2.55f); private static readonly Quaternion MarqueeLocalRot = Quaternion.Euler(0f, 180f, 0f); private static readonly Vector3 MarqueeLocalScale = new Vector3(1.35f, 1.35f, 1.3f); private static readonly Vector3 CounterWorldPos = new Vector3(-12f, -2.53f, 13f); private static readonly Quaternion CounterWorldRot = Quaternion.Euler(0f, 90f, 0f); private static MethodBase TargetMethod() { return AccessTools.Method("LethalCasino.Custom.CasinoBuilding:Awake", (Type[])null, (Type[])null); } private static void Postfix(Component __instance) { //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) Transform transform = __instance.transform; string[] letterChildren = LetterChildren; foreach (string text in letterChildren) { Transform val = transform.Find(text); if ((Object)(object)val != (Object)null) { ((Component)val).gameObject.SetActive(false); } else { Plugin.Log.LogWarning((object)("CASINO letter not found: " + text)); } } if ((Object)(object)Plugin.Y4NGZ_MarqueePrefab == (Object)null) { Plugin.Log.LogWarning((object)"[LGUSportsbook] Y4NGZ_Marquee prefab not loaded, skipping marquee instantiation"); } else { GameObject obj = Object.Instantiate(Plugin.Y4NGZ_MarqueePrefab, transform, false); obj.transform.localPosition = MarqueeLocalPos; obj.transform.localRotation = MarqueeLocalRot; obj.transform.localScale = MarqueeLocalScale; Plugin.Log.LogInfo((object)"[LGUSportsbook] Y4NGZ_Marquee instantiated at local (-2.95, 7.1, 2.55) rot (0, 180, 0) scale (1.35, 1.35, 1.3)"); } if ((Object)(object)Plugin.SportsbookCounterPrefab != (Object)null) { GameObject obj2 = Object.Instantiate(Plugin.SportsbookCounterPrefab, transform); obj2.transform.localPosition = transform.InverseTransformPoint(CounterWorldPos); obj2.transform.localRotation = Quaternion.Inverse(transform.rotation) * CounterWorldRot; obj2.transform.localScale = Vector3.one; } else { Plugin.Log.LogWarning((object)"SportsbookCounterPrefab not loaded — skipping counter placement."); } } } } namespace LGUSportsbook.Components { public class FrozenHoarderBug : MonoBehaviour { } public class SportsbookCounter : MonoBehaviour { private void Start() { //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Expected O, but got Unknown Transform val = ((Component)this).transform.Find("InteractTrigger"); if ((Object)(object)val == (Object)null) { Plugin.Log.LogWarning((object)"SportsbookCounter: child 'InteractTrigger' not found."); return; } InteractTrigger component = ((Component)val).GetComponent(); if ((Object)(object)component == (Object)null) { Plugin.Log.LogWarning((object)"SportsbookCounter: 'InteractTrigger' GameObject has no InteractTrigger component."); return; } if (component.onInteract == null) { component.onInteract = new InteractEvent(); } ((UnityEvent)(object)component.onInteract).AddListener((UnityAction)OnInteract); } private void OnInteract(PlayerControllerB player) { if (!((Object)(object)player == (Object)null)) { Plugin.Log.LogInfo((object)("[LGUSportsbook] Counter interacted by " + player.playerUsername)); } } } }