Decompiled source of HIFUCommandoTweaks v1.1.8

HIFUCommandoTweaks.dll

Decompiled 3 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.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.0", FrameworkDisplayName = ".NET Standard 2.0")]
[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.1.7")]
	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.1.7";

		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.1.7", "DO NOT CHANGE THIS");
			if (enableAutoConfig.Value && (_preVersioning || latestVersion.Value != "1.1.7"))
			{
				latestVersion.Value = "1.1.7";
				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 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");
			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_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)
			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 = (DamageType)128;
				SkillDef val2 = Addressables.LoadAssetAsync<SkillDef>((object)"RoR2/Base/Commando/ThrowGrenade.asset").WaitForCompletion();
				val2.keywordTokens = new string[1] { "KEYWORD_IGNITE" };
			}
		}
	}
	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 = 1f / 60f;
					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 = 1f / 60f;
						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 >= 7f || EndSpeedCoefficient >= 7f) ? " long" : ((InitialSpeedCoefficient >= 4f || EndSpeedCoefficient >= 4f) ? " 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);
		}
	}
}