Decompiled source of Auriel v1.7.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 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.1", FrameworkDisplayName = "")]
[assembly: AssemblyCompany("Auriel")]
[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.7.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_0759: Unknown result type (might be due to invalid IL or missing references)
		//IL_0776: Unknown result type (might be due to invalid IL or missing references)
		//IL_0778: Unknown result type (might be due to invalid IL or missing references)
		//IL_0781: Unknown result type (might be due to invalid IL or missing references)
		//IL_07b8: Unknown result type (might be due to invalid IL or missing references)
		//IL_07ba: Unknown result type (might be due to invalid IL or missing references)
		//IL_07c3: Unknown result type (might be due to invalid IL or missing references)
		//IL_07fa: 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_0805: Unknown result type (might be due to invalid IL or missing references)
		//IL_083c: Unknown result type (might be due to invalid IL or missing references)
		//IL_083e: 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_08c4: Unknown result type (might be due to invalid IL or missing references)
		//IL_08cb: Expected O, but got Unknown
		//IL_08d2: Unknown result type (might be due to invalid IL or missing references)
		//IL_090a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a9b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0aa6: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b01: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b26: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b28: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b6d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a16: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a1d: Expected O, but got Unknown
		//IL_0a33: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a53: Unknown result type (might be due to invalid IL or missing references)
		//IL_0c83: Unknown result type (might be due to invalid IL or missing references)
		//IL_0c8e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ce9: Unknown result type (might be due to invalid IL or missing references)
		//IL_0d0e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0d10: Unknown result type (might be due to invalid IL or missing references)
		//IL_0d55: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ba9: Unknown result type (might be due to invalid IL or missing references)
		//IL_0bb0: Expected O, but got Unknown
		//IL_0bb7: Unknown result type (might be due to invalid IL or missing references)
		//IL_0bef: Unknown result type (might be due to invalid IL or missing references)
		//IL_0d91: Unknown result type (might be due to invalid IL or missing references)
		//IL_0d98: Expected O, but got Unknown
		//IL_0d9f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0dd7: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ea4: Unknown result type (might be due to invalid IL or missing references)
		//IL_0eaf: Unknown result type (might be due to invalid IL or missing references)
		//IL_0f0a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0f2f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0f31: Unknown result type (might be due to invalid IL or missing references)
		//IL_0f3a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0f6a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0f6c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0f75: Unknown result type (might be due to invalid IL or missing references)
		//IL_0fa5: Unknown result type (might be due to invalid IL or missing references)
		//IL_0fa7: Unknown result type (might be due to invalid IL or missing references)
		//IL_0fec: Unknown result type (might be due to invalid IL or missing references)
		//IL_1028: Unknown result type (might be due to invalid IL or missing references)
		//IL_102f: Expected O, but got Unknown
		//IL_1036: Unknown result type (might be due to invalid IL or missing references)
		//IL_106e: Unknown result type (might be due to invalid IL or missing references)
		//IL_113b: Unknown result type (might be due to invalid IL or missing references)
		//IL_1146: Unknown result type (might be due to invalid IL or missing references)
		//IL_11a1: Unknown result type (might be due to invalid IL or missing references)
		//IL_11c6: Unknown result type (might be due to invalid IL or missing references)
		//IL_11c8: Unknown result type (might be due to invalid IL or missing references)
		//IL_11d1: Unknown result type (might be due to invalid IL or missing references)
		//IL_1201: Unknown result type (might be due to invalid IL or missing references)
		//IL_1203: Unknown result type (might be due to invalid IL or missing references)
		//IL_120c: Unknown result type (might be due to invalid IL or missing references)
		//IL_123c: Unknown result type (might be due to invalid IL or missing references)
		//IL_123e: Unknown result type (might be due to invalid IL or missing references)
		//IL_1283: Unknown result type (might be due to invalid IL or missing references)
		//IL_12bf: Unknown result type (might be due to invalid IL or missing references)
		//IL_12c6: Expected O, but got Unknown
		//IL_12cd: Unknown result type (might be due to invalid IL or missing references)
		//IL_1305: Unknown result type (might be due to invalid IL or missing references)
		//IL_140b: Unknown result type (might be due to invalid IL or missing references)
		//IL_1517: Unknown result type (might be due to invalid IL or missing references)
		//IL_151c: Unknown result type (might be due to invalid IL or missing references)
		//IL_1610: Unknown result type (might be due to invalid IL or missing references)
		//IL_16a9: Unknown result type (might be due to invalid IL or missing references)
		//IL_16f0: Unknown result type (might be due to invalid IL or missing references)
		//IL_16f7: Expected O, but got Unknown
		//IL_172b: Unknown result type (might be due to invalid IL or missing references)
		//IL_173d: Unknown result type (might be due to invalid IL or missing references)
		//IL_175e: Unknown result type (might be due to invalid IL or missing references)
		//IL_17b0: Unknown result type (might be due to invalid IL or missing references)
		//IL_17b7: Expected O, but got Unknown
		//IL_17eb: Unknown result type (might be due to invalid IL or missing references)
		//IL_17fd: Unknown result type (might be due to invalid IL or missing references)
		//IL_181e: Unknown result type (might be due to invalid IL or missing references)
		//IL_1870: Unknown result type (might be due to invalid IL or missing references)
		//IL_1877: Expected O, but got Unknown
		//IL_18ab: Unknown result type (might be due to invalid IL or missing references)
		//IL_18bd: Unknown result type (might be due to invalid IL or missing references)
		//IL_18de: 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<TemporaryOverlayInstance>();
		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];
		((Component)component9.FindChild("Crown")).gameObject.SetActive(false);
		val8.GameObjectActivations = (GameObjectActivation[])(object)new GameObjectActivation[0];
		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")).GetComponent<SkinnedMeshRenderer>().sharedMesh
			},
			new MeshReplacement
			{
				renderer = baseRendererInfos[2].renderer,
				mesh = ((Component)component9.FindChild("WingsAnimated")).GetComponent<SkinnedMeshRenderer>().sharedMesh
			},
			new MeshReplacement
			{
				renderer = baseRendererInfos[3].renderer,
				mesh = ((Component)component9.FindChild("Crown")).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 = Skins.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 = Skins.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 = Skins.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 = Skins.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 = Skins.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 = (ICharacterController)(object)component4;
		component15.Capsule = component14;
		component15.playerCharacter = true;
		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_0037: Unknown result type (might be due to invalid IL or missing references)
		//IL_0041: Unknown result type (might be due to invalid IL or missing references)
		//IL_0084: Unknown result type (might be due to invalid IL or missing references)
		//IL_008e: Expected O, but got Unknown
		//IL_0147: Unknown result type (might be due to invalid IL or missing references)
		//IL_014c: Unknown result type (might be due to invalid IL or missing references)
		characterDisplay = PrefabAPI.InstantiateClone(((Component)characterPrefab.GetComponent<ModelLocator>().modelBaseTransform).gameObject, "AurielDisplay", true);
		characterDisplay.transform.GetChild(2).localPosition = Vector3.up * 0.1f;
		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, <style=cIsDamage>piercing</style> enemies with a powerful beam of light dealing <style=cIsDamage>100%</style> <style=cIsDamage>+Energy</style> damage per hit and <style=cIsDamage>burns</style> 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, <style=cIsHealing>healing</style> 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", "Auriel channels on the spirit of a fallen ally. After channeling for <style=cIsUtility>2s</style>, they are brought back to <style=cIsHealing>life</style>. If there is no ally to resurrect, Auriel <style=cIsHealing>heals</style> herself to <style=cIsHealth>full health</style>.");
		specialEmpSkillDef = ScriptableObject.CreateInstance<SkillDef>();
		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_002b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0030: Unknown result type (might be due to invalid IL or missing references)
		SkillLocator component = characterPrefab.GetComponent<SkillLocator>();
		LanguageAPI.Add("AURIEL_PASSIVE_NAME", "Angelic Flight");
		KeyCode value = EnergyKeyToggle.Value;
		LanguageAPI.Add("AURIEL_PASSIVE_DESCRIPTION", "Auriel can <style=cIsUtility>fly</style> at will. Searing Light generates <style=cIsDamage>Energy</style>, which can be used to cast <style=cIsDamage>Energy Skills</style>. Pressing " + ((object)(KeyCode)(ref value)).ToString() + " or Left D-Pad, enables the <style=cIsDamage>Energy Skills</style> that match their <style=cIsDamage>Energy</style> cost.");
		component.passiveSkill.enabled = true;
		component.passiveSkill.skillNameToken = "AURIEL_PASSIVE_NAME";
		component.passiveSkill.skillDescriptionToken = "AURIEL_PASSIVE_DESCRIPTION";
		component.passiveSkill.icon = MainAssetBundle.LoadAsset<Sprite>("passive");
	}

	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 <style=cIsDamage>pierces</style> all enemies 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, <style=cIsUtility>pulling</style> all nearby enemies to it's core and <style=cIsUtility>dragging</style> them along it's path. [<style=cIsDamage>Divine Beam</style>]");
		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 <style=cIsHealing>recovers 5%</style> of her <style=cIsHealth>health</style> and gains <style=cIsDamage>25% attack speed</style> and <style=cIsUtility>25% movement speed</style> for a <style=cIsUtility>4s</style>. [<style=cIsDamage>Ray of Heaven</style>]");
		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 <style=cIsDamage>divine protection</style> 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. [<style=cIsDamage>Resurrect</style>]");
		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;

	private GameObject crown;

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

	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();
		}
		crown = ((Component)((BaseState)this).FindModelChild("Crown")).gameObject;
	}

	public override void Update()
	{
		((GenericCharacterMain)this).Update();
		if (((EntityState)this).characterBody.characterMotor.disableAirControlUntilCollision)
		{
			providingAntiGravity = false;
			providingFlight = false;
		}
		else
		{
			providingAntiGravity = true;
			providingFlight = true;
		}
	}

	public override void FixedUpdate()
	{
		((GenericCharacterMain)this).FixedUpdate();
		if (((EntityState)this).characterBody.HasBuff(Auriel.crownBuff))
		{
			crown.SetActive(true);
		}
		else
		{
			crown.SetActive(false);
		}
	}
}
internal class EnergyController : MonoBehaviour
{
	private CharacterBody body;

	private GameObject energyBar;

	[SerializeField]
	private float energyValue = 0f;

	private float maxEnergyValue = 1f;

	public bool canExecute = true;

	public bool toggle = true;

	public bool canRez;

	public HUDTracker tracker;

	public float barGain = 0.02f;

	public Player player;

	public float currentEnergyValue => energyValue;

	public void AddEnergy()
	{
		energyValue = MathF.Min(energyValue + barGain, maxEnergyValue);
		AkSoundEngine.PostEvent(Auriel.BarMax, ((Component)this).gameObject);
		if (!Object.op_Implicit((Object)(object)tracker))
		{
			Debug.LogWarning((object)"[Auriel]: No HUDTracker");
		}
		else
		{
			tracker.UpdateValues(energyValue);
		}
	}

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

	private void Update()
	{
		//IL_0020: Unknown result type (might be due to invalid IL or missing references)
		if ((!Object.op_Implicit((Object)(object)body) || !body.hasEffectiveAuthority || !Input.GetKeyDown(Auriel.EnergyKeyToggle.Value)) && !player.GetButtonDown(103))
		{
			return;
		}
		if (toggle)
		{
			if (currentEnergyValue >= 0.25f)
			{
				AkSoundEngine.PostEvent(Auriel.Switch, ((Component)this).gameObject);
				toggle = !toggle;
				body.skillLocator.secondary.SetSkillOverride((object)((Component)this).gameObject, Auriel.secondaryEmpSkillDef, (SkillOverridePriority)4);
			}
			if (currentEnergyValue >= 0.49f)
			{
				body.skillLocator.utility.SetSkillOverride((object)((Component)this).gameObject, Auriel.utilityEmpSkillDef, (SkillOverridePriority)4);
			}
			if (currentEnergyValue >= 0.99f)
			{
				body.skillLocator.special.SetSkillOverride((object)((Component)this).gameObject, Auriel.specialEmpSkillDef, (SkillOverridePriority)4);
			}
		}
		else
		{
			toggle = !toggle;
			body.skillLocator.secondary.UnsetSkillOverride((object)((Component)this).gameObject, Auriel.secondaryEmpSkillDef, (SkillOverridePriority)4);
			body.skillLocator.utility.UnsetSkillOverride((object)((Component)this).gameObject, Auriel.utilityEmpSkillDef, (SkillOverridePriority)4);
			body.skillLocator.special.UnsetSkillOverride((object)((Component)this).gameObject, Auriel.specialEmpSkillDef, (SkillOverridePriority)4);
		}
	}

	private void Awake()
	{
		body = ((Component)this).GetComponent<CharacterBody>();
	}

	private void OnEnable()
	{
		LocalUser firstLocalUser = LocalUserManager.GetFirstLocalUser();
		NetworkUser val = ((firstLocalUser != null) ? firstLocalUser.currentNetworkUser : null);
		if (Object.op_Implicit((Object)(object)val) && val.inputPlayer != null)
		{
			player = val.inputPlayer;
		}
	}

	private void OnDisable()
	{
		if (Object.op_Implicit((Object)(object)energyBar))
		{
			Object.Destroy((Object)(object)energyBar);
		}
	}
}
internal class HUDTracker : MonoBehaviour
{
	public GameObject barRoot;

	public Image bar;

	public TextMeshProUGUI currentText;

	public TextMeshProUGUI fullText;

	public HUD hud;

	private EnergyController behaviour;

	private void Awake()
	{
		hud = ((Component)this).GetComponent<HUD>();
	}

	public void UpdateValues(float value)
	{
		if (!Object.op_Implicit((Object)(object)bar) || !Object.op_Implicit((Object)(object)currentText))
		{
			Debug.LogWarning((object)"[Auriel]: No Bar Elements");
			return;
		}
		bar.fillAmount = value;
		((TMP_Text)currentText).text = Mathf.CeilToInt(bar.fillAmount * 100f).ToString();
	}

	private void FixedUpdate()
	{
		if (!Object.op_Implicit((Object)(object)behaviour))
		{
			if (Object.op_Implicit((Object)(object)hud) && Object.op_Implicit((Object)(object)hud.targetBodyObject))
			{
				behaviour = hud.targetBodyObject.GetComponent<EnergyController>();
				if (Object.op_Implicit((Object)(object)behaviour))
				{
					behaviour.tracker = this;
					barRoot.gameObject.SetActive(true);
				}
			}
			if (barRoot.activeInHierarchy)
			{
				barRoot.gameObject.SetActive(false);
			}
		}
		else if (!barRoot.activeInHierarchy)
		{
			barRoot.gameObject.SetActive(true);
		}
	}
}
internal class BestowHope : BaseSkillState
{
	public float duration = 0.1f;

	private uint FireID;

	public override void OnEnter()
	{
		//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
		((BaseState)this).OnEnter();
		FireID = AkSoundEngine.PostEvent(Auriel.Utility, ((Component)((EntityState)this).characterBody).gameObject);
		((EntityState)this).PlayAnimation("Gesture, Override", "Spell2", "Skill2.playbackRate", 1f, 0f);
		if (NetworkServer.active)
		{
			((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, 0f);
	}

	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;
		if (Object.op_Implicit((Object)(object)areaIndicatorInstance))
		{
			EntityState.Destroy((Object)(object)areaIndicatorInstance);
		}
		((EntityState)this).skillLocator.secondary.UnsetSkillOverride((object)((EntityState)this).gameObject, Auriel.secondaryEmpSkillDef, (SkillOverridePriority)4);
		((EntityState)this).skillLocator.utility.UnsetSkillOverride((object)((EntityState)this).gameObject, Auriel.utilityEmpSkillDef, (SkillOverridePriority)4);
		((EntityState)this).skillLocator.special.UnsetSkillOverride((object)((EntityState)this).gameObject, 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 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_006b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0075: Unknown result type (might be due to invalid IL or missing references)
		//IL_007a: Unknown result type (might be due to invalid IL or missing references)
		//IL_008c: Unknown result type (might be due to invalid IL or missing references)
		//IL_009e: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e7: Expected O, but got Unknown
		//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f5: Expected O, but got Unknown
		//IL_0101: Unknown result type (might be due to invalid IL or missing references)
		//IL_0106: Unknown result type (might be due to invalid IL or missing references)
		//IL_0113: Unknown result type (might be due to invalid IL or missing references)
		//IL_0120: Unknown result type (might be due to invalid IL or missing references)
		//IL_0137: Unknown result type (might be due to invalid IL or missing references)
		//IL_0144: Unknown result type (might be due to invalid IL or missing references)
		//IL_0151: Unknown result type (might be due to invalid IL or missing references)
		//IL_0176: Unknown result type (might be due to invalid IL or missing references)
		//IL_0258: Unknown result type (might be due to invalid IL or missing references)
		//IL_025d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0406: Unknown result type (might be due to invalid IL or missing references)
		//IL_040d: Expected O, but got Unknown
		//IL_0321: Unknown result type (might be due to invalid IL or missing references)
		//IL_032b: Unknown result type (might be due to invalid IL or missing references)
		//IL_03bd: Unknown result type (might be due to invalid IL or missing references)
		//IL_03c7: Unknown result type (might be due to invalid IL or missing references)
		//IL_0501: Unknown result type (might be due to invalid IL or missing references)
		//IL_0506: Unknown result type (might be due to invalid IL or missing references)
		//IL_0657: Unknown result type (might be due to invalid IL or missing references)
		//IL_06b5: Unknown result type (might be due to invalid IL or missing references)
		//IL_06bc: Expected O, but got Unknown
		//IL_06d6: Unknown result type (might be due to invalid IL or missing references)
		//IL_06db: Unknown result type (might be due to invalid IL or missing references)
		GameObject val = Load<GameObject>("RoR2/Base/UI/HUDSimple.prefab");
		Object.DontDestroyOnLoad((Object)(object)val);
		HUDTracker hUDTracker = val.AddComponent<HUDTracker>();
		Transform val2 = val.GetComponent<ChildLocator>().FindChild("BottomLeftCluster");
		GameObject gameObject = ((Component)((Component)val2).GetComponentInChildren<HealthBar>()).gameObject;
		GameObject val3 = Object.Instantiate<GameObject>(gameObject);
		((Object)val3).name = "EnergyBar";
		val3.transform.SetParent(gameObject.transform.parent);
		val3.transform.localPosition = Vector2.op_Implicit(Vector2.one * 6f);
		val3.transform.localRotation = Quaternion.identity;
		val3.transform.localScale = Vector3.one;
		HealthBar component = val3.GetComponent<HealthBar>();
		RectTransform barContainer = component.barContainer;
		GameObject val4 = new GameObject("Bar", new Type[2]
		{
			typeof(RectTransform),
			typeof(Image)
		});
		RectTransform val5 = (RectTransform)val4.transform;
		((Transform)val5).SetParent((Transform)(object)barContainer);
		((Transform)val5).localPosition = Vector2.op_Implicit(Vector2.zero);
		((Transform)val5).localRotation = Quaternion.identity;
		((Transform)val5).localScale = Vector3.one;
		val5.sizeDelta = new Vector2(4f, 3f);
		val5.anchorMin = Vector2.zero;
		val5.anchorMax = Vector2.one;
		Image component2 = val4.GetComponent<Image>();
		((Graphic)component2).color = new Color(49f / 51f, 0.8235294f, 0f);
		component2.sprite = Auriel.MainAssetBundle.LoadAsset<Sprite>("energybar");
		component2.type = (Type)3;
		component2.fillMethod = (FillMethod)0;
		component2.fillAmount = 0f;
		hUDTracker.barRoot = val3;
		hUDTracker.bar = component2;
		hUDTracker.currentText = component.currentHealthText;
		((TMP_Text)hUDTracker.currentText).text = "0";
		((Component)((TMP_Text)hUDTracker.currentText).transform.parent).gameObject.SetActive(true);
		hUDTracker.fullText = component.fullHealthText;
		((TMP_Text)hUDTracker.fullText).text = "100";
		Object.Destroy((Object)(object)component);
		val3.SetActive(false);
		BuffDef val6 = ScriptableObject.CreateInstance<BuffDef>();
		((Object)val6).name = "BestowHope";
		val6.iconSprite = Load<Sprite>("RoR2/Base/Grandparent/texBuffOverheat.tif");
		val6.buffColor = Auriel.characterColor;
		val6.canStack = true;
		val6.isDebuff = false;
		val6.eliteDef = null;
		ContentAddition.AddBuffDef(val6);
		Auriel.crownBuff = val6;
		laserEffect = PrefabAPI.InstantiateClone(Load<GameObject>("RoR2/DLC1/MajorAndMinorConstruct/LaserMajorConstruct.prefab"), "AurielLaserEffect", false);
		ParticleSystemRenderer[] componentsInChildren = laserEffect.GetComponentsInChildren<ParticleSystemRenderer>();
		foreach (ParticleSystemRenderer val7 in componentsInChildren)
		{
			string name = ((Object)val7).name;
			if (name == "Hexagon" || name == "AreaIndicator" || name == "Fire, Electric")
			{
				((Renderer)val7).enabled = false;
			}
			if (name == "Flare (1)")
			{
				((Component)val7).transform.localScale = Vector3.one * 0.65f;
			}
		}
		projectileGravInstGhost = PrefabAPI.InstantiateClone(Load<GameObject>("RoR2/Base/Grandparent/GrandparentGravSphereGhost.prefab"), "AurielProjectileGravInstGhost", fals