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 ArtifactPackMod.Artifacts; using BepInEx; using BepInEx.Configuration; using IL.RoR2; using Microsoft.CodeAnalysis; using Mono.Cecil.Cil; using MonoMod.Cil; using On.RoR2; using On.RoR2.CharacterAI; using R2API; using R2API.Networking; using R2API.Networking.Interfaces; using RoR2; using RoR2.Artifacts; using RoR2.CharacterAI; using RoR2.Navigation; using RoR2.UI; using TMPro; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.Events; using UnityEngine.Networking; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("Cypher Artifact Pack")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("Cypher Artifact Pack")] [assembly: AssemblyTitle("Cypher Artifact Pack")] [assembly: AssemblyVersion("1.0.0.0")] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } } namespace ArtifactPackMod { public abstract class ArtifactBase { public ArtifactDef ArtifactDef; public abstract string ArtifactName { get; } public abstract string ArtifactLangTokenName { get; } public abstract string ArtifactDescription { get; } public abstract string ArtifactIconName { get; } public void Initialize() { CreateArtifactDef(); Hooks(); } private void CreateArtifactDef() { //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Expected O, but got Unknown //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Expected O, but got Unknown //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_01a1: Unknown result type (might be due to invalid IL or missing references) //IL_01cc: Unknown result type (might be due to invalid IL or missing references) //IL_01db: Unknown result type (might be due to invalid IL or missing references) ArtifactDef = ScriptableObject.CreateInstance(); ArtifactDef.cachedName = ArtifactLangTokenName; ArtifactDef.nameToken = ArtifactLangTokenName; ArtifactDef.descriptionToken = ArtifactLangTokenName + "_DESC"; Sprite val = LoadSprite(ArtifactIconName); string text = ArtifactIconName.Replace(".png", "Disabled.png"); Sprite val2 = LoadSprite(text); if (Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)val2)) { ArtifactDef.smallIconSelectedSprite = val; ArtifactDef.smallIconDeselectedSprite = val2; } else { Debug.LogError((object)("[ArtifactBase] Could not load icons for " + ArtifactName + ". Looking for: " + ArtifactIconName + " and " + text)); Texture2D val3 = new Texture2D(128, 128); Color[] array = (Color[])(object)new Color[16384]; for (int i = 0; i < array.Length; i++) { array[i] = Color.red; } val3.SetPixels(array); val3.Apply(); Texture2D val4 = new Texture2D(128, 128); Color[] array2 = (Color[])(object)new Color[16384]; for (int j = 0; j < array2.Length; j++) { array2[j] = Color.gray; } val4.SetPixels(array2); val4.Apply(); ArtifactDef.smallIconSelectedSprite = Sprite.Create(val3, new Rect(0f, 0f, 128f, 128f), new Vector2(0.5f, 0.5f)); ArtifactDef.smallIconDeselectedSprite = Sprite.Create(val4, new Rect(0f, 0f, 128f, 128f), new Vector2(0.5f, 0.5f)); } ContentAddition.AddArtifactDef(ArtifactDef); LanguageAPI.Add(ArtifactLangTokenName, ArtifactName); LanguageAPI.Add(ArtifactLangTokenName + "_DESC", ArtifactDescription); } public abstract void Hooks(); private Sprite LoadSprite(string fileName) { //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Expected O, but got Unknown //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) Assembly executingAssembly = Assembly.GetExecutingAssembly(); string text = null; string[] manifestResourceNames = executingAssembly.GetManifestResourceNames(); foreach (string text2 in manifestResourceNames) { if (text2.EndsWith(fileName, StringComparison.OrdinalIgnoreCase)) { text = text2; break; } } if (string.IsNullOrEmpty(text)) { return null; } using (Stream stream = executingAssembly.GetManifestResourceStream(text)) { if (stream == null) { return null; } byte[] array = new byte[stream.Length]; stream.Read(array, 0, array.Length); Texture2D val = new Texture2D(2, 2); if (ImageConversion.LoadImage(val, array)) { return Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), new Vector2(0.5f, 0.5f)); } } return null; } } [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInPlugin("Cyphers.Artifact.Pack", "My Artifact Pack", "1.2.0")] public class ArtifactPackPlugin : BaseUnityPlugin { public static ArtifactPackPlugin Instance { get; private set; } public void Awake() { Instance = this; new AnarchyArtifact().Initialize(); new KinshipArtifact().Initialize(); new TempestArtifact().Initialize(); new StasisArtifact().Initialize(); new RouletteArtifact().Initialize(); new CrescentArtifact().Initialize(); new DesecratedArtifact().Initialize(); ((BaseUnityPlugin)this).Logger.LogInfo((object)"Artifact Pack Loaded Successfully!"); } } } namespace ArtifactPackMod.Artifacts { public class AnarchyArtifact : ArtifactBase { public static ConfigEntry ConfigTimeLimit; public static ConfigEntry ConfigRefundPercentage; public static ConfigEntry ConfigLinearScaling; public static ConfigEntry ConfigBatchSize; private static FieldInfo _spawnCountField; private static FieldInfo _currentMonsterCardField; public override string ArtifactName => "Artifact of Anarchy"; public override string ArtifactLangTokenName => "ARTIFACT_ANARCHY"; public override string ArtifactDescription => "Violence is inevitable. Difficulty scales linearly. After a delay, monsters refund credits on death and spawn in swarms with high diversity."; public override string ArtifactIconName => "Anarchy.png"; public override void Hooks() { //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Expected O, but got Unknown //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Expected O, but got Unknown //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Expected O, but got Unknown //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Expected O, but got Unknown //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Expected O, but got Unknown //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Expected O, but got Unknown //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Expected O, but got Unknown //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_017c: Expected O, but got Unknown //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Expected O, but got Unknown //IL_0194: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Expected O, but got Unknown //IL_01a5: Unknown result type (might be due to invalid IL or missing references) //IL_01af: Expected O, but got Unknown //IL_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Expected O, but got Unknown ConfigTimeLimit = ((BaseUnityPlugin)ArtifactPackPlugin.Instance).Config.Bind("Artifact: Anarchy", "Violence Timer", 60f, "Seconds before the violence begins."); ConfigRefundPercentage = ((BaseUnityPlugin)ArtifactPackPlugin.Instance).Config.Bind("Artifact: Anarchy", "Credit Refund %", 65f, "Percentage of monster cost refunded to the Director on death during Violence."); ConfigLinearScaling = ((BaseUnityPlugin)ArtifactPackPlugin.Instance).Config.Bind("Artifact: Anarchy", "Linear Scaling Factor", 0.2f, "Adds (1 + Factor * StageCount) to difficulty scaling. Makes looping harder."); ConfigBatchSize = ((BaseUnityPlugin)ArtifactPackPlugin.Instance).Config.Bind("Artifact: Anarchy", "Spawn Batch Size", 2, "How many monsters of the same type can spawn before forcing a switch."); _spawnCountField = typeof(CombatDirector).GetField("spawnCountInCurrentWave", BindingFlags.Instance | BindingFlags.NonPublic); _currentMonsterCardField = typeof(CombatDirector).GetField("currentMonsterCard", BindingFlags.Instance | BindingFlags.NonPublic); Run.onRunStartGlobal += OnRunStart; Run.onRunDestroyGlobal += OnRunDestroy; Run.OnServerTeleporterPlaced += new hook_OnServerTeleporterPlaced(OnTeleporterPlaced); TeleporterInteraction.OnInteractionBegin += new hook_OnInteractionBegin(OnTeleporterInteract); CombatDirector.Simulate += new hook_Simulate(ApplyDirectorTweaks); CombatDirector.Awake += new hook_Awake(SetupCreditRefund); CombatDirector.PrepareNewMonsterWave += new hook_PrepareNewMonsterWave(ApplySwarmsDiscount); Run.RecalculateDifficultyCoefficentInternal += new Manipulator(HookLinearScaling); BaseAI.UpdateBodyInputs += new hook_UpdateBodyInputs(ForceSphereTargeting); BaseAI.OnBodyStart += new hook_OnBodyStart(AddTracker); TeamManager.IsTeamEnemy += new hook_IsTeamEnemy(ForceMonsterHostility); FriendlyFireManager.ShouldDirectHitProceed += new hook_ShouldDirectHitProceed(AllowMonsterCivilWar_Direct); FriendlyFireManager.ShouldSplashHitProceed += new hook_ShouldSplashHitProceed(AllowMonsterCivilWar_Splash); FriendlyFireManager.ShouldSeekingProceed += new hook_ShouldSeekingProceed(AllowMonsterCivilWar_Seeking); } private void OnRunStart(Run run) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown if (NetworkServer.active) { GameObject val = new GameObject("AnarchyController"); val.AddComponent(); val.AddComponent(); NetworkServer.Spawn(val); } } private void OnRunDestroy(Run run) { if (Object.op_Implicit((Object)(object)AnarchyRunController.Instance)) { Object.Destroy((Object)(object)((Component)AnarchyRunController.Instance).gameObject); } } private void OnTeleporterPlaced(orig_OnServerTeleporterPlaced orig, Run self, SceneDirector sceneDirector, GameObject teleporter) { orig.Invoke(self, sceneDirector, teleporter); if (NetworkServer.active && Object.op_Implicit((Object)(object)AnarchyRunController.Instance) && RunArtifactManager.instance.IsArtifactEnabled(ArtifactDef)) { float deadline = Run.instance.fixedTime + ConfigTimeLimit.Value; AnarchyRunController.Instance.StartTimer(deadline); } } private void OnTeleporterInteract(orig_OnInteractionBegin orig, TeleporterInteraction self, Interactor interactor) { orig.Invoke(self, interactor); if (NetworkServer.active && Object.op_Implicit((Object)(object)AnarchyRunController.Instance)) { AnarchyRunController.Instance.StopTimer(); } } private void SetupCreditRefund(orig_Awake orig, CombatDirector self) { CombatDirector self2 = self; orig.Invoke(self2); if (!NetworkServer.active) { return; } ((UnityEvent)(object)self2.onSpawnedServer).AddListener((UnityAction)delegate(GameObject masterObject) { //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Invalid comparison between Unknown and I4 if (RunArtifactManager.instance.IsArtifactEnabled(ArtifactDef)) { CharacterMaster component = masterObject.GetComponent(); if (Object.op_Implicit((Object)(object)component)) { CharacterBody body = component.GetBody(); if (Object.op_Implicit((Object)(object)body) && !body.isBoss && !body.isChampion && (int)body.teamComponent.teamIndex == 2) { component.onBodyDestroyed += delegate(CharacterBody destroyedBody) { if (Object.op_Implicit((Object)(object)AnarchyRunController.Instance) && AnarchyRunController.Instance.ViolenceActive && Object.op_Implicit((Object)(object)self2) && ((Behaviour)self2).enabled && self2.monsterCredit > 0f) { float num = destroyedBody.cost * (ConfigRefundPercentage.Value / 100f); CombatDirector obj = self2; obj.monsterCredit += num; } }; } } } }); } private void ApplySwarmsDiscount(orig_PrepareNewMonsterWave orig, CombatDirector self, DirectorCard monsterCard) { //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Expected O, but got Unknown //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: 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_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Expected O, but got Unknown orig.Invoke(self, monsterCard); if (!NetworkServer.active || !Object.op_Implicit((Object)(object)AnarchyRunController.Instance) || !AnarchyRunController.Instance.ViolenceActive || !RunArtifactManager.instance.IsArtifactEnabled(ArtifactDef)) { return; } DirectorCard val = null; if (_currentMonsterCardField != null) { val = (DirectorCard)_currentMonsterCardField.GetValue(self); } if (val != null && (Object)(object)val.spawnCard != (Object)null) { SpawnCard val2 = Object.Instantiate(val.spawnCard); ((Object)val2).name = ((Object)val.spawnCard).name + "_AnarchyDiscount"; val2.directorCreditCost = Mathf.Max(1, val.spawnCard.directorCreditCost / 2); DirectorCard value = new DirectorCard { spawnCard = val2, selectionWeight = val.selectionWeight, spawnDistance = val.spawnDistance, preventOverhead = val.preventOverhead, minimumStageCompletions = val.minimumStageCompletions, requiredUnlockable = val.requiredUnlockable, forbiddenUnlockable = val.forbiddenUnlockable }; if (_currentMonsterCardField != null) { _currentMonsterCardField.SetValue(self, value); } } } private void ApplyDirectorTweaks(orig_Simulate orig, CombatDirector self, float deltaTime) { if (NetworkServer.active && Object.op_Implicit((Object)(object)AnarchyRunController.Instance) && AnarchyRunController.Instance.ViolenceActive && RunArtifactManager.instance.IsArtifactEnabled(ArtifactDef)) { self.minRerollSpawnInterval = 1f; self.maxRerollSpawnInterval = 2f; self.skipSpawnIfTooCheap = false; self.maximumNumberToSpawnBeforeSkipping = ConfigBatchSize.Value * 2; int num = 0; if (_spawnCountField != null) { num = (int)_spawnCountField.GetValue(self); } if (num >= self.maximumNumberToSpawnBeforeSkipping) { if (_spawnCountField != null) { _spawnCountField.SetValue(self, 0); } if (_currentMonsterCardField != null) { _currentMonsterCardField.SetValue(self, null); } } } orig.Invoke(self, deltaTime); } private void HookLinearScaling(ILContext il) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_009f: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); if (val.TryGotoNext((MoveType)2, new Func[4] { (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0), (Instruction x) => ILPatternMatchingExt.MatchLdfld(x, "stageClearCount"), (Instruction x) => ILPatternMatchingExt.MatchConvR4(x), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "Pow") })) { val.Emit(OpCodes.Ldarg_0); val.EmitDelegate>((Func)delegate(float currentScaling, Run runInstance) { if (RunArtifactManager.instance.IsArtifactEnabled(ArtifactDef)) { float num = 1f + ConfigLinearScaling.Value * (float)runInstance.stageClearCount; return Mathf.Max(currentScaling, num); } return currentScaling; }); } else { Debug.LogError((object)"AnarchyArtifact: Failed to hook Linear Scaling IL."); } } private void AddTracker(orig_OnBodyStart orig, BaseAI self, CharacterBody body) { //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Invalid comparison between Unknown and I4 orig.Invoke(self, body); if (Object.op_Implicit((Object)(object)RunArtifactManager.instance) && RunArtifactManager.instance.IsArtifactEnabled(ArtifactDef) && (int)body.teamComponent.teamIndex == 2) { if (!Object.op_Implicit((Object)(object)((Component)self).GetComponent())) { ((Component)self).gameObject.AddComponent(); } self.neverRetaliateFriendlies = false; } } private void ForceSphereTargeting(orig_UpdateBodyInputs orig, BaseAI self) { //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Invalid comparison between Unknown and I4 orig.Invoke(self); if (!NetworkServer.active || !RunArtifactManager.instance.IsArtifactEnabled(ArtifactDef) || !Object.op_Implicit((Object)(object)self.body) || (int)self.body.teamComponent.teamIndex != 2) { return; } AnarchySphereTracker component = ((Component)self).GetComponent(); if (Object.op_Implicit((Object)(object)component)) { CharacterBody val = FindBestTarget(self, component); if (Object.op_Implicit((Object)(object)val)) { self.currentEnemy.gameObject = ((Component)val).gameObject; self.currentEnemy.bestHurtBox = val.mainHurtBox; self.customTarget.gameObject = null; component.ResetRadius(); } else { HandleWandering(self, component); } } } private CharacterBody FindBestTarget(BaseAI self, AnarchySphereTracker tracker) { //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0133: 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_014a: Invalid comparison between Unknown and I4 Vector3 val; if (Object.op_Implicit((Object)(object)self.currentEnemy.gameObject)) { CharacterBody characterBody = self.currentEnemy.characterBody; if (Object.op_Implicit((Object)(object)characterBody) && characterBody.healthComponent.alive) { val = characterBody.corePosition - self.body.corePosition; if (((Vector3)(ref val)).magnitude <= tracker.currentRadius && CheckLoS(self.body.inputBank.aimOrigin, characterBody)) { return characterBody; } } } CharacterBody result = null; float num = float.PositiveInfinity; Vector3 corePosition = self.body.corePosition; Vector3 aimOrigin = self.body.inputBank.aimOrigin; float engagementRange = GetEngagementRange(self.body.baseNameToken); float num2 = Mathf.Min(tracker.currentRadius, engagementRange); num2 *= num2; foreach (CharacterBody readOnlyInstances in CharacterBody.readOnlyInstancesList) { if ((Object)(object)readOnlyInstances == (Object)(object)self.body || !readOnlyInstances.healthComponent.alive || !TeamManager.IsTeamEnemy((TeamIndex)2, readOnlyInstances.teamComponent.teamIndex)) { continue; } val = readOnlyInstances.corePosition - corePosition; float num3 = ((Vector3)(ref val)).sqrMagnitude; if (!(num3 > num2) && CheckLoS(aimOrigin, readOnlyInstances)) { if ((int)readOnlyInstances.teamComponent.teamIndex == 1) { num3 *= 0.7f; } if (num3 < num) { num = num3; result = readOnlyInstances; } } } return result; } private float GetEngagementRange(string nameToken) { return nameToken switch { "BEETLE_BODY_NAME" => 45f, "IMP_BODY_NAME" => 45f, "LEMURIAN_BODY_NAME" => 70f, "GOLEM_BODY_NAME" => 70f, "WISP_BODY_NAME" => 90f, "GREATER_WISP_BODY_NAME" => 90f, _ => 60f, }; } private void HandleWandering(BaseAI self, AnarchySphereTracker tracker) { if (!((Object)(object)self.customTarget.gameObject != (Object)null)) { tracker.ExpandRadius(); } } private bool CheckLoS(Vector3 origin, CharacterBody target) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002a: 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_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)target.mainHurtBox)) { return false; } Vector3 position = ((Component)target.mainHurtBox).transform.position; Vector3 val = position - origin; Vector3 val2 = position - origin; float magnitude = ((Vector3)(ref val2)).magnitude; LayerIndex world = LayerIndex.world; RaycastHit val3 = default(RaycastHit); return !Physics.Raycast(origin, val, ref val3, magnitude, LayerMask.op_Implicit(((LayerIndex)(ref world)).mask)); } private bool ForceMonsterHostility(orig_IsTeamEnemy orig, TeamIndex teamA, TeamIndex teamB) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Invalid comparison between Unknown and I4 //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Invalid comparison between Unknown and I4 if (Object.op_Implicit((Object)(object)RunArtifactManager.instance) && RunArtifactManager.instance.IsArtifactEnabled(ArtifactDef) && (int)teamA == 2 && (int)teamB == 2) { return true; } return orig.Invoke(teamA, teamB); } private bool AllowMonsterCivilWar_Direct(orig_ShouldDirectHitProceed orig, HealthComponent victim, TeamIndex attackerTeamIndex) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Invalid comparison between Unknown and I4 //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Invalid comparison between Unknown and I4 if (orig.Invoke(victim, attackerTeamIndex)) { return true; } if (Object.op_Implicit((Object)(object)RunArtifactManager.instance) && RunArtifactManager.instance.IsArtifactEnabled(ArtifactDef) && (int)attackerTeamIndex == 2 && (int)victim.body.teamComponent.teamIndex == 2) { return true; } return false; } private bool AllowMonsterCivilWar_Splash(orig_ShouldSplashHitProceed orig, HealthComponent victim, TeamIndex attackerTeamIndex) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Invalid comparison between Unknown and I4 //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Invalid comparison between Unknown and I4 if (orig.Invoke(victim, attackerTeamIndex)) { return true; } if (Object.op_Implicit((Object)(object)RunArtifactManager.instance) && RunArtifactManager.instance.IsArtifactEnabled(ArtifactDef) && (int)attackerTeamIndex == 2 && (int)victim.body.teamComponent.teamIndex == 2) { return true; } return false; } private bool AllowMonsterCivilWar_Seeking(orig_ShouldSeekingProceed orig, HealthComponent victim, TeamIndex attackerTeamIndex) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Invalid comparison between Unknown and I4 //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Invalid comparison between Unknown and I4 if (orig.Invoke(victim, attackerTeamIndex)) { return true; } if (Object.op_Implicit((Object)(object)RunArtifactManager.instance) && RunArtifactManager.instance.IsArtifactEnabled(ArtifactDef) && (int)attackerTeamIndex == 2 && (int)victim.body.teamComponent.teamIndex == 2) { return true; } return false; } } public class AnarchyRunController : NetworkBehaviour { public static AnarchyRunController Instance; [SyncVar] public bool ViolenceActive; [SyncVar] public float Deadline; [SyncVar] public bool TimerRunning; public void Awake() { Instance = this; Object.DontDestroyOnLoad((Object)(object)((Component)this).gameObject); } public void StartTimer(float deadline) { Deadline = deadline; TimerRunning = true; ViolenceActive = false; } public void StopTimer() { TimerRunning = false; ViolenceActive = false; } public void FixedUpdate() { //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Expected O, but got Unknown if (NetworkServer.active && TimerRunning && Run.instance.fixedTime >= Deadline && !ViolenceActive) { ViolenceActive = true; Chat.SendBroadcastChat((ChatMessageBase)new SimpleChatMessage { baseToken = "'...And then they called for violence...'" }); } } } public class AnarchySphereTracker : MonoBehaviour { public float minRadius = 15f; public float maxRadius = 300f; public float currentRadius; public float growthRate = 15f; public void Awake() { ResetRadius(); } public void FixedUpdate() { if (currentRadius < maxRadius) { currentRadius += growthRate * Time.fixedDeltaTime; } } public void ResetRadius() { currentRadius = minRadius; } public void ExpandRadius() { if (currentRadius < maxRadius) { currentRadius += 10f; } } } public class CrescentArtifact : ArtifactBase { private static InteractableSpawnCard lunarPodCard; private static PickupIndex lunarCoinPickupIndex; public override string ArtifactName => "Artifact of the Crescent"; public override string ArtifactLangTokenName => "ARTIFACT_CRESCENT"; public override string ArtifactDescription => "Teleporter bosses drop Lunar Coins instead of items. Lunar Pods spawn on every stage."; public override string ArtifactIconName => "Crescent.png"; public override void Hooks() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Expected O, but got Unknown //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Expected O, but got Unknown lunarPodCard = Addressables.LoadAssetAsync((object)"RoR2/Base/LunarChest/iscLunarChest.asset").WaitForCompletion(); RoR2Application.onLoad = (Action)Delegate.Combine(RoR2Application.onLoad, (Action)delegate { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)MiscPickups.LunarCoin)) { lunarCoinPickupIndex = PickupCatalog.FindPickupIndex(MiscPickups.LunarCoin.miscPickupIndex); } }); BossGroup.DropRewards += new hook_DropRewards(OverrideBossDrops); SceneDirector.PopulateScene += new hook_PopulateScene(GuaranteeLunarPod); } private void OverrideBossDrops(orig_DropRewards orig, BossGroup self) { //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Invalid comparison between Unknown and I4 //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Invalid comparison between Unknown and I4 //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Invalid comparison between Unknown and I4 //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_0194: Unknown result type (might be due to invalid IL or missing references) //IL_0199: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) if (!NetworkServer.active) { orig.Invoke(self); return; } if (!RunArtifactManager.instance.IsArtifactEnabled(ArtifactDef)) { orig.Invoke(self); return; } if (!Object.op_Implicit((Object)(object)self.dropPosition)) { Debug.LogWarning((object)"Crescent Artifact: BossGroup has no drop position."); return; } Xoroshiro128Plus treasureRng = Run.instance.treasureRng; int num = (1 + self.bonusRewardCount) * Run.instance.participatingPlayerCount; int bonusRewardCount = self.bonusRewardCount; Transform dropPosition = self.dropPosition; for (int i = 0; i < num; i++) { PickupIndex val = PickupIndex.none; try { if (Object.op_Implicit((Object)(object)self.dropTable)) { val = self.dropTable.GenerateDrop(treasureRng); } else { List availableTier2DropList = Run.instance.availableTier2DropList; if (availableTier2DropList.Count > 0) { val = availableTier2DropList[treasureRng.RangeInt(0, availableTier2DropList.Count)]; } } } catch (Exception) { List availableTier2DropList2 = Run.instance.availableTier2DropList; if (availableTier2DropList2.Count > 0) { val = availableTier2DropList2[treasureRng.RangeInt(0, availableTier2DropList2.Count)]; } } int num2 = 5; if (val != PickupIndex.none) { PickupDef pickupDef = PickupCatalog.GetPickupDef(val); if (pickupDef != null) { num2 = (((int)pickupDef.itemTier == 1) ? 5 : (((int)pickupDef.itemTier == 4) ? 7 : (((int)pickupDef.itemTier != 2) ? 5 : 10))); } } num2 += bonusRewardCount; if (lunarCoinPickupIndex != PickupIndex.none && num2 > 0) { for (int j = 0; j < num2; j++) { Vector3 val2 = Vector3.up * 20f + Random.insideUnitSphere * 5f; PickupDropletController.CreatePickupDroplet(lunarCoinPickupIndex, dropPosition.position, val2); } } } } private void GuaranteeLunarPod(orig_PopulateScene orig, SceneDirector self) { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Invalid comparison between Unknown and I4 //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_0052: Expected O, but got Unknown //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Expected O, but got Unknown //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Invalid comparison between Unknown and I4 orig.Invoke(self); if (!NetworkServer.active || !RunArtifactManager.instance.IsArtifactEnabled(ArtifactDef)) { return; } SceneDef sceneDefForCurrentScene = SceneCatalog.GetSceneDefForCurrentScene(); if (!Object.op_Implicit((Object)(object)sceneDefForCurrentScene) || (int)sceneDefForCurrentScene.sceneType != 1 || !Object.op_Implicit((Object)(object)lunarPodCard)) { return; } DirectorPlacementRule val = new DirectorPlacementRule { placementMode = (PlacementMode)4 }; GameObject val2 = DirectorCore.instance.TrySpawnObject(new DirectorSpawnRequest((SpawnCard)(object)lunarPodCard, val, Run.instance.stageRng)); if (Object.op_Implicit((Object)(object)val2)) { PurchaseInteraction component = val2.GetComponent(); if (Object.op_Implicit((Object)(object)component) && (int)component.costType == 1) { component.Networkcost = Run.instance.GetDifficultyScaledCost(component.cost); } } } } public class DesecratedArtifact : ArtifactBase { public static ConfigEntry ConfigMaxActiveGhosts; public static ConfigEntry ConfigSpawnInterval; public static ConfigEntry ConfigGhostColorHexA; public static ConfigEntry ConfigGhostColorHexB; public static ConfigEntry ConfigUIColorTop; public static ConfigEntry ConfigUIColorBottom; public static ConfigEntry ConfigGlowIntensity; public override string ArtifactName => "Artifact of the Desecrated"; public override string ArtifactLangTokenName => "ARTIFACT_DESECRATED"; public override string ArtifactDescription => "Enemies killed before the Teleporter event are resurrected as vengeful ghosts. Normal spawns are disabled during Teleporter charge."; public override string ArtifactIconName => "Desecrated.png"; public override void Hooks() { //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Expected O, but got Unknown //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Expected O, but got Unknown //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Expected O, but got Unknown //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Expected O, but got Unknown ConfigMaxActiveGhosts = ((BaseUnityPlugin)ArtifactPackPlugin.Instance).Config.Bind("Artifact: Desecrated - Gameplay", "Max Active Ghosts", 20, "The maximum number of resurrected ghosts allowed to exist at the same time. Lower this if you experience lag."); ConfigSpawnInterval = ((BaseUnityPlugin)ArtifactPackPlugin.Instance).Config.Bind("Artifact: Desecrated - Gameplay", "Ghost Respawn Delay", 4f, "The time (in seconds) between ghost spawns during the Teleporter event."); ConfigGhostColorHexA = ((BaseUnityPlugin)ArtifactPackPlugin.Instance).Config.Bind("Artifact: Desecrated - Visuals", "Ghost Pulse Color A", "#73C2FB", "The starting color of the ghost's pulsing animation. Format: Hex Code (e.g., #FF0000 for Red, #00FF00 for Green)."); ConfigGhostColorHexB = ((BaseUnityPlugin)ArtifactPackPlugin.Instance).Config.Bind("Artifact: Desecrated - Visuals", "Ghost Pulse Color B", "#8EEDFF", "The ending color of the ghost's pulsing animation. The ghost will fade back and forth between Color A and Color B."); ConfigUIColorTop = ((BaseUnityPlugin)ArtifactPackPlugin.Instance).Config.Bind("Artifact: Desecrated - Visuals", "UI Text Top Color", "#73C2FB", "The color used for the TOP half of the warning text gradient."); ConfigUIColorBottom = ((BaseUnityPlugin)ArtifactPackPlugin.Instance).Config.Bind("Artifact: Desecrated - Visuals", "UI Text Bottom Color", "##3B084D", "The color used for the BOTTOM half of the warning text gradient."); ConfigGlowIntensity = ((BaseUnityPlugin)ArtifactPackPlugin.Instance).Config.Bind("Artifact: Desecrated - Visuals", "Glow Intensity", 3f, "How bright the ghosts glow. Values above 1.0 create a Bloom effect. Set higher (e.g., 5.0) for blinding neon, or lower (e.g., 1.0) for flat colors."); Run.onRunStartGlobal += delegate(Run run) { if (Object.op_Implicit((Object)(object)RunArtifactManager.instance) && RunArtifactManager.instance.IsArtifactEnabled(ArtifactDef) && !Object.op_Implicit((Object)(object)((Component)run).gameObject.GetComponent())) { ((Component)run).gameObject.AddComponent(); } }; RunArtifactManager.onArtifactEnabledGlobal += (ArtifactStateChangeDelegate)delegate(RunArtifactManager run, ArtifactDef artifactDef) { if ((Object)(object)artifactDef == (Object)(object)ArtifactDef && !Object.op_Implicit((Object)(object)((Component)run).gameObject.GetComponent())) { ((Component)run).gameObject.AddComponent(); } }; RunArtifactManager.onArtifactDisabledGlobal += (ArtifactStateChangeDelegate)delegate(RunArtifactManager run, ArtifactDef artifactDef) { if ((Object)(object)artifactDef == (Object)(object)ArtifactDef) { DesecratedController component = ((Component)run).gameObject.GetComponent(); if (Object.op_Implicit((Object)(object)component)) { Object.Destroy((Object)(object)component); } } }; CombatDirector.AttemptSpawnOnTarget += new hook_AttemptSpawnOnTarget(CombatDirector_AttemptSpawnOnTarget); CharacterBody.Start += new hook_Start(CharacterBody_Start); } public static Color ParseColor(string hex, float intensityMultiplier = 1f) { //IL_0012: 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_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) Color val = default(Color); if (ColorUtility.TryParseHtmlString(hex, ref val)) { return val * intensityMultiplier; } return Color.white * intensityMultiplier; } private bool CombatDirector_AttemptSpawnOnTarget(orig_AttemptSpawnOnTarget orig, CombatDirector self, Transform spawnTarget, PlacementMode placementMode) { //IL_002d: 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) if (!RunArtifactManager.instance.IsArtifactEnabled(ArtifactDef) || !Object.op_Implicit((Object)(object)TeleporterInteraction.instance) || !TeleporterInteraction.instance.isCharging) { return orig.Invoke(self, spawnTarget, placementMode); } if ((Object)(object)TeleporterInteraction.instance.bossDirector == (Object)(object)self) { return orig.Invoke(self, spawnTarget, placementMode); } return false; } private void CharacterBody_Start(orig_Start orig, CharacterBody self) { orig.Invoke(self); if (Object.op_Implicit((Object)(object)self.master) && Object.op_Implicit((Object)(object)((Component)self.master).GetComponent()) && !Object.op_Implicit((Object)(object)((Component)self).GetComponent())) { ((Component)self).gameObject.AddComponent(); } } } public class DesecratedGhostVisuals : MonoBehaviour { private CharacterBody body; private TemporaryOverlay overlay; private static Material ghostMaterial; private Color colorA; private Color colorB; private const float AnimationSpeed = 2f; private void Start() { //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Expected O, but got Unknown body = ((Component)this).GetComponent(); if (!Object.op_Implicit((Object)(object)body) || !Object.op_Implicit((Object)(object)body.modelLocator) || !Object.op_Implicit((Object)(object)body.modelLocator.modelTransform)) { return; } float value = DesecratedArtifact.ConfigGlowIntensity.Value; colorA = DesecratedArtifact.ParseColor(DesecratedArtifact.ConfigGhostColorHexA.Value, value); colorB = DesecratedArtifact.ParseColor(DesecratedArtifact.ConfigGhostColorHexB.Value, value); if (!Object.op_Implicit((Object)(object)ghostMaterial)) { Material val = Addressables.LoadAssetAsync((object)"RoR2/Base/Common/VFX/matGhostEffect.mat").WaitForCompletion(); if (!Object.op_Implicit((Object)(object)val)) { return; } ghostMaterial = new Material(val); if (ghostMaterial.HasProperty("_AlphaBoost")) { ghostMaterial.SetFloat("_AlphaBoost", 1.5f); } if (ghostMaterial.HasProperty("_Boost")) { ghostMaterial.SetFloat("_Boost", 1.2f); } if (ghostMaterial.HasProperty("_FresnelPower")) { ghostMaterial.SetFloat("_FresnelPower", 1f); } } GameObject gameObject = ((Component)body.modelLocator.modelTransform).gameObject; CharacterModel component = gameObject.GetComponent(); if (Object.op_Implicit((Object)(object)component)) { component.isGhost = true; overlay = gameObject.AddComponent(); overlay.duration = float.PositiveInfinity; overlay.destroyComponentOnEnd = true; overlay.originalMaterial = ghostMaterial; overlay.inspectorCharacterModel = component; overlay.alphaCurve = AnimationCurve.Constant(0f, 1f, 1f); overlay.animateShaderAlpha = true; } } private void Update() { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0050: 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) if (Object.op_Implicit((Object)(object)ghostMaterial)) { float num = Mathf.PingPong(Time.time * 2f, 1f); Color val = Color.Lerp(colorA, colorB, num); if (ghostMaterial.HasProperty("_TintColor")) { ghostMaterial.SetColor("_TintColor", val); } else if (ghostMaterial.HasProperty("_Color")) { ghostMaterial.SetColor("_Color", val); } } } private void OnDestroy() { if (Object.op_Implicit((Object)(object)overlay)) { Object.Destroy((Object)(object)overlay); } } } public class DesecratedUIManager : MonoBehaviour { public static void ShowArtifactMessage(string messageText) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown //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_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: 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_00ad: 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) GameObject val = new GameObject("DesecratedMessageUI"); Canvas obj = val.AddComponent(); obj.renderMode = (RenderMode)0; obj.sortingOrder = 100; val.AddComponent(); val.AddComponent(); GameObject val2 = new GameObject("MessageText"); val2.transform.SetParent(val.transform, false); TextMeshProUGUI val3 = val2.AddComponent(); ((TMP_Text)val3).text = messageText; ((TMP_Text)val3).font = HGTextMeshProUGUI.defaultLanguageFont; ((TMP_Text)val3).fontSize = 60f; ((TMP_Text)val3).alignment = (TextAlignmentOptions)514; ((TMP_Text)val3).enableWordWrapping = false; Color val4 = DesecratedArtifact.ParseColor(DesecratedArtifact.ConfigUIColorTop.Value); Color val5 = DesecratedArtifact.ParseColor(DesecratedArtifact.ConfigUIColorBottom.Value); VertexGradient colorGradient = default(VertexGradient); ((VertexGradient)(ref colorGradient))..ctor(val4, val4, val5, val5); ((TMP_Text)val3).colorGradient = colorGradient; ((TMP_Text)val3).enableVertexGradient = true; val.AddComponent().targetText = val3; } } public class DesecratedUIAnimation : MonoBehaviour { public TextMeshProUGUI targetText; private float duration = 5f; private float timer; private void Start() { if (Object.op_Implicit((Object)(object)targetText)) { ((TMP_Text)targetText).alpha = 0f; ((TMP_Text)targetText).characterSpacing = 0f; } } private void Update() { timer += Time.deltaTime; float num = Mathf.Clamp01(timer / duration); if (Object.op_Implicit((Object)(object)targetText)) { if (num < 0.2f) { ((TMP_Text)targetText).alpha = num / 0.2f; } else if (num > 0.8f) { ((TMP_Text)targetText).alpha = 1f - (num - 0.8f) / 0.2f; } else { ((TMP_Text)targetText).alpha = 1f; } ((TMP_Text)targetText).characterSpacing = Mathf.Lerp(0f, 25f, num); } if (timer >= duration) { Object.Destroy((Object)(object)((Component)this).gameObject); } } } public class DesecratedController : MonoBehaviour { private struct GhostEntry { public MasterIndex masterIndex; public EquipmentIndex eliteEquipmentIndex; } private List enemyGraveyard = new List(); private List currentSpawnDeck = new List(); private Xoroshiro128Plus rng; private float spawnTimer; private bool messageShown; public void Awake() { GlobalEventManager.onCharacterDeathGlobal += OnDeath; TeleporterInteraction.onTeleporterBeginChargingGlobal += OnTeleporterStart; TeleporterInteraction.onTeleporterChargedGlobal += OnTeleporterFinish; SceneCatalog.onMostRecentSceneDefChanged += OnSceneChanged; } public void OnDestroy() { GlobalEventManager.onCharacterDeathGlobal -= OnDeath; TeleporterInteraction.onTeleporterBeginChargingGlobal -= OnTeleporterStart; TeleporterInteraction.onTeleporterChargedGlobal -= OnTeleporterFinish; SceneCatalog.onMostRecentSceneDefChanged -= OnSceneChanged; } private void OnSceneChanged(SceneDef sceneDef) { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Expected O, but got Unknown enemyGraveyard.Clear(); currentSpawnDeck.Clear(); messageShown = false; rng = new Xoroshiro128Plus(Run.instance.stageRng.nextUlong); } private void OnDeath(DamageReport report) { //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Invalid comparison between Unknown and I4 //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) if (NetworkServer.active && (!Object.op_Implicit((Object)(object)TeleporterInteraction.instance) || !TeleporterInteraction.instance.isCharging) && Object.op_Implicit((Object)(object)report.victimMaster) && report.victimMaster.masterIndex != MasterIndex.none && (int)report.victimTeamIndex == 2 && (!Object.op_Implicit((Object)(object)report.victimBody) || !Object.op_Implicit((Object)(object)((Component)report.victimBody).GetComponent())) && !Object.op_Implicit((Object)(object)((Component)report.victimMaster).GetComponent())) { EquipmentIndex eliteEquipmentIndex = (EquipmentIndex)(-1); if (Object.op_Implicit((Object)(object)report.victimMaster.inventory)) { eliteEquipmentIndex = report.victimMaster.inventory.GetEquipmentIndex(); } enemyGraveyard.Add(new GhostEntry { masterIndex = report.victimMaster.masterIndex, eliteEquipmentIndex = eliteEquipmentIndex }); } } private void OnTeleporterStart(TeleporterInteraction tp) { if (NetworkServer.active && !messageShown) { if (enemyGraveyard.Count > 0) { DesecratedUIManager.ShowArtifactMessage("You stirred the dead..."); RefillDeck(); } else { DesecratedUIManager.ShowArtifactMessage("They rest for now..."); } messageShown = true; } } private void OnTeleporterFinish(TeleporterInteraction tp) { currentSpawnDeck.Clear(); } private void RefillDeck() { if (enemyGraveyard.Count != 0) { currentSpawnDeck = new List(enemyGraveyard); Util.ShuffleList(currentSpawnDeck, rng); } } public void FixedUpdate() { if (!NetworkServer.active || !Object.op_Implicit((Object)(object)Run.instance) || !Object.op_Implicit((Object)(object)TeleporterInteraction.instance) || !TeleporterInteraction.instance.isCharging) { return; } int num = 0; foreach (CharacterMaster readOnlyInstances in CharacterMaster.readOnlyInstancesList) { if (Object.op_Implicit((Object)(object)((Component)readOnlyInstances).GetComponent())) { num++; } } if (num < DesecratedArtifact.ConfigMaxActiveGhosts.Value && num < enemyGraveyard.Count) { spawnTimer -= Time.fixedDeltaTime; if (spawnTimer <= 0f) { SpawnNextGhost(); spawnTimer = DesecratedArtifact.ConfigSpawnInterval.Value; } } } private void SpawnNextGhost() { if (enemyGraveyard.Count != 0) { if (currentSpawnDeck.Count == 0) { RefillDeck(); } GhostEntry entry = currentSpawnDeck[0]; currentSpawnDeck.RemoveAt(0); SpawnGhost(entry); } } private void SpawnGhost(GhostEntry entry) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: 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_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Invalid comparison between Unknown and I4 //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) GameObject masterPrefab = MasterCatalog.GetMasterPrefab(entry.masterIndex); if (!Object.op_Implicit((Object)(object)masterPrefab)) { return; } Vector3 val = ((Component)TeleporterInteraction.instance).transform.position; NodeGraph nodeGraph = SceneInfo.instance.GetNodeGraph((GraphType)0); if (Object.op_Implicit((Object)(object)nodeGraph)) { List list = nodeGraph.FindNodesInRange(val, 20f, 100f, (HullMask)1); if (list.Count > 0) { NodeIndex val2 = list[rng.RangeInt(0, list.Count)]; Vector3 val3 = default(Vector3); if (nodeGraph.GetNodePosition(val2, ref val3)) { val = val3; } } } CharacterMaster val4 = new MasterSummon { masterPrefab = masterPrefab, position = val, rotation = Quaternion.identity, teamIndexOverride = (TeamIndex)2, ignoreTeamMemberLimit = true, useAmbientLevel = true }.Perform(); if (Object.op_Implicit((Object)(object)val4)) { ((Component)val4).gameObject.AddComponent(); if ((int)entry.eliteEquipmentIndex != -1 && Object.op_Implicit((Object)(object)val4.inventory)) { val4.inventory.SetEquipmentIndex(entry.eliteEquipmentIndex); } } } } public class DesecratedGhostMarker : MonoBehaviour { } public class KinshipArtifact : ArtifactBase { public static float CurrentStageMultiplier = 1f; public override string ArtifactName => "Artifact of Kinship"; public override string ArtifactLangTokenName => "ARTIFACT_KINSHIP"; public override string ArtifactDescription => "Every stage has a random Monster Family event active."; public override string ArtifactIconName => "Kinship.png"; public override void Hooks() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Expected O, but got Unknown ClassicStageInfo.RebuildCards += new hook_RebuildCards(ForceFamilyEvent); CombatDirector.Simulate += new hook_Simulate(ApplyDynamicDirectorBudget); } private void ApplyDynamicDirectorBudget(orig_Simulate orig, CombatDirector self, float deltaTime) { if (Object.op_Implicit((Object)(object)RunArtifactManager.instance) && RunArtifactManager.instance.IsArtifactEnabled(ArtifactDef)) { orig.Invoke(self, deltaTime * CurrentStageMultiplier); } else { orig.Invoke(self, deltaTime); } } private void ForceFamilyEvent(orig_RebuildCards orig, ClassicStageInfo self, DirectorCardCategorySelection forcedMonsterCategory, DirectorCardCategorySelection forcedInteractableCategory) { //IL_0262: Unknown result type (might be due to invalid IL or missing references) //IL_0267: Unknown result type (might be due to invalid IL or missing references) //IL_0273: Expected O, but got Unknown //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Expected O, but got Unknown CurrentStageMultiplier = 1f; if (!Object.op_Implicit((Object)(object)RunArtifactManager.instance) || !RunArtifactManager.instance.IsArtifactEnabled(ArtifactDef)) { orig.Invoke(self, forcedMonsterCategory, forcedInteractableCategory); return; } DirectorCardCategorySelection val = null; string text = null; try { FieldInfo field = typeof(ClassicStageInfo).GetField("monsterDccsPool", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); if (field != null) { object value = field.GetValue(self); if (value != null) { FieldInfo field2 = value.GetType().GetField("poolCategories", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); if (field2 != null) { Array obj = (Array)field2.GetValue(value); List list = new List(); foreach (object item in obj) { FieldInfo[] array = (from f in item.GetType().GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic) where f.FieldType.IsArray select f).ToArray(); for (int i = 0; i < array.Length; i++) { Array array2 = (Array)array[i].GetValue(item); if (array2 == null) { continue; } foreach (object item2 in array2) { FieldInfo field3 = item2.GetType().GetField("dccs", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); if (field3 != null) { DirectorCardCategorySelection val2 = (DirectorCardCategorySelection)field3.GetValue(item2); if ((Object)(object)val2 != (Object)null && ((Object)val2).name.IndexOf("Family", StringComparison.OrdinalIgnoreCase) >= 0) { list.Add(val2); } } } } } if (list.Count > 0) { val = list[Run.instance.stageRng.RangeInt(0, list.Count)]; text = GetMessageForFamily(((Object)val).name); CurrentStageMultiplier = CalculateMultiplier(((Object)val).name); } } } } } catch (Exception ex) { Debug.LogWarning((object)("[Kinship] Reflection Error: " + ex.Message)); } if ((Object)(object)val != (Object)null) { forcedMonsterCategory = val; Debug.Log((object)$"[Kinship] Success! Family Enforced: {((Object)val).name}. Director Multiplier set to: {CurrentStageMultiplier}x"); if (!string.IsNullOrEmpty(text)) { Chat.SendBroadcastChat((ChatMessageBase)new SimpleChatMessage { baseToken = text }); } } else { SceneDef sceneDefForCurrentScene = SceneCatalog.GetSceneDefForCurrentScene(); Debug.LogWarning((object)("[Kinship] No specific Family Events found for this stage (" + ((sceneDefForCurrentScene != null) ? sceneDefForCurrentScene.baseSceneName : null) + ").")); } orig.Invoke(self, forcedMonsterCategory, forcedInteractableCategory); } private float CalculateMultiplier(string dccsName) { string text = dccsName.ToLower(); if (text.Contains("void")) { return 4f; } if (text.Contains("parent")) { return 4f; } if (text.Contains("lunar")) { return 4f; } if (text.Contains("alloy")) { return 3.5f; } if (text.Contains("construct")) { return 3.5f; } if (text.Contains("imp")) { return 2f; } if (text.Contains("golem")) { return 2f; } if (text.Contains("mushroom")) { return 2f; } if (text.Contains("gup")) { return 2.5f; } if (text.Contains("solus")) { return 2f; } if (text.Contains("beetle")) { return 1f; } if (text.Contains("wisp")) { return 1f; } if (text.Contains("lemurian")) { return 1f; } if (text.Contains("jellyfish")) { return 1f; } text.Contains("vermin"); return 1f; } private string GetMessageForFamily(string dccsName) { string text = dccsName.ToLower(); if (text.Contains("wisp")) { return "The air begins to burn.."; } if (text.Contains("lemurian")) { return "The ground's temperature begins to rise.."; } if (text.Contains("imp")) { return "A tear in the fabric of the universe.."; } if (text.Contains("beetle")) { return "The ground begins to shift beneath you.."; } if (text.Contains("golem")) { return "The earth rumbles and groans with mysterious energies.."; } if (text.Contains("parent")) { return "The earth shifts and changes.."; } if (text.Contains("mushroom")) { return "The ground grows sickly.."; } if (text.Contains("construct")) { return "You have tripped an ancient alarm.."; } if (text.Contains("void")) { return "The Void has become curious.."; } if (text.Contains("lunar")) { return "The bulwark begins to falter.."; } if (text.Contains("jellyfish")) { return "The air crackles and arcs.."; } if (text.Contains("solus")) { return "The Collective is converging.."; } if (text.Contains("alloy")) { return "A committee swarms above.."; } if (text.Contains("gup")) { return "The air smells of sweet strawberries.."; } return "WARNING_FAMILY_EVENT"; } } public class RouletteArtifact : ArtifactBase { public class SyncRouletteEvent : INetMessage, ISerializableObject { private int eventId; private float duration; public SyncRouletteEvent() { } public SyncRouletteEvent(int id, float dur) { eventId = id; duration = dur; } public void Serialize(NetworkWriter writer) { writer.Write(eventId); writer.Write(duration); } public void Deserialize(NetworkReader reader) { eventId = reader.ReadInt32(); duration = reader.ReadSingle(); } public void OnReceived() { //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Invalid comparison between Unknown and I4 //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Invalid comparison between Unknown and I4 if (NetworkServer.active) { return; } switch (eventId) { case 0: EliteEventActive = true; EliteEventTimer = duration; Chat.AddMessage($"[Roulette] DANGER! All spawns are Elite for {duration} seconds!"); break; case 1: BigHeadActive = true; BigHeadTimer = duration; Chat.AddMessage("[Roulette] BIG HEAD MODE! All heads enlarged!"); { foreach (CharacterBody readOnlyInstances in CharacterBody.readOnlyInstancesList) { if (Object.op_Implicit((Object)(object)readOnlyInstances) && !Object.op_Implicit((Object)(object)((Component)readOnlyInstances).GetComponent())) { ((Component)readOnlyInstances).gameObject.AddComponent(); } } break; } case 2: MiniEnemiesActive = true; GiantEnemiesActive = false; SizeEventTimer = duration; Chat.AddMessage("[Roulette] MINI MONSTERS!"); { foreach (CharacterBody readOnlyInstances2 in CharacterBody.readOnlyInstancesList) { if (Object.op_Implicit((Object)(object)readOnlyInstances2) && Object.op_Implicit((Object)(object)readOnlyInstances2.teamComponent) && (int)readOnlyInstances2.teamComponent.teamIndex == 2 && !Object.op_Implicit((Object)(object)((Component)readOnlyInstances2).GetComponent())) { ((Component)readOnlyInstances2).gameObject.AddComponent().targetScale = 0.5f; } } break; } case 3: GiantEnemiesActive = true; MiniEnemiesActive = false; SizeEventTimer = duration; Chat.AddMessage("[Roulette] GIANT MONSTERS!"); { foreach (CharacterBody readOnlyInstances3 in CharacterBody.readOnlyInstancesList) { if (Object.op_Implicit((Object)(object)readOnlyInstances3) && Object.op_Implicit((Object)(object)readOnlyInstances3.teamComponent) && (int)readOnlyInstances3.teamComponent.teamIndex == 2 && !Object.op_Implicit((Object)(object)((Component)readOnlyInstances3).GetComponent())) { ((Component)readOnlyInstances3).gameObject.AddComponent().targetScale = 2f; } } break; } } } } public class SyncTinyPlayer : INetMessage, ISerializableObject { private NetworkInstanceId netId; public SyncTinyPlayer() { } public SyncTinyPlayer(NetworkInstanceId id) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) netId = id; } public void Serialize(NetworkWriter writer) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) writer.Write(netId); } public void Deserialize(NetworkReader reader) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) netId = reader.ReadNetworkId(); } public void OnReceived() { //IL_0009: Unknown result type (might be due to invalid IL or missing references) if (NetworkServer.active) { return; } GameObject val = ClientScene.FindLocalObject(netId); if (Object.op_Implicit((Object)(object)val)) { CharacterBody component = val.GetComponent(); if (Object.op_Implicit((Object)(object)component) && !Object.op_Implicit((Object)(object)((Component)component).GetComponent())) { ((Component)component).gameObject.AddComponent().targetScale = 0.5f; Chat.AddMessage("[Roulette] A player has been Downsized!"); } } } } public class SyncFrailty : INetMessage, ISerializableObject { private NetworkInstanceId netId; public SyncFrailty() { } public SyncFrailty(NetworkInstanceId id) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) netId = id; } public void Serialize(NetworkWriter writer) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) writer.Write(netId); } public void Deserialize(NetworkReader reader) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) netId = reader.ReadNetworkId(); } public void OnReceived() { //IL_0009: Unknown result type (might be due to invalid IL or missing references) if (NetworkServer.active) { return; } GameObject val = ClientScene.FindLocalObject(netId); if (Object.op_Implicit((Object)(object)val) && !Object.op_Implicit((Object)(object)val.GetComponent())) { val.AddComponent(); CharacterBody component = val.GetComponent(); if (Object.op_Implicit((Object)(object)component)) { component.RecalculateStats(); } } } } public static ConfigEntry ConfigMinItems; public static ConfigEntry ConfigMaxItems; public static ConfigEntry ConfigMinGold; public static ConfigEntry ConfigMaxGold; public static ConfigEntry ConfigEliteEventDuration; public static ConfigEntry ConfigAllyMin; public static ConfigEntry ConfigAllyMax; public static ConfigEntry ConfigMinScrap; public static ConfigEntry ConfigMaxScrap; public static ConfigEntry ConfigHighRollerMin; public static ConfigEntry ConfigHighRollerMax; public static ConfigEntry WeightItems; public static ConfigEntry WeightEliteHorde; public static ConfigEntry WeightGoldSteal; public static ConfigEntry WeightGoldGift; public static ConfigEntry WeightBossSpawn; public static ConfigEntry WeightRandomArtifact; public static ConfigEntry WeightEliteEvent; public static ConfigEntry WeightItemScramble; public static ConfigEntry WeightRandomShrine; public static ConfigEntry WeightSpawnAlly; public static ConfigEntry WeightCurseFrailty; public static ConfigEntry WeightActStrength; public static ConfigEntry WeightBigHead; public static ConfigEntry WeightTinyPlayer; public static ConfigEntry WeightMiniEnemies; public static ConfigEntry WeightGiantEnemies; public static ConfigEntry WeightScrapFountain; public static ConfigEntry WeightHighRoller; public static ConfigEntry WeightFightThySelf; public static ConfigEntry WeightMazelTov; public static ConfigEntry WeightMithrix; private static GameObject shrineUseEffect; private static GameObject coinImpactEffect; private static GameObject shadowCloneEncounterPrefab; private static GameObject mithrixMasterPrefab; private static SpawnCard lemurianCard; private static List t1BossCards = new List(); private static List t2BossCards = new List(); private static List t3BossCards = new List(); private static List scavCards = new List(); private static List allyMasterPrefabs = new List(); private static List eliteBuffs = new List(); public static bool EliteEventActive = false; public static float EliteEventTimer = 0f; public static bool BigHeadActive = false; public static float BigHeadTimer = 0f; public static bool MiniEnemiesActive = false; public static bool GiantEnemiesActive = false; public static float SizeEventTimer = 0f; private static bool suppressMessages = false; public override string ArtifactName => "Artifact of Roulette"; public override string ArtifactLangTokenName => "ARTIFACT_ROULETTE"; public override string ArtifactDescription => "Chest interactables become a Roulette. Outcomes range from items, gold, and hordes to scrambling inventory or activating random artifacts."; public override string ArtifactIconName => "Roulette.png"; public override void Hooks() { //IL_053a: Unknown result type (might be due to invalid IL or missing references) //IL_0544: Expected O, but got Unknown //IL_054b: Unknown result type (might be due to invalid IL or missing references) //IL_0555: Expected O, but got Unknown //IL_055c: Unknown result type (might be due to invalid IL or missing references) //IL_0566: Expected O, but got Unknown //IL_056d: Unknown result type (might be due to invalid IL or missing references) //IL_0577: Expected O, but got Unknown //IL_057e: Unknown result type (might be due to invalid IL or missing references) //IL_0588: Expected O, but got Unknown ConfigMinItems = ((BaseUnityPlugin)ArtifactPackPlugin.Instance).Config.Bind("Artifact: Roulette", "Min Items Drop", 1, "Minimum items dropped."); ConfigMaxItems = ((BaseUnityPlugin)ArtifactPackPlugin.Instance).Config.Bind("Artifact: Roulette", "Max Items Drop", 3, "Maximum items dropped."); ConfigMinGold = ((BaseUnityPlugin)ArtifactPackPlugin.Instance).Config.Bind("Artifact: Roulette", "Min Gold Gift", 50, "Minimum gold gift base amount."); ConfigMaxGold = ((BaseUnityPlugin)ArtifactPackPlugin.Instance).Config.Bind("Artifact: Roulette", "Max Gold Gift", 500, "Maximum gold gift base amount."); ConfigEliteEventDuration = ((BaseUnityPlugin)ArtifactPackPlugin.Instance).Config.Bind("Artifact: Roulette", "Elite Event Duration", 60f, "Duration in seconds for the forced Elite spawn event."); ConfigAllyMin = ((BaseUnityPlugin)ArtifactPackPlugin.Instance).Config.Bind("Artifact: Roulette", "Ally Spawn Min", 1, "Minimum number of allies to spawn."); ConfigAllyMax = ((BaseUnityPlugin)ArtifactPackPlugin.Instance).Config.Bind("Artifact: Roulette", "Ally Spawn Max", 6, "Maximum number of allies to spawn."); ConfigMinScrap = ((BaseUnityPlugin)ArtifactPackPlugin.Instance).Config.Bind("Artifact: Roulette", "Min Scrap Drop", 7, "Minimum scrap dropped in the fountain."); ConfigMaxScrap = ((BaseUnityPlugin)ArtifactPackPlugin.Instance).Config.Bind("Artifact: Roulette", "Max Scrap Drop", 10, "Maximum scrap dropped in the fountain."); ConfigHighRollerMin = ((BaseUnityPlugin)ArtifactPackPlugin.Instance).Config.Bind("Artifact: Roulette", "High Roller Min", 3, "Minimum items for High Roller."); ConfigHighRollerMax = ((BaseUnityPlugin)ArtifactPackPlugin.Instance).Config.Bind("Artifact: Roulette", "High Roller Max", 10, "Maximum items for High Roller."); WeightItems = ((BaseUnityPlugin)ArtifactPackPlugin.Instance).Config.Bind("Artifact: Roulette", "Weight: Items", 50f, "Chance for Items."); WeightEliteHorde = ((BaseUnityPlugin)ArtifactPackPlugin.Instance).Config.Bind("Artifact: Roulette", "Weight: Elite Horde", 10f, "Chance for Elite Horde."); WeightGoldSteal = ((BaseUnityPlugin)ArtifactPackPlugin.Instance).Config.Bind("Artifact: Roulette", "Weight: Gold Steal", 10f, "Chance for Gold Loss."); WeightGoldGift = ((BaseUnityPlugin)ArtifactPackPlugin.Instance).Config.Bind("Artifact: Roulette", "Weight: Gold Gift", 10f, "Chance for Gold Gift."); WeightBossSpawn = ((BaseUnityPlugin)ArtifactPackPlugin.Instance).Config.Bind("Artifact: Roulette", "Weight: Boss Spawn", 5f, "Chance for Boss."); WeightRandomArtifact = ((BaseUnityPlugin)ArtifactPackPlugin.Instance).Config.Bind("Artifact: Roulette", "Weight: Random Artifact", 2f, "Chance to permanently activate a random Artifact."); WeightEliteEvent = ((BaseUnityPlugin)ArtifactPackPlugin.Instance).Config.Bind("Artifact: Roulette", "Weight: Elite Event", 5f, "Chance to force all spawns to be Elite for a duration."); WeightItemScramble = ((BaseUnityPlugin)ArtifactPackPlugin.Instance).Config.Bind("Artifact: Roulette", "Weight: Item Scramble", 3f, "Chance to re-roll the player's inventory."); WeightRandomShrine = ((BaseUnityPlugin)ArtifactPackPlugin.Instance).Config.Bind("Artifact: Roulette", "Weight: Random Shrine Effect", 5f, "Chance to mimic a random shrine (Mountain, Chance, Order, Combat)."); WeightSpawnAlly = ((BaseUnityPlugin)ArtifactPackPlugin.Instance).Config.Bind("Artifact: Roulette", "Weight: Spawn Allies", 8f, "Chance to spawn drones or monster allies."); WeightCurseFrailty = ((BaseUnityPlugin)ArtifactPackPlugin.Instance).Config.Bind("Artifact: Roulette", "Weight: Curse of Frailty", 4f, "Chance to halve HP but increase Damage for the stage."); WeightActStrength = ((BaseUnityPlugin)ArtifactPackPlugin.Instance).Config.Bind("Artifact: Roulette", "Weight: Act of Strength", 4f, "Chance to grant random Elite powers to the team temporarily."); WeightBigHead = ((BaseUnityPlugin)ArtifactPackPlugin.Instance).Config.Bind("Artifact: Roulette", "Weight: Big Head Mode", 5f, "Chance to enlarge heads by 75% for 60 seconds."); WeightTinyPlayer = ((BaseUnityPlugin)ArtifactPackPlugin.Instance).Config.Bind("Artifact: Roulette", "Weight: Tiny Player", 5f, "Chance to make the player tiny (0.5x) for 60 seconds."); WeightMiniEnemies = ((BaseUnityPlugin)ArtifactPackPlugin.Instance).Config.Bind("Artifact: Roulette", "Weight: Mini Enemies", 5f, "Chance to make all enemies tiny (0.5x) for 60 seconds."); WeightGiantEnemies = ((BaseUnityPlugin)ArtifactPackPlugin.Instance).Config.Bind("Artifact: Roulette", "Weight: Giant Enemies", 5f, "Chance to make all enemies giant (2.0x) for 60 seconds."); WeightScrapFountain = ((BaseUnityPlugin)ArtifactPackPlugin.Instance).Config.Bind("Artifact: Roulette", "Weight: Scrap Fountain", 10f, "Chance to spawn a fountain of scrap."); WeightHighRoller = ((BaseUnityPlugin)ArtifactPackPlugin.Instance).Config.Bind("Artifact: Roulette", "Weight: High Roller", 7f, "Chance for tiered item fountain."); WeightFightThySelf = ((BaseUnityPlugin)ArtifactPackPlugin.Instance).Config.Bind("Artifact: Roulette", "Weight: Fight Thy Self", 4f, "Chance to spawn a doppelganger."); WeightMazelTov = ((BaseUnityPlugin)ArtifactPackPlugin.Instance).Config.Bind("Artifact: Roulette", "Weight: Mazel Tov", 1f, "Chance to activate nearly ALL effects at once."); WeightMithrix = ((BaseUnityPlugin)ArtifactPackPlugin.Instance).Config.Bind("Artifact: Roulette", "Weight: Command Thee Kneel", 1f, "Tiny chance to spawn Mithrix."); NetworkingAPI.RegisterMessageType(); NetworkingAPI.RegisterMessageType(); NetworkingAPI.RegisterMessageType(); RoR2Application.onLoad = (Action)Delegate.Combine(RoR2Application.onLoad, new Action(LoadAssets)); Run.onRunStartGlobal += ResetRouletteState; Run.onRunDestroyGlobal += ResetRouletteState; PurchaseInteraction.OnInteractionBegin += new hook_OnInteractionBegin(InterceptInteraction); CombatDirector.IsEliteOnlyArtifactActive += new hook_IsEliteOnlyArtifactActive(ForceEliteOnlyIfEventActive); Run.FixedUpdate += new hook_FixedUpdate(Run_FixedUpdate); CharacterBody.Start += new hook_Start(CharacterBody_Start); RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(RecalculateStatsAPI_GetStatCoefficients); } private void ResetRouletteState(Run run) { EliteEventActive = false; BigHeadActive = false; MiniEnemiesActive = false; GiantEnemiesActive = false; EliteEventTimer = 0f; BigHeadTimer = 0f; SizeEventTimer = 0f; suppressMessages = false; } private void LoadAssets() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_004a: 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_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: 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_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_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Unknown result type (might be due to invalid IL or missing references) //IL_01a1: Unknown result type (might be due to invalid IL or missing references) //IL_01a6: Unknown result type (might be due to invalid IL or missing references) //IL_01c7: Unknown result type (might be due to invalid IL or missing references) //IL_01cc: Unknown result type (might be due to invalid IL or missing references) //IL_01e3: Unknown result type (might be due to invalid IL or missing references) //IL_01e8: 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_0204: Unknown result type (might be due to invalid IL or missing references) //IL_021b: Unknown result type (might be due to invalid IL or missing references) //IL_0220: Unknown result type (might be due to invalid IL or missing references) //IL_0237: 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_0253: Unknown result type (might be due to invalid IL or missing references) //IL_0258: Unknown result type (might be due to invalid IL or missing references) //IL_026f: Unknown result type (might be due to invalid IL or missing references) //IL_0274: Unknown result type (might be due to invalid IL or missing references) //IL_028b: Unknown result type (might be due to invalid IL or missing references) //IL_0290: Unknown result type (might be due to invalid IL or missing references) //IL_02a7: Unknown result type (might be due to invalid IL or missing references) //IL_02ac: Unknown result type (might be due to invalid IL or missing references) shrineUseEffect = Addressables.LoadAssetAsync((object)"RoR2/Base/Common/VFX/ShrineUseEffect.prefab").WaitForCompletion(); coinImpactEffect = Addressables.LoadAssetAsync((object)"RoR2/Base/Common/VFX/CoinImpact.prefab").WaitForCompletion(); shadowCloneEncounterPrefab = Addressables.LoadAssetAsync((object)"RoR2/Base/ShadowClone/ShadowCloneEncounter.prefab").WaitForCompletion(); mithrixMasterPrefab = Addressables.LoadAssetAsync((object)"RoR2/Base/Brother/BrotherMaster.prefab").WaitForCompletion(); lemurianCard = Addressables.LoadAssetAsync((object)"RoR2/Base/Lemurian/cscLemurian.asset").WaitForCompletion(); t1BossCards.Clear(); t1BossCards.Add(Addressables.LoadAssetAsync((object)"RoR2/Base/Beetle/cscBeetleQueen.asset").WaitForCompletion()); t1BossCards.Add(Addressables.LoadAssetAsync((object)"RoR2/Base/Vagrant/cscVagrant.asset").WaitForCompletion()); t1BossCards.Add(Addressables.LoadAssetAsync((object)"RoR2/Base/Titan/cscTitanGolemPlains.asset").WaitForCompletion()); t1BossCards.Add(Addressables.LoadAssetAsync((object)"RoR2/Base/ClayBoss/cscClayBoss.asset").WaitForCompletion()); t2BossCards.Clear(); t2BossCards.Add(Addressables.LoadAssetAsync((object)"RoR2/Base/Gravekeeper/cscGravekeeper.asset").WaitForCompletion()); t2BossCards.Add(Addressables.LoadAssetAsync((object)"RoR2/Base/RoboBallBoss/cscRoboBallBoss.asset").WaitForCompletion()); t2BossCards.Add(Addressables.LoadAssetAsync((object)"RoR2/Base/ImpBoss/cscImpBoss.asset").WaitForCompletion()); t2BossCards.Add(Addressables.LoadAssetAsync((object)"RoR2/Base/MagmaWorm/cscMagmaWorm.asset").WaitForCompletion()); t3BossCards.Clear(); t3BossCards.Add(Addressables.LoadAssetAsync((object)"RoR2/Base/Grandparent/cscGrandparent.asset").WaitForCompletion()); scavCards.Clear(); scavCards.Add(Addressables.LoadAssetAsync((object)"RoR2/Base/Scav/cscScav.asset").WaitForCompletion()); allyMasterPrefabs.Clear(); allyMasterPrefabs.Add(Addressables.LoadAssetAsync((object)"RoR2/Base/Drones/Drone1Master.prefab").WaitForCompletion()); allyMasterPrefabs.Add(Addressables.LoadAssetAsync((object)"RoR2/Base/Drones/Drone2Master.prefab").WaitForCompletion()); allyMasterPrefabs.Add(Addressables.LoadAssetAsync((object)"RoR2/Base/Drones/MissileDroneMaster.prefab").WaitForCompletion()); allyMasterPrefabs.Add(Addressables.LoadAssetAsync((object)"RoR2/Base/Drones/FlameDroneMaster.prefab").WaitForCompletion()); allyMasterPrefabs.Add(Addressables.LoadAssetAsync((object)"RoR2/Base/Drones/EmergencyDroneMaster.prefab").WaitForCompletion()); allyMasterPrefabs.Add(Addressables.LoadAssetAsync((object)"RoR2/Base/Lemurian/LemurianMaster.prefab").WaitForCompletion()); allyMasterPrefabs.Add(Addressables.LoadAssetAsync((object)"RoR2/Base/Beetle/BeetleMaster.prefab").WaitForCompletion()); allyMasterPrefabs.Add(Addressables.LoadAssetAsync((object)"RoR2/Base/Imp/ImpMaster.prefab").WaitForCompletion()); allyMasterPrefabs.Add(Addressables.LoadAssetAsync((object)"RoR2/Base/Wisp/WispMaster.prefab").WaitForCompletion()); eliteBuffs.Clear(); if (Object.op_Implicit((Object)(object)Buffs.AffixRed)) { eliteBuffs.Add(Buffs.AffixRed); } if (Object.op_Implicit((Object)(object)Buffs.AffixBlue)) { eliteBuffs.Add(Buffs.AffixBlue); } if (Object.op_Implicit((Object)(object)Buffs.AffixWhite)) { eliteBuffs.Add(Buffs.AffixWhite); } if (Object.op_Implicit((Object)(object)Buffs.AffixPoison)) { eliteBuffs.Add(Buffs.AffixPoison); } if (Object.op_Implicit((Object)(object)Buffs.AffixHaunted)) { eliteBuffs.Add(Buffs.AffixHaunted); } } private void Run_FixedUpdate(orig_FixedUpdate orig, Run self) { orig.Invoke(self); if (EliteEventActive) { EliteEventTimer -= Time.fixedDeltaTime; if (EliteEventTimer <= 0f) { EliteEventActive = false; BroadcastChat("[Roulette] The air calms down. Elite spawning returns to normal."); } } if (BigHeadActive) { BigHeadTimer -= Time.fixedDeltaTime; if (BigHeadTimer <= 0f) { BigHeadActive = false; BroadcastChat("[Roulette] Heads return to normal size."); } } if (MiniEnemiesActive || GiantEnemiesActive) { SizeEventTimer -= Time.fixedDeltaTime; if (SizeEventTimer <= 0f) { MiniEnemiesActive = false; GiantEnemiesActive = false; BroadcastChat("[Roulette] The strange size magic fades..."); } } } private void CharacterBody_Start(orig_Start orig, CharacterBody self) { //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Invalid comparison between Unknown and I4 orig.Invoke(self); if (BigHeadActive && !Object.op_Implicit((Object)(object)((Component)self).GetComponent())) { ((Component)self).gameObject.AddComponent(); } if (Object.op_Implicit((Object)(object)self.teamComponent) && (int)self.teamComponent.teamIndex == 2) { if (MiniEnemiesActive) { ApplySizeModifier(self, 0.5f); } else if (GiantEnemiesActive) { ApplySizeModifier(self, 2f); } } } private void ApplySizeModifier(CharacterBody body, float scaleMultiplier) { if (!Object.op_Implicit((Object)(object)((Component)body).GetComponent())) { ((Component)body).gameObject.AddComponent().targetScale = scaleMultiplier; } } private bool ForceEliteOnlyIfEventActive(orig_IsEliteOnlyArtifactActive orig) { if (EliteEventActive) { return true; } return orig.Invoke(); } private void RecalculateStatsAPI_GetStatCoefficients(CharacterBody sender, StatHookEventArgs args) { if (Object.op_Implicit((Object)(object)((Component)sender).GetComponent())) { args.damageMultAdd += 0.5f; args.healthMultAdd -= 0.5f; } } private void InterceptInteraction(orig_OnInteractionBegin orig, PurchaseInteraction self, Interactor activator) { //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: 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_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Expected O, but got Unknown if (!NetworkServer.active || !Object.op_Implicit((Object)(object)RunArtifactManager.instance) || !RunArtifactManager.instance.IsArtifactEnabled(ArtifactDef)) { orig.Invoke(self, activator); return; } if (!IsRouletteTarget(self)) { orig.Invoke(self, activator); return; } if (!self.available) { orig.Invoke(self, activator); return; } if (!self.CanBeAffordedByInteractor(activator)) { orig.Invoke(self, activator); return; } orig.Invoke(self, activator); CharacterBody component = ((Component)activator).GetComponent(); if (Object.op_Implicit((Object)(object)component)) { RunRouletteLogic(component, ((Component)self).transform.position, ((Component)self).gameObject); if (Object.op_Implicit((Object)(object)shrineUseEffect)) { EffectManager.SpawnEffect(shrineUseEffect, new EffectData { origin = ((Component)self).transform.position, rotation = Quaternion.identity, scale = 1f, color = Color32.op_Implicit(Color.magenta) }, true); } } } private bool IsRouletteTarget(PurchaseInteraction interaction) { GameObject gameObject = ((Component)interaction).gameObject; string name = ((Object)gameObject).name; if (name.Contains("Duplicator")) { return false; } if (name.Contains("VoidChest")) { return false; } if (name.Contains("LockboxVoid")) { return false; } if (Object.op_Implicit((Object)(object)gameObject.GetComponent())) { return false; } if (name.Contains("LunarChest")) { return false; } if (name.Contains("Teleporter")) { return false; } if (name.Contains("Portal")) { return false; } if (name.Contains("Scrapper")) { return false; } if (Object.op_Implicit((Object)(object)gameObject.GetComponent())) { return true; } if (Object.op_Implicit((Object)(object)gameObject.GetComponent())) { return true; } if (Object.op_Implicit((Object)(object)gameObject.GetComponent())) { return true; } return false; } private void RunRouletteLogic(CharacterBody player, Vector3 origin, GameObject sourceObject) { //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_016f: 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_0253: Unknown result type (might be due to invalid IL or missing references) //IL_0304: Unknown result type (might be due to invalid IL or missing references) //IL_0396: Unknown result type (might be due to invalid IL or missing references) //IL_03b9: Unknown result type (might be due to invalid IL or missing references) //IL_03ff: Unknown result type (might be due to invalid IL or missing references) //IL_0433: Unknown result type (might be due to invalid IL or missing references) //IL_0467: Unknown result type (might be due to invalid IL or missing references) suppressMessages = false; float num = WeightItems.Value + WeightEliteHorde.Value + WeightGoldSteal.Value + WeightGoldGift.Value + WeightBossSpawn.Value + WeightRandomArtifact.Value + WeightEliteEvent.Value + WeightItemScramble.Value + WeightRandomShrine.Value + WeightSpawnAlly.Value + WeightCurseFrailty.Value + WeightActStrength.Value + WeightBigHead.Value + WeightTinyPlayer.Value + WeightMiniEnemies.Value + WeightGiantEnemies.Value + WeightScrapFountain.Value + WeightHighRoller.Value + WeightFightThySelf.Value + WeightMazelTov.Value + WeightMithrix.Value; float num2 = Random.Range(0f, num); if (num2 < WeightItems.Value) { SpawnRandomItems(origin, sourceObject); return; } num2 -= WeightItems.Value; if (num2 < WeightEliteHorde.Value) { SpawnEliteHorde(player); return; } num2 -= WeightEliteHorde.Value; if (num2 < WeightGoldSteal.Value) { StealGold(player); return; } num2 -= WeightGoldSteal.Value; if (num2 < WeightGoldGift.Value) { GiftGoldAndItem(player, origin, sourceObject); return; } num2 -= WeightGoldGift.Value; if (num2 < WeightBossSpawn.Value) { SpawnBoss(player); return; } num2 -= WeightBossSpawn.Value; if (num2 < WeightRandomArtifact.Value) { ActivateRandomArtifact(); return; } num2 -= WeightRandomArtifact.Value; if (num2 < WeightEliteEvent.Value) { ActivateEliteEvent(); NetMessageExtensions.Send((INetMessage)(object)new SyncRouletteEvent(0, ConfigEliteEventDuration.Value), (NetworkDestination)1); return; } num2 -= WeightEliteEvent.Value; if (num2 < WeightItemScramble.Value) { ScrambleItems(player); return; } num2 -= WeightItemScramble.Value; if (num2 < WeightRandomShrine.Value) { ActivateRandomShrineEffect(player, origin, sourceObject); return; } num2 -= WeightRandomShrine.Value; if (num2 < WeightSpawnAlly.Value) { SpawnAllies(player, origin); return; } num2 -= WeightSpawnAlly.Value; if (num2 < WeightCurseFrailty.Value) { ApplyCurseOfFrailty(player); return; } num2 -= WeightCurseFrailty.Value; if (num2 < WeightActStrength.Value) { ActivateActOfStrength(player); return; } num2 -= WeightActStrength.Value; if (num2 < WeightBigHead.Value) { ActivateBigHeadMode(); NetMessageExtensions.Send((INetMessage)(object)new SyncRouletteEvent(1, 60f), (NetworkDestination)1); return; } num2 -= WeightBigHead.Value; if (num2 < WeightTinyPlayer.Value) { ActivateTinyPlayer(player); if (Object.op_Implicit((Object)(object)player.networkIdentity)) { NetMessageExtensions.Send((INetMessage)(object)new SyncTinyPlayer(player.networkIdentity.netId), (NetworkDestination)1); } return; } num2 -= WeightTinyPlayer.Value; if (num2 < WeightMiniEnemies.Value) { ActivateEnemySizeEvent(mini: true); NetMessageExtensions.Send((INetMessage)(object)new SyncRouletteEvent(2, 60f), (NetworkDestination)1); return; } num2 -= WeightMiniEnemies.Value; if (num2 < WeightGiantEnemies.Value) { ActivateEnemySizeEvent(mini: false); NetMessageExtensions.Send((INetMessage)(object)new SyncRouletteEvent(3, 60f), (NetworkDestination)1); return; } num2 -= WeightGiantEnemies.Value; if (num2 < WeightScrapFountain.Value) { ActivateScrapFountain(origin, sourceObject); return; } num2 -= WeightScrapFountain.Value; if (num2 < WeightHighRoller.Value) { ActivateHighRoller(origin, sourceObject); return; } num2 -= WeightHighRoller.Value; if (num2 < WeightFightThySelf.Value) { ActivateFightThySelf(player); return; } num2 -= WeightFightThySelf.Value; if (num2 < WeightMazelTov.Value) { ActivateMazelTov(player, origin, sourceObject); NetMessageExtensions.Send((INetMessage)(object)new SyncRouletteEvent(0, ConfigEliteEventDuration.Value), (NetworkDestination)1); NetMessageExtensions.Send((INetMessage)(object)new SyncRouletteEvent(1, 60f), (NetworkDestination)1); NetMessageExtensions.Send((INetMessage)(object)new SyncTinyPlayer(player.networkIdentity.netId), (NetworkDestination)1); } else { num2 -= WeightMazelTov.Value; if (num2 < WeightMithrix.Value) { ActivateMithrixCommand(player); } else { SpawnRandomItems(origin, sourceObject); } } } private void BroadcastChat(string message) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Expected O, but got Unknown if (!suppressMessages && NetworkServer.active) { Chat.SendBroadcastChat((ChatMessageBase)new SimpleChatMessage { baseToken = message }); } } private void SpawnRandomItems(Vector3 position, GameObject sourceObject) { //IL_0037: Unknown result type (might be due to invalid IL or missing references) int num = Random.Range(ConfigMinItems.Value, ConfigMaxItems.Value + 1); BroadcastChat($"[Roulette] JACKPOT! {num} Items!"); for (int i = 0; i < num; i++) { SpawnSingleItem(position, sourceObject); } } private void SpawnSingleItem(Vector3 position, GameObject sourceObject) { //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) List list = Run.instance.availableTier1DropList; float value = Random.value; if (value > 0.95f) { list = Run.instance.availableTier3DropList; } else if (value > 0.8f) { list = Run.instance.availableTier2DropList; } else if (value > 0.65f) { list = Run.instance.availableEquipmentDropList; } if (list.Count > 0) { PickupIndex val = list[Random.Range(0, list.Count)]; Vector3 val2 = Vector3.up * 20f + Random.insideUnitSphere * 5f; Vector3 val3 = position; if (Object.op_Implicit((Object)(object)sourceObject) && Object.op_Implicit((Object)(object)sourceObject.GetComponent())) { val3 += Vector3.up * 3f; val2 = sourceObject.transform.forward * 15f + Vector3.up * 15f; val2 += sourceObject.transform.right * Random.Range(-3f, 3f); } PickupDropletController.CreatePickupDroplet(val, val3, val2); } } private void SpawnEliteHorde(CharacterBody player) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Expected O, but got Unknown //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Expected I4, but got Unknown //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Expected I4, but got Unknown //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Expected I4, but got Unknown //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) BroadcastChat("[Roulette] BAD LUCK! Elite Ambush!"); int num = Random.Range(5, 11); if (!((Object)(object)lemurianCard != (Object)null)) { return; } DirectorSpawnRequest val = new DirectorSpawnRequest(lemurianCard, new DirectorPlacementRule { placementMode = (PlacementMode)1, minDistance = 5f, maxDistance = 25f, spawnOnTarget = ((Component)player).transform }, Run.instance.stageRng); val.teamIndexOverride = (TeamIndex)2; val.ignoreTeamMemberLimit = true; for (int i = 0; i < num; i++) { GameObject val2 = DirectorCore.instance.TrySpawnObject(val); if (Object.op_Implicit((Object)(object)val2)) { CharacterMaster component = val2.GetComponent(); if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component.inventory)) { EquipmentIndex[] array = (EquipmentIndex[])(object)new EquipmentIndex[3] { (EquipmentIndex)(int)Equipment.AffixRed.equipmentIndex, (EquipmentIndex)(int)Equipment.AffixBlue.equipmentIndex, (EquipmentIndex)(int)Equipment.AffixWhite.equipmentIndex }; EquipmentIndex val3 = array[Random.Range(0, array.Length)]; component.inventory.SetEquipment(new EquipmentState(val3, FixedTimeStamp.negativeInfinity, (byte)1, false), 0u); } } } } private void StealGold(CharacterBody player) { //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown if (Object.op_Implicit((Object)(object)player.master)) { uint num = player.master.money / 2; player.master.money = num; BroadcastChat($"[Roulette] BANKRUPTCY! You lost {num} gold."); if (Object.op_Implicit((Object)(object)coinImpactEffect)) { EffectManager.SpawnEffect(coinImpactEffect, new EffectData { origin = player.corePosition, scale = 2f }, true); } } } private void GiftGoldAndItem(CharacterBody player, Vector3 origin, GameObject sourceObject) { //IL_0043: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)player.master)) { float difficultyCoefficient = Run.instance.difficultyCoefficient; uint num = (uint)((float)Random.Range(ConfigMinGold.Value, ConfigMaxGold.Value) * difficultyCoefficient); player.master.GiveMoney(num); SpawnSingleItem(origin, sourceObject); BroadcastChat($"[Roulette] PAYDAY! Received {num} gold and an item."); } } private void SpawnBoss(CharacterBody player) { //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Expected O, but got Unknown //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Expected O, but got Unknown BroadcastChat("[Roulette] JACKPOT? Boss Spawn!"); SpawnCard val = SelectBossCard(Run.instance.treasureRng); if (!((Object)(object)val != (Object)null) || !Object.op_Implicit((Object)(object)shadowCloneEncounterPrefab)) { return; } DirectorPlacementRule val2 = new DirectorPlacementRule { placementMode = (PlacementMode)1, minDistance = 20f, maxDistance = 50f, spawnOnTarget = ((Component)player).transform }; DirectorSpawnRequest val3 = new DirectorSpawnRequest(val, val2, Run.instance.stageRng); val3.teamIndexOverride = (TeamIndex)2; val3.ignoreTeamMemberLimit = true; GameObject val4 = Object.Instantiate(shadowCloneEncounterPrefab); CombatSquad combatSquad = val4.GetComponent(); val3.onSpawnedServer = delegate(SpawnResult result) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)result.spawnedInstance)) { CharacterMaster component = result.spawnedInstance.GetComponent(); if (Object.op_Implicit((Object)(object)component)) { combatSquad.AddMember(component); } } }; if (Object.op_Implicit((Object)(object)DirectorCore.instance.TrySpawnObject(val3))) { NetworkServer.Spawn(val4); } else { Object.Destroy((Object)(object)val4); } } private SpawnCard SelectBossCard(Xoroshiro128Plus rng) { int stageClearCount = Run.instance.stageClearCount; bool flag = t1BossCards.Count > 0; bool flag2 = t2BossCards.Count > 0; bool flag3 = t3BossCards.Count > 0; bool flag4 = scavCards.Count > 0 && stageClearCount >= 5; List list = null; if (stageClearCount < 2) { if (flag) { list = t1BossCards; } else if (flag2) { list = t2BossCards; } } else if (stageClearCount < 4) { if (flag && ((!flag2 && !flag3) || rng.RangeInt(1, 11) < 4)) { list = t1BossCards; } else if (flag2) { list = t2BossCards; } } else if (flag4 && rng.RangeInt(1, 100) <= 5) { list = scavCards; } else { int num = rng.RangeInt(1, 100); list = ((flag && num < 25) ? t1BossCards : ((!flag3 || num < 90) ? t2BossCards : t3BossCards)); } if (list != null && list.Count > 0) { return list[rng.RangeInt(0, list.Count)]; } if (flag) { return t1BossCards[0]; } return null; } private void ScrambleItems(CharacterBody player) { //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Invalid comparison between Unknown and I4 //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Invalid comparison between Unknown and I4 //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Expected I4, but got Unknown //IL_0212: Unknown result type (might be due to invalid IL or missing references) //IL_0217: Unknown result type (might be due to invalid IL or missing references) //IL_0221: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)player.inventory)) { return; } BroadcastChat("[Roulette] SCRAMBLE! Your inventory has been reshuffled!"); List list = new List(); Dictionary dictionary = new Dictionary(); foreach (ItemIndex item in player.inventory.itemAcquisitionOrder) { ItemDef itemDef = ItemCatalog.GetItemDef(item); if (!Object.op_Implicit((Object)(object)itemDef) || (int)itemDef.tier == 5 || (int)itemDef.tier == 3 || itemDef.ContainsTag((ItemTag)10)) { continue; } int itemCount = player.inventory.GetItemCount(item); if (itemCount > 0) { list.Add(item); if (dictionary.ContainsKey(itemDef.tier)) { dictionary[itemDef.tier] += itemCount; } else { dictionary[itemDef.tier] = itemCount; } } } foreach (ItemIndex item2 in list) { player.inventory.RemoveItem(item2, player.inventory.GetItemCount(item2)); } foreach (KeyValuePair item3 in dictionary) { List list2 = null; ItemTier key = item3.Key; switch ((int)key) { case 0: list2 = Run.instance.availableTier1DropList; break; case 1: list2 = Run.instance.availableTier2DropList; break; case 2: list2 = Run.instance.availableTier3DropList; break; case 4: list2 = Run.instance.availableBossDropList; break; case 6: list2 = Run.instance.availableVoidTier1DropList; break; case 7: list2 = Run.instance.availableVoidTier2DropList; break; case 8: list2 = Run.instance.availableVoidTier3DropList; break; case 9: list2 = Run.instance.availableVoidBossDropList; break; } if (list2 != null && list2.Count > 0) { for (int i = 0; i < item3.Value; i++) { PickupIndex val = list2[Random.Range(0, list2.Count)]; player.inventory.GiveItem(((PickupIndex)(ref val)).itemIndex, 1); } } } } private void ActivateRandomShrineEffect(CharacterBody player, Vector3 origin, GameObject sourceObject) { //IL_009c: Unknown result type (might be due to invalid IL or missing references) switch (Random.Range(0, 4)) { case 0: if (Object.op_Implicit((Object)(object)TeleporterInteraction.instance)) { TeleporterInteraction.instance.AddShrineStack(); BroadcastChat("[Roulette] The gods of the mountain are watching... (Mountain Shrine Added)"); } break; case 1: if (Object.op_Implicit((Object)(object)player.inventory)) { BroadcastChat("[Roulette] You have been Sequenced!"); player.inventory.ShrineRestackInventory(Run.instance.treasureRng); } break; case 2: BroadcastChat("[Roulette] You have summoned a challenge!"); SpawnEliteHorde(player); break; case 3: if (Random.value > 0.45f) { BroadcastChat("[Roulette] Chance Shrine: WIN!"); SpawnSingleItem(origin, sourceObject); } else { BroadcastChat("[Roulette] Chance Shrine: FAIL. Try again."); } break; } } private void ActivateMazelTov(CharacterBody player, Vector3 origin, GameObject sourceObject) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown suppressMessages = true; string baseToken = "[Roulette] MAZEL TOV!"; if (NetworkServer.active) { Chat.SendBroadcastChat((ChatMessageBase)new SimpleChatMessage { baseToken = baseToken }); } SpawnRandomItems(origin, sourceObject); SpawnEliteHorde(player); SpawnBoss(player); SpawnAllies(player, origin); GiftGoldAndItem(player, origin, sourceObject); StealGold(player); ActivateActOfStrength(player); ActivateBigHeadMode(); ActivateTinyPlayer(player); ActivateFightThySelf(player); ActivateScrapFountain(origin, sourceObject); ActivateHighRoller(origin, sourceObject); if (Random.value > 0.5f) { ActivateEnemySizeEvent(mini: true); } else { ActivateEnemySizeEvent(mini: false); } ActivateEliteEvent(); suppressMessages = false; } private void ActivateHighRoller(Vector3 origin, GameObject sourceObject) { //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_015b: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_0179: 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_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_0199: Unknown result type (might be due to invalid IL or missing references) //IL_019a: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: 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_01d9: Unknown result type (might be due to invalid IL or missing references) //IL_01db: Unknown result type (might be due to invalid IL or missing references) //IL_01be: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: Unknown result type (might be due to invalid IL or missing references) //IL_01d7: Unknown result type (might be due to invalid IL or missing references) int num = Random.Range(ConfigHighRollerMin.Value, ConfigHighRollerMax.Value + 1); float value = Random.value; List list = null; string text = ""; string text2 = "#FFFFFF"; if (value < 0.5f) { text = "High Roller Basic"; text2 = "#FFFFFF"; list = Run.instance.availableTier1DropList; } else if (value < 0.75f) { text = "High Roller V.I.P"; text2 = "#00FF00"; list = Run.instance.availableTier2DropList; } else if (value < 0.85f) { text = "High Roller Esteemed Guest"; text2 = "#FF0000"; list = Run.instance.availableTier3DropList; } else if (value < 0.95f) { text = "High Roller Blue Moon"; text2 = "#0000FF"; list = Run.instance.availableLunarCombinedDropList; } else { text = "High v01d Roller"; text2 = "#D900FF"; list = new List(); list.AddRange(Run.instance.availableVoidTier1DropList); list.AddRange(Run.instance.availableVoidTier2DropList); list.AddRange(Run.instance.availableVoidTier3DropList); } BroadcastChat($"[Roulette] {text}! {num} items incoming!"); if (list == null || list.Count <= 0) { return; } for (int i = 0; i < num; i++) { PickupIndex val = list[Random.Range(0, list.Count)]; Vector3 val2 = Vector3.up * Random.Range(20f, 30f); Vector3 onUnitSphere = Random.onUnitSphere; onUnitSphere.y = 0f; val2 += ((Vector3)(ref onUnitSphere)).normalized * Random.Range(5f, 10f); Vector3 val3 = origin + Vector3.up * 2f; if (Object.op_Implicit((Object)(object)sourceObject)) { val3 = sourceObject.transform.position + Vector3.up * 2f; } PickupDropletController.CreatePickupDroplet(val, val3, val2); } } private void ActivateFightThySelf(CharacterBody player) { //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_004c: 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_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Expected O, but got Unknown //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Expected O, but got Unknown //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) BroadcastChat("[Roulette] FIGHT THY SELF! A dark reflection appears..."); if (!Object.op_Implicit((Object)(object)player.master)) { return; } SpawnCard val = (SpawnCard)(object)DoppelgangerSpawnCard.FromMaster(player.master); if (!Object.op_Implicit((Object)(object)val)) { return; } Vector3 onUnitSphere = Random.onUnitSphere; onUnitSphere.y = 0f; Vector3 val2 = ((Component)player).transform.position + ((Vector3)(ref onUnitSphere)).normalized * 50f; Vector3 val3 = val2 + Vector3.up * 50f; Vector3 down = Vector3.down; LayerIndex world = LayerIndex.world; RaycastHit val4 = default(RaycastHit); if (Physics.Raycast(val3, down, ref val4, 100f, LayerMask.op_Implicit(((LayerIndex)(ref world)).mask))) { val2 = ((RaycastHit)(ref val4)).point; } DirectorPlacementRule val5 = new DirectorPlacementRule { placementMode = (PlacementMode)0, position = val2 }; DirectorSpawnRequest val6 = new DirectorSpawnRequest(val, val5, Run.instance.stageRng); val6.teamIndexOverride = (TeamIndex)2; val6.ignoreTeamMemberLimit = true; GameObject val7 = Object.Instantiate(shadowCloneEncounterPrefab); CombatSquad combatSquad = val7.GetComponent(); val6.onSpawnedServer = delegate(SpawnResult result) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)result.spawnedInstance)) { CharacterMaster component = result.spawnedInstance.GetComponent(); if (Object.op_Implicit((Object)(object)component)) { if (Object.op_Implicit((Object)(object)component.inventory)) { component.inventory.GiveItem(Items.BoostHp, 10); } combatSquad.AddMember(component); } } }; if (Object.op_Implicit((Object)(object)DirectorCore.instance.TrySpawnObject(val6))) { NetworkServer.Spawn(val7); return; } Object.Destroy((Object)(object)val7); Object.Destroy((Object)(object)val); } private void ActivateMithrixCommand(CharacterBody player) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_008b: 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_009b: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) BroadcastChat("[Roulette] I COMMAND THEE KNEEL! The King of Nothing has arrived."); if (!Object.op_Implicit((Object)(object)mithrixMasterPrefab)) { return; } Vector3 position = Vector3.zero; NodeGraph groundNodes = SceneInfo.instance.groundNodes; if (Object.op_Implicit((Object)(object)groundNodes)) { List list = new List(); groundNodes.FindNodesInRange(Vector3.zero, 100f, 50f, (HullMask)1, list); if (list.Count > 0) { groundNodes.GetNodePosition(list[0], ref position); } else { position = ((Component)player).transform.position + Vector3.up * 10f; } } new MasterSummon { masterPrefab = mithrixMasterPrefab, position = position, ignoreTeamMemberLimit = true, teamIndexOverride = (TeamIndex)2 }.Perform(); } private void ActivateScrapFountain(Vector3 origin, GameObject sourceObject) { //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Invalid comparison between Unknown and I4 //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Invalid comparison between Unknown and I4 //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_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) int num = Random.Range(ConfigMinScrap.Value, ConfigMaxScrap.Value + 1); bool flag = Random.value > 0.5f; ItemIndex val = (flag ? Items.ScrapGreen.itemIndex : Items.ScrapWhite.itemIndex); if ((int)val == -1) { val = Items.ScrapWhite.itemIndex; } if ((int)val == -1) { return; } string arg = (flag ? "#00FF00" : "#FFFFFF"); string arg2 = (flag ? "Green" : "White"); BroadcastChat($"[Roulette] SCRAP SHOWER! {num} pieces of {arg2} Scrap ejected!"); PickupIndex val2 = PickupCatalog.FindPickupIndex(val); for (int i = 0; i < num; i++) { Vector3 val3 = Vector3.up * Random.Range(15f, 25f); Vector3 onUnitSphere = Random.onUnitSphere; onUnitSphere.y = 0f; val3 += ((Vector3)(ref onUnitSphere)).normalized * Random.Range(5f, 15f); Vector3 val4 = origin + Vector3.up * 2f; if (Object.op_Implicit((Object)(object)sourceObject)) { val4 = sourceObject.transform.position + Vector3.up * 2f; } PickupDropletController.CreatePickupDroplet(val2, val4, val3); } } private void ActivateEliteEvent() { EliteEventActive = true; EliteEventTimer = ConfigEliteEventDuration.Value; BroadcastChat($"[Roulette] DANGER! All spawns are Elite for {ConfigEliteEventDuration.Value} seconds!"); } private void ActivateBigHeadMode() { BigHeadActive = true; BigHeadTimer = 60f; BroadcastChat("[Roulette] BIG HEAD MODE! All heads enlarged for 60 seconds!"); foreach (CharacterBody readOnlyInstances in CharacterBody.readOnlyInstancesList) { if (Object.op_Implicit((Object)(object)readOnlyInstances) && !Object.op_Implicit((Object)(object)((Component)readOnlyInstances).GetComponent())) { ((Component)readOnlyInstances).gameObject.AddComponent(); } } } private void ActivateTinyPlayer(CharacterBody player) { BroadcastChat("[Roulette] DOWNSIZING! You feel tiny..."); RouletteSizeBehavior component = ((Component)player).GetComponent(); if (!Object.op_Implicit((Object)(object)component)) { component = ((Component)player).gameObject.AddComponent(); component.targetScale = 0.5f; ((MonoBehaviour)player).StartCoroutine(RemoveComponentAfterDelay((MonoBehaviour)(object)component, 60f)); } } private IEnumerator RemoveComponentAfterDelay(MonoBehaviour component, float delay) { yield return (object)new WaitForSeconds(delay); if (Object.op_Implicit((Object)(object)component)) { Object.Destroy((Object)(object)component); } BroadcastChat("[Roulette] You return to normal size."); } private void ActivateEnemySizeEvent(bool mini) { //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Invalid comparison between Unknown and I4 MiniEnemiesActive = false; GiantEnemiesActive = false; if (mini) { MiniEnemiesActive = true; BroadcastChat("[Roulette] MINI MONSTERS! All enemies are tiny for 60 seconds!"); } else { GiantEnemiesActive = true; BroadcastChat("[Roulette] GIANT MONSTERS! All enemies are giant for 60 seconds!"); } SizeEventTimer = 60f; float scaleMultiplier = (mini ? 0.5f : 2f); foreach (CharacterBody readOnlyInstances in CharacterBody.readOnlyInstancesList) { if (Object.op_Implicit((Object)(object)readOnlyInstances) && Object.op_Implicit((Object)(object)readOnlyInstances.teamComponent) && (int)readOnlyInstances.teamComponent.teamIndex == 2) { ApplySizeModifier(readOnlyInstances, scaleMultiplier); } } } private void SpawnAllies(CharacterBody player, Vector3 origin) { //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) int num = Random.Range(ConfigAllyMin.Value, ConfigAllyMax.Value + 1); BroadcastChat($"[Roulette] Reinforcements have arrived! ({num})"); if (allyMasterPrefabs == null || allyMasterPrefabs.Count == 0) { SpawnSingleItem(origin, null); return; } for (int i = 0; i < num; i++) { GameObject val = allyMasterPrefabs[Random.Range(0, allyMasterPrefabs.Count)]; if (Object.op_Implicit((Object)(object)val)) { new MasterSummon { masterPrefab = val, position = origin + Random.insideUnitSphere * 5f, rotation = Quaternion.identity, summonerBodyObject = ((Component)player).gameObject, ignoreTeamMemberLimit = true, useAmbientLevel = true }.Perform(); } } } private void ApplyCurseOfFrailty(CharacterBody player) { //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)((Component)player).GetComponent())) { ((Component)player).gameObject.AddComponent(); player.RecalculateStats(); if (Object.op_Implicit((Object)(object)player.networkIdentity)) { NetMessageExtensions.Send((INetMessage)(object)new SyncFrailty(player.networkIdentity.netId), (NetworkDestination)1); } if (Object.op_Implicit((Object)(object)player.healthComponent)) { player.healthComponent.Heal(0.1f, default(ProcChainMask), true); } BroadcastChat("[Roulette] CURSE OF FRAILTY! Your vitality is halved, but your power doubles!"); } else { BroadcastChat("[Roulette] You are already Frail. Have some gold instead."); if (Object.op_Implicit((Object)(object)player.master)) { player.master.GiveMoney(100u); } } } private void ActivateActOfStrength(CharacterBody player) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) if (eliteBuffs == null || eliteBuffs.Count == 0) { SpawnSingleItem(Vector3.zero, null); return; } BroadcastChat("[Roulette] ACT OF STRENGTH! You and your allies surge with Elite power!"); BuffDef val = eliteBuffs[Random.Range(0, eliteBuffs.Count)]; foreach (CharacterBody item in CharacterBody.readOnlyInstancesList.Where((CharacterBody b) => Object.op_Implicit((Object)(object)b.teamComponent) && (int)b.teamComponent.teamIndex == 1).ToList()) { item.AddTimedBuff(val, 60f); } } private void ActivateRandomArtifact() { //IL_008c: Unknown result type (might be due to invalid IL or missing references) List list = new List(); for (int i = 0; i < ArtifactCatalog.artifactCount; i++) { ArtifactDef artifactDef = ArtifactCatalog.GetArtifactDef((ArtifactIndex)i); if (Object.op_Implicit((Object)(object)artifactDef) && !RunArtifactManager.instance.IsArtifactEnabled(artifactDef) && (Object)(object)artifactDef != (Object)(object)ArtifactDef) { list.Add(artifactDef); } } if (list.Count > 0) { ArtifactDef val = list[Random.Range(0, list.Count)]; RunArtifactManager.instance.SetArtifactEnabledServer(val, true); BroadcastChat("[Roulette] CHAOS! Artifact of " + val.nameToken + " activated!"); } else { SpawnSingleItem(Vector3.zero, null); } } } public class RouletteFrailtyBehavior : MonoBehaviour { } public class RouletteBigHeadBehavior : MonoBehaviour { private Transform headTransform; private Vector3 originalScale; private bool scaled; public void Start() { //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) CharacterBody component = ((Component)this).GetComponent(); if (!Object.op_Implicit((Object)(object)component)) { return; } ModelLocator modelLocator = component.modelLocator; if (!Object.op_Implicit((Object)(object)modelLocator) || !Object.op_Implicit((Object)(object)modelLocator.modelTransform)) { return; } ChildLocator component2 = ((Component)modelLocator.modelTransform).GetComponent(); if (Object.op_Implicit((Object)(object)component2)) { headTransform = component2.FindChild("Head"); if (Object.op_Implicit((Object)(object)headTransform)) { originalScale = headTransform.localScale; headTransform.localScale = originalScale * 1.75f; scaled = true; } } } public void FixedUpdate() { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0039: 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_0056: Unknown result type (might be due to invalid IL or missing references) if (!RouletteArtifact.BigHeadActive) { Object.Destroy((Object)(object)this); } else if (scaled && Object.op_Implicit((Object)(object)headTransform) && headTransform.localScale != originalScale * 1.75f) { headTransform.localScale = originalScale * 1.75f; } } public void OnDestroy() { //IL_001c: Unknown result type (might be due to invalid IL or missing references) if (scaled && Object.op_Implicit((Object)(object)headTransform)) { headTransform.localScale = originalScale; } } } public class RouletteSizeBehavior : MonoBehaviour { public float targetScale = 1f; private Vector3 originalBodyScale; private Vector3 originalModelScale; private bool scaled; private Transform bodyTransform; private Transform modelTransform; public void Start() { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_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_005d: 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) bodyTransform = ((Component)this).transform; originalBodyScale = bodyTransform.localScale; ModelLocator component = ((Component)this).GetComponent(); if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component.modelTransform)) { modelTransform = component.modelTransform; originalModelScale = modelTransform.localScale; modelTransform.localScale = originalModelScale * targetScale; } bodyTransform.localScale = originalBodyScale * targetScale; scaled = true; } public void FixedUpdate() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) if (scaled) { if (bodyTransform.localScale != originalBodyScale * targetScale) { bodyTransform.localScale = originalBodyScale * targetScale; } if (Object.op_Implicit((Object)(object)modelTransform) && modelTransform.localScale != originalModelScale * targetScale) { modelTransform.localScale = originalModelScale * targetScale; } } } public void OnDestroy() { //IL_001c: 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) if (scaled) { if (Object.op_Implicit((Object)(object)bodyTransform)) { bodyTransform.localScale = originalBodyScale; } if (Object.op_Implicit((Object)(object)modelTransform)) { modelTransform.localScale = originalModelScale; } } } } public class StasisArtifact : ArtifactBase { public static ConfigEntry ConfigAccelerationMult; public override string ArtifactName => "Artifact of Stasis"; public override string ArtifactLangTokenName => "ARTIFACT_STASIS"; public override string ArtifactDescription => "Difficulty timer is frozen. Timer accelerates 10x while Teleporter is charging."; public override string ArtifactIconName => "Stasis.png"; public override void Hooks() { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Expected O, but got Unknown ConfigAccelerationMult = ((BaseUnityPlugin)ArtifactPackPlugin.Instance).Config.Bind("Artifact: Stasis", "Teleporter Time Multiplier", 10f, "How fast the difficulty timer advances while the Teleporter is charging."); Run.FixedUpdate += new hook_FixedUpdate(ManageTimeFlow); } private void ManageTimeFlow(orig_FixedUpdate orig, Run self) { orig.Invoke(self); if (NetworkServer.active && Object.op_Implicit((Object)(object)RunArtifactManager.instance) && RunArtifactManager.instance.IsArtifactEnabled(ArtifactDef)) { bool flag = false; if (Object.op_Implicit((Object)(object)TeleporterInteraction.instance)) { flag = TeleporterInteraction.instance.isCharging; } if (flag) { if (self.isRunStopwatchPaused) { self.SetForcePauseRunStopwatch(false); } float runStopwatch = self.GetRunStopwatch(); float num = ConfigAccelerationMult.Value; if (num < 1f) { num = 1f; } float num2 = Time.fixedDeltaTime * (num - 1f); self.SetRunStopwatch(runStopwatch + num2); } else if (!self.isRunStopwatchPaused) { self.SetForcePauseRunStopwatch(true); } } else if (NetworkServer.active && self.NetworkisRunStopwatchForcePaused && Object.op_Implicit((Object)(object)RunArtifactManager.instance) && !RunArtifactManager.instance.IsArtifactEnabled(ArtifactDef)) { self.SetForcePauseRunStopwatch(false); } } } public class TempestArtifact : ArtifactBase { public static ConfigEntry ConfigBatchSize; public static ConfigEntry ConfigBatchSpawnDelayMin; public static ConfigEntry ConfigBatchSpawnDelayMax; public static ConfigEntry ConfigBaseInterval; public static ConfigEntry ConfigMinInterval; public static ConfigEntry ConfigMultistrikeChance; public static ConfigEntry ConfigMaxMultistrikeDepth; public override string ArtifactName => "Artifact of The Tempest"; public override string ArtifactLangTokenName => "ARTIFACT_TEMPEST"; public override string ArtifactDescription => "A permanent lightning storm rages. Strikes increase in frequency and power over time."; public override string ArtifactIconName => "Tempest.png"; public override void Hooks() { //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Expected O, but got Unknown //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Expected O, but got Unknown ConfigBatchSize = ((BaseUnityPlugin)ArtifactPackPlugin.Instance).Config.Bind("Artifact: Tempest", "Batch Size", 400, "How many lightning bolts are fired in a single storm cycle."); ConfigBatchSpawnDelayMin = ((BaseUnityPlugin)ArtifactPackPlugin.Instance).Config.Bind("Artifact: Tempest", "Batch Spawn Delay Min", 0.005f, "Minimum seconds between individual bolts. Set extremely low for chaos."); ConfigBatchSpawnDelayMax = ((BaseUnityPlugin)ArtifactPackPlugin.Instance).Config.Bind("Artifact: Tempest", "Batch Spawn Delay Max", 0.02f, "Maximum seconds between individual bolts."); ConfigBaseInterval = ((BaseUnityPlugin)ArtifactPackPlugin.Instance).Config.Bind("Artifact: Tempest", "Base Storm Interval", 10f, "Time to wait AFTER a batch finishes."); ConfigMinInterval = ((BaseUnityPlugin)ArtifactPackPlugin.Instance).Config.Bind("Artifact: Tempest", "Minimum Storm Interval", 2f, "Minimum time between storms."); ConfigMultistrikeChance = ((BaseUnityPlugin)ArtifactPackPlugin.Instance).Config.Bind("Artifact: Tempest", "Multistrike Chance", 25f, "Chance for twin strikes."); ConfigMaxMultistrikeDepth = ((BaseUnityPlugin)ArtifactPackPlugin.Instance).Config.Bind("Artifact: Tempest", "Max Multistrike Chain", 2, "Max recursion depth."); Run.onRunStartGlobal += delegate(Run run) { if (Object.op_Implicit((Object)(object)RunArtifactManager.instance) && RunArtifactManager.instance.IsArtifactEnabled(ArtifactDef) && !Object.op_Implicit((Object)(object)((Component)run).gameObject.GetComponent())) { ((Component)run).gameObject.AddComponent(); } }; RunArtifactManager.onArtifactEnabledGlobal += (ArtifactStateChangeDelegate)delegate(RunArtifactManager run, ArtifactDef artifactDef) { if ((Object)(object)artifactDef == (Object)(object)ArtifactDef && !Object.op_Implicit((Object)(object)((Component)run).gameObject.GetComponent())) { ((Component)run).gameObject.AddComponent(); } }; RunArtifactManager.onArtifactDisabledGlobal += (ArtifactStateChangeDelegate)delegate(RunArtifactManager run, ArtifactDef artifactDef) { if ((Object)(object)artifactDef == (Object)(object)ArtifactDef) { TempestController component = ((Component)run).gameObject.GetComponent(); if (Object.op_Implicit((Object)(object)component)) { Object.Destroy((Object)(object)component); } } }; } } public class TempestController : MonoBehaviour { private const float BaseDamage = 400f; private const float WarningDelay = 2.5f; private const float BlastRadius = 8f; private const float VisualDiameter = 16f; private static GameObject strikeEffectPrefab; private static GameObject indicatorPrefab; private static Material indicatorMaterial; private Coroutine mainRoutine; public void Start() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Expected O, but got Unknown //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)strikeEffectPrefab)) { strikeEffectPrefab = Addressables.LoadAssetAsync((object)"RoR2/Base/Lightning/LightningStrikeImpact.prefab").WaitForCompletion(); } if (!Object.op_Implicit((Object)(object)indicatorPrefab)) { indicatorPrefab = Addressables.LoadAssetAsync((object)"RoR2/Base/NearbyDamageBonus/NearbyDamageBonusIndicator.prefab").WaitForCompletion(); } if (Object.op_Implicit((Object)(object)indicatorPrefab) && !Object.op_Implicit((Object)(object)indicatorMaterial)) { Renderer componentInChildren = indicatorPrefab.GetComponentInChildren(); if (Object.op_Implicit((Object)(object)componentInChildren) && Object.op_Implicit((Object)(object)componentInChildren.sharedMaterial)) { indicatorMaterial = new Material(componentInChildren.sharedMaterial); Color val = default(Color); ((Color)(ref val))..ctor(0f, 4f, 4f, 0.6f); if (indicatorMaterial.HasProperty("_TintColor")) { indicatorMaterial.SetColor("_TintColor", val); } else if (indicatorMaterial.HasProperty("_Color")) { indicatorMaterial.SetColor("_Color", val); } else { indicatorMaterial.color = val; } if (indicatorMaterial.HasProperty("_Boost")) { indicatorMaterial.SetFloat("_Boost", 3f); } if (indicatorMaterial.HasProperty("_AlphaBoost")) { indicatorMaterial.SetFloat("_AlphaBoost", 2f); } } } mainRoutine = ((MonoBehaviour)this).StartCoroutine(StormLogicLoop()); } public void OnDestroy() { if (mainRoutine != null) { ((MonoBehaviour)this).StopCoroutine(mainRoutine); } } private IEnumerator StormLogicLoop() { yield return (object)new WaitForSeconds(3f); while (true) { if (!NetworkServer.active || !Object.op_Implicit((Object)(object)Run.instance) || Time.timeScale == 0f) { yield return (object)new WaitForSeconds(1f); continue; } yield return ((MonoBehaviour)this).StartCoroutine(ProcessBatch()); float difficultyCoefficient = Run.instance.difficultyCoefficient; float value = TempestArtifact.ConfigBaseInterval.Value; float value2 = TempestArtifact.ConfigMinInterval.Value; float num = value / Mathf.Sqrt(difficultyCoefficient); num = Mathf.Max(value2, num); yield return (object)new WaitForSeconds(num); } } private IEnumerator ProcessBatch() { if (!Object.op_Implicit((Object)(object)SceneInfo.instance) || !Object.op_Implicit((Object)(object)SceneInfo.instance.groundNodes)) { yield break; } NodeGraph graph = SceneInfo.instance.groundNodes; int batchSize = TempestArtifact.ConfigBatchSize.Value; float minDelay = TempestArtifact.ConfigBatchSpawnDelayMin.Value; float maxDelay = TempestArtifact.ConfigBatchSpawnDelayMax.Value; if (batchSize < 1) { batchSize = 1; } float timeAccumulator = 0f; NodeIndex val = default(NodeIndex); while (batchSize > 0 && Object.op_Implicit((Object)(object)Run.instance)) { timeAccumulator -= Time.deltaTime; int num = 0; while (timeAccumulator <= 0f && batchSize > 0 && num < 500) { Vector3 zero = Vector3.zero; int nodeCount = graph.GetNodeCount(); if (nodeCount > 0) { int num2 = Random.Range(0, nodeCount); ((NodeIndex)(ref val))..ctor(num2); if (graph.GetNodePosition(val, ref zero)) { ((MonoBehaviour)this).StartCoroutine(StrikeSequence(zero, 0)); } } float num3 = Random.Range(minDelay, maxDelay); timeAccumulator += num3; batchSize--; num++; } if (timeAccumulator < -1f) { timeAccumulator = 0f; } yield return null; } } private IEnumerator StrikeSequence(Vector3 position, int currentDepth) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) GameObject indicator = null; if (Object.op_Implicit((Object)(object)indicatorPrefab)) { indicator = Object.Instantiate(indicatorPrefab, position, Quaternion.identity); if (Object.op_Implicit((Object)(object)indicatorMaterial)) { Renderer[] componentsInChildren = indicator.GetComponentsInChildren(); for (int i = 0; i < componentsInChildren.Length; i++) { componentsInChildren[i].material = indicatorMaterial; } } indicator.transform.localScale = Vector3.zero; } for (float elapsed = 0f; elapsed < 2.5f; elapsed += Time.deltaTime) { if (Object.op_Implicit((Object)(object)indicator)) { float num = elapsed / 2.5f; float num2 = Mathf.Lerp(0f, 16f, num); indicator.transform.localScale = Vector3.one * num2; } yield return null; } if (Object.op_Implicit((Object)(object)indicator)) { Object.Destroy((Object)(object)indicator); } if (Object.op_Implicit((Object)(object)strikeEffectPrefab)) { EffectManager.SpawnEffect(strikeEffectPrefab, new EffectData { origin = position, scale = 8f }, true); } if (NetworkServer.active) { float baseDamage = 400f * Run.instance.difficultyCoefficient; new BlastAttack { attacker = null, inflictor = null, teamIndex = (TeamIndex)(-1), baseDamage = baseDamage, baseForce = 2000f, position = position, radius = 8f, falloffModel = (FalloffModel)0, damageType = DamageTypeCombo.op_Implicit((DamageType)16777216) }.Fire(); } if (currentDepth >= TempestArtifact.ConfigMaxMultistrikeDepth.Value) { yield break; } float value = TempestArtifact.ConfigMultistrikeChance.Value; if (Random.Range(0f, 100f) <= value) { Vector2 val = Random.insideUnitCircle * 8f * 1.5f; Vector3 val2 = position + new Vector3(val.x, 5f, val.y); Vector3 down = Vector3.down; LayerIndex world = LayerIndex.world; RaycastHit val3 = default(RaycastHit); if (Physics.Raycast(val2, down, ref val3, 20f, LayerMask.op_Implicit(((LayerIndex)(ref world)).mask))) { ((MonoBehaviour)this).StartCoroutine(StrikeSequence(((RaycastHit)(ref val3)).point, currentDepth + 1)); } } } } }