Decompiled source of PRT v1.0.2
PRTCards.dll
Decompiled 2 weeks ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using BepInEx; using CardChoiceSpawnUniqueCardPatch.CustomCategories; using ClassesManagerReborn; using HarmonyLib; using InControl; using Jotunn.Utils; using PRT; using PRT.Cards; using PRT.Core; using PRT.Objects.Laser; using PRT.Objects.TNT; using PRT.Objects.Train; using PRT.UI; using Photon.Pun; using RarityLib.Utils; using SoundImplementation; using UnboundLib; using UnboundLib.Cards; using UnityEngine; using UnityEngine.Audio; using UnityEngine.SceneManagement; using WWMO.MonoBehaviours; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("PRTCards")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+bc907c1f3a9bb34f0756e66b1cf8220ed9fd6dba")] [assembly: AssemblyProduct("PRTCards")] [assembly: AssemblyTitle("PRTCards")] [assembly: AssemblyVersion("1.0.0.0")] public class BlockSpawnerEffects : MonoBehaviour { public float blockSpeed = 200f; public float blockScale = 2f; public float wagons = 0f; public bool GodOfTrains = false; public bool lava = false; public bool boomerang = false; public bool DoubleTrain = false; public int numberOfTNTs = 10; public float timeOfExplosion = 3f; public float TNTscale = 1f; public int numberofgodtrains = 8; public float degreegodtrains = 45f; public bool LaserDoDmg = false; } public class GunAdditionalData { public bool canShoot = true; } public static class GunExtension { private static readonly ConditionalWeakTable<Gun, GunAdditionalData> data = new ConditionalWeakTable<Gun, GunAdditionalData>(); public static GunAdditionalData GetAdditionalData(this Gun gun) { return data.GetOrCreateValue(gun); } } public class ParticleAutoRenderer : MonoBehaviour { private static AssetBundle bundle; private void Awake() { bundle = Assets.Bundle; Material maskMaterial = bundle.LoadAsset<Material>("Mat_MeshMaskWrite"); ApplyToAllExisting(maskMaterial); } private void OnEnable() { ParticleSystemCreationWatcher.OnParticleSystemCreated += OnParticleSystemCreated; } private void OnDisable() { ParticleSystemCreationWatcher.OnParticleSystemCreated -= OnParticleSystemCreated; } private void ApplyToAllExisting(Material maskMaterial) { ParticleSystem[] array = Object.FindObjectsOfType<ParticleSystem>(); ParticleSystem[] array2 = array; foreach (ParticleSystem original in array2) { DuplicateRenderer(original, maskMaterial); } } private void OnParticleSystemCreated(ParticleSystem ps) { Material maskMaterial = bundle.LoadAsset<Material>("Mat_MeshMaskWrite"); DuplicateRenderer(ps, maskMaterial); } private void DuplicateRenderer(ParticleSystem original, Material maskMaterial) { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Expected O, but got Unknown //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0062: 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_010d: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)original == (Object)null)) { GameObject val = new GameObject(((Object)original).name + "_Mask"); val.transform.SetParent(((Component)original).transform, false); val.transform.localPosition = Vector3.zero; val.transform.localRotation = Quaternion.identity; val.transform.localScale = Vector3.one; ParticleSystemRenderer val2 = val.AddComponent<ParticleSystemRenderer>(); ParticleSystemRenderer component = ((Component)original).GetComponent<ParticleSystemRenderer>(); if ((Object)(object)component != (Object)null) { val2.renderMode = component.renderMode; val2.mesh = component.mesh; ((Renderer)val2).sortingLayerID = ((Renderer)component).sortingLayerID; ((Renderer)val2).sortingOrder = ((Renderer)component).sortingOrder + 1; ((Renderer)val2).material = maskMaterial; val2.trailMaterial = component.trailMaterial; val2.normalDirection = component.normalDirection; val2.cameraVelocityScale = component.cameraVelocityScale; val2.velocityScale = component.velocityScale; val2.lengthScale = component.lengthScale; val2.alignment = component.alignment; } } } } [DefaultExecutionOrder(-1000)] public class ParticleSystemCreationWatcher : MonoBehaviour { public static event Action<ParticleSystem> OnParticleSystemCreated; private void Awake() { ParticleSystem[] array = Object.FindObjectsOfType<ParticleSystem>(); ParticleSystem[] array2 = array; foreach (ParticleSystem ps in array2) { Notify(ps); } } private void OnTransformChildrenChanged() { ParticleSystem[] componentsInChildren = ((Component)this).GetComponentsInChildren<ParticleSystem>(); ParticleSystem[] array = componentsInChildren; foreach (ParticleSystem ps in array) { Notify(ps); } } private void Notify(ParticleSystem ps) { ParticleSystemCreationWatcher.OnParticleSystemCreated?.Invoke(ps); } } [HarmonyPatch(typeof(WaterMono), "HandleBox")] [HarmonyPatch(new Type[] { typeof(Rigidbody2D) })] public class PatchWaterMono_HandleBox { private static bool Prefix(Rigidbody2D rb) { if (((Object)((Component)rb).gameObject).name.Contains("IgnoreWater")) { return false; } return true; } } [HarmonyPatch(typeof(BoxTouchingLava_Mono), "FixedUpdate")] public class Patch_BoxTouchingLava { private static bool Prefix(BoxTouchingLava_Mono __instance) { //IL_0082: 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_0092: 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_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: 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_0117: Unknown result type (might be due to invalid IL or missing references) if (!((Object)((Component)__instance).gameObject).name.Contains("IgnoreWater") && !((Object)((Component)__instance).gameObject).name.Contains("IgnoreLava")) { return true; } if (((Object)((Component)__instance).gameObject).name.Contains("IgnoreLava")) { return false; } Collider2D component = ((Component)__instance).GetComponent<Collider2D>(); if ((Object)(object)component == (Object)null) { return false; } ContactFilter2D val = default(ContactFilter2D); val.useTriggers = false; ContactFilter2D val2 = val; Collider2D[] array = (Collider2D[])(object)new Collider2D[10]; int num = component.OverlapCollider(val2, array); for (int i = 0; i < num; i++) { Collider2D obj = array[i]; Player val3 = ((obj != null) ? ((Component)obj).GetComponent<Player>() : null); if ((Object)(object)val3 != (Object)null) { val3.data.healthHandler.TakeDamageOverTime(Vector2.up * 0.25f * __instance.heatPercent, Vector2.zero, 5f, 0.1f, new Color(1f, 0f, 0f, 0.7f), (GameObject)null, (Player)null, true); } } return false; } } [HarmonyPatch(typeof(LavaMono), "HandlePlayer")] [HarmonyPatch(new Type[] { typeof(Player) })] public class Patch_LavaMono_HandlePlayer { private static bool Prefix(LavaMono __instance, Player player) { //IL_000e: 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_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) HealthHandler healthHandler = player.data.healthHandler; ((Damagable)healthHandler).TakeDamage(Vector2.up * 0.65f, Vector2.op_Implicit(((Component)player).transform.position), (GameObject)null, (Player)null, true, false); FieldInfo field = typeof(HealthHandler).GetField("activeDoTs", BindingFlags.Instance | BindingFlags.NonPublic); IList list = (IList)field.GetValue(healthHandler); while (list.Count > 1) { list.RemoveAt(0); } if (list.Count >= 1) { return false; } healthHandler.TakeDamageOverTime(Vector2.up * 0.65f, Vector2.zero, 2.5f, 1f, new Color(1f, 0f, 0f, 0.7f), (GameObject)null, (Player)null, true); return false; } } [HarmonyPatch(typeof(LegRaycasters), "HitGround")] public class Patch_LegRaycasters_NoTrainOwnerGround { private static bool Prefix(LegRaycasters __instance, RaycastHit2D hit) { object? value = AccessTools.Field(typeof(LegRaycasters), "data").GetValue(__instance); CharacterData val = (CharacterData)((value is CharacterData) ? value : null); if ((Object)(object)val == (Object)null) { return true; } if (!Object.op_Implicit((Object)(object)((RaycastHit2D)(ref hit)).transform)) { return true; } TrainOwner componentInParent = ((Component)((RaycastHit2D)(ref hit)).transform).GetComponentInParent<TrainOwner>(); if ((Object)(object)componentInParent != (Object)null && (Object)(object)componentInParent.owner == (Object)(object)val.player) { return false; } return true; } } [HarmonyPatch(typeof(MapObjet_Rope))] [HarmonyPatch("Update")] internal class MapObjetRope_Update_Patch { private static Dictionary<MapObjet_Rope, bool> originallyTwoPointsMap = new Dictionary<MapObjet_Rope, bool>(); private static bool Prefix(MapObjet_Rope __instance) { if ((Object)(object)__instance == (Object)null) { return true; } Type typeFromHandle = typeof(MapObjet_Rope); FieldInfo field = typeFromHandle.GetField("joint", BindingFlags.Instance | BindingFlags.NonPublic); FieldInfo field2 = typeFromHandle.GetField("lineRenderer", BindingFlags.Instance | BindingFlags.NonPublic); object? obj = field?.GetValue(__instance); AnchoredJoint2D val = (AnchoredJoint2D)((obj is AnchoredJoint2D) ? obj : null); object? obj2 = field2?.GetValue(__instance); LineRenderer val2 = (LineRenderer)((obj2 is LineRenderer) ? obj2 : null); if ((Object)(object)val == (Object)null || (Object)(object)val2 == (Object)null) { return true; } if (!originallyTwoPointsMap.ContainsKey(__instance)) { bool value = (Object)(object)((Joint2D)val).attachedRigidbody != (Object)null && (Object)(object)((Joint2D)val).connectedBody != (Object)null; originallyTwoPointsMap[__instance] = value; } if (originallyTwoPointsMap[__instance]) { bool flag = (Object)(object)((Joint2D)val).attachedRigidbody == (Object)null || !((Component)((Joint2D)val).attachedRigidbody).gameObject.activeInHierarchy; bool flag2 = (Object)(object)((Joint2D)val).connectedBody == (Object)null || !((Component)((Joint2D)val).connectedBody).gameObject.activeInHierarchy; if ((flag || flag2) && ((Renderer)val2).enabled) { ((Renderer)val2).enabled = false; } } return true; } } [HarmonyPatch(typeof(PlayerCollision), "FixedUpdate")] public class Patch_PlayerCollision_NoTrainOwnerCollision { private static bool Prefix(PlayerCollision __instance) { //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_007e: 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_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) object? value = AccessTools.Field(typeof(PlayerCollision), "data").GetValue(__instance); CharacterData val = (CharacterData)((value is CharacterData) ? value : null); if ((Object)(object)val == (Object)null) { return true; } Vector2 val2 = (Vector2)AccessTools.Field(typeof(PlayerCollision), "lastPos").GetValue(__instance); CircleCollider2D component = ((Component)__instance).GetComponent<CircleCollider2D>(); if ((Object)(object)component == (Object)null) { return true; } float num = component.radius * ((Component)__instance).transform.localScale.x; LayerMask val3 = (LayerMask)AccessTools.Field(typeof(PlayerCollision), "mask").GetValue(__instance); Vector2 val4 = Vector2.op_Implicit(((Component)__instance).transform.position) - val2; float magnitude = ((Vector2)(ref val4)).magnitude; if (magnitude <= 0.0001f) { return true; } RaycastHit2D[] array = Physics2D.CircleCastAll(val2, num, val4, magnitude, LayerMask.op_Implicit(val3)); RaycastHit2D[] array2 = array; for (int i = 0; i < array2.Length; i++) { RaycastHit2D val5 = array2[i]; if (Object.op_Implicit((Object)(object)((RaycastHit2D)(ref val5)).transform)) { TrainOwner componentInParent = ((Component)((RaycastHit2D)(ref val5)).transform).GetComponentInParent<TrainOwner>(); if ((Object)(object)componentInParent != (Object)null && (Object)(object)componentInParent.owner == (Object)(object)val.player) { return false; } } } return true; } } [HarmonyPatch(typeof(Map), "MapMoveOut")] internal class Patch_Map_MapMoveOut { private static void Prefix() { GameObject[] array = Object.FindObjectsOfType<GameObject>(); foreach (GameObject val in array) { if (((Object)val).name.Contains("Piece")) { Object.Destroy((Object)(object)val); } } } } public class DestroyPieceOutOfCamera : MonoBehaviour { private Camera cam; private float zDist; private void Start() { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) cam = Camera.main; zDist = Mathf.Abs(((Component)this).transform.position.z - ((Component)cam).transform.position.z); } private void Update() { //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_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_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: 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_005c: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)cam == (Object)null)) { Vector3 val = cam.WorldToViewportPoint(((Component)this).transform.position); Vector3 val2 = cam.ViewportToWorldPoint(new Vector3(val.x, 0f, zDist)); if (((Component)this).transform.position.y < val2.y - 20f) { Object.Destroy((Object)(object)((Component)this).gameObject); } } } } public class ExplosionPool : MonoBehaviour { public static ExplosionPool Instance; public GameObject effectPrefab; public List<GameObject> pool = new List<GameObject>(); public int poolSize = 40; private GameObject container; private void Awake() { //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Expected O, but got Unknown if ((Object)(object)Instance == (Object)null) { Instance = this; Object.DontDestroyOnLoad((Object)(object)((Component)this).gameObject); AssetBundle bundle = Assets.Bundle; if ((Object)(object)effectPrefab == (Object)null && (Object)(object)bundle != (Object)null) { effectPrefab = bundle.LoadAsset<GameObject>("explosion"); } if ((Object)(object)effectPrefab == (Object)null) { object? obj = typeof(TNTSpawner).GetField("bundle", BindingFlags.Static | BindingFlags.NonPublic)?.GetValue(null); AssetBundle val = (AssetBundle)((obj is AssetBundle) ? obj : null); if ((Object)(object)val != (Object)null) { effectPrefab = val.LoadAsset<GameObject>("explosion"); } } container = new GameObject("ExplosionsContainer"); container.transform.SetParent(((Component)this).transform); if ((Object)(object)effectPrefab != (Object)null) { for (int i = 0; i < poolSize; i++) { GameObject val2 = Object.Instantiate<GameObject>(effectPrefab); val2.SetActive(false); val2.transform.SetParent(container.transform); pool.Add(val2); } } } else { Object.Destroy((Object)(object)((Component)this).gameObject); } } public GameObject GetExplosion() { foreach (GameObject item in pool) { if (!item.activeInHierarchy) { return item; } } GameObject val = Object.Instantiate<GameObject>(effectPrefab); val.SetActive(false); val.transform.SetParent(container.transform); pool.Add(val); return val; } public void RegisterExplosion(GameObject explosion) { explosion.transform.SetParent(container.transform); pool.Add(explosion); } public void ReturnToContainer(GameObject explosion) { if ((Object)(object)container != (Object)null) { explosion.transform.SetParent(container.transform); } } } public class PieceData : MonoBehaviour { public Sprite sprite; public string OriginalLayer; public float createdTime; } public static class Cutter2DPhoton { [Serializable] public struct CutterPieceData { public Vector2[] localPoints; public Vector3 position; public Quaternion rotation; public Vector3 scale; public int layer; public Color color; public int sortingLayerID; public int sortingOrder; public bool withPhysics; public int spriteID; public float mass; public float gravityScale; } private static Dictionary<Sprite, int> spriteToID = new Dictionary<Sprite, int>(); private static Dictionary<int, Sprite> idToSprite = new Dictionary<int, Sprite>(); private static int nextID = 0; public static int GetSpriteID(Sprite sprite) { if ((Object)(object)sprite == (Object)null) { return -1; } if (!spriteToID.TryGetValue(sprite, out var value)) { value = nextID++; spriteToID[sprite] = value; idToSprite[value] = sprite; } return value; } public static Sprite GetSpriteByID(int id) { if (idToSprite.TryGetValue(id, out var value)) { return value; } return null; } public static List<CutterPieceData> CutAndReturnData(GameObject original, Vector2 pointA, Vector2 pointB) { //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_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0082: 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_008c: 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_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: 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_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: 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_0272: Unknown result type (might be due to invalid IL or missing references) //IL_0277: Unknown result type (might be due to invalid IL or missing references) //IL_020d: Unknown result type (might be due to invalid IL or missing references) //IL_0212: Unknown result type (might be due to invalid IL or missing references) PolygonCollider2D component = original.GetComponent<PolygonCollider2D>(); if ((Object)(object)component == (Object)null) { return null; } List<Vector2> list = component.points.Select((Vector2 p) => Vector2.op_Implicit(original.transform.TransformPoint(Vector2.op_Implicit(p)))).ToList(); List<Vector2> list2 = new List<Vector2>(); List<Vector2> list3 = new List<Vector2>(); for (int i = 0; i < list.Count; i++) { Vector2 val = list[i]; Vector2 val2 = list[(i + 1) % list.Count]; bool flag = IsAbove(val, pointA, pointB); bool flag2 = IsAbove(val2, pointA, pointB); if (flag) { list2.Add(val); } else { list3.Add(val); } if (flag != flag2 && SegmentIntersect(val, val2, pointA, pointB, out var r)) { list2.Add(r); list3.Add(r); } } List<CutterPieceData> result = new List<CutterPieceData>(); Sprite finalSprite = null; Color finalColor = Color.white; int finalSortingLayer = 0; int finalSortingOrder = 0; Transform val3 = original.transform.Find("Color"); SpriteRenderer val4 = (((Object)(object)val3 != (Object)null) ? ((Component)val3).GetComponent<SpriteRenderer>() : null); if ((Object)(object)val4 != (Object)null) { finalSprite = val4.sprite; finalColor = val4.color; finalSortingLayer = ((Renderer)val4).sortingLayerID; finalSortingOrder = ((Renderer)val4).sortingOrder; } if ((Object)(object)finalSprite == (Object)null) { MeshRenderer component2 = original.GetComponent<MeshRenderer>(); if ((Object)(object)component2 != (Object)null && (Object)(object)((Renderer)component2).material != (Object)null) { PieceData component3 = original.GetComponent<PieceData>(); if ((Object)(object)component3 != (Object)null) { finalSprite = component3.sprite; } finalColor = ((Renderer)component2).material.color; finalSortingLayer = ((Renderer)component2).sortingLayerID; finalSortingOrder = ((Renderer)component2).sortingOrder; } } if ((Object)(object)finalSprite == (Object)null) { SpriteRenderer component4 = original.GetComponent<SpriteRenderer>(); if ((Object)(object)component4 != (Object)null) { finalSprite = component4.sprite; finalColor = component4.color; finalSortingLayer = ((Renderer)component4).sortingLayerID; finalSortingOrder = ((Renderer)component4).sortingOrder; } } if ((Object)(object)finalSprite == (Object)null) { PieceData component5 = original.GetComponent<PieceData>(); if ((Object)(object)component5 != (Object)null) { finalSprite = component5.sprite; } } AddPiece(list2); AddPiece(list3); return result; void AddPiece(List<Vector2> worldPts) { //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_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_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_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) if (worldPts.Count >= 3) { Vector2[] localPoints = worldPts.Select((Vector2 p) => Vector2.op_Implicit(original.transform.InverseTransformPoint(Vector2.op_Implicit(p)))).ToArray(); List<CutterPieceData> list4 = result; CutterPieceData item = new CutterPieceData { spriteID = GetSpriteID(finalSprite), localPoints = localPoints, position = original.transform.position, rotation = original.transform.rotation, scale = original.transform.localScale, layer = original.layer, color = finalColor, sortingLayerID = finalSortingLayer, sortingOrder = finalSortingOrder, withPhysics = ((Object)(object)original.GetComponent<Rigidbody2D>() != (Object)null) }; Rigidbody2D component6 = original.GetComponent<Rigidbody2D>(); item.mass = ((component6 != null) ? component6.mass : 20000f); Rigidbody2D component7 = original.GetComponent<Rigidbody2D>(); item.gravityScale = ((component7 != null) ? component7.gravityScale : 1f); list4.Add(item); } } } private static bool IsAbove(Vector2 p, Vector2 a, Vector2 b) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_001b: 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_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) return (b.x - a.x) * (p.y - a.y) - (b.y - a.y) * (p.x - a.x) > 0f; } private static bool SegmentIntersect(Vector2 p, Vector2 q, Vector2 a, Vector2 b, out Vector2 r) { //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) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_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) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001e: 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_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_004e: 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_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_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) Vector2 val = q - p; Vector2 val2 = b - a; float num = val.x * val2.y - val.y * val2.x; if (Mathf.Approximately(num, 0f)) { r = default(Vector2); return false; } float num2 = ((a - p).x * val2.y - (a - p).y * val2.x) / num; r = p + num2 * val; return num2 >= 0f && num2 <= 1f; } public static Mesh CreateMeshFromPolygon(List<Vector2> pts, Sprite sprite) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //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_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //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_01f8: Unknown result type (might be due to invalid IL or missing references) //IL_020e: 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_0226: Unknown result type (might be due to invalid IL or missing references) Mesh val = new Mesh(); Vector3[] array = pts.Select((Vector2 p) => Vector2.op_Implicit(p)).ToArray(); int[] array2 = new Triangulator(pts.ToArray()).Triangulate(); for (int i = 0; i < array2.Length; i += 3) { int num = array2[i + 1]; array2[i + 1] = array2[i + 2]; array2[i + 2] = num; } val.vertices = array; val.triangles = array2; Vector2[] array3 = (Vector2[])(object)new Vector2[pts.Count]; if ((Object)(object)sprite != (Object)null) { Rect rect = sprite.rect; Vector2 pivot = sprite.pivot; float pixelsPerUnit = sprite.pixelsPerUnit; Texture2D texture = sprite.texture; for (int j = 0; j < pts.Count; j++) { float num2 = array[j].x * pixelsPerUnit + pivot.x; float num3 = array[j].y * pixelsPerUnit + pivot.y; array3[j] = new Vector2((((Rect)(ref rect)).x + num2) / (float)((Texture)texture).width, (((Rect)(ref rect)).y + num3) / (float)((Texture)texture).height); } } else { float num4 = pts.Min((Vector2 p) => p.x); float num5 = pts.Max((Vector2 p) => p.x); float num6 = pts.Min((Vector2 p) => p.y); float num7 = pts.Max((Vector2 p) => p.y); for (int k = 0; k < pts.Count; k++) { array3[k] = new Vector2((pts[k].x - num4) / (num5 - num4), (pts[k].y - num6) / (num7 - num6)); } } val.uv = array3; val.RecalculateBounds(); val.RecalculateNormals(); return val; } } public class Triangulator { private List<Vector2> m_pts; public Triangulator(Vector2[] pts) { m_pts = new List<Vector2>(pts); } public int[] Triangulate() { List<int> list = new List<int>(); int count = m_pts.Count; int[] array = new int[count]; if (Area() > 0f) { for (int i = 0; i < count; i++) { array[i] = i; } } else { for (int j = 0; j < count; j++) { array[j] = count - 1 - j; } } int num = count; int num2 = 2 * num; int num3 = num - 1; while (num > 2 && num2-- > 0) { int num4 = ((num3 < num) ? num3 : 0); num3 = ((num4 + 1 < num) ? (num4 + 1) : 0); int num5 = ((num3 + 1 < num) ? (num3 + 1) : 0); if (Snip(num4, num3, num5, num, array)) { list.Add(array[num4]); list.Add(array[num3]); list.Add(array[num5]); int num6 = num3; for (int k = num3 + 1; k < num; k++) { array[num6] = array[k]; num6++; } num--; num2 = 2 * num; } } return list.ToArray(); } private float Area() { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_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_0039: 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_0048: 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) float num = 0f; int count = m_pts.Count; int index = count - 1; int num2 = 0; while (num2 < count) { Vector2 val = m_pts[index]; Vector2 val2 = m_pts[num2]; num += val.x * val2.y - val2.x * val.y; index = num2++; } return num * 0.5f; } private bool Snip(int u, int v, int w, int n, int[] V) { //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) //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_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_0036: 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_0043: 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_0051: 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_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_009b: 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) Vector2 val = m_pts[V[u]]; Vector2 val2 = m_pts[V[v]]; Vector2 val3 = m_pts[V[w]]; if (Mathf.Epsilon > (val2.x - val.x) * (val3.y - val.y) - (val2.y - val.y) * (val3.x - val.x)) { return false; } for (int i = 0; i < n; i++) { if (i != u && i != v && i != w && InsideTriangle(val, val2, val3, m_pts[V[i]])) { return false; } } return true; } private bool InsideTriangle(Vector2 A, Vector2 B, Vector2 C, Vector2 P) { //IL_0001: 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_000f: 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_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003f: 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_004e: 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_005e: 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_006e: 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_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0097: 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_00a7: 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) float num = C.x - B.x; float num2 = C.y - B.y; float num3 = A.x - C.x; float num4 = A.y - C.y; float num5 = B.x - A.x; float num6 = B.y - A.y; float num7 = P.x - A.x; float num8 = P.y - A.y; float num9 = P.x - B.x; float num10 = P.y - B.y; float num11 = P.x - C.x; float num12 = P.y - A.y; return num * num10 - num2 * num9 >= 0f && num3 * num12 - num4 * num11 >= 0f && num5 * num8 - num6 * num7 >= 0f; } } public class LaserCutter2D : MonoBehaviour { [Header("References")] public LineRenderer line; public LineRenderer visibleline; [Header("Hit Info")] public HitInfo currentHitInfo; [Header("Cut Settings")] public string[] cutLayerNames = new string[5] { "Default", "IgnorePlayer", "IgnoreMap", "BackgroundObject", "Player" }; [HideInInspector] public Transform Gun2; public LaserNetworkActionProxy cutterProxy; private LayerMask cutLayers; private Vector3 startPoint; private Vector3 endPoint; public bool cutting; private float laserLength = 100f; private Gun gun; private bool locked = false; private Vector3 lockeddirection; private HashSet<GameObject> alreadyRequestedThisCut = new HashSet<GameObject>(); private HashSet<Player> Playersdmg = new HashSet<Player>(); private void Start() { //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_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Expected O, but got Unknown //IL_00de: 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) cutLayers = LayerMask.op_Implicit(LayerMask.GetMask(cutLayerNames)); line = ((Component)this).GetComponent<LineRenderer>(); line.positionCount = 2; ((Renderer)line).enabled = false; ((Component)this).gameObject.tag = "Laser"; if ((Object)(object)visibleline == (Object)null) { GameObject val = new GameObject("LineSempreVisivel"); val.transform.SetParent(((Component)this).transform); visibleline = val.AddComponent<LineRenderer>(); visibleline.startWidth = 0.05f; visibleline.endWidth = 0.05f; ((Renderer)visibleline).material = ((Renderer)line).material; visibleline.startColor = new Color(1f, 1f, 1f, 0.3f); visibleline.endColor = new Color(1f, 1f, 1f, 0.3f); visibleline.positionCount = 2; ((Renderer)visibleline).enabled = false; } gun = ((Component)this).GetComponentInParent<Gun>(); if ((Object)(object)Gun2 == (Object)null && (Object)(object)gun != (Object)null) { Gun2 = gun.shootPosition; } if ((Object)(object)cutterProxy == (Object)null && (Object)(object)gun != (Object)null && (Object)(object)gun.player != (Object)null) { cutterProxy = ((Component)gun.player).GetComponent<LaserNetworkActionProxy>(); } CalculateLaserLength(); cutting = false; } private void CalculateLaserLength() { Camera main = Camera.main; if (!((Object)(object)main == (Object)null)) { if (main.orthographic) { float num = main.orthographicSize * 2f; laserLength = num * main.aspect + 100f; } else { laserLength = 500f; } } } private void Update() { //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_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_00a5: 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_013d: 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_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)Gun2 == (Object)null || (Object)(object)gun == (Object)null) { return; } if (!locked) { startPoint = Gun2.position; lockeddirection = GetFireDirection(); endPoint = startPoint + lockeddirection * laserLength; } if (cutting) { ((Renderer)visibleline).enabled = false; ((Renderer)line).enabled = true; line.SetPosition(0, startPoint); line.SetPosition(1, endPoint); if ((Object)(object)gun.player != (Object)null && gun.player.data.view.IsMine) { UpdateLaserHitEffect(startPoint, lockeddirection); CutObjects(); } } else if (((Renderer)visibleline).enabled) { ((Renderer)line).enabled = false; visibleline.SetPosition(0, startPoint); visibleline.SetPosition(1, endPoint); } else { ((Renderer)line).enabled = false; ((Renderer)visibleline).enabled = false; } } public void TriggerVisualEffects() { //IL_0008: 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) //IL_003f: Unknown result type (might be due to invalid IL or missing references) UpdateLaserHitEffect(Gun2.position, GetFireDirection()); if ((Object)(object)DynamicParticles.instance != (Object)null) { DynamicParticles.instance.PlayBulletHit(10000f, ((Component)this).transform, currentHitInfo, Color.red); } } private void UpdateLaserHitEffect(Vector3 start, Vector3 dir) { //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_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_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_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_0046: Expected O, but got Unknown Camera main = Camera.main; if (!((Object)(object)main == (Object)null)) { Vector3 laserCameraLimit = GetLaserCameraLimit(main, start, dir); currentHitInfo = new HitInfo { point = Vector2.op_Implicit(laserCameraLimit), normal = Vector2.op_Implicit(-dir) }; } } private Vector3 GetLaserCameraLimit(Camera cam, Vector3 start, Vector3 dir) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //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_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: 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_0038: 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_0086: 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_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_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) Plane[] array = GeometryUtility.CalculateFrustumPlanes(cam); float num = float.MaxValue; Vector3 result = start + dir * laserLength; Plane[] array2 = array; float num2 = default(float); for (int i = 0; i < array2.Length; i++) { Plane val = array2[i]; if (((Plane)(ref val)).Raycast(new Ray(start, dir), ref num2) && num2 > 0f && num2 < num) { num = num2; result = start + dir * num2; } } return result; } public void ActivateLaser(Transform arma) { //IL_0024: 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_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: 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_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) Gun2 = arma; alreadyRequestedThisCut.Clear(); cutting = true; locked = true; startPoint = arma.position; lockeddirection = GetFireDirection(); endPoint = startPoint + lockeddirection * laserLength; } public void SwitchOffLaser() { cutting = false; locked = false; alreadyRequestedThisCut.Clear(); ((Renderer)visibleline).enabled = true; } public void SetAimLaser(bool ativa) { if ((Object)(object)visibleline != (Object)null) { ((Renderer)visibleline).enabled = ativa; } } private Vector3 GetFireDirection() { //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_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_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_005a: Unknown result type (might be due to invalid IL or missing references) Quaternion val = (Quaternion)typeof(Gun).InvokeMember("getShootRotation", BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.InvokeMethod, null, gun, new object[3] { 0, 0, 0f }); return val * Vector3.forward; } private void DamagePlayerPercent(Player targetPlayer, float percent) { //IL_0079: 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_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_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009e: 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_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)targetPlayer == (Object)null) && !((Object)(object)gun == (Object)null) && !((Object)(object)gun.player == (Object)null)) { CharacterData data = targetPlayer.data; HealthHandler component = ((Component)targetPlayer).GetComponent<HealthHandler>(); percent = Mathf.Clamp(percent, 0.1f, 1f); float num = data.health * percent; if (!(num <= 0f)) { Vector3 val = ((Component)targetPlayer).transform.position - startPoint; Vector2 val2 = Vector2.op_Implicit(((Vector3)(ref val)).normalized); ((Damagable)((Component)targetPlayer).GetComponent<HealthHandler>()).CallTakeDamage(val2 * num, Vector2.op_Implicit(((Component)targetPlayer).transform.position), (GameObject)null, gun.player, true); } } } private void CutObjects() { //IL_0002: 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_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_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_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_0146: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Unknown result type (might be due to invalid IL or missing references) //IL_0190: Unknown result type (might be due to invalid IL or missing references) //IL_02ea: Unknown result type (might be due to invalid IL or missing references) //IL_02ef: Unknown result type (might be due to invalid IL or missing references) //IL_02f5: 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) Vector3 val = endPoint - startPoint; Vector2 val2 = Vector2.op_Implicit(((Vector3)(ref val)).normalized); float num = Vector3.Distance(startPoint, endPoint); foreach (RopeColliderGenerator allRope in RopeColliderGenerator.AllRopes) { if ((Object)(object)allRope == (Object)null || !allRope.CheckLaserHit(Vector2.op_Implicit(startPoint), val2, num, out var _)) { continue; } RuntimeMarker runtimeMarker = ((Component)allRope).GetComponent<RuntimeMarker>() ?? ((Component)allRope).GetComponentInParent<RuntimeMarker>(); if ((Object)(object)runtimeMarker != (Object)null && (Object)(object)cutterProxy != (Object)null) { if (PhotonNetwork.IsMasterClient || PhotonNetwork.OfflineMode) { ((MonoBehaviourPun)cutterProxy).photonView.RPC("RPC_SyncRopeCut", (RpcTarget)0, new object[1] { runtimeMarker.RuntimeID }); } else { ((MonoBehaviourPun)cutterProxy).photonView.RPC("RPC_RequestRopeCutOnMaster", (RpcTarget)2, new object[1] { runtimeMarker.RuntimeID }); } } } RaycastHit2D[] array = Physics2D.RaycastAll(Vector2.op_Implicit(startPoint), val2, num, LayerMask.op_Implicit(cutLayers)); float num2 = 0.9f; BlockSpawnerEffects component = ((Component)gun.player).GetComponent<BlockSpawnerEffects>(); RaycastHit2D[] array2 = array; for (int i = 0; i < array2.Length; i++) { RaycastHit2D val3 = array2[i]; if ((Object)(object)((RaycastHit2D)(ref val3)).collider == (Object)null || ((RaycastHit2D)(ref val3)).collider.isTrigger) { continue; } GameObject gameObject = ((Component)((RaycastHit2D)(ref val3)).collider).gameObject; if (gameObject.layer == LayerMask.NameToLayer("Player")) { if ((Object)(object)component != (Object)null && component.LaserDoDmg) { Player componentInParent = gameObject.GetComponentInParent<Player>(); if ((Object)(object)componentInParent != (Object)null && (Object)(object)componentInParent != (Object)(object)gun.player && !Playersdmg.Contains(componentInParent)) { Playersdmg.Add(componentInParent); DamagePlayerPercent(componentInParent, num2); } } num2 = Mathf.Max(0.1f, num2 - 0.1f); } else if (!alreadyRequestedThisCut.Contains(gameObject)) { PieceData component2 = gameObject.GetComponent<PieceData>(); if ((!((Object)(object)component2 != (Object)null) || !(Time.time - component2.createdTime < 0.2f)) && (Object)(object)cutterProxy != (Object)null) { alreadyRequestedThisCut.Add(gameObject); cutterProxy.RequestCut(gameObject, Vector2.op_Implicit(startPoint), Vector2.op_Implicit(endPoint)); num2 = Mathf.Max(0.1f, num2 - 0.1f); } } } } } public class LaserGunController : MonoBehaviour { [CompilerGenerated] private sealed class <InitLaser>d__26 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public LaserGunController <>4__this; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <InitLaser>d__26(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; goto IL_0044; case 1: <>1__state = -1; goto IL_0044; case 2: { <>1__state = -1; <>4__this.laserCutter = ((Component)<>4__this.gun).GetComponentInChildren<LaserCutter2D>(); if ((Object)(object)<>4__this.laserCutter != (Object)null) { <>4__this.laserCutter.SwitchOffLaser(); <>4__this.laserCutter.SetAimLaser(<>4__this.ActiveLaser); } return false; } IL_0044: if ((Object)(object)<>4__this.gun == (Object)null) { <>2__current = null; <>1__state = 1; return true; } <>2__current = (object)new WaitForSeconds(0.1f); <>1__state = 2; return true; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public Gun gun; private LaserCutter2D laserCutter; public Coroutine laserCoroutine; private bool ActiveLaser = false; private float sinceAttackLaser = 999f; private float sinceAttackNormal = 999f; private float attackSpeedOriginal = -1f; private bool dontAllowAutoFireOriginal; private float spreadOriginal; public float attackSpeedLaser = 5f; public bool LoadingLaser = false; private AudioSource chargeSource; private AudioSource fireSource; private static AudioClip laserChargeClip; private static AudioClip laserFireClip; private PhotonView PlayerView => ((Component)this).GetComponent<PhotonView>(); private void Awake() { SetupAudio(); } private void Start() { ((MonoBehaviour)this).StartCoroutine(InitLaser()); } private void Update() { if (!((Object)(object)gun == (Object)null) && !((Object)(object)gun.player == (Object)null) && !((Object)(object)PlayerView == (Object)null) && PlayerView.IsMine) { float deltaTime = Time.deltaTime; if (ActiveLaser) { sinceAttackLaser += deltaTime; } else { sinceAttackNormal += deltaTime; } PlayerActions playerActions = gun.player.data.playerActions; if (playerActions != null && ((OneAxisInputControl)playerActions.GetAdditionalData().switchWeapon).WasPressed) { PlayerView.RPC("RPC_ToggleLaserMode", (RpcTarget)0, new object[1] { !ActiveLaser }); } } } [PunRPC] private void RPC_ToggleLaserMode(bool activate) { ActiveLaser = activate; if (ActiveLaser) { if (attackSpeedOriginal < 0f) { attackSpeedOriginal = gun.attackSpeed; dontAllowAutoFireOriginal = gun.dontAllowAutoFire; spreadOriginal = gun.spread; } sinceAttackNormal = ((Weapon)gun).sinceAttack; ((Weapon)gun).sinceAttack = sinceAttackLaser; gun.attackSpeed = attackSpeedLaser; gun.dontAllowAutoFire = true; gun.spread = 0f; } else { sinceAttackLaser = ((Weapon)gun).sinceAttack; ((Weapon)gun).sinceAttack = sinceAttackNormal; CancelLaser(); if (attackSpeedOriginal >= 0f) { gun.attackSpeed = attackSpeedOriginal; gun.dontAllowAutoFire = dontAllowAutoFireOriginal; gun.spread = spreadOriginal; } } if ((Object)(object)laserCutter != (Object)null) { laserCutter.SetAimLaser(ActiveLaser); } } public void NetworkPlayCharge() { PlayerView.RPC("RPC_LaserCharge", (RpcTarget)0, new object[1] { true }); } public void NetworkStopCharge() { PlayerView.RPC("RPC_LaserCharge", (RpcTarget)0, new object[1] { false }); } public void NetworkPlayFire() { PlayerView.RPC("RPC_LaserFire", (RpcTarget)0, Array.Empty<object>()); } [PunRPC] private void RPC_LaserCharge(bool start) { if (start) { PlayChargeSound(); } else { StopChargeSound(); } } [PunRPC] private void RPC_LaserFire() { //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_0036: 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_0041: Unknown result type (might be due to invalid IL or missing references) PlayFireSound(); if ((Object)(object)laserCutter != (Object)null) { laserCutter.TriggerVisualEffects(); Vector3 forward = gun.shootPosition.forward; GamefeelManager.GameFeel(Vector2.op_Implicit(forward * 30f)); } } [IteratorStateMachine(typeof(<InitLaser>d__26))] private IEnumerator InitLaser() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <InitLaser>d__26(0) { <>4__this = this }; } private void SetupAudio() { chargeSource = ((Component)this).gameObject.AddComponent<AudioSource>(); chargeSource.volume = 0.05f; chargeSource.playOnAwake = false; chargeSource.loop = false; fireSource = ((Component)this).gameObject.AddComponent<AudioSource>(); fireSource.volume = 0.055f; fireSource.playOnAwake = false; fireSource.loop = false; if ((Object)(object)laserChargeClip == (Object)null) { laserChargeClip = Assets.Bundle.LoadAsset<AudioClip>("laser_charge_loop"); } if ((Object)(object)laserFireClip == (Object)null) { laserFireClip = Assets.Bundle.LoadAsset<AudioClip>("laserrealease"); } chargeSource.clip = laserChargeClip; fireSource.clip = laserFireClip; AudioMixerGroup[] array = SoundVolumeManager.Instance.audioMixer.FindMatchingGroups("SFX"); if (array.Length != 0) { chargeSource.outputAudioMixerGroup = array[0]; fireSource.outputAudioMixerGroup = array[0]; } } public void PlayChargeSound() { if (!chargeSource.isPlaying) { chargeSource.Play(); } } public void StopChargeSound() { if (chargeSource.isPlaying) { chargeSource.Stop(); } } public void PlayFireSound() { if ((Object)(object)fireSource.clip != (Object)null) { fireSource.PlayOneShot(fireSource.clip); } } public void CancelLaser() { if (laserCoroutine != null) { ((MonoBehaviour)gun).StopCoroutine(laserCoroutine); laserCoroutine = null; } LoadingLaser = false; StopChargeSound(); if ((Object)(object)laserCutter != (Object)null) { laserCutter.SwitchOffLaser(); } } public bool IsLaserActive() { return ActiveLaser; } public bool IsWaitingForCooldown() { return sinceAttackLaser < 1f / attackSpeedLaser; } public void ResetLaserCooldown() { sinceAttackLaser = 0f; } public LaserCutter2D GetLaserCutter() { return laserCutter; } } public class LaserNetworkActionProxy : MonoBehaviourPun { private Dictionary<int, RuntimeMarker> runtimeMarkers = new Dictionary<int, RuntimeMarker>(); private void Awake() { if ((Object)(object)((MonoBehaviourPun)this).photonView != (Object)null) { ((MonoBehaviourPun)this).photonView.RefreshRpcMonoBehaviourCache(); } RuntimeMarker[] array = Object.FindObjectsOfType<RuntimeMarker>(); foreach (RuntimeMarker runtimeMarker in array) { if (!runtimeMarkers.ContainsKey(runtimeMarker.RuntimeID)) { runtimeMarkers[runtimeMarker.RuntimeID] = runtimeMarker; } } } public void RequestCut(GameObject original, Vector2 pointA, Vector2 pointB) { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0074: 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_00bd: 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) if ((Object)(object)original == (Object)null) { return; } if (PhotonNetwork.IsMasterClient || PhotonNetwork.OfflineMode) { ProcessAndBroadcastCut(original, pointA, pointB); return; } PhotonView component = original.GetComponent<PhotonView>(); RuntimeMarker component2 = original.GetComponent<RuntimeMarker>(); if ((Object)(object)component != (Object)null) { ((MonoBehaviourPun)this).photonView.RPC("RPC_RequestCutOnMaster", (RpcTarget)2, new object[3] { component.ViewID, pointA, pointB }); } else if ((Object)(object)component2 != (Object)null) { ((MonoBehaviourPun)this).photonView.RPC("RPC_RequestCutByRuntimeIDOnMaster", (RpcTarget)2, new object[3] { component2.RuntimeID, pointA, pointB }); } } [PunRPC] private void RPC_RequestCutByRuntimeIDOnMaster(int runtimeID, Vector2 pointA, Vector2 pointB) { //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) if (runtimeMarkers.TryGetValue(runtimeID, out var value)) { ProcessAndBroadcastCut(((Component)value).gameObject, pointA, pointB); } } [PunRPC] private void RPC_RequestCutOnMaster(int targetViewID, Vector2 pointA, Vector2 pointB) { //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) PhotonView val = PhotonView.Find(targetViewID); if ((Object)(object)val != (Object)null) { ProcessAndBroadcastCut(((Component)val).gameObject, pointA, pointB); } } [PunRPC] private void RPC_SyncRopeCut(int runtimeID) { if (runtimeMarkers.TryGetValue(runtimeID, out var value)) { MapObjet_Rope val = ((Component)value).GetComponent<MapObjet_Rope>() ?? ((Component)value).GetComponentInChildren<MapObjet_Rope>(); if ((Object)(object)val != (Object)null) { typeof(MapObjet_Rope).GetMethod("Leave", BindingFlags.Instance | BindingFlags.NonPublic)?.Invoke(val, null); } } } private void ProcessAndBroadcastCut(GameObject original, Vector2 pointA, Vector2 pointB) { //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_0162: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_021f: Unknown result type (might be due to invalid IL or missing references) //IL_022e: 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_0259: 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) if ((Object)(object)original == (Object)null) { return; } BoxCollider2D component = original.GetComponent<BoxCollider2D>(); if ((Object)(object)component != (Object)null && (Object)(object)original.GetComponent<PolygonCollider2D>() == (Object)null) { ConvertBoxToPolygon(component); } CircleCollider2D component2 = original.GetComponent<CircleCollider2D>(); if ((Object)(object)component2 != (Object)null && (Object)(object)original.GetComponent<PolygonCollider2D>() == (Object)null) { ConvertCircleToPolygon(component2); } List<Cutter2DPhoton.CutterPieceData> list = Cutter2DPhoton.CutAndReturnData(original, pointA, pointB); if (list == null || list.Count == 0) { return; } RuntimeMarker component3 = original.GetComponent<RuntimeMarker>(); if ((Object)(object)component3 != (Object)null) { EnsurePhotonView(original, component3.RuntimeID); } PhotonView component4 = original.GetComponent<PhotonView>(); int num = (((Object)(object)component4 != (Object)null) ? component4.ViewID : (-1)); RuntimeMarker component5 = original.GetComponent<RuntimeMarker>(); Vector3 val = default(Vector3); for (int i = 0; i < list.Count; i++) { Cutter2DPhoton.CutterPieceData cutterPieceData = list[i]; int num2 = PhotonNetwork.AllocateViewID(true); float[] array = new float[cutterPieceData.localPoints.Length * 2]; for (int j = 0; j < cutterPieceData.localPoints.Length; j++) { array[j * 2] = cutterPieceData.localPoints[j].x; array[j * 2 + 1] = cutterPieceData.localPoints[j].y; } ((Vector3)(ref val))..ctor(cutterPieceData.color.r, cutterPieceData.color.g, cutterPieceData.color.b); int num3 = ((cutterPieceData.layer == LayerMask.NameToLayer("IgnoreMap")) ? LayerMask.NameToLayer("Default") : cutterPieceData.layer); bool flag = num3 == LayerMask.NameToLayer("IgnorePlayer") || num3 == LayerMask.NameToLayer("BackgroundObject") || num3 == LayerMask.NameToLayer("Default"); Sprite spriteByID = Cutter2DPhoton.GetSpriteByID(cutterPieceData.spriteID); bool flag2 = ShouldUseSpecialMaterial(original, spriteByID); ((MonoBehaviourPun)this).photonView.RPC("RPC_SpawnPiece", (RpcTarget)0, new object[17] { num2, array, cutterPieceData.position, cutterPieceData.rotation, cutterPieceData.scale, cutterPieceData.spriteID, val, cutterPieceData.color.a, num3, cutterPieceData.sortingLayerID, cutterPieceData.sortingOrder, flag, cutterPieceData.mass, cutterPieceData.gravityScale, original.tag, LayerMask.LayerToName(original.layer), flag2 }); } if (num != -1) { ((MonoBehaviourPun)this).photonView.RPC("RPC_DestroyNetworkPiece", (RpcTarget)0, new object[1] { num }); } else if ((Object)(object)component5 != (Object)null) { ((MonoBehaviourPun)this).photonView.RPC("RPC_DestroyWithIDPiece", (RpcTarget)0, new object[1] { component5.RuntimeID }); } else { Object.Destroy((Object)(object)original); } } [PunRPC] public void RPC_SpawnPiece(int viewID, float[] flatPoints, Vector3 pos, Quaternion rot, Vector3 scale, int spriteID, Vector3 rgb, float a, int layer, int sLayer, int sOrder, bool withPhys, float mass, float grav, string originalTag, string originLayerName, bool useSpecialMaterial) { //IL_0200: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Expected O, but got Unknown //IL_0064: 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_0073: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Expected O, but got Unknown //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Expected O, but got Unknown //IL_0171: 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_017f: 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) Vector2[] array = (Vector2[])(object)new Vector2[flatPoints.Length / 2]; for (int i = 0; i < array.Length; i++) { array[i] = new Vector2(flatPoints[i * 2], flatPoints[i * 2 + 1]); } Sprite spriteByID = Cutter2DPhoton.GetSpriteByID(spriteID); GameObject val = new GameObject("Piece_" + viewID); val.transform.SetPositionAndRotation(pos, rot); val.transform.localScale = scale; val.layer = layer; val.tag = originalTag; if ((Object)(object)spriteByID != (Object)null) { PieceData pieceData = val.AddComponent<PieceData>(); pieceData.sprite = spriteByID; pieceData.OriginalLayer = originLayerName; pieceData.createdTime = Time.time; } MeshFilter val2 = val.AddComponent<MeshFilter>(); val2.mesh = Cutter2DPhoton.CreateMeshFromPolygon(array.ToList(), spriteByID); MeshRenderer val3 = val.AddComponent<MeshRenderer>(); if (useSpecialMaterial && (Object)(object)Assets.Bundle != (Object)null) { Material val4 = Assets.Bundle.LoadAsset<Material>("Mat_MeshMaskWrite"); ((Renderer)val3).material = new Material(val4); ((Renderer)val3).material.renderQueue = 4000; } else { ((Renderer)val3).material = new Material(Shader.Find("Sprites/Default")); } if ((Object)(object)spriteByID != (Object)null) { ((Renderer)val3).material.mainTexture = (Texture)(object)spriteByID.texture; } ((Renderer)val3).material.color = new Color(rgb.x, rgb.y, rgb.z, a); ((Renderer)val3).sortingLayerID = sLayer; ((Renderer)val3).sortingOrder = sOrder; PolygonCollider2D val5 = val.AddComponent<PolygonCollider2D>(); val5.points = array; try { SFPolygon val6 = val.AddComponent<SFPolygon>(); val6.pathCount = 1; val6.verts = array; val6.looped = true; val6._UpdateBounds(); } catch { } PhotonView val7 = val.AddComponent<PhotonView>(); val7.ViewID = viewID; val7.OwnershipTransfer = (OwnershipOption)2; if (withPhys) { Rigidbody2D val8 = val.AddComponent<Rigidbody2D>(); val8.mass = mass; val8.gravityScale = grav; NetworkPhysicsObject val9 = val.AddComponent<NetworkPhysicsObject>(); val9.photonView = val7; val9.speed = 8000f; val9.maxShake = 8000000f; val9.dmgAmount = 0.5f; val9.bulletPushMultiplier = 20f; val9.collisionThreshold = 200000f; val9.forceAmount = 1500f; val9.playerColThreshold = 5f; val7.ObservedComponents = new List<Component> { (Component)(object)val9 }; } val.AddComponent<DestroyPieceOutOfCamera>(); SetPhotonInternalFlags(val7); } [PunRPC] public void RPC_DestroyNetworkPiece(int viewID) { PhotonView val = PhotonView.Find(viewID); if ((Object)(object)val != (Object)null) { Object.Destroy((Object)(object)((Component)val).gameObject); } } [PunRPC] public void RPC_DestroyWithIDPiece(int runtimeID) { if (runtimeMarkers.TryGetValue(runtimeID, out var value)) { if ((Object)(object)value != (Object)null && (Object)(object)((Component)value).gameObject != (Object)null) { runtimeMarkers.Remove(runtimeID); Object.Destroy((Object)(object)((Component)value).gameObject); } } else { Debug.LogWarning((object)$"[Proxy] RuntimeID {runtimeID} não encontrado no dicionário local."); } } [PunRPC] private void RPC_RequestRopeCutOnMaster(int runtimeID) { if (PhotonNetwork.IsMasterClient) { ((MonoBehaviourPun)this).photonView.RPC("RPC_SyncRopeCut", (RpcTarget)0, new object[1] { runtimeID }); } } private PolygonCollider2D ConvertBoxToPolygon(BoxCollider2D box) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0024: 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_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_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_0056: 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_005e: 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_006b: 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_007f: 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_0087: 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_0093: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: 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_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) PolygonCollider2D val = ((Component)box).gameObject.GetComponent<PolygonCollider2D>() ?? ((Component)box).gameObject.AddComponent<PolygonCollider2D>(); Vector2 size = box.size; Vector2 offset = ((Collider2D)box).offset; Vector2[] array = (Vector2[])(object)new Vector2[4] { offset + new Vector2(0f - size.x, 0f - size.y) * 0.5f, offset + new Vector2(0f - size.x, size.y) * 0.5f, offset + new Vector2(size.x, size.y) * 0.5f, offset + new Vector2(size.x, 0f - size.y) * 0.5f }; val.pathCount = 1; val.SetPath(0, array); Object.Destroy((Object)(object)box); return val; } public void AddMarkerToDictionary(int id, RuntimeMarker marker) { if (!runtimeMarkers.ContainsKey(id)) { runtimeMarkers[id] = marker; } } private PolygonCollider2D ConvertCircleToPolygon(CircleCollider2D circle, int segments = 16) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) PolygonCollider2D val = ((Component)circle).gameObject.GetComponent<PolygonCollider2D>() ?? ((Component)circle).gameObject.AddComponent<PolygonCollider2D>(); Vector2 offset = ((Collider2D)circle).offset; float radius = circle.radius; Vector2[] array = (Vector2[])(object)new Vector2[segments]; for (int i = 0; i < segments; i++) { float num = (float)i / (float)segments * MathF.PI * 2f; array[i] = offset + new Vector2(Mathf.Cos(num), Mathf.Sin(num)) * radius; } val.pathCount = 1; val.SetPath(0, array); Object.Destroy((Object)(object)circle); return val; } private bool ShouldUseSpecialMaterial(GameObject original, Sprite sprite) { if ((Object)(object)sprite == (Object)null) { return false; } if (original.layer != LayerMask.NameToLayer("Default")) { return false; } string text = ((Object)sprite).name.ToLower(); return text.Contains("square") || text.Contains("circle"); } [PunRPC] private void RPC_AssignPhotonView(int runtimeID, int viewID) { if (runtimeMarkers.TryGetValue(runtimeID, out var value)) { PhotonView val = ((Component)value).gameObject.GetComponent<PhotonView>() ?? ((Component)value).gameObject.AddComponent<PhotonView>(); val.ViewID = viewID; } } public void EnsurePhotonView(GameObject go, int runtimeID) { PhotonView component = go.GetComponent<PhotonView>(); if (!((Object)(object)component != (Object)null)) { component = go.AddComponent<PhotonView>(); if (PhotonNetwork.IsMasterClient) { component.ViewID = PhotonNetwork.AllocateViewID(true); ((MonoBehaviourPun)this).photonView.RPC("RPC_AssignPhotonView", (RpcTarget)4, new object[2] { runtimeID, component.ViewID }); } } } private void SetPhotonInternalFlags(PhotonView pv) { Type typeFromHandle = typeof(PhotonView); typeFromHandle.GetField("ownerActorNr", BindingFlags.Instance | BindingFlags.NonPublic)?.SetValue(pv, PhotonNetwork.IsMasterClient ? PhotonNetwork.LocalPlayer.ActorNumber : 0); typeFromHandle.GetField("<AmOwner>k__BackingField", BindingFlags.Instance | BindingFlags.NonPublic)?.SetValue(pv, PhotonNetwork.IsMasterClient); typeFromHandle.GetField("amController", BindingFlags.Instance | BindingFlags.NonPublic)?.SetValue(pv, true); typeFromHandle.GetField("isRuntimeInstantiated", BindingFlags.Instance | BindingFlags.NonPublic)?.SetValue(pv, true); } } public class MapSceneRuntimeIDManager : MonoBehaviour { [CompilerGenerated] private sealed class <RegisterAllObjectsWithDelay>d__5 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Scene scene; public float delay; public MapSceneRuntimeIDManager <>4__this; private GameObject[] <>s__1; private int <>s__2; private GameObject <go>5__3; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <RegisterAllObjectsWithDelay>d__5(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>s__1 = null; <go>5__3 = null; <>1__state = -2; } private bool MoveNext() { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(delay); <>1__state = 1; return true; case 1: <>1__state = -1; <>s__1 = ((Scene)(ref scene)).GetRootGameObjects(); for (<>s__2 = 0; <>s__2 < <>s__1.Length; <>s__2++) { <go>5__3 = <>s__1[<>s__2]; <>4__this.RegisterMapObjectRecursively(<go>5__3); <go>5__3 = null; } <>s__1 = null; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private static int RuntimeCounter; public static int RegisterDynamicObject(GameObject go) { if ((Object)(object)go.GetComponent<RuntimeMarker>() == (Object)null) { RuntimeMarker runtimeMarker = go.AddComponent<RuntimeMarker>(); runtimeMarker.RuntimeID = ++RuntimeCounter; return runtimeMarker.RuntimeID; } return go.GetComponent<RuntimeMarker>().RuntimeID; } private void OnEnable() { SceneManager.sceneLoaded += OnSceneLoaded; } private void OnDisable() { SceneManager.sceneLoaded -= OnSceneLoaded; } private void OnSceneLoaded(Scene scene, LoadSceneMode mode) { //IL_003f: Unknown result type (might be due to invalid IL or missing references) if (((Scene)(ref scene)).GetRootGameObjects().Any((GameObject go) => (Object)(object)go.GetComponentInChildren<Map>() != (Object)null)) { RuntimeCounter = 0; ((MonoBehaviour)this).StartCoroutine(RegisterAllObjectsWithDelay(scene, 0.5f)); } } [IteratorStateMachine(typeof(<RegisterAllObjectsWithDelay>d__5))] private IEnumerator RegisterAllObjectsWithDelay(Scene scene, float delay) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <RegisterAllObjectsWithDelay>d__5(0) { <>4__this = this, scene = scene, delay = delay }; } private void RegisterMapObjectRecursively(GameObject go) { //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Expected O, but got Unknown if ((Object)(object)go.GetComponent<RuntimeMarker>() == (Object)null) { RuntimeMarker runtimeMarker = go.AddComponent<RuntimeMarker>(); runtimeMarker.RuntimeID = ++RuntimeCounter; } foreach (Transform item in go.transform) { Transform val = item; RegisterMapObjectRecursively(((Component)val).gameObject); } } } public class RuntimeMarker : MonoBehaviour { public int RuntimeID; } public class RigidbodyRopeRef : MonoBehaviour { public MapObjet_Rope rope; } [HarmonyPatch(typeof(MapObjet_Rope), "AddJoint")] public class MapRope_AddJoint_Patch { private static void Postfix(MapObjet_Rope __instance, Rigidbody2D target) { if ((Object)(object)target != (Object)null) { RigidbodyRopeRef rigidbodyRopeRef = ((Component)target).GetComponent<RigidbodyRopeRef>(); if ((Object)(object)rigidbodyRopeRef == (Object)null) { rigidbodyRopeRef = ((Component)target).gameObject.AddComponent<RigidbodyRopeRef>(); } rigidbodyRopeRef.rope = __instance; } } } public class RopeAutoConverter : MonoBehaviour { [CompilerGenerated] private sealed class <AutoCheckLoop>d__5 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public RopeAutoConverter <>4__this; private bool <stillMissing>5__1; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <AutoCheckLoop>d__5(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; break; case 1: <>1__state = -1; break; } <stillMissing>5__1 = <>4__this.ConvertAllRopes(); if (!<stillMissing>5__1) { <>4__this.autoRoutine = null; return false; } <>2__current = (object)new WaitForSeconds(<>4__this.interval); <>1__state = 1; return true; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private Coroutine autoRoutine; private float interval = 2f; private void Awake() { Object.DontDestroyOnLoad((Object)(object)((Component)this).gameObject); SceneManager.sceneLoaded += OnSceneLoaded; } private void OnSceneLoaded(Scene scene, LoadSceneMode mode) { StartLoop(); } private void StartLoop() { if (autoRoutine == null) { autoRoutine = ((MonoBehaviour)this).StartCoroutine(AutoCheckLoop()); } } [IteratorStateMachine(typeof(<AutoCheckLoop>d__5))] private IEnumerator AutoCheckLoop() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <AutoCheckLoop>d__5(0) { <>4__this = this }; } private bool ConvertAllRopes() { bool result = false; LineRenderer[] array = Object.FindObjectsOfType<LineRenderer>(); LineRenderer[] array2 = array; foreach (LineRenderer val in array2) { if (((Object)val).name.ToLower().Contains("rope") && (Object)(object)((Component)val).GetComponent<RopeColliderGenerator>() == (Object)null) { result = true; ((Component)val).gameObject.AddComponent<RopeColliderGenerator>(); } } return result; } private void Update() { if (autoRoutine == null && HasUnconvertedRopes()) { StartLoop(); } } private bool HasUnconvertedRopes() { LineRenderer[] array = Object.FindObjectsOfType<LineRenderer>(); foreach (LineRenderer val in array) { if (((Object)val).name.ToLower().Contains("rope") && (Object)(object)((Component)val).GetComponent<RopeColliderGenerator>() == (Object)null) { return true; } } return false; } } [RequireComponent(typeof(LineRenderer))] public class RopeColliderGenerator : MonoBehaviour { public static readonly List<RopeColliderGenerator> AllRopes = new List<RopeColliderGenerator>(); private LineRenderer line; private Vector3[] positions; private void Awake() { line = ((Component)this).GetComponent<LineRenderer>(); AllRopes.Add(this); } private void OnDestroy() { AllRopes.Remove(this); } public bool CheckLaserHit(Vector2 laserStart, Vector2 laserDir, float laserDist, out Vector2 hitPoint) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_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_006a: 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_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: 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) hitPoint = Vector2.zero; int positionCount = line.positionCount; if (positions == null || positions.Length != positionCount) { positions = (Vector3[])(object)new Vector3[positionCount]; } line.GetPositions(positions); for (int i = 0; i < positionCount - 1; i++) { Vector2 p = Vector2.op_Implicit(positions[i]); Vector2 p2 = Vector2.op_Implicit(positions[i + 1]); if (LineIntersect(laserStart, laserStart + laserDir * laserDist, p, p2, out var intersection)) { hitPoint = intersection; return true; } } return false; } private bool LineIntersect(Vector2 p1, Vector2 p2, Vector2 p3, Vector2 p4, out Vector2 intersection) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_001b: 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_002a: 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_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: 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_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: 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) intersection = Vector2.zero; float num = p2.y - p1.y; float num2 = p1.x - p2.x; float num3 = num * p1.x + num2 * p1.y; float num4 = p4.y - p3.y; float num5 = p3.x - p4.x; float num6 = num4 * p3.x + num5 * p3.y; float num7 = num * num5 - num4 * num2; if (Mathf.Abs(num7) < 0.001f) { return false; } float num8 = (num5 * num3 - num2 * num6) / num7; float num9 = (num * num6 - num4 * num3) / num7; Vector2 val = default(Vector2); ((Vector2)(ref val))..ctor(num8, num9); if (PointOnSegment(val, p1, p2) && PointOnSegment(val, p3, p4)) { intersection = val; return true; } return false; } private bool PointOnSegment(Vector2 p, Vector2 a, Vector2 b) { //IL_0001: 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_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0020: 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_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_004c: 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_0058: Unknown result type (might be due to invalid IL or missing references) return p.x >= Mathf.Min(a.x, b.x) && p.x <= Mathf.Max(a.x, b.x) && p.y >= Mathf.Min(a.y, b.y) && p.y <= Mathf.Max(a.y, b.y); } } public class TeleportUIScript : MonoBehaviour { public Vector3 anchorPosition = Vector3.zero; public Vector3 anchorRotation = Vector3.zero; private RectTransform rect; private void Start() { rect = ((Component)this).GetComponent<RectTransform>(); } private void Update() { //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_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_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_0045: 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) if (anchorPosition != Vector3.zero) { rect.anchoredPosition = Vector2.op_Implicit(anchorPosition); ((Transform)rect).localEulerAngles = anchorRotation; anchorPosition = Vector3.zero; anchorRotation = Vector3.zero; } } } public class TNTNetworkProxy : MonoBehaviourPun { public static TNTNetworkProxy Instance; private void Awake() { Instance = this; } public void RequestNetworkSync(int principalViewID, int[] cloneIDs, Vector2[] clonePositions, int principalInstanceID, float maxLoops, float scale, int spawnerID) { ((MonoBehaviourPun)this).photonView.RPC("RPC_FinalNetworkSync", (RpcTarget)0, new object[7] { principalViewID, cloneIDs, clonePositions, principalInstanceID, maxLoops, scale, spawnerID }); } [PunRPC] private void RPC_FinalNetworkSync(int principalViewID, int[] cloneIDs, Vector2[] clonePositions, int principalInstanceID, float maxLoops, float scale, int spawnerID) { //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) Player player_spawner = ((IEnumerable<Player>)PlayerManager.instance.players).FirstOrDefault((Func<Player, bool>)((Player p) => p.playerID == spawnerID)); GameObject prefab = TNTSpawner.GetPrefab(); TNTScript tNTScript = Object.FindObjectsOfType<TNTScript>().FirstOrDefault((TNTScript t) => !t.isCopy && ((Object)(object)((Component)t).GetComponent<PhotonView>() == (Object)null || ((Component)t).GetComponent<PhotonView>().ViewID <= 0)); if ((Object)(object)tNTScript != (Object)null) { SetupNetworking(((Component)tNTScript).gameObject, principalViewID); } for (int i = 0; i < cloneIDs.Length; i++) { GameObject val = Object.Instantiate<GameObject>(prefab, Vector2.op_Implicit(clonePositions[i]), Quaternion.identity); Transform obj = val.transform.Find("SpriteRenderer"); SpriteRenderer val2 = ((obj != null) ? ((Component)obj).GetComponent<SpriteRenderer>() : null); TNTScript tNTScript2 = val.GetComponent<TNTScript>() ?? val.AddComponent<TNTScript>(); tNTScript2.isCopy = true; tNTScript2.player_spawner = player_spawner; tNTScript2.tntScale = scale; val.layer = LayerMask.NameToLayer("PlayerObjectCollider"); if ((Object)(object)val2 != (Object)null) { ((Component)val2).gameObject.layer = LayerMask.NameToLayer("Default"); } tNTScript2.StartTNT(0, maxLoops); SetupNetworking(val, cloneIDs[i]); } } private void SetupNetworking(GameObject obj, int viewID) { //IL_0040: Unknown result type (might be due to invalid IL or missing references) PhotonView val = obj.GetComponent<PhotonView>() ?? obj.AddComponent<PhotonView>(); val.ViewID = viewID; NetworkPhysicsObject item = obj.GetComponent<NetworkPhysicsObject>() ?? obj.AddComponent<NetworkPhysicsObject>(); val.ObservedComponents = new List<Component> { (Component)(object)item }; val.Synchronization = (ViewSynchronization)3; Rigidbody2D component = obj.GetComponent<Rigidbody2D>(); if ((Object)(object)component != (Object)null) { component.interpolation = (RigidbodyInterpolation2D)1; component.collisionDetectionMode = (CollisionDetectionMode2D)1; } } } public class TNTScript : MonoBehaviour { [CompilerGenerated] private sealed class <DisableAfterDelay>d__32 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public GameObject obj; public float delay; public TNTScript <>4__this; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <DisableAfterDelay>d__32(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(delay); <>1__state = 1; return true; case 1: <>1__state = -1; obj.SetActive(false); if ((Object)(object)ExplosionPool.Instance != (Object)nul