Decompiled source of Briar v1.0.1

Briar.dll

Decompiled a month 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 EntityStates;
using EntityStates.Merc;
using JetBrains.Annotations;
using KinematicCharacterController;
using On.RoR2;
using R2API;
using R2API.Utils;
using Rewired.ComponentControls.Effects;
using RoR2;
using RoR2.Projectile;
using RoR2.Skills;
using RoR2.UI;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.Networking;
using UnityEngine.Rendering;

[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyCompany("Briar")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: CompilationRelaxations(8)]
[assembly: TargetFramework(".NETStandard,Version=v2.0", FrameworkDisplayName = "")]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyTitle("Briar")]
[assembly: AssemblyProduct("Briar")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace Briar;

internal class Assets
{
	public static AssetBundle MainAssetBundle;

	public static T Load<T>(string name) where T : Object
	{
		return MainAssetBundle.LoadAsset<T>(name);
	}

	public static void PopulateAssets()
	{
		Assembly executingAssembly = Assembly.GetExecutingAssembly();
		if ((Object)(object)MainAssetBundle == (Object)null)
		{
			using Stream stream = executingAssembly.GetManifestResourceStream("Briar.AssetBundle." + "Briar".ToLower() + "assets");
			MainAssetBundle = AssetBundle.LoadFromStream(stream);
		}
		using Stream stream2 = executingAssembly.GetManifestResourceStream("Briar.Briar.bnk");
		byte[] array = new byte[stream2.Length];
		stream2.Read(array, 0, array.Length);
		SoundBanks.Add(array);
	}
}
internal class BriarTracker : HuntressTracker
{
	public ModelBehaviour modelBehaviour;

	public GameObject hitEntity;

	public GameObject projectile;

	public float kickMinDistance = 0f;

	public float kickMinRadius = 2f;

	public float minScreamDistance = 5f;

	public float maxScreamDistance = 25f;

	public float maxScreamAngle = 62f;

	public float minScreamForce = 20f;

	public float maxScreamForce = 80f;

	public float selfForce = 4500f;

	public float minSelfForce = 0.6f;

	public float maxSelfForce = 1.7f;

	public float rootMotion = 35f;

	public float minYDistance = 8f;

	public float radialDist = 5f;

	public float swingSelfForce = 10f;

	public float maxScreamIndicatorSides = 15f;

	public float maxScreamIndicatorFw = 25f;

	public bool inFrenzy;

	public bool inPrimary;

	private void Awake()
	{
		//IL_000d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0017: Expected O, but got Unknown
		base.indicator = new Indicator(((Component)this).gameObject, Prefabs.trackingIndicator);
		base.characterBody = ((Component)this).GetComponent<CharacterBody>();
		modelBehaviour = ((Component)base.characterBody.modelLocator.modelTransform).GetComponent<ModelBehaviour>();
	}

	private void Start()
	{
		((HuntressTracker)this).Start();
		base.search.minDistanceFilter = 0f;
		base.search.minAngleFilter = 0f;
	}

	public void Show()
	{
		modelBehaviour.Show();
	}

	public void FrenzyShow()
	{
		modelBehaviour.FrenzyShow();
	}

	public void Hide()
	{
		modelBehaviour.Hide();
	}
}
internal class BriarUltProjectileBehaviour : NetworkBehaviour, IProjectileImpactBehavior
{
	private ProjectileController controller;

	private GameObject owner;

	private BriarTracker tracker;

	private static int kRpcRpcProjectileImpact;

	private void Awake()
	{
		controller = ((Component)this).GetComponent<ProjectileController>();
	}

	private void Start()
	{
		owner = controller.owner;
		tracker = (Object.op_Implicit((Object)(object)owner) ? owner.GetComponent<BriarTracker>() : null);
		if (Object.op_Implicit((Object)(object)tracker))
		{
			tracker.projectile = ((Component)this).gameObject;
		}
	}

	public void OnProjectileImpact(ProjectileImpactInfo impactInfo)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		HurtBox component = ((Component)impactInfo.collider).GetComponent<HurtBox>();
		if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component.healthComponent))
		{
			ProjectileImpact(((Component)component.healthComponent).gameObject);
			CallRpcProjectileImpact(((Component)component.healthComponent).gameObject);
		}
	}

	private void ProjectileImpact(GameObject collider)
	{
		HealthComponent component = collider.GetComponent<HealthComponent>();
		if (!Object.op_Implicit((Object)(object)component) || !Object.op_Implicit((Object)(object)tracker))
		{
			return;
		}
		if (Object.op_Implicit((Object)(object)owner))
		{
			CharacterBody component2 = owner.GetComponent<CharacterBody>();
			if (Object.op_Implicit((Object)(object)component2))
			{
				Util.CleanseBody(component2, true, false, false, true, true, false);
			}
			if (Util.HasEffectiveAuthority(owner))
			{
				AkSoundEngine.PostEvent(Sounds.Play_Briar_Ult_Missile_Hit, owner);
			}
			AkSoundEngine.PostEvent(Sounds.Play_Briar_VO, owner);
		}
		tracker.hitEntity = collider;
		CharacterBody body = component.body;
		if (Object.op_Implicit((Object)(object)body) && Object.op_Implicit((Object)(object)body.modelLocator.modelTransform))
		{
			CharacterModel component3 = ((Component)body.modelLocator.modelTransform).GetComponent<CharacterModel>();
			if (Object.op_Implicit((Object)(object)component3))
			{
				TemporaryOverlay val = ((Component)component3).gameObject.AddComponent<TemporaryOverlay>();
				val.duration = 10f;
				val.animateShaderAlpha = true;
				val.alphaCurve = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f);
				val.destroyComponentOnEnd = true;
				val.originalMaterial = Prefabs.ultHitOverlay;
				val.AddToCharacerModel(component3);
			}
		}
	}

	[ClientRpc]
	public void RpcProjectileImpact(GameObject collider)
	{
		ProjectileImpact(collider);
	}

	private void UNetVersion()
	{
	}

	protected static void InvokeRpcRpcProjectileImpact(NetworkBehaviour obj, NetworkReader reader)
	{
		if (!NetworkClient.active)
		{
			Debug.LogError((object)"RPC RpcProjectileImpact called on server.");
		}
		else
		{
			((BriarUltProjectileBehaviour)(object)obj).RpcProjectileImpact(reader.ReadGameObject());
		}
	}

	public void CallRpcProjectileImpact(GameObject collider)
	{
		//IL_0016: Unknown result type (might be due to invalid IL or missing references)
		//IL_001c: Expected O, but got Unknown
		//IL_0041: Unknown result type (might be due to invalid IL or missing references)
		if (!NetworkServer.active)
		{
			Debug.LogError((object)"RPC Function RpcProjectileImpact called on client.");
			return;
		}
		NetworkWriter val = new NetworkWriter();
		val.Write((short)0);
		val.Write((short)2);
		val.WritePackedUInt32((uint)kRpcRpcProjectileImpact);
		val.Write(((Component)this).GetComponent<NetworkIdentity>().netId);
		val.Write(collider);
		((NetworkBehaviour)this).SendRPCInternal(val, 0, "RpcProjectileImpact");
	}

	static BriarUltProjectileBehaviour()
	{
		//IL_0020: Unknown result type (might be due to invalid IL or missing references)
		//IL_002a: Expected O, but got Unknown
		kRpcRpcProjectileImpact = 693570598;
		NetworkBehaviour.RegisterRpcDelegate(typeof(BriarUltProjectileBehaviour), kRpcRpcProjectileImpact, new CmdDelegate(InvokeRpcRpcProjectileImpact));
		NetworkCRC.RegisterBehaviour("BriarUltProjectileBehaviour", 0);
	}

	public override bool OnSerialize(NetworkWriter writer, bool forceAll)
	{
		bool result = default(bool);
		return result;
	}

	public override void OnDeserialize(NetworkReader reader, bool initialState)
	{
	}
}
internal class ModelBehaviour : MonoBehaviour
{
	private uint ID;

	public bool playSound = false;

	private GameObject baseHead;

	private GameObject frenzyHead;

	private GameObject frenzyWeapon;

	private GameObject weaponLock;

	private void Awake()
	{
		ChildLocator component = ((Component)this).GetComponent<ChildLocator>();
		baseHead = ((Component)component.FindChild("baseHead")).gameObject;
		frenzyHead = ((Component)component.FindChild("frenzyHead")).gameObject;
		frenzyWeapon = ((Component)component.FindChild("frenzyWeapon")).gameObject;
		weaponLock = ((Component)component.FindChild("weaponLock")).gameObject;
	}

	private void Start()
	{
		if (playSound)
		{
			ID = AkSoundEngine.PostEvent(Sounds.Play_Briar_Intro, ((Component)this).gameObject);
		}
	}

	private void OnDisable()
	{
		if (playSound)
		{
			AkSoundEngine.StopPlayingID(ID);
		}
	}

	public void FrenzyShow()
	{
		Show();
		weaponLock.SetActive(false);
		frenzyWeapon.SetActive(true);
	}

	public void Show()
	{
		baseHead.SetActive(false);
		frenzyHead.SetActive(true);
	}

	public void Hide()
	{
		baseHead.SetActive(true);
		weaponLock.SetActive(true);
		frenzyHead.SetActive(false);
		frenzyWeapon.SetActive(false);
	}
}
internal class NetBehaviour : NetworkBehaviour
{
	private static int kCmdCmdBite;

	private static int kRpcRpcBite;

	private static int kCmdCmdApplyForce;

	[Command]
	public void CmdBite()
	{
		CallRpcBite();
	}

	[ClientRpc]
	public void RpcBite()
	{
		EntityStateMachine component = ((Component)this).GetComponent<EntityStateMachine>();
		if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component) && component.state is Frenzy frenzy)
		{
			frenzy.Bite();
		}
	}

	[Command]
	public void CmdApplyForce(GameObject obj, Vector3 force, bool maxCharge, Vector3 direction)
	{
		//IL_0009: 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_0028: Unknown result type (might be due to invalid IL or missing references)
		//IL_0045: Unknown result type (might be due to invalid IL or missing references)
		//IL_0047: Unknown result type (might be due to invalid IL or missing references)
		HealthComponent component = obj.GetComponent<HealthComponent>();
		component.TakeDamageForce(force, false, false);
		if (maxCharge)
		{
			WallCollisionBehaviour component2 = Object.Instantiate<GameObject>(Prefabs.wallCollider, obj.transform.position, Quaternion.identity).GetComponent<WallCollisionBehaviour>();
			component2.characterBody = component.body;
			component2.direction = direction;
		}
	}

	private void UNetVersion()
	{
	}

	protected static void InvokeCmdCmdBite(NetworkBehaviour obj, NetworkReader reader)
	{
		if (!NetworkServer.active)
		{
			Debug.LogError((object)"Command CmdBite called on client.");
		}
		else
		{
			((NetBehaviour)(object)obj).CmdBite();
		}
	}

	protected static void InvokeCmdCmdApplyForce(NetworkBehaviour obj, NetworkReader reader)
	{
		//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)
		if (!NetworkServer.active)
		{
			Debug.LogError((object)"Command CmdApplyForce called on client.");
		}
		else
		{
			((NetBehaviour)(object)obj).CmdApplyForce(reader.ReadGameObject(), reader.ReadVector3(), reader.ReadBoolean(), reader.ReadVector3());
		}
	}

	public void CallCmdBite()
	{
		//IL_0029: Unknown result type (might be due to invalid IL or missing references)
		//IL_002f: Expected O, but got Unknown
		//IL_0054: Unknown result type (might be due to invalid IL or missing references)
		if (!NetworkClient.active)
		{
			Debug.LogError((object)"Command function CmdBite called on server.");
			return;
		}
		if (((NetworkBehaviour)this).isServer)
		{
			CmdBite();
			return;
		}
		NetworkWriter val = new NetworkWriter();
		val.Write((short)0);
		val.Write((short)5);
		val.WritePackedUInt32((uint)kCmdCmdBite);
		val.Write(((Component)this).GetComponent<NetworkIdentity>().netId);
		((NetworkBehaviour)this).SendCommandInternal(val, 0, "CmdBite");
	}

	public void CallCmdApplyForce(GameObject obj, Vector3 force, bool maxCharge, Vector3 direction)
	{
		//IL_0039: Unknown result type (might be due to invalid IL or missing references)
		//IL_003f: Expected O, but got Unknown
		//IL_0064: 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_008d: 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_002e: Unknown result type (might be due to invalid IL or missing references)
		if (!NetworkClient.active)
		{
			Debug.LogError((object)"Command function CmdApplyForce called on server.");
			return;
		}
		if (((NetworkBehaviour)this).isServer)
		{
			CmdApplyForce(obj, force, maxCharge, direction);
			return;
		}
		NetworkWriter val = new NetworkWriter();
		val.Write((short)0);
		val.Write((short)5);
		val.WritePackedUInt32((uint)kCmdCmdApplyForce);
		val.Write(((Component)this).GetComponent<NetworkIdentity>().netId);
		val.Write(obj);
		val.Write(force);
		val.Write(maxCharge);
		val.Write(direction);
		((NetworkBehaviour)this).SendCommandInternal(val, 0, "CmdApplyForce");
	}

	protected static void InvokeRpcRpcBite(NetworkBehaviour obj, NetworkReader reader)
	{
		if (!NetworkClient.active)
		{
			Debug.LogError((object)"RPC RpcBite called on server.");
		}
		else
		{
			((NetBehaviour)(object)obj).RpcBite();
		}
	}

	public void CallRpcBite()
	{
		//IL_0016: Unknown result type (might be due to invalid IL or missing references)
		//IL_001c: Expected O, but got Unknown
		//IL_0041: Unknown result type (might be due to invalid IL or missing references)
		if (!NetworkServer.active)
		{
			Debug.LogError((object)"RPC Function RpcBite called on client.");
			return;
		}
		NetworkWriter val = new NetworkWriter();
		val.Write((short)0);
		val.Write((short)2);
		val.WritePackedUInt32((uint)kRpcRpcBite);
		val.Write(((Component)this).GetComponent<NetworkIdentity>().netId);
		((NetworkBehaviour)this).SendRPCInternal(val, 0, "RpcBite");
	}

	static NetBehaviour()
	{
		//IL_0020: Unknown result type (might be due to invalid IL or missing references)
		//IL_002a: Expected O, but got Unknown
		//IL_004a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0054: Expected O, but got Unknown
		//IL_0074: Unknown result type (might be due to invalid IL or missing references)
		//IL_007e: Expected O, but got Unknown
		kCmdCmdBite = -1939490280;
		NetworkBehaviour.RegisterCommandDelegate(typeof(NetBehaviour), kCmdCmdBite, new CmdDelegate(InvokeCmdCmdBite));
		kCmdCmdApplyForce = -399685315;
		NetworkBehaviour.RegisterCommandDelegate(typeof(NetBehaviour), kCmdCmdApplyForce, new CmdDelegate(InvokeCmdCmdApplyForce));
		kRpcRpcBite = -1393425682;
		NetworkBehaviour.RegisterRpcDelegate(typeof(NetBehaviour), kRpcRpcBite, new CmdDelegate(InvokeRpcRpcBite));
		NetworkCRC.RegisterBehaviour("NetBehaviour", 0);
	}

	public override bool OnSerialize(NetworkWriter writer, bool forceAll)
	{
		bool result = default(bool);
		return result;
	}

	public override void OnDeserialize(NetworkReader reader, bool initialState)
	{
	}
}
internal class WallCollisionBehaviour : MonoBehaviour
{
	public Vector3 direction;

	public CharacterBody characterBody;

	private void Start()
	{
		//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)
		//IL_003f: 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_007e: Expected O, but got Unknown
		if (Object.op_Implicit((Object)(object)characterBody))
		{
			Bounds bounds = ((Component)characterBody).GetComponent<Collider>().bounds;
			Vector3 size = ((Bounds)(ref bounds)).size;
			float magnitude = ((Vector3)(ref size)).magnitude;
			((Component)this).transform.localScale = new Vector3(magnitude, 0.1f, magnitude);
		}
		if (Object.op_Implicit((Object)(object)characterBody.characterMotor))
		{
			characterBody.characterMotor.onHitGroundServer += new HitGroundDelegate(CharacterMotor_onHitGroundServer);
		}
	}

	private void CharacterMotor_onHitGroundServer(ref HitGroundInfo hitGroundInfo)
	{
		Object.Destroy((Object)(object)((Component)this).gameObject);
	}

	private void Update()
	{
		//IL_001d: Unknown result type (might be due to invalid IL or missing references)
		if (Object.op_Implicit((Object)(object)characterBody))
		{
			((Component)this).transform.position = characterBody.corePosition;
		}
		else
		{
			Object.Destroy((Object)(object)((Component)this).gameObject);
		}
	}

	private void OnDestroy()
	{
		//IL_0028: Unknown result type (might be due to invalid IL or missing references)
		//IL_0032: Expected O, but got Unknown
		if (Object.op_Implicit((Object)(object)characterBody.characterMotor))
		{
			characterBody.characterMotor.onHitGroundServer -= new HitGroundDelegate(CharacterMotor_onHitGroundServer);
		}
	}

	private void OnCollisionEnter(Collision collision)
	{
		//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_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_00a4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ab: Expected O, but got Unknown
		//IL_00cc: 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_00e1: 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_011a: 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_0132: 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_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_0161: Expected O, but got Unknown
		if (Object.op_Implicit((Object)(object)characterBody) && collision.gameObject.layer == LayerIndex.world.intVal)
		{
			float num = Mathf.Max(characterBody.moveSpeed, characterBody.baseMoveSpeed) * 2f;
			Vector3 velocity = characterBody.rigidbody.velocity;
			float magnitude = ((Vector3)(ref velocity)).magnitude;
			if (magnitude >= num)
			{
				Vector3 point = ((ContactPoint)(ref collision.contacts[0])).point;
				float num2 = magnitude / characterBody.moveSpeed * 0.07f;
				DamageInfo val = new DamageInfo();
				val.damage = characterBody.healthComponent.fullCombinedHealth * 0.15f;
				val.damageType = (DamageType)32;
				val.procCoefficient = 0f;
				val.position = point;
				val.attacker = characterBody.healthComponent.lastHitAttacker;
				characterBody.healthComponent.TakeDamage(val);
				EffectManager.SpawnEffect(Prefabs.wallImpact, new EffectData
				{
					origin = ((ContactPoint)(ref collision.contacts[0])).point,
					scale = magnitude / 100f,
					rotation = Util.QuaternionSafeLookRotation(((ContactPoint)(ref collision.contacts[0])).normal)
				}, true);
				Object.Destroy((Object)(object)((Component)this).gameObject);
			}
		}
	}
}
internal class Hook
{
	internal static void Hooks()
	{
		//IL_0008: Unknown result type (might be due to invalid IL or missing references)
		//IL_0012: Expected O, but got Unknown
		//IL_002c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0036: Expected O, but got Unknown
		//IL_003e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0048: Expected O, but got Unknown
		RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(RecalculateStatsAPI_GetStatCoefficients);
		GlobalEventManager.onServerDamageDealt += GlobalEventManager_onServerDamageDealt;
		DotController.InflictDot_GameObject_GameObject_DotIndex_float_float_Nullable1 += new hook_InflictDot_GameObject_GameObject_DotIndex_float_float_Nullable1(DotController_InflictDot_GameObject_GameObject_DotIndex_float_float_Nullable1);
		HealthComponent.Heal += new hook_Heal(HealthComponent_Heal);
	}

	private static void RecalculateStatsAPI_GetStatCoefficients(CharacterBody sender, StatHookEventArgs args)
	{
		if (sender.HasBuff(Prefabs.armor))
		{
			args.armorAdd += 100f;
		}
		if (sender.HasBuff(Prefabs.frenzy))
		{
			args.attackSpeedMultAdd += 0.6f;
			args.moveSpeedMultAdd += 0.6f;
		}
		if (sender.HasBuff(Prefabs.frenzyUlt))
		{
			args.attackSpeedMultAdd += 0.6f;
			args.moveSpeedMultAdd += 0.6f;
			args.armorAdd += 10f;
		}
		if (sender.HasBuff(Prefabs.armorbreak))
		{
			args.armorAdd -= 25f;
		}
	}

	private static float HealthComponent_Heal(orig_Heal orig, HealthComponent self, float amount, ProcChainMask procChainMask, bool nonRegen)
	{
		//IL_0032: Unknown result type (might be due to invalid IL or missing references)
		if (nonRegen && Object.op_Implicit((Object)(object)((Component)self).GetComponent<BriarTracker>()))
		{
			amount *= 1f + (1f - self.combinedHealthFraction);
		}
		return orig.Invoke(self, amount, procChainMask, nonRegen);
	}

	private static void DotController_InflictDot_GameObject_GameObject_DotIndex_float_float_Nullable1(orig_InflictDot_GameObject_GameObject_DotIndex_float_float_Nullable1 orig, GameObject victimObject, GameObject attackerObject, DotIndex dotIndex, float duration, float damageMultiplier, uint? maxStacksFromAttacker)
	{
		//IL_005f: Unknown result type (might be due to invalid IL or missing references)
		if (!Object.op_Implicit((Object)(object)attackerObject.GetComponent<BriarTracker>()) || maxStacksFromAttacker.HasValue)
		{
			CharacterBody component = attackerObject.GetComponent<CharacterBody>();
			if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component.inventory))
			{
				damageMultiplier *= 1f + component.bleedChance / 100f;
			}
			orig.Invoke(victimObject, attackerObject, dotIndex, duration, damageMultiplier, maxStacksFromAttacker);
		}
	}

	private static void GlobalEventManager_onServerDamageDealt(DamageReport damageReport)
	{
		//IL_0051: Unknown result type (might be due to invalid IL or missing references)
		//IL_005b: Invalid comparison between Unknown and I4
		//IL_0086: Unknown result type (might be due to invalid IL or missing references)
		//IL_0090: Unknown result type (might be due to invalid IL or missing references)
		//IL_0092: Invalid comparison between Unknown and I4
		//IL_0096: 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_00ad: Unknown result type (might be due to invalid IL or missing references)
		//IL_00af: Invalid comparison between Unknown and I4
		//IL_00d4: 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_0121: 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)
		if (!Object.op_Implicit((Object)(object)damageReport.attacker) || !Object.op_Implicit((Object)(object)damageReport.attackerBody) || !Object.op_Implicit((Object)(object)damageReport.victim))
		{
			return;
		}
		BriarTracker component = damageReport.attacker.GetComponent<BriarTracker>();
		if (!Object.op_Implicit((Object)(object)component))
		{
			return;
		}
		if ((int)damageReport.damageInfo.damageType == 262176)
		{
			damageReport.victim.body.AddTimedBuff(Prefabs.armorbreak, 5f);
		}
		bool flag = (damageReport.damageInfo.damageType & 0x40000) > 0;
		if ((int)damageReport.dotType == 0 && (damageReport.damageInfo.damageType & 0x4000000) > 0)
		{
			damageReport.attackerBody.healthComponent.Heal(damageReport.damageDealt * 0.1f, default(ProcChainMask), true);
		}
		else if (flag)
		{
			if (damageReport.attackerBody.HasBuff(Prefabs.frenzyUlt))
			{
				damageReport.attackerBody.healthComponent.Heal(damageReport.damageDealt * 0.2f, default(ProcChainMask), true);
			}
			DotController.InflictDot(((Component)damageReport.victim).gameObject, damageReport.attacker, (DotIndex)0, 3f * damageReport.damageInfo.procCoefficient, 1f, (uint?)666u);
		}
	}
}
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInPlugin("com.Dragonyck.Briar", "Briar", "1.0.1")]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[NetworkCompatibility(/*Could not decode attribute arguments.*/)]
public class MainPlugin : BaseUnityPlugin
{
	public const string MODUID = "com.Dragonyck.Briar";

	public const string MODNAME = "Briar";

	public const string VERSION = "1.0.1";

	public const string SURVIVORNAME = "Briar";

	public const string SURVIVORNAMEKEY = "BRIAR";

	public static GameObject characterPrefab;

	public static readonly Color characterColor = Color32.op_Implicit(new Color32((byte)222, (byte)0, (byte)66, byte.MaxValue));

	public static SkillDef special;

	private void Awake()
	{
		Assets.PopulateAssets();
		Prefabs.CreatePrefabs();
		CreatePrefab();
		RegisterStates();
		RegisterCharacter();
		Hook.Hooks();
	}

	internal static void CreatePrefab()
	{
		//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_00dc: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e2: Expected O, but got Unknown
		//IL_010d: Unknown result type (might be due to invalid IL or missing references)
		//IL_011e: Unknown result type (might be due to invalid IL or missing references)
		//IL_013e: 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_0155: Expected O, but got Unknown
		//IL_017e: 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_01a2: Unknown result type (might be due to invalid IL or missing references)
		//IL_01c5: 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_01df: 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_0383: Unknown result type (might be due to invalid IL or missing references)
		//IL_03bd: Unknown result type (might be due to invalid IL or missing references)
		//IL_03c2: Unknown result type (might be due to invalid IL or missing references)
		//IL_0426: Unknown result type (might be due to invalid IL or missing references)
		//IL_042b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0458: Unknown result type (might be due to invalid IL or missing references)
		//IL_045d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0506: Unknown result type (might be due to invalid IL or missing references)
		//IL_0526: Unknown result type (might be due to invalid IL or missing references)
		//IL_0533: Unknown result type (might be due to invalid IL or missing references)
		//IL_05db: Unknown result type (might be due to invalid IL or missing references)
		//IL_0764: Unknown result type (might be due to invalid IL or missing references)
		//IL_07c0: Unknown result type (might be due to invalid IL or missing references)
		//IL_07ca: Unknown result type (might be due to invalid IL or missing references)
		//IL_07de: Unknown result type (might be due to invalid IL or missing references)
		//IL_080c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0811: Unknown result type (might be due to invalid IL or missing references)
		//IL_0869: Unknown result type (might be due to invalid IL or missing references)
		//IL_086e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0891: Unknown result type (might be due to invalid IL or missing references)
		//IL_0896: Unknown result type (might be due to invalid IL or missing references)
		//IL_08c4: Unknown result type (might be due to invalid IL or missing references)
		//IL_08c9: Unknown result type (might be due to invalid IL or missing references)
		GameObject val = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Merc/MercBody.prefab").WaitForCompletion();
		characterPrefab = PrefabAPI.InstantiateClone(val, "BriarBody", true);
		characterPrefab.GetComponent<NetworkIdentity>().localPlayerAuthority = true;
		characterPrefab.AddComponent<NetBehaviour>();
		BriarTracker briarTracker = characterPrefab.AddComponent<BriarTracker>();
		((HuntressTracker)briarTracker).maxTrackingDistance = 14f;
		((HuntressTracker)briarTracker).maxTrackingAngle = 35f;
		Object.Destroy((Object)(object)((Component)characterPrefab.transform.Find("ModelBase")).gameObject);
		Object.Destroy((Object)(object)((Component)characterPrefab.transform.Find("CameraPivot")).gameObject);
		Object.Destroy((Object)(object)((Component)characterPrefab.transform.Find("AimOrigin")).gameObject);
		GameObject val2 = Assets.MainAssetBundle.LoadAsset<GameObject>("brerMdl");
		val2.AddComponent<ModelBehaviour>();
		GameObject val3 = new GameObject("ModelBase");
		val3.transform.parent = characterPrefab.transform;
		val3.transform.localPosition = new Vector3(0f, -0.94f, 0f);
		val3.transform.localRotation = Quaternion.identity;
		val3.transform.localScale = new Vector3(1f, 1f, 1f);
		GameObject val4 = new GameObject("AimOrigin");
		val4.transform.parent = val3.transform;
		val4.transform.localPosition = new Vector3(0f, 1.4f, 0f);
		val4.transform.localRotation = Quaternion.identity;
		val4.transform.localScale = Vector3.one;
		Transform transform = val2.transform;
		transform.parent = val3.transform;
		transform.localPosition = Vector3.zero;
		transform.localScale = Vector3.one;
		transform.localRotation = Quaternion.identity;
		CharacterDirection component = characterPrefab.GetComponent<CharacterDirection>();
		component.targetTransform = val3.transform;
		component.modelAnimator = val2.GetComponentInChildren<Animator>();
		component.turnSpeed = 720f;
		CharacterBody component2 = characterPrefab.GetComponent<CharacterBody>();
		((Object)component2).name = "BriarBody";
		component2.baseNameToken = "BRIAR_NAME";
		component2.subtitleNameToken = "BRIAR_SUBTITLE";
		component2.bodyFlags = (BodyFlags)16;
		component2.rootMotionInMainState = false;
		component2.mainRootSpeed = 0f;
		component2.baseMaxHealth = 220f;
		component2.levelMaxHealth = 62f;
		component2.baseRegen = 0f;
		component2.levelRegen = 0f;
		component2.baseMaxShield = 0f;
		component2.levelMaxShield = 0f;
		component2.baseMoveSpeed = 9f;
		component2.levelMoveSpeed = 0f;
		component2.baseAcceleration = 110f;
		component2.baseJumpPower = 15f;
		component2.levelJumpPower = 0f;
		component2.baseDamage = 16f;
		component2.levelDamage = 2.4f;
		component2.baseAttackSpeed = 1f;
		component2.levelAttackSpeed = 0f;
		component2.baseCrit = 1f;
		component2.levelCrit = 0f;
		component2.baseArmor = 20f;
		component2.levelArmor = 0f;
		component2.baseJumpCount = 3;
		component2.sprintingSpeedMultiplier = 1.45f;
		component2.wasLucky = false;
		component2.hideCrosshair = false;
		component2.aimOriginTransform = val4.transform;
		component2.hullClassification = (HullClassification)0;
		component2.portraitIcon = (Texture)(object)Assets.MainAssetBundle.LoadAsset<Sprite>("portrait").texture;
		component2.isChampion = false;
		component2.currentVehicle = null;
		component2.skinIndex = 0u;
		component2.bodyColor = characterColor;
		CharacterMotor component3 = characterPrefab.GetComponent<CharacterMotor>();
		component3.walkSpeedPenaltyCoefficient = 1f;
		component3.characterDirection = component;
		component3.muteWalkMotion = false;
		component3.mass = 100f;
		component3.airControl = 0.25f;
		component3.disableAirControlUntilCollision = false;
		component3.generateParametersOnAwake = true;
		InputBankTest component4 = characterPrefab.GetComponent<InputBankTest>();
		component4.moveVector = Vector3.zero;
		CameraTargetParams component5 = characterPrefab.GetComponent<CameraTargetParams>();
		component5.cameraParams = val.GetComponent<CameraTargetParams>().cameraParams;
		component5.cameraPivotTransform = null;
		component5.recoil = Vector2.zero;
		component5.dontRaycastToPivot = false;
		ModelLocator component6 = characterPrefab.GetComponent<ModelLocator>();
		component6.modelTransform = transform;
		component6.modelBaseTransform = val3.transform;
		component6.dontReleaseModelOnDeath = false;
		component6.autoUpdateModelTransform = true;
		component6.dontDetatchFromParent = false;
		component6.noCorpse = false;
		component6.normalizeToFloor = false;
		component6.preserveModel = false;
		ChildLocator component7 = val2.GetComponent<ChildLocator>();
		CharacterModel val5 = val2.AddComponent<CharacterModel>();
		SkinnedMeshRenderer[] componentsInChildren = val2.GetComponentsInChildren<SkinnedMeshRenderer>();
		List<RendererInfo> list = new List<RendererInfo>();
		foreach (SkinnedMeshRenderer val6 in componentsInChildren)
		{
			((Renderer)val6).material = Utils.InstantiateMaterial(((Renderer)val6).material.mainTexture);
			list.Add(new RendererInfo
			{
				renderer = (Renderer)(object)val6,
				defaultMaterial = ((Renderer)val6).material,
				defaultShadowCastingMode = (ShadowCastingMode)1,
				ignoreOverlays = false
			});
		}
		RendererInfo[] array = list.ToArray();
		val5.body = component2;
		val5.baseRendererInfos = array;
		val5.autoPopulateLightInfos = true;
		val5.invisibilityCount = 0;
		val5.temporaryOverlays = new List<TemporaryOverlay>();
		val5.mainSkinnedMeshRenderer = componentsInChildren[0];
		GameObject gameObject = ((Component)transform).gameObject;
		CharacterModel component8 = gameObject.GetComponent<CharacterModel>();
		ModelSkinController val7 = gameObject.AddComponent<ModelSkinController>();
		ChildLocator component9 = gameObject.GetComponent<ChildLocator>();
		LanguageAPI.Add("BRIARBODY_DEFAULT_SKIN_NAME", "Default");
		val7.skins = (SkinDef[])(object)new SkinDef[1] { LoadoutAPI.CreateNewSkinDef(Utils.CreateNewSkinDefInfo(componentsInChildren, gameObject, "BRIARBODY_DEFAULT_SKIN_NAME", array)) };
		((Component)component7.FindChild("frenzyHead")).gameObject.SetActive(false);
		((Component)component7.FindChild("frenzyWeapon")).gameObject.SetActive(false);
		HealthComponent component10 = characterPrefab.GetComponent<HealthComponent>();
		component10.health = component2.baseMaxHealth;
		component10.shield = 0f;
		component10.barrier = 0f;
		component10.magnetiCharge = 0f;
		component10.body = null;
		component10.dontShowHealthbar = false;
		characterPrefab.GetComponent<Interactor>().maxInteractionDistance = 3f;
		characterPrefab.GetComponent<InteractionDriver>().highlightInteractor = true;
		SfxLocator component11 = characterPrefab.GetComponent<SfxLocator>();
		component11.deathSound = "Play_ui_player_death";
		component11.barkSound = "";
		component11.openSound = "";
		component11.landingSound = "Play_char_land";
		component11.fallDamageSound = "Play_char_land_fall_damage";
		component11.aliveLoopStart = "";
		component11.aliveLoopStop = "";
		characterPrefab.GetComponent<Rigidbody>().mass = 100f;
		Collider[] componentsInChildren2 = val2.GetComponentsInChildren<Collider>();
		HurtBoxGroup val8 = val2.AddComponent<HurtBoxGroup>();
		List<HurtBox> list2 = new List<HurtBox>();
		Collider[] array2 = componentsInChildren2;
		foreach (Collider val9 in array2)
		{
			HurtBox val10 = ((Component)val9).gameObject.AddComponent<HurtBox>();
			((Component)val10).gameObject.layer = LayerIndex.entityPrecise.intVal;
			val10.healthComponent = component10;
			val10.isBullseye = true;
			val10.damageModifier = (DamageModifier)0;
			val10.hurtBoxGroup = val8;
			val10.indexInGroup = 0;
			val8.mainHurtBox = val10;
			val8.bullseyeCount = 1;
			list2.Add(val10);
		}
		val8.hurtBoxes = list2.ToArray();
		Utils.CreateHitbox("Swing", val2.transform, Vector3.one * 9.5f, new Vector3(0f, 1.5f, 2.5f));
		component7.transformPairs[component7.FindChildIndex("screamMuzzle")].transform = Utils.CreateHitbox("Scream", val2.transform, Vector3.one, Vector3.zero).transform;
		KinematicCharacterMotor component12 = characterPrefab.GetComponent<KinematicCharacterMotor>();
		component12.CharacterController = (BaseCharacterController)(object)component3;
		FootstepHandler val11 = val2.AddComponent<FootstepHandler>();
		val11.baseFootstepString = "Play_player_footstep";
		val11.sprintFootstepOverrideString = "";
		val11.enableFootstepDust = true;
		val11.footstepDustPrefab = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Common/VFX/GenericFootstepDust.prefab").WaitForCompletion();
		EntityStateMachine component13 = ((Component)component2).GetComponent<EntityStateMachine>();
		component13.mainStateType = new SerializableEntityStateType(typeof(CharacterMain));
		CharacterDeathBehavior component14 = characterPrefab.GetComponent<CharacterDeathBehavior>();
		component14.deathStateMachine = characterPrefab.GetComponent<EntityStateMachine>();
		component14.deathState = new SerializableEntityStateType(typeof(GenericCharacterDeath));
		Utils.NewStateMachine<Idle>(characterPrefab, "Frenzy");
		Utils.NewStateMachine<Idle>(characterPrefab, "Ult");
		NetworkStateMachine component15 = ((Component)component2).GetComponent<NetworkStateMachine>();
		component15.stateMachines = ((Component)component2).GetComponents<EntityStateMachine>();
		ContentAddition.AddBody(characterPrefab);
	}

	private void RegisterCharacter()
	{
		//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)
		string text = " <style=cSub>\r\n\r\n< ! > \r\n\r\n< ! > \r\n\r\n< ! > \r\n\r\n< ! > \r\n\r\n";
		string text2 = "..and so she left, ever hungry.";
		string text3 = "..and so she vanished.";
		string text4 = "A failed experiment by the Black Rose, Briar’s uncontrollable bloodlust required a special pillory to focus her frenzied mind. After years of confinement this living weapon broke free from her restraints and unleashed herself into the world. Now she’s controlled by no one—following only her hunger for knowledge and blood—and relishes the opportunities to let loose, even if reining back the frenzy isn’t easy.";
		LanguageAPI.Add("BRIAR_NAME", "Briar");
		LanguageAPI.Add("BRIAR_DESCRIPTION", text);
		LanguageAPI.Add("BRIAR_SUBTITLE", "THE RESTRAINED HUNGER");
		LanguageAPI.Add("BRIAR_OUTRO", text2);
		LanguageAPI.Add("BRIAR_FAIL", text3);
		LanguageAPI.Add("BRIAR_LORE", text4);
		SurvivorDef val = ScriptableObject.CreateInstance<SurvivorDef>();
		val.cachedName = "BRIAR_NAME";
		val.unlockableDef = null;
		val.descriptionToken = "BRIAR_DESCRIPTION";
		val.primaryColor = characterColor;
		val.bodyPrefab = characterPrefab;
		val.displayPrefab = Utils.NewDisplayModel(((Component)characterPrefab.GetComponent<ModelLocator>().modelBaseTransform).gameObject, "BriarDisplay");
		val.outroFlavorToken = "BRIAR_OUTRO";
		val.desiredSortPosition = 17f;
		val.mainEndingEscapeFailureFlavorToken = "BRIAR_FAIL";
		ContentAddition.AddSurvivorDef(val);
		SkillSetup();
		GameObject val2 = PrefabAPI.InstantiateClone(Prefabs.Load<GameObject>("RoR2/Base/Merc/MercMonsterMaster.prefab"), "BriarMaster", true);
		ContentAddition.AddMaster(val2);
		CharacterMaster component = val2.GetComponent<CharacterMaster>();
		component.bodyPrefab = characterPrefab;
	}

	private void RegisterStates()
	{
		//IL_0003: 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_0013: 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_0023: 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_0033: 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_0043: 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_0053: Unknown result type (might be due to invalid IL or missing references)
		bool flag = default(bool);
		ContentAddition.AddEntityState<Primary>(ref flag);
		ContentAddition.AddEntityState<Secondary>(ref flag);
		ContentAddition.AddEntityState<SecondaryFire>(ref flag);
		ContentAddition.AddEntityState<Utility>(ref flag);
		ContentAddition.AddEntityState<Special>(ref flag);
		ContentAddition.AddEntityState<SpecialTeleport>(ref flag);
		ContentAddition.AddEntityState<SpecialSlash>(ref flag);
		ContentAddition.AddEntityState<CharacterMain>(ref flag);
		ContentAddition.AddEntityState<MeleeSkillState>(ref flag);
		ContentAddition.AddEntityState<BasicMeleeSkillState>(ref flag);
		ContentAddition.AddEntityState<Frenzy>(ref flag);
	}

	private void SkillSetup()
	{
		GenericSkill[] componentsInChildren = characterPrefab.GetComponentsInChildren<GenericSkill>();
		foreach (GenericSkill val in componentsInChildren)
		{
			Object.DestroyImmediate((Object)(object)val);
		}
		PassiveSetup();
		PrimarySetup();
		SecondarySetup();
		UtilitySetup();
		SpecialSetup();
	}

	private void PassiveSetup()
	{
		SkillLocator component = characterPrefab.GetComponent<SkillLocator>();
		LanguageAPI.Add("BRIAR_PASSIVE_NAME", "Crimson Curse");
		LanguageAPI.Add("BRIAR_PASSIVE_DESCRIPTION", "Briar's basic attacks and abilities inflict a <style=cIsHealth>bleed</style> against enemies. The bleed damage is multiplied by bleed chance. She <style=cIsHealing>heals</style> herself for <style=cIsHealing>10%</style> of the bleed damage dealt. Briar has no health regeneration, but healing received from all sources is multiplied by her missing health percentage.");
		component.passiveSkill.enabled = true;
		component.passiveSkill.skillNameToken = "BRIAR_PASSIVE_NAME";
		component.passiveSkill.skillDescriptionToken = "BRIAR_PASSIVE_DESCRIPTION";
		component.passiveSkill.icon = Assets.MainAssetBundle.LoadAsset<Sprite>("briarp");
	}

	private void PrimarySetup()
	{
		//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_007b: Unknown result type (might be due to invalid IL or missing references)
		SkillLocator component = characterPrefab.GetComponent<SkillLocator>();
		LanguageAPI.Add("BRIAR_M1", "Head Rush");
		LanguageAPI.Add("BRIAR_M1_DESCRIPTION", "Briar Dash leaps to the target unit, dealing <style=cIsDamage>420% damage</style>, <style=cIsDamage>stuns</style> and reduces the enemy's armor by <style=cIsDamage>25</style> for <style=cIsUtility>5s</style>.");
		HuntressTrackingSkillDef val = ScriptableObject.CreateInstance<HuntressTrackingSkillDef>();
		((SkillDef)val).activationState = new SerializableEntityStateType(typeof(Primary));
		((SkillDef)val).activationStateMachineName = "Weapon";
		((SkillDef)val).baseMaxStock = 1;
		((SkillDef)val).baseRechargeInterval = 1.5f;
		((SkillDef)val).beginSkillCooldownOnSkillEnd = true;
		((SkillDef)val).canceledFromSprinting = false;
		((SkillDef)val).fullRestockOnAssign = true;
		((SkillDef)val).interruptPriority = (InterruptPriority)0;
		((SkillDef)val).isCombatSkill = true;
		((SkillDef)val).mustKeyPress = false;
		((SkillDef)val).cancelSprintingOnActivation = false;
		((SkillDef)val).rechargeStock = 1;
		((SkillDef)val).requiredStock = 1;
		((SkillDef)val).stockToConsume = 1;
		((SkillDef)val).icon = Assets.MainAssetBundle.LoadAsset<Sprite>("briarq");
		((SkillDef)val).skillDescriptionToken = "BRIAR_M1_DESCRIPTION";
		((SkillDef)val).skillName = "BRIAR_M1";
		((SkillDef)val).skillNameToken = "BRIAR_M1";
		ContentAddition.AddSkillDef((SkillDef)(object)val);
		component.primary = Utils.NewGenericSkill(characterPrefab, (SkillDef)(object)val);
	}

	private void SecondarySetup()
	{
		//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_007b: Unknown result type (might be due to invalid IL or missing references)
		SkillLocator component = characterPrefab.GetComponent<SkillLocator>();
		LanguageAPI.Add("BRIAR_M2", "Blood Frenzy");
		LanguageAPI.Add("BRIAR_M2_DESCRIPTION", "Briar Dash dashes to the target location, gaining <style=cIsHealth>Blood Frenzy</style> for <style=cIsUtility>8s</style>. During it, Briar is forced to attack the nearest enemy for <style=cIsDamage>220% damage</style>. She can also cast <style=cIsDamage>Snack Attack</style>, which deals <style=cIsDamage>500% damage</style> and deals more damage the lower the target's health is, as well as <style=cIsHealing>healing</style> her for <style=cIsHealing>40%</style> of her max hp.");
		SkillDef val = ScriptableObject.CreateInstance<SkillDef>();
		val.activationState = new SerializableEntityStateType(typeof(Utility));
		val.activationStateMachineName = "Frenzy";
		val.baseMaxStock = 1;
		val.baseRechargeInterval = 5f;
		val.beginSkillCooldownOnSkillEnd = true;
		val.canceledFromSprinting = false;
		val.fullRestockOnAssign = false;
		val.interruptPriority = (InterruptPriority)0;
		val.isCombatSkill = true;
		val.mustKeyPress = true;
		val.cancelSprintingOnActivation = false;
		val.rechargeStock = 1;
		val.requiredStock = 1;
		val.stockToConsume = 1;
		val.icon = Assets.MainAssetBundle.LoadAsset<Sprite>("briarw");
		val.skillDescriptionToken = "BRIAR_M2_DESCRIPTION";
		val.skillName = "BRIAR_M2";
		val.skillNameToken = "BRIAR_M2";
		ContentAddition.AddSkillDef(val);
		component.secondary = Utils.NewGenericSkill(characterPrefab, val);
	}

	private void UtilitySetup()
	{
		//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_007b: Unknown result type (might be due to invalid IL or missing references)
		SkillLocator component = characterPrefab.GetComponent<SkillLocator>();
		LanguageAPI.Add("BRIAR_UTIL", "Chilling Scream");
		LanguageAPI.Add("BRIAR_UTIL_DESCRIPTION", "Briar charges for up to 1 second, cancelling <style=cIsHealth>Blood Frenzy</style>, during which she increases <style=cIsDamage>Chilling Scream's</style> damage and range, and gains <style=cIsDamage>100 armor</style> and <style=cIsHealing>heals</style> herself for <style=cIsHealing>2.5%</style> of her max hp every 0.25s. Unleashing the scream, will deal <style=cIsDamage>100%-800%</style> damage, knocking back enemies. At it's maximum charge, if enemies that are knocked back collide with walls will rebound to take <style=cIsDamage>15%</style> of their max hp and get <style=cIsDamage>stunned</style>.");
		SkillDef val = ScriptableObject.CreateInstance<SkillDef>();
		val.activationState = new SerializableEntityStateType(typeof(Secondary));
		val.activationStateMachineName = "Weapon";
		val.baseMaxStock = 1;
		val.baseRechargeInterval = 5f;
		val.beginSkillCooldownOnSkillEnd = true;
		val.canceledFromSprinting = false;
		val.fullRestockOnAssign = false;
		val.interruptPriority = (InterruptPriority)0;
		val.isCombatSkill = true;
		val.mustKeyPress = true;
		val.cancelSprintingOnActivation = false;
		val.rechargeStock = 1;
		val.requiredStock = 1;
		val.stockToConsume = 1;
		val.icon = Assets.MainAssetBundle.LoadAsset<Sprite>("briare");
		val.skillDescriptionToken = "BRIAR_UTIL_DESCRIPTION";
		val.skillName = "BRIAR_UTIL";
		val.skillNameToken = "BRIAR_UTIL";
		ContentAddition.AddSkillDef(val);
		component.utility = Utils.NewGenericSkill(characterPrefab, val);
	}

	private void SpecialSetup()
	{
		//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_007b: 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_0116: Unknown result type (might be due to invalid IL or missing references)
		//IL_016b: Unknown result type (might be due to invalid IL or missing references)
		SkillLocator component = characterPrefab.GetComponent<SkillLocator>();
		LanguageAPI.Add("BRIAR_SPEC", "Certain Death");
		LanguageAPI.Add("BRIAR_SPEC_DESCRIPTION", "Briar kicks her pillory's hemolith in the target direction, marking the first enemy hit. If a target is hit, Briar <style=cIsHealing>cleanses</style> herself from all debuffs and immediately teleports to them. Upon arrival, she creates an explosion around the marked target that deals <style=cIsDamage>1600% damage</style> and gains all effects of <style=cIsDamage>Blood Frenzy</style> as well as <style=cIsDamage>10 armor</style> and <style=cIsHealing>20% life steal</style>.");
		SkillDef val = ScriptableObject.CreateInstance<SkillDef>();
		val.activationState = new SerializableEntityStateType(typeof(Special));
		val.activationStateMachineName = "Ult";
		val.baseMaxStock = 1;
		val.baseRechargeInterval = 18f;
		val.beginSkillCooldownOnSkillEnd = true;
		val.canceledFromSprinting = false;
		val.fullRestockOnAssign = false;
		val.interruptPriority = (InterruptPriority)0;
		val.isCombatSkill = false;
		val.mustKeyPress = true;
		val.cancelSprintingOnActivation = false;
		val.rechargeStock = 1;
		val.requiredStock = 1;
		val.stockToConsume = 1;
		val.icon = Assets.MainAssetBundle.LoadAsset<Sprite>("briarr");
		val.skillDescriptionToken = "BRIAR_SPEC_DESCRIPTION";
		val.skillName = "BRIAR_SPEC";
		val.skillNameToken = "BRIAR_SPEC";
		ContentAddition.AddSkillDef(val);
		component.special = Utils.NewGenericSkill(characterPrefab, val);
		special = (SkillDef)(object)ScriptableObject.CreateInstance<TPSkillDef>();
		special.activationState = new SerializableEntityStateType(typeof(SpecialTeleport));
		special.activationStateMachineName = "Weapon";
		special.baseMaxStock = 0;
		special.baseRechargeInterval = 0f;
		special.beginSkillCooldownOnSkillEnd = true;
		special.canceledFromSprinting = false;
		special.fullRestockOnAssign = true;
		special.interruptPriority = (InterruptPriority)0;
		special.isCombatSkill = true;
		special.mustKeyPress = true;
		special.cancelSprintingOnActivation = false;
		special.rechargeStock = 0;
		special.requiredStock = 0;
		special.stockToConsume = 0;
		special.icon = Assets.MainAssetBundle.LoadAsset<Sprite>("briarw");
		special.skillDescriptionToken = "BRIAR_SPEC_DESCRIPTION";
		special.skillName = "BRIAR_SPEC";
		special.skillNameToken = "BRIAR_SPEC";
		ContentAddition.AddSkillDef(special);
	}
}
internal class NoFrenzySkillDef : SkillDef
{
	private class InstanceData : BaseSkillInstanceData
	{
		public BriarTracker tracker;
	}

	public override BaseSkillInstanceData OnAssigned([NotNull] GenericSkill skillSlot)
	{
		return (BaseSkillInstanceData)(object)new InstanceData
		{
			tracker = ((Component)skillSlot).GetComponent<BriarTracker>()
		};
	}

	internal static bool IsExecutable([NotNull] GenericSkill skillSlot)
	{
		InstanceData instanceData = (InstanceData)(object)skillSlot.skillInstanceData;
		BriarTracker tracker = instanceData.tracker;
		return !tracker.inFrenzy;
	}

	public override bool CanExecute([NotNull] GenericSkill skillSlot)
	{
		return IsExecutable(skillSlot) && ((SkillDef)this).CanExecute(skillSlot);
	}

	public override bool IsReady([NotNull] GenericSkill skillSlot)
	{
		return ((SkillDef)this).IsReady(skillSlot) && IsExecutable(skillSlot);
	}
}
internal class Prefabs
{
	internal static GameObject ultProjectileGhost;

	internal static GameObject ultProjectile;

	internal static GameObject wallCollider;

	internal static GameObject screamIndicator;

	internal static GameObject wallImpact;

	internal static GameObject ultExplosion;

	internal static GameObject blinkEffect;

	internal static GameObject swingEffect;

	internal static GameObject blinkDestinationEffect;

	internal static GameObject kickHitEffect;

	internal static GameObject screamHitEffect;

	internal static GameObject screamHitEffectCharged;

	internal static GameObject biteHitEffect;

	internal static GameObject slashHitEffect;

	internal static GameObject trackingIndicator;

	internal static GameObject screamEffect;

	internal static GameObject projectileHitEffect;

	internal static GameObject projectileCastEffect;

	internal static GameObject kickSwingEffect;

	internal static Sprite baseIcon;

	internal static Sprite biteIcon;

	internal static Material ultHitOverlay;

	internal static RuntimeAnimatorController baseAnimator;

	internal static RuntimeAnimatorController frenzyAnimator;

	internal static BuffDef armor;

	internal static BuffDef armorbreak;

	internal static BuffDef frenzy;

	internal static BuffDef frenzyUlt;

	internal static T Load<T>(string path)
	{
		//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)
		return Addressables.LoadAssetAsync<T>((object)path).WaitForCompletion();
	}

	internal static void CreatePrefabs()
	{
		//IL_0029: Unknown result type (might be due to invalid IL or missing references)
		//IL_0033: Expected O, but got Unknown
		//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d4: 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_0114: 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_0151: Unknown result type (might be due to invalid IL or missing references)
		//IL_0166: Unknown result type (might be due to invalid IL or missing references)
		//IL_016c: Expected O, but got Unknown
		//IL_018d: 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_0208: Unknown result type (might be due to invalid IL or missing references)
		//IL_0212: Expected O, but got Unknown
		//IL_024e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0258: Unknown result type (might be due to invalid IL or missing references)
		//IL_0279: Unknown result type (might be due to invalid IL or missing references)
		//IL_029a: Unknown result type (might be due to invalid IL or missing references)
		//IL_02cf: Unknown result type (might be due to invalid IL or missing references)
		//IL_02f0: Unknown result type (might be due to invalid IL or missing references)
		//IL_0311: Unknown result type (might be due to invalid IL or missing references)
		//IL_03b7: Unknown result type (might be due to invalid IL or missing references)
		//IL_03c1: Expected O, but got Unknown
		//IL_048b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0490: Unknown result type (might be due to invalid IL or missing references)
		//IL_04a4: Unknown result type (might be due to invalid IL or missing references)
		//IL_04ae: Unknown result type (might be due to invalid IL or missing references)
		//IL_04c2: Unknown result type (might be due to invalid IL or missing references)
		//IL_04cc: Unknown result type (might be due to invalid IL or missing references)
		//IL_04d1: Unknown result type (might be due to invalid IL or missing references)
		//IL_04e5: Unknown result type (might be due to invalid IL or missing references)
		//IL_04ef: Unknown result type (might be due to invalid IL or missing references)
		//IL_04f4: Unknown result type (might be due to invalid IL or missing references)
		//IL_0526: Unknown result type (might be due to invalid IL or missing references)
		//IL_0530: Unknown result type (might be due to invalid IL or missing references)
		//IL_0535: Unknown result type (might be due to invalid IL or missing references)
		//IL_057e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0583: Unknown result type (might be due to invalid IL or missing references)
		//IL_0616: Unknown result type (might be due to invalid IL or missing references)
		//IL_0620: Expected O, but got Unknown
		//IL_062d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0693: Unknown result type (might be due to invalid IL or missing references)
		//IL_069d: Unknown result type (might be due to invalid IL or missing references)
		//IL_06eb: Unknown result type (might be due to invalid IL or missing references)
		//IL_06f5: Expected O, but got Unknown
		//IL_070b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0710: Unknown result type (might be due to invalid IL or missing references)
		//IL_07ca: Unknown result type (might be due to invalid IL or missing references)
		//IL_07d4: Expected O, but got Unknown
		//IL_07e1: Unknown result type (might be due to invalid IL or missing references)
		//IL_086f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0879: Expected O, but got Unknown
		//IL_0886: Unknown result type (might be due to invalid IL or missing references)
		//IL_0914: Unknown result type (might be due to invalid IL or missing references)
		//IL_091e: Expected O, but got Unknown
		//IL_092b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0981: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a9e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0aa8: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b6a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b74: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b89: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b8f: Expected O, but got Unknown
		//IL_0b95: Unknown result type (might be due to invalid IL or missing references)
		//IL_0bf9: Unknown result type (might be due to invalid IL or missing references)
		//IL_0c1f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0c24: Unknown result type (might be due to invalid IL or missing references)
		//IL_0c6e: Unknown result type (might be due to invalid IL or missing references)
		//IL_09e5: Unknown result type (might be due to invalid IL or missing references)
		//IL_09ef: Expected O, but got Unknown
		//IL_0a27: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a31: Unknown result type (might be due to invalid IL or missing references)
		//IL_0d3d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b09: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b13: Expected O, but got Unknown
		//IL_0d6b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0d75: Expected O, but got Unknown
		//IL_0e20: Unknown result type (might be due to invalid IL or missing references)
		//IL_0e27: Expected O, but got Unknown
		//IL_0e3a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0e3f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0f5c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ccf: Unknown result type (might be due to invalid IL or missing references)
		//IL_0cd9: Expected O, but got Unknown
		baseIcon = Assets.Load<Sprite>("briarw");
		biteIcon = Assets.Load<Sprite>("briarw2");
		ultHitOverlay = new Material(Load<Material>("RoR2/Base/Imp/matImpDissolve.mat"));
		ultHitOverlay.SetFloat("_Boost", 1f);
		ultHitOverlay.SetFloat("_AlphaBoost", 0.8f);
		ultHitOverlay.SetFloat("_ZTest", 8f);
		ultHitOverlay.SetTexture("_Cloud1Tex", (Texture)(object)Load<Texture2D>("RoR2/Base/Common/texCloudCaustic2.png"));
		baseAnimator = Assets.Load<RuntimeAnimatorController>("animator");
		frenzyAnimator = Assets.Load<RuntimeAnimatorController>("frenzyAnimator");
		Sprite sprite = Load<Sprite>("RoR2/Junk/Common/texBuffBodyArmorIcon.tif");
		armor = Utils.NewBuffDef("Chilling Scream", stack: false, hidden: false, sprite, MainPlugin.characterColor);
		armorbreak = Utils.NewBuffDef("Armor Break", stack: false, hidden: false, sprite, MainPlugin.characterColor);
		frenzy = Utils.NewBuffDef("Frenzy", stack: false, hidden: false, Assets.Load<Sprite>("briarwbuff"), Color.white);
		frenzyUlt = Utils.NewBuffDef("Frenzy", stack: false, hidden: false, Assets.Load<Sprite>("briarwbuff"), Color.white);
		projectileCastEffect = PrefabAPI.InstantiateClone(Load<GameObject>("RoR2/Base/ImpBoss/ImpBossFireVoidspikes.prefab"), "ProjectileCastEffect", false);
		projectileCastEffect.transform.localScale = Vector3.one * 0.15f;
		Material val = new Material(Load<Material>("RoR2/Base/Imp/matImpSwipe.mat"));
		val.SetFloat("_Boost", 1f);
		val.SetTextureScale("_Cloud1Tex", new Vector2(4f, 2f));
		ParticleSystemRenderer[] componentsInChildren = projectileCastEffect.GetComponentsInChildren<ParticleSystemRenderer>();
		foreach (ParticleSystemRenderer val2 in componentsInChildren)
		{
			MainModule main = ((Component)val2).GetComponent<ParticleSystem>().main;
			((MainModule)(ref main)).simulationSpace = (ParticleSystemSimulationSpace)0;
			if (((Object)((Renderer)val2).material).name.Contains("Imp") && ((Renderer)val2).material.HasProperty("_Boost"))
			{
				((Renderer)val2).material = new Material(((Renderer)val2).material);
				((Renderer)val2).material.SetFloat("_Boost", 1f);
			}
			string name = ((Object)val2).name;
			if (name == "SwingTrail")
			{
				((Component)val2).transform.localPosition = Vector3.forward * 3f;
				((Component)val2).transform.localRotation = Quaternion.Euler(25f, 4f, 15f);
				((Component)val2).transform.localScale = new Vector3(2f, 1f, 1f);
			}
			if (name == "SwingTrail, Distortion")
			{
				((Component)val2).transform.localPosition = new Vector3(2.8f, -5f, 3f);
				((Component)val2).transform.localRotation = Quaternion.Euler(25f, 4f, 15f);
				((Component)val2).transform.localScale = new Vector3(2f, 1f, 1f);
			}
		}
		Utils.RegisterEffect(projectileCastEffect, -1f);
		projectileHitEffect = PrefabAPI.InstantiateClone(Load<GameObject>("RoR2/Base/ImpBoss/ImpVoidspikeExplosion.prefab"), "ProjectileHitEffect", false);
		ParticleSystemRenderer[] componentsInChildren2 = projectileHitEffect.GetComponentsInChildren<ParticleSystemRenderer>();
		foreach (ParticleSystemRenderer val3 in componentsInChildren2)
		{
			if (((Object)((Renderer)val3).material).name.Contains("Imp") && ((Renderer)val3).material.HasProperty("_Boost"))
			{
				((Renderer)val3).material = new Material(((Renderer)val3).material);
				((Renderer)val3).material.SetFloat("_Boost", 1f);
			}
		}
		Utils.RegisterEffect(projectileHitEffect, -1f);
		screamEffect = PrefabAPI.InstantiateClone(Assets.Load<GameObject>("screamEffect"), "ScreamEffect", false);
		screamEffect.AddComponent<DestroyOnTimer>().duration = 0.5f;
		trackingIndicator = PrefabAPI.InstantiateClone(Load<GameObject>("RoR2/Base/Huntress/HuntressTrackingIndicator.prefab"), "TrackingIndicator", false);
		Object.Destroy((Object)(object)trackingIndicator.GetComponentInChildren<RotateAroundAxis>());
		SpriteRenderer[] componentsInChildren3 = trackingIndicator.GetComponentsInChildren<SpriteRenderer>();
		for (int k = 0; k < componentsInChildren3.Length; k++)
		{
			switch (k)
			{
			case 1:
				componentsInChildren3[k].color = Color32.op_Implicit(new Color32((byte)238, (byte)26, (byte)30, (byte)73));
				((Component)componentsInChildren3[k]).transform.localPosition = Vector3.right * -0.15f;
				((Component)componentsInChildren3[k]).transform.localRotation = Quaternion.Euler(Vector3.forward * 135f);
				((Component)componentsInChildren3[k]).transform.localScale = Vector2.op_Implicit(Vector2.one * 0.3f);
				componentsInChildren3[k].sprite = Load<Sprite>("RoR2/Base/UI/texUICornerTier1.png");
				((Component)componentsInChildren3[k]).transform.parent.parent.localRotation = Quaternion.Euler(Vector3.forward * 90f);
				break;
			case 4:
				((Renderer)componentsInChildren3[k]).enabled = true;
				componentsInChildren3[k].sprite = Load<Sprite>("RoR2/Base/UI/texCrosshairArrow.png");
				componentsInChildren3[k].color = Color32.op_Implicit(new Color32((byte)154, (byte)0, (byte)0, (byte)243));
				break;
			default:
				((Component)componentsInChildren3[k]).gameObject.SetActive(false);
				break;
			}
		}
		slashHitEffect = PrefabAPI.InstantiateClone(Load<GameObject>("RoR2/Base/Common/VFX/OmniImpactVFXSlash.prefab"), "SlashHitEffect", false);
		Object.Destroy((Object)(object)slashHitEffect.GetComponent<OmniEffect>());
		ParticleSystemRenderer[] componentsInChildren4 = slashHitEffect.GetComponentsInChildren<ParticleSystemRenderer>(true);
		foreach (ParticleSystemRenderer val4 in componentsInChildren4)
		{
			((Component)val4).gameObject.SetActive(true);
			((Renderer)val4).material = new Material(((Renderer)val4).material);
			((Renderer)val4).material.SetColor("_TintColor", Color.red);
		}
		Utils.RegisterEffect(slashHitEffect, -1f, "Play_Briar_Attack_Hit");
		biteHitEffect = PrefabAPI.InstantiateClone(Load<GameObject>("RoR2/Base/Croco/CrocoBiteEffect.prefab"), "BiteHitEffect", false);
		Object.Destroy((Object)(object)biteHitEffect.GetComponent<ScaleParticleSystemDuration>());
		biteHitEffect.transform.localScale = Vector3.one * 0.4f;
		ParticleSystemRenderer[] componentsInChildren5 = biteHitEffect.GetComponentsInChildren<ParticleSystemRenderer>(true);
		foreach (ParticleSystemRenderer val5 in componentsInChildren5)
		{
			string name2 = ((Object)val5).name;
			if (name2 == "SwingTrail")
			{
				((Renderer)val5).material = new Material(((Renderer)val5).material);
				((Renderer)val5).material.SetColor("_TintColor", Color32.op_Implicit(new Color32((byte)80, (byte)0, (byte)0, byte.MaxValue)));
			}
			else if (name2 == "Goo")
			{
				((Renderer)val5).material = Load<Material>("RoR2/Base/Common/VFX/matBloodHumanLarge.mat");
			}
		}
		Utils.RegisterEffect(biteHitEffect, -1f, "Play_Briar_Attack_Hit");
		kickHitEffect = PrefabAPI.InstantiateClone(Load<GameObject>("RoR2/Base/Loader/OmniImpactVFXLoader.prefab"), "KickHitEffect", false);
		Object.Destroy((Object)(object)kickHitEffect.GetComponent<OmniEffect>());
		ParticleSystemRenderer[] componentsInChildren6 = kickHitEffect.GetComponentsInChildren<ParticleSystemRenderer>(true);
		foreach (ParticleSystemRenderer val6 in componentsInChildren6)
		{
			((Component)val6).gameObject.SetActive(true);
			((Renderer)val6).material = new Material(((Renderer)val6).material);
			((Renderer)val6).material.SetColor("_TintColor", Color.red);
		}
		Utils.RegisterEffect(kickHitEffect, -1f, "Play_Briar_Kick_Hit");
		screamHitEffect = PrefabAPI.InstantiateClone(Load<GameObject>("RoR2/Base/Common/VFX/OmniImpactVFX.prefab"), "ScreamHitEffect", false);
		Object.Destroy((Object)(object)screamHitEffect.GetComponent<OmniEffect>());
		ParticleSystemRenderer[] componentsInChildren7 = screamHitEffect.GetComponentsInChildren<ParticleSystemRenderer>(true);
		foreach (ParticleSystemRenderer val7 in componentsInChildren7)
		{
			((Component)val7).gameObject.SetActive(true);
			((Renderer)val7).material = new Material(((Renderer)val7).material);
			((Renderer)val7).material.SetColor("_TintColor", Color.red);
		}
		Utils.RegisterEffect(screamHitEffect, -1f, "Play_Briar_Scream_Missile_Hit");
		screamHitEffectCharged = PrefabAPI.InstantiateClone(Load<GameObject>("RoR2/Base/Loader/OmniImpactVFXLoaderLightning.prefab"), "ScreamHitEffect", false);
		Object.Destroy((Object)(object)screamHitEffectCharged.GetComponent<OmniEffect>());
		ParticleSystemRenderer[] componentsInChildren8 = screamHitEffectCharged.GetComponentsInChildren<ParticleSystemRenderer>(true);
		foreach (ParticleSystemRenderer val8 in componentsInChildren8)
		{
			((Component)val8).gameObject.SetActive(true);
			((Renderer)val8).material = new Material(((Renderer)val8).material);
			((Renderer)val8).material.SetColor("_TintColor", Color.red);
		}
		Utils.RegisterEffect(screamHitEffectCharged, -1f, "Play_Briar_Scream_Hit_Charged");
		blinkDestinationEffect = PrefabAPI.InstantiateClone(Load<GameObject>("RoR2/Base/Imp/ImpBossBlinkDestination.prefab"), "BlinkDestinationEffect", false);
		blinkDestinationEffect.GetComponentInChildren<Light>().color = Color.red;
		ParticleSystemRenderer[] componentsInChildren9 = blinkDestinationEffect.GetComponentsInChildren<ParticleSystemRenderer>();
		foreach (ParticleSystemRenderer val9 in componentsInChildren9)
		{
			if (((Object)((Renderer)val9).material).name.Contains("Imp") && ((Renderer)val9).material.HasProperty("_Boost"))
			{
				((Renderer)val9).material = new Material(((Renderer)val9).material);
				((Renderer)val9).material.SetFloat("_Boost", 1f);
			}
			if (((Object)val9).name == "AreaIndicator")
			{
				((Component)val9).transform.localScale = Vector3.one * 6f;
				Utils.AddScaleComponent(((Component)val9).gameObject, 0.55f, AnimationCurve.Linear(0f, 1f, 1f, 0f));
			}
		}
		kickSwingEffect = PrefabAPI.InstantiateClone(Load<GameObject>("RoR2/Base/Imp/ImpSwipeEffect.prefab"), "KickSwingEffect", false);
		kickSwingEffect.transform.localScale = Vector3.one * 0.15f;
		ParticleSystemRenderer[] componentsInChildren10 = kickSwingEffect.GetComponentsInChildren<ParticleSystemRenderer>();
		foreach (ParticleSystemRenderer val10 in componentsInChildren10)
		{
			if (((Object)((Renderer)val10).material).name.Contains("Imp") && ((Renderer)val10).material.HasProperty("_Boost"))
			{
				((Renderer)val10).material = new Material(((Renderer)val10).material);
				((Renderer)val10).material.SetFloat("_Boost", 1f);
			}
		}
		ContentAddition.AddEffect(kickSwingEffect);
		swingEffect = PrefabAPI.InstantiateClone(Load<GameObject>("RoR2/Base/Imp/ImpSwipeEffect.prefab"), "SwingEffect", false);
		swingEffect.transform.localScale = Vector3.one * 0.5f;
		Material val11 = new Material(Load<Material>("RoR2/Base/Merc/matMercSwipe3.mat"));
		val11.SetColor("_TintColor", Color.white);
		val11.SetTexture("_RemapTex", (Texture)(object)Assets.Load<Texture2D>("rampTex"));
		val11.SetFloat("_InvFade", 0f);
		val11.SetFloat("_Boost", 2.5f);
		val11.SetFloat("_AlphaBoost", 1.874f);
		val11.SetTextureScale("_Cloud1Tex", new Vector2(-0.3f, 1.8f));
		swingEffect.GetComponent<Renderer>().material = val11;
		MainModule main2 = swingEffect.GetComponent<ParticleSystem>().main;
		((MainModule)(ref main2)).scalingMode = (ParticleSystemScalingMode)0;
		ContentAddition.AddEffect(swingEffect);
		ultExplosion = PrefabAPI.InstantiateClone(Load<GameObject>("RoR2/Base/ImpBoss/ImpBossBlink.prefab"), "UltExplosion", false);
		ultExplosion.GetComponent<EffectComponent>().applyScale = true;
		ultExplosion.GetComponentInChildren<Light>().color = Color.red;
		ParticleSystemRenderer[] componentsInChildren11 = ultExplosion.GetComponentsInChildren<ParticleSystemRenderer>();
		foreach (ParticleSystemRenderer val12 in componentsInChildren11)
		{
			if (((Object)((Renderer)val12).material).name.Contains("Imp") && ((Renderer)val12).material.HasProperty("_Boost"))
			{
				((Renderer)val12).material = new Material(((Renderer)val12).material);
				((Renderer)val12).material.SetFloat("_Boost", 1f);
			}
		}
		Utils.RegisterEffect(ultExplosion, -1f, "Play_Briar_Ult_Explosion");
		blinkEffect = PrefabAPI.InstantiateClone(Load<GameObject>("RoR2/Base/Imp/ImpBlinkEffect.prefab"), "BlinkEffect", false);
		blinkEffect.GetComponentInChildren<Light>().color = Color.red;
		ParticleSystemRenderer[] componentsInChildren12 = blinkEffect.GetComponentsInChildren<ParticleSystemRenderer>();
		foreach (ParticleSystemRenderer val13 in componentsInChildren12)
		{
			((Renderer)val13).material = new Material(((Renderer)val13).material);
			((Renderer)val13).material.SetFloat("_Boost", 1f);
		}
		ContentAddition.AddEffect(blinkEffect);
		wallImpact = PrefabAPI.InstantiateClone(Load<GameObject>("RoR2/Base/Parent/ParentSlamEffect.prefab"), "WallImpact", false);
		wallImpact.GetComponent<EffectComponent>().applyScale = true;
		ContentAddition.AddEffect(wallImpact);
		screamIndicator = PrefabAPI.InstantiateClone(Assets.Load<GameObject>("ScreamIndicator"), "ScreamIndicator", false);
		Utils.AddScaleComponent(((Component)screamIndicator.transform.GetChild(0)).gameObject, 0.12f);
		Material val14 = new Material(Load<Material>("RoR2/Base/EliteHaunted/matHauntedEliteAreaIndicator.mat"));
		val14.SetColor("_TintColor", Color32.op_Implicit(new Color32((byte)132, (byte)0, (byte)0, byte.MaxValue)));
		val14.SetTexture("_RemapTex", (Texture)(object)Load<Texture2D>("RoR2/Base/Common/ColorRamps/texRampParentFire.png"));
		((Renderer)screamIndicator.GetComponentInChildren<MeshRenderer>()).materials = (Material[])(object)new Material[2]
		{
			Load<Material>("RoR2/Base/Common/VFX/matAreaIndicatorIntersectionOnly.mat"),
			val14
		};
		ultProjectileGhost = PrefabAPI.InstantiateClone(Assets.Load<GameObject>("UltProjectile"), "UltProjectileGhost", false);
		ultProjectileGhost.AddComponent<ProjectileGhostController>();
		Utils.AddScaleComponent(ultProjectileGhost, 0.12f);
		ultProjectile = PrefabAPI.InstantiateClone(Load<GameObject>("RoR2/Base/Lemurian/Fireball.prefab"), "UltProjectile", true);
		ultProjectile.AddComponent<BriarUltProjectileBehaviour>();
		SphereCollider component = ultProjectile.GetComponent<SphereCollider>();
		((Collider)component).isTrigger = true;
		component.radius = 2f;
		ProjectileController component2 = ultProjectile.GetComponent<ProjectileController>();
		component2.ghostPrefab = ultProjectileGhost;
		component2.canImpactOnTrigger = true;
		component2.startSound = "Play_Briar_Ult_Missile_Start";
		ProjectileSingleTargetImpact component3 = ultProjectile.GetComponent<ProjectileSingleTargetImpact>();
		component3.destroyOnWorld = false;
		component3.impactEffect = projectileHitEffect;
		ultProjectile.GetComponent<ProjectileDamage>().damageType = (DamageType)8;
		ContentAddition.AddProjectile(ultProjectile);
		wallCollider = PrefabAPI.InstantiateClone(Assets.Load<GameObject>("WallCollider"), "WallCollider", false);
		wallCollider.layer = LayerIndex.projectile.intVal;
		wallCollider.AddComponent<WallCollisionBehaviour>();
		wallCollider.AddComponent<DestroyOnTimer>().duration = 2f;
	}
}
internal class BasicMeleeSkillState : BaseSkillState
{
	private float duration = 0.2f;

	private Vector3 dir;

	private OverlapAttack attack;

	private float damageCoefficient = 4.2f;

	private GameObject hitEffectPrefab = null;

	private bool parried;

	public Animator animator;

	private uint ID;

	private string hitboxGroupName = "";

	public override void OnEnter()
	{
		((BaseState)this).OnEnter();
		animator = ((EntityState)this).GetModelAnimator();
		if (!animator.GetBool("slide"))
		{
			((BaseState)this).StartAimMode(1f, true);
		}
		((EntityState)this).PlayAnimation("LeftArm, Override", "MeleeAttack");
		AkSoundEngine.PostEvent(ID, ((EntityState)this).gameObject);
		attack = ((BaseState)this).InitMeleeOverlap(damageCoefficient, hitEffectPrefab, ((EntityState)this).GetModelTransform(), hitboxGroupName);
	}

	public override void FixedUpdate()
	{
		((EntityState)this).FixedUpdate();
		if (((EntityState)this).isAuthority)
		{
			attack.Fire((List<HurtBox>)null);
		}
		if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority)
		{
			((EntityState)this).outer.SetNextStateToMain();
		}
	}

	public override void OnExit()
	{
		((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)1;
	}
}
internal class CharacterMain : GenericCharacterMain
{
	public override void FixedUpdate()
	{
		((GenericCharacterMain)this).FixedUpdate();
		if ((((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= 0.2f && ((EntityState)this).characterBody.HasBuff(Prefabs.frenzy)) || ((EntityState)this).characterBody.HasBuff(Prefabs.frenzyUlt))
		{
			((EntityState)this).outer.SetNextState((EntityState)(object)new Frenzy());
		}
	}
}
internal class Frenzy : GenericCharacterMain
{
	public static float duration = 8f;

	public float damageCoefficient = 2.2f;

	public float biteDamageCoefficient = 5f;

	public float attackDuration;

	public float baseAttackDuration = 0.55f;

	public float attackStopwatch = 99f;

	private OverlapAttack atack;

	private int attackIndex = 1;

	private int oldIndex = 1;

	private bool spawnEffect;

	private float stopwatch;

	private bool inBite;

	private float biteStopwatch;

	private BriarTracker tracker;

	private SphereSearch search = new SphereSearch();

	private HurtBox target;

	private bool frenzyUlt;

	private bool hasBite;

	private uint ID;

	public override void OnSerialize(NetworkWriter writer)
	{
		((EntityState)this).OnSerialize(writer);
		writer.Write(frenzyUlt);
	}

	public override void OnDeserialize(NetworkReader reader)
	{
		((EntityState)this).OnDeserialize(reader);
		frenzyUlt = reader.ReadBoolean();
	}

	public override void OnEnter()
	{
		//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)
		//IL_0061: Unknown result type (might be due to invalid IL or missing references)
		//IL_0066: Unknown result type (might be due to invalid IL or missing references)
		//IL_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_00af: 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_00cb: Expected O, but got Unknown
		((GenericCharacterMain)this).OnEnter();
		((BaseCharacterMain)this).modelAnimator.runtimeAnimatorController = Prefabs.frenzyAnimator;
		tracker = ((EntityState)this).GetComponent<BriarTracker>();
		tracker.inFrenzy = true;
		tracker.FrenzyShow();
		((BaseCharacterMain)this).modelAnimator.SetFloat("frenzy", 1f);
		SphereSearch obj = search;
		LayerIndex entityPrecise = LayerIndex.entityPrecise;
		obj.mask = ((LayerIndex)(ref entityPrecise)).mask;
		search.radius = tracker.radialDist;
		attackDuration = baseAttackDuration / Math.Min(((BaseState)this).attackSpeedStat, 4f);
		EffectManager.SpawnEffect(Prefabs.blinkEffect, new EffectData
		{
			origin = ((EntityState)this).characterBody.corePosition,
			scale = 0.2f
		}, false);
		AkSoundEngine.PostEvent(Sounds.Play_Briar_Frenzy_Activate, ((EntityState)this).gameObject);
		ID = AkSoundEngine.PostEvent(Sounds.Play_Briar_Frenzy_Loop, ((EntityState)this).gameObject);
		frenzyUlt = ((EntityState)this).characterBody.HasBuff(Prefabs.frenzyUlt);
		hasBite = !frenzyUlt;
		if (((EntityState)this).isAuthority && !frenzyUlt)
		{
			((EntityState)this).skillLocator.secondary.skillDef.icon = Prefabs.biteIcon;
		}
	}

	private void NewAttack()
	{
		//IL_00b0: 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_00cf: 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)
		AkSoundEngine.PostEvent(Sounds.Play_Briar_Attack_Cast, ((EntityState)this).gameObject);
		((EntityState)this).PlayAnimation("Body", "Attack" + attackIndex, "M1", attackDuration);
		oldIndex = attackIndex;
		spawnEffect = true;
		attackIndex++;
		if (attackIndex >= 5)
		{
			attackIndex = 1;
		}
		if (((EntityState)this).isAuthority)
		{
			atack = ((BaseState)this).InitMeleeOverlap(damageCoefficient, Prefabs.slashHitEffect, ((EntityState)this).GetModelTransform(), "Swing");
			atack.damageType = (DamageType)262144;
		}
		if (NetworkServer.active)
		{
			HealthComponent healthComponent = ((EntityState)this).healthComponent;
			Ray aimRay = ((BaseState)this).GetAimRay();
			healthComponent.TakeDamageForce(((Ray)(ref aimRay)).direction * tracker.swingSelfForce, true, false);
		}
	}

	public void Bite()
	{
		//IL_0057: Unknown result type (might be due to invalid IL or missing references)
		//IL_005c: Unknown result type (might be due to invalid IL or missing references)
		//IL_005f: 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_0095: Unknown result type (might be due to invalid IL or missing references)
		//IL_009b: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f6: Unknown result type (might be due to invalid IL or missing references)
		//IL_0102: Unknown result type (might be due to invalid IL or missing references)
		inBite = true;
		attackStopwatch = 0f;
		AkSoundEngine.PostEvent(Sounds.Play_Briar_Bite, ((EntityState)this).gameObject);
		((EntityState)this).PlayAnimation("Body", "Bite", "M1", attackDuration * 2f);
		if (NetworkServer.active)
		{
			HealthComponent healthComponent = ((EntityState)this).healthComponent;
			Ray aimRay = ((BaseState)this).GetAimRay();
			healthComponent.TakeDamageForce(((Ray)(ref aimRay)).direction * tracker.swingSelfForce, true, false);
			((EntityState)this).healthComponent.Heal(((EntityState)this).healthComponent.fullCombinedHealth * 0.4f, default(ProcChainMask), true);
		}
		if (((EntityState)this).isAuthority)
		{
			((EntityState)this).skillLocator.secondary.skillDef.icon = Prefabs.baseIcon;
			atack = ((BaseState)this).InitMeleeOverlap(biteDamageCoefficient, Prefabs.biteHitEffect, ((EntityState)this).GetModelTransform(), "Swing");
			atack.damageType = (DamageType)786432;
			atack.damageColorIndex = (DamageColorIndex)5;
			atack.Fire((List<HurtBox>)null);
		}
	}

	public override void OnExit()
	{
		//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_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_006d: Expected O, but got Unknown
		if ((Object)(object)((EntityState)this).skillLocator.secondary.skillDef.icon == (Object)(object)Prefabs.biteIcon)
		{
			((EntityState)this).skillLocator.secondary.skillDef.icon = Prefabs.baseIcon;
		}
		EffectManager.SpawnEffect(Prefabs.blinkEffect, new EffectData
		{
			origin = ((EntityState)this).characterBody.corePosition,
			scale = 0.2f
		}, false);
		AkSoundEngine.PostEvent(Sounds.Play_Briar_Frenzy_Deactivate, ((EntityState)this).gameObject);
		AkSoundEngine.StopPlayingID(ID);
		tracker.inFrenzy = false;
		((BaseCharacterMain)this).modelAnimator.runtimeAnimatorController = Prefabs.baseAnimator;
		((EntityState)this).GetComponent<BriarTracker>().Hide();
		((BaseCharacterMain)this).modelAnimator.SetFloat("frenzy", 0f);
		((GenericCharacterMain)this).OnExit();
	}

	public override void HandleMovements()
	{
	}

	public override void Update()
	{
		//IL_0054: 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_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_006d: 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_0042: Unknown result type (might be due to invalid IL or missing references)
		//IL_0072: Unknown result type (might be due to invalid IL or missing references)
		//IL_0073: Unknown result type (might be due to invalid IL or missing references)
		//IL_0074: Unknown result type (might be due to invalid IL or missing references)
		//IL_0079: 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_007b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0094: 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_00a5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
		//IL_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_01a6: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b3: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b4: Unknown result type (might be due to invalid IL or missing references)
		//IL_01c0: 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_016c: 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)
		if (tracker.inPrimary)
		{
			return;
		}
		((GenericCharacterMain)this).Update();
		if (((EntityState)this).isAuthority)
		{
			Vector3 val;
			Vector3 val2;
			if (!Object.op_Implicit((Object)(object)target))
			{
				Ray aimRay = ((BaseState)this).GetAimRay();
				val = ((Ray)(ref aimRay)).direction;
			}
			else
			{
				val2 = ((Component)target).transform.position - ((EntityState)this).characterBody.corePosition;
				val = ((Vector3)(ref val2)).normalized;
			}
			Vector3 val3 = val;
			Vector2 val4 = Util.Vector3XZToVector2XY(val3);
			if (val4 != Vector2.zero)
			{
				((Vector2)(ref val4)).Normalize();
				val2 = new Vector3(val4.x, 0f, val4.y);
				val3 = ((Vector3)(ref val2)).normalized;
			}
			if (Object.op_Implicit((Object)(object)target))
			{
				if (!frenzyUlt && hasBite && ((ButtonState)(ref ((EntityState)this).inputBank.skill2)).justPressed)
				{
					hasBite = false;
					((EntityState)this).GetComponent<NetBehaviour>().CallCmdBite();
				}
				((BaseState)this).SmallHop(((EntityState)this).characterMotor, 0f);
				if (((BaseState)this).FireMeleeOverlap(atack, ((BaseCharacterMain)this).modelAnimator, "Curve", 70f, true))
				{
				}
				if (!Object.op_Implicit((Object)(object)target))
				{
				}
				((EntityState)this).characterMotor.moveDirection = Vector3.zero;
				((EntityState)this).inputBank.moveVector = Vector3.zero;
			}
			else
			{
				if (((ButtonState)(ref ((EntityState)this).inputBank.jump)).justPressed)
				{
					base.jumpInputReceived = true;
				}
				((GenericCharacterMain)this).ProcessJump();
				((EntityState)this).characterMotor.moveDirection = val3;
				((EntityState)this).inputBank.moveVector = val3;
			}
			((EntityState)this).characterDirection.forward = val3;
		}
		base.sprintInputReceived = true;
		((BaseCharacterMain)this).modelAnimator.SetBool("isMoving", true);
		((BaseCharacterMain)this).modelAnimator.SetBool("isSprinting", true);
		((BaseCharacterMain)this).modelAnimator.SetFloat("forwardSpeed", 1f);
	}

	private void Search()
	{
		//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_0029: 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)
		search.origin = ((EntityState)this).characterBody.corePosition;
		target = search.RefreshCandidates().FilterCandidatesByHurtBoxTeam(TeamMask.GetEnemyTeams(((EntityState)this).teamComponent.teamIndex)).OrderCandidatesByDistance()
			.FilterCandidatesByDistinctHurtBoxEntities()
			.GetHurtBoxes()
			.FirstOrDefault();
	}

	public override void FixedUpdate()
	{
		if (tracker.inPrimary)
		{
			return;
		}
		if (((BaseCharacterMain)this).modelAnimator.GetFloat("Curve") >= 0.11f && spawnEffect)
		{
			spawnEffect = false;
			switch (oldIndex)
			{
			case 1:
				EffectManager.SimpleMuzzleFlash(Prefabs.swingEffect, ((EntityState)this).gameObject, "Attack1MuzzleR", false);
				EffectManager.SimpleMuzzleFlash(Prefabs.swingEffect, ((EntityState)this).gameObject, "Attack1MuzzleL", false);
				break;
			case 2:
				EffectManager.SimpleMuzzleFlash(Prefabs.swingEffect, ((EntityState)this).gameObject, "Attack2Muzzle", false);
				break;
			case 3:
				EffectManager.SimpleMuzzleFlash(Prefabs.swingEffect, ((EntityState)this).gameObject, "Attack3MuzzleR", false);
				EffectManager.SimpleMuzzleFlash(Prefabs.swingEffect, ((EntityState)this).gameObject, "Attack3MuzzleL", false);
				break;
			case 4:
				EffectManager.SimpleMuzzleFlash(Prefabs.swingEffect, ((EntityState)this).gameObject, "Attack4MuzzleR", false);
				EffectManager.SimpleMuzzleFlash(Prefabs.swingEffect, ((EntityState)this).gameObject, "Attack4MuzzleL", false);
				break;
			}
		}
		if (inBite)
		{
			stopwatch = 0f;
			biteStopwatch += Time.fixedDeltaTime;
			if (biteStopwatch >= attackDuration * 2f)
			{
				inBite = false;
				biteStopwatch = 0f;
				stopwatch = 1f;
			}
		}
		stopwatch += Time.fixedDeltaTime;
		if (stopwatch >= 0.1f)
		{
			stopwatch = 0f;
			Search();
		}
		attackStopwatch += Time.fixedDeltaTime;
		if (Object.op_Implicit((Object)(object)target) && attackStopwatch >= attackDuration)
		{
			attackStopwatch = 0f;
			NewAttack();
		}
		if (((EntityState)this).isAuthority)
		{
			((EntityState)this).characterBody.isSprinting = true;
		}
		((GenericCharacterMain)this).FixedUpdate();
		if (((EntityState)this).isAuthority)
		{
			((EntityState)this).characterBody.isSprinting = true;
		}
		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)6;
	}
}
internal class MeleeSkillState : BaseSkillState
{
	public float attackDuration;

	public float earlyExitDuration;

	private bool hopped;

	private bool hasSwung;

	public bool isInHitPause;

	public float hitPauseDuration;

	public float hopVelocity;

	public float hitPauseTimer;

	public float stopwatch;

	public HitStopCachedState hitStopCachedState;

	public OverlapAttack overlapAttack;

	public bool hasHit;

	private bool hasAnimParameter;

	private float attackSpeedScaling;

	public Animator animator;

	public virtual float baseAttackDuration => 0f;

	public virtual float baseEarlyExitDuration => 0f;

	public virtual float damageCoefficient => 0f;

	public virtual float forceMagnitude => 440f;

	public virtual float rootMotionSpeed => 25f;

	public virtual float baseHopVelocity => 4f;

	public virtual string layerName => "FullBody, Override";

	public virtual string animationStateName => "";

	public virtual string animParameter => "M1";

	public virtual string hitBoxGroupName => animationStateName;

	public virtual string hitBoxActiveParameter => "Curve";

	public virtual string swingMuzzle => animationStateName + "Muzzle";

	public virtual GameObject swingEffectPrefab => null;

	public virtual bool hopOnHit => true;

	public virtual bool rootMotion => false;

	public virtual bool rootMotionWhileHitting => false;

	public virtual uint swingSound => 0u;

	public virtual DamageType damageType => (DamageType)0;

	public virtual DamageColorIndex damageColor => (DamageColorIndex)0;

	public virtual Vector3 bonusForce => Vector3.zero;

	public virtual GameObject hitEffectPrefab => null;

	public override void OnEnter()
	{
		((BaseState)this).OnEnter();
		attackSpeedScaling = Math.Min(((BaseState)this).attackSpeedStat, 6f);
		attackDuration = baseAttackDuration / attackSpeedScaling;
		earlyExitDuration = baseEarlyExitDuration / attackSpeedScaling;
		hitPauseDuration = GroundLight.hitPauseDuration / attackSpeedScaling;
		hitPauseTimer = hitPauseDuration;
		hopVelocity = baseHopVelocity / attackSpeedScaling;
		animator = ((EntityState)this).GetModelAnimator();
		animator.SetFloat(hitBoxActiveParameter, 0f);
		((BaseState)this).StartAimMode(attackDuration + 1f, false);
		overlapAttack = ((BaseState)this).InitMeleeOverlap(damageCoefficient, hitEffectPrefab, ((EntityState)this).GetModelTransform(), hitBoxGroupName);
		overlapAttack.pushAwayForce = 1f;
		hasAnimParameter = !Utility.IsNullOrWhiteSpace(animParameter);
		if (hasAnimParameter && !Utility.IsNullOrWhiteSpace(animationStateName))
		{
			((EntityState)this).PlayAnimation(layerName, animationStateName, animParameter, attackDuration);
		}
	}

	public virtual Vector3 rootMotionDirection()
	{
		//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_000f: Unknown result type (might be due to invalid IL or missing references)
		return ((EntityState)this).characterDirection.forward;
	}

	public override void FixedUpdate()
	{
		//IL_0042: Unknown result type (might be due to invalid IL or missing references)
		//IL_0274: Unknown result type (might be due to invalid IL or missing references)
		//IL_0279: Unknown result type (might be due to invalid IL or missing references)
		//IL_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_012e: Unknown result type (might be due to invalid IL or missing references)
		//IL_013a: 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_015a: 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_0169: Unknown result type (might be due to invalid IL or missing references)
		//IL_016e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0232: Unknown result type (might be due to invalid IL or missing references)
		//IL_0239: Unknown result type (might be due to invalid IL or missing references)
		//IL_0193: 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_00e3: Unknown result type (might be due to invalid IL or missing references)
		((EntityState)this).FixedUpdate();
		hitPauseTimer -= Time.fixedDeltaTime;
		if (((EntityState)this).isAuthority)
		{
			bool flag = FireMeleeAttack(overlapAttack, animator, hitBoxActiveParameter, forceMagnitude, bonusForce);
			hasHit |= flag;
			if (hasHit)
			{
				if (hopOnHit && !((EntityState)this).characterMotor.isGrounded && !hopped)
				{
					((BaseState)this).SmallHop(((EntityState)this).characterMotor, hopVelocity);
					hopped = false;
				}
				if (!rootMotionWhileHitting && !isInHitPause && hasAnimParameter)
				{
					hitStopCachedState = ((BaseState)this).CreateHitStopCachedState(((EntityState)this).characterMotor, animator, animParameter);
					isInHitPause = true;
				}
			}
			if (animator.GetFloat(hitBoxActiveParameter) > 0.1f && rootMotion && !isInHitPause)
			{
				Vector3 val = rootMotionDirection();
				Vector3 val2 = default(Vector3);
				((Vector3)(ref val2))..ctor(val.x, 0f, val.z);
				CharacterMotor characterMotor = ((EntityState)this).characterMotor;
				characterMotor.rootMotion += val2 * rootMotionSpeed * Time.fixedDeltaTime;
			}
			if (hitPauseTimer <= 0f && isInHitPause)
			{
				((BaseState)this).ConsumeHitStopCachedState(hitStopCachedState, ((EntityState)this).characterMotor, animator);
				isInHitPause = false;
			}
		}
		if (animator.GetFloat(hitBoxActiveParameter) > 0.1f && !hasSwung)
		{
			hasSwung = true;
			AkSoundEngine.PostEvent(swingSound, ((EntityState)this).gameObject);
			if (Object.op_Implicit((Object)(object)swingEffectPrefab) && !Utility.IsNullOrWhiteSpace(swingMuzzle))
			{
				Transform val3 = ((BaseState)this).FindModelChild(swingMuzzle);
				Object.Instantiate<GameObject>(swingEffectPrefab, val3.position, val3.rotation, val3);
			}
		}
		if (!isInHitPause)
		{
			stopwatch += Time.fixedDeltaTime;
		}
		else
		{
			((EntityState)this).characterMotor.velocity = Vector3.zero;
			if (hasAnimParameter)
			{
				animator.SetFloat(animParameter, 0f);
			}
		}
		if (!((EntityState)this).isAuthority || !(stopwatch >= attackDuration - earlyExitDuration))
		{
			return;
		}
		if (((BaseSkillState)this).IsKeyDownAuthority())
		{
			SetState();
		}
		if (stopwatch >= attackDuration)
		{
			BaseSkillState val4 = StateOverride();
			if (val4 != null)
			{
				((EntityState)this).outer.SetNextState((EntityState)(object)val4);
			}
			else
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}
	}

	public bool FireMeleeAttack(OverlapAttack attack, Animator animator, string mecanimHitboxActiveParameter, float forceMagnitude, Vector3 bonusForce)
	{
		//IL_0050: 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_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_0043: Unknown result type (might be due to invalid IL or missing references)
		//IL_0055: Unknown result type (might be due to invalid IL or missing references)
		bool result = false;
		if (Object.op_Implicit((Object)(object)animator) && animator.GetFloat(mecanimHitboxActiveParameter) > 0.1f)
		{
			attack.forceVector = (Object.op_Implicit((Object)(object)((EntityState)this).characterDirection) ? ((EntityState)this).characterDirection.forward : (((EntityState)this).transform.forward * forceMagnitude + bonusForce));
			result = attack.Fire((List<HurtBox>)null);
		}
		return result;
	}

	public virtual void SetState()
	{
	}

	public virtual BaseSkillState StateOverride()
	{
		return null;
	}

	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;
	}
}
internal class Primary : BaseSkillState
{
	private float duration;

	private float baseDuration = 0.85f;

	private float damageCoefficient = 4.2f;

	private OverlapAttack atack;

	private Animator modelAnimator;

	private Vector3 direction;

	private Vector3 tPos;

	private bool tp;

	private BriarTracker tracker;

	private bool hasHit;

	private float speedScale;

	private float targetDistance;

	private bool hopped;

	private AimRequest request;

	private float targetRadius;

	private bool effectSpawned;

	public override void OnEnter()
	{
		//IL_0082: 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_009d: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a4: 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_00b9: 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_00c1: 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_00fa: 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_0126: Unknown result type (might be due to invalid IL or missing references)
		((Bas