using System; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BoosterImplants; using Clonesoft.Json; using Clonesoft.Json.Linq; using DropServer.BoosterImplants; using GameData; using Hikaria.BoosterTweaker.Detours; using Hikaria.BoosterTweaker.Features; using Hikaria.BoosterTweaker.Managers; using Hikaria.Core.Detour; using Il2CppInterop.Runtime.InteropTypes.Arrays; using Il2CppInterop.Runtime.Runtime; using Il2CppSystem.Collections.Generic; using Localization; using TheArchive.Core; using TheArchive.Core.Attributes; using TheArchive.Core.Attributes.Feature; using TheArchive.Core.Attributes.Feature.Members; using TheArchive.Core.Attributes.Feature.Patches; using TheArchive.Core.Attributes.Feature.Settings; using TheArchive.Core.FeaturesAPI; using TheArchive.Core.FeaturesAPI.Components; using TheArchive.Core.Localization; using TheArchive.Core.ModulesAPI; using TheArchive.Interfaces; using TheArchive.Utilities; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("0.0.0.0")] [module: UnverifiableCode] namespace Hikaria.BoosterTweaker { [ArchiveIncompatibility("Endskill.CustomBoosters")] [ArchiveDependency(/*Could not decode attribute arguments.*/)] [ArchiveModule("Hikaria.BoosterTweaker", "BoosterTweaker", "1.2.6")] public class EntryPoint : IArchiveModule { private const string CUSTOMBOOSTERS_GUID = "Endskill.CustomBoosters"; public ILocalizationService LocalizationService { get; set; } public IArchiveLogger Logger { get; set; } public void Init() { Logs.Setup(Logger); PersistentInventoryManager_Hooks.ApplyAll(); } } internal static class Logs { private static IArchiveLogger _logger; public static void Setup(IArchiveLogger logger) { _logger = logger; } public static void LogDebug(object data) { _logger.Debug(data.ToString()); } public static void LogError(object data) { _logger.Error(data.ToString()); } public static void LogInfo(object data) { _logger.Info(data.ToString()); } public static void LogMessage(object data) { _logger.Msg(ConsoleColor.White, data.ToString()); } public static void LogWarning(object data) { _logger.Warning(data.ToString()); } public static void LogNotice(object data) { _logger.Notice(data.ToString()); } public static void LogSuccess(object data) { _logger.Success(data.ToString()); } public static void LogException(Exception ex) { _logger.Exception(ex); } } public static class PluginInfo { public const string GUID = "Hikaria.BoosterTweaker"; public const string NAME = "BoosterTweaker"; public const string VERSION = "1.2.6"; } } namespace Hikaria.BoosterTweaker.Managers { public static class BoosterImplantTemplateManager { public class bBoosterImplantTemplate { public uint BoosterImplantID { get; set; } public int TemplateIndex { get; set; } public BoosterImplantCategory ImplantCategory { get; set; } public Dictionary> EffectGroups { get; set; } = new Dictionary>(); public Dictionary> ConditionGroups { get; set; } = new Dictionary>(); public bBoosterImplantTemplate(BoosterImplantTemplate template) { //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) BoosterImplantID = template.BoosterImplantID; ImplantCategory = template.ImplantCategory; TemplateIndex = BoosterImplantTemplatesLookup.Value[template.ImplantCategory].Count((bBoosterImplantTemplate p) => p.BoosterImplantID == template.BoosterImplantID); int num = 0; foreach (List effectGroup in template.EffectGroups) { List list = new List(); foreach (BoosterImplantEffectTemplate item in effectGroup) { list.Add(new bBoosterImplantEffectTemplate(item)); } EffectGroups.Add(num++, list); } num = 0; foreach (List conditionGroup in template.ConditionGroups) { List list2 = new List(); foreach (uint item2 in conditionGroup) { list2.Add(new bBoosterImplantConditionTemplate(GameDataBlockBase.GetBlock(item2))); } ConditionGroups.Add(num++, list2); } } } public class bBoosterImplantEffectTemplate { public uint ID { get; set; } public AgentModifier Effect { get; set; } public float MaxValue { get; set; } public float MinValue { get; set; } public bBoosterImplantEffectTemplate(BoosterImplantEffectTemplate effectTemplate) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) ID = effectTemplate.BoosterImplantEffect; Effect = GameDataBlockBase.GetBlock(ID).Effect; MaxValue = effectTemplate.EffectMaxValue; MinValue = effectTemplate.EffectMinValue; } } public class bBoosterImplantConditionTemplate { public uint ID { get; set; } public BoosterCondition Condition { get; set; } public bBoosterImplantConditionTemplate(BoosterImplantConditionDataBlock block) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) ID = ((GameDataBlockBase)(object)block).persistentID; Condition = block.Condition; } } public class LocalizedTextJsonConverter : JsonConverter { public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) { writer.WriteValue(string.Empty); } public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) { return BoosterImplantTemplateDataBlock.UNKNOWN_BLOCK.PublicName; } public override bool CanConvert(Type objectType) { return objectType == typeof(LocalizedText); } } public class ListOfTConverter : JsonConverter> { public override List ReadJson(JsonReader reader, Type objectType, List existingValue, bool hasExistingValue, JsonSerializer serializer) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Invalid comparison between Unknown and I4 JToken val = JToken.Load(reader); if ((int)val.Type == 2) { return SharedUtils.ToIL2CPPListIfNecessary(val.ToObject>(serializer)); } return null; } public override void WriteJson(JsonWriter writer, List value, JsonSerializer serializer) { JToken.FromObject((object)value).WriteTo(writer, Array.Empty()); } public ListOfTConverter() { ((JsonConverter>>)(object)this)..ctor(); } } public class ListOfListOfTConverter : JsonConverter>> { public override List> ReadJson(JsonReader reader, Type objectType, List> existingValue, bool hasExistingValue, JsonSerializer serializer) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Invalid comparison between Unknown and I4 //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Invalid comparison between Unknown and I4 //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) JToken val = JToken.Load(reader); List> val2 = (List>)(object)new List>>(); if ((int)val.Type == 2) { foreach (JToken item in val.Children()) { if ((int)item.Type != 2) { continue; } List val3 = new List(); foreach (JToken item2 in item.Children()) { T val4 = item2.ToObject(serializer); val3.Add(val4); } ((List>>)(object)val2).Add((List>)(object)val3); } } return val2; } public override void WriteJson(JsonWriter writer, List> value, JsonSerializer serializer) { JToken.FromObject((object)value).WriteTo(writer, Array.Empty()); } public ListOfListOfTConverter() { ((JsonConverter>>>>)(object)this)..ctor(); } } public class BoosterImplantEffectTemplate { public uint BoosterImplantEffect { get; set; } public float EffectMaxValue { get; set; } public float EffectMinValue { get; set; } public BoosterImplantEffectTemplate(BoosterImplantEffectInstance effect) { EffectMaxValue = effect.MaxValue; EffectMinValue = effect.MinValue; BoosterImplantEffect = effect.BoosterImplantEffect; } } public class BoosterImplantTemplate { public uint BoosterImplantID { get; set; } public BoosterImplantCategory ImplantCategory { get; set; } [JsonIgnore] public List Effects { get; set; } = new List(); [JsonIgnore] public List> RandomEffects { get; set; } = new List>(); [JsonIgnore] public List Conditions { get; set; } = new List(); [JsonIgnore] public List RandomConditions { get; set; } = new List(); [JsonIgnore] public BoosterImplantTemplateDataBlock TemplateDataBlock { get; private set; } public List> EffectGroups { get; set; } = new List>(); public List> ConditionGroups { get; set; } = new List>(); public BoosterImplantTemplate(BoosterImplantTemplateDataBlock block) { //IL_005d: Unknown result type (might be due to invalid IL or missing references) TemplateDataBlock = block; BoosterImplantID = ((GameDataBlockBase)(object)block).persistentID; ImplantCategory = block.ImplantCategory; for (int i = 0; i < block.Effects.Count; i++) { Effects.Add(new BoosterImplantEffectTemplate(block.Effects[i])); } for (int j = 0; j < block.RandomEffects.Count; j++) { List list = new List(); for (int k = 0; k < block.RandomEffects[j].Count; k++) { list.Add(new BoosterImplantEffectTemplate(block.RandomEffects[j][k])); } RandomEffects.Add(list); } Conditions.AddRange((IEnumerable)block.Conditions.ToArray()); RandomConditions.AddRange((IEnumerable)block.RandomConditions.ToArray()); EffectGroups = GenerateEffectGroups(); ConditionGroups = GenerateConditionGroups(); } private List> GenerateEffectGroups() { List> list = new List>(); List> nElementCombinations = GetNElementCombinations(RandomEffects); for (int i = 0; i < nElementCombinations.Count; i++) { List list2 = Effects.ToList(); list2.AddRange(nElementCombinations[i]); list.Add(list2); } return list; } private List> GenerateConditionGroups() { return GetNElementCombinations(new List> { Conditions, RandomConditions }); } private static List> GetNElementCombinations(List> lists) { List> list = new List>(); GetNElementCombinationsHelper(lists, new List(), 0, list); return list; } private static void GetNElementCombinationsHelper(List> lists, List currentCombination, int currentIndex, List> combinations) { if (currentIndex == lists.Count) { combinations.Add(new List(currentCombination)); return; } List list = lists[currentIndex]; if (list.Count == 0) { GetNElementCombinationsHelper(lists, currentCombination, currentIndex + 1, combinations); return; } foreach (T item in list) { currentCombination.Add(item); GetNElementCombinationsHelper(lists, currentCombination, currentIndex + 1, combinations); currentCombination.RemoveAt(currentCombination.Count - 1); } } } private static List OldBoosterImplantTemplateDataBlocks = new List(); public static bool DisableBoosterConditions { get; set; } = false; public static bool DisableBoosterNegativeEffects { get; set; } = false; public static bool EnableCustomPerfectBooster { get; set; } = false; public static bool EnableCustomBooster { get; set; } = false; public static CustomSetting>> BoosterImplantTemplatesLookup { get; set; } = new CustomSetting>>("BoosterImplantTemplatesLookup", new Dictionary> { { (BoosterImplantCategory)0, new List() }, { (BoosterImplantCategory)1, new List() }, { (BoosterImplantCategory)2, new List() } }, (Action>>)null, (LoadingTime)0, false); public static List BoosterImplantTemplates { get; } = new List(); public static void LoadTemplateData() { //IL_011c: Unknown result type (might be due to invalid IL or missing references) using Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("Hikaria.BoosterTweaker.Resources.OldBoosterTemplates.json"); using StreamReader streamReader = new StreamReader(stream); string text = streamReader.ReadToEnd(); OldBoosterImplantTemplateDataBlocks.Clear(); OldBoosterImplantTemplateDataBlocks.AddRange(JsonConvert.DeserializeObject>(text, (JsonConverter[])(object)new JsonConverter[4] { new LocalizedTextJsonConverter(), (JsonConverter)new ListOfTConverter(), (JsonConverter)new ListOfTConverter(), (JsonConverter)new ListOfListOfTConverter() })); BoosterImplantTemplates.Clear(); Il2CppArrayBase allBlocksForEditor = GameDataBlockBase.GetAllBlocksForEditor(); for (int i = 0; i < allBlocksForEditor.Count; i++) { BoosterImplantTemplates.Add(new BoosterImplantTemplate(allBlocksForEditor[i])); } for (int j = 0; j < OldBoosterImplantTemplateDataBlocks.Count; j++) { BoosterImplantTemplates.Add(new BoosterImplantTemplate(OldBoosterImplantTemplateDataBlocks[j])); } BoosterImplantTemplatesLookup.Value = new Dictionary> { { (BoosterImplantCategory)0, new List() }, { (BoosterImplantCategory)1, new List() }, { (BoosterImplantCategory)2, new List() } }; for (int k = 0; k < BoosterImplantTemplates.Count; k++) { BoosterImplantTemplatesLookup.Value[BoosterImplantTemplates[k].ImplantCategory].Add(new bBoosterImplantTemplate(BoosterImplantTemplates[k])); } BoosterImplantTemplatesLookup.Save(); } public static void ApplyPerfectBoosterFromTemplate(BoosterImplant boosterImplant, List effectGroup, List conditions) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) List list = new List(); foreach (BoosterImplantEffectTemplate item in effectGroup) { list.Add(new Effect { Id = item.BoosterImplantEffect, Value = ((item.EffectMaxValue <= 1f && DisableBoosterNegativeEffects) ? 1f : item.EffectMaxValue) }); } boosterImplant.Effects = Il2CppStructArray.op_Implicit(list.ToArray()); boosterImplant.Conditions = Il2CppStructArray.op_Implicit(DisableBoosterConditions ? Array.Empty() : conditions.ToArray()); } public static bool TryGetBoosterImplantTemplate(BoosterImplant boosterImplant, out BoosterImplantTemplate template, out List effectGroup, out List conditionGroup, out int effectGroupIndex, out int conditionGroupIndex) { template = null; effectGroup = new List(); conditionGroup = new List(); effectGroupIndex = -1; conditionGroupIndex = -1; uint persistenID = boosterImplant.TemplateId; List list = BoosterImplantTemplates.FindAll((BoosterImplantTemplate p) => p.BoosterImplantID == persistenID && p.ImplantCategory == boosterImplant.Category); for (int k = 0; k < list.Count; k++) { if (list[k].TemplateDataBlock == null) { continue; } List> conditionGroups = list[k].ConditionGroups; int count = ((Il2CppArrayBase)(object)boosterImplant.Conditions).Count; bool flag = count == 0; Il2CppStructArray conditions = boosterImplant.Conditions; if (count > 0) { int j; for (j = 0; j < conditionGroups.Count; j++) { if (count != conditionGroups[j].Count) { continue; } bool num = ((IEnumerable)conditions).All((uint p) => conditionGroups[j].Any((uint q) => q == p)); bool flag2 = conditionGroups[j].All((uint p) => ((IEnumerable)conditions).Any((uint q) => q == p)); if (num && flag2) { flag = true; conditionGroup = conditionGroups[j]; conditionGroupIndex = j; break; } } } if (!flag) { continue; } conditionGroupIndex = 0; int count2 = ((Il2CppArrayBase)(object)boosterImplant.Effects).Count; bool flag3 = false; List> effectGroups = list[k].EffectGroups; List effects = ((IEnumerable)boosterImplant.Effects).ToList(); int i; for (i = 0; i < effectGroups.Count; i++) { if (effectGroups[i].Count != count2) { continue; } for (int l = 0; l < effectGroups[i].Count; l++) { bool num2 = effects.All((Effect p) => effectGroups[i].Any((BoosterImplantEffectTemplate q) => q.BoosterImplantEffect == p.Id)); bool flag4 = effectGroups[i].All((BoosterImplantEffectTemplate p) => effects.Any((Effect q) => q.Id == p.BoosterImplantEffect)); if (num2 && flag4) { flag3 = true; effectGroup = effectGroups[i]; effectGroupIndex = i; break; } } if (flag3) { break; } } if (flag3) { return true; } } return false; } } public static class CustomBoosterImplantManager { public class CustomBoosterImplant { public class Effect { public uint Id { get; set; } public float Value { get; set; } = 1f; public Effect(Effect effect) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) Id = effect.Id; Value = effect.Value; } public Effect() { } } public string Name { get; set; } = string.Empty; public BoosterImplantCategory Category { get; set; } = (BoosterImplantCategory)3; public uint TemplateId { get; set; } public List Conditions { get; set; } = new List(); public List Effects { get; set; } = new List(); public bool Enabled { get; set; } public CustomBoosterImplant(BoosterImplant implant) { //IL_000d: 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) //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_008a: Unknown result type (might be due to invalid IL or missing references) Name = implant.GetCompositPublicName(true); TemplateId = implant.TemplateId; Conditions = ((IEnumerable)implant.Conditions).ToList(); Category = implant.Category; Effects.Clear(); foreach (Effect item in (Il2CppArrayBase)(object)implant.Effects) { Effects.Add(new Effect(item)); } Enabled = true; } public CustomBoosterImplant() { }//IL_000d: Unknown result type (might be due to invalid IL or missing references) } public static CustomSetting>> CustomBoosterImplants { get; set; } = new CustomSetting>>("CustomBoosterImplants", new Dictionary> { { (BoosterImplantCategory)0, new List() }, { (BoosterImplantCategory)1, new List() }, { (BoosterImplantCategory)2, new List() } }, (Action>>)null, (LoadingTime)1, true); public static void CreateCustomBoosterImplantsFromInventory() { //IL_0074: Unknown result type (might be due to invalid IL or missing references) CustomBoosterImplants.Value = new Dictionary> { { (BoosterImplantCategory)0, new List() }, { (BoosterImplantCategory)1, new List() }, { (BoosterImplantCategory)2, new List() } }; foreach (Category item in (Il2CppArrayBase)(object)PersistentInventoryManager.Current.m_boosterImplantInventory.Categories) { Enumerator enumerator2 = item.Inventory.GetEnumerator(); while (enumerator2.MoveNext()) { BoosterImplantInventoryItem current = enumerator2.Current; CustomBoosterImplants.Value[current.Implant.Category].Add(new CustomBoosterImplant(current.Implant)); } } } public static void ApplyCustomBoosterImplants() { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_01e6: 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_00f2: 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_0134: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Expected O, but got Unknown //IL_017d: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Expected O, but got Unknown //IL_01ac: Unknown result type (might be due to invalid IL or missing references) uint num = 3223718u; for (int i = 0; i < 3; i++) { List inventory = ((Il2CppArrayBase)(object)PersistentInventoryManager.Current.m_boosterImplantInventory.Categories)[i].Inventory; inventory.Clear(); BoosterImplantCategory key = (BoosterImplantCategory)i; for (int j = 0; j < CustomBoosterImplants.Value[key].Count; j++) { CustomBoosterImplant customBoosterImplant = CustomBoosterImplants.Value[key][j]; if (!customBoosterImplant.Enabled || GameDataBlockBase.GetBlock(customBoosterImplant.TemplateId) == null || customBoosterImplant.Effects.Any((CustomBoosterImplant.Effect p) => p.Id == 0) || customBoosterImplant.Conditions.Any((uint p) => p == 0)) { continue; } List list = new List(); foreach (CustomBoosterImplant.Effect effect in customBoosterImplant.Effects) { list.Add(new BoosterImplantEffect { Id = effect.Id, Param = effect.Value }); } BoosterImplantInventoryItem val = new BoosterImplantInventoryItem(new BoosterImplantInventoryItem { Conditions = Il2CppStructArray.op_Implicit(customBoosterImplant.Conditions.ToArray()), Effects = Il2CppStructArray.op_Implicit(list.ToArray()), Id = num, TemplateId = customBoosterImplant.TemplateId, Flags = 1u }); inventory.Add(val); val.Implant.InstanceId = num; val.Implant.Uses = (int)val.Implant.Template.DurationRange.y; customBoosterImplant.Name = val.Implant.GetCompositPublicName(true); num++; } } } } public static class CustomPerfectBoosterImplantManager { public class CustomPerfectBoosterImplant { public string Name { get; set; } = string.Empty; public BoosterImplantCategory Category { get; set; } = (BoosterImplantCategory)3; public uint TemplateId { get; set; } public int TemplateIndex { get; set; } public int EffectGroupIndex { get; set; } public int ConditionGroupIndex { get; set; } public bool Enabled { get; set; } public CustomPerfectBoosterImplant(BoosterImplant implant) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) Name = implant.GetCompositPublicName(true); TemplateId = implant.TemplateId; Category = implant.Category; if (BoosterImplantTemplateManager.TryGetBoosterImplantTemplate(implant, out var _, out var _, out var _, out var effectGroupIndex, out var conditionGroupIndex)) { ConditionGroupIndex = conditionGroupIndex; EffectGroupIndex = effectGroupIndex; } Enabled = true; } public CustomPerfectBoosterImplant() { }//IL_000d: Unknown result type (might be due to invalid IL or missing references) } public static CustomSetting>> CustomPerfectBoosterImplants { get; set; } = new CustomSetting>>("CustomPerfectBoosterImplants", new Dictionary> { { (BoosterImplantCategory)0, new List() }, { (BoosterImplantCategory)1, new List() }, { (BoosterImplantCategory)2, new List() } }, (Action>>)null, (LoadingTime)2, true); public static void CreateCustomPerfectBoosterImplantsFromInventory() { //IL_0074: Unknown result type (might be due to invalid IL or missing references) CustomPerfectBoosterImplants.Value = new Dictionary> { { (BoosterImplantCategory)0, new List() }, { (BoosterImplantCategory)1, new List() }, { (BoosterImplantCategory)2, new List() } }; foreach (Category item in (Il2CppArrayBase)(object)PersistentInventoryManager.Current.m_boosterImplantInventory.Categories) { Enumerator enumerator2 = item.Inventory.GetEnumerator(); while (enumerator2.MoveNext()) { BoosterImplantInventoryItem current = enumerator2.Current; CustomPerfectBoosterImplants.Value[current.Implant.Category].Add(new CustomPerfectBoosterImplant(current.Implant)); } } } public static void ApplyCustomPerfectBoosterImplants() { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_029d: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_018e: 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_01d0: Unknown result type (might be due to invalid IL or missing references) //IL_01d5: Unknown result type (might be due to invalid IL or missing references) //IL_01fd: Unknown result type (might be due to invalid IL or missing references) //IL_020f: Unknown result type (might be due to invalid IL or missing references) //IL_0216: Unknown result type (might be due to invalid IL or missing references) //IL_0228: Unknown result type (might be due to invalid IL or missing references) //IL_0234: Expected O, but got Unknown //IL_022f: Unknown result type (might be due to invalid IL or missing references) //IL_0236: Expected O, but got Unknown //IL_025e: Unknown result type (might be due to invalid IL or missing references) uint num = 7225460u; for (int i = 0; i < 3; i++) { List inventory = ((Il2CppArrayBase)(object)PersistentInventoryManager.Current.m_boosterImplantInventory.Categories)[i].Inventory; inventory.Clear(); BoosterImplantCategory key = (BoosterImplantCategory)i; for (int j = 0; j < CustomPerfectBoosterImplants.Value[key].Count; j++) { CustomPerfectBoosterImplant CustomPerfectBoosterImplant = CustomPerfectBoosterImplants.Value[key][j]; if (!CustomPerfectBoosterImplant.Enabled || GameDataBlockBase.GetBlock(CustomPerfectBoosterImplant.TemplateId) == null) { continue; } List list = BoosterImplantTemplateManager.BoosterImplantTemplates.FindAll((BoosterImplantTemplateManager.BoosterImplantTemplate p) => p.BoosterImplantID == CustomPerfectBoosterImplant.TemplateId); if (!list.Any() || CustomPerfectBoosterImplant.TemplateIndex <= -1 || CustomPerfectBoosterImplant.TemplateIndex >= list.Count) { continue; } BoosterImplantTemplateManager.BoosterImplantTemplate boosterImplantTemplate = list[CustomPerfectBoosterImplant.TemplateIndex]; if (boosterImplantTemplate == null || boosterImplantTemplate.BoosterImplantID == 0 || CustomPerfectBoosterImplant.ConditionGroupIndex >= boosterImplantTemplate.ConditionGroups.Count || CustomPerfectBoosterImplant.EffectGroupIndex >= boosterImplantTemplate.EffectGroups.Count || CustomPerfectBoosterImplant.ConditionGroupIndex <= -1 || CustomPerfectBoosterImplant.EffectGroupIndex <= -1) { continue; } List list2 = new List(); foreach (BoosterImplantTemplateManager.BoosterImplantEffectTemplate item in boosterImplantTemplate.EffectGroups[CustomPerfectBoosterImplant.EffectGroupIndex]) { list2.Add(new BoosterImplantEffect { Id = item.BoosterImplantEffect, Param = item.EffectMaxValue }); } BoosterImplantInventoryItem val = new BoosterImplantInventoryItem(new BoosterImplantInventoryItem { Conditions = Il2CppStructArray.op_Implicit(boosterImplantTemplate.ConditionGroups[CustomPerfectBoosterImplant.ConditionGroupIndex].ToArray()), Effects = Il2CppStructArray.op_Implicit(list2.ToArray()), Id = num, TemplateId = CustomPerfectBoosterImplant.TemplateId, Flags = 1u }); inventory.Add(val); val.Implant.InstanceId = num; val.Implant.Uses = (int)val.Implant.Template.DurationRange.y; CustomPerfectBoosterImplant.Name = val.Implant.GetCompositPublicName(true); num++; } } } } } namespace Hikaria.BoosterTweaker.Features { [EnableFeatureByDefault] [HideInModSettings] public class CustomBooster : Feature { public class CustomBoosterSetting { [FSDisplayName("禁用条件")] public bool DisableBoosterConditions { get { return BoosterImplantTemplateManager.DisableBoosterConditions; } set { BoosterImplantTemplateManager.DisableBoosterConditions = value; } } [FSDisplayName("禁用负面效果")] public bool DisableBoosterNegativeEffects { get { return BoosterImplantTemplateManager.DisableBoosterNegativeEffects; } set { BoosterImplantTemplateManager.DisableBoosterNegativeEffects = value; } } [FSDisplayName("强化剂自定义")] [FSDescription("自定义将导致完美强化剂与模板首选项以及其他作弊选项失效")] public bool EnableCustomBooster { get { return BoosterImplantTemplateManager.EnableCustomBooster; } set { BoosterImplantTemplateManager.EnableCustomBooster = value; } } [FSDisplayName("通过现有强化剂生成自定义强化剂")] public FButton CreateCustomBoosterFromInventory { get; set; } = new FButton("生成", "生成自定义强化剂", (Action)CustomBoosterImplantManager.CreateCustomBoosterImplantsFromInventory, false); [FSDisplayName("通过设置文件重载自定义强化剂")] public FButton LoadCustomBoosterFromSettings { get; set; } = new FButton("重载", "重载自定义强化剂设置", (Action)CustomBoosterImplantManager.CustomBoosterImplants.Load, false); [FSDisplayName("应用自定义强化剂")] public FButton ApplyCustomBoosters { get; set; } = new FButton("应用", "应用自定义强化剂", (Action)CustomBoosterImplantManager.ApplyCustomBoosterImplants, false); [JsonIgnore] [FSReadOnly(true)] [FSDisplayName("编辑自定义强化剂")] public Dictionary CustomBoosterImplantsEntry { get { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0022: 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) Dictionary dictionary = new Dictionary(); for (int i = 0; i < 3; i++) { BoosterImplantCategory key = (BoosterImplantCategory)i; List list = new List(); for (int j = 0; j < CustomBoosterImplantManager.CustomBoosterImplants.Value[key].Count; j++) { list.Add(new CustomBoosterImplantEntry(CustomBoosterImplantManager.CustomBoosterImplants.Value[key][j])); } dictionary[key] = new CustomBoosterImplantEntryListEntry(list); } return dictionary; } set { } } } public class CustomBoosterImplantEntryListEntry { [FSInline] [FSDisplayName("强化剂列表")] public List Entries { get; set; } = new List(); public CustomBoosterImplantEntryListEntry(List entries) { Entries = entries; } } public class CustomBoosterImplantEntry { [FSSeparator] [FSReadOnly(true)] [FSDisplayName("名称")] public string Name { get { return Implant.Name; } set { } } [FSReadOnly(true)] [FSDisplayName("类别")] public BoosterImplantCategory Category { get { //IL_0006: Unknown result type (might be due to invalid IL or missing references) return Implant.Category; } set { } } [FSReadOnly(true)] [FSDisplayName("ID")] public uint TemplateId { get { return Implant.TemplateId; } set { } } [FSDisplayName("效果列表")] public List Effects { get { List list = new List(); for (int i = 0; i < Implant.Effects.Count; i++) { list.Add(new CustomBoosterImplantEffectEntry(Implant.Effects[i])); } return list; } set { } } [FSDisplayName("条件列表")] public List Conditions { get { List list = new List(); for (int i = 0; i < Implant.Conditions.Count; i++) { list.Add(new CustomBoosterImplantConditionEntry(i, Implant)); } return list; } set { } } [FSDisplayName("状态")] public bool Enabled { get { return Implant.Enabled; } set { Implant.Enabled = value; } } [FSDisplayName("修改")] public BoosterImplantModifier Modifier { get; set; } [FSIgnore] private CustomBoosterImplantManager.CustomBoosterImplant Implant { get; set; } public CustomBoosterImplantEntry(CustomBoosterImplantManager.CustomBoosterImplant implant) { Implant = implant; Modifier = new BoosterImplantModifier(implant); } } [Localized] public enum ModifyType { Add, Remove, Modify } [Localized] public enum ModifyTarget { Effect, Condition } public class BoosterImplantModifier { [FSDisplayName("ID")] public uint Id { get; set; } [FSDisplayName("值")] public float Value { get; set; } = 1f; [FSDisplayName("修改模式")] public ModifyType type { get; set; } = ModifyType.Modify; [FSDisplayName("修改对象")] public ModifyTarget target { get; set; } [FSDisplayName("应用修改")] public FButton Modify { get; set; } private CustomBoosterImplantManager.CustomBoosterImplant Implant { get; set; } public BoosterImplantModifier(CustomBoosterImplantManager.CustomBoosterImplant implant) { //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Expected O, but got Unknown Implant = implant; Modify = new FButton("应用", "应用修改", (Action)DoModify, false); } private void DoModify() { List effects = Implant.Effects; List conditions = Implant.Conditions; switch (type) { case ModifyType.Modify: if (target == ModifyTarget.Effect) { int num3 = effects.FindIndex((CustomBoosterImplantManager.CustomBoosterImplant.Effect p) => p.Id == Id); if (num3 != -1) { effects[num3].Value = Value; } } else { int num4 = conditions.FindIndex((uint p) => p == Id); if (num4 != -1) { conditions[num4] = Id; } } break; case ModifyType.Add: if (target == ModifyTarget.Effect) { if (effects.FindIndex((CustomBoosterImplantManager.CustomBoosterImplant.Effect p) => p.Id == Id) == -1) { effects.Add(new CustomBoosterImplantManager.CustomBoosterImplant.Effect { Id = Id, Value = Value }); } } else if (conditions.FindIndex((uint p) => p == Id) == -1) { conditions.Add(Id); } break; case ModifyType.Remove: if (target == ModifyTarget.Effect) { int num = effects.FindIndex((CustomBoosterImplantManager.CustomBoosterImplant.Effect p) => p.Id == Id); if (num != -1) { effects.RemoveAt(num); } } else { int num2 = conditions.FindIndex((uint p) => p == Id); if (num2 != -1) { conditions.RemoveAt(num2); } } break; } } } public class CustomBoosterImplantEffectEntry { [FSSeparator] [FSDisplayName("效果ID")] public uint Id { get { return Effect.Id; } set { Effect.Id = value; } } [FSDisplayName("效果数值")] public float Value { get { return Effect.Value; } set { Effect.Value = value; } } [FSIgnore] private CustomBoosterImplantManager.CustomBoosterImplant.Effect Effect { get; set; } public CustomBoosterImplantEffectEntry(CustomBoosterImplantManager.CustomBoosterImplant.Effect effect) { Effect = effect; } } public class CustomBoosterImplantConditionEntry { [FSIgnore] public int Index { get; set; } [FSSeparator] [FSDisplayName("条件")] public uint Condition { get { return Implant.Conditions[Index]; } set { Implant.Conditions[Index] = value; } } [FSIgnore] private CustomBoosterImplantManager.CustomBoosterImplant Implant { get; set; } public CustomBoosterImplantConditionEntry(int index, CustomBoosterImplantManager.CustomBoosterImplant implant) { Index = index; Implant = implant; } } private class PersistentInventoryManager__UpdateBoosterImplants__Patch { private static bool Prefix(PersistentInventoryManager __instance) { if (Settings.EnableCustomBooster) { __instance.m_boosterImplantDirtyState = (BoosterImplantDirtyState)0; CustomBoosterImplantManager.ApplyCustomBoosterImplants(); return false; } return true; } } [ArchivePatch(/*Could not decode attribute arguments.*/)] private class CM_PageLoadout__ProcessBoosterImplantEvents__Patch { private static bool Prefix() { if (Settings.EnableCustomBooster) { return false; } return true; } } [ArchivePatch(/*Could not decode attribute arguments.*/)] internal static class DropServerManager__NewGameSession__Patch { public static void Prefix(ref uint[] boosterIds) { if (Settings.EnableCustomBooster) { boosterIds = null; } } } [ArchivePatch(/*Could not decode attribute arguments.*/)] private class DropServerGameSession__ConsumeBoosters__Patch { private static bool Prefix() { return !Settings.EnableCustomBooster; } } [ArchivePatch(/*Could not decode attribute arguments.*/)] private class BoosterUtils__BoosterCurrencyFromHeatAndArtifactCount__Patch { private static void Postfix(ref int __result) { if (Settings.EnableCustomBooster) { __result = 0; } } } public override string Name => "Custom Booster"; [FeatureConfig] public static CustomBoosterSetting Settings { get; set; } public override bool RequiresRestart => true; public override Type[] ExternalLocalizedTypes => new Type[3] { typeof(BoosterImplantCategory), typeof(AgentModifier), typeof(BoosterCondition) }; } [EnableFeatureByDefault] public class PerfectBooster : Feature { public class PerfectBoosterSetting { [FSDisplayName("快速刷取")] public bool EnableBoosterFarmer { get; set; } [RequiresRestart] [FSDisplayName("完美强化剂")] public bool EnablePerfectBooster { get; set; } = true; [FSDisplayName("禁用消耗")] public bool DisableBoosterConsume { get; set; } = true; [FSHeader("自定义强化剂", true)] [FSDisplayName("启用自定义强化剂")] public bool EnableCustomPerfectBooster { get { return BoosterImplantTemplateManager.EnableCustomPerfectBooster; } set { BoosterImplantTemplateManager.EnableCustomPerfectBooster = value; } } [FSDisplayName("通过现有强化剂生成自定义强化剂")] public FButton CreateCustomPerfectBoosterFromInventory { get; set; } = new FButton("生成", "生成自定义强化剂", (Action)CustomPerfectBoosterImplantManager.CreateCustomPerfectBoosterImplantsFromInventory, false); [FSDisplayName("通过设置文件重载自定义强化剂")] public FButton LoadCustomPerfectBoosterFromSettings { get; set; } = new FButton("重载", "重载自定义强化剂设置", (Action)CustomPerfectBoosterImplantManager.CustomPerfectBoosterImplants.Load, false); [FSDisplayName("应用自定义强化剂")] public FButton ApplyCustomPerfectBoosters { get; set; } = new FButton("应用", "应用自定义强化剂", (Action)CustomPerfectBoosterImplantManager.ApplyCustomPerfectBoosterImplants, false); [JsonIgnore] [FSReadOnly(true)] [FSDisplayName("编辑自定义强化剂")] public Dictionary CustomPerfectBoosterImplantsEntry { get { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0022: 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) Dictionary dictionary = new Dictionary(); for (int i = 0; i < 3; i++) { BoosterImplantCategory key = (BoosterImplantCategory)i; List list = new List(); for (int j = 0; j < CustomPerfectBoosterImplantManager.CustomPerfectBoosterImplants.Value[key].Count; j++) { list.Add(new CustomPerfectBoosterImplantEntry(CustomPerfectBoosterImplantManager.CustomPerfectBoosterImplants.Value[key][j])); } dictionary[key] = new CustomPerfectBoosterImplantEntryListEntry(list); } return dictionary; } set { } } } public class CustomPerfectBoosterImplantEntryListEntry { [FSInline] [FSDisplayName("强化剂列表")] public List Entries { get; set; } = new List(); public CustomPerfectBoosterImplantEntryListEntry(List entries) { Entries = entries; } } public class CustomPerfectBoosterImplantEntry { [FSSeparator] [FSReadOnly(true)] [FSDisplayName("名称")] public string Name { get { return Implant.Name; } set { } } [FSReadOnly(true)] [FSDisplayName("类别")] public BoosterImplantCategory Category { get { //IL_0006: Unknown result type (might be due to invalid IL or missing references) return Implant.Category; } set { } } [FSReadOnly(true)] [FSDisplayName("ID")] public uint TemplateId { get { return Implant.TemplateId; } set { } } [FSDisplayName("模版索引")] public int TemplateIndex { get { return Implant.TemplateIndex; } set { Implant.TemplateIndex = value; UpdateTemplate(); } } [FSDisplayName("效果组索引")] public int EffectsGroupIndex { get { return Implant.EffectGroupIndex; } set { Implant.EffectGroupIndex = value; } } [FSDisplayName("条件组索引")] public int ConditionsGroupIndex { get { return Implant.ConditionGroupIndex; } set { Implant.ConditionGroupIndex = value; } } [FSDisplayName("状态")] public bool Enabled { get { return Implant.Enabled; } set { Implant.Enabled = value; } } [JsonIgnore] [FSInline] [FSDisplayName("可选模板")] public CustomPerfectBoosterTemplateEntry Templates { get; set; } = new CustomPerfectBoosterTemplateEntry(); [FSIgnore] private CustomPerfectBoosterImplantManager.CustomPerfectBoosterImplant Implant { get; set; } public CustomPerfectBoosterImplantEntry(CustomPerfectBoosterImplantManager.CustomPerfectBoosterImplant implant) { Implant = implant; TemplateId = implant.TemplateId; BoosterImplantTemplateManager.BoosterImplantTemplate boosterImplantTemplate = BoosterImplantTemplateManager.BoosterImplantTemplates.FindAll((BoosterImplantTemplateManager.BoosterImplantTemplate p) => p.BoosterImplantID == implant.TemplateId)[implant.TemplateIndex]; if (boosterImplantTemplate != null && boosterImplantTemplate.BoosterImplantID != 0) { Templates.EffectsTemplates.Clear(); for (int i = 0; i < boosterImplantTemplate.EffectGroups.Count; i++) { Templates.EffectsTemplates.Add(new BoosterImplantEffectGroupPreferenceEntry(i, boosterImplantTemplate.EffectGroups[i])); } Templates.ConditionsTemplates.Clear(); for (int j = 0; j < boosterImplantTemplate.ConditionGroups.Count; j++) { Templates.ConditionsTemplates.Add(new BoosterImplantConditionGroupPreferenceEntry(j, boosterImplantTemplate.ConditionGroups[j])); } TemplateId = boosterImplantTemplate.BoosterImplantID; } } private void UpdateTemplate() { List list = BoosterImplantTemplateManager.BoosterImplantTemplates.FindAll((BoosterImplantTemplateManager.BoosterImplantTemplate p) => p.BoosterImplantID == TemplateId); if (TemplateIndex <= -1 || TemplateIndex >= list.Count) { return; } BoosterImplantTemplateManager.BoosterImplantTemplate boosterImplantTemplate = list[TemplateIndex]; if (boosterImplantTemplate != null && boosterImplantTemplate.BoosterImplantID != 0) { Templates.EffectsTemplates.Clear(); for (int i = 0; i < boosterImplantTemplate.EffectGroups.Count; i++) { Templates.EffectsTemplates.Add(new BoosterImplantEffectGroupPreferenceEntry(i, boosterImplantTemplate.EffectGroups[i])); } Templates.ConditionsTemplates.Clear(); for (int j = 0; j < boosterImplantTemplate.ConditionGroups.Count; j++) { Templates.ConditionsTemplates.Add(new BoosterImplantConditionGroupPreferenceEntry(j, boosterImplantTemplate.ConditionGroups[j])); } TemplateId = boosterImplantTemplate.BoosterImplantID; } } } public class CustomPerfectBoosterTemplateEntry { [FSReadOnly(true)] [FSDisplayName("可选效果模板")] public List EffectsTemplates { get; set; } = new List(); [FSReadOnly(true)] [FSDisplayName("可选条件模板")] public List ConditionsTemplates { get; set; } = new List(); } public class BoosterImplantEffectGroupPreferenceEntry { public class EffectEntry { [FSReadOnly(true)] [FSDisplayName("效果")] public AgentModifier Effect { get; set; } public EffectEntry(BoosterImplantEffectDataBlock block) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) Effect = block.Effect; } } [FSSeparator] [FSReadOnly(true)] [FSDisplayName("效果组索引")] public int Index { get; set; } [FSReadOnly(true)] [FSInline] [FSDisplayName("效果列表")] public List Effects { get; set; } = new List(); public BoosterImplantEffectGroupPreferenceEntry(int index, List effectGroup) { Index = index; Effects.Clear(); for (int i = 0; i < effectGroup.Count; i++) { BoosterImplantEffectDataBlock block = GameDataBlockBase.GetBlock(effectGroup[i].BoosterImplantEffect); if (block != null) { Effects.Add(new EffectEntry(block)); } } } } public class BoosterImplantConditionGroupPreferenceEntry { public class ConditionEntry { [FSReadOnly(true)] [FSDisplayName("条件")] public BoosterCondition Condition { get; set; } public ConditionEntry(BoosterImplantConditionDataBlock block) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) Condition = block.Condition; } } [FSSeparator] [FSReadOnly(true)] [FSDisplayName("条件组索引")] public int Index { get; set; } [FSReadOnly(true)] [FSInline] [FSDisplayName("条件列表")] public List Conditions { get; set; } = new List(); public BoosterImplantConditionGroupPreferenceEntry(int index, List conditionGroup) { Index = index; Conditions.Clear(); for (int i = 0; i < conditionGroup.Count; i++) { BoosterImplantConditionDataBlock block = GameDataBlockBase.GetBlock(conditionGroup[i]); if (block != null) { Conditions.Add(new ConditionEntry(block)); } } } } [ArchivePatch(/*Could not decode attribute arguments.*/)] private class LocalizationManager__Setup__Patch { private static void Postfix() { CustomPerfectBoosterImplantManager.CustomPerfectBoosterImplants.Load(); } } [ArchivePatch(/*Could not decode attribute arguments.*/)] private class CM_PageLoadout__ProcessBoosterImplantEvents__Patch { private static bool Prefix() { if (Settings.EnableCustomPerfectBooster) { return false; } return true; } } [ArchivePatch(/*Could not decode attribute arguments.*/)] internal static class DropServerManager__NewGameSession__Patch { public static void Prefix(ref uint[] boosterIds) { if (Settings.DisableBoosterConsume || Settings.EnablePerfectBooster) { boosterIds = null; } } } [ArchivePatch(/*Could not decode attribute arguments.*/)] private class DropServerGameSession__ConsumeBoosters__Patch { private static bool Prefix() { if (!Settings.DisableBoosterConsume) { return !Settings.EnableCustomPerfectBooster; } return false; } } [ArchivePatch(/*Could not decode attribute arguments.*/)] private class BoosterUtils__BoosterCurrencyFromHeatAndArtifactCount__Patch { private static void Postfix(ref int __result) { if (Settings.EnableCustomPerfectBooster) { __result = 0; } else if (Settings.EnableBoosterFarmer) { __result = 100000; } } } public override string Name => "Perfect Booster"; [FeatureConfig] public static PerfectBoosterSetting Settings { get; set; } public override bool RequiresRestart => true; public override Type[] ExternalLocalizedTypes => new Type[3] { typeof(BoosterImplantCategory), typeof(AgentModifier), typeof(BoosterCondition) }; public override void OnGameDataInitialized() { BoosterImplantTemplateManager.LoadTemplateData(); } public static void ApplyPerfectBoosterImplants() { for (int i = 0; i < ((Il2CppArrayBase)(object)PersistentInventoryManager.Current.m_boosterImplantInventory.Categories).Count; i++) { List inventory = ((Il2CppArrayBase)(object)PersistentInventoryManager.Current.m_boosterImplantInventory.Categories)[i].Inventory; for (int j = 0; j < inventory.Count; j++) { BoosterImplant implant = inventory[j].Implant; if (BoosterImplantTemplateManager.TryGetBoosterImplantTemplate(implant, out var _, out var effectGroup, out var conditionGroup, out var _, out var _)) { BoosterImplantTemplateManager.ApplyPerfectBoosterFromTemplate(implant, effectGroup, conditionGroup); } } } } } } namespace Hikaria.BoosterTweaker.Detours { internal static class PersistentInventoryManager_Hooks { [UnmanagedFunctionPointer(CallingConvention.Cdecl)] private unsafe delegate void UpdateBoosterImplants_HookDelegate(IntPtr self, BoosterImplantPlayerData* playerData, Il2CppMethodInfo* methodInfo); private static readonly NativeDetourHandle UpdateBoosterImplants_Handle; private static UpdateBoosterImplants_HookDelegate UpdateBoosterImplants_Original => UpdateBoosterImplants_Handle.Original; [NativeDetour(typeof(PersistentInventoryManager), "UpdateBoosterImplants")] private unsafe static void UpdateBoosterImplants_Hook(IntPtr self, BoosterImplantPlayerData* playerData, Il2CppMethodInfo* methodInfo) { if (PerfectBooster.Settings.EnableCustomPerfectBooster) { CustomPerfectBoosterImplantManager.ApplyCustomPerfectBoosterImplants(); return; } if (CustomBooster.Settings.EnableCustomBooster) { CustomBoosterImplantManager.ApplyCustomBoosterImplants(); return; } UpdateBoosterImplants_Original(self, playerData, methodInfo); if (PerfectBooster.Settings.EnablePerfectBooster) { PerfectBooster.ApplyPerfectBoosterImplants(); } } public static bool UpdateBoosterImplants_Apply() { return UpdateBoosterImplants_Handle.Apply(); } public static void UpdateBoosterImplants_Dispose() { UpdateBoosterImplants_Handle.Dispose(); } public static void ApplyAll() { UpdateBoosterImplants_Apply(); } public static void DisposeAll() { UpdateBoosterImplants_Dispose(); } unsafe static PersistentInventoryManager_Hooks() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown DetourDescriptor val = new DetourDescriptor(); val.set_Type(typeof(PersistentInventoryManager)); val.set_MethodName("UpdateBoosterImplants"); val.set_ReturnType(typeof(void)); val.set_ArgTypes(new Type[1] { typeof(BoosterImplantPlayerData*) }); val.set_IsGeneric(false); UpdateBoosterImplants_Handle = NativeDetour.Create(val, (UpdateBoosterImplants_HookDelegate)UpdateBoosterImplants_Hook); } } }