Decompiled source of DoomSkills v1.0.0

DoomSkills.dll

Decompiled a month ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using EntityStates;
using EntityStates.Bandit2.Weapon;
using EntityStates.Merc;
using On.RoR2.UI;
using R2API;
using R2API.Utils;
using Rewired.ComponentControls.Effects;
using RoR2;
using RoR2.Projectile;
using RoR2.Skills;
using RoR2.UI;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.Networking;

[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.0", FrameworkDisplayName = "")]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: CompilationRelaxations(8)]
[assembly: AssemblyCompany("DoomSkills")]
[assembly: AssemblyProduct("DoomSkills")]
[assembly: AssemblyTitle("DoomSkills")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace DoomSkills;

internal class Assets
{
	public static AssetBundle MainAssetBundle;

	public static T Load<T>(string name) where T : Object
	{
		return MainAssetBundle.LoadAsset<T>(name);
	}

	public static void PopulateAssets()
	{
		Assembly executingAssembly = Assembly.GetExecutingAssembly();
		if ((Object)(object)MainAssetBundle == (Object)null)
		{
			using Stream stream = executingAssembly.GetManifestResourceStream("DoomSkills.AssetBundle." + "DoomSkills".ToLower() + "assets");
			MainAssetBundle = AssetBundle.LoadFromStream(stream);
		}
		using Stream stream2 = executingAssembly.GetManifestResourceStream("DoomSkills.DoomSkills.bnk");
		byte[] array = new byte[stream2.Length];
		stream2.Read(array, 0, array.Length);
		SoundBanks.Add(array);
	}
}
internal class Behaviour : NetworkBehaviour
{
	private Animator animator;

	private SkillLocator skillLocator;

	private static int kCmdCmdUpdateAnimator;

	private static int kRpcRpcUpdateAnimator;

	private static int kCmdCmdPlaySound;

	private static int kRpcRpcPlaySound;

	private static int kRpcRpcReset;

	private void Start()
	{
		animator = ((Component)((Component)this).GetComponent<ModelLocator>().modelTransform).GetComponent<Animator>();
		skillLocator = ((Component)this).GetComponent<SkillLocator>();
	}

	[Command]
	public void CmdUpdateAnimator()
	{
		CallRpcUpdateAnimator();
	}

	[ClientRpc]
	public void RpcUpdateAnimator()
	{
		animator.SetFloat("SlashBlade.playbackRate", animator.GetFloat("SlashBlade.playbackRate") * 2f);
	}

	[Command]
	public void CmdPlaySound(uint ID)
	{
		CallRpcPlaySound(ID);
	}

	[ClientRpc]
	public void RpcPlaySound(uint ID)
	{
		AkSoundEngine.PostEvent(ID, ((Component)this).gameObject);
	}

	[ClientRpc]
	public void RpcReset()
	{
		skillLocator.secondary.RunRecharge(99f);
	}

	private void UNetVersion()
	{
	}

	protected static void InvokeCmdCmdUpdateAnimator(NetworkBehaviour obj, NetworkReader reader)
	{
		if (!NetworkServer.active)
		{
			Debug.LogError((object)"Command CmdUpdateAnimator called on client.");
		}
		else
		{
			((Behaviour)(object)obj).CmdUpdateAnimator();
		}
	}

	protected static void InvokeCmdCmdPlaySound(NetworkBehaviour obj, NetworkReader reader)
	{
		if (!NetworkServer.active)
		{
			Debug.LogError((object)"Command CmdPlaySound called on client.");
		}
		else
		{
			((Behaviour)(object)obj).CmdPlaySound(reader.ReadPackedUInt32());
		}
	}

	public void CallCmdUpdateAnimator()
	{
		//IL_0029: Unknown result type (might be due to invalid IL or missing references)
		//IL_002f: Expected O, but got Unknown
		//IL_0054: Unknown result type (might be due to invalid IL or missing references)
		if (!NetworkClient.active)
		{
			Debug.LogError((object)"Command function CmdUpdateAnimator called on server.");
			return;
		}
		if (((NetworkBehaviour)this).isServer)
		{
			CmdUpdateAnimator();
			return;
		}
		NetworkWriter val = new NetworkWriter();
		val.Write((short)0);
		val.Write((short)5);
		val.WritePackedUInt32((uint)kCmdCmdUpdateAnimator);
		val.Write(((Component)this).GetComponent<NetworkIdentity>().netId);
		((NetworkBehaviour)this).SendCommandInternal(val, 0, "CmdUpdateAnimator");
	}

	public void CallCmdPlaySound(uint ID)
	{
		//IL_002d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0033: Expected O, but got Unknown
		//IL_0058: Unknown result type (might be due to invalid IL or missing references)
		if (!NetworkClient.active)
		{
			Debug.LogError((object)"Command function CmdPlaySound called on server.");
			return;
		}
		if (((NetworkBehaviour)this).isServer)
		{
			CmdPlaySound(ID);
			return;
		}
		NetworkWriter val = new NetworkWriter();
		val.Write((short)0);
		val.Write((short)5);
		val.WritePackedUInt32((uint)kCmdCmdPlaySound);
		val.Write(((Component)this).GetComponent<NetworkIdentity>().netId);
		val.WritePackedUInt32(ID);
		((NetworkBehaviour)this).SendCommandInternal(val, 0, "CmdPlaySound");
	}

	protected static void InvokeRpcRpcUpdateAnimator(NetworkBehaviour obj, NetworkReader reader)
	{
		if (!NetworkClient.active)
		{
			Debug.LogError((object)"RPC RpcUpdateAnimator called on server.");
		}
		else
		{
			((Behaviour)(object)obj).RpcUpdateAnimator();
		}
	}

	protected static void InvokeRpcRpcPlaySound(NetworkBehaviour obj, NetworkReader reader)
	{
		if (!NetworkClient.active)
		{
			Debug.LogError((object)"RPC RpcPlaySound called on server.");
		}
		else
		{
			((Behaviour)(object)obj).RpcPlaySound(reader.ReadPackedUInt32());
		}
	}

	protected static void InvokeRpcRpcReset(NetworkBehaviour obj, NetworkReader reader)
	{
		if (!NetworkClient.active)
		{
			Debug.LogError((object)"RPC RpcReset called on server.");
		}
		else
		{
			((Behaviour)(object)obj).RpcReset();
		}
	}

	public void CallRpcUpdateAnimator()
	{
		//IL_0016: Unknown result type (might be due to invalid IL or missing references)
		//IL_001c: Expected O, but got Unknown
		//IL_0041: Unknown result type (might be due to invalid IL or missing references)
		if (!NetworkServer.active)
		{
			Debug.LogError((object)"RPC Function RpcUpdateAnimator called on client.");
			return;
		}
		NetworkWriter val = new NetworkWriter();
		val.Write((short)0);
		val.Write((short)2);
		val.WritePackedUInt32((uint)kRpcRpcUpdateAnimator);
		val.Write(((Component)this).GetComponent<NetworkIdentity>().netId);
		((NetworkBehaviour)this).SendRPCInternal(val, 0, "RpcUpdateAnimator");
	}

	public void CallRpcPlaySound(uint ID)
	{
		//IL_0016: Unknown result type (might be due to invalid IL or missing references)
		//IL_001c: Expected O, but got Unknown
		//IL_0041: Unknown result type (might be due to invalid IL or missing references)
		if (!NetworkServer.active)
		{
			Debug.LogError((object)"RPC Function RpcPlaySound called on client.");
			return;
		}
		NetworkWriter val = new NetworkWriter();
		val.Write((short)0);
		val.Write((short)2);
		val.WritePackedUInt32((uint)kRpcRpcPlaySound);
		val.Write(((Component)this).GetComponent<NetworkIdentity>().netId);
		val.WritePackedUInt32(ID);
		((NetworkBehaviour)this).SendRPCInternal(val, 0, "RpcPlaySound");
	}

	public void CallRpcReset()
	{
		//IL_0016: Unknown result type (might be due to invalid IL or missing references)
		//IL_001c: Expected O, but got Unknown
		//IL_0041: Unknown result type (might be due to invalid IL or missing references)
		if (!NetworkServer.active)
		{
			Debug.LogError((object)"RPC Function RpcReset called on client.");
			return;
		}
		NetworkWriter val = new NetworkWriter();
		val.Write((short)0);
		val.Write((short)2);
		val.WritePackedUInt32((uint)kRpcRpcReset);
		val.Write(((Component)this).GetComponent<NetworkIdentity>().netId);
		((NetworkBehaviour)this).SendRPCInternal(val, 0, "RpcReset");
	}

	static Behaviour()
	{
		//IL_0020: Unknown result type (might be due to invalid IL or missing references)
		//IL_002a: Expected O, but got Unknown
		//IL_004a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0054: Expected O, but got Unknown
		//IL_0074: Unknown result type (might be due to invalid IL or missing references)
		//IL_007e: Expected O, but got Unknown
		//IL_009e: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a8: Expected O, but got Unknown
		//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d2: Expected O, but got Unknown
		kCmdCmdUpdateAnimator = -1259881203;
		NetworkBehaviour.RegisterCommandDelegate(typeof(Behaviour), kCmdCmdUpdateAnimator, new CmdDelegate(InvokeCmdCmdUpdateAnimator));
		kCmdCmdPlaySound = -189157922;
		NetworkBehaviour.RegisterCommandDelegate(typeof(Behaviour), kCmdCmdPlaySound, new CmdDelegate(InvokeCmdCmdPlaySound));
		kRpcRpcUpdateAnimator = 1609003619;
		NetworkBehaviour.RegisterRpcDelegate(typeof(Behaviour), kRpcRpcUpdateAnimator, new CmdDelegate(InvokeRpcRpcUpdateAnimator));
		kRpcRpcPlaySound = -1782089016;
		NetworkBehaviour.RegisterRpcDelegate(typeof(Behaviour), kRpcRpcPlaySound, new CmdDelegate(InvokeRpcRpcPlaySound));
		kRpcRpcReset = -1604339620;
		NetworkBehaviour.RegisterRpcDelegate(typeof(Behaviour), kRpcRpcReset, new CmdDelegate(InvokeRpcRpcReset));
		NetworkCRC.RegisterBehaviour("Behaviour", 0);
	}

	public override bool OnSerialize(NetworkWriter writer, bool forceAll)
	{
		bool result = default(bool);
		return result;
	}

	public override void OnDeserialize(NetworkReader reader, bool initialState)
	{
	}
}
internal class Hook
{
	internal static void Hooks()
	{
		//IL_0008: Unknown result type (might be due to invalid IL or missing references)
		//IL_0012: Expected O, but got Unknown
		//IL_002c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0036: Expected O, but got Unknown
		RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(RecalculateStatsAPI_GetStatCoefficients);
		GlobalEventManager.onServerDamageDealt += GlobalEventManager_onServerDamageDealt;
		Row.FromSkin += new hook_FromSkin(Row_FromSkin);
		GlobalEventManager.onCharacterDeathGlobal += GlobalEventManager_onCharacterDeathGlobal;
	}

	private static void GlobalEventManager_onCharacterDeathGlobal(DamageReport damageReport)
	{
		//IL_002a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0051: Unknown result type (might be due to invalid IL or missing references)
		//IL_0056: Unknown result type (might be due to invalid IL or missing references)
		//IL_0081: 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)
		//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
		if (Object.op_Implicit((Object)(object)damageReport.attackerBody) && Object.op_Implicit((Object)(object)damageReport.victimBody) && DamageAPI.HasModdedDamageType(damageReport.damageInfo, Prefabs.orb))
		{
			GameObject val = Object.Instantiate<GameObject>(Prefabs.Load<GameObject>("RoR2/Base/Tooth/HealPack.prefab"), damageReport.victimBody.transform.position, Random.rotation);
			TeamFilter component = val.GetComponent<TeamFilter>();
			if (Object.op_Implicit((Object)(object)component))
			{
				component.teamIndex = damageReport.attackerBody.teamComponent.teamIndex;
			}
			HealthPickup componentInChildren = val.GetComponentInChildren<HealthPickup>();
			if (Object.op_Implicit((Object)(object)componentInChildren))
			{
				componentInChildren.flatHealing = 8f;
				componentInChildren.fractionalHealing = 0.02f;
			}
			val.transform.localScale = Vector3.one * 0.25f;
			NetworkServer.Spawn(val);
			float num = 0f;
			RigidbodyMotor component2 = ((Component)damageReport.victimBody).GetComponent<RigidbodyMotor>();
			if (Object.op_Implicit((Object)(object)damageReport.victimBody.characterMotor))
			{
				num = damageReport.victimBody.characterMotor.mass;
			}
			else if (Object.op_Implicit((Object)(object)component2))
			{
				num = component2.mass;
			}
			if (num >= 250f || damageReport.victimBody.isBoss)
			{
				((Component)damageReport.attackerBody).GetComponent<Behaviour>().CallRpcReset();
			}
		}
	}

	private static object Row_FromSkin(orig_FromSkin orig, LoadoutPanelController owner, BodyIndex bodyIndex)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_007b: Unknown result type (might be due to invalid IL or missing references)
		CharacterBody bodyPrefabBodyComponent = BodyCatalog.GetBodyPrefabBodyComponent(bodyIndex);
		if (Object.op_Implicit((Object)(object)bodyPrefabBodyComponent) && bodyPrefabBodyComponent.baseNameToken == "BANDIT2_BODY_NAME")
		{
			LanguageTextMeshController[] componentsInChildren = ((Component)owner).GetComponentsInChildren<LanguageTextMeshController>();
			for (int i = 0; i < componentsInChildren.Length; i++)
			{
				if (componentsInChildren[i].token == "LOADOUT_SKILL_MISC")
				{
					((Component)componentsInChildren[i]).transform.parent.parent.SetAsFirstSibling();
					break;
				}
			}
		}
		return orig.Invoke(owner, bodyIndex);
	}

	private static void GlobalEventManager_onServerDamageDealt(DamageReport damageReport)
	{
		//IL_0017: Unknown result type (might be due to invalid IL or missing references)
		if (Object.op_Implicit((Object)(object)damageReport.attackerBody) && DamageAPI.HasModdedDamageType(damageReport.damageInfo, Prefabs.shield))
		{
			HealthComponent healthComponent = damageReport.attackerBody.healthComponent;
			healthComponent.AddBarrier(healthComponent.fullCombinedHealth * 0.05f);
		}
	}

	private static void RecalculateStatsAPI_GetStatCoefficients(CharacterBody sender, StatHookEventArgs args)
	{
		//IL_005c: Unknown result type (might be due to invalid IL or missing references)
		//IL_007c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0086: Unknown result type (might be due to invalid IL or missing references)
		//IL_0087: Unknown result type (might be due to invalid IL or missing references)
		if (Object.op_Implicit((Object)(object)sender.inventory) && sender.inventory.GetItemCount(Prefabs.passiveItem) > 0)
		{
			args.healthMultAdd += 0.5f;
			args.critDamageMultAdd += sender.crit / 10f;
			sender.baseJumpCount = 2;
			if (((Enum)sender.bodyFlags).HasFlag((Enum)(object)(BodyFlags)128))
			{
				sender.bodyFlags = (BodyFlags)(sender.bodyFlags & -129);
			}
		}
	}
}
[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.*/)]
[NetworkCompatibility(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInPlugin("com.Dragonyck.DoomSkills", "DoomSkills", "1.0.0")]
public class MainPlugin : BaseUnityPlugin
{
	public const string MODUID = "com.Dragonyck.DoomSkills";

	public const string MODNAME = "DoomSkills";

	public const string VERSION = "1.0.0";

	public const string MODNAMEKEY = "DOOMSKILLS";

	public static GameObject characterPrefab;

	private void Awake()
	{
		Assets.PopulateAssets();
		Prefabs.CreatePrefabs();
		SetupSkills();
		RegisterStates();
		Hook.Hooks();
	}

	internal void SetupSkills()
	{
		//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_0048: Unknown result type (might be due to invalid IL or missing references)
		//IL_005c: Unknown result type (might be due to invalid IL or missing references)
		characterPrefab = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Bandit2/Bandit2Body.prefab").WaitForCompletion();
		characterPrefab.AddComponent<Behaviour>();
		Transform modelTransform = characterPrefab.GetComponent<ModelLocator>().modelTransform;
		Utils.CreateHitbox("Punch", modelTransform, new Vector3(4.8f, 6f, 9f), new Vector3(0f, 1.2f, 2f));
		SkillSetup();
	}

	private void RegisterStates()
	{
		//IL_0003: 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_0013: Unknown result type (might be due to invalid IL or missing references)
		//IL_001b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0023: 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_0033: 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)
		bool flag = default(bool);
		ContentAddition.AddEntityState<Primary>(ref flag);
		ContentAddition.AddEntityState<Reload>(ref flag);
		ContentAddition.AddEntityState<Secondary>(ref flag);
		ContentAddition.AddEntityState<Utility>(ref flag);
		ContentAddition.AddEntityState<Special>(ref flag);
		ContentAddition.AddEntityState<CharacterMain>(ref flag);
		ContentAddition.AddEntityState<MeleeSkillState>(ref flag);
		ContentAddition.AddEntityState<BasicMeleeSkillState>(ref flag);
	}

	private void SkillSetup()
	{
		PassiveSetup();
		PrimarySetup();
		SecondarySetup();
		UtilitySetup();
		SpecialSetup();
	}

	private void PassiveSetup()
	{
		//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
		SkillLocator component = characterPrefab.GetComponent<SkillLocator>();
		component.passiveSkill.enabled = false;
		SkillDef skill = Utils.NewSkillDef<SkillDef>(typeof(Idle), "Weapon", 0, 0f, beginSkillCooldownOnSkillEnd: true, canceledFromSprinting: false, fullRestockOnAssign: true, (InterruptPriority)0, isCombatSkill: true, mustKeyPress: false, cancelSprintingOnActivation: true, 0, 0, 0, component.passiveSkill.icon, "BANDIT2_PASSIVE_DESCRIPTION", "BANDIT2_PASSIVE_NAME", Array.Empty<string>());
		GenericSkill val = Utils.NewGenericSkill(characterPrefab, skill);
		LanguageAPI.Add("DOOMSKILLS_PASSIVE", "Rip and Tear");
		LanguageAPI.Add("DOOMSKILLS_PASSIVE_DESCRIPTION", "<style=cIsDamage>Critical damage</style> scales with <style=cIsDamage>critical chance</style> and gain an additional <style=cIsHealth>50% max health</style>. Can <style=cIsUtility>jump twice</style>.");
		skill = Utils.NewSkillDef<PassiveItemSkillDef>(typeof(Idle), "Weapon", 0, 0f, beginSkillCooldownOnSkillEnd: true, canceledFromSprinting: false, fullRestockOnAssign: true, (InterruptPriority)0, isCombatSkill: true, mustKeyPress: false, cancelSprintingOnActivation: true, 0, 0, 0, Assets.MainAssetBundle.LoadAsset<Sprite>("passive"), "DOOMSKILLS_PASSIVE_DESCRIPTION", "DOOMSKILLS_PASSIVE", Array.Empty<string>());
		((PassiveItemSkillDef)skill).passiveItem = Prefabs.passiveItem;
		Utils.AddAlt(val.skillFamily, skill);
	}

	private void PrimarySetup()
	{
		SkillLocator component = characterPrefab.GetComponent<SkillLocator>();
		LanguageAPI.Add("DOOMSKILLS_M1", "Super Shotgun");
		LanguageAPI.Add("DOOMSKILLS_M1_DESCRIPTION", "Fire 2 shells at once in a wide spread for <style=cIsDamage>12x100% damage</style> per pellet. ");
		SkillDef skillDef = Utils.NewSkillDef<SkillDef>(typeof(Primary), "Weapon", 2, 1.2f, beginSkillCooldownOnSkillEnd: false, canceledFromSprinting: false, fullRestockOnAssign: true, (InterruptPriority)0, isCombatSkill: true, mustKeyPress: false, cancelSprintingOnActivation: true, 2, 2, 2, Assets.MainAssetBundle.LoadAsset<Sprite>("primary"), "DOOMSKILLS_M1_DESCRIPTION", "DOOMSKILLS_M1", Array.Empty<string>());
		Utils.AddAlt(component.primary.skillFamily, skillDef);
	}

	private void SecondarySetup()
	{
		SkillLocator component = characterPrefab.GetComponent<SkillLocator>();
		LanguageAPI.Add("DOOMSKILLS_M2", "Blood Punch");
		LanguageAPI.Add("DOOMSKILLS_M2_DESCRIPTION", "<style=cIsDamage>Critical.</style>Unleash a devastating punch for <style=cIsDamage>2x200% damage</style>. Any enemies caught in the shockwave after the first target is struck take <style=cIsDamage>2x50% damage</style> in the shockwave. Monsters slain by Blood Punch drop <style=cIsHealing>healing orbs</style>. Large monsters slain with blood punch will instantly <style=cIsDamage>replenish</style> the move.");
		SkillDef skillDef = Utils.NewSkillDef<SkillDef>(typeof(Secondary), "Weapon", 1, 4f, beginSkillCooldownOnSkillEnd: false, canceledFromSprinting: false, fullRestockOnAssign: false, (InterruptPriority)1, isCombatSkill: true, mustKeyPress: true, cancelSprintingOnActivation: true, 1, 1, 1, Assets.MainAssetBundle.LoadAsset<Sprite>("secondary"), "DOOMSKILLS_M2_DESCRIPTION", "DOOMSKILLS_M2", Array.Empty<string>());
		Utils.AddAlt(component.secondary.skillFamily, skillDef);
	}

	private void UtilitySetup()
	{
		SkillLocator component = characterPrefab.GetComponent<SkillLocator>();
		LanguageAPI.Add("DOOMSKILLS_UTIL", "Dash");
		LanguageAPI.Add("DOOMSKILLS_UTIL_DESCRIPTION", "<style=cIsDamage>Untouchable</style>. Perform a short dash in any direction, becoming <style=cIsDamage>invincible</style> for the duration.");
		SkillDef skillDef = Utils.NewSkillDef<SkillDef>(typeof(Utility), "Stealth", 2, 2f, beginSkillCooldownOnSkillEnd: true, canceledFromSprinting: false, fullRestockOnAssign: false, (InterruptPriority)0, isCombatSkill: true, mustKeyPress: true, cancelSprintingOnActivation: false, 2, 1, 1, Assets.MainAssetBundle.LoadAsset<Sprite>("utility"), "DOOMSKILLS_UTIL_DESCRIPTION", "DOOMSKILLS_UTIL", Array.Empty<string>());
		Utils.AddAlt(component.utility.skillFamily, skillDef);
	}

	private void SpecialSetup()
	{
		SkillLocator component = characterPrefab.GetComponent<SkillLocator>();
		LanguageAPI.Add("DOOMSKILLS_SPEC", "Frag Grenade");
		LanguageAPI.Add("DOOMSKILLS_SPEC_DESCRIPTION", "<style=cIsHealing>Shielding</style>. Toss a frag grenade from your shoulder cannon, dealing damage in a wide radius for <style=cIsDamage>500% damage</style> and stunning any surviving monster. Enemies hit grant <style=cIsHealing>5% max hp</style> fading <style=cIsHealing>barrier</style>.");
		SkillDef skillDef = Utils.NewSkillDef<SkillDef>(typeof(Special), "Stealth", 1, 8f, beginSkillCooldownOnSkillEnd: true, canceledFromSprinting: false, fullRestockOnAssign: false, (InterruptPriority)0, isCombatSkill: true, mustKeyPress: true, cancelSprintingOnActivation: false, 1, 1, 1, Assets.MainAssetBundle.LoadAsset<Sprite>("special"), "DOOMSKILLS_SPEC_DESCRIPTION", "DOOMSKILLS_SPEC", Array.Empty<string>());
		Utils.AddAlt(component.special.skillFamily, skillDef);
	}
}
internal class Prefabs
{
	internal static GameObject grenadeGhost;

	internal static GameObject grenade;

	internal static GameObject beamProjectileGhost;

	internal static GameObject beamProjectile;

	internal static GameObject dashEffect;

	internal static GameObject swingEffect;

	internal static ItemDef passiveItem;

	internal static ModdedDamageType shield;

	internal static ModdedDamageType orb;

	internal static T Load<T>(string path)
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		return Addressables.LoadAssetAsync<T>((object)path).WaitForCompletion();
	}

	internal static GameObject Instantiate(string path, string name, bool registerNetwork = false)
	{
		return PrefabAPI.InstantiateClone(Load<GameObject>(path), name, registerNetwork);
	}

	internal static void CreatePrefabs()
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//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_0010: Unknown result type (might be due to invalid IL or missing references)
		//IL_0062: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e0: Expected O, but got Unknown
		//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
		//IL_018d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0197: Expected O, but got Unknown
		//IL_01a3: Unknown result type (might be due to invalid IL or missing references)
		//IL_01d1: Unknown result type (might be due to invalid IL or missing references)
		//IL_01db: Expected O, but got Unknown
		//IL_01e8: 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_021e: Expected O, but got Unknown
		//IL_022a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0256: Unknown result type (might be due to invalid IL or missing references)
		//IL_0279: Unknown result type (might be due to invalid IL or missing references)
		//IL_02d2: Unknown result type (might be due to invalid IL or missing references)
		//IL_033d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0344: Expected O, but got Unknown
		//IL_0362: Unknown result type (might be due to invalid IL or missing references)
		//IL_036c: Unknown result type (might be due to invalid IL or missing references)
		//IL_03a3: Unknown result type (might be due to invalid IL or missing references)
		//IL_03c4: Unknown result type (might be due to invalid IL or missing references)
		//IL_03e4: Unknown result type (might be due to invalid IL or missing references)
		//IL_03ee: Expected O, but got Unknown
		//IL_03fb: Unknown result type (might be due to invalid IL or missing references)
		//IL_0497: Unknown result type (might be due to invalid IL or missing references)
		//IL_053d: Unknown result type (might be due to invalid IL or missing references)
		shield = DamageAPI.ReserveDamageType();
		orb = DamageAPI.ReserveDamageType();
		passiveItem = ScriptableObject.CreateInstance<ItemDef>();
		((Object)passiveItem).name = "DoomSkillsPassiveItem";
		passiveItem.nameToken = "DOOMSKILLS_ITEM_NAME";
		passiveItem.pickupToken = "DOOMSKILLS_ITEM_DESCRIPTION";
		passiveItem.loreToken = "DOOMSKILLS_ITEM_DESCRIPTION";
		passiveItem.deprecatedTier = (ItemTier)5;
		passiveItem.tier = (ItemTier)5;
		ItemDef obj = passiveItem;
		ItemTag[] array = new ItemTag[6];
		RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/);
		obj.tags = (ItemTag[])(object)array;
		passiveItem.canRemove = false;
		passiveItem.hidden = true;
		ContentAddition.AddItemDef(passiveItem);
		swingEffect = Instantiate("RoR2/Base/Merc/MercSwordSlash.prefab", "SwingEffect");
		ParticleSystemRenderer componentInChildren = swingEffect.GetComponentInChildren<ParticleSystemRenderer>();
		((Renderer)componentInChildren).material = new Material(((Renderer)componentInChildren).material);
		((Renderer)componentInChildren).material.SetColor("_TintColor", Color.red);
		((Renderer)componentInChildren).material.SetTexture("_RemapTex", (Texture)(object)Load<Texture2D>("RoR2/Base/Common/ColorRamps/texRampArtifactShellSoft.png"));
		((Renderer)componentInChildren).material.SetFloat("_AlphaBias", 0f);
		dashEffect = Instantiate("RoR2/Base/Vulture/VultureJumpEffect.prefab", "DashEffect");
		((Component)dashEffect.GetComponentsInChildren<ParticleSystem>()[^1]).gameObject.SetActive(false);
		ContentAddition.AddEffect(dashEffect);
		grenadeGhost = Instantiate("RoR2/Base/Commando/CommandoGrenadeGhost.prefab", "GrenadeGhost");
		MeshRenderer componentInChildren2 = grenadeGhost.GetComponentInChildren<MeshRenderer>();
		((Renderer)componentInChildren2).material = new Material(((Renderer)componentInChildren2).material);
		((Renderer)componentInChildren2).material.SetColor("_Color", Color.red);
		ParticleSystemRenderer[] componentsInChildren = grenadeGhost.GetComponentsInChildren<ParticleSystemRenderer>();
		foreach (ParticleSystemRenderer val in componentsInChildren)
		{
			((Renderer)val).material = new Material(((Renderer)val).material);
			((Renderer)val).material.SetColor("_TintColor", Color.red);
		}
		TrailRenderer componentInChildren3 = grenadeGhost.GetComponentInChildren<TrailRenderer>();
		((Renderer)componentInChildren3).material = new Material(((Renderer)componentInChildren3).material);
		((Renderer)componentInChildren3).material.SetColor("_TintColor", Color.red);
		grenade = Instantiate("RoR2/Base/Commando/CommandoGrenadeProjectile.prefab", "Grenade", registerNetwork: true);
		grenade.GetComponent<ProjectileDamage>().damageType = (DamageType)32;
		grenade.GetComponent<ProjectileController>().ghostPrefab = grenadeGhost;
		grenade.AddComponent<ModdedDamageTypeHolderComponent>().Add(shield);
		ProjectileImpactExplosion component = grenade.GetComponent<ProjectileImpactExplosion>();
		component.lifetimeAfterImpact = 0.75f;
		((ProjectileExplosion)component).blastRadius = 15f;
		ContentAddition.AddProjectile(grenade);
		beamProjectileGhost = Instantiate("RoR2/Base/Merc/EvisProjectileGhost.prefab", "BeamGhost");
		beamProjectileGhost.GetComponentInChildren<Light>().color = Color.red;
		ParticleSystemRenderer[] componentsInChildren2 = beamProjectileGhost.GetComponentsInChildren<ParticleSystemRenderer>();
		ParticleSystemRenderer[] array2 = componentsInChildren2;
		foreach (ParticleSystemRenderer val2 in array2)
		{
			((Component)val2).gameObject.SetActive(false);
		}
		GameObject val3 = new GameObject("beamMesh", new Type[2]
		{
			typeof(MeshFilter),
			typeof(MeshRenderer)
		});
		val3.transform.parent = beamProjectileGhost.transform;
		val3.transform.localPosition = Vector3.forward * -3f;
		val3.GetComponent<MeshFilter>().mesh = componentsInChildren2[0].mesh;
		val3.transform.localRotation = Quaternion.Euler(-90f, 0f, 0f);
		val3.transform.localScale = new Vector3(8f, 8f, 4f);
		MeshRenderer component2 = val3.GetComponent<MeshRenderer>();
		((Renderer)component2).material = new Material(Load<Material>("RoR2/DLC1/MissileVoid/matMissileVoidFlare.mat"));
		((Renderer)component2).material.SetColor("_TintColor", Color.red);
		((Renderer)component2).material.SetTexture("_RemapTex", (Texture)(object)Load<Texture2D>("RoR2/Base/Common/ColorRamps/texRampNearbyDamageBonus.png"));
		ObjectScaleCurve val4 = Utils.AddScaleComponent(beamProjectileGhost, 0.25f, AnimationCurve.Linear(0f, 1f, 1f, 0f));
		val4.overallCurve.AddKey(0.65f, 1f);
		beamProjectile = Instantiate("RoR2/Junk/Commando/FMJ.prefab", "Beam", registerNetwork: true);
		beamProjectile.transform.GetChild(0).localScale = new Vector3(14f, 4f, 8f);
		for (int k = 0; k < beamProjectile.transform.childCount; k++)
		{
			if (k != 0)
			{
				((Component)beamProjectile.transform.GetChild(k)).gameObject.SetActive(false);
			}
		}
		beamProjectile.GetComponent<ProjectileSimple>().lifetime = 0.25f;
		beamProjectile.GetComponent<ProjectileController>().ghostPrefab = beamProjectileGhost;
		beamProjectile.GetComponent<ProjectileOverlapAttack>().impactEffect = Load<GameObject>("RoR2/Base/Common/VFX/OmniImpactVFXLarge.prefab");
		beamProjectile.AddComponent<ModdedDamageTypeHolderComponent>().Add(orb);
		ContentAddition.AddProjectile(beamProjectile);
	}
}
internal class BasicMeleeSkillState : BaseSkillState
{
	private OverlapAttack attack;

	private GameObject hitEffectPrefab = null;

	public Animator animator;

	public bool hasHit;

	public virtual float damageCoefficient => 0f;

	public virtual string hitboxGroupName => "";

	public override void OnEnter()
	{
		//IL_0032: Unknown result type (might be due to invalid IL or missing references)
		//IL_0049: Unknown result type (might be due to invalid IL or missing references)
		//IL_0053: Unknown result type (might be due to invalid IL or missing references)
		//IL_0058: Unknown result type (might be due to invalid IL or missing references)
		((BaseState)this).OnEnter();
		attack = ((BaseState)this).InitMeleeOverlap(damageCoefficient, hitEffectPrefab, ((EntityState)this).GetModelTransform(), hitboxGroupName);
		DamageAPI.AddModdedDamageType(attack, Prefabs.orb);
		attack.forceVector = ((EntityState)this).characterDirection.forward * 2240f;
		attack.isCrit = true;
	}

	public override void FixedUpdate()
	{
		((EntityState)this).FixedUpdate();
		if (((EntityState)this).isAuthority && attack.Fire((List<HurtBox>)null))
		{
			hasHit = true;
		}
	}

	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;
	}
}
internal class CharacterMain : GenericCharacterMain
{
}
internal class MeleeSkillState : BaseSkillState
{
	public float attackDuration;

	public float earlyExitDuration;

	private bool hopped;

	private bool hasSwung;

	public bool isInHitPause;

	public float hitPauseDuration;

	public float hopVelocity;

	public float hitPauseTimer;

	public float stopwatch;

	public HitStopCachedState hitStopCachedState;

	public OverlapAttack overlapAttack;

	public bool hasHit;

	private bool hasAnimParameter;

	private float attackSpeedScaling;

	public Animator animator;

	public virtual float baseAttackDuration => 0f;

	public virtual float baseEarlyExitDuration => 0f;

	public virtual float damageCoefficient => 0f;

	public virtual float forceMagnitude => 440f;

	public virtual float rootMotionSpeed => 25f;

	public virtual float baseHopVelocity => 4f;

	public virtual string layerName => "FullBody, Override";

	public virtual string animationStateName => "";

	public virtual string animParameter => "M1";

	public virtual string hitBoxGroupName => animationStateName;

	public virtual string hitBoxActiveParameter => "Curve";

	public virtual string swingMuzzle => animationStateName + "Muzzle";

	public virtual GameObject swingEffectPrefab => null;

	public virtual bool hopOnHit => true;

	public virtual bool rootMotion => true;

	public virtual bool rootMotionWhileHitting => false;

	public virtual uint swingSound => 0u;

	public virtual DamageType damageType => (DamageType)0;

	public virtual DamageColorIndex damageColor => (DamageColorIndex)0;

	public virtual Vector3 bonusForce => Vector3.zero;

	public virtual GameObject hitEffectPrefab => null;

	public override void OnEnter()
	{
		((BaseState)this).OnEnter();
		attackSpeedScaling = Math.Min(((BaseState)this).attackSpeedStat, 6f);
		attackDuration = baseAttackDuration / attackSpeedScaling;
		earlyExitDuration = baseEarlyExitDuration / attackSpeedScaling;
		hitPauseDuration = GroundLight.hitPauseDuration / attackSpeedScaling;
		hopVelocity = baseHopVelocity / attackSpeedScaling;
		((EntityState)this).PlayAnimation(layerName, "BufferEmpty");
		animator = ((EntityState)this).GetModelAnimator();
		animator.SetFloat(hitBoxActiveParameter, 0f);
		((BaseState)this).StartAimMode(attackDuration + 1f, false);
		overlapAttack = ((BaseState)this).InitMeleeOverlap(damageCoefficient, hitEffectPrefab, ((EntityState)this).GetModelTransform(), hitBoxGroupName);
		overlapAttack.pushAwayForce = 1f;
		hasAnimParameter = !Utility.IsNullOrWhiteSpace(animParameter);
		if (hasAnimParameter && !Utility.IsNullOrWhiteSpace(animationStateName))
		{
			((EntityState)this).PlayCrossfade(layerName, animationStateName, animParameter, attackDuration, 0.1f);
		}
	}

	public virtual Vector3 rootMotionDirection()
	{
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		//IL_000c: Unknown result type (might be due to invalid IL or missing references)
		//IL_000f: Unknown result type (might be due to invalid IL or missing references)
		return ((EntityState)this).characterDirection.forward;
	}

	public override void FixedUpdate()
	{
		//IL_0030: Unknown result type (might be due to invalid IL or missing references)
		//IL_0114: Unknown result type (might be due to invalid IL or missing references)
		//IL_0119: Unknown result type (might be due to invalid IL or missing references)
		//IL_011d: 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_013c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0141: Unknown result type (might be due to invalid IL or missing references)
		//IL_0149: 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_0183: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
		//IL_01f1: Unknown result type (might be due to invalid IL or missing references)
		//IL_01f6: Unknown result type (might be due to invalid IL or missing references)
		((EntityState)this).FixedUpdate();
		if (((EntityState)this).isAuthority)
		{
			bool flag = FireMeleeAttack(overlapAttack, animator, hitBoxActiveParameter, forceMagnitude, bonusForce);
			hasHit = flag;
			if (hasHit)
			{
				if (hopOnHit && !((EntityState)this).characterMotor.isGrounded && !hopped)
				{
					((BaseState)this).SmallHop(((EntityState)this).characterMotor, hopVelocity);
					hopped = true;
				}
				if (!rootMotionWhileHitting && !isInHitPause && hasAnimParameter)
				{
					hitStopCachedState = ((BaseState)this).CreateHitStopCachedState(((EntityState)this).characterMotor, animator, animParameter);
					isInHitPause = true;
				}
			}
			if (animator.GetFloat(hitBoxActiveParameter) > 0.1f && rootMotion && !isInHitPause && !hasHit)
			{
				Vector3 val = rootMotionDirection();
				Vector3 val2 = default(Vector3);
				((Vector3)(ref val2))..ctor(val.x, 0f, val.z);
				CharacterMotor characterMotor = ((EntityState)this).characterMotor;
				characterMotor.rootMotion += val2 * rootMotionSpeed * Time.fixedDeltaTime;
			}
			if (hitPauseTimer >= hitPauseDuration && isInHitPause)
			{
				((BaseState)this).ConsumeHitStopCachedState(hitStopCachedState, ((EntityState)this).characterMotor, animator);
				isInHitPause = false;
				animator.speed = 1f;
			}
			if (!isInHitPause)
			{
				stopwatch += Time.fixedDeltaTime;
			}
			else
			{
				hitPauseTimer += Time.fixedDeltaTime;
				((EntityState)this).characterMotor.velocity = Vector3.zero;
				animator.speed = 0f;
			}
			if (stopwatch >= attackDuration - earlyExitDuration)
			{
				if (((EntityState)this).inputBank.skill1.down)
				{
					SetState();
				}
				if (stopwatch >= attackDuration)
				{
					BaseSkillState val3 = StateOverride();
					if (val3 != null)
					{
						((EntityState)this).outer.SetNextState((EntityState)(object)val3);
					}
					else
					{
						((EntityState)this).outer.SetNextStateToMain();
					}
					return;
				}
			}
		}
		if (animator.GetFloat(hitBoxActiveParameter) >= 0.11f && !hasSwung)
		{
			hasSwung = true;
			AkSoundEngine.PostEvent(swingSound, ((EntityState)this).gameObject);
			if (Object.op_Implicit((Object)(object)swingEffectPrefab) && !Utility.IsNullOrWhiteSpace(swingMuzzle))
			{
				EffectManager.SimpleMuzzleFlash(swingEffectPrefab, ((EntityState)this).gameObject, swingMuzzle, false);
			}
		}
	}

	public bool FireMeleeAttack(OverlapAttack attack, Animator animator, string mecanimHitboxActiveParameter, float forceMagnitude, Vector3 bonusForce)
	{
		//IL_0050: Unknown result type (might be due to invalid IL or missing references)
		//IL_0035: 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)
		//IL_0043: 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)
		bool result = false;
		if (Object.op_Implicit((Object)(object)animator) && animator.GetFloat(mecanimHitboxActiveParameter) > 0.1f)
		{
			attack.forceVector = (Object.op_Implicit((Object)(object)((EntityState)this).characterDirection) ? ((EntityState)this).characterDirection.forward : (((EntityState)this).transform.forward * forceMagnitude + bonusForce));
			result = attack.Fire((List<HurtBox>)null);
		}
		return result;
	}

	public virtual void SetState()
	{
	}

	public virtual BaseSkillState StateOverride()
	{
		return null;
	}

	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;
	}
}
internal class Primary : BaseSkillState
{
	private float duration;

	private float baseDuration = 0.55f;

	private float damageCoefficient = 1f;

	public override void OnEnter()
	{
		//IL_008d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0092: Unknown result type (might be due to invalid IL or missing references)
		//IL_0099: Unknown result type (might be due to invalid IL or missing references)
		//IL_009e: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a9: 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_00b7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00bc: 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)
		//IL_00d4: 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_00db: Unknown result type (might be due to invalid IL or missing references)
		//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
		//IL_0100: Unknown result type (might be due to invalid IL or missing references)
		//IL_0101: 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_010b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0113: Unknown result type (might be due to invalid IL or missing references)
		//IL_011a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0126: Unknown result type (might be due to invalid IL or missing references)
		//IL_0132: Unknown result type (might be due to invalid IL or missing references)
		//IL_013d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0144: Unknown result type (might be due to invalid IL or missing references)
		//IL_014a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0150: Unknown result type (might be due to invalid IL or missing references)
		//IL_015b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0166: Unknown result type (might be due to invalid IL or missing references)
		//IL_016d: Unknown result type (might be due to invalid IL or missing references)
		//IL_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_017f: 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_01a5: Unknown result type (might be due to invalid IL or missing references)
		((BaseState)this).OnEnter();
		((BaseState)this).StartAimMode(2f, false);
		duration = baseDuration / ((BaseState)this).attackSpeedStat;
		((EntityState)this).PlayAnimation("Gesture, Additive", "FireMainWeapon", "FireMainWeapon.playbackRate", duration);
		float num = 5f;
		((BaseState)this).AddRecoil(-1f * num, -1.5f * num, -0.25f * num, 0.25f * num);
		((EntityState)this).characterBody.AddSpreadBloom(2f);
		if (((EntityState)this).isAuthority)
		{
			Ray aimRay = ((BaseState)this).GetAimRay();
			float num2 = 15f;
			new BulletAttack
			{
				bulletCount = 12u,
				aimVector = ((Ray)(ref aimRay)).direction,
				origin = ((Ray)(ref aimRay)).origin,
				damage = ((BaseState)this).damageStat * damageCoefficient,
				damageColorIndex = (DamageColorIndex)0,
				damageType = (DamageType)0,
				falloffModel = (FalloffModel)1,
				maxDistance = 250f,
				force = 20f,
				hitMask = CommonMasks.bullet,
				minSpread = 0f - num2,
				maxSpread = num2,
				isCrit = ((BaseState)this).RollCrit(),
				owner = ((EntityState)this).gameObject,
				muzzleName = "MuzzleShotgun",
				smartCollision = false,
				procChainMask = default(ProcChainMask),
				procCoefficient = 0.6f,
				radius = 0.08f,
				sniper = false,
				stopperMask = CommonMasks.bullet,
				weapon = null,
				tracerEffectPrefab = Prefabs.Load<GameObject>("RoR2/Base/Commando/TracerCommandoDefault.prefab"),
				spreadPitchScale = 1f,
				spreadYawScale = 1f,
				hitEffectPrefab = Prefabs.Load<GameObject>("RoR2/Junk/Commando/HitsparkBarrage.prefab")
			}.Fire();
		}
		EffectManager.SimpleMuzzleFlash(Prefabs.Load<GameObject>("RoR2/Base/Common/VFX/MuzzleflashBarrage.prefab"), ((EntityState)this).gameObject, "MuzzleShotgun", false);
		AkSoundEngine.PostEvent(Sounds.Play_DoomSkills_Shotgun_Fire, ((EntityState)this).gameObject);
	}

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

	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)2;
	}
}
internal class Reload : BaseSkillState
{
	private bool reloaded;

	public override void OnEnter()
	{
		((BaseState)this).OnEnter();
		((EntityState)this).PlayCrossfade("Gesture, Additive", "EnterReload", "Reload.playbackRate", ((EntityState)this).skillLocator.primary.cooldownRemaining / 2f, 0.1f);
		Util.PlaySound(EnterReload.enterSoundString, ((EntityState)this).gameObject);
	}

	public override void FixedUpdate()
	{
		((EntityState)this).FixedUpdate();
		if (((EntityState)this).fixedAge >= ((EntityState)this).skillLocator.primary.cooldownRemaining / 2f && !reloaded)
		{
			reloaded = true;
			Util.PlayAttackSpeedSound(Reload.enterSoundString, ((EntityState)this).gameObject, Reload.enterSoundPitch);
			EffectManager.SimpleMuzzleFlash(Reload.reloadEffectPrefab, ((EntityState)this).gameObject, Reload.reloadEffectMuzzleString, false);
			((EntityState)this).PlayAnimation("Gesture, Additive", (((EntityState)this).characterBody.isSprinting && ((BaseState)this).isGrounded) ? "ReloadSimple" : "Reload", "Reload.playbackRate", ((EntityState)this).skillLocator.primary.cooldownRemaining);
		}
		if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= ((EntityState)this).skillLocator.primary.cooldownRemaining)
		{
			((EntityState)this).outer.SetNextStateToMain();
		}
	}

	public override void OnExit()
	{
		Util.PlayAttackSpeedSound(Reload.exitSoundString, ((EntityState)this).gameObject, Reload.exitSoundPitch);
		((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)4;
	}
}
internal class Secondary : BasicMeleeSkillState
{
	private float duration;

	private float baseDuration = 0.7f;

	private bool hasFired;

	public override string hitboxGroupName => "Punch";

	public override float damageCoefficient => 2.5f;

	public override void OnEnter()
	{
		//IL_0066: 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_00bb: Unknown result type (might be due to invalid IL or missing references)
		//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
		//IL_0087: Unknown result type (might be due to invalid IL or missing references)
		//IL_0091: Unknown result type (might be due to invalid IL or missing references)
		base.OnEnter();
		((BaseState)this).StartAimMode(2f, false);
		duration = baseDuration / ((BaseState)this).attackSpeedStat;
		((EntityState)this).PlayAnimation("Gesture, Additive", "SlashBlade", "SlashBlade.playbackRate", duration);
		AkSoundEngine.PostEvent(Sounds.Play_DoomSkills_Punch_Swing, ((EntityState)this).gameObject);
		if (((EntityState)this).isAuthority)
		{
			((EntityState)this).characterMotor.velocity = Vector3.zero;
		}
		if (NetworkServer.active)
		{
			((EntityState)this).healthComponent.TakeDamageForce(((EntityState)this).characterDirection.forward * 2500f, true, false);
		}
		Transform val = ((BaseState)this).FindModelChild(Bandit2FireShiv.muzzleString);
		val.localRotation = Quaternion.Euler(0f, 6f, -35f);
		GameObject val2 = Object.Instantiate<GameObject>(Prefabs.swingEffect, val.position, Quaternion.identity, val);
		val2.GetComponent<ScaleParticleSystemDuration>().newDuration = duration;
		val2.transform.localRotation = Quaternion.identity;
	}

	public override void FixedUpdate()
	{
		//IL_0031: Unknown result type (might be due to invalid IL or missing references)
		//IL_0036: 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)
		//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)
		base.FixedUpdate();
		if (((EntityState)this).isAuthority && hasHit && !hasFired)
		{
			hasFired = true;
			Ray aimRay = ((BaseState)this).GetAimRay();
			ProjectileManager.instance.FireProjectile(Prefabs.beamProjectile, ((Ray)(ref aimRay)).origin, Util.QuaternionSafeLookRotation(((Ray)(ref aimRay)).direction), ((EntityState)this).gameObject, ((BaseState)this).damageStat * damageCoefficient / 2f, 680f, true, (DamageColorIndex)0, (GameObject)null, -1f);
			Behaviour component = ((EntityState)this).GetComponent<Behaviour>();
			component.CallCmdUpdateAnimator();
			component.CallCmdPlaySound(Sounds.Play_DoomSkills_Punch_Hit);
		}
		if ((((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= duration) || (hasHit && ((EntityState)this).fixedAge >= 0.35f))
		{
			((EntityState)this).outer.SetNextStateToMain();
		}
	}

	public override void OnExit()
	{
		base.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;
	}
}
internal class Special : BaseSkillState
{
	private float duration;

	private float baseDuration = 0.35f;

	private float damageCoefficient = 5f;

	public override void OnEnter()
	{
		//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)
		//IL_004d: 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_0059: Unknown result type (might be due to invalid IL or missing references)
		//IL_0093: Unknown result type (might be due to invalid IL or missing references)
		//IL_0098: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a4: 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_00b3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b8: 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_00c5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
		//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e2: Expected O, but got Unknown
		((BaseState)this).OnEnter();
		duration = baseDuration / ((BaseState)this).attackSpeedStat;
		AkSoundEngine.PostEvent("Play_commando_M2_grenade_throw", ((EntityState)this).gameObject);
		if (((EntityState)this).isAuthority)
		{
			Ray aimRay = ((BaseState)this).GetAimRay();
			ProjectileManager.instance.FireProjectile(Prefabs.grenade, ((Ray)(ref aimRay)).origin, Util.QuaternionSafeLookRotation(((Ray)(ref aimRay)).direction), ((EntityState)this).gameObject, ((BaseState)this).damageStat * damageCoefficient, 680f, ((BaseState)this).RollCrit(), (DamageColorIndex)0, (GameObject)null, -1f);
			GameObject obj = Prefabs.Load<GameObject>("RoR2/Base/Common/VFX/MuzzleflashSmokeRing.prefab");
			EffectData val = new EffectData
			{
				origin = ((BaseState)this).FindModelChild("UpperArmL").position + Vector3.up * 0.25f
			};
			Ray aimRay2 = ((BaseState)this).GetAimRay();
			val.rotation = Util.QuaternionSafeLookRotation(((Ray)(ref aimRay2)).direction);
			EffectManager.SpawnEffect(obj, val, false);
		}
	}

	public override void FixedUpdate()
	{
		((EntityState)this).FixedUpdate();
		if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority)
		{
			((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;
	}
}
internal class Utility : BaseSkillState
{
	private float duration;

	private float baseDuration = 0.32f;

	private Vector3 dir;

	private AnimationCurve curve = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f);

	public override void OnEnter()
	{
		//IL_0049: 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_00b0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
		//IL_006d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0060: Unknown result type (might be due to invalid IL or missing references)
		//IL_0072: Unknown result type (might be due to invalid IL or missing references)
		((BaseState)this).OnEnter();
		duration = baseDuration / ((BaseState)this).attackSpeedStat;
		((EntityState)this).PlayAnimation("Gesture, Additive", "SlashBlade", "SlashBlade.playbackRate", duration);
		if (((EntityState)this).isAuthority)
		{
			dir = ((((EntityState)this).inputBank.moveVector != Vector3.zero) ? ((EntityState)this).inputBank.moveVector : ((EntityState)this).characterDirection.forward);
		}
		AkSoundEngine.PostEvent(Sounds.Play_DoomSkills_Dash, ((EntityState)this).gameObject);
		if (NetworkServer.active)
		{
			((EntityState)this).characterBody.AddBuff(Buffs.HiddenInvincibility);
		}
		EffectManager.SimpleEffect(Prefabs.dashEffect, ((EntityState)this).characterBody.corePosition, Util.QuaternionSafeLookRotation(((EntityState)this).characterDirection.forward), false);
	}

	public override void FixedUpdate()
	{
		//IL_0046: Unknown result type (might be due to invalid IL or missing references)
		//IL_004c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0056: Unknown result type (might be due to invalid IL or missing references)
		//IL_007c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0082: Unknown result type (might be due to invalid IL or missing references)
		//IL_0087: Unknown result type (might be due to invalid IL or missing references)
		//IL_008c: Unknown result type (might be due to invalid IL or missing references)
		((EntityState)this).FixedUpdate();
		((EntityState)this).characterBody.isSprinting = true;
		if (((EntityState)this).isAuthority)
		{
			float num = curve.Evaluate(((EntityState)this).fixedAge / duration) * Time.fixedDeltaTime;
			CharacterMotor characterMotor = ((EntityState)this).characterMotor;
			characterMotor.rootMotion += dir * 48f * Mathf.Max(1f, ((EntityState)this).characterBody.moveSpeed / ((EntityState)this).characterBody.baseMoveSpeed) * num;
		}
		if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority)
		{
			((EntityState)this).outer.SetNextStateToMain();
		}
	}

	public override void OnExit()
	{
		if (NetworkServer.active)
		{
			((EntityState)this).characterBody.RemoveBuff(Buffs.HiddenInvincibility);
		}
		((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;
	}
}
internal class Sounds
{
	public static readonly uint Play_DoomSkills_Punch_Swing = 2282594009u;

	public static readonly uint Play_DoomSkills_Punch_Hit = 3365360700u;

	public static readonly uint Play_DoomSkills_Shotgun_Fire = 4176024915u;

	public static readonly uint Play_DoomSkills_Dash = 94520598u;
}
internal static class Extensions
{
	public static GameObject NewSyringe(this GameObject g, params Material[] m)
	{
		((Renderer)g.GetComponentsInChildren<MeshRenderer>(false)[0]).material = m[0];
		((Renderer)g.GetComponent<TrailRenderer>()).material = m[1];
		((Renderer)g.GetComponent<ParticleSystemRenderer>()).material = m[2];
		return g;
	}

	public static Material SwapTexture(this Material m, Texture2D t)
	{
		m.mainTexture = (Texture)(object)t;
		return m;
	}

	public static GameObject SwapMaterials(this GameObject g, Material[] m)
	{
		Renderer[] componentsInChildren = g.GetComponentsInChildren<Renderer>();
		for (int i = 0; i < componentsInChildren.Length; i++)
		{
			if (Object.op_Implicit((Object)(object)m[i]))
			{
				componentsInChildren[i].material = m[i];
			}
		}
		return g;
	}

	public static float Mult(this float f, float mult = 100f)
	{
		return f * mult;
	}

	public static Color ToRGB255(this Color c, string title, string body)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_000d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0019: Unknown result type (might be due to invalid IL or missing references)
		//IL_0025: Unknown result type (might be due to invalid IL or missing references)
		//IL_002a: 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)
		return new Color(c.r / 255f, c.g / 255f, c.b / 255f);
	}

	public static void SetStrings(this TooltipProvider t, string title, string body)
	{
		t.overrideTitleText = title;
		t.overrideBodyText = body;
	}
}
internal class Utils
{
	public static SkillDef NewSkillDef<T>(Type activationState, string activationStateMachineName, int baseMaxStock, float baseRechargeInterval, bool beginSkillCooldownOnSkillEnd, bool canceledFromSprinting, bool fullRestockOnAssign, InterruptPriority interruptPriority, bool isCombatSkill, bool mustKeyPress, bool cancelSprintingOnActivation, int rechargeStock, int requiredStock, int stockToConsume, Sprite icon, string skillDescriptionToken, string skillName, params string[] keywordTokens) where T : SkillDef
	{
		//IL_000e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0013: Unknown result type (might be due to invalid IL or missing references)
		//IL_0069: 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)
		T val = ScriptableObject.CreateInstance<T>();
		((SkillDef)val).activationState = new SerializableEntityStateType(activationState);
		((SkillDef)val).activationStateMachineName = activationStateMachineName;
		((SkillDef)val).baseMaxStock = baseMaxStock;
		((SkillDef)val).baseRechargeInterval = baseRechargeInterval;
		((SkillDef)val).beginSkillCooldownOnSkillEnd = beginSkillCooldownOnSkillEnd;
		((SkillDef)val).canceledFromSprinting = canceledFromSprinting;
		((SkillDef)val).fullRestockOnAssign = fullRestockOnAssign;
		((SkillDef)val).interruptPriority = interruptPriority;
		((SkillDef)val).isCombatSkill = isCombatSkill;
		((SkillDef)val).mustKeyPress = mustKeyPress;
		((SkillDef)val).cancelSprintingOnActivation = cancelSprintingOnActivation;
		((SkillDef)val).rechargeStock = rechargeStock;
		((SkillDef)val).requiredStock = requiredStock;
		((SkillDef)val).stockToConsume = stockToConsume;
		((SkillDef)val).icon = icon;
		((SkillDef)val).skillDescriptionToken = skillDescriptionToken;
		((SkillDef)val).skillName = skillName;
		((SkillDef)val).skillNameToken = ((SkillDef)val).skillName;
		((SkillDef)val).keywordTokens = keywordTokens;
		ContentAddition.AddSkillDef((SkillDef)(object)val);
		return (SkillDef)(object)val;
	}

	public static Color HexTo10(string hexColor)
	{
		//IL_0025: Unknown result type (might be due to invalid IL or missing references)
		//IL_002f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0034: Unknown result type (might be due to invalid IL or missing references)
		//IL_0035: Unknown result type (might be due to invalid IL or missing references)
		//IL_0036: Unknown result type (might be due to invalid IL or missing references)
		//IL_0039: Unknown result type (might be due to invalid IL or missing references)
		char[] array = hexColor.ToCharArray();
		return new Color((float)(array[0] + array[1]), (float)(array[2] + array[3]), (float)(array[4] + array[5]), 255f) / 255f;
	}

	public static EntityStateMachine NewStateMachine<T>(GameObject obj, string customName) where T : EntityState
	{
		//IL_0021: 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_0028: Unknown result type (might be due to invalid IL or missing references)
		//IL_0029: Unknown result type (might be due to invalid IL or missing references)
		SerializableEntityStateType val = default(SerializableEntityStateType);
		((SerializableEntityStateType)(ref val))..ctor(typeof(T));
		EntityStateMachine val2 = obj.AddComponent<EntityStateMachine>();
		val2.customName = customName;
		val2.initialStateType = val;
		val2.mainStateType = val;
		return val2;
	}

	public static GenericSkill NewGenericSkill(GameObject obj, SkillDef skill)
	{
		//IL_0031: Unknown result type (might be due to invalid IL or missing references)
		//IL_0049: Unknown result type (might be due to invalid IL or missing references)
		//IL_0053: Expected O, but got Unknown
		//IL_0054: 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)
		GenericSkill val = obj.AddComponent<GenericSkill>();
		SkillFamily val2 = ScriptableObject.CreateInstance<SkillFamily>();
		val2.variants = (Variant[])(object)new Variant[1];
		val._skillFamily = val2;
		SkillFamily skillFamily = val.skillFamily;
		Variant[] variants = skillFamily.variants;
		Variant val3 = new Variant
		{
			skillDef = skill
		};
		((Variant)(ref val3)).viewableNode = new Node(skill.skillNameToken, false, (Node)null);
		variants[0] = val3;
		ContentAddition.AddSkillFamily(skillFamily);
		return val;
	}

	public static void AddAlt(SkillFamily skillFamily, SkillDef SkillDef)
	{
		//IL_0029: Unknown result type (might be due to invalid IL or missing references)
		//IL_0041: Unknown result type (might be due to invalid IL or missing references)
		//IL_004b: Expected O, but got Unknown
		//IL_004c: Unknown result type (might be due to invalid IL or missing references)
		//IL_004d: Unknown result type (might be due to invalid IL or missing references)
		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
		};
		((Variant)(ref val)).viewableNode = new Node(SkillDef.skillNameToken, false, (Node)null);
		variants[num] = val;
	}

	public static BuffDef NewBuffDef(string name, bool stack, bool hidden, Sprite sprite, Color color)
	{
		//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 = stack;
		val.isHidden = hidden;
		val.iconSprite = sprite;
		val.buffColor = color;
		ContentAddition.AddBuffDef(val);
		return val;
	}

	public static ObjectScaleCurve AddScaleComponent(GameObject target, float timeMax, AnimationCurve overallCurve)
	{
		ObjectScaleCurve val = target.AddComponent<ObjectScaleCurve>();
		val.useOverallCurveOnly = true;
		val.timeMax = timeMax;
		val.overallCurve = overallCurve;
		return val;
	}

	public static ObjectScaleCurve AddScaleComponent(GameObject target, float timeMax)
	{
		ObjectScaleCurve val = target.AddComponent<ObjectScaleCurve>();
		val.useOverallCurveOnly = true;
		val.timeMax = timeMax;
		val.overallCurve = AnimationCurve.Linear(0f, 0f, 1f, 1f);
		return val;
	}

	public static RotateAroundAxis AddRotationComponent(GameObject target, float speed, RotationAxis axis)
	{
		//IL_0019: Unknown result type (might be due to invalid IL or missing references)
		RotateAroundAxis val = target.AddComponent<RotateAroundAxis>();
		val.speed = (Speed)2;
		val.fastRotationSpeed = speed;
		val.rotateAroundAxis = axis;
		return val;
	}

	public static GameObject NewDisplayModel(GameObject model, string name)
	{
		//IL_0046: Unknown result type (might be due to invalid IL or missing references)
		//IL_0050: Expected O, but got Unknown
		GameObject val = PrefabAPI.InstantiateClone(model, name, false);
		val.GetComponentInChildren<Animator>().runtimeAnimatorController = Assets.Load<RuntimeAnimatorController>("displayAnimator");
		((Behaviour)val.GetComponentInChildren<CharacterModel>()).enabled = false;
		SkinnedMeshRenderer[] componentsInChildren = val.GetComponentsInChildren<SkinnedMeshRenderer>(true);
		foreach (SkinnedMeshRenderer val2 in componentsInChildren)
		{
			((Renderer)val2).material = new Material(((Renderer)val2).material);
			((Renderer)val2).material.DisableKeyword("DITHER");
		}
		return val;
	}

	public static AnimateShaderAlpha AddShaderAlphaComponent(GameObject target, float timeMax, AnimationCurve curve, bool destroyOnEnd = true, bool disableOnEnd = false)
	{
		AnimateShaderAlpha val = target.AddComponent<AnimateShaderAlpha>();
		val.timeMax = timeMax;
		val.alphaCurve = curve;
		val.destroyOnEnd = destroyOnEnd;
		val.disableOnEnd = disableOnEnd;
		return val;
	}

	internal static Sprite CreateSprite(Texture2D tex)
	{
		//IL_001a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0029: Unknown result type (might be due to invalid IL or missing references)
		return Sprite.Create(tex, new Rect(0f, 0f, (float)((Texture)tex).width, (float)((Texture)tex).height), new Vector2(0.5f, 0.5f), 128f);
	}

	internal static SkinDefInfo CreateNewSkinDefInfo(SkinnedMeshRenderer[] childList, GameObject rootObject, string skinName, string objectToEnable, RendererInfo[] rendererInfos, UnlockableDef unlockableDef = null)
	{
		//IL_0003: Unknown result type (might be due to invalid IL or missing references)
		//IL_0044: 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_006e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0071: 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)
		//IL_00db: Unknown result type (might be due to invalid IL or missing references)
		//IL_00df: Unknown result type (might be due to invalid IL or missing references)
		SkinDefInfo result = default(SkinDefInfo);
		result.BaseSkins = Array.Empty<SkinDef>();
		result.MinionSkinReplacements = (MinionSkinReplacement[])(object)new MinionSkinReplacement[0];
		result.ProjectileGhostReplacements = (ProjectileGhostReplacement[])(object)new ProjectileGhostReplacement[0];
		List<GameObjectActivation> list = new List<GameObjectActivation>();
		foreach (SkinnedMeshRenderer val in childList)
		{
			GameObjectActivation val2 = default(GameObjectActivation);
			val2.gameObject = ((Component)val).gameObject;
			val2.shouldActivate = ((Object)val).name == objectToEnable;
			GameObjectActivation item = val2;
			list.Add(item);
		}
		result.GameObjectActivations = list.ToArray();
		result.Icon = Assets.MainAssetBundle.LoadAsset<Sprite>(objectToEnable);
		result.MeshReplacements = (MeshReplacement[])(object)new MeshReplacement[0];
		result.Name = skinName;
		result.NameToken = skinName;
		result.RendererInfos = rendererInfos;
		result.RootObject = rootObject;
		result.UnlockableDef = unlockableDef;
		return result;
	}

	internal static T CopyComponent<T>(T original, GameObject destination) where T : Component
	{
		Type type = ((object)original).GetType();
		Component val = destination.AddComponent(type);
		FieldInfo[] fields = type.GetFields();
		FieldInfo[] array = fields;
		foreach (FieldInfo fieldInfo in array)
		{
			fieldInfo.SetValue(val, fieldInfo.GetValue(original));
		}
		return (T)(object)((val is T) ? val : null);
	}

	public static Sprite CreateSpriteFromTexture(Texture2D texture)
	{
		//IL_0025: Unknown result type (might be due to invalid IL or missing references)
		//IL_0034: Unknown result type (might be due to invalid IL or missing references)
		if (Object.op_Implicit((Object)(object)texture))
		{
			return Sprite.Create(texture, new Rect(0f, 0f, (float)((Texture)texture).width, (float)((Texture)texture).height), new Vector2(0.5f, 0.5f));
		}
		return null;
	}

	public static GameObject FindInActiveObjectByName(string name)
	{
		//IL_000f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0015: Invalid comparison between Unknown and I4
		Transform[] array = Resources.FindObjectsOfTypeAll<Transform>();
		for (int i = 0; i < array.Length; i++)
		{
			if ((int)((Object)array[i]).hideFlags == 0 && ((Object)array[i]).name == name)
			{
				return ((Component)array[i]).gameObject;
			}
		}
		return null;
	}

	public static void CreateHitboxes(string name, Transform parent, Vector3[] sizes, Vector3[] positions)
	{
		//IL_0034: Unknown result type (might be due to invalid IL or missing references)
		//IL_003a: Expected O, but got Unknown
		//IL_004f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0060: Unknown result type (might be due to invalid IL or missing references)
		//IL_0073: Unknown result type (might be due to invalid IL or missing references)
		HitBoxGroup val = ((Component)parent).gameObject.AddComponent<HitBoxGroup>();
		val.groupName = name;
		List<HitBox> list = new List<HitBox>();
		for (int i = 0; i < sizes.Length; i++)
		{
			GameObject val2 = new GameObject(name + (i + 1));
			val2.transform.SetParent(parent);
			val2.transform.localPosition = positions[i];
			val2.transform.localRotation = Quaternion.identity;
			val2.transform.localScale = sizes[i];
			HitBox item = val2.AddComponent<HitBox>();
			val2.layer = LayerIndex.projectile.intVal;
			list.Add(item);
		}
		val.hitBoxes = list.ToArray();
	}

	public static GameObject CreateHitbox(string name, Transform parent, Vector3 scale, Vector3 localPosition)
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0008: Expected O, but got Unknown
		//IL_001b: 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_0039: Unknown result type (might be due to invalid IL or missing references)
		GameObject val = new GameObject(name);
		val.transform.SetParent(parent);
		val.transform.localPosition = localPosition;
		val.transform.localRotation = Quaternion.identity;
		val.transform.localScale = scale;
		HitBoxGroup val2 = ((Component)parent).gameObject.AddComponent<HitBoxGroup>();
		HitBox val3 = val.AddComponent<HitBox>();
		val.layer = LayerIndex.projectile.intVal;
		val2.hitBoxes = (HitBox[])(object)new HitBox[1] { val3 };
		val2.groupName = name;
		return val;
	}

	internal static EffectComponent RegisterEffect(GameObject effect, float duration, string soundName = "", bool applyScale = false, bool parentToReferencedTransform = true, bool positionAtReferencedTransform = true)
	{
		//IL_00a6: 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)
		EffectComponent val = effect.GetComponent<EffectComponent>();
		if (!Object.op_Implicit((Object)(object)val))
		{
			val = effect.AddComponent<EffectComponent>();
		}
		if (duration != -1f)
		{
			DestroyOnTimer component = effect.GetComponent<DestroyOnTimer>();
			if (!Object.op_Implicit((Object)(object)component))
			{
				effect.AddComponent<DestroyOnTimer>().duration = duration;
			}
			else
			{
				component.duration = duration;
			}
		}
		if (!Object.op_Implicit((Object)(object)effect.GetComponent<NetworkIdentity>()))
		{
			effect.AddComponent<NetworkIdentity>();
		}
		if (!Object.op_Implicit((Object)(object)effect.GetComponent<VFXAttributes>()))
		{
			effect.AddComponent<VFXAttributes>().vfxPriority = (VFXPriority)2;
		}
		val.applyScale = applyScale;
		val.effectIndex = (EffectIndex)(-1);
		val.parentToReferencedTransform = parentToReferencedTransform;
		val.positionAtReferencedTransform = positionAtReferencedTransform;
		val.soundName = soundName;
		ContentAddition.AddEffect(effect);
		return val;
	}

	public static Material InstantiateMaterial(Texture tex)
	{
		//IL_0022: 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)
		Material val = Object.Instantiate<Material>(Prefabs.Load<Material>("RoR2/Base/Commando/matCommandoDualies.mat"));
		if (Object.op_Implicit((Object)(object)val))
		{
			val.SetColor("_Color", Color.white);
			val.SetTexture("_MainTex", tex);
			val.SetColor("_EmColor", Color.black);
			val.SetFloat("_EmPower", 0f);
			val.SetTexture("_EmTex", (Texture)null);
			val.SetFloat("_NormalStrength", 1f);
			val.SetTexture("_NormalTex", (Texture)null);
			return val;
		}
		return val;
	}

	public static Material InstantiateMaterial(Color color, Texture tex, Color emColor, float emPower, Texture emTex, float normStr, Texture normTex)
	{
		//IL_0037: Unknown result type (might be due to invalid IL or missing references)
		//IL_0051: Unknown result type (might be due to invalid IL or missing references)
		Material val = Object.Instantiate<Material>(LegacyResourcesAPI.Load<GameObject>("Prefabs/CharacterBodies/CommandoBody").GetComponentInChildren<CharacterModel>().baseRendererInfos[0].defaultMaterial);
		if (Object.op_Implicit((Object)(object)val))
		{
			val.SetColor("_Color", color);
			val.SetTexture("_MainTex", tex);
			val.SetColor("_EmColor", emColor);
			val.SetFloat("_EmPower", emPower);
			val.SetTexture("_EmTex", emTex);
			val.SetFloat("_NormalStrength", 1f);
			val.SetTexture("_NormalTex", normTex);
			return val;
		}
		return val;
	}

	public static Material FindMaterial(string name)
	{
		//IL_000f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0015: Invalid comparison between Unknown and I4
		Material[] array = Resources.FindObjectsOfTypeAll<Material>();
		for (int i = 0; i < array.Length; i++)
		{
			if ((int)((Object)array[i]).hideFlags == 0 && ((Object)array[i]).name == name)
			{
				return array[i];
			}
		}
		return null;
	}
}