Due to update 2.4.3, some mods may no longer function. FixedConfig may be necessary.
Decompiled source of Bopl Shift v0.6.2
BepInEx/plugins/BoplPossession/BoplPossession.dll
Decompiled 28 minutes ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Security.Cryptography; using System.Text; using BepInEx; using BepInEx.Logging; using BoplFixedMath; using HarmonyLib; using UnityEngine; using UnityEngine.SceneManagement; [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: CompilationRelaxations(8)] [assembly: AssemblyVersion("0.0.0.0")] namespace BoplArsenal; internal static class AbilityTheft { private static readonly FieldInfo Timers = AccessTools.Field(typeof(SlimeController), "abilityCooldownTimers"); private static readonly FieldInfo PickupIndex = AccessTools.Field(typeof(SlimeController), "nextAbiltityToChangeOnPickup"); internal static GameObject EmptyPrefab; internal static Sprite EmptyIcon; internal static NamedSprite FindSkill(SlimeController target, int slot) { //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)target == (Object)null || ((MonoUpdatable)target).IsDestroyed || slot < 0 || slot >= target.abilities.Count || (Object)(object)target.abilities[slot] == (Object)null || ((MonoUpdatable)target.abilities[slot]).IsDestroyed || target.abilities[slot] is EmptyAbility) { return default(NamedSprite); } Player player = PlayerHandler.Get().GetPlayer(target.playerNumber); if (player == null || !player.IsAlive || slot >= player.AbilityIcons.Count) { return default(NamedSprite); } Sprite currentIcon = target.AbilityReadyIndicators[slot].GetSpriteRen().sprite; NamedSpriteList val = Resources.FindObjectsOfTypeAll<NamedSpriteList>().First((NamedSpriteList x) => ((Object)x).name == "AbilityIcons"); return ((IEnumerable<NamedSprite>)val.sprites).FirstOrDefault((Func<NamedSprite, bool>)((NamedSprite x) => (Object)(object)x.sprite == (Object)(object)currentIcon && (Object)(object)x.associatedGameObject != (Object)null && x.name != "NullAbility" && x.name != "Random")); } internal static bool Steal(HandAbility hand, SlimeController target, int slot) { //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_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0082: 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_010f: 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_0125: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: 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) NamedSprite val = FindSkill(target, slot); SlimeController owner = hand.Owner; if ((Object)(object)val.associatedGameObject == (Object)null || (Object)(object)owner == (Object)null || ((MonoUpdatable)owner).IsDestroyed || (Object)(object)owner.abilities[slot] != (Object)(object)((Component)hand).GetComponent<Ability>()) { return false; } AbilityMonoBehaviour val2 = target.abilities[slot]; Fix elapsed = ((Fix[])Timers.GetValue(target))[slot]; Fix cooldown = val2.GetCooldown(); GameObject val3 = FixTransform.InstantiateFixed(val.associatedGameObject, Vec2.zero); val3.SetActive(false); GameObject val4 = FixTransform.InstantiateFixed(EmptyPrefab, Vec2.zero); val4.SetActive(false); AbilityMonoBehaviour component = val3.GetComponent<AbilityMonoBehaviour>(); if (!((Component)target).gameObject.activeSelf && ((Component)val2).gameObject.activeSelf) { IAbilityComponent component2 = ((Component)val2).GetComponent<IAbilityComponent>(); if (component2 != null) { component2.ExitAbility(default(AbilityExitInfo)); } else { val2.ExitAbility(default(AbilityExitInfo)); } } Replace(target, slot, (AbilityMonoBehaviour)(object)val4.GetComponent<EmptyAbility>(), EmptyIcon, Fix.One); Replace(owner, slot, component, val.sprite, HandReach.StolenCooldown(elapsed, cooldown, component.GetCooldown())); Updater.DestroyFix(((Component)val2).gameObject); Plugin.Log.LogInfo((object)("Hand stole slot " + (slot + 1) + " (" + val.name + ") from player " + target.playerNumber + " to " + owner.playerNumber)); return true; } internal static bool FillEmptySlot(SlimeController slime, AbilityMonoBehaviour ability, Sprite icon) { //IL_0034: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < slime.abilities.Count; i++) { EmptyAbility emptyAbility = slime.abilities[i] as EmptyAbility; if (!((Object)(object)emptyAbility == (Object)null) && !((MonoUpdatable)emptyAbility).IsDestroyed) { Replace(slime, i, ability, icon, (Fix)100000L); Updater.DestroyFix(((Component)emptyAbility).gameObject); Plugin.Log.LogInfo((object)("Pickup filled stolen slot " + (i + 1) + " for player " + slime.playerNumber)); return true; } } return false; } private static void Replace(SlimeController slime, int slot, AbilityMonoBehaviour ability, Sprite icon, Fix timer) { //IL_0078: 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) Player player = PlayerHandler.Get().GetPlayer(slime.playerNumber); GameObject gameObject = ((Component)slime.abilities[slot]).gameObject; int num = (int)PickupIndex.GetValue(slime); PickupIndex.SetValue(slime, slot); try { slime.AddAbility(ability, icon, (GameObject)null); } finally { PickupIndex.SetValue(slime, num); } ((Fix[])Timers.GetValue(slime))[slot] = timer; int num2 = player.CurrentAbilities.IndexOf(gameObject); if (num2 >= 0) { player.CurrentAbilities[num2] = ((Component)ability).gameObject; } } } public sealed class EmptyAbility : AbilityMonoBehaviour { public override bool IsRope => false; public override bool CooldownStoppedDuringTimeStop => true; public override bool IgnoreNextCooldown => false; private void Awake() { Updater.RegisterUpdatable((MonoUpdatable)(object)this); } public override void Init() { } public override void UpdateSim(Fix delta) { } public override Fix GetCooldown() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) return Fix.One; } public override bool IsInstant() { return true; } public override bool IsCastable(Player player) { return false; } public override void UpdateCooldowns(PlayerBody body) { } public override PlayerCollision GetPlayerCollision() { return null; } public override SlimeController GetSlimeController() { return null; } public override void EnterAbility(PlayerInfo info, Action<AbilityExitInfo> exit) { } public override void ExitAbility(AbilityExitInfo info) { } } public sealed class HandAbility : MonoUpdatable, IAbilityComponent { private enum Phase { Enter, Aim, Reach, Grip, Return } public Sprite OpenSprite; public Sprite ReachSprite; public Sprite CurlSprite; public Sprite GripSprite; public AnimationData FaceAnimations; private Ability ability; private PlayerBody body; private PlayerPhysics physics; private DPhysicsBox hitbox; private SpriteRenderer root; private SpriteRenderer visual; private SpriteRenderer face; private SpriteRenderer prize; private SpriteAnimator eyes; private PlayerInfo info; private Player player; private Vec2 direction; private Fix elapsed; private Fix normalRadius; private bool grabbed; private bool stolen; private bool exited; private Phase phase; public SlimeController Owner => info.slimeController; public bool HasStolen => stolen; public Vec2 AimDirection => direction; internal static GameObject CreatePrefab(MagnetGun source, Sprite open, Sprite reach, Sprite curl, Sprite grip, AnimationData faces) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("Hand template staging"); val.SetActive(false); GameObject val2 = Object.Instantiate<GameObject>(((Component)source).gameObject, val.transform); val2.SetActive(false); Object.DestroyImmediate((Object)(object)val2.GetComponent<MagnetGun>()); for (int num = val2.transform.childCount - 1; num >= 0; num--) { Object.DestroyImmediate((Object)(object)((Component)val2.transform.GetChild(num)).gameObject); } ((Behaviour)val2.GetComponent<SpriteAnimator>()).enabled = false; Ability component = val2.GetComponent<Ability>(); component.Cooldown = (Fix)15L; ((AbilityMonoBehaviour)component).OnlyCastableOnGround = false; component.KillPlayersOnContact = false; component.cooldownStoppedDuringTimeStop = true; HandAbility handAbility = val2.AddComponent<HandAbility>(); ((MonoUpdatable)handAbility).HierarchyNumber = ((MonoUpdatable)source).HierarchyNumber; handAbility.OpenSprite = open; handAbility.ReachSprite = reach; handAbility.CurlSprite = curl; handAbility.GripSprite = grip; handAbility.FaceAnimations = faces; ((Object)val2).name = "Bopl stealing hand ability"; val2.transform.SetParent((Transform)null, false); Object.DontDestroyOnLoad((Object)(object)val2); ((Object)val2).hideFlags = (HideFlags)52; Object.Destroy((Object)(object)val); return val2; } private void Awake() { //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Expected O, but got Unknown Updater.RegisterUpdatable((MonoUpdatable)(object)this); ability = ((Component)this).GetComponent<Ability>(); body = ((Component)this).GetComponent<PlayerBody>(); physics = ((Component)this).GetComponent<PlayerPhysics>(); hitbox = ((Component)this).GetComponent<DPhysicsBox>(); root = ((Component)this).GetComponent<SpriteRenderer>(); visual = Child("Hand animated body", ((Component)this).transform, ((Renderer)root).sortingOrder); face = Child("Hand animated eyes", ((Component)visual).transform, ((Renderer)root).sortingOrder + 1); eyes = ((Component)face).gameObject.AddComponent<SpriteAnimator>(); ((MonoUpdatable)eyes).HierarchyNumber = ((MonoUpdatable)this).HierarchyNumber + 1; eyes.AlwaysStopDuringTimeStop = true; prize = Child("Hand stolen ability", ((Component)visual).transform, ((Renderer)root).sortingOrder + 2); ((Renderer)prize).sharedMaterial = new Material(Shader.Find("Sprites/Default")); } private SpriteRenderer Child(string name, Transform parent, int order) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown GameObject val = new GameObject(name); val.transform.SetParent(parent, false); SpriteRenderer val2 = val.AddComponent<SpriteRenderer>(); ((Renderer)val2).sortingLayerID = ((Renderer)root).sortingLayerID; ((Renderer)val2).sortingOrder = order; return val2; } public override void Init() { } public void OnScaleChanged(Fix multiplier) { } public void OnEnterAbility() { //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_0033: 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_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0065: 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_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Unknown result type (might be due to invalid IL or missing references) //IL_01af: Unknown result type (might be due to invalid IL or missing references) //IL_01cc: Unknown result type (might be due to invalid IL or missing references) //IL_01d1: Unknown result type (might be due to invalid IL or missing references) //IL_01ef: Unknown result type (might be due to invalid IL or missing references) //IL_01e3: Unknown result type (might be due to invalid IL or missing references) //IL_01e8: Unknown result type (might be due to invalid IL or missing references) //IL_01f4: Unknown result type (might be due to invalid IL or missing references) //IL_0201: Unknown result type (might be due to invalid IL or missing references) //IL_0206: Unknown result type (might be due to invalid IL or missing references) info = ability.GetPlayerInfo(); player = PlayerHandler.Get().GetPlayer(info.playerId); physics.SyncPhysicsTo(info); normalRadius = physics.radius / player.Scale; physics.radius = normalRadius * player.Scale; ((Component)this).GetComponent<FixTransform>().offset = Vec2.zero; hitbox.SetExtents(new Vec2((Fix)2L, (Fix)1.3m) * player.Scale); ((Renderer)root).enabled = false; SpriteRenderer obj = visual; Material sharedMaterial = (((Renderer)face).sharedMaterial = info.playerMaterial); ((Renderer)obj).sharedMaterial = sharedMaterial; ((Component)visual).transform.localPosition = Vector3.zero; ((Component)visual).transform.localScale = Vector3.one; visual.sprite = OpenSprite; ((Renderer)face).enabled = true; eyes.beginAnimation(FaceAnimations.GetAnimation("WidthLoop")); Transform transform = ((Component)face).transform; Vector3 one = Vector3.one; Bounds bounds = face.sprite.bounds; transform.localScale = one * (2.7f / ((Bounds)(ref bounds)).size.x); ((Component)face).transform.localPosition = new Vector3(-0.85f, 0f, -0.01f); ((Renderer)prize).enabled = false; direction = ((info.forwardsVector == Vec2.zero) ? Vec2.right : Vec2.NormalizedSafe(info.forwardsVector)); phase = Phase.Enter; elapsed = Fix.Zero; grabbed = (stolen = (exited = false)); AudioManager.Get().Play("transform3"); } public override void UpdateSim(Fix simDeltaTime) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0120: 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_0165: 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_045e: Unknown result type (might be due to invalid IL or missing references) //IL_0463: Unknown result type (might be due to invalid IL or missing references) //IL_01de: Unknown result type (might be due to invalid IL or missing references) //IL_01ee: Unknown result type (might be due to invalid IL or missing references) //IL_01f3: Unknown result type (might be due to invalid IL or missing references) //IL_0359: 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_036e: Unknown result type (might be due to invalid IL or missing references) //IL_03a3: Unknown result type (might be due to invalid IL or missing references) //IL_02ce: Unknown result type (might be due to invalid IL or missing references) //IL_02dd: Unknown result type (might be due to invalid IL or missing references) //IL_0251: 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_0290: Unknown result type (might be due to invalid IL or missing references) //IL_02a0: Unknown result type (might be due to invalid IL or missing references) //IL_0408: Unknown result type (might be due to invalid IL or missing references) //IL_041b: Unknown result type (might be due to invalid IL or missing references) //IL_0426: Unknown result type (might be due to invalid IL or missing references) //IL_0436: Unknown result type (might be due to invalid IL or missing references) //IL_032e: Unknown result type (might be due to invalid IL or missing references) //IL_033d: Unknown result type (might be due to invalid IL or missing references) //IL_0305: Unknown result type (might be due to invalid IL or missing references) //IL_0314: 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_044b: Unknown result type (might be due to invalid IL or missing references) if (exited) { return; } Fix val = GameTime.FixedDeltaTime(info.playerId, simDeltaTime); if (val <= Fix.Zero) { return; } elapsed += val; if (phase == Phase.Enter || phase == Phase.Aim) { Vec2 val2 = player.AimVector(); if (Vec2.Magnitude(val2) > Constants.DEADZONE) { direction = Vec2.NormalizedSafe(val2); } } if (physics.IsGrounded()) { physics.Move(Vec2.zero, simDeltaTime, true); physics.DropPlatformTest(); } else { physics.AddGravityFactor(); physics.VelocityBasedRaycasts(true, simDeltaTime); } body.up = new Vec2(-direction.y, direction.x); hitbox.UpdatePhysicsPositions(); if (phase == Phase.Enter) { AnimateTransition((float)(elapsed / (Fix)0.2m)); if (elapsed >= (Fix)0.2m) { Change(Phase.Aim); } } else if (phase == Phase.Aim) { visual.sprite = OpenSprite; float num = Mathf.Sin((float)elapsed * 9f) * 0.035f; ((Component)visual).transform.localScale = new Vector3(1f + num, 1f - num, 1f); if (!player.AbilityButtonIsDown(info.AbilityButtonUsedIndex012)) { Change(Phase.Reach); } } else if (phase == Phase.Reach) { float num2 = Mathf.Clamp01((float)(elapsed / (Fix)0.18m)); visual.sprite = ((num2 < 0.25f) ? OpenSprite : ((num2 < 0.8f) ? ReachSprite : CurlSprite)); ((Component)visual).transform.localPosition = new Vector3(num2 * 0.75f, 0f, 0f); ((Component)visual).transform.localScale = new Vector3(1f + 0.2f * num2, 1f - 0.12f * num2, 1f); if (elapsed >= (Fix)0.18m) { Change(Phase.Grip); } } else if (phase == Phase.Grip) { visual.sprite = ((elapsed < (Fix)0.08m) ? CurlSprite : GripSprite); if (!grabbed && elapsed >= (Fix)0.08m) { grabbed = true; TryGrab(); } if (elapsed >= (Fix)0.3m) { Change(Phase.Return); } } else { float num3 = Mathf.Clamp01((float)(elapsed / (Fix)0.25m)); ((Component)visual).transform.localPosition = new Vector3((1f - num3) * 0.75f, 0f, 0f); visual.sprite = ((num3 < 0.35f) ? GripSprite : ((num3 < 0.65f) ? CurlSprite : ReachSprite)); if (num3 > 0.65f) { AnimateTransition((1f - num3) / 0.35f); } ((Component)prize).transform.localScale = Vector3.one * (1.1f * (1f - num3)); if (elapsed >= (Fix)0.25m) { ExitAbility(default(AbilityExitInfo)); } } face.flipY = direction.x < Fix.Zero; } private void Change(Phase next) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) phase = next; elapsed = Fix.Zero; if (next == Phase.Grip) { eyes.beginAnimation(FaceAnimations.GetAnimation("ToExit")); } if (next == Phase.Return) { eyes.beginAnimation(FaceAnimations.GetAnimation("WidthLoop")); } } private void AnimateTransition(float t) { //IL_0081: Unknown result type (might be due to invalid IL or missing references) t = Mathf.Clamp01(t); visual.sprite = ((t < 0.5f) ? info.EntrySprite : OpenSprite); ((Renderer)face).enabled = t >= 0.5f; float num = Mathf.Abs(t * 2f - 1f); ((Component)visual).transform.localScale = new Vector3(0.35f + 0.65f * num, 1.2f - 0.2f * num, 1f); } private void TryGrab() { //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_0239: 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_028d: Unknown result type (might be due to invalid IL or missing references) //IL_02a2: Unknown result type (might be due to invalid IL or missing references) //IL_02ac: 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_0144: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_017d: 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_0192: Unknown result type (might be due to invalid IL or missing references) //IL_019d: Unknown result type (might be due to invalid IL or missing references) //IL_01a2: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: 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_01ba: Unknown result type (might be due to invalid IL or missing references) //IL_01bc: 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_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_01cf: Unknown result type (might be due to invalid IL or missing references) //IL_0204: Unknown result type (might be due to invalid IL or missing references) //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_01e6: Unknown result type (might be due to invalid IL or missing references) //IL_01eb: Unknown result type (might be due to invalid IL or missing references) //IL_01ed: Unknown result type (might be due to invalid IL or missing references) //IL_01ef: Unknown result type (might be due to invalid IL or missing references) //IL_01f4: Unknown result type (might be due to invalid IL or missing references) //IL_01f6: Unknown result type (might be due to invalid IL or missing references) SlimeController val = null; Fix val2 = Fix.MaxValue; foreach (MonoUpdatable updatable in Updater.updatables) { SlimeController val3 = (SlimeController)(object)((updatable is SlimeController) ? updatable : null); if ((Object)(object)val3 == (Object)null || ((MonoUpdatable)val3).IsDestroyed || val3.playerNumber == info.playerId || (Object)(object)AbilityTheft.FindSkill(val3, info.AbilityButtonUsedIndex012).associatedGameObject == (Object)null) { continue; } Player val4 = PlayerHandler.Get().GetPlayer(val3.playerNumber); if (val4.Team == player.Team) { continue; } IPhysicsCollider val5 = (((Component)val3).gameObject.activeSelf ? ((Component)val3).GetComponent<IPhysicsCollider>() : null); if (val5 == null) { foreach (AbilityMonoBehaviour ability in val3.abilities) { if ((Object)(object)ability != (Object)null && !((MonoUpdatable)ability).IsDestroyed && ((Component)ability).gameObject.activeSelf) { val5 = ((Component)ability).GetComponent<IPhysicsCollider>(); break; } } } if (val5 == null || val5.IsDestroyed || !val5.enabled) { continue; } Vec2 val6 = val5.position - body.position; Fix radius = ((Component)val3).GetComponent<PlayerPhysics>().radius; if (HandReach.Hit(val6, direction, radius, (Fix)3.2m * player.Scale, (Fix)0.9m * player.Scale, out var distance) && !(distance >= val2)) { Fix val7 = Vec2.Magnitude(val6); if (!(val7 > (Fix)0.01m) || !RaycastInformation.op_Implicit(DetPhysics.Get().RaycastToClosestRoundedRect(body.position, val6 / val7, val7))) { val = val3; val2 = distance; } } } if (!((Object)(object)val == (Object)null)) { Sprite sprite = AbilityTheft.FindSkill(val, info.AbilityButtonUsedIndex012).sprite; stolen = AbilityTheft.Steal(this, val, info.AbilityButtonUsedIndex012); if (stolen) { prize.sprite = sprite; ((Component)prize).transform.localPosition = new Vector3(0.6f, 0f, -0.02f); ((Component)prize).transform.localScale = Vector3.one * 0.45f; ((Renderer)prize).enabled = true; } } } private void LateUpdate() { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)visual != (Object)null) { SpriteRenderer obj = visual; Color color = (face.color = root.color); obj.color = color; } } private void OnDestroy() { if ((Object)(object)prize != (Object)null && (Object)(object)((Renderer)prize).sharedMaterial != (Object)null) { Object.Destroy((Object)(object)((Renderer)prize).sharedMaterial); } } public void ExitAbility(AbilityExitInfo exitInfo) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_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_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) if (!exited) { exited = true; body.rotation = Fix.Zero; physics.UnGround(true, false); physics.radius = normalRadius * player.Scale; exitInfo.groundedSpeed = physics.groundedSpeed; exitInfo.isGrounded = physics.IsGrounded(); exitInfo.isFacingRight = direction.x >= Fix.Zero; exitInfo.position = body.position; exitInfo.selfImposedVelocity = body.selfImposedVelocity; exitInfo.externalVelocity = body.externalVelocity; exitInfo.currentlyAttachedGround = physics.getAttachedGround(); exitInfo.lastSprite = info.EntrySprite; exitInfo.groundedLocalPosition = physics.LocalPlatformPos; exitInfo.radius = physics.radius; ((AbilityMonoBehaviour)ability).ExitAbility(exitInfo); if (stolen) { Updater.DestroyFix(((Component)this).gameObject); } } } } public static class HandReach { public static bool Hit(Vec2 offset, Vec2 direction, Fix radius, Fix reach, Fix halfWidth, out Fix distance) { //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_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: 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_0049: 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_0052: 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_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0069: 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_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) Fix val = Vec2.Dot(offset, direction); Fix val2 = Fix.Max(Fix.Zero, Fix.Abs(Vec2.Dot(offset, new Vec2(-direction.y, direction.x))) - halfWidth); distance = Fix.MaxValue; if (val2 > radius || val < Fix.Zero) { return false; } distance = Fix.Max(Fix.Zero, val - Fix.Sqrt(radius * radius - val2 * val2)); return distance <= reach; } public static Fix StolenCooldown(Fix elapsed, Fix originalCooldown, Fix newCooldown) { //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_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_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) Fix val = Fix.Max(newCooldown, Fix.Max(Fix.Zero, originalCooldown - elapsed)); return newCooldown - val; } } public struct IconLayout { public int Rows; public float Cell; public float EntrySize; public float Left; public float Top; public static IconLayout Fit(int count, int columns, float width, float height, float largestScale) { if (count < 1 || columns < 1 || width <= 0f || height <= 0f || largestScale <= 0f) { throw new ArgumentOutOfRangeException("Grid dimensions must be positive."); } IconLayout result = default(IconLayout); result.Rows = (count + columns - 1) / columns; float num = width * 0.12f; float num2 = height * 0.13f; float num3 = height * 0.045f; float num4 = height - num2 - num3; result.Cell = Math.Min((width - 2f * num) / (float)columns, num4 / (float)result.Rows); result.EntrySize = result.Cell * 0.88f / largestScale; result.Left = (float)(-columns) * result.Cell / 2f; result.Top = height / 2f - num2; return result; } } public sealed class MirrorAbility : MonoUpdatable, IAbilityComponent { internal static readonly List<MirrorAbility> Active = new List<MirrorAbility>(); public Sprite IntactSprite; public Sprite BrokenSprite; public AnimationData FaceAnimations; public Fix BeamAimStep; public AnimationCurveFixed BeamAimCurve; private Ability ability; private PlayerBody body; private PlayerPhysics physics; private SpriteRenderer rootRenderer; private SpriteRenderer visual; private SpriteRenderer face; private SpriteAnimator faceAnimator; private Sprite[] coloredBody; private PlayerInfo info; private Player player; private MirrorCycle cycle; private Vec2 direction; private Fix transition; private bool exiting; private Fix normalRadius; private DPhysicsBox hitbox; private Fix beamContactRemaining; private Fix beamAimElapsed; private static readonly Fix TransitionTime = (Fix)0.25m; public bool Reflecting { get { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) if (!exiting && transition >= TransitionTime && cycle != null) { return !cycle.Broken; } return false; } } public bool Broken { get { if (cycle != null) { return cycle.Broken; } return false; } } public Vec2 AimDirection => direction; internal int PlayerId => info.playerId; public Vec2 Center => hitbox.physicsBox.center; public Vec2 BodyRight => body.right; public Vec2 BodyExtents => hitbox.CalcExtents(); public bool SteeringBeam { get { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) if (Reflecting) { return beamContactRemaining > Fix.Zero; } return false; } } public Vec2 OutgoingOrigin => MirrorMath.ExitPoint(Center, BodyRight, BodyExtents, direction); internal void ReceiveBeam() { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) beamContactRemaining = (Fix)0.08m; } internal static GameObject CreatePrefab(MagnetGun source, Sprite intact, Sprite broken, AnimationData faces, Beam beam) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("Mirror template staging"); val.SetActive(false); GameObject val2 = Object.Instantiate<GameObject>(((Component)source).gameObject, val.transform); val2.SetActive(false); Object.DestroyImmediate((Object)(object)val2.GetComponent<MagnetGun>()); for (int num = val2.transform.childCount - 1; num >= 0; num--) { Object.DestroyImmediate((Object)(object)((Component)val2.transform.GetChild(num)).gameObject); } ((Behaviour)val2.GetComponent<SpriteAnimator>()).enabled = false; Ability component = val2.GetComponent<Ability>(); component.Cooldown = (Fix)2L; component.cooldownStoppedDuringTimeStop = true; MirrorAbility mirrorAbility = val2.AddComponent<MirrorAbility>(); ((MonoUpdatable)mirrorAbility).HierarchyNumber = ((MonoUpdatable)source).HierarchyNumber; mirrorAbility.IntactSprite = intact; mirrorAbility.BrokenSprite = broken; mirrorAbility.FaceAnimations = faces; mirrorAbility.BeamAimStep = beam.angularAimSpeed; mirrorAbility.BeamAimCurve = beam.angularAimSpeedAnim01; ((Object)val2).name = "Bopl Mirror ability"; val2.transform.SetParent((Transform)null, false); Object.DontDestroyOnLoad((Object)(object)val2); ((Object)val2).hideFlags = (HideFlags)52; Object.Destroy((Object)(object)val); return val2; } private void Awake() { //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Expected O, but got Unknown //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Expected O, but got Unknown //IL_00c9: Unknown result type (might be due to invalid IL or missing references) Updater.RegisterUpdatable((MonoUpdatable)(object)this); ability = ((Component)this).GetComponent<Ability>(); body = ((Component)this).GetComponent<PlayerBody>(); physics = ((Component)this).GetComponent<PlayerPhysics>(); hitbox = ((Component)this).GetComponent<DPhysicsBox>(); rootRenderer = ((Component)this).GetComponent<SpriteRenderer>(); GameObject val = new GameObject("Mirror transformed body"); val.transform.SetParent(((Component)this).transform, false); visual = val.AddComponent<SpriteRenderer>(); ((Renderer)visual).sortingLayerID = ((Renderer)rootRenderer).sortingLayerID; ((Renderer)visual).sortingOrder = ((Renderer)rootRenderer).sortingOrder; GameObject val2 = new GameObject("Mirror animated face"); val2.transform.SetParent(val.transform, false); val2.transform.localPosition = new Vector3(0f, 0.2f, -0.01f); face = val2.AddComponent<SpriteRenderer>(); ((Renderer)face).sortingLayerID = ((Renderer)visual).sortingLayerID; ((Renderer)face).sortingOrder = ((Renderer)visual).sortingOrder + 1; faceAnimator = val2.AddComponent<SpriteAnimator>(); ((MonoUpdatable)faceAnimator).HierarchyNumber = ((MonoUpdatable)this).HierarchyNumber + 1; } public override void Init() { } public void OnScaleChanged(Fix scaleMultiplier) { } public void OnEnterAbility() { //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_0033: 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_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0072: 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_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: 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_010e: 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_012e: Unknown result type (might be due to invalid IL or missing references) //IL_01da: Unknown result type (might be due to invalid IL or missing references) //IL_01ef: Unknown result type (might be due to invalid IL or missing references) //IL_01f4: Unknown result type (might be due to invalid IL or missing references) //IL_01f7: Unknown result type (might be due to invalid IL or missing references) //IL_0202: Unknown result type (might be due to invalid IL or missing references) //IL_0213: 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) //IL_00b0: 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_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_0236: Unknown result type (might be due to invalid IL or missing references) //IL_022a: Unknown result type (might be due to invalid IL or missing references) //IL_022f: Unknown result type (might be due to invalid IL or missing references) //IL_023b: Unknown result type (might be due to invalid IL or missing references) //IL_024c: Unknown result type (might be due to invalid IL or missing references) //IL_0251: Unknown result type (might be due to invalid IL or missing references) //IL_025f: Unknown result type (might be due to invalid IL or missing references) //IL_0264: Unknown result type (might be due to invalid IL or missing references) //IL_0265: Unknown result type (might be due to invalid IL or missing references) //IL_0266: Unknown result type (might be due to invalid IL or missing references) //IL_026b: Unknown result type (might be due to invalid IL or missing references) //IL_026c: Unknown result type (might be due to invalid IL or missing references) //IL_028f: Unknown result type (might be due to invalid IL or missing references) //IL_0294: Unknown result type (might be due to invalid IL or missing references) info = ability.GetPlayerInfo(); player = PlayerHandler.Get().GetPlayer(info.playerId); physics.SyncPhysicsTo(info); normalRadius = physics.radius / player.Scale; physics.radius = (Fix)1.55m * player.Scale; if (physics.IsGrounded()) { body.position = physics.getAttachedGround().PositionFromLocalPlayerPos(physics.LocalPlatformPos, physics.radius); } ((Component)this).GetComponent<FixTransform>().offset = Vec2.zero; ((Component)this).GetComponent<DPhysicsBox>().SetExtents(new Vec2((Fix)1.25m, (Fix)1.55m) * player.Scale); ((Component)this).GetComponent<DPhysicsBox>().UpdatePhysicsPositions(); body.rotation = Fix.Zero; ((Renderer)rootRenderer).enabled = false; ((Renderer)visual).sharedMaterial = info.playerMaterial; coloredBody = MirrorPalette.ForPlayer(info.playerMaterial, IntactSprite, BrokenSprite); visual.sprite = info.EntrySprite; ((Renderer)face).sharedMaterial = info.playerMaterial; ((Renderer)face).enabled = false; faceAnimator.beginAnimation(FaceAnimations.GetAnimation("WidthLoop")); Transform transform = ((Component)face).transform; Vector3 one = Vector3.one; Bounds bounds = face.sprite.bounds; transform.localScale = one * (3f / ((Bounds)(ref bounds)).size.x); direction = ((info.forwardsVector == Vec2.zero) ? Vec2.right : Vec2.NormalizedSafe(info.forwardsVector)); cycle = new MirrorCycle(); transition = Fix.Zero; exiting = false; beamContactRemaining = (beamAimElapsed = Fix.Zero); if (!info.isGrounded) { physics.gravity_modifier = (Fix)0.15m; } if (!Active.Contains(this)) { Active.Add(this); } AudioManager.Get().Play("magnetEnter"); } public override void UpdateSim(Fix simDeltaTime) { //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_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_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_002c: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: 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_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_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_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_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_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_004e: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_0079: 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_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_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_01b8: Unknown result type (might be due to invalid IL or missing references) //IL_01bd: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_018a: Unknown result type (might be due to invalid IL or missing references) //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_019a: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_01f8: 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_01d0: Unknown result type (might be due to invalid IL or missing references) //IL_01d5: Unknown result type (might be due to invalid IL or missing references) //IL_01d6: Unknown result type (might be due to invalid IL or missing references) //IL_01db: Unknown result type (might be due to invalid IL or missing references) //IL_01e0: Unknown result type (might be due to invalid IL or missing references) //IL_01e7: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_01af: Unknown result type (might be due to invalid IL or missing references) //IL_0288: Unknown result type (might be due to invalid IL or missing references) //IL_0298: Unknown result type (might be due to invalid IL or missing references) //IL_02b7: Unknown result type (might be due to invalid IL or missing references) //IL_02fa: Unknown result type (might be due to invalid IL or missing references) //IL_0301: Unknown result type (might be due to invalid IL or missing references) //IL_0306: Unknown result type (might be due to invalid IL or missing references) //IL_033f: Unknown result type (might be due to invalid IL or missing references) Fix val = GameTime.FixedDeltaTime(info.playerId, simDeltaTime); if (val <= Fix.Zero) { return; } Vec2 val2 = player.AimVector(); if (Vec2.Magnitude(val2) > Constants.DEADZONE) { val2 = Vec2.NormalizedSafe(val2); direction = (SteeringBeam ? Vec2.ApproachNormalizedVector(direction, val2, BeamAimStep * BeamAimCurve.Evaluate(beamAimElapsed)) : val2); } if (SteeringBeam) { beamAimElapsed += simDeltaTime; } else { beamAimElapsed = Fix.Zero; } beamContactRemaining = Fix.Max(Fix.Zero, beamContactRemaining - val); if (physics.IsGrounded()) { physics.Move(Vec2.zero, simDeltaTime, true); physics.DropPlatformTest(); } else { physics.AddGravityFactor(); physics.VelocityBasedRaycasts(true, simDeltaTime); } body.up = new Vec2(-direction.y, direction.x); ((Component)this).GetComponent<DPhysicsBox>().UpdatePhysicsPositions(); if (!exiting && !player.AbilityButtonIsDown(info.AbilityButtonUsedIndex012)) { exiting = true; transition = TransitionTime; } if (exiting) { transition -= val; AnimateTransform(transition); if (transition <= Fix.Zero) { ExitAbility(default(AbilityExitInfo)); } return; } if (transition < TransitionTime) { transition = Fix.Min(TransitionTime, transition + val); AnimateTransform(transition); return; } if (cycle.Advance(val)) { AudioManager.Get().Play(cycle.Broken ? "magnetPause" : "magnetEnter"); faceAnimator.beginAnimation(FaceAnimations.GetAnimation(cycle.Broken ? "ToExit" : "WidthLoop")); } visual.sprite = coloredBody[cycle.Broken ? 1 : 0]; float num = ((!cycle.Broken && cycle.Elapsed > (Fix)2.5m) ? 0.06f : 0f); float num2 = Mathf.Sin((float)cycle.Elapsed * 7f) * 0.025f; float num3 = (cycle.Broken ? (0.94f + 0.06f * (float)(cycle.Elapsed / (Fix)2L)) : (1f + num2)); ((Component)visual).transform.localScale = new Vector3(num3 + ((Updater.SimulationTicks % 4 < 2) ? num : (0f - num)), 2f - num3, 1f); } private void AnimateTransform(Fix elapsed) { //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_0006: 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) float num = Mathf.Clamp01((float)(elapsed / TransitionTime)); visual.sprite = ((num < 0.5f) ? info.EntrySprite : coloredBody[Broken ? 1 : 0]); ((Renderer)visual).sharedMaterial = ((num < 0.5f) ? info.playerMaterial : MirrorPalette.Material); ((Renderer)face).enabled = num >= 0.5f; float num2 = Mathf.Abs(num * 2f - 1f); ((Component)visual).transform.localScale = new Vector3(0.25f + 0.75f * num2, 1.25f - 0.25f * num2, 1f); } private void LateUpdate() { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0035: 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) if (!((Object)(object)visual == (Object)null) && !((Object)(object)rootRenderer == (Object)null)) { SpriteRenderer obj = visual; Color color = (face.color = rootRenderer.color); obj.color = color; } } private void OnEnable() { if (cycle != null && !((MonoUpdatable)this).IsDestroyed && !Active.Contains(this)) { Active.Add(this); } } private void OnDisable() { Active.Remove(this); } public void ExitAbility(AbilityExitInfo exitInfo) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_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_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_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_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: 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_010e: 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_011e: Unknown result type (might be due to invalid IL or missing references) Active.Remove(this); body.rotation = Fix.Zero; physics.UnGround(true, false); physics.gravity_modifier = Fix.One; physics.radius = normalRadius * player.Scale; exitInfo.groundedSpeed = physics.groundedSpeed; exitInfo.isGrounded = physics.IsGrounded(); exitInfo.isFacingRight = direction.x >= Fix.Zero; exitInfo.position = body.position; exitInfo.selfImposedVelocity = body.selfImposedVelocity; exitInfo.externalVelocity = body.externalVelocity; exitInfo.currentlyAttachedGround = physics.getAttachedGround(); exitInfo.lastSprite = info.EntrySprite; exitInfo.groundedLocalPosition = physics.LocalPlatformPos; exitInfo.radius = physics.radius; ((AbilityMonoBehaviour)ability).ExitAbility(exitInfo); } } internal static class MirrorBeams { private struct Cap { internal Vec2 Origin; internal Vec2 Direction; internal Fix Distance; } private struct ProtectedHit { internal int BeamId; internal int PlayerId; } [HarmonyPatch(typeof(PlayerCollision), "KillPlayerOnCollision")] private static class ReflectedBeamContact { private static bool Prefix(PlayerCollision __instance, CollisionInformation collision, ref bool __result) { if ((protectedHits.Count == 0 && previousProtectedHits.Count == 0) || (Object)(object)collision.colliderPP.fixTrans == (Object)null) { return true; } BeamObject component = ((Component)collision.colliderPP.fixTrans).GetComponent<BeamObject>(); if ((Object)(object)component == (Object)null) { return true; } int playerId = __instance.GetPlayerId(); foreach (ProtectedHit protectedHit in protectedHits) { if (protectedHit.BeamId == component.beamId && protectedHit.PlayerId == playerId) { __result = false; return false; } } if (!((Component)component).gameObject.activeInHierarchy) { foreach (ProtectedHit previousProtectedHit in previousProtectedHits) { if (previousProtectedHit.BeamId == component.beamId && previousProtectedHit.PlayerId == playerId) { __result = false; return false; } } } return true; } } [HarmonyPatch(typeof(BeamObject), "SetDimensions")] private static class ExactMirrorEnd { private static void Prefix(BeamObject __instance, int beamId, out Fix __state) { //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_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) __state = __instance.extraLength; if (caps.ContainsKey(beamId)) { __instance.extraLength = Fix.Zero; } } private static void Postfix(BeamObject __instance, Fix __state) { //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) __instance.extraLength = __state; } } [HarmonyPatch(typeof(DetPhysics), "UpdateBeams")] private static class Split { private static void Prefix(DetPhysics __instance, ref int ___beamsThisFrame, LayerMask ___beamHitMask, Fix ___maxBeamDistance) { //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_009f: 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_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: 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_0110: 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_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Invalid comparison between Unknown and I4 //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Unknown result type (might be due to invalid IL or missing references) //IL_0186: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Unknown result type (might be due to invalid IL or missing references) //IL_0191: Unknown result type (might be due to invalid IL or missing references) //IL_0198: Unknown result type (might be due to invalid IL or missing references) //IL_019d: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: Unknown result type (might be due to invalid IL or missing references) //IL_01b9: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_01d0: Unknown result type (might be due to invalid IL or missing references) //IL_01d5: Unknown result type (might be due to invalid IL or missing references) //IL_01da: Unknown result type (might be due to invalid IL or missing references) //IL_01ed: 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_029c: Unknown result type (might be due to invalid IL or missing references) //IL_02a5: Unknown result type (might be due to invalid IL or missing references) //IL_02aa: Unknown result type (might be due to invalid IL or missing references) //IL_02b1: Unknown result type (might be due to invalid IL or missing references) //IL_02b3: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_016d: 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) //IL_01fe: Unknown result type (might be due to invalid IL or missing references) //IL_0205: Unknown result type (might be due to invalid IL or missing references) //IL_020a: Unknown result type (might be due to invalid IL or missing references) //IL_020c: Unknown result type (might be due to invalid IL or missing references) //IL_0211: Unknown result type (might be due to invalid IL or missing references) //IL_0216: Unknown result type (might be due to invalid IL or missing references) //IL_0221: Unknown result type (might be due to invalid IL or missing references) //IL_022d: Unknown result type (might be due to invalid IL or missing references) //IL_0232: Unknown result type (might be due to invalid IL or missing references) //IL_023d: Unknown result type (might be due to invalid IL or missing references) //IL_023f: Unknown result type (might be due to invalid IL or missing references) //IL_0241: Unknown result type (might be due to invalid IL or missing references) //IL_0242: Unknown result type (might be due to invalid IL or missing references) //IL_0243: Unknown result type (might be due to invalid IL or missing references) //IL_0248: Unknown result type (might be due to invalid IL or missing references) //IL_024a: Unknown result type (might be due to invalid IL or missing references) //IL_0300: Unknown result type (might be due to invalid IL or missing references) //IL_0302: Unknown result type (might be due to invalid IL or missing references) //IL_0256: 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_025e: Unknown result type (might be due to invalid IL or missing references) //IL_0253: Unknown result type (might be due to invalid IL or missing references) //IL_0263: Unknown result type (might be due to invalid IL or missing references) //IL_0265: 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_0269: Unknown result type (might be due to invalid IL or missing references) //IL_026b: Unknown result type (might be due to invalid IL or missing references) //IL_027b: Unknown result type (might be due to invalid IL or missing references) //IL_027d: Unknown result type (might be due to invalid IL or missing references) //IL_0357: Unknown result type (might be due to invalid IL or missing references) //IL_0320: Unknown result type (might be due to invalid IL or missing references) //IL_0327: 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_032e: 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_0338: Unknown result type (might be due to invalid IL or missing references) //IL_0344: Unknown result type (might be due to invalid IL or missing references) //IL_0349: Unknown result type (might be due to invalid IL or missing references) //IL_034e: Unknown result type (might be due to invalid IL or missing references) //IL_035c: 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_0365: 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) caps.Clear(); List<ProtectedHit> previousProtectedHits = MirrorBeams.previousProtectedHits; MirrorBeams.previousProtectedHits = protectedHits; protectedHits = previousProtectedHits; protectedHits.Clear(); if (MirrorAbility.Active.Count == 0) { return; } int num = ___beamsThisFrame; Vec2 aimDirection = default(Vec2); for (int i = 0; i < num; i++) { BeamBody val = __instance.beamBodies[i]; Fix halfWidth = __instance.beamWidth * val.scale * __instance.beamObjectPrefab.baseWidth01 * __instance.beamWidthAnim.Evaluate(val.timePassed); int num2 = i; MirrorAbility previous = null; for (int j = 0; j < 4; j++) { RaycastInformation val2 = __instance.RaycastToClosest(val.position, val.direction, ___maxBeamDistance, ___beamHitMask); Fix val3 = (RaycastInformation.op_Implicit(val2) ? Fix.Min(___maxBeamDistance, val2.nearDist) : ___maxBeamDistance); if ((Object)(object)val2.pp.fixTrans != (Object)null && (Object)(object)((Component)val2.pp.fixTrans).GetComponent<MirrorAbility>() != (Object)null) { val3 = Fix.Min(___maxBeamDistance, val3 + MirrorMath.Epsilon); } Fix val4 = ___maxBeamDistance; if ((int)Constants.leveltype != 2 && val.direction.y < -MirrorMath.Epsilon && val.position.y > Constants.WATER_HEIGHT) { val4 = (Constants.WATER_HEIGHT - val.position.y) / val.direction.y; } bool flag = val4 < val3; val3 = Fix.Min(val3, val4); MirrorAbility mirror; Fix distance; bool flag2 = MirrorHits.Find(val.position, val.direction, val3, halfWidth, previous, out mirror, out distance); if (flag2) { aimDirection = mirror.AimDirection; mirror.ReceiveBeam(); } else { if (!flag || Vec2.Dot(val.direction, Vec2.down) >= (Fix)0.997m) { break; } Vec2 val5 = val.position + val.direction * val4; ((Vec2)(ref aimDirection))..ctor(val.direction.x, -val.direction.y); RaycastInformation val6 = __instance.RaycastToClosest(val5, aimDirection, ___maxBeamDistance, ___beamHitMask); Fix maxDistance = (RaycastInformation.op_Implicit(val6) ? Fix.Min(___maxBeamDistance, val6.nearDist) : ___maxBeamDistance); if (!MirrorHits.Find(val5, aimDirection, maxDistance, halfWidth, out mirror, out var _)) { break; } distance = val4; } caps[val.id] = new Cap { Origin = val.position, Direction = val.direction, Distance = distance }; if (flag2) { protectedHits.Add(new ProtectedHit { BeamId = val.id, PlayerId = mirror.PlayerId }); } __instance.beamBodies[num2].distance = distance; if (___beamsThisFrame >= 32 || j == 3) { break; } val.position = (flag2 ? mirror.OutgoingOrigin : (val.position + val.direction * distance + aimDirection * (Fix)0.1m)); val.direction = aimDirection; previous = (flag2 ? mirror : null); val.ground = null; val.id = 1000000000 + i * 8 + j; if (flag2) { protectedHits.Add(new ProtectedHit { BeamId = val.id, PlayerId = mirror.PlayerId }); } num2 = __instance.AddBeamBody(val); } } } } [HarmonyPatch(typeof(DetPhysics), "RaycastBeam", new Type[] { typeof(int) })] private static class StopAtMirror { private static void Postfix(DetPhysics __instance, int ind, bool[] ___beamIsReflected, Fix[] ___beamReflectionDistance, FixTransform[] ___beamRaycastHitRRs) { //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_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_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_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) BeamBody val = __instance.beamBodies[ind]; if (caps.TryGetValue(val.id, out var value) && !(val.position != value.Origin) && !(val.direction != value.Direction)) { __instance.beamBodies[ind].distance = Fix.Min(val.distance, value.Distance); ___beamIsReflected[ind] = false; ref Fix reference = ref ___beamReflectionDistance[ind]; reference = Fix.Zero; ___beamRaycastHitRRs[ind] = null; } } } private static readonly Dictionary<int, Cap> caps = new Dictionary<int, Cap>(); private static List<ProtectedHit> protectedHits = new List<ProtectedHit>(); private static List<ProtectedHit> previousProtectedHits = new List<ProtectedHit>(); } public static class MirrorMath { public static readonly Fix Epsilon = (Fix)0.02m; public static bool HitBody(Vec2 origin, Vec2 direction, Vec2 center, Vec2 right, Vec2 extents, Fix maxDistance, Fix halfWidth, out Fix distance) { //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_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_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_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_0043: 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_0050: 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_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006e: 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_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007c: 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_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_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_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_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_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: 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_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_010d: 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_011a: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) distance = Fix.Zero; if (direction == Vec2.zero || maxDistance < Fix.Zero) { return false; } Vec2 val = default(Vec2); ((Vec2)(ref val))..ctor(-right.y, right.x); Vec2 val2 = right * extents.x; Vec2 val3 = val * extents.y; Vec2 val4 = center - origin; Vec2 val5 = Project(val4 + val2 + val3, direction); Vec2 val6 = Project(val4 + val2 - val3, direction); Vec2 val7 = Project(val4 - val2 - val3, direction); Vec2 val8 = Project(val4 - val2 + val3, direction); Fix near = Fix.MaxValue; Fix far = -Fix.MaxValue; halfWidth = Fix.Max(Fix.Zero, halfWidth); ClipEdge(val5, val6, halfWidth, ref near, ref far); ClipEdge(val6, val7, halfWidth, ref near, ref far); ClipEdge(val7, val8, halfWidth, ref near, ref far); ClipEdge(val8, val5, halfWidth, ref near, ref far); if (far < Fix.Zero || near > maxDistance) { return false; } distance = Fix.Max(Fix.Zero, near); return true; } private static Vec2 Project(Vec2 point, Vec2 direction) { //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_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: 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) return new Vec2(Vec2.Dot(point, direction), Vec2.Dot(point, new Vec2(-direction.y, direction.x))); } private static void ClipEdge(Vec2 a, Vec2 b, Fix width, ref Fix near, ref Fix far) { //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_000c: 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_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_004d: 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_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0085: 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_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_00c7: Unknown result type (might be due to invalid IL or missing references) if (Fix.Abs(a.y) <= width) { Include(a.x, ref near, ref far); } if (a.y == b.y) { return; } for (int i = 0; i < 2; i++) { Fix val = ((i == 0) ? (-width) : width); if (!(val < Fix.Min(a.y, b.y)) && !(val > Fix.Max(a.y, b.y))) { Include(a.x + (b.x - a.x) * (val - a.y) / (b.y - a.y), ref near, ref far); } } } private static void Include(Fix value, ref Fix near, ref Fix far) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) near = Fix.Min(near, value); far = Fix.Max(far, value); } public static Vec2 ExitPoint(Vec2 center, Vec2 right, Vec2 extents, Vec2 aim) { //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_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0046: 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_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_005d: 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_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_0088: 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_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) if (aim == Vec2.zero) { return center; } Fix val = Fix.Abs(Vec2.Dot(aim, right)); Fix val2 = Fix.Abs(Vec2.Dot(aim, new Vec2(-right.y, right.x))); Fix val3 = Fix.MaxValue; if (val > (Fix)0.000001m) { val3 = Fix.Min(val3, extents.x / val); } if (val2 > (Fix)0.000001m) { val3 = Fix.Min(val3, extents.y / val2); } return center + aim * (val3 + Epsilon); } } public sealed class MirrorCycle { public bool Broken { get; private set; } public Fix Elapsed { get; private set; } public bool Advance(Fix delta) { //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_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0017: 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_002b: 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_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_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) if (delta <= Fix.Zero) { return false; } Elapsed += delta; Fix val = (Broken ? ((Fix)2L) : ((Fix)3L)); if (Elapsed < val) { return false; } Elapsed -= val; Broken = !Broken; return true; } } internal static class MirrorPalette { private static readonly Dictionary<Material, Sprite[]> cache = new Dictionary<Material, Sprite[]>(); internal static Material Material; internal static Sprite[] ForPlayer(Material player, Sprite intact, Sprite broken) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Expected O, but got Unknown //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_0048: 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) if ((Object)(object)Material == (Object)null) { Material = new Material(Shader.Find("Sprites/Default")); } if (cache.TryGetValue(player, out var value)) { return value; } Color color = player.GetColor("_MainColor"); value = (Sprite[])(object)new Sprite[2] { Recolor(intact, color), Recolor(broken, color) }; cache.Add(player, value); return value; } private static Sprite Recolor(Sprite source, Color tint) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Expected O, but got Unknown //IL_00dc: 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_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) Color32[] pixels = source.texture.GetPixels32(); for (int i = 0; i < pixels.Length; i++) { Color32 val = pixels[i]; if (val.g > val.r + 100 && val.g > val.b + 100) { float num = (float)(int)val.g / 255f; ref Color32 reference = ref pixels[i]; reference = Color32.op_Implicit(new Color(tint.r * num, tint.g * num, tint.b * num, (float)(int)val.a / 255f)); } } Texture2D val2 = new Texture2D(((Texture)source.texture).width, ((Texture)source.texture).height, (TextureFormat)4, false); val2.SetPixels32(pixels); val2.Apply(false, true); ((Texture)val2).filterMode = (FilterMode)1; return Sprite.Create(val2, source.rect, new Vector2(0.5f, 0.5f), source.pixelsPerUnit); } } internal static class MirrorHits { internal static bool Find(Vec2 origin, Vec2 direction, Fix maxDistance, out MirrorAbility mirror, out Fix distance) { //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_0003: Unknown result type (might be due to invalid IL or missing references) return Find(origin, direction, maxDistance, Fix.Zero, out mirror, out distance); } internal static bool Find(Vec2 origin, Vec2 direction, Fix maxDistance, Fix halfWidth, out MirrorAbility mirror, out Fix distance) { //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_0003: Unknown result type (might be due to invalid IL or missing references) return Find(origin, direction, maxDistance, halfWidth, null, out mirror, out distance); } internal static bool Find(Vec2 origin, Vec2 direction, Fix maxDistance, Fix halfWidth, MirrorAbility previous, out MirrorAbility mirror, out Fix distance) { //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_004c: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_004f: 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_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_0067: 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) mirror = null; distance = maxDistance; foreach (MirrorAbility item in MirrorAbility.Active) { if (!((Object)(object)item == (Object)null) && !((Object)(object)item == (Object)(object)previous) && !((MonoUpdatable)item).IsDestroyed && ((Behaviour)item).isActiveAndEnabled && item.Reflecting && MirrorMath.HitBody(origin, direction, item.Center, item.BodyRight, item.BodyExtents, distance, halfWidth, out var distance2))