Decompiled source of TitansOfTheRiftRevived v0.2.12

plugins/RiftTitansMod.dll

Decompiled 5 months ago
using System;
using System.Collections;
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.Bootstrap;
using BepInEx.Configuration;
using EntityStates;
using EntityStates.BeetleGuardMonster;
using EntityStates.LemurianMonster;
using HG;
using IL.RoR2;
using JetBrains.Annotations;
using Mono.Cecil.Cil;
using MonoMod.Cil;
using R2API;
using R2API.Utils;
using RiftTitansMod.Modules;
using RiftTitansMod.Modules.Components;
using RiftTitansMod.Modules.Components.Reksai;
using RiftTitansMod.Modules.Survivors;
using RiftTitansMod.SkillStates.Baron;
using RiftTitansMod.SkillStates.BaseStates;
using RiftTitansMod.SkillStates.Blue;
using RiftTitansMod.SkillStates.Chicken;
using RiftTitansMod.SkillStates.Herald;
using RiftTitansMod.SkillStates.Reksai;
using Risky_Artifacts.Artifacts;
using RoR2;
using RoR2.Achievements;
using RoR2.Audio;
using RoR2.CharacterAI;
using RoR2.ContentManagement;
using RoR2.Navigation;
using RoR2.Projectile;
using RoR2.Skills;
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: AssemblyCompany("RiftTitansMod")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("RiftTitansMod")]
[assembly: AssemblyTitle("RiftTitansMod")]
[assembly: TargetFramework(".NETStandard,Version=v2.0", FrameworkDisplayName = "")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
internal class BodyInfo
{
	internal string bodyName = "";

	internal string bodyNameToken = "";

	internal string subtitleNameToken = "";

	internal string bodyNameToClone = "Commando";

	internal Texture characterPortrait = null;

	internal GameObject crosshair = null;

	internal GameObject podPrefab = null;

	internal float maxHealth = 100f;

	internal float healthGrowth = 2f;

	internal float healthRegen = 0f;

	internal float shield = 0f;

	internal float shieldGrowth = 0f;

	internal float moveSpeed = 7f;

	internal float moveSpeedGrowth = 0f;

	internal float acceleration = 80f;

	internal float jumpPower = 15f;

	internal float jumpPowerGrowth = 0f;

	internal float damage = 12f;

	internal float attackSpeed = 1f;

	internal float attackSpeedGrowth = 0f;

	internal float armor = 0f;

	internal float armorGrowth = 0f;

	internal float crit = 1f;

	internal float critGrowth = 0f;

	internal int jumpCount = 1;

	internal Color bodyColor = Color.grey;

	internal Vector3 aimOriginPosition = new Vector3(0f, 1.8f, 0f);

	internal Vector3 modelBasePosition = new Vector3(0f, -0.92f, 0f);

	internal Vector3 cameraPivotPosition = new Vector3(0f, 1.6f, 0f);
}
internal class CustomRendererInfo
{
	internal string childName;

	internal Material material;

	internal bool ignoreOverlays;
}
internal class SkillDefInfo
{
	public string skillName;

	public string skillNameToken;

	public string skillDescriptionToken;

	public Sprite skillIcon;

	public SerializableEntityStateType activationState;

	public string activationStateMachineName;

	public int baseMaxStock;

	public float baseRechargeInterval;

	public bool beginSkillCooldownOnSkillEnd;

	public bool canceledFromSprinting;

	public bool forceSprintDuringState;

	public bool fullRestockOnAssign;

	public InterruptPriority interruptPriority;

	public bool resetCooldownTimerOnUse;

	public bool isCombatSkill;

	public bool mustKeyPress;

	public bool cancelSprintingOnActivation;

	public int rechargeStock;

	public int requiredStock;

	public int stockToConsume;

	public string[] keywordTokens;
}
namespace RiftTitansMod
{
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[NetworkCompatibility(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("com.phreel.TitansOfTheRiftSOTV", "TitansoftheRiftSOTV", "0.2.1")]
	[R2APISubmoduleDependency(new string[] { "DirectorAPI", "PrefabAPI", "LanguageAPI", "SoundAPI" })]
	public class RiftTitansPlugin : BaseUnityPlugin
	{
		public class StageSpawnInfo
		{
			private string stageName;

			private int minStages;

			public StageSpawnInfo(string stageName, int minStages)
			{
				this.stageName = stageName;
				this.minStages = minStages;
			}

			public string GetStageName()
			{
				return stageName;
			}

			public int GetMinStages()
			{
				return minStages;
			}
		}

		public const string MODUID = "com.Phreel.TitansOfTheRiftSOTV";

		public const string MODNAME = "TitansoftheRiftSOTV";

		public const string MODVERSION = "0.2.1";

		public const string developerPrefix = "Phreel";

		public static DirectorCardHolder BaronCard;

		public static DirectorCardHolder BaronLoopCard;

		public static DirectorCardHolder BlueCard;

		public static DirectorCardHolder BlueLoopCard;

		public static DirectorCardHolder ChickenCard;

		public static DirectorCardHolder ChickenLoopCard;

		public static DirectorCardHolder HeraldCard;

		public static DirectorCardHolder HeraldLoopCard;

		public static DirectorCardHolder ReksaiCard;

		public static DirectorCardHolder ReksaiLoopCard;

		public static List<StageSpawnInfo> StageList = new List<StageSpawnInfo>();

		public static RiftTitansPlugin instance;

		public static bool riskyArtifactsInstalled => Chainloader.PluginInfos.ContainsKey("com.Moffein.RiskyArtifacts");

		private void Awake()
		{
			instance = this;
			Files.PluginInfo = ((BaseUnityPlugin)this).Info;
			Assets.Initialize();
			ReadConfig();
			States.RegisterStates();
			Buffs.RegisterBuffs();
			Projectiles.RegisterProjectiles();
			Tokens.AddTokens();
			ItemDisplays.PopulateDisplays();
			Baron.CreateCharacter();
			Reksai.CreateCharacter();
			Blue.CreateCharacter();
			Chicken.CreateCharacter();
			Herald.CreateCharacter();
			new ContentPacks().Initialize();
			ContentManager.onContentPacksAssigned += LateSetup;
			Hook();
		}

		private void Start()
		{
			SoundBanks.Init();
		}

		private void LateSetup(ReadOnlyArray<ReadOnlyContentPack> obj)
		{
			Baron.SetItemDisplays();
			Herald.SetItemDisplays();
			Reksai.SetItemDisplays();
			Chicken.SetItemDisplays();
			Blue.SetItemDisplays();
		}

		public void ReadConfig()
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Expected O, but got Unknown
			//IL_0030: Expected O, but got Unknown
			string value = ((BaseUnityPlugin)this).Config.Bind<string>(new ConfigDefinition("Spawns", "Stage List"), "ancientloft, arena, blackbeach, blackbeach2, dampcavesimple, foggyswamp, frozenwall, golemplains, golemplains2, goolake, itancientloft, itdampcave, itfrozenwall, itgolemplains, itgoolake, itskymeadow, rootjungle, shipgraveyard, skymeadow, snowyforest, sulfurpools, voidstage, wispgraveyard, drybasin, slumberingsatellite, FBLScene, artifactworld, goldshores", new ConfigDescription("What stages the monster will show up on. Add a '- loop' after the stagename to make it only spawn after looping. List of stage names can be found at https://github.com/risk-of-thunder/R2Wiki/wiki/List-of-scene-names", (AcceptableValueBase)null, Array.Empty<object>())).Value;
			value = new string((from c in value.ToCharArray()
				where !char.IsWhiteSpace(c)
				select c).ToArray());
			string[] array = value.Split(new char[1] { ',' });
			string[] array2 = array;
			foreach (string text in array2)
			{
				string[] array3 = text.Split(new char[1] { '-' });
				string stageName = array3[0];
				int minStages = 0;
				if (array3.Length > 1)
				{
					minStages = 5;
				}
				StageList.Add(new StageSpawnInfo(stageName, minStages));
			}
		}

		private void Hook()
		{
		}
	}
}
namespace RiftTitansMod.SkillStates
{
	public class GrabbedState : BaseState
	{
		public Transform handTransform;

		private float duration = 1f;

		private Animator modelAnimator;

		public float freezeDuration = 1f;

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
			Transform modelTransform = ((EntityState)this).GetModelTransform();
			if (Object.op_Implicit((Object)(object)modelTransform))
			{
				CharacterModel component = ((Component)modelTransform).GetComponent<CharacterModel>();
				if (Object.op_Implicit((Object)(object)component))
				{
				}
			}
			modelAnimator = ((EntityState)this).GetModelAnimator();
			if (Object.op_Implicit((Object)(object)modelAnimator))
			{
				duration = freezeDuration;
			}
			((EntityState)this).GetModelBaseTransform().parent = handTransform;
			((EntityState)this).transform.parent = handTransform;
		}

		public override void OnExit()
		{
			if (Object.op_Implicit((Object)(object)modelAnimator))
			{
				((Behaviour)modelAnimator).enabled = true;
			}
			((EntityState)this).GetModelBaseTransform().parent = null;
			((EntityState)this).transform.parent = null;
			((EntityState)this).healthComponent.isInFrozenState = false;
			((EntityState)this).OnExit();
		}

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= duration)
			{
				((EntityState)this).outer.SetInterruptState((EntityState)(object)new ThrownState(), (InterruptPriority)4);
			}
		}

		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)4;
		}
	}
}
namespace RiftTitansMod.SkillStates.Reksai
{
	public class DeathState : GenericCharacterDeath
	{
		private float duration = 4f;

		public static GameObject initialEffect;

		public static float initialEffectScale;

		public static float velocityMagnitude;

		public static float explosionForce;

		public override void OnEnter()
		{
			((GenericCharacterDeath)this).OnEnter();
			Transform modelTransform = ((EntityState)this).GetModelTransform();
			((EntityState)this).PlayAnimation("Body", "Death", "Spawn.playbackRate", duration);
			((EntityState)this).PlayAnimation("Body, Burrowed", "Death", "Spawn.playbackRate", duration);
			Util.PlaySound("RekDeath", ((EntityState)this).gameObject);
		}

		public override void PlayDeathSound()
		{
		}

		public override void FixedUpdate()
		{
			((GenericCharacterDeath)this).FixedUpdate();
			if (NetworkServer.active && ((EntityState)this).fixedAge > 0.5f)
			{
				((GenericCharacterDeath)this).DestroyBodyAsapServer();
			}
		}

		public override void OnExit()
		{
			((GenericCharacterDeath)this).OnExit();
		}
	}
	public class FireSeeker : BaseSkillState
	{
		public static float damageCoefficient = 3f;

		public static float procCoefficient = 1f;

		public static float baseDuration = 0.65f;

		public static float throwForce = 80f;

		private float duration;

		private float fireTime;

		private bool hasFired;

		private Animator animator;

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
			if (!Object.op_Implicit((Object)(object)((EntityState)this).GetComponent<ReksaiBurrowController>()) || !((EntityState)this).GetComponent<ReksaiBurrowController>().burrowed)
			{
				((EntityState)this).outer.SetNextStateToMain();
				((EntityState)this).skillLocator.secondary.AddOneStock();
				return;
			}
			duration = baseDuration / ((BaseState)this).attackSpeedStat;
			fireTime = 0.35f * duration;
			animator = ((EntityState)this).GetModelAnimator();
			((EntityState)this).PlayAnimation("Body, Burrowed", "Seeker", "ThrowBomb.playbackRate", duration);
			((EntityState)this).characterBody.SetAimTimer(2f);
		}

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

		private void Fire()
		{
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			if (!hasFired)
			{
				hasFired = true;
				Util.PlaySound("RekSeeker", ((EntityState)this).gameObject);
				if (((EntityState)this).isAuthority)
				{
					Ray aimRay = ((BaseState)this).GetAimRay();
					ProjectileManager.instance.FireProjectile(Projectiles.seekerPrefab, ((Ray)(ref aimRay)).origin, Util.QuaternionSafeLookRotation(((Ray)(ref aimRay)).direction), ((EntityState)this).gameObject, damageCoefficient * ((BaseState)this).damageStat, 1000f, ((BaseState)this).RollCrit(), (DamageColorIndex)0, (GameObject)null, -1f);
				}
			}
		}

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

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return (InterruptPriority)2;
		}
	}
	public class Punch : BaseSkillState
	{
		public int swingIndex;

		public string hitboxName;

		protected DamageType damageType = (DamageType)0;

		protected float damageCoefficient = 4f;

		protected float procCoefficient = 1f;

		protected float pushForce = 2000f;

		protected Vector3 bonusForce = Vector3.zero;

		protected float baseDuration = 1f;

		protected float attackStartTime = 0.32f;

		protected float attackEndTime = 0.8f;

		protected float baseEarlyExitTime = 0f;

		protected float hitStopDuration = 0.012f;

		protected float attackRecoil = 0.75f;

		protected float hitHopVelocity = 4f;

		protected bool cancelled = false;

		protected float animDuration;

		protected string swingSoundString = "";

		protected string hitSoundString = "";

		private string muzzleString;

		private GameObject swingEffectPrefab;

		private GameObject hitEffectPrefab;

		protected NetworkSoundEventIndex impactSound;

		public static float punchDuration = 1.5f;

		public static float punchStart = 0.25f;

		public static float punchEnd = 0.4f;

		public static float punch3Duration = 1.5f;

		public static float punch3Start = 0.25f;

		public static float punch3End = 0.4f;

		public static Vector3 punch3Force = Vector3.up * 2000f;

		public float duration;

		private bool hasFired;

		private OverlapAttack attack;

		protected bool inHitPause;

		protected float stopwatch;

		protected Animator animator;

		public override void OnEnter()
		{
			//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0163: Unknown result type (might be due to invalid IL or missing references)
			//IL_0168: Unknown result type (might be due to invalid IL or missing references)
			//IL_0242: Unknown result type (might be due to invalid IL or missing references)
			//IL_024c: Expected O, but got Unknown
			//IL_0253: Unknown result type (might be due to invalid IL or missing references)
			//IL_0258: Unknown result type (might be due to invalid IL or missing references)
			//IL_0286: Unknown result type (might be due to invalid IL or missing references)
			//IL_028b: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0310: Unknown result type (might be due to invalid IL or missing references)
			//IL_0315: Unknown result type (might be due to invalid IL or missing references)
			((BaseState)this).OnEnter();
			hasFired = false;
			animator = ((EntityState)this).GetModelAnimator();
			((BaseState)this).StartAimMode(0.5f + duration, false);
			((EntityState)this).characterBody.outOfCombatStopwatch = 0f;
			animator.SetBool("attacking", true);
			swingEffectPrefab = Assets.reksaiAttackEffect;
			Random random = new Random();
			int num = random.Next(1, 5);
			switch (num)
			{
			case 1:
				duration = punchDuration;
				attackStartTime = punchStart;
				attackEndTime = punchEnd;
				hitboxName = "SwipeRight";
				break;
			case 2:
				duration = punch3Duration;
				attackStartTime = punch3Start;
				attackEndTime = punch3End;
				pushForce = 0f;
				bonusForce = punch3Force;
				hitboxName = "Uppercut";
				break;
			case 3:
				duration = punchDuration;
				attackStartTime = punchStart;
				attackEndTime = punchEnd;
				hitboxName = "SwipeLeft";
				break;
			case 4:
				duration = punch3Duration;
				attackStartTime = punch3Start;
				attackEndTime = punch3End;
				pushForce = 0f;
				bonusForce = punch3Force;
				hitboxName = "Uppercut";
				break;
			default:
				duration = punchDuration;
				attackStartTime = punchStart;
				attackEndTime = punchEnd;
				hitboxName = "SwipeRight";
				break;
			}
			muzzleString = "Attack" + num;
			((EntityState)this).PlayCrossfade("Body", "Attack" + num, "Slash.playbackRate", 0.8f, 0.05f);
			Util.PlaySound("RekAttackVoice", ((EntityState)this).gameObject);
			swingSoundString = "RekSwing";
			hitSoundString = "RekHit";
			HitBoxGroup hitBoxGroup = null;
			Transform modelTransform = ((EntityState)this).GetModelTransform();
			if (Object.op_Implicit((Object)(object)modelTransform))
			{
				hitBoxGroup = Array.Find(((Component)modelTransform).GetComponents<HitBoxGroup>(), (HitBoxGroup element) => element.groupName == hitboxName);
			}
			attack = new OverlapAttack();
			attack.damageType = damageType;
			attack.attacker = ((EntityState)this).gameObject;
			attack.inflictor = ((EntityState)this).gameObject;
			attack.teamIndex = ((BaseState)this).GetTeam();
			attack.damage = damageCoefficient * ((BaseState)this).damageStat;
			attack.procCoefficient = procCoefficient;
			attack.hitEffectPrefab = hitEffectPrefab;
			attack.forceVector = bonusForce;
			attack.pushAwayForce = pushForce;
			attack.hitBoxGroup = hitBoxGroup;
			attack.isCrit = ((BaseState)this).RollCrit();
			attack.impactSound = impactSound;
		}

		protected virtual void PlayAttackAnimation()
		{
		}

		public override void OnExit()
		{
			((EntityState)this).OnExit();
			if (Object.op_Implicit((Object)(object)animator))
			{
				animator.SetBool("attacking", false);
			}
		}

		protected virtual void PlaySwingEffect()
		{
			EffectManager.SimpleMuzzleFlash(swingEffectPrefab, ((EntityState)this).gameObject, muzzleString, true);
		}

		protected virtual void OnHitEnemyAuthority()
		{
			Util.PlaySound(hitSoundString, ((EntityState)this).gameObject);
		}

		private void FireAttack()
		{
			if (!hasFired)
			{
				hasFired = true;
				Util.PlayAttackSpeedSound(swingSoundString, ((EntityState)this).gameObject, ((BaseState)this).attackSpeedStat);
				if (((EntityState)this).isAuthority)
				{
					PlaySwingEffect();
					((BaseState)this).AddRecoil(-1f * attackRecoil, -2f * attackRecoil, -0.5f * attackRecoil, 0.5f * attackRecoil);
				}
			}
			if (((EntityState)this).isAuthority && attack.Fire((List<HurtBox>)null))
			{
				OnHitEnemyAuthority();
			}
		}

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			stopwatch += Time.fixedDeltaTime;
			if (stopwatch >= duration * attackStartTime && stopwatch <= duration * attackEndTime)
			{
				FireAttack();
			}
			if (stopwatch >= duration && ((EntityState)this).isAuthority)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return (InterruptPriority)4;
		}

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

		public override void OnDeserialize(NetworkReader reader)
		{
			((BaseSkillState)this).OnDeserialize(reader);
			swingIndex = reader.ReadInt32();
		}
	}
	public class SpawnState : BaseSkillState
	{
		private Transform muzzleTransform;

		public GameObject yellEffect;

		private bool a;

		private bool b;

		public float yellEffectTime = 1.7f;

		public float yellEndTime = 3f;

		public static float effectRadius = 10f;

		public float duration = 5f;

		public float yellTime = 1f;

		public bool yell;

		public override void OnEnter()
		{
			//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d9: Expected O, but got Unknown
			((BaseState)this).OnEnter();
			duration = 5f;
			if (Object.op_Implicit((Object)(object)((EntityState)this).modelLocator))
			{
				ChildLocator component = ((Component)((EntityState)this).modelLocator.modelTransform).GetComponent<ChildLocator>();
				if (Object.op_Implicit((Object)(object)component))
				{
					muzzleTransform = component.FindChild("Mouth");
				}
			}
			Random random = new Random();
			((EntityState)this).PlayAnimation("Body", "Spawn" + random.Next(1, 4), "Spawn.playbackRate", duration);
			Util.PlaySound("RekUnburrow", ((EntityState)this).gameObject);
			Util.PlaySound("RekUnburrowVoice", ((EntityState)this).gameObject);
			EffectManager.SpawnEffect(Assets.reksaiUnburrowEffect, new EffectData
			{
				origin = ((EntityState)this).transform.position,
				scale = effectRadius
			}, true);
		}

		public override void FixedUpdate()
		{
			//IL_00f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fb: 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_0147: 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_0169: Unknown result type (might be due to invalid IL or missing references)
			//IL_0198: Unknown result type (might be due to invalid IL or missing references)
			//IL_019d: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ba: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)this).FixedUpdate();
			if (!yell && ((EntityState)this).fixedAge >= yellTime)
			{
				Util.PlaySound("RekSpawnVoice", ((EntityState)this).gameObject);
				yell = true;
			}
			if (!a && ((EntityState)this).fixedAge >= yellEffectTime)
			{
				yellEffect = Object.Instantiate<GameObject>(Assets.reksaiYellEffect, muzzleTransform);
				yellEffect.AddComponent<DestroyOnParticleEnd>();
				ShakeEmitter val = yellEffect.AddComponent<ShakeEmitter>();
				val.duration = yellEndTime - yellEffectTime;
				val.radius = 200f;
				val.wave.amplitude = 0.6f;
				val.wave.frequency = 200f;
				MainModule main = ((Component)yellEffect.gameObject.transform.Find("Breath")).gameObject.GetComponent<ParticleSystem>().main;
				((MainModule)(ref main)).duration = yellEndTime - yellEffectTime;
				((MainModule)(ref main)).startDelay = MinMaxCurve.op_Implicit(0f);
				main = ((Component)yellEffect.gameObject.transform.Find("Spit")).gameObject.GetComponent<ParticleSystem>().main;
				((MainModule)(ref main)).duration = yellEndTime - yellEffectTime;
				((MainModule)(ref main)).startDelay = MinMaxCurve.op_Implicit(0f);
				main = ((Component)yellEffect.gameObject.transform.Find("SoundWaves")).gameObject.GetComponent<ParticleSystem>().main;
				((MainModule)(ref main)).duration = yellEndTime - yellEffectTime;
				((MainModule)(ref main)).startDelay = MinMaxCurve.op_Implicit(0f);
				a = true;
			}
			if (!b && ((EntityState)this).fixedAge >= yellEndTime && Object.op_Implicit((Object)(object)yellEffect))
			{
				b = true;
			}
			if (((EntityState)this).fixedAge >= 6f && ((EntityState)this).isAuthority)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		public override void OnExit()
		{
			((EntityState)this).OnExit();
			if (Object.op_Implicit((Object)(object)yellEffect))
			{
				EntityState.Destroy((Object)(object)yellEffect);
			}
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return (InterruptPriority)6;
		}
	}
	public class Special : BaseSkillState
	{
		public static float damageCoefficient = 16f;

		public static float procCoefficient = 1f;

		public static float baseDuration = 6f;

		public static float throwForce = 80f;

		public static float speedCoefficient = 4f;

		public static float forceExitDistance = 35f;

		public static float effectRadius = 10f;

		private ReksaiSpecialTracker tracker;

		private float duration;

		private float burrowTime;

		private bool playSound;

		private Animator animator;

		private HurtBox target;

		private Vector3 previousTargetPosition;

		private bool targetIsValid;

		private bool targetIsLost;

		private Transform muzzleTransform;

		private bool burrowEffect;

		private bool b;

		private float y = 0.18f;

		private float du = 1.1f;

		public override void OnEnter()
		{
			//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ce: Expected O, but got Unknown
			//IL_00da: 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_00e1: 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_0109: Expected O, but got Unknown
			//IL_013b: 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)
			((BaseState)this).OnEnter();
			if (!((EntityState)this).GetComponent<ReksaiBurrowController>().burrowed)
			{
				((EntityState)this).outer.SetNextStateToMain();
				((EntityState)this).skillLocator.special.AddOneStock();
				return;
			}
			duration = baseDuration;
			burrowTime = 0.35f * duration;
			animator = ((EntityState)this).GetModelAnimator();
			tracker = ((EntityState)this).GetComponent<ReksaiSpecialTracker>();
			target = tracker.GetTrackingTarget();
			((EntityState)this).characterBody.SetAimTimer(2f);
			((BaseState)this).StartAimMode(2f, false);
			if (Object.op_Implicit((Object)(object)((EntityState)this).GetComponent<ReksaiBurrowController>()))
			{
				((EntityState)this).GetComponent<ReksaiBurrowController>().SetBurrowFalse();
			}
			if (Object.op_Implicit((Object)((EntityState)this).characterBody))
			{
				CharacterBody characterBody = ((EntityState)this).characterBody;
				characterBody.bodyFlags = (BodyFlags)(characterBody.bodyFlags | 1);
			}
			if (Object.op_Implicit((Object)(object)target) && Object.op_Implicit((Object)target.healthComponent) && target.healthComponent.alive)
			{
				targetIsValid = true;
				((EntityState)this).characterDirection.forward = ((Component)target).transform.position - ((EntityState)this).transform.position;
			}
			if (Object.op_Implicit((Object)(object)((EntityState)this).modelLocator))
			{
				ChildLocator component = ((Component)((EntityState)this).modelLocator.modelTransform).GetComponent<ChildLocator>();
				if (Object.op_Implicit((Object)(object)component))
				{
					muzzleTransform = component.FindChild("Mouth");
				}
			}
			animator.SetLayerWeight(animator.GetLayerIndex("Body, Burrowed"), 0f);
			Util.PlaySound("RekUltVoice", ((EntityState)this).gameObject);
			((EntityState)this).PlayAnimation("Body", "Special", "ThrowBomb.playbackRate", duration);
		}

		public override void OnExit()
		{
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)this).OnExit();
			CharacterBody characterBody = ((EntityState)this).characterBody;
			characterBody.bodyFlags = (BodyFlags)(characterBody.bodyFlags & -2);
		}

		public override void FixedUpdate()
		{
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_0115: Unknown result type (might be due to invalid IL or missing references)
			//IL_011a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0131: Unknown result type (might be due to invalid IL or missing references)
			//IL_015c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0161: Unknown result type (might be due to invalid IL or missing references)
			//IL_0178: Unknown result type (might be due to invalid IL or missing references)
			//IL_019c: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a6: Expected O, but got Unknown
			//IL_01e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_0291: Unknown result type (might be due to invalid IL or missing references)
			//IL_0296: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_02cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0276: Unknown result type (might be due to invalid IL or missing references)
			//IL_027b: Unknown result type (might be due to invalid IL or missing references)
			//IL_03bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_03c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_035d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0362: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)this).FixedUpdate();
			if (!targetIsValid)
			{
				((EntityState)this).outer.SetNextStateToMain();
				return;
			}
			if (((EntityState)this).fixedAge >= y && !b)
			{
				b = true;
				GameObject val = Object.Instantiate<GameObject>(Assets.reksaiYellEffect, muzzleTransform);
				val.AddComponent<DestroyOnParticleEnd>();
				ShakeEmitter val2 = val.AddComponent<ShakeEmitter>();
				val2.duration = du;
				val2.radius = 200f;
				val2.wave.amplitude = 1.3f;
				val2.wave.frequency = 360f;
				MainModule main = ((Component)val.gameObject.transform.Find("Breath")).gameObject.GetComponent<ParticleSystem>().main;
				((MainModule)(ref main)).duration = du;
				((MainModule)(ref main)).startDelay = MinMaxCurve.op_Implicit(0f);
				main = ((Component)val.gameObject.transform.Find("Spit")).gameObject.GetComponent<ParticleSystem>().main;
				((MainModule)(ref main)).duration = du;
				((MainModule)(ref main)).startDelay = MinMaxCurve.op_Implicit(0f);
				main = ((Component)val.gameObject.transform.Find("SoundWaves")).gameObject.GetComponent<ParticleSystem>().main;
				((MainModule)(ref main)).duration = du;
				((MainModule)(ref main)).startDelay = MinMaxCurve.op_Implicit(0f);
			}
			if (!Object.op_Implicit((Object)(object)target) || !Object.op_Implicit((Object)target.healthComponent) || !target.healthComponent.alive)
			{
				targetIsLost = true;
			}
			Vector3 val3 = (targetIsLost ? previousTargetPosition : ((Component)target).transform.position);
			Vector3 val4 = val3 - ((EntityState)this).transform.position;
			if (((EntityState)this).fixedAge >= burrowTime * 0.7f && !playSound)
			{
				Util.PlaySound("RekBurrow", ((EntityState)this).gameObject);
				playSound = true;
			}
			if (((EntityState)this).fixedAge >= burrowTime)
			{
				if (!burrowEffect)
				{
					EffectManager.SimpleEffect(Assets.reksaiBurrowEffect, ((EntityState)this).transform.position, Quaternion.identity, true);
					burrowEffect = true;
				}
				Vector3 normalized = ((Vector3)(ref val4)).normalized;
				normalized.y = 0f;
				CharacterMotor characterMotor = ((EntityState)this).characterMotor;
				characterMotor.rootMotion += ((BaseState)this).moveSpeedStat * normalized * speedCoefficient * Time.fixedDeltaTime;
			}
			if (((Vector3)(ref val4)).magnitude <= forceExitDistance && ((EntityState)this).fixedAge >= burrowTime && ((EntityState)this).isAuthority)
			{
				if (targetIsValid && !targetIsLost)
				{
					((EntityState)this).outer.SetNextState((EntityState)(object)new SpecialOut
					{
						target = target
					});
				}
				else if (targetIsLost)
				{
					((EntityState)this).outer.SetNextState((EntityState)(object)new SpecialOut
					{
						targetPosition = previousTargetPosition
					});
				}
			}
			else if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority)
			{
				((EntityState)this).outer.SetNextState((EntityState)(object)new SpecialOut());
			}
			else if (!targetIsLost)
			{
				previousTargetPosition = ((Component)target).transform.position;
			}
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return (InterruptPriority)2;
		}
	}
	public class SpecialOut : BaseSkillState
	{
		public static float damageCoefficient = 16f;

		public static float procCoefficient = 1f;

		public static float baseDuration = 1f;

		public static float throwForce = 80f;

		public static float speedCoefficient = 3.35f;

		public float seekTime = 0.1f;

		private ReksaiSpecialTracker specialTracker;

		public string hitboxName = "Special";

		private OverlapAttack attack;

		protected DamageType damageType = (DamageType)0;

		protected float pushForce = 2000f;

		protected Vector3 bonusForce = Vector3.zero;

		protected float attackStartTime = 0.625f;

		protected float attackEndTime = 0.75f;

		protected string swingSoundString = "";

		protected string hitSoundString = "";

		protected string muzzleString = "SwingCenter";

		protected GameObject swingEffectPrefab;

		protected GameObject hitEffectPrefab;

		protected NetworkSoundEventIndex impactSound;

		private float duration;

		private float fireTime;

		private bool hasFired;

		private bool hit;

		private Animator animator;

		private Vector3 lockedDirection;

		public HurtBox target;

		public Vector3 targetPosition;

		private bool locked;

		public override void OnEnter()
		{
			//IL_009c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0106: Expected O, but got Unknown
			//IL_010d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0112: Unknown result type (might be due to invalid IL or missing references)
			//IL_0140: Unknown result type (might be due to invalid IL or missing references)
			//IL_0145: 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_01c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_0203: Unknown result type (might be due to invalid IL or missing references)
			//IL_0208: Unknown result type (might be due to invalid IL or missing references)
			//IL_020c: Unknown result type (might be due to invalid IL or missing references)
			((BaseState)this).OnEnter();
			duration = baseDuration;
			fireTime = 0.5f * duration;
			animator = ((EntityState)this).GetModelAnimator();
			((EntityState)this).PlayCrossfade("Body", "Emerge", "ThrowBomb.playbackRate", duration, 0.05f);
			((EntityState)this).characterBody.SetAimTimer(2f);
			specialTracker = ((EntityState)this).GetComponent<ReksaiSpecialTracker>();
			Util.PlaySound("RekUnburrow", ((EntityState)this).gameObject);
			Util.PlaySound("RekUnburrowVoice", ((EntityState)this).gameObject);
			EffectManager.SimpleEffect(Assets.reksaiBurrowEffect, ((EntityState)this).transform.position, Quaternion.identity, true);
			swingEffectPrefab = Assets.reksaiSpecialEffect;
			swingSoundString = "RekSwing";
			hitSoundString = "RekHit";
			HitBoxGroup hitBoxGroup = null;
			Transform modelTransform = ((EntityState)this).GetModelTransform();
			if (Object.op_Implicit((Object)(object)modelTransform))
			{
				hitBoxGroup = Array.Find(((Component)modelTransform).GetComponents<HitBoxGroup>(), (HitBoxGroup element) => element.groupName == hitboxName);
			}
			attack = new OverlapAttack();
			attack.damageType = damageType;
			attack.attacker = ((EntityState)this).gameObject;
			attack.inflictor = ((EntityState)this).gameObject;
			attack.teamIndex = ((BaseState)this).GetTeam();
			attack.damage = damageCoefficient * ((BaseState)this).damageStat;
			attack.procCoefficient = procCoefficient;
			attack.hitEffectPrefab = hitEffectPrefab;
			attack.forceVector = bonusForce;
			attack.pushAwayForce = pushForce;
			attack.hitBoxGroup = hitBoxGroup;
			attack.isCrit = ((BaseState)this).RollCrit();
			attack.impactSound = impactSound;
			if (Object.op_Implicit((Object)(object)target))
			{
				CharacterDirection characterDirection = ((EntityState)this).characterDirection;
				Vector3 val = ((Component)target).transform.position - ((EntityState)this).transform.position;
				characterDirection.forward = ((Vector3)(ref val)).normalized;
			}
		}

		public override void OnExit()
		{
			if (Object.op_Implicit((Object)(object)specialTracker) && Object.op_Implicit((Object)(object)specialTracker.GetTrackingTarget()))
			{
				specialTracker.trackingTarget = null;
			}
			((EntityState)this).OnExit();
		}

		public override void FixedUpdate()
		{
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: 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_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: 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_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_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_00a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_00c2: 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_0132: 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_013e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0148: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_00e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)this).FixedUpdate();
			if (Object.op_Implicit((Object)(object)target))
			{
				targetPosition = ((Component)target).transform.position;
			}
			_ = targetPosition;
			Vector3 val = ((!(targetPosition != Vector3.zero)) ? ((EntityState)this).inputBank.aimDirection : (targetPosition - ((EntityState)this).transform.position));
			if (((EntityState)this).fixedAge <= seekTime * duration)
			{
				Vector3 normalized = ((Vector3)(ref val)).normalized;
				CharacterMotor characterMotor = ((EntityState)this).characterMotor;
				characterMotor.rootMotion += ((BaseState)this).moveSpeedStat * normalized * speedCoefficient * Time.fixedDeltaTime;
			}
			else
			{
				if (!locked)
				{
					lockedDirection = ((Vector3)(ref val)).normalized;
					locked = true;
				}
				float num = Mathf.Lerp(speedCoefficient, 1f, (((EntityState)this).fixedAge - fireTime) / (duration - fireTime));
				CharacterMotor characterMotor2 = ((EntityState)this).characterMotor;
				characterMotor2.rootMotion += ((BaseState)this).moveSpeedStat * lockedDirection * num * Time.fixedDeltaTime;
			}
			if (((EntityState)this).fixedAge >= fireTime && !hit)
			{
				hit = true;
				((EntityState)this).PlayCrossfade("Body", "Hit", "ThrowBomb.playbackRate", duration, 0.05f);
			}
			if (((EntityState)this).fixedAge >= duration * attackStartTime && ((EntityState)this).fixedAge <= duration * attackEndTime)
			{
				Fire();
			}
			if (((EntityState)this).fixedAge >= duration + 0.5f && ((EntityState)this).isAuthority)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		private void Fire()
		{
			if (!hasFired)
			{
				hasFired = true;
				Util.PlayAttackSpeedSound(swingSoundString, ((EntityState)this).gameObject, ((BaseState)this).attackSpeedStat);
				if (((EntityState)this).isAuthority)
				{
					EffectManager.SimpleMuzzleFlash(swingEffectPrefab, ((EntityState)this).gameObject, "SpecialRight", true);
					EffectManager.SimpleMuzzleFlash(swingEffectPrefab, ((EntityState)this).gameObject, "SpecialLeft", true);
				}
			}
			if (((EntityState)this).isAuthority && attack.Fire((List<HurtBox>)null))
			{
				Util.PlaySound(hitSoundString, ((EntityState)this).gameObject);
			}
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return (InterruptPriority)2;
		}
	}
	public class Unburrow : BaseSkillState
	{
		public int swingIndex;

		public string hitboxName = "Unburrow";

		public static float effectRadius = 13f;

		protected DamageType damageType = (DamageType)0;

		protected float damageCoefficient = 4f;

		protected float procCoefficient = 1f;

		protected float pushForce = 1000f;

		protected Vector3 bonusForce = Vector3.up * 3750f;

		protected float baseDuration = 1f;

		protected float attackStartTime = 0.1f;

		protected float attackEndTime = 0.3f;

		protected bool cancelled = false;

		protected float animDuration;

		protected string swingSoundString = "";

		protected string hitSoundString = "";

		protected string muzzleString = "SwingCenter";

		protected GameObject swingEffectPrefab;

		protected GameObject hitEffectPrefab;

		protected NetworkSoundEventIndex impactSound;

		public float duration;

		private bool hasFired;

		private OverlapAttack attack;

		protected bool inHitPause;

		protected float stopwatch;

		protected Animator animator;

		public override void OnEnter()
		{
			//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0105: Expected O, but got Unknown
			//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_013f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0144: Unknown result type (might be due to invalid IL or missing references)
			//IL_018a: Unknown result type (might be due to invalid IL or missing references)
			//IL_018f: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ce: Unknown result type (might be due to invalid IL or missing references)
			((BaseState)this).OnEnter();
			duration = baseDuration / ((BaseState)this).attackSpeedStat;
			hasFired = false;
			animator = ((EntityState)this).GetModelAnimator();
			animator.SetBool("attacking", true);
			swingEffectPrefab = Assets.reksaiUnburrowEffect;
			((EntityState)this).PlayCrossfade("Body", "Unburrow", "Slash.playbackRate", 0.8f, 0.05f);
			((EntityState)this).PlayCrossfade("Body, Burrowed", "Unburrow", "Slash.playbackRate", 0.8f, 0.05f);
			Util.PlaySound("RekUnburrowVoice", ((EntityState)this).gameObject);
			swingSoundString = "RekUnburrow";
			hitSoundString = "";
			muzzleString = "";
			hitEffectPrefab = Resources.Load<GameObject>("prefabs/effects/impacteffects/BeetleGuardSunderPop");
			HitBoxGroup hitBoxGroup = null;
			Transform modelTransform = ((EntityState)this).GetModelTransform();
			if (Object.op_Implicit((Object)(object)modelTransform))
			{
				hitBoxGroup = Array.Find(((Component)modelTransform).GetComponents<HitBoxGroup>(), (HitBoxGroup element) => element.groupName == hitboxName);
			}
			attack = new OverlapAttack();
			attack.damageType = damageType;
			attack.attacker = ((EntityState)this).gameObject;
			attack.inflictor = ((EntityState)this).gameObject;
			attack.teamIndex = ((BaseState)this).GetTeam();
			attack.damage = damageCoefficient * ((BaseState)this).damageStat;
			attack.procCoefficient = procCoefficient;
			attack.hitEffectPrefab = hitEffectPrefab;
			attack.forceVector = bonusForce;
			attack.pushAwayForce = pushForce;
			attack.hitBoxGroup = hitBoxGroup;
			attack.isCrit = ((BaseState)this).RollCrit();
			attack.impactSound = impactSound;
		}

		public override void OnExit()
		{
			((EntityState)this).OnExit();
			ReksaiBurrowController component = ((EntityState)this).GetComponent<ReksaiBurrowController>();
			if (Object.op_Implicit((Object)(object)component))
			{
				((EntityState)this).GetComponent<ReksaiBurrowController>().Unburrow();
			}
			animator.SetBool("attacking", false);
		}

		private void FireAttack()
		{
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			if (!hasFired)
			{
				hasFired = true;
				Util.PlayAttackSpeedSound(swingSoundString, ((EntityState)this).gameObject, ((BaseState)this).attackSpeedStat);
				if (((EntityState)this).isAuthority)
				{
					EffectManager.SimpleEffect(Assets.reksaiUnburrowEffect, ((EntityState)this).transform.position, Quaternion.identity, true);
				}
			}
			if (((EntityState)this).isAuthority && attack.Fire((List<HurtBox>)null))
			{
				Util.PlaySound(hitSoundString, ((EntityState)this).gameObject);
			}
		}

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			stopwatch += Time.fixedDeltaTime;
			if (stopwatch >= duration * attackStartTime && stopwatch <= duration * attackEndTime)
			{
				FireAttack();
			}
			if (stopwatch >= duration && ((EntityState)this).isAuthority)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return (InterruptPriority)4;
		}
	}
}
namespace RiftTitansMod.SkillStates.Herald
{
	public class Attack : BaseSkillState
	{
		public int swingIndex;

		public string hitboxName;

		protected DamageType damageType = (DamageType)0;

		protected float damageCoefficient = 2.5f;

		protected float procCoefficient = 1f;

		protected float pushForce = 3000f;

		protected Vector3 bonusForce = Vector3.zero;

		protected float baseDuration = 1f;

		protected float attackStartTime = 0.43f;

		protected float attackEndTime = 0.6f;

		protected bool cancelled = false;

		protected float animDuration;

		protected string swingSoundString = "";

		protected string hitSoundString = "";

		private string muzzleString;

		private GameObject swingEffectPrefab;

		private GameObject hitEffectPrefab;

		protected NetworkSoundEventIndex impactSound;

		public static Vector3 punch3Force = Vector3.up * 2000f;

		public float duration;

		private bool hasFired;

		private OverlapAttack attack;

		protected float stopwatch;

		protected Animator animator;

		public override void OnEnter()
		{
			//IL_012b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0135: Expected O, but got Unknown
			//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_016f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0174: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fe: Unknown result type (might be due to invalid IL or missing references)
			((BaseState)this).OnEnter();
			hasFired = false;
			animator = ((EntityState)this).GetModelAnimator();
			((BaseState)this).StartAimMode(0.5f + duration, false);
			((EntityState)this).characterBody.outOfCombatStopwatch = 0f;
			animator.SetBool("attacking", true);
			duration = baseDuration / ((BaseState)this).attackSpeedStat;
			swingEffectPrefab = null;
			Random random = new Random();
			int num = random.Next(1, 3);
			muzzleString = "Attack" + num;
			((EntityState)this).PlayCrossfade("Body", "Attack" + num, "Slash.playbackRate", 0.8f, 0.05f);
			hitboxName = "Attack" + num;
			Util.PlaySound("HeraldSwing", ((EntityState)this).gameObject);
			swingSoundString = "RekSwing";
			hitSoundString = "HeraldHit";
			HitBoxGroup hitBoxGroup = null;
			Transform modelTransform = ((EntityState)this).GetModelTransform();
			if (Object.op_Implicit((Object)(object)modelTransform))
			{
				hitBoxGroup = Array.Find(((Component)modelTransform).GetComponents<HitBoxGroup>(), (HitBoxGroup element) => element.groupName == hitboxName);
			}
			attack = new OverlapAttack();
			attack.damageType = damageType;
			attack.attacker = ((EntityState)this).gameObject;
			attack.inflictor = ((EntityState)this).gameObject;
			attack.teamIndex = ((BaseState)this).GetTeam();
			attack.damage = damageCoefficient * ((BaseState)this).damageStat;
			attack.procCoefficient = procCoefficient;
			attack.hitEffectPrefab = hitEffectPrefab;
			attack.forceVector = bonusForce;
			attack.pushAwayForce = pushForce;
			attack.hitBoxGroup = hitBoxGroup;
			attack.isCrit = ((BaseState)this).RollCrit();
			attack.impactSound = impactSound;
		}

		public override void OnExit()
		{
			((EntityState)this).OnExit();
			if (Object.op_Implicit((Object)(object)animator))
			{
				animator.SetBool("attacking", false);
			}
		}

		protected virtual void PlaySwingEffect()
		{
		}

		protected virtual void OnHitEnemyAuthority()
		{
			Util.PlaySound(hitSoundString, ((EntityState)this).gameObject);
		}

		private void FireAttack()
		{
			if (!hasFired)
			{
				hasFired = true;
				Util.PlayAttackSpeedSound(swingSoundString, ((EntityState)this).gameObject, ((BaseState)this).attackSpeedStat);
				if (((EntityState)this).isAuthority)
				{
					PlaySwingEffect();
				}
			}
			if (((EntityState)this).isAuthority && attack.Fire((List<HurtBox>)null))
			{
				OnHitEnemyAuthority();
			}
		}

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			stopwatch += Time.fixedDeltaTime;
			if (stopwatch >= duration * attackStartTime && stopwatch <= duration * attackEndTime)
			{
				FireAttack();
			}
			if (stopwatch >= duration && ((EntityState)this).isAuthority)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return (InterruptPriority)4;
		}

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

		public override void OnDeserialize(NetworkReader reader)
		{
			((BaseSkillState)this).OnDeserialize(reader);
			swingIndex = reader.ReadInt32();
		}
	}
	public class Charge : BaseSkillState
	{
		public float baseWindupTime = 2.2f;

		private float windupTime;

		private float stopwatch;

		public float turningSpeed = 0.3f;

		public float baseDuration = 1.2f;

		public static float chargeDamageCoefficient = 3f;

		public static float awayForceMagnitude = 3500f;

		public static float upwardForceMagnitude = 2500f;

		public static GameObject impactEffectPrefab;

		public static string impactSoundString;

		public static string startSoundString;

		public static string endSoundString;

		public static GameObject knockbackEffectPrefab;

		public static float knockbackDamageCoefficient;

		public static float knockbackForce;

		public GameObject startEffectPrefab;

		public GameObject endEffectPrefab;

		private float duration;

		private Vector3 targetMoveVector;

		private Vector3 targetMoveVectorVelocity;

		public static float turnSmoothTime = 0.01f;

		public static float turnSpeed = 60f;

		public static float chargeMovementSpeedCoefficient = 4f;

		private string baseFootstepString;

		private OverlapAttack attack;

		private List<HurtBox> victimsStruck = new List<HurtBox>();

		public override void OnEnter()
		{
			//IL_002c: 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_00f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0103: Expected O, but got Unknown
			//IL_012c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0131: Unknown result type (might be due to invalid IL or missing references)
			//IL_0163: Unknown result type (might be due to invalid IL or missing references)
			//IL_016d: 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)
			((BaseState)this).OnEnter();
			windupTime = baseWindupTime;
			duration = baseDuration;
			((EntityState)this).characterDirection.forward = ((EntityState)this).inputBank.aimDirection;
			if (Object.op_Implicit((Object)(object)((EntityState)this).modelLocator))
			{
				((EntityState)this).modelLocator.normalizeToFloor = true;
			}
			if (!Object.op_Implicit((Object)(object)startEffectPrefab) || Object.op_Implicit((Object)((EntityState)this).characterBody))
			{
			}
			Transform modelTransform = ((EntityState)this).GetModelTransform();
			FootstepHandler component = ((Component)modelTransform).gameObject.GetComponent<FootstepHandler>();
			if (Object.op_Implicit((Object)(object)component))
			{
				baseFootstepString = component.baseFootstepString;
				component.baseFootstepString = "Play_titanboss_step";
			}
			HitBoxGroup hitBoxGroup = null;
			Transform modelTransform2 = ((EntityState)this).GetModelTransform();
			if (Object.op_Implicit((Object)(object)modelTransform2))
			{
				hitBoxGroup = Array.Find(((Component)modelTransform2).GetComponents<HitBoxGroup>(), (HitBoxGroup element) => element.groupName == "Charge");
			}
			attack = new OverlapAttack();
			attack.attacker = ((EntityState)this).gameObject;
			attack.inflictor = ((EntityState)this).gameObject;
			attack.teamIndex = ((BaseState)this).GetTeam();
			attack.damage = chargeDamageCoefficient * ((BaseState)this).damageStat;
			attack.hitEffectPrefab = impactEffectPrefab;
			attack.forceVector = Vector3.up * upwardForceMagnitude;
			attack.pushAwayForce = awayForceMagnitude;
			attack.hitBoxGroup = hitBoxGroup;
			attack.isCrit = ((BaseState)this).RollCrit();
			((EntityState)this).PlayCrossfade("Body", "DashStart", 0.1f);
			Util.PlaySound("HeraldChargeStart", ((EntityState)this).gameObject);
		}

		public override void OnExit()
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Expected O, but got Unknown
			//IL_0078: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: Expected O, but got Unknown
			//IL_0090: Unknown result type (might be due to invalid IL or missing references)
			//IL_009a: Unknown result type (might be due to invalid IL or missing references)
			if (Object.op_Implicit((Object)((EntityState)this).characterBody))
			{
				if (((EntityState)this).outer.destroying || Object.op_Implicit((Object)(object)endEffectPrefab))
				{
				}
				((EntityState)this).characterBody.isSprinting = false;
			}
			Transform modelTransform = ((EntityState)this).GetModelTransform();
			FootstepHandler component = ((Component)modelTransform).gameObject.GetComponent<FootstepHandler>();
			if (Object.op_Implicit((Object)(object)component))
			{
				component.baseFootstepString = baseFootstepString;
			}
			if (Object.op_Implicit((Object)((EntityState)this).characterMotor))
			{
				CharacterMotor characterMotor = ((EntityState)this).characterMotor;
				characterMotor.moveDirection /= 6f;
			}
			if (Object.op_Implicit((Object)(object)((EntityState)this).modelLocator))
			{
				((EntityState)this).modelLocator.normalizeToFloor = false;
			}
			((EntityState)this).OnExit();
		}

		public override void FixedUpdate()
		{
			//IL_0087: Unknown result type (might be due to invalid IL or missing references)
			//IL_0091: Expected O, but got Unknown
			//IL_00a8: 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_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_00d7: 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_00ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f1: 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_0108: Unknown result type (might be due to invalid IL or missing references)
			//IL_010e: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)this).FixedUpdate();
			if (!(((EntityState)this).fixedAge > windupTime))
			{
				return;
			}
			stopwatch += Time.fixedDeltaTime;
			if (stopwatch >= duration)
			{
				((EntityState)this).outer.SetNextState((EntityState)(object)new ChargeCrash());
				((EntityState)this).PlayAnimation("Body", "DashHit");
			}
			else if (((EntityState)this).isAuthority)
			{
				if (Object.op_Implicit((Object)((EntityState)this).characterBody))
				{
					((EntityState)this).characterBody.isSprinting = true;
				}
				Vector3 val = Vector3.ProjectOnPlane(Vector3.SmoothDamp(targetMoveVector, ((EntityState)this).inputBank.aimDirection, ref targetMoveVectorVelocity, turnSmoothTime, turnSpeed), Vector3.up);
				targetMoveVector = ((Vector3)(ref val)).normalized;
				((EntityState)this).characterDirection.moveVector = targetMoveVector;
				Vector3 forward = ((EntityState)this).characterDirection.forward;
				((EntityState)this).characterMotor.moveDirection = forward * chargeMovementSpeedCoefficient;
				attack.damage = ((BaseState)this).damageStat * chargeDamageCoefficient;
				if (attack.Fire(victimsStruck))
				{
					((EntityState)this).outer.SetNextState((EntityState)(object)new ChargeCrash());
				}
			}
		}

		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)4;
		}
	}
	public class ChargeCrash : BaseSkillState
	{
		public int swingIndex;

		public string hitboxName;

		protected DamageType damageType = (DamageType)0;

		public static float damageCoefficient = 6f;

		public static float procCoefficient = 1f;

		public static float blastRadius = 15f;

		protected float pushForce = 2000f;

		protected Vector3 bonusForce = Vector3.up * 2000f;

		protected float baseDuration = 2f;

		protected float attackStartTime = 0.3f;

		private float radius;

		protected string swingSoundString = "";

		protected string hitSoundString = "";

		private string muzzleString;

		private Transform muzzleTransform;

		private GameObject swingEffectPrefab;

		private GameObject hitEffectPrefab;

		public float duration;

		private bool hasFired;

		protected float stopwatch;

		protected Animator animator;

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
			hasFired = false;
			animator = ((EntityState)this).GetModelAnimator();
			swingEffectPrefab = Assets.heraldCrashEffect;
			radius = blastRadius;
			duration = baseDuration / ((BaseState)this).attackSpeedStat;
			if (Object.op_Implicit((Object)(object)((EntityState)this).modelLocator))
			{
				ChildLocator component = ((Component)((EntityState)this).modelLocator.modelTransform).GetComponent<ChildLocator>();
				if (Object.op_Implicit((Object)(object)component))
				{
					muzzleTransform = component.FindChild("Crash");
				}
			}
			((EntityState)this).PlayCrossfade("Body", "DashHit", "Slash.playbackRate", 0.8f, 0.05f);
			Util.PlaySound("HeraldChargeEnd", ((EntityState)this).gameObject);
		}

		protected virtual void PlayAttackAnimation()
		{
		}

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

		protected virtual void PlaySwingEffect()
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			EffectManager.SimpleEffect(Assets.heraldSlamEffect, ((EntityState)this).transform.position, Quaternion.identity, true);
		}

		private void FireAttack()
		{
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: Expected O, but got Unknown
			//IL_0057: 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_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: Unknown result type (might be due to invalid IL or missing references)
			//IL_008f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0094: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b8: 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_00d5: 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_00e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0106: Unknown result type (might be due to invalid IL or missing references)
			if (!hasFired)
			{
				hasFired = true;
				Util.PlaySound("HeraldSlam", ((EntityState)this).gameObject);
				if (((EntityState)this).isAuthority)
				{
					PlaySwingEffect();
					BlastAttack val = new BlastAttack();
					val.attacker = ((EntityState)this).gameObject;
					val.procChainMask = default(ProcChainMask);
					val.impactEffect = (EffectIndex)(-1);
					val.losType = (LoSType)1;
					val.damageColorIndex = (DamageColorIndex)0;
					val.damageType = (DamageType)0;
					val.procCoefficient = procCoefficient;
					val.bonusForce = Vector3.up * 3000f;
					val.baseForce = 300f;
					val.baseDamage = damageCoefficient * ((BaseState)this).damageStat;
					val.falloffModel = (FalloffModel)1;
					val.radius = radius;
					val.position = muzzleTransform.position;
					val.attackerFiltering = (AttackerFiltering)2;
					val.teamIndex = ((BaseState)this).GetTeam();
					val.inflictor = ((EntityState)this).gameObject;
					val.crit = ((BaseState)this).RollCrit();
					val.Fire();
				}
			}
		}

		public override void FixedUpdate()
		{
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_0060: Unknown result type (might be due to invalid IL or missing references)
			//IL_0065: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)this).FixedUpdate();
			stopwatch += Time.fixedDeltaTime;
			if (stopwatch >= duration * attackStartTime)
			{
				FireAttack();
				((EntityState)this).characterMotor.moveDirection = Vector3.zero;
				CharacterMotor characterMotor = ((EntityState)this).characterMotor;
				characterMotor.velocity /= 5f;
			}
			if (stopwatch >= duration && ((EntityState)this).isAuthority)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return (InterruptPriority)4;
		}
	}
	public class DeathState : GenericCharacterDeath
	{
		private bool a;

		private float s = 0.7f;

		public static GameObject initialEffect;

		public static float initialEffectScale;

		public static float velocityMagnitude;

		public static float explosionForce;

		public override void OnEnter()
		{
			((GenericCharacterDeath)this).OnEnter();
			Transform modelTransform = ((EntityState)this).GetModelTransform();
			((EntityState)this).PlayAnimation("Death", "Death", "Spawn.playbackRate", SpawnState.duration);
			Util.PlaySound("HeraldDeathStart", ((EntityState)this).gameObject);
		}

		public override void PlayDeathSound()
		{
		}

		public override void FixedUpdate()
		{
			((GenericCharacterDeath)this).FixedUpdate();
			if (!a && ((EntityState)this).fixedAge >= s)
			{
				a = true;
				Util.PlaySound("HeraldDeath", ((EntityState)this).gameObject);
			}
			if (NetworkServer.active && ((EntityState)this).fixedAge > 1f)
			{
				((GenericCharacterDeath)this).DestroyBodyAsapServer();
			}
		}

		public override void OnExit()
		{
			((GenericCharacterDeath)this).OnExit();
		}
	}
	public class SpawnState : BaseSkillState
	{
		private bool a;

		protected float sound = 0.9f;

		private bool b;

		protected float effect = 0.4f;

		protected GameObject spawnEffect = Assets.heraldCrashEffect;

		public static float duration = 3f;

		public static string spawnSoundString;

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
			((EntityState)this).PlayAnimation("Body", "Spawn", "Spawn.playbackRate", duration);
		}

		public override void FixedUpdate()
		{
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)this).FixedUpdate();
			if (((EntityState)this).fixedAge >= sound && !a)
			{
				a = true;
				Util.PlaySound("HeraldSpawn", ((EntityState)this).gameObject);
			}
			if (((EntityState)this).fixedAge >= effect && !b)
			{
				b = true;
				Util.PlaySound("RekUnburrow", ((EntityState)this).gameObject);
				EffectManager.SimpleEffect(Assets.heraldCrashEffect, ((EntityState)this).transform.position, Quaternion.identity, true);
			}
			if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return (InterruptPriority)6;
		}
	}
	public class Sweep : BaseSkillState
	{
		public int swingIndex;

		public string hitboxName;

		public float radius = 13f;

		protected DamageType damageType = (DamageType)0;

		protected float damageCoefficient = 6f;

		protected float procCoefficient = 1f;

		protected float pushForce = 3000f;

		protected Vector3 bonusForce = Vector3.up * 2000f;

		protected float baseDuration = 3f;

		private float slamTime = 0.6f;

		protected float attackStartTime = 0.6f;

		protected float attackEndTime = 0.7f;

		protected bool cancelled = false;

		protected float animDuration;

		protected string swingSoundString = "";

		protected string hitSoundString = "";

		private string muzzleString;

		private GameObject swingEffectPrefab;

		private GameObject hitEffectPrefab;

		protected NetworkSoundEventIndex impactSound;

		private Transform muzzleTransform;

		public float duration;

		private bool hasFired;

		private OverlapAttack attack;

		protected float stopwatch;

		protected Animator animator;

		private bool blast;

		private bool a;

		private float s1 = 0.6f;

		private bool b;

		private float s2 = 0.8f;

		public override void OnEnter()
		{
			//IL_0136: Unknown result type (might be due to invalid IL or missing references)
			//IL_0140: Expected O, but got Unknown
			//IL_0147: 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_017a: Unknown result type (might be due to invalid IL or missing references)
			//IL_017f: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_0204: Unknown result type (might be due to invalid IL or missing references)
			//IL_0209: Unknown result type (might be due to invalid IL or missing references)
			((BaseState)this).OnEnter();
			hasFired = false;
			animator = ((EntityState)this).GetModelAnimator();
			((BaseState)this).StartAimMode(0.5f + duration, false);
			animator.SetBool("attacking", true);
			duration = baseDuration / ((BaseState)this).attackSpeedStat;
			swingEffectPrefab = Assets.reksaiAttackEffect;
			Random random = new Random();
			muzzleString = "Sweep";
			((EntityState)this).PlayCrossfade("Body", "SwingPunch", "Slash.playbackRate", 0.8f, 0.05f);
			hitboxName = "Sweep";
			Util.PlaySound("HeraldSweep", ((EntityState)this).gameObject);
			swingSoundString = "RekSwing";
			hitSoundString = "RekHit";
			if (Object.op_Implicit((Object)(object)((EntityState)this).modelLocator))
			{
				ChildLocator component = ((Component)((EntityState)this).modelLocator.modelTransform).GetComponent<ChildLocator>();
				if (Object.op_Implicit((Object)(object)component))
				{
					muzzleTransform = component.FindChild("Slam");
				}
			}
			HitBoxGroup hitBoxGroup = null;
			Transform modelTransform = ((EntityState)this).GetModelTransform();
			if (Object.op_Implicit((Object)(object)modelTransform))
			{
				hitBoxGroup = Array.Find(((Component)modelTransform).GetComponents<HitBoxGroup>(), (HitBoxGroup element) => element.groupName == hitboxName);
			}
			attack = new OverlapAttack();
			attack.damageType = damageType;
			attack.attacker = ((EntityState)this).gameObject;
			attack.inflictor = ((EntityState)this).gameObject;
			attack.teamIndex = ((BaseState)this).GetTeam();
			attack.damage = damageCoefficient * ((BaseState)this).damageStat;
			attack.procCoefficient = procCoefficient;
			attack.hitEffectPrefab = hitEffectPrefab;
			attack.forceVector = bonusForce;
			attack.pushAwayForce = pushForce;
			attack.hitBoxGroup = hitBoxGroup;
			attack.isCrit = ((BaseState)this).RollCrit();
			attack.impactSound = impactSound;
		}

		public override void OnExit()
		{
			((EntityState)this).OnExit();
			if (Object.op_Implicit((Object)(object)animator))
			{
				animator.SetBool("attacking", false);
			}
		}

		protected virtual void PlaySwingEffect()
		{
		}

		protected virtual void OnHitEnemyAuthority()
		{
			Util.PlaySound(hitSoundString, ((EntityState)this).gameObject);
		}

		private void Fire()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Expected O, but got Unknown
			//IL_004d: 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_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0063: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: 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_008b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: 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_00d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00db: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fe: Unknown result type (might be due to invalid IL or missing references)
			if (!blast)
			{
				blast = true;
				EffectManager.SimpleEffect(Assets.heraldSlamEffect, muzzleTransform.position, Quaternion.identity, true);
				BlastAttack val = new BlastAttack();
				val.attacker = ((EntityState)this).gameObject;
				val.procChainMask = default(ProcChainMask);
				val.impactEffect = (EffectIndex)(-1);
				val.losType = (LoSType)1;
				val.damageColorIndex = (DamageColorIndex)0;
				val.damageType = (DamageType)0;
				val.procCoefficient = procCoefficient;
				val.bonusForce = Vector3.up * 1500f;
				val.baseForce = 1500f;
				val.baseDamage = damageCoefficient * ((BaseState)this).damageStat;
				val.falloffModel = (FalloffModel)1;
				val.radius = radius;
				val.position = muzzleTransform.position;
				val.attackerFiltering = (AttackerFiltering)2;
				val.teamIndex = ((BaseState)this).GetTeam();
				val.inflictor = ((EntityState)this).gameObject;
				val.crit = ((BaseState)this).RollCrit();
				val.Fire();
			}
		}

		private void FireAttack()
		{
			if (!hasFired)
			{
				hasFired = true;
				Util.PlaySound("HeraldSlam", ((EntityState)this).gameObject);
				if (((EntityState)this).isAuthority)
				{
					PlaySwingEffect();
				}
			}
			if (((EntityState)this).isAuthority && attack.Fire((List<HurtBox>)null))
			{
				OnHitEnemyAuthority();
			}
		}

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			if (((EntityState)this).fixedAge >= s1 && a)
			{
				a = true;
				Util.PlaySound("HeraldSweep", ((EntityState)this).gameObject);
			}
			if (((EntityState)this).fixedAge >= s2 && b)
			{
				b = true;
				Util.PlaySound("HeraldSwing", ((EntityState)this).gameObject);
			}
			stopwatch += Time.fixedDeltaTime;
			if (stopwatch >= duration * attackStartTime && stopwatch <= duration * attackEndTime)
			{
				FireAttack();
			}
			if (stopwatch >= duration * slamTime)
			{
				Fire();
			}
			if (stopwatch >= duration && ((EntityState)this).isAuthority)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return (InterruptPriority)4;
		}

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

		public override void OnDeserialize(NetworkReader reader)
		{
			((BaseSkillState)this).OnDeserialize(reader);
			swingIndex = reader.ReadInt32();
		}
	}
}
namespace RiftTitansMod.SkillStates.Chicken
{
	public class DeathState : GenericCharacterDeath
	{
		public static float dropTime = 0.15f;

		public static GameObject initialEffect;

		public static float initialEffectScale;

		public static float velocityMagnitude;

		public static float explosionForce;

		public override void OnEnter()
		{
			((GenericCharacterDeath)this).OnEnter();
			Transform modelTransform = ((EntityState)this).GetModelTransform();
			((EntityState)this).PlayAnimation("Death", "Death", "Spawn.playbackRate", SpawnState.duration);
			Util.PlaySound("ChickenDeath", ((EntityState)this).gameObject);
		}

		public override void PlayDeathSound()
		{
		}

		public override void FixedUpdate()
		{
			((GenericCharacterDeath)this).FixedUpdate();
			if (NetworkServer.active && ((EntityState)this).fixedAge > 1f)
			{
				((GenericCharacterDeath)this).DestroyBodyAsapServer();
			}
		}

		public override void OnExit()
		{
			((GenericCharacterDeath)this).OnExit();
		}
	}
	public class Shoot : BaseSkillState
	{
		public static float damageCoefficient = 1f;

		public static float force = 200f;

		private bool hasFired;

		private float duration;

		private float fireTime = 0.5f;

		public static float baseDuration = 0.67f;

		public static GameObject chargeVfxPrefab;

		private GameObject chargeVfxInstance;

		public override void OnEnter()
		{
			//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)
			((BaseState)this).OnEnter();
			duration = baseDuration / ((BaseState)this).attackSpeedStat;
			fireTime = duration * 0.75f;
			((BaseState)this).StartAimMode(fireTime, false);
			((EntityState)this).GetModelAnimator();
			Random random = new Random();
			((EntityState)this).PlayCrossfade("Body", "Attack" + random.Next(1, 4), "Slash.playbackRate", 0.8f, 0.05f);
			Transform modelTransform = ((EntityState)this).GetModelTransform();
			Util.PlayAttackSpeedSound(ChargeFireball.attackString, ((EntityState)this).gameObject, ((BaseState)this).attackSpeedStat);
			if (!Object.op_Implicit((Object)(object)modelTransform))
			{
				return;
			}
			ChildLocator component = ((Component)modelTransform).GetComponent<ChildLocator>();
			if (Object.op_Implicit((Object)(object)component))
			{
				Transform val = component.FindChild("Mouth");
				if (Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)ChargeFireball.chargeVfxPrefab))
				{
					chargeVfxInstance = Object.Instantiate<GameObject>(ChargeFireball.chargeVfxPrefab, val.position, val.rotation);
					chargeVfxInstance.transform.parent = val;
				}
			}
		}

		private void Fire()
		{
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			//IL_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)
			if (!hasFired)
			{
				hasFired = true;
				Ray aimRay = ((BaseState)this).GetAimRay();
				Util.PlaySound("ChickenShoot", ((EntityState)this).gameObject);
				if (Object.op_Implicit((Object)(object)FireFireball.effectPrefab))
				{
					EffectManager.SimpleMuzzleFlash(FireFireball.effectPrefab, ((EntityState)this).gameObject, "Mouth", false);
				}
				if (((EntityState)this).isAuthority)
				{
					ProjectileManager.instance.FireProjectile(Projectiles.chickenProjectilePrefab, ((Ray)(ref aimRay)).origin, Util.QuaternionSafeLookRotation(((Ray)(ref aimRay)).direction), ((EntityState)this).gameObject, ((BaseState)this).damageStat * damageCoefficient, force, ((BaseState)this).RollCrit(), (DamageColorIndex)0, (GameObject)null, -1f);
				}
			}
		}

		public override void OnExit()
		{
			((EntityState)this).OnExit();
			if (Object.op_Implicit((Object)(object)chargeVfxInstance))
			{
				EntityState.Destroy((Object)(object)chargeVfxInstance);
			}
		}

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

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return (InterruptPriority)1;
		}
	}
	public class SpawnState : BaseSkillState
	{
		public static float duration = 3f;

		public static string spawnSoundString;

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
			((EntityState)this).PlayAnimation("Body", "Spawn", "Spawn.playbackRate", duration);
			Util.PlaySound("ChickenSpawn", ((EntityState)this).gameObject);
		}

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

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return (InterruptPriority)6;
		}
	}
}
namespace RiftTitansMod.SkillStates.Blue
{
	public class DeathState : GenericCharacterDeath
	{
		public static float dropTime = 0.15f;

		public static GameObject initialEffect;

		public static float initialEffectScale;

		public static float velocityMagnitude;

		public static float explosionForce;

		public override void OnEnter()
		{
			((GenericCharacterDeath)this).OnEnter();
			Transform modelTransform = ((EntityState)this).GetModelTransform();
			((EntityState)this).PlayAnimation("Death", "Death", "Spawn.playbackRate", SpawnState.duration);
			Util.PlaySound("BlueDeath", ((EntityState)this).gameObject);
		}

		public override void PlayDeathSound()
		{
		}

		public override void FixedUpdate()
		{
			((GenericCharacterDeath)this).FixedUpdate();
			if (NetworkServer.active && ((EntityState)this).fixedAge > 1f)
			{
				((GenericCharacterDeath)this).DestroyBodyAsapServer();
			}
		}

		public override void OnExit()
		{
			((GenericCharacterDeath)this).OnExit();
		}
	}
	public class Slam : BaseSkillState
	{
		public int swingIndex;

		public string hitboxName;

		protected DamageType damageType = (DamageType)0;

		public static float damageCoefficient = 5f;

		public static float procCoefficient = 1f;

		public static float blastRadius = 9f;

		protected float pushForce = 2000f;

		protected Vector3 bonusForce = Vector3.up * 2000f;

		protected float baseDuration = 1.5f;

		protected float attackStartTime = 0.4f;

		private float radius;

		protected string swingSoundString = "";

		protected string hitSoundString = "";

		private string muzzleString;

		private Transform muzzleTransform;

		private GameObject swingEffectPrefab;

		private GameObject hitEffectPrefab;

		public float duration;

		private bool hasFired;

		protected float stopwatch;

		protected Animator animator;

		public override void OnEnter()
		{
			//IL_0094: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
			((BaseState)this).OnEnter();
			hasFired = false;
			animator = ((EntityState)this).GetModelAnimator();
			((BaseState)this).StartAimMode(0.5f + duration, false);
			((EntityState)this).characterBody.outOfCombatStopwatch = 0f;
			animator.SetBool("attacking", true);
			swingEffectPrefab = Assets.blueSlamEffect;
			radius = blastRadius;
			duration = baseDuration / ((BaseState)this).attackSpeedStat;
			Random random = new Random();
			int num = random.Next(1, 4);
			if (num == 3)
			{
				bonusForce *= 2f;
				pushForce *= 2f;
				radius *= 1.5f;
			}
			muzzleString = "Slam" + num;
			if (Object.op_Implicit((Object)(object)((EntityState)this).modelLocator))
			{
				ChildLocator component = ((Component)((EntityState)this).modelLocator.modelTransform).GetComponent<ChildLocator>();
				if (Object.op_Implicit((Object)(object)component))
				{
					muzzleTransform = component.FindChild(muzzleString);
				}
			}
			Util.PlaySound("BlueSwing", ((EntityState)this).gameObject);
			((EntityState)this).PlayCrossfade("Body", "Attack" + num, "Slash.playbackRate", 0.8f, 0.05f);
		}

		protected virtual void PlayAttackAnimation()
		{
		}

		public override void OnExit()
		{
			((EntityState)this).OnExit();
			if (Object.op_Implicit((Object)(object)animator))
			{
				animator.SetBool("attacking", false);
			}
		}

		protected virtual void PlaySwingEffect()
		{
			EffectManager.SimpleMuzzleFlash(swingEffectPrefab, ((EntityState)this).gameObject, muzzleString, true);
		}

		private void FireAttack()
		{
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: Expected O, but got Unknown
			//IL_0057: 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_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: 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_0095: 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_00d1: 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_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_0107: Unknown result type (might be due to invalid IL or missing references)
			if (!hasFired)
			{
				hasFired = true;
				if (((EntityState)this).isAuthority)
				{
					PlaySwingEffect();
					Util.PlaySound("BlueHit", ((EntityState)this).gameObject);
					BlastAttack val = new BlastAttack();
					val.attacker = ((EntityState)this).gameObject;
					val.procChainMask = default(ProcChainMask);
					val.impactEffect = (EffectIndex)(-1);
					val.losType = (LoSType)1;
					val.damageColorIndex = (DamageColorIndex)0;
					val.damageType = (DamageType)0;
					val.procCoefficient = procCoefficient;
					val.bonusForce = Vector3.up * pushForce;
					val.baseForce = 1500f;
					val.baseDamage = damageCoefficient * ((BaseState)this).damageStat;
					val.falloffModel = (FalloffModel)1;
					val.radius = radius;
					val.position = muzzleTransform.position;
					val.attackerFiltering = (AttackerFiltering)2;
					val.teamIndex = ((BaseState)this).GetTeam();
					val.inflictor = ((EntityState)this).gameObject;
					val.crit = ((BaseState)this).RollCrit();
					val.Fire();
				}
			}
		}

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			stopwatch += Time.fixedDeltaTime;
			if (stopwatch >= duration * attackStartTime)
			{
				FireAttack();
			}
			if (stopwatch >= duration && ((EntityState)this).isAuthority)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return (InterruptPriority)4;
		}
	}
	public class SpawnState : BaseSkillState
	{
		private bool b;

		protected float effect = 1f;

		protected GameObject spawnEffect = Assets.blueSlamEffect;

		public static float duration = 5f;

		public static string spawnSoundString;

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
			((EntityState)this).PlayAnimation("Body", "Spawn", "Spawn.playbackRate", duration);
			Util.PlaySound("BlueSpawn", ((EntityState)this).gameObject);
		}

		public override void FixedUpdate()
		{
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)this).FixedUpdate();
			if (((EntityState)this).fixedAge >= effect && !b)
			{
				b = true;
				if (Object.op_Implicit((Object)(object)spawnEffect))
				{
					EffectManager.SimpleEffect(spawnEffect, ((EntityState)this).transform.position, Quaternion.identity, true);
				}
			}
			if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return (InterruptPriority)6;
		}
	}
}
namespace RiftTitansMod.SkillStates.BaseStates
{
	public class BaseMeleeAttack : BaseSkillState
	{
		public int swingIndex;

		protected string hitboxName = "Sword";

		protected DamageType damageType = (DamageType)0;

		protected float damageCoefficient = 3.5f;

		protected float procCoefficient = 1f;

		protected float pushForce = 300f;

		protected Vector3 bonusForce = Vector3.zero;

		protected float baseDuration = 1f;

		protected float attackStartTime = 0.2f;

		protected float attackEndTime = 0.4f;

		protected float baseEarlyExitTime = 0.4f;

		protected float hitStopDuration = 0.012f;

		protected float attackRecoil = 0.75f;

		protected float hitHopVelocity = 4f;

		protected bool cancelled = false;

		protected string swingSoundString = "";

		protected string hitSoundString = "";

		protected string muzzleString = "SwingCenter";

		protected GameObject swingEffectPrefab;

		protected GameObject hitEffectPrefab;

		protected NetworkSoundEventIndex impactSound;

		private float earlyExitTime;

		public float duration;

		private bool hasFired;

		private float hitPauseTimer;

		private OverlapAttack attack;

		protected bool inHitPause;

		private bool hasHopped;

		protected float stopwatch;

		protected Animator animator;

		private HitStopCachedState hitStopCachedState;

		private Vector3 storedVelocity;

		public override void OnEnter()
		{
			//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b6: Expected O, but got Unknown
			//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f0: 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_013b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0140: Unknown result type (might be due to invalid IL or missing references)
			//IL_017a: Unknown result type (might be due to invalid IL or missing references)
			//IL_017f: Unknown result type (might be due to invalid IL or missing references)
			((BaseState)this).OnEnter();
			duration = baseDuration / ((BaseState)this).attackSpeedStat;
			earlyExitTime = baseEarlyExitTime / ((BaseState)this).attackSpeedStat;
			hasFired = false;
			animator = ((EntityState)this).GetModelAnimator();
			((BaseState)this).StartAimMode(0.5f + duration, false);
			((EntityState)this).characterBody.outOfCombatStopwatch = 0f;
			animator.SetBool("attacking", true);
			HitBoxGroup hitBoxGroup = null;
			Transform modelTransform = ((EntityState)this).GetModelTransform();
			if (Object.op_Implicit((Object)(object)modelTransform))
			{
				hitBoxGroup = Array.Find(((Component)modelTransform).GetComponents<HitBoxGroup>(), (HitBoxGroup element) => element.groupName == hitboxName);
			}
			PlayAttackAnimation();
			attack = new OverlapAttack();
			attack.damageType = damageType;
			attack.attacker = ((EntityState)this).gameObject;
			attack.inflictor = ((EntityState)this).gameObject;
			attack.teamIndex = ((BaseState)this).GetTeam();
			attack.damage = damageCoefficient * ((BaseState)this).damageStat;
			attack.procCoefficient = procCoefficient;
			attack.hitEffectPrefab = hitEffectPrefab;
			attack.forceVector = bonusForce;
			attack.pushAwayForce = pushForce;
			attack.hitBoxGroup = hitBoxGroup;
			attack.isCrit = ((BaseState)this).RollCrit();
			attack.impactSound = impactSound;
		}

		protected virtual void PlayAttackAnimation()
		{
			((EntityState)this).PlayCrossfade("Gesture, Override", "Slash" + (1 + swingIndex), "Slash.playbackRate", duration, 0.05f);
		}

		public override void OnExit()
		{
			if (!hasFired && !cancelled)
			{
				FireAttack();
			}
			((EntityState)this).OnExit();
			animator.SetBool("attacking", false);
		}

		protected virtual void PlaySwingEffect()
		{
			EffectManager.SimpleMuzzleFlash(swingEffectPrefab, ((EntityState)this).gameObject, muzzleString, true);
		}

		protected virtual void OnHitEnemyAuthority()
		{
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Expected O, but got Unknown
			//IL_0095: Unknown result type (might be due to invalid IL or missing references)
			//IL_009a: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b2: 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)
			Util.PlaySound(hitSoundString, ((EntityState)this).gameObject);
			if (!hasHopped)
			{
				if (Object.op_Implicit((Object)((EntityState)this).characterMotor) && !((EntityState)this).characterMotor.isGrounded && hitHopVelocity > 0f)
				{
					((BaseState)this).SmallHop(((EntityState)this).characterMotor, hitHopVelocity);
				}
				hasHopped = true;
			}
			if (!inHitPause && hitStopDuration > 0f)
			{
				storedVelocity = ((EntityState)this).characterMotor.velocity;
				hitStopCachedState = ((BaseState)this).CreateHitStopCachedState(((EntityState)this).characterMotor, animator, "Slash.playbackRate");
				hitPauseTimer = hitStopDuration / ((BaseState)this).attackSpeedStat;
				inHitPause = true;
			}
		}

		private void FireAttack()
		{
			if (!hasFired)
			{
				hasFired = true;
				Util.PlayAttackSpeedSound(swingSoundString, ((EntityState)this).gameObject, ((BaseState)this).attackSpeedStat);
				if (((EntityState)this).isAuthority)
				{
					PlaySwingEffect();
					((BaseState)this).AddRecoil(-1f * attackRecoil, -2f * attackRecoil, -0.5f * attackRecoil, 0.5f * attackRecoil);
				}
			}
			if (((EntityState)this).isAuthority && attack.Fire((List<HurtBox>)null))
			{
				OnHitEnemyAuthority();
			}
		}

		protected virtual void SetNextState()
		{
			int num = ((swingIndex == 0) ? 1 : 0);
			((EntityState)this).outer.SetNextState((EntityState)(object)new BaseMeleeAttack
			{
				swingIndex = num
			});
		}

		public override void FixedUpdate()
		{
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_0091: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Expected O, but got Unknown
			//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)this).FixedUpdate();
			hitPauseTimer -= Time.fixedDeltaTime;
			if (hitPauseTimer <= 0f && inHitPause)
			{
				((BaseState)this).ConsumeHitStopCachedState(hitStopCachedState, ((EntityState)this).characterMotor, animator);
				inHitPause = false;
				((EntityState)this).characterMotor.velocity = storedVelocity;
			}
			if (!inHitPause)
			{
				stopwatch += Time.fixedDeltaTime;
			}
			else
			{
				if (Object.op_Implicit((Object)((EntityState)this).characterMotor))
				{
					((EntityState)this).characterMotor.velocity = Vector3.zero;
				}
				if (Object.op_Implicit((Object)(object)animator))
				{
					animator.SetFloat("Swing.playbackRate", 0f);
				}
			}
			if (stopwatch >= duration * attackStartTime && stopwatch <= duration * attackEndTime)
			{
				FireAttack();
			}
			if (stopwatch >= duration - earlyExitTime && ((EntityState)this).isAuthority && ((EntityState)this).inputBank.skill1.down)
			{
				if (!hasFired)
				{
					FireAttack();
				}
				SetNextState();
			}
			else if (stopwatch >= duration && ((EntityState)this).isAuthority)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return (InterruptPriority)1;
		}

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

		public override void OnDeserialize(NetworkReader reader)
		{
			((BaseSkillState)this).OnDeserialize(reader);
			swingIndex = reader.ReadInt32();
		}
	}
}
namespace RiftTitansMod.SkillStates.Baron
{
	public class DeathState : GenericCharacterDeath
	{
		private float duration = 4f;

		public s