using System;
using Cpp2IlInjected;
using UnityEngine;

namespace RootMotion.FinalIK
{
	// Token: 0x02000483 RID: 1155
	[Token(Token = "0x2000483")]
	public class Recoil : OffsetModifier
	{
		// Token: 0x170002A0 RID: 672
		// (get) Token: 0x06002902 RID: 10498 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x170002A0")]
		public bool isFinished
		{
			[Token(Token = "0x6002902")]
			[Address(RVA = "0xBE7150", Offset = "0xBE5F50", VA = "0x180BE7150")]
			get
			{
				throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
			}
		}

		// Token: 0x06002903 RID: 10499 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002903")]
		[Address(RVA = "0xBE70B0", Offset = "0xBE5EB0", VA = "0x180BE70B0")]
		public void SetHandRotations(Quaternion leftHandRotation, Quaternion rightHandRotation)
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002904 RID: 10500 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002904")]
		[Address(RVA = "0xBE5E40", Offset = "0xBE4C40", VA = "0x180BE5E40")]
		public void Fire(float magnitude)
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002905 RID: 10501 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002905")]
		[Address(RVA = "0xBE61F0", Offset = "0xBE4FF0", VA = "0x180BE61F0", Slot = "4")]
		protected override void OnModifyOffset()
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002906 RID: 10502 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002906")]
		[Address(RVA = "0xBE5C90", Offset = "0xBE4A90", VA = "0x180BE5C90")]
		private void AfterFBBIK()
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002907 RID: 10503 RVA: 0x0005A17C File Offset: 0x0005837C
		[Token(Token = "0x6002907")]
		[Address(RVA = "0xBE5C40", Offset = "0xBE4A40", VA = "0x180BE5C40")]
		private void AfterAimIK()
		{
			if (this.aimIKSolvedLast)
			{
				IKSolverAim solver = this.aimIK.solver;
				float z = this.aimIKAxis.z;
				solver.axis.z = z;
			}
		}

		// Token: 0x170002A1 RID: 673
		// (get) Token: 0x06002908 RID: 10504 RVA: 0x0005A1BC File Offset: 0x000583BC
		[Token(Token = "0x170002A1")]
		private IKEffector primaryHandEffector
		{
			[Token(Token = "0x6002908")]
			[Address(RVA = "0xBE7170", Offset = "0xBE5F70", VA = "0x180BE7170")]
			get
			{
				FullBodyBipedIK ik = this.ik;
				if (this.handedness != Recoil.Handedness.Right)
				{
					return ik.solver.leftHandEffector;
				}
				return ik.solver.rightHandEffector;
			}
		}

		// Token: 0x170002A2 RID: 674
		// (get) Token: 0x06002909 RID: 10505 RVA: 0x0005A1F8 File Offset: 0x000583F8
		[Token(Token = "0x170002A2")]
		private IKEffector secondaryHandEffector
		{
			[Token(Token = "0x6002909")]
			[Address(RVA = "0xBE7210", Offset = "0xBE6010", VA = "0x180BE7210")]
			get
			{
				FullBodyBipedIK ik = this.ik;
				if (this.handedness != Recoil.Handedness.Right)
				{
					return ik.solver.rightHandEffector;
				}
				return ik.solver.leftHandEffector;
			}
		}

		// Token: 0x170002A3 RID: 675
		// (get) Token: 0x0600290A RID: 10506 RVA: 0x0005A234 File Offset: 0x00058434
		[Token(Token = "0x170002A3")]
		private Transform primaryHand
		{
			[Token(Token = "0x600290A")]
			[Address(RVA = "0xBE71C0", Offset = "0xBE5FC0", VA = "0x180BE71C0")]
			get
			{
				FullBodyBipedIK ik = this.ik;
				if (this.handedness != Recoil.Handedness.Right)
				{
					IKEffector leftHandEffector = ik.solver.leftHandEffector;
				}
				return ik.solver.rightHandEffector.bone;
			}
		}

		// Token: 0x170002A4 RID: 676
		// (get) Token: 0x0600290B RID: 10507 RVA: 0x0005A274 File Offset: 0x00058474
		[Token(Token = "0x170002A4")]
		private Transform secondaryHand
		{
			[Token(Token = "0x600290B")]
			[Address(RVA = "0xBE7260", Offset = "0xBE6060", VA = "0x180BE7260")]
			get
			{
				FullBodyBipedIK ik = this.ik;
				if (this.handedness != Recoil.Handedness.Right)
				{
					IKEffector rightHandEffector = ik.solver.rightHandEffector;
				}
				return ik.solver.leftHandEffector.bone;
			}
		}

		// Token: 0x0600290C RID: 10508 RVA: 0x0005A2B4 File Offset: 0x000584B4
		[Token(Token = "0x600290C")]
		[Address(RVA = "0xBE5FE0", Offset = "0xBE4DE0", VA = "0x180BE5FE0", Slot = "6")]
		protected override void OnDestroy()
		{
			base.OnDestroy();
			FullBodyBipedIK ik = this.ik;
			int num = 0;
			if (ik != num && this.initiated)
			{
				IKSolverFullBodyBiped solver = this.ik.solver;
				IKSolver.UpdateDelegate onPostUpdate = solver.OnPostUpdate;
				IKSolver.UpdateDelegate updateDelegate = new IKSolver.UpdateDelegate(this.AfterFBBIK);
				Delegate @delegate = Delegate.Remove(onPostUpdate, updateDelegate);
				int num2 = 0;
				if (@delegate == 0 || @delegate != 0)
				{
					solver.OnPostUpdate = num2;
					AimIK aimIK = this.aimIK;
					int num3 = 0;
					if (!(aimIK != num3))
					{
						return;
					}
					IKSolverAim solver2 = this.aimIK.solver;
					IKSolver.UpdateDelegate onPostUpdate2 = solver2.OnPostUpdate;
					IKSolver.UpdateDelegate updateDelegate2 = new IKSolver.UpdateDelegate(this.AfterAimIK);
					Delegate delegate2 = Delegate.Remove(onPostUpdate2, updateDelegate2);
					if (delegate2 == 0 || delegate2 != 0)
					{
						solver2.OnPostUpdate = delegate2;
						return;
					}
				}
				throw new InvalidCastException();
			}
		}

		// Token: 0x0600290D RID: 10509 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x600290D")]
		[Address(RVA = "0xBE70E0", Offset = "0xBE5EE0", VA = "0x180BE70E0")]
		public Recoil()
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x0400323F RID: 12863
		[FieldOffset(Offset = "0x30")]
		[Token(Token = "0x400323F")]
		[Tooltip("Reference to the AimIK component. Optional, only used to getting the aiming direction.")]
		public AimIK aimIK;

		// Token: 0x04003240 RID: 12864
		[FieldOffset(Offset = "0x38")]
		[Token(Token = "0x4003240")]
		[Tooltip("Set this true if you are using IKExecutionOrder.cs or a custom script to force AimIK solve after FBBIK.")]
		public bool aimIKSolvedLast;

		// Token: 0x04003241 RID: 12865
		[FieldOffset(Offset = "0x3C")]
		[Token(Token = "0x4003241")]
		[Tooltip("Which hand is holding the weapon?")]
		public Recoil.Handedness handedness;

		// Token: 0x04003242 RID: 12866
		[FieldOffset(Offset = "0x40")]
		[Token(Token = "0x4003242")]
		[Tooltip("Check for 2-handed weapons.")]
		public bool twoHanded;

		// Token: 0x04003243 RID: 12867
		[FieldOffset(Offset = "0x48")]
		[Token(Token = "0x4003243")]
		[Tooltip("Weight curve for the recoil offsets. Recoil procedure is as long as this curve.")]
		public AnimationCurve recoilWeight;

		// Token: 0x04003244 RID: 12868
		[FieldOffset(Offset = "0x50")]
		[Token(Token = "0x4003244")]
		[Tooltip("How much is the magnitude randomized each time Recoil is called?")]
		public float magnitudeRandom;

		// Token: 0x04003245 RID: 12869
		[FieldOffset(Offset = "0x54")]
		[Token(Token = "0x4003245")]
		[Tooltip("How much is the rotation randomized each time Recoil is called?")]
		public Vector3 rotationRandom;

		// Token: 0x04003246 RID: 12870
		[FieldOffset(Offset = "0x60")]
		[Token(Token = "0x4003246")]
		[Tooltip("Rotating the primary hand bone for the recoil (in local space).")]
		public Vector3 handRotationOffset;

		// Token: 0x04003247 RID: 12871
		[FieldOffset(Offset = "0x6C")]
		[Token(Token = "0x4003247")]
		[Tooltip("Time of blending in another recoil when doing automatic fire.")]
		public float blendTime;

		// Token: 0x04003248 RID: 12872
		[FieldOffset(Offset = "0x70")]
		[Token(Token = "0x4003248")]
		[Space]
		[Space(10f)]
		[Tooltip("FBBIK effector position offsets for the recoil (in aiming direction space).")]
		public Recoil.RecoilOffset[] offsets;

		// Token: 0x04003249 RID: 12873
		[FieldOffset(Offset = "0x78")]
		[Token(Token = "0x4003249")]
		[HideInInspector]
		public Quaternion rotationOffset;

		// Token: 0x0400324A RID: 12874
		[FieldOffset(Offset = "0x88")]
		[Token(Token = "0x400324A")]
		private float magnitudeMlp;

		// Token: 0x0400324B RID: 12875
		[FieldOffset(Offset = "0x8C")]
		[Token(Token = "0x400324B")]
		private float endTime;

		// Token: 0x0400324C RID: 12876
		[FieldOffset(Offset = "0x90")]
		[Token(Token = "0x400324C")]
		private Quaternion handRotation;

		// Token: 0x0400324D RID: 12877
		[FieldOffset(Offset = "0xA0")]
		[Token(Token = "0x400324D")]
		private Quaternion secondaryHandRelativeRotation;

		// Token: 0x0400324E RID: 12878
		[FieldOffset(Offset = "0xB0")]
		[Token(Token = "0x400324E")]
		private Quaternion randomRotation;

		// Token: 0x0400324F RID: 12879
		[FieldOffset(Offset = "0xC0")]
		[Token(Token = "0x400324F")]
		private float length;

		// Token: 0x04003250 RID: 12880
		[FieldOffset(Offset = "0xC4")]
		[Token(Token = "0x4003250")]
		private bool initiated;

		// Token: 0x04003251 RID: 12881
		[FieldOffset(Offset = "0xC8")]
		[Token(Token = "0x4003251")]
		private float blendWeight;

		// Token: 0x04003252 RID: 12882
		[FieldOffset(Offset = "0xCC")]
		[Token(Token = "0x4003252")]
		private float w;

		// Token: 0x04003253 RID: 12883
		[FieldOffset(Offset = "0xD0")]
		[Token(Token = "0x4003253")]
		private Quaternion primaryHandRotation;

		// Token: 0x04003254 RID: 12884
		[FieldOffset(Offset = "0xE0")]
		[Token(Token = "0x4003254")]
		private bool handRotationsSet;

		// Token: 0x04003255 RID: 12885
		[FieldOffset(Offset = "0xE4")]
		[Token(Token = "0x4003255")]
		private Vector3 aimIKAxis;

		// Token: 0x02000484 RID: 1156
		[Token(Token = "0x2000484")]
		[Serializable]
		public class RecoilOffset
		{
			// Token: 0x0600290E RID: 10510 RVA: 0x000020D3 File Offset: 0x000002D3
			[Token(Token = "0x600290E")]
			[Address(RVA = "0x6A0250", Offset = "0x69F050", VA = "0x1806A0250")]
			public void Start()
			{
				throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
			}

			// Token: 0x0600290F RID: 10511 RVA: 0x000020D3 File Offset: 0x000002D3
			[Token(Token = "0x600290F")]
			[Address(RVA = "0x69FFA0", Offset = "0x69EDA0", VA = "0x18069FFA0")]
			public void Apply(IKSolverFullBodyBiped solver, Quaternion rotation, float masterWeight, float length, float timeLeft)
			{
				throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
			}

			// Token: 0x06002910 RID: 10512 RVA: 0x0005A390 File Offset: 0x00058590
			[Token(Token = "0x6002910")]
			[Address(RVA = "0x6A0300", Offset = "0x69F100", VA = "0x1806A0300")]
			public RecoilOffset()
			{
			}

			// Token: 0x04003256 RID: 12886
			[FieldOffset(Offset = "0x10")]
			[Token(Token = "0x4003256")]
			[Tooltip("Offset vector for the associated effector when doing recoil.")]
			public Vector3 offset;

			// Token: 0x04003257 RID: 12887
			[FieldOffset(Offset = "0x1C")]
			[Token(Token = "0x4003257")]
			[Range(0f, 1f)]
			[Tooltip("When firing before the last recoil has faded, how much of the current recoil offset will be maintained?")]
			public float additivity = 1f;

			// Token: 0x04003258 RID: 12888
			[FieldOffset(Offset = "0x20")]
			[Token(Token = "0x4003258")]
			[Tooltip("Max additive recoil for automatic fire.")]
			public float maxAdditiveOffsetMag = 0.2f;

			// Token: 0x04003259 RID: 12889
			[FieldOffset(Offset = "0x28")]
			[Token(Token = "0x4003259")]
			[Tooltip("Linking this recoil offset to FBBIK effectors.")]
			public Recoil.RecoilOffset.EffectorLink[] effectorLinks;

			// Token: 0x0400325A RID: 12890
			[FieldOffset(Offset = "0x30")]
			[Token(Token = "0x400325A")]
			private Vector3 additiveOffset;

			// Token: 0x0400325B RID: 12891
			[FieldOffset(Offset = "0x3C")]
			[Token(Token = "0x400325B")]
			private Vector3 lastOffset;

			// Token: 0x02000485 RID: 1157
			[Token(Token = "0x2000485")]
			[Serializable]
			public class EffectorLink
			{
				// Token: 0x06002911 RID: 10513 RVA: 0x0003883F File Offset: 0x00036A3F
				[Token(Token = "0x6002911")]
				[Address(RVA = "0x3D8B20", Offset = "0x3D7920", VA = "0x1803D8B20")]
				public EffectorLink()
				{
				}

				// Token: 0x0400325C RID: 12892
				[FieldOffset(Offset = "0x10")]
				[Token(Token = "0x400325C")]
				[Tooltip("Type of the FBBIK effector to use")]
				public FullBodyBipedEffector effector;

				// Token: 0x0400325D RID: 12893
				[FieldOffset(Offset = "0x14")]
				[Token(Token = "0x400325D")]
				[Tooltip("Weight of using this effector")]
				public float weight;
			}
		}

		// Token: 0x02000486 RID: 1158
		[Token(Token = "0x2000486")]
		[Serializable]
		public enum Handedness
		{
			// Token: 0x0400325F RID: 12895
			[Token(Token = "0x400325F")]
			Right,
			// Token: 0x04003260 RID: 12896
			[Token(Token = "0x4003260")]
			Left
		}
	}
}
