Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of EggShare v1.0.7
EggShare\EggShareInterop.dll
Decompiled a month agousing System; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using Microsoft.CodeAnalysis; using RoR2; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: InternalsVisibleTo("EggSharePlugin")] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("EggShareInterop")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+99e2436ba8bebdb28e7390f480d91dce2962fbd1")] [assembly: AssemblyProduct("EggShareInterop")] [assembly: AssemblyTitle("EggShareInterop")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace EggSharePlugin { public static class EggShareInterop { public static UniquePickup MakeEgg(this UniquePickup original, int yolk) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: 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_000c: 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_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) UniquePickup result = original; result.eggshare_yolk = yolk; return result; } public static int GetYolk(this UniquePickup up) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return up.eggshare_yolk; } } }
EggShare\EggSharePlugin.dll
Decompiled a month agousing System; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Logging; using EntityStates; using EntityStates.MealPrep; using HG.Reflection; using HarmonyLib; using IL.EntityStates.DroneScrapper; using IL.EntityStates.SolusVendorShrine; using IL.RoR2; using Microsoft.CodeAnalysis; using Mono.Cecil.Cil; using MonoMod.Cil; using MonoMod.RuntimeDetour; using On.EntityStates.MealPrep; using On.RoR2; using On.RoR2.Items; using On.Unity; using R2API; using RoR2; using RoR2.AsyncManagement; using RoR2.Items; using RoR2.UI; using ShareSuite; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.Networking; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: OptIn] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("EggSharePlugin")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+99e2436ba8bebdb28e7390f480d91dce2962fbd1")] [assembly: AssemblyProduct("EggSharePlugin")] [assembly: AssemblyTitle("EggSharePlugin")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace EggSharePlugin { [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInPlugin("Ap101.EggShare", "EggShare", "1.0.4")] public class EggSharePlugin : BaseUnityPlugin { [CompilerGenerated] private static class <>O { public static hook__ReadUniquePickup_None <0>__Unity_GeneratedNetworkCode__ReadUniquePickup_None; public static hook__WriteUniquePickup_None <1>__Unity_GeneratedNetworkCode__WriteUniquePickup_None; public static hook_ResetGameOverTimer <2>__RoR2_Stage_ResetGameOverTimer; public static Action<Action<GenericPickupController, CharacterBody>, GenericPickupController, CharacterBody> <3>__RoR2_GenericPickupController_AttemptGrant; public static Action<Action<orig_DropPickup_bool, ShopTerminalBehavior, bool>, orig_DropPickup_bool, ShopTerminalBehavior, bool> <4>__ShareSuite_ItemSharingHooks_OnPurchaseDrop; public static Func<UniquePickup, UniquePickup> <5>__eggstraterrestrial; public static Func<UniquePickup, ShopTerminalBehavior, UniquePickup> <6>__eggstraterrestrial; public static Func<UniquePickup, UniquePickup> <7>__eggstraterrestrial; } public const string PluginGUID = "Ap101.EggShare"; public const string PluginAuthor = "Ap101"; public const string PluginName = "EggShare"; public const string PluginVersion = "1.0.4"; private static ItemDef egg; public static bool isCommandEnabled => RunArtifactManager.instance.IsArtifactEnabled(Artifacts.Command); public void Awake() { //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: Expected O, but got Unknown //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Expected O, but got Unknown //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Expected O, but got Unknown //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Expected O, but got Unknown //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0095: 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_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Expected O, but got Unknown //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Expected O, but got Unknown //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Expected O, but got Unknown //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Expected O, but got Unknown //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_0101: 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 //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Expected O, but got Unknown //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_019b: Unknown result type (might be due to invalid IL or missing references) egg = CreateItemDef(); object obj = <>O.<0>__Unity_GeneratedNetworkCode__ReadUniquePickup_None; if (obj == null) { hook__ReadUniquePickup_None val = Unity_GeneratedNetworkCode__ReadUniquePickup_None; <>O.<0>__Unity_GeneratedNetworkCode__ReadUniquePickup_None = val; obj = (object)val; } GeneratedNetworkCode._ReadUniquePickup_None += (hook__ReadUniquePickup_None)obj; object obj2 = <>O.<1>__Unity_GeneratedNetworkCode__WriteUniquePickup_None; if (obj2 == null) { hook__WriteUniquePickup_None val2 = Unity_GeneratedNetworkCode__WriteUniquePickup_None; <>O.<1>__Unity_GeneratedNetworkCode__WriteUniquePickup_None = val2; obj2 = (object)val2; } GeneratedNetworkCode._WriteUniquePickup_None += (hook__WriteUniquePickup_None)obj2; ScrapperController.PopRewardPickupQueue += new hook_PopRewardPickupQueue(RoR2_ScrapperController_PopRewardPickupQueue); DropItem.OnEnter += new Manipulator(EntityStates_SolusVendorShrine_DropItem_OnEnter); ShopTerminalBehavior.DropPickup_bool += new Manipulator(RoR2_ShopTerminalBehavior_DropPickup); DroneScrappingToIdle.DropPickup += new Manipulator(EntityStates_DroneScrapper_DroneScrappingToIdle_DropPickup); CookingToIdle.DropItem += new hook_DropItem(EntityStates_MealPrep_CookingToIdle_DropItem); EquipmentSlot.FireRecycle += new hook_FireRecycle(RoR2_EquipmentSlot_FireRecycle); GenericPickupController.GetInfo += new hook_GetInfo(RoR2_GenericPickupController_GetInfo); GenericPickupController.GetDisplayName += new hook_GetDisplayName(RoR2_GenericPickupController_GetDisplayName); CursedBookBodyBehavior.AttemptUpgrade += new hook_AttemptUpgrade(RoR2_Items_CursedBookBodyBehavior_AttemptUpgrade); GenericPickupController.InternalSetPickupState += new hook_InternalSetPickupState(RoR2_GenericPickupController_InternalSetPickupState); object obj3 = <>O.<2>__RoR2_Stage_ResetGameOverTimer; if (obj3 == null) { hook_ResetGameOverTimer val3 = RoR2_Stage_ResetGameOverTimer; <>O.<2>__RoR2_Stage_ResetGameOverTimer = val3; obj3 = (object)val3; } Stage.ResetGameOverTimer += (hook_ResetGameOverTimer)obj3; new Hook((MethodBase)typeof(GenericPickupController).GetMethod("AttemptGrant", (BindingFlags)(-1)), (Delegate)new Action<Action<GenericPickupController, CharacterBody>, GenericPickupController, CharacterBody>(RoR2_GenericPickupController_AttemptGrant), new HookConfig { Priority = -1 }); new Hook((MethodBase)AccessTools.Method(typeof(ItemSharingHooks), "OnPurchaseDrop", (Type[])null, (Type[])null), (Delegate)new Action<Action<orig_DropPickup_bool, ShopTerminalBehavior, bool>, orig_DropPickup_bool, ShopTerminalBehavior, bool>(ShareSuite_ItemSharingHooks_OnPurchaseDrop)); } public bool RoR2_Items_CursedBookBodyBehavior_AttemptUpgrade(orig_AttemptUpgrade orig, CursedBookBodyBehavior self, UniquePickup source, out UniquePickup result) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_0009: 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_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_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_0047: 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_004d: 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_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: 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_0074: 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_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Expected I4, but got Unknown //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_008d: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Expected O, but got Unknown //IL_00b6: 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_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) result = source; if (!isEgg(source)) { UniquePickup val = default(UniquePickup); bool result2 = orig.Invoke(self, source, ref val); result = val; return result2; } UniquePickup val2 = source; val2.pickupIndex = PickupCatalog.FindPickupIndex((ItemIndex)EggShareInterop.GetYolk(source)); UniquePickup val3 = val2; UniquePickup val4 = default(UniquePickup); bool flag = orig.Invoke(self, val3, ref val4); val2 = val4; val2.pickupIndex = PickupCatalog.FindPickupIndex(egg.itemIndex); UniquePickup val5 = val2; UniquePickup val6 = EggShareInterop.MakeEgg(val5, (int)((PickupIndex)(ref val4.pickupIndex)).itemIndex); result = val6; if (flag) { SimpleChatMessage val7 = new SimpleChatMessage(); val7.baseToken = "Spinning down [" + Language.GetString(PickupCatalog.GetPickupDef(PickupCatalog.FindPickupIndex((ItemIndex)EggShareInterop.GetYolk(source))).nameToken) + "] => 2 x [" + Language.GetString(PickupCatalog.GetPickupDef(PickupCatalog.FindPickupIndex((ItemIndex)EggShareInterop.GetYolk(result))).nameToken) + "]"; Chat.SendBroadcastChat((ChatMessageBase)(object)val7); } return flag; } public static void RoR2_Stage_ResetGameOverTimer(orig_ResetGameOverTimer orig, float val = -1f) { //IL_000e: 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_0023: Expected O, but got Unknown if (val == 10f) { Chat.SendBroadcastChat((ChatMessageBase)new SimpleChatMessage { baseToken = "Egg cracking is slang for rebirth" }); orig.Invoke(100f); } else { orig.Invoke(val); } } private void RoR2_GenericPickupController_InternalSetPickupState(orig_InternalSetPickupState orig, GenericPickupController self, UniquePickup newPickupState) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: 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_003e: Unknown result type (might be due to invalid IL or missing references) UniquePickup pickupState = self._pickupState; if (isEgg(newPickupState) && isEgg(pickupState)) { UniquePickup val = new UniquePickup { pickupIndex = PickupCatalog.FindPickupIndex("VoidMegaCrabItem") }; orig.Invoke(self, val); } orig.Invoke(self, newPickupState); } public static UniquePickup Unity_GeneratedNetworkCode__ReadUniquePickup_None(orig__ReadUniquePickup_None orig, NetworkReader reader) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0009: 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_0024: 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_0037: 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_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0040: 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_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0018: 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) UniquePickup val = orig.Invoke(reader); if (!isEgg(val)) { return val; } int num = NetworkExtensions.ReadPackedIndex32(reader); UniquePickup val2 = val; val2.pickupIndex = PickupCatalog.FindPickupIndex(egg.itemIndex); UniquePickup val3 = val2; return EggShareInterop.MakeEgg(val3, num); } public static void Unity_GeneratedNetworkCode__WriteUniquePickup_None(orig__WriteUniquePickup_None orig, NetworkWriter writer, UniquePickup value) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(writer, value); if (isEgg(value)) { NetworkExtensions.WritePackedIndex32(writer, EggShareInterop.GetYolk(value)); } } private UniquePickup RoR2_ScrapperController_PopRewardPickupQueue(orig_PopRewardPickupQueue orig, ScrapperController self) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected I4, but got Unknown //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_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_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown //IL_0071: 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_0075: Unknown result type (might be due to invalid IL or missing references) UniquePickup val = orig.Invoke(self); int num = (int)((PickupIndex)(ref val.pickupIndex)).itemIndex; val = new UniquePickup { pickupIndex = PickupCatalog.FindPickupIndex(egg.itemIndex) }; UniquePickup result = EggShareInterop.MakeEgg(val, num); Chat.SendBroadcastChat((ChatMessageBase)new SimpleChatMessage { baseToken = "An egg just for you! [" + Language.GetString(PickupCatalog.GetPickupDef(PickupCatalog.FindPickupIndex((ItemIndex)num)).nameToken) + "]" }); return result; } private ItemDef CreateItemDef() { //IL_0044: 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_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Expected O, but got Unknown //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Expected O, but got Unknown ItemDef val = ScriptableObject.CreateInstance<ItemDef>(); ((Object)val).name = "EggShare"; val.nameToken = "Egg"; val.pickupToken = "Egg??!?"; val.descriptionToken = "Inside the recipient's inventory, this egg hatches into an gift."; val.loreToken = "A gift for a special someone!"; GameObject pickupModelPrefab = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Mystery/PickupMystery.prefab").WaitForCompletion(); val.pickupIconSprite = (val.pickupIconSprite = Addressables.LoadAssetAsync<Sprite>((object)"RoR2/Base/Common/MiscIcons/texMysteryIcon.png").WaitForCompletion()); val.pickupModelPrefab = pickupModelPrefab; val.deprecatedTier = (ItemTier)9; val.canRemove = false; val.hidden = true; ItemTag[] array = new ItemTag[7]; RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); val.tags = (ItemTag[])(object)array; ItemDisplayRuleDict val2 = new ItemDisplayRuleDict((ItemDisplayRule[])null); ItemAPI.Add(new CustomItem(val, val2)); return val; } private void EntityStates_SolusVendorShrine_DropItem_OnEnter(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown ILCursor val = new ILCursor(il); if (val.TryGotoNext(new Func<Instruction, bool>[1] { (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 1) })) { val.EmitDelegate<Func<UniquePickup, UniquePickup>>((Func<UniquePickup, UniquePickup>)eggstraterrestrial); } static UniquePickup eggstraterrestrial(UniquePickup pickup) { //IL_0049: 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) //IL_001a: 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_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_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_0033: 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_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Expected I4, but got Unknown //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) if (((UniquePickup)(ref pickup)).isValid && !isCommandEnabled) { UniquePickup val2 = pickup; val2.pickupIndex = PickupCatalog.FindPickupIndex(egg.itemIndex); UniquePickup val3 = val2; return EggShareInterop.MakeEgg(val3, (int)((PickupIndex)(ref pickup.pickupIndex)).itemIndex); } return pickup; } } private void RoR2_ShopTerminalBehavior_DropPickup(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_0063: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); if (val.TryGotoNext(new Func<Instruction, bool>[2] { (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0), (Instruction x) => ILPatternMatchingExt.MatchLdfld<ShopTerminalBehavior>(x, "dropTransform") })) { val.Emit(OpCodes.Ldarg_0); val.EmitDelegate<Func<UniquePickup, ShopTerminalBehavior, UniquePickup>>((Func<UniquePickup, ShopTerminalBehavior, UniquePickup>)eggstraterrestrial); } static UniquePickup eggstraterrestrial(UniquePickup pickup, ShopTerminalBehavior shop) { //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_001d: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Invalid comparison between Unknown and I4 //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_002d: 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_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Expected I4, but got Unknown //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Invalid comparison between Unknown and I4 //IL_0062: Unknown result type (might be due to invalid IL or missing references) CostTypeIndex costType = ((Component)shop).GetComponent<PurchaseInteraction>().costType; if (((UniquePickup)(ref pickup)).isValid && !isCommandEnabled && (int)costType != 1 && (int)costType > 0) { UniquePickup val2 = pickup; val2.pickupIndex = PickupCatalog.FindPickupIndex(egg.itemIndex); UniquePickup val3 = val2; return EggShareInterop.MakeEgg(val3, (int)((PickupIndex)(ref pickup.pickupIndex)).itemIndex); } return pickup; } } private void EntityStates_DroneScrapper_DroneScrappingToIdle_DropPickup(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown ILCursor val = new ILCursor(il); if (val.TryGotoNext((MoveType)2, new Func<Instruction, bool>[1] { (Instruction x) => ILPatternMatchingExt.MatchNewobj<UniquePickup>(x) })) { val.EmitDelegate<Func<UniquePickup, UniquePickup>>((Func<UniquePickup, UniquePickup>)eggstraterrestrial); } static UniquePickup eggstraterrestrial(UniquePickup pickup) { //IL_0049: 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) //IL_001a: 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_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_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_0033: 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_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Expected I4, but got Unknown //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) if (((UniquePickup)(ref pickup)).isValid && !isCommandEnabled) { UniquePickup val2 = pickup; val2.pickupIndex = PickupCatalog.FindPickupIndex(egg.itemIndex); UniquePickup val3 = val2; return EggShareInterop.MakeEgg(val3, (int)((PickupIndex)(ref pickup.pickupIndex)).itemIndex); } return pickup; } } private void EntityStates_MealPrep_CookingToIdle_DropItem(orig_DropItem orig, CookingToIdle self) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Invalid comparison between Unknown and I4 //IL_0076: 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_0088: 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) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Expected I4, but got Unknown //IL_009f: 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_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00be: 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_00cd: Unknown result type (might be due to invalid IL or missing references) if (((PickupIndex)(ref ((MealPrepBaseState)self).pickupToDrop)).isValid && (int)((PickupIndex)(ref ((MealPrepBaseState)self).pickupToDrop)).itemIndex != -1 && !isCommandEnabled) { if (EntityStateGameObject.op_Implicit(CookingToIdle.muzzleflashEffectPrefab)) { EffectManager.SimpleMuzzleFlash(EntityStateGameObject.op_Implicit(CookingToIdle.muzzleflashEffectPrefab), ((Component)this).gameObject, CookingToIdle.muzzleString, false); } if (NetworkServer.active) { Transform val = ((BaseState)self).FindModelChild(CookingToIdle.muzzleString); UniquePickup val2 = EggShareInterop.MakeEgg(new UniquePickup { pickupIndex = PickupCatalog.FindPickupIndex(egg.itemIndex) }, (int)((PickupIndex)(ref ((MealPrepBaseState)self).pickupToDrop)).itemIndex); PickupDropletController.CreatePickupDroplet(val2, val.position, Vector3.up * CookingToIdle.dropUpVelocityStrength + val.forward * CookingToIdle.dropForwardVelocityStrength); self.itemsDropped++; } } else { orig.Invoke(self); } } private static void RoR2_GenericPickupController_AttemptGrant(Action<GenericPickupController, CharacterBody> orig, GenericPickupController self, CharacterBody body) { //IL_0002: 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_0028: 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_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0035: 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_003a: 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_0040: 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_0087: 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_0092: 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_00c0: Expected O, but got Unknown //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Expected O, but got Unknown //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_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_0085: Unknown result type (might be due to invalid IL or missing references) if (!isEgg(self.pickup)) { orig(self, body); return; } UniquePickup pickup = self.pickup; PickupIndex pickupIndex = PickupCatalog.FindPickupIndex((ItemIndex)EggShareInterop.GetYolk(pickup)); UniquePickup val = pickup; val.pickupIndex = pickupIndex; UniquePickup pickup2 = val; if (!((PickupIndex)(ref pickupIndex)).isItem) { Chat.SendBroadcastChat((ChatMessageBase)new SimpleChatMessage { baseToken = "Something isn't right..." }); val = pickup; val.pickupIndex = PickupCatalog.FindPickupIndex(egg.itemIndex); pickup2 = val; } Chat.SendBroadcastChat((ChatMessageBase)new SimpleChatMessage { baseToken = "Egg hatched into a [" + Language.GetString(PickupCatalog.GetPickupDef(PickupCatalog.FindPickupIndex((ItemIndex)EggShareInterop.GetYolk(pickup))).nameToken) + "]" }); self.pickup = pickup2; orig(self, body); } private InspectInfo RoR2_GenericPickupController_GetInfo(orig_GetInfo orig, GenericPickupController self) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0040: 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) if (self.pickup.pickupIndex != PickupCatalog.FindPickupIndex(egg.itemIndex)) { return orig.Invoke(self); } PickupIndex val = PickupCatalog.FindPickupIndex((ItemIndex)EggShareInterop.GetYolk(self.pickup)); InspectInfo val2 = InspectInfo.op_Implicit(PickupCatalog.GetPickupDef(val)); val2.upgradeCount = self.pickup.upgradeValue; return val2; } public string RoR2_GenericPickupController_GetDisplayName(orig_GetDisplayName orig, GenericPickupController self) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) if (self.pickup.pickupIndex != PickupCatalog.FindPickupIndex(egg.itemIndex)) { return orig.Invoke(self); } PickupIndex val = PickupCatalog.FindPickupIndex((ItemIndex)EggShareInterop.GetYolk(self.pickup)); return "Egg[" + Language.GetString(PickupCatalog.GetPickupDef(val).nameToken) + "]"; } public static bool isEgg(UniquePickup up) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) return ((PickupIndex)(ref up.pickupIndex)).itemIndex == egg.itemIndex; } private bool RoR2_EquipmentSlot_FireRecycle(orig_FireRecycle orig, EquipmentSlot self) { //IL_000e: 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_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0015: 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_0024: 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: 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) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0074: 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_0082: 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_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008f: 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_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_00a0: 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_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Expected I4, but got Unknown //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Expected O, but got Unknown //IL_00d4: 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_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) GenericPickupController pickupController = self.currentTarget.pickupController; UniquePickup pickup = pickupController.pickup; if (pickup.pickupIndex != PickupCatalog.FindPickupIndex(egg.itemIndex)) { return orig.Invoke(self); } ItemIndex val = (ItemIndex)EggShareInterop.GetYolk(pickup); UniquePickup val2 = pickup; val2.pickupIndex = PickupCatalog.FindPickupIndex(val); UniquePickup pickup2 = val2; pickupController.pickup = pickup2; bool flag = orig.Invoke(self); UniquePickup pickup3 = pickupController.pickup; ItemIndex itemIndex = ((PickupIndex)(ref pickup3.pickupIndex)).itemIndex; val2 = pickup3; val2.pickupIndex = PickupCatalog.FindPickupIndex(egg.itemIndex); UniquePickup val3 = val2; pickupController.pickup = EggShareInterop.MakeEgg(val3, (int)itemIndex); if (flag) { SimpleChatMessage val4 = new SimpleChatMessage(); val4.baseToken = "Recycling [" + Language.GetString(PickupCatalog.GetPickupDef(PickupCatalog.FindPickupIndex(val)).nameToken) + "] => [" + Language.GetString(PickupCatalog.GetPickupDef(PickupCatalog.FindPickupIndex(itemIndex)).nameToken) + "]"; Chat.SendBroadcastChat((ChatMessageBase)(object)val4); } return flag; } private static void ShareSuite_ItemSharingHooks_OnPurchaseDrop(Action<orig_DropPickup_bool, ShopTerminalBehavior, bool> orig_do_not_invoke, orig_DropPickup_bool orig_orig, ShopTerminalBehavior self, bool isDuplicated) { orig_orig.Invoke(self, isDuplicated); } private void Update() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Expected O, but got Unknown if (Input.GetKeyDown((KeyCode)283)) { string baseToken = ""; Chat.SendBroadcastChat((ChatMessageBase)new SimpleChatMessage { baseToken = baseToken }); } } } 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); } } }
EggShare\patchers\EggSharePatcher.dll
Decompiled a month agousing System; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using Microsoft.CodeAnalysis; using Mono.Cecil; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("EggSharePatcher")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+99e2436ba8bebdb28e7390f480d91dce2962fbd1")] [assembly: AssemblyProduct("EggSharePatcher")] [assembly: AssemblyTitle("EggSharePatcher")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace EggSharePlugin { internal static class EggSharePatcher { public static IEnumerable<string> TargetDLLs { get { yield return "RoR2.dll"; } } public static void Patch(AssemblyDefinition assemblyDef) { //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Expected O, but got Unknown TypeDefinition type = assemblyDef.MainModule.GetType("RoR2", "UniquePickup"); type.Fields.Add(new FieldDefinition("eggshare_yolk", (FieldAttributes)6, assemblyDef.MainModule.ImportReference(typeof(int)))); } } }