Decompiled source of Young NejiHyuga v0.5.1

plugins/YoungNeji/YoungNeji.dll

Decompiled 6 hours ago
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.Serialization.Json;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using EntityStates;
using EntityStates.FlyingVermin.Weapon;
using EntityStates.GolemMonster;
using EntityStates.LemurianMonster;
using EntityStates.TitanMonster;
using EntityStates.Wisp1Monster;
using KinematicCharacterController;
using Microsoft.CodeAnalysis;
using On.EntityStates.GolemMonster;
using On.RoR2;
using R2API;
using R2API.Utils;
using RoR2;
using RoR2.CharacterAI;
using RoR2.ContentManagement;
using RoR2.Projectile;
using RoR2.Skills;
using TMPro;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.Networking;
using UnityEngine.Rendering;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("YoungNeji")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("YoungNeji")]
[assembly: AssemblyTitle("YoungNeji")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

		public NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[CompilerGenerated]
	[Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
}
namespace YoungNeji
{
	public static class Playtest
	{
		[Serializable]
		[CompilerGenerated]
		private sealed class <>c
		{
			public static readonly <>c <>9 = new <>c();

			public static Action<string, CharacterBody, HealthComponent, float> <>9__2_0;

			public static Action<string, CharacterBody, HealthComponent, float> <>9__5_0;

			public static Func<ConfigEntry<float>, float> <>9__5_1;

			public static Action<string, CharacterBody, HealthComponent, float> <>9__9_0;

			public static Func<EntityStateMachine, bool> <>9__9_1;

			public static Action<string, CharacterBody, HealthComponent, float> <>9__10_0;

			public static Func<EntityStateMachine, bool> <>9__10_2;

			public static Func<EntityStateMachine, bool> <>9__10_3;

			public static Func<GameObject, bool> <>9__10_1;

			public static Action<string, CharacterBody, HealthComponent, float> <>9__11_0;

			public static Func<EntityStateMachine, bool> <>9__11_1;

			public static Func<EntityStateMachine, bool> <>9__12_0;

			public static Func<GameObject, bool> <>9__13_0;

			public static Func<EntityStateMachine, bool> <>9__15_0;

			public static Func<NetworkUser, bool> <>9__16_0;

			public static Func<EntityStateMachine, bool> <>9__17_0;

			public static Action<string, CharacterBody, HealthComponent, float> <>9__18_0;

			public static Func<EntityStateMachine, bool> <>9__18_1;

			public static Func<EntityStateMachine, bool> <>9__20_0;

			public static Func<EntityStateMachine, bool> <>9__21_0;

			public static hook_Update <>9__32_0;

			public static hook_FixedUpdate <>9__32_1;

			public static Action <>9__32_2;

			public static Action<string, CharacterBody, HealthComponent, float> <>9__32_3;

			public static Func<NetworkUser, bool> <>9__35_0;

			public static Func<VehicleSeat, bool> <>9__35_1;

			public static Func<EntityStateMachine, bool> <>9__35_2;

			public static Func<Transform, bool> <>9__39_0;

			public static Func<HealthComponent, string> <>9__40_0;

			public static Action<string, CharacterBody, HealthComponent, float> <>9__42_0;

			public static Func<EntityStateMachine, bool> <>9__42_1;

			public static Func<CharacterBody, bool> <>9__43_0;

			public static Func<CharacterBody, float> <>9__43_1;

			public static Action<string, CharacterBody, HealthComponent, float> <>9__44_0;

			public static Func<EntityStateMachine, bool> <>9__44_2;

			public static Func<Component, string> <>9__44_3;

			public static Func<EntityStateMachine, bool> <>9__44_1;

			public static Func<ConfigEntry<float>, float> <>9__45_0;

			public static Func<SkinnedMeshRenderer, bool> <>9__45_1;

			public static Func<EntityStateMachine, bool> <>9__45_2;

			public static Func<MethodInfo, bool> <>9__45_3;

			public static Func<EntityStateMachine, bool> <>9__45_4;

			public static Action<int> <>9__52_0;

			public static Action<string, CharacterBody, HealthComponent, float> <>9__52_1;

			public static Func<ConfigEntry<float>, float> <>9__52_2;

			public static Func<RotationVisualRC02, bool> <>9__52_3;

			public static Func<EntityStateMachine, bool> <>9__52_4;

			public static Func<TMP_Text, string> <>9__53_0;

			public static Func<EntityStateMachine, bool> <>9__54_0;

			public static Func<EntityStateMachine, bool> <>9__55_0;

			internal void <AudioFinal03>b__2_0(string kind, CharacterBody owner, HealthComponent h, float amount)
			{
				if ((Object)(object)owner == (Object)(object)b && kind.StartsWith("palms-"))
				{
					hits03++;
					damage03 += amount;
				}
			}

			internal void <Candidate02>b__5_0(string kind, CharacterBody owner, HealthComponent h, float amount)
			{
				if ((Object)(object)owner == (Object)(object)b)
				{
					strikes02++;
					damage02 += amount;
				}
			}

			internal float <Candidate02>b__5_1(ConfigEntry<float> x)
			{
				return x.Value;
			}

			internal void <Check03>b__9_0(string kind, CharacterBody owner, HealthComponent h, float amount)
			{
				if ((Object)(object)owner == (Object)(object)b && kind.StartsWith("palms-"))
				{
					hits03++;
					damage03 += amount;
				}
			}

			internal bool <Check03>b__9_1(EntityStateMachine x)
			{
				return x.customName == "Weapon";
			}

			internal void <Check04>b__10_0(string kind, CharacterBody owner, HealthComponent h, float amount)
			{
				if ((Object)(object)owner == (Object)(object)b && kind.StartsWith("palms-"))
				{
					hits03++;
					damage03 += amount;
				}
			}

			internal bool <Check04>b__10_2(EntityStateMachine x)
			{
				return x.customName == "Weapon";
			}

			internal bool <Check04>b__10_3(EntityStateMachine x)
			{
				return x.customName == "Weapon";
			}

			internal bool <Check04>b__10_1(GameObject x)
			{
				return ((Object)x).name == "Neji local technique visual";
			}

			internal void <CorrectionRecheckRC02>b__11_0(string kind, CharacterBody owner, HealthComponent h, float amount)
			{
				if ((Object)(object)owner == (Object)(object)b && kind.StartsWith("palms-"))
				{
					strikesRC02++;
				}
			}

			internal bool <CorrectionRecheckRC02>b__11_1(EntityStateMachine x)
			{
				return x.customName == "Weapon";
			}

			internal bool <Defense02>b__12_0(EntityStateMachine x)
			{
				return x.customName == "Weapon";
			}

			internal bool <Edge>b__13_0(GameObject x)
			{
				return ((Object)x).name == "Neji local technique visual";
			}

			internal bool <Final04>b__15_0(EntityStateMachine x)
			{
				return x.customName == "Weapon";
			}

			internal bool <Selection02>b__16_0(NetworkUser x)
			{
				return ((NetworkBehaviour)x).isLocalPlayer;
			}

			internal bool <Finish02>b__17_0(EntityStateMachine x)
			{
				return x.customName == "Weapon";
			}

			internal void <Finish03>b__18_0(string kind, CharacterBody owner, HealthComponent h, float amount)
			{
				if ((Object)(object)owner == (Object)(object)b && kind.StartsWith("palms-"))
				{
					hits03++;
					damage03 += amount;
				}
			}

			internal bool <Finish03>b__18_1(EntityStateMachine x)
			{
				return x.customName == "Weapon";
			}

			internal bool <PestRecheckRC02>b__20_0(EntityStateMachine x)
			{
				return x.customName == "Weapon";
			}

			internal bool <Physical04>b__21_0(EntityStateMachine x)
			{
				return x.customName == "Weapon";
			}

			internal void <Init>b__32_0(orig_Update orig, PlayerCharacterMasterController self)
			{
				orig.Invoke(self);
				Drive(self, fixedInput: false);
			}

			internal void <Init>b__32_1(orig_FixedUpdate orig, PlayerCharacterMasterController self)
			{
				orig.Invoke(self);
				Drive(self, fixedInput: true);
			}

			internal void <Init>b__32_2()
			{
				((MonoBehaviour)Plugin.instance).StartCoroutine(Run());
			}

			internal void <Init>b__32_3(string kind, CharacterBody owner, HealthComponent h, float amount)
			{
				//IL_005d: 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)
				if ((Object)(object)owner == (Object)(object)b)
				{
					Log(phase + " damage=" + kind + " victim=" + ((Object)h).name + " amount=" + amount + " distance=" + Vector3.Distance(b.corePosition, h.body.corePosition));
				}
			}

			internal bool <Run>b__35_0(NetworkUser x)
			{
				return ((NetworkBehaviour)x).isLocalPlayer;
			}

			internal bool <Run>b__35_1(VehicleSeat x)
			{
				return (Object)(object)x.currentPassengerBody == (Object)(object)b;
			}

			internal bool <Run>b__35_2(EntityStateMachine x)
			{
				return x.customName == "Weapon";
			}

			internal bool <Capture>b__39_0(Transform x)
			{
				return ((Object)x).name == "head";
			}

			internal string <Pre03>b__40_0(HealthComponent x)
			{
				return ((Object)x.body).name;
			}

			internal void <Recheck03>b__42_0(string kind, CharacterBody owner, HealthComponent h, float amount)
			{
				if ((Object)(object)owner == (Object)(object)b && kind.StartsWith("palms-"))
				{
					hits03++;
					damage03 += amount;
				}
			}

			internal bool <Recheck03>b__42_1(EntityStateMachine x)
			{
				return x.customName == "Weapon";
			}

			internal bool <KillTarget03>b__43_0(CharacterBody x)
			{
				return Object.op_Implicit((Object)(object)x) && x.healthComponent.alive;
			}

			internal float <KillTarget03>b__43_1(CharacterBody x)
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				//IL_000b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0010: Unknown result type (might be due to invalid IL or missing references)
				//IL_0015: Unknown result type (might be due to invalid IL or missing references)
				Vector3 val = x.corePosition - b.corePosition;
				return ((Vector3)(ref val)).sqrMagnitude;
			}

			internal void <Recheck04>b__44_0(string kind, CharacterBody owner, HealthComponent h, float amount)
			{
				if ((Object)(object)owner == (Object)(object)b && kind.StartsWith("palms-"))
				{
					hits03++;
				}
			}

			internal bool <Recheck04>b__44_2(EntityStateMachine x)
			{
				return x.customName == "Weapon";
			}

			internal string <Recheck04>b__44_3(Component x)
			{
				return ((object)x).GetType().Name;
			}

			internal bool <Recheck04>b__44_1(EntityStateMachine x)
			{
				return x.customName == "Weapon";
			}

			internal float <ReleaseCheckRC>b__45_0(ConfigEntry<float> x)
			{
				return x.Value;
			}

			internal bool <ReleaseCheckRC>b__45_1(SkinnedMeshRenderer x)
			{
				return ((Object)x).name.Contains("eye_");
			}

			internal bool <ReleaseCheckRC>b__45_2(EntityStateMachine x)
			{
				return x.customName == "Weapon";
			}

			internal bool <ReleaseCheckRC>b__45_3(MethodInfo m)
			{
				return m.Name == "Respawn" && m.GetParameters().Length == 3 && m.GetParameters()[0].ParameterType == typeof(Vector3);
			}

			internal bool <ReleaseCheckRC>b__45_4(EntityStateMachine x)
			{
				return x.customName == "Weapon";
			}

			internal void <CorrectionRC02>b__52_0(int k)
			{
				if (k == 0)
				{
					contactsRC02++;
				}
			}

			internal void <CorrectionRC02>b__52_1(string kind, CharacterBody owner, HealthComponent h, float amount)
			{
				if ((Object)(object)owner == (Object)(object)b && kind.StartsWith("palms-"))
				{
					if (strikesRC02++ == 0)
					{
						firstRC02 = Time.time - startRC02;
					}
					lastRC02 = Time.time - startRC02;
					indicesRC02.Add(int.Parse(kind.Substring(6)));
				}
			}

			internal float <CorrectionRC02>b__52_2(ConfigEntry<float> x)
			{
				return x.Value;
			}

			internal bool <CorrectionRC02>b__52_3(RotationVisualRC02 x)
			{
				return x.Visible;
			}

			internal bool <CorrectionRC02>b__52_4(EntityStateMachine x)
			{
				return x.customName == "Weapon";
			}

			internal string <SelectionRC>b__53_0(TMP_Text x)
			{
				return x.text;
			}

			internal bool <RecheckRC>b__54_0(EntityStateMachine x)
			{
				return x.customName == "Weapon";
			}

			internal bool <Smoke02>b__55_0(EntityStateMachine x)
			{
				return x.customName == "Weapon";
			}
		}

		private static int strikes02;

		private static float damage02;

		private static int hits03;

		private static float damage03;

		private static List<string> rows = new List<string>();

		private static string phase;

		private static CharacterBody b;

		private static Probe d;

		private static Visual v;

		private static Vector3 home;

		private static EntityStateMachine weapon;

		private static int contactsRC02;

		private static int strikesRC02;

		private static float firstRC02;

		private static float lastRC02;

		private static float startRC02;

		private static HashSet<int> indicesRC02 = new HashSet<int>();

		private static string Root => Path.Combine(Visual.Assets, "TestEvidence");

		private static void Wake(CharacterBody e)
		{
			EntityStateMachine[] components = ((Component)e).GetComponents<EntityStateMachine>();
			foreach (EntityStateMachine val in components)
			{
				if (val.customName == "Body")
				{
					val.SetNextStateToMain();
				}
			}
		}

		private static IEnumerator Advanced()
		{
			CharacterBody e = Spawn("LemurianMaster", home + Vector3.forward * 1.8f, 10000f, pin: true);
			yield return (object)new WaitForSeconds(2f);
			Wake(e);
			yield return (object)new WaitForSeconds(1f);
			float[] array = new float[2] { 1f, 2f };
			for (int i = 0; i < array.Length; i++)
			{
				float speed = array[i];
				Reset();
				SetFoot(e, home + Vector3.forward * 1.8f);
				b.baseAttackSpeed = speed;
				b.RecalculateStats();
				yield return (object)new WaitForSeconds(0.3f);
				phase = "mature-primary-" + speed;
				float hp = e.healthComponent.health;
				d.attack = true;
				yield return Record("Final-Primary-" + speed, 2.1f / speed + 0.2f, side: false);
				d.attack = false;
				yield return (object)new WaitForSeconds(0.3f);
				Log(phase + " total=" + (hp - e.healthComponent.health));
			}
			b.baseAttackSpeed = 1f;
			b.RecalculateStats();
			Reset();
			SetFoot(e, home + Vector3.forward * 4f);
			CharacterBody e2 = Spawn("LemurianMaster", home + new Vector3(4f, 0f, 7f), 10000f, pin: true);
			CharacterBody e3 = Spawn("WispMaster", home + new Vector3(-3f, 4f, 6f), 10000f, pin: true);
			yield return (object)new WaitForSeconds(3f);
			Wake(e2);
			Wake(e3);
			yield return (object)new WaitForSeconds(0.3f);
			phase = "mature-redirect";
			e.healthComponent.health = 8f;
			Log("snapshot=" + Combat.Targets(b, b.corePosition, requireSafe: true).Count);
			weapon.SetNextState((EntityState)(object)new SixtyFourPalms());
			yield return Record("Final-64Palms-Crowd-Flyer", 3.1f, side: false);
			Log("redirect hp2=" + e2.healthComponent.health + " hp3=" + e3.healthComponent.health + " protection=" + ((Component)b).GetComponent<NejiBody>().barrage);
			Reset();
			SetFoot(e2, home + Vector3.right * 40f);
			SetFoot(e3, home + Vector3.right * 45f);
			CharacterBody boss = Spawn("BeetleQueenMaster", home + Vector3.forward * 8f, 50000f, pin: true);
			yield return (object)new WaitForSeconds(4f);
			Wake(boss);
			yield return (object)new WaitForSeconds(0.3f);
			phase = "boss";
			float bossHp = boss.healthComponent.health;
			Log("boss level=" + boss.level + " armor=" + boss.armor + " radius=" + boss.radius);
			weapon.SetNextState((EntityState)(object)new SixtyFourPalms());
			yield return Record("Final-64Palms-Boss", 3.1f, side: false);
			Log("boss loss=" + (bossHp - boss.healthComponent.health));
			SetFoot(boss, home + Vector3.right * 50f);
			Reset();
			SetFoot(e3, home + new Vector3(0f, 4.7f, 8f));
			yield return (object)new WaitForSeconds(0.4f);
			phase = "flying-engagement";
			d.jump = true;
			yield return (object)new WaitForSeconds(0.08f);
			d.jump = false;
			yield return (object)new WaitForSeconds(0.12f);
			d.move = Vector3.forward;
			Probe probe = d;
			Vector3 val = new Vector3(0f, 0.25f, 1f);
			probe.aim = ((Vector3)(ref val)).normalized;
			weapon.SetNextState((EntityState)(object)new Substitution());
			yield return (object)new WaitForSeconds(0.16f);
			d.move = Vector3.zero;
			Probe probe2 = d;
			val = e3.corePosition - b.corePosition;
			probe2.aim = ((Vector3)(ref val)).normalized;
			float flyHp = e3.healthComponent.health;
			d.attack = true;
			yield return Record("Final-Flyer-Primary", 2f, side: false);
			d.attack = false;
			Log("flying-engagement damage=" + (flyHp - e3.healthComponent.health));
			SetFoot(e3, home + Vector3.right * 45f);
			Reset();
			SetFoot(e2, home + Vector3.forward * 8f);
			yield return (object)new WaitForSeconds(0.4f);
			phase = "rotation-stream";
			d.secondary = true;
			yield return (object)new WaitForSeconds(0.4f);
			float hpBefore = b.healthComponent.health;
			float foeBefore = e2.healthComponent.health;
			for (int j = 0; j < 20; j++)
			{
				new BulletAttack
				{
					owner = ((Component)e2).gameObject,
					origin = b.corePosition + Vector3.forward * 6f,
					aimVector = Vector3.back,
					maxDistance = 10f,
					damage = 10f,
					procCoefficient = 0f,
					radius = 0.2f,
					smartCollision = true
				}.Fire();
				yield return (object)new WaitForSeconds(0.02f);
			}
			Log("bullet-stream incoming=" + (hpBefore - b.healthComponent.health) + " retaliation=" + (foeBefore - e2.healthComponent.health));
			GameObject missile = LegacyResourcesAPI.Load<GameObject>("Prefabs/Projectiles/LemurianFireball");
			if (!Object.op_Implicit((Object)(object)missile))
			{
				missile = LegacyResourcesAPI.Load<GameObject>("Prefabs/Projectiles/Fireball");
			}
			Log("projectile prefab=" + (Object.op_Implicit((Object)(object)missile) ? ((Object)missile).name : "missing"));
			if (Object.op_Implicit((Object)(object)missile))
			{
				ProjectileManager.instance.FireProjectile(missile, b.corePosition + Vector3.forward * 5f, Quaternion.LookRotation(Vector3.back), ((Component)e2).gameObject, 10f, 0f, false, (DamageColorIndex)0, (GameObject)null, -1f, (DamageTypeCombo?)null);
				yield return (object)new WaitForSeconds(0.1f);
				ProjectileController[] array2 = Object.FindObjectsOfType<ProjectileController>();
				foreach (ProjectileController p in array2)
				{
					Log("projectile live=" + ((Object)p).name + " layer=" + ((Component)p).gameObject.layer + " rb=" + Object.op_Implicit((Object)(object)((Component)p).GetComponent<Rigidbody>()) + " owner=" + (Object.op_Implicit((Object)(object)p.owner) ? ((Object)p.owner).name : "null"));
				}
			}
			yield return Record("Final-Rotation", 1.1f, side: false);
			d.secondary = false;
			yield return (object)new WaitForSeconds(0.3f);
			Log("rotation exit=" + ((Component)b).GetComponent<NejiBody>().rotating + " cooldown=" + b.skillLocator.secondary.rechargeStopwatch + " stock=" + b.skillLocator.secondary.stock);
			Reset();
			phase = "blocked-ultimate";
			SetFoot(e2, home + Vector3.forward * 8f);
			GameObject wall = GameObject.CreatePrimitive((PrimitiveType)3);
			wall.layer = LayerIndex.world.intVal;
			wall.transform.position = home + new Vector3(0f, 2.5f, 3f);
			wall.transform.localScale = new Vector3(10f, 5f, 0.3f);
			Physics.SyncTransforms();
			yield return (object)new WaitForSeconds(0.2f);
			Log("blocked eligible=" + Combat.Targets(b, b.corePosition, requireSafe: true).Count);
			Object.Destroy((Object)(object)wall);
			yield return (object)new WaitForSeconds(0.2f);
			Reset();
			phase = "stack-owner-expiry";
			NejiBody n = ((Component)b).GetComponent<NejiBody>();
			n.points.Clear();
			for (int l = 0; l < 10; l++)
			{
				n.AddPoint(e2.healthComponent);
			}
			Log("stack cap=" + n.points[e2.healthComponent].count);
			yield return (object)new WaitForSeconds(6.3f);
			Log("stack expired=" + n.points.Count);
			phase = "palms-cancel-death";
			weapon.SetNextState((EntityState)(object)new SixtyFourPalms());
			yield return (object)new WaitForSeconds(0.4f);
			weapon.SetNextState((EntityState)(object)new Substitution());
			yield return (object)new WaitForSeconds(0.3f);
			Log("cancel clean=" + (!n.barrage && !n.rotating && Time.time >= n.protectionUntil));
			Reset();
			phase = "voice-check";
			Log("audio capture=" + ((object)AkSoundEngine.StartOutputCapture(Path.Combine(Root, "Voice-output.wav"))/*cast due to .constrained prefix*/).ToString());
			uint[] array3 = new uint[2] { 0u, 1u };
			foreach (uint skin in array3)
			{
				b.skinIndex = skin;
				NejiAudio.Send(b, 0);
				yield return (object)new WaitForSeconds(4f);
				NejiAudio.Send(b, 1);
				yield return (object)new WaitForSeconds(2f);
			}
			AkSoundEngine.StopOutputCapture();
			Reset();
			SetFoot(e2, home + Vector3.right * 40f);
			phase = "final-visual";
			d.move = Vector3.forward;
			yield return Record("Final-Run", 2.5f, side: true);
			d.sprint = true;
			yield return Record("Final-Sprint", 2.5f, side: true);
			Reset();
			d.jump = true;
			yield return (object)new WaitForSeconds(0.08f);
			d.jump = false;
			yield return (object)new WaitForSeconds(0.3f);
			d.jump = true;
			yield return (object)new WaitForSeconds(0.08f);
			d.jump = false;
			yield return Record("Final-ExtraJump", 2f, side: true);
			Reset();
			yield return (object)new WaitForSeconds(0.3f);
			ScreenCapture.CaptureScreenshot(Path.Combine(Root, "HUD.png"));
			Log("ADVANCED_DONE");
			Object.Destroy((Object)(object)d);
			Application.Quit();
		}

		private static IEnumerator AudioFinal03()
		{
			Diagnostics03.enabled = true;
			Combat.OnDamage = (Action<string, CharacterBody, HealthComponent, float>)Delegate.Combine(Combat.OnDamage, (Action<string, CharacterBody, HealthComponent, float>)delegate(string kind, CharacterBody owner, HealthComponent h, float amount)
			{
				if ((Object)(object)owner == (Object)(object)b && kind.StartsWith("palms-"))
				{
					hits03++;
					damage03 += amount;
				}
			});
			uint[] array = new uint[2] { 0u, 1u };
			for (int num = 0; num < array.Length; num++)
			{
				uint skin = array[num];
				Reset();
				b.skinIndex = skin;
				((Component)b).GetComponent<NejiBody>().points.Clear();
				CharacterBody enemy = Spawn("LemurianMaster", home + Vector3.forward * 5f, 10000f, pin: true);
				yield return (object)new WaitForSeconds(3f);
				Wake(enemy);
				yield return (object)new WaitForSeconds(0.2f);
				phase = "delivered03-" + skin;
				hits03 = 0;
				damage03 = 0f;
				AkSoundEngine.StartOutputCapture(Path.Combine(Root, "Delivered03-" + skin + ".wav"));
				weapon.SetNextState((EntityState)(object)new SixtyFourPalms());
				yield return Record("Delivered64Palms03-" + skin, 5.9f, side: false);
				AkSoundEngine.StopOutputCapture();
				Log(phase + " hits=" + hits03 + " damage=" + damage03 + " protection=" + ((Component)b).GetComponent<NejiBody>().barrage);
				Remove03(enemy);
			}
			Reset();
			yield return (object)new WaitForSeconds(0.2f);
			AkSoundEngine.StartOutputCapture(Path.Combine(Root, "Substitution03.wav"));
			d.move = Vector3.forward;
			weapon.SetNextState((EntityState)(object)new Substitution());
			yield return Record("DeliveredSub03", 1f, side: false);
			AkSoundEngine.StopOutputCapture();
			Log("AUDIOFINAL03_DONE");
			Object.Destroy((Object)(object)d);
			Application.Quit();
		}

		private unsafe static IEnumerator Candidate02()
		{
			b.baseRegen = 0f;
			b.levelRegen = 0f;
			b.RecalculateStats();
			Combat.OnDamage = (Action<string, CharacterBody, HealthComponent, float>)Delegate.Combine(Combat.OnDamage, (Action<string, CharacterBody, HealthComponent, float>)delegate(string kind, CharacterBody owner, HealthComponent h, float amount)
			{
				if ((Object)(object)owner == (Object)(object)b)
				{
					strikes02++;
					damage02 += amount;
				}
			});
			Log("LOADED primary=" + string.Join(",", Tuning.Primary.Select((ConfigEntry<float> x) => x.Value)) + " rotation=" + Tuning.RotationDamage.Value + " palms=" + Tuning.PalmsDamage.Value + " duration=" + Tuning.PalmsDuration.Value + " sub=" + Tuning.SubDistance.Value);
			phase = "walk";
			d.move = Vector3.forward;
			yield return Record("Walk-Side", 3.8f, side: true);
			yield return Record("Gameplay-Walk", 2.5f, side: false);
			d.move = Vector3.left;
			yield return Record("Strafe-Left", 1.4f, side: false);
			d.move = Vector3.right;
			yield return Record("Strafe-Right", 1.4f, side: false);
			d.move = Vector3.back;
			yield return Record("Backward", 1.4f, side: true);
			Reset();
			string[] array = new string[4] { "Stationary", "Moving", "Steering", "NearLanding" };
			foreach (string mode in array)
			{
				phase = "flip-" + mode;
				Reset();
				yield return (object)new WaitForSeconds(0.3f);
				d.move = ((mode == "Stationary") ? Vector3.zero : Vector3.forward);
				d.jump = true;
				yield return (object)new WaitForSeconds(0.08f);
				d.jump = false;
				yield return (object)new WaitForSeconds((mode == "NearLanding") ? 1f : 0.3f);
				d.jump = true;
				yield return (object)new WaitForSeconds(0.08f);
				d.jump = false;
				if (mode == "Steering")
				{
					d.move = Vector3.right;
				}
				yield return Record("Flip-" + mode, 1.7f, side: true);
				Log(phase + " endclip=" + v.current + " grounded=" + b.characterMotor.isGrounded + " jumps=" + b.characterMotor.jumpCount);
			}
			Reset();
			yield return (object)new WaitForSeconds(0.3f);
			phase = "sub24-open";
			d.move = Vector3.forward;
			weapon.SetNextState((EntityState)(object)new Substitution());
			yield return Record("Substitution-24m", 0.6f, side: false);
			Vector3 val = b.footPosition - home;
			Log("sub24-open displacement=" + ((object)(*(Vector3*)(&val))/*cast due to .constrained prefix*/).ToString());
			Reset();
			yield return (object)new WaitForSeconds(0.2f);
			phase = "sub24-back";
			weapon.SetNextState((EntityState)(object)new Substitution());
			yield return (object)new WaitForSeconds(0.2f);
			val = b.footPosition - home;
			Log("sub24-back displacement=" + ((object)(*(Vector3*)(&val))/*cast due to .constrained prefix*/).ToString());
			Reset();
			GameObject wall = GameObject.CreatePrimitive((PrimitiveType)3);
			wall.layer = LayerIndex.world.intVal;
			wall.transform.position = home + new Vector3(0f, 3f, 10f);
			wall.transform.localScale = new Vector3(10f, 8f, 0.4f);
			Physics.SyncTransforms();
			d.move = Vector3.forward;
			phase = "sub24-wall";
			weapon.SetNextState((EntityState)(object)new Substitution());
			yield return (object)new WaitForSeconds(0.2f);
			val = b.footPosition - home;
			Log("sub24-wall displacement=" + ((object)(*(Vector3*)(&val))/*cast due to .constrained prefix*/).ToString());
			Object.Destroy((Object)(object)wall);
			Reset();
			yield return (object)new WaitForSeconds(0.2f);
			SetFoot(b, home + Vector3.up * 8f);
			d.move = Vector3.forward;
			Probe probe = d;
			val = new Vector3(0f, 0.4f, 1f);
			probe.aim = ((Vector3)(ref val)).normalized;
			int oldJumps = b.characterMotor.jumpCount;
			phase = "sub24-air";
			weapon.SetNextState((EntityState)(object)new Substitution());
			yield return (object)new WaitForSeconds(0.2f);
			string[] obj = new string[6] { "sub24-air displacement=", null, null, null, null, null };
			val = b.footPosition - home;
			obj[1] = ((object)(*(Vector3*)(&val))/*cast due to .constrained prefix*/).ToString();
			obj[2] = " jumps=";
			obj[3] = oldJumps.ToString();
			obj[4] = "->";
			obj[5] = b.characterMotor.jumpCount.ToString();
			Log(string.Concat(obj));
			Reset();
			CharacterBody target = Spawn("LemurianMaster", home + Vector3.forward * 1.8f, 10000f, pin: true);
			yield return (object)new WaitForSeconds(3f);
			Wake(target);
			yield return (object)new WaitForSeconds(0.3f);
			float[] array2 = new float[2] { 1f, 2f };
			for (int num2 = 0; num2 < array2.Length; num2++)
			{
				float rate = array2[num2];
				Reset();
				SetFoot(target, home + Vector3.forward * 1.8f);
				b.baseAttackSpeed = rate;
				b.RecalculateStats();
				strikes02 = 0;
				damage02 = 0f;
				phase = "primary02-" + rate;
				d.attack = true;
				yield return Record("Primary02-" + rate, 2.1f / rate + 0.2f, side: false);
				d.attack = false;
				yield return (object)new WaitForSeconds(0.2f);
				Log(phase + " hits=" + strikes02 + " total=" + damage02 + " expected=468");
			}
			b.baseAttackSpeed = 1f;
			b.RecalculateStats();
			Reset();
			SetFoot(target, home + Vector3.forward * 2f);
			phase = "rotation-contact02";
			strikes02 = 0;
			damage02 = 0f;
			d.secondary = true;
			weapon.SetNextState((EntityState)(object)new Rotation());
			yield return Record("Rotation02", 1.05f, side: false);
			d.secondary = false;
			yield return (object)new WaitForSeconds(0.1f);
			Log("rotation-contact02 pulses=" + strikes02 + " total=" + damage02 + " perPulseExpected=39 protected=" + ((Component)b).GetComponent<NejiBody>().rotating);
			string[] array3 = new string[7] { "Tap-English", "Held-Japanese", "Fast-LowFPS", "Preheld-Jump-Sprint", "Cancel-Jump", "Cancel-Sprint", "Cancel-Substitution" };
			foreach (string mode2 in array3)
			{
				Reset();
				SetFoot(target, home + Vector3.forward * 6f);
				target.healthComponent.health = target.maxHealth;
				((Component)b).GetComponent<NejiBody>().points.Clear();
				yield return (object)new WaitForSeconds(0.25f);
				b.skinIndex = ((mode2 == "Held-Japanese") ? 1u : 0u);
				b.baseAttackSpeed = ((!(mode2 == "Fast-LowFPS")) ? 1 : 4);
				b.RecalculateStats();
				if (mode2 == "Fast-LowFPS")
				{
					Application.targetFrameRate = 20;
				}
				if (mode2 == "Preheld-Jump-Sprint")
				{
					Probe probe2 = d;
					Probe probe3 = d;
					bool jump = true;
					probe3.sprint = true;
					probe2.jump = jump;
					yield return (object)new WaitForSeconds(0.12f);
				}
				b.skillLocator.special.stock = 1;
				strikes02 = 0;
				damage02 = 0f;
				phase = "palms02-" + mode2;
				AkSoundEngine.StartOutputCapture(Path.Combine(Root, mode2 + ".wav"));
				d.special = true;
				yield return (object)new WaitForSeconds(0.08f);
				if (mode2 != "Held-Japanese")
				{
					d.special = false;
				}
				if (mode2.StartsWith("Cancel"))
				{
					yield return (object)new WaitForSeconds(0.8f);
					if (mode2 == "Cancel-Jump")
					{
						d.jump = true;
					}
					else if (mode2 == "Cancel-Sprint")
					{
						d.sprint = true;
					}
					else
					{
						d.utility = true;
						b.skillLocator.utility.stock = 1;
					}
					yield return (object)new WaitForSeconds(0.12f);
					Log(mode2 + " active=" + ((Component)b).GetComponent<NejiBody>().barrage + " jumpVelocity=" + b.characterMotor.velocity.y + " sprint=" + b.isSprinting + " state=" + ((object)weapon.state).GetType().Name);
					Probe probe4 = d;
					Probe probe5 = d;
					Probe probe6 = d;
					bool jump = false;
					probe6.utility = false;
					probe4.jump = (probe5.sprint = jump);
					yield return (object)new WaitForSeconds(0.5f);
				}
				else
				{
					yield return Record("64Palms-" + mode2, (mode2 == "Fast-LowFPS") ? 4.1f : 5.8f, side: false);
				}
				AkSoundEngine.StopOutputCapture();
				Log(phase + " strikes=" + strikes02 + " total=" + damage02 + " protection=" + ((Component)b).GetComponent<NejiBody>().barrage + " stock=" + b.skillLocator.special.stock);
				d.special = false;
				Application.targetFrameRate = -1;
			}
			b.baseAttackSpeed = 1f;
			b.RecalculateStats();
			Reset();
			SetFoot(target, home + Vector3.forward * 5f);
			target.healthComponent.health = target.maxHealth;
			for (int i = 0; i < 8; i++)
			{
				((Component)b).GetComponent<NejiBody>().AddPoint(target.healthComponent);
			}
			phase = "palms02-points";
			strikes02 = 0;
			damage02 = 0f;
			weapon.SetNextState((EntityState)(object)new SixtyFourPalms());
			yield return (object)new WaitForSeconds(5.8f);
			Log("points hits=" + strikes02 + " total=" + damage02 + " expected=2016 remaining=" + ((Component)b).GetComponent<NejiBody>().points.Count);
			Reset();
			SetFoot(target, home + new Vector3(-3f, 0f, 5f));
			target.healthComponent.health = 30f;
			CharacterBody second = Spawn("LemurianMaster", home + new Vector3(3f, 0f, 5f), 10000f, pin: true);
			yield return (object)new WaitForSeconds(3f);
			Wake(second);
			yield return (object)new WaitForSeconds(0.3f);
			phase = "palms02-redirect";
			strikes02 = 0;
			damage02 = 0f;
			weapon.SetNextState((EntityState)(object)new SixtyFourPalms());
			yield return Record("64Palms-Redirect02", 5.8f, side: false);
			Log("redirect hits=" + strikes02 + " firstAlive=" + target.healthComponent.alive + " secondLoss=" + (second.maxHealth - second.healthComponent.health));
			Reset();
			SetFoot(second, home + Vector3.forward * 6f);
			second.healthComponent.health = 20f;
			phase = "palms02-exhausted";
			strikes02 = 0;
			weapon.SetNextState((EntityState)(object)new SixtyFourPalms());
			yield return (object)new WaitForSeconds(0.9f);
			Log("all-dead strikes=" + strikes02 + " clean=" + !((Component)b).GetComponent<NejiBody>().barrage + " state=" + ((object)weapon.state).GetType().Name);
			Reset();
			yield return (object)new WaitForSeconds(0.5f);
			Log("logs-active=" + Object.FindObjectsOfType<SubstitutionLog>().Length);
			phase = "earlystage-natural-enemy";
			CharacterBody normal = Spawn("LemurianMaster", home + Vector3.forward * 1.8f, 0f, pin: false);
			yield return (object)new WaitForSeconds(3f);
			Log("earlystage difficulty=" + ((object)Run.instance.selectedDifficulty/*cast due to .constrained prefix*/).ToString() + " playerLevel=" + b.level + " enemyLevel=" + normal.level + " enemyHealth=" + normal.maxHealth + " damage=" + b.damage + " items=" + b.inventory.GetTotalItemCountOfTier((ItemTier)0));
			d.attack = true;
			d.stopAt = 99;
			yield return Record("Earlystage-Combat02", 3f, side: false);
			d.attack = false;
			Log("normal-enemy alive=" + normal.healthComponent.alive);
			Log("CANDIDATE02_DONE");
			Object.Destroy((Object)(object)d);
			Application.Quit();
		}

		private static void Remove03(CharacterBody x)
		{
			if (Object.op_Implicit((Object)(object)x))
			{
				if (Object.op_Implicit((Object)(object)x.master))
				{
					Object.Destroy((Object)(object)((Component)x.master).gameObject);
				}
				Object.Destroy((Object)(object)((Component)x).gameObject);
			}
		}

		private unsafe static IEnumerator Check03()
		{
			Diagnostics03.enabled = true;
			b.baseRegen = (b.levelRegen = 0f);
			b.RecalculateStats();
			Combat.OnDamage = (Action<string, CharacterBody, HealthComponent, float>)Delegate.Combine(Combat.OnDamage, (Action<string, CharacterBody, HealthComponent, float>)delegate(string kind, CharacterBody owner, HealthComponent val2, float amount)
			{
				if ((Object)(object)owner == (Object)(object)b && kind.StartsWith("palms-"))
				{
					hits03++;
					damage03 += amount;
				}
			});
			Log("LOADED03 radius=" + Tuning.PalmsRadius.Value + " awareness=" + Tuning.Awareness.Value + " sub=" + Tuning.SubDistance.Value + " damage=" + Tuning.PalmsDamage.Value);
			uint[] array = new uint[2] { 1u, 15u };
			Vector3 val;
			for (int num = 0; num < array.Length; num++)
			{
				uint level = array[num];
				TeamManager.instance.SetTeamLevel((TeamIndex)2, level);
				string[] array2 = new string[2] { "WispMaster", "GolemMaster" };
				foreach (string species in array2)
				{
					Reset();
					CharacterBody e = Spawn(species, home + new Vector3(0f, (float)((species == "WispMaster") ? 2 : 0), 8f), 0f, pin: true);
					yield return (object)new WaitForSeconds(3f);
					Wake(e);
					e.baseRegen = (e.levelRegen = 0f);
					e.RecalculateStats();
					e.healthComponent.health = e.maxHealth;
					yield return (object)new WaitForSeconds(0.2f);
					d.secondary = true;
					weapon.SetNextState((EntityState)(object)new Rotation());
					yield return (object)new WaitForSeconds(0.06f);
					HealthComponent h = e.healthComponent;
					float hp = b.healthComponent.health;
					float before = h.health;
					float max = h.fullHealth;
					phase = "counter03-" + species + "-" + level;
					Log(phase + " level=" + e.level + " before=" + before + " max=" + max + " armor=" + e.armor);
					EntityStateMachine ew = ((Component)e).GetComponents<EntityStateMachine>().First((EntityStateMachine val2) => val2.customName == "Weapon");
					val = b.corePosition - e.inputBank.aimOrigin;
					Vector3 aim = ((Vector3)(ref val)).normalized;
					e.inputBank.aimDirection = aim;
					if (species == "WispMaster")
					{
						ew.SetNextState((EntityState)new FireEmbers());
					}
					else
					{
						ew.SetNextState((EntityState)new FireLaser
						{
							laserDirection = aim
						});
					}
					yield return Record("Rotation03-" + species + "-" + level, 0.6f, side: false);
					Log(phase + " after=" + (Object.op_Implicit((Object)(object)h) ? h.health : 0f) + " removed=" + (before - (Object.op_Implicit((Object)(object)h) ? h.health : 0f)) + " playerLoss=" + (hp - b.healthComponent.health));
					d.secondary = false;
					yield return (object)new WaitForSeconds(0.1f);
					Log(phase + " protection=" + ((Component)b).GetComponent<NejiBody>().rotating);
					Remove03(e);
				}
			}
			TeamManager.instance.SetTeamLevel((TeamIndex)2, 1u);
			string[] array3 = new string[7] { "up", "diagonal-up", "down", "wall", "ceiling", "back", "strafe" };
			foreach (string mode in array3)
			{
				Reset();
				SetFoot(b, home + Vector3.up * (float)((mode == "down") ? 15 : 0));
				yield return (object)new WaitForSeconds(0.15f);
				Probe probe = d;
				Vector3 move;
				switch (mode)
				{
				default:
					move = Vector3.forward;
					break;
				case "diagonal-up":
					val = new Vector3(1f, 0f, 1f);
					move = ((Vector3)(ref val)).normalized;
					break;
				case "strafe":
					move = Vector3.right;
					break;
				case "back":
					move = Vector3.zero;
					break;
				}
				probe.move = move;
				Probe probe2 = d;
				Vector3 aim2;
				if (!(mode == "down"))
				{
					if (!mode.Contains("up") && !(mode == "ceiling"))
					{
						aim2 = Vector3.forward;
					}
					else
					{
						val = new Vector3(0f, 0.8f, 1f);
						aim2 = ((Vector3)(ref val)).normalized;
					}
				}
				else
				{
					val = new Vector3(0f, -0.7f, 1f);
					aim2 = ((Vector3)(ref val)).normalized;
				}
				probe2.aim = aim2;
				GameObject obstacle = null;
				if (mode == "wall" || mode == "ceiling")
				{
					obstacle = GameObject.CreatePrimitive((PrimitiveType)3);
					obstacle.layer = LayerIndex.world.intVal;
					obstacle.transform.position = home + ((mode == "wall") ? new Vector3(0f, 3f, 8f) : new Vector3(0f, 4f, 4f));
					obstacle.transform.localScale = ((mode == "wall") ? new Vector3(12f, 10f, 0.4f) : new Vector3(12f, 0.4f, 12f));
					Physics.SyncTransforms();
				}
				phase = "sub03-" + mode;
				Vector3 start = b.footPosition;
				weapon.SetNextState((EntityState)(object)new Substitution());
				yield return (object)new WaitForFixedUpdate();
				string[] obj = new string[7] { phase, " displacement=", null, null, null, null, null };
				val = b.footPosition - start;
				obj[2] = ((object)(*(Vector3*)(&val))/*cast due to .constrained prefix*/).ToString();
				obj[3] = " velocity=";
				val = b.characterMotor.velocity;
				obj[4] = ((object)(*(Vector3*)(&val))/*cast due to .constrained prefix*/).ToString();
				obj[5] = " jumps=";
				obj[6] = b.characterMotor.jumpCount.ToString();
				Log(string.Concat(obj));
				yield return Record("Sub03-" + mode, 0.35f, side: true);
				if (Object.op_Implicit((Object)(object)obstacle))
				{
					Object.Destroy((Object)(object)obstacle);
				}
			}
			bool[] array4 = new bool[2] { false, true };
			for (int num4 = 0; num4 < array4.Length; num4++)
			{
				bool teleport = array4[num4];
				Reset();
				yield return (object)new WaitForSeconds(0.2f);
				b.healthComponent.health = b.maxHealth;
				SetFoot(b, home + Vector3.up * 35f);
				((BaseCharacterController)b.characterMotor).Motor.ForceUnground(0.1f);
				yield return (object)new WaitForFixedUpdate();
				b.characterMotor.velocity = Vector3.down * 40f;
				yield return (object)new WaitForSeconds(0.15f);
				float hp2 = b.healthComponent.health;
				float wait = Time.time + 5f;
				while (b.footPosition.y - home.y > 2f && Time.time < wait)
				{
					yield return (object)new WaitForFixedUpdate();
				}
				phase = "fall03-teleport=" + teleport;
				if (teleport)
				{
					d.move = Vector3.forward;
					d.aim = Vector3.forward;
					weapon.SetNextState((EntityState)(object)new Substitution());
				}
				yield return (object)new WaitForSeconds(0.8f);
				string[] obj2 = new string[7]
				{
					phase,
					" healthLoss=",
					(hp2 - b.healthComponent.health).ToString(),
					" grounded=",
					b.characterMotor.isGrounded.ToString(),
					" lastVelocity=",
					null
				};
				val = b.characterMotor.lastVelocity;
				obj2[6] = ((object)(*(Vector3*)(&val))/*cast due to .constrained prefix*/).ToString();
				Log(string.Concat(obj2));
			}
			Reset();
			yield return (object)new WaitForSeconds(0.2f);
			string[] array5 = new string[3] { "Relaxed_Idle", "Combat_Idle", "Selection_Idle" };
			RaycastHit hit = default(RaycastHit);
			foreach (string clip in array5)
			{
				v.reviewOverride = true;
				v.Play(clip, 1f, 0f, restart: true, 0f);
				yield return (object)new WaitForSeconds(0.2f);
				Physics.Raycast(b.footPosition + Vector3.up * 0.3f, Vector3.down, ref hit, 3f, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask));
				Log("GROUND03 after=" + clip + " soleAboveSurface=" + (SoleHeight() + b.footPosition.y - ((RaycastHit)(ref hit)).point.y));
				yield return Record("Ground03-" + clip, 0.4f, side: true);
			}
			v.reviewOverride = false;
			d.move = Vector3.forward;
			yield return Record("Ground03-Walk", 2f, side: true);
			Reset();
			bool[] array6 = new bool[2] { true, false };
			for (int num6 = 0; num6 < array6.Length; num6++)
			{
				bool legacy = array6[num6];
				Reset();
				float saved = Tuning.PalmsRadius.Value;
				Tuning.PalmsRadius.Value = 15f;
				GameObject wall = GameObject.CreatePrimitive((PrimitiveType)3);
				wall.layer = LayerIndex.world.intVal;
				wall.transform.position = home + new Vector3(0f, 2f, 10f);
				wall.transform.localScale = new Vector3(1f, 5f, 12f);
				CharacterBody first = Spawn("LemurianMaster", home + new Vector3(-5f, 0f, 8f), 20f, pin: true);
				CharacterBody second = Spawn("LemurianMaster", home + new Vector3(5f, 0f, 8f), 10000f, pin: true);
				yield return (object)new WaitForSeconds(3f);
				Wake(first);
				Wake(second);
				yield return (object)new WaitForSeconds(0.2f);
				Probe probe3 = d;
				val = first.corePosition - b.corePosition;
				probe3.aim = ((Vector3)(ref val)).normalized;
				phase = "terrain-death-legacy=" + legacy;
				hits03 = 0;
				damage03 = 0f;
				Log(phase + " activationCandidates=" + Combat.Targets(b, b.corePosition, requireSafe: false).Count);
				if (legacy)
				{
					weapon.SetNextState((EntityState)(object)new LegacyPalms02());
				}
				else
				{
					weapon.SetNextState((EntityState)(object)new SixtyFourPalms());
				}
				yield return Record("64Palms-Terrain-" + legacy, 5.9f, side: false);
				Log(phase + " hits=" + hits03 + " secondLoss=" + (second.maxHealth - second.healthComponent.health));
				Remove03(first);
				Remove03(second);
				Object.Destroy((Object)(object)wall);
				Tuning.PalmsRadius.Value = saved;
			}
			string[] array7 = new string[6] { "Single-English", "Single-Japanese", "Ground-NoAim", "Air-NoAim", "FinalTargetDeath", "Fast" };
			foreach (string mode2 in array7)
			{
				Reset();
				b.skinIndex = ((mode2 == "Single-Japanese") ? 1u : 0u);
				b.baseAttackSpeed = ((!(mode2 == "Fast")) ? 1 : 4);
				b.RecalculateStats();
				((Component)b).GetComponent<NejiBody>().points.Clear();
				List<CharacterBody> list = new List<CharacterBody>();
				bool air = mode2 == "Air-NoAim";
				bool crowd = mode2.Contains("NoAim") || mode2 == "FinalTargetDeath";
				list.Add(Spawn(air ? "WispMaster" : "LemurianMaster", home + new Vector3(-2f, (float)(air ? 6 : 0), 6f), crowd ? 20 : 10000, pin: true));
				if (crowd)
				{
					list.Add(Spawn(air ? "WispMaster" : "LemurianMaster", home + new Vector3(6f, (float)(air ? 9 : 0), 10f), 10000f, pin: true));
					list.Add(Spawn(air ? "WispMaster" : "LemurianMaster", home + new Vector3(-7f, (float)(air ? 4 : 0), 13f), 10000f, pin: true));
				}
				yield return (object)new WaitForSeconds(3f);
				foreach (CharacterBody x in list)
				{
					Wake(x);
				}
				yield return (object)new WaitForSeconds(0.2f);
				Probe probe4 = d;
				Vector3 aim3;
				if (!mode2.Contains("NoAim"))
				{
					val = list[0].corePosition - b.corePosition;
					aim3 = ((Vector3)(ref val)).normalized;
				}
				else
				{
					aim3 = Vector3.back;
				}
				probe4.aim = aim3;
				phase = "staged03-" + mode2;
				hits03 = 0;
				damage03 = 0f;
				weapon.SetNextState((EntityState)(object)new SixtyFourPalms());
				yield return Record("64Palms03-" + mode2, (mode2 == "Fast") ? 4f : 5.8f, side: false);
				Log(phase + " hits=" + hits03 + " damage=" + damage03 + " protection=" + ((Component)b).GetComponent<NejiBody>().barrage);
				foreach (CharacterBody x2 in list)
				{
					Remove03(x2);
				}
			}
			b.baseAttackSpeed = 1f;
			b.RecalculateStats();
			Reset();
			Log("CHECK03_DONE");
			Object.Destroy((Object)(object)d);
			Application.Quit();
		}

		private unsafe static IEnumerator Check04()
		{
			Diagnostics03.enabled = true;
			b.baseRegen = (b.levelRegen = 0f);
			b.RecalculateStats();
			Combat.OnDamage = (Action<string, CharacterBody, HealthComponent, float>)Delegate.Combine(Combat.OnDamage, (Action<string, CharacterBody, HealthComponent, float>)delegate(string kind, CharacterBody owner, HealthComponent h, float amount)
			{
				if ((Object)(object)owner == (Object)(object)b && kind.StartsWith("palms-"))
				{
					hits03++;
					damage03 += amount;
				}
			});
			Log("SETUP04 Rainstorm playerLevel=" + b.level + " enemyLevel=" + TeamManager.instance.GetTeamLevel((TeamIndex)2) + " items=" + b.inventory.GetTotalItemCountOfTier((ItemTier)0) + " damage=" + b.damage + " inner=" + Tuning.PalmsInnerRadius.Value + " outer=" + Tuning.PalmsRadius.Value);
			string[] array = new string[2] { "BeetleQueenMaster", "WispMaster" };
			foreach (string master in array)
			{
				Reset();
				CharacterBody e = Spawn(master, home + new Vector3(0f, (float)((master == "WispMaster") ? 7 : 0), 5f), 100000f, pin: true);
				yield return (object)new WaitForSeconds(3f);
				Wake(e);
				SetFoot(b, home + Vector3.up * 4f);
				((BaseCharacterController)b.characterMotor).Motor.ForceUnground(0.1f);
				yield return (object)new WaitForFixedUpdate();
				b.characterMotor.velocity = Vector3.down * 12f;
				phase = "air04-" + master;
				hits03 = 0;
				damage03 = 0f;
				Log(phase + " canExecute=" + b.skillLocator.special.skillDef.CanExecute(b.skillLocator.special) + " targetBounds=" + ((object)Position04.Bounds(e)/*cast due to .constrained prefix*/).ToString() + " targetDistance=" + Vector3.Distance(b.corePosition, e.corePosition));
				weapon.SetNextState((EntityState)(object)new SixtyFourPalms());
				yield return Record("64Palms04-" + master, 6.3f, side: false);
				Log(phase + " hits=" + hits03 + " damage=" + damage03 + " gravity=" + b.characterMotor.gravityParameters.channeledAntiGravityGranterCount + " override=" + v.skillOverride);
				Remove03(e);
			}
			Reset();
			SetFoot(b, home + Vector3.up * 5f);
			((BaseCharacterController)b.characterMotor).Motor.ForceUnground(0.1f);
			CharacterBody f1 = Spawn("WispMaster", home + new Vector3(0f, 5f, 5f), 20f, pin: true);
			CharacterBody f2 = Spawn("WispMaster", home + new Vector3(10f, 8f, 10f), 10000f, pin: true);
			CharacterBody f3 = Spawn("WispMaster", home + new Vector3(-10f, 9f, 13f), 10000f, pin: true);
			yield return (object)new WaitForSeconds(3f);
			CharacterBody[] array2 = (CharacterBody[])(object)new CharacterBody[3] { f1, f2, f3 };
			foreach (CharacterBody e2 in array2)
			{
				Wake(e2);
			}
			SetFoot(b, home + Vector3.up * 5f);
			((BaseCharacterController)b.characterMotor).Motor.ForceUnground(0.1f);
			yield return (object)new WaitForFixedUpdate();
			d.aim = Vector3.back;
			phase = "air04-inner-outer-noaim";
			hits03 = 0;
			weapon.SetNextState((EntityState)(object)new SixtyFourPalms());
			yield return Record("64Palms04-FlyingGroup", 6.3f, side: false);
			Log(phase + " hits=" + hits03 + " firstAlive=" + f1.healthComponent.alive + " outerHP=" + f2.healthComponent.health + "," + f3.healthComponent.health);
			CharacterBody[] array3 = (CharacterBody[])(object)new CharacterBody[3] { f1, f2, f3 };
			foreach (CharacterBody e3 in array3)
			{
				Remove03(e3);
			}
			Reset();
			CharacterBody outside = Spawn("WispMaster", home + new Vector3(0f, 6f, 16f), 10000f, pin: true);
			yield return (object)new WaitForSeconds(3f);
			Wake(outside);
			Log("OUTER_ONLY canExecute=" + b.skillLocator.special.skillDef.CanExecute(b.skillLocator.special));
			Remove03(outside);
			Reset();
			CharacterBody c = Spawn("WispMaster", home + new Vector3(0f, 6f, 5f), 10000f, pin: true);
			yield return (object)new WaitForSeconds(3f);
			Wake(c);
			SetFoot(b, home + Vector3.up * 5f);
			((BaseCharacterController)b.characterMotor).Motor.ForceUnground(0.1f);
			yield return (object)new WaitForFixedUpdate();
			weapon.SetNextState((EntityState)(object)new SixtyFourPalms());
			yield return (object)new WaitForSeconds(0.7f);
			d.jump = true;
			yield return (object)new WaitForSeconds(0.08f);
			d.jump = false;
			yield return (object)new WaitForSeconds(0.5f);
			string[] obj = new string[8]
			{
				"CANCEL04 barrage=",
				((Component)b).GetComponent<NejiBody>().barrage.ToString(),
				" gravity=",
				b.characterMotor.gravityParameters.channeledAntiGravityGranterCount.ToString(),
				" velocity=",
				null,
				null,
				null
			};
			Vector3 val = b.characterMotor.velocity;
			obj[5] = ((object)(*(Vector3*)(&val))/*cast due to .constrained prefix*/).ToString();
			obj[6] = " clip=";
			obj[7] = v.current;
			Log(string.Concat(obj));
			Remove03(c);
			float[] array4 = new float[2] { 6f, 14f };
			for (int num4 = 0; num4 < array4.Length; num4++)
			{
				float distance = array4[num4];
				Reset();
				CharacterBody pest = Spawn("FlyingVerminMaster", home + new Vector3(0f, 3f, distance), 10000f, pin: true);
				yield return (object)new WaitForSeconds(3f);
				Wake(pest);
				phase = "pest04-" + distance;
				float hp = b.healthComponent.health;
				float before = pest.healthComponent.health;
				d.secondary = true;
				weapon.SetNextState((EntityState)(object)new Rotation());
				EntityStateMachine w = ((IEnumerable<EntityStateMachine>)((Component)pest).GetComponents<EntityStateMachine>()).FirstOrDefault((Func<EntityStateMachine, bool>)((EntityStateMachine x) => x.customName == "Weapon"));
				Log("PEST weapon=" + (Object.op_Implicit((Object)(object)w) ? w.customName : "missing"));
				InputBankTest inputBank = pest.inputBank;
				val = b.corePosition - pest.inputBank.aimOrigin;
				inputBank.aimDirection = ((Vector3)(ref val)).normalized;
				if (Object.op_Implicit((Object)(object)w))
				{
					w.SetNextState((EntityState)new Spit());
				}
				if (distance > 10f)
				{
					((Component)pest).gameObject.AddComponent<MovingFixture04>();
				}
				yield return Record("Rotation04-Pest-" + distance, 2.5f, side: false);
				d.secondary = false;
				yield return (object)new WaitForSeconds(0.3f);
				Log(phase + " enemyLoss=" + (before - pest.healthComponent.health) + " playerLoss=" + (hp - b.healthComponent.health));
				Remove03(pest);
			}
			string[] array5 = new string[2] { "WispMaster", "GolemMaster" };
			foreach (string master2 in array5)
			{
				Reset();
				CharacterBody e4 = Spawn(master2, home + Vector3.forward * 8f, 0f, pin: true);
				yield return (object)new WaitForSeconds(3f);
				Wake(e4);
				yield return (object)new WaitForSeconds(0.2f);
				phase = "counter04-" + master2;
				float hp2 = b.healthComponent.health;
				float before2 = e4.healthComponent.health;
				d.secondary = true;
				weapon.SetNextState((EntityState)(object)new Rotation());
				yield return (object)new WaitForSeconds(0.1f);
				EntityStateMachine ew = ((Component)e4).GetComponents<EntityStateMachine>().First((EntityStateMachine x) => x.customName == "Weapon");
				for (int attempt = 0; attempt < 2; attempt++)
				{
					if (!Object.op_Implicit((Object)(object)e4))
					{
						break;
					}
					if (!(e4.healthComponent.health >= before2))
					{
						break;
					}
					InputBankTest inputBank2 = e4.inputBank;
					val = b.corePosition - e4.inputBank.aimOrigin;
					inputBank2.aimDirection = ((Vector3)(ref val)).normalized;
					if (master2 == "WispMaster")
					{
						ew.SetNextState((EntityState)new FireEmbers());
					}
					else
					{
						ew.SetNextState((EntityState)new FireLaser
						{
							laserDirection = e4.inputBank.aimDirection
						});
					}
					yield return (object)new WaitForSeconds(0.65f);
					if (Object.op_Implicit((Object)(object)e4))
					{
						ew.SetNextStateToMain();
					}
				}
				Log(phase + " before=" + before2 + " after=" + e4.healthComponent.health + " playerLoss=" + (hp2 - b.healthComponent.health));
				d.secondary = false;
				yield return (object)new WaitForSeconds(0.2f);
				Remove03(e4);
			}
			Reset();
			phase = "rotation04-audio";
			Log("audio=" + ((object)AkSoundEngine.StartOutputCapture(Path.Combine(Root, "Rotation04.wav"))/*cast due to .constrained prefix*/).ToString());
			d.secondary = true;
			weapon.SetNextState((EntityState)(object)new Rotation());
			yield return Record("Rotation04-Hold", 3f, side: false);
			d.secondary = false;
			yield return (object)new WaitForSeconds(0.5f);
			AkSoundEngine.StopOutputCapture();
			Log("rotation04-cleanup flags=" + ((Component)b).GetComponent<NejiBody>().rotating + " roots=" + Object.FindObjectsOfType<GameObject>().Count((GameObject x) => ((Object)x).name == "Neji local technique visual"));
			float[] array6 = new float[2] { 10f, 28f };
			RaycastHit hit = default(RaycastHit);
			for (int num6 = 0; num6 < array6.Length; num6++)
			{
				float angle = array6[num6];
				Reset();
				GameObject slope = GameObject.CreatePrimitive((PrimitiveType)3);
				slope.layer = LayerIndex.world.intVal;
				slope.transform.position = home + new Vector3(0f, 5f, 0f);
				slope.transform.localScale = new Vector3(12f, 0.2f, 65f);
				slope.transform.rotation = Quaternion.Euler(0f - angle, 0f, 0f);
				Physics.SyncTransforms();
				Physics.Raycast(home + Vector3.up * 30f, Vector3.down, ref hit, 40f, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask));
				SetFoot(b, ((RaycastHit)(ref hit)).point + Vector3.up * 0.06f);
				yield return (object)new WaitForSeconds(0.4f);
				Vector3 start = b.footPosition;
				d.move = Vector3.forward;
				d.aim = Vector3.forward;
				phase = "slope04-" + angle;
				weapon.SetNextState((EntityState)(object)new Substitution());
				yield return (object)new WaitForSeconds(0.03f);
				d.move = Vector3.zero;
				yield return Record("Substitution04-Slope-" + angle, 0.9f, side: true);
				string[] obj2 = new string[5] { phase, " delta=", null, null, null };
				val = b.footPosition - start;
				obj2[2] = ((object)(*(Vector3*)(&val))/*cast due to .constrained prefix*/).ToString();
				obj2[3] = " travel=";
				obj2[4] = Vector3.Distance(start, b.footPosition).ToString();
				Log(string.Concat(obj2));
				Object.Destroy((Object)(object)slope);
			}
			Reset();
			GameObject wall = GameObject.CreatePrimitive((PrimitiveType)3);
			wall.layer = LayerIndex.world.intVal;
			wall.transform.position = home + new Vector3(0f, 3f, 5f);
			wall.transform.localScale = new Vector3(10f, 8f, 0.4f);
			Physics.SyncTransforms();
			d.move = Vector3.forward;
			weapon.SetNextState((EntityState)(object)new Substitution());
			yield return (object)new WaitForSeconds(0.03f);
			d.move = Vector3.zero;
			yield return (object)new WaitForSeconds(0.2f);
			val = b.footPosition - home;
			Log("WALL04 delta=" + ((object)(*(Vector3*)(&val))/*cast due to .constrained prefix*/).ToString());
			Object.Destroy((Object)(object)wall);
			Reset();
			d.move = Vector3.forward;
			Probe probe = d;
			val = new Vector3(0f, 0.8f, 1f);
			probe.aim = ((Vector3)(ref val)).normalized;
			weapon.SetNextState((EntityState)(object)new Substitution());
			yield return (object)new WaitForSeconds(0.03f);
			d.move = Vector3.zero;
			yield return Record("Substitution04-Up-Smoke", 1f, side: false);
			val = b.footPosition - home;
			Log("UP04 delta=" + ((object)(*(Vector3*)(&val))/*cast due to .constrained prefix*/).ToString());
			Reset();
			v.reviewOverride = true;
			string[] array7 = new string[4] { "Walk", "Backward", "Strafe_Left", "Strafe_Right" };
			foreach (string name in array7)
			{
				v.Play(name, 1f, 0f, restart: true, 0f);
				yield return Record("Hands04-" + name, 2.5f, side: true);
			}
			v.reviewOverride = false;
			Reset();
			d.move = Vector3.forward;
			yield return Record("Hands04-Gameplay-Walk", 2.8f, side: false);
			Reset();
			yield return (object)new WaitForSeconds(0.3f);
			Log("CHECK04_DONE");
			Object.Destroy((Object)(object)d);
			Application.Quit();
		}

		private static IEnumerator CorrectionRecheckRC02()
		{
			Diagnostics03.enabled = true;
			b.baseRegen = 0f;
			b.RecalculateStats();
			Combat.OnDamage = (Action<string, CharacterBody, HealthComponent, float>)Delegate.Combine(Combat.OnDamage, (Action<string, CharacterBody, HealthComponent, float>)delegate(string kind, CharacterBody owner, HealthComponent h, float amount)
			{
				if ((Object)(object)owner == (Object)(object)b && kind.StartsWith("palms-"))
				{
					strikesRC02++;
				}
			});
			Reset();
			CharacterBody e = Spawn("WispMaster", home + new Vector3(0f, 3f, 5f), 100000f, pin: true);
			yield return (object)new WaitForSeconds(2f);
			Wake(e);
			yield return (object)new WaitForSeconds(0.25f);
			SetFoot(b, home + Vector3.up * 3f);
			((BaseCharacterController)b.characterMotor).Motor.ForceUnground(0.1f);
			yield return (object)new WaitForFixedUpdate();
			phase = "RC02-cancel-recheck";
			strikesRC02 = 0;
			weapon.SetNextState((EntityState)(object)new SixtyFourPalms());
			yield return (object)new WaitForSeconds(0.8f);
			Log("RC02_CANCEL_ACTIVE strikes=" + strikesRC02 + " protected=" + ((Component)b).GetComponent<NejiBody>().barrage + " clip=" + v.current);
			d.jump = true;
			yield return (object)new WaitForSeconds(0.1f);
			d.jump = false;
			int at = strikesRC02;
			yield return (object)new WaitForSeconds(0.5f);
			Log("RC02_CANCEL_CONFIRMED at=" + at + " after=" + strikesRC02 + " protected=" + ((Component)b).GetComponent<NejiBody>().barrage + " gravity=" + b.characterMotor.gravityParameters.channeledAntiGravityGranterCount);
			Remove03(e);
			Reset();
			e = Spawn("WispMaster", home + new Vector3(0f, 3f, 5f), 30f, pin: true);
			yield return (object)new WaitForSeconds(2f);
			Wake(e);
			yield return (object)new WaitForSeconds(0.25f);
			SetFoot(b, home + Vector3.up * 3f);
			((BaseCharacterController)b.characterMotor).Motor.ForceUnground(0.1f);
			yield return (object)new WaitForFixedUpdate();
			strikesRC02 = 0;
			phase = "RC02-early-clear";
			weapon.SetNextState((EntityState)(object)new SixtyFourPalms());
			yield return (object)new WaitForSeconds(2f);
			Log("RC02_CLEAR strikes=" + strikesRC02 + " dead=" + (!Object.op_Implicit((Object)(object)e) || !e.healthComponent.alive) + " protected=" + ((Component)b).GetComponent<NejiBody>().barrage + " gravity=" + b.characterMotor.gravityParameters.channeledAntiGravityGranterCount);
			Remove03(e);
			Reset();
			e = Spawn("FlyingVerminMaster", home + new Vector3(0f, 3f, 8f), 10000f, pin: true);
			yield return (object)new WaitForSeconds(2f);
			Wake(e);
			yield return (object)new WaitForSeconds(0.2f);
			phase = "RC02-pest-final";
			d.secondary = true;
			weapon.SetNextState((EntityState)(object)new Rotation());
			yield return (object)new WaitForSeconds(0.1f);
			float before = e.healthComponent.health;
			float hp = b.healthComponent.health;
			EntityStateMachine ew = ((Component)e).GetComponents<EntityStateMachine>().First((EntityStateMachine x) => x.customName == "Weapon");
			InputBankTest inputBank = e.inputBank;
			Vector3 val = b.corePosition - e.inputBank.aimOrigin;
			inputBank.aimDirection = ((Vector3)(ref val)).normalized;
			ew.SetNextState((EntityState)new Spit());
			yield return Record("Pest-Return-RC02-Final", 1f, side: false);
			Log("RC02_PEST_FINAL returned=" + (before - e.healthComponent.health) + " incoming=" + (hp - b.healthComponent.health));
			d.secondary = false;
			yield return (object)new WaitForSeconds(0.2f);
			Remove03(e);
			Reset();
			d.secondary = true;
			Rotation state = new Rotation();
			weapon.SetNextState((EntityState)(object)state);
			yield return (object)new WaitForSeconds(0.2f);
			RotationVisualRC02 fx = ((Component)b).GetComponentInChildren<RotationVisualRC02>();
			OwnedFx owned = ((Component)fx).GetComponent<OwnedFx>();
			Object.Destroy((Object)(object)owned.Root);
			yield return (object)new WaitForSeconds(0.15f);
			Log("RC02_FX_RECOVERY visible=" + fx.Visible + " builds=" + fx.rebuilds);
			yield return Record("Rotation-RC02-Final", 1.3f, side: false);
			d.secondary = false;
			yield return (object)new WaitForSeconds(0.2f);
			Log("RC02_FX_ENDED remaining=" + ((Component)b).GetComponentsInChildren<RotationVisualRC02>().Length);
			Log("RC02_RECHECK_DONE");
			Application.Quit();
		}

		private static IEnumerator Defense02()
		{
			Combat.traceDefense = true;
			string[] array = new string[2] { "WispMaster", "GolemMaster" };
			foreach (string species in array)
			{
				Reset();
				CharacterBody enemy = Spawn(species, home + new Vector3(0f, (float)((species == "WispMaster") ? 2 : 0), 8f), 10000f, pin: true);
				yield return (object)new WaitForSeconds(3f);
				Wake(enemy);
				yield return (object)new WaitForSeconds(0.3f);
				EntityStateMachine ew = ((IEnumerable<EntityStateMachine>)((Component)enemy).GetComponents<EntityStateMachine>()).FirstOrDefault((Func<EntityStateMachine, bool>)((EntityStateMachine x) => x.customName == "Weapon")) ?? ((Component)enemy).GetComponents<EntityStateMachine>().First();
				Log("attack-state " + species + " machine=" + ew.customName + " enemyDamage=" + enemy.damage);
				string[] array2 = new string[4] { "unprotected", "original-rotation", "fixed-rotation", "after-release" };
				foreach (string mode in array2)
				{
					phase = species + "-" + mode;
					Combat.defense02 = mode != "original-rotation";
					Reset();
					yield return (object)new WaitForSeconds(0.15f);
					if (mode.Contains("rotation"))
					{
						d.secondary = true;
						weapon.SetNextState((EntityState)(object)new Rotation());
					}
					yield return (object)new WaitForSeconds(0.12f);
					float hp = b.healthComponent.health;
					float ehp = enemy.healthComponent.health;
					for (int shot = 0; shot < 3; shot++)
					{
						Vector3 val = b.corePosition - enemy.inputBank.aimOrigin;
						Vector3 direction = ((Vector3)(ref val)).normalized;
						enemy.inputBank.aimDirection = direction;
						if (species == "GolemMaster")
						{
							ew.SetNextState((EntityState)new FireLaser
							{
								laserDirection = direction
							});
						}
						else
						{
							ew.SetNextState((EntityState)new FireEmbers());
						}
						yield return (object)new WaitForSeconds(0.35f);
						ew.SetNextStateToMain();
						yield return (object)new WaitForSeconds(0.1f);
					}
					Log(phase + " playerLoss=" + (hp - b.healthComponent.health) + " enemyLoss=" + (ehp - enemy.healthComponent.health) + " protecting=" + ((Component)b).GetComponent<NejiBody>().rotating);
					if (mode == "fixed-rotation")
					{
						yield return Record(species + "-Rotation", 0.7f, side: false);
					}
					d.secondary = false;
					yield return (object)new WaitForSeconds(0.15f);
				}
				Object.Destroy((Object)(object)((Component)enemy.master).gameObject);
				Object.Destroy((Object)(object)((Component)enemy).gameObject);
			}
			Combat.defense02 = true;
			Log("DEFENSE02_DONE");
			Object.Destroy((Object)(object)d);
			Application.Quit();
		}

		private static IEnumerator Edge()
		{
			phase = "rotation-speed";
			float ordinary = b.moveSpeed;
			d.secondary = true;
			d.move = Vector3.forward;
			yield return (object)new WaitForSeconds(0.4f);
			Log("rotation speed-stat=" + b.moveSpeed + " velocity=" + ((Vector3)(ref b.characterMotor.velocity)).magnitude + " ordinary=" + ordinary);
			yield return Record("Rotation-Moving", 0.8f, side: false);
			d.secondary = false;
			d.move = Vector3.zero;
			yield return (object)new WaitForSeconds(0.3f);
			Log("rotation restored=" + b.moveSpeed);
			Reset();
			GameObject slope = GameObject.CreatePrimitive((PrimitiveType)3);
			slope.layer = LayerIndex.world.intVal;
			slope.transform.position = home + new Vector3(0f, 0.7f, 5f);
			slope.transform.localScale = new Vector3(6f, 0.2f, 8f);
			slope.transform.rotation = Quaternion.Euler(-12f, 0f, 0f);
			Physics.SyncTransforms();
			SetFoot(b, home + new Vector3(0f, 0.55f, 2f));
			yield return (object)new WaitForSeconds(0.5f);
			phase = "slope-follow";
			d.move = Vector3.forward;
			weapon.SetNextState((EntityState)(object)new Substitution());
			yield return (object)new WaitForSeconds(0.03f);
			d.move = Vector3.zero;
			yield return Record("Slope-Follow", 0.5f, side: true);
			Log("slope end=" + ((object)(b.footPosition - home)/*cast due to .constrained prefix*/).ToString());
			Object.Destroy((Object)(object)slope);
			Reset();
			yield return (object)new WaitForSeconds(0.3f);
			GameObject wall = GameObject.CreatePrimitive((PrimitiveType)3);
			wall.layer = LayerIndex.world.intVal;
			wall.transform.position = home + new Vector3(0f, 2f, 3f);
			wall.transform.localScale = new Vector3(8f, 5f, 0.4f);
			Physics.SyncTransforms();
			phase = "wall-recheck";
			d.move = Vector3.forward;
			weapon.SetNextState((EntityState)(object)new Substitution());
			yield return (object)new WaitForSeconds(0.03f);
			d.move = Vector3.zero;
			yield return (object)new WaitForSeconds(0.3f);
			Log("wall end=" + ((object)(b.footPosition - home)/*cast due to .constrained prefix*/).ToString());
			Object.Destroy((Object)(object)wall);
			Reset();
			CharacterBody enemy = Spawn("LemurianMaster", home + Vector3.forward * 2f, 10000f, pin: true);
			yield return (object)new WaitForSeconds(3f);
			Wake(enemy);
			yield return (object)new WaitForSeconds(0.3f);
			phase = "primary-cancel";
			weapon.SetNextState((EntityState)(object)new GentleFist());
			yield return (object)new WaitForSeconds(0.03f);
			weapon.SetNextState((EntityState)(object)new Substitution());
			yield return (object)new WaitForSeconds(0.4f);
			Log("primary-cancel hp=" + enemy.healthComponent.health);
			Reset();
			phase = "loop-bound";
			for (int i = 0; i < 3; i++)
			{
				d.secondary = true;
				yield return (object)new WaitForSeconds(0.4f);
				d.secondary = false;
				yield return (object)new WaitForSeconds(0.2f);
			}
			yield return (object)new WaitForSeconds(1f);
			Log("cleanup techniqueRoots=" + Object.FindObjectsOfType<GameObject>().Count((GameObject x) => ((Object)x).name == "Neji local technique visual") + " shortSounds=" + Object.FindObjectsOfType<LocalSound>().Length);
			phase = "skin-slots";
			SkinDef[] skins = ((Component)b.modelLocator.modelTransform).GetComponent<ModelSkinController>().skins;
			SkinDef[] array = skins;
			foreach (SkinDef skin in array)
			{
				Log("skin=" + Language.GetString(skin.nameToken));
			}
			Log("EDGE_DONE");
			Object.Destroy((Object)(object)d);
			Application.Quit();
		}

		private static IEnumerator Final()
		{
			CharacterBody enemy = Spawn("LemurianMaster", home + Vector3.forward * 6f, 10000f, pin: true);
			yield return (object)new WaitForSeconds(3f);
			Wake(enemy);
			yield return (object)new WaitForSeconds(0.3f);
			phase = "final-audio-fx";
			AkSoundEngine.StartOutputCapture(Path.Combine(Root, "Final-audio.wav"));
			d.secondary = true;
			yield return Record("Final-Rotation-SourceFX", 2f, side: false);
			d.secondary = false;
			yield return (object)new WaitForSeconds(0.2f);
			Reset();
			weapon.SetNextState((EntityState)(object)new SixtyFourPalms());
			yield return Record("Final-64Palms-SourceFX", 3.1f, side: false);
			Reset();
			SetFoot(enemy, home + Vector3.forward * 5f);
			phase = "four-speed-low-fps";
			b.baseAttackSpeed = 4f;
			b.RecalculateStats();
			int oldRate = Application.targetFrameRate;
			Application.targetFrameRate = 20;
			float hp = enemy.healthComponent.health;
			weapon.SetNextState((EntityState)(object)new SixtyFourPalms());
			yield return (object)new WaitForSeconds(2f);
			Log("four-speed-low-fps loss=" + (hp - enemy.healthComponent.health) + " expected=288 clean=" + !((Component)b).GetComponent<NejiBody>().barrage);
			Application.targetFrameRate = oldRate;
			b.baseAttackSpeed = 1f;
			b.RecalculateStats();
			Reset();
			SetFoot(enemy, home + Vector3.forward * 1.8f);
			phase = "gameplay-primary";
			d.attack = true;
			yield return Record("Gameplay-Primary", 2f, side: false);
			d.attack = false;
			yield return (object)new WaitForSeconds(0.3f);
			Reset();
			SetFoot(enemy, home + Vector3.forward * 7f);
			phase = "gameplay-palms";
			weapon.SetNextState((EntityState)(object)new SixtyFourPalms());
			yield return Record("Gameplay-64Palms", 3.1f, side: false);
			Reset();
			SetFoot(enemy, home + Vector3.right * 35f);
			d.move = Vector3.forward;
			phase = "gameplay-move";
			yield return Record("Gameplay-Run", 1.7f, side: false);
			d.sprint = true;
			yield return Record("Gameplay-Sprint", 1.7f, side: false);
			Reset();
			d.jump = true;
			yield return (object)new WaitForSeconds(0.08f);
			d.jump = false;
			yield return Record("Gameplay-Jump", 0.3f, side: false);
			d.jump = true;
			yield return (object)new WaitForSeconds(0.08f);
			d.jump = false;
			yield return Record("Gameplay-Flip-Land", 1.8f, side: false);
			Reset();
			GameObject slope = GameObject.CreatePrimitive((PrimitiveType)3);
			slope.layer = LayerIndex.world.intVal;
			slope.transform.position = home + new Vector3(0f, 0.7f, 5f);
			slope.transform.localScale = new Vector3(6f, 0.2f, 8f);
			slope.transform.rotation = Quaternion.Euler(-12f, 0f, 0f);
			Physics.SyncTransforms();
			SetFoot(b, home + new Vector3(0f, 0.55f, 2f));
			yield return (object)new WaitForSeconds(0.5f);
			phase = "slope-sub";
			d.move = Vector3.forward;
			weapon.SetNextState((EntityState)(object)new Substitution());
			yield return Record("Final-Slope-Sub", 0.5f, side: true);
			Log("slope arrival=" + ((object)(b.footPosition - home)/*cast due to .constrained prefix*/).ToString());
			Object.Destroy((Object)(object)slope);
			Reset();
			yield return (object)new WaitForSeconds(0.3f);
			phase = "two-instance-stack";
			NejiBody other = new GameObject("Stack ownership fixture").AddComponent<NejiBody>();
			other.body = b;
			other.AddPoint(enemy.healthComponent);
			NejiBody n = ((Component)b).GetComponent<NejiBody>();
			n.points.Clear();
			for (int i = 0; i < 3; i++)
			{
				n.AddPoint(enemy.healthComponent);
			}
			Log("separate-instance own=" + n.Consume(enemy.healthComponent) + " other=" + other.points[enemy.healthComponent].count);
			Object.Destroy((Object)(object)((Component)other).gameObject);
			phase = "jp-final";
			b.skinIndex = 1u;
			NejiAudio.Send(b, 0);
			yield return (object)new WaitForSeconds(4f);
			NejiAudio.Send(b, 1);
			yield return (object)new WaitForSeconds(2f);
			AkSoundEngine.StopOutputCapture();
			phase = "death-cleanup";
			Reset();
			SetFoot(enemy, home + Vector3.forward * 5f);
			weapon.SetNextState((EntityState)(object)new SixtyFourPalms());
			yield return (object)new WaitForSeconds(0.3f);
			b.healthComponent.health = 0f;
			yield return (object)new WaitForSeconds(0.3f);
			Log("death-clean rotating=" + n.rotating + " barrage=" + n.barrage + " until=" + n.protectionUntil);
			yield return Record("Final-Death", 1.8f, side: true);
			Log("FINAL_DONE");
			Object.Destroy((Object)(object)d);
			Application.Quit();
		}

		private static IEnumerator Final04()
		{
			Diagnostics03.enabled = true;
			float[] array = new float[3] { 6f, 14f, 14f };
			for (int i = 0; i < array.Length; i++)
			{
				float distance = array[i];
				Reset();
				CharacterBody pest = Spawn("FlyingVerminMaster", home + new Vector3(0f, 3f, distance), 10000f, pin: true);
				yield return (object)new WaitForSeconds(3f);
				Wake(pest);
				phase = "final-return04-" + distance;
				float hp = b.healthComponent.health;
				float before = pest.healthComponent.health;
				d.secondary = true;
				weapon.SetNextState((EntityState)(object)new Rotation());
				EntityStateMachine w = ((Component)pest).GetComponents<EntityStateMachine>().First((EntityStateMachine x) => x.customName == "Weapon");
				InputBankTest inputBank = pest.inputBank;
				Vector3 val = b.corePosition - pest.inputBank.aimOrigin;
				inputBank.aimDirection = ((Vector3)(ref val)).normalized;
				w.SetNextState((EntityState)new Spit());
				if (distance > 10f)
				{
					((Component)pest).gameObject.AddComponent<MovingFixture04>();
				}
				yield return Record("Rotation04-FinalReturn-" + distance, 1.6f, side: false);
				d.secondary = false;
				yield return (object)new WaitForSeconds(0.2f);
				Log(phase + " damage=" + (before - pest.healthComponent.health) + " playerLoss=" + (hp - b.healthComponent.health));
				Remove03(pest);
			}
			Reset();
			CharacterBody boss = Spawn("BeetleQueenMaster", home + Vector3.forward * 11f, 100000f, pin: true);
			yield return (object)new WaitForSeconds(3f);
			Wake(boss);
			SetFoot(b, home + Vector3.up * 8f);
			((BaseCharacterController)b.characterMotor).Motor.ForceUnground(0.1f);
			yield return (object)new WaitForFixedUpdate();
			phase = "final-boss04";
			Log("AUDIO04 " + ((object)AkSoundEngine.StartOutputCapture(Path.Combine(Root, "64Palms04-VoicedBoss.wav"))/*cast due to .constrained prefix*/).ToString());
			weapon.SetNextState((EntityState)(object)new SixtyFourPalms());
			yield return Record("64Palms04-VoicedBoss", 6f, side: false);
			AkSoundEngine.StopOutputCapture();
			Remove03(boss);
			Reset();
			CharacterBody e = Spawn("WispMaster", home + new Vector3(0f, 5f, 5f), 10000f, pin: true);
			yield return (object)new WaitForSeconds(3f);
			Wake(e);
			SetFoot(b, home + Vector3.up * 5f);
			((BaseCharacterController)b.characterMotor).Motor.ForceUnground(0.1f);
			yield return (object)new WaitForFixedUpdate();
			weapon.SetNextState((EntityState)(object)new SixtyFourPalms());
			yield return (object)new WaitForSeconds(0.6f);
			weapon.SetNextState((EntityState)(object)new Substitution());
			yield return (object)new WaitForSeconds(0.2f);
			Log("SUB_CANCEL04 gravity=" + b.characterMotor.gravityParameters.channeledAntiGravityGranterCount + " barrage=" + ((Component)b).GetComponent<NejiBody>().barrage + " protected=" + (Time.time < ((Component)b).GetComponent<NejiBody>().protectionUntil));
			Remove03(e);
			Log("FINAL04_DONE");
			Object.Destroy((Object)(object)d);
			Application.Quit();
		}

		private static IEnumerator Selection02()
		{
			foreach (NetworkUser user in from x in Object.FindObjectsOfType<NetworkUser>()
				where ((NetworkBehaviour)x).isLocalPlayer
				select x)
			{
				Loadout load = new Loadout();
				user.networkLoadout.CopyLoadout(load);
				uint[] array = new uint[2] { 0u, 1u };
				for (int num = 0; num < array.Length; num++)
				{
					uint skin = array[num];
					load.bodyLoadoutManager.SetSkinIndex(BodyCatalog.FindBodyIndex("HenryYoungNejiBody"), skin);
					user.networkLoadout.SetLoadout(load);
					yield return (object)new WaitForSeconds(0.8f);
					for (int frame = 0; frame < 4; frame++)
					{
						ScreenCapture.CaptureScreenshot(Path.Combine(Root, "SelectionVoice" + skin + "-" + frame + ".png"));
						yield return (object)new WaitForSeconds(0.6f);
					}
					Log("selection-skin=" + skin + " title=" + Language.GetString((skin == 0) ? "HENRY_NEJI_ENGLISH" : "HENRY_NEJI_JAPANESE"));
				}
				load.bodyLoadoutManager.SetSkinIndex(BodyCatalog.FindBodyIndex("HenryYoungNejiBody"), 0u);
				user.networkLoadout.SetLoadout(load);
			}
		}

		private unsafe static IEnumerator Finish02()
		{
			b.baseRegen = (b.levelRegen = 0f);
			b.RecalculateStats();
			Combat.traceDefense = true;
			uint[] array = new uint[2] { 0u, 1u };
			for (int i = 0; i < array.Length; i++)
			{
				uint skin = array[i];
				b.skinIndex = skin;
				((Component)b.modelLocator.modelTransform).GetComponent<ModelSkinController>().ApplySkin((int)skin);
				yield return (object)new WaitForSeconds(0.25f);
				yield return Record("Face-Eyes-" + skin, 0.4f, side: false);
			}
			string[] array2 = new string[2] { "WispMaster", "GolemMaster" };
			Vector3 val;
			foreach (string species in array2)
			{
				Reset();
				CharacterBody enemy = Spawn(species, home + new Vector3(0f, (float)((species == "WispMaster") ? 2 : 0), 8f), 10000f, pin: true);
				yield return (object)new WaitForSeconds(3f);
				Wake(enemy);
				yield return (object)new WaitForSeconds(0.2f);
				EntityStateMachine ew = ((IEnumerable<EntityStateMachine>)((Component)enemy).GetComponents<EntityStateMachine>()).FirstOrDefault((Func<EntityStateMachine, bool>)((EntityStateMachine x) => x.customName == "Weapon")) ?? ((Component)enemy).GetComponents<EntityStateMachine>().First();
				phase = "confirmed-" + species;
				float hp = b.healthComponent.health;
				float ehp = enemy.healthComponent.health;
				d.secondary = true;
				weapon.SetNextState((EntityState)(object)new Rotation());
				yield return (object)new WaitForSeconds(0.04f);
				for (int i2 = 0; i2 < 3; i2++)
				{
					val = b.corePosition - enemy.inputBank.aimOrigin;
					Vector3 aim = ((Vector3)(ref val)).normalized;
					enemy.inputBank.aimDirection = aim;
					if (species == "GolemMaster")
					{
						ew.SetNextState((EntityState)new FireLaser
						{
							laserDirection = aim
						});
					}
					else
					{
						ew.SetNextState((EntityState)new FireEmbers());
					}
					yield return Record("Confirmed-" + species + "-" + i2, 0.5f, side: false);
					ew.SetNextStateToMain();
				}
				Log(phase + " playerLoss=" + (hp - b.healthComponent.health) + " retaliation=" + (ehp - enemy.healthComponent.health));
				d.secondary = false;
				yield return (object)new WaitForSeconds(0.1f);
				Log("protection-after-release=" + ((Component)b).GetComponent<NejiBody>().rotating);
				Object.Destroy((Object)(object)((Component)enemy.master).gameObject);
				Object.Destroy((Object)(object)((Component)enemy).gameObject);
			}
			Reset();
			GameObject slope = GameObject.CreatePrimitive((PrimitiveType)3);
			slope.layer = LayerIndex.world.intVal;
			slope.transform.position = home + new Vector3(0f, 1f, 8f);
			slope.transform.localScale = new Vector3(6f, 0.2f, 15f);
			slope.transform.rotation = Quaternion.Euler(-10f, 0f, 0f);
			Physics.SyncTransforms();
			SetFoot(b, home + new Vector3(0f, 0.65f, 3f));
			yield return (object)new WaitForSeconds(0.3f);
			phase = "sub24-slope";
			d.move = Vector3.forward;
			weapon.SetNextState((EntityState)(object)new Substitution());
			yield return Record("Substitution-Slope", 0.5f, side: true);
			val = b.footPosition - home;
			Log("slope destination=" + ((object)(*(Vector3*)(&val))/*cast due to .constrained prefix*/).ToString());
			Object.Destroy((Object)(object)slope);
			Reset();
			CharacterBody target = Spawn("LemurianMaster", home + Vector3.forward * 5f, 10000f, pin: true);
			yield return (object)new WaitForSeconds(3f);
			Wake(target);
			yield return (object)new WaitForSeconds(0.2f);
			phase = "death-cleanup02";
			weapon.SetNextState((EntityState)(object)new SixtyFourPalms());
			yield return (object)new WaitForSeconds(0.6f);
			b.healthComponent.health = 0f;
			yield return (object)new WaitForSeconds(0.3f);
			Log("death-clear barrage=" + ((Component)b).GetComponent<NejiBody>().barrage + " rotating=" + ((Component)b).GetComponent<NejiBody>().rotating + " protectedUntil=" + ((Component)b).GetComponent<NejiBody>().protectionUntil);
			Log("FINISH02_DONE");
			Object.Destroy((Object)(object)d);
			Application.Quit();
		}

		private unsafe static IEnumerator Finish03()
		{
			Diagnostics03.enabled = true;
			Combat.traceDefense = true;
			b.baseRegen = (b.levelRegen = 0f);
			b.RecalculateStats();
			Combat.OnDamage = (Action<string, CharacterBody, HealthComponent, float>)Delegate.Combine(Combat.OnDamage, (Action<string, CharacterBody, HealthComponent, float>)delegate(string kind, CharacterBody owner, HealthComponent h, float amount)
			{
				if ((Object)(object)owner == (Object)(object)b && kind.StartsWith("palms-"))
				{
					hits03++;
					damage03 += amount;
				}
			});
			TeamManager.instance.SetTeamLevel((TeamIndex)2, 15u);
			CharacterBody golem = Spawn("GolemMaster", home + new Vector3(0f, 0f, 8f), 0f, pin: true);
			yield return (object)new WaitForSeconds(3f);
			Wake(golem);
			golem.baseArmor = 20f;
			golem.baseRegen = (golem.levelRegen = 0f);
			golem.RecalculateStats();
			golem.healthComponent.health = golem.maxHealth;
			yield return (object)new WaitForSeconds(0.2f);
			phase = "final-golem15";
			EntityStateMachine ew = ((Component)golem).GetComponents<EntityStateMachine>().First((EntityStateMachine x) => x.customName == "Weapon");
			d.secondary = true;
			weapon.SetNextState((EntityState)(object)new Rotation());
			yield return (object)new WaitForSeconds(0.1f);
			float before = golem.healthComponent.health;
			float hp = b.healthComponent.health;
			Log("final-golem15 before=" + before + " armor=" + golem.armor + " level=" + golem.level);
			for (int shot = 0; shot < 3; shot++)
			{
				if (!(golem.healthComponent.health >= before))
				{
					break;
				}
				Vector3 val = b.corePosition - golem.inputBank.aimOrigin;
				Vector3 aim = ((Vector3)(ref val)).normalized;
				golem.inputBank.aimDirection = aim;
				string[] obj = new string[6]
				{
					"laser-attempt=",
					shot.ToString(),
					" origin=",
					null,
					null,
					null
				};
				val = golem.inputBank.aimOrigin;
				obj[3] = ((object)(*(Vector3*)(&val))/*cast due to .constrained prefix*/).ToString();
				obj[4] = " destination=";
				val = b.corePosition;
				obj[5] = ((object)(*(Vector3*)(&val))/*cast due to .constrained prefix*/).ToString();
				Log(string.Concat(obj));
				ew.SetNextState((EntityState)new FireLaser
				{
					laserDirection = aim
				});
				yield return Record("Final03-Golem15-" + shot, 0.65f, side: false);
				ew.SetNextStateToMain();
			}
			Log("final-golem15 after=" + golem.healthComponent.health + " removed=" + (before - golem.healthComponent.health) + " playerLoss=" + (hp - b.healthComponent.health));
			d.secondary = false;
			yield return (object)new WaitForSeconds(0.1f);
			Remove03(golem);
			TeamManager.instance.SetTeamLevel((TeamIndex)2, 1u);
			string[] array = new string[2] { "English", "Japanese" };
			foreach (string mode in array)
			{
				Reset();
				b.skinIndex = ((mode == "Japanese") ? 1u : 0u);
				b.baseAttackSpeed = 1f;
				b.RecalculateStats();
				((Component)b).GetComponent<NejiBody>().points.Clear();
				CharacterBody target = Spawn("LemurianMaster", home + Vector3.forward * 5f, 10000f, pin: true);
				yield return (object)new WaitForSeconds(3f);
				Wake(target);
				yield return (object)new WaitForSeconds(0.3f);
				phase = "final-staged-" + mode;
				hits03 = 0;
				damage03 = 0f;
				Log("audio capture=" + ((object)AkSoundEngine.StartOutputCapture(Path.Combine(Root, "Final03-" + mode + ".wav"))/*cast due to .constrained prefix*/).ToString());
				weapon.SetNextState((EntityState)(object)new SixtyFourPalms());
				yield return Record("Final64Palms03-" + mode, 5.9f, side: false);
				AkSoundEngine.StopOutputCapture();
				Log(phase + " hits=" + hits03 + " damage=" + damage03 + " protected=" + ((Component)b).GetComponent<NejiBody>().barrage);
				Remove03(target);
			}
			Reset();
			yield return (object)new WaitForSeconds(0.2f);
			phase = "root-only-primary";
			CharacterBody e2 = Spawn("LemurianMaster", home + Vector3.forward * 1.8f, 10000f, pin: true);
			yield return (object)new WaitForSeconds(3f);
			Wake(e2);
			yield return (object)new WaitForSeconds(0.2f);
			d.attack = true;
			d.stopAt = 4;
			yield return Record("Ground03-Primary", 2.2f, side: true);
			d.attack = false;
			Remove03(e2);
			Reset();
			v.reviewOverride = true;
			v.Play("Combat_Idle", 1f, 0f, restart: true, 0f);
			yield return Record("Ground03-Idle-Final", 1f, side: true);
			Log("finalCombatSole=" + SoleHeight());
			v.reviewOverride = false;
			d.move = Vector3.forward;
			yield return Record("Ground03-Walk-Final", 2.6f, side: true);
			d.sprint = true;
			yield return Record("Ground03-Sprint-Final", 1.5f, side: true);
			Reset();
			yield return (object)new WaitForSeconds(0.3f);
			d.jump = true;
			yield return (object)new WaitForSeconds(0.1f);
			d.jump = false;
			yield return Record("Ground03-Land-Final", 1.8f, side: true);
			GameObject slope = GameObject.CreatePrimitive((PrimitiveType)3);
			slope.layer = LayerIndex.world.intVal;
			slope.transform.position = home + new Vector3(0f, 1f, 10f);
			slope.transform.localScale = new Vector3(8f, 0.2f, 15f);
			slope.transform.rotation = Quaternion.Euler(-10f, 0f, 0f);
			SetFoot(b, home + new Vector3(0f, 1.5f, 10f));
			yield return (object)new WaitForSeconds(0.5f);
			yield return Record("Ground03-Slope-Final", 0.6f, side: true);
			Object.Destroy((Object)(object)slope);
			Reset();
			b.healthComponent.health = b.maxHealth;
			SetFoot(b, home + Vector3.up * 40f);
			((BaseCharacterController)b.characterMotor).Motor.ForceUnground(0.1f);
			yield return (object)new WaitForFixedUpdate();
			b.characterMotor.velocity = Vector3.down * 40f;
			d.move = Vector3.forward;
			d.aim = Vector3.forward;
			weapon.SetNextState((EntityState)(object)new Substitution());
			yield return (object)new WaitForSeconds(0.2f);
			d.move = Vector3.zero;
			float old = b.healthComponent.health;
			yield return (object)new WaitForSeconds(3f);
			Log("NEW FALL AFTER SUB damage=" + (old - b.healthComponent.health));
			Log("FINISH03_DONE");
			Object.Destroy((Object)(object)d);
			Application.Quit();
		}

		private static IEnumerator Inputs()
		{
			phase = "input-no-target";
			d.special = true;
			yield return (object)new WaitForSeconds(0.08f);
			d.special = false;
			yield return (object)new WaitForSeconds(0.2f);
			Log("empty special stock=" + b.skillLocator.special.stock + " state=" + ((object)weapon.state).GetType().Name);
			phase = "input-utility";
			d.utility = true;
			yield return (object)new WaitForSeconds(0.08f);
			d.utility = false;
			yield return (object)new WaitForSeconds(0.3f);
			Log("utility stock=" + b.skillLocator.utility.stock + " displacement=" + ((object)(b.footPosition - home)/*cast due to .constrained prefix*/).ToString() + " state=" + ((object)weapon.state).GetType().Name);
			Reset();
			CharacterBody target = Spawn("LemurianMaster", home + Vector3.forward * 5f, 10000f, pin: true);
			yield return (object)new WaitForSeconds(3f);
			Wake(target);
			yield return (object)new WaitForSeconds(0.4f);
			phase = "input-special";
			Log("canExecute=" + b.skillLocator.special.skillDef.CanExecute(b.skillLocator.special));
			float hp = target.healthComponent.health;
			d.special = true;
			yield return (object)new WaitForSeconds(0.08f);
			d.special = false;
			yield return Record("Actual-Input-64Palms", 3f, side: false);
			Log("special stock=" + b.skillLocator.special.stock + " loss=" + (hp - target.healthComponent.health) + " active=" + ((Component)b).GetComponent<NejiBody>().barrage);
			Log("INPUT_DONE");
			Object.Destroy((Object)(object)d);
			Application.Quit();
		}

		private static IEnumerator PestRecheckRC02()
		{
			Diagnostics03.enabled = true;
			Reset();
			CharacterBody e = Spawn("FlyingVerminMaster", home + new Vector3(0f, 3f, 8f), 10000f, pin: true);
			yield return (object)new WaitForSeconds(3f);
			Wake(e);
			yield return (object)new WaitForSeconds(0.3f);
			BaseAI[] components = ((Component)e.master).GetComponents<BaseAI>();
			foreach (BaseAI ai in components)
			{
				FieldInfo f = ((object)ai).GetType().GetField("shouldMissFirstOffScreenShot");
				if (f != null)
				{
					f.SetValue(ai, false);
				}
			}
			EntityStateMachine ew = ((Component)e).GetComponents<EntityStateMachine>().First((EntityStateMachine x) => x.customName == "Weapon");
			phase = "RC02-pest-confirm";
			float before = e.healthComponent.health;
			float hp = b.healthComponent.health;
			for (int attempt = 0; attempt < 4; attempt++)
			{
				if (before != e.healthComponent.health)
				{
					break;
				}
				Reset();
				d.secondary = true;
				weapon.SetNextState((EntityState)(object)new Rotation());
				yield return (object)new WaitForSeconds(0.1f);
				ew.SetNextStateToMain();
				yield return (object)new WaitForSeconds(0.1f);
				InputBankTest inputBank = e.inputBank;
				Vector3 val = b.corePosition - e.inputBank.aimOrigin;
				inputBank.aimDirection = ((Vector3)(ref val)).normalized;
				ew.SetNextState((EntityState)new Spit());
				yield return Record("Pest-RC02-Confirmed-" + attempt, 1.1f, side: false);
				d.secondary = false;
				yield return (object)new WaitForSeconds(0.15f);
			}
			Log("RC02_PEST_CONFIRMED returned=" + (before - e.healthComponent.health) + " incoming=" + (hp - b.healthComponent.health));
			Remove03(e);
			Log("RC02_PEST_DONE");
			Application.Quit();
		}

		private static IEnumerator Physical04()
		{
			Diagnostics03.enabled = true;
			float[] array = new float[2] { 6f, 14f };
			for (int i = 0; i < array.Length; i++)
			{
				float distance = array[i];
				Reset();
				CharacterBody pest = Spawn("FlyingVerminMaster", home + new Vector3(0f, 3f, distance), 10000f, pin: true);
				yield return (object)new WaitForSeconds(3f);
				Wake(pest);
				BaseAI[] components = ((Component)pest.master).GetComponents<BaseAI>();
				foreach (BaseAI ai in components)
				{
					FieldInfo field = ((object)ai).GetType().GetField("shouldMissFirstOffScreenShot");
					if (field != null)
					{
						field.SetValue(ai, false);
					}
				}
				yield return (object)new WaitForSeconds(0.2f);
				phase = "verified-return04-" + distance;
				float hp = b.healthComponent.health;
				float before = pest.healthComponent.health;
				d.secondary = true;
				weapon.SetNextState((EntityState)(object)new Rotation());
				EntityStateMachine w = ((Component)pest).GetComponents<EntityStateMachine>().First((EntityStateMachine x) => x.customName == "Weapon");
				InputBankTest inputBank = pest.inputBank;
				Vector3 val = b.corePosition - pest.inputBank.aimOrigin;
				inputBank.aimDirection = ((Vector3)(ref val)).normalized;
				w.SetNextState((EntityState)new Spit());
				if (distance > 10f)
				{
					((Component)pest).gameObject.AddComponent<MovingFixture04>();
				}
				yield return Record("Rotation04-VerifiedReturn-" + distance, 1.5f, side: false);
				d.secondary = false;
				yield return (object)new WaitForSeconds(0.2f);
				Log(phase + " damage=" + (before - pest.healthComponent.health) + " playerLoss=" + (hp - b.healthComponent.health));
				Remove03(pest);
			}
			Reset();
			yield return (object)new WaitForSeconds(0.3f);
			float start = Time.realtimeSinceStartup;
			int frames = 0;
			while (Time.realtimeSinceStartup - start < 1.5f)
			{
				yield return null;
				frames++;
			}
			Log("PERF04 idleFPS=" + (float)frames / (Time.realtimeSinceStartup - start));
			d.secondary = true;
			weapon.SetNextState((EntityState)(object)new Rotation());
			start = Time.realtimeSinceStartup;
			frames = 0;
			float maximum = 0f;
			while (Time.realtimeSinceStartup - start < 2f)
			{
				yield return null;
				frames++;
				maximum = Mathf.Max(maximum, Time.unscaledDeltaTime);
			}
			Log("PERF04 rotationFPS=" + (float)frames / (Time.realtimeSinceStartup - start) + " maxFrame=" + maximum);
			d.secondary = false;
			yield return (object)new WaitForSeconds(0.3f);
			Log("PHYSICAL04_DONE");
			Object.Destroy((Object)(object)d);
			Application.Quit();
		}

		public static void Log(string s)
		{
			Plugin.instance.Log.LogInfo((object)("NEJI_TEST " + s));
			rows.Add(s);
			Directory.CreateDirectory(Root);
			File.WriteAllLines(Path.Combine(Root, "results.txt"), rows);
		}

		public static void Init()
		{
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Expected O, but got Unknown
			//IL_005a: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0065: Expected O, but got Unknown
			if (!File.Exists(Path.Combine(Visual.Assets, "RUN_TEST")))
			{
				return;
			}
			object obj = <>c.<>9__32_0;
			if (obj == null)
			{
				hook_Update val = delegate(orig_Update orig, PlayerCharacterMasterController self)
				{
					orig.Invoke(self);
					Drive(self, fixedInput: false);
				};
				<>c.<>9__32_0 = val;
				obj = (object)val;
			}
			PlayerCharacterMasterController.Update += (hook_Update)obj;
			object obj2 = <>c.<>9__32_1;
			if (obj2 == null)
			{
				hook_FixedUpdate val2 = delegate(orig_FixedUpdate orig, PlayerCharacterMasterController self)
				{
					orig.Invoke(self);
					Drive(self, fixedInput: true);
				};
				<>c.<>9__32_1 = val2;
				obj2 = (object)val2;
			}
			PlayerCharacterMasterController.FixedUpdate += (hook_FixedUpdate)obj2;
			RoR2Application.onLoad = (Action)Delegate.Combine(RoR2Application.onLoad, (Action)delegate
			{
				((MonoBehaviour)Plugin.instance).StartCoroutine(Run());
			});
			Combat.OnDamage = (Action<string, CharacterBody, HealthComponent, float>)Delegate.Combine(Combat.OnDamage, (Action<string, CharacterBody, HealthComponent, float>)delegate(string kind, CharacterBody owner, HealthComponent h, float amount)
			{
				//IL_005d: 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)
				if ((Object)(object)owner == (Object)(object)b)
				{
					Log(phase + " damage=" + kind + " victim=" + ((Object)h).name + " amount=" + amount + " distance=" + Vector3.Distance(b.corePosition, h.body.corePosition));
				}
			});
		}

		private static void Drive(PlayerCharacterMasterController pc, bool fixedInput)
		{
			CharacterBody body = pc.master.GetBody();
			if (Object.op_Implicit((Object)(object)body))
			{
				Probe component = ((Component)body).GetComponent<Probe>();
				if (Object.op_Implicit((Object)(object)component))
				{
					component.Apply(fixedInput);
				}
			}
		}

		public static void SetFoot(CharacterBody cb, Vector3 pos)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0073: Unknown result type (might be due to invalid IL or missing references)
			//IL_0074: Unknown result type (might be due to invalid IL or missing references)
			Vector3 val = pos + cb.transform.position - cb.footPosition;
			if (Object.op_Implicit((Object)(object)cb.characterMotor))
			{
				((BaseCharacterController)cb.characterMotor).Motor.SetPosition(val, true);
				cb.characterMotor.velocity = Vector3.zero;
			}
			else
			{
				cb.transform.position = val;
			}
			Pin component = ((Component)cb).GetComponent<Pin>();
			if (Object.op_Implicit((Object)(object)component))
			{
				component.point = val;
			}
		}

		private unsafe static IEnumerator Run()
		{
			yield return (object)new WaitForSeconds(12f);
			Directory.CreateDirectory(Root);
			if (!LocalUserManager.isAnyUserSignedIn)
			{
				typeof(UserProfile).GetMethod("LoadDefaultProfile", BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic).Invoke(null, null);
				UserProfile original = (UserProfile)typeof(UserProfile).GetField("defaultProfile", BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic).GetValue(null);
				UserProfile guest = (UserProfile)Activator.CreateInstance(typeof(UserProfile), BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic, null, new object[1] { original }, null);
				guest.canSave = false;
				guest.name = "Young Neji isolated test";
				LocalUserManager.AddMainUser(guest);
			}
			foreach (LocalUser local in LocalUserManager.readOnlyLocalUsersList)
			{
				local.userProfile.canSave = false;
			}
			Console.instance.SubmitCmd((NetworkUser)null, "host 1", false);
			for (int i = 0; i < 60; i++)
			{
				if (Object.op_Implicit((Object)(object)PreGameController.instance))
				{
					break;
				}
				yield return (object)new WaitForSeconds(1f);
			}
			if (!Object.op_Implicit((Object)(object)PreGameController.instance))
			{
				Log("FAIL lobby");
				yield break;
			}
			NetworkUser[] array = Object.FindObjectsOfType<NetworkUser>();
			foreach (NetworkUser user in array)
			{
				if (((NetworkBehaviour)user).isLocalPlayer)
				{
					user.SetBodyPreference(BodyCatalog.FindBodyIndex("HenryYoungNejiBody"));
				}
			}
			yield return (object)new WaitForSeconds(1f);
			ScreenCapture.CaptureScreenshot(Path.Combine(Root, "Selection.png"));
			if (File.Exists(Path.Combine(Visual.Assets, "RC_CHECK")) || File.Exists(Path.Combine(Visual.Assets, "FINISH02")) || File.Exists(Path.Combine(Visual.Assets, "CHECK03")))
			{
				yield return Selection02();
			}
			if (File.Exists(Path.Combine(Visual.Assets, "RECHECK03")))
			{
				yield return SelectionGround03();
			}
			if (File.Exists(Path.Combine(Visual.Assets, "RC02_RECHECK")) || File.Exists(Path.Combine(Visual.Assets, "RC_RECHECK")) || File.Exists(Path.Combine(Visual.Assets, "RC_UI_ONLY")))
			{
				yield return SelectionRC();
			}
			if (File.Exists(Path.Combine(Visual.Assets, "RC_UI_ONLY")))
			{
				Log("RC_UI_DONE");
				Application.Quit();
				yield break;
			}
			PreGameController.instance.StartRun();
			for (int k = 0; k < 60; k++)
			{
				if (Object.op_Implicit((Object)(object)Run.instance) && Object.op_Implicit((Object)(object)SceneInfo.instance))
				{
					break;
				}
				yield return (object)new WaitForSeconds(1f);
			}
			yield return (object)new WaitForSeconds(8f);
			NetworkUser u = ((IEnumerable<NetworkUser>)Object.FindObjectsOfType<NetworkUser>()).FirstOrDefault((Func<NetworkUser, bool>)((NetworkUser x) => ((NetworkBehaviour)x).isLocalPlayer));
			b = ((Object.op_Implicit((Object)(object)u) && Object.op_Implicit((Object)(object)u.master)) ? u.master.GetBody() : null);
			if (!Object.op_Implicit((Object)(object)b))
			{
				Log("FAIL no player");
				yield break;
			}
			VehicleSeat seat = ((IEnumerable<VehicleSeat>)Object.FindObjectsOfType<VehicleSeat>()).FirstOrDefault((Func<VehicleSeat, bool>)((VehicleSeat x) => (Object)(object)x.currentPassengerBody == (Object)(object)b));
			if (Object.op_Implicit((Object)(object)seat))
			{
				seat.EjectPassenger();
				yield return (object)new WaitForSeconds(3f);
			}
			v = ((Component)b.modelLocator.modelTransform).GetComponentInChildren<Visual>();
			string[] obj = new string[20]
			{
				"CAPSULE center=", null, null, null, null, null, null, null, null, null,
				null, null, null, null, null, null, null, null, null, null
			};
			Vector3 val = ((BaseCharacterController)b.characterMotor).Motor.Capsule.center;
			obj[1] = ((object)(*(Vector3*)(&val))/*cast due to .constrained prefix*/).ToString();
			obj[2] = " height=";
			obj[3] = ((BaseCharacterController)b.characterMotor).Motor.Capsule.height.ToString();
			obj[4] = " radius=";
			obj[5] = ((BaseCharacterController)b.characterMotor).Motor.Capsule.radius.ToString();
			obj[6] = " footOffset=";
			val = b.footPosition - b.transform.position;
			obj[7] = ((object)(*(Vector3*)(&val))/*cast due to .constrained prefix*/).ToString();
			obj[8] = " BASELINE difficulty=";
			obj[9] = ((object)Run.instance.selectedDifficulty/*cast due to .constrained prefix*/).ToString();
			obj[10] = " level=";
			obj[11] = b.level.ToString();
			obj[12] = " damage=";
			obj[13] = b.damage.ToString();
			obj[14] = " speed=";
			obj[15] = b.moveSpeed.ToString();
			obj[16] = " jumpCount=";
			obj[17] = b.maxJu