Decompiled source of Auriel v1.6.1

Auriel.dll

Decompiled 2 months ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using EntityStates;
using EntityStates.Huntress;
using IL.RoR2;
using JetBrains.Annotations;
using KinematicCharacterController;
using Mono.Cecil.Cil;
using MonoMod.Cil;
using On.RoR2;
using On.RoR2.UI;
using R2API;
using R2API.Utils;
using Rewired;
using RoR2;
using RoR2.Achievements;
using RoR2.Projectile;
using RoR2.Skills;
using RoR2.UI;
using TMPro;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.Networking;
using UnityEngine.Rendering;
using UnityEngine.SceneManagement;
using UnityEngine.UI;

[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.0", FrameworkDisplayName = "")]
[assembly: AssemblyCompany("Dragonyck")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("Auriel")]
[assembly: AssemblyTitle("Auriel")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace Auriel;

[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInPlugin("com.Dragonyck.Auriel", "Auriel", "1.6.1")]
[NetworkCompatibility(/*Could not decode attribute arguments.*/)]
public class Auriel : BaseUnityPlugin
{
	public const string MODUID = "com.Dragonyck.Auriel";

	public static GameObject characterPrefab;

	public static GameObject crosshairPrefab;

	public GameObject characterDisplay;

	public GameObject doppelganger;

	public static ConfigEntry<float> crosshairSize;

	public static ConfigEntry<KeyCode> EnergyKeyToggle;

	public static BuffDef crownBuff;

	public static readonly Color characterColor = new Color(1f, 0.8f, 0.12f);

	public static AssetBundle MainAssetBundle = null;

	public static SkillDef secondarySkillDef;

	public static SkillDef utilitySkillDef;

	public static SkillDef specialSkillDef;

	public static SkillDef secondaryEmpSkillDef;

	public static SkillDef utilityEmpSkillDef;

	public static SkillDef specialEmpSkillDef;

	private Transform crownOn;

	public static readonly uint BarMax = 508719834u;

	public static readonly uint HealField = 651778837u;

	public static readonly uint M1 = 1685527111u;

	public static readonly uint HealFieldMax = 2064178461u;

	public static readonly uint Utility = 2378126911u;

	public static readonly uint res_Source = 2781556679u;

	public static readonly uint Special = 3064974266u;

	public static readonly uint Switch = 3202316517u;

	public static readonly uint res_Target = 3939982387u;

	public static readonly uint Laser = 3982605422u;

	public static readonly uint LaserMax = 4269721684u;

	private void Awake()
	{
		//IL_008b: 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_00aa: Expected O, but got Unknown
		//IL_00aa: Expected O, but got Unknown
		//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00de: Expected O, but got Unknown
		//IL_00de: Expected O, but got Unknown
		if ((Object)(object)MainAssetBundle == (Object)null)
		{
			using Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("Auriel.AssetBundle.auriel");
			MainAssetBundle = AssetBundle.LoadFromStream(stream);
		}
		using (Stream stream2 = Assembly.GetExecutingAssembly().GetManifestResourceStream("Auriel.Auriel.bnk"))
		{
			byte[] array = new byte[stream2.Length];
			stream2.Read(array, 0, array.Length);
			SoundBanks.Add(array);
		}
		crosshairSize = ((BaseUnityPlugin)this).Config.Bind<float>(new ConfigDefinition("Crosshair Size", "Size"), 50f, new ConfigDescription("", (AcceptableValueBase)null, Array.Empty<object>()));
		EnergyKeyToggle = ((BaseUnityPlugin)this).Config.Bind<KeyCode>(new ConfigDefinition("Energy Skill Toggle", "Key"), (KeyCode)308, new ConfigDescription("", (AcceptableValueBase)null, Array.Empty<object>()));
		Achievements.RegisterUnlockables();
		Prefabs.CreatePrefabs();
		CreatePrefab();
		RegisterStates();
		RegisterCharacter();
		CreateDoppelganger();
		Hooks();
		VFX.RegisterGenericEffects();
	}

	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();
	}

	private void Hooks()
	{
		//IL_0008: Unknown result type (might be due to invalid IL or missing references)
		//IL_0012: Expected O, but got Unknown
		RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(RecalculateStatsAPI_GetStatCoefficients);
	}

	private void RecalculateStatsAPI_GetStatCoefficients(CharacterBody sender, StatHookEventArgs args)
	{
		int buffCount = sender.GetBuffCount(crownBuff);
		if (buffCount > 0)
		{
			args.attackSpeedMultAdd += 0.45f * (float)buffCount;
			args.moveSpeedMultAdd += 0.45f * (float)buffCount;
		}
	}

	private static GameObject CreateModel(GameObject main)
	{
		Object.Destroy((Object)(object)((Component)main.transform.Find("ModelBase")).gameObject);
		Object.Destroy((Object)(object)((Component)main.transform.Find("CameraPivot")).gameObject);
		Object.Destroy((Object)(object)((Component)main.transform.Find("AimOrigin")).gameObject);
		return MainAssetBundle.LoadAsset<GameObject>("Aurielmdl");
	}

	internal static void CreatePrefab()
	{
		//IL_0036: Unknown result type (might be due to invalid IL or missing references)
		//IL_003c: Expected O, but got Unknown
		//IL_0067: Unknown result type (might be due to invalid IL or missing references)
		//IL_0078: Unknown result type (might be due to invalid IL or missing references)
		//IL_0098: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ae: Expected O, but got Unknown
		//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f7: Unknown result type (might be due to invalid IL or missing references)
		//IL_0107: Unknown result type (might be due to invalid IL or missing references)
		//IL_010d: Expected O, but got Unknown
		//IL_0134: Unknown result type (might be due to invalid IL or missing references)
		//IL_0145: Unknown result type (might be due to invalid IL or missing references)
		//IL_0156: Unknown result type (might be due to invalid IL or missing references)
		//IL_0179: 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_01a2: Unknown result type (might be due to invalid IL or missing references)
		//IL_01bb: Unknown result type (might be due to invalid IL or missing references)
		//IL_01c0: Unknown result type (might be due to invalid IL or missing references)
		//IL_0238: Unknown result type (might be due to invalid IL or missing references)
		//IL_0375: Unknown result type (might be due to invalid IL or missing references)
		//IL_03cd: Unknown result type (might be due to invalid IL or missing references)
		//IL_03d2: Unknown result type (might be due to invalid IL or missing references)
		//IL_0436: Unknown result type (might be due to invalid IL or missing references)
		//IL_043b: Unknown result type (might be due to invalid IL or missing references)
		//IL_04b8: Unknown result type (might be due to invalid IL or missing references)
		//IL_04e0: Unknown result type (might be due to invalid IL or missing references)
		//IL_04ed: Unknown result type (might be due to invalid IL or missing references)
		//IL_04ef: Unknown result type (might be due to invalid IL or missing references)
		//IL_04f8: Unknown result type (might be due to invalid IL or missing references)
		//IL_0536: Unknown result type (might be due to invalid IL or missing references)
		//IL_0543: 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_054e: Unknown result type (might be due to invalid IL or missing references)
		//IL_058c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0599: Unknown result type (might be due to invalid IL or missing references)
		//IL_059b: Unknown result type (might be due to invalid IL or missing references)
		//IL_05a4: Unknown result type (might be due to invalid IL or missing references)
		//IL_05e2: Unknown result type (might be due to invalid IL or missing references)
		//IL_05ef: Unknown result type (might be due to invalid IL or missing references)
		//IL_05f1: Unknown result type (might be due to invalid IL or missing references)
		//IL_06dd: Unknown result type (might be due to invalid IL or missing references)
		//IL_0715: Unknown result type (might be due to invalid IL or missing references)
		//IL_073b: Unknown result type (might be due to invalid IL or missing references)
		//IL_073d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0746: Unknown result type (might be due to invalid IL or missing references)
		//IL_076c: Unknown result type (might be due to invalid IL or missing references)
		//IL_076e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0777: Unknown result type (might be due to invalid IL or missing references)
		//IL_079d: Unknown result type (might be due to invalid IL or missing references)
		//IL_079f: Unknown result type (might be due to invalid IL or missing references)
		//IL_07d4: Unknown result type (might be due to invalid IL or missing references)
		//IL_07f1: Unknown result type (might be due to invalid IL or missing references)
		//IL_07f3: Unknown result type (might be due to invalid IL or missing references)
		//IL_07fc: Unknown result type (might be due to invalid IL or missing references)
		//IL_0838: Unknown result type (might be due to invalid IL or missing references)
		//IL_083a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0843: Unknown result type (might be due to invalid IL or missing references)
		//IL_087f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0881: Unknown result type (might be due to invalid IL or missing references)
		//IL_088a: Unknown result type (might be due to invalid IL or missing references)
		//IL_08c6: Unknown result type (might be due to invalid IL or missing references)
		//IL_08c8: Unknown result type (might be due to invalid IL or missing references)
		//IL_0909: Unknown result type (might be due to invalid IL or missing references)
		//IL_094e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0955: Expected O, but got Unknown
		//IL_095c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0994: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b25: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b30: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b8b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0bb0: Unknown result type (might be due to invalid IL or missing references)
		//IL_0bb2: Unknown result type (might be due to invalid IL or missing references)
		//IL_0bf7: Unknown result type (might be due to invalid IL or missing references)
		//IL_0aa0: Unknown result type (might be due to invalid IL or missing references)
		//IL_0aa7: Expected O, but got Unknown
		//IL_0abd: Unknown result type (might be due to invalid IL or missing references)
		//IL_0add: Unknown result type (might be due to invalid IL or missing references)
		//IL_0d0d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0d18: Unknown result type (might be due to invalid IL or missing references)
		//IL_0d73: Unknown result type (might be due to invalid IL or missing references)
		//IL_0d98: Unknown result type (might be due to invalid IL or missing references)
		//IL_0d9a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ddf: Unknown result type (might be due to invalid IL or missing references)
		//IL_0c33: Unknown result type (might be due to invalid IL or missing references)
		//IL_0c3a: Expected O, but got Unknown
		//IL_0c41: Unknown result type (might be due to invalid IL or missing references)
		//IL_0c79: Unknown result type (might be due to invalid IL or missing references)
		//IL_0e1b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0e22: Expected O, but got Unknown
		//IL_0e29: Unknown result type (might be due to invalid IL or missing references)
		//IL_0e61: Unknown result type (might be due to invalid IL or missing references)
		//IL_0f2e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0f39: Unknown result type (might be due to invalid IL or missing references)
		//IL_0f94: Unknown result type (might be due to invalid IL or missing references)
		//IL_0fb9: Unknown result type (might be due to invalid IL or missing references)
		//IL_0fbb: Unknown result type (might be due to invalid IL or missing references)
		//IL_0fc4: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ff4: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ff6: Unknown result type (might be due to invalid IL or missing references)
		//IL_0fff: Unknown result type (might be due to invalid IL or missing references)
		//IL_102f: Unknown result type (might be due to invalid IL or missing references)
		//IL_1031: Unknown result type (might be due to invalid IL or missing references)
		//IL_1076: Unknown result type (might be due to invalid IL or missing references)
		//IL_10b2: Unknown result type (might be due to invalid IL or missing references)
		//IL_10b9: Expected O, but got Unknown
		//IL_10c0: Unknown result type (might be due to invalid IL or missing references)
		//IL_10f8: Unknown result type (might be due to invalid IL or missing references)
		//IL_11c5: Unknown result type (might be due to invalid IL or missing references)
		//IL_11d0: Unknown result type (might be due to invalid IL or missing references)
		//IL_122b: Unknown result type (might be due to invalid IL or missing references)
		//IL_1250: Unknown result type (might be due to invalid IL or missing references)
		//IL_1252: Unknown result type (might be due to invalid IL or missing references)
		//IL_125b: Unknown result type (might be due to invalid IL or missing references)
		//IL_128b: Unknown result type (might be due to invalid IL or missing references)
		//IL_128d: Unknown result type (might be due to invalid IL or missing references)
		//IL_1296: Unknown result type (might be due to invalid IL or missing references)
		//IL_12c6: Unknown result type (might be due to invalid IL or missing references)
		//IL_12c8: Unknown result type (might be due to invalid IL or missing references)
		//IL_130d: Unknown result type (might be due to invalid IL or missing references)
		//IL_1349: Unknown result type (might be due to invalid IL or missing references)
		//IL_1350: Expected O, but got Unknown
		//IL_1357: Unknown result type (might be due to invalid IL or missing references)
		//IL_138f: Unknown result type (might be due to invalid IL or missing references)
		//IL_1495: Unknown result type (might be due to invalid IL or missing references)
		//IL_15a1: Unknown result type (might be due to invalid IL or missing references)
		//IL_15a6: Unknown result type (might be due to invalid IL or missing references)
		//IL_169a: Unknown result type (might be due to invalid IL or missing references)
		//IL_174a: Unknown result type (might be due to invalid IL or missing references)
		//IL_1761: Unknown result type (might be due to invalid IL or missing references)
		//IL_1766: Unknown result type (might be due to invalid IL or missing references)
		//IL_176e: Unknown result type (might be due to invalid IL or missing references)
		//IL_17d0: Unknown result type (might be due to invalid IL or missing references)
		//IL_1817: Unknown result type (might be due to invalid IL or missing references)
		//IL_181e: Expected O, but got Unknown
		//IL_1852: Unknown result type (might be due to invalid IL or missing references)
		//IL_1864: Unknown result type (might be due to invalid IL or missing references)
		//IL_1885: Unknown result type (might be due to invalid IL or missing references)
		//IL_18d7: Unknown result type (might be due to invalid IL or missing references)
		//IL_18de: Expected O, but got Unknown
		//IL_1912: Unknown result type (might be due to invalid IL or missing references)
		//IL_1924: Unknown result type (might be due to invalid IL or missing references)
		//IL_1945: Unknown result type (might be due to invalid IL or missing references)
		//IL_1997: Unknown result type (might be due to invalid IL or missing references)
		//IL_199e: Expected O, but got Unknown
		//IL_19d2: Unknown result type (might be due to invalid IL or missing references)
		//IL_19e4: Unknown result type (might be due to invalid IL or missing references)
		//IL_1a05: Unknown result type (might be due to invalid IL or missing references)
		characterPrefab = PrefabAPI.InstantiateClone(Load<GameObject>("RoR2/Base/Commando/CommandoBody.prefab"), "AurielBody", true);
		characterPrefab.AddComponent<EnergyController>();
		GameObject val = CreateModel(characterPrefab);
		GameObject val2 = new GameObject("ModelBase");
		val2.transform.parent = characterPrefab.transform;
		val2.transform.localPosition = new Vector3(0f, -0.81f, 0f);
		val2.transform.localRotation = Quaternion.identity;
		val2.transform.localScale = new Vector3(1f, 1f, 1f);
		GameObject val3 = new GameObject("CameraPivot");
		val3.transform.parent = val2.transform;
		val3.transform.localPosition = new Vector3(0f, 2.8f, 0f);
		val3.transform.localRotation = Quaternion.identity;
		val3.transform.localScale = Vector3.one;
		GameObject val4 = new GameObject("AimOrigin");
		val4.transform.parent = val2.transform;
		val4.transform.localPosition = new Vector3(0f, 2.6f, 0f);
		val4.transform.localRotation = Quaternion.identity;
		val4.transform.localScale = Vector3.one;
		Transform transform = val.transform;
		transform.parent = val2.transform;
		transform.localPosition = Vector3.zero;
		transform.localScale = new Vector3(1f, 1f, 1f);
		transform.localRotation = Quaternion.identity;
		CharacterDirection component = characterPrefab.GetComponent<CharacterDirection>();
		component.moveVector = Vector3.zero;
		component.targetTransform = val2.transform;
		component.overrideAnimatorForwardTransform = null;
		component.rootMotionAccumulator = null;
		component.modelAnimator = val.GetComponentInChildren<Animator>();
		component.driveFromRootRotation = false;
		component.turnSpeed = 720f;
		CharacterBody component2 = characterPrefab.GetComponent<CharacterBody>();
		((Object)component2).name = "AurielBody";
		component2.baseNameToken = "AURIEL_NAME";
		component2.subtitleNameToken = "AURIEL_SUBTITLE";
		component2.bodyFlags = (BodyFlags)16;
		component2.rootMotionInMainState = false;
		component2.mainRootSpeed = 0f;
		component2.baseMaxHealth = 110f;
		component2.levelMaxHealth = 33f;
		component2.baseRegen = 1f;
		component2.levelRegen = 0.25f;
		component2.baseMaxShield = 0f;
		component2.levelMaxShield = 0f;
		component2.baseMoveSpeed = 7f;
		component2.levelMoveSpeed = 0f;
		component2.baseAcceleration = 80f;
		component2.baseJumpPower = 15f;
		component2.levelJumpPower = 0f;
		component2.baseDamage = 12f;
		component2.levelDamage = 2.4f;
		component2.baseAttackSpeed = 1f;
		component2.levelAttackSpeed = 0f;
		component2.baseCrit = 1f;
		component2.levelCrit = 0f;
		component2.baseArmor = 0f;
		component2.levelArmor = 0f;
		component2.baseJumpCount = 1;
		component2.sprintingSpeedMultiplier = 1.45f;
		component2.wasLucky = false;
		component2._defaultCrosshairPrefab = Prefabs.Crosshair;
		component2.hideCrosshair = false;
		component2.aimOriginTransform = val4.transform;
		component2.hullClassification = (HullClassification)0;
		component2.portraitIcon = (Texture)(object)MainAssetBundle.LoadAsset<Sprite>("portrait").texture;
		component2.isChampion = false;
		component2.currentVehicle = null;
		component2.skinIndex = 0u;
		component2.preferredPodPrefab = null;
		EntityStateMachine component3 = characterPrefab.GetComponent<EntityStateMachine>();
		component3.mainStateType = new SerializableEntityStateType(typeof(AurielCharacterMain));
		CharacterMotor component4 = characterPrefab.GetComponent<CharacterMotor>();
		component4.walkSpeedPenaltyCoefficient = 1f;
		component4.characterDirection = component;
		component4.muteWalkMotion = false;
		component4.mass = 100f;
		component4.airControl = 0.25f;
		component4.disableAirControlUntilCollision = false;
		component4.generateParametersOnAwake = true;
		InputBankTest component5 = characterPrefab.GetComponent<InputBankTest>();
		component5.moveVector = Vector3.zero;
		ModelLocator component6 = characterPrefab.GetComponent<ModelLocator>();
		component6.modelTransform = transform;
		component6.modelBaseTransform = val2.transform;
		component6.dontReleaseModelOnDeath = false;
		component6.autoUpdateModelTransform = true;
		component6.dontDetatchFromParent = false;
		component6.noCorpse = false;
		component6.normalizeToFloor = false;
		component6.preserveModel = false;
		ChildLocator component7 = val.GetComponent<ChildLocator>();
		CharacterModel val5 = val.AddComponent<CharacterModel>();
		val5.body = component2;
		val5.baseRendererInfos = (RendererInfo[])(object)new RendererInfo[4]
		{
			new RendererInfo
			{
				defaultMaterial = ((Renderer)val.GetComponentInChildren<SkinnedMeshRenderer>()).material,
				renderer = (Renderer)(object)val.GetComponentInChildren<SkinnedMeshRenderer>(),
				defaultShadowCastingMode = (ShadowCastingMode)1,
				ignoreOverlays = false
			},
			new RendererInfo
			{
				renderer = (Renderer)(object)((Component)component7.FindChild("Wings")).GetComponentInChildren<SkinnedMeshRenderer>(),
				defaultMaterial = ((Renderer)((Component)component7.FindChild("Wings")).GetComponentInChildren<SkinnedMeshRenderer>()).material,
				defaultShadowCastingMode = (ShadowCastingMode)1,
				ignoreOverlays = false
			},
			new RendererInfo
			{
				renderer = (Renderer)(object)((Component)component7.FindChild("WingsAnimated")).GetComponentInChildren<SkinnedMeshRenderer>(),
				defaultMaterial = ((Renderer)((Component)component7.FindChild("WingsAnimated")).GetComponentInChildren<SkinnedMeshRenderer>()).material,
				defaultShadowCastingMode = (ShadowCastingMode)1,
				ignoreOverlays = false
			},
			new RendererInfo
			{
				renderer = (Renderer)(object)((Component)component7.FindChild("Crown")).GetComponentInChildren<SkinnedMeshRenderer>(),
				defaultMaterial = ((Renderer)((Component)component7.FindChild("Crown")).GetComponentInChildren<SkinnedMeshRenderer>()).material,
				defaultShadowCastingMode = (ShadowCastingMode)1,
				ignoreOverlays = false
			}
		};
		val5.autoPopulateLightInfos = true;
		val5.invisibilityCount = 0;
		val5.temporaryOverlays = new List<TemporaryOverlay>();
		Reflection.SetFieldValue<SkinnedMeshRenderer>((object)val5, "mainSkinnedMeshRenderer", ((Component)val5.baseRendererInfos[0].renderer).gameObject.GetComponent<SkinnedMeshRenderer>());
		GameObject gameObject = ((Component)characterPrefab.GetComponentInChildren<ModelLocator>().modelTransform).gameObject;
		CharacterModel component8 = gameObject.GetComponent<CharacterModel>();
		ModelSkinController val6 = gameObject.AddComponent<ModelSkinController>();
		ChildLocator component9 = gameObject.GetComponent<ChildLocator>();
		SkinnedMeshRenderer fieldValue = Reflection.GetFieldValue<SkinnedMeshRenderer>((object)component8, "mainSkinnedMeshRenderer");
		LanguageAPI.Add("AURIELBODY_DEFAULT_SKIN_NAME", "Default");
		LanguageAPI.Add("AURIELBODY_ARCHANGEL_SKIN_NAME", "Archangel");
		LanguageAPI.Add("AURIELBODY_SAKURA_SKIN_NAME", "Sakura");
		LanguageAPI.Add("AURIELBODY_SPIRIT_SKIN_NAME", "Spirit Healer");
		LanguageAPI.Add("AURIELBODY_DEMONIC_SKIN_NAME", "Demonic");
		Material val7 = Load<Material>("RoR2/Base/Commando/matCommandoDualies.mat");
		SkinDefInfo val8 = default(SkinDefInfo);
		val8.BaseSkins = Array.Empty<SkinDef>();
		val8.MinionSkinReplacements = (MinionSkinReplacement[])(object)new MinionSkinReplacement[0];
		val8.ProjectileGhostReplacements = (ProjectileGhostReplacement[])(object)new ProjectileGhostReplacement[0];
		val8.GameObjectActivations = (GameObjectActivation[])(object)new GameObjectActivation[3]
		{
			new GameObjectActivation
			{
				gameObject = ((Component)component9.FindChild("Wings")).gameObject,
				shouldActivate = true
			},
			new GameObjectActivation
			{
				gameObject = ((Component)component9.FindChild("WingsAnimated")).gameObject,
				shouldActivate = true
			},
			new GameObjectActivation
			{
				gameObject = ((Component)component9.FindChild("Crown")).gameObject,
				shouldActivate = false
			}
		};
		val8.Icon = MainAssetBundle.LoadAsset<Sprite>("portraitskin");
		RendererInfo[] baseRendererInfos = val5.baseRendererInfos;
		val8.MeshReplacements = (MeshReplacement[])(object)new MeshReplacement[4]
		{
			new MeshReplacement
			{
				renderer = (Renderer)(object)fieldValue,
				mesh = fieldValue.sharedMesh
			},
			new MeshReplacement
			{
				renderer = baseRendererInfos[1].renderer,
				mesh = ((Component)component9.FindChild("Wings")).gameObject.GetComponent<SkinnedMeshRenderer>().sharedMesh
			},
			new MeshReplacement
			{
				renderer = baseRendererInfos[2].renderer,
				mesh = ((Component)component9.FindChild("WingsAnimated")).gameObject.GetComponent<SkinnedMeshRenderer>().sharedMesh
			},
			new MeshReplacement
			{
				renderer = baseRendererInfos[3].renderer,
				mesh = ((Component)component9.FindChild("Crown")).gameObject.GetComponent<SkinnedMeshRenderer>().sharedMesh
			}
		};
		val8.Name = "AURIELBODY_DEFAULT_SKIN_NAME";
		val8.NameToken = "AURIELBODY_DEFAULT_SKIN_NAME";
		val8.RendererInfos = component8.baseRendererInfos;
		val8.RootObject = gameObject;
		val8.UnlockableDef = null;
		RendererInfo[] rendererInfos = val8.RendererInfos;
		RendererInfo[] array = (RendererInfo[])(object)new RendererInfo[rendererInfos.Length];
		rendererInfos.CopyTo(array, 0);
		Material defaultMaterial = array[0].defaultMaterial;
		bool flag = Object.op_Implicit((Object)(object)defaultMaterial);
		if (flag)
		{
			defaultMaterial = new Material(val7);
			defaultMaterial.SetColor("_Color", Color.white);
			defaultMaterial.SetTexture("_MainTex", MainAssetBundle.LoadAsset<Material>("Body").GetTexture("_MainTex"));
			defaultMaterial.SetColor("_EmColor", Color.black);
			defaultMaterial.SetFloat("_EmPower", 0f);
			defaultMaterial.SetFloat("_NormalStrength", 1f);
			defaultMaterial.SetTexture("_NormalTex", MainAssetBundle.LoadAsset<Material>("Body").GetTexture("_BumpMap"));
			array[0].defaultMaterial = defaultMaterial;
		}
		defaultMaterial = array[1].defaultMaterial;
		bool flag2 = Object.op_Implicit((Object)(object)defaultMaterial);
		if (flag2)
		{
			defaultMaterial = MainAssetBundle.LoadAsset<Material>("wingmat");
			array[1].defaultMaterial = defaultMaterial;
		}
		defaultMaterial = array[2].defaultMaterial;
		bool flag3 = Object.op_Implicit((Object)(object)defaultMaterial);
		if (flag3)
		{
			defaultMaterial = MainAssetBundle.LoadAsset<Material>("wingmatanim");
			array[2].defaultMaterial = defaultMaterial;
		}
		defaultMaterial = array[3].defaultMaterial;
		if (Object.op_Implicit((Object)(object)defaultMaterial))
		{
			defaultMaterial = new Material(val7);
			defaultMaterial.SetColor("_Color", new Color(1f, 0.8f, 0.12f));
			defaultMaterial.SetTexture("_MainTex", (Texture)null);
			defaultMaterial.SetColor("_EmColor", Color.yellow);
			defaultMaterial.SetFloat("_EmPower", 1.4f);
			defaultMaterial.SetFloat("_NormalStrength", 1f);
			array[3].defaultMaterial = defaultMaterial;
		}
		val8.RendererInfos = array;
		SkinDef val9 = LoadoutAPI.CreateNewSkinDef(val8);
		SkinDefInfo val10 = default(SkinDefInfo);
		val10.BaseSkins = Array.Empty<SkinDef>();
		val10.MinionSkinReplacements = (MinionSkinReplacement[])(object)new MinionSkinReplacement[0];
		val10.ProjectileGhostReplacements = (ProjectileGhostReplacement[])(object)new ProjectileGhostReplacement[0];
		val10.GameObjectActivations = (GameObjectActivation[])(object)new GameObjectActivation[0];
		val10.Icon = MainAssetBundle.LoadAsset<Sprite>("portraitarchangel");
		val10.MeshReplacements = (MeshReplacement[])(object)new MeshReplacement[1]
		{
			new MeshReplacement
			{
				renderer = (Renderer)(object)fieldValue,
				mesh = MainAssetBundle.LoadAsset<Mesh>("Archangel")
			}
		};
		val10.Name = "AURIELBODY_ARCHANGEL_SKIN_NAME";
		val10.NameToken = "AURIELBODY_ARCHANGEL_SKIN_NAME";
		val10.RendererInfos = component8.baseRendererInfos;
		val10.RootObject = gameObject;
		val10.UnlockableDef = Achievements.aurielMasteryDef;
		rendererInfos = val8.RendererInfos;
		array = (RendererInfo[])(object)new RendererInfo[rendererInfos.Length];
		rendererInfos.CopyTo(array, 0);
		defaultMaterial = array[0].defaultMaterial;
		if (flag)
		{
			defaultMaterial = new Material(val7);
			defaultMaterial.SetColor("_Color", Color.white);
			defaultMaterial.SetTexture("_MainTex", MainAssetBundle.LoadAsset<Material>("archangel").GetTexture("_MainTex"));
			defaultMaterial.SetColor("_EmColor", Color.yellow);
			defaultMaterial.SetFloat("_EmPower", 1f);
			defaultMaterial.SetTexture("_EmTex", MainAssetBundle.LoadAsset<Material>("archangel").GetTexture("_EmissionMap"));
			defaultMaterial.SetFloat("_NormalStrength", 1f);
			defaultMaterial.SetTexture("_NormalTex", MainAssetBundle.LoadAsset<Material>("archangel").GetTexture("_BumpMap"));
			array[0].defaultMaterial = defaultMaterial;
		}
		val10.RendererInfos = array;
		SkinDef val11 = LoadoutAPI.CreateNewSkinDef(val10);
		SkinDefInfo val12 = default(SkinDefInfo);
		val12.BaseSkins = Array.Empty<SkinDef>();
		val12.MinionSkinReplacements = (MinionSkinReplacement[])(object)new MinionSkinReplacement[0];
		val12.ProjectileGhostReplacements = (ProjectileGhostReplacement[])(object)new ProjectileGhostReplacement[0];
		val12.GameObjectActivations = (GameObjectActivation[])(object)new GameObjectActivation[0];
		val12.Icon = MainAssetBundle.LoadAsset<Sprite>("portraithanamura");
		val12.MeshReplacements = (MeshReplacement[])(object)new MeshReplacement[1]
		{
			new MeshReplacement
			{
				renderer = (Renderer)(object)fieldValue,
				mesh = MainAssetBundle.LoadAsset<Mesh>("Sakura")
			}
		};
		val12.Name = "AURIELBODY_SAKURA_SKIN_NAME";
		val12.NameToken = "AURIELBODY_SAKURA_SKIN_NAME";
		val12.RendererInfos = component8.baseRendererInfos;
		val12.RootObject = gameObject;
		val12.UnlockableDef = Achievements.aurielSakuraDef;
		rendererInfos = val8.RendererInfos;
		array = (RendererInfo[])(object)new RendererInfo[rendererInfos.Length];
		rendererInfos.CopyTo(array, 0);
		defaultMaterial = array[0].defaultMaterial;
		if (flag)
		{
			defaultMaterial = new Material(val7);
			defaultMaterial.SetColor("_Color", Color.white);
			defaultMaterial.SetTexture("_MainTex", MainAssetBundle.LoadAsset<Material>("sakura").GetTexture("_MainTex"));
			defaultMaterial.SetColor("_EmColor", Color.cyan);
			defaultMaterial.SetFloat("_EmPower", 1f);
			defaultMaterial.SetTexture("_EmTex", MainAssetBundle.LoadAsset<Material>("sakura").GetTexture("_EmissionMap"));
			defaultMaterial.SetFloat("_NormalStrength", 1f);
			defaultMaterial.SetTexture("_NormalTex", MainAssetBundle.LoadAsset<Material>("sakura").GetTexture("_BumpMap"));
			array[0].defaultMaterial = defaultMaterial;
		}
		defaultMaterial = array[2].defaultMaterial;
		if (flag3)
		{
			defaultMaterial = MainAssetBundle.LoadAsset<Material>("sakurawingsanim");
			array[2].defaultMaterial = defaultMaterial;
		}
		val12.RendererInfos = array;
		SkinDef val13 = LoadoutAPI.CreateNewSkinDef(val12);
		SkinDefInfo val14 = default(SkinDefInfo);
		val14.BaseSkins = Array.Empty<SkinDef>();
		val14.MinionSkinReplacements = (MinionSkinReplacement[])(object)new MinionSkinReplacement[0];
		val14.ProjectileGhostReplacements = (ProjectileGhostReplacement[])(object)new ProjectileGhostReplacement[0];
		val14.GameObjectActivations = (GameObjectActivation[])(object)new GameObjectActivation[0];
		val14.Icon = MainAssetBundle.LoadAsset<Sprite>("portraitspirit");
		val14.MeshReplacements = (MeshReplacement[])(object)new MeshReplacement[3]
		{
			new MeshReplacement
			{
				renderer = (Renderer)(object)fieldValue,
				mesh = MainAssetBundle.LoadAsset<Mesh>("Spirit")
			},
			new MeshReplacement
			{
				renderer = array[1].renderer,
				mesh = MainAssetBundle.LoadAsset<Mesh>("SpiritWings")
			},
			new MeshReplacement
			{
				renderer = array[2].renderer,
				mesh = MainAssetBundle.LoadAsset<Mesh>("SpiritWings")
			}
		};
		val14.Name = "AURIELBODY_SPIRIT_SKIN_NAME";
		val14.NameToken = "AURIELBODY_SPIRIT_SKIN_NAME";
		val14.RendererInfos = component8.baseRendererInfos;
		val14.RootObject = gameObject;
		val14.UnlockableDef = Achievements.aurielSpiritDef;
		rendererInfos = val8.RendererInfos;
		array = (RendererInfo[])(object)new RendererInfo[rendererInfos.Length];
		rendererInfos.CopyTo(array, 0);
		defaultMaterial = array[0].defaultMaterial;
		if (flag)
		{
			defaultMaterial = new Material(val7);
			defaultMaterial.SetColor("_Color", Color.white);
			defaultMaterial.SetTexture("_MainTex", MainAssetBundle.LoadAsset<Material>("spirit").GetTexture("_MainTex"));
			defaultMaterial.SetColor("_EmColor", Color.cyan);
			defaultMaterial.SetFloat("_EmPower", 1f);
			defaultMaterial.SetTexture("_EmTex", MainAssetBundle.LoadAsset<Material>("spirit").GetTexture("_EmissionMap"));
			defaultMaterial.SetFloat("_NormalStrength", 1f);
			defaultMaterial.SetTexture("_NormalTex", MainAssetBundle.LoadAsset<Material>("spirit").GetTexture("_BumpMap"));
			array[0].defaultMaterial = defaultMaterial;
		}
		defaultMaterial = array[2].defaultMaterial;
		if (flag3)
		{
			defaultMaterial = MainAssetBundle.LoadAsset<Material>("spiritwingsanim");
			array[2].defaultMaterial = defaultMaterial;
		}
		val14.RendererInfos = array;
		SkinDef val15 = LoadoutAPI.CreateNewSkinDef(val14);
		SkinDefInfo val16 = default(SkinDefInfo);
		val16.BaseSkins = Array.Empty<SkinDef>();
		val16.MinionSkinReplacements = (MinionSkinReplacement[])(object)new MinionSkinReplacement[0];
		val16.ProjectileGhostReplacements = (ProjectileGhostReplacement[])(object)new ProjectileGhostReplacement[0];
		val16.GameObjectActivations = (GameObjectActivation[])(object)new GameObjectActivation[0];
		val16.Icon = MainAssetBundle.LoadAsset<Sprite>("portraitdemonic");
		val16.MeshReplacements = (MeshReplacement[])(object)new MeshReplacement[3]
		{
			new MeshReplacement
			{
				renderer = (Renderer)(object)fieldValue,
				mesh = MainAssetBundle.LoadAsset<Mesh>("Demonic")
			},
			new MeshReplacement
			{
				renderer = array[1].renderer,
				mesh = MainAssetBundle.LoadAsset<Mesh>("DemonicWings")
			},
			new MeshReplacement
			{
				renderer = array[2].renderer,
				mesh = MainAssetBundle.LoadAsset<Mesh>("DemonicWings")
			}
		};
		val16.Name = "AURIELBODY_DEMONIC_SKIN_NAME";
		val16.NameToken = "AURIELBODY_DEMONIC_SKIN_NAME";
		val16.RendererInfos = component8.baseRendererInfos;
		val16.RootObject = gameObject;
		val16.UnlockableDef = Achievements.aurielDemonicDef;
		rendererInfos = val8.RendererInfos;
		array = (RendererInfo[])(object)new RendererInfo[rendererInfos.Length];
		rendererInfos.CopyTo(array, 0);
		defaultMaterial = array[0].defaultMaterial;
		if (flag)
		{
			defaultMaterial = new Material(val7);
			defaultMaterial.SetColor("_Color", Color.white);
			defaultMaterial.SetTexture("_MainTex", MainAssetBundle.LoadAsset<Material>("demonic").GetTexture("_MainTex"));
			defaultMaterial.SetColor("_EmColor", Color.red);
			defaultMaterial.SetFloat("_EmPower", 1f);
			defaultMaterial.SetTexture("_EmTex", MainAssetBundle.LoadAsset<Material>("demonic").GetTexture("_EmissionMap"));
			defaultMaterial.SetFloat("_NormalStrength", 1f);
			defaultMaterial.SetTexture("_NormalTex", MainAssetBundle.LoadAsset<Material>("demonic").GetTexture("_BumpMap"));
			array[0].defaultMaterial = defaultMaterial;
		}
		defaultMaterial = array[1].defaultMaterial;
		if (flag2)
		{
			defaultMaterial = MainAssetBundle.LoadAsset<Material>("demonicwings");
			array[1].defaultMaterial = defaultMaterial;
		}
		defaultMaterial = array[2].defaultMaterial;
		if (flag3)
		{
			defaultMaterial = MainAssetBundle.LoadAsset<Material>("demonicwingsanim");
			array[2].defaultMaterial = defaultMaterial;
		}
		val16.RendererInfos = array;
		SkinDef val17 = LoadoutAPI.CreateNewSkinDef(val16);
		val6.skins = (SkinDef[])(object)new SkinDef[5] { val9, val11, val13, val15, val17 };
		TeamComponent val18 = null;
		val18 = ((!((Object)(object)characterPrefab.GetComponent<TeamComponent>() != (Object)null)) ? characterPrefab.GetComponent<TeamComponent>() : characterPrefab.GetComponent<TeamComponent>());
		val18.hideAllyCardDisplay = false;
		val18.teamIndex = (TeamIndex)(-1);
		HealthComponent component10 = characterPrefab.GetComponent<HealthComponent>();
		component10.health = 110f;
		component10.shield = 0f;
		component10.barrier = 0f;
		component10.magnetiCharge = 0f;
		component10.body = null;
		component10.dontShowHealthbar = false;
		characterPrefab.GetComponent<Interactor>().maxInteractionDistance = 3f;
		characterPrefab.GetComponent<InteractionDriver>().highlightInteractor = true;
		CharacterDeathBehavior component11 = characterPrefab.GetComponent<CharacterDeathBehavior>();
		component11.deathStateMachine = characterPrefab.GetComponent<EntityStateMachine>();
		component11.deathState = new SerializableEntityStateType(typeof(GenericCharacterDeath));
		SfxLocator component12 = characterPrefab.GetComponent<SfxLocator>();
		component12.deathSound = "Play_ui_player_death";
		component12.barkSound = "";
		component12.openSound = "";
		component12.landingSound = "Play_char_land";
		component12.fallDamageSound = "Play_char_land_fall_damage";
		component12.aliveLoopStart = "";
		component12.aliveLoopStop = "";
		Rigidbody component13 = characterPrefab.GetComponent<Rigidbody>();
		component13.mass = 100f;
		component13.drag = 0f;
		component13.angularDrag = 0f;
		component13.useGravity = false;
		component13.isKinematic = true;
		component13.interpolation = (RigidbodyInterpolation)0;
		component13.collisionDetectionMode = (CollisionDetectionMode)0;
		component13.constraints = (RigidbodyConstraints)0;
		CapsuleCollider component14 = characterPrefab.GetComponent<CapsuleCollider>();
		((Collider)component14).isTrigger = false;
		((Collider)component14).material = null;
		component14.center = new Vector3(0f, 0f, 0f);
		component14.radius = 0.5f;
		component14.height = 2f;
		component14.direction = 1;
		KinematicCharacterMotor component15 = characterPrefab.GetComponent<KinematicCharacterMotor>();
		component15.CharacterController = (BaseCharacterController)(object)component4;
		component15.Capsule = component14;
		component15.Rigidbody = component13;
		component15.DetectDiscreteCollisions = false;
		component15.GroundDetectionExtraDistance = 0f;
		component15.MaxStepHeight = 0.2f;
		component15.MinRequiredStepDepth = 0.1f;
		component15.MaxStableSlopeAngle = 55f;
		component15.MaxStableDistanceFromLedge = 0.5f;
		component15.PreventSnappingOnLedges = false;
		component15.MaxStableDenivelationAngle = 55f;
		component15.RigidbodyInteractionType = (RigidbodyInteractionType)0;
		component15.PreserveAttachedRigidbodyMomentum = true;
		component15.HasPlanarConstraint = false;
		component15.PlanarConstraintAxis = Vector3.up;
		component15.StepHandling = (StepHandlingMethod)0;
		component15.LedgeHandling = true;
		component15.InteractiveRigidbodyHandling = true;
		component15.SafeMovement = false;
		HurtBoxGroup val19 = val.AddComponent<HurtBoxGroup>();
		HurtBox val20 = ((Component)val.GetComponentInChildren<CapsuleCollider>()).gameObject.AddComponent<HurtBox>();
		((Component)val20).gameObject.layer = LayerIndex.entityPrecise.intVal;
		val20.healthComponent = component10;
		val20.isBullseye = true;
		val20.damageModifier = (DamageModifier)0;
		val20.hurtBoxGroup = val19;
		val20.indexInGroup = 0;
		val19.hurtBoxes = (HurtBox[])(object)new HurtBox[1] { val20 };
		val19.mainHurtBox = val20;
		val19.bullseyeCount = 1;
		HitBoxGroup val21 = gameObject.AddComponent<HitBoxGroup>();
		GameObject val22 = new GameObject("SlashHitbox");
		val22.transform.parent = ((Component)component7.FindChild("HitBoxCenter")).transform;
		val22.transform.localPosition = new Vector3(0f, 0f, 0f);
		val22.transform.localRotation = Quaternion.identity;
		val22.transform.localScale = new Vector3(10f, 5f, 10f);
		val22.layer = LayerIndex.projectile.intVal;
		HitBox val23 = val22.AddComponent<HitBox>();
		val21.hitBoxes = (HitBox[])(object)new HitBox[1] { val23 };
		val21.groupName = "SlashHitbox";
		HitBoxGroup val24 = gameObject.AddComponent<HitBoxGroup>();
		GameObject val25 = new GameObject("SlashHitboxWeakSpot");
		val25.transform.parent = ((Component)component7.FindChild("HitBoxCenter")).transform;
		val25.transform.localPosition = new Vector3(0f, 0f, 0f);
		val25.transform.localRotation = Quaternion.identity;
		val25.transform.localScale = new Vector3(4f, 5f, 10f);
		val25.layer = LayerIndex.projectile.intVal;
		HitBox val26 = val25.AddComponent<HitBox>();
		val24.hitBoxes = (HitBox[])(object)new HitBox[1] { val26 };
		val24.groupName = "SlashHitboxWeakSpot";
		HitBoxGroup val27 = gameObject.AddComponent<HitBoxGroup>();
		GameObject val28 = new GameObject("WrathHitbox");
		val28.transform.parent = ((Component)component7.FindChild("SlashHitBox")).transform;
		val28.transform.localPosition = new Vector3(0f, 0f, 0f);
		val28.transform.localRotation = Quaternion.identity;
		val28.transform.localScale = new Vector3(13f, 13f, 13f);
		val28.layer = LayerIndex.projectile.intVal;
		HitBox val29 = val28.AddComponent<HitBox>();
		val27.hitBoxes = (HitBox[])(object)new HitBox[1] { val29 };
		val27.groupName = "WrathHitbox";
		FootstepHandler val30 = val.AddComponent<FootstepHandler>();
		val30.baseFootstepString = "Play_player_footstep";
		val30.sprintFootstepOverrideString = "";
		val30.enableFootstepDust = true;
		val30.footstepDustPrefab = Load<GameObject>("RoR2/Base/Common/VFX/GenericFootstepDust.prefab");
		ContentAddition.AddBody(characterPrefab);
	}

	private void RegisterCharacter()
	{
		//IL_005e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0068: Expected O, but got Unknown
		//IL_0121: 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)
		characterDisplay = PrefabAPI.InstantiateClone(((Component)characterPrefab.GetComponent<ModelLocator>().modelBaseTransform).gameObject, "AurielDisplay", true);
		characterDisplay.AddComponent<NetworkIdentity>();
		RendererInfo[] baseRendererInfos = characterDisplay.GetComponentInChildren<CharacterModel>().baseRendererInfos;
		for (int i = 0; i < baseRendererInfos.Length; i++)
		{
			baseRendererInfos[i].defaultMaterial = new Material(baseRendererInfos[i].defaultMaterial);
			baseRendererInfos[i].defaultMaterial.DisableKeyword("_DITHER");
		}
		string text = "Her eternal light illuminates even the darkest souls. Seeking harmony in all things, she is a mediator, a counselor, and when the need arises, a fearless warrior.<color=#CCD3E0>" + Environment.NewLine + Environment.NewLine;
		string text2 = "..and so she left, the power of hope flows into the fabric of creation.";
		LanguageAPI.Add("AURIEL_NAME", "Auriel");
		LanguageAPI.Add("AURIEL_DESCRIPTION", text);
		LanguageAPI.Add("AURIEL_SUBTITLE", "Archangel of Hope");
		LanguageAPI.Add("AURIEL_OUTRO", text2);
		LanguageAPI.Add("AURIEL_FAIL", "..and so she vanished, in the face of adversity hope's light shines the brightest.");
		SurvivorDef val = ScriptableObject.CreateInstance<SurvivorDef>();
		val.cachedName = "AURIEL_NAME";
		val.unlockableDef = Achievements.aurielUnlockDef;
		val.descriptionToken = "AURIEL_DESCRIPTION";
		val.primaryColor = characterColor;
		val.bodyPrefab = characterPrefab;
		val.displayPrefab = characterDisplay;
		val.outroFlavorToken = "AURIEL_OUTRO";
		val.mainEndingEscapeFailureFlavorToken = "AURIEL_FAIL";
		val.desiredSortPosition = 18f;
		ContentAddition.AddSurvivorDef(val);
		SkillSetup();
	}

	private void RegisterStates()
	{
		//IL_0003: Unknown result type (might be due to invalid IL or missing references)
		//IL_000b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0013: Unknown result type (might be due to invalid IL or missing references)
		//IL_001b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0023: Unknown result type (might be due to invalid IL or missing references)
		//IL_002b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0033: Unknown result type (might be due to invalid IL or missing references)
		//IL_003b: Unknown result type (might be due to invalid IL or missing references)
		bool flag = default(bool);
		ContentAddition.AddEntityState<SearingLight>(ref flag);
		ContentAddition.AddEntityState<SacredSweep>(ref flag);
		ContentAddition.AddEntityState<BestowHope>(ref flag);
		ContentAddition.AddEntityState<WrathofHeaven>(ref flag);
		ContentAddition.AddEntityState<AurielCharacterMain>(ref flag);
		ContentAddition.AddEntityState<SacredSweepEmp>(ref flag);
		ContentAddition.AddEntityState<BestowHopeEmp>(ref flag);
		ContentAddition.AddEntityState<Resurrect>(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();
		EmpoweredSetup();
	}

	private void EmpoweredSetup()
	{
		//IL_003a: Unknown result type (might be due to invalid IL or missing references)
		//IL_003f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0094: Unknown result type (might be due to invalid IL or missing references)
		//IL_015a: Unknown result type (might be due to invalid IL or missing references)
		//IL_015f: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b4: Unknown result type (might be due to invalid IL or missing references)
		//IL_027a: Unknown result type (might be due to invalid IL or missing references)
		//IL_027f: Unknown result type (might be due to invalid IL or missing references)
		//IL_02d4: Unknown result type (might be due to invalid IL or missing references)
		LanguageAPI.Add("AURIEL_SECONDARYEMP", "<style=cIsDamage>Divine Beam</style> [<style=cIsDamage>25</style>]");
		LanguageAPI.Add("AURIEL_SECONDARYEMP_DESCRIPTION", "Auriel charges a divine power from within, piercing enemies with a powerful beam of light dealing <style=cIsDamage>100%</style> <style=cIsDamage>+Energy</style> damage per hit and burns their wretched flesh.");
		secondaryEmpSkillDef = ScriptableObject.CreateInstance<SkillDef>();
		secondaryEmpSkillDef.activationState = new SerializableEntityStateType(typeof(SacredSweepEmp));
		secondaryEmpSkillDef.activationStateMachineName = "Weapon";
		secondaryEmpSkillDef.baseMaxStock = 0;
		secondaryEmpSkillDef.baseRechargeInterval = 0f;
		secondaryEmpSkillDef.beginSkillCooldownOnSkillEnd = true;
		secondaryEmpSkillDef.canceledFromSprinting = false;
		secondaryEmpSkillDef.fullRestockOnAssign = false;
		secondaryEmpSkillDef.interruptPriority = (InterruptPriority)0;
		secondaryEmpSkillDef.isCombatSkill = true;
		secondaryEmpSkillDef.mustKeyPress = true;
		secondaryEmpSkillDef.cancelSprintingOnActivation = true;
		secondaryEmpSkillDef.rechargeStock = 0;
		secondaryEmpSkillDef.requiredStock = 0;
		secondaryEmpSkillDef.stockToConsume = 0;
		secondaryEmpSkillDef.icon = MainAssetBundle.LoadAsset<Sprite>("skill2emp");
		secondaryEmpSkillDef.skillDescriptionToken = "AURIEL_SECONDARYEMP_DESCRIPTION";
		secondaryEmpSkillDef.skillName = "AURIEL_SECONDARYEMP";
		secondaryEmpSkillDef.skillNameToken = "AURIEL_SECONDARYEMP";
		LanguageAPI.Add("AURIEL_UTILITYEMP", "<style=cIsDamage>Ray of Heaven</style> [<style=cIsDamage>50</style>]");
		LanguageAPI.Add("AURIEL_UTILITYEMP_DESCRIPTION", "Auriel blesses the ground with divine power, healing her and her teammates for <style=cIsHealing>5%</style> of her max health <style=cIsDamage>+Energy</style> per second.");
		utilityEmpSkillDef = ScriptableObject.CreateInstance<SkillDef>();
		utilityEmpSkillDef.activationState = new SerializableEntityStateType(typeof(BestowHopeEmp));
		utilityEmpSkillDef.activationStateMachineName = "Weapon";
		utilityEmpSkillDef.baseMaxStock = 0;
		utilityEmpSkillDef.baseRechargeInterval = 0f;
		utilityEmpSkillDef.beginSkillCooldownOnSkillEnd = true;
		utilityEmpSkillDef.canceledFromSprinting = false;
		utilityEmpSkillDef.fullRestockOnAssign = false;
		utilityEmpSkillDef.interruptPriority = (InterruptPriority)0;
		utilityEmpSkillDef.isCombatSkill = true;
		utilityEmpSkillDef.mustKeyPress = true;
		utilityEmpSkillDef.cancelSprintingOnActivation = true;
		utilityEmpSkillDef.rechargeStock = 0;
		utilityEmpSkillDef.requiredStock = 0;
		utilityEmpSkillDef.stockToConsume = 0;
		utilityEmpSkillDef.icon = MainAssetBundle.LoadAsset<Sprite>("skill3emp");
		utilityEmpSkillDef.skillDescriptionToken = "AURIEL_UTILITYEMP_DESCRIPTION";
		utilityEmpSkillDef.skillName = "AURIEL_UTILITYEMP";
		utilityEmpSkillDef.skillNameToken = "AURIEL_UTILITYEMP";
		LanguageAPI.Add("AURIEL_SPECIALEMP", "<style=cIsDamage>Resurrect</style> [<style=cIsDamage>100</style>]");
		LanguageAPI.Add("AURIEL_SPECIALEMP_DESCRIPTION", "Channel on the spirits of a fallen komrades. After channeling for 2 seconds, they are brought back to life.");
		specialEmpSkillDef = (SkillDef)(object)ScriptableObject.CreateInstance<RezSkillDef>();
		specialEmpSkillDef.activationState = new SerializableEntityStateType(typeof(Resurrect));
		specialEmpSkillDef.activationStateMachineName = "Weapon";
		specialEmpSkillDef.baseMaxStock = 0;
		specialEmpSkillDef.baseRechargeInterval = 0f;
		specialEmpSkillDef.beginSkillCooldownOnSkillEnd = true;
		specialEmpSkillDef.canceledFromSprinting = false;
		specialEmpSkillDef.fullRestockOnAssign = false;
		specialEmpSkillDef.interruptPriority = (InterruptPriority)0;
		specialEmpSkillDef.isCombatSkill = true;
		specialEmpSkillDef.mustKeyPress = true;
		specialEmpSkillDef.cancelSprintingOnActivation = true;
		specialEmpSkillDef.rechargeStock = 0;
		specialEmpSkillDef.requiredStock = 0;
		specialEmpSkillDef.stockToConsume = 0;
		specialEmpSkillDef.icon = MainAssetBundle.LoadAsset<Sprite>("skill4emp");
		specialEmpSkillDef.skillDescriptionToken = "AURIEL_SPECIALEMP_DESCRIPTION";
		specialEmpSkillDef.skillName = "AURIEL_SPECIALEMP";
		specialEmpSkillDef.skillNameToken = "AURIEL_SPECIALEMP";
	}

	private void PassiveSetup()
	{
		//IL_003b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0040: Unknown result type (might be due to invalid IL or missing references)
		SkillLocator component = characterPrefab.GetComponent<SkillLocator>();
		LanguageAPI.Add("AURIEL_PASSIVE_NAME", "Angelic Flight");
		LanguageAPI.Add("AURIEL_PASSIVE_DESCRIPTION", "Auriel can fly at will. <style=cKeywordName><style=cIsDamage>Energy</style></style><style=cSub>");
		KeyCode value = EnergyKeyToggle.Value;
		LanguageAPI.Add("AURIEL_PASSIVE_KEYWORD", "<style=cKeywordName><style=cIsDamage>Energy</style></style><style=cSub>Auriel passively charges <style=cIsDamage>Energy</style> when casting Searing Light. Pressing " + ((object)(KeyCode)(ref value)).ToString() + " or Left D-Pad, enables <style=cIsDamage>Energy Skills</style> if they match their cost value. <style=cIsDamage>Energy Skills</style> are strong spells that can be cast at the cost of <style=cIsDamage>energy</style>.");
		component.passiveSkill.enabled = true;
		component.passiveSkill.skillNameToken = "AURIEL_PASSIVE_NAME";
		component.passiveSkill.skillDescriptionToken = "AURIEL_PASSIVE_DESCRIPTION";
		component.passiveSkill.icon = MainAssetBundle.LoadAsset<Sprite>("passive");
		component.passiveSkill.keywordToken = "AURIEL_PASSIVE_KEYWORD";
	}

	private void PrimarySetup()
	{
		//IL_003d: 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_007b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0130: Unknown result type (might be due to invalid IL or missing references)
		//IL_0148: Unknown result type (might be due to invalid IL or missing references)
		//IL_0152: Expected O, but got Unknown
		//IL_0153: Unknown result type (might be due to invalid IL or missing references)
		//IL_0155: Unknown result type (might be due to invalid IL or missing references)
		SkillLocator component = characterPrefab.GetComponent<SkillLocator>();
		LanguageAPI.Add("AURIEL_SEARINGLIGHT", "Searing Light");
		LanguageAPI.Add("AURIEL_SEARINGLIGHT_DESCRIPTION", "Auriel fires a fiery angelic light that pierces and hits all enemies in a line for <style=cIsDamage>260%</style> damage. While under the effects of Bestow Hope, Searing Light travels farther and faster.");
		SkillDef val = ScriptableObject.CreateInstance<SkillDef>();
		val.activationState = new SerializableEntityStateType(typeof(SearingLight));
		val.activationStateMachineName = "Weapon";
		val.baseMaxStock = 0;
		val.baseRechargeInterval = 0f;
		val.beginSkillCooldownOnSkillEnd = true;
		val.canceledFromSprinting = false;
		val.fullRestockOnAssign = true;
		val.interruptPriority = (InterruptPriority)0;
		val.isCombatSkill = true;
		val.mustKeyPress = false;
		val.cancelSprintingOnActivation = true;
		val.rechargeStock = 0;
		val.requiredStock = 0;
		val.stockToConsume = 0;
		val.icon = MainAssetBundle.LoadAsset<Sprite>("skill1");
		val.skillDescriptionToken = "AURIEL_SEARINGLIGHT_DESCRIPTION";
		val.skillName = "AURIEL_SEARINGLIGHT";
		val.skillNameToken = "AURIEL_SEARINGLIGHT";
		ContentAddition.AddSkillDef(val);
		component.primary = characterPrefab.AddComponent<GenericSkill>();
		SkillFamily val2 = ScriptableObject.CreateInstance<SkillFamily>();
		val2.variants = (Variant[])(object)new Variant[1];
		Reflection.SetFieldValue<SkillFamily>((object)component.primary, "_skillFamily", val2);
		SkillFamily skillFamily = component.primary.skillFamily;
		Variant[] variants = skillFamily.variants;
		Variant val3 = new Variant
		{
			skillDef = val
		};
		((Variant)(ref val3)).viewableNode = new Node(val.skillNameToken, false, (Node)null);
		variants[0] = val3;
		ContentAddition.AddSkillFamily(skillFamily);
	}

	private void SecondarySetup()
	{
		//IL_0045: Unknown result type (might be due to invalid IL or missing references)
		//IL_004a: Unknown result type (might be due to invalid IL or missing references)
		//IL_009f: 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_01c0: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ca: Expected O, but got Unknown
		//IL_01cb: Unknown result type (might be due to invalid IL or missing references)
		//IL_01cc: Unknown result type (might be due to invalid IL or missing references)
		SkillLocator component = characterPrefab.GetComponent<SkillLocator>();
		LanguageAPI.Add("AURIEL_SACREDSWEEP", "Sacred Sweep");
		LanguageAPI.Add("AURIEL_ACREDSWEEP_DESCRIPTION", "Auriel sweeps the area with sacred power, pulling all nearby enemies to it's core and dragging them along it's path.");
		secondarySkillDef = ScriptableObject.CreateInstance<SkillDef>();
		secondarySkillDef.activationState = new SerializableEntityStateType(typeof(SacredSweep));
		secondarySkillDef.activationStateMachineName = "Slide";
		secondarySkillDef.baseMaxStock = 1;
		secondarySkillDef.baseRechargeInterval = 8f;
		secondarySkillDef.beginSkillCooldownOnSkillEnd = true;
		secondarySkillDef.canceledFromSprinting = false;
		secondarySkillDef.fullRestockOnAssign = false;
		secondarySkillDef.interruptPriority = (InterruptPriority)0;
		secondarySkillDef.isCombatSkill = true;
		secondarySkillDef.mustKeyPress = true;
		secondarySkillDef.cancelSprintingOnActivation = true;
		secondarySkillDef.rechargeStock = 1;
		secondarySkillDef.requiredStock = 1;
		secondarySkillDef.stockToConsume = 1;
		secondarySkillDef.icon = MainAssetBundle.LoadAsset<Sprite>("skill2");
		secondarySkillDef.skillDescriptionToken = "AURIEL_ACREDSWEEP_DESCRIPTION";
		secondarySkillDef.skillName = "AURIEL_SACREDSWEEP";
		secondarySkillDef.skillNameToken = "AURIEL_SACREDSWEEP";
		secondarySkillDef.keywordTokens = new string[2] { "AURIEL_SECONDARYEMP", "AURIEL_SECONDARYEMP_DESCRIPTION" };
		ContentAddition.AddSkillDef(secondarySkillDef);
		component.secondary = characterPrefab.AddComponent<GenericSkill>();
		SkillFamily val = ScriptableObject.CreateInstance<SkillFamily>();
		val.variants = (Variant[])(object)new Variant[1];
		Reflection.SetFieldValue<SkillFamily>((object)component.secondary, "_skillFamily", val);
		SkillFamily skillFamily = component.secondary.skillFamily;
		Variant[] variants = skillFamily.variants;
		Variant val2 = new Variant
		{
			skillDef = secondarySkillDef
		};
		((Variant)(ref val2)).viewableNode = new Node(secondarySkillDef.skillNameToken, false, (Node)null);
		variants[0] = val2;
		ContentAddition.AddSkillFamily(val);
	}

	private void UtilitySetup()
	{
		//IL_0045: Unknown result type (might be due to invalid IL or missing references)
		//IL_004a: Unknown result type (might be due to invalid IL or missing references)
		//IL_009f: 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_01c0: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ca: Expected O, but got Unknown
		//IL_01cb: Unknown result type (might be due to invalid IL or missing references)
		//IL_01cc: Unknown result type (might be due to invalid IL or missing references)
		SkillLocator component = characterPrefab.GetComponent<SkillLocator>();
		LanguageAPI.Add("AURIEL_BESTOWHOPE", "Bestow Hope");
		LanguageAPI.Add("AURIEL_BESTOWHOPE_DESCRIPTION", "Auriel recovers a <style=cIsHealing>5%</style> of her health and gains <style=cIsDamageg>25% attack speed</style> and <style=cIsUtility>25% movement speed</style> for a short duration.");
		utilitySkillDef = ScriptableObject.CreateInstance<SkillDef>();
		utilitySkillDef.activationState = new SerializableEntityStateType(typeof(BestowHope));
		utilitySkillDef.activationStateMachineName = "Slide";
		utilitySkillDef.baseMaxStock = 1;
		utilitySkillDef.baseRechargeInterval = 10f;
		utilitySkillDef.beginSkillCooldownOnSkillEnd = true;
		utilitySkillDef.canceledFromSprinting = false;
		utilitySkillDef.fullRestockOnAssign = false;
		utilitySkillDef.interruptPriority = (InterruptPriority)0;
		utilitySkillDef.isCombatSkill = false;
		utilitySkillDef.mustKeyPress = true;
		utilitySkillDef.cancelSprintingOnActivation = false;
		utilitySkillDef.rechargeStock = 1;
		utilitySkillDef.requiredStock = 1;
		utilitySkillDef.stockToConsume = 1;
		utilitySkillDef.icon = MainAssetBundle.LoadAsset<Sprite>("skill3");
		utilitySkillDef.skillDescriptionToken = "AURIEL_BESTOWHOPE_DESCRIPTION";
		utilitySkillDef.skillName = "AURIEL_BESTOWHOPE";
		utilitySkillDef.skillNameToken = "AURIEL_BESTOWHOPE";
		utilitySkillDef.keywordTokens = new string[2] { "AURIEL_UTILITYEMP", "AURIEL_UTILITYEMP_DESCRIPTION" };
		ContentAddition.AddSkillDef(utilitySkillDef);
		component.utility = characterPrefab.AddComponent<GenericSkill>();
		SkillFamily val = ScriptableObject.CreateInstance<SkillFamily>();
		val.variants = (Variant[])(object)new Variant[1];
		Reflection.SetFieldValue<SkillFamily>((object)component.utility, "_skillFamily", val);
		SkillFamily skillFamily = component.utility.skillFamily;
		Variant[] variants = skillFamily.variants;
		Variant val2 = new Variant
		{
			skillDef = utilitySkillDef
		};
		((Variant)(ref val2)).viewableNode = new Node(utilitySkillDef.skillNameToken, false, (Node)null);
		variants[0] = val2;
		ContentAddition.AddSkillFamily(val);
	}

	private void SpecialSetup()
	{
		//IL_0045: Unknown result type (might be due to invalid IL or missing references)
		//IL_004a: Unknown result type (might be due to invalid IL or missing references)
		//IL_009f: 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_01c0: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ca: Expected O, but got Unknown
		//IL_01cb: Unknown result type (might be due to invalid IL or missing references)
		//IL_01cc: Unknown result type (might be due to invalid IL or missing references)
		SkillLocator component = characterPrefab.GetComponent<SkillLocator>();
		LanguageAPI.Add("AURIEL_WRATHOFHEAVEN", "Wrath of Heaven");
		LanguageAPI.Add("AURIEL_WRATHOFHEAVEN_DESCRIPTION", "Auriel channels a ray from heaven, granting her divine protection and deals <style=cIsDamage>400%</style> damage per hit to nearby enemies. At the end of this cast, Auriel releases a burst of fiery light around her dealing <style=cIsDamage>600%</style> damage.");
		specialSkillDef = ScriptableObject.CreateInstance<SkillDef>();
		specialSkillDef.activationState = new SerializableEntityStateType(typeof(WrathofHeaven));
		specialSkillDef.activationStateMachineName = "Weapon";
		specialSkillDef.baseMaxStock = 1;
		specialSkillDef.baseRechargeInterval = 12f;
		specialSkillDef.beginSkillCooldownOnSkillEnd = true;
		specialSkillDef.canceledFromSprinting = false;
		specialSkillDef.fullRestockOnAssign = false;
		specialSkillDef.interruptPriority = (InterruptPriority)1;
		specialSkillDef.isCombatSkill = true;
		specialSkillDef.mustKeyPress = true;
		specialSkillDef.cancelSprintingOnActivation = false;
		specialSkillDef.rechargeStock = 1;
		specialSkillDef.requiredStock = 1;
		specialSkillDef.stockToConsume = 1;
		specialSkillDef.icon = MainAssetBundle.LoadAsset<Sprite>("skill4");
		specialSkillDef.skillDescriptionToken = "AURIEL_WRATHOFHEAVEN_DESCRIPTION";
		specialSkillDef.skillName = "AURIEL_WRATHOFHEAVEN";
		specialSkillDef.skillNameToken = "AURIEL_WRATHOFHEAVEN";
		specialSkillDef.keywordTokens = new string[2] { "AURIEL_SPECIALEMP", "AURIEL_SPECIALEMP_DESCRIPTION" };
		ContentAddition.AddSkillDef(specialSkillDef);
		component.special = characterPrefab.AddComponent<GenericSkill>();
		SkillFamily val = ScriptableObject.CreateInstance<SkillFamily>();
		val.variants = (Variant[])(object)new Variant[1];
		Reflection.SetFieldValue<SkillFamily>((object)component.special, "_skillFamily", val);
		SkillFamily skillFamily = component.special.skillFamily;
		Variant[] variants = skillFamily.variants;
		Variant val2 = new Variant
		{
			skillDef = specialSkillDef
		};
		((Variant)(ref val2)).viewableNode = new Node(specialSkillDef.skillNameToken, false, (Node)null);
		variants[0] = val2;
		ContentAddition.AddSkillFamily(val);
	}

	private void CreateDoppelganger()
	{
		doppelganger = PrefabAPI.InstantiateClone(Load<GameObject>("RoR2/Base/Commando/CommandoMonsterMaster.prefab"), "AurielMaster", true);
		ContentAddition.AddMaster(doppelganger);
		CharacterMaster component = doppelganger.GetComponent<CharacterMaster>();
		component.bodyPrefab = characterPrefab;
	}
}
internal class AurielCharacterMain : GenericCharacterMain
{
	private bool _providingAntiGravity;

	public float duration;

	public float acceleration;

	public float boostSpeedMultiplier = 3f;

	public float boostCooldown = 0.5f;

	private float stopwatch;

	private bool _providingFlight;

	private ICharacterGravityParameterProvider targetCharacterGravityParameterProvider;

	private ICharacterFlightParameterProvider targetCharacterFlightParameterProvider;

	private float boostCooldownTimer;

	public GenericSkill secondarySkillSlot;

	public GenericSkill utilitySkillSlot;

	public GenericSkill specialSkillSlot;

	public GenericSkill secondarySkillSlot2;

	public GenericSkill utilitySkillSlot2;

	public GenericSkill specialSkillSlot2;

	public static bool playSound = true;

	private static float EnergyValue;

	private EnergyController energyController;

	public Player player;

	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()
	{
		//IL_0053: Unknown result type (might be due to invalid IL or missing references)
		//IL_0058: Unknown result type (might be due to invalid IL or missing references)
		//IL_0070: 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)
		providingAntiGravity = true;
		providingFlight = true;
		if (((EntityState)this).characterBody.hasEffectiveAuthority && Object.op_Implicit((Object)(object)((EntityState)this).characterBody.characterMotor) && ((EntityState)this).characterBody.characterMotor.isGrounded)
		{
			Vector3 velocity = ((EntityState)this).characterBody.characterMotor.velocity;
			velocity.y = 15f;
			((EntityState)this).characterBody.characterMotor.velocity = velocity;
			((BaseCharacterController)((EntityState)this).characterBody.characterMotor).Motor.ForceUnground();
		}
	}

	public override void OnEnter()
	{
		((GenericCharacterMain)this).OnEnter();
		energyController = ((Component)((EntityState)this).characterBody).GetComponent<EnergyController>();
		if (Object.op_Implicit((Object)(object)((EntityState)this).characterBody))
		{
			targetCharacterGravityParameterProvider = ((Component)((EntityState)this).characterBody).GetComponent<ICharacterGravityParameterProvider>();
			targetCharacterFlightParameterProvider = ((Component)((EntityState)this).characterBody).GetComponent<ICharacterFlightParameterProvider>();
			StartFlight();
		}
		LocalUser firstLocalUser = LocalUserManager.GetFirstLocalUser();
		NetworkUser val = ((firstLocalUser != null) ? firstLocalUser.currentNetworkUser : null);
		if (Object.op_Implicit((Object)(object)val) && val.inputPlayer != null)
		{
			player = val.inputPlayer;
		}
	}

	public override void Update()
	{
		//IL_0095: Unknown result type (might be due to invalid IL or missing references)
		((GenericCharacterMain)this).Update();
		if (((EntityState)this).characterBody.characterMotor.disableAirControlUntilCollision)
		{
			providingAntiGravity = false;
			providingFlight = false;
		}
		else
		{
			providingAntiGravity = true;
			providingFlight = true;
		}
		EnergyValue = energyController.currentEnergyValue;
		if (EnergyValue >= 0.99f && playSound)
		{
			playSound = false;
			AkSoundEngine.PostEvent(Auriel.BarMax, ((Component)((EntityState)this).characterBody).gameObject);
		}
		if ((!((EntityState)this).isAuthority || !Input.GetKeyDown(Auriel.EnergyKeyToggle.Value)) && !player.GetButtonDown(103))
		{
			return;
		}
		if (energyController.toggle)
		{
			if (EnergyValue >= 0.25f)
			{
				AkSoundEngine.PostEvent(Auriel.Switch, ((Component)((EntityState)this).characterBody).gameObject);
				EnergyController obj = energyController;
				obj.toggle = !obj.toggle;
				((EntityState)this).skillLocator.secondary.SetSkillOverride((object)1, Auriel.secondaryEmpSkillDef, (SkillOverridePriority)4);
			}
			if (EnergyValue >= 0.49f)
			{
				((EntityState)this).skillLocator.utility.SetSkillOverride((object)1, Auriel.utilityEmpSkillDef, (SkillOverridePriority)4);
			}
			if (EnergyValue >= 0.99f)
			{
				((EntityState)this).skillLocator.special.SetSkillOverride((object)1, Auriel.specialEmpSkillDef, (SkillOverridePriority)4);
			}
		}
		else
		{
			EnergyController obj2 = energyController;
			obj2.toggle = !obj2.toggle;
			((EntityState)this).skillLocator.secondary.UnsetSkillOverride((object)1, Auriel.secondaryEmpSkillDef, (SkillOverridePriority)4);
			((EntityState)this).skillLocator.utility.UnsetSkillOverride((object)1, Auriel.utilityEmpSkillDef, (SkillOverridePriority)4);
			((EntityState)this).skillLocator.special.UnsetSkillOverride((object)1, Auriel.specialEmpSkillDef, (SkillOverridePriority)4);
		}
	}

	public override void FixedUpdate()
	{
		((GenericCharacterMain)this).FixedUpdate();
		if (((EntityState)this).characterBody.HasBuff(Auriel.crownBuff))
		{
			((Component)((BaseState)this).FindModelChild("Crown")).gameObject.SetActive(true);
		}
		else
		{
			((Component)((BaseState)this).FindModelChild("Crown")).gameObject.SetActive(false);
		}
	}
}
internal class BestowHope : BaseSkillState
{
	public float duration = 0.1f;

	private uint FireID;

	public override void OnEnter()
	{
		//IL_0099: Unknown result type (might be due to invalid IL or missing references)
		//IL_009f: Unknown result type (might be due to invalid IL or missing references)
		((BaseState)this).OnEnter();
		FireID = AkSoundEngine.PostEvent(Auriel.Utility, ((Component)((EntityState)this).characterBody).gameObject);
		((EntityState)this).PlayAnimation("Gesture, Override", "Spell2", "Skill2.playbackRate", 1f);
		((EntityState)this).characterBody.AddTimedBuff(Auriel.crownBuff, 4f);
		CharacterBody component = ((EntityState)this).GetComponent<CharacterBody>();
		if (Object.op_Implicit((Object)(object)component))
		{
			HealthComponent healthComponent = component.healthComponent;
			if (Object.op_Implicit((Object)(object)healthComponent))
			{
				component.healthComponent.Heal(healthComponent.fullHealth * 0.15f + component.level * 0.015f, default(ProcChainMask), true);
			}
		}
		EffectManager.SimpleMuzzleFlash(VFX.resSource, ((EntityState)this).gameObject, "Body", false);
	}

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

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

	private GameObject areaIndicatorInstance;

	private GameObject mushroomWard;

	private uint FireID;

	private float EnergyValue;

	public override void OnEnter()
	{
		//IL_0048: Unknown result type (might be due to invalid IL or missing references)
		((BaseState)this).OnEnter();
		EnergyValue = ((Component)((EntityState)this).characterBody).GetComponent<EnergyController>().currentEnergyValue;
		areaIndicatorInstance = Object.Instantiate<GameObject>(ArrowRain.areaIndicatorPrefab);
		areaIndicatorInstance.transform.localScale = new Vector3(10f, 10f, 10f);
		((EntityState)this).PlayAnimation("Gesture, Override", "Spell2_Emp", "Skill2.playbackRate", 2.5f);
	}

	private void UpdateAreaIndicator()
	{
		//IL_0018: 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_0046: 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)
		if (Object.op_Implicit((Object)(object)areaIndicatorInstance))
		{
			float num = 1000f;
			RaycastHit val = default(RaycastHit);
			if (Physics.Raycast(((BaseState)this).GetAimRay(), ref val, num, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask)))
			{
				areaIndicatorInstance.transform.position = ((RaycastHit)(ref val)).point;
				areaIndicatorInstance.transform.up = ((RaycastHit)(ref val)).normal;
			}
		}
	}

	protected void Fire()
	{
		//IL_010c: 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_013c: 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_01e1: Unknown result type (might be due to invalid IL or missing references)
		//IL_01eb: Unknown result type (might be due to invalid IL or missing references)
		//IL_01f0: Unknown result type (might be due to invalid IL or missing references)
		//IL_0200: Unknown result type (might be due to invalid IL or missing references)
		if (EnergyValue >= 0.99f)
		{
			FireID = AkSoundEngine.PostEvent(Auriel.HealFieldMax, ((Component)((EntityState)this).characterBody).gameObject);
		}
		else
		{
			FireID = AkSoundEngine.PostEvent(Auriel.HealField, ((Component)((EntityState)this).characterBody).gameObject);
		}
		((Component)((EntityState)this).characterBody).GetComponent<EnergyController>().ResetValue();
		EffectManager.SimpleMuzzleFlash(ArrowRain.muzzleFlashEffect, ((EntityState)this).gameObject, "MuzzleR", false);
		EffectManager.SimpleMuzzleFlash(ArrowRain.muzzleFlashEffect, ((EntityState)this).gameObject, "MuzzleL", false);
		if (!Object.op_Implicit((Object)(object)areaIndicatorInstance) || !((Object)(object)mushroomWard == (Object)null))
		{
			return;
		}
		CharacterBody component = ((EntityState)this).GetComponent<CharacterBody>();
		if (!Object.op_Implicit((Object)(object)component))
		{
			return;
		}
		HealthComponent healthComponent = component.healthComponent;
		if (Object.op_Implicit((Object)(object)healthComponent))
		{
			float num = healthComponent.fullHealth * 0.0005f;
			mushroomWard = Object.Instantiate<GameObject>(Prefabs.Load<GameObject>("RoR2/Base/MiniMushroom/MiniMushroomWard.prefab"), areaIndicatorInstance.transform.position, areaIndicatorInstance.transform.rotation);
			mushroomWard.GetComponent<TeamFilter>().teamIndex = TeamComponent.GetObjectTeam(((EntityState)this).gameObject);
			mushroomWard.AddComponent<ProjectileSimple>().lifetime = 8f;
			mushroomWard.AddComponent<ProjectileController>().ghostPrefab = Prefabs.healghost2;
			if (Object.op_Implicit((Object)(object)mushroomWard))
			{
				HealingWard component2 = mushroomWard.GetComponent<HealingWard>();
				component2.healFraction = num * (1f + EnergyValue);
				component2.healPoints = 0f;
				component2.Networkradius = 10f;
			}
			NetworkServer.Spawn(mushroomWard);
			EffectManager.SimpleEffect(VFX.healField, areaIndicatorInstance.transform.position + Vector3.up * 0.1f, areaIndicatorInstance.transform.rotation, false);
		}
	}

	public override void Update()
	{
		((EntityState)this).Update();
		UpdateAreaIndicator();
	}

	public override void OnExit()
	{
		Fire();
		((EntityState)this).GetModelAnimator().SetFloat("Skill2.playbackRate", 2f);
		mushroomWard = null;
		EnergyController component = ((EntityState)this).GetComponent<EnergyController>();
		component.toggle = !component.toggle;
		EntityState.Destroy((Object)(object)areaIndicatorInstance.gameObject);
		((EntityState)this).skillLocator.secondary.UnsetSkillOverride((object)1, Auriel.secondaryEmpSkillDef, (SkillOverridePriority)4);
		((EntityState)this).skillLocator.utility.UnsetSkillOverride((object)1, Auriel.utilityEmpSkillDef, (SkillOverridePriority)4);
		((EntityState)this).skillLocator.special.UnsetSkillOverride((object)1, Auriel.specialEmpSkillDef, (SkillOverridePriority)4);
		((EntityState)this).OnExit();
	}

	public override void FixedUpdate()
	{
		((EntityState)this).FixedUpdate();
		if ((((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= duration) || ((EntityState)this).inputBank.skill1.down || ((EntityState)this).inputBank.skill2.down || ((EntityState)this).inputBank.skill4.down || !((EntityState)this).inputBank.skill3.down)
		{
			((EntityState)this).outer.SetNextStateToMain();
		}
	}

	public override InterruptPriority GetMinimumInterruptPriority()
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0005: Unknown result type (might be due to invalid IL or missing references)
		return (InterruptPriority)3;
	}
}
internal class Achievements
{
	internal static UnlockableDef aurielUnlockDef;

	internal static UnlockableDef aurielMasteryDef;

	internal static UnlockableDef aurielSakuraDef;

	internal static UnlockableDef aurielSpiritDef;

	internal static UnlockableDef aurielDemonicDef;

	public static void RegisterUnlockables()
	{
		aurielUnlockDef = UnlockableAPI.AddUnlockable<SurvivorChallenge>((Type)null, (UnlockableDef)null);
		aurielMasteryDef = UnlockableAPI.AddUnlockable<MasteryChallenge>((Type)null, (UnlockableDef)null);
		aurielSakuraDef = UnlockableAPI.AddUnlockable<SakuraChallenge>((Type)null, (UnlockableDef)null);
		aurielSpiritDef = UnlockableAPI.AddUnlockable<SpiritChallenge>((Type)null, (UnlockableDef)null);
		aurielDemonicDef = UnlockableAPI.AddUnlockable<DemonicChallenge>((Type)null, (UnlockableDef)null);
		LanguageAPI.Add("AURIEL_UNLOCKABLE_ACHIEVEMENT_ID", "AurielSurvivorAchievement");
		LanguageAPI.Add("AURIEL_UNLOCKABLE_REWARD_ID", "AurielSurvivorReward");
		LanguageAPI.Add("AURIEL_UNLOCKABLE_NAME", "AurielReborn");
		LanguageAPI.Add("AURIEL_UNLOCKABLE_ACHIEVEMENT_NAME", "A Blessing Or Just Luck?");
		LanguageAPI.Add("AURIEL_UNLOCKABLE_ACHIEVEMENT_DESC", "Grasp the duality of divine intervention.");
		LanguageAPI.Add("AURIEL_MASTERY_ACHIEVEMENT_ID", "AurielMasteryAchievement");
		LanguageAPI.Add("AURIEL_MASTERY_REWARD_ID", "AurielMasteryReward");
		LanguageAPI.Add("AURIEL_MASTERY_NAME", "AurielMastery");
		LanguageAPI.Add("AURIEL_MASTERY_ACHIEVEMENT_NAME", "Auriel: Mastery");
		LanguageAPI.Add("AURIEL_MASTERY_ACHIEVEMENT_DESC", "As Auriel, beat the game or obliterate on Monsoon.");
		LanguageAPI.Add("AURIEL_SAKURA_ACHIEVEMENT_ID", "AurielSakuraAchievement");
		LanguageAPI.Add("AURIEL_SAKURA_REWARD_ID", "AurielSakuraReward");
		LanguageAPI.Add("AURIEL_SAKURA_NAME", "AurielSakura");
		LanguageAPI.Add("AURIEL_SAKURA_ACHIEVEMENT_NAME", "Mercury Paradise");
		LanguageAPI.Add("AURIEL_SAKURA_ACHIEVEMENT_DESC", "As Auriel, visit the garden.");
		LanguageAPI.Add("AURIEL_SPIRIT_ACHIEVEMENT_ID", "AurielSpiritAchievement");
		LanguageAPI.Add("AURIEL_SPIRIT_REWARD_ID", "AurielSpiritReward");
		LanguageAPI.Add("AURIEL_SPIRIT_NAME", "AurielSpirit");
		LanguageAPI.Add("AURIEL_SPIRIT_ACHIEVEMENT_NAME", "Soul Evaluation");
		LanguageAPI.Add("AURIEL_SPIRIT_ACHIEVEMENT_DESC", "As Auriel, be resurrected by the power of Dio.");
		LanguageAPI.Add("AURIEL_DEMONIC_ACHIEVEMENT_ID", "AurielDemonicAchievement");
		LanguageAPI.Add("AURIEL_DEMONIC_REWARD_ID", "AurielDemonicReward");
		LanguageAPI.Add("AURIEL_DEMONIC_NAME", "AurielDemonic");
		LanguageAPI.Add("AURIEL_DEMONIC_ACHIEVEMENT_NAME", "Wicked");
		LanguageAPI.Add("AURIEL_DEMONIC_ACHIEVEMENT_DESC", "As Auriel, commit an act of heresy.");
	}
}
internal class SurvivorChallenge : ModdedUnlockable
{
	public override string AchievementIdentifier { get; } = "AURIEL_UNLOCKABLE_ACHIEVEMENT_ID";


	public override string UnlockableIdentifier { get; } = "AURIEL_UNLOCKABLE_REWARD_ID";


	public override string AchievementNameToken { get; } = "AURIEL_UNLOCKABLE_ACHIEVEMENT_NAME";


	public override string UnlockableNameToken { get; } = "AURIEL_UNLOCKABLE_NAME";


	public override string AchievementDescToken { get; } = "AURIEL_UNLOCKABLE_ACHIEVEMENT_DESC";


	public override Sprite Sprite { get; } = Auriel.MainAssetBundle.LoadAsset<Sprite>("portrait");


	public override string PrerequisiteUnlockableIdentifier { get; } = "AURIEL_UNLOCKABLE_REWARD_ID";


	public override Func<string> GetHowToUnlock { get; } = () => Language.GetStringFormatted("UNLOCK_VIA_ACHIEVEMENT_FORMAT", new object[2]
	{
		Language.GetString("AURIEL_UNLOCKABLE_ACHIEVEMENT_NAME"),
		Language.GetString("AURIEL_UNLOCKABLE_ACHIEVEMENT_DESC")
	});


	public override Func<string> GetUnlocked { get; } = () => Language.GetStringFormatted("UNLOCKED_FORMAT", new object[2]
	{
		Language.GetString("AURIEL_UNLOCKABLE_ACHIEVEMENT_NAME"),
		Language.GetString("AURIEL_UNLOCKABLE_ACHIEVEMENT_DESC")
	});


	public override BodyIndex LookUpRequiredBodyIndex()
	{
		//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_000e: Unknown result type (might be due to invalid IL or missing references)
		return BodyCatalog.FindBodyIndex("AurielBody");
	}

	private void OnInventoryChanged(orig_OnInventoryChanged orig, CharacterMaster self)
	{
		//IL_0015: Unknown result type (might be due to invalid IL or missing references)
		//IL_001b: Invalid comparison between Unknown and I4
		orig.Invoke(self);
		if (Object.op_Implicit((Object)(object)self) && (int)self.teamIndex == 1 && Object.op_Implicit((Object)(object)self.inventory) && Object.op_Implicit((Object)(object)self.GetBody()))
		{
			ItemDef critGlasses = Items.CritGlasses;
			ItemDef clover = Items.Clover;
			if (self.inventory.GetItemCount(critGlasses) >= 1 && self.inventory.GetItemCount(clover) >= 1)
			{
				((BaseAchievement)this).Grant();
			}
		}
	}

	public override void OnInstall()
	{
		//IL_000f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0019: Expected O, but got Unknown
		((ModdedUnlockable)this).OnInstall();
		CharacterMaster.OnInventoryChanged += new hook_OnInventoryChanged(OnInventoryChanged);
	}

	public override void OnUninstall()
	{
		//IL_000f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0019: Expected O, but got Unknown
		((ModdedUnlockable)this).OnUninstall();
		CharacterMaster.OnInventoryChanged -= new hook_OnInventoryChanged(OnInventoryChanged);
	}
}
internal class MasteryChallenge : ModdedUnlockable
{
	public override string AchievementIdentifier { get; } = "AURIEL_MASTERY_ACHIEVEMENT_ID";


	public override string UnlockableIdentifier { get; } = "AURIEL_MASTERY_REWARD_ID";


	public override string AchievementNameToken { get; } = "AURIEL_MASTERY_ACHIEVEMENT_NAME";


	public override string UnlockableNameToken { get; } = "AURIEL_MASTERY_NAME";


	public override string AchievementDescToken { get; } = "AURIEL_MASTERY_ACHIEVEMENT_DESC";


	public override Sprite Sprite { get; } = Auriel.MainAssetBundle.LoadAsset<Sprite>("portraitarchangel");


	public override string PrerequisiteUnlockableIdentifier { get; } = "AURIEL_UNLOCKABLE_REWARD_ID";


	public override Func<string> GetHowToUnlock { get; } = () => Language.GetStringFormatted("UNLOCK_VIA_ACHIEVEMENT_FORMAT", new object[2]
	{
		Language.GetString("AURIEL_MASTERY_ACHIEVEMENT_NAME"),
		Language.GetString("AURIEL_MASTERY_ACHIEVEMENT_DESC")
	});


	public override Func<string> GetUnlocked { get; } = () => Language.GetStringFormatted("UNLOCKED_FORMAT", new object[2]
	{
		Language.GetString("AURIEL_MASTERY_ACHIEVEMENT_NAME"),
		Language.GetString("AURIEL_MASTERY_ACHIEVEMENT_DESC")
	});


	public override BodyIndex LookUpRequiredBodyIndex()
	{
		//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_000e: Unknown result type (might be due to invalid IL or missing references)
		return BodyCatalog.FindBodyIndex("AurielBody");
	}

	public void ClearMonsoon(Run run, RunReport runReport)
	{
		//IL_003f: 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_0046: Unknown result type (might be due to invalid IL or missing references)
		//IL_0049: Invalid comparison between Unknown and I4
		if (run != null && runReport != null && Object.op_Implicit((Object)(object)runReport.gameEnding) && runReport.gameEnding.isWin)
		{
			DifficultyIndex val = runReport.ruleBook.FindDifficulty();
			if ((int)val == 2 && ((BaseAchievement)this).meetsBodyRequirement)
			{
				((BaseAchievement)this).Grant();
			}
		}
	}

	public override void OnInstall()
	{
		((ModdedUnlockable)this).OnInstall();
		Run.onClientGameOverGlobal += ClearMonsoon;
	}

	public override void OnUninstall()
	{
		((ModdedUnlockable)this).OnUninstall();
		Run.onClientGameOverGlobal -= ClearMonsoon;
	}
}
internal class SakuraChallenge : ModdedUnlockable
{
	public override string AchievementIdentifier { get; } = "AURIEL_SAKURA_ACHIEVEMENT_ID";


	public override string UnlockableIdentifier { get; } = "AURIEL_SAKURA_REWARD_ID";


	public override string AchievementNameToken { get; } = "AURIEL_SAKURA_ACHIEVEMENT_NAME";


	public override string UnlockableNameToken { get; } = "AURIEL_SAKURA_NAME";


	public override string AchievementDescToken { get; } = "AURIEL_SAKURA_ACHIEVEMENT_DESC";


	public override Sprite Sprite { get; } = Auriel.MainAssetBundle.LoadAsset<Sprite>("portraithanamura");


	public override string PrerequisiteUnlockableIdentifier { get; } = "AURIEL_UNLOCKABLE_REWARD_ID";


	public override Func<string> GetHowToUnlock { get; } = () => Language.GetStringFormatted("UNLOCK_VIA_ACHIEVEMENT_FORMAT", new object[2]
	{
		Language.GetString("AURIEL_SAKURA_ACHIEVEMENT_NAME"),
		Language.GetString("AURIEL_SAKURA_ACHIEVEMENT_DESC")
	});


	public override Func<string> GetUnlocked { get; } = () => Language.GetStringFormatted("UNLOCKED_FORMAT", new object[2]
	{
		Language.GetString("AURIEL_SAKURA_ACHIEVEMENT_NAME"),
		Language.GetString("AURIEL_SAKURA_ACHIEVEMENT_DESC")
	});


	public override BodyIndex LookUpRequiredBodyIndex()
	{
		//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_000e: Unknown result type (might be due to invalid IL or missing references)
		return BodyCatalog.FindBodyIndex("AurielBody");
	}

	private void SceneDirector_Start(orig_Start orig, SceneDirector self)
	{
		//IL_000c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0011: Unknown result type (might be due to invalid IL or missing references)
		if (Object.op_Implicit((Object)(object)self))
		{
			Scene activeScene = SceneManager.GetActiveScene();
			if (((Scene)(ref activeScene)).name == "wispgraveyard" && ((BaseAchievement)this).meetsBodyRequirement)
			{
				((BaseAchievement)this).Grant();
			}
		}
		orig.Invoke(self);
	}

	public override void OnInstall()
	{
		//IL_000f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0019: Expected O, but got Unknown
		((ModdedUnlockable)this).OnInstall();
		SceneDirector.Start += new hook_Start(SceneDirector_Start);
	}

	public override void OnUninstall()
	{
		//IL_000f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0019: Expected O, but got Unknown
		((ModdedUnlockable)this).OnUninstall();
		SceneDirector.Start -= new hook_Start(SceneDirector_Start);
	}
}
internal class SpiritChallenge : ModdedUnlockable
{
	public override string AchievementIdentifier { get; } = "AURIEL_SPIRIT_ACHIEVEMENT_ID";


	public override string UnlockableIdentifier { get; } = "AURIEL_SPIRIT_REWARD_ID";


	public override string AchievementNameToken { get; } = "AURIEL_SPIRIT_ACHIEVEMENT_NAME";


	public override string UnlockableNameToken { get; } = "AURIEL_SPIRIT_NAME";


	public override string AchievementDescToken { get; } = "AURIEL_SPIRIT_ACHIEVEMENT_DESC";


	public override Sprite Sprite { get; } = Auriel.MainAssetBundle.LoadAsset<Sprite>("portraitspirit");


	public override string PrerequisiteUnlockableIdentifier { get; } = "AURIEL_UNLOCKABLE_REWARD_ID";


	public override Func<string> GetHowToUnlock { get; } = () => Language.GetStringFormatted("UNLOCK_VIA_ACHIEVEMENT_FORMAT", new object[2]
	{
		Language.GetString("AURIEL_SPIRIT_ACHIEVEMENT_NAME"),
		Language.GetString("AURIEL_SPIRIT_ACHIEVEMENT_DESC")
	});


	public override Func<string> GetUnlocked { get; } = () => Language.GetStringFormatted("UNLOCKED_FORMAT", new object[2]
	{
		Language.GetString("AURIEL_SPIRIT_ACHIEVEMENT_NAME"),
		Language.GetString("AURIEL_SPIRIT_ACHIEVEMENT_DESC")
	});


	public override BodyIndex LookUpRequiredBodyIndex()
	{
		//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_000e: Unknown result type (might be due to invalid IL or missing references)
		return BodyCatalog.FindBodyIndex("AurielBody");
	}

	private void CharacterMaster_RespawnExtraLife(orig_RespawnExtraLife orig, CharacterMaster self)
	{
		orig.Invoke(self);
		if (Object.op_Implicit((Object)(object)self) && Object.op_Implicit((Object)(object)((Component)self).GetComponent<PlayerCharacterMasterController>()) && ((BaseAchievement)this).meetsBodyRequirement)
		{
			((BaseAchievement)this).Grant();
		}
	}

	public override void OnInstall()
	{
		//IL_000f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0019: Expected O, but got Unknown
		((ModdedUnlockable)this).OnInstall();
		CharacterMaster.RespawnExtraLife += new hook_RespawnExtraLife(CharacterMaster_RespawnExtraLife);
	}

	public override void OnUninstall()
	{
		//IL_000f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0019: Expected O, but got Unknown
		((ModdedUnlockable)this).OnUninstall();
		CharacterMaster.RespawnExtraLife -= new hook_RespawnExtraLife(CharacterMaster_RespawnExtraLife);
	}
}
internal class DemonicChallenge : ModdedUnlockable
{
	public override string AchievementIdentifier { get; } = "AURIEL_DEMONIC_ACHIEVEMENT_ID";


	public override string UnlockableIdentifier { get; } = "AURIEL_DEMONIC_REWARD_ID";


	public override string AchievementNameToken { get; } = "AURIEL_DEMONIC_ACHIEVEMENT_NAME";


	public override string UnlockableNameToken { get; } = "AURIEL_DEMONIC_NAME";


	public override string AchievementDescToken { get; } = "AURIEL_DEMONIC_ACHIEVEMENT_DESC";


	public override Sprite Sprite { get; } = Auriel.MainAssetBundle.LoadAsset<Sprite>("portraitdemonic");


	public override string PrerequisiteUnlockableIdentifier { get; } = "AURIEL_UNLOCKABLE_REWARD_ID";


	public override Func<string> GetHowToUnlock { get; } = () => Language.GetStringFormatted("UNLOCK_VIA_ACHIEVEMENT_FORMAT", new object[2]
	{
		Language.GetString("AURIEL_DEMONIC_ACHIEVEMENT_NAME"),
		Language.GetString("AURIEL_DEMONIC_ACHIEVEMENT_DESC")
	});


	public override Func<string> GetUnlocked { get; } = () => Language.GetStringFormatted("UNLOCKED_FORMAT", new object[2]
	{
		Language.GetString("AURIEL_DEMONIC_ACHIEVEMENT_NAME"),
		Language.GetString("AURIEL_DEMONIC_ACHIEVEMENT_DESC")
	});


	public override BodyIndex LookUpRequiredBodyIndex()
	{
		//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_000e: Unknown result type (might be due to invalid IL or missing references)
		return BodyCatalog.FindBodyIndex("AurielBody");
	}

	private void OnInventoryChanged(orig_OnInventoryChanged orig, CharacterMaster self)
	{
		//IL_0018: Unknown result type (might be due to invalid IL or missing references)
		//IL_001e: Invalid comparison between Unknown and I4
		orig.Invoke(self);
		if (Object.op_Implicit((Object)(object)self) && (int)self.teamIndex == 1 && Object.op_Implicit((Object)(object)self.inventory) && Object.op_Implicit((Object)(object)self.GetBody()))
		{
			ItemDef lunarPrimaryReplacement = Items.LunarPrimaryReplacement;
			ItemDef lunarSecondaryReplacement = Items.LunarSecondaryReplacement;
			ItemDef lunarUtilityReplacement = Items.LunarUtilityReplacement;
			ItemDef lunarSpecialReplacement = Items.LunarSpecialReplacement;
			if ((self.inventory.GetItemCount(lunarPrimaryReplacement) >= 1 || self.inventory.GetItemCount(lunarSecondaryReplacement) >= 1 || self.inventory.GetItemCount(lunarUtilityReplacement) >= 1 || self.inventory.GetItemCount(lunarSpecialReplacement) >= 1) && ((BaseAchievement)this).meetsBodyRequirement)
			{
				((BaseAchievement)this).Grant();
			}
		}
	}

	public override void OnInstall()
	{
		//IL_000f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0019: Expected O, but got Unknown
		((ModdedUnlockable)this).OnInstall();
		CharacterMaster.OnInventoryChanged += new hook_OnInventoryChanged(OnInventoryChanged);
	}

	public override void OnUninstall()
	{
		//IL_000f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0019: Expected O, but got Unknown
		((ModdedUnlockable)this).OnUninstall();
		CharacterMaster.OnInventoryChanged -= new hook_OnInventoryChanged(OnInventoryChanged);
	}
}
internal class EnergyController : MonoBehaviour
{
	private CharacterBody body;

	private GameObject energyBar;

	private TextMeshProUGUI currentEnergy;

	private TextMeshProUGUI fullEnergy;

	private Image barImage;

	[SerializeField]
	private float energyValue = 0f;

	private float maxEnergyValue = 1f;

	private bool barSetupDone;

	public bool canExecute = true;

	public bool toggle = true;

	internal bool maxEnergy => energyValue >= maxEnergyValue;

	public float currentEnergyValue => energyValue;

	public void AddEnergy()
	{
		energyValue += 0.02f;
	}

	public void ResetValue()
	{
		energyValue = 0f;
	}

	private void OnEnable()
	{
		//IL_0014: Unknown result type (might be due to invalid IL or missing references)
		//IL_001e: Expected O, but got Unknown
		body = ((Component)this).GetComponent<CharacterBody>();
		HUD.Update += new hook_Update(HUD_Update);
	}

	private void HUD_Update(orig_Update orig, HUD self)
	{
		//IL_034f: Unknown result type (might be due to invalid IL or missing references)
		orig.Invoke(self);
		energyValue = Mathf.Clamp(energyValue, 0f, maxEnergyValue);
		if (Object.op_Implicit((Object)(object)barImage))
		{
			barImage.fillAmount = energyValue / maxEnergyValue;
		}
		if (Object.op_Implicit((Object)(object)currentEnergy) && ((TMP_Text)currentEnergy).text != energyValue.ToString())
		{
			((TMP_Text)currentEnergy).text = Mathf.CeilToInt(energyValue * 100f).ToString();
		}
		if (!Object.op_Implicit((Object)(object)self.targetBodyObject) || !((Object)(object)self.targetBodyObject == (Object)(object)((Component)this).gameObject) || !Object.op_Implicit((Object)(object)self.mainUIPanel) || !Util.HasEffectiveAuthority(((Component)this).gameObject) || Object.op_Implicit((Object)(object)energyBar))
		{
			return;
		}
		HealthBar componentInChildren = self.mainUIPanel.GetComponentInChildren<HealthBar>();
		if (!Object.op_Implicit((Object)(object)componentInChildren) || !Object.op_Implicit((Object)(object)((Component)componentInChildren).gameObject))
		{
			return;
		}
		Image[] componentsInChildren = ((Component)componentInChildren).gameObject.GetComponentsInChildren<Image>();
		if (!barSetupDone)
		{
			for (int i = 0; i < componentsInChildren.Length; i++)
			{
				if (componentsInChildren.Length >= 5)
				{
					barSetupDone = true;
				}
			}
		}
		if (!barSetupDone)
		{
			return;
		}
		energyBar = Object.Instantiate<GameObject>(((Component)componentInChildren).gameObject, ((Component)componentInChildren).gameObject.transform.parent);
		((Object)energyBar).name = "EnergyBar";
		Object.Destroy((Object)(object)energyBar.GetComponent<HealthBar>());
		TextMeshProUGUI[] componentsInChildren2 = energyBar.GetComponentsInChildren<TextMeshProUGUI>();
		for (int j = 0; j < componentsInChildren2.Length; j++)
		{
			if (Object.op_Implicit((Object)(object)componentsInChildren2[j]) && Object.op_Implicit((Object)(object)((Component)componentsInChildren2[j]).gameObject))
			{
				if (((Object)((Component)componentsInChildren2[j]).gameObject).name == "CurrentHealthText")
				{
					currentEnergy = componentsInChildren2[j];
					((TMP_Text)currentEnergy).text = "0";
				}
				if (((Object)((Component)componentsInChildren2[j]).gameObject).name == "FullHealthText")
				{
					fullEnergy = componentsInChildren2[j];
					((TMP_Text)fullEnergy).text = "100";
				}
			}
		}
		Image[] componentsInChildren3 = energyBar.GetComponentsInChildren<Image>();
		for (int k = 0; k < componentsInChildren3.Length; k++)
		{
			if (Object.op_Implicit((Object)(object)componentsInChildren3[k]) && Object.op_Implicit((Object)(object)((Component)componentsInChildren3[k]).gameObject))
			{
				if ((Object)(object)componentsInChildren3[k] != (Object)(object)componentsInChildren3[3] && (Object)(object)componentsInChildren3[k] != (Object)(object)componentsInChildren3[0])
				{
					Object.Destroy((Object)(object)((Component)componentsInChildren3[k]).gameObject);
				}
				if ((Object)(object)componentsInChildren3[k] == (Object)(object)componentsInChildren3[3])
				{
					barImage = componentsInChildren3[k];
					((Graphic)barImage).color = new Color(49f / 51f, 0.8235294f, 0f);
					barImage.type = (Type)3;
					barImage.fillMethod = (FillMethod)0;
					barImage.fillCenter = false;
				}
			}
		}
	}

	private void OnDisable()
	{
		//IL_0008: Unknown result type (might be due to invalid IL or missing references)
		//IL_0012: Expected O, but got Unknown
		HUD.Update -= new hook_Update(HUD_Update);
		if (Object.op_Implicit((Object)(object)energyBar))
		{
			Object.Destroy((Object)(object)energyBar);
		}
	}
}
internal class Prefabs
{
	public static GameObject projectile;

	public static GameObject projectileGhost;

	public static GameObject projectile2;

	public static GameObject projectileGrav;

	public static GameObject projectileGravInst;

	public static GameObject projectileGravInstGhost;

	public static GameObject healghost;

	public static GameObject healghost2;

	public static GameObject laserEffect;

	public static GameObject Crosshair;

	public 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();
	}

	public static void CreatePrefabs()
	{
		//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_01ce: Unknown result type (might be due to invalid IL or missing references)
		//IL_01d4: Expected O, but got Unknown
		//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
		//IL_0185: Unknown result type (might be due to invalid IL or missing references)
		//IL_018f: Unknown result type (might be due to invalid IL or missing references)
		//IL_02be: Unknown result type (might be due to invalid IL or missing references)
		//IL_02c3: Unknown result type (might be due to invalid IL or missing references)
		//IL_0414: Unknown result type (might be due to invalid IL or missing references)
		//IL_0472: Unknown result type (might be due to invalid IL or missing references)
		//IL_0479: Expected O, but got Unknown
		//IL_0493: Unknown result type (might be due to invalid IL or missing references)
		//IL_0498: Unknown result type (might be due to invalid IL or missing references)
		BuffDef val = ScriptableObject.CreateInstance<BuffDef>();
		((Object)val).name = "BestowHope";
		val.iconSprite = Load<Sprite>("RoR2/Base/Grandparent/texBuffOverheat.tif");
		val.buffColor = Auriel.characterColor;
		val.canStack = true;
		val.isDebuff = false;
		val.eliteDef = null;
		ContentAddition.AddBuffDef(val);
		Auriel.crownBuff = val;
		laserEffect = PrefabAPI.In