Decompiled source of ProjectChronos v0.6.3

ProjectChronos.dll

Decompiled 6 months ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using EntityStates;
using IL.RoR2;
using Microsoft.CodeAnalysis;
using Mono.Cecil.Cil;
using MonoMod.Cil;
using On.RoR2;
using ProjectChronos.EntityStates;
using ProjectChronos.Items;
using R2API;
using RoR2;
using RoR2.Projectile;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.Networking;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.0", FrameworkDisplayName = ".NET Standard 2.0")]
[assembly: AssemblyCompany("ProjectChronos")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+bc6f6d441735b6115fdeb12bb3b1eb03a3418e79")]
[assembly: AssemblyProduct("ProjectChronos")]
[assembly: AssemblyTitle("ProjectChronos")]
[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 ProjectChronos
{
	[BepInPlugin("com.Nuxlar.ProjectChronos", "ProjectChronos", "0.6.3")]
	public class ProjectChronos : BaseUnityPlugin
	{
		[CompilerGenerated]
		private static class <>O
		{
			public static CustomDotBehaviour <0>__DecayBehavior;
		}

		[Serializable]
		[CompilerGenerated]
		private sealed class <>c
		{
			public static readonly <>c <>9 = new <>c();

			public static Func<Type, bool> <>9__16_0;

			public static EffectCondition <>9__21_0;

			public static EffectCondition <>9__21_1;

			internal bool <Awake>b__16_0(Type type)
			{
				if (!type.IsAbstract)
				{
					return type.IsSubclassOf(typeof(ItemBase));
				}
				return false;
			}

			internal bool <SetupVFX>b__21_0(CharacterBody body)
			{
				return body.HasBuff(timeFrozenBuff);
			}

			internal bool <SetupVFX>b__21_1(CharacterBody body)
			{
				return body.HasBuff(decayBuff);
			}
		}

		public static AssetBundle assetBundle;

		public static GameObject acceleratorItem;

		public static GameObject coinItem;

		public List<ItemBase> itemList = new List<ItemBase>();

		public static BuffDef timeFrozenBuff;

		public static BuffDef timeBandOnBuff;

		public static BuffDef timeBandOffBuff;

		public static BuffDef decayBuff;

		public static DotIndex decayDot;

		public static CustomDotBehaviour decayDotBehaviour;

		public static CustomDotVisual decayDotVisual;

		public GameObject decayEffectPrefab = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Common/CrippleEffect.prefab").WaitForCompletion(), "DecayEffect", false);

		public GameObject timeFrozenEffect = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Common/CrippleEffect.prefab").WaitForCompletion(), "TimeFrozenEffect", false);

		public static GameObject chronosphereEffect = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/Railgunner/RailgunnerMineAltDetonated.prefab").WaitForCompletion(), "Chronosphere", false);

		private Material timeFrozenMaterial = Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/mysteryspace/matSuspendedInTime.mat").WaitForCompletion();

		private BuffDef jailerBuff = Addressables.LoadAssetAsync<BuffDef>((object)"RoR2/DLC1/VoidJailer/bdJailerSlow.asset").WaitForCompletion();

		public void Awake()
		{
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0109: Unknown result type (might be due to invalid IL or missing references)
			//IL_0128: Unknown result type (might be due to invalid IL or missing references)
			//IL_024f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0255: Invalid comparison between Unknown and I4
			SetupVFX();
			assetBundle = AssetBundle.LoadFromFile(Assembly.GetExecutingAssembly().Location.Replace("ProjectChronos.dll", "chronositems.bundle"));
			assetBundle.LoadAsset<GameObject>("assets/incinrounds.prefab").transform.GetChild(0).localPosition = Vector3.zero;
			CreateBuffs();
			CreateDoTs();
			foreach (Transform item in chronosphereEffect.transform)
			{
				Object.Destroy((Object)(object)((Component)item).gameObject);
			}
			chronosphereEffect.GetComponent<SlowDownProjectiles>().slowDownCoefficient = 0f;
			chronosphereEffect.AddComponent<DestroyOnTimer>().duration = 5f;
			GameObject val = PrefabAPI.InstantiateClone(assetBundle.LoadAsset<GameObject>("assets/chronosphere.prefab"), "ChronosphereIndicator", false);
			val.transform.parent = chronosphereEffect.transform;
			val.transform.localPosition = Vector3.zero;
			val.transform.localRotation = Quaternion.identity;
			val.transform.localScale = new Vector3(15f, 15f, 15f);
			BuffWard component = chronosphereEffect.GetComponent<BuffWard>();
			component.buffDef = timeFrozenBuff;
			component.expireDuration = 5f;
			component.rangeIndicator = val.transform;
			ContentAddition.AddProjectile(chronosphereEffect);
			ReplaceMatShaders("RoR2/Base/Shaders/HGStandard.shader", "assets/matcylindetrimnux.mat", "assets/matsteelnux.mat", "assets/matcylindernux.mat", "assets/matringnux.mat", "assets/polygon arsenal/materials/main/polysolidglow.mat", "assets/polygon arsenal/materials/gradients/polyspriteglow_add.mat", "assets/polygon arsenal/materials/rimlight/solid/blackhole/polyblackholeblue.mat");
			ReplaceMatShaders("Calm Water/CalmWater - SingleSided.shader", "assets/matglassnux.mat");
			IEnumerable<Type> enumerable = from type in Assembly.GetExecutingAssembly().GetTypes()
				where !type.IsAbstract && type.IsSubclassOf(typeof(ItemBase))
				select type;
			new List<Pair>();
			foreach (Type item2 in enumerable)
			{
				ItemBase itemBase = (ItemBase)Activator.CreateInstance(item2);
				if (!ValidateItem(itemBase, itemList))
				{
					continue;
				}
				itemBase.Init(((BaseUnityPlugin)this).Config);
				ItemTag[] itemTags = itemBase.ItemTags;
				bool flag = true;
				bool flag2 = false;
				if ((int)itemBase.ItemDef.deprecatedTier == 5)
				{
					flag2 = true;
					flag = false;
				}
				string itemName = itemBase.ItemName;
				itemName = itemName.Replace("'", "");
				ItemTag[] array = itemTags;
				for (int i = 0; i < array.Length; i++)
				{
					if ((int)array[i] == 4)
					{
						flag2 = true;
						flag = false;
						break;
					}
				}
				if (!flag || ((BaseUnityPlugin)this).Config.Bind<bool>("Item: " + itemName, "Blacklist Item from AI Use?", false, "Should the AI not be able to obtain this item?").Value)
				{
					itemBase.AIBlacklisted = true;
				}
			}
		}

		public bool ValidateItem(ItemBase item, List<ItemBase> itemList)
		{
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Invalid comparison between Unknown and I4
			string text = item.ItemName.Replace("'", string.Empty);
			bool flag = false;
			if ((int)item.Tier == 5)
			{
				flag = true;
				item.AIBlacklisted = true;
			}
			else
			{
				flag = ((BaseUnityPlugin)this).Config.Bind<bool>("Items", text, true, "Should this item be enabled.").Value;
			}
			if (flag)
			{
				itemList.Add(item);
			}
			return flag;
		}

		private void CreateDoTs()
		{
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: 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_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0060: Expected O, but got Unknown
			//IL_005b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0060: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Expected O, but got Unknown
			object obj = <>O.<0>__DecayBehavior;
			if (obj == null)
			{
				CustomDotBehaviour val = DecayBehavior;
				<>O.<0>__DecayBehavior = val;
				obj = (object)val;
			}
			decayDotBehaviour = (CustomDotBehaviour)obj;
			decayDot = DotAPI.RegisterDotDef(new DotDef
			{
				interval = 0.5f,
				damageCoefficient = 0.6f,
				damageColorIndex = (DamageColorIndex)11,
				associatedBuff = decayBuff,
				resetTimerOnAdd = false
			}, decayDotBehaviour, (CustomDotVisual)null);
		}

		public static void DecayBehavior(DotController self, DotStack dotStack)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			if (dotStack.dotIndex == decayDot)
			{
				dotStack.damageType = (DamageType)67108866;
				if (Object.op_Implicit((Object)(object)self.victimBody) && Object.op_Implicit((Object)(object)self.victimHealthComponent))
				{
					float num = self.victimHealthComponent.fullCombinedHealth / 100f * 0.5f * 0.5f;
					dotStack.damage = Mathf.Min(Mathf.Max(num, dotStack.damage), dotStack.damage * 25f);
				}
			}
		}

		private void CreateBuffs()
		{
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_013d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0142: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ce: Unknown result type (might be due to invalid IL or missing references)
			timeFrozenBuff = ScriptableObject.CreateInstance<BuffDef>();
			((Object)timeFrozenBuff).name = "bdTimeFrozen";
			timeFrozenBuff.canStack = false;
			timeFrozenBuff.isCooldown = false;
			timeFrozenBuff.isDebuff = true;
			timeFrozenBuff.buffColor = Color.cyan;
			timeFrozenBuff.iconSprite = jailerBuff.iconSprite;
			((Object)timeFrozenBuff).name = ((Object)timeFrozenBuff).name;
			ContentAddition.AddBuffDef(timeFrozenBuff);
			timeBandOnBuff = ScriptableObject.CreateInstance<BuffDef>();
			((Object)timeBandOnBuff).name = "bdTimeBandOn";
			timeBandOnBuff.canStack = false;
			timeBandOnBuff.isCooldown = false;
			timeBandOnBuff.isDebuff = false;
			timeBandOnBuff.buffColor = Color.cyan;
			timeBandOnBuff.iconSprite = assetBundle.LoadAsset<Sprite>("assets/bdfracturedbandicon.png");
			((Object)timeBandOnBuff).name = ((Object)timeBandOnBuff).name;
			ContentAddition.AddBuffDef(timeBandOnBuff);
			timeBandOffBuff = ScriptableObject.CreateInstance<BuffDef>();
			((Object)timeBandOffBuff).name = "bdTimeBandOff";
			timeBandOffBuff.canStack = false;
			timeBandOffBuff.isCooldown = false;
			timeBandOffBuff.isDebuff = false;
			timeBandOffBuff.buffColor = Color.gray;
			timeBandOffBuff.iconSprite = assetBundle.LoadAsset<Sprite>("assets/bdfracturedbandicon.png");
			((Object)timeBandOffBuff).name = ((Object)timeBandOffBuff).name;
			ContentAddition.AddBuffDef(timeBandOffBuff);
			decayBuff = ScriptableObject.CreateInstance<BuffDef>();
			((Object)decayBuff).name = "bdDecay";
			decayBuff.canStack = false;
			decayBuff.isCooldown = false;
			decayBuff.isDebuff = true;
			decayBuff.canStack = false;
			decayBuff.buffColor = Color.cyan;
			decayBuff.iconSprite = assetBundle.LoadAsset<Sprite>("assets/bddecayicon.png");
			((Object)decayBuff).name = ((Object)decayBuff).name;
			ContentAddition.AddBuffDef(decayBuff);
		}

		private void SetupVFX()
		{
			//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0101: Unknown result type (might be due to invalid IL or missing references)
			//IL_0106: Unknown result type (might be due to invalid IL or missing references)
			//IL_0128: Unknown result type (might be due to invalid IL or missing references)
			//IL_014e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0153: Unknown result type (might be due to invalid IL or missing references)
			//IL_018a: Unknown result type (might be due to invalid IL or missing references)
			//IL_018f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0193: Unknown result type (might be due to invalid IL or missing references)
			//IL_0198: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_01df: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_021b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0220: Unknown result type (might be due to invalid IL or missing references)
			//IL_0224: Unknown result type (might be due to invalid IL or missing references)
			//IL_0229: Unknown result type (might be due to invalid IL or missing references)
			//IL_024b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0266: Unknown result type (might be due to invalid IL or missing references)
			//IL_026b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0271: Expected O, but got Unknown
			//IL_029b: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a6: Expected O, but got Unknown
			Transform child = timeFrozenEffect.transform.GetChild(0);
			((Component)child.GetChild(2)).gameObject.SetActive(false);
			((Renderer)((Component)child.GetChild(0)).GetComponent<MeshRenderer>()).sharedMaterial = timeFrozenMaterial;
			((Renderer)((Component)child.GetChild(1)).GetComponent<MeshRenderer>()).sharedMaterial = timeFrozenMaterial;
			Transform child2 = decayEffectPrefab.transform.GetChild(0);
			((Component)child2.GetChild(0)).gameObject.SetActive(false);
			((Component)child2.GetChild(1)).gameObject.SetActive(false);
			((Component)child2.GetChild(2)).gameObject.SetActive(false);
			float num = 2f;
			float num2 = 1.5f;
			float num3 = 1.5f;
			float num4 = 1.5f;
			ParticleSystem component = ((Component)child2.GetChild(3)).GetComponent<ParticleSystem>();
			MainModule main = component.main;
			((MainModule)(ref main)).startSizeMultiplier = ((MainModule)(ref main)).startSizeMultiplier * num;
			((MainModule)(ref main)).startSpeedMultiplier = ((MainModule)(ref main)).startSpeedMultiplier * num2;
			((MainModule)(ref main)).startLifetimeMultiplier = ((MainModule)(ref main)).startLifetimeMultiplier * num3;
			((MainModule)(ref main)).scalingMode = (ParticleSystemScalingMode)0;
			EmissionModule emission = component.emission;
			MinMaxCurve rateOverTime = ((EmissionModule)(ref emission)).rateOverTime;
			((MinMaxCurve)(ref rateOverTime)).constantMin = ((MinMaxCurve)(ref rateOverTime)).constantMin * num4;
			((MinMaxCurve)(ref rateOverTime)).constantMax = ((MinMaxCurve)(ref rateOverTime)).constantMax * num4;
			((EmissionModule)(ref emission)).rateOverTime = rateOverTime;
			((Component)child2.GetChild(5)).gameObject.SetActive(true);
			ParticleSystem component2 = ((Component)child2.GetChild(5)).GetComponent<ParticleSystem>();
			MainModule main2 = component2.main;
			((MainModule)(ref main2)).scalingMode = (ParticleSystemScalingMode)0;
			((MainModule)(ref main2)).startSizeMultiplier = ((MainModule)(ref main2)).startSizeMultiplier * num;
			((MainModule)(ref main2)).startSpeedMultiplier = ((MainModule)(ref main2)).startSpeedMultiplier * num2;
			((MainModule)(ref main2)).startLifetimeMultiplier = ((MainModule)(ref main2)).startLifetimeMultiplier * num3;
			EmissionModule emission2 = component2.emission;
			MinMaxCurve rateOverTime2 = ((EmissionModule)(ref emission2)).rateOverTime;
			((MinMaxCurve)(ref rateOverTime2)).constantMin = ((MinMaxCurve)(ref rateOverTime2)).constantMin * num4;
			((MinMaxCurve)(ref rateOverTime2)).constantMax = ((MinMaxCurve)(ref rateOverTime2)).constantMax * num4;
			((EmissionModule)(ref emission2)).rateOverTime = rateOverTime;
			((Component)child2.GetChild(4)).gameObject.SetActive(true);
			ParticleSystem component3 = ((Component)child2.GetChild(4)).GetComponent<ParticleSystem>();
			MainModule main3 = component3.main;
			((MainModule)(ref main3)).simulationSpace = (ParticleSystemSimulationSpace)0;
			((MainModule)(ref main3)).startSizeMultiplier = ((MainModule)(ref main3)).startSizeMultiplier / num;
			((MainModule)(ref main3)).startSpeedMultiplier = ((MainModule)(ref main3)).startSpeedMultiplier / num2;
			((MainModule)(ref main3)).startLifetimeMultiplier = ((MainModule)(ref main3)).startLifetimeMultiplier / num3;
			EmissionModule emission3 = component3.emission;
			MinMaxCurve rateOverTime3 = ((EmissionModule)(ref emission3)).rateOverTime;
			((MinMaxCurve)(ref rateOverTime3)).constantMin = ((MinMaxCurve)(ref rateOverTime3)).constantMin / num4;
			((MinMaxCurve)(ref rateOverTime3)).constantMax = ((MinMaxCurve)(ref rateOverTime3)).constantMax / num4;
			((EmissionModule)(ref emission3)).rateOverTime = rateOverTime;
			object obj = <>c.<>9__21_0;
			if (obj == null)
			{
				EffectCondition val = (CharacterBody body) => body.HasBuff(timeFrozenBuff);
				<>c.<>9__21_0 = val;
				obj = (object)val;
			}
			EffectCondition val2 = (EffectCondition)obj;
			TempVisualEffectAPI.AddTemporaryVisualEffect(timeFrozenEffect, val2, false, "");
			object obj2 = <>c.<>9__21_1;
			if (obj2 == null)
			{
				EffectCondition val3 = (CharacterBody body) => body.HasBuff(decayBuff);
				<>c.<>9__21_1 = val3;
				obj2 = (object)val3;
			}
			EffectCondition val4 = (EffectCondition)obj2;
			TempVisualEffectAPI.AddTemporaryVisualEffect(decayEffectPrefab, val4, false, "");
		}

		private void ReplaceMatShaders(string shaderPath, params string[] materialPaths)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			Shader shader = Addressables.LoadAssetAsync<Shader>((object)shaderPath).WaitForCompletion();
			foreach (string text in materialPaths)
			{
				Material obj = assetBundle.LoadAsset<Material>(text);
				Debug.LogWarning((object)obj);
				obj.shader = shader;
			}
		}
	}
}
namespace ProjectChronos.Items
{
	public abstract class ItemBase<T> : ItemBase where T : ItemBase<T>
	{
		public static T instance { get; private set; }

		public ItemBase()
		{
			if (instance != null)
			{
				throw new InvalidOperationException("Singleton class \"" + typeof(T).Name + "\" inheriting ItemBase was instantiated twice");
			}
			instance = this as T;
		}
	}
	public abstract class ItemBase
	{
		public ItemDef ItemDef;

		public abstract string ItemName { get; }

		public abstract string ItemLangTokenName { get; }

		public abstract string ItemPickupDesc { get; }

		public abstract string ItemFullDescription { get; }

		public abstract string ItemLore { get; }

		public abstract ItemTier Tier { get; }

		public virtual ItemTag[] ItemTags { get; set; } = (ItemTag[])(object)new ItemTag[0];


		public abstract GameObject ItemModel { get; }

		public abstract Sprite ItemIcon { get; }

		public virtual bool CanRemove { get; } = true;


		public virtual bool AIBlacklisted { get; set; }

		public abstract void Init(ConfigFile config);

		public virtual void CreateConfig(ConfigFile config)
		{
		}

		protected virtual void CreateLang()
		{
			LanguageAPI.Add("ITEM_NUX_" + ItemLangTokenName + "_NAME", ItemName);
			LanguageAPI.Add("ITEM_NUX_" + ItemLangTokenName + "_PICKUP", ItemPickupDesc);
			LanguageAPI.Add("ITEM_NUX_" + ItemLangTokenName + "_DESCRIPTION", ItemFullDescription);
			LanguageAPI.Add("ITEM_NUX_" + ItemLangTokenName + "_LORE", ItemLore);
		}

		public abstract ItemDisplayRuleDict CreateItemDisplayRules();

		protected void CreateItem()
		{
			//IL_0111: Unknown result type (might be due to invalid IL or missing references)
			//IL_0116: Unknown result type (might be due to invalid IL or missing references)
			//IL_0141: Unknown result type (might be due to invalid IL or missing references)
			//IL_014b: Expected O, but got Unknown
			if (AIBlacklisted)
			{
				ItemTags = new List<ItemTag>(ItemTags) { (ItemTag)4 }.ToArray();
			}
			ItemDef = ScriptableObject.CreateInstance<ItemDef>();
			((Object)ItemDef).name = "ITEM_NUX_" + ItemLangTokenName;
			ItemDef.nameToken = "ITEM_NUX_" + ItemLangTokenName + "_NAME";
			ItemDef.pickupToken = "ITEM_NUX_" + ItemLangTokenName + "_PICKUP";
			ItemDef.descriptionToken = "ITEM_NUX_" + ItemLangTokenName + "_DESCRIPTION";
			ItemDef.loreToken = "ITEM_NUX_" + ItemLangTokenName + "_LORE";
			ItemDef.pickupModelPrefab = ItemModel;
			ItemDef.pickupIconSprite = ItemIcon;
			ItemDef.hidden = false;
			ItemDef.canRemove = CanRemove;
			ItemDef.deprecatedTier = Tier;
			if (ItemTags.Length != 0)
			{
				ItemDef.tags = ItemTags;
			}
			ItemAPI.Add(new CustomItem(ItemDef, CreateItemDisplayRules()));
		}

		public virtual void Hooks()
		{
		}

		public int GetCount(CharacterBody body)
		{
			if (!Object.op_Implicit((Object)(object)body) || !Object.op_Implicit((Object)(object)body.inventory))
			{
				return 0;
			}
			return body.inventory.GetItemCount(ItemDef);
		}

		public int GetCount(CharacterMaster master)
		{
			if (!Object.op_Implicit((Object)(object)master) || !Object.op_Implicit((Object)(object)master.inventory))
			{
				return 0;
			}
			return master.inventory.GetItemCount(ItemDef);
		}

		public int GetCountSpecific(CharacterBody body, ItemDef itemDef)
		{
			if (!Object.op_Implicit((Object)(object)body) || !Object.op_Implicit((Object)(object)body.inventory))
			{
				return 0;
			}
			return body.inventory.GetItemCount(itemDef);
		}
	}
}
namespace ProjectChronos.Items.White
{
	public class IncendiaryRounds : ItemBase<IncendiaryRounds>
	{
		public ConfigEntry<bool> enable;

		public override string ItemName => "Incendiary Rounds";

		public override string ItemLangTokenName => "INCENDIARYROUNDS";

		public override string ItemPickupDesc => "10% chance to ignite enemies on hit.";

		public override string ItemFullDescription => "<style=cIsUtility>10%</style> <style=cStack>(+10% per stack)</style> chance to <style=cIsDamage>ignite</style> enemies on hit.";

		public override string ItemLore => "<style=cMono>Welcome to DataScraper (v3.1.53)\r\n$ Scraping memory...\r\n$ Resolving...\r\nComplete</style>\r\n\r\nField Report: P-14 'Cinder'.\r\nLocation: [REDACTED].\r\nObjective: Test efficacy of new prototype rounds.\r\nCasualties: 9.\r\nStatus: FAILURE.\r\nDue unforseen circumstances, an uncontrollable chemical fire erupted on the test site, leading to catastrophic damage and loss of life. This experimental munition will be collected and stored on [REDACTED] indefinitely.\r\n\r\nProject 'Cinder' is to be shut down immediately with no further funding.";

		public override ItemTier Tier => (ItemTier)0;

		public override GameObject ItemModel => ProjectChronos.assetBundle.LoadAsset<GameObject>("assets/incinrounds.prefab");

		public override Sprite ItemIcon => ProjectChronos.assetBundle.LoadAsset<Sprite>("assets/texincendiaryicon.png");

		public override void Init(ConfigFile config)
		{
			CreateConfig(config);
			CreateLang();
			CreateItem();
			Hooks();
		}

		public override void CreateConfig(ConfigFile config)
		{
			enable = config.Bind<bool>("Items", ItemName, true, "Should this item be enabled.");
		}

		public override ItemDisplayRuleDict CreateItemDisplayRules()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Expected O, but got Unknown
			return new ItemDisplayRuleDict(Array.Empty<ItemDisplayRule>());
		}

		public override void Hooks()
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Expected O, but got Unknown
			GlobalEventManager.OnHitEnemy += new hook_OnHitEnemy(ApplyIncin);
		}

		private void ApplyIncin(orig_OnHitEnemy orig, GlobalEventManager self, DamageInfo damageInfo, GameObject victim)
		{
			//IL_00e7: 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_0135: Unknown result type (might be due to invalid IL or missing references)
			//IL_0137: Unknown result type (might be due to invalid IL or missing references)
			orig.Invoke(self, damageInfo, victim);
			if ((double)damageInfo.procCoefficient <= 0.0 || damageInfo.rejected || !NetworkServer.active || !Object.op_Implicit((Object)(object)damageInfo.attacker))
			{
				return;
			}
			CharacterBody component = damageInfo.attacker.GetComponent<CharacterBody>();
			CharacterBody component2 = victim.GetComponent<CharacterBody>();
			if (!Object.op_Implicit((Object)(object)component) || !Object.op_Implicit((Object)(object)component2))
			{
				return;
			}
			int count = GetCount(component);
			if (count <= 0)
			{
				return;
			}
			Inventory inventory = component.master.inventory;
			if (!Util.CheckRoll(10f * (float)count, component.master))
			{
				return;
			}
			uint? maxStacksFromAttacker = null;
			if (Object.op_Implicit((Object)(object)damageInfo?.inflictor))
			{
				ProjectileDamage component3 = damageInfo.inflictor.GetComponent<ProjectileDamage>();
				if (Object.op_Implicit((Object)(object)component3) && component3.useDotMaxStacksFromAttacker)
				{
					maxStacksFromAttacker = component3.dotMaxStacksFromAttacker;
				}
			}
			float num = 0.5f;
			InflictDotInfo val = default(InflictDotInfo);
			val.attackerObject = damageInfo.attacker;
			val.victimObject = victim;
			val.totalDamage = damageInfo.damage * num;
			val.damageMultiplier = 1f;
			val.dotIndex = (DotIndex)1;
			val.maxStacksFromAttacker = maxStacksFromAttacker;
			InflictDotInfo val2 = val;
			StrengthenBurnUtils.CheckDotForUpgrade(inventory, ref val2);
			DotController.InflictDot(ref val2);
		}
	}
	public class TemporalAccelerator : ItemBase<TemporalAccelerator>
	{
		public ConfigEntry<bool> enable;

		public override string ItemName => "Temporal Accelerator";

		public override string ItemLangTokenName => "TEMPORALACCELERATOR";

		public override string ItemPickupDesc => "Increase the duration of damage over time effects.";

		public override string ItemFullDescription => "Increase the duration of damage over time effects by <style=cIsUtility>25%</style> <style=cStack>(+15% per stack)</style>.";

		public override string ItemLore => "<style=cMono>========================================\r\n====   Timekeeper's Cipher   ====\r\n====    [Version 2.12.05]    ====\r\n========================================\r\nTranslating… <100000000 cycles>\r\nTranslating… <523260 cycles>\r\nTranslation Complete\r\nDisplaying Results\r\n========================================</style>\r\n\r\nA design of ingenious cruelty created out of necessity. This device uses temporal waves localized around inflicted wounds, accelerating the rate of decay but also the rate of healing. This creates an agonizing loop, prolonging the suffering of the victim far beyond resistance. \r\n\r\nEarly results are promising but the ethical implications are... concerning. Should we as protectors even have such a device? This is beyond me to decide or even question, but I feel like I must do something...";

		public override ItemTier Tier => (ItemTier)0;

		public override GameObject ItemModel => ProjectChronos.assetBundle.LoadAsset<GameObject>("assets/acceleratoritemnux.prefab");

		public override Sprite ItemIcon => ProjectChronos.assetBundle.LoadAsset<Sprite>("assets/texacceleratoricon.png");

		public override void Init(ConfigFile config)
		{
			CreateConfig(config);
			CreateLang();
			CreateItem();
			Hooks();
		}

		public override void CreateConfig(ConfigFile config)
		{
			enable = config.Bind<bool>("Items", ItemName, true, "Should this item be enabled.");
		}

		public override ItemDisplayRuleDict CreateItemDisplayRules()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Expected O, but got Unknown
			return new ItemDisplayRuleDict(Array.Empty<ItemDisplayRule>());
		}

		public override void Hooks()
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Expected O, but got Unknown
			DotController.AddDot += new hook_AddDot(IncreaseDotDuration2);
		}

		private void IncreaseDotDuration2(orig_AddDot orig, DotController self, GameObject attackerObject, float duration, DotIndex dotIndex, float damageMultiplier, uint? maxStacksFromAttacker, float? totalDamage, DotIndex? preUpgradeDotIndex)
		{
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: Invalid comparison between Unknown and I4
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Invalid comparison between Unknown and I4
			//IL_009c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
			if (Object.op_Implicit((Object)(object)attackerObject) && Object.op_Implicit((Object)(object)attackerObject.GetComponent<CharacterBody>()))
			{
				int count = GetCount(attackerObject.GetComponent<CharacterBody>());
				if (count > 0)
				{
					duration *= 1.25f + 0.15f * (float)(count - 1);
				}
			}
			orig.Invoke(self, attackerObject, duration, dotIndex, damageMultiplier, maxStacksFromAttacker, totalDamage, preUpgradeDotIndex);
			if (((int)dotIndex != 1 && (int)dotIndex != 7) || !Object.op_Implicit((Object)(object)attackerObject) || !Object.op_Implicit((Object)(object)attackerObject.GetComponent<CharacterBody>()))
			{
				return;
			}
			int count2 = GetCount(attackerObject.GetComponent<CharacterBody>());
			if (count2 <= 0)
			{
				return;
			}
			foreach (DotStack dotStack in self.dotStackList)
			{
				if (dotStack.dotIndex == dotIndex && (Object)(object)dotStack.attackerObject == (Object)(object)attackerObject)
				{
					dotStack.timer *= 1.25f + 0.15f * (float)(count2 - 1);
				}
			}
		}
	}
	public class TimeShardDagger : ItemBase<TimeShardDagger>
	{
		public ConfigEntry<bool> enable;

		public override string ItemName => "Time-Shard Dagger";

		public override string ItemLangTokenName => "TIMESHARDDAGGER";

		public override string ItemPickupDesc => "10% chance to decay enemies on hit.";

		public override string ItemFullDescription => "<style=cIsUtility>10%</style> <style=cStack>(+10% damage per stack)</style> chance to <style=cIsDamage>Decay</style> an enemy.";

		public override string ItemLore => "<style=cMono>//-- AUTO-TRANSCRIPTION FROM UES [REDACTED] --//</style>\r\n\r\nI couldn't wield it for long. \r\nThe blade was cold to the touch, the edges seemed to shimmer with a light that wasn't even there. \r\nI could feel my mind slipping, my thoughts becoming disjointed and erratic. \r\nMy psyche being torn apart into directions I couldn't even comprehend.\r\nI had to put it down.\r\nI had to get away from it.\r\nI... I'm still holding it...\r\nHow... how long has it been?\r\nI... i..... ..........";

		public override ItemTier Tier => (ItemTier)0;

		public override GameObject ItemModel => ProjectChronos.assetBundle.LoadAsset<GameObject>("assets/sharddagger.prefab");

		public override Sprite ItemIcon => ProjectChronos.assetBundle.LoadAsset<Sprite>("assets/texdaggericon.png");

		public override void Init(ConfigFile config)
		{
			CreateConfig(config);
			CreateLang();
			CreateItem();
			Hooks();
		}

		public override void CreateConfig(ConfigFile config)
		{
			enable = config.Bind<bool>("Items", ItemName, true, "Should this item be enabled.");
		}

		public override ItemDisplayRuleDict CreateItemDisplayRules()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Expected O, but got Unknown
			return new ItemDisplayRuleDict(Array.Empty<ItemDisplayRule>());
		}

		public override void Hooks()
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Expected O, but got Unknown
			GlobalEventManager.OnHitEnemy += new hook_OnHitEnemy(ApplyDecay);
		}

		private void ApplyDecay(orig_OnHitEnemy orig, GlobalEventManager self, DamageInfo damageInfo, GameObject victim)
		{
			//IL_0090: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
			orig.Invoke(self, damageInfo, victim);
			if ((double)damageInfo.procCoefficient <= 0.0 || damageInfo.rejected || !NetworkServer.active || !Object.op_Implicit((Object)(object)damageInfo.attacker))
			{
				return;
			}
			CharacterBody component = damageInfo.attacker.GetComponent<CharacterBody>();
			CharacterBody component2 = victim.GetComponent<CharacterBody>();
			if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component2))
			{
				int count = GetCount(component);
				if (count > 0 && Util.CheckRoll(10f * (float)count, component.master) && !component2.HasBuff(ProjectChronos.decayBuff))
				{
					InflictDotInfo val = default(InflictDotInfo);
					val.attackerObject = damageInfo.attacker;
					val.victimObject = victim;
					val.damageMultiplier = 1f;
					val.duration = 10f;
					val.dotIndex = ProjectChronos.decayDot;
					InflictDotInfo val2 = val;
					DotController.InflictDot(ref val2);
				}
			}
		}
	}
}
namespace ProjectChronos.Items.Red
{
	public class EternalHarmonizer : ItemBase<EternalHarmonizer>
	{
		public ConfigEntry<bool> enable;

		public override string ItemName => "Eternal Harmonizer";

		public override string ItemLangTokenName => "ETERNALHARMONIZER";

		public override string ItemPickupDesc => "Increases move speed by +25% and decreases slow debuffs by -50%";

		public override string ItemFullDescription => "Increases move speed by <style=cIsUtility>25%</style><style=cStack> (+25% per stack)</style> and decreases applied slows by <style=cIsUtility>50%</style><style=cStack> (+25% per stack)</style>. Slow reduction caps out at <style=cIsUtility>3 stacks</style>.";

		public override string ItemLore => "\r\n<style=cMono>Mission Procurement File B-14a</style>\r\n\r\nDuring an excursion to a long abandoned planetary base, we managed to retrieve a strange crystal that seemingly accelerates time around itself. The cadet who made the discovery was found almost transparent, vibrating in-place at an incomprensible speed. This power could be invaluable to our elite forces if we can harness it properly.\r\n\r\nI recommend assigning the crystal to the research and development team at Project 'Chronos'.";

		public override ItemTier Tier => (ItemTier)2;

		public override GameObject ItemModel => ProjectChronos.assetBundle.LoadAsset<GameObject>("assets/harmonizeritemnux.prefab");

		public override Sprite ItemIcon => ProjectChronos.assetBundle.LoadAsset<Sprite>("assets/texharmonizericon.png");

		public override void Init(ConfigFile config)
		{
			CreateConfig(config);
			CreateLang();
			CreateItem();
			Hooks();
		}

		public override void CreateConfig(ConfigFile config)
		{
			enable = config.Bind<bool>("Items", ItemName, true, "Should this item be enabled.");
		}

		public override ItemDisplayRuleDict CreateItemDisplayRules()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Expected O, but got Unknown
			return new ItemDisplayRuleDict(Array.Empty<ItemDisplayRule>());
		}

		public override void Hooks()
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Expected O, but got Unknown
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Expected O, but got Unknown
			RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(RecalculateStatsAPI_GetStatCoefficients);
			CharacterBody.RecalculateStats += new Manipulator(ReducesSlows);
		}

		private void RecalculateStatsAPI_GetStatCoefficients(CharacterBody sender, StatHookEventArgs args)
		{
			if (Object.op_Implicit((Object)(object)sender) && Object.op_Implicit((Object)(object)sender.inventory))
			{
				int count = GetCount(sender);
				if (count > 0)
				{
					args.moveSpeedMultAdd += 0.25f * (float)count;
				}
			}
		}

		private void ReducesSlows(ILContext il)
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Expected O, but got Unknown
			//IL_0178: Unknown result type (might be due to invalid IL or missing references)
			ILCursor val = new ILCursor(il);
			int totalSlowIdx = -1;
			int idx1 = -1;
			int num3 = default(int);
			if (!val.TryGotoNext(new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchLdfld<CharacterBody>(x, "baseMoveSpeed")
			}) || !val.TryGotoNext(new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchLdfld<CharacterBody>(x, "levelMoveSpeed")
			}) || !val.TryGotoNext(new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchStloc(x, ref idx1)
			}) || !val.TryGotoNext((MoveType)0, new Func<Instruction, bool>[6]
			{
				(Instruction x) => ILPatternMatchingExt.MatchLdloc(x, idx1),
				(Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref num3),
				(Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref totalSlowIdx),
				(Instruction x) => ILPatternMatchingExt.MatchDiv(x),
				(Instruction x) => ILPatternMatchingExt.MatchMul(x),
				(Instruction x) => ILPatternMatchingExt.MatchStloc(x, idx1)
			}))
			{
				return;
			}
			val.TryGotoPrev(new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchLdloc(x, totalSlowIdx)
			});
			val.Index += 1;
			val.Emit(OpCodes.Ldarg, 0);
			val.EmitDelegate<Func<float, CharacterBody, float>>((Func<float, CharacterBody, float>)delegate(float totalSlow, CharacterBody body)
			{
				int count = GetCount(body);
				float num = totalSlow - 1f;
				if (count > 0 && num > 0f)
				{
					float num2 = Mathf.Clamp01(0.5f + 0.25f * (float)(count - 1));
					return totalSlow - num * num2;
				}
				return totalSlow;
			});
		}
	}
}
namespace ProjectChronos.Items.Green
{
	public class FracturedBand : ItemBase<FracturedBand>
	{
		public sealed class FracturedBandItemBehavior : ItemBehavior
		{
			private void OnDisable()
			{
				if (Object.op_Implicit((Object)(object)base.body))
				{
					if (base.body.HasBuff(ProjectChronos.timeBandOnBuff))
					{
						base.body.RemoveBuff(ProjectChronos.timeBandOnBuff);
					}
					if (base.body.HasBuff(ProjectChronos.timeBandOffBuff))
					{
						base.body.RemoveBuff(ProjectChronos.timeBandOffBuff);
					}
				}
			}

			private void FixedUpdate()
			{
				bool flag = base.body.HasBuff(ProjectChronos.timeBandOffBuff);
				bool flag2 = base.body.HasBuff(ProjectChronos.timeBandOnBuff);
				if (!flag && !flag2)
				{
					base.body.AddBuff(ProjectChronos.timeBandOnBuff);
				}
				if (flag2 && flag)
				{
					base.body.RemoveBuff(ProjectChronos.timeBandOnBuff);
				}
			}
		}

		public ConfigEntry<bool> enable;

		public override string ItemName => "Fractured Band";

		public override string ItemLangTokenName => "FRACTUREDBAND";

		public override string ItemPickupDesc => "Hits that deal <style=cIsDamage>more than 400% damage</style> also create a <style=cIsUtility>Chronosphere</style> that <style=cIsUtility>freezes enemies and projectiles in time</style> for <style=cIsUtility>5</style> seconds. Recharges every <style=cIsUtility>20</style> seconds.";

		public override string ItemFullDescription => "Hits that deal <style=cIsDamage>more than 400% damage</style> also create a <style=cIsUtility>Chronosphere</style> that <style=cIsUtility>freezes enemies and projectiles in time</style> for <style=cIsUtility>5</style> seconds. Recharges every <style=cIsUtility>20</style> <style=cStack>(-2 per stack)</style> seconds. Caps at <style=cIsUtility>10</style> seconds.";

		public override string ItemLore => "<style=cMono>Welcome to DataScraper (v3.1.53)\r\n$ Scraping memory...\r\n$ Resolving...\r\nComplete</style>\r\nAin't nothing here yet.";

		public override ItemTier Tier => (ItemTier)1;

		public override GameObject ItemModel => ProjectChronos.assetBundle.LoadAsset<GameObject>("assets/someband.prefab");

		public override Sprite ItemIcon => ProjectChronos.assetBundle.LoadAsset<Sprite>("assets/texbandicon.png");

		public override void Init(ConfigFile config)
		{
			CreateConfig(config);
			CreateLang();
			CreateItem();
			Hooks();
		}

		public override void CreateConfig(ConfigFile config)
		{
			enable = config.Bind<bool>("Items", ItemName, true, "Should this item be enabled.");
		}

		public override ItemDisplayRuleDict CreateItemDisplayRules()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Expected O, but got Unknown
			return new ItemDisplayRuleDict(Array.Empty<ItemDisplayRule>());
		}

		public override void Hooks()
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Expected O, but got Unknown
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Expected O, but got Unknown
			CharacterBody.AddTimedBuff_BuffIndex_float += new hook_AddTimedBuff_BuffIndex_float(EnterStasis);
			GlobalEventManager.OnHitEnemy += new hook_OnHitEnemy(CreateChronosphere);
			CharacterBody.onBodyInventoryChangedGlobal += AddItemBehavior;
		}

		private void AddItemBehavior(CharacterBody body)
		{
			body.AddItemBehavior<FracturedBandItemBehavior>(body.inventory.GetItemCount(ItemBase<FracturedBand>.instance.ItemDef));
		}

		private void EnterStasis(orig_AddTimedBuff_BuffIndex_float orig, CharacterBody self, BuffIndex buffIndex, float duration)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			if (buffIndex == ProjectChronos.timeFrozenBuff.buffIndex)
			{
				EntityStateMachine[] components = ((Component)self).GetComponents<EntityStateMachine>();
				foreach (EntityStateMachine val in components)
				{
					if (val.customName == "Body" && !(val.state is TimeFreeze))
					{
						val.SetInterruptState((EntityState)(object)new TimeFreeze(), (InterruptPriority)4);
					}
				}
			}
			orig.Invoke(self, buffIndex, duration);
		}

		private void CreateChronosphere(orig_OnHitEnemy orig, GlobalEventManager self, DamageInfo damageInfo, GameObject victim)
		{
			//IL_00df: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
			orig.Invoke(self, damageInfo, victim);
			if ((double)damageInfo.procCoefficient == 0.0 || damageInfo.rejected || !NetworkServer.active || !Object.op_Implicit((Object)(object)damageInfo.attacker) || (double)damageInfo.procCoefficient <= 0.0)
			{
				return;
			}
			CharacterBody component = damageInfo.attacker.GetComponent<CharacterBody>();
			if (!Object.op_Implicit((Object)(object)component))
			{
				return;
			}
			int count = GetCount(component);
			if (count > 0 && (double)damageInfo.damage / (double)component.damage >= 4.0 && component.HasBuff(ProjectChronos.timeBandOnBuff))
			{
				int num = Mathf.Clamp(20 - (count * 2 - 2), 10, 20);
				component.RemoveBuff(ProjectChronos.timeBandOnBuff);
				for (int i = 1; i <= num; i++)
				{
					component.AddTimedBuff(ProjectChronos.timeBandOffBuff, (float)i);
				}
				ProjectileManager.instance.FireProjectile(ProjectChronos.chronosphereEffect, victim.transform.position, Quaternion.identity, ((Component)component).gameObject, 0f, 0f, false, (DamageColorIndex)0, (GameObject)null, -1f);
			}
		}
	}
}
namespace ProjectChronos.EntityStates
{
	public class TimeFreeze : BaseState
	{
		private Animator modelAnimator;

		public float freezeDuration = 5f;

		public override void OnEnter()
		{
			//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0086: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
			((BaseState)this).OnEnter();
			if (Object.op_Implicit((Object)(object)((EntityState)this).sfxLocator) && ((EntityState)this).sfxLocator.barkSound != "")
			{
				Util.PlaySound(((EntityState)this).sfxLocator.barkSound, ((EntityState)this).gameObject);
			}
			modelAnimator = ((EntityState)this).GetModelAnimator();
			if (Object.op_Implicit((Object)(object)modelAnimator))
			{
				((Behaviour)modelAnimator).enabled = false;
			}
			if (Object.op_Implicit((Object)(object)((EntityState)this).rigidbody) && !((EntityState)this).rigidbody.isKinematic)
			{
				((EntityState)this).rigidbody.velocity = Vector3.zero;
				if (Object.op_Implicit((Object)(object)((EntityState)this).rigidbodyMotor))
				{
					((EntityState)this).rigidbodyMotor.moveVector = Vector3.zero;
				}
			}
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterDirection))
			{
				((EntityState)this).characterDirection.moveVector = ((EntityState)this).characterDirection.forward;
			}
		}

		public override void OnExit()
		{
			if (Object.op_Implicit((Object)(object)modelAnimator))
			{
				((Behaviour)modelAnimator).enabled = true;
			}
			((EntityState)this).OnExit();
		}

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			if (((EntityState)this).isAuthority && !((EntityState)this).characterBody.HasBuff(ProjectChronos.timeFrozenBuff))
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

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