Decompiled source of Skarner v1.0.0

Skarner.dll

Decompiled 2 days ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using EntityStates;
using EntityStates.Merc;
using HG.BlendableTypes;
using KinematicCharacterController;
using On.RoR2;
using R2API;
using R2API.Utils;
using Rewired.ComponentControls.Effects;
using RoR2;
using RoR2.Audio;
using RoR2.Navigation;
using RoR2.Networking;
using RoR2.Projectile;
using RoR2.Skills;
using RoR2.UI;
using ThreeEyedGames;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.Networking;
using UnityEngine.Rendering;

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

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("Skarner.AssetBundle." + "Skarner".ToLower() + "assets");
			MainAssetBundle = AssetBundle.LoadFromStream(stream);
		}
		using Stream stream2 = executingAssembly.GetManifestResourceStream("Skarner.Skarner.bnk");
		byte[] array = new byte[stream2.Length];
		stream2.Read(array, 0, array.Length);
		SoundBanks.Add(array);
	}
}
internal class BoulderProjectile : MonoBehaviour
{
	private ProjectileController controller;

	private ProjectileSimple simple;

	private Collider collider;

	private GameObject owner;

	private CharacterBody body;

	private Transform muzzle;

	private MeshRenderer mesh;

	private bool hasFired;

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

	private void Start()
	{
		//IL_0058: 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)
		//IL_0062: Unknown result type (might be due to invalid IL or missing references)
		//IL_0067: Unknown result type (might be due to invalid IL or missing references)
		//IL_0078: Unknown result type (might be due to invalid IL or missing references)
		if (!Object.op_Implicit((Object)(object)controller) || !Object.op_Implicit((Object)(object)controller.ghost))
		{
			return;
		}
		mesh = ((Component)controller.ghost).GetComponentInChildren<MeshRenderer>();
		RaycastHit val = default(RaycastHit);
		if (Object.op_Implicit((Object)(object)mesh) && Physics.Raycast(((Component)this).transform.position + Vector3.up, Vector3.down, ref val, 5f, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask)) && Object.op_Implicit((Object)(object)((RaycastHit)(ref val)).collider))
		{
			MeshRenderer component = ((Component)((RaycastHit)(ref val)).collider).GetComponent<MeshRenderer>();
			if (Object.op_Implicit((Object)(object)component))
			{
				((Renderer)mesh).material = ((Renderer)component).material;
			}
		}
	}

	private void FixedUpdate()
	{
		//IL_0108: Unknown result type (might be due to invalid IL or missing references)
		if (!Object.op_Implicit((Object)(object)owner))
		{
			owner = controller.owner;
			if (Object.op_Implicit((Object)(object)owner))
			{
				body = owner.GetComponent<CharacterBody>();
				if (Object.op_Implicit((Object)(object)body) && Object.op_Implicit((Object)(object)body.modelLocator) && Object.op_Implicit((Object)(object)body.modelLocator.modelTransform))
				{
					SBehaviour component = ((Component)body).GetComponent<SBehaviour>();
					if (Object.op_Implicit((Object)(object)component))
					{
						component.boulder = this;
					}
					ChildLocator component2 = ((Component)body.modelLocator.modelTransform).GetComponent<ChildLocator>();
					muzzle = component2.FindChild("BoulderMuzzle");
				}
			}
		}
		else if (Object.op_Implicit((Object)(object)muzzle) && !hasFired)
		{
			((Component)this).transform.position = ((Component)muzzle).transform.position;
		}
		if (!Object.op_Implicit((Object)(object)muzzle) && !hasFired)
		{
			Fire();
		}
	}

	public void Fire()
	{
		//IL_0022: Unknown result type (might be due to invalid IL or missing references)
		if (Object.op_Implicit((Object)(object)body))
		{
			((Component)this).transform.forward = body.inputBank.aimDirection;
		}
		if (Object.op_Implicit((Object)(object)simple))
		{
			((Behaviour)simple).enabled = true;
		}
		if (Object.op_Implicit((Object)(object)collider))
		{
			collider.enabled = true;
		}
		hasFired = true;
	}
}
internal class ModelBehaviour : MonoBehaviour
{
	public Animator animator;

	public CharacterBody body;

	public CharacterModel characterModel;

	public ChildLocator childLocator;

	public Transform baseSkeleton;

	public Transform skinSkeleton;

	public NetworkLoadout networkLoadout;

	public BodyIndex bodyIndex;

	public int skinIndex;

	private CharacterCameraParams cameraParams;

	private Interactor interactor;

	private float baseFwCamera;

	private float baseAimUpPos;

	private FootstepHandler footstepHandler;

	private SfxLocator sfxLocator;

	public float mult;

	public float multCapped;

	public float maxCap = 3f;

	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)
		//IL_016e: 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("SkarnerBody");
		}
		childLocator = ((Component)this).GetComponent<ChildLocator>();
		baseSkeleton = childLocator.FindChild("baseArmature");
		skinSkeleton = childLocator.FindChild("skin03Armature");
		footstepHandler = ((Component)this).GetComponent<FootstepHandler>();
		sfxLocator = ((Component)this).GetComponent<SfxLocator>();
		animator = ((Component)this).GetComponent<Animator>();
		characterModel = ((Component)this).GetComponent<CharacterModel>();
		body = characterModel.body;
		UpdateModel();
		if (Object.op_Implicit((Object)(object)body))
		{
			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;
				baseFwCamera = cameraParams.data.idealLocalCameraPos.value.z;
				baseAimUpPos = body.aimOriginTransform.localPosition.y;
			}
		}
	}

	private void FixedUpdate()
	{
		//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d0: 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_00f5: Unknown result type (might be due to invalid IL or missing references)
		//IL_0100: Unknown result type (might be due to invalid IL or missing references)
		//IL_010b: 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_0126: Unknown result type (might be due to invalid IL or missing references)
		//IL_0131: Unknown result type (might be due to invalid IL or missing references)
		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;
		}
		HealthComponent healthComponent = body.healthComponent;
		mult = Math.Min(6.5f, healthComponent.fullHealth / body.baseMaxHealth);
		multCapped = Util.Remap(mult, 1f, 6.5f, 1f, maxCap);
		animator.SetFloat("moveSpeed", animator.GetFloat("walkSpeed") / multCapped);
		cameraParams.data.idealLocalCameraPos = BlendableVector3.op_Implicit(Vector3.forward * baseFwCamera * multCapped);
		body.aimOriginTransform.localPosition = Vector3.up * baseAimUpPos * multCapped;
		((Component)this).transform.localScale = Vector3.one * 1.5f * multCapped;
		interactor.maxInteractionDistance = 4f * multCapped;
		if (!Object.op_Implicit((Object)(object)footstepHandler))
		{
			return;
		}
		if (mult >= 2.5f && mult < 5f && 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 (mult >= 6f && 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();
		if (skinIndex == 3)
		{
			skinSkeleton.SetAsFirstSibling();
			((Component)skinSkeleton).gameObject.SetActive(true);
			animator.runtimeAnimatorController = Prefabs.skinAnimator;
			((Component)baseSkeleton).gameObject.SetActive(false);
		}
		else if (skinIndex == 0)
		{
			baseSkeleton.SetAsFirstSibling();
			((Component)baseSkeleton).gameObject.SetActive(true);
			animator.runtimeAnimatorController = Prefabs.baseAnimator;
			((Component)skinSkeleton).gameObject.SetActive(false);
		}
	}

	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)networkLoadout))
		{
			networkLoadout.onLoadoutUpdated -= NetworkLoadout_onLoadoutUpdated;
		}
	}
}
[DefaultExecutionOrder(100)]
internal class ProjectileScale : MonoBehaviour
{
	private ProjectileController controller;

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

	private void Start()
	{
		//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_0071: Unknown result type (might be due to invalid IL or missing references)
		//IL_007c: Unknown result type (might be due to invalid IL or missing references)
		CharacterBody component = controller.owner.GetComponent<CharacterBody>();
		if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component.modelLocator.modelTransform))
		{
			ModelBehaviour component2 = ((Component)component.modelLocator.modelTransform).GetComponent<ModelBehaviour>();
			Transform transform = ((Component)this).transform;
			transform.localScale *= component2.multCapped;
			Transform transform2 = controller.ghost.transform;
			transform2.localScale *= component2.multCapped;
		}
	}
}
internal class QuakeBehaviour : MonoBehaviour
{
	private float dotStopwatch = 1f;

	private float deletionStopwatch;

	public GameObject owner;

	private CharacterBody ownerBody;

	public GameObject targetObject;

	private HealthComponent health;

	private void Start()
	{
		//IL_0058: 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)
		ownerBody = owner.GetComponent<CharacterBody>();
		health = targetObject.GetComponent<HealthComponent>();
		if (Object.op_Implicit((Object)(object)health) && Object.op_Implicit((Object)(object)health.body))
		{
			GameObject val = Object.Instantiate<GameObject>(Prefabs.quakeEffect, health.body.corePosition, Quaternion.identity);
			val.GetComponent<QuakeEffectBehaviour>().parent = targetObject;
			NetworkServer.Spawn(val);
			InstanceTracker.Add<QuakeBehaviour>(this);
		}
		else
		{
			Object.Destroy((Object)(object)((Component)this).gameObject);
		}
	}

	private void OnDisable()
	{
		if (InstanceTracker.GetInstancesList<QuakeBehaviour>().Contains(this))
		{
			InstanceTracker.Remove<QuakeBehaviour>(this);
		}
	}

	private void FixedUpdate()
	{
		//IL_0088: Unknown result type (might be due to invalid IL or missing references)
		//IL_008d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0099: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00bc: 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_00d8: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f0: Expected O, but got Unknown
		//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)
		if (!Object.op_Implicit((Object)(object)health) || !Object.op_Implicit((Object)(object)ownerBody))
		{
			return;
		}
		int buffCount = health.body.GetBuffCount(Prefabs.quake);
		if (buffCount >= 3)
		{
			dotStopwatch += Time.fixedDeltaTime;
			if (dotStopwatch >= 0.2f && NetworkServer.active)
			{
				dotStopwatch = 0f;
				DamageInfo val = new DamageInfo
				{
					attacker = owner,
					inflictor = ((Component)this).gameObject,
					damage = ownerBody.damage * 0.3f,
					crit = ownerBody.RollCrit(),
					procCoefficient = 0f,
					position = health.body.corePosition
				};
				health.TakeDamage(val);
				GlobalEventManager.instance.OnHitEnemy(val, ((Component)health).gameObject);
				GlobalEventManager.instance.OnHitAll(val, ((Component)health).gameObject);
				EffectManager.SimpleEffect(Prefabs.quakeHitEffect, val.position, Quaternion.identity, true);
			}
		}
		if (buffCount == 0)
		{
			deletionStopwatch += Time.fixedDeltaTime;
			if (deletionStopwatch >= 0.5f)
			{
				Object.Destroy((Object)(object)this);
			}
		}
	}
}
internal class QuakeEffectBehaviour : MonoBehaviour
{
	public GameObject parent;

	private CharacterBody body;

	private GameObject effect;

	private float stopwatch;

	private uint ID;

	private void Awake()
	{
		effect = ((Component)((Component)this).transform.GetChild(0)).gameObject;
		effect.SetActive(false);
	}

	private void Start()
	{
		if (Object.op_Implicit((Object)(object)parent))
		{
			body = parent.GetComponent<CharacterBody>();
			if (Object.op_Implicit((Object)(object)body))
			{
				((Component)this).transform.parent = body.coreTransform;
				ID = AkSoundEngine.PostEvent("Play_sfx_Skarner_SkarnerP_loop", ((Component)this).gameObject);
			}
			else
			{
				Object.Destroy((Object)(object)((Component)this).gameObject);
			}
		}
		else
		{
			Object.Destroy((Object)(object)((Component)this).gameObject);
		}
	}

	private void FixedUpdate()
	{
		if (Object.op_Implicit((Object)(object)body))
		{
			int buffCount = body.GetBuffCount(Prefabs.quake);
			effect.SetActive(buffCount >= 3);
			stopwatch += Time.fixedDeltaTime;
			if (stopwatch > 0.5f && buffCount == 0)
			{
				Object.Destroy((Object)(object)((Component)this).gameObject);
			}
		}
	}

	private void OnDisable()
	{
		AkSoundEngine.StopPlayingID(ID);
	}
}
internal class SBehaviour : MonoBehaviour
{
	public float force = 70f;

	public float impactDistance = 6f;

	public float upImpactDistance = 2f;

	public BoulderProjectile boulder;

	public float minSpawnTime = 0.1f;

	public float turnSmoothing = 7f;

	public float minMoveSpeed = 1f;

	public float maxMoveSpeed = 4f;

	public float minSpeed = 5f;

	public float maxSpeed = 25f;

	public float maxUtilitySearchRadius = 2f;

	public float maxUtilityFwSearchDistance = 1.5f;

	public float maxUtilitySearchDistance = 4f;

	public float maxUtilityUpSearchDistance = 1f;

	public float maxUtilitySearchAngle = 35f;

	public float maxSpecialSearchDistance = 30f;

	public float maxSpecialSearchAngle = 50f;

	public float downSpeedMult = 5f;

	public float fwEffectPos = 2.2f;

	public float fwForce = 11189f;
}
internal class ShieldEffectBehaviour : MonoBehaviour
{
	public CharacterBody body;

	private void OnEnable()
	{
		InstanceTracker.Add<ShieldEffectBehaviour>(this);
	}

	private void OnDisable()
	{
		InstanceTracker.Remove<ShieldEffectBehaviour>(this);
	}

	private void Start()
	{
		body = ((Component)this).GetComponentInParent<CharacterBody>();
	}

	private void FixedUpdate()
	{
		if (!Object.op_Implicit((Object)(object)body))
		{
			Object.Destroy((Object)(object)((Component)this).gameObject);
		}
		else if (body.healthComponent.barrier <= 0f)
		{
			Object.Destroy((Object)(object)((Component)this).gameObject);
		}
	}
}
internal class Hook
{
	internal static void Hooks()
	{
		//IL_0008: Unknown result type (might be due to invalid IL or missing references)
		//IL_0012: Expected O, but got Unknown
		//IL_001a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0024: Expected O, but got Unknown
		RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(RecalculateStatsAPI_GetStatCoefficients);
		HealthComponent.TakeDamage += new hook_TakeDamage(HealthComponent_TakeDamage);
		GlobalEventManager.onServerDamageDealt += GlobalEventManager_onServerDamageDealt;
	}

	private static void RecalculateStatsAPI_GetStatCoefficients(CharacterBody sender, StatHookEventArgs args)
	{
		HealthComponent healthComponent = sender.healthComponent;
		args.damageMultAdd += Math.Max(1f, healthComponent.fullHealth / sender.baseMaxHealth) - 1f;
	}

	private static void HealthComponent_TakeDamage(orig_TakeDamage orig, HealthComponent self, DamageInfo damageInfo)
	{
		if (Object.op_Implicit((Object)(object)self.body) && self.body.HasBuff(Prefabs.dmgBuff))
		{
			damageInfo.damage *= 1.2f;
		}
		orig.Invoke(self, damageInfo);
	}

	private static void GlobalEventManager_onServerDamageDealt(DamageReport damageReport)
	{
		//IL_0054: Unknown result type (might be due to invalid IL or missing references)
		if (Object.op_Implicit((Object)(object)damageReport.attacker) && Object.op_Implicit((Object)(object)damageReport.victim) && Object.op_Implicit((Object)(object)damageReport.victim.body) && DamageAPI.HasModdedDamageType(damageReport.damageInfo, Prefabs.quakeDMG))
		{
			int buffCount = damageReport.victim.body.GetBuffCount(Prefabs.quake);
			buffCount++;
			damageReport.victim.body.ClearTimedBuffs(Prefabs.quake);
			for (int i = 0; i < Math.Min(4, buffCount); i++)
			{
				damageReport.victim.body.AddTimedBuff(Prefabs.quake, 4f);
			}
			QuakeBehaviour quakeBehaviour = InstanceTracker.GetInstancesList<QuakeBehaviour>().Find((QuakeBehaviour x) => (Object)(object)x.targetObject == (Object)(object)((Component)damageReport.victim).gameObject);
			if (!Object.op_Implicit((Object)(object)quakeBehaviour))
			{
				quakeBehaviour = ((Component)damageReport.victim).gameObject.AddComponent<QuakeBehaviour>();
				quakeBehaviour.targetObject = ((Component)damageReport.victim).gameObject;
				quakeBehaviour.owner = damageReport.attacker;
			}
		}
	}
}
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInPlugin("com.Dragonyck.Skarner", "Skarner", "1.0.0")]
[NetworkCompatibility(/*Could not decode attribute arguments.*/)]
public class MainPlugin : BaseUnityPlugin
{
	public const string MODUID = "com.Dragonyck.Skarner";

	public const string MODNAME = "Skarner";

	public const string VERSION = "1.0.0";

	public const string SURVIVORNAME = "Skarner";

	public const string SURVIVORNAMEKEY = "SKARNER";

	public static GameObject characterPrefab;

	public static readonly Color characterColor = Color32.op_Implicit(new Color32((byte)231, (byte)227, (byte)156, byte.MaxValue));

	internal static ConfigEntry<bool> enableTroll;

	private void Awake()
	{
		enableTroll = ((BaseUnityPlugin)this).Config.Bind<bool>("Misc", "Enable Troll Mode", false, (ConfigDescription)null);
		Assets.PopulateAssets();
		Prefabs.CreatePrefabs();
		CreatePrefab();
		RegisterStates();
		RegisterCharacter();
		Hook.Hooks();
	}

	internal static void CreatePrefab()
	{
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		//IL_000b: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00cd: Expected O, but got Unknown
		//IL_00f8: Unknown result type (might be due to invalid IL or missing references)
		//IL_0109: Unknown result type (might be due to invalid IL or missing references)
		//IL_011a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0124: Unknown result type (might be due to invalid IL or missing references)
		//IL_0134: Unknown result type (might be due to invalid IL or missing references)
		//IL_013a: Expected O, but got Unknown
		//IL_0161: Unknown result type (might be due to invalid IL or missing references)
		//IL_0172: 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_01a6: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b3: Unknown result type (might be due to invalid IL or missing references)
		//IL_01c0: Unknown result type (might be due to invalid IL or missing references)
		//IL_0232: Unknown result type (might be due to invalid IL or missing references)
		//IL_0363: Unknown result type (might be due to invalid IL or missing references)
		//IL_039d: Unknown result type (might be due to invalid IL or missing references)
		//IL_03a2: Unknown result type (might be due to invalid IL or missing references)
		//IL_0438: Unknown result type (might be due to invalid IL or missing references)
		//IL_043d: Unknown result type (might be due to invalid IL or missing references)
		//IL_045b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0465: Unknown result type (might be due to invalid IL or missing references)
		//IL_046a: 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_0493: Unknown result type (might be due to invalid IL or missing references)
		//IL_0498: Unknown result type (might be due to invalid IL or missing references)
		//IL_0544: Unknown result type (might be due to invalid IL or missing references)
		//IL_0564: Unknown result type (might be due to invalid IL or missing references)
		//IL_0571: Unknown result type (might be due to invalid IL or missing references)
		//IL_067c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0699: Unknown result type (might be due to invalid IL or missing references)
		//IL_06b6: Unknown result type (might be due to invalid IL or missing references)
		//IL_06d3: Unknown result type (might be due to invalid IL or missing references)
		//IL_06f0: Unknown result type (might be due to invalid IL or missing references)
		//IL_070d: Unknown result type (might be due to invalid IL or missing references)
		//IL_077f: Unknown result type (might be due to invalid IL or missing references)
		//IL_07ea: Unknown result type (might be due to invalid IL or missing references)
		//IL_07fe: Unknown result type (might be due to invalid IL or missing references)
		//IL_08f0: Unknown result type (might be due to invalid IL or missing references)
		//IL_08f5: Unknown result type (might be due to invalid IL or missing references)
		//IL_0918: Unknown result type (might be due to invalid IL or missing references)
		//IL_091d: Unknown result type (might be due to invalid IL or missing references)
		//IL_094b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0950: 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, "SkarnerBody", true);
		characterPrefab.GetComponent<NetworkIdentity>().localPlayerAuthority = true;
		characterPrefab.AddComponent<SBehaviour>();
		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>("skarnerMdl");
		val2.AddComponent<AnimationEvents>().soundCenter = val2;
		val2.AddComponent<ModelBehaviour>();
		GameObject val3 = new GameObject("ModelBase");
		val3.transform.parent = characterPrefab.transform;
		val3.transform.localPosition = new Vector3(0f, -0.94f, 0f);
		val3.transform.localRotation = Quaternion.identity;
		val3.transform.localScale = Vector3.one * 1.5f;
		GameObject val4 = new GameObject("AimOrigin");
		val4.transform.parent = val3.transform;
		val4.transform.localPosition = new Vector3(0f, 2.4f, 0f);
		val4.transform.localRotation = Quaternion.identity;
		val4.transform.localScale = Vector3.one;
		Transform transform = val2.transform;
		transform.parent = val3.transform;
		transform.localPosition = Vector3.zero;
		transform.localScale = Vector3.one;
		transform.localRotation = Quaternion.identity;
		CharacterDirection component = characterPrefab.GetComponent<CharacterDirection>();
		component.targetTransform = val3.transform;
		component.modelAnimator = val2.GetComponentInChildren<Animator>();
		component.turnSpeed = 720f;
		CharacterBody component2 = characterPrefab.GetComponent<CharacterBody>();
		((Object)component2).name = "SkarnerBody";
		component2.baseNameToken = "SKARNER_NAME";
		component2.subtitleNameToken = "SKARNER_SUBTITLE";
		component2.bodyFlags = (BodyFlags)16;
		component2.rootMotionInMainState = false;
		component2.mainRootSpeed = 0f;
		component2.baseMaxHealth = 220f;
		component2.levelMaxHealth = 37f;
		component2.baseRegen = 2.5f;
		component2.levelRegen = 0.2f;
		component2.baseMaxShield = 0f;
		component2.levelMaxShield = 0f;
		component2.baseMoveSpeed = 7f;
		component2.levelMoveSpeed = 0f;
		component2.baseAcceleration = 110f;
		component2.baseJumpPower = 20f;
		component2.levelJumpPower = 0f;
		component2.baseDamage = 12f;
		component2.levelDamage = 2.4f;
		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;
		HealthComponent component3 = characterPrefab.GetComponent<HealthComponent>();
		component3.health = component2.baseMaxHealth;
		component3.shield = 0f;
		component3.barrier = 0f;
		CharacterMotor component4 = characterPrefab.GetComponent<CharacterMotor>();
		component4.walkSpeedPenaltyCoefficient = 1f;
		component4.characterDirection = component;
		component4.muteWalkMotion = false;
		component4.mass = 160f;
		component4.airControl = 0.25f;
		component4.disableAirControlUntilCollision = false;
		component4.generateParametersOnAwake = true;
		InputBankTest component5 = characterPrefab.GetComponent<InputBankTest>();
		component5.moveVector = Vector3.zero;
		CharacterCameraParams val5 = Object.Instantiate<CharacterCameraParams>(val.GetComponent<CameraTargetParams>().cameraParams);
		val5.data.idealLocalCameraPos = BlendableVector3.op_Implicit(Vector3.forward * -12f);
		CameraTargetParams component6 = characterPrefab.GetComponent<CameraTargetParams>();
		component6.cameraParams = val5;
		component6.cameraPivotTransform = null;
		component6.recoil = Vector2.zero;
		component6.dontRaycastToPivot = false;
		ModelLocator component7 = characterPrefab.GetComponent<ModelLocator>();
		component7.modelTransform = transform;
		component7.modelBaseTransform = val3.transform;
		component7.dontReleaseModelOnDeath = false;
		component7.autoUpdateModelTransform = true;
		component7.dontDetatchFromParent = false;
		component7.noCorpse = false;
		component7.normalizeToFloor = false;
		component7.preserveModel = false;
		ChildLocator component8 = val2.GetComponent<ChildLocator>();
		CharacterModel val6 = val2.AddComponent<CharacterModel>();
		SkinnedMeshRenderer[] componentsInChildren = val2.GetComponentsInChildren<SkinnedMeshRenderer>();
		List<RendererInfo> list = new List<RendererInfo>();
		foreach (SkinnedMeshRenderer val7 in componentsInChildren)
		{
			((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 (((Object)val7).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<TemporaryOverlayInstance>();
		val6.mainSkinnedMeshRenderer = componentsInChildren[0];
		LanguageAPI.Add("SKARNERBODY_DEFAULT_SKIN_NAME", "Default");
		LanguageAPI.Add("SKARNERBODY_SKIN01_NAME", "Sandscourge");
		LanguageAPI.Add("SKARNERBODY_SKIN02_NAME", "Earthrune");
		LanguageAPI.Add("SKARNERBODY_SKIN03_NAME", "Battlecast");
		LanguageAPI.Add("SKARNERBODY_SKIN04_NAME", "Guardian of the Sands");
		LanguageAPI.Add("SKARNERBODY_SKIN05_NAME", "Cosmic Sting");
		ModelSkinController val8 = val2.AddComponent<ModelSkinController>();
		val8.skins = (SkinDef[])(object)new SkinDef[6]
		{
			Skins.CreateNewSkinDef(Utils.CreateNewSkinDefInfo(componentsInChildren, val2, "SKARNERBODY_DEFAULT_SKIN_NAME", "base", array)),
			Skins.CreateNewSkinDef(Utils.CreateNewSkinDefInfo(componentsInChildren, val2, "SKARNERBODY_SKIN01_NAME", "skin01", array)),
			Skins.CreateNewSkinDef(Utils.CreateNewSkinDefInfo(componentsInChildren, val2, "SKARNERBODY_SKIN02_NAME", "skin02", array)),
			Skins.CreateNewSkinDef(Utils.CreateNewSkinDefInfo(componentsInChildren, val2, "SKARNERBODY_SKIN03_NAME", "skin03", array)),
			Skins.CreateNewSkinDef(Utils.CreateNewSkinDefInfo(componentsInChildren, val2, "SKARNERBODY_SKIN04_NAME", "skin04", array)),
			Skins.CreateNewSkinDef(Utils.CreateNewSkinDefInfo(componentsInChildren, val2, "SKARNERBODY_SKIN05_NAME", "skin05", array))
		};
		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 = component3;
			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("Slash", val2.transform, new Vector3(5f, 6f, 8.5f), new Vector3(0f, 1.4f, 2.5f));
		KinematicCharacterMotor component9 = characterPrefab.GetComponent<KinematicCharacterMotor>();
		component9.CharacterController = (ICharacterController)(object)component4;
		component9.playerCharacter = true;
		characterPrefab.GetComponent<Interactor>().maxInteractionDistance = 3f;
		characterPrefab.GetComponent<InteractionDriver>().highlightInteractor = true;
		SfxLocator component10 = characterPrefab.GetComponent<SfxLocator>();
		component10.deathSound = "Play_ui_player_death";
		component10.barkSound = "";
		component10.openSound = "";
		component10.landingSound = "Play_char_land";
		component10.fallDamageSound = "Play_char_land_fall_damage";
		component10.aliveLoopStart = "";
		component10.aliveLoopStop = "";
		characterPrefab.GetComponent<Rigidbody>().mass = component4.mass;
		FootstepHandler 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));
		Utils.NewStateMachine<Idle>(characterPrefab, "Ult");
		NetworkStateMachine component13 = ((Component)component2).GetComponent<NetworkStateMachine>();
		component13.stateMachines = ((Component)component2).GetComponents<EntityStateMachine>();
		ContentAddition.AddBody(characterPrefab);
	}

	private void RegisterCharacter()
	{
		//IL_0088: Unknown result type (might be due to invalid IL or missing references)
		//IL_008d: Unknown result type (might be due to invalid IL or missing references)
		string text = " <style=cSub>\r\n\r\n< ! > \r\n\r\n< ! > \r\n\r\n< ! > \r\n\r\n< ! > \r\n\r\n";
		string text2 = "..and so he left.";
		string text3 = "..and so he vanished.";
		string text4 = "";
		LanguageAPI.Add("SKARNER_NAME", "Skarner");
		LanguageAPI.Add("SKARNER_DESCRIPTION", text);
		LanguageAPI.Add("SKARNER_SUBTITLE", "Primordial Sovereign");
		LanguageAPI.Add("SKARNER_OUTRO", text2);
		LanguageAPI.Add("SKARNER_FAIL", text3);
		SurvivorDef val = ScriptableObject.CreateInstance<SurvivorDef>();
		val.cachedName = "SKARNER_NAME";
		val.unlockableDef = null;
		val.descriptionToken = "SKARNER_DESCRIPTION";
		val.primaryColor = characterColor;
		val.bodyPrefab = characterPrefab;
		val.displayPrefab = Utils.NewDisplayModel(((Component)characterPrefab.GetComponent<ModelLocator>().modelBaseTransform).gameObject, "SkarnerDisplay");
		val.outroFlavorToken = "SKARNER_OUTRO";
		val.desiredSortPosition = 22f;
		val.mainEndingEscapeFailureFlavorToken = "SKARNER_FAIL";
		ContentAddition.AddSurvivorDef(val);
		SkillSetup();
		GameObject val2 = PrefabAPI.InstantiateClone(Prefabs.Load<GameObject>("RoR2/Base/Commando/CommandoMonsterMaster.prefab"), "SkarnerMaster", true);
		ContentAddition.AddMaster(val2);
		CharacterMaster component = val2.GetComponent<CharacterMaster>();
		component.bodyPrefab = characterPrefab;
	}

	private void RegisterStates()
	{
		//IL_0003: Unknown result type (might be due to invalid IL or missing references)
		//IL_000b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0013: Unknown result type (might be due to invalid IL or missing references)
		//IL_001b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0023: Unknown result type (might be due to invalid IL or missing references)
		//IL_002b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0033: Unknown result type (might be due to invalid IL or missing references)
		//IL_003b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0043: Unknown result type (might be due to invalid IL or missing references)
		//IL_004b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0053: Unknown result type (might be due to invalid IL or missing references)
		bool flag = default(bool);
		ContentAddition.AddEntityState<Primary>(ref flag);
		ContentAddition.AddEntityState<RockThrow>(ref flag);
		ContentAddition.AddEntityState<Secondary>(ref flag);
		ContentAddition.AddEntityState<Utility>(ref flag);
		ContentAddition.AddEntityState<UtilityEnd>(ref flag);
		ContentAddition.AddEntityState<Special>(ref flag);
		ContentAddition.AddEntityState<SpecialGrab>(ref flag);
		ContentAddition.AddEntityState<SpecialThrow>(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("SKARNER_PASSIVE_NAME", "Threads of Vibration");
		LanguageAPI.Add("SKARNER_PASSIVE_DESCRIPTION", "Skarner's abilities apply a stack of Quaking to enemies hit for <style=cIsUtility>4s</style>, refreshing on subsequent applications and stacking up to <style=cIsDamage>3</style> times. Enemies afflicted with <style=cIsDamage>3</style> stacks take <style=cIsDamage>150% damage</style> per second. <style=cIsDamage>Damage</style> and <style=cIsUtility>size</style> scales with <style=cIsHealth>bonus health</style>.");
		component.passiveSkill.enabled = true;
		component.passiveSkill.skillNameToken = "SKARNER_PASSIVE_NAME";
		component.passiveSkill.skillDescriptionToken = "SKARNER_PASSIVE_DESCRIPTION";
		component.passiveSkill.icon = Assets.MainAssetBundle.LoadAsset<Sprite>("passive");
	}

	private void PrimarySetup()
	{
		SkillLocator component = characterPrefab.GetComponent<SkillLocator>();
		LanguageAPI.Add("SKARNER_M1", "Shattered Earth");
		LanguageAPI.Add("SKARNER_M1_DESCRIPTION", "Skarner clenches enemies with his claws, dealing <style=cIsDamage>285% damage</style> and finishing with the third hit for <style=cIsDamage>350% damage</style>. While <style=cIsUtility>grounded</style>, every third hit, Skarner rips a boulder out of the ground and throws it for <style=cIsDamage>360% damage</style> instead.");
		SkillDef skill = Utils.NewSkillDef<SkillDef>(typeof(Primary), "Weapon", 0, 0f, beginSkillCooldownOnSkillEnd: true, canceledFromSprinting: false, fullRestockOnAssign: true, (InterruptPriority)0, isCombatSkill: true, mustKeyPress: false, cancelSprintingOnActivation: true, 0, 0, 0, Assets.MainAssetBundle.LoadAsset<Sprite>("primary"), "SKARNER_M1_DESCRIPTION", "SKARNER_M1", Array.Empty<string>());
		component.primary = Utils.NewGenericSkill(characterPrefab, skill);
	}

	private void SecondarySetup()
	{
		SkillLocator component = characterPrefab.GetComponent<SkillLocator>();
		LanguageAPI.Add("SKARNER_M2", "Seismic Bastion");
		LanguageAPI.Add("SKARNER_M2_DESCRIPTION", "Skarner slams his claws into the ground, granting <style=cIsHealing>20% max health as barrier</style>, and releasing a shockwave for <style=cIsDamage>420% damage</style> and <style=cIsDamage>slows</style>.");
		SkillDef skill = Utils.NewSkillDef<SkillDef>(typeof(Secondary), "Weapon", 1, 4f, beginSkillCooldownOnSkillEnd: true, canceledFromSprinting: false, fullRestockOnAssign: false, (InterruptPriority)1, isCombatSkill: true, mustKeyPress: true, cancelSprintingOnActivation: false, 1, 1, 1, Assets.MainAssetBundle.LoadAsset<Sprite>("secondary"), "SKARNER_M2_DESCRIPTION", "SKARNER_M2", Array.Empty<string>());
		component.secondary = Utils.NewGenericSkill(characterPrefab, skill);
	}

	private void UtilitySetup()
	{
		SkillLocator component = characterPrefab.GetComponent<SkillLocator>();
		LanguageAPI.Add("SKARNER_UTIL", "Ixtal's Impact");
		LanguageAPI.Add("SKARNER_UTIL_DESCRIPTION", "Skarner charges forward, carrying nearby enemies with him for up to <style=cIsUtility>4s</style>. At the end of its duration, recasting the ability or by slamming a wall, Skarner slams the ground dealing <style=cIsDamage>240% damage</style> for each enemy grabbed and <style=cIsDamage>stuns</style>.");
		SkillDef skill = Utils.NewSkillDef<SkillDef>(typeof(Utility), "Body", 1, 8f, beginSkillCooldownOnSkillEnd: true, canceledFromSprinting: false, fullRestockOnAssign: false, (InterruptPriority)0, isCombatSkill: true, mustKeyPress: true, cancelSprintingOnActivation: false, 1, 1, 1, Assets.MainAssetBundle.LoadAsset<Sprite>("utility"), "SKARNER_UTIL_DESCRIPTION", "SKARNER_UTIL", Array.Empty<string>());
		component.utility = Utils.NewGenericSkill(characterPrefab, skill);
	}

	private void SpecialSetup()
	{
		SkillLocator component = characterPrefab.GetComponent<SkillLocator>();
		LanguageAPI.Add("SKARNER_SPEC", "Impale");
		LanguageAPI.Add("SKARNER_SPEC_DESCRIPTION", "Skarner winds up his stingers over the cast time, then lashes them forward, dealing <style=cIsDamage>450% damage</style> impaling up to <style=cIsDamage>3</style> enemies. Skarner gains <style=cIsUtility>40% movement speed</style> if at least one enemy is impaled. While impaled, they take an additional <style=cIsDamage>20% damage</style> from all sources and are attached to Skarner for up to <style=cIsUtility>3s</style>. At the end of its duration or by recasting the ability again, the enemies are thrown away. <style=cIsDamage>Bosses</style> take <style=cIsDamage>double</style> the damage instead.");
		SkillDef skill = Utils.NewSkillDef<SkillDef>(typeof(Special), "Ult", 1, 14f, beginSkillCooldownOnSkillEnd: true, canceledFromSprinting: false, fullRestockOnAssign: false, (InterruptPriority)1, isCombatSkill: true, mustKeyPress: true, cancelSprintingOnActivation: false, 1, 1, 1, Assets.MainAssetBundle.LoadAsset<Sprite>("special"), "SKARNER_SPEC_DESCRIPTION", "SKARNER_SPEC", Array.Empty<string>());
		component.special = Utils.NewGenericSkill(characterPrefab, skill);
	}
}
internal class Prefabs
{
	internal static GameObject boulderProjectileGhost;

	internal static GameObject boulderProjectile;

	internal static GameObject clawHitEffect;

	internal static GameObject quakeHitEffect;

	internal static GameObject quakeEffect;

	internal static GameObject dashEffect;

	internal static GameObject boulderMuzzleEffect;

	internal static GameObject jumpImpactDecalEffect;

	internal static GameObject boulderPickupDecalEffect;

	internal static GameObject impactDecalEffect;

	internal static GameObject shieldEffect;

	internal static GameObject slashFXR;

	internal static GameObject slashFXL;

	internal static GameObject impaleEffect;

	internal static GameObject slamEffect;

	internal static Material impaledInner;

	internal static Material impaledOuter;

	internal static BuffDef quake;

	internal static BuffDef dmgBuff;

	internal static RuntimeAnimatorController baseAnimator;

	internal static RuntimeAnimatorController skinAnimator;

	internal static ModdedDamageType quakeDMG;

	internal static void CreatePrefabs()
	{
		//IL_0030: Unknown result type (might be due to invalid IL or missing references)
		//IL_0050: 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: Expected O, but got Unknown
		//IL_008b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0090: Unknown result type (might be due to invalid IL or missing references)
		//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d5: Expected O, but got Unknown
		//IL_00f0: 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_0205: Unknown result type (might be due to invalid IL or missing references)
		//IL_020a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0247: Unknown result type (might be due to invalid IL or missing references)
		//IL_0251: Unknown result type (might be due to invalid IL or missing references)
		//IL_0319: Unknown result type (might be due to invalid IL or missing references)
		//IL_031f: Expected O, but got Unknown
		//IL_03cb: Unknown result type (might be due to invalid IL or missing references)
		//IL_03d5: Unknown result type (might be due to invalid IL or missing references)
		//IL_04d9: Unknown result type (might be due to invalid IL or missing references)
		//IL_04e5: Unknown result type (might be due to invalid IL or missing references)
		//IL_04eb: Expected O, but got Unknown
		//IL_0555: Unknown result type (might be due to invalid IL or missing references)
		//IL_055b: Expected O, but got Unknown
		//IL_05af: Unknown result type (might be due to invalid IL or missing references)
		//IL_05b4: Unknown result type (might be due to invalid IL or missing references)
		//IL_06e1: Unknown result type (might be due to invalid IL or missing references)
		//IL_06eb: Unknown result type (might be due to invalid IL or missing references)
		//IL_0756: Unknown result type (might be due to invalid IL or missing references)
		//IL_0760: Unknown result type (might be due to invalid IL or missing references)
		//IL_077c: Unknown result type (might be due to invalid IL or missing references)
		//IL_080c: Unknown result type (might be due to invalid IL or missing references)
		//IL_08ad: Unknown result type (might be due to invalid IL or missing references)
		//IL_08bd: Expected O, but got Unknown
		baseAnimator = Assets.Load<RuntimeAnimatorController>("animator");
		skinAnimator = Assets.Load<RuntimeAnimatorController>("skin03Animator");
		quake = Utils.NewBuffDef("Quake", stack: true, hidden: false, Assets.Load<Sprite>("passive"), Color.white);
		dmgBuff = Utils.NewBuffDef("Impale", stack: false, hidden: false, Assets.Load<Sprite>("special"), Color.white);
		impaledInner = new Material(Load<Material>("RoR2/Base/Common/matRevealedEffect.mat"));
		impaledInner.SetColor("_TintColor", Color32.op_Implicit(new Color32(byte.MaxValue, (byte)82, (byte)42, byte.MaxValue)));
		impaledInner.SetTexture("_RemapTex", (Texture)null);
		impaledInner.SetFloat("_AlphaBias", 1.65f);
		impaledOuter = new Material(Load<Material>("RoR2/Base/BurnNearby/matOnHelfire.mat"));
		impaledOuter.SetTexture("_MainTex", (Texture)null);
		impaledOuter.SetColor("_TintColor", Color.red);
		impaledOuter.SetFloat("_Boost", 12f);
		impaledOuter.SetFloat("_AlphaBias", 1f);
		slamEffect = Instantiate(Load<GameObject>("RoR2/Base/Parent/ParentSlamEffect.prefab"), "SlamEffect");
		ParticleSystem[] componentsInChildren = slamEffect.GetComponentsInChildren<ParticleSystem>();
		foreach (ParticleSystem val in componentsInChildren)
		{
			MainModule main = val.main;
			((MainModule)(ref main)).scalingMode = (ParticleSystemScalingMode)0;
		}
		Utils.RegisterEffect(slamEffect, 0.4f, "", applyScale: true);
		impaleEffect = Instantiate(Assets.Load<GameObject>("ImpaleEffect"), "ImpaleEffect");
		Utils.RegisterEffect(impaleEffect, 0.4f);
		shieldEffect = Instantiate(Assets.Load<GameObject>("ReflectShield"), "ShieldEffect");
		Material val2 = Object.Instantiate<Material>(Load<Material>("RoR2/Base/Engi/matDefenseMatrix.mat"));
		val2.SetColor("_TintColor", Color32.op_Implicit(new Color32(byte.MaxValue, (byte)204, (byte)120, byte.MaxValue)));
		val2.SetTexture("_RemapTex", (Texture)(object)Assets.Load<Texture2D>("shieldRamp"));
		val2.SetTexture("_Cloud1Tex", (Texture)(object)Load<Texture2D>("RoR2/Base/Imp/texImpSwipeMask.png"));
		val2.SetTextureScale("_Cloud1Tex", Vector2.one * 22f);
		val2.SetFloat("_SoftPower", 0f);
		val2.SetFloat("_Boost", 0.6f);
		val2.SetFloat("_RimPower", 2.4f);
		((Renderer)shieldEffect.GetComponentInChildren<ParticleSystemRenderer>()).material = val2;
		shieldEffect.AddComponent<ShieldEffectBehaviour>();
		slashFXR = Instantiate(Assets.Load<GameObject>("SlashFXR"), "SlashFXR");
		Utils.RegisterEffect(slashFXR, 0.45f, "", applyScale: true);
		slashFXL = Instantiate(Assets.Load<GameObject>("SlashFXL"), "SlashFXL");
		Utils.RegisterEffect(slashFXL, 0.45f, "", applyScale: true);
		Material val3 = new Material(Load<Shader>("Decalicious/DecaliciousDeferredDecal.shader"));
		((Object)val3).name = "SkarnerGroundDecal";
		val3.SetFloat("_DecalLayer", 1f);
		val3.SetFloat("_DecalBlendMode", 0f);
		val3.SetFloat("_DecalSrcBlend", 5f);
		val3.SetFloat("_DecalDstBlend ", 10f);
		val3.SetFloat("_NormalBlendMode", 0f);
		val3.SetTexture("_MaskTex", (Texture)(object)Assets.Load<Texture2D>("groundcrack_mask"));
		val3.SetTexture("_MainTex", (Texture)(object)Assets.Load<Texture2D>("groundcrack"));
		jumpImpactDecalEffect = Instantiate("RoR2/Base/ClayBoss/ClayBossSpawnEffect.prefab", "JumpImpactDecalEffect");
		jumpImpactDecalEffect.transform.localScale = Vector3.one * 4.5f;
		Object.Destroy((Object)(object)jumpImpactDecalEffect.GetComponent<AlignToNormal>());
		AnimateShaderAlpha component = jumpImpactDecalEffect.GetComponent<AnimateShaderAlpha>();
		component.timeMax = 6f;
		component.disableOnEnd = false;
		component.destroyOnEnd = true;
		component.alphaCurve = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f);
		component.alphaCurve.AddKey(0.85f, 1f);
		ParticleSystem[] componentsInChildren2 = jumpImpactDecalEffect.GetComponentsInChildren<ParticleSystem>();
		foreach (ParticleSystem val4 in componentsInChildren2)
		{
			((Component)val4).gameObject.SetActive(false);
		}
		Decal componentInChildren = jumpImpactDecalEffect.GetComponentInChildren<Decal>();
		componentInChildren.Material = val3;
		Utils.RegisterEffect(jumpImpactDecalEffect, -1f, "", applyScale: true);
		jumpImpactDecalEffect.GetComponent<VFXAttributes>().DoNotPool = true;
		boulderPickupDecalEffect = Instantiate(jumpImpactDecalEffect, "BoulderPickupDecalEffect");
		boulderPickupDecalEffect.transform.localScale = Vector3.one;
		val3 = new Material(val3);
		val3.SetTexture("_MaskTex", (Texture)(object)Assets.Load<Texture2D>("halfcrater_mask"));
		val3.SetTexture("_MainTex", (Texture)(object)Assets.Load<Texture2D>("halfcrater"));
		boulderPickupDecalEffect.GetComponentInChildren<Decal>().Material = val3;
		Utils.RegisterEffect(boulderPickupDecalEffect, -1f, "", applyScale: true);
		impactDecalEffect = Instantiate(jumpImpactDecalEffect, "ImpactDecalEffect");
		val3 = new Material(val3);
		val3.SetTexture("_MaskTex", (Texture)(object)Assets.Load<Texture2D>("crater_mask"));
		val3.SetTexture("_MainTex", (Texture)(object)Assets.Load<Texture2D>("crater"));
		impactDecalEffect.GetComponentInChildren<Decal>().Material = val3;
		Utils.RegisterEffect(impactDecalEffect, -1f, "", applyScale: true);
		quakeDMG = DamageAPI.ReserveDamageType();
		dashEffect = Instantiate(Assets.Load<GameObject>("dashEffect"), "DashEffect");
		quakeEffect = Instantiate("RoR2/Base/Beetle/SunderGhost.prefab", "QuakeEffect");
		Object.DestroyImmediate((Object)(object)quakeEffect.GetComponent<ProjectileGhostController>());
		Object.DestroyImmediate((Object)(object)quakeEffect.GetComponent<DisableParticleEmissionAndDestroyOnTimer>());
		Object.DestroyImmediate((Object)(object)quakeEffect.GetComponent<VFXAttributes>());
		Object.DestroyImmediate((Object)(object)quakeEffect.GetComponent<ShakeEmitter>());
		Object.DestroyImmediate((Object)(object)quakeEffect.GetComponent<AkEvent>());
		Object.DestroyImmediate((Object)(object)quakeEffect.GetComponent<AkEvent>());
		Object.DestroyImmediate((Object)(object)quakeEffect.GetComponent<AkGameObj>());
		quakeEffect.AddComponent<QuakeEffectBehaviour>();
		quakeEffect.AddComponent<NetworkIdentity>();
		PrefabAPI.RegisterNetworkPrefab(quakeEffect);
		boulderMuzzleEffect = Instantiate(quakeEffect, "BoulderMuzzleEffect");
		Object.DestroyImmediate((Object)(object)boulderMuzzleEffect.GetComponent<QuakeEffectBehaviour>());
		((Component)boulderMuzzleEffect.transform.GetChild(0).GetChild(1)).gameObject.SetActive(false);
		ParticleSystemRenderer[] componentsInChildren3 = boulderMuzzleEffect.GetComponentsInChildren<ParticleSystemRenderer>();
		foreach (ParticleSystemRenderer val5 in componentsInChildren3)
		{
			((Component)val5).transform.localScale = Vector3.one * 0.45f;
		}
		Utils.RegisterEffect(boulderMuzzleEffect, 0.6f, "", applyScale: true);
		boulderProjectileGhost = Instantiate("RoR2/Base/Grandparent/GrandparentBoulderGhost.prefab", "BoulderProjectileGhost");
		boulderProjectileGhost.GetComponent<VFXAttributes>().DoNotPool = true;
		Transform child = boulderProjectileGhost.transform.GetChild(0);
		child.localScale = Vector3.one * 0.35f;
		child.localRotation = Quaternion.Euler(325f, 75f, 90f);
		Object.Destroy((Object)(object)((Component)child).GetComponent<RotateAroundAxis>());
		boulderProjectile = Instantiate("RoR2/Base/LemurianBruiser/LemurianBigFireball.prefab", "BoulderProjectile", registerNetwork: true);
		boulderProjectile.AddComponent<ProjectileScale>();
		boulderProjectile.GetComponent<Rigidbody>().useGravity = true;
		ProjectileSimple component2 = boulderProjectile.GetComponent<ProjectileSimple>();
		((Behaviour)component2).enabled = false;
		component2.desiredForwardSpeed = 85f;
		boulderProjectile.GetComponent<Collider>().enabled = false;
		boulderProjectile.AddComponent<BoulderProjectile>();
		boulderProjectile.AddComponent<ModdedDamageTypeHolderComponent>().Add(quakeDMG);
		ProjectileController component3 = boulderProjectile.GetComponent<ProjectileController>();
		component3.ghostPrefab = boulderProjectileGhost;
		component3.flightSoundLoop = Load<LoopSoundDef>("RoR2/Base/Grandparent/lsdGrandparentBoulderFlight.asset");
		ProjectileImpactExplosion component4 = boulderProjectile.GetComponent<ProjectileImpactExplosion>();
		((ProjectileExplosion)component4).blastProcCoefficient = 1.2f;
		component4.impactEffect = Load<GameObject>("RoR2/Base/Parent/ParentSlamEffect.prefab");
		component4.lifetime = 10f;
		ContentAddition.AddProjectile(boulderProjectile);
		clawHitEffect = Instantiate("RoR2/Base/Common/VFX/OmniImpactVFX.prefab", "ClawHitEffect");
		Utils.RegisterEffect(clawHitEffect, -1f, "Play_sfx_SkarnerQClawAttack_OnHit");
		quakeHitEffect = Instantiate(new GameObject(), "QuakeHitEffect");
		Utils.RegisterEffect(quakeHitEffect, -1f, "Play_sfx_SkarnerPassiveAttack_OnHit");
	}

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

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

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

	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 earlyExitDurationPercentage => 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 => "Gesture, Override";

	public virtual string animationStateName => "";

	public virtual string animParameter => "M1";

	public virtual string hitBoxGroupName => "";

	public virtual string hitBoxActiveParameter => "Curve";

	public virtual string swingMuzzle => "";

	public virtual GameObject swingEffectPrefab => null;

	public virtual bool hopOnHit => true;

	public virtual bool rootMotion => false;

	public virtual bool rootMotionWhileHitting => false;

	public virtual string swingSound => "";

	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_00b4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
		//IL_00be: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c9: 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;
		hitPauseDuration = GroundLight.hitPauseDuration / attackSpeedScaling;
		hopVelocity = baseHopVelocity / attackSpeedScaling;
		animator = ((EntityState)this).GetModelAnimator();
		animator.SetFloat(hitBoxActiveParameter, 0f);
		overlapAttack = ((BaseState)this).InitMeleeOverlap(damageCoefficient, hitEffectPrefab, ((EntityState)this).GetModelTransform(), hitBoxGroupName);
		overlapAttack.pushAwayForce = 1f;
		overlapAttack.damageType = DamageTypeCombo.op_Implicit(damageType);
		DamageAPI.AddModdedDamageType(overlapAttack, Prefabs.quakeDMG);
		hasAnimParameter = !Utility.IsNullOrWhiteSpace(animParameter);
		if (hasAnimParameter && !Utility.IsNullOrWhiteSpace(animationStateName))
		{
			((EntityState)this).PlayAnimation(layerName, animationStateName, animParameter, attackDuration, 0f);
		}
	}

	public virtual Vector3 rootMotionDirection()
	{
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		//IL_000c: Unknown result type (might be due to invalid IL or missing references)
		//IL_000f: Unknown result type (might be due to invalid IL or missing references)
		return ((EntityState)this).characterDirection.forward;
	}

	public override void FixedUpdate()
	{
		//IL_0030: Unknown result type (might be due to invalid IL or missing references)
		//IL_0114: Unknown result type (might be due to invalid IL or missing references)
		//IL_0119: Unknown result type (might be due to invalid IL or missing references)
		//IL_011d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0129: Unknown result type (might be due to invalid IL or missing references)
		//IL_013c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0141: Unknown result type (might be due to invalid IL or missing references)
		//IL_0149: Unknown result type (might be due to invalid IL or missing references)
		//IL_0153: Unknown result type (might be due to invalid IL or missing references)
		//IL_0158: Unknown result type (might be due to invalid IL or missing references)
		//IL_015d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0183: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
		//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
		((EntityState)this).FixedUpdate();
		if (((EntityState)this).isAuthority)
		{
			bool flag = FireMeleeAttack(overlapAttack, animator, hitBoxActiveParameter, forceMagnitude, bonusForce);
			hasHit |= flag;
			if (hasHit)
			{
				if (hasHit && !((EntityState)this).characterMotor.isGrounded && !hopped)
				{
					hopped = true;
				}
				if (!rootMotionWhileHitting && !isInHitPause && hasAnimParameter)
				{
					hitStopCachedState = ((BaseState)this).CreateHitStopCachedState(((EntityState)this).characterMotor, animator, animParameter);
					isInHitPause = true;
				}
			}
			if (!isInHitPause && !hasHit && !animator.GetBool("inUlt") && animator.GetFloat(hitBoxActiveParameter) > 0.1f && rootMotion)
			{
				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;
				animator.speed = 0f;
			}
			if (stopwatch >= attackDuration * earlyExitDurationPercentage)
			{
				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 finisher => attackIndex == 3;

	public override float baseAttackDuration => finisher ? 0.8f : 0.65f;

	public override float earlyExitDurationPercentage => 0.85f;

	public override string layerName => animator.GetBool("inUlt") ? "Gesture, Override" : "FullBody, Override";

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

	public override string hitBoxGroupName => "Slash";

	public override float forceMagnitude => 250f;

	public override string swingMuzzle => "Attack1Muzzle";

	public override float damageCoefficient => finisher ? 3.5f : 2.85f;

	public override string swingSound => "Play_sfx_SkarnerQClawAttack_OnCast";

	public override float baseHopVelocity => 6f;

	public override bool rootMotion => true;

	public override GameObject hitEffectPrefab => Prefabs.clawHitEffect;

	public override GameObject swingEffectPrefab => (attackIndex == 1) ? Prefabs.slashFXR : Prefabs.slashFXL;

	public override DamageType damageType => DamageTypeCombo.op_Implicit(DamageTypeCombo.GenericPrimary);

	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();
	}

	public override void SetState()
	{
		if (!finisher)
		{
			if (attackIndex == 2 && ((BaseState)this).isGrounded && !animator.GetBool("inUlt"))
			{
				((EntityState)this).outer.SetNextState((EntityState)(object)new RockThrow());
				return;
			}
			Primary primary = new Primary();
			primary.attackIndex = attackIndex + 1;
			((EntityState)this).outer.SetNextState((EntityState)(object)primary);
		}
	}

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

	private float baseDuration = 1.2f;

	private float damageCoefficient = 3.6f;

	private SBehaviour behaviour;

	private BoulderProjectile boulder;

	private Animator animator;

	private bool spawnedProjecitle;

	private bool hasFired;

	private Vector3 fwEffectPos;

	private float mult;

	public override void OnEnter()
	{
		//IL_0098: 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_00b3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b8: 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_00c7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d9: Unknown result type (might be due to invalid IL or missing references)
		//IL_00eb: Expected O, but got Unknown
		((BaseState)this).OnEnter();
		duration = baseDuration / ((BaseState)this).attackSpeedStat;
		behaviour = ((EntityState)this).GetComponent<SBehaviour>();
		animator = ((EntityState)this).GetModelAnimator();
		animator.SetFloat("Curve", 0f);
		((EntityState)this).PlayAnimation("FullBody, Override", "Attack3", "M1", duration, 0f);
		AkSoundEngine.PostEvent("Play_sfx_SkarnerQClawAttack_OnCast", ((EntityState)this).gameObject);
		mult = ((Component)((EntityState)this).GetModelTransform()).GetComponent<ModelBehaviour>().multCapped;
		fwEffectPos = ((EntityState)this).transform.position + ((EntityState)this).characterDirection.forward * behaviour.fwEffectPos;
		EffectManager.SpawnEffect(Prefabs.boulderMuzzleEffect, new EffectData
		{
			origin = fwEffectPos,
			scale = mult
		}, false);
	}

	public override void FixedUpdate()
	{
		//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
		//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
		//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f2: Expected O, but got Unknown
		//IL_0059: Unknown result type (might be due to invalid IL or missing references)
		//IL_005f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0064: Unknown result type (might be due to invalid IL or missing references)
		//IL_0067: Unknown result type (might be due to invalid IL or missing references)
		//IL_006c: Unknown result type (might be due to invalid IL or missing references)
		//IL_009d: Unknown result type (might be due to invalid IL or missing references)
		((EntityState)this).FixedUpdate();
		if (!spawnedProjecitle && ((EntityState)this).fixedAge >= duration * 0.1f)
		{
			spawnedProjecitle = true;
			if (((EntityState)this).isAuthority)
			{
				ProjectileManager instance = ProjectileManager.instance;
				GameObject boulderProjectile = Prefabs.boulderProjectile;
				Vector3 position = ((BaseState)this).FindModelChild("BoulderMuzzle").position;
				Ray aimRay = ((BaseState)this).GetAimRay();
				instance.FireProjectile(boulderProjectile, position, Quaternion.LookRotation(((Ray)(ref aimRay)).direction), ((EntityState)this).gameObject, ((BaseState)this).damageStat * damageCoefficient, damageCoefficient * 100f, ((BaseState)this).RollCrit(), (DamageColorIndex)0, (GameObject)null, -1f, (DamageTypeCombo?)DamageTypeCombo.GenericPrimary);
			}
			EffectManager.SpawnEffect(Prefabs.boulderPickupDecalEffect, new EffectData
			{
				origin = ((EntityState)this).characterBody.footPosition,
				scale = mult,
				rotation = Quaternion.LookRotation(((EntityState)this).characterDirection.forward)
			}, false);
			AkSoundEngine.PostEvent("Play_sfx_Skarner_SkarnerQThrow_obd", ((EntityState)this).gameObject);
			AkSoundEngine.PostEvent("Play_sfx_SkarnerQRockAttack_OnCast", ((EntityState)this).gameObject);
		}
		if (spawnedProjecitle && !Object.op_Implicit((Object)(object)boulder))
		{
			boulder = behaviour.boulder;
		}
		if (Object.op_Implicit((Object)(object)boulder) && !hasFired && (animator.GetFloat("Curve") > behaviour.minSpawnTime || ((EntityState)this).fixedAge >= duration))
		{
			hasFired = true;
			boulder.Fire();
		}
		if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= duration)
		{
			((EntityState)this).outer.SetNextStateToMain();
		}
	}

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

	public override InterruptPriority GetMinimumInterruptPriority()
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0005: Unknown result type (might be due to invalid IL or missing references)
		return (InterruptPriority)1;
	}
}
internal class Secondary : BaseSkillState
{
	private float duration;

	private float baseDuration = 0.25f;

	private float blastDamageCoefficient = 4.2f;

	public override void OnEnter()
	{
		((BaseState)this).OnEnter();
		duration = baseDuration / ((BaseState)this).attackSpeedStat;
		if (!((EntityState)this).GetModelAnimator().GetBool("inUlt"))
		{
			((EntityState)this).PlayAnimation("FullBody, Override", "Hop", "M2", duration, 0f);
		}
		AkSoundEngine.PostEvent("Play_sfx_Skarner_SkarnerW_OnCast", ((EntityState)this).gameObject);
		((BaseState)this).SmallHop(((EntityState)this).characterMotor, 0f);
	}

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

	public override void OnExit()
	{
		//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_006c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0071: Unknown result type (might be due to invalid IL or missing references)
		//IL_0078: Unknown result type (might be due to invalid IL or missing references)
		//IL_0083: Unknown result type (might be due to invalid IL or missing references)
		//IL_0096: Expected O, but got Unknown
		//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
		//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e9: Expected O, but got Unknown
		//IL_00fa: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ff: Unknown result type (might be due to invalid IL or missing references)
		//IL_010b: Unknown result type (might be due to invalid IL or missing references)
		//IL_011e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0129: 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_0137: Unknown result type (might be due to invalid IL or missing references)
		//IL_013c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0141: Unknown result type (might be due to invalid IL or missing references)
		//IL_0146: Unknown result type (might be due to invalid IL or missing references)
		//IL_014b: Unknown result type (might be due to invalid IL or missing references)
		//IL_014d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0152: Unknown result type (might be due to invalid IL or missing references)
		//IL_015d: Unknown result type (might be due to invalid IL or missing references)
		//IL_016a: 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_0176: Unknown result type (might be due to invalid IL or missing references)
		//IL_017b: Unknown result type (might be due to invalid IL or missing references)
		//IL_017d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0182: Unknown result type (might be due to invalid IL or missing references)
		//IL_0189: 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_0195: Expected O, but got Unknown
		//IL_0197: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a4: Unknown result type (might be due to invalid IL or missing references)
		if (!Object.op_Implicit((Object)(object)InstanceTracker.GetInstancesList<ShieldEffectBehaviour>().Find((ShieldEffectBehaviour x) => (Object)(object)x.body == (Object)(object)((EntityState)this).characterBody)))
		{
			Object.Instantiate<GameObject>(Prefabs.shieldEffect, ((BaseState)this).FindModelChild("shieldMuzzle").position, Quaternion.identity, ((EntityState)this).transform);
		}
		float multCapped = ((Component)((EntityState)this).GetModelTransform()).GetComponent<ModelBehaviour>().multCapped;
		if (((BaseState)this).isGrounded)
		{
			EffectManager.SpawnEffect(Prefabs.jumpImpactDecalEffect, new EffectData
			{
				origin = ((EntityState)this).characterBody.footPosition,
				scale = 4.5f * multCapped
			}, false);
		}
		if (NetworkServer.active)
		{
			((EntityState)this).healthComponent.AddBarrier(((EntityState)this).healthComponent.fullHealth * 0.2f);
		}
		EffectManager.SpawnEffect(Prefabs.slamEffect, new EffectData
		{
			origin = ((EntityState)this).characterBody.footPosition,
			scale = multCapped
		}, false);
		if (((EntityState)this).isAuthority)
		{
			BlastAttack val = new BlastAttack
			{
				attacker = ((EntityState)this).gameObject,
				baseDamage = ((BaseState)this).damageStat * blastDamageCoefficient,
				baseForce = 2000f,
				crit = ((BaseState)this).RollCrit(),
				damageType = (DamageTypeCombo.op_Implicit((DamageType)8) | DamageTypeCombo.GenericSecondary),
				falloffModel = (FalloffModel)0,
				procCoefficient = 1f,
				radius = 18f * multCapped,
				position = ((EntityState)this).characterBody.footPosition,
				attackerFiltering = (AttackerFiltering)2,
				teamIndex = ((EntityState)this).teamComponent.teamIndex
			};
			DamageAPI.AddModdedDamageType(val, Prefabs.quakeDMG);
			val.Fire();
		}
		AkSoundEngine.PostEvent("Play_sfx_Skarner_SkarnerW_missilelaunch", ((EntityState)this).gameObject);
		((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 : BaseSkillState
{
	private float duration;

	private float baseDuration = 0.25f;

	private EntityStateMachine body;

	public override void OnEnter()
	{
		//IL_007c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0081: Unknown result type (might be due to invalid IL or missing references)
		//IL_0084: Unknown result type (might be due to invalid IL or missing references)
		//IL_0089: Unknown result type (might be due to invalid IL or missing references)
		//IL_0069: Unknown result type (might be due to invalid IL or missing references)
		//IL_0073: Expected O, but got Unknown
		((BaseState)this).OnEnter();
		duration = baseDuration / ((BaseState)this).attackSpeedStat;
		((EntityState)this).PlayAnimation("FullBody, Override", "Ult", "Special", duration, 0f);
		body = ((EntityState)this).GetComponent<EntityStateMachine>();
		if (((EntityState)this).isAuthority && Object.op_Implicit((Object)(object)body))
		{
			body.SetNextState((EntityState)new Idle());
		}
		CharacterDirection characterDirection = ((EntityState)this).characterDirection;
		Ray aimRay = ((BaseState)this).GetAimRay();
		characterDirection.forward = Utils.GetForwardDirection(((Ray)(ref aimRay)).direction);
		AkSoundEngine.PostEvent("Play_sfx_Skarner_SkarnerR_cast", ((EntityState)this).gameObject);
	}

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

	public override void OnExit()
	{
		if (((EntityState)this).isAuthority)
		{
			body.SetNextStateToMain();
		}
		((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 SpecialGrab : BaseSkillState
{
	private float duration = 3f;

	private float damageCoefficient = 4.5f;

	private bool hit;

	private Dictionary<CharacterBody, object> hits = new Dictionary<CharacterBody, object>();

	private Transform[] tailMuzzles;

	private List<int> layers = new List<int>();

	private List<TemporaryOverlayInstance> overlays = new List<TemporaryOverlayInstance>();

	private Animator animator;

	private SBehaviour behaviour;

	private uint ID;

	private bool playingSound;

	public override void OnEnter()
	{
		//IL_007f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0084: 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_009b: 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_00b6: Unknown result type (might be due to invalid IL or missing references)
		//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c8: 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_00d2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00da: Unknown result type (might be due to invalid IL or missing references)
		//IL_00df: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
		//IL_0100: Unknown result type (might be due to invalid IL or missing references)
		//IL_0102: Unknown result type (might be due to invalid IL or missing references)
		//IL_0109: Expected O, but got Unknown
		//IL_03f9: Unknown result type (might be due to invalid IL or missing references)
		//IL_03fe: Unknown result type (might be due to invalid IL or missing references)
		//IL_040a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0416: Unknown result type (might be due to invalid IL or missing references)
		//IL_041e: Unknown result type (might be due to invalid IL or missing references)
		//IL_042a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0435: Unknown result type (might be due to invalid IL or missing references)
		//IL_043d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0442: Unknown result type (might be due to invalid IL or missing references)
		//IL_0449: Expected O, but got Unknown
		//IL_044b: Unknown result type (might be due to invalid IL or missing references)
		((BaseState)this).OnEnter();
		behaviour = ((EntityState)this).GetComponent<SBehaviour>();
		ChildLocator modelChildLocator = ((EntityState)this).GetModelChildLocator();
		string text = ((((EntityState)this).characterBody.skinIndex == 3) ? "skin03" : "");
		tailMuzzles = (Transform[])(object)new Transform[3]
		{
			modelChildLocator.FindChild(text + "RTailMuzzle"),
			modelChildLocator.FindChild(text + "CTailMuzzle"),
			modelChildLocator.FindChild(text + "LTailMuzzle")
		};
		Ray aimRay = ((BaseState)this).GetAimRay();
		float multCapped = ((Component)((EntityState)this).GetModelTransform()).GetComponent<ModelBehaviour>().multCapped;
		BullseyeSearch val = new BullseyeSearch
		{
			maxAngleFilter = behaviour.maxSpecialSearchAngle * multCapped,
			teamMaskFilter = TeamMask.GetEnemyTeams(((EntityState)this).teamComponent.teamIndex),
			searchOrigin = ((Ray)(ref aimRay)).origin,
			searchDirection = ((Ray)(ref aimRay)).direction,
			maxDistanceFilter = behaviour.maxSpecialSearchDistance * multCapped,
			filterByLoS = true,
			filterByDistinctEntity = true,
			sortMode = (SortMode)3
		};
		val.RefreshCandidates();
		foreach (HurtBox result in val.GetResults())
		{
			HealthComponent healthComponent = result.healthComponent;
			if (!Object.op_Implicit((Object)(object)healthComponent) || !Object.op_Implicit((Object)(object)healthComponent.body))
			{
				continue;
			}
			hit = true;
			float num = ((BaseState)this).damageStat * damageCoefficient;
			if (healthComponent.body.isBoss || healthComponent.body.isChampion)
			{
				num *= 2f;
			}
			else if (hits.Count < 3 && !hits.ContainsKey(healthComponent.body))
			{
				CharacterMotor characterMotor = healthComponent.body.characterMotor;
				RigidbodyMotor component = ((Component)healthComponent).GetComponent<RigidbodyMotor>();
				if (Object.op_Implicit((Object)(object)characterMotor) || Object.op_Implicit((Object)(object)component))
				{
					hits.Add(healthComponent.body, Object.op_Implicit((Object)(object)characterMotor) ? ((object)characterMotor) : ((object)component));
				}
				if (NetworkServer.active)
				{
					SetStateOnHurt.SetStunOnObject(((Component)healthComponent).gameObject, duration + 0.5f);
				}
				if (Object.op_Implicit((Object)(object)characterMotor))
				{
					layers.Add(((Component)characterMotor).gameObject.layer);
					((Component)characterMotor).gameObject.layer = LayerIndex.fakeActor.intVal;
					((BaseCharacterController)((EntityState)this).characterMotor).Motor.RebuildCollidableLayers();
				}
			}
			Transform modelTransform = healthComponent.body.modelLocator.modelTransform;
			if (Object.op_Implicit((Object)(object)modelTransform))
			{
				CharacterModel component2 = ((Component)modelTransform).GetComponent<CharacterModel>();
				if (Object.op_Implicit((Object)(object)component2))
				{
					TemporaryOverlayInstance val2 = TemporaryOverlayManager.AddOverlay(((Component)component2).gameObject);
					val2.duration = duration;
					val2.originalMaterial = Prefabs.impaledInner;
					val2.animateShaderAlpha = true;
					val2.alphaCurve = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f);
					val2.alphaCurve.AddKey(0.85f, 1f);
					val2.destroyComponentOnEnd = true;
					val2.AddToCharacterModel(component2);
					overlays.Add(val2);
					val2 = TemporaryOverlayManager.AddOverlay(((Component)component2).gameObject);
					val2.duration = duration;
					val2.originalMaterial = Prefabs.impaledOuter;
					val2.animateShaderAlpha = true;
					val2.alphaCurve = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f);
					val2.alphaCurve.AddKey(0.85f, 1f);
					val2.destroyComponentOnEnd = true;
					val2.AddToCharacterModel(component2);
					overlays.Add(val2);
				}
			}
			if (NetworkServer.active)
			{
				DamageInfo val3 = new DamageInfo
				{
					attacker = ((EntityState)this).gameObject,
					inflictor = ((EntityState)this).gameObject,
					damage = num,
					crit = ((BaseState)this).RollCrit(),
					procCoefficient = 0f,
					position = healthComponent.body.corePosition
				};
				DamageAPI.AddModdedDamageType(val3, Prefabs.quakeDMG);
				healthComponent.TakeDamage(val3);
				GlobalEventManager.instance.OnHitEnemy(val3, ((Component)healthComponent).gameObject);
				GlobalEventManager.instance.OnHitAll(val3, ((Component)healthComponent).gameObject);
				result.healthComponent.body.AddBuff(Prefabs.dmgBuff);
			}
			AkSoundEngine.PostEvent("Play_sfx_Skarner_SkarnerR_hitlocation", ((Component)healthComponent).gameObject);
		}
		animator = ((EntityState)this).GetModelAnimator();
		animator.SetBool("inUlt", true);
		((BaseState)this).StartAimMode(2f, false);
		AkSoundEngine.PostEvent("Play_sfx_Skarner_SkarnerR_missilelaunch", ((EntityState)this).gameObject);
		if (hit)
		{
			AkSoundEngine.PostEvent("Play_sfx_Skarner_SkarnerR_hit", ((EntityState)this).gameObject);
		}
		EffectManager.SimpleMuzzleFlash(Prefabs.impaleEffect, ((EntityState)this).gameObject, "base", false);
	}

	public override void FixedUpdate()
	{
		//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
		//IL_00de: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ed: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
		//IL_010c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0111: Unknown result type (might be due to invalid IL or missing references)
		//IL_0118: Unknown result type (might be due to invalid IL or missing references)
		//IL_011d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0129: Unknown result type (might be due to invalid IL or missing references)
		//IL_014a: 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)
		((EntityState)this).FixedUpdate();
		((EntityState)this).skillLocator.special.rechargeStopwatch = 0f;
		((BaseState)this).StartAimMode(2f, false);
		if (((EntityState)this).isAuthority && (!hit || ((EntityState)this).fixedAge >= duration || (((EntityState)this).fixedAge >= 0.25f && ((ButtonState)(ref ((EntityState)this).inputBank.skill4)).justPressed)))
		{
			((EntityState)this).outer.SetNextState((EntityState)(object)new SpecialThrow());
			if (hit)
			{
			}
			return;
		}
		for (int i = 0; i < hits.Count; i++)
		{
			object value = hits.ElementAt(i).Value;
			CharacterMotor val = ((!(value is CharacterMotor)) ? ((CharacterMotor)null) : ((CharacterMotor)value));
			RigidbodyMotor val2 = ((!(value is RigidbodyMotor)) ? ((RigidbodyMotor)null) : ((RigidbodyMotor)value));
			Vector3 position = tailMuzzles[i].position;
			if (Object.op_Implicit((Object)(object)val))
			{
				val.disableAirControlUntilCollision = true;
				val.velocity = Vector3.zero;
				val.rootMotion = Vector3.zero;
				((BaseCharacterController)val).Motor.SetPosition(position, true);
			}
			else if (Object.op_Implicit((Object)(object)val2))
			{
				val2.rigid.velocity = Vector3.zero;
				val2.rigid.MovePosition(position);
			}
		}
		if (hit && !playingSound)
		{
			playingSound = true;
			ID = AkSoundEngine.PostEvent("Play_sfx_Skarner_SkarnerR_buffactivate", ((EntityState)this).gameObject);
		}
	}

	public override void OnExit()
	{
		//IL_009e: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
		//IL_0193: Unknown result type (might be due to invalid IL or missing references)
		//IL_0199: Unknown result type (might be due to invalid IL or missing references)
		//IL_019e: 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_01b2: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b7: Unknown result type (might be due to invalid IL or missing references)
		//IL_014c: Unknown result type (might be due to invalid IL or missing references)
		//IL_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_015b: 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_0170: Unknown result type (might be due to invalid IL or missing references)
		//IL_0175: Unknown result type (might be due to invalid IL or missing references)
		AkSoundEngine.StopPlayingID(ID);
		animator.SetBool("inUlt", false);
		if (hit)
		{
			foreach (TemporaryOverlayInstance overlay in overlays)
			{
				if (overlay != null)
				{
					overlay.Destroy();
				}
			}
			for (int i = 0; i < hits.Count; i++)
			{
				KeyValuePair<CharacterBody, object> keyValuePair = hits.ElementAt(i);
				object value = keyValuePair.Value;
				CharacterMotor val = ((!(value is CharacterMotor)) ? ((CharacterMotor)null) : ((CharacterMotor)value));
				RigidbodyMotor val2 = ((!(value is RigidbodyMotor)) ? ((RigidbodyMotor)null) : ((RigidbodyMotor)value));
				CharacterBody key = keyValuePair.Key;
				if (Object.op_Implicit((Object)(object)key) && value != null)
				{
					if (Object.op_Implicit((Object)(object)key))
					{
						key.RemoveBuff(Prefabs.dmgBuff);
					}
					Ray aimRay;
					if (Object.op_Implicit((Object)(object)val))
					{
						val.disableAirControlUntilCollision = false;
						((Component)val).gameObject.layer = ((layers.Count >= i) ? layers[i] : 8);
						((BaseCharacterController)val).Motor.RebuildCollidableLayers();
						Vector3 velocity = val.velocity;
						aimRay = ((BaseState)this).GetAimRay();
						val.velocity = velocity + ((Ray)(ref aimRay)).direction * behaviour.force;
					}
					else if (Object.op_Implicit((Object)(object)val2))
					{
						Rigidbody rigid = val2.rigid;
						Vector3 velocity2 = rigid.velocity;
						aimRay = ((BaseState)this).GetAimRay();
						rigid.velocity = velocity2 + ((Ray)(ref aimRay)).direction * behaviour.force;
					}
				}
			}
		}
		((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)7;
	}
}
internal class SpecialThrow : BaseSkillState
{
	public override void OnEnter()
	{
		((BaseState)this).OnEnter();
		((EntityState)this).PlayAnimation("Tail, Override", "Throw");
	}

	public override void FixedUpdate()
	{
		((EntityState)this).FixedUpdate();
		if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= 0.5f)
		{
			((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 Utility : BaseSkillState
{
	private float duration = 4f;

	private Vector3 direction;

	private float speedCoefficient = 12f;

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

	private uint ID;

	private uint ID2;

	private Animator animator;

	private SBehaviour behaviour;

	private float speed;

	private Dictionary<CharacterBody, object> hits = new Dictionary<CharacterBody, object>();

	private List<int> layers = new List<int>();

	private float stopwatch = 1f;

	private bool hit;

	private bool clenched;

	private GameObject dashEffect;

	private float mult;

	public override void OnEnter()
	{
		//IL_00e6: 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_00ed: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
		//IL_00fc: Unknown result type (might be due to invalid IL or missing references)
		//IL_0101: Unknown result type (might be due to invalid IL or missing references)
		//IL_0114: Unknown result type (might be due to invalid IL or missing references)
		//IL_011f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0124: Unknown result type (might be due to invalid IL or missing references)
		((BaseState)this).OnEnter();
		mult = ((Component)((EntityState)this).GetModelTransform()).GetComponent<ModelBehaviour>().multCapped;
		ID = AkSoundEngine.PostEvent("Play_sfx_Skarner_SkarnerEMovement_loop", ((EntityState)this).gameObject);
		ID2 = AkSoundEngine.PostEvent("Play_sfx_Skarner_SkarnerEMovement_footstep", ((EntityState)this).gameObject);
		behaviour = ((EntityState)this).GetComponent<SBehaviour>();
		animator = ((EntityState)this).GetModelAnimator();
		animator.SetFloat("chargeSpeed", Util.Remap(((BaseState)this).moveSpeedStat, 3f, 30f, behaviour.minMoveSpeed, behaviour.maxMoveSpeed) / mult);
		animator.SetBool("charging", true);
		animator.SetBool("isGrounded", ((BaseState)this).isGrounded);
		((EntityState)this).PlayAnimation("Body", "Charge");
		CharacterBody characterBody = ((EntityState)this).characterBody;
		characterBody.bodyFlags = (BodyFlags)(characterBody.bodyFlags | 1);
		Ray aimRay = ((BaseState)this).GetAimRay();
		direction = ((Ray)(ref aimRay)).direction;
		Transform modelTransform = ((EntityState)this).GetModelTransform();
		dashEffect = Object.Instantiate<GameObject>(Prefabs.dashEffect, modelTransform.position, Quaternion.LookRotation(((EntityState)this).characterDirection.forward), modelTransform);
	}

	public override void Update()
	{
		//IL_000f: Unknown result type (might be due to invalid IL or missing references)
		((EntityState)this).Update();
		((EntityState)this).characterDirection.forward = direction;
	}

	public override void FixedUpdate()
	{
		//IL_0056: 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_006b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0076: Unknown result type (might be due to invalid IL or missing references)
		//IL_007b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0086: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
		((EntityState)this).FixedUpdate();
		stopwatch += Time.fixedDeltaTime;
		if (stopwatch >= 0.12f)
		{
			stopwatch = 0f;
			CollectEnemies();
		}
		SetEnemyStatic();
		SpeedBoost();
		RaycastHit val = default(RaycastHit);
		bool flag = Physics.Raycast(((EntityState)this).characterBody.corePosition + Vector3.up * behaviour.upImpactDistance * mult, ((EntityState)this).characterDirection.forward, ref val, behaviour.impactDistance * mult, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask)) && Vector3.Dot(((RaycastHit)(ref val)).normal, Vector3.up) <= 0.5f;
		if (flag)
		{
			AkSoundEngine.PostEvent("Play_sfx_Skarner_SkarnerEMovement_wall_exit", ((EntityState)this).gameObject);
		}
		if (hit && !clenched)
		{
			clenched = true;
			((EntityState)this).PlayAnimation("Claw, Override", "Grab");
		}
		if ((((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= duration) || (((EntityState)this).fixedAge >= 0.2f && ((ButtonState)(ref ((EntityState)this).inputBank.skill3)).justPressed) || flag)
		{
			((EntityState)this).outer.SetNextState((EntityState)(object)new UtilityEnd
			{
				hitCount = hits.Count
			});
		}
	}

	private void SetEnemyStatic()
	{
		//IL_002a: 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_0051: Unknown result type (might be due to invalid IL or missing references)
		//IL_0056: Unknown re