Decompiled source of TemplarReturnsReturns v1.3.0

Templar.dll

Decompiled 3 weeks ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using BepInEx.Logging;
using BulwarksHaunt.Achievements;
using Downpour;
using EntityStates;
using EntityStates.ClayBoss;
using EntityStates.ClayBoss.ClayBossWeapon;
using EntityStates.ClayBruiser.Weapon;
using EntityStates.ClayBruiserMonster;
using EntityStates.Commando;
using EntityStates.GolemMonster;
using EntityStates.LemurianBruiserMonster;
using EntityStates.Missions.BrotherEncounter;
using EntityStates.Missions.Goldshores;
using EntityStates.ParentMonster;
using EntityStates.ScavMonster;
using EntityStates.Sniper.SniperWeapon;
using EntityStates.Squid.SquidWeapon;
using EntityStates.Toolbot;
using EntityStates.Treebot.Weapon;
using HG.BlendableTypes;
using HarmonyLib;
using IL.RoR2.UI;
using Inferno.Unlocks;
using KinematicCharacterController;
using Microsoft.CodeAnalysis;
using Mono.Cecil;
using Mono.Cecil.Cil;
using MonoMod.Cil;
using On.EntityStates.Missions.BrotherEncounter;
using On.EntityStates.Missions.Goldshores;
using On.RoR2;
using On.RoR2.UI;
using R2API;
using R2API.Utils;
using RoR2;
using RoR2.Achievements;
using RoR2.ContentManagement;
using RoR2.Projectile;
using RoR2.Skills;
using RoR2.UI;
using RoR2BepInExPack.VanillaFixes;
using TPDespair.ZetArtifacts;
using Templar.TemplarSurvivor;
using TemplarSkins;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.Networking;
using UnityEngine.Rendering;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("Templar")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+2c0fa14e0bbb6545c15513460dc4d818eb5d8810")]
[assembly: AssemblyProduct("Templar")]
[assembly: AssemblyTitle("Templar")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.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 TemplarSkins
{
	public class RegisterModdedAchievementAttribute : Attribute
	{
		public readonly string identifier;

		public readonly string unlockableRewardIdentifier;

		public string prerequisiteAchievementIdentifier;

		public readonly uint lunarCoinReward;

		public readonly Type serverTrackerType;

		public readonly string[] mods;

		public RegisterModdedAchievementAttribute(string identifier, string unlockableRewardIdentifier, string prerequisiteAchievementIdentifier, uint lunarCoinReward, Type serverTrackerType = null, params string[] mods)
		{
			this.identifier = identifier;
			this.unlockableRewardIdentifier = unlockableRewardIdentifier;
			this.prerequisiteAchievementIdentifier = prerequisiteAchievementIdentifier;
			this.serverTrackerType = serverTrackerType;
			this.mods = mods;
			this.lunarCoinReward = lunarCoinReward;
		}
	}
}
namespace Templar
{
	public static class Assets
	{
		public static AssetBundle MainAssetBundle = null;

		public static AssetBundle SecondaryAssetBundle = null;

		public static AssetBundle TemplarSkins = null;

		private static string[] assetNames = Array.Empty<string>();

		public static Texture templarIcon;

		public static Texture templarIconOld;

		public static Sprite iconP;

		public static Sprite icon1;

		public static Sprite icon1b;

		public static Sprite icon1c;

		public static Sprite icon1d;

		public static Sprite icon2;

		public static Sprite icon2b;

		public static Sprite icon3;

		public static Sprite icon3b;

		public static Sprite icon4;

		public static Sprite icon4b;

		public static Texture templarSkinTex;

		public static GameObject clayBombModel;

		public static GameObject clayMissileModel;

		public static void Initialize()
		{
			MainAssetBundle = AssetBundle.LoadFromFile(Path.Combine(Path.GetDirectoryName(Main.pluginInfo.Location), "templar"));
			SecondaryAssetBundle = AssetBundle.LoadFromFile(Path.Combine(Path.GetDirectoryName(Main.pluginInfo.Location), "skillbundle"));
			TemplarSkins = AssetBundle.LoadFromFile(Path.Combine(Path.GetDirectoryName(Main.pluginInfo.Location), "templarskins"));
			PopulateAssets();
		}

		internal static void PopulateAssets()
		{
			if (!Object.op_Implicit((Object)(object)MainAssetBundle))
			{
				Debug.LogError((object)"There is no Main AssetBundle to load assets from.");
				return;
			}
			clayBombModel = MainAssetBundle.LoadAsset<GameObject>("ClayBombModel");
			clayMissileModel = MainAssetBundle.LoadAsset<GameObject>("ClayMissileModel");
			templarIcon = MainAssetBundle.LoadAsset<Texture>("TemplarBody");
			templarIcon.filterMode = (FilterMode)0;
			templarIconOld = MainAssetBundle.LoadAsset<Texture>("TemplarBodyOld");
			templarIconOld.filterMode = (FilterMode)0;
			templarSkinTex = MainAssetBundle.LoadAsset<Texture>("texTemplarSkin");
			if (!Object.op_Implicit((Object)(object)SecondaryAssetBundle))
			{
				Debug.LogError((object)"There is no Secondary AssetBundle to load assets from.");
				return;
			}
			iconP = MainAssetBundle.LoadAsset<Sprite>("TarNewIcon");
			icon1 = MainAssetBundle.LoadAsset<Sprite>("MinigunNewIcon");
			icon1b = MainAssetBundle.LoadAsset<Sprite>("RifleNewIcon");
			icon1c = MainAssetBundle.LoadAsset<Sprite>("RailgunNewIcon");
			icon2 = MainAssetBundle.LoadAsset<Sprite>("ClayBombNewIcon");
			icon2b = MainAssetBundle.LoadAsset<Sprite>("ShotgunNewIcon");
			icon3 = MainAssetBundle.LoadAsset<Sprite>("TarBurstNewIcon");
			icon3b = MainAssetBundle.LoadAsset<Sprite>("SidestepIcon");
			icon4 = MainAssetBundle.LoadAsset<Sprite>("BazookaNewIcon");
			icon4b = MainAssetBundle.LoadAsset<Sprite>("SwapNewIcon");
			icon1d = SecondaryAssetBundle.LoadAsset<Sprite>("FlamethrowerIcon");
		}
	}
	public static class Buffs
	{
		internal static BuffDef TemplArmorBuff;

		internal static BuffDef TemplarstationaryArmorBuff;

		internal static BuffDef TemplarigniteDebuff;

		internal static BuffDef TemplarOverdriveBuff;

		internal static readonly Color CHAR_COLOR2 = new Color(40f / 51f, 0.29411766f, 1f / 17f);

		internal static List<BuffDef> buffDefs = new List<BuffDef>();

		internal static void RegisterBuffs()
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: 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_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_00a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c4: 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)
			TemplArmorBuff = AddNewBuff("TemplArmorBuff", Addressables.LoadAssetAsync<BuffDef>((object)"RoR2/Base/RoboBallBoss/bdEngiShield.asset").WaitForCompletion().iconSprite, new Color(0.54f, 0.21f, 0.12f), canStack: false, isDebuff: false);
			TemplarstationaryArmorBuff = AddNewBuff("TemplarstationaryArmorBuff", Addressables.LoadAssetAsync<BuffDef>((object)"RoR2/Base/RoboBallBoss/bdEngiShield.asset").WaitForCompletion().iconSprite, new Color(0.74f, 0.41f, 0.32f), canStack: false, isDebuff: false);
			TemplarigniteDebuff = AddNewBuff("TemplarScorchedDebuff", Addressables.LoadAssetAsync<BuffDef>((object)"RoR2/Base/ArmorReductionOnHit/bdPulverized.asset").WaitForCompletion().iconSprite, new Color(0.3f, 0.3f, 0.3f), canStack: false, isDebuff: true);
			TemplarOverdriveBuff = AddNewBuff("TemplarOverdriveBuff", Addressables.LoadAssetAsync<BuffDef>((object)"RoR2/Base/WarCryOnMultiKill/bdWarCryBuff.asset").WaitForCompletion().iconSprite, new Color(0.84f, 0.51f, 0.42f), canStack: false, isDebuff: false);
		}

		internal static BuffDef AddNewBuff(string buffName, Sprite buffIcon, Color buffColor, bool canStack, bool isDebuff)
		{
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			BuffDef val = ScriptableObject.CreateInstance<BuffDef>();
			((Object)val).name = buffName;
			val.buffColor = buffColor;
			val.canStack = canStack;
			val.isDebuff = isDebuff;
			val.eliteDef = null;
			val.iconSprite = buffIcon;
			buffDefs.Add(val);
			return val;
		}
	}
	public class ContentPacks : IContentPackProvider
	{
		internal static ContentPack contentPack = new ContentPack();

		public string identifier => "Lemurian.LemurianContent";

		public IEnumerator LoadStaticContentAsync(LoadStaticContentAsyncArgs args)
		{
			contentPack.buffDefs.Add(Buffs.buffDefs.ToArray());
			contentPack.skillDefs.Add(Main.skillDefs.ToArray());
			contentPack.skillFamilies.Add(Main.skillFamilies.ToArray());
			contentPack.survivorDefs.Add(Main.survivorDefs.ToArray());
			contentPack.bodyPrefabs.Add(Main.bodyPrefabs.ToArray());
			contentPack.masterPrefabs.Add(Main.masterPrefabs.ToArray());
			contentPack.projectilePrefabs.Add(Main.projectilePrefabs.ToArray());
			args.ReportProgress(1f);
			yield break;
		}

		public IEnumerator GenerateContentPackAsync(GetContentPackAsyncArgs args)
		{
			ContentPack.Copy(contentPack, args.output);
			yield break;
		}

		public IEnumerator FinalizeAsync(FinalizeAsyncArgs args)
		{
			args.ReportProgress(1f);
			yield break;
		}
	}
	public static class Hook
	{
		[Serializable]
		[CompilerGenerated]
		private sealed class <>c
		{
			public static readonly <>c <>9 = new <>c();

			public static hook_RecalculateStats <>9__0_0;

			public static hook_TakeDamage <>9__0_1;

			internal void <HookSetup>b__0_0(orig_RecalculateStats orig, CharacterBody self)
			{
				orig.Invoke(self);
				if (Object.op_Implicit((Object)(object)self) && self.HasBuff(Buffs.TemplArmorBuff))
				{
					Reflection.SetPropertyValue<float>((object)self, "armor", self.armor + 50f);
				}
				if (Object.op_Implicit((Object)(object)self) && self.HasBuff(Buffs.TemplarstationaryArmorBuff))
				{
					Reflection.SetPropertyValue<float>((object)self, "armor", self.armor + 100f);
				}
				if (Object.op_Implicit((Object)(object)self) && self.HasBuff(Buffs.TemplarOverdriveBuff))
				{
					Reflection.SetPropertyValue<float>((object)self, "regen", self.regen * 12f);
					Reflection.SetPropertyValue<float>((object)self, "attackSpeed", self.attackSpeed * 1.5f);
				}
				if (Object.op_Implicit((Object)(object)self) && self.HasBuff(Buffs.TemplarigniteDebuff))
				{
					Reflection.SetPropertyValue<float>((object)self, "armor", self.armor - 45f);
					Reflection.SetPropertyValue<float>((object)self, "moveSpeed", self.moveSpeed * 0.8f);
				}
			}

			internal void <HookSetup>b__0_1(orig_TakeDamage orig, HealthComponent self, DamageInfo di)
			{
				//IL_0183: 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_0194: Unknown result type (might be due to invalid IL or missing references)
				//IL_01a0: Unknown result type (might be due to invalid IL or missing references)
				//IL_01a2: Unknown result type (might be due to invalid IL or missing references)
				//IL_01a7: Unknown result type (might be due to invalid IL or missing references)
				//IL_01b2: Unknown result type (might be due to invalid IL or missing references)
				//IL_01b9: Unknown result type (might be due to invalid IL or missing references)
				//IL_01be: Unknown result type (might be due to invalid IL or missing references)
				//IL_01c3: 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_01d0: Unknown result type (might be due to invalid IL or missing references)
				//IL_01d5: 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)
				//IL_01f3: Unknown result type (might be due to invalid IL or missing references)
				//IL_0201: Expected O, but got Unknown
				//IL_0204: Unknown result type (might be due to invalid IL or missing references)
				//IL_020b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0210: Unknown result type (might be due to invalid IL or missing references)
				//IL_0215: Unknown result type (might be due to invalid IL or missing references)
				//IL_021c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0222: Unknown result type (might be due to invalid IL or missing references)
				//IL_0227: Unknown result type (might be due to invalid IL or missing references)
				//IL_0233: Unknown result type (might be due to invalid IL or missing references)
				//IL_023f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0241: Unknown result type (might be due to invalid IL or missing references)
				//IL_0246: Unknown result type (might be due to invalid IL or missing references)
				//IL_0251: Unknown result type (might be due to invalid IL or missing references)
				//IL_0258: Unknown result type (might be due to invalid IL or missing references)
				//IL_025d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0262: Unknown result type (might be due to invalid IL or missing references)
				//IL_026d: Unknown result type (might be due to invalid IL or missing references)
				//IL_026f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0274: Unknown result type (might be due to invalid IL or missing references)
				//IL_027b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0286: Unknown result type (might be due to invalid IL or missing references)
				//IL_0291: Unknown result type (might be due to invalid IL or missing references)
				//IL_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_02a3: Expected O, but got Unknown
				//IL_02a5: Unknown result type (might be due to invalid IL or missing references)
				//IL_02b5: Unknown result type (might be due to invalid IL or missing references)
				//IL_02ba: Unknown result type (might be due to invalid IL or missing references)
				//IL_02c1: Unknown result type (might be due to invalid IL or missing references)
				//IL_02cc: Unknown result type (might be due to invalid IL or missing references)
				//IL_02dd: Expected O, but got Unknown
				//IL_006a: Unknown result type (might be due to invalid IL or missing references)
				orig.Invoke(self, di);
				if (!((Object)(object)di.inflictor != (Object)null) || !((Object)(object)self != (Object)null) || !((Object)(object)di.attacker != (Object)null) || !((Object)(object)di.attacker.GetComponent<CharacterBody>() != (Object)null) || !(di.attacker.GetComponent<CharacterBody>().baseNameToken == "Templar_Survivor") || !((Enum)di.damageType.damageType).HasFlag((Enum)(object)(DamageType)262144) || !((Component)self).GetComponent<CharacterBody>().HasBuff(Buffs.ClayGoo) || ((Component)self).GetComponent<CharacterBody>().HasBuff(Buffs.TemplarigniteDebuff))
				{
					return;
				}
				((Component)self).GetComponent<CharacterBody>().AddTimedBuff(Buffs.TemplarigniteDebuff, 12f);
				if (Object.op_Implicit((Object)(object)((Component)self).GetComponent<CharacterBody>().modelLocator))
				{
					Transform modelTransform = ((Component)self).GetComponent<CharacterBody>().modelLocator.modelTransform;
					if (Object.op_Implicit((Object)(object)((Component)modelTransform).GetComponent<CharacterModel>()))
					{
						TemporaryOverlayInstance val = TemporaryOverlayManager.AddOverlay(((Component)modelTransform).gameObject);
						val.duration = 16f;
						val.animateShaderAlpha = true;
						val.alphaCurve = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f);
						val.destroyComponentOnEnd = true;
						val.originalMaterial = LegacyResourcesAPI.Load<Material>("Materials/matDoppelganger");
						val.AddToCharacterModel(((Component)modelTransform).GetComponent<CharacterModel>());
					}
					BlastAttack val2 = new BlastAttack
					{
						attacker = di.inflictor,
						inflictor = di.inflictor,
						teamIndex = (TeamIndex)1,
						baseForce = 0f,
						position = ((Component)self).transform.position,
						radius = 12f,
						falloffModel = (FalloffModel)0,
						crit = di.crit,
						baseDamage = di.damage * 0.2f,
						procCoefficient = di.procCoefficient
					};
					val2.damageType |= DamageTypeCombo.op_Implicit((DamageType)32);
					val2.Fire();
					BlastAttack val3 = new BlastAttack
					{
						attacker = di.inflictor,
						inflictor = di.inflictor,
						teamIndex = (TeamIndex)1,
						baseForce = 0f,
						position = ((Component)self).transform.position,
						radius = 16f,
						falloffModel = (FalloffModel)0,
						crit = false,
						baseDamage = 0f,
						procCoefficient = 0f,
						damageType = DamageTypeCombo.op_Implicit((DamageType)262144)
					};
					val3.Fire();
					EffectManager.SpawnEffect(LegacyResourcesAPI.Load<GameObject>("Prefabs/Effects/ImpactEffects/MagmaOrbExplosion"), new EffectData
					{
						origin = ((Component)self).transform.position,
						scale = 16f
					}, true);
				}
			}
		}

		internal static void HookSetup()
		{
			//IL_0015: 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_0020: Expected O, but got Unknown
			//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_0045: Expected O, but got Unknown
			object obj = <>c.<>9__0_0;
			if (obj == null)
			{
				hook_RecalculateStats val = delegate(orig_RecalculateStats orig, CharacterBody self)
				{
					orig.Invoke(self);
					if (Object.op_Implicit((Object)(object)self) && self.HasBuff(Buffs.TemplArmorBuff))
					{
						Reflection.SetPropertyValue<float>((object)self, "armor", self.armor + 50f);
					}
					if (Object.op_Implicit((Object)(object)self) && self.HasBuff(Buffs.TemplarstationaryArmorBuff))
					{
						Reflection.SetPropertyValue<float>((object)self, "armor", self.armor + 100f);
					}
					if (Object.op_Implicit((Object)(object)self) && self.HasBuff(Buffs.TemplarOverdriveBuff))
					{
						Reflection.SetPropertyValue<float>((object)self, "regen", self.regen * 12f);
						Reflection.SetPropertyValue<float>((object)self, "attackSpeed", self.attackSpeed * 1.5f);
					}
					if (Object.op_Implicit((Object)(object)self) && self.HasBuff(Buffs.TemplarigniteDebuff))
					{
						Reflection.SetPropertyValue<float>((object)self, "armor", self.armor - 45f);
						Reflection.SetPropertyValue<float>((object)self, "moveSpeed", self.moveSpeed * 0.8f);
					}
				};
				<>c.<>9__0_0 = val;
				obj = (object)val;
			}
			CharacterBody.RecalculateStats += (hook_RecalculateStats)obj;
			object obj2 = <>c.<>9__0_1;
			if (obj2 == null)
			{
				hook_TakeDamage val2 = delegate(orig_TakeDamage orig, HealthComponent self, DamageInfo di)
				{
					//IL_0183: 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_0194: Unknown result type (might be due to invalid IL or missing references)
					//IL_01a0: Unknown result type (might be due to invalid IL or missing references)
					//IL_01a2: Unknown result type (might be due to invalid IL or missing references)
					//IL_01a7: Unknown result type (might be due to invalid IL or missing references)
					//IL_01b2: Unknown result type (might be due to invalid IL or missing references)
					//IL_01b9: Unknown result type (might be due to invalid IL or missing references)
					//IL_01be: Unknown result type (might be due to invalid IL or missing references)
					//IL_01c3: 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_01d0: Unknown result type (might be due to invalid IL or missing references)
					//IL_01d5: 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)
					//IL_01f3: Unknown result type (might be due to invalid IL or missing references)
					//IL_0201: Expected O, but got Unknown
					//IL_0204: Unknown result type (might be due to invalid IL or missing references)
					//IL_020b: Unknown result type (might be due to invalid IL or missing references)
					//IL_0210: Unknown result type (might be due to invalid IL or missing references)
					//IL_0215: Unknown result type (might be due to invalid IL or missing references)
					//IL_021c: Unknown result type (might be due to invalid IL or missing references)
					//IL_0222: Unknown result type (might be due to invalid IL or missing references)
					//IL_0227: Unknown result type (might be due to invalid IL or missing references)
					//IL_0233: Unknown result type (might be due to invalid IL or missing references)
					//IL_023f: Unknown result type (might be due to invalid IL or missing references)
					//IL_0241: Unknown result type (might be due to invalid IL or missing references)
					//IL_0246: Unknown result type (might be due to invalid IL or missing references)
					//IL_0251: Unknown result type (might be due to invalid IL or missing references)
					//IL_0258: Unknown result type (might be due to invalid IL or missing references)
					//IL_025d: Unknown result type (might be due to invalid IL or missing references)
					//IL_0262: Unknown result type (might be due to invalid IL or missing references)
					//IL_026d: Unknown result type (might be due to invalid IL or missing references)
					//IL_026f: Unknown result type (might be due to invalid IL or missing references)
					//IL_0274: Unknown result type (might be due to invalid IL or missing references)
					//IL_027b: Unknown result type (might be due to invalid IL or missing references)
					//IL_0286: Unknown result type (might be due to invalid IL or missing references)
					//IL_0291: Unknown result type (might be due to invalid IL or missing references)
					//IL_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_02a3: Expected O, but got Unknown
					//IL_02a5: Unknown result type (might be due to invalid IL or missing references)
					//IL_02b5: Unknown result type (might be due to invalid IL or missing references)
					//IL_02ba: Unknown result type (might be due to invalid IL or missing references)
					//IL_02c1: Unknown result type (might be due to invalid IL or missing references)
					//IL_02cc: Unknown result type (might be due to invalid IL or missing references)
					//IL_02dd: Expected O, but got Unknown
					//IL_006a: Unknown result type (might be due to invalid IL or missing references)
					orig.Invoke(self, di);
					if ((Object)(object)di.inflictor != (Object)null && (Object)(object)self != (Object)null && (Object)(object)di.attacker != (Object)null && (Object)(object)di.attacker.GetComponent<CharacterBody>() != (Object)null && di.attacker.GetComponent<CharacterBody>().baseNameToken == "Templar_Survivor" && ((Enum)di.damageType.damageType).HasFlag((Enum)(object)(DamageType)262144) && ((Component)self).GetComponent<CharacterBody>().HasBuff(Buffs.ClayGoo) && !((Component)self).GetComponent<CharacterBody>().HasBuff(Buffs.TemplarigniteDebuff))
					{
						((Component)self).GetComponent<CharacterBody>().AddTimedBuff(Buffs.TemplarigniteDebuff, 12f);
						if (Object.op_Implicit((Object)(object)((Component)self).GetComponent<CharacterBody>().modelLocator))
						{
							Transform modelTransform = ((Component)self).GetComponent<CharacterBody>().modelLocator.modelTransform;
							if (Object.op_Implicit((Object)(object)((Component)modelTransform).GetComponent<CharacterModel>()))
							{
								TemporaryOverlayInstance val3 = TemporaryOverlayManager.AddOverlay(((Component)modelTransform).gameObject);
								val3.duration = 16f;
								val3.animateShaderAlpha = true;
								val3.alphaCurve = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f);
								val3.destroyComponentOnEnd = true;
								val3.originalMaterial = LegacyResourcesAPI.Load<Material>("Materials/matDoppelganger");
								val3.AddToCharacterModel(((Component)modelTransform).GetComponent<CharacterModel>());
							}
							BlastAttack val4 = new BlastAttack
							{
								attacker = di.inflictor,
								inflictor = di.inflictor,
								teamIndex = (TeamIndex)1,
								baseForce = 0f,
								position = ((Component)self).transform.position,
								radius = 12f,
								falloffModel = (FalloffModel)0,
								crit = di.crit,
								baseDamage = di.damage * 0.2f,
								procCoefficient = di.procCoefficient
							};
							val4.damageType |= DamageTypeCombo.op_Implicit((DamageType)32);
							val4.Fire();
							BlastAttack val5 = new BlastAttack
							{
								attacker = di.inflictor,
								inflictor = di.inflictor,
								teamIndex = (TeamIndex)1,
								baseForce = 0f,
								position = ((Component)self).transform.position,
								radius = 16f,
								falloffModel = (FalloffModel)0,
								crit = false,
								baseDamage = 0f,
								procCoefficient = 0f,
								damageType = DamageTypeCombo.op_Implicit((DamageType)262144)
							};
							val5.Fire();
							EffectManager.SpawnEffect(LegacyResourcesAPI.Load<GameObject>("Prefabs/Effects/ImpactEffects/MagmaOrbExplosion"), new EffectData
							{
								origin = ((Component)self).transform.position,
								scale = 16f
							}, true);
						}
					}
				};
				<>c.<>9__0_1 = val2;
				obj2 = (object)val2;
			}
			HealthComponent.TakeDamage += (hook_TakeDamage)obj2;
		}
	}
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[NetworkCompatibility(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("com.Tymmey.Templar", "Templar", "1.3.0")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class Main : BaseUnityPlugin
	{
		public static Main Instance;

		public static ManualLogSource Log;

		public static Harmony Harmony;

		public static PluginInfo pluginInfo;

		internal static List<GameObject> projectilePrefabs = new List<GameObject>();

		internal static List<SurvivorDef> survivorDefs = new List<SurvivorDef>();

		public static List<GameObject> bodyPrefabs = new List<GameObject>();

		internal static List<GameObject> masterPrefabs = new List<GameObject>();

		internal static List<Type> entityStates = new List<Type>();

		internal static List<SkillDef> skillDefs = new List<SkillDef>();

		internal static List<SkillFamily> skillFamilies = new List<SkillFamily>();

		public static bool IsBUDefined { get; private set; }

		public void Awake()
		{
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Expected O, but got Unknown
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Expected O, but got Unknown
			Instance = this;
			Log = ((BaseUnityPlugin)this).Logger;
			Harmony = new Harmony("com.Tymmey.Templar");
			pluginInfo = ((BaseUnityPlugin)this).Info;
			ReadConfig();
			Assets.Initialize();
			Buffs.RegisterBuffs();
			Projectiles.ProjectileSetup();
			Hook.HookSetup();
			Templar.TemplarSetup();
			TemplarItemDisplays.InitializeItemDisplays();
			ContentManager.collectContentPackProviders += new CollectContentPackProvidersDelegate(ContentManager_collectContentPackProviders);
			RoR2Application.onLoad = (Action)Delegate.Combine(RoR2Application.onLoad, new Action(AddItemDisplays));
		}

		public void ReadConfig()
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Expected O, but got Unknown
			//IL_0030: Expected O, but got Unknown
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: Expected O, but got Unknown
			//IL_0064: Expected O, but got Unknown
			//IL_0079: Unknown result type (might be due to invalid IL or missing references)
			//IL_008e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0098: Expected O, but got Unknown
			//IL_0098: Expected O, but got Unknown
			//IL_00ad: 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_00cc: Expected O, but got Unknown
			//IL_00cc: Expected O, but got Unknown
			//IL_00e1: 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_0100: Expected O, but got Unknown
			//IL_0100: Expected O, but got Unknown
			//IL_0115: 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_0134: Expected O, but got Unknown
			//IL_0134: Expected O, but got Unknown
			//IL_0149: Unknown result type (might be due to invalid IL or missing references)
			//IL_015e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0168: Expected O, but got Unknown
			//IL_0168: Expected O, but got Unknown
			//IL_017d: Unknown result type (might be due to invalid IL or missing references)
			//IL_018e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0198: Expected O, but got Unknown
			//IL_0198: Expected O, but got Unknown
			//IL_01ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cc: Expected O, but got Unknown
			//IL_01cc: Expected O, but got Unknown
			//IL_01e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0200: Expected O, but got Unknown
			//IL_0200: Expected O, but got Unknown
			//IL_0215: Unknown result type (might be due to invalid IL or missing references)
			//IL_022a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0234: Expected O, but got Unknown
			//IL_0234: Expected O, but got Unknown
			//IL_0249: Unknown result type (might be due to invalid IL or missing references)
			//IL_025e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0268: Expected O, but got Unknown
			//IL_0268: Expected O, but got Unknown
			//IL_027d: 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_029c: Expected O, but got Unknown
			//IL_029c: Expected O, but got Unknown
			//IL_02b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d0: Expected O, but got Unknown
			//IL_02d0: Expected O, but got Unknown
			//IL_02e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_02fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_0304: Expected O, but got Unknown
			//IL_0304: Expected O, but got Unknown
			//IL_0319: Unknown result type (might be due to invalid IL or missing references)
			//IL_032e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0338: Expected O, but got Unknown
			//IL_0338: Expected O, but got Unknown
			//IL_034d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0362: Unknown result type (might be due to invalid IL or missing references)
			//IL_036c: Expected O, but got Unknown
			//IL_036c: Expected O, but got Unknown
			//IL_0381: Unknown result type (might be due to invalid IL or missing references)
			//IL_0396: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a0: Expected O, but got Unknown
			//IL_03a0: Expected O, but got Unknown
			//IL_03b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_03d4: Expected O, but got Unknown
			//IL_03d4: Expected O, but got Unknown
			//IL_03e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_03fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_0408: Expected O, but got Unknown
			//IL_0408: Expected O, but got Unknown
			//IL_041d: Unknown result type (might be due to invalid IL or missing references)
			//IL_042e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0438: Expected O, but got Unknown
			//IL_0438: Expected O, but got Unknown
			//IL_044d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0462: Unknown result type (might be due to invalid IL or missing references)
			//IL_046c: Expected O, but got Unknown
			//IL_046c: Expected O, but got Unknown
			//IL_0481: Unknown result type (might be due to invalid IL or missing references)
			//IL_0496: Unknown result type (might be due to invalid IL or missing references)
			//IL_04a0: Expected O, but got Unknown
			//IL_04a0: Expected O, but got Unknown
			//IL_04b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_04ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_04d4: Expected O, but got Unknown
			//IL_04d4: Expected O, but got Unknown
			//IL_04e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_04fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_0508: Expected O, but got Unknown
			//IL_0508: Expected O, but got Unknown
			//IL_051d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0532: Unknown result type (might be due to invalid IL or missing references)
			//IL_053c: Expected O, but got Unknown
			//IL_053c: Expected O, but got Unknown
			//IL_0551: Unknown result type (might be due to invalid IL or missing references)
			//IL_0562: Unknown result type (might be due to invalid IL or missing references)
			//IL_056c: Expected O, but got Unknown
			//IL_056c: Expected O, but got Unknown
			//IL_0581: Unknown result type (might be due to invalid IL or missing references)
			//IL_0596: Unknown result type (might be due to invalid IL or missing references)
			//IL_05a0: Expected O, but got Unknown
			//IL_05a0: Expected O, but got Unknown
			//IL_05b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_05c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_05d0: Expected O, but got Unknown
			//IL_05d0: Expected O, but got Unknown
			//IL_05e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_05fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_0604: Expected O, but got Unknown
			//IL_0604: Expected O, but got Unknown
			//IL_0619: Unknown result type (might be due to invalid IL or missing references)
			//IL_062e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0638: Expected O, but got Unknown
			//IL_0638: Expected O, but got Unknown
			//IL_064d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0662: Unknown result type (might be due to invalid IL or missing references)
			//IL_066c: Expected O, but got Unknown
			//IL_066c: Expected O, but got Unknown
			//IL_0681: Unknown result type (might be due to invalid IL or missing references)
			//IL_0692: Unknown result type (might be due to invalid IL or missing references)
			//IL_069c: Expected O, but got Unknown
			//IL_069c: Expected O, but got Unknown
			//IL_06b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_06c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_06d0: Expected O, but got Unknown
			//IL_06d0: Expected O, but got Unknown
			//IL_06e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_06f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0700: Expected O, but got Unknown
			//IL_0700: Expected O, but got Unknown
			//IL_0715: Unknown result type (might be due to invalid IL or missing references)
			//IL_072a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0734: Expected O, but got Unknown
			//IL_0734: Expected O, but got Unknown
			//IL_0749: Unknown result type (might be due to invalid IL or missing references)
			//IL_075a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0764: Expected O, but got Unknown
			//IL_0764: Expected O, but got Unknown
			//IL_0779: Unknown result type (might be due to invalid IL or missing references)
			//IL_078e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0798: Expected O, but got Unknown
			//IL_0798: Expected O, but got Unknown
			//IL_07ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_07be: Unknown result type (might be due to invalid IL or missing references)
			//IL_07c8: Expected O, but got Unknown
			//IL_07c8: Expected O, but got Unknown
			//IL_07dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_07f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_07fc: Expected O, but got Unknown
			//IL_07fc: Expected O, but got Unknown
			//IL_0811: Unknown result type (might be due to invalid IL or missing references)
			//IL_0826: Unknown result type (might be due to invalid IL or missing references)
			//IL_0830: Expected O, but got Unknown
			//IL_0830: Expected O, but got Unknown
			//IL_0845: Unknown result type (might be due to invalid IL or missing references)
			//IL_085a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0864: Expected O, but got Unknown
			//IL_0864: Expected O, but got Unknown
			//IL_0879: Unknown result type (might be due to invalid IL or missing references)
			//IL_088e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0898: Expected O, but got Unknown
			//IL_0898: Expected O, but got Unknown
			//IL_08ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_08c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_08cc: Expected O, but got Unknown
			//IL_08cc: Expected O, but got Unknown
			Templar.baseDamage = ((BaseUnityPlugin)this).Config.Bind<float>(new ConfigDefinition("1 - Templar", "Damage"), 12f, new ConfigDescription("Base damage", (AcceptableValueBase)null, Array.Empty<object>()));
			Templar.damageGrowth = ((BaseUnityPlugin)this).Config.Bind<float>(new ConfigDefinition("1 - Templar", "Damage growth"), 2.4f, new ConfigDescription("Damage per level", (AcceptableValueBase)null, Array.Empty<object>()));
			Templar.baseHealth = ((BaseUnityPlugin)this).Config.Bind<float>(new ConfigDefinition("1 - Templar", "Health"), 200f, new ConfigDescription("Base health", (AcceptableValueBase)null, Array.Empty<object>()));
			Templar.healthGrowth = ((BaseUnityPlugin)this).Config.Bind<float>(new ConfigDefinition("1 - Templar", "Health growth"), 48f, new ConfigDescription("Health per level", (AcceptableValueBase)null, Array.Empty<object>()));
			Templar.baseArmor = ((BaseUnityPlugin)this).Config.Bind<float>(new ConfigDefinition("1 - Templar", "Armor"), 15f, new ConfigDescription("Base armor", (AcceptableValueBase)null, Array.Empty<object>()));
			Templar.baseRegen = ((BaseUnityPlugin)this).Config.Bind<float>(new ConfigDefinition("1 - Templar", "Regen"), 0.5f, new ConfigDescription("Base HP regen", (AcceptableValueBase)null, Array.Empty<object>()));
			Templar.regenGrowth = ((BaseUnityPlugin)this).Config.Bind<float>(new ConfigDefinition("1 - Templar", "Regen growth"), 0.5f, new ConfigDescription("HP regen per level", (AcceptableValueBase)null, Array.Empty<object>()));
			Templar.bazookaGoBoom = ((BaseUnityPlugin)this).Config.Bind<bool>(new ConfigDefinition("1 - Templar", "Mini Bazooka Primary"), false, new ConfigDescription("Enables Bazooka Mk.2", (AcceptableValueBase)null, Array.Empty<object>()));
			Templar.minigunDamageCoefficient = ((BaseUnityPlugin)this).Config.Bind<float>(new ConfigDefinition("2 - Minigun", "Damage"), 0.4f, new ConfigDescription("Minigun damage per bullet", (AcceptableValueBase)null, Array.Empty<object>()));
			Templar.minigunProcCoefficient = ((BaseUnityPlugin)this).Config.Bind<float>(new ConfigDefinition("2 - Minigun", "Proc Coefficient"), 0.4f, new ConfigDescription("Minigun proc coefficient per bullet", (AcceptableValueBase)null, Array.Empty<object>()));
			Templar.minigunForce = ((BaseUnityPlugin)this).Config.Bind<float>(new ConfigDefinition("2 - Minigun", "Force"), 3f, new ConfigDescription("Minigun bullet force", (AcceptableValueBase)null, Array.Empty<object>()));
			Templar.minigunArmorBoost = ((BaseUnityPlugin)this).Config.Bind<float>(new ConfigDefinition("2 - Minigun", "Armor Bonus"), 50f, new ConfigDescription("Bonus armor while firing", (AcceptableValueBase)null, Array.Empty<object>()));
			Templar.minigunStationaryArmorBoost = ((BaseUnityPlugin)this).Config.Bind<float>(new ConfigDefinition("2 - Minigun", "Stationary Armor Bonus"), 100f, new ConfigDescription("Bonus armor while standing still and firing", (AcceptableValueBase)null, Array.Empty<object>()));
			Templar.minigunMinFireRate = ((BaseUnityPlugin)this).Config.Bind<float>(new ConfigDefinition("2 - Minigun", "Minimum Fire Rate"), 0.75f, new ConfigDescription("Starting fire rate", (AcceptableValueBase)null, Array.Empty<object>()));
			Templar.minigunMaxFireRate = ((BaseUnityPlugin)this).Config.Bind<float>(new ConfigDefinition("2 - Minigun", "Maximum Fire Rate"), 1.35f, new ConfigDescription("Max fire rate", (AcceptableValueBase)null, Array.Empty<object>()));
			Templar.minigunFireRateGrowth = ((BaseUnityPlugin)this).Config.Bind<float>(new ConfigDefinition("2 - Minigun", "Fire Rate Growth"), 0.01f, new ConfigDescription("Amount the fire rate increases per shot", (AcceptableValueBase)null, Array.Empty<object>()));
			Templar.rifleDamageCoefficient = ((BaseUnityPlugin)this).Config.Bind<float>(new ConfigDefinition("3 - Tar Rifle", "Damage"), 0.5f, new ConfigDescription("Rifle damage per bullet", (AcceptableValueBase)null, Array.Empty<object>()));
			Templar.rifleProcCoefficient = ((BaseUnityPlugin)this).Config.Bind<float>(new ConfigDefinition("3 - Tar Rifle", "Proc Coefficient"), 0.7f, new ConfigDescription("Rifle proc coefficient per bullet", (AcceptableValueBase)null, Array.Empty<object>()));
			Templar.rifleForce = ((BaseUnityPlugin)this).Config.Bind<float>(new ConfigDefinition("3 - Tar Rifle", "Force"), 5f, new ConfigDescription("Rifle bullet force", (AcceptableValueBase)null, Array.Empty<object>()));
			Templar.rifleFireRate = ((BaseUnityPlugin)this).Config.Bind<float>(new ConfigDefinition("3 - Tar Rifle", "Fire Rate"), 1.6f, new ConfigDescription("Higher value = lower fire rate, due to spaghetti code", (AcceptableValueBase)null, Array.Empty<object>()));
			Templar.clayGrenadeStock = ((BaseUnityPlugin)this).Config.Bind<int>(new ConfigDefinition("4 - Clay Bomb", "Stock"), 2, new ConfigDescription("Maximum stock", (AcceptableValueBase)null, Array.Empty<object>()));
			Templar.clayGrenadeCooldown = ((BaseUnityPlugin)this).Config.Bind<float>(new ConfigDefinition("4 - Clay Bomb", "Cooldown"), 5f, new ConfigDescription("Bomb cooldown", (AcceptableValueBase)null, Array.Empty<object>()));
			Templar.clayGrenadeDamageCoefficient = ((BaseUnityPlugin)this).Config.Bind<float>(new ConfigDefinition("4 - Clay Bomb", "Damage"), 4f, new ConfigDescription("Explosion damage", (AcceptableValueBase)null, Array.Empty<object>()));
			Templar.clayGrenadeProcCoefficient = ((BaseUnityPlugin)this).Config.Bind<float>(new ConfigDefinition("4 - Clay Bomb", "Proc Coefficient"), 0.8f, new ConfigDescription("Explosion proc coefficient", (AcceptableValueBase)null, Array.Empty<object>()));
			Templar.clayGrenadeRadius = ((BaseUnityPlugin)this).Config.Bind<float>(new ConfigDefinition("4 - Clay Bomb", "Radius"), 12f, new ConfigDescription("Explosion radius", (AcceptableValueBase)null, Array.Empty<object>()));
			Templar.clayGrenadeDetonationTime = ((BaseUnityPlugin)this).Config.Bind<float>(new ConfigDefinition("4 - Clay Bomb", "Detonation Time"), 0.15f, new ConfigDescription("The time it takes to explode after hitting something", (AcceptableValueBase)null, Array.Empty<object>()));
			Templar.blunderbussStock = ((BaseUnityPlugin)this).Config.Bind<int>(new ConfigDefinition("5 - Blunderbuss", "Stock"), 2, new ConfigDescription("Maximum stock", (AcceptableValueBase)null, Array.Empty<object>()));
			Templar.blunderbussCooldown = ((BaseUnityPlugin)this).Config.Bind<float>(new ConfigDefinition("5 - Blunderbuss", "Cooldown"), 2.5f, new ConfigDescription("Cooldown per shot", (AcceptableValueBase)null, Array.Empty<object>()));
			Templar.blunderbussPelletCount = ((BaseUnityPlugin)this).Config.Bind<int>(new ConfigDefinition("5 - Blunderbuss", "Pellet count"), 6, new ConfigDescription("Pellets fired per shot", (AcceptableValueBase)null, Array.Empty<object>()));
			Templar.blunderbussDamageCoefficient = ((BaseUnityPlugin)this).Config.Bind<float>(new ConfigDefinition("5 - Blunderbuss", "Damage"), 1f, new ConfigDescription("Pellet damage", (AcceptableValueBase)null, Array.Empty<object>()));
			Templar.blunderbussProcCoefficient = ((BaseUnityPlugin)this).Config.Bind<float>(new ConfigDefinition("5 - Blunderbuss", "Proc Coefficient"), 1f, new ConfigDescription("Pellet proc coefficient", (AcceptableValueBase)null, Array.Empty<object>()));
			Templar.blunderbussSpread = ((BaseUnityPlugin)this).Config.Bind<float>(new ConfigDefinition("5 - Blunderbuss", "Pellet spread"), 10f, new ConfigDescription("Pellet spread when fired", (AcceptableValueBase)null, Array.Empty<object>()));
			Templar.tarStock = ((BaseUnityPlugin)this).Config.Bind<int>(new ConfigDefinition("6 - Tar Blast", "Stock"), 1, new ConfigDescription("Maximum stock", (AcceptableValueBase)null, Array.Empty<object>()));
			Templar.tarCooldown = ((BaseUnityPlugin)this).Config.Bind<float>(new ConfigDefinition("6 - Tar Blast", "Cooldown"), 1f, new ConfigDescription("Cooldown", (AcceptableValueBase)null, Array.Empty<object>()));
			Templar.overdriveStock = ((BaseUnityPlugin)this).Config.Bind<int>(new ConfigDefinition("6 - Tar Overdrive", "Stock"), 1, new ConfigDescription("Maximum stock", (AcceptableValueBase)null, Array.Empty<object>()));
			Templar.overdriveCooldown = ((BaseUnityPlugin)this).Config.Bind<float>(new ConfigDefinition("6 - Tar Overdrive", "Cooldown"), 12f, new ConfigDescription("Cooldown", (AcceptableValueBase)null, Array.Empty<object>()));
			Templar.dashStock = ((BaseUnityPlugin)this).Config.Bind<int>(new ConfigDefinition("7 - Sidestep", "Stock"), 2, new ConfigDescription("Maximum stock", (AcceptableValueBase)null, Array.Empty<object>()));
			Templar.dashCooldown = ((BaseUnityPlugin)this).Config.Bind<float>(new ConfigDefinition("7 - Sidestep", "Cooldown"), 7f, new ConfigDescription("Cooldown", (AcceptableValueBase)null, Array.Empty<object>()));
			Templar.bazookaStock = ((BaseUnityPlugin)this).Config.Bind<int>(new ConfigDefinition("8 - Bazooka", "Stock"), 1, new ConfigDescription("Maximum stock", (AcceptableValueBase)null, Array.Empty<object>()));
			Templar.bazookaCooldown = ((BaseUnityPlugin)this).Config.Bind<float>(new ConfigDefinition("8 - Bazooka", "Cooldown"), 14f, new ConfigDescription("Bazooka cooldown", (AcceptableValueBase)null, Array.Empty<object>()));
			Templar.bazookaDamageCoefficient = ((BaseUnityPlugin)this).Config.Bind<float>(new ConfigDefinition("8 - Bazooka", "Damage"), 12f, new ConfigDescription("Bazooka damage", (AcceptableValueBase)null, Array.Empty<object>()));
			Templar.bazookaProcCoefficient = ((BaseUnityPlugin)this).Config.Bind<float>(new ConfigDefinition("8 - Bazooka", "Proc Coefficient"), 0.6f, new ConfigDescription("Bazooka proc coefficient", (AcceptableValueBase)null, Array.Empty<object>()));
			Templar.bazookaBlastRadius = ((BaseUnityPlugin)this).Config.Bind<float>(new ConfigDefinition("8 - Bazooka", "Blast Radius"), 16f, new ConfigDescription("Bazooka blast radius", (AcceptableValueBase)null, Array.Empty<object>()));
			Templar.miniBazookaDamageCoefficient = ((BaseUnityPlugin)this).Config.Bind<float>(new ConfigDefinition("8 - Bazooka Mk.2", "Damage"), 5f, new ConfigDescription("Bazooka Mk.2 damage", (AcceptableValueBase)null, Array.Empty<object>()));
			Templar.EnableTemplarSkin = ((BaseUnityPlugin)this).Config.Bind<bool>("9 - TemplarSkins", "Add Templar Recolors", false, "Set to false to disable it.");
			Templar.EnableEngiVoidSkin = ((BaseUnityPlugin)this).Config.Bind<bool>("9 - TemplarSkins", "Engi Void Skin", false, "Set to false to disable it.");
			Templar.EnableMalignantOrigins = ((BaseUnityPlugin)this).Config.Bind<bool>("9 - TemplarSkins", "Malignant Origins", true, "Set to false to disable it.");
			Templar.EnableUnlocks = ((BaseUnityPlugin)this).Config.Bind<bool>("9 - TemplarSkins", "Unlocks", true, "Set to false to disable it.");
		}

		public static void AddItemDisplays()
		{
			TemplarItemDisplays.SetItemDisplays();
		}

		private void ContentManager_collectContentPackProviders(AddContentPackProviderDelegate addContentPackProvider)
		{
			addContentPackProvider.Invoke((IContentPackProvider)(object)new ContentPacks());
		}

		public static bool Mods(params string[] arr)
		{
			for (int i = 0; i < arr.Length; i++)
			{
				if (!Chainloader.PluginInfos.ContainsKey(arr[i]))
				{
					return false;
				}
			}
			return true;
		}
	}
	public static class Projectiles
	{
		internal static void ProjectileSetup()
		{
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a2: 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_00d0: 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_01f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0210: Unknown result type (might be due to invalid IL or missing references)
			//IL_021a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0278: Unknown result type (might be due to invalid IL or missing references)
			//IL_0282: Unknown result type (might be due to invalid IL or missing references)
			//IL_0323: Unknown result type (might be due to invalid IL or missing references)
			//IL_0328: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ef: Unknown result type (might be due to invalid IL or missing references)
			Templar.templarGrenade = PrefabAPI.InstantiateClone(LegacyResourcesAPI.Load<GameObject>("Prefabs/Projectiles/CommandoGrenadeProjectile"), "TemplarGrenadeProjectile");
			((ProjectileExplosion)Templar.templarGrenade.GetComponent<ProjectileImpactExplosion>()).blastDamageCoefficient = 4f;
			((ProjectileExplosion)Templar.templarGrenade.GetComponent<ProjectileImpactExplosion>()).blastProcCoefficient = 0.8f;
			((ProjectileExplosion)Templar.templarGrenade.GetComponent<ProjectileImpactExplosion>()).blastRadius = 12f;
			((ProjectileExplosion)Templar.templarGrenade.GetComponent<ProjectileImpactExplosion>()).falloffModel = (FalloffModel)1;
			Templar.templarGrenade.GetComponent<ProjectileImpactExplosion>().lifetimeAfterImpact = 0.15f;
			Templar.templarGrenade.GetComponent<ProjectileImpactExplosion>().impactEffect = LegacyResourcesAPI.Load<GameObject>("Prefabs/Effects/ImpactEffects/ExplosivePotExplosion");
			Templar.templarGrenade.GetComponent<ProjectileDamage>().damageType = DamageTypeCombo.op_Implicit((DamageType)512);
			GameObject val = PrefabAPI.InstantiateClone(Assets.clayBombModel, "TemplarBombModel");
			val.AddComponent<ProjectileGhostController>();
			Transform child = val.transform.GetChild(0);
			child.localScale *= 0.5f;
			Templar.templarGrenade.GetComponent<ProjectileController>().ghostPrefab = val;
			val.AddComponent<NetworkIdentity>();
			Templar.templarRocket = PrefabAPI.InstantiateClone(LegacyResourcesAPI.Load<GameObject>("Prefabs/Projectiles/LemurianBigFireball"), "TemplarRocketProjectile");
			((ProjectileExplosion)Templar.templarRocket.GetComponent<ProjectileImpactExplosion>()).blastDamageCoefficient = 1f;
			((ProjectileExplosion)Templar.templarRocket.GetComponent<ProjectileImpactExplosion>()).blastRadius = 16f;
			((ProjectileExplosion)Templar.templarRocket.GetComponent<ProjectileImpactExplosion>()).blastProcCoefficient = 0.8f;
			Templar.templarRocket.GetComponent<ProjectileImpactExplosion>().destroyOnEnemy = true;
			Templar.templarRocket.GetComponent<ProjectileImpactExplosion>().destroyOnWorld = true;
			if ((Object)(object)Templar.templarRocket.GetComponent<MissileController>() != (Object)null)
			{
				Object.Destroy((Object)(object)Templar.templarRocket.GetComponent<MissileController>());
			}
			Templar.templarRocket.AddComponent<Templar.TemplarMissileController>();
			GameObject val2 = PrefabAPI.InstantiateClone(Assets.clayMissileModel, "TemplarMissileModel");
			val2.AddComponent<ProjectileGhostController>();
			val2.transform.GetChild(1).SetParent(val2.transform.GetChild(0));
			val2.transform.GetChild(0).localRotation = Quaternion.Euler(0f, 90f, 0f);
			Transform child2 = val2.transform.GetChild(0);
			child2.localScale *= 0.5f;
			val2.transform.GetChild(0).GetChild(0).GetChild(0)
				.SetParent(val2.transform.GetChild(0));
			GameObject gameObject = ((Component)val2.transform.GetChild(0).GetChild(0)).gameObject;
			gameObject.AddComponent<Templar.TemplarSeparateFromParent>();
			Transform transform = gameObject.transform;
			transform.localScale *= 0.8f;
			Templar.templarRocket.GetComponent<ProjectileController>().ghostPrefab = val2;
			Templar.templarRocketEffect = PrefabAPI.InstantiateClone(Templar.templarRocket.GetComponent<ProjectileImpactExplosion>().impactEffect, "TemplarRocketImpact");
			Templar.templarRocketEffect.AddComponent<Templar.TemplarExplosionForce>();
			if (Object.op_Implicit((Object)(object)Templar.templarRocketEffect.GetComponent<VFXAttributes>()))
			{
				Templar.templarRocketEffect.GetComponent<VFXAttributes>().vfxPriority = (VFXPriority)2;
			}
			ContentAddition.AddEffect(Templar.templarRocketEffect);
			Templar.templarRocket.GetComponent<ProjectileImpactExplosion>().impactEffect = Templar.templarRocketEffect;
			Templar.templarRocket.GetComponent<ProjectileDamage>().damageType = DamageTypeCombo.op_Implicit((DamageType)262144);
			val2.AddComponent<NetworkIdentity>();
			Templar.templarRocketEffect.AddComponent<NetworkIdentity>();
			Main.projectilePrefabs.Add(Templar.templarGrenade);
			Main.projectilePrefabs.Add(Templar.templarRocket);
		}
	}
	public class ChargeRailgun : BaseState
	{
		private float minChargeDuration;

		private float chargeDuration;

		private GameObject chargeInstance;

		private bool released;

		private Transform muzzleTransform;

		public override void OnEnter()
		{
			//IL_00b0: 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)
			((BaseState)this).OnEnter();
			((EntityState)this).characterBody._defaultCrosshairPrefab = LegacyResourcesAPI.Load<GameObject>("prefabs/crosshair/SMGCrosshair");
			minChargeDuration = 0.75f * (ChargeSpear.baseMinChargeDuration / base.attackSpeedStat);
			chargeDuration = 0.75f * (ChargeSpear.baseChargeDuration / base.attackSpeedStat);
			Util.PlaySound(MinigunSpinUp.sound, ((EntityState)this).gameObject);
			((EntityState)this).GetModelAnimator().SetBool("WeaponIsReady", true);
			muzzleTransform = ((BaseState)this).FindModelChild(MinigunState.muzzleName);
			if (Object.op_Implicit((Object)(object)muzzleTransform) && Object.op_Implicit((Object)(object)MinigunSpinUp.chargeEffectPrefab))
			{
				chargeInstance = Object.Instantiate<GameObject>(MinigunSpinUp.chargeEffectPrefab, muzzleTransform.position, muzzleTransform.rotation);
				chargeInstance.transform.parent = muzzleTransform;
				ScaleParticleSystemDuration component = chargeInstance.GetComponent<ScaleParticleSystemDuration>();
				if (Object.op_Implicit((Object)(object)component))
				{
					component.newDuration = minChargeDuration;
				}
			}
		}

		public override void OnExit()
		{
			((EntityState)this).characterBody._defaultCrosshairPrefab = LegacyResourcesAPI.Load<GameObject>("prefabs/crosshair/SimpleDotCrosshair");
			if (Object.op_Implicit((Object)(object)chargeInstance))
			{
				EntityState.Destroy((Object)(object)chargeInstance);
			}
			((EntityState)this).PlayCrossfade("Gesture, Additive", "BufferEmpty", 0.2f);
			((EntityState)this).GetModelAnimator().SetBool("WeaponIsReady", false);
			((EntityState)this).OnExit();
		}

		public override void Update()
		{
			((EntityState)this).Update();
			((EntityState)this).characterBody.SetSpreadBloom(1f - ((EntityState)this).age / chargeDuration, true);
		}

		public override void FixedUpdate()
		{
			//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ee: Expected O, but got Unknown
			((EntityState)this).FixedUpdate();
			((BaseState)this).StartAimMode(2f, false);
			float num = ((EntityState)this).fixedAge - chargeDuration;
			if (num >= 0f)
			{
				float perfectChargeWindow = ChargeSpear.perfectChargeWindow;
			}
			float charge = chargeDuration / ((EntityState)this).fixedAge;
			if (((EntityState)this).isAuthority)
			{
				if (!released && (!Object.op_Implicit((Object)(object)((EntityState)this).inputBank) || !((EntityState)this).inputBank.skill1.down))
				{
					released = true;
				}
				if (released && ((EntityState)this).fixedAge >= minChargeDuration)
				{
					((EntityState)this).outer.SetNextState((EntityState)new FireSpear
					{
						charge = charge
					});
				}
			}
		}

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

		public override void ModifyBullet(BulletAttack bulletAttack)
		{
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			((GenericBulletBaseState)this).ModifyBullet(bulletAttack);
			bulletAttack.stopperMask = ((LayerIndex)(ref LayerIndex.world)).mask;
			bulletAttack.falloffModel = (FalloffModel)0;
		}

		public override void FireBullet(Ray aimRay)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			((GenericBulletBaseState)this).FireBullet(aimRay);
			((EntityState)this).characterBody.SetSpreadBloom(0.2f, false);
			((BaseState)this).AddRecoil(-0.6f * FireSpear.recoilAmplitude, -0.8f * FireSpear.recoilAmplitude, -0.1f * FireSpear.recoilAmplitude, 0.1f * FireSpear.recoilAmplitude);
			((EntityState)this).GetModelAnimator().SetBool("WeaponIsReady", false);
		}
	}
	public class TemplarChargeBeam : BaseState
	{
		public static float baseDuration = 1f;

		public static float laserMaxWidth = 0.2f;

		private float duration;

		private uint chargePlayID;

		private GameObject chargeEffect;

		private GameObject laserEffect;

		private LineRenderer laserLineComponent;

		private Vector3 laserDirection;

		private Vector3 visualEndPosition;

		private float flashTimer;

		private bool laserOn;

		private Animator animator;

		public override void OnEnter()
		{
			//IL_0101: Unknown result type (might be due to invalid IL or missing references)
			//IL_0108: Unknown result type (might be due to invalid IL or missing references)
			//IL_017e: 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)
			((BaseState)this).OnEnter();
			duration = baseDuration / base.attackSpeedStat;
			Transform modelTransform = ((EntityState)this).GetModelTransform();
			animator = ((EntityState)this).GetModelAnimator();
			((BaseState)this).StartAimMode(duration + 2f, false);
			animator.SetBool("WeaponIsReady", true);
			((EntityState)this).characterBody._defaultCrosshairPrefab = LegacyResourcesAPI.Load<GameObject>("Prefabs/Crosshair/BanditCrosshair");
			chargePlayID = Util.PlayAttackSpeedSound(ChargeLaser.attackSoundString, ((EntityState)this).gameObject, base.attackSpeedStat);
			if (Object.op_Implicit((Object)(object)modelTransform))
			{
				ChildLocator component = ((Component)modelTransform).GetComponent<ChildLocator>();
				if (Object.op_Implicit((Object)(object)component))
				{
					Transform val = component.FindChild(MinigunState.muzzleName);
					if (Object.op_Implicit((Object)(object)val))
					{
						if (Object.op_Implicit((Object)(object)ChargeLaser.effectPrefab))
						{
							chargeEffect = Object.Instantiate<GameObject>(ChargeLaser.effectPrefab, val.position, val.rotation);
							chargeEffect.transform.parent = val;
							ScaleParticleSystemDuration component2 = chargeEffect.GetComponent<ScaleParticleSystemDuration>();
							if (Object.op_Implicit((Object)(object)component2))
							{
								component2.newDuration = duration;
							}
						}
						if (Object.op_Implicit((Object)(object)ChargeLaser.laserPrefab))
						{
							laserEffect = Object.Instantiate<GameObject>(ChargeLaser.laserPrefab, val.position, val.rotation);
							laserEffect.transform.parent = val;
							laserLineComponent = laserEffect.GetComponent<LineRenderer>();
						}
					}
				}
			}
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterBody))
			{
				((EntityState)this).characterBody.SetAimTimer(duration);
			}
			flashTimer = 0f;
			laserOn = true;
		}

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

		public override void Update()
		{
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_0063: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: 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_0086: 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_00c5: 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)
			((EntityState)this).Update();
			if (!Object.op_Implicit((Object)(object)laserEffect) || !Object.op_Implicit((Object)(object)laserLineComponent))
			{
				return;
			}
			float num = 1000f;
			Ray aimRay = ((BaseState)this).GetAimRay();
			Vector3 position = laserEffect.transform.parent.position;
			Vector3 point = ((Ray)(ref aimRay)).GetPoint(num);
			laserDirection = point - position;
			RaycastHit val = default(RaycastHit);
			if (Physics.Raycast(aimRay, ref val, num, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask) | LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.entityPrecise)).mask)))
			{
				point = ((RaycastHit)(ref val)).point;
			}
			laserLineComponent.SetPosition(0, position);
			laserLineComponent.SetPosition(1, point);
			float num2;
			if (duration - ((EntityState)this).age > 0.5f)
			{
				num2 = ((EntityState)this).age / duration;
			}
			else
			{
				flashTimer -= Time.deltaTime;
				if (flashTimer <= 0f)
				{
					laserOn = !laserOn;
					flashTimer = 1f / 30f;
				}
				num2 = (laserOn ? 1f : 0f);
			}
			num2 *= laserMaxWidth;
			laserLineComponent.startWidth = num2;
			laserLineComponent.endWidth = num2;
		}

		public override void FixedUpdate()
		{
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)this).FixedUpdate();
			if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority)
			{
				TemplarFireBeam nextState = new TemplarFireBeam
				{
					laserDirection = laserDirection
				};
				((EntityState)this).outer.SetNextState((EntityState)(object)nextState);
			}
		}

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

		private float duration;

		private GameObject chargeInstance;

		protected ref ButtonState skillButtonState => ref ((EntityState)this).inputBank.skill1;

		public override void OnEnter()
		{
			//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
			((BaseState)this).OnEnter();
			duration = baseDuration / base.attackSpeedStat;
			Object modelAnimator = (Object)(object)((EntityState)this).GetModelAnimator();
			Transform modelTransform = ((EntityState)this).GetModelTransform();
			((EntityState)this).GetModelAnimator().SetBool("WeaponIsReady", true);
			((EntityState)this).PlayCrossfade("Gesture, Additive", "FireMinigun", 0.2f);
			((EntityState)this).characterBody._defaultCrosshairPrefab = LegacyResourcesAPI.Load<GameObject>("prefabs/crosshair/ToolbotGrenadeLauncherCrosshair");
			Util.PlayAttackSpeedSound(ChargeMegaFireball.attackString, ((EntityState)this).gameObject, base.attackSpeedStat);
			if (!Object.op_Implicit((Object)(object)modelTransform))
			{
				return;
			}
			ChildLocator component = ((Component)modelTransform).GetComponent<ChildLocator>();
			if (!Object.op_Implicit((Object)(object)component))
			{
				return;
			}
			Transform val = component.FindChild(MinigunState.muzzleName);
			if (Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)ChargeMegaFireball.chargeEffectPrefab))
			{
				chargeInstance = Object.Instantiate<GameObject>(ChargeMegaFireball.chargeEffectPrefab, val.position, val.rotation);
				chargeInstance.transform.parent = val;
				ScaleParticleSystemDuration component2 = chargeInstance.GetComponent<ScaleParticleSystemDuration>();
				if (Object.op_Implicit((Object)(object)component2))
				{
					component2.newDuration = duration;
				}
			}
		}

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

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

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			((BaseState)this).StartAimMode(2f, false);
			if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority)
			{
				TemplarFireMiniRocket nextState = new TemplarFireMiniRocket();
				((EntityState)this).outer.SetNextState((EntityState)(object)nextState);
			}
		}

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

		private float duration;

		private GameObject chargeInstance;

		protected ref ButtonState skillButtonState => ref ((EntityState)this).inputBank.skill4;

		public override void OnEnter()
		{
			//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
			((BaseState)this).OnEnter();
			duration = baseDuration / base.attackSpeedStat;
			Object modelAnimator = (Object)(object)((EntityState)this).GetModelAnimator();
			Transform modelTransform = ((EntityState)this).GetModelTransform();
			((EntityState)this).GetModelAnimator().SetBool("WeaponIsReady", true);
			((EntityState)this).PlayCrossfade("Gesture, Additive", "FireMinigun", 0.2f);
			((EntityState)this).characterBody._defaultCrosshairPrefab = LegacyResourcesAPI.Load<GameObject>("prefabs/crosshair/ToolbotGrenadeLauncherCrosshair");
			Util.PlayAttackSpeedSound(ChargeMegaFireball.attackString, ((EntityState)this).gameObject, base.attackSpeedStat);
			if (!Object.op_Implicit((Object)(object)modelTransform))
			{
				return;
			}
			ChildLocator component = ((Component)modelTransform).GetComponent<ChildLocator>();
			if (!Object.op_Implicit((Object)(object)component))
			{
				return;
			}
			Transform val = component.FindChild(MinigunState.muzzleName);
			if (Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)ChargeMegaFireball.chargeEffectPrefab))
			{
				chargeInstance = Object.Instantiate<GameObject>(ChargeMegaFireball.chargeEffectPrefab, val.position, val.rotation);
				chargeInstance.transform.parent = val;
				ScaleParticleSystemDuration component2 = chargeInstance.GetComponent<ScaleParticleSystemDuration>();
				if (Object.op_Implicit((Object)(object)component2))
				{
					component2.newDuration = duration;
				}
			}
		}

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

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

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			((BaseState)this).StartAimMode(2f, false);
			if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority && !skillButtonState.down)
			{
				TemplarFireRocket nextState = new TemplarFireRocket();
				((EntityState)this).outer.SetNextState((EntityState)(object)nextState);
			}
		}

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

		public static float procCoefficient = 1f;

		public static float force = 500f;

		public static float minSpread = 0f;

		public static float maxSpread = 0f;

		public static int bulletCount = 1;

		public static float baseDuration = 0.5f;

		public static float radius = 1.25f;

		public float recoilAmplitude = 10f;

		public float bloom = 6f;

		public Vector3 laserDirection;

		private float duration;

		private Ray modifiedAimRay;

		private Animator animator;

		public override void OnEnter()
		{
			//IL_001c: 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_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_0110: Unknown result type (might be due to invalid IL or missing references)
			//IL_011b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0122: Unknown result type (might be due to invalid IL or missing references)
			//IL_0127: Unknown result type (might be due to invalid IL or missing references)
			//IL_012c: 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_013d: Unknown result type (might be due to invalid IL or missing references)
			//IL_014c: Unknown result type (might be due to invalid IL or missing references)
			//IL_015c: 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_018a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0196: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_01af: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01de: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_020b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0216: Unknown result type (might be due to invalid IL or missing references)
			//IL_0218: Unknown result type (might be due to invalid IL or missing references)
			//IL_021d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0228: Unknown result type (might be due to invalid IL or missing references)
			//IL_0233: Unknown result type (might be due to invalid IL or missing references)
			//IL_023e: Unknown result type (might be due to invalid IL or missing references)
			//IL_025a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0261: Unknown result type (might be due to invalid IL or missing references)
			//IL_026c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0273: Unknown result type (might be due to invalid IL or missing references)
			//IL_0279: Unknown result type (might be due to invalid IL or missing references)
			//IL_027e: Unknown result type (might be due to invalid IL or missing references)
			//IL_017d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0182: Unknown result type (might be due to invalid IL or missing references)
			((BaseState)this).OnEnter();
			duration = baseDuration / base.attackSpeedStat;
			modifiedAimRay = ((BaseState)this).GetAimRay();
			((Ray)(ref modifiedAimRay)).direction = laserDirection;
			animator = ((EntityState)this).GetModelAnimator();
			Transform modelTransform = ((EntityState)this).GetModelTransform();
			Ray aimRay = ((BaseState)this).GetAimRay();
			((BaseState)this).StartAimMode(2f, false);
			float num = recoilAmplitude / base.attackSpeedStat;
			((BaseState)this).AddRecoil(-1f * num, -1.5f * num, -0.25f * num, 0.25f * num);
			((EntityState)this).characterBody.AddSpreadBloom(bloom);
			Util.PlayAttackSpeedSound(FireLaser.attackSoundString, ((EntityState)this).gameObject, 2f);
			string muzzleName = MinigunState.muzzleName;
			if (Object.op_Implicit((Object)(object)FireLaser.effectPrefab))
			{
				EffectManager.SimpleMuzzleFlash(FireLaser.effectPrefab, ((EntityState)this).gameObject, muzzleName, false);
			}
			if (((EntityState)this).isAuthority)
			{
				float num2 = 1000f;
				Vector3 val = ((Ray)(ref modifiedAimRay)).origin + ((Ray)(ref modifiedAimRay)).direction * num2;
				RaycastHit val2 = default(RaycastHit);
				if (Physics.Raycast(modifiedAimRay, ref val2, num2, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask) | LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.defaultLayer)).mask) | LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.entityPrecise)).mask)))
				{
					val = ((RaycastHit)(ref val2)).point;
				}
				new BulletAttack
				{
					owner = ((EntityState)this).gameObject,
					weapon = ((EntityState)this).gameObject,
					origin = ((Ray)(ref aimRay)).origin,
					aimVector = ((Ray)(ref aimRay)).direction,
					minSpread = 0f,
					maxSpread = 0f,
					bulletCount = (uint)bulletCount,
					procCoefficient = procCoefficient,
					damageType = DamageTypeCombo.op_Implicit((DamageType)262144),
					damage = damageCoefficient * base.damageStat,
					force = force,
					falloffModel = (FalloffModel)0,
					tracerEffectPrefab = FireLaser.tracerEffectPrefab,
					muzzleName = MinigunState.muzzleName,
					hitEffectPrefab = FireLaser.hitEffectPrefab,
					isCrit = Util.CheckRoll(base.critStat, ((EntityState)this).characterBody.master),
					HitEffectNormal = false,
					radius = radius,
					smartCollision = true,
					stopperMask = ((LayerIndex)(ref LayerIndex.world)).mask
				}.Fire();
			}
			((EntityState)this).PlayCrossfade("Gesture, Additive", "FireMinigun", 0.75f * duration);
		}

		public override void OnExit()
		{
			((EntityState)this).OnExit();
			((EntityState)this).characterBody._defaultCrosshairPrefab = LegacyResourcesAPI.Load<GameObject>("prefabs/crosshair/SimpleDotCrosshair");
			((EntityState)this).PlayCrossfade("Gesture, Additive", "BufferEmpty", 0.2f);
			animator.SetBool("WeaponIsReady", false);
		}

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

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return (InterruptPriority)2;
		}
	}
	public class TemplarFireMiniRocket : BaseState
	{
		public static GameObject rocketPrefab;

		public static GameObject effectPrefab;

		public static int projectileCount = 1;

		public static float totalYawSpread = 1f;

		public static float baseDuration = 0.25f;

		public static float baseFireDuration = 0.25f;

		public static float damageCoefficient = Templar.miniBazookaDamageCoefficient.Value;

		public static float force = 25f;

		public static float recoilAmplitude = 7.5f;

		private float duration;

		private float fireDuration;

		private int projectilesFired;

		private bool jelly;

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
			((BaseState)this).StartAimMode(2f, false);
			jelly = false;
			rocketPrefab = Templar.templarRocket;
			effectPrefab = FireMegaFireball.muzzleflashEffectPrefab;
			rocketPrefab = Templar.templarRocket;
			((BaseState)this).AddRecoil(-1f * recoilAmplitude, -2f * recoilAmplitude, -0.5f * recoilAmplitude, 0.5f * recoilAmplitude);
			duration = baseDuration / base.attackSpeedStat;
			fireDuration = baseFireDuration / base.attackSpeedStat;
			Util.PlaySound(FireMegaFireball.attackString, ((EntityState)this).gameObject);
		}

		public override void OnExit()
		{
			((EntityState)this).OnExit();
			((EntityState)this).PlayCrossfade("Gesture, Additive", "BufferEmpty", 0.2f);
			((EntityState)this).GetModelAnimator().SetBool("WeaponIsReady", false);
			((EntityState)this).characterBody._defaultCrosshairPrefab = LegacyResourcesAPI.Load<GameObject>("prefabs/crosshair/SimpleDotCrosshair");
		}

		public override void FixedUpdate()
		{
			//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)
			//IL_00c7: 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_00ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_0101: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)this).FixedUpdate();
			string muzzleName = MinigunState.muzzleName;
			if (((EntityState)this).isAuthority)
			{
				int num = Mathf.FloorToInt(((EntityState)this).fixedAge / fireDuration * (float)projectileCount);
				if (projectilesFired <= num && projectilesFired < projectileCount)
				{
					EffectManager.SimpleMuzzleFlash(effectPrefab, ((EntityState)this).gameObject, muzzleName, false);
					Ray aimRay = ((BaseState)this).GetAimRay();
					float num2 = FireMegaFireball.projectileSpeed * 2f;
					float num3 = (float)Mathf.FloorToInt((float)projectilesFired - (float)(projectileCount - 1) / 2f) / (float)(projectileCount - 1) * totalYawSpread;
					num3 = 0f;
					Vector3 val = Util.ApplySpread(((Ray)(ref aimRay)).direction, 0f, 0f, 1f, 1f, num3, 0f);
					ProjectileManager.instance.FireProjectile(rocketPrefab, ((Ray)(ref aimRay)).origin, Util.QuaternionSafeLookRotation(val), ((EntityState)this).gameObject, base.damageStat * damageCoefficient, force, Util.CheckRoll(base.critStat, ((EntityState)this).characterBody.master), (DamageColorIndex)0, (GameObject)null, num2);
					projectilesFired++;
				}
			}
			if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return (InterruptPriority)2;
		}
	}
	public class TemplarFireRocket : BaseState
	{
		public static GameObject rocketPrefab;

		public static GameObject effectPrefab;

		public static int projectileCount = 1;

		public static float totalYawSpread = 1f;

		public static float baseDuration = 0.25f;

		public static float baseFireDuration = 0.2f;

		public static float damageCoefficient = Templar.bazookaDamageCoefficient.Value;

		public static float force = 25f;

		public static float recoilAmplitude = 10f;

		private float duration;

		private float fireDuration;

		private int projectilesFired;

		private bool jelly;

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
			((BaseState)this).StartAimMode(2f, false);
			jelly = false;
			rocketPrefab = Templar.templarRocket;
			effectPrefab = FireMegaFireball.muzzleflashEffectPrefab;
			rocketPrefab = Templar.templarRocket;
			((BaseState)this).AddRecoil(-1f * recoilAmplitude, -2f * recoilAmplitude, -0.5f * recoilAmplitude, 0.5f * recoilAmplitude);
			duration = baseDuration / base.attackSpeedStat;
			fireDuration = baseFireDuration / base.attackSpeedStat;
			Util.PlaySound(FireMegaFireball.attackString, ((EntityState)this).gameObject);
		}

		public override void OnExit()
		{
			((EntityState)this).OnExit();
			((EntityState)this).PlayCrossfade("Gesture, Additive", "BufferEmpty", 0.2f);
			((EntityState)this).GetModelAnimator().SetBool("WeaponIsReady", false);
			((EntityState)this).characterBody._defaultCrosshairPrefab = LegacyResourcesAPI.Load<GameObject>("prefabs/crosshair/SimpleDotCrosshair");
		}

		public override void FixedUpdate()
		{
			//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)
			//IL_00c7: 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_00ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_0101: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)this).FixedUpdate();
			string muzzleName = MinigunState.muzzleName;
			if (((EntityState)this).isAuthority)
			{
				int num = Mathf.FloorToInt(((EntityState)this).fixedAge / fireDuration * (float)projectileCount);
				if (projectilesFired <= num && projectilesFired < projectileCount)
				{
					EffectManager.SimpleMuzzleFlash(effectPrefab, ((EntityState)this).gameObject, muzzleName, false);
					Ray aimRay = ((BaseState)this).GetAimRay();
					float num2 = FireMegaFireball.projectileSpeed * 2f;
					float num3 = (float)Mathf.FloorToInt((float)projectilesFired - (float)(projectileCount - 1) / 2f) / (float)(projectileCount - 1) * totalYawSpread;
					num3 = 0f;
					Vector3 val = Util.ApplySpread(((Ray)(ref aimRay)).direction, 0f, 0f, 1f, 1f, num3, 0f);
					ProjectileManager.instance.FireProjectile(rocketPrefab, ((Ray)(ref aimRay)).origin, Util.QuaternionSafeLookRotation(val), ((EntityState)this).gameObject, base.damageStat * damageCoefficient, force, Util.CheckRoll(base.critStat, ((EntityState)this).characterBody.master), (DamageColorIndex)0, (GameObject)null, num2);
					projectilesFired++;
				}
			}
			if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return (InterruptPriority)2;
		}
	}
	public class TemplarFireSonicBoom : FireSonicBoom
	{
		public override void OnEnter()
		{
			((FireSonicBoom)this).OnEnter();
			((EntityState)this).GetModelAnimator().SetBool("WeaponIsReady", true);
			base.baseDuration = 0.5f;
		}

		public override void AddDebuff(CharacterBody body)
		{
			body.AddTimedBuff((BuffIndex)21, base.slowDuration * 3f);
		}

		public override void OnExit()
		{
			if (!((EntityState)this).outer.destroying)
			{
				((EntityState)this).GetModelAnimator().SetBool("WeaponIsReady", false);
			}
			((EntityState)this).OnExit();
		}
	}
	public class TemplarFlamethrower : BaseState
	{
		public static float maxDistance = 20f;

		public static float radius = 1.5f;

		public static float baseEntryDuration = 0.1f;

		public static float baseExitDuration = 0.75f;

		public static float damageCoefficientPerTick = 2.5f;

		public static float procCoefficientPerTick = 0.4f;

		public static float tickFrequency = 0.25f;

		public static float force = 1f;

		public static float maxSpread = 0.25f;

		public static GameObject flamethrowerEffectPrefab;

		private float tickDamageCoefficient;

		private float flamethrowerStopwatch;

		private float stopwatch;

		private float entryDuration;

		private float exitDuration;

		private float flamethrowerDuration;

		private bool hasBegunFlamethrower;

		private ChildLocator childLocator;

		private Transform flamethrowerEffectInstance;

		private Transform muzzleTransform;

		private Animator animator;

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
			stopwatch = 0f;
			entryDuration = baseEntryDuration / base.attackSpeedStat;
			exitDuration = baseExitDuration / base.attackSpeedStat;
			animator = ((EntityState)this).GetModelAnimator();
			Transform modelTransform = ((EntityState)this).GetModelTransform();
			childLocator = ((Component)modelTransform).GetComponent<ChildLocator>();
			animator.SetBool("WeaponIsReady", true);
			flamethrowerDuration = 5f;
			if (NetworkServer.active && Object.op_Implicit((Object)(object)((EntityState)this).characterBody))
			{
				((EntityState)this).characterBody.AddBuff(Buffs.TemplArmorBuff);
			}
			float num = base.attackSpeedStat * tickFrequency;
			tickDamageCoefficient = damageCoefficientPerTick;
		}

		public override void OnExit()
		{
			Util.PlaySound(Flamebreath.endAttackSoundString, ((EntityState)this).gameObject);
			if (Object.op_Implicit((Object)(object)flamethrowerEffectInstance))
			{
				EntityState.Destroy((Object)(object)((Component)flamethrowerEffectInstance).gameObject);
			}
			if (NetworkServer.active && Object.op_Implicit((Object)(object)((EntityState)this).characterBody))
			{
				((EntityState)this).characterBody.RemoveBuff(Buffs.TemplArmorBuff);
			}
			animator.SetBool("WeaponIsReady", false);
			((EntityState)this).PlayCrossfade("Gesture, Additive", "BufferEmpty", 0.2f);
			((EntityState)this).OnExit();
		}

		private void FireFlame(string muzzleString)
		{
			//IL_0002: 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_003b: 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_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: 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_0080: 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_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: 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_00c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f7: Unknown result type (might be due to invalid IL or missing references)
			((BaseState)this).GetAimRay();
			if (((EntityState)this).isAuthority && Object.op_Implicit((Object)(object)muzzleTransform))
			{
				new BulletAttack
				{
					owner = ((EntityState)this).gameObject,
					weapon = ((EntityState)this).gameObject,
					origin = muzzleTransform.position,
					aimVector = muzzleTransform.forward,
					minSpread = 0f,
					maxSpread = maxSpread,
					damage = tickDamageCoefficient * base.damageStat,
					force = force,
					muzzleName = muzzleString,
					hitEffectPrefab = Flamebreath.impactEffectPrefab,
					isCrit = ((BaseState)this).RollCrit(),
					radius = radius,
					falloffModel = (FalloffModel)0,
					procCoefficient = procCoefficientPerTick,
					maxDistance = maxDistance,
					smartCollision = true,
					damageType = DamageTypeCombo.op_Implicit((DamageType)262144)
				}.Fire();
			}
		}

		public override void FixedUpdate()
		{
			//IL_00e2: 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)
			((EntityState)this).FixedUpdate();
			stopwatch += Time.fixedDeltaTime;
			((BaseState)this).StartAimMode(0.5f, false);
			((EntityState)this).characterBody.isSprinting = false;
			if (stopwatch >= entryDuration && stopwatch < entryDuration + flamethrowerDuration && !hasBegunFlamethrower)
			{
				hasBegunFlamethrower = true;
				Util.PlaySound(Flamebreath.startAttackSoundString, ((EntityState)this).gameObject);
				if (Object.op_Implicit((Object)(object)childLocator))
				{
					muzzleTransform = childLocator.FindChild(MinigunState.muzzleName);
					flamethrowerEffectInstance = Object.Instantiate<GameObject>(Flamebreath.flamethrowerEffectPrefab, muzzleTransform).transform;
					((Component)flamethrowerEffectInstance).transform.localPosition = Vector3.zero;
					((Component)flamethrowerEffectInstance).GetComponent<ScaleParticleSystemDuration>().newDuration = 2f;
					ParticleSystem[] componentsInChildren = ((Component)flamethrowerEffectInstance).GetComponentsInChildren<ParticleSystem>();
					foreach (ParticleSystem val in componentsInChildren)
					{
						if (Object.op_Implicit((Object)(object)val))
						{
							MainModule main = val.main;
							((MainModule)(ref main)).loop = true;
						}
					}
				}
			}
			if (stopwatch >= entryDuration && hasBegunFlamethrower && !((EntityState)this).inputBank.skill1.down)
			{
				hasBegunFlamethrower = false;
				if (Object.op_Implicit((Object)(object)flamethrowerEffectInstance))
				{
					EntityState.Destroy((Object)(object)((Component)flamethrowerEffectInstance).gameObject);
				}
				((EntityState)this).outer.SetNextStateToMain();
				return;
			}
			if (hasBegunFlamethrower)
			{
				flamethrowerStopwatch += Time.fixedDeltaTime;
				if (flamethrowerStopwatch > tickFrequency / base.attackSpeedStat)
				{
					flamethrowerStopwatch -= tickFrequency / base.attackSpeedStat;
					FireFlame(MinigunState.muzzleName);
					((EntityState)this).PlayCrossfade("Gesture, Additive", "FireMinigun", 0.2f);
				}
				flamethrowerDuration = stopwatch + baseExitDuration;
			}
			else if (Object.op_Implicit((Object)(object)flamethrowerEffectInstance))
			{
				EntityState.Destroy((Object)(object)((Component)flamethrowerEffectInstance).gameObject);
			}
			if (stopwatch >= flamethrowerDuration + entryDuration && ((EntityState)this).isAuthority)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return (InterruptPriority)1;
		}
	}
	public class TemplarMinigunFire : TemplarMinigunState
	{
		public static float baseDamageCoefficient = Templar.minigunDamageCoefficient.Value;

		public static float baseForce = Templar.minigunForce.Value;

		public static float baseProcCoefficient = Templar.minigunProcCoefficient.Value;

		public static float recoilAmplitude = 2f;

		public static float minFireRate = Templar.minigunMinFireRate.Value;

		public static float maxFireRate = Templar.minigunMaxFireRate.Value;

		public static float fireRateGrowth = Templar.minigunFireRateGrowth.Value;

		private float fireTimer;

		private Transform muzzleVfxTransform;

		private float baseFireRate;

		private float baseBulletsPerSecond;

		private FixedTimeStamp critEndTime;

		private FixedTimeStamp lastCritCheck;

		private float currentFireRate;

		public override void OnEnter()
		{
			//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)
			//IL_006b: 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)
			base.OnEnter();
			if (Object.op_Implicit((Object)(object)muzzleTransform) && Object.op_Implicit((Object)(object)MinigunFire.muzzleVfxPrefab))
			{
				muzzleVfxTransform = Object.Instantiate<GameObject>(MinigunFire.muzzleVfxPrefab, muzzleTransform).transform;
			}
			baseFireRate = 1f / MinigunFire.baseFireInterval;
			currentFireRate = minFireRate;
			critEndTime = FixedTimeStamp.negativeInfinity;
			lastCritCheck = FixedTimeStamp.negativeInfinity;
			Util.PlaySound(MinigunFire.startSound, ((EntityState)this).gameObject);
			((EntityState)this).PlayCrossfade("Gesture, Additive", "FireMinigun", 0.2f);
		}

		public override void FixedUpdate()
		{
			base.FixedUpdate();
			baseFireRate = 1f / MinigunFire.baseFireInterval;
			fireTimer -= Time.fixedDeltaTime;
			if (fireTimer <= 0f)
			{
				((BaseState)this).attackSpeedStat = ((EntityState)this).characterBody.attackSpeed;
				float num = MinigunFire.baseFireInterval / ((BaseState)this).attackSpeedStat / currentFireRate;
				fireTimer += num;
				OnFireShared();
			}
			if (((EntityState)this).isAuthority && !base.skillButtonState.down)
			{
				((EntityState)this).outer.SetNextState((EntityState)(object)new TemplarMinigunSpinDown());
			}
		}

		private void UpdateCrits()
		{
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: 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_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)
			((BaseState)this).critStat = ((EntityState)this).characterBody.crit;
			if (((FixedTimeStamp)(ref lastCritCheck)).timeSince >= 0.15f)
			{
				lastCritCheck = FixedTimeStamp.now;
				if (((BaseState)this).RollCrit())
				{
					critEndTime = FixedTimeStamp.now + 0.25f;
				}
			}
		}

		public override void OnExit()
		{
			Util.PlaySound(MinigunFire.endSound, ((EntityState)this).gameObject);
			if (Object.op_Implicit((Object)(object)muzzleVfxTransform))
			{
				EntityState.Destroy((Object)(object)((Component)muzzleVfxTransform).gameObject);
				muzzleVfxTransform = null;
			}
			((EntityState)this).PlayCrossfade("Gesture, Additive", "BufferEmpty", 0.2f);
			base.OnExit();
		}

		private void OnFireShared()
		{
			Util.PlaySound(MinigunFire.fireSound, ((EntityState)this).gameObject);
			if (((EntityState)this).isAuthority)
			{
				OnFireAuthority();
			}
		}

		private void OnFireAuthority()
		{
			//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 reference