using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Drawing; 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 AllyNames; using BNR; using BNR.items; using BNR.patches; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using CoolerEclipse; using DebuggingPlains; 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.EntityStates.JunkCube; using On.RoR2; using On.RoR2.Hologram; using On.RoR2.UI; using On.RoR2.UI.SkinControllers; using PhotoMode; using R2API; using Rewired; using RiskOfOptions; using RiskOfOptions.OptionConfigs; using RiskOfOptions.Options; using RoR2; using RoR2.ConVar; using RoR2.Hologram; using RoR2.Items; 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 UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.Events; using UnityEngine.Networking; using UnityEngine.Rendering.PostProcessing; using UnityEngine.ResourceManagement.AsyncOperations; using UnityEngine.SceneManagement; using UnityEngine.UI; using butterscotchnroses; [assembly: AssemblyTitle("butterscotchnroses")] [assembly: AssemblyProduct("butterscotchnroses")] [assembly: AssemblyInformationalVersion("1.0.0+f6676ca7adceafe8f8bc541ea4598e8487290979")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyCompany("butterscotchnroses")] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: OptIn] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: CompilationRelaxations(8)] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] [Microsoft.CodeAnalysis.Embedded] [CompilerGenerated] 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 i = 0; i < num; i++) { array[i] = 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 = "goldshores,bazaar,solutionalhaunt,ss2_voidshop,goldshores"; if (coolereclipse.blacklistStages.Value == text2) { coolereclipse.blacklistStages.Value = (string)((ConfigEntryBase)coolereclipse.blacklistStages).DefaultValue; } string text3 = "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 == text3) { allynames.bodyNames.Value = (string)((ConfigEntryBase)allynames.bodyNames).DefaultValue; } } } } } namespace BNR { [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInPlugin("zzzicebro.BNR", "BNR", "0.2.1")] 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.2.1"; public static AssetBundle carvingKitBundle; public static butterscotchnroses instance; public static List patchBases = new List(); public static Harmony harmony; public void Awake() { //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown instance = this; Log.Init(((BaseUnityPlugin)this).Logger); ((BaseUnityPlugin)this).Logger.LogDebug((object)"loading mod !!"); carvingKitBundle = AssetBundle.LoadFromFile(Path.Combine(Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location), "carvingkit_assets")); ((MonoBehaviour)this).StartCoroutine(ShaderSwapper.UpgradeStubbedShadersAsync(carvingKitBundle)); 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); } } 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); } CheatsConVar.instance.boolValue = true; oldconfigs.fixOldConfigs(); } private void 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) { _logSource.LogDebug(data); } internal static void Error(object data) { _logSource.LogError(data); } internal static void Fatal(object data) { _logSource.LogFatal(data); } internal static void Info(object data) { _logSource.LogInfo(data); } internal static void Message(object data) { _logSource.LogMessage(data); } internal static void Warning(object data) { _logSource.LogWarning(data); } } public class 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_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Expected O, but got Unknown //IL_007e: 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: Expected O, but got Unknown //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Expected O, but got Unknown //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Expected O, but got Unknown //IL_0141: 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_0164: 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 drifter : PatchBase { private ConfigEntry enabled; private ConfigEntry neverKillCubes; private ConfigEntry cubeCount; public override void Init() { if (enabled.Value) { applyHooks(); } } public void applyHooks() { //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) { 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_0082: 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_00a6: Expected O, but got Unknown //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: 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 malachite : PatchBase { private ConfigEntry enabled; public static ConfigEntry timeBetweenSpawns; 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) { 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 !!"); } private void FixedUpdate() { //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0075: 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_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: 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_00d7: 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_00fd: 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 !!"); if (!Object.op_Implicit((Object)(object)_characterBody) || !_characterBody.HasBuff(Buffs.AffixPoison)) { Log.Debug("uh oh,,"); 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_005e: 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_0082: Expected O, but got Unknown //IL_00a2: 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_00c6: Expected O, but got Unknown //IL_00e6: 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_010a: Expected O, but got Unknown //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_014e: 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 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 !"); ((MonoBehaviour)this).StartCoroutine(LoadTextures()); } } [CompilerGenerated] private sealed class d__9 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; private string[] <>7__wrap1; private int <>7__wrap2; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__9(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>7__wrap1 = null; <>1__state = -2; } private bool MoveNext() { //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: { <>1__state = -1; string[] files = Directory.GetFiles(textureDirs, "*.*", SearchOption.AllDirectories); <>7__wrap1 = files; <>7__wrap2 = 0; break; } case 1: <>1__state = -1; <>7__wrap2++; break; } if (<>7__wrap2 < <>7__wrap1.Length) { string text = <>7__wrap1[<>7__wrap2]; Stopwatch stopwatch = new Stopwatch(); stopwatch.Start(); byte[] array = File.ReadAllBytes(text); Texture2D val = new Texture2D(2, 2); ImageConversion.LoadImage(val, array); Log.Debug(string.Format("loaded {0} in {1}ms !! adding to recoloredTextures ,.,.", text.Split("\\")[^1], stopwatch.ElapsedMilliseconds)); recoloredTextures.Add(text.Split("\\")[^1], val); <>2__current = null; <>1__state = 1; return true; } <>7__wrap1 = null; return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__14 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public orig_Init orig; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__14(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: { <>1__state = -1; Stopwatch stopwatch = Stopwatch.StartNew(); stopwatch.Start(); RecolorSkins(); Log.Debug(string.Format("recolored {0} skins in {1}ms !!!", skinRecolors.Value.Split(";;").Length, stopwatch.ElapsedMilliseconds)); <>2__current = orig.Invoke(); <>1__state = 1; return true; } case 1: <>1__state = -1; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__11 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public orig_Start orig; public Stage self; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__11(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; commands.bodyNameToPrev.Clear(); <>2__current = orig.Invoke(self); <>1__state = 1; return true; case 1: <>1__state = -1; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public static SkinDef baseSkinName; 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 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); } [IteratorStateMachine(typeof(d__9))] private static IEnumerator LoadTextures() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__9(0); } 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); } } [IteratorStateMachine(typeof(d__11))] private IEnumerator StageOnStart(orig_Start orig, Stage self) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__11(0) { orig = orig, self = self }; } private void RunOnBeginStage(orig_BeginStage orig, Run self) { orig.Invoke(self); commands.bodyNameToPrev.Clear(); } private static void RunOnonRunStartGlobal(Run obj) { commands.bodyNameToPrev.Clear(); } [IteratorStateMachine(typeof(d__14))] private IEnumerator SkinCatalogOnInit(orig_Init orig) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__14(0) { orig = orig }; } 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] : ""); } 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) { //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_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Expected O, but got Unknown //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: 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_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_0271: Unknown result type (might be due to invalid IL or missing references) //IL_0276: Unknown result type (might be due to invalid IL or missing references) //IL_01ca: Unknown result type (might be due to invalid IL or missing references) //IL_01cf: 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_0208: 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_02d1: Unknown result type (might be due to invalid IL or missing references) //IL_02d6: 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); 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 mat2 = Object.Instantiate(((Object)(object)val6.rendererInfos[k].defaultMaterial == (Object)null) ? val6.rendererInfos[k].defaultMaterialAddress.LoadAssetAsync().WaitForCompletion() : val6.rendererInfos[k].defaultMaterial); val6.rendererInfos[k].defaultMaterial = Utils.RecolorMaterial(mat2, hue, saturation, value, dontAdd); 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 + " !!!!"); result = val3; } catch (Exception data) { Log.Warning("faileds to add " + skinName + " skin to " + bodyName + " ,.,.,."); Log.Error(data); } return result; } 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", "skinCommandoAlt,CommandoBody,100,0,0,Test Skin;;skinCommandoAlt,CommandoBody,200,0,0,Test Skin 2;;skinCommandoDefault,CommandoBody,290,-40,-10,Awesome Skin !!!!", "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 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_006c: 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}"); 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_005a: 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_007d: 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 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 !!"); 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_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) 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}"); 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 !!"); 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 !!"); orig.Invoke(self); return false; } } } Log.Debug($"test eclipse !! rng {num} < {eclipseChance.Value} ,,,.. applying ? {(float)num > eclipseChance.Value}"); if ((float)num > eclipseChance.Value) { orig.Invoke(self); return false; } return true; } Log.Debug("unable to find eclipse handler !! "); orig.Invoke(self); return false; } [HarmonyPostfix] [HarmonyPatch(typeof(CoolerEclipse), "AddSkybox")] public static void CoolerEclipseAddSkyboxPostFix(orig_Start orig, SceneDirector self) { //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_011c: 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_01ca: Unknown result type (might be due to invalid IL or missing references) //IL_01cf: Unknown result type (might be due to invalid IL or missing references) //IL_01e7: Unknown result type (might be due to invalid IL or missing references) //IL_01ec: Unknown result type (might be due to invalid IL or missing references) //IL_0201: Unknown result type (might be due to invalid IL or missing references) //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_0242: 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_025f: Unknown result type (might be due to invalid IL or missing references) //IL_0264: Unknown result type (might be due to invalid IL or missing references) //IL_0269: Unknown result type (might be due to invalid IL or missing references) //IL_027e: Unknown result type (might be due to invalid IL or missing references) //IL_0283: Unknown result type (might be due to invalid IL or missing references) //IL_0288: Unknown result type (might be due to invalid IL or missing references) //IL_0466: Unknown result type (might be due to invalid IL or missing references) //IL_046b: Unknown result type (might be due to invalid IL or missing references) //IL_0493: Unknown result type (might be due to invalid IL or missing references) //IL_0498: 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}"); 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 !! "); } } } 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_0062: 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_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_00c4: 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) if (applyCE.Value) { butterscotchnroses.harmony.CreateClassProcessor(typeof(CoolerEclipseChanges)).Patch(); Run.onRunStartGlobal += RunOnonRunStartGlobal; Log.Debug("ptached cooler eclipse !!"); 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 static int kListeclipseRNGs; private static int kListpinkEclipses; private void Awake() { Object.DontDestroyOnLoad((Object)(object)this); ((SyncList)(object)eclipseRNGs).InitializeBehaviour((NetworkBehaviour)(object)this, kListeclipseRNGs); ((SyncList)(object)pinkEclipses).InitializeBehaviour((NetworkBehaviour)(object)this, kListpinkEclipses); } 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}"); int num2 = Run.instance.runRNG.RangeInt(0, 100); Log.Debug($"pink rng {(float)num2 > coolereclipse.pinkEclipseChance.Value}"); ((SyncList)(object)eclipseRNGs).Add(num); ((SyncList)(object)pinkEclipses).Add((float)num2 > coolereclipse.pinkEclipseChance.Value); } return orig.Invoke(self); } private void UNetVersion() { } protected static void InvokeSyncListeclipseRNGs(NetworkBehaviour obj, NetworkReader reader) { if (!NetworkClient.active) { Debug.LogError((object)"SyncList eclipseRNGs called on server."); } else { ((SyncList)(object)((EclipseNetworkBehavior)(object)obj).eclipseRNGs).HandleMsg(reader); } } protected static void InvokeSyncListpinkEclipses(NetworkBehaviour obj, NetworkReader reader) { if (!NetworkClient.active) { Debug.LogError((object)"SyncList pinkEclipses called on server."); } else { ((SyncList)(object)((EclipseNetworkBehavior)(object)obj).pinkEclipses).HandleMsg(reader); } } static EclipseNetworkBehavior() { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Expected O, but got Unknown //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown kListeclipseRNGs = -1395580364; NetworkBehaviour.RegisterSyncListDelegate(typeof(EclipseNetworkBehavior), kListeclipseRNGs, new CmdDelegate(InvokeSyncListeclipseRNGs)); kListpinkEclipses = 477959197; NetworkBehaviour.RegisterSyncListDelegate(typeof(EclipseNetworkBehavior), kListpinkEclipses, new CmdDelegate(InvokeSyncListpinkEclipses)); NetworkCRC.RegisterBehaviour("EclipseNetworkBehavior", 0); } public override bool OnSerialize(NetworkWriter writer, bool forceAll) { if (forceAll) { SyncListInt.WriteInstance(writer, eclipseRNGs); SyncListBool.WriteInstance(writer, pinkEclipses); return true; } bool flag = false; if ((((NetworkBehaviour)this).syncVarDirtyBits & (true ? 1u : 0u)) != 0) { if (!flag) { writer.WritePackedUInt32(((NetworkBehaviour)this).syncVarDirtyBits); flag = true; } SyncListInt.WriteInstance(writer, eclipseRNGs); } if ((((NetworkBehaviour)this).syncVarDirtyBits & 2u) != 0) { if (!flag) { writer.WritePackedUInt32(((NetworkBehaviour)this).syncVarDirtyBits); flag = true; } SyncListBool.WriteInstance(writer, pinkEclipses); } if (!flag) { writer.WritePackedUInt32(((NetworkBehaviour)this).syncVarDirtyBits); } return flag; } public override void OnDeserialize(NetworkReader reader, bool initialState) { if (initialState) { SyncListInt.ReadReference(reader, eclipseRNGs); SyncListBool.ReadReference(reader, pinkEclipses); return; } int num = (int)reader.ReadPackedUInt32(); if (((uint)num & (true ? 1u : 0u)) != 0) { SyncListInt.ReadReference(reader, eclipseRNGs); } if (((uint)num & 2u) != 0) { SyncListBool.ReadReference(reader, pinkEclipses); } } } public class debugplains : PatchBase { [HarmonyPatch] public class DebuggingPlainsChanges { private static bool autoVote; private static bool autoMenu; private static bool autoPlains; private static bool autoCharacter; [HarmonyPrefix] [HarmonyPatch(typeof(DebuggingPlains), "PreGameRuleVoteController_ServerHandleClientVoteUpdate")] public static bool PreGameRuleVoteController_ServerHandleClientVoteUpdate(DebuggingPlains __instance) { if (!preventRepeatEnters.Value) { return true; } if (autoVote) { return false; } autoVote = true; return true; } [HarmonyPatch(typeof(DebuggingPlains), "Stage_RespawnCharacter")] [HarmonyPrefix] public static bool Stage_RespawnCharacter(DebuggingPlains __instance) { if (!preventRepeatEnters.Value) { return true; } if (autoCharacter) { return false; } autoCharacter = true; return true; } [HarmonyPatch(typeof(DebuggingPlains), "MainMenuController_UpdateMenuTransition")] [HarmonyPrefix] public static bool MainMenuController_UpdateMenuTransition(DebuggingPlains __instance) { if (!preventRepeatEnters.Value) { return true; } if (autoMenu) { return false; } autoMenu = true; return true; } [HarmonyPatch(typeof(DebuggingPlains), "Run_PickNextStageScene")] [HarmonyPrefix] public static bool Run_PickNextStageScene(DebuggingPlains __instance, orig_PickNextStageScene orig, Run self, WeightedSelection choices) { //IL_00c6: 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) if (!preventRepeatEnters.Value) { return true; } if (autoPlains) { WeightedSelection val = new WeightedSelection(8); string @string = ((BaseConVar)Run.cvRunSceneOverride).GetString(); val.AddChoice(SceneCatalog.GetSceneDefFromSceneName(@string), 1f); if (Object.op_Implicit((Object)(object)Run.instance.startingSceneGroup)) { Run.instance.startingSceneGroup.AddToWeightedSelection(val, (Func)Run.instance.CanPickStage); } else { for (int i = 0; i < Run.instance.startingScenes.Length; i++) { if (Run.instance.CanPickStage(Run.instance.startingScenes[i])) { val.AddChoice(Run.instance.startingScenes[i], 1f); } } } if (choices.Count != 0) { if ((int)Run.instance.ruleBook.stageOrder == 0) { Run.instance.nextStageScene = choices.Evaluate(Run.instance.nextStageRng.nextNormalizedFloat); return false; } SceneDef[] array = ((IEnumerable)(object)SceneCatalog.allStageSceneDefs).Where(IsValidNextStage).ToArray(); Run.instance.nextStageScene = Run.instance.nextStageRng.NextElementUniform(array); } return false; } autoPlains = true; return true; static bool IsValidNextStage(SceneDef sceneDef) { if ((Object)(object)Run.instance.nextStageScene != (Object)null && Run.instance.nextStageScene.baseSceneName == sceneDef.baseSceneName) { return false; } if (!sceneDef.hasAnyDestinations) { return false; } if (Run.instance.stageClearCount == 0 && Run.instance.blacklistedScenesForFirstScene.Contains(sceneDef)) { return false; } return sceneDef.validForRandomSelection; } } } private static ConfigEntry enabled; private static ConfigEntry preventRepeatEnters; public override string chainLoaderKey => "com.Dragonyck.DebuggingPlains"; public override void Init() { if (enabled.Value) { butterscotchnroses.harmony.CreateClassProcessor(typeof(DebuggingPlainsChanges)).Patch(); } } public override void Config(ConfigFile config) { enabled = config.Bind("Mods - debugging plains", "enable patches for debugging plains", true, ""); Utils.CheckboxConfig(enabled); preventRepeatEnters = config.Bind("Mods - debugging plains", "prevent re-entering debugging plains", true, "like uhh you know when you just want to switch skills or skins or something and the chud mod puts you back in yeah it fixes that ,,."); Utils.CheckboxConfig(preventRepeatEnters); } } 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_0195: 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_01a9: 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_028e: 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 !"); 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 j = 0; j < val8.rendererInfos.Length; j++) { val8.rendererInfos[j].defaultMaterial = val5; Log.Debug($"defualt address = {val8.rendererInfos[j].defaultMaterialAddress}"); } 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 "); 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 { [HarmonyILManipulator] [HarmonyPatch(typeof(Body), "BodyChanges")] public static void OnEnterPostFix(ILContext il) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Expected O, but got Unknown if (noBeetleStun.Value) { Log.Debug("ilh ook hate beetle grahhhhh"); 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 photomode : PatchBase { [HarmonyPatch] public class PhotomodeChanges { private static bool timeStop; public static float prevTimeScale = -1f; [HarmonyPrefix] [HarmonyPatch(typeof(PhotoModeController), "Update")] public static bool UpdatePrefix(PhotoModeController __instance) { //IL_02b2: Unknown result type (might be due to invalid IL or missing references) //IL_02b9: Unknown result type (might be due to invalid IL or missing references) //IL_02be: Unknown result type (might be due to invalid IL or missing references) //IL_02e6: Unknown result type (might be due to invalid IL or missing references) //IL_02f1: Unknown result type (might be due to invalid IL or missing references) //IL_02f6: Unknown result type (might be due to invalid IL or missing references) //IL_02f8: Unknown result type (might be due to invalid IL or missing references) //IL_0302: Unknown result type (might be due to invalid IL or missing references) //IL_030c: Unknown result type (might be due to invalid IL or missing references) //IL_0311: Unknown result type (might be due to invalid IL or missing references) //IL_0316: 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_033c: Unknown result type (might be due to invalid IL or missing references) //IL_0341: Unknown result type (might be due to invalid IL or missing references) //IL_0345: Unknown result type (might be due to invalid IL or missing references) //IL_02cc: Unknown result type (might be due to invalid IL or missing references) //IL_02d3: Unknown result type (might be due to invalid IL or missing references) //IL_02d8: Unknown result type (might be due to invalid IL or missing references) //IL_0392: Unknown result type (might be due to invalid IL or missing references) //IL_0360: Unknown result type (might be due to invalid IL or missing references) //IL_0380: Unknown result type (might be due to invalid IL or missing references) //IL_0385: Unknown result type (might be due to invalid IL or missing references) if (!noConsoleCamMovement.Value) { return true; } UserProfile userProfile = __instance.cameraRigController.localUserViewer.userProfile; Player inputPlayer = __instance.cameraRigController.localUserViewer.inputPlayer; if (inputPlayer.GetButton(25)) { __instance.ExitPhotoMode(); return false; } if (timeStop) { prevTimeScale = Time.timeScale; Time.timeScale = 0f; timeStop = false; } ConsoleWindow instance = ConsoleWindow.instance; if (Object.op_Implicit((Object)(object)((instance != null) ? ((Component)instance).gameObject : null))) { return false; } float mouseLookSensitivity = userProfile.mouseLookSensitivity; float mouseLookScaleX = userProfile.mouseLookScaleX; float mouseLookScaleY = userProfile.mouseLookScaleY; float axis = inputPlayer.GetAxis(23); float axis2 = inputPlayer.GetAxis(24); float num = 1f; if (__instance.gamepad) { num = 10f; } if ((__instance.gamepad && inputPlayer.GetButton(9)) || Input.GetMouseButton(1)) { __instance.cameraState.fov = Mathf.Clamp(__instance.Camera.fieldOfView + mouseLookSensitivity * Time.unscaledDeltaTime * axis2 * num, 4f, 120f); } if ((__instance.gamepad && inputPlayer.GetButton(10)) || Input.GetMouseButton(2)) { __instance.cameraState.roll += (0f - mouseLookScaleX) * mouseLookSensitivity * Time.unscaledDeltaTime * axis * num; } else { float num2 = mouseLookScaleX * mouseLookSensitivity * Time.unscaledDeltaTime * axis * num; float num3 = mouseLookScaleY * mouseLookSensitivity * Time.unscaledDeltaTime * axis2 * num; __instance.ConditionalNegate(ref num2, userProfile.mouseLookInvertX); __instance.ConditionalNegate(ref num3, userProfile.mouseLookInvertY); float num4 = __instance.cameraState.roll * (MathF.PI / 180f); __instance.cameraState.yaw += __instance.cameraState.fov * (num2 * Mathf.Cos(num4) - num3 * Mathf.Sin(num4)); __instance.cameraState.pitch += __instance.cameraState.fov * ((0f - num3) * Mathf.Cos(num4) - num2 * Mathf.Sin(num4)); __instance.cameraState.pitch = Mathf.Clamp(__instance.cameraState.pitch, -89f, 89f); } Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(inputPlayer.GetAxis(0) * num, 0f, inputPlayer.GetAxis(1) * num); if ((__instance.gamepad && inputPlayer.GetButton(7)) || Input.GetKey((KeyCode)113)) { val.y -= 1f; } if ((__instance.gamepad && inputPlayer.GetButton(8)) || Input.GetKey((KeyCode)101)) { val.y += 1f; } ((Vector3)(ref val)).Normalize(); if (inputPlayer.GetButton("Sprint")) { val *= PhotoModeController.cameraSprintMultiplier; } if (Input.GetKey((KeyCode)306)) { val *= PhotoModeController.cameraSlowMultiplier; } ref Vector3 position = ref __instance.cameraState.position; position += ((PhotoModeCameraState)(ref __instance.cameraState)).Rotation * val * Time.unscaledDeltaTime * PhotoModeController.cameraSpeed; ((Component)__instance.Camera).transform.position = __instance.cameraState.position; Quaternion val2 = ((PhotoModeCameraState)(ref __instance.cameraState)).Rotation; if ((double)Mathf.Abs(((Quaternion)(ref val2)).eulerAngles.z) < 2.0) { val2 = QuaternionExtension.WithEulerAngles(val2, (float?)null, (float?)null, (float?)0f); } ((Component)__instance.Camera).transform.rotation = val2; __instance.Camera.fieldOfView = __instance.cameraState.fov; return false; } [HarmonyPostfix] [HarmonyPatch(typeof(PhotoModeController), "SetupPhotoModeHUD")] public static void PhotomodePrefix(PhotoModeController __instance) { timeStop = true; } [HarmonyPatch(typeof(PhotoModeController), "ExitPhotoMode")] [HarmonyPostfix] public static void PhotomodePost(PhotoModeController __instance) { if (keepPreviousTimescale.Value) { Time.timeScale = prevTimeScale; } } [HarmonyPatch(typeof(PhotoModePlugin), "SetupPhotoModeButton")] [HarmonyPrefix] public static bool PhotomodePostButton(PhotoModePlugin __instance, PauseScreenController pauseScreenController) { //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Expected O, but got Unknown ButtonSkinController componentInChildren = ((Component)pauseScreenController).GetComponentInChildren(); GameObject val = ((componentInChildren != null) ? ((Component)componentInChildren).gameObject : null); if ((Object)(object)val == (Object)null) { return false; } GameObject val2 = Object.Instantiate(val, val.transform.parent); if ((Object)(object)val2 == (Object)null) { return false; } ((Object)val2).name = "GenericMenuButton (Photo mode)"; val2.SetActive(true); ButtonSkinController component = val2.GetComponent(); if ((Object)(object)component == (Object)null) { return false; } ((Component)component).GetComponent().token = "Photo mode"; HGButton component2 = val2.GetComponent(); if ((Object)(object)component2 == (Object)null) { return false; } ((Selectable)component2).interactable = __instance.cameraRigController.localUserViewer != null; ((UnityEvent)((Button)component2).onClick).AddListener((UnityAction)delegate { //IL_0005: Unknown result type (might be due to invalid IL or missing references) new GameObject("PhotoModeController").AddComponent().EnterPhotoMode(pauseScreenController, __instance.cameraRigController); }); val2.transform.SetSiblingIndex(PhotoModePlugin.buttonPlacement.Value); return false; } } private static ConfigEntry enabled; private static ConfigEntry noConsoleCamMovement; private static ConfigEntry keepPreviousTimescale; public override string chainLoaderKey => "com.cwmlolzlz.photomode"; public override void Init() { if (enabled.Value) { butterscotchnroses.harmony.CreateClassProcessor(typeof(PhotomodeChanges)).Patch(); } } public override void Config(ConfigFile config) { enabled = config.Bind("Mods - photomode", "enable patches for photomode", true, ""); Utils.CheckboxConfig(enabled); noConsoleCamMovement = config.Bind("Mods - photomode", "disable cam movement on console open", true, "doesnt move the camera around when you have the console open ,,. helpful when testing material edits with runtime material inspector @!!!!"); Utils.CheckboxConfig(noConsoleCamMovement); keepPreviousTimescale = config.Bind("Mods - photomode", "keep previous timescale exiting photomode", true, "like !! if your time_scale was 0.3 going in ,.,. 0.3 going out !! instead of resetting back to 1 ,,."); Utils.CheckboxConfig(keepPreviousTimescale); } } 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_0057: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_01a6: 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)) || (Object)(object)Items.IceTool == (Object)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)}"); component2.SetFrozen(iceToolFreezeTime.Value + iceToolFreezeTimeStack.Value * (float)(itemCountEffective - 1)); } else { Log.Debug($"failed to freeze {self.body}"); } 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 EmColor = Shader.PropertyToID("_EmColor"); private static readonly int _Color = Shader.PropertyToID("_Color"); private static readonly int TintColor = Shader.PropertyToID("_TintColor"); 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) { //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 CheckBoxConfig val = new CheckBoxConfig(); 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) { //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Expected O, but got Unknown //IL_0244: 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_025c: 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_0274: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_013f: 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_0191: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Unknown result type (might be due to invalid IL or missing references) //IL_019a: Unknown result type (might be due to invalid IL or missing references) //IL_01aa: Unknown result type (might be due to invalid IL or missing references) //IL_01ac: Unknown result type (might be due to invalid IL or missing references) string path = $"{skinrecolors.textureDirs}\\{((Object)texture).name}_RecolorH{hueShift}S{saturation}V{value}.png"; Texture2D val; if (skinrecolors.recoloredTextures.TryGetValue($"{((Object)texture).name}_RecolorH{hueShift}S{saturation}V{value}.png", out var value2)) { Log.Debug($"found {((Object)texture).name}_RecolorH{hueShift}S{saturation}V{value}.png in recolored texture dict !!"); val = value2; } else if (File.Exists(path)) { Stopwatch stopwatch = new Stopwatch(); stopwatch.Start(); byte[] array = File.ReadAllBytes(path); val = new Texture2D(2, 2); ImageConversion.LoadImage(val, array); Log.Debug($"loaded return texture in {stopwatch.ElapsedMilliseconds}ms !!! {((Object)texture).name}"); } 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 += saturation / 100f; 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}"); 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) { //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_0152: 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_0170: Unknown result type (might be due to invalid IL or missing references) //IL_0220: Unknown result type (might be due to invalid IL or missing references) //IL_01df: Unknown result type (might be due to invalid IL or missing references) //IL_01e4: Unknown result type (might be due to invalid IL or missing references) //IL_01ee: Unknown result type (might be due to invalid IL or missing references) //IL_0203: Unknown result type (might be due to invalid IL or missing references) //IL_0273: Unknown result type (might be due to invalid IL or missing references) //IL_0278: 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_0297: Unknown result type (might be due to invalid IL or missing references) 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)); } 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)); } 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)); } if (mat.HasColor(EmColor)) { float num = default(float); float num2 = default(float); float num3 = default(float); Color.RGBToHSV(mat.GetColor(EmColor), ref num, ref num2, ref num3); num = (num + hue / 360f) % 1f; if (num < 0f) { num += 1f; } num2 += saturation / 100f; num3 += value / 100f; Color val4 = Color.HSVToRGB(num, num2, num3); val4.a = mat.GetColor(EmColor).a; mat.SetColor(EmColor, val4); } if (mat.HasColor(_Color)) { float num4 = default(float); float num5 = default(float); float num6 = default(float); Color.RGBToHSV(mat.GetColor(_Color), ref num4, ref num5, ref num6); num4 = (num4 + hue / 360f) % 1f; if (num4 < 0f) { num4 += 1f; } num5 += saturation / 100f; num6 += value / 100f; Color val5 = Color.HSVToRGB(num4, num5, num6); val5.a = mat.GetColor(_Color).a; mat.SetColor(_Color, val5); } if (mat.HasColor(TintColor)) { float num7 = default(float); float num8 = default(float); float num9 = default(float); Color.RGBToHSV(mat.GetColor(TintColor), ref num7, ref num8, ref num9); num7 = (num7 + hue / 360f) % 1f; if (num7 < 0f) { num7 += 1f; } num8 += saturation / 100f; num9 += value / 100f; Color val6 = Color.HSVToRGB(num7, num8, num9); val6.a = mat.GetColor(TintColor).a; mat.SetColor(TintColor, val6); } return mat; } 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(); private static List sounds = new List(); [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[6] { ((Object)skinrecolors.baseSkinName).name, 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; skinRecolors.Value = value + string.Format(";;{0},{1},{2},{3},{4},{5}", obj); object[] obj2 = new object[6] { ((Object)skinrecolors.baseSkinName).name, 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; Debug.Log((object)string.Format("added ;;{0},{1},{2},{3},{4},{5} 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; 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]); } } 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]); } } SkinDef val = skinrecolors.skinRecolor(((Object)obj).name, ((Object)((ConCommandArgs)(ref args)).senderBody).name, result, num2, num3, "temp", "", dontAdd: true); 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; } [ConCommand(/*Could not decode attribute arguments.*/)] public static void akplaysound(ConCommandArgs args) { //IL_003c: Unknown result type (might be due to invalid IL or missing references) Debug.Log((object)("args = " + ((ConCommandArgs)(ref args))[0])); Debug.Log((object)$"sender body = {((ConCommandArgs)(ref args)).senderBody}"); uint num = AkSoundEngine.PostEvent(((ConCommandArgs)(ref args))[0], ((Component)((ConCommandArgs)(ref args)).senderBody).gameObject); Debug.Log((object)$"sound id = {num}"); sounds.Add(num); } [ConCommand(/*Could not decode attribute arguments.*/)] public static void akstopsound(ConCommandArgs args) { Debug.Log((object)$"sender body = {((ConCommandArgs)(ref args)).senderBody}"); foreach (uint item in sounds.ToList()) { AkSoundEngine.StopPlayingID(item); Debug.Log((object)$"stopped sound {item} !!!"); sounds.Remove(item); } } [ConCommand(/*Could not decode attribute arguments.*/)] [ConCommand(/*Could not decode attribute arguments.*/)] public static void spawnEffect(ConCommandArgs args) { //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_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: 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_00d6: Expected O, but got Unknown float scale = 1f; if (((ConCommandArgs)(ref args)).Count > 1) { scale = Convert.ToSingle(((ConCommandArgs)(ref args))[1]); } Debug.Log((object)("args = " + ((ConCommandArgs)(ref args))[0] + " " + scale)); EffectDef val = null; EffectDef[] entries = EffectCatalog.entries; foreach (EffectDef val2 in entries) { if (val2.prefabName.Contains(((ConCommandArgs)(ref args))[0])) { val = val2; break; } } if (val == null) { Log.Warning("couldnt find effect " + ((ConCommandArgs)(ref args))[0] + " !!!"); return; } EffectManager.SpawnEffect(val.index, new EffectData { origin = ((ConCommandArgs)(ref args)).senderBody.transform.position, scale = scale, rotation = Util.QuaternionSafeLookRotation(Vector3.up) }, true); } } 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 ,.,,."); } } public abstract void Init(); public abstract void Config(ConfigFile config); public virtual void Hooks() { } public virtual void FixedUpdate() { } } } 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; } } 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; } }