Decompiled source of MissFortune v1.0.0

MissFortune.dll

Decompiled 2 days ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using EntityStates;
using EntityStates.Huntress;
using KinematicCharacterController;
using On.RoR2;
using R2API;
using R2API.Utils;
using Rewired.ComponentControls.Effects;
using RoR2;
using RoR2.Navigation;
using RoR2.Orbs;
using RoR2.Projectile;
using RoR2.Skills;
using RoR2.UI;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.Networking;
using UnityEngine.Rendering;

[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = "")]
[assembly: AssemblyCompany("MissFortune")]
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: AssemblyProduct("MissFortune")]
[assembly: AssemblyTitle("MissFortune")]
[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 MissFortune;

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("MissFortune.AssetBundle.missfortuneassets");
			MainAssetBundle = AssetBundle.LoadFromStream(stream);
		}
		using Stream stream2 = executingAssembly.GetManifestResourceStream("MissFortune.MissFortune.bnk");
		byte[] array = new byte[stream2.Length];
		stream2.Read(array, 0, array.Length);
		SoundBanks.Add(array);
	}
}
internal class MFBehaviour : NetworkBehaviour
{
	public GameObject lastMarkedTarget;

	private GameObject mark;

	private CharacterBody body;

	private CharacterModel model;

	private ChildLocator childLocator;

	private Renderer baseRenderer;

	private GameObject gun0;

	private GameObject gun1;

	private GameObject gun2;

	private GameObject gun3;

	public float stopwatch;

	public string muzzle;

	public bool left = true;

	public bool fire;

	private ParticleSystem hearts;

	private static int kRpcRpcUpdateMark;

	private static int kRpcRpcSetWeapon;

	private void Awake()
	{
		body = ((Component)this).GetComponent<CharacterBody>();
		model = ((Component)body.modelLocator.modelTransform).GetComponent<CharacterModel>();
		childLocator = ((Component)model).GetComponent<ChildLocator>();
		baseRenderer = ((Component)childLocator.FindChild("skin16")).GetComponent<Renderer>();
		gun0 = ((Component)childLocator.FindChild("weapon0")).gameObject;
		gun1 = ((Component)childLocator.FindChild("weapon1")).gameObject;
		gun2 = ((Component)childLocator.FindChild("weapon2")).gameObject;
		gun3 = ((Component)childLocator.FindChild("weapon3")).gameObject;
	}

	private void Start()
	{
		hearts = ((Component)((Component)body.modelLocator.modelTransform).GetComponent<ChildLocator>().FindChild("heartEffect")).GetComponent<ParticleSystem>();
	}

	private void FixedUpdate()
	{
		//IL_005f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0064: 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)
		if (!NetworkServer.active)
		{
			return;
		}
		int buffCount = body.GetBuffCount(Prefabs.speed);
		if (body.outOfDanger)
		{
			if (!hearts.isPlaying)
			{
				hearts.Play();
			}
			EmissionModule emission = hearts.emission;
			((EmissionModule)(ref emission)).rateOverTime = MinMaxCurve.op_Implicit(Util.Remap((float)buffCount, 0f, 100f, 4f, 12f));
			if (buffCount != 100)
			{
				stopwatch += Time.fixedDeltaTime;
				if (stopwatch >= 0.2f)
				{
					stopwatch = 0f;
					body.AddBuff(Prefabs.speed);
				}
			}
		}
		else if (body.HasBuff(Prefabs.speed))
		{
			if (hearts.isPlaying)
			{
				hearts.Stop();
			}
			stopwatch = 0f;
			for (int i = 0; i < buffCount; i++)
			{
				body.RemoveBuff(Prefabs.speed);
			}
		}
	}

	private void Update()
	{
		if (body.skinIndex == 11)
		{
			if (Input.GetKeyDown((KeyCode)49))
			{
				CallRpcSetWeapon(0);
			}
			if (Input.GetKeyDown((KeyCode)50))
			{
				CallRpcSetWeapon(1);
			}
			if (Input.GetKeyDown((KeyCode)51))
			{
				CallRpcSetWeapon(2);
			}
			if (Input.GetKeyDown((KeyCode)52))
			{
				CallRpcSetWeapon(3);
			}
		}
	}

	[ClientRpc]
	public void RpcUpdateMark(GameObject target)
	{
		//IL_0038: Unknown result type (might be due to invalid IL or missing references)
		//IL_003d: Unknown result type (might be due to invalid IL or missing references)
		lastMarkedTarget = target;
		if (Object.op_Implicit((Object)(object)mark))
		{
			Object.Destroy((Object)(object)mark);
		}
		Transform coreTransform = target.GetComponent<CharacterBody>().coreTransform;
		mark = Object.Instantiate<GameObject>(Prefabs.passiveMark, coreTransform.position, Quaternion.identity);
		mark.transform.parent = coreTransform;
		AkSoundEngine.PostEvent("Play_sfx_MissFortune_MissFortunePassiveAttack_OnHit", ((Component)this).gameObject);
		body.skillLocator.utility.RunRecharge(0.5f);
	}

	[ClientRpc]
	public void RpcSetWeapon(int index)
	{
		gun0.SetActive(false);
		gun1.SetActive(false);
		gun2.SetActive(false);
		gun3.SetActive(false);
		Material val = null;
		switch (index)
		{
		case 0:
			gun0.SetActive(true);
			val = Prefabs.mat0;
			break;
		case 1:
			gun1.SetActive(true);
			val = Prefabs.mat1;
			break;
		case 2:
			gun2.SetActive(true);
			val = Prefabs.mat2;
			break;
		case 3:
			gun3.SetActive(true);
			val = Prefabs.mat3;
			break;
		}
		for (int i = 0; i < model.baseRendererInfos.Length; i++)
		{
			if ((Object)(object)model.baseRendererInfos[i].renderer == (Object)(object)baseRenderer)
			{
				model.baseRendererInfos[i].defaultMaterial = val;
				break;
			}
		}
		baseRenderer.material = val;
	}

	private void UNetVersion()
	{
	}

	protected static void InvokeRpcRpcUpdateMark(NetworkBehaviour obj, NetworkReader reader)
	{
		if (!NetworkClient.active)
		{
			Debug.LogError((object)"RPC RpcUpdateMark called on server.");
		}
		else
		{
			((MFBehaviour)(object)obj).RpcUpdateMark(reader.ReadGameObject());
		}
	}

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

	public void CallRpcUpdateMark(GameObject target)
	{
		//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 RpcUpdateMark called on client.");
			return;
		}
		NetworkWriter val = new NetworkWriter();
		val.Write((short)0);
		val.Write((short)2);
		val.WritePackedUInt32((uint)kRpcRpcUpdateMark);
		val.Write(((Component)this).GetComponent<NetworkIdentity>().netId);
		val.Write(target);
		((NetworkBehaviour)this).SendRPCInternal(val, 0, "RpcUpdateMark");
	}

	public void CallRpcSetWeapon(int index)
	{
		//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 RpcSetWeapon called on client.");
			return;
		}
		NetworkWriter val = new NetworkWriter();
		val.Write((short)0);
		val.Write((short)2);
		val.WritePackedUInt32((uint)kRpcRpcSetWeapon);
		val.Write(((Component)this).GetComponent<NetworkIdentity>().netId);
		val.WritePackedUInt32((uint)index);
		((NetworkBehaviour)this).SendRPCInternal(val, 0, "RpcSetWeapon");
	}

	static MFBehaviour()
	{
		//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
		kRpcRpcUpdateMark = -107533552;
		NetworkBehaviour.RegisterRpcDelegate(typeof(MFBehaviour), kRpcRpcUpdateMark, new CmdDelegate(InvokeRpcRpcUpdateMark));
		kRpcRpcSetWeapon = 1249849860;
		NetworkBehaviour.RegisterRpcDelegate(typeof(MFBehaviour), kRpcRpcSetWeapon, new CmdDelegate(InvokeRpcRpcSetWeapon));
		NetworkCRC.RegisterBehaviour("MFBehaviour", 0);
	}

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

	public override void OnDeserialize(NetworkReader reader, bool initialState)
	{
	}
}
[DefaultExecutionOrder(20)]
internal class ModelBehaviour : MonoBehaviour
{
	private MFBehaviour behaviour;

	private CharacterModel model;

	private void Awake()
	{
		model = ((Component)this).GetComponent<CharacterModel>();
	}

	private void Start()
	{
		if (Object.op_Implicit((Object)(object)model.body))
		{
			behaviour = ((Component)model.body).GetComponent<MFBehaviour>();
		}
	}

	private void Fire(string s)
	{
		if (Object.op_Implicit((Object)(object)behaviour))
		{
			behaviour.muzzle = s;
			behaviour.fire = true;
		}
	}
}
internal class ProjectileTriggerImpact : MonoBehaviour
{
	private ProjectileController controller;

	private void Awake()
	{
		controller = ((Component)this).GetComponent<ProjectileController>();
	}

	private void OnTriggerEnter(Collider collider)
	{
		//IL_002f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0045: 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_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_005b: Unknown result type (might be due to invalid IL or missing references)
		//IL_005c: Unknown result type (might be due to invalid IL or missing references)
		//IL_006e: Unknown result type (might be due to invalid IL or missing references)
		if (NetworkServer.active && !Object.op_Implicit((Object)(object)((Component)collider).GetComponent<HurtBox>()) && controller.CanProcessCollisionEvents())
		{
			ProjectileImpactInfo val = default(ProjectileImpactInfo);
			val.collider = collider;
			val.estimatedPointOfImpact = ((Component)this).transform.position;
			val.estimatedImpactNormal = Vector3.zero;
			ProjectileImpactInfo val2 = val;
			IProjectileImpactBehavior[] components = ((Component)this).GetComponents<IProjectileImpactBehavior>();
			for (int i = 0; i < components.Length; i++)
			{
				components[i].OnProjectileImpact(val2);
			}
		}
	}
}
internal class SoundLoop : MonoBehaviour
{
	private uint ID;

	private void Start()
	{
		ID = AkSoundEngine.PostEvent("Play_sfx_MissFortune_MissFortuneScattershot_Ground", ((Component)this).gameObject);
	}

	private void OnDisable()
	{
		AkSoundEngine.StopPlayingID(ID);
		AkSoundEngine.PostEvent("Play_sfx_MissFortune_MissFortuneScattershot_End", ((Component)this).gameObject);
	}
}
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_001a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0024: Expected O, but got Unknown
		RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(RecalculateStatsAPI_GetStatCoefficients);
		HealthComponent.TakeDamage += new hook_TakeDamage(HealthComponent_TakeDamage);
	}

	private static void HealthComponent_TakeDamage(orig_TakeDamage orig, HealthComponent self, DamageInfo damageInfo)
	{
		//IL_0004: Unknown result type (might be due to invalid IL or missing references)
		//IL_000a: 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)
		//IL_0014: Unknown result type (might be due to invalid IL or missing references)
		//IL_00de: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ed: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
		//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
		//IL_0218: Unknown result type (might be due to invalid IL or missing references)
		//IL_023d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0242: 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_0172: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b0: Unknown result type (might be due to invalid IL or missing references)
		//IL_01c2: Unknown result type (might be due to invalid IL or missing references)
		//IL_01c7: Unknown result type (might be due to invalid IL or missing references)
		//IL_01cf: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ec: 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)
		bool flag = false;
		if ((int)DamageTypeCombo.op_Implicit(damageInfo.damageType & DamageTypeCombo.op_Implicit((DamageType)2)) != 0 && Object.op_Implicit((Object)(object)damageInfo.attacker))
		{
			MFBehaviour component = damageInfo.attacker.GetComponent<MFBehaviour>();
			if (Object.op_Implicit((Object)(object)component))
			{
				if (!self.body.HasBuff(Prefabs.mark))
				{
					self.body.AddBuff(Prefabs.mark);
					if (Object.op_Implicit((Object)(object)component.lastMarkedTarget))
					{
						component.lastMarkedTarget.GetComponent<CharacterBody>().RemoveBuff(Prefabs.mark);
					}
					component.CallRpcUpdateMark(((Component)self).gameObject);
					flag = true;
				}
				else
				{
					damageInfo.damageType |= DamageTypeCombo.op_Implicit((DamageType)2);
				}
			}
		}
		orig.Invoke(self, damageInfo);
		if (!damageInfo.rejected && (int)DamageTypeCombo.op_Implicit(damageInfo.damageType & DamageTypeCombo.op_Implicit((DamageType)262144)) != 0 && Object.op_Implicit((Object)(object)damageInfo.attacker) && Object.op_Implicit((Object)(object)damageInfo.attacker.GetComponent<MFBehaviour>()))
		{
			CharacterBody component2 = damageInfo.attacker.GetComponent<CharacterBody>();
			MFOrb mFOrb = new MFOrb();
			mFOrb.damageValue = component2.damage * 2.25f;
			mFOrb.isCrit = !self.alive || component2.RollCrit();
			mFOrb.teamIndex = component2.teamComponent.teamIndex;
			mFOrb.attacker = ((Component)component2).gameObject;
			mFOrb.procCoefficient = 1f;
			mFOrb.bouncesRemaining = 0;
			mFOrb.bouncedObjects = new List<HealthComponent> { self };
			mFOrb.damageType = (DamageType)0;
			mFOrb.direction = damageInfo.inflictor.transform.forward;
			HurtBox val = mFOrb.PickNextTarget(damageInfo.position);
			if (Object.op_Implicit((Object)(object)val))
			{
				((Orb)mFOrb).origin = damageInfo.position;
				((Orb)mFOrb).target = val;
				OrbManager.instance.AddOrb((Orb)(object)mFOrb);
			}
		}
		if (flag)
		{
			damageInfo.damageColorIndex = (DamageColorIndex)3;
			damageInfo.damage *= 0.2f;
			self.TakeDamage(damageInfo);
			EffectManager.SimpleEffect(Prefabs.passiveImpact, damageInfo.position, Quaternion.identity, true);
		}
	}

	private static void RecalculateStatsAPI_GetStatCoefficients(CharacterBody sender, StatHookEventArgs args)
	{
		int buffCount = sender.GetBuffCount(Prefabs.speed);
		if (buffCount > 0)
		{
			args.moveSpeedMultAdd += 0.005f * (float)buffCount;
		}
		if (sender.HasBuff(Prefabs.atacspeed))
		{
			args.attackSpeedMultAdd += 0.4f;
		}
	}
}
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInPlugin("com.Dragonyck.MissFortune", "MissFortune", "1.0.0")]
[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.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
public class MainPlugin : BaseUnityPlugin
{
	public const string MODUID = "com.Dragonyck.MissFortune";

	public const string MODNAME = "MissFortune";

	public const string VERSION = "1.0.0";

	public const string SURVIVORNAME = "Miss Fortune";

	public const string SURVIVORNAMEKEY = "MISSFORTUNE";

	public static GameObject characterPrefab;

	public static readonly Color characterColor = Color32.op_Implicit(new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue));

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

	internal static void CreatePrefab()
	{
		//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_00b5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00bb: Expected O, but got Unknown
		//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f7: Unknown result type (might be due to invalid IL or missing references)
		//IL_0117: Unknown result type (might be due to invalid IL or missing references)
		//IL_0127: Unknown result type (might be due to invalid IL or missing references)
		//IL_012d: Expected O, but got Unknown
		//IL_0154: Unknown result type (might be due to invalid IL or missing references)
		//IL_0165: Unknown result type (might be due to invalid IL or missing references)
		//IL_0176: Unknown result type (might be due to invalid IL or missing references)
		//IL_0199: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a6: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b3: Unknown result type (might be due to invalid IL or missing references)
		//IL_0225: Unknown result type (might be due to invalid IL or missing references)
		//IL_0356: Unknown result type (might be due to invalid IL or missing references)
		//IL_0390: Unknown result type (might be due to invalid IL or missing references)
		//IL_0395: Unknown result type (might be due to invalid IL or missing references)
		//IL_042b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0430: Unknown result type (might be due to invalid IL or missing references)
		//IL_045d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0462: Unknown result type (might be due to invalid IL or missing references)
		//IL_050e: Unknown result type (might be due to invalid IL or missing references)
		//IL_052e: Unknown result type (might be due to invalid IL or missing references)
		//IL_053b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0759: Unknown result type (might be due to invalid IL or missing references)
		//IL_0776: Unknown result type (might be due to invalid IL or missing references)
		//IL_0793: Unknown result type (might be due to invalid IL or missing references)
		//IL_07b0: Unknown result type (might be due to invalid IL or missing references)
		//IL_07cd: Unknown result type (might be due to invalid IL or missing references)
		//IL_07ea: Unknown result type (might be due to invalid IL or missing references)
		//IL_0807: Unknown result type (might be due to invalid IL or missing references)
		//IL_0824: Unknown result type (might be due to invalid IL or missing references)
		//IL_0841: Unknown result type (might be due to invalid IL or missing references)
		//IL_085f: Unknown result type (might be due to invalid IL or missing references)
		//IL_087d: Unknown result type (might be due to invalid IL or missing references)
		//IL_089b: Unknown result type (might be due to invalid IL or missing references)
		//IL_08b9: Unknown result type (might be due to invalid IL or missing references)
		//IL_08d7: Unknown result type (might be due to invalid IL or missing references)
		//IL_08f5: Unknown result type (might be due to invalid IL or missing references)
		//IL_0913: Unknown result type (might be due to invalid IL or missing references)
		//IL_0931: Unknown result type (might be due to invalid IL or missing references)
		//IL_094f: Unknown result type (might be due to invalid IL or missing references)
		//IL_096d: Unknown result type (might be due to invalid IL or missing references)
		//IL_098b: Unknown result type (might be due to invalid IL or missing references)
		//IL_09a9: Unknown result type (might be due to invalid IL or missing references)
		//IL_09c7: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a39: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b71: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b76: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b99: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b9e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0bcc: Unknown result type (might be due to invalid IL or missing references)
		//IL_0bd1: Unknown result type (might be due to invalid IL or missing references)
		GameObject val = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Commando/CommandoBody.prefab").WaitForCompletion();
		characterPrefab = PrefabAPI.InstantiateClone(val, "Miss FortuneBody", true);
		characterPrefab.GetComponent<NetworkIdentity>().localPlayerAuthority = true;
		Object.Destroy((Object)(object)((Component)characterPrefab.transform.Find("ModelBase")).gameObject);
		Object.Destroy((Object)(object)((Component)characterPrefab.transform.Find("CameraPivot")).gameObject);
		Object.Destroy((Object)(object)((Component)characterPrefab.transform.Find("AimOrigin")).gameObject);
		GameObject val2 = Assets.MainAssetBundle.LoadAsset<GameObject>("MFMdl");
		val2.AddComponent<AnimationEvents>().soundCenter = val2;
		GameObject val3 = new GameObject("ModelBase");
		val3.transform.parent = characterPrefab.transform;
		val3.transform.localPosition = new Vector3(0f, -0.94f, 0f);
		val3.transform.localRotation = Quaternion.identity;
		val3.transform.localScale = new Vector3(1f, 1f, 1f);
		GameObject val4 = new GameObject("AimOrigin");
		val4.transform.parent = val3.transform;
		val4.transform.localPosition = new Vector3(0f, 1.4f, 0f);
		val4.transform.localRotation = Quaternion.identity;
		val4.transform.localScale = Vector3.one;
		Transform transform = val2.transform;
		transform.parent = val3.transform;
		transform.localPosition = Vector3.zero;
		transform.localScale = Vector3.one;
		transform.localRotation = Quaternion.identity;
		CharacterDirection component = characterPrefab.GetComponent<CharacterDirection>();
		component.targetTransform = val3.transform;
		component.modelAnimator = val2.GetComponentInChildren<Animator>();
		component.turnSpeed = 720f;
		CharacterBody component2 = characterPrefab.GetComponent<CharacterBody>();
		((Object)component2).name = "Miss FortuneBody";
		component2.baseNameToken = "MISSFORTUNE_NAME";
		component2.subtitleNameToken = "MISSFORTUNE_SUBTITLE";
		component2.bodyFlags = (BodyFlags)16;
		component2.rootMotionInMainState = false;
		component2.mainRootSpeed = 0f;
		component2.baseMaxHealth = 110f;
		component2.levelMaxHealth = 35f;
		component2.baseRegen = 1.5f;
		component2.levelRegen = 0.2f;
		component2.baseMaxShield = 0f;
		component2.levelMaxShield = 0f;
		component2.baseMoveSpeed = 7f;
		component2.levelMoveSpeed = 0f;
		component2.baseAcceleration = 110f;
		component2.baseJumpPower = 15f;
		component2.levelJumpPower = 0f;
		component2.baseDamage = 12f;
		component2.levelDamage = 2.4f;
		component2.baseAttackSpeed = 1f;
		component2.levelAttackSpeed = 0f;
		component2.baseCrit = 1f;
		component2.levelCrit = 0f;
		component2.baseArmor = 0f;
		component2.levelArmor = 0f;
		component2.baseJumpCount = 1;
		component2.sprintingSpeedMultiplier = 1.45f;
		component2.wasLucky = false;
		component2.hideCrosshair = false;
		component2.aimOriginTransform = val4.transform;
		component2.hullClassification = (HullClassification)0;
		component2.portraitIcon = (Texture)(object)Assets.MainAssetBundle.LoadAsset<Sprite>("portrait").texture;
		component2.isChampion = false;
		component2.currentVehicle = null;
		component2.skinIndex = 0u;
		component2.bodyColor = characterColor;
		HealthComponent component3 = characterPrefab.GetComponent<HealthComponent>();
		component3.health = component2.baseMaxHealth;
		component3.shield = 0f;
		component3.barrier = 0f;
		CharacterMotor component4 = characterPrefab.GetComponent<CharacterMotor>();
		component4.walkSpeedPenaltyCoefficient = 1f;
		component4.characterDirection = component;
		component4.muteWalkMotion = false;
		component4.mass = 160f;
		component4.airControl = 0.25f;
		component4.disableAirControlUntilCollision = false;
		component4.generateParametersOnAwake = true;
		InputBankTest component5 = characterPrefab.GetComponent<InputBankTest>();
		component5.moveVector = Vector3.zero;
		CameraTargetParams component6 = characterPrefab.GetComponent<CameraTargetParams>();
		component6.cameraParams = val.GetComponent<CameraTargetParams>().cameraParams;
		component6.cameraPivotTransform = null;
		component6.recoil = Vector2.zero;
		component6.dontRaycastToPivot = false;
		ModelLocator component7 = characterPrefab.GetComponent<ModelLocator>();
		component7.modelTransform = transform;
		component7.modelBaseTransform = val3.transform;
		component7.dontReleaseModelOnDeath = false;
		component7.autoUpdateModelTransform = true;
		component7.dontDetatchFromParent = false;
		component7.noCorpse = false;
		component7.normalizeToFloor = false;
		component7.preserveModel = false;
		ChildLocator component8 = val2.GetComponent<ChildLocator>();
		CharacterModel val5 = val2.AddComponent<CharacterModel>();
		SkinnedMeshRenderer[] componentsInChildren = val2.GetComponentsInChildren<SkinnedMeshRenderer>();
		List<RendererInfo> list = new List<RendererInfo>();
		foreach (SkinnedMeshRenderer val6 in componentsInChildren)
		{
			((Renderer)val6).material = Utils.InstantiateMaterial(((Renderer)val6).material.mainTexture);
			list.Add(new RendererInfo
			{
				renderer = (Renderer)(object)val6,
				defaultMaterial = ((Renderer)val6).material,
				defaultShadowCastingMode = (ShadowCastingMode)1,
				ignoreOverlays = false
			});
			if (((Object)val6).name != "base")
			{
				((Component)val6).gameObject.SetActive(false);
			}
		}
		RendererInfo[] array = list.ToArray();
		val5.body = component2;
		val5.baseRendererInfos = array;
		val5.autoPopulateLightInfos = true;
		val5.invisibilityCount = 0;
		val5.temporaryOverlays = new List<TemporaryOverlayInstance>();
		val5.mainSkinnedMeshRenderer = componentsInChildren[0];
		characterPrefab.AddComponent<MFBehaviour>();
		val2.AddComponent<ModelBehaviour>();
		LanguageAPI.Add("MISSFORTUNEBODY_DEFAULT_SKIN_NAME", "Default");
		LanguageAPI.Add("MISSFORTUNEBODY_SKIN01_NAME", "Cowgirl");
		LanguageAPI.Add("MISSFORTUNEBODY_SKIN02_NAME", "Waterloo");
		LanguageAPI.Add("MISSFORTUNEBODY_SKIN03_NAME", "Secret Agent");
		LanguageAPI.Add("MISSFORTUNEBODY_SKIN04_NAME", "Candy Cane");
		LanguageAPI.Add("MISSFORTUNEBODY_SKIN05_NAME", "Road Warrior");
		LanguageAPI.Add("MISSFORTUNEBODY_SKIN06_NAME", "Crime City");
		LanguageAPI.Add("MISSFORTUNEBODY_SKIN07_NAME", "Arcade");
		LanguageAPI.Add("MISSFORTUNEBODY_SKIN08_NAME", "Captain");
		LanguageAPI.Add("MISSFORTUNEBODY_SKIN09_NAME", "Pool Party");
		LanguageAPI.Add("MISSFORTUNEBODY_SKIN15_NAME", "Star Guardian");
		LanguageAPI.Add("MISSFORTUNEBODY_SKIN16_NAME", "Gun Goddess");
		LanguageAPI.Add("MISSFORTUNEBODY_SKIN17_NAME", "Pajama Guardian");
		LanguageAPI.Add("MISSFORTUNEBODY_SKIN18_NAME", "Bewitching");
		LanguageAPI.Add("MISSFORTUNEBODY_SKIN20_NAME", "Prestige Bewitching");
		LanguageAPI.Add("MISSFORTUNEBODY_SKIN21_NAME", "Ruined");
		LanguageAPI.Add("MISSFORTUNEBODY_SKIN31_NAME", "Battle Bunny");
		LanguageAPI.Add("MISSFORTUNEBODY_SKIN32_NAME", "Admiral Battle Bunny");
		LanguageAPI.Add("MISSFORTUNEBODY_SKIN40_NAME", "Broken Covenant");
		LanguageAPI.Add("MISSFORTUNEBODY_SKIN41_NAME", "Prestige Broken Covenant");
		LanguageAPI.Add("MISSFORTUNEBODY_SKIN50_NAME", "Porcelain");
		LanguageAPI.Add("MISSFORTUNEBODY_SKIN60_NAME", "Battle Queen");
		ModelSkinController val7 = val2.AddComponent<ModelSkinController>();
		val7.skins = (SkinDef[])(object)new SkinDef[22]
		{
			Skins.CreateNewSkinDef(Utils.CreateNewSkinDefInfo(componentsInChildren, val2, "MISSFORTUNEBODY_DEFAULT_SKIN_NAME", "base", array)),
			Skins.CreateNewSkinDef(Utils.CreateNewSkinDefInfo(componentsInChildren, val2, "MISSFORTUNEBODY_SKIN01_NAME", "skin01", array)),
			Skins.CreateNewSkinDef(Utils.CreateNewSkinDefInfo(componentsInChildren, val2, "MISSFORTUNEBODY_SKIN02_NAME", "skin02", array)),
			Skins.CreateNewSkinDef(Utils.CreateNewSkinDefInfo(componentsInChildren, val2, "MISSFORTUNEBODY_SKIN03_NAME", "skin03", array)),
			Skins.CreateNewSkinDef(Utils.CreateNewSkinDefInfo(componentsInChildren, val2, "MISSFORTUNEBODY_SKIN04_NAME", "skin04", array)),
			Skins.CreateNewSkinDef(Utils.CreateNewSkinDefInfo(componentsInChildren, val2, "MISSFORTUNEBODY_SKIN05_NAME", "skin05", array)),
			Skins.CreateNewSkinDef(Utils.CreateNewSkinDefInfo(componentsInChildren, val2, "MISSFORTUNEBODY_SKIN06_NAME", "skin06", array)),
			Skins.CreateNewSkinDef(Utils.CreateNewSkinDefInfo(componentsInChildren, val2, "MISSFORTUNEBODY_SKIN07_NAME", "skin07", array)),
			Skins.CreateNewSkinDef(Utils.CreateNewSkinDefInfo(componentsInChildren, val2, "MISSFORTUNEBODY_SKIN08_NAME", "skin08", array)),
			Skins.CreateNewSkinDef(Utils.CreateNewSkinDefInfo(componentsInChildren, val2, "MISSFORTUNEBODY_SKIN09_NAME", "skin09", array)),
			Skins.CreateNewSkinDef(Utils.CreateNewSkinDefInfo(componentsInChildren, val2, "MISSFORTUNEBODY_SKIN15_NAME", "skin15", array)),
			Skins.CreateNewSkinDef(Utils.CreateNewSkinDefInfo(componentsInChildren, val2, "MISSFORTUNEBODY_SKIN16_NAME", "skin16", array)),
			Skins.CreateNewSkinDef(Utils.CreateNewSkinDefInfo(componentsInChildren, val2, "MISSFORTUNEBODY_SKIN17_NAME", "skin17", array)),
			Skins.CreateNewSkinDef(Utils.CreateNewSkinDefInfo(componentsInChildren, val2, "MISSFORTUNEBODY_SKIN18_NAME", "skin18", array)),
			Skins.CreateNewSkinDef(Utils.CreateNewSkinDefInfo(componentsInChildren, val2, "MISSFORTUNEBODY_SKIN20_NAME", "skin20", array)),
			Skins.CreateNewSkinDef(Utils.CreateNewSkinDefInfo(componentsInChildren, val2, "MISSFORTUNEBODY_SKIN21_NAME", "skin21", array)),
			Skins.CreateNewSkinDef(Utils.CreateNewSkinDefInfo(componentsInChildren, val2, "MISSFORTUNEBODY_SKIN31_NAME", "skin31", array)),
			Skins.CreateNewSkinDef(Utils.CreateNewSkinDefInfo(componentsInChildren, val2, "MISSFORTUNEBODY_SKIN32_NAME", "skin32", array)),
			Skins.CreateNewSkinDef(Utils.CreateNewSkinDefInfo(componentsInChildren, val2, "MISSFORTUNEBODY_SKIN40_NAME", "skin40", array)),
			Skins.CreateNewSkinDef(Utils.CreateNewSkinDefInfo(componentsInChildren, val2, "MISSFORTUNEBODY_SKIN41_NAME", "skin41", array)),
			Skins.CreateNewSkinDef(Utils.CreateNewSkinDefInfo(componentsInChildren, val2, "MISSFORTUNEBODY_SKIN50_NAME", "skin50", array)),
			Skins.CreateNewSkinDef(Utils.CreateNewSkinDefInfo(componentsInChildren, val2, "MISSFORTUNEBODY_SKIN60_NAME", "skin60", array))
		};
		Collider[] componentsInChildren2 = val2.GetComponentsInChildren<Collider>();
		HurtBoxGroup val8 = val2.AddComponent<HurtBoxGroup>();
		List<HurtBox> list2 = new List<HurtBox>();
		Collider[] array2 = componentsInChildren2;
		foreach (Collider val9 in array2)
		{
			HurtBox val10 = ((Component)val9).gameObject.AddComponent<HurtBox>();
			((Component)val10).gameObject.layer = LayerIndex.entityPrecise.intVal;
			val10.healthComponent = component3;
			val10.isBullseye = true;
			val10.damageModifier = (DamageModifier)0;
			val10.hurtBoxGroup = val8;
			val10.indexInGroup = 0;
			val8.mainHurtBox = val10;
			val8.bullseyeCount = 1;
			list2.Add(val10);
		}
		val8.hurtBoxes = list2.ToArray();
		KinematicCharacterMotor component9 = characterPrefab.GetComponent<KinematicCharacterMotor>();
		component9.CharacterController = (ICharacterController)(object)component4;
		component9.playerCharacter = true;
		characterPrefab.GetComponent<Interactor>().maxInteractionDistance = 3f;
		characterPrefab.GetComponent<InteractionDriver>().highlightInteractor = true;
		SfxLocator component10 = characterPrefab.GetComponent<SfxLocator>();
		component10.deathSound = "Play_ui_player_death";
		component10.barkSound = "";
		component10.openSound = "";
		component10.landingSound = "Play_char_land";
		component10.fallDamageSound = "Play_char_land_fall_damage";
		component10.aliveLoopStart = "";
		component10.aliveLoopStop = "";
		characterPrefab.GetComponent<Rigidbody>().mass = component4.mass;
		FootstepHandler val11 = val2.AddComponent<FootstepHandler>();
		val11.baseFootstepString = "Play_player_footstep";
		val11.sprintFootstepOverrideString = "";
		val11.enableFootstepDust = true;
		val11.footstepDustPrefab = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Common/VFX/GenericFootstepDust.prefab").WaitForCompletion();
		EntityStateMachine component11 = ((Component)component2).GetComponent<EntityStateMachine>();
		component11.mainStateType = new SerializableEntityStateType(typeof(CharacterMain));
		CharacterDeathBehavior component12 = characterPrefab.GetComponent<CharacterDeathBehavior>();
		component12.deathStateMachine = characterPrefab.GetComponent<EntityStateMachine>();
		component12.deathState = new SerializableEntityStateType(typeof(GenericCharacterDeath));
		NetworkStateMachine component13 = ((Component)component2).GetComponent<NetworkStateMachine>();
		component13.stateMachines = ((Component)component2).GetComponents<EntityStateMachine>();
		ContentAddition.AddBody(characterPrefab);
	}

	private void RegisterCharacter()
	{
		//IL_0088: Unknown result type (might be due to invalid IL or missing references)
		//IL_008d: Unknown result type (might be due to invalid IL or missing references)
		string text = " <style=cSub>\r\n\r\n< ! > \r\n\r\n< ! > \r\n\r\n< ! > \r\n\r\n< ! > \r\n\r\n";
		string text2 = "..and so she left.";
		string text3 = "..and so she vanished.";
		string text4 = "";
		LanguageAPI.Add("MISSFORTUNE_NAME", "Miss Fortune");
		LanguageAPI.Add("MISSFORTUNE_DESCRIPTION", text);
		LanguageAPI.Add("MISSFORTUNE_SUBTITLE", "Bounty Hunter");
		LanguageAPI.Add("MISSFORTUNE_OUTRO", text2);
		LanguageAPI.Add("MISSFORTUNE_FAIL", text3);
		SurvivorDef val = ScriptableObject.CreateInstance<SurvivorDef>();
		val.cachedName = "MISSFORTUNE_NAME";
		val.unlockableDef = null;
		val.descriptionToken = "MISSFORTUNE_DESCRIPTION";
		val.primaryColor = characterColor;
		val.bodyPrefab = characterPrefab;
		val.displayPrefab = Utils.NewDisplayModel(((Component)characterPrefab.GetComponent<ModelLocator>().modelBaseTransform).gameObject, "Miss FortuneDisplay");
		val.outroFlavorToken = "MISSFORTUNE_OUTRO";
		val.desiredSortPosition = 22f;
		val.mainEndingEscapeFailureFlavorToken = "MISSFORTUNE_FAIL";
		ContentAddition.AddSurvivorDef(val);
		SkillSetup();
		GameObject val2 = PrefabAPI.InstantiateClone(Prefabs.Load<GameObject>("RoR2/Base/Commando/CommandoMonsterMaster.prefab"), "Miss FortuneMaster", true);
		ContentAddition.AddMaster(val2);
		CharacterMaster component = val2.GetComponent<CharacterMaster>();
		component.bodyPrefab = characterPrefab;
	}

	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)
		bool flag = default(bool);
		ContentAddition.AddEntityState<Primary>(ref flag);
		ContentAddition.AddEntityState<Primary2>(ref flag);
		ContentAddition.AddEntityState<PrimarySelect>(ref flag);
		ContentAddition.AddEntityState<Secondary>(ref flag);
		ContentAddition.AddEntityState<Utility>(ref flag);
		ContentAddition.AddEntityState<Special>(ref flag);
		ContentAddition.AddEntityState<CharacterMain>(ref flag);
		OrbAPI.AddOrb<MFOrb>();
	}

	private void SkillSetup()
	{
		GenericSkill[] componentsInChildren = characterPrefab.GetComponentsInChildren<GenericSkill>();
		foreach (GenericSkill val in componentsInChildren)
		{
			Object.DestroyImmediate((Object)(object)val);
		}
		PassiveSetup();
		PrimarySetup();
		SecondarySetup();
		UtilitySetup();
		SpecialSetup();
	}

	private void PassiveSetup()
	{
		SkillLocator component = characterPrefab.GetComponent<SkillLocator>();
		LanguageAPI.Add("MISSFORTUNE_PASSIVE_NAME", "Love Tap");
		LanguageAPI.Add("MISSFORTUNE_PASSIVE_DESCRIPTION", "<style=cIsDamage>Double Up</style> applies a mark that expires upon attacking a new enemy.  If the enemy was unmarked, this also deals an additional <style=cIsDamage>20%</style> of the damage inflicted. Miss Fortune passively gains <style=cIsUtility>movement speed</style> after <style=cIsUtility>4s</style> without taking damage, stacking up to <style=cIsUtility>50% movement speed</style>.");
		component.passiveSkill.enabled = true;
		component.passiveSkill.skillNameToken = "MISSFORTUNE_PASSIVE_NAME";
		component.passiveSkill.skillDescriptionToken = "MISSFORTUNE_PASSIVE_DESCRIPTION";
		component.passiveSkill.icon = Assets.MainAssetBundle.LoadAsset<Sprite>("missfortune_w");
	}

	private void PrimarySetup()
	{
		SkillLocator component = characterPrefab.GetComponent<SkillLocator>();
		LanguageAPI.Add("MISSFORTUNE_M1", "Double Up");
		LanguageAPI.Add("MISSFORTUNE_M1_DESCRIPTION", "Miss Fortune fires a shot at the target enemy that deals <style=cIsDamage>135% damage</style>. Fire a ricocheting shot by holding down the button for <style=cIsDamage>225% damage</style>, which then bounces to hit another enemy behind them, inflicting a guaranteed <style=cIsDamage>crit</style> if the primary enemy was killed.");
		SkillDef skill = Utils.NewSkillDef<SkillDef>(typeof(PrimarySelect), "Weapon", 0, 0f, beginSkillCooldownOnSkillEnd: true, canceledFromSprinting: false, fullRestockOnAssign: true, (InterruptPriority)0, isCombatSkill: true, mustKeyPress: false, cancelSprintingOnActivation: false, 0, 0, 0, Assets.MainAssetBundle.LoadAsset<Sprite>("missfortune_q"), "MISSFORTUNE_M1_DESCRIPTION", "MISSFORTUNE_M1", Array.Empty<string>());
		component.primary = Utils.NewGenericSkill(characterPrefab, skill);
	}

	private void SecondarySetup()
	{
		SkillLocator component = characterPrefab.GetComponent<SkillLocator>();
		LanguageAPI.Add("MISSFORTUNE_M2", "Make It Rain");
		LanguageAPI.Add("MISSFORTUNE_M2_DESCRIPTION", "<style=cIsDamage>Slows</style>. Miss Fortune casts a storm of bullets at the target location for <style=cIsUtility>6s</style>, dealing <style=cIsDamage>200% damage</style> per second.");
		SkillDef skill = Utils.NewSkillDef<SkillDef>(typeof(Secondary), "Weapon", 1, 5f, beginSkillCooldownOnSkillEnd: true, canceledFromSprinting: false, fullRestockOnAssign: false, (InterruptPriority)1, isCombatSkill: true, mustKeyPress: true, cancelSprintingOnActivation: false, 1, 1, 1, Assets.MainAssetBundle.LoadAsset<Sprite>("missfortune_e"), "MISSFORTUNE_M2_DESCRIPTION", "MISSFORTUNE_M2", Array.Empty<string>());
		component.secondary = Utils.NewGenericSkill(characterPrefab, skill);
	}

	private void UtilitySetup()
	{
		SkillLocator component = characterPrefab.GetComponent<SkillLocator>();
		LanguageAPI.Add("MISSFORTUNE_UTIL", "Strut");
		LanguageAPI.Add("MISSFORTUNE_UTIL_DESCRIPTION", "Miss Fortune gains <style=cIsDamage>40% attack speed</style> for <style=cIsUtility>5s</style>, and maxes out the bonus <style=cIsUtility>passive movement speed</style>. Marking a new target with <style=cIsDamage>Love Tap</style> reduces <style=cIsDamage>Strut</style> cooldown by <style=cIsUtility>0.5s</style>.");
		SkillDef skill = Utils.NewSkillDef<SkillDef>(typeof(Utility), "Slide", 1, 8f, beginSkillCooldownOnSkillEnd: true, canceledFromSprinting: false, fullRestockOnAssign: false, (InterruptPriority)0, isCombatSkill: true, mustKeyPress: true, cancelSprintingOnActivation: false, 1, 1, 1, Assets.MainAssetBundle.LoadAsset<Sprite>("missfortune_passive"), "MISSFORTUNE_UTIL_DESCRIPTION", "MISSFORTUNE_UTIL", Array.Empty<string>());
		component.utility = Utils.NewGenericSkill(characterPrefab, skill);
	}

	private void SpecialSetup()
	{
		SkillLocator component = characterPrefab.GetComponent<SkillLocator>();
		LanguageAPI.Add("MISSFORTUNE_SPEC", "Bullet Time");
		LanguageAPI.Add("MISSFORTUNE_SPEC_DESCRIPTION", "Miss Fortune channels for up to <style=cIsUtility>3s</style>, firing a number of waves of bullets in the target direction, dealing <style=cIsDamage>6x50% damage</style>.");
		SkillDef skill = Utils.NewSkillDef<SkillDef>(typeof(Special), "Weapon", 1, 16f, beginSkillCooldownOnSkillEnd: true, canceledFromSprinting: false, fullRestockOnAssign: false, (InterruptPriority)1, isCombatSkill: true, mustKeyPress: true, cancelSprintingOnActivation: false, 1, 1, 1, Assets.MainAssetBundle.LoadAsset<Sprite>("missfortune_r"), "MISSFORTUNE_SPEC_DESCRIPTION", "MISSFORTUNE_SPEC", Array.Empty<string>());
		component.special = Utils.NewGenericSkill(characterPrefab, skill);
	}
}
internal class MFOrb : Orb
{
	public List<HealthComponent> bouncedObjects;

	public float speed = 100f;

	public float damageValue;

	public GameObject attacker;

	public TeamIndex teamIndex;

	public ProcChainMask procChainMask;

	public float procCoefficient = 1f;

	public DamageColorIndex damageColorIndex;

	public float range = 25f;

	public float damageCoefficientPerBounce = 1f;

	public DamageType damageType;

	public bool isCrit;

	public Vector3 direction;

	public GameObject inflictor;

	private BullseyeSearch search;

	public int bouncesRemaining;

	public override void Begin()
	{
		//IL_0015: Unknown result type (might be due to invalid IL or missing references)
		//IL_001a: Unknown result type (might be due to invalid IL or missing references)
		//IL_001c: 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)
		//IL_0034: Expected O, but got Unknown
		((Orb)this).duration = ((Orb)this).distanceToTarget / speed;
		EffectData val = new EffectData
		{
			origin = base.origin,
			genericFloat = ((Orb)this).duration
		};
		val.SetHurtBoxReference(base.target);
		EffectManager.SpawnEffect(Prefabs.orbEffect, val, true);
	}

	public override void OnArrival()
	{
		//IL_0024: 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)
		//IL_004f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0055: Expected O, but got Unknown
		//IL_007a: Unknown result type (might be due to invalid IL or missing references)
		//IL_007f: 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_0097: 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_00c0: 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_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_00d6: 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_0199: Unknown result type (might be due to invalid IL or missing references)
		//IL_019e: Unknown result type (might be due to invalid IL or missing references)
		//IL_01c9: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ce: Unknown result type (might be due to invalid IL or missing references)
		//IL_0213: Unknown result type (might be due to invalid IL or missing references)
		//IL_0218: Unknown result type (might be due to invalid IL or missing references)
		//IL_022d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0232: Unknown result type (might be due to invalid IL or missing references)
		//IL_0261: Unknown result type (might be due to invalid IL or missing references)
		//IL_0266: Unknown result type (might be due to invalid IL or missing references)
		if (!Object.op_Implicit((Object)(object)base.target))
		{
			return;
		}
		EffectManager.SimpleEffect(Prefabs.ricochetImpact, ((Component)base.target).transform.position, Quaternion.identity, true);
		HealthComponent healthComponent = base.target.healthComponent;
		if (Object.op_Implicit((Object)(object)healthComponent))
		{
			DamageInfo val = new DamageInfo();
			val.damage = damageValue;
			val.attacker = attacker;
			val.inflictor = inflictor;
			val.force = Vector3.zero;
			val.crit = isCrit;
			val.procChainMask = procChainMask;
			val.procCoefficient = procCoefficient;
			val.position = ((Component)base.target).transform.position;
			val.damageColorIndex = damageColorIndex;
			val.damageType = DamageTypeCombo.op_Implicit(damageType);
			healthComponent.TakeDamage(val);
			GlobalEventManager.instance.OnHitEnemy(val, ((Component)healthComponent).gameObject);
			GlobalEventManager.instance.OnHitAll(val, ((Component)healthComponent).gameObject);
		}
		if (bouncesRemaining > 0)
		{
			if (bouncedObjects != null)
			{
				bouncedObjects.Clear();
				bouncedObjects.Add(base.target.healthComponent);
			}
			HurtBox val2 = PickNextTarget(((Component)base.target).transform.position);
			if (Object.op_Implicit((Object)(object)val2))
			{
				MFOrb mFOrb = new MFOrb();
				mFOrb.search = search;
				((Orb)mFOrb).origin = ((Component)base.target).transform.position;
				((Orb)mFOrb).target = val2;
				mFOrb.attacker = attacker;
				mFOrb.inflictor = inflictor;
				mFOrb.teamIndex = teamIndex;
				mFOrb.damageValue = damageValue * damageCoefficientPerBounce;
				mFOrb.bouncesRemaining = bouncesRemaining - 1;
				mFOrb.isCrit = isCrit;
				mFOrb.bouncedObjects = bouncedObjects;
				mFOrb.procChainMask = procChainMask;
				mFOrb.procCoefficient = procCoefficient;
				mFOrb.damageColorIndex = damageColorIndex;
				mFOrb.damageCoefficientPerBounce = damageCoefficientPerBounce;
				mFOrb.speed = speed;
				mFOrb.range = range;
				mFOrb.damageType = damageType;
				OrbManager.instance.AddOrb((Orb)(object)mFOrb);
			}
		}
	}

	public HurtBox PickNextTarget(Vector3 position)
	{
		//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_002e: 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_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)
		//IL_0054: 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)
		//IL_0010: Unknown result type (might be due to invalid IL or missing references)
		//IL_001a: Expected O, but got Unknown
		if (search == null)
		{
			search = new BullseyeSearch();
		}
		search.searchOrigin = position;
		search.searchDirection = direction;
		search.teamMaskFilter = TeamMask.allButNeutral;
		((TeamMask)(ref search.teamMaskFilter)).RemoveTeam(teamIndex);
		search.filterByLoS = false;
		search.sortMode = (SortMode)3;
		search.maxDistanceFilter = range;
		search.maxAngleFilter = 40f;
		search.RefreshCandidates();
		if (Object.op_Implicit((Object)(object)base.target))
		{
			search.FilterOutGameObject(((Component)base.target).gameObject);
		}
		HurtBox val = (from v in search.GetResults()
			where !bouncedObjects.Contains(v.healthComponent)
			select v).FirstOrDefault();
		if (Object.op_Implicit((Object)(object)val))
		{
			bouncedObjects.Add(val.healthComponent);
		}
		return val;
	}
}
internal class Prefabs
{
	internal static GameObject rainProjectileGhost;

	internal static GameObject rainProjectile;

	internal static GameObject fireballProjectileGhost;

	internal static GameObject fireballProjectile;

	internal static GameObject fireballSingleTargetProjectile;

	internal static GameObject leadballProjectile;

	internal static GameObject ballTracer;

	internal static GameObject basicImpact;

	internal static GameObject ricochetImpact;

	internal static GameObject ultImpact;

	internal static GameObject passiveImpact;

	internal static GameObject passiveMark;

	internal static GameObject orbEffect;

	internal static BuffDef speed;

	internal static BuffDef atacspeed;

	internal static BuffDef mark;

	internal static Material mat0;

	internal static Material mat1;

	internal static Material mat2;

	internal static Material mat3;

	internal static void CreatePrefabs()
	{
		//IL_0012: Unknown result type (might be due to invalid IL or missing references)
		//IL_0032: Unknown result type (might be due to invalid IL or missing references)
		//IL_0052: Unknown result type (might be due to invalid IL or missing references)
		//IL_02ef: Unknown result type (might be due to invalid IL or missing references)
		//IL_02f4: Unknown result type (might be due to invalid IL or missing references)
		//IL_032a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0334: Unknown result type (might be due to invalid IL or missing references)
		//IL_05cb: Unknown result type (might be due to invalid IL or missing references)
		//IL_05d0: Unknown result type (might be due to invalid IL or missing references)
		//IL_037f: Unknown result type (might be due to invalid IL or missing references)
		//IL_06e6: Unknown result type (might be due to invalid IL or missing references)
		//IL_06f0: Expected O, but got Unknown
		//IL_0720: Unknown result type (might be due to invalid IL or missing references)
		//IL_075c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0761: Unknown result type (might be due to invalid IL or missing references)
		//IL_07da: Unknown result type (might be due to invalid IL or missing references)
		//IL_07e9: Unknown result type (might be due to invalid IL or missing references)
		//IL_0872: Unknown result type (might be due to invalid IL or missing references)
		//IL_0877: Unknown result type (might be due to invalid IL or missing references)
		//IL_0890: Unknown result type (might be due to invalid IL or missing references)
		//IL_0895: Unknown result type (might be due to invalid IL or missing references)
		//IL_089c: Unknown result type (might be due to invalid IL or missing references)
		//IL_08a1: Unknown result type (might be due to invalid IL or missing references)
		//IL_08a8: Unknown result type (might be due to invalid IL or missing references)
		//IL_08ad: Unknown result type (might be due to invalid IL or missing references)
		//IL_08b4: Unknown result type (might be due to invalid IL or missing references)
		//IL_08b9: Unknown result type (might be due to invalid IL or missing references)
		//IL_043e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0676: Unknown result type (might be due to invalid IL or missing references)
		//IL_0680: Expected O, but got Unknown
		//IL_069c: Unknown result type (might be due to invalid IL or missing references)
		//IL_06a6: Unknown result type (might be due to invalid IL or missing references)
		speed = Utils.NewBuffDef("Strut", stack: true, hidden: false, Assets.Load<Sprite>("missfortune_passive"), Color.white);
		atacspeed = Utils.NewBuffDef("Strut", stack: false, hidden: false, Assets.Load<Sprite>("missfortune_w_active"), Color.white);
		mark = Utils.NewBuffDef("Love Tap", stack: false, hidden: false, Assets.Load<Sprite>("missfortune_w_active"), Color.white);
		mat0 = Utils.InstantiateMaterial(Assets.Load<Material>("skin16-0").mainTexture);
		mat1 = Utils.InstantiateMaterial(Assets.Load<Material>("skin16-1").mainTexture);
		mat2 = Utils.InstantiateMaterial(Assets.Load<Material>("skin16-2").mainTexture);
		mat3 = Utils.InstantiateMaterial(Assets.Load<Material>("skin16-3").mainTexture);
		passiveMark = Instantiate(Assets.Load<GameObject>("PassiveMarkEffect"), "PassiveMarkEffect");
		basicImpact = Instantiate("RoR2/Base/Common/VFX/OmniImpactVFX.prefab", "BasicImpact");
		Utils.RegisterEffect(basicImpact, -1f, "Play_sfx_MissFortune_MissFortuneBasicAttack_OnHit");
		ricochetImpact = Instantiate("RoR2/Base/Common/VFX/OmniImpactVFXLarge.prefab", "RicochetImpact");
		Utils.RegisterEffect(ricochetImpact, -1f, "Play_sfx_MissFortune_MissFortuneRicochetShot_OnHit");
		passiveImpact = Instantiate("RoR2/Base/Common/VFX/OmniImpactVFXMedium.prefab", "PassiveImpact");
		Utils.RegisterEffect(passiveImpact, -1f, "Play_sfx_MissFortune_MissFortunePassiveAttack_OnHit");
		ultImpact = Instantiate("RoR2/Base/Common/VFX/OmniExplosionVFX.prefab", "UltImpact");
		Utils.RegisterEffect(ultImpact, -1f, "Play_sfx_MissFortune_MissFortuneRShotExtra_OnHit");
		rainProjectileGhost = Instantiate(Assets.Load<GameObject>("BulletRainEffect"), "RainProjectileGhost");
		rainProjectileGhost.AddComponent<ProjectileGhostController>();
		rainProjectileGhost.AddComponent<SoundLoop>();
		rainProjectileGhost.AddComponent<VFXAttributes>().DoNotPool = true;
		rainProjectile = Instantiate("RoR2/Base/Huntress/HuntressArrowRain.prefab", "RainProjectile", registerNetwork: true);
		Object.Destroy((Object)(object)rainProjectile.GetComponent<LoopSoundPlayer>());
		Transform[] componentsInChildren = rainProjectile.GetComponentsInChildren<Transform>();
		foreach (Transform val in componentsInChildren)
		{
			if ((Object)(object)val != (Object)(object)rainProjectile.transform && ((Object)val).name != "FX" && !Object.op_Implicit((Object)(object)((Component)val).GetComponent<HitBox>()))
			{
				((Component)val).gameObject.SetActive(false);
			}
		}
		Object.DestroyImmediate((Object)(object)rainProjectile.GetComponent<AkEvent>());
		Object.DestroyImmediate((Object)(object)rainProjectile.GetComponent<AkEvent>());
		Object.DestroyImmediate((Object)(object)rainProjectile.GetComponent<AkGameObj>());
		rainProjectile.GetComponent<ProjectileController>().ghostPrefab = rainProjectileGhost;
		ProjectileDotZone component = rainProjectile.GetComponent<ProjectileDotZone>();
		component.damageCoefficient = 1f;
		component.resetFrequency = 5f;
		component.impactEffect = Load<GameObject>("RoR2/Base/Common/VFX/OmniImpactVFX.prefab");
		rainProjectile.GetComponent<ProjectileDamage>().damageType = DamageTypeCombo.op_Implicit((DamageType)8);
		ContentAddition.AddProjectile(rainProjectile);
		Mesh mesh = null;
		fireballProjectileGhost = PrefabAPI.InstantiateClone(Load<GameObject>("RoR2/DLC1/VoidBarnacle/VoidBarnacleBulletGhost.prefab"), "FireballProjectileGhost", false);
		fireballProjectileGhost.transform.localScale = Vector3.one * 0.65f;
		Renderer[] componentsInChildren2 = fireballProjectileGhost.GetComponentsInChildren<Renderer>();
		foreach (Renderer val2 in componentsInChildren2)
		{
			string name = ((Object)val2).name;
			if (name == "Sphere")
			{
				((Component)val2).transform.localScale = Vector3.one;
				val2.sharedMaterials = (Material[])(object)new Material[1] { Load<Material>("RoR2/Base/SlowOnHit/matBaubleMetal.mat") };
				mesh = ((Component)val2).GetComponent<MeshFilter>().mesh;
			}
			if (name == "SoftGlow")
			{
				val2.enabled = false;
			}
			if (name == "Flames")
			{
				val2.enabled = false;
				GameObject val3 = Object.Instantiate<GameObject>(((Component)Array.Find(Load<GameObject>("RoR2/Base/Lemurian/FireballGhost.prefab").GetComponentsInChildren<ParticleSystemRenderer>(), (ParticleSystemRenderer x) => ((Object)x).name == "Flames")).gameObject, ((Component)val2).transform.parent);
				val3.transform.localPosition = Vector3.zero;
				((Renderer)val3.GetComponent<ParticleSystemRenderer>()).material = Load<Material>("RoR2/Junk/GreaterWisp/matExplosion1.mat");
			}
			if (name == "Sparks, Misc")
			{
				val2.material = Load<Material>("RoR2/Junk/GreaterWisp/matExplosion1.mat");
			}
		}
		((Renderer)fireballProjectileGhost.GetComponentInChildren<TrailRenderer>()).material = Load<Material>("RoR2/DLC1/GoldOnHurt/matGoldOrbTrail.mat");
		fireballProjectile = Instantiate("RoR2/Junk/Mage/MageFireboltExpanded.prefab", "FireballProjectile", registerNetwork: true);
		fireballProjectile.AddComponent<ProjectileTriggerImpact>();
		fireballProjectile.GetComponent<ProjectileController>().ghostPrefab = fireballProjectileGhost;
		ProjectileSimple component2 = fireballProjectile.GetComponent<ProjectileSimple>();
		component2.lifetime = 1f;
		component2.desiredForwardSpeed = 90f;
		ProjectileOverlapAttack component3 = fireballProjectile.GetComponent<ProjectileOverlapAttack>();
		component3.resetInterval = -1f;
		component3.damageCoefficient = 1f;
		component3.impactEffect = null;
		ProjectileImpactExplosion val4 = fireballProjectile.AddComponent<ProjectileImpactExplosion>();
		val4.lifetime = 10f;
		val4.destroyOnEnemy = false;
		val4.destroyOnWorld = true;
		((ProjectileExplosion)val4).blastDamageCoefficient = 0f;
		((ProjectileExplosion)val4).blastProcCoefficient = 0f;
		((ProjectileExplosion)val4).blastRadius = 0f;
		val4.impactEffect = ultImpact;
		ContentAddition.AddProjectile(fireballProjectile);
		fireballSingleTargetProjectile = Instantiate("RoR2/Base/Lemurian/Fireball.prefab", "FireballProjectile", registerNetwork: true);
		fireballSingleTargetProjectile.GetComponent<ProjectileController>().ghostPrefab = fireballProjectileGhost;
		fireballSingleTargetProjectile.GetComponent<ProjectileDamage>().damageType = DamageTypeCombo.op_Implicit((DamageType)262146);
		fireballSingleTargetProjectile.GetComponent<ProjectileSimple>().desiredForwardSpeed = 200f;
		ContentAddition.AddProjectile(fireballSingleTargetProjectile);
		Texture2D val5 = Load<Texture2D>("RoR2/Base/Common/ColorRamps/texBehemothRamp.png");
		GameObject val6 = Instantiate(fireballProjectileGhost, "LeadballProjectileGhost");
		ParticleSystemRenderer[] componentsInChildren3 = val6.GetComponentsInChildren<ParticleSystemRenderer>();
		foreach (ParticleSystemRenderer val7 in componentsInChildren3)
		{
			string name2 = ((Object)val7).name;
			if (name2 == "Sparks, Misc")
			{
				((Component)val7).gameObject.SetActive(false);
			}
			if (name2 == "Flames(Clone)")
			{
				((Renderer)val7).material = new Material(Load<Material>("RoR2/Base/Engi/matEngiTrailExplosion.mat"));
				((Renderer)val7).material.SetTexture("_RemapTex", (Texture)(object)val5);
				((Component)val7).transform.localScale = Vector3.one * 0.3f;
			}
		}
		TrailRenderer componentInChildren = val6.GetComponentInChildren<TrailRenderer>();
		componentInChildren.widthMultiplier = 0.3f;
		((Renderer)componentInChildren).material = new Material(Load<Material>("RoR2/Base/Huntress/matHuntressSwingTrail.mat"));
		((Renderer)componentInChildren).material.SetTexture("_RemapTex", (Texture)(object)val5);
		((Component)val6.GetComponentInChildren<MeshRenderer>()).transform.localScale = new Vector3(0.6f, 0.8f, 0.6f);
		leadballProjectile = Instantiate(fireballSingleTargetProjectile, "LeadballProjectile", registerNetwork: true);
		leadballProjectile.GetComponent<ProjectileController>().ghostPrefab = val6;
		leadballProjectile.GetComponent<ProjectileDamage>().damageType = DamageTypeCombo.op_Implicit((DamageType)2);
		leadballProjectile.GetComponent<ProjectileSimple>().desiredForwardSpeed = 180f;
		ContentAddition.AddProjectile(leadballProjectile);
		ballTracer = Instantiate("RoR2/Base/LunarWisp/TracerLunarWispMinigun.prefab", "BallTracer");
		ballTracer.GetComponentInChildren<MeshFilter>().mesh = mesh;
		ContentAddition.AddEffect(ballTracer);
		orbEffect = Instantiate("RoR2/Base/NovaOnHeal/DevilOrbEffect.prefab", "OrbEffect");
		GameObject val8 = Object.Instantiate<GameObject>(fireballProjectileGhost, orbEffect.transform.position, orbEffect.transform.rotation, orbEffect.transform);
		((Component)orbEffect.transform.GetChild(0)).gameObject.SetActive(false);
		((Component)orbEffect.transform.GetChild(1)).gameObject.SetActive(false);
		Object.DestroyImmediate((Object)(object)orbEffect.GetComponent<AkEvent>());
		Object.DestroyImmediate((Object)(object)orbEffect.GetComponent<AkEvent>());
		orbEffect.GetComponentInChildren<Light>().color = Color32.op_Implicit(new Color32((byte)248, (byte)181, (byte)76, byte.MaxValue));
		OrbEffect component4 = orbEffect.GetComponent<OrbEffect>();
		component4.startVelocity1 = Vector3.zero;
		component4.startVelocity2 = Vector3.zero;
		component4.endVelocity1 = Vector3.zero;
		component4.endVelocity2 = Vector3.zero;
		Object.Destroy((Object)(object)val8.GetComponent<ProjectileGhostController>());
		Object.Destroy((Object)(object)val8.GetComponent<VFXAttributes>());
		Utils.RegisterEffect(orbEffect, -1f, "Play_sfx_MissFortune_MissFortuneRicochetShot_OnMissileLaunch");
	}

	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 GameObject Instantiate(GameObject obj, string name, bool registerNetwork = false)
	{
		return PrefabAPI.InstantiateClone(obj, name, registerNetwork);
	}
}
internal class CharacterMain : GenericCharacterMain
{
}
internal class PrimarySelect : BaseSkillState
{
	private float duration = 0.25f;

	public override void OnEnter()
	{
		((BaseState)this).OnEnter();
	}

	public override void FixedUpdate()
	{
		((EntityState)this).FixedUpdate();
		if (((EntityState)this).isAuthority)
		{
			if (!((EntityState)this).inputBank.skill1.down)
			{
				((EntityState)this).outer.SetNextState((EntityState)(object)new Primary());
			}
			else if (((EntityState)this).fixedAge >= duration)
			{
				((EntityState)this).outer.SetNextState((EntityState)(object)new Primary2());
			}
		}
	}

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

	private float baseDuration = 0.4f;

	private float damageCoefficient = 1.35f;

	private MFBehaviour behaviour;

	public override void OnEnter()
	{
		((BaseState)this).OnEnter();
		duration = baseDuration / ((BaseState)this).attackSpeedStat;
		behaviour = ((EntityState)this).GetComponent<MFBehaviour>();
		MFBehaviour mFBehaviour = behaviour;
		mFBehaviour.left = !mFBehaviour.left;
		((EntityState)this).PlayAnimation("Gesture, Override", behaviour.left ? "Attack2" : "Attack1", "M1", duration, 0f);
		AkSoundEngine.PostEvent("Play_sfx_MissFortune_MissFortuneBasicAttack_OnCast", ((EntityState)this).gameObject);
	}

	private void Fire()
	{
		//IL_0079: Unknown result type (might be due to invalid IL or missing references)
		//IL_007e: Unknown result type (might be due to invalid IL or missing references)
		//IL_008b: 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_0097: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
		AkSoundEngine.PostEvent("Play_sfx_MissFortune_MissFortuneBasicAttack_OnMissileCast", ((EntityState)this).gameObject);
		EffectManager.SimpleMuzzleFlash(Prefabs.Load<GameObject>("RoR2/Base/Common/VFX/Muzzleflash1.prefab"), ((EntityState)this).gameObject, behaviour.muzzle, false);
		if (((EntityState)this).isAuthority)
		{
			float num = 1.4f;
			((BaseState)this).AddRecoil(-1f * num, -1.5f * num, -0.25f * num, 0.25f * num);
			((EntityState)this).characterBody.AddSpreadBloom(num);
			Ray aimRay = ((BaseState)this).GetAimRay();
			ProjectileManager.instance.FireProjectile(Prefabs.leadballProjectile, ((Ray)(ref aimRay)).origin, Util.QuaternionSafeLookRotation(((Ray)(ref aimRay)).direction), ((EntityState)this).gameObject, ((EntityState)this).characterBody.damage * damageCoefficient, 120f, ((BaseState)this).RollCrit(), (DamageColorIndex)0, (GameObject)null, -1f, (DamageTypeCombo?)DamageTypeCombo.GenericPrimary);
		}
	}

	public override void FixedUpdate()
	{
		((EntityState)this).FixedUpdate();
		if (behaviour.fire)
		{
			behaviour.fire = false;
			Fire();
		}
		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 Primary2 : BaseSkillState
{
	private float duration;

	private float baseDuration = 0.85f;

	private float damageCoefficient = 2.25f;

	private MFBehaviour behaviour;

	public override void OnEnter()
	{
		((BaseState)this).OnEnter();
		duration = baseDuration / ((BaseState)this).attackSpeedStat;
		behaviour = ((EntityState)this).GetComponent<MFBehaviour>();
		((EntityState)this).PlayAnimation("Gesture, Override", "Attack3", "M1", duration, 0f);
		AkSoundEngine.PostEvent("Play_sfx_MissFortune_MissFortuneRicochetShot_OnCast", ((EntityState)this).gameObject);
	}

	private void Fire()
	{
		//IL_0073: Unknown result type (might be due to invalid IL or missing references)
		//IL_0078: Unknown result type (might be due to invalid IL or missing references)
		//IL_0085: Unknown result type (might be due to invalid IL or missing references)
		//IL_008c: 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)
		//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
		AkSoundEngine.PostEvent("Play_sfx_MissFortune_MissFortuneRicochetShot_OnMissileLaunch", ((EntityState)this).gameObject);
		EffectManager.SimpleMuzzleFlash(Prefabs.Load<GameObject>("RoR2/Base/Common/VFX/Muzzleflash1.prefab"), ((EntityState)this).gameObject, "muzzleR", false);
		if (((EntityState)this).isAuthority)
		{
			float num = 1.4f;
			((BaseState)this).AddRecoil(-1f * num, -1.5f * num, -0.25f * num, 0.25f * num);
			((EntityState)this).characterBody.AddSpreadBloom(num);
			Ray aimRay = ((BaseState)this).GetAimRay();
			ProjectileManager.instance.FireProjectile(Prefabs.fireballSingleTargetProjectile, ((Ray)(ref aimRay)).origin, Util.QuaternionSafeLookRotation(((Ray)(ref aimRay)).direction), ((EntityState)this).gameObject, ((EntityState)this).characterBody.damage * damageCoefficient, 120f, ((BaseState)this).RollCrit(), (DamageColorIndex)0, (GameObject)null, -1f, (DamageTypeCombo?)DamageTypeCombo.GenericPrimary);
		}
	}

	public override void FixedUpdate()
	{
		((EntityState)this).FixedUpdate();
		if (behaviour.fire)
		{
			behaviour.fire = false;
			Fire();
		}
		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 Secondary : BaseSkillState
{
	private Vector3 pos;

	private float damageCoefficient = 0.4f;

	private GameObject areaIndicator;

	private AimRequest request;

	public override void OnEnter()
	{
		//IL_0040: 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)
		((BaseState)this).OnEnter();
		if (((EntityState)this).isAuthority)
		{
			request = ((EntityState)this).cameraTargetParams.RequestAimType((AimType)2);
			areaIndicator = Object.Instantiate<GameObject>(ArrowRain.areaIndicatorPrefab);
			areaIndicator.transform.localScale = Vector3.one * 7f;
			areaIndicator.SetActive(false);
		}
	}

	public override void Update()
	{
		//IL_0016: 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)
		//IL_0041: Unknown result type (might be due to invalid IL or missing references)
		//IL_0046: Unknown result type (might be due to invalid IL or missing references)
		//IL_0057: Unknown result type (might be due to invalid IL or missing references)
		((EntityState)this).Update();
		RaycastHit val = default(RaycastHit);
		if (Object.op_Implicit((Object)(object)areaIndicator) && Physics.Raycast(((BaseState)this).GetAimRay(), ref val, 999f, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask)))
		{
			pos = ((RaycastHit)(ref val)).point;
			areaIndicator.transform.position = pos;
			areaIndicator.SetActive(true);
		}
	}

	public override void FixedUpdate()
	{
		//IL_0022: 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)
		//IL_0041: Unknown result type (might be due to invalid IL or missing references)
		//IL_0046: 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)
		((EntityState)this).FixedUpdate();
		if (((EntityState)this).isAuthority && !((BaseSkillState)this).IsKeyDownAuthority())
		{
			if (pos != Vector3.zero)
			{
				ProjectileManager.instance.FireProjectile(Prefabs.rainProjectile, pos, Quaternion.identity, ((EntityState)this).gameObject, ((BaseState)this).damageStat * damageCoefficient, 0f, ((BaseState)this).RollCrit(), (DamageColorIndex)0, (GameObject)null, -1f, (DamageTypeCombo?)DamageTypeCombo.GenericPrimary);
			}
			((EntityState)this).outer.SetNextStateToMain();
		}
	}

	public override void OnExit()
	{
		float num = 1.4f;
		((BaseState)this).AddRecoil(-1f * num, -1.5f * num, -0.25f * num, 0.25f * num);
		((EntityState)this).characterBody.AddSpreadBloom(num);
		AkSoundEngine.PostEvent("Play_sfx_MissFortune_MissFortuneScattershot_OnCast", ((EntityState)this).gameObject);
		if (request != null)
		{
			request.Dispose();
		}
		if (Object.op_Implicit((Object)(object)areaIndicator))
		{
			EntityState.Destroy((Object)(object)areaIndicator);
		}
		((EntityState)this).PlayAnimation("Gesture, Override", "Secondary", "M2", 1f, 0f);
		((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 Special : BaseSkillState
{
	private float duration = 3f;

	private float baseFireFrequency = 0.2f;

	private float stopwatch;

	private float spread = 20f;

	private float damageCoefficient = 0.5f;

	private int projectileCount = 6;

	private Animator animator;

	public override void OnEnter()
	{
		((BaseState)this).OnEnter();
		animator = ((EntityState)this).GetModelAnimator();
		animator.SetFloat("Special", ((BaseState)this).attackSpeedStat);
		animator.SetBool("inUlt", true);
		((EntityState)this).PlayAnimation("Gesture, Override", "Special");
		AkSoundEngine.PostEvent("Play_sfx_MissFortune_MissFortuneBulletTime_OnCast", ((EntityState)this).gameObject);
	}

	public override void FixedUpdate()
	{
		((EntityState)this).FixedUpdate();
		stopwatch += Time.fixedDeltaTime;
		if (stopwatch >= baseFireFrequency / ((BaseState)this).attackSpeedStat)
		{
			stopwatch = 0f;
			Fire();
		}
		if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority)
		{
			((EntityState)this).outer.SetNextStateToMain();
		}
	}

	private void Fire()
	{
		//IL_006e: 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)
		//IL_0074: 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)
		//IL_0080: Unknown result type (might be due to invalid IL or missing references)
		//IL_0085: Unknown result type (might be due to invalid IL or missing references)
		//IL_0088: Unknown result type (might be due to invalid IL or missing references)
		//IL_008d: Unknown result type (might be due to invalid IL or missing references)
		//IL_008e: 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_00b2: 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_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_00c5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
		//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d0: 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_00eb: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
		//IL_00fd: Unknown result type (might be due to invalid IL or missing references)
		//IL_0102: Unknown result type (might be due to invalid IL or missing references)
		float num = 0.86f;
		((BaseState)this).AddRecoil(-1f * num, -1.5f * num, -0.25f * num, 0.25f * num);
		((EntityState)this).characterBody.AddSpreadBloom(num);
		AkSoundEngine.PostEvent("Play_sfx_MissFortune_MissFortuneBulletEMPTY_OnMissileLaunch", ((EntityState)this).gameObject);
		animator.SetFloat("Special", ((BaseState)this).attackSpeedStat);
		if (((EntityState)this).isAuthority)
		{
			Ray aimRay = ((BaseState)this).GetAimRay();
			Vector3 val = Vector3.Cross(Vector3.up, ((Ray)(ref aimRay)).direction);
			Vector3 val2 = Vector3.Cross(((Ray)(ref aimRay)).direction, val);
			float num2 = spread;
			float num3 = num2 / (float)projectileCount;
			Vector3 val3 = Quaternion.AngleAxis((0f - num2) * 0.5f, val2) * ((Ray)(ref aimRay)).direction;
			Quaternion val4 = Quaternion.AngleAxis(num3, val2);
			Ray val5 = default(Ray);
			((Ray)(ref val5))..ctor(((Ray)(ref aimRay)).origin, val3);
			for (int i = 0; i < projectileCount; i++)
			{
				NewProjectile(((Ray)(ref val5)).direction, aimRay);
				((Ray)(ref val5)).direction = val4 * ((Ray)(ref val5)).direction;
			}
		}
	}

	private void NewProjectile(Vector3 direction, Ray aimRay)
	{
		//IL_000d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0012: Unknown result type (might be due to invalid IL or missing references)
		//IL_0013: Unknown result type (might be due to invalid IL or missing references)
		//IL_0042: Unknown result type (might be due to invalid IL or missing references)
		ProjectileManager.instance.FireProjectile(Prefabs.fireballProjectile, ((Ray)(ref aimRay)).origin, Util.QuaternionSafeLookRotation(direction), ((EntityState)this).gameObject, ((EntityState)this).characterBody.damage * damageCoefficient, 120f, ((BaseState)this).RollCrit(), (DamageColorIndex)0, (GameObject)null, -1f, (DamageTypeCombo?)DamageTypeCombo.GenericSpecial);
	}

	public override void OnExit()
	{
		animator.SetBool("inUlt", false);
		((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 Utility : BaseSkillState
{
	private float duration;

	private float baseDuration = 0.35f;

	public override void OnEnter()
	{
		((BaseState)this).OnEnter();
		duration = baseDuration / ((BaseState)this).attackSpeedStat;
		if (NetworkServer.active)
		{
			int buffCount = ((EntityState)this).characterBody.GetBuffCount(Prefabs.speed);
			if (buffCount < 100)
			{
				int num = 100 - buffCount;
				for (int i = 0; i < num; i++)
				{
					((EntityState)this).characterBody.AddBuff(Prefabs.speed);
				}
			}
			((EntityState)this).characterBody.AddTimedBuff(Prefabs.atacspeed, 5f);
		}
		AkSoundEngine.PostEvent("Play_sfx_MissFortune_MissFortuneStrutStacks_OnBuffCast", ((EntityState)this).gameObject);
	}

	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 Sounds
{
	public static readonly uint Sound1;

	public static readonly uint Sound2;

	public static readonly uint Sound3;

	public static readonly uint Sound4;
}
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 Vector3 FindNearestNodePosition(Vector3 targetPosition, GraphType nodeGraphType)
	{
		//IL_0009: 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)
		//IL_0010: 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_0026: 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_0032: 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_0039: Unknown result type (might be due to invalid IL or missing references)
		//IL_003a: Unknown result type (might be due to invalid IL or missing references)
		//IL_003b: Unknown result type (might be due to invalid IL or missing references)
		//IL_004a: Expected O, but got Unknown
		//IL_0045: Unknown result type (might be due to invalid IL or missing references)
		//IL_004f: Expected O, but got Unknown
		//IL_0061: Unknown result type (might be due to invalid IL or missing references)
		//IL_0066: Unknown result type (might be due to invalid IL or missing references)
		//IL_0084: Unknown result type (might be due to invalid IL or missing references)
		//IL_0085: Unknown result type (might be due to invalid IL or missing references)
		//IL_0089: Unknown result type (might be due to invalid IL or missing references)
		SpawnCard val = ScriptableObject.CreateInstance<SpawnCard>();
		val.hullSize = (HullClassification)1;
		val.nodeGraphType = nodeGraphType;
		val.prefab = Prefabs.Load<GameObject>("RoR2/Base/Common/DirectorSpawnProbeHelperPrefab.prefab");
		Vector3 result = targetPosition;
		GameObject val2 = DirectorCore.instance.TrySpawnObject(new DirectorSpawnRequest(val, new DirectorPlacementRule
		{
			placementMode = (PlacementMode)3,
			position = targetPosition
		}, RoR2Application.rng));
		if (Object.op_Implicit((Object)(object)val2))
		{
			result = val2.transform.position;
		}
		if (Object.op_Implicit((Object)(object)val2))
		{
			Object.Destroy((Object)(object)val2);
		}
		Object.Destroy((Object)(object)val);
		return result;
	}

	public static Vector3 GetForwardDirection(Vector3 dir)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//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)
		//IL_0008: Unknown result type (might be due to invalid IL or missing references)
		//IL_0009: 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_0042: Unknown result type (might be due to invalid IL or missing references)
		//IL_0020: Unknown result type (might be due to invalid IL or missing references)
		//IL_002b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0031: Unknown result type (might be due to invalid IL or missing references)
		//IL_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)
		//IL_003e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0045: Unknown result type (might be due to invalid IL or missing references)
		Vector2 val = Util.Vector3XZToVector2XY(dir);
		if (val != Vector2.zero)
		{
			((Vector2)(ref val)).Normalize();
			Vector3 val2 = new Vector3(val.x, 0f, val.y);
			return ((Vector3)(ref val2)).normalized;
		}
		return dir;
	}

	public static void PlayAnimation(GameObject g, string layerName, string animationStateName)
	{
		Animator component = g.GetComponent<Animator>();
		if (Object.op_Implicit((Object)(object)component))
		{
			int layerIndex = component.GetLayerIndex(layerName);
			component.speed = 1f;
			component.Update(0f);
			component.PlayInFixedTime(animationStateName, layerIndex, 0f);
		}
	}

	public static void PlayAnimation(GameObject g, string layerName, string animationStateName, string playbackRateParam, float duration)
	{
		//IL_005c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0061: Unknown result type (might be due to invalid IL or missing references)
		Animator component = g.GetComponent<Animator>();
		if (Object.op_Implicit((Object)(object)component))
		{
			component.speed = 1f;
			component.Update(0f);
			int layerIndex = component.GetLayerIndex(layerName);
			component.SetFloat(playbackRateParam, 1f);
			component.PlayInFixedTime(animationStateName, layerIndex, 0f);
			component.Update(0f);
			AnimatorStateInfo currentAnimatorStateInfo = component.GetCurrentAnimatorStateInfo(layerIndex);
			float length = ((AnimatorStateInfo)(ref currentAnimatorStateInfo)).length;
			component.SetFloat(playbackRateParam, length / duration);
		}
	}

	public static void AnimatorPlayAnimation(Animator modelAnimator, string layerName, string animationStateName)
	{
		int layerIndex = modelAnimator.GetLayerIndex(layerName);
		modelAnimator.speed = 1f;
		modelAnimator.Update(0f);
		modelAnimator.PlayInFixedTime(animationStateName, layerIndex, 0f);
	}

	public static void AnimatorPlayAnimation(Animator modelAnimator, string layerName, string animationStateName, string playbackRateParam, float duration)
	{
		//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)
		modelAnimator.speed = 1f;
		modelAnimator.Update(0f);
		int layerIndex = modelAnimator.GetLayerIndex(layerName);
		modelAnimator.SetFloat(playbackRateParam, 1f);
		modelAnimator.PlayInFixedTime(animationStateName, layerIndex, 0f);
		modelAnimator.Update(0f);
		AnimatorStateInfo currentAnimatorStateInfo = modelAnimator.GetCurrentAnimatorStateInfo(layerIndex);
		float length = ((AnimatorStateInfo)(ref currentAnimatorStateInfo)).length;
		modelAnimator.SetFloat(playbackRateParam, length / duration);
	}

	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)
	{
		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_0047: Unknown result type (might be due to invalid IL or missing references)
		//IL_011f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0120: Unknown result type (might be due to invalid IL or missing references)
		//IL_0124: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ae: 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_00b3: 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.Contains(objectToEnable) && !((Object)val).name.Contains("skin16_Weapon1") && !((Object)val).name.Contains("skin16_Weapon2") && !((Object)val).name.Contains("skin16_Weapon3");
			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_006a: 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_0082: 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.Euler(Vector3.forward * 45f);
			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_0032: 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_0048: 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.Euler(Vector3.forward * 45f);
		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