Decompiled source of HIFUCaptainTweaks v1.2.3

HIFUCaptainTweaks.dll

Decompiled 9 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 System.Text.RegularExpressions;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using EntityStates;
using EntityStates.Captain.Weapon;
using EntityStates.CaptainDefenseMatrixItem;
using EntityStates.CaptainSupplyDrop;
using HIFUCaptainTweaks.Misc;
using HarmonyLib;
using IL.EntityStates.CaptainSupplyDrop;
using Microsoft.CodeAnalysis;
using Mono.Cecil.Cil;
using MonoMod.Cil;
using MonoMod.RuntimeDetour;
using On.EntityStates;
using On.EntityStates.Captain.Weapon;
using On.EntityStates.CaptainDefenseMatrixItem;
using On.EntityStates.CaptainSupplyDrop;
using On.RoR2;
using R2API;
using R2API.Utils;
using RoR2;
using RoR2.Navigation;
using RoR2.Projectile;
using RoR2.Skills;
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: TargetFramework(".NETStandard,Version=v2.0", FrameworkDisplayName = ".NET Standard 2.0")]
[assembly: AssemblyCompany("HIFUCaptainTweaks")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("HIFUCaptainTweaks")]
[assembly: AssemblyTitle("HIFUCaptainTweaks")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[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 HIFUCaptainTweaks
{
	public class ConfigManager
	{
		internal static bool ConfigChanged;

		internal static bool VersionChanged;

		public static T HandleConfig<T>(ConfigEntryBase entry, ConfigFile config, string name)
		{
			//IL_0087: Unknown result type (might be due to invalid IL or missing references)
			//IL_008d: Expected O, but got Unknown
			//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00af: Expected O, but got Unknown
			//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: Expected O, but got Unknown
			MethodInfo methodInfo = (from x in typeof(ConfigFile).GetMethods()
				where x.Name == "Bind"
				select x).First();
			methodInfo = methodInfo.MakeGenericMethod(typeof(T));
			object[] parameters = new object[3]
			{
				(object)new ConfigDefinition(Regex.Replace(config.ConfigFilePath, "\\W", "") + " : " + entry.Definition.Section, name),
				entry.DefaultValue,
				(object)new ConfigDescription(entry.Description.Description, (AcceptableValueBase)null, Array.Empty<object>())
			};
			ConfigEntryBase val = (ConfigEntryBase)methodInfo.Invoke(config, parameters);
			if (Main._preVersioning)
			{
				entry.BoxedValue = entry.DefaultValue;
			}
			if (!ConfigEqual(val.DefaultValue, val.BoxedValue) && VersionChanged)
			{
				entry.BoxedValue = entry.DefaultValue;
				val.BoxedValue = val.DefaultValue;
			}
			return default(T);
		}

		private static bool ConfigEqual(object a, object b)
		{
			if (a.Equals(b))
			{
				return true;
			}
			if (float.TryParse(a.ToString(), out var result) && float.TryParse(b.ToString(), out var result2) && (double)Mathf.Abs(result - result2) < 0.0001)
			{
				return true;
			}
			return false;
		}
	}
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("HIFU.HIFUCaptainTweaks", "HIFUCaptainTweaks", "1.2.2")]
	public class Main : BaseUnityPlugin
	{
		public const string PluginGUID = "HIFU.HIFUCaptainTweaks";

		public const string PluginAuthor = "HIFU";

		public const string PluginName = "HIFUCaptainTweaks";

		public const string PluginVersion = "1.2.2";

		public static AssetBundle hifucaptaintweaks;

		public static ConfigFile HCAPTConfig;

		public static ConfigFile HCAPTBackupConfig;

		public static ManualLogSource HCAPTLogger;

		public static bool _preVersioning;

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

		public static ConfigEntry<string> latestVersion { get; set; }

		public void Awake()
		{
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Expected O, but got Unknown
			HCAPTLogger = ((BaseUnityPlugin)this).Logger;
			HCAPTConfig = ((BaseUnityPlugin)this).Config;
			hifucaptaintweaks = AssetBundle.LoadFromFile(Assembly.GetExecutingAssembly().Location.Replace("HIFUCaptainTweaks.dll", "hifucaptaintweaks"));
			HCAPTBackupConfig = new ConfigFile(Paths.ConfigPath + "\\HIFU.HIFUCaptainTweaks.Backup.cfg", true);
			HCAPTBackupConfig.Bind<string>(": DO NOT MODIFY THIS FILES CONTENTS :", ": DO NOT MODIFY THIS FILES CONTENTS :", ": DO NOT MODIFY THIS FILES CONTENTS :", ": DO NOT MODIFY THIS FILES CONTENTS :");
			enableAutoConfig = HCAPTConfig.Bind<bool>("Config", "Enable Auto Config Sync", true, "Disabling this would stop HIFUCaptainTweaks from syncing config whenever a new version is found.");
			_preVersioning = !((Dictionary<ConfigDefinition, string>)AccessTools.DeclaredPropertyGetter(typeof(ConfigFile), "OrphanedEntries").Invoke(HCAPTConfig, null)).Keys.Any((ConfigDefinition x) => x.Key == "Latest Version");
			latestVersion = HCAPTConfig.Bind<string>("Config", "Latest Version", "1.2.2", "DO NOT CHANGE THIS");
			if (enableAutoConfig.Value && (_preVersioning || latestVersion.Value != "1.2.2"))
			{
				latestVersion.Value = "1.2.2";
				ConfigManager.VersionChanged = true;
				HCAPTLogger.LogInfo((object)"Config Autosync Enabled.");
			}
			IEnumerable<Type> enumerable = from type in Assembly.GetExecutingAssembly().GetTypes()
				where !type.IsAbstract && type.IsSubclassOf(typeof(TweakBase))
				select type;
			HCAPTLogger.LogInfo((object)"==+----------------==TWEAKS==----------------+==");
			foreach (Type item in enumerable)
			{
				TweakBase tweakBase = (TweakBase)Activator.CreateInstance(item);
				if (ValidateTweak(tweakBase))
				{
					tweakBase.Init();
				}
			}
			IEnumerable<Type> enumerable2 = from type in Assembly.GetExecutingAssembly().GetTypes()
				where !type.IsAbstract && type.IsSubclassOf(typeof(MiscBase))
				select type;
			HCAPTLogger.LogInfo((object)"==+----------------==MISC==----------------+==");
			foreach (Type item2 in enumerable2)
			{
				MiscBase miscBase = (MiscBase)Activator.CreateInstance(item2);
				if (ValidateMisc(miscBase))
				{
					miscBase.Init();
				}
			}
			OrbitalsInHiddenRealms.HopooLore();
			TryRespawn.HopooBugs();
		}

		public bool ValidateTweak(TweakBase tb)
		{
			if (tb.isEnabled && ((BaseUnityPlugin)this).Config.Bind<bool>(tb.Name, "Enable?", true, "Vanilla is false").Value)
			{
				return true;
			}
			return false;
		}

		public bool ValidateMisc(MiscBase mb)
		{
			if (mb.isEnabled && ((BaseUnityPlugin)this).Config.Bind<bool>(mb.Name, "Enable?", true, "Vanilla is false").Value)
			{
				return true;
			}
			return false;
		}

		private void PeripheryMyBeloved()
		{
		}
	}
	public abstract class MiscBase
	{
		public abstract string Name { get; }

		public virtual bool isEnabled { get; } = true;


		public T ConfigOption<T>(T value, string name, string description)
		{
			ConfigEntry<T> val = Main.HCAPTConfig.Bind<T>(Name, name, value, description);
			ConfigManager.HandleConfig<T>((ConfigEntryBase)(object)val, Main.HCAPTBackupConfig, name);
			return val.Value;
		}

		public abstract void Hooks();

		public string d(float f)
		{
			return f * 100f + "%";
		}

		public virtual void Init()
		{
			Hooks();
			Main.HCAPTLogger.LogInfo((object)("Added " + Name));
		}
	}
	public abstract class MiscBase<T> : MiscBase where T : MiscBase<T>
	{
		public static T instance { get; set; }

		public MiscBase()
		{
			if (instance != null)
			{
				throw new InvalidOperationException("Singleton class " + typeof(T).Name + " was instantiated twice");
			}
			instance = this as T;
		}
	}
	public abstract class TweakBase
	{
		public abstract string Name { get; }

		public abstract string SkillToken { get; }

		public abstract string DescText { get; }

		public virtual bool isEnabled { get; } = true;


		public T ConfigOption<T>(T value, string name, string description)
		{
			ConfigEntry<T> val = Main.HCAPTConfig.Bind<T>(Name, name, value, description);
			ConfigManager.HandleConfig<T>((ConfigEntryBase)(object)val, Main.HCAPTBackupConfig, name);
			return val.Value;
		}

		public abstract void Hooks();

		public string d(float f)
		{
			return f * 100f + "%";
		}

		public virtual void Init()
		{
			Hooks();
			string text = "CAPTAIN_" + SkillToken.ToUpper() + "_DESCRIPTION";
			LanguageAPI.Add(text, DescText);
			Main.HCAPTLogger.LogInfo((object)("Added " + Name));
		}
	}
	public abstract class TweakBase<T> : TweakBase where T : TweakBase<T>
	{
		public static T instance { get; set; }

		public TweakBase()
		{
			if (instance != null)
			{
				throw new InvalidOperationException("Singleton class " + typeof(T).Name + " was instantiated twice");
			}
			instance = this as T;
		}
	}
}
namespace HIFUCaptainTweaks.Skills
{
	public class HackingBeacon : TweakBase
	{
		[Serializable]
		[CompilerGenerated]
		private sealed class <>c
		{
			public static readonly <>c <>9 = new <>c();

			public static hook_OnEnter <>9__12_0;

			public static hook_OnEnter <>9__12_1;

			internal void <Changes>b__12_0(orig_OnEnter orig, HackingMainState self)
			{
				HackingMainState.baseRadius = Radius;
				orig.Invoke(self);
			}

			internal void <Changes>b__12_1(orig_OnEnter orig, HackingInProgressState self)
			{
				HackingInProgressState.baseGoldForBaseDuration = DurationPerGold;
				HackingInProgressState.baseDuration = BaseDuration;
				orig.Invoke(self);
			}
		}

		public static float Radius;

		public static float BaseDuration;

		public static int DurationPerGold;

		public static bool Formula;

		public override string Name => ": Special :::: Hacking Beacon";

		public override string SkillToken => "supply_hacking";

		public override string DescText => "<style=cIsUtility>Hack</style> all nearby purchasables to a cost of <style=cIsUtility>$0</style> over time.";

		public override void Init()
		{
			Radius = ConfigOption(16f, "Radius", "Vanilla is 10");
			BaseDuration = ConfigOption(2f, "Duration Multiplier", "Vanilla is 3");
			DurationPerGold = ConfigOption(25, "Duration Per Gold", "Vanilla is 25");
			Formula = ConfigOption(value: true, "Hacking Speed Formula", "(Interactable Cost / Duration Per Gold) * Duration Multiplier");
			base.Init();
		}

		public override void Hooks()
		{
			Changes();
		}

		public static void Changes()
		{
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0081: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Expected O, but got Unknown
			//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ac: Expected O, but got Unknown
			LanguageAPI.Add("CAPTAIN_SUPPLY_HACKING_NAME", "Hacking Beacon");
			GameObject val = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Captain/CaptainSupplyDrop, Hacking.prefab").WaitForCompletion();
			Transform child = val.GetComponent<ModelLocator>().modelTransform.GetChild(4);
			((Component)child).GetComponent<ObjectScaleCurve>().baseScale = new Vector3(Radius / 1.5f, Radius / 1.5f, Radius / 1.5f);
			object obj = <>c.<>9__12_0;
			if (obj == null)
			{
				hook_OnEnter val2 = delegate(orig_OnEnter orig, HackingMainState self)
				{
					HackingMainState.baseRadius = Radius;
					orig.Invoke(self);
				};
				<>c.<>9__12_0 = val2;
				obj = (object)val2;
			}
			HackingMainState.OnEnter += (hook_OnEnter)obj;
			object obj2 = <>c.<>9__12_1;
			if (obj2 == null)
			{
				hook_OnEnter val3 = delegate(orig_OnEnter orig, HackingInProgressState self)
				{
					HackingInProgressState.baseGoldForBaseDuration = DurationPerGold;
					HackingInProgressState.baseDuration = BaseDuration;
					orig.Invoke(self);
				};
				<>c.<>9__12_1 = val3;
				obj2 = (object)val3;
			}
			HackingInProgressState.OnEnter += (hook_OnEnter)obj2;
		}
	}
	public class HealingBeacon : TweakBase
	{
		[Serializable]
		[CompilerGenerated]
		private sealed class <>c
		{
			public static readonly <>c <>9 = new <>c();

			public static hook_OnEnter <>9__14_0;

			internal void <Changes>b__14_0(orig_OnEnter orig, HealZoneMainState self)
			{
				HealingWard component = HealZoneMainState.healZonePrefab.GetComponent<HealingWard>();
				component.radius = Radius;
				component.healFraction = Interval * Healing;
				orig.Invoke(self);
			}
		}

		public static float Healing;

		public static float Radius;

		public static float Interval;

		public static float MoveSpeed;

		public static BuffDef MoveSpeedBuff;

		public override string Name => ": Special : Remedy Beacon";

		public override string SkillToken => "supply_heal";

		public override string DescText => "<style=cIsHealing>Heal</style> all nearby allies constantly" + ((MoveSpeed > 0f) ? " and <style=cIsUtility>increase movement speed</style>." : ".");

		public override void Init()
		{
			Healing = ConfigOption(0.07f, "Healing", "Decimal. Vanilla is 0.1");
			Interval = ConfigOption(0.2f, "Interval", "Vanilla is 0.2");
			Radius = ConfigOption(24f, "Radius", "Vanilla is 10");
			MoveSpeed = ConfigOption(0.2f, "Buff Move Speed", "Decimal. Vanilla is 0");
			base.Init();
		}

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

		private void RecalculateStatsAPI_GetStatCoefficients(CharacterBody sender, StatHookEventArgs args)
		{
			if (Object.op_Implicit((Object)(object)sender) && sender.HasBuff(MoveSpeedBuff))
			{
				args.moveSpeedMultAdd += MoveSpeed;
			}
		}

		public static void Changes()
		{
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0062: 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_009f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0102: Unknown result type (might be due to invalid IL or missing references)
			//IL_0107: Unknown result type (might be due to invalid IL or missing references)
			//IL_0138: 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_00dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e3: Expected O, but got Unknown
			LanguageAPI.Add("CAPTAIN_SUPPLY_HEAL_NAME", "Remedy Beacon");
			Texture2D val = Addressables.LoadAssetAsync<Texture2D>((object)"RoR2/Base/Common/texMovespeedBuffIcon.tif").WaitForCompletion();
			MoveSpeedBuff = ScriptableObject.CreateInstance<BuffDef>();
			((Object)MoveSpeedBuff).name = "Remedy Beacon Speed";
			MoveSpeedBuff.buffColor = Color32.op_Implicit(new Color32((byte)128, (byte)209, (byte)132, byte.MaxValue));
			MoveSpeedBuff.canStack = false;
			MoveSpeedBuff.iconSprite = Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), new Vector2(0f, 0f));
			MoveSpeedBuff.isDebuff = false;
			ContentAddition.AddBuffDef(MoveSpeedBuff);
			object obj = <>c.<>9__14_0;
			if (obj == null)
			{
				hook_OnEnter val2 = delegate(orig_OnEnter orig, HealZoneMainState self)
				{
					HealingWard component2 = HealZoneMainState.healZonePrefab.GetComponent<HealingWard>();
					component2.radius = Radius;
					component2.healFraction = Interval * Healing;
					orig.Invoke(self);
				};
				<>c.<>9__14_0 = val2;
				obj = (object)val2;
			}
			HealZoneMainState.OnEnter += (hook_OnEnter)obj;
			GameObject val3 = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Captain/CaptainSupplyDrop, Healing.prefab").WaitForCompletion();
			Transform child = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Captain/CaptainHealingWard.prefab").WaitForCompletion().transform.GetChild(0);
			val3.AddComponent<BuffWard>();
			BuffWard component = val3.GetComponent<BuffWard>();
			component.Networkradius = Radius;
			component.shape = (BuffWardShape)0;
			component.radius = Radius;
			component.interval = 0.5f;
			component.rangeIndicator = ((Component)child).transform;
			component.buffDef = MoveSpeedBuff;
			component.buffDuration = 1.5f;
			component.floorWard = true;
			component.expires = false;
			component.invertTeamFilter = false;
			component.expireDuration = 0f;
			component.animateRadius = false;
			component.removalTime = 0f;
			component.requireGrounded = false;
			component.teamFilter = val3.GetComponent<TeamFilter>();
		}
	}
	public class OGM72DIABLOStrike : TweakBase
	{
		[Serializable]
		[CompilerGenerated]
		private sealed class <>c
		{
			public static readonly <>c <>9 = new <>c();

			public static hook_OnEnter <>9__14_0;

			public static hook_ModifyProjectile <>9__14_1;

			internal void <Changes>b__14_0(orig_OnEnter orig, CallAirstrikeBase self)
			{
				//IL_0049: Unknown result type (might be due to invalid IL or missing references)
				//IL_0075: Unknown result type (might be due to invalid IL or missing references)
				//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
				//IL_0122: Unknown result type (might be due to invalid IL or missing references)
				//IL_0163: Unknown result type (might be due to invalid IL or missing references)
				if (self is CallAirstrikeAlt)
				{
					((AimThrowableBase)self).damageCoefficient = Damage;
					((AimThrowableBase)self).projectilePrefab.transform.localScale = new Vector3(Radius / 16f, Radius / 16f, Radius / 16f);
					((ProjectileExplosion)((AimThrowableBase)self).projectilePrefab.GetComponent<ProjectileImpactExplosion>()).blastRadius = Radius;
					((ProjectileExplosion)((AimThrowableBase)self).projectilePrefab.GetComponent<ProjectileImpactExplosion>()).falloffModel = (FalloffModel)0;
					((AimThrowableBase)self).projectilePrefab.GetComponent<ProjectileController>().ghostPrefab.transform.localScale = new Vector3(Radius / 16f, Radius / 16f, Radius / 16f);
					Empower component = ((EntityState)self).gameObject.GetComponent<Empower>();
					if ((Object)(object)component != (Object)null && component.IsEmpowered)
					{
						((ProjectileExplosion)((AimThrowableBase)self).projectilePrefab.GetComponent<ProjectileImpactExplosion>()).blastRadius = EmpoweredRadius;
						((AimThrowableBase)self).projectilePrefab.transform.localScale = new Vector3(EmpoweredRadius / 16f, EmpoweredRadius / 16f, EmpoweredRadius / 16f);
						((AimThrowableBase)self).projectilePrefab.GetComponent<ProjectileController>().ghostPrefab.transform.localScale = new Vector3(EmpoweredRadius / 16f, EmpoweredRadius / 16f, EmpoweredRadius / 16f);
					}
				}
				orig.Invoke(self);
			}

			internal void <Changes>b__14_1(orig_ModifyProjectile orig, AimThrowableBase self, ref FireProjectileInfo fireProjectileInfo)
			{
				orig.Invoke(self, ref fireProjectileInfo);
				if (self is CallAirstrikeAlt)
				{
					fireProjectileInfo.useFuseOverride = true;
					((FireProjectileInfo)(ref fireProjectileInfo)).fuseOverride = TimeToLand;
				}
			}
		}

		public static float Damage;

		public static float Radius;

		public static float Cooldown;

		public static float TimeToLand;

		public static float EmpoweredRadius;

		public static SkillDef Diablo;

		public override string Name => ": Utility :: OGM-72 DIABLO Strike";

		public override string SkillToken => "utility_alt1";

		public override string DescText => "<style=cIsDamage>Stunning</style>. Request a <style=cIsDamage>kinetic strike</style> from the <style=cIsDamage>UES Safe Travels</style>. After <style=cIsUtility>" + TimeToLand + " seconds</style>, it deals <style=cIsDamage>" + d(Damage) + " damage</style> to ALL characters.";

		public override void Init()
		{
			Damage = ConfigOption(140f, "Damage", "Decimal. Vanilla is 400");
			Radius = ConfigOption(16f, "Radius", "Vanilla is 16");
			Cooldown = ConfigOption(24f, "Cooldown", "Vanilla is 40");
			TimeToLand = ConfigOption(15f, "Explosion Timer", "Vanilla is 20");
			EmpoweredRadius = ConfigOption(32f, "Empowered Radius", "Vanilla is 16");
			base.Init();
		}

		public override void Hooks()
		{
			Changes();
		}

		public static void Changes()
		{
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Expected O, but got Unknown
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: Expected O, but got Unknown
			object obj = <>c.<>9__14_0;
			if (obj == null)
			{
				hook_OnEnter val = delegate(orig_OnEnter orig, CallAirstrikeBase self)
				{
					//IL_0049: Unknown result type (might be due to invalid IL or missing references)
					//IL_0075: Unknown result type (might be due to invalid IL or missing references)
					//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
					//IL_0122: Unknown result type (might be due to invalid IL or missing references)
					//IL_0163: Unknown result type (might be due to invalid IL or missing references)
					if (self is CallAirstrikeAlt)
					{
						((AimThrowableBase)self).damageCoefficient = Damage;
						((AimThrowableBase)self).projectilePrefab.transform.localScale = new Vector3(Radius / 16f, Radius / 16f, Radius / 16f);
						((ProjectileExplosion)((AimThrowableBase)self).projectilePrefab.GetComponent<ProjectileImpactExplosion>()).blastRadius = Radius;
						((ProjectileExplosion)((AimThrowableBase)self).projectilePrefab.GetComponent<ProjectileImpactExplosion>()).falloffModel = (FalloffModel)0;
						((AimThrowableBase)self).projectilePrefab.GetComponent<ProjectileController>().ghostPrefab.transform.localScale = new Vector3(Radius / 16f, Radius / 16f, Radius / 16f);
						Empower component = ((EntityState)self).gameObject.GetComponent<Empower>();
						if ((Object)(object)component != (Object)null && component.IsEmpowered)
						{
							((ProjectileExplosion)((AimThrowableBase)self).projectilePrefab.GetComponent<ProjectileImpactExplosion>()).blastRadius = EmpoweredRadius;
							((AimThrowableBase)self).projectilePrefab.transform.localScale = new Vector3(EmpoweredRadius / 16f, EmpoweredRadius / 16f, EmpoweredRadius / 16f);
							((AimThrowableBase)self).projectilePrefab.GetComponent<ProjectileController>().ghostPrefab.transform.localScale = new Vector3(EmpoweredRadius / 16f, EmpoweredRadius / 16f, EmpoweredRadius / 16f);
						}
					}
					orig.Invoke(self);
				};
				<>c.<>9__14_0 = val;
				obj = (object)val;
			}
			CallAirstrikeBase.OnEnter += (hook_OnEnter)obj;
			object obj2 = <>c.<>9__14_1;
			if (obj2 == null)
			{
				hook_ModifyProjectile val2 = delegate(orig_ModifyProjectile orig, AimThrowableBase self, ref FireProjectileInfo fireProjectileInfo)
				{
					orig.Invoke(self, ref fireProjectileInfo);
					if (self is CallAirstrikeAlt)
					{
						fireProjectileInfo.useFuseOverride = true;
						((FireProjectileInfo)(ref fireProjectileInfo)).fuseOverride = TimeToLand;
					}
				};
				<>c.<>9__14_1 = val2;
				obj2 = (object)val2;
			}
			AimThrowableBase.ModifyProjectile += (hook_ModifyProjectile)obj2;
			Addressables.LoadAssetAsync<SkillDef>((object)"RoR2/Base/Captain/PrepAirstrikeAlt.asset").WaitForCompletion().baseRechargeInterval = Cooldown;
		}
	}
	public class OrbitalProbe : TweakBase
	{
		[Serializable]
		[CompilerGenerated]
		private sealed class <>c
		{
			public static readonly <>c <>9 = new <>c();

			public static hook_OnEnter <>9__11_0;

			internal void <Changes>b__11_0(orig_OnEnter orig, AimThrowableBase self)
			{
				if (self is CallAirstrike1 || self is CallAirstrike2 || self is CallAirstrike3)
				{
					self.damageCoefficient = Damage;
					Empower component = ((EntityState)self).gameObject.GetComponent<Empower>();
					if ((Object)(object)component != (Object)null && component.IsEmpowered)
					{
						self.damageCoefficient = EmpoweredDamage;
					}
				}
				orig.Invoke(self);
			}
		}

		public static float Damage;

		public static float Cooldown;

		public static float EmpoweredDamage;

		public override string Name => ": Utility : Orbital Probe";

		public override string SkillToken => "utility";

		public override string DescText => "<style=cIsDamage>Stunning</style>. Request up to <style=cIsDamage>3</style> Orbital Probes from the <style=cIsDamage>UES Safe Travels</style>. Each probe deals <style=cIsDamage>" + d(Damage) + " damage</style>.";

		public override void Init()
		{
			Damage = ConfigOption(10f, "Damage", "Decimal. Vanilla is 10");
			Cooldown = ConfigOption(9f, "Cooldown", "Vanilla is 11");
			EmpoweredDamage = ConfigOption(14f, "Empowered Damage", "Decimal. Vanilla is 10");
			base.Init();
		}

		public override void Hooks()
		{
			Changes();
		}

		public static void Changes()
		{
			//IL_002b: 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_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Expected O, but got Unknown
			object obj = <>c.<>9__11_0;
			if (obj == null)
			{
				hook_OnEnter val = delegate(orig_OnEnter orig, AimThrowableBase self)
				{
					if (self is CallAirstrike1 || self is CallAirstrike2 || self is CallAirstrike3)
					{
						self.damageCoefficient = Damage;
						Empower component = ((EntityState)self).gameObject.GetComponent<Empower>();
						if ((Object)(object)component != (Object)null && component.IsEmpowered)
						{
							self.damageCoefficient = EmpoweredDamage;
						}
					}
					orig.Invoke(self);
				};
				<>c.<>9__11_0 = val;
				obj = (object)val;
			}
			AimThrowableBase.OnEnter += (hook_OnEnter)obj;
			SkillDef val2 = Addressables.LoadAssetAsync<SkillDef>((object)"RoR2/Base/Captain/PrepAirstrike.asset").WaitForCompletion();
			val2.baseRechargeInterval = Cooldown;
		}
	}
	public class PowerTazer : TweakBase
	{
		public static float Damage;

		public static float Cooldown;

		public static int Charges;

		public static int ChargesToRecharges;

		public static float AoE;

		public static float EmpowerDuration;

		public static float Size;

		public static SkillDef CaptainShotgun;

		public static SkillDef PrepAirstrike;

		public static SkillDef PrepAirstrikeAlt;

		public override string Name => ": Secondary : Thunder Tazer";

		public override string SkillToken => "secondary";

		public override string DescText => "<style=cIsUtility>Empowering</style>. <style=cIsDamage>Shocking</style>. Fire a fast tazer that deals <style=cIsDamage>" + d(Damage) + " damage</style> and <style=cIsUtility>empowers</style> your other abilities.";

		public override void Init()
		{
			//IL_00b4: 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_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_00e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
			Damage = ConfigOption(3.8f, "Damage", "Decimal. Vanilla is 1");
			Cooldown = ConfigOption(7f, "Cooldown", "Vanilla is 6");
			Charges = ConfigOption(1, "Charges", "Vanilla is 1");
			ChargesToRecharges = ConfigOption(1, "Charges to Recharge", "Vanilla is 1");
			AoE = ConfigOption(8f, "Area of Effect", "Vanilla is 2");
			EmpowerDuration = ConfigOption(1.5f, "Empower Duration", "Default is 1.5");
			Size = ConfigOption(2f, "Size Multiplier", "Vanilla is 1");
			CaptainShotgun = Addressables.LoadAssetAsync<SkillDef>((object)"RoR2/Base/Captain/CaptainShotgun.asset").WaitForCompletion();
			PrepAirstrike = Addressables.LoadAssetAsync<SkillDef>((object)"RoR2/Base/Captain/PrepAirstrike.asset").WaitForCompletion();
			PrepAirstrikeAlt = Addressables.LoadAssetAsync<SkillDef>((object)"RoR2/Base/Captain/PrepAirstrikeAlt.asset").WaitForCompletion();
			base.Init();
		}

		public override void Hooks()
		{
			Changes();
		}

		public static void Changes()
		{
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_006e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0073: 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_00b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0124: Unknown result type (might be due to invalid IL or missing references)
			//IL_012e: Expected O, but got Unknown
			//IL_0134: Unknown result type (might be due to invalid IL or missing references)
			//IL_0139: Unknown result type (might be due to invalid IL or missing references)
			//IL_016d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0172: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_021d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0222: Unknown result type (might be due to invalid IL or missing references)
			//IL_0244: Unknown result type (might be due to invalid IL or missing references)
			//IL_0253: Unknown result type (might be due to invalid IL or missing references)
			//IL_0279: Unknown result type (might be due to invalid IL or missing references)
			//IL_0288: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_02bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0317: Unknown result type (might be due to invalid IL or missing references)
			//IL_0326: Unknown result type (might be due to invalid IL or missing references)
			//IL_0348: Unknown result type (might be due to invalid IL or missing references)
			//IL_0357: Unknown result type (might be due to invalid IL or missing references)
			//IL_037a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0389: Unknown result type (might be due to invalid IL or missing references)
			//IL_03af: Unknown result type (might be due to invalid IL or missing references)
			//IL_03be: Unknown result type (might be due to invalid IL or missing references)
			//IL_03d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_03de: Expected O, but got Unknown
			LanguageAPI.Add("KEYWORD_EMPOWERING", "<style=cKeywordName>Empowering</style><style=cSub>Makes your abilities stronger in unique ways.\nVulcan Shotgun: <style=cIsDamage>+75% Attack Speed</style>.\nOrbital Probe: <style=cIsDamage>+400% Damage</style>.\nOGM-72 'DIABLO' Strike: <style=cIsDamage>+100% Radius</style>.</style>");
			string[] keywordTokens = new string[2] { "KEYWORD_EMPOWERING", "KEYWORD_SHOCKING" };
			SkillFamily val = Addressables.LoadAssetAsync<SkillFamily>((object)"RoR2/Base/Captain/CaptainSecondarySkillFamily.asset").WaitForCompletion();
			val.variants[0].skillDef.keywordTokens = keywordTokens;
			LanguageAPI.Add("CAPTAIN_SECONDARY_NAME", "Thunder Tazer");
			Texture2D val2 = Addressables.LoadAssetAsync<Texture2D>((object)"RoR2/Base/ShockNearby/texBuffTeslaIcon.tif").WaitForCompletion();
			BuffDef Empowered = ScriptableObject.CreateInstance<BuffDef>();
			((Object)Empowered).name = "Empowered";
			Empowered.buffColor = Color32.op_Implicit(new Color32((byte)41, (byte)99, (byte)181, byte.MaxValue));
			Empowered.canStack = false;
			Empowered.iconSprite = Sprite.Create(val2, new Rect(0f, 0f, (float)((Texture)val2).width, (float)((Texture)val2).height), new Vector2(0f, 0f));
			Empowered.isDebuff = false;
			ContentAddition.AddBuffDef(Empowered);
			FireTazer.OnEnter += (hook_OnEnter)delegate(orig_OnEnter orig, FireTazer self)
			{
				//IL_007e: Unknown result type (might be due to invalid IL or missing references)
				FireTazer.baseDuration = 1f;
				FireTazer.baseDurationUntilPriorityLowers = 0.3f;
				FireTazer.damageCoefficient = Damage;
				FireTazer.force = 500f;
				if ((Object)(object)((EntityState)self).gameObject.GetComponent<Empower>() == (Object)null)
				{
					((EntityState)self).gameObject.AddComponent<Empower>();
				}
				((EntityState)self).gameObject.GetComponent<Empower>().IsEmpowered = true;
				((EntityState)self).gameObject.GetComponent<Empower>().EmpowerDuration = EmpowerDuration;
				((EntityState)self).characterBody.AddTimedBuffAuthority(Empowered.buffIndex, EmpowerDuration);
				orig.Invoke(self);
			};
			SkillDef val3 = Addressables.LoadAssetAsync<SkillDef>((object)"RoR2/Base/Captain/CaptainTazer.asset").WaitForCompletion();
			val3.baseRechargeInterval = Cooldown;
			val3.baseMaxStock = Charges;
			val3.rechargeStock = ChargesToRecharges;
			GameObject val4 = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Captain/CaptainTazer.prefab").WaitForCompletion();
			val4.GetComponent<ProjectileSimple>().lifetime = 6f;
			val4.transform.localScale = new Vector3(Size, Size, Size);
			val4.GetComponent<ProjectileController>().ghostPrefab.transform.localScale = new Vector3(Size, Size, Size);
			ProjectileImpactExplosion component = val4.GetComponent<ProjectileImpactExplosion>();
			component.lifetimeAfterImpact = 5f;
			component.lifetime = 6f;
			((ProjectileExplosion)component).blastRadius = AoE;
			Texture2D val5 = Main.hifucaptaintweaks.LoadAsset<Texture2D>("texCaptainIcons.png");
			Texture2D val6 = Addressables.LoadAssetAsync<Texture2D>((object)"RoR2/Base/Captain/texCaptainSkillIcons.png").WaitForCompletion();
			Sprite RealVulcan = Sprite.Create(val6, new Rect(128f, 384f, 128f, 128f), new Vector2(0f, 0f));
			Sprite RealEmpoweredVulcan = Sprite.Create(val5, new Rect(128f, 384f, 128f, 128f), new Vector2(0f, 0f));
			Sprite RealProbe = Sprite.Create(val6, new Rect(256f, 384f, 128f, 128f), new Vector2(0f, 0f));
			Sprite RealEmpoweredProbe = Sprite.Create(val5, new Rect(256f, 384f, 128f, 128f), new Vector2(0f, 0f));
			Sprite val7 = Sprite.Create(val6, new Rect(384f, 384f, 128f, 128f), new Vector2(0f, 0f));
			Sprite val8 = Sprite.Create(val5, new Rect(384f, 384f, 128f, 128f), new Vector2(0f, 0f));
			Sprite RealDiablo = Sprite.Create(val6, new Rect(384f, 0f, 128f, 128f), new Vector2(0f, 0f));
			Sprite RealEmpoweredDiablo = Sprite.Create(val5, new Rect(384f, 0f, 128f, 128f), new Vector2(0f, 0f));
			CharacterBody.FixedUpdate += (hook_FixedUpdate)delegate(orig_FixedUpdate orig, CharacterBody self)
			{
				Empower component2 = ((Component)self).gameObject.GetComponent<Empower>();
				if ((Object)(object)component2 != (Object)null && component2.IsEmpowered)
				{
					component2.EmpowerDuration -= Time.fixedDeltaTime;
					if ((Object)(object)self.skillLocator.primary.skillDef == (Object)(object)CaptainShotgun)
					{
						self.skillLocator.primary.skillDef.icon = RealEmpoweredVulcan;
					}
					if ((Object)(object)self.skillLocator.utility.skillDef == (Object)(object)PrepAirstrike)
					{
						self.skillLocator.utility.skillDef.icon = RealEmpoweredProbe;
					}
					if ((Object)(object)self.skillLocator.utility.skillDef == (Object)(object)PrepAirstrikeAlt)
					{
						self.skillLocator.utility.skillDef.icon = RealEmpoweredDiablo;
					}
					if (component2.EmpowerDuration <= 0f)
					{
						if ((Object)(object)self.skillLocator.primary.skillDef == (Object)(object)CaptainShotgun)
						{
							self.skillLocator.primary.skillDef.icon = RealVulcan;
						}
						if ((Object)(object)self.skillLocator.utility.skillDef == (Object)(object)PrepAirstrike)
						{
							self.skillLocator.utility.skillDef.icon = RealProbe;
						}
						if ((Object)(object)self.skillLocator.utility.skillDef == (Object)(object)PrepAirstrikeAlt)
						{
							self.skillLocator.utility.skillDef.icon = RealDiablo;
						}
						component2.IsEmpowered = false;
					}
				}
				orig.Invoke(self);
			};
		}
	}
	public class Empower : MonoBehaviour
	{
		public bool IsEmpowered;

		public float EmpowerDuration;
	}
	public class ResupplyBeacon : TweakBase
	{
		public static float AttackSpeed;

		public static float CooldownReduction;

		public static float Radius;

		public static BuffDef AttackSpeedBuff;

		public override string Name => ": Special ::: Artillery Beacon";

		public override string SkillToken => "supply_equipment_restock";

		public override string DescText => "<style=cIsUtility>Recharge Equipment</style> on use" + ((AttackSpeed > 0f) ? ", <style=cIsDamage>increase attack speed</style> and <style=cIsUtility>reduce cooldowns</style>." : ".");

		public override void Init()
		{
			AttackSpeed = ConfigOption(0.25f, "Buff Attack Speed", "Decimal. Vanilla is 0");
			CooldownReduction = ConfigOption(0.1f, "Buff Cooldown Reduction", "Decimal. Vanilla is 0");
			Radius = ConfigOption(20f, "Radius", "Vanilla is 0");
			base.Init();
		}

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

		private void RecalculateStatsAPI_GetStatCoefficients(CharacterBody sender, StatHookEventArgs args)
		{
			if (Object.op_Implicit((Object)(object)sender) && sender.HasBuff(AttackSpeedBuff))
			{
				args.attackSpeedMultAdd += AttackSpeed;
				args.cooldownMultAdd -= CooldownReduction;
			}
		}

		public static void Changes()
		{
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_0065: Unknown result type (might be due to invalid IL or missing references)
			//IL_0093: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a2: 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_00d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0119: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a6: 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_01ee: Expected O, but got Unknown
			LanguageAPI.Add("CAPTAIN_SUPPLY_EQUIPMENT_RESTOCK_NAME", "Artillery Beacon");
			Texture2D val = Addressables.LoadAssetAsync<Texture2D>((object)"RoR2/Base/WarCryOnMultiKill/texWarcryBuffIcon.tif").WaitForCompletion();
			AttackSpeedBuff = ScriptableObject.CreateInstance<BuffDef>();
			((Object)AttackSpeedBuff).name = "Artillery Beacon Attack Speed";
			AttackSpeedBuff.buffColor = Color32.op_Implicit(new Color32((byte)205, (byte)133, (byte)49, byte.MaxValue));
			AttackSpeedBuff.canStack = false;
			AttackSpeedBuff.iconSprite = Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), new Vector2(0f, 0f));
			AttackSpeedBuff.isDebuff = false;
			ContentAddition.AddBuffDef(AttackSpeedBuff);
			GameObject val2 = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Captain/CaptainSupplyDrop, EquipmentRestock.prefab").WaitForCompletion();
			Transform child = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Captain/CaptainHealingWard.prefab").WaitForCompletion().transform.GetChild(0);
			val2.AddComponent<BuffWard>();
			BuffWard component = val2.GetComponent<BuffWard>();
			component.Networkradius = Radius;
			component.shape = (BuffWardShape)0;
			component.radius = Radius;
			component.rangeIndicator = ((Component)child).transform;
			component.buffDef = AttackSpeedBuff;
			component.buffDuration = 1.5f;
			component.interval = 0.5f;
			component.floorWard = true;
			component.expires = false;
			component.invertTeamFilter = false;
			component.expireDuration = 0f;
			component.animateRadius = false;
			component.requireGrounded = false;
			component.teamFilter = val2.GetComponent<TeamFilter>();
			GameObject val3 = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/WardOnLevel/WarbannerWard.prefab").WaitForCompletion();
			Transform WarbannerVisual1 = val3.transform.GetChild(0);
			Transform WarbannerVisual2 = val3.transform.GetChild(0).GetChild(0);
			BaseCaptainSupplyDropState.OnEnter += (hook_OnEnter)delegate(orig_OnEnter orig, BaseCaptainSupplyDropState self)
			{
				//IL_0045: Unknown result type (might be due to invalid IL or missing references)
				try
				{
					GameObject val4 = GameObject.Find("CaptainSupplyDrop, EquipmentRestock(Clone)");
					if ((Object)(object)val4 != (Object)null)
					{
						Object.Instantiate<Transform>(WarbannerVisual1, val4.transform);
						((Component)WarbannerVisual1).transform.localScale = new Vector3(Radius, Radius, Radius);
						Object.Instantiate<Transform>(WarbannerVisual2, val4.transform);
					}
				}
				catch
				{
					Main.HCAPTLogger.LogError((object)"GUHHHHHH IM MORBIN... 3... 2... 1..");
				}
				orig.Invoke(self);
			};
		}
	}
	public class ShockingBeacon : TweakBase
	{
		[Serializable]
		[CompilerGenerated]
		private sealed class <>c
		{
			public static readonly <>c <>9 = new <>c();

			public static Func<Instruction, bool> <>9__16_1;

			public static Func<float, ShockZoneMainState, float> <>9__16_0;

			public static Func<Instruction, bool> <>9__18_0;

			public static hook_OnEnter <>9__19_0;

			internal bool <ShockZoneMainState_Shock1>b__16_1(Instruction x)
			{
				return ILPatternMatchingExt.MatchLdcR4(x, 0f);
			}

			internal float <ShockZoneMainState_Shock1>b__16_0(float Damage, ShockZoneMainState self)
			{
				CharacterMaster ownerMaster = ((EntityState)self).gameObject.GetComponent<Deployable>().ownerMaster;
				float num = ownerMaster.GetBody().damage * BigDamage;
				return Damage + num;
			}

			internal bool <ShockZoneMainState_Shock>b__18_0(Instruction x)
			{
				return ILPatternMatchingExt.MatchLdcI4(x, 16779264);
			}

			internal void <Changes>b__19_0(orig_OnEnter orig, ShockZoneMainState self)
			{
				ShockZoneMainState.shockFrequency = BigFireRate;
				ShockZoneMainState.shockRadius = BigRadius;
				orig.Invoke(self);
			}
		}

		public static float BigDamage;

		public static float BigFireRate;

		public static float BigRadius;

		public static float SmolDamage;

		public static float SmolFireRate;

		public static float SmolRadius;

		public static float SmolProcCoefficient;

		public static int StunType;

		public float timer = 69696970f;

		public override string Name => ": Special :: Thunder Beacon";

		public override string SkillToken => "supply_shocking";

		public override string DescText => "Periodically <style=cIsDamage>stun</style>" + ((BigDamage > 0f || SmolDamage > 0f) ? " and <style=cIsDamage>damage</style>" : "") + " all nearby enemies, immobilizing them.";

		public override void Init()
		{
			BigDamage = ConfigOption(5f, "Burst Damage", "Decimal. Vanilla is 0");
			BigFireRate = ConfigOption(0.25f, "Burst Fire Rate", "Vanilla is 0.33334");
			BigRadius = ConfigOption(24f, "Burst Radius", "Vanilla is 10");
			SmolDamage = ConfigOption(1f, "Constant Damage", "Decimal. Vanilla is 0");
			SmolFireRate = ConfigOption(1f, "Constant Fire Rate", "Vanilla is 0");
			SmolRadius = ConfigOption(24f, "Constant Radius", "Vanilla is 0");
			SmolProcCoefficient = ConfigOption(0f, "Constant Proc Coefficient", "Vanilla is 0");
			StunType = ConfigOption(2, "Stun Type", "0 = None, 1 = Shock for 5s, 2 = Stun for 1s, Vanilla is 1");
			base.Init();
		}

		public override void Hooks()
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Expected O, but got Unknown
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Expected O, but got Unknown
			Changes();
			ShockZoneMainState.Shock += new Manipulator(ShockZoneMainState_Shock);
			ShockZoneMainState.Shock += new Manipulator(ShockZoneMainState_Shock1);
		}

		private void ShockZoneMainState_Shock1(ILContext il)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Expected O, but got Unknown
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			ILCursor val = new ILCursor(il);
			if (val.TryGotoNext((MoveType)2, new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, 0f)
			}))
			{
				val.Emit(OpCodes.Ldarg_0);
				val.EmitDelegate<Func<float, ShockZoneMainState, float>>((Func<float, ShockZoneMainState, float>)delegate(float Damage, ShockZoneMainState self)
				{
					CharacterMaster ownerMaster = ((EntityState)self).gameObject.GetComponent<Deployable>().ownerMaster;
					float num = ownerMaster.GetBody().damage * BigDamage;
					return Damage + num;
				});
			}
			else
			{
				Main.HCAPTLogger.LogError((object)"Failed changing damage for Thunder Beacon.");
			}
		}

		private void ShockZoneMainState_Shock(ILContext il)
		{
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Expected O, but got Unknown
			timer += Time.fixedDeltaTime;
			float num = 69696970f;
			ILCursor val = new ILCursor(il);
			if (val.TryGotoNext(new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 16779264)
			}))
			{
				Instruction next = val.Next;
				int stunType = StunType;
				if (1 == 0)
				{
				}
				int num2 = stunType switch
				{
					0 => 2048, 
					2 => 2080, 
					_ => 16779264, 
				};
				if (1 == 0)
				{
				}
				next.Operand = num2;
			}
			else if (timer > num)
			{
				Main.HCAPTLogger.LogError((object)"Failed changing damage type for Thunder Beacon.");
				timer = 0f;
			}
		}

		public static void Changes()
		{
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Expected O, but got Unknown
			//IL_002b: 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_0036: Expected O, but got Unknown
			LanguageAPI.Add("CAPTAIN_SUPPLY_SHOCKING_NAME", "Thunder Beacon");
			object obj = <>c.<>9__19_0;
			if (obj == null)
			{
				hook_OnEnter val = delegate(orig_OnEnter orig, ShockZoneMainState self)
				{
					ShockZoneMainState.shockFrequency = BigFireRate;
					ShockZoneMainState.shockRadius = BigRadius;
					orig.Invoke(self);
				};
				<>c.<>9__19_0 = val;
				obj = (object)val;
			}
			ShockZoneMainState.OnEnter += (hook_OnEnter)obj;
			float timer = 0f;
			ShockZoneMainState.FixedUpdate += (hook_FixedUpdate)delegate(orig_FixedUpdate orig, ShockZoneMainState self)
			{
				//IL_00be: Unknown result type (might be due to invalid IL or missing references)
				//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
				//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
				//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
				//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
				//IL_0102: Unknown result type (might be due to invalid IL or missing references)
				//IL_0104: 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_0114: Unknown result type (might be due to invalid IL or missing references)
				//IL_011f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0121: Unknown result type (might be due to invalid IL or missing references)
				//IL_0126: Unknown result type (might be due to invalid IL or missing references)
				//IL_012d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0132: Unknown result type (might be due to invalid IL or missing references)
				//IL_0137: Unknown result type (might be due to invalid IL or missing references)
				//IL_0139: Unknown result type (might be due to invalid IL or missing references)
				//IL_013e: Unknown result type (might be due to invalid IL or missing references)
				//IL_014a: Unknown result type (might be due to invalid IL or missing references)
				//IL_014f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0154: Unknown result type (might be due to invalid IL or missing references)
				//IL_015f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0164: Unknown result type (might be due to invalid IL or missing references)
				//IL_016b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0176: Unknown result type (might be due to invalid IL or missing references)
				//IL_0181: Unknown result type (might be due to invalid IL or missing references)
				//IL_0190: Unknown result type (might be due to invalid IL or missing references)
				//IL_0195: Unknown result type (might be due to invalid IL or missing references)
				//IL_01a0: Expected O, but got Unknown
				timer += Time.fixedDeltaTime;
				if (timer > 1f / SmolFireRate && self != null && (Object)(object)((EntityState)self).gameObject != (Object)null && (Object)(object)((EntityState)self).gameObject.GetComponent<Deployable>() != (Object)null && (Object)(object)((EntityState)self).gameObject.GetComponent<Deployable>().ownerMaster != (Object)null && (Object)(object)((EntityState)self).gameObject.GetComponent<Deployable>().ownerMaster.GetBodyObject() != (Object)null && (Object)(object)((EntityState)self).gameObject.GetComponent<Deployable>().ownerMaster.GetBody() != (Object)null)
				{
					CharacterMaster ownerMaster = ((EntityState)self).gameObject.GetComponent<Deployable>().ownerMaster;
					new BlastAttack
					{
						attacker = ownerMaster.GetBodyObject(),
						baseDamage = ownerMaster.GetBody().damage * SmolDamage,
						baseForce = 0f,
						crit = ownerMaster.GetBody().RollCrit(),
						damageType = (DamageType)0,
						procCoefficient = SmolProcCoefficient,
						radius = SmolRadius,
						falloffModel = (FalloffModel)0,
						position = ((EntityState)self).transform.position,
						attackerFiltering = (AttackerFiltering)2,
						teamIndex = ownerMaster.GetBody().teamComponent.teamIndex
					}.Fire();
					EffectManager.SpawnEffect(ShockZoneMainState.shockEffectPrefab, new EffectData
					{
						origin = ((EntityState)self).transform.position,
						scale = SmolRadius,
						color = new Color32((byte)121, (byte)184, byte.MaxValue, (byte)50)
					}, true);
					timer = 0f;
				}
				orig.Invoke(self);
			};
		}
	}
	public class VulcanShotgun : TweakBase
	{
		[Serializable]
		[CompilerGenerated]
		private sealed class <>c
		{
			public static readonly <>c <>9 = new <>c();

			public static hook_OnEnter <>9__18_0;

			public static hook_FixedUpdate <>9__18_1;

			public static hook_OnEnter <>9__18_2;

			public static hook_ModifyBullet <>9__18_3;

			internal void <Changes>b__18_0(orig_OnEnter orig, ChargeCaptainShotgun self)
			{
				ChargeCaptainShotgun.baseChargeDuration = ChargeDuration;
				ChargeCaptainShotgun.baseMinChargeDuration = 0f;
				orig.Invoke(self);
			}

			internal void <Changes>b__18_1(orig_FixedUpdate orig, ChargeCaptainShotgun self)
			{
				if (Util.HasEffectiveAuthority(((EntityState)self).outer.networkIdentity) && ((EntityState)self).fixedAge / self.chargeDuration > 1f && !((Component)((EntityState)self).outer).gameObject.GetComponent<CharacterBody>().isSprinting)
				{
					self.released = true;
				}
				orig.Invoke(self);
			}

			internal void <Changes>b__18_2(orig_OnEnter orig, GenericBulletBaseState self)
			{
				if (self is FireCaptainShotgun)
				{
					self.bulletCount = PelletCount;
					self.damageCoefficient = Damage;
					self.procCoefficient = ProcCoefficient;
					self.baseDuration = 1f / FireRate;
					self.spreadPitchScale = 0.8f;
					self.spreadYawScale = 0.8f;
					self.force = 350f;
					Empower component = ((EntityState)self).gameObject.GetComponent<Empower>();
					if ((Object)(object)component != (Object)null && component.IsEmpowered)
					{
						self.baseDuration = 1f / EmpoweredFireRate;
					}
				}
				orig.Invoke(self);
			}

			internal void <Changes>b__18_3(orig_ModifyBullet orig, FireCaptainShotgun self, BulletAttack bulletAttack)
			{
				//IL_000c: Unknown result type (might be due to invalid IL or missing references)
				orig.Invoke(self, bulletAttack);
				bulletAttack.falloffModel = (FalloffModel)0;
			}
		}

		public static float Damage;

		public static float ProcCoefficient;

		public static float FireRate;

		public static int PelletCount;

		public static int Charges;

		public static int ChargesToRecharge;

		public static float Cooldown;

		public static float EmpoweredFireRate;

		public static float ChargeDuration;

		public static float EmpoweredCooldown;

		public override string Name => ": Primary : Vulcan Shotgun";

		public override string SkillToken => "primary";

		public override string DescText => "Fire a blast of pellets that deal <style=cIsDamage>" + PelletCount + "x" + d(Damage) + " damage</style>. Charging the attack narrows the <style=cIsUtility>spread</style>.";

		public override void Init()
		{
			Damage = ConfigOption(0.75f, "Damage", "Decimal. Vanilla is 1.2");
			ProcCoefficient = ConfigOption(0.55f, "Proc Coefficient", "Vanilla is 0.75");
			FireRate = ConfigOption(3f, "Fire Rate", "Vanilla is 1");
			PelletCount = ConfigOption(6, "Pellet Count", "Vanilla is 8");
			Charges = ConfigOption(3, "Charges", "Vanilla is 0");
			ChargesToRecharge = ConfigOption(3, "Charges to Recharge", "Vanilla is 0");
			Cooldown = ConfigOption(1f, "Cooldown", "Vanilla is 0");
			EmpoweredFireRate = ConfigOption(5.25f, "Empowered Fire Rate", "Vanilla is 1");
			ChargeDuration = ConfigOption(0.4f, "Charging Duration", "Vanilla is 1.2");
			base.Init();
		}

		public override void Hooks()
		{
			Changes();
		}

		public static void Changes()
		{
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Expected O, but got Unknown
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: Expected O, but got Unknown
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: Expected O, but got Unknown
			//IL_009a: Unknown result type (might be due to invalid IL or missing references)
			//IL_009f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_008f: Expected O, but got Unknown
			object obj = <>c.<>9__18_0;
			if (obj == null)
			{
				hook_OnEnter val = delegate(orig_OnEnter orig, ChargeCaptainShotgun self)
				{
					ChargeCaptainShotgun.baseChargeDuration = ChargeDuration;
					ChargeCaptainShotgun.baseMinChargeDuration = 0f;
					orig.Invoke(self);
				};
				<>c.<>9__18_0 = val;
				obj = (object)val;
			}
			ChargeCaptainShotgun.OnEnter += (hook_OnEnter)obj;
			object obj2 = <>c.<>9__18_1;
			if (obj2 == null)
			{
				hook_FixedUpdate val2 = delegate(orig_FixedUpdate orig, ChargeCaptainShotgun self)
				{
					if (Util.HasEffectiveAuthority(((EntityState)self).outer.networkIdentity) && ((EntityState)self).fixedAge / self.chargeDuration > 1f && !((Component)((EntityState)self).outer).gameObject.GetComponent<CharacterBody>().isSprinting)
					{
						self.released = true;
					}
					orig.Invoke(self);
				};
				<>c.<>9__18_1 = val2;
				obj2 = (object)val2;
			}
			ChargeCaptainShotgun.FixedUpdate += (hook_FixedUpdate)obj2;
			object obj3 = <>c.<>9__18_2;
			if (obj3 == null)
			{
				hook_OnEnter val3 = delegate(orig_OnEnter orig, GenericBulletBaseState self)
				{
					if (self is FireCaptainShotgun)
					{
						self.bulletCount = PelletCount;
						self.damageCoefficient = Damage;
						self.procCoefficient = ProcCoefficient;
						self.baseDuration = 1f / FireRate;
						self.spreadPitchScale = 0.8f;
						self.spreadYawScale = 0.8f;
						self.force = 350f;
						Empower component = ((EntityState)self).gameObject.GetComponent<Empower>();
						if ((Object)(object)component != (Object)null && component.IsEmpowered)
						{
							self.baseDuration = 1f / EmpoweredFireRate;
						}
					}
					orig.Invoke(self);
				};
				<>c.<>9__18_2 = val3;
				obj3 = (object)val3;
			}
			GenericBulletBaseState.OnEnter += (hook_OnEnter)obj3;
			object obj4 = <>c.<>9__18_3;
			if (obj4 == null)
			{
				hook_ModifyBullet val4 = delegate(orig_ModifyBullet orig, FireCaptainShotgun self, BulletAttack bulletAttack)
				{
					//IL_000c: Unknown result type (might be due to invalid IL or missing references)
					orig.Invoke(self, bulletAttack);
					bulletAttack.falloffModel = (FalloffModel)0;
				};
				<>c.<>9__18_3 = val4;
				obj4 = (object)val4;
			}
			FireCaptainShotgun.ModifyBullet += (hook_ModifyBullet)obj4;
			SkillDef val5 = Addressables.LoadAssetAsync<SkillDef>((object)"RoR2/Base/Captain/CaptainShotgun.asset").WaitForCompletion();
			val5.baseMaxStock = Charges;
			val5.rechargeStock = ChargesToRecharge;
			val5.baseRechargeInterval = Cooldown;
			val5.mustKeyPress = false;
			val5.resetCooldownTimerOnUse = true;
		}
	}
}
namespace HIFUCaptainTweaks.Misc
{
	public class AllBeacons : MiscBase
	{
		[Serializable]
		[CompilerGenerated]
		private sealed class <>c
		{
			public static readonly <>c <>9 = new <>c();

			public static hook_OnEnter <>9__5_0;

			internal void <Changes>b__5_0(orig_OnEnter orig, CallSupplyDropBase self)
			{
				CallSupplyDropBase.impactDamageCoefficient = Damage;
				orig.Invoke(self);
			}
		}

		public static float Damage;

		public override string Name => ": Special ::::: All Beacons";

		public override void Init()
		{
			Damage = ConfigOption(13f, "Damage", "Decimal. Vanilla is 20");
			base.Init();
		}

		public override void Hooks()
		{
			Changes();
		}

		public static void Changes()
		{
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Expected O, but got Unknown
			object obj = <>c.<>9__5_0;
			if (obj == null)
			{
				hook_OnEnter val = delegate(orig_OnEnter orig, CallSupplyDropBase self)
				{
					CallSupplyDropBase.impactDamageCoefficient = Damage;
					orig.Invoke(self);
				};
				<>c.<>9__5_0 = val;
				obj = (object)val;
			}
			CallSupplyDropBase.OnEnter += (hook_OnEnter)obj;
		}
	}
	public class BaseStats : MiscBase
	{
		public static float MovementSpeed;

		public override string Name => ": Misc :: Base Stats";

		public override void Init()
		{
			MovementSpeed = ConfigOption(7.5f, "Base Move Speed", "Vanilla is 7");
			base.Init();
		}

		public override void Hooks()
		{
			Changes();
		}

		private void Changes()
		{
			//IL_0006: 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)
			CharacterBody component = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Captain/CaptainBody.prefab").WaitForCompletion().GetComponent<CharacterBody>();
			component.baseMoveSpeed = MovementSpeed;
		}
	}
	public class DefensiveMicrobots : MiscBase
	{
		[Serializable]
		[CompilerGenerated]
		private sealed class <>c
		{
			public static readonly <>c <>9 = new <>c();

			public static hook_OnEnter <>9__13_0;

			public static hook_DeleteNearbyProjectile <>9__13_1;

			internal void <Changes>b__13_0(orig_OnEnter orig, DefenseMatrixOn self)
			{
				DefenseMatrixOn.baseRechargeFrequency = BaseRechargeFrequency;
				DefenseMatrixOn.minimumFireFrequency = MinimumFireFrequency;
				DefenseMatrixOn.projectileEraserRadius = Radius;
				orig.Invoke(self);
			}

			internal bool <Changes>b__13_1(orig_DeleteNearbyProjectile orig, DefenseMatrixOn self)
			{
				//IL_0046: Unknown result type (might be due to invalid IL or missing references)
				bool flag = orig.Invoke(self);
				if ((Object)(object)((BaseBodyAttachmentState)self).attachedBody != (Object)null && (Object)(object)((Component)((BaseBodyAttachmentState)self).attachedBody).GetComponent<CharacterBody>() != (Object)null && flag)
				{
					((Component)((BaseBodyAttachmentState)self).attachedBody).GetComponent<CharacterBody>().AddTimedBuffAuthority(MoveSpeedBuff.buffIndex, SpeedBuffDuration);
				}
				return flag;
			}
		}

		public static float Radius;

		public static float MinimumFireFrequency;

		public static float BaseRechargeFrequency;

		public static bool Formula;

		public static float SpeedBuff;

		public static bool StackSpeedBuff;

		public static float SpeedBuffDuration;

		public static BuffDef MoveSpeedBuff;

		public override string Name => ":: Misc : Defensive Microbots";

		public override void Init()
		{
			Radius = ConfigOption(20f, "Range", "Vanilla is 20");
			MinimumFireFrequency = ConfigOption(1.3f, "Maximum Blocks Per Second", "Vanilla is 10");
			BaseRechargeFrequency = ConfigOption(0.8f, "Blocks Per Second", "Vanilla is 2");
			Formula = ConfigOption(value: true, "Microbots Formula", "Lowest value between 1 / Maximum Blocks Per Second and (1 / (Blocks Per Second * Attack Speed Stat))");
			SpeedBuff = ConfigOption(0.12f, "Buff Speed", "Decimal. Vanilla is 0");
			StackSpeedBuff = ConfigOption(value: true, "Stack Speed Buff?", "Vanilla is false");
			SpeedBuffDuration = ConfigOption(3.5f, "Speed Buff Duration", "Vanilla is 0");
			base.Init();
		}

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

		private void RecalculateStatsAPI_GetStatCoefficients(CharacterBody sender, StatHookEventArgs args)
		{
			if (Object.op_Implicit((Object)(object)sender) && sender.GetBuffCount(MoveSpeedBuff) > 0)
			{
				args.moveSpeedMultAdd += SpeedBuff * (float)sender.GetBuffCount(MoveSpeedBuff);
			}
		}

		public static void Changes()
		{
			//IL_0006: 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_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0092: 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_00d6: Expected O, but got Unknown
			//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fb: Expected O, but got Unknown
			Texture2D val = Addressables.LoadAssetAsync<Texture2D>((object)"RoR2/DLC1/MoveSpeedOnKill/texBuffKillMoveSpeed.tif").WaitForCompletion();
			MoveSpeedBuff = ScriptableObject.CreateInstance<BuffDef>();
			((Object)MoveSpeedBuff).name = "Microbot Speed";
			MoveSpeedBuff.buffColor = Color32.op_Implicit(new Color32((byte)240, (byte)196, (byte)174, byte.MaxValue));
			MoveSpeedBuff.canStack = StackSpeedBuff;
			MoveSpeedBuff.iconSprite = Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), new Vector2(0f, 0f));
			MoveSpeedBuff.isDebuff = false;
			ContentAddition.AddBuffDef(MoveSpeedBuff);
			object obj = <>c.<>9__13_0;
			if (obj == null)
			{
				hook_OnEnter val2 = delegate(orig_OnEnter orig, DefenseMatrixOn self)
				{
					DefenseMatrixOn.baseRechargeFrequency = BaseRechargeFrequency;
					DefenseMatrixOn.minimumFireFrequency = MinimumFireFrequency;
					DefenseMatrixOn.projectileEraserRadius = Radius;
					orig.Invoke(self);
				};
				<>c.<>9__13_0 = val2;
				obj = (object)val2;
			}
			DefenseMatrixOn.OnEnter += (hook_OnEnter)obj;
			object obj2 = <>c.<>9__13_1;
			if (obj2 == null)
			{
				hook_DeleteNearbyProjectile val3 = delegate(orig_DeleteNearbyProjectile orig, DefenseMatrixOn self)
				{
					//IL_0046: Unknown result type (might be due to invalid IL or missing references)
					bool flag = orig.Invoke(self);
					if ((Object)(object)((BaseBodyAttachmentState)self).attachedBody != (Object)null && (Object)(object)((Component)((BaseBodyAttachmentState)self).attachedBody).GetComponent<CharacterBody>() != (Object)null && flag)
					{
						((Component)((BaseBodyAttachmentState)self).attachedBody).GetComponent<CharacterBody>().AddTimedBuffAuthority(MoveSpeedBuff.buffIndex, SpeedBuffDuration);
					}
					return flag;
				};
				<>c.<>9__13_1 = val3;
				obj2 = (object)val3;
			}
			DefenseMatrixOn.DeleteNearbyProjectile += (hook_DeleteNearbyProjectile)obj2;
			LanguageAPI.Add("ITEM_CAPTAINDEFENSEMATRIX_DESC", "Shoot down <style=cIsDamage>1</style> <style=cStack>(+1 per stack)</style> projectiles within <style=cIsDamage>" + Radius + "m</style> every <style=cIsDamage>" + ((1f / BaseRechargeFrequency == 1f) ? "second" : (Math.Round(1f / BaseRechargeFrequency, 2) + " seconds</style>")) + ((SpeedBuff > 0f) ? (", gaining a small" + (StackSpeedBuff ? " stackable" : "") + " <style=cIsUtility>speed buff</style>.") : ".") + " <style=cIsUtility>Recharge rate scales with attack speed</style>.");
			LanguageAPI.Add("CAPTAIN_PASSIVE_DESCRIPTION", "Passively gain <style=cIsUtility>Microbots</style> that <style=cIsUtility>shoot down nearby enemy projectiles</style>" + ((SpeedBuff > 0f) ? " and <style=cIsUtility>increase movement speed</style> for a short duration." : ".") + " <style=cIsUtility>Drones</style> are also given <style=cIsUtility>Microbots</style>.");
		}
	}
	public static class TryRespawn
	{
		[CompilerGenerated]
		private static class <>O
		{
			public static hook_HandlePlayerFirstEntryAnimation <0>__Run_HandlePlayerFirstEntryAnimation;
		}

		public static void HopooBugs()
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Expected O, but got Unknown
			object obj = <>O.<0>__Run_HandlePlayerFirstEntryAnimation;
			if (obj == null)
			{
				hook_HandlePlayerFirstEntryAnimation val = Run_HandlePlayerFirstEntryAnimation;
				<>O.<0>__Run_HandlePlayerFirstEntryAnimation = val;
				obj = (object)val;
			}
			Run.HandlePlayerFirstEntryAnimation += (hook_HandlePlayerFirstEntryAnimation)obj;
		}

		private static void Run_HandlePlayerFirstEntryAnimation(orig_HandlePlayerFirstEntryAnimation orig, Run self, CharacterBody body, Vector3 spawnPosition, Quaternion spawnRotation)
		{
			//IL_0004: 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)
			orig.Invoke(self, body, spawnPosition, spawnRotation);
			if (!NetworkServer.active || (Object)(object)GameObject.Find("CaptainBody(Clone)") == (Object)null)
			{
				return;
			}
			foreach (CharacterBody item in CharacterBody.instancesList.Where((CharacterBody x) => ((Object)x).name == "CaptainBody(Clone)"))
			{
				if ((Object)(object)((Component)item).GetComponent<RespawnTimerILoveHopooGames>() == (Object)null)
				{
					((Component)item).gameObject.AddComponent<RespawnTimerILoveHopooGames>();
				}
			}
		}

		public static void RespawnPlayer(CharacterMaster master)
		{
			//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)
			//IL_0029: 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_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)master != (Object)null)
			{
				Vector3 position = Stage.instance.GetPlayerSpawnTransform().position;
				NodeGraph groundNodes = SceneInfo.instance.groundNodes;
				NodeIndex val = groundNodes.FindClosestNode(position, master.GetBody().hullClassification, float.PositiveInfinity);
				groundNodes.GetNodePosition(val, ref position);
				master.Respawn(position, ((Component)master).transform.rotation);
			}
			else
			{
				Main.HCAPTLogger.LogError((object)"CaptainBody(Clone) Master null");
			}
		}
	}
	public class RespawnTimerILoveHopooGames : MonoBehaviour
	{
		public bool Active;

		public float Timer;

		public SkillDef Bullshit;

		public CharacterBody Body;

		private void Start()
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			Active = true;
			Bullshit = Addressables.LoadAssetAsync<SkillDef>((object)"RoR2/Base/Captain/PrepSupplyDrop.asset").WaitForCompletion();
			Body = ((Component)this).GetComponent<CharacterBody>();
		}

		private void FixedUpdate()
		{
			//IL_0074: Unknown result type (might be due to invalid IL or missing references)
			if (!Active)
			{
				return;
			}
			Timer += Time.fixedDeltaTime;
			if (Timer >= 3f)
			{
				Active = false;
				if ((Object)(object)((Component)Body).GetComponent<SkillLocator>().special.skillDef == (Object)(object)Bullshit && !((InstanceData)((Component)Body).GetComponent<SkillLocator>().special.skillInstanceData).anySupplyDropsAvailable)
				{
					TryRespawn.RespawnPlayer(Body.master);
				}
			}
		}
	}
	public static class OrbitalsInHiddenRealms
	{
		private static Hook fuckyou;

		public static void HopooLore()
		{
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Expected O, but got Unknown
			fuckyou = new Hook((MethodBase)Reflection.GetMethodCached(typeof(CaptainOrbitalSkillDef), "get_isAvailable"), Reflection.GetMethodCached(typeof(OrbitalsInHiddenRealms), "OrbitalSkillsHook"));
		}

		private static bool OrbitalSkillsHook(CaptainOrbitalSkillDef self)
		{
			return true;
		}
	}
	public class RefreshBeacons : MiscBase
	{
		public static float Damage;

		public List<GameObject> beacons = new List<GameObject>();

		public override string Name => ": Special ::::: Refresh Beacons";

		public override void Init()
		{
			base.Init();
		}

		public override void Hooks()
		{
			//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
			BaseCaptainSupplyDropState.OnEnter += new hook_OnEnter(BaseCaptainSupplyDropState_OnEnter);
			IdleToChargingState.OnEnter += new hook_OnEnter(IdleToChargingState_OnEnter);
		}

		private void BaseCaptainSupplyDropState_OnEnter(orig_OnEnter orig, BaseCaptainSupplyDropState self)
		{
			beacons.Add(((EntityState)self).gameObject);
			orig.Invoke(self);
		}

		private void IdleToChargingState_OnEnter(orig_OnEnter orig, BaseState self)
		{
			//IL_0006: 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_00bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e8: Expected O, but got Unknown
			GameObject val = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Common/VFX/ExplosionVFX.prefab").WaitForCompletion();
			orig.Invoke(self);
			foreach (PlayerCharacterMasterController instance in PlayerCharacterMasterController.instances)
			{
				CharacterBody body = instance.body;
				if (Object.op_Implicit((Object)(object)body))
				{
					CaptainSupplyDropController component = ((Component)body).GetComponent<CaptainSupplyDropController>();
					if (Object.op_Implicit((Object)(object)component))
					{
						component.supplyDrop1Skill.stock = 1;
						component.supplyDrop2Skill.stock = 1;
					}
				}
			}
			for (int i = 0; i < beacons.Count; i++)
			{
				GameObject val2 = beacons[i];
				if (Object.op_Implicit((Object)(object)val2))
				{
					Object.Destroy((Object)(object)val2);
					EffectManager.SpawnEffect(val, new EffectData
					{
						origin = val2.transform.position,
						scale = 10f
					}, false);
				}
				beacons.Remove(val2);
			}
		}
	}
	internal class the_c
	{
	}
}