Decompiled source of Nautilus v1.2.9
plugins/Nautilus/Nautilus.dll
Decompiled 2 weeks ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using EntityStates.VoidJailer.Weapon; using HG; using IL.RoR2; using Microsoft.CodeAnalysis; using Mono.Cecil.Cil; using MonoMod.Cil; using Nautilus.Configuration; using Nautilus.Interactables; using Nautilus.Items; using On.RoR2; using R2API; using R2API.Utils; using RiskOfOptions; using RiskOfOptions.OptionConfigs; using RiskOfOptions.Options; using RoR2; using RoR2.ContentManagement; using RoR2.ExpansionManagement; using RoR2.Navigation; using RoR2.Orbs; using RoR2.UI; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.Events; 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: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("Nautilus")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+dc7bd0259c2e14523489c3a03107f2c550e4edfc")] [assembly: AssemblyProduct("Nautilus")] [assembly: AssemblyTitle("Nautilus")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.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] [Microsoft.CodeAnalysis.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] [Microsoft.CodeAnalysis.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 Nautilus { public static class Helpers { public static GameObject PrepareItemDisplayModel(GameObject itemDisplayModel) { //IL_0022: 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_0041: 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) ItemDisplay val = itemDisplayModel.AddComponent<ItemDisplay>(); List<RendererInfo> list = new List<RendererInfo>(); Renderer[] componentsInChildren = itemDisplayModel.GetComponentsInChildren<Renderer>(); foreach (Renderer val2 in componentsInChildren) { RendererInfo val3 = default(RendererInfo); val3.renderer = val2; val3.defaultMaterial = val2.material; RendererInfo item = val3; list.Add(item); } val.rendererInfos = list.ToArray(); return itemDisplayModel; } } 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); } } [BepInPlugin("com.Hex3.Nautilus", "Nautilus", "1.2.9")] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [NetworkCompatibility(/*Could not decode attribute arguments.*/)] public class Main : BaseUnityPlugin { public class RecipeContentPackProvider : IContentPackProvider { [CompilerGenerated] private sealed class <FinalizeAsync>d__8 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public FinalizeAsyncArgs args; public RecipeContentPackProvider <>4__this; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <FinalizeAsync>d__8(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { if (<>1__state != 0) { return false; } <>1__state = -1; Log.Info("Craftable content provider called (Finalize)"); args.ReportProgress(1f); return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class <GenerateContentPackAsync>d__7 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public GetContentPackAsyncArgs args; public RecipeContentPackProvider <>4__this; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <GenerateContentPackAsync>d__7(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { if (<>1__state != 0) { return false; } <>1__state = -1; Log.Info("Craftable content provider called (Generate)"); ContentPack.Copy(<>4__this.contentPack, args.output); args.ReportProgress(1f); return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class <LoadStaticContentAsync>d__6 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public LoadStaticContentAsyncArgs args; public RecipeContentPackProvider <>4__this; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <LoadStaticContentAsync>d__6(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { if (<>1__state != 0) { return false; } <>1__state = -1; Log.Info("Craftable content provider called (Load)"); <>4__this.contentPack.identifier = <>4__this.identifier; <>4__this.contentPack.craftableDefs.Add(Craftables.ToArray()); args.ReportProgress(1f); return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } internal ContentPack contentPack = new ContentPack(); public static List<CraftableDef> Craftables = new List<CraftableDef>(); public string identifier => "com.hex3.NautilusRecipes"; public void Initialise() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown ContentManager.collectContentPackProviders += new CollectContentPackProvidersDelegate(AddSelf); } private void AddSelf(AddContentPackProviderDelegate add) { add.Invoke((IContentPackProvider)(object)this); } [IteratorStateMachine(typeof(<LoadStaticContentAsync>d__6))] public IEnumerator LoadStaticContentAsync(LoadStaticContentAsyncArgs args) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <LoadStaticContentAsync>d__6(0) { <>4__this = this, args = args }; } [IteratorStateMachine(typeof(<GenerateContentPackAsync>d__7))] public IEnumerator GenerateContentPackAsync(GetContentPackAsyncArgs args) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <GenerateContentPackAsync>d__7(0) { <>4__this = this, args = args }; } [IteratorStateMachine(typeof(<FinalizeAsync>d__8))] public IEnumerator FinalizeAsync(FinalizeAsyncArgs args) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <FinalizeAsync>d__8(0) { <>4__this = this, args = args }; } } [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static hook_OnMainMenuControllerInitialized <>9__9_0; internal void <Awake>b__9_0(orig_OnMainMenuControllerInitialized orig, RoR2Application self) { ItemInit.FormatDescriptions(); orig.Invoke(self); } } public const string NAUTILUS_GUID = "com.Hex3.Nautilus"; public const string NAUTILUS_NAME = "Nautilus"; public const string NAUTILUS_VER = "1.2.9"; public static Main Instance; public static ExpansionDef Expansion; public static AssetBundle Assets; public static ItemRelationshipProvider ItemRelationshipProvider = ScriptableObject.CreateInstance<ItemRelationshipProvider>(); public static List<Pair> ItemConversionList = new List<Pair>(); public static ConfigEntry<bool> Config_Enabled; public void Awake() { //IL_007c: 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_0097: Expected O, but got Unknown //IL_0097: Expected O, but got Unknown //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Expected O, but got Unknown //IL_01a5: Unknown result type (might be due to invalid IL or missing references) //IL_01aa: Unknown result type (might be due to invalid IL or missing references) //IL_054b: Unknown result type (might be due to invalid IL or missing references) //IL_0550: Unknown result type (might be due to invalid IL or missing references) //IL_0556: Expected O, but got Unknown Log.Init(((BaseUnityPlugin)this).Logger); Log.Info("Init Nautilus 1.2.9"); Instance = this; Log.Info("Creating assets..."); using (Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("Nautilus.nautilusvfx")) { Assets = AssetBundle.LoadFromStream(stream); } InteractableInit.shrineOfTheDeep = InteractableInit.shrineOfTheDeep; Log.Info("Creating config..."); Config_Enabled = ((BaseUnityPlugin)Instance).Config.Bind<bool>(new ConfigDefinition("CONFIG - IMPORTANT", "Enable custom config"), false, new ConfigDescription("Set to 'true' to enable custom configuration for this mod. False by default to allow balance changes to take effect.", (AcceptableValueBase)null, Array.Empty<object>())); ModSettingsManager.SetModDescription("Adds new void counterparts for vanilla items."); ModSettingsManager.SetModIcon(Assets.LoadAsset<Sprite>("Assets/icons/expansion.png")); ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(Config_Enabled, true)); ConfigItem.Init(); Log.Info("Creating expansion..."); Expansion = ScriptableObject.CreateInstance<ExpansionDef>(); ((Object)Expansion).name = "Nautilus"; Expansion.nameToken = "NT_EXPANSION_NAME"; Expansion.descriptionToken = "NT_EXPANSION_DESC"; Expansion.iconSprite = Assets.LoadAsset<Sprite>("Assets/icons/expansion.png"); Expansion.disabledIconSprite = Assets.LoadAsset<Sprite>("Assets/icons/expansion-inactive.png"); Expansion.requiredEntitlement = null; ContentAddition.AddExpansionDef(Expansion); Log.Info("Creating items..."); ItemInit.Init(); Log.Info("Creating interactables..."); InteractableInit.Init(); Log.Info("Creating void conversions..."); ((Object)ItemRelationshipProvider).name = "NT_ITEMRELATIONSHIPPROVIDER"; ItemRelationshipProvider.relationshipType = Addressables.LoadAssetAsync<ItemRelationshipType>((object)"RoR2/DLC1/Common/ContagiousItem.asset").WaitForCompletion(); ItemRelationshipProvider.relationships = ItemConversionList.ToArray(); ContentAddition.AddItemRelationshipProvider(ItemRelationshipProvider); Log.Info("Creating crafting recipes..."); if (ItemInit.WeepingFungus_Recipe.Value) { ItemInit.MakeCorruptionRecipe(ItemInit.WeepingFungus_Ingredient1.Value, ItemInit.WeepingFungus_Ingredient2.Value, "MushroomVoid"); } if (ItemInit.SaferSpaces_Recipe.Value) { ItemInit.MakeCorruptionRecipe(ItemInit.SaferSpaces_Ingredient1.Value, ItemInit.SaferSpaces_Ingredient2.Value, "BearVoid"); } if (ItemInit.EncrustedKey_Recipe.Value) { ItemInit.MakeCorruptionRecipe(ItemInit.EncrustedKey_Ingredient1.Value, ItemInit.EncrustedKey_Ingredient2.Value, "TreasureCacheVoid"); } if (ItemInit.Lenses_Recipe.Value) { ItemInit.MakeCorruptionRecipe(ItemInit.Lenses_Ingredient1.Value, ItemInit.Lenses_Ingredient2.Value, "CritGlassesVoid"); } if (ItemInit.NeedleTick_Recipe.Value) { ItemInit.MakeCorruptionRecipe(ItemInit.NeedleTick_Ingredient1.Value, ItemInit.NeedleTick_Ingredient2.Value, "BleedOnHitVoid"); } if (ItemInit.LysateCell_Recipe.Value) { ItemInit.MakeCorruptionRecipe(ItemInit.LysateCell_Ingredient1.Value, ItemInit.LysateCell_Ingredient2.Value, "EquipmentMagazineVoid"); } if (ItemInit.Polylute_Recipe.Value) { ItemInit.MakeCorruptionRecipe(ItemInit.Polylute_Ingredient1.Value, ItemInit.Polylute_Ingredient2.Value, "ChainLightningVoid"); } if (ItemInit.Tentabauble_Recipe.Value) { ItemInit.MakeCorruptionRecipe(ItemInit.Tentabauble_Ingredient1.Value, ItemInit.Tentabauble_Ingredient2.Value, "SlowOnHitVoid"); } if (ItemInit.Voidsent_Recipe.Value) { ItemInit.MakeCorruptionRecipe(ItemInit.Voidsent_Ingredient1.Value, ItemInit.Voidsent_Ingredient2.Value, "ExplodeOnDeathVoid"); } if (ItemInit.Band_Recipe.Value) { ItemInit.MakeCorruptionRecipe(ItemInit.Band_Ingredient1.Value, ItemInit.Band_Ingredient2.Value, "ElementalRingVoid"); } if (ItemInit.Band_Recipe.Value) { ItemInit.MakeCorruptionRecipe(ItemInit.Band_Ingredient1Alt.Value, ItemInit.Band_Ingredient2.Value, "ElementalRingVoid"); } if (ItemInit.PlasmaShrimp_Recipe.Value) { ItemInit.MakeCorruptionRecipe(ItemInit.PlasmaShrimp_Ingredient1.Value, ItemInit.PlasmaShrimp_Ingredient2.Value, "MissileVoid"); } if (ItemInit.Benthic_Recipe.Value) { ItemInit.MakeCorruptionRecipe(ItemInit.Benthic_Ingredient1.Value, ItemInit.Benthic_Ingredient2.Value, "CloverVoid"); } if (ItemInit.Larva_Recipe.Value) { ItemInit.MakeCorruptionRecipe(ItemInit.Larva_Ingredient1.Value, ItemInit.Larva_Ingredient2.Value, "ExtraLifeVoid"); } if (ItemInit.Zoea_Recipe.Value) { ItemInit.MakeCorruptionRecipe(ItemInit.Zoea_Ingredient1.Value, ItemInit.Zoea_Ingredient2.Value, "VoidMegaCrabItem"); } for (int i = 0; i < ItemInit.RecipeList.Count; i++) { CraftableDef val = ScriptableObject.CreateInstance<CraftableDef>(); ((Object)val).name = "NautilusRecipe" + i; RecipeContentPackProvider.Craftables.Add(val); } new RecipeContentPackProvider().Initialise(); ((ResourceAvailability)(ref PickupCatalog.availability)).CallWhenAvailable((Action)InitRecipes); Log.Info("Adding language hooks..."); object obj = <>c.<>9__9_0; if (obj == null) { hook_OnMainMenuControllerInitialized val2 = delegate(orig_OnMainMenuControllerInitialized orig, RoR2Application self) { ItemInit.FormatDescriptions(); orig.Invoke(self); }; <>c.<>9__9_0 = val2; obj = (object)val2; } RoR2Application.OnMainMenuControllerInitialized += (hook_OnMainMenuControllerInitialized)obj; Log.Info("Done"); } public void InitRecipes() { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Expected O, but got Unknown //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_004e: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Expected O, but got Unknown //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Expected O, but got Unknown //IL_0088: Unknown result type (might be due to invalid IL or missing references) int num = 0; foreach (VoidRecipe recipe in ItemInit.RecipeList) { CraftableDef val = RecipeContentPackProvider.Craftables[num]; Recipe val2 = new Recipe(); val2.amountToDrop = 1; val2.ingredients = (RecipeIngredient[])(object)new RecipeIngredient[2] { new RecipeIngredient { pickup = (Object)(object)ItemCatalog.GetItemDef(ItemCatalog.FindItemIndex(recipe.ingredient1)) }, new RecipeIngredient { pickup = (Object)(object)ItemCatalog.GetItemDef(ItemCatalog.FindItemIndex(recipe.ingredient2)) } }; val.pickup = (Object)(object)ItemCatalog.GetItemDef(ItemCatalog.FindItemIndex(recipe.result)); val.recipes = (Recipe[])(object)new Recipe[1] { val2 }; RecipeContentPackProvider.Craftables.Add(val); Log.Info("Added recipe for " + recipe.result + ": " + recipe.ingredient1 + " + " + recipe.ingredient2); num++; } } } } namespace Nautilus.Items { public class CollapseInfectOrb : Orb { public override void Begin() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: 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_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Expected O, but got Unknown EffectData val = new EffectData { origin = base.origin, genericFloat = ((Orb)this).duration }; val.SetHurtBoxReference(base.target); EffectManager.SpawnEffect(OrbStorageUtility.Get("Prefabs/Effects/OrbEffects/InfusionOrbEffect"), val, true); } public static void CreateInfectOrb(Vector3 origin, HurtBox target) { //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) CollapseInfectOrb collapseInfectOrb = new CollapseInfectOrb(); ((Orb)collapseInfectOrb).duration = 0.5f; ((Orb)collapseInfectOrb).origin = origin; ((Orb)collapseInfectOrb).target = target; OrbManager.instance.AddOrb((Orb)(object)collapseInfectOrb); } } public abstract class ItemBase { public ItemDef ItemDef; public string Name; public ItemTag[] Tags; public ItemTier Tier; public bool CanRemove; public bool IsConsumed; public bool Hidden; public ItemIndex ItemIndex => ItemCatalog.FindItemIndex(((Object)ItemDef).name); public abstract bool Enabled { get; } public abstract ItemDef ConversionItemDef { get; } public abstract GameObject itemPrefab { get; } public abstract Sprite itemIcon { get; } public ItemBase(string _name, ItemTag[] _tags, ItemTier _tier, bool _canRemove, bool _isConsumed, bool _hidden) { //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) Name = _name; Tags = _tags; Tier = _tier; CanRemove = _canRemove; IsConsumed = _isConsumed; Hidden = _hidden; ItemInit.ItemList.Add(this); } public bool RegisterItem() { //IL_00e4: 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) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_01c9: Unknown result type (might be due to invalid IL or missing references) //IL_01d3: Expected O, but got Unknown //IL_01e8: Unknown result type (might be due to invalid IL or missing references) //IL_0208: Unknown result type (might be due to invalid IL or missing references) //IL_020a: Unknown result type (might be due to invalid IL or missing references) //IL_0211: Unknown result type (might be due to invalid IL or missing references) if (!Enabled) { return Enabled; } ItemDef = ScriptableObject.CreateInstance<ItemDef>(); ((Object)ItemDef).name = Name; ItemDef.nameToken = "NT_ITEM_" + Name.ToUpper() + "_NAME"; ItemDef.pickupToken = "NT_ITEM_" + Name.ToUpper() + "_PICKUP"; ItemDef.descriptionToken = "NT_ITEM_" + Name.ToUpper() + "_DESC"; ItemDef.loreToken = "NT_ITEM_" + Name.ToUpper() + "_LORE"; ItemDef.tags = Tags; ItemDef.tier = Tier; ItemDef.deprecatedTier = Tier; ItemDef.canRemove = CanRemove; ItemDef.isConsumed = IsConsumed; ItemDef.hidden = Hidden; ItemDef.requiredExpansion = Main.Expansion; ItemDef.pickupModelPrefab = itemPrefab; ItemDef.pickupIconSprite = itemIcon; if (Object.op_Implicit((Object)(object)itemPrefab)) { Transform child = itemPrefab.transform.GetChild(0); ModelPanelParameters val = itemPrefab.AddComponent<ModelPanelParameters>(); val.minDistance = 1f; val.maxDistance = 2f; val.focusPointTransform = child; val.cameraPositionTransform = child; } ItemAPI.Add(new CustomItem(ItemDef, AddItemDisplays())); if (Object.op_Implicit((Object)(object)ConversionItemDef)) { Pair val2 = default(Pair); val2.itemDef1 = ConversionItemDef; val2.itemDef2 = ItemDef; Pair item = val2; Main.ItemConversionList.Add(item); Log.Info($"Added void conversion from {((Object)ConversionItemDef).name} to {((Object)ItemDef).name}"); } return Enabled; } public int GetItemCountEffective(CharacterBody body) { int result = 0; if (Object.op_Implicit((Object)(object)body) && Object.op_Implicit((Object)(object)body.inventory)) { result = body.inventory.GetItemCountEffective(ItemDef); } return result; } public int GetItemCountPermanent(CharacterBody body) { int result = 0; if (Object.op_Implicit((Object)(object)body) && Object.op_Implicit((Object)(object)body.inventory)) { result = body.inventory.GetItemCountPermanent(ItemDef); } return result; } public abstract void FormatDescriptionTokens(); public abstract void RegisterHooks(); public abstract void AddCorruptionRecipe(); public abstract ItemDisplayRuleDict AddItemDisplays(); } public static class ItemInit { public static ConfigItem<bool> WeepingFungus_Recipe = new ConfigItem<bool>("Vanilla: Weeping Fungus", "Recipe enabled", "Should this item have a custom corruption recipe?", _defaultValue: true); public static ConfigItem<string> WeepingFungus_Ingredient1 = new ConfigItem<string>("Vanilla: Weeping Fungus", "Recipe ingredient 1", "First ingredient for corruption recipe", "Mushroom"); public static ConfigItem<string> WeepingFungus_Ingredient2 = new ConfigItem<string>("Vanilla: Weeping Fungus", "Recipe ingredient 2", "Second ingredient for corruption recipe", "Crabsinthe"); public static ConfigItem<bool> SaferSpaces_Recipe = new ConfigItem<bool>("Vanilla: Safer Spaces", "Recipe enabled", "Should this item have a custom corruption recipe?", _defaultValue: true); public static ConfigItem<string> SaferSpaces_Ingredient1 = new ConfigItem<string>("Vanilla: Safer Spaces", "Recipe ingredient 1", "First ingredient for corruption recipe", "Bear"); public static ConfigItem<string> SaferSpaces_Ingredient2 = new ConfigItem<string>("Vanilla: Safer Spaces", "Recipe ingredient 2", "Second ingredient for corruption recipe", "BleedOnHitVoid"); public static ConfigItem<bool> EncrustedKey_Recipe = new ConfigItem<bool>("Vanilla: Encrusted Key", "Recipe enabled", "Should this item have a custom corruption recipe?", _defaultValue: true); public static ConfigItem<string> EncrustedKey_Ingredient1 = new ConfigItem<string>("Vanilla: Encrusted Key", "Recipe ingredient 1", "First ingredient for corruption recipe", "TreasureCache"); public static ConfigItem<string> EncrustedKey_Ingredient2 = new ConfigItem<string>("Vanilla: Encrusted Key", "Recipe ingredient 2", "Second ingredient for corruption recipe", "VoidWatch"); public static ConfigItem<bool> Lenses_Recipe = new ConfigItem<bool>("Vanilla: Lost Seers Lenses", "Recipe enabled", "Should this item have a custom corruption recipe?", _defaultValue: true); public static ConfigItem<string> Lenses_Ingredient1 = new ConfigItem<string>("Vanilla: Lost Seers Lenses", "Recipe ingredient 1", "First ingredient for corruption recipe", "CritGlasses"); public static ConfigItem<string> Lenses_Ingredient2 = new ConfigItem<string>("Vanilla: Lost Seers Lenses", "Recipe ingredient 2", "Second ingredient for corruption recipe", "BleedOnHitVoid"); public static ConfigItem<bool> NeedleTick_Recipe = new ConfigItem<bool>("Vanilla: Needletick", "Recipe enabled", "Should this item have a custom corruption recipe?", _defaultValue: true); public static ConfigItem<string> NeedleTick_Ingredient1 = new ConfigItem<string>("Vanilla: Needletick", "Recipe ingredient 1", "First ingredient for corruption recipe", "BleedOnHit"); public static ConfigItem<string> NeedleTick_Ingredient2 = new ConfigItem<string>("Vanilla: Needletick", "Recipe ingredient 2", "Second ingredient for corruption recipe", "Crabsinthe"); public static ConfigItem<bool> LysateCell_Recipe = new ConfigItem<bool>("Vanilla: Lysate Cell", "Recipe enabled", "Should this item have a custom corruption recipe?", _defaultValue: true); public static ConfigItem<string> LysateCell_Ingredient1 = new ConfigItem<string>("Vanilla: Lysate Cell", "Recipe ingredient 1", "First ingredient for corruption recipe", "EquipmentMagazine"); public static ConfigItem<string> LysateCell_Ingredient2 = new ConfigItem<string>("Vanilla: Lysate Cell", "Recipe ingredient 2", "Second ingredient for corruption recipe", "MushroomVoid"); public static ConfigItem<bool> Polylute_Recipe = new ConfigItem<bool>("Vanilla: Polylute", "Recipe enabled", "Should this item have a custom corruption recipe?", _defaultValue: true); public static ConfigItem<string> Polylute_Ingredient1 = new ConfigItem<string>("Vanilla: Polylute", "Recipe ingredient 1", "First ingredient for corruption recipe", "ChainLightning"); public static ConfigItem<string> Polylute_Ingredient2 = new ConfigItem<string>("Vanilla: Polylute", "Recipe ingredient 2", "Second ingredient for corruption recipe", "CritGlassesVoid"); public static ConfigItem<bool> Tentabauble_Recipe = new ConfigItem<bool>("Vanilla: Tentabauble", "Recipe enabled", "Should this item have a custom corruption recipe?", _defaultValue: true); public static ConfigItem<string> Tentabauble_Ingredient1 = new ConfigItem<string>("Vanilla: Tentabauble", "Recipe ingredient 1", "First ingredient for corruption recipe", "SlowOnHit"); public static ConfigItem<string> Tentabauble_Ingredient2 = new ConfigItem<string>("Vanilla: Tentabauble", "Recipe ingredient 2", "Second ingredient for corruption recipe", "Crabsinthe"); public static ConfigItem<bool> Voidsent_Recipe = new ConfigItem<bool>("Vanilla: Voidsent Flame", "Recipe enabled", "Should this item have a custom corruption recipe?", _defaultValue: true); public static ConfigItem<string> Voidsent_Ingredient1 = new ConfigItem<string>("Vanilla: Voidsent Flame", "Recipe ingredient 1", "First ingredient for corruption recipe", "ExplodeOnDeath"); public static ConfigItem<string> Voidsent_Ingredient2 = new ConfigItem<string>("Vanilla: Voidsent Flame", "Recipe ingredient 2", "Second ingredient for corruption recipe", "VoidWatch"); public static ConfigItem<bool> Band_Recipe = new ConfigItem<bool>("Vanilla: Singularity Band", "Recipe enabled", "Should this item have a custom corruption recipe?", _defaultValue: true); public static ConfigItem<string> Band_Ingredient1 = new ConfigItem<string>("Vanilla: Singularity Band", "Recipe ingredient 1", "First ingredient for corruption recipe", "FireRing"); public static ConfigItem<string> Band_Ingredient1Alt = new ConfigItem<string>("Vanilla: Singularity Band", "Recipe ingredient 1 (alt)", "First ingredient for corruption recipe (alt)", "IceRing"); public static ConfigItem<string> Band_Ingredient2 = new ConfigItem<string>("Vanilla: Singularity Band", "Recipe ingredient 2", "Second ingredient for corruption recipe", "BearVoid"); public static ConfigItem<bool> PlasmaShrimp_Recipe = new ConfigItem<bool>("Vanilla: Plasma Shrimp", "Recipe enabled", "Should this item have a custom corruption recipe?", _defaultValue: true); public static ConfigItem<string> PlasmaShrimp_Ingredient1 = new ConfigItem<string>("Vanilla: Plasma Shrimp", "Recipe ingredient 1", "First ingredient for corruption recipe", "Missile"); public static ConfigItem<string> PlasmaShrimp_Ingredient2 = new ConfigItem<string>("Vanilla: Plasma Shrimp", "Recipe ingredient 2", "Second ingredient for corruption recipe", "BearVoid"); public static ConfigItem<bool> Benthic_Recipe = new ConfigItem<bool>("Vanilla: Benthic Bloom", "Recipe enabled", "Should this item have a custom corruption recipe?", _defaultValue: true); public static ConfigItem<string> Benthic_Ingredient1 = new ConfigItem<string>("Vanilla: Benthic Bloom", "Recipe ingredient 1", "First ingredient for corruption recipe", "Clover"); public static ConfigItem<string> Benthic_Ingredient2 = new ConfigItem<string>("Vanilla: Benthic Bloom", "Recipe ingredient 2", "Second ingredient for corruption recipe", "ChainLightningVoid"); public static ConfigItem<bool> Larva_Recipe = new ConfigItem<bool>("Vanilla: Pluripotent Larva", "Recipe enabled", "Should this item have a custom corruption recipe?", _defaultValue: true); public static ConfigItem<string> Larva_Ingredient1 = new ConfigItem<string>("Vanilla: Pluripotent Larva", "Recipe ingredient 1", "First ingredient for corruption recipe", "ExtraLife"); public static ConfigItem<string> Larva_Ingredient2 = new ConfigItem<string>("Vanilla: Pluripotent Larva", "Recipe ingredient 2", "Second ingredient for corruption recipe", "EquipmentMagazineVoid"); public static ConfigItem<bool> Zoea_Recipe = new ConfigItem<bool>("Vanilla: Newly Hatched Zoea", "Recipe enabled", "Should this item have a custom corruption recipe?", _defaultValue: true); public static ConfigItem<string> Zoea_Ingredient1 = new ConfigItem<string>("Vanilla: Newly Hatched Zoea", "Recipe ingredient 1", "First ingredient for corruption recipe", "BeetleGland"); public static ConfigItem<string> Zoea_Ingredient2 = new ConfigItem<string>("Vanilla: Newly Hatched Zoea", "Recipe ingredient 2", "Second ingredient for corruption recipe", "SlowOnHitVoid"); private static List<ItemBase> _itemList; private static List<VoidRecipe> _recipeList; public static DrenchedPerforator DrenchedPerforator; public static EffigyOfRot EffigyOfRot; public static MobiusNode MobiusNode; public static OsmiumShackles OsmiumShackles; public static RebelSoul RebelSoul; public static Rebirth Rebirth; public static SplitNucleus SplitNucleus; public static TenebralGland TenebralGland; public static Crabsinthe Crabsinthe; public static VoidWatch VoidWatch; public static Wellies Wellies; public static AlteredSoul AlteredSoul; public static MotherOfPearl MotherOfPearl; public static ShimmeringNautilus ShimmeringNautilus; public static SkullSprout SkullSprout; public static Xenobacteria Xenobacteria; public static HydraTooth HydraTooth; public static PaleStar PaleStar; public static PaleStarConsumed PaleStarConsumed; public static ViscousPot ViscousPot; public static List<ItemBase> ItemList { get { if (_itemList == null) { _itemList = new List<ItemBase>(); } return _itemList; } set { _itemList = value; } } public static List<VoidRecipe> RecipeList { get { if (_recipeList == null) { _recipeList = new List<VoidRecipe>(); } return _recipeList; } set { _recipeList = value; } } public static void Init() { foreach (ItemBase item in ItemList) { if (item.RegisterItem()) { Log.Info("Added definition for item " + item.Name); item.RegisterHooks(); item.AddCorruptionRecipe(); } } } public static void FormatDescriptions() { foreach (ItemBase item in ItemList) { if (item.Enabled) { item.FormatDescriptionTokens(); } } } public static void MakeCorruptionRecipe(string ingredient1, string ingredient2, string result) { if (string.IsNullOrEmpty(ingredient1) || string.IsNullOrEmpty(ingredient2) || string.IsNullOrEmpty(result)) { Log.Warning("Failed adding recipe for " + result + " due to missing item names!"); return; } VoidRecipe voidRecipe = default(VoidRecipe); voidRecipe.ingredient1 = ingredient1; voidRecipe.ingredient2 = ingredient2; voidRecipe.result = result; VoidRecipe item = voidRecipe; RecipeList.Add(item); } static ItemInit() { ItemTag[] array = new ItemTag[4]; RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); DrenchedPerforator = new DrenchedPerforator("DrenchedPerforator", (ItemTag[])(object)array, (ItemTier)9); ItemTag[] array2 = new ItemTag[5]; RuntimeHelpers.InitializeArray(array2, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); EffigyOfRot = new EffigyOfRot("EffigyOfRot", (ItemTag[])(object)array2, (ItemTier)9); MobiusNode = new MobiusNode("MobiusNode", (ItemTag[])(object)new ItemTag[1] { (ItemTag)2 }, (ItemTier)9); OsmiumShackles = new OsmiumShackles("OsmiumShackles", (ItemTag[])(object)new ItemTag[1] { (ItemTag)1 }, (ItemTier)9); ItemTag[] array3 = new ItemTag[5]; RuntimeHelpers.InitializeArray(array3, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); RebelSoul = new RebelSoul("RebelSoul", (ItemTag[])(object)array3, (ItemTier)9); ItemTag[] array4 = new ItemTag[6]; RuntimeHelpers.InitializeArray(array4, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); Rebirth = new Rebirth("Rebirth", (ItemTag[])(object)array4, (ItemTier)9); SplitNucleus = new SplitNucleus("SplitNucleus", (ItemTag[])(object)new ItemTag[1] { (ItemTag)3 }, (ItemTier)9); TenebralGland = new TenebralGland("TenebralGland", (ItemTag[])(object)new ItemTag[1] { (ItemTag)1 }, (ItemTier)9); Crabsinthe = new Crabsinthe("Crabsinthe", (ItemTag[])(object)new ItemTag[1] { (ItemTag)2 }, (ItemTier)6); VoidWatch = new VoidWatch("VoidWatch", (ItemTag[])(object)new ItemTag[1] { (ItemTag)1 }, (ItemTier)6); Wellies = new Wellies("Wellies", (ItemTag[])(object)new ItemTag[1] { (ItemTag)3 }, (ItemTier)6); AlteredSoul = new AlteredSoul("AlteredSoul", (ItemTag[])(object)new ItemTag[2] { (ItemTag)3, (ItemTag)4 }, (ItemTier)8); ItemTag[] array5 = new ItemTag[4]; RuntimeHelpers.InitializeArray(array5, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); MotherOfPearl = new MotherOfPearl("MotherOfPearl", (ItemTag[])(object)array5, (ItemTier)8); ItemTag[] array6 = new ItemTag[5]; RuntimeHelpers.InitializeArray(array6, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); ShimmeringNautilus = new ShimmeringNautilus("ShimmeringNautilus", (ItemTag[])(object)array6, (ItemTier)8); SkullSprout = new SkullSprout("Skullsprout", (ItemTag[])(object)new ItemTag[1] { (ItemTag)1 }, (ItemTier)8); Xenobacteria = new Xenobacteria("Xenobacteria", (ItemTag[])(object)new ItemTag[2] { (ItemTag)1, (ItemTag)4 }, (ItemTier)8); HydraTooth = new HydraTooth("HydraTooth", (ItemTag[])(object)new ItemTag[2] { (ItemTag)1, (ItemTag)4 }, (ItemTier)7); ItemTag[] array7 = new ItemTag[3]; RuntimeHelpers.InitializeArray(array7, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); PaleStar = new PaleStar("PaleStar", (ItemTag[])(object)array7, (ItemTier)7); ItemTag[] array8 = new ItemTag[4]; RuntimeHelpers.InitializeArray(array8, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); PaleStarConsumed = new PaleStarConsumed("PaleStarConsumed", (ItemTag[])(object)array8, (ItemTier)5); ViscousPot = new ViscousPot("ViscousPot", (ItemTag[])(object)new ItemTag[2] { (ItemTag)2, (ItemTag)1 }, (ItemTier)7); } } public struct VoidRecipe { public string ingredient1; public string ingredient2; public string result; } public class PoisonInfectOrb : Orb { public override void Begin() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: 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_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Expected O, but got Unknown EffectData val = new EffectData { origin = base.origin, genericFloat = ((Orb)this).duration }; val.SetHurtBoxReference(base.target); EffectManager.SpawnEffect(OrbStorageUtility.Get("Prefabs/Effects/OrbEffects/CrocoDiseaseOrbEffect"), val, true); } public static void CreateInfectOrb(Vector3 origin, HurtBox target) { //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) PoisonInfectOrb poisonInfectOrb = new PoisonInfectOrb(); ((Orb)poisonInfectOrb).duration = 0.5f; ((Orb)poisonInfectOrb).origin = origin; ((Orb)poisonInfectOrb).target = target; OrbManager.instance.AddOrb((Orb)(object)poisonInfectOrb); } } public class DrenchedPerforator : ItemBase { private GameObject _explodePrefab; [CompilerGenerated] [DebuggerBrowsable(DebuggerBrowsableState.Never)] private GameObject <explodePrefab>k__BackingField; private GameObject _individualExplodePrefab; [CompilerGenerated] [DebuggerBrowsable(DebuggerBrowsableState.Never)] private GameObject <individualExplodePrefab>k__BackingField; private ExplicitPickupDropTable _explicitPickupDropTable; [CompilerGenerated] [DebuggerBrowsable(DebuggerBrowsableState.Never)] private ExplicitPickupDropTable <explicitPickupDropTable>k__BackingField; public static ConfigItem<bool> DrenchedPerforator_Enabled = new ConfigItem<bool>("Void boss: Drenched Perforator", "Item enabled", "Should this item appear in runs?", _defaultValue: true); public static ConfigItem<float> DrenchedPerforator_Threshold = new ConfigItem<float>("Void boss: Drenched Perforator", "Damage threshold", "Repeating fractional damage threshold for additional stacks of collapse to be added.", 6f, 1f, 12f, 0.5f); public static ConfigItem<int> DrenchedPerforator_Stacks = new ConfigItem<int>("Void boss: Drenched Perforator", "Collapse stacks", "Number of stacks of collapse to add on passing threshold.", 1, 1f, 5f, 1f); public static ConfigItem<int> DrenchedPerforator_StacksStack = new ConfigItem<int>("Void boss: Drenched Perforator", "Collapse stacks (per stack)", "Number of stacks of collapse to add on passing threshold, per additional stack.", 1, 1f, 5f, 1f); public static ConfigItem<float> DrenchedPerforator_ExplosionRadiusv2 = new ConfigItem<float>("Void boss: Drenched Perforator", "Explosion radius", "Meters radius for the base collapse explosion.", 12f, 1f, 24f, 1f); public static ConfigItem<float> DrenchedPerforator_ExplosionRadiusIncreasev2 = new ConfigItem<float>("Void boss: Drenched Perforator", "Explosion radius increase", "Meters radius the collapse explosion expands when additional collapse stacks are added.", 4f, 1f, 8f, 1f); public static ConfigItem<float> DrenchedPerforator_ExplosionDamage = new ConfigItem<float>("Void boss: Drenched Perforator", "Explosion damage", "Fractional damage (1 = 100%) dealt by explosion.", 4f, 1f, 12f, 0.1f); public static ConfigItem<float> DrenchedPerforator_ExplosionProcCoefficient = new ConfigItem<float>("Void boss: Drenched Perforator", "Explosion proc coefficient", "Proc coefficient of the on-collapse explosion.", 0.2f, 0f, 1f, 0.05f); public static ConfigItem<bool> DrenchedPerforator_Recipe = new ConfigItem<bool>("Void boss: Drenched Perforator", "Recipe enabled", "Should this item have a custom corruption recipe?", _defaultValue: true); public static ConfigItem<string> DrenchedPerforator_Ingredient1 = new ConfigItem<string>("Void boss: Drenched Perforator", "Recipe ingredient 1", "First ingredient for corruption recipe", "FireballsOnHit"); public static ConfigItem<string> DrenchedPerforator_Ingredient1Alt = new ConfigItem<string>("Void boss: Drenched Perforator", "Recipe ingredient 1 (alt)", "First ingredient for corruption recipe (alt)", "LightningStrikeOnHit"); public static ConfigItem<string> DrenchedPerforator_Ingredient2 = new ConfigItem<string>("Void boss: Drenched Perforator", "Recipe ingredient 2", "Second ingredient for corruption recipe", "HydraTooth"); public override bool Enabled => DrenchedPerforator_Enabled.Value; public override ItemDef ConversionItemDef => Addressables.LoadAssetAsync<ItemDef>((object)"RoR2/Base/FireballsOnHit/FireballsOnHit.asset").WaitForCompletion(); public override GameObject itemPrefab => OverwritePrefabMaterials(); public override Sprite itemIcon => Main.Assets.LoadAsset<Sprite>("Assets/icons/drenchedPerforator.png"); public ItemDef ConversionItemDefExtra => Addressables.LoadAssetAsync<ItemDef>((object)"RoR2/Base/LightningStrikeOnHit/LightningStrikeOnHit.asset").WaitForCompletion(); public Material material0 => Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/Common/TrimSheets/matTrimSheetMetalLightSnow.mat").WaitForCompletion(); public Material material1 => Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/Croco/matCrocoSpine.mat").WaitForCompletion(); public GameObject explodePrefab { get { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_explodePrefab == (Object)null) { _explodePrefab = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/VoidMegaCrab/VoidMegaCrabDeathBombExplosion.prefab").WaitForCompletion(); } return _explodePrefab; } [CompilerGenerated] set { <explodePrefab>k__BackingField = value; } } public GameObject individualExplodePrefab { get { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_individualExplodePrefab == (Object)null) { _individualExplodePrefab = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/BleedOnHitVoid/FractureImpactEffect.prefab").WaitForCompletion(); } return _individualExplodePrefab; } [CompilerGenerated] set { <individualExplodePrefab>k__BackingField = value; } } public ExplicitPickupDropTable explicitPickupDropTable { get { //IL_002d: 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) //IL_004d: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_explicitPickupDropTable == (Object)null) { _explicitPickupDropTable = ScriptableObject.CreateInstance<ExplicitPickupDropTable>(); _explicitPickupDropTable.pickupEntries = (PickupDefEntry[])(object)new PickupDefEntry[1] { new PickupDefEntry { pickupDef = (Object)(object)ItemDef, pickupWeight = 1f } }; } ((PickupDropTable)_explicitPickupDropTable).Regenerate(Run.instance); return _explicitPickupDropTable; } [CompilerGenerated] set { <explicitPickupDropTable>k__BackingField = value; } } public DrenchedPerforator(string _name, ItemTag[] _tags, ItemTier _tier, bool _canRemove = true, bool _isConsumed = false, bool _hidden = false) : base(_name, _tags, _tier, _canRemove, _isConsumed, _hidden) { }//IL_0003: Unknown result type (might be due to invalid IL or missing references) public GameObject OverwritePrefabMaterials() { GameObject val = Main.Assets.LoadAsset<GameObject>("Assets/prefabs/drenchedPerforator.prefab"); Material[] materialArray = (Material[])(object)new Material[2] { material0, material1 }; ((Renderer)val.GetComponentInChildren<MeshRenderer>()).SetMaterialArray(materialArray); return val; } public override void FormatDescriptionTokens() { string descriptionToken = ItemDef.descriptionToken; LanguageAPI.AddOverlay(descriptionToken, string.Format(Language.currentLanguage.GetLocalizedStringByToken(descriptionToken), DrenchedPerforator_Threshold.Value * 100f, DrenchedPerforator_Stacks.Value, DrenchedPerforator_StacksStack.Value, DrenchedPerforator_ExplosionDamage.Value * 100f, DrenchedPerforator_ExplosionRadiusv2.Value, DrenchedPerforator_ExplosionRadiusIncreasev2.Value)); } public override void RegisterHooks() { //IL_0003: 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_002a: 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_0068: Expected O, but got Unknown Pair val = default(Pair); val.itemDef1 = ConversionItemDefExtra; val.itemDef2 = ItemDef; Pair item = val; Main.ItemConversionList.Add(item); Log.Info($"Added void conversion from {((Object)ConversionItemDefExtra).name} to {((Object)ItemDef).name}"); GlobalEventManager.OnHitEnemy += (hook_OnHitEnemy)delegate(orig_OnHitEnemy orig, GlobalEventManager self, DamageInfo damageInfo, GameObject victimObject) { //IL_0188: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self, damageInfo, victimObject); CharacterBody val2 = default(CharacterBody); CharacterBody val3 = default(CharacterBody); if (!((ProcChainMask)(ref damageInfo.procChainMask)).HasProc((ProcType)19) && !damageInfo.rejected && damageInfo.procCoefficient > 0f && damageInfo.damage > 0f && Object.op_Implicit((Object)(object)damageInfo.attacker) && damageInfo.attacker.TryGetComponent<CharacterBody>(ref val2) && Object.op_Implicit((Object)(object)val2.master) && victimObject.TryGetComponent<CharacterBody>(ref val3) && Object.op_Implicit((Object)(object)val3.healthComponent)) { int itemCountEffective = GetItemCountEffective(val2); if (itemCountEffective > 0 && Object.op_Implicit((Object)(object)val2.teamComponent) && Object.op_Implicit((Object)(object)val3.teamComponent)) { float num = (damageInfo.crit ? (damageInfo.damage * val2.critMultiplier) : damageInfo.damage); float num2 = num / val2.damage; if (num2 > 0f) { int num3 = Convert.ToInt32(Math.Floor(num2 / DrenchedPerforator_Threshold.Value)); int num4 = (DrenchedPerforator_Stacks.Value + (itemCountEffective - 1) * DrenchedPerforator_StacksStack.Value) * num3; if (num4 > 0) { DotDef dotDef = DotController.GetDotDef((DotIndex)8); for (int i = 0; i < num4; i++) { DotController.InflictDot(victimObject, damageInfo.attacker, damageInfo.inflictedHurtbox, (DotIndex)8, dotDef.interval, 1f, (uint?)null); } CreateExplosion(val2, val3.corePosition, DrenchedPerforator_ExplosionRadiusv2.Value, DrenchedPerforator_ExplosionRadiusIncreasev2.Value * (float)(num4 - 1), damageInfo); } } } } }; } public override void AddCorruptionRecipe() { if (DrenchedPerforator_Recipe.Value && ItemInit.HydraTooth.Enabled) { ItemInit.MakeCorruptionRecipe(DrenchedPerforator_Ingredient1.Value, DrenchedPerforator_Ingredient2.Value, ((Object)ItemDef).name); ItemInit.MakeCorruptionRecipe(DrenchedPerforator_Ingredient1Alt.Value, DrenchedPerforator_Ingredient2.Value, ((Object)ItemDef).name); } } public override ItemDisplayRuleDict AddItemDisplays() { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Expected O, but got Unknown GameObject val = Helpers.PrepareItemDisplayModel(PrefabAPI.InstantiateClone(itemPrefab, ((Object)ItemDef).name + "Display", false)); return new ItemDisplayRuleDict(Array.Empty<ItemDisplayRule>()); } public void CreateExplosion(CharacterBody attackerBody, Vector3 position, float radius, float extraRadius, DamageInfo origDamageInfo) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_015f: 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_0166: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_0171: 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_017b: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Expected O, but got Unknown //IL_0184: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_007e: 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_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_01bd: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Expected O, but got Unknown //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Expected O, but got Unknown List<Collider> list = Physics.OverlapSphere(position, radius + extraRadius).ToList(); Util.ShuffleList<Collider>(list); foreach (Collider item in list) { GameObject gameObject = ((Component)item).gameObject; if (Object.op_Implicit((Object)(object)gameObject.GetComponentInChildren<CharacterBody>())) { CharacterBody componentInChildren = gameObject.GetComponentInChildren<CharacterBody>(); if (Object.op_Implicit((Object)(object)componentInChildren) && Object.op_Implicit((Object)(object)componentInChildren.teamComponent) && componentInChildren.teamComponent.teamIndex != attackerBody.teamComponent.teamIndex) { EffectData val = new EffectData { origin = componentInChildren.corePosition }; EffectManager.SpawnEffect(individualExplodePrefab, val, true); } } } BlastAttack val2 = new BlastAttack { position = position, baseDamage = attackerBody.damage * DrenchedPerforator_ExplosionDamage.Value, baseForce = 0f, radius = radius + extraRadius, attacker = ((Component)attackerBody).gameObject, inflictor = null, teamIndex = attackerBody.teamComponent.teamIndex, crit = origDamageInfo.crit, procChainMask = origDamageInfo.procChainMask, procCoefficient = DrenchedPerforator_ExplosionProcCoefficient.Value, damageColorIndex = (DamageColorIndex)9, falloffModel = (FalloffModel)0, damageType = DamageTypeCombo.op_Implicit((DamageType)131072), attackerFiltering = (AttackerFiltering)2 }; val2.Fire(); float num = 0f; num = ((!(extraRadius > 0f)) ? 0f : (extraRadius / radius)); EffectData val3 = new EffectData { origin = position, scale = 1f + num }; EffectManager.SpawnEffect(explodePrefab, val3, true); } } public class EffigyOfRot : ItemBase { public class PoisonDoNotTransferBehavior : MonoBehaviour { private float timeLeft = EffigyOfRot_PoisonImmunityDuration.Value; private void FixedUpdate() { timeLeft -= Time.fixedDeltaTime; if (timeLeft <= 0f) { Object.Destroy((Object)(object)this); } } } private GameObject _poisonPrefab; [CompilerGenerated] [DebuggerBrowsable(DebuggerBrowsableState.Never)] private GameObject <PoisonPrefab>k__BackingField; private ExplicitPickupDropTable _explicitPickupDropTable; [CompilerGenerated] [DebuggerBrowsable(DebuggerBrowsableState.Never)] private ExplicitPickupDropTable <explicitPickupDropTable>k__BackingField; public static ConfigItem<bool> EffigyOfRot_Enabled = new ConfigItem<bool>("Void boss: Effigy Of Rot", "Item enabled", "Should this item appear in runs?", _defaultValue: true); public static ConfigItem<float> EffigyOfRot_PoisonDuration = new ConfigItem<float>("Void boss: Effigy Of Rot", "Poison duration", "Poison damage over time duration in seconds.", 10f, 1f, 20f, 1f); public static ConfigItem<float> EffigyOfRot_PoisonImmunityDuration = new ConfigItem<float>("Void boss: Effigy Of Rot", "Poison spread immunity duration", "Seconds of hidden immunity to poison applied after it spreads to an enemy. Prevents infinite poison loops.", 15f, 1f, 30f, 1f); public static ConfigItem<float> EffigyOfRot_HealthPerSecond = new ConfigItem<float>("Void boss: Effigy Of Rot", "Poison healing per second", "How much poison heals the inflictor per second.", 3f, 0.1f, 6f, 0.1f); public static ConfigItem<float> EffigyOfRot_HealthPerSecondStack = new ConfigItem<float>("Void boss: Effigy Of Rot", "Poison healing per second (per stack)", "How much poison heals the inflictor per second, per additional stack.", 3f, 0.1f, 6f, 0.1f); public static ConfigItem<float> EffigyOfRot_SpreadChance = new ConfigItem<float>("Void boss: Effigy Of Rot", "Poison spread chance per second", "Percent chance for poison to infect another enemy per second.", 10f, 0.1f, 10f, 0.1f); public static ConfigItem<float> EffigyOfRot_SpreadChanceStack = new ConfigItem<float>("Void boss: Effigy Of Rot", "Poison spread chance per second (per stack)", "Percent chance for poison to infect another enemy per second, per additional stack.", 5f, 0.1f, 5f, 0.1f); public static ConfigItem<float> EffigyOfRot_SpreadRadius = new ConfigItem<float>("Void boss: Effigy Of Rot", "Poison spread radius", "Poison can spread within this radius.", 20f, 1f, 40f, 1f); public static ConfigItem<float> EffigyOfRot_MeleeRange = new ConfigItem<float>("Void boss: Effigy Of Rot", "Melee range", "Meters range within which damage is considered to be melee. Measured from the center of your character to the damage point of contact.", 13f, 1f, 26f, 1f); public static ConfigItem<bool> EffigyOfRot_Recipe = new ConfigItem<bool>("Void boss: Effigy Of Rot", "Recipe enabled", "Should this item have a custom corruption recipe?", _defaultValue: true); public static ConfigItem<string> EffigyOfRot_Ingredient1 = new ConfigItem<string>("Void boss: Effigy Of Rot", "Recipe ingredient 1", "First ingredient for corruption recipe", "SiphonOnLowHealth"); public static ConfigItem<string> EffigyOfRot_Ingredient2 = new ConfigItem<string>("Void boss: Effigy Of Rot", "Recipe ingredient 2", "Second ingredient for corruption recipe", "ViscousPot"); public static ConfigItem<bool> EffigyOfRot_CorruptsAllMiredUrns = new ConfigItem<bool>("Void boss: Effigy Of Rot", "Corrupts all Mired Urns", "Corrupts all Mired Urns.", _defaultValue: false); public override bool Enabled => EffigyOfRot_Enabled.Value; public override ItemDef ConversionItemDef => Addressables.LoadAssetAsync<ItemDef>((object)"RoR2/Base/SiphonOnLowHealth/SiphonOnLowHealth.asset").WaitForCompletion(); public override GameObject itemPrefab => OverwritePrefabMaterials(); public override Sprite itemIcon => Main.Assets.LoadAsset<Sprite>("Assets/icons/effigyOfRot.png"); public Material material0 => Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/ShrineBlood/matShrineBlood.mat").WaitForCompletion(); public Material material1 => Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/ShrineHealing/matShrineHealing.mat").WaitForCompletion(); public Material material2 => Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/BeetleGland/matBeetleGland.mat").WaitForCompletion(); public Material material3 => Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/ShrineBlood/matShrineBlood.mat").WaitForCompletion(); public GameObject PoisonPrefab { get { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_poisonPrefab == (Object)null) { _poisonPrefab = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/MajorAndMinorConstruct/MajorConstructSpawnMinorConstructEffect.prefab").WaitForCompletion(); } return _poisonPrefab; } [CompilerGenerated] set { <PoisonPrefab>k__BackingField = value; } } public ExplicitPickupDropTable explicitPickupDropTable { get { //IL_002d: 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) //IL_004d: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_explicitPickupDropTable == (Object)null) { _explicitPickupDropTable = ScriptableObject.CreateInstance<ExplicitPickupDropTable>(); _explicitPickupDropTable.pickupEntries = (PickupDefEntry[])(object)new PickupDefEntry[1] { new PickupDefEntry { pickupDef = (Object)(object)ItemDef, pickupWeight = 1f } }; } ((PickupDropTable)_explicitPickupDropTable).Regenerate(Run.instance); return _explicitPickupDropTable; } [CompilerGenerated] set { <explicitPickupDropTable>k__BackingField = value; } } public EffigyOfRot(string _name, ItemTag[] _tags, ItemTier _tier, bool _canRemove = true, bool _isConsumed = false, bool _hidden = false) : base(_name, _tags, _tier, _canRemove, _isConsumed, _hidden) { }//IL_0003: Unknown result type (might be due to invalid IL or missing references) public GameObject OverwritePrefabMaterials() { GameObject val = Main.Assets.LoadAsset<GameObject>("Assets/prefabs/effigyOfRot.prefab"); Material[] materialArray = (Material[])(object)new Material[4] { material0, material1, material2, material3 }; ((Renderer)val.GetComponentInChildren<MeshRenderer>()).SetMaterialArray(materialArray); return val; } public override void FormatDescriptionTokens() { string nameToken = ItemDef.nameToken; string descriptionToken = ItemDef.descriptionToken; if (EffigyOfRot_CorruptsAllMiredUrns.Value) { LanguageAPI.AddOverlay(nameToken, "<style=cIsVoid>Corrupts all Mired Urns.</style>"); } LanguageAPI.AddOverlay(descriptionToken, string.Format(Language.currentLanguage.GetLocalizedStringByToken(descriptionToken), EffigyOfRot_PoisonDuration.Value, EffigyOfRot_HealthPerSecond.Value, EffigyOfRot_HealthPerSecondStack.Value, EffigyOfRot_SpreadChance.Value, EffigyOfRot_SpreadChanceStack.Value, EffigyOfRot_SpreadRadius.Value)); } public override void RegisterHooks() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown HealthComponent.TakeDamageProcess += (hook_TakeDamageProcess)delegate(orig_TakeDamageProcess orig, HealthComponent self, DamageInfo damageInfo) { //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Invalid comparison between Unknown and I4 //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0081: 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: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_0198: Unknown result type (might be due to invalid IL or missing references) //IL_01c4: Unknown result type (might be due to invalid IL or missing references) //IL_024c: Unknown result type (might be due to invalid IL or missing references) //IL_0257: Unknown result type (might be due to invalid IL or missing references) //IL_0281: Unknown result type (might be due to invalid IL or missing references) //IL_02a3: Unknown result type (might be due to invalid IL or missing references) //IL_02a8: Unknown result type (might be due to invalid IL or missing references) //IL_02ed: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self, damageInfo); if (Object.op_Implicit((Object)(object)damageInfo.attacker) && Object.op_Implicit((Object)(object)self.body)) { CharacterBody component = damageInfo.attacker.GetComponent<CharacterBody>(); if (Object.op_Implicit((Object)(object)component) && GetItemCountEffective(component) > 0) { int itemCountEffective = GetItemCountEffective(component); if (damageInfo.procCoefficient > 0f) { float num = Vector3.Distance(damageInfo.position, component.corePosition); if (num <= EffigyOfRot_MeleeRange.Value) { InflictDotInfo val = default(InflictDotInfo); val.attackerObject = damageInfo.attacker; val.damageMultiplier = 1f; val.dotIndex = (DotIndex)4; val.duration = EffigyOfRot_PoisonDuration.Value; val.hitHurtBox = self.body.mainHurtBox; val.victimObject = ((Component)self.body).gameObject; DotController.InflictDot(ref val); } } if (((int)damageInfo.dotIndex == 4 || (int)damageInfo.dotIndex == 5) && Object.op_Implicit((Object)(object)component.healthComponent) && Object.op_Implicit((Object)(object)component.master)) { float num2 = (EffigyOfRot_HealthPerSecond.Value + EffigyOfRot_HealthPerSecondStack.Value * (float)(itemCountEffective - 1)) / 3f; float num3 = (EffigyOfRot_SpreadChance.Value + EffigyOfRot_SpreadChanceStack.Value * (float)(itemCountEffective - 1)) / 3f; component.healthComponent.Heal(num2, default(ProcChainMask), true); if (Util.CheckRoll(num3, component.master.luck, component.master)) { List<Collider> list = Physics.OverlapSphere(component.corePosition, EffigyOfRot_SpreadRadius.Value).ToList(); Util.ShuffleList<Collider>(list); foreach (Collider item in list) { GameObject gameObject = ((Component)item).gameObject; if (Object.op_Implicit((Object)(object)gameObject.GetComponentInChildren<CharacterBody>())) { CharacterBody componentInChildren = gameObject.GetComponentInChildren<CharacterBody>(); if ((Object)(object)componentInChildren != (Object)(object)self.body && Object.op_Implicit((Object)(object)componentInChildren.teamComponent) && componentInChildren.teamComponent.teamIndex != component.teamComponent.teamIndex && !Object.op_Implicit((Object)(object)((Component)componentInChildren).gameObject.GetComponent<PoisonDoNotTransferBehavior>())) { InflictDotInfo val2 = default(InflictDotInfo); val2.attackerObject = damageInfo.attacker; val2.damageMultiplier = 1f; val2.dotIndex = damageInfo.dotIndex; val2.duration = EffigyOfRot_PoisonDuration.Value; val2.hitHurtBox = componentInChildren.mainHurtBox; val2.victimObject = ((Component)componentInChildren).gameObject; ((Component)componentInChildren).gameObject.AddComponent<PoisonDoNotTransferBehavior>(); PoisonInfectOrb.CreateInfectOrb(self.body.corePosition, componentInChildren.mainHurtBox); DotController.InflictDot(ref val2); break; } } } } } } } }; } public override void AddCorruptionRecipe() { if (EffigyOfRot_Recipe.Value && ItemInit.ViscousPot.Enabled) { ItemInit.MakeCorruptionRecipe(EffigyOfRot_Ingredient1.Value, EffigyOfRot_Ingredient2.Value, ((Object)ItemDef).name); } } public override ItemDisplayRuleDict AddItemDisplays() { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Expected O, but got Unknown GameObject val = Helpers.PrepareItemDisplayModel(PrefabAPI.InstantiateClone(itemPrefab, ((Object)ItemDef).name + "Display", false)); return new ItemDisplayRuleDict(Array.Empty<ItemDisplayRule>()); } } public class MobiusNode : ItemBase { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static Func<Instruction, bool> <>9__41_4; public static Func<Instruction, bool> <>9__41_5; public static Func<Instruction, bool> <>9__41_6; public static Func<Instruction, bool> <>9__41_7; public static Func<HealthComponent, bool> <>9__41_8; public static Manipulator <>9__41_1; public static hook_TakeDamageProcess <>9__41_2; internal void <RegisterHooks>b__41_1(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); val.TryGotoNext(new Func<Instruction, bool>[1] { (Instruction x) => ILPatternMatchingExt.MatchLdfld<ItemCounts>(x, "missileVoid") }); float num = default(float); if (val.TryGotoNext((MoveType)2, new Func<Instruction, bool>[3] { (Instruction x) => ILPatternMatchingExt.MatchConvR4(x), (Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, ref num), (Instruction x) => ILPatternMatchingExt.MatchCgt(x) })) { val.Emit(OpCodes.Ldarg, 0); val.EmitDelegate<Func<HealthComponent, bool>>((Func<HealthComponent, bool>)((HealthComponent hc) => Object.op_Implicit((Object)(object)hc) && Object.op_Implicit((Object)(object)hc.body) && Object.op_Implicit((Object)(object)hc.body.inventory) && hc.body.inventory.GetItemCountEffective(ItemInit.MobiusNode.ItemIndex) > 0)); val.Emit(OpCodes.Or); } else { Log.Error("IL hook failed for shield color adjustment."); } } internal bool <RegisterHooks>b__41_4(Instruction x) { return ILPatternMatchingExt.MatchLdfld<ItemCounts>(x, "missileVoid"); } internal bool <RegisterHooks>b__41_5(Instruction x) { return ILPatternMatchingExt.MatchConvR4(x); } internal bool <RegisterHooks>b__41_6(Instruction x) { float num = default(float); return ILPatternMatchingExt.MatchLdcR4(x, ref num); } internal bool <RegisterHooks>b__41_7(Instruction x) { return ILPatternMatchingExt.MatchCgt(x); } internal bool <RegisterHooks>b__41_8(HealthComponent hc) { //IL_003e: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)hc) && Object.op_Implicit((Object)(object)hc.body) && Object.op_Implicit((Object)(object)hc.body.inventory)) { return hc.body.inventory.GetItemCountEffective(ItemInit.MobiusNode.ItemIndex) > 0; } return false; } internal void <RegisterHooks>b__41_2(orig_TakeDamageProcess orig, HealthComponent self, DamageInfo damageInfo) { orig.Invoke(self, damageInfo); MobiusBehavior mobiusBehavior = default(MobiusBehavior); if (Object.op_Implicit((Object)(object)self.body) && ((Component)self.body).gameObject.TryGetComponent<MobiusBehavior>(ref mobiusBehavior) && self.IsHealthBelowThreshold(MobiusNode_Threshold.Value)) { mobiusBehavior.Explode(); } } } public BuffDef MobiusBuff; private GameObject _ExplodePrefab; [CompilerGenerated] [DebuggerBrowsable(DebuggerBrowsableState.Never)] private GameObject <ExplodePrefab>k__BackingField; private Material _ExplodeOverlay; [CompilerGenerated] [DebuggerBrowsable(DebuggerBrowsableState.Never)] private Material <ExplodeOverlay>k__BackingField; private ExplicitPickupDropTable _explicitPickupDropTable; [CompilerGenerated] [DebuggerBrowsable(DebuggerBrowsableState.Never)] private ExplicitPickupDropTable <explicitPickupDropTable>k__BackingField; public static ConfigItem<bool> MobiusNode_Enabled = new ConfigItem<bool>("Void boss: Mobius Node", "Item enabled", "Should this item appear in runs?", _defaultValue: true); public static ConfigItem<float> MobiusNode_ShieldAdd = new ConfigItem<float>("Void boss: Mobius Node", "Added shield", "Fraction of shield to grant on first stack.", 0.2f, 0f, 1f, 0.05f); public static ConfigItem<float> MobiusNode_Threshold = new ConfigItem<float>("Void boss: Mobius Node", "Shield regen threshold", "Health fraction below which shield regeneration will activate.", 0.5f, 0.1f, 0.9f, 0.05f); public static ConfigItem<float> MobiusNode_Timer = new ConfigItem<float>("Void boss: Mobius Node", "Replenish interval", "All stacks of shield regen are replenished every x seconds.", 60f, 5f, 120f, 1f); public static ConfigItem<int> MobiusNode_Stacks = new ConfigItem<int>("Void boss: Mobius Node", "Stacks of shield regen", "Maximum shield regen stacks you can hold.", 2, 1f, 5f, 1f); public static ConfigItem<int> MobiusNode_StacksStack = new ConfigItem<int>("Void boss: Mobius Node", "Stacks of shield regen (per stack)", "Maximum shield regen stacks you can hold, per additional stack.", 1, 1f, 5f, 1f); public static ConfigItem<float> MobiusNode_ExplodeRadius = new ConfigItem<float>("Void boss: Mobius Node", "Stun radius", "Meters radius in which to stun enemies when shield is recharged.", 40f, 1f, 80f, 1f); public static ConfigItem<bool> MobiusNode_Recipe = new ConfigItem<bool>("Void boss: Mobius Node", "Recipe enabled", "Should this item have a custom corruption recipe?", _defaultValue: true); public static ConfigItem<string> MobiusNode_Ingredient1 = new ConfigItem<string>("Void boss: Mobius Node", "Recipe ingredient 1", "First ingredient for corruption recipe", "NovaOnLowHealth"); public static ConfigItem<string> MobiusNode_Ingredient2 = new ConfigItem<string>("Void boss: Mobius Node", "Recipe ingredient 2", "Second ingredient for corruption recipe", "MissileVoid"); public override bool Enabled => MobiusNode_Enabled.Value; public override ItemDef ConversionItemDef => Addressables.LoadAssetAsync<ItemDef>((object)"RoR2/Base/NovaOnLowHealth/NovaOnLowHealth.asset").WaitForCompletion(); public override GameObject itemPrefab => OverwritePrefabMaterials(); public override Sprite itemIcon => Main.Assets.LoadAsset<Sprite>("Assets/icons/mobiusGland.png"); public Material material0 => Addressables.LoadAssetAsync<Material>((object)"RoR2/DLC1/GummyClone/matGummyClone.mat").WaitForCompletion(); public Material material1 => Addressables.LoadAssetAsync<Material>((object)"RoR2/DLC1/VoidSurvivor/matVoidSurvivorCorruptOverlay.mat").WaitForCompletion(); public GameObject ExplodePrefab { get { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_ExplodePrefab == (Object)null) { _ExplodePrefab = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/VoidMegaCrab/VoidMegaCrabDeathBombExplosion.prefab").WaitForCompletion(); } return _ExplodePrefab; } [CompilerGenerated] set { <ExplodePrefab>k__BackingField = value; } } public Material ExplodeOverlay { get { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_ExplodeOverlay == (Object)null) { _ExplodeOverlay = Addressables.LoadAssetAsync<Material>((object)"RoR2/DLC1/VoidSurvivor/matVoidBlinkBodyOverlayCorrupted.mat").WaitForCompletion(); } return _ExplodeOverlay; } [CompilerGenerated] set { <ExplodeOverlay>k__BackingField = value; } } public ExplicitPickupDropTable explicitPickupDropTable { get { //IL_002d: 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) //IL_004d: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_explicitPickupDropTable == (Object)null) { _explicitPickupDropTable = ScriptableObject.CreateInstance<ExplicitPickupDropTable>(); _explicitPickupDropTable.pickupEntries = (PickupDefEntry[])(object)new PickupDefEntry[1] { new PickupDefEntry { pickupDef = (Object)(object)ItemDef, pickupWeight = 1f } }; } ((PickupDropTable)_explicitPickupDropTable).Regenerate(Run.instance); return _explicitPickupDropTable; } [CompilerGenerated] set { <explicitPickupDropTable>k__BackingField = value; } } public MobiusNode(string _name, ItemTag[] _tags, ItemTier _tier, bool _canRemove = true, bool _isConsumed = false, bool _hidden = false) : base(_name, _tags, _tier, _canRemove, _isConsumed, _hidden) { }//IL_0003: Unknown result type (might be due to invalid IL or missing references) public GameObject OverwritePrefabMaterials() { GameObject val = Main.Assets.LoadAsset<GameObject>("Assets/prefabs/mobiusNode.prefab"); Material[] materialArray = (Material[])(object)new Material[2] { material0, material1 }; ((Renderer)val.GetComponentInChildren<MeshRenderer>()).SetMaterialArray(materialArray); return val; } public override void FormatDescriptionTokens() { string descriptionToken = ItemDef.descriptionToken; LanguageAPI.AddOverlay(descriptionToken, string.Format(Language.currentLanguage.GetLocalizedStringByToken(descriptionToken), MobiusNode_ShieldAdd.Value * 100f, MobiusNode_Threshold.Value * 100f, MobiusNode_Stacks.Value, MobiusNode_StacksStack.Value, MobiusNode_Timer.Value)); } public override void RegisterHooks() { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Expected O, but got Unknown //IL_002e: 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_0039: Expected O, but got Unknown //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Expected O, but got Unknown //IL_0053: 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_005e: Expected O, but got Unknown CreateMobiusBuff(); RecalculateStatsAPI.GetStatCoefficients += (StatHookEventHandler)delegate(CharacterBody orig, StatHookEventArgs self) { int itemCountEffective2 = GetItemCountEffective(orig); if (itemCountEffective2 > 0) { self.baseShieldAdd += orig.maxHealth * MobiusNode_ShieldAdd.Value; } }; object obj = <>c.<>9__41_1; if (obj == null) { Manipulator val = delegate(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) ILCursor val3 = new ILCursor(il); val3.TryGotoNext(new Func<Instruction, bool>[1] { (Instruction x) => ILPatternMatchingExt.MatchLdfld<ItemCounts>(x, "missileVoid") }); float num = default(float); if (val3.TryGotoNext((MoveType)2, new Func<Instruction, bool>[3] { (Instruction x) => ILPatternMatchingExt.MatchConvR4(x), (Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, ref num), (Instruction x) => ILPatternMatchingExt.MatchCgt(x) })) { val3.Emit(OpCodes.Ldarg, 0); val3.EmitDelegate<Func<HealthComponent, bool>>((Func<HealthComponent, bool>)((HealthComponent hc) => Object.op_Implicit((Object)(object)hc) && Object.op_Implicit((Object)(object)hc.body) && Object.op_Implicit((Object)(object)hc.body.inventory) && hc.body.inventory.GetItemCountEffective(ItemInit.MobiusNode.ItemIndex) > 0)); val3.Emit(OpCodes.Or); } else { Log.Error("IL hook failed for shield color adjustment."); } }; <>c.<>9__41_1 = val; obj = (object)val; } HealthComponent.GetHealthBarValues += (Manipulator)obj; object obj2 = <>c.<>9__41_2; if (obj2 == null) { hook_TakeDamageProcess val2 = delegate(orig_TakeDamageProcess orig, HealthComponent self, DamageInfo damageInfo) { orig.Invoke(self, damageInfo); MobiusBehavior mobiusBehavior2 = default(MobiusBehavior); if (Object.op_Implicit((Object)(object)self.body) && ((Component)self.body).gameObject.TryGetComponent<MobiusBehavior>(ref mobiusBehavior2) && self.IsHealthBelowThreshold(MobiusNode_Threshold.Value)) { mobiusBehavior2.Explode(); } }; <>c.<>9__41_2 = val2; obj2 = (object)val2; } HealthComponent.TakeDamageProcess += (hook_TakeDamageProcess)obj2; CharacterBody.OnInventoryChanged += (hook_OnInventoryChanged)delegate(orig_OnInventoryChanged orig, CharacterBody self) { //IL_0075: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self); MobiusBehavior mobiusBehavior = ((Component)self).gameObject.GetComponent<MobiusBehavior>(); int itemCountEffective = GetItemCountEffective(self); if (GetItemCountEffective(self) > 0 && !Object.op_Implicit((Object)(object)mobiusBehavior)) { mobiusBehavior = ((Component)self).gameObject.AddComponent<MobiusBehavior>(); } if (GetItemCountEffective(self) <= 0 && Object.op_Implicit((Object)(object)mobiusBehavior)) { Object.Destroy((Object)(object)((Component)self).gameObject.GetComponent<MobiusBehavior>()); self.SetBuffCount(MobiusBuff.buffIndex, 0); } }; } public override void AddCorruptionRecipe() { if (MobiusNode_Recipe.Value) { ItemInit.MakeCorruptionRecipe(MobiusNode_Ingredient1.Value, MobiusNode_Ingredient2.Value, ((Object)ItemDef).name); } } public override ItemDisplayRuleDict AddItemDisplays() { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Expected O, but got Unknown GameObject val = Helpers.PrepareItemDisplayModel(PrefabAPI.InstantiateClone(itemPrefab, ((Object)ItemDef).name + "Display", false)); return new ItemDisplayRuleDict(Array.Empty<ItemDisplayRule>()); } public void CreateMobiusBuff() { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) BuffDef val = ScriptableObject.CreateInstance<BuffDef>(); val.buffColor = new Color(0.29f, 0f, 0.38f); val.canStack = true; val.isDebuff = false; val.ignoreGrowthNectar = true; ((Object)val).name = "Möbius regen charges"; val.isHidden = false; val.isCooldown = false; val.iconSprite = Main.Assets.LoadAsset<Sprite>("Assets/icons/mobiusBuff.png"); ContentAddition.AddBuffDef(val); MobiusBuff = val; } } public class MobiusBehavior : MonoBehaviour { private HealthComponent healthComponent; private CharacterBody characterBody; private BuffDef buffDef; public float rechargeInterval = 60f; public float rechargeTimer = 0f; private int _stacks = 0; public int maxStacks = 0; public int stacks { get { return _stacks; } set { //IL_001b: Unknown result type (might be due to invalid IL or missing references) RecheckMaxStacks(); _stacks = value; characterBody.SetBuffCount(buffDef.buffIndex, _stacks); } } private void Awake() { healthComponent = ((Component)this).gameObject.GetComponent<HealthComponent>(); characterBody = ((Component)this).gameObject.GetComponent<CharacterBody>(); buffDef = ItemInit.MobiusNode.MobiusBuff; if (!Object.op_Implicit((Object)(object)healthComponent) || !Object.op_Implicit((Object)(object)characterBody) || !Object.op_Implicit((Object)(object)buffDef)) { Object.Destroy((Object)(object)this); } RecheckMaxStacks(); stacks = maxStacks; } private void FixedUpdate() { if (stacks < maxStacks) { rechargeTimer += Time.fixedDeltaTime; if (rechargeTimer >= rechargeInterval) { RegenAllStacks(); rechargeTimer = 0f; } } } public void Explode() { //IL_0012: 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_001e: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Expected O, but got Unknown //IL_00bc: 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_0149: Unknown result type (might be due to invalid IL or missing references) if (stacks <= 0) { return; } EffectData val = new EffectData { origin = characterBody.corePosition }; EffectManager.SpawnEffect(ItemInit.MobiusNode.ExplodePrefab, val, true); TemporaryOverlay val2 = ((Component)characterBody).gameObject.AddComponent<TemporaryOverlay>(); val2.duration = 2f; val2.animateShaderAlpha = true; val2.alphaCurve = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f); val2.destroyComponentOnEnd = true; val2.originalMaterial = ItemInit.MobiusNode.ExplodeOverlay; val2.AddToCharacerModel(((Component)((Component)characterBody).gameObject.GetComponent<ModelLocator>().modelTransform).GetComponentInParent<CharacterModel>()); List<Collider> list = Physics.OverlapSphere(characterBody.corePosition, MobiusNode.MobiusNode_ExplodeRadius.Value).ToList(); SetStateOnHurt val3 = default(SetStateOnHurt); foreach (Collider item in list) { GameObject gameObject = ((Component)item).gameObject; if (!Object.op_Implicit((Object)(object)gameObject.GetComponentInChildren<CharacterBody>())) { continue; } CharacterBody componentInChildren = gameObject.GetComponentInChildren<CharacterBody>(); if (Object.op_Implicit((Object)(object)componentInChildren.healthComponent) && Object.op_Implicit((Object)(object)componentInChildren.teamComponent) && componentInChildren.teamComponent.teamIndex != characterBody.teamComponent.teamIndex) { ((Component)componentInChildren.healthComponent).gameObject.TryGetComponent<SetStateOnHurt>(ref val3); if (Object.op_Implicit((Object)(object)val3)) { val3.SetStun(2f); } } } healthComponent.RechargeShieldFull(); stacks--; } public void RegenAllStacks() { RecheckMaxStacks(); stacks = maxStacks; TemporaryOverlay val = ((Component)characterBody).gameObject.AddComponent<TemporaryOverlay>(); val.duration = 1f; val.animateShaderAlpha = true; val.alphaCurve = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f); val.destroyComponentOnEnd = true; val.originalMaterial = ItemInit.MobiusNode.ExplodeOverlay; val.AddToCharacerModel(((Component)((Component)characterBody).gameObject.GetComponent<ModelLocator>().modelTransform).GetComponentInParent<CharacterModel>()); Util.PlaySound("Play_Item_proc_medkit", ((Component)characterBody).gameObject); } public void RecheckMaxStacks() { //IL_0026: Unknown result type (might be due to invalid IL or missing references) maxStacks = MobiusNode.MobiusNode_Stacks.Value + MobiusNode.MobiusNode_StacksStack.Value * (characterBody.inventory.GetItemCountEffective(ItemInit.MobiusNode.ItemIndex) - 1); } } public class OsmiumShackles : ItemBase { public BuffDef OsmiumBuff; private GameObject _radiusPrefab; [CompilerGenerated] [DebuggerBrowsable(DebuggerBrowsableState.Never)] private GameObject <radiusPrefab>k__BackingField; private Material _OsmiumOverlay; [CompilerGenerated] [DebuggerBrowsable(DebuggerBrowsableState.Never)] private Material <OsmiumOverlay>k__BackingField; private ExplicitPickupDropTable _explicitPickupDropTable; [CompilerGenerated] [DebuggerBrowsable(DebuggerBrowsableState.Never)] private ExplicitPickupDropTable <explicitPickupDropTable>k__BackingField; public static ConfigItem<bool> OsmiumShackles_Enabled = new ConfigItem<bool>("Void boss: Osmium Shackles", "Item enabled", "Should this item appear in runs?", _defaultValue: true); public static ConfigItem<float> OsmiumShackles_DebuffRadius = new ConfigItem<float>("Void boss: Osmium Shackles", "Weigh down radius", "Radius where enemies are debuffed by this item.", 20f, 1f, 40f, 1f); public static ConfigItem<float> OsmiumShackles_DebuffRadiusStack = new ConfigItem<float>("Void boss: Osmium Shackles", "Weigh down radius (per stack)", "Radius where enemies are debuffed by this item, per additional stack.", 8f, 1f, 40f, 1f); public static ConfigItem<float> OsmiumShackles_DebuffPercent = new ConfigItem<float>("Void boss: Osmium Shackles", "Debuff encumbrance percentage", "Slows enemy speed, attack speed and cooldowns by this fraction.", 0.3f, 0.1f, 1f, 0.1f); public static ConfigItem<float> OsmiumShackles_CritAdd = new ConfigItem<float>("Void boss: Osmium Shackles", "Crit addition", "Fractional crit chance increase against encumbered enemies", 0.25f, 0.05f, 1f, 0.05f); public static ConfigItem<bool> OsmiumShackles_Recipe = new ConfigItem<bool>("Void boss: Osmium Shackles", "Recipe enabled", "Should this item have a custom corruption recipe?", _defaultValue: true); public static ConfigItem<string> OsmiumShackles_Ingredient1 = new ConfigItem<string>("Void boss: Osmium Shackles", "Recipe ingredient 1", "First ingredient for corruption recipe", "Knurl"); public static ConfigItem<string> OsmiumShackles_Ingredient2 = new ConfigItem<string>("Void boss: Osmium Shackles", "Recipe ingredient 2", "Second ingredient for corruption recipe", "ElementalRingVoid"); public override bool Enabled => OsmiumShackles_Enabled.Value; public override ItemDef ConversionItemDef => Addressables.LoadAssetAsync<ItemDef>((object)"RoR2/Base/Knurl/Knurl.asset").WaitForCompletion(); public override GameObject itemPrefab => OverwritePrefabMaterials(); public override Sprite itemIcon => Main.Assets.LoadAsset<Sprite>("Assets/icons/osmiumShackles.png"); public ItemDef ConversionItemDefExtra => Addressables.LoadAssetAsync<ItemDef>((object)"RoR2/Base/LightningStrikeOnHit/LightningStrikeOnHit.asset").WaitForCompletion(); public Material material0 => Addressables.LoadAssetAsync<Material>((object)"RoR2/GlobalContent/matArtifact.mat").WaitForCompletion(); public Material material1 => Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/Nullifier/matNullifierZoneAreaIndicator.mat").WaitForCompletion(); public GameObject radiusPrefab { get { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_radiusPrefab == (Object)null) { _radiusPrefab = Object.Instantiate<GameObject>(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC2/Items/AttackSpeedPerNearbyAllyOrEnemy/BolsteringLanternBonusIndicator.prefab").WaitForCompletion()); Object.Destroy((Object)(object)_radiusPrefab.GetComponent<SphereCollider>()); Object.Destroy((Object)(object)_radiusPrefab.GetComponent<AttackSpeedPerNearbyCollider>()); MeshRenderer componentInChildren = _radiusPrefab.GetComponentInChildren<MeshRenderer>(); if (Object.op_Implicit((Object)(object)componentInChildren)) { ((Renderer)componentInChildren).material = material1; } } return _radiusPrefab; } [CompilerGenerated] set { <radiusPrefab>k__BackingField = value; } } public Material OsmiumOverlay { get { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_OsmiumOverlay == (Object)null) { _OsmiumOverlay = Addressables.LoadAssetAsync<Material>((object)"RoR2/DLC1/VoidSurvivor/matVoidBlinkSwimOverlay.mat").WaitForCompletion(); } return _OsmiumOverlay; } [CompilerGenerated] set { <OsmiumOverlay>k__BackingField = value; } } public ExplicitPickupDropTable explicitPickupDropTable { get { //IL_002d: 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) //IL_004d: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_explicitPickupDropTable == (Object)null) { _explicitPickupDropTable = ScriptableObject.CreateInstance<ExplicitPickupDropTable>(); _explicitPickupDropTable.pickupEntries = (PickupDefEntry[])(object)new PickupDefEntry[1] { new PickupDefEntry { pickupDef = (Object)(object)ItemDef, pickupWeight = 1f } }; } ((PickupDropTable)_explicitPickupDropTable).Regenerate(Run.instance); return _explicitPickupDropTable; } [CompilerGenerated] set { <explicitPickupDropTable>k__BackingField = value; } } public OsmiumShackles(string _name, ItemTag[] _tags, ItemTier _tier, bool _canRemove = true, bool _isConsumed = false, bool _hidden = false) : base(_name, _tags, _tier, _canRemove, _isConsumed, _hidden) { }//IL_0003: Unknown result type (might be due to invalid IL or missing references) public GameObject OverwritePrefabMaterials() { GameObject val = Main.Assets.LoadAsset<GameObject>("Assets/prefabs/osmiumShackles.prefab"); Material[] materialArray = (Material[])(object)new Material[1] { material0 }; ((Renderer)val.GetComponentInChildren<MeshRenderer>()).SetMaterialArray(materialArray); return val; } public override void FormatDescriptionTokens() { string descriptionToken = ItemDef.descriptionToken; LanguageAPI.AddOverlay(descriptionToken, string.Format(Language.currentLanguage.GetLocalizedStringByToken(descriptionToken), OsmiumShackles_DebuffRadius.Value, OsmiumShackles_DebuffRadiusStack.Value, OsmiumShackles_DebuffPercent.Value * 100f, OsmiumShackles_CritAdd.Value * 100f)); } public override void RegisterHooks() { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Expected O, but got Unknown //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Expected O, but got Unknown //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Expected O, but got Unknown CreateOsmiumBuff(); CharacterBody.OnInventoryChanged += (hook_OnInventoryChanged)delegate(orig_OnInventoryChanged orig, CharacterBody self) { orig.Invoke(self); OsmiumShacklesBehavior osmiumShacklesBehavior = ((Component)self).gameObject.GetComponent<OsmiumShacklesBehavior>(); int itemCountEffective = GetItemCountEffective(self); if (GetItemCountEffective(self) > 0 && !Object.op_Implicit((Object)(object)osmiumShacklesBehavior)) { osmiumShacklesBehavior = ((Component)self).gameObject.AddComponent<OsmiumShacklesBehavior>(); } if (Object.op_Implicit((Object)(object)osmiumShacklesBehavior)) { osmiumShacklesBehavior.UpdateScale(); } if (GetItemCountEffective(self) <= 0 && Object.op_Implicit((Object)(object)osmiumShacklesBehavior)) { Object.Destroy((Object)(object)((Component)self).gameObject.GetComponent<OsmiumShacklesBehavior>()); } }; RecalculateStatsAPI.GetStatCoefficients += (StatHookEventHandler)delegate(CharacterBody orig, StatHookEventArgs self) { int buffCount = orig.GetBuffCount(OsmiumBuff); if (buffCount > 0) { self.attackSpeedTotalMult -= OsmiumShackles_DebuffPercent.Value; self.moveSpeedTotalMult -= OsmiumShackles_DebuffPercent.Value; self.allSkills.cooldownMultiplier *= 0f - OsmiumShackles_DebuffPercent.Value; } }; HealthComponent.TakeDamageProcess += (hook_TakeDamageProcess)delegate(orig_TakeDamageProcess orig, HealthComponent self, DamageInfo damageInfo) { if (!damageInfo.crit && Object.op_Implicit((Object)(object)self.body) && self.body.GetBuffCount(OsmiumBuff) > 0 && (Object)(object)damageInfo.attacker != (Object)(object)((Component)self.body).gameObject && Util.CheckRoll(OsmiumShackles_CritAdd.Value * 100f, 0f, (CharacterMaster)null)) { damageInfo.crit = true; } orig.Invoke(self, damageInfo); }; CharacterBody.OnBuffFinalStackLost += (hook_OnBuffFinalStackLost)delegate(orig_OnBuffFinalStackLost orig, CharacterBody self, BuffDef buffDef) { //IL_000b: 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(self, buffDef); if (buffDef.buffIndex == OsmiumBuff.buffIndex) { self.RecalculateStats(); } }; } public override void AddCorruptionRecipe() { if (OsmiumShackles_Recipe.Value) { ItemInit.MakeCorruptionRecipe(OsmiumShackles_Ingredient1.Value, OsmiumShackles_Ingredient2.Value, ((Object)ItemDef).name); } } public override ItemDisplayRuleDict AddItemDisplays() { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Expected O, but got Unknown GameObject val = Helpers.PrepareItemDisplayModel(PrefabAPI.InstantiateClone(itemPrefab, ((Object)ItemDef).name + "Display", false)); return new ItemDisplayRuleDict(Array.Empty<ItemDisplayRule>()); } public void CreateOsmiumBuff() { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) BuffDef val = ScriptableObject.CreateInstance<BuffDef>(); val.buffColor = new Color(1f, 1f, 1f); val.canStack = false; val.isDebuff = true; ((Object)val).name = "Osmium weight"; val.isHidden = false; val.isCooldown = false; val.iconSprite = Main.Assets.LoadAsset<Sprite>("Assets/icons/osmiumBuff.png"); ContentAddition.AddBuffDef(val); OsmiumBuff = val; } } public class OsmiumShacklesBehavior : MonoBehaviour { private GameObject radius; private CharacterBody characterBody; private float scale = 20f; private float debuffInterval = 0.5f; private float debuffTimer = 0f; private void Awake() { radius = Object.Instantiate<GameObject>(ItemInit.OsmiumShackles.radiusPrefab); NetworkedBodyAttachment component = radius.GetComponent<NetworkedBodyAttachment>(); characterBody = ((Component)this).gameObject.GetComponent<CharacterBody>(); if (Object.op_Implicit((Object)(object)characterBody) && Object.op_Implicit((Object)(object)component)) { component.AttachToGameObjectAndSpawn(((Component)this).gameObject, (string)null); UpdateScale(); } else { Object.Destroy((Object)(object)this); } } private void FixedUpdate() { //IL_0032: 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_00a9: Unknown result type (might be due to invalid IL or missing references) debuffTimer += Time.fixedDeltaTime; if (!(debuffTimer >= debuffInterval)) { return; } Collider[] array = Physics.OverlapSphere(characterBody.corePosition, scale); Collider[] array2 = array; foreach (Collider val in array2) { if (!Object.op_Implicit((Object)(object)((Component)val).gameObject)) { continue; } GameObject gameObject = ((Component)val).gameObject; CharacterBody componentInChildren = gameObject.GetComponentInChildren<CharacterBody>(); if (Object.op_Implicit((Object)(object)componentInChildren) && Object.op_Implicit((Object)(object)componentInChildren.teamComponent) && componentInChildren.teamComponent.teamIndex != characterBody.teamComponent.teamIndex) { componentInChildren.AddTimedBuff(ItemInit.OsmiumShackles.OsmiumBuff, 1f); ModelLocator component = ((Component)componentInChildren).gameObject.GetComponent<ModelLocator>(); if (Object.op_Implicit((Object)(object)component) &&