using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text; using System.Text.RegularExpressions; using AssistManager; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using ClassicItemsReturns.Artifact; using ClassicItemsReturns.Equipment; using ClassicItemsReturns.Equipment.EliteEquipment; using ClassicItemsReturns.Items; using ClassicItemsReturns.Items.Common; using ClassicItemsReturns.Items.NoTier; using ClassicItemsReturns.Items.Rare; using ClassicItemsReturns.Items.Uncommon; using ClassicItemsReturns.Modules; using ClassicItemsReturns.SharedHooks; using ClassicItemsReturns.Utils; using ClassicItemsReturns.Utils.Components; using EntityStates; using EntityStates.ArtifactShell; using EntityStates.DeepVoidPortalBattery; using EntityStates.Drone.DroneWeapon; using EntityStates.Gup; using EntityStates.InfiniteTowerSafeWard; using EntityStates.Interactables.GoldBeacon; using EntityStates.MeridianEvent; using EntityStates.Missions.Arena.NullWard; using EntityStates.Missions.BrotherEncounter; using EntityStates.Missions.Goldshores; using EntityStates.Missions.Moon; using HG; using HG.Reflection; using IL.EntityStates; using IL.RoR2; using JetBrains.Annotations; using KinematicCharacterController; using Microsoft.CodeAnalysis; using Mono.Cecil.Cil; using MonoMod.Cil; using On.EntityStates; using On.EntityStates.ArtifactShell; using On.EntityStates.DeepVoidPortalBattery; using On.EntityStates.Gup; using On.EntityStates.InfiniteTowerSafeWard; using On.EntityStates.Interactables.GoldBeacon; using On.EntityStates.MeridianEvent; using On.EntityStates.Missions.Arena.NullWard; using On.EntityStates.Missions.BrotherEncounter; using On.EntityStates.Missions.Goldshores; using On.EntityStates.Missions.Moon; using On.RoR2; using On.RoR2.UI.MainMenu; using R2API; using R2API.Utils; using RiskOfOptions; using RiskyMod.Items; using RiskyMod.Items.Uncommon; using RoR2; using RoR2.Artifacts; using RoR2.Audio; using RoR2.ContentManagement; using RoR2.ExpansionManagement; using RoR2.Items; using RoR2.Navigation; using RoR2.Orbs; using RoR2.Projectile; using RoR2.UI.MainMenu; using ShaderSwapper; using SneedHooks; using TMPro; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.Events; using UnityEngine.Networking; using UnityEngine.Rendering; using UnityEngine.SceneManagement; using UnityEngine.UI; [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: OptIn] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: AssemblyInformationalVersion("1.0.0+fd30bdc481e7d247e44f35cef46e3ae6917453a8")] [assembly: AssemblyProduct("ClassicItemsReturns")] [assembly: AssemblyTitle("ClassicItemsReturns")] [assembly: AssemblyCompany("ClassicItemsReturns")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] 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; } } [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [Microsoft.CodeAnalysis.Embedded] [CompilerGenerated] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } } namespace ClassicItemsReturns { [NetworkCompatibility(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInPlugin("com.RiskySleeps.ClassicItemsReturns", "Classic Items Returns", "3.6.23")] [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.*/)] [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.*/)] public class ClassicItemsReturnsPlugin : BaseUnityPlugin { public const string ModGuid = "com.RiskySleeps.ClassicItemsReturns"; public const string ModName = "Classic Items Returns"; public const string ModVer = "3.6.23"; public const string ModDescription = "Adds items and equipment from Risk of Rain and Risk of Rain Returns."; public static bool useClassicSprites = false; public static bool use3dModels = true; public static bool useUnfinished = false; public static List Artifacts = new List(); public static List Items = new List(); public static List Equipments = new List(); public static List EliteEquipments = new List(); public static SceneDef bazaarScene = Addressables.LoadAssetAsync((object)"RoR2/Base/bazaar/bazaar.asset").WaitForCompletion(); public static ManualLogSource ModLogger; public const bool debug = true; public static Action onFinishScanning; public static PluginInfo PInfo { get; private set; } public static void ModDebugLog(object data) { bool flag = true; ModLogger.LogMessage(data); } private void Awake() { use3dModels = ((BaseUnityPlugin)this).Config.Bind("General", "Use 3d Models", true, "Use 3d models instead of sprites.").Value; useClassicSprites = ((BaseUnityPlugin)this).Config.Bind("General", "Use Classic Sprites", false, "Use the original Risk of Rain sprites instead of the Returns sprites. (Requires Use 3d Models = false)").Value; useUnfinished = ((BaseUnityPlugin)this).Config.Bind("General", "Enable Unfinished Content", false, "Enables unfinished content that lacks 3d models.").Value; PInfo = ((BaseUnityPlugin)this).Info; new PluginContentPack().Initialize(); ModLogger = ((BaseUnityPlugin)this).Logger; Assets.Init(); SoundBanks.Init(); DLCSupport.Initialize(); ModSupport.CheckForModSupport(); LanguageOverrides.Initialize(); Deployables.Initialize(); Buffs.Initialize(); Orbs.Initialize(); AddToAssembly(); Dots.Initialize(); TakeDamage.Initialize(); OnCharacterDeath.Initialize(); new IsTeleActivatedTracker(); } private void AddToAssembly() { IEnumerable enumerable = from type in Assembly.GetExecutingAssembly().GetTypes() where !type.IsAbstract && type.IsSubclassOf(typeof(EquipmentBase)) select type; List list = new List(); List list2 = new List(); foreach (Type item in enumerable) { EquipmentBase equipmentBase = (EquipmentBase)Activator.CreateInstance(item); if (equipmentBase.ParentEquipmentName != null) { list2.Add(equipmentBase); } else if (ValidateEquipment(equipmentBase, Equipments)) { equipmentBase.Init(((BaseUnityPlugin)this).Config); list.Add(equipmentBase.EquipmentName); } } foreach (EquipmentBase item2 in list2) { if (list.Contains(item2.ParentEquipmentName)) { item2.Init(((BaseUnityPlugin)this).Config); } } IEnumerable enumerable2 = from type in Assembly.GetExecutingAssembly().GetTypes() where !type.IsAbstract && type.IsSubclassOf(typeof(EliteEquipmentBase)) select type; foreach (Type item3 in enumerable2) { EliteEquipmentBase eliteEquipmentBase = (EliteEquipmentBase)Activator.CreateInstance(item3); if (ValidateEliteEquipment(eliteEquipmentBase, EliteEquipments)) { eliteEquipmentBase.Init(((BaseUnityPlugin)this).Config); } } IEnumerable enumerable3 = from type in Assembly.GetExecutingAssembly().GetTypes() where !type.IsAbstract && type.IsSubclassOf(typeof(ItemBase)) select type; List list3 = new List(); List list4 = new List(); foreach (Type item4 in enumerable3) { ItemBase itemBase = (ItemBase)Activator.CreateInstance(item4); if (itemBase.ParentEquipmentName != null || itemBase.ParentItemName != null) { list4.Add(itemBase); } else if (ValidateItem(itemBase, Items)) { itemBase.Init(((BaseUnityPlugin)this).Config); list3.Add(itemBase.ItemName); } } foreach (ItemBase item5 in list4) { if (list3.Contains(item5.ParentItemName) || list.Contains(item5.ParentEquipmentName)) { item5.Init(((BaseUnityPlugin)this).Config); } } IEnumerable enumerable4 = from type in Assembly.GetExecutingAssembly().GetTypes() where !type.IsAbstract && type.IsSubclassOf(typeof(ArtifactBase)) select type; foreach (Type item6 in enumerable4) { ArtifactBase artifactBase = (ArtifactBase)Activator.CreateInstance(item6); if (ValidateArtifact(artifactBase, Artifacts)) { artifactBase.Init(((BaseUnityPlugin)this).Config); } } onFinishScanning?.Invoke(); } public bool ValidateArtifact(ArtifactBase artifact, List artifactList) { bool value = ((BaseUnityPlugin)this).Config.Bind("Artifact: " + artifact.ArtifactName, "Enable Artifact?", true, "Should this artifact appear for selection?").Value; if (value) { artifactList.Add(artifact); } return value; } public bool ValidateItem(ItemBase item, List itemList) { string text = "Should this item appear in runs?"; if (item.Unfinished) { text = "UNFINISHED! " + text; } bool value = ((BaseUnityPlugin)this).Config.Bind(item.ConfigCategory, "Enable Item?", true, text).Value; bool flag = item.ItemTags.Contains((ItemTag)4); bool value2 = ((BaseUnityPlugin)this).Config.Bind(item.ConfigCategory, "Blacklist Item from AI Use?", flag, "Should the AI not be able to obtain this item?").Value; if (item.Unfinished && !useUnfinished) { return false; } if (value) { itemList.Add(item); if (value2) { item.AIBlacklisted = true; } } return value; } public bool ValidateEquipment(EquipmentBase equipment, List equipmentList) { string text = "Should this equipment appear in runs?"; if (equipment.Unfinished) { text = "UNFINISHED! " + text; } bool value = ((BaseUnityPlugin)this).Config.Bind(equipment.ConfigCategory, "Enable Equipment?", true, text).Value; if (equipment.Unfinished && !useUnfinished) { return false; } if (value) { equipmentList.Add(equipment); return true; } return false; } public bool ValidateEliteEquipment(EliteEquipmentBase eliteEquipment, List eliteEquipmentList) { if (((BaseUnityPlugin)this).Config.Bind("Equipment: " + eliteEquipment.EliteEquipmentName, "Enable Elite Equipment?", true, "Should this elite equipment appear in runs? If disabled, the associated elite will not appear in runs either.").Value) { eliteEquipmentList.Add(eliteEquipment); return true; } return false; } } } namespace ClassicItemsReturns.Utils { public class IsTeleActivatedTracker { public delegate void OnTPActivatedDelegate(); public static bool teleporterActivated = false; public static List alwaysActiveStages = new List { "voidraid", "limbo", "enemiesreturns_outoftime", "solutionalhaunt", "solusweb" }; public static OnTPActivatedDelegate OnTPActivatedActions; public IsTeleActivatedTracker() { //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 //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Expected O, but got Unknown //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Expected O, but got Unknown //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Expected O, but got Unknown //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Expected O, but got Unknown //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Expected O, but got Unknown //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Expected O, but got Unknown //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Expected O, but got Unknown //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Expected O, but got Unknown Stage.onStageStartGlobal += Stage_onStageStartGlobal; ChargingState.OnEnter += new hook_OnEnter(ChargingState_OnEnter); ChargedState.OnEnter += new hook_OnEnter(ChargedState_OnEnter); Active.OnEnter += new hook_OnEnter(Active_OnEnter); Travelling.OnEnter += new hook_OnEnter(Travelling_OnEnter); BrotherEncounterPhaseBaseState.OnEnter += new hook_OnEnter(BrotherEncounterPhaseBaseState_OnEnter); ArenaMissionController.BeginRound += new hook_BeginRound(ArenaMissionController_BeginRound); MoonBatteryActive.OnEnter += new hook_OnEnter(MoonBatteryActive_OnEnter); StartHurt.OnEnter += new hook_OnEnter(StartHurt_OnEnter); Charging.OnEnter += new hook_OnEnter(Charging_OnEnter); GoldshoresBossfight.SpawnBoss += new hook_SpawnBoss(GoldshoresBossfight_SpawnBoss); MeridianEventStart.OnEnter += new hook_OnEnter(MeridianEventStart_OnEnter1); } private void MeridianEventStart_OnEnter1(orig_OnEnter orig, MeridianEventStart self) { orig.Invoke(self); OnTPActivated(); } private void GoldshoresBossfight_SpawnBoss(orig_SpawnBoss orig, GoldshoresBossfight self) { orig.Invoke(self); OnTPActivated(); } private void StartHurt_OnEnter(orig_OnEnter orig, StartHurt self) { orig.Invoke(self); OnTPActivated(); } private void Charging_OnEnter(orig_OnEnter orig, Charging self) { orig.Invoke(self); OnTPActivated(); } private void MoonBatteryActive_OnEnter(orig_OnEnter orig, MoonBatteryActive self) { orig.Invoke(self); OnTPActivated(); } private void ArenaMissionController_BeginRound(orig_BeginRound orig, ArenaMissionController self) { orig.Invoke(self); OnTPActivated(); } private void BrotherEncounterPhaseBaseState_OnEnter(orig_OnEnter orig, BrotherEncounterPhaseBaseState self) { orig.Invoke(self); OnTPActivated(); } private void ChargedState_OnEnter(orig_OnEnter orig, ChargedState self) { orig.Invoke(self); OnTPActivated(); } private void Active_OnEnter(orig_OnEnter orig, Active self) { orig.Invoke(self); OnTPActivated(); } private void ChargingState_OnEnter(orig_OnEnter orig, ChargingState self) { orig.Invoke(self); OnTPActivated(); } private void Travelling_OnEnter(orig_OnEnter orig, Travelling self) { orig.Invoke(self); teleporterActivated = false; } private void Stage_onStageStartGlobal(Stage obj) { teleporterActivated = false; SceneDef sceneDefForCurrentScene = SceneCatalog.GetSceneDefForCurrentScene(); if (Object.op_Implicit((Object)(object)sceneDefForCurrentScene) && alwaysActiveStages.Contains(sceneDefForCurrentScene.cachedName)) { OnTPActivated(); } } public static void OnTPActivated() { if (!teleporterActivated) { teleporterActivated = true; OnTPActivatedActions?.Invoke(); } } } public static class ItemHelpers { public class OverlayPreviewer : MonoBehaviour { public enum AnimationCurveType { Constant, Linear, EaseInAndOut } public bool EnableToPreview = false; public string materialAssetPath = ""; [HideInInspector] public Material materialInstance; public bool isAssigned; public CharacterModel assignedCharacterModel; public CharacterModel inspectorCharacterModel; public bool animateShaderAlpha; public AnimationCurve alphaCurve; public float constantAnimCurveFloat = 1f; public AnimationCurveType animationCurveType = AnimationCurveType.Constant; public float duration = 2f; public void Update() { if (EnableToPreview) { EnableToPreview = false; TemporaryOverlay val = ((Component)((Component)this).gameObject.GetComponent().modelTransform).gameObject.AddComponent(); val.duration = duration; val.animateShaderAlpha = animateShaderAlpha; val.alphaCurve = AnimationCurve.Constant(0f, duration, constantAnimCurveFloat); val.destroyComponentOnEnd = true; try { val.originalMaterial = Assets.LoadAddressable(materialAssetPath); val.AddToCharacerModel(((Component)((Component)this).gameObject.GetComponent().modelTransform).GetComponent()); } catch { Object.Destroy((Object)(object)val); Chat.AddMessage("Exception on preview"); } } } } private static Shader hopooShader = Addressables.LoadAssetAsync((object)"RoR2/Base/Shaders/HGStandard.shader").WaitForCompletion(); private static List cachedMaterials = new List(); public static RendererInfo[] ItemDisplaySetup(GameObject obj, bool debugmode = false) { //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: 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_00de: Unknown result type (might be due to invalid IL or missing references) List list = new List(); MeshRenderer[] componentsInChildren = obj.GetComponentsInChildren(); if (componentsInChildren.Length != 0) { list.AddRange((IEnumerable)(object)componentsInChildren); } SkinnedMeshRenderer[] componentsInChildren2 = obj.GetComponentsInChildren(); if (componentsInChildren2.Length != 0) { list.AddRange((IEnumerable)(object)componentsInChildren2); } RendererInfo[] array = (RendererInfo[])(object)new RendererInfo[list.Count]; for (int i = 0; i < list.Count; i++) { if (debugmode) { MaterialControllerComponents.HGControllerFinder hGControllerFinder = ((Component)list[i]).gameObject.AddComponent(); hGControllerFinder.Renderer = list[i]; } array[i] = new RendererInfo { defaultMaterial = ((list[i] is SkinnedMeshRenderer) ? list[i].sharedMaterial : list[i].material), renderer = list[i], defaultShadowCastingMode = (ShadowCastingMode)1, ignoreOverlays = false }; } return array; } public static void SetupMaterials(GameObject model) { //IL_00d7: 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_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) Renderer[] componentsInChildren = model.GetComponentsInChildren(); Renderer[] array = componentsInChildren; foreach (Renderer val in array) { bool flag = Object.op_Implicit((Object)(object)val.material.shader) && ((Object)val.material.shader).name == "Standard"; bool flag2 = ((Object)val).name == "UseGlassShader" || ((Object)val).name == "UseGlass2Shader" || ((Object)val).name == "UseGlass3Shader"; if (Object.op_Implicit((Object)(object)val.material) && (flag || flag2)) { if (((Object)val).name == "UseGlassShader") { Debug.Log((object)("ClassicItemsReturns: Swapping material to Infusion Glass material for " + ((Object)model).name)); val.material = Addressables.LoadAssetAsync((object)"RoR2/Base/Infusion/matInfusionGlass.mat").WaitForCompletion(); } else if (((Object)val).name == "UseGlass2Shader") { Debug.Log((object)("ClassicItemsReturns: Swapping material to Elixir Glass material for " + ((Object)model).name)); val.material = Addressables.LoadAssetAsync((object)"RoR2/DLC1/HealingPotion/matHealingPotionGlass.mat").WaitForCompletion(); } else if (((Object)val).name == "UseGlass3Shader") { Debug.Log((object)("ClassicItemsReturns: Swapping material to Vending Machine Glass material for " + ((Object)model).name)); val.material = Addressables.LoadAssetAsync((object)"RoR2/DLC1/VendingMachine/matVendingMachineGlass.mat").WaitForCompletion(); } else { val.sharedMaterial = val.sharedMaterial.SetHopooMaterial(); } } } } public static Sprite LoadItemSprite(string spriteName) { Sprite val = Assets.LoadSprite("texIcon3d" + spriteName); Sprite val2 = Assets.LoadSprite("texIcon" + spriteName); Sprite val3 = Assets.LoadSprite("texIconClassic" + spriteName); if (ClassicItemsReturnsPlugin.use3dModels) { if (Object.op_Implicit((Object)(object)val)) { return val; } if (Object.op_Implicit((Object)(object)val2)) { return val2; } return val3; } if (!ClassicItemsReturnsPlugin.useClassicSprites) { if (Object.op_Implicit((Object)(object)val2)) { return val2; } if (Object.op_Implicit((Object)(object)val3)) { return val3; } return val; } if (Object.op_Implicit((Object)(object)val3)) { return val3; } if (Object.op_Implicit((Object)(object)val2)) { return val2; } return val; } public static Material SetHopooMaterial(this Material tempMat) { //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: 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_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_01c5: Unknown result type (might be due to invalid IL or missing references) //IL_01d3: Unknown result type (might be due to invalid IL or missing references) //IL_0294: Unknown result type (might be due to invalid IL or missing references) //IL_023d: Unknown result type (might be due to invalid IL or missing references) //IL_024b: Unknown result type (might be due to invalid IL or missing references) //IL_0267: Unknown result type (might be due to invalid IL or missing references) //IL_0275: Unknown result type (might be due to invalid IL or missing references) if (cachedMaterials.Contains(tempMat)) { return tempMat; } float? num = null; Color? val = null; float? num2 = null; float? num3 = tempMat.GetFloat("_Metallic"); bool flag = tempMat.IsKeywordEnabled("_NORMALMAP"); bool flag2 = tempMat.IsKeywordEnabled("_PARALLAXMAP"); Texture val2 = null; Vector2 val3 = Vector2.one; Vector2 val4 = Vector2.zero; Texture val5 = null; Vector2 val6 = Vector2.one; Vector2 val7 = Vector2.zero; if (flag2) { val2 = tempMat.GetTexture("_ParallaxMap"); val3 = tempMat.GetTextureScale("_ParallaxMap"); val4 = tempMat.GetTextureOffset("_ParallaxMap"); num2 = tempMat.GetFloat("_Parallax"); } if (flag) { num = tempMat.GetFloat("_BumpScale"); val5 = tempMat.GetTexture("_BumpMap"); val6 = tempMat.GetTextureScale("_BumpMap"); val7 = tempMat.GetTextureOffset("_BumpMap"); } if (tempMat.IsKeywordEnabled("_EMISSION")) { val = tempMat.GetColor("_EmissionColor"); } tempMat.shader = hopooShader; tempMat.SetColor("_Color", tempMat.GetColor("_Color")); tempMat.SetTexture("_MainTex", tempMat.GetTexture("_MainTex")); tempMat.SetTexture("_EmTex", tempMat.GetTexture("_EmissionMap")); tempMat.EnableKeyword("DITHER"); if (num3.HasValue) { tempMat.SetFloat("_SpecularStrength", 1f); } if (flag2) { tempMat.SetTexture("_ParallaxMap", val2); tempMat.SetTextureScale("_ParallaxMap", val3); tempMat.SetTextureOffset("_ParallaxMap", val4); if (num2.HasValue) { tempMat.SetFloat("_Parallax", num2.Value); } } if (flag) { if (num.HasValue) { tempMat.SetFloat("_NormalStrength", num.Value); } tempMat.SetTexture("_BumpMap", val5); tempMat.SetTextureScale("_BumpMap", val6); tempMat.SetTextureOffset("_BumpMap", val7); tempMat.SetTexture("_NormalTex", val5); tempMat.SetTextureScale("_NormalTex", val6); tempMat.SetTextureOffset("_NormalTex", val7); } if (val.HasValue) { tempMat.SetColor("_EmColor", val.Value); tempMat.SetFloat("_EmPower", 1f); } if (tempMat.IsKeywordEnabled("NOCULL")) { tempMat.SetInt("_Cull", 0); } if (tempMat.IsKeywordEnabled("LIMBREMOVAL")) { tempMat.SetInt("_LimbRemovalOn", 1); } cachedMaterials.Add(tempMat); return tempMat; } public static void RefreshTimedBuffs(CharacterBody body, BuffDef buffDef, float duration) { //IL_0039: 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) if (!Object.op_Implicit((Object)(object)body) || body.GetBuffCount(buffDef) <= 0) { return; } foreach (TimedBuff timedBuff in body.timedBuffs) { if (buffDef.buffIndex == timedBuff.buffIndex) { timedBuff.timer = duration; } } } public static void RefreshTimedBuffs(CharacterBody body, BuffDef buffDef, float taperStart, float taperDuration) { //IL_003b: 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) if (!Object.op_Implicit((Object)(object)body) || body.GetBuffCount(buffDef) <= 0) { return; } int num = 0; foreach (TimedBuff timedBuff in body.timedBuffs) { if (buffDef.buffIndex == timedBuff.buffIndex) { timedBuff.timer = taperStart + (float)num * taperDuration; num++; } } } public static DotIndex FindAssociatedDotForBuff(BuffDef buff) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) return (DotIndex)Array.FindIndex(DotController.dotDefs, (DotDef dotDef) => (Object)(object)dotDef.associatedBuff == (Object)(object)buff); } public static float StackingLinear(int itemCount, float baseValue, float stackValue) { return baseValue + stackValue * (float)(itemCount - 1); } public static int StackingLinear(int itemCount, int baseValue, int stackValue) { return baseValue + stackValue * (itemCount - 1); } public static bool TryGetBuffCount(CharacterBody characterBody, BuffDef buffDef, out int buffCount) { buffCount = 0; if (!Object.op_Implicit((Object)(object)characterBody)) { return false; } buffCount = characterBody.GetBuffCount(buffDef); return buffCount > 0; } } public static class MathHelpers { public static string FloatToPercentageString(float number, float numberBase = 100f) { return (number * numberBase).ToString("##0") + "%"; } public static Vector3 ClosestPointOnSphereToPoint(Vector3 origin, float radius, Vector3 targetPosition) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) Vector3 val = targetPosition - origin; val = Vector3.Normalize(val); val *= radius; return origin + val; } public static List DistributePointsEvenlyAroundSphere(int points, float radius, Vector3 origin) { //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) List list = new List(); double num = Math.PI * (3.0 - Math.Sqrt(5.0)); for (int i = 0; i < points; i++) { int num2 = 1 - i / (points - 1) * 2; double num3 = Math.Sqrt(1 - num2 * num2); double num4 = num * (double)i; float num5 = (float)(Math.Cos(num4) * num3); float num6 = (float)(Math.Sin(num4) * num3); Vector3 val = origin + new Vector3(num5, (float)num2, num6); list.Add(val * radius); } return list; } public static List DistributePointsEvenlyAroundCircle(int points, float radius, Vector3 origin, float angleOffset = 0f) { //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) List list = new List(); Vector3 item = default(Vector3); for (int i = 0; i < points; i++) { double num = Math.PI * 2.0 / (double)points; double num2 = num * (double)i + (double)angleOffset; ((Vector3)(ref item))..ctor((float)((double)radius * Math.Cos(num2) + (double)origin.x), origin.y, (float)((double)radius * Math.Sin(num2) + (double)origin.z)); list.Add(item); } return list; } public static Vector3 GetPointOnUnitSphereCap(Quaternion targetDirection, float angle) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) float num = Random.Range(0f, angle) * (MathF.PI / 180f); Vector2 insideUnitCircle = Random.insideUnitCircle; Vector2 val = ((Vector2)(ref insideUnitCircle)).normalized * Mathf.Sin(num); Vector3 val2 = default(Vector3); ((Vector3)(ref val2))..ctor(val.x, val.y, Mathf.Cos(num)); return targetDirection * val2; } public static Vector3 GetPointOnUnitSphereCap(Vector3 targetDirection, float angle) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) return GetPointOnUnitSphereCap(Quaternion.LookRotation(targetDirection), angle); } public static Vector3 RandomPointOnCircle(Vector3 origin, float radius, Xoroshiro128Plus random) { //IL_0012: 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_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) float num = random.RangeFloat(0f, MathF.PI * 2f); return origin + new Vector3(Mathf.Cos(num), 0f, Mathf.Sin(num)) * radius; } public static float InverseHyperbolicScaling(float baseValue, float additionalValue, float maxValue, int itemCount) { return baseValue + (maxValue - baseValue) * (1f - 1f / (1f + additionalValue * (float)(itemCount - 1))); } } public static class MiscUtils { private static GameObject teleportHelperPrefab = Addressables.LoadAssetAsync((object)"RoR2/Base/Common/DirectorSpawnProbeHelperPrefab.prefab").WaitForCompletion(); public static Vector3 FindSafeTeleportPosition(Vector3 position, HullClassification hullSize, bool isFlying, float maxDistance, PlacementMode placementMode) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0031: 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_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Expected I4, but got Unknown //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Expected O, but got Unknown //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Expected O, but got Unknown //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) Vector3 result = position; SpawnCard val = ScriptableObject.CreateInstance(); val.hullSize = hullSize; val.nodeGraphType = (GraphType)(isFlying ? 1 : 0); val.prefab = teleportHelperPrefab; float minDistance = 0f; switch ((int)hullSize) { case 0: minDistance = 4f; break; case 1: minDistance = 8f; break; case 2: minDistance = 16f; break; } GameObject val2 = DirectorCore.instance.TrySpawnObject(new DirectorSpawnRequest(val, new DirectorPlacementRule { placementMode = placementMode, position = position, minDistance = minDistance, maxDistance = maxDistance }, RoR2Application.rng)); if (Object.op_Implicit((Object)(object)val2)) { result = val2.transform.position; Object.Destroy((Object)(object)val2); } Object.Destroy((Object)(object)val); return result; } public static Vector3? RaycastToDirection(Vector3 position, float maxDistance, Vector3 direction, int layer) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) RaycastHit val = default(RaycastHit); if (Physics.Raycast(new Ray(position, direction), ref val, maxDistance, layer, (QueryTriggerInteraction)1)) { return ((RaycastHit)(ref val)).point; } return null; } public static void TryRemoveBuff(CharacterBody body, BuffDef buff) { if (body.HasBuff(buff)) { body.RemoveBuff(buff); } } public static IEnumerable Shuffle(this IEnumerable toShuffle, Xoroshiro128Plus random) { List list = new List(); foreach (T item in toShuffle) { list.Insert(random.RangeInt(0, list.Count + 1), item); } return list; } public static Vector3 FindClosestNodeToPosition(Vector3 position, HullClassification hullClassification, bool checkAirNodes = false) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0044: 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) NodeGraph val = (checkAirNodes ? SceneInfo.instance.airNodes : SceneInfo.instance.groundNodes); NodeIndex val2 = val.FindClosestNode(position, hullClassification, float.PositiveInfinity); if (val2 != NodeIndex.invalid) { Vector3 result = default(Vector3); val.GetNodePosition(val2, ref result); return result; } ClassicItemsReturnsPlugin.ModLogger.LogInfo((object)$"No closest node to be found for XYZ: {position}, returning 0,0,0"); return Vector3.zero; } public static bool TeleportBody(CharacterBody characterBody, GameObject target, GameObject teleportEffect, HullClassification hullClassification, Xoroshiro128Plus rng, float minDistance = 20f, float maxDistance = 45f, bool teleportAir = false) { //IL_001d: 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_002c: 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_004c: 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_0053: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: 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_007b: Expected O, but got Unknown //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Expected O, but got Unknown //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)characterBody)) { return false; } SpawnCard val = ScriptableObject.CreateInstance(); val.hullSize = hullClassification; val.nodeGraphType = (GraphType)(teleportAir ? 1 : 0); val.prefab = Resources.Load("SpawnCards/HelperPrefab"); GameObject val2 = DirectorCore.instance.TrySpawnObject(new DirectorSpawnRequest(val, new DirectorPlacementRule { placementMode = (PlacementMode)1, position = target.transform.position, minDistance = minDistance, maxDistance = maxDistance }, rng)); if (Object.op_Implicit((Object)(object)val2)) { TeleportHelper.TeleportBody(characterBody, val2.transform.position); if (Object.op_Implicit((Object)(object)teleportEffect)) { EffectManager.SimpleEffect(teleportEffect, val2.transform.position, Quaternion.identity, true); } Object.Destroy((Object)(object)val2); Object.Destroy((Object)(object)val); return true; } Object.Destroy((Object)(object)val); return false; } public static Vector3? AboveTargetVectorFromDamageInfo(DamageInfo damageInfo, float distanceAboveTarget) { //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: 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_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_012b: 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_0130: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_0169: 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_015b: Unknown result type (might be due to invalid IL or missing references) if (damageInfo.rejected || !Object.op_Implicit((Object)(object)damageInfo.attacker)) { return null; } CharacterBody component = damageInfo.attacker.GetComponent(); if (Object.op_Implicit((Object)(object)component)) { TeamMask enemyTeams = TeamMask.GetEnemyTeams(component.teamComponent.teamIndex); HurtBox val = new SphereSearch { radius = 1f, mask = ((LayerIndex)(ref LayerIndex.entityPrecise)).mask, origin = damageInfo.position }.RefreshCandidates().FilterCandidatesByHurtBoxTeam(enemyTeams).OrderCandidatesByDistance() .FilterCandidatesByDistinctHurtBoxEntities() .GetHurtBoxes() .FirstOrDefault(); if (Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)val.healthComponent) && Object.op_Implicit((Object)(object)val.healthComponent.body)) { CharacterBody body = val.healthComponent.body; Vector3 val2 = body.mainHurtBox.collider.ClosestPointOnBounds(body.transform.position + new Vector3(0f, 10000f, 0f)); Vector3? val3 = RaycastToDirection(val2, distanceAboveTarget, Vector3.up, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask)); if (val3.HasValue) { return val3.Value; } return val2 + Vector3.up * distanceAboveTarget; } } return null; } public static Vector3? AboveTargetBody(CharacterBody body, float distanceAbove) { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)body)) { return null; } Vector3 val = body.mainHurtBox.collider.ClosestPointOnBounds(body.transform.position + new Vector3(0f, 10000f, 0f)); Vector3? val2 = RaycastToDirection(val, distanceAbove, Vector3.up, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask)); if (val2.HasValue) { return val2.Value; } return val + Vector3.up * distanceAbove; } public static Dictionary GetAimSurfaceAlignmentInfo(Ray ray, int layerMask, float distance) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) Dictionary dictionary = new Dictionary(); RaycastHit val = default(RaycastHit); if (!Physics.Raycast(ray, ref val, distance, layerMask, (QueryTriggerInteraction)1)) { ClassicItemsReturnsPlugin.ModLogger.LogInfo((object)$"GetAimSurfaceAlignmentInfo did not hit anything in the aim direction on the specified layer ({layerMask})."); return null; } Vector3 point = ((RaycastHit)(ref val)).point; Vector3 val2 = Vector3.Cross(((Ray)(ref ray)).direction, Vector3.up); Vector3 val3 = Vector3.ProjectOnPlane(((RaycastHit)(ref val)).normal, val2); Vector3 value = Vector3.Cross(val2, val3); dictionary.Add("Position", point); dictionary.Add("Right", val2); dictionary.Add("Forward", value); dictionary.Add("Up", val3); return dictionary; } public static List FindEnemiesInSphere(float radius, Vector3 position, TeamIndex team) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) int num = 0; List list = new List(); Collider[] array = Physics.OverlapSphere(position, radius, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.entityPrecise)).mask)); for (int i = 0; i < array.Length; i++) { HurtBox component = ((Component)array[i]).GetComponent(); if (Object.op_Implicit((Object)(object)component)) { HealthComponent healthComponent = component.healthComponent; if (Object.op_Implicit((Object)(object)healthComponent) && Object.op_Implicit((Object)(object)healthComponent.body) && Object.op_Implicit((Object)(object)healthComponent.body.teamComponent) && healthComponent.body.teamComponent.teamIndex != team && !list.Contains(healthComponent)) { list.Add(healthComponent); } } } return list; } } public static class NetworkingHelpers { public static T GetObjectFromNetIdValue(uint netIdValue) { //IL_002a: 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) NetworkInstanceId key = default(NetworkInstanceId); ((NetworkInstanceId)(ref key))..ctor(netIdValue); NetworkIdentity value; if (NetworkServer.active) { NetworkServer.objects.TryGetValue(key, out value); } else { ClientScene.objects.TryGetValue(key, out value); } if (Object.op_Implicit((Object)(object)value)) { T component = ((Component)value).GetComponent(); if (component != null) { return component; } } return default(T); } } } namespace ClassicItemsReturns.Utils.Components { public class MaterialControllerComponents { public class HGControllerFinder : MonoBehaviour { public Renderer Renderer; public Material Material; public void Start() { if (Object.op_Implicit((Object)(object)Renderer)) { Material = Renderer.materials[0]; if (Object.op_Implicit((Object)(object)Material)) { switch (((Object)Material.shader).name) { case "Hopoo Games/Deferred/Standard": { HGStandardController hGStandardController = ((Component)this).gameObject.AddComponent(); hGStandardController.Material = Material; hGStandardController.Renderer = Renderer; break; } case "Hopoo Games/FX/Cloud Remap": { HGCloudRemapController hGCloudRemapController = ((Component)this).gameObject.AddComponent(); hGCloudRemapController.Material = Material; hGCloudRemapController.Renderer = Renderer; break; } case "Hopoo Games/FX/Cloud Intersection Remap": { HGIntersectionController hGIntersectionController = ((Component)this).gameObject.AddComponent(); hGIntersectionController.Material = Material; hGIntersectionController.Renderer = Renderer; break; } } } } Object.Destroy((Object)(object)this); } } public class HGStandardController : MonoBehaviour { public enum _RampInfoEnum { TwoTone = 0, SmoothedTwoTone = 1, Unlitish = 3, Subsurface = 4, Grass = 5 } public enum _DecalLayerEnum { Default, Environment, Character, Misc } public enum _CullEnum { Off, Front, Back } public enum _PrintDirectionEnum { BottomUp = 0, TopDown = 1, BackToFront = 3 } public Material Material; public Renderer Renderer; public string MaterialName; public bool _EnableCutout; public Color _Color; public Texture _MainTex; public Vector2 _MainTexScale; public Vector2 _MainTexOffset; [Range(0f, 5f)] public float _NormalStrength; public Texture _NormalTex; public Vector2 _NormalTexScale; public Vector2 _NormalTexOffset; public Color _EmColor; public Texture _EmTex; [Range(0f, 10f)] public float _EmPower; [Range(0f, 1f)] public float _Smoothness; public bool _IgnoreDiffuseAlphaForSpeculars; public _RampInfoEnum _RampChoice; public _DecalLayerEnum _DecalLayer; [Range(0f, 1f)] public float _SpecularStrength; [Range(0.1f, 20f)] public float _SpecularExponent; public _CullEnum _Cull_Mode; public bool _EnableDither; [Range(0f, 1f)] public float _FadeBias; public bool _EnableFresnelEmission; public Texture _FresnelRamp; [Range(0.1f, 20f)] public float _FresnelPower; public Texture _FresnelMask; [Range(0f, 20f)] public float _FresnelBoost; public bool _EnablePrinting; [Range(-25f, 25f)] public float _SliceHeight; [Range(0f, 10f)] public float _PrintBandHeight; [Range(0f, 1f)] public float _PrintAlphaDepth; public Texture _PrintAlphaTexture; public Vector2 _PrintAlphaTextureScale; public Vector2 _PrintAlphaTextureOffset; [Range(0f, 10f)] public float _PrintColorBoost; [Range(0f, 4f)] public float _PrintAlphaBias; [Range(0f, 1f)] public float _PrintEmissionToAlbedoLerp; public _PrintDirectionEnum _PrintDirection; public Texture _PrintRamp; [Range(-10f, 10f)] public float _EliteBrightnessMin; [Range(-10f, 10f)] public float _EliteBrightnessMax; public bool _EnableSplatmap; public bool _UseVertexColorsInstead; [Range(0f, 1f)] public float _BlendDepth; public Texture _SplatmapTex; public Vector2 _SplatmapTexScale; public Vector2 _SplatmapTexOffset; [Range(0f, 20f)] public float _SplatmapTileScale; public Texture _GreenChannelTex; public Texture _GreenChannelNormalTex; [Range(0f, 1f)] public float _GreenChannelSmoothness; [Range(-2f, 5f)] public float _GreenChannelBias; public Texture _BlueChannelTex; public Texture _BlueChannelNormalTex; [Range(0f, 1f)] public float _BlueChannelSmoothness; [Range(-2f, 5f)] public float _BlueChannelBias; public bool _EnableFlowmap; public Texture _FlowTexture; public Texture _FlowHeightmap; public Vector2 _FlowHeightmapScale; public Vector2 _FlowHeightmapOffset; public Texture _FlowHeightRamp; public Vector2 _FlowHeightRampScale; public Vector2 _FlowHeightRampOffset; [Range(-1f, 1f)] public float _FlowHeightBias; [Range(0.1f, 20f)] public float _FlowHeightPower; [Range(0.1f, 20f)] public float _FlowEmissionStrength; [Range(0f, 15f)] public float _FlowSpeed; [Range(0f, 5f)] public float _MaskFlowStrength; [Range(0f, 5f)] public float _NormalFlowStrength; [Range(0f, 10f)] public float _FlowTextureScaleFactor; public bool _EnableLimbRemoval; public void Start() { GrabMaterialValues(); } public void GrabMaterialValues() { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_02cd: Unknown result type (might be due to invalid IL or missing references) //IL_02d2: Unknown result type (might be due to invalid IL or missing references) //IL_02e3: Unknown result type (might be due to invalid IL or missing references) //IL_02e8: Unknown result type (might be due to invalid IL or missing references) //IL_03ec: Unknown result type (might be due to invalid IL or missing references) //IL_03f1: Unknown result type (might be due to invalid IL or missing references) //IL_0402: Unknown result type (might be due to invalid IL or missing references) //IL_0407: Unknown result type (might be due to invalid IL or missing references) //IL_0520: Unknown result type (might be due to invalid IL or missing references) //IL_0525: Unknown result type (might be due to invalid IL or missing references) //IL_0536: Unknown result type (might be due to invalid IL or missing references) //IL_053b: Unknown result type (might be due to invalid IL or missing references) //IL_0562: Unknown result type (might be due to invalid IL or missing references) //IL_0567: Unknown result type (might be due to invalid IL or missing references) //IL_0578: Unknown result type (might be due to invalid IL or missing references) //IL_057d: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)Material)) { _EnableCutout = Material.IsKeywordEnabled("CUTOUT"); _Color = Material.GetColor("_Color"); _MainTex = Material.GetTexture("_MainTex"); _MainTexScale = Material.GetTextureScale("_MainTex"); _MainTexOffset = Material.GetTextureOffset("_MainTex"); _NormalStrength = Material.GetFloat("_NormalStrength"); _NormalTex = Material.GetTexture("_NormalTex"); _NormalTexScale = Material.GetTextureScale("_NormalTex"); _NormalTexOffset = Material.GetTextureOffset("_NormalTex"); _EmColor = Material.GetColor("_EmColor"); _EmTex = Material.GetTexture("_EmTex"); _EmPower = Material.GetFloat("_EmPower"); _Smoothness = Material.GetFloat("_Smoothness"); _IgnoreDiffuseAlphaForSpeculars = Material.IsKeywordEnabled("FORCE_SPEC"); _RampChoice = (_RampInfoEnum)Material.GetFloat("_RampInfo"); _DecalLayer = (_DecalLayerEnum)Material.GetFloat("_DecalLayer"); _SpecularStrength = Material.GetFloat("_SpecularStrength"); _SpecularExponent = Material.GetFloat("_SpecularExponent"); _Cull_Mode = (_CullEnum)Material.GetFloat("_Cull"); _EnableDither = Material.IsKeywordEnabled("DITHER"); _FadeBias = Material.GetFloat("_FadeBias"); _EnableFresnelEmission = Material.IsKeywordEnabled("FRESNEL_EMISSION"); _FresnelRamp = Material.GetTexture("_FresnelRamp"); _FresnelPower = Material.GetFloat("_FresnelPower"); _FresnelMask = Material.GetTexture("_FresnelMask"); _FresnelBoost = Material.GetFloat("_FresnelBoost"); _EnablePrinting = Material.IsKeywordEnabled("PRINT_CUTOFF"); _SliceHeight = Material.GetFloat("_SliceHeight"); _PrintBandHeight = Material.GetFloat("_SliceBandHeight"); _PrintAlphaDepth = Material.GetFloat("_SliceAlphaDepth"); _PrintAlphaTexture = Material.GetTexture("_SliceAlphaTex"); _PrintAlphaTextureScale = Material.GetTextureScale("_SliceAlphaTex"); _PrintAlphaTextureOffset = Material.GetTextureOffset("_SliceAlphaTex"); _PrintColorBoost = Material.GetFloat("_PrintBoost"); _PrintAlphaBias = Material.GetFloat("_PrintBias"); _PrintEmissionToAlbedoLerp = Material.GetFloat("_PrintEmissionToAlbedoLerp"); _PrintDirection = (_PrintDirectionEnum)Material.GetFloat("_PrintDirection"); _PrintRamp = Material.GetTexture("_PrintRamp"); _EliteBrightnessMin = Material.GetFloat("_EliteBrightnessMin"); _EliteBrightnessMax = Material.GetFloat("_EliteBrightnessMax"); _EnableSplatmap = Material.IsKeywordEnabled("SPLATMAP"); _UseVertexColorsInstead = Material.IsKeywordEnabled("USE_VERTEX_COLORS"); _BlendDepth = Material.GetFloat("_Depth"); _SplatmapTex = Material.GetTexture("_SplatmapTex"); _SplatmapTexScale = Material.GetTextureScale("_SplatmapTex"); _SplatmapTexOffset = Material.GetTextureOffset("_SplatmapTex"); _SplatmapTileScale = Material.GetFloat("_SplatmapTileScale"); _GreenChannelTex = Material.GetTexture("_GreenChannelTex"); _GreenChannelNormalTex = Material.GetTexture("_GreenChannelNormalTex"); _GreenChannelSmoothness = Material.GetFloat("_GreenChannelSmoothness"); _GreenChannelBias = Material.GetFloat("_GreenChannelBias"); _BlueChannelTex = Material.GetTexture("_BlueChannelTex"); _BlueChannelNormalTex = Material.GetTexture("_BlueChannelNormalTex"); _BlueChannelSmoothness = Material.GetFloat("_BlueChannelSmoothness"); _BlueChannelBias = Material.GetFloat("_BlueChannelBias"); _EnableFlowmap = Material.IsKeywordEnabled("FLOWMAP"); _FlowTexture = Material.GetTexture("_FlowTex"); _FlowHeightmap = Material.GetTexture("_FlowHeightmap"); _FlowHeightmapScale = Material.GetTextureScale("_FlowHeightmap"); _FlowHeightmapOffset = Material.GetTextureOffset("_FlowHeightmap"); _FlowHeightRamp = Material.GetTexture("_FlowHeightRamp"); _FlowHeightRampScale = Material.GetTextureScale("_FlowHeightRamp"); _FlowHeightRampOffset = Material.GetTextureOffset("_FlowHeightRamp"); _FlowHeightBias = Material.GetFloat("_FlowHeightBias"); _FlowHeightPower = Material.GetFloat("_FlowHeightPower"); _FlowEmissionStrength = Material.GetFloat("_FlowEmissionStrength"); _FlowSpeed = Material.GetFloat("_FlowSpeed"); _MaskFlowStrength = Material.GetFloat("_FlowMaskStrength"); _NormalFlowStrength = Material.GetFloat("_FlowNormalStrength"); _FlowTextureScaleFactor = Material.GetFloat("_FlowTextureScaleFactor"); _EnableLimbRemoval = Material.IsKeywordEnabled("LIMBREMOVAL"); MaterialName = ((Object)Material).name; } } public void Update() { //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_0427: Unknown result type (might be due to invalid IL or missing references) //IL_043e: Unknown result type (might be due to invalid IL or missing references) //IL_05ae: Unknown result type (might be due to invalid IL or missing references) //IL_05c5: Unknown result type (might be due to invalid IL or missing references) //IL_07e6: Unknown result type (might be due to invalid IL or missing references) //IL_07fd: Unknown result type (might be due to invalid IL or missing references) //IL_0854: Unknown result type (might be due to invalid IL or missing references) //IL_086b: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)Material)) { if (((Object)Material).name != MaterialName && Object.op_Implicit((Object)(object)Renderer)) { GrabMaterialValues(); PutMaterialIntoMeshRenderer(Renderer, Material); } SetShaderKeywordBasedOnBool(_EnableCutout, Material, "CUTOUT"); Material.SetColor("_Color", _Color); if (Object.op_Implicit((Object)(object)_MainTex)) { Material.SetTexture("_MainTex", _MainTex); Material.SetTextureScale("_MainTex", _MainTexScale); Material.SetTextureOffset("_MainTex", _MainTexOffset); } else { Material.SetTexture("_MainTex", (Texture)null); } Material.SetFloat("_NormalStrength", _NormalStrength); if (Object.op_Implicit((Object)(object)_NormalTex)) { Material.SetTexture("_NormalTex", _NormalTex); Material.SetTextureScale("_NormalTex", _NormalTexScale); Material.SetTextureOffset("_NormalTex", _NormalTexOffset); } else { Material.SetTexture("_NormalTex", (Texture)null); } Material.SetColor("_EmColor", _EmColor); if (Object.op_Implicit((Object)(object)_EmTex)) { Material.SetTexture("_EmTex", _EmTex); } else { Material.SetTexture("_EmTex", (Texture)null); } Material.SetFloat("_EmPower", _EmPower); Material.SetFloat("_Smoothness", _Smoothness); SetShaderKeywordBasedOnBool(_IgnoreDiffuseAlphaForSpeculars, Material, "FORCE_SPEC"); Material.SetFloat("_RampInfo", Convert.ToSingle(_RampChoice)); Material.SetFloat("_DecalLayer", Convert.ToSingle(_DecalLayer)); Material.SetFloat("_SpecularStrength", _SpecularStrength); Material.SetFloat("_SpecularExponent", _SpecularExponent); Material.SetFloat("_Cull", Convert.ToSingle(_Cull_Mode)); SetShaderKeywordBasedOnBool(_EnableDither, Material, "DITHER"); Material.SetFloat("_FadeBias", _FadeBias); SetShaderKeywordBasedOnBool(_EnableFresnelEmission, Material, "FRESNEL_EMISSION"); if (Object.op_Implicit((Object)(object)_FresnelRamp)) { Material.SetTexture("_FresnelRamp", _FresnelRamp); } else { Material.SetTexture("_FresnelRamp", (Texture)null); } Material.SetFloat("_FresnelPower", _FresnelPower); if (Object.op_Implicit((Object)(object)_FresnelMask)) { Material.SetTexture("_FresnelMask", _FresnelMask); } else { Material.SetTexture("_FresnelMask", (Texture)null); } Material.SetFloat("_FresnelBoost", _FresnelBoost); SetShaderKeywordBasedOnBool(_EnablePrinting, Material, "PRINT_CUTOFF"); Material.SetFloat("_SliceHeight", _SliceHeight); Material.SetFloat("_SliceBandHeight", _PrintBandHeight); Material.SetFloat("_SliceAlphaDepth", _PrintAlphaDepth); if (Object.op_Implicit((Object)(object)_PrintAlphaTexture)) { Material.SetTexture("_SliceAlphaTex", _PrintAlphaTexture); Material.SetTextureScale("_SliceAlphaTex", _PrintAlphaTextureScale); Material.SetTextureOffset("_SliceAlphaTex", _PrintAlphaTextureOffset); } else { Material.SetTexture("_SliceAlphaTex", (Texture)null); } Material.SetFloat("_PrintBoost", _PrintColorBoost); Material.SetFloat("_PrintBias", _PrintAlphaBias); Material.SetFloat("_PrintEmissionToAlbedoLerp", _PrintEmissionToAlbedoLerp); Material.SetFloat("_PrintDirection", Convert.ToSingle(_PrintDirection)); if (Object.op_Implicit((Object)(object)_PrintRamp)) { Material.SetTexture("_PrintRamp", _PrintRamp); } else { Material.SetTexture("_PrintRamp", (Texture)null); } Material.SetFloat("_EliteBrightnessMin", _EliteBrightnessMin); Material.SetFloat("_EliteBrightnessMax", _EliteBrightnessMax); SetShaderKeywordBasedOnBool(_EnableSplatmap, Material, "SPLATMAP"); SetShaderKeywordBasedOnBool(_UseVertexColorsInstead, Material, "USE_VERTEX_COLORS"); Material.SetFloat("_Depth", _BlendDepth); if (Object.op_Implicit((Object)(object)_SplatmapTex)) { Material.SetTexture("_SplatmapTex", _SplatmapTex); Material.SetTextureScale("_SplatmapTex", _SplatmapTexScale); Material.SetTextureOffset("_SplatmapTex", _SplatmapTexOffset); } else { Material.SetTexture("_SplatmapTex", (Texture)null); } Material.SetFloat("_SplatmapTileScale", _SplatmapTileScale); if (Object.op_Implicit((Object)(object)_GreenChannelTex)) { Material.SetTexture("_GreenChannelTex", _GreenChannelTex); } else { Material.SetTexture("_GreenChannelTex", (Texture)null); } if (Object.op_Implicit((Object)(object)_GreenChannelNormalTex)) { Material.SetTexture("_GreenChannelNormalTex", _GreenChannelNormalTex); } else { Material.SetTexture("_GreenChannelNormalTex", (Texture)null); } Material.SetFloat("_GreenChannelSmoothness", _GreenChannelSmoothness); Material.SetFloat("_GreenChannelBias", _GreenChannelBias); if (Object.op_Implicit((Object)(object)_BlueChannelTex)) { Material.SetTexture("_BlueChannelTex", _BlueChannelTex); } else { Material.SetTexture("_BlueChannelTex", (Texture)null); } if (Object.op_Implicit((Object)(object)_BlueChannelNormalTex)) { Material.SetTexture("_BlueChannelNormalTex", _BlueChannelNormalTex); } else { Material.SetTexture("_BlueChannelNormalTex", (Texture)null); } Material.SetFloat("_BlueChannelSmoothness", _BlueChannelSmoothness); Material.SetFloat("_BlueChannelBias", _BlueChannelBias); SetShaderKeywordBasedOnBool(_EnableFlowmap, Material, "FLOWMAP"); if (Object.op_Implicit((Object)(object)_FlowTexture)) { Material.SetTexture("_FlowTex", _FlowTexture); } else { Material.SetTexture("_FlowTex", (Texture)null); } if (Object.op_Implicit((Object)(object)_FlowHeightmap)) { Material.SetTexture("_FlowHeightmap", _FlowHeightmap); Material.SetTextureScale("_FlowHeightmap", _FlowHeightmapScale); Material.SetTextureOffset("_FlowHeightmap", _FlowHeightmapOffset); } else { Material.SetTexture("_FlowHeightmap", (Texture)null); } if (Object.op_Implicit((Object)(object)_FlowHeightRamp)) { Material.SetTexture("_FlowHeightRamp", _FlowHeightRamp); Material.SetTextureScale("_FlowHeightRamp", _FlowHeightRampScale); Material.SetTextureOffset("_FlowHeightRamp", _FlowHeightRampOffset); } else { Material.SetTexture("_FlowHeightRamp", (Texture)null); } Material.SetFloat("_FlowHeightBias", _FlowHeightBias); Material.SetFloat("_FlowHeightPower", _FlowHeightPower); Material.SetFloat("_FlowEmissionStrength", _FlowEmissionStrength); Material.SetFloat("_FlowSpeed", _FlowSpeed); Material.SetFloat("_FlowMaskStrength", _MaskFlowStrength); Material.SetFloat("_FlowNormalStrength", _NormalFlowStrength); Material.SetFloat("_FlowTextureScaleFactor", _FlowTextureScaleFactor); SetShaderKeywordBasedOnBool(_EnableLimbRemoval, Material, "LIMBREMOVAL"); } } } public class HGCloudRemapController : MonoBehaviour { public enum _SrcBlendFloatEnum { Zero, One, DstColor, SrcColor, OneMinusDstColor, SrcAlpha, OneMinusSrcColor, DstAlpha, OneMinusDstAlpha, SrcAlphaSaturate, OneMinusSrcAlpha } public enum _DstBlendFloatEnum { Zero, One, DstColor, SrcColor, OneMinusDstColor, SrcAlpha, OneMinusSrcColor, DstAlpha, OneMinusDstAlpha, SrcAlphaSaturate, OneMinusSrcAlpha } public enum _CullEnum { Off, Front, Back } public enum _ZTestEnum { Disabled, Never, Less, Equal, LessEqual, Greater, NotEqual, GreaterEqual, Always } public Material Material; public Renderer Renderer; public string MaterialName; public _SrcBlendFloatEnum _Source_Blend_Mode; public _DstBlendFloatEnum _Destination_Blend_Mode; public int _InternalSimpleBlendMode; public Color _Tint; public bool _DisableRemapping; public Texture _MainTex; public Vector2 _MainTexScale; public Vector2 _MainTexOffset; public Texture _RemapTex; public Vector2 _RemapTexScale; public Vector2 _RemapTexOffset; [Range(0f, 2f)] public float _SoftFactor; [Range(1f, 20f)] public float _BrightnessBoost; [Range(0f, 20f)] public float _AlphaBoost; [Range(0f, 1f)] public float _AlphaBias; public bool _UseUV1; public bool _FadeWhenNearCamera; [Range(0f, 1f)] public float _FadeCloseDistance; public _CullEnum _Cull_Mode; public _ZTestEnum _ZTest_Mode; [Range(-10f, 10f)] public float _DepthOffset; public bool _CloudRemapping; public bool _DistortionClouds; [Range(-2f, 2f)] public float _DistortionStrength; public Texture _Cloud1Tex; public Vector2 _Cloud1TexScale; public Vector2 _Cloud1TexOffset; public Texture _Cloud2Tex; public Vector2 _Cloud2TexScale; public Vector2 _Cloud2TexOffset; public Vector4 _CutoffScroll; public bool _VertexColors; public bool _LuminanceForVertexAlpha; public bool _LuminanceForTextureAlpha; public bool _VertexOffset; public bool _FresnelFade; public bool _SkyboxOnly; [Range(-20f, 20f)] public float _FresnelPower; [Range(0f, 3f)] public float _VertexOffsetAmount; public void Start() { GrabMaterialValues(); } public void GrabMaterialValues() { //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_024b: Unknown result type (might be due to invalid IL or missing references) //IL_0250: Unknown result type (might be due to invalid IL or missing references) //IL_0261: Unknown result type (might be due to invalid IL or missing references) //IL_0266: Unknown result type (might be due to invalid IL or missing references) //IL_028d: Unknown result type (might be due to invalid IL or missing references) //IL_0292: 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_02b9: Unknown result type (might be due to invalid IL or missing references) //IL_02be: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)Material)) { _Source_Blend_Mode = (_SrcBlendFloatEnum)Material.GetFloat("_SrcBlend"); _Destination_Blend_Mode = (_DstBlendFloatEnum)Material.GetFloat("_DstBlend"); _InternalSimpleBlendMode = (int)Material.GetFloat("_InternalSimpleBlendMode"); _Tint = Material.GetColor("_TintColor"); _DisableRemapping = Material.IsKeywordEnabled("DISABLEREMAP"); _MainTex = Material.GetTexture("_MainTex"); _MainTexScale = Material.GetTextureScale("_MainTex"); _MainTexOffset = Material.GetTextureOffset("_MainTex"); _RemapTex = Material.GetTexture("_RemapTex"); _RemapTexScale = Material.GetTextureScale("_RemapTex"); _RemapTexOffset = Material.GetTextureOffset("_RemapTex"); _SoftFactor = Material.GetFloat("_InvFade"); _BrightnessBoost = Material.GetFloat("_Boost"); _AlphaBoost = Material.GetFloat("_AlphaBoost"); _AlphaBias = Material.GetFloat("_AlphaBias"); _UseUV1 = Material.IsKeywordEnabled("USE_UV1"); _FadeWhenNearCamera = Material.IsKeywordEnabled("FADECLOSE"); _FadeCloseDistance = Material.GetFloat("_FadeCloseDistance"); _Cull_Mode = (_CullEnum)Material.GetFloat("_Cull"); _ZTest_Mode = (_ZTestEnum)Material.GetFloat("_ZTest"); _DepthOffset = Material.GetFloat("_DepthOffset"); _CloudRemapping = Material.IsKeywordEnabled("USE_CLOUDS"); _DistortionClouds = Material.IsKeywordEnabled("CLOUDOFFSET"); _DistortionStrength = Material.GetFloat("_DistortionStrength"); _Cloud1Tex = Material.GetTexture("_Cloud1Tex"); _Cloud1TexScale = Material.GetTextureScale("_Cloud1Tex"); _Cloud1TexOffset = Material.GetTextureOffset("_Cloud1Tex"); _Cloud2Tex = Material.GetTexture("_Cloud2Tex"); _Cloud2TexScale = Material.GetTextureScale("_Cloud2Tex"); _Cloud2TexOffset = Material.GetTextureOffset("_Cloud2Tex"); _CutoffScroll = Material.GetVector("_CutoffScroll"); _VertexColors = Material.IsKeywordEnabled("VERTEXCOLOR"); _LuminanceForVertexAlpha = Material.IsKeywordEnabled("VERTEXALPHA"); _LuminanceForTextureAlpha = Material.IsKeywordEnabled("CALCTEXTUREALPHA"); _VertexOffset = Material.IsKeywordEnabled("VERTEXOFFSET"); _FresnelFade = Material.IsKeywordEnabled("FRESNEL"); _SkyboxOnly = Material.IsKeywordEnabled("SKYBOX_ONLY"); _FresnelPower = Material.GetFloat("_FresnelPower"); _VertexOffsetAmount = Material.GetFloat("_OffsetAmount"); MaterialName = ((Object)Material).name; } } public void Update() { //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_032d: Unknown result type (might be due to invalid IL or missing references) //IL_0344: Unknown result type (might be due to invalid IL or missing references) //IL_039b: Unknown result type (might be due to invalid IL or missing references) //IL_03b2: Unknown result type (might be due to invalid IL or missing references) //IL_03e0: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)Material)) { if (((Object)Material).name != MaterialName && Object.op_Implicit((Object)(object)Renderer)) { GrabMaterialValues(); PutMaterialIntoMeshRenderer(Renderer, Material); } Material.SetFloat("_SrcBlend", Convert.ToSingle(_Source_Blend_Mode)); Material.SetFloat("_DstBlend", Convert.ToSingle(_Destination_Blend_Mode)); Material.SetFloat("_InternalSimpleBlendMode", (float)_InternalSimpleBlendMode); Material.SetColor("_TintColor", _Tint); SetShaderKeywordBasedOnBool(_DisableRemapping, Material, "DISABLEREMAP"); if (Object.op_Implicit((Object)(object)_MainTex)) { Material.SetTexture("_MainTex", _MainTex); Material.SetTextureScale("_MainTex", _MainTexScale); Material.SetTextureOffset("_MainTex", _MainTexOffset); } else { Material.SetTexture("_MainTex", (Texture)null); } if (Object.op_Implicit((Object)(object)_RemapTex)) { Material.SetTexture("_RemapTex", _RemapTex); Material.SetTextureScale("_RemapTex", _RemapTexScale); Material.SetTextureOffset("_RemapTex", _RemapTexOffset); } else { Material.SetTexture("_RemapTex", (Texture)null); } Material.SetFloat("_InvFade", _SoftFactor); Material.SetFloat("_Boost", _BrightnessBoost); Material.SetFloat("_AlphaBoost", _AlphaBoost); Material.SetFloat("_AlphaBias", _AlphaBias); SetShaderKeywordBasedOnBool(_UseUV1, Material, "USE_UV1"); SetShaderKeywordBasedOnBool(_FadeWhenNearCamera, Material, "FADECLOSE"); Material.SetFloat("_FadeCloseDistance", _FadeCloseDistance); Material.SetFloat("_Cull", Convert.ToSingle(_Cull_Mode)); Material.SetFloat("_ZTest", Convert.ToSingle(_ZTest_Mode)); Material.SetFloat("_DepthOffset", _DepthOffset); SetShaderKeywordBasedOnBool(_CloudRemapping, Material, "USE_CLOUDS"); SetShaderKeywordBasedOnBool(_DistortionClouds, Material, "CLOUDOFFSET"); Material.SetFloat("_DistortionStrength", _DistortionStrength); if (Object.op_Implicit((Object)(object)_Cloud1Tex)) { Material.SetTexture("_Cloud1Tex", _Cloud1Tex); Material.SetTextureScale("_Cloud1Tex", _Cloud1TexScale); Material.SetTextureOffset("_Cloud1Tex", _Cloud1TexOffset); } else { Material.SetTexture("_Cloud1Tex", (Texture)null); } if (Object.op_Implicit((Object)(object)_Cloud2Tex)) { Material.SetTexture("_Cloud2Tex", _Cloud2Tex); Material.SetTextureScale("_Cloud2Tex", _Cloud2TexScale); Material.SetTextureOffset("_Cloud2Tex", _Cloud2TexOffset); } else { Material.SetTexture("_Cloud2Tex", (Texture)null); } Material.SetVector("_CutoffScroll", _CutoffScroll); SetShaderKeywordBasedOnBool(_VertexColors, Material, "VERTEXCOLOR"); SetShaderKeywordBasedOnBool(_LuminanceForVertexAlpha, Material, "VERTEXALPHA"); SetShaderKeywordBasedOnBool(_LuminanceForTextureAlpha, Material, "CALCTEXTUREALPHA"); SetShaderKeywordBasedOnBool(_VertexOffset, Material, "VERTEXOFFSET"); SetShaderKeywordBasedOnBool(_FresnelFade, Material, "FRESNEL"); SetShaderKeywordBasedOnBool(_SkyboxOnly, Material, "SKYBOX_ONLY"); Material.SetFloat("_FresnelPower", _FresnelPower); Material.SetFloat("_OffsetAmount", _VertexOffsetAmount); } } } public class HGIntersectionController : MonoBehaviour { public enum _SrcBlendFloatEnum { Zero, One, DstColor, SrcColor, OneMinusDstColor, SrcAlpha, OneMinusSrcColor, DstAlpha, OneMinusDstAlpha, SrcAlphaSaturate, OneMinusSrcAlpha } public enum _DstBlendFloatEnum { Zero, One, DstColor, SrcColor, OneMinusDstColor, SrcAlpha, OneMinusSrcColor, DstAlpha, OneMinusDstAlpha, SrcAlphaSaturate, OneMinusSrcAlpha } public enum _CullEnum { Off, Front, Back } public Material Material; public Renderer Renderer; public string MaterialName; public _SrcBlendFloatEnum _Source_Blend_Mode; public _DstBlendFloatEnum _Destination_Blend_Mode; public Color _Tint; public Texture _MainTex; public Vector2 _MainTexScale; public Vector2 _MainTexOffset; public Texture _Cloud1Tex; public Vector2 _Cloud1TexScale; public Vector2 _Cloud1TexOffset; public Texture _Cloud2Tex; public Vector2 _Cloud2TexScale; public Vector2 _Cloud2TexOffset; public Texture _RemapTex; public Vector2 _RemapTexScale; public Vector2 _RemapTexOffset; public Vector4 _CutoffScroll; [Range(0f, 30f)] public float _SoftFactor; [Range(0.1f, 20f)] public float _SoftPower; [Range(0f, 5f)] public float _BrightnessBoost; [Range(0.1f, 20f)] public float _RimPower; [Range(0f, 5f)] public float _RimStrength; [Range(0f, 20f)] public float _AlphaBoost; [Range(0f, 20f)] public float _IntersectionStrength; public _CullEnum _Cull_Mode; public bool _FadeFromVertexColorsOn; public bool _EnableTriplanarProjectionsForClouds; public void Start() { GrabMaterialValues(); } public void GrabMaterialValues() { //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_016c: 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) if (Object.op_Implicit((Object)(object)Material)) { _Source_Blend_Mode = (_SrcBlendFloatEnum)Material.GetFloat("_SrcBlendFloat"); _Destination_Blend_Mode = (_DstBlendFloatEnum)Material.GetFloat("_DstBlendFloat"); _Tint = Material.GetColor("_TintColor"); _MainTex = Material.GetTexture("_MainTex"); _MainTexScale = Material.GetTextureScale("_MainTex"); _MainTexOffset = Material.GetTextureOffset("_MainTex"); _Cloud1Tex = Material.GetTexture("_Cloud1Tex"); _Cloud1TexScale = Material.GetTextureScale("_Cloud1Tex"); _Cloud1TexOffset = Material.GetTextureOffset("_Cloud1Tex"); _Cloud2Tex = Material.GetTexture("_Cloud2Tex"); _Cloud2TexScale = Material.GetTextureScale("_Cloud2Tex"); _Cloud2TexOffset = Material.GetTextureOffset("_Cloud2Tex"); _RemapTex = Material.GetTexture("_RemapTex"); _RemapTexScale = Material.GetTextureScale("_RemapTex"); _RemapTexOffset = Material.GetTextureOffset("_RemapTex"); _CutoffScroll = Material.GetVector("_CutoffScroll"); _SoftFactor = Material.GetFloat("_InvFade"); _SoftPower = Material.GetFloat("_SoftPower"); _BrightnessBoost = Material.GetFloat("_Boost"); _RimPower = Material.GetFloat("_RimPower"); _RimStrength = Material.GetFloat("_RimStrength"); _AlphaBoost = Material.GetFloat("_AlphaBoost"); _IntersectionStrength = Material.GetFloat("_IntersectionStrength"); _Cull_Mode = (_CullEnum)Material.GetFloat("_Cull"); _FadeFromVertexColorsOn = Material.IsKeywordEnabled("FADE_FROM_VERTEX_COLORS"); _EnableTriplanarProjectionsForClouds = Material.IsKeywordEnabled("TRIPLANAR"); MaterialName = ((Object)Material).name; } } public void Update() { //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: Unknown result type (might be due to invalid IL or missing references) //IL_01d6: Unknown result type (might be due to invalid IL or missing references) //IL_022d: Unknown result type (might be due to invalid IL or missing references) //IL_0244: Unknown result type (might be due to invalid IL or missing references) //IL_0272: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)Material)) { if (((Object)Material).name != MaterialName && Object.op_Implicit((Object)(object)Renderer)) { GrabMaterialValues(); PutMaterialIntoMeshRenderer(Renderer, Material); } Material.SetFloat("_SrcBlendFloat", Convert.ToSingle(_Source_Blend_Mode)); Material.SetFloat("_DstBlendFloat", Convert.ToSingle(_Destination_Blend_Mode)); Material.SetColor("_TintColor", _Tint); if (Object.op_Implicit((Object)(object)_MainTex)) { Material.SetTexture("_MainTex", _MainTex); Material.SetTextureScale("_MainTex", _MainTexScale); Material.SetTextureOffset("_MainTex", _MainTexOffset); } else { Material.SetTexture("_MainTex", (Texture)null); } if (Object.op_Implicit((Object)(object)_Cloud1Tex)) { Material.SetTexture("_Cloud1Tex", _Cloud1Tex); Material.SetTextureScale("_Cloud1Tex", _Cloud1TexScale); Material.SetTextureOffset("_Cloud1Tex", _Cloud1TexOffset); } else { Material.SetTexture("_Cloud1Tex", (Texture)null); } if (Object.op_Implicit((Object)(object)_Cloud2Tex)) { Material.SetTexture("_Cloud2Tex", _Cloud2Tex); Material.SetTextureScale("_Cloud2Tex", _Cloud2TexScale); Material.SetTextureOffset("_Cloud2Tex", _Cloud2TexOffset); } else { Material.SetTexture("_Cloud2Tex", (Texture)null); } if (Object.op_Implicit((Object)(object)_RemapTex)) { Material.SetTexture("_RemapTex", _RemapTex); Material.SetTextureScale("_RemapTex", _RemapTexScale); Material.SetTextureOffset("_RemapTex", _RemapTexOffset); } else { Material.SetTexture("_RemapTex", (Texture)null); } Material.SetVector("_CutoffScroll", _CutoffScroll); Material.SetFloat("_InvFade", _SoftFactor); Material.SetFloat("_SoftPower", _SoftPower); Material.SetFloat("_Boost", _BrightnessBoost); Material.SetFloat("_RimPower", _RimPower); Material.SetFloat("_RimStrength", _RimStrength); Material.SetFloat("_AlphaBoost", _AlphaBoost); Material.SetFloat("_IntersectionStrength", _IntersectionStrength); Material.SetFloat("_Cull", Convert.ToSingle(_Cull_Mode)); SetShaderKeywordBasedOnBool(_FadeFromVertexColorsOn, Material, "FADE_FROM_VERTEX_COLORS"); SetShaderKeywordBasedOnBool(_EnableTriplanarProjectionsForClouds, Material, "TRIPLANAR"); } } } public static void SetShaderKeywordBasedOnBool(bool enabled, Material material, string keyword) { if (!Object.op_Implicit((Object)(object)material)) { return; } if (enabled) { if (!material.IsKeywordEnabled(keyword)) { material.EnableKeyword(keyword); } } else if (material.IsKeywordEnabled(keyword)) { material.DisableKeyword(keyword); } } public static void PutMaterialIntoMeshRenderer(Renderer renderer, Material material) { if (Object.op_Implicit((Object)(object)material) && Object.op_Implicit((Object)(object)renderer)) { renderer.materials[0] = material; } } } } namespace ClassicItemsReturns.SharedHooks { public static class OnCharacterDeath { public delegate void OnCharacterDeathAttackerInventory(GlobalEventManager globalEventManager, DamageReport damageReport, CharacterBody attackerBody, Inventory attackerInventory); public static OnCharacterDeathAttackerInventory OnCharacterDeathAttackerInventoryActions; public static void Initialize() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown GlobalEventManager.OnCharacterDeath += new hook_OnCharacterDeath(GlobalEventManager_OnCharacterDeath); } private static void GlobalEventManager_OnCharacterDeath(orig_OnCharacterDeath orig, GlobalEventManager self, DamageReport damageReport) { orig.Invoke(self, damageReport); if (NetworkServer.active && Object.op_Implicit((Object)(object)damageReport.attackerBody) && Object.op_Implicit((Object)(object)damageReport.attackerBody.inventory)) { OnCharacterDeathAttackerInventoryActions?.Invoke(self, damageReport, damageReport.attackerBody, damageReport.attackerBody.inventory); } } } public static class TakeDamage { public delegate void OnDamageTakenInventory(DamageInfo damageInfo, HealthComponent self, CharacterBody victimBody, Inventory inventory, bool lostShield, bool lostOutOfDanger); public static OnDamageTakenInventory OnDamageTakenInventoryActions; public static void Initialize() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown HealthComponent.TakeDamageProcess += new hook_TakeDamageProcess(HealthComponent_TakeDamage); } private static void HealthComponent_TakeDamage(orig_TakeDamageProcess orig, HealthComponent self, DamageInfo damageInfo) { bool flag = self.shield > 0f; bool lostOutOfDanger = Object.op_Implicit((Object)(object)self.body) && self.body.outOfDanger; orig.Invoke(self, damageInfo); if (NetworkServer.active && damageInfo.damage > 0f && !damageInfo.rejected && Object.op_Implicit((Object)(object)self.body) && Object.op_Implicit((Object)(object)self.body.inventory)) { bool lostShield = flag && self.shield <= 0f; OnDamageTakenInventoryActions?.Invoke(damageInfo, self, self.body, self.body.inventory, lostShield, lostOutOfDanger); } } } } namespace ClassicItemsReturns.ReadmeGenerator { internal class ReadmeGeneratorMain { public static void Init() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown MainMenuController.Start += new hook_Start(MainMenuController_Start); } private static void MainMenuController_Start(orig_Start orig, MainMenuController self) { orig.Invoke(self); FormatItemCatalog("CLASSICITEMSRETURNS"); FormatEquipmentCatalog("CLASSICITEMSRETURNS"); } public static string ReplaceStyleTagsWithBackticks(string input) { string pattern = "]+>(.*?)<\\/style>"; string replacement = "`$1`"; return Regex.Replace(input, pattern, replacement); } public static void FormatItemCatalog(string nametokenfilter) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Expected I4, but got Unknown List list = new List(); List list2 = new List(); List list3 = new List(); List list4 = new List(); Enumerator enumerator = ItemCatalog.allItemDefs.GetEnumerator(); try { while (enumerator.MoveNext()) { ItemDef current = enumerator.Current; if (Object.op_Implicit((Object)(object)current) && current.nameToken.Contains(nametokenfilter)) { ItemTier tier = current.tier; ItemTier val = tier; switch ((int)val) { case 0: list.Add(current); break; case 1: list2.Add(current); break; case 2: list3.Add(current); break; case 3: list4.Add(current); break; } } } } finally { ((IDisposable)enumerator).Dispose(); } Debug.Log((object)FormatItemSection(list.ToArray(), "Common")); Debug.Log((object)FormatItemSection(list2.ToArray(), "Uncommon")); Debug.Log((object)FormatItemSection(list3.ToArray(), "Legendary")); Debug.Log((object)FormatItemSection(list4.ToArray(), "Lunar")); } public static string FormatItemRow(ItemDef itemDef, ref StringBuilder stringBuilder) { if (!Object.op_Implicit((Object)(object)itemDef)) { return null; } string format = "| ![](https://raw.githubusercontent.com/DestroyedClone/RiskyClassicItems/master/RiskyClassicItemsUnityProject/Assets/Sprites/Icons/{0}.png) | {1} | {2}"; return string.Format(format, ((Object)itemDef.pickupIconSprite.texture).name, Language.GetString(itemDef.nameToken), ReplaceStyleTagsWithBackticks(Language.GetString(itemDef.descriptionToken))); } public static string FormatItemSection(ItemDef[] itemDefs, string columnName = null) { StringBuilder stringBuilder = StringBuilderPool.RentStringBuilder(); stringBuilder.AppendLine("\n| Icon | Item | Desc |"); stringBuilder.AppendLine("|:--:|:--:|--|"); if (columnName != null) { stringBuilder.AppendLine("| " + columnName + " | | |"); } foreach (ItemDef itemDef in itemDefs) { stringBuilder.AppendLine(FormatItemRow(itemDef, ref stringBuilder)); } string result = stringBuilder.ToString(); StringBuilderPool.ReturnStringBuilder(stringBuilder); return result; } public static void FormatEquipmentCatalog(string nametokenfilter) { List list = new List(); List list2 = new List(); EquipmentDef[] equipmentDefs = EquipmentCatalog.equipmentDefs; foreach (EquipmentDef val in equipmentDefs) { if (Object.op_Implicit((Object)(object)val) && val.nameToken.Contains(nametokenfilter)) { if (val.isLunar) { list2.Add(val); } else { list.Add(val); } } } Debug.Log((object)FormatEquipmentSection(list.ToArray(), "Equipment")); Debug.Log((object)FormatEquipmentSection(list2.ToArray(), "Lunar Equipment")); } public static string FormatEquipmentRow(EquipmentDef itemDef, ref StringBuilder stringBuilder) { if (!Object.op_Implicit((Object)(object)itemDef)) { return null; } string format = "| ![](https://raw.githubusercontent.com/DestroyedClone/RiskyClassicItems/master/RiskyClassicItemsUnityProject/Assets/Sprites/Icons/{0}.png) | {1} | {2}"; return string.Format(format, ((Object)itemDef.pickupIconSprite.texture).name, Language.GetString(itemDef.nameToken), ReplaceStyleTagsWithBackticks(Language.GetString(itemDef.descriptionToken))); } public static string FormatEquipmentSection(EquipmentDef[] itemDefs, string columnName = null) { StringBuilder stringBuilder = StringBuilderPool.RentStringBuilder(); stringBuilder.AppendLine("\n| Icon | Item | Desc |"); stringBuilder.AppendLine("|:--:|:--:|--|"); if (columnName != null) { stringBuilder.AppendLine("| " + columnName + " | | |"); } foreach (EquipmentDef itemDef in itemDefs) { stringBuilder.AppendLine(FormatEquipmentRow(itemDef, ref stringBuilder)); } string result = stringBuilder.ToString(); StringBuilderPool.ReturnStringBuilder(stringBuilder); return result; } } } namespace ClassicItemsReturns.Modules { internal class Assets { internal const string unlockableDefPrefix = "ClassicItemsReturns."; internal const string unlockableDefItemPrefix = "ClassicItemsReturns."; internal const string unlockableDefEquipmentPrefix = "ClassicItemsReturns."; internal const string prefabPrefix = "ClassicItemsReturns_"; internal static GameObject NullModel = LoadAddressable("RoR2/Base/Core/NullModel.prefab"); internal static Sprite NullSprite = LoadAddressable("RoR2/Base/Core/texNullIcon.png"); internal static ItemTierDef itemLunarTierDef = LoadAddressable("RoR2/Base/Common/LunarTierDef.asset"); internal static ItemTierDef itemBossTierDef = LoadAddressable("RoR2/Base/Common/BossTierDef.asset"); internal static ItemTierDef itemTier1Def = LoadAddressable("RoR2/Base/Common/Tier1Def.asset"); internal static ItemTierDef itemTier2Def = LoadAddressable("RoR2/Base/Common/Tier2Def.asset"); internal static ItemTierDef itemTier3Def = LoadAddressable("RoR2/Base/Common/Tier3Def.asset"); internal static ItemTierDef itemVoidBossTierDef = LoadAddressable("RoR2/DLC1/Common/VoidBossDef.asset"); internal static ItemTierDef itemVoidTier1Def = LoadAddressable("RoR2/DLC1/Common/VoidTier1Def.asset"); internal static ItemTierDef itemVoidTier2Def = LoadAddressable("RoR2/DLC1/Common/VoidTier2Def.asset"); internal static ItemTierDef itemVoidTier3Def = LoadAddressable("RoR2/DLC1/Common/VoidTier3Def.asset"); public static AssetBundle mainAssetBundle; public const string bundleName = "classicitemsreturnsbundle"; public const string assetBundleFolder = "AssetBundles"; public static string AssetBundlePath => Path.Combine(Path.GetDirectoryName(ClassicItemsReturnsPlugin.PInfo.Location), "AssetBundles", "classicitemsreturnsbundle"); public static ItemTierDef ResolveTierDef(ItemTier itemTier) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Expected I4, but got Unknown //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Invalid comparison between Unknown and I4 switch ((int)itemTier) { default: if ((int)itemTier == 1000) { return null; } return null; case 4: return itemBossTierDef; case 3: return itemLunarTierDef; case 5: return null; case 0: return itemTier1Def; case 1: return itemTier2Def; case 2: return itemTier3Def; case 9: return itemVoidBossTierDef; case 6: return itemVoidTier1Def; case 7: return itemVoidTier2Def; case 8: return itemVoidTier3Def; } } public static T LoadAddressable(string path) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) return Addressables.LoadAssetAsync((object)path).WaitForCompletion(); } public static UnlockableDef CreateUnlockableDef(string name, Sprite icon = null) { UnlockableDef val = ScriptableObject.CreateInstance(); val.achievementIcon = icon; val.cachedName = "ClassicItemsReturns." + name; return val; } public static void Init() { PopulateAssets(); } public static void PopulateAssets() { mainAssetBundle = AssetBundle.LoadFromFile(AssetBundlePath); ShaderSwapper.UpgradeStubbedShaders(mainAssetBundle); } public static Sprite LoadSprite(string path) { try { return mainAssetBundle.LoadAsset(path); } catch { ClassicItemsReturnsPlugin.ModLogger.LogError((object)("Modules.Assets.LoadSprite failed to load path \"" + path + "\", defaulting to Modules.Assets.NullSprite.")); return NullSprite; } } public static GameObject LoadObject(string path) { try { return mainAssetBundle.LoadAsset(path); } catch { ClassicItemsReturnsPlugin.ModLogger.LogError((object)("Modules.Assets.LoadObject failed to load path \"" + path + "\", defaulting to Modules.Assets.NullModel.")); return NullModel; } } internal static NetworkSoundEventDef CreateNetworkSoundEventDef(string eventName) { NetworkSoundEventDef val = ScriptableObject.CreateInstance(); val.akId = AkSoundEngine.GetIDFromString(eventName); val.eventName = eventName; PluginContentPack.networkSoundEventDefs.Add(val); return val; } } internal class Buffs { public static class SnakeEyesBuffs { public static BuffDef Snake1; public static BuffDef Snake2; public static BuffDef Snake3; public static BuffDef Snake4; public static BuffDef Snake5; public static BuffDef Snake6; } [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static Func <>9__14_4; public static Func <>9__14_2; public static Func <>9__14_5; public static Func <>9__14_3; public static Manipulator <>9__14_0; public static Func <>9__14_9; public static Func <>9__14_6; public static Func <>9__14_10; public static Func <>9__14_7; public static Func <>9__14_11; public static Func <>9__14_8; public static Manipulator <>9__14_1; internal void b__14_0(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); if (val.TryGotoNext(new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, typeof(Buffs), "Weak") })) { val.Index += 2; val.Emit(OpCodes.Ldarg_0); val.EmitDelegate>((Func)((bool hasBuff, CharacterBody self) => hasBuff || self.HasBuff(WeakenOnContactBuff))); } else { Debug.LogError((object)"ClassicItemsReturns: Failed to set up Toxin VFX."); } if (val.TryGotoNext(new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, typeof(Buffs), "CrocoRegen") })) { val.Index += 2; val.Emit(OpCodes.Ldarg_0); val.EmitDelegate>((Func)((bool hasBuff, CharacterBody self) => hasBuff || self.HasBuff(BitterRootBuff))); } else { Debug.LogError((object)"ClassicItemsReturns: Failed to set up Bitter Root."); } } internal bool b__14_4(Instruction x) { return ILPatternMatchingExt.MatchLdsfld(x, typeof(Buffs), "Weak"); } internal bool b__14_2(bool hasBuff, CharacterBody self) { return hasBuff || self.HasBuff(WeakenOnContactBuff); } internal bool b__14_5(Instruction x) { return ILPatternMatchingExt.MatchLdsfld(x, typeof(Buffs), "CrocoRegen"); } internal bool b__14_3(bool hasBuff, CharacterBody self) { return hasBuff || self.HasBuff(BitterRootBuff); } internal void b__14_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_004b: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); if (val.TryGotoNext(new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, typeof(Buffs), "Weak") })) { val.Index += 2; val.Emit(OpCodes.Ldarg_0); val.EmitDelegate>((Func)((bool hasBuff, CharacterModel self) => hasBuff || self.body.HasBuff(WeakenOnContactBuff))); } else { Debug.LogError((object)"ClassicItemsReturns: Failed to set up Toxin Overlay."); } if (val.TryGotoNext(new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, typeof(Buffs), "FullCrit") })) { val.Index += 2; val.Emit(OpCodes.Ldarg_0); val.EmitDelegate>((Func)((bool hasBuff, CharacterModel self) => hasBuff || self.body.HasBuff(DrugsBuff))); } else { Debug.LogError((object)"ClassicItemsReturns: Failed to set up Prescriptions Overlay."); } if (val.TryGotoNext(new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, typeof(Buffs), "Immune") })) { val.Index += 2; val.Emit(OpCodes.Ldarg_0); val.EmitDelegate>((Func)((bool hasBuff, CharacterModel self) => hasBuff || self.body.HasBuff(DroneRepairBuff))); } else { Debug.LogError((object)"ClassicItemsReturns: Failed to set up Drone Repair Kit Overlay."); } } internal bool b__14_9(Instruction x) { return ILPatternMatchingExt.MatchLdsfld(x, typeof(Buffs), "Weak"); } internal bool b__14_6(bool hasBuff, CharacterModel self) { return hasBuff || self.body.HasBuff(WeakenOnContactBuff); } internal bool b__14_10(Instruction x) { return ILPatternMatchingExt.MatchLdsfld(x, typeof(Buffs), "FullCrit"); } internal bool b__14_7(bool hasBuff, CharacterModel self) { return hasBuff || self.body.HasBuff(DrugsBuff); } internal bool b__14_11(Instruction x) { return ILPatternMatchingExt.MatchLdsfld(x, typeof(Buffs), "Immune"); } internal bool b__14_8(bool hasBuff, CharacterModel self) { return hasBuff || self.body.HasBuff(DroneRepairBuff); } } public static BuffDef DrugsBuff; public static BuffDef SnowglobeBuff; public static BuffDef BitterRootBuff; public static BuffDef GoldenGunBuff; public static BuffDef PermafrostChilledBuff; public static BuffDef ShacklesBuff; public static BuffDef ThalliumBuff; public static BuffDef WeakenOnContactBuff; public static BuffDef DroneRepairBuff; public static BuffDef RoyalMedallionBuff; public static BuffDef GuardiansHeartReadyBuff; public static BuffDef HitListEnemyMarker; public static BuffDef HitListPlayerBuff; public static void Initialize() { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Expected O, but got Unknown //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Expected O, but got Unknown InitializeBuffDefs(); object obj = <>c.<>9__14_0; 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_004b: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) ILCursor val4 = new ILCursor(il); if (val4.TryGotoNext(new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, typeof(Buffs), "Weak") })) { val4.Index += 2; val4.Emit(OpCodes.Ldarg_0); val4.EmitDelegate>((Func)((bool hasBuff, CharacterBody self) => hasBuff || self.HasBuff(WeakenOnContactBuff))); } else { Debug.LogError((object)"ClassicItemsReturns: Failed to set up Toxin VFX."); } if (val4.TryGotoNext(new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, typeof(Buffs), "CrocoRegen") })) { val4.Index += 2; val4.Emit(OpCodes.Ldarg_0); val4.EmitDelegate>((Func)((bool hasBuff, CharacterBody self) => hasBuff || self.HasBuff(BitterRootBuff))); } else { Debug.LogError((object)"ClassicItemsReturns: Failed to set up Bitter Root."); } }; <>c.<>9__14_0 = val; obj = (object)val; } CharacterBody.UpdateAllTemporaryVisualEffects += (Manipulator)obj; object obj2 = <>c.<>9__14_1; if (obj2 == null) { Manipulator val2 = 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_004b: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Unknown result type (might be due to invalid IL or missing references) ILCursor val3 = new ILCursor(il); if (val3.TryGotoNext(new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, typeof(Buffs), "Weak") })) { val3.Index += 2; val3.Emit(OpCodes.Ldarg_0); val3.EmitDelegate>((Func)((bool hasBuff, CharacterModel self) => hasBuff || self.body.HasBuff(WeakenOnContactBuff))); } else { Debug.LogError((object)"ClassicItemsReturns: Failed to set up Toxin Overlay."); } if (val3.TryGotoNext(new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, typeof(Buffs), "FullCrit") })) { val3.Index += 2; val3.Emit(OpCodes.Ldarg_0); val3.EmitDelegate>((Func)((bool hasBuff, CharacterModel self) => hasBuff || self.body.HasBuff(DrugsBuff))); } else { Debug.LogError((object)"ClassicItemsReturns: Failed to set up Prescriptions Overlay."); } if (val3.TryGotoNext(new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, typeof(Buffs), "Immune") })) { val3.Index += 2; val3.Emit(OpCodes.Ldarg_0); val3.EmitDelegate>((Func)((bool hasBuff, CharacterModel self) => hasBuff || self.body.HasBuff(DroneRepairBuff))); } else { Debug.LogError((object)"ClassicItemsReturns: Failed to set up Drone Repair Kit Overlay."); } }; <>c.<>9__14_1 = val2; obj2 = (object)val2; } CharacterModel.UpdateOverlays += (Manipulator)obj2; } private static void InitializeBuffDefs() { //IL_0006: 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_0062: 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_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_019a: Unknown result type (might be due to invalid IL or missing references) //IL_01a6: Unknown result type (might be due to invalid IL or missing references) //IL_01ab: Unknown result type (might be due to invalid IL or missing references) //IL_01d4: Unknown result type (might be due to invalid IL or missing references) //IL_01d9: Unknown result type (might be due to invalid IL or missing references) //IL_020b: Unknown result type (might be due to invalid IL or missing references) //IL_0210: Unknown result type (might be due to invalid IL or missing references) //IL_0242: Unknown result type (might be due to invalid IL or missing references) //IL_0247: Unknown result type (might be due to invalid IL or missing references) //IL_0279: Unknown result type (might be due to invalid IL or missing references) //IL_027e: Unknown result type (might be due to invalid IL or missing references) //IL_02b0: Unknown result type (might be due to invalid IL or missing references) //IL_02b5: Unknown result type (might be due to invalid IL or missing references) //IL_02e7: Unknown result type (might be due to invalid IL or missing references) //IL_02ec: Unknown result type (might be due to invalid IL or missing references) //IL_0321: Unknown result type (might be due to invalid IL or missing references) //IL_0326: Unknown result type (might be due to invalid IL or missing references) //IL_035b: Unknown result type (might be due to invalid IL or missing references) //IL_0360: Unknown result type (might be due to invalid IL or missing references) //IL_0395: Unknown result type (might be due to invalid IL or missing references) //IL_039a: Unknown result type (might be due to invalid IL or missing references) //IL_03a6: Unknown result type (might be due to invalid IL or missing references) //IL_03ab: Unknown result type (might be due to invalid IL or missing references) GuardiansHeartReadyBuff = CreateBuffInternal("CIR_GuardiansHeartReady", Color.white, canStack: false, null, Assets.LoadSprite("texBuffGuardiansHeart"), isCooldown: false, isDebuff: false, isHidden: false, null); DrugsBuff = CreateBuffInternal("CIR_Prescriptions", Color.white, canStack: false, null, Assets.LoadSprite("texBuffPills"), isCooldown: false, isDebuff: false, isHidden: false, null); BitterRootBuff = CreateBuffInternal("CIR_BitterRoot", new Color(0.784f, 0.937f, 0.427f, 1f), canStack: true, null, Assets.LoadSprite("texBuffGinseng"), isCooldown: false, isDebuff: false, isHidden: false, null); GoldenGunBuff = CreateBuffInternal("CIR_GoldenGun", Color32.op_Implicit(new Color32((byte)219, (byte)211, (byte)77, byte.MaxValue)), canStack: true, null, Assets.LoadSprite("texBuffGoldGun_nomoney"), isCooldown: false, isDebuff: false, isHidden: false, null); PermafrostChilledBuff = CreateBuffInternal("CIR_Chilled", Color.cyan, canStack: false, null, Assets.LoadSprite("texPermafrostBuffIcon"), isCooldown: false, isDebuff: true, isHidden: false, null); ShacklesBuff = CreateBuffInternal("CIR_PrisonShackles", new Color(0.918f, 0.408f, 0.42f, 1f), canStack: false, null, Assets.LoadSprite("texBuffShackles"), isCooldown: false, isDebuff: true, isHidden: false, null); ThalliumBuff = CreateBuffInternal("CIR_ThalliumBuff", rgb(123, 74, 149), canStack: false, null, Assets.LoadSprite("texBuffThallium"), isCooldown: false, isDebuff: true, isHidden: false, null); WeakenOnContactBuff = CreateBuffInternal("CIR_WeakenOnContact", new Color(0.784f, 0.937f, 0.427f, 1f), canStack: false, null, Assets.LoadSprite("texBuffToxin"), isCooldown: false, isDebuff: true, isHidden: false, null); DroneRepairBuff = CreateBuffInternal("CIR_DroneRepairBuff", new Color(0.784f, 0.937f, 0.427f, 1f), canStack: false, null, Addressables.LoadAssetAsync((object)"RoR2/Base/ShockNearby/texBuffTeslaIcon.tif").WaitForCompletion(), isCooldown: false, isDebuff: true, isHidden: false, null); SnakeEyesBuffs.Snake1 = CreateBuffInternal("CIR_Snake1", Color32.op_Implicit(new Color32((byte)214, (byte)58, (byte)58, byte.MaxValue)), canStack: false, null, Assets.LoadSprite("texBuffSnake1"), isCooldown: false, isDebuff: false, isHidden: false, null); SnakeEyesBuffs.Snake2 = CreateBuffInternal("CIR_Snake2", Color32.op_Implicit(new Color32((byte)214, (byte)58, (byte)58, byte.MaxValue)), canStack: false, null, Assets.LoadSprite("texBuffSnake2"), isCooldown: false, isDebuff: false, isHidden: false, null); SnakeEyesBuffs.Snake3 = CreateBuffInternal("CIR_Snake3", Color32.op_Implicit(new Color32((byte)214, (byte)58, (byte)58, byte.MaxValue)), canStack: false, null, Assets.LoadSprite("texBuffSnake3"), isCooldown: false, isDebuff: false, isHidden: false, null); SnakeEyesBuffs.Snake4 = CreateBuffInternal("CIR_Snake4", Color32.op_Implicit(new Color32((byte)214, (byte)58, (byte)58, byte.MaxValue)), canStack: false, null, Assets.LoadSprite("texBuffSnake4"), isCooldown: false, isDebuff: false, isHidden: false, null); SnakeEyesBuffs.Snake5 = CreateBuffInternal("CIR_Snake5", Color32.op_Implicit(new Color32((byte)214, (byte)58, (byte)58, byte.MaxValue)), canStack: false, null, Assets.LoadSprite("texBuffSnake5"), isCooldown: false, isDebuff: false, isHidden: false, null); SnakeEyesBuffs.Snake6 = CreateBuffInternal("CIR_Snake6", Color32.op_Implicit(new Color32((byte)214, (byte)58, (byte)58, byte.MaxValue)), canStack: false, null, Assets.LoadSprite("texBuffSnake6"), isCooldown: false, isDebuff: false, isHidden: false, null); HitListEnemyMarker = CreateBuffInternal("CIR_HitListEnemyMarker", Color32.op_Implicit(new Color32(byte.MaxValue, (byte)232, (byte)68, byte.MaxValue)), canStack: false, null, Assets.LoadSprite("texBuffHitListMark"), isCooldown: false, isDebuff: false, isHidden: false, null); HitListPlayerBuff = CreateBuffInternal("CIR_HitListPlayerBuff", Color32.op_Implicit(new Color32(byte.MaxValue, (byte)232, (byte)68, byte.MaxValue)), canStack: true, null, Assets.LoadSprite("texBuffHitListMark"), isCooldown: false, isDebuff: false, isHidden: false, null); RoyalMedallionBuff = CreateBuffInternal("CIR_RoyalMedallionBuff", Color32.op_Implicit(new Color32(byte.MaxValue, (byte)232, (byte)68, byte.MaxValue)), canStack: true, null, Addressables.LoadAssetAsync((object)"RoR2/Base/WarCryOnMultiKill/texWarcryBuffIcon.tif").WaitForCompletion(), isCooldown: false, isDebuff: false, isHidden: false, null); } public static BuffDef CreateBuffInternal(string name, Color buffColor, bool canStack, EliteDef eliteDef, Sprite iconSprite, bool isCooldown, bool isDebuff, bool isHidden, NetworkSoundEventDef startSfx) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) BuffDef val = ScriptableObject.CreateInstance(); val.buffColor = buffColor; val.canStack = canStack; val.eliteDef = eliteDef; val.iconSprite = iconSprite; val.isCooldown = isCooldown; val.isDebuff = isDebuff; val.isHidden = isHidden; val.startSfx = startSfx; ((Object)val).name = name; PluginContentPack.buffDefs.Add(val); return val; } public static BuffDef CreateEliteBuffDef(string name, Color buffcolor, EliteDef eliteDef, Sprite iconSprite, NetworkSoundEventDef startSfx) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) return CreateBuffInternal(name, buffcolor, canStack: false, eliteDef, iconSprite, isCooldown: false, isDebuff: false, isHidden: false, startSfx); } public static Color rgb(byte r, byte g, byte b, byte a = byte.MaxValue) { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) return new Color((float)(int)r / 255f, (float)(int)g / 255f, (float)(int)b / 255f, (float)(int)a / 255f); } } internal class Deployables { public static void Initialize() { } } internal class DLCSupport { internal class DLC1 { public static ExpansionDef sotvExpansionDef; public static Dictionary voidConversions = new Dictionary(); public static void Initialize() { } public static ExpansionDef GetSOTVExpansionDef() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)sotvExpansionDef)) { sotvExpansionDef = ((IEnumerable)(object)ExpansionCatalog.expansionDefs).FirstOrDefault((Func)((ExpansionDef def) => def.nameToken == "DLC1_NAME")); } return sotvExpansionDef; } } internal static void Initialize() { DLC1.Initialize(); } } internal class Dots { public class DotVisualTracker : MonoBehaviour { public BurnEffectController thalliumEffect; } public static class Thallium { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static CustomDotVisual <>9__5_1; internal void b__5_1(DotController target) { //IL_0032: Unknown result type (might be due to invalid IL or missing references) ModelLocator component = target.victimObject.GetComponent(); DotVisualTracker component2 = ((Component)target).GetComponent(); if (!Object.op_Implicit((Object)(object)component) || !Object.op_Implicit((Object)(object)component2)) { return; } if (target.HasDotActive(CIR_ThalliumDotIndex)) { if (!Object.op_Implicit((Object)(object)component2.thalliumEffect) && Object.op_Implicit((Object)(object)component.modelTransform)) { component2.thalliumEffect = ((Component)target).gameObject.AddComponent(); component2.thalliumEffect.target = ((Component)component.modelTransform).gameObject; } } else if (Object.op_Implicit((Object)(object)component2.thalliumEffect)) { Object.Destroy((Object)(object)component2.thalliumEffect); component2.thalliumEffect = null; } } } internal static DotIndex CIR_ThalliumDotIndex; internal static DotDef CIR_ThalliumDotDef; internal static CustomDotBehaviour CIR_ThalliumDotBehavior; internal static CustomDotVisual CIR_ThalliumDotVisual; internal static EffectParams CIR_ThalliumEffectParams; public static void Initialize() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Expected O, but got Unknown //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Expected O, but got Unknown //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Expected O, but got Unknown //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Expected O, but got Unknown ClassicItemsReturns.Items.Rare.Thallium thallium = ItemBase.Instance; CIR_ThalliumEffectParams = new EffectParams(); CIR_ThalliumDotDef = new DotDef { associatedBuff = Buffs.ThalliumBuff, damageCoefficient = 0.333f, damageColorIndex = (DamageColorIndex)9, interval = thallium.dotInterval, resetTimerOnAdd = true }; CIR_ThalliumDotBehavior = (CustomDotBehaviour)delegate(DotController dotController, DotStack dotStack) { float num = 0f; float damage = dotController.victimBody.damage; float num2 = 1f; CharacterBody val2 = null; if (Object.op_Implicit((Object)(object)dotStack.attackerObject) && dotStack.attackerObject.TryGetComponent(ref val2)) { num2 = val2.damage; } num = Mathf.Max(num2, damage); num *= thallium.enemyAttackDamageCoef; int num3 = 1; if (Object.op_Implicit((Object)(object)val2)) { num3 = thallium.GetCount(val2); } dotStack.damage = num; }; object obj = <>c.<>9__5_1; if (obj == null) { CustomDotVisual val = delegate(DotController target) { //IL_0032: Unknown result type (might be due to invalid IL or missing references) ModelLocator component = target.victimObject.GetComponent(); DotVisualTracker component2 = ((Component)target).GetComponent(); if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component2)) { if (target.HasDotActive(CIR_ThalliumDotIndex)) { if (!Object.op_Implicit((Object)(object)component2.thalliumEffect) && Object.op_Implicit((Object)(object)component.modelTransform)) { component2.thalliumEffect = ((Component)target).gameObject.AddComponent(); component2.thalliumEffect.target = ((Component)component.modelTransform).gameObject; } } else if (Object.op_Implicit((Object)(object)component2.thalliumEffect)) { Object.Destroy((Object)(object)component2.thalliumEffect); component2.thalliumEffect = null; } } }; <>c.<>9__5_1 = val; obj = (object)val; } CIR_ThalliumDotVisual = (CustomDotVisual)obj; CIR_ThalliumDotIndex = DotAPI.RegisterDotDef(CIR_ThalliumDotDef, CIR_ThalliumDotBehavior, (CustomDotVisual)null); HealthComponent.TakeDamageProcess += new hook_TakeDamageProcess(HealthComponent_TakeDamage); } private static void HealthComponent_TakeDamage(orig_TakeDamageProcess orig, HealthComponent self, DamageInfo damageInfo) { //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_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self, damageInfo); if (NetworkServer.active && damageInfo.dotIndex == CIR_ThalliumDotIndex) { EffectManager.SimpleEffect(ClassicItemsReturns.Items.Rare.Thallium.thalliumTickEffect, damageInfo.position, Quaternion.identity, true); } } } internal static void Initialize() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown Thallium.Initialize(); DotController.Awake += new hook_Awake(DotController_Awake); } private static void DotController_Awake(orig_Awake orig, DotController self) { orig.Invoke(self); if (!Object.op_Implicit((Object)(object)((Component)self).GetComponent())) { ((Component)self).gameObject.AddComponent(); } } } internal class LanguageOverrides { public struct ReplacementToken { public string assignedToken; public string formatToken; public object[] args; } public const string LanguageTokenPrefix = "CLASSICITEMSRETURNS_"; public const string LanguageTokenPrefixArtifact = "CLASSICITEMSRETURNS_ARTIFACT_"; public const string LanguageTokenPrefixItem = "CLASSICITEMSRETURNS_ITEM_"; public const string LanguageTokenPrefixEquipment = "CLASSICITEMSRETURNS_EQUIPMENT_"; public const string LanguageTokenPrefixEliteEquipment = "CLASSICITEMSRETURNS_ELITE_EQUIPMENT_"; public const string LanguageTokenPrefixElite = "CLASSICITEMSRETURNS_ELITE_"; public const string LanguageTokenPrefixBuffs = "CLASSICITEMSRETURNS_BUFF_"; public static List replacementTokens = new List(); public static List postReplacementTokens = new List(); public static List configEntries = new List(); public static Dictionary logbookTokenOverrideDict = new Dictionary(); public static void DeferToken(string token, params object[] args) { replacementTokens.Add(new ReplacementToken { assignedToken = token, formatToken = token, args = args }); } public static void DeferLateTokens(string token, params object[] args) { postReplacementTokens.Add(new ReplacementToken { assignedToken = token, formatToken = token, args = args }); } public static void DeferUniqueToken(string assignedToken, string formatToken, params object[] args) { replacementTokens.Add(new ReplacementToken { assignedToken = assignedToken, formatToken = formatToken, args = args }); } public static void DeferLateUniqueTokens(string assignedToken, string formatToken, params object[] args) { postReplacementTokens.Add(new ReplacementToken { assignedToken = assignedToken, formatToken = formatToken, args = args }); } public static void Initialize() { Language.collectLanguageRootFolders += CollectLanguageRootFolders; Language.onCurrentLanguageChanged += Language_onCurrentLanguageChanged; } private static void Language_onCurrentLanguageChanged() { Language currentLanguage = Language.currentLanguage; foreach (ReplacementToken replacementToken in replacementTokens) { string localizedFormattedStringByToken = currentLanguage.GetLocalizedFormattedStringByToken(replacementToken.formatToken, replacementToken.args); currentLanguage.SetStringByToken(replacementToken.assignedToken, localizedFormattedStringByToken); } foreach (ReplacementToken postReplacementToken in postReplacementTokens) { List list = new List(); object[] args = postReplacementToken.args; foreach (object obj in args) { list.Add(currentLanguage.GetLocalizedStringByToken(obj.ToString())); string text = postReplacementToken.formatToken; if (postReplacementToken.assignedToken == null || postReplacementToken.assignedToken != postReplacementToken.formatToken) { text = postReplacementToken.assignedToken; } string formatToken = postReplacementToken.formatToken; object[] array = list.ToArray(); string localizedFormattedStringByToken2 = currentLanguage.GetLocalizedFormattedStringByToken(formatToken, array); currentLanguage.SetStringByToken(text, localizedFormattedStringByToken2); } } } private static void CollectLanguageRootFolders(List folders) { folders.Add(Path.Combine(Path.GetDirectoryName(ClassicItemsReturnsPlugin.PInfo.Location), "Language")); } } internal class ModSupport { internal class LinearDamage { internal const string guid = "com.RiskyLives.LinearDamage"; internal static bool loaded; } internal class ModCompatRiskOfOptions { internal const string guid = "com.rune580.riskofoptions"; internal static bool loaded; [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] internal static void Init() { loaded = true; ModSettingsManager.SetModDescription("Adds items and equipment from Risk of Rain and Risk of Rain Returns.", "com.RiskySleeps.ClassicItemsReturns", "Classic Items Returns"); } } internal class ModCompatRiskyMod { internal const string guid = "com.RiskyLives.RiskyMod"; internal static bool loaded; [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] internal static void Init() { loaded = true; } internal static bool IsAtgEnabled() { if (!loaded) { return false; } return IsAtgEnabledInternal(); } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] private static bool IsAtgEnabledInternal() { return ItemsCore.enabled && AtG.enabled; } } internal class ModCompatAssistManager { internal const string guid = "com.Moffein.AssistManager"; internal static bool loaded; [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] internal static void Init() { loaded = true; } } internal static void CheckForModSupport() { if (Chainloader.PluginInfos.ContainsKey("com.RiskyLives.RiskyMod")) { ModCompatRiskyMod.Init(); } if (Chainloader.PluginInfos.ContainsKey("com.Moffein.AssistManager")) { ModCompatAssistManager.Init(); } LinearDamage.loaded = Chainloader.PluginInfos.ContainsKey("com.RiskyLives.LinearDamage"); } } internal class Orbs { public class CIR_LostDollOrb : DevilOrb { public CharacterBody attackerCharacterBody; public static GameObject effectPrefab = LegacyResourcesAPI.Load("Prefabs/Effects/OrbEffects/HauntOrbEffect"); public static NetworkSoundEventDef arrivalSound; public override void Begin() { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Expected O, but got Unknown //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Expected O, but got Unknown ((Orb)this).duration = ((Orb)this).distanceToTarget / 60f; attackerCharacterBody.healthComponent.TakeDamage(new DamageInfo { attacker = null, crit = false, damage = attackerCharacterBody.healthComponent.combinedHealth * 0.25f, damageColorIndex = (DamageColorIndex)0, damageType = DamageTypeCombo.op_Implicit((DamageType)1), inflictor = null, position = attackerCharacterBody.corePosition, procCoefficient = 0f, procChainMask = default(ProcChainMask), force = Vector3.zero }); EffectData val = new EffectData { scale = base.scale, origin = ((Orb)this).origin, genericFloat = ((Orb)this).duration }; val.SetHurtBoxReference(((Orb)this).target); EffectManager.SpawnEffect(effectPrefab, val, true); } public override void OnArrival() { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Expected O, but got Unknown //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)((Orb)this).target)) { return; } HealthComponent healthComponent = ((Orb)this).target.healthComponent; if (Object.op_Implicit((Object)(object)healthComponent)) { DamageInfo val = new DamageInfo(); val.damage = base.damageValue; val.attacker = base.attacker; val.inflictor = base.attacker; val.force = Vector3.zero; val.crit = base.isCrit; val.procChainMask = base.procChainMask; val.procCoefficient = base.procCoefficient; val.position = ((Component)((Orb)this).target).transform.position; val.damageColorIndex = base.damageColorIndex; val.damageType = DamageTypeCombo.op_Implicit((DamageSource)64); healthComponent.TakeDamage(val); GlobalEventManager.instance.OnHitEnemy(val, ((Component)healthComponent).gameObject); GlobalEventManager.instance.OnHitAll(val, ((Component)healthComponent).gameObject); if (Object.op_Implicit((Object)(object)arrivalSound)) { EffectManager.SimpleSoundEffect(arrivalSound.index, ((Component)((Orb)this).target).transform.position, true); } } } } public static void Initialize() { OrbAPI.AddOrb(typeof(CIR_LostDollOrb)); CIR_LostDollOrb.arrivalSound = ScriptableObject.CreateInstance(); CIR_LostDollOrb.arrivalSound.eventName = "Play_item_proc_deathMark"; PluginContentPack.networkSoundEventDefs.Add(CIR_LostDollOrb.arrivalSound); } } public class PluginContentPack : IContentPackProvider { [CompilerGenerated] private sealed class d__18 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public FinalizeAsyncArgs args; public PluginContentPack <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__18(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; 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 d__17 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public GetContentPackAsyncArgs args; public PluginContentPack <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__17(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; 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 d__16 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public LoadStaticContentAsyncArgs args; public PluginContentPack <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__16(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; <>4__this.contentPack.identifier = <>4__this.identifier; <>4__this.contentPack.networkSoundEventDefs.Add(networkSoundEventDefs.ToArray()); <>4__this.contentPack.effectDefs.Add(effectDefs.ToArray()); <>4__this.contentPack.itemDefs.Add(itemDefs.ToArray()); <>4__this.contentPack.craftableDefs.Add(craftableDefs.ToArray()); <>4__this.contentPack.equipmentDefs.Add(equipmentDefs.ToArray()); <>4__this.contentPack.projectilePrefabs.Add(projectilePrefabs.ToArray()); <>4__this.contentPack.artifactDefs.Add(artifactDefs.ToArray()); <>4__this.contentPack.bodyPrefabs.Add(bodyPrefabs.ToArray()); <>4__this.contentPack.masterPrefabs.Add(masterPrefabs.ToArray()); <>4__this.contentPack.buffDefs.Add(buffDefs.ToArray()); <>4__this.contentPack.unlockableDefs.Add(unlockableDefs.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 networkSoundEventDefs = new List(); public static List itemDefs = new List(); public static List buffDefs = new List(); public static List equipmentDefs = new List(); public static List craftableDefs = new List(); public static List artifactDefs = new List(); public static List effectDefs = new List(); public static List projectilePrefabs = new List(); public static List bodyPrefabs = new List(); public static List masterPrefabs = new List(); public static List unlockableDefs = new List(); public string identifier => "com.RiskySleeps.ClassicItemsReturns"; public void Initialize() { //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(ContentManager_collectContentPackProviders); } private void ContentManager_collectContentPackProviders(AddContentPackProviderDelegate addContentPackProvider) { addContentPackProvider.Invoke((IContentPackProvider)(object)this); } [IteratorStateMachine(typeof(d__16))] public IEnumerator LoadStaticContentAsync(LoadStaticContentAsyncArgs args) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__16(0) { <>4__this = this, args = args }; } [IteratorStateMachine(typeof(d__17))] public IEnumerator GenerateContentPackAsync(GetContentPackAsyncArgs args) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__17(0) { <>4__this = this, args = args }; } [IteratorStateMachine(typeof(d__18))] public IEnumerator FinalizeAsync(FinalizeAsyncArgs args) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__18(0) { <>4__this = this, args = args }; } } internal static class SoundBanks { private static bool initialized; public static string SoundBankDirectory => Path.Combine(Path.GetDirectoryName(ClassicItemsReturnsPlugin.PInfo.Location), "SoundBanks"); public static void Init() { if (initialized) { return; } initialized = true; using Stream stream = new FileStream(SoundBankDirectory + "\\ClassicItemsReturnsSoundbank.bnk", FileMode.Open); byte[] array = new byte[stream.Length]; stream.Read(array, 0, array.Length); SoundBanks.Add(array); } } } namespace ClassicItemsReturns.Items { public abstract class ItemBase : ItemBase where T : ItemBase { public static T Instance { get; private set; } public ItemBase() { if (Instance != null) { throw new InvalidOperationException("Singleton class \"" + typeof(T).Name + "\" inheriting ItemBase was instantiated twice"); } Instance = this as T; } } public abstract class ItemBase { public ItemDef ItemDef; public abstract string ItemName { get; } public abstract string ItemLangTokenName { get; } public string ItemPickupToken => "CLASSICITEMSRETURNS_ITEM_" + ItemLangTokenName + "_PICKUP"; public virtual object[] ItemPickupDescParams { get; } public string ItemDescriptionToken => "CLASSICITEMSRETURNS_ITEM_" + ItemLangTokenName + "_DESCRIPTION"; public virtual object[] ItemFullDescriptionParams { get; } public virtual string ItemLoreToken => "CLASSICITEMSRETURNS_ITEM_" + ItemLangTokenName + "_LORE"; public virtual object[] ItemLoreParams { get; } public virtual bool ItemDescriptionLogbookOverride { get; } = false; public virtual string ItemDescriptionLogbookToken => "CLASSICITEMSRETURNS_ITEM_" + ItemLangTokenName + "_LOGBOOK_DESCRIPTION"; public virtual string[] ItemLogbookDescriptionParams { get; } public abstract ItemTier Tier { get; } public virtual ItemTag[] ItemTags { get; set; } = (ItemTag[])(object)new ItemTag[0]; public abstract GameObject ItemModel { get; } public abstract Sprite ItemIcon { get; } public virtual ItemDef ContagiousOwnerItemDef { get; } = null; public virtual bool CanRemove { get; } = true; public virtual bool AIBlacklisted { get; set; } = false; public virtual string ParentEquipmentName { get; } = null; public virtual string ParentItemName { get; } = null; public virtual bool Hidden { get; } = false; public virtual bool Unfinished { get; } = false; public string ConfigCategory => "Item: " + ItemName; public virtual void Init(ConfigFile config) { CreateLang(); CreateConfig(config); CreateAssets(config); CreateItem(); if (Object.op_Implicit((Object)(object)ItemDef)) { ClassicItemsReturnsPlugin.onFinishScanning = (Action)Delegate.Combine(ClassicItemsReturnsPlugin.onFinishScanning, new Action(CreateCraftableDef)); } Hooks(); } public virtual void CreateAssets(ConfigFile config) { } public virtual void CreateConfig(ConfigFile config) { } protected virtual void CreateCraftableDef() { } protected virtual void CreateLang() { object[] itemPickupDescParams = ItemPickupDescParams; bool flag = itemPickupDescParams != null && itemPickupDescParams.Length != 0; object[] itemFullDescriptionParams = ItemFullDescriptionParams; bool flag2 = itemFullDescriptionParams != null && itemFullDescriptionParams.Length != 0; string[] itemLogbookDescriptionParams = ItemLogbookDescriptionParams; bool flag3 = itemLogbookDescriptionParams != null && itemLogbookDescriptionParams.Length != 0; object[] itemLoreParams = ItemLoreParams; bool flag4 = itemLoreParams != null && itemLoreParams.Length != 0; if (flag2 || flag || flag3 || flag4) { if (flag) { LanguageOverrides.DeferToken(ItemPickupToken, ItemPickupDescParams); } if (flag2) { LanguageOverrides.DeferToken(ItemDescriptionToken, ItemFullDescriptionParams); } if (flag3) { string itemDescriptionLogbookToken = ItemDescriptionLogbookToken; object[] itemLogbookDescriptionParams2 = ItemLogbookDescriptionParams; LanguageOverrides.DeferToken(itemDescriptionLogbookToken, itemLogbookDescriptionParams2); } if (flag4) { LanguageOverrides.DeferToken(ItemLoreToken, ItemLoreParams); } if (ItemDescriptionLogbookOverride || flag3) { LanguageOverrides.logbookTokenOverrideDict.Add(ItemDescriptionToken, ItemDescriptionLogbookToken); } } } public abstract ItemDisplayRuleDict CreateItemDisplayRules(); protected void CreateItem() { //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Invalid comparison between Unknown and I4 //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Invalid comparison between Unknown and I4 //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Invalid comparison between Unknown and I4 //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Invalid comparison between Unknown and I4 //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_01f6: Unknown result type (might be due to invalid IL or missing references) //IL_0200: Expected O, but got Unknown string text = "CLASSICITEMSRETURNS_ITEM_"; ItemDef = ScriptableObject.CreateInstance(); ((Object)ItemDef).name = text + ItemLangTokenName; ItemDef.nameToken = text + ItemLangTokenName + "_NAME"; ItemDef.pickupToken = ItemPickupToken; ItemDef.descriptionToken = ItemDescriptionToken; ItemDef.loreToken = ItemLoreToken; ItemDef.pickupModelPrefab = ItemModel; ItemDef.pickupIconSprite = ItemIcon; ItemDef.hidden = Hidden; ItemDef.canRemove = CanRemove; ItemDef.deprecatedTier = Tier; if ((int)Tier == 6 || (int)Tier == 7 || (int)Tier == 8 || (int)Tier == 9) { ItemDef.requiredExpansion = DLCSupport.DLC1.GetSOTVExpansionDef(); if (Object.op_Implicit((Object)(object)ContagiousOwnerItemDef)) { DLCSupport.DLC1.voidConversions.Add(ContagiousOwnerItemDef, ItemDef); } } if (ItemTags.Length != 0) { ItemDef.tags = ItemTags; } if (AIBlacklisted && ItemDef.DoesNotContainTag((ItemTag)4)) { ref ItemTag[] tags = ref ItemDef.tags; ItemTag val = (ItemTag)4; ArrayUtils.ArrayAppend(ref tags, ref val); } else if (!AIBlacklisted && ItemDef.ContainsTag((ItemTag)4)) { ItemDef.tags = ItemDef.tags.Where((ItemTag tag) => (int)tag != 4).ToArray(); } ItemAPI.Add(new CustomItem(ItemDef, CreateItemDisplayRules())); } public virtual void Hooks() { } public int GetCount(CharacterBody body) { if (!Object.op_Implicit((Object)(object)body) || !Object.op_Implicit((Object)(object)body.inventory)) { return 0; } return body.inventory.GetItemCountEffective(ItemDef); } public bool TryGetCount(CharacterBody body, out int count) { count = 0; if (!Object.op_Implicit((Object)(object)body) || !Object.op_Implicit((Object)(object)body.inventory)) { return false; } count = body.inventory.GetItemCountEffective(ItemDef); return count > 0; } public int GetCount(CharacterMaster master) { if (!Object.op_Implicit((Object)(object)master) || !Object.op_Implicit((Object)(object)master.inventory)) { return 0; } return master.inventory.GetItemCountEffective(ItemDef); } public bool TryGetCount(CharacterMaster master, out int count) { count = 0; if (!Object.op_Implicit((Object)(object)master) || !Object.op_Implicit((Object)(object)master.inventory)) { return false; } count = master.inventory.GetItemCountEffective(ItemDef); return count > 0; } public int GetCountSpecific(CharacterBody body, ItemDef itemDef) { if (!Object.op_Implicit((Object)(object)body) || !Object.op_Implicit((Object)(object)body.inventory)) { return 0; } return body.inventory.GetItemCountEffective(itemDef); } public bool TryGetCountSpecific(CharacterBody body, ItemDef itemDef, out int count) { count = 0; if (!Object.op_Implicit((Object)(object)body) || !Object.op_Implicit((Object)(object)body.inventory)) { return false; } count = body.inventory.GetItemCountEffective(itemDef); return true; } public Sprite LoadSprite(string spriteName) { return Assets.LoadSprite(spriteName); } public GameObject LoadModel(string modelName) { return Assets.LoadObject(modelName); } public Sprite LoadItemSprite(string spriteName) { return ItemHelpers.LoadItemSprite(spriteName); } public GameObject LoadItemModel(string modelName) { //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) GameObject val = Assets.LoadObject("mdl3d" + modelName); if (Object.op_Implicit((Object)(object)val)) { ItemHelpers.SetupMaterials(val); if (!Object.op_Implicit((Object)(object)val.GetComponent())) { ItemDisplay val2 = val.AddComponent(); MeshRenderer[] componentsInChildren = val.GetComponentsInChildren(); List list = new List(); MeshRenderer[] array = componentsInChildren; for (int i = 0; i < array.Length; i++) { Renderer val3 = (Renderer)(object)array[i]; RendererInfo item = default(RendererInfo); item.renderer = val3; item.defaultMaterial = val3.material; item.defaultShadowCastingMode = val3.shadowCastingMode; item.ignoreOverlays = false; item.hideOnDeath = false; list.Add(item); } val2.rendererInfos = list.ToArray(); } } GameObject val4 = Assets.LoadObject("mdl" + modelName); GameObject val5 = Assets.LoadObject("mdlClassic" + modelName); Queue queue = new Queue(); if (ClassicItemsReturnsPlugin.use3dModels) { if (Object.op_Implicit((Object)(object)val)) { return val; } if (Object.op_Implicit((Object)(object)val4)) { return val4; } if (Object.op_Implicit((Object)(object)val5)) { return val5; } } else { if (!ClassicItemsReturnsPlugin.useClassicSprites) { if (Object.op_Implicit((Object)(object)val4)) { return val4; } if (Object.op_Implicit((Object)(object)val5)) { return val5; } } else { if (Object.op_Implicit((Object)(object)val5)) { return val5; } if (Object.op_Implicit((Object)(object)val4)) { return val4; } } if (Object.op_Implicit((Object)(object)val)) { return val; } } Debug.LogError((object)("ClassicItemsReturns: Could not find ANY model for " + modelName)); return null; } } } namespace ClassicItemsReturns.Items.Uncommon { internal class ArmsRace : ItemBase { public class ArmsRaceBehavior : BaseItemBodyBehavior { public MinionOwnership minionOwnership; private const float display2Chance = 0.1f; private int previousStack; private Xoroshiro128Plus rng; private Inventory inventory; private CharacterMaster master; [ItemDefAssociation(useOnClient = false, useOnServer = true)] public static ItemDef GetItemDef() { return ItemBase.Instance.ItemDef; } private void OnEnable() { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown ulong num = Run.instance.seed ^ (ulong)Run.instance.stageClearCount; rng = new Xoroshiro128Plus(num); MasterSummon.onServerMasterSummonGlobal += MasterSummon_onServerMasterSummonGlobal; if (Object.op_Implicit((Object)(object)((BaseItemBodyBehavior)this).body.inventory)) { inventory = ((BaseItemBodyBehavior)this).body.inventory; inventory.onInventoryChanged += Inv_onInventoryChanged; } if (Object.op_Implicit((Object)(object)((BaseItemBodyBehavior)this).body.master)) { master = ((BaseItemBodyBehavior)this).body.master; } minionOwnership = ((Component)((BaseItemBodyBehavior)this).body).GetComponent(); UpdateAllMinions(inventory.GetItemCountEffective(ItemBase.Instance.ItemDef)); } private void Inv_onInventoryChanged() { UpdateAllMinions(inventory.GetItemCountEffective(ItemBase.Instance.ItemDef)); } private void OnDisable() { MasterSummon.onServerMasterSummonGlobal -= MasterSummon_onServerMasterSummonGlobal; if (Object.op_Implicit((Object)(object)inventory)) { inventory.onInventoryChanged -= Inv_onInventoryChanged; } UpdateAllMinions(0); } private void UpdateAllMinions(int newStack) { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) if (!NetworkServer.active || !Object.op_Implicit((Object)(object)master)) { return; } MinionGroup val = MinionGroup.FindGroup(((NetworkBehaviour)master).netId); if (val == null) { return; } MinionOwnership[] members = val.members; foreach (MinionOwnership val2 in members) { if (!Object.op_Implicit((Object)(object)val2)) { continue; } CharacterMaster component = ((Component)val2).GetComponent(); if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component.inventory)) { CharacterBody body = component.GetBody(); if (Object.op_Implicit((Object)(object)body)) { UpdateMinionInventory(component.inventory, body.bodyFlags, newStack); } } } previousStack = newStack; } private void MasterSummon_onServerMasterSummonGlobal(MasterSummonReport summonReport) { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)((BaseItemBodyBehavior)this).body) || !Object.op_Implicit((Object)(object)((BaseItemBodyBehavior)this).body.master) || !((Object)(object)((BaseItemBodyBehavior)this).body.master == (Object)(object)summonReport.leaderMasterInstance)) { return; } CharacterMaster summonMasterInstance = summonReport.summonMasterInstance; if (Object.op_Implicit((Object)(object)summonMasterInstance)) { CharacterBody body = summonMasterInstance.GetBody(); if (Object.op_Implicit((Object)(object)body)) { UpdateMinionInventory(summonMasterInstance.inventory, body.bodyFlags, base.stack); } } } private void UpdateMinionInventory(Inventory inventory, BodyFlags bodyFlags, int newStack) { //IL_0020: Unknown result type (might be due to invalid IL or missing references) if (newStack < 0) { newStack = 0; } if (Object.op_Implicit((Object)(object)inventory) && (!requireMechanical.Value || ((Enum)bodyFlags).HasFlag((Enum)(object)(BodyFlags)2))) { int itemCountPermanent = inventory.GetItemCountPermanent(ArmsRaceDroneItemDef); if (itemCountPermanent < newStack) { inventory.GiveItemPermanent(ArmsRaceDroneItemDef, newStack - itemCountPermanent); } else if (itemCountPermanent > newStack) { inventory.RemoveItemPermanent(ArmsRaceDroneItemDef, itemCountPermanent - newStack); } } } } public float cooldown = 10f; public int missileCount = 4; public int missileCountPerStack = 4; public float damageCoeff = 1f; public static ConfigEntry requireMechanical; public override string ItemName => "Arms Race"; public override string ItemLangTokenName => "ARMSRACE"; public override object[] ItemFullDescriptionParams => new object[4] { cooldown, missileCount, missileCountPerStack, damageCoeff * 100f }; public override ItemTier Tier => (ItemTier)1; public override GameObject ItemModel => LoadItemModel("ArmsRace"); public override Sprite ItemIcon => LoadItemSprite("ArmsRace"); public static ItemDef ArmsRaceDroneItemDef => ItemBase.Instance.ItemDef; public override ItemTag[] ItemTags { get { ItemTag[] array = new ItemTag[4]; RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); return (ItemTag[])(object)array; } } public override ItemDisplayRuleDict CreateItemDisplayRules() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown return new ItemDisplayRuleDict(Array.Empty()); } public override void CreateConfig(ConfigFile config) { requireMechanical = config.Bind(base.ConfigCategory, "Mechanical Allies Only", true, "Arms Race only applies to Drones and other Mechanical allies."); } } public class BearArmor : ItemBase { public float armor = 14f; public float armorPerStack = 14f; public override string ItemName => "Tough Times"; public override string ItemLangTokenName => "TOUGHTIMES"; public override object[] ItemFullDescriptionParams => new object[2] { armor, armorPerStack }; public override ItemTier Tier => (ItemTier)1; public override GameObject ItemModel => LoadItemModel("Bear"); public override Sprite ItemIcon => LoadItemSprite("Bear"); public override ItemTag[] ItemTags => (ItemTag[])(object)new ItemTag[2] { (ItemTag)3, (ItemTag)31 }; public override ItemDisplayRuleDict CreateItemDisplayRules() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown return new ItemDisplayRuleDict(Array.Empty()); } public override void Hooks() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(RecalculateStatsAPI_GetStatCoefficients); } private void RecalculateStatsAPI_GetStatCoefficients(CharacterBody sender, StatHookEventArgs args) { if (TryGetCount(sender, out var count)) { args.armorAdd += ItemHelpers.StackingLinear(count, armor, armorPerStack); } } protected override void CreateCraftableDef() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Expected O, but got Unknown //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Expected O, but got Unknown //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Expected O, but got Unknown //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Expected O, but got Unknown //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Expected O, but got Unknown ItemDef pickup = Addressables.LoadAssetAsync((object)"RoR2/Base/Bear/Bear.asset").WaitForCompletion(); CraftableDef val = ScriptableObject.CreateInstance(); val.pickup = (Object)(object)ItemDef; Recipe[] array = new Recipe[1]; Recipe val2 = new Recipe(); val2.amountToDrop = 1; val2.ingredients = (RecipeIngredient[])(object)new RecipeIngredient[2] { new RecipeIngredient { pickup = (Object)(object)pickup }, new RecipeIngredient { pickup = (Object)(object)pickup } }; array[0] = val2; val.recipes = (Recipe[])(object)array; PluginContentPack.craftableDefs.Add(val); CraftableDef val3 = ScriptableObject.CreateInstance(); val3.pickup = (Object)(object)pickup; Recipe[] array2 = new Recipe[1]; val2 = new Recipe(); val2.amountToDrop = 1; val2.ingredients = (RecipeIngredient[])(object)new RecipeIngredient[2] { new RecipeIngredient { pickup = (Object)(object)ItemDef }, new RecipeIngredient { pickup = (Object)(object)Addressables.LoadAssetAsync((object)"RoR2/Base/Scrap/ScrapWhite.asset").WaitForCompletion() } }; array2[0] = val2; val3.recipes = (Recipe[])(object)array2; PluginContentPack.craftableDefs.Add(val3); } } public class BoxingGloves : ItemBase { public float chance = 6f; public float chanceStack = 6f; public float damageMult = 1f; public float baseForce = 2800f; public float airbornMultiplier = 0.7f; public float championMultiplier = 0.7f; public static GameObject procEffect; public override string ItemName => "Boxing Gloves"; public override string ItemLangTokenName => "BOXINGGLOVES"; public override object[] ItemFullDescriptionParams => new object[3] { chance, chanceStack, damageMult * 100f }; public override ItemTier Tier => (ItemTier)1; public override GameObject ItemModel => LoadItemModel("Boxing"); public override Sprite ItemIcon => LoadItemSprite("Boxing"); public override ItemTag[] ItemTags { get { ItemTag[] array = new ItemTag[3]; RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); return (ItemTag[])(object)array; } } public override bool Unfinished => true; public override void CreateAssets(ConfigFile config) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Expected O, but got Unknown procEffect = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync((object)"RoR2/Base/Common/VFX/OmniImpactVFXLarge.prefab").WaitForCompletion(), "CIR_BoxingGloveImpactEffect", false); EffectComponent component = procEffect.GetComponent(); component.soundName = "Play_ClassicItemsReturns_Punch"; PluginContentPack.effectDefs.Add(new EffectDef(procEffect)); } public override ItemDisplayRuleDict CreateItemDisplayRules() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown return new ItemDisplayRuleDict(Array.Empty()); } public override void Hooks() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Expected O, but got Unknown ProcessHitEnemy.OnHitAttackerActions = (OnHitAttacker)Delegate.Combine((Delegate?)(object)ProcessHitEnemy.OnHitAttackerActions, (Delegate?)new OnHitAttacker(OnHit)); } private void OnHit(DamageInfo damageInfo, CharacterBody victimBody, CharacterBody attackerBody) { //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_0199: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01a0: Unknown result type (might be due to invalid IL or missing references) //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_01ac: Unknown result type (might be due to invalid IL or missing references) //IL_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_01b2: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: Unknown result type (might be due to invalid IL or missing references) //IL_01b8: 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_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01d0: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: Unknown result type (might be due to invalid IL or missing references) //IL_01d7: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: Unknown result type (might be due to invalid IL or missing references) //IL_01e8: Expected O, but got Unknown //IL_01fa: Unknown result type (might be due to invalid IL or missing references) //IL_01ff: Unknown result type (might be due to invalid IL or missing references) //IL_0201: Unknown result type (might be due to invalid IL or missing references) //IL_020c: Unknown result type (might be due to invalid IL or missing references) //IL_021d: Expected O, but got Unknown //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)attackerBody.inventory)) { return; } int itemCountEffective = attackerBody.inventory.GetItemCountEffective(ItemDef); if (itemCountEffective <= 0) { return; } float num = ItemHelpers.StackingLinear(itemCountEffective, chance, chanceStack); if (!Util.CheckRoll(num * damageInfo.procCoefficient, attackerBody.master) && !((ProcChainMask)(ref damageInfo.procChainMask)).HasProc((ProcType)26)) { return; } float num2 = baseForce; Vector3 val = damageInfo.position - damageInfo.attacker.transform.position; Vector3 val2 = num2 * ((Vector3)(ref val)).normalized; if (victimBody.isChampion) { val2 *= championMultiplier; } if (victimBody.isFlying || (Object.op_Implicit((Object)(object)victimBody.characterMotor) && !victimBody.characterMotor.isGrounded)) { val2 *= airbornMultiplier; } if (Object.op_Implicit((Object)(object)victimBody.rigidbody)) { float num3 = Mathf.Max(victimBody.rigidbody.mass / 100f, 1f); if (victimBody.isFlying) { num3 = Mathf.Min(num3, 7.5f); } val2 *= num3; } DamageInfo val3 = new DamageInfo { attacker = damageInfo.attacker, canRejectForce = false, crit = damageInfo.crit, damage = damageInfo.damage * damageMult, damageColorIndex = (DamageColorIndex)3, damageType = DamageTypeCombo.op_Implicit((DamageType)0), dotIndex = (DotIndex)(-1), force = val2, inflictor = damageInfo.attacker, position = damageInfo.position, procChainMask = damageInfo.procChainMask, procCoefficient = 0f }; victimBody.healthComponent.TakeDamage(val3); EffectManager.SpawnEffect(procEffect, new EffectData { origin = damageInfo.position, scale = 8f }, true); } } public class ElitesDropItems : ItemBase { public const float cloverPercentageDropChance = 4.5f; public const float cloverPercentageDropChancePerStack = 1.5f; public static ConfigEntry useClassic; private static Xoroshiro128Plus treasureRng; public override string ItemName => "56 Leaf Clover"; public override string ItemLangTokenName => "56LEAFCLOVER"; public override object[] ItemFullDescriptionParams => new object[2] { 4.5f, 1.5f }; public override ItemTier Tier => (ItemTier)1; public override GameObject ItemModel => LoadItemModel("Clover"); public override Sprite ItemIcon => LoadItemSprite("Clover"); public override ItemTag[] ItemTags { get { ItemTag[] array = new ItemTag[7]; RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); return (ItemTag[])(object)array; } } public static PickupDropTable SacrificePickupDropTable => SacrificeArtifactManager.dropTable; public override void Init(ConfigFile config) { //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Expected O, but got Unknown CreateConfig(config); CreateLang(); CreateItem(); Hooks(); ClassicItemsReturnsPlugin.onFinishScanning = (Action)Delegate.Combine(ClassicItemsReturnsPlugin.onFinishScanning, new Action(CreateCraftableDef)); treasureRng = new Xoroshiro128Plus(0uL); ArtifactOfClover.cloverDef = ItemDef; } public override void CreateConfig(ConfigFile config) { useClassic = config.Bind(base.ConfigCategory, "Use Classic Chances", true, "Roll Clover for all players until an item drops, like in RoR1. Disabling this will make it only roll for the killer."); } public override ItemDisplayRuleDict CreateItemDisplayRules() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown return new ItemDisplayRuleDict(Array.Empty()); } public override void Hooks() { GlobalEventManager.onCharacterDeathGlobal += GlobalEventManager_onCharacterDeathGlobal; Run.onRunStartGlobal += Run_onRunStartGlobal; } private void Run_onRunStartGlobal(Run run) { if (NetworkServer.active && run.treasureRng != null) { treasureRng.ResetSeed(run.treasureRng.nextUlong); } } protected override void CreateCraftableDef() { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Expected O, but got Unknown //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Expected O, but got Unknown //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Expected O, but got Unknown //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Expected O, but got Unknown //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Expected O, but got Unknown //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Expected O, but got Unknown //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Expected O, but got Unknown //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Expected O, but got Unknown //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Expected O, but got Unknown if (Object.op_Implicit((Object)(object)ItemDef)) { CraftableDef val = ScriptableObject.CreateInstance(); Recipe val2 = new Recipe(); val2.amountToDrop = 1; val2.ingredients = (RecipeIngredient[])(object)new RecipeIngredient[2] { new RecipeIngredient { pickup = (Object)(object)ItemDef }, new RecipeIngredient { pickup = (Object)(object)Addressables.LoadAssetAsync((object)"RoR2/DLC2/Items/BoostAllStats/BoostAllStats.asset").WaitForCompletion() } }; Recipe val3 = val2; val2 = new Recipe(); val2.amountToDrop = 1; val2.ingredients = (RecipeIngredient[])(object)new RecipeIngredient[2] { new RecipeIngredient { pickup = (Object)(object)ItemDef }, new RecipeIngredient { pickup = (Object)(object)Addressables.LoadAssetAsync((object)"RoR2/Base/Plant/Plant.asset").WaitForCompletion() } }; Recipe val4 = val2; val.pickup = (Object)(object)Addressables.LoadAssetAsync((object)"RoR2/Base/Clover/Clover.asset").WaitForCompletion(); val.recipes = (Recipe[])(object)new Recipe[2] { val3, val4 }; ((Object)val).name = "cdCloverToClover"; PluginContentPack.craftableDefs.Add(val); CraftableDef val5 = ScriptableObject.CreateInstance(); val2 = new Recipe(); val2.amountToDrop = 2; val2.ingredients = (RecipeIngredient[])(object)new RecipeIngredient[2] { new RecipeIngredient { pickup = (Object)(object)Addressables.LoadAssetAsync((object)"RoR2/Base/Clover/Clover.asset").WaitForCompletion() }, new RecipeIngredient { pickup = (Object)(object)Addressables.LoadAssetAsync((object)"RoR2/Base/Scrap/ScrapGreen.asset").WaitForCompletion() } }; Recipe val6 = val2; val5.pickup = (Object)(object)ItemDef; val5.recipes = (Recipe[])(object)new Recipe[1] { val6 }; ((Object)val5).name = "bigCloverToSmallClover"; PluginContentPack.craftableDefs.Add(val5); } } private void GlobalEventManager_onCharacterDeathGlobal(DamageReport damageReport) { //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) if (NetworkServer.active && Object.op_Implicit((Object)(object)damageReport.victimBody) && damageReport.victimBody.isElite && Object.op_Implicit((Object)(object)damageReport.attacker) && damageReport.attackerTeamIndex != damageReport.victimTeamIndex && !((Enum)damageReport.victimBody.bodyFlags).HasFlag((Enum)(object)(BodyFlags)4)) { if (useClassic.Value) { CloverActivation_UseClassic(damageReport); } else { CloverActivation_KillerOnly(damageReport); } } } private void CloverActivation_UseClassic(DamageReport damageReport) { foreach (PlayerCharacterMasterController instance in PlayerCharacterMasterController.instances) { if (RollForMaster(instance.master)) { CloverActivation_CreatePickupDroplet(damageReport); break; } } } private void CloverActivation_KillerOnly(DamageReport damageReport) { if (Object.op_Implicit((Object)(object)damageReport.attackerMaster) && RollForMaster(damageReport.attackerMaster)) { CloverActivation_CreatePickupDroplet(damageReport); } } private bool RollForMaster(CharacterMaster master) { if (Object.op_Implicit((Object)(object)master)) { int count = GetCount(master); if (count > 0) { CharacterBody body = master.GetBody(); if (Object.op_Implicit((Object)(object)body) && Object.op_Implicit((Object)(object)body.healthComponent) && body.healthComponent.alive) { float num = ItemHelpers.StackingLinear(count, 4.5f, 1.5f); return Util.CheckRoll(num, 0f, (CharacterMaster)null); } } } return false; } private void CloverActivation_CreatePickupDroplet(DamageReport damageReport) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: 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) UniquePickup val = SacrificePickupDropTable.GeneratePickupPreReplacement(treasureRng); bool flag = true; PickupDropletController.CreatePickupDroplet(val, damageReport.victimBody.corePosition, Vector3.up * 20f, false, false); } } public class EnergyCell : ItemBase { public class EnergyCellBehavior : BaseItemBodyBehavior { private int lastAtkSpdToInt = 0; private Inventory inventory; [ItemDefAssociation(useOnClient = true, useOnServer = true)] public static ItemDef GetItemDef() { return ItemBase.Instance.ItemDef; } private void OnEnable() { inventory = ((BaseItemBodyBehavior)this).body.inventory; } private void FixedUpdate() { if (Object.op_Implicit((Object)(object)((BaseItemBodyBehavior)this).body.inventory)) { float num = (((BaseItemBodyBehavior)this).body.healthComponent.combinedHealthFraction - 0.25f) / 0.75f; float num2 = Mathf.Lerp(0f, ItemHelpers.StackingLinear(base.stack, 0.4f, 0.4f), 1f - num); int num3 = Mathf.FloorToInt(num2 * 100f); if (num3 != lastAtkSpdToInt) { lastAtkSpdToInt = num3; ((BaseItemBodyBehavior)this).body.statsDirty = true; } } } } public const float atkSpdIncrease = 0.2f; public const float atkSpdIncreaseStack = 0.2f; public const float atkSpdIncreaseLowHealth = 0.4f; public const float atkSpdIncreaseLowHealthStack = 0.4f; public const float atkSpdIncreaseLowHealthThreshold = 0.25f; public const float atkSpdIncreaseLowHealthThresholdInverse = 0.75f; public override string ItemName => "Energy Cell"; public override string ItemLangTokenName => "ENERGYCELL"; public override ItemTier Tier => (ItemTier)1; public override GameObject ItemModel => LoadItemModel("Cell"); public override Sprite ItemIcon => LoadItemSprite("Cell"); public override ItemTag[] ItemTags { get { ItemTag[] array = new ItemTag[3]; RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); return (ItemTag[])(object)array; } } public override object[] ItemFullDescriptionParams => new object[4] { 20f, 20f, 60.000004f, 60.000004f }; public override ItemDisplayRuleDict CreateItemDisplayRules() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown return new ItemDisplayRuleDict(Array.Empty()); } public override void Hooks() { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Expected O, but got Unknown base.Hooks(); RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(RecalculateStatsAPI_GetStatCoefficients); } private void RecalculateStatsAPI_GetStatCoefficients(CharacterBody sender, StatHookEventArgs args) { int count = GetCount(sender); if (count != 0) { float num = ItemHelpers.StackingLinear(count, 0.2f, 0.2f); float num2 = ItemHelpers.StackingLinear(count, 0.4f, 0.4f); float num3 = (sender.healthComponent.combinedHealthFraction - 0.25f) / 0.75f; float num4 = Mathf.Lerp(0f, num2, 1f - num3); args.attackSpeedMultAdd += num + (float)Mathf.FloorToInt(num4 * 100f) / 100f; } } } public class GoldenGun : ItemBase { public class GoldenGunBehavior : BaseItemBodyBehavior { [ItemDefAssociation(useOnClient = true, useOnServer = true)] public static ItemDef GetItemDef() { return ItemBase.Instance.ItemDef; } public void OnDestroy() { SetBuffCount(0); } public void SetBuffCount(int count) { if (!Object.op_Implicit((Object)(object)((BaseItemBodyBehavior)this).body)) { return; } int buffCount = ((BaseItemBodyBehavior)this).body.GetBuffCount(Buffs.GoldenGunBuff); int num = buffCount - count; if (num > 0) { for (int i = 0; i < num; i++) { ((BaseItemBodyBehavior)this).body.RemoveBuff(Buffs.GoldenGunBuff); } } else if (num < 0) { for (int j = 0; j < -num; j++) { ((BaseItemBodyBehavior)this).body.AddBuff(Buffs.GoldenGunBuff); } } } private void FixedUpdate() { if (NetworkServer.active && Object.op_Implicit((Object)(object)Run.instance) && Object.op_Implicit((Object)(object)((BaseItemBodyBehavior)this).body.master)) { int num = (Object.op_Implicit((Object)(object)Stage.instance) ? Run.instance.GetDifficultyScaledCost((int)goldCap, Stage.instance.entryDifficultyCoefficient) : Run.instance.GetDifficultyScaledCost((int)goldCap)); int num2 = (int)ItemHelpers.StackingLinear(base.stack, num, goldCapPerStack); int num3 = (int)ItemHelpers.StackingLinear(base.stack, GoldenGun.buffCount, buffCountPerStack); float num4 = (float)((BaseItemBodyBehavior)this).body.master.money / (float)num2; int num5 = Mathf.Min(num3, Mathf.FloorToInt((float)num3 * num4)); int buffCount = ((BaseItemBodyBehavior)this).body.GetBuffCount(Buffs.GoldenGunBuff); if (num5 != buffCount) { SetBuffCount(num5); } } } } public static uint buffCount = 40u; public static uint buffCountPerStack = 20u; public static uint goldCap = 300u; public static uint goldCapPerStack = 150u; public override string ItemName => "Golden Gun"; public override string ItemLangTokenName => "GOLDENGUN"; public override object[] ItemFullDescriptionParams => new object[4] { buffCount, buffCountPerStack, goldCap, goldCapPerStack }; public override ItemTier Tier => (ItemTier)1; public override GameObject ItemModel => LoadItemModel("GoldGun"); public override Sprite ItemIcon => LoadItemSprite("GoldGun"); public override ItemTag[] ItemTags { get { ItemTag[] array = new ItemTag[3]; RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); return (ItemTag[])(object)array; } } public override ItemDisplayRuleDict CreateItemDisplayRules() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown return new ItemDisplayRuleDict(Array.Empty()); } public override void Hooks() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(RecalculateStatsAPI_GetStatCoefficients); } private void RecalculateStatsAPI_GetStatCoefficients(CharacterBody sender, StatHookEventArgs args) { if (Object.op_Implicit((Object)(object)sender)) { args.damageMultAdd += 0.01f * (float)sender.GetBuffCount(Buffs.GoldenGunBuff); } } protected override void CreateCraftableDef() { //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Expected O, but got Unknown //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Expected O, but got Unknown //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Expected O, but got Unknown //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Expected O, but got Unknown //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Expected O, but got Unknown //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Expected O, but got Unknown bool flag = ItemBase.Instance != null && Object.op_Implicit((Object)(object)ItemBase.Instance.ItemDef); bool flag2 = ItemBase.Instance != null && Object.op_Implicit((Object)(object)ItemBase.Instance.ItemDef); if (flag || flag2) { CraftableDef val = ScriptableObject.CreateInstance(); val.pickup = (Object)(object)ItemDef; val.recipes = (Recipe[])(object)new Recipe[0]; if (flag) { Recipe val2 = new Recipe(); val2.amountToDrop = 1; val2.ingredients = (RecipeIngredient[])(object)new RecipeIngredient[2] { new RecipeIngredient { pickup = (Object)(object)Addressables.LoadAssetAsync((object)"RoR2/Base/Missile/Missile.asset").WaitForCompletion() }, new RecipeIngredient { pickup = (Object)(object)ItemBase.Instance.ItemDef } }; Recipe element = val2; val.recipes = val.recipes.Append(element).ToArray(); } if (flag2) { Recipe val2 = new Recipe(); val2.amountToDrop = 1; val2.ingredients = (RecipeIngredient[])(object)new RecipeIngredient[2] { new RecipeIngredient { pickup = (Object)(object)Addressables.LoadAssetAsync((object)"RoR2/Base/Missile/Missile.asset").WaitForCompletion() }, new RecipeIngredient { pickup = (Object)(object)ItemBase.Instance.ItemDef } }; Recipe element2 = val2; val.recipes = val.recipes.Append(element2).ToArray(); } PluginContentPack.craftableDefs.Add(val); } } } public class GuardiansHeart : ItemBase { public float shield = 0.1f; public float armor = 100f; public ConfigEntry useFullInvuln; public override string ItemName => "Guardians Heart"; public override string ItemLangTokenName => "GUARDIANSHEART"; public override ItemTier Tier => (ItemTier)1; public override GameObject ItemModel => LoadItemModel("GuardiansHeart"); public override Sprite ItemIcon => LoadItemSprite("GuardiansHeart"); public override ItemTag[] ItemTags { get { ItemTag[] array = new ItemTag[4]; RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); return (ItemTag[])(object)array; } } public override object[] ItemFullDescriptionParams => new object[4] { shield * 100f, shield * 100f, armor, armor }; public override ItemDisplayRuleDict CreateItemDisplayRules() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown return new ItemDisplayRuleDict(Array.Empty()); } protected override void CreateLang() { base.CreateLang(); LanguageOverrides.DeferToken("CLASSICITEMSRETURNS_ITEM_GUARDIANSHEART_DESCRIPTION_ALT", ItemFullDescriptionParams[0], ItemFullDescriptionParams[1]); } public override void CreateConfig(ConfigFile config) { useFullInvuln = config.Bind(base.ConfigCategory, "Full Invulnerability", false, "Gain i-frames on shield break."); } public override void Hooks() { //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0053: 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_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Expected O, but got Unknown //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Expected O, but got Unknown if (useFullInvuln.Value) { ItemDef itemDef = ItemDef; itemDef.descriptionToken += "_ALT"; HealthComponent.TakeDamageProcess += new Manipulator(FullInvuln); } else { HealthComponent.TakeDamageProcess += new Manipulator(ArmorOnShieldBreak); } HealthComponent.ServerFixedUpdate += new hook_ServerFixedUpdate(ManageBuff); CharacterBody.onBodyInventoryChangedGlobal += CharacterBody_onBodyInventoryChangedGlobal; RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(RecalculateStatsAPI_GetStatCoefficients); } private void RecalculateStatsAPI_GetStatCoefficients(CharacterBody sender, StatHookEventArgs args) { if (Object.op_Implicit((Object)(object)sender.inventory)) { int itemCountEffective = sender.inventory.GetItemCountEffective(ItemDef); if (itemCountEffective > 0) { args.baseShieldAdd += sender.baseMaxHealth * shield * (float)itemCountEffective; args.levelShieldAdd += sender.levelMaxHealth * shield * (float)itemCountEffective; } } } private void CharacterBody_onBodyInventoryChangedGlobal(CharacterBody body) { if (!NetworkServer.active || !Object.op_Implicit((Object)(object)body.inventory)) { return; } if (body.HasBuff(Buffs.GuardiansHeartReadyBuff)) { if (body.inventory.GetItemCountEffective(ItemDef) <= 0) { body.RemoveBuff(Buffs.GuardiansHeartReadyBuff); } } else if (body.inventory.GetItemCountEffective(ItemDef) > 0 && Object.op_Implicit((Object)(object)body.healthComponent) && body.healthComponent.shield >= body.healthComponent.fullShield) { body.AddBuff(Buffs.GuardiansHeartReadyBuff); } } private void ManageBuff(orig_ServerFixedUpdate orig, HealthComponent self, float deltaTime) { orig.Invoke(self, deltaTime); CharacterBody body = self.body; if (!Object.op_Implicit((Object)(object)body)) { return; } if (self.shield <= 0f) { if (body.HasBuff(Buffs.GuardiansHeartReadyBuff)) { body.RemoveBuff(Buffs.GuardiansHeartReadyBuff); } } else if (self.shield >= self.fullShield && Object.op_Implicit((Object)(object)body.inventory) && body.inventory.GetItemCountEffective(ItemDef) > 0 && !body.HasBuff(Buffs.GuardiansHeartReadyBuff)) { body.AddBuff(Buffs.GuardiansHeartReadyBuff); } } private void FullInvuln(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); if (val.TryGotoNext((MoveType)2, new Func[2] { (Instruction x) => ILPatternMatchingExt.MatchLdfld(x, "shield"), (Instruction x) => ILPatternMatchingExt.MatchSub(x) })) { val.Emit(OpCodes.Ldarg_0); val.Emit(OpCodes.Ldarg_1); val.EmitDelegate>((Func)delegate(float remainingDamage, HealthComponent self, DamageInfo damageInfo) { //IL_0002: 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_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Invalid comparison between Unknown and I4 //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Invalid comparison between Unknown and I4 //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Invalid comparison between Unknown and I4 //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Invalid comparison between Unknown and I4 //IL_00a0: Unknown result type (might be due to invalid IL or missing references) bool flag = (int)DamageTypeCombo.op_Implicit(damageInfo.damageType & DamageTypeCombo.op_Implicit((DamageType)2)) == 2 || (int)DamageTypeCombo.op_Implicit(damageInfo.damageType & DamageTypeCombo.op_Implicit((DamageType)262144)) == 262144 || (int)DamageTypeCombo.op_Implicit(damageInfo.damageType & DamageTypeCombo.op_Implicit((DamageType)64)) == 64 || (int)DamageTypeCombo.op_Implicit(damageInfo.damageType & DamageTypeCombo.op_Implicit((DamageType)65536)) == 65536; CharacterBody body = self.body; if (!flag && body.HasBuff(Buffs.GuardiansHeartReadyBuff)) { body.AddTimedBuff(Buffs.HiddenInvincibility.buffIndex, Time.fixedDeltaTime); remainingDamage = 0f; } body.RemoveBuff(Buffs.GuardiansHeartReadyBuff); return remainingDamage; }); } else { Debug.LogError((object)"ClassicItemsReturns: ShieldGating FullInvuln TakeDamage IL Hook failed"); } } private void ArmorOnShieldBreak(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); if (val.TryGotoNext((MoveType)2, new Func[2] { (Instruction x) => ILPatternMatchingExt.MatchLdfld(x, "shield"), (Instruction x) => ILPatternMatchingExt.MatchSub(x) })) { val.Emit(OpCodes.Ldarg_0); val.Emit(OpCodes.Ldarg_1); val.EmitDelegate>((Func)delegate(float remainingDamage, HealthComponent self, DamageInfo damageInfo) { //IL_0002: 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_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Invalid comparison between Unknown and I4 //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Invalid comparison between Unknown and I4 //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Invalid comparison between Unknown and I4 //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Invalid comparison between Unknown and I4 bool flag = (int)DamageTypeCombo.op_Implicit(damageInfo.damageType & DamageTypeCombo.op_Implicit((DamageType)2)) == 2 || (int)DamageTypeCombo.op_Implicit(damageInfo.damageType & DamageTypeCombo.op_Implicit((DamageType)262144)) == 262144 || (int)DamageTypeCombo.op_Implicit(damageInfo.damageType & DamageTypeCombo.op_Implicit((DamageType)64)) == 64 || (int)DamageTypeCombo.op_Implicit(damageInfo.damageType & DamageTypeCombo.op_Implicit((DamageType)65536)) == 65536; CharacterBody body = self.body; if (!flag && body.HasBuff(Buffs.GuardiansHeartReadyBuff)) { float num = body.armor + self.adaptiveArmorValue; int num2 = 1; if (Object.op_Implicit((Object)(object)body.inventory)) { num2 = Mathf.Max(1, body.inventory.GetItemCountEffective(ItemDef)); } float num3 = num + (float)num2 * armor; remainingDamage *= (100f + num) / (100f + num3); } body.RemoveBuff(Buffs.GuardiansHeartReadyBuff); return remainingDamage; }); } else { Debug.LogError((object)"ClassicItemsReturns: ShieldGating Armor TakeDamage IL Hook failed"); } } protected override void CreateCraftableDef() { //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0043: 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_0069: Expected O, but got Unknown //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Expected O, but got Unknown if (ItemBase.Instance != null && Object.op_Implicit((Object)(object)ItemBase.Instance.ItemDef)) { CraftableDef val = ScriptableObject.CreateInstance(); val.pickup = (Object)(object)ItemDef; Recipe[] array = new Recipe[1]; Recipe val2 = new Recipe(); val2.amountToDrop = 1; val2.ingredients = (RecipeIngredient[])(object)new RecipeIngredient[2] { new RecipeIngredient { pickup = (Object)(object)ItemBase.Instance.ItemDef }, new RecipeIngredient { pickup = (Object)(object)Addressables.LoadAssetAsync((object)"RoR2/Base/FlatHealth/FlatHealth.asset").WaitForCompletion() } }; array[0] = val2; val.recipes = (Recipe[])(object)array; ((Object)val).name = "cdGuardiansHeart"; PluginContentPack.craftableDefs.Add(val); } } } public class Jewel : ItemBase { public static ConfigEntry disableInBazaar; public static NetworkSoundEventDef activationSound; public int moneyToGrant = 8; public float barrierInitial = 0.25f; public float barrierStack = 0.15f; public override string ItemName => "Locked Jewel"; public override string ItemLangTokenName => "JEWEL"; public override ItemTier Tier => (ItemTier)1; public override GameObject ItemModel => LoadItemModel("Jewel"); public override Sprite ItemIcon => LoadItemSprite("Jewel"); public override ItemTag[] ItemTags { get { ItemTag[] array = new ItemTag[6]; RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); return (ItemTag[])(object)array; } } public override object[] ItemFullDescriptionParams => new object[3] { barrierInitial * 100f, barrierStack * 100f, moneyToGrant }; public override ItemDisplayRuleDict CreateItemDisplayRules() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown return new ItemDisplayRuleDict(Array.Empty()); } public override void Init(ConfigFile config) { base.Init(config); activationSound = ScriptableObject.CreateInstance(); activationSound.eventName = "Play_ClassicItemsReturns_Jewel"; PluginContentPack.networkSoundEventDefs.Add(activationSound); } public override void CreateConfig(ConfigFile config) { disableInBazaar = config.Bind(base.ConfigCategory, "Disable in Bazaar", true, "Disable this item in the Bazaar."); } public override void Hooks() { base.Hooks(); GlobalEventManager.OnInteractionsGlobal += GlobalEventManager_OnInteractionsGlobal; } private void GlobalEventManager_OnInteractionsGlobal(Interactor interactor, IInteractable interactable, GameObject interactableObject) { //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Unknown result type (might be due to invalid IL or missing references) if (disableInBazaar.Value && (Object)(object)SceneCatalog.GetSceneDefForCurrentScene() == (Object)(object)ClassicItemsReturnsPlugin.bazaarScene) { return; } InteractionProcFilter component = interactableObject.GetComponent(); if ((Object.op_Implicit((Object)(object)component) && !component.shouldAllowOnInteractionBeginProc) || Object.op_Implicit((Object)(object)interactableObject.GetComponent()) || Object.op_Implicit((Object)(object)interactableObject.GetComponent()) || (Object.op_Implicit((Object)(object)interactableObject.GetComponent()) && !Object.op_Implicit((Object)(object)interactableObject.GetComponent()))) { return; } CharacterBody component2 = ((Component)interactor).GetComponent(); if (!Object.op_Implicit((Object)(object)component2) || !Object.op_Implicit((Object)(object)component2.inventory)) { return; } int itemCountEffective = component2.inventory.GetItemCountEffective(ItemDef); if (itemCountEffective > 0 && Object.op_Implicit((Object)(object)Run.instance) && Object.op_Implicit((Object)(object)Stage.instance)) { JewelOrb jewelOrb = new JewelOrb(); Orb val = (Orb)(object)jewelOrb; Vector3? val2; if ((Object)(object)interactableObject == (Object)null) { val2 = null; } else { Transform transform = interactableObject.transform; val2 = (((Object)(object)transform != (Object)null) ? new Vector3?(transform.position) : null); } val.origin = (Vector3)(((??)val2) ?? component2.corePosition); ((Orb)jewelOrb).target = component2.mainHurtBox; ((GoldOrb)jewelOrb).goldAmount = (uint)Run.instance.GetDifficultyScaledCost(moneyToGrant, Stage.instance.entryDifficultyCoefficient); jewelOrb.barrierPercentGrant = barrierInitial + barrierStack * (float)(itemCountEffective - 1); OrbManager.instance.AddOrb((Orb)(object)jewelOrb); } } protected override void CreateCraftableDef() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0123: 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_0140: Expected O, but got Unknown //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Expected O, but got Unknown //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Expected O, but got Unknown //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_0195: Expected O, but got Unknown //IL_01a7: Unknown result type (might be due to invalid IL or missing references) //IL_01ac: Unknown result type (might be due to invalid IL or missing references) //IL_01b2: Unknown result type (might be due to invalid IL or missing references) //IL_01b7: Unknown result type (might be due to invalid IL or missing references) //IL_01c5: Expected O, but got Unknown //IL_01c7: Unknown result type (might be due to invalid IL or missing references) //IL_01cc: Unknown result type (might be due to invalid IL or missing references) //IL_01d9: Expected O, but got Unknown //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Expected O, but got Unknown //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected O, but got Unknown //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Expected O, but got Unknown //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Expected O, but got Unknown //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Expected O, but got Unknown //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Expected O, but got Unknown ItemDef pickup = Addressables.LoadAssetAsync((object)"RoR2/Base/BarrierOnKill/BarrierOnKill.asset").WaitForCompletion(); Recipe val2; if (ItemBase.Instance != null && Object.op_Implicit((Object)(object)ItemBase.Instance.ItemDef)) { CraftableDef val = ScriptableObject.CreateInstance(); val.pickup = (Object)(object)ItemDef; Recipe[] array = new Recipe[2]; val2 = new Recipe(); val2.amountToDrop = 1; val2.ingredients = (RecipeIngredient[])(object)new RecipeIngredient[2] { new RecipeIngredient { pickup = (Object)(object)pickup }, new RecipeIngredient { pickup = (Object)(object)ItemBase.Instance.ItemDef } }; array[0] = val2; val2 = new Recipe(); val2.amountToDrop = 1; val2.ingredients = (RecipeIngredient[])(object)new RecipeIngredient[2] { new RecipeIngredient { pickup = (Object)(object)Addressables.LoadAssetAsync((object)"RoR2/Base/NearbyDamageBonus/NearbyDamageBonus.asset").WaitForCompletion() }, new RecipeIngredient { pickup = (Object)(object)ItemBase.Instance.ItemDef } }; array[1] = val2; val.recipes = (Recipe[])(object)array; ((Object)val).name = "cdLockedJewel"; PluginContentPack.craftableDefs.Add(val); } CraftableDef val3 = ScriptableObject.CreateInstance(); val3.pickup = (Object)(object)Addressables.LoadAssetAsync((object)"RoR2/Base/BarrierOnKill/BarrierOnKill.asset").WaitForCompletion(); Recipe[] array2 = new Recipe[2]; val2 = new Recipe(); val2.amountToDrop = 2; val2.ingredients = (RecipeIngredient[])(object)new RecipeIngredient[2] { new RecipeIngredient { pickup = (Object)(object)Addressables.LoadAssetAsync((object)"RoR2/Base/TreasureCache/TreasureCache.asset").WaitForCompletion() }, new RecipeIngredient { pickup = (Object)(object)ItemDef } }; array2[0] = val2; val2 = new Recipe(); val2.amountToDrop = 2; val2.ingredients = (RecipeIngredient[])(object)new RecipeIngredient[2] { new RecipeIngredient { pickup = (Object)(object)Addressables.LoadAssetAsync((object)"RoR2/DLC1/TreasureCacheVoid/TreasureCacheVoid.asset").WaitForCompletion() }, new RecipeIngredient { pickup = (Object)(object)ItemDef } }; array2[1] = val2; val3.recipes = (Recipe[])(object)array2; ((Object)val3).name = "cdUnlockedJewel"; PluginContentPack.craftableDefs.Add(val3); } } public class JewelOrb : GoldOrb { public float barrierPercentGrant = 0f; public override void OnArrival() { //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) ((GoldOrb)this).OnArrival(); if (Object.op_Implicit((Object)(object)((Orb)this).target)) { if (Object.op_Implicit((Object)(object)((Orb)this).target.healthComponent) && barrierPercentGrant > 0f) { ((Orb)this).target.healthComponent.AddBarrier(barrierPercentGrant * ((Orb)this).target.healthComponent.fullCombinedHealth); } if (Object.op_Implicit((Object)(object)((Component)((Orb)this).target).transform) && Object.op_Implicit((Object)(object)Jewel.activationSound)) { EffectManager.SimpleSoundEffect(Jewel.activationSound.index, ((Component)((Orb)this).target).transform.position, true); } } } } internal class MortarTube : ItemBase { public float damageCoeff = 3f; public float stackDamageCoeff = 3f; public float procCoeff = 0f; public float procChance = 10f; public float blastRadius = 10f; public GameObject mortarProjectilePrefab; public GameObject mortarProjectileGhostPrefab; public GameObject mortarImpactEffectPrefab; private static float minDistance = 5f; private static float maxDistance = 60f; private static float timeToTarget = 1f; public override string ItemName => "Mortar Tube"; public override string ItemLangTokenName => "MORTARTUBE"; public override object[] ItemFullDescriptionParams => new object[3] { procChance, damageCoeff * 100f, stackDamageCoeff * 100f }; public override ItemTier Tier => (ItemTier)1; public override GameObject ItemModel => LoadItemModel("Mortar"); public override Sprite ItemIcon => LoadItemSprite("Mortar"); public override ItemTag[] ItemTags => (ItemTag[])(object)new ItemTag[2] { (ItemTag)1, (ItemTag)31 }; protected override void CreateLang() { if (ModSupport.ModCompatRiskyMod.IsAtgEnabled()) { stackDamageCoeff = 2.1f; ItemFullDescriptionParams[2] = stackDamageCoeff * 100f; } base.CreateLang(); } public override ItemDisplayRuleDict CreateItemDisplayRules() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown return new ItemDisplayRuleDict(Array.Empty()); } public override void CreateAssets(ConfigFile config) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_017c: Unknown result type (might be due to invalid IL or missing references) //IL_0210: Unknown result type (might be due to invalid IL or missing references) //IL_0217: Unknown result type (might be due to invalid IL or missing references) //IL_021c: Unknown result type (might be due to invalid IL or missing references) //IL_0248: Unknown result type (might be due to invalid IL or missing references) //IL_0252: Expected O, but got Unknown mortarProjectilePrefab = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync((object)"RoR2/Base/Commando/CommandoGrenadeProjectile.prefab").WaitForCompletion(), "CIR_MortarProjectile", true); mortarProjectilePrefab.AddComponent(); ProjectileController component = mortarProjectilePrefab.GetComponent(); ProjectileDamage component2 = mortarProjectilePrefab.GetComponent(); ProjectileImpactExplosion component3 = mortarProjectilePrefab.GetComponent(); ((ProjectileExplosion)component3).blastRadius = blastRadius; mortarImpactEffectPrefab = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync((object)"RoR2/Base/Common/VFX/OmniExplosionVFX.prefab").WaitForCompletion(), "CIR_MortarImpactVFX", false); if (!Object.op_Implicit((Object)(object)mortarImpactEffectPrefab.GetComponent())) { mortarImpactEffectPrefab.AddComponent(); } mortarImpactEffectPrefab.GetComponent().soundName = "Play_ClassicItemsReturns_MortarImpact"; mortarProjectileGhostPrefab = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync((object)"RoR2/Base/Drones/MicroMissileGhost.prefab").WaitForCompletion(), "CIR_MortarProjectileGhost", false); mortarProjectileGhostPrefab.transform.Find("missile VFX").localPosition = new Vector3(0f, 0f, -0.45f); mortarProjectileGhostPrefab.transform.Find("missile VFX").localScale = new Vector3(0.5f, 0.3f, 0.5f); component.ghostPrefab = mortarProjectileGhostPrefab; component3.lifetimeExpiredSound = Assets.CreateNetworkSoundEventDef("Play_ClassicItemsReturns_Mortar"); component3.offsetForLifetimeExpiredSound = 0.1f; component3.destroyOnEnemy = false; component3.destroyOnWorld = false; component3.timerAfterImpact = true; ((ProjectileExplosion)component3).falloffModel = (FalloffModel)0; component3.lifetime = 30f; component3.lifetimeAfterImpact = 0f; component3.lifetimeRandomOffset = 0f; ((ProjectileExplosion)component3).blastDamageCoefficient = 1f; ((ProjectileExplosion)component3).blastProcCoefficient = procCoeff; ((ProjectileExplosion)component3).fireChildren = false; ((ProjectileExplosion)component3).childrenCount = 0; ((ProjectileExplosion)component3).childrenProjectilePrefab = null; ((ProjectileExplosion)component3).childrenDamageCoefficient = 0f; component3.impactEffect = mortarImpactEffectPrefab; component.startSound = ""; component.procCoefficient = procCoeff; component2.crit = false; component2.damage = 0f; component2.damageColorIndex = (DamageColorIndex)0; component2.damageType = DamageTypeCombo.op_Implicit((DamageType)0); component2.force = 0f; Object.Destroy((Object)(object)mortarProjectilePrefab.GetComponent()); PluginContentPack.effectDefs.Add(new EffectDef(mortarImpactEffectPrefab)); PluginContentPack.projectilePrefabs.Add(mortarProjectilePrefab); } public override void Hooks() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Expected O, but got Unknown ProcessHitEnemy.OnHitAttackerActions = (OnHitAttacker)Delegate.Combine((Delegate?)(object)ProcessHitEnemy.OnHitAttackerActions, (Delegate?)new OnHitAttacker(FireMortar)); } private void FireMortar(DamageInfo damageInfo, CharacterBody victimBody, CharacterBody attackerBody) { //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: 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_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Unknown result type (might be due to invalid IL or missing references) //IL_019b: Unknown result type (might be due to invalid IL or missing references) //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_01b4: Unknown result type (might be due to invalid IL or missing references) //IL_01b9: Unknown result type (might be due to invalid IL or missing references) //IL_01be: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: Unknown result type (might be due to invalid IL or missing references) //IL_01c7: 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_0230: Unknown result type (might be due to invalid IL or missing references) //IL_0252: 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_025f: Unknown result type (might be due to invalid IL or missing references) //IL_0264: Unknown result type (might be due to invalid IL or missing references) //IL_0278: Unknown result type (might be due to invalid IL or missing references) //IL_027a: Unknown result type (might be due to invalid IL or missing references) //IL_02a2: Unknown result type (might be due to invalid IL or missing references) //IL_02a4: Unknown result type (might be due to invalid IL or missing references) //IL_02ab: Unknown result type (might be due to invalid IL or missing references) //IL_02cd: Unknown result type (might be due to invalid IL or missing references) //IL_02d2: Unknown result type (might be due to invalid IL or missing references) //IL_02d4: Unknown result type (might be due to invalid IL or missing references) //IL_02d9: Unknown result type (might be due to invalid IL or missing references) //IL_02db: Unknown result type (might be due to invalid IL or missing references) //IL_02dd: Unknown result type (might be due to invalid IL or missing references) //IL_02df: Unknown result type (might be due to invalid IL or missing references) //IL_02e4: Unknown result type (might be due to invalid IL or missing references) //IL_030e: Unknown result type (might be due to invalid IL or missing references) //IL_0310: Unknown result type (might be due to invalid IL or missing references) //IL_0315: Unknown result type (might be due to invalid IL or missing references) //IL_0317: Unknown result type (might be due to invalid IL or missing references) //IL_031c: Unknown result type (might be due to invalid IL or missing references) //IL_0320: Unknown result type (might be due to invalid IL or missing references) //IL_0322: Unknown result type (might be due to invalid IL or missing references) //IL_0327: Unknown result type (might be due to invalid IL or missing references) //IL_032d: Unknown result type (might be due to invalid IL or missing references) //IL_0332: Unknown result type (might be due to invalid IL or missing references) //IL_0343: Unknown result type (might be due to invalid IL or missing references) //IL_0348: Unknown result type (might be due to invalid IL or missing references) //IL_034d: Unknown result type (might be due to invalid IL or missing references) //IL_0371: Unknown result type (might be due to invalid IL or missing references) //IL_0375: Unknown result type (might be due to invalid IL or missing references) //IL_037a: Unknown result type (might be due to invalid IL or missing references) //IL_0366: Unknown result type (might be due to invalid IL or missing references) if (damageInfo.damage <= 0f || !Object.op_Implicit((Object)(object)attackerBody) || !Object.op_Implicit((Object)(object)attackerBody.inventory)) { return; } int itemCountEffective = attackerBody.inventory.GetItemCountEffective(ItemDef); if (itemCountEffective <= 0) { return; } float num = procChance; if (!Util.CheckRoll(num * damageInfo.procCoefficient, attackerBody.master) && !((ProcChainMask)(ref damageInfo.procChainMask)).HasProc((ProcType)26)) { return; } Ray val = default(Ray); ((Ray)(ref val)).origin = attackerBody.aimOrigin; Vector3 val2 = damageInfo.position - attackerBody.aimOrigin; ((Ray)(ref val)).direction = ((Vector3)(ref val2)).normalized; Ray val3 = val; Ray val4 = default(Ray); ((Ray)(ref val4))..ctor(((Ray)(ref val3)).origin, Vector3.up); Vector3 position = damageInfo.position; float num2 = 40f; Vector3 val5 = position - ((Ray)(ref val4)).origin; Vector2 val6 = default(Vector2); ((Vector2)(ref val6))..ctor(val5.x, val5.z); float magnitude = ((Vector2)(ref val6)).magnitude; Vector2 val7 = val6 / magnitude; if (magnitude < minDistance) { magnitude = minDistance; } if (magnitude > maxDistance) { magnitude = maxDistance; } float num3 = Trajectory.CalculateInitialYSpeed(timeToTarget, val5.y); float num4 = magnitude / timeToTarget; Vector3 direction = default(Vector3); ((Vector3)(ref direction))..ctor(val7.x * num4, num3, val7.y * num4); num2 = ((Vector3)(ref direction)).magnitude; ((Ray)(ref val4)).direction = direction; Vector3 val8 = ((Ray)(ref val4)).direction + Random.insideUnitSphere * 0.05f; Quaternion rotation = Util.QuaternionSafeLookRotation(val8); float num5 = damageCoeff + (float)(itemCountEffective - 1) * stackDamageCoeff; int itemCountEffective2 = attackerBody.inventory.GetItemCountEffective(Items.MoreMissile); if (itemCountEffective2 > 0) { num5 *= MissileUtils.GetMoreMissileDamageMultiplier(itemCountEffective2); } FireProjectileInfo val9 = default(FireProjectileInfo); val9.crit = damageInfo.crit; val9.damage = damageInfo.damage * num5; val9.damageColorIndex = (DamageColorIndex)0; val9.force = 800f; val9.owner = ((Component)attackerBody).gameObject; val9.position = ((Ray)(ref val4)).origin; val9.procChainMask = damageInfo.procChainMask; val9.projectilePrefab = mortarProjectilePrefab; val9.rotation = rotation; ((FireProjectileInfo)(ref val9)).speedOverride = num2; val9._speedOverride = num2; val9.useFuseOverride = false; val9.useSpeedOverride = true; FireProjectileInfo val10 = val9; ProjectileManager.instance.FireProjectileServer(val10, (NetworkConnection)null, (ushort)0, 0.0); if (itemCountEffective2 <= 0) { return; } Vector3 val11 = Vector3.Cross(Vector3.up, val8); Vector3 val12 = Vector3.Cross(val8, val11); float num6 = 0f; float num7 = 0f; num7 = 4f; num6 = num7 / 2f; Vector3 val13 = Quaternion.AngleAxis((0f - num7) * 0.5f, val12) * val8; Quaternion val14 = Quaternion.AngleAxis(num6, val12); Ray val15 = default(Ray); ((Ray)(ref val15))..ctor(((Ray)(ref val4)).origin, val13); for (int i = 0; i < 3; i++) { val10.rotation = Util.QuaternionSafeLookRotation(((Ray)(ref val15)).direction); if (i != 1) { ProjectileManager.instance.FireProjectile(val10); } ((Ray)(ref val15)).direction = val14 * ((Ray)(ref val15)).direction; } } } internal class MortarRotation : MonoBehaviour { private Rigidbody rb; private void Awake() { rb = ((Component)this).GetComponent(); } private void FixedUpdate() { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) if (NetworkServer.active && Object.op_Implicit((Object)(object)rb)) { Transform transform = ((Component)this).transform; Vector3 velocity = rb.velocity; transform.rotation = Util.QuaternionSafeLookRotation(((Vector3)(ref velocity)).normalized); } } } public class PrisonShackles : ItemBase { public static float attackSpeedSlowMultiplier = 0.4f; public static int duration = 2; public static int durationStack = 2; public override string ItemName => "Prison Shackles"; public override string ItemLangTokenName => "PRISONSHACKLES"; public override object[] ItemFullDescriptionParams => new object[3] { attackSpeedSlowMultiplier * 100f, duration, durationStack }; public override ItemTier Tier => (ItemTier)1; public override GameObject ItemModel => LoadItemModel("Shackles"); public override Sprite ItemIcon => LoadItemSprite("Shackles"); public override ItemTag[] ItemTags { get { ItemTag[] array = new ItemTag[3]; RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); return (ItemTag[])(object)array; } } public override ItemDisplayRuleDict CreateItemDisplayRules() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown return new ItemDisplayRuleDict(Array.Empty()); } public override void Hooks() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Expected O, but got Unknown //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Expected O, but got Unknown ProcessHitEnemy.OnHitAttackerActions = (OnHitAttacker)Delegate.Combine((Delegate?)(object)ProcessHitEnemy.OnHitAttackerActions, (Delegate?)new OnHitAttacker(ApplyShackles)); RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(RecalculateStatsAPI_GetStatCoefficients); } private void ApplyShackles(DamageInfo damageInfo, CharacterBody victimBody, CharacterBody attackerBody) { if (!Object.op_Implicit((Object)(object)attackerBody.inventory)) { return; } int itemCountEffective = attackerBody.inventory.GetItemCountEffective(ItemDef); if (itemCountEffective > 0) { int num = itemCountEffective - 1; float num2 = (float)(duration + num * durationStack) * damageInfo.procCoefficient; if (!(num2 <= 0f)) { victimBody.AddTimedBuff(Buffs.ShacklesBuff, num2); } } } private void RecalculateStatsAPI_GetStatCoefficients(CharacterBody sender, StatHookEventArgs args) { if (sender.HasBuff(Buffs.ShacklesBuff)) { args.attackSpeedReductionMultAdd += 1f / (1f - attackSpeedSlowMultiplier) - 1f; } } } public class RoyalMedallion : ItemBase { public static int maxBuffStacks = 10; public float procChance = 10f; public float buffDuration = 10f; public float buffDurationStack = 6f; public static GameObject buffObjectPrefab; public override string ItemName => "Royal Medallion"; public override string ItemLangTokenName => "ROYALMEDALLION"; public override ItemTier Tier => (ItemTier)1; public override GameObject ItemModel => LoadItemModel("Medallion"); public override Sprite ItemIcon => LoadItemSprite("Medallion"); public override ItemTag[] ItemTags { get { ItemTag[] array = new ItemTag[5]; RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); return (ItemTag[])(object)array; } } public override ItemDisplayRuleDict CreateItemDisplayRules() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown return new ItemDisplayRuleDict(Array.Empty()); } public override void CreateAssets(ConfigFile config) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_003d: 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_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_013e: 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_0144: 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_0180: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Unknown result type (might be due to invalid IL or missing references) //IL_0186: Unknown result type (might be due to invalid IL or missing references) RoyalMedallionPickup.procSound = Assets.CreateNetworkSoundEventDef("Play_ClassicItemsReturns_Medallion"); buffObjectPrefab = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync((object)"RoR2/Base/Tooth/HealPack.prefab").WaitForCompletion(), "CIR_RoyalMedallinPickup", true); buffObjectPrefab.transform.localScale = Vector3.one * 2.5f; buffObjectPrefab.GetComponent().drag = 15f; buffObjectPrefab.GetComponent().duration = 8f; buffObjectPrefab.GetComponent().delayBeforeBeginningBlinking = 7f; GravitatePickup component = buffObjectPrefab.GetComponent(); if (Object.op_Implicit((Object)(object)component)) { component.gravitateAtFullHealth = true; } GameObject gameObject = ((Component)buffObjectPrefab.transform.Find("PickupTrigger")).gameObject; Object.Destroy((Object)(object)gameObject.GetComponent()); RoyalMedallionPickup royalMedallionPickup = gameObject.AddComponent(); GameObject gameObject2 = ((Component)buffObjectPrefab.transform.Find("HealthOrbEffect")).gameObject; GameObject gameObject3 = ((Component)gameObject2.transform.Find("VFX").Find("Core")).gameObject; MainModule main = gameObject3.GetComponent().main; Color val = Color32.op_Implicit(new Color32((byte)220, (byte)100, (byte)200, byte.MaxValue)); ((MainModule)(ref main)).startColor = MinMaxGradient.op_Implicit(val); GameObject gameObject4 = ((Component)gameObject2.transform.Find("VFX").Find("PulseGlow")).gameObject; ParticleSystem component2 = gameObject4.GetComponent(); MainModule main2 = component2.main; ((MainModule)(ref main2)).startColor = MinMaxGradient.op_Implicit(val); ((MainModule)(ref main2)).simulationSpeed = 0f; Object.Destroy((Object)(object)((Component)gameObject2.transform.Find("TrailParent")).gameObject); AkEvent[] componentsInChildren = buffObjectPrefab.GetComponentsInChildren(); AkEvent[] array = componentsInChildren; foreach (AkEvent val2 in array) { Object.Destroy((Object)(object)val2); } Object.Destroy((Object)(object)buffObjectPrefab.GetComponentInChildren()); } public override void Hooks() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Expected O, but got Unknown //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Expected O, but got Unknown ProcessHitEnemy.OnHitAttackerActions = (OnHitAttacker)Delegate.Combine((Delegate?)(object)ProcessHitEnemy.OnHitAttackerActions, (Delegate?)new OnHitAttacker(SpawnOrb)); RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(RecalculateStatsAPI_GetStatCoefficients); } private void SpawnOrb(DamageInfo damageInfo, CharacterBody victimBody, CharacterBody attackerBody) { //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c3->IL00c3: Incompatible stack types: O vs I4 //IL_00b8->IL00c3: Incompatible stack types: I4 vs O //IL_00b8->IL00c3: Incompatible stack types: O vs I4 if ((!victimBody.isChampion && !victimBody.isBoss) || !RoyalMedallionPickup.CanSpawnPickup() || !Object.op_Implicit((Object)(object)attackerBody.inventory)) { return; } int itemCountEffective = attackerBody.inventory.GetItemCountEffective(ItemDef); if (itemCountEffective > 0 && (Util.CheckRoll(procChance, attackerBody.master) || ((ProcChainMask)(ref damageInfo.procChainMask)).HasProc((ProcType)26))) { GameObject val = Object.Instantiate(buffObjectPrefab, damageInfo.position, Random.rotation); TeamFilter component = val.GetComponent(); object obj = component; int num; if (Object.op_Implicit((Object)(object)attackerBody.teamComponent)) { obj = attackerBody.teamComponent.teamIndex; num = (int)obj; } else { num = -1; obj = num; num = (int)obj; } ((TeamFilter)num).teamIndex = (TeamIndex)obj; RoyalMedallionPickup componentInChildren = val.GetComponentInChildren(); componentInChildren.team = component; componentInChildren.buffDuration = ItemHelpers.StackingLinear(itemCountEffective, buffDuration, buffDurationStack); componentInChildren.baseObject = val; NetworkServer.Spawn(val); } } private void ProcItem(GlobalEventManager globalEventManager, DamageInfo damageInfo, CharacterBody victimBody, CharacterBody attackerBody, Inventory attackerInventory) { //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a0->IL00a0: Incompatible stack types: O vs I4 //IL_0094->IL00a0: Incompatible stack types: I4 vs O //IL_0094->IL00a0: Incompatible stack types: O vs I4 if ((!victimBody.isChampion && !victimBody.isBoss) || !RoyalMedallionPickup.CanSpawnPickup()) { return; } int itemCountEffective = attackerInventory.GetItemCountEffective(ItemDef); if (itemCountEffective > 0 && Util.CheckRoll(procChance, attackerBody.master)) { GameObject val = Object.Instantiate(buffObjectPrefab, damageInfo.position, Random.rotation); TeamFilter component = val.GetComponent(); object obj = component; int num; if (Object.op_Implicit((Object)(object)attackerBody.teamComponent)) { obj = attackerBody.teamComponent.teamIndex; num = (int)obj; } else { num = -1; obj = num; num = (int)obj; } ((TeamFilter)num).teamIndex = (TeamIndex)obj; RoyalMedallionPickup componentInChildren = val.GetComponentInChildren(); componentInChildren.team = component; componentInChildren.buffDuration = ItemHelpers.StackingLinear(itemCountEffective, buffDuration, buffDurationStack); componentInChildren.baseObject = val; NetworkServer.Spawn(val); } } private void RecalculateStatsAPI_GetStatCoefficients(CharacterBody sender, StatHookEventArgs args) { int buffCount = sender.GetBuffCount(Buffs.RoyalMedallionBuff); if (buffCount > 0) { args.attackSpeedMultAdd += (float)buffCount * 0.06f; args.damageMultAdd += (float)buffCount * 0.03f; args.moveSpeedMultAdd += 0.1f; float num = 1f + 0.2f * (sender.level - 1f); args.baseRegenAdd += (float)buffCount * 1f * num; } } public static void AddRoyalMedallionBuffWithDroneHandling(CharacterBody originalPickupBody, float duration) { //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Invalid comparison between Unknown and I4 //IL_006e: 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_00cb: 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_00e0: Unknown result type (might be due to invalid IL or missing references) AddRoyalMedallionBuff(originalPickupBody, duration); if (originalPickupBody.isPlayerControlled || !Object.op_Implicit((Object)(object)originalPickupBody.teamComponent) || (int)originalPickupBody.teamComponent.teamIndex == -1) { return; } TeamIndex team = originalPickupBody.teamComponent.teamIndex; List list = CharacterBody.readOnlyInstancesList.Where((CharacterBody cb) => Object.op_Implicit((Object)(object)cb.teamComponent) && cb.teamComponent.teamIndex == team && cb.isPlayerControlled).ToList(); if (list.Count <= 0) { return; } list.Sort(delegate(CharacterBody cb1, CharacterBody cb2) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) Vector3 val3 = cb1.corePosition - originalPickupBody.corePosition; float sqrMagnitude = ((Vector3)(ref val3)).sqrMagnitude; val3 = cb2.corePosition - originalPickupBody.corePosition; return Mathf.RoundToInt(sqrMagnitude - ((Vector3)(ref val3)).sqrMagnitude); }); CharacterBody val = list.FirstOrDefault(); if (Object.op_Implicit((Object)(object)val)) { Vector3 val2 = val.corePosition - originalPickupBody.corePosition; if (((Vector3)(ref val2)).sqrMagnitude <= 900f) { AddRoyalMedallionBuff(val, duration); } } } public static void AddRoyalMedallionBuff(CharacterBody attackerBody, float duration) { int buffCount = attackerBody.GetBuffCount(Buffs.RoyalMedallionBuff); if (buffCount > 0) { attackerBody.ClearTimedBuffs(Buffs.RoyalMedallionBuff); } int num = Mathf.Min(buffCount + 1, maxBuffStacks); for (int i = 0; i < num; i++) { attackerBody.AddTimedBuff(Buffs.RoyalMedallionBuff, duration); } } } public class RoyalMedallionPickup : MonoBehaviour { public static NetworkSoundEventDef procSound; public static int maxInstances = 40; private static int instanceCount = 0; public float buffDuration; public TeamFilter team; private bool gaveBuff = false; public GameObject baseObject; private void OnTriggerStay(Collider other) { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) if (NetworkServer.active && !gaveBuff && Object.op_Implicit((Object)(object)team) && Object.op_Implicit((Object)(object)other) && TeamComponent.GetObjectTeam(((Component)other).gameObject) == team.teamIndex) { CharacterBody component = ((Component)other).GetComponent(); gaveBuff = true; if (Object.op_Implicit((Object)(object)procSound)) { EffectManager.SimpleSoundEffect(procSound.index, ((Component)this).transform.position, true); } RoyalMedallion.AddRoyalMedallionBuffWithDroneHandling(component, buffDuration); Object.Destroy((Object)(object)baseObject); } } public static bool CanSpawnPickup() { return instanceCount < maxInstances; } private void Awake() { instanceCount++; } private void OnDestroy() { instanceCount--; } } public class RustyJetpack : ItemBase { public const float jumpBonus = 0.25f; public const float jumpBonusStack = 0.25f; public static GameObject jumpEffectPrefab; public static ConfigEntry enableAirhop; public override string ItemName => "Rusty Jetpack"; public override string ItemLangTokenName => "RUSTYJETPACK"; public override object[] ItemFullDescriptionParams => new object[2] { 25f, 25f }; public override ItemTier Tier => (ItemTier)1; public override GameObject ItemModel => LoadItemModel("Jetpack"); public override Sprite ItemIcon => LoadItemSprite("Jetpack"); public override ItemTag[] ItemTags { get { ItemTag[] array = new ItemTag[3]; RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); return (ItemTag[])(object)array; } } public override void CreateConfig(ConfigFile config) { enableAirhop = config.Bind(base.ConfigCategory, "Enable Airhop", true, "This item grants a short airhop."); } public override ItemDisplayRuleDict CreateItemDisplayRules() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown return new ItemDisplayRuleDict(Array.Empty()); } public override void CreateAssets(ConfigFile config) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Expected O, but got Unknown base.CreateAssets(config); jumpEffectPrefab = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync((object)"RoR2/Base/Bandit2/Bandit2SmokeBombMini.prefab").WaitForCompletion(), "CIR_RustyJetpackEffect", false); ShakeEmitter[] componentsInChildren = jumpEffectPrefab.GetComponentsInChildren(); for (int i = 0; i < componentsInChildren.Length; i++) { if (Object.op_Implicit((Object)(object)componentsInChildren[i])) { Object.Destroy((Object)(object)componentsInChildren[i]); } } EffectComponent component = jumpEffectPrefab.GetComponent(); component.soundName = "Play_ClassicItemsReturns_Jetpack"; PluginContentPack.effectDefs.Add(new EffectDef(jumpEffectPrefab)); } public override void Hooks() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Expected O, but got Unknown CharacterBody.RecalculateStats += new hook_RecalculateStats(RecalculateStats_AddJump); GenericCharacterMain.ApplyJumpVelocity += new hook_ApplyJumpVelocity(ApplyJumpVelocity_DoShorthop); GenericCharacterMain.ProcessJump_bool += new Manipulator(ReplaceJumpEffect); RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(RecalculateStatsAPI_GetStatCoefficients); } private void RecalculateStatsAPI_GetStatCoefficients(CharacterBody sender, StatHookEventArgs args) { if (Object.op_Implicit((Object)(object)sender.inventory)) { int itemCountEffective = sender.inventory.GetItemCountEffective(ItemDef); if (itemCountEffective > 0) { args.jumpPowerMultAdd += ItemHelpers.StackingLinear(itemCountEffective, 0.25f, 0.25f); } } } private void ApplyJumpVelocity_DoShorthop(orig_ApplyJumpVelocity orig, CharacterMotor characterMotor, CharacterBody characterBody, float horizontalBonus, float verticalBonus, bool vault) { //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)characterBody)) { int num = 0; if (Object.op_Implicit((Object)(object)characterBody.inventory)) { num = characterBody.inventory.GetItemCountEffective(ItemDef); } if (num > 0 && enableAirhop.Value && Object.op_Implicit((Object)(object)characterMotor) && characterMotor.jumpCount == characterBody.maxJumpCount - 1) { Vector3 val = characterMotor.moveDirection; val.y = 0f; float magnitude = ((Vector3)(ref val)).magnitude; if (magnitude > 0f) { val /= magnitude; } Vector3 velocity = val * characterBody.moveSpeed * horizontalBonus; velocity.y = 18f; characterMotor.velocity = velocity; ((BaseCharacterController)characterMotor).Motor.ForceUnground(0.1f); return; } } orig.Invoke(characterMotor, characterBody, horizontalBonus, verticalBonus, vault); } private void ReplaceJumpEffect(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_004e: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); if (val.TryGotoNext((MoveType)2, new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchLdstr(x, "Prefabs/Effects/FeatherEffect") })) { int index = val.Index; val.Index = index + 1; val.Emit(OpCodes.Ldarg_0); val.EmitDelegate>((Func)delegate(GameObject origPrefab, GenericCharacterMain self) { if (Object.op_Implicit((Object)(object)((EntityState)self).characterBody)) { bool flag = enableAirhop.Value && Object.op_Implicit((Object)(object)((EntityState)self).characterMotor) && ((EntityState)self).characterMotor.jumpCount == ((EntityState)self).characterBody.maxJumpCount - 1; bool flag2 = Object.op_Implicit((Object)(object)((EntityState)self).characterBody.inventory) && ((EntityState)self).characterBody.inventory.GetItemCountEffective(ItemDef) > 0; if (flag && flag2) { return jumpEffectPrefab; } } return origPrefab; }); } else { Debug.LogError((object)"ClassicItemsReturns: Rusty Jetpack VFX IL hook failed."); } } private void RecalculateStats_AddJump(orig_RecalculateStats orig, CharacterBody self) { orig.Invoke(self); if (GetCount(self) > 0) { int maxJumpCount = self.maxJumpCount; self.maxJumpCount = maxJumpCount + 1; } } protected override void CreateCraftableDef() { //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Expected O, but got Unknown //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Expected O, but got Unknown //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Expected O, but got Unknown if (Object.op_Implicit((Object)(object)ItemDef) && ItemBase.Instance != null && Object.op_Implicit((Object)(object)ItemBase.Instance.ItemDef)) { CraftableDef val = ScriptableObject.CreateInstance(); val.pickup = (Object)(object)ItemDef; Recipe[] array = new Recipe[1]; Recipe val2 = new Recipe(); val2.amountToDrop = 1; val2.ingredients = (RecipeIngredient[])(object)new RecipeIngredient[2] { new RecipeIngredient { pickup = (Object)(object)ItemBase.Instance.ItemDef }, new RecipeIngredient { pickup = (Object)(object)Addressables.LoadAssetAsync((object)"RoR2/DLC1/StrengthenBurn/StrengthenBurn.asset").WaitForCompletion() } }; array[0] = val2; val.recipes = (Recipe[])(object)array; ((Object)val).name = "cdRustyJetpack"; PluginContentPack.craftableDefs.Add(val); } } } public class SmartShopper : ItemBase { public float moneyMult = 0.25f; public float moneyMultStack = 0.25f; public override string ItemName => "Smart Shopper"; public override string ItemLangTokenName => "SMARTSHOPPER"; public override ItemTier Tier => (ItemTier)1; public override GameObject ItemModel => LoadItemModel("Purse"); public override Sprite ItemIcon => LoadItemSprite("Purse"); public override ItemTag[] ItemTags { get { ItemTag[] array = new ItemTag[4]; RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); return (ItemTag[])(object)array; } } public override object[] ItemFullDescriptionParams => new object[2] { moneyMult * 100f, moneyMultStack * 100f }; public override ItemDisplayRuleDict CreateItemDisplayRules() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown return new ItemDisplayRuleDict(Array.Empty()); } public override void Hooks() { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Expected O, but got Unknown base.Hooks(); DeathRewards.OnKilledServer += new hook_OnKilledServer(DeathRewards_OnKilledServer); } protected override void CreateCraftableDef() { //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Expected O, but got Unknown //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Expected O, but got Unknown //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Expected O, but got Unknown //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Expected O, but got Unknown //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Expected O, but got Unknown //IL_0115: 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_0122: Expected O, but got Unknown bool flag = ItemBase.Instance != null && Object.op_Implicit((Object)(object)ItemBase.Instance.ItemDef); bool flag2 = ItemBase.Instance != null && Object.op_Implicit((Object)(object)ItemBase.Instance.ItemDef); if (flag || flag2) { ItemDef pickup = Addressables.LoadAssetAsync((object)"RoR2/DLC3/Items/SpeedOnPickup/SpeedOnPickup.asset").WaitForCompletion(); CraftableDef val = ScriptableObject.CreateInstance(); val.pickup = (Object)(object)ItemDef; val.recipes = (Recipe[])(object)new Recipe[0]; if (flag) { Recipe[] recipes = val.recipes; Recipe val2 = new Recipe(); val2.amountToDrop = 1; val2.ingredients = (RecipeIngredient[])(object)new RecipeIngredient[2] { new RecipeIngredient { pickup = (Object)(object)ItemBase.Instance.ItemDef }, new RecipeIngredient { pickup = (Object)(object)pickup } }; recipes.Append(val2).ToArray(); } if (flag2) { Recipe[] recipes2 = val.recipes; Recipe val2 = new Recipe(); val2.amountToDrop = 1; val2.ingredients = (RecipeIngredient[])(object)new RecipeIngredient[2] { new RecipeIngredient { pickup = (Object)(object)ItemBase.Instance.ItemDef }, new RecipeIngredient { pickup = (Object)(object)pickup } }; recipes2.Append(val2).ToArray(); } ((Object)val).name = "cdSmartShopper"; PluginContentPack.craftableDefs.Add(val); } } private void DeathRewards_OnKilledServer(orig_OnKilledServer orig, DeathRewards self, DamageReport damageReport) { CharacterBody attackerBody = damageReport.attackerBody; if (Object.op_Implicit((Object)(object)attackerBody) && Object.op_Implicit((Object)(object)attackerBody.inventory)) { int itemCountEffective = attackerBody.inventory.GetItemCountEffective(ItemDef); if (itemCountEffective > 0) { int num = itemCountEffective - 1; float num2 = 1f + moneyMult + (float)num * moneyMultStack; self.goldReward = (uint)Mathf.FloorToInt((float)self.goldReward * num2); } } orig.Invoke(self, damageReport); } } } namespace ClassicItemsReturns.Items.Rare { public class HitList : ItemBase { public float damagePerStack = 0.5f; public static NetworkSoundEventDef markEnemySound; public static GameObject markerPrefab; public static GameObject checkPrefab; public override string ItemName => "The Hit List"; public override string ItemLangTokenName => "HITLIST"; public override ItemTier Tier => (ItemTier)2; public override GameObject ItemModel => LoadItemModel("HitList"); public override Sprite ItemIcon => LoadItemSprite("HitList"); public override ItemTag[] ItemTags { get { ItemTag[] array = new ItemTag[3]; RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); return (ItemTag[])(object)array; } } public override object[] ItemFullDescriptionParams => new object[1] { damagePerStack }; public override ItemDisplayRuleDict CreateItemDisplayRules() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown return new ItemDisplayRuleDict(Array.Empty()); } public override void CreateAssets(ConfigFile config) { //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Expected O, but got Unknown markEnemySound = Assets.CreateNetworkSoundEventDef("Play_ClassicItemsReturns_HitListMark"); markerPrefab = Assets.LoadObject("HitListMarker"); markerPrefab.AddComponent(); checkPrefab = Assets.LoadObject("HitListCheck"); checkPrefab.AddComponent(); checkPrefab.AddComponent(); EffectComponent val = checkPrefab.AddComponent(); val.soundName = "Play_ClassicItemsReturns_HitList"; VFXAttributes val2 = checkPrefab.AddComponent(); val2.vfxIntensity = (VFXIntensity)0; val2.vfxPriority = (VFXPriority)2; PluginContentPack.effectDefs.Add(new EffectDef(checkPrefab)); } public override void Hooks() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Expected O, but got Unknown RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(RecalculateStatsAPI_GetStatCoefficients); Inventory.onInventoryChangedGlobal += onInventoryChangedGlobal_SetupHitListServer; CharacterBody.onBodyInventoryChangedGlobal += onBodyInventoryChangedGlobal_RemoveBuffsServer; Stage.onServerStageBegin += onServerStageBegin_InitMinigame; GlobalEventManager.onCharacterDeathGlobal += GlobalEventManager_onCharacterDeathGlobal; CharacterBody.onBodyStartGlobal += onBodyStartGlobal_InitBuffs; CharacterBody.OnClientBuffsChanged += new hook_OnClientBuffsChanged(CharacterBody_OnClientBuffsChanged); } private void CharacterBody_OnClientBuffsChanged(orig_OnClientBuffsChanged orig, CharacterBody self) { orig.Invoke(self); if (!NetworkClient.active || !self.HasBuff(Buffs.HitListEnemyMarker)) { return; } BodyHitListMarkerController component = ((Component)self).GetComponent(); if (!Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)((Component)self).gameObject)) { component = ((Component)self).gameObject.AddComponent(); if (Object.op_Implicit((Object)(object)component)) { component.body = self; } } } private void onBodyStartGlobal_InitBuffs(CharacterBody body) { if (NetworkServer.active && Object.op_Implicit((Object)(object)body.master) && Object.op_Implicit((Object)(object)body.master.inventory) && body.master.inventory.GetItemCountEffective(ItemDef) > 0) { HitListKillCounterServer hitListKillCounterServer = ((Component)body.master).gameObject.GetComponent(); if (!Object.op_Implicit((Object)(object)hitListKillCounterServer)) { hitListKillCounterServer = ((Component)body.master).gameObject.AddComponent(); } hitListKillCounterServer.SetBuffsServer(); } } private void GlobalEventManager_onCharacterDeathGlobal(DamageReport damageReport) { //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)damageReport.victimBody) || !Object.op_Implicit((Object)(object)damageReport.victimBody.teamComponent) || !damageReport.victimBody.HasBuff(Buffs.HitListEnemyMarker) || !Object.op_Implicit((Object)(object)HitListMinigameController.instance)) { return; } TeamMask enemyTeams = TeamMask.GetEnemyTeams(HitListMinigameController.instance.teamIndex); if (((TeamMask)(ref enemyTeams)).HasTeam(damageReport.victimBody.teamComponent.teamIndex)) { IncrementHitListServer(); if (Object.op_Implicit((Object)(object)checkPrefab)) { EffectManager.SimpleEffect(checkPrefab, damageReport.victimBody.corePosition, Quaternion.identity, true); } } } private void onBodyInventoryChangedGlobal_RemoveBuffsServer(CharacterBody body) { if (NetworkServer.active && body.HasBuff(Buffs.HitListPlayerBuff) && (!Object.op_Implicit((Object)(object)body.inventory) || body.inventory.GetItemCountEffective(ItemBase.Instance.ItemDef) <= 0) && Object.op_Implicit((Object)(object)body.master)) { HitListKillCounterServer component = ((Component)body.master).GetComponent(); if (Object.op_Implicit((Object)(object)component)) { component.RemoveAllBuffsServer(); } } } private void onServerStageBegin_InitMinigame(Stage obj) { //IL_0026: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)HitListMinigameController.instance)) { Object.Destroy((Object)(object)((Component)HitListMinigameController.instance).gameObject); } if (Util.GetItemCountForTeam((TeamIndex)1, ItemDef.itemIndex, false, true) > 0) { InitializeHitListMinigameServer(); } } private void onInventoryChangedGlobal_SetupHitListServer(Inventory inv) { if (NetworkServer.active && inv.GetItemCountEffective(ItemDef) > 0) { if (!Object.op_Implicit((Object)(object)HitListMinigameController.instance)) { InitializeHitListMinigameServer(); } HitListKillCounterServer hitListKillCounterServer = ((Component)inv).gameObject.GetComponent(); if (!Object.op_Implicit((Object)(object)hitListKillCounterServer)) { hitListKillCounterServer = ((Component)inv).gameObject.AddComponent(); } hitListKillCounterServer.SetBuffsServer(); } } private void RecalculateStatsAPI_GetStatCoefficients(CharacterBody sender, StatHookEventArgs args) { int buffCount = sender.GetBuffCount(Buffs.HitListPlayerBuff); if (buffCount > 0) { args.baseDamageAdd += damagePerStack * (float)buffCount; } } private void InitializeHitListMinigameServer() { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Expected O, but got Unknown if (NetworkServer.active && !Object.op_Implicit((Object)(object)HitListMinigameController.instance)) { GameObject val = new GameObject(); val.AddComponent(); Object.Instantiate(val); } } public static void IncrementHitListServer() { //IL_0046: Unknown result type (might be due to invalid IL or missing references) if (!NetworkServer.active || !Object.op_Implicit((Object)(object)HitListMinigameController.instance)) { return; } int totalStacks = HitListMinigameController.instance.GetTotalStacks(); if (totalStacks <= 0) { return; } IEnumerable enumerable = from teamComponent in TeamComponent.GetTeamMembers(HitListMinigameController.instance.teamIndex) where Object.op_Implicit((Object)(object)teamComponent.body) && Object.op_Implicit((Object)(object)teamComponent.body.master) && Object.op_Implicit((Object)(object)teamComponent.body.inventory) && teamComponent.body.inventory.GetItemCountEffective(ItemBase.Instance.ItemDef) > 0 select teamComponent; foreach (TeamComponent item in enumerable) { HitListKillCounterServer hitListKillCounterServer = ((Component)item.body.master).GetComponent(); if (!Object.op_Implicit((Object)(object)hitListKillCounterServer)) { hitListKillCounterServer = ((Component)item.body.master).gameObject.AddComponent(); } hitListKillCounterServer.Increment(); } } protected override void CreateCraftableDef() { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Expected O, but got Unknown //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Expected O, but got Unknown //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Expected O, but got Unknown //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Expected O, but got Unknown //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Expected O, but got Unknown //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Expected O, but got Unknown //IL_01fb: Unknown result type (might be due to invalid IL or missing references) //IL_0202: Expected O, but got Unknown //IL_0214: Unknown result type (might be due to invalid IL or missing references) //IL_0219: Unknown result type (might be due to invalid IL or missing references) //IL_021f: Unknown result type (might be due to invalid IL or missing references) //IL_0224: Unknown result type (might be due to invalid IL or missing references) //IL_0233: Expected O, but got Unknown //IL_0235: Unknown result type (might be due to invalid IL or missing references) //IL_023a: Unknown result type (might be due to invalid IL or missing references) //IL_0247: Expected O, but got Unknown //IL_019a: Unknown result type (might be due to invalid IL or missing references) //IL_01a1: Expected O, but got Unknown //IL_01b3: Unknown result type (might be due to invalid IL or missing references) //IL_01b8: Unknown result type (might be due to invalid IL or missing references) //IL_01c9: Expected O, but got Unknown //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01d0: Unknown result type (might be due to invalid IL or missing references) //IL_01dd: Expected O, but got Unknown if (Object.op_Implicit((Object)(object)ItemDef)) { ItemDef pickup = Addressables.LoadAssetAsync((object)"RoR2/DLC2/Items/BarrageOnBoss/BarrageOnBoss.asset").WaitForCompletion(); Recipe val2; if (ItemBase.Instance != null && Object.op_Implicit((Object)(object)ItemBase.Instance.ItemDef)) { CraftableDef val = ScriptableObject.CreateInstance(); val.pickup = (Object)(object)ItemDef; Recipe[] array = new Recipe[1]; val2 = new Recipe(); val2.amountToDrop = 1; val2.ingredients = (RecipeIngredient[])(object)new RecipeIngredient[2] { new RecipeIngredient { pickup = (Object)(object)ItemBase.Instance.ItemDef }, new RecipeIngredient { pickup = (Object)(object)pickup } }; array[0] = val2; val.recipes = (Recipe[])(object)array; ((Object)val).name = "cdHitList"; PluginContentPack.craftableDefs.Add(val); } bool flag = ItemBase.Instance != null && Object.op_Implicit((Object)(object)ItemBase.Instance.ItemDef); bool flag2 = ItemBase.Instance != null && Object.op_Implicit((Object)(object)ItemBase.Instance.ItemDef); CraftableDef val3 = ScriptableObject.CreateInstance(); val3.pickup = (Object)(object)pickup; val3.recipes = (Recipe[])(object)new Recipe[0]; if (flag) { Recipe[] recipes = val3.recipes; val2 = new Recipe(); val2.amountToDrop = 1; val2.ingredients = (RecipeIngredient[])(object)new RecipeIngredient[2] { new RecipeIngredient { pickup = (Object)(object)ItemBase.Instance.ItemDef }, new RecipeIngredient { pickup = (Object)(object)ItemDef } }; val3.recipes = recipes.Append(val2).ToArray(); } if (flag2) { Recipe[] recipes2 = val3.recipes; val2 = new Recipe(); val2.amountToDrop = 1; val2.ingredients = (RecipeIngredient[])(object)new RecipeIngredient[2] { new RecipeIngredient { pickup = (Object)(object)ItemBase.Instance.ItemDef }, new RecipeIngredient { pickup = (Object)(object)ItemDef } }; val3.recipes = recipes2.Append(val2).ToArray(); } Recipe[] recipes3 = val3.recipes; val2 = new Recipe(); val2.amountToDrop = 1; val2.ingredients = (RecipeIngredient[])(object)new RecipeIngredient[2] { new RecipeIngredient { pickup = (Object)(object)Addressables.LoadAssetAsync((object)"RoR2/DLC1/GoldOnHurt/GoldOnHurt.asset").WaitForCompletion() }, new RecipeIngredient { pickup = (Object)(object)ItemDef } }; val3.recipes = recipes3.Append(val2).ToArray(); ((Object)val3).name = "cdHitListToWarBonds"; PluginContentPack.craftableDefs.Add(val3); } } } public class HitListMinigameController : MonoBehaviour { public static HitListMinigameController instance; public TeamIndex teamIndex = (TeamIndex)1; public static float markDuration = 5f; public static float markDelay = 5f; private float timer; private Xoroshiro128Plus rng; public int GetTotalStacks() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) return Util.GetItemCountForTeam(teamIndex, ItemBase.Instance.ItemDef.itemIndex, false, true); } private void Awake() { //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Expected O, but got Unknown timer = markDelay; if (NetworkServer.active && !Object.op_Implicit((Object)(object)instance) && Object.op_Implicit((Object)(object)Run.instance)) { instance = this; rng = new Xoroshiro128Plus(Run.instance.seed); Debug.Log((object)"ClassicItemsReturns: Initialized HitListMinigameController"); } else { Object.Destroy((Object)(object)((Component)this).gameObject); } } private void FixedUpdate() { if (NetworkServer.active) { timer -= Time.fixedDeltaTime; if (timer <= 0f) { timer += markDelay + markDuration; MarkEnemiesServer(); } } } private void OnDestroy() { if ((Object)(object)instance == (Object)(object)this) { instance = null; Debug.Log((object)"ClassicItemsReturns: Destroying HitListMinigameController"); } } public void ResetTimer() { timer = markDelay; } public void MarkEnemiesServer() { //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) if (!NetworkServer.active) { return; } if (GetTotalStacks() <= 0) { Object.Destroy((Object)(object)((Component)this).gameObject); return; } int totalStacks = GetTotalStacks(); List list = CharacterBody.readOnlyInstancesList.Where(delegate(CharacterBody body) { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)body)) { return false; } if (Object.op_Implicit((Object)(object)body.teamComponent)) { TeamMask enemyTeams = TeamMask.GetEnemyTeams(teamIndex); if (((TeamMask)(ref enemyTeams)).HasTeam(body.teamComponent.teamIndex)) { if (((Enum)body.bodyFlags).HasFlag((Enum)(object)(BodyFlags)4) || !((Object)(object)body.master != (Object)null)) { return false; } bool flag = Object.op_Implicit((Object)(object)body.healthComponent) && body.healthComponent.alive; bool flag2 = !body.HasBuff(Buffs.Immune); bool flag3 = !body.disablingHurtBoxes; bool flag4 = !Object.op_Implicit((Object)(object)((Component)body).GetComponent()); return flag && flag2 && flag3 && flag4; } } return false; }).ToList(); totalStacks = Mathf.Min(list.Count, totalStacks); while (totalStacks > 0) { int index = rng.RangeInt(0, list.Count); CharacterBody val = list[index]; val.AddTimedBuff(Buffs.HitListEnemyMarker, markDuration); list.Remove(val); totalStacks--; if (Object.op_Implicit((Object)(object)HitList.markEnemySound)) { EffectManager.SimpleSoundEffect(HitList.markEnemySound.index, val.corePosition, true); } } } } public class HitListKillCounterServer : MonoBehaviour { private CharacterMaster master; public int killCount = 0; public void Increment() { killCount++; SetBuffsServer(); } public void SetBuffsServer() { if (!NetworkServer.active || killCount <= 0) { return; } if (!Object.op_Implicit((Object)(object)master)) { master = ((Component)this).GetComponent(); if (!Object.op_Implicit((Object)(object)master)) { return; } } if (!Object.op_Implicit((Object)(object)master.inventory) || master.inventory.GetItemCountEffective(ItemBase.Instance.ItemDef) <= 0) { return; } CharacterBody body = master.GetBody(); if (!Object.op_Implicit((Object)(object)body)) { return; } int buffCount = body.GetBuffCount(Buffs.HitListPlayerBuff); if (buffCount < killCount) { for (int i = 0; i < killCount - buffCount; i++) { body.AddBuff(Buffs.HitListPlayerBuff); } } } public void RemoveAllBuffsServer() { if (!NetworkServer.active) { return; } if (!Object.op_Implicit((Object)(object)master)) { master = ((Component)this).GetComponent(); if (!Object.op_Implicit((Object)(object)master)) { return; } } CharacterBody body = master.GetBody(); if (Object.op_Implicit((Object)(object)body)) { int buffCount = body.GetBuffCount(Buffs.HitListPlayerBuff); for (int i = 0; i < buffCount; i++) { body.RemoveBuff(Buffs.HitListPlayerBuff); } } } } public class BodyHitListMarkerController : MonoBehaviour { private GameObject markerInstance; public CharacterBody body; private bool destroying = false; private void Start() { if (!Object.op_Implicit((Object)(object)markerInstance)) { markerInstance = Object.Instantiate(HitList.markerPrefab, ((Component)this).transform); } } private void FixedUpdate() { if (!destroying && Object.op_Implicit((Object)(object)body)) { bool flag = body.HasBuff(Buffs.HitListEnemyMarker); bool flag2 = Object.op_Implicit((Object)(object)body.healthComponent) && body.healthComponent.alive; destroying = !flag || !flag2; if (destroying) { Object.Destroy((Object)(object)this); } } } private void OnDestroy() { if (Object.op_Implicit((Object)(object)markerInstance)) { Object.Destroy((Object)(object)markerInstance); } } } public class FadeOverDuration : MonoBehaviour { public float initialDelay = 1f; public float fadeTime = 1f; private float stopwatch; private float initialAlpha = 1f; private SpriteRenderer renderer; private void Awake() { //IL_002f: Unknown result type (might be due to invalid IL or missing references) stopwatch = 0f; renderer = ((Component)this).GetComponentInChildren(); if (Object.op_Implicit((Object)(object)renderer)) { initialAlpha = renderer.color.a; } if (!Object.op_Implicit((Object)(object)renderer)) { Object.Destroy((Object)(object)this); } } private void Update() { //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_006a: 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) if (stopwatch >= initialDelay + fadeTime) { Object.Destroy((Object)(object)((Component)this).gameObject); return; } stopwatch += Time.deltaTime; renderer.color = new Color(renderer.color.r, renderer.color.g, renderer.color.b, Mathf.Lerp(1f, 0f, (stopwatch - initialAlpha) / fadeTime)); } } public class HyperThreader : ItemBase { private float chance = 100f; private float damageCoeff = 0.8f; private float bounceRange = 30f; private int bounceCount = 2; private int bounceCountPerStack = 1; public static GameObject orbEffect; public static NetworkSoundEventDef procSound; public override string ItemName => "Hyper-Threader"; public override string ItemLangTokenName => "HYPERTHREADER"; public override object[] ItemFullDescriptionParams => new object[4] { chance, damageCoeff * 100f, bounceCount, bounceCountPerStack }; public override ItemTier Tier => (ItemTier)2; public override GameObject ItemModel => LoadItemModel("HyperThreader"); public override Sprite ItemIcon => LoadItemSprite("HyperThreader"); public override ItemTag[] ItemTags { get { ItemTag[] array = new ItemTag[4]; RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); return (ItemTag[])(object)array; } } public override void CreateAssets(ConfigFile config) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Expected O, but got Unknown orbEffect = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync((object)"RoR2/DLC1/DroneWeapons/ChainGunOrbEffect.prefab").WaitForCompletion(), "CIR_HyperThreaderOrbEffect", false); TrailRenderer component = ((Component)orbEffect.transform.Find("TrailParent/Trail")).GetComponent(); component.startColor = Color.red; component.endColor = Color.red; PluginContentPack.effectDefs.Add(new EffectDef(orbEffect)); procSound = Assets.CreateNetworkSoundEventDef("Play_ClassicItemsReturns_Reflect"); } public override ItemDisplayRuleDict CreateItemDisplayRules() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown return new ItemDisplayRuleDict(Array.Empty()); } public override void Hooks() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Expected O, but got Unknown ProcessHitEnemy.OnHitAttackerActions = (OnHitAttacker)Delegate.Combine((Delegate?)(object)ProcessHitEnemy.OnHitAttackerActions, (Delegate?)new OnHitAttacker(OnHit)); } private void OnHit(DamageInfo damageInfo, CharacterBody victimBody, CharacterBody attackerBody) { //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Expected O, but got Unknown //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_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_0144: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)attackerBody.inventory)) { int itemCountEffective = attackerBody.inventory.GetItemCountEffective(ItemDef); if (itemCountEffective > 0 && (Util.CheckRoll(chance * damageInfo.procCoefficient, attackerBody.master) || ((ProcChainMask)(ref damageInfo.procChainMask)).HasProc((ProcType)26))) { int bouncesRemaining = ItemHelpers.StackingLinear(itemCountEffective, bounceCount, bounceCountPerStack); ChainGunOrb val = new ChainGunOrb(orbEffect); ((GenericDamageOrb)val).damageValue = attackerBody.damage * damageCoeff; ((GenericDamageOrb)val).isCrit = damageInfo.crit; ((GenericDamageOrb)val).teamIndex = attackerBody.teamComponent.teamIndex; ((GenericDamageOrb)val).attacker = ((Component)attackerBody).gameObject; ((GenericDamageOrb)val).procCoefficient = 0f; ((GenericDamageOrb)val).procChainMask = damageInfo.procChainMask; ((Orb)val).origin = attackerBody.corePosition; ((GenericDamageOrb)val).speed = 150f; val.bouncesRemaining = bouncesRemaining; val.bounceRange = bounceRange; val.damageCoefficientPerBounce = 1f; val.targetsToFindPerBounce = 1; val.canBounceOnSameTarget = false; ((GenericDamageOrb)val).damageColorIndex = (DamageColorIndex)3; ((GenericDamageOrb)val).damageType = new DamageTypeCombo { damageTypeExtended = (DamageTypeExtended)8192 }; ((Orb)val).target = victimBody.mainHurtBox; OrbManager.instance.AddOrb((Orb)(object)val); EntitySoundManager.EmitSoundServer(procSound.index, damageInfo.attacker); } } } protected override void CreateCraftableDef() { //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Expected O, but got Unknown //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Expected O, but got Unknown //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Expected O, but got Unknown //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Expected O, but got Unknown //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Expected O, but got Unknown //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Expected O, but got Unknown //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Expected O, but got Unknown //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_0191: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Unknown result type (might be due to invalid IL or missing references) //IL_01ab: Expected O, but got Unknown //IL_01ad: Unknown result type (might be due to invalid IL or missing references) //IL_01b2: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Expected O, but got Unknown //IL_01ed: Unknown result type (might be due to invalid IL or missing references) //IL_01f4: Expected O, but got Unknown //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_020b: Unknown result type (might be due to invalid IL or missing references) //IL_021c: Expected O, but got Unknown //IL_021e: Unknown result type (might be due to invalid IL or missing references) //IL_0223: Unknown result type (might be due to invalid IL or missing references) //IL_0234: Expected O, but got Unknown if (!Object.op_Implicit((Object)(object)ItemDef)) { return; } bool flag = ItemBase.Instance != null && Object.op_Implicit((Object)(object)ItemBase.Instance.ItemDef); bool flag2 = ItemBase.Instance != null && Object.op_Implicit((Object)(object)ItemBase.Instance.ItemDef); if (flag || flag2) { CraftableDef val = ScriptableObject.CreateInstance(); val.pickup = (Object)(object)ItemDef; val.recipes = (Recipe[])(object)new Recipe[0]; if (flag) { Recipe[] recipes = val.recipes; Recipe val2 = new Recipe(); val2.amountToDrop = 1; val2.ingredients = (RecipeIngredient[])(object)new RecipeIngredient[2] { new RecipeIngredient { pickup = (Object)(object)Addressables.LoadAssetAsync((object)"RoR2/Base/ShockNearby/ShockNearby.asset").WaitForCompletion() }, new RecipeIngredient { pickup = (Object)(object)ItemBase.Instance.ItemDef } }; val.recipes = recipes.Append(val2).ToArray(); Recipe[] recipes2 = val.recipes; val2 = new Recipe(); val2.amountToDrop = 1; val2.ingredients = (RecipeIngredient[])(object)new RecipeIngredient[2] { new RecipeIngredient { pickup = (Object)(object)Addressables.LoadAssetAsync((object)"RoR2/Base/Lightning/Lightning.asset").WaitForCompletion() }, new RecipeIngredient { pickup = (Object)(object)ItemBase.Instance.ItemDef } }; val.recipes = recipes2.Append(val2).ToArray(); } if (flag2) { Recipe[] recipes3 = val.recipes; Recipe val2 = new Recipe(); val2.amountToDrop = 1; val2.ingredients = (RecipeIngredient[])(object)new RecipeIngredient[2] { new RecipeIngredient { pickup = (Object)(object)Addressables.LoadAssetAsync((object)"RoR2/Base/GoldGat/GoldGat.asset").WaitForCompletion() }, new RecipeIngredient { pickup = (Object)(object)ItemBase.Instance.ItemDef } }; val.recipes = recipes3.Append(val2).ToArray(); } if (flag2 && flag) { Recipe[] recipes4 = val.recipes; Recipe val2 = new Recipe(); val2.amountToDrop = 1; val2.ingredients = (RecipeIngredient[])(object)new RecipeIngredient[2] { new RecipeIngredient { pickup = (Object)(object)ItemBase.Instance.ItemDef }, new RecipeIngredient { pickup = (Object)(object)ItemBase.Instance.ItemDef } }; val.recipes = recipes4.Append(val2).ToArray(); } ((Object)val).name = "cdHyperThreader"; PluginContentPack.craftableDefs.Add(val); } } } public class Permafrost : ItemBase { private float procChancePercentage = 3f; public bool allowFreezeBoss = false; public static HashSet ModdedFreezeDebuffs = new HashSet(); public override string ItemName => "Permafrost"; public override string ItemLangTokenName => "PERMAFROST"; public override object[] ItemFullDescriptionParams => new object[1] { procChancePercentage }; public override ItemTier Tier => (ItemTier)2; public override GameObject ItemModel => LoadItemModel("IceCube"); public override Sprite ItemIcon => LoadItemSprite("IceCube"); public override ItemTag[] ItemTags { get { ItemTag[] array = new ItemTag[4]; RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); return (ItemTag[])(object)array; } } public override ItemDisplayRuleDict CreateItemDisplayRules() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown return new ItemDisplayRuleDict(Array.Empty()); } public override void CreateConfig(ConfigFile config) { allowFreezeBoss = config.Bind(base.ConfigCategory, "Freeze Bosses", false, "Allow this item to freeze bosses.").Value; } protected override void CreateCraftableDef() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Expected O, but got Unknown //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_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_0073: Expected O, but got Unknown //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Expected O, but got Unknown if (Object.op_Implicit((Object)(object)ItemDef)) { CraftableDef val = ScriptableObject.CreateInstance(); val.pickup = (Object)(object)Addressables.LoadAssetAsync((object)"RoR2/Base/Icicle/Icicle.asset").WaitForCompletion(); Recipe[] array = new Recipe[1]; Recipe val2 = new Recipe(); val2.amountToDrop = 1; val2.ingredients = (RecipeIngredient[])(object)new RecipeIngredient[2] { new RecipeIngredient { pickup = (Object)(object)Addressables.LoadAssetAsync((object)"RoR2/Base/NearbyDamageBonus/NearbyDamageBonus.asset").WaitForCompletion() }, new RecipeIngredient { pickup = (Object)(object)ItemDef } }; array[0] = val2; val.recipes = (Recipe[])(object)array; PluginContentPack.craftableDefs.Add(val); } } public override void Hooks() { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Expected O, but got Unknown RoR2Application.onLoad = (Action)Delegate.Combine(RoR2Application.onLoad, new Action(GetModdedFreezeDebuffs)); SetStateOnHurt.OnTakeDamageServer += new hook_OnTakeDamageServer(SetStateOnHurt_OnTakeDamageServer); } private void SetStateOnHurt_OnTakeDamageServer(orig_OnTakeDamageServer orig, SetStateOnHurt self, DamageReport damageReport) { //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_0136: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self, damageReport); if (!Object.op_Implicit((Object)(object)self.targetStateMachine) || !self.spawnedOverNetwork || damageReport.damageInfo.procCoefficient <= 0f || !Object.op_Implicit((Object)(object)damageReport.attackerMaster) || !Object.op_Implicit((Object)(object)damageReport.attackerMaster.inventory)) { return; } DamageInfo damageInfo = damageReport.damageInfo; Inventory inventory = damageReport.attackerMaster.inventory; int itemCountEffective = inventory.GetItemCountEffective(ItemDef); if (itemCountEffective <= 0 || (!Util.CheckRoll(procChancePercentage * (float)itemCountEffective, damageReport.attackerMaster) && !((ProcChainMask)(ref damageInfo.procChainMask)).HasProc((ProcType)26))) { return; } float num = 2f * damageReport.damageInfo.procCoefficient; if (self.canBeFrozen && (!damageReport.victimIsChampion || allowFreezeBoss)) { self.SetFrozen(num); } else { if (!Object.op_Implicit((Object)(object)damageReport.victimBody)) { return; } foreach (BuffIndex moddedFreezeDebuff in ModdedFreezeDebuffs) { damageReport.victimBody.AddTimedBuff(moddedFreezeDebuff, num); } } } private void GetModdedFreezeDebuffs() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Invalid comparison between Unknown and I4 //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Invalid comparison between Unknown and I4 //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) BuffIndex val = BuffCatalog.FindBuffIndex("RiskyMod_FreezeDebuff"); if ((int)val != -1) { ModdedFreezeDebuffs.Add(val); } val = BuffCatalog.FindBuffIndex("Freeze Debuff"); if ((int)val != -1) { ModdedFreezeDebuffs.Add(val); } } } public class Thallium : ItemBase { public float chance = 10f; public float enemyAttackDamageCoef = 3f; public float enemyMoveSpeedCoef = 1f; public float duration = 3f; public float durationPerStack = 1.5f; public float dotInterval = 0.5f; public static GameObject thalliumTickEffect; public override string ItemName => "Thallium"; public override string ItemLangTokenName => "THALLIUM"; public override object[] ItemFullDescriptionParams => new object[6] { chance, enemyAttackDamageCoef * 100f, enemyMoveSpeedCoef * 100f, duration, durationPerStack, (object)(ItemTag)31 }; public override ItemTier Tier => (ItemTier)2; public override GameObject ItemModel => LoadItemModel("Thallium"); public override Sprite ItemIcon => LoadItemSprite("Thallium"); public override ItemTag[] ItemTags => (ItemTag[])(object)new ItemTag[2] { (ItemTag)1, (ItemTag)4 }; public override void CreateConfig(ConfigFile config) { } public override void CreateAssets(ConfigFile config) { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Expected O, but got Unknown GameObject val = Assets.LoadAddressable("RoR2/Base/DeathProjectile/DeathProjectileTickEffect.prefab"); thalliumTickEffect = PrefabAPI.InstantiateClone(val, "ThalliumProcEffect", false); thalliumTickEffect.transform.localScale = Vector3.one * 0.5f; MainModule main = ((Component)thalliumTickEffect.transform.Find("DarkWisps01Ring_Ps")).GetComponent().main; ((MainModule)(ref main)).simulationSpeed = ((MainModule)(ref main)).simulationSpeed * 4f; Object.Destroy((Object)(object)((Component)thalliumTickEffect.transform.Find("FlarePersitant_Ps")).gameObject); Object.Destroy((Object)(object)((Component)thalliumTickEffect.transform.Find("WispsBurst_Ps")).gameObject); PluginContentPack.effectDefs.Add(new EffectDef(thalliumTickEffect)); } public override ItemDisplayRuleDict CreateItemDisplayRules() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown return new ItemDisplayRuleDict(Array.Empty()); } public override void Hooks() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Expected O, but got Unknown //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Expected O, but got Unknown ProcessHitEnemy.OnHitAttackerActions = (OnHitAttacker)Delegate.Combine((Delegate?)(object)ProcessHitEnemy.OnHitAttackerActions, (Delegate?)new OnHitAttacker(ApplyThallium)); RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(RecalculateStatsAPI_GetStatCoefficients); } private void ApplyThallium(DamageInfo damageInfo, CharacterBody victimBody, CharacterBody attackerBody) { //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: 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_00d8: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)attackerBody.inventory)) { int itemCountEffective = attackerBody.inventory.GetItemCountEffective(ItemDef); if (itemCountEffective > 0 && (Util.CheckRoll(chance * damageInfo.procCoefficient, attackerBody.master) || ((ProcChainMask)(ref damageInfo.procChainMask)).HasProc((ProcType)26))) { int num = itemCountEffective - 1; float num2 = ItemHelpers.StackingLinear(itemCountEffective, ItemBase.Instance.duration, durationPerStack); InflictDotInfo val = default(InflictDotInfo); val.attackerObject = damageInfo.attacker; val.dotIndex = Dots.Thallium.CIR_ThalliumDotIndex; val.maxStacksFromAttacker = 1u; val.victimObject = ((Component)victimBody).gameObject; val.duration = duration; InflictDotInfo val2 = val; DotController.InflictDot(ref val2); } } } private void RecalculateStatsAPI_GetStatCoefficients(CharacterBody sender, StatHookEventArgs args) { if (sender.HasBuff(Buffs.ThalliumBuff)) { args.moveSpeedReductionMultAdd += enemyMoveSpeedCoef; } } } public class USB : ItemBase { public static int maxPlacementAttemptsPerStage = 10; private static int placementAttempts = 0; public static GameObject atlasCannonNetworkPrefab; public static GameObject teleporterVisualNetworkPrefab; public static GameObject atlasCannonInteractablePrefab; public static InteractableSpawnCard atlasCannonSpawnCard; public static NetworkSoundEventDef atlasCannonFireSound; public static HashSet atlasCannonScriptedCombatEncounterSceneBlacklist = new HashSet { "goldshores", "limbo" }; public static HashSet atlasCannonInteractableSceneForceRandomPlacement = new HashSet { "goldshores", "moon", "moon2" }; public static Dictionary atlasCannonInteractableManualPlacementDict = new Dictionary { { "voidraid", new Vector3(0f, 217f, -443f) }, { "meridian", new Vector3(78f, 35f, -94f) }, { "solutionalhaunt", new Vector3(173f, -54.7f, 151f) } }; public static bool cannonSpawned = false; public static bool cannonActivated = false; private static bool addedTeleporterVisual = false; public static bool firedCannon = false; private static GameObject teleporterVisualNetworkInstance; public override string ItemName => "Classified Access Codes"; public override string ItemLangTokenName => "USB"; public override ItemTier Tier => (ItemTier)2; public override GameObject ItemModel => LoadItemModel("USB"); public override Sprite ItemIcon => LoadItemSprite("USB"); public override ItemTag[] ItemTags { get { ItemTag[] array = new ItemTag[4]; RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); return (ItemTag[])(object)array; } } public override ItemDisplayRuleDict CreateItemDisplayRules() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown return new ItemDisplayRuleDict(Array.Empty()); } public override void Hooks() { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Expected O, but got Unknown //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Expected O, but got Unknown //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Expected O, but got Unknown //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Expected O, but got Unknown Stage.onStageStartGlobal += Stage_onStageStartGlobal; ChargingState.OnEnter += new hook_OnEnter(ChargingState_OnEnter); TeleporterInteraction.Start += new hook_Start(TeleporterInteraction_Start); GoldshoresBossfight.SetBossImmunity += new hook_SetBossImmunity(GoldshoresBossfight_SetBossImmunity); ScriptedCombatEncounter.Spawn += new hook_Spawn(ScriptedCombatEncounter_Spawn); SceneDirector.PopulateScene += new hook_PopulateScene(SceneDirector_PopulateScene); CharacterBody.OnInventoryChanged += new hook_OnInventoryChanged(CharacterBody_OnInventoryChanged); } public static float CalcDamagePercent(int itemCount) { itemCount = Mathf.Max(itemCount, 1); return 1f - 0.6f * Mathf.Pow(0.8f, (float)(itemCount - 1)); } public override void CreateAssets(ConfigFile config) { //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_01c8: Unknown result type (might be due to invalid IL or missing references) //IL_01de: Unknown result type (might be due to invalid IL or missing references) atlasCannonFireSound = Assets.CreateNetworkSoundEventDef("Play_captain_utility_variant_impact"); atlasCannonNetworkPrefab = Assets.LoadObject("AtlasCannonTarget"); atlasCannonNetworkPrefab.AddComponent(); atlasCannonNetworkPrefab.AddComponent(); AtlasCannonController atlasCannonController = atlasCannonNetworkPrefab.AddComponent(); atlasCannonNetworkPrefab.AddComponent().duration = atlasCannonController.delayBeforeFiring + atlasCannonController.lifetimeAfterFiring + 2f; PrefabAPI.RegisterNetworkPrefab(atlasCannonNetworkPrefab); teleporterVisualNetworkPrefab = Assets.LoadObject("AtlasCannonTeleporterVisual"); teleporterVisualNetworkPrefab.AddComponent(); teleporterVisualNetworkPrefab.AddComponent(); PrefabAPI.RegisterNetworkPrefab(teleporterVisualNetworkPrefab); atlasCannonInteractablePrefab = Assets.LoadObject("AtlasCannonInteractable"); atlasCannonInteractablePrefab.AddComponent(); ChildLocator component = atlasCannonInteractablePrefab.GetComponent(); Transform val = component.FindChild("Model"); Highlight val2 = atlasCannonInteractablePrefab.AddComponent(); val2.targetRenderer = (Renderer)(object)((Component)val).GetComponent(); val2.strength = 1f; val2.highlightColor = (HighlightColor)0; val2.isOn = false; PurchaseInteraction val3 = atlasCannonInteractablePrefab.AddComponent(); val3.cost = 0; val3.costType = (CostTypeIndex)0; val3.displayNameToken = "CLASSICITEMSRETURNS_INTERACTABLE_ATLASCANNON_NAME"; val3.contextToken = "CLASSICITEMSRETURNS_INTERACTABLE_ATLASCANNON_CONTEXT"; val3.setUnavailableOnTeleporterActivated = true; val3.isShrine = true; val3.isGoldShrine = false; val3.ignoreSpherecastForInteractability = false; val3.available = true; atlasCannonInteractablePrefab.AddComponent(); EntityLocator val4 = atlasCannonInteractablePrefab.AddComponent(); val4.entity = atlasCannonInteractablePrefab; PrefabAPI.RegisterNetworkPrefab(atlasCannonInteractablePrefab); atlasCannonSpawnCard = ScriptableObject.CreateInstance(); atlasCannonSpawnCard.maxSpawnsPerStage = 1; ((SpawnCard)atlasCannonSpawnCard).occupyPosition = true; ((SpawnCard)atlasCannonSpawnCard).prefab = atlasCannonInteractablePrefab; atlasCannonSpawnCard.slightlyRandomizeOrientation = false; ((SpawnCard)atlasCannonSpawnCard).requiredFlags = (NodeFlags)0; atlasCannonSpawnCard.orientToFloor = false; ((SpawnCard)atlasCannonSpawnCard).hullSize = (HullClassification)0; ((SpawnCard)atlasCannonSpawnCard).sendOverNetwork = false; } public static void PlaceAtlasCannonInteractable(Xoroshiro128Plus rng) { //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Expected O, but got Unknown //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Expected O, but got Unknown //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Expected O, but got Unknown if (NetworkServer.active && !cannonSpawned && placementAttempts < maxPlacementAttemptsPerStage && Util.GetItemCountForTeam((TeamIndex)1, ItemBase.Instance.ItemDef.itemIndex, false, true) > 0) { placementAttempts++; GameObject val = null; DirectorPlacementRule val2 = null; bool flag = false; SceneDef sceneDefForCurrentScene = SceneCatalog.GetSceneDefForCurrentScene(); if (Object.op_Implicit((Object)(object)TeleporterInteraction.instance) || (Object.op_Implicit((Object)(object)sceneDefForCurrentScene) && atlasCannonInteractableSceneForceRandomPlacement.Contains(sceneDefForCurrentScene.cachedName))) { val2 = new DirectorPlacementRule { placementMode = (PlacementMode)4 }; } else if (Object.op_Implicit((Object)(object)sceneDefForCurrentScene) && atlasCannonInteractableManualPlacementDict.ContainsKey(sceneDefForCurrentScene.cachedName)) { atlasCannonInteractableManualPlacementDict.TryGetValue(sceneDefForCurrentScene.cachedName, out var value); val2 = new DirectorPlacementRule { placementMode = (PlacementMode)0, position = value }; } if (val2 != null) { val = DirectorCore.instance.TrySpawnObject(new DirectorSpawnRequest((SpawnCard)(object)atlasCannonSpawnCard, val2, rng)); } if (Object.op_Implicit((Object)(object)val)) { Debug.Log((object)"ClassicItemsReturns: Placed Atlas Cannon interactable."); } else { Debug.LogError((object)"ClassicItemsReturns: Failed to place Atlas Cannon interactable."); } if (!cannonSpawned) { cannonSpawned = (Object)(object)val != (Object)null; } } } private void CharacterBody_OnInventoryChanged(orig_OnInventoryChanged orig, CharacterBody self) { //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Expected O, but got Unknown orig.Invoke(self); if (NetworkServer.active && !cannonSpawned && self.inventory.GetItemCountEffective(ItemDef) > 0 && Object.op_Implicit((Object)(object)Run.instance)) { PlaceAtlasCannonInteractable(new Xoroshiro128Plus(Run.instance.seed)); } } private void SceneDirector_PopulateScene(orig_PopulateScene orig, SceneDirector self) { orig.Invoke(self); placementAttempts = 0; cannonSpawned = false; PlaceAtlasCannonInteractable(self.rng); } private void ScriptedCombatEncounter_Spawn(orig_Spawn orig, ScriptedCombatEncounter self, ref SpawnInfo spawnInfo) { orig.Invoke(self, ref spawnInfo); SceneDef sceneDefForCurrentScene = SceneCatalog.GetSceneDefForCurrentScene(); if (!Object.op_Implicit((Object)(object)sceneDefForCurrentScene) || Object.op_Implicit((Object)(object)TeleporterInteraction.instance) || atlasCannonScriptedCombatEncounterSceneBlacklist.Contains(sceneDefForCurrentScene.cachedName)) { return; } if (cannonActivated && !firedCannon) { foreach (CharacterMaster readOnlyInstances in CharacterMaster.readOnlyInstancesList) { TargetCannon(readOnlyInstances); } } firedCannon = true; } private void GoldshoresBossfight_SetBossImmunity(orig_SetBossImmunity orig, GoldshoresBossfight self, bool newBossImmunity) { orig.Invoke(self, newBossImmunity); if (!NetworkServer.active || newBossImmunity || firedCannon || !cannonActivated) { return; } firedCannon = true; foreach (CharacterMaster readOnlyMembers in self.scriptedCombatEncounter.combatSquad.readOnlyMembersList) { TargetCannonIgnoreBossCheck(readOnlyMembers); } } private void TeleporterInteraction_Start(orig_Start orig, TeleporterInteraction self) { orig.Invoke(self); if (NetworkServer.active && Object.op_Implicit((Object)(object)self.bossGroup) && Object.op_Implicit((Object)(object)self.bossGroup.combatSquad)) { self.bossGroup.combatSquad.onMemberAddedServer += TargetCannonIgnoreBossCheck; } } private void TargetCannon(CharacterMaster master) { //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) if (!NetworkServer.active || !cannonActivated) { return; } CharacterBody body = master.GetBody(); if (!Object.op_Implicit((Object)(object)body) || (!body.isChampion && !body.isBoss) || !Object.op_Implicit((Object)(object)body.healthComponent) || !Object.op_Implicit((Object)(object)body.teamComponent)) { return; } TeamMask enemyTeams = TeamMask.GetEnemyTeams((TeamIndex)1); if (((TeamMask)(ref enemyTeams)).HasTeam(body.teamComponent.teamIndex)) { GameObject val = Object.Instantiate(atlasCannonNetworkPrefab, body.transform); AtlasCannonController component = val.GetComponent(); if (Object.op_Implicit((Object)(object)component)) { component.targetHealthComponent = body.healthComponent; } NetworkServer.Spawn(val); } } private void TargetCannonIgnoreBossCheck(CharacterMaster master) { //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) if (!NetworkServer.active || !cannonActivated) { return; } CharacterBody body = master.GetBody(); if (Object.op_Implicit((Object)(object)body) && Object.op_Implicit((Object)(object)body.healthComponent) && Object.op_Implicit((Object)(object)body.teamComponent)) { TeamMask enemyTeams = TeamMask.GetEnemyTeams((TeamIndex)1); if (((TeamMask)(ref enemyTeams)).HasTeam(body.teamComponent.teamIndex)) { GameObject val = Object.Instantiate(atlasCannonNetworkPrefab, body.transform); AtlasCannonController component = val.GetComponent(); if (Object.op_Implicit((Object)(object)component)) { component.targetHealthComponent = body.healthComponent; } NetworkServer.Spawn(val); } } firedCannon = true; } public static void AddTeleporterVisualServer() { //IL_0098: Unknown result type (might be due to invalid IL or missing references) if (NetworkServer.active && Object.op_Implicit((Object)(object)TeleporterInteraction.instance) && !(((object)TeleporterInteraction.instance.currentState).GetType() != typeof(IdleState))) { if (Object.op_Implicit((Object)(object)teleporterVisualNetworkInstance)) { Object.Destroy((Object)(object)teleporterVisualNetworkInstance); teleporterVisualNetworkInstance = null; } teleporterVisualNetworkInstance = Object.Instantiate(teleporterVisualNetworkPrefab); AtlasTeleporterBeamController component = teleporterVisualNetworkInstance.GetComponent(); if (Object.op_Implicit((Object)(object)component)) { component.SetPosServer(((Component)TeleporterInteraction.instance).transform.position); } NetworkServer.Spawn(teleporterVisualNetworkInstance); } } private void ChargingState_OnEnter(orig_OnEnter orig, ChargingState self) { orig.Invoke(self); cannonSpawned = true; if (NetworkServer.active && Object.op_Implicit((Object)(object)teleporterVisualNetworkInstance)) { Object.Destroy((Object)(object)teleporterVisualNetworkInstance); teleporterVisualNetworkInstance = null; } } private void Stage_onStageStartGlobal(Stage obj) { placementAttempts = 0; cannonActivated = false; addedTeleporterVisual = false; firedCannon = false; } } public class AtlasCannonController : NetworkBehaviour { public float delayBeforeFiring = 5f; public float lifetimeAfterFiring = 1f; public HealthComponent targetHealthComponent; public float laserFireWidth = 15f; [SyncVar] private bool _hasFired = false; private bool hasFiredLocal = false; private LineRenderer laser; private SpriteRenderer crosshairRenderer; private SpriteRenderer rotatorRenderer; private Transform rotatorTransform; private float stopwatch; private float rotationStopwatch; private float laserFadeStopwatch; public bool Network_hasFired { get { return _hasFired; } [param: In] set { ((NetworkBehaviour)this).SetSyncVar(value, ref _hasFired, 1u); } } private void Awake() { ChildLocator component = ((Component)this).GetComponent(); if (Object.op_Implicit((Object)(object)component)) { Transform val = component.FindChild("Crosshair"); if (Object.op_Implicit((Object)(object)val)) { crosshairRenderer = ((Component)val).GetComponent(); } rotatorTransform = component.FindChild("Rotator"); if (Object.op_Implicit((Object)(object)rotatorTransform)) { rotatorRenderer = ((Component)rotatorTransform).GetComponent(); } Transform val2 = component.FindChild("Laser"); if (Object.op_Implicit((Object)(object)val2)) { laser = ((Component)val2).GetComponent(); } } stopwatch = 0f; rotationStopwatch = 0f; laserFadeStopwatch = 0f; } private void FixedUpdate() { if (_hasFired && !hasFiredLocal) { hasFiredLocal = true; if (Object.op_Implicit((Object)(object)crosshairRenderer)) { ((Renderer)crosshairRenderer).enabled = false; } if (Object.op_Implicit((Object)(object)rotatorRenderer)) { ((Renderer)rotatorRenderer).enabled = false; } laser.widthMultiplier = laserFireWidth; stopwatch = 0f; } if (NetworkServer.active) { FixedUpdateServer(); } } private void FixedUpdateServer() { if (!Object.op_Implicit((Object)(object)targetHealthComponent) || !targetHealthComponent.alive) { Object.Destroy((Object)(object)((Component)this).gameObject); return; } stopwatch += Time.fixedDeltaTime; if (!_hasFired) { if (stopwatch >= delayBeforeFiring) { FireCannonServer(); } } else if (hasFiredLocal && stopwatch >= lifetimeAfterFiring) { Object.Destroy((Object)(object)((Component)this).gameObject); } } private void FireCannonServer() { //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Expected O, but got Unknown //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) if (!NetworkServer.active) { return; } Network_hasFired = true; if (Object.op_Implicit((Object)(object)targetHealthComponent)) { int itemCount = Mathf.Max(1, Util.GetItemCountForTeam((TeamIndex)1, ItemBase.Instance.ItemDef.itemIndex, false, true)); float num = targetHealthComponent.fullCombinedHealth * USB.CalcDamagePercent(itemCount); if (Object.op_Implicit((Object)(object)targetHealthComponent.body) && (targetHealthComponent.body.bodyIndex == BodyPrefabs.SolusWingBody.bodyIndex || targetHealthComponent.body.bodyIndex == BodyPrefabs.SolusHeartBody.bodyIndex)) { num /= 3f; } Vector3 val = (Object.op_Implicit((Object)(object)targetHealthComponent.body) ? targetHealthComponent.body.corePosition : ((Component)this).transform.position); DamageInfo val2 = new DamageInfo { damage = num, damageType = DamageTypeCombo.op_Implicit((DamageType)66), attacker = null, canRejectForce = true, force = Vector3.zero, crit = false, damageColorIndex = (DamageColorIndex)3, dotIndex = (DotIndex)(-1), inflictor = ((Component)this).gameObject, position = val, procChainMask = default(ProcChainMask), procCoefficient = 0f }; targetHealthComponent.TakeDamage(val2); EffectManager.SimpleSoundEffect(USB.atlasCannonFireSound.index, val, true); } } private void Update() { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: 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_00e7: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)laser)) { laser.SetPositions((Vector3[])(object)new Vector3[2] { ((Component)this).transform.position + Vector3.up * 1000f, ((Component)this).transform.position + Vector3.down * 1000f }); } if (!hasFiredLocal) { if (Object.op_Implicit((Object)(object)rotatorTransform)) { rotationStopwatch += Time.deltaTime; if (rotationStopwatch >= 2f) { rotationStopwatch -= 2f; } rotatorTransform.localRotation = Quaternion.Euler(new Vector3(0f, 0f, 360f * rotationStopwatch)); } } else { laserFadeStopwatch += Time.deltaTime; float num = 1f - laserFadeStopwatch / lifetimeAfterFiring; laser.widthMultiplier = laserFireWidth * num; } } private void UNetVersion() { } public override bool OnSerialize(NetworkWriter writer, bool forceAll) { if (forceAll) { writer.Write(_hasFired); return true; } bool flag = false; if ((((NetworkBehaviour)this).syncVarDirtyBits & (true ? 1u : 0u)) != 0) { if (!flag) { writer.WritePackedUInt32(((NetworkBehaviour)this).syncVarDirtyBits); flag = true; } writer.Write(_hasFired); } if (!flag) { writer.WritePackedUInt32(((NetworkBehaviour)this).syncVarDirtyBits); } return flag; } public override void OnDeserialize(NetworkReader reader, bool initialState) { if (initialState) { _hasFired = reader.ReadBoolean(); return; } int num = (int)reader.ReadPackedUInt32(); if (((uint)num & (true ? 1u : 0u)) != 0) { _hasFired = reader.ReadBoolean(); } } } public class AtlasTeleporterBeamController : NetworkBehaviour { private LineRenderer lineRenderer; [SyncVar] private Vector3 _serverPos; private Vector3 localPos; private float endWidthMult = 5f; private float expandDuration = 0f; private float retractDuration = 0f; private float expandStopwatch = 0f; private bool isRetracting = false; private static int kRpcRpcTriggerBeamAnim; public Vector3 Network_serverPos { get { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return _serverPos; } [param: In] set { //IL_0001: Unknown result type (might be due to invalid IL or missing references) ((NetworkBehaviour)this).SetSyncVar(value, ref _serverPos, 1u); } } public void SetPosServer(Vector3 pos) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) if (NetworkServer.active) { Network_serverPos = pos; } } private void Awake() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) lineRenderer = ((Component)this).GetComponent(); if (Object.op_Implicit((Object)(object)lineRenderer)) { localPos = ((Component)this).transform.position; lineRenderer.SetPositions((Vector3[])(object)new Vector3[2] { localPos, localPos + 1000f * Vector3.up }); } } private void FixedUpdate() { //IL_0002: 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_0019: 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_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_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) if (localPos != _serverPos) { localPos = _serverPos; if (Object.op_Implicit((Object)(object)lineRenderer)) { lineRenderer.SetPositions((Vector3[])(object)new Vector3[2] { localPos, localPos + 1000f * Vector3.up }); } } } private void Update() { //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)lineRenderer) || (expandDuration <= 0f && retractDuration <= 0f)) { return; } expandStopwatch += Time.deltaTime; if (!isRetracting) { lineRenderer.widthMultiplier = Mathf.Lerp(1f, endWidthMult, expandStopwatch / expandDuration); if (expandDuration > 0f && expandStopwatch >= expandDuration) { expandDuration = 0f; expandStopwatch = 0f; isRetracting = true; } return; } lineRenderer.widthMultiplier = Mathf.Lerp(endWidthMult, 0f, expandStopwatch / retractDuration); if (expandStopwatch >= retractDuration) { retractDuration = 0f; expandStopwatch = 0f; isRetracting = false; if (NetworkServer.active) { EffectManager.SimpleSoundEffect(USB.atlasCannonFireSound.index, _serverPos, true); Object.Destroy((Object)(object)((Component)this).gameObject); } } } private void TriggerBeamAnim() { expandDuration = 5f; retractDuration = 1f; isRetracting = false; expandStopwatch = 0f; endWidthMult = 5f; } [ClientRpc] private void RpcTriggerBeamAnim() { TriggerBeamAnim(); } public void TriggerBeamAnimServer() { if (NetworkServer.active) { CallRpcTriggerBeamAnim(); } } private void UNetVersion() { } protected static void InvokeRpcRpcTriggerBeamAnim(NetworkBehaviour obj, NetworkReader reader) { if (!NetworkClient.active) { Debug.LogError((object)"RPC RpcTriggerBeamAnim called on server."); } else { ((AtlasTeleporterBeamController)(object)obj).RpcTriggerBeamAnim(); } } public void CallRpcTriggerBeamAnim() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0041: Unknown result type (might be due to invalid IL or missing references) if (!NetworkServer.active) { Debug.LogError((object)"RPC Function RpcTriggerBeamAnim called on client."); return; } NetworkWriter val = new NetworkWriter(); val.Write((short)0); val.Write((short)2); val.WritePackedUInt32((uint)kRpcRpcTriggerBeamAnim); val.Write(((Component)this).GetComponent().netId); ((NetworkBehaviour)this).SendRPCInternal(val, 0, "RpcTriggerBeamAnim"); } static AtlasTeleporterBeamController() { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Expected O, but got Unknown kRpcRpcTriggerBeamAnim = 530846996; NetworkBehaviour.RegisterRpcDelegate(typeof(AtlasTeleporterBeamController), kRpcRpcTriggerBeamAnim, new CmdDelegate(InvokeRpcRpcTriggerBeamAnim)); NetworkCRC.RegisterBehaviour("AtlasTeleporterBeamController", 0); } public override bool OnSerialize(NetworkWriter writer, bool forceAll) { //IL_0008: 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) if (forceAll) { writer.Write(_serverPos); return true; } bool flag = false; if ((((NetworkBehaviour)this).syncVarDirtyBits & (true ? 1u : 0u)) != 0) { if (!flag) { writer.WritePackedUInt32(((NetworkBehaviour)this).syncVarDirtyBits); flag = true; } writer.Write(_serverPos); } if (!flag) { writer.WritePackedUInt32(((NetworkBehaviour)this).syncVarDirtyBits); } return flag; } public override void OnDeserialize(NetworkReader reader, bool initialState) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) if (initialState) { _serverPos = reader.ReadVector3(); return; } int num = (int)reader.ReadPackedUInt32(); if (((uint)num & (true ? 1u : 0u)) != 0) { _serverPos = reader.ReadVector3(); } } } public class AtlasCannonInteractableController : MonoBehaviour { private GameObject beamInstance; private PurchaseInteraction pi; private bool expandedBeam = false; private void Awake() { pi = ((Component)this).GetComponent(); if (Object.op_Implicit((Object)(object)pi)) { ((UnityEvent)(object)pi.onPurchase).AddListener((UnityAction)AtlasCannonOnPurchase); } } private void FixedUpdate() { if (!NetworkServer.active || !Object.op_Implicit((Object)(object)pi) || !USB.firedCannon) { return; } pi.available = false; if (Object.op_Implicit((Object)(object)beamInstance) && !expandedBeam) { expandedBeam = true; AtlasTeleporterBeamController component = beamInstance.GetComponent(); if (Object.op_Implicit((Object)(object)component)) { component.TriggerBeamAnimServer(); } } } private void OnDestroy() { if (NetworkServer.active && Object.op_Implicit((Object)(object)beamInstance)) { Object.Destroy((Object)(object)beamInstance); } } private void AtlasCannonOnPurchase(Interactor interactor) { //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Expected O, but got Unknown //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) if (USB.cannonActivated) { return; } USB.cannonActivated = true; USB.AddTeleporterVisualServer(); if (Object.op_Implicit((Object)(object)pi)) { pi.lastActivator = interactor; pi.available = false; } Chat.SendBroadcastChat((ChatMessageBase)new SubjectFormatChatMessage { subjectAsCharacterBody = ((Component)interactor).GetComponent(), baseToken = "CLASSICITEMSRETURNS_INTERACTABLE_ATLASCANNON_USE_MESSAGE" }); if (Object.op_Implicit((Object)(object)beamInstance) || !NetworkServer.active) { return; } beamInstance = Object.Instantiate(USB.teleporterVisualNetworkPrefab); AtlasTeleporterBeamController component = beamInstance.GetComponent(); if (Object.op_Implicit((Object)(object)component)) { Vector3 posServer = ((Component)this).transform.position + 6f * Vector3.up; ChildLocator component2 = ((Component)this).GetComponent(); if (Object.op_Implicit((Object)(object)component2)) { Transform val = component2.FindChild("BeamOrigin"); posServer = val.position; } component.SetPosServer(posServer); } NetworkServer.Spawn(beamInstance); } } public class WickedRing : ItemBase { public ConfigEntry useAlternateVersion; public float cdr = 1f; public float cdrStack = 0.5f; public float bonusCrit = 5f; public override string ItemName => "Wicked Ring"; public override string ItemLangTokenName => "WICKEDRING"; public override ItemTier Tier => (ItemTier)2; public override GameObject ItemModel => LoadItemModel("SkullRing"); public override Sprite ItemIcon => LoadItemSprite("SkullRing"); public override object[] ItemFullDescriptionParams => new object[3] { bonusCrit, cdr, cdrStack }; public override ItemTag[] ItemTags { get { ItemTag[] array = new ItemTag[3]; RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); return (ItemTag[])(object)array; } } public override ItemDisplayRuleDict CreateItemDisplayRules() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown return new ItemDisplayRuleDict(Array.Empty()); } public override void Init(ConfigFile config) { //IL_0035: Unknown result type (might be due to invalid IL or missing references) base.Init(config); if (useAlternateVersion.Value && ItemDef.DoesNotContainTag((ItemTag)6)) { ref ItemTag[] tags = ref ItemDef.tags; ItemTag val = (ItemTag)6; ArrayUtils.ArrayAppend(ref tags, ref val); } } public override void CreateConfig(ConfigFile config) { useAlternateVersion = config.Bind(base.ConfigCategory, "Use Rework", false, "Reworks the item into giving CDR on kill. If false, gives CDR on crit like in Risk of Rain 1."); } protected override void CreateLang() { base.CreateLang(); LanguageOverrides.DeferToken("CLASSICITEMSRETURNS_ITEM_WICKEDRING_DESCRIPTION_ALT", cdr, cdrStack); } public override void Hooks() { //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Expected O, but got Unknown //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Expected O, but got Unknown //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Expected O, but got Unknown base.Hooks(); if (useAlternateVersion.Value) { ItemDef itemDef = ItemDef; itemDef.pickupToken += "_ALT"; ItemDef itemDef2 = ItemDef; itemDef2.descriptionToken += "_ALT"; OnCharacterDeath.OnCharacterDeathAttackerInventoryActions = (OnCharacterDeath.OnCharacterDeathAttackerInventory)Delegate.Combine(OnCharacterDeath.OnCharacterDeathAttackerInventoryActions, new OnCharacterDeath.OnCharacterDeathAttackerInventory(CooldownOnKill)); } else { RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(RecalculateStatsAPI_GetStatCoefficients); ProcessHitEnemy.OnHitAttackerActions = (OnHitAttacker)Delegate.Combine((Delegate?)(object)ProcessHitEnemy.OnHitAttackerActions, (Delegate?)new OnHitAttacker(CooldownOnCrit)); } } private void CooldownOnCrit(DamageInfo damageInfo, CharacterBody victimBody, CharacterBody attackerBody) { if (damageInfo.crit && !(damageInfo.procCoefficient <= 0f) && Object.op_Implicit((Object)(object)attackerBody.inventory) && Object.op_Implicit((Object)(object)attackerBody.skillLocator)) { int itemCountEffective = attackerBody.inventory.GetItemCountEffective(ItemDef); if (itemCountEffective > 0) { int num = itemCountEffective - 1; float num2 = cdr + (float)num * cdrStack; attackerBody.skillLocator.DeductCooldownFromAllSkillsServer(num2 * damageInfo.procCoefficient); } } } private void CooldownOnKill(GlobalEventManager globalEventManager, DamageReport damageReport, CharacterBody attackerBody, Inventory attackerInventory) { int itemCountEffective = attackerInventory.GetItemCountEffective(ItemDef); if (itemCountEffective > 0 && Object.op_Implicit((Object)(object)attackerBody.skillLocator)) { int num = itemCountEffective - 1; float num2 = cdr + (float)num * cdrStack; attackerBody.skillLocator.DeductCooldownFromAllSkillsServer(num2); } } private void RecalculateStatsAPI_GetStatCoefficients(CharacterBody sender, StatHookEventArgs args) { if (Object.op_Implicit((Object)(object)sender.inventory) && sender.inventory.GetItemCountEffective(ItemDef) > 0) { args.critAdd += bonusCrit; } } private void CooldownOnCrit(GlobalEventManager globalEventManager, DamageInfo damageInfo, GameObject victim, CharacterBody attackerBody, Inventory attackerInventory) { if (damageInfo.crit && !(damageInfo.procCoefficient <= 0f) && Object.op_Implicit((Object)(object)attackerBody.skillLocator)) { int itemCountEffective = attackerInventory.GetItemCountEffective(ItemDef); if (itemCountEffective > 0) { int num = itemCountEffective - 1; float num2 = cdr + (float)num * cdrStack; attackerBody.skillLocator.DeductCooldownFromAllSkillsServer(num2 * damageInfo.procCoefficient); } } } protected override void CreateCraftableDef() { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Expected O, but got Unknown //IL_019a: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Unknown result type (might be due to invalid IL or missing references) //IL_01ac: Expected O, but got Unknown //IL_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: Unknown result type (might be due to invalid IL or missing references) //IL_01b9: Unknown result type (might be due to invalid IL or missing references) //IL_01be: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: Expected O, but got Unknown //IL_01d7: Unknown result type (might be due to invalid IL or missing references) //IL_01de: Expected O, but got Unknown //IL_01f0: Unknown result type (might be due to invalid IL or missing references) //IL_01f5: Unknown result type (might be due to invalid IL or missing references) //IL_0202: Expected O, but got Unknown //IL_0204: Unknown result type (might be due to invalid IL or missing references) //IL_0209: Unknown result type (might be due to invalid IL or missing references) //IL_020f: Unknown result type (might be due to invalid IL or missing references) //IL_0214: Unknown result type (might be due to invalid IL or missing references) //IL_0223: Expected O, but got Unknown //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Expected O, but got Unknown //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Expected O, but got Unknown //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Expected O, but got Unknown //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Expected O, but got Unknown //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Expected O, but got Unknown //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Expected O, but got Unknown if (!Object.op_Implicit((Object)(object)ItemDef)) { return; } ItemDef pickup = Addressables.LoadAssetAsync((object)"RoR2/Base/Talisman/Talisman.asset").WaitForCompletion(); bool flag = EquipmentBase.Instance != null && Object.op_Implicit((Object)(object)EquipmentBase.Instance.EquipmentDef); bool flag2 = ItemBase.Instance != null && Object.op_Implicit((Object)(object)ItemBase.Instance.ItemDef); Recipe val2; if (flag || flag2) { CraftableDef val = ScriptableObject.CreateInstance(); val.pickup = (Object)(object)ItemDef; val.recipes = (Recipe[])(object)new Recipe[0]; if (flag) { Recipe[] recipes = val.recipes; val2 = new Recipe(); val2.amountToDrop = 1; val2.ingredients = (RecipeIngredient[])(object)new RecipeIngredient[2] { new RecipeIngredient { pickup = (Object)(object)pickup }, new RecipeIngredient { pickup = (Object)(object)EquipmentBase.Instance.EquipmentDef } }; recipes.Append(val2).ToArray(); } if (flag2) { Recipe[] recipes2 = val.recipes; val2 = new Recipe(); val2.amountToDrop = 1; val2.ingredients = (RecipeIngredient[])(object)new RecipeIngredient[2] { new RecipeIngredient { pickup = (Object)(object)pickup }, new RecipeIngredient { pickup = (Object)(object)ItemBase.Instance.ItemDef } }; recipes2.Append(val2).ToArray(); } ((Object)val).name = "cdWickedRing"; PluginContentPack.craftableDefs.Add(val); } CraftableDef val3 = ScriptableObject.CreateInstance(); val3.pickup = (Object)(object)pickup; Recipe[] array = new Recipe[2]; val2 = new Recipe(); val2.amountToDrop = 1; val2.ingredients = (RecipeIngredient[])(object)new RecipeIngredient[2] { new RecipeIngredient { pickup = (Object)(object)ItemDef }, new RecipeIngredient { pickup = (Object)(object)Addressables.LoadAssetAsync((object)"RoR2/Base/EquipmentMagazine/EquipmentMagazine.asset").WaitForCompletion() } }; array[0] = val2; val2 = new Recipe(); val2.amountToDrop = 1; val2.ingredients = (RecipeIngredient[])(object)new RecipeIngredient[2] { new RecipeIngredient { pickup = (Object)(object)ItemDef }, new RecipeIngredient { pickup = (Object)(object)Addressables.LoadAssetAsync((object)"RoR2/Base/DeathProjectile/DeathProjectile.asset").WaitForCompletion() } }; array[1] = val2; val3.recipes = (Recipe[])(object)array; ((Object)val3).name = "cdWickedRingToTalisman"; PluginContentPack.craftableDefs.Add(val3); } } } namespace ClassicItemsReturns.Items.NoTier { internal class ArmsRaceDroneItem : ItemBase { public class ArmsRaceDroneBehavior : BaseItemBodyBehavior { public static float searchInterval = 1f; public static float maxActivationDistance = 80f; public static int missilesPerBarrage = 4; public static float baseFireInterval = 0.15f; public float searchStopwatch; public float cooldownStopwatch; public float fireStopwatch; public int missilesLoaded; public bool firingBarrage = false; public float fireInterval; public HurtBox targetHurtBox; public float failedTargetCooldown = 2f; public float timer = 2f; private Transform missileMuzzleTransform; public float cooldownInterval => ItemBase.Instance.cooldown; [ItemDefAssociation(useOnClient = false, useOnServer = true)] public static ItemDef GetItemDef() { return ItemBase.Instance.ItemDef; } private void Start() { //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) ModelLocator component = ((Component)this).GetComponent(); if (Object.op_Implicit((Object)(object)component)) { Transform modelTransform = component.modelTransform; if (Object.op_Implicit((Object)(object)modelTransform)) { CharacterModel component2 = ((Component)modelTransform).GetComponent(); if (Object.op_Implicit((Object)(object)component2)) { List itemDisplayObjects = component2.GetItemDisplayObjects(Items.DroneWeaponsDisplay1.itemIndex); itemDisplayObjects.AddRange(component2.GetItemDisplayObjects(Items.DroneWeaponsDisplay2.itemIndex)); foreach (GameObject item in itemDisplayObjects) { ChildLocator component3 = item.GetComponent(); if (Object.op_Implicit((Object)(object)component3)) { Transform val = component3.FindChild("MissileMuzzle"); if (Object.op_Implicit((Object)(object)val)) { missileMuzzleTransform = val; break; } } } } } } GetMissileBarrageCount(); missilesLoaded = missilesPerBarrage; searchStopwatch = 0f; cooldownStopwatch = Random.Range(0.1f, 0.75f); fireStopwatch = 0f; fireInterval = baseFireInterval; } private void GetMissileBarrageCount() { if (Object.op_Implicit((Object)(object)((BaseItemBodyBehavior)this).body) && Object.op_Implicit((Object)(object)((BaseItemBodyBehavior)this).body.master) && Object.op_Implicit((Object)(object)((BaseItemBodyBehavior)this).body.master.minionOwnership) && Object.op_Implicit((Object)(object)((BaseItemBodyBehavior)this).body.master.minionOwnership.ownerMaster) && ItemBase.Instance.TryGetCount(((BaseItemBodyBehavior)this).body.master.minionOwnership.ownerMaster, out var count)) { if (count > 0) { missilesPerBarrage = ItemHelpers.StackingLinear(count, ItemBase.Instance.missileCount, ItemBase.Instance.missileCountPerStack); } else { missilesPerBarrage = 0; } } else { ItemHelpers.StackingLinear(base.stack, ItemBase.Instance.missileCount, ItemBase.Instance.missileCountPerStack); } } public bool AcquireTarget() { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Expected O, but got Unknown //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) Ray val = (Ray)(Object.op_Implicit((Object)(object)((BaseItemBodyBehavior)this).body.inputBank) ? ((BaseItemBodyBehavior)this).body.inputBank.GetAimRay() : default(Ray)); BullseyeSearch val2 = new BullseyeSearch(); val2.teamMaskFilter = TeamMask.allButNeutral; ((TeamMask)(ref val2.teamMaskFilter)).RemoveTeam(((BaseItemBodyBehavior)this).body.teamComponent.teamIndex); val2.filterByLoS = true; val2.searchOrigin = ((Ray)(ref val)).origin; val2.sortMode = (SortMode)2; val2.maxDistanceFilter = maxActivationDistance; val2.maxAngleFilter = 360f; val2.searchDirection = ((Ray)(ref val)).direction; val2.RefreshCandidates(); targetHurtBox = val2.GetResults().FirstOrDefault(); return (Object)(object)targetHurtBox != (Object)null; } private void FixedUpdate() { if (!NetworkServer.active) { return; } if (!firingBarrage) { GetMissileBarrageCount(); if (missilesLoaded < missilesPerBarrage) { cooldownStopwatch += Time.fixedDeltaTime; if (cooldownStopwatch >= cooldownInterval) { cooldownStopwatch = 0f; missilesLoaded = missilesPerBarrage; fireInterval = baseFireInterval * (float)ItemBase.Instance.missileCount / (float)missilesPerBarrage; } return; } searchStopwatch += Time.fixedDeltaTime; if (searchStopwatch > searchInterval) { searchStopwatch -= searchInterval; if (Object.op_Implicit((Object)(object)((BaseItemBodyBehavior)this).body.teamComponent) && AcquireTarget()) { firingBarrage = true; fireStopwatch = 0f; } } } else { fireStopwatch += Time.fixedDeltaTime; if (fireStopwatch >= fireInterval) { fireStopwatch -= fireInterval; FireMissile(); } } } private void FireMissile() { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)targetHurtBox != (Object)null) { MicroMissileOrb val = new MicroMissileOrb(); ((Orb)val).origin = (Object.op_Implicit((Object)(object)missileMuzzleTransform) ? missileMuzzleTransform.position : ((BaseItemBodyBehavior)this).body.corePosition); ((GenericDamageOrb)val).damageValue = ((BaseItemBodyBehavior)this).body.damage * ItemBase.Instance.damageCoeff; ((GenericDamageOrb)val).isCrit = ((BaseItemBodyBehavior)this).body.RollCrit(); ((GenericDamageOrb)val).teamIndex = TeamComponent.GetObjectTeam(((Component)((BaseItemBodyBehavior)this).body).gameObject); ((GenericDamageOrb)val).attacker = ((Component)this).gameObject; ((GenericDamageOrb)val).procChainMask = default(ProcChainMask); ((GenericDamageOrb)val).procCoefficient = 1f; ((GenericDamageOrb)val).damageColorIndex = (DamageColorIndex)0; ((Orb)val).target = targetHurtBox; ((GenericDamageOrb)val).speed = 25f; OrbManager.instance.AddOrb((Orb)(object)val); if (Object.op_Implicit((Object)(object)FireMissileBarrage.effectPrefab)) { EffectManager.SimpleMuzzleFlash(FireMissileBarrage.effectPrefab, ((Component)this).gameObject, "Muzzle", true); } } missilesLoaded--; if (missilesLoaded <= 0 || !targetHurtBox.healthComponent.alive) { missilesLoaded = 0; firingBarrage = false; } } } public override string ItemName => "ARMSRACEDRONEITEM"; public override ItemTier Tier => (ItemTier)5; public override GameObject ItemModel => LoadItemModel("ArmsRaceMissiles"); public override Sprite ItemIcon => Assets.NullSprite; public override string ItemLangTokenName => "ARMSRACEDRONEITEM"; public override ItemTag[] ItemTags { get { ItemTag[] array = new ItemTag[4]; RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); return (ItemTag[])(object)array; } } public override ItemDisplayRuleDict CreateItemDisplayRules() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0112: 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_0134: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_019d: Unknown result type (might be due to invalid IL or missing references) //IL_01a2: Unknown result type (might be due to invalid IL or missing references) //IL_01b8: 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_01c2: 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_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01de: Unknown result type (might be due to invalid IL or missing references) //IL_0200: Unknown result type (might be due to invalid IL or missing references) //IL_0205: Unknown result type (might be due to invalid IL or missing references) //IL_021b: Unknown result type (might be due to invalid IL or missing references) //IL_0220: Unknown result type (might be due to invalid IL or missing references) //IL_0236: Unknown result type (might be due to invalid IL or missing references) //IL_023b: Unknown result type (might be due to invalid IL or missing references) //IL_0240: Unknown result type (might be due to invalid IL or missing references) //IL_0242: Unknown result type (might be due to invalid IL or missing references) //IL_025d: Unknown result type (might be due to invalid IL or missing references) //IL_026e: Unknown result type (might be due to invalid IL or missing references) //IL_0290: Unknown result type (might be due to invalid IL or missing references) //IL_0295: Unknown result type (might be due to invalid IL or missing references) //IL_02ab: Unknown result type (might be due to invalid IL or missing references) //IL_02b0: Unknown result type (might be due to invalid IL or missing references) //IL_02c6: Unknown result type (might be due to invalid IL or missing references) //IL_02cb: Unknown result type (might be due to invalid IL or missing references) //IL_02d0: Unknown result type (might be due to invalid IL or missing references) //IL_02d2: Unknown result type (might be due to invalid IL or missing references) //IL_02db: Unknown result type (might be due to invalid IL or missing references) //IL_02ec: Unknown result type (might be due to invalid IL or missing references) //IL_030e: Unknown result type (might be due to invalid IL or missing references) //IL_0313: Unknown result type (might be due to invalid IL or missing references) //IL_0329: Unknown result type (might be due to invalid IL or missing references) //IL_032e: Unknown result type (might be due to invalid IL or missing references) //IL_0344: Unknown result type (might be due to invalid IL or missing references) //IL_0349: Unknown result type (might be due to invalid IL or missing references) //IL_034e: Unknown result type (might be due to invalid IL or missing references) //IL_0350: Unknown result type (might be due to invalid IL or missing references) //IL_036b: Unknown result type (might be due to invalid IL or missing references) //IL_037c: Unknown result type (might be due to invalid IL or missing references) //IL_039e: Unknown result type (might be due to invalid IL or missing references) //IL_03a3: Unknown result type (might be due to invalid IL or missing references) //IL_03b9: Unknown result type (might be due to invalid IL or missing references) //IL_03be: Unknown result type (might be due to invalid IL or missing references) //IL_03d4: Unknown result type (might be due to invalid IL or missing references) //IL_03d9: Unknown result type (might be due to invalid IL or missing references) //IL_03de: Unknown result type (might be due to invalid IL or missing references) //IL_03e0: Unknown result type (might be due to invalid IL or missing references) //IL_03e9: Unknown result type (might be due to invalid IL or missing references) //IL_03fa: Unknown result type (might be due to invalid IL or missing references) //IL_041c: Unknown result type (might be due to invalid IL or missing references) //IL_0421: Unknown result type (might be due to invalid IL or missing references) //IL_0437: Unknown result type (might be due to invalid IL or missing references) //IL_043c: Unknown result type (might be due to invalid IL or missing references) //IL_0452: Unknown result type (might be due to invalid IL or missing references) //IL_0457: Unknown result type (might be due to invalid IL or missing references) //IL_045c: Unknown result type (might be due to invalid IL or missing references) //IL_045e: Unknown result type (might be due to invalid IL or missing references) //IL_0479: Unknown result type (might be due to invalid IL or missing references) //IL_048a: Unknown result type (might be due to invalid IL or missing references) //IL_04ac: Unknown result type (might be due to invalid IL or missing references) //IL_04b1: Unknown result type (might be due to invalid IL or missing references) //IL_04c7: Unknown result type (might be due to invalid IL or missing references) //IL_04cc: Unknown result type (might be due to invalid IL or missing references) //IL_04e2: Unknown result type (might be due to invalid IL or missing references) //IL_04e7: Unknown result type (might be due to invalid IL or missing references) //IL_04ec: Unknown result type (might be due to invalid IL or missing references) //IL_04ee: Unknown result type (might be due to invalid IL or missing references) //IL_04f7: Unknown result type (might be due to invalid IL or missing references) //IL_0508: Unknown result type (might be due to invalid IL or missing references) //IL_052a: Unknown result type (might be due to invalid IL or missing references) //IL_052f: Unknown result type (might be due to invalid IL or missing references) //IL_0545: Unknown result type (might be due to invalid IL or missing references) //IL_054a: Unknown result type (might be due to invalid IL or missing references) //IL_0560: Unknown result type (might be due to invalid IL or missing references) //IL_0565: Unknown result type (might be due to invalid IL or missing references) //IL_056a: Unknown result type (might be due to invalid IL or missing references) //IL_056c: Unknown result type (might be due to invalid IL or missing references) //IL_0587: Unknown result type (might be due to invalid IL or missing references) //IL_0598: Unknown result type (might be due to invalid IL or missing references) //IL_05ba: Unknown result type (might be due to invalid IL or missing references) //IL_05bf: Unknown result type (might be due to invalid IL or missing references) //IL_05d5: Unknown result type (might be due to invalid IL or missing references) //IL_05da: Unknown result type (might be due to invalid IL or missing references) //IL_05f0: Unknown result type (might be due to invalid IL or missing references) //IL_05f5: Unknown result type (might be due to invalid IL or missing references) //IL_05fa: Unknown result type (might be due to invalid IL or missing references) //IL_05fc: Unknown result type (might be due to invalid IL or missing references) //IL_0605: Unknown result type (might be due to invalid IL or missing references) //IL_0616: Unknown result type (might be due to invalid IL or missing references) //IL_0638: Unknown result type (might be due to invalid IL or missing references) //IL_063d: Unknown result type (might be due to invalid IL or missing references) //IL_0653: Unknown result type (might be due to invalid IL or missing references) //IL_0658: Unknown result type (might be due to invalid IL or missing references) //IL_066e: Unknown result type (might be due to invalid IL or missing references) //IL_0673: Unknown result type (might be due to invalid IL or missing references) //IL_0678: Unknown result type (might be due to invalid IL or missing references) //IL_067a: Unknown result type (might be due to invalid IL or missing references) //IL_0695: Unknown result type (might be due to invalid IL or missing references) //IL_06a6: Unknown result type (might be due to invalid IL or missing references) //IL_06c8: Unknown result type (might be due to invalid IL or missing references) //IL_06cd: Unknown result type (might be due to invalid IL or missing references) //IL_06e3: Unknown result type (might be due to invalid IL or missing references) //IL_06e8: Unknown result type (might be due to invalid IL or missing references) //IL_06fe: Unknown result type (might be due to invalid IL or missing references) //IL_0703: Unknown result type (might be due to invalid IL or missing references) //IL_0708: Unknown result type (might be due to invalid IL or missing references) //IL_070a: Unknown result type (might be due to invalid IL or missing references) //IL_0713: Unknown result type (might be due to invalid IL or missing references) //IL_0724: Unknown result type (might be due to invalid IL or missing references) //IL_0746: Unknown result type (might be due to invalid IL or missing references) //IL_074b: Unknown result type (might be due to invalid IL or missing references) //IL_0761: Unknown result type (might be due to invalid IL or missing references) //IL_0766: Unknown result type (might be due to invalid IL or missing references) //IL_077c: Unknown result type (might be due to invalid IL or missing references) //IL_0781: Unknown result type (might be due to invalid IL or missing references) //IL_0786: Unknown result type (might be due to invalid IL or missing references) //IL_0788: Unknown result type (might be due to invalid IL or missing references) //IL_07a3: Unknown result type (might be due to invalid IL or missing references) //IL_07b4: Unknown result type (might be due to invalid IL or missing references) //IL_07d6: Unknown result type (might be due to invalid IL or missing references) //IL_07db: Unknown result type (might be due to invalid IL or missing references) //IL_07f1: Unknown result type (might be due to invalid IL or missing references) //IL_07f6: Unknown result type (might be due to invalid IL or missing references) //IL_080c: Unknown result type (might be due to invalid IL or missing references) //IL_0811: Unknown result type (might be due to invalid IL or missing references) //IL_0816: Unknown result type (might be due to invalid IL or missing references) //IL_0818: Unknown result type (might be due to invalid IL or missing references) //IL_0821: Unknown result type (might be due to invalid IL or missing references) //IL_0832: Unknown result type (might be due to invalid IL or missing references) //IL_0854: Unknown result type (might be due to invalid IL or missing references) //IL_0859: Unknown result type (might be due to invalid IL or missing references) //IL_086f: Unknown result type (might be due to invalid IL or missing references) //IL_0874: Unknown result type (might be due to invalid IL or missing references) //IL_088a: Unknown result type (might be due to invalid IL or missing references) //IL_088f: Unknown result type (might be due to invalid IL or missing references) //IL_0894: Unknown result type (might be due to invalid IL or missing references) //IL_0896: Unknown result type (might be due to invalid IL or missing references) //IL_08b1: Unknown result type (might be due to invalid IL or missing references) //IL_08c2: Unknown result type (might be due to invalid IL or missing references) //IL_08e4: Unknown result type (might be due to invalid IL or missing references) //IL_08e9: Unknown result type (might be due to invalid IL or missing references) //IL_08ff: Unknown result type (might be due to invalid IL or missing references) //IL_0904: Unknown result type (might be due to invalid IL or missing references) //IL_091a: Unknown result type (might be due to invalid IL or missing references) //IL_091f: Unknown result type (might be due to invalid IL or missing references) //IL_0924: Unknown result type (might be due to invalid IL or missing references) //IL_0926: Unknown result type (might be due to invalid IL or missing references) //IL_092f: Unknown result type (might be due to invalid IL or missing references) //IL_0940: Unknown result type (might be due to invalid IL or missing references) //IL_0962: Unknown result type (might be due to invalid IL or missing references) //IL_0967: Unknown result type (might be due to invalid IL or missing references) //IL_097d: Unknown result type (might be due to invalid IL or missing references) //IL_0982: Unknown result type (might be due to invalid IL or missing references) //IL_0998: Unknown result type (might be due to invalid IL or missing references) //IL_099d: Unknown result type (might be due to invalid IL or missing references) //IL_09a2: Unknown result type (might be due to invalid IL or missing references) //IL_09a4: Unknown result type (might be due to invalid IL or missing references) //IL_09bf: Unknown result type (might be due to invalid IL or missing references) //IL_09d0: Unknown result type (might be due to invalid IL or missing references) //IL_09f2: Unknown result type (might be due to invalid IL or missing references) //IL_09f7: Unknown result type (might be due to invalid IL or missing references) //IL_0a0d: Unknown result type (might be due to invalid IL or missing references) //IL_0a12: Unknown result type (might be due to invalid IL or missing references) //IL_0a28: Unknown result type (might be due to invalid IL or missing references) //IL_0a2d: Unknown result type (might be due to invalid IL or missing references) //IL_0a32: Unknown result type (might be due to invalid IL or missing references) //IL_0a34: Unknown result type (might be due to invalid IL or missing references) //IL_0a3d: Unknown result type (might be due to invalid IL or missing references) //IL_0a4e: Unknown result type (might be due to invalid IL or missing references) //IL_0a70: Unknown result type (might be due to invalid IL or missing references) //IL_0a75: Unknown result type (might be due to invalid IL or missing references) //IL_0a8b: Unknown result type (might be due to invalid IL or missing references) //IL_0a90: Unknown result type (might be due to invalid IL or missing references) //IL_0aa6: Unknown result type (might be due to invalid IL or missing references) //IL_0aab: Unknown result type (might be due to invalid IL or missing references) //IL_0ab0: Unknown result type (might be due to invalid IL or missing references) //IL_0ab2: Unknown result type (might be due to invalid IL or missing references) //IL_0acd: Unknown result type (might be due to invalid IL or missing references) //IL_0ade: Unknown result type (might be due to invalid IL or missing references) //IL_0b00: Unknown result type (might be due to invalid IL or missing references) //IL_0b05: Unknown result type (might be due to invalid IL or missing references) //IL_0b1b: Unknown result type (might be due to invalid IL or missing references) //IL_0b20: Unknown result type (might be due to invalid IL or missing references) //IL_0b36: Unknown result type (might be due to invalid IL or missing references) //IL_0b3b: Unknown result type (might be due to invalid IL or missing references) //IL_0b40: Unknown result type (might be due to invalid IL or missing references) //IL_0b42: Unknown result type (might be due to invalid IL or missing references) //IL_0b4b: Unknown result type (might be due to invalid IL or missing references) //IL_0b5c: Unknown result type (might be due to invalid IL or missing references) //IL_0b7e: Unknown result type (might be due to invalid IL or missing references) //IL_0b83: Unknown result type (might be due to invalid IL or missing references) //IL_0b99: Unknown result type (might be due to invalid IL or missing references) //IL_0b9e: Unknown result type (might be due to invalid IL or missing references) //IL_0bb4: Unknown result type (might be due to invalid IL or missing references) //IL_0bb9: Unknown result type (might be due to invalid IL or missing references) //IL_0bbe: Unknown result type (might be due to invalid IL or missing references) //IL_0bc0: Unknown result type (might be due to invalid IL or missing references) //IL_0bdb: Unknown result type (might be due to invalid IL or missing references) //IL_0bec: Unknown result type (might be due to invalid IL or missing references) //IL_0c0e: Unknown result type (might be due to invalid IL or missing references) //IL_0c13: Unknown result type (might be due to invalid IL or missing references) //IL_0c29: Unknown result type (might be due to invalid IL or missing references) //IL_0c2e: Unknown result type (might be due to invalid IL or missing references) //IL_0c44: Unknown result type (might be due to invalid IL or missing references) //IL_0c49: Unknown result type (might be due to invalid IL or missing references) //IL_0c4e: Unknown result type (might be due to invalid IL or missing references) //IL_0c50: Unknown result type (might be due to invalid IL or missing references) //IL_0c59: Unknown result type (might be due to invalid IL or missing references) //IL_0c6a: Unknown result type (might be due to invalid IL or missing references) //IL_0c8c: Unknown result type (might be due to invalid IL or missing references) //IL_0c91: Unknown result type (might be due to invalid IL or missing references) //IL_0ca7: Unknown result type (might be due to invalid IL or missing references) //IL_0cac: Unknown result type (might be due to invalid IL or missing references) //IL_0cc2: Unknown result type (might be due to invalid IL or missing references) //IL_0cc7: Unknown result type (might be due to invalid IL or missing references) //IL_0ccc: Unknown result type (might be due to invalid IL or missing references) //IL_0cce: Unknown result type (might be due to invalid IL or missing references) //IL_0ce9: Unknown result type (might be due to invalid IL or missing references) //IL_0cfa: Unknown result type (might be due to invalid IL or missing references) //IL_0d1c: Unknown result type (might be due to invalid IL or missing references) //IL_0d21: Unknown result type (might be due to invalid IL or missing references) //IL_0d37: Unknown result type (might be due to invalid IL or missing references) //IL_0d3c: Unknown result type (might be due to invalid IL or missing references) //IL_0d52: Unknown result type (might be due to invalid IL or missing references) //IL_0d57: Unknown result type (might be due to invalid IL or missing references) //IL_0d5c: Unknown result type (might be due to invalid IL or missing references) //IL_0d5e: Unknown result type (might be due to invalid IL or missing references) //IL_0d67: Unknown result type (might be due to invalid IL or missing references) //IL_0d78: Unknown result type (might be due to invalid IL or missing references) //IL_0d9a: Unknown result type (might be due to invalid IL or missing references) //IL_0d9f: Unknown result type (might be due to invalid IL or missing references) //IL_0db5: Unknown result type (might be due to invalid IL or missing references) //IL_0dba: Unknown result type (might be due to invalid IL or missing references) //IL_0dd0: Unknown result type (might be due to invalid IL or missing references) //IL_0dd5: Unknown result type (might be due to invalid IL or missing references) //IL_0dda: Unknown result type (might be due to invalid IL or missing references) //IL_0ddc: Unknown result type (might be due to invalid IL or missing references) //IL_0df7: Unknown result type (might be due to invalid IL or missing references) //IL_0e08: Unknown result type (might be due to invalid IL or missing references) //IL_0e2a: Unknown result type (might be due to invalid IL or missing references) //IL_0e2f: Unknown result type (might be due to invalid IL or missing references) //IL_0e45: Unknown result type (might be due to invalid IL or missing references) //IL_0e4a: Unknown result type (might be due to invalid IL or missing references) //IL_0e60: Unknown result type (might be due to invalid IL or missing references) //IL_0e65: Unknown result type (might be due to invalid IL or missing references) //IL_0e6a: Unknown result type (might be due to invalid IL or missing references) //IL_0e6c: Unknown result type (might be due to invalid IL or missing references) //IL_0e75: Unknown result type (might be due to invalid IL or missing references) //IL_0e86: Unknown result type (might be due to invalid IL or missing references) //IL_0ea8: Unknown result type (might be due to invalid IL or missing references) //IL_0ead: Unknown result type (might be due to invalid IL or missing references) //IL_0ec3: Unknown result type (might be due to invalid IL or missing references) //IL_0ec8: Unknown result type (might be due to invalid IL or missing references) //IL_0ede: Unknown result type (might be due to invalid IL or missing references) //IL_0ee3: Unknown result type (might be due to invalid IL or missing references) //IL_0ee8: Unknown result type (might be due to invalid IL or missing references) //IL_0eea: Unknown result type (might be due to invalid IL or missing references) //IL_0f05: Unknown result type (might be due to invalid IL or missing references) //IL_0f16: Unknown result type (might be due to invalid IL or missing references) //IL_0f38: Unknown result type (might be due to invalid IL or missing references) //IL_0f3d: Unknown result type (might be due to invalid IL or missing references) //IL_0f53: Unknown result type (might be due to invalid IL or missing references) //IL_0f58: Unknown result type (might be due to invalid IL or missing references) //IL_0f6e: Unknown result type (might be due to invalid IL or missing references) //IL_0f73: Unknown result type (might be due to invalid IL or missing references) //IL_0f78: Unknown result type (might be due to invalid IL or missing references) //IL_0f7a: Unknown result type (might be due to invalid IL or missing references) //IL_0f83: Unknown result type (might be due to invalid IL or missing references) //IL_0f94: Unknown result type (might be due to invalid IL or missing references) //IL_0fb6: Unknown result type (might be due to invalid IL or missing references) //IL_0fbb: Unknown result type (might be due to invalid IL or missing references) //IL_0fd1: Unknown result type (might be due to invalid IL or missing references) //IL_0fd6: Unknown result type (might be due to invalid IL or missing references) //IL_0fec: Unknown result type (might be due to invalid IL or missing references) //IL_0ff1: Unknown result type (might be due to invalid IL or missing references) //IL_0ff6: Unknown result type (might be due to invalid IL or missing references) //IL_0ff8: Unknown result type (might be due to invalid IL or missing references) //IL_1013: Unknown result type (might be due to invalid IL or missing references) //IL_1024: Unknown result type (might be due to invalid IL or missing references) //IL_1046: Unknown result type (might be due to invalid IL or missing references) //IL_104b: Unknown result type (might be due to invalid IL or missing references) //IL_1061: Unknown result type (might be due to invalid IL or missing references) //IL_1066: Unknown result type (might be due to invalid IL or missing references) //IL_107c: Unknown result type (might be due to invalid IL or missing references) //IL_1081: Unknown result type (might be due to invalid IL or missing references) //IL_1086: Unknown result type (might be due to invalid IL or missing references) //IL_1088: Unknown result type (might be due to invalid IL or missing references) //IL_1091: Unknown result type (might be due to invalid IL or missing references) //IL_10a2: Unknown result type (might be due to invalid IL or missing references) //IL_10c4: Unknown result type (might be due to invalid IL or missing references) //IL_10c9: Unknown result type (might be due to invalid IL or missing references) //IL_10df: Unknown result type (might be due to invalid IL or missing references) //IL_10e4: Unknown result type (might be due to invalid IL or missing references) //IL_10fa: Unknown result type (might be due to invalid IL or missing references) //IL_10ff: Unknown result type (might be due to invalid IL or missing references) //IL_1104: Unknown result type (might be due to invalid IL or missing references) //IL_1106: Unknown result type (might be due to invalid IL or missing references) //IL_1121: Unknown result type (might be due to invalid IL or missing references) //IL_1132: Unknown result type (might be due to invalid IL or missing references) //IL_1154: Unknown result type (might be due to invalid IL or missing references) //IL_1159: Unknown result type (might be due to invalid IL or missing references) //IL_116f: Unknown result type (might be due to invalid IL or missing references) //IL_1174: Unknown result type (might be due to invalid IL or missing references) //IL_118a: Unknown result type (might be due to invalid IL or missing references) //IL_118f: Unknown result type (might be due to invalid IL or missing references) //IL_1194: Unknown result type (might be due to invalid IL or missing references) //IL_1196: Unknown result type (might be due to invalid IL or missing references) //IL_119f: Unknown result type (might be due to invalid IL or missing references) //IL_11b0: Unknown result type (might be due to invalid IL or missing references) //IL_11d2: Unknown result type (might be due to invalid IL or missing references) //IL_11d7: Unknown result type (might be due to invalid IL or missing references) //IL_11ed: Unknown result type (might be due to invalid IL or missing references) //IL_11f2: Unknown result type (might be due to invalid IL or missing references) //IL_1208: Unknown result type (might be due to invalid IL or missing references) //IL_120d: Unknown result type (might be due to invalid IL or missing references) //IL_1212: Unknown result type (might be due to invalid IL or missing references) //IL_1214: Unknown result type (might be due to invalid IL or missing references) //IL_122f: Unknown result type (might be due to invalid IL or missing references) //IL_1240: Unknown result type (might be due to invalid IL or missing references) //IL_1262: Unknown result type (might be due to invalid IL or missing references) //IL_1267: Unknown result type (might be due to invalid IL or missing references) //IL_127d: Unknown result type (might be due to invalid IL or missing references) //IL_1282: Unknown result type (might be due to invalid IL or missing references) //IL_1298: Unknown result type (might be due to invalid IL or missing references) //IL_129d: Unknown result type (might be due to invalid IL or missing references) //IL_12a2: Unknown result type (might be due to invalid IL or missing references) //IL_12a4: Unknown result type (might be due to invalid IL or missing references) //IL_12ad: Unknown result type (might be due to invalid IL or missing references) //IL_12be: Unknown result type (might be due to invalid IL or missing references) //IL_12e0: Unknown result type (might be due to invalid IL or missing references) //IL_12e5: Unknown result type (might be due to invalid IL or missing references) //IL_12fb: Unknown result type (might be due to invalid IL or missing references) //IL_1300: Unknown result type (might be due to invalid IL or missing references) //IL_1316: Unknown result type (might be due to invalid IL or missing references) //IL_131b: Unknown result type (might be due to invalid IL or missing references) //IL_1320: Unknown result type (might be due to invalid IL or missing references) //IL_1322: Unknown result type (might be due to invalid IL or missing references) //IL_133d: Unknown result type (might be due to invalid IL or missing references) //IL_134e: Unknown result type (might be due to invalid IL or missing references) //IL_1370: Unknown result type (might be due to invalid IL or missing references) //IL_1375: Unknown result type (might be due to invalid IL or missing references) //IL_138b: Unknown result type (might be due to invalid IL or missing references) //IL_1390: Unknown result type (might be due to invalid IL or missing references) //IL_13a6: Unknown result type (might be due to invalid IL or missing references) //IL_13ab: Unknown result type (might be due to invalid IL or missing references) //IL_13b0: Unknown result type (might be due to invalid IL or missing references) //IL_13b2: Unknown result type (might be due to invalid IL or missing references) //IL_13bb: Unknown result type (might be due to invalid IL or missing references) //IL_13cc: Unknown result type (might be due to invalid IL or missing references) //IL_13ee: Unknown result type (might be due to invalid IL or missing references) //IL_13f3: Unknown result type (might be due to invalid IL or missing references) //IL_1409: Unknown result type (might be due to invalid IL or missing references) //IL_140e: Unknown result type (might be due to invalid IL or missing references) //IL_1424: Unknown result type (might be due to invalid IL or missing references) //IL_1429: Unknown result type (might be due to invalid IL or missing references) //IL_142e: Unknown result type (might be due to invalid IL or missing references) //IL_1430: Unknown result type (might be due to invalid IL or missing references) //IL_144b: Unknown result type (might be due to invalid IL or missing references) //IL_145c: Unknown result type (might be due to invalid IL or missing references) //IL_147e: Unknown result type (might be due to invalid IL or missing references) //IL_1483: Unknown result type (might be due to invalid IL or missing references) //IL_1499: Unknown result type (might be due to invalid IL or missing references) //IL_149e: Unknown result type (might be due to invalid IL or missing references) //IL_14b4: Unknown result type (might be due to invalid IL or missing references) //IL_14b9: Unknown result type (might be due to invalid IL or missing references) //IL_14be: Unknown result type (might be due to invalid IL or missing references) //IL_14c0: Unknown result type (might be due to invalid IL or missing references) //IL_14c9: Unknown result type (might be due to invalid IL or missing references) //IL_14da: Unknown result type (might be due to invalid IL or missing references) //IL_14fc: Unknown result type (might be due to invalid IL or missing references) //IL_1501: Unknown result type (might be due to invalid IL or missing references) //IL_1517: Unknown result type (might be due to invalid IL or missing references) //IL_151c: Unknown result type (might be due to invalid IL or missing references) //IL_1532: Unknown result type (might be due to invalid IL or missing references) //IL_1537: Unknown result type (might be due to invalid IL or missing references) //IL_153c: Unknown result type (might be due to invalid IL or missing references) //IL_153e: Unknown result type (might be due to invalid IL or missing references) //IL_1559: Unknown result type (might be due to invalid IL or missing references) //IL_156a: Unknown result type (might be due to invalid IL or missing references) //IL_158c: Unknown result type (might be due to invalid IL or missing references) //IL_1591: Unknown result type (might be due to invalid IL or missing references) //IL_15a7: Unknown result type (might be due to invalid IL or missing references) //IL_15ac: Unknown result type (might be due to invalid IL or missing references) //IL_15c2: Unknown result type (might be due to invalid IL or missing references) //IL_15c7: Unknown result type (might be due to invalid IL or missing references) //IL_15cc: Unknown result type (might be due to invalid IL or missing references) //IL_15ce: Unknown result type (might be due to invalid IL or missing references) //IL_15d7: Unknown result type (might be due to invalid IL or missing references) //IL_15e8: Unknown result type (might be due to invalid IL or missing references) //IL_160a: Unknown result type (might be due to invalid IL or missing references) //IL_160f: Unknown result type (might be due to invalid IL or missing references) //IL_1625: Unknown result type (might be due to invalid IL or missing references) //IL_162a: Unknown result type (might be due to invalid IL or missing references) //IL_1640: Unknown result type (might be due to invalid IL or missing references) //IL_1645: Unknown result type (might be due to invalid IL or missing references) //IL_164a: Unknown result type (might be due to invalid IL or missing references) //IL_164c: Unknown result type (might be due to invalid IL or missing references) //IL_1667: Unknown result type (might be due to invalid IL or missing references) //IL_1678: Unknown result type (might be due to invalid IL or missing references) //IL_169a: Unknown result type (might be due to invalid IL or missing references) //IL_169f: Unknown result type (might be due to invalid IL or missing references) //IL_16b5: Unknown result type (might be due to invalid IL or missing references) //IL_16ba: Unknown result type (might be due to invalid IL or missing references) //IL_16d0: Unknown result type (might be due to invalid IL or missing references) //IL_16d5: Unknown result type (might be due to invalid IL or missing references) //IL_16da: Unknown result type (might be due to invalid IL or missing references) //IL_16dc: Unknown result type (might be due to invalid IL or missing references) //IL_16e5: Unknown result type (might be due to invalid IL or missing references) //IL_16f6: Unknown result type (might be due to invalid IL or missing references) //IL_1718: Unknown result type (might be due to invalid IL or missing references) //IL_171d: Unknown result type (might be due to invalid IL or missing references) //IL_1733: Unknown result type (might be due to invalid IL or missing references) //IL_1738: Unknown result type (might be due to invalid IL or missing references) //IL_174e: Unknown result type (might be due to invalid IL or missing references) //IL_1753: Unknown result type (might be due to invalid IL or missing references) //IL_1758: Unknown result type (might be due to invalid IL or missing references) //IL_175a: Unknown result type (might be due to invalid IL or missing references) //IL_1775: Unknown result type (might be due to invalid IL or missing references) //IL_1786: Unknown result type (might be due to invalid IL or missing references) //IL_17a8: Unknown result type (might be due to invalid IL or missing references) //IL_17ad: Unknown result type (might be due to invalid IL or missing references) //IL_17c3: Unknown result type (might be due to invalid IL or missing references) //IL_17c8: Unknown result type (might be due to invalid IL or missing references) //IL_17de: Unknown result type (might be due to invalid IL or missing references) //IL_17e3: Unknown result type (might be due to invalid IL or missing references) //IL_17e8: Unknown result type (might be due to invalid IL or missing references) //IL_17ea: Unknown result type (might be due to invalid IL or missing references) //IL_17f3: Unknown result type (might be due to invalid IL or missing references) //IL_1804: Unknown result type (might be due to invalid IL or missing references) //IL_1826: Unknown result type (might be due to invalid IL or missing references) //IL_182b: Unknown result type (might be due to invalid IL or missing references) //IL_1841: Unknown result type (might be due to invalid IL or missing references) //IL_1846: Unknown result type (might be due to invalid IL or missing references) //IL_185c: Unknown result type (might be due to invalid IL or missing references) //IL_1861: Unknown result type (might be due to invalid IL or missing references) //IL_1866: Unknown result type (might be due to invalid IL or missing references) //IL_1868: Unknown result type (might be due to invalid IL or missing references) //IL_1883: Unknown result type (might be due to invalid IL or missing references) //IL_1894: Unknown result type (might be due to invalid IL or missing references) //IL_18b6: Unknown result type (might be due to invalid IL or missing references) //IL_18bb: Unknown result type (might be due to invalid IL or missing references) //IL_18d1: Unknown result type (might be due to invalid IL or missing references) //IL_18d6: Unknown result type (might be due to invalid IL or missing references) //IL_18ec: Unknown result type (might be due to invalid IL or missing references) //IL_18f1: Unknown result type (might be due to invalid IL or missing references) //IL_18f6: Unknown result type (might be due to invalid IL or missing references) //IL_18f8: Unknown result type (might be due to invalid IL or missing references) //IL_1901: Unknown result type (might be due to invalid IL or missing references) //IL_1912: Unknown result type (might be due to invalid IL or missing references) //IL_1934: Unknown result type (might be due to invalid IL or missing references) //IL_1939: Unknown result type (might be due to invalid IL or missing references) //IL_194f: Unknown result type (might be due to invalid IL or missing references) //IL_1954: Unknown result type (might be due to invalid IL or missing references) //IL_196a: Unknown result type (might be due to invalid IL or missing references) //IL_196f: Unknown result type (might be due to invalid IL or missing references) //IL_1974: Unknown result type (might be due to invalid IL or missing references) //IL_1976: Unknown result type (might be due to invalid IL or missing references) //IL_1991: Unknown result type (might be due to invalid IL or missing references) //IL_19a2: Unknown result type (might be due to invalid IL or missing references) //IL_19c4: Unknown result type (might be due to invalid IL or missing references) //IL_19c9: Unknown result type (might be due to invalid IL or missing references) //IL_19df: Unknown result type (might be due to invalid IL or missing references) //IL_19e4: Unknown result type (might be due to invalid IL or missing references) //IL_19fa: Unknown result type (might be due to invalid IL or missing references) //IL_19ff: Unknown result type (might be due to invalid IL or missing references) //IL_1a04: Unknown result type (might be due to invalid IL or missing references) //IL_1a06: Unknown result type (might be due to invalid IL or missing references) //IL_1a0f: Unknown result type (might be due to invalid IL or missing references) //IL_1a20: Unknown result type (might be due to invalid IL or missing references) //IL_1a42: Unknown result type (might be due to invalid IL or missing references) //IL_1a47: Unknown result type (might be due to invalid IL or missing references) //IL_1a5d: Unknown result type (might be due to invalid IL or missing references) //IL_1a62: Unknown result type (might be due to invalid IL or missing references) //IL_1a78: Unknown result type (might be due to invalid IL or missing references) //IL_1a7d: Unknown result type (might be due to invalid IL or missing references) //IL_1a82: Unknown result type (might be due to invalid IL or missing references) //IL_1a84: Unknown result type (might be due to invalid IL or missing references) //IL_1a9f: Unknown result type (might be due to invalid IL or missing references) //IL_1ab0: Unknown result type (might be due to invalid IL or missing references) //IL_1ad2: Unknown result type (might be due to invalid IL or missing references) //IL_1ad7: Unknown result type (might be due to invalid IL or missing references) //IL_1aed: Unknown result type (might be due to invalid IL or missing references) //IL_1af2: Unknown result type (might be due to invalid IL or missing references) //IL_1b08: Unknown result type (might be due to invalid IL or missing references) //IL_1b0d: Unknown result type (might be due to invalid IL or missing references) //IL_1b12: Unknown result type (might be due to invalid IL or missing references) //IL_1b14: Unknown result type (might be due to invalid IL or missing references) //IL_1b1d: Unknown result type (might be due to invalid IL or missing references) //IL_1b2e: Unknown result type (might be due to invalid IL or missing references) //IL_1b50: Unknown result type (might be due to invalid IL or missing references) //IL_1b55: Unknown result type (might be due to invalid IL or missing references) //IL_1b6b: Unknown result type (might be due to invalid IL or missing references) //IL_1b70: Unknown result type (might be due to invalid IL or missing references) //IL_1b86: Unknown result type (might be due to invalid IL or missing references) //IL_1b8b: Unknown result type (might be due to invalid IL or missing references) //IL_1b90: Unknown result type (might be due to invalid IL or missing references) //IL_1b92: Unknown result type (might be due to invalid IL or missing references) //IL_1bad: Unknown result type (might be due to invalid IL or missing references) //IL_1bbe: Unknown result type (might be due to invalid IL or missing references) //IL_1be0: Unknown result type (might be due to invalid IL or missing references) //IL_1be5: Unknown result type (might be due to invalid IL or missing references) //IL_1bfb: Unknown result type (might be due to invalid IL or missing references) //IL_1c00: Unknown result type (might be due to invalid IL or missing references) //IL_1c16: Unknown result type (might be due to invalid IL or missing references) //IL_1c1b: Unknown result type (might be due to invalid IL or missing references) //IL_1c20: Unknown result type (might be due to invalid IL or missing references) //IL_1c22: Unknown result type (might be due to invalid IL or missing references) //IL_1c2b: Unknown result type (might be due to invalid IL or missing references) //IL_1c3c: Unknown result type (might be due to invalid IL or missing references) //IL_1c5e: Unknown result type (might be due to invalid IL or missing references) //IL_1c63: Unknown result type (might be due to invalid IL or missing references) //IL_1c79: Unknown result type (might be due to invalid IL or missing references) //IL_1c7e: Unknown result type (might be due to invalid IL or missing references) //IL_1c94: Unknown result type (might be due to invalid IL or missing references) //IL_1c99: Unknown result type (might be due to invalid IL or missing references) //IL_1c9e: Unknown result type (might be due to invalid IL or missing references) //IL_1ca0: Unknown result type (might be due to invalid IL or missing references) //IL_1cbb: Unknown result type (might be due to invalid IL or missing references) //IL_1ccc: Unknown result type (might be due to invalid IL or missing references) //IL_1cee: Unknown result type (might be due to invalid IL or missing references) //IL_1cf3: Unknown result type (might be due to invalid IL or missing references) //IL_1d09: Unknown result type (might be due to invalid IL or missing references) //IL_1d0e: Unknown result type (might be due to invalid IL or missing references) //IL_1d24: Unknown result type (might be due to invalid IL or missing references) //IL_1d29: Unknown result type (might be due to invalid IL or missing references) //IL_1d2e: Unknown result type (might be due to invalid IL or missing references) //IL_1d30: Unknown result type (might be due to invalid IL or missing references) //IL_1d39: Unknown result type (might be due to invalid IL or missing references) //IL_1d4a: Unknown result type (might be due to invalid IL or missing references) //IL_1d6c: Unknown result type (might be due to invalid IL or missing references) //IL_1d71: Unknown result type (might be due to invalid IL or missing references) //IL_1d87: Unknown result type (might be due to invalid IL or missing references) //IL_1d8c: Unknown result type (might be due to invalid IL or missing references) //IL_1da2: Unknown result type (might be due to invalid IL or missing references) //IL_1da7: Unknown result type (might be due to invalid IL or missing references) //IL_1dac: Unknown result type (might be due to invalid IL or missing references) //IL_1dae: Unknown result type (might be due to invalid IL or missing references) //IL_1dc9: Unknown result type (might be due to invalid IL or missing references) //IL_1dda: Unknown result type (might be due to invalid IL or missing references) //IL_1dfc: Unknown result type (might be due to invalid IL or missing references) //IL_1e01: Unknown result type (might be due to invalid IL or missing references) //IL_1e17: Unknown result type (might be due to invalid IL or missing references) //IL_1e1c: Unknown result type (might be due to invalid IL or missing references) //IL_1e32: Unknown result type (might be due to invalid IL or missing references) //IL_1e37: Unknown result type (might be due to invalid IL or missing references) //IL_1e3c: Unknown result type (might be due to invalid IL or missing references) //IL_1e3e: Unknown result type (might be due to invalid IL or missing references) //IL_1e47: Unknown result type (might be due to invalid IL or missing references) //IL_1e58: Unknown result type (might be due to invalid IL or missing references) //IL_1e7a: Unknown result type (might be due to invalid IL or missing references) //IL_1e7f: Unknown result type (might be due to invalid IL or missing references) //IL_1e95: Unknown result type (might be due to invalid IL or missing references) //IL_1e9a: Unknown result type (might be due to invalid IL or missing references) //IL_1eb0: Unknown result type (might be due to invalid IL or missing references) //IL_1eb5: Unknown result type (might be due to invalid IL or missing references) //IL_1eba: Unknown result type (might be due to invalid IL or missing references) //IL_1ebc: Unknown result type (might be due to invalid IL or missing references) //IL_1ed7: Unknown result type (might be due to invalid IL or missing references) //IL_1ee8: Unknown result type (might be due to invalid IL or missing references) //IL_1f0a: Unknown result type (might be due to invalid IL or missing references) //IL_1f0f: Unknown result type (might be due to invalid IL or missing references) //IL_1f25: Unknown result type (might be due to invalid IL or missing references) //IL_1f2a: Unknown result type (might be due to invalid IL or missing references) //IL_1f40: Unknown result type (might be due to invalid IL or missing references) //IL_1f45: Unknown result type (might be due to invalid IL or missing references) //IL_1f4a: Unknown result type (might be due to invalid IL or missing references) //IL_1f4c: Unknown result type (might be due to invalid IL or missing references) //IL_1f55: Unknown result type (might be due to invalid IL or missing references) //IL_1f66: Unknown result type (might be due to invalid IL or missing references) //IL_1f88: Unknown result type (might be due to invalid IL or missing references) //IL_1f8d: Unknown result type (might be due to invalid IL or missing references) //IL_1fa3: Unknown result type (might be due to invalid IL or missing references) //IL_1fa8: Unknown result type (might be due to invalid IL or missing references) //IL_1fbe: Unknown result type (might be due to invalid IL or missing references) //IL_1fc3: Unknown result type (might be due to invalid IL or missing references) //IL_1fc8: Unknown result type (might be due to invalid IL or missing references) //IL_1fca: Unknown result type (might be due to invalid IL or missing references) //IL_1fe5: Unknown result type (might be due to invalid IL or missing references) //IL_1ff6: Unknown result type (might be due to invalid IL or missing references) //IL_2018: Unknown result type (might be due to invalid IL or missing references) //IL_201d: Unknown result type (might be due to invalid IL or missing references) //IL_2033: Unknown result type (might be due to invalid IL or missing references) //IL_2038: Unknown result type (might be due to invalid IL or missing references) //IL_204e: Unknown result type (might be due to invalid IL or missing references) //IL_2053: Unknown result type (might be due to invalid IL or missing references) //IL_2058: Unknown result type (might be due to invalid IL or missing references) //IL_205a: Unknown result type (might be due to invalid IL or missing references) //IL_2063: Unknown result type (might be due to invalid IL or missing references) //IL_2074: Unknown result type (might be due to invalid IL or missing references) //IL_2096: Unknown result type (might be due to invalid IL or missing references) //IL_209b: Unknown result type (might be due to invalid IL or missing references) //IL_20b1: Unknown result type (might be due to invalid IL or missing references) //IL_20b6: Unknown result type (might be due to invalid IL or missing references) //IL_20cc: Unknown result type (might be due to invalid IL or missing references) //IL_20d1: Unknown result type (might be due to invalid IL or missing references) //IL_20d6: Unknown result type (might be due to invalid IL or missing references) //IL_20d8: Unknown result type (might be due to invalid IL or missing references) //IL_20f3: Unknown result type (might be due to invalid IL or missing references) //IL_2104: Unknown result type (might be due to invalid IL or missing references) //IL_2126: Unknown result type (might be due to invalid IL or missing references) //IL_212b: Unknown result type (might be due to invalid IL or missing references) //IL_2141: Unknown result type (might be due to invalid IL or missing references) //IL_2146: Unknown result type (might be due to invalid IL or missing references) //IL_215c: Unknown result type (might be due to invalid IL or missing references) //IL_2161: Unknown result type (might be due to invalid IL or missing references) //IL_2166: Unknown result type (might be due to invalid IL or missing references) //IL_2168: Unknown result type (might be due to invalid IL or missing references) //IL_2171: Unknown result type (might be due to invalid IL or missing references) //IL_2182: Unknown result type (might be due to invalid IL or missing references) //IL_21a4: Unknown result type (might be due to invalid IL or missing references) //IL_21a9: Unknown result type (might be due to invalid IL or missing references) //IL_21bf: Unknown result type (might be due to invalid IL or missing references) //IL_21c4: Unknown result type (might be due to invalid IL or missing references) //IL_21da: Unknown result type (might be due to invalid IL or missing references) //IL_21df: Unknown result type (might be due to invalid IL or missing references) //IL_21e4: Unknown result type (might be due to invalid IL or missing references) //IL_21e6: Unknown result type (might be due to invalid IL or missing references) //IL_2201: Unknown result type (might be due to invalid IL or missing references) //IL_2212: Unknown result type (might be due to invalid IL or missing references) //IL_2234: Unknown result type (might be due to invalid IL or missing references) //IL_2239: Unknown result type (might be due to invalid IL or missing references) //IL_224f: Unknown result type (might be due to invalid IL or missing references) //IL_2254: Unknown result type (might be due to invalid IL or missing references) //IL_226a: Unknown result type (might be due to invalid IL or missing references) //IL_226f: Unknown result type (might be due to invalid IL or missing references) //IL_2274: Unknown result type (might be due to invalid IL or missing references) //IL_2276: Unknown result type (might be due to invalid IL or missing references) //IL_227f: Unknown result type (might be due to invalid IL or missing references) //IL_2290: Unknown result type (might be due to invalid IL or missing references) //IL_22b2: Unknown result type (might be due to invalid IL or missing references) //IL_22b7: Unknown result type (might be due to invalid IL or missing references) //IL_22cd: Unknown result type (might be due to invalid IL or missing references) //IL_22d2: Unknown result type (might be due to invalid IL or missing references) //IL_22e8: Unknown result type (might be due to invalid IL or missing references) //IL_22ed: Unknown result type (might be due to invalid IL or missing references) //IL_22f2: Unknown result type (might be due to invalid IL or missing references) //IL_22f4: Unknown result type (might be due to invalid IL or missing references) //IL_230f: Unknown result type (might be due to invalid IL or missing references) //IL_2320: Unknown result type (might be due to invalid IL or missing references) //IL_2342: Unknown result type (might be due to invalid IL or missing references) //IL_2347: Unknown result type (might be due to invalid IL or missing references) //IL_235d: Unknown result type (might be due to invalid IL or missing references) //IL_2362: Unknown result type (might be due to invalid IL or missing references) //IL_2378: Unknown result type (might be due to invalid IL or missing references) //IL_237d: Unknown result type (might be due to invalid IL or missing references) //IL_2382: Unknown result type (might be due to invalid IL or missing references) //IL_2384: Unknown result type (might be due to invalid IL or missing references) //IL_238d: Unknown result type (might be due to invalid IL or missing references) //IL_239e: Unknown result type (might be due to invalid IL or missing references) //IL_23c0: Unknown result type (might be due to invalid IL or missing references) //IL_23c5: Unknown result type (might be due to invalid IL or missing references) //IL_23db: Unknown result type (might be due to invalid IL or missing references) //IL_23e0: Unknown result type (might be due to invalid IL or missing references) //IL_23f6: Unknown result type (might be due to invalid IL or missing references) //IL_23fb: Unknown result type (might be due to invalid IL or missing references) //IL_2400: Unknown result type (might be due to invalid IL or missing references) //IL_2402: Unknown result type (might be due to invalid IL or missing references) //IL_241d: Unknown result type (might be due to invalid IL or missing references) //IL_242e: Unknown result type (might be due to invalid IL or missing references) //IL_2450: Unknown result type (might be due to invalid IL or missing references) //IL_2455: Unknown result type (might be due to invalid IL or missing references) //IL_246b: Unknown result type (might be due to invalid IL or missing references) //IL_2470: Unknown result type (might be due to invalid IL or missing references) //IL_2486: Unknown result type (might be due to invalid IL or missing references) //IL_248b: Unknown result type (might be due to invalid IL or missing references) //IL_2490: Unknown result type (might be due to invalid IL or missing references) //IL_2492: Unknown result type (might be due to invalid IL or missing references) //IL_249b: Unknown result type (might be due to invalid IL or missing references) //IL_24ac: Unknown result type (might be due to invalid IL or missing references) //IL_24ce: Unknown result type (might be due to invalid IL or missing references) //IL_24d3: Unknown result type (might be due to invalid IL or missing references) //IL_24e9: Unknown result type (might be due to invalid IL or missing references) //IL_24ee: Unknown result type (might be due to invalid IL or missing references) //IL_2504: Unknown result type (might be due to invalid IL or missing references) //IL_2509: Unknown result type (might be due to invalid IL or missing references) //IL_250e: Unknown result type (might be due to invalid IL or missing references) //IL_2510: Unknown result type (might be due to invalid IL or missing references) //IL_252b: Unknown result type (might be due to invalid IL or missing references) //IL_253c: Unknown result type (might be due to invalid IL or missing references) //IL_255e: Unknown result type (might be due to invalid IL or missing references) //IL_2563: Unknown result type (might be due to invalid IL or missing references) //IL_2579: Unknown result type (might be due to invalid IL or missing references) //IL_257e: Unknown result type (might be due to invalid IL or missing references) //IL_2594: Unknown result type (might be due to invalid IL or missing references) //IL_2599: Unknown result type (might be due to invalid IL or missing references) //IL_259e: Unknown result type (might be due to invalid IL or missing references) //IL_25a0: Unknown result type (might be due to invalid IL or missing references) //IL_25a9: Unknown result type (might be due to invalid IL or missing references) //IL_25ba: Unknown result type (might be due to invalid IL or missing references) //IL_25dc: Unknown result type (might be due to invalid IL or missing references) //IL_25e1: Unknown result type (might be due to invalid IL or missing references) //IL_25f7: Unknown result type (might be due to invalid IL or missing references) //IL_25fc: Unknown result type (might be due to invalid IL or missing references) //IL_2612: Unknown result type (might be due to invalid IL or missing references) //IL_2617: Unknown result type (might be due to invalid IL or missing references) //IL_261c: Unknown result type (might be due to invalid IL or missing references) //IL_261e: Unknown result type (might be due to invalid IL or missing references) //IL_2639: Unknown result type (might be due to invalid IL or missing references) //IL_264a: Unknown result type (might be due to invalid IL or missing references) //IL_266c: Unknown result type (might be due to invalid IL or missing references) //IL_2671: Unknown result type (might be due to invalid IL or missing references) //IL_2687: Unknown result type (might be due to invalid IL or missing references) //IL_268c: Unknown result type (might be due to invalid IL or missing references) //IL_26a2: Unknown result type (might be due to invalid IL or missing references) //IL_26a7: Unknown result type (might be due to invalid IL or missing references) //IL_26ac: Unknown result type (might be due to invalid IL or missing references) //IL_26ae: Unknown result type (might be due to invalid IL or missing references) //IL_26b7: Unknown result type (might be due to invalid IL or missing references) //IL_26c8: Unknown result type (might be due to invalid IL or missing references) //IL_26ea: Unknown result type (might be due to invalid IL or missing references) //IL_26ef: Unknown result type (might be due to invalid IL or missing references) //IL_2705: Unknown result type (might be due to invalid IL or missing references) //IL_270a: Unknown result type (might be due to invalid IL or missing references) //IL_2720: Unknown result type (might be due to invalid IL or missing references) //IL_2725: Unknown result type (might be due to invalid IL or missing references) //IL_272a: Unknown result type (might be due to invalid IL or missing references) //IL_272c: Unknown result type (might be due to invalid IL or missing references) //IL_2747: Unknown result type (might be due to invalid IL or missing references) //IL_2758: Unknown result type (might be due to invalid IL or missing references) //IL_277a: Unknown result type (might be due to invalid IL or missing references) //IL_277f: Unknown result type (might be due to invalid IL or missing references) //IL_2795: Unknown result type (might be due to invalid IL or missing references) //IL_279a: Unknown result type (might be due to invalid IL or missing references) //IL_27b0: Unknown result type (might be due to invalid IL or missing references) //IL_27b5: Unknown result type (might be due to invalid IL or missing references) //IL_27ba: Unknown result type (might be due to invalid IL or missing references) //IL_27bc: Unknown result type (might be due to invalid IL or missing references) //IL_27c5: Unknown result type (might be due to invalid IL or missing references) //IL_27d6: Unknown result type (might be due to invalid IL or missing references) //IL_27f8: Unknown result type (might be due to invalid IL or missing references) //IL_27fd: Unknown result type (might be due to invalid IL or missing references) //IL_2813: Unknown result type (might be due to invalid IL or missing references) //IL_2818: Unknown result type (might be due to invalid IL or missing references) //IL_282e: Unknown result type (might be due to invalid IL or missing references) //IL_2833: Unknown result type (might be due to invalid IL or missing references) //IL_2838: Unknown result type (might be due to invalid IL or missing references) //IL_283a: Unknown result type (might be due to invalid IL or missing references) //IL_2855: Unknown result type (might be due to invalid IL or missing references) //IL_2866: Unknown result type (might be due to invalid IL or missing references) //IL_2888: Unknown result type (might be due to invalid IL or missing references) //IL_288d: Unknown result type (might be due to invalid IL or missing references) //IL_28a3: Unknown result type (might be due to invalid IL or missing references) //IL_28a8: Unknown result type (might be due to invalid IL or missing references) //IL_28be: Unknown result type (might be due to invalid IL or missing references) //IL_28c3: Unknown result type (might be due to invalid IL or missing references) //IL_28c8: Unknown result type (might be due to invalid IL or missing references) //IL_28ca: Unknown result type (might be due to invalid IL or missing references) //IL_28d3: Unknown result type (might be due to invalid IL or missing references) //IL_28e4: Unknown result type (might be due to invalid IL or missing references) //IL_2906: Unknown result type (might be due to invalid IL or missing references) //IL_290b: Unknown result type (might be due to invalid IL or missing references) //IL_2921: Unknown result type (might be due to invalid IL or missing references) //IL_2926: Unknown result type (might be due to invalid IL or missing references) //IL_293c: Unknown result type (might be due to invalid IL or missing references) //IL_2941: Unknown result type (might be due to invalid IL or missing references) //IL_2946: Unknown result type (might be due to invalid IL or missing references) //IL_2948: Unknown result type (might be due to invalid IL or missing references) //IL_2963: Unknown result type (might be due to invalid IL or missing references) //IL_2974: Unknown result type (might be due to invalid IL or missing references) //IL_2996: Unknown result type (might be due to invalid IL or missing references) //IL_299b: Unknown result type (might be due to invalid IL or missing references) //IL_29b1: Unknown result type (might be due to invalid IL or missing references) //IL_29b6: Unknown result type (might be due to invalid IL or missing references) //IL_29cc: Unknown result type (might be due to invalid IL or missing references) //IL_29d1: Unknown result type (might be due to invalid IL or missing references) //IL_29d6: Unknown result type (might be due to invalid IL or missing references) //IL_29d8: Unknown result type (might be due to invalid IL or missing references) //IL_29e1: Unknown result type (might be due to invalid IL or missing references) //IL_29f2: Unknown result type (might be due to invalid IL or missing references) //IL_2a14: Unknown result type (might be due to invalid IL or missing references) //IL_2a19: Unknown result type (might be due to invalid IL or missing references) //IL_2a2f: Unknown result type (might be due to invalid IL or missing references) //IL_2a34: Unknown result type (might be due to invalid IL or missing references) //IL_2a4a: Unknown result type (might be due to invalid IL or missing references) //IL_2a4f: Unknown result type (might be due to invalid IL or missing references) //IL_2a54: Unknown result type (might be due to invalid IL or missing references) //IL_2a56: Unknown result type (might be due to invalid IL or missing references) //IL_2a71: Unknown result type (might be due to invalid IL or missing references) //IL_2a82: Unknown result type (might be due to invalid IL or missing references) //IL_2aa4: Unknown result type (might be due to invalid IL or missing references) //IL_2aa9: Unknown result type (might be due to invalid IL or missing references) //IL_2abf: Unknown result type (might be due to invalid IL or missing references) //IL_2ac4: Unknown result type (might be due to invalid IL or missing references) //IL_2ada: Unknown result type (might be due to invalid IL or missing references) //IL_2adf: Unknown result type (might be due to invalid IL or missing references) //IL_2ae4: Unknown result type (might be due to invalid IL or missing references) //IL_2ae6: Unknown result type (might be due to invalid IL or missing references) //IL_2aef: Unknown result type (might be due to invalid IL or missing references) //IL_2b00: Unknown result type (might be due to invalid IL or missing references) //IL_2b22: Unknown result type (might be due to invalid IL or missing references) //IL_2b27: Unknown result type (might be due to invalid IL or missing references) //IL_2b3d: Unknown result type (might be due to invalid IL or missing references) //IL_2b42: Unknown result type (might be due to invalid IL or missing references) //IL_2b58: Unknown result type (might be due to invalid IL or missing references) //IL_2b5d: Unknown result type (might be due to invalid IL or missing references) //IL_2b62: Unknown result type (might be due to invalid IL or missing references) //IL_2b64: Unknown result type (might be due to invalid IL or missing references) //IL_2b7f: Unknown result type (might be due to invalid IL or missing references) //IL_2b90: Unknown result type (might be due to invalid IL or missing references) //IL_2bb2: Unknown result type (might be due to invalid IL or missing references) //IL_2bb7: Unknown result type (might be due to invalid IL or missing references) //IL_2bcd: Unknown result type (might be due to invalid IL or missing references) //IL_2bd2: Unknown result type (might be due to invalid IL or missing references) //IL_2be8: Unknown result type (might be due to invalid IL or missing references) //IL_2bed: Unknown result type (might be due to invalid IL or missing references) //IL_2bf2: Unknown result type (might be due to invalid IL or missing references) //IL_2bf4: Unknown result type (might be due to invalid IL or missing references) //IL_2bfd: Unknown result type (might be due to invalid IL or missing references) //IL_2c0e: Unknown result type (might be due to invalid IL or missing references) //IL_2c30: Unknown result type (might be due to invalid IL or missing references) //IL_2c35: Unknown result type (might be due to invalid IL or missing references) //IL_2c4b: Unknown result type (might be due to invalid IL or missing references) //IL_2c50: Unknown result type (might be due to invalid IL or missing references) //IL_2c66: Unknown result type (might be due to invalid IL or missing references) //IL_2c6b: Unknown result type (might be due to invalid IL or missing references) //IL_2c70: Unknown result type (might be due to invalid IL or missing references) //IL_2c72: Unknown result type (might be due to invalid IL or missing references) //IL_2c8d: Unknown result type (might be due to invalid IL or missing references) //IL_2c9e: Unknown result type (might be due to invalid IL or missing references) //IL_2cc0: Unknown result type (might be due to invalid IL or missing references) //IL_2cc5: Unknown result type (might be due to invalid IL or missing references) //IL_2cdb: Unknown result type (might be due to invalid IL or missing references) //IL_2ce0: Unknown result type (might be due to invalid IL or missing references) //IL_2cf6: Unknown result type (might be due to invalid IL or missing references) //IL_2cfb: Unknown result type (might be due to invalid IL or missing references) //IL_2d00: Unknown result type (might be due to invalid IL or missing references) //IL_2d02: Unknown result type (might be due to invalid IL or missing references) //IL_2d0b: Unknown result type (might be due to invalid IL or missing references) //IL_2d1c: Unknown result type (might be due to invalid IL or missing references) //IL_2d3e: Unknown result type (might be due to invalid IL or missing references) //IL_2d43: Unknown result type (might be due to invalid IL or missing references) //IL_2d59: Unknown result type (might be due to invalid IL or missing references) //IL_2d5e: Unknown result type (might be due to invalid IL or missing references) //IL_2d74: Unknown result type (might be due to invalid IL or missing references) //IL_2d79: Unknown result type (might be due to invalid IL or missing references) //IL_2d7e: Unknown result type (might be due to invalid IL or missing references) //IL_2d80: Unknown result type (might be due to invalid IL or missing references) ItemDisplayRuleDict val = new ItemDisplayRuleDict(Array.Empty()); GameObject itemModel = ItemModel; if (!((Object)itemModel).name.Contains("mdl3d")) { return val; } val.Add("EquipmentDroneBody", (ItemDisplayRule[])(object)new ItemDisplayRule[2] { new ItemDisplayRule { followerPrefab = itemModel, ruleType = (ItemDisplayRuleType)0, childName = "GunBarrelBase", localPos = new Vector3(0.6f, 0f, 0f), localAngles = new Vector3(90f, 180f, 0f), localScale = new Vector3(0.25f, 0.25f, 0.25f) }, new ItemDisplayRule { followerPrefab = itemModel, ruleType = (ItemDisplayRuleType)0, childName = "GunBarrelBase", localPos = new Vector3(-0.6f, 0f, 0f), localAngles = new Vector3(90f, 180f, 0f), localScale = new Vector3(-0.25f, 0.25f, 0.25f) } }); val.Add("Drone1Body", (ItemDisplayRule[])(object)new ItemDisplayRule[2] { new ItemDisplayRule { followerPrefab = itemModel, ruleType = (ItemDisplayRuleType)0, childName = "Head", localPos = new Vector3(0.5f, 0f, 0f), localAngles = new Vector3(0f, 0f, 180f), localScale = new Vector3(0.5f, 0.5f, 0.5f) }, new ItemDisplayRule { followerPrefab = itemModel, ruleType = (ItemDisplayRuleType)0, childName = "Head", localPos = new Vector3(-0.5f, 0f, 0f), localAngles = new Vector3(0f, 0f, 0f), localScale = new Vector3(0.5f, -0.5f, 0.5f) } }); val.Add("Drone1BodyRemoteOp", (ItemDisplayRule[])(object)new ItemDisplayRule[2] { new ItemDisplayRule { followerPrefab = itemModel, ruleType = (ItemDisplayRuleType)0, childName = "Head", localPos = new Vector3(0.5f, 0f, 0f), localAngles = new Vector3(0f, 0f, 180f), localScale = new Vector3(0.5f, 0.5f, 0.5f) }, new ItemDisplayRule { followerPrefab = itemModel, ruleType = (ItemDisplayRuleType)0, childName = "Head", localPos = new Vector3(-0.5f, 0f, 0f), localAngles = new Vector3(0f, 0f, 0f), localScale = new Vector3(0.5f, -0.5f, 0.5f) } }); val.Add("DTGunnerDroneBody", (ItemDisplayRule[])(object)new ItemDisplayRule[2] { new ItemDisplayRule { followerPrefab = itemModel, ruleType = (ItemDisplayRuleType)0, childName = "Head", localPos = new Vector3(0.5f, 0f, 0f), localAngles = new Vector3(0f, 0f, 180f), localScale = new Vector3(0.5f, 0.5f, 0.5f) }, new ItemDisplayRule { followerPrefab = itemModel, ruleType = (ItemDisplayRuleType)0, childName = "Head", localPos = new Vector3(-0.5f, 0f, 0f), localAngles = new Vector3(0f, 0f, 0f), localScale = new Vector3(0.5f, -0.5f, 0.5f) } }); val.Add("CLASSICITEMSRETURNS_BODY_RepairDroneBody", (ItemDisplayRule[])(object)new ItemDisplayRule[2] { new ItemDisplayRule { followerPrefab = itemModel, ruleType = (ItemDisplayRuleType)0, childName = "Head", localPos = new Vector3(0.5f, 0f, 0f), localAngles = new Vector3(0f, 0f, 180f), localScale = new Vector3(0.5f, 0.5f, 0.5f) }, new ItemDisplayRule { followerPrefab = itemModel, ruleType = (ItemDisplayRuleType)0, childName = "Head", localPos = new Vector3(-0.5f, 0f, 0f), localAngles = new Vector3(0f, 0f, 0f), localScale = new Vector3(0.5f, -0.5f, 0.5f) } }); val.Add("Drone2Body", (ItemDisplayRule[])(object)new ItemDisplayRule[2] { new ItemDisplayRule { followerPrefab = itemModel, ruleType = (ItemDisplayRuleType)0, childName = "HeadCenter", localPos = new Vector3(0.5f, 0f, 0f), localAngles = new Vector3(270f, 180f, 0f), localScale = new Vector3(0.5f, 0.5f, 0.5f) }, new ItemDisplayRule { followerPrefab = itemModel, ruleType = (ItemDisplayRuleType)0, childName = "HeadCenter", localPos = new Vector3(-0.5f, 0f, 0f), localAngles = new Vector3(270f, 180f, 0f), localScale = new Vector3(-0.5f, 0.5f, 0.5f) } }); val.Add("Drone2BodyRemoteOp", (ItemDisplayRule[])(object)new ItemDisplayRule[2] { new ItemDisplayRule { followerPrefab = itemModel, ruleType = (ItemDisplayRuleType)0, childName = "HeadCenter", localPos = new Vector3(0.5f, 0f, 0f), localAngles = new Vector3(270f, 180f, 0f), localScale = new Vector3(0.5f, 0.5f, 0.5f) }, new ItemDisplayRule { followerPrefab = itemModel, ruleType = (ItemDisplayRuleType)0, childName = "HeadCenter", localPos = new Vector3(-0.5f, 0f, 0f), localAngles = new Vector3(270f, 180f, 0f), localScale = new Vector3(-0.5f, 0.5f, 0.5f) } }); val.Add("DTHealingDroneBody", (ItemDisplayRule[])(object)new ItemDisplayRule[2] { new ItemDisplayRule { followerPrefab = itemModel, ruleType = (ItemDisplayRuleType)0, childName = "HeadCenter", localPos = new Vector3(0.5f, 0f, 0f), localAngles = new Vector3(270f, 180f, 0f), localScale = new Vector3(0.5f, 0.5f, 0.5f) }, new ItemDisplayRule { followerPrefab = itemModel, ruleType = (ItemDisplayRuleType)0, childName = "HeadCenter", localPos = new Vector3(-0.5f, 0f, 0f), localAngles = new Vector3(270f, 180f, 0f), localScale = new Vector3(-0.5f, 0.5f, 0.5f) } }); val.Add("BackupDroneBody", (ItemDisplayRule[])(object)new ItemDisplayRule[2] { new ItemDisplayRule { followerPrefab = itemModel, ruleType = (ItemDisplayRuleType)0, childName = "HeadCenter", localPos = new Vector3(0.5f, 0.35f, 0.2f), localAngles = new Vector3(0f, 180f, 0f), localScale = new Vector3(0.25f, 0.25f, 0.25f) }, new ItemDisplayRule { followerPrefab = itemModel, ruleType = (ItemDisplayRuleType)0, childName = "HeadCenter", localPos = new Vector3(-0.5f, 0.35f, 0.2f), localAngles = new Vector3(0f, 180f, 0f), localScale = new Vector3(-0.25f, 0.25f, 0.25f) } }); val.Add("BackupDroneBodyRemoteOp", (ItemDisplayRule[])(object)new ItemDisplayRule[2] { new ItemDisplayRule { followerPrefab = itemModel, ruleType = (ItemDisplayRuleType)0, childName = "HeadCenter", localPos = new Vector3(0.5f, 0.35f, 0.2f), localAngles = new Vector3(0f, 180f, 0f), localScale = new Vector3(0.25f, 0.25f, 0.25f) }, new ItemDisplayRule { followerPrefab = itemModel, ruleType = (ItemDisplayRuleType)0, childName = "HeadCenter", localPos = new Vector3(-0.5f, 0.35f, 0.2f), localAngles = new Vector3(0f, 180f, 0f), localScale = new Vector3(-0.25f, 0.25f, 0.25f) } }); val.Add("DroneCommanderBody", (ItemDisplayRule[])(object)new ItemDisplayRule[2] { new ItemDisplayRule { followerPrefab = itemModel, ruleType = (ItemDisplayRuleType)0, childName = "HeadCenter", localPos = new Vector3(0.2f, -0.07f, 0f), localAngles = new Vector3(0f, 180f, 0f), localScale = new Vector3(0.125f, 0.125f, 0.125f) }, new ItemDisplayRule { followerPrefab = itemModel, ruleType = (ItemDisplayRuleType)0, childName = "HeadCenter", localPos = new Vector3(-0.2f, -0.07f, 0f), localAngles = new Vector3(0f, 180f, 0f), localScale = new Vector3(-0.125f, 0.125f, 0.125f) } }); val.Add("DroneBomberBody", (ItemDisplayRule[])(object)new ItemDisplayRule[2] { new ItemDisplayRule { followerPrefab = itemModel, ruleType = (ItemDisplayRuleType)0, childName = "HeadCenter", localPos = new Vector3(0.2f, -0.07f, 0f), localAngles = new Vector3(0f, 180f, 0f), localScale = new Vector3(0.125f, 0.125f, 0.125f) }, new ItemDisplayRule { followerPrefab = itemModel, ruleType = (ItemDisplayRuleType)0, childName = "HeadCenter", localPos = new Vector3(-0.2f, -0.07f, 0f), localAngles = new Vector3(0f, 180f, 0f), localScale = new Vector3(-0.125f, 0.125f, 0.125f) } }); val.Add("EmergencyDroneBody", (ItemDisplayRule[])(object)new ItemDisplayRule[2] { new ItemDisplayRule { followerPrefab = itemModel, ruleType = (ItemDisplayRuleType)0, childName = "TopRing", localPos = new Vector3(2.7f, 2.57f, 0f), localAngles = new Vector3(0f, 180f, 0f), localScale = new Vector3(0.5f, 0.5f, 0.5f) }, new ItemDisplayRule { followerPrefab = itemModel, ruleType = (ItemDisplayRuleType)0, childName = "TopRing", localPos = new Vector3(-2.7f, 2.57f, 0f), localAngles = new Vector3(0f, 180f, 0f), localScale = new Vector3(-0.5f, 0.5f, 0.5f) } }); val.Add("EmergencyDroneBodyRemoteOp", (ItemDisplayRule[])(object)new ItemDisplayRule[2] { new ItemDisplayRule { followerPrefab = itemModel, ruleType = (ItemDisplayRuleType)0, childName = "TopRing", localPos = new Vector3(2.7f, 2.57f, 0f), localAngles = new Vector3(0f, 180f, 0f), localScale = new Vector3(0.5f, 0.5f, 0.5f) }, new ItemDisplayRule { followerPrefab = itemModel, ruleType = (ItemDisplayRuleType)0, childName = "TopRing", localPos = new Vector3(-2.7f, 2.57f, 0f), localAngles = new Vector3(0f, 180f, 0f), localScale = new Vector3(-0.5f, 0.5f, 0.5f) } }); val.Add("FlameDroneBody", (ItemDisplayRule[])(object)new ItemDisplayRule[2] { new ItemDisplayRule { followerPrefab = itemModel, ruleType = (ItemDisplayRuleType)0, childName = "HeadCenter", localPos = new Vector3(-0.5f, -0.25f, 0f), localAngles = new Vector3(0f, 0f, 180f), localScale = new Vector3(-0.35f, 0.35f, 0.35f) }, new ItemDisplayRule { followerPrefab = itemModel, ruleType = (ItemDisplayRuleType)0, childName = "HeadCenter", localPos = new Vector3(0.5f, -0.25f, 0f), localAngles = new Vector3(0f, 0f, 180f), localScale = new Vector3(0.35f, 0.35f, 0.35f) } }); val.Add("FlameDroneBodyRemoteOp", (ItemDisplayRule[])(object)new ItemDisplayRule[2] { new ItemDisplayRule { followerPrefab = itemModel, ruleType = (ItemDisplayRuleType)0, childName = "HeadCenter", localPos = new Vector3(-0.5f, -0.25f, 0f), localAngles = new Vector3(0f, 0f, 180f), localScale = new Vector3(-0.35f, 0.35f, 0.35f) }, new ItemDisplayRule { followerPrefab = itemModel, ruleType = (ItemDisplayRuleType)0, childName = "HeadCenter", localPos = new Vector3(0.5f, -0.25f, 0f), localAngles = new Vector3(0f, 0f, 180f), localScale = new Vector3(0.35f, 0.35f, 0.35f) } }); val.Add("MegaDroneBody", (ItemDisplayRule[])(object)new ItemDisplayRule[2] { new ItemDisplayRule { followerPrefab = itemModel, ruleType = (ItemDisplayRuleType)0, childName = "Base", localPos = new Vector3(2.7f, 0.72f, 0.2f), localAngles = new Vector3(90f, 180f, 0f), localScale = new Vector3(0.4f, 0.4f, 0.4f) }, new ItemDisplayRule { followerPrefab = itemModel, ruleType = (ItemDisplayRuleType)0, childName = "Base", localPos = new Vector3(-2.7f, 0.72f, 0.2f), localAngles = new Vector3(90f, 180f, 0f), localScale = new Vector3(-0.4f, 0.4f, 0.4f) } }); val.Add("MegaDroneBodyRemoteOp", (ItemDisplayRule[])(object)new ItemDisplayRule[2] { new ItemDisplayRule { followerPrefab = itemModel, ruleType = (ItemDisplayRuleType)0, childName = "Base", localPos = new Vector3(2.7f, 0.72f, 0.2f), localAngles = new Vector3(90f, 180f, 0f), localScale = new Vector3(0.4f, 0.4f, 0.4f) }, new ItemDisplayRule { followerPrefab = itemModel, ruleType = (ItemDisplayRuleType)0, childName = "Base", localPos = new Vector3(-2.7f, 0.72f, 0.2f), localAngles = new Vector3(90f, 180f, 0f), localScale = new Vector3(-0.4f, 0.4f, 0.4f) } }); val.Add("MissileDroneBody", (ItemDisplayRule[])(object)new ItemDisplayRule[2] { new ItemDisplayRule { followerPrefab = itemModel, ruleType = (ItemDisplayRuleType)0, childName = "Body", localPos = new Vector3(0.6f, 0.5f, 0f), localAngles = new Vector3(0f, 180f, 0f), localScale = new Vector3(0.35f, 0.35f, 0.35f) }, new ItemDisplayRule { followerPrefab = itemModel, ruleType = (ItemDisplayRuleType)0, childName = "Body", localPos = new Vector3(-0.6f, 0.5f, 0f), localAngles = new Vector3(0f, 180f, 0f), localScale = new Vector3(-0.35f, 0.35f, 0.35f) } }); val.Add("MissileDroneBodyRemoteOp", (ItemDisplayRule[])(object)new ItemDisplayRule[2] { new ItemDisplayRule { followerPrefab = itemModel, ruleType = (ItemDisplayRuleType)0, childName = "Body", localPos = new Vector3(0.6f, 0.5f, 0f), localAngles = new Vector3(0f, 180f, 0f), localScale = new Vector3(0.35f, 0.35f, 0.35f) }, new ItemDisplayRule { followerPrefab = itemModel, ruleType = (ItemDisplayRuleType)0, childName = "Body", localPos = new Vector3(-0.6f, 0.5f, 0f), localAngles = new Vector3(0f, 180f, 0f), localScale = new Vector3(-0.35f, 0.35f, 0.35f) } }); val.Add("Turret1Body", (ItemDisplayRule[])(object)new ItemDisplayRule[2] { new ItemDisplayRule { followerPrefab = itemModel, ruleType = (ItemDisplayRuleType)0, childName = "Top", localPos = new Vector3(1.5f, 0.7f, -0.1f), localAngles = new Vector3(0f, 180f, 0f), localScale = new Vector3(1f, 1f, 1f) }, new ItemDisplayRule { followerPrefab = itemModel, ruleType = (ItemDisplayRuleType)0, childName = "Top", localPos = new Vector3(-1.5f, 0.7f, -0.1f), localAngles = new Vector3(0f, 180f, 0f), localScale = new Vector3(-1f, 1f, 1f) } }); val.Add("EngiTurretBody", (ItemDisplayRule[])(object)new ItemDisplayRule[2] { new ItemDisplayRule { followerPrefab = itemModel, ruleType = (ItemDisplayRuleType)0, childName = "Head", localPos = new Vector3(0.6f, 0.42f, -0.66f), localAngles = new Vector3(0f, 180f, 0f), localScale = new Vector3(0.25f, 0.25f, 0.25f) }, new ItemDisplayRule { followerPrefab = itemModel, ruleType = (ItemDisplayRuleType)0, childName = "Head", localPos = new Vector3(-0.6f, 0.42f, -0.66f), localAngles = new Vector3(0f, 180f, 0f), localScale = new Vector3(-0.25f, 0.25f, 0.25f) } }); val.Add("EngiBeamTurretBody", (ItemDisplayRule[])(object)new ItemDisplayRule[2] { new ItemDisplayRule { followerPrefab = itemModel, ruleType = (ItemDisplayRuleType)0, childName = "Head", localPos = new Vector3(0.6f, 0.42f, -0.66f), localAngles = new Vector3(0f, 180f, 0f), localScale = new Vector3(0.25f, 0.25f, 0.25f) }, new ItemDisplayRule { followerPrefab = itemModel, ruleType = (ItemDisplayRuleType)0, childName = "Head", localPos = new Vector3(-0.6f, 0.42f, -0.66f), localAngles = new Vector3(0f, 180f, 0f), localScale = new Vector3(-0.25f, 0.25f, 0.25f) } }); val.Add("EngiWalkerTurretBody", (ItemDisplayRule[])(object)new ItemDisplayRule[2] { new ItemDisplayRule { followerPrefab = itemModel, ruleType = (ItemDisplayRuleType)0, childName = "Head", localPos = new Vector3(0.5f, 0.8f, -1f), localAngles = new Vector3(0f, 180f, 0f), localScale = new Vector3(0.25f, 0.25f, 0.25f) }, new ItemDisplayRule { followerPrefab = itemModel, ruleType = (ItemDisplayRuleType)0, childName = "Head", localPos = new Vector3(-0.5f, 0.8f, -1f), localAngles = new Vector3(0f, 180f, 0f), localScale = new Vector3(-0.25f, 0.25f, 0.25f) } }); val.Add("CopycatDroneBody", (ItemDisplayRule[])(object)new ItemDisplayRule[2] { new ItemDisplayRule { followerPrefab = itemModel, ruleType = (ItemDisplayRuleType)0, childName = "Head", localPos = new Vector3(0.25f, -0.32f, 0.15f), localAngles = new Vector3(0f, 180f, 0f), localScale = new Vector3(0.2f, 0.2f, 0.2f) }, new ItemDisplayRule { followerPrefab = itemModel, ruleType = (ItemDisplayRuleType)0, childName = "Head", localPos = new Vector3(-0.25f, -0.32f, 0.15f), localAngles = new Vector3(0f, 180f, 0f), localScale = new Vector3(-0.2f, 0.2f, 0.2f) } }); val.Add("CopycatDroneBodyRemoteOp", (ItemDisplayRule[])(object)new ItemDisplayRule[2] { new ItemDisplayRule { followerPrefab = itemModel, ruleType = (ItemDisplayRuleType)0, childName = "Head", localPos = new Vector3(0.25f, -0.32f, 0.15f), localAngles = new Vector3(0f, 180f, 0f), localScale = new Vector3(0.2f, 0.2f, 0.2f) }, new ItemDisplayRule { followerPrefab = itemModel, ruleType = (ItemDisplayRuleType)0, childName = "Head", localPos = new Vector3(-0.25f, -0.32f, 0.15f), localAngles = new Vector3(0f, 180f, 0f), localScale = new Vector3(-0.2f, 0.2f, 0.2f) } }); val.Add("HaulerDroneBody", (ItemDisplayRule[])(object)new ItemDisplayRule[2] { new ItemDisplayRule { followerPrefab = itemModel, ruleType = (ItemDisplayRuleType)0, childName = "Head", localPos = new Vector3(0.5f, -0.38f, 0.3f), localAngles = new Vector3(0f, 180f, 0f), localScale = new Vector3(0.3f, 0.3f, 0.3f) }, new ItemDisplayRule { followerPrefab = itemModel, ruleType = (ItemDisplayRuleType)0, childName = "Head", localPos = new Vector3(-0.5f, -0.38f, 0.3f), localAngles = new Vector3(0f, 180f, 0f), localScale = new Vector3(-0.3f, 0.3f, 0.3f) } }); val.Add("HaulerDroneBodyRemoteOp", (ItemDisplayRule[])(object)new ItemDisplayRule[2] { new ItemDisplayRule { followerPrefab = itemModel, ruleType = (ItemDisplayRuleType)0, childName = "Head", localPos = new Vector3(0.5f, -0.38f, 0.3f), localAngles = new Vector3(0f, 180f, 0f), localScale = new Vector3(0.3f, 0.3f, 0.3f) }, new ItemDisplayRule { followerPrefab = itemModel, ruleType = (ItemDisplayRuleType)0, childName = "Head", localPos = new Vector3(-0.5f, -0.38f, 0.3f), localAngles = new Vector3(0f, 180f, 0f), localScale = new Vector3(-0.3f, 0.3f, 0.3f) } }); val.Add("DTHaulerDroneBody", (ItemDisplayRule[])(object)new ItemDisplayRule[2] { new ItemDisplayRule { followerPrefab = itemModel, ruleType = (ItemDisplayRuleType)0, childName = "Head", localPos = new Vector3(0.5f, -0.38f, 0.3f), localAngles = new Vector3(0f, 180f, 0f), localScale = new Vector3(0.3f, 0.3f, 0.3f) }, new ItemDisplayRule { followerPrefab = itemModel, ruleType = (ItemDisplayRuleType)0, childName = "Head", localPos = new Vector3(-0.5f, -0.38f, 0.3f), localAngles = new Vector3(0f, 180f, 0f), localScale = new Vector3(-0.3f, 0.3f, 0.3f) } }); val.Add("JunkDroneBody", (ItemDisplayRule[])(object)new ItemDisplayRule[2] { new ItemDisplayRule { followerPrefab = itemModel, ruleType = (ItemDisplayRuleType)0, childName = "RightBody", localPos = new Vector3(0.5f, -0.15f, 0.4f), localAngles = new Vector3(0f, 180f, 0f), localScale = new Vector3(0.3f, 0.3f, -0.3f) }, new ItemDisplayRule { followerPrefab = itemModel, ruleType = (ItemDisplayRuleType)0, childName = "LeftBody", localPos = new Vector3(-0.5f, -0.15f, 0.4f), localAngles = new Vector3(0f, 180f, 0f), localScale = new Vector3(-0.3f, 0.3f, -0.3f) } }); val.Add("JunkDroneBodyRemoteOp", (ItemDisplayRule[])(object)new ItemDisplayRule[2] { new ItemDisplayRule { followerPrefab = itemModel, ruleType = (ItemDisplayRuleType)0, childName = "RightBody", localPos = new Vector3(0.5f, -0.15f, 0.4f), localAngles = new Vector3(0f, 180f, 0f), localScale = new Vector3(0.3f, 0.3f, -0.3f) }, new ItemDisplayRule { followerPrefab = itemModel, ruleType = (ItemDisplayRuleType)0, childName = "LeftBody", localPos = new Vector3(-0.5f, -0.15f, 0.4f), localAngles = new Vector3(0f, 180f, 0f), localScale = new Vector3(-0.3f, 0.3f, -0.3f) } }); val.Add("CleanupDroneBody", (ItemDisplayRule[])(object)new ItemDisplayRule[2] { new ItemDisplayRule { followerPrefab = itemModel, ruleType = (ItemDisplayRuleType)0, childName = "Head", localPos = new Vector3(0.5f, -0.4f, 0.4f), localAngles = new Vector3(0f, 180f, 0f), localScale = new Vector3(0.5f, 0.5f, 0.5f) }, new ItemDisplayRule { followerPrefab = itemModel, ruleType = (ItemDisplayRuleType)0, childName = "Head", localPos = new Vector3(-0.5f, -0.4f, 0.4f), localAngles = new Vector3(0f, 180f, 0f), localScale = new Vector3(-0.5f, 0.5f, 0.5f) } }); val.Add("CleanupDroneBodyRemoteOp", (ItemDisplayRule[])(object)new ItemDisplayRule[2] { new ItemDisplayRule { followerPrefab = itemModel, ruleType = (ItemDisplayRuleType)0, childName = "Head", localPos = new Vector3(0.5f, -0.4f, 0.4f), localAngles = new Vector3(0f, 180f, 0f), localScale = new Vector3(0.5f, 0.5f, 0.5f) }, new ItemDisplayRule { followerPrefab = itemModel, ruleType = (ItemDisplayRuleType)0, childName = "Head", localPos = new Vector3(-0.5f, -0.4f, 0.4f), localAngles = new Vector3(0f, 180f, 0f), localScale = new Vector3(-0.5f, 0.5f, 0.5f) } }); val.Add("BombardmentDroneBody", (ItemDisplayRule[])(object)new ItemDisplayRule[2] { new ItemDisplayRule { followerPrefab = itemModel, ruleType = (ItemDisplayRuleType)0, childName = "Muzzle", localPos = new Vector3(0.45f, 0.22f, 0.12f), localAngles = new Vector3(0f, 180f, 0f), localScale = new Vector3(0.3f, 0.3f, 0.3f) }, new ItemDisplayRule { followerPrefab = itemModel, ruleType = (ItemDisplayRuleType)0, childName = "Muzzle", localPos = new Vector3(-0.45f, 0.22f, 0.12f), localAngles = new Vector3(0f, 180f, 0f), localScale = new Vector3(-0.3f, 0.3f, 0.3f) } }); val.Add("BombardmentDroneBodyRemoteOp", (ItemDisplayRule[])(object)new ItemDisplayRule[2] { new ItemDisplayRule { followerPrefab = itemModel, ruleType = (ItemDisplayRuleType)0, childName = "Muzzle", localPos = new Vector3(0.45f, 0.22f, 0.12f), localAngles = new Vector3(0f, 180f, 0f), localScale = new Vector3(0.3f, 0.3f, 0.3f) }, new ItemDisplayRule { followerPrefab = itemModel, ruleType = (ItemDisplayRuleType)0, childName = "Muzzle", localPos = new Vector3(-0.45f, 0.22f, 0.12f), localAngles = new Vector3(0f, 180f, 0f), localScale = new Vector3(-0.3f, 0.3f, 0.3f) } }); val.Add("JailerDroneBody", (ItemDisplayRule[])(object)new ItemDisplayRule[2] { new ItemDisplayRule { followerPrefab = itemModel, ruleType = (ItemDisplayRuleType)0, childName = "Panel1", localPos = new Vector3(0.35f, -0.1f, -0.3f), localAngles = new Vector3(0f, 0f, 0f), localScale = new Vector3(-0.3f, 0.3f, 0.3f) }, new ItemDisplayRule { followerPrefab = itemModel, ruleType = (ItemDisplayRuleType)0, childName = "Panel3", localPos = new Vector3(-0.35f, -0.1f, -0.3f), localAngles = new Vector3(0f, 0f, 0f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); val.Add("JailerDroneBodyRemoteOp", (ItemDisplayRule[])(object)new ItemDisplayRule[2] { new ItemDisplayRule { followerPrefab = itemModel, ruleType = (ItemDisplayRuleType)0, childName = "Panel1", localPos = new Vector3(0.35f, -0.1f, -0.3f), localAngles = new Vector3(0f, 0f, 0f), localScale = new Vector3(-0.3f, 0.3f, 0.3f) }, new ItemDisplayRule { followerPrefab = itemModel, ruleType = (ItemDisplayRuleType)0, childName = "Panel3", localPos = new Vector3(-0.35f, -0.1f, -0.3f), localAngles = new Vector3(0f, 0f, 0f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); val.Add("RechargeDroneBody", (ItemDisplayRule[])(object)new ItemDisplayRule[2] { new ItemDisplayRule { followerPrefab = itemModel, ruleType = (ItemDisplayRuleType)0, childName = "HeadCenter", localPos = new Vector3(0.3f, -0.3f, 0.2f), localAngles = new Vector3(0f, 180f, 0f), localScale = new Vector3(0.2f, 0.2f, 0.2f) }, new ItemDisplayRule { followerPrefab = itemModel, ruleType = (ItemDisplayRuleType)0, childName = "HeadCenter", localPos = new Vector3(-0.3f, -0.3f, 0.2f), localAngles = new Vector3(0f, 180f, 0f), localScale = new Vector3(-0.2f, 0.2f, 0.2f) } }); val.Add("RechargeDroneBodyRemoteOp", (ItemDisplayRule[])(object)new ItemDisplayRule[2] { new ItemDisplayRule { followerPrefab = itemModel, ruleType = (ItemDisplayRuleType)0, childName = "HeadCenter", localPos = new Vector3(0.3f, -0.3f, 0.2f), localAngles = new Vector3(0f, 180f, 0f), localScale = new Vector3(0.2f, 0.2f, 0.2f) }, new ItemDisplayRule { followerPrefab = itemModel, ruleType = (ItemDisplayRuleType)0, childName = "HeadCenter", localPos = new Vector3(-0.3f, -0.3f, 0.2f), localAngles = new Vector3(0f, 180f, 0f), localScale = new Vector3(-0.2f, 0.2f, 0.2f) } }); val.Add("FriendUnitBody", (ItemDisplayRule[])(object)new ItemDisplayRule[2] { new ItemDisplayRule { followerPrefab = itemModel, ruleType = (ItemDisplayRuleType)0, childName = "Body", localPos = new Vector3(-0.9f, 0.2f, 0f), localAngles = new Vector3(90f, 0f, 0f), localScale = new Vector3(0.15f, -0.15f, 0.15f) }, new ItemDisplayRule { followerPrefab = itemModel, ruleType = (ItemDisplayRuleType)0, childName = "Body", localPos = new Vector3(0.9f, 0.2f, 0f), localAngles = new Vector3(90f, 0f, 0f), localScale = new Vector3(-0.15f, -0.15f, 0.15f) } }); val.Add("RoboBallGreenBuddyBody", (ItemDisplayRule[])(object)new ItemDisplayRule[2] { new ItemDisplayRule { followerPrefab = itemModel, ruleType = (ItemDisplayRuleType)0, childName = "Root", localPos = new Vector3(0.9f, 0f, 0f), localAngles = new Vector3(0f, 180f, 0f), localScale = new Vector3(0.2f, 0.2f, 0.2f) }, new ItemDisplayRule { followerPrefab = itemModel, ruleType = (ItemDisplayRuleType)0, childName = "Root", localPos = new Vector3(-0.9f, 0f, 0f), localAngles = new Vector3(0f, 180f, 0f), localScale = new Vector3(-0.2f, 0.2f, 0.2f) } }); val.Add("RoboBallRedBuddyBody", (ItemDisplayRule[])(object)new ItemDisplayRule[2] { new ItemDisplayRule { followerPrefab = itemModel, ruleType = (ItemDisplayRuleType)0, childName = "Root", localPos = new Vector3(0.9f, 0f, 0f), localAngles = new Vector3(0f, 180f, 0f), localScale = new Vector3(0.2f, 0.2f, 0.2f) }, new ItemDisplayRule { followerPrefab = itemModel, ruleType = (ItemDisplayRuleType)0, childName = "Root", localPos = new Vector3(-0.9f, 0f, 0f), localAngles = new Vector3(0f, 180f, 0f), localScale = new Vector3(-0.2f, 0.2f, 0.2f) } }); val.Add("RoboBallMiniBody", (ItemDisplayRule[])(object)new ItemDisplayRule[2] { new ItemDisplayRule { followerPrefab = itemModel, ruleType = (ItemDisplayRuleType)0, childName = "Root", localPos = new Vector3(0.9f, 0f, 0f), localAngles = new Vector3(0f, 180f, 0f), localScale = new Vector3(0.2f, 0.2f, 0.2f) }, new ItemDisplayRule { followerPrefab = itemModel, ruleType = (ItemDisplayRuleType)0, childName = "Root", localPos = new Vector3(-0.9f, 0f, 0f), localAngles = new Vector3(0f, 180f, 0f), localScale = new Vector3(-0.2f, 0.2f, 0.2f) } }); return val; } public override void CreateAssets(ConfigFile config) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) GameObject val = Addressables.LoadAssetAsync((object)"RoR2/Base/Drones/Turret1Body.prefab").WaitForCompletion(); ModelLocator component = val.GetComponent(); if (!Object.op_Implicit((Object)(object)component) || !Object.op_Implicit((Object)(object)component.modelTransform) || !Object.op_Implicit((Object)(object)((Component)component.modelTransform).gameObject)) { return; } Transform[] componentsInChildren = ((Component)component).GetComponentsInChildren(); Transform val2 = null; Transform[] array = componentsInChildren; foreach (Transform val3 in array) { if (((Object)val3).name == "Top") { val2 = val3; break; } } if (Object.op_Implicit((Object)(object)val2)) { ChildLocator component2 = ((Component)component.modelTransform).gameObject.GetComponent(); if (Object.op_Implicit((Object)(object)component2) && !((Object)(object)component2.FindChild("Top") != (Object)null)) { List list = component2.transformPairs.ToList(); list.Add(new NameTransformPair { name = "Top", transform = val2 }); component2.transformPairs = list.ToArray(); } } } } internal class DroneRepairKitDroneItem : ItemBase { public override string ItemName => "DRONEREPAIRKITDRONEITEM"; public override ItemTier Tier => (ItemTier)5; public override GameObject ItemModel => LoadItemModel("RepairKitDroneDisplay"); public override Sprite ItemIcon => Assets.NullSprite; public override string ItemLangTokenName => "DRONEREPAIRKITDRONEITEM"; public override bool CanRemove => false; public override bool Hidden => true; public override ItemTag[] ItemTags { get { ItemTag[] array = new ItemTag[4]; RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); return (ItemTag[])(object)array; } } public override ItemDisplayRuleDict CreateItemDisplayRules() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: 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_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_0194: Unknown result type (might be due to invalid IL or missing references) //IL_0199: Unknown result type (might be due to invalid IL or missing references) //IL_01af: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: Unknown result type (might be due to invalid IL or missing references) //IL_01ca: Unknown result type (might be due to invalid IL or missing references) //IL_01cf: Unknown result type (might be due to invalid IL or missing references) //IL_01d4: Unknown result type (might be due to invalid IL or missing references) //IL_01d6: Unknown result type (might be due to invalid IL or missing references) //IL_01f1: Unknown result type (might be due to invalid IL or missing references) //IL_0202: Unknown result type (might be due to invalid IL or missing references) //IL_0224: Unknown result type (might be due to invalid IL or missing references) //IL_0229: Unknown result type (might be due to invalid IL or missing references) //IL_023f: Unknown result type (might be due to invalid IL or missing references) //IL_0244: Unknown result type (might be due to invalid IL or missing references) //IL_025a: Unknown result type (might be due to invalid IL or missing references) //IL_025f: Unknown result type (might be due to invalid IL or missing references) //IL_0264: Unknown result type (might be due to invalid IL or missing references) //IL_0266: Unknown result type (might be due to invalid IL or missing references) ItemDisplayRuleDict val = new ItemDisplayRuleDict(Array.Empty()); GameObject itemModel = ItemModel; if (!((Object)itemModel).name.Contains("mdl3d")) { return val; } val.Add("CLASSICITEMSRETURNS_BODY_RepairDroneBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { followerPrefab = itemModel, ruleType = (ItemDisplayRuleType)0, childName = "Head", localPos = new Vector3(0f, 0.35f, 0f), localAngles = new Vector3(0f, 180f, 180f), localScale = new Vector3(1f, 1f, 1f) } }); val.Add("Drone1Body", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { followerPrefab = itemModel, ruleType = (ItemDisplayRuleType)0, childName = "Head", localPos = new Vector3(0f, 0.35f, 0f), localAngles = new Vector3(0f, 180f, 180f), localScale = new Vector3(1f, 1f, 1f) } }); val.Add("Drone1BodyRemoteOp", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { followerPrefab = itemModel, ruleType = (ItemDisplayRuleType)0, childName = "Head", localPos = new Vector3(0f, 0.35f, 0f), localAngles = new Vector3(0f, 180f, 180f), localScale = new Vector3(1f, 1f, 1f) } }); val.Add("DTGunnerDroneBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { followerPrefab = itemModel, ruleType = (ItemDisplayRuleType)0, childName = "Head", localPos = new Vector3(0f, 0.35f, 0f), localAngles = new Vector3(0f, 180f, 180f), localScale = new Vector3(1f, 1f, 1f) } }); return val; } } } namespace ClassicItemsReturns.Items.Common { public class ArcaneBlades : ItemBase { public float speedIncrease = 0.25f; public override string ItemName => "Arcane Blades"; public override string ItemLangTokenName => "ARCANEBLADES"; public override ItemTier Tier => (ItemTier)0; public override GameObject ItemModel => LoadItemModel("ArcaneBlades"); public override Sprite ItemIcon => LoadItemSprite("ArcaneBlades"); public override ItemTag[] ItemTags => (ItemTag[])(object)new ItemTag[2] { (ItemTag)3, (ItemTag)31 }; public override object[] ItemFullDescriptionParams => new object[1] { speedIncrease * 100f }; public override ItemDisplayRuleDict CreateItemDisplayRules() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown return new ItemDisplayRuleDict(Array.Empty()); } public override void Hooks() { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Expected O, but got Unknown base.Hooks(); RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(RecalculateStatsAPI_GetStatCoefficients); IsTeleActivatedTracker.OnTPActivatedActions = (IsTeleActivatedTracker.OnTPActivatedDelegate)Delegate.Combine(IsTeleActivatedTracker.OnTPActivatedActions, new IsTeleActivatedTracker.OnTPActivatedDelegate(ApplySpeedBoost)); } private void ApplySpeedBoost() { foreach (CharacterMaster instances in CharacterMaster.instancesList) { if (Object.op_Implicit((Object)(object)instances.inventory) && Object.op_Implicit((Object)(object)instances.inventory) && instances.inventory.GetItemCountEffective(ItemBase.Instance.ItemDef) > 0) { CharacterBody body = instances.GetBody(); if (Object.op_Implicit((Object)(object)body)) { body.statsDirty = true; } } } } private void RecalculateStatsAPI_GetStatCoefficients(CharacterBody sender, StatHookEventArgs args) { if (IsTeleActivatedTracker.teleporterActivated && Object.op_Implicit((Object)(object)sender.inventory)) { int itemCountEffective = sender.inventory.GetItemCountEffective(ItemDef); args.moveSpeedMultAdd += (float)itemCountEffective * speedIncrease; } } } public class BitterRoot : ItemBase { public ConfigEntry useAlternateVersion; private float maxHealthMultiplier = 0.08f; private float maxHealthMultiplierStack = 0.08f; public float alt_regenIncrease = 2f; public float alt_duration = 2f; public float alt_durationStack = 2f; public ConfigEntry assistSupport; public override string ItemName => "Bitter Root"; public override string ItemLangTokenName => "BITTERROOT"; public override object[] ItemFullDescriptionParams => new object[2] { maxHealthMultiplier * 100f, maxHealthMultiplierStack * 100f }; public override ItemTier Tier => (ItemTier)0; public override GameObject ItemModel => LoadItemModel("Root"); public override Sprite ItemIcon => LoadItemSprite("Root"); public override ItemTag[] ItemTags { get { ItemTag[] array = new ItemTag[3]; RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); return (ItemTag[])(object)array; } } public override void Init(ConfigFile config) { //IL_0035: Unknown result type (might be due to invalid IL or missing references) base.Init(config); if (useAlternateVersion.Value && ItemDef.DoesNotContainTag((ItemTag)6)) { ref ItemTag[] tags = ref ItemDef.tags; ItemTag val = (ItemTag)6; ArrayUtils.ArrayAppend(ref tags, ref val); } } protected override void CreateLang() { base.CreateLang(); LanguageOverrides.DeferToken("CLASSICITEMSRETURNS_ITEM_BITTERROOT_DESCRIPTION_ALT", alt_regenIncrease, alt_duration, alt_durationStack); } public override void CreateConfig(ConfigFile config) { useAlternateVersion = config.Bind(base.ConfigCategory, "Use Rework", true, "Reworks the item into providing health regen on kill since Bison Steak already exists. If false, gives +HP like in Risk of Rain 1."); assistSupport = config.Bind(base.ConfigCategory, "Use Rework - Assist Support", true, "Reworked on-kill effect supports assists."); } public override ItemDisplayRuleDict CreateItemDisplayRules() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown return new ItemDisplayRuleDict(Array.Empty()); } public override void Hooks() { //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Expected O, but got Unknown //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Expected O, but got Unknown if (useAlternateVersion.Value) { ItemDef itemDef = ItemDef; itemDef.pickupToken += "_ALT"; ItemDef itemDef2 = ItemDef; itemDef2.descriptionToken += "_ALT"; RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(GetStatCoefficients_Alt); GlobalEventManager.onCharacterDeathGlobal += GlobalEventManager_onCharacterDeathGlobal; if (ModSupport.ModCompatAssistManager.loaded && assistSupport.Value) { AssistSetup(); } } else { RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(GetStatCoefficients); } } private void GetStatCoefficients(CharacterBody sender, StatHookEventArgs args) { if (TryGetCount(sender, out var count)) { args.healthMultAdd += ItemHelpers.StackingLinear(count, maxHealthMultiplier, maxHealthMultiplierStack); } } private void GetStatCoefficients_Alt(CharacterBody sender, StatHookEventArgs args) { if (ItemHelpers.TryGetBuffCount(sender, Buffs.BitterRootBuff, out var buffCount)) { float num = 1f + 0.2f * (sender.level - 1f); args.baseRegenAdd += alt_regenIncrease * (float)buffCount * num; } } private void GlobalEventManager_onCharacterDeathGlobal(DamageReport obj) { if (obj == null || !Object.op_Implicit((Object)(object)obj.attackerBody) || !Object.op_Implicit((Object)(object)obj.victim)) { return; } int count = GetCount(obj.attackerMaster); if (count > 0) { int buffCount = obj.attackerBody.GetBuffCount(Buffs.BitterRootBuff); if (buffCount > 0) { obj.attackerBody.ClearTimedBuffs(Buffs.BitterRootBuff); } for (int i = 0; i < buffCount + 1; i++) { obj.attackerBody.AddTimedBuff(Buffs.BitterRootBuff, ItemHelpers.StackingLinear(count, alt_duration, alt_durationStack)); } } } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] private void AssistSetup() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Expected O, but got Unknown AssistManager.HandleAssistInventoryCompatibleActions = (HandleAssistInventoryCompatible)Delegate.Combine((Delegate?)(object)AssistManager.HandleAssistInventoryCompatibleActions, (Delegate?)new HandleAssistInventoryCompatible(OnKillEffect)); } private void OnKillEffect(CharacterBody attackerBody, CharacterBody victimBody, DamageType? assistDamageType, DamageTypeExtended? assistDamageTypeExtended, DamageSource? assistDamageSource, HashSet assistModdedDamageTypes, Inventory attackerInventory, CharacterBody killerBody, DamageInfo damageInfo) { int itemCountEffective = attackerInventory.GetItemCountEffective(ItemDef); if (itemCountEffective > 0 && (Object)(object)attackerBody != (Object)(object)killerBody) { int buffCount = attackerBody.GetBuffCount(Buffs.BitterRootBuff); if (buffCount > 0) { attackerBody.ClearTimedBuffs(Buffs.BitterRootBuff); } for (int i = 0; i < buffCount + 1; i++) { attackerBody.AddTimedBuff(Buffs.BitterRootBuff, ItemHelpers.StackingLinear(itemCountEffective, alt_duration, alt_durationStack)); } } } } public class FireShield : ItemBase { public static float explosionDamageCoefficient = 2f; public static float igniteDamageCoefficient = 2f; public static float blastRadius = 20f; public override string ItemName => "Fire Shield"; public override string ItemLangTokenName => "FIRESHIELD"; public override ItemTier Tier => (ItemTier)0; public override ItemTag[] ItemTags { get { ItemTag[] array = new ItemTag[3]; RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); return (ItemTag[])(object)array; } } public override GameObject ItemModel => LoadItemModel("FireShield"); public override Sprite ItemIcon => LoadItemSprite("FireShield"); public override object[] ItemFullDescriptionParams => new object[3] { blastRadius, explosionDamageCoefficient * 100f, igniteDamageCoefficient * 100f }; public override ItemDisplayRuleDict CreateItemDisplayRules() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown return new ItemDisplayRuleDict(Array.Empty()); } public override void Hooks() { base.Hooks(); TakeDamage.OnDamageTakenInventoryActions = (TakeDamage.OnDamageTakenInventory)Delegate.Combine(TakeDamage.OnDamageTakenInventoryActions, new TakeDamage.OnDamageTakenInventory(ProcFireShield)); } private void ProcFireShield(DamageInfo damageInfo, HealthComponent self, CharacterBody victimBody, Inventory inventory, bool lostShield, bool lostOutOfDanger) { //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Invalid comparison between Unknown and I4 //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Expected O, but got Unknown //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_018a: Unknown result type (might be due to invalid IL or missing references) //IL_01a1: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_01a8: 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_01af: Unknown result type (might be due to invalid IL or missing references) //IL_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_01c4: 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_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01d0: Unknown result type (might be due to invalid IL or missing references) //IL_01d5: Unknown result type (might be due to invalid IL or missing references) //IL_01e0: Unknown result type (might be due to invalid IL or missing references) //IL_01e6: Unknown result type (might be due to invalid IL or missing references) //IL_01eb: Unknown result type (might be due to invalid IL or missing references) //IL_01f0: Unknown result type (might be due to invalid IL or missing references) int itemCountEffective = inventory.GetItemCountEffective(ItemDef); if (itemCountEffective <= 0) { return; } TeamIndex val = (TeamIndex)((!Object.op_Implicit((Object)(object)victimBody.teamComponent)) ? (-1) : ((int)victimBody.teamComponent.teamIndex)); if ((int)val == -1) { return; } float num = damageInfo.damage / self.fullCombinedHealth; if (!(num >= 0.049f || lostShield || lostOutOfDanger)) { return; } EffectManager.SpawnEffect(CommonAssets.igniteOnKillExplosionEffectPrefab, new EffectData { origin = victimBody.corePosition, scale = blastRadius }, true); float value = victimBody.damage * igniteDamageCoefficient * (float)itemCountEffective; List list = MiscUtils.FindEnemiesInSphere(blastRadius, victimBody.corePosition, val); foreach (HealthComponent item in list) { InflictDotInfo val2 = default(InflictDotInfo); val2.victimObject = ((Component)item).gameObject; val2.attackerObject = ((Component)victimBody).gameObject; val2.totalDamage = value; val2.dotIndex = (DotIndex)1; val2.damageMultiplier = 0.75f + 0.25f * (float)itemCountEffective; InflictDotInfo val3 = val2; StrengthenBurnUtils.CheckDotForUpgrade(inventory, ref val3); DotController.InflictDot(ref val3); } new BlastAttack { radius = blastRadius, baseDamage = victimBody.damage * explosionDamageCoefficient, procCoefficient = 1f, crit = Util.CheckRoll(victimBody.crit, victimBody.master), damageColorIndex = (DamageColorIndex)3, attackerFiltering = (AttackerFiltering)2, falloffModel = (FalloffModel)0, attacker = ((Component)victimBody).gameObject, teamIndex = val, position = victimBody.corePosition, baseForce = 2000f, damageType = DamageTypeCombo.op_Implicit((DamageTypeExtended)32768) }.Fire(); } } public class LifeSavings : ItemBase { public class LifeSavingsBehaviour : BaseItemBodyBehavior { private CharacterMaster master; private float stopwatch = ItemBase.Instance.intervalSeconds; [ItemDefAssociation(useOnClient = false, useOnServer = true)] public static ItemDef GetItemDef() { return ItemBase.Instance.ItemDef; } private void OnEnable() { //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) master = ((BaseItemBodyBehavior)this).body.master; string[] bannedSceneDefNames = LifeSavings.bannedSceneDefNames; Scene activeScene = SceneManager.GetActiveScene(); if (bannedSceneDefNames.Contains(((Scene)(ref activeScene)).name)) { ((Behaviour)this).enabled = false; } } private void FixedUpdate() { if (onlyAfterTeleporter.Value && !IsTeleActivatedTracker.teleporterActivated) { return; } stopwatch -= Time.fixedDeltaTime; if (!(stopwatch <= 0f) || SceneExitController.isRunning) { return; } stopwatch = ItemBase.Instance.intervalSeconds; int num = ItemHelpers.StackingLinear(base.stack, ItemBase.Instance.gold, ItemBase.Instance.goldStack); if (Object.op_Implicit((Object)(object)Run.instance) && scaleWithTime.Value) { float num2 = 0f; if (Object.op_Implicit((Object)(object)Stage.instance)) { num2 = Stage.instance.entryDifficultyCoefficient; } else if (Object.op_Implicit((Object)(object)Run.instance)) { num2 = Run.instance.difficultyCoefficient; } num = Run.instance.GetDifficultyScaledCost(num, num2); } master.GiveMoney((uint)num); } } private int gold = 1; private int goldStack = 1; private float intervalSeconds = 3f; public static ConfigEntry onlyAfterTeleporter; public static ConfigEntry scaleWithTime; public static ConfigEntry cfgBannedSceneNames; public static string[] bannedSceneDefNames = new string[0]; public override string ItemName => "Life Savings"; public override string ItemLangTokenName => "LIFESAVINGS"; public override object[] ItemFullDescriptionParams => new object[4] { gold, goldStack, intervalSeconds, (object)(ItemTag)31 }; public override ItemTier Tier => (ItemTier)0; public override GameObject ItemModel => LoadItemModel("Pig"); public override Sprite ItemIcon => LoadItemSprite("Pig"); public override ItemTag[] ItemTags => (ItemTag[])(object)new ItemTag[2] { (ItemTag)3, (ItemTag)4 }; public override void Init(ConfigFile config) { CreateConfig(config); CreateLang(); CreateItem(); Hooks(); } public override void CreateConfig(ConfigFile config) { cfgBannedSceneNames = config.Bind(base.ConfigCategory, "Banned Scenes", "bazaar", "Input the names of the scenes you don't want the item to perform on. Entries are separated by commas."); scaleWithTime = config.Bind(base.ConfigCategory, "Scale with Time", true, "Scale money gain with time."); onlyAfterTeleporter = config.Bind(base.ConfigCategory, "On Teleporter Activated", false, "Only proc this item after teleporter has been activated."); bannedSceneDefNames = cfgBannedSceneNames.Value.Split(','); for (int i = 0; i < bannedSceneDefNames.Length; i++) { bannedSceneDefNames[i].Equals(bannedSceneDefNames[i].Trim()); } bannedSceneDefNames = bannedSceneDefNames.Where((string str) => str != null && str.Length > 0).ToArray(); } public override ItemDisplayRuleDict CreateItemDisplayRules() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown return new ItemDisplayRuleDict(Array.Empty()); } } public class MuConstruct : ItemBase { public static ConfigEntry disableFollower; public override string ItemName => "Mu Construct"; public override string ItemLangTokenName => "MUCONSTRUCT"; public override ItemTier Tier => (ItemTier)0; public override GameObject ItemModel => LoadItemModel("MuConstruct"); public override Sprite ItemIcon => LoadItemSprite("MuConstruct"); public override ItemTag[] ItemTags => (ItemTag[])(object)new ItemTag[2] { (ItemTag)2, (ItemTag)31 }; public override object[] ItemFullDescriptionParams => new object[3] { MuConstructBehavior.healAmount * 100f, MuConstructBehavior.initialCooldown, MuConstructBehavior.cooldownReduction * 100f }; public override ItemDisplayRuleDict CreateItemDisplayRules() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown return new ItemDisplayRuleDict(Array.Empty()); } public override void Init(ConfigFile config) { base.Init(config); MuConstructBehavior.followerPrefab = Assets.LoadObject("MuConstructFollower"); ItemHelpers.SetupMaterials(MuConstructBehavior.followerPrefab); } public override void CreateConfig(ConfigFile config) { disableFollower = config.Bind(base.ConfigCategory, "Disable Follower", false, "Disable the follower visual."); } public override void Hooks() { base.Hooks(); CharacterBody.onBodyInventoryChangedGlobal += CharacterBody_onBodyInventoryChangedGlobal; } private void CharacterBody_onBodyInventoryChangedGlobal(CharacterBody body) { body.AddItemBehavior(body.inventory.GetItemCountEffective(ItemDef)); } protected override void CreateCraftableDef() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Expected O, but got Unknown //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Expected O, but got Unknown //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Expected O, but got Unknown //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Expected O, but got Unknown //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Expected O, but got Unknown //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Expected O, but got Unknown if (Object.op_Implicit((Object)(object)ItemDef)) { CraftableDef val = ScriptableObject.CreateInstance(); val.pickup = (Object)(object)Addressables.LoadAssetAsync((object)"RoR2/DLC1/MinorConstructOnKill/MinorConstructOnKill.asset").WaitForCompletion(); Recipe[] array = new Recipe[2]; Recipe val2 = new Recipe(); val2.amountToDrop = 1; val2.ingredients = (RecipeIngredient[])(object)new RecipeIngredient[2] { new RecipeIngredient { pickup = (Object)(object)ItemDef }, new RecipeIngredient { pickup = (Object)(object)ItemDef } }; array[0] = val2; val2 = new Recipe(); val2.amountToDrop = 1; val2.ingredients = (RecipeIngredient[])(object)new RecipeIngredient[2] { new RecipeIngredient { pickup = (Object)(object)ItemDef }, new RecipeIngredient { pickup = (Object)(object)Addressables.LoadAssetAsync((object)"RoR2/Base/Squid/Squid.asset").WaitForCompletion() } }; array[1] = val2; val.recipes = (Recipe[])(object)array; ((Object)val).name = "cdMuToAlpha"; PluginContentPack.craftableDefs.Add(val); } } } public class MuConstructBehavior : ItemBehavior { public static float healAmount = 0.025f; public static float initialCooldown = 5f; public static float cooldownReduction = 0.25f; private float cooldown = 0f; public static float followerRotationTime = 8f; private float followerRotationStopwatch = 0f; public static GameObject followerPrefab; public GameObject followerInstance; private float followerHeightOffset = 0f; private float followerSideOffset = 0f; private Vector3 velocity = Vector3.zero; private void FixedUpdate() { if (NetworkServer.active) { FixedUpdateServer(); } } private void FixedUpdateServer() { //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) if (IsTeleActivatedTracker.teleporterActivated) { cooldown -= Time.fixedDeltaTime; if (cooldown <= 0f && Object.op_Implicit((Object)(object)base.body.healthComponent)) { base.body.healthComponent.HealFraction(healAmount, default(ProcChainMask)); cooldown = 5f / Mathf.Max(1f, 1f + cooldownReduction * (float)(base.stack - 1)); } } } public void InitFollower() { //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)followerInstance) && Object.op_Implicit((Object)(object)followerPrefab) && !MuConstruct.disableFollower.Value) { followerInstance = Object.Instantiate(followerPrefab); followerInstance.transform.position = base.body.transform.position; Vector3 desiredPosition = GetDesiredPosition(); followerInstance.transform.position = desiredPosition; followerHeightOffset = 1.3f; followerSideOffset = 1.5f; } } private void OnDisable() { if (Object.op_Implicit((Object)(object)followerInstance)) { Object.Destroy((Object)(object)followerInstance); } } private void Start() { InitFollower(); if (Object.op_Implicit((Object)(object)followerInstance)) { followerInstance.SetActive(IsTeleActivatedTracker.teleporterActivated); } } private void Update() { //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)followerInstance)) { followerInstance.SetActive(IsTeleActivatedTracker.teleporterActivated); if (Object.op_Implicit((Object)(object)base.body.modelLocator) && Object.op_Implicit((Object)(object)base.body.modelLocator.modelTransform)) { followerInstance.transform.rotation = base.body.modelLocator.modelTransform.rotation; } followerRotationStopwatch += Time.deltaTime; if (followerRotationStopwatch >= followerRotationTime) { followerRotationStopwatch -= followerRotationTime; } followerInstance.transform.Rotate(Vector3.forward, 360f * followerRotationStopwatch / followerRotationTime, (Space)1); Vector3 desiredPosition = GetDesiredPosition(); followerInstance.transform.position = Vector3.SmoothDamp(followerInstance.transform.position, desiredPosition, ref velocity, 0.05f); Transform transform = followerInstance.transform; transform.position += velocity * Time.deltaTime; } } private Vector3 GetDesiredPosition() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0036: 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_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0060: 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_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0080: 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_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) Vector3 position = base.body.transform.position; Vector3 val = (Object.op_Implicit((Object)(object)base.body.inputBank) ? base.body.inputBank.aimDirection : Vector3.forward); val.y = 0f; ((Vector3)(ref val)).Normalize(); val = Quaternion.AngleAxis(90f, Vector3.up) * val * (0f - followerSideOffset); val.y = followerHeightOffset; return position + val; } } public class MysteriousVial : ItemBase { private float regen = 1f; private float regenPerStack = 1f; public override string ItemName => "Mysterious Vial"; public override string ItemLangTokenName => "MYSTERIOUSVIAL"; public override object[] ItemFullDescriptionParams => new object[2] { regen, regenPerStack }; public override ItemTier Tier => (ItemTier)0; public override GameObject ItemModel => LoadItemModel("Vial"); public override Sprite ItemIcon => LoadItemSprite("Vial"); public override ItemTag[] ItemTags => (ItemTag[])(object)new ItemTag[2] { (ItemTag)2, (ItemTag)31 }; public override void CreateConfig(ConfigFile config) { } public override ItemDisplayRuleDict CreateItemDisplayRules() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown return new ItemDisplayRuleDict(Array.Empty()); } public override void Hooks() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(RecalculateStatsAPI_GetStatCoefficients); } private void RecalculateStatsAPI_GetStatCoefficients(CharacterBody sender, StatHookEventArgs args) { if (TryGetCount(sender, out var count)) { float num = 1f + 0.2f * (sender.level - 1f); args.baseRegenAdd += ItemHelpers.StackingLinear(count, regen, regenPerStack) * num; } } protected override void CreateCraftableDef() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Expected O, but got Unknown //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Expected O, but got Unknown //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Expected O, but got Unknown if (Object.op_Implicit((Object)(object)ItemDef)) { CraftableDef val = ScriptableObject.CreateInstance(); val.pickup = (Object)(object)Addressables.LoadAssetAsync((object)"RoR2/Base/Infusion/Infusion.asset").WaitForCompletion(); Recipe[] array = new Recipe[1]; Recipe val2 = new Recipe(); val2.amountToDrop = 1; val2.ingredients = (RecipeIngredient[])(object)new RecipeIngredient[2] { new RecipeIngredient { pickup = (Object)(object)ItemDef }, new RecipeIngredient { pickup = (Object)(object)ItemDef } }; array[0] = val2; val.recipes = (Recipe[])(object)array; ((Object)val).name = "cdMysteriousVialToInfusion"; PluginContentPack.craftableDefs.Add(val); } } } public class RazorPenny : ItemBase { public static ConfigEntry disableInBazaar; public float critChance = 5f; public int goldOnHit = 1; public override string ItemName => "Razor Penny"; public override string ItemLangTokenName => "PENNY"; public override ItemTier Tier => (ItemTier)0; public override GameObject ItemModel => LoadItemModel("Penny"); public override Sprite ItemIcon => LoadItemSprite("Penny"); public override ItemTag[] ItemTags { get { ItemTag[] array = new ItemTag[3]; RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); return (ItemTag[])(object)array; } } public override object[] ItemFullDescriptionParams => new object[2] { critChance, goldOnHit }; public override ItemDisplayRuleDict CreateItemDisplayRules() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown return new ItemDisplayRuleDict(Array.Empty()); } public override void CreateConfig(ConfigFile config) { disableInBazaar = config.Bind(base.ConfigCategory, "Disable in Bazaar", true, "Disable money gain from this item in the Bazaar."); } public override void Hooks() { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Expected O, but got Unknown //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Expected O, but got Unknown //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Expected O, but got Unknown base.Hooks(); RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(RecalculateStatsAPI_GetStatCoefficients); ProcessHitEnemy.OnHitAttackerActions = (OnHitAttacker)Delegate.Combine((Delegate?)(object)ProcessHitEnemy.OnHitAttackerActions, (Delegate?)new OnHitAttacker(GoldOnCrit)); } private void GoldOnCrit(DamageInfo damageInfo, CharacterBody victimBody, CharacterBody attackerBody) { if (damageInfo.crit && Object.op_Implicit((Object)(object)attackerBody.master) && Object.op_Implicit((Object)(object)attackerBody.master.inventory)) { int itemCountEffective = attackerBody.master.inventory.GetItemCountEffective(ItemDef); if (itemCountEffective > 0 && (!disableInBazaar.Value || !((Object)(object)SceneCatalog.GetSceneDefForCurrentScene() == (Object)(object)ClassicItemsReturnsPlugin.bazaarScene))) { attackerBody.master.GiveMoney((uint)(goldOnHit * itemCountEffective)); } } } private void RecalculateStatsAPI_GetStatCoefficients(CharacterBody sender, StatHookEventArgs args) { if (Object.op_Implicit((Object)(object)sender.inventory)) { int itemCountEffective = sender.inventory.GetItemCountEffective(ItemDef); args.critAdd += (float)itemCountEffective * critChance; } } } public class SnakeEyes : ItemBase { public class MasterSnakeEyesTracker : MonoBehaviour { private int count = 0; private const int maxStack = 6; public void ResetCount() { count = 0; } public void Increment(CharacterBody body) { if (count < 6) { count++; } if (Object.op_Implicit((Object)(object)body)) { RecalculateBuffServer(body); } } public void RecalculateBuffServer(CharacterBody body) { if (NetworkServer.active && Object.op_Implicit((Object)(object)body)) { RemoveSnakeEyesBuffs(body); switch (count) { case 0: break; case 1: body.AddBuff(Buffs.SnakeEyesBuffs.Snake1); break; case 2: body.AddBuff(Buffs.SnakeEyesBuffs.Snake2); break; case 3: body.AddBuff(Buffs.SnakeEyesBuffs.Snake3); break; case 4: body.AddBuff(Buffs.SnakeEyesBuffs.Snake4); break; case 5: body.AddBuff(Buffs.SnakeEyesBuffs.Snake5); break; default: body.AddBuff(Buffs.SnakeEyesBuffs.Snake6); break; } } } } public static HashSet stageDontResetList = new HashSet { "solusweb", "solutionalhaunt" }; public static HashSet stageForceResetList = new HashSet { "meridian", "moon2", "arena", "goldshores", "voidstage", "enemiesreturns_outoftime" }; public static HashSet teamwideProcShrineList = new HashSet { "SHRINE_HALCYONITE_NAME", "SHRINE_BOSS_NAME" }; public static HashSet shrineListSingleProc = new HashSet(); public static HashSet shrineListTeamProc = new HashSet(); public float critChance = 5f; public float critDamageInitial = 0f; public float critDamageStack = 0.05f; public override string ItemName => "Snake Eyes"; public override string ItemLangTokenName => "SNAKEEYES"; public override ItemTier Tier => (ItemTier)0; public override GameObject ItemModel => LoadItemModel("Dice"); public override Sprite ItemIcon => LoadItemSprite("Dice"); public override ItemTag[] ItemTags { get { ItemTag[] array = new ItemTag[4]; RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); return (ItemTag[])(object)array; } } public override object[] ItemFullDescriptionParams => new object[3] { critChance, critDamageInitial * 100f, critDamageStack * 100f }; public override ItemDisplayRuleDict CreateItemDisplayRules() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown return new ItemDisplayRuleDict(Array.Empty()); } public override void Hooks() { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0019: 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 //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Expected O, but got Unknown //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Expected O, but got Unknown //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Expected O, but got Unknown //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Expected O, but got Unknown //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Expected O, but got Unknown //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Expected O, but got Unknown //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Expected O, but got Unknown base.Hooks(); RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(RecalculateStatsAPI_GetStatCoefficients); Inventory.onInventoryChangedGlobal += Inventory_onInventoryChangedGlobal; Inventory.RemoveInventoryDisabler += new hook_RemoveInventoryDisabler(Inventory_RemoveInventoryDisabler); PurchaseInteraction.OnInteractionBegin += new hook_OnInteractionBegin(DiceOnShrinePurchase); Stage.onStageStartGlobal += ResetCountOnStageStart; CharacterBody.onBodyStartGlobal += CharacterBody_onBodyStartGlobal; GeodeController.OnInteractionBegin += new hook_OnInteractionBegin(GeodeController_OnInteractionBegin); Ready.OnEnter += new hook_OnEnter(Ready_OnEnter); MoonBatteryActive.OnEnter += new hook_OnEnter(MoonBatteryActive_OnEnter); Active.OnEnter += new hook_OnEnter(Active_OnEnter); Charging.OnEnter += new hook_OnEnter(Charging_OnEnter); Interactor.PerformInteraction += new hook_PerformInteraction(Interactor_PerformInteraction); ScrapperController.CreateItemTakenOrb += new hook_CreateItemTakenOrb(ScrapperController_CreateItemTakenOrb); } private void Inventory_RemoveInventoryDisabler(orig_RemoveInventoryDisabler orig, Inventory self) { orig.Invoke(self); if (!NetworkServer.active) { return; } CharacterMaster component = ((Component)self).GetComponent(); if (!Object.op_Implicit((Object)(object)component)) { return; } CharacterBody body = component.GetBody(); if (Object.op_Implicit((Object)(object)body)) { MasterSnakeEyesTracker component2 = ((Component)component).gameObject.GetComponent(); if (Object.op_Implicit((Object)(object)component2)) { component2.RecalculateBuffServer(body); } } } private void ScrapperController_CreateItemTakenOrb(orig_CreateItemTakenOrb orig, Vector3 effectOrigin, GameObject targetObject, ItemIndex itemIndex) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(effectOrigin, targetObject, itemIndex); if (NetworkServer.active) { Scene activeScene = SceneManager.GetActiveScene(); if (!(((Scene)(ref activeScene)).name != "enemiesreturns_outoftime") && ((Object)targetObject).name == "JudgementInteractable") { ProcSnakeEyesForTeam((TeamIndex)1); } } } private void Interactor_PerformInteraction(orig_PerformInteraction orig, Interactor self, GameObject interactableObject) { //IL_00d1: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self, interactableObject); if (!NetworkServer.active || !Object.op_Implicit((Object)(object)interactableObject) || Object.op_Implicit((Object)(object)interactableObject.GetComponent())) { return; } string item = ((Object)interactableObject).name.Replace("(Clone)", "").Trim(); if (shrineListSingleProc.Contains(item)) { CharacterBody component = ((Component)self).GetComponent(); if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component.master)) { ProcSnakeEyes(component.master); } } else if (shrineListTeamProc.Contains(item)) { CharacterBody component2 = ((Component)self).GetComponent(); if (Object.op_Implicit((Object)(object)component2) && Object.op_Implicit((Object)(object)component2.teamComponent)) { ProcSnakeEyesForTeam(component2.teamComponent.teamIndex); } } } public void ProcSnakeEyesForTeam(TeamIndex index) { //IL_0019: 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) foreach (CharacterMaster instances in CharacterMaster.instancesList) { if (instances.teamIndex == index) { ProcSnakeEyes(instances); } } } public void ProcSnakeEyes(CharacterMaster master) { if (Object.op_Implicit((Object)(object)master) && Object.op_Implicit((Object)(object)master.inventory) && master.inventory.GetItemCountEffective(ItemDef) > 0) { MasterSnakeEyesTracker masterSnakeEyesTracker = ((Component)master).GetComponent(); if (!Object.op_Implicit((Object)(object)masterSnakeEyesTracker)) { masterSnakeEyesTracker = ((Component)master).gameObject.AddComponent(); } CharacterBody body = master.GetBody(); if (Object.op_Implicit((Object)(object)body)) { masterSnakeEyesTracker.Increment(body); } } } private void DiceOnShrinePurchase(orig_OnInteractionBegin orig, PurchaseInteraction self, Interactor activator) { //IL_0074: Unknown result type (might be due to invalid IL or missing references) bool flag = self.CanBeAffordedByInteractor(activator); orig.Invoke(self, activator); if (!(NetworkServer.active && flag) || (!self.isShrine && !self.isGoldShrine)) { return; } CharacterBody component = ((Component)activator).GetComponent(); if (Object.op_Implicit((Object)(object)component)) { if (teamwideProcShrineList.Contains(self.displayNameToken) && Object.op_Implicit((Object)(object)component.teamComponent)) { ProcSnakeEyesForTeam(component.teamComponent.teamIndex); } else { ProcSnakeEyes(component.master); } } } private void GeodeController_OnInteractionBegin(orig_OnInteractionBegin orig, GeodeController self, Interactor activator) { //IL_0047: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self, activator); if (NetworkServer.active && Object.op_Implicit((Object)(object)activator)) { CharacterBody component = ((Component)activator).GetComponent(); if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component.teamComponent)) { ProcSnakeEyesForTeam(component.teamComponent.teamIndex); } } } private void Active_OnEnter(orig_OnEnter orig, Active self) { orig.Invoke(self); if (NetworkServer.active) { ProcSnakeEyesForTeam((TeamIndex)1); } } private void MoonBatteryActive_OnEnter(orig_OnEnter orig, MoonBatteryActive self) { orig.Invoke(self); if (NetworkServer.active) { ProcSnakeEyesForTeam((TeamIndex)1); } } private void Ready_OnEnter(orig_OnEnter orig, Ready self) { orig.Invoke(self); if (NetworkServer.active) { ProcSnakeEyesForTeam((TeamIndex)1); } } private void Charging_OnEnter(orig_OnEnter orig, Charging self) { orig.Invoke(self); if (NetworkServer.active) { ProcSnakeEyesForTeam((TeamIndex)1); } } private void CharacterBody_onBodyStartGlobal(CharacterBody body) { if (NetworkServer.active && Object.op_Implicit((Object)(object)body.master)) { MasterSnakeEyesTracker component = ((Component)body.master).gameObject.GetComponent(); if (Object.op_Implicit((Object)(object)component)) { component.RecalculateBuffServer(body); } } } private void ResetCountOnStageStart(Stage obj) { if (!NetworkServer.active) { return; } SceneDef sceneDefForCurrentScene = SceneCatalog.GetSceneDefForCurrentScene(); if (Object.op_Implicit((Object)(object)sceneDefForCurrentScene) && !stageForceResetList.Contains(sceneDefForCurrentScene.baseSceneName) && (sceneDefForCurrentScene.isFinalStage || sceneDefForCurrentScene.blockOrbitalSkills || stageDontResetList.Contains(sceneDefForCurrentScene.baseSceneName))) { return; } foreach (CharacterMaster instances in CharacterMaster.instancesList) { MasterSnakeEyesTracker component = ((Component)instances).GetComponent(); if (Object.op_Implicit((Object)(object)component)) { component.ResetCount(); } } } private void Inventory_onInventoryChangedGlobal(Inventory inventory) { if (!NetworkServer.active || !Object.op_Implicit((Object)(object)inventory)) { return; } CharacterMaster component = ((Component)inventory).GetComponent(); if (!Object.op_Implicit((Object)(object)component)) { return; } bool flag = inventory.GetItemCountEffective(ItemDef) > 0; if (flag) { MasterSnakeEyesTracker component2 = ((Component)component).GetComponent(); if (!Object.op_Implicit((Object)(object)component2)) { ((Component)component).gameObject.AddComponent(); } } CharacterBody body = component.GetBody(); if (Object.op_Implicit((Object)(object)body) && !flag) { RemoveSnakeEyesBuffs(body); } } public static void RemoveSnakeEyesBuffs(CharacterBody body) { MiscUtils.TryRemoveBuff(body, Buffs.SnakeEyesBuffs.Snake1); MiscUtils.TryRemoveBuff(body, Buffs.SnakeEyesBuffs.Snake2); MiscUtils.TryRemoveBuff(body, Buffs.SnakeEyesBuffs.Snake3); MiscUtils.TryRemoveBuff(body, Buffs.SnakeEyesBuffs.Snake4); MiscUtils.TryRemoveBuff(body, Buffs.SnakeEyesBuffs.Snake5); MiscUtils.TryRemoveBuff(body, Buffs.SnakeEyesBuffs.Snake6); } private void RecalculateStatsAPI_GetStatCoefficients(CharacterBody sender, StatHookEventArgs args) { if (TryGetCount(sender, out var count)) { float num = critChance; float num2 = critDamageInitial + critDamageStack * (float)(count - 1); int num3 = 0; if (sender.HasBuff(Buffs.SnakeEyesBuffs.Snake1)) { num3 = 1; } if (sender.HasBuff(Buffs.SnakeEyesBuffs.Snake2)) { num3 = 2; } if (sender.HasBuff(Buffs.SnakeEyesBuffs.Snake3)) { num3 = 3; } if (sender.HasBuff(Buffs.SnakeEyesBuffs.Snake4)) { num3 = 4; } if (sender.HasBuff(Buffs.SnakeEyesBuffs.Snake5)) { num3 = 5; } if (sender.HasBuff(Buffs.SnakeEyesBuffs.Snake6)) { num3 = 6; } args.critAdd += num * (float)num3; args.critDamageMultAdd += num2 * (float)num3; } } } public class WeakenOnContact : ItemBase { public class WeakenOnContactBehavior : BaseItemBodyBehavior { public SphereSearch sphereSearch = new SphereSearch(); public float age = 0f; protected float timer = 0f; public float tickRate = 1f; public float sizeCorrectionMultiplier = 4f; private readonly float maxTickDuration = 0.1f; private readonly float minTickDuration = 0.1f; private float lerp_denominator = 2f; [ItemDefAssociation(useOnClient = false, useOnServer = true)] public static ItemDef GetItemDef() { return ItemBase.Instance.ItemDef; } public void OnEnable() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) sphereSearch.mask = ((LayerIndex)(ref LayerIndex.entityPrecise)).mask; sphereSearch.radius = ((BaseItemBodyBehavior)this).body.radius * sizeCorrectionMultiplier; sphereSearch.queryTriggerInteraction = (QueryTriggerInteraction)0; lerp_denominator = ((BaseItemBodyBehavior)this).body.baseMoveSpeed * ((BaseItemBodyBehavior)this).body.sprintingSpeedMultiplier * 2f + ((BaseItemBodyBehavior)this).body.baseMoveSpeed; } public void FixedUpdate() { //IL_00da: Unknown result type (might be due to invalid IL or missing references) sphereSearch.radius = Mathf.Max(6f, ((BaseItemBodyBehavior)this).body.radius * sizeCorrectionMultiplier); AdjustFrequencyBasedOnSpeed(); age -= Time.fixedDeltaTime; if (!(age <= 0f)) { return; } age = timer; List list = CollectionPool>.RentCollection(); SearchForTargets(list); if (list.Count != 0) { float num = ItemHelpers.StackingLinear(base.stack, ItemBase.Instance.duration, ItemBase.Instance.durationPerStack); foreach (HurtBox item in list) { if (Object.op_Implicit((Object)(object)item)) { item.healthComponent.body.AddTimedBuffAuthority(Buffs.WeakenOnContactBuff.buffIndex, num); } } } CollectionPool>.ReturnCollection(list); } public void SearchForTargets(List dest) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) sphereSearch.origin = ((BaseItemBodyBehavior)this).body.corePosition; sphereSearch.RefreshCandidates(); sphereSearch.FilterCandidatesByHurtBoxTeam(TeamMask.GetEnemyTeams(((BaseItemBodyBehavior)this).body.teamComponent.teamIndex)); sphereSearch.OrderCandidatesByDistance(); sphereSearch.FilterCandidatesByDistinctHurtBoxEntities(); sphereSearch.GetHurtBoxes(dest); sphereSearch.ClearCandidates(); } public void AdjustFrequencyBasedOnSpeed() { timer = Mathf.Lerp(minTickDuration, maxTickDuration, ((BaseItemBodyBehavior)this).body.moveSpeed / lerp_denominator); } } public float damageBonus = 25f; public float duration = 3f; public float durationPerStack = 1.5f; public override string ItemName => "The Toxin"; public override string ItemLangTokenName => "WEAKENONCONTACT"; public override object[] ItemFullDescriptionParams => new object[3] { damageBonus, duration, durationPerStack }; public override ItemTier Tier => (ItemTier)0; public override GameObject ItemModel => LoadItemModel("Toxin"); public override Sprite ItemIcon => LoadItemSprite("Toxin"); public override ItemTag[] ItemTags { get { ItemTag[] array = new ItemTag[3]; RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); return (ItemTag[])(object)array; } } public override void Init(ConfigFile config) { CreateConfig(config); CreateLang(); CreateItem(); ClassicItemsReturnsPlugin.onFinishScanning = (Action)Delegate.Combine(ClassicItemsReturnsPlugin.onFinishScanning, new Action(CreateCraftableDef)); Hooks(); } public override void CreateConfig(ConfigFile config) { } public override ItemDisplayRuleDict CreateItemDisplayRules() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown return new ItemDisplayRuleDict(Array.Empty()); } public override void Hooks() { //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0045: 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 //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0021: 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 if (ModSupport.LinearDamage.loaded) { ModifyFinalDamage.ModifyFinalDamageActions = (ModifyFinalDamageDelegate)Delegate.Combine((Delegate?)(object)ModifyFinalDamage.ModifyFinalDamageActions, (Delegate?)new ModifyFinalDamageDelegate(ModifyFinalDamage_Additive)); } else { ModifyFinalDamage.ModifyFinalDamageActions = (ModifyFinalDamageDelegate)Delegate.Combine((Delegate?)(object)ModifyFinalDamage.ModifyFinalDamageActions, (Delegate?)new ModifyFinalDamageDelegate(ModifyFinalDamage)); } } private void ModifyFinalDamage_Additive(DamageModifierArgs damageModifierArgs, DamageInfo damageInfo, HealthComponent victim, CharacterBody victimBody) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Invalid comparison between Unknown and I4 //IL_0033: Unknown result type (might be due to invalid IL or missing references) if (victimBody.HasBuff(Buffs.WeakenOnContactBuff)) { damageModifierArgs.damageMultAdd += 0.2f; if ((int)damageInfo.damageColorIndex == 0) { damageInfo.damageColorIndex = (DamageColorIndex)5; } } } private void ModifyFinalDamage(DamageModifierArgs damageModifierArgs, DamageInfo damageInfo, HealthComponent victim, CharacterBody victimBody) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Invalid comparison between Unknown and I4 //IL_0033: Unknown result type (might be due to invalid IL or missing references) if (victimBody.HasBuff(Buffs.WeakenOnContactBuff)) { damageModifierArgs.damageMultFinal *= 1.2f; if ((int)damageInfo.damageColorIndex == 0) { damageInfo.damageColorIndex = (DamageColorIndex)5; } } } protected override void CreateCraftableDef() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Expected O, but got Unknown //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Expected O, but got Unknown //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Expected O, but got Unknown if (Object.op_Implicit((Object)(object)ItemDef)) { CraftableDef val = ScriptableObject.CreateInstance(); val.pickup = (Object)(object)Addressables.LoadAssetAsync((object)"RoR2/DLC2/Items/TriggerEnemyDebuffs/TriggerEnemyDebuffs.asset").WaitForCompletion(); Recipe[] array = new Recipe[1]; Recipe val2 = new Recipe(); val2.amountToDrop = 1; val2.ingredients = (RecipeIngredient[])(object)new RecipeIngredient[2] { new RecipeIngredient { pickup = (Object)(object)ItemDef }, new RecipeIngredient { pickup = (Object)(object)Addressables.LoadAssetAsync((object)"RoR2/Base/Thorns/Thorns.asset").WaitForCompletion() } }; array[0] = val2; val.recipes = (Recipe[])(object)array; ((Object)val).name = "cdToxinToThorns"; PluginContentPack.craftableDefs.Add(val); } } } } namespace ClassicItemsReturns.Equipment { internal class CreateGhostTargeting : EquipmentBase { public class JarGhostTrackerComponent : MonoBehaviour { public List ghostList = new List(); public bool CanSpawnGhost() { int num = 0; foreach (CharacterMaster ghost in ghostList) { CharacterBody body = ghost.GetBody(); num = ((!Object.op_Implicit((Object)(object)body) || !body.isChampion) ? (num + 1) : (num + EquipmentBase.Instance.ghostsPerCommon)); } return num + EquipmentBase.Instance.ghostsPerCommon <= EquipmentBase.Instance.maxGhosts; } public void FixedUpdate() { for (int num = ghostList.Count - 1; num >= 0; num--) { CharacterMaster val = ghostList[num]; if (Object.op_Implicit((Object)(object)val) && val.IsDeadAndOutOfLivesServer()) { ghostList.Remove(val); } } } } public const int ghostDurationSecondsPlayer = 25; public const int ghostDurationSecondsEnemy = 10; public const int boostDamageItemCount = 10; public const int boostDamageChampionItemCount = 20; public int ghostsPerCommon = 3; public int ghostsPerChampion = 1; public int maxGhosts = 6; public HashSet bodyBlacklist = new HashSet(); public HashSet countAsBoss = new HashSet(); public static ConfigEntry blacklistSS2UNemesis; public static ConfigEntry drainHP; public static string bodyBlacklistString; public static NetworkSoundEventDef activationSound; public static GameObject commonTargetIndicator; public static GameObject championTargetIndicator; public override string EquipmentName => "Jar of Souls"; public override string EquipmentLangTokenName => "CREATEGHOSTTARGETING"; public override bool EnigmaCompatible { get; } = true; public override bool CanBeRandomlyTriggered { get; } = false; public override object[] EquipmentFullDescriptionParams => new object[2] { 100, 25 }; public override GameObject EquipmentModel => LoadItemModel("JarSouls"); public override Sprite EquipmentIcon => LoadItemSprite("JarSouls"); public override TargetFinderType EquipmentTargetFinderType => TargetFinderType.Enemies; public override float Cooldown => 100f; public override void Init(ConfigFile config) { CreateConfig(config); CreateLang(); CreateTargetingIndicator(); CreateEquipment(); ClassicItemsReturnsPlugin.onFinishScanning = (Action)Delegate.Combine(ClassicItemsReturnsPlugin.onFinishScanning, new Action(CreateCraftableDef)); Hooks(); RoR2Application.onLoad = (Action)Delegate.Combine(RoR2Application.onLoad, new Action(GetBodyIndex)); activationSound = ScriptableObject.CreateInstance(); activationSound.eventName = "Play_ClassicItemsReturns_JarSouls"; PluginContentPack.networkSoundEventDefs.Add(activationSound); } private void GetBodyIndex() { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Invalid comparison between Unknown and I4 //IL_003c: Unknown result type (might be due to invalid IL or missing references) string[] array = bodyBlacklistString.Split(','); string[] array2 = array; foreach (string text in array2) { BodyIndex val = BodyCatalog.FindBodyIndex(text.Trim()); if ((int)val != -1) { bodyBlacklist.Add(val); } } } private void CreateTargetingIndicator() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) commonTargetIndicator = Addressables.LoadAssetAsync((object)"RoR2/DLC1/BossHunter/BossHunterIndicator.prefab").WaitForCompletion(); championTargetIndicator = Addressables.LoadAssetAsync((object)"RoR2/DLC1/BossHunter/BossHunterIndicator.prefab").WaitForCompletion(); } public override void Hooks() { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Expected O, but got Unknown base.Hooks(); BaseSplitDeath.OnEnter += new hook_OnEnter(FixGhostGupSplit); } private void FixGhostGupSplit(orig_OnEnter orig, BaseSplitDeath self) { orig.Invoke(self); if (NetworkServer.active && Object.op_Implicit((Object)(object)((EntityState)self).GetComponent())) { self.hasDied = true; ((GenericCharacterDeath)self).DestroyBodyAsapServer(); } } protected override void ConfigureTargetIndicator(EquipmentSlot equipmentSlot, EquipmentIndex targetingEquipmentIndex, GenericPickupController genericPickupController, ref bool shouldShowOverride) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) UserTargetInfo currentTarget = equipmentSlot.currentTarget; if (Object.op_Implicit((Object)(object)currentTarget.hurtBox) && Object.op_Implicit((Object)(object)currentTarget.hurtBox.healthComponent) && currentTarget.hurtBox.healthComponent.alive) { if (currentTarget.hurtBox.healthComponent.body.isChampion) { equipmentSlot.targetIndicator.visualizerPrefab = championTargetIndicator; } else { equipmentSlot.targetIndicator.visualizerPrefab = commonTargetIndicator; } } else { shouldShowOverride = false; } } public override void FilterTargetFinderHurtbox(EquipmentSlot slot, BullseyeSearch targetFinder) { //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) base.FilterTargetFinderHurtbox(slot, targetFinder); if (slot.equipmentIndex == EquipmentDef.equipmentIndex) { targetFinder.candidatesEnumerable = targetFinder.candidatesEnumerable.Where((CandidateInfo v) => Object.op_Implicit((Object)(object)v.hurtBox.healthComponent.body) && !((Enum)v.hurtBox.healthComponent.body.bodyFlags).HasFlag((Enum)(object)(BodyFlags)4) && Object.op_Implicit((Object)(object)v.hurtBox.healthComponent.body.master) && !bodyBlacklist.Contains(v.hurtBox.healthComponent.body.bodyIndex) && !HasNemesisItem(v.hurtBox.healthComponent.body.inventory)).ToList(); } } protected override void CreateConfig(ConfigFile config) { int value = config.Bind(base.ConfigCategory, "Max Uses", 2, "Max amount of active uses (each use spawns 3 normal enemies or 1 boss).").Value; drainHP = config.Bind(base.ConfigCategory, "Drain HP", true, "Ghosts drain HP over their lifetime. Mainly used so that boss ghosts properly trigger their attacks that require certain HP thresholds."); blacklistSS2UNemesis = config.Bind(base.ConfigCategory, "Blacklist SS2U Nemesis Bosses", true, "Jar of Souls cannot target Nemesis Bosses from SS2U."); string text = "ShopkeeperBody, VoidInfestorBody, WispSoulBody, UrchinTurretBody, MinorConstructAttachableBody, VoidRaidCrabBody, MiniVoidRaidCrabBodyPhase1, MiniVoidRaidCrabBodyPhase2, MiniVoidRaidCrabBodyPhase3, SolusWingBody, SolusHeartBody, SolusHeartBody_Offering, ExhaustPortWeakpointBody, SolusMineBody"; bool value2 = config.Bind(base.ConfigCategory, "Body Blacklist - Use Default", true, "Ignore the custom blacklist setting and just use the default body blacklist.").Value; string value3 = config.Bind(base.ConfigCategory, "Body Blacklist", text, "Prevents the listed enemies from being targeted. Case-sensitive, use DebugToolKit list_bodies command to see full bodylist.").Value; bodyBlacklistString = (value2 ? text : value3); maxGhosts = value * ghostsPerCommon; } public override ItemDisplayRuleDict CreateItemDisplayRules() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) ItemDisplayRuleDict val = new ItemDisplayRuleDict(Array.Empty()); GameObject equipmentModel = EquipmentModel; if (!((Object)equipmentModel).name.Contains("mdl3d")) { return val; } val.Add("EquipmentDroneBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { followerPrefab = EquipmentModel, ruleType = (ItemDisplayRuleType)0, childName = "GunBarrelBase", localPos = new Vector3(0f, 0f, 2.22f), localAngles = new Vector3(45f, 90f, 270f), localScale = new Vector3(0.4f, 0.4f, 0.4f) } }); return val; } protected override bool ActivateEquipment(EquipmentSlot slot) { //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Invalid comparison between Unknown and I4 //IL_0153: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) HurtBox hurtBox = slot.currentTarget.hurtBox; if (!Object.op_Implicit((Object)(object)hurtBox) || !Object.op_Implicit((Object)(object)hurtBox.healthComponent) || !hurtBox.healthComponent.alive) { return false; } JarGhostTrackerComponent jarGhostTrackerComponent = ((Component)slot).GetComponent(); if (!Object.op_Implicit((Object)(object)jarGhostTrackerComponent)) { jarGhostTrackerComponent = ((Component)slot).gameObject.AddComponent(); } int num = ((hurtBox.healthComponent.body.isChampion || countAsBoss.Contains(hurtBox.healthComponent.body.bodyIndex)) ? ghostsPerChampion : ghostsPerCommon); if (Object.op_Implicit((Object)(object)slot.teamComponent) && (int)slot.teamComponent.teamIndex != 1 && (!Object.op_Implicit((Object)(object)slot.characterBody) || !slot.characterBody.isPlayerControlled)) { num = 1; } bool flag = false; if (jarGhostTrackerComponent.CanSpawnGhost()) { while (num > 0) { SpawnMaskGhost(hurtBox.healthComponent.body, slot.characterBody, out var ghostMaster); if (Object.op_Implicit((Object)(object)ghostMaster)) { jarGhostTrackerComponent.ghostList.Add(ghostMaster); num--; flag = true; } else { num = 0; } } } if (flag) { EffectManager.SimpleSoundEffect(activationSound.index, slot.characterBody.corePosition, true); CreateGhostOrbEffect(slot.characterBody, hurtBox.healthComponent.body, 0.25f); } slot.InvalidateCurrentTarget(); return flag; } public static CharacterBody SpawnMaskGhost(CharacterBody targetBody, CharacterBody ownerBody, out CharacterMaster ghostMaster) { //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Expected O, but got Unknown //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0307: Unknown result type (might be due to invalid IL or missing references) //IL_030c: Unknown result type (might be due to invalid IL or missing references) //IL_01fd: Unknown result type (might be due to invalid IL or missing references) //IL_0203: Invalid comparison between Unknown and I4 //IL_0356: Unknown result type (might be due to invalid IL or missing references) //IL_0360: Unknown result type (might be due to invalid IL or missing references) //IL_0246: Unknown result type (might be due to invalid IL or missing references) //IL_0216: Unknown result type (might be due to invalid IL or missing references) //IL_0369: Unknown result type (might be due to invalid IL or missing references) //IL_0373: Unknown result type (might be due to invalid IL or missing references) //IL_037c: Unknown result type (might be due to invalid IL or missing references) //IL_0386: Unknown result type (might be due to invalid IL or missing references) ghostMaster = null; if (!NetworkServer.active) { Debug.LogWarning((object)"[Server] function 'HappiestMask SpawnMaskGhost' called on client"); return null; } if (!Object.op_Implicit((Object)(object)targetBody)) { return null; } GameObject bodyPrefab = BodyCatalog.FindBodyPrefab(targetBody); if (!Object.op_Implicit((Object)(object)bodyPrefab)) { return null; } CharacterMaster val = MasterCatalog.allAiMasters.FirstOrDefault((Func)((CharacterMaster master) => (Object)(object)master.bodyPrefab == (Object)(object)bodyPrefab)); if (!Object.op_Implicit((Object)(object)val)) { return null; } MasterSummon val2 = new MasterSummon(); val2.masterPrefab = ((Component)val).gameObject; val2.ignoreTeamMemberLimit = true; CharacterDirection component = ((Component)targetBody).GetComponent(); val2.rotation = (Object.op_Implicit((Object)(object)component) ? Quaternion.Euler(0f, component.yaw, 0f) : targetBody.transform.rotation); val2.summonerBodyObject = (Object.op_Implicit((Object)(object)ownerBody) ? ((Component)ownerBody).gameObject : null); val2.inventoryToCopy = targetBody.inventory; val2.useAmbientLevel = null; HullClassification hullSize = (HullClassification)((!targetBody.isChampion) ? 1 : 2); val2.position = MiscUtils.FindSafeTeleportPosition(targetBody.corePosition, hullSize, targetBody.isFlying, 30f, (PlacementMode)1); CharacterMaster val3 = val2.Perform(); if (!Object.op_Implicit((Object)(object)val3)) { return null; } ghostMaster = val3; Inventory inventory = val3.inventory; if (Object.op_Implicit((Object)(object)inventory)) { if (inventory.GetItemCountPermanent(Items.Ghost) <= 0) { inventory.GiveItemPermanent(Items.Ghost, 1); } if (inventory.GetItemCountPermanent(Items.UseAmbientLevel) <= 0) { inventory.GiveItemPermanent(Items.UseAmbientLevel, 1); } MasterSuicideOnTimer val4 = ((Component)val3).gameObject.AddComponent(); if (Object.op_Implicit((Object)(object)ownerBody) && Object.op_Implicit((Object)(object)ownerBody.teamComponent) && (int)ownerBody.teamComponent.teamIndex == 1) { inventory.GiveItemPermanent(Items.BoostDamage.itemIndex, ownerBody.isChampion ? 20 : 10); val4.lifeTimer = 25f; } else { inventory.GiveItemPermanent(Items.HealthDecay.itemIndex, 10); val4.lifeTimer = 10f; } if (drainHP.Value) { int itemCountPermanent = inventory.GetItemCountPermanent(Items.HealthDecay); if (itemCountPermanent > 0) { inventory.RemoveItemPermanent(Items.HealthDecay, itemCountPermanent); } inventory.GiveItemPermanent(Items.HealthDecay, Mathf.CeilToInt(val4.lifeTimer)); } } CharacterBody body = val3.GetBody(); if (Object.op_Implicit((Object)(object)body)) { if (drainHP.Value) { ((Component)body).gameObject.AddComponent(); } EntityStateMachine[] components = ((Component)body).GetComponents(); foreach (EntityStateMachine val5 in components) { val5.initialStateType = val5.mainStateType; } Util.PlaySound("Play_elite_haunt_ghost_convert", ((Component)body).gameObject); if (Object.op_Implicit((Object)(object)body.mainHurtBox)) { CreateGhostOrbEffect(targetBody, body, 0.5f); } if (body.bodyIndex == BodyCatalog.FindBodyIndex("GupBody") || body.bodyIndex == BodyCatalog.FindBodyIndex("GeepBody") || body.bodyIndex == BodyCatalog.FindBodyIndex("GipBody")) { ((Component)body).gameObject.AddComponent(); } } return body; } private static void CreateGhostOrbEffect(CharacterBody targetBody, CharacterBody originBody, float duration) { //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_0011: 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_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Expected O, but got Unknown EffectData val = new EffectData { scale = 0.5f, origin = targetBody.corePosition, genericFloat = duration }; val.SetHurtBoxReference(originBody.mainHurtBox); EffectManager.SpawnEffect(LegacyResourcesAPI.Load("Prefabs/Effects/OrbEffects/HauntOrbEffect"), val, true); } private bool HasNemesisItem(Inventory inventory) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)inventory)) { ItemDef itemDef = ItemCatalog.GetItemDef(ItemCatalog.FindItemIndex("SS2UNemesisMarkerItem")); if (Object.op_Implicit((Object)(object)itemDef) && inventory.GetItemCountEffective(itemDef) > 0) { return true; } } return false; } protected override void CreateCraftableDef() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Expected O, but got Unknown //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Expected O, but got Unknown //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Expected O, but got Unknown if (Object.op_Implicit((Object)(object)EquipmentDef)) { CraftableDef val = ScriptableObject.CreateInstance(); val.pickup = (Object)(object)Addressables.LoadAssetAsync((object)"RoR2/Base/GhostOnKill/GhostOnKill.asset").WaitForCompletion(); Recipe[] array = new Recipe[1]; Recipe val2 = new Recipe(); val2.amountToDrop = 1; val2.ingredients = (RecipeIngredient[])(object)new RecipeIngredient[2] { new RecipeIngredient { pickup = (Object)(object)EquipmentDef }, new RecipeIngredient { pickup = (Object)(object)Addressables.LoadAssetAsync((object)"RoR2/Base/DeathMark/DeathMark.asset").WaitForCompletion() } }; array[0] = val2; val.recipes = (Recipe[])(object)array; ((Object)val).name = "cdJarToMask"; PluginContentPack.craftableDefs.Add(val); } } } public class DontSplitOnDeath : MonoBehaviour { } public class FixHealth : MonoBehaviour { private void Start() { if (NetworkServer.active) { HealthComponent component = ((Component)this).GetComponent(); if (Object.op_Implicit((Object)(object)component)) { component.Networkhealth = component.fullHealth; } } Object.Destroy((Object)(object)this); } } public class DroneRepairKit : EquipmentBase { public const float buffDuration = 8f; public const float buffAttackSpeed = 0.5f; public const float buffCDReduction = 0.5f; public const float buffArmor = 50f; public static NetworkSoundEventDef activationSound; public static GameObject repairDroneMasterPrefab; public static GameObject repairDroneBodyPrefab; public override string EquipmentName => "Drone Repair Kit"; public override string EquipmentLangTokenName => "DRONEREPAIRKIT"; public override bool EnigmaCompatible { get; } = true; public override bool CanBeRandomlyTriggered { get; } = true; public override object[] EquipmentFullDescriptionParams => new object[0]; public override GameObject EquipmentModel => LoadItemModel("RepairKit"); public override Sprite EquipmentIcon => LoadItemSprite("RepairKit"); public override void CreateAssets(ConfigFile config) { base.CreateAssets(config); activationSound = Assets.CreateNetworkSoundEventDef("Play_ClassicItemsReturns_RepairKit"); CreateUniqueDrone(); } private void CreateUniqueDrone() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) repairDroneBodyPrefab = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync((object)"RoR2/Base/Drones/Drone1Body.prefab").WaitForCompletion(), "CLASSICITEMSRETURNS_BODY_RepairDroneBody", true); CharacterBody component = repairDroneBodyPrefab.GetComponent(); component.baseNameToken = "CLASSICITEMSRETURNS_BODY_REPAIRDRONEBODY_NAME"; component.portraitIcon = (Texture)(object)Assets.mainAssetBundle.LoadAsset("texRepairDroneBodyIcon"); PluginContentPack.bodyPrefabs.Add(repairDroneBodyPrefab); repairDroneMasterPrefab = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync((object)"RoR2/Base/Drones/Drone1Master.prefab").WaitForCompletion(), "CLASSICITEMSRETURNS_MASTER_RepairDroneMaster", true); CharacterMaster component2 = repairDroneMasterPrefab.GetComponent(); component2.bodyPrefab = repairDroneBodyPrefab; SetDontDestroyOnLoad component3 = ((Component)component2).GetComponent(); ((Behaviour)component3).enabled = false; if (Object.op_Implicit((Object)(object)component3)) { Object.Destroy((Object)(object)component3); } PluginContentPack.masterPrefabs.Add(repairDroneMasterPrefab); } public override void Hooks() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(RecalculateStatsAPI_GetStatCoefficients); } private void RecalculateStatsAPI_GetStatCoefficients(CharacterBody sender, StatHookEventArgs args) { if (sender.HasBuff(Buffs.DroneRepairBuff)) { args.attackSpeedMultAdd += 0.5f; args.cooldownReductionAdd += 0.5f; args.armorAdd += 50f; } } public override ItemDisplayRuleDict CreateItemDisplayRules() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) ItemDisplayRuleDict val = new ItemDisplayRuleDict(Array.Empty()); GameObject equipmentModel = EquipmentModel; if (!((Object)equipmentModel).name.Contains("mdl3d")) { return val; } val.Add("EquipmentDroneBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { followerPrefab = EquipmentModel, ruleType = (ItemDisplayRuleType)0, childName = "GunBarrelBase", localPos = new Vector3(-0.222f, 0f, 2.51855f), localAngles = new Vector3(0.39625f, 59.72602f, 274.5737f), localScale = new Vector3(0.5f, 0.5f, 0.5f) } }); return val; } protected override bool ActivateEquipment(EquipmentSlot slot) { //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_0145: 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_0158: 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_018f: Unknown result type (might be due to invalid IL or missing references) //IL_0195: Invalid comparison between Unknown and I4 //IL_02d1: Unknown result type (might be due to invalid IL or missing references) //IL_022e: Unknown result type (might be due to invalid IL or missing references) //IL_0290: Unknown result type (might be due to invalid IL or missing references) //IL_0296: Unknown result type (might be due to invalid IL or missing references) //IL_025a: Unknown result type (might be due to invalid IL or missing references) //IL_025f: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)slot.characterBody) || !Object.op_Implicit((Object)(object)slot.characterBody.master)) { return false; } DroneRepairKitSummonTracker droneRepairKitSummonTracker = ((Component)slot.characterBody.master).GetComponent(); if (!Object.op_Implicit((Object)(object)droneRepairKitSummonTracker)) { droneRepairKitSummonTracker = ((Component)slot.characterBody.master).gameObject.AddComponent(); } TeamIndex val = (TeamIndex)(-1); if (Object.op_Implicit((Object)(object)slot.characterBody.teamComponent)) { val = slot.characterBody.teamComponent.teamIndex; } if (!Object.op_Implicit((Object)(object)droneRepairKitSummonTracker.summonMasterInstance) && slot.characterBody.isPlayerControlled) { Ray aimRay = slot.GetAimRay(); Quaternion val2 = Quaternion.LookRotation(((Ray)(ref aimRay)).direction); float y = ((Quaternion)(ref val2)).eulerAngles.y; Quaternion val3 = Quaternion.Euler(0f, y, 0f); CharacterMaster val4 = new MasterSummon { masterPrefab = repairDroneMasterPrefab, position = ((Component)slot).transform.position + val3 * Vector3.forward * 3f + Vector3.up * 3f, rotation = val3, summonerBodyObject = ((Component)slot).gameObject, ignoreTeamMemberLimit = true, useAmbientLevel = true }.Perform(); if (Object.op_Implicit((Object)(object)val4)) { droneRepairKitSummonTracker.summonMasterInstance = ((Component)val4).gameObject; if ((int)val4.teamIndex == 1 && Object.op_Implicit((Object)(object)val4.inventory) && Object.op_Implicit((Object)(object)ItemBase.Instance.ItemDef)) { val4.inventory.GiveItemPermanent(ItemBase.Instance.ItemDef, 1); } } } foreach (CharacterMaster readOnlyInstances in CharacterMaster.readOnlyInstancesList) { if (!Object.op_Implicit((Object)(object)readOnlyInstances)) { continue; } CharacterBody body = readOnlyInstances.GetBody(); if (Object.op_Implicit((Object)(object)body) && !body.isPlayerControlled && ((Enum)body.bodyFlags).HasFlag((Enum)(object)(BodyFlags)2) && Object.op_Implicit((Object)(object)body.teamComponent) && body.teamComponent.teamIndex == val) { if (Object.op_Implicit((Object)(object)body.healthComponent)) { body.healthComponent.HealFraction(1f, default(ProcChainMask)); } body.AddTimedBuff(Buffs.DroneRepairBuff, 8f); } } EntitySoundManager.EmitSoundServer(activationSound.index, ((Component)slot.characterBody).gameObject); return true; } protected override void CreateCraftableDef() { //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Expected O, but got Unknown //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Expected O, but got Unknown //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Expected O, but got Unknown //IL_0115: 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_0153: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Expected O, but got Unknown //IL_016c: 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_0182: Expected O, but got Unknown //IL_0184: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Expected O, but got Unknown //IL_01be: Unknown result type (might be due to invalid IL or missing references) //IL_01c5: Expected O, but got Unknown //IL_01d7: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: Unknown result type (might be due to invalid IL or missing references) //IL_01ed: Expected O, but got Unknown //IL_01ef: Unknown result type (might be due to invalid IL or missing references) //IL_01f4: Unknown result type (might be due to invalid IL or missing references) //IL_0201: Expected O, but got Unknown if (!Object.op_Implicit((Object)(object)EquipmentDef)) { return; } bool flag = ItemBase.Instance != null && Object.op_Implicit((Object)(object)ItemBase.Instance.ItemDef); bool flag2 = ItemBase.Instance != null && Object.op_Implicit((Object)(object)ItemBase.Instance.ItemDef); if (ItemBase.Instance != null && Object.op_Implicit((Object)(object)ItemBase.Instance.ItemDef)) { CraftableDef val = ScriptableObject.CreateInstance(); val.pickup = (Object)(object)EquipmentDef; Recipe[] array = new Recipe[1]; Recipe val2 = new Recipe(); val2.amountToDrop = 1; val2.ingredients = (RecipeIngredient[])(object)new RecipeIngredient[2] { new RecipeIngredient { pickup = (Object)(object)ItemBase.Instance.ItemDef }, new RecipeIngredient { pickup = (Object)(object)Addressables.LoadAssetAsync((object)"RoR2/Base/EquipmentMagazine/EquipmentMagazine.asset").WaitForCompletion() } }; array[0] = val2; val.recipes = (Recipe[])(object)array; ((Object)val).name = "cdDroneRepairKit"; PluginContentPack.craftableDefs.Add(val); } if (flag2 || flag) { ItemDef pickup = Addressables.LoadAssetAsync((object)"RoR2/DLC1/DroneWeapons/DroneWeapons.asset").WaitForCompletion(); CraftableDef val3 = ScriptableObject.CreateInstance(); val3.pickup = (Object)(object)pickup; val3.recipes = (Recipe[])(object)new Recipe[0]; if (flag2) { Recipe[] recipes = val3.recipes; Recipe val2 = new Recipe(); val2.amountToDrop = 1; val2.ingredients = (RecipeIngredient[])(object)new RecipeIngredient[2] { new RecipeIngredient { pickup = (Object)(object)ItemBase.Instance.ItemDef }, new RecipeIngredient { pickup = (Object)(object)EquipmentDef } }; val3.recipes = recipes.Append(val2).ToArray(); } if (flag) { Recipe[] recipes2 = val3.recipes; Recipe val2 = new Recipe(); val2.amountToDrop = 1; val2.ingredients = (RecipeIngredient[])(object)new RecipeIngredient[2] { new RecipeIngredient { pickup = (Object)(object)ItemBase.Instance.ItemDef }, new RecipeIngredient { pickup = (Object)(object)EquipmentDef } }; val3.recipes = recipes2.Append(val2).ToArray(); } ((Object)val3).name = "cdDRKToSDP"; PluginContentPack.craftableDefs.Add(val3); } } } public class DroneRepairKitSummonTracker : MonoBehaviour { public GameObject summonMasterInstance = null; } public abstract class EquipmentBase : EquipmentBase where T : EquipmentBase { public static T Instance { get; private set; } public EquipmentBase() { if (Instance != null) { throw new InvalidOperationException("Singleton class \"" + typeof(T).Name + "\" inheriting EquipmentBoilerplate/Equipment was instantiated twice"); } Instance = this as T; } } public abstract class EquipmentBase { public enum TargetFinderType { Enemies, BossesWithRewards, Friendlies, Pickups, Custom, None } public EquipmentDef EquipmentDef; public GameObject ItemBodyModelPrefab; public GameObject TargetingIndicatorPrefabBase = null; public abstract string EquipmentName { get; } public abstract string EquipmentLangTokenName { get; } public virtual string EquipmentPickupToken => "CLASSICITEMSRETURNS_EQUIPMENT_" + EquipmentLangTokenName + "_PICKUP"; public virtual object[] EquipmentPickupDescParams { get; } public virtual string EquipmentDescriptionToken => "CLASSICITEMSRETURNS_EQUIPMENT_" + EquipmentLangTokenName + "_DESCRIPTION"; public virtual object[] EquipmentFullDescriptionParams { get; } public virtual string EquipmentUniquePickupToken { get; } public virtual string EquipmentUniqueDescriptionToken { get; } public abstract GameObject EquipmentModel { get; } public abstract Sprite EquipmentIcon { get; } public virtual bool AppearsInSinglePlayer { get; } = true; public virtual bool AppearsInMultiPlayer { get; } = true; public virtual bool CanDrop { get; } = true; public virtual float Cooldown { get; } = 60f; public virtual bool EnigmaCompatible { get; } = true; public virtual bool IsBoss { get; } = false; public virtual bool IsLunar { get; } = false; public virtual bool CanBeRandomlyTriggered { get; } = true; public virtual EquipmentBase DependentEquipment { get; } = null; public virtual string ParentEquipmentName { get; } = null; public virtual UnlockableDef UnlockableDef { get; set; } = null; public virtual bool UnlockableDefAutoSetup { get; } = false; public virtual ExpansionDef ExpansionDef { get; } public virtual bool Unfinished { get; } = false; public string ConfigCategory => "Equipment: " + EquipmentName; public virtual TargetFinderType EquipmentTargetFinderType { get; } = TargetFinderType.None; public abstract ItemDisplayRuleDict CreateItemDisplayRules(); public virtual void Init(ConfigFile config) { CreateConfig(config); CreateAssets(config); CreateLang(); CreateEquipment(); if ((Object)(object)EquipmentDef != (Object)null) { ClassicItemsReturnsPlugin.onFinishScanning = (Action)Delegate.Combine(ClassicItemsReturnsPlugin.onFinishScanning, new Action(CreateCraftableDef)); } Hooks(); } public virtual void CreateAssets(ConfigFile config) { } protected virtual void CreateConfig(ConfigFile config) { } protected virtual void CreateCraftableDef() { } protected virtual void CreateLang() { object[] equipmentPickupDescParams = EquipmentPickupDescParams; bool flag = equipmentPickupDescParams != null && equipmentPickupDescParams.Length != 0; object[] equipmentFullDescriptionParams = EquipmentFullDescriptionParams; bool flag2 = equipmentFullDescriptionParams != null && equipmentFullDescriptionParams.Length != 0; if (flag2 && flag) { return; } if (flag) { if (Utility.IsNullOrWhiteSpace(EquipmentUniquePickupToken)) { LanguageOverrides.DeferToken(EquipmentPickupToken, EquipmentPickupDescParams); } else { LanguageOverrides.DeferUniqueToken(EquipmentUniquePickupToken, EquipmentPickupToken, EquipmentPickupDescParams); } } if (flag2) { if (Utility.IsNullOrWhiteSpace(EquipmentUniqueDescriptionToken)) { LanguageOverrides.DeferToken(EquipmentDescriptionToken, EquipmentFullDescriptionParams); } else { LanguageOverrides.DeferUniqueToken(EquipmentUniqueDescriptionToken, EquipmentDescriptionToken, EquipmentFullDescriptionParams); } } } protected void CreateEquipment() { //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_01db: Unknown result type (might be due to invalid IL or missing references) //IL_01e5: Expected O, but got Unknown //IL_01ed: Unknown result type (might be due to invalid IL or missing references) //IL_01f7: Expected O, but got Unknown //IL_0212: Unknown result type (might be due to invalid IL or missing references) //IL_021c: Expected O, but got Unknown string text = "CLASSICITEMSRETURNS_EQUIPMENT_"; EquipmentDef = ScriptableObject.CreateInstance(); ((Object)EquipmentDef).name = text + EquipmentLangTokenName; EquipmentDef.nameToken = text + EquipmentLangTokenName + "_NAME"; EquipmentDef.pickupToken = EquipmentPickupToken; EquipmentDef.descriptionToken = EquipmentDescriptionToken; EquipmentDef.loreToken = text + EquipmentLangTokenName + "_LORE"; EquipmentDef.pickupModelPrefab = EquipmentModel; EquipmentDef.pickupIconSprite = EquipmentIcon; EquipmentDef.appearsInSinglePlayer = AppearsInSinglePlayer; EquipmentDef.appearsInMultiPlayer = AppearsInMultiPlayer; EquipmentDef.canDrop = CanDrop; EquipmentDef.cooldown = Cooldown; EquipmentDef.enigmaCompatible = EnigmaCompatible; EquipmentDef.isBoss = IsBoss; EquipmentDef.isLunar = IsLunar; EquipmentDef.canBeRandomlyTriggered = CanBeRandomlyTriggered; if (Object.op_Implicit((Object)(object)ExpansionDef)) { EquipmentDef.requiredExpansion = ExpansionDef; } if (IsLunar) { EquipmentDef.colorIndex = (ColorIndex)4; } if (UnlockableDefAutoSetup) { UnlockableDef = Assets.CreateUnlockableDef("Equipment." + EquipmentLangTokenName, EquipmentDef.pickupIconSprite); } if ((Object)(object)UnlockableDef != (Object)null) { PluginContentPack.unlockableDefs.Add(UnlockableDef); EquipmentDef.unlockableDef = UnlockableDef; } ItemAPI.Add(new CustomEquipment(EquipmentDef, CreateItemDisplayRules())); EquipmentSlot.PerformEquipmentAction += new hook_PerformEquipmentAction(PerformEquipmentAction); if (EquipmentTargetFinderType != TargetFinderType.None) { EquipmentSlot.UpdateTargets += new hook_UpdateTargets(EquipmentSlot_UpdateTargets); } } private bool PerformEquipmentAction(orig_PerformEquipmentAction orig, EquipmentSlot self, EquipmentDef equipmentDef) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)equipmentDef == (Object)(object)EquipmentDef) { if (EquipmentTargetFinderType != TargetFinderType.None) { self.UpdateTargets(equipmentDef.equipmentIndex, ShouldAnticipateTarget(self)); } return ActivateEquipment(self); } return orig.Invoke(self, equipmentDef); } protected abstract bool ActivateEquipment(EquipmentSlot slot); public Sprite LoadSprite(string spriteName) { return Assets.LoadSprite(spriteName); } public GameObject LoadModel(string modelName) { return Assets.LoadObject(modelName); } public Sprite LoadItemSprite(string spriteName) { return ItemHelpers.LoadItemSprite(spriteName); } public GameObject LoadItemModel(string modelName) { //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) GameObject val = Assets.LoadObject("mdl3d" + modelName); if (Object.op_Implicit((Object)(object)val)) { ItemHelpers.SetupMaterials(val); if (!Object.op_Implicit((Object)(object)val.GetComponent())) { ItemDisplay val2 = val.AddComponent(); MeshRenderer[] componentsInChildren = val.GetComponentsInChildren(); List list = new List(); MeshRenderer[] array = componentsInChildren; for (int i = 0; i < array.Length; i++) { Renderer val3 = (Renderer)(object)array[i]; RendererInfo item = default(RendererInfo); item.renderer = val3; item.defaultMaterial = val3.material; item.defaultShadowCastingMode = val3.shadowCastingMode; item.ignoreOverlays = false; item.hideOnDeath = false; list.Add(item); } val2.rendererInfos = list.ToArray(); } } GameObject val4 = Assets.LoadObject("mdl" + modelName); GameObject val5 = Assets.LoadObject("mdlClassic" + modelName); Queue queue = new Queue(); if (ClassicItemsReturnsPlugin.use3dModels) { if (Object.op_Implicit((Object)(object)val)) { return val; } if (Object.op_Implicit((Object)(object)val4)) { return val4; } if (Object.op_Implicit((Object)(object)val5)) { return val5; } } else { if (!ClassicItemsReturnsPlugin.useClassicSprites) { if (Object.op_Implicit((Object)(object)val4)) { return val4; } if (Object.op_Implicit((Object)(object)val5)) { return val5; } } else { if (Object.op_Implicit((Object)(object)val5)) { return val5; } if (Object.op_Implicit((Object)(object)val4)) { return val4; } } if (Object.op_Implicit((Object)(object)val)) { return val; } } Debug.LogError((object)("ClassicItemsReturns: Could not find ANY model for " + modelName)); return null; } public virtual void Hooks() { } public virtual void FilterTargetFinderHurtbox(EquipmentSlot slot, BullseyeSearch targetFinder) { } private void EquipmentSlot_UpdateTargets(orig_UpdateTargets orig, EquipmentSlot self, EquipmentIndex targetingEquipmentIndex, bool userShouldAnticipateTarget) { //IL_0001: 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_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) if (targetingEquipmentIndex != EquipmentDef.equipmentIndex) { orig.Invoke(self, targetingEquipmentIndex, userShouldAnticipateTarget); return; } ConfigureTargetFinder(self); bool shouldShowOverride = Object.op_Implicit((Object)(object)self.currentTarget.transformToIndicateAt); if (shouldShowOverride) { GenericPickupController pickupController = self.currentTarget.pickupController; ConfigureTargetIndicator(self, targetingEquipmentIndex, pickupController, ref shouldShowOverride); } self.targetIndicator.active = shouldShowOverride && self.stock > 0; self.targetIndicator.targetTransform = (shouldShowOverride ? self.currentTarget.transformToIndicateAt : null); } protected void ConfigureTargetFinder(EquipmentSlot slot) { //IL_0180: Unknown result type (might be due to invalid IL or missing references) //IL_0191: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Unknown result type (might be due to invalid IL or missing references) //IL_01a8: Unknown result type (might be due to invalid IL or missing references) //IL_01ad: Unknown result type (might be due to invalid IL or missing references) //IL_01df: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) if (EquipmentTargetFinderType == TargetFinderType.Enemies || EquipmentTargetFinderType == TargetFinderType.BossesWithRewards || EquipmentTargetFinderType == TargetFinderType.Friendlies) { if (EquipmentTargetFinderType == TargetFinderType.Enemies || EquipmentTargetFinderType == TargetFinderType.BossesWithRewards) { slot.ConfigureTargetFinderForEnemies(); } if (EquipmentTargetFinderType == TargetFinderType.Friendlies) { slot.ConfigureTargetFinderForFriendlies(); } HurtBox val = null; if (EquipmentTargetFinderType == TargetFinderType.BossesWithRewards) { foreach (HurtBox result in slot.targetFinder.GetResults()) { if (Object.op_Implicit((Object)(object)result) && Object.op_Implicit((Object)(object)result.healthComponent) && Object.op_Implicit((Object)(object)result.healthComponent.body)) { DeathRewards component = ((Component)result.healthComponent.body).gameObject.GetComponent(); if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component.bossDropTable) && !result.healthComponent.body.HasBuff(Buffs.Immune)) { val = result; break; } } } } else { FilterTargetFinderHurtbox(slot, slot.targetFinder); val = slot.targetFinder.GetResults().FirstOrDefault(); } slot.currentTarget = new UserTargetInfo(val); } else if (EquipmentTargetFinderType == TargetFinderType.Pickups) { slot.currentTarget = new UserTargetInfo(slot.FindPickupController(slot.GetAimRay(), 10f, 30f, true, slot.equipmentIndex == EquipmentDef.equipmentIndex)); } else if (EquipmentTargetFinderType == TargetFinderType.Custom) { ConfigureTargetFinderCustom(slot); SetCurrentTargetCustom(slot); } else { slot.currentTarget = default(UserTargetInfo); } } protected virtual void ConfigureTargetFinderCustom(EquipmentSlot equipmentSlot) { ClassicItemsReturnsPlugin.ModLogger.LogWarning((object)"EquipmentBase.Targeting ConfigureTargetFinderCustom isn't set!"); } protected virtual void SetCurrentTargetCustom(EquipmentSlot equipmentSlot) { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) ClassicItemsReturnsPlugin.ModLogger.LogWarning((object)"EquipmentBase.Targeting SetCurrentTargetCustom isn't set!"); equipmentSlot.currentTarget = new UserTargetInfo(equipmentSlot.targetFinder.GetResults().FirstOrDefault()); } protected virtual void ConfigureTargetIndicator(EquipmentSlot equipmentSlot, EquipmentIndex targetingEquipmentIndex, GenericPickupController genericPickupController, ref bool shouldShowOverride) { equipmentSlot.targetIndicator.visualizerPrefab = LegacyResourcesAPI.Load("Prefabs/BossHunterIndicator"); } public virtual bool ShouldAnticipateTarget(EquipmentSlot equipmentSlot) { if (EquipmentTargetFinderType == TargetFinderType.None || EquipmentTargetFinderType == TargetFinderType.Pickups) { return false; } return equipmentSlot.stock > 0; } } internal class LostDoll : EquipmentBase { public bool useAltLore = true; public const float selfHurtCoefficient = 0.25f; public const float healthCoefficient = 4f; public const float durationDelay = 0.5f; public static GameObject dollActivationEffect; public static NetworkSoundEventDef dollActivationSound; public override string EquipmentName => "Lost Doll"; public override bool EnigmaCompatible { get; } = false; public override bool CanBeRandomlyTriggered { get; } = false; public override string EquipmentLangTokenName => "LOSTDOLL"; public override object[] EquipmentFullDescriptionParams => new object[2] { 25f, 400f }; public override GameObject EquipmentModel => LoadItemModel("Doll"); public override Sprite EquipmentIcon => LoadItemSprite("Doll"); public override TargetFinderType EquipmentTargetFinderType => TargetFinderType.Enemies; public override bool IsLunar => true; public override float Cooldown => 25f; public override void Init(ConfigFile config) { CreateConfig(config); CreateLang(); CreateTargetingIndicator(); CreateAssets(); CreateEquipment(); Hooks(); } protected override void CreateConfig(ConfigFile config) { useAltLore = config.Bind(base.ConfigCategory, "Alt Lore", true, "Uses an unused Lunar lore entry instead of the original RoR1 one.").Value; RoR2Application.onLoad = (Action)Delegate.Combine(RoR2Application.onLoad, new Action(SetLore)); } private void SetLore() { if (useAltLore) { EquipmentDef equipmentDef = EquipmentDef; equipmentDef.loreToken += "_ALT"; } } public void CreateAssets() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) dollActivationEffect = Addressables.LoadAssetAsync((object)"RoR2/Base/DeathProjectile/DeathProjectileTickEffect.prefab").WaitForCompletion(); dollActivationSound = Assets.CreateNetworkSoundEventDef("Play_ClassicItemsReturns_Doll"); } private void CreateTargetingIndicator() { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) TargetingIndicatorPrefabBase = PrefabAPI.InstantiateClone(LegacyResourcesAPI.Load("Prefabs/WoodSpriteIndicator"), "RCI_LostDollIndicator", false); TargetingIndicatorPrefabBase.GetComponentInChildren().color = Color32.op_Implicit(new Color32((byte)156, (byte)80, (byte)82, byte.MaxValue)); ((Component)TargetingIndicatorPrefabBase.GetComponentInChildren()).transform.rotation = Quaternion.identity; ((Graphic)TargetingIndicatorPrefabBase.GetComponentInChildren()).color = Color32.op_Implicit(new Color32((byte)156, (byte)80, (byte)82, byte.MaxValue)); } public override ItemDisplayRuleDict CreateItemDisplayRules() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) ItemDisplayRuleDict val = new ItemDisplayRuleDict(Array.Empty()); GameObject equipmentModel = EquipmentModel; if (!((Object)equipmentModel).name.Contains("mdl3d")) { return val; } val.Add("EquipmentDroneBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { followerPrefab = EquipmentModel, ruleType = (ItemDisplayRuleType)0, childName = "GunBarrelBase", localPos = new Vector3(0.00234f, 0.03307f, 1.32997f), localAngles = new Vector3(281.8f, 180f, 180f), localScale = new Vector3(0.25f, 0.25f, 0.25f) } }); return val; } protected override void ConfigureTargetIndicator(EquipmentSlot equipmentSlot, EquipmentIndex targetingEquipmentIndex, GenericPickupController genericPickupController, ref bool shouldShowOverride) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) UserTargetInfo currentTarget = equipmentSlot.currentTarget; if (Object.op_Implicit((Object)(object)currentTarget.hurtBox) && Object.op_Implicit((Object)(object)equipmentSlot.currentTarget.hurtBox.healthComponent) && equipmentSlot.currentTarget.hurtBox.healthComponent.alive) { equipmentSlot.targetIndicator.visualizerPrefab = TargetingIndicatorPrefabBase; } else { shouldShowOverride = false; } } protected override bool ActivateEquipment(EquipmentSlot slot) { //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Expected O, but got Unknown HurtBox hurtBox = slot.currentTarget.hurtBox; if (!Object.op_Implicit((Object)(object)hurtBox) || !Object.op_Implicit((Object)(object)hurtBox.healthComponent) || !hurtBox.healthComponent.alive) { return false; } EntitySoundManager.EmitSoundServer(AkEventIdArg.op_Implicit(dollActivationSound.akId), ((Component)slot).gameObject); slot.subcooldownTimer = 0.05f; OrbManager.instance.AddOrb((Orb)(object)new Orbs.CIR_LostDollOrb { attacker = ((Component)slot).gameObject, attackerCharacterBody = slot.characterBody, damageColorIndex = (DamageColorIndex)3, damageValue = slot.characterBody.healthComponent.fullCombinedHealth * 4f, isCrit = Util.CheckRoll(slot.characterBody.crit, slot.characterBody.master), procChainMask = default(ProcChainMask), procCoefficient = 1f, target = hurtBox, origin = slot.characterBody.corePosition, teamIndex = slot.characterBody.teamComponent.teamIndex }); EffectData val = new EffectData { origin = slot.characterBody.corePosition }; EffectManager.SpawnEffect(dollActivationEffect, val, true); slot.InvalidateCurrentTarget(); return true; } } public class Prescriptions : EquipmentBase { public const float buffDuration = 8f; public const float buffDamageMultiplier = 0.25f; public const float buffAttackSpeed = 0.5f; public override string EquipmentName => "Prescriptions"; public override string EquipmentLangTokenName => "DRUGS"; public override bool EnigmaCompatible { get; } = true; public override bool CanBeRandomlyTriggered { get; } = true; public override object[] EquipmentFullDescriptionParams => new object[3] { 8f, 25f, 50f }; public override GameObject EquipmentModel => LoadItemModel("Pills"); public override Sprite EquipmentIcon => LoadItemSprite("Pills"); public static BuffDef DrugsBuff => Buffs.DrugsBuff; public override void Hooks() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(RecalculateStatsAPI_GetStatCoefficients); } private void RecalculateStatsAPI_GetStatCoefficients(CharacterBody sender, StatHookEventArgs args) { int buffCount = sender.GetBuffCount(DrugsBuff); if (buffCount > 0) { args.attackSpeedMultAdd += 0.5f; args.damageMultAdd += 0.25f; } } public override ItemDisplayRuleDict CreateItemDisplayRules() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) ItemDisplayRuleDict val = new ItemDisplayRuleDict(Array.Empty()); GameObject equipmentModel = EquipmentModel; if (!((Object)equipmentModel).name.Contains("mdl3d")) { return val; } val.Add("EquipmentDroneBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { followerPrefab = EquipmentModel, ruleType = (ItemDisplayRuleType)0, childName = "GunBarrelBase", localPos = new Vector3(0.01209f, 0f, 1.69616f), localAngles = new Vector3(0f, 90f, 56f), localScale = new Vector3(0.25f, 0.25f, 0.25f) } }); return val; } protected override bool ActivateEquipment(EquipmentSlot slot) { slot.characterBody.AddTimedBuff(DrugsBuff, 8f); Util.PlaySound("Play_item_proc_healingPotion", ((Component)slot).gameObject); return true; } } internal class ResetSkillCooldown : EquipmentBase { public override string EquipmentName => "Gigantic Amethyst"; public override string EquipmentLangTokenName => "RESETSKILLCOOLDOWN"; public override bool EnigmaCompatible { get; } = true; public override bool CanBeRandomlyTriggered { get; } = true; public override GameObject EquipmentModel => LoadItemModel("Crystal"); public override Sprite EquipmentIcon => LoadItemSprite("Crystal"); public override float Cooldown => 12f; public override ItemDisplayRuleDict CreateItemDisplayRules() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) ItemDisplayRuleDict val = new ItemDisplayRuleDict(Array.Empty()); GameObject equipmentModel = EquipmentModel; if (!((Object)equipmentModel).name.Contains("mdl3d")) { return val; } val.Add("EquipmentDroneBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefab = EquipmentModel, childName = "GunBarrelBase", localPos = new Vector3(0f, 0f, 2f), localAngles = new Vector3(90f, 0f, 0f), localScale = new Vector3(0.3f, 0.3f, 0.3f) } }); return val; } public override void Init(ConfigFile config) { CreateConfig(config); CreateLang(); CreateEquipment(); ClassicItemsReturnsPlugin.onFinishScanning = (Action)Delegate.Combine(ClassicItemsReturnsPlugin.onFinishScanning, new Action(CreateCraftableDef)); Hooks(); } protected override bool ActivateEquipment(EquipmentSlot slot) { if (Object.op_Implicit((Object)(object)slot) && Object.op_Implicit((Object)(object)slot.characterBody) && Object.op_Implicit((Object)(object)slot.characterBody.skillLocator)) { slot.characterBody.skillLocator.ApplyAmmoPack(); Util.PlaySound("Play_env_hiddenLab_laptop_activate", ((Component)slot).gameObject); return true; } return false; } protected override void CreateCraftableDef() { //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Expected O, but got Unknown //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Expected O, but got Unknown //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Expected O, but got Unknown if (Object.op_Implicit((Object)(object)EquipmentDef)) { CraftableDef val = ScriptableObject.CreateInstance(); val.pickup = (Object)(object)EquipmentDef; Recipe[] array = new Recipe[1]; Recipe val2 = new Recipe(); val2.amountToDrop = 1; val2.ingredients = (RecipeIngredient[])(object)new RecipeIngredient[2] { new RecipeIngredient { pickup = (Object)(object)Addressables.LoadAssetAsync((object)"RoR2/Base/NearbyDamageBonus/NearbyDamageBonus.asset").WaitForCompletion() }, new RecipeIngredient { pickup = (Object)(object)Addressables.LoadAssetAsync((object)"RoR2/Base/EquipmentMagazine/EquipmentMagazine.asset").WaitForCompletion() } }; array[0] = val2; val.recipes = (Recipe[])(object)array; ((Object)val).name = "cdAmethyst"; PluginContentPack.craftableDefs.Add(val); } } } public class Thqwibs : EquipmentBase { public int projectileCount = 15; public float damageCoefficient = 3.6f; public GameObject projectilePrefab; public override string EquipmentName => "Thqwibs"; public override string EquipmentLangTokenName => "THQWIBS"; public override GameObject EquipmentModel => LoadItemModel("Squib"); public override Sprite EquipmentIcon => LoadItemSprite("Squib"); public override bool EnigmaCompatible { get; } = true; public override bool CanBeRandomlyTriggered { get; } = true; public override float Cooldown => 45f; public override object[] EquipmentFullDescriptionParams => new object[2] { projectileCount, damageCoefficient * 100f }; public override bool Unfinished => false; public override ItemDisplayRuleDict CreateItemDisplayRules() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) ItemDisplayRuleDict val = new ItemDisplayRuleDict(Array.Empty()); GameObject equipmentModel = EquipmentModel; if (!((Object)equipmentModel).name.Contains("mdl3d")) { return val; } val.Add("EquipmentDroneBody", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefab = EquipmentModel, childName = "GunBarrelBase", localPos = new Vector3(0f, 0f, 2.02558f), localAngles = new Vector3(270f, 0f, 0f), localScale = new Vector3(0.4f, 0.4f, 0.4f) } }); return val; } public override void Init(ConfigFile config) { BuildProjectile(); base.Init(config); } private void BuildProjectile() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) projectilePrefab = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync((object)"RoR2/Base/Scav/ScavSackProjectile.prefab").WaitForCompletion(), "ClassicItemsReturns_SquibProjectile", true); Object.Destroy((Object)(object)projectilePrefab.GetComponent()); ProjectileImpactExplosion component = projectilePrefab.GetComponent(); component.destroyOnEnemy = true; ((ProjectileExplosion)component).falloffModel = (FalloffModel)0; PluginContentPack.projectilePrefabs.Add(projectilePrefab); } protected override bool ActivateEquipment(EquipmentSlot slot) { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)slot.characterBody)) { return false; } float num = 80f; Ray aimRay = slot.GetAimRay(); for (int i = 0; i < projectileCount; i++) { Quaternion val = Util.QuaternionSafeLookRotation(Util.ApplySpread(((Ray)(ref aimRay)).direction, 0f, 12f, 1f, 1f, 0f, 0f)); ProjectileManager.instance.FireProjectile(projectilePrefab, ((Ray)(ref aimRay)).origin, val, ((Component)slot.characterBody).gameObject, slot.characterBody.damage * damageCoefficient, 0f, Util.CheckRoll(slot.characterBody.crit, slot.characterBody.master), (DamageColorIndex)0, (GameObject)null, num, (DamageTypeCombo?)DamageTypeCombo.op_Implicit((DamageSource)64)); } return true; } } } namespace ClassicItemsReturns.Equipment.EliteEquipment { public abstract class EliteEquipmentBase : EliteEquipmentBase where T : EliteEquipmentBase { public static T Instance { get; private set; } public EliteEquipmentBase() { if (Instance != null) { throw new InvalidOperationException("Singleton class \"" + typeof(T).Name + "\" inheriting EliteEquipmentBase was instantiated twice"); } Instance = this as T; } } public abstract class EliteEquipmentBase { public class EliteOverlayManager : MonoBehaviour { public TemporaryOverlay Overlay; public CharacterBody Body; public BuffDef EliteBuffDef; public void FixedUpdate() { if (!Body.HasBuff(EliteBuffDef)) { Object.Destroy((Object)(object)Overlay); Object.Destroy((Object)(object)this); } } } public enum TargetingType { Enemies, Friendlies } public class TargetingControllerComponent : MonoBehaviour { public GameObject TargetObject; public GameObject VisualizerPrefab; public Indicator Indicator; public BullseyeSearch TargetFinder; public Action AdditionalBullseyeFunctionality = delegate { }; public void Awake() { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Expected O, but got Unknown Indicator = new Indicator(((Component)this).gameObject, (GameObject)null); } public void OnDestroy() { Invalidate(); } public void Invalidate() { TargetObject = null; Indicator.targetTransform = null; } public void ConfigureTargetFinderBase(EquipmentSlot self) { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Expected O, but got Unknown if (TargetFinder == null) { TargetFinder = new BullseyeSearch(); } TargetFinder.teamMaskFilter = TeamMask.allButNeutral; ((TeamMask)(ref TargetFinder.teamMaskFilter)).RemoveTeam(self.characterBody.teamComponent.teamIndex); TargetFinder.sortMode = (SortMode)2; TargetFinder.filterByLoS = true; float num = default(float); Ray val = CameraRigController.ModifyAimRayIfApplicable(self.GetAimRay(), ((Component)self).gameObject, ref num); TargetFinder.searchOrigin = ((Ray)(ref val)).origin; TargetFinder.searchDirection = ((Ray)(ref val)).direction; TargetFinder.maxAngleFilter = 10f; TargetFinder.viewer = self.characterBody; } public void ConfigureTargetFinderForEnemies(EquipmentSlot self) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) ConfigureTargetFinderBase(self); TargetFinder.teamMaskFilter = TeamMask.GetUnprotectedTeams(self.characterBody.teamComponent.teamIndex); TargetFinder.RefreshCandidates(); TargetFinder.FilterOutGameObject(((Component)self).gameObject); AdditionalBullseyeFunctionality(TargetFinder); PlaceTargetingIndicator(TargetFinder.GetResults()); } public void ConfigureTargetFinderForFriendlies(EquipmentSlot self) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) ConfigureTargetFinderBase(self); TargetFinder.teamMaskFilter = TeamMask.none; ((TeamMask)(ref TargetFinder.teamMaskFilter)).AddTeam(self.characterBody.teamComponent.teamIndex); TargetFinder.RefreshCandidates(); TargetFinder.FilterOutGameObject(((Component)self).gameObject); AdditionalBullseyeFunctionality(TargetFinder); PlaceTargetingIndicator(TargetFinder.GetResults()); } public void PlaceTargetingIndicator(IEnumerable TargetFinderResults) { HurtBox val = (TargetFinderResults.Any() ? TargetFinderResults.First() : null); if (Object.op_Implicit((Object)(object)val)) { TargetObject = ((Component)val.healthComponent).gameObject; Indicator.visualizerPrefab = VisualizerPrefab; Indicator.targetTransform = ((Component)val).transform; } else { Invalidate(); } Indicator.active = Object.op_Implicit((Object)(object)val); } } public EquipmentDef EliteEquipmentDef; public BuffDef EliteBuffDef; public EliteDef EliteDef; public GameObject TargetingIndicatorPrefabBase = null; public abstract string EliteEquipmentName { get; } public abstract string EliteAffixToken { get; } public virtual string EliteEquipmentPickupToken => "CLASSICITEMSRETURNS_ELITE_EQUIPMENT_" + EliteAffixToken + "_PICKUP"; public virtual string[] EliteEquipmentPickupDescParams { get; } public virtual string EquipmentDescriptionToken => "CLASSICITEMSRETURNS_EQUIPMENT_" + EliteAffixToken + "_DESCRIPTION"; public virtual string[] EliteEquipmentFullDescriptionParams { get; } public virtual bool AppearsInSinglePlayer { get; } = true; public virtual bool AppearsInMultiPlayer { get; } = true; public virtual bool CanDrop { get; } = false; public virtual float Cooldown { get; } = 60f; public virtual bool EnigmaCompatible { get; } = false; public virtual bool CanBeRandomlyTriggered { get; } = false; public virtual bool IsBoss { get; } = false; public virtual bool IsLunar { get; } = false; public virtual ExpansionDef ExpansionDef { get; } public abstract GameObject EliteEquipmentModel { get; } public abstract Sprite EliteEquipmentIcon { get; } public abstract Sprite EliteBuffIcon { get; } public virtual EliteTierDef[] CanAppearInEliteTiers { get; set; } = EliteAPI.GetCombatDirectorEliteTiers(); public virtual Material EliteMaterial { get; set; } = null; public virtual float HealthMultiplier { get; set; } = 1f; public virtual float DamageMultiplier { get; set; } = 1f; public virtual bool UseTargeting { get; } = false; public virtual TargetingType TargetingTypeEnum { get; } = TargetingType.Enemies; public abstract void Init(ConfigFile config); public abstract ItemDisplayRuleDict CreateItemDisplayRules(); protected void CreateLang() { string[] eliteEquipmentPickupDescParams = EliteEquipmentPickupDescParams; bool flag = eliteEquipmentPickupDescParams != null && eliteEquipmentPickupDescParams.Length != 0; string[] eliteEquipmentFullDescriptionParams = EliteEquipmentFullDescriptionParams; bool flag2 = eliteEquipmentFullDescriptionParams != null && eliteEquipmentFullDescriptionParams.Length != 0; if (!(flag2 && flag)) { if (flag) { string eliteEquipmentPickupToken = EliteEquipmentPickupToken; object[] eliteEquipmentPickupDescParams2 = EliteEquipmentPickupDescParams; LanguageOverrides.DeferToken(eliteEquipmentPickupToken, eliteEquipmentPickupDescParams2); } if (flag2) { string equipmentDescriptionToken = EquipmentDescriptionToken; object[] eliteEquipmentPickupDescParams2 = EliteEquipmentFullDescriptionParams; LanguageOverrides.DeferToken(equipmentDescriptionToken, eliteEquipmentPickupDescParams2); } } } protected void CreateEquipment() { //IL_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_01bb: Expected O, but got Unknown //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: Expected O, but got Unknown //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_01f0: Unknown result type (might be due to invalid IL or missing references) //IL_01fa: Expected O, but got Unknown //IL_0213: Unknown result type (might be due to invalid IL or missing references) //IL_021d: Expected O, but got Unknown string text = "CLASSICITEMSRETURNS_ELITE_EQUIPMENT_"; if ((Object)(object)EliteBuffDef == (Object)null) { EliteBuffDef = Buffs.CreateEliteBuffDef(EliteAffixToken, Color32.op_Implicit(new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue)), null, EliteBuffIcon, null); } EliteEquipmentDef = ScriptableObject.CreateInstance(); ((Object)EliteEquipmentDef).name = text + EliteAffixToken; EliteEquipmentDef.nameToken = text + EliteAffixToken + "_NAME"; EliteEquipmentDef.pickupToken = text + EliteAffixToken + "_PICKUP"; EliteEquipmentDef.descriptionToken = text + EliteAffixToken + "_DESCRIPTION"; EliteEquipmentDef.pickupModelPrefab = EliteEquipmentModel; EliteEquipmentDef.pickupIconSprite = EliteEquipmentIcon; EliteEquipmentDef.appearsInSinglePlayer = AppearsInSinglePlayer; EliteEquipmentDef.appearsInMultiPlayer = AppearsInMultiPlayer; EliteEquipmentDef.canDrop = CanDrop; EliteEquipmentDef.cooldown = Cooldown; EliteEquipmentDef.enigmaCompatible = EnigmaCompatible; EliteEquipmentDef.isBoss = IsBoss; EliteEquipmentDef.isLunar = IsLunar; EliteEquipmentDef.passiveBuffDef = EliteBuffDef; EliteEquipmentDef.canBeRandomlyTriggered = false; EliteEquipmentDef.dropOnDeathChance = 0.00025f; EliteEquipmentDef.requiredExpansion = null; EliteEquipmentDef.unlockableDef = null; ItemAPI.Add(new CustomEquipment(EliteEquipmentDef, CreateItemDisplayRules())); EquipmentSlot.PerformEquipmentAction += new hook_PerformEquipmentAction(PerformEquipmentAction); if (UseTargeting && Object.op_Implicit((Object)(object)TargetingIndicatorPrefabBase)) { EquipmentSlot.Update += new hook_Update(UpdateTargeting); } if (Object.op_Implicit((Object)(object)EliteMaterial)) { CharacterBody.FixedUpdate += new hook_FixedUpdate(OverlayManager); } } private void OverlayManager(orig_FixedUpdate orig, CharacterBody self) { if (Object.op_Implicit((Object)(object)self.modelLocator) && Object.op_Implicit((Object)(object)self.modelLocator.modelTransform) && self.HasBuff(EliteBuffDef)) { EliteOverlayManager[] components = ((Component)self).gameObject.GetComponents(); EliteOverlayManager eliteOverlayManager = null; if (!components.Any()) { eliteOverlayManager = ((Component)self).gameObject.AddComponent(); } else { EliteOverlayManager[] array = components; foreach (EliteOverlayManager eliteOverlayManager2 in array) { if ((Object)(object)eliteOverlayManager2.EliteBuffDef == (Object)(object)EliteBuffDef) { orig.Invoke(self); return; } } TemporaryOverlay val = ((Component)self.modelLocator.modelTransform).gameObject.AddComponent(); val.duration = float.PositiveInfinity; val.alphaCurve = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f); val.animateShaderAlpha = true; val.destroyComponentOnEnd = true; val.originalMaterial = EliteMaterial; val.AddToCharacerModel(((Component)self.modelLocator.modelTransform).GetComponent()); if (!Object.op_Implicit((Object)(object)eliteOverlayManager)) { eliteOverlayManager = ((Component)self).gameObject.AddComponent(); } eliteOverlayManager.Overlay = val; eliteOverlayManager.Body = self; eliteOverlayManager.EliteBuffDef = EliteBuffDef; } } orig.Invoke(self); } protected void CreateElite() { //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Expected O, but got Unknown EliteDef = ScriptableObject.CreateInstance(); ((Object)EliteDef).name = "CLASSICITEMSRETURNS_ELITE_" + EliteAffixToken; EliteDef.modifierToken = "CLASSICITEMSRETURNS_ELITE_" + EliteAffixToken + "_MODIFIER"; EliteDef.eliteEquipmentDef = EliteEquipmentDef; EliteTierDef?[] baseEliteTierDefs = EliteAPI.GetCombatDirectorEliteTiers(); if (!CanAppearInEliteTiers.All((EliteTierDef x) => baseEliteTierDefs.Contains(x))) { IEnumerable enumerable = CanAppearInEliteTiers.Except(baseEliteTierDefs); foreach (EliteTierDef eliteTierDef in enumerable) { int num = Array.FindIndex(baseEliteTierDefs, (EliteTierDef x) => x.costMultiplier >= eliteTierDef.costMultiplier); if (num >= 0) { EliteAPI.AddCustomEliteTier(eliteTierDef, num); } else { EliteAPI.AddCustomEliteTier(eliteTierDef); } baseEliteTierDefs = EliteAPI.GetCombatDirectorEliteTiers(); } } EliteAPI.Add(new CustomElite(EliteDef, (IEnumerable)CanAppearInEliteTiers)); EliteBuffDef.eliteDef = EliteDef; PluginContentPack.buffDefs.Add(EliteBuffDef); } protected bool PerformEquipmentAction(orig_PerformEquipmentAction orig, EquipmentSlot self, EquipmentDef equipmentDef) { if ((Object)(object)equipmentDef == (Object)(object)EliteEquipmentDef) { return ActivateEquipment(self); } return orig.Invoke(self, equipmentDef); } protected abstract bool ActivateEquipment(EquipmentSlot slot); public abstract void Hooks(); protected void UpdateTargeting(orig_Update orig, EquipmentSlot self) { //IL_000a: 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) orig.Invoke(self); if (self.equipmentIndex != EliteEquipmentDef.equipmentIndex) { return; } TargetingControllerComponent targetingControllerComponent = ((Component)self).GetComponent(); if (!Object.op_Implicit((Object)(object)targetingControllerComponent)) { targetingControllerComponent = ((Component)self).gameObject.AddComponent(); targetingControllerComponent.VisualizerPrefab = TargetingIndicatorPrefabBase; } if (self.stock > 0) { switch (TargetingTypeEnum) { case TargetingType.Enemies: targetingControllerComponent.ConfigureTargetFinderForEnemies(self); break; case TargetingType.Friendlies: targetingControllerComponent.ConfigureTargetFinderForFriendlies(self); break; } } else { targetingControllerComponent.Invalidate(); targetingControllerComponent.Indicator.active = false; } } } } namespace ClassicItemsReturns.Artifact { public abstract class ArtifactBase : ArtifactBase where T : ArtifactBase { public static T Instance { get; private set; } public ArtifactBase() { if (Instance != null) { throw new InvalidOperationException("Singleton class \"" + typeof(T).Name + "\" inheriting ArtifactBase was instantiated twice"); } Instance = this as T; } } public abstract class ArtifactBase { public ArtifactDef ArtifactDef; public abstract string ArtifactName { get; } public abstract string ArtifactLangTokenName { get; } public string ArtifactDescriptionToken => "CLASSICITEMSRETURNS_ARTIFACT_" + ArtifactLangTokenName + "_DESCRIPTION"; public virtual object[] ArtifactFullDescriptionParams { get; } public virtual ExpansionDef ArtifactExpansionDef { get; } public abstract Sprite ArtifactEnabledIcon { get; } public abstract Sprite ArtifactDisabledIcon { get; } public string ConfigCategory => "Artifact: " + ArtifactName; public bool ArtifactEnabled => RunArtifactManager.instance.IsArtifactEnabled(ArtifactDef); public virtual void Init(ConfigFile config) { CreateLang(); CreateArtifact(); Hooks(); } protected void CreateLang() { object[] artifactFullDescriptionParams = ArtifactFullDescriptionParams; if (artifactFullDescriptionParams != null && artifactFullDescriptionParams.Length != 0) { LanguageOverrides.DeferToken(ArtifactDescriptionToken, ArtifactFullDescriptionParams); } } protected void CreateArtifact() { //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Expected O, but got Unknown //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Expected O, but got Unknown string text = "CLASSICITEMSRETURNS_ARTIFACT_"; ArtifactDef = ScriptableObject.CreateInstance(); ArtifactDef.cachedName = text + ArtifactLangTokenName; ArtifactDef.nameToken = text + ArtifactLangTokenName + "_NAME"; ArtifactDef.descriptionToken = text + ArtifactLangTokenName + "_DESCRIPTION"; ArtifactDef.smallIconSelectedSprite = ArtifactEnabledIcon; ArtifactDef.smallIconDeselectedSprite = ArtifactDisabledIcon; if (Object.op_Implicit((Object)(object)ArtifactExpansionDef)) { ArtifactDef.requiredExpansion = ArtifactExpansionDef; } PluginContentPack.artifactDefs.Add(ArtifactDef); RunArtifactManager.onArtifactEnabledGlobal += new ArtifactStateChangeDelegate(RunArtifactManager_onArtifactEnabledGlobal); RunArtifactManager.onArtifactDisabledGlobal += new ArtifactStateChangeDelegate(RunArtifactManager_onArtifactDisabledGlobal); } private void RunArtifactManager_onArtifactEnabledGlobal([NotNull] RunArtifactManager runArtifactManager, [NotNull] ArtifactDef artifactDef) { if (!((Object)(object)artifactDef != (Object)(object)ArtifactDef)) { OnArtifactEnabled(); } } private void RunArtifactManager_onArtifactDisabledGlobal([NotNull] RunArtifactManager runArtifactManager, [NotNull] ArtifactDef artifactDef) { if (!((Object)(object)artifactDef != (Object)(object)ArtifactDef)) { OnArtifactDisabled(); } } public abstract void OnArtifactEnabled(); public abstract void OnArtifactDisabled(); public virtual void Hooks() { } public Sprite LoadSprite(string spriteName) { return Assets.LoadSprite(spriteName); } } public class ArtifactOfClover : ArtifactBase { public static ItemDef cloverDef; public static List affectedInventories = new List(); public override string ArtifactName => "Artifact of Clovers"; public override string ArtifactLangTokenName => "CLOVER"; public override Sprite ArtifactEnabledIcon => LoadSprite("texArtifactCloverEnabled"); public override Sprite ArtifactDisabledIcon => LoadSprite("texArtifactCloverDisabled"); public override void Init(ConfigFile config) { bool flag = false; if ((Object)(object)cloverDef != (Object)null) { foreach (ItemBase item in ClassicItemsReturnsPlugin.Items) { if ((Object)(object)item.ItemDef == (Object)(object)cloverDef) { flag = true; break; } } } if (!flag) { Debug.LogError((object)"Artifact of Clovers - Could not find 56 Leaf Clover. Artifact will not be initialized."); } else { base.Init(config); } } public override void Hooks() { Run.onRunStartGlobal += ResetInventoryList; } public override void OnArtifactEnabled() { CharacterBody.onBodyStartGlobal += GiveCloverOnSpawn; } public override void OnArtifactDisabled() { CharacterBody.onBodyStartGlobal -= GiveCloverOnSpawn; } private void ResetInventoryList(Run runObject) { affectedInventories.Clear(); } private void GiveCloverOnSpawn(CharacterBody body) { if (NetworkServer.active && body.isPlayerControlled && Object.op_Implicit((Object)(object)body.inventory) && !affectedInventories.Contains(body.inventory)) { affectedInventories.Add(body.inventory); body.inventory.GiveItemPermanent(cloverDef, 1); } } } }