Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of butterscotchandroses v0.3.9
butterscotchnroses.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.Drawing; using System.Globalization; 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.RegularExpressions; using AllyNames; using BNR; using BNR.items; using BNR.patches; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using CoolerEclipse; using EntityStates; using EntityStates.JunkCube; using GoldenCoastPlusRevived.Modules; using HG; using HG.Reflection; using HarmonyLib; using IL.RoR2; using Inferno.Stat_AI; using Microsoft.CodeAnalysis; using Mono.Cecil; using Mono.Cecil.Cil; using MonoMod.Cil; using On; using On.EntityStates.JunkCube; using On.RoR2; using On.RoR2.Hologram; using On.RoR2.UI; using On.RoR2.UI.SkinControllers; using R2API; using R2API.Utils; using Rewired; using RiskOfOptions; using RiskOfOptions.Components.Options; using RiskOfOptions.OptionConfigs; using RiskOfOptions.Options; using RoR2; using RoR2.Hologram; using RoR2.Items; using RoR2.Orbs; using RoR2.Skills; using RoR2.UI; using RoR2.UI.SkinControllers; using RoR2BepInExPack.GameAssetPaths.Version_1_35_0; using RoR2BepInExPack.GameAssetPaths.Version_1_39_0; using RoR2BepInExPack.GameAssetPathsBetter; using SS2; using ShaderSwapper; using Skillsmas.Skills.Merc; using TMPro; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.EventSystems; using UnityEngine.Events; using UnityEngine.Networking; using UnityEngine.Rendering; using UnityEngine.Rendering.PostProcessing; using UnityEngine.ResourceManagement.AsyncOperations; using UnityEngine.SceneManagement; using UnityEngine.UI; using butterscotchnroses; using butterscotchnroses.artifacts; using butterscotchnroses.skills; [assembly: AssemblyTitle("butterscotchnroses")] [assembly: AssemblyProduct("butterscotchnroses")] [assembly: AssemblyInformationalVersion("1.0.0+fce3368d83e1f8580a1d8ce67170c43e01eb43dc")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyCompany("butterscotchnroses")] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: OptIn] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: CompilationRelaxations(8)] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] [CompilerGenerated] [Embedded] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } public class captain { private class SkinnedDefenseMatrixController : MonoBehaviour { private ModelSkinController targetSkinController; public void Start() { Transform parent = ((Component)this).transform.parent; object obj; if (parent == null) { obj = null; } else { Transform obj2 = UnityObjectExtensions.AsValidOrNull<Transform>(parent); obj = ((obj2 != null) ? ((Component)obj2).GetComponent<CharacterBody>() : null); } CharacterBody val = (CharacterBody)obj; object obj3; if (val == null) { obj3 = null; } else { CharacterMaster master = val.master; if (master == null) { obj3 = null; } else { CharacterMaster obj4 = UnityObjectExtensions.AsValidOrNull<CharacterMaster>(master); if (obj4 == null) { obj3 = null; } else { MinionOwnership minionOwnership = obj4.minionOwnership; if (minionOwnership == null) { obj3 = null; } else { MinionOwnership obj5 = UnityObjectExtensions.AsValidOrNull<MinionOwnership>(minionOwnership); if (obj5 == null) { obj3 = null; } else { CharacterMaster ownerMaster = obj5.ownerMaster; obj3 = ((ownerMaster != null) ? UnityObjectExtensions.AsValidOrNull<CharacterMaster>(ownerMaster) : null); } } } } } CharacterMaster val2 = (CharacterMaster)obj3; if (Object.op_Implicit((Object)(object)val2)) { CharacterBody body = val2.GetBody(); object obj6; if (body == null) { obj6 = null; } else { ModelLocator modelLocator = UnityObjectExtensions.AsValidOrNull<CharacterBody>(body).modelLocator; if (modelLocator == null) { obj6 = null; } else { Transform modelTransform = UnityObjectExtensions.AsValidOrNull<ModelLocator>(modelLocator).modelTransform; if (modelTransform == null) { obj6 = null; } else { Transform obj7 = UnityObjectExtensions.AsValidOrNull<Transform>(modelTransform); obj6 = ((obj7 != null) ? ((Component)obj7).GetComponent<ModelSkinController>() : null); } } } targetSkinController = (ModelSkinController)obj6; } else { object obj8; if (val == null) { obj8 = null; } else { ModelLocator modelLocator2 = val.modelLocator; if (modelLocator2 == null) { obj8 = null; } else { ModelLocator obj9 = UnityObjectExtensions.AsValidOrNull<ModelLocator>(modelLocator2); if (obj9 == null) { obj8 = null; } else { Transform modelTransform2 = obj9.modelTransform; if (modelTransform2 == null) { obj8 = null; } else { Transform obj10 = UnityObjectExtensions.AsValidOrNull<Transform>(modelTransform2); obj8 = ((obj10 != null) ? ((Component)obj10).GetComponent<ModelSkinController>() : null); } } } } targetSkinController = (ModelSkinController)obj8; } ModelSkinController obj11 = targetSkinController; if (Object.op_Implicit((Object)(object)((obj11 != null) ? UnityObjectExtensions.AsValidOrNull<ModelSkinController>(obj11) : null))) { if (Object.op_Implicit((Object)(object)val2)) { OnSkinApplied(targetSkinController.currentSkinIndex); } targetSkinController.onSkinApplied += OnSkinApplied; } } private void OnSkinApplied(int skinIndex) { //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) _ = targetSkinController.skins[skinIndex]; Transform val = ((Component)this).gameObject.transform.Find("Spinner"); if (Object.op_Implicit((Object)(object)((val != null) ? UnityObjectExtensions.AsValidOrNull<Transform>(val) : null))) { GameObject gameObject = ((Component)val.GetChild(0)).gameObject; GameObject obj = GameObject.CreatePrimitive((PrimitiveType)3); obj.transform.SetParent(((Component)val).transform, false); obj.transform.localPosition = gameObject.transform.localPosition; obj.transform.localScale = gameObject.transform.localScale; Object.Destroy((Object)(object)gameObject.gameObject); } } } public void AddSkinnedDefenseMatrixController() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) AsyncOperationHandle<GameObject> val = Addressables.LoadAssetAsync<GameObject>((object)RoR2_Base_CaptainDefenseMatrix.CaptainDefenseMatrixItemBodyAttachment_prefab); val.Completed += delegate(AsyncOperationHandle<GameObject> handle) { handle.Result.AddComponent<SkinnedDefenseMatrixController>(); }; } } namespace ProdzModpackUtils { public class ProdzUtils { public static Color TRANSPARENT = new Color(0f, 0f, 0f, 0f); public static Sprite GetComposite(Texture2D bg, Texture2D fg) { //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_006d: 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_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Expected O, but got Unknown //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: 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) //IL_00d5: 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_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) Vector2 val = default(Vector2); ((Vector2)(ref val))..ctor((float)Mathf.Max(((Texture)bg).width, ((Texture)fg).width), (float)Mathf.Max(((Texture)bg).height, ((Texture)fg).height)); Vector2 val2 = default(Vector2); ((Vector2)(ref val2))..ctor(Mathf.Floor(((float)((Texture)bg).width - val.x) / 2f), Mathf.Floor(((float)((Texture)bg).width - val.y) / 2f)); Vector2 val3 = default(Vector2); ((Vector2)(ref val3))..ctor(Mathf.Floor(((float)((Texture)fg).width - val.x) / 2f), Mathf.Floor(((float)((Texture)fg).width - val.y) / 2f)); Texture2D val4 = new Texture2D((int)val.x, (int)val.y); for (int i = 0; (float)i < val.x; i++) { for (int j = 0; (float)j < val.y; j++) { val4.SetPixel(i, j, Over(Pixel(bg, (float)i + val2.x, (float)j + val2.y), Pixel(fg, (float)i + val3.x, (float)j + val3.y))); } } return Sprite.Create(val4, new Rect(0f, 0f, val.x, val.y), new Vector2(0.5f, 0.5f), 3f); } public static Color Pixel(Texture2D img, float x, float y) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) if (0f > x || x >= (float)((Texture)img).width || 0f > y || y >= (float)((Texture)img).height) { return TRANSPARENT; } return img.GetPixel((int)x, (int)y); } public static Color Over(Color bg, Color fg) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) float num = bg.a * (1f - fg.a) + fg.a; return Color.op_Implicit((Color.op_Implicit(fg) * fg.a + Color.op_Implicit(bg) * bg.a * (1f - fg.a)) / num); } public static Sprite Load(params string[] path) { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Expected O, but got Unknown //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Expected O, but got Unknown Size dimensions = ImageHelper.GetDimensions(Path.Combine(path)); byte[] array = File.ReadAllBytes(Path.Combine(path)); Texture2D val = new Texture2D(dimensions.Width, dimensions.Height, (TextureFormat)3, false) { filterMode = (FilterMode)2 }; ImageConversion.LoadImage(val, array); return Sprite.Create(val, new Rect(0f, 0f, (float)dimensions.Width, (float)dimensions.Height), new Vector2(0.5f, 0.5f), 3f); } } public static class ImageHelper { private const string errorMessage = "Could not recognize image format."; private static Dictionary<byte[], Func<BinaryReader, Size>> imageFormatDecoders = new Dictionary<byte[], Func<BinaryReader, Size>> { { new byte[2] { 66, 77 }, DecodeBitmap }, { new byte[6] { 71, 73, 70, 56, 55, 97 }, DecodeGif }, { new byte[6] { 71, 73, 70, 56, 57, 97 }, DecodeGif }, { new byte[8] { 137, 80, 78, 71, 13, 10, 26, 10 }, DecodePng }, { new byte[2] { 255, 216 }, DecodeJfif } }; public static Size GetDimensions(string path) { using BinaryReader binaryReader = new BinaryReader(File.OpenRead(path)); try { return GetDimensions(binaryReader); } catch (ArgumentException ex) { if (ex.Message.StartsWith("Could not recognize image format.")) { throw new ArgumentException("Could not recognize image format.", "path", ex); } throw ex; } } public static Size GetDimensions(BinaryReader binaryReader) { int num = imageFormatDecoders.Keys.OrderByDescending((byte[] x) => x.Length).First().Length; byte[] array = new byte[num]; for (int num2 = 0; num2 < num; num2++) { array[num2] = binaryReader.ReadByte(); foreach (KeyValuePair<byte[], Func<BinaryReader, Size>> imageFormatDecoder in imageFormatDecoders) { if (array.StartsWith(imageFormatDecoder.Key)) { return imageFormatDecoder.Value(binaryReader); } } } throw new ArgumentException("Could not recognize image format.", "binaryReader"); } private static bool StartsWith(this byte[] thisBytes, byte[] thatBytes) { for (int i = 0; i < thatBytes.Length; i++) { if (thisBytes[i] != thatBytes[i]) { return false; } } return true; } private static short ReadLittleEndianInt16(this BinaryReader binaryReader) { byte[] array = new byte[2]; for (int i = 0; i < 2; i++) { array[1 - i] = binaryReader.ReadByte(); } return BitConverter.ToInt16(array, 0); } private static int ReadLittleEndianInt32(this BinaryReader binaryReader) { byte[] array = new byte[4]; for (int i = 0; i < 4; i++) { array[3 - i] = binaryReader.ReadByte(); } return BitConverter.ToInt32(array, 0); } private static Size DecodeBitmap(BinaryReader binaryReader) { binaryReader.ReadBytes(16); int width = binaryReader.ReadInt32(); int height = binaryReader.ReadInt32(); return new Size(width, height); } private static Size DecodeGif(BinaryReader binaryReader) { short width = binaryReader.ReadInt16(); int height = binaryReader.ReadInt16(); return new Size(width, height); } private static Size DecodePng(BinaryReader binaryReader) { binaryReader.ReadBytes(8); int width = binaryReader.ReadLittleEndianInt32(); int height = binaryReader.ReadLittleEndianInt32(); return new Size(width, height); } private static Size DecodeJfif(BinaryReader binaryReader) { while (binaryReader.ReadByte() == byte.MaxValue) { byte num = binaryReader.ReadByte(); short num2 = binaryReader.ReadLittleEndianInt16(); if (num == 192) { binaryReader.ReadByte(); int height = binaryReader.ReadLittleEndianInt16(); return new Size(binaryReader.ReadLittleEndianInt16(), height); } binaryReader.ReadBytes(num2 - 2); } throw new ArgumentException("Could not recognize image format."); } } } namespace butterscotchnroses { public class oldconfigs { private static ConfigEntry<bool> replaceOldConfigs; public static void fixOldConfigs() { replaceOldConfigs = ((BaseUnityPlugin)BNR.butterscotchnroses.instance).Config.Bind<bool>("BNR", "whether or not to replace/fix old default configs ,..,", true, "basically uhh replace default configs if enabled.,,."); Utils.CheckboxConfig(replaceOldConfigs); if (replaceOldConfigs.Value) { string text = "golemplains,golemplains2"; if (coolereclipse.whitelistStages.Value == text) { coolereclipse.whitelistStages.Value = (string)((ConfigEntryBase)coolereclipse.whitelistStages).DefaultValue; } string text2 = "skinCommandoAlt,CommandoBody,100,0,0,Test Skin;;skinCommandoAlt,CommandoBody,200,0,0,Test Skin 2;;skinCommandoDefault,CommandoBody,290,-40,-10,Awesome Skin !!!!"; if (skinrecolors.skinRecolors.Value == text2) { skinrecolors.skinRecolors.Value = (string)((ConfigEntryBase)skinrecolors.skinRecolors).DefaultValue; } string text3 = "goldshores,bazaar,solutionalhaunt,ss2_voidshop,goldshores"; if (coolereclipse.blacklistStages.Value == text3) { coolereclipse.blacklistStages.Value = (string)((ConfigEntryBase)coolereclipse.blacklistStages).DefaultValue; } string text4 = "BombardmentDrone,Bombardment Drone,Default;Drones,Tsar Bomba;Fat Man;Little Boy|JunkDrone,Junk Drone,Default;Drones|RechargeDrone,Barrier Drone,Default;Drones|JailerDrone,Jailer Drone,Default;Drones|CleanupDrone,Cleanup Drone,Default;Drones,Roomba|CopycatDrone,Freeze Drone,Default;Drones,Frozone|HaulerDrone,Transport Drone,Default;Drones|DTGunnerDroneBody,CROSSHAIRS,Default;Drones,Ruxin|DTHealingDroneBody,DOC,Default;Drones,Bunny|DTHaulerDroneBody,CHIRP,Default;Drones,Moose|FriendUnitBody,Best Buddy,Default,Friend Inside Me;Stupid Baby;Son|DroneBomber,Lt. Droneboy,Default,Lt. Beep Boop"; if (allynames.bodyNames.Value == text4) { allynames.bodyNames.Value = (string)((ConfigEntryBase)allynames.bodyNames).DefaultValue; } } } } } namespace butterscotchnroses.skills { public abstract class SkillBase<T> : SkillBase where T : SkillBase<T> { public static T Instance { get; private set; } public SkillBase() { if (Instance != null) { throw new InvalidOperationException("Singleton class \"" + typeof(T).Name + "\" inheriting SkillBase was instantiated twice"); } Instance = this as T; } } public abstract class SkillBase { public SkillDef SkillDef; public static EventHandler PostCreationEvent; public abstract SerializableEntityStateType ActivationState { get; } public abstract float Cooldown { get; } public virtual int StockToConsume { get; } = 1; public abstract string Machine { get; } public abstract int MaxStock { get; } public abstract string LangToken { get; } public abstract string Name { get; } public virtual string Survivor { get; } public virtual SkillSlot Slot { get; } = (SkillSlot)(-1); public abstract string Description { get; } public virtual bool IsCombat { get; } = true; public virtual bool Agile { get; } public virtual bool DelayCooldown { get; } public virtual List<string> Keywords { get; } = new List<string>(); public abstract Sprite SkillIcon { get; } public virtual UnlockableDef Unlock { get; } public virtual bool AutoApply { get; } = true; public virtual bool MustKeyPress { get; } public virtual bool AgileAddKeyword { get; } = true; public virtual bool SprintCancelable { get; } = true; public virtual bool ResetStockOnOverride { get; } public virtual bool Passive { get; } public virtual bool Configurable { get; } = true; public virtual bool ForceOff { get; } public virtual InterruptPriority Priority { get; } = (InterruptPriority)1; public virtual int StockToRecharge { get; } = 1; public void Init() { //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_04b2: 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_04cb: Unknown result type (might be due to invalid IL or missing references) //IL_04d0: Unknown result type (might be due to invalid IL or missing references) //IL_04d2: Unknown result type (might be due to invalid IL or missing references) //IL_04e9: Expected I4, but got Unknown //IL_0243: Unknown result type (might be due to invalid IL or missing references) //IL_0248: Unknown result type (might be due to invalid IL or missing references) //IL_0558: Unknown result type (might be due to invalid IL or missing references) //IL_0587: Unknown result type (might be due to invalid IL or missing references) //IL_0591: Expected O, but got Unknown //IL_0591: Unknown result type (might be due to invalid IL or missing references) //IL_0593: Unknown result type (might be due to invalid IL or missing references) //IL_03a2: Unknown result type (might be due to invalid IL or missing references) //IL_03d1: Unknown result type (might be due to invalid IL or missing references) //IL_03db: Expected O, but got Unknown //IL_03db: Unknown result type (might be due to invalid IL or missing references) //IL_03dd: Unknown result type (might be due to invalid IL or missing references) //IL_0427: Unknown result type (might be due to invalid IL or missing references) //IL_042c: Unknown result type (might be due to invalid IL or missing references) //IL_046a: Unknown result type (might be due to invalid IL or missing references) //IL_0484: Unknown result type (might be due to invalid IL or missing references) //IL_048e: Expected O, but got Unknown //IL_048e: Unknown result type (might be due to invalid IL or missing references) //IL_0490: Unknown result type (might be due to invalid IL or missing references) //IL_02ee: Unknown result type (might be due to invalid IL or missing references) //IL_031d: Unknown result type (might be due to invalid IL or missing references) //IL_0327: Expected O, but got Unknown //IL_0327: 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) if (ForceOff || (Configurable && !((BaseUnityPlugin)BNR.butterscotchnroses.instance).Config.Bind<bool>("Skills", Name, true, "Enable this skill?").Value)) { return; } SkillDef = GetSkillDef(); SkillDef.skillNameToken = "SKILL_" + LangToken.ToUpper() + "_NAME"; SkillDef.skillDescriptionToken = "SKILL_" + LangToken.ToUpper() + "_DESC"; SkillDef.skillName = LangToken.ToUpper(); SkillDef.baseRechargeInterval = Cooldown; SkillDef.baseMaxStock = MaxStock; SkillDef.activationState = ActivationState; SkillDef.cancelSprintingOnActivation = !Passive && !Agile; SkillDef.icon = SkillIcon; SkillDef.interruptPriority = Priority; if (!SprintCancelable) { SkillDef.canceledFromSprinting = false; } else { SkillDef.canceledFromSprinting = !Agile; } SkillDef.isCombatSkill = IsCombat; SkillDef.activationStateMachineName = Machine; SkillDef.beginSkillCooldownOnSkillEnd = DelayCooldown; SkillDef.stockToConsume = StockToConsume; SkillDef.requiredStock = ((!Passive) ? 1 : 321); SkillDef.mustKeyPress = MustKeyPress; SkillDef.fullRestockOnAssign = ResetStockOnOverride; SkillDef.rechargeStock = StockToRecharge; ((Object)SkillDef).name = LangToken.ToUpper(); List<string> keywords = Keywords; if (Agile && AgileAddKeyword) { keywords.Add(butterscotchnroses.skills.Keywords.Agile); } if (keywords.Count >= 1) { SkillDef.keywordTokens = keywords.ToArray(); } Variant val3; if (AutoApply && Passive) { GameObject val = Addressables.LoadAssetAsync<GameObject>((object)Survivor).WaitForCompletion(); bool flag = false; GenericSkill[] components = val.GetComponents<GenericSkill>(); foreach (GenericSkill val2 in components) { if ((val2.skillName != null && val2.skillName.ToLower().Contains("passive")) || (((Object)val2.skillFamily).name != null && ((Object)val2.skillFamily).name.ToLower().Contains("passive"))) { SkillFamily skillFamily = val2.skillFamily; Array.Resize(ref skillFamily.variants, skillFamily.variants.Length + 1); Variant[] variants = skillFamily.variants; int num = skillFamily.variants.Length - 1; val3 = new Variant { skillDef = SkillDef, unlockableDef = Unlock }; ((Variant)(ref val3)).viewableNode = new Node(SkillDef.skillNameToken, false, (Node)null); variants[num] = val3; flag = true; break; } } if (!flag) { GenericSkill obj = val.AddComponent<GenericSkill>(); SkillLocator component = val.GetComponent<SkillLocator>(); SkillFamily val4 = ScriptableObject.CreateInstance<SkillFamily>(); obj.skillName = ((Object)val).name + "Passive"; ((Object)val4).name = ((Object)val).name + "Passive"; val4.variants = (Variant[])(object)new Variant[2]; Variant[] variants2 = val4.variants; val3 = new Variant { skillDef = SkillDef, unlockableDef = Unlock }; ((Variant)(ref val3)).viewableNode = new Node(SkillDef.skillNameToken, false, (Node)null); variants2[1] = val3; SkillDef val5 = ScriptableObject.CreateInstance<SkillDef>(); val5.skillNameToken = component.passiveSkill.skillNameToken; val5.skillDescriptionToken = component.passiveSkill.skillDescriptionToken; val5.activationStateMachineName = "TheAmongUs"; val5.activationState = new SerializableEntityStateType(typeof(Idle)); val5.icon = component.passiveSkill.icon; ContentAddition.AddSkillDef(val5); component.passiveSkill.enabled = false; obj.hideInCharacterSelect = true; Variant[] variants3 = val4.variants; val3 = new Variant { skillDef = val5 }; ((Variant)(ref val3)).viewableNode = new Node(val5.skillNameToken, false, (Node)null); variants3[0] = val3; obj._skillFamily = val4; } } else if (AutoApply) { SkillLocator component2 = Addressables.LoadAssetAsync<GameObject>((object)Survivor).WaitForCompletion().GetComponent<SkillLocator>(); SkillFamily val6 = null; SkillSlot slot = Slot; switch ((int)slot) { case 0: val6 = component2.primary.skillFamily; break; case 1: val6 = component2.secondary.skillFamily; break; case 2: val6 = component2.utility.skillFamily; break; case 3: val6 = component2.special.skillFamily; break; } if ((Object)(object)val6 != (Object)null) { Array.Resize(ref val6.variants, val6.variants.Length + 1); Variant[] variants4 = val6.variants; int num2 = variants4.Length - 1; val3 = new Variant { skillDef = SkillDef, unlockableDef = Unlock }; ((Variant)(ref val3)).viewableNode = new Node(SkillDef.skillNameToken, false, (Node)null); variants4[num2] = val3; } } LanguageAPI.Add(SkillDef.skillNameToken, Name); string text = Description; if (Agile && AgileAddKeyword) { text = "<style=cIsUtility>Agile.</style> " + text; } LanguageAPI.Add(SkillDef.skillDescriptionToken, text); ContentAddition.AddSkillDef(SkillDef); PostCreation(); } public virtual SkillDef GetSkillDef() { return ScriptableObject.CreateInstance<SkillDef>(); } public virtual void PostCreation() { PostCreationEvent?.Invoke(this, new EventArgs()); } public EntityStateMachine AddEntityStateMachine<T>(GameObject obj, string name) where T : EntityState { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) EntityStateMachine obj2 = obj.AddComponent<EntityStateMachine>(); obj2.customName = name; obj2.initialStateType = new SerializableEntityStateType(typeof(T)); obj2.mainStateType = new SerializableEntityStateType(typeof(T)); List<EntityStateMachine> list = obj.GetComponents<EntityStateMachine>().ToList(); obj.GetComponent<NetworkStateMachine>().stateMachines = list.ToArray(); return obj2; } public GameObject GetSurvivor() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) return Addressables.LoadAssetAsync<GameObject>((object)Survivor).WaitForCompletion(); } } public static class Keywords { public static string Poison = "KEYWORD_POISON"; public static string Regenerative = "KEYWORD_RAPID_REGEN"; public static string Agile = "KEYWORD_AGILE"; public static string HealthCost = "KEYWORD_PERCENT_HP"; public static string Disperse = "KEYWORD_SONIC_BOOM"; public static string Weak = "KEYWORD_WEAK"; public static string Heavy = "KEYWORD_HEAVY"; public static string Freeze = "KEYWORD_FREEZING"; public static string Stun = "KEYWORD_STUNNING"; public static string Expose = "KEYWORD_EXPOSE"; public static string Shock = "KEYWORD_SHOCKING"; public static string Slayer = "KEYWORD_SLAYER"; public static string Hemorrhage = "KEYWORD_SUPERBLEED"; public static string Ignite = "KEYWORD_IGNITE"; public static string Weakpoint = "KEYWORD_WEAKPOINT"; public static string ActiveReload = "KEYWORD_ACTIVERELOAD"; public static string VoidCorruption = "KEYWORD_VOIDCORRUPTION"; } } namespace butterscotchnroses.artifacts { public abstract class ArtifactBase<T> : ArtifactBase where T : ArtifactBase<T> { public static T instance { get; private set; } public ArtifactBase() { if (instance != null) { throw new InvalidOperationException("Singleton class \"" + typeof(T).Name + "\" inheriting ArtifactBase was instantiated twice"); } instance = this as T; } } public abstract class ArtifactBase { public ArtifactDef ArtifactDef; public abstract string ArtifactName { get; } public abstract string ArtifactLangTokenName { get; } public abstract string ArtifactDescription { get; } public abstract Sprite ArtifactEnabledIcon { get; } public abstract Sprite ArtifactDisabledIcon { get; } public bool ArtifactEnabled => RunArtifactManager.instance.IsArtifactEnabled(ArtifactDef); public abstract void Init(ConfigFile config); protected void CreateLang() { LanguageAPI.Add("ARTIFACT_" + ArtifactLangTokenName + "_NAME", ArtifactName); LanguageAPI.Add("ARTIFACT_" + ArtifactLangTokenName + "_DESCRIPTION", ArtifactDescription); } protected void CreateArtifact() { ArtifactDef = ScriptableObject.CreateInstance<ArtifactDef>(); ArtifactDef.cachedName = "ARTIFACT_" + ArtifactLangTokenName; ArtifactDef.nameToken = "ARTIFACT_" + ArtifactLangTokenName + "_NAME"; ArtifactDef.descriptionToken = "ARTIFACT_" + ArtifactLangTokenName + "_DESCRIPTION"; ArtifactDef.smallIconSelectedSprite = ArtifactEnabledIcon; ArtifactDef.smallIconDeselectedSprite = ArtifactDisabledIcon; ContentAddition.AddArtifactDef(ArtifactDef); } public abstract void Hooks(); } internal class evil : ArtifactBase<evil> { public static ConfigEntry<int> TimesToPrintMessageOnStart; public override string ArtifactName => "Artifact of Example"; public override string ArtifactLangTokenName => "ARTIFACT_OF_EXAMPLE"; public override string ArtifactDescription => "When enabled, print a message to the chat at the start of the run."; public override Sprite ArtifactEnabledIcon => Addressables.LoadAssetAsync<Sprite>((object)"RoR2/Base/Common/MiscIcons/texMysteryIcon.png").WaitForCompletion(); public override Sprite ArtifactDisabledIcon => Addressables.LoadAssetAsync<Sprite>((object)"RoR2/Base/Common/MiscIcons/texMysteryIcon.png").WaitForCompletion(); public override void Init(ConfigFile config) { } private void CreateConfig(ConfigFile config) { TimesToPrintMessageOnStart = config.Bind<int>("Artifact: " + ArtifactName, "Times to Print Message in Chat", 5, "How many times should a message be printed to the chat on run start?"); } public override void Hooks() { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Expected O, but got Unknown Run.onRunStartGlobal += PrintMessageToChat; GenericNotification.SetItem += new hook_SetItem(GenericNotificationOnSetItem); ItemIcon.SetItemIndex_ItemIndex_int_float += new hook_SetItemIndex_ItemIndex_int_float(ItemIconOnSetItemIndex_ItemIndex_int_float); } private void ItemIconOnSetItemIndex_ItemIndex_int_float(orig_SetItemIndex_ItemIndex_int_float orig, ItemIcon self, ItemIndex newitemindex, int newitemcount, float newdurationpercent) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self, newitemindex, newitemcount, newdurationpercent); if (base.ArtifactEnabled) { self.image.texture = (Texture)(object)Addressables.LoadAssetAsync<Sprite>((object)"RoR2/Base/Common/MiscIcons/texMysteryIcon.png").WaitForCompletion().texture; self.tooltipProvider.titleToken = "???"; self.tooltipProvider.bodyToken = "???"; self.tooltipProvider.titleColor = Color32.op_Implicit(ColorCatalog.GetColor((ColorIndex)1)); } } private void GenericNotificationOnSetItem(orig_SetItem orig, GenericNotification self, ItemDef itemdef) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self, itemdef); if (base.ArtifactEnabled) { self.iconImage.texture = (Texture)(object)Addressables.LoadAssetAsync<Sprite>((object)"RoR2/Base/Common/MiscIcons/texMysteryIcon.png").WaitForCompletion().texture; self.titleText.token = "???"; self.descriptionText.token = "???"; } } private void PrintMessageToChat(Run run) { if (NetworkServer.active && base.ArtifactEnabled) { for (int i = 0; i < TimesToPrintMessageOnStart.Value; i++) { Chat.AddMessage("Example Artifact has been Enabled."); } } } } } namespace BNR { [BepInPlugin("zzz.kina.BNR", "BNR", "0.3.9")] public class butterscotchnroses : BaseUnityPlugin { private const string PluginGUID = "zzz.kina.BNR"; private const string PluginAuthor = "kina"; private const string PluginName = "BNR"; private const string PluginVersion = "0.3.9"; public static butterscotchnroses instance; public static AssetBundle carvingKitBundle; public static AssetBundle bnrBundle; public static Harmony harmony; public static ConfigEntry<bool> clientSide; public static ConfigEntry<bool> logDebug; public void Awake() { //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Expected O, but got Unknown instance = this; Log.Init(((BaseUnityPlugin)this).Logger); clientSide = ((BaseUnityPlugin)this).Config.Bind<bool>("BNR", "client side", false, "whether the mod should run in clientside mode or not .,,. disables content/changed behavior that would otherwise cause desyncs automatically !!!"); Utils.CheckboxConfig(clientSide); logDebug = ((BaseUnityPlugin)this).Config.Bind<bool>("BNR", "debug logs", false, "whether the mod should log debug logs.,.,"); Utils.CheckboxConfig(logDebug); carvingKitBundle = AssetBundle.LoadFromFile(Path.Combine(Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location), "carvingkit_assets")); ((MonoBehaviour)this).StartCoroutine(ShaderSwapper.UpgradeStubbedShadersAsync(carvingKitBundle)); bnrBundle = AssetBundle.LoadFromFile(Path.Combine(Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location), "bnrbundle")); harmony = new Harmony(((BaseUnityPlugin)this).Info.Metadata.GUID); foreach (Type item in from type in Assembly.GetExecutingAssembly().GetTypes() where !type.IsAbstract && type.IsSubclassOf(typeof(PatchBase)) select type) { try { PatchBase obj = (PatchBase)Activator.CreateInstance(item); obj.Config(((BaseUnityPlugin)this).Config); obj.Init(); } catch (Exception data) { Log.Warning("failed to patch something ! probably fine if you dont have whatever mod that was attempted to be patched enabled ,..,,."); Log.Warning(data); } } foreach (Type item2 in from type in Assembly.GetExecutingAssembly().GetTypes() where !type.IsAbstract && type.IsSubclassOf(typeof(ModdedPatchBase)) select type) { try { ModdedPatchBase obj2 = (ModdedPatchBase)Activator.CreateInstance(item2); obj2.Config(((BaseUnityPlugin)this).Config); obj2.PreInit(); } catch (Exception data2) { Log.Warning("failed to patch something ! probably fine if you dont have whatever mod that was attempted to be patched enabled ,..,,."); Log.Warning(data2); } } if (!clientSide.Value) { foreach (Type item3 in from type in Assembly.GetExecutingAssembly().GetTypes() where !type.IsAbstract && type.IsSubclassOf(typeof(BuffBase)) select type) { ((BuffBase)Activator.CreateInstance(item3)).AddBuff(); } foreach (Type item4 in from type in Assembly.GetExecutingAssembly().GetTypes() where !type.IsAbstract && type.IsSubclassOf(typeof(ItemBase)) select type) { ((ItemBase)Activator.CreateInstance(item4)).Init(((BaseUnityPlugin)this).Config); } foreach (Type item5 in from x in Assembly.GetExecutingAssembly().GetTypes() where !x.IsAbstract && x.IsSubclassOf(typeof(SkillBase)) select x) { ((SkillBase)Activator.CreateInstance(item5)).Init(); } foreach (Type item6 in from x in Assembly.GetExecutingAssembly().GetTypes() where !x.IsAbstract && x.IsSubclassOf(typeof(ArtifactBase)) select x) { ((ArtifactBase)Activator.CreateInstance(item6)).Init(((BaseUnityPlugin)this).Config); } } oldconfigs.fixOldConfigs(); ModSettingsManager.SetModIcon(bnrBundle.LoadAsset<Sprite>("icon")); } } internal static class Log { private static ManualLogSource _logSource; internal static void Init(ManualLogSource logSource) { _logSource = logSource; } internal static void Debug(object data, [CallerLineNumber] int line = -1) { if (butterscotchnroses.logDebug.Value) { _logSource.LogDebug(data); } } internal static void Error(object data) { _logSource.LogError(data); } internal static void Fatal(object data) { _logSource.LogFatal(data); } internal static void Info(object data) { _logSource.LogInfo(data); } internal static void Message(object data) { _logSource.LogMessage(data); } internal static void Warning(object data) { _logSource.LogWarning(data); } } public class acolytesoulrecolor : PatchBase<acolytesoulrecolor> { private static readonly int Color = Shader.PropertyToID("_Color"); private static readonly int PrintRamp = Shader.PropertyToID("_PrintRamp"); private static readonly int ColorRamp = Shader.PropertyToID("_RemapTex"); private ConfigEntry<string> pronounOverrides; private ConfigEntry<bool> descriptionOverride; private ConfigEntry<bool> enabled; public override void Init() { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0122: 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_0131: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_0191: Unknown result type (might be due to invalid IL or missing references) //IL_019b: Unknown result type (might be due to invalid IL or missing references) //IL_01b7: Unknown result type (might be due to invalid IL or missing references) //IL_01bc: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: Unknown result type (might be due to invalid IL or missing references) //IL_01d7: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: Unknown result type (might be due to invalid IL or missing references) //IL_01f5: Unknown result type (might be due to invalid IL or missing references) //IL_01fa: Unknown result type (might be due to invalid IL or missing references) //IL_0204: Unknown result type (might be due to invalid IL or missing references) //IL_021f: Unknown result type (might be due to invalid IL or missing references) //IL_0224: Unknown result type (might be due to invalid IL or missing references) //IL_022a: Unknown result type (might be due to invalid IL or missing references) //IL_023f: Unknown result type (might be due to invalid IL or missing references) //IL_0244: Unknown result type (might be due to invalid IL or missing references) //IL_025a: Unknown result type (might be due to invalid IL or missing references) //IL_025f: 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) applyHooks(); if (enabled.Value) { Texture val = Addressables.LoadAssetAsync<Texture>((object)RoR2_Base_Common_ColorRamps.texRampEngi_png).WaitForCompletion(); CharacterModel component = ((Component)Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC4/Acolyte/AISoulBody.prefab").WaitForCompletion().transform.Find("Model/mdlSoulBody")).GetComponent<CharacterModel>(); Material val2 = Object.Instantiate<Material>(component.baseRendererInfos[0].defaultMaterial); val2.SetColor(Color, Color32.op_Implicit(new Color32((byte)56, byte.MaxValue, (byte)48, byte.MaxValue))); val2.SetTexture(PrintRamp, val); Material val3 = Object.Instantiate<Material>(component.baseRendererInfos[1].defaultMaterial); val3.SetColor(Color, Color32.op_Implicit(new Color32((byte)56, byte.MaxValue, (byte)48, byte.MaxValue))); val3.SetTexture(ColorRamp, val); component.baseRendererInfos[0].defaultMaterial = val2; component.baseRendererInfos[1].defaultMaterial = val3; component.baseLightInfos[0].defaultColor = Color32.op_Implicit(new Color32((byte)56, byte.MaxValue, (byte)48, byte.MaxValue)); GameObject obj = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC4/Acolyte/AcolyteSoulDeathEffect.prefab").WaitForCompletion(); MainModule main = ((Component)obj.transform.Find("Transform/Sparks")).GetComponent<ParticleSystem>().main; MinMaxGradient startColor = default(MinMaxGradient); ((MinMaxGradient)(ref startColor)).colorMin = Color32.op_Implicit(new Color32((byte)107, byte.MaxValue, (byte)0, byte.MaxValue)); ((MinMaxGradient)(ref startColor)).colorMax = Color32.op_Implicit(new Color32((byte)0, byte.MaxValue, (byte)33, byte.MaxValue)); ((MainModule)(ref main)).startColor = startColor; MainModule main2 = ((Component)obj.transform.Find("Transform/TriangleSparks")).GetComponent<ParticleSystem>().main; startColor = default(MinMaxGradient); ((MinMaxGradient)(ref startColor)).colorMin = Color32.op_Implicit(new Color32((byte)107, byte.MaxValue, (byte)0, byte.MaxValue)); ((MinMaxGradient)(ref startColor)).colorMax = Color32.op_Implicit(new Color32((byte)0, byte.MaxValue, (byte)33, byte.MaxValue)); ((MainModule)(ref main2)).startColor = startColor; MainModule main3 = ((Component)obj.transform.Find("Transform/Unscaled Flames (1)")).GetComponent<ParticleSystem>().main; startColor = default(MinMaxGradient); ((MinMaxGradient)(ref startColor)).colorMin = Color32.op_Implicit(new Color32((byte)46, (byte)191, (byte)0, byte.MaxValue)); ((MinMaxGradient)(ref startColor)).colorMax = Color32.op_Implicit(new Color32((byte)28, (byte)72, (byte)0, byte.MaxValue)); ((MainModule)(ref main3)).startColor = startColor; } } private void applyHooks() { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Expected O, but got Unknown //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Expected O, but got Unknown if (enabled.Value) { AcolyteExtractedSoulController.OnIncomingDamageServer += new Manipulator(AcolyteExtractedSoulControllerOnIncomingDamageServer); } else { AcolyteExtractedSoulController.OnIncomingDamageServer -= new Manipulator(AcolyteExtractedSoulControllerOnIncomingDamageServer); } } private void AcolyteExtractedSoulControllerOnIncomingDamageServer(ILContext il) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Expected O, but got Unknown //IL_00e2: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); int damageOrbIndex = -1; MethodReference val2 = default(MethodReference); if (!val.TryGotoNext((MoveType)2, new Func<Instruction, bool>[2] { (Instruction x) => ILPatternMatchingExt.MatchNewobj(x, ref val2), (Instruction x) => ILPatternMatchingExt.MatchStloc(x, ref damageOrbIndex) })) { Log.Error("failed il"); return; } int num = default(int); if (!val.TryGotoNext((MoveType)2, new Func<Instruction, bool>[3] { (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, damageOrbIndex), (Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, ref num), (Instruction x) => ILPatternMatchingExt.MatchStfld<GenericDamageOrb>(x, "damageColorIndex") })) { Log.Error("failed il 2"); return; } val.Index -= 2; val.Remove(); val.Emit(OpCodes.Ldc_I4_S, (sbyte)4); } public override void Config(ConfigFile config) { enabled = config.Bind<bool>("BNR - acolytesoulrecolor", "enable patches for acolytesoulrecolor", true, ""); Utils.CheckboxConfig(enabled); enabled.SettingChanged += delegate { applyHooks(); }; } } public class buttonrecolors : PatchBase<buttonrecolors> { [HarmonyPatch] public class RooDropdownPatch { [HarmonyPatch(typeof(RooDropdown), "Awake")] [HarmonyPostfix] public static void CoolerEclipseAddSkyboxPreFix(RooDropdown __instance) { //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_000e: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) ColorBlock colors = ((Selectable)__instance).colors; ((ColorBlock)(ref colors)).normalColor = buttonNorm.Value; ((ColorBlock)(ref colors)).highlightedColor = buttonHigh.Value; ((ColorBlock)(ref colors)).pressedColor = buttonPress.Value; ((ColorBlock)(ref colors)).selectedColor = buttonSelect.Value; ((ColorBlock)(ref colors)).disabledColor = buttonDisabled.Value; ((Selectable)__instance).colors = colors; } } [CompilerGenerated] private static class <>O { public static hook_Awake <0>__ButtonSkinControllerOnAwake; public static hook_Awake <1>__PanelSkinControllerOnAwake; } private ConfigEntry<bool> enabled; private static ConfigEntry<bool> colorButtons; private static ConfigEntry<Color> buttonNorm; private static ConfigEntry<Color> buttonHigh; private static ConfigEntry<Color> buttonPress; private static ConfigEntry<Color> buttonSelect; private static ConfigEntry<Color> buttonDisabled; public override void Init() { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Expected O, but got Unknown //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Expected O, but got Unknown //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Expected O, but got Unknown //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) if (!enabled.Value) { return; } object obj = <>O.<0>__ButtonSkinControllerOnAwake; if (obj == null) { hook_Awake val = ButtonSkinControllerOnAwake; <>O.<0>__ButtonSkinControllerOnAwake = val; obj = (object)val; } ButtonSkinController.Awake += (hook_Awake)obj; object obj2 = <>O.<1>__PanelSkinControllerOnAwake; if (obj2 == null) { hook_Awake val2 = PanelSkinControllerOnAwake; <>O.<1>__PanelSkinControllerOnAwake = val2; obj2 = (object)val2; } PanelSkinController.Awake += (hook_Awake)obj2; MPDropdown.Awake += new hook_Awake(MPDropdownOnAwake); CustomScrollbar.Awake += new hook_Awake(CustomScrollbarOnAwake); if (colorButtons.Value) { AsyncOperationHandle<UISkinData> val3 = Addressables.LoadAssetAsync<UISkinData>((object)RoR2_Base_UI.skinCleanButton_asset); val3.Completed += delegate(AsyncOperationHandle<UISkinData> handle) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) ColorBlock colors = handle.Result.buttonStyle.colors; ((ColorBlock)(ref colors)).normalColor = buttonNorm.Value; ((ColorBlock)(ref colors)).highlightedColor = buttonHigh.Value; ((ColorBlock)(ref colors)).pressedColor = buttonPress.Value; ((ColorBlock)(ref colors)).selectedColor = buttonSelect.Value; ((ColorBlock)(ref colors)).disabledColor = buttonDisabled.Value; handle.Result.buttonStyle.colors = colors; }; butterscotchnroses.harmony.CreateClassProcessor(typeof(RooDropdownPatch)).Patch(); } } private void MPDropdownOnAwake(orig_Awake orig, MPDropdown self) { //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_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self); if (colorButtons.Value) { ColorBlock colors = ((Selectable)self).colors; ((ColorBlock)(ref colors)).normalColor = buttonNorm.Value; ((ColorBlock)(ref colors)).highlightedColor = buttonHigh.Value; ((ColorBlock)(ref colors)).pressedColor = buttonPress.Value; ((ColorBlock)(ref colors)).selectedColor = buttonSelect.Value; ((ColorBlock)(ref colors)).disabledColor = buttonDisabled.Value; ((Selectable)self).colors = colors; } } private void CustomScrollbarOnAwake(orig_Awake orig, CustomScrollbar self) { //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_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self); if (colorButtons.Value) { ColorBlock colors = ((Selectable)self).colors; ((ColorBlock)(ref colors)).normalColor = buttonNorm.Value; ((ColorBlock)(ref colors)).highlightedColor = buttonHigh.Value; ((ColorBlock)(ref colors)).pressedColor = buttonPress.Value; ((ColorBlock)(ref colors)).selectedColor = buttonSelect.Value; ((ColorBlock)(ref colors)).disabledColor = buttonDisabled.Value; ((Selectable)self).colors = colors; } } private static void PanelSkinControllerOnAwake(orig_Awake orig, PanelSkinController self) { //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self); if (colorButtons.Value && !((Object)((Component)self).gameObject).name.Contains("ObjectivePanel") && !((Object)((Component)self).gameObject).name.Contains("Naked")) { Image component = ((Component)self).gameObject.GetComponent<Image>(); if (!((Object)((Component)component).gameObject).name.Contains("RuleBook")) { ((Graphic)component).color = Utils.Color255(buttonNorm.Value.r, buttonNorm.Value.g, buttonNorm.Value.b, ((Graphic)component).color.a); } } } private static void ButtonSkinControllerOnAwake(orig_Awake orig, ButtonSkinController self) { //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self); if (!colorButtons.Value) { return; } HGButton component = ((Component)self).gameObject.GetComponent<HGButton>(); if (!Object.op_Implicit((Object)(object)component) || ((Object)component).name.Contains("SurvivorIcon") || ((Object)((Component)component).gameObject).name.Contains("Choice") || ((Object)((Component)component).gameObject).name.Contains("Loadout") || ((Object)((Component)component).gameObject).name.Contains("ObjectivePanel") || ((Object)((Component)component).gameObject).name.Contains("Naked")) { return; } Transform parent = ((Component)component).gameObject.transform.parent; if (parent != null) { Transform parent2 = parent.parent; bool? obj; if (parent2 == null) { obj = null; } else { Transform parent3 = parent2.parent; obj = ((parent3 != null) ? new bool?(((Object)parent3).name.Contains("CommandPickerPanel(Clone)")) : ((bool?)null)); } bool? flag = obj; if (flag == true) { return; } } if (((Object)((Component)component).gameObject).name.Contains("Music&More")) { ((Component)component).gameObject.SetActive(false); } ColorBlock colors = ((Selectable)component).colors; ((ColorBlock)(ref colors)).normalColor = buttonNorm.Value; ((ColorBlock)(ref colors)).highlightedColor = buttonHigh.Value; ((ColorBlock)(ref colors)).pressedColor = buttonPress.Value; ((ColorBlock)(ref colors)).selectedColor = buttonSelect.Value; ((ColorBlock)(ref colors)).disabledColor = buttonDisabled.Value; ((Selectable)component).colors = colors; } public override void Config(ConfigFile config) { //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Expected O, but got Unknown //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Expected O, but got Unknown //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Expected O, but got Unknown //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Expected O, but got Unknown //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Expected O, but got Unknown //IL_0184: 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_01a7: Expected O, but got Unknown enabled = config.Bind<bool>("BNR - UI", "enable patches for button recolors", true, ""); Utils.CheckboxConfig(enabled); enabled.SettingChanged += delegate { //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Expected O, but got Unknown //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Expected O, but got Unknown //IL_003d: 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_0048: Expected O, but got Unknown if (enabled.Value) { object obj = <>O.<0>__ButtonSkinControllerOnAwake; if (obj == null) { hook_Awake val = ButtonSkinControllerOnAwake; <>O.<0>__ButtonSkinControllerOnAwake = val; obj = (object)val; } ButtonSkinController.Awake += (hook_Awake)obj; object obj2 = <>O.<1>__PanelSkinControllerOnAwake; if (obj2 == null) { hook_Awake val2 = PanelSkinControllerOnAwake; <>O.<1>__PanelSkinControllerOnAwake = val2; obj2 = (object)val2; } PanelSkinController.Awake += (hook_Awake)obj2; } else { object obj3 = <>O.<0>__ButtonSkinControllerOnAwake; if (obj3 == null) { hook_Awake val3 = ButtonSkinControllerOnAwake; <>O.<0>__ButtonSkinControllerOnAwake = val3; obj3 = (object)val3; } ButtonSkinController.Awake -= (hook_Awake)obj3; object obj4 = <>O.<1>__PanelSkinControllerOnAwake; if (obj4 == null) { hook_Awake val4 = PanelSkinControllerOnAwake; <>O.<1>__PanelSkinControllerOnAwake = val4; obj4 = (object)val4; } PanelSkinController.Awake -= (hook_Awake)obj4; } }; colorButtons = config.Bind<bool>("BNR - UI", "change buttons colors", false, "whether or not to use custom menu button colors,..,"); ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(colorButtons)); buttonNorm = config.Bind<Color>("BNR - UI", "normal button color", Utils.Color255(110, 83, 120), ""); ModSettingsManager.AddOption((BaseOption)new ColorOption(buttonNorm)); buttonHigh = config.Bind<Color>("BNR - UI", "highlighted button coor", Utils.Color255(255, 177, 245), ""); ModSettingsManager.AddOption((BaseOption)new ColorOption(buttonHigh)); buttonPress = config.Bind<Color>("BNR - UI", "pressed button color", Utils.Color255(192, 113, 182), ""); ModSettingsManager.AddOption((BaseOption)new ColorOption(buttonPress)); buttonSelect = config.Bind<Color>("BNR - UI", "selected button color", Utils.Color255(255, 177, 238), ""); ModSettingsManager.AddOption((BaseOption)new ColorOption(buttonSelect)); buttonDisabled = config.Bind<Color>("BNR - UI", "disabled button color", Utils.Color255(226, 197, 219), ""); ModSettingsManager.AddOption((BaseOption)new ColorOption(buttonDisabled)); } } public class camtest : PatchBase<camtest> { private static readonly int ShadowTex = Shader.PropertyToID("_ShadowTex"); private List<Renderer> gameObjects = new List<Renderer>(); private List<ShadowCastingMode> castingModes = new List<ShadowCastingMode>(); private ConfigEntry<bool> enabled; public override void Init() { applyHooks(); } private void applyHooks() { _ = enabled.Value; } private void StageOnonStageStartGlobal(Stage stage) { //IL_003c: Unknown result type (might be due to invalid IL or missing references) gameObjects = new List<Renderer>(); Renderer[] array = Object.FindObjectsOfType<Renderer>(false); foreach (Renderer val in array) { if (((Component)val).gameObject.layer == 11) { gameObjects.Add(val); castingModes.Add(val.shadowCastingMode); } } } private void HealthComponentOnTakeDamageProcess(orig_TakeDamageProcess orig, HealthComponent self, DamageInfo damageinfo) { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: 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) GameObject gameObject = ((Component)self.body.modelLocator.modelTransform).gameObject; RendererInfo[] obj = gameObject.GetComponent<CharacterModel>()?.baseRendererInfos; List<int> list = new List<int>(); RendererInfo[] array = obj; foreach (RendererInfo val in array) { list.Add(((Component)val.renderer).gameObject.layer); ((Component)val.renderer).gameObject.layer = 28; } for (int j = 0; j < gameObjects.Count; j++) { ((Component)gameObjects[j]).gameObject.layer = 28; gameObjects[j].shadowCastingMode = (ShadowCastingMode)3; } ApplyAnamorphic(28, Vector3.Distance(((Component)SceneCamera._camera).transform.position, gameObject.transform.position) + 999f); for (int k = 0; k < gameObjects.Count; k++) { ((Component)gameObjects[k]).gameObject.layer = 11; gameObjects[k].shadowCastingMode = (ShadowCastingMode)1; } } private void RoR2ApplicationOnonUpdate() { if (Input.GetKeyDown((KeyCode)112)) { ApplyAnamorphic(1); } } private void ApplyAnamorphic(int layer, float maxDistance = -1f) { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: 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_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Expected O, but got Unknown //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_0202: Unknown result type (might be due to invalid IL or missing references) //IL_0218: Unknown result type (might be due to invalid IL or missing references) //IL_022e: Unknown result type (might be due to invalid IL or missing references) //IL_0238: Expected O, but got Unknown //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_02f2: Unknown result type (might be due to invalid IL or missing references) //IL_0395: Unknown result type (might be due to invalid IL or missing references) //IL_03a3: Unknown result type (might be due to invalid IL or missing references) //IL_03ba: Unknown result type (might be due to invalid IL or missing references) //IL_03bc: Unknown result type (might be due to invalid IL or missing references) Camera camera = SceneCamera._camera; GameObject val = null; if (HUD.instancesList.Count > 0) { HUD obj = HUD.instancesList[0]; val = ((obj != null) ? ((Component)obj).gameObject : null); } CameraClearFlags clearFlags = camera.clearFlags; int cullingMask = camera.cullingMask; Color backgroundColor = camera.backgroundColor; camera.clearFlags = (CameraClearFlags)2; camera.cullingMask = 1 << layer; camera.backgroundColor = Color.clear; Log.Debug("mask = " + camera.cullingMask, 109); if (val != null) { val.SetActive(false); } ((Component)((Component)SceneCamera._camera).transform.Find("GlobalPostProcessVolume")).gameObject.SetActive(false); GameObject val2 = GameObject.Find("PP + Amb"); PostProcessVolume obj2 = ((val2 != null) ? val2.GetComponent<PostProcessVolume>() : null); object obj3; if (obj2 == null) { obj3 = null; } else { PostProcessProfile profile = obj2.profile; obj3 = ((profile != null) ? profile.GetSetting<RampFog>() : null); } RampFog val3 = (RampFog)obj3; Color value = default(Color); if (Object.op_Implicit((Object)(object)val3)) { value = ((ParameterOverride<Color>)(object)val3.fogColorEnd).value; ((ParameterOverride<Color>)(object)val3.fogColorEnd).value = new Color(0f, 0f, 0f, 0f); } Stopwatch stopwatch = new Stopwatch(); stopwatch.Start(); Texture2D val4 = new Texture2D(camera.pixelWidth, camera.pixelHeight, (TextureFormat)4, false); Stopwatch stopwatch2 = new Stopwatch(); stopwatch2.Start(); RenderTexture.active = camera.targetTexture; camera.Render(); Log.Debug(stopwatch2.Elapsed.Milliseconds + " ms", 138); val4.ReadPixels(new Rect(0f, 0f, (float)camera.pixelWidth, (float)camera.pixelHeight), 0, 0); val4.Apply(); ((Object)val4).name = "newSnapshot"; ((Texture)val4).wrapMode = (TextureWrapMode)1; RenderTexture.active = null; camera.targetTexture = null; GameObject obj4 = Object.Instantiate<GameObject>(butterscotchnroses.bnrBundle.LoadAsset<GameObject>("BlobShadowProjector")); ((Object)obj4).name = "TestProjector"; obj4.transform.position = ((Component)camera).transform.position; obj4.transform.rotation = ((Component)camera).transform.rotation; Projector component = obj4.GetComponent<Projector>(); component.material = new Material(component.material); component.fieldOfView = camera.fieldOfView; component.farClipPlane = (Mathf.Approximately(maxDistance, -1f) ? camera.farClipPlane : maxDistance); component.nearClipPlane = camera.nearClipPlane; component.orthographicSize = camera.orthographicSize; component.aspectRatio = camera.aspect; component.material.SetTexture(ShadowTex, (Texture)(object)val4); Log.Debug(stopwatch.Elapsed.Milliseconds + " ms", 161); Stopwatch stopwatch3 = new Stopwatch(); stopwatch3.Start(); Plane[] array = GeometryUtility.CalculateFrustumPlanes(camera); foreach (Renderer gameObject in gameObjects) { if (GeometryUtility.TestPlanesAABB(array, gameObject.bounds)) { Log.Debug("renderer was rendered " + ((Object)gameObject).name, 171); } } Log.Debug(stopwatch3.Elapsed.Milliseconds + " ms", 174); if (val != null) { val.SetActive(true); } ((Component)((Component)SceneCamera._camera).transform.Find("GlobalPostProcessVolume")).gameObject.SetActive(true); if (val2 != null) { val2.SetActive(true); } camera.clearFlags = clearFlags; camera.cullingMask = cullingMask; camera.backgroundColor = backgroundColor; if (Object.op_Implicit((Object)(object)val3)) { ((ParameterOverride<Color>)(object)val3.fogColorEnd).value = value; } File.WriteAllBytes(Path.Combine(Path.GetDirectoryName(Paths.BepInExConfigPath), "test", "evil.png"), ImageConversion.EncodeToPNG(val4)); } public override void Config(ConfigFile config) { } } public class coloredits : PatchBase<coloredits> { private static Dictionary<int, ConfigEntry<Color>> replacementStyleLookupDict = new Dictionary<int, ConfigEntry<Color>>(); private static TMP_StyleSheet styleSheet; private static ConfigEntry<bool> enabled; public override void Init() { ApplyHooks(); } private static void ApplyHooks() { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Expected O, but got Unknown //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) if (!enabled.Value) { return; } int num = ColorCatalog.indexToColor32.Length - 1; for (int i = 1; i < num; i++) { Color val = Color32.op_Implicit(ColorCatalog.indexToColor32[i]); ConfigEntry<Color> newColor = ((BaseUnityPlugin)butterscotchnroses.instance).Config.Bind<Color>("BNR - coloredits", "new color for " + Enum.GetName(typeof(ColorIndex), i), val, ""); ModSettingsManager.AddOption((BaseOption)new ColorOption(newColor)); int i2 = i; newColor.SettingChanged += delegate { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: 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) ColorCatalog.indexToColor32[i2] = Color32.op_Implicit(newColor.Value); }; ColorCatalog.indexToColor32[i] = Color32.op_Implicit(newColor.Value); } RoR2Application.onLoadFinished = (Action)Delegate.Combine(RoR2Application.onLoadFinished, new Action(OnLoadFinished)); } private static void OnLoadFinished() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) AsyncOperationHandle<TMP_StyleSheet> val = Addressables.LoadAssetAsync<TMP_StyleSheet>((object)TextMesh_Pro_FormerResources.TMP_Default_Style_Sheet_asset); val.Completed += delegate(AsyncOperationHandle<TMP_StyleSheet> handle) { ConfigApplyStyleSheed(handle.Result); }; static void ConfigApplyStyleSheed(TMP_StyleSheet styleSheet) { //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Expected O, but got Unknown //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Expected O, but got Unknown TMP_Style[] array = styleSheet.styles.ToArray(); Color val2 = default(Color); foreach (TMP_Style tmpStyle in array) { ColorUtility.TryParseHtmlString(tmpStyle.styleOpeningDefinition.Replace("<color=", "").Replace(">", ""), ref val2); ConfigEntry<Color> newColor = ((BaseUnityPlugin)butterscotchnroses.instance).Config.Bind<Color>("BNR - coloredits", "tmp style tag recolor for " + (tmpStyle.name.StartsWith('c') ? tmpStyle.name.Substring(1).Replace(")", "") : tmpStyle.name.Replace(")", "")), val2, ""); ModSettingsManager.AddOption((BaseOption)new ColorOption(newColor)); newColor.SettingChanged += delegate { //IL_0032: 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) //IL_0057: Expected O, but got Unknown styleSheet.styles.Remove(tmpStyle); TMP_Style item2 = new TMP_Style(tmpStyle.name, "<color=#" + ColorUtility.ToHtmlStringRGBA(newColor.Value) + ">", tmpStyle.styleClosingDefinition); styleSheet.styles.Add(item2); }; styleSheet.styles.Remove(tmpStyle); TMP_Style item = new TMP_Style(tmpStyle.name, "<color=#" + ColorUtility.ToHtmlStringRGBA(newColor.Value) + ">", tmpStyle.styleClosingDefinition); styleSheet.styles.Add(item); } } } public override void Config(ConfigFile config) { enabled = config.Bind<bool>("BNR - coloredits", "enable patches for coloredits", true, ""); Utils.CheckboxConfig(enabled); enabled.SettingChanged += delegate { ApplyHooks(); }; } } public class cursoredits : PatchBase<cursoredits> { public enum cursorTypes { defaultCursor, cursor1, cursor2, cursor3 } private Texture cursorDefault; private Texture cursorDefaultActive; private Texture cursor1; private Texture cursor1Active; private Texture cursor2; private Texture cursor2Active; private Texture cursor3; private Texture cursor3Active; private GameObject cursorPrefab; private ConfigEntry<cursorTypes> cursorType; private ConfigEntry<Color> cursorColor; private ConfigEntry<bool> enabled; public static ConfigEntry<bool> swingyCursor; public override void Init() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) applyHooks(); cursorDefault = Addressables.LoadAssetAsync<Texture>((object)RoR2_Base_Core.texCursor_Active_png).WaitForCompletion(); cursorDefaultActive = Addressables.LoadAssetAsync<Texture>((object)RoR2_Base_Core.texCursor_Inactive_png).WaitForCompletion(); cursor1 = Addressables.LoadAssetAsync<Texture>((object)RoR2_Base_Common_MiscIcons.texCursor_png).WaitForCompletion(); cursor1Active = Addressables.LoadAssetAsync<Texture>((object)RoR2_Base_Common_MiscIcons.texCursor_png).WaitForCompletion(); cursor2 = Addressables.LoadAssetAsync<Texture>((object)RoR2_Base_Common_MiscIcons.texCursor2_png).WaitForCompletion(); cursor2Active = Addressables.LoadAssetAsync<Texture>((object)RoR2_Base_Common_MiscIcons.texCursor2_png).WaitForCompletion(); cursor3 = Addressables.LoadAssetAsync<Texture>((object)RoR2_Base_Common_MiscIcons.texCursor3_png).WaitForCompletion(); cursor3Active = Addressables.LoadAssetAsync<Texture>((object)RoR2_Base_Common_MiscIcons.texCursor3_png).WaitForCompletion(); } private void applyHooks() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: 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_009a: Expected O, but got Unknown //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Expected O, but got Unknown if (swingyCursor.Value) { AsyncOperationHandle<GameObject> val = Addressables.LoadAssetAsync<GameObject>((object)RoR2_Base_UI_Cursor.CursorIndicator_prefab); val.Completed += delegate(AsyncOperationHandle<GameObject> handle) { cursorPrefab = handle.Result; ((Component)((Component)cursorPrefab.transform.GetChild(0)).transform).gameObject.AddComponent<OsuPhysics>(); }; } if (enabled.Value) { RoR2Application.onLoadFinished = (Action)Delegate.Combine(RoR2Application.onLoadFinished, new Action(applyCursorEdits)); CursorIndicatorController.SetCursor += new hook_SetCursor(CursorIndicatorControllerOnSetCursor); } else { RoR2Application.onLoadFinished = (Action)Delegate.Remove(RoR2Application.onLoadFinished, new Action(applyCursorEdits)); CursorIndicatorController.SetCursor -= new hook_SetCursor(CursorIndicatorControllerOnSetCursor); } } private void CursorIndicatorControllerOnSetCursor(orig_SetCursor orig, CursorIndicatorController self, CursorSet cursorset, CursorImage cursorimage, Color color) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self, cursorset, cursorimage, cursorColor.Value); } private void applyCursorEdits() { //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_0194: Unknown result type (might be due to invalid IL or missing references) //IL_0199: Unknown result type (might be due to invalid IL or missing references) Texture val = default(Texture); foreach (MPEventSystem instances in MPEventSystem.instancesList) { cursorTypes value = cursorType.Value; switch (value) { case cursorTypes.cursor1: val = cursor1Active; break; case cursorTypes.cursor2: val = cursor2Active; break; case cursorTypes.cursor3: val = cursor3Active; break; case cursorTypes.defaultCursor: val = cursorDefaultActive; break; default: global::<PrivateImplementationDetails>.ThrowSwitchExpressionException(value); break; } Texture val2 = val; value = cursorType.Value; switch (value) { case cursorTypes.cursor1: val = cursor1; break; case cursorTypes.cursor2: val = cursor2; break; case cursorTypes.cursor3: val = cursor3; break; case cursorTypes.defaultCursor: val = cursorDefault; break; default: global::<PrivateImplementationDetails>.ThrowSwitchExpressionException(value); break; } Texture val3 = val; instances.cursorIndicatorController.mouseCursorSet.hoverObject.GetComponent<Image>().sprite = Sprite.Create((Texture2D)(object)((val3 is Texture2D) ? val3 : null), new Rect(0f, 0f, (float)cursor1.width, (float)cursor1.height), new Vector2(0f, 0f)); instances.cursorIndicatorController.mouseCursorSet.pointerObject.GetComponent<Image>().sprite = Sprite.Create((Texture2D)(object)((val2 is Texture2D) ? val2 : null), new Rect(0f, 0f, (float)cursor1.width, (float)cursor1.height), new Vector2(0f, 0f)); instances.cursorIndicatorController.cachedIndicatorColor = cursorColor.Value; instances.cursorIndicatorController.ApplyIndicatorColor(); } } public override void Config(ConfigFile config) { //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Expected O, but got Unknown //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Expected O, but got Unknown //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Expected O, but got Unknown cursorType = config.Bind<cursorTypes>("BNR - cursoredits", "cursor type ,..,", cursorTypes.defaultCursor, ""); cursorType.SettingChanged += delegate { applyCursorEdits(); }; ModSettingsManager.AddOption((BaseOption)new ChoiceOption((ConfigEntryBase)(object)cursorType)); cursorColor = config.Bind<Color>("BNR - cursoredits", "cursor color ,..,", Color.white, ""); cursorColor.SettingChanged += delegate { applyCursorEdits(); }; ModSettingsManager.AddOption((BaseOption)new ColorOption(cursorColor)); swingyCursor = config.Bind<bool>("BNR - cursoredits", "swingy cursor ,..,", true, ""); ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(swingyCursor)); enabled = config.Bind<bool>("BNR - cursoredits", "enable patches for cursoredits", false, ""); Utils.CheckboxConfig(enabled); enabled.SettingChanged += delegate { applyHooks(); }; } } internal class OsuPhysics : CursorPhysicsBase { private Vector3? initialPos; private new void Update() { //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_01fc: Unknown result type (might be due to invalid IL or missing references) //IL_0207: Unknown result type (might be due to invalid IL or missing references) //IL_022d: Unknown result type (might be due to invalid IL or missing references) //IL_0233: Unknown result type (might be due to invalid IL or missing references) //IL_0243: Unknown result type (might be due to invalid IL or missing references) //IL_0248: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: 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_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_0160: 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_0180: Unknown result type (might be due to invalid IL or missing references) //IL_0190: Unknown result type (might be due to invalid IL or missing references) //IL_0198: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_01e0: Unknown result type (might be due to invalid IL or missing references) //IL_01e5: Unknown result type (might be due to invalid IL or missing references) if (Input.GetMouseButtonDown(0) && spinDegrees == 0f) { prevVector = targetVector; initialPos = ((Component)this).transform.position; } if (Input.GetMouseButtonDown(0)) { initialPos = ((Component)this).transform.position; } if (Input.GetMouseButtonUp(0)) { if (added180) { spinDegrees -= 180f; } added180 = false; timeHoldingDownCursor = 0f; lastSpinDegree = 0f; positions = new Queue<Vector2>(); for (int i = 0; i < 3; i++) { positions.Enqueue(new Vector2(1f, 0f)); } prevVector = new Vector2(1f, 0f); targetVector = new Vector2(1f, 0f); } if (Input.GetMouseButton(0) && timeHoldingDownCursor > 0.5f) { Vector2 val = positions.Peek() - Vector2.op_Implicit(((Component)this).transform.position); if (val != Vector2.zero) { Vector3 position = ((Component)this).transform.position; Vector3? val2 = initialPos; if (!val2.HasValue || position != val2.GetValueOrDefault()) { positions.Enqueue(Vector2.op_Implicit(((Component)this).transform.position)); positions.Dequeue(); float num = Mathf.Atan2(((Vector2)(ref val)).normalized.y, ((Vector2)(ref val)).normalized.x) * 57.29578f; num -= 135f; prevVector = new Vector2(Mathf.Cos(MathF.PI / 180f * num), Mathf.Sin(MathF.PI / 180f * num)); initialPos = null; } } Log.Debug($"target {targetVector} prev {prevVector} at {timeHoldingDownCursor}", 192); targetVector = Vector2.Lerp(targetVector, prevVector, Time.unscaledDeltaTime * 4f); angle = Mathf.Atan2(targetVector.y, targetVector.x) * 57.29578f; HandleSpinAnlge(); } else { spinDegrees = Mathf.Lerp(spinDegrees, 0f, Time.unscaledDeltaTime * 2f); spinDegrees = Mathf.MoveTowards(spinDegrees, 0f, Time.unscaledDeltaTime * 6f); angle = spinDegrees; } base.Update(); } } internal class ConstantSwingy : CursorPhysicsBase { private new void Update() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0016: 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_0020: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: 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_003d: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //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_0115: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) Vector2 val = Vector2.op_Implicit(((Component)this).transform.position) - positions.Dequeue(); positions.Enqueue(Vector2.op_Implicit(((Component)this).transform.position)); if (val != Vector2.zero) { prevVector = ((Vector2)(ref val)).normalized; float num = Mathf.Atan2(prevVector.y, prevVector.x) * 57.29578f; num -= 135f; prevVector = new Vector2(Mathf.Cos(MathF.PI / 180f * num), Mathf.Sin(MathF.PI / 180f * num)); } else { prevVector = Vector2.right; spinDegrees = Mathf.Lerp(spinDegrees, 0f, Time.deltaTime * 2f); spinDegrees = Mathf.MoveTowards(spinDegrees, 0f, Time.deltaTime * 6f); lastSpinDegree = 0f; } targetVector = Vector2.Lerp(targetVector, prevVector, Time.deltaTime * 4f); angle = Mathf.Atan2(targetVector.y, targetVector.x) * 57.29578f; base.Update(); } } internal class CursorPhysicsBase : MonoBehaviour { public Vector2 targetVector; public RectTransform rectTransform; public Vector2 prevVector; public float spinDegrees; public float lastSpinDegree = -1f; public Queue<Vector2> positions = new Queue<Vector2>(); public float timeHoldingDownCursor; public bool added180; public float angle; private void Start() { //IL_0020: Unknown result type (might be due to invalid IL or missing references) rectTransform = ((Component)this).GetComponent<RectTransform>(); for (int i = 0; i < 3; i++) { positions.Enqueue(new Vector2(1f, 0f)); } } protected void Update() { //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) if (Input.GetMouseButton(0) && spinDegrees == 0f) { timeHoldingDownCursor += Time.unscaledDeltaTime; } RectTransform obj = rectTransform; Vector3 eulerAngles = ((Transform)rectTransform).eulerAngles; eulerAngles.z = angle; ((Transform)obj).eulerAngles = eulerAngles; } public void HandleSpinAnlge() { float num = angle; if (num < 180f) { added180 = true; num += 180f; } if (lastSpinDegree > num && Mathf.Abs(num - lastSpinDegree) > 200f) { spinDegrees += 360f - Mathf.Abs(lastSpinDegree - num); } else if (num > lastSpinDegree && Mathf.Abs(num - lastSpinDegree) > 200f) { spinDegrees -= 360f - Mathf.Abs(lastSpinDegree - num); } else { spinDegrees += Mathf.Abs(num) - lastSpinDegree; } lastSpinDegree = Mathf.Abs(num); } } public class drifter : PatchBase<drifter> { private ConfigEntry<bool> enabled; private ConfigEntry<bool> neverKillCubes; private ConfigEntry<int> cubeCount; public override void Init() { if (enabled.Value) { applyHooks(); } } public void applyHooks() { //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Expected O, but got Unknown //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Expected O, but got Unknown //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Expected O, but got Unknown //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Expected O, but got Unknown if (enabled.Value && butterscotchnroses.clientSide.Value) { CharacterMaster.GetDeployableSameSlotLimit += new hook_GetDeployableSameSlotLimit(CharacterMasterOnGetDeployableSameSlotLimit); Idle.OnEnter += new hook_OnEnter(IdleOnOnEnter); } else { CharacterMaster.GetDeployableSameSlotLimit -= new hook_GetDeployableSameSlotLimit(CharacterMasterOnGetDeployableSameSlotLimit); Idle.OnEnter -= new hook_OnEnter(IdleOnOnEnter); } } private void IdleOnOnEnter(orig_OnEnter orig, Idle self) { orig.Invoke(self); if (neverKillCubes.Value) { ((EntityState)self).fixedAge = float.NegativeInfinity; } } private int CharacterMasterOnGetDeployableSameSlotLimit(orig_GetDeployableSameSlotLimit orig, CharacterMaster self, DeployableSlot slot) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Invalid comparison between Unknown and I4 //IL_0007: Unknown result type (might be due to invalid IL or missing references) if ((int)slot != 22) { return orig.Invoke(self, slot); } return cubeCount.Value; } public override void Config(ConfigFile config) { enabled = config.Bind<bool>("BNR - drifter", "enable patches for drifter", true, ""); Utils.CheckboxConfig(enabled); enabled.SettingChanged += delegate { applyHooks(); }; cubeCount = config.Bind<int>("BNR - drifter", "junk cube count", 20, "limit of junk cubes !!"); Utils.SliderConfig(4, 300, cubeCount); neverKillCubes = config.Bind<bool>("BNR - drifter", "never kill cubes !!!", true, "byeah ,,."); Utils.CheckboxConfig(neverKillCubes); } } public class dronevisibility : PatchBase<dronevisibility> { private ConfigEntry<bool> enabled; private ConfigEntry<bool> useSillyMaterials; private ConfigEntry<Color> sillyMaterialColor; private ConfigEntry<Color> operatorIndicatorColor; private ConfigEntry<float> visibilityDistance; private Material operatorMat; public override void Init() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) operatorMat = Object.Instantiate<Material>(Addressables.LoadAssetAsync<Material>((object)"RoR2/DLC3/Drone Tech/matDroneTechCarryRings.mat").WaitForCompletion()); operatorMat.SetColor("_TintColor", operatorIndicatorColor.Value); Hook(); } private void Hook() { //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Expected O, but got Unknown //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Expected O, but got Unknown //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Expected O, but got Unknown //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Expected O, but got Unknown if (enabled.Value) { HologramProjector.BuildHologram += new hook_BuildHologram(HologramProjectorOnBuildHologram); SummonMasterBehavior.OnEnable += new hook_OnEnable(SummonMasterBehaviorOnOnEnable); } else { HologramProjector.BuildHologram -= new hook_BuildHologram(HologramProjectorOnBuildHologram); SummonMasterBehavior.OnEnable -= new hook_OnEnable(SummonMasterBehaviorOnOnEnable); } } private void SummonMasterBehaviorOnOnEnable(orig_OnEnable orig, SummonMasterBehavior self) { orig.Invoke(self); if (Object.op_Implicit((Object)(object)((Component)self).GetComponent<DroneAvailability>())) { HologramProjector component = ((Component)self).GetComponent<HologramProjector>(); if (Object.op_Implicit((Object)(object)component)) { component.displayDistance = visibilityDistance.Value; } else { Log.Warning("failed to find projector on drone !!"); } } } private void HologramProjectorOnBuildHologram(orig_BuildHologram orig, HologramProjector self) { //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Expected O, but got Unknown //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_014e: 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_0172: Unknown result type (might be due to invalid IL or missing references) //IL_022b: Unknown result type (might be due to invalid IL or missing references) //IL_024b: 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)