Decompiled source of Asuma Sarutobi v0.5.1

plugins/Asuma/Asuma.dll

Decompiled 9 hours ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Serialization;
using System.Runtime.Serialization.Json;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using AsumaEffects01;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using EntityStates;
using KinematicCharacterController;
using On.RoR2;
using On.RoR2.SurvivorMannequins;
using R2API;
using R2API.Utils;
using RoR2;
using RoR2.CharacterAI;
using RoR2.ConVar;
using RoR2.ContentManagement;
using RoR2.Networking;
using RoR2.Skills;
using RoR2.SurvivorMannequins;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.Networking;
using UnityEngine.Rendering;
using UnityEngine.SceneManagement;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("Asuma")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("Asuma")]
[assembly: AssemblyTitle("Asuma")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace AsumaMod
{
	public sealed class Cigarette : MonoBehaviour
	{
		private Material ember;

		private float born;

		public static void Attach(Transform mouth)
		{
			//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_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			if (!Object.op_Implicit((Object)(object)mouth.Find("Asuma cigarette")))
			{
				GameObject val = new GameObject("Asuma cigarette");
				val.transform.SetParent(mouth, false);
				val.transform.localPosition = new Vector3(0.017f, -0.005f, 0f);
				val.transform.localRotation = Quaternion.Euler(8f, -8f, 0f);
				val.AddComponent<Cigarette>().Build();
			}
		}

		private Material Solid(Color color, bool glow = false)
		{
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: Expected O, but got Unknown
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			Material val = new Material(Shader.Find("Hopoo Games/Deferred/Standard"));
			val.color = color;
			if (glow && val.HasProperty("_EmColor"))
			{
				val.SetColor("_EmColor", color);
				val.SetFloat("_EmPower", 0.5f);
			}
			return val;
		}

		private void Segment(string name, float z, float length, float radius, Material material)
		{
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			GameObject obj = GameObject.CreatePrimitive((PrimitiveType)2);
			((Object)obj).name = name;
			obj.transform.SetParent(((Component)this).transform, false);
			obj.transform.localPosition = new Vector3(0f, 0f, z);
			obj.transform.localRotation = Quaternion.Euler(90f, 0f, 0f);
			obj.transform.localScale = new Vector3(radius * 2f, length * 0.5f, radius * 2f);
			Collider component = obj.GetComponent<Collider>();
			component.enabled = false;
			Object.Destroy((Object)(object)component);
			Renderer component2 = obj.GetComponent<Renderer>();
			component2.sharedMaterial = material;
			component2.shadowCastingMode = (ShadowCastingMode)0;
		}

		private void Build()
		{
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0065: Unknown result type (might be due to invalid IL or missing references)
			//IL_0086: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0100: Unknown result type (might be due to invalid IL or missing references)
			//IL_011c: Unknown result type (might be due to invalid IL or missing references)
			//IL_012d: Unknown result type (might be due to invalid IL or missing references)
			//IL_013e: Unknown result type (might be due to invalid IL or missing references)
			//IL_015e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0163: Unknown result type (might be due to invalid IL or missing references)
			//IL_017e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0183: Unknown result type (might be due to invalid IL or missing references)
			//IL_018b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0196: Unknown result type (might be due to invalid IL or missing references)
			//IL_019b: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01df: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_020e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0219: Unknown result type (might be due to invalid IL or missing references)
			//IL_021e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0228: Unknown result type (might be due to invalid IL or missing references)
			//IL_022f: Expected O, but got Unknown
			//IL_0239: Unknown result type (might be due to invalid IL or missing references)
			//IL_0243: Unknown result type (might be due to invalid IL or missing references)
			//IL_0248: Unknown result type (might be due to invalid IL or missing references)
			//IL_024f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0259: Unknown result type (might be due to invalid IL or missing references)
			//IL_025e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0275: Unknown result type (might be due to invalid IL or missing references)
			//IL_027a: Unknown result type (might be due to invalid IL or missing references)
			//IL_028b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0290: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b4: Unknown result type (might be due to invalid IL or missing references)
			born = Time.time;
			Segment("filter", 0.009f, 0.018f, 0.0035f, Solid(new Color(0.53f, 0.32f, 0.15f)));
			Segment("paper", 0.045f, 0.054f, 0.0033f, Solid(new Color(0.83f, 0.79f, 0.69f)));
			ember = Solid(new Color(0.65f, 0.13f, 0.025f), glow: true);
			Segment("small ember", 0.073f, 0.003f, 0.0034f, ember);
			GameObject val = new GameObject("occasional cigarette smoke");
			val.transform.SetParent(((Component)this).transform, false);
			val.transform.localPosition = Vector3.forward * 0.075f;
			ParticleSystem val2 = val.AddComponent<ParticleSystem>();
			val2.Stop(true, (ParticleSystemStopBehavior)0);
			MainModule main = val2.main;
			((MainModule)(ref main)).loop = true;
			((MainModule)(ref main)).duration = 4f;
			((MainModule)(ref main)).startLifetime = MinMaxCurve.op_Implicit(0.65f);
			((MainModule)(ref main)).startSpeed = MinMaxCurve.op_Implicit(0.02f);
			((MainModule)(ref main)).startSize = MinMaxCurve.op_Implicit(0.025f);
			((MainModule)(ref main)).startColor = MinMaxGradient.op_Implicit(new Color(0.6f, 0.65f, 0.7f, 0.09f));
			((MainModule)(ref main)).maxParticles = 4;
			((MainModule)(ref main)).simulationSpace = (ParticleSystemSimulationSpace)1;
			EmissionModule emission = val2.emission;
			((EmissionModule)(ref emission)).rateOverTime = MinMaxCurve.op_Implicit(1.1f);
			ShapeModule shape = val2.shape;
			((ShapeModule)(ref shape)).enabled = false;
			VelocityOverLifetimeModule velocityOverLifetime = val2.velocityOverLifetime;
			((VelocityOverLifetimeModule)(ref velocityOverLifetime)).enabled = true;
			((VelocityOverLifetimeModule)(ref velocityOverLifetime)).space = (ParticleSystemSimulationSpace)1;
			((VelocityOverLifetimeModule)(ref velocityOverLifetime)).y = MinMaxCurve.op_Implicit(0.09f);
			((VelocityOverLifetimeModule)(ref velocityOverLifetime)).x = MinMaxCurve.op_Implicit(0.015f);
			SizeOverLifetimeModule sizeOverLifetime = val2.sizeOverLifetime;
			((SizeOverLifetimeModule)(ref sizeOverLifetime)).enabled = true;
			((SizeOverLifetimeModule)(ref sizeOverLifetime)).size = new MinMaxCurve(1f, AnimationCurve.Linear(0f, 0.4f, 1f, 1.6f));
			ColorOverLifetimeModule colorOverLifetime = val2.colorOverLifetime;
			((ColorOverLifetimeModule)(ref colorOverLifetime)).enabled = true;
			Gradient val3 = new Gradient();
			val3.SetKeys((GradientColorKey[])(object)new GradientColorKey[2]
			{
				new GradientColorKey(Color.white, 0f),
				new GradientColorKey(Color.white, 1f)
			}, (GradientAlphaKey[])(object)new GradientAlphaKey[3]
			{
				new GradientAlphaKey(0f, 0f),
				new GradientAlphaKey(1f, 0.15f),
				new GradientAlphaKey(0f, 1f)
			});
			((ColorOverLifetimeModule)(ref colorOverLifetime)).color = MinMaxGradient.op_Implicit(val3);
			ParticleSystemRenderer component = ((Component)val2).GetComponent<ParticleSystemRenderer>();
			((Renderer)component).sharedMaterial = AsumaVfx.SmokeMaterial;
			((Renderer)component).shadowCastingMode = (ShadowCastingMode)0;
			component.maxParticleSize = 0.03f;
			val2.Play();
		}

		private void Update()
		{
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			if (Object.op_Implicit((Object)(object)ember))
			{
				ember.color = new Color(0.56f + 0.1f * Mathf.Sin((Time.time - born) * 1.4f), 0.1f, 0.02f);
			}
		}

		private void OnDestroy()
		{
			Renderer[] componentsInChildren = ((Component)this).GetComponentsInChildren<Renderer>();
			foreach (Renderer val in componentsInChildren)
			{
				if (Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)val.sharedMaterial) && (Object)(object)val.sharedMaterial != (Object)(object)AsumaVfx.SmokeMaterial)
				{
					Object.Destroy((Object)(object)val.sharedMaterial);
				}
			}
		}
	}
	public static class Combat
	{
		public static Action<string> Trace;

		private static BodyIndex egg = (BodyIndex)(-1);

		public static bool Target(HurtBox hurt, CharacterBody attacker)
		{
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_0060: Unknown result type (might be due to invalid IL or missing references)
			//IL_0069: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Invalid comparison between Unknown and I4
			//IL_0080: Unknown result type (might be due to invalid IL or missing references)
			//IL_0086: Invalid comparison between Unknown and I4
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
			if (!Object.op_Implicit((Object)(object)hurt) || !Object.op_Implicit((Object)(object)hurt.healthComponent) || !hurt.healthComponent.alive || !Object.op_Implicit((Object)(object)attacker) || !Object.op_Implicit((Object)(object)attacker.teamComponent) || (Object)(object)hurt.healthComponent == (Object)(object)attacker.healthComponent || hurt.teamIndex == attacker.teamComponent.teamIndex)
			{
				return false;
			}
			if ((int)hurt.teamIndex != 0)
			{
				return true;
			}
			if ((int)egg == -1)
			{
				egg = BodyCatalog.FindBodyIndex("VultureEggBody");
			}
			if ((int)egg != -1 && Object.op_Implicit((Object)(object)hurt.healthComponent.body))
			{
				return hurt.healthComponent.body.bodyIndex == egg;
			}
			return false;
		}

		public static bool Visible(Vector3 origin, Vector3 point)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			return !Physics.Linecast(origin, point, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask), (QueryTriggerInteraction)1);
		}

		public unsafe static void Deal(CharacterBody attacker, HurtBox hurt, Vector3 position, float damage, float proc, bool crit, Vector3 force, bool burn = false, bool wound = false, float woundScale = 1f)
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: 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_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Expected O, but got Unknown
			//IL_0113: Unknown result type (might be due to invalid IL or missing references)
			//IL_0114: Unknown result type (might be due to invalid IL or missing references)
			if (NetworkServer.active && Target(hurt, attacker))
			{
				DamageInfo val = new DamageInfo
				{
					attacker = ((Component)attacker).gameObject,
					inflictor = ((Component)attacker).gameObject,
					damage = damage,
					crit = crit,
					position = position,
					force = force,
					procCoefficient = proc,
					damageType = DamageTypeCombo.op_Implicit((DamageType)0)
				};
				float health = hurt.healthComponent.health;
				hurt.healthComponent.TakeDamage(val);
				if (wound && !val.rejected && hurt.healthComponent.alive)
				{
					WindWound.Apply(attacker, hurt, woundScale);
				}
				Action<string> trace = Trace;
				if (trace != null)
				{
					string[] obj = new string[14]
					{
						"DAMAGE victim=",
						((Object)hurt.healthComponent).GetInstanceID().ToString(),
						" name=",
						((Object)hurt.healthComponent).name,
						" damage=",
						damage.ToString(),
						" proc=",
						proc.ToString(),
						" position=",
						null,
						null,
						null,
						null,
						null
					};
					Vector3 val2 = position;
					obj[9] = ((object)(*(Vector3*)(&val2))/*cast due to .constrained prefix*/).ToString();
					obj[10] = " burn=";
					obj[11] = burn.ToString();
					obj[12] = " applied=";
					obj[13] = (health - hurt.healthComponent.health).ToString();
					trace(string.Concat(obj));
				}
				GlobalEventManager.instance.OnHitEnemy(val, ((Component)hurt.healthComponent).gameObject);
				GlobalEventManager.instance.OnHitAll(val, ((Component)hurt.healthComponent).gameObject);
				if (burn && Tuning.AshBurn.Value > 0f && hurt.healthComponent.alive)
				{
					DotController.InflictDot(((Component)hurt.healthComponent).gameObject, ((Component)attacker).gameObject, hurt, (DotIndex)1, Tuning.AshBurn.Value, 1f, (uint?)null);
				}
			}
		}

		public static int Cone(CharacterBody attacker, Vector3 origin, Vector3 aim, float reach, float degrees, float coefficient, float proc, float force, HashSet<HealthComponent> hit, float halfHeight = 2f, bool wound = false, float woundScale = 1f)
		{
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: 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_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0102: Unknown result type (might be due to invalid IL or missing references)
			//IL_0103: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_011e: Unknown result type (might be due to invalid IL or missing references)
			//IL_012c: Unknown result type (might be due to invalid IL or missing references)
			//IL_012f: Unknown result type (might be due to invalid IL or missing references)
			if (!NetworkServer.active)
			{
				return 0;
			}
			bool crit = attacker.RollCrit();
			int num = 0;
			float num2 = Mathf.Cos(degrees * 0.5f * (MathF.PI / 180f));
			Vector3 val = Vector3.Cross(Vector3.up, aim);
			Vector3 val2 = ((Vector3)(ref val)).normalized;
			if (((Vector3)(ref val2)).sqrMagnitude < 0.01f)
			{
				val2 = Vector3.right;
			}
			val = Vector3.Cross(aim, val2);
			Vector3 normalized = ((Vector3)(ref val)).normalized;
			Collider[] array = Physics.OverlapSphere(origin, reach, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.entityPrecise)).mask), (QueryTriggerInteraction)2);
			foreach (Collider val3 in array)
			{
				HurtBox component = ((Component)val3).GetComponent<HurtBox>();
				if (Target(component, attacker) && !hit.Contains(component.healthComponent))
				{
					Vector3 val4 = val3.ClosestPoint(origin);
					Vector3 val5 = val4 - origin;
					if (!(Mathf.Abs(Vector3.Dot(val5, normalized)) > halfHeight) && !(((Vector3)(ref val5)).sqrMagnitude > reach * reach) && (!(((Vector3)(ref val5)).sqrMagnitude > 0.1f) || !(Vector3.Dot(((Vector3)(ref val5)).normalized, aim) < num2)) && Visible(origin, val4))
					{
						hit.Add(component.healthComponent);
						Deal(attacker, component, val4, attacker.damage * coefficient, proc, crit, aim * force, burn: false, wound, woundScale);
						num++;
					}
				}
			}
			return num;
		}
	}
	public abstract class AsumaAttack : BaseSkillState
	{
		protected Visual visual;

		protected bool awakened;

		protected float speed;

		protected float duration;

		protected string role;

		private string groundMotion;

		private string airMotion;

		protected virtual float Speed => Mathf.Max(0.25f, ((BaseState)this).attackSpeedStat);

		protected void StartMotion(string groundRole, string airRole, float fallbackDuration)
		{
			visual = Visual.Find(((EntityState)this).characterBody);
			speed = Speed;
			groundMotion = groundRole;
			airMotion = airRole;
			role = ((Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && !((EntityState)this).characterMotor.isGrounded) ? airRole : groundRole);
			duration = Media.Duration(role, fallbackDuration) / speed;
			visual?.Play(role, speed, duration, restart: true);
			((EntityState)this).characterBody.SetAimTimer(duration + 0.5f);
		}

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			string text = ((Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && !((EntityState)this).characterMotor.isGrounded) ? airMotion : groundMotion);
			if (text != role && Object.op_Implicit((Object)(object)visual) && !string.IsNullOrEmpty(text))
			{
				role = text;
				visual.SwitchVariant(role, Mathf.Clamp01(((EntityState)this).fixedAge / duration), speed, Mathf.Max(0f, duration - ((EntityState)this).fixedAge));
			}
		}

		public override void OnExit()
		{
			if (Object.op_Implicit((Object)(object)visual))
			{
				visual.ReleaseSkill();
			}
			((EntityState)this).OnExit();
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			return (InterruptPriority)2;
		}
	}
	public sealed class BladeCombo : AsumaAttack
	{
		public int Stage;

		private int nextContact;

		private float[] contacts;

		private float coefficient;

		private float proc;

		private int lastStage;

		private readonly HashSet<HealthComponent> hit = new HashSet<HealthComponent>();

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
			awakened = Awakening.Active(((EntityState)this).characterBody);
			lastStage = (awakened ? 2 : 3);
			Stage = Mathf.Clamp(Stage, 0, lastStage);
			string text = (awakened ? "AwakePrimary_" : "Primary_");
			string text2 = (Stage + 1).ToString("00");
			StartMotion(text + text2, text + text2 + "_Air", (new float[4] { 0.38f, 0.38f, 0.48f, 0.5f })[Stage]);
			contacts = Media.Contacts(role, (Stage != 2) ? new float[1] { (Stage == 3) ? 0.29f : 0.21f } : new float[3] { 0.2f, 0.31f, 0.43f });
			coefficient = ((!awakened) ? new float[4] { 1.6f, 1.6f, 2.4f, 3f } : new float[3] { 3.1f, 3.4f, 4.5f })[Stage] * Tuning.PrimaryDamage.Value * (awakened ? Tuning.AwakePrimaryDamage.Value : 1f);
			proc = ((!awakened && Stage == 2) ? 0.8f : 1f);
			Media.Event(((EntityState)this).characterBody, (Stage == lastStage) ? "FinisherVoice" : ((Stage % 2 == 0) ? "PrimaryVoiceA" : "PrimaryVoiceB"));
			if (!awakened && Stage == 2)
			{
				Media.Event(((EntityState)this).characterBody, "FlurrySwing");
			}
		}

		public override void FixedUpdate()
		{
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0105: Unknown result type (might be due to invalid IL or missing references)
			//IL_010b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0110: Unknown result type (might be due to invalid IL or missing references)
			//IL_0113: Unknown result type (might be due to invalid IL or missing references)
			//IL_0118: Unknown result type (might be due to invalid IL or missing references)
			base.FixedUpdate();
			while (nextContact < contacts.Length && ((EntityState)this).fixedAge >= contacts[nextContact] / speed)
			{
				hit.Clear();
				CharacterBody characterBody = ((EntityState)this).characterBody;
				Vector3 corePosition = ((EntityState)this).characterBody.corePosition;
				Ray aimRay = ((BaseState)this).GetAimRay();
				int num = Combat.Cone(characterBody, corePosition, ((Ray)(ref aimRay)).direction, awakened ? Tuning.AwakePrimaryReach.Value : Tuning.PrimaryReach.Value, 125f, coefficient / (float)contacts.Length, proc / (float)contacts.Length, (Stage == lastStage) ? 220 : 35, hit, 2f, awakened, 1f / (float)contacts.Length);
				bool flag = !awakened && Stage == 2;
				if (!flag)
				{
					Media.Event(((EntityState)this).characterBody, (awakened || Stage == lastStage) ? "BladeSwing" : "PrimarySwing");
				}
				if (num > 0)
				{
					Vector3 corePosition2 = ((EntityState)this).characterBody.corePosition;
					aimRay = ((BaseState)this).GetAimRay();
					Media.Impact(corePosition2 + ((Ray)(ref aimRay)).direction, flag ? ("FlurryContact" + (nextContact + 1)) : ((Stage == lastStage) ? "FinisherContact" : (awakened ? "BladeContact" : "PrimaryContact")));
				}
				Combat.Trace?.Invoke("CONTACT role=" + role + " stage=" + Stage + " ordinal=" + nextContact + " age=" + ((EntityState)this).fixedAge + " speed=" + speed + " hits=" + num + " coefficient=" + coefficient / (float)contacts.Length + " proc=" + proc / (float)contacts.Length);
				visual?.PulseBlades(0.14f, awakened);
				nextContact++;
			}
			if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= duration)
			{
				if (Stage < lastStage && ((EntityState)this).inputBank.skill1.down)
				{
					((EntityState)this).outer.SetNextState((EntityState)(object)new BladeCombo
					{
						Stage = Stage + 1
					});
				}
				else
				{
					((EntityState)this).outer.SetNextStateToMain();
				}
			}
		}

		public override void OnSerialize(NetworkWriter writer)
		{
			((BaseSkillState)this).OnSerialize(writer);
			writer.Write(Stage);
		}

		public override void OnDeserialize(NetworkReader reader)
		{
			((BaseSkillState)this).OnDeserialize(reader);
			Stage = reader.ReadInt32();
		}
	}
	public sealed class StraightLine : AsumaAttack
	{
		private bool fired;

		private readonly HashSet<HealthComponent> victims = new HashSet<HealthComponent>();

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
			StartMotion("StraightLine", "StraightLine_Air", 0.85f);
			Media.Event(((EntityState)this).characterBody, "StraightLineVoice");
			Combat.Trace?.Invoke("SECONDARY_ENTER normal realtime=" + Time.realtimeSinceStartup);
		}

		public unsafe override void FixedUpdate()
		{
			//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_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0101: Unknown result type (might be due to invalid IL or missing references)
			//IL_0106: Unknown result type (might be due to invalid IL or missing references)
			//IL_0109: Unknown result type (might be due to invalid IL or missing references)
			//IL_0113: Unknown result type (might be due to invalid IL or missing references)
			//IL_0118: Unknown result type (might be due to invalid IL or missing references)
			//IL_014f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0154: Unknown result type (might be due to invalid IL or missing references)
			//IL_0157: Unknown result type (might be due to invalid IL or missing references)
			//IL_015c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0182: Unknown result type (might be due to invalid IL or missing references)
			//IL_0193: Unknown result type (might be due to invalid IL or missing references)
			//IL_0175: Unknown result type (might be due to invalid IL or missing references)
			//IL_0198: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01da: Unknown result type (might be due to invalid IL or missing references)
			//IL_01db: Unknown result type (might be due to invalid IL or missing references)
			//IL_01dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_020f: Unknown result type (might be due to invalid IL or missing references)
			//IL_023f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0244: Unknown result type (might be due to invalid IL or missing references)
			//IL_025e: Unknown result type (might be due to invalid IL or missing references)
			//IL_025f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0279: Unknown result type (might be due to invalid IL or missing references)
			//IL_027b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0295: Unknown result type (might be due to invalid IL or missing references)
			//IL_0296: Unknown result type (might be due to invalid IL or missing references)
			base.FixedUpdate();
			Visual obj = visual;
			Ray aimRay;
			if (obj != null)
			{
				aimRay = ((BaseState)this).GetAimRay();
				obj.SetCastAim(((Ray)(ref aimRay)).direction, 0.1f);
			}
			if (!fired && ((EntityState)this).fixedAge >= Media.Contact(role, 0.38f) / speed)
			{
				fired = true;
				Combat.Trace?.Invoke("SECONDARY_RELEASE normal age=" + ((EntityState)this).fixedAge + " realtime=" + Time.realtimeSinceStartup);
				CharacterBody characterBody = ((EntityState)this).characterBody;
				Vector3 corePosition = ((EntityState)this).characterBody.corePosition;
				aimRay = ((BaseState)this).GetAimRay();
				if (Combat.Cone(characterBody, corePosition, ((Ray)(ref aimRay)).direction, Tuning.StraightReach.Value, 150f, Tuning.StraightDamage.Value, 1f, 300f, victims, 1.55f, wound: true) > 0)
				{
					Vector3 corePosition2 = ((EntityState)this).characterBody.corePosition;
					aimRay = ((BaseState)this).GetAimRay();
					Media.Impact(corePosition2 + ((Ray)(ref aimRay)).direction * 3f, "BladeContact");
				}
				Media.Event(((EntityState)this).characterBody, "StraightLineRelease");
				visual?.PulseBlades(0.25f, awake: false);
				aimRay = ((BaseState)this).GetAimRay();
				Vector3 direction = ((Ray)(ref aimRay)).direction;
				Vector3 val = (Object.op_Implicit((Object)(object)visual) ? visual.SampleReleaseRight(direction, Media.Contact(role, 0.52f)) : ((EntityState)this).characterBody.transform.right);
				Vector3 val2 = (Object.op_Implicit((Object)(object)visual) ? visual.Socket("blade_l", ((EntityState)this).characterBody.corePosition) : ((EntityState)this).characterBody.corePosition);
				Vector3 val3 = AsumaVfx.StraightLinePlaneOrigin(((EntityState)this).characterBody.corePosition, val2, direction, val, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask));
				AsumaVfx.StraightLine(val3, direction, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask), Tuning.StraightReach.Value, val);
				Action<string> trace = Combat.Trace;
				if (trace != null)
				{
					string[] obj2 = new string[8]
					{
						"STRAIGHT_PLANE core=",
						((object)((EntityState)this).characterBody.corePosition/*cast due to .constrained prefix*/).ToString(),
						" blade=",
						null,
						null,
						null,
						null,
						null
					};
					Vector3 val4 = val2;
					obj2[3] = ((object)(*(Vector3*)(&val4))/*cast due to .constrained prefix*/).ToString();
					obj2[4] = " origin=";
					val4 = val3;
					obj2[5] = ((object)(*(Vector3*)(&val4))/*cast due to .constrained prefix*/).ToString();
					obj2[6] = " aim=";
					val4 = direction;
					obj2[7] = ((object)(*(Vector3*)(&val4))/*cast due to .constrained prefix*/).ToString();
					trace(string.Concat(obj2));
				}
			}
			if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= duration)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}
	}
	public sealed class BurningAsh : AsumaAttack
	{
		private bool expelled;

		private Vector3 aim;

		private Vector3 mouth;

		protected override float Speed => 1f;

		public override void OnEnter()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_0044: Unknown result type (might be due to invalid IL or missing references)
			((BaseState)this).OnEnter();
			Ray aimRay = ((BaseState)this).GetAimRay();
			Vector3 direction = ((Ray)(ref aimRay)).direction;
			aim = ((Vector3)(ref direction)).normalized;
			StartMotion("AshCast", "AshCast_Air", 0.42f);
			visual?.SetCastAim(aim, 0.45f);
			Media.Event(((EntityState)this).characterBody, "AshVoice");
			Media.Event(((EntityState)this).characterBody, "AshCast");
		}

		public override void FixedUpdate()
		{
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0069: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_006e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0081: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Unknown result type (might be due to invalid IL or missing references)
			base.FixedUpdate();
			if (!expelled && ((EntityState)this).fixedAge >= 0.28f)
			{
				expelled = true;
				mouth = (Object.op_Implicit((Object)(object)visual) ? visual.SampleMouth(aim, ((EntityState)this).fixedAge) : (((EntityState)this).characterBody.corePosition + Vector3.up * 0.55f));
				if (NetworkServer.active)
				{
					AshVolume.Spawn(((EntityState)this).characterBody, mouth, aim, 0.8f - ((EntityState)this).fixedAge);
				}
				Media.Event(((EntityState)this).characterBody, "AshExhale");
			}
			visual?.HideKnives(((EntityState)this).fixedAge >= 0.03f && ((EntityState)this).fixedAge < 0.3f);
			if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= 0.45f)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		public override void OnSerialize(NetworkWriter writer)
		{
			//IL_0009: 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)
			((BaseSkillState)this).OnSerialize(writer);
			writer.Write(aim);
			writer.Write(mouth);
		}

		public override void OnDeserialize(NetworkReader reader)
		{
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			((BaseSkillState)this).OnDeserialize(reader);
			aim = reader.ReadVector3();
			mouth = reader.ReadVector3();
		}

		public override void OnExit()
		{
			visual?.HideKnives(hide: false);
			base.OnExit();
		}
	}
	public sealed class FlyingSwallow : AsumaAttack
	{
		private bool committed;

		protected override float Speed => 1f;

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
			StartMotion("Awakening", "Awakening_Air", 0.65f);
			Media.Event(((EntityState)this).characterBody, "AwakeningVoice");
		}

		public override void FixedUpdate()
		{
			base.FixedUpdate();
			visual?.AwakeningProgress(Mathf.InverseLerp(0.32f, 0.55f, ((EntityState)this).fixedAge));
			if (!committed && ((EntityState)this).fixedAge >= 0.55f)
			{
				committed = true;
				if (NetworkServer.active)
				{
					((EntityState)this).GetComponent<Awakening>()?.Begin();
				}
			}
			if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= duration)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		public override void OnExit()
		{
			if (!Awakening.Active(((EntityState)this).characterBody))
			{
				visual?.AwakeningProgress(0f);
			}
			base.OnExit();
		}
	}
	public sealed class WaveSlash : AsumaAttack
	{
		private bool fired;

		public int Variant;

		protected override float Speed => Mathf.Clamp(((BaseState)this).attackSpeedStat, 0.5f, 1.6f);

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
			awakened = Awakening.Active(((EntityState)this).characterBody);
			if (((EntityState)this).isAuthority)
			{
				Variant = ((EntityState)this).GetComponent<Awakening>().NextWaveVariant;
			}
			StartMotion("Wave_0" + (Variant + 1), "Wave_0" + (Variant + 1) + "_Air", 0.65f);
			Combat.Trace?.Invoke("SECONDARY_ENTER wave variant=" + Variant + " stock=" + ((EntityState)this).skillLocator.secondary.stock + " realtime=" + Time.realtimeSinceStartup);
		}

		public override void FixedUpdate()
		{
			//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_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0109: Unknown result type (might be due to invalid IL or missing references)
			//IL_011b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_0120: Unknown result type (might be due to invalid IL or missing references)
			//IL_0134: Unknown result type (might be due to invalid IL or missing references)
			//IL_013b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0145: Unknown result type (might be due to invalid IL or missing references)
			//IL_014a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0151: Unknown result type (might be due to invalid IL or missing references)
			//IL_0156: Unknown result type (might be due to invalid IL or missing references)
			base.FixedUpdate();
			Visual obj = visual;
			if (obj != null)
			{
				Ray aimRay = ((BaseState)this).GetAimRay();
				obj.SetCastAim(((Ray)(ref aimRay)).direction, 0.1f);
			}
			if (!fired && ((EntityState)this).fixedAge >= Media.Contact(role, 0.17f) / speed)
			{
				fired = true;
				Combat.Trace?.Invoke("SECONDARY_RELEASE wave variant=" + Variant + " age=" + ((EntityState)this).fixedAge + " realtime=" + Time.realtimeSinceStartup);
				if (awakened && Awakening.Active(((EntityState)this).characterBody))
				{
					Ray aimRay2 = ((BaseState)this).GetAimRay();
					Vector3 value = (Object.op_Implicit((Object)(object)visual) ? visual.SampleReleaseRight(((Ray)(ref aimRay2)).direction, ((EntityState)this).fixedAge * speed) : ((EntityState)this).characterBody.transform.right);
					if (NetworkServer.active)
					{
						WindWave.Spawn(((EntityState)this).characterBody, ((EntityState)this).characterBody.corePosition + ((Ray)(ref aimRay2)).direction * 0.7f, ((Ray)(ref aimRay2)).direction, value);
					}
					if (((EntityState)this).isAuthority)
					{
						((EntityState)this).GetComponent<Awakening>().CommitWaveVariant(Variant);
					}
					Media.Event(((EntityState)this).characterBody, "WaveRelease");
					visual?.PulseBlades(0.2f, awake: true);
					Media.Event(((EntityState)this).characterBody, "WaveVoice");
				}
			}
			if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= duration)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		public override void OnSerialize(NetworkWriter writer)
		{
			((BaseSkillState)this).OnSerialize(writer);
			writer.Write(Variant);
		}

		public override void OnDeserialize(NetworkReader reader)
		{
			((BaseSkillState)this).OnDeserialize(reader);
			Variant = reader.ReadInt32();
		}
	}
	[Serializable]
	public class RoleBinding
	{
		public string role;

		public string clip;

		public float duration;

		public float[] contacts;
	}
	[Serializable]
	public class SocketBinding
	{
		public string role;

		public string bone;
	}
	[Serializable]
	public class EventBinding
	{
		public string role;

		public string eventName;

		public float duration;

		[OptionalField]
		public float speechDuration;
	}
	[Serializable]
	public class IconBinding
	{
		public string role;

		public string file;
	}
	[Serializable]
	public class EffectBinding
	{
		public string role;

		public string prefab;

		public float referenceRadius = 1f;
	}
	[Serializable]
	public class MediaContract
	{
		public string model = "Asuma.json";

		public string awakenedModel;

		public string bank;

		public string effectBundle;

		public float modelScale = 1f;

		public RoleBinding[] roles = new RoleBinding[0];

		public SocketBinding[] sockets = new SocketBinding[0];

		public EventBinding[] events = new EventBinding[0];

		public IconBinding[] icons = new IconBinding[0];

		public EffectBinding[] effects = new EffectBinding[0];
	}
	public static class Media
	{
		public static MediaContract Contract = new MediaContract();

		private static readonly Dictionary<string, Sprite> iconCache = new Dictionary<string, Sprite>();

		private static readonly HashSet<string> missing = new HashSet<string>();

		private static AssetBundle effectBundle;

		private static readonly Dictionary<string, NetworkSoundEventDef> networkSounds = new Dictionary<string, NetworkSoundEventDef>();

		public static string Assets => Path.Combine(Path.GetDirectoryName(((BaseUnityPlugin)Plugin.Instance).Info.Location), "Assets");

		public static IEnumerable<NetworkSoundEventDef> NetworkSounds => networkSounds.Values;

		public static T Read<T>(string path)
		{
			using FileStream stream = File.OpenRead(path);
			return (T)new DataContractJsonSerializer(typeof(T)).ReadObject(stream);
		}

		public static void Load()
		{
			string path = Path.Combine(Assets, "AsumaMedia.json");
			if (File.Exists(path))
			{
				Contract = Read<MediaContract>(path);
			}
			else
			{
				Missing("AsumaMedia.json — awaiting authenticated specialist handoff");
			}
			if (!string.IsNullOrEmpty(Contract.bank))
			{
				SoundBanks.Add(File.ReadAllBytes(Path.Combine(Assets, Contract.bank)));
			}
			VoiceVariants.Load();
			if (!string.IsNullOrEmpty(Contract.effectBundle))
			{
				effectBundle = AssetBundle.LoadFromFile(Path.Combine(Assets, Contract.effectBundle));
			}
			AsumaVfx.Init(Path.Combine(Assets, "Runtime"));
			foreach (EventBinding item in from b in (Contract.events ?? new EventBinding[0]).Concat((VoiceVariants.Contract.shared ?? new VoiceBinding[0]).Select((VoiceBinding b) => b.ActorEvent()))
				group b by b.role into g
				select g.Last())
			{
				NetworkSoundEventDef val = ScriptableObject.CreateInstance<NetworkSoundEventDef>();
				((Object)val).name = "AsumaSound" + item.role;
				val.eventName = item.eventName;
				val.akId = AkSoundEngine.GetIDFromString(item.eventName);
				networkSounds[item.role] = val;
			}
		}

		public static void Missing(string key)
		{
			if (missing.Add(key))
			{
				Plugin.Instance.Log.LogWarning((object)("ASUMA_MEDIA_MISSING " + key));
			}
		}

		public static RoleBinding Role(string role)
		{
			return Contract.roles?.FirstOrDefault((RoleBinding r) => r.role == role);
		}

		public static string Clip(string role)
		{
			return Role(role)?.clip ?? role;
		}

		public static float Duration(string role, float fallback)
		{
			RoleBinding roleBinding = Role(role);
			if (roleBinding == null || !(roleBinding.duration > 0f))
			{
				return fallback;
			}
			return roleBinding.duration;
		}

		public static float[] Contacts(string role, float[] fallback)
		{
			return Role(role)?.contacts ?? fallback;
		}

		public static float Contact(string role, float fallback)
		{
			float[] array = Role(role)?.contacts;
			if (array == null || array.Length == 0)
			{
				return fallback;
			}
			return array[0];
		}

		public static string Bone(string socket)
		{
			return Contract.sockets?.FirstOrDefault((SocketBinding s) => s.role == socket)?.bone;
		}

		public static Sprite Icon(string role)
		{
			//IL_006c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0072: Expected O, but got Unknown
			//IL_0149: Unknown result type (might be due to invalid IL or missing references)
			//IL_0158: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0111: Unknown result type (might be due to invalid IL or missing references)
			//IL_0117: Unknown result type (might be due to invalid IL or missing references)
			//IL_0125: Expected O, but got Unknown
			if (iconCache.TryGetValue(role, out var value))
			{
				return value;
			}
			IconBinding iconBinding = Contract.icons?.FirstOrDefault((IconBinding i) => i.role == role);
			if (iconBinding == null)
			{
				return iconCache[role] = NativeIcons.Make(role);
			}
			Texture2D val2 = new Texture2D(2, 2);
			ImageConversion.LoadImage(val2, File.ReadAllBytes(Path.Combine(Assets, iconBinding.file)));
			((Texture)val2).wrapMode = (TextureWrapMode)1;
			if (role == "portrait" && ((Texture)val2).width != ((Texture)val2).height)
			{
				int num = Mathf.Max(((Texture)val2).width, ((Texture)val2).height);
				Texture2D val3 = new Texture2D(num, num, (TextureFormat)4, false);
				val3.SetPixels((Color[])(object)new Color[num * num]);
				val3.SetPixels((num - ((Texture)val2).width) / 2, (num - ((Texture)val2).height) / 2, ((Texture)val2).width, ((Texture)val2).height, val2.GetPixels());
				val3.Apply();
				((Texture)val3).wrapMode = (TextureWrapMode)1;
				Object.Destroy((Object)(object)val2);
				val2 = val3;
			}
			return iconCache[role] = Sprite.Create(val2, new Rect(0f, 0f, (float)((Texture)val2).width, (float)((Texture)val2).height), new Vector2(0.5f, 0.5f));
		}

		public static void Event(CharacterBody body, string role)
		{
			if (Object.op_Implicit((Object)(object)body))
			{
				Event(((Component)body).gameObject, role);
			}
		}

		public static void Event(GameObject emitter, string role)
		{
			if (NetworkClient.active && Object.op_Implicit((Object)(object)emitter))
			{
				EventBinding eventBinding = (role.Contains("Voice") ? VoiceVariants.Resolve(emitter.GetComponent<CharacterBody>(), role) : (VoiceVariants.Shared(role) ?? Contract.events?.FirstOrDefault((EventBinding e) => e.role == role)));
				if (eventBinding == null || string.IsNullOrEmpty(eventBinding.eventName))
				{
					Missing("audio:" + role);
				}
				else
				{
					(emitter.GetComponent<AsumaAudio>() ?? emitter.AddComponent<AsumaAudio>()).Play(eventBinding);
				}
			}
		}

		public static void EventAt(Vector3 position, string role)
		{
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_007e: Expected O, but got Unknown
			//IL_0099: Expected O, but got Unknown
			if (NetworkClient.active)
			{
				EventBinding eventBinding = Contract.events?.FirstOrDefault((EventBinding e) => e.role == role);
				if (eventBinding == null)
				{
					Missing("audio:" + role);
					return;
				}
				GameObject val = new GameObject("Asuma detached " + role);
				val.transform.position = position;
				Media.Event(val, role);
				Object.Destroy((Object)val, Mathf.Max(0.2f, eventBinding.duration) + 0.2f);
			}
		}

		public static void Impact(Vector3 position, string role)
		{
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			if (NetworkServer.active && networkSounds.TryGetValue(role, out var value))
			{
				EffectManager.SimpleSoundEffect(value.index, position, true);
			}
		}

		public static GameObject SpawnVfx(string role, Vector3 position, Vector3 direction, float radius, float lifetime)
		{
			//IL_0087: Unknown result type (might be due to invalid IL or missing references)
			//IL_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_009a: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
			EffectBinding effectBinding = Contract.effects?.FirstOrDefault((EffectBinding e) => e.role == role);
			if (effectBinding == null || !Object.op_Implicit((Object)(object)effectBundle))
			{
				Missing("effect:" + role);
				return null;
			}
			GameObject val = effectBundle.LoadAsset<GameObject>(effectBinding.prefab);
			if (!Object.op_Implicit((Object)(object)val))
			{
				Missing("effect-prefab:" + effectBinding.prefab);
				return null;
			}
			GameObject obj = Object.Instantiate<GameObject>(val, position, Quaternion.LookRotation(direction));
			Transform transform = obj.transform;
			transform.localScale *= radius / Mathf.Max(0.01f, effectBinding.referenceRadius);
			Object.Destroy((Object)(object)obj, lifetime);
			return obj;
		}
	}
	public sealed class AsumaAudio : MonoBehaviour
	{
		private sealed class Handle
		{
			public uint id;

			public float until;

			public string group;
		}

		private readonly List<Handle> playing = new List<Handle>();

		private readonly Queue<EventBinding> pendingSpeech = new Queue<EventBinding>();

		private float voiceUntil;

		private float waveVoiceUntil;

		public void Play(EventBinding binding)
		{
			bool flag = binding.role.Contains("Voice");
			if (flag && Time.time < voiceUntil)
			{
				if ((binding.role == "AshVoice" || binding.role == "AwakeningVoice" || binding.role == "StraightLineVoice") && !pendingSpeech.Any((EventBinding p) => p.role == binding.role) && pendingSpeech.Count < 2)
				{
					pendingSpeech.Enqueue(binding);
				}
			}
			else
			{
				if (binding.role == "WaveVoice" && Time.time < waveVoiceUntil)
				{
					return;
				}
				string group = (flag ? "voice" : (binding.role.Contains("Contact") ? "contact" : (binding.role.Contains("Swing") ? "swing" : ((binding.role == "WaveRelease") ? "wave" : binding.role))));
				playing.RemoveAll((Handle h) => h.until <= Time.time);
				Handle[] array = playing.Where((Handle h) => h.group == group).ToArray();
				if (!flag && array.Length >= 2)
				{
					AkSoundEngine.StopPlayingID(array[0].id, 40);
					playing.Remove(array[0]);
				}
				if (!Object.op_Implicit((Object)(object)((Component)this).GetComponent<AkGameObj>()))
				{
					((Component)this).gameObject.AddComponent<AkGameObj>();
				}
				uint id = AkSoundEngine.PostEvent(binding.eventName, ((Component)this).gameObject);
				if (flag)
				{
					Plugin.Instance.Log.LogInfo((object)("ASUMA_SPEECH role=" + binding.role + " playingId=" + id + " realtime=" + Time.realtimeSinceStartup));
				}
				playing.Add(new Handle
				{
					id = id,
					until = Time.time + Mathf.Max(0.2f, binding.duration),
					group = group
				});
				if (flag)
				{
					voiceUntil = Time.time + Mathf.Max(0.2f, (binding.speechDuration > 0f) ? binding.speechDuration : binding.duration);
					if (binding.role == "WaveVoice")
					{
						waveVoiceUntil = Time.time + 2.5f;
					}
				}
			}
		}

		private void Update()
		{
			CharacterBody component = ((Component)this).GetComponent<CharacterBody>();
			if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component.healthComponent) && !component.healthComponent.alive)
			{
				Stop();
			}
			else if (pendingSpeech.Count > 0 && Time.time >= voiceUntil)
			{
				Play(pendingSpeech.Dequeue());
			}
		}

		private void Stop()
		{
			foreach (Handle item in playing)
			{
				AkSoundEngine.StopPlayingID(item.id, 100);
			}
			playing.Clear();
			pendingSpeech.Clear();
		}

		private void OnDisable()
		{
			Stop();
		}
	}
	public static class MovementStats
	{
		[Serializable]
		[CompilerGenerated]
		private sealed class <>c
		{
			public static readonly <>c <>9 = new <>c();

			public static hook_RecalculateStats <>9__1_0;

			internal void <Install>b__1_0(orig_RecalculateStats orig, CharacterBody body)
			{
				orig.Invoke(body);
				if (Awakening.Active(body))
				{
					SetMoveSpeed(body, body.moveSpeed * 1.25f);
				}
			}
		}

		private static readonly Action<CharacterBody, float> SetMoveSpeed = (Action<CharacterBody, float>)Delegate.CreateDelegate(typeof(Action<CharacterBody, float>), typeof(CharacterBody).GetProperty("moveSpeed").GetSetMethod(nonPublic: true));

		public static void Install()
		{
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Expected O, but got Unknown
			object obj = <>c.<>9__1_0;
			if (obj == null)
			{
				hook_RecalculateStats val = delegate(orig_RecalculateStats orig, CharacterBody body)
				{
					orig.Invoke(body);
					if (Awakening.Active(body))
					{
						SetMoveSpeed(body, body.moveSpeed * 1.25f);
					}
				};
				<>c.<>9__1_0 = val;
				obj = (object)val;
			}
			CharacterBody.RecalculateStats += (hook_RecalculateStats)obj;
		}
	}
	internal static class NativeIcons
	{
		private static float Line(Vector2 p, Vector2 a, Vector2 b)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			Vector2 val = b - a;
			float num = Mathf.Clamp01(Vector2.Dot(p - a, val) / ((Vector2)(ref val)).sqrMagnitude);
			return Vector2.Distance(p, a + num * val);
		}

		public static Sprite Make(string role)
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Expected O, but got Unknown
			//IL_04a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_04ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_04b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_009a: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0102: Unknown result type (might be due to invalid IL or missing references)
			//IL_010e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0118: Unknown result type (might be due to invalid IL or missing references)
			//IL_0124: Unknown result type (might be due to invalid IL or missing references)
			//IL_0130: Unknown result type (might be due to invalid IL or missing references)
			//IL_0143: Unknown result type (might be due to invalid IL or missing references)
			//IL_014f: Unknown result type (might be due to invalid IL or missing references)
			//IL_016d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0179: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_03be: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_03fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_0403: Unknown result type (might be due to invalid IL or missing references)
			//IL_0416: Unknown result type (might be due to invalid IL or missing references)
			//IL_041b: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0444: Unknown result type (might be due to invalid IL or missing references)
			//IL_0446: Unknown result type (might be due to invalid IL or missing references)
			//IL_045f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0464: Unknown result type (might be due to invalid IL or missing references)
			//IL_030d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0319: Unknown result type (might be due to invalid IL or missing references)
			//IL_0328: Unknown result type (might be due to invalid IL or missing references)
			//IL_0336: Unknown result type (might be due to invalid IL or missing references)
			//IL_0342: Unknown result type (might be due to invalid IL or missing references)
			//IL_0351: Unknown result type (might be due to invalid IL or missing references)
			//IL_0364: Unknown result type (might be due to invalid IL or missing references)
			//IL_0370: Unknown result type (might be due to invalid IL or missing references)
			//IL_037f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0392: Unknown result type (might be due to invalid IL or missing references)
			//IL_039e: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_0239: Unknown result type (might be due to invalid IL or missing references)
			//IL_0245: Unknown result type (might be due to invalid IL or missing references)
			//IL_025a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0266: Unknown result type (might be due to invalid IL or missing references)
			//IL_0284: Unknown result type (might be due to invalid IL or missing references)
			//IL_0290: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_02dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f7: Unknown result type (might be due to invalid IL or missing references)
			Texture2D val = new Texture2D(128, 128, (TextureFormat)4, false);
			((Object)val).name = "Asuma authored " + role;
			((Texture)val).wrapMode = (TextureWrapMode)1;
			Color[] array = (Color[])(object)new Color[16384];
			Vector2 val2 = default(Vector2);
			for (int i = 0; i < 128; i++)
			{
				for (int j = 0; j < 128; j++)
				{
					((Vector2)(ref val2))..ctor(((float)j + 0.5f) / 128f * 2f - 1f, ((float)i + 0.5f) / 128f * 2f - 1f);
					Color val3 = ((role == "utility") ? new Color(1f, 0.62f, 0.25f) : new Color(0.72f, 0.93f, 1f));
					float num = 9f;
					switch (role)
					{
					case "primary":
					case "special":
					{
						float num2 = ((role == "special") ? 0.77f : 0.5f);
						num = Mathf.Min(Line(val2, new Vector2(-0.55f, -0.58f), new Vector2(0.1f, num2)), Line(val2, new Vector2(0.05f, -0.58f), new Vector2(0.65f, num2)));
						num = Mathf.Min(num, Mathf.Abs(Vector2.Distance(val2, new Vector2(-0.54f, -0.53f)) - 0.13f));
						num = Mathf.Min(num, Mathf.Abs(Vector2.Distance(val2, new Vector2(0.04f, -0.53f)) - 0.13f));
						break;
					}
					case "secondary":
					case "windwave":
						if (Mathf.Abs(Mathf.Atan2(val2.x, val2.y + 0.25f) * 57.29578f) < 75f)
						{
							Vector2 val4 = val2 + new Vector2(0f, 0.25f);
							float magnitude = ((Vector2)(ref val4)).magnitude;
							num = Mathf.Min(Mathf.Abs(magnitude - 0.72f), Mathf.Abs(magnitude - 0.47f));
						}
						break;
					case "utility":
						num = Mathf.Min(Mathf.Abs(Vector2.Distance(val2, new Vector2(-0.35f, 0.08f)) - 0.28f), Mathf.Abs(Vector2.Distance(val2, new Vector2(0.02f, 0.31f)) - 0.32f));
						num = Mathf.Min(num, Mathf.Abs(Vector2.Distance(val2, new Vector2(0.38f, 0.06f)) - 0.27f));
						num = Mathf.Min(num, Line(val2, new Vector2(-0.18f, -0.58f), new Vector2(0.08f, -0.12f)));
						num = Mathf.Min(num, Line(val2, new Vector2(0.08f, -0.12f), new Vector2(0.22f, -0.58f)));
						break;
					default:
						num = Line(val2, new Vector2(0.5f, -0.75f), new Vector2(0.5f, 0.75f));
						num = Mathf.Min(num, Line(val2, new Vector2(-0.3f, -0.6f), new Vector2(-0.3f, 0.55f)));
						num = Mathf.Min(num, Line(val2, new Vector2(-0.3f, 0.55f), new Vector2(-0.58f, 0.2f)));
						num = Mathf.Min(num, Line(val2, new Vector2(-0.3f, 0.55f), new Vector2(-0.02f, 0.2f)));
						break;
					}
					float num3 = Mathf.Max(Mathf.Abs(val2.x), Mathf.Abs(val2.y));
					Color val5 = Color.Lerp(new Color(0.035f, 0.07f, 0.095f), new Color(0.11f, 0.19f, 0.23f), (val2.y + 1f) * 0.5f);
					if (num3 > 0.92f)
					{
						((Color)(ref val5))..ctor(0.24f, 0.42f, 0.46f);
					}
					array[i * 128 + j] = Color.Lerp(val5, val3, 1f - Mathf.SmoothStep(0.025f, 0.065f, num));
				}
			}
			val.SetPixels(array);
			val.Apply();
			return Sprite.Create(val, new Rect(0f, 0f, 128f, 128f), Vector2.one * 0.5f);
		}
	}
	public static class Playtest
	{
		private struct WallCandidate
		{
			public Vector3 p;

			public Vector3 n;

			public float score;

			public float minY;

			public float turn;

			public string name;
		}

		[Serializable]
		[CompilerGenerated]
		private sealed class <>c
		{
			public static readonly <>c <>9 = new <>c();

			public static hook_Update <>9__8_0;

			public static hook_FixedUpdate <>9__8_1;

			public static Action <>9__8_2;

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

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

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

			public static Func<AshVisual, IEnumerable<MeshRenderer>> <>9__23_0;

			public static Func<VictimBurnVisual, IEnumerable<MeshRenderer>> <>9__23_1;

			public static Func<MeshRenderer, Transform> <>9__23_2;

			public static Func<Transform, Quaternion> <>9__23_3;

			public static Func<WallCandidate, float> <>9__26_0;

			public static Func<WallCandidate, string> <>9__26_1;

			public static hook_LateUpdate <>9__28_0;

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

			public static Func<SkinDef, int, string> <>9__38_0;

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

			internal void <Init>b__8_0(orig_Update orig, PlayerCharacterMasterController pc)
			{
				Snapshot(pc);
				orig.Invoke(pc);
				Apply(pc, fixedInput: false);
			}

			internal void <Init>b__8_1(orig_FixedUpdate orig, PlayerCharacterMasterController pc)
			{
				Snapshot(pc);
				orig.Invoke(pc);
				Apply(pc, fixedInput: true);
			}

			internal void <Init>b__8_2()
			{
				((MonoBehaviour)Plugin.Instance).StartCoroutine(Run());
			}

			internal bool <Run>b__13_0(NetworkUser u)
			{
				return ((NetworkBehaviour)u).isLocalPlayer;
			}

			internal bool <Run>b__13_1(VehicleSeat s)
			{
				return (Object)(object)s.currentPassengerBody == (Object)(object)actor;
			}

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

			internal IEnumerable<MeshRenderer> <Capture>b__23_0(AshVisual v)
			{
				return ((Component)v).GetComponentsInChildren<MeshRenderer>();
			}

			internal IEnumerable<MeshRenderer> <Capture>b__23_1(VictimBurnVisual v)
			{
				return ((Component)v).GetComponentsInChildren<MeshRenderer>();
			}

			internal Transform <Capture>b__23_2(MeshRenderer r)
			{
				return ((Component)r).transform;
			}

			internal Quaternion <Capture>b__23_3(Transform t)
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				return t.rotation;
			}

			internal float <RealWallCheck>b__26_0(WallCandidate x)
			{
				return x.score;
			}

			internal unsafe string <RealWallCheck>b__26_1(WallCandidate x)
			{
				//IL_001b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0020: Unknown result type (might be due to invalid IL or missing references)
				//IL_003a: Unknown result type (might be due to invalid IL or missing references)
				//IL_003f: Unknown result type (might be due to invalid IL or missing references)
				string[] obj = new string[9] { x.name, " point=", null, null, null, null, null, null, null };
				Vector3 p = x.p;
				obj[2] = ((object)(*(Vector3*)(&p))/*cast due to .constrained prefix*/).ToString();
				obj[3] = " normal=";
				p = x.n;
				obj[4] = ((object)(*(Vector3*)(&p))/*cast due to .constrained prefix*/).ToString();
				obj[5] = " predictedTurn=";
				obj[6] = x.turn.ToString();
				obj[7] = " minY=";
				obj[8] = x.minY.ToString();
				return string.Concat(obj);
			}

			internal void <ReleaseCandidateTwoRear>b__28_0(orig_LateUpdate orig, CameraRigController rig)
			{
				//IL_003b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0040: Unknown result type (might be due to invalid IL or missing references)
				//IL_0048: Unknown result type (might be due to invalid IL or missing references)
				//IL_004d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0057: Unknown result type (might be due to invalid IL or missing references)
				//IL_005c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0061: Unknown result type (might be due to invalid IL or missing references)
				//IL_006b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0070: Unknown result type (might be due to invalid IL or missing references)
				//IL_0075: Unknown result type (might be due to invalid IL or missing references)
				//IL_0081: Unknown result type (might be due to invalid IL or missing references)
				//IL_0086: Unknown result type (might be due to invalid IL or missing references)
				//IL_0090: Unknown result type (might be due to invalid IL or missing references)
				//IL_0095: Unknown result type (might be due to invalid IL or missing references)
				//IL_009a: Unknown result type (might be due to invalid IL or missing references)
				//IL_009b: Unknown result type (might be due to invalid IL or missing references)
				//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
				//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
				//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
				//IL_00af: Unknown result type (might be due to invalid IL or missing references)
				//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
				orig.Invoke(rig);
				if (rearCamera && Object.op_Implicit((Object)(object)actor) && (Object)(object)rig.target == (Object)(object)((Component)actor).gameObject)
				{
					CameraState currentCameraState = rig.currentCameraState;
					currentCameraState.position = actor.corePosition + Vector3.up * 1.3f - Vector3.forward * 6f;
					currentCameraState.rotation = Quaternion.LookRotation(actor.corePosition + Vector3.forward * 12f - currentCameraState.position, Vector3.up);
					rig.SetCameraState(currentCameraState);
				}
			}

			internal bool <ReleaseCandidateTwo>b__29_0(SkinnedMeshRenderer x)
			{
				if (!((Object)x).name.Contains("eye_l_"))
				{
					return ((Object)x).name.Contains("eye_r_");
				}
				return true;
			}

			internal string <RevisionVisual>b__38_0(SkinDef s, int i)
			{
				return i + ":" + ((Object)s).name;
			}

			internal float <AshBaselineLayout>b__39_0(CharacterBody v)
			{
				return v.healthComponent.health;
			}
		}

		private static CharacterBody actor;

		private static TestInput input;

		private static EntityStateMachine weapon;

		private static Vector3 home;

		private static string evidence;

		private static readonly List<string> results = new List<string>();

		private static int frame;

		private static float captureStart;

		private static bool rearCamera;

		private static Vector3 captureAngle = new Vector3(0.65f, 0.22f, -0.8f);

		private static Vector3? captureFocus;

		public static void Init()
		{
			//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ad: Expected O, but got Unknown
			//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d1: Expected O, but got Unknown
			if (!File.Exists(Path.Combine(Media.Assets, "RUN_ASUMA_QA")))
			{
				return;
			}
			evidence = Path.GetFullPath(Path.Combine(Media.Assets, "..", "..", "..", "..", "..", "Evidence", "Runtime-" + DateTime.Now.ToString("yyyyMMdd-HHmmss")));
			Directory.CreateDirectory(evidence);
			object obj = <>c.<>9__8_0;
			if (obj == null)
			{
				hook_Update val = delegate(orig_Update orig, PlayerCharacterMasterController pc)
				{
					Snapshot(pc);
					orig.Invoke(pc);
					Apply(pc, fixedInput: false);
				};
				<>c.<>9__8_0 = val;
				obj = (object)val;
			}
			PlayerCharacterMasterController.Update += (hook_Update)obj;
			object obj2 = <>c.<>9__8_1;
			if (obj2 == null)
			{
				hook_FixedUpdate val2 = delegate(orig_FixedUpdate orig, PlayerCharacterMasterController pc)
				{
					Snapshot(pc);
					orig.Invoke(pc);
					Apply(pc, fixedInput: true);
				};
				<>c.<>9__8_1 = val2;
				obj2 = (object)val2;
			}
			PlayerCharacterMasterController.FixedUpdate += (hook_FixedUpdate)obj2;
			RoR2Application.onLoad = (Action)Delegate.Combine(RoR2Application.onLoad, (Action)delegate
			{
				((MonoBehaviour)Plugin.Instance).StartCoroutine(Run());
			});
		}

		private static void Apply(PlayerCharacterMasterController pc, bool fixedInput)
		{
			CharacterBody val = (Object.op_Implicit((Object)(object)pc.master) ? pc.master.GetBody() : null);
			if (Object.op_Implicit((Object)(object)val))
			{
				((Component)val).GetComponent<TestInput>()?.Apply(fixedInput);
			}
		}

		private static void Snapshot(PlayerCharacterMasterController pc)
		{
			CharacterBody val = (Object.op_Implicit((Object)(object)pc.master) ? pc.master.GetBody() : null);
			if (Object.op_Implicit((Object)(object)val))
			{
				((Component)val).GetComponent<TestInput>()?.Snapshot();
			}
		}

		private static void Log(string line)
		{
			results.Add(line);
			File.WriteAllLines(Path.Combine(evidence, "results.txt"), results);
			Plugin.Instance.Log.LogInfo((object)("ASUMA_TEST " + line));
		}

		private static void Place(CharacterBody body, Vector3 foot)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: Unknown result type (might be due to invalid IL or missing references)
			//IL_006b: Unknown result type (might be due to invalid IL or missing references)
			Vector3 val = foot + body.transform.position - body.footPosition;
			if (Object.op_Implicit((Object)(object)body.characterMotor))
			{
				((BaseCharacterController)body.characterMotor).Motor.SetPosition(val, true);
				body.characterMotor.velocity = Vector3.zero;
			}
			else
			{
				body.transform.position = val;
			}
			TestPin component = ((Component)body).GetComponent<TestPin>();
			if (Object.op_Implicit((Object)(object)component))
			{
				component.point = val;
			}
		}

		private unsafe static IEnumerator Run()
		{
			foreach (LocalUser readOnlyLocalUsers in LocalUserManager.readOnlyLocalUsersList)
			{
				readOnlyLocalUsers.userProfile.canSave = false;
			}
			yield return (object)new WaitForSeconds(12f);
			if (!LocalUserManager.isAnyUserSignedIn)
			{
				typeof(UserProfile).GetMethod("LoadDefaultProfile", BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic).Invoke(null, null);
				UserProfile val = (UserProfile)typeof(UserProfile).GetField("defaultProfile", BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic).GetValue(null);
				UserProfile val2 = (UserProfile)Activator.CreateInstance(typeof(UserProfile), BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic, null, new object[1] { val }, null);
				val2.canSave = false;
				val2.name = "Asuma isolated QA";
				LocalUserManager.AddMainUser(val2);
			}
			foreach (LocalUser readOnlyLocalUsers2 in LocalUserManager.readOnlyLocalUsersList)
			{
				readOnlyLocalUsers2.userProfile.canSave = false;
			}
			Log("BUILD 0.5.1 dll=" + ((BaseUnityPlugin)Plugin.Instance).Info.Location);
			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 did not start");
				yield break;
			}
			NetworkUser[] array = Object.FindObjectsOfType<NetworkUser>();
			foreach (NetworkUser val3 in array)
			{
				if (((NetworkBehaviour)val3).isLocalPlayer)
				{
					val3.SetBodyPreference(BodyCatalog.FindBodyIndex("HenryAsumaBody"));
				}
			}
			if (File.ReadAllText(Path.Combine(Media.Assets, "RUN_ASUMA_QA")).Trim() != "revision-visual" && File.ReadAllText(Path.Combine(Media.Assets, "RUN_ASUMA_QA")).Trim().StartsWith("revision"))
			{
				foreach (LocalUser readOnlyLocalUsers3 in LocalUserManager.readOnlyLocalUsersList)
				{
					Loadout val4 = new Loadout();
					readOnlyLocalUsers3.userProfile.CopyLoadout(val4);
					val4.bodyLoadoutManager.SetSkinIndex(BodyCatalog.FindBodyIndex("HenryAsumaBody"), (!File.ReadAllText(Path.Combine(Media.Assets, "RUN_ASUMA_QA")).Trim().StartsWith("revision-rc01-") && !(File.ReadAllText(Path.Combine(Media.Assets, "RUN_ASUMA_QA")).Trim() == "revision-rc02-rear")) ? 1u : 0u);
					readOnlyLocalUsers3.userProfile.SetLoadout(val4);
				}
				array = Object.FindObjectsOfType<NetworkUser>();
				foreach (NetworkUser val5 in array)
				{
					if (((NetworkBehaviour)val5).isLocalPlayer)
					{
						val5.PullLoadoutFromUserProfile();
					}
				}
			}
			yield return (object)new WaitForSeconds(2f);
			ScreenCapture.CaptureScreenshot(Path.Combine(evidence, "Selection.png"));
			yield return (object)new WaitForSeconds(0.6f);
			ScreenCapture.CaptureScreenshot(Path.Combine(evidence, "Selection-motion.png"));
			if (File.ReadAllText(Path.Combine(Media.Assets, "RUN_ASUMA_QA")).Trim().StartsWith("revision-rc01"))
			{
				((BaseConVar)Run.cvRunSceneOverride).SetString("golemplains");
			}
			if (File.ReadAllText(Path.Combine(Media.Assets, "RUN_ASUMA_QA")).Trim().StartsWith("revision-rc01-") || File.ReadAllText(Path.Combine(Media.Assets, "RUN_ASUMA_QA")).Trim().StartsWith("revision-rc02"))
			{
				string[] array2 = new string[2] { "Skills", "Loadout" };
				foreach (string label in array2)
				{
					Button[] array3 = Object.FindObjectsOfType<Button>();
					foreach (Button val6 in array3)
					{
						if (((Component)val6).GetComponentsInChildren<Component>(true).Any((Component c) => Object.op_Implicit((Object)(object)c) && ((object)c).GetType().GetProperty("text")?.PropertyType == typeof(string) && (string)((object)c).GetType().GetProperty("text").GetValue(c, null) == label))
						{
							((UnityEvent)val6.onClick).Invoke();
							break;
						}
					}
					yield return (object)new WaitForSeconds(0.4f);
					ScreenCapture.CaptureScreenshot(Path.Combine(evidence, "Selection-" + label + "-" + ((File.ReadAllText(Path.Combine(Media.Assets, "RUN_ASUMA_QA")).Trim() == "revision-rc02") ? "EN" : "JP") + ".png"));
					yield return (object)new WaitForEndOfFrame();
					yield return (object)new WaitForSeconds(0.2f);
				}
			}
			if (File.ReadAllText(Path.Combine(Media.Assets, "RUN_ASUMA_QA")).Trim() == "revision-rc01-ui")
			{
				Log("UI_ONLY_COMPLETE");
				Application.Quit();
				yield break;
			}
			PreGameController.instance.StartRun();
			for (int i = 0; i < 60; i++)
			{
				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 val7 = ((IEnumerable<NetworkUser>)Object.FindObjectsOfType<NetworkUser>()).FirstOrDefault((Func<NetworkUser, bool>)((NetworkUser u) => ((NetworkBehaviour)u).isLocalPlayer));
			actor = ((Object.op_Implicit((Object)(object)val7) && Object.op_Implicit((Object)(object)val7.master)) ? val7.master.GetBody() : null);
			if (!Object.op_Implicit((Object)(object)actor))
			{
				Log("FAIL no Asuma player");
				yield break;
			}
			VehicleSeat val8 = ((IEnumerable<VehicleSeat>)Object.FindObjectsOfType<VehicleSeat>()).FirstOrDefault((Func<VehicleSeat, bool>)((VehicleSeat s) => (Object)(object)s.currentPassengerBody == (Object)(object)actor));
			if (Object.op_Implicit((Object)(object)val8))
			{
				val8.EjectPassenger();
				yield return (object)new WaitForSeconds(2f);
			}
			CombatDirector[] array4 = Object.FindObjectsOfType<CombatDirector>();
			for (int j = 0; j < array4.Length; j++)
			{
				((Behaviour)array4[j]).enabled = false;
			}
			CharacterBody[] array5 = CharacterBody.readOnlyInstancesList.ToArray();
			foreach (CharacterBody val9 in array5)
			{
				if ((Object)(object)val9 != (Object)(object)actor && (int)val9.teamComponent.teamIndex != 1)
				{
					NetworkServer.Destroy(((Component)val9).gameObject);
				}
			}
			MapZone[] array6 = Object.FindObjectsOfType<MapZone>();
			for (int j = 0; j < array6.Length; j++)
			{
				Collider[] components = ((Component)array6[j]).GetComponents<Collider>();
				for (int num = 0; num < components.Length; num++)
				{
					components[num].enabled = false;
				}
			}
			GameObject val10 = Fixture("Asuma isolated QA platform", actor.footPosition + Vector3.up * 300f, new Vector3(130f, 1f, 130f));
			Place(actor, val10.transform.position + Vector3.up * 0.6f);
			yield return (object)new WaitForSeconds(0.6f);
			home = actor.footPosition;
			actor.baseCrit = 0f;
			actor.baseMaxHealth = 100000f;
			actor.baseRegen = 0f;
			actor.RecalculateStats();
			actor.healthComponent.health = actor.maxHealth;
			input = ((Component)actor).gameObject.AddComponent<TestInput>();
			input.body = actor;
			weapon = ((Component)actor).GetComponents<EntityStateMachine>().First((EntityStateMachine m) => m.customName == "Weapon");
			Log("IDENTITY " + ((Object)actor).name + " bodyIndex=" + ((object)Unsafe.As<BodyIndex, BodyIndex>(ref actor.bodyIndex)/*cast due to .constrained prefix*/).ToString() + " health=" + actor.maxHealth + " damage=" + actor.damage + " jumps=" + actor.maxJumpCount);
			captureStart = Time.realtimeSinceStartup;
			Log("AUDIO_CAPTURE " + ((object)AkSoundEngine.StartOutputCapture(Path.Combine(evidence, "GameAudio.wav"))/*cast due to .constrained prefix*/).ToString() + " startRealtime=" + captureStart);
			File.WriteAllText(Path.Combine(evidence, "frames.csv"), "file,elapsedSeconds\n");
			if (File.ReadAllText(Path.Combine(Media.Assets, "RUN_ASUMA_QA")).Trim().StartsWith("revision"))
			{
				Combat.Trace = Log;
				((MonoBehaviour)Plugin.Instance).StartCoroutine(RevisionDeadline());
				string mode = File.ReadAllText(Path.Combine(Media.Assets, "RUN_ASUMA_QA")).Trim();
				switch (mode)
				{
				case "revision-rc02-rear":
					yield return ReleaseCandidateTwoRear();
					break;
				case "revision-rc02":
					yield return ReleaseCandidateTwo();
					break;
				case "revision-rc01-wall":
				case "revision-rc01-overhang":
					ScreenCapture.CaptureScreenshot(Path.Combine(evidence, "HUD-Normal-JP.png"));
					yield return RealWallCheck();
					break;
				case "revision-rc01":
					yield return ReleaseCandidate();
					break;
				case "revision02-alternation":
					yield return RevisionTwoAlternation();
					break;
				case "revision02-balance":
					yield return RevisionTwoBalance();
					break;
				case "revision02":
					yield return RevisionTwo();
					break;
				case "revision-retry":
					yield return RevisionRetry();
					break;
				case "revision-closure":
					AshVolume.DiagnosticLegacyMouthGate = true;
					yield return AshBaselineLayout();
					yield return (object)new WaitForSeconds(0.8f);
					AshVolume.DiagnosticLegacyMouthGate = false;
					yield return AshBaselineLayout();
					break;
				default:
					yield return RevisionVisual();
					break;
				}
				if (!mode.StartsWith("revision-rc02") && !mode.StartsWith("revision-rc01") && mode != "revision-visual" && mode != "revision-retry" && mode != "revision02" && mode != "revision02-balance" && mode != "revision02-alternation")
				{
					yield return RevisionAcceptance();
				}
				Combat.Trace = null;
				Log("REVISION_VISUAL_COMPLETE");
				AkSoundEngine.StopOutputCapture();
				Application.Quit();
				yield break;
			}
			if (File.ReadAllText(Path.Combine(Media.Assets, "RUN_ASUMA_QA")).Trim() == "closure")
			{
				yield return Record("01-Source-guard", 0.4f, 7f);
				yield return BossCheck();
				yield return WallClosure();
				Reset();
				Awakening closingForm = ((Component)actor).GetComponent<Awakening>();
				closingForm.Begin();
				float deadline = closingForm.EndAt;
				while (closingForm.Remaining > 0.6f)
				{
					yield return (object)new WaitForSeconds(0.1f);
				}
				yield return Record("02-Expiry-boundary", 0.8f, 9f);
				float num2 = Awakening.Now - deadline;
				Check("natural-expiry-measured", !closingForm.IsActive && (Object)(object)actor.skillLocator.secondary.skillDef == (Object)(object)SkillSetup.Secondary && actor.skillLocator.special.stock == 0 && Mathf.Abs(actor.skillLocator.special.rechargeStopwatch - num2) < 0.12f, "elapsedAfterExpiry=" + num2 + " recharge=" + actor.skillLocator.special.rechargeStopwatch);
				Log("CLOSURE_COMPLETE");
				AkSoundEngine.StopOutputCapture();
				Application.Quit();
				yield break;
			}
			yield return Record("01-Source-idle", 0.4f, 7f);
			CharacterBody target = Spawn("BeetleMaster", home + Vector3.forward * 2f, 100000f);
			yield return (object)new WaitForSeconds(0.3f);
			float before = target.healthComponent.health;
			input.primary = true;
			yield return Record("02-Ground-combo", 1.85f, 6f);
			input.primary = false;
			yield return (object)new WaitForSeconds(0.6f);
			Log("PRIMARY damage=" + (before - target.healthComponent.health));
			Reset();
			Place(actor, home + Vector3.up * 2f);
			input.primary = true;
			yield return Record("03-Air-to-ground-combo", 1.8f, 7f);
			input.primary = false;
			yield return (object)new WaitForSeconds(0.5f);
			Reset();
			Place(target, home + Vector3.forward * 7f);
			before = target.healthComponent.health;
			input.secondary = true;
			yield return (object)new WaitForSeconds(0.08f);
			input.secondary = false;
			yield return Record("04-Straight-Line", 1.1f, 14f);
			Log("STRAIGHT damage=" + (before - target.healthComponent.health));
			Reset();
			TestInput testInput = input;
			Vector3 val11 = new Vector3(0f, 0.45f, 1f);
			testInput.aim = ((Vector3)(ref val11)).normalized;
			input.utility = true;
			yield return (object)new WaitForSeconds(0.08f);
			input.utility = false;
			yield return Record("05-Upward-Burning-Ash", 2f, 52f);
			Log("ASH utilityStock=" + actor.skillLocator.utility.stock + " state=" + ((object)weapon.state).GetType().Name);
			Reset();
			input.special = true;
			yield return (object)new WaitForSeconds(0.08f);
			input.special = false;
			yield return Record("06-Awakening", 1.1f, 9f);
			Log("AWAKE active=" + Awakening.Active(actor) + " secondaryStock=" + actor.skillLocator.secondary.stock + " secondaryMax=" + actor.skillLocator.secondary.maxStock);
			int stock = actor.skillLocator.secondary.stock;
			input.secondary = true;
			yield return Record("07-Held-wave-single-shot", 1.4f, 15f);
			input.secondary = false;
			Log("WAVE_HOLD before=" + stock + " after=" + actor.skillLocator.secondary.stock);
			for (int i = 0; i < 5; i++)
			{
				yield return (object)new WaitForSeconds(0.1f);
				input.secondary = true;
				yield return (object)new WaitForSeconds(0.08f);
				input.secondary = false;
				yield return Record("08-Wave-click-" + i, 0.72f, 15f);
			}
			Log("WAVES finalStock=" + actor.skillLocator.secondary.stock);
			input.primary = true;
			yield return Record("08b-Awakened-primary", 2.3f, 7f);
			input.primary = false;
			yield return (object)new WaitForSeconds(0.6f);
			Reset();
			GameObject wall = Fixture("Asuma wall ascent QA", home + new Vector3(0f, 10f, 3f), new Vector3(12f, 20f, 0.5f));
			input.move = Vector3.forward;
			input.jump = true;
			yield return Record("09-Wall-ascent", 0.8f, 12f);
			Log("WALL ascent=" + (actor.footPosition.y - home.y) + " running=" + ((Component)actor).GetComponent<WallRun>().Running + " jumps=" + actor.characterMotor.jumpCount);
			input.move = Vector3.back;
			yield return (object)new WaitForSeconds(0.1f);
			input.jump = false;
			input.primary = true;
			yield return Record("10-Push-off-air-combo", 0.5f, 12f);
			input.primary = false;
			input.move = Vector3.zero;
			val11 = actor.footPosition - home;
			Log("PUSH_OFF position=" + ((object)(*(Vector3*)(&val11))/*cast due to .constrained prefix*/).ToString() + " jumps=" + actor.characterMotor.jumpCount);
			Object.Destroy((Object)(object)wall);
			Reset();
			((Component)actor).GetComponent<Awakening>().End("qa-reversion");
			yield return (object)new WaitForSeconds(0.2f);
			Log("REVERSION primary=" + actor.skillLocator.primary.skillDef.skillName + " secondary=" + actor.skillLocator.secondary.skillDef.skillName + " stock=" + actor.skillLocator.secondary.stock + " specialStock=" + actor.skillLocator.special.stock);
			yield return GeometryChecks(target);
			yield return LifecycleChecks();
			Log("VISUAL_CHECKPOINT_COMPLETE — captures and gameplay logs require review; not a remote multiplayer or auditory verdict.");
			AkSoundEngine.StopOutputCapture();
			Object.Destroy((Object)(object)input);
			Application.Quit();
		}

		private static void Reset()
		{
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			input.Clear();
			input.aim = Vector3.forward;
			Place(actor, home);
			weapon.SetNextStateToMain();
			actor.SetAimTimer(1f);
		}

		private static void Check(string name, bool pass, string detail)
		{
			Log((pass ? "PASS " : "FAIL ") + name + " " + detail);
		}

		private static IEnumerator GeometryChecks(CharacterBody target)
		{
			Reset();
			target.teamComponent.teamIndex = (TeamIndex)2;
			Vector3[] positions = (Vector3[])(object)new Vector3[5]
			{
				new Vector3(0f, 0f, 6f),
				new Vector3(5f, 0f, 4f),
				new Vector3(6f, 0f, -3f),
				new Vector3(0f, 0f, 13f),
				new Vector3(0f, 5f, 5f)
			};
			string[] names = new string[5] { "straight-front", "straight-wide-arc", "straight-outside-angle", "straight-outside-range", "straight-outside-height" };
			for (int i = 0; i < positions.Length; i++)
			{
				Place(target, home + positions[i]);
				yield return (object)new WaitForSeconds(0.1f);
				float health = target.healthComponent.health;
				int num = Combat.Cone(actor, actor.corePosition, Vector3.forward, 9f, 150f, 7f, 1f, 0f, new HashSet<HealthComponent>(), 1.55f);
				float num2 = health - target.healthComponent.health;
				Check(names[i], (i < 2) ? (Mathf.Abs(num2 - 84f) < 0.1f) : (num2 == 0f), "hits=" + num + " damage=" + num2);
			}
			Place(target, home + Vector3.forward * 6f);
			target.teamComponent.teamIndex = (TeamIndex)1;
			yield return (object)new WaitForSeconds(0.1f);
			float before = target.healthComponent.health;
			Combat.Cone(actor, actor.corePosition, Vector3.forward, 9f, 150f, 7f, 1f, 0f, new HashSet<HealthComponent>(), 1.55f);
			Check("straight-ally", target.healthComponent.health == before, "damage=" + (before - target.healthComponent.health));
			target.teamComponent.teamIndex = (TeamIndex)2;
			GameObject blocker = Fixture("Asuma terrain occlusion QA", home + new Vector3(0f, 3f, 3f), new Vector3(15f, 8f, 1f));
			yield return (object)new WaitForSeconds(0.1f);
			before = target.healthComponent.health;
			Combat.Cone(actor, actor.corePosition, Vector3.forward, 9f, 150f, 7f, 1f, 0f, new HashSet<HealthComponent>(), 1.55f);
			Check("straight-terrain", target.healthComponent.health == before, "damage=" + (before - target.healthComponent.health));
			Object.Destroy((Object)(object)blocker);
			yield return (object)new WaitForSeconds(0.1f);
			yield return BossCheck();
			Place(target, home + Vector3.forward * 6f);
			CharacterBody behind = Spawn("BeetleMaster", home + Vector3.forward * 14f, 100000f);
			yield return (object)new WaitForSeconds(0.4f);
			blocker = Fixture("Asuma wave occlusion QA", home + new Vector3(0f, 3f, 10f), new Vector3(18f, 8f, 1f));
			before = target.healthComponent.health;
			float behindBefore = behind.healthComponent.health;
			WindWave.Spawn(actor, actor.corePosition + Vector3.forward * 0.7f, Vector3.forward);
			yield return (object)new WaitForSeconds(0.5f);
			Check("wave-single-hit", Mathf.Abs(before - target.healthComponent.health - 72f) < 0.1f, "damage=" + (before - target.healthComponent.health));
			Check("wave-terrain", behind.healthComponent.health == behindBefore, "behindDamage=" + (behindBefore - behind.healthComponent.health));
			Object.Destroy((Object)(object)blocker);
			yield return (object)new WaitForSeconds(0.1f);
			before = target.healthComponent.health;
			behindBefore = behind.healthComponent.health;
			WindWave.Spawn(actor, actor.corePosition + Vector3.forward * 0.7f, Vector3.forward);
			yield return (object)new WaitForSeconds(0.5f);
			Check("wave-pierce-two", Mathf.Abs(before - target.healthComponent.health - 72f) < 0.1f && Mathf.Abs(behindBefore - behind.healthComponent.health - 72f) < 0.1f, "front=" + (before - target.healthComponent.health) + " back=" + (behindBefore - behind.healthComponent.health));
			Vector3 mouth = actor.corePosition + Vector3.up * 0.55f;
			Vector3 val = mouth + Vector3.forward * 9.75f;
			Place(target, val + Vector3.up * 10f);
			Place(behind, val + Vector3.up * 21f);
			yield return (object)new WaitForSeconds(0.1f);
			before = target.healthComponent.health;
			behindBefore = behind.healthComponent.health;
			AshVolume.Spawn(actor, mouth, Vector3.forward, 0.8f);
			yield return (object)new WaitForSeconds(0.86f);
			Check("ash-three-dimensional", before - target.healthComponent.health >= 191.9f, "aboveDamage=" + (before - target.healthComponent.health));
			Check("ash-outside-radius", behind.healthComponent.health == behindBefore, "outsideDamage=" + (behindBefore - behind.healthComponent.health));
			yield return (object)new WaitForSeconds(3.2f);
			Place(target, home + Vector3.forward * 6f);
			Place(behind, home + Vector3.right * 3f);
			behind.teamComponent.teamIndex = (TeamIndex)1;
			blocker = Fixture("Asuma ash occlusion QA", home + new Vector3(0f, 3f, 3f), new Vector3(18f, 8f, 1f));
			yield return (object)new WaitForSeconds(0.1f);
			before = target.healthComponent.health;
			behindBefore = behind.healthComponent.health;
			AshVolume.Spawn(actor, mouth, Vector3.forward, 0.8f);
			yield return (object)new WaitForSeconds(0.86f);
			Check("ash-terrain", target.healthComponent.health == before, "damage=" + (before - target.healthComponent.health));
			Check("ash-ally", behind.healthComponent.health == behindBefore, "damage=" + (behindBefore - behind.healthComponent.health));
			Object.Destroy((Object)(object)blocker);
			NetworkServer.Destroy(((Component)behind).gameObject);
			NetworkServer.Destroy(((Component)target).gameObject);
			GameObject eggObject = Object.Instantiate<GameObject>(BodyCatalog.FindBodyPrefab("VultureEggBody"), home + Vector3.forward * 2f, Quaternion.identity);
			NetworkServer.Spawn(eggObject);
			yield return (object)new WaitForSeconds(0.3f);
			CharacterBody component = eggObject.GetComponent<CharacterBody>();
			component.baseMaxHealth = 100000f;
			component.baseArmor = 0f;
			component.baseRegen = 0f;
			component.RecalculateStats();
			component.healthComponent.health = 100000f;
			before = component.healthComponent.health;
			Combat.Cone(actor, actor.corePosition, Vector3.forward, 9f, 150f, 7f, 1f, 0f, new HashSet<HealthComponent>(), 1.55f);
			Check("neutral-vulture-egg", Mathf.Abs(before - component.healthComponent.health - 84f) < 0.1f, "team=" + ((object)component.teamComponent.teamIndex/*cast due to .constrained prefix*/).ToString() + " damage=" + (before - component.healthComponent.health));
			NetworkServer.Destroy(eggObject);
		}

		private static IEnumerator LifecycleChecks()
		{
			Reset();
			Awakening form = ((Component)actor).GetComponent<Awakening>();
			actor.skillLocator.special.stock = 1;
			input.special = true;
			yield return (object)new WaitForSeconds(0.08f);
			input.special = false;
			yield return Record("11-Clean-Awakening", 1.3f, 9f);
			Check("clean-awakening", form.IsActive, "active=" + form.IsActive);
			float deadline = form.EndAt;
			actor.skillLocator.secondary.stock = 0;
			actor.skillLocator.secondary.rechargeStopwatch = 0f;
			yield return (object)new WaitForSeconds(2.65f);
			Check("sequential-one-stock", actor.skillLocator.secondary.stock == 1, "stock=" + actor.skillLocator.secondary.stock);
			Check("special-locked-active", actor.skillLocator.special.stock == 0 && !SkillSetup.Special.CanExecute(actor.skillLocator.special), "stock=" + actor.skillLocator.special.stock + " recharge=" + actor.skillLocator.special.rechargeStopwatch);
			while (form.Remaining > 0.6f)
			{
				yield return (object)new WaitForSeconds(0.1f);
			}
			yield return Record("12-Natural-reversion", 0.8f, 9f);
			Check("natural-expiry", (Object)(object)actor.skillLocator.secondary.skillDef == (Object)(object)SkillSetup.Secondary && actor.skillLocator.special.stock == 0 && Mathf.Abs(actor.skillLocator.special.rechargeStopwatch - (Awakening.Now - deadline)) < 0.12f, "specialRecharge=" + actor.skillLocator.special.rechargeStopwatch + " elapsedAfterExpiry=" + (Awakening.Now - deadline));
			yield return (object)new WaitForSeconds(1f);
			Check("cooldown-after-expiry", actor.skillLocator.special.rechargeStopwatch > 0.8f && actor.skillLocator.special.rechargeStopwatch < 1.5f, "recharge=" + actor.skillLocator.special.rechargeStopwatch);
			form.Begin();
			yield return (object)new WaitForSeconds(0.1f);
			CharacterMaster master = actor.master;
			actor.healthComponent.Suicide((GameObject)null, (GameObject)null, default(DamageTypeCombo));
			yield return (object)new WaitForSeconds(0.3f);
			Check("death-cleanup", !form.IsActive && (Object)(object)actor.skillLocator.secondary.skillDef == (Object)(object)SkillSetup.Secondary, "active=" + form.IsActive);
			CharacterBody revived = master.Respawn(home + Vector3.up * 2f, Quaternion.identity, false);
			yield return (object)new WaitForSeconds(0.4f);
			Check("respawn-base-kit", Object.op_Implicit((Object)(object)revived) && !Awakening.Active(revived) && (Object)(object)revived.skillLocator.secondary.skillDef == (Object)(object)SkillSetup.Secondary && revived.skillLocator.special.stock == 0, "body=" + (Object.op_Implicit((Object)(object)revived) ? ((Object)revived).name : "null"));
		}

		private unsafe static IEnumerator BossCheck()
		{
			CharacterBody boss = Spawn("VagrantMaster", home + Vector3.forward * 6f, 100000f);
			yield return (object)new WaitForSeconds(2f);
			Vector3 val = boss.corePosition - actor.corePosition;
			string? text = ((object)(*(Vector3*)(&val))/*cast due to .constrained prefix*/).ToString();
			val = ((Component)boss.mainHurtBox).transform.position - actor.corePosition;
			Log("BOSS originalCoreDelta=" + text + " mainHurtDelta=" + ((object)(*(Vector3*)(&val))/*cast due to .constrained prefix*/).ToString());
			Place(boss, boss.footPosition + actor.corePosition + Vector3.forward * 6f - ((Component)boss.mainHurtBox).transform.position);
			yield return (object)new WaitForSeconds(0.15f);
			float health = boss.healthComponent.health;
			val = ((Component)boss.mainHurtBox).transform.position - actor.corePosition;
			Vector3 normalized = ((Vector3)(ref val)).normalized;
			int num = Physics.OverlapSphere(actor.corePosition, 9f, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.entityPrecise)).mask), (QueryTriggerInteraction)2).Count((Collider c) => Object.op_Implicit((Objec