Decompiled source of Kindred v1.0.0

Kindred.dll

Decompiled 3 weeks 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 EntityStates.Treebot.Weapon;
using KinematicCharacterController;
using On.RoR2;
using R2API;
using R2API.Utils;
using Rewired.ComponentControls.Effects;
using RoR2;
using RoR2.Orbs;
using RoR2.Skills;
using RoR2.UI;
using ThreeEyedGames;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.Networking;
using UnityEngine.Rendering;

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

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("Kindred.AssetBundle." + "Kindred".ToLower() + "assets");
			MainAssetBundle = AssetBundle.LoadFromStream(stream);
		}
		using Stream stream2 = executingAssembly.GetManifestResourceStream("Kindred.Kindred.bnk");
		byte[] array = new byte[stream2.Length];
		stream2.Read(array, 0, array.Length);
		SoundBanks.Add(array);
	}
}
internal class KindredTracker : HuntressTracker
{
	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.indicator);
	}
}
internal class MarkBehaviour : MonoBehaviour
{
	public GameObject owner;

	public float duration = 45f;

	private float stopwatch;

	private GameObject indicator;

	private CharacterBody body;

	private bool collected;

	private void Start()
	{
		//IL_0019: Unknown result type (might be due to invalid IL or missing references)
		//IL_001e: Unknown result type (might be due to invalid IL or missing references)
		body = ((Component)this).GetComponent<CharacterBody>();
		indicator = Object.Instantiate<GameObject>(Prefabs.markEffect, body.corePosition, Quaternion.identity, ((Component)this).transform);
	}

	private void FixedUpdate()
	{
		stopwatch += Time.deltaTime;
		bool flag = Object.op_Implicit((Object)(object)body) && !body.healthComponent.alive;
		if (stopwatch >= duration || !Object.op_Implicit((Object)(object)body) || flag)
		{
			if (flag)
			{
				collected = true;
			}
			Object.Destroy((Object)(object)this);
		}
	}

	private void OnDestroy()
	{
		if (Object.op_Implicit((Object)(object)owner) && collected)
		{
			if (Util.HasEffectiveAuthority(owner))
			{
				AkSoundEngine.PostEvent(Sounds.Play_Kindred_Passive_Collect, owner.gameObject);
			}
			EffectManager.SimpleMuzzleFlash(Prefabs.collectEffect, owner, "base", false);
		}
		Object.Destroy((Object)(object)indicator);
	}
}
internal class KindredBehaviour : MonoBehaviour
{
	public GameObject wolf;

	public Animator animator;

	public Animator wolfAnimator;

	public ChildLocator childLocator;

	private CharacterBody body;

	public Transform wolfMuzzle;

	public HuntressTracker tracker;

	private float stopwatch = 1f;

	private float walkStopwatch = 1f;

	public float hopSpeed = 13f;

	public bool attacking;

	public float markStopwatch;

	public float markMinTime = 60f;

	public bool inAttackRange;

	public float minAttackRange = 3f;

	public float attackRangeMult;

	public float baseAttackInterval = 0.5f;

	public float baseAttackDuration = 0.45f;

	public float attackFireDuration = 0.15f;

	public HitBoxGroup wolfHitbox;

	private HurtBox wolfTarget;

	private SphereSearch search = new SphereSearch();

	public float wolfSpeed => 2.5f * Mathf.Max(1f, body.moveSpeed / body.baseMoveSpeed);

	private HurtBox currentTarget
	{
		get
		{
			if (Object.op_Implicit((Object)(object)wolfTarget) && Object.op_Implicit((Object)(object)wolfTarget.healthComponent) && !wolfTarget.healthComponent.alive)
			{
				return null;
			}
			return wolfTarget;
		}
	}

	private void Start()
	{
		tracker = ((Component)this).GetComponent<HuntressTracker>();
		body = ((Component)this).GetComponent<CharacterBody>();
		childLocator = ((Component)body.modelLocator.modelTransform).GetComponent<ChildLocator>();
		animator = ((Component)childLocator).GetComponent<Animator>();
		wolfMuzzle = childLocator.FindChild("wolfMuzzle");
		wolf = ((Component)childLocator.FindChild("wolf")).gameObject;
		wolfHitbox = wolf.GetComponent<HitBoxGroup>();
		wolfAnimator = wolf.GetComponent<Animator>();
	}

	public void StartAttack()
	{
		//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_0044: Unknown result type (might be due to invalid IL or missing references)
		//IL_0049: Unknown result type (might be due to invalid IL or missing references)
		wolfTarget = tracker.trackingTarget;
		wolf.transform.parent = null;
		attacking = true;
		Bounds bounds = tracker.trackingTarget.collider.bounds;
		Vector3 size = ((Bounds)(ref bounds)).size;
		attackRangeMult = ((Vector3)(ref size)).magnitude;
		if (Object.op_Implicit((Object)(object)wolfAnimator))
		{
			wolfAnimator.SetFloat("walkSpeed", body.moveSpeed);
		}
	}

	public void EndAttack()
	{
		attacking = false;
		inAttackRange = false;
		wolfTarget = null;
	}

	private void Update()
	{
		//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
		//IL_0104: Unknown result type (might be due to invalid IL or missing references)
		//IL_010f: Unknown result type (might be due to invalid IL or missing references)
		//IL_011f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0124: Unknown result type (might be due to invalid IL or missing references)
		//IL_0129: Unknown result type (might be due to invalid IL or missing references)
		//IL_012c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0131: Unknown result type (might be due to invalid IL or missing references)
		//IL_0141: Unknown result type (might be due to invalid IL or missing references)
		//IL_0271: Unknown result type (might be due to invalid IL or missing references)
		//IL_0276: Unknown result type (might be due to invalid IL or missing references)
		//IL_027a: Unknown result type (might be due to invalid IL or missing references)
		//IL_027f: Unknown result type (might be due to invalid IL or missing references)
		//IL_02ac: Unknown result type (might be due to invalid IL or missing references)
		//IL_02b1: Unknown result type (might be due to invalid IL or missing references)
		//IL_02cd: Unknown result type (might be due to invalid IL or missing references)
		//IL_02d2: Unknown result type (might be due to invalid IL or missing references)
		//IL_0308: Unknown result type (might be due to invalid IL or missing references)
		//IL_0313: Unknown result type (might be due to invalid IL or missing references)
		//IL_0323: Unknown result type (might be due to invalid IL or missing references)
		//IL_0328: Unknown result type (might be due to invalid IL or missing references)
		//IL_032d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0330: Unknown result type (might be due to invalid IL or missing references)
		//IL_0335: Unknown result type (might be due to invalid IL or missing references)
		//IL_0345: Unknown result type (might be due to invalid IL or missing references)
		//IL_0366: Unknown result type (might be due to invalid IL or missing references)
		//IL_0371: Unknown result type (might be due to invalid IL or missing references)
		//IL_0382: Unknown result type (might be due to invalid IL or missing references)
		//IL_0197: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a7: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ac: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b1: 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_01b9: Unknown result type (might be due to invalid IL or missing references)
		//IL_01c6: Unknown result type (might be due to invalid IL or missing references)
		//IL_01e4: Unknown result type (might be due to invalid IL or missing references)
		//IL_01f4: Unknown result type (might be due to invalid IL or missing references)
		//IL_01f9: Unknown result type (might be due to invalid IL or missing references)
		//IL_01fb: Unknown result type (might be due to invalid IL or missing references)
		//IL_0206: Unknown result type (might be due to invalid IL or missing references)
		//IL_020b: Unknown result type (might be due to invalid IL or missing references)
		//IL_021c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0233: Unknown result type (might be due to invalid IL or missing references)
		//IL_0243: Unknown result type (might be due to invalid IL or missing references)
		if (PauseManager.isPaused || Time.timeScale == 0f || !Object.op_Implicit((Object)(object)wolf) || !Object.op_Implicit((Object)(object)wolfAnimator) || !Object.op_Implicit((Object)(object)animator) || !Object.op_Implicit((Object)(object)wolfMuzzle))
		{
			return;
		}
		Vector3 val;
		if (!attacking)
		{
			wolfAnimator.SetBool("isMoving", animator.GetBool("isMoving"));
			wolfAnimator.SetBool("isSprinting", animator.GetBool("isSprinting"));
			wolf.transform.position = Vector3.Lerp(wolf.transform.position, wolfMuzzle.position, wolfSpeed * Time.deltaTime);
			Transform transform = wolf.transform;
			Quaternion localRotation = wolf.transform.localRotation;
			val = wolfMuzzle.position - wolf.transform.position;
			transform.rotation = Quaternion.Lerp(localRotation, Util.QuaternionSafeLookRotation(((Vector3)(ref val)).normalized), 2f * Time.deltaTime);
			return;
		}
		wolfAnimator.SetBool("isMoving", true);
		wolfAnimator.SetBool("isSprinting", true);
		if (Object.op_Implicit((Object)(object)currentTarget))
		{
			val = ((Component)currentTarget).transform.position - wolf.transform.position;
			Vector3 normalized = ((Vector3)(ref val)).normalized;
			wolf.transform.forward = normalized;
			wolf.transform.position = Vector3.Lerp(wolf.transform.position, ((Component)currentTarget).transform.position + -normalized * minAttackRange, wolfSpeed * Time.deltaTime);
			inAttackRange = Vector3.Distance(wolf.transform.position, ((Component)currentTarget).transform.position) <= minAttackRange * attackRangeMult;
			return;
		}
		SphereSearch obj = search;
		LayerIndex entityPrecise = LayerIndex.entityPrecise;
		obj.mask = ((LayerIndex)(ref entityPrecise)).mask;
		search.radius = tracker.maxTrackingDistance * 1.5f;
		search.origin = ((Component)this).transform.position;
		wolfTarget = search.RefreshCandidates().FilterCandidatesByHurtBoxTeam(TeamMask.GetEnemyTeams(body.teamComponent.teamIndex)).OrderCandidatesByDistance()
			.FilterCandidatesByDistinctHurtBoxEntities()
			.GetHurtBoxes()[0];
		Transform transform2 = wolf.transform;
		Quaternion localRotation2 = wolf.transform.localRotation;
		val = wolfMuzzle.position - wolf.transform.position;
		transform2.rotation = Quaternion.Lerp(localRotation2, Util.QuaternionSafeLookRotation(((Vector3)(ref val)).normalized), 2f * Time.deltaTime);
		wolf.transform.position = Vector3.Lerp(wolf.transform.position, wolfMuzzle.position, wolfSpeed * Time.deltaTime);
	}

	private void FixedUpdate()
	{
		if (Object.op_Implicit((Object)(object)wolf) && Object.op_Implicit((Object)(object)wolf.transform.parent))
		{
			wolf.transform.parent = null;
		}
		markStopwatch += Time.deltaTime;
		if (markStopwatch >= markMinTime)
		{
			markStopwatch = 0f;
			List<CharacterBody> list = new List<CharacterBody>();
			list.AddRange(CharacterBody.instancesList);
			list.RemoveAll((CharacterBody x) => x.teamComponent.teamIndex == body.teamComponent.teamIndex || (int)x.teamComponent.teamIndex == 5 || (int)x.teamComponent.teamIndex == 0 || (int)x.teamComponent.teamIndex == -1);
			CharacterBody val = list[RoR2Application.rng.RangeInt(0, list.Count)];
			if (Object.op_Implicit((Object)(object)val))
			{
				((Component)val).gameObject.AddComponent<MarkBehaviour>().owner = ((Component)this).gameObject;
				if (body.hasEffectiveAuthority)
				{
					AkSoundEngine.PostEvent(Sounds.Play_Kindred_Passive_Mark, ((Component)this).gameObject);
				}
			}
		}
		if (NetworkServer.active && Object.op_Implicit((Object)(object)body) && Object.op_Implicit((Object)(object)animator) && animator.GetBool("isMoving"))
		{
			walkStopwatch += Time.deltaTime;
			if (walkStopwatch >= 1f / Mathf.Max(1f, body.moveSpeed / body.baseMoveSpeed))
			{
				walkStopwatch = 0f;
				if (body.GetBuffCount(Prefabs.heal) < 100)
				{
					body.AddBuff(Prefabs.heal);
				}
			}
		}
		if (!Object.op_Implicit((Object)(object)tracker) || !Object.op_Implicit((Object)(object)body) || !Object.op_Implicit((Object)(object)body.inventory))
		{
			return;
		}
		stopwatch += Time.deltaTime;
		if (!(stopwatch >= 0.5f))
		{
			return;
		}
		stopwatch = 0f;
		tracker.maxTrackingDistance = 26 + body.inventory.GetItemCount(Prefabs.passive);
		if (!NetworkServer.active)
		{
			return;
		}
		int itemCount = body.inventory.GetItemCount(Prefabs.passive);
		int buffCount = body.GetBuffCount(Prefabs.mark);
		if (buffCount < itemCount)
		{
			for (int i = 0; i < itemCount - buffCount; i++)
			{
				body.AddBuff(Prefabs.mark);
			}
		}
	}

	private void OnDestroy()
	{
		Object.Destroy((Object)(object)wolf);
	}
}
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_001a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0024: Expected O, but got Unknown
		HealthComponent.TakeDamage += new hook_TakeDamage(HealthComponent_TakeDamage);
		RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(RecalculateStatsAPI_GetStatCoefficients);
		GlobalEventManager.onServerDamageDealt += GlobalEventManager_onServerDamageDealt;
		GlobalEventManager.onCharacterDeathGlobal += GlobalEventManager_onCharacterDeathGlobal;
	}

	private static void GlobalEventManager_onCharacterDeathGlobal(DamageReport damageReport)
	{
		if (!Object.op_Implicit((Object)(object)damageReport.victim))
		{
			return;
		}
		MarkBehaviour component = ((Component)damageReport.victim).GetComponent<MarkBehaviour>();
		if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component.owner))
		{
			CharacterBody component2 = component.owner.GetComponent<CharacterBody>();
			if (Object.op_Implicit((Object)(object)component2) && Object.op_Implicit((Object)(object)component2.inventory))
			{
				component2.inventory.GiveItem(Prefabs.passive, 1);
			}
		}
	}

	private static void HealthComponent_TakeDamage(orig_TakeDamage orig, HealthComponent self, DamageInfo damageInfo)
	{
		if (self.body.HasBuff(Prefabs.immunity))
		{
			float damage = damageInfo.damage;
			float combinedHealth = self.combinedHealth;
			float num = self.fullCombinedHealth * 0.1f;
			bool flag = damage >= combinedHealth;
			bool flag2 = combinedHealth <= num;
			if (flag || flag2)
			{
				damageInfo.damage = 0f;
				damageInfo.rejected = true;
			}
			else
			{
				float num2 = combinedHealth - self.fullCombinedHealth * 0.1f;
				damageInfo.damage = Mathf.Clamp(damage, 0f, num2);
			}
		}
		orig.Invoke(self, damageInfo);
	}

	private static void GlobalEventManager_onServerDamageDealt(DamageReport damageReport)
	{
		//IL_003c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0043: Invalid comparison between Unknown and I4
		//IL_0119: Unknown result type (might be due to invalid IL or missing references)
		//IL_011f: Unknown result type (might be due to invalid IL or missing references)
		if (!Object.op_Implicit((Object)(object)damageReport.attackerBody) || !Object.op_Implicit((Object)(object)damageReport.attacker) || !Object.op_Implicit((Object)(object)damageReport.attacker.GetComponent<KindredBehaviour>()) || (int)damageReport.damageInfo.damageType == 64 || !(damageReport.damageInfo.procCoefficient > 0f))
		{
			return;
		}
		int buffCount = damageReport.attackerBody.GetBuffCount(Prefabs.heal);
		int val = 100 - buffCount;
		int num = Math.Min(5, val);
		if (buffCount >= 100)
		{
			num = 0;
			for (int i = 0; i < buffCount; i++)
			{
				damageReport.attackerBody.RemoveBuff(Prefabs.heal);
			}
			damageReport.attackerBody.ClearTimedBuffs(Prefabs.heal);
			HealthComponent healthComponent = damageReport.attackerBody.healthComponent;
			healthComponent.Heal(healthComponent.fullCombinedHealth * Util.Remap((healthComponent.fullCombinedHealth - healthComponent.combinedHealth) / healthComponent.fullCombinedHealth, 0f, 1f, 0.1f, 0.25f), default(ProcChainMask), true);
		}
		else
		{
			for (int j = 0; j < num; j++)
			{
				damageReport.attackerBody.AddBuff(Prefabs.heal);
			}
		}
	}

	private static void RecalculateStatsAPI_GetStatCoefficients(CharacterBody sender, StatHookEventArgs args)
	{
		if (Object.op_Implicit((Object)(object)sender.inventory))
		{
			int itemCount = sender.inventory.GetItemCount(Prefabs.passive);
			if (itemCount > 0)
			{
				args.damageMultAdd += 0.05f * (float)itemCount;
				args.moveSpeedMultAdd += 0.05f * (float)itemCount;
			}
		}
		if (sender.HasBuff(Prefabs.attackspeed))
		{
			args.attackSpeedMultAdd += 0.3f;
		}
	}
}
internal class KindredOrb : GenericDamageOrb
{
	public float attackSpeed;

	public override void Begin()
	{
		base.speed = 45f * attackSpeed;
		((GenericDamageOrb)this).Begin();
	}

	public override GameObject GetOrbEffect()
	{
		return Prefabs.orbEffect;
	}
}
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInPlugin("com.Dragonyck.Kindred", "Kindred", "1.0.0")]
[NetworkCompatibility(/*Could not decode attribute arguments.*/)]
public class MainPlugin : BaseUnityPlugin
{
	public const string MODUID = "com.Dragonyck.Kindred";

	public const string MODNAME = "Kindred";

	public const string VERSION = "1.0.0";

	public const string SURVIVORNAME = "Kindred";

	public const string SURVIVORNAMEKEY = "KINDRED";

	public static GameObject characterPrefab;

	public static readonly Color characterColor = Color32.op_Implicit(new Color32((byte)162, (byte)130, byte.MaxValue, byte.MaxValue));

	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_00e1: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e7: Expected O, but got Unknown
		//IL_0112: Unknown result type (might be due to invalid IL or missing references)
		//IL_0123: Unknown result type (might be due to invalid IL or missing references)
		//IL_0143: Unknown result type (might be due to invalid IL or missing references)
		//IL_0153: Unknown result type (might be due to invalid IL or missing references)
		//IL_015a: Expected O, but got Unknown
		//IL_0183: Unknown result type (might be due to invalid IL or missing references)
		//IL_0195: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a7: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ca: Unknown result type (might be due to invalid IL or missing references)
		//IL_01d7: Unknown result type (might be due to invalid IL or missing references)
		//IL_01e4: Unknown result type (might be due to invalid IL or missing references)
		//IL_0256: Unknown result type (might be due to invalid IL or missing references)
		//IL_0388: 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_03c7: 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_0462: Unknown result type (might be due to invalid IL or missing references)
		//IL_048f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0494: Unknown result type (might be due to invalid IL or missing references)
		//IL_06be: Unknown result type (might be due to invalid IL or missing references)
		//IL_06db: Unknown result type (might be due to invalid IL or missing references)
		//IL_06f8: Unknown result type (might be due to invalid IL or missing references)
		//IL_0715: Unknown result type (might be due to invalid IL or missing references)
		//IL_0732: Unknown result type (might be due to invalid IL or missing references)
		//IL_074f: Unknown result type (might be due to invalid IL or missing references)
		//IL_076c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0789: Unknown result type (might be due to invalid IL or missing references)
		//IL_055d: Unknown result type (might be due to invalid IL or missing references)
		//IL_057d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0595: Unknown result type (might be due to invalid IL or missing references)
		//IL_07fb: Unknown result type (might be due to invalid IL or missing references)
		//IL_086c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0880: Unknown result type (might be due to invalid IL or missing references)
		//IL_096a: Unknown result type (might be due to invalid IL or missing references)
		//IL_096f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0992: Unknown result type (might be due to invalid IL or missing references)
		//IL_0997: Unknown result type (might be due to invalid IL or missing references)
		//IL_09c5: Unknown result type (might be due to invalid IL or missing references)
		//IL_09ca: Unknown result type (might be due to invalid IL or missing references)
		GameObject val = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Commando/CommandoBody.prefab").WaitForCompletion();
		characterPrefab = PrefabAPI.InstantiateClone(val, "KindredBody", true);
		KindredTracker kindredTracker = characterPrefab.AddComponent<KindredTracker>();
		((HuntressTracker)kindredTracker).maxTrackingAngle = 45f;
		((HuntressTracker)kindredTracker).maxTrackingDistance = 26f;
		characterPrefab.AddComponent<KindredBehaviour>();
		characterPrefab.GetComponent<NetworkIdentity>().localPlayerAuthority = true;
		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>("kindredMdl");
		val2.AddComponent<AnimationEvents>().soundCenter = val2;
		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 = "KindredBody";
		component2.baseNameToken = "KINDRED_NAME";
		component2.subtitleNameToken = "KINDRED_SUBTITLE";
		component2.bodyFlags = (BodyFlags)16;
		component2.rootMotionInMainState = false;
		component2.mainRootSpeed = 0f;
		component2.baseMaxHealth = 110f;
		component2.levelMaxHealth = 35f;
		component2.baseRegen = 1.5f;
		component2.levelRegen = 0.2f;
		component2.baseMaxShield = 0f;
		component2.levelMaxShield = 0f;
		component2.baseMoveSpeed = 7f;
		component2.levelMoveSpeed = 0f;
		component2.baseAcceleration = 110f;
		component2.baseJumpPower = 15f;
		component2.levelJumpPower = 0f;
		component2.baseDamage = 12f;
		component2.levelDamage = 2.4f;
		component2.baseAttackSpeed = 1f;
		component2.levelAttackSpeed = 0f;
		component2.baseCrit = 1f;
		component2.levelCrit = 0f;
		component2.baseArmor = 0f;
		component2.levelArmor = 0f;
		component2.baseJumpCount = 1;
		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;
		HealthComponent component3 = characterPrefab.GetComponent<HealthComponent>();
		component3.health = component2.baseMaxHealth;
		component3.shield = 0f;
		component3.barrier = 0f;
		CharacterMotor component4 = characterPrefab.GetComponent<CharacterMotor>();
		component4.walkSpeedPenaltyCoefficient = 1f;
		component4.characterDirection = component;
		component4.muteWalkMotion = false;
		component4.mass = 160f;
		component4.airControl = 0.25f;
		component4.disableAirControlUntilCollision = false;
		component4.generateParametersOnAwake = true;
		InputBankTest component5 = characterPrefab.GetComponent<InputBankTest>();
		component5.moveVector = Vector3.zero;
		CameraTargetParams component6 = characterPrefab.GetComponent<CameraTargetParams>();
		component6.cameraParams = val.GetComponent<CameraTargetParams>().cameraParams;
		component6.cameraPivotTransform = null;
		component6.recoil = Vector2.zero;
		component6.dontRaycastToPivot = false;
		ModelLocator component7 = characterPrefab.GetComponent<ModelLocator>();
		component7.modelTransform = transform;
		component7.modelBaseTransform = val3.transform;
		component7.dontReleaseModelOnDeath = false;
		component7.autoUpdateModelTransform = true;
		component7.dontDetatchFromParent = false;
		component7.noCorpse = false;
		component7.normalizeToFloor = false;
		component7.preserveModel = false;
		ChildLocator component8 = val2.GetComponent<ChildLocator>();
		CharacterModel val5 = val2.AddComponent<CharacterModel>();
		SkinnedMeshRenderer[] componentsInChildren = val2.GetComponentsInChildren<SkinnedMeshRenderer>();
		List<RendererInfo> list = new List<RendererInfo>();
		foreach (SkinnedMeshRenderer val6 in componentsInChildren)
		{
			string name = ((Object)val6).name;
			if (name != "skin01-1")
			{
				((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 = (name == "skin01-1")
			});
			if (!name.Contains("base"))
			{
				((Component)val6).gameObject.SetActive(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];
		LanguageAPI.Add("KINDREDBODY_DEFAULT_SKIN_NAME", "Default");
		LanguageAPI.Add("KINDREDBODY_SKIN01_NAME", "Shadowfire");
		LanguageAPI.Add("KINDREDBODY_SKIN02_NAME", "Super Galaxy");
		LanguageAPI.Add("KINDREDBODY_SKIN03_NAME", "Spirit Blossom");
		LanguageAPI.Add("KINDREDBODY_SKIN12_NAME", "Porcelain");
		LanguageAPI.Add("KINDREDBODY_SKIN22_NAME", "Woof and Lamb");
		LanguageAPI.Add("KINDREDBODY_SKIN23_NAME", "DRX");
		LanguageAPI.Add("KINDREDBODY_SKIN33_NAME", "Prestige Porcelain");
		ModelSkinController val7 = val2.AddComponent<ModelSkinController>();
		val7.skins = (SkinDef[])(object)new SkinDef[8]
		{
			LoadoutAPI.CreateNewSkinDef(Utils.CreateNewSkinDefInfo(componentsInChildren, val2, "KINDREDBODY_DEFAULT_SKIN_NAME", "base", array)),
			LoadoutAPI.CreateNewSkinDef(Utils.CreateNewSkinDefInfo(componentsInChildren, val2, "KINDREDBODY_SKIN01_NAME", "skin01", array)),
			LoadoutAPI.CreateNewSkinDef(Utils.CreateNewSkinDefInfo(componentsInChildren, val2, "KINDREDBODY_SKIN02_NAME", "skin02", array)),
			LoadoutAPI.CreateNewSkinDef(Utils.CreateNewSkinDefInfo(componentsInChildren, val2, "KINDREDBODY_SKIN03_NAME", "skin03", array)),
			LoadoutAPI.CreateNewSkinDef(Utils.CreateNewSkinDefInfo(componentsInChildren, val2, "KINDREDBODY_SKIN12_NAME", "skin12", array)),
			LoadoutAPI.CreateNewSkinDef(Utils.CreateNewSkinDefInfo(componentsInChildren, val2, "KINDREDBODY_SKIN22_NAME", "skin22", array)),
			LoadoutAPI.CreateNewSkinDef(Utils.CreateNewSkinDefInfo(componentsInChildren, val2, "KINDREDBODY_SKIN23_NAME", "skin23", array)),
			LoadoutAPI.CreateNewSkinDef(Utils.CreateNewSkinDefInfo(componentsInChildren, val2, "KINDREDBODY_SKIN33_NAME", "skin33", array))
		};
		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 = component3;
			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("Attack", component8.FindChild("wolf"), new Vector3(3f, 4f, 5f), new Vector3(0f, 1f, 1f));
		KinematicCharacterMotor component9 = characterPrefab.GetComponent<KinematicCharacterMotor>();
		component9.CharacterController = (BaseCharacterController)(object)component4;
		characterPrefab.GetComponent<Interactor>().maxInteractionDistance = 3f;
		characterPrefab.GetComponent<InteractionDriver>().highlightInteractor = true;
		SfxLocator component10 = characterPrefab.GetComponent<SfxLocator>();
		component10.deathSound = "Play_ui_player_death";
		component10.barkSound = "";
		component10.openSound = "";
		component10.landingSound = "Play_char_land";
		component10.fallDamageSound = "Play_char_land_fall_damage";
		component10.aliveLoopStart = "";
		component10.aliveLoopStop = "";
		characterPrefab.GetComponent<Rigidbody>().mass = component4.mass;
		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 component11 = ((Component)component2).GetComponent<EntityStateMachine>();
		component11.mainStateType = new SerializableEntityStateType(typeof(CharacterMain));
		CharacterDeathBehavior component12 = characterPrefab.GetComponent<CharacterDeathBehavior>();
		component12.deathStateMachine = characterPrefab.GetComponent<EntityStateMachine>();
		component12.deathState = new SerializableEntityStateType(typeof(DeathState));
		Utils.NewStateMachine<Idle>(characterPrefab, "Wolf");
		NetworkStateMachine component13 = ((Component)component2).GetComponent<NetworkStateMachine>();
		component13.stateMachines = ((Component)component2).GetComponents<EntityStateMachine>();
		ContentAddition.AddBody(characterPrefab);
	}

	private void RegisterCharacter()
	{
		//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)
		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 they left.";
		string text3 = "..and so they vanished.";
		string text4 = "";
		LanguageAPI.Add("KINDRED_NAME", "Kindred");
		LanguageAPI.Add("KINDRED_DESCRIPTION", text);
		LanguageAPI.Add("KINDRED_SUBTITLE", "The Eternal Hunters");
		LanguageAPI.Add("KINDRED_OUTRO", text2);
		LanguageAPI.Add("KINDRED_FAIL", text3);
		SurvivorDef val = ScriptableObject.CreateInstance<SurvivorDef>();
		val.cachedName = "KINDRED_NAME";
		val.unlockableDef = null;
		val.descriptionToken = "KINDRED_DESCRIPTION";
		val.primaryColor = characterColor;
		val.bodyPrefab = characterPrefab;
		val.displayPrefab = Utils.NewDisplayModel(((Component)characterPrefab.GetComponent<ModelLocator>().modelBaseTransform).gameObject, "KindredDisplay");
		val.outroFlavorToken = "KINDRED_OUTRO";
		val.desiredSortPosition = 22f;
		val.mainEndingEscapeFailureFlavorToken = "KINDRED_FAIL";
		ContentAddition.AddSurvivorDef(val);
		SkillSetup();
		GameObject val2 = PrefabAPI.InstantiateClone(Prefabs.Load<GameObject>("RoR2/Base/Commando/CommandoMonsterMaster.prefab"), "KindredMaster", 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)
		bool flag = default(bool);
		ContentAddition.AddEntityState<Primary>(ref flag);
		ContentAddition.AddEntityState<Secondary>(ref flag);
		ContentAddition.AddEntityState<Utility>(ref flag);
		ContentAddition.AddEntityState<Special>(ref flag);
		ContentAddition.AddEntityState<CharacterMain>(ref flag);
		ContentAddition.AddEntityState<MeleeSkillState>(ref flag);
		ContentAddition.AddEntityState<BasicMeleeSkillState>(ref flag);
		ContentAddition.AddEntityState<DeathState>(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("KINDRED_PASSIVE_NAME", "Mark of the Kindred");
		LanguageAPI.Add("KINDRED_PASSIVE_KEYWORD", "<style=cKeywordName></style>Mark of the Kindred<style=cSub>Increases the Kindred range by <style=cIsUtility>1</style>, and <style=cIsDamage>damage</style> and <style=cIsDamage>movement speed</style> by <style=cIsDamage>5%</style>.");
		LanguageAPI.Add("KINDRED_PASSIVE_DESCRIPTION", "Every <style=cIsUtility>60s</style> a random enemy is marked for <style=cIsUtility>45s</style>. Killing the marked target will reward a stack of <style=cKeywordName></style>Mark of the Kindred<style=cSub>As Kindred move and attack, they build up to 100 stacks of <style=cIsDamage>Hunter's Vigor</style>. At maximum stacks, Lamb's next hit <style=cIsHealing>heals</style> her for <style=cIsHealing>10%-25%</style> of her <style=cIsHealth>max health</style> based on her missing health.");
		component.passiveSkill.enabled = true;
		component.passiveSkill.skillNameToken = "KINDRED_PASSIVE_NAME";
		component.passiveSkill.skillDescriptionToken = "KINDRED_PASSIVE_DESCRIPTION";
		component.passiveSkill.icon = Assets.MainAssetBundle.LoadAsset<Sprite>("passive");
		component.passiveSkill.keywordToken = "KINDRED_PASSIVE_KEYWORD";
	}

	private void PrimarySetup()
	{
		SkillLocator component = characterPrefab.GetComponent<SkillLocator>();
		LanguageAPI.Add("KINDRED_M1", "Dance of Arrows");
		LanguageAPI.Add("KINDRED_M1_DESCRIPTION", "<style=cIsUtility>Agile</style>. Lamb fires an arrow at her current target for <style=cIsDamage>185% damage</style>.");
		SkillDef skill = Utils.NewSkillDef<HuntressTrackingSkillDef>(typeof(Primary), "Weapon", 0, 0f, beginSkillCooldownOnSkillEnd: true, canceledFromSprinting: false, fullRestockOnAssign: true, (InterruptPriority)0, isCombatSkill: true, mustKeyPress: false, cancelSprintingOnActivation: true, 0, 0, 0, Assets.MainAssetBundle.LoadAsset<Sprite>("primary"), "KINDRED_M1_DESCRIPTION", "KINDRED_M1", Array.Empty<string>());
		component.primary = Utils.NewGenericSkill(characterPrefab, skill);
	}

	private void SecondarySetup()
	{
		SkillLocator component = characterPrefab.GetComponent<SkillLocator>();
		LanguageAPI.Add("KINDRED_M2", "Mounting Dread");
		LanguageAPI.Add("KINDRED_M2_DESCRIPTION", "Lamb dashes forward, gaining <style=cIsDamage>30% attack speed</style> for <style=cIsUtility>4s</style> and firing an arrow at up to 3 nearby enemies, prioritizing enemiesi n the aim direction, at 150% of her range.");
		SkillDef skill = Utils.NewSkillDef<SkillDef>(typeof(Secondary), "Weapon", 1, 5f, beginSkillCooldownOnSkillEnd: true, canceledFromSprinting: false, fullRestockOnAssign: false, (InterruptPriority)1, isCombatSkill: true, mustKeyPress: true, cancelSprintingOnActivation: false, 1, 1, 1, Assets.MainAssetBundle.LoadAsset<Sprite>("secondary"), "KINDRED_M2_DESCRIPTION", "KINDRED_M2", Array.Empty<string>());
		component.secondary = Utils.NewGenericSkill(characterPrefab, skill);
	}

	private void UtilitySetup()
	{
		SkillLocator component = characterPrefab.GetComponent<SkillLocator>();
		LanguageAPI.Add("KINDRED_UTIL", "Wolf's Frenzy");
		LanguageAPI.Add("KINDRED_UTIL_DESCRIPTION", "Wolf dashes toward the target, separating from Lamb for the next <style=cIsUtility>8.5s</style>. He automatically attacks the closest nearby enemy within range. Wolf's attacks deal <style=cIsDamage>180% damage</style>. After killing an enemy, Wolf searched for his next target, returning to Lamb while there are none.");
		SkillDef skill = Utils.NewSkillDef<HuntressTrackingSkillDef>(typeof(Utility), "Wolf", 1, 5f, beginSkillCooldownOnSkillEnd: true, canceledFromSprinting: false, fullRestockOnAssign: false, (InterruptPriority)0, isCombatSkill: true, mustKeyPress: true, cancelSprintingOnActivation: false, 1, 1, 1, Assets.MainAssetBundle.LoadAsset<Sprite>("utility"), "KINDRED_UTIL_DESCRIPTION", "KINDRED_UTIL", Array.Empty<string>());
		component.utility = Utils.NewGenericSkill(characterPrefab, skill);
	}

	private void SpecialSetup()
	{
		SkillLocator component = characterPrefab.GetComponent<SkillLocator>();
		LanguageAPI.Add("KINDRED_SPEC", "Lamb's Respite");
		LanguageAPI.Add("KINDRED_SPEC_DESCRIPTION", "Lamb blesses the ground under herself for <style=cIsUtility>4s</style>, all allies inside the zone gain a <style=cIsHealth>minimum health threshold</style> of <style=cIsHealing>10% max health</style>, and will become <style=cIsDamage>immune</style> for the remaining duration. All targetable units within the zone are <style=cIsHealing>healed</style> for <style=cIsHealing>50%</style> of Lamb's <style=cIsHealth>max health</style> when the blessing ends.");
		SkillDef skill = Utils.NewSkillDef<SkillDef>(typeof(Special), "Slide", 1, 8f, beginSkillCooldownOnSkillEnd: true, canceledFromSprinting: false, fullRestockOnAssign: false, (InterruptPriority)0, isCombatSkill: true, mustKeyPress: true, cancelSprintingOnActivation: false, 1, 1, 1, Assets.MainAssetBundle.LoadAsset<Sprite>("special"), "KINDRED_SPEC_DESCRIPTION", "KINDRED_SPEC", Array.Empty<string>());
		component.special = Utils.NewGenericSkill(characterPrefab, skill);
	}
}
internal class Prefabs
{
	internal static GameObject indicator;

	internal static GameObject orbEffect;

	internal static GameObject hitEffect;

	internal static GameObject wolfHitEffect;

	internal static GameObject areaIndicator;

	internal static GameObject markEffect;

	internal static GameObject healEffect;

	internal static GameObject collectEffect;

	internal static GameObject muzzleEffectMult;

	internal static GameObject muzzleEffect;

	internal static BuffDef heal;

	internal static BuffDef immunity;

	internal static BuffDef attackspeed;

	internal static BuffDef mark;

	internal static ItemDef passive;

	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 GameObject Instantiate(GameObject obj, string name, bool registerNetwork = false)
	{
		return PrefabAPI.InstantiateClone(obj, name, registerNetwork);
	}

	internal static GameObject Instantiate(string path, string name, bool registerNetwork = false)
	{
		return PrefabAPI.InstantiateClone(Load<GameObject>(path), name, registerNetwork);
	}

	internal static void CreatePrefabs()
	{
		//IL_004e: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
		//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
		//IL_010c: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ba: Unknown result type (might be due to invalid IL or missing references)
		//IL_01c4: Unknown result type (might be due to invalid IL or missing references)
		//IL_01d1: Unknown result type (might be due to invalid IL or missing references)
		//IL_01d6: Unknown result type (might be due to invalid IL or missing references)
		//IL_01da: Unknown result type (might be due to invalid IL or missing references)
		//IL_01df: Unknown result type (might be due to invalid IL or missing references)
		//IL_0288: Unknown result type (might be due to invalid IL or missing references)
		//IL_028d: Unknown result type (might be due to invalid IL or missing references)
		//IL_02c7: Unknown result type (might be due to invalid IL or missing references)
		//IL_02cc: Unknown result type (might be due to invalid IL or missing references)
		//IL_02fb: Unknown result type (might be due to invalid IL or missing references)
		//IL_031b: Unknown result type (might be due to invalid IL or missing references)
		//IL_036b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0375: Expected O, but got Unknown
		//IL_03b2: Unknown result type (might be due to invalid IL or missing references)
		//IL_01f1: Unknown result type (might be due to invalid IL or missing references)
		//IL_01f6: Unknown result type (might be due to invalid IL or missing references)
		//IL_0416: Unknown result type (might be due to invalid IL or missing references)
		//IL_041d: Expected O, but got Unknown
		//IL_043b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0445: Unknown result type (might be due to invalid IL or missing references)
		//IL_0457: Unknown result type (might be due to invalid IL or missing references)
		//IL_0461: Unknown result type (might be due to invalid IL or missing references)
		//IL_0481: Unknown result type (might be due to invalid IL or missing references)
		//IL_048b: Expected O, but got Unknown
		//IL_0501: Unknown result type (might be due to invalid IL or missing references)
		//IL_03e2: Unknown result type (might be due to invalid IL or missing references)
		//IL_03e7: Unknown result type (might be due to invalid IL or missing references)
		//IL_054b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0555: Unknown result type (might be due to invalid IL or missing references)
		//IL_0584: Unknown result type (might be due to invalid IL or missing references)
		//IL_058e: Expected O, but got Unknown
		//IL_05ad: Unknown result type (might be due to invalid IL or missing references)
		//IL_069b: Unknown result type (might be due to invalid IL or missing references)
		//IL_06a5: Expected O, but got Unknown
		//IL_06d5: Unknown result type (might be due to invalid IL or missing references)
		//IL_06da: Unknown result type (might be due to invalid IL or missing references)
		//IL_0780: Unknown result type (might be due to invalid IL or missing references)
		//IL_0785: Unknown result type (might be due to invalid IL or missing references)
		passive = ScriptableObject.CreateInstance<ItemDef>();
		((Object)passive).name = "KindredPassiveStat";
		passive.nameToken = "KINDRED_ITEM_NAME";
		passive.pickupToken = "KINDRED_ITEM_DESCRIPTION";
		passive.loreToken = "KINDRED_ITEM_DESCRIPTION";
		passive.deprecatedTier = (ItemTier)5;
		passive.tier = (ItemTier)5;
		ItemDef obj = passive;
		ItemTag[] array = new ItemTag[6];
		RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/);
		obj.tags = (ItemTag[])(object)array;
		passive.canRemove = false;
		passive.hidden = true;
		ContentAddition.AddItemDef(passive);
		attackspeed = Utils.NewBuffDef("Lamb's Dance", stack: false, hidden: false, Assets.Load<Sprite>("secondary"), Color.white);
		heal = Utils.NewBuffDef("Hunter's Vigor", stack: true, hidden: false, Assets.Load<Sprite>("utility"), Color.white);
		immunity = Utils.NewBuffDef("Lamb's Blessing", stack: false, hidden: false, Assets.Load<Sprite>("special"), Color.white);
		mark = Utils.NewBuffDef("Mark of the Kindred", stack: true, hidden: false, Assets.Load<Sprite>("kindred_base_p_mark"), Color.white);
		collectEffect = Instantiate(Assets.Load<GameObject>("CollectEffect"), "CollectEffect");
		Utils.RegisterEffect(collectEffect, 1f);
		healEffect = Instantiate(Assets.Load<GameObject>("healEffect"), "HealEffect");
		Utils.RegisterEffect(healEffect, 0.8f);
		muzzleEffectMult = Instantiate(Load<GameObject>("RoR2/Base/LunarWisp/MuzzleflashLunarWispMinigun.prefab"), "MuzzleEffectMult");
		ParticleSystem[] componentsInChildren = muzzleEffectMult.GetComponentsInChildren<ParticleSystem>();
		foreach (ParticleSystem val in componentsInChildren)
		{
			((Component)val).transform.localScale = Vector3.one * 0.5f;
			MainModule main = val.main;
			LightsModule lights = val.lights;
			if (((LightsModule)(ref lights)).enabled)
			{
				LightsModule lights2 = val.lights;
				((LightsModule)(ref lights2)).intensityMultiplier = 0.15f;
			}
		}
		Utils.RegisterEffect(muzzleEffectMult, 0.4f);
		muzzleEffect = Instantiate(muzzleEffectMult, "MuzzleEffect");
		Utils.RegisterEffect(muzzleEffect, 0.15f);
		markEffect = Instantiate(Assets.Load<GameObject>("Mark"), "MarkEffect");
		GameObject val2 = Object.Instantiate<GameObject>(Load<GameObject>("RoR2/Base/Common/BossPositionIndicator.prefab"), markEffect.transform.position, Quaternion.identity, markEffect.transform);
		val2.GetComponent<PositionIndicator>().insideViewObject = null;
		SpriteRenderer componentInChildren = val2.GetComponentInChildren<SpriteRenderer>();
		componentInChildren.color = Color32.op_Implicit(new Color32((byte)52, (byte)145, (byte)188, byte.MaxValue));
		SpriteRenderer component = ((Component)((Component)componentInChildren).transform.GetChild(0)).GetComponent<SpriteRenderer>();
		component.sprite = Assets.Load<Sprite>("kindred_base_p_mark");
		component.color = Color.white;
		((Component)component).transform.localScale = new Vector3(0.25f, 0.08f, 0.25f);
		indicator = Instantiate(Assets.Load<GameObject>("indicator"), "TrackerIndicator");
		areaIndicator = Instantiate("RoR2/Base/Huntress/HuntressArrowRainIndicator.prefab", "AreaIndicator");
		MeshRenderer componentInChildren2 = areaIndicator.GetComponentInChildren<MeshRenderer>();
		((Renderer)componentInChildren2).material = new Material(Load<Material>("RoR2/DLC1/MajorAndMinorConstruct/matMajorConstructAreaIndicator.mat"));
		((Renderer)componentInChildren2).material.SetFloat("_Boost", 5f);
		((Renderer)componentInChildren2).material.SetTexture("_RemapTex", (Texture)(object)Load<Texture2D>("RoR2/Base/Common/ColorRamps/texRampHelfire.png"));
		((Renderer)componentInChildren2).material.SetColor("_TintColor", Color.white);
		if (Object.op_Implicit((Object)(object)areaIndicator))
		{
			GameObject val3 = Object.Instantiate<GameObject>(Assets.Load<GameObject>("UltEffect"), areaIndicator.transform.position, Quaternion.identity, areaIndicator.transform);
		}
		GameObject val4 = new GameObject("Decal", new Type[1] { typeof(Decal) });
		val4.transform.parent = areaIndicator.transform;
		val4.transform.localPosition = Vector3.forward * -0.1f;
		val4.transform.localScale = Vector3.one * 2f;
		Decal component2 = val4.GetComponent<Decal>();
		component2.Material = new Material(Load<Material>("RoR2/Base/LunarExploder/matLunarExploderDeathDecal.mat"));
		component2.Material.SetTexture("_MaskTex", (Texture)(object)Assets.Load<Texture2D>("kindred_base_r_symbol_decal"));
		component2.Material.SetTexture("_Cloud1Tex", (Texture)(object)Load<Texture2D>("RoR2/Base/Common/texCloudCaustic3.jpg"));
		component2.Material.SetTexture("_Cloud2Tex", (Texture)(object)Load<Texture2D>("RoR2/Base/Common/texCloudCaustic2.png"));
		component2.Material.SetFloat("_AngleLimit", 0.9f);
		component2.DrawNormalAndGloss = false;
		component2.RenderMode = (DecalRenderMode)0;
		component2.Fade = 2f;
		hitEffect = Instantiate("RoR2/Base/LunarWisp/LunarWispMinigunHitspark.prefab", "HitEffect");
		ParticleSystemRenderer[] componentsInChildren2 = hitEffect.GetComponentsInChildren<ParticleSystemRenderer>();
		foreach (ParticleSystemRenderer val5 in componentsInChildren2)
		{
			((Component)val5).transform.localScale = Vector3.one * 2f;
			if (((Renderer)val5).material.HasProperty("_TintColor"))
			{
				((Renderer)val5).material = new Material(((Renderer)val5).material);
				((Renderer)val5).material.DisableKeyword("VERTEXCOLOR");
				((Renderer)val5).material.SetColor("_TintColor", Color.cyan);
				if (((Object)val5).name == "ImpactStreaks_Ps")
				{
					((Renderer)val5).material.SetTexture("_MainTex", (Texture)(object)Load<Texture2D>("RoR2/Base/Common/VFX/texOmniHitspark3Mask.png"));
					((Renderer)val5).material.SetTexture("_RemapTex", (Texture)(object)Load<Texture2D>("RoR2/Base/Common/ColorRamps/texRampEliteLunar.png"));
				}
				((Renderer)val5).material.SetFloat("_Boost", 5f);
			}
		}
		Utils.RegisterEffect(hitEffect, -1f, "Play_Kindred_M1_Hit");
		wolfHitEffect = Instantiate("RoR2/Base/Common/VFX/OmniImpactVFX.prefab", "WolfHitEffect");
		ParticleSystemRenderer[] componentsInChildren3 = wolfHitEffect.GetComponentsInChildren<ParticleSystemRenderer>();
		foreach (ParticleSystemRenderer val6 in componentsInChildren3)
		{
			if (((Renderer)val6).material.HasProperty("_TintColor"))
			{
				((Renderer)val6).material = new Material(((Renderer)val6).material);
				((Renderer)val6).material.DisableKeyword("VERTEXCOLOR");
				((Renderer)val6).material.SetColor("_TintColor", Color32.op_Implicit(new Color32((byte)137, (byte)49, byte.MaxValue, byte.MaxValue)));
			}
		}
		Utils.RegisterEffect(wolfHitEffect, -1f, "Play_Kindred_Wolf_Attack_Hit");
		orbEffect = Instantiate("RoR2/Base/Huntress/ArrowOrbEffect.prefab", "OrbEffect");
		Object.Destroy((Object)(object)((Component)orbEffect.transform.GetChild(1)).gameObject);
		Object.Destroy((Object)(object)((Component)orbEffect.transform.GetChild(0)).gameObject);
		if (Object.op_Implicit((Object)(object)orbEffect))
		{
			GameObject val7 = Object.Instantiate<GameObject>(Assets.Load<GameObject>("ArrowEffect"), orbEffect.transform.position, Quaternion.identity, orbEffect.transform);
		}
		orbEffect.GetComponent<OrbEffect>().endEffect = hitEffect;
		ContentAddition.AddEffect(orbEffect);
		OrbAPI.AddOrb<KindredOrb>();
	}
}
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
{
}
internal class DeathState : GenericCharacterDeath
{
	public override void OnEnter()
	{
		((GenericCharacterDeath)this).OnEnter();
		((EntityState)this).GetComponent<KindredBehaviour>().wolfAnimator.Play("Death", 0);
	}
}
internal class KindredState : BaseSkillState
{
	public KindredBehaviour behaviour;

	public Animator animator;

	public Animator wolfAnimator;

	public ChildLocator childLocator;

	public override void OnEnter()
	{
		((BaseState)this).OnEnter();
		behaviour = ((EntityState)this).GetComponent<KindredBehaviour>();
		animator = behaviour.animator;
		wolfAnimator = behaviour.wolfAnimator;
		childLocator = behaviour.childLocator;
	}
}
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 => true;

	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;
		hopVelocity = baseHopVelocity / attackSpeedScaling;
		((EntityState)this).PlayAnimation(layerName, "BufferEmpty");
		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).PlayCrossfade(layerName, animationStateName, animParameter, attackDuration, 0.1f);
		}
	}

	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_0030: 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_0119: Unknown result type (might be due to invalid IL or missing references)
		//IL_011d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0129: Unknown result type (might be due to invalid IL or missing references)
		//IL_013c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0141: Unknown result type (might be due to invalid IL or missing references)
		//IL_0149: Unknown result type (might be due to invalid IL or missing references)
		//IL_0153: Unknown result type (might be due to invalid IL or missing references)
		//IL_0158: Unknown result type (might be due to invalid IL or missing references)
		//IL_015d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0183: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
		//IL_01f1: Unknown result type (might be due to invalid IL or missing references)
		//IL_01f6: Unknown result type (might be due to invalid IL or missing references)
		((EntityState)this).FixedUpdate();
		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 = true;
				}
				if (!rootMotionWhileHitting && !isInHitPause && hasAnimParameter)
				{
					hitStopCachedState = ((BaseState)this).CreateHitStopCachedState(((EntityState)this).characterMotor, animator, animParameter);
					isInHitPause = true;
				}
			}
			if (animator.GetFloat(hitBoxActiveParameter) > 0.1f && rootMotion && !isInHitPause && !hasHit)
			{
				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 >= hitPauseDuration && isInHitPause)
			{
				((BaseState)this).ConsumeHitStopCachedState(hitStopCachedState, ((EntityState)this).characterMotor, animator);
				isInHitPause = false;
				animator.speed = 1f;
			}
			if (!isInHitPause)
			{
				stopwatch += Time.fixedDeltaTime;
			}
			else
			{
				hitPauseTimer += Time.fixedDeltaTime;
				((EntityState)this).characterMotor.velocity = Vector3.zero;
				animator.speed = 0f;
			}
			if (stopwatch >= attackDuration - earlyExitDuration)
			{
				if (((EntityState)this).inputBank.skill1.down)
				{
					SetState();
				}
				if (stopwatch >= attackDuration)
				{
					BaseSkillState val3 = StateOverride();
					if (val3 != null)
					{
						((EntityState)this).outer.SetNextState((EntityState)(object)val3);
					}
					else
					{
						((EntityState)this).outer.SetNextStateToMain();
					}
					return;
				}
			}
		}
		if (animator.GetFloat(hitBoxActiveParameter) >= 0.11f && !hasSwung)
		{
			hasSwung = true;
			AkSoundEngine.PostEvent(swingSound, ((EntityState)this).gameObject);
			if (Object.op_Implicit((Object)(object)swingEffectPrefab) && !Utility.IsNullOrWhiteSpace(swingMuzzle))
			{
				EffectManager.SimpleMuzzleFlash(swingEffectPrefab, ((EntityState)this).gameObject, swingMuzzle, false);
			}
		}
	}

	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 : KindredState
{
	private float duration;

	private float baseDuration = 3f;

	private float minDuration;

	private float baseMinDuration = 0.45f;

	private float damageCoefficient = 1.85f;

	private HurtBox target;

	private bool hasFired;

	public override void OnEnter()
	{
		base.OnEnter();
		duration = baseDuration / ((BaseState)this).attackSpeedStat;
		minDuration = baseMinDuration / ((BaseState)this).attackSpeedStat;
		target = behaviour.tracker.trackingTarget;
		animator.SetFloat("attackIndex", (float)RoR2Application.rng.RangeInt(0, 3));
		((EntityState)this).PlayAnimation("Gesture, Override", "Attack", "M1", duration);
	}

	public override void FixedUpdate()
	{
		//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_00f5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00fa: Unknown result type (might be due to invalid IL or missing references)
		((EntityState)this).FixedUpdate();
		if (!hasFired && animator.GetFloat("Curve") > 0.1f)
		{
			hasFired = true;
			AkSoundEngine.PostEvent(Sounds.Play_Kindred_M1_Cast, ((EntityState)this).gameObject);
			if (NetworkServer.active)
			{
				KindredOrb kindredOrb = new KindredOrb();
				((GenericDamageOrb)kindredOrb).damageValue = ((EntityState)this).characterBody.damage * damageCoefficient;
				((GenericDamageOrb)kindredOrb).isCrit = ((BaseState)this).RollCrit();
				((GenericDamageOrb)kindredOrb).teamIndex = TeamComponent.GetObjectTeam(((EntityState)this).gameObject);
				((GenericDamageOrb)kindredOrb).attacker = ((EntityState)this).gameObject;
				((GenericDamageOrb)kindredOrb).procCoefficient = 1f;
				kindredOrb.attackSpeed = ((BaseState)this).attackSpeedStat;
				HurtBox val = target;
				if (Object.op_Implicit((Object)(object)val))
				{
					Transform val2 = childLocator.FindChild("weaponMuzzle");
					EffectManager.SimpleMuzzleFlash(Prefabs.muzzleEffect, ((EntityState)this).gameObject, "weaponMuzzle", true);
					((Orb)kindredOrb).origin = val2.position;
					((Orb)kindredOrb).target = val;
					OrbManager.instance.AddOrb((Orb)(object)kindredOrb);
				}
			}
		}
		if ((((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= duration) || (((EntityState)this).fixedAge >= minDuration && ((BaseSkillState)this).IsKeyDownAuthority()))
		{
			((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 Secondary : KindredState
{
	private float duration;

	private float baseDuration = 1.2f;

	private float minDuration;

	private float baseMinDuration = 0.8f;

	private float damageCoefficient = 1.85f;

	private Vector3 input;

	private AnimationCurve curve = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f);

	private SphereSearch search = new SphereSearch();

	private Transform muzzleTransform;

	private bool hasFired;

	public override void OnEnter()
	{
		//IL_0035: Unknown result type (might be due to invalid IL or missing references)
		//IL_003a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0040: 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_005b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0060: Unknown result type (might be due to invalid IL or missing references)
		base.OnEnter();
		duration = baseDuration / ((BaseState)this).attackSpeedStat;
		minDuration = baseMinDuration / ((BaseState)this).attackSpeedStat;
		input = ((EntityState)this).inputBank.moveVector;
		if (input == Vector3.zero)
		{
			input = ((EntityState)this).characterDirection.forward;
		}
		float num = Mathf.RoundToInt(animator.GetFloat("forwardSpeed"));
		float num2 = animator.GetFloat("rightSpeed");
		if (num == 1f || num == -1f)
		{
			num2 = 0f;
		}
		animator.SetFloat("fwHop", num);
		animator.SetFloat("sideHop", num2);
		((EntityState)this).PlayAnimation("Gesture, Override", "BufferEmpty");
		((EntityState)this).PlayAnimation("Body", "Hop", "M2", duration);
		muzzleTransform = childLocator.FindChild("weaponMuzzle");
		((BaseState)this).SmallHop(((EntityState)this).characterMotor, 12f);
		if (((EntityState)this).isAuthority)
		{
			((EntityState)this).characterBody.isSprinting = true;
		}
		AkSoundEngine.PostEvent(Sounds.Play_Kindred_M2_Cast, ((EntityState)this).gameObject);
		if (NetworkServer.active)
		{
			((EntityState)this).characterBody.AddTimedBuff(Prefabs.attackspeed, 4f);
		}
	}

	private void SpawnOrbs(HurtBox[] hurtboxes)
	{
		int num = hurtboxes.Length;
		if (num >= 3)
		{
			int num2 = 3;
			for (int i = 0; i < num2; i++)
			{
				NewOrb(hurtboxes[i]);
			}
		}
		else if (num == 2)
		{
			int num3 = 2;
			for (int j = 0; j < num3; j++)
			{
				NewOrb(hurtboxes[0]);
			}
			if (Object.op_Implicit((Object)(object)hurtboxes[1]))
			{
				NewOrb(hurtboxes[1]);
			}
		}
		else
		{
			int num4 = 3;
			for (int k = 0; k < num4; k++)
			{
				NewOrb(hurtboxes[0]);
			}
		}
	}

	private void NewOrb(HurtBox target)
	{
		//IL_0043: Unknown result type (might be due to invalid IL or missing references)
		//IL_0048: Unknown result type (might be due to invalid IL or missing references)
		//IL_009b: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
		Util.PlaySound(FireSyringe.attackSound, ((EntityState)this).gameObject);
		KindredOrb kindredOrb = new KindredOrb();
		((GenericDamageOrb)kindredOrb).damageValue = ((EntityState)this).characterBody.damage * damageCoefficient;
		((GenericDamageOrb)kindredOrb).isCrit = ((BaseState)this).RollCrit();
		((GenericDamageOrb)kindredOrb).teamIndex = TeamComponent.GetObjectTeam(((EntityState)this).gameObject);
		((GenericDamageOrb)kindredOrb).attacker = ((EntityState)this).gameObject;
		((GenericDamageOrb)kindredOrb).procCoefficient = 1f;
		kindredOrb.attackSpeed = ((BaseState)this).attackSpeedStat;
		if (Object.op_Implicit((Object)(object)target))
		{
			EffectManager.SimpleMuzzleFlash(Prefabs.muzzleEffectMult, ((EntityState)this).gameObject, "weaponMuzzle", true);
			((Orb)kindredOrb).origin = muzzleTransform.position;
			((Orb)kindredOrb).target = target;
			OrbManager.instance.AddOrb((Orb)(object)kindredOrb);
		}
	}

	public override void FixedUpdate()
	{
		//IL_01f0: Unknown result type (might be due to invalid IL or missing references)
		//IL_01f6: Unknown result type (might be due to invalid IL or missing references)
		//IL_0206: Unknown result type (might be due to invalid IL or missing references)
		//IL_022c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0233: Unknown result type (might be due to invalid IL or missing references)
		//IL_0238: Unknown result type (might be due to invalid IL or missing references)
		//IL_023d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0243: Unknown result type (might be due to invalid IL or missing references)
		//IL_0248: Unknown result type (might be due to invalid IL or missing references)
		//IL_024d: Unknown result type (might be due to invalid IL or missing references)
		//IL_024f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0251: Unknown result type (might be due to invalid IL or missing references)
		//IL_026a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0276: Unknown result type (might be due to invalid IL or missing references)
		//IL_027d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0282: Unknown result type (might be due to invalid IL or missing references)
		//IL_0286: Unknown result type (might be due to invalid IL or missing references)
		//IL_028b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0293: Unknown result type (might be due to invalid IL or missing references)
		//IL_0295: Unknown result type (might be due to invalid IL or missing references)
		//IL_0122: Unknown result type (might be due to invalid IL or missing references)
		//IL_0127: Unknown result type (might be due to invalid IL or missing references)
		//IL_012b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0130: Unknown result type (might be due to invalid IL or missing references)
		//IL_0162: Unknown result type (might be due to invalid IL or missing references)
		//IL_0167: Unknown result type (might be due to invalid IL or missing references)
		//IL_017d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0182: Unknown result type (might be due to invalid IL or missing references)
		((EntityState)this).FixedUpdate();
		if (((EntityState)this).isAuthority)
		{
			((EntityState)this).characterBody.isSprinting = true;
		}
		if (!hasFired && animator.GetFloat("Curve") >= 0.1f)
		{
			hasFired = true;
			AkSoundEngine.PostEvent(Sounds.Play_Kindred_M2_Cast, ((EntityState)this).gameObject);
			if (NetworkServer.active)
			{
				behaviour.tracker.search.maxAngleFilter = 45f;
				BullseyeSearch obj = behaviour.tracker.search;
				obj.maxDistanceFilter *= 1.5f;
				behaviour.tracker.search.RefreshCandidates();
				behaviour.tracker.search.FilterOutGameObject(((EntityState)this).gameObject);
				HurtBox[] array = behaviour.tracker.search.GetResults().ToArray();
				int num = array.Length;
				if (num > 0)
				{
					SpawnOrbs(array);
				}
				else
				{
					SphereSearch obj2 = search;
					LayerIndex entityPrecise = LayerIndex.entityPrecise;
					obj2.mask = ((LayerIndex)(ref entityPrecise)).mask;
					search.radius = behaviour.tracker.maxTrackingDistance * 1.5f;
					search.origin = ((EntityState)this).transform.position;
					array = search.RefreshCandidates().FilterCandidatesByHurtBoxTeam(TeamMask.GetEnemyTeams(((EntityState)this).teamComponent.teamIndex)).OrderCandidatesByDistance()
						.FilterCandidatesByDistinctHurtBoxEntities()
						.GetHurtBoxes();
					num = array.Length;
					if (num > 0)
					{
						SpawnOrbs(array);
					}
				}
			}
		}
		if (((EntityState)this).isAuthority)
		{
			float num2 = curve.Evaluate(((EntityState)this).fixedAge / duration) * Time.fixedDeltaTime;
			CharacterMotor characterMotor = ((EntityState)this).characterMotor;
			characterMotor.rootMotion += input * behaviour.hopSpeed * Mathf.Max(1f, ((EntityState)this).characterBody.moveSpeed / ((EntityState)this).characterBody.baseMoveSpeed) * num2;
			Vector2 val = Util.Vector3XZToVector2XY(input);
			if (val != Vector2.zero)
			{
				((Vector2)(ref val)).Normalize();
				Vector3 val2 = new Vector3(val.x, 0f, val.y);
				Vector3 normalized = ((Vector3)(ref val2)).normalized;
				((EntityState)this).characterDirection.moveVector = normalized;
			}
		}
		if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= minDuration)
		{
			((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)2;
	}
}
internal class Special : KindredState
{
	private float duration = 4f;

	private float stopwatch;

	private SphereSearch search = new SphereSearch();

	private float radius = 10f;

	private GameObject areaIndicator;

	private TeamMask mask;

	private uint ID;

	private AimRequest request;

	public override void OnEnter()
	{
		//IL_000e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0020: Unknown result type (might be due to invalid IL or missing references)
		//IL_0031: Unknown result type (might be due to invalid IL or missing references)
		//IL_0036: Unknown result type (might be due to invalid IL or missing references)
		//IL_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_006f: 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)
		base.OnEnter();
		mask = default(TeamMask);
		((TeamMask)(ref mask)).AddTeam(((EntityState)this).teamComponent.teamIndex);
		SphereSearch obj = search;
		LayerIndex entityPrecise = LayerIndex.entityPrecise;
		obj.mask = ((LayerIndex)(ref entityPrecise)).mask;
		search.radius = radius;
		areaIndicator = Object.Instantiate<GameObject>(Prefabs.areaIndicator);
		areaIndicator.transform.localScale = Vector3.one * radius;
		AkSoundEngine.PostEvent(Sounds.Play_Kindred_Special_Cast, ((EntityState)this).gameObject);
		ID = AkSoundEngine.PostEvent(Sounds.Play_Kindred_Special_Loop, ((EntityState)this).gameObject);
		request = ((EntityState)this).cameraTargetParams.RequestAimType((AimType)2);
	}

	public override void Update()
	{
		//IL_0029: Unknown result type (might be due to invalid IL or missing references)
		((EntityState)this).Update();
		if (Object.op_Implicit((Object)(object)areaIndicator))
		{
			areaIndicator.transform.position = ((EntityState)this).transform.position;
		}
	}

	public override void FixedUpdate()
	{
		//IL_0053: Unknown result type (might be due to invalid IL or missing references)
		//IL_0058: Unknown result type (might be due to invalid IL or missing references)
		//IL_006a: Unknown result type (might be due to invalid IL or missing references)
		((EntityState)this).FixedUpdate();
		if (NetworkServer.active)
		{
			stopwatch += Time.fixedDeltaTime;
			if (stopwatch >= 0.15f)
			{
				stopwatch = 0f;
				search.origin = ((EntityState)this).transform.position;
				HurtBox[] hurtBoxes = search.RefreshCandidates().FilterCandidatesByHurtBoxTeam(mask).OrderCandidatesByDistance()
					.FilterCandidatesByDistinctHurtBoxEntities()
					.GetHurtBoxes();
				foreach (HurtBox val in hurtBoxes)
				{
					val.healthComponent.body.AddTimedBuff(Prefabs.immunity, 0.25f);
				}
			}
		}
		if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority)
		{
			((EntityState)this).outer.SetNextStateToMain();
		}
	}

	public override void OnExit()
	{
		//IL_0063: Unknown result type (might be due to invalid IL or missing references)
		//IL_0068: Unknown result type (might be due to invalid IL or missing references)
		//IL_008d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0092: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
		if (Object.op_Implicit((Object)(object)((EntityState)this).cameraTargetParams))
		{
			request.Dispose();
		}
		AkSoundEngine.StopPlayingID(ID);
		AkSoundEngine.PostEvent(Sounds.Play_Kindred_Special_Heal, ((EntityState)this).gameObject);
		if (Object.op_Implicit((Object)(object)areaIndicator))
		{
			EntityState.Destroy((Object)(object)areaIndicator);
		}
		EffectManager.SimpleEffect(Prefabs.healEffect, ((EntityState)this).transform.position, Quaternion.identity, false);
		if (NetworkServer.active)
		{
			search.origin = ((EntityState)this).transform.position;
			HurtBox[] hurtBoxes = search.RefreshCandidates().FilterCandidatesByHurtBoxTeam(mask).OrderCandidatesByDistance()
				.FilterCandidatesByDistinctHurtBoxEntities()
				.GetHurtBoxes();
			foreach (HurtBox val in hurtBoxes)
			{
				val.healthComponent.Heal(((EntityState)this).healthComponent.fullCombinedHealth * 0.5f, default(ProcChainMask), true);
			}
		}
		((EntityState)this).OnExit();
	}

	public override InterruptPriority GetMinimumInterruptPriority()
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0005: Unknown result type (might be due to invalid IL or missing references)
		return (InterruptPriority)6;
	}
}
internal class Utility : KindredState
{
	private float duration = 10f;

	private OverlapAttack overlapAttack;

	private float attackStopwatch = 1f;

	private float attackInterval;

	private float attackDuration;

	private bool attacked;

	public override void OnEnter()
	{
		base.OnEnter();
		attackInterval = behaviour.baseAttackInterval / ((BaseState)this).attackSpeedStat;
		attackDuration = behaviour.baseAttackDuration / ((BaseState)this).attackSpeedStat;
		((EntityState)this).PlayAnimation("Gesture, Override", "Utility", "Utility", 1.5f);
		behaviour.StartAttack();
		AkSoundEngine.PostEvent(Sounds.Play_Kindred_Utility_Cast, ((EntityState)this).gameObject);
	}

	public override void FixedUpdate()
	{
		((EntityState)this).FixedUpdate();
		if (behaviour.inAttackRange)
		{
			attackStopwatch += Time.fixedDeltaTime;
			if (attackStopwatch >= attackInterval)
			{
				if (attackStopwatch < attackInterval + behaviour.attackFireDuration)
				{
					Attack();
				}
				if (attackStopwatch >= attackInterval + attackDuration)
				{
					attackStopwatch = 0f;
					attacked = false;
				}
			}
		}
		else
		{
			attacked = false;
		}
		if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority)
		{
			((EntityState)this).outer.SetNextStateToMain();
		}
	}

	private void Attack()
	{
		//IL_0078: Unknown result type (might be due to invalid IL or missing references)
		//IL_007d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0089: 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_009c: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
		//IL_00bd: 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_00d2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f8: Expected O, but got Unknown
		if (!attacked)
		{
			attacked = true;
			AkSoundEngine.PostEvent(Sounds.Play_Kindred_Wolf_Attack_Cast, ((EntityState)this).gameObject);
			EntityState.PlayAnimationOnAnimator(behaviour.wolfAnimator, "Body", "Attack" + RoR2Application.rng.RangeInt(1, 3), "M1", attackDuration);
			if (((EntityState)this).isAuthority)
			{
				overlapAttack = new OverlapAttack
				{
					attacker = ((EntityState)this).gameObject,
					inflictor = ((EntityState)this).gameObject,
					teamIndex = ((EntityState)this).teamComponent.teamIndex,
					hitEffectPrefab = Prefabs.wolfHitEffect,
					isCrit = ((BaseState)this).RollCrit(),
					damage = ((BaseState)this).damageStat * 1.8f,
					damageType = (DamageType)64,
					procCoefficient = 0.5f,
					hitBoxGroup = behaviour.wolfHitbox
				};
			}
		}
		if (((EntityState)this).isAuthority)
		{
			overlapAttack.Fire((List<HurtBox>)null);
		}
	}

	public override void OnExit()
	{
		behaviour.EndAttack();
		((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)6;
	}
}
internal class Sounds
{
	public static readonly uint Play_Kindred_M1_Hit = 398482840u;

	public static readonly uint Play_Kindred_M1_Cast = 1147392264u;

	public static readonly uint Play_Kindred_M2_Cast = 1126787797u;

	public static readonly uint Play_Kindred_M2_Fire = 2042173164u;

	public static readonly uint Play_Kindred_Special_Loop = 61726854u;

	public static readonly uint Play_Kindred_Special_Cast = 1359657169u;

	public static readonly uint Play_Kindred_Passive_Mark = 1550163989u;

	public static readonly uint Play_Kindred_Wolf_Attack_Hit = 1839320549u;

	public static readonly uint Play_Kindred_Wolf_Attack_Cast = 1911345575u;

	public static readonly uint Play_Kindred_Special_Heal = 2656577746u;

	public static readonly uint Play_Kindred_Utility_Cast = 3042049546u;

	public static readonly uint Play_Kindred_Passive_Collect = 3369812272u;

	public static readonly uint Play_Kindred_Intro = 1835983734u;
}
internal static class Extensions
{
	public static GameObject NewSyringe(this GameObject g, params Material[] m)
	{
		((Renderer)g.GetComponentsInChildren<MeshRenderer>(false)[0]).material = m[0];
		((Renderer)g.GetComponent<TrailRenderer>()).material = m[1];
		((Renderer)g.GetComponent<ParticleSystemRenderer>()).material = m[2];
		return g;
	}

	public static Material SwapTexture(this Material m, Texture2D t)
	{
		m.mainTexture = (Texture)(object)t;
		return m;
	}

	public static GameObject SwapMaterials(this GameObject g, Material[] m)
	{
		Renderer[] componentsInChildren = g.GetComponentsInChildren<Renderer>();
		for (int i = 0; i < componentsInChildren.Length; i++)
		{
			if (Object.op_Implicit((Object)(object)m[i]))
			{
				componentsInChildren[i].material = m[i];
			}
		}
		return g;
	}

	public static float Mult(this float f, float mult = 100f)
	{
		return f * mult;
	}

	public static Color ToRGB255(this Color c, string title, string body)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_000d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0019: Unknown result type (might be due to invalid IL or missing references)
		//IL_0025: Unknown result type (might be due to invalid IL or missing references)
		//IL_002a: Unknown result type (might be due to invalid IL or missing references)
		//IL_002d: Unknown result type (might be due to invalid IL or missing references)
		return new Color(c.r / 255f, c.g / 255f, c.b / 255f);
	}

	public static void SetStrings(this TooltipProvider t, string title, string body)
	{
		t.overrideTitleText = title;
		t.overrideBodyText = body;
	}
}
internal class Utils
{
	public static SkillDef NewSkillDef<T>(Type activationState, string activationStateMachineName, int baseMaxStock, float baseRechargeInterval, bool beginSkillCooldownOnSkillEnd, bool canceledFromSprinting, bool fullRestockOnAssign, InterruptPriority interruptPriority, bool isCombatSkill, bool mustKeyPress, bool cancelSprintingOnActivation, int rechargeStock, int requiredStock, int stockToConsume, Sprite icon, string skillDescriptionToken, string skillName, params string[] keywordTokens) where T : SkillDef
	{
		//IL_000e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0013: Unknown result type (might be due to invalid IL or missing references)
		//IL_0069: Unknown result type (might be due to invalid IL or missing references)
		//IL_006b: Unknown result type (might be due to invalid IL or missing references)
		T val = ScriptableObject.CreateInstance<T>();
		((SkillDef)val).activationState = new SerializableEntityStateType(activationState);
		((SkillDef)val).activationStateMachineName = activationStateMachineName;
		((SkillDef)val).baseMaxStock = baseMaxStock;
		((SkillDef)val).baseRechargeInterval = baseRechargeInterval;
		((SkillDef)val).beginSkillCooldownOnSkillEnd = beginSkillCooldownOnSkillEnd;
		((SkillDef)val).canceledFromSprinting = canceledFromSprinting;
		((SkillDef)val).fullRestockOnAssign = fullRestockOnAssign;
		((SkillDef)val).interruptPriority = interruptPriority;
		((SkillDef)val).isCombatSkill = isCombatSkill;
		((SkillDef)val).mustKeyPress = mustKeyPress;
		((SkillDef)val).cancelSprintingOnActivation = cancelSprintingOnActivation;
		((SkillDef)val).rechargeStock = rechargeStock;
		((SkillDef)val).requiredStock = requiredStock;
		((SkillDef)val).stockToConsume = stockToConsume;
		((SkillDef)val).icon = icon;
		((SkillDef)val).skillDescriptionToken = skillDescriptionToken;
		((SkillDef)val).skillName = skillName;
		((SkillDef)val).skillNameToken = ((SkillDef)val).skillName;
		((SkillDef)val).keywordTokens = keywordTokens;
		ContentAddition.AddSkillDef((SkillDef)(object)val);
		return (SkillDef)(object)val;
	}

	public static Color HexTo10(string hexColor)
	{
		//IL_0025: Unknown result type (might be due to invalid IL or missing references)
		//IL_002f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0034: 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_0036: 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)
		char[] array = hexColor.ToCharArray();
		return new Color((float)(array[0] + array[1]), (float)(array[2] + array[3]), (float)(array[4] + array[5]), 255f) / 255f;
	}

	public static EntityStateMachine NewStateMachine<T>(GameObject obj, string customName) where T : EntityState
	{
		//IL_0021: Unknown result type (might be due to invalid IL or missing references)
		//IL_0022: Unknown result type (might be due to invalid IL or missing references)
		//IL_0028: Unknown result type (might be due to invalid IL or missing references)
		//IL_0029: Unknown result type (might be due to invalid IL or missing references)
		SerializableEntityStateType val = default(SerializableEntityStateType);
		((SerializableEntityStateType)(ref val))..ctor(typeof(T));
		EntityStateMachine val2 = obj.AddComponent<EntityStateMachine>();
		val2.customName = customName;
		val2.initialStateType = val;
		val2.mainStateType = val;
		return val2;
	}

	public static GenericSkill NewGenericSkill(GameObject obj, SkillDef skill)
	{
		//IL_0031: Unknown result type (might be due to invalid IL or missing references)
		//IL_0049: Unknown result type (might be due to invalid IL or missing references)
		//IL_0053: Expected O, but got Unknown
		//IL_0054: 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)
		GenericSkill val = obj.AddComponent<GenericSkill>();
		SkillFamily val2 = ScriptableObject.CreateInstance<SkillFamily>();
		val2.variants = (Variant[])(object)new Variant[1];
		val._skillFamily = val2;
		SkillFamily skillFamily = val.skillFamily;
		Variant[] variants = skillFamily.variants;
		Variant val3 = new Variant
		{
			skillDef = skill
		};
		((Variant)(ref val3)).viewableNode = new Node(skill.skillNameToken, false, (Node)null);
		variants[0] = val3;
		ContentAddition.AddSkillFamily(skillFamily);
		return val;
	}

	public static void AddAlt(SkillFamily skillFamily, SkillDef SkillDef)
	{
		//IL_0029: Unknown result type (might be due to invalid IL or missing references)
		//IL_0041: Unknown result type (might be due to invalid IL or missing references)
		//IL_004b: Expected O, but got Unknown
		//IL_004c: Unknown result type (might be due to invalid IL or missing references)
		//IL_004d: Unknown result type (might be due to invalid IL or missing references)
		Array.Resize(ref skillFamily.variants, skillFamily.variants.Length + 1);
		Variant[] variants = skillFamily.variants;
		int num = skillFamily.variants.Length - 1;
		Variant val = new Variant
		{
			skillDef = SkillDef
		};
		((Variant)(ref val)).viewableNode = new Node(SkillDef.skillNameToken, false, (Node)null);
		variants[num] = val;
	}

	public static BuffDef NewBuffDef(string name, bool stack, bool hidden, Sprite sprite, Color color)
	{
		//IL_0025: Unknown result type (might be due to invalid IL or missing references)
		//IL_0027: Unknown result type (might be due to invalid IL or missing references)
		BuffDef val = ScriptableObject.CreateInstance<BuffDef>();
		((Object)val).name = name;
		val.canStack = stack;
		val.isHidden = hidden;
		val.iconSprite = sprite;
		val.buffColor = color;
		ContentAddition.AddBuffDef(val);
		return val;
	}

	public static ObjectScaleCurve AddScaleComponent(GameObject target, float timeMax)
	{
		ObjectScaleCurve val = target.AddComponent<ObjectScaleCurve>();
		val.useOverallCurveOnly = true;
		val.timeMax = timeMax;
		val.overallCurve = AnimationCurve.Linear(0f, 0f, 1f, 1f);
		return val;
	}

	public static RotateAroundAxis AddRotationComponent(GameObject target, float speed, RotationAxis axis)
	{
		//IL_0019: Unknown result type (might be due to invalid IL or missing references)
		RotateAroundAxis val = target.AddComponent<RotateAroundAxis>();
		val.speed = (Speed)2;
		val.fastRotationSpeed = speed;
		val.rotateAroundAxis = axis;
		return val;
	}

	public static GameObject NewDisplayModel(GameObject model, string name)
	{
		//IL_0041: Unknown result type (might be due to invalid IL or missing references)
		//IL_0075: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c0: Expected O, but got Unknown
		GameObject val = PrefabAPI.InstantiateClone(model, name, false);
		Animator componentInChildren = val.GetComponentInChildren<Animator>();
		componentInChildren.runtimeAnimatorController = Assets.Load<RuntimeAnimatorController>("displayAnimator");
		((Behaviour)((Component)componentInChildren).GetComponent<CharacterModel>()).enabled = false;
		ChildLocator component = ((Component)componentInChildren).GetComponent<ChildLocator>();
		component.FindChild("wolfMuzzle").localPosition = Vector3.zero;
		((Component)component.FindChild("displayEffect")).gameObject.SetActive(true);
		Transform val2 = ((Component)componentInChildren).GetComponent<ChildLocator>().FindChild("wolf");
		val2.localPosition = Vector3.zero;
		((Component)val2).GetComponent<Animator>().runtimeAnimatorController = Assets.Load<RuntimeAnimatorController>("wolfDisplayAnimator");
		SkinnedMeshRenderer[] componentsInChildren = val.GetComponentsInChildren<SkinnedMeshRenderer>(true);
		foreach (SkinnedMeshRenderer val3 in componentsInChildren)
		{
			((Renderer)val3).material = new Material(((Renderer)val3).material);
			((Renderer)val3).material.DisableKeyword("DITHER");
		}
		return val;
	}

	public static AnimateShaderAlpha AddShaderAlphaComponent(GameObject target, float timeMax, AnimationCurve curve, bool destroyOnEnd = true, bool disableOnEnd = false)
	{
		AnimateShaderAlpha val = target.AddComponent<AnimateShaderAlpha>();
		val.timeMax = timeMax;
		val.alphaCurve = curve;
		val.destroyOnEnd = destroyOnEnd;
		val.disableOnEnd = disableOnEnd;
		return val;
	}

	internal static Sprite CreateSprite(Texture2D tex)
	{
		//IL_001a: 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)
		return Sprite.Create(tex, new Rect(0f, 0f, (float)((Texture)tex).width, (float)((Texture)tex).height), new Vector2(0.5f, 0.5f), 128f);
	}

	internal static SkinDefInfo CreateNewSkinDefInfo(SkinnedMeshRenderer[] childList, GameObject rootObject, string skinName, string objectToEnable, RendererInfo[] rendererInfos, UnlockableDef unlockableDef = null)
	{
		//IL_0003: Unknown result type (might be due to invalid IL or missing references)
		//IL_0044: Unknown result type (might be due to invalid IL or missing references)
		//IL_006c: Unknown result type (might be due to invalid IL or missing references)
		//IL_006e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0071: 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_00db: 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)
		SkinDefInfo result = default(SkinDefInfo);
		result.BaseSkins = Array.Empty<SkinDef>();
		result.MinionSkinReplacements = (MinionSkinReplacement[])(object)new MinionSkinReplacement[0];
		result.ProjectileGhostReplacements = (ProjectileGhostReplacement[])(object)new ProjectileGhostReplacement[0];
		List<GameObjectActivation> list = new List<GameObjectActivation>();
		foreach (SkinnedMeshRenderer val in childList)
		{
			GameObjectActivation val2 = default(GameObjectActivation);
			val2.gameObject = ((Component)val).gameObject;
			val2.shouldActivate = ((Object)val).name.Contains(objectToEnable);
			GameObjectActivation item = val2;
			list.Add(item);
		}
		result.GameObjectActivations = list.ToArray();
		result.Icon = Assets.MainAssetBundle.LoadAsset<Sprite>(objectToEnable);
		result.MeshReplacements = (MeshReplacement[])(object)new MeshReplacement[0];
		result.Name = skinName;
		result.NameToken = skinName;
		result.RendererInfos = rendererInfos;
		result.RootObject = rootObject;
		result.UnlockableDef = unlockableDef;
		return result;
	}

	internal static T CopyComponent<T>(T original, GameObject destination) where T : Component
	{
		Type type = ((object)original).GetType();
		Component val = destination.AddComponent(type);
		FieldInfo[] fields = type.GetFields();
		FieldInfo[] array = fields;
		foreach (FieldInfo fieldInfo in array)
		{
			fieldInfo.SetValue(val, fieldInfo.GetValue(original));
		}
		return (T)(object)((val is T) ? val : null);
	}

	public static Sprite CreateSpriteFromTexture(Texture2D texture)
	{
		//IL_0025: Unknown result type (might be due to invalid IL or missing references)
		//IL_0034: Unknown result type (might be due to invalid IL or missing references)
		if (Object.op_Implicit((Object)(object)texture))
		{
			return Sprite.Create(texture, new Rect(0f, 0f, (float)((Texture)texture).width, (float)((Texture)texture).height), new Vector2(0.5f, 0.5f));
		}
		return null;
	}

	public static GameObject FindInActiveObjectByName(string name)
	{
		//IL_000f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0015: Invalid comparison between Unknown and I4
		Transform[] array = Resources.FindObjectsOfTypeAll<Transform>();
		for (int i = 0; i < array.Length; i++)
		{
			if ((int)((Object)array[i]).hideFlags == 0 && ((Object)array[i]).name == name)
			{
				return ((Component)array[i]).gameObject;
			}
		}
		return null;
	}

	public static void CreateHitboxes(string name, Transform parent, Vector3[] sizes, Vector3[] positions)
	{
		//IL_0034: Unknown result type (might be due to invalid IL or missing references)
		//IL_003a: Expected O, but got Unknown
		//IL_004f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0060: Unknown result type (might be due to invalid IL or missing references)
		//IL_0073: Unknown result type (might be due to invalid IL or missing references)
		HitBoxGroup val = ((Component)parent).gameObject.AddComponent<HitBoxGroup>();
		val.groupName = name;
		List<HitBox> list = new List<HitBox>();
		for (int i = 0; i < sizes.Length; i++)
		{
			GameObject val2 = new GameObject(name + (i + 1));
			val2.transform.SetParent(parent);
			val2.transform.localPosition = positions[i];
			val2.transform.localRotation = Quaternion.identity;
			val2.transform.localScale = sizes[i];
			HitBox item = val2.AddComponent<HitBox>();
			val2.layer = LayerIndex.projectile.intVal;
			list.Add(item);
		}
		val.hitBoxes = list.ToArray();
	}

	public static GameObject CreateHitbox(string name, Transform parent, Vector3 scale, Vector3 localPosition)
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0008: Expected O, but got Unknown
		//IL_001b: 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_0039: Unknown result type (might be due to invalid IL or missing references)
		GameObject val = new GameObject(name);
		val.transform.SetParent(parent);
		val.transform.localPosition = localPosition;
		val.transform.localRotation = Quaternion.identity;
		val.transform.localScale = scale;
		HitBoxGroup val2 = ((Component)parent).gameObject.AddComponent<HitBoxGroup>();
		HitBox val3 = val.AddComponent<HitBox>();
		val.layer = LayerIndex.projectile.intVal;
		val2.hitBoxes = (HitBox[])(object)new HitBox[1] { val3 };
		val2.groupName = name;
		return val;
	}

	internal static EffectComponent RegisterEffect(GameObject effect, float duration, string soundName = "", bool applyScale = false, bool parentToReferencedTransform = true, bool positionAtReferencedTransform = true)
	{
		//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
		//IL_0097: Unknown result type (might be due to invalid IL or missing references)
		EffectComponent val = effect.GetComponent<EffectComponent>();
		if (!Object.op_Implicit((Object)(object)val))
		{
			val = effect.AddComponent<EffectComponent>();
		}
		if (duration != -1f)
		{
			DestroyOnTimer component = effect.GetComponent<DestroyOnTimer>();
			if (!Object.op_Implicit((Object)(object)compo