Decompiled source of MoreHuntressSkills v0.7.5

plugins/HuntressSkills.dll

Decompiled 2 days ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using EntityStates;
using EntityStates.GravekeeperBoss;
using EntityStates.Huntress;
using EntityStates.Huntress.HuntressWeapon;
using EntityStates.Huntress.Weapon;
using HuntressSkills.Skills;
using Microsoft.CodeAnalysis;
using On.EntityStates;
using On.RoR2;
using R2API;
using RoR2;
using RoR2.Orbs;
using RoR2.Skills;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.Networking;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("HuntressSkills")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+054f0df2b0fd7e764e0c97a7852d70dd5cdd7801")]
[assembly: AssemblyProduct("HuntressSkills")]
[assembly: AssemblyTitle("HuntressSkills")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace HuntressSkills
{
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("pablest.MoreHuntressSkills", "MoreHuntressSkills", "0.7.0")]
	public class HuntressSkillsPlugin : BaseUnityPlugin
	{
		public const string PluginGUID = "pablest.MoreHuntressSkills";

		public const string PluginAuthor = "pablest";

		public const string PluginName = "MoreHuntressSkills";

		public const string PluginVersion = "0.7.0";

		public const string DEVELOPER_PREFIX = "PBLST";

		public static AssetBundle mainAssets;

		public static string assetBundleFolder = "Assets";

		public static string assetName = "icons";

		public static PluginInfo PInfo { get; private set; }

		private void Awake()
		{
			PInfo = ((BaseUnityPlugin)this).Info;
			string text = Path.Combine(Path.GetDirectoryName(PInfo.Location), assetBundleFolder, assetName);
			mainAssets = AssetBundle.LoadFromFile(text);
			TranceFire.Initialize(this);
			SplittingGlaive.Initialize(this);
			StalkingThePrey.Initialize(this);
			SwiftManeuver.Initialize(this);
		}
	}
	internal static class Log
	{
		private static ManualLogSource _logSource;

		internal static void Init(ManualLogSource logSource)
		{
			_logSource = logSource;
		}

		internal static void Debug(object data)
		{
			_logSource.LogDebug(data);
		}

		internal static void Error(object data)
		{
			_logSource.LogError(data);
		}

		internal static void Fatal(object data)
		{
			_logSource.LogFatal(data);
		}

		internal static void Info(object data)
		{
			_logSource.LogInfo(data);
		}

		internal static void Message(object data)
		{
			_logSource.LogMessage(data);
		}

		internal static void Warning(object data)
		{
			_logSource.LogWarning(data);
		}
	}
	internal class MyAssets
	{
	}
}
namespace HuntressSkills.Skills
{
	public class FireHeavyArrow
	{
		public class HuntressTargetSkillDef : SkillDef
		{
			public override bool CanExecute(GenericSkill skillSlot)
			{
				if (((SkillDef)this).CanExecute(skillSlot))
				{
					CharacterBody characterBody = skillSlot.characterBody;
					if (Object.op_Implicit((Object)(object)characterBody))
					{
						HuntressTracker component = ((Component)characterBody).GetComponent<HuntressTracker>();
						return Object.op_Implicit((Object)(object)component) && (Object)(object)component.GetTrackingTarget() != (Object)null;
					}
				}
				return false;
			}
		}

		public class FireHeavyArrowAttack : BaseSkillState
		{
			public float orbDamageCoefficient = 5f;

			public float orbProcCoefficient = 3f;

			public float attackSpeedDamageConversion = 3f;

			public float attackSpeedProcConversion = 2f;

			public float fixedAttackSpeed = 1f;

			[SerializeField]
			public string muzzleString;

			[SerializeField]
			public GameObject muzzleflashEffectPrefab;

			[SerializeField]
			public string attackSoundString;

			public float baseDuration = 1.5f;

			public float baseArrowReloadDuration = 0f;

			private float duration;

			protected float arrowReloadTimer;

			protected bool isCrit;

			private int firedArrowCount = 0;

			private HurtBox initialOrbTarget;

			private ChildLocator childLocator;

			private HuntressTracker huntressTracker;

			private Animator animator;

			public override void OnEnter()
			{
				//IL_0008: Unknown result type (might be due to invalid IL or missing references)
				//IL_000e: Expected O, but got Unknown
				((BaseState)this).OnEnter();
				FireSeekingArrow val = new FireSeekingArrow();
				muzzleString = val.muzzleString;
				muzzleflashEffectPrefab = val.muzzleflashEffectPrefab;
				attackSoundString = val.attackSoundString;
				Transform modelTransform = ((EntityState)this).GetModelTransform();
				huntressTracker = ((EntityState)this).GetComponent<HuntressTracker>();
				if (Object.op_Implicit((Object)(object)modelTransform))
				{
					childLocator = ((Component)modelTransform).GetComponent<ChildLocator>();
					animator = ((Component)modelTransform).GetComponent<Animator>();
				}
				Util.PlayAttackSpeedSound(attackSoundString, ((EntityState)this).gameObject, fixedAttackSpeed);
				if (Object.op_Implicit((Object)(object)huntressTracker) && ((EntityState)this).isAuthority)
				{
					initialOrbTarget = huntressTracker.GetTrackingTarget();
				}
				duration = baseDuration / fixedAttackSpeed;
				arrowReloadTimer = baseArrowReloadDuration / fixedAttackSpeed;
				if (Object.op_Implicit((Object)(object)((EntityState)this).characterBody))
				{
					((EntityState)this).characterBody.SetAimTimer(duration + 1f);
				}
				((EntityState)this).PlayCrossfade("Gesture, Override", "FireSeekingShot", "FireSeekingShot.playbackRate", duration, duration * 1f / fixedAttackSpeed);
				((EntityState)this).PlayCrossfade("Gesture, Additive", "FireSeekingShot", "FireSeekingShot.playbackRate", duration, duration * 0.2f / fixedAttackSpeed);
				isCrit = Util.CheckRoll(((EntityState)this).characterBody.crit, ((EntityState)this).characterBody.master);
			}

			public override void OnExit()
			{
				((EntityState)this).OnExit();
			}

			protected virtual GenericDamageOrb CreateArrowOrb()
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				//IL_0007: Expected O, but got Unknown
				return (GenericDamageOrb)new HuntressArrowOrb();
			}

			private void FireOrbArrow()
			{
				//IL_0094: Unknown result type (might be due to invalid IL or missing references)
				//IL_0099: Unknown result type (might be due to invalid IL or missing references)
				//IL_00b1: 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_0130: Unknown result type (might be due to invalid IL or missing references)
				//IL_0135: Unknown result type (might be due to invalid IL or missing references)
				if (firedArrowCount < 1 && !(arrowReloadTimer > 0f) && NetworkServer.active)
				{
					firedArrowCount++;
					float num = Math.Max(0f, attackSpeedDamageConversion * (((BaseState)this).attackSpeedStat - 1f));
					float num2 = Math.Max(0f, attackSpeedProcConversion * (((BaseState)this).attackSpeedStat - 1f));
					GenericDamageOrb val = CreateArrowOrb();
					val.damageValue = ((EntityState)this).characterBody.damage * (orbDamageCoefficient + num);
					val.damageType = DamageTypeCombo.op_Implicit((DamageType)2);
					val.isCrit = isCrit;
					val.teamIndex = TeamComponent.GetObjectTeam(((EntityState)this).gameObject);
					val.attacker = ((EntityState)this).gameObject;
					val.procCoefficient = orbProcCoefficient + num2;
					val.speed = 7f;
					val.scale = 50f;
					HurtBox val2 = initialOrbTarget;
					if (Object.op_Implicit((Object)(object)val2))
					{
						Transform val3 = childLocator.FindChild(muzzleString);
						EffectManager.SimpleMuzzleFlash(muzzleflashEffectPrefab, ((EntityState)this).gameObject, muzzleString, true);
						((Orb)val).origin = val3.position;
						((Orb)val).target = val2;
						OrbManager.instance.AddOrb((Orb)(object)val);
					}
				}
			}

			public override void FixedUpdate()
			{
				((EntityState)this).FixedUpdate();
				arrowReloadTimer -= Time.fixedDeltaTime;
				if (animator.GetFloat("FireSeekingShot.fire") > 0f)
				{
					FireOrbArrow();
				}
				if (((EntityState)this).fixedAge > duration && ((EntityState)this).isAuthority)
				{
					((EntityState)this).outer.SetNextStateToMain();
				}
			}

			public override InterruptPriority GetMinimumInterruptPriority()
			{
				//IL_0002: 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)
				return (InterruptPriority)1;
			}
		}

		public static void Initialize(HuntressSkillsPlugin pluginInfo)
		{
			//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_0046: 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_008b: 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_0141: Unknown result type (might be due to invalid IL or missing references)
			//IL_014b: Expected O, but got Unknown
			//IL_014c: 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)
			GameObject val = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Huntress/HuntressBody.prefab").WaitForCompletion();
			LanguageAPI.Add("PBLSTHUNTRESS_PRIMARY_FIREHEAVYARROW_NAME", "Heavy Arrow");
			LanguageAPI.Add("PBLSTHUNTRESS_PRIMARY_FIREHEAVYARROW_DESCRIPTION", "Fire a boomerang for <style=cIsDamage>300% damage</style>.");
			SkillDef val2 = (SkillDef)(object)ScriptableObject.CreateInstance<HuntressTargetSkillDef>();
			val2.activationState = new SerializableEntityStateType(typeof(FireHeavyArrowAttack));
			val2.activationStateMachineName = "Weapon";
			val2.baseMaxStock = 1;
			val2.baseRechargeInterval = 0f;
			val2.beginSkillCooldownOnSkillEnd = false;
			val2.canceledFromSprinting = false;
			val2.cancelSprintingOnActivation = false;
			val2.fullRestockOnAssign = true;
			val2.interruptPriority = (InterruptPriority)0;
			val2.isCombatSkill = true;
			val2.mustKeyPress = false;
			val2.rechargeStock = 1;
			val2.requiredStock = 1;
			val2.stockToConsume = 1;
			val2.icon = null;
			val2.skillDescriptionToken = "PBLSTHUNTRESS_PRIMARY_FIREHEAVYARROW_DESCRIPTION";
			val2.skillName = "PBLSTHUNTRESS_PRIMARY_FIREHEAVYARROW_NAME";
			val2.skillNameToken = "PBLSTHUNTRESS_PRIMARY_FIREHEAVYARROW_NAME";
			ContentAddition.AddSkillDef(val2);
			SkillLocator component = val.GetComponent<SkillLocator>();
			SkillFamily skillFamily = component.primary.skillFamily;
			Array.Resize(ref skillFamily.variants, skillFamily.variants.Length + 1);
			Variant[] variants = skillFamily.variants;
			int num = skillFamily.variants.Length - 1;
			Variant val3 = new Variant
			{
				skillDef = val2,
				unlockableName = ""
			};
			((Variant)(ref val3)).viewableNode = new Node(val2.skillNameToken, false, (Node)null);
			variants[num] = val3;
		}
	}
	public class FireChargeArrow
	{
		public class HuntressTargetSkillDef : SkillDef
		{
			public override bool CanExecute(GenericSkill skillSlot)
			{
				if (((SkillDef)this).CanExecute(skillSlot))
				{
					CharacterBody characterBody = skillSlot.characterBody;
					if (Object.op_Implicit((Object)(object)characterBody))
					{
						HuntressTracker component = ((Component)characterBody).GetComponent<HuntressTracker>();
						return Object.op_Implicit((Object)(object)component) && (Object)(object)component.GetTrackingTarget() != (Object)null;
					}
				}
				return false;
			}
		}

		public class FireHeavyArrowAttack : BaseSkillState
		{
			public float orbDamageCoefficient = 5f;

			public float orbProcCoefficient = 3f;

			public float attackSpeedDamageConversion = 3f;

			public float attackSpeedProcConversion = 2f;

			public float fixedAttackSpeed = 1f;

			[SerializeField]
			public string muzzleString;

			[SerializeField]
			public GameObject muzzleflashEffectPrefab;

			[SerializeField]
			public string attackSoundString;

			public float baseDuration = 1.5f;

			public float baseArrowReloadDuration = 0f;

			private float duration;

			protected float arrowReloadTimer;

			protected bool isCrit;

			private int firedArrowCount = 0;

			private HurtBox initialOrbTarget;

			private ChildLocator childLocator;

			private HuntressTracker huntressTracker;

			private Animator animator;

			public override void OnEnter()
			{
				//IL_0008: Unknown result type (might be due to invalid IL or missing references)
				//IL_000e: Expected O, but got Unknown
				((BaseState)this).OnEnter();
				FireSeekingArrow val = new FireSeekingArrow();
				muzzleString = val.muzzleString;
				muzzleflashEffectPrefab = val.muzzleflashEffectPrefab;
				attackSoundString = val.attackSoundString;
				Transform modelTransform = ((EntityState)this).GetModelTransform();
				huntressTracker = ((EntityState)this).GetComponent<HuntressTracker>();
				if (Object.op_Implicit((Object)(object)modelTransform))
				{
					childLocator = ((Component)modelTransform).GetComponent<ChildLocator>();
					animator = ((Component)modelTransform).GetComponent<Animator>();
				}
				Util.PlayAttackSpeedSound(attackSoundString, ((EntityState)this).gameObject, fixedAttackSpeed);
				if (Object.op_Implicit((Object)(object)huntressTracker) && ((EntityState)this).isAuthority)
				{
					initialOrbTarget = huntressTracker.GetTrackingTarget();
				}
				duration = baseDuration / fixedAttackSpeed;
				arrowReloadTimer = baseArrowReloadDuration / fixedAttackSpeed;
				if (Object.op_Implicit((Object)(object)((EntityState)this).characterBody))
				{
					((EntityState)this).characterBody.SetAimTimer(duration + 1f);
				}
				((EntityState)this).PlayCrossfade("Gesture, Override", "FireSeekingShot", "FireSeekingShot.playbackRate", duration, duration * 1f / fixedAttackSpeed);
				((EntityState)this).PlayCrossfade("Gesture, Additive", "FireSeekingShot", "FireSeekingShot.playbackRate", duration, duration * 0.2f / fixedAttackSpeed);
				isCrit = Util.CheckRoll(((EntityState)this).characterBody.crit, ((EntityState)this).characterBody.master);
			}

			public override void OnExit()
			{
				((EntityState)this).OnExit();
			}

			protected virtual GenericDamageOrb CreateArrowOrb()
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				//IL_0007: Expected O, but got Unknown
				return (GenericDamageOrb)new HuntressArrowOrb();
			}

			private void FireOrbArrow()
			{
				//IL_0094: Unknown result type (might be due to invalid IL or missing references)
				//IL_0099: Unknown result type (might be due to invalid IL or missing references)
				//IL_00b1: 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_0130: Unknown result type (might be due to invalid IL or missing references)
				//IL_0135: Unknown result type (might be due to invalid IL or missing references)
				if (firedArrowCount < 1 && !(arrowReloadTimer > 0f) && NetworkServer.active)
				{
					firedArrowCount++;
					float num = Math.Max(0f, attackSpeedDamageConversion * (((BaseState)this).attackSpeedStat - 1f));
					float num2 = Math.Max(0f, attackSpeedProcConversion * (((BaseState)this).attackSpeedStat - 1f));
					GenericDamageOrb val = CreateArrowOrb();
					val.damageValue = ((EntityState)this).characterBody.damage * (orbDamageCoefficient + num);
					val.damageType = DamageTypeCombo.op_Implicit((DamageType)2);
					val.isCrit = isCrit;
					val.teamIndex = TeamComponent.GetObjectTeam(((EntityState)this).gameObject);
					val.attacker = ((EntityState)this).gameObject;
					val.procCoefficient = orbProcCoefficient + num2;
					val.speed = 7f;
					val.scale = 50f;
					HurtBox val2 = initialOrbTarget;
					if (Object.op_Implicit((Object)(object)val2))
					{
						Transform val3 = childLocator.FindChild(muzzleString);
						EffectManager.SimpleMuzzleFlash(muzzleflashEffectPrefab, ((EntityState)this).gameObject, muzzleString, true);
						((Orb)val).origin = val3.position;
						((Orb)val).target = val2;
						OrbManager.instance.AddOrb((Orb)(object)val);
					}
				}
			}

			public override void FixedUpdate()
			{
				((EntityState)this).FixedUpdate();
				arrowReloadTimer -= Time.fixedDeltaTime;
				if (animator.GetFloat("FireSeekingShot.fire") > 0f)
				{
					FireOrbArrow();
				}
				if (((EntityState)this).fixedAge > duration && ((EntityState)this).isAuthority)
				{
					((EntityState)this).outer.SetNextStateToMain();
				}
			}

			public override InterruptPriority GetMinimumInterruptPriority()
			{
				//IL_0002: 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)
				return (InterruptPriority)1;
			}
		}

		public static void Initialize(HuntressSkillsPlugin pluginInfo)
		{
			//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_0046: 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_008b: 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_0141: Unknown result type (might be due to invalid IL or missing references)
			//IL_014b: Expected O, but got Unknown
			//IL_014c: 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)
			GameObject val = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Huntress/HuntressBody.prefab").WaitForCompletion();
			LanguageAPI.Add("PBLSTHUNTRESS_PRIMARY_FIREHEAVYARROW_NAME", "Heavy Arrow");
			LanguageAPI.Add("PBLSTHUNTRESS_PRIMARY_FIREHEAVYARROW_DESCRIPTION", "Fire a boomerang for <style=cIsDamage>300% damage</style>.");
			SkillDef val2 = (SkillDef)(object)ScriptableObject.CreateInstance<HuntressTargetSkillDef>();
			val2.activationState = new SerializableEntityStateType(typeof(FireHeavyArrowAttack));
			val2.activationStateMachineName = "Weapon";
			val2.baseMaxStock = 1;
			val2.baseRechargeInterval = 0f;
			val2.beginSkillCooldownOnSkillEnd = false;
			val2.canceledFromSprinting = false;
			val2.cancelSprintingOnActivation = false;
			val2.fullRestockOnAssign = true;
			val2.interruptPriority = (InterruptPriority)0;
			val2.isCombatSkill = true;
			val2.mustKeyPress = false;
			val2.rechargeStock = 1;
			val2.requiredStock = 1;
			val2.stockToConsume = 1;
			val2.icon = null;
			val2.skillDescriptionToken = "PBLSTHUNTRESS_PRIMARY_FIREHEAVYARROW_DESCRIPTION";
			val2.skillName = "PBLSTHUNTRESS_PRIMARY_FIREHEAVYARROW_NAME";
			val2.skillNameToken = "PBLSTHUNTRESS_PRIMARY_FIREHEAVYARROW_NAME";
			ContentAddition.AddSkillDef(val2);
			SkillLocator component = val.GetComponent<SkillLocator>();
			SkillFamily skillFamily = component.primary.skillFamily;
			Array.Resize(ref skillFamily.variants, skillFamily.variants.Length + 1);
			Variant[] variants = skillFamily.variants;
			int num = skillFamily.variants.Length - 1;
			Variant val3 = new Variant
			{
				skillDef = val2,
				unlockableName = ""
			};
			((Variant)(ref val3)).viewableNode = new Node(val2.skillNameToken, false, (Node)null);
			variants[num] = val3;
		}
	}
	public class SplittingGlaive
	{
		public class HuntressTargetSkillDef : SkillDef
		{
			public override bool CanExecute(GenericSkill skillSlot)
			{
				if (((SkillDef)this).CanExecute(skillSlot))
				{
					CharacterBody characterBody = skillSlot.characterBody;
					if (Object.op_Implicit((Object)(object)characterBody))
					{
						HuntressTracker component = ((Component)characterBody).GetComponent<HuntressTracker>();
						return Object.op_Implicit((Object)(object)component) && (Object)(object)component.GetTrackingTarget() != (Object)null;
					}
				}
				return false;
			}
		}

		public class SplittingGlaiveAttack : BaseSkillState
		{
			public float baseDuration = 1f;

			private float duration;

			public static float smallHopStrength = 1f;

			public static float antigravityStrength = 20f;

			public static float damageCoefficient = 4.6f;

			public static float damageCoefficientPerBounce = 0.7f;

			public static float glaiveProcCoefficient = 0.8f;

			public static int maxBounceCount = 3;

			public static float glaiveTravelSpeed = 45f;

			public static float glaiveBounceRange = 30f;

			public static GameObject chargePrefab = ThrowGlaive.chargePrefab;

			public static GameObject muzzleFlashPrefab = ThrowGlaive.muzzleFlashPrefab;

			private GameObject chargeEffect;

			private Animator animator;

			private float stopwatch;

			private HuntressTracker huntressTracker;

			private Transform modelTransform;

			private HurtBox initialOrbTarget;

			private ChildLocator childLocator;

			private bool hasTriedToThrowGlaive = false;

			private bool hasSuccessfullyThrownGlaive = false;

			public override void OnEnter()
			{
				//IL_0168: 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)
				((BaseState)this).OnEnter();
				stopwatch = 0f;
				duration = baseDuration / ((BaseState)this).attackSpeedStat;
				modelTransform = ((EntityState)this).GetModelTransform();
				animator = ((EntityState)this).GetModelAnimator();
				huntressTracker = ((EntityState)this).GetComponent<HuntressTracker>();
				Util.PlaySound(ThrowGlaive.attackSoundString, ((EntityState)this).gameObject);
				if (Object.op_Implicit((Object)(object)huntressTracker) && ((EntityState)this).isAuthority)
				{
					initialOrbTarget = huntressTracker.GetTrackingTarget();
				}
				if (!Object.op_Implicit((Object)(object)initialOrbTarget))
				{
					return;
				}
				if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && smallHopStrength != 0f)
				{
					((EntityState)this).characterMotor.velocity.y = smallHopStrength;
				}
				((EntityState)this).PlayAnimation("FullBody, Override", "ThrowGlaive", "ThrowGlaive.playbackRate", duration, 0f);
				if (Object.op_Implicit((Object)(object)modelTransform))
				{
					childLocator = ((Component)modelTransform).GetComponent<ChildLocator>();
					if (Object.op_Implicit((Object)(object)childLocator))
					{
						Transform val = childLocator.FindChild("HandR");
						if (Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)chargePrefab))
						{
							chargeEffect = Object.Instantiate<GameObject>(chargePrefab, val.position, val.rotation);
							chargeEffect.transform.parent = val;
						}
					}
				}
				if (Object.op_Implicit((Object)(object)((EntityState)this).characterBody))
				{
					((EntityState)this).characterBody.SetAimTimer(duration);
				}
			}

			public override void OnExit()
			{
				((EntityState)this).OnExit();
				if (Object.op_Implicit((Object)(object)chargeEffect))
				{
					EntityState.Destroy((Object)(object)chargeEffect);
				}
				int layerIndex = animator.GetLayerIndex("Impact");
				if (layerIndex >= 0)
				{
					animator.SetLayerWeight(layerIndex, 1.5f);
					animator.PlayInFixedTime("LightImpact", layerIndex, 0f);
				}
				if (!hasTriedToThrowGlaive)
				{
					FireOrbGlaive();
				}
				if (!hasSuccessfullyThrownGlaive && NetworkServer.active)
				{
					((EntityState)this).skillLocator.secondary.AddOneStock();
				}
			}

			public override void FixedUpdate()
			{
				((EntityState)this).FixedUpdate();
				stopwatch += Time.fixedDeltaTime;
				if (!hasTriedToThrowGlaive && animator.GetFloat("ThrowGlaive.fire") > 0f)
				{
					if (Object.op_Implicit((Object)(object)chargeEffect))
					{
						EntityState.Destroy((Object)(object)chargeEffect);
					}
					FireOrbGlaive();
				}
				((EntityState)this).characterMotor.velocity.y += antigravityStrength * Time.fixedDeltaTime * (1f - stopwatch / duration);
				if (stopwatch >= duration && ((EntityState)this).isAuthority)
				{
					((EntityState)this).outer.SetNextStateToMain();
				}
			}

			private void FireOrbGlaive()
			{
				//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_0105: 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)
				if (NetworkServer.active && !hasTriedToThrowGlaive)
				{
					hasTriedToThrowGlaive = true;
					DividingGlaiveOrb dividingGlaiveOrb = new DividingGlaiveOrb();
					dividingGlaiveOrb.damageValue = ((EntityState)this).characterBody.damage * damageCoefficient;
					dividingGlaiveOrb.isCrit = Util.CheckRoll(((EntityState)this).characterBody.crit, ((EntityState)this).characterBody.master);
					dividingGlaiveOrb.teamIndex = TeamComponent.GetObjectTeam(((EntityState)this).gameObject);
					dividingGlaiveOrb.attacker = ((EntityState)this).gameObject;
					dividingGlaiveOrb.procCoefficient = glaiveProcCoefficient;
					dividingGlaiveOrb.bouncesRemaining = maxBounceCount;
					dividingGlaiveOrb.speed = glaiveTravelSpeed;
					dividingGlaiveOrb.bouncedObjects = new List<HealthComponent>();
					dividingGlaiveOrb.range = glaiveBounceRange;
					dividingGlaiveOrb.damageCoefficientPerBounce = damageCoefficientPerBounce;
					HurtBox val = initialOrbTarget;
					if (Object.op_Implicit((Object)(object)val))
					{
						hasSuccessfullyThrownGlaive = true;
						Transform val2 = childLocator.FindChild("HandR");
						EffectManager.SimpleMuzzleFlash(muzzleFlashPrefab, ((EntityState)this).gameObject, "HandR", true);
						((Orb)dividingGlaiveOrb).origin = val2.position;
						((Orb)dividingGlaiveOrb).target = val;
						OrbManager.instance.AddOrb((Orb)(object)dividingGlaiveOrb);
					}
				}
			}

			public override InterruptPriority GetMinimumInterruptPriority()
			{
				//IL_0002: 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)
				return (InterruptPriority)1;
			}
		}

		public class DividingGlaiveOrb : Orb
		{
			public float speed = 100f;

			public int glaiveSplitCount = 2;

			public float damageValue;

			public GameObject attacker;

			public GameObject inflictor;

			public int bouncesRemaining;

			public List<HealthComponent> bouncedObjects;

			public TeamIndex teamIndex;

			public bool isCrit;

			public ProcChainMask procChainMask;

			public float procCoefficient = 1f;

			public DamageColorIndex damageColorIndex;

			public float range = 40f;

			public float damageCoefficientPerBounce = 0.75f;

			public DamageType damageType;

			private BullseyeSearch search;

			public static string path = "Prefabs/Effects/OrbEffects/HuntressGlaiveOrbEffect";

			public float currentReductionRatio = 1f;

			public float reductionPerBounce = 0.5f;

			public override void Begin()
			{
				//IL_0021: 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_0028: Unknown result type (might be due to invalid IL or missing references)
				//IL_0033: 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_004c: Expected O, but got Unknown
				((Orb)this).duration = 0.1f;
				((Orb)this).duration = ((Orb)this).distanceToTarget / speed;
				EffectData val = new EffectData
				{
					origin = base.origin,
					genericFloat = ((Orb)this).duration,
					scale = currentReductionRatio
				};
				val.SetHurtBoxReference(base.target);
				EffectManager.SpawnEffect(LegacyResourcesAPI.Load<GameObject>(path), val, true);
			}

			public override void OnArrival()
			{
				//IL_0033: Unknown result type (might be due to invalid IL or missing references)
				//IL_003a: Expected O, but got Unknown
				//IL_0063: Unknown result type (might be due to invalid IL or missing references)
				//IL_0068: Unknown result type (might be due to invalid IL or missing references)
				//IL_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_00a1: Unknown result type (might be due to invalid IL or missing references)
				//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
				//IL_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_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_00c5: 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_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_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_0220: Unknown result type (might be due to invalid IL or missing references)
				//IL_0225: Unknown result type (might be due to invalid IL or missing references)
				//IL_023a: Unknown result type (might be due to invalid IL or missing references)
				//IL_023f: Unknown result type (might be due to invalid IL or missing references)
				//IL_026e: 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)
				if (!Object.op_Implicit((Object)(object)base.target))
				{
					return;
				}
				HealthComponent healthComponent = base.target.healthComponent;
				if (Object.op_Implicit((Object)(object)healthComponent))
				{
					DamageInfo val = new DamageInfo();
					val.damage = damageValue;
					val.attacker = attacker;
					val.inflictor = inflictor;
					val.force = Vector3.zero;
					val.crit = isCrit;
					val.procChainMask = procChainMask;
					val.procCoefficient = procCoefficient;
					val.position = ((Component)base.target).transform.position;
					val.damageColorIndex = damageColorIndex;
					val.damageType = DamageTypeCombo.op_Implicit(damageType);
					healthComponent.TakeDamage(val);
					GlobalEventManager.instance.OnHitEnemy(val, ((Component)healthComponent).gameObject);
					GlobalEventManager.instance.OnHitAll(val, ((Component)healthComponent).gameObject);
				}
				bool flag = !Object.op_Implicit((Object)(object)healthComponent) || healthComponent.alive;
				if (bouncesRemaining <= 0)
				{
					return;
				}
				if (bouncedObjects != null)
				{
					bouncedObjects.Clear();
					bouncedObjects.Add(base.target.healthComponent);
				}
				for (int i = 0; i < glaiveSplitCount; i++)
				{
					HurtBox val2 = PickNextTarget(((Component)base.target).transform.position);
					if (Object.op_Implicit((Object)(object)val2))
					{
						DividingGlaiveOrb dividingGlaiveOrb = new DividingGlaiveOrb();
						dividingGlaiveOrb.search = search;
						((Orb)dividingGlaiveOrb).origin = ((Component)base.target).transform.position;
						((Orb)dividingGlaiveOrb).target = val2;
						dividingGlaiveOrb.attacker = attacker;
						dividingGlaiveOrb.inflictor = inflictor;
						dividingGlaiveOrb.teamIndex = teamIndex;
						dividingGlaiveOrb.damageValue = damageValue * damageCoefficientPerBounce;
						dividingGlaiveOrb.bouncesRemaining = bouncesRemaining - 1;
						dividingGlaiveOrb.isCrit = isCrit;
						dividingGlaiveOrb.bouncedObjects = bouncedObjects;
						dividingGlaiveOrb.procChainMask = procChainMask;
						dividingGlaiveOrb.procCoefficient = procCoefficient;
						dividingGlaiveOrb.damageColorIndex = damageColorIndex;
						dividingGlaiveOrb.damageCoefficientPerBounce = damageCoefficientPerBounce;
						dividingGlaiveOrb.speed = speed;
						dividingGlaiveOrb.range = range;
						dividingGlaiveOrb.damageType = damageType;
						dividingGlaiveOrb.currentReductionRatio = currentReductionRatio * reductionPerBounce;
						dividingGlaiveOrb.reductionPerBounce = reductionPerBounce;
						OrbManager.instance.AddOrb((Orb)(object)dividingGlaiveOrb);
					}
				}
			}

			public HurtBox PickNextTarget(Vector3 position)
			{
				//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)
				//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_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)
				//IL_0053: 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_0010: Unknown result type (might be due to invalid IL or missing references)
				//IL_001a: Expected O, but got Unknown
				if (search == null)
				{
					search = new BullseyeSearch();
				}
				search.searchOrigin = position;
				search.searchDirection = Vector3.zero;
				search.teamMaskFilter = TeamMask.allButNeutral;
				((TeamMask)(ref search.teamMaskFilter)).RemoveTeam(teamIndex);
				search.filterByLoS = false;
				search.sortMode = (SortMode)1;
				search.maxDistanceFilter = range;
				search.RefreshCandidates();
				HurtBox val = (from v in search.GetResults()
					where !bouncedObjects.Contains(v.healthComponent)
					select v).FirstOrDefault();
				if (Object.op_Implicit((Object)(object)val))
				{
					bouncedObjects.Add(val.healthComponent);
				}
				return val;
			}
		}

		public static void Initialize(HuntressSkillsPlugin pluginInfo)
		{
			//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_0046: 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_008b: Unknown result type (might be due to invalid IL or missing references)
			//IL_012b: Unknown result type (might be due to invalid IL or missing references)
			//IL_014f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0159: Expected O, but got Unknown
			//IL_015a: 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)
			GameObject val = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Huntress/HuntressBody.prefab").WaitForCompletion();
			LanguageAPI.Add("PBLSTHUNTRESS_SECONDARY_SPLITTINGGLAIVE_NAME", "Splitting Glaive");
			LanguageAPI.Add("PBLSTHUNTRESS_SECONDARY_SPLITTINGGLAIVE_DESCRIPTION", "Throw a boomerang for <style=cIsDamage>460% damage</style>. On hit, it splits into 2, each dealing <style=cIsDamage>70%</style> of the original damage, up to <style=cIsDamage>3</style> times.");
			SkillDef val2 = (SkillDef)(object)ScriptableObject.CreateInstance<HuntressTargetSkillDef>();
			val2.activationState = new SerializableEntityStateType(typeof(SplittingGlaiveAttack));
			val2.activationStateMachineName = "Weapon";
			val2.baseMaxStock = 1;
			val2.baseRechargeInterval = 7f;
			val2.beginSkillCooldownOnSkillEnd = true;
			val2.canceledFromSprinting = false;
			val2.cancelSprintingOnActivation = true;
			val2.fullRestockOnAssign = true;
			val2.interruptPriority = (InterruptPriority)1;
			val2.isCombatSkill = true;
			val2.mustKeyPress = false;
			val2.rechargeStock = 1;
			val2.requiredStock = 1;
			val2.stockToConsume = 1;
			val2.icon = HuntressSkillsPlugin.mainAssets.LoadAsset<Sprite>("Glaive_orange");
			val2.skillDescriptionToken = "PBLSTHUNTRESS_SECONDARY_SPLITTINGGLAIVE_DESCRIPTION";
			val2.skillName = "PBLSTHUNTRESS_SECONDARY_SPLITTINGGLAIVE_NAME";
			val2.skillNameToken = "PBLSTHUNTRESS_SECONDARY_SPLITTINGGLAIVE_NAME";
			ContentAddition.AddSkillDef(val2);
			SkillLocator component = val.GetComponent<SkillLocator>();
			SkillFamily skillFamily = component.secondary.skillFamily;
			Array.Resize(ref skillFamily.variants, skillFamily.variants.Length + 1);
			Variant[] variants = skillFamily.variants;
			int num = skillFamily.variants.Length - 1;
			Variant val3 = new Variant
			{
				skillDef = val2,
				unlockableName = ""
			};
			((Variant)(ref val3)).viewableNode = new Node(val2.skillNameToken, false, (Node)null);
			variants[num] = val3;
		}
	}
	public class StalkingThePrey
	{
		public class StalkingThePreySkill : BaseSkillState
		{
			public static float buffDuration = 4f;

			public static string enterStealthSound = "Play_bandit2_shift_enter";

			public static GameObject featherEffectPrefab = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Feather/FeatherEffect.prefab").WaitForCompletion();

			private Animator animator;

			public override void OnEnter()
			{
				//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_0047: Unknown result type (might be due to invalid IL or missing references)
				//IL_004c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0053: Unknown result type (might be due to invalid IL or missing references)
				//IL_005e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0065: Unknown result type (might be due to invalid IL or missing references)
				//IL_006a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0075: Expected O, but got Unknown
				((BaseState)this).OnEnter();
				animator = ((EntityState)this).GetModelAnimator();
				Object.op_Implicit((Object)(object)animator);
				if (Object.op_Implicit((Object)(object)((EntityState)this).characterBody))
				{
					GameObject val = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/SprintOutOfCombat/SprintActivate.prefab").WaitForCompletion();
					EffectManager.SpawnEffect(val, new EffectData
					{
						origin = ((EntityState)this).transform.position,
						rotation = ((EntityState)this).transform.rotation
					}, true);
					if (NetworkServer.active)
					{
						((EntityState)this).characterBody.AddBuff(Buffs.Cloak);
						((EntityState)this).characterBody.AddBuff(Buffs.CloakSpeed);
						((EntityState)this).characterBody.AddBuff(StalkingThePreyFirstHit);
					}
					((EntityState)this).characterBody.onSkillActivatedAuthority += OnSkillActivatedRemoveInvis;
				}
			}

			public override void FixedUpdate()
			{
				((EntityState)this).FixedUpdate();
				((EntityState)this).outer.SetNextStateToMain();
			}

			public override void OnExit()
			{
				//IL_000f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0019: Expected O, but got Unknown
				((EntityState)this).OnExit();
				EntityState.OnExit += new hook_OnExit(RemoveFirstHitBuff);
			}

			private void RemoveFirstHitBuff(orig_OnExit orig, EntityState self)
			{
				//IL_0072: Unknown result type (might be due to invalid IL or missing references)
				//IL_007c: Expected O, but got Unknown
				orig.Invoke(self);
				BaseState val = (BaseState)(object)((self is BaseState) ? self : null);
				if (val == null)
				{
					return;
				}
				CharacterBody characterBody = self.characterBody;
				if (((Object)(object)characterBody != (Object)null) & ((Object)(object)characterBody == (Object)(object)((EntityState)this).characterBody))
				{
					CharacterBody component = ((Component)characterBody).GetComponent<CharacterBody>();
					if (NetworkServer.active && component.HasBuff(StalkingThePreyFirstHit))
					{
						component.RemoveBuff(StalkingThePreyFirstHit);
						EntityState.OnExit -= new hook_OnExit(RemoveFirstHitBuff);
					}
				}
			}

			private void OnSkillActivatedRemoveInvis(GenericSkill skill)
			{
				//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_0036: 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_0048: Unknown result type (might be due to invalid IL or missing references)
				//IL_004d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0058: Expected O, but got Unknown
				if (skill.skillDef.isCombatSkill && (Object)(object)((EntityState)this).characterBody != (Object)null)
				{
					EffectManager.SpawnEffect(featherEffectPrefab, new EffectData
					{
						origin = ((EntityState)this).transform.position,
						rotation = ((EntityState)this).transform.rotation
					}, true);
					((EntityState)this).characterBody.RemoveBuff(Buffs.CloakSpeed);
					((EntityState)this).characterBody.RemoveBuff(Buffs.Cloak);
					if (((EntityState)this).characterBody.HasBuff(StalkingThePreyFirstHit))
					{
						((EntityState)this).characterBody.RemoveBuff(StalkingThePreyFirstHit);
					}
					((EntityState)this).characterBody.AddTimedBuff(PredatorFocus, buffDuration);
					((EntityState)this).characterBody.onSkillActivatedAuthority -= OnSkillActivatedRemoveInvis;
				}
			}

			public override InterruptPriority GetMinimumInterruptPriority()
			{
				//IL_0002: 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)
				return (InterruptPriority)2;
			}
		}

		[CompilerGenerated]
		private static class <>O
		{
			public static StatHookEventHandler <0>__StalkingThePreyFirstHitStatIncrease;

			public static StatHookEventHandler <1>__PredatorFocusStatIncrease;
		}

		public static BuffDef StalkingThePreyFirstHit;

		public static BuffDef PredatorFocus;

		public static float PredatorFocusCritMultDamage = 0.3f;

		public static float PredatorFocusCritChance = 25f;

		public static void Initialize(HuntressSkillsPlugin pluginInfo)
		{
			//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_004c: 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_0091: 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_0155: Unknown result type (might be due to invalid IL or missing references)
			//IL_015f: Expected O, but got Unknown
			//IL_0160: 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)
			GameObject val = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Huntress/HuntressBody.prefab").WaitForCompletion();
			LanguageAPI.Add("PBLSTHUNTRESS_UTILITY_STALKINGTHEPREY_NAME", "Stalking The Prey");
			LanguageAPI.Add("PBLSTHUNTRESS_UTILITY_STALKINGTHEPREY_DESCRIPTION", "<style=cIsUtility>Agile</style>. Become <style=cIsUtility>Invisible</style>, making your next ability <style=cIsHealth>Critical</style> and increasing movement speed until you deal damage. On use, <style=cIsHealth>increase Critical Damage by 30%</style> and gain <style=cIsHealth>25% Critical Chance</style> for 4 seconds.");
			CreateBuffs();
			SkillDef val2 = ScriptableObject.CreateInstance<SkillDef>();
			val2.activationState = new SerializableEntityStateType(typeof(StalkingThePreySkill));
			val2.activationStateMachineName = "Body";
			val2.baseMaxStock = 1;
			val2.baseRechargeInterval = 8f;
			val2.beginSkillCooldownOnSkillEnd = true;
			val2.canceledFromSprinting = false;
			val2.cancelSprintingOnActivation = false;
			val2.fullRestockOnAssign = true;
			val2.interruptPriority = (InterruptPriority)1;
			val2.isCombatSkill = false;
			val2.mustKeyPress = false;
			val2.rechargeStock = 1;
			val2.requiredStock = 1;
			val2.stockToConsume = 1;
			val2.icon = HuntressSkillsPlugin.mainAssets.LoadAsset<Sprite>("huntress_invis");
			val2.skillDescriptionToken = "PBLSTHUNTRESS_UTILITY_STALKINGTHEPREY_DESCRIPTION";
			val2.skillName = "PBLSTHUNTRESS_UTILITY_STALKINGTHEPREY_NAME";
			val2.skillNameToken = "PBLSTHUNTRESS_UTILITY_STALKINGTHEPREY_NAME";
			ContentAddition.AddSkillDef(val2);
			SkillLocator component = val.GetComponent<SkillLocator>();
			SkillFamily skillFamily = component.utility.skillFamily;
			Array.Resize(ref skillFamily.variants, skillFamily.variants.Length + 1);
			Variant[] variants = skillFamily.variants;
			int num = skillFamily.variants.Length - 1;
			Variant val3 = new Variant
			{
				skillDef = val2,
				unlockableName = ""
			};
			((Variant)(ref val3)).viewableNode = new Node(val2.skillNameToken, false, (Node)null);
			variants[num] = val3;
		}

		public static void StalkingThePreyFirstHitStatIncrease(CharacterBody characterBody, StatHookEventArgs args)
		{
			if (characterBody.HasBuff(StalkingThePreyFirstHit))
			{
				args.critAdd += 100f;
			}
		}

		public static void PredatorFocusStatIncrease(CharacterBody characterBody, StatHookEventArgs args)
		{
			if (characterBody.HasBuff(PredatorFocus))
			{
				args.critDamageMultAdd += PredatorFocusCritMultDamage;
				args.critAdd += PredatorFocusCritChance;
			}
		}

		public static void CreateBuffs()
		{
			//IL_002f: 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_00b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0075: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0080: Expected O, but got Unknown
			//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_011e: Expected O, but got Unknown
			StalkingThePreyFirstHit = ScriptableObject.CreateInstance<BuffDef>();
			((Object)StalkingThePreyFirstHit).name = "StalkingThePrey: CritGuaranteed";
			StalkingThePreyFirstHit.buffColor = new Color(255f, 255f, 255f);
			StalkingThePreyFirstHit.isHidden = true;
			StalkingThePreyFirstHit.canStack = false;
			StalkingThePreyFirstHit.isDebuff = false;
			ContentAddition.AddBuffDef(StalkingThePreyFirstHit);
			object obj = <>O.<0>__StalkingThePreyFirstHitStatIncrease;
			if (obj == null)
			{
				StatHookEventHandler val = StalkingThePreyFirstHitStatIncrease;
				<>O.<0>__StalkingThePreyFirstHitStatIncrease = val;
				obj = (object)val;
			}
			RecalculateStatsAPI.GetStatCoefficients += (StatHookEventHandler)obj;
			PredatorFocus = ScriptableObject.CreateInstance<BuffDef>();
			((Object)PredatorFocus).name = "Stalking The Prey";
			PredatorFocus.buffColor = new Color(255f, 255f, 255f);
			PredatorFocus.iconSprite = HuntressSkillsPlugin.mainAssets.LoadAsset<Sprite>("critBuff_orange");
			PredatorFocus.isHidden = false;
			PredatorFocus.canStack = false;
			PredatorFocus.isDebuff = false;
			ContentAddition.AddBuffDef(PredatorFocus);
			object obj2 = <>O.<1>__PredatorFocusStatIncrease;
			if (obj2 == null)
			{
				StatHookEventHandler val2 = PredatorFocusStatIncrease;
				<>O.<1>__PredatorFocusStatIncrease = val2;
				obj2 = (object)val2;
			}
			RecalculateStatsAPI.GetStatCoefficients += (StatHookEventHandler)obj2;
		}
	}
	internal class SwiftManeuver
	{
		public class SwiftManeuverSkill : BaseSkillState
		{
			private Transform modelTransform;

			public static float baseFirstBlinkDuration = 0.15f;

			public static float baseShotDuration = 0.3f;

			public static float baseSecondBlinkDuration = 0.15f;

			public static float distanceCoefficient = 5f;

			public static float damageCoefficient = 7.5f;

			public static float procCoefficient = 1f;

			public static float cooldownReductionOnCrit = 2f;

			public static GameObject blinkPrefab = BaseBeginArrowBarrage.blinkPrefab;

			public static string blinkSoundString = BaseBeginArrowBarrage.blinkSoundString;

			public static string shotMuzzleString;

			public static GameObject shotMuzzleEffectPrefab;

			public static GameObject projectilePrefab = ArrowRain.projectilePrefab;

			public static SkillDef primarySkillDef = AimArrowSnipe.primarySkillDef;

			public static GameObject crosshairOverridePrefab = AimArrowSnipe.crosshairOverridePrefab;

			public HuntressTracker huntressTracker;

			public Vector3 blinkVector = Vector3.zero;

			public float firstBlinkUpForce = 0.3f;

			public float secondBlinkDownForce = 0.3f;

			private float firstBlinkDuration;

			public float shotDuration;

			public float fsDuration;

			private float secondBlinkDuration;

			public float fssDuration;

			public HurtBox huntressTrackerTarget;

			private bool beginShot = false;

			private bool beginSecondBlink = false;

			public Vector3 GetUserMovVector()
			{
				//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_002b: 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_0030: Unknown result type (might be due to invalid IL or missing references)
				//IL_0033: 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_003b: Unknown result type (might be due to invalid IL or missing references)
				Vector3 val = ((((EntityState)this).inputBank.moveVector == Vector3.zero) ? ((EntityState)this).characterDirection.forward : ((EntityState)this).inputBank.moveVector);
				return ((Vector3)(ref val)).normalized;
			}

			private void CreateBlinkEffect(Vector3 origin)
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				//IL_0007: Expected O, but got Unknown
				//IL_0009: Unknown result type (might be due to invalid IL or missing references)
				//IL_000e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0013: 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)
				EffectData val = new EffectData();
				val.rotation = Util.QuaternionSafeLookRotation(blinkVector);
				val.origin = origin;
				EffectManager.SpawnEffect(blinkPrefab, val, false);
			}

			public override void OnEnter()
			{
				//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)
				//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_011d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0122: 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_012a: 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_0136: Unknown result type (might be due to invalid IL or missing references)
				//IL_013b: Unknown result type (might be due to invalid IL or missing references)
				//IL_013f: 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_0150: 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)
				((BaseState)this).OnEnter();
				Util.PlaySound(blinkSoundString, ((EntityState)this).gameObject);
				huntressTracker = ((EntityState)this).GetComponent<HuntressTracker>();
				if (Object.op_Implicit((Object)(object)huntressTracker))
				{
					huntressTrackerTarget = huntressTracker.GetTrackingTarget();
					((Behaviour)huntressTracker).enabled = false;
				}
				modelTransform = ((EntityState)this).GetModelTransform();
				if (Object.op_Implicit((Object)(object)modelTransform))
				{
				}
				firstBlinkDuration = baseFirstBlinkDuration / ((BaseState)this).attackSpeedStat;
				secondBlinkDuration = baseSecondBlinkDuration / ((BaseState)this).attackSpeedStat;
				shotDuration = baseShotDuration / ((BaseState)this).attackSpeedStat;
				fsDuration = firstBlinkDuration + shotDuration;
				fssDuration = fsDuration + secondBlinkDuration;
				shotMuzzleString = FireHook.muzzleString;
				shotMuzzleEffectPrefab = FireHook.muzzleflashEffectPrefab;
				if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor))
				{
					((EntityState)this).characterMotor.velocity = Vector3.zero;
				}
				CharacterMotor characterMotor = ((EntityState)this).characterMotor;
				characterMotor.rootMotion += Vector3.up;
				Vector3 up = Vector3.up;
				Vector3 val = GetUserMovVector() + up * firstBlinkUpForce;
				blinkVector = ((Vector3)(ref val)).normalized;
				CreateBlinkEffect(((EntityState)this).transform.position);
			}

			public override void FixedUpdate()
			{
				//IL_001e: 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_002f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0035: Unknown result type (might be due to invalid IL or missing references)
				//IL_004c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0051: Unknown result type (might be due to invalid IL or missing references)
				//IL_0056: Unknown result type (might be due to invalid IL or missing references)
				//IL_0083: 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_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_00dd: Unknown result type (might be due to invalid IL or missing references)
				//IL_00e2: Unknown result type (might be due to invalid IL or missing references)
				//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
				//IL_00ee: 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_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_0108: Unknown result type (might be due to invalid IL or missing references)
				((EntityState)this).FixedUpdate();
				if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor))
				{
					((EntityState)this).characterMotor.velocity = Vector3.zero;
					CharacterMotor characterMotor = ((EntityState)this).characterMotor;
					characterMotor.rootMotion += blinkVector * (((BaseState)this).moveSpeedStat * distanceCoefficient * Time.fixedDeltaTime);
				}
				if (((EntityState)this).fixedAge >= firstBlinkDuration && !beginShot)
				{
					beginShot = true;
					blinkVector = Vector3.zero;
					((EntityState)this).PlayAnimation("Body", "FireArrowSnipe", "FireArrowSnipe.playbackRate", shotDuration, 0f);
					SwiftShot();
				}
				if (((EntityState)this).fixedAge >= fsDuration && !beginSecondBlink)
				{
					Vector3 down = Vector3.down;
					Vector3 val = GetUserMovVector() + down * secondBlinkDownForce;
					blinkVector = ((Vector3)(ref val)).normalized;
					CreateBlinkEffect(((EntityState)this).transform.position);
					beginSecondBlink = true;
				}
				if (((EntityState)this).fixedAge >= fssDuration && ((EntityState)this).isAuthority)
				{
					((EntityState)this).PlayAnimation("Body", "FireArrowSnipe", "FireArrowSnipe.playbackRate", shotDuration, 0f);
					SwiftShot();
					((EntityState)this).outer.SetNextStateToMain();
				}
			}

			public override void OnExit()
			{
				//IL_0008: Unknown result type (might be due to invalid IL or missing references)
				CreateBlinkEffect(((EntityState)this).transform.position);
				((EntityState)this).PlayAnimation("Body", "Idle");
				if (Object.op_Implicit((Object)(object)huntressTracker))
				{
					((Behaviour)huntressTracker).enabled = true;
				}
				((EntityState)this).OnExit();
			}

			public override InterruptPriority GetMinimumInterruptPriority()
			{
				//IL_0002: 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)
				return (InterruptPriority)2;
			}

			public void SwiftShot()
			{
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				//IL_0007: Unknown result type (might be due to invalid IL or missing references)
				//IL_0008: Unknown result type (might be due to invalid IL or missing references)
				//IL_000e: Expected O, but got Unknown
				//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_0043: Unknown result type (might be due to invalid IL or missing references)
				//IL_0048: Unknown result type (might be due to invalid IL or missing references)
				//IL_004a: Unknown result type (might be due to invalid IL or missing references)
				//IL_004e: Unknown result type (might be due to invalid IL or missing references)
				//IL_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_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_0071: 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_008d: Unknown result type (might be due to invalid IL or missing references)
				//IL_008e: 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_00a5: 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_0152: 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_015a: 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_0167: Unknown result type (might be due to invalid IL or missing references)
				//IL_0173: Unknown result type (might be due to invalid IL or missing references)
				//IL_017a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0181: Unknown result type (might be due to invalid IL or missing references)
				//IL_0193: Unknown result type (might be due to invalid IL or missing references)
				//IL_0195: 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)
				//IL_019c: 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_01ac: Unknown result type (might be due to invalid IL or missing references)
				//IL_01b2: Unknown result type (might be due to invalid IL or missing references)
				//IL_01b8: Unknown result type (might be due to invalid IL or missing references)
				//IL_01c3: Unknown result type (might be due to invalid IL or missing references)
				//IL_01cf: Unknown result type (might be due to invalid IL or missing references)
				//IL_01d7: Unknown result type (might be due to invalid IL or missing references)
				//IL_01e3: Unknown result type (might be due to invalid IL or missing references)
				//IL_01ef: Unknown result type (might be due to invalid IL or missing references)
				//IL_01fb: Unknown result type (might be due to invalid IL or missing references)
				//IL_0207: Unknown result type (might be due to invalid IL or missing references)
				//IL_0215: Expected O, but got Unknown
				Ray aimRay = ((BaseState)this).GetAimRay();
				FireArrowSnipe val = new FireArrowSnipe();
				Util.PlayAttackSpeedSound(((GenericBulletBaseState)val).fireSoundString, ((EntityState)this).gameObject, ((BaseState)this).attackSpeedStat);
				Vector3 val3;
				if (Object.op_Implicit((Object)(object)huntressTrackerTarget))
				{
					Vector3 position = ((Component)huntressTrackerTarget).transform.position;
					Vector3 val2 = position - ((Ray)(ref aimRay)).origin;
					val3 = ((Vector3)(ref val2)).normalized;
				}
				else
				{
					val3 = ((Ray)(ref aimRay)).direction;
				}
				Vector3 val4 = default(Vector3);
				((Vector3)(ref val4))..ctor(val3.x, 0f, ((Ray)(ref aimRay)).origin.z);
				if (val4 != Vector3.zero)
				{
					modelTransform.forward = val4;
				}
				((EntityState)this).healthComponent.TakeDamageForce(((Ray)(ref aimRay)).direction * -400f, true, false);
				bool flag = ((BaseState)this).RollCrit();
				if (flag)
				{
					GenericSkill special = ((EntityState)this).characterBody.skillLocator.special;
					if (special.stock < special.maxStock)
					{
						special.rechargeStopwatch += cooldownReductionOnCrit;
						if (special.rechargeStopwatch > special.skillDef.baseRechargeInterval)
						{
							special.rechargeStopwatch = special.skillDef.baseRechargeInterval;
						}
					}
				}
				BulletAttack val5 = new BulletAttack
				{
					aimVector = val3,
					origin = ((Ray)(ref aimRay)).origin,
					owner = ((EntityState)this).gameObject,
					weapon = null,
					bulletCount = 1u,
					damage = ((BaseState)this).damageStat * damageCoefficient,
					damageColorIndex = (DamageColorIndex)0,
					falloffModel = (FalloffModel)0,
					force = 2f,
					procChainMask = default(ProcChainMask),
					procCoefficient = procCoefficient,
					maxDistance = 1000f,
					isCrit = flag,
					muzzleName = ((GenericBulletBaseState)val).muzzleName,
					hitEffectPrefab = ((GenericBulletBaseState)val).hitEffectPrefab,
					spreadPitchScale = ((GenericBulletBaseState)val).spreadPitchScale,
					spreadYawScale = ((GenericBulletBaseState)val).spreadYawScale,
					tracerEffectPrefab = ((GenericBulletBaseState)val).tracerEffectPrefab
				};
				val5.Fire();
			}
		}

		public static void Initialize(HuntressSkillsPlugin pluginInfo)
		{
			//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_0046: 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_008b: Unknown result type (might be due to invalid IL or missing references)
			//IL_012b: Unknown result type (might be due to invalid IL or missing references)
			//IL_014f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0159: Expected O, but got Unknown
			//IL_015a: 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)
			GameObject val = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Huntress/HuntressBody.prefab").WaitForCompletion();
			LanguageAPI.Add("PBLSTHUNTRESS_SPECIAL_SWIFTMANEUVERSKILL_NAME", "Swift Maneuver");
			LanguageAPI.Add("PBLSTHUNTRESS_SPECIAL_SWIFTMANEUVERSKILL_DESCRIPTION", "<style=cIsUtility>Agile</style>. <style=cIsUtility>Disappear</style> and <style=cIsUtility>teleport</style> a short distance, firing an arrow for <style=cIsDamage>750% damage</style>. <style=cIsUtility>Teleport</style> again and fire another arrow for <style=cIsDamage>750% damage</style>. Can store up to <style=cIsUtility>2 charges</style>. <style=cIsHealth>Critical Strikes</style> reduce cooldown by <style=cIsUtility>3 seconds</style>.");
			SkillDef val2 = ScriptableObject.CreateInstance<SkillDef>();
			val2.activationState = new SerializableEntityStateType(typeof(SwiftManeuverSkill));
			val2.activationStateMachineName = "Weapon";
			val2.baseMaxStock = 2;
			val2.baseRechargeInterval = 7f;
			val2.beginSkillCooldownOnSkillEnd = true;
			val2.canceledFromSprinting = false;
			val2.cancelSprintingOnActivation = false;
			val2.fullRestockOnAssign = true;
			val2.interruptPriority = (InterruptPriority)1;
			val2.isCombatSkill = true;
			val2.mustKeyPress = false;
			val2.rechargeStock = 1;
			val2.requiredStock = 1;
			val2.stockToConsume = 1;
			val2.icon = HuntressSkillsPlugin.mainAssets.LoadAsset<Sprite>("ballista_orange");
			val2.skillDescriptionToken = "PBLSTHUNTRESS_SPECIAL_SWIFTMANEUVERSKILL_DESCRIPTION";
			val2.skillName = "PBLSTHUNTRESS_SPECIAL_SWIFTMANEUVERSKILL_NAME  ";
			val2.skillNameToken = "PBLSTHUNTRESS_SPECIAL_SWIFTMANEUVERSKILL_NAME";
			ContentAddition.AddSkillDef(val2);
			SkillLocator component = val.GetComponent<SkillLocator>();
			SkillFamily skillFamily = component.special.skillFamily;
			Array.Resize(ref skillFamily.variants, skillFamily.variants.Length + 1);
			Variant[] variants = skillFamily.variants;
			int num = skillFamily.variants.Length - 1;
			Variant val3 = new Variant
			{
				skillDef = val2,
				unlockableName = ""
			};
			((Variant)(ref val3)).viewableNode = new Node(val2.skillNameToken, false, (Node)null);
			variants[num] = val3;
		}
	}
	public class TranceFire
	{
		public class HuntressTargetSkillDef : SkillDef
		{
			public override bool CanExecute(GenericSkill skillSlot)
			{
				if (((SkillDef)this).CanExecute(skillSlot))
				{
					CharacterBody characterBody = skillSlot.characterBody;
					if (Object.op_Implicit((Object)(object)characterBody))
					{
						HuntressTracker component = ((Component)characterBody).GetComponent<HuntressTracker>();
						return Object.op_Implicit((Object)(object)component) && (Object)(object)component.GetTrackingTarget() != (Object)null;
					}
				}
				return false;
			}
		}

		public class FireHeavyArrowAttack : BaseSkillState
		{
			public static float orbDamageCoefficient = 1f;

			public static float orbProcCoefficient = 1f;

			public static float baseDuration = 0.75f;

			public static float durationReductionPerBuff = 0.05f;

			private static float buffDuration = 3.5f;

			private static int maxBuffStack = 10;

			private float duration;

			protected bool isCrit;

			private int firedArrowCount = 0;

			private int numArrows = 1;

			private HurtBox initialOrbTarget;

			private HuntressTracker huntressTracker;

			private Animator animator;

			public override void OnEnter()
			{
				((BaseState)this).OnEnter();
				Transform modelTransform = ((EntityState)this).GetModelTransform();
				huntressTracker = ((EntityState)this).GetComponent<HuntressTracker>();
				if (((EntityState)this).isAuthority && (Object)(object)huntressTracker != (Object)null)
				{
					initialOrbTarget = huntressTracker.GetTrackingTarget();
				}
				if (!Object.op_Implicit((Object)(object)modelTransform) || !Object.op_Implicit((Object)(object)initialOrbTarget))
				{
					return;
				}
				animator = ((Component)modelTransform).GetComponent<Animator>();
				if (Object.op_Implicit((Object)(object)huntressTracker) || !((EntityState)this).isAuthority)
				{
					int buffCount = ((EntityState)this).characterBody.GetBuffCount(TranceBuff);
					duration = (baseDuration - durationReductionPerBuff * (float)buffCount) / ((BaseState)this).attackSpeedStat;
					if (buffCount >= maxBuffStack)
					{
						numArrows = 2;
					}
					isCrit = Util.CheckRoll(((EntityState)this).characterBody.crit, ((EntityState)this).characterBody.master);
					if (Object.op_Implicit((Object)(object)((EntityState)this).characterBody))
					{
						((EntityState)this).characterBody.SetAimTimer(duration + 1f);
					}
					((EntityState)this).PlayCrossfade("Gesture, Override", "FireSeekingShot", "FireSeekingShot.playbackRate", duration, duration);
				}
			}

			public override void OnExit()
			{
				((EntityState)this).OnExit();
			}

			protected virtual GenericDamageOrb CreateArrowOrb()
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				//IL_0007: Expected O, but got Unknown
				return (GenericDamageOrb)new HuntressArrowOrb();
			}

			private void FireOrbArrow()
			{
				//IL_0105: 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_0122: 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_015e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0163: Unknown result type (might be due to invalid IL or missing references)
				if (firedArrowCount < numArrows && NetworkServer.active)
				{
					int buffCount = ((EntityState)this).characterBody.GetBuffCount(TranceBuff);
					((EntityState)this).characterBody.ClearTimedBuffs(TranceBuff);
					for (int i = 0; i < buffCount; i++)
					{
						((EntityState)this).characterBody.AddTimedBuff(TranceBuff, buffDuration, maxBuffStack);
					}
					if (isCrit)
					{
						((EntityState)this).characterBody.AddTimedBuff(TranceBuff, buffDuration, maxBuffStack);
						((EntityState)this).characterBody.AddTimedBuff(TranceBuff, buffDuration, maxBuffStack);
					}
					else
					{
						((EntityState)this).characterBody.AddTimedBuff(TranceBuff, buffDuration, maxBuffStack);
					}
					firedArrowCount++;
					GenericDamageOrb val = CreateArrowOrb();
					val.damageValue = ((EntityState)this).characterBody.damage * orbDamageCoefficient;
					val.damageType = DamageTypeCombo.op_Implicit((DamageType)0);
					val.isCrit = isCrit;
					val.teamIndex = TeamComponent.GetObjectTeam(((EntityState)this).gameObject);
					val.attacker = ((EntityState)this).gameObject;
					val.procCoefficient = orbProcCoefficient;
					HurtBox val2 = initialOrbTarget;
					if (Object.op_Implicit((Object)(object)val2))
					{
						((Orb)val).origin = ((EntityState)this).transform.position;
						((Orb)val).target = val2;
						OrbManager.instance.AddOrb((Orb)(object)val);
					}
				}
			}

			public override void FixedUpdate()
			{
				((EntityState)this).FixedUpdate();
				if (animator.GetFloat("FireSeekingShot.fire") > 0f)
				{
					FireOrbArrow();
				}
				if (((EntityState)this).fixedAge > duration && ((EntityState)this).isAuthority)
				{
					((EntityState)this).outer.SetNextStateToMain();
				}
			}

			public override InterruptPriority GetMinimumInterruptPriority()
			{
				//IL_0002: 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)
				return (InterruptPriority)1;
			}
		}

		[CompilerGenerated]
		private static class <>O
		{
			public static hook_OnHitEnemy <0>__OnHitTranceBuffElimination;
		}

		public static BuffDef TranceBuff;

		public static void Initialize(HuntressSkillsPlugin pluginInfo)
		{
			//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_004c: 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_0091: 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_0155: Unknown result type (might be due to invalid IL or missing references)
			//IL_015f: Expected O, but got Unknown
			//IL_0160: 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)
			GameObject val = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Huntress/HuntressBody.prefab").WaitForCompletion();
			LanguageAPI.Add("PBLSTHUNTRESS_PRIMARY_TRANCEFIRE_NAME", "Trance Fire");
			LanguageAPI.Add("PBLSTHUNTRESS_PRIMARY_TRANCEFIRE_DESCRIPTION", "<style=cIsUtility>Agile</style>. Fire a seeking arrow for <style=cIsDamage>100% damage</style>. Consecutive shots without taking damage grant <style=cIsDamage>Focus</style>, increasing attack speed up to <style=cIsUtility>10</style> stacks. At max <style=cIsDamage>Focus</style>, fire <style=cIsDamage>2</style> arrows.");
			SkillDef val2 = (SkillDef)(object)ScriptableObject.CreateInstance<HuntressTargetSkillDef>();
			CreateBuff();
			val2.activationState = new SerializableEntityStateType(typeof(FireHeavyArrowAttack));
			val2.activationStateMachineName = "Weapon";
			val2.baseMaxStock = 1;
			val2.baseRechargeInterval = 0f;
			val2.beginSkillCooldownOnSkillEnd = false;
			val2.canceledFromSprinting = false;
			val2.cancelSprintingOnActivation = false;
			val2.fullRestockOnAssign = true;
			val2.interruptPriority = (InterruptPriority)0;
			val2.isCombatSkill = true;
			val2.mustKeyPress = false;
			val2.rechargeStock = 1;
			val2.requiredStock = 1;
			val2.stockToConsume = 1;
			val2.icon = HuntressSkillsPlugin.mainAssets.LoadAsset<Sprite>("strafe_orange");
			val2.skillDescriptionToken = "PBLSTHUNTRESS_PRIMARY_TRANCEFIRE_DESCRIPTION";
			val2.skillName = "PBLSTHUNTRESS_PRIMARY_TRANCEFIRE_NAME";
			val2.skillNameToken = "PBLSTHUNTRESS_PRIMARY_TRANCEFIRE_NAME";
			ContentAddition.AddSkillDef(val2);
			SkillLocator component = val.GetComponent<SkillLocator>();
			SkillFamily skillFamily = component.primary.skillFamily;
			Array.Resize(ref skillFamily.variants, skillFamily.variants.Length + 1);
			Variant[] variants = skillFamily.variants;
			int num = skillFamily.variants.Length - 1;
			Variant val3 = new Variant
			{
				skillDef = val2,
				unlockableName = ""
			};
			((Variant)(ref val3)).viewableNode = new Node(val2.skillNameToken, false, (Node)null);
			variants[num] = val3;
		}

		public static void CreateBuff()
		{
			//IL_0070: Unknown result type (might be due to invalid IL or missing references)
			//IL_0075: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: Expected O, but got Unknown
			TranceBuff = ScriptableObject.CreateInstance<BuffDef>();
			((Object)TranceBuff).name = "Huntress Focus";
			TranceBuff.iconSprite = HuntressSkillsPlugin.mainAssets.LoadAsset<Sprite>("huntress_trance_buff");
			TranceBuff.isHidden = false;
			TranceBuff.canStack = true;
			TranceBuff.isDebuff = false;
			ContentAddition.AddBuffDef(TranceBuff);
			object obj = <>O.<0>__OnHitTranceBuffElimination;
			if (obj == null)
			{
				hook_OnHitEnemy val = OnHitTranceBuffElimination;
				<>O.<0>__OnHitTranceBuffElimination = val;
				obj = (object)val;
			}
			GlobalEventManager.OnHitEnemy += (hook_OnHitEnemy)obj;
		}

		public static void OnHitTranceBuffElimination(orig_OnHitEnemy orig, GlobalEventManager self, DamageInfo damageInfo, GameObject victim)
		{
			orig.Invoke(self, damageInfo, victim);
			if (Object.op_Implicit((Object)(object)victim))
			{
				CharacterBody component = victim.GetComponent<CharacterBody>();
				if (Object.op_Implicit((Object)(object)component) && component.HasBuff(TranceBuff))
				{
					component.ClearTimedBuffs(TranceBuff);
				}
			}
		}
	}
}