Decompiled source of ChoGath v1.0.1

ChoGath.dll

Decompiled 2 months ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using EntityStates;
using EntityStates.BrotherMonster;
using EntityStates.Merc;
using HG.BlendableTypes;
using KinematicCharacterController;
using R2API;
using R2API.Utils;
using Rewired.ComponentControls.Effects;
using RoR2;
using RoR2.Achievements;
using RoR2.Networking;
using RoR2.Projectile;
using RoR2.Skills;
using RoR2.UI;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.Events;
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("ChoGath")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("ChoGath")]
[assembly: AssemblyTitle("ChoGath")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace ChoGath;

public static class Achievements
{
	public class BaseEnemyConsumeUnlock : BaseAchievement
	{
		private BodyIndex requiredEnemyBodyIndex;

		public virtual string requiredEnemy => "";

		public override BodyIndex LookUpRequiredBodyIndex()
		{
			//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_000e: Unknown result type (might be due to invalid IL or missing references)
			return BodyCatalog.FindBodyIndex("Cho'GathBody");
		}

		public override void OnBodyRequirementMet()
		{
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			((BaseAchievement)this).OnBodyRequirementMet();
			requiredEnemyBodyIndex = BodyCatalog.FindBodyIndex(requiredEnemy);
			GlobalEventManager.onClientDamageNotified += GlobalEventManager_onClientDamageNotified;
		}

		private void GlobalEventManager_onClientDamageNotified(DamageDealtMessage message)
		{
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Invalid comparison between Unknown and I4
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			if (!Object.op_Implicit((Object)(object)message.victim) || !Object.op_Implicit((Object)(object)message.attacker) || !Object.op_Implicit((Object)(object)message.attacker.GetComponent<ChoTracker>()) || (int)message.damageType != 524288)
			{
				return;
			}
			CharacterBody component = message.victim.GetComponent<CharacterBody>();
			if (Object.op_Implicit((Object)(object)component) && component.bodyIndex == requiredEnemyBodyIndex)
			{
				HealthComponent healthComponent = component.healthComponent;
				if (Object.op_Implicit((Object)(object)healthComponent) && !healthComponent.alive)
				{
					((BaseAchievement)this).Grant();
				}
			}
		}

		public override void OnBodyRequirementBroken()
		{
			GlobalEventManager.onClientDamageNotified -= GlobalEventManager_onClientDamageNotified;
			((BaseAchievement)this).OnBodyRequirementBroken();
		}
	}

	public class BaseItemUnlock : BaseAchievement
	{
		private Inventory inventory;

		public virtual int requiredAmount => 0;

		public virtual string itemName => "ChoGathFeast";

		public override BodyIndex LookUpRequiredBodyIndex()
		{
			//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_000e: Unknown result type (might be due to invalid IL or missing references)
			return BodyCatalog.FindBodyIndex("Cho'GathBody");
		}

		public override void OnBodyRequirementMet()
		{
			((BaseAchievement)this).OnBodyRequirementMet();
			inventory = ((BaseAchievement)this).localUser.cachedMaster.inventory;
			inventory.onInventoryChanged += OnInventoryChanged;
		}

		public override void OnBodyRequirementBroken()
		{
			inventory.onInventoryChanged -= OnInventoryChanged;
			((BaseAchievement)this).OnBodyRequirementBroken();
		}

		private void OnInventoryChanged()
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			if (inventory.GetItemCount(ItemCatalog.FindItemIndex(itemName)) >= requiredAmount)
			{
				((BaseAchievement)this).Grant();
			}
		}
	}

	[RegisterAchievement("CHOGATH_BEAR", "ACHIEVEMENT_CHOGATH_BEAR_UNLOCKABLE_ID", null, null)]
	public class BearUnlock : BaseItemUnlock
	{
		public override int requiredAmount => 1;

		public override string itemName => "Bear";
	}

	[RegisterAchievement("CHOGATH_SIZECAP", "ACHIEVEMENT_CHOGATH_SIZECAP_UNLOCKABLE_ID", null, null)]
	public class SizeCapUnlock : BaseItemUnlock
	{
		public override int requiredAmount => 100;
	}

	[RegisterAchievement("CHOGATH_CONSUMEELDER", "ACHIEVEMENT_CHOGATH_CONSUMEELDER_UNLOCKABLE_ID", null, null)]
	public class ConsumeElderUnlock : BaseEnemyConsumeUnlock
	{
		public override string requiredEnemy => "LemurianBruiserBody";
	}

	[RegisterAchievement("CHOGATH_CONSUMEGUP", "ACHIEVEMENT_CHOGATH_CONSUMEGUP_UNLOCKABLE_ID", null, null)]
	public class ConsumeGupUnlock : BaseEnemyConsumeUnlock
	{
		public override string requiredEnemy => "GupBody";
	}

	[RegisterAchievement("CHOGATH_CONSUMEVAGRANT", "ACHIEVEMENT_CHOGATH_CONSUMEVAGRANT_UNLOCKABLE_ID", null, typeof(ConsumeVagrantServerAchievement))]
	public class ConsumeVagrantUnlock : BaseAchievement
	{
		private class ConsumeVagrantServerAchievement : BaseServerAchievement
		{
			private BodyIndex requiredEnemyBodyIndex;

			public override void OnInstall()
			{
				//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)
				((BaseServerAchievement)this).OnInstall();
				requiredEnemyBodyIndex = BodyCatalog.FindBodyIndex("VagrantBody");
				GlobalEventManager.onCharacterDeathGlobal += GlobalEventManager_onCharacterDeathGlobal;
			}

			private void GlobalEventManager_onCharacterDeathGlobal(DamageReport damageReport)
			{
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				//IL_0008: Unknown result type (might be due to invalid IL or missing references)
				//IL_0015: Unknown result type (might be due to invalid IL or missing references)
				//IL_001f: Invalid comparison between Unknown and I4
				if (damageReport.victimBodyIndex == requiredEnemyBodyIndex && (int)damageReport.damageInfo.damageType == 524288 && (Object)(object)damageReport.attackerBody == (Object)(object)((BaseServerAchievement)this).networkUser.GetCurrentBody())
				{
					((BaseServerAchievement)this).Grant();
				}
			}

			public override void OnUninstall()
			{
				((BaseServerAchievement)this).OnUninstall();
			}
		}

		public override BodyIndex LookUpRequiredBodyIndex()
		{
			//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_000e: Unknown result type (might be due to invalid IL or missing references)
			return BodyCatalog.FindBodyIndex("Cho'GathBody");
		}

		public override void OnBodyRequirementMet()
		{
			((BaseAchievement)this).OnBodyRequirementMet();
			((BaseAchievement)this).SetServerTracked(true);
		}

		public override void OnBodyRequirementBroken()
		{
			((BaseAchievement)this).SetServerTracked(false);
			((BaseAchievement)this).OnBodyRequirementBroken();
		}
	}

	[RegisterAchievement("CHOGATH_CONSUME", "ACHIEVEMENT_CHOGATH_CONSUME_UNLOCKABLE_ID", null, null)]
	public class ConsumeUnlock : BaseItemUnlock
	{
		public override int requiredAmount => 1;
	}

	[RegisterAchievement("CHOGATH_TYPHOON", "ACHIEVEMENT_CHOGATH_TYPHOON_UNLOCKABLE_ID", null, null)]
	public class TyphoonAchievement : BaseAchievement
	{
		public override void OnBodyRequirementMet()
		{
			((BaseAchievement)this).OnBodyRequirementMet();
			Run.onClientGameOverGlobal += OnClientGameOverGlobal;
		}

		public override void OnBodyRequirementBroken()
		{
			Run.onClientGameOverGlobal -= OnClientGameOverGlobal;
			((BaseAchievement)this).OnBodyRequirementBroken();
		}

		private void OnClientGameOverGlobal(Run run, RunReport runReport)
		{
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			if (Object.op_Implicit((Object)(object)runReport.gameEnding) && runReport.gameEnding.isWin)
			{
				DifficultyDef difficultyDef = DifficultyCatalog.GetDifficultyDef(runReport.ruleBook.FindDifficulty());
				if (difficultyDef != null && difficultyDef.nameToken == "SS2_DIFFICULTY_TYPHOON_NAME")
				{
					((BaseAchievement)this).Grant();
				}
			}
		}
	}

	[RegisterAchievement("CHOGATH_MASTERY", "ACHIEVEMENT_CHOGATH_MASTERY_UNLOCKABLE_ID", null, null)]
	public class MasteryUnlockable : BasePerSurvivorClearGameMonsoonAchievement
	{
		public override BodyIndex LookUpRequiredBodyIndex()
		{
			//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_000e: Unknown result type (might be due to invalid IL or missing references)
			return BodyCatalog.FindBodyIndex("Cho'GathBody");
		}
	}

	internal static UnlockableDef masteryUnlock;

	internal static UnlockableDef typhoonUnlock;

	internal static UnlockableDef consumeUnlock;

	internal static UnlockableDef consumeBossUnlock;

	internal static UnlockableDef consumeGupUnlock;

	internal static UnlockableDef consumeElderUnlock;

	internal static UnlockableDef sizeCapUnlock;

	internal static UnlockableDef bearUnlock;

	private static UnlockableDef NewUnlockable<T>(string AchievementIdentifier, Sprite Icon, string Title, string Description) where T : BaseAchievement
	{
		string text = "ACHIEVEMENT_CHOGATH_";
		UnlockableDef val = ScriptableObject.CreateInstance<UnlockableDef>();
		string langName = text + AchievementIdentifier + "_NAME";
		string langDesc = text + AchievementIdentifier + "_DESCRIPTION";
		LanguageAPI.Add(langName, Title);
		LanguageAPI.Add(langDesc, Description);
		Func<string> func = () => Language.GetStringFormatted("UNLOCKED_FORMAT", new object[2]
		{
			Language.GetString(langName),
			Language.GetString(langDesc)
		});
		Type typeFromHandle = typeof(T);
		val.cachedName = text + AchievementIdentifier + "_UNLOCKABLE_ID";
		val.getHowToUnlockString = func;
		val.getUnlockedString = func;
		val.achievementIcon = Icon;
		val.sortScore = 200;
		val.hidden = false;
		ContentAddition.AddUnlockableDef(val);
		return val;
	}

	public static void RegisterUnlockables()
	{
		string text = "As Cho'Gath";
		masteryUnlock = NewUnlockable<MasteryUnlockable>("MASTERY", Assets.MainAssetBundle.LoadAsset<Sprite>("skin05"), "CHOGATH: Mastery", text + ", beat the game or obliterate on Monsoon.");
		typhoonUnlock = NewUnlockable<TyphoonAchievement>("TYPHOON", Assets.MainAssetBundle.LoadAsset<Sprite>("skin07"), "CHOGATH: Grand Mastery", text + ", beat the game or obliterate on Typhoon.");
		consumeUnlock = NewUnlockable<ConsumeUnlock>("CONSUME", Assets.MainAssetBundle.LoadAsset<Sprite>("skin01"), "CHOGATH: Nightmare", text + ", consume your first enemy.");
		consumeBossUnlock = NewUnlockable<ConsumeVagrantUnlock>("CONSUMEVAGRANT", Assets.MainAssetBundle.LoadAsset<Sprite>("skin03"), "CHOGATH: Loch Ness", text + ", consume a Wandering Vagrant.");
		consumeGupUnlock = NewUnlockable<ConsumeGupUnlock>("CONSUMEGUP", Assets.MainAssetBundle.LoadAsset<Sprite>("skin04"), "CHOGATH: Jurassic", text + ", consume a Gup.");
		consumeElderUnlock = NewUnlockable<ConsumeElderUnlock>("CONSUMEELDER", Assets.MainAssetBundle.LoadAsset<Sprite>("skin06"), "CHOGATH: Prehistoric", text + ", consume a Elder Lemurian.");
		sizeCapUnlock = NewUnlockable<SizeCapUnlock>("SIZECAP", Assets.MainAssetBundle.LoadAsset<Sprite>("skin23"), "CHOGATH: Broken Covenant", text + ", consume 100 enemies.");
		bearUnlock = NewUnlockable<BearUnlock>("BEAR", Assets.MainAssetBundle.LoadAsset<Sprite>("skin32"), "CHOGATH: Toy Terror", text + ", carry a Tougher Times.");
	}
}
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("ChoGath.AssetBundle." + "ChoGath".ToLower() + "assets");
			MainAssetBundle = AssetBundle.LoadFromStream(stream);
		}
		using Stream stream2 = executingAssembly.GetManifestResourceStream("ChoGath.ChoGath.bnk");
		byte[] array = new byte[stream2.Length];
		stream2.Read(array, 0, array.Length);
		SoundBanks.Add(array);
	}
}
internal class ChoTracker : HuntressTracker
{
}
internal class ModelBehaviour : MonoBehaviour
{
	private Animator animator;

	private CharacterBody body;

	private Interactor interactor;

	private CharacterModel characterModel;

	private ChildLocator childLocator;

	private FootstepHandler footstepHandler;

	private SfxLocator sfxLocator;

	private Transform baseSkeleton;

	private Transform battlecastSkeleton;

	private NetworkLoadout networkLoadout;

	private BodyIndex bodyIndex;

	private int skinIndex;

	private CharacterCameraParams cameraParams;

	private int feastCount;

	private bool enabledSpikes;

	private void Start()
	{
		//IL_0059: Unknown result type (might be due to invalid IL or missing references)
		//IL_005e: Unknown result type (might be due to invalid IL or missing references)
		LocalUser firstLocalUser = LocalUserManager.GetFirstLocalUser();
		NetworkUser val = ((firstLocalUser != null) ? firstLocalUser.currentNetworkUser : null);
		if (Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)val.networkLoadout))
		{
			networkLoadout = val.networkLoadout;
			networkLoadout.onLoadoutUpdated += NetworkLoadout_onLoadoutUpdated;
			bodyIndex = BodyCatalog.FindBodyIndex("Cho'GathBody");
		}
		childLocator = ((Component)this).GetComponent<ChildLocator>();
		baseSkeleton = childLocator.FindChild("baseSkeleton");
		battlecastSkeleton = childLocator.FindChild("battlecastSkeleton");
		animator = ((Component)this).GetComponent<Animator>();
		characterModel = ((Component)this).GetComponent<CharacterModel>();
		footstepHandler = ((Component)this).GetComponent<FootstepHandler>();
		body = characterModel.body;
		sfxLocator = (Object.op_Implicit((Object)(object)body) ? ((Component)body).GetComponent<SfxLocator>() : null);
		UpdateModel();
		if (!Object.op_Implicit((Object)(object)body))
		{
			return;
		}
		interactor = ((Component)body).GetComponent<Interactor>();
		CameraTargetParams component = ((Component)body).GetComponent<CameraTargetParams>();
		if (Object.op_Implicit((Object)(object)component))
		{
			cameraParams = Object.Instantiate<CharacterCameraParams>(component.cameraParams);
			component.cameraParams = cameraParams;
		}
		if (Object.op_Implicit((Object)(object)body.inventory))
		{
			feastCount = body.inventory.GetItemCount(Prefabs.feast);
			for (int i = 0; i < feastCount; i++)
			{
				body.AddBuff(Prefabs.feastBuff);
			}
			body.onInventoryChanged += Body_onInventoryChanged;
			UpdateSkinVFX();
		}
		if (!enabledSpikes && feastCount >= 20)
		{
			EnableSpikes();
		}
	}

	private void UpdateSkinVFX(bool force = false)
	{
		if (!Object.op_Implicit((Object)(object)childLocator) || !Object.op_Implicit((Object)(object)body))
		{
			return;
		}
		if (body.skinIndex == 7 || force)
		{
			((Component)childLocator.FindChild("darkStarLines")).gameObject.SetActive(true);
			((Component)childLocator.FindChild("darkStarIdleEffectTier1")).gameObject.SetActive(true);
			if (feastCount >= 100 && feastCount < 300)
			{
				((Component)childLocator.FindChild("darkStarIdleEffectTier2")).gameObject.SetActive(true);
				((Component)childLocator.FindChild("skinn07-1")).gameObject.SetActive(false);
				((Component)childLocator.FindChild("skinn07-2")).gameObject.SetActive(true);
			}
			else if (feastCount >= 300)
			{
				((Component)childLocator.FindChild("darkStarIdleEffectTier3")).gameObject.SetActive(true);
				((Component)childLocator.FindChild("skinn07-1")).gameObject.SetActive(false);
				((Component)childLocator.FindChild("skinn07-2")).gameObject.SetActive(false);
				((Component)childLocator.FindChild("skinn07-3")).gameObject.SetActive(true);
			}
		}
		else
		{
			((Component)childLocator.FindChild("darkStarLines")).gameObject.SetActive(false);
			((Component)childLocator.FindChild("darkStarIdleEffectTier1")).gameObject.SetActive(false);
		}
	}

	private void Body_onInventoryChanged()
	{
		if (!Object.op_Implicit((Object)(object)animator) || !Object.op_Implicit((Object)(object)body) || !Object.op_Implicit((Object)(object)body.inventory))
		{
			return;
		}
		feastCount = body.inventory.GetItemCount(Prefabs.feast);
		int buffCount = body.GetBuffCount(Prefabs.feastBuff);
		int num = feastCount - buffCount;
		if (num > 0)
		{
			for (int i = 0; i < num; i++)
			{
				body.AddBuff(Prefabs.feastBuff);
			}
		}
		if (!enabledSpikes && feastCount >= 20)
		{
			EnableSpikes();
		}
		UpdateSkinVFX();
	}

	private void EnableSpikes()
	{
		if (enabledSpikes && Object.op_Implicit((Object)(object)childLocator) && Object.op_Implicit((Object)(object)body))
		{
			enabledSpikes = true;
			if (body.skinIndex == 5)
			{
				((Component)childLocator.FindChild("spikeEffectBattleCastL")).gameObject.SetActive(true);
				((Component)childLocator.FindChild("spikeEffectBattleCastR")).gameObject.SetActive(true);
			}
			else if (body.skinIndex == 7)
			{
				((Component)childLocator.FindChild("spikeEffectDarkStarL")).gameObject.SetActive(true);
				((Component)childLocator.FindChild("spikeEffectDarkStarR")).gameObject.SetActive(true);
			}
			else
			{
				((Component)childLocator.FindChild("spikeEffectBaseL")).gameObject.SetActive(true);
				((Component)childLocator.FindChild("spikeEffectBaseR")).gameObject.SetActive(true);
			}
		}
	}

	private void FixedUpdate()
	{
		//IL_0080: Unknown result type (might be due to invalid IL or missing references)
		//IL_008c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0091: Unknown result type (might be due to invalid IL or missing references)
		//IL_0096: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
		if (!Object.op_Implicit((Object)(object)animator) || !Object.op_Implicit((Object)(object)body) || !Object.op_Implicit((Object)(object)cameraParams) || !Object.op_Implicit((Object)(object)interactor))
		{
			return;
		}
		float num = 1f + 0.01f * (float)feastCount;
		animator.SetFloat("moveSpeed", animator.GetFloat("walkSpeed") / num);
		cameraParams.data.idealLocalCameraPos = BlendableVector3.op_Implicit(Vector3.forward * (-12f * num));
		body.aimOriginTransform.localPosition = Vector3.up * (2.5f * (1f + 0.012f * (float)feastCount));
		interactor.maxInteractionDistance = 5f * (1f + 0.01f * (float)feastCount);
		if (!Object.op_Implicit((Object)(object)footstepHandler))
		{
			return;
		}
		if (feastCount >= 100 && feastCount < 300 && footstepHandler.baseFootstepString != "Play_beetle_queen_step")
		{
			footstepHandler.baseFootstepString = "Play_beetle_queen_step";
			footstepHandler.sprintFootstepOverrideString = "";
			footstepHandler.footstepDustPrefab = Prefabs.Load<GameObject>("RoR2/Base/Common/VFX/GenericHugeFootstepDust.prefab");
		}
		else if (feastCount >= 300 && footstepHandler.baseFootstepString != "Play_moonBrother_step")
		{
			footstepHandler.baseFootstepString = "Play_moonBrother_step";
			footstepHandler.sprintFootstepOverrideString = "Play_moonBrother_sprint";
			footstepHandler.footstepDustPrefab = Prefabs.Load<GameObject>("RoR2/Base/Brother/BrotherFootstepDust.prefab");
			if (Object.op_Implicit((Object)(object)sfxLocator))
			{
				sfxLocator.landingSound = "Play_gravekeeper_land";
			}
		}
	}

	private void UpdateModel()
	{
		UpdateIndex();
		string text = "Play_ChoGath_Scream_Cast";
		if (skinIndex == 5)
		{
			battlecastSkeleton.SetAsFirstSibling();
			animator.runtimeAnimatorController = Prefabs.battlecastAnimator;
			text = "Play_ChoGath_Battlecast_Scream_Cast";
		}
		else
		{
			baseSkeleton.SetAsFirstSibling();
			animator.runtimeAnimatorController = Prefabs.baseAnimator;
		}
		if (skinIndex == 7)
		{
			UpdateSkinVFX(force: true);
			text = "Play_ChoGath_DarkStar_Scream_Cast";
		}
		if (!Object.op_Implicit((Object)(object)Run.instance))
		{
			AkSoundEngine.PostEvent(text, ((Component)this).gameObject);
		}
	}

	private void UpdateIndex()
	{
		//IL_006b: Unknown result type (might be due to invalid IL or missing references)
		if (Object.op_Implicit((Object)(object)body))
		{
			skinIndex = (int)body.skinIndex;
		}
		else if (Object.op_Implicit((Object)(object)networkLoadout) && networkLoadout.loadout != null && networkLoadout.loadout.bodyLoadoutManager != null)
		{
			skinIndex = (int)networkLoadout.loadout.bodyLoadoutManager.GetSkinIndex(bodyIndex);
		}
	}

	private void NetworkLoadout_onLoadoutUpdated()
	{
		UpdateModel();
	}

	private void OnDisable()
	{
		if (Object.op_Implicit((Object)(object)body) && Object.op_Implicit((Object)(object)body.inventory))
		{
			body.onInventoryChanged -= Body_onInventoryChanged;
		}
		if (Object.op_Implicit((Object)(object)networkLoadout))
		{
			networkLoadout.onLoadoutUpdated -= NetworkLoadout_onLoadoutUpdated;
		}
	}
}
internal class ProjectileScale : MonoBehaviour
{
	private ProjectileController controller;

	private ProjectileSimple simple;

	public SkinEffectBehaviour effectBehaviour;

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

	private void Start()
	{
		//IL_005f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0072: Unknown result type (might be due to invalid IL or missing references)
		if (!Object.op_Implicit((Object)(object)controller.owner))
		{
			return;
		}
		CharacterBody component = controller.owner.GetComponent<CharacterBody>();
		if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component.inventory))
		{
			int itemCount = component.inventory.GetItemCount(Prefabs.feast);
			((Component)this).transform.localScale = Vector3.one * (1f + 0.01f * (float)itemCount);
			ProjectileSimple obj = simple;
			obj.desiredForwardSpeed *= 1f + 0.1f * (float)itemCount;
			int skinIndex = (int)component.skinIndex;
			if (Object.op_Implicit((Object)(object)effectBehaviour))
			{
				effectBehaviour.skinIndex = skinIndex;
			}
			string text = "Play_ChoGath_Voidspike_Launch";
			switch (skinIndex)
			{
			case 5:
				text = "Play_ChoGath_Battlecast_Voidspike_Launch";
				break;
			case 7:
				text = "Play_ChoGath_DarkStar_Voidspike_Launch";
				break;
			}
			AkSoundEngine.PostEvent(text, ((Component)this).gameObject);
		}
	}
}
internal class SkinEffectBehaviour : MonoBehaviour
{
	private ChildLocator childLocator;

	public int skinIndex = 0;

	private void Awake()
	{
		childLocator = ((Component)this).GetComponent<ChildLocator>();
	}

	private void Start()
	{
		string text = "base";
		if (skinIndex == 5)
		{
			text = "skin05";
		}
		else if (skinIndex == 7)
		{
			text = "skin07";
		}
		((Component)childLocator.FindChild(text)).gameObject.SetActive(true);
	}
}
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
		RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(RecalculateStatsAPI_GetStatCoefficients);
		GlobalEventManager.onCharacterDeathGlobal += GlobalEventManager_onCharacterDeathGlobal;
	}

	private static void GlobalEventManager_onCharacterDeathGlobal(DamageReport damageReport)
	{
		//IL_0055: 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_0069: Unknown result type (might be due to invalid IL or missing references)
		//IL_0073: Invalid comparison between Unknown and I4
		if (NetworkServer.active && Object.op_Implicit((Object)(object)damageReport.attacker) && Object.op_Implicit((Object)(object)damageReport.attackerBody) && Object.op_Implicit((Object)(object)damageReport.attacker.GetComponent<ChoTracker>()))
		{
			HealthComponent healthComponent = damageReport.attackerBody.healthComponent;
			healthComponent.Heal(healthComponent.fullCombinedHealth * 0.02f, default(ProcChainMask), true);
			if ((int)damageReport.damageInfo.damageType == 524288)
			{
				damageReport.attackerBody.inventory.GiveItem(Prefabs.feast, 1);
			}
		}
	}

	private static void RecalculateStatsAPI_GetStatCoefficients(CharacterBody sender, StatHookEventArgs args)
	{
		//IL_0083: Unknown result type (might be due to invalid IL or missing references)
		//IL_0096: Unknown result type (might be due to invalid IL or missing references)
		if (Object.op_Implicit((Object)(object)sender) && Object.op_Implicit((Object)(object)sender.inventory))
		{
			int itemCount = sender.inventory.GetItemCount(Prefabs.feast);
			if (itemCount > 0)
			{
				args.healthMultAdd += 0.01f * (float)itemCount;
				args.armorAdd += 0.2f * (float)itemCount;
				args.jumpPowerMultAdd += 0.001f * (float)itemCount;
				sender.modelLocator.modelTransform.localScale = Vector3.one * (1f + 0.01f * (float)itemCount);
			}
		}
	}
}
[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.ChoGath", "ChoGath", "1.0.0")]
[NetworkCompatibility(/*Could not decode attribute arguments.*/)]
public class MainPlugin : BaseUnityPlugin
{
	public const string MODUID = "com.Dragonyck.ChoGath";

	public const string MODNAME = "ChoGath";

	public const string VERSION = "1.0.0";

	public const string SURVIVORNAME = "Cho'Gath";

	public const string SURVIVORNAMEKEY = "CHOGATH";

	public static GameObject characterPrefab;

	private static readonly Color characterColor = Color32.op_Implicit(new Color32((byte)107, (byte)8, (byte)104, byte.MaxValue));

	private void Awake()
	{
		Assets.PopulateAssets();
		Achievements.RegisterUnlockables();
		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_00cd: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d3: Expected O, but got Unknown
		//IL_00fe: 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_012f: Unknown result type (might be due to invalid IL or missing references)
		//IL_013f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0145: Expected O, but got Unknown
		//IL_016c: 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_018e: 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_01be: Unknown result type (might be due to invalid IL or missing references)
		//IL_01cb: Unknown result type (might be due to invalid IL or missing references)
		//IL_0240: 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_03ab: Unknown result type (might be due to invalid IL or missing references)
		//IL_03b0: Unknown result type (might be due to invalid IL or missing references)
		//IL_0414: Unknown result type (might be due to invalid IL or missing references)
		//IL_0419: Unknown result type (might be due to invalid IL or missing references)
		//IL_0437: Unknown result type (might be due to invalid IL or missing references)
		//IL_0441: Unknown result type (might be due to invalid IL or missing references)
		//IL_0446: Unknown result type (might be due to invalid IL or missing references)
		//IL_044b: Unknown result type (might be due to invalid IL or missing references)
		//IL_046f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0474: Unknown result type (might be due to invalid IL or missing references)
		//IL_06d2: Unknown result type (might be due to invalid IL or missing references)
		//IL_06f3: Unknown result type (might be due to invalid IL or missing references)
		//IL_0710: Unknown result type (might be due to invalid IL or missing references)
		//IL_0731: Unknown result type (might be due to invalid IL or missing references)
		//IL_0752: Unknown result type (might be due to invalid IL or missing references)
		//IL_0773: Unknown result type (might be due to invalid IL or missing references)
		//IL_0794: Unknown result type (might be due to invalid IL or missing references)
		//IL_07b5: Unknown result type (might be due to invalid IL or missing references)
		//IL_07d2: Unknown result type (might be due to invalid IL or missing references)
		//IL_07f4: Unknown result type (might be due to invalid IL or missing references)
		//IL_0816: Unknown result type (might be due to invalid IL or missing references)
		//IL_0955: Unknown result type (might be due to invalid IL or missing references)
		//IL_09c0: Unknown result type (might be due to invalid IL or missing references)
		//IL_09d4: Unknown result type (might be due to invalid IL or missing references)
		//IL_09f9: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a0d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a5c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a61: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a84: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a89: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ab7: Unknown result type (might be due to invalid IL or missing references)
		//IL_0abc: Unknown result type (might be due to invalid IL or missing references)
		//IL_054e: Unknown result type (might be due to invalid IL or missing references)
		//IL_056e: Unknown result type (might be due to invalid IL or missing references)
		//IL_057b: Unknown result type (might be due to invalid IL or missing references)
		GameObject val = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Merc/MercBody.prefab").WaitForCompletion();
		characterPrefab = PrefabAPI.InstantiateClone(val, "Cho'GathBody", true);
		((Behaviour)characterPrefab.AddComponent<ChoTracker>()).enabled = false;
		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>("choMdl");
		val2.AddComponent<ModelBehaviour>();
		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, 2.5f, 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 = "Cho'GathBody";
		component2.baseNameToken = "CHOGATH_NAME";
		component2.subtitleNameToken = "CHOGATH_SUBTITLE";
		component2.bodyFlags = (BodyFlags)1040;
		component2.rootMotionInMainState = false;
		component2.mainRootSpeed = 0f;
		component2.baseMaxHealth = 150f;
		component2.levelMaxHealth = 36f;
		component2.baseRegen = 3f;
		component2.levelRegen = 0.75f;
		component2.baseMaxShield = 0f;
		component2.levelMaxShield = 0f;
		component2.baseMoveSpeed = 7f;
		component2.levelMoveSpeed = 0f;
		component2.baseAcceleration = 110f;
		component2.baseJumpPower = 15f;
		component2.levelJumpPower = 0f;
		component2.baseDamage = 13f;
		component2.levelDamage = 3f;
		component2.baseAttackSpeed = 1f;
		component2.levelAttackSpeed = 0f;
		component2.baseCrit = 1f;
		component2.levelCrit = 0f;
		component2.baseArmor = 20f;
		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;
		CharacterMotor component3 = characterPrefab.GetComponent<CharacterMotor>();
		component3.walkSpeedPenaltyCoefficient = 1f;
		component3.characterDirection = component;
		component3.muteWalkMotion = false;
		component3.mass = 160f;
		component3.airControl = 0.25f;
		component3.disableAirControlUntilCollision = false;
		component3.generateParametersOnAwake = true;
		InputBankTest component4 = characterPrefab.GetComponent<InputBankTest>();
		component4.moveVector = Vector3.zero;
		CharacterCameraParams val5 = Object.Instantiate<CharacterCameraParams>(val.GetComponent<CameraTargetParams>().cameraParams);
		val5.data.idealLocalCameraPos = BlendableVector3.op_Implicit(Vector3.forward * -12f);
		CameraTargetParams component5 = characterPrefab.GetComponent<CameraTargetParams>();
		component5.cameraParams = val5;
		component5.cameraPivotTransform = null;
		component5.recoil = Vector2.zero;
		component5.dontRaycastToPivot = false;
		ModelLocator component6 = characterPrefab.GetComponent<ModelLocator>();
		component6.modelTransform = transform;
		component6.modelBaseTransform = val3.transform;
		component6.dontReleaseModelOnDeath = false;
		component6.autoUpdateModelTransform = true;
		component6.dontDetatchFromParent = true;
		component6.noCorpse = false;
		component6.normalizeToFloor = false;
		component6.preserveModel = false;
		ChildLocator component7 = val2.GetComponent<ChildLocator>();
		CharacterModel val6 = val2.AddComponent<CharacterModel>();
		SkinnedMeshRenderer[] componentsInChildren = val2.GetComponentsInChildren<SkinnedMeshRenderer>();
		List<RendererInfo> list = new List<RendererInfo>();
		foreach (SkinnedMeshRenderer val7 in componentsInChildren)
		{
			string name = ((Object)val7).name;
			if (name != "skin23Light" && name != "skin32Glass")
			{
				((Renderer)val7).material = Utils.InstantiateMaterial(((Renderer)val7).material.mainTexture);
			}
			list.Add(new RendererInfo
			{
				renderer = (Renderer)(object)val7,
				defaultMaterial = ((Renderer)val7).material,
				defaultShadowCastingMode = (ShadowCastingMode)1,
				ignoreOverlays = false
			});
			if (name != "base")
			{
				((Component)val7).gameObject.SetActive(false);
			}
		}
		RendererInfo[] array = list.ToArray();
		val6.body = component2;
		val6.baseRendererInfos = array;
		val6.autoPopulateLightInfos = true;
		val6.invisibilityCount = 0;
		val6.temporaryOverlays = new List<TemporaryOverlay>();
		val6.mainSkinnedMeshRenderer = componentsInChildren[0];
		LanguageAPI.Add("CHOGATHBODY_DEFAULT_SKIN_NAME", "Default");
		LanguageAPI.Add("CHOGATHBODY_SKIN01_NAME", "Nightmare");
		LanguageAPI.Add("CHOGATHBODY_SKIN02_NAME", "Gentleman");
		LanguageAPI.Add("CHOGATHBODY_SKIN03_NAME", "Loch Ness");
		LanguageAPI.Add("CHOGATHBODY_SKIN04_NAME", "Jurassic");
		LanguageAPI.Add("CHOGATHBODY_SKIN05_NAME", "Battlecast");
		LanguageAPI.Add("CHOGATHBODY_SKIN06_NAME", "Prehistoric");
		LanguageAPI.Add("CHOGATHBODY_SKIN07_NAME", "Dark Star");
		LanguageAPI.Add("CHOGATHBODY_SKIN14_NAME", "Shan Hai Scrolls");
		LanguageAPI.Add("CHOGATHBODY_SKIN23_NAME", "Broken Covenant");
		LanguageAPI.Add("CHOGATHBODY_SKIN32_NAME", "Toy Terror");
		ModelSkinController val8 = val2.AddComponent<ModelSkinController>();
		val8.skins = (SkinDef[])(object)new SkinDef[11]
		{
			LoadoutAPI.CreateNewSkinDef(Utils.CreateNewSkinDefInfo(componentsInChildren, val2, "CHOGATHBODY_DEFAULT_SKIN_NAME", "base", array)),
			LoadoutAPI.CreateNewSkinDef(Utils.CreateNewSkinDefInfo(componentsInChildren, val2, "CHOGATHBODY_SKIN01_NAME", "skin01", array, Achievements.consumeUnlock)),
			LoadoutAPI.CreateNewSkinDef(Utils.CreateNewSkinDefInfo(componentsInChildren, val2, "CHOGATHBODY_SKIN02_NAME", "skin02", array)),
			LoadoutAPI.CreateNewSkinDef(Utils.CreateNewSkinDefInfo(componentsInChildren, val2, "CHOGATHBODY_SKIN03_NAME", "skin03", array, Achievements.consumeBossUnlock)),
			LoadoutAPI.CreateNewSkinDef(Utils.CreateNewSkinDefInfo(componentsInChildren, val2, "CHOGATHBODY_SKIN04_NAME", "skin04", array, Achievements.consumeGupUnlock)),
			LoadoutAPI.CreateNewSkinDef(Utils.CreateNewSkinDefInfo(componentsInChildren, val2, "CHOGATHBODY_SKIN05_NAME", "skin05", array, Achievements.masteryUnlock)),
			LoadoutAPI.CreateNewSkinDef(Utils.CreateNewSkinDefInfo(componentsInChildren, val2, "CHOGATHBODY_SKIN06_NAME", "skin06", array, Achievements.consumeElderUnlock)),
			LoadoutAPI.CreateNewSkinDef(Utils.CreateNewSkinDefInfo(componentsInChildren, val2, "CHOGATHBODY_SKIN07_NAME", "skin07", array, Achievements.typhoonUnlock)),
			LoadoutAPI.CreateNewSkinDef(Utils.CreateNewSkinDefInfo(componentsInChildren, val2, "CHOGATHBODY_SKIN14_NAME", "skin14", array)),
			LoadoutAPI.CreateNewSkinDef(Utils.CreateNewSkinDefInfo(componentsInChildren, val2, "CHOGATHBODY_SKIN23_NAME", "skin23", array, Achievements.sizeCapUnlock)),
			LoadoutAPI.CreateNewSkinDef(Utils.CreateNewSkinDefInfo(componentsInChildren, val2, "CHOGATHBODY_SKIN32_NAME", "skin32", array, Achievements.bearUnlock))
		};
		HealthComponent component8 = characterPrefab.GetComponent<HealthComponent>();
		component8.health = component2.baseMaxHealth;
		component8.shield = 0f;
		component8.barrier = 0f;
		characterPrefab.GetComponent<Interactor>().maxInteractionDistance = 3f;
		characterPrefab.GetComponent<InteractionDriver>().highlightInteractor = true;
		SfxLocator component9 = characterPrefab.GetComponent<SfxLocator>();
		component9.deathSound = "Play_ui_player_death";
		component9.barkSound = "";
		component9.openSound = "";
		component9.landingSound = "Play_char_land";
		component9.fallDamageSound = "Play_char_land_fall_damage";
		component9.aliveLoopStart = "";
		component9.aliveLoopStop = "";
		characterPrefab.GetComponent<Rigidbody>().mass = component3.mass;
		Collider[] componentsInChildren2 = val2.GetComponentsInChildren<Collider>();
		HurtBoxGroup val9 = val2.AddComponent<HurtBoxGroup>();
		List<HurtBox> list2 = new List<HurtBox>();
		Collider[] array2 = componentsInChildren2;
		foreach (Collider val10 in array2)
		{
			HurtBox val11 = ((Component)val10).gameObject.AddComponent<HurtBox>();
			((Component)val11).gameObject.layer = LayerIndex.entityPrecise.intVal;
			val11.healthComponent = component8;
			val11.isBullseye = true;
			val11.damageModifier = (DamageModifier)0;
			val11.hurtBoxGroup = val9;
			val11.indexInGroup = 0;
			val9.mainHurtBox = val11;
			val9.bullseyeCount = 1;
			list2.Add(val11);
		}
		val9.hurtBoxes = list2.ToArray();
		Utils.CreateHitbox("Attack", val2.transform, new Vector3(5.5f, 6.5f, 8.5f), new Vector3(0f, 1.5f, 3f));
		Utils.CreateHitbox("Feast", val2.transform, new Vector3(6.5f, 6.5f, 9f), new Vector3(0f, 1.5f, 3f));
		KinematicCharacterMotor component10 = characterPrefab.GetComponent<KinematicCharacterMotor>();
		component10.CharacterController = (BaseCharacterController)(object)component3;
		FootstepHandler val12 = val2.AddComponent<FootstepHandler>();
		val12.baseFootstepString = "Play_player_footstep";
		val12.sprintFootstepOverrideString = "";
		val12.enableFootstepDust = true;
		val12.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(GenericCharacterDeath));
		NetworkStateMachine component13 = ((Component)component2).GetComponent<NetworkStateMachine>();
		component13.stateMachines = ((Component)component2).GetComponents<EntityStateMachine>();
		ContentAddition.AddBody(characterPrefab);
	}

	private void RegisterCharacter()
	{
		//IL_0094: Unknown result type (might be due to invalid IL or missing references)
		//IL_0099: Unknown result type (might be due to invalid IL or missing references)
		string text = "Cho’Gath is a Melee tank with slow speed. While weak in the early game, this monster eats and grows to be incredibly powerful. <style=cSub>\r\n\r\n< ! > Every third attack heals Cho’Gath on top of healing on kills, making him good at sustaining in hordes.\r\n\r\n< ! > Use his M2 and Utility to control the enemies around you.\r\n\r\n< ! > Cho’Gath gains HP, Size and Armor with Feast, so eat as much as you can.\r\n\r\n< ! > Try eating multiple enemies at once to gain Feast stacks faster.\r\n\r\n";
		string text2 = "..and so he feasts...";
		string text3 = "..and so he vanished.";
		string text4 = "“Why are we back in the void man it gives me the creeps”\r\n\r\n“Its our mission to retrieve any artifacts and rescue soldiers taken by these damn… man I don’t even know what these damn things are…”\r\n\r\n“Well we could’ve at least brought something to eat… I’m starved.”\r\n\r\n<i>A distressing growl howls in the distance, the soldiers turn their head sharply and speak quieter</i>”\r\n\r\n“What was that…?”\r\n\r\n“Lets go check it out…”\r\n\r\n<i>They peer over to see a beast… considerably sized but trapped</i>”\r\n\r\n“Its another one of those-”\r\n\r\n“Jesus man what th-”\r\n\r\n“Would you relax! It’s the same as Acrid, its one of those damn living weapons.”\r\n\r\n“It’s looking at us…”\r\n\r\n“Not in a good way… though not exactly in a bad way either… lets help it out and bring it back.”\r\n\r\n“Are you insane?? We came for artifacts not for… whatever the hell dinosaur rip off this thing is”\r\n\r\n“Oh pucker up, maybe we’ll get promoted for finding another one of Acrid’s kind or whatever, now move it.";
		LanguageAPI.Add("CHOGATH_NAME", "Cho'Gath");
		LanguageAPI.Add("CHOGATH_DESCRIPTION", text);
		LanguageAPI.Add("CHOGATH_SUBTITLE", "The Terror Of The Void");
		LanguageAPI.Add("CHOGATH_OUTRO", text2);
		LanguageAPI.Add("CHOGATH_FAIL", text3);
		LanguageAPI.Add("CHOGATH_LORE", text4);
		SurvivorDef val = ScriptableObject.CreateInstance<SurvivorDef>();
		val.cachedName = "CHOGATH_NAME";
		val.unlockableDef = null;
		val.descriptionToken = "CHOGATH_DESCRIPTION";
		val.primaryColor = characterColor;
		val.bodyPrefab = characterPrefab;
		val.displayPrefab = Utils.NewDisplayModel(((Component)characterPrefab.GetComponent<ModelLocator>().modelBaseTransform).gameObject, "Cho'GathDisplay");
		val.outroFlavorToken = "CHOGATH_OUTRO";
		val.desiredSortPosition = 22f;
		val.mainEndingEscapeFailureFlavorToken = "CHOGATH_FAIL";
		ContentAddition.AddSurvivorDef(val);
		SkillSetup();
		GameObject val2 = PrefabAPI.InstantiateClone(Prefabs.Load<GameObject>("RoR2/Base/Merc/MercMonsterMaster.prefab"), "Cho'GathMaster", 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)
		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);
	}

	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("CHOGATH_PASSIVE_NAME", "Carnivore");
		LanguageAPI.Add("CHOGATH_PASSIVE_DESCRIPTION", "Whenever Cho'Gath <style=cIsDamage>kills</style> an enemy, it <style=cIsHealing>heals 2%</style> max hp.");
		component.passiveSkill.enabled = true;
		component.passiveSkill.skillNameToken = "CHOGATH_PASSIVE_NAME";
		component.passiveSkill.skillDescriptionToken = "CHOGATH_PASSIVE_DESCRIPTION";
		component.passiveSkill.icon = Assets.MainAssetBundle.LoadAsset<Sprite>("passive");
	}

	private void PrimarySetup()
	{
		//IL_003d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0042: Unknown result type (might be due to invalid IL or missing references)
		//IL_007b: Unknown result type (might be due to invalid IL or missing references)
		SkillLocator component = characterPrefab.GetComponent<SkillLocator>();
		LanguageAPI.Add("CHOGATH_M1", "Vorpal Spikes");
		LanguageAPI.Add("CHOGATH_M1_DESCRIPTION", "Cho'Gath attacks in the forward direction, dealing <style=cIsDamage>130% damage</style>, every third attack deals <style=cIsDamage>180% damage</style> and <style=cIsHealing>heals 1%</style> max hp. At 20 or more stacks of Feast, every attack will launch a blast of <style=cIsDamage>piercing</style> spikes that deal <style=cIsDamage>40%(+3% per stack of Feast) damage</style> and <style=cIsDamage>slows</style>.");
		SkillDef val = ScriptableObject.CreateInstance<SkillDef>();
		val.activationState = new SerializableEntityStateType(typeof(Primary));
		val.activationStateMachineName = "Body";
		val.baseMaxStock = 0;
		val.baseRechargeInterval = 0f;
		val.beginSkillCooldownOnSkillEnd = true;
		val.canceledFromSprinting = false;
		val.fullRestockOnAssign = true;
		val.interruptPriority = (InterruptPriority)0;
		val.isCombatSkill = true;
		val.mustKeyPress = false;
		val.cancelSprintingOnActivation = true;
		val.rechargeStock = 0;
		val.requiredStock = 0;
		val.stockToConsume = 0;
		val.icon = Assets.MainAssetBundle.LoadAsset<Sprite>("primary");
		val.skillDescriptionToken = "CHOGATH_M1_DESCRIPTION";
		val.skillName = "CHOGATH_M1";
		val.skillNameToken = val.skillName;
		ContentAddition.AddSkillDef(val);
		component.primary = Utils.NewGenericSkill(characterPrefab, val);
	}

	private void SecondarySetup()
	{
		//IL_003d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0042: Unknown result type (might be due to invalid IL or missing references)
		//IL_007b: Unknown result type (might be due to invalid IL or missing references)
		SkillLocator component = characterPrefab.GetComponent<SkillLocator>();
		LanguageAPI.Add("CHOGATH_M2", "Rupture");
		LanguageAPI.Add("CHOGATH_M2_DESCRIPTION", "Cho'Gath ruptures the ground, releasing shockwaves all around him that deal <style=cIsDamage>400%(+10% per stack of Feast) damage</style>.");
		GroundedSkillDef val = ScriptableObject.CreateInstance<GroundedSkillDef>();
		((SkillDef)val).activationState = new SerializableEntityStateType(typeof(Secondary));
		((SkillDef)val).activationStateMachineName = "Weapon";
		((SkillDef)val).baseMaxStock = 1;
		((SkillDef)val).baseRechargeInterval = 5f;
		((SkillDef)val).beginSkillCooldownOnSkillEnd = true;
		((SkillDef)val).canceledFromSprinting = false;
		((SkillDef)val).fullRestockOnAssign = false;
		((SkillDef)val).interruptPriority = (InterruptPriority)1;
		((SkillDef)val).isCombatSkill = true;
		((SkillDef)val).mustKeyPress = true;
		((SkillDef)val).cancelSprintingOnActivation = true;
		((SkillDef)val).rechargeStock = 1;
		((SkillDef)val).requiredStock = 1;
		((SkillDef)val).stockToConsume = 1;
		((SkillDef)val).icon = Assets.MainAssetBundle.LoadAsset<Sprite>("secondary");
		((SkillDef)val).skillDescriptionToken = "CHOGATH_M2_DESCRIPTION";
		((SkillDef)val).skillName = "CHOGATH_M2";
		((SkillDef)val).skillNameToken = ((SkillDef)val).skillName;
		ContentAddition.AddSkillDef((SkillDef)(object)val);
		component.secondary = Utils.NewGenericSkill(characterPrefab, (SkillDef)(object)val);
	}

	private void UtilitySetup()
	{
		//IL_003d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0042: Unknown result type (might be due to invalid IL or missing references)
		//IL_007b: Unknown result type (might be due to invalid IL or missing references)
		SkillLocator component = characterPrefab.GetComponent<SkillLocator>();
		LanguageAPI.Add("CHOGATH_UTIL", "Feral Scream");
		LanguageAPI.Add("CHOGATH_UTIL_DESCRIPTION", "Cho'Gath roars in a cone in the target direction, dealing <style=cIsDamage>200%(+15% per stack of Feast) damage</style> and <style=cIsUtility>pulling</style> enemies towards it.");
		SkillDef val = ScriptableObject.CreateInstance<SkillDef>();
		val.activationState = new SerializableEntityStateType(typeof(Utility));
		val.activationStateMachineName = "Body";
		val.baseMaxStock = 1;
		val.baseRechargeInterval = 5f;
		val.beginSkillCooldownOnSkillEnd = true;
		val.canceledFromSprinting = false;
		val.fullRestockOnAssign = false;
		val.interruptPriority = (InterruptPriority)1;
		val.isCombatSkill = true;
		val.mustKeyPress = true;
		val.cancelSprintingOnActivation = true;
		val.rechargeStock = 1;
		val.requiredStock = 1;
		val.stockToConsume = 1;
		val.icon = Assets.MainAssetBundle.LoadAsset<Sprite>("utility");
		val.skillDescriptionToken = "CHOGATH_UTIL_DESCRIPTION";
		val.skillName = "CHOGATH_UTIL";
		val.skillNameToken = val.skillName;
		ContentAddition.AddSkillDef(val);
		component.utility = Utils.NewGenericSkill(characterPrefab, val);
	}

	private void SpecialSetup()
	{
		//IL_004d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0052: Unknown result type (might be due to invalid IL or missing references)
		//IL_008b: Unknown result type (might be due to invalid IL or missing references)
		SkillLocator component = characterPrefab.GetComponent<SkillLocator>();
		LanguageAPI.Add("CHOGATH_SPEC", "Feast");
		LanguageAPI.Add("CHOGATH_SPEC_DESCRIPTION", "<style=cIsDamage>Slayer</style>. Cho'Gath attempts to eat the target enemy, dealing <style=cIsDamage>800%(+25% per stack of Feast) damage</style>. If the target is killed, Cho'Gath gain a stack of <style=cKeywordName>Feast</style><style=cSub>");
		LanguageAPI.Add("CHOGATH_SPEC_KEYWORD", "<style=cKeywordName>Feast</style><style=cSub>Increases <style=cIsHealth>health</style>, <style=cIsUtility>size</style> and <style=cIsDamage>armor</style> by <style=cIsDamage>1%</style>.");
		SkillDef val = ScriptableObject.CreateInstance<SkillDef>();
		val.activationState = new SerializableEntityStateType(typeof(Special));
		val.activationStateMachineName = "Body";
		val.baseMaxStock = 1;
		val.baseRechargeInterval = 12f;
		val.beginSkillCooldownOnSkillEnd = true;
		val.canceledFromSprinting = false;
		val.fullRestockOnAssign = false;
		val.interruptPriority = (InterruptPriority)1;
		val.isCombatSkill = true;
		val.mustKeyPress = true;
		val.cancelSprintingOnActivation = true;
		val.rechargeStock = 1;
		val.requiredStock = 1;
		val.stockToConsume = 1;
		val.icon = Assets.MainAssetBundle.LoadAsset<Sprite>("special");
		val.skillDescriptionToken = "CHOGATH_SPEC_DESCRIPTION";
		val.skillName = "CHOGATH_SPEC";
		val.skillNameToken = val.skillName;
		val.keywordTokens = new string[2] { "KEYWORD_SLAYER", "CHOGATH_SPEC_KEYWORD" };
		ContentAddition.AddSkillDef(val);
		component.special = Utils.NewGenericSkill(characterPrefab, val);
	}
}
internal class Prefabs
{
	internal static GameObject attackHitEffect;

	internal static GameObject attackHitEffectDarkStar;

	internal static GameObject attackHitEffectBattlecast;

	internal static GameObject bleedImpact;

	internal static GameObject spikeProjectileGhost;

	internal static GameObject spikeProjectile;

	internal static GameObject delayedProjectile;

	internal static GameObject areaIndicator;

	internal static GameObject explosionEffect;

	internal static GameObject ultHitEffectBase;

	internal static GameObject ultHitEffectBattlecast;

	internal static GameObject ultHitEffectDarkStar;

	internal static GameObject screamHitEffect;

	internal static GameObject pullEffect;

	internal static Material baseScreamOverlayMaterial;

	internal static Material battlecastScreamOverlayMaterial;

	internal static Material darkStarScreamOverlayMaterial;

	internal static RuntimeAnimatorController baseAnimator;

	internal static RuntimeAnimatorController battlecastAnimator;

	internal static ItemDef feast;

	internal static BuffDef feastBuff;

	internal static T Load<T>(string path)
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		return Addressables.LoadAssetAsync<T>((object)path).WaitForCompletion();
	}

	internal static void CreatePrefabs()
	{
		//IL_0024: Unknown result type (might be due to invalid IL or missing references)
		//IL_002a: Expected O, but got Unknown
		//IL_0043: Unknown result type (might be due to invalid IL or missing references)
		//IL_0049: Expected O, but got Unknown
		//IL_005d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0062: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
		//IL_0120: Unknown result type (might be due to invalid IL or missing references)
		//IL_0177: Unknown result type (might be due to invalid IL or missing references)
		//IL_0181: Expected O, but got Unknown
		//IL_01a0: Unknown result type (might be due to invalid IL or missing references)
		//IL_01aa: Expected O, but got Unknown
		//IL_01c9: Unknown result type (might be due to invalid IL or missing references)
		//IL_01d3: Expected O, but got Unknown
		//IL_02b0: Unknown result type (might be due to invalid IL or missing references)
		//IL_02ba: Unknown result type (might be due to invalid IL or missing references)
		//IL_0347: Unknown result type (might be due to invalid IL or missing references)
		//IL_0545: Unknown result type (might be due to invalid IL or missing references)
		//IL_054f: Unknown result type (might be due to invalid IL or missing references)
		//IL_05d0: Unknown result type (might be due to invalid IL or missing references)
		//IL_05d5: Unknown result type (might be due to invalid IL or missing references)
		//IL_067b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0685: Expected O, but got Unknown
		//IL_06c4: Unknown result type (might be due to invalid IL or missing references)
		baseAnimator = Assets.Load<RuntimeAnimatorController>("baseAnimator");
		battlecastAnimator = Assets.Load<RuntimeAnimatorController>("battlecastAnimator");
		GameObject val = new GameObject("dontDestroyOnLoad");
		val.SetActive(false);
		Object.DontDestroyOnLoad((Object)(object)val);
		Material val2 = new Material(Load<Material>("RoR2/Base/Common/VFX/matAreaIndicatorRim.mat"));
		val2.SetColor("_TintColor", Color32.op_Implicit(new Color32((byte)96, (byte)33, (byte)134, byte.MaxValue)));
		val2.SetTexture("_MainTex", (Texture)(object)Load<Texture2D>("RoR2/Base/Common/texCloudBone1.png"));
		areaIndicator = PrefabAPI.InstantiateClone(Load<GameObject>("RoR2/Base/Huntress/HuntressArrowRainIndicator.prefab"), "ChoAreaIndicator", false);
		((Renderer)areaIndicator.GetComponentInChildren<MeshRenderer>()).material = val2;
		feastBuff = Utils.NewBuffDef("Feast", stack: true, hidden: false, Assets.MainAssetBundle.LoadAsset<Sprite>("special"), Color.white);
		feast = ScriptableObject.CreateInstance<ItemDef>();
		((Object)feast).name = "ChoGathFeast";
		feast.nameToken = "CHOGATH_ITEM_NAME";
		feast.pickupToken = "CHOGATH_ITEM_DESCRIPTION";
		feast.loreToken = "CHOGATH_ITEM_DESCRIPTION";
		feast.deprecatedTier = (ItemTier)5;
		feast.tier = (ItemTier)5;
		ItemDef obj = feast;
		ItemTag[] array = new ItemTag[6];
		RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/);
		obj.tags = (ItemTag[])(object)array;
		feast.canRemove = false;
		feast.hidden = true;
		ContentAddition.AddItemDef(feast);
		baseScreamOverlayMaterial = new Material(Load<Material>("RoR2/Base/Common/VFX/matGhostEffect.mat"));
		baseScreamOverlayMaterial.SetTexture("_RemapTex", (Texture)(object)Load<Texture2D>("RoR2/Base/Common/ColorRamps/texRampTeslaCoil.png"));
		battlecastScreamOverlayMaterial = new Material(baseScreamOverlayMaterial);
		battlecastScreamOverlayMaterial.SetTexture("_RemapTex", (Texture)(object)Load<Texture2D>("RoR2/Base/Common/ColorRamps/texRampRoboBallSmoothed.png"));
		darkStarScreamOverlayMaterial = new Material(baseScreamOverlayMaterial);
		darkStarScreamOverlayMaterial.SetTexture("_RemapTex", (Texture)(object)Load<Texture2D>("RoR2/Base/Common/ColorRamps/texRampSporeGrenadeGas.png"));
		pullEffect = PrefabAPI.InstantiateClone(Assets.Load<GameObject>("RoarEffect"), "ChoScreamEffect", false);
		pullEffect.AddComponent<SkinEffectBehaviour>();
		Utils.RegisterEffect(pullEffect, 0.9f);
		screamHitEffect = PrefabAPI.InstantiateClone(Assets.Load<GameObject>("ScreamHitEffect"), "ChoScreamHitEffect", false);
		screamHitEffect.AddComponent<SkinEffectBehaviour>();
		Utils.RegisterEffect(screamHitEffect, 0.6f);
		bleedImpact = PrefabAPI.InstantiateClone(Load<GameObject>("RoR2/Base/Common/VFX/BleedEffect.prefab"), "ChoBleedHitEffect", false);
		Object.Destroy((Object)(object)bleedImpact.GetComponent<LoopSound>());
		ParticleSystem[] componentsInChildren = bleedImpact.GetComponentsInChildren<ParticleSystem>();
		foreach (ParticleSystem val3 in componentsInChildren)
		{
			((Component)val3).transform.localScale = Vector3.one * 2f;
		}
		Utils.RegisterEffect(bleedImpact, 1f, "Play_item_void_bleedOnHit_explo");
		ultHitEffectBase = PrefabAPI.InstantiateClone(Assets.Load<GameObject>("UltHitEffect"), "ChoUltHitEffect", false);
		ultHitEffectBase.AddComponent<SkinEffectBehaviour>().skinIndex = 0;
		GameObject val4 = PrefabAPI.InstantiateClone(Load<GameObject>("RoR2/Base/Common/VFX/BleedEffect.prefab"), "bleedeffect", false);
		val4.transform.parent = ultHitEffectBase.transform;
		val4.transform.localPosition = Vector3.zero;
		Object.Destroy((Object)(object)val4.GetComponent<LoopSound>());
		Object.Destroy((Object)(object)val4.GetComponent<EffectComponent>());
		Object.Destroy((Object)(object)val4.GetComponent<VFXAttributes>());
		Object.Destroy((Object)(object)val4.GetComponent<DestroyOnTimer>());
		Utils.RegisterEffect(ultHitEffectBase, 0.7f, "Play_ChoGath_Ult_Hit");
		ultHitEffectBattlecast = PrefabAPI.InstantiateClone(ultHitEffectBase, "ChoUltHitEffectBattlecast", false);
		ultHitEffectBattlecast.GetComponent<SkinEffectBehaviour>().skinIndex = 5;
		ultHitEffectBattlecast.GetComponent<EffectComponent>().soundName = "Play_ChoGath_Battlecast_Ult_Hit";
		ContentAddition.AddEffect(ultHitEffectBattlecast);
		ultHitEffectDarkStar = PrefabAPI.InstantiateClone(ultHitEffectBase, "ChoUltHitEffectDarkStar", false);
		ultHitEffectDarkStar.GetComponent<SkinEffectBehaviour>().skinIndex = 7;
		ultHitEffectDarkStar.GetComponent<EffectComponent>().soundName = "Play_ChoGath_DarkStar_Ult_Hit";
		ContentAddition.AddEffect(ultHitEffectDarkStar);
		attackHitEffect = PrefabAPI.InstantiateClone(Load<GameObject>("RoR2/DLC1/VoidSurvivor/VoidSurvivorCrushHealthMuzzleflash.prefab"), "ChoAttackHitEffect", false);
		attackHitEffect.GetComponent<EffectComponent>().soundName = "Play_ChoGath_Battlecast_Voidspike_Hit";
		ContentAddition.AddEffect(attackHitEffect);
		attackHitEffectBattlecast = PrefabAPI.InstantiateClone(Load<GameObject>("RoR2/Base/Common/VFX/OmniImpactVFX.prefab"), "ChoAttackHitEffectBattlecast", false);
		attackHitEffectBattlecast.GetComponent<EffectComponent>().soundName = "Play_ChoGath_Battlecast_Voidspike_Hit";
		ContentAddition.AddEffect(attackHitEffectBattlecast);
		attackHitEffectDarkStar = PrefabAPI.InstantiateClone(Load<GameObject>("RoR2/DLC1/VoidBarnacle/OmniExplosionVFXVoidBarnacle.prefab"), "ChoAttackHitEffectDarkStar", false);
		attackHitEffectDarkStar.GetComponent<EffectComponent>().soundName = "Play_ChoGath_DarkStar_Voidspike_Hit";
		ContentAddition.AddEffect(attackHitEffectDarkStar);
		spikeProjectileGhost = PrefabAPI.InstantiateClone(Assets.Load<GameObject>("spikeProjectile"), "ChoSpikeProjectileGhost", false);
		spikeProjectileGhost.AddComponent<SkinEffectBehaviour>();
		spikeProjectileGhost.AddComponent<ProjectileGhostController>();
		spikeProjectile = PrefabAPI.InstantiateClone(Load<GameObject>("RoR2/Base/Commando/FMJRamping.prefab"), "ChoSpikeProjectile", true);
		ProjectileScale projectileScale = spikeProjectile.AddComponent<ProjectileScale>();
		spikeProjectile.GetComponent<ProjectileSimple>().lifetime = 0.4f;
		spikeProjectile.transform.GetChild(0).localScale = Vector3.one * 3f;
		Object.Destroy((Object)(object)spikeProjectile.GetComponent<SphereCollider>());
		spikeProjectile.GetComponent<ProjectileController>().ghostPrefab = null;
		ProjectileOverlapAttack component = spikeProjectile.GetComponent<ProjectileOverlapAttack>();
		component.overlapProcCoefficient = 0.5f;
		component.damageCoefficient = 1f;
		((UnityEventBase)component.onServerHit).m_PersistentCalls = null;
		component.impactEffect = Load<GameObject>("RoR2/DLC1/VoidSurvivor/VoidSurvivorBeamImpact.prefab");
		GameObject val5 = Object.Instantiate<GameObject>(Assets.Load<GameObject>("spikeProjectile"), spikeProjectile.transform.position, Quaternion.identity, spikeProjectile.transform);
		projectileScale.effectBehaviour = val5.AddComponent<SkinEffectBehaviour>();
		ContentAddition.AddProjectile(spikeProjectile);
		explosionEffect = PrefabAPI.InstantiateClone(Load<GameObject>("RoR2/Base/Beetle/BeetleGuardGroundSlam.prefab"), "eff", false);
		explosionEffect.GetComponent<EffectComponent>().soundName = "Play_voidRaid_m1_explode";
		ContentAddition.AddEffect(explosionEffect);
		delayedProjectile = new GameObject("ChoDelayedProjectile", new Type[4]
		{
			typeof(NetworkIdentity),
			typeof(ProjectileController),
			typeof(ProjectileImpactExplosion),
			typeof(ProjectileDamage)
		});
		ProjectileImpactExplosion component2 = delayedProjectile.GetComponent<ProjectileImpactExplosion>();
		component2.lifetime = 0.5f;
		((ProjectileExplosion)component2).blastDamageCoefficient = 1f;
		((ProjectileExplosion)component2).blastRadius = 12f;
		((ProjectileExplosion)component2).explosionEffect = explosionEffect;
		((ProjectileExplosion)component2).falloffModel = (FalloffModel)0;
		((ProjectileExplosion)component2).canRejectForce = false;
		PrefabAPI.RegisterNetworkPrefab(delayedProjectile);
		delayedProjectile.transform.parent = val.transform;
	}
}
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 MeleeSkillState : BaseSkillState
{
	public float attackDuration;

	public float earlyExitDuration;

	private bool hopped;

	private bool hasSwung;

	public bool isInHitPause;

	public float hitPauseDuration;

	public float hopVelocity;

	public float hitPauseTimer;

	public float stopwatch;

	public HitStopCachedState hitStopCachedState;

	public OverlapAttack overlapAttack;

	public bool hasHit;

	private bool hasAnimParameter;

	private float attackSpeedScaling;

	public Animator animator;

	public virtual float baseAttackDuration => 0f;

	public virtual float baseEarlyExitDuration => 0f;

	public virtual float damageCoefficient => 0f;

	public virtual float forceMagnitude => 440f;

	public virtual float rootMotionSpeed => 25f;

	public virtual float baseHopVelocity => 4f;

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

	public virtual string animationStateName => "";

	public virtual string animParameter => "M1";

	public virtual string hitBoxGroupName => animationStateName;

	public virtual string hitBoxActiveParameter => "Curve";

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

	public virtual GameObject swingEffectPrefab => null;

	public virtual bool hopOnHit => true;

	public virtual bool rootMotion => false;

	public virtual bool rootMotionWhileHitting => false;

	public virtual uint swingSound => 0u;

	public virtual DamageType damageType => (DamageType)0;

	public virtual DamageColorIndex damageColor => (DamageColorIndex)0;

	public virtual Vector3 bonusForce => Vector3.zero;

	public virtual GameObject hitEffectPrefab => null;

	public override void OnEnter()
	{
		//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e2: Unknown result type (might be due to invalid IL or missing references)
		((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.damageType = damageType;
		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_0113: Unknown result type (might be due to invalid IL or missing references)
		//IL_0118: Unknown result type (might be due to invalid IL or missing references)
		//IL_011c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0128: Unknown result type (might be due to invalid IL or missing references)
		//IL_013b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0140: Unknown result type (might be due to invalid IL or missing references)
		//IL_0148: Unknown result type (might be due to invalid IL or missing references)
		//IL_0152: Unknown result type (might be due to invalid IL or missing references)
		//IL_0157: Unknown result type (might be due to invalid IL or missing references)
		//IL_015c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0182: Unknown result type (might be due to invalid IL or missing references)
		//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
		//IL_01f0: Unknown result type (might be due to invalid IL or missing references)
		//IL_01f5: Unknown result type (might be due to invalid IL or missing references)
		((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 && !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 : MeleeSkillState
{
	public int attackIndex = 1;

	private bool canFire = true;

	public override float baseAttackDuration => (attackIndex == 3) ? GroundLight.baseFinisherAttackDuration : GroundLight.baseComboAttackDuration;

	public override float baseEarlyExitDuration => GroundLight.baseEarlyExitDuration;

	public override string animationStateName => "Attack" + attackIndex;

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

	public override string animParameter => "M1";

	public override string hitBoxGroupName => "Attack";

	public override float forceMagnitude => 250f;

	public override string swingMuzzle => "swingMuzzle" + attackIndex;

	public override float damageCoefficient => (attackIndex == 3) ? 3.5f : 2.2f;

	public override uint swingSound
	{
		get
		{
			if (((EntityState)this).characterBody.skinIndex == 5)
			{
				return Sounds.Play_ChoGath_Battlecast_Attack_Cast;
			}
			if (((EntityState)this).characterBody.skinIndex == 7)
			{
				return Sounds.Play_ChoGath_DarkStar_Attack_Cast;
			}
			return Sounds.Play_ChoGath_Attack_Cast;
		}
	}

	public override float baseHopVelocity => 6f;

	public override bool rootMotion => true;

	public override GameObject hitEffectPrefab
	{
		get
		{
			if (((EntityState)this).characterBody.skinIndex == 5)
			{
				return Prefabs.attackHitEffectBattlecast;
			}
			if (((EntityState)this).characterBody.skinIndex == 7)
			{
				return Prefabs.attackHitEffectDarkStar;
			}
			return Prefabs.attackHitEffect;
		}
	}

	public override GameObject swingEffectPrefab => null;

	public override DamageType damageType => (DamageType)0;

	public override void OnSerialize(NetworkWriter writer)
	{
		((BaseSkillState)this).OnSerialize(writer);
		writer.Write(attackIndex);
	}

	public override void OnDeserialize(NetworkReader reader)
	{
		((BaseSkillState)this).OnDeserialize(reader);
		attackIndex = reader.ReadInt32();
	}

	public override void OnEnter()
	{
		base.OnEnter();
		if (((EntityState)this).isAuthority)
		{
			((EntityState)this).characterBody.isSprinting = false;
		}
		canFire = ((EntityState)this).characterBody.inventory.GetItemCount(Prefabs.feast) >= 20;
	}

	public override void SetState()
	{
		if (attackIndex != 3)
		{
			Primary primary = new Primary();
			primary.attackIndex = attackIndex + 1;
			((EntityState)this).outer.SetNextState((EntityState)(object)primary);
		}
	}

	public override void FixedUpdate()
	{
		//IL_0034: Unknown result type (might be due to invalid IL or missing references)
		//IL_0039: Unknown result type (might be due to invalid IL or missing references)
		//IL_004a: 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)
		//IL_005a: Unknown result type (might be due to invalid IL or missing references)
		base.FixedUpdate();
		if (((EntityState)this).isAuthority)
		{
			if (hasHit && canFire)
			{
				canFire = false;
				Ray aimRay = ((BaseState)this).GetAimRay();
				ProjectileManager.instance.FireProjectile(Prefabs.spikeProjectile, ((EntityState)this).characterBody.corePosition, Util.QuaternionSafeLookRotation(((EntityState)this).characterDirection.forward), ((EntityState)this).gameObject, ((BaseState)this).damageStat * 0.4f + 0.03f * (float)((EntityState)this).characterBody.inventory.GetItemCount(Prefabs.feast), 1500f, ((BaseState)this).RollCrit(), (DamageColorIndex)0, (GameObject)null, -1f);
			}
			((EntityState)this).characterBody.isSprinting = false;
		}
	}

	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 : BaseSkillState
{
	public Vector3 pos;

	private float duration;

	private float baseDuration = 0.85f;

	private bool hasFired;

	public override void OnSerialize(NetworkWriter writer)
	{
		//IL_000b: Unknown result type (might be due to invalid IL or missing references)
		((BaseSkillState)this).OnSerialize(writer);
		writer.Write(pos);
	}

	public override void OnDeserialize(NetworkReader reader)
	{
		//IL_000b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0010: Unknown result type (might be due to invalid IL or missing references)
		((BaseSkillState)this).OnDeserialize(reader);
		pos = reader.ReadVector3();
	}

	public override void OnEnter()
	{
		((BaseState)this).OnEnter();
		((BaseState)this).StartAimMode(duration, true);
		duration = baseDuration / Math.Min(((BaseState)this).attackSpeedStat, 2f);
		if (((BaseState)this).isGrounded)
		{
			((EntityState)this).PlayAnimation("FullBody, Override", "Stomp", "M2", duration);
		}
	}

	public override void FixedUpdate()
	{
		//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
		//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d5: Expected O, but got Unknown
		//IL_0111: Unknown result type (might be due to invalid IL or missing references)
		//IL_0116: Unknown result type (might be due to invalid IL or missing references)
		//IL_011d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0122: Unknown result type (might be due to invalid IL or missing references)
		//IL_0127: Unknown result type (might be due to invalid IL or missing references)
		//IL_0133: Unknown result type (might be due to invalid IL or missing references)
		//IL_0135: Unknown result type (might be due to invalid IL or missing references)
		//IL_013a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0142: Unknown result type (might be due to invalid IL or missing references)
		//IL_014d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0159: Unknown result type (might be due to invalid IL or missing references)
		//IL_015b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0160: Unknown result type (might be due to invalid IL or missing references)
		//IL_016b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0171: Unknown result type (might be due to invalid IL or missing references)
		//IL_0177: Unknown result type (might be due to invalid IL or missing references)
		//IL_017e: 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_01a2: 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_01c2: Unknown result type (might be due to invalid IL or missing references)
		//IL_01c7: Unknown result type (might be due to invalid IL or missing references)
		//IL_01cc: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ce: Unknown result type (might be due to invalid IL or missing references)
		//IL_01d3: 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_0217: 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_0242: Unknown result type (might be due to invalid IL or missing references)
		//IL_024e: Unknown result type (might be due to invalid IL or missing references)
		//IL_025b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0260: Unknown result type (might be due to invalid IL or missing references)
		//IL_0270: Unknown result type (might be due to invalid IL or missing references)
		//IL_0272: Unknown result type (might be due to invalid IL or missing references)
		//IL_0277: Unknown result type (might be due to invalid IL or missing references)
		//IL_0294: Unknown result type (might be due to invalid IL or missing references)
		//IL_0296: Unknown result type (might be due to invalid IL or missing references)
		//IL_029d: Unknown result type (might be due to invalid IL or missing references)
		((EntityState)this).FixedUpdate();
		if (!hasFired && ((EntityState)this).fixedAge >= duration * 0.5f)
		{
			hasFired = false;
			uint skinIndex = ((EntityState)this).characterBody.skinIndex;
			string text = "Play_ChoGath_Stomp_Cast";
			switch (skinIndex)
			{
			case 5u:
				text = "Play_ChoGath_Battlecast_Stomp_Cast";
				break;
			case 7u:
				text = "Play_ChoGath_DarkStar_Stomp_Cast";
				break;
			}
			AkSoundEngine.PostEvent(text, ((EntityState)this).gameObject);
			float num = 12f * (1f + 0.1f * (float)((EntityState)this).characterBody.inventory.GetItemCount(Prefabs.feast));
			EffectManager.SpawnEffect(Prefabs.Load<GameObject>("RoR2/Base/Beetle/BeetleGuardGroundSlam.prefab"), new EffectData
			{
				origin = ((EntityState)this).transform.position,
				scale = num
			}, false);
			if (((EntityState)this).isAuthority)
			{
				float num2 = ((BaseState)this).damageStat * 4f + 0.1f * (float)((EntityState)this).characterBody.inventory.GetItemCount(Prefabs.feast);
				new BlastAttack
				{
					position = ((EntityState)this).transform.position,
					attacker = ((EntityState)this).gameObject,
					attackerFiltering = (AttackerFiltering)2,
					baseDamage = num2,
					baseForce = 1500f,
					crit = ((BaseState)this).RollCrit(),
					falloffModel = (FalloffModel)0,
					procCoefficient = 1f,
					procChainMask = default(ProcChainMask),
					teamIndex = ((EntityState)this).teamComponent.teamIndex,
					radius = num
				};
				float num3 = 360f / (float)ExitSkyLeap.waveProjectileCount;
				Vector3 val = Vector3.ProjectOnPlane(((EntityState)this).inputBank.aimDirection, Vector3.up);
				for (int i = 0; i < ExitSkyLeap.waveProjectileCount; i++)
				{
					Vector3 val2 = Quaternion.AngleAxis(num3 * (float)i, Vector3.up) * val;
					FireProjectileInfo val3 = default(FireProjectileInfo);
					val3.crit = ((BaseState)this).RollCrit();
					val3.damage = ((EntityState)this).characterBody.damage * (num2 / (float)ExitSkyLeap.waveProjectileCount);
					val3.damageTypeOverride = (DamageType)32;
					val3.damageColorIndex = (DamageColorIndex)0;
					val3.force = ExitSkyLeap.waveProjectileForce;
					val3.owner = ((EntityState)this).gameObject;
					val3.position = ((EntityState)this).transform.position;
					val3.procChainMask = default(ProcChainMask);
					val3.projectilePrefab = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Brother/BrotherSunderWave.prefab").WaitForCompletion();
					val3.rotation = Util.QuaternionSafeLookRotation(val2);
					val3.useFuseOverride = false;
					val3.useSpeedOverride = false;
					val3.target = null;
					FireProjectileInfo val4 = val3;
					ProjectileManager.instance.FireProjectile(val4);
				}
				((EntityState)this).GetComponent<EntityStateMachine>().SetNextStateToMain();
				((EntityState)this).outer.SetNextStateToMain();
			}
		}
		if (((EntityState)this).isAuthority && !((BaseState)this).isGrounded)
		{
			((BaseState)this).SmallHop(((EntityState)this).characterMotor, 0f);
		}
	}

	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 Special : MeleeSkillState
{
	public override float baseAttackDuration => 0.85f;

	public override string animationStateName => "Ult";

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

	public override string animParameter => "Special";

	public override string hitBoxGroupName => "Feast";

	public override float forceMagnitude => 250f;

	public override float damageCoefficient => 8f + 0.25f * (float)((EntityState)this).characterBody.inventory.GetItemCount(Prefabs.feast);

	public override uint swingSound
	{
		get
		{
			if (((EntityState)this).characterBody.skinIndex == 5)
			{
				return 0u;
			}
			if (((EntityState)this).characterBody.skinIndex == 7)
			{
				return Sounds.Play_ChoGath_DarkStar_Ult_Cast;
			}
			return Sounds.Play_ChoGath_Ult_Cast;
		}
	}

	public override float baseHopVelocity => 0f;

	public override bool rootMotion => false;

	public override GameObject hitEffectPrefab
	{
		get
		{
			if (((EntityState)this).characterBody.skinIndex == 5)
			{
				return Prefabs.ultHitEffectBattlecast;
			}
			if (((EntityState)this).characterBody.skinIndex == 7)
			{
				return Prefabs.ultHitEffectDarkStar;
			}
			return Prefabs.ultHitEffectBase;
		}
	}

	public override GameObject swingEffectPrefab => null;

	public override DamageType damageType => (DamageType)524288;

	public override void OnEnter()
	{
		base.OnEnter();
	}

	public override void Update()
	{
		((EntityState)this).Update();
		if (((EntityState)this).isAuthority && !((BaseState)this).isGrounded)
		{
			((BaseState)this).SmallHop(((EntityState)this).characterMotor, 0f);
		}
	}

	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 Utility : BaseSkillState
{
	private float duration = 0.65f;

	private float damageCoefficient = 3.2f;

	public override void OnEnter()
	{
		//IL_0098: Unknown result type (might be due to invalid IL or missing references)
		//IL_009d: Unknown result type (might be due to invalid IL or missing references)
		//IL_009e: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00af: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
		//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ca: 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_00d4: 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_00e0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e5: 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)
		//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f3: Expected O, but got Unknown
		//IL_046e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0473: Unknown result type (might be due to invalid IL or missing references)
		//IL_047f: Unknown result type (might be due to invalid IL or missing references)
		//IL_048a: Unknown result type (might be due to invalid IL or missing references)
		//IL_048c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0491: Unknown result type (might be due to invalid IL or missing references)
		//IL_0495: Unknown result type (might be due to invalid IL or missing references)
		//IL_049a: Unknown result type (might be due to invalid IL or missing references)
		//IL_049f: Unknown result type (might be due to invalid IL or missing references)
		//IL_04a6: Expected O, but got Unknown
		//IL_04aa: Unknown result type (might be due to invalid IL or missing references)
		//IL_04b5: Unknown result type (might be due to invalid IL or missing references)
		//IL_04ba: Unknown result type (might be due to invalid IL or missing references)
		//IL_04bf: Unknown result type (might be due to invalid IL or missing references)
		//IL_04c3: Unknown result type (might be due to invalid IL or missing references)
		//IL_04c8: Unknown result type (might be due to invalid IL or missing references)
		//IL_04cd: Unknown result type (might be due to invalid IL or missing references)
		//IL_04e2: Unknown result type (might be due to invalid IL or missing references)
		//IL_04e7: Unknown result type (might be due to invalid IL or missing references)
		//IL_04ec: Unknown result type (might be due to invalid IL or missing references)
		//IL_04ee: Unknown result type (might be due to invalid IL or missing references)
		//IL_04f0: Unknown result type (might be due to invalid IL or missing references)
		//IL_0509: Unknown result type (might be due to invalid IL or missing references)
		//IL_0515: Unknown result type (might be due to invalid IL or missing references)
		//IL_051c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0521: Unknown result type (might be due to invalid IL or missing references)
		//IL_0525: Unknown result type (might be due to invalid IL or missing references)
		//IL_052a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0532: Unknown result type (might be due to invalid IL or missing references)
		//IL_0534: Unknown result type (might be due to invalid IL or missing references)
		//IL_0309: Unknown result type (might be due to invalid IL or missing references)
		//IL_030e: 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_01de: Expected O, but got Unknown
		//IL_0200: Unknown result type (might be due to invalid IL or missing references)
		//IL_020c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0211: Unknown result type (might be due to invalid IL or missing references)
		//IL_0216: Unknown result type (might be due to invalid IL or missing references)
		//IL_021a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0221: Unknown result type (might be due to invalid IL or missing references)
		//IL_0226: Unknown result type (might be due to invalid IL or missing references)
		//IL_0277: Unknown result type (might be due to invalid IL or missing references)
		//IL_027c: 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_029d: Unknown result type (might be due to invalid IL or missing references)
		//IL_02a6: Unknown result type (might be due to invalid IL or missing references)
		((BaseState)this).OnEnter();
		((BaseState)this).StartAimMode(duration, true);
		((EntityState)this).PlayAnimation("FullBody, Override", "Wave", "Utility", duration);
		int num = 0;
		Material originalMaterial = Prefabs.baseScreamOverlayMaterial;
		string text = "Play_ChoGath_Scream_Cast";
		if (((EntityState)this).characterBody.skinIndex == 5)
		{
			num = 5;
			originalMaterial = Prefabs.battlecastScreamOverlayMaterial;
			text = "Play_ChoGath_Battlecast_Scream_Cast";
		}
		else if (((EntityState)this).characterBody.skinIndex == 7)
		{
			num = 7;
			originalMaterial = Prefabs.darkStarScreamOverlayMaterial;
			text = "Play_ChoGath_DarkStar_Scream_Cast";
		}
		AkSoundEngine.PostEvent(text, ((EntityState)this).gameObject);
		Ray aimRay = ((BaseState)this).GetAimRay();
		BullseyeSearch val = new BullseyeSearch
		{
			maxAngleFilter = 78f,
			maxDistanceFilter = 45f,
			searchDirection = ((Ray)(ref aimRay)).direction,
			searchOrigin = ((Ray)(ref aimRay)).origin,
			teamMaskFilter = TeamMask.GetEnemyTeams(((EntityState)this).teamComponent.teamIndex),
			sortMode = (SortMode)3
		};
		val.RefreshCandidates();
		Vector3 val3;
		foreach (HurtBox result in val.GetResults())
		{
			if (!Object.op_Implicit((Object)(object)result.healthComponent) || !result.healthComponent.alive || !Object.op_Implicit((Object)(object)result.healthComponent.body))
			{
				continue;
			}
			if (NetworkServer.active)
			{
				float num2 = 0f;
				RigidbodyMotor component = ((Component)result.healthComponent).GetComponent<RigidbodyMotor>();
				if (Object.op_Implicit((Object)(object)result.healthComponent.body.characterMotor))
				{
					num2 = result.healthComponent.body.characterMotor.mass;
				}
				else if (Object.op_Implicit((Object)(object)component))
				{
					num2 = component.mass * 0.85f;
				}
				float num3 = 25f * num2;
				DamageInfo val2 = new DamageInfo();
				val2.attacker = ((EntityState)this).gameObject;
				val2.inflictor = ((EntityState)this).gameObject;
				val3 = ((EntityState)this).characterBody.corePosition - ((Component)result).transform.position;
				val2.force = ((Vector3)(ref val3)).normalized * num3;
				val2.damage = ((BaseState)this).damageStat * damageCoefficient + 0.15f * (float)((EntityState)this).characterBody.inventory.GetItemCount(Prefabs.feast);
				val2.crit = ((BaseState)this).RollCrit();
				val2.position = result.healthComponent.body.corePosition;
				val2.procChainMask = default(ProcChainMask);
				val2.procCoefficient = 1f;
				val2.damageColorIndex = (DamageColorIndex)0;
				val2.damageType = (DamageType)32;
				result.healthComponent.TakeDamage(val2);
				GlobalEventManager.instance.OnHitEnemy(val2, ((Component)result.healthComponent).gameObject);
				GlobalEventManager.instance.OnHitAll(val2, ((Component)result.healthComponent).gameObject);
			}
			Prefabs.screamHitEffect.GetComponent<SkinEffectBehaviour>().skinIndex = num;
			EffectManager.SimpleEffect(Prefabs.screamHitEffect, ((Component)result).transform.position, Quaternion.identity, false);
			if (Object.op_Implicit((Object)(object)result.healthComponent.body.modelLocator) && Object.op_Implicit((Object)(object)result.healthComponent.body.modelLocator.modelTransform))
			{
				TemporaryOverlay val4 = ((Component)result.healthComponent.body.modelLocator.modelTransform).gameObject.AddComponent<TemporaryOverlay>();
				val4.duration = 0.65f;
				val4.destroyComponentOnEnd = true;
				val4.originalMaterial = originalMaterial;
				val4.animateShaderAlpha = true;
				val4.alphaCurve = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f);
				val4.AddToCharacerModel(((Component)result.healthComponent.body.modelLocator.modelTransform).GetComponent<CharacterModel>());
			}
			text = "Play_ChoGath_Scream_Hit";
			switch (num)
			{
			case 5:
				text = "Play_ChoGath_Battlecast_Scream_Hit";
				break;
			case 7:
				text = "Play_ChoGath_DarkStar_Scream_Hit";
				break;
			}
			AkSoundEngine.PostEvent(text, ((Component)result).gameObject);
		}
		if (!((BaseState)this).isGrounded)
		{
			((BaseState)this).SmallHop(((EntityState)this).characterMotor, 15f);
		}
		Prefabs.pullEffect.GetComponent<SkinEffectBehaviour>().skinIndex = num;
		EffectData val5 = new EffectData
		{
			origin = ((BaseState)this).FindModelChild("screamMuzzle").position
		};
		Ray aimRay2 = ((BaseState)this).GetAimRay();
		val5.rotation = Util.QuaternionSafeLookRotation(((Ray)(ref aimRay2)).direction);
		EffectData val6 = val5;
		val3 = val6.origin - ((EntityState)this).characterBody.corePosition;
		val6.rotation = Util.QuaternionSafeLookRotation(((Vector3)(ref val3)).normalized);
		EffectManager.SpawnEffect(Prefabs.pullEffect, val6, false);
		Vector2 val7 = Util.Vector3XZToVector2XY(((Ray)(ref aimRay)).direction);
		if (val7 != Vector2.zero)
		{
			((Vector2)(ref val7)).Normalize();
			val3 = new Vector3(val7.x, 0f, val7.y);
			Vector3 normalized = ((Vector3)(ref val3)).normalized;
			((EntityState)this).characterDirection.moveVector = normalized;
		}
	}

	public override void FixedUpdate()
	{
		((EntityState)this).FixedUpdate();
		if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= duration)
		{
			((EntityState)this).outer.SetNextStateToMain();
		}
	}

	public override InterruptPriority GetMinimumInterruptPriority()
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0005: Unknown result type (might be due to invalid IL or missing references)
		return (InterruptPriority)2;
	}
}
internal class Sounds
{
	public static readonly uint Play_ChoGath_Scream_Cast = 390636328u;

	public static readonly uint Play_ChoGath_Ult_Hit = 597492748u;

	public static readonly uint Play_ChoGath_Stomp_Impact = 670555757u;

	public static readonly uint Play_ChoGath_Attack_Cast = 767045429u;

	public static readonly uint Play_ChoGath_Ult_Cast = 1553383012u;

	public static readonly uint Play_ChoGath_Voidspike_Hit = 1773745057u;

	public static readonly uint Play_ChoGath_Stomp_Cast = 1805504570u;

	public static readonly uint Play_ChoGath_Attack_Hit = 3552223223u;

	public static readonly uint Play_ChoGath_Scream_Hit = 3565772088u;

	public static readonly uint Play_ChoGath_Voidspike_Launch = 4015411511u;

	public static readonly uint Play_ChoGath_Battlecast_Attack_Cast = 1853155425u;

	public static readonly uint Play_ChoGath_Battlecast_Scream_Cast = 548498692u;

	public static readonly uint Play_ChoGath_Battlecast_Voidspike_Launch = 2597811995u;

	public static readonly uint Play_ChoGath_Battlecast_Stomp_Cast = 2620661478u;

	public static readonly uint Play_ChoGath_Battlecast_Ult_Hit = 2706567408u;

	public static readonly uint Play_ChoGath_Battlecast_Scream_Hit = 3034231596u;

	public static readonly uint Play_ChoGath_Battlecast_Voidspike_Hit = 3250877181u;

	public static readonly uint Play_ChoGath_Battlecast_Stomp_Impact = 4234866753u;

	public static readonly uint Play_ChoGath_DarkStar_Stomp_Impact = 815294048u;

	public static rea