Decompiled source of Green Lantern Hal Jordan v0.16.2

plugins/HalJordanRoR2/HalJordanRoR2.dll

Decompiled a day 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.Versioning;
using System.Text;
using System.Threading;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using BepInEx.Logging;
using EntityStates;
using EntityStates.SurvivorPod;
using HG.GeneralSerializer;
using KinematicCharacterController;
using MonoMod.RuntimeDetour;
using R2API;
using RiskOfOptions;
using RiskOfOptions.OptionConfigs;
using RiskOfOptions.Options;
using RoR2;
using RoR2.CharacterAI;
using RoR2.ConVar;
using RoR2.Skills;
using RoR2.SurvivorMannequins;
using RoR2.UI;
using TMPro;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.EventSystems;
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("HalJordanRoR2")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+d4db0c5eda7891d51211577b9841ce50c186a6d3")]
[assembly: AssemblyProduct("HalJordanRoR2")]
[assembly: AssemblyTitle("HalJordanRoR2")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace HalJordanRoR2;

internal sealed class CarCrashCast : BaseSkillState
{
	private const float FormTime = 0.3f;

	private const float MaxDrive = 2.2f;

	private const float TopSpeed = 30f;

	private const float Acceleration = 42f;

	private const float TurnRate = 1.6f;

	private const float BailDistance = 11f;

	private const float AfterBail = 1.05f;

	private const float Range = 75f;

	private const float SeatForward = 0.2f;

	private const float SeatSide = 0.4f;

	private CarConstruct car;

	private Vector3 direction;

	private HurtBox target;

	private float speed;

	private bool bailed;

	private bool rolled;

	private float bailAge;

	private Vector3 lastPosition;

	public override void OnEnter()
	{
		//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_0010: Unknown result type (might be due to invalid IL or missing references)
		//IL_001b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0020: Unknown result type (might be due to invalid IL or missing references)
		//IL_0025: Unknown result type (might be due to invalid IL or missing references)
		//IL_002c: Unknown result type (might be due to invalid IL or missing references)
		//IL_007d: 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_00c0: 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_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_0067: Unknown result type (might be due to invalid IL or missing references)
		//IL_006c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0071: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f5: 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_0124: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a3: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ae: Unknown result type (might be due to invalid IL or missing references)
		((BaseState)this).OnEnter();
		Ray aimRay = ((BaseState)this).GetAimRay();
		direction = CorpsDamage.Flat(((Ray)(ref aimRay)).direction, ((EntityState)this).characterDirection.forward);
		target = FindTarget(aimRay);
		if ((Object)(object)target != (Object)null)
		{
			direction = CorpsDamage.Flat(((Component)target).transform.position - ((EntityState)this).characterBody.footPosition, direction);
		}
		((EntityState)this).characterDirection.forward = direction;
		((EntityState)this).PlayAnimation("Gesture, Override", "BufferEmpty");
		((EntityState)this).PlayCrossfade("FullBody, Override", "CarSeat", 0.1f);
		car = CarConstruct.Spawn(((EntityState)this).characterBody, ((EntityState)this).isAuthority, SeatOrigin(), direction);
		if (((EntityState)this).isAuthority && ((EntityState)this).characterBody.isPlayerControlled)
		{
			HalVoice.Signature("KyleChandler:Voice_Car");
		}
		lastPosition = ((EntityState)this).characterBody.footPosition;
		Util.PlaySound("Play_loader_shift_activate", ((EntityState)this).gameObject);
		if (((EntityState)this).isAuthority)
		{
			((EntityState)this).characterBody.AddTimedBuffAuthority(Buffs.HiddenInvincibility.buffIndex, 3f);
			if (((EntityState)this).characterBody.isPlayerControlled)
			{
				HalVoice.Attack(0.8f);
			}
			HalAutoTest.Trace("crash course: target=" + (((Object)(object)target != (Object)null) ? target.healthComponent.body.GetDisplayName() : "none") + " " + $"distance={(((Object)(object)target != (Object)null) ? Vector3.Distance(((Component)target).transform.position, ((EntityState)this).characterBody.footPosition) : 0f):0.0} m");
		}
	}

	private Vector3 SeatOrigin()
	{
		//IL_0000: Unknown result type (might be due to invalid IL or missing references)
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		//IL_000b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0010: Unknown result type (might be due to invalid IL or missing references)
		//IL_0017: Unknown result type (might be due to invalid IL or missing references)
		//IL_001c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0022: Unknown result type (might be due to invalid IL or missing references)
		//IL_0027: Unknown result type (might be due to invalid IL or missing references)
		//IL_002d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0037: Unknown result type (might be due to invalid IL or missing references)
		//IL_003c: Unknown result type (might be due to invalid IL or missing references)
		//IL_004b: Unknown result type (might be due to invalid IL or missing references)
		Vector3 val = Vector3.Cross(Vector3.up, direction);
		return CorpsDamage.Ground(((EntityState)this).characterBody.footPosition + val * 0.4f + direction * 0.2f, 1.5f, 4f);
	}

	private HurtBox FindTarget(Ray aim)
	{
		//IL_0000: Unknown result type (might be due to invalid IL or missing references)
		//IL_0005: Unknown result type (might be due to invalid IL or missing references)
		//IL_000c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0011: Unknown result type (might be due to invalid IL or missing references)
		//IL_0016: Unknown result type (might be due to invalid IL or missing references)
		//IL_001b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0022: Unknown result type (might be due to invalid IL or missing references)
		//IL_0025: Unknown result type (might be due to invalid IL or missing references)
		//IL_002a: Unknown result type (might be due to invalid IL or missing references)
		//IL_002f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0032: Unknown result type (might be due to invalid IL or missing references)
		//IL_0037: Unknown result type (might be due to invalid IL or missing references)
		//IL_003c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0047: Unknown result type (might be due to invalid IL or missing references)
		//IL_0052: Unknown result type (might be due to invalid IL or missing references)
		//IL_0054: Unknown result type (might be due to invalid IL or missing references)
		//IL_0059: 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_0066: Unknown result type (might be due to invalid IL or missing references)
		BullseyeSearch val = new BullseyeSearch
		{
			teamMaskFilter = TeamMask.GetEnemyTeams(((EntityState)this).teamComponent.teamIndex),
			filterByLoS = false,
			searchOrigin = ((Ray)(ref aim)).origin,
			searchDirection = ((Ray)(ref aim)).direction,
			maxDistanceFilter = 75f,
			maxAngleFilter = 35f,
			sortMode = (SortMode)2,
			filterByDistinctEntity = true
		};
		val.RefreshCandidates();
		val.FilterOutGameObject(((EntityState)this).gameObject);
		return val.GetResults().FirstOrDefault((Func<HurtBox, bool>)((HurtBox h) => (Object)(object)h != (Object)null && (Object)(object)h.healthComponent != (Object)null && h.healthComponent.alive));
	}

	public override void Update()
	{
		//IL_0023: Unknown result type (might be due to invalid IL or missing references)
		//IL_0029: Unknown result type (might be due to invalid IL or missing references)
		((EntityState)this).Update();
		if (!bailed && (Object)(object)car != (Object)null)
		{
			car.Follow(SeatOrigin(), direction);
		}
	}

	public override void FixedUpdate()
	{
		((EntityState)this).FixedUpdate();
		if (!((EntityState)this).isAuthority)
		{
			return;
		}
		float deltaTime = ((EntityState)this).GetDeltaTime();
		if (!bailed)
		{
			Drive(deltaTime);
			return;
		}
		bailAge += deltaTime;
		if (!rolled && ((bailAge > 0.32f && ((EntityState)this).characterMotor.isGrounded) || bailAge > 0.6f))
		{
			rolled = true;
			((EntityState)this).PlayCrossfade("FullBody, Override", "Dodge_Roll_L", "Dodge.playbackRate", 0.62f, 0.05f);
		}
		if (bailAge >= 1.05f)
		{
			((EntityState)this).outer.SetNextStateToMain();
		}
	}

	private void Drive(float dt)
	{
		//IL_002d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0032: Unknown result type (might be due to invalid IL or missing references)
		//IL_00de: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f1: 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_00fb: 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_0125: Unknown result type (might be due to invalid IL or missing references)
		//IL_0131: Unknown result type (might be due to invalid IL or missing references)
		//IL_0141: Unknown result type (might be due to invalid IL or missing references)
		//IL_0147: Unknown result type (might be due to invalid IL or missing references)
		//IL_014c: 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)
		//IL_015b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0178: Unknown result type (might be due to invalid IL or missing references)
		//IL_017d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0098: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b8: 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_00cd: 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_018f: Unknown result type (might be due to invalid IL or missing references)
		//IL_019a: Unknown result type (might be due to invalid IL or missing references)
		if (((EntityState)this).fixedAge < 0.3f)
		{
			((EntityState)this).characterMotor.velocity = new Vector3(0f, ((EntityState)this).characterMotor.velocity.y, 0f);
			return;
		}
		speed = Mathf.Min(30f, speed + 42f * dt);
		int num;
		if ((Object)(object)target != (Object)null && (Object)(object)target.healthComponent != (Object)null)
		{
			num = (target.healthComponent.alive ? 1 : 0);
			if (num != 0)
			{
				Vector3 val = CorpsDamage.Flat(((Component)target).transform.position - ((EntityState)this).characterBody.footPosition, direction);
				direction = Vector3.RotateTowards(direction, val, 1.6f * dt, 0f);
			}
		}
		else
		{
			num = 0;
		}
		CharacterMotor characterMotor = ((EntityState)this).characterMotor;
		characterMotor.rootMotion += direction * (speed * dt);
		((EntityState)this).characterMotor.velocity = new Vector3(0f, ((EntityState)this).characterMotor.velocity.y, 0f);
		((EntityState)this).characterDirection.forward = direction;
		Vector3 val2 = Vector3.ProjectOnPlane(((EntityState)this).characterBody.footPosition - lastPosition, Vector3.up);
		float num2 = ((Vector3)(ref val2)).magnitude / Mathf.Max(dt, 0.0001f);
		lastPosition = ((EntityState)this).characterBody.footPosition;
		bool flag = num != 0 && Vector3.Distance(((Component)target).transform.position, ((EntityState)this).characterBody.footPosition) <= 11f + speed * 0.12f;
		bool flag2 = ((EntityState)this).fixedAge > 0.90000004f && num2 < speed * 0.25f;
		if (flag || flag2 || ((EntityState)this).fixedAge >= 2.5f)
		{
			Bail(flag ? "close to the target" : (flag2 ? "blocked" : "out of road"));
		}
	}

	private void Bail(string reason)
	{
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		//IL_000d: Unknown result type (might be due to invalid IL or missing references)
		//IL_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_002a: 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: Unknown result type (might be due to invalid IL or missing references)
		//IL_0067: Unknown result type (might be due to invalid IL or missing references)
		//IL_0078: Unknown result type (might be due to invalid IL or missing references)
		//IL_007d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0082: Unknown result type (might be due to invalid IL or missing references)
		//IL_008c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0091: Unknown result type (might be due to invalid IL or missing references)
		//IL_0096: Unknown result type (might be due to invalid IL or missing references)
		bailed = true;
		Vector3 val = -Vector3.Cross(Vector3.up, direction);
		car?.Release(direction, speed, target);
		((BaseCharacterController)((EntityState)this).characterMotor).Motor.ForceUnground(0.1f);
		((EntityState)this).characterMotor.velocity = val * 9f + direction * (speed * 0.35f) + Vector3.up * 8f;
		((EntityState)this).PlayCrossfade("FullBody, Override", "CarBailout", "Dodge.playbackRate", 0.32f, 0.05f);
		if (((EntityState)this).characterBody.isPlayerControlled)
		{
			RingAudio.PlayJump();
		}
		HalAutoTest.Trace($"crash course: bailed out at {speed:0.0} m/s ({reason})");
	}

	public override void OnExit()
	{
		//IL_001d: Unknown result type (might be due to invalid IL or missing references)
		if (!bailed && (Object)(object)car != (Object)null)
		{
			car.Release(direction, Mathf.Max(speed, 15f), target);
		}
		if (!rolled || bailAge < 1.05f)
		{
			((EntityState)this).PlayCrossfade("FullBody, Override", "BufferEmpty", 0.2f);
		}
		((EntityState)this).OnExit();
	}

	public override InterruptPriority GetMinimumInterruptPriority()
	{
		if (bailed && bailAge > 0.5f)
		{
			return (InterruptPriority)1;
		}
		return (InterruptPriority)7;
	}
}
internal sealed class CarConstruct : MonoBehaviour
{
	private const float MaxSpeed = 44f;

	private const float RunTime = 1.8f;

	private const float HitRadius = 1.3f;

	private const float BlastRadius = 10f;

	private const float BlastCoefficient = 25f;

	private CharacterBody owner;

	private bool authority;

	private ConstructActor actor;

	private bool released;

	private Vector3 direction;

	private float speed;

	private HurtBox target;

	private float age;

	private float dust;

	private bool exploded;

	private float closest = float.MaxValue;

	private bool TargetAlive
	{
		get
		{
			if ((Object)(object)target != (Object)null && (Object)(object)target.healthComponent != (Object)null)
			{
				return target.healthComponent.alive;
			}
			return false;
		}
	}

	internal static CarConstruct Spawn(CharacterBody owner, bool authority, Vector3 position, Vector3 direction)
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0003: Unknown result type (might be due to invalid IL or missing references)
		//IL_0004: 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_0036: Unknown result type (might be due to invalid IL or missing references)
		//IL_0049: Unknown result type (might be due to invalid IL or missing references)
		//IL_004a: Unknown result type (might be due to invalid IL or missing references)
		//IL_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_0089: Unknown result type (might be due to invalid IL or missing references)
		//IL_008a: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
		ConstructActor constructActor = ConstructEffects.SpawnActor(ConstructKind.Car, position, Quaternion.LookRotation(direction, Vector3.up), 6f, 1f, 10f, 5f);
		object obj = (((Object)(object)constructActor != (Object)null) ? ((object)((Component)constructActor).gameObject) : ((object)new GameObject("CrashCourseCar")));
		((GameObject)obj).transform.SetPositionAndRotation(position, Quaternion.LookRotation(direction, Vector3.up));
		if ((Object)(object)constructActor != (Object)null)
		{
			constructActor.Brightness = 0.22f;
		}
		CarConstruct carConstruct = ((GameObject)obj).AddComponent<CarConstruct>();
		carConstruct.owner = owner;
		carConstruct.authority = authority;
		carConstruct.actor = constructActor;
		carConstruct.direction = direction;
		CorpsDamage.Sound(owner, RingAudio.HasNamed("Tank_Spawn") ? "Tank_Spawn" : "Wall_Spawn", RingConfig.BlastVolume.Value);
		ConstructEffects.SpawnBurst(position + Vector3.up * 0.8f, 3.5f, 0.35f);
		return carConstruct;
	}

	internal void Follow(Vector3 position, Vector3 heading)
	{
		//IL_0016: Unknown result type (might be due to invalid IL or missing references)
		//IL_0017: Unknown result type (might be due to invalid IL or missing references)
		//IL_0018: Unknown result type (might be due to invalid IL or missing references)
		//IL_001d: Unknown result type (might be due to invalid IL or missing references)
		if (!released && !exploded)
		{
			((Component)this).transform.SetPositionAndRotation(position, Quaternion.LookRotation(heading, Vector3.up));
			Exhaust();
		}
	}

	internal void Release(Vector3 heading, float startSpeed, HurtBox aimTarget)
	{
		//IL_002c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0037: Unknown result type (might be due to invalid IL or missing references)
		//IL_003c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0041: 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_001e: 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)
		released = true;
		speed = startSpeed;
		target = aimTarget;
		direction = (TargetAlive ? CorpsDamage.Flat(((Component)target).transform.position - ((Component)this).transform.position, heading) : heading);
		CorpsDamage.Sound(owner, RingAudio.HasNamed("Eagle_Flyby") ? "Eagle_Flyby" : "Jet_Strike", RingConfig.BlastVolume.Value * 0.8f);
	}

	private void Exhaust()
	{
		//IL_0030: Unknown result type (might be due to invalid IL or missing references)
		//IL_003b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0045: Unknown result type (might be due to invalid IL or missing references)
		//IL_004a: Unknown result type (might be due to invalid IL or missing references)
		//IL_004f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0059: Unknown result type (might be due to invalid IL or missing references)
		//IL_005e: Unknown result type (might be due to invalid IL or missing references)
		dust -= Time.deltaTime;
		if (dust <= 0f)
		{
			dust = 0.06f;
			ConstructEffects.SpawnBurst(((Component)this).transform.position - ((Component)this).transform.forward * 2.3f + Vector3.up * 0.4f, 0.9f, 0.25f);
		}
	}

	private void Update()
	{
		//IL_012f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0134: Unknown result type (might be due to invalid IL or missing references)
		//IL_013e: 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_0148: Unknown result type (might be due to invalid IL or missing references)
		//IL_0149: Unknown result type (might be due to invalid IL or missing references)
		//IL_014e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0152: Unknown result type (might be due to invalid IL or missing references)
		//IL_015c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0161: Unknown result type (might be due to invalid IL or missing references)
		//IL_0165: Unknown result type (might be due to invalid IL or missing references)
		//IL_0171: Unknown result type (might be due to invalid IL or missing references)
		//IL_0178: Unknown result type (might be due to invalid IL or missing references)
		//IL_0059: Unknown result type (might be due to invalid IL or missing references)
		//IL_0064: Unknown result type (might be due to invalid IL or missing references)
		//IL_0069: Unknown result type (might be due to invalid IL or missing references)
		//IL_006f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0074: Unknown result type (might be due to invalid IL or missing references)
		//IL_0079: Unknown result type (might be due to invalid IL or missing references)
		//IL_007d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0082: Unknown result type (might be due to invalid IL or missing references)
		//IL_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_00a5: 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_00b5: 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_0102: Unknown result type (might be due to invalid IL or missing references)
		//IL_0199: Unknown result type (might be due to invalid IL or missing references)
		//IL_019e: Unknown result type (might be due to invalid IL or missing references)
		//IL_02b1: Unknown result type (might be due to invalid IL or missing references)
		//IL_02b7: Unknown result type (might be due to invalid IL or missing references)
		//IL_02bd: Unknown result type (might be due to invalid IL or missing references)
		//IL_02c2: Unknown result type (might be due to invalid IL or missing references)
		//IL_02c7: 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_02d5: Unknown result type (might be due to invalid IL or missing references)
		//IL_02da: Unknown result type (might be due to invalid IL or missing references)
		//IL_02e2: Unknown result type (might be due to invalid IL or missing references)
		//IL_02e5: Unknown result type (might be due to invalid IL or missing references)
		//IL_02ea: Unknown result type (might be due to invalid IL or missing references)
		//IL_02ef: Unknown result type (might be due to invalid IL or missing references)
		//IL_0313: Unknown result type (might be due to invalid IL or missing references)
		//IL_0318: Unknown result type (might be due to invalid IL or missing references)
		//IL_0322: Unknown result type (might be due to invalid IL or missing references)
		//IL_0327: Unknown result type (might be due to invalid IL or missing references)
		//IL_0231: Unknown result type (might be due to invalid IL or missing references)
		//IL_0236: Unknown result type (might be due to invalid IL or missing references)
		//IL_0262: Unknown result type (might be due to invalid IL or missing references)
		//IL_0267: Unknown result type (might be due to invalid IL or missing references)
		//IL_0208: Unknown result type (might be due to invalid IL or missing references)
		//IL_0218: Unknown result type (might be due to invalid IL or missing references)
		//IL_028f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0273: 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_0281: Unknown result type (might be due to invalid IL or missing references)
		//IL_0286: Unknown result type (might be due to invalid IL or missing references)
		if (!released || exploded)
		{
			return;
		}
		float deltaTime = Time.deltaTime;
		age += deltaTime;
		speed = Mathf.Min(44f, speed + 30f * deltaTime);
		if (TargetAlive)
		{
			Vector3 val = CorpsDamage.Flat(((Component)target).transform.position - ((Component)this).transform.position, direction);
			direction = Vector3.RotateTowards(direction, val, 8f * deltaTime, 0f);
			float num = Vector3.Distance(((Component)target).transform.position, ((Component)this).transform.position + Vector3.up * 0.7f);
			if (num < 3.5f || (closest < 8f && num > closest + 0.5f))
			{
				Explode(((Component)target).transform.position);
				return;
			}
			closest = Mathf.Min(closest, num);
		}
		float num2 = speed * deltaTime;
		Vector3 val2 = ((Component)this).transform.position + Vector3.up * 0.8f;
		LayerIndex val3 = LayerIndex.world;
		int num3 = LayerMask.op_Implicit(((LayerIndex)(ref val3)).mask);
		val3 = LayerIndex.entityPrecise;
		int num4 = num3 | LayerMask.op_Implicit(((LayerIndex)(ref val3)).mask);
		RaycastHit[] array = Physics.SphereCastAll(val2, 1.3f, direction, num2 + 2.2f, num4, (QueryTriggerInteraction)1);
		for (int i = 0; i < array.Length; i++)
		{
			RaycastHit val4 = array[i];
			HurtBox component = ((Component)((RaycastHit)(ref val4)).collider).GetComponent<HurtBox>();
			bool num5 = (Object)(object)component != (Object)null && (Object)(object)component.healthComponent != (Object)null && component.healthComponent.alive && (Object)(object)owner != (Object)null && (Object)(object)component.healthComponent.body != (Object)null && component.healthComponent.body.teamComponent.teamIndex != owner.teamComponent.teamIndex;
			bool flag = (Object)(object)component == (Object)null && Vector3.Dot(((RaycastHit)(ref val4)).normal, Vector3.up) < 0.6f && ((RaycastHit)(ref val4)).distance > 0f;
			if (num5 || flag)
			{
				Explode((((RaycastHit)(ref val4)).point != Vector3.zero) ? ((RaycastHit)(ref val4)).point : (val2 + direction * ((RaycastHit)(ref val4)).distance));
				return;
			}
		}
		Vector3 point = ((Component)this).transform.position + direction * num2;
		point = CorpsDamage.Ground(point, 2f, 6f);
		((Component)this).transform.SetPositionAndRotation(point, Quaternion.LookRotation(direction, Vector3.up));
		Exhaust();
		if (age >= 1.8f)
		{
			Explode(((Component)this).transform.position + Vector3.up * 0.6f);
		}
	}

	private void Explode(Vector3 point)
	{
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		//IL_002d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0032: Unknown result type (might be due to invalid IL or missing references)
		//IL_0037: Unknown result type (might be due to invalid IL or missing references)
		//IL_004b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0050: Unknown result type (might be due to invalid IL or missing references)
		//IL_0051: Unknown result type (might be due to invalid IL or missing references)
		//IL_0052: Unknown result type (might be due to invalid IL or missing references)
		//IL_0053: Unknown result type (might be due to invalid IL or missing references)
		//IL_0058: Unknown result type (might be due to invalid IL or missing references)
		//IL_006c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0071: Unknown result type (might be due to invalid IL or missing references)
		//IL_0097: 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_0111: Unknown result type (might be due to invalid IL or missing references)
		//IL_0133: 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_014d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0153: Unknown result type (might be due to invalid IL or missing references)
		//IL_015d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0162: Unknown result type (might be due to invalid IL or missing references)
		//IL_0178: Unknown result type (might be due to invalid IL or missing references)
		exploded = true;
		ConstructEffects.SpawnBurst(point, 13f, 0.7f);
		for (int i = 0; i < 7; i++)
		{
			Vector3 val = Quaternion.Euler(0f, (float)i * 51f, 0f) * Vector3.forward * Random.Range(2.5f, 6f);
			ConstructEffects.SpawnBurst(point + val + Vector3.up * Random.Range(0f, 2.5f), Random.Range(4f, 7f), 0.6f);
		}
		CorpsDamage.Shake(point, 2.2f, 0.9f, 90f);
		CorpsDamage.Sound(owner, RingAudio.HasNamed("Eagle_BigBomb") ? "Eagle_BigBomb" : "Jet_Boom", RingConfig.BlastVolume.Value);
		CorpsDamage.Sound(owner, "Jet_Boom", RingConfig.BlastVolume.Value * 0.8f);
		EagleZone.Spawn(owner, authority, EagleZone.Kind.Napalm, CorpsDamage.Ground(point, 3f, 8f), 6f, 6f);
		if (authority)
		{
			int num = CorpsDamage.Blast(owner, point, 10f, 25f, (DamageType)160, Vector3.up * 2500f + direction * 1500f, 1f, (FalloffModel)0);
			HalAutoTest.Trace($"crash course: the car exploded at {point} after {age:0.00} s, hits {num}");
		}
		if ((Object)(object)actor != (Object)null)
		{
			actor.Dissolve(0.25f);
		}
		else
		{
			Object.Destroy((Object)(object)((Component)this).gameObject, 0.3f);
		}
	}
}
internal static class CarCrashIcon
{
	private const int Size = 128;

	internal static Sprite Create()
	{
		//IL_000c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0011: Unknown result type (might be due to invalid IL or missing references)
		//IL_001c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0024: Expected O, but got Unknown
		//IL_02c2: Unknown result type (might be due to invalid IL or missing references)
		//IL_02d1: 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_0071: 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)
		//IL_007b: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e3: 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_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_0105: Unknown result type (might be due to invalid IL or missing references)
		//IL_0107: Unknown result type (might be due to invalid IL or missing references)
		//IL_0115: Unknown result type (might be due to invalid IL or missing references)
		//IL_0144: Unknown result type (might be due to invalid IL or missing references)
		//IL_0123: Unknown result type (might be due to invalid IL or missing references)
		//IL_0152: Unknown result type (might be due to invalid IL or missing references)
		//IL_0131: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a9: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b5: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ba: Unknown result type (might be due to invalid IL or missing references)
		//IL_01bf: Unknown result type (might be due to invalid IL or missing references)
		//IL_0160: Unknown result type (might be due to invalid IL or missing references)
		//IL_016c: Unknown result type (might be due to invalid IL or missing references)
		//IL_01cf: Unknown result type (might be due to invalid IL or missing references)
		//IL_01db: Unknown result type (might be due to invalid IL or missing references)
		//IL_01e0: Unknown result type (might be due to invalid IL or missing references)
		//IL_01e5: 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_018e: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ff: Unknown result type (might be due to invalid IL or missing references)
		//IL_0210: Unknown result type (might be due to invalid IL or missing references)
		//IL_021a: Unknown result type (might be due to invalid IL or missing references)
		//IL_021f: Unknown result type (might be due to invalid IL or missing references)
		//IL_024f: Unknown result type (might be due to invalid IL or missing references)
		//IL_025b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0267: Unknown result type (might be due to invalid IL or missing references)
		//IL_0278: Unknown result type (might be due to invalid IL or missing references)
		//IL_027d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0223: Unknown result type (might be due to invalid IL or missing references)
		//IL_0234: Unknown result type (might be due to invalid IL or missing references)
		//IL_023e: 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)
		try
		{
			Texture2D val = new Texture2D(128, 128, (TextureFormat)4, false)
			{
				name = "Skill_CrashCourse",
				wrapMode = (TextureWrapMode)1
			};
			Color[] array = (Color[])(object)new Color[16384];
			Vector2 val2 = default(Vector2);
			Color val4 = default(Color);
			for (int i = 0; i < 128; i++)
			{
				for (int j = 0; j < 128; j++)
				{
					((Vector2)(ref val2))..ctor(((float)j + 0.5f) / 128f, ((float)i + 0.5f) / 128f);
					Vector2 val3 = val2 - new Vector2(0.5f, 0.5f);
					float num = 1f - Mathf.Clamp01(((Vector2)(ref val3)).magnitude * 1.3f);
					((Color)(ref val4))..ctor(0.01f, 0.07f + 0.1f * num, 0.03f, 1f);
					val3 = val2 - new Vector2(0.72f, 0.62f);
					float num2 = Mathf.Exp((0f - ((Vector2)(ref val3)).sqrMagnitude) / 0.03f);
					val4 += new Color(0.35f, 0.95f, 0.4f) * num2;
					bool flag = val2.x > 0.12f && val2.x < 0.78f && val2.y > 0.3f && val2.y < 0.44f;
					bool flag2 = val2.y >= 0.44f && val2.y < 0.56f && val2.x > 0.28f + (val2.y - 0.44f) * 0.8f && val2.x < 0.62f - (val2.y - 0.44f) * 0.6f;
					val3 = val2 - new Vector2(0.26f, 0.29f);
					int num3;
					if (!(((Vector2)(ref val3)).magnitude < 0.07f))
					{
						val3 = val2 - new Vector2(0.64f, 0.29f);
						num3 = ((((Vector2)(ref val3)).magnitude < 0.07f) ? 1 : 0);
					}
					else
					{
						num3 = 1;
					}
					if (flag || flag2)
					{
						val4 = Color.Lerp(val4, new Color(0.2f, 0.9f, 0.35f), 0.75f);
					}
					if (num3 != 0)
					{
						val4 = Color.Lerp(val4, new Color(0.6f, 1f, 0.65f), 0.85f);
					}
					array[i * 128 + j] = new Color(Mathf.Clamp01(val4.r), Mathf.Clamp01(val4.g), Mathf.Clamp01(val4.b), 1f);
				}
			}
			val.SetPixels(array);
			val.Apply();
			return Sprite.Create(val, new Rect(0f, 0f, 128f, 128f), new Vector2(0.5f, 0.5f));
		}
		catch (Exception ex)
		{
			Plugin.ModLogger.LogWarning((object)("Crash Course icon could not be drawn: " + ex.Message));
			return null;
		}
	}
}
internal static class CombatHelpers
{
	internal static Transform FindRing(EntityState state)
	{
		return FindChild(state, "Ring");
	}

	internal static Transform FindChild(EntityState state, string childName)
	{
		ModelLocator val = (((Object)(object)state.outer != (Object)null) ? state.outer.commonComponents.modelLocator : null);
		Transform val2 = (((Object)(object)val != (Object)null) ? val.modelTransform : null);
		ChildLocator val3 = (((Object)(object)val2 != (Object)null) ? ((Component)val2).GetComponent<ChildLocator>() : null);
		Transform val4 = (((Object)(object)val3 != (Object)null) ? val3.FindChild(childName) : null);
		if (!((Object)(object)val4 != (Object)null))
		{
			return val2;
		}
		return val4;
	}
}
internal class ConstructStrike : BaseSkillState
{
	private static readonly string[] Animations = new string[6] { "Strike1", "Strike2", "Strike3", "Strike4", "Strike5", "Strike6" };

	private static readonly ConstructKind[] Kinds = new ConstructKind[6]
	{
		ConstructKind.Fist,
		ConstructKind.Glove,
		ConstructKind.Mace,
		ConstructKind.Bat,
		ConstructKind.Sword,
		ConstructKind.Hammer
	};

	private static readonly float[] Coefficients = new float[6] { 2.2f, 2.2f, 2.6f, 2.8f, 3f, 4f };

	private static readonly string[] Anchors = new string[6] { "Ring", "HandL", "Ring", "HandL", "Ring", "Ring" };

	private const float BaseDuration = 0.45f;

	private const float HitFraction = 0.32f;

	private const float StrikeRange = 3.2f;

	private const float LungeSpeed = 42f;

	private const float MaxLungeTime = 0.5f;

	private const float HitPause = 0.06f;

	private const float CriticalPause = 0.16f;

	private const float BlastRadius = 2.6f;

	private const float StrikeCrossfade = 0.08f;

	private const float TurnDegreesPerSecond = 1080f;

	internal const float CounterWindow = 0.45f;

	private const float CounterDamage = 1.5f;

	private bool counter;

	private const float RunningWindow = 0.2f;

	private const float RunningDamage = 1.35f;

	private const float RunningPush = 14f;

	private const string RunningState = "Light_RH_10";

	private bool running;

	private bool handedOff;

	protected FreeflowController freeflow;

	protected Animator animator;

	private Transform ring;

	private StrikeLibrary.Variant variant;

	private HurtBox target;

	protected int step;

	private float duration;

	private bool lunging;

	private bool striking;

	private bool hasHit;

	private float lungeTime;

	private float strikeAge;

	private float pauseTimer;

	public override void OnEnter()
	{
		//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
		//IL_0201: Unknown result type (might be due to invalid IL or missing references)
		((BaseState)this).OnEnter();
		if (PlungeStrike.CanPlunge(((EntityState)this).characterBody))
		{
			handedOff = true;
			((EntityState)this).outer.SetNextState((EntityState)(object)new PlungeStrike());
			return;
		}
		freeflow = ((EntityState)this).GetComponent<FreeflowController>();
		animator = ((EntityState)this).GetModelAnimator();
		duration = 0.45f / ((BaseState)this).attackSpeedStat;
		step = (((Object)(object)freeflow != (Object)null) ? freeflow.NextStep() : 0);
		HalDodgeInput component = ((EntityState)this).GetComponent<HalDodgeInput>();
		counter = (Object)(object)component != (Object)null && Time.time - component.LastDodgeEnded < 0.45f;
		if (counter)
		{
			step = 5;
			ConstructEffects.SpawnBurst(((EntityState)this).characterBody.corePosition, 2.2f, 0.25f);
		}
		running = !counter && (Object)(object)freeflow != (Object)null && Time.time - freeflow.LastSprintTime < 0.2f && ((Object)(object)((EntityState)this).characterMotor == (Object)null || ((EntityState)this).characterMotor.isGrounded);
		string text = $"strike step {step} counter={counter} running={running} sinceSprint={(((Object)(object)freeflow != (Object)null) ? (Time.time - freeflow.LastSprintTime) : (-1f)):0.00} ";
		CharacterMotor characterMotor = ((EntityState)this).characterMotor;
		HalAutoTest.Trace(text + $"grounded={((characterMotor != null) ? new bool?(characterMotor.isGrounded) : ((bool?)null))}");
		ring = CombatHelpers.FindChild((EntityState)(object)this, Anchors[step]);
		((BaseState)this).StartAimMode(2f, false);
		if (((EntityState)this).isAuthority && (Object)(object)freeflow != (Object)null)
		{
			target = freeflow.AcquireTarget(((BaseState)this).GetAimRay(), RingConfig.LungeRange.Value);
			lunging = (Object)(object)target != (Object)null && DistanceTo(target) > 3.2f;
		}
		if (lunging)
		{
			freeflow.OverridingMovement = true;
			((EntityState)this).PlayCrossfade("FullBody, Override", "Lunge", 0.1f);
			Util.PlaySound("Play_huntress_shift_mini_blink", ((EntityState)this).gameObject);
		}
		else
		{
			BeginStrike();
		}
	}

	public override void FixedUpdate()
	{
		//IL_008c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0091: Unknown result type (might be due to invalid IL or missing references)
		((EntityState)this).FixedUpdate();
		if (handedOff)
		{
			return;
		}
		if (lunging)
		{
			UpdateLunge();
			return;
		}
		if (pauseTimer > 0f)
		{
			pauseTimer -= ((EntityState)this).GetDeltaTime();
			if ((Object)(object)animator != (Object)null)
			{
				animator.speed = ((pauseTimer > 0f) ? 0f : 1f);
			}
			if (((EntityState)this).isAuthority && (Object)(object)((EntityState)this).characterMotor != (Object)null)
			{
				((EntityState)this).characterMotor.velocity = Vector3.zero;
			}
			return;
		}
		strikeAge += ((EntityState)this).GetDeltaTime();
		if (!hasHit && strikeAge >= duration * 0.32f)
		{
			hasHit = true;
			Hit();
		}
		if (((EntityState)this).isAuthority && strikeAge >= duration)
		{
			((EntityState)this).outer.SetNextStateToMain();
		}
	}

	public override void OnExit()
	{
		if (handedOff)
		{
			((EntityState)this).OnExit();
			return;
		}
		if ((Object)(object)animator != (Object)null)
		{
			animator.speed = 1f;
		}
		if ((Object)(object)freeflow != (Object)null)
		{
			freeflow.OverridingMovement = false;
		}
		if (!striking)
		{
			((EntityState)this).PlayCrossfade("FullBody, Override", "BufferEmpty", 0.2f);
		}
		((EntityState)this).OnExit();
	}

	public override InterruptPriority GetMinimumInterruptPriority()
	{
		if (striking && strikeAge >= duration * 0.6f)
		{
			return (InterruptPriority)0;
		}
		return (InterruptPriority)1;
	}

	private void UpdateLunge()
	{
		//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
		//IL_00fc: Unknown result type (might be due to invalid IL or missing references)
		//IL_00fd: Unknown result type (might be due to invalid IL or missing references)
		//IL_0102: Unknown result type (might be due to invalid IL or missing references)
		//IL_0107: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f7: Unknown result type (might be due to invalid IL or missing references)
		//IL_0096: Unknown result type (might be due to invalid IL or missing references)
		//IL_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_0130: Unknown result type (might be due to invalid IL or missing references)
		//IL_0137: Unknown result type (might be due to invalid IL or missing references)
		//IL_014d: Unknown result type (might be due to invalid IL or missing references)
		lungeTime += ((EntityState)this).GetDeltaTime();
		if ((Object)(object)target == (Object)null || (Object)(object)target.healthComponent == (Object)null || !target.healthComponent.alive || lungeTime > 0.5f || DistanceTo(target) <= 3.2f)
		{
			lunging = false;
			freeflow.OverridingMovement = false;
			if ((Object)(object)((EntityState)this).characterMotor != (Object)null)
			{
				CharacterMotor characterMotor = ((EntityState)this).characterMotor;
				characterMotor.velocity *= 0.15f;
			}
			BeginStrike();
			return;
		}
		Vector3 val = ((Component)target).transform.position - ((EntityState)this).characterBody.corePosition;
		if ((Object)(object)((EntityState)this).characterMotor != (Object)null)
		{
			((EntityState)this).characterMotor.velocity = ((Vector3)(ref val)).normalized * 42f;
		}
		Vector3 val2 = Vector3.ProjectOnPlane(val, Vector3.up);
		if ((Object)(object)((EntityState)this).characterDirection != (Object)null && ((Vector3)(ref val2)).sqrMagnitude > 0.01f)
		{
			((EntityState)this).characterDirection.forward = Vector3.RotateTowards(((EntityState)this).characterDirection.forward, ((Vector3)(ref val2)).normalized, MathF.PI * 6f * ((EntityState)this).GetDeltaTime(), 0f);
		}
	}

	private void BeginStrike()
	{
		//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00fc: Unknown result type (might be due to invalid IL or missing references)
		//IL_0101: Unknown result type (might be due to invalid IL or missing references)
		//IL_0104: Unknown result type (might be due to invalid IL or missing references)
		//IL_010e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0113: Unknown result type (might be due to invalid IL or missing references)
		//IL_0118: Unknown result type (might be due to invalid IL or missing references)
		//IL_0237: Unknown result type (might be due to invalid IL or missing references)
		striking = true;
		strikeAge = 0f;
		bool flag = (Object)(object)((EntityState)this).characterMotor == (Object)null || ((EntityState)this).characterMotor.isGrounded;
		bool flag2 = (Object)(object)((EntityState)this).inputBank != (Object)null && ((Vector3)(ref ((EntityState)this).inputBank.moveVector)).sqrMagnitude > 0.04f;
		bool flag3 = !running && (!flag || flag2);
		variant = ((!running) ? PickVariant(flag3) : (StrikeLibrary.For(animator)?.Hands.FirstOrDefault((StrikeLibrary.Variant v) => v.State == "Light_RH_10") ?? PickVariant(upperBody: false)));
		if (running && ((EntityState)this).isAuthority && (Object)(object)((EntityState)this).characterMotor != (Object)null)
		{
			CharacterMotor characterMotor = ((EntityState)this).characterMotor;
			Vector3 velocity = characterMotor.velocity;
			Vector3 val = Vector3.ProjectOnPlane(StrikeDirection(), Vector3.up);
			characterMotor.velocity = velocity + ((Vector3)(ref val)).normalized * 14f;
		}
		if (variant != null)
		{
			ring = CombatHelpers.FindChild((EntityState)(object)this, variant.Anchor);
			string text = ((flag3 && !variant.IsKick) ? "Gesture, Override" : "FullBody, Override");
			if (text == "Gesture, Override")
			{
				((EntityState)this).PlayCrossfade("FullBody, Override", "BufferEmpty", 0.1f);
			}
			((EntityState)this).PlayCrossfade(text, variant.State, "Strike.playbackRate", duration, 0.08f);
		}
		else
		{
			((EntityState)this).PlayCrossfade("FullBody, Override", Animations[step], "Strike.playbackRate", duration, 0.08f);
		}
		HalAutoTest.Trace($"strike variant {variant?.State ?? Animations[step]} (step {step})");
		if (variant == null || !variant.IsKick)
		{
			ConstructKind kind = KindFor(step, variant);
			ConstructEffects.SpawnConstruct(kind, ring, StrikeDirection(), duration * 0.9f, (step == 5) ? 1.3f : 1.1f);
			OnConstructFormed(kind);
		}
		if (((EntityState)this).isAuthority && ((EntityState)this).characterBody.isPlayerControlled)
		{
			RingAudio.PlaySwing();
		}
		else
		{
			Util.PlaySound("Play_loader_m1_swing", ((EntityState)this).gameObject);
		}
	}

	protected virtual ConstructKind KindFor(int strikeStep, StrikeLibrary.Variant strikeVariant)
	{
		return Kinds[strikeStep];
	}

	protected virtual void OnConstructFormed(ConstructKind kind)
	{
	}

	protected virtual void OnFinisherLanded()
	{
	}

	protected virtual StrikeLibrary.Variant PickVariant(bool upperBody)
	{
		StrikeLibrary.Pools pools = StrikeLibrary.For(animator);
		if (pools == null || (Object)(object)freeflow == (Object)null || pools.Hands.Count == 0)
		{
			return null;
		}
		uint num = StrikeLibrary.Mix((uint)(freeflow.StrikeCount * 7919 + step));
		List<StrikeLibrary.Variant> list = ((step == 5 && pools.Finishers.Count > 0) ? pools.Finishers : ((!upperBody && pools.Kicks.Count > 0 && num % 100 < 22) ? pools.Kicks : pools.Hands));
		int num2 = (int)(StrikeLibrary.Mix(num) % (uint)list.Count);
		if (list.Count > 1 && list[num2].Hash == freeflow.LastVariant)
		{
			num2 = (num2 + 1) % list.Count;
		}
		freeflow.LastVariant = list[num2].Hash;
		return list[num2];
	}

	private void Hit()
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		//IL_000d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0012: Unknown result type (might be due to invalid IL or missing references)
		//IL_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_0022: 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_00af: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d9: Unknown result type (might be due to invalid IL or missing references)
		//IL_00da: Unknown result type (might be due to invalid IL or missing references)
		//IL_00df: Unknown result type (might be due to invalid IL or missing references)
		//IL_0092: Unknown result type (might be due to invalid IL or missing references)
		//IL_0100: Unknown result type (might be due to invalid IL or missing references)
		//IL_0102: Unknown result type (might be due to invalid IL or missing references)
		//IL_0107: Unknown result type (might be due to invalid IL or missing references)
		//IL_0170: Unknown result type (might be due to invalid IL or missing references)
		//IL_017b: Unknown result type (might be due to invalid IL or missing references)
		//IL_017c: 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_0197: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a1: Unknown result type (might be due to invalid IL or missing references)
		//IL_0190: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a6: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ab: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b0: Unknown result type (might be due to invalid IL or missing references)
		//IL_01bc: Unknown result type (might be due to invalid IL or missing references)
		//IL_01c7: Unknown result type (might be due to invalid IL or missing references)
		//IL_01d6: Unknown result type (might be due to invalid IL or missing references)
		//IL_01db: Unknown result type (might be due to invalid IL or missing references)
		//IL_01e0: Unknown result type (might be due to invalid IL or missing references)
		//IL_01e2: Unknown result type (might be due to invalid IL or missing references)
		//IL_01e7: Unknown result type (might be due to invalid IL or missing references)
		//IL_01e9: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ef: Expected O, but got Unknown
		//IL_01f0: 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_01f6: 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_0224: Unknown result type (might be due to invalid IL or missing references)
		Vector3 val = StrikeDirection();
		Vector3 position = ((EntityState)this).characterBody.corePosition + val * 1.7f;
		ConstructEffects.SpawnBurst(position, (step == 5) ? 2.4f : 1.4f);
		((EntityState)this).GetComponent<HalMotion>()?.Punch((step == 5) ? 1.6f : 1f);
		if (variant != null && variant.IsKick && (Object)(object)ring != (Object)null)
		{
			ConstructEffects.SpawnBurst(ring.position, 1.8f, 0.3f);
		}
		if (!((EntityState)this).isAuthority)
		{
			return;
		}
		BlastAttack val2 = new BlastAttack
		{
			attacker = ((EntityState)this).gameObject,
			inflictor = ((EntityState)this).gameObject,
			teamIndex = ((BaseState)this).GetTeam(),
			position = position,
			radius = 2.6f * ((step == 5) ? 1.3f : 1f),
			falloffModel = (FalloffModel)0,
			baseDamage = ((BaseState)this).damageStat * Coefficients[step] * RingConfig.ConstructDamageMultiplier.Value * (((Object)(object)freeflow != (Object)null) ? freeflow.DamageMultiplier : 1f) * (counter ? 1.5f : (running ? 1.35f : 1f)),
			baseForce = 900f,
			bonusForce = val * 600f + ((step == 3) ? (Vector3.up * 1400f) : Vector3.zero),
			crit = ((BaseState)this).RollCrit(),
			procCoefficient = 1f,
			damageType = DamageTypeCombo.op_Implicit((DamageType)((step == 5) ? 32 : 0)),
			attackerFiltering = (AttackerFiltering)2,
			damageColorIndex = (DamageColorIndex)0
		};
		Result val3 = val2.Fire();
		if (val3.hitCount <= 0)
		{
			return;
		}
		freeflow?.RegisterHits(val3.hitCount);
		pauseTimer = 0.06f;
		foreach (HealthComponent item in StanceBreak.Targets(val3))
		{
			if (StanceBreak.TryCritical(item, ((EntityState)this).characterBody, val2.baseDamage * 2.5f))
			{
				pauseTimer = 0.16f;
				((EntityState)this).GetComponent<HalMotion>()?.Punch(2f);
				HalVoice.Attack(0.6f);
			}
			else
			{
				StanceBreak.Add(item, (step == 5 || counter || running) ? 3f : 1f);
			}
		}
		if (!((EntityState)this).characterBody.isPlayerControlled)
		{
			Util.PlaySound("Play_loader_m1_impact", ((EntityState)this).gameObject);
		}
		else if (step == 5)
		{
			RingAudio.PlayFinisher();
			HalVoice.Attack();
			OnFinisherLanded();
		}
		else
		{
			RingAudio.PlayPunch();
		}
	}

	private Vector3 StrikeDirection()
	{
		//IL_0029: Unknown result type (might be due to invalid IL or missing references)
		//IL_0034: Unknown result type (might be due to invalid IL or missing references)
		//IL_0039: 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_0014: 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_003e: 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_0053: Unknown result type (might be due to invalid IL or missing references)
		Vector3 val;
		if (!((Object)(object)target != (Object)null))
		{
			Ray aimRay = ((BaseState)this).GetAimRay();
			val = ((Ray)(ref aimRay)).direction;
		}
		else
		{
			val = ((Component)target).transform.position - ((EntityState)this).characterBody.corePosition;
		}
		Vector3 val2 = val;
		if (!(((Vector3)(ref val2)).sqrMagnitude > 0.001f))
		{
			return ((EntityState)this).characterDirection.forward;
		}
		return ((Vector3)(ref val2)).normalized;
	}

	private float DistanceTo(HurtBox hurtBox)
	{
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		//IL_0011: Unknown result type (might be due to invalid IL or missing references)
		return Vector3.Distance(((EntityState)this).characterBody.corePosition, ((Component)hurtBox).transform.position);
	}
}
internal sealed class RingBlastFire : BaseSkillState
{
	private const float Range = 200f;

	private RingPowerController ring;

	private Transform muzzle;

	private float interval;

	private float timer;

	public override void OnEnter()
	{
		((BaseState)this).OnEnter();
		ring = ((EntityState)this).GetComponent<RingPowerController>();
		muzzle = CombatHelpers.FindRing((EntityState)(object)this);
		interval = Mathf.Max(0.05f, RingConfig.RingBlastInterval.Value) / Mathf.Sqrt(Mathf.Max(((BaseState)this).attackSpeedStat, 0.01f));
		if (((EntityState)this).isAuthority && (Object)(object)ring != (Object)null && ring.Available < RingConfig.RingBlastCost.Value)
		{
			((EntityState)this).outer.SetNextStateToMain();
			return;
		}
		float num = (((Object)(object)ring != (Object)null) ? (Time.time - ring.LastBlastTime) : interval);
		timer = Mathf.Max(0f, interval - num);
		if (timer <= 0f)
		{
			Fire();
			timer = interval;
		}
	}

	public override void FixedUpdate()
	{
		((EntityState)this).FixedUpdate();
		if (((EntityState)this).isAuthority && (!((BaseSkillState)this).IsKeyDownAuthority() || ((Object)(object)ring != (Object)null && ring.Available < RingConfig.RingBlastCost.Value)))
		{
			((EntityState)this).outer.SetNextStateToMain();
			return;
		}
		timer -= ((EntityState)this).GetDeltaTime();
		if (timer <= 0f)
		{
			timer += interval;
			Fire();
		}
	}

	public override InterruptPriority GetMinimumInterruptPriority()
	{
		return (InterruptPriority)1;
	}

	private void Fire()
	{
		//IL_001f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0024: Unknown result type (might be due to invalid IL or missing references)
		//IL_0026: 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_0052: Unknown result type (might be due to invalid IL or missing references)
		//IL_006b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0070: Unknown result type (might be due to invalid IL or missing references)
		//IL_0071: Unknown result type (might be due to invalid IL or missing references)
		//IL_0079: Unknown result type (might be due to invalid IL or missing references)
		//IL_007e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0081: Unknown result type (might be due to invalid IL or missing references)
		//IL_008b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0090: Unknown result type (might be due to invalid IL or missing references)
		//IL_0093: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
		//IL_00af: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
		//IL_010a: Unknown result type (might be due to invalid IL or missing references)
		//IL_010f: Unknown result type (might be due to invalid IL or missing references)
		//IL_011b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0127: Unknown result type (might be due to invalid IL or missing references)
		//IL_012a: Unknown result type (might be due to invalid IL or missing references)
		//IL_012f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0134: Unknown result type (might be due to invalid IL or missing references)
		//IL_0137: Unknown result type (might be due to invalid IL or missing references)
		//IL_0141: Unknown result type (might be due to invalid IL or missing references)
		//IL_014c: Unknown result type (might be due to invalid IL or missing references)
		//IL_015d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0164: Unknown result type (might be due to invalid IL or missing references)
		//IL_017b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0186: Unknown result type (might be due to invalid IL or missing references)
		//IL_0191: Unknown result type (might be due to invalid IL or missing references)
		//IL_019d: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a8: Unknown result type (might be due to invalid IL or missing references)
		//IL_01af: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ba: Unknown result type (might be due to invalid IL or missing references)
		//IL_01bc: Unknown result type (might be due to invalid IL or missing references)
		//IL_01c1: Unknown result type (might be due to invalid IL or missing references)
		//IL_01cc: Unknown result type (might be due to invalid IL or missing references)
		//IL_01cd: Unknown result type (might be due to invalid IL or missing references)
		//IL_01d2: 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_01df: Unknown result type (might be due to invalid IL or missing references)
		//IL_01e1: Unknown result type (might be due to invalid IL or missing references)
		if ((Object)(object)ring != (Object)null)
		{
			ring.LastBlastTime = Time.time;
		}
		Ray aimRay = ((BaseState)this).GetAimRay();
		((BaseState)this).StartAimMode(aimRay, 2f, false);
		((EntityState)this).PlayAnimation("Gesture, Override", "FirePistol, Right");
		Vector3 val = (((Object)(object)muzzle != (Object)null) ? muzzle.position : ((Ray)(ref aimRay)).origin);
		Vector3 point = ((Ray)(ref aimRay)).GetPoint(200f);
		Ray val2 = aimRay;
		LayerIndex val3 = LayerIndex.world;
		int num = LayerMask.op_Implicit(((LayerIndex)(ref val3)).mask);
		val3 = LayerIndex.entityPrecise;
		RaycastHit val4 = default(RaycastHit);
		if (Physics.Raycast(val2, ref val4, 200f, num | LayerMask.op_Implicit(((LayerIndex)(ref val3)).mask), (QueryTriggerInteraction)1))
		{
			point = ((RaycastHit)(ref val4)).point;
		}
		ConstructEffects.SpawnBolt(val, point);
		ConstructEffects.SpawnBurst(val, 0.35f, 0.12f);
		ConstructEffects.SpawnBurst(point, 0.9f, 0.2f);
		if (((EntityState)this).isAuthority)
		{
			if (((EntityState)this).characterBody.isPlayerControlled)
			{
				RingAudio.PlayBlast();
			}
			ring?.SpendPower(RingConfig.RingBlastCost.Value);
			BulletAttack val5 = new BulletAttack
			{
				owner = ((EntityState)this).gameObject,
				weapon = ((EntityState)this).gameObject,
				origin = ((Ray)(ref aimRay)).origin,
				aimVector = ((Ray)(ref aimRay)).direction,
				minSpread = 0f,
				maxSpread = ((EntityState)this).characterBody.spreadBloomAngle,
				bulletCount = 1u,
				damage = ((BaseState)this).damageStat * RingConfig.RingBlastDamage.Value,
				force = 250f,
				muzzleName = "Ring",
				isCrit = ((BaseState)this).RollCrit(),
				radius = 0.45f,
				smartCollision = true,
				procCoefficient = 1f,
				falloffModel = (FalloffModel)0,
				maxDistance = 200f
			};
			val3 = LayerIndex.world;
			val5.stopperMask = ((LayerIndex)(ref val3)).mask;
			val5.damageColorIndex = (DamageColorIndex)0;
			val5.Fire();
			((EntityState)this).characterBody.AddSpreadBloom(0.4f);
		}
	}
}
internal sealed class ConstructSlam : BaseSkillState
{
	private const float BaseDuration = 0.95f;

	private const float HitFraction = 0.42f;

	private const float Radius = 9f;

	private const float Coefficient = 9f;

	private float duration;

	private bool hasHit;

	private Vector3 forward;

	public override void OnEnter()
	{
		//IL_001a: Unknown result type (might be due to invalid IL or missing references)
		//IL_001f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0022: Unknown result type (might be due to invalid IL or missing references)
		//IL_0027: Unknown result type (might be due to invalid IL or missing references)
		//IL_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_0034: Unknown result type (might be due to invalid IL or missing references)
		//IL_0039: Unknown result type (might be due to invalid IL or missing references)
		//IL_0093: Unknown result type (might be due to invalid IL or missing references)
		//IL_0098: Unknown result type (might be due to invalid IL or missing references)
		//IL_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: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c2: 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)
		((BaseState)this).OnEnter();
		duration = 0.95f / ((BaseState)this).attackSpeedStat;
		Ray aimRay = ((BaseState)this).GetAimRay();
		Vector3 val = Vector3.ProjectOnPlane(((Ray)(ref aimRay)).direction, Vector3.up);
		forward = ((Vector3)(ref val)).normalized;
		if (((Vector3)(ref forward)).sqrMagnitude < 0.01f)
		{
			forward = ((EntityState)this).characterDirection.forward;
		}
		((BaseState)this).StartAimMode(2f, false);
		((EntityState)this).PlayCrossfade("FullBody, Override", "Slam", "Slam.playbackRate", duration, 0.12f);
		ConstructEffects.SpawnSlamHammer(((EntityState)this).characterBody.corePosition + Vector3.up * 1.6f + forward * 0.3f, forward, duration * 0.42f + 0.35f, 2.6f);
		Util.PlaySound("Play_loader_shift_activate", ((EntityState)this).gameObject);
		if (((EntityState)this).isAuthority && ((EntityState)this).characterBody.isPlayerControlled)
		{
			RingAudio.PlaySlam();
		}
	}

	public override void FixedUpdate()
	{
		((EntityState)this).FixedUpdate();
		if (!hasHit && ((EntityState)this).fixedAge >= duration * 0.42f)
		{
			hasHit = true;
			Slam();
		}
		if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= duration)
		{
			((EntityState)this).outer.SetNextStateToMain();
		}
	}

	public override InterruptPriority GetMinimumInterruptPriority()
	{
		return (InterruptPriority)2;
	}

	private void Slam()
	{
		//IL_0006: 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_0016: Unknown result type (might be due to invalid IL or missing references)
		//IL_001b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0020: Unknown result type (might be due to invalid IL or missing references)
		//IL_0021: Unknown result type (might be due to invalid IL or missing references)
		//IL_005d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0062: 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_007a: Unknown result type (might be due to invalid IL or missing references)
		//IL_007c: Unknown result type (might be due to invalid IL or missing references)
		//IL_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_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_008d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0098: Unknown result type (might be due to invalid IL or missing references)
		//IL_009a: Unknown result type (might be due to invalid IL or missing references)
		//IL_009f: Unknown result type (might be due to invalid IL or missing references)
		//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c8: 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_00d7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f6: 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_0102: Unknown result type (might be due to invalid IL or missing references)
		//IL_0107: Unknown result type (might be due to invalid IL or missing references)
		//IL_0109: Unknown result type (might be due to invalid IL or missing references)
		//IL_010e: Unknown result type (might be due to invalid IL or missing references)
		Vector3 position = ((EntityState)this).characterBody.footPosition + forward * 4f;
		ConstructEffects.SpawnBurst(position, 7f, 0.4f);
		Util.PlaySound("Play_loader_R_shock", ((EntityState)this).gameObject);
		if (((EntityState)this).isAuthority)
		{
			if (((EntityState)this).characterBody.isPlayerControlled)
			{
				RingAudio.PlayPunch();
			}
			new BlastAttack
			{
				attacker = ((EntityState)this).gameObject,
				inflictor = ((EntityState)this).gameObject,
				teamIndex = ((BaseState)this).GetTeam(),
				position = position,
				radius = 9f,
				falloffModel = (FalloffModel)0,
				baseDamage = ((BaseState)this).damageStat * 9f * RingConfig.ConstructDamageMultiplier.Value,
				baseForce = 1200f,
				bonusForce = Vector3.up * 2000f,
				crit = ((BaseState)this).RollCrit(),
				procCoefficient = 1f,
				damageType = DamageTypeCombo.op_Implicit((DamageType)32),
				attackerFiltering = (AttackerFiltering)2,
				damageColorIndex = (DamageColorIndex)0
			}.Fire();
		}
	}
}
internal sealed class PlungeStrike : BaseSkillState
{
	private const float MinimumHeight = 3f;

	private const float DiveSpeed = 38f;

	private const float MaxDiveTime = 2.5f;

	private const float Recovery = 0.3f;

	private const float Radius = 7f;

	private const float BaseCoefficient = 5f;

	private const float CoefficientPerMetre = 0.12f;

	private const float MaxBonusMetres = 30f;

	private float startHeight;

	private float landedAt = -1f;

	private bool addedFallImmunity;

	internal static bool CanPlunge(CharacterBody body)
	{
		//IL_0068: Unknown result type (might be due to invalid IL or missing references)
		//IL_006d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0077: Unknown result type (might be due to invalid IL or missing references)
		//IL_007c: Unknown result type (might be due to invalid IL or missing references)
		//IL_007f: 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_00cd: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
		//IL_00df: Unknown result type (might be due to invalid IL or missing references)
		CharacterMotor val = (((Object)(object)body != (Object)null) ? body.characterMotor : null);
		RingPowerController ringPowerController = (((Object)(object)body != (Object)null) ? ((Component)body).GetComponent<RingPowerController>() : null);
		LayerIndex world;
		if ((Object)(object)val != (Object)null)
		{
			string text = $"plunge check: grounded={val.isGrounded} flying={ringPowerController?.IsFlying} ";
			Vector3 footPosition = body.footPosition;
			Vector3 down = Vector3.down;
			world = LayerIndex.world;
			HalAutoTest.Trace(text + $"groundWithin3m={Physics.Raycast(footPosition, down, 3f, LayerMask.op_Implicit(((LayerIndex)(ref world)).mask), (QueryTriggerInteraction)1)}");
		}
		if ((Object)(object)val == (Object)null || val.isGrounded || ((Object)(object)ringPowerController != (Object)null && ringPowerController.IsFlying))
		{
			return false;
		}
		Vector3 footPosition2 = body.footPosition;
		Vector3 down2 = Vector3.down;
		world = LayerIndex.world;
		return !Physics.Raycast(footPosition2, down2, 3f, LayerMask.op_Implicit(((LayerIndex)(ref world)).mask), (QueryTriggerInteraction)1);
	}

	public override void OnEnter()
	{
		//IL_000d: 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_0076: Unknown result type (might be due to invalid IL or missing references)
		//IL_007c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0086: Unknown result type (might be due to invalid IL or missing references)
		//IL_008c: Unknown result type (might be due to invalid IL or missing references)
		//IL_008d: Unknown result type (might be due to invalid IL or missing references)
		((BaseState)this).OnEnter();
		startHeight = ((EntityState)this).characterBody.footPosition.y;
		((EntityState)this).PlayCrossfade("FullBody, Override", "Slam", "Slam.playbackRate", 0.55f, 0.1f);
		ConstructEffects.SpawnConstruct(ConstructKind.Fist, CombatHelpers.FindRing((EntityState)(object)this), Vector3.down, 2.5f, 1.7f);
		if (((EntityState)this).isAuthority && ((EntityState)this).characterBody.isPlayerControlled)
		{
			RingAudio.PlaySwing();
		}
		if ((((EntityState)this).characterBody.bodyFlags & 1) == 0)
		{
			CharacterBody characterBody = ((EntityState)this).characterBody;
			characterBody.bodyFlags = (BodyFlags)(characterBody.bodyFlags | 1);
			addedFallImmunity = true;
		}
	}

	public override void FixedUpdate()
	{
		//IL_0022: Unknown result type (might be due to invalid IL or missing references)
		//IL_0027: Unknown result type (might be due to invalid IL or missing references)
		//IL_002e: 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_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)
		((EntityState)this).FixedUpdate();
		if (!((EntityState)this).isAuthority)
		{
			return;
		}
		if (landedAt < 0f)
		{
			Vector3 velocity = ((EntityState)this).characterMotor.velocity;
			((EntityState)this).characterMotor.velocity = new Vector3(velocity.x * 0.85f, -38f, velocity.z * 0.85f);
			if (((EntityState)this).characterMotor.isGrounded || ((EntityState)this).fixedAge > 2.5f)
			{
				Land();
			}
		}
		else if (((EntityState)this).fixedAge - landedAt >= 0.3f)
		{
			((EntityState)this).outer.SetNextStateToMain();
		}
	}

	public override void OnExit()
	{
		//IL_000f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0016: Unknown result type (might be due to invalid IL or missing references)
		//IL_0017: Unknown result type (might be due to invalid IL or missing references)
		if (addedFallImmunity)
		{
			CharacterBody characterBody = ((EntityState)this).characterBody;
			characterBody.bodyFlags = (BodyFlags)(characterBody.bodyFlags & -2);
		}
		((EntityState)this).OnExit();
	}

	public override InterruptPriority GetMinimumInterruptPriority()
	{
		return (InterruptPriority)2;
	}

	private void Land()
	{
		//IL_0018: Unknown result type (might be due to invalid IL or missing references)
		//IL_0039: Unknown result type (might be due to invalid IL or missing references)
		//IL_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_004f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0052: Unknown result type (might be due to invalid IL or missing references)
		//IL_007c: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
		//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00da: Unknown result type (might be due to invalid IL or missing references)
		//IL_00df: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f8: Unknown result type (might be due to invalid IL or missing references)
		//IL_011d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0128: Unknown result type (might be due to invalid IL or missing references)
		//IL_0129: Unknown result type (might be due to invalid IL or missing references)
		//IL_0133: Unknown result type (might be due to invalid IL or missing references)
		//IL_0138: Unknown result type (might be due to invalid IL or missing references)
		//IL_013d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0149: 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_0161: 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_0168: Unknown result type (might be due to invalid IL or missing references)
		//IL_016a: Unknown result type (might be due to invalid IL or missing references)
		//IL_016f: Unknown result type (might be due to invalid IL or missing references)
		landedAt = ((EntityState)this).fixedAge;
		float num = Mathf.Clamp(startHeight - ((EntityState)this).characterBody.footPosition.y, 0f, 30f);
		Vector3 footPosition = ((EntityState)this).characterBody.footPosition;
		ConstructEffects.SpawnBurst(footPosition, 7f, 0.4f);
		ShakeEmitter.CreateSimpleShakeEmitter(footPosition, new Wave
		{
			amplitude = 0.6f,
			frequency = 20f,
			cycleOffset = 0f
		}, 0.35f, 30f, true);
		((EntityState)this).GetComponent<HalMotion>()?.Punch(1.8f);
		if (((EntityState)this).characterBody.isPlayerControlled)
		{
			RingAudio.PlaySlam();
		}
		StanceBreak.AddFromBlast(new BlastAttack
		{
			attacker = ((EntityState)this).gameObject,
			inflictor = ((EntityState)this).gameObject,
			teamIndex = ((BaseState)this).GetTeam(),
			position = footPosition,
			radius = 7f,
			falloffModel = (FalloffModel)2,
			baseDamage = ((BaseState)this).damageStat * (5f + 0.12f * num) * RingConfig.ConstructDamageMultiplier.Value,
			baseForce = 1200f,
			bonusForce = Vector3.up * 1500f,
			crit = ((BaseState)this).RollCrit(),
			procCoefficient = 1f,
			damageType = DamageTypeCombo.op_Implicit((DamageType)32),
			attackerFiltering = (AttackerFiltering)2,
			damageColorIndex = (DamageColorIndex)0
		}.Fire(), 6f);
	}
}
internal enum ConstructKind
{
	Fist,
	Glove,
	Hammer,
	Mace,
	Sword,
	Bat,
	DC_LightFist,
	DC_ClosedHand,
	DC_RobotHand,
	DC_RobotHandL,
	DC_KilowogFist,
	DC_KilowogHand,
	DC_GloveSpring,
	DC_Hammer,
	DC_Buzzsaw,
	DC_Rifle,
	DC_GrenadeLauncher,
	DC_Tank,
	DC_Jet,
	DC_SpikeWall,
	DC_Cage,
	Car
}
internal static class ConstructEffects
{
	private static readonly Dictionary<string, GameObject> Prefabs = new Dictionary<string, GameObject>();

	private static readonly int AlphaProperty = Shader.PropertyToID("_Alpha");

	internal static bool Loaded => Prefabs.Count > 0;

	internal static bool HasCorps { get; private set; }

	internal static Material Material
	{
		get
		{
			if (!Prefabs.TryGetValue("Construct_Burst", out var value))
			{
				return null;
			}
			Renderer componentInChildren = value.GetComponentInChildren<Renderer>(true);
			if (componentInChildren == null)
			{
				return null;
			}
			return componentInChildren.sharedMaterial;
		}
	}

	internal static bool Has(ConstructKind kind)
	{
		return Prefabs.ContainsKey("Construct_" + kind);
	}

	internal static void Load(AssetBundle bundle)
	{
		string[] array = new string[8] { "Construct_Fist", "Construct_Glove", "Construct_Hammer", "Construct_Mace", "Construct_Sword", "Construct_Bat", "Construct_Bolt", "Construct_Burst" };
		foreach (string text in array)
		{
			GameObject val = bundle.LoadAsset<GameObject>(text);
			if ((Object)(object)val == (Object)null)
			{
				throw new InvalidOperationException("greenlanternassets is missing " + text + ".");
			}
			Prefabs[text] = val;
		}
		GameObject val2 = bundle.LoadAsset<GameObject>("Construct_Car");
		if ((Object)(object)val2 != (Object)null)
		{
			Prefabs["Construct_Car"] = val2;
		}
		int num = 0;
		ConstructKind[] array2 = (ConstructKind[])Enum.GetValues(typeof(ConstructKind));
		ConstructKind[] array3 = array2;
		for (int i = 0; i < array3.Length; i++)
		{
			ConstructKind constructKind = array3[i];
			string text2 = "Construct_" + constructKind;
			if (constructKind.ToString().StartsWith("DC_", StringComparison.Ordinal))
			{
				GameObject val3 = bundle.LoadAsset<GameObject>(text2);
				if ((Object)(object)val3 != (Object)null)
				{
					Prefabs[text2] = val3;
					num++;
				}
			}
		}
		HasCorps = num == array2.Count((ConstructKind k) => k.ToString().StartsWith("DC_", StringComparison.Ordinal));
		Plugin.ModLogger.LogInfo((object)string.Format("Corps constructs in the bundle: {0}{1}.", num, HasCorps ? " (Corps loadouts enabled)" : ""));
	}

	internal static void SpawnConstruct(ConstructKind kind, Transform hand, Vector3 aimDirection, float duration, float scale = 1f)
	{
		//IL_0044: Unknown result type (might be due to invalid IL or missing references)
		if (Loaded && !((Object)(object)hand == (Object)null) && Prefabs.TryGetValue("Construct_" + kind, out var value))
		{
			Object.Instantiate<GameObject>(value).AddComponent<ConstructVisual>().Initialize(kind, hand, aimDirection, duration, scale);
		}
	}

	internal static HeldConstruct SpawnHeld(ConstructKind kind, Transform hand, Vector3 aimDirection, float scale = 1f)
	{
		//IL_003d: Unknown result type (might be due to invalid IL or missing references)
		if ((Object)(object)hand == (Object)null || !Prefabs.TryGetValue("Construct_" + kind, out var value))
		{
			return null;
		}
		HeldConstruct heldConstruct = Object.Instantiate<GameObject>(value).AddComponent<HeldConstruct>();
		heldConstruct.Initialize(hand, aimDirection, scale);
		return heldConstruct;
	}

	internal static ConstructActor SpawnActor(ConstructKind kind, Vector3 position, Quaternion rotation, float lifetime, float scale = 1f, float lightRange = 8f, float lightIntensity = 4f)
	{
		//IL_0028: Unknown result type (might be due to invalid IL or missing references)
		//IL_0029: Unknown result type (might be due to invalid IL or missing references)
		if (!Prefabs.TryGetValue("Construct_" + kind, out var value))
		{
			return null;
		}
		ConstructActor constructActor = Object.Instantiate<GameObject>(value, position, rotation).AddComponent<ConstructActor>();
		constructActor.Initialize(lifetime, scale, lightRange, lightIntensity);
		return constructActor;
	}

	internal static GameObject SpawnShell(Vector3 position, float scale)
	{
		//IL_0018: Unknown result type (might be due to invalid IL or missing references)
		//IL_0019: Unknown result type (might be due to invalid IL or missing references)
		//IL_0029: Unknown result type (might be due to invalid IL or missing references)
		//IL_002f: Unknown result type (might be due to invalid IL or missing references)
		//IL_003f: Unknown result type (might be due to invalid IL or missing references)
		//IL_004e: Expected O, but got Unknown
		if (!Loaded)
		{
			return null;
		}
		GameObject obj = Object.Instantiate<GameObject>(Prefabs["Construct_Burst"], position, Random.rotation);
		obj.transform.localScale = Vector3.one * scale;
		SetAlpha(obj.GetComponentsInChildren<Renderer>(), new MaterialPropertyBlock(), 1f);
		AddLight(obj, 3f, 3f);
		return obj;
	}

	internal static void SpawnSlamHammer(Vector3 origin, Vector3 forward, float duration, float scale)
	{
		//IL_0021: 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)
		if (Loaded)
		{
			Object.Instantiate<GameObject>(Prefabs["Construct_Hammer"]).AddComponent<ConstructVisual>().InitializeSlam(origin, forward, duration, scale);
		}
	}

	internal static void SpawnBolt(Vector3 from, Vector3 to)
	{
		//IL_0017: Unknown result type (might be due to invalid IL or missing references)
		//IL_0018: Unknown result type (might be due to invalid IL or missing references)
		//IL_0019: Unknown result type (might be due to invalid IL or missing references)
		//IL_001a: Unknown result type (might be due to invalid IL or missing references)
		//IL_001f: 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)
		if (Loaded)
		{
			Object.Instantiate<GameObject>(Prefabs["Construct_Bolt"], from, Quaternion.LookRotation(to - from)).AddComponent<BoltVisual>().Initialize(to);
		}
	}

	internal static void SpawnBurst(Vector3 position, float scale, float lifetime = 0.28f)
	{
		//IL_0017: Unknown result type (might be due to invalid IL or missing references)
		//IL_0018: Unknown result type (might be due to invalid IL or missing references)
		if (Loaded)
		{
			Object.Instantiate<GameObject>(Prefabs["Construct_Burst"], position, Random.rotation).AddComponent<BurstVisual>().Initialize(scale, lifetime);
		}
	}

	internal static void SetAlpha(Renderer[] renderers, MaterialPropertyBlock block, float alpha)
	{
		foreach (Renderer obj in renderers)
		{
			obj.GetPropertyBlock(block);
			block.SetFloat(AlphaProperty, alpha);
			obj.SetPropertyBlock(block);
		}
	}

	internal static Light AddLight(GameObject owner, float range, float intensity)
	{
		//IL_001d: Unknown result type (might be due to invalid IL or missing references)
		Light obj = owner.AddComponent<Light>();
		obj.type = (LightType)2;
		obj.color = new Color(0.3f, 1f, 0.4f);
		obj.range = range;
		obj.intensity = intensity;
		obj.shadows = (LightShadows)0;
		return obj;
	}
}
internal sealed class ConstructVisual : MonoBehaviour
{
	private const float PopInTime = 0.06f;

	private ConstructKind kind;

	private Transform hand;

	private Vector3 aim;

	private float duration;

	private float scale;

	private float age;

	private bool slam;

	private Vector3 slamOrigin;

	private Renderer[] renderers;

	private MaterialPropertyBlock block;

	private Light glow;

	private float glowIntensity;

	internal void Initialize(ConstructKind constructKind, Transform anchor, Vector3 aimDirection, float lifetime, float size)
	{
		//IL_0026: 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_002b: Unknown result type (might be due to invalid IL or missing references)
		kind = constructKind;
		hand = anchor;
		aim = ((((Vector3)(ref aimDirection)).sqrMagnitude > 0.0001f) ? ((Vector3)(ref aimDirection)).normalized : Vector3.forward);
		duration = Mathf.Max(0.15f, lifetime);
		scale = size;
		Setup(2.5f, 2.2f);
		Apply();
	}

	internal void InitializeSlam(Vector3 origin, Vector3 forward, float lifetime, float size)
	{
		//IL_000f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0010: Unknown result type (might be due to invalid IL or missing references)
		//IL_0016: Unknown result type (might be due to invalid IL or missing references)
		//IL_0017: Unknown result type (might be due to invalid IL or missing references)
		//IL_001c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0021: Unknown result type (might be due to invalid IL or missing references)
		//IL_0024: Unknown result type (might be due to invalid IL or missing references)
		//IL_0029: Unknown result type (might be due to invalid IL or missing references)
		slam = true;
		kind = ConstructKind.Hammer;
		slamOrigin = origin;
		Vector3 val = Vector3.ProjectOnPlane(forward, Vector3.up);
		aim = ((Vector3)(ref val)).normalized;
		duration = Mathf.Max(0.3f, lifetime);
		scale = size;
		Setup(7f, 4f);
		Apply();
	}

	private void Setup(float lightRange, float lightIntensity)
	{
		//IL_000d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0017: Expected O, but got Unknown
		renderers = ((Component)this).GetComponentsInChildren<Renderer>();
		block = new MaterialPropertyBlock();
		glow = ConstructEffects.AddLight(((Component)this).gameObject, lightRange, lightIntensity);
		glowIntensity = lightIntensity;
	}

	private void LateUpdate()
	{
		age += Time.deltaTime;
		if (age >= duration || (!slam && (Object)(object)hand == (Object)null))
		{
			Object.Destroy((Object)(object)((Component)this).gameObject);
		}
		else
		{
			Apply();
		}
	}

	private void Apply()
	{
		//IL_007d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0082: Unknown result type (might be due to invalid IL or missing references)
		//IL_0087: Unknown result type (might be due to invalid IL or missing references)
		//IL_008c: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
		//IL_009d: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
		//IL_0149: Unknown result type (might be due to invalid IL or missing references)
		//IL_015c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0162: Unknown result type (might be due to invalid IL or missing references)
		//IL_0177: Unknown result type (might be due to invalid IL or missing references)
		//IL_017c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0280: Unknown result type (might be due to invalid IL or missing references)
		//IL_029c: Unknown result type (might be due to invalid IL or missing references)
		//IL_02a1: Unknown result type (might be due to invalid IL or missing references)
		//IL_02e9: Unknown result type (might be due to invalid IL or missing references)
		//IL_0305: Unknown result type (might be due to invalid IL or missing references)
		//IL_030a: Unknown result type (might be due to invalid IL or missing references)
		//IL_02b6: Unknown result type (might be due to invalid IL or missing references)
		//IL_02d2: Unknown result type (might be due to invalid IL or missing references)
		//IL_02d7: Unknown result type (might be due to invalid IL or missing references)
		//IL_0191: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a4: 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_01e5: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ea: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ff: Unknown result type (might be due to invalid IL or missing references)
		//IL_0210: Unknown result type (might be due to invalid IL or missing references)
		//IL_0215: Unknown result type (might be due to invalid IL or missing references)
		//IL_0230: Unknown result type (might be due to invalid IL or missing references)
		//IL_0235: Unknown result type (might be due to invalid IL or missing references)
		//IL_024b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0251: Unknown result type (might be due to invalid IL or missing references)
		//IL_0266: Unknown result type (might be due to invalid IL or missing references)
		//IL_026b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0343: Unknown result type (might be due to invalid IL or missing references)
		//IL_035f: Unknown result type (might be due to invalid IL or missing references)
		//IL_032e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0333: Unknown result type (might be due to invalid IL or missing references)
		float num = Mathf.Clamp01(age / duration);
		float num2 = Mathf.SmoothStep(0f, 1f, Mathf.Clamp01(age / 0.06f));
		float num3 = ((num < 0.6f) ? 1f : Mathf.Lerp(1f, 0f, (num - 0.6f) / 0.4f));
		float num4 = Mathf.SmoothStep(0f, 1f, Mathf.Clamp01(num / 0.45f));
		Quaternion val = Quaternion.LookRotation(aim, Vector3.up);
		if (slam)
		{
			((Component)this).transform.position = slamOrigin;
			((Component)this).transform.rotation = val * Quaternion.Euler(Mathf.Lerp(-35f, 105f, num4), 0f, 0f);
		}
		else
		{
			((Component)this).transform.position = hand.position;
			switch (kind)
			{
			case ConstructKind.Fist:
			case ConstructKind.Glove:
			case ConstructKind.DC_LightFist:
			case ConstructKind.DC_ClosedHand:
			case ConstructKind.DC_RobotHand:
			case ConstructKind.DC_RobotHandL:
			case ConstructKind.DC_KilowogFist:
			case ConstructKind.DC_KilowogHand:
				((Component)this).transform.rotation = val;
				((Component)this).transform.position = hand.position + aim * Mathf.Lerp(0f, 0.55f, num4);
				break;
			case ConstructKind.DC_GloveSpring:
				((Component)this).transform.rotation = val;
				((Component)this).transform.position = hand.position + aim * (Mathf.Lerp(0f, 0.9f, num4) - 0.25f * Mathf.Sin(Mathf.Clamp01((num - 0.45f) / 0.3f) * MathF.PI) * num4);
				break;
			case ConstructKind.DC_Buzzsaw:
				((Component)this).transform.rotation = val * Quaternion.Euler(0f, 0f, 90f) * Quaternion.Euler(0f, age * 1440f, 0f);
				((Component)this).transform.position = hand.position + aim * Mathf.Lerp(0.25f, 1.1f, num4);
				break;
			case ConstructKind.Hammer:
			case ConstructKind.DC_Hammer:
				((Component)this).transform.rotation = val * Quaternion.Euler(Mathf.Lerp(-40f, 110f, num4), 0f, 0f);
				break;
			case ConstructKind.Bat:
				((Component)this).transform.rotation = val * Quaternion.Euler(Mathf.Lerp(125f, -15f, num4), 0f, 0f);
				break;
			case ConstructKind.Mace:
			case ConstructKind.Sword:
				((Component)this).transform.rotation = val * Quaternion.Euler(0f, Mathf.Lerp(35f, -150f, num4), 0f) * Quaternion.Euler(0f, 0f, (kind == ConstructKind.Sword) ? (-80f) : (-95f));
				break;
			}
		}
		((Component)this).transform.localScale = Vector3.one * (scale * Mathf.Lerp(0.2f, 1f, num2));
		ConstructEffects.SetAlpha(renderers, block, num2 * num3);
		if ((Object)(object)glow != (Object)null)
		{
			glow.intensity = glowIntensity * num2 * num3;
		}
	}
}
internal sealed class BoltVisual : MonoBehaviour
{
	private const float Speed = 160f;

	private Vector3 target;

	private Renderer[] renderers;

	private MaterialPropertyBlock block;

	internal void Initialize(Vector3 destination)
	{
		//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_0014: Unknown result type (might be due to invalid IL or missing references)
		//IL_001e: Expected O, but got Unknown
		//IL_0049: Unknown result type (might be due to invalid IL or missing references)
		target = destination;
		renderers = ((Component)this).GetComponentsInChildren<Renderer>();
		block = new MaterialPropertyBlock();
		ConstructEffects.AddLight(((Component)this).gameObject, 3f, 2f);
		((Component)this).transform.localScale = new Vector3(1.2f, 1.2f, 1.6f);
		ConstructEffects.SetAlpha(renderers, block, 1f);
	}

	private void Update()
	{
		//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_0022: Unknown result type (might be due to invalid IL or missing references)
		//IL_0032: Unknown result type (might be due to invalid IL or missing references)
		//IL_0038: Unknown result type (might be due to invalid IL or missing references)
		//IL_003d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0042: Unknown result type (might be due to invalid IL or missing references)
		((Component)this).transform.position = Vector3.MoveTowards(((Component)this).transform.position, target, 160f * Time.deltaTime);
		Vector3 val = ((Component)this).transform.position - target;
		if (((Vector3)(ref val)).sqrMagnitude < 0.01f)
		{
			Object.Destroy((Object)(object)((Component)this).gameObject);
		}
	}
}
internal sealed class BurstVisual : MonoBehaviour
{
	private float scale;

	private float lifetime;

	private float age;

	private Renderer[] renderers;

	private MaterialPropertyBlock block;

	private Light flash;

	private float flashIntensity;

	internal void Initialize(float size, float life)
	{
		//IL_0025: Unknown result type (might be due to invalid IL or missing references)
		//IL_002f: Expected O, but got Unknown
		scale = size;
		lifetime = Mathf.Max(0.05f, life);
		renderers = ((Component)this).GetComponentsInChildren<Renderer>();
		block = new MaterialPropertyBlock();
		flashIntensity = 3f + size;
		flash = ConstructEffects.AddLight(((Component)this).gameObject, 2.5f + size * 1.5f, flashIntensity);
		Apply();
	}

	private void Update()
	{
		age += Time.deltaTime;
		if (age >= lifetime)
		{
			Object.Destroy((Object)(object)((Component)this).gameObject);
		}
		else
		{
			Apply();
		}
	}

	private void Apply()
	{
		//IL_0019: 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)
		fl