Decompiled source of TF2SoldierModFIX v1.3.5

TF2SoldierMod.dll

Decompiled a day 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.Configuration;
using BepInEx.Logging;
using EntityStates;
using EntityStates.Commando.CommandoWeapon;
using HG;
using HG.BlendableTypes;
using Microsoft.CodeAnalysis;
using On.EntityStates;
using On.RoR2;
using R2API;
using R2API.Networking;
using R2API.Utils;
using RoR2;
using RoR2.Audio;
using RoR2.ContentManagement;
using RoR2.Projectile;
using RoR2.Skills;
using TF2SoldierMod.Components;
using TF2SoldierMod.Modules;
using TF2SoldierMod.Modules.Controllers;
using TF2SoldierMod.Modules.Survivors;
using TF2SoldierMod.SkillStates;
using TF2SoldierMod.SkillStates.Banners;
using TF2SoldierMod.SkillStates.BaseStates;
using TF2SoldierMod.SkillStates.TF2Soldier.ReloadStates;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.Networking;
using UnityEngine.Rendering;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: IgnoresAccessChecksTo("RoR2")]
[assembly: AssemblyCompany("TF2SoldierMod")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.3.5.0")]
[assembly: AssemblyInformationalVersion("1.3.5")]
[assembly: AssemblyProduct("TF2SoldierMod")]
[assembly: AssemblyTitle("TF2SoldierMod")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.3.5.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace TF2SoldierMod
{
	internal class SoldierMintTeaInfo
	{
		public CharacterMotor Motor { get; set; }

		public bool LeniencyFrame { get; set; }

		public bool GroundedJump { get; set; }
	}
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[NetworkCompatibility(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("com.Lemner.TF2SoldierMod", "TF2SoldierMod", "1.3.5")]
	public class TF2SoldierPlugin : BaseUnityPlugin
	{
		public const string MODUID = "com.Lemner.TF2SoldierMod";

		public const string MODNAME = "TF2SoldierMod";

		public const string MODVERSION = "1.3.5";

		public const string developerPrefix = "LEMN";

		public const string SoldierBodyNameToken = "LEMN_SOLDIERTF2_BODY_NAME";

		public const string TokenPrefix = "LEMN_SOLDIERTF2_BODY_";

		public static TF2SoldierPlugin instance;

		internal static ManualLogSource Log;

		public static ModdedDamageType ReserveShooterHit;

		public static ModdedDamageType DeathResistor;

		public static ModdedDamageType ZatoichiHit;

		public static ModdedDamageType BazookaHit;

		private readonly Dictionary<CharacterMotor, SoldierMintTeaInfo> info = new Dictionary<CharacterMotor, SoldierMintTeaInfo>();

		public static bool IsSoldier(CharacterBody body)
		{
			if (Object.op_Implicit((Object)(object)body))
			{
				return body.baseNameToken == "LEMN_SOLDIERTF2_BODY_NAME";
			}
			return false;
		}

		public static bool SkillIs(GenericSkill slot, string token)
		{
			if (Object.op_Implicit((Object)(object)slot) && Object.op_Implicit((Object)(object)slot.skillDef))
			{
				return slot.skillDef.skillNameToken == token;
			}
			return false;
		}

		private void Awake()
		{
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			instance = this;
			Log = ((BaseUnityPlugin)this).Logger;
			Assets.Initialize();
			Config.ReadConfig();
			Sounds.RegisterNetworkSounds();
			States.RegisterStates();
			Buffs.RegisterBuffs();
			Projectiles.RegisterProjectiles();
			Banners.RegisterBanners();
			Tokens.AddTokens();
			ItemDisplays.PopulateDisplays();
			ReserveShooterHit = DamageAPI.ReserveDamageType();
			DeathResistor = DamageAPI.ReserveDamageType();
			ZatoichiHit = DamageAPI.ReserveDamageType();
			BazookaHit = DamageAPI.ReserveDamageType();
			new Soldier().Initialize();
			new ContentPacks().Initialize();
			ContentManager.onContentPacksAssigned += LateSetup;
			Hook();
			LanguageAPI.Add("KEYWORD_MINICRIT", "<style=cKeywordName><style=cIsDamage>Mini Crit</style></style><style=cSub>Deals <style=cIsDamage>1.5x damage.</style><style=cIsUtility> Activates on-crit items.</style>\nDamage is overridden by regular critical strikes.</style>");
			LanguageAPI.Add("KEYWORD_OVERHEAL", "<style=cKeywordName><style=cIsHealing>Overheal</style></style><style=cSub>Healing recieved from this ability is instead <style=cIsHealing>applied as a barrier</style>, if your health is full.</style>");
			LanguageAPI.Add("KEYWORD_PASSIVEONLY", "<style=cKeywordName><style=cIsUtility>Passive Only</style></style><style=cSub>This ability cannot be directly used, and instead provides <style=cIsUtility>passive benefits.</style></style>");
			LanguageAPI.Add("KEYWORD_ROCKETJUMP", "<style=cKeywordName><style=cIsUtility>Rocket Jumping</style></style><style=cSub>The rockets from this ability <style=cIsUtility>push you back</style> when they explode near you.</style>");
			LanguageAPI.Add("KEYWORD_SELFDAMAGE", "<style=cKeywordName><style=cIsHealth>Self Damaging</style></style><style=cSub>The rockets from this ability damage you for up to <style=cIsHealth>35% of your current health</style> when they explode near you. This damage is <style=cIsUtility>non-lethal.</style></style>");
			LanguageAPI.Add("KEYWORD_DEATHRESIST", $"<style=cKeywordName><style=cIsUtility>Death Resist</style></style><style=cSub>Activated when you would have been killed. You <style=cIsUtility>cannot be lowered below 1 health by normal means.</style> Lasts {7.5f} seconds, and has a cooldown of {30f} seconds.</style>");
			LanguageAPI.Add("KEYWORD_LOADING", "<style=cKeywordName><style=cIsUtility>Loading</style></style><style=cSub>Holding the button down loads a rocket. Releasing fires all stored rockets. Attempting to load more than the maximum <style=cIsHealth>damages you</style> and <style=cIsUtility>pushes you backward.</style></style>");
			LanguageAPI.Add("KEYWORD_MOTIVATE", string.Format("<style=cKeywordName><style=cIsUtility>Motivation</style></style><style=cSub>Increases damage by {0}x, attack speed by {1}%, movement speed by {2}x, critical strike chance by {3}%, and grants {4} additional jump{5}.</style>", 1.25f, 50f, 1.5f, 30f, 1, ""));
			LanguageAPI.Add("KEYWORD_DUELING", $"<style=cKeywordName><style=cIsDamage>Dueling</style></style><style=cSub>Hitting an elite enemy with this ability has a <style=cIsUtility>{20f}% chance to steal their affix for {90f} seconds.</style>\nKilling an elite enemy with this ability <style=cIsUtility>steals their affix 100% of the time.</style>\nHitting an elite enemy sharing an affix with you with this ability <style=cIsDamage>does {5f}x damage and is a guaranteed critical strike</style>, with a <style=cIsDamage>{20f}% chance to execute them.</style></style>");
		}

		private void LateSetup(ReadOnlyArray<ReadOnlyContentPack> obj)
		{
			if (SurvivorBase.instance != null && Object.op_Implicit((Object)(object)SurvivorBase.instance.bodyPrefab) && Object.op_Implicit((Object)(object)SurvivorBase.instance.itemDisplayRuleSet))
			{
				SurvivorBase.instance.SetItemDisplays();
			}
		}

		private void Hook()
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Expected O, but got Unknown
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Expected O, but got Unknown
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Expected O, but got Unknown
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Expected O, but got Unknown
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Expected O, but got Unknown
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Expected O, but got Unknown
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: Expected O, but got Unknown
			//IL_009b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a5: Expected O, but got Unknown
			//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_00c7: Expected O, but got Unknown
			//IL_008a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0094: Expected O, but got Unknown
			CharacterBody.RecalculateStats += new hook_RecalculateStats(CharacterBody_RecalculateStats);
			CharacterMotor.OnLanded += new hook_OnLanded(CharacterMotor_OnLanded);
			HealthComponent.TakeDamage += new hook_TakeDamage(HealthComponent_TakeDamage);
			CharacterModel.Awake += new hook_Awake(CharacterModel_Awake);
			CharacterBody.OnBuffFirstStackGained += new hook_OnBuffFirstStackGained(CharacterBody_OnBuffFirstStackGained);
			CharacterBody.OnBuffFinalStackLost += new hook_OnBuffFinalStackLost(CharacterBody_OnBuffFinalStackLost);
			GlobalEventManager.OnCharacterHitGroundServer += new hook_OnCharacterHitGroundServer(GlobalEventManager_OnCharacterHitGroundServer);
			if (Config.autoJumpEnabled.Value)
			{
				GenericCharacterMain.GatherInputs += new hook_GatherInputs(GenericCharacterMain_GatherInputs);
			}
			GenericCharacterMain.ProcessJump += new hook_ProcessJump(GenericCharacterMain_ProcessJump);
			CharacterMotor.PreMove += new hook_PreMove(CharacterMotor_PreMove);
			GenericCharacterMain.ApplyJumpVelocity += new hook_ApplyJumpVelocity(GenericCharacterMain_ApplyJumpVelocity);
		}

		private void CharacterBody_RecalculateStats(orig_RecalculateStats orig, CharacterBody self)
		{
			orig.Invoke(self);
			if (Object.op_Implicit((Object)(object)self))
			{
				if (self.HasBuff(Buffs.conchBuff))
				{
					self.moveSpeed *= 1.5f;
				}
				if (self.HasBuff(Buffs.rocketJumpingBuff))
				{
					self.armor += 25f;
				}
				if (self.HasBuff(Buffs.buffBannerBuff))
				{
					self.attackSpeed *= 1.5f;
				}
				if (self.HasBuff(Buffs.battalionBuff))
				{
					self.armor += 200f;
				}
				if (self.HasBuff(Buffs.whipBuff))
				{
					self.moveSpeed *= 1.5f;
					self.attackSpeed += 0.5f;
					self.crit += 30f;
					self.maxJumpCount += 1;
					self.damage *= 1.25f;
				}
				int buffCount = self.GetBuffCount(Buffs.whipHeadBuff);
				if (buffCount > 0)
				{
					self.damage *= 1f + 0.25f * (float)buffCount;
				}
				if (self.HasBuff(Buffs.parachuteBuff))
				{
					self.damage *= 1.2f;
					self.attackSpeed *= 1.2f;
				}
			}
		}

		private static bool IsBannerStyleBuff(BuffDef buffDef)
		{
			if (!((Object)(object)buffDef == (Object)(object)Buffs.whipBuff) && !((Object)(object)buffDef == (Object)(object)Buffs.conchBuff) && !((Object)(object)buffDef == (Object)(object)Buffs.battalionBuff))
			{
				return (Object)(object)buffDef == (Object)(object)Buffs.buffBannerBuff;
			}
			return true;
		}

		private void CharacterBody_OnBuffFirstStackGained(orig_OnBuffFirstStackGained orig, CharacterBody self, BuffDef buffDef)
		{
			orig.Invoke(self, buffDef);
			if (IsBannerStyleBuff(buffDef))
			{
				Util.PlaySound("SpeedUpSound", ((Component)self).gameObject);
			}
			if ((Object)(object)buffDef == (Object)(object)Buffs.parachuteBuff)
			{
				SoldierBodyController.SetParachuteDeployed(self, deployed: true);
			}
		}

		private void CharacterBody_OnBuffFinalStackLost(orig_OnBuffFinalStackLost orig, CharacterBody self, BuffDef buffDef)
		{
			//IL_0094: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
			orig.Invoke(self, buffDef);
			if (IsBannerStyleBuff(buffDef))
			{
				Util.PlaySound("SpeedDownSound", ((Component)self).gameObject);
			}
			if ((Object)(object)buffDef == (Object)(object)Buffs.parachuteBuff)
			{
				SoldierBodyController.SetParachuteDeployed(self, deployed: false);
			}
			if (NetworkServer.active)
			{
				if ((Object)(object)buffDef == (Object)(object)Buffs.deathResistActive)
				{
					self.AddTimedBuff(Buffs.deathResistCooldown, 30f);
				}
				if (IsSoldier(self) && (Object)(object)buffDef == (Object)(object)Buffs.EliteVoid && Object.op_Implicit((Object)(object)self.inventory) && self.inventory.GetItemCount(Items.BearVoid) == 0)
				{
					self.SetBuffCount(Buffs.BearVoidReady.buffIndex, 0);
					self.SetBuffCount(Buffs.BearVoidCooldown.buffIndex, 0);
				}
			}
		}

		private void CharacterModel_Awake(orig_Awake orig, CharacterModel self)
		{
			orig.Invoke(self);
			if (((Object)((Component)self).gameObject).name.Contains("SoldierTF2Display"))
			{
				Util.PlaySound("MenuNoteSoldier", ((Component)self).gameObject);
			}
		}

		private void CharacterMotor_OnLanded(orig_OnLanded orig, CharacterMotor self)
		{
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0067: Unknown result type (might be due to invalid IL or missing references)
			orig.Invoke(self);
			if (Object.op_Implicit((Object)(object)self.body) && self.hasEffectiveAuthority)
			{
				if (self.body.HasBuff(Buffs.rocketJumpingBuff))
				{
					NetworkingHelpers.ApplyBuff(self.body, Buffs.rocketJumpingBuff.buffIndex, 0, -1f);
				}
				if (self.body.HasBuff(Buffs.parachuteBuff))
				{
					NetworkingHelpers.ApplyBuff(self.body, Buffs.parachuteBuff.buffIndex, 0, -1f);
				}
			}
		}

		private void GlobalEventManager_OnCharacterHitGroundServer(orig_OnCharacterHitGroundServer orig, GlobalEventManager self, CharacterBody characterBody, HitGroundInfo hitGroundInfo)
		{
			//IL_0003: 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_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c6: 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_00d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00de: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e4: 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)
			//IL_00eb: 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_00fb: 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)
			//IL_0111: Unknown result type (might be due to invalid IL or missing references)
			//IL_011f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0121: 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_012d: Unknown result type (might be due to invalid IL or missing references)
			//IL_012f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0134: Unknown result type (might be due to invalid IL or missing references)
			//IL_0136: 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_013c: Unknown result type (might be due to invalid IL or missing references)
			//IL_013d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0142: Unknown result type (might be due to invalid IL or missing references)
			//IL_0180: Unknown result type (might be due to invalid IL or missing references)
			//IL_0185: Unknown result type (might be due to invalid IL or missing references)
			//IL_0186: Unknown result type (might be due to invalid IL or missing references)
			//IL_0188: Unknown result type (might be due to invalid IL or missing references)
			//IL_0198: Expected O, but got Unknown
			orig.Invoke(self, characterBody, hitGroundInfo);
			if (!IsSoldier(characterBody) || !Object.op_Implicit((Object)(object)characterBody.skillLocator) || !SkillIs(characterBody.skillLocator.secondary, "LEMN_SOLDIERTF2_BODY_SECONDARY_MANNTREADS_NAME"))
			{
				return;
			}
			float num = Mathf.Abs(hitGroundInfo.velocity.y);
			ManualLogSource log = Log;
			if (log != null)
			{
				log.LogDebug((object)$"Mantreads landing: speed {num:F1} m/s (stomp at {30f}, max damage at {60f})");
			}
			if (num < 30f)
			{
				return;
			}
			float num2 = Mathf.Lerp(15f, 40f, Mathf.InverseLerp(30f, 60f, num));
			DamageTypeCombo damageType = DamageTypeCombo.op_Implicit((DamageType)0);
			damageType.damageSource = (DamageSource)2;
			Result val = new BlastAttack
			{
				attacker = ((Component)characterBody).gameObject,
				inflictor = ((Component)characterBody).gameObject,
				teamIndex = TeamComponent.GetObjectTeam(((Component)characterBody).gameObject),
				position = hitGroundInfo.position,
				procCoefficient = 1.5f,
				radius = Config.MantreadsStompRadius,
				baseForce = 0f,
				baseDamage = characterBody.damage * num2,
				falloffModel = (FalloffModel)0,
				crit = true,
				damageColorIndex = (DamageColorIndex)0,
				attackerFiltering = (AttackerFiltering)2,
				damageType = damageType
			}.Fire();
			Sounds.EmitServer(Sounds.mannTreadBoom, ((Component)characterBody).gameObject);
			if (val.hitCount > 0)
			{
				Sounds.EmitServer(Sounds.mannTreadSquish, ((Component)characterBody).gameObject);
				if (Object.op_Implicit((Object)(object)Assets.stompShakeEffect))
				{
					EffectManager.SpawnEffect(Assets.stompShakeEffect, new EffectData
					{
						origin = hitGroundInfo.position
					}, true);
				}
			}
		}

		private void HealthComponent_TakeDamage(orig_TakeDamage orig, HealthComponent self, DamageInfo damageInfo)
		{
			//IL_02bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0281: Unknown result type (might be due to invalid IL or missing references)
			//IL_0287: Unknown result type (might be due to invalid IL or missing references)
			//IL_028c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0292: Unknown result type (might be due to invalid IL or missing references)
			//IL_0297: Unknown result type (might be due to invalid IL or missing references)
			//IL_029c: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0124: Unknown result type (might be due to invalid IL or missing references)
			//IL_014f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_03e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_038f: Unknown result type (might be due to invalid IL or missing references)
			//IL_033e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0348: Unknown result type (might be due to invalid IL or missing references)
			//IL_041d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_0103: 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_0356: Unknown result type (might be due to invalid IL or missing references)
			//IL_0360: Unknown result type (might be due to invalid IL or missing references)
			//IL_0365: Unknown result type (might be due to invalid IL or missing references)
			//IL_036a: Unknown result type (might be due to invalid IL or missing references)
			//IL_04c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0494: Unknown result type (might be due to invalid IL or missing references)
			//IL_05d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_05af: Unknown result type (might be due to invalid IL or missing references)
			//IL_0560: Unknown result type (might be due to invalid IL or missing references)
			//IL_0566: Unknown result type (might be due to invalid IL or missing references)
			CharacterBody attackerBody = (Object.op_Implicit((Object)(object)damageInfo.attacker) ? damageInfo.attacker.GetComponent<CharacterBody>() : null);
			CharacterBody victimBody = (Object.op_Implicit((Object)(object)self) ? self.body : null);
			bool flag = false;
			if (Object.op_Implicit((Object)(object)attackerBody))
			{
				if (attackerBody.HasBuff(Buffs.buffBannerBuff) && !damageInfo.crit)
				{
					flag = true;
				}
				if (IsSoldier(attackerBody) && Object.op_Implicit((Object)(object)attackerBody.skillLocator) && SkillIs(attackerBody.skillLocator.secondary, "LEMN_SOLDIERTF2_BODY_SECONDARY_RESERVE_SHOOTER_NAME") && Object.op_Implicit((Object)(object)victimBody) && IsAirborne(victimBody) && DamageAPI.HasModdedDamageType(damageInfo, ReserveShooterHit))
				{
					if (!damageInfo.crit)
					{
						flag = true;
					}
					if (Util.CheckRoll(10f, attackerBody.master))
					{
						damageInfo.damageType |= DamageTypeCombo.op_Implicit((DamageType)1024);
					}
				}
				if (flag)
				{
					damageInfo.damage *= 1.5f;
					damageInfo.damageColorIndex = (DamageColorIndex)3;
					Sounds.EmitServer(Sounds.miniCrit, ((Component)attackerBody).gameObject);
				}
				if (Object.op_Implicit((Object)(object)victimBody) && DamageAPI.HasModdedDamageType(damageInfo, ZatoichiHit))
				{
					if (victimBody.isElite && Object.op_Implicit((Object)(object)attackerBody.master) && BuffCatalog.eliteBuffIndices.Any((BuffIndex elite) => victimBody.HasBuff(elite) && attackerBody.HasBuff(elite)))
					{
						if (Util.CheckRoll(20f, attackerBody.master.luck, (CharacterMaster)null))
						{
							damageInfo.damage = self.fullCombinedHealth;
						}
						else
						{
							damageInfo.damage *= 5f;
							damageInfo.crit = true;
							flag = false;
						}
					}
					HealWithOverheal(attackerBody, 0.05f);
					if (victimBody.isElite && Object.op_Implicit((Object)(object)attackerBody.master) && Util.CheckRoll(20f, attackerBody.master.luck, (CharacterMaster)null))
					{
						StealAffix(victimBody, attackerBody);
					}
				}
			}
			if (Object.op_Implicit((Object)(object)victimBody) && (victimBody.HasBuff(Buffs.deathResistActive) || (victimBody.HasBuff(Buffs.battalionBuff) && !victimBody.HasBuff(Buffs.deathResistCooldown))) && (damageInfo.damageType.damageType & 1) == 0)
			{
				damageInfo.damageType |= DamageTypeCombo.op_Implicit((DamageType)1);
				DamageAPI.AddModdedDamageType(damageInfo, DeathResistor);
			}
			if (IsSoldier(victimBody) && (damageInfo.damageType.damageType & 0x200000) != 0)
			{
				damageInfo.damage *= 0.6f;
			}
			CharacterBody val = (IsSoldier(attackerBody) ? attackerBody : null);
			KillGracePeriod killGracePeriod = null;
			if (Object.op_Implicit((Object)(object)val) && Config.killGracePeriod.Value > 0f)
			{
				killGracePeriod = ((Component)self).gameObject.GetComponent<KillGracePeriod>();
				if (!Object.op_Implicit((Object)(object)killGracePeriod))
				{
					killGracePeriod = ((Component)self).gameObject.AddComponent<KillGracePeriod>();
				}
				if (self.alive && (damageInfo.damageType.damageType & 0x10000000) == 0 && killGracePeriod.HasSkull(val))
				{
					damageInfo.damageType |= DamageTypeCombo.op_Implicit((DamageType)268435456);
				}
			}
			if (Object.op_Implicit((Object)(object)victimBody) && victimBody.HasBuff(Buffs.bazookaBurstDebuff) && DamageAPI.HasModdedDamageType(damageInfo, BazookaHit))
			{
				int buffCount = victimBody.GetBuffCount(Buffs.bazookaBurstDebuff);
				damageInfo.damage *= 1.5f + 0.5f * (float)(buffCount - 1);
			}
			orig.Invoke(self, damageInfo);
			if (Object.op_Implicit((Object)(object)victimBody) && DamageAPI.HasModdedDamageType(damageInfo, BazookaHit))
			{
				victimBody.AddTimedBuff(Buffs.bazookaBurstDebuff, 1f);
			}
			if (Object.op_Implicit((Object)(object)attackerBody) && Object.op_Implicit((Object)(object)victimBody) && DamageAPI.HasModdedDamageType(damageInfo, ZatoichiHit) && !self.alive)
			{
				if (victimBody.isElite)
				{
					StealAffix(victimBody, attackerBody);
				}
				HealWithOverheal(attackerBody, 0.4f);
			}
			if (Object.op_Implicit((Object)(object)killGracePeriod) && Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)val.master) && !damageInfo.rejected)
			{
				if (self.alive)
				{
					killGracePeriod.AddTimer(val, damageInfo.damageType.damageType);
				}
				else
				{
					killGracePeriod.TriggerEffects(val, victimBody);
				}
			}
			if (Object.op_Implicit((Object)(object)victimBody) && IsAirborne(victimBody) && DamageAPI.HasModdedDamageType(damageInfo, ReserveShooterHit) && !victimBody.HasBuff(Buffs.DeathMark))
			{
				victimBody.AddTimedBuff(Buffs.DeathMark, 5f);
			}
			if (Object.op_Implicit((Object)(object)attackerBody) && attackerBody.HasBuff(Buffs.conchBuff) && Object.op_Implicit((Object)(object)attackerBody.healthComponent) && (Object)(object)attackerBody.healthComponent != (Object)(object)self && !damageInfo.rejected)
			{
				attackerBody.healthComponent.Heal(damageInfo.damage * 0.2f, default(ProcChainMask), true);
			}
			if (flag && Object.op_Implicit((Object)(object)attackerBody) && Object.op_Implicit((Object)(object)attackerBody.master))
			{
				GlobalEventManager.instance.OnCrit(attackerBody, damageInfo, attackerBody.master, damageInfo.procCoefficient, damageInfo.procChainMask);
			}
			if (Object.op_Implicit((Object)(object)victimBody) && self.combinedHealth <= 1f && DamageAPI.HasModdedDamageType(damageInfo, DeathResistor) && !victimBody.HasBuff(Buffs.deathResistActive) && !victimBody.HasBuff(Buffs.deathResistCooldown))
			{
				victimBody.AddTimedBuff(Buffs.deathResistActive, 7.5f);
			}
		}

		private static bool IsAirborne(CharacterBody body)
		{
			if (!body.isFlying)
			{
				if (Object.op_Implicit((Object)(object)body.characterMotor))
				{
					return !body.characterMotor.isGrounded;
				}
				return false;
			}
			return true;
		}

		private static void HealWithOverheal(CharacterBody body, float fraction)
		{
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			if (Object.op_Implicit((Object)(object)body) && Object.op_Implicit((Object)(object)body.healthComponent))
			{
				HealthComponent healthComponent = body.healthComponent;
				float num = healthComponent.fullHealth - healthComponent.health;
				float num2 = healthComponent.fullHealth * fraction;
				float num3 = Mathf.Clamp(num2 - num, 0f, healthComponent.fullHealth);
				healthComponent.Heal(num2, default(ProcChainMask), true);
				if (num3 > 0f)
				{
					healthComponent.AddBarrierAuthority(num3 * 0.5f);
				}
			}
		}

		private static void StealAffix(CharacterBody victim, CharacterBody thief)
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			BuffIndex[] eliteBuffIndices = BuffCatalog.eliteBuffIndices;
			foreach (BuffIndex val in eliteBuffIndices)
			{
				if (victim.HasBuff(val))
				{
					if (!thief.HasBuff(val))
					{
						thief.AddTimedBuff(val, 90f);
					}
					break;
				}
			}
		}

		private void GenericCharacterMain_GatherInputs(orig_GatherInputs orig, GenericCharacterMain self)
		{
			orig.Invoke(self);
			if (IsSoldier(((EntityState)self).characterBody) && ((BaseCharacterMain)self).hasInputBank && Object.op_Implicit((Object)(object)((EntityState)self).inputBank))
			{
				CharacterMotor characterMotor = ((EntityState)self).characterMotor;
				if (Object.op_Implicit((Object)(object)characterMotor))
				{
					GetInfo(characterMotor).GroundedJump = ((EntityState)self).inputBank.jump.down;
				}
			}
		}

		private void GenericCharacterMain_ProcessJump(orig_ProcessJump orig, GenericCharacterMain self)
		{
			CharacterMotor characterMotor = ((EntityState)self).characterMotor;
			if (Object.op_Implicit((Object)(object)characterMotor) && characterMotor.isGrounded && IsSoldier(((EntityState)self).characterBody))
			{
				SoldierMintTeaInfo soldierMintTeaInfo = GetInfo(characterMotor);
				if (soldierMintTeaInfo != null && soldierMintTeaInfo.GroundedJump)
				{
					self.jumpInputReceived = true;
				}
			}
			orig.Invoke(self);
		}

		private void CharacterMotor_PreMove(orig_PreMove orig, CharacterMotor self, float deltaTime)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			Vector3 velocity = self.velocity;
			orig.Invoke(self, deltaTime);
			if (self.hasEffectiveAuthority && Object.op_Implicit((Object)(object)self.body) && self.body.isPlayerControlled && IsSoldier(self.body) && !self.body.HasBuff(Buffs.parachuteBuff))
			{
				self.velocity = velocity;
				PreMovementHandler(self, deltaTime);
			}
		}

		private void GenericCharacterMain_ApplyJumpVelocity(orig_ApplyJumpVelocity orig, CharacterMotor characterMotor, CharacterBody characterBody, float horizontalBonus, float verticalBonus, bool vault)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0069: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			Vector3 velocity = characterMotor.velocity;
			orig.Invoke(characterMotor, characterBody, horizontalBonus, verticalBonus, vault);
			if (!vault && IsSoldier(characterBody))
			{
				Vector3 velocity2 = characterMotor.velocity;
				Vector3 val = default(Vector3);
				((Vector3)(ref val))..ctor(velocity.x, 0f, velocity.z);
				Vector3 val2 = default(Vector3);
				((Vector3)(ref val2))..ctor(velocity2.x, 0f, velocity2.z);
				Vector3 val3 = ((((Vector3)(ref val)).sqrMagnitude > ((Vector3)(ref val2)).sqrMagnitude) ? val : val2);
				characterMotor.velocity = new Vector3(val3.x, velocity2.y, val3.z);
			}
		}

		private void PreMovementHandler(CharacterMotor self, float deltaTime)
		{
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			SoldierMintTeaInfo soldierMintTeaInfo = GetInfo(self);
			if (!self.isGrounded || soldierMintTeaInfo.LeniencyFrame)
			{
				AirMovementHandler(self, 3f, 30f);
			}
			else
			{
				GroundMovement(self, deltaTime);
			}
			if (self.useGravity)
			{
				self.velocity.y += Physics.gravity.y * deltaTime;
				if (self.isGrounded)
				{
					self.velocity.y = Mathf.Max(self.velocity.y, 0f);
				}
			}
			soldierMintTeaInfo.LeniencyFrame = !self.isGrounded;
		}

		private void AirMovementHandler(CharacterMotor characterMotor, float maximumAirAcceleration, float airAcceleration)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: 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_003f: 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_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_0078: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			Vector3 moveDirection = characterMotor.moveDirection;
			float num = ((((Vector3)(ref moveDirection)).sqrMagnitude > 0.0001f) ? characterMotor.walkSpeed : 0f);
			if (num > maximumAirAcceleration)
			{
				num = maximumAirAcceleration;
			}
			Vector3 velocity = characterMotor.velocity;
			velocity.y = 0f;
			float num2 = Vector3.Dot(velocity, ((Vector3)(ref moveDirection)).normalized);
			float num3 = num - num2;
			if (!(num3 <= 0f))
			{
				float num4 = airAcceleration * num;
				if (num4 > num3)
				{
					num4 = num3;
				}
				characterMotor.velocity += ((Vector3)(ref moveDirection)).normalized * num4;
			}
		}

		private void GroundMovement(CharacterMotor self, float deltaTime)
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_006f: Unknown result type (might be due to invalid IL or missing references)
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0091: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			float acceleration = self.acceleration;
			Vector3 val = self.moveDirection;
			if (!self.isFlying)
			{
				val.y = 0f;
			}
			CharacterBody body = self.body;
			if (Object.op_Implicit((Object)(object)body) && body.isSprinting && 0f < ((Vector3)(ref val)).magnitude && ((Vector3)(ref val)).magnitude < 1f)
			{
				val /= ((Vector3)(ref val)).magnitude;
			}
			Vector3 val2 = val * self.walkSpeed;
			if (!self.isFlying)
			{
				val2.y = self.velocity.y;
			}
			self.velocity = Vector3.MoveTowards(self.velocity, val2, acceleration * deltaTime);
		}

		private SoldierMintTeaInfo GetInfo(CharacterMotor characterMotor)
		{
			if (!Object.op_Implicit((Object)(object)characterMotor))
			{
				return null;
			}
			if (info.TryGetValue(characterMotor, out var value))
			{
				return value;
			}
			if (info.Count > 64)
			{
				foreach (CharacterMotor item in info.Keys.Where((CharacterMotor k) => !Object.op_Implicit((Object)(object)k)).ToList())
				{
					info.Remove(item);
				}
			}
			return info[characterMotor] = new SoldierMintTeaInfo
			{
				Motor = characterMotor,
				LeniencyFrame = false
			};
		}
	}
}
namespace TF2SoldierMod.SkillStates
{
	public class AirStrike : BaseSkillState
	{
		public static float baseDuration = 0.65f;

		private float duration;

		private float fireTime;

		private bool hasFired;

		private Animator animator;

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
			duration = baseDuration / ((BaseState)this).attackSpeedStat;
			if (((BaseState)this).HasBuff(Buffs.rocketJumpingBuff))
			{
				duration *= 0.4f;
			}
			fireTime = 0.1f * duration;
			((EntityState)this).characterBody.SetAimTimer(2f);
			animator = ((EntityState)this).GetModelAnimator();
			Helpers.SwapToPrimary(((EntityState)this).characterBody);
			animator.SetFloat("weaponIndex", 0f);
			Util.PlaySound("AirStrikeLaunchSound", ((EntityState)this).gameObject);
			((EntityState)this).PlayAnimation("PrimaryFire, Override", "FirePrimary", "ThrowBomb.playbackRate", duration, 0f);
		}

		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_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: 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_008a: 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_0090: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
			if (hasFired)
			{
				return;
			}
			hasFired = true;
			if (((EntityState)this).isAuthority)
			{
				Ray aimRay = ((BaseState)this).GetAimRay();
				Quaternion val = Util.QuaternionSafeLookRotation(((Ray)(ref aimRay)).direction);
				Projectiles.FireRocket(Projectiles.airStrikeRocketPrefab, ((Ray)(ref aimRay)).origin, val, ((EntityState)this).gameObject);
				if (Object.op_Implicit((Object)(object)((EntityState)this).characterBody.inventory) && ((EntityState)this).characterBody.inventory.GetItemCount(Items.MoreMissile) > 0)
				{
					Projectiles.FireRocket(Projectiles.icbmAirStrikeRocketPrefab, ((Ray)(ref aimRay)).origin, Quaternion.Euler(0f, 20f, 0f) * val, ((EntityState)this).gameObject);
					Projectiles.FireRocket(Projectiles.icbmAirStrikeRocketPrefab, ((Ray)(ref aimRay)).origin, Quaternion.Euler(0f, -20f, 0f) * val, ((EntityState)this).gameObject);
				}
			}
		}

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			if (((EntityState)this).fixedAge >= fireTime)
			{
				Fire();
			}
			if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority)
			{
				if (((EntityState)this).skillLocator.primary.stock < ((EntityState)this).skillLocator.primary.maxStock)
				{
					((EntityState)this).outer.SetNextState((EntityState)(object)new RocketReload());
				}
				else
				{
					((EntityState)this).outer.SetNextStateToMain();
				}
			}
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			return (InterruptPriority)2;
		}
	}
	public class BeggarsBazookaChargeUp : BaseSkillState
	{
		public static float baseDuration = 0.9f;

		public static int maxRockets = 3;

		public static float overloadForce = 5700f;

		private float duration;

		private float overloadDelayMax;

		private float overloadDelay;

		private int currentRockets;

		private bool isOverloading;

		private Animator animator;

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
			duration = baseDuration / ((BaseState)this).attackSpeedStat;
			overloadDelayMax = duration;
			((EntityState)this).characterBody.SetAimTimer(2f);
			animator = ((EntityState)this).GetModelAnimator();
			Helpers.SwapToPrimary(((EntityState)this).characterBody);
			animator.SetFloat("weaponIndex", 0f);
		}

		private int CalculateRocketCount()
		{
			return Mathf.FloorToInt(((EntityState)this).fixedAge / duration + duration * 4f / 5f);
		}

		private void PlayReloadAnimation()
		{
			Helpers.SwapToPrimary(((EntityState)this).characterBody);
			animator.SetFloat("weaponIndex", 0f);
			((EntityState)this).PlayAnimation("Reload", "soldier_model_skeleton_primary_reload", "Reload.playbackRate", duration * 2f, 0f);
		}

		private void LoadRocket()
		{
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			currentRockets++;
			Util.PlaySound("BeggarsReloadSound", ((EntityState)this).gameObject);
			if (((EntityState)this).isAuthority)
			{
				((EntityState)this).skillLocator.primary.DeductStock(1);
				NetworkingHelpers.ApplyBuff(((EntityState)this).characterBody, Buffs.bazookaLoadBuff.buffIndex, currentRockets, -1f);
			}
		}

		private void Overload()
		{
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0088: 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_0093: 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_0099: 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_00ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e1: 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_00ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0103: 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_010d: 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_011e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0137: Expected O, but got Unknown
			//IL_0142: Unknown result type (might be due to invalid IL or missing references)
			isOverloading = true;
			overloadDelay = overloadDelayMax;
			currentRockets = Mathf.Max(currentRockets - 1, 0);
			Util.PlaySound("RocketExplodeSound", ((EntityState)this).gameObject);
			Util.PlaySound("BeggarsReloadSound", ((EntityState)this).gameObject);
			if (((EntityState)this).isAuthority)
			{
				((EntityState)this).skillLocator.primary.AddOneStock();
				NetworkingHelpers.ApplyBuff(((EntityState)this).characterBody, Buffs.bazookaLoadBuff.buffIndex, currentRockets, -1f);
				Ray aimRay = ((BaseState)this).GetAimRay();
				Vector3 direction = ((Ray)(ref aimRay)).direction;
				Vector3 normalized = ((Vector3)(ref direction)).normalized;
				NetworkingHelpers.DealDamage(new DamageInfo
				{
					damage = ((EntityState)this).characterBody.healthComponent.combinedHealth * 0.15f,
					force = -normalized * overloadForce,
					position = ((EntityState)this).characterBody.corePosition,
					damageColorIndex = (DamageColorIndex)0,
					crit = false,
					attacker = null,
					inflictor = null,
					damageType = DamageTypeCombo.op_Implicit((DamageType)262211),
					procCoefficient = 0f,
					procChainMask = default(ProcChainMask)
				}, ((EntityState)this).characterBody.mainHurtBox, true, false, false);
				NetworkingHelpers.ApplyBuff(((EntityState)this).characterBody, Buffs.rocketJumpingBuff.buffIndex, 1, -1f);
			}
		}

		public override void FixedUpdate()
		{
			//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)this).FixedUpdate();
			int num = CalculateRocketCount();
			overloadDelay -= Time.fixedDeltaTime;
			if (num > currentRockets || isOverloading)
			{
				if ((currentRockets >= maxRockets || (isOverloading && currentRockets > 0)) && overloadDelay <= 0f)
				{
					PlayReloadAnimation();
					Overload();
				}
				else if (!isOverloading)
				{
					PlayReloadAnimation();
					LoadRocket();
				}
			}
			if (((EntityState)this).isAuthority)
			{
				if (((BaseState)this).isGrounded && ((EntityState)this).characterBody.HasBuff(Buffs.rocketJumpingBuff))
				{
					NetworkingHelpers.ApplyBuff(((EntityState)this).characterBody, Buffs.rocketJumpingBuff.buffIndex, 0, -1f);
				}
				if (!((BaseSkillState)this).IsKeyDownAuthority())
				{
					((EntityState)this).outer.SetNextState((EntityState)(object)new BeggarsBazookaFire
					{
						rockets = currentRockets
					});
				}
			}
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			return (InterruptPriority)2;
		}
	}
	public class BeggarsBazookaFire : BaseSkillState
	{
		public static float baseDuration = 0.65f;

		public int rockets;

		private float duration;

		private float rocketDelayMax;

		private float rocketDelay;

		private Animator animator;

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
			duration = baseDuration / ((BaseState)this).attackSpeedStat;
			rocketDelayMax = 0.3f / ((BaseState)this).attackSpeedStat;
			rocketDelay = 0f;
			((EntityState)this).characterBody.SetAimTimer(2f);
			animator = ((EntityState)this).GetModelAnimator();
			Helpers.SwapToPrimary(((EntityState)this).characterBody);
			animator.SetFloat("weaponIndex", 0f);
		}

		private void FireOne()
		{
			//IL_0080: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a9: 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_00b6: 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_00d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_011d: Unknown result type (might be due to invalid IL or missing references)
			//IL_014f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0154: Unknown result type (might be due to invalid IL or missing references)
			//IL_0155: Unknown result type (might be due to invalid IL or missing references)
			//IL_016c: Unknown result type (might be due to invalid IL or missing references)
			//IL_019e: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a4: Unknown result type (might be due to invalid IL or missing references)
			rockets--;
			rocketDelay = rocketDelayMax;
			Util.PlaySound("BeggarsLaunchSound", ((EntityState)this).gameObject);
			((EntityState)this).PlayAnimation("PrimaryFire, Override", "FirePrimary", "ThrowBomb.playbackRate", duration, 0f);
			if (((EntityState)this).isAuthority)
			{
				((EntityState)this).skillLocator.primary.AddOneStock();
				((EntityState)this).characterBody.SetSpreadBloom(3f, true);
				NetworkingHelpers.ApplyBuff(((EntityState)this).characterBody, Buffs.bazookaLoadBuff.buffIndex, rockets, -1f);
				Ray aimRay = ((BaseState)this).GetAimRay();
				float num = 4f;
				Quaternion val = Util.QuaternionSafeLookRotation(((Ray)(ref aimRay)).direction);
				Projectiles.FireRocket(Projectiles.bazookaRocketPrefab, ((Ray)(ref aimRay)).origin, Quaternion.Euler(Random.Range(0f - num, num), Random.Range(0f - num, num), 0f) * val, ((EntityState)this).gameObject);
				if (Object.op_Implicit((Object)(object)((EntityState)this).characterBody.inventory) && ((EntityState)this).characterBody.inventory.GetItemCount(Items.MoreMissile) > 0)
				{
					Projectiles.FireRocket(Projectiles.icbmBazookaRocketPrefab, ((Ray)(ref aimRay)).origin, Quaternion.Euler(Random.Range((0f - num) * 2f, num * 2f), Random.Range((0f - num) * 2f, num * 2f), 0f) * val, ((EntityState)this).gameObject);
					Projectiles.FireRocket(Projectiles.icbmBazookaRocketPrefab, ((Ray)(ref aimRay)).origin, Quaternion.Euler(Random.Range((0f - num) * 2f, num * 2f), Random.Range((0f - num) * 2f, num * 2f), 0f) * val, ((EntityState)this).gameObject);
				}
			}
		}

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			rocketDelay -= Time.fixedDeltaTime;
			if (rocketDelay <= 0f && rockets > 0)
			{
				FireOne();
			}
			if (((EntityState)this).fixedAge >= duration && rockets <= 0 && ((EntityState)this).isAuthority)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			return (InterruptPriority)2;
		}

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

		public override void OnDeserialize(NetworkReader reader)
		{
			((BaseSkillState)this).OnDeserialize(reader);
			rockets = reader.ReadInt32();
		}
	}
	public class DisciplinaryAction : BaseMeleeAttack
	{
		public override void OnEnter()
		{
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			Helpers.SwapToSpecial(((EntityState)this).characterBody);
			hitboxName = "Shovel";
			damageType = (DamageType)0;
			damageCoefficient = 2f;
			procCoefficient = 1f;
			pushForce = 100f;
			bonusForce = Vector3.zero;
			baseDuration = 1f;
			attackStartTime = 0.2f;
			attackEndTime = 0.4f;
			baseEarlyExitTime = 0.4f;
			hitStopDuration = 0.012f;
			attackRecoil = 0.5f;
			hitHopVelocity = 4f;
			swingSoundString = "WhipSwingSound";
			hitSoundString = "WhipHitEnemySound";
			muzzleString = ((swingIndex % 2 == 0) ? "SwingLeft" : "SwingRight");
			base.OnEnter();
			if (NetworkServer.active)
			{
				MotivateAlliesServer();
			}
		}

		private void MotivateAlliesServer()
		{
			//IL_0019: 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_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_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)
			if (!Object.op_Implicit((Object)(object)((EntityState)this).characterBody.teamComponent))
			{
				return;
			}
			Vector3 position = ((EntityState)this).transform.position;
			Ray aimRay = ((BaseState)this).GetAimRay();
			Vector3 val = ((Ray)(ref aimRay)).direction;
			Vector3 val2 = position + 2.5f * ((Vector3)(ref val)).normalized;
			float num = 25f;
			bool flag = false;
			foreach (TeamComponent teamMember in TeamComponent.GetTeamMembers(((EntityState)this).characterBody.teamComponent.teamIndex))
			{
				CharacterBody val3 = (Object.op_Implicit((Object)(object)teamMember) ? teamMember.body : null);
				if (Object.op_Implicit((Object)(object)val3) && !((Object)(object)val3 == (Object)(object)((EntityState)this).characterBody) && Object.op_Implicit((Object)(object)val3.healthComponent) && val3.healthComponent.alive)
				{
					val = val3.corePosition - val2;
					if (!(((Vector3)(ref val)).sqrMagnitude > num))
					{
						flag = true;
						val3.AddTimedBuff(Buffs.whipBuff, 40f);
						Util.CleanseBody(val3, true, false, false, true, true, false);
					}
				}
			}
			if (flag)
			{
				((EntityState)this).characterBody.AddTimedBuff(Buffs.whipBuff, 40f);
				Util.CleanseBody(((EntityState)this).characterBody, true, false, false, true, true, false);
				Sounds.EmitServer(Sounds.whipHitPlayer, ((EntityState)this).gameObject);
			}
		}
	}
	public class Manntreads : BaseSkillState
	{
		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			if (((EntityState)this).isAuthority)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			return (InterruptPriority)2;
		}
	}
	public class MarketGardener : BaseMeleeAttack
	{
		public override void OnEnter()
		{
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			Helpers.SwapToSpecial(((EntityState)this).characterBody);
			hitboxName = "Shovel";
			damageType = (DamageType)0;
			damageCoefficient = 1.5f;
			procCoefficient = 1f;
			pushForce = 100f;
			bonusForce = Vector3.zero;
			baseDuration = 1f;
			attackStartTime = 0.2f;
			attackEndTime = 0.4f;
			baseEarlyExitTime = 0.4f;
			hitStopDuration = 0.012f;
			attackRecoil = 0.5f;
			hitHopVelocity = 4f;
			swingSoundString = "ShovelSwingSound";
			muzzleString = ((swingIndex % 2 == 0) ? "SwingLeft" : "SwingRight");
			if (((EntityState)this).characterBody.HasBuff(Buffs.rocketJumpingBuff))
			{
				forceCrit = true;
				hitSoundString = "CritSound";
				damageCoefficient = 25f;
			}
			else
			{
				hitSoundString = "ShovelHitSound";
			}
			base.OnEnter();
		}
	}
	internal class ParachuteToggle : BaseSkillState
	{
		public static float toggleDuration = 0.2f;

		private float duration;

		private bool wasDeployed;

		public override void OnEnter()
		{
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			((BaseState)this).OnEnter();
			duration = toggleDuration / ((BaseState)this).attackSpeedStat;
			wasDeployed = ((BaseState)this).HasBuff(Buffs.parachuteBuff);
			if (((EntityState)this).isAuthority)
			{
				NetworkingHelpers.ApplyBuff(((EntityState)this).characterBody, Buffs.parachuteBuff.buffIndex, (!wasDeployed) ? 1 : 0, -1f);
			}
		}

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

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			if (wasDeployed)
			{
				return (InterruptPriority)2;
			}
			return (InterruptPriority)1;
		}
	}
	public class ReserveShoot : BaseSkillState
	{
		public static float damageCoefficient = 0.5f;

		public static float procCoefficient = 0.5f;

		public static float baseDuration = 0.6f;

		private float duration;

		private float fireTime;

		private bool hasFired;

		private string muzzleString;

		private Animator animator;

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
			duration = baseDuration / ((BaseState)this).attackSpeedStat;
			fireTime = 0.2f * duration;
			((EntityState)this).characterBody.SetAimTimer(2f);
			muzzleString = "Muzzle";
			Helpers.SwapToSecondary(((EntityState)this).characterBody);
			animator = ((EntityState)this).GetModelAnimator();
			animator.SetFloat("weaponIndex", 1f);
			((EntityState)this).PlayAnimation("PrimaryFire, Override", "FireSecondary", "ShootGun.playbackRate", 1.8f, 0f);
		}

		private void Fire()
		{
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: 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_0094: Unknown result type (might be due to invalid IL or missing references)
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a9: 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_00b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d2: 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_00d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00da: Unknown result type (might be due to invalid IL or missing references)
			//IL_00db: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fd: 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)
			//IL_0103: 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_0113: Unknown result type (might be due to invalid IL or missing references)
			//IL_011e: Unknown result type (might be due to invalid IL or missing references)
			//IL_012a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0136: Unknown result type (might be due to invalid IL or missing references)
			//IL_0142: Unknown result type (might be due to invalid IL or missing references)
			//IL_0149: Unknown result type (might be due to invalid IL or missing references)
			//IL_014f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0155: Unknown result type (might be due to invalid IL or missing references)
			//IL_0160: Unknown result type (might be due to invalid IL or missing references)
			//IL_016b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0172: Unknown result type (might be due to invalid IL or missing references)
			//IL_0173: 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_017d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0184: 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_019a: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c2: Expected O, but got Unknown
			if (!hasFired)
			{
				hasFired = true;
				((EntityState)this).characterBody.AddSpreadBloom(1.5f);
				EffectManager.SimpleMuzzleFlash(FirePistol2.muzzleEffectPrefab, ((EntityState)this).gameObject, muzzleString, false);
				Util.PlaySound("ReserveShooterShootSound", ((EntityState)this).gameObject);
				if (((EntityState)this).isAuthority)
				{
					Ray aimRay = ((BaseState)this).GetAimRay();
					((BaseState)this).AddRecoil(-1f * ShotgunShoot.recoil, -2f * ShotgunShoot.recoil, -0.5f * ShotgunShoot.recoil, 0.5f * ShotgunShoot.recoil);
					DamageTypeCombo damageType = DamageTypeCombo.op_Implicit((DamageType)0);
					damageType.damageSource = (DamageSource)2;
					BulletAttack val = new BulletAttack
					{
						bulletCount = 9u,
						aimVector = ((Ray)(ref aimRay)).direction,
						origin = ((Ray)(ref aimRay)).origin,
						damage = damageCoefficient * ((BaseState)this).damageStat,
						damageColorIndex = (DamageColorIndex)0,
						damageType = damageType,
						falloffModel = (FalloffModel)0,
						maxDistance = ShotgunShoot.range,
						force = ShotgunShoot.force,
						hitMask = CommonMasks.bullet,
						minSpread = 0f,
						maxSpread = 0.8f,
						isCrit = ((BaseState)this).RollCrit(),
						owner = ((EntityState)this).gameObject,
						muzzleName = muzzleString,
						smartCollision = false,
						procChainMask = default(ProcChainMask),
						procCoefficient = procCoefficient,
						radius = 0f,
						sniper = false,
						stopperMask = CommonMasks.bullet,
						weapon = null,
						tracerEffectPrefab = ShotgunShoot.tracerEffectPrefab,
						spreadPitchScale = 1f,
						spreadYawScale = 1f,
						queryTriggerInteraction = (QueryTriggerInteraction)0,
						hitEffectPrefab = FirePistol2.hitEffectPrefab
					};
					DamageAPI.AddModdedDamageType(val, TF2SoldierPlugin.ReserveShooterHit);
					val.Fire();
				}
			}
		}

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			if (((EntityState)this).fixedAge >= fireTime)
			{
				Fire();
			}
			if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority)
			{
				if (((EntityState)this).skillLocator.secondary.stock < ((EntityState)this).skillLocator.secondary.maxStock)
				{
					((EntityState)this).outer.SetNextState((EntityState)(object)new ShotgunReload());
				}
				else
				{
					((EntityState)this).outer.SetNextStateToMain();
				}
			}
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			return (InterruptPriority)2;
		}
	}
	public class RocketJumper : BaseSkillState
	{
		private float duration;

		private float fireTime;

		private bool hasFired;

		private Animator animator;

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
			duration = RocketLauncher.baseDuration / ((BaseState)this).attackSpeedStat;
			fireTime = 0.1f * duration;
			((EntityState)this).characterBody.SetAimTimer(2f);
			animator = ((EntityState)this).GetModelAnimator();
			Helpers.SwapToPrimary(((EntityState)this).characterBody);
			animator.SetFloat("weaponIndex", 0f);
			Util.PlaySound("RocketJumperLaunchSound", ((EntityState)this).gameObject);
			((EntityState)this).PlayAnimation("PrimaryFire, Override", "FirePrimary", "ThrowBomb.playbackRate", duration, 0f);
		}

		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_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			if (!hasFired)
			{
				hasFired = true;
				if (((EntityState)this).isAuthority)
				{
					Ray aimRay = ((BaseState)this).GetAimRay();
					Projectiles.FireRocket(Projectiles.rocketJumperPrefab, ((Ray)(ref aimRay)).origin, Util.QuaternionSafeLookRotation(((Ray)(ref aimRay)).direction), ((EntityState)this).gameObject);
				}
			}
		}

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			if (((EntityState)this).fixedAge >= fireTime)
			{
				Fire();
			}
			if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority)
			{
				if (((EntityState)this).skillLocator.primary.stock < ((EntityState)this).skillLocator.primary.maxStock)
				{
					((EntityState)this).outer.SetNextState((EntityState)(object)new RocketReload());
				}
				else
				{
					((EntityState)this).outer.SetNextStateToMain();
				}
			}
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			return (InterruptPriority)2;
		}
	}
	public class RocketLauncher : BaseSkillState
	{
		public static float baseDuration = 0.65f;

		private float duration;

		private float fireTime;

		private bool hasFired;

		private Animator animator;

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
			duration = baseDuration / ((BaseState)this).attackSpeedStat;
			fireTime = 0.1f * duration;
			((EntityState)this).characterBody.SetAimTimer(2f);
			animator = ((EntityState)this).GetModelAnimator();
			Helpers.SwapToPrimary(((EntityState)this).characterBody);
			animator.SetFloat("weaponIndex", 0f);
			Util.PlaySound("RocketSound", ((EntityState)this).gameObject);
			((EntityState)this).PlayAnimation("PrimaryFire, Override", "FirePrimary", "ThrowBomb.playbackRate", duration, 0f);
		}

		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_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: 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_008a: 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_0090: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
			if (hasFired)
			{
				return;
			}
			hasFired = true;
			if (((EntityState)this).isAuthority)
			{
				Ray aimRay = ((BaseState)this).GetAimRay();
				Quaternion val = Util.QuaternionSafeLookRotation(((Ray)(ref aimRay)).direction);
				Projectiles.FireRocket(Projectiles.rocketPrefab, ((Ray)(ref aimRay)).origin, val, ((EntityState)this).gameObject);
				if (Object.op_Implicit((Object)(object)((EntityState)this).characterBody.inventory) && ((EntityState)this).characterBody.inventory.GetItemCount(Items.MoreMissile) > 0)
				{
					Projectiles.FireRocket(Projectiles.icbmRocketPrefab, ((Ray)(ref aimRay)).origin, Quaternion.Euler(0f, 20f, 0f) * val, ((EntityState)this).gameObject);
					Projectiles.FireRocket(Projectiles.icbmRocketPrefab, ((Ray)(ref aimRay)).origin, Quaternion.Euler(0f, -20f, 0f) * val, ((EntityState)this).gameObject);
				}
			}
		}

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			if (((EntityState)this).fixedAge >= fireTime)
			{
				Fire();
			}
			if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority)
			{
				if (((EntityState)this).skillLocator.primary.stock < ((EntityState)this).skillLocator.primary.maxStock)
				{
					((EntityState)this).outer.SetNextState((EntityState)(object)new RocketReload());
				}
				else
				{
					((EntityState)this).outer.SetNextStateToMain();
				}
			}
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			return (InterruptPriority)2;
		}
	}
	public class ShotgunShoot : BaseSkillState
	{
		public static float damageCoefficient = 0.65f;

		public static float procCoefficient = 0.5f;

		public static float baseDuration = 0.6f;

		public static float force = 50f;

		public static float recoil = 3f;

		public static float range = 256f;

		public static GameObject tracerEffectPrefab = LegacyResourcesAPI.Load<GameObject>("Prefabs/Effects/Tracers/TracerGoldGat");

		private float duration;

		private float fireTime;

		private bool hasFired;

		private string muzzleString;

		private Animator animator;

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
			duration = baseDuration / ((BaseState)this).attackSpeedStat;
			fireTime = 0.2f * duration;
			((EntityState)this).characterBody.SetAimTimer(2f);
			muzzleString = "Muzzle";
			Helpers.SwapToSecondary(((EntityState)this).characterBody);
			animator = ((EntityState)this).GetModelAnimator();
			animator.SetFloat("weaponIndex", 1f);
			((EntityState)this).PlayAnimation("PrimaryFire, Override", "FireSecondary", "ShootGun.playbackRate", 1.8f, 0f);
		}

		private void Fire()
		{
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: 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_0094: Unknown result type (might be due to invalid IL or missing references)
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a9: 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_00b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d2: 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_00d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00da: Unknown result type (might be due to invalid IL or missing references)
			//IL_00db: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fd: 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)
			//IL_0103: 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_0113: Unknown result type (might be due to invalid IL or missing references)
			//IL_011e: Unknown result type (might be due to invalid IL or missing references)
			//IL_012a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0136: Unknown result type (might be due to invalid IL or missing references)
			//IL_0142: Unknown result type (might be due to invalid IL or missing references)
			//IL_0149: Unknown result type (might be due to invalid IL or missing references)
			//IL_014f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0155: Unknown result type (might be due to invalid IL or missing references)
			//IL_0160: Unknown result type (might be due to invalid IL or missing references)
			//IL_016b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0172: Unknown result type (might be due to invalid IL or missing references)
			//IL_0173: 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_017d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0184: 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_019a: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ac: Unknown result type (might be due to invalid IL or missing references)
			if (!hasFired)
			{
				hasFired = true;
				((EntityState)this).characterBody.AddSpreadBloom(1.5f);
				EffectManager.SimpleMuzzleFlash(FirePistol2.muzzleEffectPrefab, ((EntityState)this).gameObject, muzzleString, false);
				Util.PlaySound("ShotgunShootSound", ((EntityState)this).gameObject);
				if (((EntityState)this).isAuthority)
				{
					Ray aimRay = ((BaseState)this).GetAimRay();
					((BaseState)this).AddRecoil(-1f * recoil, -2f * recoil, -0.5f * recoil, 0.5f * recoil);
					DamageTypeCombo damageType = DamageTypeCombo.op_Implicit((DamageType)0);
					damageType.damageSource = (DamageSource)2;
					new BulletAttack
					{
						bulletCount = 9u,
						aimVector = ((Ray)(ref aimRay)).direction,
						origin = ((Ray)(ref aimRay)).origin,
						damage = damageCoefficient * ((BaseState)this).damageStat,
						damageColorIndex = (DamageColorIndex)0,
						damageType = damageType,
						falloffModel = (FalloffModel)1,
						maxDistance = range,
						force = force,
						hitMask = CommonMasks.bullet,
						minSpread = 0f,
						maxSpread = 2f,
						isCrit = ((BaseState)this).RollCrit(),
						owner = ((EntityState)this).gameObject,
						muzzleName = muzzleString,
						smartCollision = false,
						procChainMask = default(ProcChainMask),
						procCoefficient = procCoefficient,
						radius = 0f,
						sniper = false,
						stopperMask = CommonMasks.bullet,
						weapon = null,
						tracerEffectPrefab = tracerEffectPrefab,
						spreadPitchScale = 1f,
						spreadYawScale = 1f,
						queryTriggerInteraction = (QueryTriggerInteraction)0,
						hitEffectPrefab = FirePistol2.hitEffectPrefab
					}.Fire();
				}
			}
		}

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			if (((EntityState)this).fixedAge >= fireTime)
			{
				Fire();
			}
			if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority)
			{
				if (((EntityState)this).skillLocator.secondary.stock < ((EntityState)this).skillLocator.secondary.maxStock)
				{
					((EntityState)this).outer.SetNextState((EntityState)(object)new ShotgunReload());
				}
				else
				{
					((EntityState)this).outer.SetNextStateToMain();
				}
			}
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			return (InterruptPriority)2;
		}
	}
	public class Zatoichi : BaseMeleeAttack
	{
		public override void OnEnter()
		{
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			Helpers.SwapToSpecial(((EntityState)this).characterBody);
			hitboxName = "Katana";
			damageType = (DamageType)0;
			isKatana = true;
			damageCoefficient = 5f;
			procCoefficient = 1f;
			pushForce = 100f;
			bonusForce = Vector3.zero;
			baseDuration = 1f;
			attackStartTime = 0.2f;
			attackEndTime = 0.4f;
			baseEarlyExitTime = 0.4f;
			hitStopDuration = 0.012f;
			attackRecoil = 0.5f;
			hitHopVelocity = 4f;
			swingSoundString = "KatanaSwingSound";
			hitSoundString = "KatanaHitSound";
			muzzleString = ((swingIndex % 2 == 0) ? "SwingLeft" : "SwingRight");
			base.OnEnter();
		}
	}
}
namespace TF2SoldierMod.SkillStates.TF2Soldier.ReloadStates
{
	public class RocketReload : BaseState
	{
		private bool hasGivenStock;

		private Animator animator;

		private float duration => 0.85f / base.attackSpeedStat;

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
			animator = ((EntityState)this).GetModelAnimator();
			if (Object.op_Implicit((Object)(object)animator) && animator.GetFloat("weaponIndex") == 0f)
			{
				((EntityState)this).PlayAnimation("Reload", "soldier_model_skeleton_primary_reload", "Reload.playbackRate", duration * 2f, 0f);
			}
		}

		private void GiveStock()
		{
			if (!hasGivenStock)
			{
				hasGivenStock = true;
				if (((EntityState)this).isAuthority && ((EntityState)this).skillLocator.primary.stock < ((EntityState)this).skillLocator.primary.maxStock)
				{
					((EntityState)this).skillLocator.primary.AddOneStock();
				}
				Util.PlaySound("RocketReload", ((EntityState)this).gameObject);
			}
		}

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			if (((EntityState)this).fixedAge >= duration / 2f)
			{
				GiveStock();
			}
			if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= duration)
			{
				if (((EntityState)this).skillLocator.primary.stock < ((EntityState)this).skillLocator.primary.maxStock)
				{
					((EntityState)this).outer.SetNextState((EntityState)(object)new RocketReload());
				}
				else
				{
					((EntityState)this).outer.SetNextStateToMain();
				}
			}
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			return (InterruptPriority)1;
		}
	}
	public class ShotgunReload : BaseState
	{
		private bool hasGivenStock;

		private bool isDone;

		private Animator animator;

		private float duration => 0.6f / base.attackSpeedStat;

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
			isDone = false;
			animator = ((EntityState)this).GetModelAnimator();
			if (Object.op_Implicit((Object)(object)animator) && animator.GetFloat("weaponIndex") == 1f)
			{
				((EntityState)this).PlayAnimation("Reload", "soldier_model_skeleton_secondary_reload", "Reload.playbackRate", duration * 2f, 0f);
			}
		}

		private void GiveStock()
		{
			if (!hasGivenStock)
			{
				hasGivenStock = true;
				if (((EntityState)this).isAuthority && ((EntityState)this).skillLocator.secondary.stock < ((EntityState)this).skillLocator.secondary.maxStock)
				{
					((EntityState)this).skillLocator.secondary.AddOneStock();
				}
				Util.PlaySound("ShotgunReload", ((EntityState)this).gameObject);
			}
		}

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			if (((EntityState)this).fixedAge >= duration)
			{
				GiveStock();
			}
			if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= duration)
			{
				if (((EntityState)this).skillLocator.secondary.stock < ((EntityState)this).skillLocator.secondary.maxStock)
				{
					((EntityState)this).outer.SetNextState((EntityState)(object)new ShotgunReload());
					return;
				}
				isDone = true;
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		public override void OnExit()
		{
			((EntityState)this).OnExit();
			if (isDone)
			{
				Util.PlaySound("ShotgunCockSound", ((EntityState)this).gameObject);
			}
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			return (InterruptPriority)1;
		}
	}
}
namespace TF2SoldierMod.SkillStates.BaseStates
{
	public class BaseDeployBanner : BaseSkillState
	{
		public static float duration = 2f;

		protected GameObject bannerPrefab;

		protected string hornSoundString;

		private Animator animator;

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
			Helpers.SwapToUtility(((EntityState)this).characterBody);
			animator = ((EntityState)this).GetModelAnimator();
			animator.SetFloat("weaponIndex", 0f);
			((EntityState)this).PlayAnimation("FullBody, Override", "Roll", "Roll.playbackRate", duration, 0f);
			Util.PlaySound(hornSoundString, ((EntityState)this).gameObject);
		}

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

		public override void OnExit()
		{
			((EntityState)this).OnExit();
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor))
			{
				((EntityState)this).characterMotor.disableAirControlUntilCollision = false;
			}
			Helpers.SwapToPrimary(((EntityState)this).characterBody);
			Util.PlaySound("BannerFlagSound", ((EntityState)this).gameObject);
			TF2SoldierMod.Modules.Banners.DeployWard(bannerPrefab, ((EntityState)this).characterBody);
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			return (InterruptPriority)2;
		}
	}
	public class BaseMeleeAttack : BaseSkillState
	{
		public int swingIndex;

		protected string hitboxName = "Shovel";

		protected DamageType damageType;

		protected bool isKatana;

		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 string swingSoundString = "";

		protected string hitSoundString = "";

		protected string muzzleString = "SwingCenter";

		protected GameObject swingEffectPrefab;

		protected GameObject hitEffectPrefab;

		protected bool forceCrit;

		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;

		private NetworkSoundEventIndex impactSound = (NetworkSoundEventIndex)(-1);

		public override void OnEnter()
		{
			//IL_00d6: 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_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)
			//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ef: 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_00ff: Expected O, but got Unknown
			//IL_0105: 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)
			//IL_0134: Unknown result type (might be due to invalid IL or missing references)
			//IL_0139: 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_0184: 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)
			//IL_01e1: 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);
			animator.SetFloat("weaponIndex", 2f);
			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();
			if (!Object.op_Implicit((Object)(object)hitEffectPrefab))
			{
				hitEffectPrefab = Assets.meleeHitEffect;
			}
			impactSound = Sounds.IndexOf(hitSoundString);
			DamageTypeCombo val = DamageTypeCombo.op_Implicit(damageType);
			val.damageSource = (DamageSource)8;
			attack = new OverlapAttack();
			attack.damageType = val;
			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 = forceCrit || ((BaseState)this).RollCrit();
			attack.impactSound = impactSound;
			if (isKatana)
			{
				DamageAPI.AddModdedDamageType(attack, TF2SoldierPlugin.ZatoichiHit);
			}
		}

		protected virtual void PlayAttackAnimation()
		{
			((EntityState)this).PlayCrossfade("PrimaryFire, Override", "FireMelee", "Slash.playbackRate", duration, 0.05f);
		}

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

		protected virtual void OnHitEnemyAuthority()
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Invalid comparison between Unknown and I4
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0075: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			if ((int)impactSound == -1 && !string.IsNullOrEmpty(hitSoundString))
			{
				Util.PlaySound(hitSoundString, ((EntityState)this).gameObject);
			}
			hasHopped = true;
			if (!inHitPause && hitStopDuration > 0f && Object.op_Implicit((Object)(object)((EntityState)this).characterMotor))
			{
				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();
			}
		}

		public override void FixedUpdate()
		{
			//IL_002f: 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();
			hitPauseTimer -= Time.fixedDeltaTime;
			if (hitPauseTimer <= 0f && inHitPause)
			{
				((BaseState)this).ConsumeHitStopCachedState(hitStopCachedState, ((EntityState)this).characterMotor, animator);
				inHitPause = false;
				if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor))
				{
					((EntityState)this).characterMotor.velocity = storedVelocity;
				}
			}
			if (!inHitPause)
			{
				stopwatch += Time.fixedDeltaTime;
			}
			else if (Object.op_Implicit((Object)(object)animator))
			{
				animator.SetFloat("Swing.playbackRate", 0f);
			}
			if (stopwatch >= duration * attackStartTime && stopwatch <= duration * attackEndTime)
			{
				FireAttack();
			}
			if (stopwatch >= duration && ((EntityState)this).isAuthority)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

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

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			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 TF2SoldierMod.SkillStates.Banners
{
	public class DeployBattalionBanner : BaseDeployBanner
	{
		public override void OnEnter()
		{
			bannerPrefab = TF2SoldierMod.Modules.Banners.battalionBuffBanner;
			hornSoundString = "BattalionsBluSound";
			base.OnEnter();
		}
	}
	public class DeployBuffBanner : BaseDeployBanner
	{
		public override void OnEnter()
		{
			bannerPrefab = TF2SoldierMod.Modules.Banners.critBuffBanner;
			hornSoundString = "BuffBannerBluSound";
			base.OnEnter();
		}
	}
	public class DeployConchBanner : BaseDeployBanner
	{
		public override void OnEnter()
		{
			bannerPrefab = TF2SoldierMod.Modules.Banners.conchBuffBanner;
			hornSoundString = "HornUseSound";
			base.OnEnter();
		}
	}
}
namespace TF2SoldierMod.Modules
{
	internal static class Assets
	{
		internal static AssetBundle mainAssetBundle;

		internal static GameObject rocketExplosionEffect;

		internal static GameObject rocketJumperExplosionEffect;

		internal static GameObject airStrikeExplosionEffect;

		internal static GameObject stompShakeEffect;

		internal static GameObject meleeHitEffect;

		internal static List<NetworkSoundEventDef> networkSoundEventDefs = new List<NetworkSoundEventDef>();

		internal static List<EffectDef> effectDefs = new List<EffectDef>();

		internal static Shader hotpoo;

		internal static Material commandoMat;

		private static string[] assetNames = new string[0];

		internal static void Initialize()
		{
			hotpoo = LegacyResourcesAPI.Load<Shader>("Shaders/Deferred/HGStandard");
			LoadAssetBundle();
			LoadSoundbank();
			PopulateAssets();
		}

		internal static void LoadAssetBundle()
		{
			if ((Object)(object)mainAssetBundle == (Object)null)
			{
				using Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("TF2SoldierMod.soldierassets");
				mainAssetBundle = AssetBundle.LoadFromStream(stream);
			}
			assetNames = mainAssetBundle.GetAllAssetNames();
		}

		internal static void LoadSoundbank()
		{
			using Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("TF2SoldierMod.TF2SoldierModSFX.bnk");
			byte[] array = new byte[stream.Length];
			stream.Read(array, 0, array.Length);
			SoundBanks.Add(array);
		}

		internal static void PopulateAssets()
		{
			if (!Object.op_Implicit((Object)(object)mainAssetBundle))
			{
				Debug.LogError((object)"There is no AssetBundle to load assets from.");
				return;
			}
			rocketExplosionEffect = LoadEffect("RocketExplosionEffect", "RocketExplodeSound");
			rocketJumperExplosionEffect = LoadEffect("RocketJumperExplosionEffect", "RocketJumperExplodeSound");
			airStrikeExplosionEffect = LoadEffect("AirStrikeExplosionEffect", "RocketExplodeSound");
			if (Object.op_Implicit((Object)(object)rocketExplosionEffect))
			{
				AddShake(rocketExplosionEffect, 0f, 50f);
			}
			stompShakeEffect = CreateStompShakeEffect();
			meleeHitEffect = LegacyResourcesAPI.Load<GameObject>("Prefabs/Effects/OmniEffect/OmniImpactVFX");
		}

		private static void AddShake(GameObject effect, float duration, float radius)
		{
			//IL_002b: 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_0056: Unknown result type (might be due to invalid IL or missing references)
			ShakeEmitter obj = effect.AddComponent<ShakeEmitter>();
			obj.shakeOnStart = true;
			obj.amplitudeTimeDecay = true;
			obj.duration = duration;
			obj.radius = radius;
			obj.scaleShakeRadiusWithLocalScale = false;
			obj.wave = new Wave
			{
				amplitude = 1f,
				frequency = 40f,
				cycleOffset = 0f
			};
		}

		private static GameObject CreateStompShakeEffect()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Expected O, but got Unknown
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_0063: Expected O, but got Unknown
			//IL_0069: Expected O, but got Unknown
			GameObject val = new GameObject("SoldierStompShakeEffect");
			val.AddComponent<DestroyOnTimer>().duration = 1f;
			val.AddComponent<NetworkIdentity>();
			val.AddComponent<VFXAttributes>().vfxPriority = (VFXPriority)2;
			EffectComponent obj = val.AddComponent<EffectComponent>();
			obj.applyScale = false;
			obj.effectIndex = (EffectIndex)(-1);
			obj.positionAtReferencedTransform = true;
			AddShake(val, 0.4f, 100f);
			GameObject val2 = PrefabAPI.InstantiateClone(val, "SoldierStompShakeEffect", false);
			Object.Destroy((Object)val);
			AddNewEffectDef(val2, "");
			return val2;
		}

		internal static NetworkSoundEventDef CreateNetworkSoundEventDef(string eventName)
		{
			NetworkSoundEventDef val = ScriptableObject.CreateInstance<NetworkSoundEventDef>();
			((Object)val).name = "nse" + eventName;
			val.eventName = eventName;
			networkSoundEventDefs.Add(val);
			return val;
		}

		internal static void ConvertAllRenderersToHopooShader(GameObject objectToConvert)
		{
			if (!Object.op_Implicit((Object)(object)objectToConvert))
			{
				return;
			}
			MeshRenderer[] componentsInChildren = objectToConvert.GetComponentsInChildren<MeshRenderer>();
			foreach (MeshRenderer val in componentsInChildren)
			{
				if (Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)((Renderer)val).material))
				{
					((Renderer)val).material.shader = hotpoo;
				}
			}
			SkinnedMeshRenderer[] componentsInChildren2 = objectToConvert.GetComponentsInChildren<SkinnedMeshRenderer>();
			foreach (SkinnedMeshRenderer val2 in componentsInChildren2)
			{
				if (Object.op_Implicit((Object)(object)val2) && Object.op_Implicit((Object)(object)((Renderer)val2).material))
				{
					((Renderer)val2).material.shader = hotpoo;
				}
			}
		}

		internal static Texture LoadCharacterIcon(string characterName)
		{
			return mainAssetBundle.LoadAsset<Texture>("tex" + characterName + "Icon");
		}

		internal static GameObject LoadCrosshair(string crosshairName)
		{
			GameObject val = LegacyResourcesAPI.Load<GameObject>("Prefabs/Crosshair/" + crosshairName + "Crosshair");
			if (!Object.op_Implicit((Object)(object)val))
			{
				val = LegacyResourcesAPI.Load<GameObject>("Prefabs/Crosshair/StandardCrosshair");
			}
			return val;
		}

		private static GameObject LoadEffect(string resourceName, string soundName)
		{
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			bool flag = false;
			for (int i = 0; i < assetNames.Length; i++)
			{
				if (assetNames[i].Contains(resourceName.ToLower()))
				{
					flag = true;
					break;
				}
			}
			if (!flag)
			{
				Debug.LogError((object)("Failed to load effect: " + resourceName + " because it does not exist in the AssetBundle"));
				return null;
			}
			GameObject obj = mainAssetBundle.LoadAsset<GameObject>(resourceName);
			obj.AddComponent<DestroyOnTimer>().duration = 12f;
			obj.AddComponent<NetworkIdentity>();
			obj.AddComponent<VFXAttributes>().vfxPriority = (VFXPriority)2;
			EffectComponent obj2 = obj.AddComponent<EffectComponent>();
			obj2.applyScale = false;
			obj2.effectIndex = (EffectIndex)(-1);
			obj2.parentToReferencedTransform = false;
			obj2.positionAtReferencedTransform = true;
			obj2.soundName = soundName;
			AddNewEffectDef(obj, soundName);
			return obj;
		}

		private static void AddNewEffectDef(GameObject effect