using System; using System.Collections.Generic; 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 HarmonyLib; using LethalLib.Modules; using Microsoft.CodeAnalysis; using UnityEngine; [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("myCardsMod")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.1.0")] [assembly: AssemblyInformationalVersion("1.0.1")] [assembly: AssemblyProduct("My Cards Mod")] [assembly: AssemblyTitle("myCardsMod")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.1.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 MyCardsMod { [BepInPlugin("com.tibby.lethalcardcollectorcomedic", "Lethal Card Collector - Comedic Version", "1.0.1")] [BepInDependency(/*Could not decode attribute arguments.*/)] public class Plugin : BaseUnityPlugin { private const string GUID = "com.tibby.lethalcardcollectorcomedic"; private const string NAME = "Lethal Card Collector - Comedic Version"; private const string VERSION = "1.0.1"; internal static ManualLogSource Log; internal static List LoadedCards = new List(); private readonly Harmony harmony = new Harmony("com.tibby.lethalcardcollectorcomedic"); private void Awake() { Log = ((BaseUnityPlugin)this).Logger; LoadCardsFromBundle(); harmony.PatchAll(); Log.LogInfo((object)"Card Mod loaded successfully!"); } private void LoadCardsFromBundle() { string text = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "kartybundle"); if (!File.Exists(text)) { Log.LogError((object)("[CRITICAL ERROR] Bundle not found: " + text)); return; } AssetBundle val = AssetBundle.LoadFromFile(text); if ((Object)(object)val == (Object)null) { Log.LogError((object)"[CRITICAL ERROR] Failed to load AssetBundle!"); return; } Dictionary dictionary = new Dictionary { { "Common1", 60 }, { "Common2", 60 }, { "Common3", 60 }, { "Uncommon1", 35 }, { "Uncommon2", 35 }, { "Uncommon3", 35 }, { "Rare1", 15 }, { "Rare2", 15 }, { "Rare3", 15 }, { "Legendary1", 7 }, { "Legendary2", 7 }, { "Mythic1", 3 }, { "Unknown1", 1 } }; int num = 0; foreach (KeyValuePair item in dictionary) { string key = item.Key; int value = item.Value; Item val2 = val.LoadAsset(key); if ((Object)(object)val2 != (Object)null && (Object)(object)val2.spawnPrefab != (Object)null) { ScanNodeProperties componentInChildren = val2.spawnPrefab.GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null) { componentInChildren.nodeType = 1; componentInChildren.creatureScanID = -1; } NetworkPrefabs.RegisterNetworkPrefab(val2.spawnPrefab); Items.RegisterScrap(val2, value, (LevelTypes)(-1)); LoadedCards.Add(val2); num++; } } Log.LogInfo((object)$"Successfully registered {num} cards to the scrap pool."); } } }