using System; 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 BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using BossSouls.Buildings; using BossSouls.Data; using BossSouls.Data.Souls; using BossSouls.Effects; using BossSouls.Effects.Souls; using BossSouls.Patches; using BossSouls.UI; using HarmonyLib; using LootClicker; using LootClicker.BuildingUpgrades; using LootClicker.Entities; using LootClicker.Entities.Buffs; using LootClicker.Entities.Characters; using LootClicker.Entities.Monsters; using LootClicker.Entities.Skills; using LootClicker.Items; using LootClicker.Services; using Microsoft.CodeAnalysis; using Newtonsoft.Json; using TMPro; using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.Events; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: IgnoresAccessChecksTo("Assembly-CSharp")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyCompany("BossSouls")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("BossSouls")] [assembly: AssemblyTitle("BossSouls")] [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 BossSouls { [BepInPlugin("com.corga.bosssouls", "Boss Souls", "1.0.0")] public class BossSoulsPlugin : BaseUnityPlugin { private static ConfigEntry _debugLogging; private static Harmony harmony; private static SoulSelectionPanel selectionPanel; public static ManualLogSource Log { get; private set; } public static bool DebugLogging { get; private set; } private void Awake() { //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Expected O, but got Unknown Log = ((BaseUnityPlugin)this).Logger; _debugLogging = ((BaseUnityPlugin)this).Config.Bind("Debug", "EnableDebugLogging", false, "Log all soul effect events (buff apply/remove/expire, hits, procs)"); DebugLogging = _debugLogging.Value; _debugLogging.SettingChanged += delegate { DebugLogging = _debugLogging.Value; }; Log.LogInfo((object)"Boss Souls plugin loading..."); SoulRegistry.Init(); Log.LogInfo((object)$"Registered {SoulRegistry.All.Count} boss souls across {SoulRegistry.ByTier.Count} tiers."); harmony = new Harmony("com.corga.bosssouls"); ApplyPatchSafe("BossKillPatches", delegate { BossKillPatches.Apply(harmony); }); ApplyPatchSafe("EquipmentUIPatches", delegate { EquipmentUIPatches.Apply(harmony); }); ApplyPatchSafe("SavePatches", delegate { SavePatches.Apply(harmony); }); ApplyPatchSafe("BuildingPatches", delegate { BuildingPatches.Apply(harmony); }); ApplyPatchSafe("SoulEffectPatches", delegate { SoulEffectPatches.Apply(harmony); }); foreach (MethodBase patchedMethod in harmony.GetPatchedMethods()) { Log.LogInfo((object)(" Patched: " + patchedMethod.DeclaringType?.Name + "." + patchedMethod.Name)); } Log.LogInfo((object)"Boss Souls plugin loaded."); SoulSaveManager.Load(); } private static void ApplyPatchSafe(string name, Action apply) { try { apply(); } catch (Exception arg) { Log.LogError((object)$"Failed to apply {name}: {arg}"); } } public static SoulSelectionPanel GetOrCreateSelectionPanel() { //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)selectionPanel != (Object)null) { return selectionPanel; } try { GameObject val = GameData.GameController?.Canvas; if ((Object)(object)val != (Object)null) { GameObject val2 = new GameObject("BossSoulsSelectionPanel"); val2.transform.SetParent(val.transform, false); selectionPanel = val2.AddComponent(); selectionPanel.Init(val.transform); Log.LogInfo((object)"Boss Souls selection panel created."); } } catch (Exception arg) { Log.LogError((object)$"Failed to create selection panel: {arg}"); } return selectionPanel; } public static void RefreshEquipmentSlot() { EquipmentUIPatches.RefreshSlot(); Character currentCharacter = GameData.CurrentCharacter; if (currentCharacter != null) { SoulEffectSystem.LoadPrimaryEffect(currentCharacter); } } public static void DumpFlaskPanel() { GameObject val = GameData.GameController?.Canvas; if ((Object)(object)val == (Object)null) { Log.LogWarning((object)"DumpFlaskPanel: Canvas not found."); return; } SelectFlaskController val2 = null; SelectFlaskController[] componentsInChildren = val.GetComponentsInChildren(true); int num = 0; if (num < componentsInChildren.Length) { val2 = componentsInChildren[num]; } if ((Object)(object)val2 == (Object)null) { Log.LogWarning((object)"DumpFlaskPanel: SelectFlaskController not found in canvas hierarchy."); return; } Log.LogInfo((object)"=== FLASK PANEL HIERARCHY DUMP ==="); DumpTransform(((Component)val2).transform, 0); Log.LogInfo((object)"=== END FLASK PANEL DUMP ==="); } private static void DumpTransform(Transform t, int depth) { //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) string arg = new string(' ', depth * 2); GameObject gameObject = ((Component)t).gameObject; string text = $"{arg}[{((Object)gameObject).name}] active={gameObject.activeSelf}"; RectTransform component = gameObject.GetComponent(); if ((Object)(object)component != (Object)null) { text += $" anchMin={component.anchorMin} anchMax={component.anchorMax} pos={component.anchoredPosition} size={component.sizeDelta} pivot={component.pivot}"; } Image component2 = gameObject.GetComponent(); if ((Object)(object)component2 != (Object)null) { string text2 = text; Sprite sprite = component2.sprite; text = text2 + string.Format(" IMG(sprite={0} type={1} color={2})", ((sprite != null) ? ((Object)sprite).name : null) ?? "null", component2.type, ((Graphic)component2).color); } TMP_Text component3 = gameObject.GetComponent(); if ((Object)(object)component3 != (Object)null) { text += $" TXT(\"{component3.text}\" size={component3.fontSize} align={component3.alignment})"; } if ((Object)(object)gameObject.GetComponent