Decompiled source of SpawnerArmExtras v5.0.2
SpawnerArmExtras.dll
Decompiled a month 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 System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Logging; using HarmonyLib; using Microsoft.CodeAnalysis; using Newtonsoft.Json; using Sandbox; using ULTRAKILL.Cheats; using ULTRAKILL.Portal; using Unity.AI.Navigation; using UnityEngine; using UnityEngine.AI; using UnityEngine.AddressableAssets; using UnityEngine.ProBuilder; using UnityEngine.SceneManagement; using plog.Models; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: IgnoresAccessChecksTo("Assembly-CSharp")] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("SpawnerArmExtras")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("5.0.2.0")] [assembly: AssemblyInformationalVersion("5.0.2+7f1c2093041558b79ca357699777ad02d292e483")] [assembly: AssemblyProduct("SpawnerArmExtras")] [assembly: AssemblyTitle("SpawnerArmExtras")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("5.0.2.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace SpawnerArmExtras { public class BlackHoleFromMortar : MonoBehaviour { public EnemyIdentifier source = null; public void Update() { if ((Object)(object)source == (Object)null) { ((Component)this).GetComponent<BlackHoleProjectile>().Explode(); } } } [HarmonyPatch(typeof(BlackHoleProjectile), "Explode")] public class BlackHoleFromMortarPatch { public static void Prefix(BlackHoleProjectile __instance) { BlackHoleFromMortar component = ((Component)__instance).GetComponent<BlackHoleFromMortar>(); if (!((Object)(object)component == (Object)null) && !((Object)(object)component.source == (Object)null)) { MortarLauncher component2 = ((Component)component.source).GetComponent<MortarLauncher>(); if (component2 != null) { component2.cooldown = 2f; } } } } public class DisgraceSpawned : MonoBehaviour { [CompilerGenerated] private sealed class <Dash>d__13 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public int times; public DisgraceSpawned <>4__this; private Vector3 <distance>5__1; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <Dash>d__13(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Expected O, but got Unknown //IL_00e6: 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_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0078: 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_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(0.01f); <>1__state = 1; return true; case 1: <>1__state = -1; if (times > 0) { <distance>5__1 = ((Component)<>4__this.mf).transform.position - ((Component)MonoSingleton<NewMovement>.Instance).transform.position; Transform transform = ((Component)<>4__this).transform; transform.position -= 0.1f * <distance>5__1; ((MonoBehaviour)<>4__this).StartCoroutine(<>4__this.Dash(times - 1)); } else { Object.Instantiate<GameObject>(Plugin.Prefabs["Explosion"], ((Component)<>4__this).transform.position, ((Component)<>4__this).transform.rotation); <>4__this.dashing = false; <>4__this.dashCooldown = 0f; } 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(); } } public bool dashing = false; public float dashCooldown = 0f; public float dashCooldownMax = 0.6f; public float randomizedSpeed; public Color red = new Color(0.9f, 0.5f, 0.6f); public Color green = new Color(0.5f, 0.9f, 0.6f); public Transform mf; public Follow follow; public AlwaysLookAtCamera looker; public SkinnedMeshRenderer renderer; public EnemyIdentifier eid; public float difficultySpeedModifier; public void Start() { //IL_0063: Unknown result type (might be due to invalid IL or missing references) mf = ((Component)this).transform.Find("MaliciousFace"); follow = ((Component)this).gameObject.AddComponent<Follow>(); follow.speed = 12f; looker = ((Component)mf).gameObject.AddComponent<AlwaysLookAtCamera>(); mf.localScale = new Vector3(0.1f, 0.0875f, 0.0005f); randomizedSpeed = Random.Range(-1.6f, 1.6f); renderer = ((Component)this).GetComponentInChildren<SkinnedMeshRenderer>(); eid = ((Component)this).GetComponent<EnemyIdentifier>(); for (int i = 0; i < ((Component)this).transform.parent.childCount; i++) { Transform child = ((Component)this).transform.parent.GetChild(i); if (((Object)child).name.Contains("Leg")) { ((Component)child).gameObject.SetActive(false); } } int difficulty = eid.difficulty; if (1 == 0) { } float num = difficulty switch { 4 => 1f, 3 => 0.9f, 2 => 0.75f, 1 => 0.5f, 0 => 0.4f, _ => 1.15f, }; if (1 == 0) { } difficultySpeedModifier = num; dashCooldownMax /= difficultySpeedModifier; } [IteratorStateMachine(typeof(<Dash>d__13))] public IEnumerator Dash(int times) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <Dash>d__13(0) { <>4__this = this, times = times }; } public void Update() { //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0061: 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_0155: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) if (eid.dead) { Object.Destroy((Object)(object)this); } if (!dashing) { dashCooldown += Time.deltaTime; } NewMovement instance = MonoSingleton<NewMovement>.Instance; Vector3 val = ((Component)mf).transform.position - ((Component)instance).transform.position; float num = Vector3.Dot(((Vector3)(ref val)).normalized, ((Component)instance.cc).transform.forward); if (((Vector3)(ref val)).magnitude <= 12f && dashCooldown >= dashCooldownMax && !dashing && !BlindEnemies.Blind && !EnemyIgnorePlayer.Active && !eid.dead) { dashing = true; ((MonoBehaviour)this).StartCoroutine(Dash(10)); } if (num > 0.9f) { follow.speed = (3f + randomizedSpeed * 0.375f) * difficultySpeedModifier; ((Renderer)renderer).material.color = red; } else { follow.speed = (8f + randomizedSpeed) * difficultySpeedModifier; ((Renderer)renderer).material.color = green; } if (eid.dead) { ((Renderer)renderer).material.color = ((Renderer)renderer).material.color / 3f; } if (BlindEnemies.Blind || EnemyIgnorePlayer.Active) { ((Behaviour)follow).enabled = false; ((Behaviour)looker).enabled = false; } else { ((Behaviour)follow).enabled = true; ((Behaviour)looker).enabled = true; } } } public class HidePreviewIfNotInHand : MonoBehaviour { private Transform parent; private GameObject thingToHide; public void Start() { parent = ((Component)this).transform.parent; thingToHide = ((Component)((Component)this).transform.GetChild(0)).gameObject; } public void Update() { if (Object.op_Implicit((Object)(object)parent) && ((Object)parent).name == "Holder") { thingToHide.SetActive(true); } else { thingToHide.SetActive(false); } } } public class FromOneTimeParry : MonoBehaviour { public OneTimeParry source; public Enemy enemy; public void Awake() { source = null; } public void Update() { //IL_0022: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)source != (Object)null) { ((Component)this).transform.position = ((Component)source).transform.position; } if ((Object)(object)enemy == (Object)null) { Object.Destroy((Object)(object)((Component)this).gameObject); } } } public class OneTimeParry : MonoBehaviour { [CompilerGenerated] private sealed class <GotParried>d__6 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public OneTimeParry <>4__this; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <GotParried>d__6(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(0.1f); <>1__state = 1; return true; case 1: { <>1__state = -1; Object.Destroy((Object)(object)((Component)<>4__this.mine).gameObject); <>4__this.deactivateOnParry.SetActive(false); Enemy enemy = <>4__this.enemy; if (enemy != null) { enemy.health -= <>4__this.subtractHealth; } Enemy enemy2 = <>4__this.enemy; if (enemy2 != null) { EnemyIdentifier eid = enemy2.eid; if (eid != null) { eid.health -= <>4__this.subtractHealth; } } Enemy enemy3 = <>4__this.enemy; if (enemy3 != null && enemy3.health <= 0f) { Enemy enemy4 = <>4__this.enemy; if (enemy4 != null) { EnemyIdentifier eid2 = enemy4.eid; if (eid2 != null) { eid2.SimpleDamage(0f); } } } Object.Destroy((Object)(object)<>4__this); 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(); } } public Landmine mine; public GameObject deactivateOnParry; public Enemy enemy; public float subtractHealth; public void Start() { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Unknown result type (might be due to invalid IL or missing references) mine = Object.Instantiate<GameObject>(Plugin.Prefabs["Landmine"], ((Component)this).transform.position, ((Component)this).transform.rotation).GetComponent<Landmine>(); ((Component)mine).transform.localScale = Vector3.one; FromOneTimeParry fromOneTimeParry = ((Component)mine).gameObject.AddComponent<FromOneTimeParry>(); fromOneTimeParry.source = this; fromOneTimeParry.enemy = enemy; Rigidbody component = ((Component)mine).gameObject.GetComponent<Rigidbody>(); component.isKinematic = true; mine.activated = true; AudioSource component2 = ((Component)mine).gameObject.GetComponent<AudioSource>(); component2.volume = 0f; mine.activatedBeep = null; Object.Destroy((Object)(object)((Component)mine).gameObject.GetComponent<MeshCollider>()); Object.Destroy((Object)(object)((Component)mine).gameObject.GetComponent<ProBuilderMesh>()); Object.Destroy((Object)(object)((Component)mine).gameObject.GetComponent<MeshRenderer>()); Object.Destroy((Object)(object)((Component)mine).gameObject.GetComponent<MeshFilter>()); Object.Destroy((Object)(object)((Component)((Component)mine).transform.Find("LightCylinder")).gameObject); ((Component)((Component)mine).transform.Find("ParryZone")).gameObject.SetActive(true); Transform val = ((Component)mine).transform.Find("ParryZone/V2Flash"); ((Component)val).gameObject.AddComponent<AlwaysLookAtCamera>(); val.position = ((Component)mine).transform.position; val.localScale *= 3f; } public void Update() { if (mine.parried) { ((MonoBehaviour)this).StartCoroutine(GotParried()); } } [IteratorStateMachine(typeof(<GotParried>d__6))] public IEnumerator GotParried() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <GotParried>d__6(0) { <>4__this = this }; } } public class ProjectileExplosionColor : MonoBehaviour { public Color color = new Color(1f, 0.269f, 0f, 1f); } public class PuppetName : MonoBehaviour { public string puppetName = ""; public void Start() { SaveForPuppet(); } public void SaveForPuppet() { //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Expected O, but got Unknown EnemyIdentifier componentInChildren = ((Component)this).GetComponentInChildren<EnemyIdentifier>(); if ((Object)(object)componentInChildren == (Object)null) { return; } GameObject[] activateOnDeath = componentInChildren.activateOnDeath; foreach (GameObject val in activateOnDeath) { if (((Object)val).name == "PuppetName") { return; } } GameObject val2 = new GameObject("PuppetName"); PuppetName puppetName = val2.AddComponent<PuppetName>(); puppetName.puppetName = this.puppetName; Util.ArrayAdd(ref componentInChildren.activateOnDeath, val2); } } public enum RealEnemyType { Default, Wicked, AgonyTundra, Agony, Tundra, Minos, MinosArm, Minotaur, DroneGhost, Eye, EyeYellow, EyeMalicious, BlackHoleLauncher, Disgrace, Watchtower } public class RealEnemyTypeSaver : MonoBehaviour { public RealEnemyType type = RealEnemyType.Default; public void Start() { SaveForPuppet(); } public void SaveForPuppet() { //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Expected O, but got Unknown EnemyIdentifier componentInChildren = ((Component)this).GetComponentInChildren<EnemyIdentifier>(); if ((Object)(object)componentInChildren == (Object)null) { return; } GameObject[] activateOnDeath = componentInChildren.activateOnDeath; foreach (GameObject val in activateOnDeath) { if (((Object)val).name == "RealEnemyTypeSaver") { return; } } GameObject val2 = new GameObject("RealEnemyTypeSaver"); RealEnemyTypeSaver realEnemyTypeSaver = val2.AddComponent<RealEnemyTypeSaver>(); realEnemyTypeSaver.type = type; Util.ArrayAdd(ref componentInChildren.activateOnDeath, val2); } } public class WatchtowerSpawned : MonoBehaviour { [CompilerGenerated] private sealed class <Shoot>d__21 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public int times; public WatchtowerSpawned <>4__this; private Vector3 <predictedPosition>5__1; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <Shoot>d__21(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_007f: 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_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_017c: Unknown result type (might be due to invalid IL or missing references) //IL_0186: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: { <>1__state = -1; if (times <= 0) { <>4__this.shooting = false; <>4__this.shootCooldown = 0f; return false; } <predictedPosition>5__1 = <>4__this.GetPredictedPosition(); <>4__this.currentProjectile = Object.Instantiate<GameObject>(<>4__this.projectile, <>4__this.shootPoint.position, <>4__this.shootPoint.rotation).GetComponent<Projectile>(); ((Component)<>4__this.currentProjectile).transform.LookAt(<predictedPosition>5__1); Projectile currentProjectile = <>4__this.currentProjectile; currentProjectile.damage *= <>4__this.eid.totalDamageModifier; <>4__this.currentProjectile.safeEnemyType = (EnemyType)35; <>4__this.currentProjectile.speed = <>4__this.projectileSpeed; <>4__this.currentProjectile.enemyDamageMultiplier = 0.2f; <>4__this.currentSeries.Add(<>4__this.currentProjectile); if (<>4__this.seriesParried) { <>4__this.MakeProjectileUnparriable(<>4__this.currentProjectile); } <>2__current = (object)new WaitForSeconds(0.1f / <>4__this.difficultySpeedModifier); <>1__state = 1; return true; } case 1: <>1__state = -1; ((MonoBehaviour)<>4__this).StartCoroutine(<>4__this.Shoot(times - 1)); 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(); } } public bool shooting; public Transform shootPoint; public EnemyIdentifier eid; public OneTimeParry otp; public float shootCooldown = 0f; public float shootCooldownMax = 1.5f; public const float shootCooldownMaxDefault = 1.5f; public int shootCount = 6; public float projectileSpeed = 100f; public const float projectileSpeedDefault = 100f; public float difficultySpeedModifier = 1f; public GameObject projectile = Plugin.Prefabs["Projectile"]; public Projectile currentProjectile; public List<Projectile> currentSeries = new List<Projectile>(); public bool seriesParried; public void Awake() { //IL_0016: 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) ((Component)this).transform.localScale = new Vector3(10f, 10f, 10f); if (((Object)((Component)this).transform.parent).name.Contains("Automated Gore Zone")) { ((Component)this).transform.localScale = new Vector3(15f, 20f, 15f); } StartSpheres(); shootPoint = ((Component)this).GetComponent<MortarLauncher>().shootPoint; eid = ((Component)this).GetComponent<EnemyIdentifier>(); otp = ((Component)((Component)shootPoint).transform.Find("Sphere (1)")).gameObject.AddComponent<OneTimeParry>(); otp.deactivateOnParry = ((Component)otp).gameObject; otp.enemy = ((Component)this).GetComponent<Enemy>(); otp.subtractHealth = 12f; StartDifficulty(); StartColliders(); } public void StartSpheres() { //IL_0022: 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_0090: Unknown result type (might be due to invalid IL or missing references) Transform val = ((Component)this).transform.Find("Armature/Pole_Top/Sphere (1)"); val.localScale = new Vector3(0.2f, 0.2f, 0.2f); Object.Destroy((Object)(object)((Component)val).GetComponent<ObjectActivator>()); Object.Destroy((Object)(object)((Component)val).GetComponent<ScaleTransform>()); ((Component)val).gameObject.SetActive(false); Transform val2 = val.Find("Sphere (1)"); ((Renderer)((Component)val2).GetComponent<MeshRenderer>()).material.color = new Color(1f, 1f, 0f); Object.Destroy((Object)(object)((Component)val2).GetComponent<ScaleTransform>()); val2.localScale = Vector3.one; ComponentExtensions.GetOrAddComponent<EnemySimplifier>((Component)(object)val2); ((Renderer)((Component)val2).GetComponent<MeshRenderer>()).material.EnableKeyword("ENEMY"); } public void StartDifficulty() { switch (eid.difficulty) { case 4: difficultySpeedModifier = 1f; shootCount = 5; break; case 3: difficultySpeedModifier = 0.85f; shootCount = 4; break; case 2: difficultySpeedModifier = 0.65f; shootCount = 4; break; case 1: difficultySpeedModifier = 0.4f; shootCount = 3; break; case 0: difficultySpeedModifier = 0.3f; shootCount = 3; break; default: difficultySpeedModifier = 1.15f; shootCount = 6; break; } shootCooldownMax = 1.5f / difficultySpeedModifier; projectileSpeed = 100f * difficultySpeedModifier; } public void StartColliders() { CapsuleCollider component = ((Component)((Component)this).transform.Find("Armature/Pole_Top")).GetComponent<CapsuleCollider>(); component.height = 0.6f; component.radius = 0.06f; CapsuleCollider component2 = ((Component)((Component)this).transform.Find("Armature/Pole_Middle")).GetComponent<CapsuleCollider>(); component2.height = 0.66f; component2.radius = 0.08f; CapsuleCollider component3 = ((Component)((Component)this).transform.Find("Armature/Pole_Bottom")).GetComponent<CapsuleCollider>(); component3.height = 0.66f; component3.radius = 0.1f; } public void Update() { if (!shooting) { shootCooldown += Time.deltaTime * eid.totalSpeedModifier; } if (shootCooldown >= shootCooldownMax && !shooting && !BlindEnemies.Blind && !EnemyIgnorePlayer.Active) { shooting = true; currentSeries = new List<Projectile>(); seriesParried = false; ((MonoBehaviour)this).StartCoroutine(Shoot(shootCount)); } if (currentSeries.Count > 1 && !seriesParried) { CheckParriedProjectile(); } } public void CheckParriedProjectile() { bool flag = false; Projectile val = null; foreach (Projectile item in currentSeries) { if (!Object.op_Implicit((Object)(object)item) || !item.parried) { continue; } val = item; seriesParried = true; flag = true; break; } if (!flag) { return; } foreach (Projectile item2 in currentSeries) { if (!((Object)(object)item2 == (Object)(object)val) && Object.op_Implicit((Object)(object)item2) && !((Object)(object)((Component)item2).transform == (Object)null)) { MakeProjectileUnparriable(item2); } } } [IteratorStateMachine(typeof(<Shoot>d__21))] public IEnumerator Shoot(int times) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <Shoot>d__21(0) { <>4__this = this, times = times }; } public Vector3 GetPredictedPosition() { //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_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_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_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: 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_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) Vector3 position = ((Component)MonoSingleton<NewMovement>.Instance).transform.position; Vector3 playerVelocity = MonoSingleton<PlayerTracker>.Instance.GetPlayerVelocity(false); Vector3 position2 = shootPoint.position; Vector3 val = position - position2; float num = Vector3.Dot(playerVelocity, playerVelocity) - projectileSpeed * projectileSpeed; float num2 = 2f * Vector3.Dot(playerVelocity, val); float num3 = Vector3.Dot(val, val); float num4 = num2 * num2 - 4f * num * num3; float num5 = 0f; if (num4 > 0f) { float num6 = Mathf.Sqrt(num4); float num7 = (0f - num2 + num6) / (2f * num); float num8 = (0f - num2 - num6) / (2f * num); num5 = Mathf.Max(num7, num8); if (num5 < 0f) { num5 = Mathf.Min(num7, num8); } if (num5 < 0f) { num5 = 0f; } } return position + playerVelocity * num5; } public void MakeProjectileUnparriable(Projectile proj) { //IL_0056: 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_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Expected O, but got Unknown //IL_0186: 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) if (Object.op_Implicit((Object)(object)proj) && !((Object)(object)((Component)proj).transform == (Object)null)) { proj.unparryable = true; proj.enemyDamageMultiplier = 0f; Light component = ((Component)proj).GetComponent<Light>(); if (component != null) { component.color = new Color(0.5f, 0f, 0.85f, 1f); } TrailRenderer component2 = ((Component)proj).GetComponent<TrailRenderer>(); if (component2 != null) { component2.endColor = new Color(0.65f, 0f, 0.95f, 1f); } if (component2 != null) { component2.startColor = new Color(0.4f, 0f, 0.7f, 1f); } if (component2 != null) { component2.endWidth = 1f; } MeshRenderer component3 = ((Component)((Component)proj).transform.Find("AlwaysLookAtCamera/ChargeEffect")).GetComponent<MeshRenderer>(); if (component3 != null) { ((Renderer)component3).material.color = new Color(0.7f, 0f, 0.95f, 1f); } MeshRenderer component4 = ((Component)proj).GetComponent<MeshRenderer>(); Material val = Object.Instantiate<Material>(((Renderer)component4).material); val.mainTexture = (Texture)(object)Plugin.Textures["ProjectilePurple"]; ((Renderer)component4).material = val; MaterialPropertyBlock val2 = new MaterialPropertyBlock(); ((Renderer)component4).GetPropertyBlock(val2); val2.SetTexture("_MainTex", (Texture)(object)Plugin.Textures["ProjectilePurple"]); ((Renderer)component4).SetPropertyBlock(val2); ComponentExtensions.GetOrAddComponent<ProjectileExplosionColor>((Component)(object)proj).color = new Color(0.75f, 0.2f, 1f, 1f); } } } public class WickedSpawned : MonoBehaviour { public bool active = true; public float freezeTimeMax = 5f; public float freezeTime = 0f; public bool immune = false; public float immuneTimeMax = 5f; public float immuneTime = 5f; public Animator anim; public float defaultAnimSpeed = 1f; public void Start() { anim = ((Component)this).GetComponent<Animator>(); defaultAnimSpeed = anim.speed; } public void Update() { if (!active) { immuneTime = 0f; freezeTime += Time.deltaTime; if (freezeTime >= freezeTimeMax) { freezeTime = 0f; active = true; anim.speed = defaultAnimSpeed; } } else { immuneTime += Time.deltaTime; if (immuneTime < immuneTimeMax) { immune = true; } else { immune = false; } } } } [HarmonyPatch(typeof(MortarLauncher))] public class BlackHoleMortarLauncherPatch { [HarmonyPostfix] [HarmonyPatch(typeof(MortarLauncher), "Start")] public static void StartPostfix(MortarLauncher __instance) { //IL_00c2: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)Util.FindParentWithNameContaining("BlackHoleLauncherSpawned", ((Component)__instance).transform) == (Object)null)) { __instance.eid.overrideFullName = "BLACK HOLE LAUNCHER"; __instance.eid.health = 27f; Enemy component = ((Component)__instance).GetComponent<Enemy>(); if (component != null) { component.health = 27f; } if (component != null) { component.originalHealth = 27f; } BossHealthBar component2 = ((Component)__instance).GetComponent<BossHealthBar>(); if ((Object)(object)component2 != (Object)null) { Object.Destroy((Object)(object)component2); ((Component)__instance).gameObject.AddComponent<BossHealthBar>(); } ComponentExtensions.GetOrAddComponent<PuppetName>((Component)(object)__instance).puppetName = ((Object)__instance).name; SkinnedMeshRenderer componentInChildren = ((Component)__instance).GetComponentInChildren<SkinnedMeshRenderer>(); ((Renderer)componentInChildren).material.color = new Color(0.65f, 0f, 0.8f, 1f); ((Component)__instance).gameObject.AddComponent<RealEnemyTypeSaver>().type = RealEnemyType.BlackHoleLauncher; } } [HarmonyPrefix] [HarmonyPatch(typeof(MortarLauncher), "ShootHoming")] public static bool ShootHomingPrefix(MortarLauncher __instance) { //IL_0078: 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_009a: 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_00b2: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)Util.FindParentWithNameContaining("BlackHoleLauncherSpawned", ((Component)__instance).transform) == (Object)null) { return true; } BlackHoleFromMortar[] array = Object.FindObjectsByType<BlackHoleFromMortar>((FindObjectsSortMode)0); foreach (BlackHoleFromMortar blackHoleFromMortar in array) { if ((Object)(object)blackHoleFromMortar.source == (Object)(object)__instance.eid) { return false; } } BlackHoleProjectile component = Object.Instantiate<GameObject>(Plugin.Prefabs["BlackHole"], __instance.shootPoint.position, __instance.shootPoint.rotation).GetComponent<BlackHoleProjectile>(); Transform transform = ((Component)component).transform; transform.localScale *= 3f; component.safeType = (EnemyType)35; component.Activate(); component.speed = 8f * __instance.eid.totalDamageModifier; ((Component)component).gameObject.AddComponent<BlackHoleFromMortar>().source = __instance.eid; if (Object.op_Implicit((Object)(object)__instance.anim)) { __instance.anim.Play("Shoot", 0, 0f); } return false; } } [HarmonyPatch(typeof(BlackHoleProjectile))] public class BlackHoleProjectilePatch { [HarmonyPrefix] [HarmonyPatch(typeof(BlackHoleProjectile), "ShootTargetLightning")] public static bool ShootTargetLightningPrefix(BlackHoleProjectile __instance) { BlackHoleFromMortar component = ((Component)__instance).GetComponent<BlackHoleFromMortar>(); return (Object)(object)component == (Object)null; } [HarmonyPostfix] [HarmonyPatch(typeof(BlackHoleProjectile), "Start")] public static void StartPostfix(BlackHoleProjectile __instance) { SimplePortalTraveler orAddComponent = ComponentExtensions.GetOrAddComponent<SimplePortalTraveler>((Component)(object)__instance); orAddComponent.travellerType = (PortalTravellerType)(__instance.enemy ? 4 : 2); } } [HarmonyPatch] public class DeadcaughtEnemyPatch { [HarmonyPostfix] [HarmonyPatch(typeof(Deathcatcher), "EnemyDeath")] public static void EnemyDeathPostfix(EnemyIdentifier eid, Deathcatcher __instance) { if (__instance.deadCaughtEnemies.Count == 0) { return; } List<CaughtEnemy> deadCaughtEnemies = __instance.deadCaughtEnemies; CaughtEnemy val = deadCaughtEnemies[deadCaughtEnemies.Count - 1]; GameObject[] activateOnDeath = val.original.activateOnDeath; foreach (GameObject val2 in activateOnDeath) { if (((Object)val2).name == "RealEnemyTypeSaver") { RealEnemyType type = val2.GetComponent<RealEnemyTypeSaver>().type; if (Plugin.SpawnableObjects.ContainsKey(type) && (Object)(object)Plugin.SpawnableObjects[type] != (Object)null) { ((SavedGeneric)val.savedEnemy).Spawnable = Plugin.SpawnableObjects[type]; } } } List<CaughtEnemy> deadCaughtEnemies2 = __instance.deadCaughtEnemies; deadCaughtEnemies2[deadCaughtEnemies2.Count - 1] = val; } [HarmonyPrefix] [HarmonyPatch(typeof(CaughtEnemy), "UpdatePuppet")] public static void UpdatePuppetPrefix(GameObject newPuppet, CaughtEnemy __instance) { ReaddComponents(newPuppet, __instance.original); } public static void ReaddComponents(GameObject puppet, EnemyIdentifier original) { GameObject[] activateOnDeath = original.activateOnDeath; foreach (GameObject val in activateOnDeath) { string name = ((Object)val).name; string text = name; if (!(text == "PuppetName")) { if (text == "RealEnemyTypeSaver") { RealEnemyTypeSaver component = val.GetComponent<RealEnemyTypeSaver>(); RealEnemyTypeSaver orAddComponent = GameObjectExtensions.GetOrAddComponent<RealEnemyTypeSaver>(puppet); orAddComponent.type = component.type; } continue; } PuppetName component2 = val.GetComponent<PuppetName>(); PuppetName orAddComponent2 = GameObjectExtensions.GetOrAddComponent<PuppetName>(puppet); orAddComponent2.puppetName = component2.puppetName; if (orAddComponent2.puppetName != "") { ((Object)puppet).name = orAddComponent2.puppetName; } } } } [HarmonyPatch(typeof(MaliciousFace))] public class DisgraceMaliciousFacePatch { [CompilerGenerated] private sealed class <DisgraceDeath>d__0 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Transform tr; private Vector3 <pos>5__1; private Quaternion <rot>5__2; private Transform <gib>5__3; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <DisgraceDeath>d__0(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <gib>5__3 = null; <>1__state = -2; } private bool MoveNext() { //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Expected O, but got Unknown //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: 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_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Expected O, but got Unknown //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(1f); <>1__state = 1; return true; case 1: <>1__state = -1; <pos>5__1 = tr.position; <rot>5__2 = tr.rotation; Object.Instantiate<GameObject>(Plugin.Prefabs["Explosion"], <pos>5__1, <rot>5__2); <>2__current = (object)new WaitForSeconds(0.1f); <>1__state = 2; return true; case 2: <>1__state = -1; <gib>5__3 = Object.Instantiate<GameObject>(Plugin.Prefabs["BrainGib"], <pos>5__1 + new Vector3(0f, -3f, 0f), <rot>5__2).transform; <gib>5__3.localScale = new Vector3(1.5f, 1.5f, 4.5f); Object.Destroy((Object)(object)((Component)tr.parent.parent).gameObject); 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(); } } [IteratorStateMachine(typeof(<DisgraceDeath>d__0))] public static IEnumerator DisgraceDeath(Transform tr) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <DisgraceDeath>d__0(0) { tr = tr }; } [HarmonyPostfix] [HarmonyPatch(typeof(MaliciousFace), "Start")] public static void StartPostfix(MaliciousFace __instance) { if (!((Object)(object)Util.FindParentWithNameContaining("DisgraceSpawned", ((Component)__instance).transform) == (Object)null)) { __instance.eid.overrideFullName = "DISGRACE"; __instance.eid.health = 20f; __instance.spider.health = 20f; __instance.spider.originalHealth = 20f; BossHealthBar component = ((Component)__instance).GetComponent<BossHealthBar>(); if ((Object)(object)component != (Object)null) { Object.Destroy((Object)(object)component); ((Component)__instance).gameObject.AddComponent<BossHealthBar>(); } ((Component)__instance).gameObject.AddComponent<DisgraceSpawned>(); ((Component)__instance).gameObject.AddComponent<RealEnemyTypeSaver>().type = RealEnemyType.Disgrace; } } [HarmonyPrefix] [HarmonyPatch(typeof(MaliciousFace), "Die")] public static bool DiePrefix(MaliciousFace __instance) { if ((Object)(object)((Component)__instance).gameObject.GetComponent<DisgraceSpawned>() == (Object)null) { return true; } ((MonoBehaviour)__instance).StartCoroutine(DisgraceDeath(((Component)__instance).transform)); return false; } [HarmonyPrefix] [HarmonyPatch(typeof(MaliciousFace), "Update")] public static bool UpdatePrefix(MaliciousFace __instance) { if ((Object)(object)((Component)__instance).gameObject.GetComponent<DisgraceSpawned>() == (Object)null) { return true; } return false; } } [HarmonyPatch(typeof(DroneFlesh), "Start")] public class DroneFleshPatch { public static void Postfix(DroneFlesh __instance) { //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) string name = ((Object)((Component)__instance).transform.parent).name; if (!name.Contains("Spawned") || (!name.Contains("DroneFlesh") && !name.Contains("DroneSkull"))) { return; } FleshPrison[] array = Object.FindObjectsByType<FleshPrison>((FindObjectsSortMode)0); if (array.Length == 0) { return; } FleshPrison val = array[0]; FleshPrison[] array2 = array; foreach (FleshPrison val2 in array2) { float num = Vector3.Distance(((Component)__instance).transform.position, ((Component)val2).transform.position); float num2 = Vector3.Distance(((Component)__instance).transform.position, ((Component)val).transform.position); if (num < num2) { val = val2; } } val.currentDrones.Add(__instance); if (val.healing) { LineToPoint val3 = default(LineToPoint); if (Object.Instantiate<GameObject>(val.healingTargetEffect, ((Component)__instance).transform).TryGetComponent<LineToPoint>(ref val3)) { val3.targets[1] = val.rotationBone; } Rigidbody val4 = default(Rigidbody); if (((Component)__instance).TryGetComponent<Rigidbody>(ref val4)) { val4.isKinematic = true; } } } } public class FireSizeReduced : MonoBehaviour { } [HarmonyPatch(typeof(Flammable), "Burn")] public class FlammablePatch { public static void Postfix(Flammable __instance) { //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_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_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)__instance.currentFire == (Object)null) && !((Object)(object)__instance.currentFire.GetComponent<FireSizeReduced>() != (Object)null)) { if ((Object)(object)Util.FindParentWithNameContaining("DisgraceSpawned", ((Component)__instance).transform) != (Object)null) { Vector3 localScale = __instance.currentFire.transform.localScale; __instance.currentFire.transform.localScale = new Vector3(localScale.x, localScale.y * 0.5f, localScale.z); GameObjectExtensions.GetOrAddComponent<FireSizeReduced>(__instance.currentFire); } else if ((Object)(object)Util.FindParentWithNameContaining("WatchtowerSpawned", ((Component)__instance).transform) != (Object)null) { Vector3 localScale2 = __instance.currentFire.transform.localScale; __instance.currentFire.transform.localScale = new Vector3(localScale2.x * 0.6f, localScale2.y * 0.75f, localScale2.z * 0.6f); GameObjectExtensions.GetOrAddComponent<FireSizeReduced>(__instance.currentFire); } else if ((Object)(object)Util.FindParentWithNameContaining("Very Cancerous Rodent", ((Component)__instance).transform) != (Object)null) { Transform transform = __instance.currentFire.transform; transform.localScale *= 0.25f; GameObjectExtensions.GetOrAddComponent<FireSizeReduced>(__instance.currentFire); } } } } [HarmonyPatch(typeof(GhostDrone))] public class GhostDronePatch { [HarmonyPostfix] [HarmonyPatch(typeof(GhostDrone), "Start")] public static void StartPostfix(GhostDrone __instance) { if (!((Object)(object)Util.FindParentWithNameContaining("DroneGhostSpawned", ((Component)__instance).transform) == (Object)null)) { ((Component)((Component)__instance).transform.Find("Armature/Root/GhostDrone_GlowPlane")).gameObject.SetActive(true); } } } [HarmonyPatch(typeof(KillAllEnemies))] public class KillAllEnemiesPatch { public static void KillEnemy<T>() where T : MonoBehaviour { T[] array = Object.FindObjectsByType<T>((FindObjectsSortMode)0); T[] array2 = array; foreach (T val in array2) { Object.Destroy((Object)(object)((Component)(object)val).gameObject); } } [HarmonyPrefix] [HarmonyPatch(typeof(KillAllEnemies), "Enable")] public static void EnablePrefix(CheatsManager manager) { KillAllEnemiesPatch.KillEnemy<Wicked>(); KillAllEnemiesPatch.KillEnemy<GhostDrone>(); KillAllEnemiesPatch.KillEnemy<MinosArm>(); FromOneTimeParry[] array = Object.FindObjectsByType<FromOneTimeParry>((FindObjectsSortMode)0); foreach (FromOneTimeParry fromOneTimeParry in array) { Object.Destroy((Object)(object)((Component)fromOneTimeParry).gameObject); } } } [HarmonyPatch(typeof(Landmine))] public class LandminePatch { [HarmonyPrefix] [HarmonyPatch(typeof(Landmine), "Parry")] public static bool SetColorPrefix(Landmine __instance) { FromOneTimeParry component = ((Component)__instance).GetComponent<FromOneTimeParry>(); if ((Object)(object)component == (Object)null) { return true; } __instance.parried = true; return false; } } [HarmonyPatch(typeof(MinosArm), "Retreat")] public class MinosArmPatch { public static void Prefix(MinosArm __instance) { if (!((Object)(object)Util.FindParentWithNameContaining("MinosArmSpawned", ((Component)__instance).transform) == (Object)null)) { Object.Destroy((Object)(object)((Component)__instance).gameObject); } } } [HarmonyPatch(typeof(MinotaurChase))] public class MinotaurChasePatch { [HarmonyPrefix] [HarmonyPatch(typeof(MinotaurChase), "Start")] public static void StartPrefix(MinotaurChase __instance) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)Util.FindParentWithNameContaining("MinotaurSpawned", ((Component)__instance).transform) == (Object)null)) { __instance.leashPosition = ((Component)__instance).transform.position; __instance.trackTarget = false; __instance.eid = ((Component)__instance).GetComponent<EnemyIdentifier>(); __instance.eid.isBoss = false; } } [HarmonyPrefix] [HarmonyPatch(typeof(MinotaurChase), "Update")] public static bool UpdatePrefix(MinotaurChase __instance) { if (!((Object)(object)Util.FindParentWithNameContaining("MinotaurSpawned", ((Component)__instance).transform) != (Object)null) || !(__instance.eid.health <= 0f)) { return true; } Object.Destroy((Object)(object)((Component)((Component)__instance).transform.parent).gameObject); return false; } } [HarmonyPatch] public class OutlinePatch { [HarmonyPostfix] [HarmonyPatch(typeof(DroneFlesh), "Start")] public static void DroneFleshPostfix(DroneFlesh __instance) { if (((Object)__instance).name.Contains("DroneFlesh")) { MeshRenderer component = ((Component)((Component)__instance).transform.Find("Gib_Eyeball")).GetComponent<MeshRenderer>(); ((Renderer)component).material.EnableKeyword("ENEMY"); } } } [HarmonyPatch(typeof(Projectile), "CreateExplosionEffect")] public class ProjectilePatch { public static bool Prefix(Projectile __instance) { //IL_0043: 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_0126: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_01b1: Unknown result type (might be due to invalid IL or missing references) ProjectileExplosionColor component = ((Component)__instance).GetComponent<ProjectileExplosionColor>(); if ((Object)(object)component == (Object)null) { return true; } if ((Object)(object)__instance.explosionEffect == (Object)null) { return false; } GameObject val = Object.Instantiate<GameObject>(__instance.explosionEffect, ((Component)__instance).transform.position, ((Component)__instance).transform.rotation); Explosion[] componentsInChildren = val.GetComponentsInChildren<Explosion>(); Explosion[] array = componentsInChildren; foreach (Explosion val2 in array) { val2.sourceWeapon = __instance.sourceWeapon ?? val2.sourceWeapon; if (val2.damage != 0 && ((!__instance.friendly && !__instance.playerBullet) || (float)val2.damage < __instance.damage)) { val2.damage = (int)__instance.damage; } if (!__instance.friendly && !__instance.playerBullet) { val2.enemy = true; } val2.boosted = __instance.boosted; } ParticleSystem component2 = val.GetComponent<ParticleSystem>(); if ((Object)(object)component2 != (Object)null) { MainModule main = component2.main; MinMaxGradient startColor = ((MainModule)(ref main)).startColor; ((MinMaxGradient)(ref startColor)).color = component.color; ((MinMaxGradient)(ref startColor)).colorMax = component.color; component2.startColor = component.color; } if (!val.activeSelf) { val.SetActive(true); } val.transform.SetParent(((Component)__instance).transform.parent, true); if (__instance.boosted || __instance.parried) { MonoSingleton<StainVoxelManager>.Instance.TryIgniteAt(((Component)__instance).transform.position, 3); } return false; } } [HarmonyPatch(typeof(SpawnableObjectExtensions), "InstantiateSpawnable")] public class SpawnableObjectExtensionsPatch { public static bool Prefix(SpawnableObject spawnable, SavedGeneric saved, Transform parent, bool newSizing, ref SpawnableInstance __result) { //IL_001a: 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_0074: 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_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Invalid comparison between Unknown and I4 //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Expected O, but got Unknown //IL_02da: Unknown result type (might be due to invalid IL or missing references) //IL_02e0: Invalid comparison between Unknown and I4 //IL_02a7: Unknown result type (might be due to invalid IL or missing references) //IL_0300: Unknown result type (might be due to invalid IL or missing references) SavedBlock val = (SavedBlock)(object)((saved is SavedBlock) ? saved : null); GameObject val2; bool flag; if (val != null) { val2 = SandboxUtils.CreateFinalBlock(spawnable, ((SavedGeneric)val).Position.ToVector3(), val.BlockSize.ToVector3(), spawnable.isWater); flag = true; if ((Object)(object)parent != (Object)null) { val2.transform.SetParent(parent, true); } } else { val2 = Object.Instantiate<GameObject>(spawnable.gameObject, parent, true); flag = false; } val2.transform.position = saved.Position.ToVector3(); if (!flag && !newSizing) { val2.transform.localScale = saved.Scale.ToVector3(); } KeepInBounds val3 = default(KeepInBounds); if (val2.TryGetComponent<KeepInBounds>(ref val3)) { val3.ForceApproveNewPosition(); } SpawnableInstance val5; if ((int)spawnable.spawnableObjectType == 1) { SavedEnemy val4 = (SavedEnemy)(object)((saved is SavedEnemy) ? saved : null); if (val4 == null) { SpawnableObjectExtensions.Log.Error("Provided SavedGeneric object is not of type SavedEnemy, while SpawnableObject.spawnableObjectType is Enemy.", (IEnumerable<Tag>)null, (string)null, (object)null); throw new ArgumentException("Invalid SavedGeneric type for Enemy spawnable object."); } val5 = (SpawnableInstance)(object)val2.GetComponentInChildren<EnemySpawnableInstance>(true); if ((Object)(object)val5 == (Object)null) { val5 = (SpawnableInstance)(object)GameObjectExtensions.GetOrAddComponent<EnemySpawnableInstance>(val2); } EnemySpawnableInstance val6 = (EnemySpawnableInstance)val5; ((SpawnableInstance)val6).sourceObject = spawnable; if ((Object)(object)val6.eid == (Object)null) { EnemySimplifier[] componentsInChildren = val2.GetComponentsInChildren<EnemySimplifier>(true); EnemySimplifier[] array = componentsInChildren; foreach (EnemySimplifier val7 in array) { val7.Awake(); val7.eid = val2.GetComponentInChildren<EnemyIdentifier>(true); Dictionary<MaterialState, Material> materialDict = val7.materialDict; if (materialDict[(MaterialState)3] == null) { Material val9 = (materialDict[(MaterialState)3] = val7.materialDict[(MaterialState)2]); } } ((SpawnableInstance)val6).Awake(); val2.GetComponentInChildren<Enemy>(true).Awake(); Transform val10 = Util.FindParentWithNameContaining("Spawned", val2.transform); if ((Object)(object)val10 != (Object)null) { ((Component)val10).gameObject.SetActive(true); if ((Object)(object)val10.parent != (Object)null && ((Object)val10.parent).name.Contains("Spawned")) { ((Component)val10.parent).gameObject.SetActive(true); } } } val6.eid.checkingSpawnStatus = false; val6.RestoreRadiance(val4.Radiance); } else { val5 = GameObjectExtensions.GetOrAddComponent<SpawnableInstance>(val2); val5.sourceObject = spawnable; } SavedPhysical val11 = (SavedPhysical)(object)((saved is SavedPhysical) ? saved : null); if (val11 != null && val11.Kinematic) { val5.Pause(true); } if (!flag && newSizing) { val5.SetSize(saved.Scale.ToVector3()); } val5.disallowManipulation = saved.DisallowManipulation; val5.disallowFreezing = saved.DisallowFreezing; SpawnableObjectExtensions.ApplyData(val2, saved.Data); if ((int)spawnable.spawnableObjectType == 1 && Object.op_Implicit((Object)(object)MonoSingleton<SandboxNavmesh>.Instance)) { MonoSingleton<SandboxNavmesh>.Instance.EnsurePositionWithinBounds(val2.transform.position); } __result = val5; return false; } } [HarmonyPatch(typeof(MortarLauncher))] public class WatchtowerMortarLauncherPatch { [CompilerGenerated] private sealed class <ShowSphere>d__0 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Transform tr; private Transform <objSphere>5__1; private Transform <subSphere>5__2; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <ShowSphere>d__0(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <objSphere>5__1 = null; <subSphere>5__2 = null; <>1__state = -2; } private bool MoveNext() { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Expected O, but got Unknown //IL_007d: 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) switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(0.85f); <>1__state = 1; return true; case 1: <>1__state = -1; <objSphere>5__1 = tr.Find("Armature/Pole_Top/Sphere (1)"); ((Component)<objSphere>5__1).gameObject.SetActive(true); <objSphere>5__1.localScale = new Vector3(0.15f, 0.2f, 0.2f); <objSphere>5__1.localPosition = new Vector3(-0.45f, 0f, 0f); <subSphere>5__2 = <objSphere>5__1.Find("Sphere (1)"); ((Component)<subSphere>5__2).gameObject.SetActive(true); 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(); } } [IteratorStateMachine(typeof(<ShowSphere>d__0))] public static IEnumerator ShowSphere(Transform tr) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <ShowSphere>d__0(0) { tr = tr }; } [HarmonyPostfix] [HarmonyPatch(typeof(MortarLauncher), "Start")] public static void StartPostfix(MortarLauncher __instance) { if (!((Object)(object)Util.FindParentWithNameContaining("WatchtowerSpawned", ((Component)__instance).transform) == (Object)null)) { __instance.eid.overrideFullName = "WATCHTOWER"; __instance.eid.health = 30f; Enemy component = ((Component)__instance).GetComponent<Enemy>(); if (component != null) { component.health = 30f; } if (component != null) { component.originalHealth = 30f; } BossHealthBar component2 = ((Component)__instance).GetComponent<BossHealthBar>(); if ((Object)(object)component2 != (Object)null) { Object.Destroy((Object)(object)component2); ((Component)__instance).gameObject.AddComponent<BossHealthBar>(); } ((Component)__instance).gameObject.AddComponent<WatchtowerSpawned>(); ((Component)__instance).gameObject.AddComponent<RealEnemyTypeSaver>().type = RealEnemyType.Watchtower; ComponentExtensions.GetOrAddComponent<PuppetName>((Component)(object)__instance).puppetName = ((Object)__instance).name; ((MonoBehaviour)__instance).StartCoroutine(ShowSphere(((Component)__instance).transform)); } } [HarmonyPrefix] [HarmonyPatch(typeof(MortarLauncher), "Update")] public static bool UpdatePrefix(MortarLauncher __instance) { if ((Object)(object)((Component)__instance).gameObject.GetComponent<WatchtowerSpawned>() != (Object)null) { return false; } return true; } } [HarmonyPatch(typeof(Wicked))] public class WickedPatch { [HarmonyPostfix] [HarmonyPatch(typeof(Wicked), "Start")] public static void StartPostfix(Wicked __instance) { if (!((Object)(object)Util.FindParentWithNameContaining("WickedSpawned", ((Component)__instance).transform) == (Object)null)) { ((Component)__instance).gameObject.AddComponent<WickedSpawned>(); } } [HarmonyPrefix] [HarmonyPatch(typeof(Wicked), "Update")] public static bool UpdatePrefix(Wicked __instance) { WickedSpawned component = ((Component)__instance).gameObject.GetComponent<WickedSpawned>(); if ((Object)(object)component != (Object)null && !component.active) { return false; } if (BlindEnemies.Blind || EnemyIgnorePlayer.Active) { return false; } __instance.playerSpotTime = 999f; return true; } [HarmonyPrefix] [HarmonyPatch(typeof(Wicked), "OnCollisionEnter")] public static bool OnCollisionEnterPrefix(Wicked __instance) { if ((Object)(object)Util.FindParentWithNameContaining("WickedSpawned", ((Component)__instance).transform) == (Object)null) { return true; } WickedSpawned component = ((Component)__instance).gameObject.GetComponent<WickedSpawned>(); if (!component.active) { return false; } return true; } [HarmonyPrefix] [HarmonyPatch(typeof(Wicked), "GetHit")] public static bool GetHitPrefix(Wicked __instance) { if (!((Component)__instance).gameObject.activeInHierarchy) { return false; } WickedSpawned component = ((Component)__instance).gameObject.GetComponent<WickedSpawned>(); if ((Object)(object)component == (Object)null) { return true; } if (!component.immune) { component.active = false; ((Component)__instance).gameObject.GetComponent<Animator>().speed = 0f; ((Component)__instance).gameObject.GetComponent<NavMeshAgent>().speed = 0f; } return false; } } [HarmonyPatch] public class NavMeshStuff { [HarmonyPrefix] [HarmonyPatch(typeof(SandboxNavmesh), "Rebake")] public static bool SandboxNavmeshRebakePrefix(SandboxNavmesh __instance) { if (Util.IsSandbox()) { return true; } BrushBlock[] array = Object.FindObjectsByType<BrushBlock>((FindObjectsInactive)1, (FindObjectsSortMode)0); BrushBlock[] array2 = array; foreach (BrushBlock val in array2) { if (!((Object)(object)((Component)val).transform.parent == (Object)(object)((Component)__instance.surface).transform)) { ((Component)val).transform.SetParent(((Component)__instance.surface).transform); } } SandboxProp[] array3 = Object.FindObjectsByType<SandboxProp>((FindObjectsInactive)1, (FindObjectsSortMode)0); SandboxProp[] array4 = array3; foreach (SandboxProp val2 in array4) { if (!((Object)(object)((Component)val2).transform.parent == (Object)(object)((Component)__instance.surface).transform)) { ((Component)val2).transform.SetParent(((Component)__instance.surface).transform); } } __instance.surface.BuildNavMesh(); SandboxNavmesh.Log.Info("Navmesh built", (IEnumerable<Tag>)null, (string)null, (object)null); __instance.isDirty = false; MonoSingleton<SandboxHud>.Instance.HideNavmeshNotice(); if (__instance.navmeshBuilt != null) { __instance.navmeshBuilt.Invoke(); } MonoSingleton<CheatsManager>.Instance.RenderCheatsInfo(); return false; } } [HarmonyPatch(typeof(PresenceController), "SceneManagerOnsceneLoaded")] public class PresencePatch { public static bool Prefix(Scene _, LoadSceneMode mode) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Invalid comparison between Unknown and I4 //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) if ((int)mode == 1) { return false; } string currentScene = SceneHelper.CurrentScene; PresenceController.Log.Info("Scene loaded: " + currentScene, (IEnumerable<Tag>)null, (string)null, (object)null); DiscordController.Instance.FetchSceneActivity(currentScene); SteamController.Instance.FetchSceneActivity(currentScene); if ((Object)(object)MapInfoBase.Instance != (Object)null && currentScene == "uk_construct") { if (!MonoSingleton<PresenceController>.Instance.trackingTimeInSandbox) { PresenceController.Log.Info("Starting sandbox time tracking", (IEnumerable<Tag>)null, (string)null, (object)null); MonoSingleton<PresenceController>.Instance.trackingTimeInSandbox = true; MonoSingleton<PresenceController>.Instance.timeInSandbox = TimeSince.op_Implicit(0f); } } else if (MonoSingleton<PresenceController>.Instance.trackingTimeInSandbox) { PresenceController.Log.Info("Submitting sandbox time", (IEnumerable<Tag>)null, (string)null, (object)null); MonoSingleton<PresenceController>.Instance.trackingTimeInSandbox = false; SteamController.Instance.UpdateTimeInSandbox(TimeSince.op_Implicit(MonoSingleton<PresenceController>.Instance.timeInSandbox)); } return false; } } [HarmonyPatch] public class SandboxOnlyStuff { [HarmonyPrefix] [HarmonyPatch(typeof(SpawnMenu), "RebuildMenu")] public static void SpawnMenuRebuildMenuPrefix() { MapInfoBase.Instance.sandboxTools = true; } [HarmonyPrefix] [HarmonyPatch(typeof(CheatsManager), "Start")] [HarmonyPriority(200)] public static bool CheatsManagerStartPrefix(CheatsManager __instance) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Expected O, but got Unknown //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Expected O, but got Unknown //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Expected O, but got Unknown //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Expected O, but got Unknown //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Expected O, but got Unknown //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Expected O, but got Unknown //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Expected O, but got Unknown //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Expected O, but got Unknown //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Expected O, but got Unknown //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Expected O, but got Unknown //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Expected O, but got Unknown //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Expected O, but got Unknown //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Expected O, but got Unknown //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Expected O, but got Unknown //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Expected O, but got Unknown //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Expected O, but got Unknown //IL_0186: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Expected O, but got Unknown //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Expected O, but got Unknown //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Expected O, but got Unknown //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Expected O, but got Unknown //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Expected O, but got Unknown //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Expected O, but got Unknown //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Expected O, but got Unknown //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Expected O, but got Unknown //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Expected O, but got Unknown //IL_01ad: Unknown result type (might be due to invalid IL or missing references) //IL_01bc: Expected O, but got Unknown //IL_01e3: Unknown result type (might be due to invalid IL or missing references) //IL_01e9: Expected O, but got Unknown //IL_01eb: Unknown result type (might be due to invalid IL or missing references) //IL_01f1: Expected O, but got Unknown //IL_01f3: Unknown result type (might be due to invalid IL or missing references) //IL_01f9: Expected O, but got Unknown //IL_01fb: Unknown result type (might be due to invalid IL or missing references) //IL_0201: Expected O, but got Unknown //IL_0203: Unknown result type (might be due to invalid IL or missing references) //IL_0209: Expected O, but got Unknown //IL_020b: Unknown result type (might be due to invalid IL or missing references) //IL_0211: Expected O, but got Unknown //IL_0213: Unknown result type (might be due to invalid IL or missing references) //IL_0219: Expected O, but got Unknown //IL_021b: Unknown result type (might be due to invalid IL or missing references) //IL_0221: Expected O, but got Unknown //IL_022d: Unknown result type (might be due to invalid IL or missing references) //IL_023c: Expected O, but got Unknown //IL_01c9: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: Expected O, but got Unknown __instance.RebuildIcons(); __instance.RegisterCheat((ICheat)new KeepEnabled(), "meta"); if ((Object)(object)MapInfoBase.Instance != (Object)null) { __instance.RegisterCheat((ICheat)new ExperimentalArmRotation(), "sandbox"); __instance.RegisterCheat((ICheat)new QuickSave(), "sandbox"); __instance.RegisterCheat((ICheat)new QuickLoad(), "sandbox"); __instance.RegisterCheat((ICheat)new ManageSaves(), "sandbox"); __instance.RegisterCheat((ICheat)new ClearMap(), "sandbox"); __instance.RegisterCheat((ICheat)new RebuildNavmesh(), "sandbox"); __instance.RegisterCheats((ICheat[])(object)new ICheat[2] { (ICheat)new Snapping(), (ICheat)new SpawnPhysics() }, "sandbox"); } __instance.RegisterCheats((ICheat[])(object)new ICheat[4] { (ICheat)new SummonSandboxArm(), (ICheat)new TeleportMenu(), (ICheat)new FullBright(), (ICheat)new Invincibility() }, "general"); __instance.RegisterCheats((ICheat[])(object)new ICheat[3] { (ICheat)new Noclip(), (ICheat)new Flight(), (ICheat)new InfiniteWallJumps() }, "movement"); __instance.RegisterCheats((ICheat[])(object)new ICheat[2] { (ICheat)new NoWeaponCooldown(), (ICheat)new InfinitePowerUps() }, "weapons"); __instance.RegisterCheats((ICheat[])(object)new ICheat[6] { (ICheat)new BlindEnemies(), (ICheat)new EnemiesHateEnemies(), (ICheat)new EnemyIgnorePlayer(), (ICheat)new DisableEnemySpawns(), (ICheat)new InvincibleEnemies(), (ICheat)new KillAllEnemies() }, "enemies"); __instance.RegisterCheats((ICheat[])(object)new ICheat[2] { (ICheat)new HideWeapons(), (ICheat)new HideUI() }, "visual"); bool flag = false; if (GameProgressSaver.GetClashModeUnlocked() && !flag) { __instance.RegisterCheat((ICheat)new CrashMode(), "special"); } if (GameProgressSaver.GetGhostDroneModeUnlocked()) { __instance.RegisterCheat((ICheat)new GhostDroneMode(), "special"); } __instance.RegisterCheats((ICheat[])(object)new ICheat[8] { (ICheat)new PlayerParentingDebug(), (ICheat)new StateDebug(), (ICheat)new GunControlDebug(), (ICheat)new SandboxArmDebug(), (ICheat)new EnemyIdentifierDebug(), (ICheat)new ForceBossBars(), (ICheat)new SpreadGasoline(), (ICheat)new DeathCatcherDebug() }, "debug"); __instance.RegisterCheat((ICheat)new PauseTimedBombs(), "debug"); MonoSingleton<CheatBinds>.Instance.RestoreBinds(__instance.allRegisteredCheats); __instance.RebuildMenu(); return false; } [HarmonyPrefix] [HarmonyPatch(typeof(SandboxSaver), "Clear")] public static bool SandboxSaverClearPrefix() { if (Util.IsSandbox()) { return true; } DefaultSandboxCheckpoint instance = MonoSingleton<DefaultSandboxCheckpoint>.Instance; if (!((Object)(object)instance == (Object)null)) { MonoSingleton<StatsManager>.Instance.currentCheckPoint = instance.checkpoint; } SpawnableInstance[] array = Object.FindObjectsOfType<SpawnableInstance>(); SpawnableInstance[] array2 = array; foreach (SpawnableInstance val in array2) { if (((Behaviour)val).enabled) { Object.Destroy((Object)(object)((Component)val).gameObject); } } Resources.UnloadUnusedAssets(); MonoSingleton<SandboxNavmesh>.Instance.ResetSizeToDefault(); MonoSingleton<SandboxSaver>.Instance.activeSave = null; MonoSingleton<CheatsManager>.Instance.RefreshCheatStates(); return false; } [HarmonyPrefix] [HarmonyPatch(typeof(SandboxSaver), "Load")] public static bool SandboxSaverLoadPrefix(string name, SandboxSaver __instance) { //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_01b7: Unknown result type (might be due to invalid IL or missing references) //IL_01cc: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Unknown result type (might be due to invalid IL or missing references) //IL_0141: 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) if (Util.IsSandbox()) { return true; } SandboxSaver.Log.Info("Loading save: " + name, (IEnumerable<Tag>)null, (string)null, (object)null); SandboxSaver.SetupDirs(); SandboxSaver.Clear(); __instance.activeSave = name; MonoSingleton<CheatsManager>.Instance.RefreshCheatStates(); __instance.RebuildObjectList(); SandboxSaveData val = JsonConvert.DeserializeObject<SandboxSaveData>(File.ReadAllText(Path.Combine(SandboxSaver.SavePath, name + ".pitr"))); SandboxSaver.Log.Fine($"Loaded {val.Blocks.Length} blocks\nLoaded {val.Props.Length} props", (IEnumerable<Tag>)null, (string)null, (object)null); SandboxSaver.Log.Fine("Save Version: " + val.SaveVersion, (IEnumerable<Tag>)null, (string)null, (object)null); Vector3? val2 = null; Vector3 position = ((Component)MonoSingleton<NewMovement>.Instance).transform.position; SavedProp[] props = val.Props; SavedProp[] array = props; foreach (SavedProp val3 in array) { __instance.RecreateProp(val3, val.SaveVersion > 1); if (!(((SavedGeneric)val3).ObjectIdentifier != "ultrakill.spawn-point")) { if (!val2.HasValue) { val2 = ((SavedGeneric)val3).Position.ToVector3(); } else if (Vector3.Distance(position, ((SavedGeneric)val3).Position.ToVector3()) < Vector3.Distance(position, val2.Value)) { val2 = ((SavedGeneric)val3).Position.ToVector3(); } } } if (val2.HasValue) { ((Component)MonoSingleton<NewMovement>.Instance).transform.position = val2.Value; MonoSingleton<NewMovement>.Instance.rb.velocity = Vector3.zero; } SavedBlock[] blocks = val.Blocks; SavedBlock[] array2 = blocks; foreach (SavedBlock val4 in array2) { __instance.RecreateBlock(val4); } MonoSingleton<SandboxNavmesh>.Instance.Rebake(); List<EnemySpawnableInstance> list = new List<EnemySpawnableInstance>(); SavedEnemy[] enemies = val.Enemies; SavedEnemy[] array3 = enemies; foreach (SavedEnemy val5 in array3) { EnemySpawnableInstance val6 = __instance.RecreateEnemy((SavedGeneric)(object)val5, val.SaveVersion > 1); ((SpawnableInstance)val6).Pause(false); list.Add(val6); } ((MonoBehaviour)__instance).StartCoroutine(__instance.PostLoadAndBake(list)); return false; } } [BepInPlugin("billy.spawnerarmextras", "SpawnerArmExtras", "5.0.2")] public class Plugin : BaseUnityPlugin { [CompilerGenerated] private sealed class <AddSandboxNavMesh>d__13 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; private GameObject <obj>5__1; private NavMeshSurface <surface>5__2; private SandboxNavmesh <snm>5__3; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <AddSandboxNavMesh>d__13(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <obj>5__1 = null; <surface>5__2 = null; <snm>5__3 = null; <>1__state = -2; } private bool MoveNext() { //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Expected O, but got Unknown //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Expected O, but got Unknown //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(1f); <>1__state = 1; return true; case 1: <>1__state = -1; <obj>5__1 = new GameObject("SandboxNavMesh"); <obj>5__1.SetActive(false); <surface>5__2 = <obj>5__1.AddComponent<NavMeshSurface>(); <surface>5__2.useGeometry = (NavMeshCollectGeometry)1; <surface>5__2.collectObjects = (CollectObjects)2; <surface>5__2.voxelSize = 0.1667f; <surface>5__2.layerMask = LayerMask.op_Implicit(16777664); <snm>5__3 = <obj>5__1.AddComponent<SandboxNavmesh>(); <snm>5__3.surface = <surface>5__2; <obj>5__1.SetActive(true); <>2__current = (object)new WaitForSeconds(0.1f); <>1__state = 2; return true; case 2: <>1__state = -1; 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 readonly Harmony Harmony = new Harmony("billy.spawnerarmextras"); internal static ManualLogSource Logger; public static bool addedEnemies = false; public static Dictionary<string, GameObject> Prefabs = new Dictionary<string, GameObject> { ["Wicked"] = null, ["Tundra"] = null, ["Agony"] = null, ["Minos"] = null, ["MinosArm"] = null, ["Minotaur"] = null, ["DroneGhost"] = null, ["DroneFlesh"] = null, ["DroneFleshCamera"] = null, ["DroneSkull"] = null, ["CentaurMortar"] = null, ["BlackHole"] = null, ["MaliciousFace"] = null, ["Explosion"] = null, ["BrainGib"] = null, ["CentaurTower"] = null, ["CentaurTowerPreview"] = null, ["Projectile"] = null, ["Landmine"] = null }; public static Dictionary<string, Texture2D> Icons = new Dictionary<string, Texture2D> { ["Wicked"] = null, ["AgonyTundra"] = null, ["Tundra"] = null, ["Agony"] = null, ["Minos"] = null, ["MinosArm"] = null, ["Minotaur"] = null, ["DroneGhost"] = null, ["DroneFlesh"] = null, ["DroneFleshCamera"] = null, ["DroneSkull"] = null, ["BlackHoleLauncher"] = null, ["Disgrace"] = null, ["Watchtower"] = null }; public static Dictionary<string, Texture2D> Textures = new Dictionary<string, Texture2D> { ["ProjectilePurple"] = null }; public static Dictionary<RealEnemyType, SpawnableObject> SpawnableObjects = new Dictionary<RealEnemyType, SpawnableObject> { [RealEnemyType.Wicked] = null, [RealEnemyType.AgonyTundra] = null, [RealEnemyType.Agony] = null, [RealEnemyType.Tundra] = null, [RealEnemyType.Minos] = null, [RealEnemyType.MinosArm] = null, [RealEnemyType.Minotaur] = null, [RealEnemyType.DroneGhost] = null, [RealEnemyType.Eye] = null, [RealEnemyType.EyeYellow] = null, [RealEnemyType.EyeMalicious] = null, [RealEnemyType.BlackHoleLauncher] = null, [RealEnemyType.Disgrace] = null, [RealEnemyType.Watchtower] = null }; public void Awake() { Logger = ((BaseUnityPlugin)this).Logger; LoadAssets(); Harmony.PatchAll(); Logger.LogInfo((object)"Plugin SpawnerArmExtras is loaded!"); SceneManager.activeSceneChanged += SceneManagerActiveSceneChanged; SceneManager.sceneLoaded += SceneManagerSceneLoaded; } public T Ass<T>(string path) { //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) return Addressables.LoadAssetAsync<T>((object)path).WaitForCompletion(); } public void LoadAssets() { Logger.LogInfo((object)"Getting Something Wicked assets... (1/7)"); Icons["Wicked"] = Util.LoadEmbeddedTexture("SpawnerArmExtras.assets.WickedIcon.png"); Prefabs["Wicked"] = Ass<GameObject>("Assets/Prefabs/Enemies/Wicked.prefab"); AddRealEnemyType(Prefabs["Wicked"], RealEnemyType.Wicked); Logger.LogInfo((object)"Getting Swordsmachine Agony and Tundra assets... (2/7)"); Icons["AgonyTundra"] = Util.LoadEmbeddedTexture("SpawnerArmExtras.assets.AgonyTundraIcon.png"); Icons["Tundra"] = Util.LoadEmbeddedTexture("SpawnerArmExtras.assets.TundraIcon.png"); Prefabs["Tundra"] = Ass<GameObject>("Assets/Prefabs/Enemies/SwordsMachine Tundra.prefab"); AddRealEnemyType(Prefabs["Tundra"], RealEnemyType.Tundra); Icons["Agony"] = Util.LoadEmbeddedTexture("SpawnerArmExtras.assets.AgonyIcon.png"); Prefabs["Agony"] = Ass<GameObject>("Assets/Prefabs/Enemies/SwordsMachine Agony.prefab"); AddRealEnemyType(Prefabs["Agony"], RealEnemyType.Agony); Logger.LogInfo((object)"Getting Minos assets... (3/7)"); Icons["Minos"] = Ass<Texture2D>("Assets/Textures/UI/Spawn Menu/Minos.png"); Prefabs["Minos"] = Ass<GameObject>("Assets/Prefabs/Enemies/MinosBoss.prefab"); AddRealEnemyType(Prefabs["Minos"], RealEnemyType.Minos); Icons["MinosArm"] = Util.LoadEmbeddedTexture("SpawnerArmExtras.assets.MinosArmIcon.png"); Prefabs["MinosArm"] = Ass<GameObject>("Assets/Prefabs/Enemies/MinosArm.prefab"); AddRealEnemyType(Prefabs["MinosArm"], RealEnemyType.MinosArm); Icons["Minotaur"] = Ass<Texture2D>("Assets/Textures/UI/Spawn Menu/Minotaur.png"); Prefabs["Minotaur"] = Ass<GameObject>("Assets/Prefabs/Enemies/MinotaurChase.prefab"); AddRealEnemyType(Prefabs["Minotaur"], RealEnemyType.Minotaur); Logger.LogInfo((object)"Getting Drone assets... (4/7)"); Icons["DroneGhost"] = Util.LoadEmbeddedTexture("SpawnerArmExtras.assets.DroneGhostIcon.png"); Prefabs["DroneGhost"] = Ass<GameObject>("Assets/Prefabs/Enemies/DroneGhostFromCorpse.prefab"); AddRealEnemyType(Prefabs["DroneGhost"], RealEnemyType.DroneGhost); Icons["DroneFlesh"] = Util.LoadEmbeddedTexture("SpawnerArmExtras.assets.DroneFleshIcon.png"); Prefabs["DroneFlesh"] = Ass<GameObject>("Assets/Prefabs/Enemies/DroneFlesh.prefab"); AddRealEnemyType(Prefabs["DroneFlesh"], RealEnemyType.Eye); Icons["DroneFleshCamera"] = Util.LoadEmbeddedTexture("SpawnerArmExtras.assets.DroneFleshCameraIcon.png"); Prefabs["DroneFleshCamera"] = Ass<GameObject>("Assets/Prefabs/Enemies/DroneFleshCamera Variant.prefab"); AddRealEnemyType(Prefabs["DroneFleshCamera"], RealEnemyType.EyeYellow); Icons["DroneSkull"] = Util.LoadEmbeddedTexture("SpawnerArmExtras.assets.DroneSkullIcon.png"); Prefabs["DroneSkull"] = Ass<GameObject>("Assets/Prefabs/Enemies/DroneSkull Variant.prefab"); AddRealEnemyType(Prefabs["DroneSkull"], RealEnemyType.EyeMalicious); Logger.LogInfo((object)"Getting Black Hole Launcher assets... (5/7)"); Icons["BlackHoleLauncher"] = Util.LoadEmbeddedTexture("SpawnerArmExtras.assets.BlackHoleLauncherIcon.png"); Prefabs["CentaurMortar"] = Ass<GameObject>("Assets/Prefabs/Enemies/CentaurMortar.prefab"); Prefabs["CentaurMortarPreview"] = Ass<GameObject>("Assets/Prefabs/Spawner Previews/CentaurMortar Preview.prefab"); Prefabs["BlackHole"] = Ass<GameObject>("Assets/Prefabs/Attacks and Projectiles/Black Hole Enemy.prefab"); Logger.LogInfo((object)"Getting Disgrace assets... (6/7)"); Icons["Disgrace"] = Util.LoadEmbeddedTexture("SpawnerArmExtras.assets.DisgraceIcon.png"); Prefabs["MaliciousFace"] = Ass<GameObject>("Assets/Prefabs/Enemies/Malicious Face.prefab"); Prefabs["Explosion"] = Ass<GameObject>("Assets/Prefabs/Attacks and Projectiles/Explosions/Explosion.prefab"); Prefabs["BrainGib"] = Ass<GameObject>("Assets/Prefabs/Gibs/Gib_BrainChunk.prefab"); Logger.LogInfo((object)"Getting Watchtower assets... (7/7)"); Icons["Watchtower"] = Util.LoadEmbeddedTexture("SpawnerArmExtras.assets.WatchtowerIcon.png"); Prefabs["CentaurTower"] = Ass<GameObject>("Assets/Prefabs/Enemies/CentaurTower.prefab"); Prefabs["CentaurTowerPreview"] = Ass<GameObject>("Assets/Prefabs/Spawner Previews/CentaurTower Preview.prefab"); Prefabs["Projectile"] = Ass<GameObject>("Assets/Prefabs/Attacks and Projectiles/Projectile.prefab"); Prefabs["Landmine"] = Ass<GameObject>("Assets/Prefabs/Attacks and Projectiles/Landmine.prefab"); Textures["ProjectilePurple"] = Util.LoadEmbeddedTexture("SpawnerArmExtras.assets.ProjectilePurple.png"); } public static void AddRealEnemyType(GameObject obj, RealEnemyType realEnemyType) { obj.AddComponent<RealEnemyTypeSaver>().type = realEnemyType; } public static void SceneManagerSceneLoaded(Scene scene, LoadSceneMode mode) { if (SceneHelper.CurrentScene != "Bootstrap" && SceneHelper.CurrentScene != "Intro" && SceneHelper.CurrentScene != "Main Menu") { SpawnMenuPatch.MakeAllSpawnables(); } } public static void SceneManagerActiveSceneChanged(Scene arg0, Scene arg1) { if (!Util.IsSandbox()) { SceneHelper instance = MonoSingleton<SceneHelper>.Instance; if (instance != null) { ((MonoBehaviour)instance).StartCoroutine(AddSandboxNavMesh()); } } } [IteratorStateMachine(typeof(<AddSandboxNavMesh>d__13))] public static IEnumerator AddSandboxNavMesh() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <AddSandboxNavMesh>d__13(0); } } [HarmonyPatch(typeof(SpawnMenu))] public class SpawnMenuPatch { public static GameObject MakeGameObject(string name, GameObject obj) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_0035: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject(name); Object.DontDestroyOnLoad((Object)(object)val); val.SetActive(false); val.layer = LayerMask.NameToLayer("EnemyTrigger"); GameObject val2 = Object.Instantiate<GameObject>(obj); val2.transform.position = Vector3.zero; val2.transform.SetParent(val.transform); DisableVertexLighting(val2); return val; } public static GameObject MakeGameObjectCombined(string name, GameObject[] objs) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_0043: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject(name); Object.DontDestroyOnLoad((Object)(object)val); val.SetActive(false); val.layer = LayerMask.NameToLayer("EnemyTrigger"); foreach (GameObject val2 in objs) { GameObject val3 = Object.Instantiate<GameObject>(val2); val3.transform.position = Vector3.zero; val3.transform.SetParent(val.transform); DisableVertexLighting(val3); } return val; } public static GameObject MakePreview(string name, GameObject obj) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_0023: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject(name); Object.DontDestroyOnLoad((Object)(object)val); val.AddComponent<HidePreviewIfNotInHand>(); GameObject val2 = Object.Instantiate<GameObject>(obj); val2.transform.position = Vector3.zero; val2.transform.SetParent(val.transform); DisableVertexLighting(val2); return val; } public static void DisableVertexLighting(GameObject obj) { SkinnedMeshRenderer[] componentsInChildren = obj.GetComponentsInChildren<SkinnedMeshRenderer>(); foreach (SkinnedMeshRenderer val in componentsInChildren) { Material[] materials = ((Renderer)val).materials; foreach (Material val2 in materials) { val2.DisableKeyword("VERTEX_LIGHTING"); } } MeshRenderer[] componentsInChildren2 = obj.GetComponentsInChildren<MeshRenderer>(); foreach (MeshRenderer val3 in componentsInChildren2) { Material[] materials2 = ((Renderer)val3).materials; foreach (Material val4 in materials2) { val4.DisableKeyword("VERTEX_LIGHTING"); } } } public static Color MakeColor(string enemy = "") { //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_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_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) return (Color)(enemy switch { "husk" => new Color(0.898f, 0.6588f, 0.6588f), "machine" => new Color(0.4784f, 0.6196f, 0.851f), "demon" => new Color(0.5176f, 0.9059f, 0.5098f), "angel" => new Color(1f, 0.9091f, 0.4481f), _ => new Color(0.75f, 0.75f, 0.75f), }); } public static Sprite MakeIcon(Texture2D tex) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) return Sprite.Create(tex, new Rect(0f, 0f, 256f, 256f), new Vector2(0.5f, 0.5f)); } [HarmonyPrefix] [HarmonyPatch(typeof(SpawnMenu), "Awake")] public static void AwakePrefix(SpawnMenu __instance) { if (Plugin.addedEnemies) { return; } MakeAllSpawnables(); List<SpawnableObject> list = __instance.objects.enemies.ToList(); List<SpawnableObject> list2 = new List<SpawnableObject>(); foreach (RealEnemyType key in Plugin.SpawnableObjects.Keys) { if ((Object)(object)Plugin.SpawnableObjects[key] != (Object)null) { list2.Add(Plugin.SpawnableObjects[key]); } } list.AddRange(list2); __instance.objects.enemies = list.ToArray(); Plugin.addedEnemies = true; SpawnableObject[] sandboxTools = __instance.objects.sandboxTools; foreach (SpawnableObject val in sandboxTools) { val.sandboxOnly = false; } SpawnableObject[] sandboxObjects = __instance.objects.sandboxObjects; foreach (SpawnableObject val2 in sandboxObjects) { val2.sandboxOnly = false; } SpawnableObject[] specialSandbox = __instance.objects.specialSandbox; foreach (SpawnableObject val3 in specialSandbox) { val3.sandboxOnly = false; } } public static void MakeAllSpawnables() { RealEnemyType[] array = Plugin.SpawnableObjects.Keys.ToArray(); RealEnemyType[] array2 = array; foreach (RealEnemyType realEnemyType in array2) { if ((Object)(object)Plugin.SpawnableObjects[realEnemyType] == (Object)null) { Plugin.SpawnableObjects[realEnemyType] = MakeSpawnableFromType(realEnemyType); } } } public static SpawnableObject MakeSpawnableFromType(RealEnemyType realEnemyType) { if (1 == 0) { } SpawnableObject result = (SpawnableObject)(realEnemyType switch { RealEnemyType.Wicked => MakeSpawnableWicked(), RealEnemyType.AgonyTundra => MakeSpawnableAgonyTundra(), RealEnemyType.Agony => MakeSpawnableAgony(), RealEnemyType.Tundra => MakeSpawnableTundra(), RealEnemyType.Minos => MakeSpawnableMinos(), RealEnemyType.MinosArm => MakeSpawnableMinosArm(), RealEnemyType.Minotaur => MakeSpawnableMinotaur(), RealEnemyType.DroneGhost => MakeSpawnableDroneGhost(), RealEnemyType.Eye => MakeSpawnableDroneFlesh(), RealEnemyType.EyeYellow => MakeSpawnableDroneFleshCamera(), RealEnemyType.EyeMalicious => MakeSpawnableDroneSkull(), RealEnemyType.BlackHoleLauncher => MakeSpawnableBlackHoleLauncher(), RealEnemyType.Disgrace => MakeSpawnableDisgrace(), RealEnemyType.Watchtower => MakeSpawnableWatchtower(), _ => null, }); if (1 == 0) { } return result; } public static void SetSpawnableDefaults(SpawnableObject spawnable, string identifier = "ultrakill.mannequin") { spawnable.iconKey = ""; spawnable.identifier = identifier; spawnable.defaultSettings = Array.Empty<AlterOption>(); spawnable.description = "description"; spawnable.strategy = "strategy"; spawnable.type = "type"; } public static SpawnableObject MakeSpawnableWicked() { //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004f: 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) SpawnableObject val = ScriptableObject.CreateInstance<SpawnableObject>(); ((Object)val).name = "Wicked"; val.objectName = "Wicked"; val.gameObject = MakeGameObject("WickedSpawned", Plugin.Prefabs["Wicked"]); val.backgroundColor = MakeColor(); val.spawnableObjectType = (SpawnableObjectDataType)1; val.enemyType = (EnemyType)10; val.gridIcon = MakeIcon(Plugin.Icons["Wicked"]); ((Object)val.gridIcon).name = "WickedIcon"; SetSpawnableDefaults(val); return val; } public static SpawnableObject MakeSpawnableAgonyTundra() { //IL_00bc: 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_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) SpawnableObject val = ScriptableObject.CreateInstance<SpawnableObject>(); ((Object)val).name = "AgonyTundra"; val.objectName = "AgonyTundra"; val.gameObject = MakeGameObjectCombined("AgonyTundraSpawned", (GameObject[])(object)new GameObject[2] { Plugin.Prefabs["Agony"], Plugin.Prefabs["Tundra"] }); Enemy componentInChildren = ((Component)val.gameObject.transform.GetChild(0)).GetComponentInChildren<Enemy>(); Enemy componentInChildren2 = ((Component)val.gameObject.transform.GetChild(1)).GetComponentInChildren<Enemy>(); componentInChildren.symbiotic = true; componentInChildren2.symbiotic = true; componentInChildren.symbiote = componentInChildren2; componentInChildren2.symbiote = componentInChildren; val.gameObject.transform.rotation = Quaternion.Euler(0f, 90f, 0f); ((Component)componentInChildren).transform.localPosition = new Vector3(0f, 0f, -2f); ((Component)componentInChildren2).transform.localPosition = new Vector3(0f, 0f, 2f); val.backgroundColor = MakeColor("machine"); val.spawnableObjectType = (SpawnableObjectDataType)1; val.enemyType = (EnemyType)7; val.gridIcon = MakeIcon(Plugin.Icons["AgonyTundra"]); ((Object)val.gridIcon).name = "AgonyTundraIcon"; SetSpawnableDefaults(val); return val; } public static SpawnableObject MakeSpawnableAgony() { //IL_0057: 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) //IL_0074: 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) SpawnableObject val = ScriptableObject.CreateInstance<SpawnableObject>(); ((Object)val).name = "Agony"; val.objectName = "Agony"; val.gameObject = MakeGameObject("AgonySpawned", Plugin.Prefabs["Agony"]); val.gameObject.transform.rotation = Quaternion.Euler(0f, -45f, 0f); val.backgroundColor = MakeColor("machine"); val.spawnableObjectType = (SpawnableObjectDataType)1; val.enemyType = (EnemyType)7; val.gridIcon = MakeIcon(Plugin.Icons["Agony"]); ((Object)val.gridIcon).name = "AgonyIcon"; SetSpawnableDefaults(val); return val; } public static SpawnableObject MakeSpawnableTundra() { //IL_0057: 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) //IL_0074: 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) SpawnableObject val = ScriptableObject.CreateInstance<SpawnableObject>(); ((Object)val).name = "Tundra"; val.objectName = "Tundra"; val.gameObject = MakeGameObject("Tundra