Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of LostInTransitLegacy v1.0.0
plugins/LostInTransitLegacy/LostInTransitLegacy.dll
Decompiled 20 hours ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using EntityStates; using EntityStates.LostInTransitLegacy; using EntityStates.ParentMonster; using HG; using HG.Reflection; using KinematicCharacterController; using LostInTransitLegacy.Content; using LostInTransitLegacy.Elites; using LostInTransitLegacy.Items; using Microsoft.CodeAnalysis; using On.RoR2; using R2API; using R2API.Utils; using RoR2; using RoR2.Navigation; using RoR2BepInExPack.GameAssetPathsBetter; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.Networking; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: OptIn] [assembly: NetworkCompatibility(/*Could not decode attribute arguments.*/)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("LostInTransitLegacy")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+c988079955e49d627ea90ee7f89be9a0c0585f20")] [assembly: AssemblyProduct("LostInTransitLegacy")] [assembly: AssemblyTitle("LostInTransitLegacy")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace EntityStates.LostInTransitLegacy { public class FrenziedBlink : BaseState { public static string beginSoundString = "FrenzyDash"; private float duration; private float stopwatch; private Vector3 blinkStart; private Vector3 blinkDestination; private Transform modelTransform; private CharacterModel characterModel; private HurtBoxGroup hurtboxGroup; public override void OnEnter() { //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_0107: 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_0130: Unknown result type (might be due to invalid IL or missing references) //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) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_022f: Unknown result type (might be due to invalid IL or missing references) //IL_0234: 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_023c: Unknown result type (might be due to invalid IL or missing references) //IL_0241: 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_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_0257: Unknown result type (might be due to invalid IL or missing references) //IL_0267: Expected O, but got Unknown //IL_01c0: 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_01ff: 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_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_0219: Unknown result type (might be due to invalid IL or missing references) //IL_01d1: 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) ((BaseState)this).OnEnter(); duration = ((LoomingPresence.duration > 0f) ? LoomingPresence.duration : 0.3f); Util.PlaySound(beginSoundString, ((EntityState)this).gameObject); FrenzyingBehaviour frenzyingBehaviour = default(FrenzyingBehaviour); if (((EntityState)this).gameObject.TryGetComponent<FrenzyingBehaviour>(ref frenzyingBehaviour)) { frenzyingBehaviour.OnBlink(); } modelTransform = ((EntityState)this).GetModelTransform(); if (Object.op_Implicit((Object)(object)modelTransform)) { characterModel = ((Component)modelTransform).GetComponent<CharacterModel>(); hurtboxGroup = ((Component)modelTransform).GetComponent<HurtBoxGroup>(); } if (Object.op_Implicit((Object)(object)characterModel)) { CharacterModel obj = characterModel; int invisibilityCount = obj.invisibilityCount; obj.invisibilityCount = invisibilityCount + 1; } if (Object.op_Implicit((Object)(object)hurtboxGroup)) { HurtBoxGroup obj2 = hurtboxGroup; int invisibilityCount = obj2.hurtBoxesDeactivatorCounter; obj2.hurtBoxesDeactivatorCounter = invisibilityCount + 1; } if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor)) { ((Behaviour)((EntityState)this).characterMotor).enabled = false; } if (!((EntityState)this).isAuthority) { return; } blinkStart = ((EntityState)this).transform.position; blinkDestination = ((EntityState)this).transform.position; float num = ((Frenzying.instance != null) ? Frenzying.instance.blinkDistance : 25f); Vector3 target = ((EntityState)this).transform.position + ((EntityState)this).inputBank.aimDirection * num; SceneInfo instance = SceneInfo.instance; int num2; NodeGraph obj3; if (Object.op_Implicit((Object)(object)instance)) { if (!Object.op_Implicit((Object)(object)((EntityState)this).characterBody) || !((EntityState)this).characterBody.isFlying) { if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor)) { num2 = ((!((EntityState)this).characterMotor.isGrounded) ? 1 : 0); if (num2 != 0) { goto IL_01a3; } } else { num2 = 0; } obj3 = instance.groundNodes; goto IL_01a9; } num2 = 1; goto IL_01a3; } goto IL_021e; IL_021e: if (Object.op_Implicit((Object)(object)LoomingPresence.blinkPrefab)) { EffectManager.SpawnEffect(LoomingPresence.blinkPrefab, new EffectData { rotation = Util.QuaternionSafeLookRotation(blinkDestination - blinkStart), origin = Util.GetCorePosition(((EntityState)this).gameObject) }, true); } return; IL_01a3: obj3 = instance.airNodes; goto IL_01a9; IL_01a9: NodeGraph nodes = obj3; NodeGraph nodes2 = ((num2 != 0) ? instance.groundNodes : instance.airNodes); if (!TryFindNode(nodes, target, out blinkDestination) && !TryFindNode(nodes2, target, out blinkDestination)) { blinkDestination = ((EntityState)this).transform.position; } else { blinkDestination += ((EntityState)this).transform.position - ((EntityState)this).characterBody.footPosition; } goto IL_021e; } private bool TryFindNode(NodeGraph nodes, Vector3 target, out Vector3 position) { //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_0016: 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_0027: 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_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_003b: Unknown result type (might be due to invalid IL or missing references) position = Vector3.zero; if (!Object.op_Implicit((Object)(object)nodes)) { return false; } NodeIndex val = nodes.FindClosestNode(target, ((EntityState)this).characterBody.hullClassification, float.PositiveInfinity); if (val != NodeIndex.invalid) { return nodes.GetNodePosition(val, ref position); } return false; } private void SetPosition(Vector3 position) { //IL_0018: 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_004f: 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) if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor)) { ((BaseCharacterController)((EntityState)this).characterMotor).Motor.SetPositionAndRotation(position, ((Component)((EntityState)this).characterMotor).transform.rotation, true); return; } if (Object.op_Implicit((Object)(object)((EntityState)this).rigidbody)) { ((EntityState)this).rigidbody.interpolation = (RigidbodyInterpolation)0; } ((EntityState)this).transform.SetPositionAndRotation(position, ((EntityState)this).transform.rotation); } public override void FixedUpdate() { //IL_004d: 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_0065: 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_0046: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).FixedUpdate(); stopwatch += Time.fixedDeltaTime; if (((EntityState)this).isAuthority) { if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && Object.op_Implicit((Object)(object)((EntityState)this).characterDirection)) { ((EntityState)this).characterMotor.velocity = Vector3.zero; } SetPosition(Vector3.Lerp(blinkStart, blinkDestination, stopwatch / duration)); if (stopwatch >= duration) { ((EntityState)this).outer.SetNextStateToMain(); } } } public override void OnExit() { //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) Util.PlaySound(LoomingPresence.endSoundString, ((EntityState)this).gameObject); if (Object.op_Implicit((Object)(object)((EntityState)this).characterDirection) && Object.op_Implicit((Object)(object)((EntityState)this).inputBank)) { CharacterDirection characterDirection = ((EntityState)this).characterDirection; Ray aimRay = ((BaseState)this).GetAimRay(); characterDirection.forward = ((Ray)(ref aimRay)).direction; } if (Object.op_Implicit((Object)(object)modelTransform) && Object.op_Implicit((Object)(object)LoomingPresence.destealthMaterial)) { TemporaryOverlayInstance val = TemporaryOverlayManager.AddOverlay(((Component)modelTransform).gameObject); val.duration = LoomingPresence.destealthDuration; val.destroyComponentOnEnd = true; val.originalMaterial = LoomingPresence.destealthMaterial; val.inspectorCharacterModel = characterModel; val.alphaCurve = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f); val.animateShaderAlpha = true; if (Object.op_Implicit((Object)(object)characterModel)) { val.AddToCharacterModel(characterModel); } } if (Object.op_Implicit((Object)(object)characterModel)) { CharacterModel obj = characterModel; int invisibilityCount = obj.invisibilityCount; obj.invisibilityCount = invisibilityCount - 1; } if (Object.op_Implicit((Object)(object)hurtboxGroup)) { HurtBoxGroup obj2 = hurtboxGroup; int invisibilityCount = obj2.hurtBoxesDeactivatorCounter; obj2.hurtBoxesDeactivatorCounter = invisibilityCount - 1; } if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor)) { ((Behaviour)((EntityState)this).characterMotor).enabled = true; } ((EntityState)this).OnExit(); } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)2; } } } namespace LostInTransitLegacy { internal static class LITAssets { public const string BundleName = "lostintransitlegacyassets"; public const string SoundBankName = "LostInTransitLegacy.bnk"; private static readonly Dictionary<string, string> stubbedShaders = new Dictionary<string, string> { { "StubbedShader/deferred/hgstandard", RoR2_Base_Shaders.HGStandard_shader }, { "StubbedShader/fx/hgcloudremap", RoR2_Base_Shaders.HGCloudRemap_shader }, { "StubbedShader/fx/hgintersectioncloudremap", RoR2_Base_Shaders.HGIntersectionCloudRemap_shader } }; private static readonly Dictionary<string, string> materialShaders = new Dictionary<string, string> { { "matAffixFrenzied", "StubbedShader/deferred/hgstandard" }, { "matAffixLeeching", "StubbedShader/deferred/hgstandard" }, { "matAffixVolatile", "StubbedShader/deferred/hgstandard" }, { "matBeckoningCat", "StubbedShader/deferred/hgstandard" }, { "matTelescopicSight", "StubbedShader/deferred/hgstandard" }, { "matVolatileWick", "StubbedShader/deferred/hgstandard" }, { "matFrenzyingElectric", "StubbedShader/fx/hgcloudremap" }, { "matTracerLeeching", "StubbedShader/fx/hgcloudremap" }, { "matVolatileExplosion", "StubbedShader/fx/hgcloudremap" }, { "matOverlayLeeching", "StubbedShader/fx/hgintersectioncloudremap" } }; private static readonly Dictionary<string, Shader> loadedShaders = new Dictionary<string, Shader>(); private static readonly HashSet<Material> swappedMaterials = new HashSet<Material>(); public static AssetBundle Bundle { get; private set; } private static string AssetPath(string name) { return Path.Combine(Path.GetDirectoryName(((BaseUnityPlugin)Main.Instance).Info.Location), name); } public static void Init() { string text = AssetPath("lostintransitlegacyassets"); if (File.Exists(text)) { Bundle = AssetBundle.LoadFromFile(text); } if (!Object.op_Implicit((Object)(object)Bundle)) { Log.Error("Could not load the asset bundle at " + text + ", content will be missing its models and icons", "D:\\Games\\LostItems\\2021LiT\\LiT2021RevivalSource\\LostInTransitLegacy\\LITAssets.cs", "Init", 58); } string text2 = AssetPath("LostInTransitLegacy.bnk"); if (File.Exists(text2)) { SoundBanks.Add(text2); } else { Log.Warning("Missing soundbank " + text2 + ", Beckoning Cat, Telescopic Sight, Frenzying and Leeching will be silent (see docs/SOUNDBANK.md)", "D:\\Games\\LostItems\\2021LiT\\LiT2021RevivalSource\\LostInTransitLegacy\\LITAssets.cs", "Init", 68); } } public static T Load<T>(string name) where T : Object { if (!Object.op_Implicit((Object)(object)Bundle)) { return default(T); } T val = Bundle.LoadAsset<T>(name); if (!Object.op_Implicit((Object)(object)val)) { Log.Warning("Asset " + name + " (" + typeof(T).Name + ") is missing from the bundle", "D:\\Games\\LostItems\\2021LiT\\LiT2021RevivalSource\\LostInTransitLegacy\\LITAssets.cs", "Load", 81); return default(T); } object obj = val; GameObject val2 = (GameObject)((obj is GameObject) ? obj : null); if (val2 != null) { SwapShaders(val2); } return val; } public static Sprite LoadSprite(string name) { return LITAssets.Load<Sprite>(name); } public static GameObject LoadPrefab(string name) { return LITAssets.Load<GameObject>(name); } public static GameObject LoadEffect(string name) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) GameObject val = LoadPrefab(name); if (Object.op_Implicit((Object)(object)val)) { if (!Object.op_Implicit((Object)(object)val.GetComponent<VFXAttributes>())) { VFXAttributes obj = val.AddComponent<VFXAttributes>(); obj.vfxPriority = (VFXPriority)2; obj.DoNotPool = true; } ContentAddition.AddEffect(val); } return val; } public static NetworkSoundEventDef CreateNetworkSound(string eventName) { NetworkSoundEventDef obj = ScriptableObject.CreateInstance<NetworkSoundEventDef>(); ((Object)obj).name = "nseLostInTransitLegacy" + eventName; obj.eventName = eventName; ContentAddition.AddNetworkSoundEventDef(obj); return obj; } private static void SwapShaders(GameObject prefab) { Renderer[] componentsInChildren = prefab.GetComponentsInChildren<Renderer>(true); foreach (Renderer val in componentsInChildren) { Material[] sharedMaterials = val.sharedMaterials; for (int j = 0; j < sharedMaterials.Length; j++) { SwapShader(sharedMaterials[j]); } ParticleSystemRenderer val2 = (ParticleSystemRenderer)(object)((val is ParticleSystemRenderer) ? val : null); if (val2 != null) { SwapShader(val2.trailMaterial); } } } private static void SwapShader(Material material) { //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)material) || swappedMaterials.Contains(material)) { return; } swappedMaterials.Add(material); string value = (Object.op_Implicit((Object)(object)material.shader) ? ((Object)material.shader).name : null); if ((value != null && stubbedShaders.ContainsKey(value)) || materialShaders.TryGetValue(((Object)material).name, out value)) { if (!loadedShaders.TryGetValue(value, out var value2)) { value2 = Addressables.LoadAssetAsync<Shader>((object)stubbedShaders[value]).WaitForCompletion(); loadedShaders[value] = value2; } if (Object.op_Implicit((Object)(object)value2)) { material.shader = value2; return; } Log.Warning("Could not load the replacement for " + value + ", " + ((Object)material).name + " will render incorrectly", "D:\\Games\\LostItems\\2021LiT\\LiT2021RevivalSource\\LostInTransitLegacy\\LITAssets.cs", "SwapShader", 167); } } } internal static class Log { internal static ManualLogSource _logSource; internal static void Init(ManualLogSource logSource) { _logSource = logSource; } private static string getLogPrefix(string callerPath, string callerMemberName, int callerLineNumber) { int num = callerPath.LastIndexOf("LostInTransitLegacy"); if (num >= 0) { callerPath = callerPath.Substring(num + "LostInTransitLegacy".Length + 1); } return $"{callerPath}:{callerLineNumber} ({callerMemberName}) "; } internal static void Error(object data, [CallerFilePath] string callerPath = "", [CallerMemberName] string callerMemberName = "", [CallerLineNumber] int callerLineNumber = -1) { _logSource.LogError((object)(getLogPrefix(callerPath, callerMemberName, callerLineNumber) + data)); } internal static void Error_NoCallerPrefix(object data) { _logSource.LogError(data); } internal static void Fatal(object data, [CallerFilePath] string callerPath = "", [CallerMemberName] string callerMemberName = "", [CallerLineNumber] int callerLineNumber = -1) { _logSource.LogFatal((object)(getLogPrefix(callerPath, callerMemberName, callerLineNumber) + data)); } internal static void Fatal_NoCallerPrefix(object data) { _logSource.LogFatal(data); } internal static void Info(object data, [CallerFilePath] string callerPath = "", [CallerMemberName] string callerMemberName = "", [CallerLineNumber] int callerLineNumber = -1) { _logSource.LogInfo((object)(getLogPrefix(callerPath, callerMemberName, callerLineNumber) + data)); } internal static void Info_NoCallerPrefix(object data) { _logSource.LogInfo(data); } internal static void Message(object data, [CallerFilePath] string callerPath = "", [CallerMemberName] string callerMemberName = "", [CallerLineNumber] int callerLineNumber = -1) { _logSource.LogMessage((object)(getLogPrefix(callerPath, callerMemberName, callerLineNumber) + data)); } internal static void Message_NoCallerPrefix(object data) { _logSource.LogMessage(data); } internal static void Warning(object data, [CallerFilePath] string callerPath = "", [CallerMemberName] string callerMemberName = "", [CallerLineNumber] int callerLineNumber = -1) { _logSource.LogWarning((object)(getLogPrefix(callerPath, callerMemberName, callerLineNumber) + data)); } internal static void Warning_NoCallerPrefix(object data) { _logSource.LogWarning(data); } } [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.*/)] [BepInPlugin("Phreelosu.LostInTransitLegacy", "LostInTransitLegacy", "1.0.0")] public class Main : BaseUnityPlugin { public const string PluginGUID = "Phreelosu.LostInTransitLegacy"; public const string PluginAuthor = "Phreelosu"; public const string PluginName = "LostInTransitLegacy"; public const string PluginVersion = "1.0.0"; internal static readonly List<ContentBase> EnabledContent = new List<ContentBase>(); internal static Main Instance { get; private set; } public void Awake() { Instance = this; Log.Init(((BaseUnityPlugin)this).Logger); LITAssets.Init(); ContentBase[] array = new ContentBase[5] { new BeckoningCat(), new TelescopicSight(), new Frenzying(), new Leeching(), new Volatile() }; foreach (ContentBase contentBase in array) { if (!((BaseUnityPlugin)this).Config.Bind<bool>(contentBase.ConfigSection, "Enabled", contentBase.EnabledByDefault, "Should " + contentBase.Name + " be loaded? Disabled content is never registered with the game.").Value) { Log.Info(contentBase.Name + " is disabled in the config, skipping it", "D:\\Games\\LostItems\\2021LiT\\LiT2021RevivalSource\\LostInTransitLegacy\\Main.cs", "Awake", 54); continue; } contentBase.Init(); EnabledContent.Add(contentBase); Log.Info(contentBase.Name + " loaded", "D:\\Games\\LostItems\\2021LiT\\LiT2021RevivalSource\\LostInTransitLegacy\\Main.cs", "Awake", 59); } EliteDisplays.Init(); } } } namespace LostInTransitLegacy.Items { public class BeckoningCat : ItemBase { private float baseChance; private float stackChance; private float capChance; private float greenChance; private float greenStack; private float redChance; private float redStack; private bool usesLuck; private NetworkSoundEventDef procSound; public override string Name => "Beckoning Cat"; public override string Token => "BECKONINGCAT"; public override bool EnabledByDefault => false; public override ItemTier Tier => (ItemTier)1; public override ItemTag[] Tags { get { ItemTag[] array = new ItemTag[3]; RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); return (ItemTag[])(object)array; } } public override GameObject PickupModel => LITAssets.LoadPrefab("PickupBeckoningCat"); public override Sprite Icon => LITAssets.LoadSprite("texIconPickupBeckoningCat"); public override string PickupText => "Elite monsters have a chance to drop items."; public override string DescriptionText => $"Elite monsters have a <style=cIsUtility>{baseChance}%</style> <style=cStack>(+{stackChance}% per stack)</style> chance to drop items on death. " + $"Dropped items have a <style=cIsUtility>{greenChance}%</style> <style=cStack>(+{greenStack}% per stack)</style> chance to be <color=#81d047>Uncommon</color>, " + $"and a <style=cIsUtility>{redChance}%</style> <style=cStack>(+{redStack}% per stack)</style> chance to be <color=#f26060>Rare</color>."; public override string LoreText => "Light rain drops fall around an old-timey restaurant. The noise dull, but slowly raising in volume. Their good luck charm sitting there as its paw dip, dip, dipped. \"Hey, Gramps. Don't you think it's about time to close up? No one is going to be visiting like this.\"\n\nThe elderly man simply sits behind the counter, sipping something warm, and musing himself by watching their old plastic cat. Dip, dip, dip. \"No, my boy. It's for this exact reason we should stay open. Someone is on their way.\"\n\nThe young man rolls his eyes and closes the door, as it was now getting too loud to hear. The distant roar of thunder making the old structure creak, the charm rattling on the table. Dip, dip, dip. \"I'm sure they're on their way home at least. Well, we can still tidy up a bit while we wait for this to pass.\"\n\nThe door swings open as an imposing woman strides in, dressed as though she's some commander or government official. As she brushes water off her coat, she scans the menu on the counter with the charm. Dip, dip dip. \"See, my boy? There's always someone who could use a bit of help. And who are we to turn them away? When it rains, it pours after all.\"\n\nThe woman quickly leaves into the storm, and all is quiet, save for the light staccato of raindrops. Soon however, the woman returns, followed by a small platoon of soldiers. Apparently, a night-long celebration for victory at the only half decent store still open. The woman nods to the elderly man as she places her card next to the charm, and its paw dip, dip, dipped."; public override void Init() { baseChance = Bind("Base Drop Chance", 4.5f, "Base chance for Elites to drop an item."); stackChance = Bind("Stacking Drop Chance", 1.5f, "Added chance for Elites to drop an item per stack."); capChance = Bind("Maximum Drop Chance", 100f, "Maximum chance for Elites to drop an item, regardless of stacks."); greenChance = Bind("Uncommon Item Chance", 6f, "Chance for a dropped item to be Uncommon (Green)."); greenStack = Bind("Uncommon Item Stacking Chance", 1f, "Extra chance for a dropped item to be Uncommon (Green) per stack."); redChance = Bind("Rare Item Chance", 0.5f, "Chance for a dropped item to be Rare (Red)."); redStack = Bind("Rare Item Stacking Chance", 0.25f, "Extra chance for a dropped item to be Rare (Red) per stack."); usesLuck = Bind("Use Luck", defaultValue: true, "Whether Luck affects the Uncommon and Rare rolls."); CreateItem(); procSound = LITAssets.CreateNetworkSound("CatProc"); GlobalEventManager.onDeathProcServer += OnCharacterDeath; } private void OnCharacterDeath(DamageReport report) { //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_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_0176: 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_0192: 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_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_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_01c1: 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_01d3: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: 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_01ec: Unknown result type (might be due to invalid IL or missing references) CharacterBody attackerBody = report.attackerBody; CharacterBody victimBody = report.victimBody; if (!Object.op_Implicit((Object)(object)attackerBody) || !Object.op_Implicit((Object)(object)victimBody) || !victimBody.isElite || !Object.op_Implicit((Object)(object)Run.instance)) { return; } int count = GetCount(attackerBody); if (count <= 0) { return; } float num = ((usesLuck && Object.op_Implicit((Object)(object)attackerBody.master)) ? attackerBody.master.luck : 0f); float num2 = Mathf.Min(baseChance + stackChance * (float)(count - 1), capChance); int num3 = 0; BuffIndex[] eliteBuffIndices = BuffCatalog.eliteBuffIndices; foreach (BuffIndex val in eliteBuffIndices) { if (victimBody.HasBuff(val)) { num3++; } } for (int j = 0; j < Mathf.Max(num3, 1); j++) { if (Util.CheckRoll(num2, 0f, (CharacterMaster)null)) { List<PickupIndex> list = (Util.CheckRoll(redChance + redStack * (float)(count - 1), num, (CharacterMaster)null) ? Run.instance.availableTier3DropList : ((!Util.CheckRoll(greenChance + greenStack * (float)(count - 1), num, (CharacterMaster)null)) ? Run.instance.availableTier1DropList : Run.instance.availableTier2DropList)); if (list.Count != 0) { PickupIndex pickupIndex = list[Run.instance.treasureRng.RangeInt(0, list.Count)]; float num4 = MathF.PI * 2f / (float)Mathf.Max(Run.instance.participatingPlayerCount, 1); Vector3 val2 = Vector3.up * 20f + 5f * Mathf.Cos(num4) * Vector3.right + 5f * Mathf.Sin(num4) * Vector3.forward; PickupDropletController.CreatePickupDroplet(new UniquePickup { pickupIndex = pickupIndex }, victimBody.corePosition, val2, false); EffectManager.SimpleSoundEffect(procSound.index, attackerBody.corePosition, true); } break; } } } } public class TelescopicSight : ItemBase { private float baseChance; private float stackChance; private float cooldown; private float cooldownStack; private float minimumCooldown; private float exceptionHealthPercentage; private bool instakillElites; private bool instakillBosses; private BuffDef cooldownBuff; private NetworkSoundEventDef procSound; public override string Name => "Telescopic Sight"; public override string Token => "TELESCOPICSIGHT"; public override ItemTier Tier => (ItemTier)2; public override ItemTag[] Tags => (ItemTag[])(object)new ItemTag[1] { (ItemTag)1 }; public override GameObject PickupModel => LITAssets.LoadPrefab("PickupTelescopicSight"); public override Sprite Icon => LITAssets.LoadSprite("texIconPickupTelescopicSight"); public override string PickupText => "Chance to instantly kill enemies."; public override string DescriptionText => $"<style=cIsDamage>{baseChance}%</style> <style=cStack>(+{stackChance}% per stack)</style> chance to <style=cIsDamage>instakill monsters</style>. " + $"{ExceptionText} instead take <style=cIsDamage>{exceptionHealthPercentage}% of their maximum health</style> in damage. " + $"Recharges every <style=cIsUtility>{cooldown}</style> <style=cStack>(-{cooldownStack} per stack)</style> seconds."; private string ExceptionText { get { if (instakillBosses || instakillElites) { if (instakillBosses) { return "Elite monsters"; } return "Boss monsters"; } return "Boss and elite monsters"; } } public override string LoreText => "\"The sight comes with infrared, night vision, onboard wind assesment, built in scope adjustments between five and twenty five times magnification, and adaptive smart fire technology to ensure the perfect shot. Bought it out of military surplus, but I've got no idea how it ended up there.\"\n\n\"You make it sound like the gun itself is an attachment for the scope.\"\n\n\"Ha! Well it is extra. But I'll give it to you at a discount! Friends and family.\"\n\n\"Just one last question.\"\n\n\"Shoot.\"\n\n\"Do you have two more?\""; public override void Init() { //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_016c: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Expected O, but got Unknown baseChance = Bind("Base Proc Chance", 1f, "Base proc chance for Telescopic Sight, in percent."); stackChance = Bind("Proc Chance per Stack", 0.5f, "Extra proc chance per stack, in percent."); cooldown = Bind("Cooldown", 20f, "Seconds between Telescopic Sight activations."); cooldownStack = Bind("Cooldown Reduction per Stack", 2f, "Seconds removed from the cooldown per extra stack."); minimumCooldown = Bind("Minimum Cooldown", 10f, "The cooldown never goes below this, however many stacks you have."); exceptionHealthPercentage = Bind("Health Percentage Dealt to Exceptions", 20f, "Percentage of max health dealt to enemies that can't be instakilled."); instakillElites = Bind("Instakill Elites", defaultValue: false, "Whether Telescopic Sight should instakill elites."); instakillBosses = Bind("Instakill Bosses", defaultValue: false, "Whether Telescopic Sight should instakill boss monsters."); CreateItem(); cooldownBuff = ScriptableObject.CreateInstance<BuffDef>(); ((Object)cooldownBuff).name = "bdLITLegacyTeleSightCooldown"; cooldownBuff.iconSprite = LITAssets.LoadSprite("texIconTeleSightCD"); cooldownBuff.buffColor = new Color(0.651f, 0.427f, 0.427f); cooldownBuff.canStack = true; cooldownBuff.isCooldown = true; cooldownBuff.isDebuff = false; ContentAddition.AddBuffDef(cooldownBuff); procSound = LITAssets.CreateNetworkSound("TeleSightProc"); HealthComponent.TakeDamageProcess += new hook_TakeDamageProcess(HealthComponent_TakeDamageProcess); } private void HealthComponent_TakeDamageProcess(orig_TakeDamageProcess orig, HealthComponent self, DamageInfo damageInfo) { TryProc(self, damageInfo); orig.Invoke(self, damageInfo); } private void TryProc(HealthComponent victim, DamageInfo damageInfo) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Invalid comparison between Unknown and I4 //IL_013a: 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) if (damageInfo.rejected || damageInfo.procCoefficient <= 0f || (int)damageInfo.dotIndex != -1 || !Object.op_Implicit((Object)(object)damageInfo.attacker) || !Object.op_Implicit((Object)(object)victim.body)) { return; } CharacterBody component = damageInfo.attacker.GetComponent<CharacterBody>(); if (!Object.op_Implicit((Object)(object)component) || (Object)(object)component == (Object)(object)victim.body || component.HasBuff(cooldownBuff)) { return; } int count = GetCount(component); if (count > 0 && Util.CheckRoll((baseChance + stackChance * (float)(count - 1)) * damageInfo.procCoefficient, component.master)) { int num = Mathf.CeilToInt(Mathf.Max(minimumCooldown, cooldown - cooldownStack * (float)(count - 1))); for (int i = 1; i <= num; i++) { component.AddTimedBuff(cooldownBuff, (float)i); } CharacterBody body = victim.body; bool flag = (body.isChampion ? instakillBosses : (!body.isElite || instakillElites)); damageInfo.damage = (flag ? (victim.fullCombinedHealth * 4f) : (body.maxHealth * (exceptionHealthPercentage / 100f))); EffectManager.SimpleSoundEffect(procSound.index, component.corePosition, true); } } } } namespace LostInTransitLegacy.Elites { internal static class EliteDisplays { internal readonly struct Rule { public readonly string idrs; public readonly string childName; public readonly Vector3 localPos; public readonly Vector3 localAngles; public readonly Vector3 localScale; public Rule(string idrs, string childName, Vector3 localPos, Vector3 localAngles, Vector3 localScale) { //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_0016: 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_001e: 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) this.idrs = idrs; this.childName = childName; this.localPos = localPos; this.localAngles = localAngles; this.localScale = localScale; } } private struct Registration { public EquipmentDef equipmentDef; public GameObject displayPrefab; public Rule[] rules; } [CompilerGenerated] private static class <>O { public static hook_Init <0>__ItemDisplayRuleSet_Init; } private static readonly List<Registration> registrations = new List<Registration>(); private static readonly List<Action> beforeApply = new List<Action>(); private static readonly FieldInfo idrsInstancesField = typeof(ItemDisplayRuleSet).GetField("instancesList", BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic); private static readonly FieldInfo childLocatorPairsField = typeof(ChildLocator).GetField("transformPairs", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); internal static readonly Rule[] FrenziedRules = new Rule[50] { new Rule("idrsBandit2", "Hat", new Vector3(0.08974f, 0.10545f, 0.20664f), new Vector3(19.66007f, 103.8748f, 305.1916f), new Vector3(0.13329f, 0.13329f, 0.13329f)), new Rule("idrsCommando", "Head", new Vector3(-0.10882f, 0.28656f, -2E-05f), new Vector3(16.89391f, 26.6832f, 315.852f), new Vector3(0.18829f, 0.18829f, 0.18829f)), new Rule("idrsCaptain", "Head", new Vector3(-0.0971f, 0.23454f, 0.12376f), new Vector3(12.5164f, 23.53003f, 333.5402f), new Vector3(0.15938f, 0.15938f, 0.15938f)), new Rule("idrsCroco", "Head", new Vector3(1.43183f, 1.90979f, 1.60243f), new Vector3(0f, 131.7732f, 343.9997f), new Vector3(1.15528f, 1.15528f, 1.15528f)), new Rule("idrsEngi", "HeadCenter", new Vector3(-0.1577f, 0.08624f, 0.17353f), new Vector3(23.0457f, 51.30429f, 342.5899f), new Vector3(0.19791f, 0.19791f, 0.19791f)), new Rule("idrsHuntress", "HeadCenter", new Vector3(-0.10123f, 0.08743f, 0.06946f), new Vector3(352.2075f, 40.43784f, 324.1241f), new Vector3(0.12099f, 0.12099f, 0.12099f)), new Rule("idrsLoader", "HeadCenter", new Vector3(-0.14988f, 0.07244f, 0.13101f), new Vector3(348.0771f, 44.41277f, 317.6945f), new Vector3(0.15598f, 0.15598f, 0.15598f)), new Rule("idrsMage", "HeadCenter", new Vector3(-0.06033f, 0.0453f, 0.0504f), new Vector3(0f, 62.92982f, 327.9778f), new Vector3(0.13293f, 0.13293f, 0.13293f)), new Rule("idrsMerc", "HeadCenter", new Vector3(-0.06012f, 0.04804f, 0.07298f), new Vector3(22.25735f, 30.90237f, 327.6738f), new Vector3(0.12764f, 0.12764f, 0.12764f)), new Rule("idrsToolbotBody", "HeadCenter", new Vector3(1.67402f, 1.91757f, 0.00017f), new Vector3(0f, 0f, 228.8764f), new Vector3(1.55257f, 1.55257f, 1.55257f)), new Rule("idrsTreebot", "Eye", new Vector3(-0.19391f, 0.81869f, -0.12099f), new Vector3(331.2386f, 321.5512f, 307.5296f), new Vector3(0.49692f, 0.49692f, 0.49692f)), new Rule("idrsBell", "BellEnd", new Vector3(0f, 4E-05f, -1.8462f), new Vector3(0f, 270f, 9.82952f), new Vector3(1f, 1f, 1f)), new Rule("idrsBeetle", "Head", new Vector3(0.45909f, 0.50325f, -0.23519f), new Vector3(0f, 207.126f, 315.7073f), new Vector3(0.49146f, 0.49146f, 0.49146f)), new Rule("idrsBeetleGuard", "Head", new Vector3(0.94592f, 0.81146f, 0.70831f), new Vector3(18.76561f, 336.6687f, 216.7174f), new Vector3(1.52671f, 1.52671f, 1.52671f)), new Rule("idrsBeetleQueen", "Head", new Vector3(2.27976f, 2.39876f, -0.79778f), new Vector3(0f, 199.2867f, 315.196f), new Vector3(2.57993f, 2.57993f, 2.57993f)), new Rule("idrsBison", "Head", new Vector3(0.37809f, 0.18691f, 0.50989f), new Vector3(10.98356f, 325.5843f, 205.4416f), new Vector3(0.48693f, 0.48693f, 0.48693f)), new Rule("idrsClayboss", "Center", new Vector3(-0.8494f, 1.24136f, 1.67323f), new Vector3(2.71684f, 31.685f, 328.3929f), new Vector3(0.75f, 0.75f, 0.75f)), new Rule("idrsClayBruiser", "Head", new Vector3(-0.3168f, 0.42085f, 0.2941f), new Vector3(0.17126f, 47.09046f, 324.5157f), new Vector3(0.33554f, 0.33554f, 0.33554f)), new Rule("idrsGolem", "Head", new Vector3(-0.60861f, 0.91172f, 0.23795f), new Vector3(3.09443f, 48.90314f, 330.0192f), new Vector3(0.68106f, 0.68106f, 0.68106f)), new Rule("idrsGrandparent", "Head", new Vector3(0f, 8.41629f, 0.4261f), new Vector3(0f, 90f, 0f), new Vector3(3f, 3f, 3f)), new Rule("idrsGravekeeperBody", "Mask", new Vector3(1.04885f, 0.33413f, 1.37011f), new Vector3(0f, 37.42749f, 270f), new Vector3(1f, 1f, 1f)), new Rule("idrsGreaterWisp", "MaskBase", new Vector3(-0.37336f, 0.67009f, 0.44159f), new Vector3(0f, 49.78561f, 336.6306f), new Vector3(0.80363f, 0.80363f, 0.80363f)), new Rule("idrsHermitCrab", "Muzzle", new Vector3(-0.20806f, -0.67986f, 0.23273f), new Vector3(0f, 48.20382f, 335.3376f), new Vector3(0.75f, 0.75f, 0.75f)), new Rule("idrsImp", "Neck", new Vector3(0.15653f, 0.05053f, -0.16651f), new Vector3(348.8095f, 229.2758f, 347.2959f), new Vector3(0.17206f, 0.17206f, 0.17206f)), new Rule("idrsImpBoss", "Neck", new Vector3(MathF.E * 45f / 164f, -0.51562f, -0.98497f), new Vector3(0f, 232.8652f, 335.1035f), new Vector3(0.68115f, 0.68115f, 0.68115f)), new Rule("idrsJellyfish", "Hull2", new Vector3(-0.34185f, 0.87674f, -0.03635f), new Vector3(0f, 0f, 301.5861f), new Vector3(0.75f, 0.75f, 0.75f)), new Rule("idrsLemurian", "Head", new Vector3(-0.89894f, 3.26086f, -0.71809f), new Vector3(346.4797f, 349.813f, 307.5465f), new Vector3(1.25f, 1.25f, 1.25f)), new Rule("idrsLemurianBruiser", "Head", new Vector3(1.2478f, 3.16592f, 0.35568f), new Vector3(14.97527f, 337.3306f, 218.4818f), new Vector3(1.59919f, 1.59919f, 1.59919f)), new Rule("idrsMiniMushroom", "Head", new Vector3(-0.01874f, -0.99547f, -0.76526f), new Vector3(24.39329f, 342.541f, 59.25598f), new Vector3(0.5f, 0.5f, 0.5f)), new Rule("idrsNullifier", "Muzzle", new Vector3(-1.03905f, 0.0003f, 2.11674f), new Vector3(0f, 52.84411f, 0f), new Vector3(1f, 1f, 1f)), new Rule("idrsParent", "Head", new Vector3(-25.9652f, 136.8653f, 21.81479f), new Vector3(326.2988f, 231.967f, 255.1075f), new Vector3(47.48817f, 47.48817f, 47.48817f)), new Rule("idrsRoboballBoss", "MainEyeMuzzle", new Vector3(0f, 0f, -0.18278f), new Vector3(13.80187f, 90f, 0f), new Vector3(0.58022f, 0.58022f, 0.58022f)), new Rule("idrsRoboballMini", "ROOT", new Vector3(-0.50079f, 0.45401f, 0.58105f), new Vector3(0f, 49.24311f, 353.8405f), new Vector3(0.76359f, 0.76359f, 0.76359f)), new Rule("idrsTitan", "Head", new Vector3(-1.35232f, 4.64578f, 1.81258f), new Vector3(3.02f, 46.32784f, 345.8343f), new Vector3(1.75183f, 1.75183f, 1.75183f)), new Rule("idrsVagrant", "HullCenter", new Vector3(-0.54434f, 0.13842f, 1.04761f), new Vector3(359.3163f, 61.89576f, 332.2689f), new Vector3(0.75f, 0.75f, 0.75f)), new Rule("idrsVulture", "Head", new Vector3(0.30848f, 2.93338f, -0.95916f), new Vector3(326.4444f, 24.23308f, 231.2234f), new Vector3(1f, 1f, 1f)), new Rule("idrsWisp", "Head", new Vector3(0.31525f, 0.30564f, 0.39702f), new Vector3(10.3731f, 350.8943f, 239.4679f), new Vector3(0.5f, 0.5f, 0.5f)), new Rule("idrsScav", "Chest", new Vector3(3.38131f, 5.72098f, -6.27938f), new Vector3(323.0511f, 335.4919f, 259.8373f), new Vector3(3f, 3f, 3f)), new Rule("idrsMoffeinAncientWisp", "Head", new Vector3(-0.33169f, 0.27867f, 0.38885f), new Vector3(8.12595f, 55.16859f, 332.1334f), new Vector3(0.31715f, 0.31715f, 0.31715f)), new Rule("idrsMoffeinClayMan", "Head", new Vector3(-0.10958f, 0.29057f, 0.08991f), new Vector3(9.61765f, 56.03909f, 330.8455f), new Vector3(0.31885f, 0.31885f, 0.31885f)), new Rule("idrsNebbyArchWisp", "DisplayMask", new Vector3(-0.61772f, 1.73818f, 1.00651f), new Vector3(6.52602f, 68.88582f, 332.3875f), new Vector3(1f, 1f, 1f)), new Rule("idrsChef", "Head", new Vector3(-0.00473f, 0.01034f, 0.00571f), new Vector3(319.1285f, 74.11437f, 329.9974f), new Vector3(0.00575f, 0.00575f, 0.00575f)), new Rule("idrsHand", "Head", new Vector3(-1.64351f, 1.37415f, 1.88725f), new Vector3(0f, 48.94975f, 331.2297f), new Vector3(1.46635f, 1.46635f, 1.46635f)), new Rule("idrsMiner", "Head", new Vector3(0.00068f, 0.00218f, -0.00037f), new Vector3(0f, 213.5366f, 318.8299f), new Vector3(0.00248f, 0.00248f, 0.00248f)), new Rule("idrsNemesisEnforcer", "Head", new Vector3(-0.00232f, 0.00635f, -0.00202f), new Vector3(353.177f, 326.9874f, 328.6262f), new Vector3(0.0075f, 0.0075f, 0.0075f)), new Rule("idrsSniperClassic", "Head", new Vector3(-0.04223f, 0.2166f, -0.15216f), new Vector3(338.7646f, 340.8388f, 313.8116f), new Vector3(0.17031f, 0.17031f, 0.17031f)), new Rule("idrsExecutioner", "Head", new Vector3(-0.00069f, -0.0004f, 0.00099f), new Vector3(0f, 55.12426f, 322.411f), new Vector3(0.00151f, 0.00151f, 0.00151f)), new Rule("idrsNemmando", "HeadCenter", new Vector3(-0.00085f, 0.00297f, 0.00064f), new Vector3(1E-05f, 37.07076f, 323.0984f), new Vector3(0.00193f, 0.00193f, 0.00193f)), new Rule("idrsSecurityDrone", "EliteDisplay", new Vector3(-0.44765f, 0.44688f, -0.47721f), new Vector3(0f, 313.1695f, 325.6675f), new Vector3(0.75f, 0.75f, 0.75f)), new Rule("idrsPaladin", "Head", new Vector3(-0.07597f, 0.38895f, 0.10051f), new Vector3(17.05813f, 40.11826f, 340.8055f), new Vector3(0.25f, 0.25f, 0.25f)) }; internal static readonly Rule[] LeechingRules = new Rule[56] { new Rule("idrsBandit2", "Hat", new Vector3(-0.00296f, 0.07684f, 0.25673f), new Vector3(286.5711f, 185.1139f, 352.8005f), new Vector3(0.02f, 0.02f, 0.02f)), new Rule("idrsCommando", "Head", new Vector3(-0.0001f, 0.34396f, 0.12604f), new Vector3(297.5942f, 179.6773f, 0.46493f), new Vector3(0.02f, 0.0162f, 0.03377f)), new Rule("idrsCaptain", "Head", new Vector3(0f, 0.15192f, 0.16848f), new Vector3(270.5661f, 249.5511f, 289.4948f), new Vector3(0.02f, 0.02f, 0.03307f)), new Rule("idrsCroco", "HeadCenter", new Vector3(1E-05f, 3.8569f, -0.06125f), new Vector3(0f, 0f, 0f), new Vector3(0.16085f, 0.16085f, 0.3f)), new Rule("idrsEngi", "HeadCenter", new Vector3(0f, 0.13422f, 0.11111f), new Vector3(292.4788f, 180f, 0f), new Vector3(0.02912f, 0.06183f, 0.04938f)), new Rule("idrsHuntress", "HeadCenter", new Vector3(0f, 0.11053f, -0.00827f), new Vector3(335.3411f, 180f, 0f), new Vector3(0.01922f, 0.03294f, 0.05f)), new Rule("idrsLoader", "HeadCenter", new Vector3(0f, 0.11061f, 0.09488f), new Vector3(300.284f, 180f, 0f), new Vector3(0.02236f, 0.04092f, 0.0471f)), new Rule("idrsMage", "Head", new Vector3(0f, 0.12845f, 0.096f), new Vector3(291.4278f, 180f, 0f), new Vector3(0.0126f, 0.01602f, 0.025f)), new Rule("idrsMerc", "HeadCenter", new Vector3(-0.00101f, 0.11018f, 0.08674f), new Vector3(306.3394f, 180.2737f, 0f), new Vector3(0.01681f, 0.01623f, 0.03371f)), new Rule("idrsToolbotBody", "HeadCenter", new Vector3(0.16261f, 1.998f, 0.00023f), new Vector3(0f, 0f, 0f), new Vector3(0.29558f, 0.21625f, 0.4f)), new Rule("idrsTreebot", "PlatformBase", new Vector3(0f, 0.16132f, 0.60128f), new Vector3(270f, 180f, 0f), new Vector3(0.1f, 0.1f, 0.14974f)), new Rule("idrsBell", "ShieldR", new Vector3(-0.58548f, 2.76704f, 0f), new Vector3(90f, 270f, 0f), new Vector3(0.26704f, 0.22156f, 0.4f)), new Rule("idrsBell", "ShieldL", new Vector3(0.58548f, 2.76704f, 1E-05f), new Vector3(90f, 90f, 0f), new Vector3(0.26704f, 0.22156f, 0.4f)), new Rule("idrsBeetle", "Head", new Vector3(0f, 0.52498f, -0.2889f), new Vector3(290.7759f, 356.2821f, 4.96486f), new Vector3(0.1f, 0.1f, 0.1f)), new Rule("idrsBeetleGuard", "Head", new Vector3(0f, 0.57629f, 1.06993f), new Vector3(55.18219f, 3.1013f, 6.64726f), new Vector3(0.12708f, 0.1f, 0.4f)), new Rule("idrsBeetleQueen", "Head", new Vector3(0f, 2.75405f, -1.37888f), new Vector3(302.9106f, 1E-05f, -1E-05f), new Vector3(0.30098f, 0.27579f, 0.50319f)), new Rule("idrsBison", "Head", new Vector3(0f, 0.50329f, 0.43731f), new Vector3(37.51827f, 3.14302f, 1.31356f), new Vector3(0.07089f, 0.1f, 0.1f)), new Rule("idrsClayboss", "PotLidTop", new Vector3(0f, 0.34052f, 1.73708f), new Vector3(349.1262f, 180f, 0f), new Vector3(0.14984f, 0.1f, 0.41383f)), new Rule("idrsClayBruiser", "Head", new Vector3(-4E-05f, 0.48896f, 0.19644f), new Vector3(317.3055f, 180f, 0f), new Vector3(0.02366f, 0.06557f, 0.06513f)), new Rule("idrsGolem", "Head", new Vector3(0f, 1.0223f, 0.29887f), new Vector3(286.917f, 180f, 0f), new Vector3(0.13925f, 0.06581f, 0.14715f)), new Rule("idrsGrandparent", "RingTop", new Vector3(0f, 4.33875f, 1.70508f), new Vector3(321.1376f, 180f, 0f), new Vector3(0.5f, 0.5f, 0.5f)), new Rule("idrsGrandparent", "RingMiddle", new Vector3(-7.12676f, 2.23582f, 0.62922f), new Vector3(350.6506f, 216.278f, 273.7339f), new Vector3(0.58143f, 0.58143f, 0.58143f)), new Rule("idrsGrandparent", "RingMiddle", new Vector3(7.12676f, 2.23582f, 0.62922f), new Vector3(342.0572f, 151.3101f, 86.62997f), new Vector3(0.58143f, 0.58143f, 0.58143f)), new Rule("idrsGrandparent", "Head", new Vector3(0f, -2.03736f, -0.38876f), new Vector3(51.59029f, 178.9474f, 178.6941f), new Vector3(0.32876f, 0.5f, 0.78675f)), new Rule("idrsGravekeeperBody", "Mask", new Vector3(-1E-05f, 0.12769f, 1.05664f), new Vector3(12.51616f, 0f, 0f), new Vector3(0.25318f, 0.26736f, 0.47475f)), new Rule("idrsGreaterWisp", "MaskBase", new Vector3(0f, 1.04345f, 0.56038f), new Vector3(288.4669f, 180f, -2E-05f), new Vector3(0.09319f, 0.13827f, 0.22663f)), new Rule("idrsHermitCrab", "Muzzle", new Vector3(0.02866f, 0.02457f, 0.1311f), new Vector3(297.728f, 170.3057f, 20.98157f), new Vector3(0.03582f, 0.09683f, 0.18024f)), new Rule("idrsImp", "Neck", new Vector3(0f, 0.04674f, -0.05131f), new Vector3(312.3057f, 0f, 0f), new Vector3(0.03656f, 0.05376f, 0.1f)), new Rule("idrsImpBoss", "Neck", new Vector3(0f, -0.70381f, -1.09149f), new Vector3(305.325f, 7E-05f, -7E-05f), new Vector3(0.15307f, 0.18328f, 0.31631f)), new Rule("idrsJellyfish", "Hull2", new Vector3(0f, 0.47539f, 0.67741f), new Vector3(54.82596f, 292.5841f, 294.5264f), new Vector3(0.15203f, 0.15203f, 0.23226f)), new Rule("idrsLemurian", "MuzzleMouth", new Vector3(-0.02518f, 0.97405f, -0.66589f), new Vector3(270f, 180f, 0f), new Vector3(0.15863f, 0.11661f, 0.33493f)), new Rule("idrsLemurianBruiser", "Head", new Vector3(0f, 4.16755f, -0.1643f), new Vector3(0f, 0f, 0f), new Vector3(0.28894f, 0.28894f, 0.5f)), new Rule("idrsMiniMushroom", "Head", new Vector3(0.16215f, -1.04916f, -0.07452f), new Vector3(359.4716f, 269.9815f, 175.9287f), new Vector3(0.18353f, 0.10233f, 0.17451f)), new Rule("idrsNullifier", "Muzzle", new Vector3(-0.00445f, 0.15476f, 1.96374f), new Vector3(304.5861f, 4.40385f, 173.1898f), new Vector3(0.23592f, 0.37911f, 0.37911f)), new Rule("idrsParent", "Head", new Vector3(32.67874f, 64.71168f, 42.56717f), new Vector3(45.72789f, 300.6242f, 291.309f), new Vector3(16f, 10f, 12f)), new Rule("idrsParent", "Head", new Vector3(32.67874f, 64.71168f, -42.56717f), new Vector3(51.04952f, 250.2276f, 72.38507f), new Vector3(16f, 10f, 12f)), new Rule("idrsRoboballBoss", "MainEyeMuzzle", new Vector3(-0.06385f, 0.62788f, -0.50236f), new Vector3(333.9702f, 182.7433f, 347.1753f), new Vector3(0.1f, 0.1f, 0.2f)), new Rule("idrsRoboballMini", "ROOT", new Vector3(-0.00286f, 0.46996f, 0.65937f), new Vector3(343.3967f, 180.0398f, 359.9442f), new Vector3(0.1f, 0.1f, 0.2f)), new Rule("idrsTitan", "Head", new Vector3(0f, 5.76489f, 1.40275f), new Vector3(284.5208f, 180f, 1E-05f), new Vector3(0.2427f, 0.36309f, 0.70228f)), new Rule("idrsVagrant", "Hull", new Vector3(0f, 0.33588f, 1.17454f), new Vector3(276.6792f, 359.5343f, 180.3693f), new Vector3(0.17102f, 0.22686f, 0.3f)), new Rule("idrsVulture", "MouthMuzzle", new Vector3(-0.00153f, 0.1911f, 2.50689f), new Vector3(275.782f, 358.0522f, 179.3977f), new Vector3(0.0853f, 0.12987f, 0.3652f)), new Rule("idrsWisp", "Muzzle", new Vector3(0.05368f, 0.14199f, -0.08813f), new Vector3(280.3765f, 359.8243f, 186.7697f), new Vector3(0.0441f, 0.08795f, 0.11981f)), new Rule("idrsScav", "Head", new Vector3(0.23907f, 1.212f, -6.87497f), new Vector3(37.30244f, 176.5596f, 354.3346f), new Vector3(1f, 1f, 1.27922f)), new Rule("idrsMoffeinAncientWisp", "Head", new Vector3(7E-05f, 0.3354f, 0.13612f), new Vector3(303.5266f, 180.0309f, 0f), new Vector3(0.05213f, 0.0602f, 0.1f)), new Rule("idrsMoffeinClayMan", "Head", new Vector3(-0.00331f, 0.31723f, 0.12242f), new Vector3(291.2462f, 178.4516f, 0f), new Vector3(0.02545f, 0.03547f, 0.04916f)), new Rule("idrsChef", "Chef", new Vector3(0f, -0.00555f, 0.03141f), new Vector3(355.4503f, 359.9826f, 180.2189f), new Vector3(0.0006f, 0.001f, 0.001f)), new Rule("idrsHand", "Head", new Vector3(0.00401f, 0.3288f, 2.27225f), new Vector3(282.1041f, 352.6601f, 185.3194f), new Vector3(0.30295f, 0.2007f, 0.27131f)), new Rule("idrsMiner", "Head", new Vector3(0f, 0.00236f, -0.00132f), new Vector3(298.6057f, 0f, 0f), new Vector3(0.00017f, 0.00017f, 0.00035f)), new Rule("idrsNemesisEnforcer", "Head", new Vector3(-0.00349f, 0.00729f, 0.00046f), new Vector3(286.3019f, 102.5859f, 356.669f), new Vector3(0.00058f, 0.001f, 0.00126f)), new Rule("idrsSniperClassic", "Head", new Vector3(0f, 0.17229f, -0.17609f), new Vector3(23.08068f, 180f, 0f), new Vector3(0.0164f, 0.01f, 0.024f)), new Rule("idrsExecutioner", "Head", new Vector3(-5E-05f, -0.00018f, 0.00156f), new Vector3(291.4471f, 179.9999f, 357.9479f), new Vector3(0.0001f, 0.00021f, 0.00032f)), new Rule("idrsNemmando", "Head", new Vector3(6E-05f, 0.00339f, 0.00114f), new Vector3(308.2152f, 182.8021f, 0f), new Vector3(0.00019f, 0.00019f, 0.00037f)), new Rule("idrsSecurityDrone", "EliteDisplay", new Vector3(-1.04976f, -0.12445f, -0.06037f), new Vector3(287.4604f, 266.7087f, 180f), new Vector3(0.10576f, 0.11797f, 0.17216f)), new Rule("idrsPaladin", "Head", new Vector3(0.00463f, 0.33857f, 0.19801f), new Vector3(287.9035f, 181.3404f, 0f), new Vector3(0.02013f, 0.06366f, 0.06366f)), new Rule("idrsNebbyArchwisp", "DisplayMask", new Vector3(0.29958f, -0.29178f, 0.53362f), new Vector3(0.17745f, 166.9659f, 92.6403f), new Vector3(0.12163f, 0.05686f, 0.15f)), new Rule("idrsNebbyArchwisp", "DisplayMask", new Vector3(-0.29958f, -0.29178f, 0.53362f), new Vector3(0f, 166.9659f, 270.5457f), new Vector3(0.12163f, 0.05686f, 0.15f)) }; internal static readonly Rule[] VolatileRules = new Rule[50] { new Rule("idrsBandit2", "Hat", new Vector3(0.01332f, 0.08063f, -0.05186f), new Vector3(327.2307f, 0f, 0f), new Vector3(0.0879f, 0.0879f, 0.0879f)), new Rule("idrsCommando", "Head", new Vector3(0f, 0.35121f, 0.0075f), new Vector3(0f, 0f, 0f), new Vector3(0.1f, 0.1f, 0.1f)), new Rule("idrsCaptain", "Head", new Vector3(0f, 0.23571f, -0.00827f), new Vector3(329.3352f, 0f, 0f), new Vector3(0.1f, 0.1f, 0.1f)), new Rule("idrsCroco", "HeadCenter", new Vector3(0.01844f, 0.13459f, 0.96418f), new Vector3(277.9591f, 177.6658f, 3.39686f), new Vector3(1f, 1f, 1f)), new Rule("idrsEngi", "HeadCenter", new Vector3(0f, 0.15667f, 1E-05f), new Vector3(0f, 0f, 0f), new Vector3(0.1f, 0.1f, 0.1f)), new Rule("idrsHuntress", "Head", new Vector3(0f, 0.28657f, -0.03808f), new Vector3(0f, 0f, 0f), new Vector3(0.1f, 0.1f, 0.1f)), new Rule("idrsLoader", "Head", new Vector3(0f, 0.22052f, 0.01997f), new Vector3(0f, 0f, 0f), new Vector3(0.125f, 0.125f, 0.125f)), new Rule("idrsMage", "HeadCenter", new Vector3(0f, 0.09544f, 1E-05f), new Vector3(21.34826f, 0f, 0f), new Vector3(0.09543f, 0.09543f, 0.09543f)), new Rule("idrsMerc", "HeadCenter", new Vector3(0f, 0.10847f, 0.00429f), new Vector3(0f, 0f, 0f), new Vector3(0.10085f, 0.10085f, 0.10085f)), new Rule("idrsToolbotBody", "HeadCenter", new Vector3(-1E-05f, 0.39777f, 0.51166f), new Vector3(307.9438f, 184.4826f, 356.4622f), new Vector3(1f, 1f, 1f)), new Rule("idrsTreebot", "HeadBase", new Vector3(0f, -0.97968f, 0f), new Vector3(-1E-05f, 180f, 180f), new Vector3(0.42316f, 0.42316f, 0.42316f)), new Rule("idrsBell", "BellEnd", new Vector3(0f, -1.03717f, 0f), new Vector3(0f, 180f, 180f), new Vector3(1f, 1f, 1f)), new Rule("idrsBeetle", "Head", new Vector3(0f, 0.39622f, 0.34231f), new Vector3(335.2211f, 180f, 0f), new Vector3(0.35f, 0.35f, 0.35f)), new Rule("idrsBeetleGuard", "Head", new Vector3(-0.00962f, 0.31786f, 1.12327f), new Vector3(310.6685f, 180.1122f, 359.3626f), new Vector3(0.57384f, 0.57384f, 0.57384f)), new Rule("idrsBeetleQueen", "Head", new Vector3(0f, 3.40601f, -9E-05f), new Vector3(12.12358f, 180f, 0f), new Vector3(1f, 1f, 1f)), new Rule("idrsBison", "Head", new Vector3(0f, 0.1267f, 0.51461f), new Vector3(270f, 180f, 0f), new Vector3(0.25f, 0.25f, 0.25f)), new Rule("idrsClayboss", "PotLidTop", new Vector3(0f, 0.31516f, 1.19245f), new Vector3(0f, 0f, 0f), new Vector3(0.53035f, 0.53035f, 0.53035f)), new Rule("idrsClayBruiser", "Head", new Vector3(0.00189f, 0.46475f, 0.08132f), new Vector3(0f, 0f, 0f), new Vector3(0.23479f, 0.23479f, 0.23479f)), new Rule("idrsGolem", "Head", new Vector3(0f, 0.98831f, 0.03556f), new Vector3(0f, 0f, 0f), new Vector3(0.37796f, 0.37796f, 0.37796f)), new Rule("idrsGrandparent", "Head", new Vector3(-0.00103f, -1.14961f, -0.81659f), new Vector3(35.39537f, 0.04486f, 359.9838f), new Vector3(2f, 2f, 2f)), new Rule("idrsGravekeeperBody", "Head", new Vector3(-1E-05f, 2.24414f, -0.60637f), new Vector3(341.7246f, 0f, 0f), new Vector3(1f, 1f, 1f)), new Rule("idrsGreaterWisp", "MaskBase", new Vector3(0f, 0.98213f, 0.52905f), new Vector3(48.6563f, 0f, 0f), new Vector3(0.37249f, 0.37249f, 0.37249f)), new Rule("idrsHermitCrab", "Muzzle", new Vector3(-0.02536f, 3E-05f, 0.01601f), new Vector3(0f, 0f, 0f), new Vector3(0.24756f, 0.24756f, 0.24756f)), new Rule("idrsImp", "Neck", new Vector3(0f, 0.04231f, 1E-05f), new Vector3(0f, 180f, 0f), new Vector3(0.15114f, 0.15114f, 0.15114f)), new Rule("idrsImpBoss", "Neck", new Vector3(0f, 0.09536f, 1E-05f), new Vector3(0f, 180f, 0f), new Vector3(0.72925f, 0.72925f, 0.72925f)), new Rule("idrsJellyfish", "Hull2", new Vector3(0.01367f, 0.45507f, -0.86919f), new Vector3(282.1551f, 0f, 0f), new Vector3(0.5f, 0.5f, 0.5f)), new Rule("idrsLemurian", "Head", new Vector3(0f, 1.67074f, -1.08618f), new Vector3(270.2315f, 0f, 0f), new Vector3(1f, 1f, 1f)), new Rule("idrsLemurianBruiser", "Head", new Vector3(0f, 1.96664f, 0.51707f), new Vector3(270f, 180f, 0f), new Vector3(1f, 1f, 1f)), new Rule("idrsMiniMushroom", "Head", new Vector3(-0.29765f, 0f, 0f), new Vector3(90f, 270f, 0f), new Vector3(0.54445f, 0.54445f, 0.54445f)), new Rule("idrsNullifier", "Muzzle", new Vector3(0f, 1.01155f, 0.07019f), new Vector3(14.84576f, 0f, 0f), new Vector3(0.75f, 0.75f, 0.75f)), new Rule("idrsParent", "Head", new Vector3(-83.0517f, 132.2572f, -0.00013f), new Vector3(309.9993f, 89.62286f, 0.2889f), new Vector3(36.1141f, 36.1141f, 36.1141f)), new Rule("idrsRoboballBoss", "MainEyeMuzzle", new Vector3(0f, 0.94633f, -1.01487f), new Vector3(0f, 0f, 0f), new Vector3(0.5f, 0.5f, 0.5f)), new Rule("idrsRoboballMini", "ROOT", new Vector3(0f, 0.94158f, 0f), new Vector3(0f, 0f, 0f), new Vector3(0.5f, 0.5f, 0.5f)), new Rule("idrsTitan", "Head", new Vector3(0f, 5.75371f, 0.28066f), new Vector3(0f, 0f, 0f), new Vector3(1.18087f, 1.18087f, 1.18087f)), new Rule("idrsVagrant", "HullCenter", new Vector3(0f, 0.7031f, 0f), new Vector3(0f, 0f, 0f), new Vector3(0.5f, 0.5f, 0.5f)), new Rule("idrsVulture", "Head", new Vector3(0.00012f, 1.1144f, -0.55067f), new Vector3(276.5814f, 180f, 180f), new Vector3(1f, 1f, 1f)), new Rule("idrsWisp", "Head", new Vector3(0f, 0.17274f, 0.52916f), new Vector3(320.2195f, 177.0836f, 1.86699f), new Vector3(0.40878f, 0.40878f, 0.40878f)), new Rule("idrsScav", "Chest", new Vector3(0.15733f, 4.92097f, 1.40138f), new Vector3(334.4718f, 185.7457f, 358.3457f), new Vector3(3f, 3f, 3f)), new Rule("idrsMoffeinAncientWisp", "Head", new Vector3(0f, 0.44231f, -0.00256f), new Vector3(17.05706f, 0f, 0f), new Vector3(0.17247f, 0.17247f, 0.17247f)), new Rule("idrsMoffeinClayMan", "Head", new Vector3(0f, 0.37574f, -0.01413f), new Vector3(0f, 0f, 0f), new Vector3(0.14255f, 0.14255f, 0.14255f)), new Rule("idrsNebbyArchWisp", "DisplayMask", new Vector3(0f, 2.24507f, 0.77472f), new Vector3(32.63882f, 0f, 0f), new Vector3(0.29575f, 0.29575f, 0.29575f)), new Rule("idrsChef", "Hat", new Vector3(0f, 0.00848f, 0f), new Vector3(0f, 0f, 0f), new Vector3(0.0075f, 0.0075f, 0.0075f)), new Rule("idrsHand", "Head", new Vector3(-0.63314f, 2.65928f, 0.58902f), new Vector3(0f, 0f, 0f), new Vector3(1f, 1f, 1f)), new Rule("idrsMiner", "HeadCenter", new Vector3(0f, 0.00281f, 0f), new Vector3(0f, 180f, 0f), new Vector3(0.00096f, 0.00096f, 0.00096f)), new Rule("idrsNemesisEnforcer", "Head", new Vector3(0.0009f, 0.00764f, 0.00037f), new Vector3(0f, 270f, 0f), new Vector3(0.00628f, 0.00628f, 0.00628f)), new Rule("idrsSniperClassic", "Head", new Vector3(1E-05f, 0.05008f, -0.21924f), new Vector3(270f, 0f, 0f), new Vector3(0.14916f, 0.14916f, 0.14916f)), new Rule("idrsExecutioner", "Head", new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new Vector3(0.00103f, 0.00103f, 0.00103f)), new Rule("idrsNemmando", "HeadCenter", new Vector3(0f, 0.00351f, 0f), new Vector3(0f, 0f, 0f), new Vector3(0.00158f, 0.00158f, 0.00158f)), new Rule("idrsSecurityDrone", "EliteDisplay", new Vector3(0.6191f, 0.76038f, 0f), new Vector3(0f, 270f, 0f), new Vector3(0.42585f, 0.42585f, 0.42585f)), new Rule("idrsPaladin", "Head", new Vector3(0.00459f, 0.36417f, 0.06903f), new Vector3(0f, 0f, 0f), new Vector3(0.14948f, 0.14948f, 0.14948f)) }; public static void Register(EquipmentDef equipmentDef, GameObject displayPrefab, Rule[] rules) { if (!Object.op_Implicit((Object)(object)displayPrefab)) { Log.Warning(((Object)equipmentDef).name + " has no display prefab, it won't show on characters", "D:\\Games\\LostItems\\2021LiT\\LiT2021RevivalSource\\LostInTransitLegacy\\Elites\\EliteDisplays.cs", "Register", 56); return; } registrations.Add(new Registration { equipmentDef = equipmentDef, displayPrefab = displayPrefab, rules = rules }); } public static void BeforeApply(Action action) { beforeApply.Add(action); } internal static void Init() { //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) //IL_0028: Expected O, but got Unknown if (registrations.Count > 0) { object obj = <>O.<0>__ItemDisplayRuleSet_Init; if (obj == null) { hook_Init val = ItemDisplayRuleSet_Init; <>O.<0>__ItemDisplayRuleSet_Init = val; obj = (object)val; } ItemDisplayRuleSet.Init += (hook_Init)obj; } } private static IEnumerator ItemDisplayRuleSet_Init(orig_Init orig) { foreach (Action item in beforeApply) { try { item(); } catch (Exception data) { Log.Error(data, "D:\\Games\\LostItems\\2021LiT\\LiT2021RevivalSource\\LostInTransitLegacy\\Elites\\EliteDisplays.cs", "ItemDisplayRuleSet_Init", 88); } } try { Apply(); } catch (Exception data2) { Log.Error(data2, "D:\\Games\\LostItems\\2021LiT\\LiT2021RevivalSource\\LostInTransitLegacy\\Elites\\EliteDisplays.cs", "ItemDisplayRuleSet_Init", 98); } return orig.Invoke(); } private static void Apply() { //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_0138: 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_0155: 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) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Expected O, but got Unknown //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_01a2: Unknown result type (might be due to invalid IL or missing references) //IL_01a7: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_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_01ec: Unknown result type (might be due to invalid IL or missing references) Dictionary<string, ItemDisplayRuleSet> dictionary = new Dictionary<string, ItemDisplayRuleSet>(StringComparer.OrdinalIgnoreCase); foreach (ItemDisplayRuleSet item in (List<ItemDisplayRuleSet>)idrsInstancesField.GetValue(null)) { if (Object.op_Implicit((Object)(object)item) && !dictionary.ContainsKey(((Object)item).name)) { dictionary.Add(((Object)item).name, item); } } Dictionary<string, string> dictionary2 = null; int num = 0; foreach (Registration registration in registrations) { foreach (IGrouping<string, Rule> item2 in registration.rules.GroupBy<Rule, string>((Rule rule) => rule.idrs, StringComparer.OrdinalIgnoreCase)) { if (!dictionary.TryGetValue(item2.Key, out var value)) { if (dictionary2 == null) { dictionary2 = FindVanillaIDRSAddresses(); } if (!dictionary2.TryGetValue(item2.Key, out var value2)) { continue; } value = Addressables.LoadAssetAsync<ItemDisplayRuleSet>((object)value2).WaitForCompletion(); if (!Object.op_Implicit((Object)(object)value)) { continue; } dictionary[item2.Key] = value; } DisplayRuleGroup val = value.FindDisplayRuleGroup((Object)(object)registration.equipmentDef); foreach (Rule item3 in item2) { ((DisplayRuleGroup)(ref val)).AddDisplayRule(new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefab = registration.displayPrefab, followerPrefabAddress = new AssetReferenceGameObject(string.Empty), childName = item3.childName, localPos = item3.localPos, localAngles = item3.localAngles, localScale = item3.localScale, limbMask = (LimbFlags)0 }); } value.SetDisplayRuleGroup((Object)(object)registration.equipmentDef, val); num++; } } Log.Info($"Added elite displays to {num} item display rule sets", "D:\\Games\\LostItems\\2021LiT\\LiT2021RevivalSource\\LostInTransitLegacy\\Elites\\EliteDisplays.cs", "Apply", 156); } private static Dictionary<string, string> FindVanillaIDRSAddresses() { Dictionary<string, string> dictionary = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase); Assembly assembly = typeof(RoR2_Base_Commando).Assembly; string ns = typeof(RoR2_Base_Commando).Namespace; foreach (Type item in from t in assembly.GetTypes() where t.Namespace == ns select t) { FieldInfo[] fields = item.GetFields(BindingFlags.Static | BindingFlags.Public); foreach (FieldInfo fieldInfo in fields) { if (fieldInfo.FieldType == typeof(string) && fieldInfo.Name.StartsWith("idrs") && fieldInfo.Name.EndsWith("_asset")) { string key = fieldInfo.Name.Substring(0, fieldInfo.Name.Length - "_asset".Length); if (!dictionary.ContainsKey(key)) { dictionary.Add(key, (string)fieldInfo.GetValue(null)); } } } } return dictionary; } public static void AddChild(string bodyAddress, string parentChild, string newChild, string path) { //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_00f2: Unknown result type (might be due to invalid IL or missing references) GameObject val = Addressables.LoadAssetAsync<GameObject>((object)bodyAddress).WaitForCompletion(); ModelLocator val2 = (Object.op_Implicit((Object)(object)val) ? val.GetComponent<ModelLocator>() : null); ChildLocator val3 = ((Object.op_Implicit((Object)(object)val2) && Object.op_Implicit((Object)(object)val2.modelTransform)) ? ((Component)val2.modelTransform).GetComponent<ChildLocator>() : null); if (Object.op_Implicit((Object)(object)val3) && val3.FindChildIndex(newChild) < 0) { Transform val4 = val3.FindChild(parentChild); Transform val5 = (Object.op_Implicit((Object)(object)val4) ? val4.Find(path) : null); if (!Object.op_Implicit((Object)(object)val5)) { Log.Warning("Could not find " + parentChild + "/" + path + " on " + ((Object)val).name + ", displays on " + newChild + " won't show", "D:\\Games\\LostItems\\2021LiT\\LiT2021RevivalSource\\LostInTransitLegacy\\Elites\\EliteDisplays.cs", "AddChild", 200); } else { NameTransformPair[] value = (NameTransformPair[])childLocatorPairsField.GetValue(val3); NameTransformPair val6 = new NameTransformPair { name = newChild, transform = val5 }; ArrayUtils.ArrayAppend<NameTransformPair>(ref value, ref val6); childLocatorPairsField.SetValue(val3, value); } } } } public class Frenzying : EliteBase { public static Frenzying instance; public float moveSpeedBonus; public float attackSpeedBonus; public float cooldownReduction; public float blinkCooldown; public float blinkDistance; public KeyCode blinkKey; public GameObject blinkReadyEffect; public override string Name => "Frenzying"; public override string Token => "FRENZIED"; public override Color32 EliteColor => new Color32((byte)199, (byte)199, (byte)28, byte.MaxValue); public override Color BuffColor => new Color(1f, 0.962f, 0f); public override string EquipmentName => "Primordial Rage"; public override string AspectWord => "seething"; public override float EquipmentCooldown => 25f; public override Sprite BuffIcon => LITAssets.LoadSprite("texIconBuffAffixFrenzied"); public override Sprite EquipmentIcon => LITAssets.LoadSprite("texIconPickupAffixFrenzied"); public override GameObject PickupModel => LITAssets.LoadPrefab("PickupAffixFrenzied"); public override Texture2D EliteRamp => LITAssets.Load<Texture2D>("texRampEliteFrenzied"); public override GameObject DisplayPrefab => LITAssets.LoadPrefab("DisplayFrenzied"); internal override EliteDisplays.Rule[] DisplayRules => EliteDisplays.FrenziedRules; public override void Init() { //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_00bd: 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_00df: Expected O, but got Unknown instance = this; moveSpeedBonus = Bind("Movement Speed Bonus", 1f, "Extra movement speed, 1 is +100%."); attackSpeedBonus = Bind("Attack Speed Bonus", 1f, "Extra attack speed, 1 is +100%."); cooldownReduction = Bind("Cooldown Reduction", 0.5f, "Skill cooldown reduction, 0.5 is -50%."); blinkCooldown = Bind("Blink Cooldown", 10f, "Seconds between blinks."); blinkDistance = Bind("Blink Distance", 25f, "How far a blink goes."); blinkKey = Bind<KeyCode>("Player Blink Key", (KeyCode)102, "The key a player holding the aspect presses to blink."); CreateElite(); blinkReadyEffect = LITAssets.LoadPrefab("EffectFrenziedTPReady"); bool flag = default(bool); ContentAddition.AddEntityState<FrenziedBlink>(ref flag); BuffBehaviours.Register<FrenzyingBehaviour>(base.AffixBuff); RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(GetStatCoefficients); } private void GetStatCoefficients(CharacterBody body, StatHookEventArgs args) { if (body.HasBuff(base.AffixBuff)) { args.moveSpeedMultAdd += moveSpeedBonus; args.attackSpeedMultAdd += attackSpeedBonus; args.allSkills.cooldownMultAdd -= cooldownReduction; } } } public class FrenzyingBehaviour : BuffBehaviour { private float stopwatch; private GameObject readyEffectInstance; private EntityStateMachine bodyMachine; private bool Ready => stopwatch >= Frenzying.instance.blinkCooldown; private void Start() { bodyMachine = EntityStateMachine.FindByCustomName(((Component)this).gameObject, "Body"); } private void FixedUpdate() { //IL_00b8: 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) if (!Object.op_Implicit((Object)(object)body) || !Object.op_Implicit((Object)(object)body.healthComponent) || !body.healthComponent.alive) { return; } stopwatch += Time.fixedDeltaTime; if (Ready) { if (!Object.op_Implicit((Object)(object)readyEffectInstance) && Object.op_Implicit((Object)(object)Frenzying.instance.blinkReadyEffect)) { Transform val = (Object.op_Implicit((Object)(object)body.aimOriginTransform) ? body.aimOriginTransform : body.transform); readyEffectInstance = Object.Instantiate<GameObject>(Frenzying.instance.blinkReadyEffect, val); Transform transform = readyEffectInstance.transform; transform.localScale *= body.radius; } if (!body.isPlayerControlled && body.hasEffectiveAuthority) { TryBlink(); } } } private void Update() { //IL_0034: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)body) && body.isPlayerControlled && body.hasEffectiveAuthority && Ready && Input.GetKeyDown(Frenzying.instance.blinkKey) && !IsUIFocused()) { TryBlink(); } } private bool IsUIFocused() { LocalUser val = ((Object.op_Implicit((Object)(object)body.master) && Object.op_Implicit((Object)(object)body.master.playerCharacterMasterController) && Object.op_Implicit((Object)(object)body.master.playerCharacterMasterController.networkUser)) ? body.master.playerCharacterMasterController.networkUser.localUser : null); if (val != null) { return val.isUIFocused; } return false; } private void TryBlink() { if (Object.op_Implicit((Object)(object)bodyMachine) && Object.op_Implicit((Object)(object)body.inputBank) && bodyMachine.IsInMainState()) { bodyMachine.SetNextState((EntityState)(object)new FrenziedBlink()); OnBlink(); } } public void OnBlink() { stopwatch = 0f; if (Object.op_Implicit((Object)(object)readyEffectInstance)) { Object.Destroy((Object)(object)readyEffectInstance); } } private void OnDestroy() { if (Object.op_Implicit((Object)(object)readyEffectInstance)) { Object.Destroy((Object)(object)readyEffectInstance); } } } public class Leeching : EliteBase { public static Leeching instance; public float lifestealFraction; public float playerLifestealFraction; public float timeBetweenBursts; public float chargingTime; public float burstRadius; public float burstHealPercentage; public float minimumBurstHealPercentage; public float burstReductionPerHit; public float regenDuration; public BuffDef regenBuff; public GameObject prepBurstEffect; public GameObject burstEffect; public GameObject regenEffect; public GameObject tracerEffect; public override string Name => "Leeching"; public override string Token => "LEECHING"; public override Color32 EliteColor => new Color32((byte)53, (byte)138, (byte)78, byte.MaxValue); public override Color BuffColor => new Color(0.4f, 0.694f, 0.38f); public override string EquipmentName => "Guttural Whimpers"; public override string AspectWord => "parasitism"; public override float EquipmentCooldown => 35f; public override Sprite BuffIcon => LITAssets.LoadSprite("texIconBuffAffixLeeching"); public override Sprite EquipmentIcon => LITAssets.LoadSprite("texIconPickupAffixLeeching"); public override GameObject PickupModel => LITAssets.LoadPrefab("PickupAffixLeeching"); public override Texture2D EliteRamp => LITAssets.Load<Texture2D>("texRampEliteLeeching"); public override GameObject DisplayPrefab => LITAssets.LoadPrefab("DisplayLeechingCrown"); internal override EliteDisplays.Rule[] DisplayRules => EliteDisplays.LeechingRules; public override void Init() { //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_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_0233: Unknown result type (might be due to invalid IL or missing references) //IL_023d: Expected O, but got Unknown instance = this; lifestealFraction = Bind("Lifesteal", 1f, "Fraction of damage dealt that Leeching monsters heal back, scaled by proc coefficient."); playerLifestealFraction = Bind("Player Lifesteal", 0.5f, "Fraction of damage dealt that players holding the aspect heal back, scaled by proc coefficient."); timeBetweenBursts = Bind("Time Between Bursts", 10f, "Seconds between healing bursts."); chargingTime = Bind("Burst Charge Time", 5f, "Seconds a healing burst charges for, during which damaging the elite weakens it."); burstRadius = Bind("Burst Radius", 25f, "Radius of the healing burst."); burstHealPercentage = Bind("Burst Heal Percentage", 10f, "Percentage of max health the burst regenerates on allies, over its duration."); minimumBurstHealPercentage = Bind("Minimum Burst Heal Percentage", 5f, "The burst heal can't be weakened below this percentage."); burstReductionPerHit = Bind("Burst Reduction per Hit", 0.5f, "Percentage points removed from the burst heal for every hit taken while it charges."); regenDuration = Bind("Regen Duration", 5f, "Seconds the burst's regeneration lasts."); CreateElite(); BuffDef val = Addressables.LoadAssetAsync<BuffDef>((object)RoR2_Base_Croco.bdCrocoRegen_asset).WaitForCompletion(); regenBuff = ScriptableObject.CreateInstance<BuffDef>(); ((Object)regenBuff).name = "bdLITLegacyLeechingRegen"; regenBuff.buffColor = new Color(0.208f, 0.541f, 0.306f); regenBuff.iconSprite = (Object.op_Implicit((Object)(object)val) ? val.iconSprite : null); regenBuff.startSfx = (Object.op_Implicit((Object)(object)val) ? val.startSfx : null); regenBuff.canStack = false; regenBuff.isDebuff = false; ContentAddition.AddBuffDef(regenBuff); prepBurstEffect = LITAssets.LoadEffect("EffectLeechingPrepBurst"); burstEffect = LITAssets.LoadEffect("EffectLeechingBurst"); regenEffect = LITAssets.LoadEffect("EffectLeechingRegen"); tracerEffect = LITAssets.LoadEffect("TracerLeeching"); DestroyOnTimer val2 = default(DestroyOnTimer); if (Object.op_Implicit((Object)(object)regenEffect) && regenEffect.TryGetComponent<DestroyOnTimer>(ref val2)) { val2.duration = regenDuration; } BuffBehaviours.Register<LeechingBehaviour>(base.AffixBuff); GlobalEventManager.onServerDamageDealt += OnServerDamageDealt; RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(GetStatCoefficients); EliteDisplays.BeforeApply(delegate { EliteDisplays.AddChild(RoR2_Base_Grandparent.GrandParentBody_prefab, "Head", "RingBottom", "head.2"); EliteDisplays.AddChild(RoR2_Base_Grandparent.GrandParentBody_prefab, "Head", "RingMiddle", "head.2/head.3"); EliteDisplays.AddChild(RoR2_Base_Grandparent.GrandParentBody_prefab, "Head", "RingTop", "head.2/head.3/head.4"); }); } private void OnServerDamageDealt(DamageReport report) { //IL_0065: 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) CharacterBody attackerBody = report.attackerBody; if (Object.op_Implicit((Object)(object)attackerBody) && attackerBody.HasBuff(base.AffixBuff) && Object.op_Implicit((Object)(object)attackerBody.healthComponent) && report.damageInfo != null) { float num = (attackerBody.isPlayerControlled ? playerLifestealFraction : lifestealFraction); attackerBody.healthComponent.Heal(report.damageDealt * report.damageInfo.procCoefficient * num, default(ProcChainMask), true); } LeechingBehaviour leechingBehaviour = default(LeechingBehaviour); if (Object.op_Implicit((Object)(object)report.victimBody) && ((Component)report.victimBody).TryGetComponent<LeechingBehaviour>(ref leechingBehaviour)) { leechingBehaviour.OnDamagedServer(); } } private void GetStatCoefficients(CharacterBody body, StatHookEventArgs args) { LeechingRegenStrength leechingRegenStrength = default(LeechingRegenStrength); if (body.HasBuff(regenBuff) && ((Component)body).TryGetComponent<LeechingRegenStrength>(ref leechingRegenStrength)) { args.baseRegenAdd += body.maxHealth * (leechingRegenStrength.percentage / 100f) / regenDuration; } } } public class LeechingRegenStrength : MonoBehaviour { public float percentage; } public class LeechingBehaviour : BuffBehaviour { private readonly SphereSearch search = new SphereSearch(); private readonly List<HurtBox> hurtBoxes = new List<HurtBox>(); private readonly List<HealthComponent> allies = new List<HealthComponent>(); private float burstStopwatch; private float chargeStopwatch; private bool charging; private float healPercentage; private static Leeching Elite => Leeching.instance; private void FixedUpdate() { if (!NetworkServer.active || !Object.op_Implicit((Object)(object)body) || !Object.op_Implicit((Object)(object)body.healthComponent) || !body.healthComponent.alive) { return; } if (!charging) { burstStopwatch += Time.fixedDeltaTime; if (burstStopwatch >= Elite.timeBetweenBursts) { burstStopwatch = 0f; StartCharging(); } } else { chargeStopwatch += Time.fixedDeltaTime; if (chargeStopwatch >= Elite.chargingTime) { chargeStopwatch = 0f; Burst(); } } } public void OnDamagedServer() { if (charging) { healPercentage -= Elite.burstReductionPerHit; } } private void StartCharging() { //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_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Expected O, but got Unknown charging = true; healPercentage = Elite.burstHealPercentage; if (Object.op_Implicit((Object)(object)Elite.prepBurstEffect)) { EffectData val = new EffectData { origin = body.corePosition }; val.SetNetworkedObjectReference(((Component)body).gameObject); EffectManager.SpawnEffect(Elite.prepBurstEffect, val, true); } } private void Burst() { //IL_00c9: 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_00e0: 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_00ee: Expected O, but got Unknown //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_012f: 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: 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_0150: Expected O, but got Unknown //IL_0170: 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_0186: 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) //IL_019d: Expected O, but got Unknown charging = false; float percentage = Mathf.Max(Elite.minimumBurstHealPercentage, healPercentage); bool flag = false; LeechingRegenStrength leechingRegenStrength = default(LeechingRegenStrength); foreach (HealthComponent item in FindHurtAllies()) { CharacterBody val = item.body; if (Object.op_Implicit((Object)(object)val) && !((Object)(object)val == (Object)(object)body) && !val.HasBuff(Elite.regenBuff) && !val.HasBuff(buffDef)) { if (!((Component)val).TryGetComponent<LeechingRegenStrength>(ref leechingRegenStrength)) { leechingRegenStrength = ((Component)val).gameObject.AddComponent<LeechingRegenStrength>(); } leechingRegenStrength.percentage = percentage; val.AddTimedBuff(Elite.regenBuff, Elite.regenDuration); if (Object.op_Implicit((Object)(object)Elite.regenEffect)) { EffectData val2 = new EffectData { scale = val.bestFitRadius / 10f, origin = val.aimOrigin }; val2.SetNetworkedObjectReference(((Component)val).gameObject); EffectManager.SpawnEffect(Elite.regenEffect, val2, true); } if (Object.op_Implicit((Object)(object)Elite.tracerEffect)) { EffectManager.SpawnEffect(Elite.tracerEffect, new EffectData { origin = val.corePosition, start = body.corePosition }, true); } if (!flag && Object.op_Implicit((Object)(object)Elite.burstEffect)) { flag = true; EffectManager.SpawnEffect(Elite.burstEffect, new EffectData { scale = body.radius, origin = body.aimOrigin }, true); } } } } private List<HealthComponent> FindHurtAllies() { //IL_0018: 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_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_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_0087: Unknown result type (might be due to invalid IL or missing references) hurtBoxes.Clear(); allies.Clear(); TeamMask val = default(TeamMask); ((TeamMask)(ref val)).AddTeam(body.teamComponent.teamIndex); search.mask = ((LayerIndex)(ref LayerIndex.entityPrecise)).mask; search.radius = Elite.burstRadius; search.origin = body.corePosition; search.RefreshCandidates(); search.FilterCandidatesByHurtBoxTeam(val); search.FilterCandidatesByDistinctHurtBoxEntities(); search.GetHurtBoxes(hurtBoxes); foreach (HurtBox hurtBox in hurtBoxes) { HealthComponent healthComponent = hurtBox.healthComponent; if (Object.op_Implicit((Object)(object)healthComponent) && healthComponent.alive && healthComponent.health < healthComponent.fullHealth && !allies.Contains(healthComponent)) { allies.Add(healthComponent); } } return allies; } } public class Volatile : EliteBase { public static Volatile instance; private const int SpiteMaxBombCount = 30; private const float SpiteExtraBombPerRadius = 4f; private const float SpiteBombSpawnBaseRadius = 3f; private const float SpiteBombSpawnRadiusCoefficient = 4f; private const float SpiteBombBlastRadius = 7f; private const float SpiteBombFuseTimeout = 8f; private const float SpiteMaxBombStepUpDistance = 8f; private const float SpiteMaxBombFallDistance = 60f; public float explosionDamageCoefficient; public float explosionBaseRadius; public float explosionRadiusPerProc; public bool enableBombs; public float bombHealthFraction; public float bombCooldown; public float bombDamageCoefficient; public ModdedDamageType volatileDamageType; private GameObject explosionEffect; private GameObject bombPrefab; public override string Name => "Volatile"; public override string Token => "VOLATILE"; public override Color32 EliteColor => new Color32(byte.MaxValue, (byte)152, (byte)0, byte.MaxValue); public override Color BuffColor => new Color(1f, 0.595f, 0f); public override string EquipmentName => "Lingering Torment"; public override string AspectWord => "instability"; public override float EquipmentCooldown => 40f; public override Sprite BuffIcon => LITAssets.LoadSprite("texIconBuffAffixVolatile"); public override Sprite EquipmentIcon => LITAssets.LoadSprite("texIconPickupAffixVolatile"); public override GameObject PickupModel => LITAssets.LoadPrefab("PickupAffixVolatile"); public override Texture2D EliteRamp => LITAssets.Load<Texture2D>("texRampEliteVolatile"); public override GameObject DisplayPrefab => LITAssets.LoadPrefab("DisplayWick"); internal override EliteDisplays.Rule[] DisplayRules => EliteDisplays.VolatileRules; public override void Init() { //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_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_011a: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Expected O, but got Unknown //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) instance = this; explosionDamageCoefficient = Bind("Explosion Damage", 0.3f, "Damage of the on-hit explosions, as a fraction of the hit's damage."); explosionBaseRadius = Bind("Explosion Base Radius", 1.5f, "Radius of the on-hit explosions."); explosionRadiusPerProc = Bind("Explosion Radius per Proc Coefficient", 2.5f, "Extra radius of the on-hit explosions, multiplied by the hit's proc coefficient."); enableBombs = Bind("Spite Bombs", defaultValue: true, "Whether Volatile elites drop Spite bombs when damaged."); bombHealthFraction = Bind("Bomb Damage Threshold", 2f / 3f, "Fraction of max health (divided by the difficulty's scaling) a Volatile elite has to lose to drop bombs."); bombCooldown = Bind("Bomb Cooldown", 3f, "Minimum seconds between two waves of bombs."); bombDamageCoefficient = Bind("Bomb Damage", 1f, "Damage of each bomb, as a multiple of the elite's damage."); CreateElite(); volatileDamageType = DamageAPI.ReserveDamageType(); explosionEffect = Addressables.LoadAssetAsync<GameObject>((object)RoR2_Base_Common_VFX.OmniExplosionVFXQuick_prefab).WaitForCompletion(); if (enableBombs) { bombPrefab = Addressables.LoadAssetAsync<GameObject>((object)RoR2_Base_Bomb.SpiteBomb_prefab).WaitForCompletion(); } BuffBehaviours.Register<VolatileBehaviour>(base.AffixBuff); GlobalEventManager.OnHitAll += new hook_OnHitAll(GlobalEventManager_OnHitAll); GlobalEventManager.onServerDamageDealt += OnServerDamageDealt; } private void GlobalEventManager_OnHitAll(orig_OnHitAll orig, GlobalEventManager self, DamageInfo damageInfo, GameObject hitObject) { //IL_0038: 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_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_00d0: 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_00f8: 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_010b: 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_0119: 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_012f: 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_0136: Unknown result type (might be due to invalid IL or missing references) //IL_013b: 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_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_014b: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0155: 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_0161: Expected O, but got Unknown //IL_0161: 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_0097: 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_00a8: 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_00bf: Expected O, but got Unknown orig.Invoke(self, damageInfo, hitObject); if (!NetworkServer.active || damageInfo == null || !Object.op_Implicit((Object)(object)damageInfo.attacker) || damageInfo.procCoefficient <= 0f || damageInfo.rejected || DamageAPI.HasModdedDamageType(damageInfo, volatileDamageType)) { return; } CharacterBody component = damageInfo.attacker.GetComponent<CharacterBody>(); if (Object.op_Implicit((Object)(object)component) && component.HasBuff(base.AffixBuff)) { float num = explosionBaseRadius + explosionRadiusPerProc * damageInfo.procCoefficient; if (Object.op_Implicit((Object)(object)explosionEffect)) { EffectManager.SpawnEffect(explosionEffect, new EffectData { origin = damageInfo.position, scale = num, rotation = Util.QuaternionSafeLookRotation(damageInfo.force) }, true); } BlastAttack val = new BlastAttack { position = damageInfo.position, baseDamage = Util.OnHitProcDamage(damageInfo.damage, component.damage, explosionDamageCoefficient), baseForce = 0f, radius = num, attacker = damageInfo.attacker, inflictor = null, teamIndex = TeamComponent.GetObjectTeam(damageInfo.attacker), crit = damageInfo.crit, procChainMask = damageInfo.procChainMask, damageColorIndex = (DamageColorIndex)5, falloffModel = (FalloffModel)0, damageType = damageInfo.damageType }; DamageAPI.AddModdedDamageType(val, volatileDamageType); val.Fire(); } } private void OnServerDamageDealt(DamageReport report) { VolatileBehaviour volatileBehaviour = default(VolatileBehaviour); if (Object.op_Implicit((Object)(object)report.victimBody) && ((Component)report.victimBody).TryGetComponent<VolatileBehaviour>(ref volatileBehaviour)) { volatileBehaviour.OnDamagedServer(report.damageDealt); } } internal void SpawnBombs(CharacterBody body) { //IL_002e: 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_004a: 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_0051: 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_0058: 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_0088: 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: 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_00b3: 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_00e4: 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_0119: 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_0188: 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) if (!Object.op_Implicit((Object)(object)bombPrefab)) { return; } int num = Mathf.Min(15, Mathf.CeilToInt(body.bestFitRadius * 4f)); RaycastHit val3 = default(RaycastHit); for (int i = 0; i < num; i++) { Vector3 val = Random.insideUnitSphere * (3f + body.bestFitRadius * 4f); Vector3 val2 = body.corePosition + val; if (Physics.Raycast(new Ray(val2 + new Vector3(0f, 8f, 0f), Vector3.down), ref val3, 68f, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask), (QueryTriggerInteraction)1)) { float y = ((RaycastHit)(ref val3)).point.y; Vector3 corePosition = body.corePosition; if (corePosition.y < y + 4f) { corePosition.y = y + 4f; } val2.y = y; GameObject obj = Object.Instantiate<GameObject>(bombPrefab, corePosition, Random.rotation); SpiteBombController component = obj.GetComponent<SpiteBombController>(); DelayBlast delayBlast = component.delayBlast; component.bouncePosition = val2; component.initialVelocityY = Random.Range(5f, 25f); delayBlast.position = corePosition; delayBlast.baseDa