Decompiled source of SkillsReturns v0.4.3

SkillsReturns.dll

Decompiled a month ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using EntityStates;
using EntityStates.Captain.Weapon;
using IL.RoR2;
using Microsoft.CodeAnalysis;
using Mono.Cecil.Cil;
using MonoMod.Cil;
using On.RoR2;
using R2API;
using RoR2;
using RoR2.Projectile;
using RoR2.Skills;
using ShaderSwapper;
using SkillsReturns.SharedHooks;
using SkillsReturns.SkillSetup;
using SkillsReturns.SkillSetup.Commando;
using SkillsReturns.SkillSetup.Engineer.Components;
using SkillsReturns.SkillStates.Bandit2.FlashBang;
using SkillsReturns.SkillStates.Commando;
using SkillsReturns.SkillStates.Engineer;
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.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("SkillsReturns")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+6d6905584296fdc2b5df7f36de8aa7c995444401")]
[assembly: AssemblyProduct("SkillsReturns")]
[assembly: AssemblyTitle("SkillsReturns")]
[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 SkillsReturns
{
	internal static class Assets
	{
		public static AssetBundle mainAssetBundle;

		internal static void Init()
		{
			using (Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("SkillsReturns.skillsreturnsbundle"))
			{
				mainAssetBundle = AssetBundle.LoadFromStream(stream);
				ShaderSwapper.UpgradeStubbedShaders(mainAssetBundle);
			}
			using Stream stream2 = Assembly.GetExecutingAssembly().GetManifestResourceStream("SkillsReturns.SkillsReturnsSoundbank.bnk");
			byte[] array = new byte[stream2.Length];
			stream2.Read(array, 0, array.Length);
			SoundBanks.Add(array);
		}
	}
	internal static class ModCompat
	{
		internal static class AncientScepterCompat
		{
			public static bool pluginLoaded;

			internal static void Init()
			{
				pluginLoaded = Chainloader.PluginInfos.ContainsKey("com.DestroyedClone.AncientScepter");
			}

			public static void AddScepterSkill(SkillDef scepterSkill, string targetBodyName, SkillDef originalSkill)
			{
				if (pluginLoaded)
				{
					AddScepterSkillInternal(scepterSkill, targetBodyName, originalSkill);
				}
			}

			[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
			private static void AddScepterSkillInternal(SkillDef scepterSkill, string targetBodyName, SkillDef originalSkill)
			{
			}
		}

		internal static void Init()
		{
			AncientScepterCompat.Init();
		}
	}
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("com.Forced_Reassembly.SkillsReturns", "Skills Returns", "1.4.3")]
	public class SkillsReturnsPlugin : BaseUnityPlugin
	{
		[CompilerGenerated]
		private static class <>O
		{
			public static Manipulator <0>__ModfyFinalDamageHook;
		}

		public static ConfigFile configFile;

		private void Awake()
		{
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Expected O, but got Unknown
			configFile = ((BaseUnityPlugin)this).Config;
			ModCompat.Init();
			Assets.Init();
			object obj = <>O.<0>__ModfyFinalDamageHook;
			if (obj == null)
			{
				Manipulator val = ModifyFinalDamage.ModfyFinalDamageHook;
				<>O.<0>__ModfyFinalDamageHook = val;
				obj = (object)val;
			}
			HealthComponent.TakeDamageProcess += (Manipulator)obj;
			AddToAssembly();
		}

		private void AddToAssembly()
		{
			IEnumerable<Type> enumerable = from type in Assembly.GetExecutingAssembly().GetTypes()
				where !type.IsAbstract && type.IsSubclassOf(typeof(SkillBase))
				select type;
			foreach (Type item in enumerable)
			{
				SkillBase skillBase = (SkillBase)Activator.CreateInstance(item);
			}
		}
	}
	internal class Utilities
	{
		public static BuffDef CreateBuffDef(string name, bool canStack, bool isCooldown, bool isDebuff, Color color, Sprite iconSprite)
		{
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			BuffDef val = ScriptableObject.CreateInstance<BuffDef>();
			((Object)val).name = name;
			val.canStack = canStack;
			val.isCooldown = isCooldown;
			val.isDebuff = isDebuff;
			val.buffColor = color;
			val.iconSprite = iconSprite;
			ContentAddition.AddBuffDef(val);
			((Object)val).name = ((Object)val).name;
			return val;
		}
	}
}
namespace SkillsReturns.SkillStates.Engineer
{
	public class EngiMortarFire : BaseSkillState, IStepSetter
	{
		public static float baseDuration = 0.2f;

		private float duration;

		public static GameObject engiMortarProjectilePrefab;

		public static GameObject muzzleflashEffectPrefab = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Common/VFX/MuzzleflashSmokeRing.prefab").WaitForCompletion();

		public float damageCoefficient = 1f;

		public float force = 100f;

		public static float upwardsAimFactor = 0.5f;

		private int step;

		public override void OnEnter()
		{
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_00f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fe: Unknown result type (might be due to invalid IL or missing references)
			((BaseState)this).OnEnter();
			duration = baseDuration / ((BaseState)this).attackSpeedStat;
			Ray aimRay = ((BaseState)this).GetAimRay();
			((BaseState)this).StartAimMode(aimRay, 2f, false);
			Util.PlaySound("Play_SkillsReturns_Engi_Shoot", ((EntityState)this).gameObject);
			if (step % 2 == 0)
			{
				EffectManager.SimpleMuzzleFlash(muzzleflashEffectPrefab, ((EntityState)this).gameObject, "MuzzleLeft", false);
				((EntityState)this).PlayCrossfade("Gesture Left Cannon, Additive", "FireGrenadeLeft", duration);
			}
			else
			{
				EffectManager.SimpleMuzzleFlash(muzzleflashEffectPrefab, ((EntityState)this).gameObject, "MuzzleRight", false);
				((EntityState)this).PlayCrossfade("Gesture Right Cannon, Additive", "FireGrenadeRight", duration);
			}
			if (((EntityState)this).isAuthority)
			{
				Vector3 direction = ((Ray)(ref aimRay)).direction;
				direction.y = 0f;
				((Vector3)(ref direction)).Normalize();
				direction.y = upwardsAimFactor;
				((Vector3)(ref direction)).Normalize();
				ProjectileManager.instance.FireProjectile(engiMortarProjectilePrefab, ((Ray)(ref aimRay)).origin, Util.QuaternionSafeLookRotation(direction), ((EntityState)this).gameObject, ((BaseState)this).damageStat * damageCoefficient, force, ((BaseState)this).RollCrit(), (DamageColorIndex)0, (GameObject)null, -1f);
			}
			((EntityState)this).characterBody.AddSpreadBloom(0.3f);
		}

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return (InterruptPriority)2;
		}

		public void SetStep(int i)
		{
			step = i;
		}
	}
}
namespace SkillsReturns.SkillStates.Commando
{
	public class SlashKnife : BaseSkillState
	{
		public static GameObject biteEffectPrefab = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Lemurian/LemurianBiteTrail.prefab").WaitForCompletion();

		public static float baseDuration = 0.5f;

		private float duration;

		public override void OnEnter()
		{
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_00de: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ef: 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_0106: Unknown result type (might be due to invalid IL or missing references)
			//IL_0118: Unknown result type (might be due to invalid IL or missing references)
			//IL_011f: 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_0129: Unknown result type (might be due to invalid IL or missing references)
			//IL_012b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0130: Unknown result type (might be due to invalid IL or missing references)
			//IL_0135: Unknown result type (might be due to invalid IL or missing references)
			//IL_0140: Unknown result type (might be due to invalid IL or missing references)
			//IL_0142: Unknown result type (might be due to invalid IL or missing references)
			//IL_0147: Unknown result type (might be due to invalid IL or missing references)
			//IL_0152: 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_0158: Unknown result type (might be due to invalid IL or missing references)
			//IL_015d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0160: Unknown result type (might be due to invalid IL or missing references)
			//IL_0165: Unknown result type (might be due to invalid IL or missing references)
			//IL_016a: Unknown result type (might be due to invalid IL or missing references)
			//IL_016c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0172: Expected O, but got Unknown
			//IL_0173: Unknown result type (might be due to invalid IL or missing references)
			//IL_017f: 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_01a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f9: Unknown result type (might be due to invalid IL or missing references)
			((BaseState)this).OnEnter();
			duration = baseDuration / ((BaseState)this).attackSpeedStat;
			Ray aimRay = ((BaseState)this).GetAimRay();
			((BaseState)this).StartAimMode(aimRay, 2f, false);
			((EntityState)this).PlayAnimation("Gesture, Additive", "ThrowGrenade", "FireFMJ.playbackRate", duration * 2f, 0f);
			((EntityState)this).PlayAnimation("Gesture, Override", "ThrowGrenade", "FireFMJ.playbackRate", duration * 2f, 0f);
			Util.PlaySound("Play_bandit2_m2_impact", ((EntityState)this).gameObject);
			((BaseState)this).AddRecoil(-0.6f, 0.6f, -0.6f, 0.6f);
			if (Object.op_Implicit((Object)(object)biteEffectPrefab))
			{
				EffectManager.SimpleMuzzleFlash(biteEffectPrefab, ((EntityState)this).gameObject, "MuzzleRight", false);
			}
			if (((EntityState)this).isAuthority)
			{
				BlastAttack val = new BlastAttack
				{
					attacker = ((EntityState)this).gameObject,
					inflictor = ((EntityState)this).gameObject,
					procCoefficient = 1f,
					baseDamage = ((BaseState)this).damageStat * 3.6f,
					position = ((EntityState)this).characterBody.corePosition,
					teamIndex = ((BaseState)this).GetTeam(),
					radius = 8f,
					falloffModel = (FalloffModel)0,
					baseForce = 0f,
					bonusForce = Vector3.zero,
					damageType = DamageTypeCombo.op_Implicit((DamageType)32),
					attackerFiltering = (AttackerFiltering)2
				};
				DamageAPI.AddModdedDamageType(val, CommandoKnife.knifeDamageType);
				Result val2 = val.Fire();
				if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && !((EntityState)this).characterMotor.isGrounded && val2.hitCount > 0)
				{
					((EntityState)this).characterMotor.velocity = new Vector3(((EntityState)this).characterMotor.velocity.x, Mathf.Max(((EntityState)this).characterMotor.velocity.y, 6f), ((EntityState)this).characterMotor.velocity.z);
				}
			}
		}

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return (InterruptPriority)2;
		}
	}
	public class SpecialShotgunBlast : BaseSkillState
	{
		public static GameObject shotgunHitsparkEffectPrefab = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Junk/Commando/HitsparkCommandoBarrage.prefab").WaitForCompletion();

		public static GameObject shotgunBulletEffectPrefab = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Commando/TracerCommandoDefault.prefab").WaitForCompletion();

		public static float baseDuration = 0.5f;

		private float duration;

		public override void OnEnter()
		{
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_0143: Unknown result type (might be due to invalid IL or missing references)
			//IL_0155: Unknown result type (might be due to invalid IL or missing references)
			//IL_0160: 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_016e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0173: Unknown result type (might be due to invalid IL or missing references)
			//IL_0178: Unknown result type (might be due to invalid IL or missing references)
			//IL_017a: Unknown result type (might be due to invalid IL or missing references)
			//IL_017f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0182: Unknown result type (might be due to invalid IL or missing references)
			//IL_0187: Unknown result type (might be due to invalid IL or missing references)
			//IL_018c: Unknown result type (might be due to invalid IL or missing references)
			//IL_018f: Unknown result type (might be due to invalid IL or missing references)
			//IL_019a: 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_01b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c4: 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_01da: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0201: Unknown result type (might be due to invalid IL or missing references)
			//IL_020c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0219: Expected O, but got Unknown
			((BaseState)this).OnEnter();
			duration = baseDuration / ((BaseState)this).attackSpeedStat;
			Ray aimRay = ((BaseState)this).GetAimRay();
			((BaseState)this).StartAimMode(aimRay, 2f, false);
			((EntityState)this).PlayAnimation("Gesture, Additive", "FireBarrage", "FireBarrage.playbackRate", duration, 0f);
			((EntityState)this).PlayAnimation("Gesture, Override", "FireBarrage", "FireBarrage.playbackRate", duration, 0f);
			Util.PlaySound(FireCaptainShotgun.wideSoundString, ((EntityState)this).gameObject);
			if (Object.op_Implicit((Object)(object)shotgunHitsparkEffectPrefab))
			{
				EffectManager.SimpleMuzzleFlash(shotgunHitsparkEffectPrefab, ((EntityState)this).gameObject, "MuzzleRight", false);
			}
			if (Object.op_Implicit((Object)(object)shotgunBulletEffectPrefab))
			{
				EffectManager.SimpleMuzzleFlash(shotgunBulletEffectPrefab, ((EntityState)this).gameObject, "MuzzleRight", false);
			}
			if (((EntityState)this).isAuthority)
			{
				bool flag = Object.op_Implicit((Object)(object)((EntityState)this).skillLocator) && Object.op_Implicit((Object)(object)((EntityState)this).skillLocator.special) && (Object)(object)((EntityState)this).skillLocator.special.skillDef == (Object)(object)SkillBase<CommandoSpecialShotgun>.Instance.scepterDef;
				uint num = 6u;
				if (flag)
				{
					num *= 2;
				}
				BulletAttack val = new BulletAttack
				{
					owner = ((EntityState)this).gameObject,
					damage = ((BaseState)this).damageStat * 3f,
					procCoefficient = 1f,
					force = 1f,
					damageType = DamageTypeCombo.op_Implicit((DamageType)32),
					falloffModel = (FalloffModel)1,
					origin = ((Ray)(ref aimRay)).origin,
					aimVector = ((Ray)(ref aimRay)).direction,
					maxDistance = 25f,
					radius = 1f,
					bulletCount = num,
					minSpread = 0f,
					maxSpread = 5f,
					filterCallback = BulletAttack.defaultFilterCallback,
					hitCallback = BulletAttack.defaultHitCallback,
					stopperMask = ((LayerIndex)(ref LayerIndex.world)).collisionMask,
					isCrit = ((BaseState)this).RollCrit(),
					tracerEffectPrefab = shotgunBulletEffectPrefab,
					hitEffectPrefab = shotgunHitsparkEffectPrefab
				};
				val.Fire();
			}
		}

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return (InterruptPriority)2;
		}
	}
}
namespace SkillsReturns.SkillStates.Bandit2.FlashBang
{
	public class ThrowFlashbang : AimThrowableBase
	{
		public static GameObject smokeProjectilePrefab;

		public static GameObject aimEndpointVisualizerPrefab = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Huntress/HuntressArrowRainIndicator.prefab").WaitForCompletion();

		public static GameObject aimArcVisualizerPrefab = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Common/VFX/BasicThrowableVisualizer.prefab").WaitForCompletion();

		public override void OnEnter()
		{
			base.maxDistance = 48f;
			base.rayRadius = 2f;
			base.arcVisualizerPrefab = aimArcVisualizerPrefab;
			base.projectilePrefab = smokeProjectilePrefab;
			base.endpointVisualizerPrefab = aimEndpointVisualizerPrefab;
			base.endpointVisualizerRadiusScale = 4f;
			base.setFuse = false;
			base.damageCoefficient = 0f;
			base.baseMinimumDuration = 0f;
			base.projectileBaseSpeed = 80f;
			((AimThrowableBase)this).OnEnter();
		}

		public override void OnExit()
		{
			//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)this).PlayAnimation("Gesture, Additive", "SlashBlade", "SlashBlade.playbackRate", 0.5f, 0f);
			((EntityState)this).PlayAnimation("Gesture, Override", "SlashBlade", "SlashBlade.playbackRate", 0.5f, 0f);
			Util.PlaySound("Play_commando_M2_grenade_throw", ((EntityState)this).gameObject);
			if (((EntityState)this).isAuthority && Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && !((EntityState)this).characterMotor.isGrounded)
			{
				((EntityState)this).characterMotor.velocity = new Vector3(((EntityState)this).characterMotor.velocity.x, Mathf.Max(((EntityState)this).characterMotor.velocity.y, 6f), ((EntityState)this).characterMotor.velocity.z);
			}
			((AimThrowableBase)this).OnExit();
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return (InterruptPriority)3;
		}
	}
}
namespace SkillsReturns.SkillSetup
{
	public abstract class SkillBase<T> : SkillBase where T : SkillBase<T>
	{
		public static T Instance { get; private set; }

		public SkillBase()
		{
			if (Instance != null)
			{
				throw new InvalidOperationException("Singleton class \"" + typeof(T).Name + "\" inheriting SkillBase was instantiated twice");
			}
			Instance = this as T;
			Instance.Init();
		}
	}
	public abstract class SkillBase
	{
		private bool enabled;

		public SkillDef skillDef;

		public abstract string SkillName { get; }

		public abstract string SkillLangTokenName { get; }

		public abstract string SkillLangTokenDesc { get; }

		public abstract SkillFamily SkillFamily { get; }

		protected void Init()
		{
			CreateConfig();
			if (enabled)
			{
				Hooks();
				RegisterStates();
				CreateSkillDef();
				CreateAssets();
				if (Object.op_Implicit((Object)(object)skillDef))
				{
					ContentAddition.AddSkillDef(skillDef);
				}
				AddSkillToSlot();
			}
		}

		protected virtual void CreateSkillDef()
		{
			skillDef = ScriptableObject.CreateInstance<SkillDef>();
			skillDef.skillName = SkillLangTokenName;
			skillDef.skillNameToken = SkillLangTokenName;
			skillDef.skillDescriptionToken = SkillLangTokenDesc;
			skillDef.keywordTokens = new string[0];
			((Object)skillDef).name = SkillLangTokenName;
		}

		protected virtual void CreateAssets()
		{
		}

		protected virtual void Hooks()
		{
		}

		protected virtual void CreateConfig()
		{
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Expected O, but got Unknown
			//IL_002d: Expected O, but got Unknown
			enabled = SkillsReturnsPlugin.configFile.Bind<bool>(new ConfigDefinition(SkillName, "Enabled"), true, new ConfigDescription("Enable this skill.", (AcceptableValueBase)null, Array.Empty<object>())).Value;
		}

		protected abstract void RegisterStates();

		protected virtual void AddSkillToSlot()
		{
			//IL_0091: 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_00c9: Expected O, but got Unknown
			//IL_00ca: 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)
			if (!Object.op_Implicit((Object)(object)skillDef))
			{
				Debug.LogError((object)("SkillsReturns: Could not add " + SkillName + ": SkillDef is null."));
				return;
			}
			if ((Object)(object)SkillFamily == (Object)null)
			{
				Debug.LogError((object)("SkillsReturns: Could not add " + SkillName + ": SkillFamily is null."));
				return;
			}
			SkillFamily skillFamily = SkillFamily;
			Array.Resize(ref skillFamily.variants, skillFamily.variants.Length + 1);
			Variant[] variants = skillFamily.variants;
			int num = skillFamily.variants.Length - 1;
			Variant val = new Variant
			{
				skillDef = skillDef,
				unlockableName = ""
			};
			((Variant)(ref val)).viewableNode = new Node(skillDef.skillNameToken, false, (Node)null);
			variants[num] = val;
		}
	}
}
namespace SkillsReturns.SkillSetup.Engineer
{
	public class EngiMortarPrimary : SkillBase<EngiMortarPrimary>
	{
		public SkillDef scepterDef;

		public override string SkillName => "Engineer - Mortar Barrage";

		public override string SkillLangTokenName => "ENGI_PRIMARY_SKILLSRETURNS_MORTARS_NAME";

		public override string SkillLangTokenDesc => "ENGI_PRIMARY_SKILLSRETURNS_MORTARS_DESCRIPTION";

		public override SkillFamily SkillFamily => Addressables.LoadAssetAsync<SkillFamily>((object)"RoR2/Base/Engi/EngiBodyPrimaryFamily.asset").WaitForCompletion();

		protected override void CreateSkillDef()
		{
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_0094: Unknown result type (might be due to invalid IL or missing references)
			SteppedSkillDef val = ScriptableObject.CreateInstance<SteppedSkillDef>();
			((SkillDef)val).skillName = SkillLangTokenName;
			((SkillDef)val).skillNameToken = SkillLangTokenName;
			((SkillDef)val).skillDescriptionToken = SkillLangTokenDesc;
			((SkillDef)val).keywordTokens = new string[0];
			((Object)val).name = ((SkillDef)val).skillName;
			((SkillDef)val).activationState = new SerializableEntityStateType(typeof(EngiMortarFire));
			((SkillDef)val).activationStateMachineName = "Weapon";
			((SkillDef)val).baseMaxStock = 1;
			((SkillDef)val).baseRechargeInterval = 0f;
			((SkillDef)val).beginSkillCooldownOnSkillEnd = false;
			((SkillDef)val).canceledFromSprinting = false;
			((SkillDef)val).cancelSprintingOnActivation = true;
			((SkillDef)val).fullRestockOnAssign = true;
			((SkillDef)val).interruptPriority = (InterruptPriority)1;
			((SkillDef)val).isCombatSkill = true;
			((SkillDef)val).mustKeyPress = false;
			((SkillDef)val).rechargeStock = 1;
			((SkillDef)val).requiredStock = 1;
			((SkillDef)val).stockToConsume = 0;
			((SkillDef)val).icon = Assets.mainAssetBundle.LoadAsset<Sprite>("MortarBarrageIcon");
			val.stepCount = 2;
			skillDef = (SkillDef)(object)val;
			LanguageAPI.Add(SkillLangTokenName, "Mortar Barrage");
			LanguageAPI.Add(SkillLangTokenDesc, "<style=cIsDamage>Slowing.</style> Launch mortar rounds in a fixed arc for <style=cIsDamage>100% damage</style>.");
		}

		protected override void CreateAssets()
		{
			//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_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			//IL_009c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Toolbot/ToolbotGrenadeLauncherProjectile.prefab").WaitForCompletion(), "SkillsReturnsEngiMortarProjectile", true);
			ContentAddition.AddProjectile(val);
			val.AddComponent<MortarPointAtForwardDirection>();
			EngiMortarFire.engiMortarProjectilePrefab = val;
			Rigidbody component = val.GetComponent<Rigidbody>();
			component.useGravity = true;
			component.mass = 1f;
			component.angularDrag = 300f;
			ProjectileSimple component2 = val.GetComponent<ProjectileSimple>();
			component2.desiredForwardSpeed = 25f;
			ProjectileImpactExplosion component3 = val.GetComponent<ProjectileImpactExplosion>();
			((ProjectileExplosion)component3).falloffModel = (FalloffModel)0;
			component3.lifetimeAfterImpact = 0f;
			((ProjectileExplosion)component3).blastRadius = 5f;
			component3.impactEffect = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Engi/EngiGrenadeExplosion.prefab").WaitForCompletion();
			ProjectileDamage component4 = val.GetComponent<ProjectileDamage>();
			component4.damageType = DamageTypeCombo.op_Implicit((DamageType)8);
			GameObject val2 = Assets.mainAssetBundle.LoadAsset<GameObject>("EngiMortar");
			val2.AddComponent<ProjectileGhostController>();
			val2.layer = LayerIndex.noCollision.intVal;
			ProjectileController component5 = val.GetComponent<ProjectileController>();
			component5.ghostPrefab = val2;
			val2.transform.Rotate(0f, 0f, 1f);
		}

		protected override void RegisterStates()
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			bool flag = default(bool);
			ContentAddition.AddEntityState(typeof(EngiMortarFire), ref flag);
		}
	}
}
namespace SkillsReturns.SkillSetup.Engineer.Components
{
	public class MortarPointAtForwardDirection : MonoBehaviour
	{
		private Rigidbody rigidBody;

		private void Awake()
		{
			rigidBody = ((Component)this).GetComponent<Rigidbody>();
			if (!Object.op_Implicit((Object)(object)rigidBody))
			{
				Object.Destroy((Object)(object)this);
			}
		}

		private void FixedUpdate()
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: 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)
			Transform transform = ((Component)this).transform;
			Vector3 velocity = rigidBody.velocity;
			transform.forward = ((Vector3)(ref velocity)).normalized;
		}
	}
}
namespace SkillsReturns.SkillSetup.Commando
{
	public class CommandoKnife : SkillBase<CommandoKnife>
	{
		public static ModdedDamageType knifeDamageType;

		public static BuffDef knifeDebuff;

		public override string SkillName => "Commando - Combat Knife";

		public override string SkillLangTokenName => "COMMANDO_SECONDARY_SKILLSRETURNS_SLASHKNIFE_NAME";

		public override string SkillLangTokenDesc => "COMMANDO_SECONDARY_SKILLSRETURNS_SLASHKNIFE_DESCRIPTION";

		public override SkillFamily SkillFamily => Addressables.LoadAssetAsync<SkillFamily>((object)"RoR2/Base/Commando/CommandoBodySecondaryFamily.asset").WaitForCompletion();

		protected override void CreateAssets()
		{
			//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_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			if (!Object.op_Implicit((Object)(object)knifeDebuff))
			{
				knifeDamageType = DamageAPI.ReserveDamageType();
				knifeDebuff = Utilities.CreateBuffDef("CommandoKnifeDebuff", canStack: false, isCooldown: false, isDebuff: true, Color32.op_Implicit(new Color32((byte)81, (byte)0, (byte)0, byte.MaxValue)), Addressables.LoadAssetAsync<Sprite>((object)"RoR2/Base/Bandit2/texBuffSuperBleedingIcon.tif").WaitForCompletion());
			}
		}

		protected override void Hooks()
		{
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Expected O, but got Unknown
			GlobalEventManager.onServerDamageDealt += ApplyKnifeDebuff;
			HealthComponent.TakeDamage += new hook_TakeDamage(ChangeDamageColor);
			ModifyFinalDamage.ModifyFinalDamageActions = (ModifyFinalDamage.ModifyFinalDamageDelegate)Delegate.Combine(ModifyFinalDamage.ModifyFinalDamageActions, new ModifyFinalDamage.ModifyFinalDamageDelegate(AmplifyDamage));
		}

		private void AmplifyDamage(ModifyFinalDamage.DamageMult damageMult, DamageInfo damageInfo, HealthComponent victim, CharacterBody victimBody)
		{
			if (victimBody.HasBuff(knifeDebuff))
			{
				damageMult.value += 0.5f;
			}
		}

		private void ApplyKnifeDebuff(DamageReport report)
		{
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			if (Object.op_Implicit((Object)(object)report.victimBody) && !report.damageInfo.rejected && DamageAPI.HasModdedDamageType(report.damageInfo, knifeDamageType))
			{
				report.victimBody.AddTimedBuff(knifeDebuff, 5f);
			}
		}

		private void ChangeDamageColor(orig_TakeDamage orig, HealthComponent self, DamageInfo damageInfo)
		{
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			if (NetworkServer.active && Object.op_Implicit((Object)(object)self.body) && self.body.HasBuff(knifeDebuff) && (int)damageInfo.damageColorIndex == 0)
			{
				damageInfo.damageColorIndex = (DamageColorIndex)8;
			}
			orig.Invoke(self, damageInfo);
		}

		protected override void CreateSkillDef()
		{
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: Unknown result type (might be due to invalid IL or missing references)
			base.CreateSkillDef();
			skillDef.activationState = new SerializableEntityStateType(typeof(SlashKnife));
			skillDef.activationStateMachineName = "Weapon";
			skillDef.baseMaxStock = 1;
			skillDef.baseRechargeInterval = 3f;
			skillDef.beginSkillCooldownOnSkillEnd = false;
			skillDef.canceledFromSprinting = false;
			skillDef.cancelSprintingOnActivation = true;
			skillDef.fullRestockOnAssign = true;
			skillDef.interruptPriority = (InterruptPriority)1;
			skillDef.isCombatSkill = true;
			skillDef.mustKeyPress = false;
			skillDef.rechargeStock = 1;
			skillDef.requiredStock = 1;
			skillDef.stockToConsume = 1;
			skillDef.icon = Assets.mainAssetBundle.LoadAsset<Sprite>("CombatKnifeIcon");
			skillDef.keywordTokens = new string[1] { "KEYWORD_STUNNING" };
			LanguageAPI.Add(SkillLangTokenName, "Combat Knife");
			LanguageAPI.Add(SkillLangTokenDesc, "Slash enemies for <style=cIsDamage>360% damage</style>, wounding and <style=cIsDamage>stunning</style> enemies. Wounded enemies take <style=cIsDamage>50% more damage</style>.");
		}

		protected override void RegisterStates()
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			bool flag = default(bool);
			ContentAddition.AddEntityState(typeof(SlashKnife), ref flag);
		}
	}
	public class CommandoSpecialShotgun : SkillBase<CommandoSpecialShotgun>
	{
		public SkillDef scepterDef;

		public override string SkillName => "Commando - Point Blank";

		public override string SkillLangTokenName => "COMMANDO_SPECIAL_SKILLSRETURNS_SHOTGUNBLAST_NAME";

		public override string SkillLangTokenDesc => "COMMANDO_SPECIAL_SKILLSRETURNS_SHOTGUNBLAST_DESCRIPTION";

		public override SkillFamily SkillFamily => Addressables.LoadAssetAsync<SkillFamily>((object)"RoR2/Base/Commando/CommandoBodySpecialFamily.asset").WaitForCompletion();

		protected override void CreateSkillDef()
		{
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: Unknown result type (might be due to invalid IL or missing references)
			base.CreateSkillDef();
			skillDef.activationState = new SerializableEntityStateType(typeof(SpecialShotgunBlast));
			skillDef.activationStateMachineName = "Weapon";
			skillDef.baseMaxStock = 1;
			skillDef.baseRechargeInterval = 6f;
			skillDef.beginSkillCooldownOnSkillEnd = false;
			skillDef.canceledFromSprinting = false;
			skillDef.cancelSprintingOnActivation = true;
			skillDef.fullRestockOnAssign = true;
			skillDef.interruptPriority = (InterruptPriority)1;
			skillDef.isCombatSkill = true;
			skillDef.mustKeyPress = false;
			skillDef.rechargeStock = 1;
			skillDef.requiredStock = 1;
			skillDef.stockToConsume = 1;
			skillDef.icon = Assets.mainAssetBundle.LoadAsset<Sprite>("PointBlankIcon");
			skillDef.keywordTokens = new string[1] { "KEYWORD_STUNNING" };
			LanguageAPI.Add(SkillLangTokenName, "Point-Blank");
			LanguageAPI.Add(SkillLangTokenDesc, "<style=cIsDamage>Stunning.</style> Fire a <style=cIsDamage>piercing</style> shotgun blast for <style=cIsDamage>6x300% damage</style>.");
			if (ModCompat.AncientScepterCompat.pluginLoaded)
			{
				BuildScepterSkill();
			}
		}

		private void BuildScepterSkill()
		{
			//IL_0098: Unknown result type (might be due to invalid IL or missing references)
			//IL_009d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0148: Unknown result type (might be due to invalid IL or missing references)
			//IL_014d: Unknown result type (might be due to invalid IL or missing references)
			scepterDef = ScriptableObject.CreateInstance<SkillDef>();
			scepterDef.skillName = SkillLangTokenName + "_SCEPTER";
			scepterDef.skillNameToken = SkillLangTokenName + "_SCEPTER";
			scepterDef.skillDescriptionToken = SkillLangTokenDesc + "_SCEPTER";
			scepterDef.keywordTokens = new string[1] { "KEYWORD_STUNNING" };
			((Object)scepterDef).name = SkillLangTokenName;
			scepterDef.activationState = new SerializableEntityStateType(typeof(SpecialShotgunBlast));
			scepterDef.activationStateMachineName = skillDef.activationStateMachineName;
			scepterDef.baseMaxStock = skillDef.baseMaxStock;
			scepterDef.baseRechargeInterval = skillDef.baseRechargeInterval;
			scepterDef.beginSkillCooldownOnSkillEnd = skillDef.beginSkillCooldownOnSkillEnd;
			scepterDef.canceledFromSprinting = skillDef.canceledFromSprinting;
			scepterDef.cancelSprintingOnActivation = skillDef.cancelSprintingOnActivation;
			scepterDef.fullRestockOnAssign = skillDef.fullRestockOnAssign;
			scepterDef.interruptPriority = skillDef.interruptPriority;
			scepterDef.isCombatSkill = skillDef.isCombatSkill;
			scepterDef.mustKeyPress = skillDef.mustKeyPress;
			scepterDef.rechargeStock = skillDef.rechargeStock;
			scepterDef.requiredStock = skillDef.requiredStock;
			scepterDef.stockToConsume = skillDef.stockToConsume;
			scepterDef.icon = Assets.mainAssetBundle.LoadAsset<Sprite>("PointBlankIcon");
			ContentAddition.AddSkillDef(scepterDef);
			ModCompat.AncientScepterCompat.AddScepterSkill(scepterDef, "CommandoBody", skillDef);
			LanguageAPI.Add(SkillLangTokenName + "_SCEPTER", "Lead Shot");
			LanguageAPI.Add(SkillLangTokenDesc + "_SCEPTER", "<style=cIsDamage>Stunning.</style> Fire a <style=cIsDamage>piercing</style> shotgun blast for <style=cIsDamage>12x200% damage</style>.");
		}

		protected override void RegisterStates()
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			bool flag = default(bool);
			ContentAddition.AddEntityState(typeof(SpecialShotgunBlast), ref flag);
		}
	}
}
namespace SkillsReturns.SkillSetup.Bandit2
{
	public class Smokescreen : SkillBase<Smokescreen>
	{
		public static ModdedDamageType SmokescreenDamageType;

		public static BuffDef BlindingDebuff;

		public override string SkillName => "Bandit - Flashbang";

		public override string SkillLangTokenName => "BANDIT2_UTILITY_SKILLSRETURNS_FLASHBANG_NAME";

		public override string SkillLangTokenDesc => "BANDIT2_UTILITY_SKILLSRETURNS_FLASHBANG_DESCRIPTION";

		public override SkillFamily SkillFamily => Addressables.LoadAssetAsync<SkillFamily>((object)"RoR2/Base/Bandit2/Bandit2BodyUtilityFamily.asset").WaitForCompletion();

		protected override void RegisterStates()
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			bool flag = default(bool);
			ContentAddition.AddEntityState(typeof(ThrowFlashbang), ref flag);
		}

		protected override void CreateAssets()
		{
			//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_0032: 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_0041: Unknown result type (might be due to invalid IL or missing references)
			if (!Object.op_Implicit((Object)(object)BlindingDebuff))
			{
				SmokescreenDamageType = DamageAPI.ReserveDamageType();
				BlindingDebuff = Utilities.CreateBuffDef("SmokescreenDebuff", canStack: false, isCooldown: false, isDebuff: true, new Color(41f / 51f, 41f / 85f, 43f / 51f), Addressables.LoadAssetAsync<Sprite>((object)"RoR2/Base/Common/texBuffCloakIcon.tif").WaitForCompletion());
				BuildProjectile();
			}
		}

		protected override void Hooks()
		{
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Expected O, but got Unknown
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Expected O, but got Unknown
			GlobalEventManager.onServerDamageDealt += ApplySmokescreenDebuff;
			HealthComponent.TakeDamage += new hook_TakeDamage(ChangeDamageColor);
			ModifyFinalDamage.ModifyFinalDamageActions = (ModifyFinalDamage.ModifyFinalDamageDelegate)Delegate.Combine(ModifyFinalDamage.ModifyFinalDamageActions, new ModifyFinalDamage.ModifyFinalDamageDelegate(AmplifyDamage));
			RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(Bandit2SmokebombDebuffModifier);
		}

		private void AmplifyDamage(ModifyFinalDamage.DamageMult damageMult, DamageInfo damageInfo, HealthComponent victim, CharacterBody victimBody)
		{
			if (victimBody.HasBuff(BlindingDebuff))
			{
				damageMult.value += 0.25f;
			}
		}

		private void ApplySmokescreenDebuff(DamageReport report)
		{
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			if (Object.op_Implicit((Object)(object)report.victimBody) && !report.damageInfo.rejected && DamageAPI.HasModdedDamageType(report.damageInfo, SmokescreenDamageType))
			{
				report.victimBody.AddTimedBuff(BlindingDebuff, 3f);
			}
		}

		private void ChangeDamageColor(orig_TakeDamage orig, HealthComponent self, DamageInfo damageInfo)
		{
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			if (NetworkServer.active && Object.op_Implicit((Object)(object)self.body) && self.body.HasBuff(BlindingDebuff) && (int)damageInfo.damageColorIndex == 0)
			{
				damageInfo.damageColorIndex = (DamageColorIndex)4;
			}
			orig.Invoke(self, damageInfo);
		}

		private void Bandit2SmokebombDebuffModifier(CharacterBody sender, StatHookEventArgs args)
		{
			if (sender.HasBuff(BlindingDebuff))
			{
				args.moveSpeedReductionMultAdd += 0.8f;
				args.attackSpeedReductionMultAdd += 0.3f;
			}
		}

		private void BuildProjectile()
		{
			//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_011b: 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_0129: Unknown result type (might be due to invalid IL or missing references)
			//IL_015e: 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)
			//IL_0276: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_032d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0332: Unknown result type (might be due to invalid IL or missing references)
			float duration = 7f;
			float num = 15f;
			GameObject val = PrefabAPI.InstantiateClone(LegacyResourcesAPI.Load<GameObject>("Prefabs/Projectiles/CommandoGrenadeProjectile"), "SkillsReturns_SmokeGrenade", true);
			ProjectileController component = val.GetComponent<ProjectileController>();
			ProjectileDamage component2 = val.GetComponent<ProjectileDamage>();
			ProjectileSimple component3 = val.GetComponent<ProjectileSimple>();
			ProjectileImpactExplosion component4 = val.GetComponent<ProjectileImpactExplosion>();
			GameObject val2 = PrefabAPI.InstantiateClone(Assets.mainAssetBundle.LoadAsset<GameObject>("SmokeGrenade"), "SniperClassic_SmokeGhost", true);
			val2.AddComponent<NetworkIdentity>();
			val2.AddComponent<ProjectileGhostController>();
			component.ghostPrefab = val2;
			component.startSound = "";
			component.procCoefficient = 1f;
			component2.crit = false;
			component2.damage = 0f;
			component2.damageColorIndex = (DamageColorIndex)0;
			component2.damageType = DamageTypeCombo.op_Implicit((DamageType)33);
			component2.force = 0f;
			GameObject val3 = PrefabAPI.InstantiateClone(LegacyResourcesAPI.Load<GameObject>("Prefabs/Projectiles/SporeGrenadeProjectileDotZone"), "SkillsReturns_SmokeDotZone", true);
			ProjectileController component5 = val3.GetComponent<ProjectileController>();
			ProjectileDamage component6 = val3.GetComponent<ProjectileDamage>();
			Object.Destroy((Object)(object)val3.GetComponent<ProjectileDotZone>());
			component5.procCoefficient = 0f;
			component6.crit = false;
			component6.damage = 0f;
			component6.damageColorIndex = (DamageColorIndex)5;
			component6.damageType = DamageTypeCombo.op_Implicit((DamageType)33);
			component6.force = 0f;
			BuffWard val4 = val3.AddComponent<BuffWard>();
			val4.radius = num;
			val4.interval = 0.25f;
			val4.buffDef = Addressables.LoadAssetAsync<BuffDef>((object)"RoR2/Base/Common/bdCloak.asset").WaitForCompletion();
			val4.buffDuration = 1f;
			val4.floorWard = false;
			val4.expires = false;
			val4.invertTeamFilter = false;
			val4.expireDuration = 0f;
			val4.animateRadius = false;
			val4.rangeIndicator = null;
			BuffWard val5 = val3.AddComponent<BuffWard>();
			val5.radius = num;
			val5.interval = 0.5f;
			val5.buffDef = BlindingDebuff;
			val5.buffDuration = 1f;
			val5.floorWard = false;
			val5.expires = false;
			val5.invertTeamFilter = true;
			val5.expireDuration = 0f;
			val5.animateRadius = false;
			val5.rangeIndicator = null;
			Object.Destroy((Object)(object)((Component)val3.transform.GetChild(0)).gameObject);
			GameObject val6 = PrefabAPI.InstantiateClone(Assets.mainAssetBundle.LoadAsset<GameObject>("SmokeEffect"), "FX", false);
			val6.AddComponent<DestroyOnTimer>().duration = duration;
			val6.transform.parent = val3.transform;
			val6.transform.localPosition = Vector3.zero;
			val3.AddComponent<DestroyOnTimer>().duration = duration;
			HackyTeamAreaIndicator hackyTeamAreaIndicator = val3.AddComponent<HackyTeamAreaIndicator>();
			hackyTeamAreaIndicator.radius = num;
			component4.offsetForLifetimeExpiredSound = 1f;
			component4.destroyOnEnemy = true;
			component4.destroyOnWorld = true;
			component4.timerAfterImpact = false;
			((ProjectileExplosion)component4).falloffModel = (FalloffModel)0;
			component4.lifetime = 12f;
			component4.lifetimeRandomOffset = 0f;
			((ProjectileExplosion)component4).blastRadius = num;
			((ProjectileExplosion)component4).blastDamageCoefficient = 1f;
			((ProjectileExplosion)component4).blastProcCoefficient = 1f;
			((ProjectileExplosion)component4).fireChildren = true;
			((ProjectileExplosion)component4).childrenCount = 1;
			((ProjectileExplosion)component4).childrenProjectilePrefab = val3;
			((ProjectileExplosion)component4).childrenDamageCoefficient = 0f;
			GameObject val7 = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Bandit2/Bandit2SmokeBomb.prefab").WaitForCompletion(), "SkillsReturns_SmokescreenImpactEffect", false);
			val7.GetComponent<EffectComponent>().soundName = "Play_bandit2_shift_exit";
			ContentAddition.AddEffect(val7);
			component4.impactEffect = val7;
			ContentAddition.AddProjectile(val);
			ContentAddition.AddProjectile(val3);
			ThrowFlashbang.smokeProjectilePrefab = val;
		}

		protected override void CreateSkillDef()
		{
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: Unknown result type (might be due to invalid IL or missing references)
			base.CreateSkillDef();
			skillDef.activationState = new SerializableEntityStateType(typeof(ThrowFlashbang));
			skillDef.activationStateMachineName = "Weapon";
			skillDef.baseMaxStock = 1;
			skillDef.baseRechargeInterval = 15f;
			skillDef.beginSkillCooldownOnSkillEnd = false;
			skillDef.canceledFromSprinting = false;
			skillDef.cancelSprintingOnActivation = true;
			skillDef.fullRestockOnAssign = true;
			skillDef.interruptPriority = (InterruptPriority)2;
			skillDef.isCombatSkill = false;
			skillDef.mustKeyPress = true;
			skillDef.rechargeStock = 1;
			skillDef.requiredStock = 1;
			skillDef.stockToConsume = 1;
			skillDef.icon = Assets.mainAssetBundle.LoadAsset<Sprite>("FlashbangIcon");
			skillDef.keywordTokens = new string[1] { "KEYWORD_STUNNING" };
			LanguageAPI.Add(SkillLangTokenName, "Flashbang");
			LanguageAPI.Add(SkillLangTokenDesc, "Toss a flash grenade, <style=cIsDamage>stunning and blinding</style> enemies. Blinded enemies have <style=cIsDamage>reduced mobility</style> and take <style=cIsDamage>25% more damage</style>.");
		}
	}
	public class HackyTeamAreaIndicator : MonoBehaviour
	{
		public GameObject indicatorPrefab = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Common/TeamAreaIndicator, FullSphere.prefab").WaitForCompletion();

		public float radius = 12f;

		private GameObject indicatorInstance;

		public void Awake()
		{
			//IL_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			TeamFilter component = ((Component)this).GetComponent<TeamFilter>();
			if (!Object.op_Implicit((Object)(object)component))
			{
				return;
			}
			indicatorInstance = Object.Instantiate<GameObject>(indicatorPrefab, ((Component)this).transform);
			if (Object.op_Implicit((Object)(object)indicatorInstance))
			{
				TeamAreaIndicator component2 = indicatorInstance.GetComponent<TeamAreaIndicator>();
				if (Object.op_Implicit((Object)(object)component2))
				{
					component2.teamFilter = component;
					((Component)component2).transform.localScale = radius * Vector3.one;
				}
			}
		}

		private void OnDestroy()
		{
			if (Object.op_Implicit((Object)(object)indicatorInstance))
			{
				Object.Destroy((Object)(object)indicatorInstance);
			}
		}
	}
}
namespace SkillsReturns.SharedHooks
{
	internal static class ModifyFinalDamage
	{
		public delegate void ModifyFinalDamageDelegate(DamageMult damageMult, DamageInfo damageInfo, HealthComponent victim, CharacterBody victimBody);

		internal class DamageMult
		{
			public float value = 1f;
		}

		public static ModifyFinalDamageDelegate ModifyFinalDamageActions;

		internal static void ModfyFinalDamageHook(ILContext il)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Expected O, but got Unknown
			//IL_008f: Unknown result type (might be due to invalid IL or missing references)
			//IL_009c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00da: Unknown result type (might be due to invalid IL or missing references)
			ILCursor val = new ILCursor(il);
			if (val.TryGotoNext(new Func<Instruction, bool>[3]
			{
				(Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 1),
				(Instruction x) => ILPatternMatchingExt.MatchLdfld<DamageInfo>(x, "damage"),
				(Instruction x) => ILPatternMatchingExt.MatchStloc(x, 7)
			}))
			{
				val.Index += 3;
				val.Emit(OpCodes.Ldloc, 7);
				val.Emit(OpCodes.Ldarg_0);
				val.Emit(OpCodes.Ldarg_1);
				val.EmitDelegate<Func<float, HealthComponent, DamageInfo, float>>((Func<float, HealthComponent, DamageInfo, float>)delegate(float origDamage, HealthComponent victimHealth, DamageInfo damageInfo)
				{
					float num = origDamage;
					CharacterBody body = victimHealth.body;
					if (Object.op_Implicit((Object)(object)body))
					{
						DamageMult damageMult = new DamageMult();
						ModifyFinalDamageActions?.Invoke(damageMult, damageInfo, victimHealth, body);
						num *= damageMult.value;
					}
					return num;
				});
				val.Emit(OpCodes.Stloc, 7);
			}
			else
			{
				Debug.LogError((object)"SkillsReturns: ModifyFinalDamage IL Hook failed. This will break a lot of things.");
			}
		}
	}
}