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.3
EggShare\EggShareInterop.dll
Decompiled 8 hours 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+ac81e88d1ef1db4d647eac47d34602ffdab531a7")] [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 8 hours 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 R2API; using RoR2; using RoR2.AsyncManagement; 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+ac81e88d1ef1db4d647eac47d34602ffdab531a7")] [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("Ap.EggShare", "EggShare", "0.0.1")] public class EggSharePlugin : BaseUnityPlugin { public const string PluginGUID = "Ap.EggShare"; public const string PluginAuthor = "Ap"; public const string PluginName = "EggShare"; public const string PluginVersion = "0.0.1"; private static ItemDef egg; private static bool isCommandEnabled => RunArtifactManager.instance.IsArtifactEnabled(Artifacts.Command); public void Awake() { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Expected O, but got Unknown //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Expected O, but got Unknown //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Expected O, but got Unknown //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Expected O, but got Unknown //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Expected O, but got Unknown //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Expected O, but got Unknown //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Expected O, but got Unknown //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) egg = CreateItemDef(); ScrapperController.PopRewardPickupQueue += new hook_PopRewardPickupQueue(RoR2_ScrapperController_PopRewardPickupQueue); GenericPickupController.GetInfo += new hook_GetInfo(RoR2_GenericPickupController_GetInfo); 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); 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)); } 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_0051: Expected O, but got Unknown //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0056: 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 = "A special gift just for you!" }); 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 = "EggShare"; val.pickupToken = "ITEM_EGGSHARE_PICKUP"; val.descriptionToken = "ITEM_EGGSHARE_DESC"; val.loreToken = "ITEM_EGGSHARE_LORE"; 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_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000f: 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_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_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_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) UniquePickup val = self.pickup; if (((PickupIndex)(ref val.pickupIndex)).itemIndex != egg.itemIndex) { orig(self, body); return; } UniquePickup pickup = self.pickup; val = pickup; val.pickupIndex = PickupCatalog.FindPickupIndex((ItemIndex)EggShareInterop.GetYolk(pickup)); UniquePickup pickup2 = val; 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_004c: Unknown result type (might be due to invalid IL or missing references) if (self.pickup.pickupIndex != PickupCatalog.FindPickupIndex(egg.itemIndex)) { return orig.Invoke(self); } InspectInfo val = InspectInfo.op_Implicit(PickupCatalog.GetPickupDef(PickupCatalog.FindPickupIndex((ItemIndex)EggShareInterop.GetYolk(self.pickup)))); val.upgradeCount = self.pickup.upgradeValue; return val; } 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_0040: 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_0045: 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_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_0057: 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: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0070: 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_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0085: 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) //IL_008c: 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_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Expected I4, but got Unknown //IL_009d: 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); } UniquePickup val = pickup; val.pickupIndex = PickupCatalog.FindPickupIndex((ItemIndex)EggShareInterop.GetYolk(pickup)); UniquePickup pickup2 = val; pickupController.pickup = pickup2; bool result = orig.Invoke(self); UniquePickup pickup3 = pickupController.pickup; val = pickup3; val.pickupIndex = PickupCatalog.FindPickupIndex(egg.itemIndex); UniquePickup val2 = val; pickupController.pickup = EggShareInterop.MakeEgg(val2, (int)((PickupIndex)(ref pickup3.pickupIndex)).itemIndex); return result; } 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 8 hours 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+ac81e88d1ef1db4d647eac47d34602ffdab531a7")] [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)))); } } }