Decompiled source of HIFUCommandoTweaks v1.2.0

HIFUCommandoTweaks.dll

Decompiled 3 months ago
using System;
using System.Collections;
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.Commando;
using EntityStates.Commando.CommandoWeapon;
using HarmonyLib;
using IL.EntityStates.Commando.CommandoWeapon;
using Microsoft.CodeAnalysis;
using Mono.Cecil.Cil;
using MonoMod.Cil;
using On.EntityStates;
using On.EntityStates.Commando;
using On.EntityStates.Commando.CommandoWeapon;
using R2API;
using RoR2;
using RoR2.Projectile;
using RoR2.Skills;
using UnityEngine;
using UnityEngine.AddressableAssets;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("HIFUCommandoTweaks")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("HIFUCommandoTweaks")]
[assembly: AssemblyTitle("HIFUCommandoTweaks")]
[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 HIFUCommandoTweaks
{
	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.*/)]
	[BepInPlugin("HIFU.HIFUCommandoTweaks", "HIFUCommandoTweaks", "1.2.0")]
	public class Main : BaseUnityPlugin
	{
		public const string PluginGUID = "HIFU.HIFUCommandoTweaks";

		public const string PluginAuthor = "HIFU";

		public const string PluginName = "HIFUCommandoTweaks";

		public const string PluginVersion = "1.2.0";

		public static ConfigFile HCTConfig;

		public static ConfigFile HCTBackupConfig;

		public static ManualLogSource HCTLogger;

		public static bool _preVersioning;

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

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

		public void Awake()
		{
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Expected O, but got Unknown
			HCTLogger = ((BaseUnityPlugin)this).Logger;
			HCTConfig = ((BaseUnityPlugin)this).Config;
			HCTBackupConfig = new ConfigFile(Paths.ConfigPath + "\\HIFU.HIFUCommandoTweaks.Backup.cfg", true);
			HCTBackupConfig.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 = HCTConfig.Bind<bool>("Config", "Enable Auto Config Sync", true, "Disabling this would stop HIFUCommandoTweaks from syncing config whenever a new version is found.");
			_preVersioning = !((Dictionary<ConfigDefinition, string>)AccessTools.DeclaredPropertyGetter(typeof(ConfigFile), "OrphanedEntries").Invoke(HCTConfig, null)).Keys.Any((ConfigDefinition x) => x.Key == "Latest Version");
			latestVersion = HCTConfig.Bind<string>("Config", "Latest Version", "1.2.0", "DO NOT CHANGE THIS");
			if (enableAutoConfig.Value && (_preVersioning || latestVersion.Value != "1.2.0"))
			{
				latestVersion.Value = "1.2.0";
				ConfigManager.VersionChanged = true;
				HCTLogger.LogInfo((object)"Config Autosync Enabled.");
			}
			IEnumerable<Type> enumerable = from type in Assembly.GetExecutingAssembly().GetTypes()
				where !type.IsAbstract && type.IsSubclassOf(typeof(TweakBase))
				select type;
			HCTLogger.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;
			HCTLogger.LogInfo((object)"==+----------------==MISC==----------------+==");
			foreach (Type item2 in enumerable2)
			{
				MiscBase miscBase = (MiscBase)Activator.CreateInstance(item2);
				if (ValidateMisc(miscBase))
				{
					miscBase.Init();
				}
			}
		}

		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.HCTConfig.Bind<T>(Name, name, value, description);
			ConfigManager.HandleConfig<T>((ConfigEntryBase)(object)val, Main.HCTBackupConfig, name);
			return val.Value;
		}

		public abstract void Hooks();

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

		public virtual void Init()
		{
			Hooks();
			Main.HCTLogger.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.HCTConfig.Bind<T>(Name, name, value, description);
			ConfigManager.HandleConfig<T>((ConfigEntryBase)(object)val, Main.HCTBackupConfig, name);
			return val.Value;
		}

		public abstract void Hooks();

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

		public virtual void Init()
		{
			Hooks();
			string text = "COMMANDO_" + SkillToken.ToUpper() + "_DESCRIPTION";
			LanguageAPI.Add(text, DescText);
			Main.HCTLogger.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 HIFUCommandoTweaks.Skills
{
	public class FragGrenade : TweakBase
	{
		public static float Damage;

		public static float AoE;

		public static bool RemoveFalloff;

		public static bool Ignite;

		public static bool NewFeedback;

		public override string Name => ": Special :: Frag Grenade";

		public override string SkillToken => "special_alt1";

		public override string DescText => (Ignite ? "<style=cIsDamage>Ignite</style>. " : "") + "Throw a grenade that explodes for <style=cIsDamage>" + d(Damage) + " damage</style>. Can hold up to 2.";

		public override void Init()
		{
			Damage = ConfigOption(6f, "Damage", "Decimal. Vanilla is 7");
			AoE = ConfigOption(11f, "Area of Effect", "Vanilla is 11");
			RemoveFalloff = ConfigOption(value: true, "Remove Damage Falloff?", "Vanilla is false");
			Ignite = ConfigOption(value: true, "Ignite?", "Vanilla is false");
			NewFeedback = ConfigOption(value: true, "Use new SFX and VFX?", "Vanilla is false");
			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();
			GenericProjectileBaseState.OnEnter += new hook_OnEnter(GenericProjectileBaseState_OnEnter);
		}

		private void GenericProjectileBaseState_OnEnter(orig_OnEnter orig, GenericProjectileBaseState self)
		{
			if (self is ThrowGrenade)
			{
				self.damageCoefficient = Damage;
			}
			orig.Invoke(self);
		}

		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_0026: 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_0056: 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_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_00c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0100: 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_012f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0145: 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_014e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0153: Unknown result type (might be due to invalid IL or missing references)
			//IL_0164: Unknown result type (might be due to invalid IL or missing references)
			//IL_0169: Unknown result type (might be due to invalid IL or missing references)
			//IL_0184: Unknown result type (might be due to invalid IL or missing references)
			//IL_0189: Unknown result type (might be due to invalid IL or missing references)
			//IL_019a: Unknown result type (might be due to invalid IL or missing references)
			//IL_019f: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c4: Expected O, but got Unknown
			//IL_01bf: 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_01dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ed: Expected O, but got Unknown
			//IL_0201: Unknown result type (might be due to invalid IL or missing references)
			//IL_0206: 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_02a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0302: Unknown result type (might be due to invalid IL or missing references)
			//IL_0307: Unknown result type (might be due to invalid IL or missing references)
			//IL_0359: Unknown result type (might be due to invalid IL or missing references)
			//IL_0369: Unknown result type (might be due to invalid IL or missing references)
			//IL_0385: Unknown result type (might be due to invalid IL or missing references)
			//IL_038a: Unknown result type (might be due to invalid IL or missing references)
			//IL_038e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0393: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_03bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_0402: Unknown result type (might be due to invalid IL or missing references)
			//IL_0407: Unknown result type (might be due to invalid IL or missing references)
			//IL_0427: Unknown result type (might be due to invalid IL or missing references)
			//IL_0431: Unknown result type (might be due to invalid IL or missing references)
			//IL_044c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0456: Unknown result type (might be due to invalid IL or missing references)
			//IL_0499: Unknown result type (might be due to invalid IL or missing references)
			//IL_049e: Unknown result type (might be due to invalid IL or missing references)
			//IL_04a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_04ae: Expected O, but got Unknown
			GameObject val = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Commando/CommandoGrenadeProjectile.prefab").WaitForCompletion();
			ProjectileImpactExplosion component = val.GetComponent<ProjectileImpactExplosion>();
			if (RemoveFalloff)
			{
				((ProjectileExplosion)component).falloffModel = (FalloffModel)0;
			}
			((ProjectileExplosion)component).blastRadius = AoE;
			if (Ignite)
			{
				ProjectileDamage component2 = val.GetComponent<ProjectileDamage>();
				component2.damageType = DamageTypeCombo.op_Implicit((DamageType)128);
				SkillDef val2 = Addressables.LoadAssetAsync<SkillDef>((object)"RoR2/Base/Commando/ThrowGrenade.asset").WaitForCompletion();
				val2.keywordTokens = new string[1] { "KEYWORD_IGNITE" };
			}
			if (NewFeedback)
			{
				GameObject val3 = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Commando/OmniExplosionVFXCommandoGrenade.prefab").WaitForCompletion();
				val3.AddComponent<GrenadeSFXSexerController>();
				Transform transform = val3.transform;
				Transform child = transform.GetChild(0);
				child.localScale = Vector3.one * (AoE / 4.4f);
				EmissionModule emission = ((Component)child).GetComponent<ParticleSystem>().emission;
				Burst burst = ((EmissionModule)(ref emission)).GetBurst(0);
				MinMaxCurve count = ((Burst)(ref burst)).count;
				((MinMaxCurve)(ref count)).constant = 6f;
				Transform val4 = transform.Find("Nova Sphere");
				val4.localScale = Vector3.one * (AoE / 4f);
				ParticleSystem component3 = ((Component)val4).GetComponent<ParticleSystem>();
				MainModule main = component3.main;
				MinMaxCurve startLifetime = ((MainModule)(ref main)).startLifetime;
				((MinMaxCurve)(ref startLifetime)).constant = 0.15f;
				SizeOverLifetimeModule sizeOverLifetime = component3.sizeOverLifetime;
				((SizeOverLifetimeModule)(ref sizeOverLifetime)).size = new MinMaxCurve(1f, new AnimationCurve((Keyframe[])(object)new Keyframe[3]
				{
					new Keyframe(0f, 1f),
					new Keyframe(0.66f, 1f),
					new Keyframe(1f, 0f)
				}));
				ParticleSystemRenderer component4 = ((Component)val4).GetComponent<ParticleSystemRenderer>();
				Material val5 = new Material(Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/Common/VFX/matCryoCanisterSphere.mat").WaitForCompletion());
				val5.SetColor("_TintColor", Color32.op_Implicit(new Color32(byte.MaxValue, (byte)88, (byte)0, byte.MaxValue)));
				val5.SetTexture("_RemapTex", (Texture)(object)Addressables.LoadAssetAsync<Texture2D>((object)"RoR2/DLC1/VoidSurvivor/texRampVoidSurvivorCorrupted3.png").WaitForCompletion());
				val5.SetFloat("_InvFade", 0.06039937f);
				val5.SetFloat("_SoftPower", 0.2511877f);
				val5.SetFloat("_Boost", 0.3f);
				val5.SetFloat("_RimPower", 2.720645f);
				val5.SetFloat("_RimStrength", 2.668566f);
				((Renderer)component4).material = val5;
				Transform val6 = transform.Find("Nova Sphere (1)");
				val6.localScale = Vector3.one * (AoE / 3f);
				((Renderer)((Component)val6).GetComponent<ParticleSystemRenderer>()).material = val5;
				((Component)val6).gameObject.SetActive(false);
				Light component5 = ((Component)transform.Find("Point Light")).GetComponent<Light>();
				component5.color = Color32.op_Implicit(new Color32(byte.MaxValue, (byte)153, (byte)0, byte.MaxValue));
				component5.range = AoE * 3f / 4f;
				((Component)component5).GetComponent<LightIntensityCurve>().timeMax = 0.5f;
				component5.intensity = 150f;
				Transform val7 = transform.Find("Dash, Bright");
				val7.localScale = Vector3.one * (AoE / 3.67f);
				MainModule main2 = ((Component)transform.Find("Unscaled Flames")).GetComponent<ParticleSystem>().main;
				MinMaxCurve startSize = ((MainModule)(ref main2)).startSize;
				((MinMaxCurve)(ref startSize)).constantMin = AoE;
				((MinMaxCurve)(ref startSize)).constantMax = AoE * 1.3f;
				GameObject val8 = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Commando/CommandoGrenadeGhost.prefab").WaitForCompletion();
				Transform transform2 = val8.transform;
				Light component6 = ((Component)transform2.Find("Point Light")).GetComponent<Light>();
				component6.range = AoE;
				component6.color = Color32.op_Implicit(new Color32((byte)53, (byte)82, (byte)146, byte.MaxValue));
				ObjectScaleCurve component7 = ((Component)transform2.Find("mdlCommandoGrenade")).GetComponent<ObjectScaleCurve>();
				component7.baseScale = Vector3.one * 3f;
				Transform val9 = transform2.Find("Pulse");
				val9.localScale = Vector3.one * 1.5f;
				TrailRenderer component8 = ((Component)transform2.Find("Helix").GetChild(1)).GetComponent<TrailRenderer>();
				component8.widthMultiplier = 0.2f;
				component8.time = 0.5f;
				Material val10 = new Material(Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/Huntress/matHuntressArrowTrail.mat").WaitForCompletion());
				val10.SetFloat("_Boost", 5.6f);
				((Renderer)component8).material = val10;
			}
		}
	}
	public class GrenadeSFXSexerController : MonoBehaviour
	{
		public void OnEnable()
		{
			Util.PlaySound("Play_bleedOnCritAndExplode_explode", ((Component)this).gameObject);
			Util.PlaySound("Play_bleedOnCritAndExplode_explode", ((Component)this).gameObject);
			Util.PlaySound("Play_clayboss_M1_explo", ((Component)this).gameObject);
			Util.PlaySound("Play_captain_m1_hit", ((Component)this).gameObject);
			((MonoBehaviour)this).StartCoroutine(FireAftershock());
		}

		public IEnumerator FireAftershock()
		{
			if (FragGrenade.Ignite)
			{
				yield return (object)new WaitForSeconds(0.2f);
				Util.PlaySound("Play_lemurianBruiser_m2_loop", ((Component)this).gameObject);
				yield return (object)new WaitForSeconds(0.3f);
				Util.PlaySound("Stop_lemurianBruiser_m2_loop", ((Component)this).gameObject);
			}
		}
	}
	public class PhaseRound : 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, GenericProjectileBaseState self)
			{
				if (self is FireFMJ)
				{
					self.damageCoefficient = Damage;
					self.baseDuration = 0.25f;
					self.force = 3000f;
				}
				orig.Invoke(self);
			}
		}

		public static float Damage;

		public static float RampingDamage;

		public static float Size;

		public override string Name => ": Secondary : Phase Round";

		public override string SkillToken => "secondary";

		public override string DescText => "Fire a <style=cIsDamage>piercing</style> bullet for <style=cIsDamage>" + d(Damage) + " damage</style>. Deals <style=cIsDamage>40%</style> more total damage for each enemy pierced.";

		public override void Init()
		{
			Damage = ConfigOption(4.5f, "Damage", "Decimal. Vanilla is 3");
			Size = ConfigOption(2f, "Size Multiplier", "Vanilla is 1");
			base.Init();
		}

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

		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_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_008d: 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_0098: Expected O, but got Unknown
			GameObject val = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Commando/FMJRamping.prefab").WaitForCompletion();
			GameObject val2 = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Commando/FMJRampingGhost.prefab").WaitForCompletion();
			val.transform.localScale = new Vector3(Size, Size, Size);
			val2.transform.localScale = new Vector3(Size, Size, Size);
			ProjectileSimple component = val.GetComponent<ProjectileSimple>();
			component.desiredForwardSpeed = 200f;
			object obj = <>c.<>9__11_0;
			if (obj == null)
			{
				hook_OnEnter val3 = delegate(orig_OnEnter orig, GenericProjectileBaseState self)
				{
					if (self is FireFMJ)
					{
						self.damageCoefficient = Damage;
						self.baseDuration = 0.25f;
						self.force = 3000f;
					}
					orig.Invoke(self);
				};
				<>c.<>9__11_0 = val3;
				obj = (object)val3;
			}
			GenericProjectileBaseState.OnEnter += (hook_OnEnter)obj;
			Addressables.LoadAssetAsync<SkillDef>((object)"RoR2/Base/Commando/CommandoBodyFireFMJ.asset").WaitForCompletion().mustKeyPress = true;
		}
	}
	public class SuppressiveFire : TweakBase
	{
		public static float Damage;

		public static float FireRate;

		public static float Cooldown;

		public static int ShotCount;

		public static bool Ignite;

		public override string Name => ": Special : Suppressive Fire";

		public override string SkillToken => "special";

		public override string DescText => "<style=cIsDamage>Stunning</style>. " + (Ignite ? "<style=cIsDamage>Ignite</style>." : "") + " Fire repeatedly for <style=cIsDamage>" + d(Damage) + " damage</style> per bullet. The number of shots increases with attack speed.";

		public override void Init()
		{
			Damage = ConfigOption(1.5f, "Damage", "Decimal. Vanilla is 1");
			FireRate = ConfigOption(0.1f, "Fire Rate", "Vanilla is 0.15");
			Cooldown = ConfigOption(7f, "Cooldown", "Vanilla is 9");
			ShotCount = ConfigOption(8, "Shot Count", "Vanilla is 6");
			Ignite = ConfigOption(value: true, "Ignite?", "Vanilla is false");
			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_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Expected O, but got Unknown
			Changes();
			FireBarrage.OnEnter += new hook_OnEnter(FireBarrage_OnEnter);
			if (Ignite)
			{
				FireBarrage.FireBullet += new Manipulator(FireBarrage_FireBullet);
			}
		}

		private void FireBarrage_FireBullet(ILContext il)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Expected O, but got Unknown
			ILCursor val = new ILCursor(il);
			if (val.TryGotoNext((MoveType)0, new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 32)
			}))
			{
				int index = val.Index;
				val.Index = index + 1;
				val.EmitDelegate<Func<int, int>>((Func<int, int>)((int useless) => 160));
			}
			else
			{
				Main.HCTLogger.LogError((object)"Failed to apply Suppressive Fire Ignite hook");
			}
		}

		private void FireBarrage_OnEnter(orig_OnEnter orig, FireBarrage self)
		{
			FireBarrage.baseBulletCount = ShotCount;
			FireBarrage.baseDurationBetweenShots = FireRate;
			FireBarrage.damageCoefficient = Damage;
			orig.Invoke(self);
		}

		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)
			SkillDef val = Addressables.LoadAssetAsync<SkillDef>((object)"RoR2/Base/Commando/CommandoBodyBarrage.asset").WaitForCompletion();
			val.baseRechargeInterval = Cooldown;
			if (Ignite)
			{
				val.keywordTokens = new string[2] { "KEYWORD_STUNNING", "KEYWORD_IGNITE" };
			}
		}
	}
	public class TacticalDive : TweakBase
	{
		[Serializable]
		[CompilerGenerated]
		private sealed class <>c
		{
			public static readonly <>c <>9 = new <>c();

			public static hook_OnEnter <>9__18_0;

			internal void <Changes>b__18_0(orig_OnEnter orig, DodgeState self)
			{
				//IL_002c: Unknown result type (might be due to invalid IL or missing references)
				self.initialSpeedCoefficient = InitialSpeedCoefficient;
				self.finalSpeedCoefficient = EndSpeedCoefficient;
				if (ArmorBuff)
				{
					((EntityState)self).characterBody.AddTimedBuffAuthority(Buffs.ArmorBoost.buffIndex, ArmorBuffDuration);
				}
				orig.Invoke(self);
			}
		}

		public static float Cooldown;

		public static float InitialSpeedCoefficient;

		public static float EndSpeedCoefficient;

		public static int Charges;

		public static int ChargesToRecharge;

		public static bool ArmorBuff;

		public static float ArmorBuffDuration;

		public override string Name => ": Utility : Tactical Dive";

		public override string SkillToken => "utility";

		public override string DescText => "<style=cIsUtility>Roll</style> a" + ((InitialSpeedCoefficient + EndSpeedCoefficient >= 12f) ? " long" : ((InitialSpeedCoefficient + EndSpeedCoefficient >= 8f) ? " medium" : " short")) + " distance." + ((Charges > 1) ? (" Can store up to <style=cIsUtility>" + Charges + "</style> charges.") : "");

		public override void Init()
		{
			Charges = ConfigOption(1, "Charges", "Vanilla is 1");
			ChargesToRecharge = ConfigOption(1, "Charges to Recharge", "Vanilla is 1");
			Cooldown = ConfigOption(4f, "Cooldown", "Vanilla is 4");
			InitialSpeedCoefficient = ConfigOption(5f, "Initial Speed Coefficient", "Vanilla is 5");
			EndSpeedCoefficient = ConfigOption(2.65f, "End Speed Coefficient", "Vanilla is 2.5");
			ArmorBuff = ConfigOption(value: true, "Enable Armor Buff?", "Vanilla is false");
			ArmorBuffDuration = ConfigOption(0.5f, "Armor Buff Dur", "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
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Expected O, but got Unknown
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Expected O, but got Unknown
			Changes();
			DodgeState.OnEnter += new hook_OnEnter(DodgeState_OnEnter);
			DodgeState.FixedUpdate += new hook_FixedUpdate(DodgeState_FixedUpdate);
			DodgeState.OnExit += new hook_OnExit(DodgeState_OnExit);
		}

		private void DodgeState_OnExit(orig_OnExit orig, DodgeState self)
		{
			((EntityState)self).characterBody.isSprinting = true;
			orig.Invoke(self);
		}

		private void DodgeState_FixedUpdate(orig_FixedUpdate orig, DodgeState self)
		{
			((EntityState)self).characterBody.isSprinting = true;
			orig.Invoke(self);
		}

		private void DodgeState_OnEnter(orig_OnEnter orig, DodgeState self)
		{
			((EntityState)self).characterBody.isSprinting = true;
			orig.Invoke(self);
		}

		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__18_0;
			if (obj == null)
			{
				hook_OnEnter val = delegate(orig_OnEnter orig, DodgeState self)
				{
					//IL_002c: Unknown result type (might be due to invalid IL or missing references)
					self.initialSpeedCoefficient = InitialSpeedCoefficient;
					self.finalSpeedCoefficient = EndSpeedCoefficient;
					if (ArmorBuff)
					{
						((EntityState)self).characterBody.AddTimedBuffAuthority(Buffs.ArmorBoost.buffIndex, ArmorBuffDuration);
					}
					orig.Invoke(self);
				};
				<>c.<>9__18_0 = val;
				obj = (object)val;
			}
			DodgeState.OnEnter += (hook_OnEnter)obj;
			SkillDef val2 = LegacyResourcesAPI.Load<SkillDef>("SkillDefs/CommandoBody/CommandoBodyRoll");
			val2.baseMaxStock = Charges;
			val2.rechargeStock = ChargesToRecharge;
			val2.baseRechargeInterval = Cooldown;
			val2.cancelSprintingOnActivation = false;
		}
	}
}
namespace HIFUCommandoTweaks.Misc
{
	public class BloomAndSpread : MiscBase
	{
		[CompilerGenerated]
		private static class <>O
		{
			public static hook_OnEnter <0>__FirePistol2_OnEnter;
		}

		public override string Name => ":: Misc : Bloom and Spread";

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

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

		public static void Changes()
		{
			//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>__FirePistol2_OnEnter;
			if (obj == null)
			{
				hook_OnEnter val = FirePistol2_OnEnter;
				<>O.<0>__FirePistol2_OnEnter = val;
				obj = (object)val;
			}
			FirePistol2.OnEnter += (hook_OnEnter)obj;
		}

		private static void FirePistol2_OnEnter(orig_OnEnter orig, FirePistol2 self)
		{
			FirePistol2.spreadBloomValue = 0.275f;
			FirePistol2.recoilAmplitude = 1.45f;
			orig.Invoke(self);
		}
	}
}