Decompiled source of Cut Skills Revived v0.1.1

BepInEx/plugins/UnusedSkillMod.dll

Decompiled a month ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using EntityStates;
using EntityStates.Captain.Weapon;
using Microsoft.CodeAnalysis;
using R2API;
using RoR2;
using RoR2.ContentManagement;
using RoR2.Projectile;
using RoR2.Skills;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnusedSkillMod.Content;
using UnusedSkillMod.Modules;
using UnusedSkillMod.MyEntityStates;

[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("UnusedSkillMod")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+f5da516f69912cf7164805285f7349cbdd4b9370")]
[assembly: AssemblyProduct("UnusedSkillMod")]
[assembly: AssemblyTitle("UnusedSkillMod")]
[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 ExamplePlugin
{
	internal static class Log
	{
		private static ManualLogSource _logSource;

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

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

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

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

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

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

		internal static void Warning(object data)
		{
			_logSource.LogWarning(data);
		}
	}
}
namespace UnusedSkillMod
{
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("com.zebra.UnusedSkillMod", "UnusedSkillMod", "0.1.0")]
	public class UnusedSkillModPlugin : BaseUnityPlugin
	{
		public const string MODUID = "com.zebra.UnusedSkillMod";

		public const string MODNAME = "UnusedSkillMod";

		public const string MODVERSION = "0.1.0";

		internal static PluginInfo pluginInfo;

		public static GameObject rocketGhost;

		public static UnusedSkillModPlugin instance;

		public void Awake()
		{
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_006b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a9: 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_0169: Unknown result type (might be due to invalid IL or missing references)
			//IL_0173: Expected O, but got Unknown
			//IL_0174: Unknown result type (might be due to invalid IL or missing references)
			//IL_0176: Unknown result type (might be due to invalid IL or missing references)
			//IL_0180: Unknown result type (might be due to invalid IL or missing references)
			//IL_0185: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0208: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e1: Expected O, but got Unknown
			//IL_02e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0303: Unknown result type (might be due to invalid IL or missing references)
			//IL_0308: Unknown result type (might be due to invalid IL or missing references)
			//IL_0346: Unknown result type (might be due to invalid IL or missing references)
			//IL_034b: Unknown result type (might be due to invalid IL or missing references)
			//IL_038b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0435: Unknown result type (might be due to invalid IL or missing references)
			//IL_045b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0465: Expected O, but got Unknown
			//IL_0466: Unknown result type (might be due to invalid IL or missing references)
			//IL_0468: Unknown result type (might be due to invalid IL or missing references)
			//IL_0472: Unknown result type (might be due to invalid IL or missing references)
			//IL_0477: Unknown result type (might be due to invalid IL or missing references)
			//IL_04b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_04ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_04fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_05a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_05ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_05d4: Expected O, but got Unknown
			//IL_05d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_05d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_05e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_05e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_05f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_05fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0639: Unknown result type (might be due to invalid IL or missing references)
			//IL_063e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0686: Unknown result type (might be due to invalid IL or missing references)
			//IL_0773: Unknown result type (might be due to invalid IL or missing references)
			//IL_0799: Unknown result type (might be due to invalid IL or missing references)
			//IL_07a3: Expected O, but got Unknown
			//IL_07a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_07a6: Unknown result type (might be due to invalid IL or missing references)
			instance = this;
			pluginInfo = ((BaseUnityPlugin)this).Info;
			GameObject val = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Commando/CommandoBody.prefab").WaitForCompletion();
			SkillDef val2 = Addressables.LoadAssetAsync<SkillDef>((object)"RoR2/Base/Commando/ThrowGrenade.asset").WaitForCompletion();
			LanguageAPI.Add("COMMANDO_SPECIAL_STICKY_NAME", "Sticky Grenade");
			LanguageAPI.Add("COMMANDO_SPECIAL_STICKY_DESCRIPTION", "Throw a grenade that sticks to the first surface or entity it lands on and explodes for <style=cIsDamage>700% damage</style> after 3 seconds. Can hold up to 2.");
			SkillDef val3 = ScriptableObject.CreateInstance<SkillDef>();
			val3.activationState = new SerializableEntityStateType(typeof(CommandoStickyGrenade));
			val3.activationStateMachineName = "Weapon";
			val3.baseMaxStock = 2;
			val3.baseRechargeInterval = 5f;
			val3.beginSkillCooldownOnSkillEnd = false;
			val3.canceledFromSprinting = false;
			val3.cancelSprintingOnActivation = true;
			val3.interruptPriority = (InterruptPriority)0;
			val3.isCombatSkill = true;
			val3.mustKeyPress = true;
			val3.rechargeStock = 1;
			val3.requiredStock = 1;
			val3.stockToConsume = 1;
			val3.icon = val2.icon;
			val3.skillDescriptionToken = "COMMANDO_SPECIAL_STICKY_DESCRIPTION";
			val3.skillName = "COMMANDO_SPECIAL_STICKY_NAME";
			val3.skillNameToken = "COMMANDO_SPECIAL_STICKY_NAME";
			ContentAddition.AddSkillDef(val3);
			SkillLocator component = val.GetComponent<SkillLocator>();
			SkillFamily skillFamily = component.special.skillFamily;
			Array.Resize(ref skillFamily.variants, skillFamily.variants.Length + 1);
			Variant[] variants = skillFamily.variants;
			int num = skillFamily.variants.Length - 1;
			Variant val4 = new Variant
			{
				skillDef = val3,
				unlockableName = "bleh 2"
			};
			((Variant)(ref val4)).viewableNode = new Node(val3.skillNameToken, false, (Node)null);
			variants[num] = val4;
			SkillDef val5 = Addressables.LoadAssetAsync<SkillDef>((object)"RoR2/Base/Commando/CommandoBodyFirePistol.asset").WaitForCompletion();
			LanguageAPI.Add("COMMANDO_SECONDARY_SHRAPNEL_NAME", "Fire Shrapnel");
			LanguageAPI.Add("COMMANDO_SECONDARY_SHRAPNEL_DESCRIPTION", " <style=cIsDamage>Ignite</style>. Fire a bullet that explodes in an 11 meter radius for <style=cIsDamage>600% damage</style>.");
			SkillDef val6 = ScriptableObject.CreateInstance<SkillDef>();
			val6.activationState = new SerializableEntityStateType(typeof(CommandoShrapnel));
			val6.activationStateMachineName = "Weapon";
			val6.baseMaxStock = 1;
			val6.baseRechargeInterval = 3f;
			val6.beginSkillCooldownOnSkillEnd = false;
			val6.canceledFromSprinting = false;
			val6.cancelSprintingOnActivation = true;
			val6.interruptPriority = (InterruptPriority)1;
			val6.isCombatSkill = true;
			val6.mustKeyPress = false;
			val6.rechargeStock = 1;
			val6.requiredStock = 1;
			val6.stockToConsume = 1;
			val6.icon = val5.icon;
			val6.skillDescriptionToken = "COMMANDO_SECONDARY_SHRAPNEL_DESCRIPTION";
			val6.skillName = "COMMANDO_SECONDARY_SHRAPNEL_NAME";
			val6.skillNameToken = "COMMANDO_SECONDARY_SHRAPNEL_NAME";
			ContentAddition.AddSkillDef(val6);
			SkillLocator component2 = val.GetComponent<SkillLocator>();
			SkillFamily skillFamily2 = component2.secondary.skillFamily;
			Array.Resize(ref skillFamily2.variants, skillFamily2.variants.Length + 1);
			Variant[] variants2 = skillFamily2.variants;
			int num2 = skillFamily2.variants.Length - 1;
			val4 = new Variant
			{
				skillDef = val6,
				unlockableName = "bleh 3"
			};
			((Variant)(ref val4)).viewableNode = new Node(val6.skillNameToken, false, (Node)null);
			variants2[num2] = val4;
			GameObject val7 = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Mage/MageBody.prefab").WaitForCompletion();
			SkillDef val8 = Addressables.LoadAssetAsync<SkillDef>((object)"RoR2/Junk/Mage/MageBodyFireIceBolt.asset").WaitForCompletion();
			LanguageAPI.Add("MAGE_PRIMARY_ICEBOLT_NAME", "Ice Bolt");
			LanguageAPI.Add("MAGE_PRIMARY_ICEBOLT_DESCRIPTION", "Fire a slowing bolt for <style=cIsDamage>300% damage</style>. Can hold up to 4.");
			SteppedSkillDef val9 = ScriptableObject.CreateInstance<SteppedSkillDef>();
			((SkillDef)val9).activationState = new SerializableEntityStateType(typeof(FireIceOrb));
			((SkillDef)val9).activationStateMachineName = "Weapon";
			((SkillDef)val9).baseMaxStock = 4;
			((SkillDef)val9).baseRechargeInterval = 1.3f;
			((SkillDef)val9).beginSkillCooldownOnSkillEnd = false;
			((SkillDef)val9).canceledFromSprinting = false;
			((SkillDef)val9).cancelSprintingOnActivation = true;
			((SkillDef)val9).interruptPriority = (InterruptPriority)0;
			((SkillDef)val9).isCombatSkill = true;
			((SkillDef)val9).mustKeyPress = false;
			((SkillDef)val9).rechargeStock = 1;
			((SkillDef)val9).requiredStock = 1;
			((SkillDef)val9).stockToConsume = 1;
			((SkillDef)val9).icon = val8.icon;
			((SkillDef)val9).skillDescriptionToken = "MAGE_PRIMARY_ICEBOLT_DESCRIPTION";
			((SkillDef)val9).skillName = "MAGE_PRIMARY_ICEBOLT_NAME";
			((SkillDef)val9).skillNameToken = "MAGE_PRIMARY_ICEBOLT_NAME";
			ContentAddition.AddSkillDef((SkillDef)(object)val9);
			SkillLocator component3 = val7.GetComponent<SkillLocator>();
			SkillFamily skillFamily3 = component3.primary.skillFamily;
			Array.Resize(ref skillFamily3.variants, skillFamily3.variants.Length + 1);
			Variant[] variants3 = skillFamily3.variants;
			int num3 = skillFamily3.variants.Length - 1;
			val4 = new Variant
			{
				skillDef = (SkillDef)(object)val9,
				unlockableName = "bleh 4"
			};
			((Variant)(ref val4)).viewableNode = new Node(((SkillDef)val9).skillNameToken, false, (Node)null);
			variants3[num3] = val4;
			SkillDef val10 = Addressables.LoadAssetAsync<SkillDef>((object)"RoR2/Base/Commando/CommandoBodyFirePistol.asset").WaitForCompletion();
			LanguageAPI.Add("MAGE_SPECIAL_NOVA_NAME", "Ice Nova");
			LanguageAPI.Add("MAGE_SPECIAL_NOVA_DESCRIPTION", " <style=cIsDamage>Freeze</style>. Explode an an icy nova in an 15 meter radius for <style=cIsDamage>600% damage</style>.");
			SkillDef val11 = ScriptableObject.CreateInstance<SkillDef>();
			val11.activationState = new SerializableEntityStateType(typeof(MageIceNova));
			val11.activationStateMachineName = "Weapon";
			val11.baseMaxStock = 1;
			val11.baseRechargeInterval = 10f;
			val11.beginSkillCooldownOnSkillEnd = false;
			val11.canceledFromSprinting = false;
			val11.cancelSprintingOnActivation = true;
			val11.interruptPriority = (InterruptPriority)1;
			val11.isCombatSkill = true;
			val11.mustKeyPress = false;
			val11.rechargeStock = 1;
			val11.requiredStock = 1;
			val11.stockToConsume = 1;
			val11.icon = val8.icon;
			val11.skillDescriptionToken = "MAGE_SPECIAL_NOVA_DESCRIPTION";
			val11.skillName = "MAGE_SPECIAL_NOVA_NAME";
			val11.skillNameToken = "MAGE_SPECIAL_NOVA_NAME";
			ContentAddition.AddSkillDef(val11);
			SkillLocator component4 = val7.GetComponent<SkillLocator>();
			SkillFamily skillFamily4 = component4.special.skillFamily;
			Array.Resize(ref skillFamily4.variants, skillFamily4.variants.Length + 1);
			Variant[] variants4 = skillFamily4.variants;
			int num4 = skillFamily4.variants.Length - 1;
			val4 = new Variant
			{
				skillDef = val11,
				unlockableName = "bleh 5"
			};
			((Variant)(ref val4)).viewableNode = new Node(val11.skillNameToken, false, (Node)null);
			variants4[num4] = val4;
			GameObject val12 = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Captain/CaptainBody.prefab").WaitForCompletion();
			SkillDef val13 = Addressables.LoadAssetAsync<SkillDef>((object)"RoR2/Base/Captain/CaptainShotgun.asset").WaitForCompletion();
			LanguageAPI.Add("CAPTAIN_SPECIAL_PLATING_NAME", "Plating Beacon");
			LanguageAPI.Add("CAPTAIN_SPECIAL_PLATING_DESCRIPTION", "Call a permanant beacon that, upon interaction will block up to 5 instances of damage.");
			SkillDef val14 = ScriptableObject.CreateInstance<SkillDef>();
			val14.activationState = new SerializableEntityStateType(typeof(CallSupplyDropPlating));
			val14.activationStateMachineName = "Weapon";
			val14.baseMaxStock = 1;
			val14.baseRechargeInterval = 1f;
			val14.beginSkillCooldownOnSkillEnd = true;
			val14.canceledFromSprinting = false;
			val14.cancelSprintingOnActivation = true;
			val14.fullRestockOnAssign = true;
			val14.interruptPriority = (InterruptPriority)1;
			val14.isCombatSkill = true;
			val14.mustKeyPress = false;
			val14.rechargeStock = 1;
			val14.requiredStock = 1;
			val14.stockToConsume = 1;
			val14.icon = val13.icon;
			val14.skillDescriptionToken = "CAPTAIN_SPECIAL_PLATING_DESCRIPTION";
			val14.skillName = "CAPTAIN_SPECIAL_PLATING_NAME";
			val14.skillNameToken = "CAPTAIN_SPECIAL_PLATING_NAME";
			ContentAddition.AddSkillDef(val14);
			SkillLocator component5 = val12.GetComponent<SkillLocator>();
			GenericSkill[] components = val12.GetComponents<GenericSkill>();
			foreach (GenericSkill val15 in components)
			{
				if (val15.skillName.Equals("SupplyDrop1") || val15.skillName.Equals("SupplyDrop2"))
				{
					SkillFamily skillFamily5 = val15.skillFamily;
					Array.Resize(ref skillFamily5.variants, skillFamily5.variants.Length + 1);
					Variant[] variants5 = skillFamily5.variants;
					int num5 = skillFamily5.variants.Length - 1;
					val4 = new Variant
					{
						skillDef = val14,
						unlockableName = ""
					};
					((Variant)(ref val4)).viewableNode = new Node(val14.skillNameToken, false, (Node)null);
					variants5[num5] = val4;
				}
			}
			UnusedSkillModAssets.CreateEffects();
			UnusedSkillModAssets.CreateProjectiles();
			new ContentPacks().Initialize();
		}
	}
}
namespace UnusedSkillMod.MyEntityStates
{
	public class CommandoShrapnel : BaseState
	{
		public static GameObject effectPrefab;

		public static GameObject hitEffectPrefab = UnusedSkillModAssets.commandoHitEffectPrefab;

		public static GameObject tracerEffectPrefab = LegacyResourcesAPI.Load<GameObject>("Prefabs/Effects/Tracers/TracerCommandoDefault");

		public static float damageCoefficient = 1.5f;

		public static float blastRadius = 6.5f;

		public static float force = 1f;

		public static float minSpread = 0f;

		public static float maxSpread = 0f;

		public static int bulletCount = 1;

		public static float baseDuration = 2f;

		public static string attackSoundString = "Play_commando_R";

		public static float maxDistance;

		private float duration;

		private Ray modifiedAimRay;

		public override void OnEnter()
		{
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_010e: 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_020f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0214: Unknown result type (might be due to invalid IL or missing references)
			//IL_0221: Unknown result type (might be due to invalid IL or missing references)
			//IL_0128: Unknown result type (might be due to invalid IL or missing references)
			//IL_012f: Expected O, but got Unknown
			//IL_0151: Unknown result type (might be due to invalid IL or missing references)
			//IL_0156: 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_019d: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ae: 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_01c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e4: Expected O, but got Unknown
			((BaseState)this).OnEnter();
			duration = baseDuration / base.attackSpeedStat;
			modifiedAimRay = ((BaseState)this).GetAimRay();
			Util.PlaySound(attackSoundString, ((EntityState)this).gameObject);
			string text = "MuzzleLeft";
			string text2 = "MuzzleRight";
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterBody))
			{
				((EntityState)this).characterBody.SetAimTimer(2f);
			}
			((EntityState)this).PlayAnimation("Gesture, Additive", "FireFMJ", "FireFMJ.playbackRate", duration, 0f);
			((EntityState)this).PlayAnimation("Gesture, Override", "FireFMJ", "FireFMJ.playbackRate", duration, 0f);
			if (Object.op_Implicit((Object)(object)effectPrefab))
			{
				EffectManager.SimpleMuzzleFlash(effectPrefab, ((EntityState)this).gameObject, text, true);
				EffectManager.SimpleMuzzleFlash(effectPrefab, ((EntityState)this).gameObject, text2, true);
			}
			if (((EntityState)this).isAuthority)
			{
				RaycastHit val = default(RaycastHit);
				if (Physics.Raycast(modifiedAimRay, ref val, 1000f, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask) | LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.enemyBody)).mask)))
				{
					BlastAttack val2 = new BlastAttack();
					val2.attacker = ((EntityState)this).gameObject;
					val2.inflictor = ((EntityState)this).gameObject;
					val2.teamIndex = TeamComponent.GetObjectTeam(((EntityState)this).gameObject);
					val2.baseDamage = base.damageStat * damageCoefficient;
					val2.baseForce = force * 0.2f;
					val2.position = ((RaycastHit)(ref val)).point;
					val2.radius = blastRadius;
					val2.falloffModel = (FalloffModel)0;
					val2.damageType = DamageTypeCombo.op_Implicit((DamageType)128);
					val2.Fire();
					EffectManager.SpawnEffect(UnusedSkillModAssets.shootExplosion, new EffectData
					{
						origin = val2.position,
						scale = blastRadius
					}, true);
				}
				BulletAttack val3 = new BulletAttack();
				val3.owner = ((EntityState)this).gameObject;
				val3.weapon = ((EntityState)this).gameObject;
				val3.origin = ((Ray)(ref modifiedAimRay)).origin;
				val3.aimVector = ((Ray)(ref modifiedAimRay)).direction;
				val3.radius = 0.15f;
				val3.minSpread = minSpread;
				val3.maxSpread = maxSpread;
				val3.bulletCount = ((bulletCount > 0) ? ((uint)bulletCount) : 0u);
				val3.damage = 7f;
				val3.procCoefficient = 0f;
				val3.force = 0f;
				val3.tracerEffectPrefab = tracerEffectPrefab;
				val3.muzzleName = text;
				val3.hitEffectPrefab = hitEffectPrefab;
				val3.isCrit = Util.CheckRoll(base.critStat, ((EntityState)this).characterBody.master);
				val3.Fire();
			}
		}

		public override void OnExit()
		{
			((EntityState)this).OnExit();
			((EntityState)this).outer.SetNextStateToMain();
		}

		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)0;
		}
	}
	public class CommandoStickyGrenade : GenericProjectileBaseState
	{
		public float damageCoefficient = 7f;

		public float duration = 1f;

		public override void OnEnter()
		{
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			((GenericProjectileBaseState)this).OnEnter();
			Util.PlaySound("Play_commando_M2_grenade_throw", ((EntityState)this).gameObject);
			Ray aimRay = ((BaseState)this).GetAimRay();
			if (((EntityState)this).isAuthority)
			{
				ProjectileManager.instance.FireProjectile(UnusedSkillModAssets.commandoStickyPrefab, ((Ray)(ref aimRay)).origin, Util.QuaternionSafeLookRotation(((Ray)(ref aimRay)).direction), ((EntityState)this).gameObject, damageCoefficient * ((BaseState)this).damageStat, 0f, Util.CheckRoll(((BaseState)this).critStat, ((EntityState)this).characterBody.master), (DamageColorIndex)0, (GameObject)null, -1f);
			}
		}

		public override void PlayAnimation(float duration)
		{
			if (Object.op_Implicit((Object)(object)((EntityState)this).GetModelAnimator()))
			{
				((EntityState)this).PlayAnimation("Gesture, Additive", "ThrowGrenade", "FireFMJ.playbackRate", duration * 0.4f, 0f);
				((EntityState)this).PlayAnimation("Gesture, Override", "ThrowGrenade", "FireFMJ.playbackRate", duration * 0.4f, 0f);
			}
		}

		public override void OnExit()
		{
			((GenericProjectileBaseState)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)0;
		}
	}
	public class FireIceOrb : BaseState, IStepSetter
	{
		public enum Gauntlet
		{
			Left,
			Right
		}

		public static GameObject projectilePrefab = UnusedSkillModAssets.artiOrbPrefab;

		public static GameObject effectPrefab = UnusedSkillModAssets.mageIceMuzzle;

		public static float baseDuration = 0.3f;

		public static float damageCoefficient = 3f;

		public static string attackString;

		private float duration;

		private bool hasFiredGauntlet;

		private string muzzleString;

		private Animator animator;

		public Gauntlet gauntlet;

		public void SetStep(int i)
		{
			gauntlet = (Gauntlet)i;
		}

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
			duration = baseDuration / base.attackSpeedStat;
			switch (gauntlet)
			{
			case Gauntlet.Left:
				muzzleString = "MuzzleLeft";
				((EntityState)this).PlayAnimation("Gesture Left, Additive", "FireGauntletLeft", "FireGauntlet.playbackRate", duration, 0f);
				break;
			case Gauntlet.Right:
				muzzleString = "MuzzleRight";
				((EntityState)this).PlayAnimation("Gesture Right, Additive", "FireGauntletRight", "FireGauntlet.playbackRate", duration, 0f);
				break;
			}
			((EntityState)this).PlayAnimation("Gesture, Additive", "HoldGauntletsUp", "FireGauntlet.playbackRate", duration, 0f);
			Util.PlaySound(attackString, ((EntityState)this).gameObject);
			animator = ((EntityState)this).GetModelAnimator();
			((EntityState)this).characterBody.SetAimTimer(2f);
			FireGauntlet();
		}

		public override void OnExit()
		{
			((EntityState)this).OnExit();
		}

		private void FireGauntlet()
		{
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Unknown result type (might be due to invalid IL or missing references)
			hasFiredGauntlet = true;
			Ray aimRay = ((BaseState)this).GetAimRay();
			if (Object.op_Implicit((Object)(object)effectPrefab))
			{
				EffectManager.SimpleMuzzleFlash(effectPrefab, ((EntityState)this).gameObject, muzzleString, false);
			}
			if (((EntityState)this).isAuthority)
			{
				ProjectileManager.instance.FireProjectile(projectilePrefab, ((Ray)(ref aimRay)).origin, Util.QuaternionSafeLookRotation(((Ray)(ref aimRay)).direction), ((EntityState)this).gameObject, base.damageStat * damageCoefficient, 0f, Util.CheckRoll(base.critStat, ((EntityState)this).characterBody.master), (DamageColorIndex)0, (GameObject)null, -1f);
			}
		}

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			if (animator.GetFloat("FireGauntlet.fire") > 0f && !hasFiredGauntlet)
			{
				FireGauntlet();
			}
			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)1;
		}
	}
	public class MageIceNova : BaseState
	{
		public static GameObject impactEffectPrefab = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/EliteIce/AffixWhiteImpactEffect.prefab").WaitForCompletion();

		public static GameObject novaEffectPrefab = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/EliteIce/AffixWhiteExplosion.prefab").WaitForCompletion();

		public static float baseStartDuration = 0.3f;

		public static float baseEndDuration = 2f;

		public static float damageCoefficient = 6f;

		public static float procCoefficient = 1f;

		public static float force = 20f;

		public static float novaRadius = 15f;

		public static string attackString;

		private float stopwatch;

		private float startDuration;

		private float endDuration;

		private bool hasCastNova;

		public override void OnEnter()
		{
			//IL_0037: 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_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0063: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0090: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ca: Expected O, but got Unknown
			//IL_00d1: 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_00dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_010f: Expected O, but got Unknown
			((BaseState)this).OnEnter();
			stopwatch = 0f;
			endDuration = baseEndDuration / base.attackSpeedStat;
			startDuration = baseStartDuration / base.attackSpeedStat;
			BlastAttack val = new BlastAttack
			{
				radius = novaRadius,
				procCoefficient = procCoefficient,
				position = ((EntityState)this).transform.position,
				attacker = ((EntityState)this).gameObject,
				crit = Util.CheckRoll(((EntityState)this).characterBody.crit, ((EntityState)this).characterBody.master),
				baseDamage = ((EntityState)this).characterBody.damage * damageCoefficient,
				falloffModel = (FalloffModel)0,
				damageType = DamageTypeCombo.op_Implicit((DamageType)256),
				baseForce = force
			};
			val.teamIndex = TeamComponent.GetObjectTeam(val.attacker);
			val.Fire();
			EffectManager.SpawnEffect(novaEffectPrefab, new EffectData
			{
				origin = ((EntityState)this).transform.position,
				scale = novaRadius
			}, true);
			((EntityState)this).PlayAnimation("Gesture, Additive", "FireWall");
			((EntityState)this).outer.SetNextStateToMain();
		}

		public override void OnExit()
		{
			((EntityState)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)1;
		}
	}
}
namespace UnusedSkillMod.Modules
{
	internal class Content
	{
		internal static void AddCharacterBodyPrefab(GameObject bprefab)
		{
			ContentPacks.bodyPrefabs.Add(bprefab);
		}

		internal static void AddMasterPrefab(GameObject prefab)
		{
			ContentPacks.masterPrefabs.Add(prefab);
		}

		internal static void AddProjectilePrefab(GameObject prefab)
		{
			ContentPacks.projectilePrefabs.Add(prefab);
		}

		internal static void AddSurvivorDef(SurvivorDef survivorDef)
		{
			ContentPacks.survivorDefs.Add(survivorDef);
		}

		internal static void CreateSurvivor(GameObject bodyPrefab, GameObject displayPrefab, Color charColor, string tokenPrefix)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			CreateSurvivor(bodyPrefab, displayPrefab, charColor, tokenPrefix, null, 100f);
		}

		internal static void CreateSurvivor(GameObject bodyPrefab, GameObject displayPrefab, Color charColor, string tokenPrefix, float sortPosition)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			CreateSurvivor(bodyPrefab, displayPrefab, charColor, tokenPrefix, null, sortPosition);
		}

		internal static void CreateSurvivor(GameObject bodyPrefab, GameObject displayPrefab, Color charColor, string tokenPrefix, UnlockableDef unlockableDef)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			CreateSurvivor(bodyPrefab, displayPrefab, charColor, tokenPrefix, unlockableDef, 100f);
		}

		internal static void CreateSurvivor(GameObject bodyPrefab, GameObject displayPrefab, Color charColor, string tokenPrefix, UnlockableDef unlockableDef, float sortPosition)
		{
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			SurvivorDef val = ScriptableObject.CreateInstance<SurvivorDef>();
			val.bodyPrefab = bodyPrefab;
			val.displayPrefab = displayPrefab;
			val.primaryColor = charColor;
			val.cachedName = ((Object)bodyPrefab).name.Replace("Body", "");
			val.displayNameToken = tokenPrefix + "NAME";
			val.descriptionToken = tokenPrefix + "DESCRIPTION";
			val.outroFlavorToken = tokenPrefix + "OUTRO_FLAVOR";
			val.mainEndingEscapeFailureFlavorToken = tokenPrefix + "OUTRO_FAILURE";
			val.desiredSortPosition = sortPosition;
			val.unlockableDef = unlockableDef;
			AddSurvivorDef(val);
		}

		internal static void AddUnlockableDef(UnlockableDef unlockableDef)
		{
			ContentPacks.unlockableDefs.Add(unlockableDef);
		}

		internal static UnlockableDef CreateAndAddUnlockableDef(string identifier, string nameToken, Sprite achievementIcon)
		{
			UnlockableDef val = ScriptableObject.CreateInstance<UnlockableDef>();
			val.cachedName = identifier;
			val.nameToken = nameToken;
			val.achievementIcon = achievementIcon;
			AddUnlockableDef(val);
			return val;
		}

		internal static void AddSkillDef(SkillDef skillDef)
		{
			ContentPacks.skillDefs.Add(skillDef);
		}

		internal static void AddSkillFamily(SkillFamily skillFamily)
		{
			ContentPacks.skillFamilies.Add(skillFamily);
		}

		internal static void AddEntityState(Type entityState)
		{
			ContentPacks.entityStates.Add(entityState);
		}

		internal static void AddBuffDef(BuffDef buffDef)
		{
			ContentPacks.buffDefs.Add(buffDef);
		}

		internal static BuffDef CreateAndAddBuff(string buffName, Sprite buffIcon, Color buffColor, bool canStack, bool isDebuff, bool isCooldown)
		{
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			BuffDef val = ScriptableObject.CreateInstance<BuffDef>();
			((Object)val).name = buffName;
			val.buffColor = buffColor;
			val.canStack = canStack;
			val.isDebuff = isDebuff;
			val.isCooldown = isCooldown;
			val.eliteDef = null;
			val.iconSprite = buffIcon;
			AddBuffDef(val);
			return val;
		}

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

		internal static EffectDef CreateAndAddEffectDef(GameObject effectPrefab)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Expected O, but got Unknown
			EffectDef val = new EffectDef(effectPrefab);
			AddEffectDef(val);
			return val;
		}

		internal static void AddNetworkSoundEventDef(NetworkSoundEventDef networkSoundEventDef)
		{
			ContentPacks.networkSoundEventDefs.Add(networkSoundEventDef);
		}

		internal static NetworkSoundEventDef CreateAndAddNetworkSoundEventDef(string eventName)
		{
			NetworkSoundEventDef val = ScriptableObject.CreateInstance<NetworkSoundEventDef>();
			val.eventName = eventName;
			AddNetworkSoundEventDef(val);
			return val;
		}
	}
	internal class ContentPacks : IContentPackProvider
	{
		internal ContentPack contentPack = new ContentPack();

		public static List<GameObject> bodyPrefabs = new List<GameObject>();

		public static List<GameObject> masterPrefabs = new List<GameObject>();

		public static List<GameObject> projectilePrefabs = new List<GameObject>();

		public static List<SurvivorDef> survivorDefs = new List<SurvivorDef>();

		public static List<UnlockableDef> unlockableDefs = new List<UnlockableDef>();

		public static List<SkillFamily> skillFamilies = new List<SkillFamily>();

		public static List<SkillDef> skillDefs = new List<SkillDef>();

		public static List<Type> entityStates = new List<Type>();

		public static List<BuffDef> buffDefs = new List<BuffDef>();

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

		public static List<NetworkSoundEventDef> networkSoundEventDefs = new List<NetworkSoundEventDef>();

		public string identifier => "com.zebra.UnusedSkillMod";

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

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

		public IEnumerator LoadStaticContentAsync(LoadStaticContentAsyncArgs args)
		{
			contentPack.identifier = identifier;
			contentPack.bodyPrefabs.Add(bodyPrefabs.ToArray());
			contentPack.masterPrefabs.Add(masterPrefabs.ToArray());
			contentPack.projectilePrefabs.Add(projectilePrefabs.ToArray());
			contentPack.survivorDefs.Add(survivorDefs.ToArray());
			contentPack.unlockableDefs.Add(unlockableDefs.ToArray());
			contentPack.skillDefs.Add(skillDefs.ToArray());
			contentPack.skillFamilies.Add(skillFamilies.ToArray());
			contentPack.entityStateTypes.Add(entityStates.ToArray());
			contentPack.buffDefs.Add(buffDefs.ToArray());
			contentPack.effectDefs.Add(effectDefs.ToArray());
			contentPack.networkSoundEventDefs.Add(networkSoundEventDefs.ToArray());
			args.ReportProgress(1f);
			yield break;
		}

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

		public IEnumerator FinalizeAsync(FinalizeAsyncArgs args)
		{
			args.ReportProgress(1f);
			yield break;
		}
	}
}
namespace UnusedSkillMod.Content
{
	public static class UnusedSkillModAssets
	{
		internal static GameObject commandoTracer;

		internal static GameObject shootExplosion;

		internal static GameObject commandoStickyPrefab;

		internal static GameObject artiOrbPrefab;

		internal static GameObject engiImpactPrefab;

		internal static GameObject commandoHitEffectPrefab;

		internal static GameObject mageIceBlast;

		internal static GameObject mageIceMuzzle;

		public static void CreateEffects()
		{
			//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_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_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			shootExplosion = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Commando/OmniExplosionVFXCommandoGrenade.prefab").WaitForCompletion();
			ContentAddition.AddEffect(shootExplosion);
			mageIceBlast = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Common/VFX/IceCullExplosion.prefab").WaitForCompletion();
			ContentAddition.AddEffect(mageIceBlast);
			mageIceMuzzle = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Mage/MuzzleflashMageIceLarge.prefab").WaitForCompletion();
			ContentAddition.AddEffect(mageIceMuzzle);
		}

		public static void CreateProjectiles()
		{
			//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_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0067: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
			commandoStickyPrefab = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Junk/Commando/CommandoStickyGrenadeProjectile.prefab").WaitForCompletion(), "CommandoGrenadeClone");
			ProjectileImpactExplosion component = commandoStickyPrefab.GetComponent<ProjectileImpactExplosion>();
			((ProjectileExplosion)component).falloffModel = (FalloffModel)0;
			((ProjectileExplosion)component).explosionSoundString = "Play_commando_M2_grenade_explo";
			ProjectileStickOnImpact component2 = commandoStickyPrefab.gameObject.GetComponent<ProjectileStickOnImpact>();
			component2.ignoreWorld = false;
			UnusedSkillMod.Modules.Content.AddProjectilePrefab(commandoStickyPrefab);
			artiOrbPrefab = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Junk/Mage/MageIceBolt.prefab").WaitForCompletion(), "MageIceBoltClone");
			ProjectileSimple component3 = artiOrbPrefab.GetComponent<ProjectileSimple>();
			component3.velocity = 100f;
			ProjectileDamage componentInChildren = artiOrbPrefab.GetComponentInChildren<ProjectileDamage>();
			componentInChildren.damageType = DamageTypeCombo.op_Implicit((DamageType)8);
			ProjectileImpactExplosion component4 = artiOrbPrefab.GetComponent<ProjectileImpactExplosion>();
			((ProjectileExplosion)component4).falloffModel = (FalloffModel)1;
			((ProjectileExplosion)component4).blastRadius = 4f;
			component4.impactEffect = mageIceBlast;
			UnusedSkillMod.Modules.Content.AddProjectilePrefab(artiOrbPrefab);
		}
	}
}