Decompiled source of Liberator v1.0.0

Liberator.dll

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

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

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("Liberator.AssetBundle." + "Liberator".ToLower() + "assets");
			MainAssetBundle = AssetBundle.LoadFromStream(stream);
		}
		using Stream stream2 = executingAssembly.GetManifestResourceStream("Liberator.Liberator.bnk");
		byte[] array = new byte[stream2.Length];
		stream2.Read(array, 0, array.Length);
		SoundBanks.Add(array);
	}
}
internal class Behaviour : HuntressTracker
{
	private Animator animator;

	private Indicator lockon;

	public int maxMissiles;

	private uint ID;

	private void Awake()
	{
		//IL_0019: Unknown result type (might be due to invalid IL or missing references)
		//IL_0023: Expected O, but got Unknown
		((HuntressTracker)this).Awake();
		lockon = new Indicator(((Component)this).gameObject, Prefabs.Load<GameObject>("RoR2/Base/Engi/EngiMissileTrackingIndicator.prefab"));
		lockon.active = false;
	}

	private void Start()
	{
		((HuntressTracker)this).Start();
		AkBankManager.LoadBankAsync("char_railgunner", (BankCallback)null);
		AkBankManager.LoadBankAsync("char_Engi", (BankCallback)null);
		ID = AkSoundEngine.PostEvent("Play_Liberator_Idle_Sprint", ((Component)this).gameObject);
		animator = ((Component)base.characterBody.modelLocator.modelTransform).GetComponent<Animator>();
	}

	private void OnDisable()
	{
		AkSoundEngine.StopPlayingID(ID);
		((HuntressTracker)this).OnDisable();
	}

	public Transform SetTarget(int maxMis)
	{
		lockon.targetTransform = ((Component)base.trackingTarget).transform;
		lockon.active = true;
		maxMissiles = maxMis;
		return lockon.targetTransform;
	}

	public void ResetTarget()
	{
		lockon.targetTransform = null;
		lockon.active = false;
	}
}
internal class DisplayBehaviour : MonoBehaviour
{
	private uint ID;

	private Animator animator;

	private void Awake()
	{
		animator = ((Component)this).GetComponent<Animator>();
	}

	private void Start()
	{
		ID = AkSoundEngine.PostEvent("Play_Liberator_Mode_On", ((Component)this).gameObject);
		EntityState.PlayAnimationOnAnimator(animator, "Mode", "Enter", "Special", 1.25f, 0f);
	}

	private void OnDisable()
	{
		AkSoundEngine.StopPlayingID(ID);
	}
}
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)
	{
		if (Object.op_Implicit((Object)(object)damageInfo.attacker) && damageInfo.procCoefficient > 0f)
		{
			CharacterBody component = damageInfo.attacker.GetComponent<CharacterBody>();
			if (Object.op_Implicit((Object)(object)component) && component.baseNameToken == "LIBERATOR_NAME" && RoR2Application.rng.RangeFloat(0f, 100f) <= 30f + component.healthComponent.fullShield * 0.05f)
			{
				damageInfo.damage *= 2f;
			}
		}
		orig.Invoke(self, damageInfo);
	}

	private static void RecalculateStatsAPI_GetStatCoefficients(CharacterBody sender, StatHookEventArgs args)
	{
		if (sender.baseNameToken == "LIBERATOR_NAME")
		{
			args.baseShieldAdd += sender.healthComponent.fullHealth;
			args.moveSpeedMultAdd += 0.1f * (float)sender.maxJumpCount;
			if (Object.op_Implicit((Object)(object)sender.inventory))
			{
				args.moveSpeedMultAdd += (float)sender.inventory.GetItemCount(Items.JumpBoost) * 0.15f + 0.1f * (float)sender.maxJumpCount;
			}
		}
	}
}
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInPlugin("com.Dragonyck.Liberator", "Liberator", "1.0.0")]
[NetworkCompatibility(/*Could not decode attribute arguments.*/)]
public class MainPlugin : BaseUnityPlugin
{
	public const string MODUID = "com.Dragonyck.Liberator";

	public const string MODNAME = "Liberator";

	public const string VERSION = "1.0.0";

	public const string SURVIVORNAME = "Liberator";

	public const string SURVIVORNAMEKEY = "LIBERATOR";

	public static GameObject characterPrefab;

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

	internal const bool melee = false;

	internal static SkillDef primaryOverride;

	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_00c9: Unknown result type (might be due to invalid IL or missing references)
		//IL_00cf: Expected O, but got Unknown
		//IL_00fa: Unknown result type (might be due to invalid IL or missing references)
		//IL_010b: Unknown result type (might be due to invalid IL or missing references)
		//IL_011c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0126: Unknown result type (might be due to invalid IL or missing references)
		//IL_0136: Unknown result type (might be due to invalid IL or missing references)
		//IL_013c: Expected O, but got Unknown
		//IL_0163: Unknown result type (might be due to invalid IL or missing references)
		//IL_0174: Unknown result type (might be due to invalid IL or missing references)
		//IL_0185: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a8: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b5: Unknown result type (might be due to invalid IL or missing references)
		//IL_01c2: Unknown result type (might be due to invalid IL or missing references)
		//IL_0234: Unknown result type (might be due to invalid IL or missing references)
		//IL_0365: Unknown result type (might be due to invalid IL or missing references)
		//IL_039f: Unknown result type (might be due to invalid IL or missing references)
		//IL_03a4: Unknown result type (might be due to invalid IL or missing references)
		//IL_043a: Unknown result type (might be due to invalid IL or missing references)
		//IL_043f: Unknown result type (might be due to invalid IL or missing references)
		//IL_046c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0471: Unknown result type (might be due to invalid IL or missing references)
		//IL_0518: Unknown result type (might be due to invalid IL or missing references)
		//IL_0538: Unknown result type (might be due to invalid IL or missing references)
		//IL_0545: Unknown result type (might be due to invalid IL or missing references)
		//IL_0668: Unknown result type (might be due to invalid IL or missing references)
		//IL_0685: Unknown result type (might be due to invalid IL or missing references)
		//IL_06a2: Unknown result type (might be due to invalid IL or missing references)
		//IL_06bf: Unknown result type (might be due to invalid IL or missing references)
		//IL_06dc: Unknown result type (might be due to invalid IL or missing references)
		//IL_06f9: Unknown result type (might be due to invalid IL or missing references)
		//IL_0716: Unknown result type (might be due to invalid IL or missing references)
		//IL_0733: Unknown result type (might be due to invalid IL or missing references)
		//IL_07a5: Unknown result type (might be due to invalid IL or missing references)
		//IL_0818: Unknown result type (might be due to invalid IL or missing references)
		//IL_081d: Unknown result type (might be due to invalid IL or missing references)
		//IL_09c1: Unknown result type (might be due to invalid IL or missing references)
		//IL_09c6: Unknown result type (might be due to invalid IL or missing references)
		//IL_09e9: Unknown result type (might be due to invalid IL or missing references)
		//IL_09ee: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a1c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a21: 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, "LiberatorBody", true);
		((HuntressTracker)characterPrefab.AddComponent<Behaviour>()).maxTrackingDistance = 60f;
		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>("liberatorMdl");
		val2.AddComponent<AnimationEvents>().soundCenter = val2;
		GameObject val3 = new GameObject("ModelBase");
		val3.transform.parent = characterPrefab.transform;
		val3.transform.localPosition = new Vector3(0f, 2f, 0f);
		val3.transform.localRotation = Quaternion.identity;
		val3.transform.localScale = Vector3.one * 1.5f;
		GameObject val4 = new GameObject("AimOrigin");
		val4.transform.parent = val3.transform;
		val4.transform.localPosition = new Vector3(0f, 0f, 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 = 0f;
		CharacterBody component2 = characterPrefab.GetComponent<CharacterBody>();
		((Object)component2).name = "LiberatorBody";
		component2.baseNameToken = "LIBERATOR_NAME";
		component2.subtitleNameToken = "LIBERATOR_SUBTITLE";
		component2.bodyFlags = (BodyFlags)16;
		component2.rootMotionInMainState = false;
		component2.mainRootSpeed = 0f;
		component2.baseMaxHealth = 50f;
		component2.levelMaxHealth = 35f;
		component2.baseRegen = 1.5f;
		component2.levelRegen = 0.2f;
		component2.baseMaxShield = 0f;
		component2.levelMaxShield = 0f;
		component2.baseMoveSpeed = 9.45f;
		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 = 0;
		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 = false;
		component7.dontDetatchFromParent = true;
		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);
			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.temporaryOverlays = new List<TemporaryOverlayInstance>();
		val5.mainSkinnedMeshRenderer = componentsInChildren[0];
		LanguageAPI.Add("LIBERATORBODY_DEFAULT_SKIN_NAME", "Default");
		LanguageAPI.Add("LIBERATORBODY_SKIN01_NAME", "Black Ops");
		LanguageAPI.Add("LIBERATORBODY_SKIN02_NAME", "Covert Ops");
		LanguageAPI.Add("LIBERATORBODY_SKIN03_NAME", "Marauder");
		LanguageAPI.Add("LIBERATORBODY_SKIN04_NAME", "Mercenary");
		LanguageAPI.Add("LIBERATORBODY_SKIN05_NAME", "Tyrador");
		LanguageAPI.Add("LIBERATORBODY_SKIN06_NAME", "Umojan");
		LanguageAPI.Add("LIBERATORBODY_SKIN07_NAME", "Zerg");
		ModelSkinController val7 = val2.AddComponent<ModelSkinController>();
		val7.skins = (SkinDef[])(object)new SkinDef[8]
		{
			Skins.CreateNewSkinDef(Utils.CreateNewSkinDefInfo(componentsInChildren, val2, "LIBERATORBODY_DEFAULT_SKIN_NAME", "base", array)),
			Skins.CreateNewSkinDef(Utils.CreateNewSkinDefInfo(componentsInChildren, val2, "LIBERATORBODY_SKIN01_NAME", "blackops", array)),
			Skins.CreateNewSkinDef(Utils.CreateNewSkinDefInfo(componentsInChildren, val2, "LIBERATORBODY_SKIN02_NAME", "covertops", array)),
			Skins.CreateNewSkinDef(Utils.CreateNewSkinDefInfo(componentsInChildren, val2, "LIBERATORBODY_SKIN03_NAME", "junker", array)),
			Skins.CreateNewSkinDef(Utils.CreateNewSkinDefInfo(componentsInChildren, val2, "LIBERATORBODY_SKIN04_NAME", "merc", array)),
			Skins.CreateNewSkinDef(Utils.CreateNewSkinDefInfo(componentsInChildren, val2, "LIBERATORBODY_SKIN05_NAME", "silver", array)),
			Skins.CreateNewSkinDef(Utils.CreateNewSkinDefInfo(componentsInChildren, val2, "LIBERATORBODY_SKIN06_NAME", "umojan", array)),
			Skins.CreateNewSkinDef(Utils.CreateNewSkinDefInfo(componentsInChildren, val2, "LIBERATORBODY_SKIN07_NAME", "zerg", 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;
		PhysicMaterial val11 = Addressables.LoadAssetAsync<PhysicMaterial>((object)"RoR2/Base/Common/physmatRagdoll.physicMaterial").WaitForCompletion();
		List<Transform> list3 = new List<Transform>();
		Transform[] componentsInChildren3 = ((Component)component8.FindChild("mainBone")).GetComponentsInChildren<Transform>(true);
		foreach (Transform val12 in componentsInChildren3)
		{
			GameObject gameObject = ((Component)val12).gameObject;
			gameObject.layer = LayerIndex.ragdoll.intVal;
			if (!Object.op_Implicit((Object)(object)gameObject.GetComponent<Rigidbody>()))
			{
				gameObject.AddComponent<Rigidbody>();
			}
			CapsuleCollider val13 = gameObject.AddComponent<CapsuleCollider>();
			val13.radius = 0.4f;
			val13.height = 3.5f;
			((Collider)val13).material = val11;
			((Collider)val13).sharedMaterial = val11;
			list3.Add(val12);
		}
		RagdollController val14 = val2.AddComponent<RagdollController>();
		val14.bones = list3.ToArray();
		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 = "";
		component10.fallDamageSound = "";
		component10.aliveLoopStart = "";
		component10.aliveLoopStop = "";
		characterPrefab.GetComponent<Rigidbody>().mass = component4.mass;
		FootstepHandler val15 = val2.AddComponent<FootstepHandler>();
		val15.baseFootstepString = "Play_player_footstep";
		val15.sprintFootstepOverrideString = "";
		val15.enableFootstepDust = true;
		val15.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(DeathState));
		NetworkStateMachine component13 = ((Component)component2).GetComponent<NetworkStateMachine>();
		component13.stateMachines = ((Component)component2).GetComponents<EntityStateMachine>();
		ContentAddition.AddBody(characterPrefab);
	}

	private void RegisterCharacter()
	{
		//IL_0094: Unknown result type (might be due to invalid IL or missing references)
		//IL_0099: Unknown result type (might be due to invalid IL or missing references)
		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 they left, with another tyrannous dominion to vanquish.";
		string text3 = "..and so they vanished, another takes their last breath in the fight for freedom.";
		string text4 = "\"Need Something Liberated?\"";
		LanguageAPI.Add("LIBERATOR_NAME", "Liberator");
		LanguageAPI.Add("LIBERATOR_DESCRIPTION", text);
		LanguageAPI.Add("LIBERATOR_SUBTITLE", "Dreadnought");
		LanguageAPI.Add("LIBERATOR_OUTRO", text2);
		LanguageAPI.Add("LIBERATOR_FAIL", text3);
		LanguageAPI.Add("LIBERATOR_LORE", text4);
		SurvivorDef val = ScriptableObject.CreateInstance<SurvivorDef>();
		val.cachedName = "LIBERATOR_NAME";
		val.unlockableDef = null;
		val.descriptionToken = "LIBERATOR_DESCRIPTION";
		val.primaryColor = characterColor;
		val.bodyPrefab = characterPrefab;
		val.displayPrefab = Utils.NewDisplayModel(((Component)characterPrefab.GetComponent<ModelLocator>().modelBaseTransform).gameObject, "LiberatorDisplay");
		val.outroFlavorToken = "LIBERATOR_OUTRO";
		val.desiredSortPosition = 22f;
		val.mainEndingEscapeFailureFlavorToken = "LIBERATOR_FAIL";
		ContentAddition.AddSurvivorDef(val);
		SkillSetup();
		GameObject val2 = PrefabAPI.InstantiateClone(Prefabs.Load<GameObject>("RoR2/Base/Commando/CommandoMonsterMaster.prefab"), "LiberatorMaster", 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)
		//IL_003b: 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_004b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0053: Unknown result type (might be due to invalid IL or missing references)
		bool flag = default(bool);
		ContentAddition.AddEntityState<Primary>(ref flag);
		ContentAddition.AddEntityState<PrimaryOverride>(ref flag);
		ContentAddition.AddEntityState<Secondary>(ref flag);
		ContentAddition.AddEntityState<Utility>(ref flag);
		ContentAddition.AddEntityState<Special>(ref flag);
		ContentAddition.AddEntityState<FlyState>(ref flag);
		ContentAddition.AddEntityState<CharacterMain>(ref flag);
		ContentAddition.AddEntityState<MeleeSkillState>(ref flag);
		ContentAddition.AddEntityState<BasicMeleeSkillState>(ref flag);
		ContentAddition.AddEntityState<LiberatorState>(ref flag);
		ContentAddition.AddEntityState<Stationary>(ref flag);
	}

	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("LIBERATOR_PASSIVE_NAME", "Precision");
		LanguageAPI.Add("LIBERATOR_PASSIVE_DESCRIPTION", "Fly at the cost of <style=cIsHealth>5 shield</style> per second.");
		component.passiveSkill.enabled = true;
		component.passiveSkill.skillNameToken = "LIBERATOR_PASSIVE_NAME";
		component.passiveSkill.skillDescriptionToken = "LIBERATOR_PASSIVE_DESCRIPTION";
		component.passiveSkill.icon = Assets.Load<Sprite>("passive");
	}

	private void PrimarySetup()
	{
		SkillLocator component = characterPrefab.GetComponent<SkillLocator>();
		LanguageAPI.Add("LIBERATOR_M1", "Alternate Fire");
		LanguageAPI.Add("LIBERATOR_M1_DESCRIPTION", "Slowly shoot for <style=cIsDamage>180% damage</style>.");
		SkillDef skill = Utils.NewSkillDef<SkillDef>(typeof(Primary), "Weapon", 0, 0f, beginSkillCooldownOnSkillEnd: true, canceledFromSprinting: false, fullRestockOnAssign: true, (InterruptPriority)0, isCombatSkill: true, mustKeyPress: false, cancelSprintingOnActivation: true, 0, 0, 0, Assets.Load<Sprite>("primary"), "LIBERATOR_M1_DESCRIPTION", "LIBERATOR_M1", Array.Empty<string>());
		component.primary = Utils.NewGenericSkill(characterPrefab, skill);
		LanguageAPI.Add("LIBERATOR_M1", "Overseer Fire");
		LanguageAPI.Add("LIBERATOR_M1_DESCRIPTION", "Fire high caliber shot for <style=cIsDamage>3000% damage</style>.");
		primaryOverride = Utils.NewSkillDef<SkillDef>(typeof(PrimaryOverride), "Slide", 1, 3f, beginSkillCooldownOnSkillEnd: true, canceledFromSprinting: false, fullRestockOnAssign: true, (InterruptPriority)0, isCombatSkill: true, mustKeyPress: false, cancelSprintingOnActivation: true, 1, 1, 1, Assets.Load<Sprite>("primaryOverride"), "LIBERATOR_M1_DESCRIPTION", "LIBERATOR_M1", Array.Empty<string>());
	}

	private void SecondarySetup()
	{
		SkillLocator component = characterPrefab.GetComponent<SkillLocator>();
		LanguageAPI.Add("LIBERATOR_M2", "Fan Of Artifices");
		LanguageAPI.Add("LIBERATOR_M2_DESCRIPTION", "Fire tracking missiles for <style=cIsDamage>2x300% damage</style>.");
		SkillDef skill = Utils.NewSkillDef<HuntressTrackingSkillDef>(typeof(Secondary), "Weapon", 4, 2f, beginSkillCooldownOnSkillEnd: true, canceledFromSprinting: false, fullRestockOnAssign: false, (InterruptPriority)1, isCombatSkill: true, mustKeyPress: false, cancelSprintingOnActivation: false, 1, 1, 1, Assets.Load<Sprite>("secondary"), "LIBERATOR_M2_DESCRIPTION", "LIBERATOR_M2", Array.Empty<string>());
		component.secondary = Utils.NewGenericSkill(characterPrefab, skill);
	}

	private void UtilitySetup()
	{
		SkillLocator component = characterPrefab.GetComponent<SkillLocator>();
		LanguageAPI.Add("LIBERATOR_UTIL", "Death Sentence");
		LanguageAPI.Add("LIBERATOR_UTIL_DESCRIPTION", "Lock-on a target and fire a barrage of mossiles, dealing <style=cIsDamage>6x200% damage</style>. Gain an additional missile per <style=cIsDamage>2% attack speed</style>.");
		SkillDef skill = Utils.NewSkillDef<HuntressTrackingSkillDef>(typeof(Utility), "Weapon", 1, 5f, beginSkillCooldownOnSkillEnd: true, canceledFromSprinting: false, fullRestockOnAssign: false, (InterruptPriority)1, isCombatSkill: true, mustKeyPress: true, cancelSprintingOnActivation: false, 1, 1, 1, Assets.Load<Sprite>("utility"), "LIBERATOR_UTIL_DESCRIPTION", "LIBERATOR_UTIL", Array.Empty<string>());
		component.utility = Utils.NewGenericSkill(characterPrefab, skill);
	}

	private void SpecialSetup()
	{
		SkillLocator component = characterPrefab.GetComponent<SkillLocator>();
		LanguageAPI.Add("LIBERATOR_SPEC", "Overseer");
		LanguageAPI.Add("LIBERATOR_SPEC_DESCRIPTION", "Enter a defensive mode and become completely <style=cIsUtility>stationary</style>, and gain <style=cIsDamage>invincibility</style>. You and nearby allies within <style=cIsUtility>20m</style> are granted <style=cIsUtility>invisibility</style>. While stationary, you are able to fire high caliber shots dealing <style=cIsDamage>3000% damage</style>. Consume <style=cIsHealth>20 shield</style> every second, and exit defensive mode after it's full depletion.");
		SkillDef skill = Utils.NewSkillDef<SkillDef>(typeof(Special), "Weapon", 1, 8f, beginSkillCooldownOnSkillEnd: true, canceledFromSprinting: false, fullRestockOnAssign: false, (InterruptPriority)1, isCombatSkill: true, mustKeyPress: true, cancelSprintingOnActivation: false, 1, 1, 1, Assets.Load<Sprite>("special"), "LIBERATOR_SPEC_DESCRIPTION", "LIBERATOR_SPEC", Array.Empty<string>());
		component.special = Utils.NewGenericSkill(characterPrefab, skill);
	}
}
internal class Prefabs
{
	internal static GameObject invisWard;

	internal static GameObject snipeTracer;

	internal static GameObject microMissile;

	internal static GameObject primaryTracer;

	internal static GameObject sniperImpactVFX;

	internal static GameObject sniperTracer;

	internal static GameObject sniperTracer2;

	internal static GameObject missileMuzzleEffect;

	internal static void CreatePrefabs()
	{
		//IL_0047: Unknown result type (might be due to invalid IL or missing references)
		//IL_0051: Expected O, but got Unknown
		//IL_0065: Unknown result type (might be due to invalid IL or missing references)
		//IL_0071: Unknown result type (might be due to invalid IL or missing references)
		//IL_008e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0098: Expected O, but got Unknown
		//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d9: Unknown result type (might be due to invalid IL or missing references)
		//IL_0139: Unknown result type (might be due to invalid IL or missing references)
		//IL_0143: Unknown result type (might be due to invalid IL or missing references)
		//IL_016a: Unknown result type (might be due to invalid IL or missing references)
		//IL_016f: Unknown result type (might be due to invalid IL or missing references)
		//IL_01dc: Unknown result type (might be due to invalid IL or missing references)
		//IL_01e6: Expected O, but got Unknown
		//IL_01ff: Unknown result type (might be due to invalid IL or missing references)
		//IL_0204: Unknown result type (might be due to invalid IL or missing references)
		//IL_02c2: Unknown result type (might be due to invalid IL or missing references)
		//IL_02c9: Expected O, but got Unknown
		//IL_02dc: Unknown result type (might be due to invalid IL or missing references)
		//IL_02e1: Unknown result type (might be due to invalid IL or missing references)
		//IL_03a0: Unknown result type (might be due to invalid IL or missing references)
		//IL_03a7: Expected O, but got Unknown
		//IL_03c2: Unknown result type (might be due to invalid IL or missing references)
		//IL_03c7: Unknown result type (might be due to invalid IL or missing references)
		Texture2D val = Load<Texture2D>("RoR2/Base/Common/ColorRamps/texRampBrotherPillar.png");
		sniperTracer2 = Instantiate("RoR2/Base/Bandit2/TracerBandit2Rifle.prefab", "SniperTracer2");
		sniperTracer2.GetComponent<Tracer>().speed = 760f;
		LineRenderer component = sniperTracer2.GetComponent<LineRenderer>();
		((Renderer)component).material = new Material(((Renderer)component).material);
		((Renderer)component).material.SetTexture("_RemapTex", (Texture)(object)val);
		component.startColor = Color.cyan;
		component.endColor = Color.cyan;
		ParticleSystemRenderer componentInChildren = sniperTracer2.GetComponentInChildren<ParticleSystemRenderer>();
		((Renderer)componentInChildren).material = new Material(((Renderer)componentInChildren).material);
		((Renderer)componentInChildren).material.DisableKeyword("VERTEXCOLOR");
		((Renderer)componentInChildren).material.SetTexture("_RemapTex", (Texture)(object)val);
		((Renderer)componentInChildren).material.SetColor("_TintColor", Color32.op_Implicit(new Color32((byte)0, (byte)100, byte.MaxValue, byte.MaxValue)));
		ContentAddition.AddEffect(sniperTracer2);
		sniperTracer = Instantiate("RoR2/Base/Golem/TracerGolem.prefab", "SniperTracer");
		sniperTracer.AddComponent<VFXAttributes>();
		ContentAddition.AddEffect(sniperTracer);
		missileMuzzleEffect = Instantiate("RoR2/Base/Common/VFX/OmniExplosionVFXQuick.prefab", "MissileMuzzleEffect");
		missileMuzzleEffect.transform.localScale = Vector3.one * 0.5f;
		ParticleSystem[] componentsInChildren = missileMuzzleEffect.GetComponentsInChildren<ParticleSystem>();
		foreach (ParticleSystem val2 in componentsInChildren)
		{
			MainModule main = val2.main;
			((MainModule)(ref main)).scalingMode = (ParticleSystemScalingMode)0;
		}
		Utils.RegisterEffect(missileMuzzleEffect, -1f, "Play_mage_m1_impact");
		primaryTracer = Instantiate("RoR2/Base/Commando/TracerCommandoShotgun.prefab", "PrimaryTracer");
		primaryTracer.GetComponent<Tracer>().speed = 390f;
		LineRenderer component2 = primaryTracer.GetComponent<LineRenderer>();
		((Renderer)component2).material = new Material(((Renderer)component2).material);
		((Renderer)component2).material.SetColor("_TintColor", Color32.op_Implicit(new Color32(byte.MaxValue, (byte)122, (byte)0, byte.MaxValue)));
		ContentAddition.AddEffect(primaryTracer);
		sniperImpactVFX = Instantiate("RoR2/Base/Common/VFX/OmniImpactVFXLarge.prefab", "SnipeImpact");
		Utils.RegisterEffect(sniperImpactVFX, -1f, "Play_Liberator_Sniper_Impact");
		microMissile = Instantiate("RoR2/Base/Drones/MicroMissileProjectile.prefab", "MicroMissile", registerNetwork: true);
		microMissile.GetComponent<MissileController>().maxVelocity = 72f;
		ContentAddition.AddProjectile(microMissile);
		snipeTracer = Instantiate("RoR2/Base/Toolbot/TracerToolbotRebar.prefab", "SnipeTracer");
		((Renderer)snipeTracer.GetComponentInChildren<MeshRenderer>()).enabled = false;
		ParticleSystemRenderer val3 = snipeTracer.GetComponentsInChildren<ParticleSystemRenderer>()[^1];
		Material val4 = new Material(Load<Material>("RoR2/Base/MagmaWorm/matMagmaWormFireballTrail.mat"));
		val4.SetColor("_TintColor", Color32.op_Implicit(new Color32(byte.MaxValue, (byte)2, (byte)0, byte.MaxValue)));
		val4.SetTexture("_RemapTex", (Texture)(object)Load<Texture2D>("RoR2/Base/Common/ColorRamps/texRampIce.png"));
		val4.SetFloat("_Boost", 15f);
		((Renderer)val3).materials = (Material[])(object)new Material[2] { val4, val4 };
		ContentAddition.AddEffect(snipeTracer);
		invisWard = Instantiate("RoR2/Base/EliteHaunted/AffixHauntedWard.prefab", "InvisWard", registerNetwork: true);
		Object.DestroyImmediate((Object)(object)invisWard.GetComponent<AkEvent>());
		Object.DestroyImmediate((Object)(object)invisWard.GetComponent<AkEvent>());
		BuffWard component3 = invisWard.GetComponent<BuffWard>();
		component3.buffDef = Load<BuffDef>("RoR2/Base/Common/bdCloak.asset");
		component3.radius = 20f;
		Material val5 = new Material(Load<Material>("RoR2/Base/Captain/matCaptainSupplyDropAreaIndicator2.mat"));
		val5.SetColor("_TintColor", Color32.op_Implicit(new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, (byte)163)));
		((Renderer)invisWard.GetComponentInChildren<MeshRenderer>()).materials = (Material[])(object)new Material[2] { val5, val5 };
		invisWard.GetComponent<NetworkedBodyAttachment>().hasEffectiveAuthority = true;
	}

	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 BasicMeleeSkillState : BaseSkillState
{
	private float duration = 0.2f;

	private Vector3 dir;

	private OverlapAttack attack;

	private float damageCoefficient = 4.2f;

	private GameObject hitEffectPrefab = null;

	private bool parried;

	public Animator animator;

	private uint ID;

	private string hitboxGroupName = "";

	public override void OnEnter()
	{
		((BaseState)this).OnEnter();
		animator = ((EntityState)this).GetModelAnimator();
		if (!animator.GetBool("slide"))
		{
			((BaseState)this).StartAimMode(1f, true);
		}
		((EntityState)this).PlayAnimation("LeftArm, Override", "MeleeAttack");
		AkSoundEngine.PostEvent(ID, ((EntityState)this).gameObject);
		attack = ((BaseState)this).InitMeleeOverlap(damageCoefficient, hitEffectPrefab, ((EntityState)this).GetModelTransform(), hitboxGroupName);
	}

	public override void FixedUpdate()
	{
		((EntityState)this).FixedUpdate();
		if (((EntityState)this).isAuthority)
		{
			attack.Fire((List<HurtBox>)null);
		}
		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 Stationary : CharacterMain
{
	public override void FixedUpdate()
	{
		//IL_001e: Unknown result type (might be due to invalid IL or missing references)
		//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_002c: Unknown result type (might be due to invalid IL or missing references)
		//IL_005e: Unknown result type (might be due to invalid IL or missing references)
		base.FixedUpdate();
		Transform modelTransform = ((EntityState)this).modelLocator.modelTransform;
		Vector3 forward = ((EntityState)this).modelLocator.modelTransform.forward;
		Ray aimRay = ((BaseState)this).GetAimRay();
		modelTransform.forward = Vector3.Lerp(forward, ((Ray)(ref aimRay)).direction, 5f * Math.Max(1f, ((EntityState)this).characterBody.moveSpeed / ((EntityState)this).characterBody.baseMoveSpeed) * Time.fixedDeltaTime);
		((EntityState)this).healthComponent.isShieldRegenForced = false;
		if (NetworkServer.active)
		{
			((EntityState)this).characterBody.outOfDangerStopwatch = 0f;
			((EntityState)this).characterBody.outOfDanger = false;
			((EntityState)this).healthComponent.Networkshield = Math.Max(0f, ((EntityState)this).healthComponent.Networkshield - 10f * Time.fixedDeltaTime);
		}
	}

	public override void HandleCost()
	{
	}

	public override void HandleMovements()
	{
	}
}
internal class CharacterMain : GenericCharacterMain
{
	private bool _providingAntiGravity;

	private bool _providingFlight;

	private ICharacterGravityParameterProvider targetCharacterGravityParameterProvider;

	private ICharacterFlightParameterProvider targetCharacterFlightParameterProvider;

	private Behaviour behaviour;

	private bool providingAntiGravity
	{
		get
		{
			return _providingAntiGravity;
		}
		set
		{
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			if (_providingAntiGravity != value)
			{
				_providingAntiGravity = value;
				if (targetCharacterGravityParameterProvider != null)
				{
					CharacterGravityParameters gravityParameters = targetCharacterGravityParameterProvider.gravityParameters;
					gravityParameters.channeledAntiGravityGranterCount += (_providingAntiGravity ? 1 : (-1));
					targetCharacterGravityParameterProvider.gravityParameters = gravityParameters;
				}
			}
		}
	}

	private bool providingFlight
	{
		get
		{
			return _providingFlight;
		}
		set
		{
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			if (_providingFlight != value)
			{
				_providingFlight = value;
				if (targetCharacterFlightParameterProvider != null)
				{
					CharacterFlightParameters flightParameters = targetCharacterFlightParameterProvider.flightParameters;
					flightParameters.channeledFlightGranterCount += (_providingFlight ? 1 : (-1));
					targetCharacterFlightParameterProvider.flightParameters = flightParameters;
				}
			}
		}
	}

	private void StartFlight()
	{
		((EntityState)this).modelLocator.normalizeToFloor = true;
		providingAntiGravity = true;
		providingFlight = true;
		if (((EntityState)this).characterBody.hasEffectiveAuthority && Object.op_Implicit((Object)(object)((EntityState)this).characterBody.characterMotor) && ((EntityState)this).characterBody.characterMotor.isGrounded)
		{
			((BaseCharacterController)((EntityState)this).characterBody.characterMotor).Motor.ForceUnground(0.1f);
		}
	}

	public override void OnEnter()
	{
		((GenericCharacterMain)this).OnEnter();
		behaviour = ((EntityState)this).GetComponent<Behaviour>();
		targetCharacterGravityParameterProvider = ((Component)((EntityState)this).characterBody).GetComponent<ICharacterGravityParameterProvider>();
		targetCharacterFlightParameterProvider = ((Component)((EntityState)this).characterBody).GetComponent<ICharacterFlightParameterProvider>();
	}

	private void StopFlight()
	{
		((BaseState)this).StartAimMode(2f, false);
		providingFlight = false;
		providingAntiGravity = false;
		((EntityState)this).modelLocator.normalizeToFloor = false;
	}

	public virtual void HandleCost()
	{
		//IL_0014: 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_0028: Unknown result type (might be due to invalid IL or missing references)
		if (Object.op_Implicit((Object)(object)behaviour) && !Physics.Raycast(((EntityState)this).transform.position, Vector3.down, 2.5f, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask)))
		{
			((EntityState)this).healthComponent.isShieldRegenForced = false;
			if (NetworkServer.active)
			{
				((EntityState)this).characterBody.outOfDangerStopwatch = 0f;
				((EntityState)this).characterBody.outOfDanger = false;
				((EntityState)this).healthComponent.Networkshield = Math.Max(0f, ((EntityState)this).healthComponent.Networkshield - 5f * Time.fixedDeltaTime);
			}
		}
	}

	public override void ProcessJump()
	{
	}

	public override void FixedUpdate()
	{
		//IL_001e: Unknown result type (might be due to invalid IL or missing references)
		//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_002c: Unknown result type (might be due to invalid IL or missing references)
		//IL_005e: Unknown result type (might be due to invalid IL or missing references)
		((GenericCharacterMain)this).FixedUpdate();
		Transform modelTransform = ((EntityState)this).modelLocator.modelTransform;
		Vector3 forward = ((EntityState)this).modelLocator.modelTransform.forward;
		Ray aimRay = ((BaseState)this).GetAimRay();
		modelTransform.forward = Vector3.Lerp(forward, ((Ray)(ref aimRay)).direction, 5f * Math.Max(1f, ((EntityState)this).characterBody.moveSpeed / ((EntityState)this).characterBody.baseMoveSpeed) * Time.fixedDeltaTime);
		if (((EntityState)this).characterBody.characterMotor.disableAirControlUntilCollision || ((EntityState)this).healthComponent.shield <= 0f)
		{
			StopFlight();
		}
		else if (((EntityState)this).healthComponent.shield > 0f)
		{
			StartFlight();
		}
		if (providingFlight)
		{
			HandleCost();
		}
	}

	public override void OnExit()
	{
		StopFlight();
		((EntityState)this).modelLocator.normalizeToFloor = false;
		((GenericCharacterMain)this).OnExit();
	}
}
internal class DeathState : DeathState
{
	public override void OnEnter()
	{
		//IL_0013: Unknown result type (might be due to invalid IL or missing references)
		//IL_0018: 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_0024: 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_0051: 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)
		((DeathState)this).OnEnter();
		Vector3 position = ((BaseState)this).FindModelChild("center").position;
		EffectManager.SimpleEffect(Prefabs.Load<GameObject>("RoR2/Base/Common/VFX/OmniExplosionVFXDroneDeath.prefab"), position, Quaternion.identity, false);
		EffectManager.SimpleEffect(Prefabs.Load<GameObject>("RoR2/Base/LemurianBruiser/OmniExplosionVFXLemurianBruiserFireballImpact.prefab"), position, Quaternion.identity, false);
		EffectManager.SimpleEffect(Prefabs.Load<GameObject>("RoR2/Base/Toolbot/CryoCanisterExplosionPrimary.prefab"), position, Quaternion.identity, false);
	}
}
internal class LiberatorState : BaseSkillState
{
	public Behaviour behaviour;

	public override void OnEnter()
	{
		((BaseState)this).OnEnter();
		behaviour = ((EntityState)this).GetComponent<Behaviour>();
	}
}
internal class MeleeSkillState : BaseSkillState
{
	public float attackDuration;

	private bool hopped;

	private bool hasSwung;

	public bool isInHitPause;

	public float hitPauseDuration;

	public float hopVelocity;

	public float hitPauseTimer;

	public float stopwatch;

	public HitStopCachedState hitStopCachedState;

	public OverlapAttack overlapAttack;

	public bool hasHit;

	private bool hasAnimParameter;

	private float attackSpeedScaling;

	public Animator animator;

	public virtual float baseAttackDuration => 0f;

	public virtual float earlyExitDurationPercentage => 0f;

	public virtual float damageCoefficient => 0f;

	public virtual float forceMagnitude => 440f;

	public virtual float rootMotionSpeed => 25f;

	public virtual float baseHopVelocity => 4f;

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

	public virtual string animationStateName => "";

	public virtual string animParameter => "M1";

	public virtual string hitBoxGroupName => "";

	public virtual string hitBoxActiveParameter => "Curve";

	public virtual string swingMuzzle => "";

	public virtual GameObject swingEffectPrefab => null;

	public virtual bool hopOnHit => true;

	public virtual bool rootMotion => false;

	public virtual bool rootMotionWhileHitting => false;

	public virtual string swingSound => "";

	public virtual DamageType damageType => (DamageType)0;

	public virtual DamageColorIndex damageColor => (DamageColorIndex)0;

	public virtual Vector3 bonusForce => Vector3.zero;

	public virtual GameObject hitEffectPrefab => null;

	public override void OnEnter()
	{
		//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
		//IL_00be: Unknown result type (might be due to invalid IL or missing references)
		((BaseState)this).OnEnter();
		attackSpeedScaling = Math.Min(((BaseState)this).attackSpeedStat, 6f);
		attackDuration = baseAttackDuration / attackSpeedScaling;
		hitPauseDuration = GroundLight.hitPauseDuration / attackSpeedScaling;
		hopVelocity = baseHopVelocity / attackSpeedScaling;
		animator = ((EntityState)this).GetModelAnimator();
		animator.SetFloat(hitBoxActiveParameter, 0f);
		overlapAttack = ((BaseState)this).InitMeleeOverlap(damageCoefficient, hitEffectPrefab, ((EntityState)this).GetModelTransform(), hitBoxGroupName);
		overlapAttack.pushAwayForce = 1f;
		overlapAttack.damageType = DamageTypeCombo.op_Implicit(damageType);
		hasAnimParameter = !Utility.IsNullOrWhiteSpace(animParameter);
		if (hasAnimParameter && !Utility.IsNullOrWhiteSpace(animationStateName))
		{
			((EntityState)this).PlayAnimation(layerName, animationStateName, animParameter, attackDuration, 0f);
		}
	}

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

	public override void FixedUpdate()
	{
		//IL_0030: Unknown result type (might be due to invalid IL or missing references)
		//IL_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_00fe: Unknown result type (might be due to invalid IL or missing references)
		//IL_0106: Unknown result type (might be due to invalid IL or missing references)
		//IL_0110: Unknown result type (might be due to invalid IL or missing references)
		//IL_0115: Unknown result type (might be due to invalid IL or missing references)
		//IL_011a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0195: Unknown result type (might be due to invalid IL or missing references)
		//IL_019a: Unknown result type (might be due to invalid IL or missing references)
		((EntityState)this).FixedUpdate();
		if (((EntityState)this).isAuthority)
		{
			bool flag = FireMeleeAttack(overlapAttack, animator, hitBoxActiveParameter, forceMagnitude, bonusForce);
			hasHit = flag;
			if (hasHit)
			{
				if (hopOnHit && !((EntityState)this).characterMotor.isGrounded && !hopped)
				{
					((BaseState)this).SmallHop(((EntityState)this).characterMotor, hopVelocity);
					hopped = true;
				}
				if (!rootMotionWhileHitting && !isInHitPause && hasAnimParameter)
				{
					isInHitPause = true;
				}
			}
			if (animator.GetFloat(hitBoxActiveParameter) > 0.1f && rootMotion && !isInHitPause)
			{
				Vector3 val = rootMotionDirection();
				CharacterMotor characterMotor = ((EntityState)this).characterMotor;
				characterMotor.rootMotion += val * rootMotionSpeed * Time.fixedDeltaTime;
			}
			if (hitPauseTimer >= hitPauseDuration && isInHitPause)
			{
				isInHitPause = false;
				animator.speed = 1f;
			}
			if (!isInHitPause)
			{
				stopwatch += Time.fixedDeltaTime;
			}
			else
			{
				hitPauseTimer += Time.fixedDeltaTime;
				((EntityState)this).characterMotor.velocity = Vector3.zero;
				animator.speed = 0f;
			}
			if (stopwatch >= attackDuration * earlyExitDurationPercentage)
			{
				if (((EntityState)this).inputBank.skill1.down)
				{
					SetState();
				}
				if (stopwatch >= attackDuration)
				{
					BaseSkillState val2 = StateOverride();
					if (val2 != null)
					{
						((EntityState)this).outer.SetNextState((EntityState)(object)val2);
					}
					else
					{
						((EntityState)this).outer.SetNextStateToMain();
					}
					return;
				}
			}
		}
		if (animator.GetFloat(hitBoxActiveParameter) >= 0.11f && !hasSwung)
		{
			hasSwung = true;
			AkSoundEngine.PostEvent(swingSound, ((EntityState)this).gameObject);
			if (Object.op_Implicit((Object)(object)swingEffectPrefab) && !Utility.IsNullOrWhiteSpace(swingMuzzle))
			{
				EffectManager.SimpleMuzzleFlash(swingEffectPrefab, ((EntityState)this).gameObject, swingMuzzle, false);
			}
		}
	}

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

	public virtual void SetState()
	{
	}

	public virtual BaseSkillState StateOverride()
	{
		return null;
	}

	public override InterruptPriority GetMinimumInterruptPriority()
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0005: Unknown result type (might be due to invalid IL or missing references)
		return (InterruptPriority)1;
	}
}
internal class Primary : BaseSkillState
{
	private float duration;

	private float baseDuration = 0.5f;

	private float damageCoefficient = 1.8f;

	private string muzzle = "Muzzle";

	private GameObject muzzleflash = Prefabs.Load<GameObject>("RoR2/Base/Common/VFX/MuzzleflashBarrage.prefab");

	private GameObject tracer = Prefabs.primaryTracer;

	private GameObject hiteffect = Prefabs.Load<GameObject>("RoR2/Base/Common/VFX/OmniImpactVFX.prefab");

	public override void OnEnter()
	{
		((BaseState)this).OnEnter();
		duration = baseDuration / ((BaseState)this).attackSpeedStat;
		Fire();
	}

	private void Fire()
	{
		//IL_0074: Unknown result type (might be due to invalid IL or missing references)
		//IL_0079: 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_008c: Unknown result type (might be due to invalid IL or missing references)
		//IL_008f: Unknown result type (might be due to invalid IL or missing references)
		//IL_009a: Unknown result type (might be due to invalid IL or missing references)
		//IL_009d: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
		//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
		//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d9: 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_00ea: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f6: Unknown result type (might be due to invalid IL or missing references)
		//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
		//IL_0100: Unknown result type (might be due to invalid IL or missing references)
		//IL_0108: Unknown result type (might be due to invalid IL or missing references)
		//IL_010f: Unknown result type (might be due to invalid IL or missing references)
		//IL_011b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0127: Unknown result type (might be due to invalid IL or missing references)
		//IL_0133: Unknown result type (might be due to invalid IL or missing references)
		//IL_013a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0140: Unknown result type (might be due to invalid IL or missing references)
		//IL_0146: Unknown result type (might be due to invalid IL or missing references)
		//IL_0151: Unknown result type (might be due to invalid IL or missing references)
		//IL_015c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0163: Unknown result type (might be due to invalid IL or missing references)
		//IL_0164: Unknown result type (might be due to invalid IL or missing references)
		//IL_0169: Unknown result type (might be due to invalid IL or missing references)
		//IL_016e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0175: Unknown result type (might be due to invalid IL or missing references)
		//IL_0181: Unknown result type (might be due to invalid IL or missing references)
		//IL_018c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0197: Unknown result type (might be due to invalid IL or missing references)
		AkSoundEngine.PostEvent("Play_Liberator_Attack", ((EntityState)this).gameObject);
		EffectManager.SimpleMuzzleFlash(muzzleflash, ((EntityState)this).gameObject, muzzle, false);
		float num = 0.65f;
		((BaseState)this).AddRecoil(-1f * num, -1.5f * num, -0.25f * num, 0.25f * num);
		((EntityState)this).characterBody.AddSpreadBloom(0.5f);
		if (((EntityState)this).isAuthority)
		{
			Ray aimRay = ((BaseState)this).GetAimRay();
			float num2 = 0.0425f;
			new BulletAttack
			{
				bulletCount = 1u,
				aimVector = ((Ray)(ref aimRay)).direction,
				origin = ((Ray)(ref aimRay)).origin,
				damage = ((BaseState)this).damageStat * damageCoefficient,
				damageColorIndex = (DamageColorIndex)0,
				damageType = (DamageTypeCombo.GenericPrimary | DamageTypeCombo.op_Implicit((DamageType)2)),
				falloffModel = (FalloffModel)0,
				maxDistance = 300f,
				force = 20f,
				hitMask = CommonMasks.bullet,
				minSpread = 0f - num2,
				maxSpread = num2,
				isCrit = ((BaseState)this).RollCrit(),
				owner = ((EntityState)this).gameObject,
				muzzleName = muzzle,
				smartCollision = false,
				procChainMask = default(ProcChainMask),
				procCoefficient = 1f,
				radius = 0.08f,
				sniper = false,
				stopperMask = CommonMasks.bullet,
				weapon = null,
				tracerEffectPrefab = tracer,
				spreadPitchScale = 1f,
				spreadYawScale = 1f,
				hitEffectPrefab = hiteffect
			}.Fire();
		}
	}

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

	private float baseDuration = 0.5f;

	private float damageCoefficient = 30f;

	private string muzzle = "Muzzle";

	private GameObject muzzleflash = Prefabs.Load<GameObject>("RoR2/Base/Commando/HitsparkCommandoShotgun.prefab");

	private GameObject hiteffect = Prefabs.sniperImpactVFX;

	public override void OnEnter()
	{
		((BaseState)this).OnEnter();
		duration = baseDuration / ((BaseState)this).attackSpeedStat;
		Fire();
	}

	private void Fire()
	{
		//IL_0094: Unknown result type (might be due to invalid IL or missing references)
		//IL_0099: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
		//IL_00af: 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_00bd: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00da: Unknown result type (might be due to invalid IL or missing references)
		//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e2: Unknown result type (might be due to invalid IL or missing references)
		//IL_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_00f7: 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_00fe: Unknown result type (might be due to invalid IL or missing references)
		//IL_010a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0115: Unknown result type (might be due to invalid IL or missing references)
		//IL_0116: Unknown result type (might be due to invalid IL or missing references)
		//IL_011b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0120: Unknown result type (might be due to invalid IL or missing references)
		//IL_0128: Unknown result type (might be due to invalid IL or missing references)
		//IL_012f: Unknown result type (might be due to invalid IL or missing references)
		//IL_013b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0147: Unknown result type (might be due to invalid IL or missing references)
		//IL_0153: Unknown result type (might be due to invalid IL or missing references)
		//IL_015a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0160: Unknown result type (might be due to invalid IL or missing references)
		//IL_0166: Unknown result type (might be due to invalid IL or missing references)
		//IL_0171: Unknown result type (might be due to invalid IL or missing references)
		//IL_017c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0183: Unknown result type (might be due to invalid IL or missing references)
		//IL_0184: Unknown result type (might be due to invalid IL or missing references)
		//IL_0189: Unknown result type (might be due to invalid IL or missing references)
		//IL_018e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0195: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a0: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ab: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b6: Unknown result type (might be due to invalid IL or missing references)
		((EntityState)this).PlayAnimation("Turret", "Fire", "M1", 0.3f, 0f);
		AkSoundEngine.PostEvent("Play_Liberator_Sniper_Attack", ((EntityState)this).gameObject);
		EffectManager.SimpleMuzzleFlash(muzzleflash, ((EntityState)this).gameObject, muzzle, false);
		float num = 4.5f;
		((BaseState)this).AddRecoil(-1f * num, -1.5f * num, -0.25f * num, 0.25f * num);
		((EntityState)this).characterBody.AddSpreadBloom(5f);
		if (((EntityState)this).isAuthority)
		{
			Ray aimRay = ((BaseState)this).GetAimRay();
			float num2 = 0.0425f;
			new BulletAttack
			{
				bulletCount = 1u,
				aimVector = ((Ray)(ref aimRay)).direction,
				origin = ((Ray)(ref aimRay)).origin,
				damage = ((BaseState)this).damageStat * damageCoefficient,
				damageColorIndex = (DamageColorIndex)0,
				damageType = (DamageTypeCombo.GenericSpecial | DamageTypeCombo.op_Implicit((DamageType)2)),
				falloffModel = (FalloffModel)0,
				maxDistance = 300f,
				force = 20f,
				hitMask = CommonMasks.bullet,
				minSpread = 0f - num2,
				maxSpread = num2,
				isCrit = ((BaseState)this).RollCrit(),
				owner = ((EntityState)this).gameObject,
				muzzleName = muzzle,
				smartCollision = false,
				procChainMask = default(ProcChainMask),
				procCoefficient = 1f,
				radius = 0.18f,
				sniper = false,
				stopperMask = CommonMasks.bullet,
				weapon = null,
				tracerEffectPrefab = Prefabs.sniperTracer2,
				spreadPitchScale = 1f,
				spreadYawScale = 1f,
				hitEffectPrefab = muzzleflash
			}.Fire();
		}
	}

	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 Secondary : LiberatorState
{
	private float duration;

	private bool hasFired = false;

	private GameObject target;

	private Transform muzzleL;

	private Transform muzzleR;

	private bool played;

	private GameObject muzzleFlash = Prefabs.missileMuzzleEffect;

	private GameObject projectile = Prefabs.microMissile;

	private float fireDuration => 0.35f;

	public override void OnEnter()
	{
		base.OnEnter();
		duration = fireDuration * 2f / ((BaseState)this).attackSpeedStat;
		target = (Object.op_Implicit((Object)(object)((HuntressTracker)behaviour).trackingTarget) ? ((Component)((HuntressTracker)behaviour).trackingTarget).gameObject : null);
		((EntityState)this).PlayAnimation("Missile", "Start", "Utility", fireDuration, 0f);
		muzzleL = ((BaseState)this).FindModelChild("misMuzzleL");
		muzzleR = ((BaseState)this).FindModelChild("misMuzzleR");
		AkSoundEngine.PostEvent("Play_Liberator_Missile_On", ((EntityState)this).gameObject);
	}

	public override void FixedUpdate()
	{
		((EntityState)this).FixedUpdate();
		if (!hasFired && ((EntityState)this).fixedAge >= fireDuration)
		{
			hasFired = true;
			FireProjectile(muzzleL, -1f);
			FireProjectile(muzzleR, 1f);
		}
		if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= duration && hasFired)
		{
			((EntityState)this).outer.SetNextStateToMain();
		}
	}

	private void FireProjectile(Transform muzzle, float mult)
	{
		//IL_0047: Unknown result type (might be due to invalid IL or missing references)
		//IL_004c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0074: 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_008b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0090: Unknown result type (might be due to invalid IL or missing references)
		//IL_0093: Unknown result type (might be due to invalid IL or missing references)
		//IL_0098: Unknown result type (might be due to invalid IL or missing references)
		//IL_009d: 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_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)
		if (Object.op_Implicit((Object)(object)target))
		{
			if (!played)
			{
				played = true;
				AkSoundEngine.PostEvent("Play_Liberator_Missile_Attack", ((EntityState)this).gameObject);
			}
			EffectManager.SimpleEffect(muzzleFlash, muzzle.position, Quaternion.identity, false);
			if (((EntityState)this).isAuthority)
			{
				ProjectileManager instance = ProjectileManager.instance;
				GameObject obj = projectile;
				Vector3 position = muzzle.position;
				Quaternion val = Quaternion.AngleAxis(25f * mult, Vector3.up);
				Ray aimRay = ((BaseState)this).GetAimRay();
				instance.FireProjectile(obj, position, Quaternion.LookRotation(val * ((Ray)(ref aimRay)).direction), ((EntityState)this).gameObject, ((BaseState)this).damageStat * 3f, 150f, ((BaseState)this).RollCrit(), (DamageColorIndex)0, target, -1f, (DamageTypeCombo?)(DamageTypeCombo.GenericSecondary | DamageTypeCombo.op_Implicit((DamageType)2)));
			}
		}
	}

	public override void OnExit()
	{
		AkSoundEngine.PostEvent("Play_Liberator_Missile_Off", ((EntityState)this).gameObject);
		((EntityState)this).PlayAnimation("Missile", "End", "Utility", fireDuration, 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 GameObject attachment;

	private EntityStateMachine bodyMachine;

	public override void OnEnter()
	{
		//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d3: Unknown result type (might be due to invalid IL or missing references)
		((BaseState)this).OnEnter();
		if (((EntityState)this).isAuthority && ((EntityState)this).healthComponent.shield <= 0f)
		{
			((EntityState)this).outer.SetNextStateToMain();
			return;
		}
		((EntityState)this).PlayAnimation("Mode", "Enter", "Special", 0.85f, 0f);
		((EntityState)this).skillLocator.primary.SetSkillOverride((object)this, MainPlugin.primaryOverride, (SkillOverridePriority)4);
		AkSoundEngine.PostEvent("Play_Liberator_Mode_On", ((EntityState)this).gameObject);
		AkSoundEngine.PostEvent("Play_Liberator_Cloak_On", ((EntityState)this).gameObject);
		if (NetworkServer.active)
		{
			attachment = Object.Instantiate<GameObject>(Prefabs.invisWard, ((EntityState)this).transform.position, Quaternion.identity);
			attachment.GetComponent<TeamFilter>().teamIndex = ((EntityState)this).teamComponent.teamIndex;
			attachment.GetComponent<NetworkedBodyAttachment>().AttachToGameObjectAndSpawn(((EntityState)this).gameObject, (string)null);
			((EntityState)this).characterBody.AddBuff(Buffs.HiddenInvincibility);
		}
		bodyMachine = ((EntityState)this).GetComponent<EntityStateMachine>();
		if (((EntityState)this).isAuthority)
		{
			bodyMachine.SetNextState((EntityState)(object)new Stationary());
		}
	}

	public override void FixedUpdate()
	{
		((EntityState)this).FixedUpdate();
		((BaseState)this).StartAimMode(2f, false);
		if ((((EntityState)this).isAuthority && ((EntityState)this).healthComponent.shield <= 0f) || (((EntityState)this).fixedAge >= 0.4f && ((ButtonState)(ref ((EntityState)this).inputBank.skill4)).justPressed))
		{
			((EntityState)this).outer.SetNextStateToMain();
		}
	}

	public override void OnExit()
	{
		AkSoundEngine.PostEvent("Play_Liberator_Mode_Off", ((EntityState)this).gameObject);
		AkSoundEngine.PostEvent("Play_Liberator_Cloak_Off", ((EntityState)this).gameObject);
		if (NetworkServer.active)
		{
			((EntityState)this).characterBody.RemoveBuff(Buffs.HiddenInvincibility);
			if (Object.op_Implicit((Object)(object)attachment))
			{
				EntityState.Destroy((Object)(object)attachment.gameObject);
			}
		}
		if (((EntityState)this).isAuthority && Object.op_Implicit((Object)(object)bodyMachine))
		{
			bodyMachine.SetNextStateToMain();
		}
		((EntityState)this).skillLocator.primary.UnsetSkillOverride((object)this, MainPlugin.primaryOverride, (SkillOverridePriority)4);
		((EntityState)this).PlayAnimation("Mode", "Exit", "Special", 0.85f, 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 Utility : LiberatorState
{
	private int maxMissiles;

	private int missileCount;

	private GameObject target;

	private Transform muzzleL;

	private Transform muzzleR;

	private bool play;

	private GameObject muzzleFlash = Prefabs.missileMuzzleEffect;

	private GameObject projectile = Prefabs.Load<GameObject>("RoR2/Base/Common/MissileProjectile.prefab");

	private float fireInterval => 0.185f / ((BaseState)this).attackSpeedStat;

	public override void OnEnter()
	{
		base.OnEnter();
		maxMissiles = 6 + Mathf.FloorToInt((((BaseState)this).attackSpeedStat - 1f) / 0.02f);
		((EntityState)this).PlayAnimation("Missile", "Start", "Utility", fireInterval * (float)maxMissiles, 0f);
		target = ((Component)behaviour.SetTarget(maxMissiles)).gameObject;
		muzzleL = ((BaseState)this).FindModelChild("misMuzzleL");
		muzzleR = ((BaseState)this).FindModelChild("misMuzzleR");
		AkSoundEngine.PostEvent("Play_engi_seekerMissile_lockOn", ((EntityState)this).gameObject);
		AkSoundEngine.PostEvent("Play_Liberator_Missile_On", ((EntityState)this).gameObject);
	}

	private void FireProjectile(Transform muzzle, float mult)
	{
		//IL_004c: 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_007c: 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_0093: Unknown result type (might be due to invalid IL or missing references)
		//IL_0098: Unknown result type (might be due to invalid IL or missing references)
		//IL_009b: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
		//IL_00de: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
		if (Object.op_Implicit((Object)(object)target))
		{
			play = !play;
			if (play)
			{
				AkSoundEngine.PostEvent("Play_Liberator_BigMissile_Attack", ((EntityState)this).gameObject);
			}
			EffectManager.SimpleEffect(muzzleFlash, muzzle.position, Quaternion.identity, false);
			if (((EntityState)this).isAuthority)
			{
				ProjectileManager instance = ProjectileManager.instance;
				GameObject obj = projectile;
				Vector3 position = muzzle.position;
				Quaternion val = Quaternion.AngleAxis(25f * mult, Vector3.up);
				Ray aimRay = ((BaseState)this).GetAimRay();
				instance.FireProjectile(obj, position, Quaternion.LookRotation(val * ((Ray)(ref aimRay)).direction), ((EntityState)this).gameObject, ((BaseState)this).damageStat * 2f, 150f, ((BaseState)this).RollCrit(), (DamageColorIndex)0, target.gameObject, -1f, (DamageTypeCombo?)(DamageTypeCombo.GenericUtility | DamageTypeCombo.op_Implicit((DamageType)2)));
			}
		}
	}

	public override void FixedUpdate()
	{
		((EntityState)this).FixedUpdate();
		if (missileCount < maxMissiles && ((EntityState)this).fixedAge >= fireInterval)
		{
			((EntityState)this).fixedAge = 0f;
			missileCount++;
			FireProjectile(muzzleL, -1f);
			FireProjectile(muzzleR, 1f);
		}
		if ((((EntityState)this).isAuthority && ((missileCount >= maxMissiles) & (((EntityState)this).fixedAge >= 1f))) || !Object.op_Implicit((Object)(object)target))
		{
			((EntityState)this).outer.SetNextStateToMain();
		}
	}

	public override void OnExit()
	{
		AkSoundEngine.PostEvent("Play_Liberator_Missile_Off", ((EntityState)this).gameObject);
		behaviour.ResetTarget();
		((EntityState)this).PlayAnimation("Missile", "End", "Utility", 0.35f, 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)1;
	}
}
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
{
	internal static void RecolorEffect(GameObject obj, Color color)
	{
		//IL_008c: Unknown result type (might be due to invalid IL or missing references)
		if (!Object.op_Implicit((Object)(object)obj))
		{
			return;
		}
		OmniEffect component = obj.GetComponent<OmniEffect>();
		if (Object.op_Implicit((Object)(object)component))
		{
			Object.DestroyImmediate((Object)(object)obj.GetComponent<OmniEffect>());
		}
		Renderer[] componentsInChildren = obj.GetComponentsInChildren<Renderer>(Object.op_Implicit((Object)(object)component));
		for (int i = 0; i < componentsInChildren.Length; i++)
		{
			((Component)componentsInChildren[i]).gameObject.SetActive(true);
			if (Object.op_Implicit((Object)(object)componentsInChildren[i].material) && componentsInChildren[i].material.HasProperty("_TintColor"))
			{
				componentsInChildren[i].material.SetColor("_TintColor", color);
			}
		}
	}

	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_0017: 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)
		//IL_0061: Expected O, but got Unknown
		GameObject val = PrefabAPI.InstantiateClone(model, name, false);
		Animator componentInChildren = val.GetComponentInChildren<Animator>();
		((Component)componentInChildren).transform.localPosition = Vector3.up;
		((Component)componentInChildren).gameObject.AddComponent<DisplayBehaviour>();
		((Behaviour)val.GetComponentInChildren<CharacterModel>()).enabled = false;
		SkinnedMeshRenderer[] componentsInChildren = val.GetComponentsInChildren<SkinnedMeshRenderer>(true);
		foreach (SkinnedMeshRenderer val2 in componentsInChildren)
		{
			((Renderer)val2).material = new Material(((Renderer)val2).material);
			((Renderer)val2).material.DisableKeyword("DITHER");
		}
		return val;
	}

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

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

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

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

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

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

	public static void CreateHitboxes(string name, Transform parent, Vector3[] sizes, Vector3[] positions)
	{
		//IL_0034: Unknown result type (might be due to invalid IL or missing references)
		//IL_003a: Expected O, but got Unknown
		//IL_004f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0060: Unknown result type (might be due to invalid IL or missing references)
		//IL_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 = false, bool parentToReferencedTransform = true, bool positionAtReferencedTransform = true)
	{
		//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
		//IL_0097: Unknown result type (might be due to invalid IL or missing references)
		EffectComponent val = effect.GetComponent<EffectComponent>();
		if (!Object.op_Implicit((Object)(object)val))
		{
			val = effect.AddComponent<EffectComponent>();
		}
		if (duration != -1f)
		{
			DestroyOnTimer component = effect.GetComponent<DestroyOnTimer>();
			if (!Object.op_Implicit((Object)(object)component))
			{
				effect.AddComponent<DestroyOnTimer>().duration = duration;
			}
			else
			{
				component.duration = duration;
			}
		}
		if (!Object.op_Implicit((Object)(object)effect.GetComponent<NetworkIdentity>()))
		{
			effect.AddComponent<NetworkIdentity>();
		}
		if (!Object.op_Implicit((Object)(object)effect.GetComponent<VFXAttributes>()))
		{
			effect.AddComponent<VFXAttributes>().vfxPriority = (VFXPriority)2;
		}
		val.applyScale = applyScale;
		val.effectIndex = (EffectIndex)(-1);
		val.parentToReferencedTransform = parentToReferencedTransform;
		val.positionAtReferencedTransform = positionAtReferencedTransform;
		val.soundName = soundName;
		ContentAddition.AddEffect(effect);
		return val;
	}

	public static Material InstantiateMaterial(Material material)
	{
		//IL_0025: 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)
		Material val = Object.Instantiate<Material>(Prefabs.Load<Material>("RoR2/Base/Commando/matCommandoDualies.mat"));
		if (Object.op_Implicit((Object)(object)val))
		{
			val.SetColor("_Color", Color.white);
			val.SetTexture("_MainTex", material.mainTexture);
			val.SetColor("_EmColor", Color.white);
			val.SetFloat("_EmPower", 10f);
			val.SetTexture("_EmTex", material.GetTexture("_EmissionMap"));
			val