Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of EquationInvasion v1.1.2
plugins/EquationInvasion/EquationInvasion.dll
Decompiled 2 days agousing System; using System.Diagnostics; using System.IO; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using R2API; using R2API.Utils; using RoR2; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.Networking; using UnityEngine.SceneManagement; [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("EquationInvasion")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.1.2.0")] [assembly: AssemblyInformationalVersion("1.1.2")] [assembly: AssemblyProduct("EquationInvasion")] [assembly: AssemblyTitle("EquationInvasion")] [assembly: AssemblyVersion("1.1.2.0")] namespace EquationInvasion; internal enum MathEnemyKind { Derivative, Eigen, Integral } internal static class EnemyVariantsSystem { public static void Scan() { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Invalid comparison between Unknown and I4 CharacterBody[] array = Object.FindObjectsOfType<CharacterBody>(); foreach (CharacterBody val in array) { if ((Object)(object)val == (Object)null || (Object)(object)val.teamComponent == (Object)null || (int)val.teamComponent.teamIndex != 2 || (Object)(object)((Component)val).GetComponent<MathEnemy>() != (Object)null) { continue; } string name = ((Object)((Component)val).gameObject).name; MathEnemyKind kind; if (name.StartsWith("LemurianBody")) { kind = MathEnemyKind.Derivative; } else if (name.StartsWith("GolemBody")) { kind = MathEnemyKind.Eigen; } else { if (!name.StartsWith("WispBody")) { continue; } kind = MathEnemyKind.Integral; } ((Component)val).gameObject.AddComponent<MathEnemy>().Initialize(val, kind); } } } internal sealed class MathEnemy : MonoBehaviour { private CharacterBody body; private float nextPulse; private TextMesh headline; private Transform orbit; private float warningUntil; private Color color; public MathEnemyKind Kind { get; private set; } public void Initialize(CharacterBody character, MathEnemyKind kind) { //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Expected O, but got Unknown //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_0193: 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_01bf: Unknown result type (might be due to invalid IL or missing references) body = character; Kind = kind; float num = kind switch { MathEnemyKind.Integral => 2.1f, MathEnemyKind.Eigen => 4.2f, _ => 2.5f, }; string text = kind switch { MathEnemyKind.Eigen => "lambda EIGEN GOLEM", MathEnemyKind.Derivative => "d/dx CHAIN STALKER", _ => "INTEGRAL WISP", }; color = (Color)(kind switch { MathEnemyKind.Eigen => new Color(0.8f, 0.38f, 1f), MathEnemyKind.Derivative => new Color(1f, 0.43f, 0.2f), _ => new Color(0.13f, 0.86f, 1f), }); MathVisuals.TintMeshRenderers(((Component)this).gameObject, color); headline = MathVisuals.Label(((Component)this).transform, text, new Vector3(0f, num, 0f), color, 0.18f); GameObject val = new GameObject("Equation_Orbit"); val.transform.SetParent(((Component)this).transform, false); val.transform.localPosition = new Vector3(0f, num * 0.6f, 0f); val.AddComponent<SlowSpin>().Speed = ((kind == MathEnemyKind.Eigen) ? 55f : 90f); orbit = val.transform; for (int i = 0; i < 4; i++) { float num2 = (float)i * MathF.PI * 0.5f; float num3 = ((kind == MathEnemyKind.Eigen) ? 1.8f : 0.9f); MathVisuals.Cuboid(orbit, new Vector3(Mathf.Cos(num2) * num3, 0f, Mathf.Sin(num2) * num3), new Vector3(0.1f, 0.1f, 0.58f), color, "Equation_Particle").transform.localRotation = Quaternion.Euler(15f, num2 * 57.29578f, 20f); } nextPulse = Time.fixedTime + ((kind == MathEnemyKind.Eigen) ? 10f : 8f); body.RecalculateStats(); } private void FixedUpdate() { //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)body == (Object)null) && !((Object)(object)body.healthComponent == (Object)null) && body.healthComponent.alive && EquationInvasionPlugin.EnemyPulses.Value && NetworkServer.active && !(Time.fixedTime < nextPulse)) { float num = ((Kind == MathEnemyKind.Eigen) ? 12f : ((Kind == MathEnemyKind.Integral) ? 9f : 8f)); nextPulse = Time.fixedTime + num; float radius = ((Kind == MathEnemyKind.Eigen) ? 12f : 7.5f); new BlastAttack { attacker = ((Component)body).gameObject, inflictor = ((Component)body).gameObject, teamIndex = (TeamIndex)2, position = body.corePosition, radius = radius, baseDamage = body.damage * Mathf.Max(0f, EquationInvasionPlugin.PulseDamage.Value), baseForce = 250f, procCoefficient = 0f, crit = false, falloffModel = (FalloffModel)1, attackerFiltering = (AttackerFiltering)2 }.Fire(); } } } [BepInPlugin("com.mathmayhem.equationinvasion", "Equation Invasion", "1.1.2")] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [NetworkCompatibility(/*Could not decode attribute arguments.*/)] public sealed class EquationInvasionPlugin : BaseUnityPlugin { public const string GUID = "com.mathmayhem.equationinvasion"; public static EquationInvasionPlugin Instance; internal static ManualLogSource Log; public static ConfigEntry<bool> EnemyVariants; public static ConfigEntry<bool> EnemyPulses; public static ConfigEntry<bool> Chests; public static ConfigEntry<bool> Shops; public static ConfigEntry<bool> GuaranteedBazaarItem; public static ConfigEntry<float> PulseDamage; public static ConfigEntry<float> EnemyScanInterval; private float nextScan; private int lastBazaarScene = int.MinValue; private bool shopStocked; private void Awake() { //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Expected O, but got Unknown Instance = this; Log = ((BaseUnityPlugin)this).Logger; EnemyVariants = ((BaseUnityPlugin)this).Config.Bind<bool>("Enemies", "EnableMathEnemyVariants", true, "Convert vanilla Lemurians, Stone Golems and Wisps into math-themed enemy variants. No new asset bundle needed."); EnemyPulses = ((BaseUnityPlugin)this).Config.Bind<bool>("Enemies", "EnableMathShockwaves", true, "The themed enemies use additional server-owned AoE pulses."); PulseDamage = ((BaseUnityPlugin)this).Config.Bind<float>("Enemies", "ShockwaveDamageMultiplier", 1f, "Damage of math shockwaves relative to each enemy's damage stat."); EnemyScanInterval = ((BaseUnityPlugin)this).Config.Bind<float>("Performance", "ScanIntervalSeconds", 2.5f, "How often to discover newly spawned enemies and shops (minimum 0.5 seconds)."); Chests = ((BaseUnityPlugin)this).Config.Bind<bool>("Visuals", "ReskinChests", true, "Tint chests and add math-themed geometry and labels."); Shops = ((BaseUnityPlugin)this).Config.Bind<bool>("Visuals", "ReskinMultishops", true, "Tint multishop terminals and add matrix decals."); GuaranteedBazaarItem = ((BaseUnityPlugin)this).Config.Bind<bool>("Lunar item", "AlwaysStockOneAtNewt", true, "On entering the Bazaar, replace one unpurchased Lunar Bud's stock with Riemann's Revenge (server only). Other Lunar Buds stay normal."); LunarItem.Register(); LunarItem.EnableDamageTracking(); RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(OnRecalculateStats); SceneManager.activeSceneChanged += SceneChanged; ((BaseUnityPlugin)this).Logger.LogInfo((object)"Equation Invasion initialized (multiplayer: all players must have this mod)."); } private void OnDestroy() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected O, but got Unknown LunarItem.DisableDamageTracking(); RecalculateStatsAPI.GetStatCoefficients -= new StatHookEventHandler(OnRecalculateStats); SceneManager.activeSceneChanged -= SceneChanged; } private void SceneChanged(Scene oldScene, Scene newScene) { nextScan = 0f; if (((Scene)(ref newScene)).handle != lastBazaarScene) { lastBazaarScene = ((Scene)(ref newScene)).handle; shopStocked = false; } } private void Update() { //IL_0098: 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) if ((Object)(object)Run.instance == (Object)null || Time.unscaledTime < nextScan) { return; } nextScan = Time.unscaledTime + Mathf.Max(0.5f, EnemyScanInterval.Value); if (EnemyVariants.Value) { EnemyVariantsSystem.Scan(); } if (Chests.Value || Shops.Value) { InteractableSkins.Scan(Chests.Value, Shops.Value); } if (GuaranteedBazaarItem.Value && !shopStocked && NetworkServer.active) { Scene activeScene = SceneManager.GetActiveScene(); if (((Scene)(ref activeScene)).name.Equals("bazaar", StringComparison.OrdinalIgnoreCase)) { shopStocked = LunarItem.TryStockOneBazaarBud(); } } } private static void OnRecalculateStats(CharacterBody sender, StatHookEventArgs stats) { if ((Object)(object)sender == (Object)null) { return; } if ((Object)(object)LunarItem.Def != (Object)null && (Object)(object)sender.inventory != (Object)null) { int itemCountEffective = sender.inventory.GetItemCountEffective(LunarItem.Def); if (itemCountEffective > 0) { stats.attackSpeedMultAdd -= LunarItem.AttackSpeedPenalty(itemCountEffective); } } MathEnemy component = ((Component)sender).GetComponent<MathEnemy>(); if (!((Object)(object)component == (Object)null)) { switch (component.Kind) { case MathEnemyKind.Derivative: stats.moveSpeedMultAdd += 0.22f; stats.attackSpeedMultAdd += 0.15f; break; case MathEnemyKind.Eigen: stats.healthMultAdd += 0.4f; stats.damageMultAdd += 0.22f; break; case MathEnemyKind.Integral: stats.attackSpeedMultAdd += 0.25f; stats.armorAdd += 12f; break; } } } } internal static class InteractableSkins { public static void Scan(bool doChests, bool doShops) { PurchaseInteraction[] array = Object.FindObjectsOfType<PurchaseInteraction>(); foreach (PurchaseInteraction val in array) { if (Object.op_Implicit((Object)(object)val) && !((Object)(object)((Component)val).GetComponent<EquationPainted>() != (Object)null)) { string name = ((Object)((Component)val).gameObject).name; bool num = name.StartsWith("Chest1") || name.StartsWith("Chest2") || name.StartsWith("GoldChest") || name.StartsWith("CategoryChest") || name.StartsWith("CasinoChest"); bool flag = name.StartsWith("MultiShop") || ((Object)(object)((Component)val).GetComponent<ShopTerminalBehavior>() != (Object)null && ((Object)(object)((Component)val).GetComponent<ShopTerminalBehavior>().serverMultiShopController != (Object)null || (Object)(object)((Component)((Component)val).GetComponent<ShopTerminalBehavior>()).GetComponentInParent<MultiShopController>() != (Object)null)); if (num && doChests) { Decorate(((Component)val).gameObject, isShop: false); } else if (flag && doShops) { Decorate(((Component)val).gameObject, isShop: true); } } } } private static void Decorate(GameObject target, bool isShop) { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_002d: 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_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Expected O, but got Unknown //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_0118: 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) Color color = (isShop ? new Color(0.16f, 0.75f, 1f) : new Color(0.92f, 0.28f, 0.9f)); MathVisuals.TintMeshRenderers(target, color); target.AddComponent<EquationPainted>(); GameObject val = new GameObject(isShop ? "MATRIX_VENDOR_SKIN" : "INTEGRAL_CHEST_SKIN"); val.transform.SetParent(target.transform, false); val.transform.localPosition = new Vector3(0f, isShop ? 1.1f : 0.75f, 0f); val.AddComponent<SlowSpin>().Speed = (isShop ? 18f : (-12f)); string text = (isShop ? "[ 1 0 ] [ 0 1 ]" : "INT f(x) dx"); MathVisuals.Label(val.transform, text, new Vector3(0f, 0.55f, 0f), color, 0.13f); for (int i = 0; i < 4; i++) { float num = (float)i * MathF.PI / 2f; MathVisuals.Cuboid(val.transform, new Vector3(Mathf.Cos(num) * 0.65f, 0f, Mathf.Sin(num) * 0.65f), new Vector3(0.12f, 0.06f, 0.4f), color, "MathTrim"); } } } internal sealed class EquationPainted : MonoBehaviour { } internal static class LunarItem { private const string ItemToken = "EQUATION_INVASION_RIEMANN"; public const float WindowSeconds = 6f; public static ItemDef Def { get; private set; } public static int Count(CharacterBody body) { if (!((Object)(object)body != (Object)null) || !((Object)(object)body.inventory != (Object)null) || !((Object)(object)Def != (Object)null)) { return 0; } return body.inventory.GetItemCountEffective(Def); } public static float BlastMultiplier(int stacks) { return 0.5f + 0.15f * (float)Mathf.Max(0, stacks - 1); } public static float AttackSpeedPenalty(int stacks) { return Mathf.Min(0.7f, 0.15f + 0.15f * (float)Mathf.Max(0, stacks - 1)); } public static float BlastRadius(int stacks) { return 16f + 4f * (float)Mathf.Max(0, stacks - 1); } public static void Register() { //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Expected O, but got Unknown LanguageAPI.Add("EQUATION_INVASION_RIEMANN_NAME", "Riemann's Revenge"); LanguageAPI.Add("EQUATION_INVASION_RIEMANN_PICKUP", "Integrate damage over time, then unleash it all at once. But your attacks are slower."); LanguageAPI.Add("EQUATION_INVASION_RIEMANN_DESC", "For each <style=cIsDamage>6-second interval</style> after your first hit, accumulate direct hit damage (<style=cIsUtility>A = sum of damage dealt</style>). At the end of the interval, unleash a <style=cIsDamage>16m blast</style> dealing <style=cIsDamage>50% of accumulated damage</style> <style=cStack>(+15 percentage points and +4m radius per stack)</style>. <style=cIsHealth>Reduce attack speed by 15%</style> <style=cStack>(+15 percentage points per stack, penalty capped at 70%)</style>. Blast damage cannot trigger other on-hit items or re-enter the sum."); LanguageAPI.Add("EQUATION_INVASION_RIEMANN_LORE", "The professor promised an integral was simply the area under a curve. Newt asked how much area lay beneath a mountain of corpses. \n\nIntegral_0^6 D(t) dt = sum(d_i).\n\nThere was a long silence, followed by a very bright explosion."); CustomItem val = new CustomItem("EquationInvasion_RiemannsRevenge", "EQUATION_INVASION_RIEMANN_NAME", "EQUATION_INVASION_RIEMANN_DESC", "EQUATION_INVASION_RIEMANN_LORE", "EQUATION_INVASION_RIEMANN_PICKUP", LoadIcon(), MakePickupModel(), (ItemTag[])(object)new ItemTag[2] { (ItemTag)1, (ItemTag)4 }, (ItemTier)3, false, true, (UnlockableDef)null, (ItemDisplayRule[])null); if (!ItemAPI.Add(val)) { EquationInvasionPlugin.Log.LogError((object)"Riemann's Revenge registration failed."); } Def = val.ItemDef; } public static void EnableDamageTracking() { GlobalEventManager.onServerDamageDealt += OnServerDamageDealt; } public static void DisableDamageTracking() { GlobalEventManager.onServerDamageDealt -= OnServerDamageDealt; } private static void OnServerDamageDealt(DamageReport report) { //IL_008f: 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) if (!NetworkServer.active || report == null || (Object)(object)report.attackerBody == (Object)null || (Object)(object)report.victimBody == (Object)null || report.damageInfo.procCoefficient <= 0f || report.damageDealt <= 0f || float.IsNaN(report.damageDealt) || float.IsInfinity(report.damageDealt)) { return; } CharacterBody attackerBody = report.attackerBody; if (!((Object)(object)attackerBody.teamComponent == (Object)null) && !((Object)(object)report.victimBody.teamComponent == (Object)null) && attackerBody.teamComponent.teamIndex != report.victimBody.teamComponent.teamIndex && Count(attackerBody) > 0) { RiemannAccumulator riemannAccumulator = ((Component)attackerBody).GetComponent<RiemannAccumulator>(); if ((Object)(object)riemannAccumulator == (Object)null) { riemannAccumulator = ((Component)attackerBody).gameObject.AddComponent<RiemannAccumulator>(); } riemannAccumulator.Record(report.damageDealt); } } private static Sprite LoadIcon() { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Expected O, but got Unknown //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0077: 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_00b6: Unknown result type (might be due to invalid IL or missing references) string path = Path.Combine(Path.GetDirectoryName(typeof(EquationInvasionPlugin).Assembly.Location), "riemann_icon.png"); Texture2D val = new Texture2D(2, 2, (TextureFormat)4, false); if (File.Exists(path)) { ImageConversion.LoadImage(val, File.ReadAllBytes(path)); } else { val.SetPixels((Color[])(object)new Color[4] { Color.cyan, Color.blue, Color.cyan, Color.magenta }); val.Apply(); } ((Texture)val).filterMode = (FilterMode)1; return Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), new Vector2(0.5f, 0.5f), 100f); } private static GameObject MakePickupModel() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown //IL_0020: 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_003b: Expected O, but got Unknown //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: 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_0108: Unknown result type (might be due to invalid IL or missing references) //IL_017c: Unknown result type (might be due to invalid IL or missing references) //IL_0190: 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_01dd: Unknown result type (might be due to invalid IL or missing references) //IL_01f1: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("RiemannsRevengeIntegralPickup"); val.transform.position = new Vector3(0f, -10000f, 0f); Object.DontDestroyOnLoad((Object)(object)val); GameObject val2 = new GameObject("Integral_Riemann_Sum_Rig"); val2.transform.SetParent(val.transform, false); val2.AddComponent<SlowSpin>().Speed = 22f; MathVisuals.Cuboid(val2.transform, Vector3.zero, new Vector3(0.4f, 0.08f, 0.4f), new Color(0.1f, 0.22f, 0.75f), "Integral_Base"); for (int i = 0; i < 8; i++) { float num = -0.7f + (float)i * 0.2f; float num2 = 0.2f + 0.37f * (1.2f + Mathf.Sin((float)i * 0.67f)); MathVisuals.Cuboid(val2.transform, new Vector3(num, num2 * 0.5f, 0f), new Vector3(0.16f, num2, 0.16f), new Color(0.13f, 0.75f, 1f), "RiemannRectangle"); } for (int j = 0; j < 12; j++) { float num3 = (float)j / 11f * 2f - 1f; float num4 = 0.92f + 0.14f * Mathf.Sin(num3 * MathF.PI); float num5 = 0.5f + num3 * 0.68f; MathVisuals.Cuboid(val2.transform, new Vector3(num4, num5, -0.05f), new Vector3(0.1f, 0.16f, 0.1f), new Color(0.75f, 0.39f, 1f), "IntegralStroke"); } MathVisuals.Label(val2.transform, "SUM d_i", new Vector3(0f, 1.1f, 0f), new Color(0.68f, 0.92f, 1f), 0.14f); return val; } public static bool TryStockOneBazaarBud() { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Invalid comparison between Unknown and I4 //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_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) if (!NetworkServer.active || (Object)(object)Def == (Object)null || (int)Def.itemIndex == -1) { return false; } PickupIndex val = PickupCatalog.FindPickupIndex(Def.itemIndex); if (val == PickupIndex.none) { return false; } ShopTerminalBehavior[] array = Object.FindObjectsOfType<ShopTerminalBehavior>(); foreach (ShopTerminalBehavior val2 in array) { if (!Object.op_Implicit((Object)(object)val2) || !((Object)((Component)val2).gameObject).name.StartsWith("LunarShopTerminal")) { continue; } PurchaseInteraction component = ((Component)val2).GetComponent<PurchaseInteraction>(); if (!((Object)(object)component == (Object)null) && component.available) { try { val2.SetPickup(new UniquePickup(val), false); EquationInvasionPlugin.Log.LogInfo((object)"Stocked Riemann's Revenge in Newt's Bazaar."); return true; } catch (Exception ex) { EquationInvasionPlugin.Log.LogWarning((object)("Bazaar stock couldn't be forced: " + ex.Message)); return true; } } } return false; } } internal sealed class RiemannAccumulator : MonoBehaviour { private CharacterBody owner; private float damageSum; private float deadline; private bool integrating; public void Record(float damage) { if (!NetworkServer.active) { return; } if ((Object)(object)owner == (Object)null) { owner = ((Component)this).GetComponent<CharacterBody>(); } if (!((Object)(object)owner == (Object)null) && LunarItem.Count(owner) > 0) { if (!integrating) { integrating = true; deadline = Time.fixedTime + 6f; } damageSum = Mathf.Min(damageSum + damage, Mathf.Max(1f, owner.damage * 200f)); } } private void FixedUpdate() { //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: 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_0105: 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_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) if (!NetworkServer.active) { return; } if ((Object)(object)owner == (Object)null) { owner = ((Component)this).GetComponent<CharacterBody>(); } if ((Object)(object)owner == (Object)null || (Object)(object)owner.healthComponent == (Object)null || !owner.healthComponent.alive || LunarItem.Count(owner) <= 0) { damageSum = 0f; integrating = false; } else if (integrating && Time.fixedTime >= deadline) { float num = damageSum; damageSum = 0f; integrating = false; if (!(num <= 0f) && !((Object)(object)owner.teamComponent == (Object)null)) { int stacks = LunarItem.Count(owner); new BlastAttack { attacker = ((Component)owner).gameObject, inflictor = ((Component)owner).gameObject, teamIndex = owner.teamComponent.teamIndex, position = owner.corePosition, radius = LunarItem.BlastRadius(stacks), baseDamage = num * LunarItem.BlastMultiplier(stacks), baseForce = 220f, procCoefficient = 0f, crit = false, falloffModel = (FalloffModel)0, attackerFiltering = (AttackerFiltering)2 }.Fire(); } } } } internal static class MathVisuals { private static Shader shader; private static Shader LoadShader() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) Shader val = null; try { val = Addressables.LoadAssetAsync<Shader>((object)"RoR2/Base/Shaders/HGStandard.shader").WaitForCompletion(); } catch (Exception ex) { EquationInvasionPlugin.Log.LogWarning((object)("HGStandard shader unavailable, using fallbacks: " + ex.Message)); } if (!Object.op_Implicit((Object)(object)val)) { val = Shader.Find("Hopoo Games/Deferred/Standard"); } if (!Object.op_Implicit((Object)(object)val)) { val = Shader.Find("Standard"); } if (!Object.op_Implicit((Object)(object)val)) { val = Shader.Find("Unlit/Color"); } if (!Object.op_Implicit((Object)(object)val)) { val = Shader.Find("Sprites/Default"); } return val; } public static Material Material(Color color) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Expected O, but got Unknown //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)shader)) { shader = LoadShader(); } Material val = new Material(shader); val.color = color; if (val.HasProperty("_EmissionColor")) { val.EnableKeyword("_EMISSION"); val.SetColor("_EmissionColor", color * 0.6f); } return val; } public static GameObject Cuboid(Transform parent, Vector3 localPosition, Vector3 localScale, Color color, string name) { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) GameObject obj = GameObject.CreatePrimitive((PrimitiveType)3); ((Object)obj).name = name; obj.transform.SetParent(parent, false); obj.transform.localPosition = localPosition; obj.transform.localScale = localScale; Collider component = obj.GetComponent<Collider>(); if ((Object)(object)component != (Object)null) { component.enabled = false; Object.Destroy((Object)(object)component); } obj.GetComponent<Renderer>().material = Material(color); return obj; } public static TextMesh Label(Transform parent, string text, Vector3 localPosition, Color color, float charSize = 0.16f, int fontSize = 38) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown //IL_0024: 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) GameObject val = new GameObject("MathGlyph_" + text); val.transform.SetParent(parent, false); val.transform.localPosition = localPosition; TextMesh obj = val.AddComponent<TextMesh>(); obj.text = text; obj.fontSize = fontSize; obj.characterSize = charSize; obj.color = color; obj.anchor = (TextAnchor)4; obj.alignment = (TextAlignment)1; val.AddComponent<MathBillboard>(); return obj; } public static void TintMeshRenderers(GameObject obj, Color color) { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Expected O, but got Unknown //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) Renderer[] componentsInChildren = obj.GetComponentsInChildren<Renderer>(true); foreach (Renderer val in componentsInChildren) { if (val is MeshRenderer || val is SkinnedMeshRenderer) { MaterialPropertyBlock val2 = new MaterialPropertyBlock(); val.GetPropertyBlock(val2); val2.SetColor("_Color", color); val2.SetColor("_EmissionColor", color * 0.35f); val.SetPropertyBlock(val2); } } } } internal sealed class MathBillboard : MonoBehaviour { private void LateUpdate() { //IL_001a: Unknown result type (might be due to invalid IL or missing references) Camera main = Camera.main; if (Object.op_Implicit((Object)(object)main)) { ((Component)this).transform.rotation = ((Component)main).transform.rotation; } } } internal sealed class SlowSpin : MonoBehaviour { public float Speed = 40f; private void Update() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) ((Component)this).transform.Rotate(Vector3.up, Speed * Time.deltaTime, (Space)1); } }