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 Inferno.Stat_AI; using Microsoft.CodeAnalysis; 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.OptionConfigs; using RiskOfOptions.Options; using RoR2; using RoR2.Hologram; using RoR2.Items; 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.PostProcessing; using UnityEngine.ResourceManagement.AsyncOperations; using UnityEngine.SceneManagement; using UnityEngine.UI; using butterscotchnroses; using butterscotchnroses.artifacts; using butterscotchnroses.skills; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: OptIn] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("butterscotchnroses")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+6a32b4f7f5044d6a6f2b4ff2393f919205a66213")] [assembly: AssemblyProduct("butterscotchnroses")] [assembly: AssemblyTitle("butterscotchnroses")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] [module: UnverifiableCode] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace 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> imageFormatDecoders = new Dictionary> { { 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> 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 replaceOldConfigs; public static void fixOldConfigs() { replaceOldConfigs = ((BaseUnityPlugin)BNR.butterscotchnroses.instance).Config.Bind("!!!Config Replacement!!!", "whether or not to replace/fix old default configs ,..,", true, "basically uhh replace default configs if enabled.,,."); 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 : SkillBase where T : SkillBase { 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 Keywords { get; } = new List(); 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("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 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((object)Survivor).WaitForCompletion(); bool flag = false; GenericSkill[] components = val.GetComponents(); 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(); SkillLocator component = val.GetComponent(); SkillFamily val4 = ScriptableObject.CreateInstance(); 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(); 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((object)Survivor).WaitForCompletion().GetComponent(); 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 = "Agile. " + text; } LanguageAPI.Add(SkillDef.skillDescriptionToken, text); ContentAddition.AddSkillDef(SkillDef); PostCreation(); } public virtual SkillDef GetSkillDef() { return ScriptableObject.CreateInstance(); } public virtual void PostCreation() { PostCreationEvent?.Invoke(this, new EventArgs()); } public EntityStateMachine AddEntityStateMachine(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(); obj2.customName = name; obj2.initialStateType = new SerializableEntityStateType(typeof(T)); obj2.mainStateType = new SerializableEntityStateType(typeof(T)); List list = obj.GetComponents().ToList(); obj.GetComponent().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((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 : ArtifactBase where T : ArtifactBase { 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.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 { public static ConfigEntry 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((object)"RoR2/Base/Common/MiscIcons/texMysteryIcon.png").WaitForCompletion(); public override Sprite ArtifactDisabledIcon => Addressables.LoadAssetAsync((object)"RoR2/Base/Common/MiscIcons/texMysteryIcon.png").WaitForCompletion(); public override void Init(ConfigFile config) { } private void CreateConfig(ConfigFile config) { TimesToPrintMessageOnStart = config.Bind("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((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((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("zzzicebro.BNR", "BNR", "0.3.0")] [BepInDependency(/*Could not decode attribute arguments.*/)] public class butterscotchnroses : BaseUnityPlugin { private const string PluginGUID = "zzzicebro.BNR"; private const string PluginAuthor = "icebro"; private const string PluginName = "BNR"; private const string PluginVersion = "0.3.0"; public static AssetBundle carvingKitBundle; public static AssetBundle redmanBundle; public static AssetBundle bnrBundle; public static butterscotchnroses instance; public static List patchBases = new List(); public static Harmony harmony; public static ConfigEntry clientSide; public void Awake() { //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Expected O, but got Unknown instance = this; Log.Init(((BaseUnityPlugin)this).Logger); ((BaseUnityPlugin)this).Logger.LogDebug((object)"loading mod !!"); clientSide = ((BaseUnityPlugin)this).Config.Bind("BNR", "client side", false, "whether the mod should run in clientside mode or not .,,. disables content/changed behavior that would otherwise cause desyncs automatically !!!"); 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 patchBase = (PatchBase)Activator.CreateInstance(item); patchBase.Config(((BaseUnityPlugin)this).Config); patchBase.PreInit(); patchBases.Add(patchBase); } 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); } } if (!clientSide.Value) { foreach (Type item2 in from type in Assembly.GetExecutingAssembly().GetTypes() where !type.IsAbstract && type.IsSubclassOf(typeof(BuffBase)) select type) { ((BuffBase)Activator.CreateInstance(item2)).AddBuff(); } foreach (Type item3 in from type in Assembly.GetExecutingAssembly().GetTypes() where !type.IsAbstract && type.IsSubclassOf(typeof(ItemBase)) select type) { ((ItemBase)Activator.CreateInstance(item3)).Init(((BaseUnityPlugin)this).Config); } foreach (Type item4 in from x in Assembly.GetExecutingAssembly().GetTypes() where !x.IsAbstract && x.IsSubclassOf(typeof(SkillBase)) select x) { ((SkillBase)Activator.CreateInstance(item4)).Init(); } foreach (Type item5 in from x in Assembly.GetExecutingAssembly().GetTypes() where !x.IsAbstract && x.IsSubclassOf(typeof(ArtifactBase)) select x) { ((ArtifactBase)Activator.CreateInstance(item5)).Init(((BaseUnityPlugin)this).Config); } } oldconfigs.fixOldConfigs(); } private void Update() { foreach (PatchBase patchBasis in patchBases) { patchBasis.Update(); } } private void FixedUpdate() { foreach (PatchBase patchBasis in patchBases) { patchBasis.FixedUpdate(); } } } 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) { } 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 buttonrecolors : PatchBase { [CompilerGenerated] private static class <>O { public static hook_Awake <0>__ButtonSkinControllerOnAwake; public static hook_Awake <1>__PanelSkinControllerOnAwake; } private ConfigEntry enabled; private static ConfigEntry colorButtons; private static ConfigEntry buttonNorm; private static ConfigEntry buttonHigh; private static ConfigEntry buttonPress; private static ConfigEntry buttonSelect; 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_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 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; } } 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("NakedButton (Quit)")) { Image component = ((Component)self).gameObject.GetComponent(); 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_00bf: 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_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: 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_010a: 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(); 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("NakedButton (Quit)")) { 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; ((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 enabled = config.Bind("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("BNR - UI", "change buttons colors", false, "whether or not to use custom menu button colors,..,"); ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(colorButtons)); buttonNorm = config.Bind("BNR - UI", "normal button color", Utils.Color255(110, 83, 120), ""); ModSettingsManager.AddOption((BaseOption)new ColorOption(buttonNorm)); buttonHigh = config.Bind("BNR - UI", "highlighted button coor", Utils.Color255(255, 177, 245), ""); ModSettingsManager.AddOption((BaseOption)new ColorOption(buttonHigh)); buttonPress = config.Bind("BNR - UI", "pressed button color", Utils.Color255(192, 113, 182), ""); ModSettingsManager.AddOption((BaseOption)new ColorOption(buttonPress)); buttonSelect = config.Bind("BNR - UI", "selected button color", Utils.Color255(255, 177, 238), ""); ModSettingsManager.AddOption((BaseOption)new ColorOption(buttonSelect)); } } public class coloredits : PatchBase { private ConfigEntry enabled; public override void Init() { applyHooks(); } private void applyHooks() { //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_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Expected O, but got Unknown //IL_00b1: 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_00bb: 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 newColor = ((BaseUnityPlugin)butterscotchnroses.instance).Config.Bind("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); } } public override void Config(ConfigFile config) { enabled = config.Bind("BNR - coloredits", "enable patches for coloredits", true, ""); Utils.CheckboxConfig(enabled); enabled.SettingChanged += delegate { applyHooks(); }; } } public class drifter : PatchBase { private ConfigEntry enabled; private ConfigEntry neverKillCubes; private ConfigEntry 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("BNR - drifter", "enable patches for drifter", true, ""); Utils.CheckboxConfig(enabled); enabled.SettingChanged += delegate { applyHooks(); }; cubeCount = config.Bind("BNR - drifter", "junk cube count", 20, "limit of junk cubes !!"); Utils.SliderConfig(4, 300, cubeCount); neverKillCubes = config.Bind("BNR - drifter", "never kill cubes !!!", true, "byeah ,,."); Utils.CheckboxConfig(neverKillCubes); } } public class dronevisibility : PatchBase { private ConfigEntry enabled; private ConfigEntry useSillyMaterials; private ConfigEntry sillyMaterialColor; private ConfigEntry operatorIndicatorColor; private ConfigEntry 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(Addressables.LoadAssetAsync((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())) { HologramProjector component = ((Component)self).GetComponent(); 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) //IL_0274: Unknown result type (might be due to invalid IL or missing references) //IL_028b: Unknown result type (might be due to invalid IL or missing references) //IL_0295: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self); if (!Object.op_Implicit((Object)(object)((Component)self).gameObject.GetComponent()) || ((Object)((Component)self).gameObject).name.Contains("Turret")) { return; } Texture portraitIcon = ((Component)self).gameObject.GetComponent().masterPrefab.GetComponent().bodyPrefab.GetComponent().portraitIcon; Transform val = ((Component)self).gameObject.transform.Find("HologramPivot"); GameObject val2 = new GameObject("HologramSprite"); val2.transform.SetParent(((Component)val).transform); val2.AddComponent(); SpriteRenderer val3 = val2.AddComponent(); val3.sprite = Sprite.Create((Texture2D)(object)((portraitIcon is Texture2D) ? portraitIcon : null), new Rect(0f, 0f, (float)portraitIcon.width, (float)portraitIcon.height), new Vector2(0.5f, 0.5f)); val2.transform.localScale = new Vector3(2f, 2f, 1f); if (useSillyMaterials.Value) { ((Renderer)val3).sharedMaterial = Addressables.LoadAssetAsync((object)RoR2_DLC2.matHalcyoniteShrineCrystalGlow_mat).WaitForCompletion(); ((Renderer)val3).sharedMaterial.SetTexture("_Cloud2Tex", Addressables.LoadAssetAsync((object)RoR2_Base_Common.texCloudOrganic2_png).WaitForCompletion()); ((Renderer)val3).sharedMaterial.SetTexture("_Cloud1Tex", Addressables.LoadAssetAsync((object)RoR2_DLC2_Child.texChildPrimaryStarCloud_png).WaitForCompletion()); ((Renderer)val3).sharedMaterial.SetColor("_TintColor", sillyMaterialColor.Value); ((Renderer)val3).sharedMaterial.SetInt("_AlphaBias", 0); } GameObject val4 = Object.Instantiate(Addressables.LoadAssetAsync((object)"RoR2/DLC3/Drone Tech/CommandCarryTransportVFX.prefab").WaitForCompletion(), val2.transform, true); for (int i = 0; i < val4.transform.childCount; i++) { GameObject gameObject = ((Component)val4.transform.GetChild(i)).gameObject; if (((Object)gameObject).name != "MainRings") { Object.Destroy((Object)(object)gameObject); continue; } gameObject.GetComponent().startSpeed = -10f; ((Renderer)gameObject.GetComponent()).sharedMaterial = operatorMat; } val4.transform.position = val4.transform.localPosition; val4.transform.localPosition = new Vector3(0f, 0f, 0f); val4.transform.position = new Vector3(val4.transform.position.x, val4.transform.position.y - 3.2f, val4.transform.position.z); } public override void Config(ConfigFile config) { //IL_0084: 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_00a8: Expected O, but got Unknown //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Expected O, but got Unknown enabled = config.Bind("BNR - Drone Visibility", "enable patches for drone visibility", false, ""); Utils.CheckboxConfig(enabled); enabled.SettingChanged += delegate { Hook(); }; useSillyMaterials = config.Bind("BNR - Drone Visibility", "use silly materials for indicator !!", true, ""); Utils.CheckboxConfig(useSillyMaterials); sillyMaterialColor = config.Bind("BNR - Drone Visibility", "colors for silly sprite hologram thing material !!", Utils.Color255(191, 126, 211), ""); ModSettingsManager.AddOption((BaseOption)new ColorOption(sillyMaterialColor)); operatorIndicatorColor = config.Bind("BNR - Drone Visibility", "colors for operator vfx thing !!", Utils.Color255(252, 142, 249), ""); ModSettingsManager.AddOption((BaseOption)new ColorOption(operatorIndicatorColor)); visibilityDistance = config.Bind("BNR - Drone Visibility", "set distance which hologram becomes visible (set like 99999 for always !!", 99999f, ""); Utils.SliderConfig(15f, 999f, visibilityDistance); } } public class HologramHelper : MonoBehaviour { private Transform hologram; public Vector3 pos; public void OnEnable() { //IL_0023: 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_0058: 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) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) hologram = ((Component)this).transform.parent.GetChild(0); ((Component)this).transform.position = ((Component)this).transform.localPosition; ((Component)this).transform.localPosition = new Vector3(0f, 0f, 0f); ((Component)this).transform.position = new Vector3(((Component)this).transform.position.x, ((Component)this).transform.position.y + 2f, ((Component)this).transform.position.z); } public void FixedUpdate() { //IL_002d: 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_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)hologram)) { Object.Destroy((Object)(object)((Component)this).gameObject); return; } Vector3 val = default(Vector3); val.x = 0f; val.y = hologram.eulerAngles.y; val.z = hologram.eulerAngles.z; ((Component)this).transform.rotation = Quaternion.Euler(val); } } public class loadingscreen : PatchBase { private ConfigEntry chanceForRandom; private ConfigEntry enabled; public override void Init() { applyHooks(); } private void applyHooks() { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Expected O, but got Unknown //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Expected O, but got Unknown if (enabled.Value && Random.Range(0f, 100f) <= chanceForRandom.Value) { RoR2Application.Update += new hook_Update(RoR2ApplicationOnUpdate); LoadingScreenCanvas.OnLoadComplete += new hook_OnLoadComplete(LoadingScreenCanvasOnOnLoadComplete); } void LoadingScreenCanvasOnOnLoadComplete(orig_OnLoadComplete orig, LoadingScreenCanvas self) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown orig.Invoke(self); RoR2Application.Update -= new hook_Update(RoR2ApplicationOnUpdate); } } private void RoR2ApplicationOnUpdate(orig_Update orig, RoR2Application self) { if (Object.op_Implicit((Object)(object)LoadingScreenCanvas.Instance?.percentage)) { LoadingScreenCanvas.Instance.percentage.SetPercentValue(Random.Range(int.MinValue, int.MaxValue)); } } public override void Config(ConfigFile config) { enabled = config.Bind("BNR - loadingscreen", "enable patches for loadingscreen", true, ""); Utils.CheckboxConfig(enabled); enabled.SettingChanged += delegate { applyHooks(); }; chanceForRandom = config.Bind("BNR - loadingscreen", "chance for loading screen to show random percents for no reason.,.,", 0.5f, "hehe,. .,"); Utils.SliderConfig(0f, 100f, chanceForRandom); } } public class malachite : PatchBase { private ConfigEntry enabled; public static ConfigEntry timeBetweenSpawns; public override void Init() { applyHooks(); } private void applyHooks() { //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_003c: 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 if (enabled.Value && butterscotchnroses.clientSide.Value) { CharacterBody.OnBuffFirstStackGained += new hook_OnBuffFirstStackGained(CharacterBodyOnOnBuffFirstStackGained); } else { CharacterBody.OnBuffFirstStackGained += new hook_OnBuffFirstStackGained(CharacterBodyOnOnBuffFirstStackGained); } } private void CharacterBodyOnOnBuffFirstStackGained(orig_OnBuffFirstStackGained orig, CharacterBody self, BuffDef buffDef) { orig.Invoke(self, buffDef); if (!((Object)(object)buffDef != (Object)(object)Buffs.AffixPoison)) { ((Component)self).gameObject.AddComponent()._characterBody = self; } } public override void Config(ConfigFile config) { enabled = config.Bind("BNR - malachite", "enable patches for malachite (have them naturally spawn urchins ,.,.", true, ""); Utils.CheckboxConfig(enabled); enabled.SettingChanged += delegate { applyHooks(); }; timeBetweenSpawns = config.Bind("BNR - malachite", "time between urchin spawns .,,.", 12f, "byeah.,,"); Utils.SliderConfig(1f, 30f, timeBetweenSpawns); } } public class EvilUrchinSpawner : MonoBehaviour { public CharacterBody _characterBody; private float urchinSpawnTimer; private void OnEnable() { Log.Debug("added urchin spawner !!", 70); } private void FixedUpdate() { //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_0092: 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_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: 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_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) urchinSpawnTimer += Time.fixedDeltaTime; if (!(urchinSpawnTimer > malachite.timeBetweenSpawns.Value)) { return; } urchinSpawnTimer = 0f; Log.Debug("spawning urgin !!", 80); if (!Object.op_Implicit((Object)(object)_characterBody) || !_characterBody.HasBuff(Buffs.AffixPoison)) { Log.Debug("uh oh,,", 84); Object.Destroy((Object)(object)this); return; } Vector3 position = ((Component)this).transform.position; Ray val = (Ray)(Object.op_Implicit((Object)(object)_characterBody.inputBank) ? _characterBody.inputBank.GetAimRay() : new Ray(((Component)this).transform.position, ((Component)this).transform.rotation * Vector3.forward)); Quaternion val2 = Quaternion.LookRotation(((Ray)(ref val)).direction); GameObject val3 = Object.Instantiate(LegacyResourcesAPI.Load("Prefabs/CharacterMasters/UrchinTurretMaster"), position, val2); CharacterMaster component = val3.GetComponent(); if (Object.op_Implicit((Object)(object)component)) { component.teamIndex = _characterBody.teamComponent.teamIndex; NetworkServer.Spawn(val3); component.SpawnBodyHere(); } } } public class pingrecolor : PatchBase { private ConfigEntry pingIndicatorDefault; private ConfigEntry pingIndicatorEnemy; private ConfigEntry pingIndicatorInteractable; private ConfigEntry pingIndicatorCount; private ConfigEntry enabled; public override void Init() { applyHooks(); } private void applyHooks() { //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Expected O, but got Unknown //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Expected O, but got Unknown //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Expected O, but got Unknown //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Expected O, but got Unknown //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: 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 //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Expected O, but got Unknown //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Expected O, but got Unknown //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Expected O, but got Unknown if (enabled.Value) { PingIndicator.OnEnable += new hook_OnEnable(PingIndicatorOnOnEnable); PingIndicator.RebuildPing += new hook_RebuildPing(PingIndicatorOnRebuildPing); PingIndicator.Start += new hook_Start(PingIndicatorOnStart); PingIndicator.OnPreRenderOutlineHighlight += new hook_OnPreRenderOutlineHighlight(PingIndicatorOnOnPreRenderOutlineHighlight); ChargeIndicatorController.TriggerPing += new hook_TriggerPing(ChargeIndicatorControllerOnTriggerPing); } else { PingIndicator.OnEnable -= new hook_OnEnable(PingIndicatorOnOnEnable); PingIndicator.RebuildPing -= new hook_RebuildPing(PingIndicatorOnRebuildPing); PingIndicator.Start -= new hook_Start(PingIndicatorOnStart); PingIndicator.OnPreRenderOutlineHighlight -= new hook_OnPreRenderOutlineHighlight(PingIndicatorOnOnPreRenderOutlineHighlight); ChargeIndicatorController.TriggerPing -= new hook_TriggerPing(ChargeIndicatorControllerOnTriggerPing); } } private void ChargeIndicatorControllerOnTriggerPing(orig_TriggerPing orig, ChargeIndicatorController self, string pingownername, bool triggeranimation) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) self.playerPingColor = pingIndicatorInteractable.Value; orig.Invoke(self, pingownername, triggeranimation); } private void PingIndicatorOnOnPreRenderOutlineHighlight(orig_OnPreRenderOutlineHighlight orig, PingIndicator self, OutlineHighlight outlinehighlight) { recolorPingIndicator(self); orig.Invoke(self, outlinehighlight); } private void PingIndicatorOnStart(orig_Start orig, PingIndicator self) { recolorPingIndicator(self); orig.Invoke(self); } private void PingIndicatorOnOnEnable(orig_OnEnable orig, PingIndicator self) { recolorPingIndicator(self); orig.Invoke(self); } private void PingIndicatorOnRebuildPing(orig_RebuildPing orig, PingIndicator self) { recolorPingIndicator(self); orig.Invoke(self); } private void recolorPingIndicator(PingIndicator pingIndicator) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //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_0029: 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) //IL_0036: 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_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Expected I4, but got Unknown //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: 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) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007b: 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_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0095: 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_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_0155: 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_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) pingIndicator.defaultPingColor = pingIndicatorDefault.Value; pingIndicator.enemyPingColor = pingIndicatorEnemy.Value; pingIndicator.interactablePingColor = pingIndicatorInteractable.Value; PingType pingType = pingIndicator.pingType; pingIndicator.pingColor = (Color)((int)pingType switch { 0 => pingIndicatorDefault.Value, 1 => pingIndicatorEnemy.Value, 2 => pingIndicatorInteractable.Value, 3 => pingIndicatorCount.Value, _ => pingIndicator.pingColor, }); pingIndicator.activeColor = pingIndicator.pingColor; ((Component)((Component)pingIndicator).transform.GetChild(0)).GetComponent().startColor = pingIndicatorDefault.Value; ((Component)((Component)pingIndicator).transform.GetChild(1)).GetComponent().startColor = pingIndicatorInteractable.Value; ((Component)((Component)pingIndicator).transform.GetChild(2)).GetComponent().startColor = pingIndicatorEnemy.Value; ((Component)pingIndicator.positionIndicator.alwaysVisibleObject.transform.GetChild(0)).GetComponent().color = pingIndicatorDefault.Value; ((Component)pingIndicator.positionIndicator.alwaysVisibleObject.transform.GetChild(1)).GetComponent().color = pingIndicatorEnemy.Value; ((Component)pingIndicator.positionIndicator.alwaysVisibleObject.transform.GetChild(2)).GetComponent().color = pingIndicatorInteractable.Value; } public override void Config(ConfigFile config) { //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Expected O, but got Unknown //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Expected O, but got Unknown //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Expected O, but got Unknown //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Expected O, but got Unknown enabled = config.Bind("BNR - pingrecolor", "enable patches for pingrecolor", true, ""); Utils.CheckboxConfig(enabled); enabled.SettingChanged += delegate { applyHooks(); }; pingIndicatorDefault = config.Bind("BNR - pingrecolor", "ping recolor for default ping !!", Utils.Color255(252, 142, 249), ""); ModSettingsManager.AddOption((BaseOption)new ColorOption(pingIndicatorDefault)); pingIndicatorEnemy = config.Bind("BNR - pingrecolor", "ping recolor for enemy ping !!", Utils.Color255(252, 142, 249), ""); ModSettingsManager.AddOption((BaseOption)new ColorOption(pingIndicatorEnemy)); pingIndicatorInteractable = config.Bind("BNR - pingrecolor", "ping recolor for interactable ping !!", Utils.Color255(252, 142, 249), ""); ModSettingsManager.AddOption((BaseOption)new ColorOption(pingIndicatorInteractable)); pingIndicatorCount = config.Bind("BNR - pingrecolor", "ping recolor for count ping (unsure what this one actually is !! !!", Utils.Color255(252, 142, 249), ""); ModSettingsManager.AddOption((BaseOption)new ColorOption(pingIndicatorCount)); } } public class postprocessing : PatchBase { private class stagePP { private PostProcessProfile profile; private string forwardFacingName; private string[] stageEditsList = Array.Empty(); public static Dictionary typeStringMatcher = new Dictionary(); public stagePP(string GUID, string forwardFacingName, string edits) { //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) stagePP stagePP = this; AsyncOperationHandle val = Addressables.LoadAssetAsync((object)GUID); val.Completed += delegate(AsyncOperationHandle handle) { postProcessProfiles.Add(handle.Result); stagePP.profile = handle.Result; stagePP.forwardFacingName = forwardFacingName; stagePP.stageEditsList = edits.Split(","); stagePP.ApplyEdits(); }; } private void ApplyEdits() { string[] array = stageEditsList; foreach (string text in array) { Log.Debug("add edit for " + forwardFacingName + " " + text, 118); if (!typeStringMatcher.TryGetValue(text, out var value)) { Log.Warning("could not find type " + text + " in supported types !!! supported types below ,. ,"); { foreach (string key in typeStringMatcher.Keys) { Log.Warning(key); } break; } } if (!profile.HasSettings(value)) { profile.AddSettings(value); Log.Debug($"added type {value} to {forwardFacingName}", 134); } object obj = typeof(PostProcessProfile).GetMethods().First((MethodInfo m) => m.Name == "GetSetting" && m.IsGenericMethod).MakeGenericMethod(value) .Invoke(profile, Array.Empty()); BindingFlags bindingAttr = BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic; foreach (FieldInfo item in obj.GetType().GetFields(bindingAttr).ToList()) { try { FieldInfo fieldInfo = item.GetValue(obj).GetType().GetFields(bindingAttr) .First((FieldInfo fieldInfo2) => fieldInfo2.Name == "value"); typeof(stagePP).GetMethods().First((MethodInfo m) => m.Name == "ApplyEdit" && m.IsGenericMethod).MakeGenericMethod(fieldInfo.FieldType) .Invoke(this, new object[3] { item, text, obj }); } catch (Exception ex) { if (!(ex is InvalidOperationException)) { if (ex is TargetInvocationException) { Log.Warning($"was unable to create config for variable {item.Name} of type {item.GetValue(obj)} !!!"); } else { Log.Error(ex); } } else { Log.Warning($"variable {item.Name} of typwe {item.GetValue(obj)} had no value variable !!"); } } } } } public void ApplyEdit(FieldInfo variable, string editType, object profileSetting) { //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Expected O, but got Unknown string text = Reflection.GetFieldValue(variable.GetValue(profileSetting), "value").ToString(); ConfigEntry val = default(ConfigEntry); if (!((BaseUnityPlugin)butterscotchnroses.instance).Config.TryGetEntry(new ConfigDefinition("BNR - postprocessing - " + forwardFacingName, editType + " - " + variable.Name), ref val)) { val = ((BaseUnityPlugin)butterscotchnroses.instance).Config.Bind("BNR - postprocessing - " + forwardFacingName, editType + " - " + variable.Name, Reflection.GetFieldValue(variable.GetValue(profileSetting), "value"), ""); } if (!object.Equals(Reflection.GetFieldValue(variable.GetValue(profileSetting), "value"), val.Value)) { Reflection.SetFieldValue(variable.GetValue(profileSetting), "value", val.Value); Reflection.SetFieldValue(variable.GetValue(profileSetting), "overrideState", true); Log.Warning(string.Format("{0} of type {1} .,., \nold value {2} ,..,\nnew value {3} !!!", variable.Name, variable.GetValue(profileSetting), text, Reflection.GetFieldValue(variable.GetValue(profileSetting), "value"))); } else { Log.Debug(string.Format("{0} of type {1} .,., value {2} !!!", variable.Name, variable.GetValue(profileSetting), Reflection.GetFieldValue(variable.GetValue(profileSetting), "value")), 199); } } } private static List postProcessProfiles = new List(); private ConfigEntry enabled; private ConfigEntry PPVEdit; public override void Init() { applyHooks(); } private void applyHooks() { if (!enabled.Value) { return; } foreach (Assembly item in new List(2) { typeof(SobelRain).Assembly, typeof(AmbientOcclusion).Assembly }) { Type[] array = item.ManifestModule.FindTypes(Module.FilterTypeName, "*"); Log.Debug($"test count: {array.Length}", 39); Type[] array2 = array; foreach (Type type in array2) { if (!type.ToString().Contains("+") && !type.ToString().Contains("[") && !type.ToString().Contains("<") && !stagePP.typeStringMatcher.ContainsKey(type.ToString().Split(".")[^1])) { stagePP.typeStringMatcher.Add(type.ToString().Split(".")[^1], type); } } } string[] array3 = PPVEdit.Value.Split(";"); foreach (string text in array3) { Log.Debug("PPV edit string: " + text, 60); Log.Debug("GUID/asset psth : " + text.Split(",")[0], 61); Log.Debug("forward facing name : " + text.Split(",")[1], 62); Log.Debug("regex []: " + Regex.Match(text, "\\[(.*?)\\]").Groups[1].Value, 63); new stagePP(text.Split(",")[0], text.Split(",")[1], Regex.Match(text, "\\[(.*?)\\]").Groups[1].Value); } } public override void Config(ConfigFile config) { enabled = config.Bind("BNR - postprocessing", "enable patches for postprocessing", true, ""); Utils.CheckboxConfig(enabled); enabled.SettingChanged += delegate { applyHooks(); }; PPVEdit = config.Bind("BNR - postprocessing", "stage edits", "RoR2/Base/title/PostProcessing/ppSceneGolemplainsFoggy.asset,titanic plains,[AmbientOcclusion];RoR2/DLC3/nest/ppSceneNest.asset,pretenders,[AmbientOcclusion]", "(assetpathtopostprocessingvolume),(config name),[(postprocessingtypename),(postprocessingtypename)]"); Utils.StringConfig(PPVEdit); } } public class quickerhalcshrine : PatchBase { private HalcyoniteShrineInteractable halcshrineinteractable; private GameObject bluePortalRef; private float startingTickRate; private ConfigEntry enabled; private ConfigEntry multiplier; private ConfigEntry playerCount; private ConfigEntry scaleTime; private ConfigEntry greenToBlue; public override void Init() { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: 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_0091: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Expected O, but got Unknown //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Expected O, but got Unknown //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Expected O, but got Unknown if (enabled.Value) { GameObject val = Addressables.LoadAssetAsync((object)RoR2_DLC2.ShrineHalcyonite_prefab).WaitForCompletion(); bluePortalRef = Addressables.LoadAssetAsync((object)RoR2_Base_PortalShop.PortalShop_prefab).WaitForCompletion(); halcshrineinteractable = val.GetComponent(); startingTickRate = halcshrineinteractable.tickRate; halcshrineinteractable.tickRate = startingTickRate * multiplier.Value; multiplier.SettingChanged += delegate { halcshrineinteractable.tickRate = startingTickRate * multiplier.Value; }; HalcyoniteShrineInteractable.Start += new hook_Start(HalcyoniteShrineInteractableOnStart); GoldSiphonNearbyBodyController.DrainGold += new hook_DrainGold(GoldSiphonNearbyBodyControllerOnDrainGold); BossGroup.OnDefeatedServer += new hook_OnDefeatedServer(BossGroupOnOnDefeatedServer); } } private void BossGroupOnOnDefeatedServer(orig_OnDefeatedServer orig, BossGroup self) { //IL_0040: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self); if (greenToBlue.Value) { GameObject val = GameObject.Find("PortalColossus(Clone)"); if (Object.op_Implicit((Object)(object)val)) { GameObject obj = Object.Instantiate(bluePortalRef); obj.transform.position = val.transform.position; NetworkServer.Spawn(obj); Object.Destroy((Object)(object)val); } } } private void GoldSiphonNearbyBodyControllerOnDrainGold(orig_DrainGold orig, GoldSiphonNearbyBodyController self) { orig.Invoke(self); if (NetworkServer.active && self.isTetheredToAtLeastOneObject && scaleTime.Value && Run.instance.participatingPlayerCount <= playerCount.Value) { Run.instance.SetRunStopwatch((Run.instance.GetRunStopwatch() + 1f / self.tickRate) * (multiplier.Value - 1f)); } } private void HalcyoniteShrineInteractableOnStart(orig_Start orig, HalcyoniteShrineInteractable self) { orig.Invoke(self); if (NetworkServer.active && Run.instance.participatingPlayerCount <= playerCount.Value) { self.tickRate = startingTickRate * multiplier.Value; } } public override void Config(ConfigFile config) { enabled = config.Bind("BNR - Halyc Shrines", "enable patches for halyc shrines", true, ""); Utils.CheckboxConfig(enabled); enabled.SettingChanged += delegate { //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) { HalcyoniteShrineInteractable.Start += new hook_Start(HalcyoniteShrineInteractableOnStart); GoldSiphonNearbyBodyController.DrainGold += new hook_DrainGold(GoldSiphonNearbyBodyControllerOnDrainGold); } else { HalcyoniteShrineInteractable.Start -= new hook_Start(HalcyoniteShrineInteractableOnStart); GoldSiphonNearbyBodyController.DrainGold -= new hook_DrainGold(GoldSiphonNearbyBodyControllerOnDrainGold); } }; multiplier = config.Bind("BNR - Halyc Shrines", "speed up halcyon shrine mutlipler", 2f, ""); Utils.SliderConfig(1f, 3f, multiplier); playerCount = config.Bind("BNR - Halyc Shrines", "only apply multiplier under or equal to x amount of players", 1, "eg. 1 = only singleplayer 2 = only 2 people multiplayer"); Utils.SliderConfig(1, 4, playerCount); scaleTime = config.Bind("BNR - Halyc Shrines", "speed up time scale as well", true, "make time scale with halcyon shrine speed as well"); Utils.CheckboxConfig(scaleTime); greenToBlue = config.Bind("BNR - Halyc Shrines", "turn green portal to blue", true, "makes green portals become blue after the boss has been defeated !!!"); Utils.CheckboxConfig(greenToBlue); } } public class skinrecolors : PatchBase { public class monobehaviorskinloader : MonoBehaviour { public void OnEnable() { Log.Debug("starting custom skin loadings coroutine !", 69); ((MonoBehaviour)this).StartCoroutine(LoadTextures()); } } public class skinrecolorui { public class tabletop : MonoBehaviour { public bool isDisabled = true; public void FixedUpdate() { if (isDisabled) { ((Component)this).gameObject.transform.Rotate(0f, 20f * Time.deltaTime, 0f); } } public void Rotate(float rot) { ((Component)this).gameObject.transform.Rotate(0f, rot, 0f); } } [CompilerGenerated] private static class <>O { public static UnityAction <0>__HueSliderListener; public static UnityAction <1>__HueInputFieldListener; public static UnityAction <2>__SatSliderListener; public static UnityAction <3>__SatInputFieldListener; public static UnityAction <4>__ValSliderListener; public static UnityAction <5>__ValInputFieldListener; public static UnityAction <6>__UseMulitplySatToggleListener; public static UnityAction <7>__SkinNameInputFieldListener; public static UnityAction <8>__ApplySkinHGButtonListner; public static UnityAction <9>__CreateSkinHGButtonListner; public static UnityAction <10>__ZoomInHGButtonListner; public static UnityAction <11>__ZoomOutHGButtonListner; public static UnityAction <12>__RotLHGButtonListner; public static UnityAction <13>__RotRHGButtonListner; public static UnityAction <14>__DisableTurntableHGButtonListner; } public static Slider hueSlider; public static TMP_InputField hueInputField; public static Slider satSlider; public static TMP_InputField satInputField; public static Slider valSlider; public static TMP_InputField valInputField; public static Toggle useMulitplySat; public static TMP_InputField skinName; public static HGButton applySkin; public static HGButton createSkin; public static GameObject cameraObject; public static HGButton zoomIn; public static HGButton zoomOut; public static HGButton rotL; public static HGButton rotR; public static Toggle disableTurntable; public static tabletop turntable; public static void BuildUI() { //IL_0348: Unknown result type (might be due to invalid IL or missing references) //IL_034d: Unknown result type (might be due to invalid IL or missing references) //IL_0353: Expected O, but got Unknown //IL_03c0: Unknown result type (might be due to invalid IL or missing references) //IL_03ca: Expected O, but got Unknown //IL_043f: Unknown result type (might be due to invalid IL or missing references) //IL_0479: Unknown result type (might be due to invalid IL or missing references) //IL_0391: Unknown result type (might be due to invalid IL or missing references) //IL_0396: Unknown result type (might be due to invalid IL or missing references) //IL_039c: Expected O, but got Unknown //IL_0502: Unknown result type (might be due to invalid IL or missing references) //IL_0526: Unknown result type (might be due to invalid IL or missing references) //IL_057d: Unknown result type (might be due to invalid IL or missing references) //IL_0582: Unknown result type (might be due to invalid IL or missing references) //IL_0588: Expected O, but got Unknown //IL_05d0: Unknown result type (might be due to invalid IL or missing references) //IL_05d5: Unknown result type (might be due to invalid IL or missing references) //IL_05db: Expected O, but got Unknown //IL_0623: Unknown result type (might be due to invalid IL or missing references) //IL_0628: Unknown result type (might be due to invalid IL or missing references) //IL_062e: Expected O, but got Unknown //IL_0676: Unknown result type (might be due to invalid IL or missing references) //IL_067b: Unknown result type (might be due to invalid IL or missing references) //IL_0681: Expected O, but got Unknown GameObject gameObject = ((Component)window.transform.Find("MainPanel")).gameObject; hueSlider = ((Component)gameObject.transform.Find("HueSlider")).gameObject.GetComponent(); ((UnityEvent)(object)hueSlider.onValueChanged).AddListener((UnityAction)HueSliderListener); hueInputField = ((Component)gameObject.transform.Find("HueInputField")).gameObject.GetComponent(); ((UnityEvent)(object)hueInputField.onValueChanged).AddListener((UnityAction)HueInputFieldListener); hueSlider.value = hsv[0]; hueInputField.text = hsv[0].ToString(CultureInfo.InvariantCulture); satSlider = ((Component)gameObject.transform.Find("SatSlider")).gameObject.GetComponent(); ((UnityEvent)(object)satSlider.onValueChanged).AddListener((UnityAction)SatSliderListener); satInputField = ((Component)gameObject.transform.Find("SatInputField")).gameObject.GetComponent(); ((UnityEvent)(object)satInputField.onValueChanged).AddListener((UnityAction)SatInputFieldListener); satSlider.value = hsv[1]; satInputField.text = hsv[1].ToString(CultureInfo.InvariantCulture); valSlider = ((Component)gameObject.transform.Find("ValSlider")).gameObject.GetComponent(); ((UnityEvent)(object)valSlider.onValueChanged).AddListener((UnityAction)ValSliderListener); valInputField = ((Component)gameObject.transform.Find("ValInputField")).gameObject.GetComponent(); ((UnityEvent)(object)valInputField.onValueChanged).AddListener((UnityAction)ValInputFieldListener); valSlider.value = hsv[2]; valInputField.text = hsv[2].ToString(CultureInfo.InvariantCulture); useMulitplySat = ((Component)gameObject.transform.Find("SatMultiplyToggle")).gameObject.GetComponent(); ((UnityEvent)(object)useMulitplySat.onValueChanged).AddListener((UnityAction)UseMulitplySatToggleListener); useMulitplySat.isOn = multiplySat; skinName = ((Component)gameObject.transform.Find("SkinName")).gameObject.GetComponent(); ((UnityEvent)(object)skinName.onValueChanged).AddListener((UnityAction)SkinNameInputFieldListener); skinName.text = newSkinName; applySkin = ((Component)gameObject.transform.Find("ApplySkin")).gameObject.GetComponent(); ButtonClickedEvent onClick = ((Button)applySkin).onClick; object obj = <>O.<8>__ApplySkinHGButtonListner; if (obj == null) { UnityAction val = ApplySkinHGButtonListner; <>O.<8>__ApplySkinHGButtonListner = val; obj = (object)val; } ((UnityEvent)onClick).AddListener((UnityAction)obj); createSkin = ((Component)gameObject.transform.Find("CreateSkin")).gameObject.GetComponent(); ButtonClickedEvent onClick2 = ((Button)createSkin).onClick; object obj2 = <>O.<9>__CreateSkinHGButtonListner; if (obj2 == null) { UnityAction val2 = CreateSkinHGButtonListner; <>O.<9>__CreateSkinHGButtonListner = val2; obj2 = (object)val2; } ((UnityEvent)onClick2).AddListener((UnityAction)obj2); currentBody = PlayerCharacterMasterController.instances[0].master.GetBody(); cameraObject = new GameObject("Temp Camera"); cameraObject.transform.SetParent(window.transform); Camera obj3 = cameraObject.AddComponent(); Log.Debug($"radius = {currentBody.radius}", 373); cameraObject.transform.position = new Vector3(0f, currentBody.radius * 2f, currentBody.radius * -4f); cameraObject.layer = (int)(ref LayerIndex.ragdoll); obj3.clearFlags = (CameraClearFlags)2; obj3.backgroundColor = new Color(0f, 0f, 0f, 0f); obj3.cullingMask = (int)(ref LayerIndex.ragdoll); obj3.targetTexture = butterscotchnroses.bnrBundle.LoadAsset("TestRenderTexture"); GameObject obj4 = Object.Instantiate(((Component)currentBody.modelLocator.modelTransform).gameObject); AimAnimator val3 = default(AimAnimator); if (obj4.TryGetComponent(ref val3)) { val3.inputBank = null; val3.directionComponent = null; } obj4.transform.SetParent(window.transform); obj4.transform.position = new Vector3(0f, 0f, 0f); obj4.transform.rotation = new Quaternion(0f, 180f, 0f, 0f); turntable = obj4.AddComponent(); zoomIn = ((Component)gameObject.transform.Find("Preview").Find("ZoomIn")).gameObject.GetComponent(); ButtonClickedEvent onClick3 = ((Button)zoomIn).onClick; object obj5 = <>O.<10>__ZoomInHGButtonListner; if (obj5 == null) { UnityAction val4 = ZoomInHGButtonListner; <>O.<10>__ZoomInHGButtonListner = val4; obj5 = (object)val4; } ((UnityEvent)onClick3).AddListener((UnityAction)obj5); zoomOut = ((Component)gameObject.transform.Find("Preview").Find("ZoomOut")).gameObject.GetComponent(); ButtonClickedEvent onClick4 = ((Button)zoomOut).onClick; object obj6 = <>O.<11>__ZoomOutHGButtonListner; if (obj6 == null) { UnityAction val5 = ZoomOutHGButtonListner; <>O.<11>__ZoomOutHGButtonListner = val5; obj6 = (object)val5; } ((UnityEvent)onClick4).AddListener((UnityAction)obj6); rotL = ((Component)gameObject.transform.Find("Preview").Find("RotL")).gameObject.GetComponent(); ButtonClickedEvent onClick5 = ((Button)rotL).onClick; object obj7 = <>O.<12>__RotLHGButtonListner; if (obj7 == null) { UnityAction val6 = RotLHGButtonListner; <>O.<12>__RotLHGButtonListner = val6; obj7 = (object)val6; } ((UnityEvent)onClick5).AddListener((UnityAction)obj7); rotR = ((Component)gameObject.transform.Find("Preview").Find("RotR")).gameObject.GetComponent(); ButtonClickedEvent onClick6 = ((Button)rotR).onClick; object obj8 = <>O.<13>__RotRHGButtonListner; if (obj8 == null) { UnityAction val7 = RotRHGButtonListner; <>O.<13>__RotRHGButtonListner = val7; obj8 = (object)val7; } ((UnityEvent)onClick6).AddListener((UnityAction)obj8); disableTurntable = ((Component)gameObject.transform.Find("Preview").Find("DisableTurntable")).gameObject.GetComponent(); ((UnityEvent)(object)disableTurntable.onValueChanged).AddListener((UnityAction)DisableTurntableHGButtonListner); } private static void DisableTurntableHGButtonListner(bool isDisabled) { turntable.isDisabled = !isDisabled; } private static void RotLHGButtonListner() { turntable.Rotate(20f); } private static void RotRHGButtonListner() { turntable.Rotate(-20f); } private static void ZoomInHGButtonListner() { //IL_0014: 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_003c: 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) cameraObject.transform.position = new Vector3(cameraObject.transform.position.x, cameraObject.transform.position.y, cameraObject.transform.position.z + 1f); } private static void ZoomOutHGButtonListner() { //IL_0014: 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_003c: 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) cameraObject.transform.position = new Vector3(cameraObject.transform.position.x, cameraObject.transform.position.y, cameraObject.transform.position.z - 1f); } private static void CreateSkinHGButtonListner() { string text = ((!string.IsNullOrEmpty(newSkinName)) ? newSkinName : "Generated Skin"); ConfigEntry skinRecolors = skinrecolors.skinRecolors; string value = skinRecolors.Value; object[] obj = new object[7] { ((Object)baseSkinName).name, null, null, null, null, null, null }; string name = ((Object)currentBody).name; obj[1] = name.Substring(0, name.Length - 7); obj[2] = hsv[0]; obj[3] = hsv[1]; obj[4] = hsv[2]; obj[5] = text; obj[6] = multiplySat; skinRecolors.Value = value + string.Format(";;{0},{1},{2},{3},{4},{5},{6}", obj); object[] obj2 = new object[7] { ((Object)baseSkinName).name, null, null, null, null, null, null }; name = ((Object)currentBody).name; obj2[1] = name.Substring(0, name.Length - 7); obj2[2] = hsv[0]; obj2[3] = hsv[1]; obj2[4] = hsv[2]; obj2[5] = text; obj2[6] = multiplySat; Log.Debug(string.Format("added ;;{0},{1},{2},{3},{4},{5},{6} to the config !!! restart your game to see it in lobby .,,.", obj2), 456); } private static void ApplySkinHGButtonListner() { ModelSkinController modelLocator = Utils.GetModelLocator(((Component)currentBody).gameObject); int num = modelLocator.currentSkinIndex; if (commands.bodyNameToPrev.TryGetValue(((Object)currentBody).name, out var value)) { num = value; } else { commands.bodyNameToPrev.Add(((Object)currentBody).name, modelLocator.currentSkinIndex); } baseSkinName = modelLocator.skins[num]; Log.Debug($"baseskin set to {modelLocator.currentSkinIndex}", 474); Log.Debug("currentBody set to " + ((Object)currentBody).name, 475); Log.Debug($"hsv[0] set to {hsv[0]}", 476); Log.Debug($"hsv[1] set to {hsv[1]}", 477); Log.Debug($"hsv[2] set to {hsv[2]}", 478); Log.Debug("newSkinName set to " + newSkinName, 479); Log.Debug($"multiplySat set to {multiplySat}", 480); SkinDef val = skinRecolor(((Object)baseSkin).name, ((Object)currentBody).name, hsv[0], hsv[1], hsv[2], (newSkinName == "") ? "Generated Skin" : newSkinName, "", dontAdd: true, multiplySat); Array.Resize(ref modelLocator.skins, modelLocator.skins.Length + 1); modelLocator.skins[^1] = val; modelLocator.currentSkinIndex = modelLocator.skins.Length - 1; currentBody.skinIndex = (uint)(modelLocator.skins.Length - 1); modelLocator.ApplySkin(modelLocator.currentSkinIndex); Array.Resize(ref modelLocator.skins, modelLocator.skins.Length - 1); } private static void UseMulitplySatToggleListener(bool isOn) { multiplySat = isOn; } private static void SkinNameInputFieldListener(string skinNameNew) { newSkinName = skinNameNew; } private static void HueInputFieldListener(string hueString) { Log.Debug("hue input field = " + hueString, 508); if (int.TryParse(hueString, out var result) && !Mathf.Approximately((float)result, hueSlider.value)) { hueSlider.value = result; hsv[0] = result; } } private static void HueSliderListener(float hueFloat) { Log.Debug($"hue = {hueFloat}", 518); if (!int.TryParse(hueInputField.text, out var _) || (int.TryParse(hueInputField.text, out var result2) && !Mathf.Approximately((float)result2, hueFloat))) { hueInputField.text = hueFloat.ToString(CultureInfo.InvariantCulture); hsv[0] = hueFloat; } } private static void SatInputFieldListener(string satString) { Log.Debug("sat input field = " + satString, 528); if (int.TryParse(satString, out var result) && !Mathf.Approximately((float)result, satSlider.value)) { satSlider.value = result; hsv[1] = result; } } private static void SatSliderListener(float satFloat) { Log.Debug($"sat = {satFloat}", 538); if (!int.TryParse(satInputField.text, out var _) || (int.TryParse(satInputField.text, out var result2) && !Mathf.Approximately((float)result2, satFloat))) { satInputField.text = satFloat.ToString(CultureInfo.InvariantCulture); hsv[1] = satFloat; } } private static void ValInputFieldListener(string valString) { Log.Debug("val input field = " + valString, 548); if (int.TryParse(valString, out var result) && !Mathf.Approximately((float)result, valSlider.value)) { valSlider.value = result; hsv[2] = result; } } private static void ValSliderListener(float valFloat) { Log.Debug($"val = {valFloat}", 558); if (!int.TryParse(valInputField.text, out var _) || (int.TryParse(valInputField.text, out var result2) && !Mathf.Approximately((float)result2, valFloat))) { valInputField.text = valFloat.ToString(CultureInfo.InvariantCulture); hsv[2] = valFloat; } } } public class evilcomponnet : MonoBehaviour { public void Update() { EventSystem val = (EventSystem)(object)MPEventSystemManager.FindEventSystem(ReInput.players.GetPlayer(0)); if (Object.op_Implicit((Object)(object)val) && !((Object)(object)val.currentSelectedGameObject != (Object)(object)window.gameObject)) { val.SetSelectedGameObject(window.gameObject); } } } public enum fileTypes { png, jpg, tga } public static SkinDef baseSkinName; public static bool multiplySat; public static string newSkinName; public static CharacterBody currentBody; public static float[] hsv = new float[3]; public static string textureDirs; public static SkinDef baseSkin; public static Dictionary recoloredTextures = new Dictionary(); public static GameObject window; public static ConfigEntry fileType; public static ConfigEntry skinRecolors; private static ConfigEntry enabled; public override void Init() { //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) textureDirs = Path.Combine(Path.GetDirectoryName(Paths.BepInExConfigPath), "skintextures"); if (!Directory.Exists(textureDirs)) { Directory.CreateDirectory(textureDirs); } baseSkin = Addressables.LoadAssetAsync((object)RoR2_Base_Commando.skinCommandoDefault_asset).WaitForCompletion(); applyHooks(); GameObject obj = PrefabAPI.CreateEmptyPrefab("skinloadercoroutines"); obj.AddComponent(); Object.Instantiate(obj); } private static IEnumerator LoadTextures() { float totalTime = 0f; string[] files = Directory.GetFiles(textureDirs, "*.*", SearchOption.AllDirectories); string[] array = files; foreach (string text in array) { Stopwatch stopwatch = new Stopwatch(); stopwatch.Start(); byte[] array2 = File.ReadAllBytes(text); Texture2D val = new Texture2D(2, 2); ImageConversion.LoadImage(val, array2); Log.Debug(string.Format("loaded {0} in {1}ms !! adding to recoloredTextures ,.,.", text.Split("\\")[^1], stopwatch.ElapsedMilliseconds), 87); recoloredTextures.Add(text.Split("\\")[^1], val); totalTime += (float)stopwatch.ElapsedMilliseconds; yield return null; } Log.Info($"total time loading recolored skins ,.., {totalTime}ms"); } private void applyHooks() { //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Expected O, but got Unknown //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Expected O, but got Unknown //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Expected O, but got Unknown //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Expected O, but got Unknown if (enabled.Value) { SkinCatalog.Init += new hook_Init(SkinCatalogOnInit); Run.onRunStartGlobal += RunOnonRunStartGlobal; Stage.Start += new hook_Start(StageOnStart); } else { SkinCatalog.Init -= new hook_Init(SkinCatalogOnInit); Run.onRunStartGlobal -= RunOnonRunStartGlobal; Stage.Start -= new hook_Start(StageOnStart); } } private IEnumerator StageOnStart(orig_Start orig, Stage self) { commands.bodyNameToPrev.Clear(); yield return orig.Invoke(self); } private static void RunOnonRunStartGlobal(Run obj) { commands.bodyNameToPrev.Clear(); } private IEnumerator SkinCatalogOnInit(orig_Init orig) { Stopwatch stopwatch = Stopwatch.StartNew(); stopwatch.Start(); RecolorSkins(); Log.Debug(string.Format("recolored {0} skins in {1}ms !!!", skinRecolors.Value.Split(";;").Length, stopwatch.ElapsedMilliseconds), 131); yield return orig.Invoke(); } private static void RecolorSkins() { if (skinRecolors.Value.Length == 0) { return; } string[] array = skinRecolors.Value.Split(";;"); foreach (string text in array) { try { string[] array2 = text.Split(","); skinRecolor(array2[0], array2[1], float.Parse(array2[2]), float.Parse(array2[3]), float.Parse(array2[4]), array2[5], (array2.Length == 7) ? array2[6] : "", array2.Length == 8 && bool.Parse(array2[7])); } catch (Exception data) { Log.Warning("error while parsing config !!"); Log.Warning(data); } } } public static SkinDef skinRecolor(string baseSkinDefName, string bodyName, float hue, float saturation, float value, string skinName, string prefix = "", bool dontAdd = false, bool multiplySaturation = false) { //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_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Expected O, but got Unknown //IL_00d5: 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_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_0274: Unknown result type (might be due to invalid IL or missing references) //IL_0279: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01d0: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: Unknown result type (might be due to invalid IL or missing references) //IL_020b: Unknown result type (might be due to invalid IL or missing references) //IL_020d: Unknown result type (might be due to invalid IL or missing references) //IL_02d4: Unknown result type (might be due to invalid IL or missing references) //IL_02d9: Unknown result type (might be due to invalid IL or missing references) SkinDef result = baseSkin; try { ModelSkinController modelLocator = Utils.GetModelLocator(BodyCatalog.FindBodyPrefab(bodyName)); if ((Object)(object)modelLocator == (Object)null) { return result; } SkinDef val = null; SkinDef[] skins = modelLocator.skins; foreach (SkinDef val2 in skins) { if (!(((Object)val2).name != baseSkinDefName)) { val = val2; break; } } if ((Object)(object)val == (Object)null) { return result; } SkinDef val3 = Object.Instantiate(val); Texture2D obj = Utils.hsvModifyTexture(val3.icon.texture, hue, saturation / 100f, value / 100f, dontAdd); Rect textureRect = val3.icon.textureRect; int num = Mathf.FloorToInt(((Rect)(ref textureRect)).width); textureRect = val3.icon.textureRect; Texture2D val4 = new Texture2D(num, Mathf.FloorToInt(((Rect)(ref textureRect)).height)); textureRect = val3.icon.textureRect; int num2 = Mathf.FloorToInt(((Rect)(ref textureRect)).x); textureRect = val3.icon.textureRect; int num3 = Mathf.FloorToInt(((Rect)(ref textureRect)).y); textureRect = val3.icon.textureRect; int num4 = Mathf.FloorToInt(((Rect)(ref textureRect)).width); textureRect = val3.icon.textureRect; Color[] pixels = obj.GetPixels(num2, num3, num4, Mathf.FloorToInt(((Rect)(ref textureRect)).height)); val4.SetPixels(pixels); val4.Apply(); Sprite icon = Sprite.Create(val4, new Rect(0f, 0f, (float)((Texture)val4).width, (float)((Texture)val4).height), new Vector2((float)(((Texture)val4).width / 2), (float)(((Texture)val4).height / 2))); val3.icon = icon; if ((Object)(object)val3.skinDefParams == (Object)null && val3.skinDefParamsAddress == null) { RendererInfo[] array = (RendererInfo[])(object)new RendererInfo[val3.rendererInfos.Length]; for (int j = 0; j < val3.rendererInfos.Length; j++) { RendererInfo val5 = val3.rendererInfos[j]; Material mat = Object.Instantiate(val5.defaultMaterial); val5.defaultMaterial = Utils.RecolorMaterial(mat, hue, saturation, value, dontAdd, multiplySaturation); val5.defaultMaterialAddress = new AssetReferenceT(""); array[j] = val5; } val3.rendererInfos = array; } else { SkinDefParams val6 = Object.Instantiate((val3.skinDefParamsAddress != null && ((object)val3.skinDefParamsAddress).ToString() != "[]") ? val3.skinDefParamsAddress.LoadAssetAsync().WaitForCompletion() : (((Object)(object)val3.skinDefParams == (Object)null) ? SkinDefParams.FromSkinDef(val) : val3.skinDefParams)); for (int k = 0; k < val6.rendererInfos.Length; k++) { Material val7 = Object.Instantiate(((Object)(object)val6.rendererInfos[k].defaultMaterial == (Object)null) ? val6.rendererInfos[k].defaultMaterialAddress.LoadAssetAsync().WaitForCompletion() : val6.rendererInfos[k].defaultMaterial); Log.Debug("new mat name = " + ((Object)val7).name, 224); val6.rendererInfos[k].defaultMaterial = Utils.RecolorMaterial(val7, hue, saturation, value, dontAdd, multiplySaturation); val6.rendererInfos[k].defaultMaterialAddress = new AssetReferenceT(""); } val3.optimizedSkinDefParams = val6; val3.skinDefParams = val6; val3.skinDefParamsAddress = new AssetReferenceT(""); } string text = skinName.Replace(" ", ""); ((Object)val3).name = ((Object)val3).name.Replace("(Clone)", ""); ((Object)val3).name = ((Object)val3).name + "Recolored" + text; ((Object)val3).name = prefix + ((Object)val3).name; val3.nameToken = val3.nameToken + "_BNR_" + text.ToUpper(); LanguageAPI.Add(val3.nameToken, skinName); if (!dontAdd) { Array.Resize(ref modelLocator.skins, modelLocator.skins.Length + 1); modelLocator.skins[^1] = val3; } Log.Debug("added " + skinName + " to " + bodyName + " !!!!", 246); result = val3; } catch (Exception data) { Log.Warning("faileds to add " + skinName + " skin to " + bodyName + " ,.,.,."); Log.Error(data); } return result; } public override void Update() { //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0062: 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_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: 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_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_0188: 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) CheckConsoleKey(); if (Object.op_Implicit((Object)(object)window)) { if (Input.GetKey((KeyCode)273)) { skinrecolorui.cameraObject.transform.position = new Vector3(skinrecolorui.cameraObject.transform.position.x, skinrecolorui.cameraObject.transform.position.y + 0.04f, skinrecolorui.cameraObject.transform.position.z); } if (Input.GetKey((KeyCode)274)) { skinrecolorui.cameraObject.transform.position = new Vector3(skinrecolorui.cameraObject.transform.position.x, skinrecolorui.cameraObject.transform.position.y - 0.04f, skinrecolorui.cameraObject.transform.position.z); } if (Input.GetKey((KeyCode)276)) { skinrecolorui.cameraObject.transform.position = new Vector3(skinrecolorui.cameraObject.transform.position.x - 0.04f, skinrecolorui.cameraObject.transform.position.y, skinrecolorui.cameraObject.transform.position.z); } if (Input.GetKey((KeyCode)275)) { skinrecolorui.cameraObject.transform.position = new Vector3(skinrecolorui.cameraObject.transform.position.x + 0.04f, skinrecolorui.cameraObject.transform.position.y, skinrecolorui.cameraObject.transform.position.z); } } } private static void CheckConsoleKey() { } public override void Config(ConfigFile config) { enabled = config.Bind("BNR - skinrecolors", "enable patches for skinrecolors", true, ""); Utils.CheckboxConfig(enabled); enabled.SettingChanged += delegate { applyHooks(); }; skinRecolors = config.Bind("BNR - skinrecolors", "skin recolors", "", "follows \"string baseSkinDefName, string bodyName, float hue, float saturation, float value, string skinName, string prefix\" where prefix is optional (used for like ,., Red on wolfo qol merc.,., use list_skins to get internal names or prodz debugging mod ,., split with ;; ..,,. you can temporarily try out recolors with recolor_skin hue saturation value ,.,,."); fileType = config.Bind("BNR - skinrecolors", "file type", fileTypes.png, "follows \"string baseSkinDefName, string bodyName, float hue, float saturation, float value, string skinName, string prefix\" where prefix is optional (used for like ,., Red on wolfo qol merc.,., use list_skins to get internal names or prodz debugging mod ,., split with ;; ..,,. you can temporarily try out recolors with recolor_skin hue saturation value ,.,,."); } } public class smallermoneyandlunars : PatchBase { private ConfigEntry enabled; public override void Init() { if (enabled.Value) { HUD.onHudTargetChangedGlobal += HUDOnonHudTargetChangedGlobal; } } private static void HUDOnonHudTargetChangedGlobal(HUD obj) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) GameObject val = GameObject.Find("UpperLeftCluster"); if (Object.op_Implicit((Object)(object)val)) { val.GetComponent().offsetMin = new Vector2(0f, -64f); ((HorizontalOrVerticalLayoutGroup)val.GetComponent()).spacing = 0f; GameObject val2 = GameObject.Find("DollarSign"); if (Object.op_Implicit((Object)(object)val2)) { val2.transform.localPosition = new Vector3(4f, val2.transform.localPosition.y, val2.transform.localPosition.z); } GameObject val3 = GameObject.Find("SteamBuildLabel"); if (Object.op_Implicit((Object)(object)val3)) { val3.gameObject.SetActive(false); } } } public override void Config(ConfigFile config) { enabled = config.Bind("BNR - UI", "make currency thing smaller", true, "make the thing that has coins and lunar coins in the top left smaller like pre sotv (i miss you ,.,."); Utils.CheckboxConfig(enabled); enabled.SettingChanged += delegate { if (enabled.Value) { HUD.onHudTargetChangedGlobal += HUDOnonHudTargetChangedGlobal; } else { HUD.onHudTargetChangedGlobal -= HUDOnonHudTargetChangedGlobal; } }; } } public class teamhealthcolor : PatchBase { public static Color defaultHealthColor; public static Color playerHealthColor; public static Dictionary> teamDefColors = new Dictionary>(); private ConfigEntry enabled; public override void Init() { applyHooks(); } private void applyHooks() { //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Expected O, but got Unknown //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_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: 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_00a3: Expected O, but got Unknown if (enabled.Value) { AsyncOperationHandle val = Addressables.LoadAssetAsync((object)"RoR2/Base/Common/CombatHealthBar.asset"); val.Completed += delegate(AsyncOperationHandle 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) defaultHealthColor = handle.Result.trailingOverHealthBarStyle.baseColor; }; val = Addressables.LoadAssetAsync((object)"RoR2/Base/Common/HUDHealthBar.asset"); val.Completed += delegate(AsyncOperationHandle 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) playerHealthColor = handle.Result.trailingOverHealthBarStyle.baseColor; }; RoR2Application.onLoad = (Action)Delegate.Combine(RoR2Application.onLoad, new Action(OnLoad)); HealthBar.UpdateBarInfos += new hook_UpdateBarInfos(HealthBarOnUpdateBarInfos); } else { RoR2Application.onLoad = (Action)Delegate.Remove(RoR2Application.onLoad, new Action(OnLoad)); HealthBar.UpdateBarInfos -= new hook_UpdateBarInfos(HealthBarOnUpdateBarInfos); } } private void OnLoad() { //IL_0023: 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_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Expected O, but got Unknown //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) TeamDef[] teamDefs = TeamCatalog.teamDefs; foreach (TeamDef val in teamDefs) { Log.Debug($"adding team {val}", 51); Color val2 = defaultHealthColor; if (TeamCatalog.GetTeamDef((TeamIndex)1) == val) { val2 = playerHealthColor; } ConfigEntry obj = ((BaseUnityPlugin)butterscotchnroses.instance).Config.Bind("BNR - teamhealthcolor", "enable team " + val.nameToken.Replace("TEAM_", "").Replace("_NAME", "").ToLower(), true, ""); Utils.CheckboxConfig(obj, restartRequired: true); ConfigEntry val3 = ((BaseUnityPlugin)butterscotchnroses.instance).Config.Bind("BNR - teamhealthcolor", "health bar color for team " + val.nameToken.Replace("TEAM_", "").Replace("_NAME", "").ToLower(), val2, ""); ModSettingsManager.AddOption((BaseOption)new ColorOption(val3)); if (obj.Value) { teamDefColors.Add(val, val3); } } } private void HealthBarOnUpdateBarInfos(orig_UpdateBarInfos orig, HealthBar self) { //IL_0022: 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_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_0079: 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) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self); HealthComponent source = self._source; if (Object.op_Implicit((Object)(object)source) && (!(self.barInfoCollection.trailingOverHealthbarInfo.color != defaultHealthColor) || !(self.barInfoCollection.trailingOverHealthbarInfo.color != playerHealthColor))) { CharacterBody body = source.body; TeamIndex? obj; if (body == null) { obj = null; } else { TeamComponent teamComponent = body.teamComponent; obj = ((teamComponent != null) ? new TeamIndex?(teamComponent.teamIndex) : ((TeamIndex?)null)); } TeamDef teamDef = TeamCatalog.GetTeamDef((TeamIndex)(((??)obj) ?? (-1))); if (teamDef != null && teamDefColors.TryGetValue(teamDef, out var value)) { self.barInfoCollection.trailingOverHealthbarInfo.color = value.Value; } } } public override void Config(ConfigFile config) { enabled = config.Bind("BNR - teamhealthcolor", "enable patches for teamhealthcolor", true, ""); Utils.CheckboxConfig(enabled); enabled.SettingChanged += delegate { applyHooks(); }; } } public class testsceneskybox : PatchBase { private static Material skyboxMaterial; private static ConfigEntry skyboxColor; private ConfigEntry enabled; public override void Init() { applyHooks(); } 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) { Stage.Start += new hook_Start(StageOnStart); } else { Stage.Start += new hook_Start(StageOnStart); } } private IEnumerator StageOnStart(orig_Start orig, Stage self) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: 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) Scene activeScene = SceneManager.GetActiveScene(); if (((Scene)(ref activeScene)).name == "testscene") { if ((Object)(object)skyboxMaterial == (Object)null) { skyboxMaterial = Object.Instantiate(RenderSettings.skybox); skyboxMaterial.SetColor("_Tint", skyboxColor.Value); } RenderSettings.skybox = skyboxMaterial; } return orig.Invoke(self); } private void SceneDirectorOnStart(orig_Start orig, SceneDirector self) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: 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_002f: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self); Scene activeScene = SceneManager.GetActiveScene(); if (((Scene)(ref activeScene)).name == "testscene") { Material skybox = RenderSettings.skybox; activeScene = SceneManager.GetActiveScene(); Log.Debug($"new scene !! {skybox} {((Scene)(ref activeScene)).name}", 60); if ((Object)(object)skyboxMaterial == (Object)null) { skyboxMaterial = Object.Instantiate(RenderSettings.skybox); skyboxMaterial.SetColor("_Tint", skyboxColor.Value); } RenderSettings.skybox = skyboxMaterial; } } public override void Config(ConfigFile config) { //IL_005b: 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) //IL_007e: Expected O, but got Unknown enabled = config.Bind("BNR - testscene", "enable patches for testscene", true, ""); Utils.CheckboxConfig(enabled); enabled.SettingChanged += delegate { applyHooks(); }; skyboxColor = config.Bind("BNR - testscene", "skyboxColor", Utils.Color255(152, 122, 144), "tint of skybox in testscene !!!"); ModSettingsManager.AddOption((BaseOption)new ColorOption(skyboxColor)); } } public class ukulelepronouns : PatchBase { private Dictionary pronouns = new Dictionary { { " she ", "her" }, { " it ", "its" }, { " they ", "their" } }; private ConfigEntry pronounOverrides; private ConfigEntry descriptionOverride; private ConfigEntry enabled; public override void Init() { applyHooks(); } private void applyHooks() { //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Expected O, but got Unknown //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0063: 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 //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Expected O, but got Unknown if (enabled.Value) { GenericNotification.SetItem += new hook_SetItem(GenericNotificationOnSetItem); ItemIcon.SetItemIndex_ItemIndex_int_float += new hook_SetItemIndex_ItemIndex_int_float(ItemIconOnSetItemIndex_ItemIndex_int_float); HUD.ActivateScoreboard += new hook_ActivateScoreboard(HUDOnActivateScoreboard); } else { GenericNotification.SetItem -= new hook_SetItem(GenericNotificationOnSetItem); ItemIcon.SetItemIndex_ItemIndex_int_float -= new hook_SetItemIndex_ItemIndex_int_float(ItemIconOnSetItemIndex_ItemIndex_int_float); } } private void HUDOnActivateScoreboard(orig_ActivateScoreboard orig, HUD self) { //IL_0031: 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_0066: 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) orig.Invoke(self); if (!descriptionOverride.Value) { return; } using List.Enumerator enumerator = self.itemInventoryDisplay.itemIcons.GetEnumerator(); if (enumerator.MoveNext()) { ItemIcon current = enumerator.Current; if (current.itemIndex == Items.ChainLightning.itemIndex) { current.tooltipProvider.overrideBodyText = Genderify(self.itemInventoryDisplay._characterBody, current.tooltipProvider.overrideBodyText.Replace(Language.GetString(ItemCatalog.GetItemDef(Items.ChainLightning.itemIndex).descriptionToken), Language.GetString(ItemCatalog.GetItemDef(Items.ChainLightning.itemIndex).pickupToken))); } } } 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_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0012: 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_0085: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self, newitemindex, newitemcount, newdurationpercent); if (ItemCatalog.GetItemDef(newitemindex).itemIndex != Items.ChainLightning.itemIndex) { return; } GameObject gameObject = ((Component)((Component)self).transform.GetParent()).gameObject; string name = ((Object)gameObject).name; if ((!(name == "ItemInventoryDisplay") && !(name == "ItemsBackground")) || 1 == 0) { return; } CharacterBody val = gameObject.GetComponent()?._characterBody; if (!((Object)(object)val == (Object)null)) { self.tooltipProvider.bodyToken = Genderify(val, Language.GetString(ItemCatalog.GetItemDef(newitemindex).pickupToken)); if (descriptionOverride.Value && self.tooltipProvider.overrideBodyText != "") { self.tooltipProvider.overrideBodyText = Genderify(val, self.tooltipProvider.overrideBodyText.Replace(Language.GetString(ItemCatalog.GetItemDef(newitemindex).descriptionToken), Language.GetString(ItemCatalog.GetItemDef(newitemindex).pickupToken))); } } } private void GenericNotificationOnSetItem(orig_SetItem orig, GenericNotification self, ItemDef itemdef) { //IL_0009: 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) orig.Invoke(self, itemdef); if (itemdef.itemIndex != Items.ChainLightning.itemIndex) { return; } LocalUser firstLocalUser = LocalUserManager.GetFirstLocalUser(); CharacterBody val = ((firstLocalUser != null) ? firstLocalUser.cachedBody : null); if (!((Object)(object)val == (Object)null)) { if (descriptionOverride.Value) { self.descriptionText.token = Genderify(val, Language.GetString(itemdef.pickupToken)); } else { self.OverrideDescription(Genderify(val, Language.GetString(itemdef.pickupToken))); } } } private string Genderify(CharacterBody body, string pickupText) { //IL_006e: 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_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Invalid comparison between Unknown and I4 //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) string[] array = pronounOverrides.Value.Split(';'); foreach (string text in array) { if (!(text.Split(",")[0] != ((Object)body).name.Replace("(Clone)", ""))) { return pickupText.Replace("his", text.Split(",")[1]); } } SurvivorIndex survivorIndexFromBodyIndex = SurvivorCatalog.GetSurvivorIndexFromBodyIndex(body.bodyIndex); if ((int)survivorIndexFromBodyIndex == -1 || (Object)(object)SurvivorCatalog.GetSurvivorDef(survivorIndexFromBodyIndex) == (Object)null) { return pickupText; } string text2 = Language.GetString(SurvivorCatalog.GetSurvivorDef(survivorIndexFromBodyIndex).outroFlavorToken); Log.Debug("ending string " + text2, 104); foreach (string key in pronouns.Keys) { if (text2.Contains(key)) { return pickupText.Replace("his", pronouns[key]); } } return pickupText; } public override void Config(ConfigFile config) { enabled = config.Bind("BNR - ukulelepronouns", "enable patches for ukulelepronouns", true, ""); Utils.CheckboxConfig(enabled); enabled.SettingChanged += delegate { applyHooks(); }; pronounOverrides = config.Bind("BNR - ukulelepronouns", "custom overrides", "", "example - CommandoBody,their;RailgunnerBody,their"); Utils.StringConfig(pronounOverrides); descriptionOverride = config.Bind("BNR - ukulelepronouns", "whether to override hover text entirely", false, "should make it compatible with mods like looking glass without having to disable description text for everything there ,..,"); Utils.CheckboxConfig(descriptionOverride); } } public class whodiddamage : PatchBase { private class DamageCredit(float damage, float minionDamage, CharacterMaster master) { public float damage = damage; public float minionDamage = minionDamage; public CharacterMaster master = master; } private static Texture CrownIcon; private static List crownImages = new List(); private Dictionary> bossGroupsToDamages = new Dictionary>(); private Dictionary mastersTotalDamage = new Dictionary(); private ConfigEntry enabled; private ConfigEntry useCrown; private ConfigEntry crownColorBasedOffBody; private ConfigEntry onlyInMultiplayer; private ConfigEntry crownColorOverrides; public override void Init() { CrownIcon = butterscotchnroses.bnrBundle.LoadAsset("texCrownIcon"); applyHooks(); } private void applyHooks() { //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Expected O, but got Unknown //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Expected O, but got Unknown if (enabled.Value) { BossGroup.onBossGroupStartServer += StartTracking; BossGroup.onBossGroupDefeatedServer += PrintDamage; Stage.onStageStartGlobal += StageOnonStageStartGlobal; AllyCardController.InfoOverride += new hook_InfoOverride(AllyCardControllerOnInfoOverride); } else { BossGroup.onBossGroupStartServer -= StartTracking; BossGroup.onBossGroupDefeatedServer -= PrintDamage; Stage.onStageStartGlobal -= StageOnonStageStartGlobal; AllyCardController.InfoOverride -= new hook_InfoOverride(AllyCardControllerOnInfoOverride); } } public static Color GetHex(string hex) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) if (!hex.StartsWith("#")) { hex = "#" + hex; } Color result = default(Color); ColorUtility.TryParseHtmlString(hex, ref result); return result; } private void AllyCardControllerOnInfoOverride(orig_InfoOverride orig, AllyCardController self) { //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Expected O, but got Unknown //IL_009e: 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_022a: Unknown result type (might be due to invalid IL or missing references) //IL_023e: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_012a: 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) orig.Invoke(self); if (!useCrown.Value || butterscotchnroses.clientSide.Value) { return; } Transform obj = ((Component)self.portraitIconImage).transform.Find("crown"); GameObject val = ((obj != null) ? ((Component)obj).gameObject : null); bool flag = self.sourceMaster.inventory.GetItemCountEffective(ItemBase.instance.ItemDef) > 0; if (Object.op_Implicit((Object)(object)val) && !flag) { Object.Destroy((Object)(object)val); } else { if (!flag) { return; } GameObject val2 = new GameObject("crown"); val2.transform.parent = ((Component)self.portraitIconImage).transform; val2.transform.localPosition = Vector3.zero; RawImage val3 = val2.AddComponent(); val3.texture = CrownIcon; if (crownColorBasedOffBody.Value) { ((Graphic)val3).color = self.sourceMaster.bodyPrefab.GetComponent().bodyColor; } if (crownColorOverrides.Value != "") { CharacterMaster sourceMaster = self.sourceMaster; object obj2; if (sourceMaster == null) { obj2 = null; } else { PlayerCharacterMasterController playerCharacterMasterController = sourceMaster.playerCharacterMasterController; if (playerCharacterMasterController == null) { obj2 = null; } else { NetworkUser networkUser = playerCharacterMasterController.networkUser; if (networkUser == null) { obj2 = null; } else { NetworkUserId id = networkUser.id; PlatformID steamId = ((NetworkUserId)(ref id)).steamId; obj2 = ((PlatformID)(ref steamId)).ToSteamID(); } } } string text = (string)obj2; if (text != null) { Log.Debug("target steamID: " + text.Split(':')[^1], 86); string[] array = crownColorOverrides.Value.Split(','); string[] array2 = array; foreach (string text2 in array2) { Log.Debug("config: " + text2.Split(':')[^1], 90); } for (int j = 0; j < array.Length; j += 2) { array[j] = array[j].Trim(); if (array[j].Split(':')[^1] == text.Split(':')[^1]) { ((Graphic)val3).color = GetHex(array[j + 1]); } } } } RectTransform component = val2.GetComponent(); ((Transform)component).localScale = new Vector3(0.2f, 0.2f, 0.2f); component.pivot = new Vector2(0.5f, -0.5f); crownImages.Add(val2); } } private void StageOnonStageStartGlobal(Stage stage) { bossGroupsToDamages = new Dictionary>(); mastersTotalDamage = new Dictionary(); GlobalEventManager.onServerDamageDealt -= GlobalEventManagerOnonServerDamageDealt; } private void PrintDamage(BossGroup bossGroup) { //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_01da: Expected O, but got Unknown //IL_038a: Unknown result type (might be due to invalid IL or missing references) //IL_038f: Unknown result type (might be due to invalid IL or missing references) //IL_03ce: Expected O, but got Unknown GlobalEventManager.onServerDamageDealt -= GlobalEventManagerOnonServerDamageDealt; if (!bossGroupsToDamages.TryGetValue(bossGroup, out var value) || (Run.instance.participatingPlayerCount == 1 && onlyInMultiplayer.Value)) { return; } List> list = value.ToList(); list.Sort((KeyValuePair kvp, KeyValuePair kvp2) => (kvp2.Value.damage + kvp2.Value.minionDamage).CompareTo(kvp.Value.damage + kvp.Value.minionDamage)); if (useCrown.Value && !butterscotchnroses.clientSide.Value) { foreach (CharacterMaster readOnlyInstances in CharacterMaster.readOnlyInstancesList) { if (readOnlyInstances != null) { Inventory inventory = readOnlyInstances.inventory; if (inventory != null) { inventory.RemoveItemPermanent(ItemBase.instance.ItemDef, 999); } } } foreach (GameObject crownImage in crownImages) { Object.DestroyImmediate((Object)(object)crownImage); } } bool flag = mastersTotalDamage.Count != 0; foreach (KeyValuePair item in list) { if (Object.op_Implicit((Object)(object)item.Key)) { string arg = TryGetName(item.Key); Chat.SendBroadcastChat((ChatMessageBase)new SimpleChatMessage { baseToken = $"{arg} dealt {item.Value.damage + item.Value.minionDamage:0} damage!" + ((item.Value.minionDamage != 0f) ? $" ({item.Value.damage:0} self, {item.Value.minionDamage:0} minion)" : "") + "" }); Log.Debug($"{arg} - {item.Value.damage:0} - {item.Value.minionDamage:0}", 149); if (mastersTotalDamage.TryGetValue(item.Key, out var _)) { mastersTotalDamage[item.Key] += item.Value.damage + item.Value.minionDamage; } else { mastersTotalDamage.Add(item.Key, item.Value.damage + item.Value.minionDamage); } } } List> list2 = mastersTotalDamage.ToList(); list2.Sort((KeyValuePair kvp, KeyValuePair kvp2) => kvp2.Value.CompareTo(kvp.Value)); if (useCrown.Value && !butterscotchnroses.clientSide.Value) { list2[0].Key.inventory.GiveItemPermanent(ItemBase.instance.ItemDef, 1); } foreach (HUD instances in HUD.instancesList) { foreach (AllyCardController element in instances.allyCardManager.cardAllocator.elements) { element.InfoOverride(); } } if (flag) { Chat.SendBroadcastChat((ChatMessageBase)new SimpleChatMessage { baseToken = $"{TryGetName(list2[0].Key)} is the highest stage damage dealer with {list2[0].Value:0} damage!" }); } } private static string TryGetName(CharacterMaster characterMaster) { if (Object.op_Implicit((Object)(object)characterMaster.playerCharacterMasterController)) { return characterMaster.playerCharacterMasterController.GetDisplayName(); } return Language.GetString(characterMaster.GetBody().baseNameToken ?? characterMaster.bodyPrefab.GetComponent().baseNameToken); } private void StartTracking(BossGroup bossGroup) { if (Run.instance.participatingPlayerCount != 1 || !onlyInMultiplayer.Value) { bossGroupsToDamages.Add(bossGroup, new Dictionary()); GlobalEventManager.onServerDamageDealt += GlobalEventManagerOnonServerDamageDealt; } } private void GlobalEventManagerOnonServerDamageDealt(DamageReport damageReport) { if (!Object.op_Implicit((Object)(object)damageReport.attackerMaster) || !damageReport.victimIsBoss) { return; } bool flag = true; KeyValuePair> keyValuePair = default(KeyValuePair>); foreach (KeyValuePair> bossGroupsToDamage in bossGroupsToDamages) { if (bossGroupsToDamage.Key.combatSquad.membersList.Contains(damageReport.victimMaster)) { flag = false; keyValuePair = bossGroupsToDamage; break; } } if (flag) { return; } DamageCredit value2; if (Object.op_Implicit((Object)(object)damageReport.attackerOwnerMaster)) { if (keyValuePair.Value.TryGetValue(damageReport.attackerOwnerMaster, out var value)) { value.minionDamage += damageReport.damageDealt; } else { keyValuePair.Value.Add(damageReport.attackerOwnerMaster, new DamageCredit(0f, damageReport.damageDealt, damageReport.attackerOwnerMaster)); } } else if (keyValuePair.Value.TryGetValue(damageReport.attackerMaster, out value2)) { value2.damage += damageReport.damageDealt; } else { keyValuePair.Value.Add(damageReport.attackerMaster, new DamageCredit(damageReport.damageDealt, 0f, damageReport.attackerOwnerMaster)); } } public override void Config(ConfigFile config) { enabled = config.Bind("BNR - whodiddamage", "enable patches for whodiddamage", true, ""); Utils.CheckboxConfig(enabled); useCrown = config.Bind("BNR - whodiddamage", "use crown icon", true, "adds a crown icon to the highest damage dealer on the scoreboard that persists going into the next stage"); Utils.CheckboxConfig(useCrown); crownColorBasedOffBody = config.Bind("BNR - whodiddamage", "base crown icon color off body color", true, "makes the crown use body color ,.,."); Utils.CheckboxConfig(crownColorBasedOffBody); crownColorOverrides = config.Bind("BNR - whodiddamage", "crown color overrides", "", "crown color overrides for specific players steamids, formatted \"STEAM_0:1:174533492,#F3D2F7\""); Utils.StringConfig(crownColorOverrides); onlyInMultiplayer = config.Bind("BNR - whodiddamage", "disable in singleplayer", true, "whether to only enable in multiplayer or not .,.,"); Utils.CheckboxConfig(onlyInMultiplayer); } } public class allynames : PatchBase { [HarmonyPatch] public class AllyNamesChanges { [HarmonyPatch(typeof(NamesList), "InitConfig")] [HarmonyPostfix] public static void OnEnterPostFix(NamesList __instance) { //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) string[] array = bodyNames.Value.Split('|'); foreach (string text in array) { if (string.IsNullOrEmpty(text)) { continue; } string[] array2 = text.Split(','); for (int j = 0; j < array2.Length; j++) { array2[j] = array2[j].Trim(); if (array2[j].EndsWith("Body")) { array2[j] = array2[j].Substring(0, array2[j].Length - 4); } } string text2 = ""; if (array2.Length >= 4) { text2 = array2[3].Trim().TrimStart('[').TrimEnd(']') .Replace(";", ","); } ConfigBodyIndex val = new ConfigBodyIndex(array2[0].Trim(), array2[1].Trim(), array2[2].Trim().TrimStart('[').TrimEnd(']') .Replace(";", ","), text2); ArrayUtils.ArrayAppend(ref NamesList.configBodyIndexes, ref val); } ConfigBodyIndex[] configBodyIndexes = NamesList.configBodyIndexes; for (int i = 0; i < configBodyIndexes.Length; i++) { _ = ref configBodyIndexes[i]; } } } public static ConfigEntry bodyNames; private ConfigEntry enabled; public override string chainLoaderKey => "SwagWizards.AllyNames"; public override void Init() { if (enabled.Value) { Log.Debug("applying allynames patches !!", 65); butterscotchnroses.harmony.CreateClassProcessor(typeof(AllyNamesChanges)).Patch(); NamesList.InitConfig(); NamesList.BuildNamesByBodyName(); AllyNames.instance.AddTokens(); } } public override void Config(ConfigFile config) { enabled = config.Bind("Mods - allynames", "enable patches for allynames", true, ""); Utils.CheckboxConfig(enabled); bodyNames = config.Bind("Mods - allynames", "ally name replace !!", "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|DTGunnerDrone,CROSSHAIRS,Default;Drones,Ruxin|DTHealingDrone,DOC,Default;Drones,Bunny|DTHaulerDrone,CHIRP,Default;Drones,Moose|FriendUnit,Best Buddy,Default,Friend Inside Me;Stupid Baby;Son|DroneBomber,Lt. Droneboy,Default,Lt. Beep Boop|_Turretling,turretling,Default,Chudling", "add custom !! use bodynamewithoutBody,realname,category1;category2,customname1;customname2|seconditem format to add custom names !!"); Utils.StringConfig(bodyNames); } } public class coolereclipse : PatchBase { [HarmonyPatch] public class CoolerEclipseChanges { [HarmonyPatch(typeof(CoolerEclipse), "AddSkybox")] [HarmonyPrefix] public static bool CoolerEclipseAddSkyboxPreFix(orig_Start orig, SceneDirector self) { //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) CoolerEclipse.shouldBeChance.Value = false; GameObject obj = GameObject.Find("eclipse handler(Clone)"); EclipseNetworkBehavior eclipseNetworkBehavior = default(EclipseNetworkBehavior); if (obj != null && obj.TryGetComponent(ref eclipseNetworkBehavior)) { int num = ((SyncList)(object)eclipseNetworkBehavior.eclipseRNGs)[Object.op_Implicit((Object)(object)Run.instance) ? Run.instance.stageClearCount : 0]; bool flag = ((SyncList)(object)eclipseNetworkBehavior.pinkEclipses)[Object.op_Implicit((Object)(object)Run.instance) ? Run.instance.stageClearCount : 0]; Log.Debug($"rng {num} pink {flag} run null {(Object)(object)Run.instance == (Object)null}", 53); Scene activeScene = SceneManager.GetActiveScene(); string name = ((Scene)(ref activeScene)).name; if (!Utility.IsNullOrWhiteSpace(whitelistStages.Value)) { string[] array = whitelistStages.Value.Split(","); foreach (string text in array) { if (name.Contains(text)) { Log.Debug(text + " is in whitelist !! forcing !!", 71); return true; } } } if (!Utility.IsNullOrWhiteSpace(blacklistStages.Value)) { string[] array = blacklistStages.Value.Split(","); foreach (string text2 in array) { if (name.Contains(text2)) { Log.Debug("name " + text2 + " is in config !! skipping !!", 82); orig.Invoke(self); return false; } } } Log.Debug($"test eclipse !! rng {num} < {eclipseChance.Value} ,,,.. applying ? {(float)num > eclipseChance.Value}", 88); if ((float)num > eclipseChance.Value) { orig.Invoke(self); return false; } return true; } Log.Debug("unable to find eclipse handler !! ", 57); orig.Invoke(self); return false; } [HarmonyPatch(typeof(CoolerEclipse), "AddSkybox")] [HarmonyPostfix] public static void CoolerEclipseAddSkyboxPostFix(orig_Start orig, SceneDirector self) { //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0125: 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_01ce: Unknown result type (might be due to invalid IL or missing references) //IL_01d3: Unknown result type (might be due to invalid IL or missing references) //IL_01eb: Unknown result type (might be due to invalid IL or missing references) //IL_01f0: Unknown result type (might be due to invalid IL or missing references) //IL_0205: Unknown result type (might be due to invalid IL or missing references) //IL_020a: Unknown result type (might be due to invalid IL or missing references) //IL_0246: 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_0250: Unknown result type (might be due to invalid IL or missing references) //IL_0263: Unknown result type (might be due to invalid IL or missing references) //IL_0268: Unknown result type (might be due to invalid IL or missing references) //IL_026d: Unknown result type (might be due to invalid IL or missing references) //IL_0282: Unknown result type (might be due to invalid IL or missing references) //IL_0287: Unknown result type (might be due to invalid IL or missing references) //IL_028c: 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_046f: Unknown result type (might be due to invalid IL or missing references) //IL_0497: Unknown result type (might be due to invalid IL or missing references) //IL_049c: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)GameObject.Find("Eclipse"))) { return; } GameObject obj = GameObject.Find("eclipse handler(Clone)"); EclipseNetworkBehavior eclipseNetworkBehavior = default(EclipseNetworkBehavior); if (obj != null && obj.TryGetComponent(ref eclipseNetworkBehavior)) { int num = ((SyncList)(object)eclipseNetworkBehavior.eclipseRNGs)[Object.op_Implicit((Object)(object)Run.instance) ? Run.instance.stageClearCount : 0]; bool flag = ((SyncList)(object)eclipseNetworkBehavior.pinkEclipses)[Object.op_Implicit((Object)(object)Run.instance) ? Run.instance.stageClearCount : 0]; Log.Debug($"rng {num} pink {flag} run null {(Object)(object)Run.instance == (Object)null}", 110); GameObject val = GameObject.Find("PP + Amb"); PostProcessVolume val2 = default(PostProcessVolume); if (val.TryGetComponent(ref val2)) { RampFog setting = val2.sharedProfile.GetSetting(); ((ParameterOverride)(object)setting.fogColorStart).value = Color32.op_Implicit(new Color32((byte)55, (byte)87, (byte)82, (byte)15)); ((ParameterOverride)(object)setting.fogColorMid).value = Color32.op_Implicit(new Color32((byte)54, (byte)74, (byte)89, (byte)100)); ((ParameterOverride)(object)setting.fogColorEnd).value = Color32.op_Implicit(new Color32((byte)47, (byte)63, (byte)82, (byte)200)); if (!Object.op_Implicit((Object)(object)colorGrading)) { colorGrading = val2.sharedProfile.GetSetting(); } if (!val2.sharedProfile.HasSettings()) { val2.sharedProfile.AddSettings(); val2.sharedProfile.settings[val2.sharedProfile.settings.FindIndex((PostProcessEffectSettings settings) => settings is ColorGrading)] = (PostProcessEffectSettings)(object)colorGrading; } } if (!flag) { return; } SetAmbientLight val3 = default(SetAmbientLight); if (val.TryGetComponent(ref val3)) { val3.ambientSkyColor = Utils.Color255(207, 97, 182); val3.ambientEquatorColor = Utils.Color255(207, 97, 165); val3.ambientGroundColor = Utils.Color255(146, 32, 93); val3.ApplyLighting(); } PostProcessVolume val4 = default(PostProcessVolume); if (val.TryGetComponent(ref val4)) { RampFog setting2 = val4.sharedProfile.GetSetting(); ((ParameterOverride)(object)setting2.fogColorStart).value = Color32.op_Implicit(new Color32((byte)190, (byte)154, (byte)150, (byte)15)); ((ParameterOverride)(object)setting2.fogColorMid).value = Color32.op_Implicit(new Color32((byte)110, (byte)73, (byte)69, (byte)100)); ((ParameterOverride)(object)setting2.fogColorEnd).value = Color32.op_Implicit(new Color32((byte)90, (byte)47, (byte)44, (byte)200)); if (!Object.op_Implicit((Object)(object)colorGrading)) { colorGrading = val2.sharedProfile.GetSetting(); } val4.sharedProfile.RemoveSettings(); } GameObject val5 = GameObject.Find("Weather (Locked Position/Rotation)"); ParticleSystemRenderer val6 = default(ParticleSystemRenderer); if (Object.op_Implicit((Object)(object)val5) && Object.op_Implicit((Object)(object)val5.transform.Find("Embers")) && ((Component)val5.transform.Find("Embers")).gameObject.TryGetComponent(ref val6)) { if ((Object)(object)particleSystemMat == (Object)null) { particleSystemMat = Object.Instantiate(((Renderer)val6).sharedMaterial); particleSystemMat.SetTexture(RemapTex, (Texture)(object)particleSystemRamp); } ((Renderer)val6).sharedMaterial = particleSystemMat; } MeshRenderer val7 = default(MeshRenderer); if (GameObject.Find("Sphere, Stars").TryGetComponent(ref val7) && Object.op_Implicit((Object)(object)val7)) { if ((Object)(object)starsMat == (Object)null) { starsMat = Object.Instantiate(((Renderer)val7).sharedMaterial); starsMat.SetTexture(RemapTex, (Texture)(object)starRamp); } ((Renderer)val7).sharedMaterial = starsMat; } MeshRenderer val8 = default(MeshRenderer); if (GameObject.Find("Sphere, Stars 2").TryGetComponent(ref val8) && Object.op_Implicit((Object)(object)val8)) { if ((Object)(object)starsMat2 == (Object)null) { starsMat2 = Object.Instantiate(((Renderer)val8).sharedMaterial); starsMat2.SetTexture(RemapTex, (Texture)(object)starRamp); } ((Renderer)val8).sharedMaterial = starsMat2; } MeshRenderer val9 = default(MeshRenderer); if (GameObject.Find("Sphere, Moon").TryGetComponent(ref val9) && Object.op_Implicit((Object)(object)val9)) { if ((Object)(object)moonMat == (Object)null) { moonMat = Object.Instantiate(((Renderer)val9).sharedMaterial); moonMat.SetTexture(RemapTex, (Texture)(object)moonRamp); moonMat.SetColor(TintColor, Color.op_Implicit(new Vector4(0.58431375f, 0.2784314f, 0.29411766f, 1f))); moonMat.SetColor(SpecColor, Color.op_Implicit(new Vector4(1f, 0f, 0f, 1f))); } ((Renderer)val9).sharedMaterial = moonMat; } MeshRenderer val10 = default(MeshRenderer); if (GameObject.Find("Eclipse").TryGetComponent(ref val10) && Object.op_Implicit((Object)(object)val10)) { if ((Object)(object)eclipseMat == (Object)null) { eclipseMat = Object.Instantiate(((Renderer)val10).sharedMaterial); eclipseMat.SetTexture(RemapTex, (Texture)(object)moonRamp); } ((Renderer)val10).sharedMaterial = eclipseMat; } } else { Log.Debug("unable to find eclipse handler !! ", 114); } } } private static int eclipseRNG; private static bool pinkEclipse; private static Texture2D particleSystemRamp; private static Texture2D starRamp; private static Texture2D moonRamp; private static Material particleSystemMat; private static Material starsMat; private static Material starsMat2; private static Material eclipseMat; private static Material moonMat; private static ColorGrading colorGrading; public static GameObject eclipseHandler; private static ConfigEntry applyCE; private static ConfigEntry eclipseChance; public static ConfigEntry pinkEclipseChance; public static ConfigEntry blacklistStages; public static ConfigEntry whitelistStages; private static readonly int RemapTex = Shader.PropertyToID("_RemapTex"); private static readonly int TintColor = Shader.PropertyToID("_TintColor"); private static readonly int SpecColor = Shader.PropertyToID("_SpecColor"); public override string chainLoaderKey => "com.Nuxlar.CoolerEclipse"; public override void Init() { //IL_0067: 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_0098: 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_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) if (applyCE.Value) { butterscotchnroses.harmony.CreateClassProcessor(typeof(CoolerEclipseChanges)).Patch(); Run.onRunStartGlobal += RunOnonRunStartGlobal; Log.Debug("ptached cooler eclipse !!", 261); eclipseHandler = PrefabAPI.CreateEmptyPrefab("eclipse handler", true); eclipseHandler.AddComponent(); AsyncOperationHandle val = Addressables.LoadAssetAsync((object)RoR2_Base_Common_ColorRamps.texRampGolem_png); val.Completed += delegate(AsyncOperationHandle handle) { starRamp = handle.Result; }; val = Addressables.LoadAssetAsync((object)RoR2_Base_Common_ColorRamps.texRampArchWisp_png); val.Completed += delegate(AsyncOperationHandle handle) { moonRamp = handle.Result; }; val = Addressables.LoadAssetAsync((object)RoR2_Base_Common_ColorRamps.texRampDiamondLaser_png); val.Completed += delegate(AsyncOperationHandle handle) { particleSystemRamp = handle.Result; }; } } private void RunOnonRunStartGlobal(Run obj) { GameObject val = GameObject.Find("eclipse handler(Clone)"); if (Object.op_Implicit((Object)(object)val)) { Object.Destroy((Object)(object)val); } if (NetworkServer.active) { val = Object.Instantiate(eclipseHandler); NetworkServer.Spawn(val); } } public override void Config(ConfigFile config) { applyCE = config.Bind("Mods - CoolerEclipse", "apply cooler eclipse patches !!", true, ""); Utils.CheckboxConfig(applyCE); eclipseChance = config.Bind("Mods - CoolerEclipse", "chance for eclipse", 15f, "bwaa, (0-100 !!!"); Utils.SliderConfig(0f, 100f, eclipseChance); pinkEclipseChance = config.Bind("Mods - CoolerEclipse", "chance for pink eclipse if enabled !", 50f, "bwaa, (0-100 !!! if regular eclipse is rolled rolls this percent chance on top .,,. set to 0 to disable !!"); Utils.SliderConfig(0f, 100f, pinkEclipseChance); blacklistStages = config.Bind("Mods - CoolerEclipse", "stage blacklist", "goldshores,bazaar,solutionalhaunt,ss2_voidshop,testscene,voidraid,arena", "eclipse stage blacklist (seperate by , !! (eg golemplains,blackbeach!!"); Utils.StringConfig(blacklistStages); whitelistStages = config.Bind("Mods - CoolerEclipse", "stage whitelist", "", "what stages to force eclipses on (seperate by , !! (eg golemplains,blackbeach!! will not work with moon2, ,.."); Utils.StringConfig(whitelistStages); } } internal class EclipseNetworkBehavior : NetworkBehaviour { public SyncListInt eclipseRNGs = new SyncListInt(); public SyncListBool pinkEclipses = new SyncListBool(); private bool ranFixedUpdate; private void Awake() { Object.DontDestroyOnLoad((Object)(object)this); } private void Start() { } private void OnServerInitialized() { } public override void OnStartClient() { ((NetworkBehaviour)this).OnStartClient(); if (NetworkServer.active) { for (int i = 0; i < 10; i++) { ((SyncList)(object)eclipseRNGs).Add(Random.RandomRangeInt(0, 100)); ((SyncList)(object)pinkEclipses).Add((float)Random.RandomRangeInt(0, 100) > coolereclipse.pinkEclipseChance.Value); } } } private void OnEnable() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown Stage.Start += new hook_Start(StageOnStart); } private void FixedUpdate() { if (!ranFixedUpdate) { ranFixedUpdate = true; } } private void start() { } private void OnDisable() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown Stage.Start -= new hook_Start(StageOnStart); } private IEnumerator StageOnStart(orig_Start orig, Stage self) { if (NetworkServer.active) { int num = Run.instance.runRNG.RangeInt(0, 100); Log.Debug($"eclipse rng {num}", 405); int num2 = Run.instance.runRNG.RangeInt(0, 100); Log.Debug($"pink rng {(float)num2 > coolereclipse.pinkEclipseChance.Value}", 407); ((SyncList)(object)eclipseRNGs).Add(num); ((SyncList)(object)pinkEclipses).Add((float)num2 > coolereclipse.pinkEclipseChance.Value); } return orig.Invoke(self); } } public class enemiesreturn : PatchBase { public sealed class HiddenAnointedBehavior : BaseItemBodyBehavior { private bool runOnce; private ModelSkinController modelSkinController; [ItemDefAssociation] private static ItemDef GetItemDef() { return annointedItemDef; } private void FixedUpdate() { //IL_0197: Unknown result type (might be due to invalid IL or missing references) if (runOnce) { return; } modelSkinController = ((Component)((BaseItemBodyBehavior)this).body.modelLocator.modelTransform).GetComponent(); if (!Object.op_Implicit((Object)(object)modelSkinController) || ((BaseItemBodyBehavior)this).body.skinIndex >= modelSkinController.skins.Length) { return; } SkinDef item = modelSkinController.skins[((BaseItemBodyBehavior)this).body.skinIndex]; if (skinDefs.Contains(item)) { GameObject gameObject = ((Component)((Component)((Component)((Component)((BaseItemBodyBehavior)this).body).gameObject.GetComponent()._modelTransform).gameObject.GetComponent().FindChild("Head")).transform.Find("DisplayAeonian(Clone)")).gameObject; MeshRenderer component = ((Component)gameObject.transform.Find("ArraignCrown")).GetComponent(); if (!Object.op_Implicit((Object)(object)replacedCrown)) { replacedCrown = Object.Instantiate(((Renderer)component).material); ? val = replacedCrown; int mainTex = MainTex; Texture texture = replacedCrown.GetTexture(MainTex); ((Material)val).SetTexture(mainTex, (Texture)(object)Utils.hsvModifyTexture((Texture2D)(object)((texture is Texture2D) ? texture : null), hue.Value, saturation.Value, value.Value)); ? val2 = replacedCrown; int emTex = EmTex; Texture texture2 = replacedCrown.GetTexture(EmTex); ((Material)val2).SetTexture(emTex, (Texture)(object)Utils.hsvModifyTexture((Texture2D)(object)((texture2 is Texture2D) ? texture2 : null), hue.Value, saturation.Value, value.Value)); replacedCrown.SetColor(EmColor, Utils.Color255(255, 195, 185)); } gameObject.GetComponent().rendererInfos[0].defaultMaterial = replacedCrown; ((Renderer)component).material = replacedCrown; } runOnce = true; } } private static readonly int MainTex = Shader.PropertyToID("_MainTex"); private static readonly int EmTex = Shader.PropertyToID("_EmTex"); private static readonly int EmColor = Shader.PropertyToID("_EmColor"); private static HashSet skinDefs = new HashSet(); private static ItemDef annointedItemDef; private static Material replacedCrown; private static ConfigEntry hue; private static ConfigEntry saturation; private static ConfigEntry value; private static ConfigEntry addAnointed; private static ConfigEntry enabled; public override string chainLoaderKey => "com.Viliger.EnemiesReturns"; public override void Init() { applyHooks(); } private void applyHooks() { if (enabled.Value) { ((ResourceAvailability)(ref BodyCatalog.availability)).onAvailable += AddAnointedPink; CharacterBody.onBodyStartGlobal += CharacterBodyOnonBodyStartGlobal; ((ResourceAvailability)(ref ItemCatalog.availability)).onAvailable += delegate { //IL_0005: Unknown result type (might be due to invalid IL or missing references) annointedItemDef = ItemCatalog.GetItemDef(ItemCatalog.FindItemIndex("HiddenAnointed")); }; } else { ((ResourceAvailability)(ref BodyCatalog.availability)).onAvailable += AddAnointedPink; CharacterBody.onBodyStartGlobal += CharacterBodyOnonBodyStartGlobal; } } private static void CharacterBodyOnonBodyStartGlobal(CharacterBody body) { if (!NetworkServer.active || !body.isPlayerControlled || body.inventory.GetItemCountPermanent(annointedItemDef) > 0 || !Object.op_Implicit((Object)(object)body.modelLocator) || !Object.op_Implicit((Object)(object)body.modelLocator.modelTransform)) { return; } ModelSkinController component = ((Component)body.modelLocator.modelTransform).GetComponent(); if (Object.op_Implicit((Object)(object)component) && body.skinIndex < component.skins.Length) { SkinDef item = component.skins[body.skinIndex]; if (skinDefs.Contains(item)) { body.inventory.GiveItemPermanent(annointedItemDef, 1); } } } private static void AddAnointedPink() { //IL_01af: Unknown result type (might be due to invalid IL or missing references) //IL_01c8: Unknown result type (might be due to invalid IL or missing references) //IL_0296: Unknown result type (might be due to invalid IL or missing references) string text = "CommandoBody"; string text2 = "testSkin"; try { GameObject val = BodyCatalog.FindBodyPrefab(text); if (!Object.op_Implicit((Object)(object)val)) { Log.Warning("Failed to add \"" + text2 + "\" skin because \"" + text + "\" doesn't exist"); return; } ModelLocator component = val.GetComponent(); if (!Object.op_Implicit((Object)(object)component)) { Log.Warning("Failed to add \"" + text2 + "\" skin to \"" + text + "\" because it doesn't have \"ModelLocator\" component"); return; } GameObject gameObject = ((Component)component.modelTransform).gameObject; ModelSkinController val2 = (Object.op_Implicit((Object)(object)gameObject) ? gameObject.GetComponent() : null); if (!Object.op_Implicit((Object)(object)val2)) { Log.Warning("Failed to add \"" + text2 + "\" skin to \"" + text + "\" because it doesn't have \"ModelSkinController\" component"); return; } SkinDef[] skins = val2.skins; for (int i = 0; i < skins.Length; i++) { Log.Info(((Object)skins[i]).name); } Log.Debug("adding !", 144); SkinDef val3 = Object.Instantiate(val2.skins.First((SkinDef skindef) => ((Object)skindef).name == "skinCommandoJudgementHidden")); Texture2D val4 = Utils.hsvModifyTexture(val3.icon.texture, hue.Value, saturation.Value, value.Value); Sprite icon = Sprite.Create(val4, new Rect(0f, 0f, (float)((Texture)val4).width, (float)((Texture)val4).height), new Vector2((float)(((Texture)val4).width / 2), (float)(((Texture)val4).height / 2))); val3.icon = icon; Material val5 = Object.Instantiate(val3.skinDefParams.rendererInfos[0].defaultMaterial); ? val6 = val5; int mainTex = MainTex; Texture texture = val5.GetTexture(MainTex); ((Material)val6).SetTexture(mainTex, (Texture)(object)Utils.hsvModifyTexture((Texture2D)(object)((texture is Texture2D) ? texture : null), hue.Value, saturation.Value, value.Value)); ? val7 = val5; int emTex = EmTex; Texture texture2 = val5.GetTexture(EmTex); ((Material)val7).SetTexture(emTex, (Texture)(object)Utils.hsvModifyTexture((Texture2D)(object)((texture2 is Texture2D) ? texture2 : null), hue.Value, saturation.Value, value.Value)); val5.SetColor(EmColor, Utils.Color255(255, 0, 185)); SkinDefParams val8 = Object.Instantiate(val3.skinDefParams); for (int num = 0; num < val8.rendererInfos.Length; num++) { val8.rendererInfos[num].defaultMaterial = val5; Log.Debug($"defualt address = {val8.rendererInfos[num].defaultMaterialAddress}", 163); } val3.skinDefParams = val8; ((Object)val3).name = text2; val3.nameToken += "_BNR"; LanguageAPI.Add(val3.nameToken, "Annointed Pink"); Array.Resize(ref val2.skins, val2.skins.Length + 1); val2.skins[^1] = val3; Log.Debug($"added {val3} to commando ", 174); skinDefs.Add(val3); } catch (Exception data) { Log.Warning("Failed to add \"" + text2 + "\" skin to \"" + text + "\""); Log.Error(data); } } public override void Config(ConfigFile config) { enabled = config.Bind("Mods - enemiesreturn", "enable patches for enemiesreturn", true, ""); Utils.CheckboxConfig(enabled); enabled.SettingChanged += delegate { applyHooks(); }; addAnointed = config.Bind("Mods - enemiesreturn", "add anointed pink skin !!", true, "enables commando pink annointed .,,. probablys doesnt show if you dont have original judgement unlocked ,....,."); Utils.CheckboxConfig(addAnointed); hue = config.Bind("Mods - enemiesreturn", "pink anointed skin hue ,...", 100f, "pink anointed hue ,.,."); Utils.SliderConfig(0f, 360f, hue); saturation = config.Bind("Mods - enemiesreturn", "pink anointed skin saturation ,.,,", 0f, "pink anointed saturation ,.,."); Utils.SliderConfig(0f, 100f, saturation); value = config.Bind("Mods - enemiesreturn", "pink anointed skin value ,..,", 0f, "pink anointed value ,.,."); Utils.SliderConfig(0f, 100f, value); } } public class gildedcoastplus : PatchBase { [HarmonyPatch] public class GoldenCoastChanges { [HarmonyPatch(typeof(FightChanges), "GoldshoresBossfight_GiveBuff")] [HarmonyPrefix] public static bool GoldenCoastPlusRevivedGiveBuffPreFix() { return !skipGoldenRewards.Value; } } public static ConfigEntry skipGoldenRewards; public static ConfigEntry applyGCP; public override string chainLoaderKey => "com.TechDebtCollector.GoldenCoastPlus"; public override void Init() { if (applyGCP.Value) { butterscotchnroses.harmony.CreateClassProcessor(typeof(GoldenCoastChanges)).Patch(); } } public override void Config(ConfigFile config) { applyGCP = config.Bind("Mods - GoldenCoastPlus", "apply golden coast plus patches !!", true, ""); Utils.CheckboxConfig(applyGCP); skipGoldenRewards = config.Bind("Mods - GoldenCoastPlus", "skip hidden buff", true, ""); Utils.CheckboxConfig(skipGoldenRewards); } } public class inferno : PatchBase { [HarmonyPatch] public class InfernoChanges { [HarmonyPatch(typeof(Body), "BodyChanges")] [HarmonyILManipulator] public static void OnEnterPostFix(ILContext il) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Expected O, but got Unknown if (noBeetleStun.Value) { Log.Debug("ilh ook hate beetle grahhhhh", 25); ILCursor val = new ILCursor(il); if (val.TryGotoNext(new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, typeof(Body), "beetleIndex") })) { val.Index += 6; val.RemoveRange(3); } } } } public static ConfigEntry noBeetleStun; public static ConfigEntry applyInferno; public override string chainLoaderKey => "HIFU.Inferno"; public override void Init() { if (applyInferno.Value) { butterscotchnroses.harmony.CreateClassProcessor(typeof(InfernoChanges)).Patch(); } } public override void Config(ConfigFile config) { applyInferno = config.Bind("Mods - Inferno", "apply inferno patches !!", true, ""); Utils.CheckboxConfig(applyInferno); noBeetleStun = config.Bind("Mods - Inferno", "makes beetles able to be stunned i hate beetle stun sm ,,..,", true, ""); Utils.CheckboxConfig(noBeetleStun); } } public class skillsmas : PatchBase { private static ConfigEntry zandatsuRechargeSkill; private ConfigEntry enabled; public override string chainLoaderKey => "com.themysticsword.skillsmas"; public override void Init() { if (enabled.Value) { GlobalEventManager.onCharacterDeathGlobal += GlobalEventManagerOnonCharacterDeathGlobal; } } private static void GlobalEventManagerOnonCharacterDeathGlobal(DamageReport damageReport) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) if (damageReport.damageInfo != null && DamageAPI.HasModdedDamageType(damageReport.damageInfo, Zandatsu.zandatsuDamageType) && Object.op_Implicit((Object)(object)damageReport.attackerBody)) { damageReport.attackerBody.skillLocator.special.ApplyAmmoPack(); } } public override void Config(ConfigFile config) { enabled = config.Bind("Mods - skillsmas", "enable patches for skillsmas", true, ""); Utils.CheckboxConfig(enabled); zandatsuRechargeSkill = config.Bind("Mods - skillsmas", "have zandatsu recharge skill on kill !!", true, "like !! if it kills something refresh cooldown !!"); Utils.CheckboxConfig(zandatsuRechargeSkill); } } public class starstorm : PatchBase { [HarmonyPatch] public class Starstorm2ExeChanges { } public static ConfigEntry applySS2; public static ConfigEntry baseSpeed; public static ConfigEntry boostedSpeed; public static ConfigEntry terminalSpeed; public static ConfigEntry speedmult; public static ConfigEntry baseDamage; public static ConfigEntry boostedDamage; public static ConfigEntry useMovespeed; public static ConfigEntry iceToolFreezeChance; public static ConfigEntry iceToolFreezeTime; public static ConfigEntry iceToolFreezeTimeStack; public static ConfigEntry iceToolFreezeChanceStack; public override string chainLoaderKey => "com.TeamMoonstorm"; public override void Init() { if (applySS2.Value) { LanguageAPI.Add("SS2_ITEM_ICETOOL_DESC", $"While touching a wall, gain +1 (+1 per stack) extra jump and a {iceToolFreezeChance.Value}% (+{iceToolFreezeChanceStack.Value}% per stack) chance to freeze enemies for {iceToolFreezeTime.Value} seconds (+{iceToolFreezeTimeStack.Value} per stack). "); Hooks(); } } public override void Hooks() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Expected O, but got Unknown HealthComponent.TakeDamageProcess += new hook_TakeDamageProcess(HealthComponentOnTakeDamageProcess); RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(RecalculateStatsAPIOnGetStatCoefficients); } private void RecalculateStatsAPIOnGetStatCoefficients(CharacterBody sender, StatHookEventArgs args) { int buffCount = sender.GetBuffCount(BuffBase.instance.BuffDef); args.moveSpeedReductionMultAdd += (float)buffCount * 0.05f; } private void HealthComponentOnTakeDamageProcess(orig_TakeDamageProcess orig, HealthComponent self, DamageInfo damageinfo) { //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_01a2: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self, damageinfo); if (!NetworkServer.active || !Object.op_Implicit((Object)(object)damageinfo.attacker)) { return; } CharacterBody component = damageinfo.attacker.GetComponent(); if (!Object.op_Implicit((Object)(object)((component != null) ? component.inventory : null))) { return; } int itemCountEffective = component.inventory.GetItemCountEffective(Items.IceTool._itemIndex); if (itemCountEffective <= 0 || !Util.CheckRoll(iceToolFreezeChance.Value + iceToolFreezeChanceStack.Value * (float)(itemCountEffective - 1), component.master)) { return; } self.body.AddTimedBuff(BuffBase.instance.BuffDef, 25f); foreach (TimedBuff timedBuff in self.body.timedBuffs) { if (timedBuff.buffIndex == BuffBase.instance.BuffDef.buffIndex) { timedBuff.totalDuration = 25f; } } if (self.body.GetBuffCount(BuffBase.instance.BuffDef) >= 5) { SetStateOnHurt component2 = ((Component)self.body).GetComponent(); if (Object.op_Implicit((Object)(object)component2)) { Log.Debug($"duration {iceToolFreezeTime.Value + iceToolFreezeTimeStack.Value * (float)(itemCountEffective - 1)}", 261); component2.SetFrozen(iceToolFreezeTime.Value + iceToolFreezeTimeStack.Value * (float)(itemCountEffective - 1)); } else { Log.Debug($"failed to freeze {self.body}", 266); } self.body.SetBuffCount(BuffBase.instance.BuffDef.buffIndex, 0); } } public override void Config(ConfigFile config) { applySS2 = config.Bind("Mods - SS2", "apply ss2 patches !!", true, ""); Utils.CheckboxConfig(applySS2); iceToolFreezeChance = config.Bind("Mods - SS2", "ice tool freeze chance", 5f, "percent chance for icetool to freeze enemies !!"); Utils.SliderConfig(0f, 100f, iceToolFreezeChance); iceToolFreezeTime = config.Bind("Mods - SS2", "ice tool freeze time", 0.5f, "how long icetool should freeze enemies !!"); Utils.SliderConfig(0f, 30f, iceToolFreezeTime); iceToolFreezeChanceStack = config.Bind("Mods - SS2", "ice tool freeze chance stack", 2.5f, "percent chance for icetool to freeze enemies stack !!"); Utils.SliderConfig(0f, 100f, iceToolFreezeChanceStack); iceToolFreezeTimeStack = config.Bind("Mods - SS2", "ice tool freeze time stack", 0.25f, "how long icetool should freeze enemies !!"); Utils.SliderConfig(0f, 30f, iceToolFreezeTimeStack); iceToolFreezeChance.SettingChanged += IceToolFreezeChanceOnSettingChanged; iceToolFreezeTime.SettingChanged += IceToolFreezeChanceOnSettingChanged; iceToolFreezeChanceStack.SettingChanged += IceToolFreezeChanceOnSettingChanged; iceToolFreezeTimeStack.SettingChanged += IceToolFreezeChanceOnSettingChanged; static void IceToolFreezeChanceOnSettingChanged(object sender, EventArgs e) { if (applySS2.Value) { LanguageAPI.Add("SS2_ITEM_ICETOOL_DESC", $"While touching a wall, gain +1 (+1 per stack) extra jump and a {iceToolFreezeChance.Value}% (+{iceToolFreezeChanceStack.Value}% per stack) chance to freeze enemies for {iceToolFreezeTime.Value} seconds (+{iceToolFreezeTimeStack.Value} per stack). "); } } } } public class SpeedTester : MonoBehaviour { public Vector3 lastPosition = Vector3.zero; public float speed; public float[] speedlist = new float[6]; private void Start() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) lastPosition = ((Component)this).transform.position; } private void FixedUpdate() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_000d: 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_002e: Unknown result type (might be due to invalid IL or missing references) speed = Vector3.Distance(lastPosition, ((Component)this).transform.position) / Time.deltaTime; lastPosition = ((Component)this).transform.position; for (int i = 1; i < speedlist.Length; i++) { speedlist[i] = speedlist[i - 1]; } speedlist[0] = speed; } } public class Boosted : MonoBehaviour { } public class Utils { private static readonly int MainTex = Shader.PropertyToID("_MainTex"); private static readonly int RemapTex = Shader.PropertyToID("_RemapTex"); private static readonly int EmTex = Shader.PropertyToID("_EmTex"); private static readonly int FresnelRamp = Shader.PropertyToID("_FresnelRamp"); private static readonly int EmColor = Shader.PropertyToID("_EmColor"); private static readonly int Color = Shader.PropertyToID("_Color"); private static readonly int TintColor = Shader.PropertyToID("_TintColor"); private static readonly int WireframeColor = Shader.PropertyToID("WireframeColor"); private static readonly int VertColor = Shader.PropertyToID("_VertColor"); public static Color Color255(int r, int g, int b, int a = 255) { //IL_0020: Unknown result type (might be due to invalid IL or missing references) return new Color((float)r / 255f, (float)g / 255f, (float)b / 255f, (float)a / 255f); } public static Color Color255(float r, float g, float b, float a = 255f) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) return new Color(r / 255f, g / 255f, b / 255f, a / 255f); } public static void SliderConfig(float min, float max, ConfigEntry config) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000c: 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_001f: Expected O, but got Unknown //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Expected O, but got Unknown StepSliderConfig val = new StepSliderConfig { max = max, min = min, FormatString = "{0:0}" }; ModSettingsManager.AddOption((BaseOption)new StepSliderOption(config, val)); } public static void SliderConfig(int min, int max, ConfigEntry config) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000c: 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_001f: Expected O, but got Unknown //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Expected O, but got Unknown IntSliderConfig val = new IntSliderConfig { max = max, min = min, formatString = "{0:0}" }; ModSettingsManager.AddOption((BaseOption)new IntSliderOption(config, val)); } public static void CheckboxConfig(ConfigEntry config, bool restartRequired = false) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Expected O, but got Unknown CheckBoxConfig val = new CheckBoxConfig(); ((BaseOptionConfig)val).restartRequired = restartRequired; ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(config, val)); } public static void StringConfig(ConfigEntry config) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown InputFieldConfig val = new InputFieldConfig(); ModSettingsManager.AddOption((BaseOption)new StringInputFieldOption(config, val)); } public static Texture2D makeReadable(Texture texture) { //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_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Expected O, but got Unknown RenderTexture temporary = RenderTexture.GetTemporary(texture.width, texture.height, 32); ((Object)temporary).name = "Whatever"; temporary.enableRandomWrite = true; temporary.Create(); Graphics.Blit(texture, temporary); RenderTexture active = RenderTexture.active; RenderTexture.active = temporary; Texture2D val = new Texture2D(texture.width, texture.height); val.ReadPixels(new Rect(0f, 0f, (float)((Texture)temporary).width, (float)((Texture)temporary).height), 0, 0); val.Apply(); RenderTexture.active = active; RenderTexture.ReleaseTemporary(temporary); return val; } public static Texture2D hsvModifyTexture(Texture2D texture, float hueShift = 0f, float saturation = 0f, float value = 0f, bool dontExport = false, bool multiplySaturation = false) { //IL_020b: Unknown result type (might be due to invalid IL or missing references) //IL_0217: Unknown result type (might be due to invalid IL or missing references) //IL_0223: Unknown result type (might be due to invalid IL or missing references) //IL_022f: Unknown result type (might be due to invalid IL or missing references) //IL_023b: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: 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_0158: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_016c: 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) string text = skinrecolors.fileType.Value switch { skinrecolors.fileTypes.png => "png", skinrecolors.fileTypes.jpg => "jpg", skinrecolors.fileTypes.tga => "tga", _ => "png", }; string text2 = $"{((Object)texture).name}_RecolorH{hueShift}S{saturation}V{value}.{text}"; string path = skinrecolors.textureDirs + "\\" + text2; Texture2D val; if (skinrecolors.recoloredTextures.TryGetValue(text2 ?? "", out var value2)) { Log.Debug("found " + text2 + " in recolored texture dict !!", 120); val = value2; } else { val = makeReadable((Texture)(object)texture); Color[] pixels = val.GetPixels(0, 0, ((Texture)val).width, ((Texture)val).height); float num = default(float); float num2 = default(float); float num3 = default(float); for (int i = 0; i < pixels.Length; i++) { Color val2 = pixels[i]; Color.RGBToHSV(val2, ref num, ref num2, ref num3); num = (num + hueShift / 360f) % 1f; if (num < 0f) { num += 1f; } num3 += value / 100f; num2 = ((!multiplySaturation) ? (num2 + saturation / 100f) : (num2 * saturation)); Color val3 = Color.HSVToRGB(num, num2, num3); val3.a = val2.a; pixels[i] = val3; } val.SetPixels(pixels); val.Apply(); if (!dontExport) { Log.Debug($"created return texture !!! {((Object)texture).name} {dontExport}", 155); File.WriteAllBytes(path, ImageConversion.EncodeToPNG(val)); } } ((Object)val).name = $"{((Object)texture).name}_RecolorH{hueShift}S{saturation}V{value}"; ((Texture)val).anisoLevel = ((Texture)texture).anisoLevel; ((Texture)val).filterMode = ((Texture)texture).filterMode; ((Texture)val).wrapMode = ((Texture)texture).wrapMode; ((Texture)val).wrapModeU = ((Texture)texture).wrapModeU; ((Texture)val).wrapModeV = ((Texture)texture).wrapModeV; ((Texture)val).wrapModeW = ((Texture)texture).wrapModeW; return val; } public static Material RecolorMaterial(Material mat, float hue, float saturation, float value, bool dontAdd = false, bool multiplySaturation = false) { if (mat.HasTexture(MainTex) && (Object)(object)mat.GetTexture(MainTex) != (Object)null) { ? val = mat; int mainTex = MainTex; Texture texture = mat.GetTexture(MainTex); ((Material)val).SetTexture(mainTex, (Texture)(object)hsvModifyTexture((Texture2D)(object)((texture is Texture2D) ? texture : null), hue, saturation / 100f, value / 100f, dontAdd, multiplySaturation)); } if (mat.HasTexture(EmTex) && (Object)(object)mat.GetTexture(EmTex) != (Object)null) { ? val2 = mat; int emTex = EmTex; Texture texture2 = mat.GetTexture(EmTex); ((Material)val2).SetTexture(emTex, (Texture)(object)hsvModifyTexture((Texture2D)(object)((texture2 is Texture2D) ? texture2 : null), hue, saturation / 100f, value / 100f, dontAdd, multiplySaturation)); } if (mat.HasTexture(RemapTex) && (Object)(object)mat.GetTexture(RemapTex) != (Object)null) { ? val3 = mat; int remapTex = RemapTex; Texture texture3 = mat.GetTexture(RemapTex); ((Material)val3).SetTexture(remapTex, (Texture)(object)hsvModifyTexture((Texture2D)(object)((texture3 is Texture2D) ? texture3 : null), hue, saturation / 100f, value / 100f, dontAdd, multiplySaturation)); } if (mat.HasTexture(FresnelRamp) && (Object)(object)mat.GetTexture(FresnelRamp) != (Object)null) { ? val4 = mat; int fresnelRamp = FresnelRamp; Texture texture4 = mat.GetTexture(FresnelRamp); ((Material)val4).SetTexture(fresnelRamp, (Texture)(object)hsvModifyTexture((Texture2D)(object)((texture4 is Texture2D) ? texture4 : null), hue, saturation / 100f, value / 100f, dontAdd, multiplySaturation)); } TryRecolorMat(mat, Color, hue, saturation, value, multiplySaturation); TryRecolorMat(mat, EmColor, hue, saturation, value, multiplySaturation); TryRecolorMat(mat, TintColor, hue, saturation, value, multiplySaturation); TryRecolorMat(mat, WireframeColor, hue, saturation, value, multiplySaturation); TryRecolorMat(mat, VertColor, hue, saturation, value, multiplySaturation); return mat; } private static void TryRecolorMat(Material mat, int nameID, float hue, float sat, float value, bool multiplySat = false) { //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_0012: 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_006b: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) if (mat.HasColor(nameID)) { Color color = mat.GetColor(nameID); float num = default(float); float num2 = default(float); float num3 = default(float); Color.RGBToHSV(color, ref num, ref num2, ref num3); num = (num + hue / 360f) % 1f; if (num < 0f) { num += 1f; } num2 = ((!multiplySat) ? (num2 + sat / 100f) : (num2 * (sat / 100f))); num3 += value / 100f; Color val = Color.HSVToRGB(num, num2, num3); val.a = color.a; mat.SetColor(nameID, val); } } public static ModelSkinController GetModelLocator(GameObject characterbody) { if (!Object.op_Implicit((Object)(object)characterbody)) { Log.Warning("failed to get model locator from null ,.,."); return null; } ModelLocator component = characterbody.GetComponent(); if (!Object.op_Implicit((Object)(object)component)) { Log.Warning("failed to get model skin controller since couldnts find model locator on " + ((Object)characterbody).name + ",.,,. "); return null; } GameObject gameObject = ((Component)component.modelTransform).gameObject; ModelSkinController val = (Object.op_Implicit((Object)(object)gameObject) ? gameObject.GetComponent() : null); if (!Object.op_Implicit((Object)(object)val)) { Log.Warning("failed to get model skin controlelr since couldnts find model skin controller components on " + ((Object)characterbody).name + " ,.,.."); return null; } return val; } } } namespace BNR.patches { public class commands { public static Dictionary bodyNameToPrev = new Dictionary(); [ConCommand(/*Could not decode attribute arguments.*/)] public static void CreateSkin(ConCommandArgs args) { if ((Object)(object)skinrecolors.baseSkinName == (Object)null) { Log.Warning("base skin null !!"); return; } if (((ConCommandArgs)(ref args)).Count >= 1) { skinrecolors.newSkinName = ((ConCommandArgs)(ref args))[0]; } string text = ((!Utility.IsNullOrWhiteSpace(skinrecolors.newSkinName)) ? skinrecolors.newSkinName : "Generated Skin"); ConfigEntry skinRecolors = skinrecolors.skinRecolors; string value = skinRecolors.Value; object[] obj = new object[7] { ((Object)skinrecolors.baseSkinName).name, null, null, null, null, null, null }; string name = ((Object)skinrecolors.currentBody).name; obj[1] = name.Substring(0, name.Length - 7); obj[2] = skinrecolors.hsv[0]; obj[3] = skinrecolors.hsv[1]; obj[4] = skinrecolors.hsv[2]; obj[5] = text; obj[6] = skinrecolors.multiplySat; skinRecolors.Value = value + string.Format(";;{0},{1},{2},{3},{4},{5},{6}", obj); object[] obj2 = new object[7] { ((Object)skinrecolors.baseSkinName).name, null, null, null, null, null, null }; name = ((Object)skinrecolors.currentBody).name; obj2[1] = name.Substring(0, name.Length - 7); obj2[2] = skinrecolors.hsv[0]; obj2[3] = skinrecolors.hsv[1]; obj2[4] = skinrecolors.hsv[2]; obj2[5] = text; obj2[6] = skinrecolors.multiplySat; Debug.Log((object)string.Format("added ;;{0},{1},{2},{3},{4},{5},{6} to the config !!! restart your game to see it in lobby .,,.", obj2)); } [ConCommand(/*Could not decode attribute arguments.*/)] public static void ListSkins(ConCommandArgs args) { Debug.Log((object)("args = " + ((ConCommandArgs)(ref args))[0] + " ")); GameObject val = BodyCatalog.FindBodyPrefab(((ConCommandArgs)(ref args))[0]); if (!Object.op_Implicit((Object)(object)val)) { Log.Warning("body no existey ,,."); return; } ModelLocator component = val.GetComponent(); if (!Object.op_Implicit((Object)(object)component)) { Log.Warning("model locator no existey .,.,"); return; } GameObject gameObject = ((Component)component.modelTransform).gameObject; ModelSkinController val2 = (Object.op_Implicit((Object)(object)gameObject) ? gameObject.GetComponent() : null); if (!Object.op_Implicit((Object)(object)val2)) { Log.Warning("model skin controller no existey .,,."); return; } SkinDef[] skins = val2.skins; for (int i = 0; i < skins.Length; i++) { Debug.Log((object)((Object)skins[i]).name); } } [ConCommand(/*Could not decode attribute arguments.*/)] public static void clearSkin(ConCommandArgs args) { bodyNameToPrev.Clear(); } [ConCommand(/*Could not decode attribute arguments.*/)] public static void recolorSkin(ConCommandArgs args) { ModelSkinController modelLocator = Utils.GetModelLocator(((Component)((ConCommandArgs)(ref args)).GetSenderBody()).gameObject); int num = modelLocator.currentSkinIndex; if (bodyNameToPrev.TryGetValue(((Object)((ConCommandArgs)(ref args)).senderBody).name, out var value)) { num = value; } else { bodyNameToPrev.Add(((Object)((ConCommandArgs)(ref args)).senderBody).name, modelLocator.currentSkinIndex); } SkinDef obj = modelLocator.skins[num]; float num2 = 0f; float num3 = 0f; bool flag = false; if (float.TryParse(((ConCommandArgs)(ref args))[0], out var result)) { if (((ConCommandArgs)(ref args)).Count >= 2) { num2 = float.Parse(((ConCommandArgs)(ref args))[1]); } if (((ConCommandArgs)(ref args)).Count >= 3) { num3 = float.Parse(((ConCommandArgs)(ref args))[2]); } if (((ConCommandArgs)(ref args)).Count >= 4) { flag = bool.Parse(((ConCommandArgs)(ref args))[3]); } } else { skinrecolors.newSkinName = ((ConCommandArgs)(ref args))[0]; if (((ConCommandArgs)(ref args)).Count >= 2) { result = float.Parse(((ConCommandArgs)(ref args))[1]); } if (((ConCommandArgs)(ref args)).Count >= 3) { num2 = float.Parse(((ConCommandArgs)(ref args))[2]); } if (((ConCommandArgs)(ref args)).Count >= 4) { num3 = float.Parse(((ConCommandArgs)(ref args))[3]); } if (((ConCommandArgs)(ref args)).Count >= 5) { flag = bool.Parse(((ConCommandArgs)(ref args))[4]); } } Log.Debug($"multipl sat ? {flag}", 131); SkinDef val = skinrecolors.skinRecolor(((Object)obj).name, ((Object)((ConCommandArgs)(ref args)).senderBody).name, result, num2, num3, "temp", "", dontAdd: true, flag); Array.Resize(ref modelLocator.skins, modelLocator.skins.Length + 1); modelLocator.skins[^1] = val; modelLocator.currentSkinIndex = modelLocator.skins.Length - 1; ((ConCommandArgs)(ref args)).senderBody.skinIndex = (uint)(modelLocator.skins.Length - 1); modelLocator.ApplySkin(modelLocator.currentSkinIndex); Array.Resize(ref modelLocator.skins, modelLocator.skins.Length - 1); skinrecolors.baseSkinName = obj; skinrecolors.hsv[0] = result; skinrecolors.hsv[1] = num2; skinrecolors.hsv[2] = num3; skinrecolors.currentBody = ((ConCommandArgs)(ref args)).senderBody; skinrecolors.multiplySat = flag; } } public abstract class PatchBase : PatchBase where T : PatchBase { public static T instance { get; private set; } public PatchBase() { if (instance != null) { throw new InvalidOperationException("Singleton class \"" + typeof(T).Name + "\" inheriting ItemBase was instantiated twice"); } instance = this as T; } } public abstract class PatchBase { public virtual string chainLoaderKey => ""; public void PreInit() { if (Utility.IsNullOrWhiteSpace(chainLoaderKey) || Chainloader.PluginInfos.ContainsKey(chainLoaderKey)) { Init(); } else { Log.Debug("didnt finds " + chainLoaderKey + " loaded !!! not applyings patches ,.,,.", 37); } } public abstract void Init(); public abstract void Config(ConfigFile config); public virtual void Hooks() { } public virtual void FixedUpdate() { } public virtual void Update() { } } } namespace BNR.items { public abstract class BuffBase : BuffBase where T : BuffBase { public static T instance { get; private set; } public BuffBase() { if (instance != null) { throw new InvalidOperationException("Singleton class \"" + typeof(T).Name + "\" inheriting BuffBase was instantiated twice"); } instance = this as T; } } public abstract class BuffBase { internal abstract string name { get; } internal abstract Sprite icon { get; } internal abstract Color color { get; } internal abstract bool canStack { get; } internal abstract bool isDebuff { get; } internal abstract EliteDef eliteDef { get; } public BuffDef BuffDef { get; set; } internal BuffDef AddBuff() { //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) BuffDef val = ScriptableObject.CreateInstance(); ((Object)val).name = name; val.iconSprite = icon; val.buffColor = color; val.canStack = canStack; val.isDebuff = isDebuff; val.eliteDef = eliteDef; ContentAddition.AddBuffDef(val); BuffDef = val; return val; } } public class Crown : ItemBase { public override string ItemName => "crown"; public override string ItemLangTokenName => "crown"; public override string ItemPickupDesc => ""; public override string ItemFullDescription => ""; public override string ItemLore => ""; public override ItemTier Tier => (ItemTier)5; public override GameObject ItemModel => butterscotchnroses.carvingKitBundle.LoadAsset("carvingkit.prefab"); public override Sprite ItemIcon => butterscotchnroses.carvingKitBundle.LoadAsset("carvingkit.png"); public override ItemTag[] ItemTags => (ItemTag[])(object)new ItemTag[1] { (ItemTag)9 }; public override void Init(ConfigFile config) { CreateConfig(config); CreateLang(); CreateItem(); Hooks(); ItemBase.instance.ItemDef.hidden = true; } public override ItemDisplayRuleDict CreateItemDisplayRules() { return null; } } internal class IcetoolDebuff : BuffBase { internal override string name => "IcetoolDebuff"; internal override Sprite icon => Addressables.LoadAssetAsync((object)RoR2_Base_ElementalRings.texIceRingIcon_png).WaitForCompletion(); internal override Color color => Color32.op_Implicit(new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue)); internal override bool canStack => true; internal override bool isDebuff => true; internal override EliteDef eliteDef => null; } public abstract class ItemBase : ItemBase where T : ItemBase { public static T instance { get; private set; } public ItemBase() { if (instance != null) { throw new InvalidOperationException("Singleton class \"" + typeof(T).Name + "\" inheriting ItemBase was instantiated twice"); } instance = this as T; } } public abstract class ItemBase { public ItemDef ItemDef; public abstract string ItemName { get; } public abstract string ItemLangTokenName { get; } public abstract string ItemPickupDesc { get; } public abstract string ItemFullDescription { get; } public abstract string ItemLore { get; } public abstract ItemTier Tier { get; } public virtual ItemTag[] ItemTags { get; set; } = (ItemTag[])(object)new ItemTag[0]; public abstract GameObject ItemModel { get; } public abstract Sprite ItemIcon { get; } public virtual bool CanRemove { get; } = true; public virtual bool AIBlacklisted { get; set; } public abstract void Init(ConfigFile config); public virtual void CreateConfig(ConfigFile config) { } protected virtual void CreateLang() { LanguageAPI.Add("ITEM_" + ItemLangTokenName + "_NAME", ItemName); LanguageAPI.Add("ITEM_" + ItemLangTokenName + "_PICKUP", ItemPickupDesc); LanguageAPI.Add("ITEM_" + ItemLangTokenName + "_DESCRIPTION", ItemFullDescription); LanguageAPI.Add("ITEM_" + ItemLangTokenName + "_LORE", ItemLore); } public abstract ItemDisplayRuleDict CreateItemDisplayRules(); protected void CreateItem() { //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Expected O, but got Unknown if (AIBlacklisted) { ItemTags = new List(ItemTags) { (ItemTag)4 }.ToArray(); } ItemDef = ScriptableObject.CreateInstance(); ((Object)ItemDef).name = "ITEM_" + ItemLangTokenName; ItemDef.nameToken = "ITEM_" + ItemLangTokenName + "_NAME"; ItemDef.pickupToken = "ITEM_" + ItemLangTokenName + "_PICKUP"; ItemDef.descriptionToken = "ITEM_" + ItemLangTokenName + "_DESCRIPTION"; ItemDef.loreToken = "ITEM_" + ItemLangTokenName + "_LORE"; ItemDef.pickupModelPrefab = ItemModel; ItemDef.pickupIconSprite = ItemIcon; ItemDef.hidden = false; ItemDef.canRemove = CanRemove; ItemDef.deprecatedTier = Tier; if (ItemTags.Length != 0) { ItemDef.tags = ItemTags; } ItemAPI.Add(new CustomItem(ItemDef, CreateItemDisplayRules())); } public virtual void Hooks() { } public int GetCount(CharacterBody body) { if (!Object.op_Implicit((Object)(object)body) || !Object.op_Implicit((Object)(object)body.inventory)) { return 0; } return body.inventory.GetItemCount(ItemDef); } public int GetCount(CharacterMaster master) { if (!Object.op_Implicit((Object)(object)master) || !Object.op_Implicit((Object)(object)master.inventory)) { return 0; } return master.inventory.GetItemCount(ItemDef); } public int GetCountSpecific(CharacterBody body, ItemDef itemDef) { if (!Object.op_Implicit((Object)(object)body) || !Object.op_Implicit((Object)(object)body.inventory)) { return 0; } return body.inventory.GetItemCount(itemDef); } } public class WoodToolkit : ItemBase { public sealed class Behavior : BaseItemBodyBehavior { private GameObject mushroomWardGameObject; private TeamFilter mushroomWardTeamFilter; private HealingWard mushroomHealingWard; private float timer; [ItemDefAssociation] private static ItemDef GetItemDef() { return ItemBase.instance?.ItemDef; } private void OnEnable() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown ShrineHealingBehavior.AddShrineStack += new hook_AddShrineStack(ShrineHealingBehaviorOnAddShrineStack); } private void ShrineHealingBehaviorOnAddShrineStack(orig_AddShrineStack orig, ShrineHealingBehavior self, Interactor activator) { //IL_0037: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self, activator); CharacterBody val = default(CharacterBody); if (((Component)activator).TryGetComponent(ref val) && val.inventory.GetItemCountEffective(ItemBase.instance.ItemDef) > 0) { val.AddBuff(BuffBase.instance.BuffDef.buffIndex); } } private void OnDisable() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown ShrineHealingBehavior.AddShrineStack -= new hook_AddShrineStack(ShrineHealingBehaviorOnAddShrineStack); } private void FixedUpdate() { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_006e: 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_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Unknown result type (might be due to invalid IL or missing references) //IL_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) if (!NetworkServer.active) { return; } if (((BaseItemBodyBehavior)this).body.GetNotMoving() && ((BaseItemBodyBehavior)this).body.GetBuffCount(BuffBase.instance.BuffDef.buffIndex) > 0) { timer += Time.deltaTime; } else { timer = 0f; } if (timer > 2f && ((BaseItemBodyBehavior)this).body.GetBuffCount(BuffBase.instance.BuffDef.buffIndex) > 0) { timer = 0f; int count = ItemBase.instance.GetCount(((BaseItemBodyBehavior)this).body); float num = ((BaseItemBodyBehavior)this).body.radius + 7f; num += 3f * (float)(count - 1); mushroomWardGameObject = Object.Instantiate(mushroomWardPrefab, ((BaseItemBodyBehavior)this).body.footPosition, Quaternion.identity); mushroomWardTeamFilter = mushroomWardGameObject.GetComponent(); mushroomHealingWard = mushroomWardGameObject.GetComponent(); NetworkServer.Spawn(mushroomWardGameObject); if (Object.op_Implicit((Object)(object)mushroomHealingWard)) { mushroomHealingWard.interval = 0.25f; mushroomHealingWard.healFraction = (0.06f + 0.04f * (float)(count - 1)) * mushroomHealingWard.interval; mushroomHealingWard.healPoints = 0f; mushroomHealingWard.Networkradius = num; } if (Object.op_Implicit((Object)(object)mushroomWardTeamFilter)) { mushroomWardTeamFilter.teamIndex = ((BaseItemBodyBehavior)this).body.teamComponent.teamIndex; } ((BaseItemBodyBehavior)this).body.SetBuffCount(BuffBase.instance.BuffDef.buffIndex, ((BaseItemBodyBehavior)this).body.GetBuffCount(BuffBase.instance.BuffDef.buffIndex) - 1); } } } private ConfigEntry enabled; private InteractableSpawnCard spawnCard; private static GameObject mushroomWardPrefab = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync((object)RoR2_Base_Mushroom.MushroomWard_prefab).WaitForCompletion(), "mushWard"); private Material woodsMaterial = Addressables.LoadAssetAsync((object)RoR2_DLC3_Drone_Tech.matDroneTechSwarmAOE_Indicator2_mat_a01f2b91).WaitForCompletion(); public override string ItemName => "Carving Kit"; public override string ItemLangTokenName => "WoodenToolkit"; public override string ItemPickupDesc => "Interacting with Shrines of the Wood gives you bark, droping after 2 seconds, creating a healing aura. Guarantee a free Shrine of the Woods spawn."; public override string ItemFullDescription => "After interacting with a Shrine of the Woods, gain a piece of bark that drops after standing still for 2 seconds, healing for 6% (+4% per stack) of your health every second to all allies within 7m (+4m per stack). Guarantee a free Shrine of the Woods spawn."; public override string ItemLore => "umm ,..,., \n uhhhhhh\n uhhhhhhhh .,..,,. \n yeah .,.,.,.,,. \n umm .,.,. \n \n \n \n \n \n the .,,,. um m.,.,,., thats .,,.. uhhhhhhhhh ,..,.,.,, something ..,,. uhh .,., cookie crumbles !!! "; public override ItemTier Tier => (ItemTier)1; public override GameObject ItemModel => butterscotchnroses.carvingKitBundle.LoadAsset("carvingkit.prefab"); public override Sprite ItemIcon => butterscotchnroses.carvingKitBundle.LoadAsset("carvingkit.png"); public override void Init(ConfigFile config) { //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_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0100: 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_016f: Unknown result type (might be due to invalid IL or missing references) //IL_018e: 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_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_01ed: Unknown result type (might be due to invalid IL or missing references) //IL_021d: Unknown result type (might be due to invalid IL or missing references) CreateConfig(config); if (enabled.Value) { CreateLang(); CreateItem(); Hooks(); spawnCard = Object.Instantiate(Addressables.LoadAssetAsync((object)RoR2_Base_ShrineHealing.iscShrineHealing_asset).WaitForCompletion()); ((SpawnCard)spawnCard).prefab = PrefabAPI.InstantiateClone(((SpawnCard)spawnCard).prefab, "WoodToolkitShrine", true); ModelLocator val = default(ModelLocator); MeshRenderer val2 = default(MeshRenderer); if (((SpawnCard)spawnCard).prefab.TryGetComponent(ref val) && ((Component)val.modelTransform).gameObject.TryGetComponent(ref val2)) { ((Renderer)val2).sharedMaterial = woodsMaterial; } ((Component)((Component)mushroomWardPrefab.transform.Find("Indicator")).transform.Find("MushroomMeshes")).gameObject.SetActive(false); GameObject val3 = PrefabAPI.CreateEmptyPrefab("silly", true); val3.transform.SetParent(mushroomWardPrefab.transform); val3.AddComponent(); val3.AddComponent().mesh = Addressables.LoadAssetAsync((object)RoR2_Base_ShrineHealing.mdlShrineHealing_fbx).WaitForCompletion(); ((Object)mushroomWardPrefab).name = "BarkHealWard"; ((Renderer)val3.AddComponent()).material = woodsMaterial; val3.transform.SetParent(mushroomWardPrefab.transform, false); val3.transform.localScale = new Vector3(0.4f, 0.4f, 0.4f); val3.transform.position = val3.transform.localPosition; val3.transform.localPosition = new Vector3(0f, 0f, 0f); Vector3 val4 = default(Vector3); val4.x = 270f; val4.y = 0f; val4.z = 0f; val3.transform.rotation = Quaternion.Euler(val4); PrefabAPI.RegisterNetworkPrefab(mushroomWardPrefab); ModelPanelParameters obj = ItemDef.pickupModelPrefab.AddComponent(); obj.focusPointTransform = new GameObject("FocusPoint").transform; obj.focusPointTransform.SetParent(ItemDef.pickupModelPrefab.transform); obj.cameraPositionTransform = new GameObject("CameraPosition").transform; obj.cameraPositionTransform.SetParent(ItemDef.pickupModelPrefab.transform); } } public override void CreateConfig(ConfigFile config) { enabled = config.Bind("BNR - items", "enable wooden toolkit", true, ""); Utils.CheckboxConfig(enabled); } public override ItemDisplayRuleDict CreateItemDisplayRules() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_0017: 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_0058: 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_0078: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0093: 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_0099: 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_00bc: 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) //IL_00f9: 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_012a: 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_0134: Unknown result type (might be due to invalid IL or missing references) //IL_0135: 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_0158: 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_0195: Unknown result type (might be due to invalid IL or missing references) //IL_01ab: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01d0: Unknown result type (might be due to invalid IL or missing references) //IL_01d1: Unknown result type (might be due to invalid IL or missing references) //IL_01eb: Unknown result type (might be due to invalid IL or missing references) //IL_01f4: Unknown result type (might be due to invalid IL or missing references) //IL_022c: Unknown result type (might be due to invalid IL or missing references) //IL_0231: Unknown result type (might be due to invalid IL or missing references) //IL_0247: Unknown result type (might be due to invalid IL or missing references) //IL_024c: Unknown result type (might be due to invalid IL or missing references) //IL_0262: Unknown result type (might be due to invalid IL or missing references) //IL_0267: Unknown result type (might be due to invalid IL or missing references) //IL_026c: Unknown result type (might be due to invalid IL or missing references) //IL_026d: Unknown result type (might be due to invalid IL or missing references) //IL_0287: Unknown result type (might be due to invalid IL or missing references) //IL_0290: Unknown result type (might be due to invalid IL or missing references) //IL_02c8: Unknown result type (might be due to invalid IL or missing references) //IL_02cd: Unknown result type (might be due to invalid IL or missing references) //IL_02e3: Unknown result type (might be due to invalid IL or missing references) //IL_02e8: Unknown result type (might be due to invalid IL or missing references) //IL_02fe: Unknown result type (might be due to invalid IL or missing references) //IL_0303: Unknown result type (might be due to invalid IL or missing references) //IL_0308: Unknown result type (might be due to invalid IL or missing references) //IL_0309: Unknown result type (might be due to invalid IL or missing references) //IL_0323: Unknown result type (might be due to invalid IL or missing references) //IL_032c: Unknown result type (might be due to invalid IL or missing references) //IL_0364: Unknown result type (might be due to invalid IL or missing references) //IL_0369: Unknown result type (might be due to invalid IL or missing references) //IL_037f: Unknown result type (might be due to invalid IL or missing references) //IL_0384: Unknown result type (might be due to invalid IL or missing references) //IL_039a: Unknown result type (might be due to invalid IL or missing references) //IL_039f: Unknown result type (might be due to invalid IL or missing references) //IL_03a4: Unknown result type (might be due to invalid IL or missing references) //IL_03a5: Unknown result type (might be due to invalid IL or missing references) //IL_03bf: Unknown result type (might be due to invalid IL or missing references) //IL_03c8: Unknown result type (might be due to invalid IL or missing references) //IL_0400: Unknown result type (might be due to invalid IL or missing references) //IL_0405: Unknown result type (might be due to invalid IL or missing references) //IL_041b: Unknown result type (might be due to invalid IL or missing references) //IL_0420: Unknown result type (might be due to invalid IL or missing references) //IL_0436: Unknown result type (might be due to invalid IL or missing references) //IL_043b: Unknown result type (might be due to invalid IL or missing references) //IL_0440: Unknown result type (might be due to invalid IL or missing references) //IL_0441: Unknown result type (might be due to invalid IL or missing references) //IL_045b: Unknown result type (might be due to invalid IL or missing references) //IL_0464: Unknown result type (might be due to invalid IL or missing references) //IL_049c: Unknown result type (might be due to invalid IL or missing references) //IL_04a1: 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_04bc: 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_04d7: Unknown result type (might be due to invalid IL or missing references) //IL_04dc: Unknown result type (might be due to invalid IL or missing references) //IL_04dd: Unknown result type (might be due to invalid IL or missing references) //IL_04f7: Unknown result type (might be due to invalid IL or missing references) //IL_0500: Unknown result type (might be due to invalid IL or missing references) //IL_0538: Unknown result type (might be due to invalid IL or missing references) //IL_053d: Unknown result type (might be due to invalid IL or missing references) //IL_0553: Unknown result type (might be due to invalid IL or missing references) //IL_0558: Unknown result type (might be due to invalid IL or missing references) //IL_056e: Unknown result type (might be due to invalid IL or missing references) //IL_0573: Unknown result type (might be due to invalid IL or missing references) //IL_0578: Unknown result type (might be due to invalid IL or missing references) //IL_0579: 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_059c: Unknown result type (might be due to invalid IL or missing references) //IL_05d4: Unknown result type (might be due to invalid IL or missing references) //IL_05d9: Unknown result type (might be due to invalid IL or missing references) //IL_05ef: Unknown result type (might be due to invalid IL or missing references) //IL_05f4: Unknown result type (might be due to invalid IL or missing references) //IL_060a: Unknown result type (might be due to invalid IL or missing references) //IL_060f: Unknown result type (might be due to invalid IL or missing references) //IL_0614: Unknown result type (might be due to invalid IL or missing references) //IL_0615: Unknown result type (might be due to invalid IL or missing references) //IL_062f: Unknown result type (might be due to invalid IL or missing references) //IL_0638: Unknown result type (might be due to invalid IL or missing references) //IL_0670: Unknown result type (might be due to invalid IL or missing references) //IL_0675: Unknown result type (might be due to invalid IL or missing references) //IL_068b: Unknown result type (might be due to invalid IL or missing references) //IL_0690: Unknown result type (might be due to invalid IL or missing references) //IL_06a6: Unknown result type (might be due to invalid IL or missing references) //IL_06ab: Unknown result type (might be due to invalid IL or missing references) //IL_06b0: Unknown result type (might be due to invalid IL or missing references) //IL_06b1: Unknown result type (might be due to invalid IL or missing references) //IL_06cb: Unknown result type (might be due to invalid IL or missing references) //IL_06d4: Unknown result type (might be due to invalid IL or missing references) //IL_070c: Unknown result type (might be due to invalid IL or missing references) //IL_0711: Unknown result type (might be due to invalid IL or missing references) //IL_0727: Unknown result type (might be due to invalid IL or missing references) //IL_072c: Unknown result type (might be due to invalid IL or missing references) //IL_0742: Unknown result type (might be due to invalid IL or missing references) //IL_0747: Unknown result type (might be due to invalid IL or missing references) //IL_074c: Unknown result type (might be due to invalid IL or missing references) //IL_074d: Unknown result type (might be due to invalid IL or missing references) //IL_0767: Unknown result type (might be due to invalid IL or missing references) //IL_0770: Unknown result type (might be due to invalid IL or missing references) //IL_07a8: Unknown result type (might be due to invalid IL or missing references) //IL_07ad: Unknown result type (might be due to invalid IL or missing references) //IL_07c3: Unknown result type (might be due to invalid IL or missing references) //IL_07c8: Unknown result type (might be due to invalid IL or missing references) //IL_07de: Unknown result type (might be due to invalid IL or missing references) //IL_07e3: Unknown result type (might be due to invalid IL or missing references) //IL_07e8: Unknown result type (might be due to invalid IL or missing references) //IL_07e9: Unknown result type (might be due to invalid IL or missing references) //IL_0803: Unknown result type (might be due to invalid IL or missing references) //IL_080c: Unknown result type (might be due to invalid IL or missing references) //IL_0844: Unknown result type (might be due to invalid IL or missing references) //IL_0849: Unknown result type (might be due to invalid IL or missing references) //IL_085f: Unknown result type (might be due to invalid IL or missing references) //IL_0864: Unknown result type (might be due to invalid IL or missing references) //IL_087a: Unknown result type (might be due to invalid IL or missing references) //IL_087f: Unknown result type (might be due to invalid IL or missing references) //IL_0884: Unknown result type (might be due to invalid IL or missing references) //IL_0885: Unknown result type (might be due to invalid IL or missing references) ItemDisplayRuleDict val = new ItemDisplayRuleDict((ItemDisplayRule[])null); val.Add("mdlRailGunner", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefab = butterscotchnroses.carvingKitBundle.LoadAsset("carvingkit.prefab"), childName = "Backpack", localPos = new Vector3(0.05974f, 0.44328f, -0.06713f), localAngles = new Vector3(322.9341f, 287.1909f, 355.0089f), localScale = new Vector3(1.5f, 1.5f, 1.5f) } }); val.Add("mdlCommandoDualies", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefab = butterscotchnroses.carvingKitBundle.LoadAsset("carvingkit.prefab"), childName = "Chest", localPos = new Vector3(-0.15616f, 0.02484f, 0.21744f), localAngles = new Vector3(24.75113f, 154.4478f, 29.14743f), localScale = new Vector3(1.5f, 1.5f, 1.5f) } }); val.Add("mdlHuntress", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefab = butterscotchnroses.carvingKitBundle.LoadAsset("carvingkit.prefab"), childName = "Chest", localPos = new Vector3(0.10213f, 0.28557f, -0.08592f), localAngles = new Vector3(313.4707f, 238.9671f, 9.71181f), localScale = new Vector3(1.5f, 1.5f, 1.5f) } }); val.Add("mdlBandit2", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefab = butterscotchnroses.carvingKitBundle.LoadAsset("carvingkit.prefab"), childName = "Head", localPos = new Vector3(0.12409f, 0.12659f, 0.00633f), localAngles = new Vector3(338.8037f, 208.6288f, 359.9354f), localScale = new Vector3(1.25f, 1.25f, 1.25f) } }); val.Add("mdlToolbot", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefab = butterscotchnroses.carvingKitBundle.LoadAsset("carvingkit.prefab"), childName = "Head", localPos = new Vector3(-2.09321f, -1.18081f, 0.19419f), localAngles = new Vector3(11.66639f, 34.73956f, 22.98347f), localScale = new Vector3(15f, 15f, 15f) } }); val.Add("mdlEngi", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefab = butterscotchnroses.carvingKitBundle.LoadAsset("carvingkit.prefab"), childName = "MuzzleLeft", localPos = new Vector3(0.21246f, 0.03726f, -0.1504f), localAngles = new Vector3(46.88489f, 146.3901f, 28.93377f), localScale = new Vector3(1.5f, 1.5f, 1.5f) } }); val.Add("mdlMage", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefab = butterscotchnroses.carvingKitBundle.LoadAsset("carvingkit.prefab"), childName = "Chest", localPos = new Vector3(0.13556f, 0.37115f, -0.16788f), localAngles = new Vector3(40.53942f, 286.7667f, 12.42073f), localScale = new Vector3(1.5f, 1.5f, 1.5f) } }); val.Add("mdlMerc", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefab = butterscotchnroses.carvingKitBundle.LoadAsset("carvingkit.prefab"), childName = "Pelvis", localPos = new Vector3(0.23807f, 0.16043f, -0.06301f), localAngles = new Vector3(16.28232f, 337.8073f, 173.7221f), localScale = new Vector3(1.5f, 1.5f, 1.5f) } }); val.Add("mdlLoader", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefab = butterscotchnroses.carvingKitBundle.LoadAsset("carvingkit.prefab"), childName = "Stomach", localPos = new Vector3(-0.00141f, -0.01828f, 0.16358f), localAngles = new Vector3(50.62165f, 260.8247f, 202.5894f), localScale = new Vector3(1.5f, 1.5f, 1.5f) } }); val.Add("mdlCaptain", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefab = butterscotchnroses.carvingKitBundle.LoadAsset("carvingkit.prefab"), childName = "ThighL", localPos = new Vector3(0.14932f, 0.23036f, 0.05693f), localAngles = new Vector3(45.22392f, 147.0988f, 33.90025f), localScale = new Vector3(1.5f, 1.5f, 1.5f) } }); val.Add("mdlVoidSurvivor", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefab = butterscotchnroses.carvingKitBundle.LoadAsset("carvingkit.prefab"), childName = "Chest", localPos = new Vector3(0.12025f, 0.28464f, -0.28027f), localAngles = new Vector3(331.8245f, 17.92445f, 5.85052f), localScale = new Vector3(1f, 1f, 1f) } }); val.Add("mdlSeeker", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefab = butterscotchnroses.carvingKitBundle.LoadAsset("carvingkit.prefab"), childName = "ThighL", localPos = new Vector3(0.15079f, 0.10885f, -0.06823f), localAngles = new Vector3(38.52636f, 250.9131f, 49.66542f), localScale = new Vector3(1f, 1f, 1f) } }); val.Add("mdlDroneTech", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefab = butterscotchnroses.carvingKitBundle.LoadAsset("carvingkit.prefab"), childName = "Backpack", localPos = new Vector3(-0.14376f, 0.3951f, -0.15703f), localAngles = new Vector3(338.5279f, 44.73534f, 33.90535f), localScale = new Vector3(-1.25f, 1.25f, 1.25f) } }); val.Add("mdlDrifter", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefab = butterscotchnroses.carvingKitBundle.LoadAsset("carvingkit.prefab"), childName = "BagFrontPocket", localPos = new Vector3(-0.13831f, 0.50942f, 0.03021f), localAngles = new Vector3(351.2845f, 87.4438f, 42.2401f), localScale = new Vector3(-1.5f, 1.5f, 1.5f) } }); return val; } public override void Hooks() { SceneDirector.onPostPopulateSceneServer += SceneDirectorOnonPostPopulateSceneServer; } private void SceneDirectorOnonPostPopulateSceneServer(SceneDirector obj) { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Expected O, but got Unknown //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Expected O, but got Unknown //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Expected O, but got Unknown //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Expected O, but got Unknown //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Expected O, but got Unknown //IL_00ee: Unknown result type (might be due to invalid IL or missing references) if (!SceneInfo.instance.countsAsStage && !SceneInfo.instance.sceneDef.allowItemsToSpawnObjects) { return; } bool flag = false; Xoroshiro128Plus val = new Xoroshiro128Plus(obj.rng.nextUlong); foreach (CharacterMaster readOnlyInstances in CharacterMaster.readOnlyInstancesList) { if (readOnlyInstances.inventory.GetItemCountEffective(ItemBase.instance.ItemDef) > 0) { flag = true; } } if (!flag) { return; } if (SceneInfo.instance.sceneDef.cachedName == "moon2") { GameObject val2 = DirectorCore.instance.TrySpawnObject(new DirectorSpawnRequest((SpawnCard)(object)spawnCard, new DirectorPlacementRule { placementMode = (PlacementMode)4 }, val)); if (!((Object)(object)val2 == (Object)null)) { PurchaseInteraction val3 = default(PurchaseInteraction); if (val2.TryGetComponent(ref val3)) { val3.Networkcost = Run.instance.GetDifficultyScaledCost(0); } val2.transform.position = new Vector3(-261.1643f, 497.2451f, -173.4794f); } } else { GameObject val4 = DirectorCore.instance.TrySpawnObject(new DirectorSpawnRequest((SpawnCard)(object)spawnCard, new DirectorPlacementRule { placementMode = (PlacementMode)4 }, val)); PurchaseInteraction val5 = default(PurchaseInteraction); if (!((Object)(object)val4 == (Object)null) && val4.TryGetComponent(ref val5)) { val5.Networkcost = Run.instance.GetDifficultyScaledCost(0); } } } } internal class WoodToolkitBuff : BuffBase { internal override string name => "Bark"; internal override Sprite icon => butterscotchnroses.carvingKitBundle.LoadAsset("carvingkit.png"); internal override Color color => Utils.Color255(191, 126, 211); internal override bool canStack => false; internal override bool isDebuff => false; internal override EliteDef eliteDef => null; } }