Decompiled source of BloonSurvivorRebalance v0.1.0

BloonSurvivorRebalance.dll

Decompiled 10 hours ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
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 BloonSurvivorRebalance.Changes;
using BloonSurvivorRebalance.Modules;
using EntityStates;
using EntityStates.Bandit2.Weapon;
using EntityStates.Commando;
using EntityStates.Commando.CommandoWeapon;
using EntityStates.Commando.StickyGrenade;
using EntityStates.FalseSon;
using EntityStates.Huntress;
using EntityStates.Huntress.HuntressWeapon;
using EntityStates.Treebot;
using EntityStates.Treebot.Weapon;
using HarmonyLib;
using IL.EntityStates;
using IL.EntityStates.FalseSon;
using IL.EntityStates.Treebot.Weapon;
using IL.RoR2;
using Microsoft.CodeAnalysis;
using Mono.Cecil;
using Mono.Cecil.Cil;
using MonoMod.Cil;
using MonoMod.RuntimeDetour;
using On.EntityStates;
using On.EntityStates.Bandit2.Weapon;
using On.EntityStates.Commando;
using On.EntityStates.Commando.CommandoWeapon;
using On.EntityStates.FalseSon;
using On.EntityStates.Huntress;
using On.EntityStates.Huntress.HuntressWeapon;
using On.EntityStates.Treebot;
using On.EntityStates.Treebot.Weapon;
using On.RoR2;
using R2API;
using RoR2;
using RoR2.Achievements.FalseSon;
using RoR2.ContentManagement;
using RoR2.Projectile;
using RoR2.Skills;
using RoR2BepInExPack.GameAssetPathsBetter;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.Networking;

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

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace BloonSurvivorRebalance
{
	[BepInPlugin("com.Bloonjitsu7.BloonSurvivorRebalance", "BloonSurvivorRebalance", "0.1.0")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class MainPlugin : BaseUnityPlugin
	{
		public void Awake()
		{
			Log.Init(((BaseUnityPlugin)this).Logger);
			new ContentPacks().Initialize();
			Main main = new Main();
			main.SetupConfig(((BaseUnityPlugin)this).Config);
			main.Initialize();
		}
	}
	internal static class Log
	{
		private static ManualLogSource _logSource;

		internal static void Init(ManualLogSource logSource)
		{
			_logSource = logSource;
		}

		internal static void Debug(object data)
		{
			_logSource.LogDebug(data);
		}

		internal static void Error(object data)
		{
			_logSource.LogError(data);
		}

		internal static void Fatal(object data)
		{
			_logSource.LogFatal(data);
		}

		internal static void Info(object data)
		{
			_logSource.LogInfo(data);
		}

		internal static void Message(object data)
		{
			_logSource.LogMessage(data);
		}

		internal static void Warning(object data)
		{
			_logSource.LogWarning(data);
		}
	}
}
namespace BloonSurvivorRebalance.Modules
{
	public static class DamageTypes
	{
		public static ModdedDamageType fsLaserRechargeProc = DamageAPI.ReserveDamageType();

		public static ModdedDamageType rexSelfDamage = DamageAPI.ReserveDamageType();
	}
	public static class Buffs
	{
		internal static List<BuffDef> buffDefs = new List<BuffDef>();

		internal static BuffDef AddNewBuff(string buffName, Sprite buffIcon, Color buffColor, bool canStack, bool isDebuff, bool isCooldown, bool isHidden, bool ignoreNectar)
		{
			//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;
			val.isCooldown = isCooldown;
			val.isHidden = isHidden;
			val.ignoreGrowthNectar = ignoreNectar;
			buffDefs.Add(val);
			return val;
		}
	}
	public static class Effects
	{
		private static GameObject finder = Addressables.LoadAssetAsync<GameObject>((object)RoR2_Base_Mushroom.MushroomWard_prefab).WaitForCompletion();

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

		internal static void RegisterEffects()
		{
			HuntressChanges.scaledHuntressVFX = CreateHuntressVFX();
		}

		private static GameObject CreateTracer()
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = CloneTracer("RoR2/Base/Huntress/TracerHuntressSnipe.prefab", "TracerStormboundAurelioniteLaser", Color.red, new Color(1f, 0.04f, 0.04f, 1f), 2f);
			Object.Destroy((Object)(object)((Component)val.transform.Find("TracerHead")).gameObject);
			return val;
		}

		private static GameObject CreateHuntressVFX()
		{
			//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)
			return CloneObject(RoR2_Base_Huntress.HuntressArrowRain_prefab, "BloonHuntressArrowRain", Color.cyan, Color.cyan, 1f, 0f, colorMesh: false);
		}

		private static GameObject CloneObject(string originalObjectName, string newObjectName, Color color1, Color color2, float scaleMult = 1f, float colorTemp = 0f, bool colorMesh = true, string soundName = "", bool parentToTransform = false, bool recolor = true)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = Addressables.LoadAssetAsync<GameObject>((object)originalObjectName).WaitForCompletion();
			if ((Object)(object)val == (Object)null)
			{
				Log.Warning(originalObjectName + " is null!");
				return null;
			}
			Component[] componentsInChildren = val.GetComponentsInChildren(typeof(Component));
			foreach (Component data in componentsInChildren)
			{
				Log.Message(data);
			}
			GameObject val2 = PrefabAPI.InstantiateClone(val, newObjectName, false);
			if ((Object)(object)val2.GetComponent<EffectComponent>() == (Object)null)
			{
				val2.AddComponent<EffectComponent>();
			}
			if ((Object)(object)val2.GetComponent<VFXAttributes>() == (Object)null)
			{
				val2.AddComponent<VFXAttributes>();
			}
			val2.GetComponent<VFXAttributes>().vfxPriority = (VFXPriority)2;
			val2.GetComponent<VFXAttributes>().DoNotPool = true;
			if (recolor)
			{
				val2.Recolor(color1, color2, scaleMult, colorTemp, colorMesh);
			}
			CreateEffectFromObject(val2, soundName, parentToTransform);
			return val2;
		}

		private static GameObject CloneTracer(string originalTracerName, string newTracerName, Color color1, Color color2, float widthMult = 1f, float? speed = null, float? length = null)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_007f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ff: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = Addressables.LoadAssetAsync<GameObject>((object)originalTracerName).WaitForCompletion();
			if ((Object)(object)val == (Object)null)
			{
				Log.Warning(originalTracerName + " is null!");
				return null;
			}
			GameObject val2 = PrefabAPI.InstantiateClone(val, newTracerName, false);
			if (!Object.op_Implicit((Object)(object)val2.GetComponent<EffectComponent>()))
			{
				val2.AddComponent<EffectComponent>();
			}
			if (!Object.op_Implicit((Object)(object)val2.GetComponent<VFXAttributes>()))
			{
				val2.AddComponent<VFXAttributes>();
			}
			val2.GetComponent<VFXAttributes>().vfxPriority = (VFXPriority)2;
			val2.GetComponent<VFXAttributes>().DoNotPool = true;
			if (!Object.op_Implicit((Object)(object)val2.GetComponent<NetworkIdentity>()))
			{
				val2.AddComponent<NetworkIdentity>();
			}
			val2.GetComponent<Tracer>().speed = (speed.HasValue ? speed.Value : val2.GetComponent<Tracer>().speed);
			val2.GetComponent<Tracer>().length = (length.HasValue ? length.Value : val2.GetComponent<Tracer>().length);
			val2.Recolor(color1, color2, widthMult);
			CreateAndAddEffectDef(val2);
			return val2;
		}

		private static void Recolor(this GameObject thingToColor, Color color1, Color color2, float widthMult = 1f, float colorTemp = 0f, bool colorMesh = true)
		{
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_008d: Unknown result type (might be due to invalid IL or missing references)
			//IL_009a: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c7: Expected O, but got Unknown
			//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f7: 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_011f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0144: Unknown result type (might be due to invalid IL or missing references)
			//IL_0171: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_0229: Unknown result type (might be due to invalid IL or missing references)
			//IL_023c: 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_0290: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b6: Unknown result type (might be due to invalid IL or missing references)
			bool flag = true;
			LineRenderer[] componentsInChildren = thingToColor.GetComponentsInChildren<LineRenderer>();
			foreach (LineRenderer val in componentsInChildren)
			{
				bool flag2 = true;
				val.startColor = color1;
				val.endColor = color2;
				if (widthMult != 1f)
				{
					val.widthMultiplier *= widthMult;
				}
			}
			ParticleSystem[] componentsInChildren2 = thingToColor.GetComponentsInChildren<ParticleSystem>();
			foreach (ParticleSystem val2 in componentsInChildren2)
			{
				MainModule main = val2.main;
				MinMaxCurve startSize = ((MainModule)(ref main)).startSize;
				((MainModule)(ref main)).startSize = new MinMaxCurve(((MinMaxCurve)(ref startSize)).constant * widthMult);
				((MainModule)(ref main)).startColor = new MinMaxGradient(color1);
				TrailModule trails = val2.trails;
				if (((TrailModule)(ref trails)).enabled)
				{
					Gradient val3 = new Gradient();
					GradientColorKey[] array = (GradientColorKey[])(object)new GradientColorKey[2];
					array[0].color = color1;
					array[0].time = 0f;
					array[1].color = color2;
					array[1].time = 1f;
					GradientAlphaKey[] array2 = (GradientAlphaKey[])(object)new GradientAlphaKey[2];
					array2[0].alpha = color1.a;
					array2[0].time = 0f;
					array2[1].alpha = color2.a;
					array2[1].time = 1f;
					val3.SetKeys(array, array2);
					((TrailModule)(ref trails)).colorOverLifetime = new MinMaxGradient(val3);
				}
			}
			Light[] componentsInChildren3 = thingToColor.GetComponentsInChildren<Light>();
			foreach (Light val4 in componentsInChildren3)
			{
				if (colorTemp > 0f)
				{
					val4.colorTemperature = colorTemp;
					val4.useColorTemperature = true;
				}
				else
				{
					val4.useColorTemperature = false;
				}
				val4.color = color1;
				Transform transform = ((Component)val4).transform;
				transform.localScale *= widthMult;
			}
			ParticleSystemRenderer[] componentsInChildren4 = thingToColor.GetComponentsInChildren<ParticleSystemRenderer>();
			foreach (ParticleSystemRenderer val5 in componentsInChildren4)
			{
				((Renderer)val5).material.SetColor("_MainColor", color1);
				((Renderer)val5).material.SetColor("_Color", color1);
				((Renderer)val5).material.SetColor("_TintColor", color2);
			}
			if (colorMesh)
			{
				MeshRenderer[] componentsInChildren5 = thingToColor.GetComponentsInChildren<MeshRenderer>();
				foreach (MeshRenderer val6 in componentsInChildren5)
				{
					((Renderer)val6).material.SetColor("_MainColor", color1);
					((Renderer)val6).material.SetColor("_Color", color1);
					((Renderer)val6).material.SetColor("_TintColor", color2);
				}
			}
		}

		internal static void AddEffectDef(EffectDef effectDef)
		{
			effectDefs.Add(effectDef);
		}

		internal static EffectDef CreateAndAddEffectDef(GameObject effectPrefab, bool donotPool = false)
		{
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Expected O, but got Unknown
			if (donotPool)
			{
				VFXAttributes val = effectPrefab.GetComponent<VFXAttributes>();
				if ((Object)(object)val == (Object)null)
				{
					val = effectPrefab.AddComponent<VFXAttributes>();
				}
				val.DoNotPool = true;
			}
			EffectDef val2 = new EffectDef(effectPrefab);
			AddEffectDef(val2);
			return val2;
		}

		internal static void CreateEffectFromObject(GameObject newEffect, string soundName, bool parentToTransform)
		{
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			newEffect.AddComponent<DestroyOnTimer>().duration = 6f;
			newEffect.AddComponent<NetworkIdentity>();
			if (!Object.op_Implicit((Object)(object)newEffect.GetComponent<VFXAttributes>()))
			{
				newEffect.AddComponent<VFXAttributes>().vfxPriority = (VFXPriority)2;
			}
			EffectComponent component = newEffect.GetComponent<EffectComponent>();
			if (!Object.op_Implicit((Object)(object)component))
			{
				component = newEffect.AddComponent<EffectComponent>();
				component.applyScale = true;
				component.effectIndex = (EffectIndex)(-1);
				component.parentToReferencedTransform = parentToTransform;
				component.positionAtReferencedTransform = true;
				component.soundName = soundName;
			}
			CreateAndAddEffectDef(newEffect);
		}
	}
	internal class ContentPacks : IContentPackProvider
	{
		internal ContentPack contentPack = new ContentPack();

		public string identifier => "com.Bloonjitsu7.BloonSurvivorRebalance";

		public void Initialize()
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Expected O, but got Unknown
			Effects.RegisterEffects();
			ContentManager.collectContentPackProviders += new CollectContentPackProvidersDelegate(ContentManager_collectContentPackProviders);
		}

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

		public IEnumerator LoadStaticContentAsync(LoadStaticContentAsyncArgs args)
		{
			contentPack.identifier = identifier;
			contentPack.effectDefs.Add(Effects.effectDefs.ToArray());
			contentPack.buffDefs.Add(Buffs.buffDefs.ToArray());
			args.ReportProgress(1f);
			yield break;
		}

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

		public IEnumerator FinalizeAsync(FinalizeAsyncArgs args)
		{
			args.ReportProgress(1f);
			yield break;
		}
	}
}
namespace BloonSurvivorRebalance.Changes
{
	public class Main
	{
		public static List<Hook> hooks = new List<Hook>();

		public static List<ILHook> ILhooks = new List<ILHook>();

		public static BuffDef GrowthBuff;

		public static BuffDef LaserArmorBuff;

		public static BuffDef BlinkSpeedBuff;

		private static Sprite growthIcon = Addressables.LoadAssetAsync<Sprite>((object)RoR2_DLC2_Elites_EliteBead.texBuffEliteBeadIcon_png).WaitForCompletion();

		private static Sprite armorIcon = Addressables.LoadAssetAsync<Sprite>((object)RoR2_Base_Common.texBuffGenericShield_tif).WaitForCompletion();

		private static Sprite speedIcon = Addressables.LoadAssetAsync<Sprite>((object)RoR2_Base_Common.texMovespeedBuffIcon_tif).WaitForCompletion();

		internal static bool HasStormbound => Chainloader.PluginInfos.ContainsKey("com.Bloonjitsu7.StormboundFalseSon");

		public static ConfigEntry<bool> commandoEnable { get; set; }

		public static ConfigEntry<bool> huntressEnable { get; set; }

		public static ConfigEntry<bool> banditEnable { get; set; }

		public static ConfigEntry<bool> rexEnable { get; set; }

		public static ConfigEntry<bool> falseSonEnable { get; set; }

		public void SetupConfig(ConfigFile cfg)
		{
			commandoEnable = cfg.Bind<bool>("Commando", "Enable Changes", true, "Enables the changes to this survivor.");
			huntressEnable = cfg.Bind<bool>("Huntress", "Enable Changes", true, "Enables the changes to this survivor.");
			banditEnable = cfg.Bind<bool>("Bandit", "Enable Changes", true, "Enables the changes to this survivor.");
			rexEnable = cfg.Bind<bool>("REX", "Enable Changes", true, "Enables the changes to this survivor.");
			falseSonEnable = cfg.Bind<bool>("False Son", "Enable Changes", true, "Enables the changes to this survivor.");
		}

		public void Initialize()
		{
			CreateBuffs();
			if (commandoEnable.Value)
			{
				CommandoChanges commandoChanges = new CommandoChanges();
				commandoChanges.Initialize();
			}
			if (huntressEnable.Value)
			{
				HuntressChanges huntressChanges = new HuntressChanges();
				huntressChanges.Initialize();
			}
			if (banditEnable.Value)
			{
				BanditChanges banditChanges = new BanditChanges();
				banditChanges.Initialize();
			}
			if (rexEnable.Value)
			{
				REXChanges rEXChanges = new REXChanges();
				rEXChanges.Initialize();
			}
			if (falseSonEnable.Value)
			{
				FalseSonChanges falseSonChanges = new FalseSonChanges();
				falseSonChanges.Initialize();
			}
		}

		private void CreateBuffs()
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			GrowthBuff = Buffs.AddNewBuff("BloonGrowthBuff", growthIcon, Color.yellow, canStack: true, isDebuff: false, isCooldown: false, isHidden: false, ignoreNectar: true);
			LaserArmorBuff = Buffs.AddNewBuff("BloonFSLaserArmorBuff", armorIcon, Color.yellow, canStack: false, isDebuff: false, isCooldown: false, isHidden: false, ignoreNectar: false);
			BlinkSpeedBuff = Buffs.AddNewBuff("BloonFSLaserArmorBuff", speedIcon, Color.white, canStack: false, isDebuff: false, isCooldown: false, isHidden: false, ignoreNectar: false);
		}

		public static float ConvertReductionIntoStackingDivision(float baseFraction, int itemCount)
		{
			float num = 1f - baseFraction;
			float num2 = (1f + num) / num - 2f;
			num2 *= (float)(itemCount - 1);
			return num2 + 1f;
		}

		public static void DumpComponents(GameObject gameObject)
		{
			Component[] componentsInChildren = gameObject.GetComponentsInChildren(typeof(Component));
			foreach (Component data in componentsInChildren)
			{
				Log.Message(data);
			}
		}
	}
	public class BaseSurvivorChanges
	{
		private static GameObject survivorPrefab = Addressables.LoadAssetAsync<GameObject>((object)RoR2_Base_Commando.CommandoBody_prefab).WaitForCompletion();

		public void Initialize()
		{
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Expected O, but got Unknown
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Expected O, but got Unknown
			CharacterBody component = survivorPrefab.GetComponent<CharacterBody>();
			if (Object.op_Implicit((Object)(object)component))
			{
			}
			GenericProjectileBaseState.OnEnter += new hook_OnEnter(OnProjectileEnter);
			GenericBulletBaseState.OnEnter += new hook_OnEnter(OnBulletEnter);
			RoR2Application.onLoad = (Action)Delegate.Combine(RoR2Application.onLoad, new Action(OnLoad));
			UpdateLang();
		}

		public void OnLoad()
		{
		}

		public void UpdateLang()
		{
		}

		public void OnProjectileEnter(orig_OnEnter orig, GenericProjectileBaseState self)
		{
			orig.Invoke(self);
		}

		public void OnBulletEnter(orig_OnEnter orig, GenericBulletBaseState self)
		{
			orig.Invoke(self);
		}
	}
	public class CommandoChanges
	{
		private static GameObject commandoPrefab = Addressables.LoadAssetAsync<GameObject>((object)RoR2_Base_Commando.CommandoBody_prefab).WaitForCompletion();

		private static GameObject grenadePrefab = Addressables.LoadAssetAsync<GameObject>((object)RoR2_Base_Commando.CommandoGrenadeProjectile_prefab).WaitForCompletion();

		private static SkillDef grenadeSkill = Addressables.LoadAssetAsync<SkillDef>((object)RoR2_Base_Commando.ThrowGrenade_asset).WaitForCompletion();

		private static SkillDef stickySkill = Addressables.LoadAssetAsync<SkillDef>((object)RoR2_Base_Commando.CommandoSabotage_asset).WaitForCompletion();

		public void Initialize()
		{
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0034: Expected O, but got Unknown
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Expected O, but got Unknown
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Expected O, but got Unknown
			//IL_0060: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: Expected O, but got Unknown
			//IL_0094: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: Expected O, but got Unknown
			CharacterBody component = commandoPrefab.GetComponent<CharacterBody>();
			if (Object.op_Implicit((Object)(object)component))
			{
				component.baseArmor = 10f;
			}
			GenericProjectileBaseState.OnEnter += new hook_OnEnter(OnProjectileEnter);
			GenericBulletBaseState.OnEnter += new hook_OnEnter(OnBulletEnter);
			DodgeState.OnEnter += new hook_OnEnter(OnDodgeEnter);
			ThrowGrenade.ModifyProjectileInfo += new hook_ModifyProjectileInfo(OnGrenadeModify);
			MethodInfo methodInfo = AccessTools.Method(typeof(StickyGrenadeExplodeState), "Fire", (Type[])null, (Type[])null);
			Main.hooks.Add(new Hook((MethodBase)methodInfo, (Delegate)new Action<Action<StickyGrenadeExplodeState>, StickyGrenadeExplodeState>(OnStickyGrenadeExplode)));
			RoR2Application.onLoad = (Action)Delegate.Combine(RoR2Application.onLoad, new Action(OnLoadCommando));
			UpdateLang();
		}

		public void OnLoadCommando()
		{
			FirePistol2.baseDuration = 0.15384616f;
			FireBarrage.baseBulletCount = 10;
			FireBarrage.baseDurationBetweenShots /= 1.6666666f;
		}

		public void UpdateLang()
		{
			LanguageAPI.Add("COMMANDO_SECONDARY_DESCRIPTION", "Fire a <style=cIsDamage>piercing</style> bullet for <style=cIsDamage>450% damage</style>. The damage increases by <style=cIsDamage>1.4x</style> every time it passes through an enemy.");
			LanguageAPI.Add("COMMANDO_SECONDARY_ALT1_DESCRIPTION", "Fire two close-range blasts that deal <style=cIsDamage>8x225% damage</style> total.");
			LanguageAPI.Add("COMMANDO_UTILITY_DESCRIPTION", "Roll a short distance. Briefly gain <style=cIsUtility>invulnerability</style> at the start of the roll.");
			LanguageAPI.Add("COMMANDO_SPECIAL_ALT1_DESCRIPTION", "<style=cIsDamage>Ignite</style>. Throw a grenade that explodes for <style=cIsDamage>800% damage</style>. Can hold up to 2.");
			grenadeSkill.keywordTokens = new string[1] { "KEYWORD_IGNITE" };
			LanguageAPI.Add("COMMANDO_SPECIAL_ALT2_DESCRIPTION", "<style=cIsDamage>Shocking</style>. Throw 3 explosives that <style=cIsUtility>attach</style> to surfaces. When <style=cIsDamage>attacked</style>, they <style=cIsDamage>zap</style> enemies for <style=cIsDamage>475% damage</style>.");
			stickySkill.keywordTokens = new string[1] { "KEYWORD_SHOCKING" };
		}

		public void OnProjectileEnter(orig_OnEnter orig, GenericProjectileBaseState self)
		{
			if (self is FireFMJ)
			{
				self.damageCoefficient = 4.5f;
			}
			if (self is ThrowGrenade)
			{
				self.damageCoefficient = 8f;
			}
			orig.Invoke(self);
		}

		public void OnBulletEnter(orig_OnEnter orig, GenericBulletBaseState self)
		{
			if (self is FireShotgunBlast)
			{
				self.damageCoefficient = 2.25f;
			}
			orig.Invoke(self);
		}

		public void OnDodgeEnter(orig_OnEnter orig, DodgeState self)
		{
			orig.Invoke(self);
			if ((Object)(object)((EntityState)self).characterBody != (Object)null)
			{
				((EntityState)self).characterBody.AddTimedBuff(Buffs.HiddenInvincibility, 0.3f);
			}
		}

		public void OnSlideEnter(orig_OnEnter orig, SlideState self)
		{
			orig.Invoke(self);
			if ((Object)(object)((EntityState)self).characterBody != (Object)null)
			{
				((EntityState)self).characterBody.AddTimedBuff(Buffs.HiddenInvincibility, 0.15f);
			}
		}

		public void OnGrenadeModify(orig_ModifyProjectileInfo orig, ThrowGrenade self, ref FireProjectileInfo info)
		{
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			orig.Invoke(self, ref info);
			info.damageTypeOverride = new DamageTypeCombo(DamageTypeCombo.op_Implicit((DamageType)128), (DamageTypeExtended)0, (DamageSource)8);
		}

		public void OnStickyGrenadeExplode(Action<StickyGrenadeExplodeState> orig, StickyGrenadeExplodeState self)
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			self.projectileDamage.damageType = new DamageTypeCombo(DamageTypeCombo.op_Implicit((DamageType)16777216), (DamageTypeExtended)8192, (DamageSource)8);
			StickyGrenadeExplodeState.damageCoefficient = 4.75f;
			orig(self);
		}
	}
	public class HuntressChanges
	{
		private static GameObject survivorPrefab = Addressables.LoadAssetAsync<GameObject>((object)RoR2_Base_Huntress.HuntressBody_prefab).WaitForCompletion();

		private static SkillDef cycloneSkill = Addressables.LoadAssetAsync<SkillDef>((object)RoR2_Base_Huntress.ThrowCyclone_Kick_asset).WaitForCompletion();

		public static GameObject scaledHuntressVFX;

		public void Initialize()
		{
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0034: Expected O, but got Unknown
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Expected O, but got Unknown
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Expected O, but got Unknown
			//IL_0060: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: Expected O, but got Unknown
			CharacterBody component = survivorPrefab.GetComponent<CharacterBody>();
			if (Object.op_Implicit((Object)(object)component))
			{
				component.baseCrit = 5f;
			}
			RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(OnRecalcStats);
			FireSeekingArrow.OnEnter += new hook_OnEnter(OnFireArrow);
			ArrowRain.OnEnter += new hook_OnEnter(OnArrowRainEnter);
			BlinkState.OnExit += new hook_OnExit(OnBlinkExit);
			RoR2Application.onLoad = (Action)Delegate.Combine(RoR2Application.onLoad, new Action(OnLoad));
			UpdateLang();
		}

		public void OnLoad()
		{
			//IL_0033: 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)
			cycloneSkill.baseRechargeInterval = 2.5f;
			ArrowRain.projectilePrefab.transform.Find("FX").localScale = new Vector3(1.2666667f, 1.4666667f, 1.2666667f);
			HitBox[] componentsInChildren = ArrowRain.projectilePrefab.GetComponentsInChildren<HitBox>();
			foreach (HitBox val in componentsInChildren)
			{
				((Component)val).transform.localScale = new Vector3(1.1333333f, 2.25f, 1.1333333f);
			}
			ProjectileDotZone component = ArrowRain.projectilePrefab.GetComponent<ProjectileDotZone>();
			if (Object.op_Implicit((Object)(object)component))
			{
				component.damageCoefficient = 0.6818181f;
			}
		}

		public void UpdateLang()
		{
			LanguageAPI.Add("HUNTRESS_PRIMARY_DESCRIPTION", "<style=cIsUtility>Agile</style>. Quickly fire a seeking arrow for <style=cIsDamage>180% damage</style>.");
			LanguageAPI.Add("HUNTRESS_UTILITY_DESCRIPTION", "<style=cIsUtility>Disappear</style> and <style=cIsUtility>teleport</style> forwards, granting a short boost to <style=cIsUtility>movement speed</style>.");
			LanguageAPI.Add("HUNTRESS_SPECIAL_DESCRIPTION", "<style=cIsUtility>Teleport</style> into the sky. Target an area to rain arrows, <style=cIsUtility>slowing</style> enemies and dealing <style=cIsDamage>450% damage per second</style> for <style=cIsUtility>6 seconds</style>.");
		}

		public void OnFireArrow(orig_OnEnter orig, FireSeekingArrow self)
		{
			if (self is FireFlurrySeekingArrow)
			{
				self.baseDuration = 1.15f;
				self.orbProcCoefficient = 0.8f;
			}
			else
			{
				self.orbDamageCoefficient = 1.8f;
			}
			orig.Invoke(self);
		}

		public void OnArrowRainEnter(orig_OnEnter orig, ArrowRain self)
		{
			ArrowRain.arrowRainRadius = 9.5f;
			orig.Invoke(self);
		}

		public void OnBlinkExit(orig_OnExit orig, BlinkState self)
		{
			orig.Invoke(self);
			if (!(self is MiniBlinkState))
			{
				((EntityState)self).characterBody.AddTimedBuff(Main.BlinkSpeedBuff, 2.5f);
			}
		}

		private void OnRecalcStats(CharacterBody sender, StatHookEventArgs args)
		{
			if ((Object)(object)sender != (Object)null && sender.HasBuff(Main.BlinkSpeedBuff))
			{
				args.moveSpeedTotalMult *= 1.5f;
			}
		}
	}
	public class BanditChanges
	{
		private static GameObject survivorPrefab = Addressables.LoadAssetAsync<GameObject>((object)RoR2_Base_Bandit2.Bandit2Body_prefab).WaitForCompletion();

		private static ReloadSkillDef blastSkill = Addressables.LoadAssetAsync<ReloadSkillDef>((object)RoR2_Base_Bandit2.Bandit2Blast_asset).WaitForCompletion();

		private static SkillDef daggerSkill = Addressables.LoadAssetAsync<SkillDef>((object)RoR2_Base_Bandit2.SlashBlade_asset).WaitForCompletion();

		private static SkillDef shivSkill = Addressables.LoadAssetAsync<SkillDef>((object)RoR2_Base_Bandit2.Bandit2SerratedShivs_asset).WaitForCompletion();

		private static SkillDef revolverSkill = Addressables.LoadAssetAsync<SkillDef>((object)RoR2_Base_Bandit2.ResetRevolver_asset).WaitForCompletion();

		private static SkillDef skullSkill = Addressables.LoadAssetAsync<SkillDef>((object)RoR2_Base_Bandit2.SkullRevolver_asset).WaitForCompletion();

		public void Initialize()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Expected O, but got Unknown
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Expected O, but got Unknown
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Expected O, but got Unknown
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Expected O, but got Unknown
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Expected O, but got Unknown
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Expected O, but got Unknown
			//IL_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_007e: Expected O, but got Unknown
			GenericBulletBaseState.OnEnter += new hook_OnEnter(OnBulletEnter);
			BasicMeleeAttack.OnEnter += new hook_OnEnter(OnMeleeEnter);
			Bandit2FirePrimaryBase.OnEnter += new hook_OnEnter(OnFirePrimaryEnter);
			Bandit2FireShiv.OnEnter += new hook_OnEnter(OnShivEnter);
			Bandit2FireShiv.FireShiv += new hook_FireShiv(OnFireShiv);
			BaseFireSidearmRevolverState.OnEnter += new hook_OnEnter(OnFireRevolver);
			BaseSidearmState.GetMinimumInterruptPriority += new hook_GetMinimumInterruptPriority(OnRevolverInterrupt);
			RoR2Application.onLoad = (Action)Delegate.Combine(RoR2Application.onLoad, new Action(OnLoad));
			UpdateLang();
		}

		public void OnLoad()
		{
			((SkillDef)blastSkill).baseMaxStock = 3;
			daggerSkill.baseRechargeInterval = 3f;
			shivSkill.baseRechargeInterval = 5f;
			revolverSkill.baseRechargeInterval = 7f;
		}

		public void UpdateLang()
		{
			LanguageAPI.Add("BANDIT2_PRIMARY_ALT_DESCRIPTION", "Fire a rifle blast for <style=cIsDamage>500% damage</style> with <style=cIsUtility>no falloff</style>. Can hold up to 3 bullets.");
			LanguageAPI.Add("BANDIT2_SECONDARY_DESCRIPTION", "Lunge and slash for <style=cIsDamage>420% damage</style>. Critical Strikes also cause <style=cIsHealth>hemorrhaging</style>.");
			LanguageAPI.Add("BANDIT2_SECONDARY_ALT_DESCRIPTION", "Throw a fan of hidden blades for <style=cIsDamage>160x3% damage</style>. Critical Strikes also cause <style=cIsHealth>hemorrhaging</style>.");
			LanguageAPI.Add("BANDIT2_SPECIAL_DESCRIPTION", "<style=cIsDamage>Slayer</style>. Fire a revolver shot for <style=cIsDamage>900% damage</style>. Kills <style=cIsUtility>reset all your cooldowns</style>.");
		}

		public void OnBulletEnter(orig_OnEnter orig, GenericBulletBaseState self)
		{
			orig.Invoke(self);
		}

		public void OnMeleeEnter(orig_OnEnter orig, BasicMeleeAttack self)
		{
			//IL_0025: 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_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_0039: 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)
			if (self is SlashBlade)
			{
				SlashBlade.selfForceStrength = 0f;
				self.damageCoefficient = 4.2f;
				Ray aimRay = ((BaseState)self).GetAimRay();
				Vector3 direction = ((Ray)(ref aimRay)).direction;
				((EntityState)self).characterMotor.ApplyForce(direction * 2500f, true, false);
			}
			orig.Invoke(self);
		}

		public void OnShivEnter(orig_OnEnter orig, Bandit2FireShiv self)
		{
			Bandit2FireShiv.baseDelayBetweenShivs = 0.07f;
			self.maxShivCount = 3;
			orig.Invoke(self);
		}

		public void OnFireShiv(orig_FireShiv orig, Bandit2FireShiv self)
		{
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: 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_0087: Unknown result type (might be due to invalid IL or missing references)
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0090: Unknown result type (might be due to invalid IL or missing references)
			//IL_0095: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			//IL_009c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_0103: Unknown result type (might be due to invalid IL or missing references)
			//IL_0149: Unknown result type (might be due to invalid IL or missing references)
			//IL_0150: Unknown result type (might be due to invalid IL or missing references)
			//IL_015f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0161: Unknown result type (might be due to invalid IL or missing references)
			//IL_0168: Unknown result type (might be due to invalid IL or missing references)
			if (Object.op_Implicit((Object)(object)Bandit2FireShiv.muzzleEffectPrefab) && self.shivCount <= 1)
			{
				EffectManager.SimpleMuzzleFlash(Bandit2FireShiv.muzzleEffectPrefab, ((EntityState)self).gameObject, Bandit2FireShiv.muzzleString, false);
			}
			if (((EntityState)self).isAuthority)
			{
				Ray aimRay = ((BaseState)self).GetAimRay();
				if ((Object)(object)self.projectilePrefab != (Object)null)
				{
					TrajectoryAimAssist.ApplyTrajectoryAimAssist(ref aimRay, self.projectilePrefab, ((EntityState)self).gameObject, 1f);
					Vector3 val = Vector3.Cross(Vector3.up, ((Ray)(ref aimRay)).direction);
					Vector3 val2 = Vector3.Cross(((Ray)(ref aimRay)).direction, val);
					float num = (float)(self.shivCount - 1) * 10f - 10f;
					((Ray)(ref aimRay)).direction = Quaternion.AngleAxis(num, val2) * ((Ray)(ref aimRay)).direction;
					FireProjectileInfo val3 = new FireProjectileInfo
					{
						projectilePrefab = self.projectilePrefab,
						position = ((Ray)(ref aimRay)).origin,
						rotation = Util.QuaternionSafeLookRotation(((Ray)(ref aimRay)).direction),
						owner = ((EntityState)self).gameObject,
						damage = ((BaseState)self).damageStat * 1.6f,
						force = self.force,
						crit = ((BaseState)self).RollCrit(),
						damageTypeOverride = new DamageTypeCombo(DamageTypeCombo.op_Implicit((DamageType)134217728), (DamageTypeExtended)0, (DamageSource)2)
					};
					ProjectileManager.instance.FireProjectile(val3);
				}
			}
		}

		public void OnFirePrimaryEnter(orig_OnEnter orig, Bandit2FirePrimaryBase self)
		{
			if (self is Bandit2FireRifle)
			{
				self.minimumBaseDuration = 0.65f;
				((GenericBulletBaseState)self).damageCoefficient = 5f;
			}
			orig.Invoke(self);
		}

		public void OnFireRevolver(orig_OnEnter orig, BaseFireSidearmRevolverState self)
		{
			if (self is FireSidearmResetRevolver)
			{
				self.damageCoefficient = 9f;
			}
			orig.Invoke(self);
		}

		public InterruptPriority OnRevolverInterrupt(orig_GetMinimumInterruptPriority orig, BaseSidearmState self)
		{
			//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)5;
		}
	}
	public class REXChanges
	{
		private static GameObject survivorPrefab = Addressables.LoadAssetAsync<GameObject>((object)RoR2_Base_Treebot.TreebotBody_prefab).WaitForCompletion();

		private static GameObject syringePrefab1 = Addressables.LoadAssetAsync<GameObject>((object)RoR2_Base_Treebot.SyringeProjectile_prefab).WaitForCompletion();

		private static GameObject syringePrefab2 = Addressables.LoadAssetAsync<GameObject>((object)RoR2_Base_Treebot.SyringeProjectileHealing_prefab).WaitForCompletion();

		private static GameObject drillPrefab = Addressables.LoadAssetAsync<GameObject>((object)RoR2_Base_Treebot.TreebotMortarRain_prefab).WaitForCompletion();

		private static SkillDef drillSkill = Addressables.LoadAssetAsync<SkillDef>((object)RoR2_Base_Treebot.TreebotBodyAimMortarRain_asset).WaitForCompletion();

		private static SkillDef disperseSkill = Addressables.LoadAssetAsync<SkillDef>((object)RoR2_Base_Treebot.TreebotBodySonicBoom_asset).WaitForCompletion();

		public void Initialize()
		{
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0034: Expected O, but got Unknown
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Expected O, but got Unknown
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Expected O, but got Unknown
			//IL_0060: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: Expected O, but got Unknown
			//IL_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Expected O, but got Unknown
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_008e: Expected O, but got Unknown
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bd: Expected O, but got Unknown
			//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c2: Expected O, but got Unknown
			//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d4: Expected O, but got Unknown
			//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e6: Expected O, but got Unknown
			CharacterBody component = survivorPrefab.GetComponent<CharacterBody>();
			if (Object.op_Implicit((Object)(object)component))
			{
				component.sprintingSpeedMultiplier = 1.75f;
			}
			GenericProjectileBaseState.OnEnter += new hook_OnEnter(OnProjectileEnter);
			GenericBulletBaseState.OnEnter += new hook_OnEnter(OnBulletEnter);
			AimMortar2.OnProjectileFiredLocal += new hook_OnProjectileFiredLocal(OnMortarFired);
			AimMortar2.OnProjectileFiredLocal += new Manipulator(IL_SelfDamage);
			FirePlantSonicBoom.OnEnter += new Manipulator(IL_SelfDamage);
			FireFlower2.OnEnter += new Manipulator(IL_SelfDamage);
			MethodInfo methodInfo = AccessTools.Method(typeof(Proliferation), "OnEnter", (Type[])null, (Type[])null);
			Main.ILhooks.Add(new ILHook((MethodBase)methodInfo, new Manipulator(IL_SelfDamage)));
			HealthComponent.TakeDamageProcess += new Manipulator(IL_PreventCurse);
			TreebotFireFruitSeed.OnEnter += new hook_OnEnter(OnFireFruit);
			RoR2Application.onLoad = (Action)Delegate.Combine(RoR2Application.onLoad, new Action(OnLoad));
			UpdateLang();
		}

		public void OnLoad()
		{
			//IL_008a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0094: Unknown result type (might be due to invalid IL or missing references)
			FirePlantSonicBoom.healthCostFraction = 0.15f;
			ProjectileController component = syringePrefab1.GetComponent<ProjectileController>();
			if (Object.op_Implicit((Object)(object)component))
			{
				component.procCoefficient = 0.75f;
			}
			ProjectileController component2 = syringePrefab2.GetComponent<ProjectileController>();
			if (Object.op_Implicit((Object)(object)component2))
			{
				component2.procCoefficient = 0.75f;
			}
			drillSkill.baseRechargeInterval = 5f;
			ProjectileDotZone component3 = drillPrefab.GetComponent<ProjectileDotZone>();
			if (Object.op_Implicit((Object)(object)component3))
			{
				component3.overlapProcCoefficient = 0.6f;
				Transform transform = ((Component)component3).transform;
				transform.localScale *= 1.15f;
			}
			disperseSkill.baseRechargeInterval = 4.5f;
			FirePlantSonicBoom.procCoefficient = 1f;
		}

		public void UpdateLang()
		{
			LanguageAPI.Add("TREEBOT_SECONDARY_DESCRIPTION", "<style=cIsHealth>10% HP</style>. Launch a mortar into the sky for <style=cIsDamage>450% damage</style>.");
			LanguageAPI.Add("TREEBOT_UTILITY_ALT1_DESCRIPTION", "<style=cIsHealth>15% HP</style>. Fire a <style=cIsUtility>Sonic Boom</style> that <style=cIsDamage>damages</style> enemies for <style=cIsDamage>550% damage</style>. <style=cIsHealing>Heals for every target hit</style>.");
			LanguageAPI.Add("TREEBOT_SPECIAL_ALT1_DESCRIPTION", "Fire a bolt that deals <style=cIsDamage>525% damage</style> and <style=cIsDamage>injects</style> an enemy. On death, drop multiple <style=cIsHealing>healing fruits</style> that heal for <style=cIsHealing>25% HP</style>.");
		}

		public void OnProjectileEnter(orig_OnEnter orig, GenericProjectileBaseState self)
		{
			orig.Invoke(self);
		}

		public void OnBulletEnter(orig_OnEnter orig, GenericBulletBaseState self)
		{
			orig.Invoke(self);
		}

		public void OnMortarFired(orig_OnProjectileFiredLocal orig, AimMortar2 self)
		{
			self.healthCostFraction = 0.1f;
			orig.Invoke(self);
		}

		public void OnFireFruit(orig_OnEnter orig, TreebotFireFruitSeed self)
		{
			self.baseDuration = 0.5f;
			self.damageCoefficient = 5.25f;
			orig.Invoke(self);
		}

		public void IL_SelfDamage(ILContext il)
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Expected O, but got Unknown
			//IL_000f: 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)
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_0098: Unknown result type (might be due to invalid IL or missing references)
			ILCursor val = new ILCursor(il);
			MoveType val2 = (MoveType)0;
			MoveType val3 = (MoveType)2;
			int loc1 = -1;
			if (val.TryGotoNext(val3, new Func<Instruction, bool>[2]
			{
				(Instruction x) => ILPatternMatchingExt.MatchNewobj<DamageInfo>(x),
				(Instruction x) => ILPatternMatchingExt.MatchStloc(x, ref loc1)
			}))
			{
				if (val.TryGotoNext(val3, new Func<Instruction, bool>[1]
				{
					(Instruction x) => ILPatternMatchingExt.MatchStfld(x, typeof(DamageInfo), "damageType")
				}))
				{
					val.Emit(OpCodes.Ldloc, loc1);
					val.EmitDelegate<Action<DamageInfo>>((Action<DamageInfo>)delegate(DamageInfo info)
					{
						//IL_0003: Unknown result type (might be due to invalid IL or missing references)
						//IL_0008: Unknown result type (might be due to invalid IL or missing references)
						//IL_000e: Unknown result type (might be due to invalid IL or missing references)
						info.damageType = DamageTypeCombo.op_Implicit((DamageType)3);
						DamageAPI.AddModdedDamageType(info, DamageTypes.rexSelfDamage);
					});
				}
				else
				{
					Log.Error(((MemberReference)il.Method).Name + " Hook 1.2 failed!");
				}
			}
			else
			{
				Log.Error(((MemberReference)il.Method).Name + " Hook 1.1 failed!");
			}
		}

		public void IL_PreventCurse(ILContext il)
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Expected O, but got Unknown
			//IL_000f: 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)
			//IL_001f: 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_011f: Unknown result type (might be due to invalid IL or missing references)
			ILCursor val = new ILCursor(il);
			MoveType val2 = (MoveType)0;
			MoveType val3 = (MoveType)2;
			ILLabel nextInstr = il.DefineLabel();
			ILLabel val4 = default(ILLabel);
			if (val.TryGotoNext(val3, new Func<Instruction, bool>[6]
			{
				(Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 1),
				(Instruction x) => ILPatternMatchingExt.MatchBneUn(x, ref val4),
				(Instruction x) => ILPatternMatchingExt.MatchCall(x, typeof(Run), "get_instance"),
				(Instruction x) => ILPatternMatchingExt.MatchCallvirt(x, typeof(Run), "get_selectedDifficulty"),
				(Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 10),
				(Instruction x) => ILPatternMatchingExt.MatchBlt(x, ref nextInstr)
			}))
			{
				val.Emit(OpCodes.Ldarg, 1);
				val.EmitDelegate<Func<DamageInfo, bool>>((Func<DamageInfo, bool>)((DamageInfo info) => DamageAPI.HasModdedDamageType(info, DamageTypes.rexSelfDamage) ? true : false));
				val.Emit(OpCodes.Brtrue, (object)nextInstr);
			}
			else
			{
				Log.Error(((MemberReference)il.Method).Name + " Hook 1 failed!");
			}
		}
	}
	public class FalseSonChanges
	{
		private static GameObject survivorPrefab = Addressables.LoadAssetAsync<GameObject>((object)RoR2_DLC2_FalseSon.FalseSonBody_prefab).WaitForCompletion();

		public static SkillDef spikeSkill = Addressables.LoadAssetAsync<SkillDef>((object)RoR2_DLC2_FalseSon.FalseSonBodyLunarSpikes_asset).WaitForCompletion();

		public static SkillDef stakeSkill = Addressables.LoadAssetAsync<SkillDef>((object)RoR2_DLC2_FalseSon.FalseSonLunarStake_asset).WaitForCompletion();

		public static SkillDef dashSkill = Addressables.LoadAssetAsync<SkillDef>((object)RoR2_DLC2_FalseSon.FalseSonBodyStep_asset).WaitForCompletion();

		public static SkillDef meridianSkill = Addressables.LoadAssetAsync<SkillDef>((object)RoR2_DLC2_FalseSon.FalseSonMeridiansWill_asset).WaitForCompletion();

		public static SteppedSkillDef laserSkill = Addressables.LoadAssetAsync<SteppedSkillDef>((object)RoR2_DLC2_FalseSon.FalseSonBodyLaser_asset).WaitForCompletion();

		public static SteppedSkillDef burstSkill = Addressables.LoadAssetAsync<SteppedSkillDef>((object)RoR2_DLC2_FalseSon.FalseSonBodyLaserBurst_asset).WaitForCompletion();

		public void Initialize()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Expected O, but got Unknown
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Expected O, but got Unknown
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Expected O, but got Unknown
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Expected O, but got Unknown
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Expected O, but got Unknown
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Expected O, but got Unknown
			//IL_0094: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: Expected O, but got Unknown
			//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: Expected O, but got Unknown
			//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c2: Expected O, but got Unknown
			//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d4: Expected O, but got Unknown
			//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e6: Expected O, but got Unknown
			//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f8: Expected O, but got Unknown
			//IL_0100: Unknown result type (might be due to invalid IL or missing references)
			//IL_010a: Expected O, but got Unknown
			//IL_0112: Unknown result type (might be due to invalid IL or missing references)
			//IL_011c: Expected O, but got Unknown
			//IL_0124: Unknown result type (might be due to invalid IL or missing references)
			//IL_012e: Expected O, but got Unknown
			//IL_0136: Unknown result type (might be due to invalid IL or missing references)
			//IL_0140: Expected O, but got Unknown
			//IL_0081: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: Expected O, but got Unknown
			GenericProjectileBaseState.OnEnter += new hook_OnEnter(OnProjectileEnter);
			GenericBulletBaseState.OnEnter += new hook_OnEnter(OnBulletEnter);
			BasicMeleeAttack.OnEnter += new hook_OnEnter(OnMeleeEnter);
			RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(OnRecalcStats);
			CharacterBody.ComputeTamperedHeartBonus += new hook_ComputeTamperedHeartBonus(OnComputeTamperedHeart);
			HealthComponent.TakeDamageProcess += new hook_TakeDamageProcess(OnTakeDamage);
			if (!Main.HasStormbound)
			{
				HealthComponent.TakeDamageProcess += new Manipulator(IL_TakeDamage);
			}
			FalseSonController.UpdateGrowth += new hook_UpdateGrowth(OnUpdateGrowth);
			FalseSonController.GetGrowthSpecialStock += new hook_GetGrowthSpecialStock(OnUpdateSpecial);
			FalseSonController.GetGrowthLaserBonusDuration += new hook_GetGrowthLaserBonusDuration(OnUpdateLaser);
			LunarSpikes.InitializeLunarSpike += new hook_InitializeLunarSpike(OnInitLunarSpike);
			MeridiansWillFire.OnEnter += new hook_OnEnter(OnMeridianEnter);
			LaserFatherCharged.OnEnter += new hook_OnEnter(OnLaserEnter);
			LaserFatherCharged.OnExit += new hook_OnExit(OnLaserExit);
			LaserFatherCharged.OnEnter += new Manipulator(IL_LaserEnter);
			LaserFatherCharged.FixedUpdate += new Manipulator(IL_LaserUpdate);
			LaserFatherCharged.FireBullet += new Manipulator(IL_LaserFire);
			RoR2Application.onLoad = (Action)Delegate.Combine(RoR2Application.onLoad, new Action(OnLoadFalseSon));
			UpdateLang();
		}

		public void OnLoadFalseSon()
		{
			StepBrothers.damageCoefficient = 3f;
			LunarSpikes.attackSpeedAltAnimationThreshold = 1.4f;
			LaserFatherBurst.damageCoefficient = 12f;
			FalseSonGrowthChallenge.requirement = 25;
			dashSkill.baseMaxStock = 1;
			dashSkill.baseRechargeInterval = 7f;
			stakeSkill.baseRechargeInterval = 10f;
			((SkillDef)burstSkill).baseRechargeInterval = 8.5f;
			FalseSonController.meridianWillMultiplier = 2.5f;
		}

		public void UpdateLang()
		{
			LanguageAPI.Add("KEYWORD_BLOONSPIKEGROWTH", "<style=cKeywordName>Growth</style><style=cSub>Each stack of <style=cIsHealing>Growth</style> grants this skill an additional charge.</style>");
			LanguageAPI.Add("KEYWORD_BLOONSTAKEGROWTH", "<style=cKeywordName>Growth</style><style=cSub>Every 2 stacks of <style=cIsHealing>Growth</style> grants this skill an additional charge.</style>");
			LanguageAPI.Add("KEYWORD_BLOONDASHGROWTH", "<style=cKeywordName>Growth</style><style=cSub>Every 3 stacks of <style=cIsHealing>Growth</style> grants this skill an additional charge.</style>");
			LanguageAPI.Add("KEYWORD_BLOONMERIDIANGROWTH", "<style=cKeywordName>Growth</style><style=cSub>Each stack of <style=cIsHealing>Growth</style> grants this skill +20% damage and +10% radius.</style>");
			LanguageAPI.Add("KEYWORD_BLOONLASERGROWTH", "<style=cKeywordName>Growth</style><style=cSub>Each stack of <style=cIsHealing>Growth</style> increases this skill's tick rate by 10%.</style>");
			LanguageAPI.Add("KEYWORD_BLOONBURSTGROWTH", "<style=cKeywordName>Growth</style><style=cSub>Every 4 stacks of <style=cIsHealing>Growth</style> grants this skill an additional charge.</style>");
			LanguageAPI.Add("KEYWORD_ENERGIZEDCORE", "<style=cKeywordName>Energized Core</style><style=cSub>Increases the benefits of your passive by 2.5x.</style>");
			LanguageAPI.Add("FALSESON_DESCRIPTION", "The False Son is a slow but stalwart close-range warrior. With extreme health and defense, False Son can weather any storm. Use False Son\\u2019s durability to stay in the fray and capitalize on his slow but deadly skills.<style=cSub>\r\n\r\n< ! > False son closes the distance on enemies with dashes to deliver destruction with his lunar club. Charge the club swing for an explosive slam.\r\n\r\n< ! > Increasing your max health increases your Lunar Spike count, which in turn increases your power. Try building into items that boost health and durability.\r\n\r\n< ! > For each Lunar Spike you have you gain primary damage and armor and using the Lunar Spikes depletes those bonuses. The more depleted slots of Lunar Spikes you have, the quicker you will move and heal.\r\n\r\n< ! > Utilize the long-range potential of your laser and lunar spikes to pick off out-of-reach aerial enemies.</style>");
			LanguageAPI.Add("ACHIEVEMENT_FALSESONGROWTHCHALLENGE_DESCRIPTION", "As False Son, reach 25 stacks of Growth.");
			LanguageAPI.Add("FALSESON_PASSIVE_DESCRIPTION", "Gain stacks of <style=cIsHealing>Growth</style> as your <style=cIsHealing>maximum health increases</style>, enhancing your abilities. Unused Lunar Spikes give <style=cIsUtility>+7.5% primary skill damage</style> and <style=cIsUtility>+2.5 armor</style>. Used spikes give <style=cIsUtility>+5% movement speed</style> and <style=cIshealing>+2.5 health regeneration</style>.");
			LanguageAPI.Add("FALSESON_PRIMARY_DESCRIPTION", "Swing for <style=cIsDamage>400% damage</style>. Hold the primary and secondary skills to charge a slam for <style=cIsDamage>1000% damage</style>.");
			LanguageAPI.Add("FALSESON_SECONDARY_DESCRIPTION", "<style=cIsHealing>Growth</style>. <style=cIsUtility>Lunar Ruin</style>. <style=cIsUtility>Agile</style>. Throw a Lunar Spike for <style=cIsDamage>200% damage.</style> Starts with 4 charges.");
			spikeSkill.keywordTokens = new string[3] { "KEYWORD_BLOONSPIKEGROWTH", "KEYWORD_LUNARRUIN", "KEYWORD_AGILE" };
			LanguageAPI.Add("FALSESON_SECONDARY_ALT1_DESCRIPTION", "<style=cIsHealing>Growth</style>. <style=cIsUtility>Lunar Ruin</style>. Fire a <style=cIsDamage>piercing</style>, <style=cIsDamage>lightning</style> infused stake for <style=cIsDamage>300% damage</style>. Each Lunar Stake counts as <style=cIsUtility>2</style> Lunar Spikes. Starts with 2 charges.");
			stakeSkill.keywordTokens = new string[3] { "KEYWORD_BLOONSTAKEGROWTH", "KEYWORD_LUNARRUIN", "KEYWORD_LUNARLIGHTNING" };
			LanguageAPI.Add("FALSESON_UTILITY_DESCRIPTION", "<style=cIsHealing>Growth</style>. Dash a short distance, generating an explosion of <style=cIsDamage>300% damage</style> for every enemy hit.");
			dashSkill.keywordTokens = new string[1] { "KEYWORD_BLOONDASHGROWTH" };
			LanguageAPI.Add("FALSESON_UTILITY_ALT1_DESCRIPTION", "<style=cIsHealing>Growth</style>. <style=cIsDamage>Stunning</style>. <style=cIsUtility>Teleport</style> and explode for <style=cIsDamage>150% damage</style>, <style=cIsUtility>pulling</style> enemies towards you. Grants <style=cIsDamage>Energized Core</style> for <style=cIsUtility>5s</style>, plus an additional <style=cIsUtility>1s</style> for each enemy hit.");
			meridianSkill.keywordTokens = new string[3] { "KEYWORD_BLOONMERIDIANGROWTH", "KEYWORD_STUNNING", "KEYWORD_ENERGIZEDCORE" };
			LanguageAPI.Add("FALSESON_SPECIAL_DESCRIPTION", "<style=cIsHealing>Growth</style>. <style=cIsUtility>Charge</style> a rapidly hitting laser that deals <style=cIsDamage>200% damage every 0.25s</style> for <style=cIsUtility>2-6s</style> based on the charge level. Each hit refills <style=cIsUtility>5%</style> of your Lunar Spikes.");
			((SkillDef)laserSkill).keywordTokens = new string[1] { "KEYWORD_BLOONLASERGROWTH" };
			LanguageAPI.Add("FALSESON_SPECIAL_ALT1_DESCRIPTION", "<style=cIsHealing>Growth</style>. Fire an instant piercing laser for <style=cIsDamage>1200% damage</style>, refilling <style=cIsUtility>50%</style> of your Lunar Spikes.");
			((SkillDef)burstSkill).keywordTokens = new string[1] { "KEYWORD_BLOONBURSTGROWTH" };
		}

		public void OnProjectileEnter(orig_OnEnter orig, GenericProjectileBaseState self)
		{
			orig.Invoke(self);
		}

		public void OnBulletEnter(orig_OnEnter orig, GenericBulletBaseState self)
		{
			orig.Invoke(self);
		}

		public void OnMeleeEnter(orig_OnEnter orig, BasicMeleeAttack self)
		{
			if (self is ClubSwing || self is OverheadClubSwing)
			{
				self.damageCoefficient = 4f;
			}
			orig.Invoke(self);
		}

		public int OnUpdateSecondary(orig_GetGrowthSecondaryStock orig, FalseSonController self)
		{
			return 0;
		}

		public int OnUpdateSpecial(orig_GetGrowthSpecialStock orig, FalseSonController self)
		{
			return 0;
		}

		public float OnUpdateLaser(orig_GetGrowthLaserBonusDuration orig, FalseSonController self)
		{
			return 0f;
		}

		public bool OnUpdateGrowth(orig_UpdateGrowth orig, FalseSonController self)
		{
			//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
			float num = self.maxHealth - self.characterBody.baseMaxHealth;
			int num2 = 0;
			float num3 = 50f;
			int num4 = 0;
			while (num > 0f)
			{
				num -= num3;
				num3 *= 1.125f;
				if (num >= 0f)
				{
					num2++;
				}
				num4++;
			}
			if (num2 != self.growthLevel || self.growthLevel != self.characterBody.GetBuffCount(Main.GrowthBuff))
			{
				Log.Message(num2);
				if (NetworkServer.active)
				{
					self.SetGrowthLevel(num2);
					self.characterBody.SetBuffCount(Main.GrowthBuff.buffIndex, num2);
				}
				else
				{
					self.CallCmdSetGrowthLevel(num2);
					self.growthLevel = num2;
				}
				self.UpdateStats();
				return true;
			}
			return false;
		}

		private void OnRecalcStats(CharacterBody sender, StatHookEventArgs args)
		{
			if (!((Object)(object)sender != (Object)null))
			{
				return;
			}
			int buffCount = sender.GetBuffCount(Main.GrowthBuff);
			if (buffCount > 0 && Object.op_Implicit((Object)(object)sender.skillLocator))
			{
				GenericSkill utility = sender.skillLocator.utility;
				if (Object.op_Implicit((Object)(object)utility) && Object.op_Implicit((Object)(object)utility.skillDef) && utility.skillDef.skillIndex == dashSkill.skillIndex)
				{
					args.utilitySkill.bonusStockAdd += (int)Math.Floor((float)buffCount / 3f);
				}
				GenericSkill special = sender.skillLocator.special;
				if (Object.op_Implicit((Object)(object)special) && Object.op_Implicit((Object)(object)special.skillDef) && special.skillDef.skillIndex == ((SkillDef)burstSkill).skillIndex)
				{
					args.specialSkill.bonusStockAdd += (int)Math.Floor((float)buffCount / 4f);
				}
			}
			if (sender.HasBuff(Main.LaserArmorBuff))
			{
				args.armorAdd += 50f;
			}
		}

		public float OnComputeTamperedHeart(orig_ComputeTamperedHeartBonus orig, CharacterBody self, TamperingHeartBonusType bonusType)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0003: Invalid comparison between Unknown and I4
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			if ((int)bonusType == 2)
			{
				return 0f;
			}
			return orig.Invoke(self, bonusType);
		}

		private void OnTakeDamage(orig_TakeDamageProcess orig, HealthComponent self, DamageInfo info)
		{
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Invalid comparison between Unknown and I4
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			if (Object.op_Implicit((Object)(object)info.attacker))
			{
				CharacterBody component = info.attacker.GetComponent<CharacterBody>();
				if (Object.op_Implicit((Object)(object)component) && component.HasBuff(Buffs.TamperingASAndArmorBonus) && (int)info.damageType.damageSource == 1)
				{
					float num = (component.HasBuff(Buffs.EnergizedCore) ? FalseSonController.meridianWillMultiplier : 1f);
					float num2 = 1f + 0.075f * (float)component.GetBuffCount(Buffs.TamperingASAndArmorBonus) * num;
					info.damage *= num2;
				}
				if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component.skillLocator) && DamageAPI.HasModdedDamageType(info, DamageTypes.fsLaserRechargeProc))
				{
					Log.Message("Wahoo1");
					GenericSkill secondary = component.skillLocator.secondary;
					if ((Object)(object)secondary != (Object)null && ((Object)(object)secondary.skillDef == (Object)(object)spikeSkill || (Object)(object)secondary.skillDef == (Object)(object)stakeSkill))
					{
						Log.Message("Wahoo2");
						if (secondary.stock < secondary.maxStock)
						{
							float num3 = (float)secondary.maxStock * 0.05f * secondary.finalRechargeInterval;
							Log.Message(num3);
							int num4 = 0;
							while (num3 > 0f)
							{
								if (num3 >= secondary.finalRechargeInterval)
								{
									num3 -= secondary.finalRechargeInterval;
									secondary.stock += 1;
								}
								else
								{
									float num5 = secondary.finalRechargeInterval - secondary.rechargeStopwatch;
									if (!(num5 <= num3))
									{
										secondary.rechargeStopwatch += num3;
										break;
									}
									secondary.rechargeStopwatch = 0f;
									secondary.stock += 1;
									num3 -= num5;
								}
								if (secondary.stock >= secondary.maxStock)
								{
									secondary.rechargeStopwatch = 0f;
									break;
								}
								num4++;
							}
						}
					}
				}
			}
			orig.Invoke(self, info);
		}

		public void IL_TakeDamage(ILContext il)
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Expected O, but got Unknown
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_0094: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
			ILCursor val = new ILCursor(il);
			MoveType val2 = (MoveType)2;
			int loc1 = -1;
			if (val.TryGotoNext(val2, new Func<Instruction, bool>[2]
			{
				(Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, typeof(Buffs), "lunarruin"),
				(Instruction x) => ILPatternMatchingExt.MatchCallvirt(x, typeof(CharacterBody), "GetBuffCount")
			}))
			{
				if (val.TryGotoNext(val2, new Func<Instruction, bool>[1]
				{
					(Instruction x) => ILPatternMatchingExt.MatchStloc(x, ref loc1)
				}))
				{
					val.Emit(OpCodes.Ldarg_0);
					val.EmitDelegate<Func<HealthComponent, float>>((Func<HealthComponent, float>)delegate(HealthComponent self)
					{
						float num = 0f;
						float num2 = 0.1f * (float)self.body.GetBuffCount(Buffs.lunarruin);
						float num3 = 0.75f;
						int num4 = 1;
						while (0f < num2)
						{
							float num5 = Mathf.Max(0f, num3 - num2);
							num2 -= num3;
							num += (num3 - num5) / (float)num4;
							num4 *= 2;
						}
						return num;
					});
					val.Emit(OpCodes.Stloc, loc1);
				}
				else
				{
					Log.Error(((MemberReference)il.Method).Name + " Hook 2.2 failed!");
				}
			}
			else
			{
				Log.Error(((MemberReference)il.Method).Name + " Hook 2.1 failed!");
			}
		}

		public void OnInitLunarSpike(orig_InitializeLunarSpike orig, LunarSpikes self)
		{
			self.baseDuration = 0.256f;
			orig.Invoke(self);
		}

		public void OnMeridianEnter(orig_OnEnter orig, MeridiansWillFire self)
		{
			//IL_00fe: 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_0113: Unknown result type (might be due to invalid IL or missing references)
			//IL_0118: Unknown result type (might be due to invalid IL or missing references)
			//IL_011d: Unknown result type (might be due to invalid IL or missing references)
			//IL_012e: Unknown result type (might be due to invalid IL or missing references)
			if (Object.op_Implicit((Object)(object)((EntityState)self).characterBody))
			{
				((BaseState)self).attackSpeedStat = ((EntityState)self).characterBody.attackSpeed;
				((BaseState)self).damageStat = ((EntityState)self).characterBody.damage;
				((BaseState)self).critStat = ((EntityState)self).characterBody.crit;
				((BaseState)self).moveSpeedStat = ((EntityState)self).characterBody.moveSpeed;
			}
			((EntityState)self).PlayAnimation("FullBody, Override", self.beginExplosionPullState);
			self.falseSonController = ((Component)((EntityState)self).characterBody).GetComponent<FalseSonController>();
			Log.Message(self.blastRadius);
			Log.Message(self.forcePullRadius);
			Log.Message(self.damage);
			float num = ((EntityState)self).characterBody.GetBuffCount(Main.GrowthBuff);
			self.damage = 1.5f + 0.3f * num;
			self.blastRadius = 15f + 1.5f * num;
			self.forcePullDistSqr = self.blastRadius * self.blastRadius;
			self.pullPosition = ((EntityState)self).characterBody.footPosition + ((EntityState)self).inputBank.aimDirection * 5f;
			self.pullPosition.y = ((EntityState)self).characterBody.footPosition.y;
			if (NetworkServer.active)
			{
				self.GetHurtBoxs();
				float num2 = 5f;
				for (int i = 0; i < self.hurtBoxes.Length; i++)
				{
					self.ApplyDamage(self.hurtBoxes[i]);
					self.InitializePullInfo(i);
					num2 += 1f;
				}
				((EntityState)self).characterBody.AddTimedBuff(Buffs.EnergizedCore, num2);
			}
		}

		public void OnLaserEnter(orig_OnEnter orig, LaserFatherCharged self)
		{
			LaserFatherCharged.maximumDuration = 0f;
			LaserFatherCharged.baseFireFrequency = 4f;
			LaserFatherCharged.procCoefficientPerTick = 0.8f;
			LaserFatherCharged.damageCoefficient = 2f;
			if (self.charge <= 0.175f)
			{
				self.charge = 0f;
			}
			orig.Invoke(self);
			if (NetworkServer.active)
			{
				((EntityState)self).characterBody.AddTimedBuff(Main.LaserArmorBuff, self.duration);
			}
			self.charge = 1f;
			self.spikeRefillAmountPerSecond = 0f;
		}

		public void IL_LaserEnter(ILContext il)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Expected O, but got Unknown
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: Unknown result type (might be due to invalid IL or missing references)
			ILCursor val = new ILCursor(il);
			MoveType val2 = (MoveType)0;
			MoveType val3 = (MoveType)2;
			if (val.TryGotoNext(val3, new Func<Instruction, bool>[3]
			{
				(Instruction x) => ILPatternMatchingExt.MatchCallvirt(x, typeof(FalseSonController), "GetGrowthLaserBonusDuration"),
				(Instruction x) => ILPatternMatchingExt.MatchAdd(x),
				(Instruction x) => ILPatternMatchingExt.MatchStfld(x, typeof(LaserFatherCharged), "duration")
			}))
			{
				val.Emit(OpCodes.Ldarg_0);
				val.EmitDelegate<Action<LaserFatherCharged>>((Action<LaserFatherCharged>)delegate(LaserFatherCharged self)
				{
					self.duration = 2f + 4f * self.charge;
				});
			}
			else
			{
				Log.Error(((MemberReference)il.Method).Name + " Hook 1.1 failed!");
			}
		}

		public void IL_LaserUpdate(ILContext il)
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Expected O, but got Unknown
			//IL_000f: 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)
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_011d: Unknown result type (might be due to invalid IL or missing references)
			ILCursor val = new ILCursor(il);
			MoveType val2 = (MoveType)0;
			MoveType val3 = (MoveType)2;
			int loc1 = -1;
			if (val.TryGotoNext(val3, new Func<Instruction, bool>[3]
			{
				(Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0),
				(Instruction x) => ILPatternMatchingExt.MatchLdfld(x, typeof(BaseState), "attackSpeedStat"),
				(Instruction x) => ILPatternMatchingExt.MatchStloc(x, ref loc1)
			}))
			{
				val.Emit(OpCodes.Ldarg_0);
				val.EmitDelegate<Func<LaserFatherCharged, float>>((Func<LaserFatherCharged, float>)delegate(LaserFatherCharged self)
				{
					int buffCount = ((EntityState)self).characterBody.GetBuffCount(Main.GrowthBuff);
					return 1f + (float)buffCount * 0.1f;
				});
				val.Emit(OpCodes.Stloc, loc1);
				if (val.TryGotoNext(val3, new Func<Instruction, bool>[1]
				{
					(Instruction x) => ILPatternMatchingExt.MatchStloc(x, loc1)
				}))
				{
					val.Emit(OpCodes.Ldarg_0);
					val.EmitDelegate<Func<LaserFatherCharged, float>>((Func<LaserFatherCharged, float>)delegate(LaserFatherCharged self)
					{
						int buffCount = ((EntityState)self).characterBody.GetBuffCount(Main.GrowthBuff);
						return 1f + (float)buffCount * 0.1f;
					});
					val.Emit(OpCodes.Stloc, loc1);
				}
				else
				{
					Log.Error(((MemberReference)il.Method).Name + " Hook 1.2 failed!");
				}
			}
			else
			{
				Log.Error(((MemberReference)il.Method).Name + " Hook 1.1 failed!");
			}
		}

		public void IL_LaserFire(ILContext il)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Expected O, but got Unknown
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			ILCursor val = new ILCursor(il);
			MoveType val2 = (MoveType)0;
			MoveType val3 = (MoveType)2;
			if (val.TryGotoNext(val3, new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchNewobj<BulletAttack>(x)
			}))
			{
				val.Emit(OpCodes.Dup);
				val.EmitDelegate<Action<BulletAttack>>((Action<BulletAttack>)delegate(BulletAttack bulletAttack)
				{
					//IL_0002: Unknown result type (might be due to invalid IL or missing references)
					DamageAPI.AddModdedDamageType(bulletAttack, DamageTypes.fsLaserRechargeProc);
				});
			}
			else
			{
				Log.Error(((MemberReference)il.Method).Name + " Hook 1 failed!");
			}
		}

		public void OnLaserExit(orig_OnExit orig, LaserFatherCharged self)
		{
			if (NetworkServer.active && ((EntityState)self).characterBody.HasBuff(Main.LaserArmorBuff))
			{
				((EntityState)self).characterBody.RemoveBuff(Main.LaserArmorBuff);
			}
			orig.Invoke(self);
		}
	}
}
namespace System.Runtime.CompilerServices
{
	[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
	internal sealed class IgnoresAccessChecksToAttribute : Attribute
	{
		public IgnoresAccessChecksToAttribute(string assemblyName)
		{
		}
	}
}