using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Serialization; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using ExitGames.Client.Photon; using HarmonyLib; using Microsoft.CodeAnalysis; using Photon.Pun; using Photon.Realtime; using REPOLib.Modules; using REPOLib.Objects.Sdk; using TMPro; using UnityEngine; using UnityEngine.Networking; using UnityEngine.SceneManagement; 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: IgnoresAccessChecksTo("")] [assembly: AssemblyCompany("Empress")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("TheElevator")] [assembly: AssemblyTitle("TheElevator")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace Empress.REPO.TheElevator { internal enum EmpressElevatorEventKind { ConfettiBloom, HealingRain, LanternOrbit, PrismGarden, SpotlightParade, HeartPageant, GiftPulse, CylinderChoir, BubbleDrift, CalmAurora, TreasureDrizzle, MoonBounce, SoloErrand, TeamTrial, LaserSweep, DirectiveTrial, RollingOrbs, CeilingPress, SpikeLattice, ShockRing, SeekerOrbs, BounceBombs, SawSweep, MeteorDrop, PulseWall, FreezeTag, MarathonPanic, GravityFlip, DoNotTurnAround } internal sealed class EmpressElevatorFloorDefinition { internal int DefinitionIndex { get; } internal string Name { get; } internal EmpressElevatorEventKind Kind { get; } internal bool Hostile { get; } internal float EventDuration { get; } internal int Count { get; } internal float Speed { get; } internal float Size { get; } internal int Power { get; } internal Color PrimaryColor { get; } internal Color SecondaryColor { get; } internal EmpressElevatorFloorDefinition(int definitionIndex, string name, EmpressElevatorEventKind kind, bool hostile, float eventDuration, int count, float speed, float size, int power, Color primaryColor, Color secondaryColor) { //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) DefinitionIndex = definitionIndex; Name = name; Kind = kind; Hostile = hostile; EventDuration = eventDuration; Count = count; Speed = speed; Size = size; Power = power; PrimaryColor = primaryColor; SecondaryColor = secondaryColor; } } internal static class EmpressElevatorFloorCatalog { internal static IReadOnlyList Build() { //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_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_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_00e3: 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_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_0119: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Unknown result type (might be due to invalid IL or missing references) //IL_01c1: Unknown result type (might be due to invalid IL or missing references) //IL_01ec: 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_0242: Unknown result type (might be due to invalid IL or missing references) //IL_026d: Unknown result type (might be due to invalid IL or missing references) //IL_0297: Unknown result type (might be due to invalid IL or missing references) //IL_02c2: Unknown result type (might be due to invalid IL or missing references) //IL_02ed: Unknown result type (might be due to invalid IL or missing references) //IL_0318: Unknown result type (might be due to invalid IL or missing references) //IL_0342: Unknown result type (might be due to invalid IL or missing references) //IL_036d: Unknown result type (might be due to invalid IL or missing references) //IL_0398: Unknown result type (might be due to invalid IL or missing references) //IL_03c3: Unknown result type (might be due to invalid IL or missing references) //IL_03ed: Unknown result type (might be due to invalid IL or missing references) //IL_0417: Unknown result type (might be due to invalid IL or missing references) //IL_0441: Unknown result type (might be due to invalid IL or missing references) //IL_046b: Unknown result type (might be due to invalid IL or missing references) //IL_0495: Unknown result type (might be due to invalid IL or missing references) //IL_04c0: Unknown result type (might be due to invalid IL or missing references) //IL_04eb: Unknown result type (might be due to invalid IL or missing references) //IL_0516: Unknown result type (might be due to invalid IL or missing references) //IL_0540: Unknown result type (might be due to invalid IL or missing references) //IL_056a: Unknown result type (might be due to invalid IL or missing references) //IL_0594: Unknown result type (might be due to invalid IL or missing references) //IL_05bf: Unknown result type (might be due to invalid IL or missing references) //IL_05ea: Unknown result type (might be due to invalid IL or missing references) //IL_0615: Unknown result type (might be due to invalid IL or missing references) //IL_0640: Unknown result type (might be due to invalid IL or missing references) //IL_066b: Unknown result type (might be due to invalid IL or missing references) //IL_0696: Unknown result type (might be due to invalid IL or missing references) //IL_06c1: Unknown result type (might be due to invalid IL or missing references) //IL_06ec: Unknown result type (might be due to invalid IL or missing references) //IL_0717: Unknown result type (might be due to invalid IL or missing references) //IL_0742: Unknown result type (might be due to invalid IL or missing references) //IL_076d: Unknown result type (might be due to invalid IL or missing references) //IL_0798: Unknown result type (might be due to invalid IL or missing references) //IL_07c3: Unknown result type (might be due to invalid IL or missing references) //IL_07ee: Unknown result type (might be due to invalid IL or missing references) //IL_081a: Unknown result type (might be due to invalid IL or missing references) //IL_0846: Unknown result type (might be due to invalid IL or missing references) //IL_0872: Unknown result type (might be due to invalid IL or missing references) //IL_089e: Unknown result type (might be due to invalid IL or missing references) //IL_08ca: Unknown result type (might be due to invalid IL or missing references) //IL_08f5: Unknown result type (might be due to invalid IL or missing references) //IL_0920: Unknown result type (might be due to invalid IL or missing references) //IL_094b: Unknown result type (might be due to invalid IL or missing references) //IL_0977: Unknown result type (might be due to invalid IL or missing references) //IL_09a2: Unknown result type (might be due to invalid IL or missing references) //IL_09cd: Unknown result type (might be due to invalid IL or missing references) //IL_09f8: Unknown result type (might be due to invalid IL or missing references) //IL_0a23: Unknown result type (might be due to invalid IL or missing references) //IL_0a4f: Unknown result type (might be due to invalid IL or missing references) //IL_0a7b: Unknown result type (might be due to invalid IL or missing references) //IL_0aa7: Unknown result type (might be due to invalid IL or missing references) //IL_0ad3: Unknown result type (might be due to invalid IL or missing references) //IL_0aff: Unknown result type (might be due to invalid IL or missing references) //IL_0b2b: Unknown result type (might be due to invalid IL or missing references) //IL_0b57: Unknown result type (might be due to invalid IL or missing references) //IL_0b83: Unknown result type (might be due to invalid IL or missing references) //IL_0baf: Unknown result type (might be due to invalid IL or missing references) //IL_0bdc: Unknown result type (might be due to invalid IL or missing references) //IL_0c09: Unknown result type (might be due to invalid IL or missing references) //IL_0c35: Unknown result type (might be due to invalid IL or missing references) //IL_0c61: Unknown result type (might be due to invalid IL or missing references) //IL_0c8d: Unknown result type (might be due to invalid IL or missing references) //IL_0cb9: Unknown result type (might be due to invalid IL or missing references) //IL_0ce5: Unknown result type (might be due to invalid IL or missing references) //IL_0d11: Unknown result type (might be due to invalid IL or missing references) //IL_0d3d: Unknown result type (might be due to invalid IL or missing references) //IL_0d69: Unknown result type (might be due to invalid IL or missing references) //IL_0d95: Unknown result type (might be due to invalid IL or missing references) //IL_0dc1: Unknown result type (might be due to invalid IL or missing references) //IL_0ded: Unknown result type (might be due to invalid IL or missing references) //IL_0e19: Unknown result type (might be due to invalid IL or missing references) //IL_0e45: Unknown result type (might be due to invalid IL or missing references) //IL_0e71: Unknown result type (might be due to invalid IL or missing references) //IL_0e9d: Unknown result type (might be due to invalid IL or missing references) //IL_0ec9: Unknown result type (might be due to invalid IL or missing references) //IL_0ef5: Unknown result type (might be due to invalid IL or missing references) //IL_0f21: Unknown result type (might be due to invalid IL or missing references) //IL_0f4e: Unknown result type (might be due to invalid IL or missing references) //IL_0f7b: Unknown result type (might be due to invalid IL or missing references) //IL_0fa7: Unknown result type (might be due to invalid IL or missing references) //IL_0fd3: Unknown result type (might be due to invalid IL or missing references) //IL_0fff: Unknown result type (might be due to invalid IL or missing references) //IL_102b: Unknown result type (might be due to invalid IL or missing references) //IL_1058: Unknown result type (might be due to invalid IL or missing references) //IL_1085: Unknown result type (might be due to invalid IL or missing references) //IL_10b2: Unknown result type (might be due to invalid IL or missing references) //IL_10df: Unknown result type (might be due to invalid IL or missing references) //IL_110b: Unknown result type (might be due to invalid IL or missing references) //IL_1137: Unknown result type (might be due to invalid IL or missing references) //IL_1163: Unknown result type (might be due to invalid IL or missing references) //IL_1190: Unknown result type (might be due to invalid IL or missing references) //IL_11bc: Unknown result type (might be due to invalid IL or missing references) //IL_11e8: Unknown result type (might be due to invalid IL or missing references) //IL_1214: Unknown result type (might be due to invalid IL or missing references) List list = new List(100); Color[] array = (Color[])(object)new Color[5] { new Color(1f, 0.56f, 0.82f), new Color(0.55f, 0.87f, 1f), new Color(0.98f, 0.91f, 0.45f), new Color(0.66f, 1f, 0.75f), new Color(0.84f, 0.72f, 1f) }; Color[] array2 = (Color[])(object)new Color[5] { new Color(1f, 0.22f, 0.22f), new Color(1f, 0.51f, 0.14f), new Color(0.88f, 0.09f, 0.42f), new Color(0.61f, 0.16f, 1f), new Color(1f, 0.83f, 0.21f) }; Add(list, "Carnival Confetti", EmpressElevatorEventKind.ConfettiBloom, hostile: false, 6.4f, 16, 0.7f, 0.16f, 2, array[0], 0.32f); Add(list, "Velvet Surprise", EmpressElevatorEventKind.ConfettiBloom, hostile: false, 6.9f, 20, 0.82f, 0.18f, 3, array[4], 0.35f); Add(list, "Joy Burst", EmpressElevatorEventKind.ConfettiBloom, hostile: false, 7.3f, 24, 0.95f, 0.2f, 4, array[2], 0.28f); Add(list, "Glitter Rescue", EmpressElevatorEventKind.ConfettiBloom, hostile: false, 7.8f, 28, 1.02f, 0.22f, 5, array[1], 0.34f); Add(list, "Warm Rain", EmpressElevatorEventKind.HealingRain, hostile: false, 6.8f, 12, 0.8f, 0.18f, 5, array[2], 0.3f); Add(list, "Sugar Drip", EmpressElevatorEventKind.HealingRain, hostile: false, 7.1f, 14, 0.86f, 0.2f, 6, array[0], 0.34f); Add(list, "Nurse Cloud", EmpressElevatorEventKind.HealingRain, hostile: false, 7.5f, 16, 0.92f, 0.22f, 7, array[3], 0.31f); Add(list, "Gentle Wash", EmpressElevatorEventKind.HealingRain, hostile: false, 8f, 18, 0.98f, 0.24f, 8, array[1], 0.29f); Add(list, "Lantern Waltz", EmpressElevatorEventKind.LanternOrbit, hostile: false, 6.7f, 8, 0.72f, 0.36f, 2, array[2], 0.25f); Add(list, "Amber Orbit", EmpressElevatorEventKind.LanternOrbit, hostile: false, 7f, 10, 0.81f, 0.4f, 3, array[4], 0.22f); Add(list, "Candle Ring", EmpressElevatorEventKind.LanternOrbit, hostile: false, 7.4f, 12, 0.9f, 0.44f, 4, array[0], 0.28f); Add(list, "Halo Carousel", EmpressElevatorEventKind.LanternOrbit, hostile: false, 7.9f, 14, 1f, 0.48f, 5, array[1], 0.24f); Add(list, "Prism Garden", EmpressElevatorEventKind.PrismGarden, hostile: false, 6.9f, 8, 0.82f, 0.34f, 3, array[1], 0.36f); Add(list, "Rainbow Terrarium", EmpressElevatorEventKind.PrismGarden, hostile: false, 7.3f, 10, 0.9f, 0.38f, 4, array[0], 0.33f); Add(list, "Glass Meadow", EmpressElevatorEventKind.PrismGarden, hostile: false, 7.7f, 12, 0.98f, 0.42f, 5, array[3], 0.3f); Add(list, "Soft Refraction", EmpressElevatorEventKind.PrismGarden, hostile: false, 8.2f, 14, 1.08f, 0.46f, 6, array[4], 0.27f); Add(list, "Dance Floor", EmpressElevatorEventKind.SpotlightParade, hostile: false, 6.4f, 4, 0.96f, 0.2f, 2, array[0], 0.26f); Add(list, "Star Walk", EmpressElevatorEventKind.SpotlightParade, hostile: false, 6.9f, 5, 1.05f, 0.22f, 3, array[1], 0.26f); Add(list, "Idol Runway", EmpressElevatorEventKind.SpotlightParade, hostile: false, 7.4f, 6, 1.12f, 0.24f, 4, array[2], 0.26f); Add(list, "Fever Show", EmpressElevatorEventKind.SpotlightParade, hostile: false, 7.9f, 7, 1.18f, 0.26f, 5, array[4], 0.24f); Add(list, "Heart Parade", EmpressElevatorEventKind.HeartPageant, hostile: false, 6.7f, 8, 0.78f, 0.18f, 4, array[0], 0.31f); Add(list, "Sweet Riot", EmpressElevatorEventKind.HeartPageant, hostile: false, 7.1f, 10, 0.86f, 0.2f, 5, array[4], 0.29f); Add(list, "Pink Oath", EmpressElevatorEventKind.HeartPageant, hostile: false, 7.6f, 12, 0.92f, 0.22f, 6, array[2], 0.32f); Add(list, "Crush Shower", EmpressElevatorEventKind.HeartPageant, hostile: false, 8f, 14, 1.02f, 0.24f, 7, array[1], 0.28f); Add(list, "Gift Pulse", EmpressElevatorEventKind.GiftPulse, hostile: false, 6.5f, 4, 0.82f, 0.24f, 6, array[2], 0.3f); Add(list, "Prize Storm", EmpressElevatorEventKind.GiftPulse, hostile: false, 7f, 5, 0.9f, 0.26f, 7, array[3], 0.27f); Add(list, "Bonus Hug", EmpressElevatorEventKind.GiftPulse, hostile: false, 7.4f, 6, 0.98f, 0.28f, 8, array[0], 0.32f); Add(list, "Lucky Package", EmpressElevatorEventKind.GiftPulse, hostile: false, 7.8f, 7, 1.05f, 0.3f, 9, array[1], 0.31f); Add(list, "Care Crate", EmpressElevatorEventKind.GiftPulse, hostile: false, 8.2f, 8, 1.12f, 0.32f, 10, array[4], 0.28f); Add(list, "Clockwise Service", EmpressElevatorEventKind.SoloErrand, hostile: false, 16.2f, 4, 0.92f, 0.34f, 5, array[3], 0.34f); Add(list, "Kneel At The Shrine", EmpressElevatorEventKind.SoloErrand, hostile: false, 16.8f, 1, 0.98f, 0.36f, 6, array[4], 0.3f); Add(list, "Touch The Choir", EmpressElevatorEventKind.SoloErrand, hostile: false, 17.1f, 3, 1.04f, 0.38f, 7, array[1], 0.31f); Add(list, "Gate Sprint", EmpressElevatorEventKind.SoloErrand, hostile: false, 17.5f, 3, 1.1f, 0.4f, 8, array[2], 0.29f); Add(list, "Center Stage", EmpressElevatorEventKind.TeamTrial, hostile: false, 7.2f, 1, 0.72f, 0.22f, 1, array[1], 0.3f); Add(list, "Corner Toast", EmpressElevatorEventKind.TeamTrial, hostile: false, 7.6f, 4, 0.82f, 0.24f, 2, array[0], 0.34f); Add(list, "Crouch Choir", EmpressElevatorEventKind.TeamTrial, hostile: false, 8.1f, 1, 0.9f, 0.26f, 3, array[3], 0.28f); Add(list, "Jump Jubilee", EmpressElevatorEventKind.TeamTrial, hostile: false, 8.6f, 1, 0.98f, 0.28f, 4, array[4], 0.25f); Add(list, "Button Darling", EmpressElevatorEventKind.SoloErrand, hostile: false, 15.5f, 1, 0.9f, 0.34f, 1, array[4], 0.36f); Add(list, "Order Service", EmpressElevatorEventKind.SoloErrand, hostile: false, 16.5f, 3, 0.96f, 0.38f, 2, array[1], 0.32f); Add(list, "Jump Audit", EmpressElevatorEventKind.SoloErrand, hostile: false, 15.8f, 5, 1.02f, 0.42f, 3, array[3], 0.3f); Add(list, "Touch And Return", EmpressElevatorEventKind.SoloErrand, hostile: false, 16.8f, 1, 1.06f, 0.46f, 4, array[0], 0.28f); Add(list, "Lucky Rain", EmpressElevatorEventKind.TreasureDrizzle, hostile: false, 6.7f, 9, 0.92f, 0.16f, 4, array[2], 0.24f); Add(list, "Cash Shower", EmpressElevatorEventKind.TreasureDrizzle, hostile: false, 7.1f, 11, 0.98f, 0.18f, 5, array[4], 0.22f); Add(list, "Golden Drizzle", EmpressElevatorEventKind.TreasureDrizzle, hostile: false, 7.6f, 13, 1.05f, 0.2f, 6, array[2], 0.2f); Add(list, "Tip Storm", EmpressElevatorEventKind.TreasureDrizzle, hostile: false, 8f, 15, 1.1f, 0.22f, 7, array[1], 0.24f); Add(list, "Jackpot Sprinkles", EmpressElevatorEventKind.TreasureDrizzle, hostile: false, 8.4f, 17, 1.18f, 0.24f, 8, array[3], 0.22f); Add(list, "Moon Bounce", EmpressElevatorEventKind.MoonBounce, hostile: false, 6.8f, 6, 0.76f, 0.28f, 4, array[1], 0.28f); Add(list, "Soft Orbit", EmpressElevatorEventKind.MoonBounce, hostile: false, 7.2f, 7, 0.84f, 0.3f, 5, array[4], 0.26f); Add(list, "Bunny Hop", EmpressElevatorEventKind.MoonBounce, hostile: false, 7.7f, 8, 0.92f, 0.32f, 6, array[0], 0.3f); Add(list, "Low Gravity Date", EmpressElevatorEventKind.MoonBounce, hostile: false, 8.1f, 9, 1f, 0.34f, 7, array[2], 0.24f); Add(list, "Red Light Green Light", EmpressElevatorEventKind.DirectiveTrial, hostile: true, 7.6f, 1, 1.02f, 0.14f, 1, array2[0], 0.18f); Add(list, "Crouch Or Cry", EmpressElevatorEventKind.DirectiveTrial, hostile: true, 7.9f, 1, 1.1f, 0.16f, 2, array2[3], 0.2f); Add(list, "Jump Tax", EmpressElevatorEventKind.DirectiveTrial, hostile: true, 8.3f, 1, 1.18f, 0.18f, 3, array2[1], 0.22f); Add(list, "Center Is Lava", EmpressElevatorEventKind.DirectiveTrial, hostile: true, 8.8f, 1, 1.28f, 0.2f, 4, array2[4], 0.18f); Add(list, "Razor Lanes", EmpressElevatorEventKind.RollingOrbs, hostile: true, 7.2f, 4, 1.1f, 0.38f, 13, array2[0], 0.18f); Add(list, "Bowling Hate", EmpressElevatorEventKind.RollingOrbs, hostile: true, 7.6f, 5, 1.18f, 0.42f, 14, array2[1], 0.2f); Add(list, "Hallway Grinder", EmpressElevatorEventKind.RollingOrbs, hostile: true, 8f, 6, 1.26f, 0.46f, 15, array2[3], 0.22f); Add(list, "Pinball Funeral", EmpressElevatorEventKind.RollingOrbs, hostile: true, 8.4f, 7, 1.34f, 0.5f, 16, array2[2], 0.2f); Add(list, "Panic Ceiling", EmpressElevatorEventKind.CeilingPress, hostile: true, 7f, 1, 0.86f, 0.92f, 16, array2[4], 0.18f); Add(list, "Flatlined Roof", EmpressElevatorEventKind.CeilingPress, hostile: true, 7.6f, 1, 0.94f, 0.98f, 18, array2[0], 0.18f); Add(list, "Bad Compression", EmpressElevatorEventKind.CeilingPress, hostile: true, 8.2f, 1, 1.02f, 1.04f, 20, array2[3], 0.2f); Add(list, "Needle Carpet", EmpressElevatorEventKind.SpikeLattice, hostile: true, 7.1f, 7, 0.96f, 0.18f, 11, array2[0], 0.2f); Add(list, "Mean Porcupine", EmpressElevatorEventKind.SpikeLattice, hostile: true, 7.6f, 8, 1.04f, 0.2f, 12, array2[1], 0.18f); Add(list, "Floor Betrayal", EmpressElevatorEventKind.SpikeLattice, hostile: true, 8f, 9, 1.12f, 0.22f, 14, array2[2], 0.2f); Add(list, "Puncture Garden", EmpressElevatorEventKind.SpikeLattice, hostile: true, 8.5f, 10, 1.2f, 0.24f, 15, array2[4], 0.18f); Add(list, "Do Not Turn Around", EmpressElevatorEventKind.DoNotTurnAround, hostile: true, 9.4f, 4, 0.96f, 0.14f, 12, array2[3], 0.2f); Add(list, "Eyes Front", EmpressElevatorEventKind.DoNotTurnAround, hostile: true, 9.9f, 5, 1.04f, 0.16f, 13, array2[1], 0.18f); Add(list, "Face The Door", EmpressElevatorEventKind.DoNotTurnAround, hostile: true, 10.3f, 6, 1.12f, 0.18f, 14, array2[0], 0.2f); Add(list, "Wrong Way Darling", EmpressElevatorEventKind.DoNotTurnAround, hostile: true, 10.8f, 7, 1.2f, 0.2f, 16, array2[2], 0.2f); Add(list, "Eyeball Chase", EmpressElevatorEventKind.SeekerOrbs, hostile: true, 7.2f, 4, 0.94f, 0.22f, 10, array2[2], 0.22f); Add(list, "Red Followers", EmpressElevatorEventKind.SeekerOrbs, hostile: true, 7.7f, 5, 1.02f, 0.24f, 12, array2[0], 0.2f); Add(list, "Hungry Satellites", EmpressElevatorEventKind.SeekerOrbs, hostile: true, 8.1f, 6, 1.1f, 0.26f, 13, array2[3], 0.18f); Add(list, "Personal Space Denied", EmpressElevatorEventKind.SeekerOrbs, hostile: true, 8.6f, 7, 1.18f, 0.28f, 15, array2[4], 0.2f); Add(list, "Bounce House From Hell", EmpressElevatorEventKind.BounceBombs, hostile: true, 7.2f, 5, 1.08f, 0.22f, 11, array2[1], 0.2f); Add(list, "Bruise Parade", EmpressElevatorEventKind.BounceBombs, hostile: true, 7.7f, 6, 1.16f, 0.24f, 12, array2[0], 0.2f); Add(list, "Angry Marbles", EmpressElevatorEventKind.BounceBombs, hostile: true, 8.1f, 7, 1.24f, 0.26f, 14, array2[3], 0.18f); Add(list, "Pop Quiz Bombs", EmpressElevatorEventKind.BounceBombs, hostile: true, 8.6f, 8, 1.32f, 0.28f, 15, array2[2], 0.22f); Add(list, "Saw Etiquette", EmpressElevatorEventKind.SawSweep, hostile: true, 7.1f, 2, 0.98f, 0.72f, 15, array2[4], 0.18f); Add(list, "Blender Waltz", EmpressElevatorEventKind.SawSweep, hostile: true, 7.6f, 3, 1.06f, 0.78f, 16, array2[1], 0.18f); Add(list, "Spin Divorce", EmpressElevatorEventKind.SawSweep, hostile: true, 8f, 4, 1.14f, 0.84f, 17, array2[0], 0.18f); Add(list, "Razor Partner Dance", EmpressElevatorEventKind.SawSweep, hostile: true, 8.5f, 4, 1.22f, 0.9f, 18, array2[3], 0.2f); Add(list, "Meteor Rent", EmpressElevatorEventKind.MeteorDrop, hostile: true, 7.2f, 6, 1f, 0.2f, 13, array2[4], 0.2f); Add(list, "Ceiling Refund", EmpressElevatorEventKind.MeteorDrop, hostile: true, 7.7f, 8, 1.08f, 0.22f, 14, array2[1], 0.18f); Add(list, "Falling Problems", EmpressElevatorEventKind.MeteorDrop, hostile: true, 8.1f, 10, 1.16f, 0.24f, 15, array2[0], 0.22f); Add(list, "Angry Hail", EmpressElevatorEventKind.MeteorDrop, hostile: true, 8.7f, 12, 1.24f, 0.26f, 17, array2[2], 0.18f); Add(list, "Wall Tax", EmpressElevatorEventKind.PulseWall, hostile: true, 7f, 3, 0.98f, 0.3f, 12, array2[3], 0.2f); Add(list, "Closing Time", EmpressElevatorEventKind.PulseWall, hostile: true, 7.5f, 4, 1.06f, 0.32f, 13, array2[0], 0.2f); Add(list, "Hall Pass Denied", EmpressElevatorEventKind.PulseWall, hostile: true, 8f, 5, 1.14f, 0.34f, 14, array2[1], 0.18f); Add(list, "Compression Waves", EmpressElevatorEventKind.PulseWall, hostile: true, 8.5f, 6, 1.22f, 0.36f, 16, array2[4], 0.2f); Add(list, "Freeze Tag", EmpressElevatorEventKind.FreezeTag, hostile: true, 7f, 10, 0.84f, 0.16f, 9, array2[1], 0.22f); Add(list, "Statue Test", EmpressElevatorEventKind.FreezeTag, hostile: true, 7.5f, 12, 0.9f, 0.18f, 10, array2[3], 0.2f); Add(list, "Museum Punishment", EmpressElevatorEventKind.FreezeTag, hostile: true, 8f, 14, 0.98f, 0.2f, 12, array2[0], 0.22f); Add(list, "Stillness Debt", EmpressElevatorEventKind.FreezeTag, hostile: true, 8.6f, 16, 1.06f, 0.22f, 13, array2[2], 0.18f); Add(list, "Marathon Panic", EmpressElevatorEventKind.MarathonPanic, hostile: true, 7.1f, 6, 1.06f, 0.2f, 10, array2[4], 0.18f); Add(list, "Cardio Or Die", EmpressElevatorEventKind.MarathonPanic, hostile: true, 7.6f, 7, 1.14f, 0.22f, 11, array2[0], 0.2f); Add(list, "Treadmill Lawsuit", EmpressElevatorEventKind.MarathonPanic, hostile: true, 8.1f, 8, 1.22f, 0.24f, 12, array2[1], 0.18f); Add(list, "Keep Moving Darling", EmpressElevatorEventKind.MarathonPanic, hostile: true, 8.7f, 9, 1.3f, 0.26f, 14, array2[3], 0.2f); Add(list, "Gravity Flip", EmpressElevatorEventKind.GravityFlip, hostile: true, 7.2f, 6, 0.84f, 0.24f, 9, array2[3], 0.22f); Add(list, "Ceiling Date", EmpressElevatorEventKind.GravityFlip, hostile: true, 7.9f, 7, 0.92f, 0.26f, 10, array2[0], 0.2f); Add(list, "Reverse Elevator Law", EmpressElevatorEventKind.GravityFlip, hostile: true, 8.6f, 8, 1f, 0.28f, 12, array2[2], 0.18f); return list; } private static void Add(List definitions, string name, EmpressElevatorEventKind kind, bool hostile, float duration, int count, float speed, float size, int power, Color primary, float secondaryBlend) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0005: 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_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) Color secondaryColor = Color.Lerp(primary, hostile ? Color.white : Color.black, secondaryBlend); definitions.Add(new EmpressElevatorFloorDefinition(definitions.Count, name, kind, hostile, duration, count, speed, size, power, primary, secondaryColor)); } } [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInPlugin("Empress.REPO.TheElevator", "Empress The Elevator", "1.0.0")] public sealed class EmpressTheElevatorPlugin : BaseUnityPlugin { internal const string PluginGuid = "Empress.REPO.TheElevator"; internal const string PluginName = "Empress The Elevator"; internal const string PluginVersion = "1.0.0"; internal const string ElevatorLevelName = "Level - The Elevator"; internal const float MoveDurationSeconds = 10f; internal const float DoorTransitionSeconds = 1.35f; internal const float DoorCueLeadSeconds = 0.56f; internal const float RollDurationSeconds = 1.6f; internal const float RewardBannerSeconds = 2.6f; private static Harmony? _harmony; private static ManualLogSource? _log; private static EmpressTheElevatorRuntime? _runtime; private static Level? _elevatorLevel; private static ConfigEntry? _forceElevatorLevel; private static Sprite? _loadingSpriteOrange; private static Sprite? _loadingSpritePink; private static Sprite? _loadingSpriteDark; private const byte SceneSyncEventCode = 180; private const byte FloorRevealEventCode = 181; private const byte FloorRewardEventCode = 182; private const byte FloorSkipEventCode = 183; private static bool _photonEventsHooked; private static readonly FieldRef LevelContentLevelRef = AccessTools.FieldRefAccess("_level"); private static readonly FieldRef> LevelContentStartRoomsRef = AccessTools.FieldRefAccess>("_startRooms"); private static readonly FieldRef> LevelContentModulesNormal1Ref = AccessTools.FieldRefAccess>("_modulesNormal1"); private static readonly FieldRef> LevelContentModulesNormal2Ref = AccessTools.FieldRefAccess>("_modulesNormal2"); private static readonly FieldRef> LevelContentModulesNormal3Ref = AccessTools.FieldRefAccess>("_modulesNormal3"); private static readonly FieldRef> LevelContentModulesPassage1Ref = AccessTools.FieldRefAccess>("_modulesPassage1"); private static readonly FieldRef> LevelContentModulesPassage2Ref = AccessTools.FieldRefAccess>("_modulesPassage2"); private static readonly FieldRef> LevelContentModulesPassage3Ref = AccessTools.FieldRefAccess>("_modulesPassage3"); private static readonly FieldRef> LevelContentModulesDeadEnd1Ref = AccessTools.FieldRefAccess>("_modulesDeadEnd1"); private static readonly FieldRef> LevelContentModulesDeadEnd2Ref = AccessTools.FieldRefAccess>("_modulesDeadEnd2"); private static readonly FieldRef> LevelContentModulesDeadEnd3Ref = AccessTools.FieldRefAccess>("_modulesDeadEnd3"); private static readonly FieldRef> LevelContentModulesExtraction1Ref = AccessTools.FieldRefAccess>("_modulesExtraction1"); private static readonly FieldRef> LevelContentModulesExtraction2Ref = AccessTools.FieldRefAccess>("_modulesExtraction2"); private static readonly FieldRef> LevelContentModulesExtraction3Ref = AccessTools.FieldRefAccess>("_modulesExtraction3"); private static readonly FieldRef LevelContentConnectObjectRef = AccessTools.FieldRefAccess("_connectObject"); private static readonly FieldRef LevelContentBlockObjectRef = AccessTools.FieldRefAccess("_blockObject"); private static readonly FieldRef LoadingUiGraphic01Ref = AccessTools.FieldRefAccess("loadingGraphic01"); private static readonly FieldRef LoadingUiGraphic02Ref = AccessTools.FieldRefAccess("loadingGraphic02"); private static readonly FieldRef LoadingUiGraphic03Ref = AccessTools.FieldRefAccess("loadingGraphic03"); internal static ManualLogSource Log => _log; internal static Level ElevatorLevel => _elevatorLevel; internal static IReadOnlyList FloorDefinitions { get; } = EmpressElevatorFloorCatalog.Build(); internal static string PluginFolderPath => Path.GetDirectoryName(typeof(EmpressTheElevatorPlugin).Assembly.Location) ?? Paths.PluginPath; private void Awake() { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Expected O, but got Unknown _log = ((BaseUnityPlugin)this).Logger; _forceElevatorLevel = ((BaseUnityPlugin)this).Config.Bind("General", "ForceElevatorLevel", false, "Forces every real run level to load the Empress elevator level so you can test it without waiting for random selection."); EnsureElevatorLevelRegistered(); _harmony = new Harmony("Empress.REPO.TheElevator"); _harmony.PatchAll(typeof(EmpressTheElevatorPlugin).Assembly); EnsureRuntime(); } private void OnDestroy() { RemovePhotonEventHook(); } internal static bool IsElevatorLevel(Level? level) { if ((Object)(object)level != (Object)null) { return ((Object)level).name == "Level - The Elevator"; } return false; } internal static bool ShouldForceElevatorLevel() { return _forceElevatorLevel?.Value ?? false; } internal static EmpressTheElevatorRuntime EnsureRuntime() { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Expected O, but got Unknown if (Object.op_Implicit((Object)(object)_runtime)) { return _runtime; } GameObject val = new GameObject("Empress The Elevator Runtime"); Object.DontDestroyOnLoad((Object)(object)val); _runtime = val.AddComponent(); return _runtime; } internal static bool TryGetCabinRecoveryPose(out Vector3 position, out Quaternion rotation) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_runtime != (Object)null && _runtime.TryGetCabinRecoveryPose(out position, out rotation)) { return true; } position = default(Vector3); rotation = Quaternion.identity; return false; } private static void EnsureElevatorLevelRegistered() { //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: 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_0113: 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_013d: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)_elevatorLevel)) { Level val = ScriptableObject.CreateInstance(); ((Object)val).name = "Level - The Elevator"; val.NarrativeName = "The Elevator"; val.ModuleAmount = 0; val.PassageMaxAmount = 0; val.HasEnemies = false; LevelValuables val2 = ScriptableObject.CreateInstance(); ((Object)val2).name = "Valuables - Empress Elevator"; val2.tiny = new List(); val2.small = new List(); val2.medium = new List(); val2.big = new List(); val2.wide = new List(); val2.tall = new List(); val2.veryTall = new List(); val.ValuablePresets = new List { val2 }; val.AmbiencePresets = new List(); val.FogColor = new Color(0.03f, 0.03f, 0.05f); val.FogStartDistance = 0f; val.FogEndDistance = 40f; val.AmbientColor = new Color(0.23f, 0.22f, 0.28f); val.AmbientColorAdaptation = new Color(0.12f, 0.11f, 0.16f); val.ColorTemperature = -10f; val.ColorFilter = new Color(1f, 0.94f, 0.88f, 1f); val.BloomIntensity = 5.5f; val.BloomThreshold = 0.82f; val.VignetteColor = new Color(0.05f, 0.02f, 0.02f, 1f); val.VignetteIntensity = 0.28f; val.VignetteSmoothness = 0.76f; val.DiscordIcon = "level"; SetLevelField(val, "LoadingGraphic01", GetOrCreateLoadingSpriteOrange()); SetLevelField(val, "LoadingGraphic02", GetOrCreateLoadingSpritePink()); SetLevelField(val, "LoadingGraphic03", GetOrCreateLoadingSpriteDark()); EnsureLevelFieldInstance(val, "LoadingGraphic01"); EnsureLevelFieldInstance(val, "LoadingGraphic02"); EnsureLevelFieldInstance(val, "LoadingGraphic03"); EnsureLevelFieldInstance(val, "ConnectObject"); EnsureLevelFieldInstance(val, "BlockObject"); LevelContent val3 = ScriptableObject.CreateInstance(); ((Object)val3).name = "Empress Elevator Level Content"; LevelContentLevelRef.Invoke(val3) = val; LevelContentStartRoomsRef.Invoke(val3) = new List(); LevelContentModulesNormal1Ref.Invoke(val3) = new List(); LevelContentModulesNormal2Ref.Invoke(val3) = new List(); LevelContentModulesNormal3Ref.Invoke(val3) = new List(); LevelContentModulesPassage1Ref.Invoke(val3) = new List(); LevelContentModulesPassage2Ref.Invoke(val3) = new List(); LevelContentModulesPassage3Ref.Invoke(val3) = new List(); LevelContentModulesDeadEnd1Ref.Invoke(val3) = new List(); LevelContentModulesDeadEnd2Ref.Invoke(val3) = new List(); LevelContentModulesDeadEnd3Ref.Invoke(val3) = new List(); LevelContentModulesExtraction1Ref.Invoke(val3) = new List(); LevelContentModulesExtraction2Ref.Invoke(val3) = new List(); LevelContentModulesExtraction3Ref.Invoke(val3) = new List(); LevelContentConnectObjectRef.Invoke(val3) = null; LevelContentBlockObjectRef.Invoke(val3) = null; Levels.RegisterLevel(val3); _elevatorLevel = val; } } private static void SetLevelField(Level level, string fieldName, object value) { FieldInfo fieldInfo = AccessTools.Field(typeof(Level), fieldName); if (!(fieldInfo == null) && value != null && fieldInfo.FieldType.IsInstanceOfType(value)) { fieldInfo.SetValue(level, value); } } private static void EnsureLevelFieldInstance(Level level, string fieldName) { //IL_006e: Unknown result type (might be due to invalid IL or missing references) FieldInfo fieldInfo = AccessTools.Field(typeof(Level), fieldName); if (!(fieldInfo == null) && fieldInfo.FieldType.IsClass && !(fieldInfo.FieldType == typeof(string)) && fieldInfo.GetValue(level) == null) { object value = ((!(fieldInfo.FieldType == typeof(PrefabRef))) ? FormatterServices.GetUninitializedObject(fieldInfo.FieldType) : ((object)new PrefabRef())); fieldInfo.SetValue(level, value); } } internal static void EnsurePhotonEventHooked() { if (!_photonEventsHooked) { LoadBalancingClient networkingClient = PhotonNetwork.NetworkingClient; if (networkingClient != null) { networkingClient.EventReceived -= OnPhotonEvent; networkingClient.EventReceived += OnPhotonEvent; _photonEventsHooked = true; } } } internal static void RemovePhotonEventHook() { if (_photonEventsHooked) { LoadBalancingClient networkingClient = PhotonNetwork.NetworkingClient; if (networkingClient != null) { networkingClient.EventReceived -= OnPhotonEvent; } _photonEventsHooked = false; } } private static void OnPhotonEvent(EventData photonEvent) { switch (photonEvent.Code) { case 180: OnSceneSyncEvent(photonEvent); break; case 181: OnFloorRevealEvent(photonEvent); break; case 182: OnFloorRewardEvent(photonEvent); break; case 183: OnFloorSkipEvent(photonEvent); break; } } private static void OnSceneSyncEvent(EventData photonEvent) { if (!(photonEvent.CustomData is object[] array) || array.Length < 2) { return; } object obj = array[0]; if (obj is int) { int runToken = (int)obj; obj = array[1]; if (obj is int) { int runSeed = (int)obj; EnsureRuntime().ReceiveSceneSync(runToken, runSeed); } } } private static void OnFloorRevealEvent(EventData photonEvent) { if (!(photonEvent.CustomData is object[] array) || array.Length < 3) { return; } object obj = array[0]; if (!(obj is int)) { return; } int runToken = (int)obj; obj = array[1]; if (obj is int) { int floorNumber = (int)obj; obj = array[2]; if (obj is int) { int definitionIndex = (int)obj; EnsureRuntime().ReceiveFloorReveal(runToken, floorNumber, definitionIndex); } } } private static void OnFloorRewardEvent(EventData photonEvent) { if (!(photonEvent.CustomData is object[] array) || array.Length < 2) { return; } object obj = array[0]; if (obj is int) { int runToken = (int)obj; if (array[1] is string rewardText) { EnsureRuntime().ReceiveFloorReward(runToken, rewardText); } } } private static void OnFloorSkipEvent(EventData photonEvent) { if (!(photonEvent.CustomData is object[] array) || array.Length < 2) { return; } object obj = array[0]; if (!(obj is int)) { return; } int runToken = (int)obj; obj = array[1]; if (obj is bool) { if ((bool)obj) { EnsureRuntime().ReceiveEmergencySkip(runToken); } else if (SemiFunc.IsMasterClientOrSingleplayer()) { BroadcastEmergencySkip(runToken); } } } internal static void RaiseSceneSync(int runToken, int runSeed) { EnsureRuntime().ReceiveSceneSync(runToken, runSeed); if (SemiFunc.IsMultiplayer() && PhotonNetwork.InRoom) { RaisePhotonEvent(180, new object[2] { runToken, runSeed }, (ReceiverGroup)0); } } internal static void RaiseFloorReveal(int runToken, int floorNumber, int definitionIndex) { EnsureRuntime().ReceiveFloorReveal(runToken, floorNumber, definitionIndex); if (SemiFunc.IsMultiplayer() && PhotonNetwork.InRoom) { RaisePhotonEvent(181, new object[3] { runToken, floorNumber, definitionIndex }, (ReceiverGroup)0); } } internal static void RaiseFloorReward(int runToken, string rewardText) { EnsureRuntime().ReceiveFloorReward(runToken, rewardText); if (SemiFunc.IsMultiplayer() && PhotonNetwork.InRoom) { RaisePhotonEvent(182, new object[2] { runToken, rewardText }, (ReceiverGroup)0); } } internal static void RequestEmergencySkip(int runToken) { if (SemiFunc.IsMasterClientOrSingleplayer()) { BroadcastEmergencySkip(runToken); } else if (SemiFunc.IsMultiplayer() && PhotonNetwork.InRoom) { RaisePhotonEvent(183, new object[2] { runToken, false }, (ReceiverGroup)2); } } private static void BroadcastEmergencySkip(int runToken) { EnsureRuntime().ReceiveEmergencySkip(runToken); if (SemiFunc.IsMultiplayer() && PhotonNetwork.InRoom) { RaisePhotonEvent(183, new object[2] { runToken, true }, (ReceiverGroup)0); } } private static void RaisePhotonEvent(byte eventCode, object[] payload, ReceiverGroup receivers) { //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_000b: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_0015: Unknown result type (might be due to invalid IL or missing references) EnsurePhotonEventHooked(); RaiseEventOptions val = new RaiseEventOptions { Receivers = receivers }; PhotonNetwork.RaiseEvent(eventCode, (object)payload, val, SendOptions.SendReliable); } internal static void ApplyLoadingGraphics(LoadingUI loadingUI) { SetLoadingGraphic(LoadingUiGraphic01Ref.Invoke(loadingUI), GetOrCreateLoadingSpriteOrange()); SetLoadingGraphic(LoadingUiGraphic02Ref.Invoke(loadingUI), GetOrCreateLoadingSpritePink()); SetLoadingGraphic(LoadingUiGraphic03Ref.Invoke(loadingUI), GetOrCreateLoadingSpriteDark()); } private static void SetLoadingGraphic(Image? image, Sprite sprite) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)image == (Object)null)) { image.sprite = sprite; ((Graphic)image).color = Color.white; image.preserveAspect = true; ((Component)image).gameObject.SetActive(true); } } private static Sprite GetOrCreateLoadingSpriteOrange() { //IL_0018: 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) return _loadingSpriteOrange ?? (_loadingSpriteOrange = CreateLoadingSprite(new Color(0.93f, 0.47f, 0.18f), new Color(0.18f, 0.07f, 0.03f))); } private static Sprite GetOrCreateLoadingSpritePink() { //IL_0018: 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) return _loadingSpritePink ?? (_loadingSpritePink = CreateLoadingSprite(new Color(1f, 0.5f, 0.73f), new Color(0.14f, 0.05f, 0.08f))); } private static Sprite GetOrCreateLoadingSpriteDark() { //IL_0018: 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) return _loadingSpriteDark ?? (_loadingSpriteDark = CreateLoadingSprite(new Color(0.22f, 0.24f, 0.32f), new Color(0.04f, 0.05f, 0.08f))); } private static Sprite CreateLoadingSprite(Color topColor, Color bottomColor) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_004a: 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_0056: 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_0074: 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_0080: 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_009d: 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_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: 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_0124: 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_015e: 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) Texture2D val = new Texture2D(64, 64, (TextureFormat)4, false); ((Texture)val).wrapMode = (TextureWrapMode)1; for (int i = 0; i < ((Texture)val).height; i++) { for (int j = 0; j < ((Texture)val).width; j++) { val.SetPixel(j, i, Color.clear); } } DrawRect(val, 16, 7, 32, 50, new Color(bottomColor.r, bottomColor.g, bottomColor.b, 0.86f)); DrawRect(val, 19, 10, 26, 44, new Color(topColor.r, topColor.g, topColor.b, 0.74f)); DrawRect(val, 31, 12, 2, 40, new Color(bottomColor.r, bottomColor.g, bottomColor.b, 0.92f)); DrawRect(val, 22, 15, 8, 4, new Color(1f, 0.95f, 0.82f, 0.72f)); DrawRect(val, 34, 15, 8, 4, new Color(1f, 0.95f, 0.82f, 0.72f)); DrawRect(val, 22, 47, 20, 3, new Color(1f, 0.95f, 0.82f, 0.55f)); val.Apply(false, false); return Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), new Vector2(0.5f, 0.5f), 32f); } private static void DrawRect(Texture2D texture, int startX, int startY, int width, int height, Color color) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) for (int i = startY; i < startY + height; i++) { for (int j = startX; j < startX + width; j++) { if (j >= 0 && j < ((Texture)texture).width && i >= 0 && i < ((Texture)texture).height) { texture.SetPixel(j, i, color); } } } } } [HarmonyPatch(typeof(LevelGenerator), "Generate")] internal static class EmpressTheElevatorPatchLevelGeneratorGenerate { private static bool Prefix(LevelGenerator __instance, ref IEnumerator __result) { if (!EmpressTheElevatorPlugin.IsElevatorLevel(RunManager.instance?.levelCurrent)) { return true; } __result = EmpressTheElevatorPlugin.EnsureRuntime().GenerateElevatorLevel(__instance); return false; } } [HarmonyPatch(typeof(RunManager), "SetRunLevel")] internal static class EmpressTheElevatorPatchRunManagerSetRunLevel { private static void Postfix(RunManager __instance) { if (EmpressTheElevatorPlugin.ShouldForceElevatorLevel()) { __instance.levelCurrent = EmpressTheElevatorPlugin.ElevatorLevel; } } } [HarmonyPatch(typeof(LevelPoint), "NavMeshCheck")] internal static class EmpressTheElevatorPatchLevelPointNavMeshCheck { private static bool Prefix(ref IEnumerator __result) { if (!EmpressTheElevatorPlugin.IsElevatorLevel(RunManager.instance?.levelCurrent)) { return true; } __result = EmpressTheElevatorRuntime.EmptyCoroutine(); return false; } } [HarmonyPatch(typeof(EnvironmentDirector), "Setup")] internal static class EmpressTheElevatorPatchEnvironmentDirectorSetup { private static bool Prefix(EnvironmentDirector __instance) { //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_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_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_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: 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_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_0136: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)LevelGenerator.Instance)) { return true; } Level level = LevelGenerator.Instance.Level; if (!Object.op_Implicit((Object)(object)level) || !EmpressTheElevatorPlugin.IsElevatorLevel(level)) { return true; } __instance.FogColor = level.FogColor; __instance.FogColorNew = __instance.FogColor; __instance.FogColorPrevious = __instance.FogColor; __instance.FogStartDistance = level.FogStartDistance; __instance.FogStartDistanceNew = __instance.FogStartDistance; __instance.FogStartDistancePrevious = __instance.FogStartDistance; __instance.FogEndDistance = level.FogEndDistance; __instance.FogEndDistanceNew = __instance.FogEndDistance; __instance.FogEndDistancePrevious = __instance.FogEndDistance; __instance.AmbientColor = level.AmbientColor; __instance.AmbientColorPrevious = __instance.AmbientColor; __instance.AmbientColorNew = __instance.AmbientColor; __instance.AmbientColorAdaptation = level.AmbientColorAdaptation; __instance.AmbientColorAdaptationPrevious = __instance.AmbientColorAdaptation; __instance.AmbientColorAdaptationNew = __instance.AmbientColorAdaptation; RenderSettings.fogColor = __instance.FogColor; RenderSettings.fogStartDistance = __instance.FogStartDistance; RenderSettings.fogEndDistance = __instance.FogEndDistance; RenderSettings.ambientLight = __instance.AmbientColor; if (!Object.op_Implicit((Object)(object)__instance.MainCamera)) { __instance.MainCamera = Camera.main; } if (Object.op_Implicit((Object)(object)__instance.MainCamera)) { __instance.MainCamera.backgroundColor = RenderSettings.fogColor; __instance.MainCamera.farClipPlane = RenderSettings.fogEndDistance + 1f; } __instance.DarkAdaptationLerp = 0.1f; __instance.SetupDone = true; return false; } } [HarmonyPatch(typeof(LoadingUI), "LevelAnimationStart")] internal static class EmpressTheElevatorPatchLoadingUiLevelAnimationStart { private static void Postfix(LoadingUI __instance) { //IL_00d2: 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) if (EmpressTheElevatorPlugin.IsElevatorLevel(Object.op_Implicit((Object)(object)LevelGenerator.Instance) ? LevelGenerator.Instance.Level : null)) { EmpressTheElevatorPlugin.ApplyLoadingGraphics(__instance); if ((Object)(object)__instance.levelNumberText != (Object)null) { ((TMP_Text)__instance.levelNumberText).text = "LEVEL " + ((!((Object)(object)RunManager.instance != (Object)null)) ? 1 : (RunManager.instance.levelsCompleted + 1)); ((Graphic)__instance.levelNumberText).color = new Color(1f, 0.83f, 0.62f); ((Component)__instance.levelNumberText).gameObject.SetActive(true); ((TMP_Text)__instance.levelNumberText).transform.SetAsLastSibling(); } if ((Object)(object)__instance.levelNameText != (Object)null) { ((TMP_Text)__instance.levelNameText).text = "THE ELEVATOR"; ((Graphic)__instance.levelNameText).color = Color.white; ((Component)__instance.levelNameText).gameObject.SetActive(true); ((TMP_Text)__instance.levelNameText).transform.SetAsLastSibling(); } } } } [HarmonyPatch(typeof(ItemManager), "TurnOffIconLights")] internal static class EmpressTheElevatorPatchItemManagerTurnOffIconLights { private static bool Prefix(ItemManager __instance, ref IEnumerator __result) { if (!EmpressTheElevatorPlugin.IsElevatorLevel(RunManager.instance?.levelCurrent)) { return true; } __result = SafeTurnOffIconLights(__instance); return false; } private static IEnumerator SafeTurnOffIconLights(ItemManager itemManager) { if ((Object)(object)itemManager.itemIconLights == (Object)null) { yield break; } if (SemiFunc.RunIsShop() || SemiFunc.MenuLevel()) { itemManager.itemIconLights.SetActive(false); yield break; } while ((Object)(object)LevelGenerator.Instance == (Object)null || !LevelGenerator.Instance.Generated) { yield return (object)new WaitForSeconds(0.2f); } if (SemiFunc.RunIsArena()) { itemManager.itemIconLights.SetActive(false); yield break; } while (true) { itemManager.spawnedItems.RemoveAll((ItemAttributes item) => (Object)(object)item == (Object)null); bool flag = false; foreach (ItemAttributes spawnedItem in itemManager.spawnedItems) { if ((Object)(object)spawnedItem != (Object)null && !spawnedItem.hasIcon) { flag = true; break; } } if (!flag) { break; } yield return (object)new WaitForSeconds(0.2f); } itemManager.itemIconLights.SetActive(false); } } [HarmonyPatch(typeof(PlayerDeathHead), "Update")] internal static class EmpressTheElevatorPatchPlayerDeathHeadUpdate { private static bool Prefix(PlayerDeathHead __instance) { //IL_006a: 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_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) if (!EmpressTheElevatorPlugin.IsElevatorLevel(RunManager.instance?.levelCurrent)) { return true; } if (!__instance.triggered) { return true; } if ((Object)(object)__instance.physGrabObject == (Object)null || (Object)(object)__instance.playerAvatar == (Object)null) { return false; } if (!SemiFunc.IsMasterClientOrSingleplayer()) { return true; } if ((Object)(object)__instance.roomVolumeCheck == (Object)null) { if (EmpressTheElevatorPlugin.TryGetCabinRecoveryPose(out var position, out var rotation)) { __instance.physGrabObject.Teleport(position, rotation); } return false; } if (__instance.roomVolumeCheck.CurrentRooms.Count > 0) { return true; } if (EmpressTheElevatorPlugin.TryGetCabinRecoveryPose(out var position2, out var rotation2)) { __instance.outsideLevelTimer = 0f; __instance.physGrabObject.Teleport(position2, rotation2); } return true; } } internal sealed class EmpressTheElevatorRuntime : MonoBehaviour { private const float CabinWidth = 10f; private const float CabinDepth = 8f; private const float CabinHeight = 5f; private const float CabinHazardMinX = -4.35f; private const float CabinHazardMaxX = 4.35f; private const float CabinHazardMinZ = -3.45f; private const float CabinHazardMaxZ = 3.45f; private const float ChamberDepth = 13f; private const float ChamberWidth = 12f; private const float ChamberHeight = 6f; private const float BarrierZ = 4.2f; private const float FrontDoorZ = 3.92f; private const float FloorThickness = 1f; private const float DamageTickInterval = 0.16f; private const float HealTickInterval = 1.25f; private const float EmergencySkipHoldSeconds = 3f; private const float RuleGraceSeconds = 4.5f; private AudioSource? _movementLoopSource; private AudioSource? _oneShotSource; private AudioClip? _movementLoopClip; private AudioClip? _doorOpenClip; private bool _audioLoadRequested; private int _sceneHandle = -1; private EmpressElevatorSceneState? _scene; private bool _hasPendingSceneSync; private int _pendingRunToken; private int _pendingRunSeed; private readonly Dictionary _effectCooldowns = new Dictionary(StringComparer.Ordinal); private readonly Dictionary _ruleAnchors = new Dictionary(StringComparer.Ordinal); private readonly Dictionary _ruleStillTimers = new Dictionary(StringComparer.Ordinal); private float _skipHoldElapsed; private Font? _uiFont; private void Awake() { EnsureAudioSources(); RequestAudioLoad(); } private void Update() { //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Invalid comparison between Unknown and I4 if (!EmpressTheElevatorPlugin.IsElevatorLevel(RunManager.instance?.levelCurrent)) { EmpressTheElevatorPlugin.RemovePhotonEventHook(); } HandleSceneTransition(); UpdateAudioState(); if (_scene == null) { _skipHoldElapsed = 0f; ResetLocalPlayerEventEffects(); return; } UpdateDoorsAndHud(); UpdateEmergencyButtonPrompt(); UpdateActiveEvent(); if (!_scene.HostLoopStarted && Object.op_Implicit((Object)(object)_scene.Generator) && _scene.Generator.Generated && (Object)(object)GameDirector.instance != (Object)null && (int)GameDirector.instance.currentState == 2 && SemiFunc.IsMasterClientOrSingleplayer()) { _scene.HostLoopStarted = true; ((MonoBehaviour)this).StartCoroutine(HostFloorLoop()); } } private void OnDisable() { StopAudio(); ClearSceneState(); } private void EnsureAudioSources() { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Expected O, but got Unknown //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Expected O, but got Unknown if ((Object)(object)_movementLoopSource == (Object)null) { GameObject val = new GameObject("Empress Elevator Move Audio"); val.transform.SetParent(((Component)this).transform, false); _movementLoopSource = val.AddComponent(); _movementLoopSource.loop = true; _movementLoopSource.playOnAwake = false; _movementLoopSource.spatialBlend = 0f; _movementLoopSource.volume = 0.45f; } if ((Object)(object)_oneShotSource == (Object)null) { GameObject val2 = new GameObject("Empress Elevator Cue Audio"); val2.transform.SetParent(((Component)this).transform, false); _oneShotSource = val2.AddComponent(); _oneShotSource.loop = false; _oneShotSource.playOnAwake = false; _oneShotSource.spatialBlend = 0f; _oneShotSource.volume = 0.75f; } } private void RequestAudioLoad() { if (!_audioLoadRequested) { _audioLoadRequested = true; ((MonoBehaviour)this).StartCoroutine(LoadAudioClipCoroutine("move", delegate(AudioClip clip) { _movementLoopClip = clip; })); ((MonoBehaviour)this).StartCoroutine(LoadAudioClipCoroutine("Open", delegate(AudioClip clip) { _doorOpenClip = clip; })); } } private static string? ResolveAudioAssetPath(string fileName) { string text = Path.Combine(EmpressTheElevatorPlugin.PluginFolderPath, "Audio", fileName); if (File.Exists(text)) { return text; } string text2 = Path.Combine(EmpressTheElevatorPlugin.PluginFolderPath, fileName); if (File.Exists(text2)) { return text2; } return null; } private IEnumerator LoadAudioClipCoroutine(string assetStem, Action onLoaded) { string text = ResolveAudioAssetPath(assetStem + ".mp3"); if (string.IsNullOrEmpty(text)) { yield break; } UnityWebRequest request = UnityWebRequestMultimedia.GetAudioClip("file:///" + text.Replace("\\", "/"), (AudioType)13); try { yield return request.SendWebRequest(); if ((int)request.result == 1) { AudioClip content = DownloadHandlerAudioClip.GetContent(request); if ((Object)(object)content != (Object)null) { ((Object)content).name = assetStem; onLoaded(content); } } } finally { ((IDisposable)request)?.Dispose(); } } private void UpdateAudioState() { if (_scene == null || (Object)(object)_scene.Generator == (Object)null || !_scene.Generator.Generated) { StopAudio(); } else if (_scene.Phase == EmpressElevatorPhase.Moving && (Object)(object)_movementLoopClip != (Object)null && (Object)(object)_movementLoopSource != (Object)null) { if ((Object)(object)_movementLoopSource.clip != (Object)(object)_movementLoopClip) { _movementLoopSource.clip = _movementLoopClip; } if (!_movementLoopSource.isPlaying) { _movementLoopSource.Play(); } } else if ((Object)(object)_movementLoopSource != (Object)null && _movementLoopSource.isPlaying) { _movementLoopSource.Stop(); } } private void StopAudio() { if ((Object)(object)_movementLoopSource != (Object)null && _movementLoopSource.isPlaying) { _movementLoopSource.Stop(); } } private void PlayDoorOpenCue() { if (!((Object)(object)_doorOpenClip == (Object)null) && !((Object)(object)_oneShotSource == (Object)null)) { _oneShotSource.PlayOneShot(_doorOpenClip, 0.8f); } } internal bool TryGetCabinRecoveryPose(out Vector3 position, out Quaternion rotation) { //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: 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_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) if (_scene != null && (Object)(object)_scene.CabinRoot != (Object)null) { position = _scene.CabinRoot.TransformPoint(new Vector3(0f, 0.9f, -1f)); rotation = Quaternion.LookRotation(_scene.CabinRoot.forward, Vector3.up); return true; } position = default(Vector3); rotation = Quaternion.identity; return false; } internal void ScheduleDeathHeadRecovery(string steamId, float delaySeconds) { if (!string.IsNullOrWhiteSpace(steamId)) { ((MonoBehaviour)this).StartCoroutine(RecoverDeathHeadToCabin(steamId, delaySeconds)); } } private IEnumerator RecoverDeathHeadToCabin(string steamId, float delaySeconds) { if (delaySeconds > 0f) { yield return (object)new WaitForSeconds(delaySeconds); } PlayerAvatar val = FindPlayerBySteamId(steamId); PlayerDeathHead val2 = (((Object)(object)val != (Object)null) ? val.playerDeathHead : null); if (!((Object)(object)val2 == (Object)null) && !((Object)(object)val2.physGrabObject == (Object)null) && TryGetCabinRecoveryPose(out var position, out var rotation)) { val2.physGrabObject.Teleport(position, rotation); val2.triggeredPosition = position; val2.triggeredRotation = rotation; val2.outsideLevelTimer = 0f; } } internal static IEnumerator EmptyCoroutine() { yield break; } internal IEnumerator GenerateElevatorLevel(LevelGenerator generator) { EmpressTheElevatorPlugin.EnsurePhotonEventHooked(); yield return (object)new WaitForSeconds(0.2f); if (!SemiFunc.IsMultiplayer()) { generator.AllPlayersReady = true; } while (!generator.AllPlayersReady) { generator.State = (LevelState)1; yield return (object)new WaitForSeconds(0.1f); } yield return (object)new WaitForSeconds(0.2f); generator.Level = RunManager.instance.levelCurrent; RunManager.instance.levelPrevious = generator.Level; generator.Generated = false; generator.EnemyReady = true; generator.ModulesSpawned = 0; generator.playerSpawned = 0; generator.LevelPathPoints = new List(); generator.LevelPathTruck = null; if (Object.op_Implicit((Object)(object)ValuableDirector.instance)) { ValuableDirector.instance.setupComplete = true; ValuableDirector.instance.valuablesSpawned = true; } if (Object.op_Implicit((Object)(object)RoundDirector.instance)) { RoundDirector.instance.extractionPoints = 0; RoundDirector.instance.extractionPointsCompleted = 0; RoundDirector.instance.extractionPointList.Clear(); } generator.State = (LevelState)3; _scene = BuildElevatorScene(generator); EmpressTheElevatorRuntime empressTheElevatorRuntime = this; Scene activeScene = SceneManager.GetActiveScene(); empressTheElevatorRuntime._sceneHandle = ((Scene)(ref activeScene)).handle; if (SemiFunc.IsMasterClientOrSingleplayer()) { EmpressTheElevatorPlugin.RaiseSceneSync(_scene.RunToken, _scene.RunSeed); } yield return (object)new WaitForSeconds(0.2f); if (Object.op_Implicit((Object)(object)EnvironmentDirector.Instance)) { EnvironmentDirector.Instance.Setup(); } if (Object.op_Implicit((Object)(object)PostProcessing.Instance)) { PostProcessing.Instance.Setup(); } if (Object.op_Implicit((Object)(object)LevelMusic.instance)) { LevelMusic.instance.Setup(); } if (Object.op_Implicit((Object)(object)ConstantMusic.instance)) { ConstantMusic.instance.Setup(); } if (SemiFunc.IsMasterClientOrSingleplayer()) { generator.NavMeshSetup(); yield return null; while ((Object)(object)GameDirector.instance == (Object)null || GameDirector.instance.PlayerList.Count == 0) { generator.State = (LevelState)12; yield return (object)new WaitForSeconds(0.1f); } generator.PlayerSpawn(); yield return null; while (generator.playerSpawned < GameDirector.instance.PlayerList.Count) { generator.State = (LevelState)13; yield return (object)new WaitForSeconds(0.1f); } if (SemiFunc.IsMultiplayer()) { generator.PhotonView.RPC("GenerateDone", (RpcTarget)3, Array.Empty()); } else { generator.GenerateDone(default(PhotonMessageInfo)); } } else { while (!generator.Generated) { yield return (object)new WaitForSeconds(0.1f); } } _scene.Phase = EmpressElevatorPhase.Moving; _scene.PhaseStartedAt = Time.time; _scene.PendingFloorNumber = 1; _scene.CurrentFloorNumber = 1; _scene.StatusText.text = "Ascending"; _scene.FloorText.text = "FLOOR 001"; _scene.EventNameText.text = "WAITING"; } internal void ReceiveSceneSync(int runToken, int runSeed) { _hasPendingSceneSync = true; _pendingRunToken = runToken; _pendingRunSeed = runSeed; if (_scene != null) { _scene.RunToken = runToken; _scene.RunSeed = runSeed; } } internal void ReceiveFloorReveal(int runToken, int floorNumber, int definitionIndex) { if (_scene != null && _scene.RunToken == runToken && definitionIndex >= 0 && definitionIndex < EmpressTheElevatorPlugin.FloorDefinitions.Count) { BeginFloorReveal(floorNumber, EmpressTheElevatorPlugin.FloorDefinitions[definitionIndex]); } } internal void ReceiveFloorReward(int runToken, string rewardText) { //IL_0042: Unknown result type (might be due to invalid IL or missing references) if (_scene != null && _scene.RunToken == runToken) { _scene.RewardText.text = rewardText; ((Graphic)_scene.RewardText).color = new Color(1f, 0.93f, 0.54f); _scene.RewardTextUntil = Time.time + 2.6f; } } internal void ReceiveEmergencySkip(int runToken) { //IL_0077: 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 (_scene != null && _scene.RunToken == runToken && !_scene.LevelExitRequested) { _scene.LevelExitRequested = true; _scene.SkipRewardForFloor = true; _skipHoldElapsed = 0f; _scene.StatusText.text = "Emergency Exit"; ((Graphic)_scene.StatusText).color = new Color(1f, 0.38f, 0.32f); _scene.EventNameText.text = "Cashing out and heading to the next stop"; _scene.RewardText.text = "Emergency button hit. Taking your winnings to the truck."; ((Graphic)_scene.RewardText).color = new Color(1f, 0.88f, 0.58f); _scene.RewardTextUntil = Time.time + 2.6f; ClearActiveEventRoot(); _scene.ActiveDefinition = null; _scene.EventVisualsBuilt = false; _scene.Phase = EmpressElevatorPhase.Moving; _scene.PhaseStartedAt = Time.time; if (SemiFunc.IsMasterClientOrSingleplayer()) { ((MonoBehaviour)this).StartCoroutine(ExitElevatorLevelEarly(runToken)); } } } private void HandleSceneTransition() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) Scene activeScene = SceneManager.GetActiveScene(); if (((Scene)(ref activeScene)).handle != _sceneHandle) { _sceneHandle = ((Scene)(ref activeScene)).handle; ClearSceneState(); } } private void ClearSceneState() { _effectCooldowns.Clear(); _ruleAnchors.Clear(); _ruleStillTimers.Clear(); _skipHoldElapsed = 0f; StopAudio(); ResetLocalPlayerEventEffects(); EmpressElevatorSceneState scene = _scene; if (scene != null) { Canvas hudCanvas = scene.HudCanvas; if (Object.op_Implicit((Object)(object)hudCanvas)) { Object.Destroy((Object)(object)((Component)hudCanvas).gameObject); } Transform activeEventRoot = scene.ActiveEventRoot; if (Object.op_Implicit((Object)(object)activeEventRoot)) { Object.Destroy((Object)(object)((Component)activeEventRoot).gameObject); } Transform activeCabinEventRoot = scene.ActiveCabinEventRoot; if (Object.op_Implicit((Object)(object)activeCabinEventRoot)) { Object.Destroy((Object)(object)((Component)activeCabinEventRoot).gameObject); } } _scene = null; } private IEnumerator HostFloorLoop() { while (_scene != null && (!Object.op_Implicit((Object)(object)_scene.Generator) || !_scene.Generator.Generated || (Object)(object)GameDirector.instance == (Object)null || (int)GameDirector.instance.currentState != 2)) { yield return (object)new WaitForSeconds(0.2f); } while (_scene != null && Object.op_Implicit((Object)(object)_scene.Generator) && _scene.Generator.Generated && !_scene.LevelExitRequested) { float moveStartedAt = Time.time; _scene.Phase = EmpressElevatorPhase.Moving; _scene.PhaseStartedAt = moveStartedAt; while (_scene != null && !_scene.LevelExitRequested && _scene.Phase == EmpressElevatorPhase.Moving && Time.time - moveStartedAt < 10f) { yield return null; } if (_scene == null || _scene.LevelExitRequested) { break; } bool hostile = Random.value >= 0.5f; int definitionIndex = TakeNextDefinitionIndex(hostile); int pendingFloorNumber = _scene.PendingFloorNumber; EmpressTheElevatorPlugin.RaiseFloorReveal(_scene.RunToken, pendingFloorNumber, definitionIndex); while (_scene != null && _scene.Phase != 0) { yield return null; } } } private int TakeNextDefinitionIndex(bool hostile) { if (_scene == null) { return 0; } List list = (hostile ? _scene.ShuffledBadDefinitions : _scene.ShuffledGoodDefinitions); if (list.Count == 0) { list = new List(); for (int i = 0; i < EmpressTheElevatorPlugin.FloorDefinitions.Count; i++) { if (EmpressTheElevatorPlugin.FloorDefinitions[i].Hostile == hostile) { list.Add(i); } } Random random = new Random(_scene.RunSeed); for (int num = list.Count - 1; num > 0; num--) { int num2 = random.Next(num + 1); List list2 = list; int index = num; List list3 = list; int index2 = num2; int value = list[num2]; int value2 = list[num]; list2[index] = value; list3[index2] = value2; } _scene.RunSeed = _scene.RunSeed * 1664525 + 1013904223; if (hostile) { _scene.ShuffledBadDefinitions = list; } else { _scene.ShuffledGoodDefinitions = list; } } int result = list[0]; list.RemoveAt(0); return result; } private IEnumerator ExitElevatorLevelEarly(int runToken) { yield return (object)new WaitForSeconds(1.15f); if (_scene != null && _scene.RunToken == runToken && !((Object)(object)RunManager.instance == (Object)null)) { RunManager.instance.ChangeLevel(true, false, (ChangeLevelType)0); } } private EmpressElevatorSceneState BuildElevatorScene(LevelGenerator generator) { //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Expected O, but got Unknown //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Expected O, but got Unknown //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Expected O, but got Unknown //IL_01b1: 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_01ea: Expected O, but got Unknown //IL_020f: Unknown result type (might be due to invalid IL or missing references) //IL_0216: Expected O, but got Unknown //IL_023f: Unknown result type (might be due to invalid IL or missing references) //IL_0271: Unknown result type (might be due to invalid IL or missing references) //IL_0285: Unknown result type (might be due to invalid IL or missing references) //IL_0299: Unknown result type (might be due to invalid IL or missing references) //IL_02bf: Unknown result type (might be due to invalid IL or missing references) //IL_02d3: Unknown result type (might be due to invalid IL or missing references) //IL_02e7: Unknown result type (might be due to invalid IL or missing references) //IL_030d: Unknown result type (might be due to invalid IL or missing references) //IL_0321: Unknown result type (might be due to invalid IL or missing references) //IL_0335: Unknown result type (might be due to invalid IL or missing references) //IL_035b: Unknown result type (might be due to invalid IL or missing references) //IL_036f: Unknown result type (might be due to invalid IL or missing references) //IL_0383: Unknown result type (might be due to invalid IL or missing references) //IL_03a9: Unknown result type (might be due to invalid IL or missing references) //IL_03bd: Unknown result type (might be due to invalid IL or missing references) //IL_03d1: Unknown result type (might be due to invalid IL or missing references) //IL_03f7: Unknown result type (might be due to invalid IL or missing references) //IL_040b: Unknown result type (might be due to invalid IL or missing references) //IL_041f: Unknown result type (might be due to invalid IL or missing references) //IL_0445: Unknown result type (might be due to invalid IL or missing references) //IL_0459: Unknown result type (might be due to invalid IL or missing references) //IL_046d: Unknown result type (might be due to invalid IL or missing references) //IL_0493: Unknown result type (might be due to invalid IL or missing references) //IL_04a7: Unknown result type (might be due to invalid IL or missing references) //IL_04bb: Unknown result type (might be due to invalid IL or missing references) //IL_04f6: Unknown result type (might be due to invalid IL or missing references) //IL_0507: Unknown result type (might be due to invalid IL or missing references) //IL_051b: Unknown result type (might be due to invalid IL or missing references) //IL_0548: Unknown result type (might be due to invalid IL or missing references) //IL_0559: Unknown result type (might be due to invalid IL or missing references) //IL_056d: Unknown result type (might be due to invalid IL or missing references) //IL_0588: Unknown result type (might be due to invalid IL or missing references) //IL_058d: Unknown result type (might be due to invalid IL or missing references) //IL_0599: Unknown result type (might be due to invalid IL or missing references) //IL_059e: Unknown result type (might be due to invalid IL or missing references) //IL_05bf: Unknown result type (might be due to invalid IL or missing references) //IL_05c4: Unknown result type (might be due to invalid IL or missing references) //IL_05e5: Unknown result type (might be due to invalid IL or missing references) //IL_05ea: Unknown result type (might be due to invalid IL or missing references) //IL_060a: Unknown result type (might be due to invalid IL or missing references) //IL_061e: Unknown result type (might be due to invalid IL or missing references) //IL_0623: Unknown result type (might be due to invalid IL or missing references) //IL_066a: Unknown result type (might be due to invalid IL or missing references) //IL_067e: Unknown result type (might be due to invalid IL or missing references) //IL_0692: Unknown result type (might be due to invalid IL or missing references) //IL_06b8: Unknown result type (might be due to invalid IL or missing references) //IL_06cc: Unknown result type (might be due to invalid IL or missing references) //IL_06e0: Unknown result type (might be due to invalid IL or missing references) //IL_0706: Unknown result type (might be due to invalid IL or missing references) //IL_071a: Unknown result type (might be due to invalid IL or missing references) //IL_072e: Unknown result type (might be due to invalid IL or missing references) //IL_0754: Unknown result type (might be due to invalid IL or missing references) //IL_0768: Unknown result type (might be due to invalid IL or missing references) //IL_077c: Unknown result type (might be due to invalid IL or missing references) //IL_07a2: Unknown result type (might be due to invalid IL or missing references) //IL_07b6: Unknown result type (might be due to invalid IL or missing references) //IL_07ca: Unknown result type (might be due to invalid IL or missing references) //IL_07f0: Unknown result type (might be due to invalid IL or missing references) //IL_0804: Unknown result type (might be due to invalid IL or missing references) //IL_0818: Unknown result type (might be due to invalid IL or missing references) //IL_0829: Unknown result type (might be due to invalid IL or missing references) //IL_0860: Unknown result type (might be due to invalid IL or missing references) //IL_088c: Unknown result type (might be due to invalid IL or missing references) //IL_08a0: Unknown result type (might be due to invalid IL or missing references) //IL_08b4: Unknown result type (might be due to invalid IL or missing references) //IL_091d: Unknown result type (might be due to invalid IL or missing references) //IL_0931: Unknown result type (might be due to invalid IL or missing references) //IL_0945: Unknown result type (might be due to invalid IL or missing references) //IL_08f7: Unknown result type (might be due to invalid IL or missing references) //IL_09c3: Unknown result type (might be due to invalid IL or missing references) //IL_09d7: Unknown result type (might be due to invalid IL or missing references) //IL_09dc: Unknown result type (might be due to invalid IL or missing references) //IL_0994: Unknown result type (might be due to invalid IL or missing references) //IL_099e: Unknown result type (might be due to invalid IL or missing references) //IL_0a1e: Unknown result type (might be due to invalid IL or missing references) //IL_0a32: Unknown result type (might be due to invalid IL or missing references) //IL_0a62: Unknown result type (might be due to invalid IL or missing references) //IL_0a76: Unknown result type (might be due to invalid IL or missing references) //IL_0aa6: Unknown result type (might be due to invalid IL or missing references) //IL_0aba: Unknown result type (might be due to invalid IL or missing references) //IL_0aeb: Unknown result type (might be due to invalid IL or missing references) //IL_0af0: Unknown result type (might be due to invalid IL or missing references) //IL_0b06: Unknown result type (might be due to invalid IL or missing references) //IL_0b0b: Unknown result type (might be due to invalid IL or missing references) //IL_0b21: Unknown result type (might be due to invalid IL or missing references) //IL_0b26: Unknown result type (might be due to invalid IL or missing references) //IL_0b3c: Unknown result type (might be due to invalid IL or missing references) //IL_0b41: Unknown result type (might be due to invalid IL or missing references) //IL_0b57: Unknown result type (might be due to invalid IL or missing references) //IL_0b5c: Unknown result type (might be due to invalid IL or missing references) //IL_0b72: Unknown result type (might be due to invalid IL or missing references) //IL_0b77: Unknown result type (might be due to invalid IL or missing references) //IL_0b8b: Unknown result type (might be due to invalid IL or missing references) //IL_0b90: Unknown result type (might be due to invalid IL or missing references) //IL_0b97: Unknown result type (might be due to invalid IL or missing references) //IL_0b9e: Expected O, but got Unknown //IL_0bb9: Unknown result type (might be due to invalid IL or missing references) //IL_0bc7: Unknown result type (might be due to invalid IL or missing references) //IL_0bcc: Unknown result type (might be due to invalid IL or missing references) //IL_0bd1: Unknown result type (might be due to invalid IL or missing references) //IL_0c09: Unknown result type (might be due to invalid IL or missing references) //IL_0c33: Unknown result type (might be due to invalid IL or missing references) //IL_0c5d: Unknown result type (might be due to invalid IL or missing references) //IL_0c87: Unknown result type (might be due to invalid IL or missing references) //IL_0cb1: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)generator.LevelParent)) { for (int num = generator.LevelParent.transform.childCount - 1; num >= 0; num--) { Object.Destroy((Object)(object)((Component)generator.LevelParent.transform.GetChild(num)).gameObject); } } EmpressElevatorSceneState empressElevatorSceneState = new EmpressElevatorSceneState(); int num2 = (int)DateTime.UtcNow.Ticks; Scene activeScene = SceneManager.GetActiveScene(); empressElevatorSceneState.RunToken = num2 ^ ((Scene)(ref activeScene)).handle ^ Random.Range(1024, int.MaxValue); empressElevatorSceneState.RunSeed = (int)DateTime.UtcNow.Ticks ^ 0x5EED123; empressElevatorSceneState.Generator = generator; EmpressElevatorSceneState empressElevatorSceneState2 = empressElevatorSceneState; if (SemiFunc.IsMultiplayer() && !SemiFunc.IsMasterClientOrSingleplayer() && _hasPendingSceneSync) { empressElevatorSceneState2.RunToken = _pendingRunToken; empressElevatorSceneState2.RunSeed = _pendingRunSeed; } GameObject val = new GameObject("Empress Elevator Root"); val.transform.SetParent(generator.LevelParent.transform, false); empressElevatorSceneState2.LevelRoot = val.transform; GameObject val2 = new GameObject("Empress Elevator Module"); val2.transform.SetParent(val.transform, false); PhotonView val3 = val2.AddComponent(); val3.ObservedComponents = new List(); Module val4 = val2.AddComponent(); val4.SetAllChecklist(); val4.SetupDone = true; val4.StartRoom = true; val4.GridX = 0; val4.GridY = 0; val2.AddComponent(); GameObject val5 = new GameObject("Elevator Room Volume"); val5.transform.SetParent(val2.transform, false); RoomVolume val6 = val5.AddComponent(); BoxCollider val7 = val5.AddComponent(); ((Collider)val7).isTrigger = true; val7.size = new Vector3(16f, 8f, 25f); val7.center = new Vector3(0f, 2.6999998f, 4.5499997f); empressElevatorSceneState2.RoomVolume = val6; GameObject val8 = new GameObject("Elevator Cabin"); val8.transform.SetParent(val2.transform, false); empressElevatorSceneState2.CabinRoot = val8.transform; GameObject val9 = new GameObject("Event Chamber"); val9.transform.SetParent(val2.transform, false); val9.transform.localPosition = new Vector3(0f, 0f, 11.5f); empressElevatorSceneState2.ChamberRoot = val9.transform; CreateBox(val8.transform, "Cabin Floor", new Vector3(0f, -0.5f, 0f), new Vector3(10f, 1f, 8f), new Color(0.12f, 0.12f, 0.13f)); CreateBox(val8.transform, "Cabin Ceiling", new Vector3(0f, 5.5f, 0f), new Vector3(10f, 1f, 8f), new Color(0.18f, 0.15f, 0.12f)); CreateBox(val8.transform, "Cabin Left Wall", new Vector3(-5.2f, 2.5f, 0f), new Vector3(0.4f, 5f, 8f), new Color(0.33f, 0.24f, 0.19f)); CreateBox(val8.transform, "Cabin Right Wall", new Vector3(5.2f, 2.5f, 0f), new Vector3(0.4f, 5f, 8f), new Color(0.33f, 0.24f, 0.19f)); CreateBox(val8.transform, "Cabin Back Wall", new Vector3(0f, 2.5f, -4.2f), new Vector3(10f, 5f, 0.4f), new Color(0.28f, 0.19f, 0.16f)); CreateBox(val8.transform, "Cabin Door Header", new Vector3(0f, 4.5f, 3.92f), new Vector3(10f, 1f, 0.45f), new Color(0.36f, 0.18f, 0.08f)); CreateBox(val8.transform, "Cabin Door Frame Left", new Vector3(-4.45f, 2.3f, 3.92f), new Vector3(1.1f, 4f, 0.45f), new Color(0.36f, 0.18f, 0.08f)); CreateBox(val8.transform, "Cabin Door Frame Right", new Vector3(4.45f, 2.3f, 3.92f), new Vector3(1.1f, 4f, 0.45f), new Color(0.36f, 0.18f, 0.08f)); float num3 = 4.58f; float num4 = num3 * 0.5f - 0.03f; empressElevatorSceneState2.DoorLeft = CreateBox(val8.transform, "Door Left", new Vector3(-1.95f, num4, 3.94f), new Vector3(3.9f, num3, 0.18f), new Color(0.9f, 0.47f, 0.19f)).transform; empressElevatorSceneState2.DoorRight = CreateBox(val8.transform, "Door Right", new Vector3(1.95f, num4, 3.94f), new Vector3(3.9f, num3, 0.18f), new Color(0.9f, 0.47f, 0.19f)).transform; empressElevatorSceneState2.DoorLeftClosedLocal = empressElevatorSceneState2.DoorLeft.localPosition; empressElevatorSceneState2.DoorRightClosedLocal = empressElevatorSceneState2.DoorRight.localPosition; empressElevatorSceneState2.DoorLeftOpenLocal = new Vector3(-5.85f, empressElevatorSceneState2.DoorLeftClosedLocal.y, empressElevatorSceneState2.DoorLeftClosedLocal.z); empressElevatorSceneState2.DoorRightOpenLocal = new Vector3(5.85f, empressElevatorSceneState2.DoorRightClosedLocal.y, empressElevatorSceneState2.DoorRightClosedLocal.z); GameObject val10 = CreateBox(val8.transform, "Empress Barrier", new Vector3(0f, 2.5f, 4.2f), new Vector3(8.8f, 4.4f, 0.12f), Color.clear); empressElevatorSceneState2.BarrierCollider = val10.GetComponent(); MeshRenderer val11 = default(MeshRenderer); if (val10.TryGetComponent(ref val11)) { ((Renderer)val11).enabled = false; } CreateBox(val9.transform, "Chamber Floor", new Vector3(0f, -0.5f, 0f), new Vector3(12f, 1f, 13f), new Color(0.09f, 0.09f, 0.12f)); CreateBox(val9.transform, "Chamber Ceiling", new Vector3(0f, 6.5f, 0f), new Vector3(12f, 1f, 13f), new Color(0.09f, 0.06f, 0.09f)); CreateBox(val9.transform, "Chamber Left Wall", new Vector3(-6.2f, 3f, 0f), new Vector3(0.4f, 6f, 13f), new Color(0.11f, 0.08f, 0.15f)); CreateBox(val9.transform, "Chamber Right Wall", new Vector3(6.2f, 3f, 0f), new Vector3(0.4f, 6f, 13f), new Color(0.11f, 0.08f, 0.15f)); CreateBox(val9.transform, "Chamber Back Wall", new Vector3(0f, 3f, 6.7f), new Vector3(12f, 6f, 0.4f), new Color(0.11f, 0.08f, 0.15f)); CreateBox(val9.transform, "Chamber Accent Rail", new Vector3(0f, 0.12f, -3.25f), new Vector3(10f, 0.1f, 0.3f), new Color(0.88f, 0.46f, 0.19f)); empressElevatorSceneState2.EventAnchor = new GameObject("Empress Event Anchor").transform; empressElevatorSceneState2.EventAnchor.SetParent(val9.transform, false); empressElevatorSceneState2.EventAnchor.localPosition = new Vector3(0f, 0f, 0.5f); BuildDecisionBoard(empressElevatorSceneState2); GameObject val12 = CreateBox(val8.transform, "Emergency Plate", new Vector3(4.84f, 1.6f, -0.9f), new Vector3(0.08f, 0.65f, 0.9f), new Color(0.14f, 0.04f, 0.04f)); MeshRenderer val13 = default(MeshRenderer); if (val12.TryGetComponent(ref val13)) { ((Renderer)val13).material.EnableKeyword("_EMISSION"); ((Renderer)val13).material.SetColor("_EmissionColor", new Color(0.25f, 0.03f, 0.03f)); } empressElevatorSceneState2.SkipButton = CreateBox(val8.transform, "Emergency Skip Button", new Vector3(4.7f, 1.6f, -0.9f), new Vector3(0.22f, 0.22f, 0.36f), new Color(0.95f, 0.12f, 0.1f)).transform; MeshRenderer val14 = default(MeshRenderer); if (((Component)empressElevatorSceneState2.SkipButton).TryGetComponent(ref val14)) { ((Renderer)val14).material.EnableKeyword("_EMISSION"); ((Renderer)val14).material.SetColor("_EmissionColor", new Color(1f, 0.1f, 0.08f) * 1.6f); } GameObject val15 = CreateBox(val8.transform, "Emergency Skip Trigger", new Vector3(4.2799997f, 1.6f, -0.9f), new Vector3(1.25f, 0.92f, 1.28f), Color.clear); Collider val16 = default(Collider); if (val15.TryGetComponent(ref val16)) { val16.isTrigger = true; } empressElevatorSceneState2.SkipButtonTrigger = val15.transform; CreateLight(val8.transform, new Vector3(-2.4f, 4.3f, -1.5f), new Color(1f, 0.67f, 0.36f), 2.1f, 12f, empressElevatorSceneState2.CabinLights); CreateLight(val8.transform, new Vector3(2.4f, 4.3f, -1.5f), new Color(1f, 0.67f, 0.36f), 2.1f, 12f, empressElevatorSceneState2.CabinLights); CreateLight(val9.transform, new Vector3(0f, 5.4f, 0f), new Color(0.95f, 0.4f, 0.65f), 1.4f, 18f, empressElevatorSceneState2.CabinLights); Vector3[] array = (Vector3[])(object)new Vector3[6] { new Vector3(-2.4f, 0.2f, -2.2f), new Vector3(0f, 0.2f, -2.2f), new Vector3(2.4f, 0.2f, -2.2f), new Vector3(-2.4f, 0.2f, 0.4f), new Vector3(0f, 0.2f, 0.4f), new Vector3(2.4f, 0.2f, 0.4f) }; Vector3[] array2 = array; foreach (Vector3 localPosition in array2) { GameObject val17 = new GameObject("Elevator Spawn"); val17.transform.SetParent(val8.transform, false); val17.transform.localPosition = localPosition; val17.transform.localRotation = Quaternion.LookRotation(Vector3.forward, Vector3.up); val17.AddComponent(); } CreateLevelPoint(val2.transform, val6, generator, new Vector3(0f, 0.15f, -2.6f), truck: true, empressElevatorSceneState2.LevelPoints); CreateLevelPoint(val2.transform, val6, generator, new Vector3(0f, 0.15f, -0.5f), truck: false, empressElevatorSceneState2.LevelPoints); CreateLevelPoint(val2.transform, val6, generator, new Vector3(0f, 0.15f, 2.6f), truck: false, empressElevatorSceneState2.LevelPoints); CreateLevelPoint(val2.transform, val6, generator, new Vector3(0f, 0.15f, 7.5f), truck: false, empressElevatorSceneState2.LevelPoints); CreateLevelPoint(val2.transform, val6, generator, new Vector3(0f, 0.15f, 11.8f), truck: false, empressElevatorSceneState2.LevelPoints); for (int j = 0; j < empressElevatorSceneState2.LevelPoints.Count; j++) { empressElevatorSceneState2.LevelPoints[j].ConnectedPoints = new List(); if (j > 0) { empressElevatorSceneState2.LevelPoints[j].ConnectedPoints.Add(empressElevatorSceneState2.LevelPoints[j - 1]); } if (j + 1 < empressElevatorSceneState2.LevelPoints.Count) { empressElevatorSceneState2.LevelPoints[j].ConnectedPoints.Add(empressElevatorSceneState2.LevelPoints[j + 1]); } empressElevatorSceneState2.LevelPoints[j].Room = val6; empressElevatorSceneState2.LevelPoints[j].ModuleConnect = true; } empressElevatorSceneState2.HudCanvas = BuildHudCanvas(empressElevatorSceneState2); return empressElevatorSceneState2; } private static LevelPoint CreateLevelPoint(Transform parent, RoomVolume roomVolume, LevelGenerator generator, Vector3 localPosition, bool truck, List sink) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown //IL_002e: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("Empress Level Point"); val.layer = LayerMask.NameToLayer("Other"); val.transform.SetParent(parent, false); val.transform.localPosition = localPosition; SphereCollider val2 = val.AddComponent(); ((Collider)val2).isTrigger = true; val2.radius = 0.35f; LevelPoint val3 = val.AddComponent(); val3.ConnectedPoints = new List(); val3.Room = roomVolume; val3.Truck = truck; val3.ModuleConnect = true; val3.inStartRoom = true; if (generator.LevelPathPoints == null) { generator.LevelPathPoints = new List(); } sink.Add(val3); return val3; } private Canvas BuildHudCanvas(EmpressElevatorSceneState scene) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Expected O, but got Unknown //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Expected O, but got Unknown //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_0158: 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_0191: Unknown result type (might be due to invalid IL or missing references) //IL_01a0: Unknown result type (might be due to invalid IL or missing references) //IL_01ca: 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_01e8: Unknown result type (might be due to invalid IL or missing references) //IL_0212: 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) //IL_0230: 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_026e: Unknown result type (might be due to invalid IL or missing references) //IL_0284: Unknown result type (might be due to invalid IL or missing references) //IL_02af: Unknown result type (might be due to invalid IL or missing references) //IL_02b6: Expected O, but got Unknown //IL_02e8: Unknown result type (might be due to invalid IL or missing references) //IL_0307: Unknown result type (might be due to invalid IL or missing references) //IL_031d: Unknown result type (might be due to invalid IL or missing references) //IL_0333: Unknown result type (might be due to invalid IL or missing references) //IL_0349: Unknown result type (might be due to invalid IL or missing references) //IL_035f: Unknown result type (might be due to invalid IL or missing references) //IL_0385: Unknown result type (might be due to invalid IL or missing references) //IL_0394: Unknown result type (might be due to invalid IL or missing references) //IL_03a3: Unknown result type (might be due to invalid IL or missing references) Font font = _uiFont ?? (_uiFont = Resources.GetBuiltinResource("Arial.ttf")); GameObject val = new GameObject("Empress Elevator HUD"); val.transform.SetParent(((Component)this).transform, false); Canvas val2 = val.AddComponent(); val2.renderMode = (RenderMode)0; val2.sortingOrder = 700; val.AddComponent(); val.AddComponent(); GameObject val3 = new GameObject("Header"); val3.transform.SetParent(val.transform, false); Image val4 = val3.AddComponent(); ((Graphic)val4).color = new Color(0.04f, 0.04f, 0.06f, 0.78f); RectTransform component = val3.GetComponent(); component.anchorMin = new Vector2(0.5f, 1f); component.anchorMax = new Vector2(0.5f, 1f); component.pivot = new Vector2(0.5f, 1f); component.sizeDelta = new Vector2(560f, 92f); component.anchoredPosition = new Vector2(0f, -24f); scene.FloorText = CreateHudText(val3.transform, font, 34, (FontStyle)1, (TextAnchor)1, new Color(1f, 0.82f, 0.58f), new Vector2(520f, 36f), new Vector2(0f, -8f)); scene.StatusText = CreateHudText(val3.transform, font, 18, (FontStyle)1, (TextAnchor)4, new Color(1f, 0.62f, 0.34f), new Vector2(520f, 24f), new Vector2(0f, -40f)); scene.EventNameText = CreateHudText(val3.transform, font, 16, (FontStyle)0, (TextAnchor)4, new Color(0.92f, 0.92f, 0.92f), new Vector2(520f, 24f), new Vector2(0f, -64f)); scene.RewardText = CreateHudText(val.transform, font, 20, (FontStyle)1, (TextAnchor)4, new Color(1f, 0.93f, 0.54f), new Vector2(700f, 28f), new Vector2(0f, -132f)); RectTransform rectTransform = ((Graphic)scene.RewardText).rectTransform; rectTransform.anchorMin = new Vector2(0.5f, 1f); rectTransform.anchorMax = new Vector2(0.5f, 1f); rectTransform.pivot = new Vector2(0.5f, 1f); scene.RewardText.text = string.Empty; ((Behaviour)scene.RewardText).enabled = false; GameObject val5 = new GameObject("Emergency Prompt"); val5.transform.SetParent(val.transform, false); Image val6 = val5.AddComponent(); ((Graphic)val6).color = new Color(0.05f, 0.05f, 0.06f, 0.78f); RectTransform component2 = val5.GetComponent(); component2.anchorMin = new Vector2(0.5f, 0f); component2.anchorMax = new Vector2(0.5f, 0f); component2.pivot = new Vector2(0.5f, 0f); component2.sizeDelta = new Vector2(420f, 34f); component2.anchoredPosition = new Vector2(0f, 24f); scene.PromptText = CreateHudText(val5.transform, font, 16, (FontStyle)1, (TextAnchor)4, new Color(1f, 0.74f, 0.68f), new Vector2(388f, 28f), new Vector2(0f, -3f)); scene.PromptText.text = string.Empty; ((Behaviour)val6).enabled = false; scene.PromptBackground = val6; return val2; } private static Text CreateHudText(Transform parent, Font font, int fontSize, FontStyle fontStyle, TextAnchor anchor, Color color, Vector2 size, Vector2 position) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown //IL_002e: 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_003d: 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_006b: 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_008b: 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) GameObject val = new GameObject("Text"); val.transform.SetParent(parent, false); Text val2 = val.AddComponent(); val2.font = font; val2.fontSize = fontSize; val2.fontStyle = fontStyle; val2.alignment = anchor; ((Graphic)val2).color = color; RectTransform component = val.GetComponent(); component.anchorMin = new Vector2(0.5f, 1f); component.anchorMax = new Vector2(0.5f, 1f); component.pivot = new Vector2(0.5f, 1f); component.sizeDelta = size; component.anchoredPosition = position; return val2; } private static GameObject CreateBox(Transform parent, string name, Vector3 localPosition, Vector3 localScale, Color color) { //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_003d: 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_005c: Unknown result type (might be due to invalid IL or missing references) GameObject val = GameObject.CreatePrimitive((PrimitiveType)3); ((Object)val).name = name; val.transform.SetParent(parent, false); val.transform.localPosition = localPosition; val.transform.localRotation = Quaternion.identity; val.transform.localScale = localScale; MeshRenderer val2 = default(MeshRenderer); if (val.TryGetComponent(ref val2)) { Material material = ((Renderer)val2).material; material.color = color; if (color.a <= 0f) { ((Renderer)val2).enabled = false; } } return val; } private static void CreateLight(Transform parent, Vector3 localPosition, Color color, float intensity, float range, List sink) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown //IL_001e: 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) GameObject val = new GameObject("Empress Light"); val.transform.SetParent(parent, false); val.transform.localPosition = localPosition; Light val2 = val.AddComponent(); val2.type = (LightType)2; val2.color = color; val2.intensity = intensity; val2.range = range; sink.Add(val2); } private void BuildDecisionBoard(EmpressElevatorSceneState scene) { //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_007f: 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_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: 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_0121: 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_0149: Unknown result type (might be due to invalid IL or missing references) //IL_01ac: Unknown result type (might be due to invalid IL or missing references) //IL_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01e0: Unknown result type (might be due to invalid IL or missing references) //IL_01e5: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("Decision Board"); val.transform.SetParent(scene.EventAnchor, false); val.transform.localPosition = new Vector3(0f, 0.02f, -4.15f); scene.DecisionBoardRoot = val.transform; for (int i = 0; i < 3; i++) { float num = Mathf.Lerp(-1.4f, 1.4f, (float)i / 2f); CreateBox(val.transform, "Good Tile", new Vector3(-1.55f, 0f, num), new Vector3(1.45f, 0.06f, 0.82f), new Color(0.24f, 0.78f, 0.36f)); CreateBox(val.transform, "Bad Tile", new Vector3(1.55f, 0f, num), new Vector3(1.45f, 0.06f, 0.82f), new Color(0.84f, 0.18f, 0.18f)); } GameObject val2 = CreateBox(val.transform, "Decision Divider", new Vector3(0f, 0.1f, 0f), new Vector3(0.18f, 0.2f, 3.1f), new Color(0.98f, 0.8f, 0.36f)); MeshRenderer val3 = default(MeshRenderer); if (val2.TryGetComponent(ref val3)) { ((Renderer)val3).material.EnableKeyword("_EMISSION"); ((Renderer)val3).material.SetColor("_EmissionColor", new Color(0.98f, 0.8f, 0.36f) * 1.2f); } scene.RollCubeStartLocal = new Vector3(0f, 1.55f, -3.5f); scene.RollCubeGoodLocal = new Vector3(-1.55f, 0.42f, 0f); scene.RollCubeBadLocal = new Vector3(1.55f, 0.42f, 0f); } private void BeginFloorReveal(int floorNumber, EmpressElevatorFloorDefinition definition) { //IL_00b6: 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_01bd: Unknown result type (might be due to invalid IL or missing references) if (_scene != null) { ClearActiveEventRoot(); _scene.CurrentFloorNumber = floorNumber; _scene.PendingFloorNumber = floorNumber + 1; _scene.ActiveDefinition = definition; _scene.Phase = EmpressElevatorPhase.Opening; _scene.PhaseStartedAt = Time.time + 0.56f; _scene.NextAuthorityTickAt = 0f; _scene.SkipRewardForFloor = false; _scene.EventVisualsBuilt = false; _skipHoldElapsed = 0f; _effectCooldowns.Clear(); _ruleAnchors.Clear(); _ruleStillTimers.Clear(); _scene.ActiveEventRoot = new GameObject("Empress Floor Event").transform; _scene.ActiveEventRoot.SetParent(_scene.EventAnchor, false); _scene.ActiveCabinEventRoot = new GameObject("Empress Cabin Floor Event").transform; _scene.ActiveCabinEventRoot.SetParent(_scene.CabinRoot, false); _scene.ActivePieces.Clear(); _scene.RollCube = BuildDecisionRoll(_scene, definition.Hostile); _scene.FloorText.text = "FLOOR " + floorNumber.ToString("000"); _scene.StatusText.text = "Doors Unlocking"; _scene.EventNameText.text = (definition.Hostile ? "Red tile means pain inside the elevator" : "Green tile means something nice outside"); ((Graphic)_scene.StatusText).color = new Color(1f, 0.7f, 0.4f); PlayDoorOpenCue(); } } private void UpdateDoorsAndHud() { //IL_00d0: 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_00eb: 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_0123: 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_02d5: Unknown result type (might be due to invalid IL or missing references) //IL_022a: Unknown result type (might be due to invalid IL or missing references) //IL_023a: Unknown result type (might be due to invalid IL or missing references) //IL_0244: Unknown result type (might be due to invalid IL or missing references) //IL_0218: Unknown result type (might be due to invalid IL or missing references) if (_scene == null) { return; } float num = _scene.Phase switch { EmpressElevatorPhase.Opening => Mathf.Clamp01((Time.time - _scene.PhaseStartedAt) / 1.35f), EmpressElevatorPhase.Event => 1f, EmpressElevatorPhase.Closing => 1f - Mathf.Clamp01((Time.time - _scene.PhaseStartedAt) / 1.35f), _ => 0f, }; _scene.DoorOpenAmount = Mathf.MoveTowards(_scene.DoorOpenAmount, num, Time.deltaTime * 2.4f); if (Object.op_Implicit((Object)(object)_scene.DoorLeft)) { _scene.DoorLeft.localPosition = Vector3.Lerp(_scene.DoorLeftClosedLocal, _scene.DoorLeftOpenLocal, _scene.DoorOpenAmount); } if (Object.op_Implicit((Object)(object)_scene.DoorRight)) { _scene.DoorRight.localPosition = Vector3.Lerp(_scene.DoorRightClosedLocal, _scene.DoorRightOpenLocal, _scene.DoorOpenAmount); } float num2 = 0.78f + Mathf.Sin(Time.time * ((_scene.ActiveDefinition != null) ? 3.6f : 1.65f)) * 0.12f; EmpressElevatorFloorDefinition? activeDefinition = _scene.ActiveDefinition; float num3 = ((activeDefinition != null && activeDefinition.Kind == EmpressElevatorEventKind.DoNotTurnAround) ? 0.18f : 1f); foreach (Light cabinLight in _scene.CabinLights) { if (Object.op_Implicit((Object)(object)cabinLight)) { cabinLight.intensity = num2 * ((_scene.ActiveDefinition != null && _scene.ActiveDefinition.Hostile) ? 2.1f : 1.8f) * num3; cabinLight.color = (Color)((_scene.ActiveDefinition != null) ? Color.Lerp(_scene.ActiveDefinition.PrimaryColor, _scene.ActiveDefinition.SecondaryColor, 0.35f) : new Color(1f, 0.67f, 0.36f)); } } if (_scene.ActiveDefinition == null) { _scene.FloorText.text = "FLOOR " + _scene.PendingFloorNumber.ToString("000"); _scene.StatusText.text = "Ascending"; ((Graphic)_scene.StatusText).color = new Color(1f, 0.68f, 0.34f); _scene.EventNameText.text = "Waiting for the next stop"; } bool flag = Time.time < _scene.RewardTextUntil; _scene.RewardText.text = (flag ? _scene.RewardText.text : string.Empty); ((Behaviour)_scene.RewardText).enabled = flag; } private void UpdateActiveEvent() { //IL_0121: 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) if (_scene == null || _scene.ActiveDefinition == null) { ResetLocalPlayerEventEffects(); return; } float num = Time.time - _scene.PhaseStartedAt; switch (_scene.Phase) { case EmpressElevatorPhase.Opening: UpdateDecisionRoll(_scene, _scene.ActiveDefinition, num); if (num >= 2.95f) { BuildEventVisuals(_scene, _scene.ActiveDefinition); _scene.EventVisualsBuilt = true; _scene.Phase = EmpressElevatorPhase.Event; _scene.PhaseStartedAt = Time.time; _scene.StatusText.text = (_scene.ActiveDefinition.Hostile ? "Warning" : "Blessing"); ((Graphic)_scene.StatusText).color = (_scene.ActiveDefinition.Hostile ? new Color(1f, 0.45f, 0.28f) : new Color(0.56f, 1f, 0.73f)); _scene.EventNameText.text = _scene.ActiveDefinition.Name; } break; case EmpressElevatorPhase.Event: { float normalized = Mathf.Clamp01(num / Mathf.Max(0.1f, _scene.ActiveDefinition.EventDuration)); UpdateActivePieces(_scene, _scene.ActiveDefinition, normalized); UpdateLocalPlayerEventEffects(_scene, _scene.ActiveDefinition, num, normalized); string text2 = UpdateSpecialObjective(_scene, _scene.ActiveDefinition, num, normalized); _scene.EventNameText.text = (string.IsNullOrWhiteSpace(text2) ? GetLiveDirectiveText(_scene.ActiveDefinition, num) : text2); if (SemiFunc.IsMasterClientOrSingleplayer() && Time.time >= _scene.NextAuthorityTickAt) { _scene.NextAuthorityTickAt = Time.time + (_scene.ActiveDefinition.Hostile ? 0.16f : 1.25f); ApplyAuthorityEffects(_scene, _scene.ActiveDefinition, num, normalized); } if (num >= _scene.ActiveDefinition.EventDuration) { SetBarrierBlocked(_scene, blocked: true); _scene.Phase = EmpressElevatorPhase.Closing; _scene.PhaseStartedAt = Time.time; } break; } case EmpressElevatorPhase.Closing: { ResetLocalPlayerEventEffects(); if (_scene.EventVisualsBuilt) { UpdateActivePieces(_scene, _scene.ActiveDefinition, 1f); } string text = UpdateClosingSpecialObjective(_scene, num); if (!string.IsNullOrWhiteSpace(text)) { _scene.EventNameText.text = text; } if (num >= 1.35f && !ShouldDelayClosingForObjective(_scene)) { if (SemiFunc.IsMasterClientOrSingleplayer() && !_scene.SkipRewardForFloor) { GrantFloorReward(_scene, _scene.ActiveDefinition); } ClearActiveEventRoot(); _scene.ActiveDefinition = null; _scene.Phase = EmpressElevatorPhase.Moving; _scene.PhaseStartedAt = Time.time; _scene.EventVisualsBuilt = false; _scene.SkipRewardForFloor = false; } break; } } } private void ClearActiveEventRoot() { if (_scene != null) { EmpressElevatorSceneState scene = _scene; scene.ActivePieces.Clear(); Transform activeEventRoot = scene.ActiveEventRoot; if (Object.op_Implicit((Object)(object)activeEventRoot)) { Object.Destroy((Object)(object)((Component)activeEventRoot).gameObject); scene.ActiveEventRoot = null; } Transform activeCabinEventRoot = scene.ActiveCabinEventRoot; if (Object.op_Implicit((Object)(object)activeCabinEventRoot)) { Object.Destroy((Object)(object)((Component)activeCabinEventRoot).gameObject); scene.ActiveCabinEventRoot = null; } scene.ActiveObjective = null; SetBarrierBlocked(scene, blocked: true); scene.RollCube = null; } } private void UpdateEmergencyButtonPrompt() { //IL_01e4: Unknown result type (might be due to invalid IL or missing references) //IL_01fd: Unknown result type (might be due to invalid IL or missing references) //IL_0203: Unknown result type (might be due to invalid IL or missing references) if (_scene == null || (Object)(object)_scene.PromptText == (Object)null || (Object)(object)_scene.PromptBackground == (Object)null) { return; } if (_scene.LevelExitRequested || (Object)(object)Camera.main == (Object)null || (Object)(object)PlayerController.instance == (Object)null) { _skipHoldElapsed = 0f; _scene.PromptText.text = string.Empty; ((Behaviour)_scene.PromptBackground).enabled = false; return; } if (!TryGetEmergencyButtonHit(out var _)) { _skipHoldElapsed = 0f; _scene.PromptText.text = string.Empty; ((Behaviour)_scene.PromptBackground).enabled = false; return; } if (SemiFunc.NoTextInputsActive() && SemiFunc.InputHold((InputKey)2)) { _skipHoldElapsed = Mathf.Min(3f, _skipHoldElapsed + Time.deltaTime); } else { _skipHoldElapsed = Mathf.Max(0f, _skipHoldElapsed - Time.deltaTime * 2.2f); } float num = Mathf.Clamp01(_skipHoldElapsed / 3f); float num2 = Mathf.Max(0f, 3f - _skipHoldElapsed); _scene.PromptText.text = "Hold E to cash out early " + (Mathf.Ceil(num2 * 10f) / 10f).ToString("0.0") + "s " + Mathf.RoundToInt(num * 100f) + "%"; ((Behaviour)_scene.PromptBackground).enabled = true; ((Graphic)_scene.PromptBackground).color = Color.Lerp(new Color(0.05f, 0.05f, 0.06f, 0.78f), new Color(0.78f, 0.12f, 0.12f, 0.92f), num); if (_skipHoldElapsed >= 3f) { _skipHoldElapsed = 0f; EmpressTheElevatorPlugin.RequestEmergencySkip(_scene.RunToken); } } private bool TryGetEmergencyButtonHit(out RaycastHit hit) { //IL_0001: 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_0055: Unknown result type (might be due to invalid IL or missing references) hit = default(RaycastHit); if (_scene == null || (Object)(object)_scene.SkipButton == (Object)null || (Object)(object)Camera.main == (Object)null) { return false; } if (TryGetEmergencyButtonAimAssist(out hit)) { return true; } if (!Physics.Raycast(((Component)Camera.main).transform.position, ((Component)Camera.main).transform.forward, ref hit, 4.8f, LayerMask.GetMask(new string[1] { "Default" }), (QueryTriggerInteraction)2)) { return false; } if (!((Object)(object)((RaycastHit)(ref hit)).transform == (Object)(object)_scene.SkipButton) && !((RaycastHit)(ref hit)).transform.IsChildOf(_scene.SkipButton)) { if ((Object)(object)_scene.SkipButtonTrigger != (Object)null) { if (!((Object)(object)((RaycastHit)(ref hit)).transform == (Object)(object)_scene.SkipButtonTrigger)) { return ((RaycastHit)(ref hit)).transform.IsChildOf(_scene.SkipButtonTrigger); } return true; } return false; } return true; } private bool TryGetEmergencyButtonAimAssist(out RaycastHit hit) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007b: 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_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_00ca: 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) hit = default(RaycastHit); if (_scene == null || (Object)(object)_scene.SkipButton == (Object)null || (Object)(object)Camera.main == (Object)null) { return false; } Transform val = (Transform)(((Object)(object)_scene.SkipButtonTrigger != (Object)null) ? ((object)_scene.SkipButtonTrigger) : ((object)_scene.SkipButton)); Vector3 position = val.position; Vector3 position2 = ((Component)Camera.main).transform.position; Vector3 val2 = position - position2; float magnitude = ((Vector3)(ref val2)).magnitude; if (magnitude > 4.8f || magnitude <= 0.01f) { return false; } Vector3 forward = ((Component)Camera.main).transform.forward; float num = Vector3.Dot(((Vector3)(ref forward)).normalized, ((Vector3)(ref val2)).normalized); if (num < 0.9f) { return false; } if (Physics.SphereCast(position2, 0.18f, ((Component)Camera.main).transform.forward, ref hit, magnitude + 0.25f, LayerMask.GetMask(new string[1] { "Default" }), (QueryTriggerInteraction)2)) { if (!((Object)(object)((RaycastHit)(ref hit)).transform == (Object)(object)_scene.SkipButton) && !((RaycastHit)(ref hit)).transform.IsChildOf(_scene.SkipButton)) { if ((Object)(object)_scene.SkipButtonTrigger != (Object)null) { if (!((Object)(object)((RaycastHit)(ref hit)).transform == (Object)(object)_scene.SkipButtonTrigger)) { return ((RaycastHit)(ref hit)).transform.IsChildOf(_scene.SkipButtonTrigger); } return true; } return false; } return true; } return false; } private Transform BuildDecisionRoll(EmpressElevatorSceneState scene, bool hostile) { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0045: 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_0081: 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_00cc: Unknown result type (might be due to invalid IL or missing references) GameObject val = GameObject.CreatePrimitive((PrimitiveType)3); ((Object)val).name = "Decision Cube"; val.transform.SetParent(scene.ActiveEventRoot, false); val.transform.localScale = Vector3.one * 0.78f; val.transform.localPosition = scene.RollCubeStartLocal; Collider val2 = default(Collider); if (val.TryGetComponent(ref val2)) { Object.Destroy((Object)(object)val2); } MeshRenderer val3 = default(MeshRenderer); if (val.TryGetComponent(ref val3)) { ((Renderer)val3).material.color = (hostile ? new Color(0.97f, 0.28f, 0.24f) : new Color(0.36f, 0.92f, 0.44f)); ((Renderer)val3).material.EnableKeyword("_EMISSION"); ((Renderer)val3).material.SetColor("_EmissionColor", ((Renderer)val3).material.color * 1.3f); } return val.transform; } private void UpdateDecisionRoll(EmpressElevatorSceneState scene, EmpressElevatorFloorDefinition definition, float phaseAge) { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0032: 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_003f: 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_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_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)scene.RollCube == (Object)null)) { float num = Mathf.Clamp01(phaseAge / 2.95f); Vector3 val = (definition.Hostile ? scene.RollCubeBadLocal : scene.RollCubeGoodLocal); Vector3 middle = Vector3.Lerp(scene.RollCubeStartLocal, val, 0.5f) + Vector3.up * 1.8f; scene.RollCube.localPosition = CalculateBezier(scene.RollCubeStartLocal, middle, val, num); scene.RollCube.localRotation = Quaternion.Euler(360f * num * 2.6f, 240f * num * 3.3f, 420f * num * 1.8f); } } private static Vector3 CalculateBezier(Vector3 start, Vector3 middle, Vector3 end, float t) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_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_0012: 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_0015: Unknown result type (might be due to invalid IL or missing references) Vector3 val = Vector3.Lerp(start, middle, t); Vector3 val2 = Vector3.Lerp(middle, end, t); return Vector3.Lerp(val, val2, t); } private void GrantFloorReward(EmpressElevatorSceneState scene, EmpressElevatorFloorDefinition definition) { if ((Object)(object)GameDirector.instance == (Object)null || (Object)(object)PunManager.instance == (Object)null) { return; } bool flag = false; foreach (PlayerAvatar player in GameDirector.instance.PlayerList) { if (Object.op_Implicit((Object)(object)player) && !player.deadSet) { flag = true; break; } } if (!flag) { EmpressTheElevatorPlugin.RaiseFloorReward(scene.RunToken, "No reward. Nobody made it."); return; } int num = SemiFunc.StatGetRunCurrency(); int num2 = (definition.Hostile ? 1 : 2); bool flag2 = scene.ActiveObjective != null && scene.ActiveObjective.Completed && (scene.ActiveObjective.Kind == EmpressElevatorSpecialObjectiveKind.SoloErrand || scene.ActiveObjective.Kind == EmpressElevatorSpecialObjectiveKind.TeamTrial); EmpressElevatorSpecialObjective? activeObjective = scene.ActiveObjective; if (activeObjective != null && activeObjective.Kind == EmpressElevatorSpecialObjectiveKind.SoloErrand && scene.ActiveObjective.Completed) { num2 = Mathf.Max(num2, 2); } else { EmpressElevatorSpecialObjective? activeObjective2 = scene.ActiveObjective; if (activeObjective2 != null && activeObjective2.Kind == EmpressElevatorSpecialObjectiveKind.TeamTrial && scene.ActiveObjective.Completed) { num2 = Mathf.Max(num2, 2); } } if (definition.Hostile && flag2 && Mathf.Abs(scene.RunSeed + scene.CurrentFloorNumber * 17 + definition.DefinitionIndex * 31) % 23 == 0) { num2 = 5; } SemiFunc.StatSetRunCurrency(num + num2); string text = "+$" + num2 + "K for clearing floor " + scene.CurrentFloorNumber.ToString("000"); if (!(!definition.Hostile || flag2) && scene.CurrentFloorNumber % 2 != 0) { SyncRewardStatsIfNeeded(); EmpressTheElevatorPlugin.RaiseFloorReward(scene.RunToken, text); return; } string[] array = new string[9] { "Health", "Stamina", "ExtraJump", "Speed", "Strength", "Throw", "Range", "CrouchRest", "TumbleWings" }; string rewardUpgrade = array[Random.Range(0, array.Length)]; foreach (PlayerAvatar player2 in GameDirector.instance.PlayerList) { if (Object.op_Implicit((Object)(object)player2)) { GrantUpgradeToPlayer(SemiFunc.PlayerGetSteamID(player2), rewardUpgrade); } } SyncRewardStatsIfNeeded(); EmpressTheElevatorPlugin.RaiseFloorReward(scene.RunToken, text + " :: +1 " + PrettyUpgradeName(rewardUpgrade) + " for everyone"); } private static void SyncRewardStatsIfNeeded() { if (!((Object)(object)PunManager.instance == (Object)null) && SemiFunc.IsMultiplayer() && PhotonNetwork.IsMasterClient) { PunManager.instance.SyncAllDictionaries(); } } private static void GrantUpgradeToPlayer(string steamId, string rewardUpgrade) { if (rewardUpgrade == null) { return; } switch (rewardUpgrade.Length) { case 5: switch (rewardUpgrade[0]) { case 'S': if (rewardUpgrade == "Speed") { PunManager.instance.UpgradePlayerSprintSpeed(steamId, 1); } break; case 'T': if (rewardUpgrade == "Throw") { PunManager.instance.UpgradePlayerThrowStrength(steamId, 1); } break; case 'R': if (rewardUpgrade == "Range") { PunManager.instance.UpgradePlayerGrabRange(steamId, 1); } break; } break; case 6: if (rewardUpgrade == "Health") { PunManager.instance.UpgradePlayerHealth(steamId, 1); } break; case 7: if (rewardUpgrade == "Stamina") { PunManager.instance.UpgradePlayerEnergy(steamId, 1); } break; case 9: if (rewardUpgrade == "ExtraJump") { PunManager.instance.UpgradePlayerExtraJump(steamId, 1); } break; case 8: if (rewardUpgrade == "Strength") { PunManager.instance.UpgradePlayerGrabStrength(steamId, 1); } break; case 10: if (rewardUpgrade == "CrouchRest") { PunManager.instance.UpgradePlayerCrouchRest(steamId, 1); } break; case 11: if (rewardUpgrade == "TumbleWings") { PunManager.instance.UpgradePlayerTumbleWings(steamId, 1); } break; } } private static string PrettyUpgradeName(string rewardUpgrade) { return rewardUpgrade switch { "CrouchRest" => "Crouch Rest", "ExtraJump" => "Extra Jump", "TumbleWings" => "Tumble Wings", _ => rewardUpgrade, }; } private void BuildEventVisuals(EmpressElevatorSceneState scene, EmpressElevatorFloorDefinition definition) { switch (definition.Kind) { case EmpressElevatorEventKind.ConfettiBloom: case EmpressElevatorEventKind.HealingRain: case EmpressElevatorEventKind.HeartPageant: case EmpressElevatorEventKind.BubbleDrift: BuildFallingField(scene, definition, definition.Kind != EmpressElevatorEventKind.ConfettiBloom); break; case EmpressElevatorEventKind.LanternOrbit: BuildOrbitField(scene, definition); break; case EmpressElevatorEventKind.PrismGarden: case EmpressElevatorEventKind.CylinderChoir: case EmpressElevatorEventKind.CalmAurora: BuildStandingField(scene, definition); break; case EmpressElevatorEventKind.TreasureDrizzle: BuildTreasureDrizzle(scene, definition); break; case EmpressElevatorEventKind.MoonBounce: BuildMoonBounce(scene, definition); break; case EmpressElevatorEventKind.SpotlightParade: BuildSpotlightParade(scene, definition); break; case EmpressElevatorEventKind.GiftPulse: BuildGiftPulse(scene, definition); break; case EmpressElevatorEventKind.TeamTrial: BuildTeamTrial(scene, definition); break; case EmpressElevatorEventKind.LaserSweep: BuildLaserSweep(scene, definition); break; case EmpressElevatorEventKind.DirectiveTrial: BuildDirectiveTrial(scene, definition); break; case EmpressElevatorEventKind.RollingOrbs: BuildRollingOrbs(scene, definition); break; case EmpressElevatorEventKind.CeilingPress: BuildCeilingPress(scene, definition); break; case EmpressElevatorEventKind.SpikeLattice: BuildSpikeLattice(scene, definition); break; case EmpressElevatorEventKind.ShockRing: BuildShockRing(scene, definition); break; case EmpressElevatorEventKind.SeekerOrbs: BuildSeekerOrbs(scene, definition); break; case EmpressElevatorEventKind.BounceBombs: BuildBounceBombs(scene, definition); break; case EmpressElevatorEventKind.SawSweep: BuildSawSweep(scene, definition); break; case EmpressElevatorEventKind.MeteorDrop: BuildMeteorDrop(scene, definition); break; case EmpressElevatorEventKind.PulseWall: BuildPulseWall(scene, definition); break; case EmpressElevatorEventKind.FreezeTag: BuildFreezeTag(scene, definition); break; case EmpressElevatorEventKind.MarathonPanic: BuildMarathonPanic(scene, definition); break; case EmpressElevatorEventKind.GravityFlip: BuildGravityFlip(scene, definition); break; case EmpressElevatorEventKind.SoloErrand: BuildSoloErrand(scene, definition); break; case EmpressElevatorEventKind.DoNotTurnAround: BuildDoNotTurnAround(scene, definition); break; } } private void BuildFallingField(EmpressElevatorSceneState scene, EmpressElevatorFloorDefinition definition, bool sphere) { //IL_000e: 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_0019: 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_0042: 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_0082: 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_00e0: 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) for (int i = 0; i < definition.Count; i++) { PrimitiveType primitiveType = (PrimitiveType)((!sphere) ? 3 : 0); Transform val = (definition.Hostile ? CreateEventPrimitive(scene, primitiveType, definition, "Falling Piece") : CreateCabinEventPrimitive(scene, primitiveType, definition, "Falling Piece")); val.localScale = Vector3.one * definition.Size; val.localPosition = (definition.Hostile ? new Vector3(Random.Range(-4.6f, 4.6f), Random.Range(1.4f, 4.8f), Random.Range(-3.8f, 5.4f)) : new Vector3(Random.Range(-4.35f, 4.35f), Random.Range(1.2f, 4.75f), Random.Range(-3.45f, 3.45f))); scene.ActivePieces.Add(new EmpressElevatorAnimatedPiece { Transform = val, Home = val.localPosition, Scale = val.localScale, Phase = Random.Range(0f, 1f), Speed = definition.Speed, Radius = 0.45f + definition.Size }); } } private void BuildOrbitField(EmpressElevatorSceneState scene, EmpressElevatorFloorDefinition definition) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < definition.Count; i++) { Transform val = CreateEventPrimitive(scene, (PrimitiveType)0, definition, "Orbit Piece"); val.localScale = Vector3.one * (definition.Size * 1.7f); scene.ActivePieces.Add(new EmpressElevatorAnimatedPiece { Transform = val, Scale = val.localScale, Phase = (float)i / Mathf.Max(1f, (float)definition.Count), Speed = definition.Speed, Radius = 2.4f + (float)(i % 3) * 1.2f, Home = new Vector3(0f, 2f + (float)(i % 4) * 0.5f, 0.8f) }); } } private void BuildStandingField(EmpressElevatorSceneState scene, EmpressElevatorFloorDefinition definition) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0084: 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_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_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) int num = Mathf.Clamp(definition.Count, 6, 20); for (int i = 0; i < num; i++) { PrimitiveType primitiveType = (PrimitiveType)((definition.Kind == EmpressElevatorEventKind.CylinderChoir) ? 2 : 3); Transform val = CreateEventPrimitive(scene, primitiveType, definition, "Standing Piece"); float num2 = Mathf.Lerp(-4.2f, 4.2f, (float)(i % 5) / 4f); float num3 = Mathf.Lerp(-1.5f, 5.6f, (float)i / 5f / Mathf.Max(1f, (float)num / 5f)); val.localPosition = new Vector3(num2, 0.5f, num3); val.localScale = new Vector3(definition.Size * 1.2f, 1.2f, definition.Size * 1.2f); scene.ActivePieces.Add(new EmpressElevatorAnimatedPiece { Transform = val, Home = val.localPosition, Scale = val.localScale, Phase = Random.Range(0f, 1f), Speed = definition.Speed }); } } private void BuildSpotlightParade(EmpressElevatorSceneState scene, EmpressElevatorFloorDefinition definition) { //IL_0026: 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_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < definition.Count; i++) { Transform val = CreateCabinEventPrimitive(scene, (PrimitiveType)3, definition, "Spotlight"); val.localScale = new Vector3(0.18f, 4.6f, 0.18f); scene.ActivePieces.Add(new EmpressElevatorAnimatedPiece { Transform = val, Scale = val.localScale, Phase = (float)i / Mathf.Max(1f, (float)definition.Count), Speed = definition.Speed, Radius = 4.2f, Home = new Vector3(0f, 2.25f, 0f) }); } } private void BuildGiftPulse(EmpressElevatorSceneState scene, EmpressElevatorFloorDefinition definition) { //IL_0017: 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_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_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) for (int i = 0; i < Mathf.Clamp(definition.Count, 4, 10); i++) { Transform val = CreateCabinEventPrimitive(scene, (PrimitiveType)3, definition, "Gift Pulse"); val.localScale = Vector3.one * Mathf.Max(0.5f, definition.Size * 2.2f); int num = Mathf.Clamp(definition.Count, 4, 10); float t = ((num <= 1) ? 0.5f : ((float)i / (float)(num - 1))); float t2 = ((num <= 1) ? 0.5f : Mathf.PingPong((float)i * 0.43f, 1f)); val.localPosition = new Vector3(CabinX(t), 1f + (float)(i % 2) * 0.7f, CabinZ(t2)); scene.ActivePieces.Add(new EmpressElevatorAnimatedPiece { Transform = val, Home = val.localPosition, Scale = val.localScale, Phase = Random.Range(0f, 1f), Speed = definition.Speed }); } } private void BuildLaserSweep(EmpressElevatorSceneState scene, EmpressElevatorFloorDefinition definition) { //IL_0033: 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_0056: 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) for (int i = 0; i < Mathf.Clamp(definition.Count, 3, 7); i++) { Transform val = CreateCabinEventPrimitive(scene, (PrimitiveType)3, definition, "Laser"); val.localScale = new Vector3(8.8f, 0.14f + definition.Size * 0.2f, 0.25f); scene.ActivePieces.Add(new EmpressElevatorAnimatedPiece { Transform = val, Scale = val.localScale, Phase = (float)i / 5f, Speed = definition.Speed, Home = new Vector3(0f, 0.8f + (float)i * 0.55f, 0f) }); } } private void BuildRollingOrbs(EmpressElevatorSceneState scene, EmpressElevatorFloorDefinition definition) { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: 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_0108: 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) int num = Mathf.Clamp(definition.Count + 3, 6, 12); int num2 = 5; for (int i = 0; i < num; i++) { Transform val = CreateCabinEventPrimitive(scene, (PrimitiveType)0, definition, "Rolling Orb"); val.localScale = Vector3.one * Mathf.Max(0.6f, definition.Size * 2.4f); float t = ((num2 == 1) ? 0.5f : ((float)(i % num2) / (float)(num2 - 1))); float num3 = CabinZ(t); float t2 = (float)(i / num2) / (float)Mathf.Max(1, Mathf.CeilToInt((float)num / (float)num2) - 1); scene.ActivePieces.Add(new EmpressElevatorAnimatedPiece { Transform = val, Scale = val.localScale, Phase = (float)i / (float)Mathf.Max(1, num), Speed = definition.Speed, Radius = val.localScale.x * 0.82f, Home = new Vector3(CabinX(t2), val.localScale.y * 0.5f - 0.35f + (float)(i / num2 % 2) * 0.5f, num3) }); } } private void BuildCeilingPress(EmpressElevatorSceneState scene, EmpressElevatorFloorDefinition definition) { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) Transform val = CreateCabinEventPrimitive(scene, (PrimitiveType)3, definition, "Ceiling Press"); val.localScale = new Vector3(10.35f, 0.72f, 8.35f); scene.ActivePieces.Add(new EmpressElevatorAnimatedPiece { Transform = val, Scale = val.localScale, Speed = definition.Speed, Home = new Vector3(0f, 4.6f, 0f) }); } private void BuildSpikeLattice(EmpressElevatorSceneState scene, EmpressElevatorFloorDefinition definition) { //IL_0041: 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_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_0099: 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) int num = 4; int num2 = 5; Vector3 val2 = default(Vector3); for (int i = 0; i < num; i++) { for (int j = 0; j < num2; j++) { Transform val = CreateCabinEventPrimitive(scene, (PrimitiveType)2, definition, "Spike"); val.localScale = new Vector3(definition.Size * 0.7f, 0.2f, definition.Size * 0.7f); ((Vector3)(ref val2))..ctor(CabinX((float)j / (float)(num2 - 1)), 0.1f, CabinZ((float)i / (float)(num - 1))); val.localPosition = val2; scene.ActivePieces.Add(new EmpressElevatorAnimatedPiece { Transform = val, Scale = val.localScale, Home = val2, Phase = (float)(j + i) * 0.13f, Speed = definition.Speed, Radius = 0.82f }); } } } private void BuildShockRing(EmpressElevatorSceneState scene, EmpressElevatorFloorDefinition definition) { //IL_0026: 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_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) for (int i = 0; i < 12; i++) { Transform val = CreateCabinEventPrimitive(scene, (PrimitiveType)3, definition, "Shock Segment"); val.localScale = new Vector3(0.24f, 0.24f, 1.1f); scene.ActivePieces.Add(new EmpressElevatorAnimatedPiece { Transform = val, Scale = val.localScale, Phase = (float)i / 12f, Speed = definition.Speed, Home = new Vector3(0f, 0.35f, 0f) }); } } private void BuildSeekerOrbs(EmpressElevatorSceneState scene, EmpressElevatorFloorDefinition definition) { //IL_0017: 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_0083: 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_00a8: 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_00d1: Unknown result type (might be due to invalid IL or missing references) Vector3 val2 = default(Vector3); for (int i = 0; i < Mathf.Clamp(definition.Count, 2, 6); i++) { Transform val = CreateCabinEventPrimitive(scene, (PrimitiveType)0, definition, "Seeker Orb"); val.localScale = Vector3.one * Mathf.Max(0.45f, definition.Size * 1.8f); ((Vector3)(ref val2))..ctor(CabinX((float)i / (float)Mathf.Max(1, Mathf.Clamp(definition.Count, 2, 6) - 1)), 1f + (float)(i % 3) * 0.7f, (i % 2 == 0) ? (-3.45f) : 3.45f); val.localPosition = val2; scene.ActivePieces.Add(new EmpressElevatorAnimatedPiece { Transform = val, Scale = val.localScale, Home = val2, Phase = Random.Range(0f, 1f), Speed = definition.Speed, Radius = val.localScale.x * 0.88f }); } } private void BuildBounceBombs(EmpressElevatorSceneState scene, EmpressElevatorFloorDefinition definition) { //IL_0017: 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_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < Mathf.Clamp(definition.Count + 2, 5, 10); i++) { Transform val = CreateCabinEventPrimitive(scene, (PrimitiveType)0, definition, "Bounce Bomb"); val.localScale = Vector3.one * Mathf.Max(0.5f, definition.Size * 2.1f); scene.ActivePieces.Add(new EmpressElevatorAnimatedPiece { Transform = val, Scale = val.localScale, Phase = Random.Range(0f, 1f), Speed = definition.Speed, Radius = val.localScale.x * 0.7f, Home = new Vector3(Random.Range(-4.35f, 4.35f), 0.7f + Random.Range(0f, 0.8f), Random.Range(-3.45f, 3.45f)) }); } } private void BuildSawSweep(EmpressElevatorSceneState scene, EmpressElevatorFloorDefinition definition) { //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_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) int num = Mathf.Clamp(definition.Count, 2, 4); for (int i = 0; i < num; i++) { Transform val = CreateCabinEventPrimitive(scene, (PrimitiveType)2, definition, "Saw Arm"); val.localScale = new Vector3(0.16f, 2f, 0.16f); scene.ActivePieces.Add(new EmpressElevatorAnimatedPiece { Transform = val, Scale = val.localScale, Phase = (float)i * 0.2f, Speed = definition.Speed, Radius = 4.05f + (float)i * 0.28f, Home = new Vector3(0f, 1.1f + (float)i * 0.55f, Mathf.Lerp(-3f, 3f, (float)i / (float)Mathf.Max(1, num - 1))) }); } } private void BuildMeteorDrop(EmpressElevatorSceneState scene, EmpressElevatorFloorDefinition definition) { //IL_0017: 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_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < Mathf.Clamp(definition.Count, 4, 12); i++) { Transform val = CreateCabinEventPrimitive(scene, (PrimitiveType)3, definition, "Meteor"); val.localScale = Vector3.one * Mathf.Max(0.3f, definition.Size * 1.8f); scene.ActivePieces.Add(new EmpressElevatorAnimatedPiece { Transform = val, Scale = val.localScale, Phase = Random.Range(0f, 1f), Speed = definition.Speed, Radius = val.localScale.x * 0.55f, Home = new Vector3(Random.Range(-4.35f, 4.35f), 4.4f + Random.Range(0f, 1.5f), Random.Range(-3.45f, 3.45f)) }); } } private void BuildPulseWall(EmpressElevatorSceneState scene, EmpressElevatorFloorDefinition definition) { //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_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) int num = Mathf.Clamp(definition.Count, 3, 6); for (int i = 0; i < num; i++) { Transform val = CreateCabinEventPrimitive(scene, (PrimitiveType)3, definition, "Pulse Wall"); val.localScale = new Vector3(10.45f, 4.05f, 0.28f); scene.ActivePieces.Add(new EmpressElevatorAnimatedPiece { Transform = val, Scale = val.localScale, Phase = (float)i / Mathf.Max(1f, (float)num), Speed = definition.Speed, Home = new Vector3(0f, 2f, 0f) }); } } private void BuildTreasureDrizzle(EmpressElevatorSceneState scene, EmpressElevatorFloorDefinition definition) { //IL_0017: 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_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < Mathf.Clamp(definition.Count + 4, 12, 22); i++) { Transform val = CreateCabinEventPrimitive(scene, (PrimitiveType)3, definition, "Treasure Cube"); val.localScale = Vector3.one * Mathf.Max(0.24f, definition.Size * 1.7f); val.localPosition = new Vector3(Random.Range(-3.55f, 3.55f), Random.Range(2.2f, 4.7f), Random.Range(-2.8f, 2.8f)); scene.ActivePieces.Add(new EmpressElevatorAnimatedPiece { Transform = val, Home = val.localPosition, Scale = val.localScale, Phase = Random.Range(0f, 1f), Speed = definition.Speed, Radius = 0.36f }); } } private void BuildMoonBounce(EmpressElevatorSceneState scene, EmpressElevatorFloorDefinition definition) { //IL_0017: 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_008c: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) Vector3 val2 = default(Vector3); for (int i = 0; i < Mathf.Clamp(definition.Count + 3, 8, 14); i++) { Transform val = CreateCabinEventPrimitive(scene, (PrimitiveType)0, definition, "Moon Bounce Orb"); val.localScale = Vector3.one * Mathf.Max(0.34f, definition.Size * 1.8f); ((Vector3)(ref val2))..ctor(CabinX((float)i / (float)Mathf.Max(1, Mathf.Clamp(definition.Count + 3, 8, 14) - 1)), 0.9f + (float)(i % 3) * 0.7f, CabinZ(Mathf.PingPong((float)i * 0.31f, 1f))); val.localPosition = val2; scene.ActivePieces.Add(new EmpressElevatorAnimatedPiece { Transform = val, Home = val2, Scale = val.localScale, Phase = (float)i / 7f, Speed = definition.Speed, Radius = 0.5f + definition.Size }); } } private void BuildFreezeTag(EmpressElevatorSceneState scene, EmpressElevatorFloorDefinition definition) { //IL_0033: 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_007e: 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_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) int num = 5; int num2 = 6; Vector3 val2 = default(Vector3); for (int i = 0; i < num; i++) { for (int j = 0; j < num2; j++) { Transform val = CreateCabinEventPrimitive(scene, (PrimitiveType)3, definition, "Freeze Tile"); val.localScale = new Vector3(1.52f, 0.08f, 1.18f); ((Vector3)(ref val2))..ctor(CabinX((float)j / (float)(num2 - 1)), -0.46f, CabinZ((float)i / (float)(num - 1))); val.localPosition = val2; scene.ActivePieces.Add(new EmpressElevatorAnimatedPiece { Transform = val, Home = val2, Scale = val.localScale, Phase = (float)(j + i) * 0.11f, Speed = definition.Speed }); } } } private void BuildMarathonPanic(EmpressElevatorSceneState scene, EmpressElevatorFloorDefinition definition) { //IL_0026: 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_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_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) Vector3 val2 = default(Vector3); for (int i = 0; i < 5; i++) { Transform val = CreateCabinEventPrimitive(scene, (PrimitiveType)3, definition, "Runner Strip"); val.localScale = new Vector3(1.75f, 0.06f, 7.2799997f); ((Vector3)(ref val2))..ctor(CabinX((float)i / 4f), -0.45f, 0f); val.localPosition = val2; scene.ActivePieces.Add(new EmpressElevatorAnimatedPiece { Transform = val, Home = val2, Scale = val.localScale, Phase = (float)i * 0.21f, Speed = definition.Speed }); } } private void BuildGravityFlip(EmpressElevatorSceneState scene, EmpressElevatorFloorDefinition definition) { //IL_0026: 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_00a3: 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_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) Vector3 val2 = default(Vector3); for (int i = 0; i < Mathf.Clamp(definition.Count + 1, 8, 14); i++) { Transform val = CreateCabinEventPrimitive(scene, (PrimitiveType)3, definition, "Gravity Column"); val.localScale = new Vector3(0.24f, 1.15f, 0.24f); ((Vector3)(ref val2))..ctor(CabinX((float)i / (float)Mathf.Max(1, Mathf.Clamp(definition.Count + 1, 8, 14) - 1)), 1.2f + (float)(i % 3) * 1.05f, Mathf.Lerp(-3.45f, 3.45f, Mathf.PingPong((float)i * 0.37f, 1f))); val.localPosition = val2; scene.ActivePieces.Add(new EmpressElevatorAnimatedPiece { Transform = val, Home = val2, Scale = val.localScale, Phase = (float)i / 8f, Speed = definition.Speed, Radius = 0.4f }); } } private void BuildSoloErrand(EmpressElevatorSceneState scene, EmpressElevatorFloorDefinition definition) { //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_013c: 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_01b2: Unknown result type (might be due to invalid IL or missing references) //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01ee: Unknown result type (might be due to invalid IL or missing references) //IL_0214: Unknown result type (might be due to invalid IL or missing references) //IL_0228: 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_0292: Unknown result type (might be due to invalid IL or missing references) //IL_02bd: Unknown result type (might be due to invalid IL or missing references) //IL_02e8: Unknown result type (might be due to invalid IL or missing references) //IL_032c: Unknown result type (might be due to invalid IL or missing references) //IL_0340: Unknown result type (might be due to invalid IL or missing references) //IL_0367: Unknown result type (might be due to invalid IL or missing references) //IL_039a: Unknown result type (might be due to invalid IL or missing references) //IL_03c5: Unknown result type (might be due to invalid IL or missing references) //IL_03f0: Unknown result type (might be due to invalid IL or missing references) //IL_0435: Unknown result type (might be due to invalid IL or missing references) //IL_0449: Unknown result type (might be due to invalid IL or missing references) //IL_0475: Unknown result type (might be due to invalid IL or missing references) //IL_0489: Unknown result type (might be due to invalid IL or missing references) //IL_04b5: Unknown result type (might be due to invalid IL or missing references) //IL_04c9: Unknown result type (might be due to invalid IL or missing references) //IL_0502: Unknown result type (might be due to invalid IL or missing references) //IL_0516: Unknown result type (might be due to invalid IL or missing references) PlayerAvatar val = SelectSoloErrandPlayer(scene, definition); if ((Object)(object)val == (Object)null) { BuildGiftPulse(scene, definition); return; } SetBarrierBlocked(scene, blocked: false); EmpressElevatorSpecialObjective empressElevatorSpecialObjective = (scene.ActiveObjective = new EmpressElevatorSpecialObjective { Kind = EmpressElevatorSpecialObjectiveKind.SoloErrand, TargetSteamId = val.steamID, TargetPlayerName = (string.IsNullOrWhiteSpace(val.playerName) ? "Chosen Player" : val.playerName), Variant = Mathf.Clamp(definition.Power, 1, 4), RequiredCount = Mathf.Max(1, definition.Count) }); switch (empressElevatorSpecialObjective.Variant) { case 1: empressElevatorSpecialObjective.HoldTarget = 0.75f; empressElevatorSpecialObjective.Primary = CreateObjectiveButton(scene, new Vector3(0f, 1.25f, 4.9f), definition, "Solo Button"); break; case 2: empressElevatorSpecialObjective.HoldTarget = 0.55f; empressElevatorSpecialObjective.RequiredCount = 3; empressElevatorSpecialObjective.Markers.Add(CreateObjectiveButton(scene, new Vector3(-2.8f, 1.1f, 4.4f), definition, "Order Button 1")); empressElevatorSpecialObjective.Markers.Add(CreateObjectiveButton(scene, new Vector3(0f, 1.1f, 5.4f), definition, "Order Button 2")); empressElevatorSpecialObjective.Markers.Add(CreateObjectiveButton(scene, new Vector3(2.8f, 1.1f, 4.4f), definition, "Order Button 3")); empressElevatorSpecialObjective.Primary = empressElevatorSpecialObjective.Markers[0]; break; case 3: empressElevatorSpecialObjective.RequiredCount = Mathf.Max(5, definition.Count); empressElevatorSpecialObjective.Primary = CreateObjectiveRing(scene, new Vector3(0f, -0.42f, 5.35f), new Vector3(3.2f, 0.08f, 3.2f), definition, "Jump Ring"); break; case 4: empressElevatorSpecialObjective.Primary = CreateObjectiveBeacon(scene, new Vector3(0f, 1.15f, 6.15f), definition, "Touch Beacon"); empressElevatorSpecialObjective.Secondary = CreateObjectiveRing(scene, new Vector3(0f, -0.42f, 2.45f), new Vector3(4.2f, 0.08f, 1.4f), definition, "Return Pad", insideCabin: true); break; case 5: empressElevatorSpecialObjective.HoldTarget = 0.45f; empressElevatorSpecialObjective.RequiredCount = 4; empressElevatorSpecialObjective.Markers.Add(CreateObjectiveButton(scene, new Vector3(-3.25f, 1.05f, 3.95f), definition, "Clockwise Button 1")); empressElevatorSpecialObjective.Markers.Add(CreateObjectiveButton(scene, new Vector3(-1.25f, 1.05f, 6.15f), definition, "Clockwise Button 2")); empressElevatorSpecialObjective.Markers.Add(CreateObjectiveButton(scene, new Vector3(1.25f, 1.05f, 6.15f), definition, "Clockwise Button 3")); empressElevatorSpecialObjective.Markers.Add(CreateObjectiveButton(scene, new Vector3(3.25f, 1.05f, 3.95f), definition, "Clockwise Button 4")); empressElevatorSpecialObjective.Primary = empressElevatorSpecialObjective.Markers[0]; break; case 6: empressElevatorSpecialObjective.HoldTarget = 2.05f; empressElevatorSpecialObjective.Primary = CreateObjectiveRing(scene, new Vector3(0f, -0.42f, 5.65f), new Vector3(2.8f, 0.08f, 2.8f), definition, "Shrine Zone"); empressElevatorSpecialObjective.Secondary = CreateObjectiveBeacon(scene, new Vector3(0f, 1.25f, 5.65f), definition, "Shrine Beacon"); break; case 7: empressElevatorSpecialObjective.RequiredCount = 3; empressElevatorSpecialObjective.Markers.Add(CreateObjectiveBeacon(scene, new Vector3(-3.1f, 1.15f, 4.2f), definition, "Choir Beacon 1")); empressElevatorSpecialObjective.Markers.Add(CreateObjectiveBeacon(scene, new Vector3(0f, 1.15f, 6.05f), definition, "Choir Beacon 2")); empressElevatorSpecialObjective.Markers.Add(CreateObjectiveBeacon(scene, new Vector3(3.1f, 1.15f, 4.2f), definition, "Choir Beacon 3")); empressElevatorSpecialObjective.Primary = empressElevatorSpecialObjective.Markers[0]; break; default: empressElevatorSpecialObjective.RequiredCount = 3; empressElevatorSpecialObjective.Markers.Add(CreateObjectiveRing(scene, new Vector3(-2.6f, 0.35f, 4.2f), new Vector3(1.3f, 2.2f, 0.22f), definition, "Gate One")); empressElevatorSpecialObjective.Markers.Add(CreateObjectiveRing(scene, new Vector3(0f, 0.35f, 5.45f), new Vector3(1.3f, 2.2f, 0.22f), definition, "Gate Two")); empressElevatorSpecialObjective.Markers.Add(CreateObjectiveRing(scene, new Vector3(2.6f, 0.35f, 4.2f), new Vector3(1.3f, 2.2f, 0.22f), definition, "Gate Three")); empressElevatorSpecialObjective.Primary = empressElevatorSpecialObjective.Markers[0]; empressElevatorSpecialObjective.Secondary = CreateObjectiveRing(scene, new Vector3(0f, -0.42f, 2.45f), new Vector3(4.2f, 0.08f, 1.4f), definition, "Return Pad", insideCabin: true); break; } } private void BuildTeamTrial(EmpressElevatorSceneState scene, EmpressElevatorFloorDefinition definition) { //IL_005f: 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_00b2: 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_00f2: 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_0132: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_0186: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Unknown result type (might be due to invalid IL or missing references) //IL_01d4: Unknown result type (might be due to invalid IL or missing references) //IL_0207: 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) EmpressElevatorSpecialObjective empressElevatorSpecialObjective = (scene.ActiveObjective = new EmpressElevatorSpecialObjective { Kind = EmpressElevatorSpecialObjectiveKind.TeamTrial, Variant = Mathf.Clamp(definition.Power, 1, 4), RequiredCount = 1 }); switch (empressElevatorSpecialObjective.Variant) { case 1: empressElevatorSpecialObjective.Primary = CreateObjectiveRing(scene, new Vector3(0f, -0.42f, 0.35f), new Vector3(3.4f, 0.08f, 3.4f), definition, "Center Stage", insideCabin: true); empressElevatorSpecialObjective.HoldTarget = 1.7f; break; case 2: empressElevatorSpecialObjective.RequiredCount = 4; empressElevatorSpecialObjective.Markers.Add(CreateObjectiveRing(scene, new Vector3(-3.55f, -0.42f, -2.65f), new Vector3(1.4f, 0.08f, 1.4f), definition, "Corner Pad 1", insideCabin: true)); empressElevatorSpecialObjective.Markers.Add(CreateObjectiveRing(scene, new Vector3(3.55f, -0.42f, -2.65f), new Vector3(1.4f, 0.08f, 1.4f), definition, "Corner Pad 2", insideCabin: true)); empressElevatorSpecialObjective.Markers.Add(CreateObjectiveRing(scene, new Vector3(-3.55f, -0.42f, 2.65f), new Vector3(1.4f, 0.08f, 1.4f), definition, "Corner Pad 3", insideCabin: true)); empressElevatorSpecialObjective.Markers.Add(CreateObjectiveRing(scene, new Vector3(3.55f, -0.42f, 2.65f), new Vector3(1.4f, 0.08f, 1.4f), definition, "Corner Pad 4", insideCabin: true)); empressElevatorSpecialObjective.Primary = empressElevatorSpecialObjective.Markers[0]; break; case 3: empressElevatorSpecialObjective.Primary = CreateObjectiveRing(scene, new Vector3(0f, -0.42f, 0.15f), new Vector3(8.4f, 0.08f, 2.2f), definition, "Choir Strip", insideCabin: true); empressElevatorSpecialObjective.HoldTarget = 1.55f; break; default: empressElevatorSpecialObjective.Primary = CreateObjectiveRing(scene, new Vector3(0f, -0.42f, 0.15f), new Vector3(8.5f, 0.08f, 6.65f), definition, "Jump Field", insideCabin: true); break; } } private void BuildDirectiveTrial(EmpressElevatorSceneState scene, EmpressElevatorFloorDefinition definition) { //IL_0058: 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_0093: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) EmpressElevatorSpecialObjective empressElevatorSpecialObjective = (scene.ActiveObjective = new EmpressElevatorSpecialObjective { Kind = EmpressElevatorSpecialObjectiveKind.DirectiveTrial, Variant = Mathf.Clamp(definition.Power, 1, 4) }); switch (empressElevatorSpecialObjective.Variant) { case 1: empressElevatorSpecialObjective.Primary = CreateObjectiveBeacon(scene, new Vector3(0f, 2.05f, -2.9f), definition, "Traffic Light"); break; case 2: empressElevatorSpecialObjective.Primary = CreateObjectiveRing(scene, new Vector3(0f, 1.15f, 0.25f), new Vector3(8.2f, 0.14f, 6f), definition, "Crouch Line", insideCabin: true); break; case 3: empressElevatorSpecialObjective.Primary = CreateObjectiveRing(scene, new Vector3(0f, -0.42f, 0.25f), new Vector3(8.2f, 0.08f, 6.35f), definition, "Jump Field", insideCabin: true); break; default: empressElevatorSpecialObjective.Primary = CreateObjectiveRing(scene, new Vector3(0f, -0.42f, 0.25f), new Vector3(3.8f, 0.08f, 3.1f), definition, "Center Lava", insideCabin: true); break; } } private void BuildDoNotTurnAround(EmpressElevatorSceneState scene, EmpressElevatorFloorDefinition definition) { //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Expected O, but got Unknown //IL_0059: 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_00ab: 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_014b: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_01f9: Unknown result type (might be due to invalid IL or missing references) //IL_0214: Unknown result type (might be due to invalid IL or missing references) //IL_0191: Unknown result type (might be due to invalid IL or missing references) //IL_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Unknown result type (might be due to invalid IL or missing references) //IL_0296: Unknown result type (might be due to invalid IL or missing references) //IL_029b: Unknown result type (might be due to invalid IL or missing references) //IL_02a1: Unknown result type (might be due to invalid IL or missing references) //IL_02a6: Unknown result type (might be due to invalid IL or missing references) //IL_023f: Unknown result type (might be due to invalid IL or missing references) //IL_0264: Unknown result type (might be due to invalid IL or missing references) //IL_026e: Unknown result type (might be due to invalid IL or missing references) EmpressElevatorSpecialObjective empressElevatorSpecialObjective = (scene.ActiveObjective = new EmpressElevatorSpecialObjective { Kind = EmpressElevatorSpecialObjectiveKind.DoNotTurnAround, Variant = Mathf.Clamp(definition.Power, 1, 4) }); GameObject val = new GameObject("Shadow Figure"); val.transform.SetParent(scene.ActiveCabinEventRoot, false); val.transform.localPosition = new Vector3(0f, 0.25f, -3.15f); val.transform.localRotation = Quaternion.identity; empressElevatorSpecialObjective.ThreatFigure = val.transform; Transform val2 = CreateCabinEventPrimitive(scene, (PrimitiveType)1, definition, "Shadow Body"); val2.SetParent(val.transform, false); val2.localPosition = new Vector3(0f, 1.05f, 0f); val2.localScale = new Vector3(0.8f, 1.15f, 0.55f); MeshRenderer val3 = default(MeshRenderer); if (((Component)val2).TryGetComponent(ref val3)) { ((Renderer)val3).material.color = new Color(0.02f, 0.02f, 0.02f); ((Renderer)val3).material.SetColor("_EmissionColor", new Color(0.01f, 0.01f, 0.01f)); } Transform val4 = CreateCabinEventPrimitive(scene, (PrimitiveType)3, definition, "Shadow Eye Left"); val4.SetParent(val.transform, false); val4.localPosition = new Vector3(-0.12f, 1.85f, 0.22f); val4.localScale = new Vector3(0.08f, 0.08f, 0.05f); MeshRenderer val5 = default(MeshRenderer); if (((Component)val4).TryGetComponent(ref val5)) { ((Renderer)val5).material.color = new Color(0.92f, 0.08f, 0.08f); ((Renderer)val5).material.SetColor("_EmissionColor", new Color(0.92f, 0.08f, 0.08f) * 2f); } Transform val6 = CreateCabinEventPrimitive(scene, (PrimitiveType)3, definition, "Shadow Eye Right"); val6.SetParent(val.transform, false); val6.localPosition = new Vector3(0.12f, 1.85f, 0.22f); val6.localScale = new Vector3(0.08f, 0.08f, 0.05f); MeshRenderer val7 = default(MeshRenderer); if (((Component)val6).TryGetComponent(ref val7)) { ((Renderer)val7).material.color = new Color(0.92f, 0.08f, 0.08f); ((Renderer)val7).material.SetColor("_EmissionColor", new Color(0.92f, 0.08f, 0.08f) * 2f); } scene.ActivePieces.Add(new EmpressElevatorAnimatedPiece { Transform = val.transform, Home = val.transform.localPosition, Scale = Vector3.one, Phase = 0f, Speed = definition.Speed, Radius = 0.8f }); } private string? UpdateSpecialObjective(EmpressElevatorSceneState scene, EmpressElevatorFloorDefinition definition, float phaseAge, float normalized) { if (scene.ActiveObjective == null) { return null; } return scene.ActiveObjective.Kind switch { EmpressElevatorSpecialObjectiveKind.SoloErrand => UpdateSoloErrand(scene, scene.ActiveObjective, definition, phaseAge), EmpressElevatorSpecialObjectiveKind.TeamTrial => UpdateTeamTrial(scene, scene.ActiveObjective, definition, phaseAge), EmpressElevatorSpecialObjectiveKind.DirectiveTrial => UpdateDirectiveTrial(scene, scene.ActiveObjective, definition, phaseAge), EmpressElevatorSpecialObjectiveKind.DoNotTurnAround => UpdateDoNotTurnAround(scene, scene.ActiveObjective, definition, phaseAge), _ => null, }; } private string? UpdateClosingSpecialObjective(EmpressElevatorSceneState scene, float phaseAge) { EmpressElevatorSpecialObjective activeObjective = scene.ActiveObjective; if (activeObjective == null) { return null; } if (activeObjective.Kind == EmpressElevatorSpecialObjectiveKind.SoloErrand && !activeObjective.Completed) { if (SemiFunc.IsMasterClientOrSingleplayer() && !activeObjective.FatalApplied && phaseAge >= 1.35f + activeObjective.FailureDelaySeconds) { PlayerAvatar val = FindPlayerBySteamId(activeObjective.TargetSteamId); if ((Object)(object)val != (Object)null && !val.deadSet) { ApplyFatalDamage(val); } activeObjective.FatalApplied = true; } float num = Mathf.Max(0f, activeObjective.FailureDelaySeconds - Mathf.Max(0f, phaseAge - 1.35f)); if (phaseAge < 1.35f) { return activeObjective.TargetPlayerName + " must get back inside before the doors shut"; } return activeObjective.TargetPlayerName + " missed the elevator :: " + num.ToString("0.0") + "s"; } return null; } private bool ShouldDelayClosingForObjective(EmpressElevatorSceneState scene) { EmpressElevatorSpecialObjective activeObjective = scene.ActiveObjective; if (activeObjective == null || activeObjective.Completed || activeObjective.Kind != EmpressElevatorSpecialObjectiveKind.SoloErrand) { return false; } return Time.time - scene.PhaseStartedAt < 1.35f + activeObjective.FailureDelaySeconds + 0.35f; } private string UpdateSoloErrand(EmpressElevatorSceneState scene, EmpressElevatorSpecialObjective objective, EmpressElevatorFloorDefinition definition, float phaseAge) { //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0233: Unknown result type (might be due to invalid IL or missing references) //IL_023e: Unknown result type (might be due to invalid IL or missing references) PlayerAvatar val = FindPlayerBySteamId(objective.TargetSteamId); if ((Object)(object)val == (Object)null || val.deadSet) { return objective.TargetPlayerName + " is down. No one is finishing this errand."; } if (objective.Completed) { SetBarrierBlocked(scene, blocked: true); return objective.TargetPlayerName + " made it back inside"; } if (objective.TaskComplete) { if (IsInsideCabinZone(scene, ((Component)val).transform.position)) { objective.Completed = true; SetBarrierBlocked(scene, blocked: true); return objective.TargetPlayerName + " made it back inside"; } return objective.TargetPlayerName + " finished the task :: get back in the elevator"; } switch (objective.Variant) { case 1: UpdateHoldObjective(val, objective, objective.Primary, 0.95f); if (objective.Progress >= 1) { objective.TaskComplete = true; } return objective.TargetPlayerName + " must hold the outside button"; case 2: if (objective.Markers.Count > 0) { Transform marker = objective.Markers[Mathf.Clamp(objective.ActiveMarkerIndex, 0, objective.Markers.Count - 1)]; UpdateHoldObjective(val, objective, marker, 0.95f); if (objective.Progress > objective.ActiveMarkerIndex) { objective.ActiveMarkerIndex = Mathf.Min(objective.Progress, objective.Markers.Count - 1); } if (objective.Progress >= objective.RequiredCount) { objective.TaskComplete = true; } } return objective.TargetPlayerName + " must press the outside buttons in order " + objective.Progress + "/" + objective.RequiredCount; case 3: UpdateJumpObjective(scene, val, objective); if (objective.Progress >= objective.RequiredCount) { objective.TaskComplete = true; } return objective.TargetPlayerName + " must jump in the ring " + objective.Progress + "/" + objective.RequiredCount; case 4: if ((Object)(object)objective.Primary != (Object)null && Vector3.Distance(((Component)val).transform.position, objective.Primary.position) <= 1.1f) { objective.TaskComplete = true; } return objective.TargetPlayerName + " must touch the far beacon and get back"; case 5: UpdateOrderedMarkerObjective(val, objective, 0.95f, holdToTrigger: true); if (objective.Progress >= objective.RequiredCount) { objective.TaskComplete = true; } return objective.TargetPlayerName + " must hit the buttons clockwise " + objective.Progress + "/" + objective.RequiredCount; case 6: UpdateCrouchHoldObjective(val, objective, objective.Primary, 1.3f); if (objective.Progress >= 1) { objective.TaskComplete = true; } return objective.TargetPlayerName + " must kneel at the shrine"; case 7: UpdateOrderedMarkerObjective(val, objective, 1.15f, holdToTrigger: false); if (objective.Progress >= objective.RequiredCount) { objective.TaskComplete = true; } return objective.TargetPlayerName + " must touch the choir beacons " + objective.Progress + "/" + objective.RequiredCount; default: UpdateOrderedMarkerObjective(val, objective, 1.05f, holdToTrigger: false); if (objective.Progress >= objective.RequiredCount) { objective.TaskComplete = true; } return objective.TargetPlayerName + " must dash through every gate " + objective.Progress + "/" + objective.RequiredCount; } } private string UpdateTeamTrial(EmpressElevatorSceneState scene, EmpressElevatorSpecialObjective objective, EmpressElevatorFloorDefinition definition, float phaseAge) { //IL_005e: 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_0259: Unknown result type (might be due to invalid IL or missing references) //IL_0264: Unknown result type (might be due to invalid IL or missing references) //IL_0170: 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_03b3: Unknown result type (might be due to invalid IL or missing references) List alivePlayers = GetAlivePlayers(); if (alivePlayers.Count == 0) { return "Everyone is down"; } switch (objective.Variant) { case 1: { bool flag3 = true; foreach (PlayerAvatar item in alivePlayers) { if ((Object)(object)objective.Primary == (Object)null || HorizontalDistance(((Component)item).transform.position, objective.Primary.position) > 1.7f) { flag3 = false; break; } } objective.HoldProgress = (flag3 ? Mathf.Min(objective.HoldTarget, objective.HoldProgress + Time.deltaTime) : Mathf.Max(0f, objective.HoldProgress - Time.deltaTime * 1.4f)); if (objective.HoldProgress >= objective.HoldTarget) { objective.Completed = true; } if (!objective.Completed) { return "everybody to the middle " + objective.HoldProgress.ToString("0.0") + "/" + objective.HoldTarget.ToString("0.0") + "s"; } return "Center Stage cleared"; } case 2: { for (int i = 0; i < objective.Markers.Count; i++) { if (objective.CompletedMarkerIndices.Contains(i)) { continue; } foreach (PlayerAvatar item2 in alivePlayers) { if (HorizontalDistance(((Component)item2).transform.position, objective.Markers[i].position) <= 1.15f) { objective.CompletedMarkerIndices.Add(i); break; } } } objective.Progress = objective.CompletedMarkerIndices.Count; if (objective.Progress >= objective.RequiredCount) { objective.Completed = true; } if (!objective.Completed) { return "light every corner pad " + objective.Progress + "/" + objective.RequiredCount; } return "Corner Toast cleared"; } case 3: { bool flag2 = true; foreach (PlayerAvatar item3 in alivePlayers) { if ((Object)(object)objective.Primary == (Object)null || HorizontalDistance(((Component)item3).transform.position, objective.Primary.position) > 2.4f || !item3.isCrouching) { flag2 = false; break; } } objective.HoldProgress = (flag2 ? Mathf.Min(objective.HoldTarget, objective.HoldProgress + Time.deltaTime) : Mathf.Max(0f, objective.HoldProgress - Time.deltaTime * 1.2f)); if (objective.HoldProgress >= objective.HoldTarget) { objective.Completed = true; } if (!objective.Completed) { return "everyone crouch in the glow " + objective.HoldProgress.ToString("0.0") + "/" + objective.HoldTarget.ToString("0.0") + "s"; } return "Crouch Choir cleared"; } default: foreach (PlayerAvatar item4 in alivePlayers) { string key = "teamjump|" + item4.steamID; float value; bool flag = _ruleStillTimers.TryGetValue(key, out value) && value > 0.5f && !item4.isGrounded && (Object)(object)item4.rb != (Object)null && item4.rb.velocity.y > 1.8f; _ruleStillTimers[key] = (item4.isGrounded ? 1f : 0f); if (flag) { objective.ParticipantSteamIds.Add(item4.steamID); } } objective.Progress = objective.ParticipantSteamIds.Count; if (objective.Progress >= alivePlayers.Count) { objective.Completed = true; } if (!objective.Completed) { return "everybody jump once " + objective.Progress + "/" + alivePlayers.Count; } return "Jump Jubilee cleared"; } } private string UpdateDirectiveTrial(EmpressElevatorSceneState scene, EmpressElevatorSpecialObjective objective, EmpressElevatorFloorDefinition definition, float phaseAge) { //IL_0056: 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_005b: 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_0073: 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) MeshRenderer val = default(MeshRenderer); if ((Object)(object)objective.Primary != (Object)null && objective.Variant == 1 && ((Component)objective.Primary).TryGetComponent(ref val)) { Color val2 = (IsDirectiveGreenWindow(phaseAge) ? new Color(0.2f, 1f, 0.35f) : new Color(1f, 0.18f, 0.18f)); ((Renderer)val).material.color = val2; ((Renderer)val).material.SetColor("_EmissionColor", val2 * 1.8f); } switch (objective.Variant) { case 1: return IsDirectiveGreenWindow(phaseAge) ? "GREEN LIGHT :: move now" : "RED LIGHT :: freeze"; case 2: if (phaseAge < 4.5f) { return "CROUCH OR CRY :: get low in " + Mathf.Max(0f, 4.5f - phaseAge).ToString("0.0") + "s"; } return "CROUCH OR CRY :: stay crouched"; case 3: if (phaseAge < 4.5f) { return "JUMP TAX :: hop soon"; } return "JUMP TAX :: keep jumping"; default: return "CENTER IS LAVA :: hug the walls"; } } private string UpdateDoNotTurnAround(EmpressElevatorSceneState scene, EmpressElevatorSpecialObjective objective, EmpressElevatorFloorDefinition definition, float phaseAge) { //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: 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) if (!_effectCooldowns.TryGetValue("local|shadowglitch", out var value) || Time.time >= value) { _effectCooldowns["local|shadowglitch"] = Time.time + 0.24f; CameraGlitch instance = CameraGlitch.Instance; if (instance != null) { instance.DoNotLookEffectSet(); } } if (!objective.Triggered && phaseAge >= 2.25f && (Object)(object)GameDirector.instance != (Object)null) { foreach (PlayerAvatar player in GameDirector.instance.PlayerList) { if (Object.op_Implicit((Object)(object)player) && !player.deadSet && !player.isDisabled) { Vector3 val = scene.CabinRoot.InverseTransformDirection(((Component)player).transform.forward); int variant = objective.Variant; if ((variant <= 12) ? (val.z < -0.18f) : (variant switch { 13 => val.z < 0.55f, 14 => val.y > 0.3f, _ => IsLookingAtThreat(scene, objective, player, 0.86f), })) { objective.Triggered = true; objective.TargetSteamId = player.steamID; objective.TargetPlayerName = (string.IsNullOrWhiteSpace(player.playerName) ? "Someone" : player.playerName); objective.LastActionAt = Time.time; break; } } } } if (objective.Triggered && SemiFunc.IsMasterClientOrSingleplayer() && !objective.FatalApplied && Time.time >= objective.LastActionAt + 0.35f) { PlayerAvatar val2 = FindPlayerBySteamId(objective.TargetSteamId); if ((Object)(object)val2 != (Object)null && !val2.deadSet) { ApplyFatalDamage(val2); } objective.FatalApplied = true; } if (objective.Triggered) { return objective.TargetPlayerName + " broke the rule"; } int variant2 = objective.Variant; if (variant2 > 12) { return variant2 switch { 13 => "FACE THE DOOR", 14 => "DO NOT LOOK UP", _ => "DO NOT LOOK AT HER", }; } return "DO NOT TURN AROUND"; } private void UpdateHoldObjective(PlayerAvatar player, EmpressElevatorSpecialObjective objective, Transform? marker, float distance) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)marker == (Object)null)) { bool interact = player.Interact; if (Vector3.Distance(((Component)player).transform.position, marker.position) <= distance && interact) { objective.HoldProgress += Time.deltaTime; } else { objective.HoldProgress = Mathf.Max(0f, objective.HoldProgress - Time.deltaTime * 2f); } if (objective.HoldProgress >= objective.HoldTarget) { objective.HoldProgress = 0f; objective.Progress++; } } } private void UpdateCrouchHoldObjective(PlayerAvatar player, EmpressElevatorSpecialObjective objective, Transform? marker, float distance) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)marker == (Object)null)) { bool flag = HorizontalDistance(((Component)player).transform.position, marker.position) <= distance && player.isCrouching; objective.HoldProgress = (flag ? Mathf.Min(objective.HoldTarget, objective.HoldProgress + Time.deltaTime) : Mathf.Max(0f, objective.HoldProgress - Time.deltaTime * 1.8f)); if (objective.HoldProgress >= objective.HoldTarget) { objective.Progress = 1; } } } private void UpdateOrderedMarkerObjective(PlayerAvatar player, EmpressElevatorSpecialObjective objective, float distance, bool holdToTrigger) { //IL_004a: 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) if (objective.Markers.Count != 0) { int index = Mathf.Clamp(objective.Progress, 0, objective.Markers.Count - 1); Transform val = objective.Markers[index]; if (holdToTrigger) { UpdateHoldObjective(player, objective, val, distance); } else if (Vector3.Distance(((Component)player).transform.position, val.position) <= distance && Time.time - objective.LastActionAt >= 0.25f) { objective.Progress++; objective.LastActionAt = Time.time; } } } private void UpdateJumpObjective(EmpressElevatorSceneState scene, PlayerAvatar player, EmpressElevatorSpecialObjective objective) { //IL_0023: 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_0059: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)objective.Primary == (Object)null) && !((Object)(object)player.rb == (Object)null)) { bool flag = HorizontalDistance(((Component)player).transform.position, objective.Primary.position) <= 1.7f; bool flag2 = objective.PreviousGrounded && !player.isGrounded && player.rb.velocity.y > 1.5f; if (flag && flag2 && Time.time - objective.LastActionAt >= 0.28f) { objective.Progress++; objective.LastActionAt = Time.time; } objective.PreviousGrounded = player.isGrounded; } } private PlayerAvatar? SelectSoloErrandPlayer(EmpressElevatorSceneState scene, EmpressElevatorFloorDefinition definition) { if ((Object)(object)GameDirector.instance == (Object)null) { return null; } List list = new List(); foreach (PlayerAvatar player in GameDirector.instance.PlayerList) { if (Object.op_Implicit((Object)(object)player) && !player.deadSet && !player.isDisabled) { list.Add(player); } } if (list.Count == 0) { return null; } list.Sort((PlayerAvatar a, PlayerAvatar b) => string.CompareOrdinal(a.steamID, b.steamID)); int index = Mathf.Abs(scene.RunToken + scene.CurrentFloorNumber * 13 + definition.DefinitionIndex * 7) % list.Count; return list[index]; } private static Transform CreateObjectiveButton(EmpressElevatorSceneState scene, Vector3 localPosition, EmpressElevatorFloorDefinition definition, string name) { //IL_0035: 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_0084: 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_00c2: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)scene.ActiveEventRoot != (Object)null)) { throw new InvalidOperationException(); } Transform transform = GameObject.CreatePrimitive((PrimitiveType)3).transform; ((Object)transform).name = name; transform.SetParent(scene.ActiveEventRoot, false); transform.localPosition = localPosition; transform.localScale = new Vector3(0.7f, 0.28f, 0.28f); Collider val = default(Collider); if (((Component)transform).TryGetComponent(ref val)) { Object.Destroy((Object)(object)val); } MeshRenderer val2 = default(MeshRenderer); if (((Component)transform).TryGetComponent(ref val2)) { ((Renderer)val2).material.color = new Color(0.28f, 0.95f, 0.55f); ((Renderer)val2).material.EnableKeyword("_EMISSION"); ((Renderer)val2).material.SetColor("_EmissionColor", new Color(0.28f, 0.95f, 0.55f) * 2f); } return transform; } private static Transform CreateObjectiveRing(EmpressElevatorSceneState scene, Vector3 localPosition, Vector3 localScale, EmpressElevatorFloorDefinition definition, string name, bool insideCabin = false) { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_007b: 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) Transform val = (insideCabin ? scene.ActiveCabinEventRoot : scene.ActiveEventRoot); GameObject val2 = GameObject.CreatePrimitive((PrimitiveType)3); ((Object)val2).name = name; val2.transform.SetParent(val, false); val2.transform.localPosition = localPosition; val2.transform.localScale = localScale; Collider val3 = default(Collider); if (val2.TryGetComponent(ref val3)) { Object.Destroy((Object)(object)val3); } MeshRenderer val4 = default(MeshRenderer); if (val2.TryGetComponent(ref val4)) { ((Renderer)val4).material.color = new Color(0.3f, 0.85f, 1f, 0.75f); ((Renderer)val4).material.EnableKeyword("_EMISSION"); ((Renderer)val4).material.SetColor("_EmissionColor", new Color(0.3f, 0.85f, 1f) * 1.5f); } return val2.transform; } private static Transform CreateObjectiveBeacon(EmpressElevatorSceneState scene, Vector3 localPosition, EmpressElevatorFloorDefinition definition, string name) { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_007a: 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_00b8: Unknown result type (might be due to invalid IL or missing references) GameObject val = GameObject.CreatePrimitive((PrimitiveType)2); ((Object)val).name = name; val.transform.SetParent(scene.ActiveEventRoot, false); val.transform.localPosition = localPosition; val.transform.localScale = new Vector3(0.55f, 1.2f, 0.55f); Collider val2 = default(Collider); if (val.TryGetComponent(ref val2)) { Object.Destroy((Object)(object)val2); } MeshRenderer val3 = default(MeshRenderer); if (val.TryGetComponent(ref val3)) { ((Renderer)val3).material.color = new Color(1f, 0.92f, 0.48f); ((Renderer)val3).material.EnableKeyword("_EMISSION"); ((Renderer)val3).material.SetColor("_EmissionColor", new Color(1f, 0.92f, 0.48f) * 1.8f); } return val.transform; } private static void SetBarrierBlocked(EmpressElevatorSceneState scene, bool blocked) { if ((Object)(object)scene.BarrierCollider != (Object)null) { ((Collider)scene.BarrierCollider).enabled = blocked; } } private Transform CreateEventPrimitive(EmpressElevatorSceneState scene, PrimitiveType primitiveType, EmpressElevatorFloorDefinition definition, string name) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) GameObject val = GameObject.CreatePrimitive(primitiveType); ((Object)val).name = name; val.transform.SetParent(scene.ActiveEventRoot, false); Collider val2 = default(Collider); if (val.TryGetComponent(ref val2)) { Object.Destroy((Object)(object)val2); } ApplyPieceVisual(val, definition); return val.transform; } private Transform CreateCabinEventPrimitive(EmpressElevatorSceneState scene, PrimitiveType primitiveType, EmpressElevatorFloorDefinition definition, string name) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) GameObject val = GameObject.CreatePrimitive(primitiveType); ((Object)val).name = name; val.transform.SetParent(scene.ActiveCabinEventRoot, false); Collider val2 = default(Collider); if (val.TryGetComponent(ref val2)) { Object.Destroy((Object)(object)val2); } ApplyPieceVisual(val, definition); return val.transform; } private static void ApplyPieceVisual(GameObject obj, EmpressElevatorFloorDefinition definition) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_002d: 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_0062: Unknown result type (might be due to invalid IL or missing references) MeshRenderer val = default(MeshRenderer); if (obj.TryGetComponent(ref val)) { Material material = ((Renderer)val).material; material.color = Color.Lerp(definition.PrimaryColor, definition.SecondaryColor, Random.Range(0.15f, 0.55f)); material.EnableKeyword("_EMISSION"); material.SetColor("_EmissionColor", material.color * (definition.Hostile ? 1.6f : 1.15f)); } } private void UpdateActivePieces(EmpressElevatorSceneState scene, EmpressElevatorFloorDefinition definition, float normalized) { //IL_0876: Unknown result type (might be due to invalid IL or missing references) //IL_06ff: Unknown result type (might be due to invalid IL or missing references) //IL_07e3: Unknown result type (might be due to invalid IL or missing references) //IL_07f4: Unknown result type (might be due to invalid IL or missing references) //IL_09a9: Unknown result type (might be due to invalid IL or missing references) //IL_09c7: Unknown result type (might be due to invalid IL or missing references) //IL_09cc: Unknown result type (might be due to invalid IL or missing references) //IL_09f5: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: Unknown result type (might be due to invalid IL or missing references) //IL_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_0289: Unknown result type (might be due to invalid IL or missing references) //IL_028e: Unknown result type (might be due to invalid IL or missing references) //IL_039d: Unknown result type (might be due to invalid IL or missing references) //IL_03c9: Unknown result type (might be due to invalid IL or missing references) //IL_03ce: Unknown result type (might be due to invalid IL or missing references) //IL_03f7: Unknown result type (might be due to invalid IL or missing references) //IL_0479: Unknown result type (might be due to invalid IL or missing references) //IL_0480: Unknown result type (might be due to invalid IL or missing references) //IL_04aa: Unknown result type (might be due to invalid IL or missing references) //IL_0572: Unknown result type (might be due to invalid IL or missing references) //IL_0583: Unknown result type (might be due to invalid IL or missing references) //IL_0588: Unknown result type (might be due to invalid IL or missing references) //IL_058d: Unknown result type (might be due to invalid IL or missing references) //IL_0659: Unknown result type (might be due to invalid IL or missing references) //IL_066a: Unknown result type (might be due to invalid IL or missing references) //IL_0e2f: Unknown result type (might be due to invalid IL or missing references) //IL_0902: Unknown result type (might be due to invalid IL or missing references) //IL_0939: Unknown result type (might be due to invalid IL or missing references) //IL_0a3d: Unknown result type (might be due to invalid IL or missing references) //IL_0a42: Unknown result type (might be due to invalid IL or missing references) //IL_0a4c: Unknown result type (might be due to invalid IL or missing references) //IL_0a51: Unknown result type (might be due to invalid IL or missing references) //IL_0a5a: Unknown result type (might be due to invalid IL or missing references) //IL_0a5f: Unknown result type (might be due to invalid IL or missing references) //IL_0a68: Unknown result type (might be due to invalid IL or missing references) //IL_0a6a: Unknown result type (might be due to invalid IL or missing references) //IL_0a7b: Unknown result type (might be due to invalid IL or missing references) //IL_0a80: Unknown result type (might be due to invalid IL or missing references) //IL_0a92: Unknown result type (might be due to invalid IL or missing references) //IL_0b57: Unknown result type (might be due to invalid IL or missing references) //IL_0bcb: Unknown result type (might be due to invalid IL or missing references) //IL_0be8: Unknown result type (might be due to invalid IL or missing references) //IL_0c80: Unknown result type (might be due to invalid IL or missing references) //IL_0c91: Unknown result type (might be due to invalid IL or missing references) //IL_0d34: Unknown result type (might be due to invalid IL or missing references) //IL_0d88: Unknown result type (might be due to invalid IL or missing references) //IL_0eb1: Unknown result type (might be due to invalid IL or missing references) //IL_0eb6: Unknown result type (might be due to invalid IL or missing references) //IL_0ec3: Unknown result type (might be due to invalid IL or missing references) //IL_0ecd: Unknown result type (might be due to invalid IL or missing references) //IL_0ed2: Unknown result type (might be due to invalid IL or missing references) //IL_0f0d: Unknown result type (might be due to invalid IL or missing references) //IL_0fa4: Unknown result type (might be due to invalid IL or missing references) //IL_0fff: Unknown result type (might be due to invalid IL or missing references) //IL_109a: Unknown result type (might be due to invalid IL or missing references) //IL_10ab: Unknown result type (might be due to invalid IL or missing references) //IL_10b0: Unknown result type (might be due to invalid IL or missing references) //IL_10b5: 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_0167: Unknown result type (might be due to invalid IL or missing references) //IL_02c6: Unknown result type (might be due to invalid IL or missing references) //IL_02e0: Unknown result type (might be due to invalid IL or missing references) //IL_11c6: Unknown result type (might be due to invalid IL or missing references) //IL_11d7: Unknown result type (might be due to invalid IL or missing references) //IL_11dc: Unknown result type (might be due to invalid IL or missing references) //IL_0331: Unknown result type (might be due to invalid IL or missing references) //IL_1145: Unknown result type (might be due to invalid IL or missing references) //IL_114a: Unknown result type (might be due to invalid IL or missing references) //IL_1154: Unknown result type (might be due to invalid IL or missing references) //IL_1159: Unknown result type (might be due to invalid IL or missing references) //IL_1175: Unknown result type (might be due to invalid IL or missing references) //IL_117a: Unknown result type (might be due to invalid IL or missing references) //IL_1187: Unknown result type (might be due to invalid IL or missing references) float time = Time.time; switch (definition.Kind) { case EmpressElevatorEventKind.ConfettiBloom: case EmpressElevatorEventKind.HealingRain: case EmpressElevatorEventKind.HeartPageant: case EmpressElevatorEventKind.BubbleDrift: { foreach (EmpressElevatorAnimatedPiece activePiece in scene.ActivePieces) { float num25 = Mathf.Repeat(normalized * activePiece.Speed * 2.4f + activePiece.Phase, 1f); float num26 = ((definition.Kind == EmpressElevatorEventKind.BubbleDrift) ? Mathf.Lerp(-0.4f, 4.8f, num25) : Mathf.Lerp(4.8f, -0.2f, num25)); float num27 = Mathf.Sin((activePiece.Phase + normalized) * MathF.PI * 2f) * 0.68f; float num28 = Mathf.Cos((activePiece.Phase + normalized) * MathF.PI * 2f) * 0.42f; activePiece.Transform.localPosition = new Vector3(activePiece.Home.x + num27, num26, activePiece.Home.z + num28); activePiece.Transform.Rotate(Vector3.up, Time.deltaTime * 90f, (Space)1); } break; } case EmpressElevatorEventKind.LanternOrbit: { foreach (EmpressElevatorAnimatedPiece activePiece2 in scene.ActivePieces) { float num23 = (activePiece2.Phase + normalized * activePiece2.Speed) * MathF.PI * 2f; activePiece2.Transform.localPosition = activePiece2.Home + new Vector3(Mathf.Cos(num23) * activePiece2.Radius, Mathf.Sin(num23 * 1.7f) * 0.45f, Mathf.Sin(num23) * activePiece2.Radius); } break; } case EmpressElevatorEventKind.PrismGarden: case EmpressElevatorEventKind.CylinderChoir: case EmpressElevatorEventKind.CalmAurora: { foreach (EmpressElevatorAnimatedPiece activePiece3 in scene.ActivePieces) { float num19 = 0.35f + Mathf.Abs(Mathf.Sin((normalized * activePiece3.Speed + activePiece3.Phase) * MathF.PI * 2f)); Vector3 scale = activePiece3.Scale; scale.y = ((definition.Kind == EmpressElevatorEventKind.CalmAurora) ? (3.4f + num19 * 1.8f) : (0.8f + num19 * 3.2f)); activePiece3.Transform.localScale = scale; activePiece3.Transform.localPosition = new Vector3(activePiece3.Home.x, scale.y * 0.5f - 0.5f, activePiece3.Home.z + ((definition.Kind == EmpressElevatorEventKind.CalmAurora) ? (Mathf.Sin((normalized + activePiece3.Phase) * MathF.PI * 2f) * 0.8f) : 0f)); } break; } case EmpressElevatorEventKind.SpotlightParade: { foreach (EmpressElevatorAnimatedPiece activePiece4 in scene.ActivePieces) { float num14 = (activePiece4.Phase + normalized * activePiece4.Speed) * MathF.PI * 2f; activePiece4.Transform.localPosition = activePiece4.Home + new Vector3(Mathf.Cos(num14) * activePiece4.Radius, 0f, Mathf.Sin(num14 * 2f) * 1.8f); activePiece4.Transform.localRotation = Quaternion.Euler(0f, num14 * 57.29578f * 0.75f, 0f); } break; } case EmpressElevatorEventKind.GiftPulse: { foreach (EmpressElevatorAnimatedPiece activePiece5 in scene.ActivePieces) { float num34 = 0.6f + Mathf.Abs(Mathf.Sin((normalized * activePiece5.Speed + activePiece5.Phase) * MathF.PI * 2f)) * 0.9f; activePiece5.Transform.localScale = activePiece5.Scale * num34; activePiece5.Transform.localRotation = Quaternion.Euler(0f, normalized * 360f * activePiece5.Speed, 0f); } break; } case EmpressElevatorEventKind.TreasureDrizzle: { foreach (EmpressElevatorAnimatedPiece activePiece6 in scene.ActivePieces) { float num31 = Mathf.Repeat(normalized * activePiece6.Speed * 2.4f + activePiece6.Phase, 1f); float num32 = Mathf.Lerp(4.85f, -0.25f, num31); float num33 = Mathf.Sin((normalized * activePiece6.Speed + activePiece6.Phase) * MathF.PI * 4f) * 0.18f; activePiece6.Transform.localPosition = new Vector3(activePiece6.Home.x + num33, num32, activePiece6.Home.z); activePiece6.Transform.Rotate(Vector3.up + Vector3.forward, Time.deltaTime * 180f, (Space)1); } break; } case EmpressElevatorEventKind.MoonBounce: { foreach (EmpressElevatorAnimatedPiece activePiece7 in scene.ActivePieces) { float num29 = (activePiece7.Phase + normalized * activePiece7.Speed) * MathF.PI * 2f; float num30 = 0.9f + Mathf.Abs(Mathf.Sin(num29 * 1.75f)) * 1.8f; activePiece7.Transform.localPosition = new Vector3(activePiece7.Home.x + Mathf.Cos(num29) * 0.7f, num30, activePiece7.Home.z + Mathf.Sin(num29) * 0.8f); activePiece7.Transform.Rotate(Vector3.up, Time.deltaTime * 110f, (Space)1); } break; } case EmpressElevatorEventKind.LaserSweep: { for (int k = 0; k < scene.ActivePieces.Count; k++) { EmpressElevatorAnimatedPiece empressElevatorAnimatedPiece4 = scene.ActivePieces[k]; float num24 = Mathf.Lerp(-3f, 3f, Mathf.PingPong((normalized * empressElevatorAnimatedPiece4.Speed + empressElevatorAnimatedPiece4.Phase) * 2f, 1f)); empressElevatorAnimatedPiece4.Transform.localPosition = new Vector3(0f, empressElevatorAnimatedPiece4.Home.y, num24); } break; } case EmpressElevatorEventKind.RollingOrbs: { for (int j = 0; j < scene.ActivePieces.Count; j++) { EmpressElevatorAnimatedPiece empressElevatorAnimatedPiece3 = scene.ActivePieces[j]; float num20 = Mathf.Lerp(-5.0499997f, 5.0499997f, Mathf.PingPong((normalized * empressElevatorAnimatedPiece3.Speed + empressElevatorAnimatedPiece3.Phase) * 2f, 1f)); float num21 = empressElevatorAnimatedPiece3.Home.y + Mathf.Sin((normalized * empressElevatorAnimatedPiece3.Speed + empressElevatorAnimatedPiece3.Phase) * MathF.PI * 2f) * 0.38f; float num22 = empressElevatorAnimatedPiece3.Home.z + Mathf.Sin((normalized * empressElevatorAnimatedPiece3.Speed + empressElevatorAnimatedPiece3.Phase) * MathF.PI * 2f) * 0.62f; empressElevatorAnimatedPiece3.Transform.localPosition = new Vector3(num20, num21, num22); empressElevatorAnimatedPiece3.Transform.Rotate(Vector3.right, Time.deltaTime * 220f, (Space)1); } break; } case EmpressElevatorEventKind.CeilingPress: if (scene.ActivePieces.Count > 0) { EmpressElevatorAnimatedPiece empressElevatorAnimatedPiece2 = scene.ActivePieces[0]; float num17 = Mathf.Sin(normalized * MathF.PI); float num18 = Mathf.Lerp(4.65f, 1.25f, num17); empressElevatorAnimatedPiece2.Transform.localPosition = new Vector3(0f, num18, 0f); } break; case EmpressElevatorEventKind.SpikeLattice: { foreach (EmpressElevatorAnimatedPiece activePiece8 in scene.ActivePieces) { float num15 = Mathf.Clamp01(Mathf.Sin((normalized * activePiece8.Speed + activePiece8.Phase) * MathF.PI * 2f) * 0.5f + 0.5f); float num16 = 0.2f + num15 * 1.85f; activePiece8.Transform.localScale = new Vector3(activePiece8.Scale.x, num16, activePiece8.Scale.z); activePiece8.Transform.localPosition = new Vector3(activePiece8.Home.x, num16 * 0.5f - 0.5f, activePiece8.Home.z); } break; } case EmpressElevatorEventKind.ShockRing: { for (int i = 0; i < scene.ActivePieces.Count; i++) { EmpressElevatorAnimatedPiece empressElevatorAnimatedPiece = scene.ActivePieces[i]; float num12 = Mathf.Lerp(0.4f, 6.2f, normalized); float num13 = empressElevatorAnimatedPiece.Phase * MathF.PI * 2f; empressElevatorAnimatedPiece.Transform.localPosition = empressElevatorAnimatedPiece.Home + new Vector3(Mathf.Cos(num13) * num12, 0f, Mathf.Sin(num13) * num12); empressElevatorAnimatedPiece.Transform.localRotation = Quaternion.Euler(0f, (0f - empressElevatorAnimatedPiece.Phase) * 360f, 0f); } break; } case EmpressElevatorEventKind.SeekerOrbs: { foreach (EmpressElevatorAnimatedPiece activePiece9 in scene.ActivePieces) { Vector3 val3 = ClampCabinLocalPosition(GetNearestPlayerLocalPosition(scene.CabinRoot, activePiece9.Transform.position), 0.5f); Vector3 localPosition = activePiece9.Transform.localPosition; activePiece9.Transform.localPosition = Vector3.Lerp(localPosition, val3 + new Vector3(0f, 0.65f, 0f), Time.deltaTime * activePiece9.Speed); } break; } case EmpressElevatorEventKind.BounceBombs: { foreach (EmpressElevatorAnimatedPiece activePiece10 in scene.ActivePieces) { float num11 = (normalized * activePiece10.Speed + activePiece10.Phase) * MathF.PI * 2f; activePiece10.Transform.localPosition = new Vector3(activePiece10.Home.x + Mathf.Sin(num11 * 1.7f) * 1.7f, 0.65f + Mathf.Abs(Mathf.Sin(num11 * 2.6f)) * 1.95f, activePiece10.Home.z + Mathf.Cos(num11 * 1.3f) * 1.55f); } break; } case EmpressElevatorEventKind.SawSweep: { foreach (EmpressElevatorAnimatedPiece activePiece11 in scene.ActivePieces) { float num10 = Mathf.Sin((normalized * activePiece11.Speed + activePiece11.Phase) * MathF.PI * 2f) * 90f; activePiece11.Transform.localPosition = activePiece11.Home; activePiece11.Transform.localRotation = Quaternion.Euler(0f, num10, 90f); } break; } case EmpressElevatorEventKind.MeteorDrop: { foreach (EmpressElevatorAnimatedPiece activePiece12 in scene.ActivePieces) { float num8 = Mathf.Repeat(normalized * activePiece12.Speed * 1.9f + activePiece12.Phase, 1f); float num9 = Mathf.Lerp(5.4f, -0.25f, num8); activePiece12.Transform.localPosition = new Vector3(activePiece12.Home.x, num9, activePiece12.Home.z); activePiece12.Transform.Rotate(Vector3.one, Time.deltaTime * 90f, (Space)1); } break; } case EmpressElevatorEventKind.PulseWall: { foreach (EmpressElevatorAnimatedPiece activePiece13 in scene.ActivePieces) { float num7 = Mathf.Lerp(2.8f, -2.6f, Mathf.PingPong((normalized * activePiece13.Speed + activePiece13.Phase) * 2f, 1f)); activePiece13.Transform.localPosition = new Vector3(activePiece13.Home.x, activePiece13.Home.y, num7); activePiece13.Transform.localScale = new Vector3(activePiece13.Scale.x, activePiece13.Scale.y, 0.18f + Mathf.Abs(Mathf.Sin((normalized + activePiece13.Phase) * MathF.PI * 2f)) * 0.18f); } break; } case EmpressElevatorEventKind.TeamTrial: case EmpressElevatorEventKind.DirectiveTrial: { foreach (EmpressElevatorAnimatedPiece activePiece14 in scene.ActivePieces) { float num6 = 0.92f + Mathf.Abs(Mathf.Sin((normalized * activePiece14.Speed + activePiece14.Phase) * MathF.PI * 3.4f)) * 0.2f; activePiece14.Transform.localScale = new Vector3(activePiece14.Scale.x * num6, activePiece14.Scale.y, activePiece14.Scale.z * num6); } break; } case EmpressElevatorEventKind.FreezeTag: { foreach (EmpressElevatorAnimatedPiece activePiece15 in scene.ActivePieces) { float num5 = 0.88f + Mathf.Abs(Mathf.Sin((normalized * activePiece15.Speed + activePiece15.Phase) * MathF.PI * 4f)) * 0.22f; activePiece15.Transform.localPosition = activePiece15.Home + Vector3.up * (num5 - 0.88f) * 0.1f; activePiece15.Transform.localScale = new Vector3(activePiece15.Scale.x * num5, activePiece15.Scale.y, activePiece15.Scale.z * num5); } break; } case EmpressElevatorEventKind.MarathonPanic: { foreach (EmpressElevatorAnimatedPiece activePiece16 in scene.ActivePieces) { float num4 = Mathf.Lerp(-1.2f, 1.2f, Mathf.PingPong((normalized * activePiece16.Speed + activePiece16.Phase) * 2.4f, 1f)); activePiece16.Transform.localPosition = new Vector3(activePiece16.Home.x, activePiece16.Home.y, num4); activePiece16.Transform.localScale = new Vector3(activePiece16.Scale.x, activePiece16.Scale.y + Mathf.Abs(Mathf.Sin((normalized + activePiece16.Phase) * MathF.PI * 2f)) * 0.04f, activePiece16.Scale.z); } break; } case EmpressElevatorEventKind.GravityFlip: { foreach (EmpressElevatorAnimatedPiece activePiece17 in scene.ActivePieces) { float num2 = Mathf.PingPong((normalized * activePiece17.Speed + activePiece17.Phase) * 2f, 1f); float num3 = Mathf.Lerp(0.4f, 4.2f, num2); activePiece17.Transform.localPosition = new Vector3(activePiece17.Home.x, num3, activePiece17.Home.z); activePiece17.Transform.Rotate(Vector3.forward + Vector3.up, Time.deltaTime * 140f, (Space)1); } break; } case EmpressElevatorEventKind.DoNotTurnAround: { foreach (EmpressElevatorAnimatedPiece activePiece18 in scene.ActivePieces) { EmpressElevatorSpecialObjective? activeObjective = scene.ActiveObjective; if (activeObjective != null && activeObjective.Triggered) { PlayerAvatar val = FindPlayerBySteamId(scene.ActiveObjective.TargetSteamId); if ((Object)(object)val != (Object)null) { Vector3 val2 = ClampCabinLocalPosition(scene.CabinRoot.InverseTransformPoint(((Component)val).transform.position), 0.25f); val2.y = 1.05f; activePiece18.Transform.localPosition = Vector3.Lerp(activePiece18.Transform.localPosition, val2, Time.deltaTime * 7.5f); } } else { float num = Mathf.Sin((normalized * activePiece18.Speed + activePiece18.Phase) * MathF.PI * 2f) * 0.12f; activePiece18.Transform.localPosition = activePiece18.Home + new Vector3(0f, num, 0f); } } break; } case EmpressElevatorEventKind.SoloErrand: break; } } private void ApplyAuthorityEffects(EmpressElevatorSceneState scene, EmpressElevatorFloorDefinition definition, float phaseAge, float normalized) { //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_049e: Unknown result type (might be due to invalid IL or missing references) //IL_049f: Unknown result type (might be due to invalid IL or missing references) //IL_04a4: Unknown result type (might be due to invalid IL or missing references) //IL_04a6: Unknown result type (might be due to invalid IL or missing references) //IL_04ad: Unknown result type (might be due to invalid IL or missing references) //IL_04b4: Unknown result type (might be due to invalid IL or missing references) //IL_04b9: Unknown result type (might be due to invalid IL or missing references) //IL_0c10: Unknown result type (might be due to invalid IL or missing references) //IL_0c15: Unknown result type (might be due to invalid IL or missing references) //IL_0c36: Unknown result type (might be due to invalid IL or missing references) //IL_0c3b: Unknown result type (might be due to invalid IL or missing references) //IL_0c47: 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_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_0363: Unknown result type (might be due to invalid IL or missing references) //IL_0364: Unknown result type (might be due to invalid IL or missing references) //IL_0369: Unknown result type (might be due to invalid IL or missing references) //IL_036b: Unknown result type (might be due to invalid IL or missing references) //IL_04f3: Unknown result type (might be due to invalid IL or missing references) //IL_067a: Unknown result type (might be due to invalid IL or missing references) //IL_0a5c: Unknown result type (might be due to invalid IL or missing references) //IL_0a59: Unknown result type (might be due to invalid IL or missing references) //IL_0c6f: Unknown result type (might be due to invalid IL or missing references) //IL_080f: Unknown result type (might be due to invalid IL or missing references) //IL_080c: Unknown result type (might be due to invalid IL or missing references) //IL_09dc: Unknown result type (might be due to invalid IL or missing references) //IL_09dd: Unknown result type (might be due to invalid IL or missing references) //IL_09e2: Unknown result type (might be due to invalid IL or missing references) //IL_09e4: Unknown result type (might be due to invalid IL or missing references) //IL_09eb: Unknown result type (might be due to invalid IL or missing references) //IL_09f8: Unknown result type (might be due to invalid IL or missing references) //IL_09fd: Unknown result type (might be due to invalid IL or missing references) //IL_0379: Unknown result type (might be due to invalid IL or missing references) //IL_0685: Unknown result type (might be due to invalid IL or missing references) //IL_068e: Unknown result type (might be due to invalid IL or missing references) //IL_0a5e: Unknown result type (might be due to invalid IL or missing references) //IL_0a68: Unknown result type (might be due to invalid IL or missing references) //IL_0c5b: Unknown result type (might be due to invalid IL or missing references) //IL_022b: Unknown result type (might be due to invalid IL or missing references) //IL_0238: Unknown result type (might be due to invalid IL or missing references) //IL_0811: Unknown result type (might be due to invalid IL or missing references) //IL_081b: Unknown result type (might be due to invalid IL or missing references) //IL_08c9: Unknown result type (might be due to invalid IL or missing references) //IL_0a14: Unknown result type (might be due to invalid IL or missing references) //IL_02c5: Unknown result type (might be due to invalid IL or missing references) //IL_02cd: Unknown result type (might be due to invalid IL or missing references) //IL_02d9: Unknown result type (might be due to invalid IL or missing references) //IL_02e6: Unknown result type (might be due to invalid IL or missing references) //IL_0387: Unknown result type (might be due to invalid IL or missing references) //IL_042c: Unknown result type (might be due to invalid IL or missing references) //IL_0522: Unknown result type (might be due to invalid IL or missing references) //IL_0527: Unknown result type (might be due to invalid IL or missing references) //IL_0529: Unknown result type (might be due to invalid IL or missing references) //IL_0532: Unknown result type (might be due to invalid IL or missing references) //IL_053e: Unknown result type (might be due to invalid IL or missing references) //IL_0543: Unknown result type (might be due to invalid IL or missing references) //IL_0548: Unknown result type (might be due to invalid IL or missing references) //IL_054a: Unknown result type (might be due to invalid IL or missing references) //IL_054b: Unknown result type (might be due to invalid IL or missing references) //IL_054d: Unknown result type (might be due to invalid IL or missing references) //IL_05b2: Unknown result type (might be due to invalid IL or missing references) //IL_05bf: Unknown result type (might be due to invalid IL or missing references) //IL_06b5: Unknown result type (might be due to invalid IL or missing references) //IL_06c5: Unknown result type (might be due to invalid IL or missing references) //IL_06cf: Unknown result type (might be due to invalid IL or missing references) //IL_06d4: Unknown result type (might be due to invalid IL or missing references) //IL_0a8d: Unknown result type (might be due to invalid IL or missing references) //IL_0a8e: Unknown result type (might be due to invalid IL or missing references) //IL_024f: Unknown result type (might be due to invalid IL or missing references) //IL_025c: Unknown result type (might be due to invalid IL or missing references) //IL_03b2: Unknown result type (might be due to invalid IL or missing references) //IL_03c9: Unknown result type (might be due to invalid IL or missing references) //IL_0395: Unknown result type (might be due to invalid IL or missing references) //IL_043d: Unknown result type (might be due to invalid IL or missing references) //IL_0445: Unknown result type (might be due to invalid IL or missing references) //IL_056c: Unknown result type (might be due to invalid IL or missing references) //IL_05d6: Unknown result type (might be due to invalid IL or missing references) //IL_05e3: Unknown result type (might be due to invalid IL or missing references) //IL_05fa: Unknown result type (might be due to invalid IL or missing references) //IL_0ab2: Unknown result type (might be due to invalid IL or missing references) //IL_0ac2: Unknown result type (might be due to invalid IL or missing references) //IL_0acc: Unknown result type (might be due to invalid IL or missing references) //IL_0ad1: Unknown result type (might be due to invalid IL or missing references) //IL_0282: Unknown result type (might be due to invalid IL or missing references) //IL_0837: Unknown result type (might be due to invalid IL or missing references) //IL_0838: Unknown result type (might be due to invalid IL or missing references) //IL_0321: Unknown result type (might be due to invalid IL or missing references) //IL_03f9: Unknown result type (might be due to invalid IL or missing references) //IL_046d: Unknown result type (might be due to invalid IL or missing references) //IL_061b: Unknown result type (might be due to invalid IL or missing references) //IL_085c: Unknown result type (might be due to invalid IL or missing references) //IL_086c: Unknown result type (might be due to invalid IL or missing references) //IL_0876: Unknown result type (might be due to invalid IL or missing references) //IL_087b: Unknown result type (might be due to invalid IL or missing references) //IL_093c: Unknown result type (might be due to invalid IL or missing references) //IL_089f: Unknown result type (might be due to invalid IL or missing references) //IL_0774: Unknown result type (might be due to invalid IL or missing references) //IL_078a: Unknown result type (might be due to invalid IL or missing references) //IL_078f: Unknown result type (might be due to invalid IL or missing references) //IL_0b55: Unknown result type (might be due to invalid IL or missing references) //IL_0b56: Unknown result type (might be due to invalid IL or missing references) //IL_07b7: Unknown result type (might be due to invalid IL or missing references) //IL_0757: Unknown result type (might be due to invalid IL or missing references) //IL_075c: Unknown result type (might be due to invalid IL or missing references) //IL_0b2e: Unknown result type (might be due to invalid IL or missing references) //IL_09c6: Unknown result type (might be due to invalid IL or missing references) //IL_0bee: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)GameDirector.instance == (Object)null) { return; } foreach (PlayerAvatar player in GameDirector.instance.PlayerList) { if (!Object.op_Implicit((Object)(object)player) || player.deadSet || player.isDisabled) { continue; } Vector3 position = ((Component)player).transform.position; Vector2 val2; switch (definition.Kind) { case EmpressElevatorEventKind.ConfettiBloom: case EmpressElevatorEventKind.HealingRain: case EmpressElevatorEventKind.HeartPageant: case EmpressElevatorEventKind.BubbleDrift: ApplyHeal(player, Mathf.Max(1, definition.Power / 2), 1.15f); break; case EmpressElevatorEventKind.GiftPulse: ApplyHeal(player, Mathf.Max(2, definition.Power / 2), 0.9f); break; case EmpressElevatorEventKind.SpotlightParade: if ((Object)(object)player.rb != (Object)null) { val2 = new Vector2(player.rb.velocity.x, player.rb.velocity.z); if (((Vector2)(ref val2)).magnitude >= 1.15f) { ApplyHeal(player, Mathf.Max(2, definition.Power / 2), 0.6f); } } break; case EmpressElevatorEventKind.TeamTrial: { EmpressElevatorSpecialObjective? activeObjective = scene.ActiveObjective; if (activeObjective != null && activeObjective.Completed) { ApplyHeal(player, Mathf.Max(2, definition.Power + 1), 0.55f); } break; } case EmpressElevatorEventKind.LanternOrbit: case EmpressElevatorEventKind.PrismGarden: case EmpressElevatorEventKind.CylinderChoir: case EmpressElevatorEventKind.CalmAurora: case EmpressElevatorEventKind.MoonBounce: ApplyHeal(player, Mathf.Max(1, definition.Power / 3), 0.85f); break; case EmpressElevatorEventKind.TreasureDrizzle: ApplyHeal(player, Mathf.Max(1, definition.Power / 3), 0.75f); GrantRunCashTick("treasure", Mathf.Clamp(definition.Power / 3, 2, 5), 0.7f); break; case EmpressElevatorEventKind.LaserSweep: foreach (EmpressElevatorAnimatedPiece activePiece in scene.ActivePieces) { if (Mathf.Abs(position.z - activePiece.Transform.position.z) <= 0.65f && Mathf.Abs(position.y - activePiece.Transform.position.y) <= 1.1f) { ApplyDamage(player, definition.Power, activePiece.Transform.position, 0.75f); } } break; case EmpressElevatorEventKind.RollingOrbs: case EmpressElevatorEventKind.SeekerOrbs: case EmpressElevatorEventKind.BounceBombs: case EmpressElevatorEventKind.MeteorDrop: foreach (EmpressElevatorAnimatedPiece activePiece2 in scene.ActivePieces) { float num4 = HorizontalDistance(position, activePiece2.Transform.position); float num5 = Mathf.Abs(position.y - activePiece2.Transform.position.y); if (num4 <= activePiece2.Radius + 1.08f && num5 <= 1.55f) { ApplyDamage(player, definition.Power, activePiece2.Transform.position, 0.48f); } } break; case EmpressElevatorEventKind.CeilingPress: if (scene.ActivePieces.Count > 0) { Vector3 val = scene.CabinRoot.InverseTransformPoint(position); if (val.x >= -4.7f && val.x <= 4.7f && val.z >= -3.8f && val.z <= 3.8f && position.y >= scene.ActivePieces[0].Transform.position.y - 0.62f) { ApplyDamage(player, definition.Power + 4, scene.ActivePieces[0].Transform.position, 0.8f); } } break; case EmpressElevatorEventKind.SpikeLattice: foreach (EmpressElevatorAnimatedPiece activePiece3 in scene.ActivePieces) { if (activePiece3.Transform.localScale.y > 1f && Vector3.Distance(position, activePiece3.Transform.position) <= activePiece3.Radius + 0.72f) { ApplyDamage(player, definition.Power, activePiece3.Transform.position, 0.8f); } } break; case EmpressElevatorEventKind.ShockRing: { Vector3 val4 = scene.CabinRoot.InverseTransformPoint(position); val2 = new Vector2(val4.x, val4.z); float magnitude = ((Vector2)(ref val2)).magnitude; float num13 = Mathf.Lerp(0.4f, 6.2f, normalized); if (Mathf.Abs(magnitude - num13) <= 1.05f) { ApplyDamage(player, definition.Power, position, 0.7f); } break; } case EmpressElevatorEventKind.SawSweep: foreach (EmpressElevatorAnimatedPiece activePiece4 in scene.ActivePieces) { Vector3 position2 = activePiece4.Transform.position; Vector3 end = position2 + activePiece4.Transform.right * activePiece4.Radius; if (DistanceToSegment(position, position2, end) <= 1f) { ApplyDamage(player, definition.Power + 2, activePiece4.Transform.position, 0.6f); } } break; case EmpressElevatorEventKind.PulseWall: foreach (EmpressElevatorAnimatedPiece activePiece5 in scene.ActivePieces) { if (Mathf.Abs(position.z - activePiece5.Transform.position.z) <= 0.95f && Mathf.Abs(position.x - activePiece5.Transform.position.x) <= activePiece5.Transform.localScale.x * 0.52f) { ApplyDamage(player, definition.Power, activePiece5.Transform.position, 0.7f); } } break; case EmpressElevatorEventKind.FreezeTag: { string key6 = player.steamID + "|freeze"; if (!_ruleAnchors.ContainsKey(key6) || phaseAge < 4.5f) { _ruleAnchors[key6] = position; break; } float num10 = HorizontalDistance(position, _ruleAnchors[key6]); float num11; if (!((Object)(object)player.rb != (Object)null)) { num11 = 0f; } else { val2 = new Vector2(player.rb.velocity.x, player.rb.velocity.z); num11 = ((Vector2)(ref val2)).magnitude; } float num12 = num11; int power2 = definition.Power; if ((power2 <= 9) ? (num10 > 0.42f || num12 > 0.95f) : (power2 switch { 10 => num10 > 0.32f || num12 > 0.75f || !player.isCrouching, 12 => num10 > 0.3f || num12 > 0.8f || scene.CabinRoot.InverseTransformDirection(((Component)player).transform.forward).z < 0.65f, _ => HorizontalDistance(position, scene.CabinRoot.TransformPoint(new Vector3(0f, 0f, 0.2f))) > 1.8f, })) { ApplyDamage(player, definition.Power + 2, position, 0.32f); } break; } case EmpressElevatorEventKind.DirectiveTrial: switch (definition.Power) { case 1: { string key3 = player.steamID + "|traffic"; Vector3 value3; Vector3 b2 = (_ruleAnchors.TryGetValue(key3, out value3) ? value3 : position); _ruleAnchors[key3] = position; if (phaseAge >= 4.5f && !IsDirectiveGreenWindow(phaseAge)) { float num6 = HorizontalDistance(position, b2); float num7; if (!((Object)(object)player.rb != (Object)null)) { num7 = 0f; } else { val2 = new Vector2(player.rb.velocity.x, player.rb.velocity.z); num7 = ((Vector2)(ref val2)).magnitude; } float num8 = num7; if (num6 > 0.13f || num8 > 0.8f) { ApplyDamage(player, 11, position, 0.26f); } } break; } case 2: if (phaseAge >= 4.5f && !player.isCrouching) { ApplyDamage(player, 12, position, 0.3f); } break; case 3: { string key4 = player.steamID + "|jumptax"; string key5 = player.steamID + "|jumptaxGround"; float value4; bool flag = _ruleStillTimers.TryGetValue(key5, out value4) && value4 > 0.5f && !player.isGrounded && (Object)(object)player.rb != (Object)null && player.rb.velocity.y > 1.7f; _ruleStillTimers[key5] = (player.isGrounded ? 1f : 0f); if (flag) { _ruleStillTimers[key4] = Time.time; } float value5; float num9 = (_ruleStillTimers.TryGetValue(key4, out value5) ? value5 : 0f); if (phaseAge >= 4.5f && Time.time - num9 >= 2.15f) { ApplyDamage(player, 12, position, 0.35f); } break; } default: { Vector3 val3 = scene.CabinRoot.InverseTransformPoint(position); val2 = new Vector2(val3.x, val3.z - 0.2f); if (((Vector2)(ref val2)).magnitude <= 2.15f) { ApplyDamage(player, 13, position, 0.3f); } break; } } break; case EmpressElevatorEventKind.MarathonPanic: { string key = player.steamID + "|marathonAnchor"; string key2 = player.steamID + "|marathonStill"; Vector3 value; Vector3 b = (_ruleAnchors.TryGetValue(key, out value) ? value : position); _ruleAnchors[key] = position; if (phaseAge < 4.5f) { _ruleStillTimers[key2] = 0f; break; } float num = HorizontalDistance(position, b); float num2; if (!((Object)(object)player.rb != (Object)null)) { num2 = 0f; } else { val2 = new Vector2(player.rb.velocity.x, player.rb.velocity.z); num2 = ((Vector2)(ref val2)).magnitude; } float num3 = num2; int power = definition.Power; if ((power <= 10) ? (num < 0.14f && num3 < 1.1f) : (power switch { 11 => num3 < 0.65f || ((Object)(object)player.rb != (Object)null && player.rb.velocity.y < 0.05f && player.isGrounded), 12 => Mathf.Abs(scene.CabinRoot.InverseTransformPoint(position).x) < 0.85f, _ => num3 < 1.25f || player.isCrouching, })) { _ruleStillTimers[key2] = (_ruleStillTimers.TryGetValue(key2, out var value2) ? value2 : 0f) + 0.16f; } else { _ruleStillTimers[key2] = 0f; } if (_ruleStillTimers[key2] >= 0.55f) { ApplyDamage(player, definition.Power + 1, position, 0.26f); } break; } case EmpressElevatorEventKind.GravityFlip: { float y = scene.CabinRoot.TransformPoint(new Vector3(0f, 3.9f, 0f)).y; float y2 = scene.CabinRoot.TransformPoint(new Vector3(0f, 0.15f, 0f)).y; if (position.y >= y || (definition.Power >= 12 && position.y <= y2)) { ApplyDamage(player, definition.Power + 3, position, 0.38f); } break; } } } } private void ApplyDamage(PlayerAvatar player, int amount, Vector3 sourcePosition, float cooldown) { //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0069: 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) string key = player.steamID + "|hurt"; if (!_effectCooldowns.TryGetValue(key, out var value) || !(Time.time < value)) { _effectCooldowns[key] = Time.time + cooldown; player.playerHealth.HurtOther(amount, (((Component)player).transform.position == Vector3.zero) ? sourcePosition : ((Component)player).transform.position, false, -1, false); } } private void ApplyHeal(PlayerAvatar player, int amount, float cooldown) { string key = player.steamID + "|heal"; if (!_effectCooldowns.TryGetValue(key, out var value) || !(Time.time < value)) { _effectCooldowns[key] = Time.time + cooldown; player.playerHealth.HealOther(amount, true); } } private void GrantRunCashTick(string bucket, int amount, float cooldown) { string key = "cash|" + bucket; if (!_effectCooldowns.TryGetValue(key, out var value) || !(Time.time < value)) { _effectCooldowns[key] = Time.time + cooldown; SemiFunc.StatSetRunCurrency(SemiFunc.StatGetRunCurrency() + amount); } } private void ResetLocalPlayerEventEffects() { PlayerController instance = PlayerController.instance; if (!((Object)(object)instance == (Object)null)) { instance.CustomGravity = ResolveBaseGravity(instance); instance.MoveSpeed = ResolveBaseMoveSpeed(instance); instance.SprintSpeed = ResolveBaseSprintSpeed(instance); } } private void UpdateLocalPlayerEventEffects(EmpressElevatorSceneState scene, EmpressElevatorFloorDefinition definition, float phaseAge, float normalized) { //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_01e6: Unknown result type (might be due to invalid IL or missing references) //IL_0215: Unknown result type (might be due to invalid IL or missing references) //IL_021f: Unknown result type (might be due to invalid IL or missing references) PlayerController instance = PlayerController.instance; if ((Object)(object)instance == (Object)null || (Object)(object)instance.rb == (Object)null || (Object)(object)instance.playerAvatarScript == (Object)null || instance.playerAvatarScript.deadSet || instance.playerAvatarScript.isDisabled) { return; } ResetLocalPlayerEventEffects(); float num = ResolveBaseMoveSpeed(instance); float num2 = ResolveBaseSprintSpeed(instance); float num3 = ResolveBaseGravity(instance); switch (definition.Kind) { case EmpressElevatorEventKind.SpotlightParade: instance.MoveSpeed = num * 1.18f; instance.SprintSpeed = num2 * 1.42f; break; case EmpressElevatorEventKind.TreasureDrizzle: instance.MoveSpeed = num * 1.08f; instance.SprintSpeed = num2 * 1.16f; break; case EmpressElevatorEventKind.MoonBounce: { instance.CustomGravity = num3 * 0.3f; string key2 = "local|moonbounce"; if ((!_effectCooldowns.TryGetValue(key2, out var value2) || Time.time >= value2) && Mathf.Abs(instance.rb.velocity.y) < 2.2f) { _effectCooldowns[key2] = Time.time + 1.05f; instance.rb.AddForce(Vector3.up * 4.6f, (ForceMode)2); } break; } case EmpressElevatorEventKind.GravityFlip: { if (definition.Power <= 9) { instance.CustomGravity = (0f - Mathf.Abs(num3)) * 0.92f; } else if (definition.Power <= 10) { instance.CustomGravity = (0f - Mathf.Abs(num3)) * 0.52f; } else { float num4 = Mathf.Sin(Time.time * 2.45f); instance.CustomGravity = ((num4 >= 0f) ? ((0f - Mathf.Abs(num3)) * 0.72f) : (Mathf.Abs(num3) * 0.2f)); } string key = "local|gravityflip"; if ((!_effectCooldowns.TryGetValue(key, out var value) || Time.time >= value) && instance.rb.velocity.y < 5f) { _effectCooldowns[key] = Time.time + 0.9f; instance.rb.AddForce(Vector3.up * 5.4f, (ForceMode)2); } break; } } } private static float ResolveBaseMoveSpeed(PlayerController controller) { if (controller.playerOriginalMoveSpeed > 0.01f) { return controller.playerOriginalMoveSpeed; } if (controller.MoveSpeed > 0.01f) { return controller.MoveSpeed; } return 0.5f; } private static float ResolveBaseSprintSpeed(PlayerController controller) { if (controller.playerOriginalSprintSpeed > 0.01f) { return controller.playerOriginalSprintSpeed; } if (controller.SprintSpeed > 0.01f) { return controller.SprintSpeed; } return 1f; } private static float ResolveBaseGravity(PlayerController controller) { if (Mathf.Abs(controller.playerOriginalCustomGravity) > 0.01f) { return Mathf.Abs(controller.playerOriginalCustomGravity); } if (Mathf.Abs(controller.CustomGravity) > 0.01f) { return Mathf.Abs(controller.CustomGravity); } return 20f; } private static string GetLiveDirectiveText(EmpressElevatorFloorDefinition definition, float phaseAge) { float num = Mathf.Max(0f, 4.5f - phaseAge); switch (definition.Kind) { case EmpressElevatorEventKind.FreezeTag: if (phaseAge < 4.5f) { return definition.Name + " :: brace in " + num.ToString("0.0") + "s"; } if (definition.Power <= 9) { return definition.Name + " :: do not move"; } if (definition.Power == 10) { return definition.Name + " :: crouch and hold still"; } if (definition.Power == 12) { return definition.Name + " :: face the door and freeze"; } return definition.Name + " :: stay in the center ring"; case EmpressElevatorEventKind.MarathonPanic: if (phaseAge < 4.5f) { return definition.Name + " :: start obeying in " + num.ToString("0.0") + "s"; } if (definition.Power <= 10) { return definition.Name + " :: keep moving or get cooked"; } if (definition.Power == 11) { return definition.Name + " :: keep hopping"; } if (definition.Power == 12) { return definition.Name + " :: stay off the middle line"; } return definition.Name + " :: sprint. no crouching."; case EmpressElevatorEventKind.GravityFlip: if (definition.Power <= 9) { return definition.Name + " :: gravity reversed. ceiling hurts."; } if (definition.Power == 10) { return definition.Name + " :: soft reverse gravity. float smart."; } return definition.Name + " :: gravity pulses both ways."; case EmpressElevatorEventKind.MoonBounce: return definition.Name + " :: bounce party. enjoy the weird gravity."; case EmpressElevatorEventKind.TreasureDrizzle: return definition.Name + " :: free money is raining."; case EmpressElevatorEventKind.SpotlightParade: return definition.Name + " :: move with the lights for extra healing."; default: return definition.Name; } } private static float HorizontalDistance(Vector3 a, Vector3 b) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000d: 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_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) Vector2 val = new Vector2(a.x - b.x, a.z - b.z); return ((Vector2)(ref val)).magnitude; } private static bool IsDirectiveGreenWindow(float phaseAge) { if (phaseAge < 4.5f) { return true; } float num = Mathf.Repeat(phaseAge - 4.5f, 2.35f); return num < 1.15f; } private List GetAlivePlayers() { List list = new List(); if ((Object)(object)GameDirector.instance == (Object)null) { return list; } foreach (PlayerAvatar player in GameDirector.instance.PlayerList) { if (Object.op_Implicit((Object)(object)player) && !player.deadSet && !player.isDisabled) { list.Add(player); } } return list; } private static bool IsLookingAtThreat(EmpressElevatorSceneState scene, EmpressElevatorSpecialObjective objective, PlayerAvatar player, float alignmentThreshold) { //IL_0016: 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_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)objective.ThreatFigure == (Object)null) { return false; } Vector3 val = objective.ThreatFigure.position - ((Component)player).transform.position; Vector3 normalized = ((Vector3)(ref val)).normalized; val = ((Component)player).transform.forward; return Vector3.Dot(((Vector3)(ref val)).normalized, normalized) >= alignmentThreshold; } private static PlayerAvatar? FindPlayerBySteamId(string steamId) { if ((Object)(object)GameDirector.instance == (Object)null || string.IsNullOrWhiteSpace(steamId)) { return null; } foreach (PlayerAvatar player in GameDirector.instance.PlayerList) { if (Object.op_Implicit((Object)(object)player) && player.steamID == steamId) { return player; } } return null; } private static bool IsInsideCabinZone(EmpressElevatorSceneState scene, Vector3 worldPosition) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) Vector3 val = scene.CabinRoot.InverseTransformPoint(worldPosition); if (val.x >= -4.7f && val.x <= 4.7f && val.z >= -3.8f) { return val.z <= 4.4f; } return false; } private static void ApplyFatalDamage(PlayerAvatar player) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) player.playerHealth.HurtOther(999, ((Component)player).transform.position, false, -1, false); if (SemiFunc.IsMasterClientOrSingleplayer()) { EmpressTheElevatorPlugin.EnsureRuntime().ScheduleDeathHeadRecovery(player.steamID, 0.28f); } } private static float CabinX(float t) { return Mathf.Lerp(-4.35f, 4.35f, Mathf.Clamp01(t)); } private static float CabinZ(float t) { return Mathf.Lerp(-3.45f, 3.45f, Mathf.Clamp01(t)); } private static Vector3 ClampCabinLocalPosition(Vector3 localPosition, float padding) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0035: 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) float num = Mathf.Clamp(localPosition.x, -4.35f + padding, 4.35f - padding); float num2 = Mathf.Clamp(localPosition.z, -3.45f + padding, 3.45f - padding); return new Vector3(num, localPosition.y, num2); } private static Vector3 GetNearestPlayerLocalPosition(Transform reference, Vector3 worldSource) { //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_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_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_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) if ((Object)(object)GameDirector.instance == (Object)null || GameDirector.instance.PlayerList.Count == 0) { return reference.InverseTransformPoint(worldSource); } float num = float.MaxValue; Vector3 result = Vector3.zero; foreach (PlayerAvatar player in GameDirector.instance.PlayerList) { if (Object.op_Implicit((Object)(object)player) && !player.deadSet && !player.isDisabled) { float num2 = Vector3.Distance(worldSource, ((Component)player).transform.position); if (num2 < num) { num = num2; result = reference.InverseTransformPoint(((Component)player).transform.position); } } } return result; } private static float DistanceToSegment(Vector3 point, Vector3 start, Vector3 end) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: 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_0027: 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_0036: 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_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_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) Vector3 val = end - start; float sqrMagnitude = ((Vector3)(ref val)).sqrMagnitude; if (sqrMagnitude <= 0.0001f) { return Vector3.Distance(point, start); } float num = Mathf.Clamp01(Vector3.Dot(point - start, val) / sqrMagnitude); Vector3 val2 = start + val * num; return Vector3.Distance(point, val2); } } internal enum EmpressElevatorPhase { Moving, Opening, Event, Closing } internal sealed class EmpressElevatorAnimatedPiece { internal Transform Transform; internal Vector3 Home; internal Vector3 Scale; internal float Phase; internal float Speed; internal float Radius; } internal sealed class EmpressElevatorSceneState { internal int RunToken; internal int RunSeed; internal LevelGenerator Generator; internal Transform LevelRoot; internal Transform CabinRoot; internal Transform ChamberRoot; internal Transform EventAnchor; internal Transform DecisionBoardRoot; internal RoomVolume RoomVolume; internal BoxCollider BarrierCollider; internal Transform DoorLeft; internal Transform DoorRight; internal Vector3 DoorLeftClosedLocal; internal Vector3 DoorLeftOpenLocal; internal Vector3 DoorRightClosedLocal; internal Vector3 DoorRightOpenLocal; internal float DoorOpenAmount; internal Transform? ActiveEventRoot; internal Transform? ActiveCabinEventRoot; internal Transform? RollCube; internal Canvas HudCanvas; internal Text FloorText; internal Text StatusText; internal Text EventNameText; internal Text RewardText; internal Text PromptText; internal Image PromptBackground; internal EmpressElevatorPhase Phase; internal float PhaseStartedAt; internal float NextAuthorityTickAt; internal int CurrentFloorNumber; internal int PendingFloorNumber; internal bool HostLoopStarted; internal EmpressElevatorFloorDefinition? ActiveDefinition; internal bool EventVisualsBuilt; internal bool SkipRewardForFloor; internal bool LevelExitRequested; internal EmpressElevatorSpecialObjective? ActiveObjective; internal float RewardTextUntil; internal Transform SkipButton; internal Transform? SkipButtonTrigger; internal Vector3 RollCubeStartLocal; internal Vector3 RollCubeGoodLocal; internal Vector3 RollCubeBadLocal; internal List LevelPoints { get; } = new List(); internal List CabinLights { get; } = new List(); internal List ActivePieces { get; } = new List(); internal List ShuffledGoodDefinitions { get; set; } = new List(); internal List ShuffledBadDefinitions { get; set; } = new List(); } internal enum EmpressElevatorSpecialObjectiveKind { None, SoloErrand, TeamTrial, DirectiveTrial, DoNotTurnAround } internal sealed class EmpressElevatorSpecialObjective { internal EmpressElevatorSpecialObjectiveKind Kind; internal string TargetSteamId = string.Empty; internal string TargetPlayerName = string.Empty; internal int Variant; internal int RequiredCount; internal int Progress; internal bool TaskComplete; internal bool Completed; internal bool FatalApplied; internal bool Triggered; internal float HoldProgress; internal float HoldTarget = 0.65f; internal float LastActionAt; internal float FailureDelaySeconds = 3f; internal bool PreviousGrounded; internal int ActiveMarkerIndex; internal Transform? Primary; internal Transform? Secondary; internal Transform? ThreatFigure; internal List Markers { get; } = new List(); internal HashSet CompletedMarkerIndices { get; } = new HashSet(); internal HashSet ParticipantSteamIds { get; } = new HashSet(); } }