Decompiled source of PaladinMod v2.0.3

plugins/PaladinMod.dll

Decompiled 3 months ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using AncientScepter;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using BepInEx.Logging;
using EmotesAPI;
using EntityStates;
using EntityStates.BrotherMonster;
using EntityStates.BrotherMonster.Weapon;
using EntityStates.ClayBruiserMonster;
using EntityStates.Commando;
using EntityStates.Commando.CommandoWeapon;
using EntityStates.Croco;
using EntityStates.GlobalSkills.LunarDetonator;
using EntityStates.GlobalSkills.LunarNeedle;
using EntityStates.GolemMonster;
using EntityStates.GrandParent;
using EntityStates.Heretic;
using EntityStates.Huntress;
using EntityStates.Loader;
using EntityStates.Mage.Weapon;
using EntityStates.Merc;
using EntityStates.ParentMonster;
using EntityStates.Toolbot;
using HG;
using HG.BlendableTypes;
using JetBrains.Annotations;
using KinematicCharacterController;
using MonoMod.RuntimeDetour;
using On.EntityStates;
using On.EntityStates.GlobalSkills.LunarDetonator;
using On.EntityStates.GlobalSkills.LunarNeedle;
using On.RoR2;
using On.RoR2.CharacterSpeech;
using On.RoR2.UI;
using PaladinMod;
using PaladinMod.Misc;
using PaladinMod.Modules;
using PaladinMod.States;
using PaladinMod.States.Emotes;
using PaladinMod.States.LunarKnight;
using PaladinMod.States.Nemesis;
using PaladinMod.States.Quickstep;
using PaladinMod.States.Rage;
using PaladinMod.States.Spell;
using PaladinMod.States.Sun;
using R2API;
using R2API.Utils;
using RoR2;
using RoR2.Achievements;
using RoR2.Audio;
using RoR2.CharacterSpeech;
using RoR2.ContentManagement;
using RoR2.Orbs;
using RoR2.Projectile;
using RoR2.Skills;
using RoR2.UI;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.Events;
using UnityEngine.Networking;
using UnityEngine.Rendering;
using UnityEngine.Rendering.PostProcessing;
using UnityEngine.SceneManagement;
using UnityEngine.UI;
using VRAPI;

[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("PaladinMod")]
[assembly: AssemblyProduct("PaladinMod")]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyInformationalVersion("1.0.0+0df1f8116a7b2212e752c37325d8460677004f67")]
[assembly: AssemblyTitle("PaladinMod")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
public class ComponentDisabler : MonoBehaviour
{
	[SerializeField]
	private Behaviour[] MoreComponentsToDisable;

	private void OnDisable()
	{
		for (int i = 0; i < MoreComponentsToDisable.Length; i++)
		{
			Behaviour val = MoreComponentsToDisable[i];
			val.enabled = false;
		}
	}
}
public class PaladinSunNetworkController : NetworkBehaviour
{
	private static int kRpcRpcPosition;

	[ClientRpc]
	public void RpcPosition(GameObject parentTransform)
	{
		//IL_0028: Unknown result type (might be due to invalid IL or missing references)
		((Component)this).transform.SetParent(parentTransform.transform);
		((Component)this).transform.localPosition = new Vector3(0f, 11f, 0f);
	}

	private void UNetVersion()
	{
	}

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

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

	static PaladinSunNetworkController()
	{
		//IL_0020: Unknown result type (might be due to invalid IL or missing references)
		//IL_002a: Expected O, but got Unknown
		kRpcRpcPosition = 1697175040;
		NetworkBehaviour.RegisterRpcDelegate(typeof(PaladinSunNetworkController), kRpcRpcPosition, new CmdDelegate(InvokeRpcRpcPosition));
		NetworkCRC.RegisterBehaviour("PaladinSunNetworkController", 0);
	}

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

	public override void OnDeserialize(NetworkReader reader, bool initialState)
	{
	}
}
[RequireComponent(typeof(TeamFilter))]
public class PaladinSunController : MonoBehaviour
{
	private TeamFilter teamFilter;

	private GameObject ownerObj;

	private CharacterBody ownerBody;

	public BuffDef buffDef;

	public GameObject buffApplyEffect;

	[SerializeField]
	public LoopSoundDef activeLoopDef;

	[SerializeField]
	public LoopSoundDef damageLoopDef;

	[SerializeField]
	public string stopSoundName;

	private float cycleInterval;

	private FixedTimeStamp previousCycle = FixedTimeStamp.negativeInfinity;

	private int cycleIndex;

	private List<HurtBox> cycleTargets = new List<HurtBox>();

	private BullseyeSearch bullseyeSearch = new BullseyeSearch();

	private bool isLocalPlayerDamaged;

	private bool crit;

	private void Awake()
	{
		teamFilter = ((Component)this).GetComponent<TeamFilter>();
	}

	private void Start()
	{
		ownerObj = (Object.op_Implicit((Object)(object)((Component)this).GetComponent<GenericOwnership>()) ? ((Component)this).GetComponent<GenericOwnership>().ownerObject : ((Component)this).GetComponent<ProjectileController>().owner);
		ownerBody = ownerObj.GetComponent<CharacterBody>();
		cycleInterval = 0.5f / ownerBody.attackSpeed;
		crit = ownerBody.RollCrit();
		if (Object.op_Implicit((Object)(object)activeLoopDef))
		{
			Util.PlaySound(activeLoopDef.startSoundName, ((Component)this).gameObject);
		}
	}

	private void OnDisable()
	{
		OnDestroy();
	}

	private void OnDestroy()
	{
		if (Object.op_Implicit((Object)(object)activeLoopDef))
		{
			Util.PlaySound(activeLoopDef.stopSoundName, ((Component)this).gameObject);
		}
		if (Object.op_Implicit((Object)(object)damageLoopDef))
		{
			Util.PlaySound(damageLoopDef.stopSoundName, ((Component)this).gameObject);
		}
		if (stopSoundName != null)
		{
			Util.PlaySound(stopSoundName, ((Component)this).gameObject);
		}
		AkSoundEngine.StopPlayingID(3203163036u);
	}

	private void FixedUpdate()
	{
		//IL_0091: Unknown result type (might be due to invalid IL or missing references)
		//IL_009b: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
		//IL_00be: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
		if (NetworkServer.active)
		{
			ServerFixedUpdate();
		}
		if (!Object.op_Implicit((Object)(object)damageLoopDef))
		{
			return;
		}
		bool flag = isLocalPlayerDamaged;
		isLocalPlayerDamaged = false;
		RaycastHit val2 = default(RaycastHit);
		foreach (HurtBox cycleTarget in cycleTargets)
		{
			CharacterBody val = null;
			if (Object.op_Implicit((Object)(object)cycleTarget) && Object.op_Implicit((Object)(object)cycleTarget.healthComponent))
			{
				val = cycleTarget.healthComponent.body;
			}
			if (Object.op_Implicit((Object)(object)val) && (val.bodyFlags & 0x200) != 0 && val.hasEffectiveAuthority)
			{
				Vector3 position = ((Component)this).transform.position;
				Vector3 corePosition = val.corePosition;
				if (!Physics.Linecast(position, corePosition, ref val2, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask), (QueryTriggerInteraction)1))
				{
					isLocalPlayerDamaged = true;
				}
			}
		}
		if (isLocalPlayerDamaged && !flag)
		{
			Util.PlaySound(damageLoopDef.startSoundName, ((Component)this).gameObject);
		}
		else if (!isLocalPlayerDamaged && flag)
		{
			Util.PlaySound(damageLoopDef.stopSoundName, ((Component)this).gameObject);
		}
	}

	private void ServerFixedUpdate()
	{
		//IL_0048: Unknown result type (might be due to invalid IL or missing references)
		//IL_004d: Unknown result type (might be due to invalid IL or missing references)
		//IL_03a6: Unknown result type (might be due to invalid IL or missing references)
		//IL_03ab: Unknown result type (might be due to invalid IL or missing references)
		//IL_00af: Unknown result type (might be due to invalid IL or missing references)
		//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
		//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
		//IL_0105: Unknown result type (might be due to invalid IL or missing references)
		//IL_010b: Invalid comparison between Unknown and I4
		//IL_0129: Unknown result type (might be due to invalid IL or missing references)
		//IL_012e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0132: Unknown result type (might be due to invalid IL or missing references)
		//IL_0133: Unknown result type (might be due to invalid IL or missing references)
		//IL_0135: Unknown result type (might be due to invalid IL or missing references)
		//IL_0136: Unknown result type (might be due to invalid IL or missing references)
		//IL_0140: Unknown result type (might be due to invalid IL or missing references)
		//IL_0141: Unknown result type (might be due to invalid IL or missing references)
		//IL_014a: Unknown result type (might be due to invalid IL or missing references)
		//IL_018c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0191: Unknown result type (might be due to invalid IL or missing references)
		//IL_0192: Unknown result type (might be due to invalid IL or missing references)
		//IL_019a: Unknown result type (might be due to invalid IL or missing references)
		//IL_019d: 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_01a7: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ac: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b1: Unknown result type (might be due to invalid IL or missing references)
		//IL_01c0: Expected O, but got Unknown
		//IL_01fc: Unknown result type (might be due to invalid IL or missing references)
		//IL_0205: Unknown result type (might be due to invalid IL or missing references)
		//IL_0331: Unknown result type (might be due to invalid IL or missing references)
		//IL_025a: Unknown result type (might be due to invalid IL or missing references)
		//IL_02b0: Unknown result type (might be due to invalid IL or missing references)
		//IL_02c0: Unknown result type (might be due to invalid IL or missing references)
		float num = Mathf.Clamp01(((FixedTimeStamp)(ref previousCycle)).timeSince / cycleInterval);
		int num2 = ((num == 1f) ? cycleTargets.Count : Mathf.FloorToInt((float)cycleTargets.Count * num));
		Vector3 position = ((Component)this).transform.position;
		Ray val2 = default(Ray);
		RaycastHit val3 = default(RaycastHit);
		while (cycleIndex < num2)
		{
			HurtBox val = cycleTargets[cycleIndex];
			if (Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)val.healthComponent))
			{
				CharacterBody body = val.healthComponent.body;
				if (Object.op_Implicit((Object)(object)ownerBody))
				{
					bool flag = body.teamComponent.teamIndex != ownerBody.teamComponent.teamIndex;
					bool flag2 = !flag && StaticValues.cruelSunAllyDamageMultiplier > 0f && body.GetBuffCount(Buffs.Overheat) < 2;
					bool flag3 = (body.bodyFlags & 0x200) == 0 || (int)body.teamComponent.teamIndex != 1;
					if ((flag || flag2) && flag3)
					{
						Vector3 corePosition = body.corePosition;
						((Ray)(ref val2))..ctor(position, corePosition - position);
						if (!Physics.Linecast(position, corePosition, ref val3, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask), (QueryTriggerInteraction)1))
						{
							body.AddTimedBuff(buffDef, 1f);
							if (Object.op_Implicit((Object)(object)buffApplyEffect))
							{
								EffectData val4 = new EffectData
								{
									origin = corePosition,
									rotation = Util.QuaternionSafeLookRotation(-((Ray)(ref val2)).direction),
									scale = body.bestFitRadius
								};
								val4.SetHurtBoxReference(val);
								EffectManager.SpawnEffect(buffApplyEffect, val4, true);
							}
							int buffCount = body.GetBuffCount(buffDef);
							if (buffCount >= 2)
							{
								InflictDotInfo val5 = default(InflictDotInfo);
								val5.dotIndex = (DotIndex)1;
								val5.attackerObject = ownerObj;
								val5.victimObject = ((Component)body).gameObject;
								if (Object.op_Implicit((Object)(object)ownerBody) && Object.op_Implicit((Object)(object)ownerBody.inventory))
								{
									TeamDef teamDef = TeamCatalog.GetTeamDef(ownerBody.teamComponent.teamIndex);
									float num3 = 1f;
									if (teamDef != null && teamDef.friendlyFireScaling > 0f)
									{
										num3 *= teamDef.friendlyFireScaling;
									}
									float num4 = ((!flag || !crit) ? 1 : 2);
									if ((body.teamComponent.teamIndex == ownerBody.teamComponent.teamIndex) & ((Object)(object)body != (Object)(object)ownerBody))
									{
										num3 *= StaticValues.cruelSunAllyDamageMultiplier;
									}
									val5.totalDamage = 1.6f * ownerBody.damage * (float)buffCount * num3 * num4;
									val5.damageMultiplier = 1f * num3;
									StrengthenBurnUtils.CheckDotForUpgrade(ownerBody.inventory, ref val5);
								}
								if (val5.totalDamage > 0f)
								{
									DotController.InflictDot(ref val5);
								}
							}
						}
					}
				}
			}
			cycleIndex++;
		}
		if (((FixedTimeStamp)(ref previousCycle)).timeSince >= cycleInterval)
		{
			previousCycle = FixedTimeStamp.now;
			cycleIndex = 0;
			cycleTargets.Clear();
			SearchForTargets(cycleTargets);
		}
	}

	private void SearchForTargets(List<HurtBox> dest)
	{
		//IL_000d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0012: Unknown result type (might be due to invalid IL or missing references)
		//IL_005c: Unknown result type (might be due to invalid IL or missing references)
		bullseyeSearch.searchOrigin = ((Component)this).transform.position;
		bullseyeSearch.minAngleFilter = 0f;
		bullseyeSearch.maxAngleFilter = 180f;
		bullseyeSearch.maxDistanceFilter = StaticValues.cruelSunAoE;
		bullseyeSearch.filterByDistinctEntity = true;
		bullseyeSearch.sortMode = (SortMode)1;
		bullseyeSearch.viewer = null;
		bullseyeSearch.RefreshCandidates();
		dest.AddRange(bullseyeSearch.GetResults());
	}
}
public class TestValueManager : MonoBehaviour
{
	public static float testValue = 1f;

	public static float testValue2 = 2f;

	private float tim;

	private float holdTime = 0.5f;

	private bool testingEnabled = true;

	internal static Vector3 testVector = new Vector3(-2.2f, -0.5f, -9f);

	private void Update()
	{
		if (testingEnabled && Input.GetKey((KeyCode)308))
		{
			manageTestValue(ref testValue, "tocombat", (KeyCode)263, (KeyCode)260, 0.1f);
			manageTestValue(ref testValue2, "tonotcombat", (KeyCode)264, (KeyCode)261, 0.1f);
		}
	}

	private void manageTestVector(ref Vector3 vector, string vectorName, float incrementAmount = 0.1f, KeyCode xUp = 263, KeyCode xDown = 260, KeyCode yUp = 264, KeyCode yDown = 261, KeyCode zUp = 265, KeyCode zDown = 262)
	{
		//IL_0013: Unknown result type (might be due to invalid IL or missing references)
		//IL_0015: 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)
		//IL_0032: Unknown result type (might be due to invalid IL or missing references)
		//IL_004d: Unknown result type (might be due to invalid IL or missing references)
		//IL_004f: Unknown result type (might be due to invalid IL or missing references)
		//IL_006a: Unknown result type (might be due to invalid IL or missing references)
		//IL_006c: Unknown result type (might be due to invalid IL or missing references)
		manageTestValue(ref vector.x, vectorName + "x", xUp, xDown, incrementAmount);
		manageTestValue(ref vector.x, vectorName + "x", xUp, xDown, incrementAmount);
		manageTestValue(ref vector.y, vectorName + "y", yUp, yDown, incrementAmount);
		manageTestValue(ref vector.z, vectorName + "z", zUp, zDown, incrementAmount);
	}

	private void manageTestValue(ref float value, string valueName, KeyCode upKey, KeyCode downKey, float incrementAmount)
	{
		//IL_0001: 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_0036: Unknown result type (might be due to invalid IL or missing references)
		//IL_003e: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
		//IL_004f: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
		if (Input.GetKeyDown(upKey))
		{
			value = setTestValue(value + incrementAmount, valueName);
		}
		if (Input.GetKeyDown(downKey))
		{
			value = setTestValue(value - incrementAmount, valueName);
		}
		if (Input.GetKey(upKey) || Input.GetKey(downKey))
		{
			float num = incrementAmount * (float)(Input.GetKey(upKey) ? 1 : (-1));
			tim += Time.deltaTime;
			if (tim > holdTime)
			{
				value = setTestValue(value + num, valueName);
				tim = holdTime - 0.05f;
			}
		}
		if (Input.GetKeyUp(upKey) || Input.GetKeyUp(downKey))
		{
			tim = 0f;
		}
	}

	private float setTestValue(float value, string print)
	{
		PaladinPlugin.logger.LogWarning((object)$"{print}: {value}");
		return value;
	}
}
internal class TronTrailSection
{
	public Vector3 point;

	public Vector3 upDir;

	public float time;

	public TronTrailSection()
	{
	}

	public TronTrailSection(Vector3 p, float t)
	{
		//IL_0009: Unknown result type (might be due to invalid IL or missing references)
		//IL_000a: Unknown result type (might be due to invalid IL or missing references)
		point = p;
		time = t;
	}
}
[RequireComponent(typeof(MeshFilter))]
[AddComponentMenu("PocketRPG/Weapon Trail")]
[RequireComponent(typeof(MeshRenderer))]
public class WeaponTrail : MonoBehaviour
{
	private WeaponTrail myTrail;

	private float t = 0.033f;

	private float tempT = 0f;

	private float animationIncrement = 0.003f;

	public float height = 1.4f;

	public float time = 0.15f;

	public bool alwaysUp = false;

	public float minDistance = 0f;

	public float timeTransitionSpeed = 1f;

	public float desiredTime = 0.15f;

	public Color startColor = Color.white;

	public Color endColor = new Color(1f, 1f, 1f, 0f);

	private Vector3 position;

	private float now = 0f;

	private TronTrailSection currentSection;

	private Matrix4x4 localSpaceTransform;

	private Mesh mesh;

	private Vector3[] vertices;

	private Color[] colors;

	private Vector2[] uv;

	private MeshRenderer meshRenderer;

	public Material trailMaterial;

	private List<TronTrailSection> sections = new List<TronTrailSection>();

	private void LateUpdate()
	{
		t = Mathf.Clamp(Time.deltaTime, 0f, 0.066f);
		if (!(t > 0f))
		{
			return;
		}
		while (tempT < t)
		{
			tempT += animationIncrement;
			if (myTrail.time > 0f)
			{
				myTrail.Itterate(Time.time - t + tempT);
			}
			else
			{
				myTrail.ClearTrail();
			}
		}
		tempT -= t;
		if (myTrail.time > 0f)
		{
			myTrail.UpdateTrail(Time.time, t);
		}
	}

	private void Awake()
	{
		//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
		//IL_00af: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
		myTrail = ((Component)this).GetComponent<WeaponTrail>();
		Component component = ((Component)this).GetComponent(typeof(MeshFilter));
		MeshFilter val = (MeshFilter)(object)((component is MeshFilter) ? component : null);
		mesh = val.mesh;
		ref MeshRenderer reference = ref meshRenderer;
		Component component2 = ((Component)this).GetComponent(typeof(MeshRenderer));
		reference = (MeshRenderer)(object)((component2 is MeshRenderer) ? component2 : null);
		trailMaterial = ((Renderer)meshRenderer).material;
		Transform val2 = ((Component)this).gameObject.transform.parent.Find("TrailStart");
		Transform val3 = ((Component)this).gameObject.transform.parent.Find("TrailEnd");
		if (Object.op_Implicit((Object)(object)val2) && Object.op_Implicit((Object)(object)val3))
		{
			height = Vector3.Distance(val2.position, val3.position);
			val2.LookAt(val3);
			val2.Rotate(new Vector3(90f, 0f, 0f));
		}
		else
		{
			((Behaviour)this).enabled = false;
		}
	}

	public void StartTrail(float timeToTweenTo, float fadeInTime)
	{
		desiredTime = timeToTweenTo;
		if (time != desiredTime)
		{
			timeTransitionSpeed = Mathf.Abs(desiredTime - time) / fadeInTime;
		}
		if (time <= 0f)
		{
			time = 0.01f;
		}
	}

	public void SetTime(float trailTime, float timeToTweenTo, float tweenSpeed)
	{
		time = trailTime;
		desiredTime = timeToTweenTo;
		timeTransitionSpeed = tweenSpeed;
		if (time <= 0f)
		{
			ClearTrail();
		}
	}

	public void FadeOut(float fadeTime)
	{
		desiredTime = 0f;
		if (time > 0f)
		{
			timeTransitionSpeed = time / fadeTime;
		}
	}

	public void SetTrailColor(Color color)
	{
		//IL_000c: Unknown result type (might be due to invalid IL or missing references)
		trailMaterial.SetColor("_TintColor", color);
	}

	public void Itterate(float itterateTime)
	{
		//IL_0008: Unknown result type (might be due to invalid IL or missing references)
		//IL_000d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0032: Unknown result type (might be due to invalid IL or missing references)
		//IL_0038: Unknown result type (might be due to invalid IL or missing references)
		//IL_003d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0042: Unknown result type (might be due to invalid IL or missing references)
		//IL_0069: Unknown result type (might be due to invalid IL or missing references)
		//IL_006e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0091: Unknown result type (might be due to invalid IL or missing references)
		//IL_0096: Unknown result type (might be due to invalid IL or missing references)
		//IL_009b: Unknown result type (might be due to invalid IL or missing references)
		//IL_007e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0083: Unknown result type (might be due to invalid IL or missing references)
		position = ((Component)this).transform.position;
		now = itterateTime;
		if (sections.Count != 0)
		{
			Vector3 val = sections[0].point - position;
			if (!(((Vector3)(ref val)).sqrMagnitude > minDistance * minDistance))
			{
				return;
			}
		}
		TronTrailSection tronTrailSection = new TronTrailSection();
		tronTrailSection.point = position;
		if (alwaysUp)
		{
			tronTrailSection.upDir = Vector3.up;
		}
		else
		{
			tronTrailSection.upDir = ((Component)this).transform.TransformDirection(Vector3.up);
		}
		tronTrailSection.time = now;
		sections.Insert(0, tronTrailSection);
	}

	public void UpdateTrail(float currentTime, float deltaTime)
	{
		//IL_00de: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
		//IL_0134: Unknown result type (might be due to invalid IL or missing references)
		//IL_0139: Unknown result type (might be due to invalid IL or missing references)
		//IL_0150: 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)
		//IL_015a: 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_017b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0183: Unknown result type (might be due to invalid IL or missing references)
		//IL_0188: Unknown result type (might be due to invalid IL or missing references)
		//IL_018d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0192: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a7: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ac: Unknown result type (might be due to invalid IL or missing references)
		//IL_01c3: Unknown result type (might be due to invalid IL or missing references)
		//IL_01c8: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ce: Unknown result type (might be due to invalid IL or missing references)
		//IL_01d4: Unknown result type (might be due to invalid IL or missing references)
		//IL_01db: Unknown result type (might be due to invalid IL or missing references)
		//IL_01e0: 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_01ed: Unknown result type (might be due to invalid IL or missing references)
		//IL_01fd: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ff: Unknown result type (might be due to invalid IL or missing references)
		mesh.Clear();
		while (sections.Count > 0 && currentTime > sections[sections.Count - 1].time + time)
		{
			sections.RemoveAt(sections.Count - 1);
		}
		if (sections.Count < 2)
		{
			return;
		}
		vertices = (Vector3[])(object)new Vector3[sections.Count * 2];
		colors = (Color[])(object)new Color[sections.Count * 2];
		uv = (Vector2[])(object)new Vector2[sections.Count * 2];
		currentSection = sections[0];
		localSpaceTransform = ((Component)this).transform.worldToLocalMatrix;
		for (int i = 0; i < sections.Count; i++)
		{
			currentSection = sections[i];
			float num = 0f;
			if (i != 0)
			{
				num = Mathf.Clamp01((currentTime - currentSection.time) / time);
			}
			Vector3 upDir = currentSection.upDir;
			vertices[i * 2] = ((Matrix4x4)(ref localSpaceTransform)).MultiplyPoint(currentSection.point);
			vertices[i * 2 + 1] = ((Matrix4x4)(ref localSpaceTransform)).MultiplyPoint(currentSection.point + upDir * height);
			uv[i * 2] = new Vector2(num, 0f);
			uv[i * 2 + 1] = new Vector2(num, 1f);
			Color val = Color.Lerp(startColor, endColor, num);
			colors[i * 2] = val;
			colors[i * 2 + 1] = val;
		}
		int[] array = new int[(sections.Count - 1) * 2 * 3];
		for (int j = 0; j < array.Length / 6; j++)
		{
			array[j * 6] = j * 2;
			array[j * 6 + 1] = j * 2 + 1;
			array[j * 6 + 2] = j * 2 + 2;
			array[j * 6 + 3] = j * 2 + 2;
			array[j * 6 + 4] = j * 2 + 1;
			array[j * 6 + 5] = j * 2 + 3;
		}
		mesh.vertices = vertices;
		mesh.colors = colors;
		mesh.uv = uv;
		mesh.triangles = array;
		if (time > desiredTime)
		{
			time -= deltaTime * timeTransitionSpeed;
			if (time <= desiredTime)
			{
				time = desiredTime;
			}
		}
		else if (time < desiredTime)
		{
			time += deltaTime * timeTransitionSpeed;
			if (time >= desiredTime)
			{
				time = desiredTime;
			}
		}
	}

	public void ClearTrail()
	{
		desiredTime = 0f;
		time = 0f;
		if ((Object)(object)mesh != (Object)null)
		{
			mesh.Clear();
			sections.Clear();
		}
	}
}
internal enum PaladinCameraParams
{
	DEFAULT,
	CHANNEL,
	CHANNEL_FULL,
	CRUEL_SUN,
	RAGE_ENTER,
	RAGE_ENTER_OUT,
	EMOTE
}
internal class SkillDefInfo
{
	public string skillName;

	public string skillNameToken;

	public string skillDescriptionToken;

	public Sprite skillIcon;

	public SerializableEntityStateType activationState;

	public string activationStateMachineName;

	public int baseMaxStock;

	public float baseRechargeInterval;

	public bool beginSkillCooldownOnSkillEnd;

	public bool canceledFromSprinting;

	public bool forceSprintDuringState;

	public bool fullRestockOnAssign;

	public InterruptPriority interruptPriority;

	public bool resetCooldownTimerOnUse;

	public bool isCombatSkill;

	public bool mustKeyPress;

	public bool cancelSprintingOnActivation;

	public int rechargeStock;

	public int requiredStock;

	public int stockToConsume;

	public string[] keywordTokens;
}
namespace PaladinMod
{
	[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.rob.Paladin", "Paladin", "2.0.0")]
	[NetworkCompatibility(/*Could not decode attribute arguments.*/)]
	public class PaladinPlugin : BaseUnityPlugin
	{
		public const string MODUID = "com.rob.Paladin";

		public static PaladinPlugin instance;

		public static ManualLogSource logger;

		public static GameObject characterPrefab;

		public GameObject doppelganger;

		public static Material commandoMat;

		public static readonly Color characterColor = new Color(0.7176f, 0.098039f, 0.098039f);

		public static SkillDef scepterHealDef;

		public static SkillDef scepterTorporDef;

		public static SkillDef scepterWarcryDef;

		public static SkillDef scepterCruelSunDef;

		public static SkillDef scepterCruelSunLegacyDef;

		public static bool aetheriumInstalled = false;

		public static bool sivsItemsInstalled = false;

		public static bool supplyDropInstalled = false;

		public static bool ancientScepterInstalled = false;

		public static bool starstormInstalled = false;

		public static bool VREnabled = false;

		public static bool autoSprintInstalled = false;

		public static uint claySkinIndex = 4u;

		public void Awake()
		{
			instance = this;
			logger = ((BaseUnityPlugin)this).Logger;
			Config.ReadConfig();
			Files.Init(((BaseUnityPlugin)this).Info);
			Languages.Init();
			Tokens.Init();
		}

		public void Start()
		{
			//IL_016a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0174: Expected O, but got Unknown
			((BaseUnityPlugin)this).Logger.LogInfo((object)"[Initializing Paladin]");
			Asset.PopulateAssets();
			CameraParams.InitializeParams();
			aetheriumInstalled = Chainloader.PluginInfos.ContainsKey("com.KomradeSpectre.Aetherium");
			sivsItemsInstalled = Chainloader.PluginInfos.ContainsKey("com.Sivelos.SivsItems");
			supplyDropInstalled = Chainloader.PluginInfos.ContainsKey("com.K1454.SupplyDrop");
			starstormInstalled = Chainloader.PluginInfos.ContainsKey("com.TeamMoonstorm.Starstorm2");
			autoSprintInstalled = Chainloader.PluginInfos.ContainsKey("com.johnedwa.RTAutoSprintEx");
			if (Chainloader.PluginInfos.ContainsKey("com.DrBibop.VRAPI"))
			{
				VRCompat.SetupVR();
			}
			if (Chainloader.PluginInfos.ContainsKey("com.weliveinasociety.CustomEmotesAPI"))
			{
				MemeCompat.Init();
			}
			Unlockables.RegisterUnlockables();
			PaladinMod.Modules.States.RegisterStates();
			Prefabs.CreatePrefabs();
			characterPrefab = Prefabs.paladinPrefab;
			ItemDisplays.InitializeItemDisplays();
			Skills.SetupSkills(Prefabs.paladinPrefab);
			Skills.SetupSkills(Prefabs.lunarKnightPrefab);
			Survivors.RegisterSurvivors();
			Buffs.RegisterBuffs();
			Projectiles.RegisterProjectiles();
			Skins.RegisterSkins();
			Effects.RegisterEffects();
			CreateDoppelganger();
			if (Chainloader.PluginInfos.ContainsKey("com.DestroyedClone.AncientScepter"))
			{
				ancientScepterInstalled = true;
				ScepterSkillSetup();
				ScepterSetup();
			}
			new ContentPacks().Initialize();
			Hook();
			ContentManager.onContentPacksAssigned += LateSetup;
			EntityStateCatalog.Init += new hook_Init(EntityStateCatalog_Init);
			((BaseUnityPlugin)this).Logger.LogInfo((object)"[Initialized]");
		}

		private void LateSetup(ReadOnlyArray<ReadOnlyContentPack> obj)
		{
			Projectiles.LateSetup();
			ItemDisplays.SetItemDisplays();
		}

		private IEnumerator EntityStateCatalog_Init(orig_Init orig)
		{
			yield return orig.Invoke();
			ChildLocator childLocator = Prefabs.paladinPrefab.GetComponentInChildren<ChildLocator>();
			ReplaceVFXMaterials(childLocator);
		}

		public static void ReplaceVFXMaterials(ChildLocator childLocator)
		{
			Material material = Object.Instantiate<Material>(((Renderer)((Component)ChargeLaser.effectPrefab.transform.Find("Particles").Find("Glow")).GetComponent<ParticleSystemRenderer>()).material);
			((Renderer)((Component)childLocator.FindChild("HealChannelEffect").Find("Orbs").Find("MagicCircle")).GetComponent<ParticleSystemRenderer>()).material = material;
			((Renderer)((Component)childLocator.FindChild("HealChannelEffect").Find("Orbs").Find("MagicCircle")
				.Find("BigCircle")).GetComponent<ParticleSystemRenderer>()).material = material;
			((Renderer)((Component)childLocator.FindChild("HealChannelEffect").Find("Orbs").Find("MagicCircle")
				.Find("MagicCircle2")).GetComponent<ParticleSystemRenderer>()).material = material;
			((Renderer)((Component)childLocator.FindChild("HealChannelEffect").Find("Orbs").Find("MagicCircle")
				.Find("MagicCircle2")
				.Find("BigCircle2")).GetComponent<ParticleSystemRenderer>()).material = material;
			((Renderer)((Component)childLocator.FindChild("ScepterHealChannelEffect").Find("Orbs").Find("MagicCircle")).GetComponent<ParticleSystemRenderer>()).material = material;
			((Renderer)((Component)childLocator.FindChild("ScepterHealChannelEffect").Find("Orbs").Find("MagicCircle")
				.Find("BigCircle")).GetComponent<ParticleSystemRenderer>()).material = material;
			((Renderer)((Component)childLocator.FindChild("ScepterHealChannelEffect").Find("Orbs").Find("MagicCircle")
				.Find("MagicCircle2")).GetComponent<ParticleSystemRenderer>()).material = material;
			((Renderer)((Component)childLocator.FindChild("ScepterHealChannelEffect").Find("Orbs").Find("MagicCircle")
				.Find("MagicCircle2")
				.Find("BigCircle2")).GetComponent<ParticleSystemRenderer>()).material = material;
			((Renderer)((Component)childLocator.FindChild("TorporChannelEffect").Find("Lightning").Find("MagicCircle")).GetComponent<ParticleSystemRenderer>()).material = material;
			((Renderer)((Component)childLocator.FindChild("TorporChannelEffect").Find("Lightning").Find("BigCircle")).GetComponent<ParticleSystemRenderer>()).material = material;
			((Renderer)((Component)childLocator.FindChild("TorporChannelEffect").Find("Lightning").Find("MagicCircle2")).GetComponent<ParticleSystemRenderer>()).material = material;
			((Renderer)((Component)childLocator.FindChild("TorporChannelEffect").Find("Lightning").Find("MagicCircle2")
				.Find("BigCircle2")).GetComponent<ParticleSystemRenderer>()).material = material;
			((Renderer)((Component)childLocator.FindChild("ScepterTorporChannelEffect").Find("Orbs").Find("MagicCircle")).GetComponent<ParticleSystemRenderer>()).material = material;
			((Renderer)((Component)childLocator.FindChild("ScepterTorporChannelEffect").Find("Orbs").Find("MagicCircle")
				.Find("BigCircle")).GetComponent<ParticleSystemRenderer>()).material = material;
			((Renderer)((Component)childLocator.FindChild("ScepterTorporChannelEffect").Find("Orbs").Find("MagicCircle")
				.Find("MagicCircle2")).GetComponent<ParticleSystemRenderer>()).material = material;
			((Renderer)((Component)childLocator.FindChild("ScepterTorporChannelEffect").Find("Orbs").Find("MagicCircle")
				.Find("MagicCircle2")
				.Find("BigCircle2")).GetComponent<ParticleSystemRenderer>()).material = material;
			((Renderer)((Component)childLocator.FindChild("WarcryChannelEffect").Find("Orbs").Find("MagicCircle")).GetComponent<ParticleSystemRenderer>()).material = material;
			((Renderer)((Component)childLocator.FindChild("WarcryChannelEffect").Find("Orbs").Find("MagicCircle")
				.Find("BigCircle")).GetComponent<ParticleSystemRenderer>()).material = material;
			((Renderer)((Component)childLocator.FindChild("WarcryChannelEffect").Find("Orbs").Find("MagicCircle")
				.Find("MagicCircle2")).GetComponent<ParticleSystemRenderer>()).material = material;
			((Renderer)((Component)childLocator.FindChild("WarcryChannelEffect").Find("Orbs").Find("MagicCircle")
				.Find("MagicCircle2")
				.Find("BigCircle2")).GetComponent<ParticleSystemRenderer>()).material = material;
			((Renderer)((Component)childLocator.FindChild("ScepterWarcryChannelEffect").Find("Orbs").Find("MagicCircle")).GetComponent<ParticleSystemRenderer>()).material = material;
			((Renderer)((Component)childLocator.FindChild("ScepterWarcryChannelEffect").Find("Orbs").Find("MagicCircle")
				.Find("BigCircle")).GetComponent<ParticleSystemRenderer>()).material = material;
			((Renderer)((Component)childLocator.FindChild("ScepterWarcryChannelEffect").Find("Orbs").Find("MagicCircle")
				.Find("MagicCircle2")).GetComponent<ParticleSystemRenderer>()).material = material;
			((Renderer)((Component)childLocator.FindChild("ScepterWarcryChannelEffect").Find("Orbs").Find("MagicCircle")
				.Find("MagicCircle2")
				.Find("BigCircle2")).GetComponent<ParticleSystemRenderer>()).material = material;
			if (!VREnabled)
			{
				((Renderer)((Component)childLocator.FindChild("SpawnEffect").Find("MagicCircle").Find("BigCircle")).GetComponent<ParticleSystemRenderer>()).material = material;
				((Renderer)((Component)childLocator.FindChild("SpawnEffect").Find("MagicCircle").Find("BigCircle")
					.Find("BigCircle2")).GetComponent<ParticleSystemRenderer>()).material = material;
			}
		}

		[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
		private void ScepterSetup()
		{
			ItemBase<AncientScepterItem>.instance.RegisterScepterSkill(scepterHealDef, "RobPaladinBody", (SkillSlot)3, 0);
			ItemBase<AncientScepterItem>.instance.RegisterScepterSkill(scepterTorporDef, "RobPaladinBody", (SkillSlot)3, 1);
			ItemBase<AncientScepterItem>.instance.RegisterScepterSkill(scepterWarcryDef, "RobPaladinBody", (SkillSlot)3, 2);
			ItemBase<AncientScepterItem>.instance.RegisterScepterSkill(scepterCruelSunDef, "RobPaladinBody", (SkillSlot)3, 3);
			if (Config.legacyCruelSun.Value)
			{
				ItemBase<AncientScepterItem>.instance.RegisterScepterSkill(scepterCruelSunLegacyDef, "RobPaladinBody", (SkillSlot)3, 4);
			}
		}

		private void Hook()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Expected O, but got Unknown
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Expected O, but got Unknown
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Expected O, but got Unknown
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Expected O, but got Unknown
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Expected O, but got Unknown
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Expected O, but got Unknown
			//IL_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_007e: Expected O, but got Unknown
			//IL_0086: Unknown result type (might be due to invalid IL or missing references)
			//IL_0090: Expected O, but got Unknown
			//IL_0098: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a2: Expected O, but got Unknown
			//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b4: Expected O, but got Unknown
			//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c6: Expected O, but got Unknown
			CharacterBody.RecalculateStats += new hook_RecalculateStats(CharacterBody_RecalculateStats);
			CharacterModel.UpdateOverlays += new hook_UpdateOverlays(CharacterModel_UpdateOverlays);
			CharacterMaster.OnInventoryChanged += new hook_OnInventoryChanged(CharacterMaster_OnInventoryChanged);
			GlobalEventManager.OnHitEnemy += new hook_OnHitEnemy(GlobalEventManager_OnHitEnemy);
			FireLunarNeedle.OnEnter += new hook_OnEnter(PlayVisionsAnimation);
			ChargeLunarSecondary.PlayChargeAnimation += new hook_PlayChargeAnimation(PlayChargeLunarAnimation);
			ThrowLunarSecondary.PlayThrowAnimation += new hook_PlayThrowAnimation(PlayThrowLunarAnimation);
			Detonate.OnEnter += new hook_OnEnter(PlayRuinAnimation);
			BrotherSpeechDriver.DoInitialSightResponse += new hook_DoInitialSightResponse(BrotherSpeechDriver_DoInitialSightResponse);
			FalseSonBossSpeechDriver.DoInitialSightResponse += new hook_DoInitialSightResponse(FalseSonBossSpeechDriver_DoInitialSightResponse);
			BrotherSpeechDriver.OnBodyKill += new hook_OnBodyKill(BrotherSpeechDriver_OnBodyKill);
		}

		private void GlobalEventManager_OnHitEnemy(orig_OnHitEnemy orig, GlobalEventManager self, DamageInfo damageInfo, GameObject victim)
		{
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Expected O, but got Unknown
			//IL_0087: Unknown result type (might be due to invalid IL or missing references)
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0112: Unknown result type (might be due to invalid IL or missing references)
			//IL_011a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0135: Unknown result type (might be due to invalid IL or missing references)
			orig.Invoke(self, damageInfo, victim);
			if (!Object.op_Implicit((Object)(object)damageInfo.attacker) || !(damageInfo.procCoefficient >= 1f))
			{
				return;
			}
			CharacterBody component = damageInfo.attacker.GetComponent<CharacterBody>();
			if (Object.op_Implicit((Object)(object)component) && component.HasBuff(Buffs.overchargeBuff))
			{
				float num = 0.75f;
				float damageValue = Util.OnHitProcDamage(damageInfo.damage, component.damage, num);
				LightningOrb val = new LightningOrb();
				((Orb)val).origin = damageInfo.position;
				val.damageValue = damageValue;
				val.isCrit = damageInfo.crit;
				val.bouncesRemaining = 3;
				val.teamIndex = component.teamComponent.teamIndex;
				val.attacker = damageInfo.attacker;
				val.bouncedObjects = new List<HealthComponent> { victim.GetComponent<HealthComponent>() };
				val.procChainMask = damageInfo.procChainMask;
				((ProcChainMask)(ref val.procChainMask)).AddProc((ProcType)3);
				val.procCoefficient = 0f;
				val.lightningType = (LightningType)5;
				val.damageColorIndex = (DamageColorIndex)0;
				val.range += 6f;
				HurtBox val2 = val.PickNextTarget(damageInfo.position);
				if (Object.op_Implicit((Object)(object)val2))
				{
					((Orb)val).target = val2;
					OrbManager.instance.AddOrb((Orb)(object)val);
				}
			}
		}

		private void HealthComponent_TakeDamage(orig_TakeDamage orig, HealthComponent self, DamageInfo damageInfo)
		{
			//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: 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)
			bool flag = false;
			if (Object.op_Implicit((Object)(object)self) && Object.op_Implicit((Object)(object)damageInfo.attacker))
			{
				CharacterBody component = damageInfo.attacker.GetComponent<CharacterBody>();
				if (Object.op_Implicit((Object)(object)component) && component.baseNameToken == "NEMPALADIN_NAME" && ((Enum)damageInfo.damageType.damageType).HasFlag((Enum)(object)(DamageType)1048576))
				{
					damageInfo.damageType = DamageTypeCombo.op_Implicit((DamageType)0);
					flag = true;
				}
			}
			orig.Invoke(self, damageInfo);
			if (flag && !damageInfo.rejected)
			{
				damageInfo.attacker.GetComponent<HealthComponent>().Heal(damageInfo.damage * 0.2f, default(ProcChainMask), true);
			}
		}

		private void BrotherSpeechDriver_OnBodyKill(orig_OnBodyKill orig, BrotherSpeechDriver self, DamageReport damageReport)
		{
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			//IL_0080: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c8: 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_0107: Unknown result type (might be due to invalid IL or missing references)
			if (Object.op_Implicit((Object)(object)damageReport.victimBody) && damageReport.victimBodyIndex == BodyCatalog.FindBodyIndex(Prefabs.paladinPrefab))
			{
				SpeechInfo[] array = (SpeechInfo[])(object)new SpeechInfo[3]
				{
					new SpeechInfo
					{
						duration = 1f,
						maxWait = 4f,
						mustPlay = true,
						priority = 0f,
						token = "BROTHER_KILL_PALADIN_1"
					},
					new SpeechInfo
					{
						duration = 1f,
						maxWait = 4f,
						mustPlay = true,
						priority = 0f,
						token = "BROTHER_KILL_PALADIN_2"
					},
					new SpeechInfo
					{
						duration = 1f,
						maxWait = 4f,
						mustPlay = true,
						priority = 0f,
						token = "BROTHER_KILL_PALADIN_3"
					}
				};
				self.SendReponseFromPool(array);
			}
			orig.Invoke(self, damageReport);
		}

		private void BrotherSpeechDriver_DoInitialSightResponse(orig_DoInitialSightResponse orig, BrotherSpeechDriver self)
		{
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_0092: 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_009d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00db: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0124: Unknown result type (might be due to invalid IL or missing references)
			//IL_0126: Unknown result type (might be due to invalid IL or missing references)
			bool flag = false;
			ReadOnlyCollection<CharacterBody> readOnlyInstancesList = CharacterBody.readOnlyInstancesList;
			for (int i = 0; i < readOnlyInstancesList.Count; i++)
			{
				BodyIndex bodyIndex = readOnlyInstancesList[i].bodyIndex;
				flag |= bodyIndex == BodyCatalog.FindBodyIndex(Prefabs.paladinPrefab);
			}
			if (flag)
			{
				SpeechInfo[] array = (SpeechInfo[])(object)new SpeechInfo[3]
				{
					new SpeechInfo
					{
						duration = 1f,
						maxWait = 4f,
						mustPlay = true,
						priority = 0f,
						token = "BROTHER_SEE_PALADIN_1"
					},
					new SpeechInfo
					{
						duration = 1f,
						maxWait = 4f,
						mustPlay = true,
						priority = 0f,
						token = "BROTHER_SEE_PALADIN_2"
					},
					new SpeechInfo
					{
						duration = 1f,
						maxWait = 4f,
						mustPlay = true,
						priority = 0f,
						token = "BROTHER_SEE_PALADIN_3"
					}
				};
				self.SendReponseFromPool(array);
			}
			orig.Invoke(self);
		}

		private void FalseSonBossSpeechDriver_DoInitialSightResponse(orig_DoInitialSightResponse orig, FalseSonBossSpeechDriver self)
		{
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_0092: 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_009d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00db: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0124: Unknown result type (might be due to invalid IL or missing references)
			//IL_0126: Unknown result type (might be due to invalid IL or missing references)
			bool flag = false;
			ReadOnlyCollection<CharacterBody> readOnlyInstancesList = CharacterBody.readOnlyInstancesList;
			for (int i = 0; i < readOnlyInstancesList.Count; i++)
			{
				BodyIndex bodyIndex = readOnlyInstancesList[i].bodyIndex;
				flag |= bodyIndex == BodyCatalog.FindBodyIndex(Prefabs.paladinPrefab);
			}
			if (flag)
			{
				SpeechInfo[] array = (SpeechInfo[])(object)new SpeechInfo[3]
				{
					new SpeechInfo
					{
						duration = 1f,
						maxWait = 4f,
						mustPlay = true,
						priority = 0f,
						token = "FALSESON_SEE_PALADIN_1"
					},
					new SpeechInfo
					{
						duration = 1f,
						maxWait = 4f,
						mustPlay = true,
						priority = 0f,
						token = "FALSESON_SEE_PALADIN_2"
					},
					new SpeechInfo
					{
						duration = 1f,
						maxWait = 4f,
						mustPlay = true,
						priority = 0f,
						token = "FALSESON_SEE_PALADIN_3"
					}
				};
				self.SendReponseFromPool(array);
			}
			orig.Invoke(self);
		}

		private void PlayVisionsAnimation(orig_OnEnter orig, FireLunarNeedle self)
		{
			orig.Invoke(self);
			if (((EntityState)self).characterBody.baseNameToken == "PALADIN_NAME")
			{
				((EntityState)self).PlayAnimation("Gesture, Override", "FireVisions", "Visions.playbackRate", self.duration * 2.5f, 0f);
			}
		}

		private void PlayChargeLunarAnimation(orig_PlayChargeAnimation orig, ChargeLunarSecondary self)
		{
			if (((EntityState)self).characterBody.baseNameToken == "PALADIN_NAME")
			{
				((EntityState)self).PlayCrossfade("Gesture, Override", "ChargeLunarSecondary", "LunarSecondary.playbackRate", ((BaseChargeBombState)self).duration * 0.5f, 0.05f);
			}
			else
			{
				orig.Invoke(self);
			}
		}

		private void PlayThrowLunarAnimation(orig_PlayThrowAnimation orig, ThrowLunarSecondary self)
		{
			if (((EntityState)self).characterBody.baseNameToken == "PALADIN_NAME")
			{
				((EntityState)self).PlayAnimation("Gesture, Override", "ThrowLunarSecondary", "LunarSecondary.playbackRate", ((BaseThrowBombState)self).duration, 0f);
			}
			else
			{
				orig.Invoke(self);
			}
		}

		private void PlayRuinAnimation(orig_OnEnter orig, Detonate self)
		{
			orig.Invoke(self);
			if (((EntityState)self).characterBody.baseNameToken == "PALADIN_NAME")
			{
				((EntityState)self).PlayCrossfade("Gesture, Override", "CastRuin", "Ruin.playbackRate", self.duration * 0.5f, 0.05f);
				Util.PlaySound("PaladinFingerSnap", ((EntityState)self).gameObject);
				((BaseState)self).StartAimMode(self.duration + 0.5f, false);
				EffectManager.SimpleMuzzleFlash(LegacyResourcesAPI.Load<GameObject>("Prefabs/Effects/MuzzleFlashes/MuzzleflashLunarNeedle"), ((EntityState)self).gameObject, "HandL", false);
			}
		}

		private void RecalculateStatsAPI_GetStatCoefficients(CharacterBody sender, StatHookEventArgs args)
		{
		}

		private void CharacterBody_RecalculateStats(orig_RecalculateStats orig, CharacterBody self)
		{
			orig.Invoke(self);
			if (!Object.op_Implicit((Object)(object)self))
			{
				return;
			}
			if (self.HasBuff(Buffs.blessedBuff))
			{
				self.regen += 3f + self.level * 0.6f;
				float num = 1f * self.level;
				self.armor += num;
			}
			if (self.HasBuff(Buffs.warcryBuff))
			{
				float num2 = 0.25f * self.damage;
				self.damage += num2;
				self.attackSpeed += 1f;
			}
			if (self.HasBuff(Buffs.scepterWarcryBuff))
			{
				float num3 = 0.5f * self.damage;
				self.damage += num3;
				self.attackSpeed += 2f;
			}
			if (self.HasBuff(Buffs.torporDebuff))
			{
				self.moveSpeed *= 0.39999998f;
				self.attackSpeed *= 0.39999998f;
			}
			if (self.HasBuff(Buffs.scepterTorporDebuff))
			{
				self.moveSpeed *= 0.19999999f;
				self.attackSpeed *= 0.19999999f;
			}
			if (self.HasBuff(Buffs.rageBuff))
			{
				self.armor += 100f;
				self.damage *= 1.5f;
				self.moveSpeed += 6f;
				PaladinRageController component = ((Component)self).GetComponent<PaladinRageController>();
				if (Object.op_Implicit((Object)(object)component))
				{
					float currentRegen = component.currentRegen;
					self.regen += currentRegen;
				}
			}
		}

		private void CharacterModel_UpdateOverlays(orig_UpdateOverlays orig, CharacterModel self)
		{
			//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
			orig.Invoke(self);
			if (!Object.op_Implicit((Object)(object)self))
			{
				return;
			}
			if (Object.op_Implicit((Object)(object)self.body) && self.body.HasBuff(Buffs.torporDebuff))
			{
				PaladinTorporTracker component = ((Component)self.body).GetComponent<PaladinTorporTracker>();
				if (Object.op_Implicit((Object)(object)component))
				{
					return;
				}
				component = ((Component)self.body).gameObject.AddComponent<PaladinTorporTracker>();
				component.Body = self.body;
				TemporaryOverlayInstance val = TemporaryOverlayManager.AddOverlay(((Component)self).gameObject);
				val.duration = float.PositiveInfinity;
				val.alphaCurve = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f);
				val.animateShaderAlpha = true;
				val.destroyComponentOnEnd = true;
				val.originalMaterial = Addressables.LoadAssetAsync<Material>((object)"RoR2/DLC1/EliteVoid/matEliteVoidOverlay.mat").WaitForCompletion();
				val.AddToCharacterModel(self);
				component.Overlay = val;
			}
			if (Object.op_Implicit((Object)(object)self.body) && self.body.HasBuff(Buffs.blessedBuff))
			{
				PaladinBlessingTracker component2 = ((Component)self.body).GetComponent<PaladinBlessingTracker>();
				if (Object.op_Implicit((Object)(object)component2))
				{
					return;
				}
				component2 = ((Component)self.body).gameObject.AddComponent<PaladinBlessingTracker>();
				component2.Body = self.body;
				TemporaryOverlayInstance val2 = TemporaryOverlayManager.AddOverlay(((Component)self).gameObject);
				val2.duration = float.PositiveInfinity;
				val2.alphaCurve = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f);
				val2.animateShaderAlpha = true;
				val2.destroyComponentOnEnd = true;
				val2.originalMaterial = Asset.blessingMat;
				val2.AddToCharacterModel(self);
				component2.Overlay = val2;
			}
			if (Object.op_Implicit((Object)(object)self.body) && self.body.HasBuff(Buffs.rageBuff))
			{
				PaladinRageTracker component3 = ((Component)self.body).GetComponent<PaladinRageTracker>();
				if (!Object.op_Implicit((Object)(object)component3))
				{
					component3 = ((Component)self.body).gameObject.AddComponent<PaladinRageTracker>();
					component3.Body = self.body;
					TemporaryOverlayInstance val3 = TemporaryOverlayManager.AddOverlay(((Component)self).gameObject);
					val3.duration = float.PositiveInfinity;
					val3.alphaCurve = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f);
					val3.animateShaderAlpha = true;
					val3.destroyComponentOnEnd = true;
					val3.originalMaterial = LegacyResourcesAPI.Load<Material>("Materials/matMercEvisTarget");
					val3.AddToCharacterModel(self);
					component3.Overlay = val3;
				}
			}
		}

		private void CharacterMaster_OnInventoryChanged(orig_OnInventoryChanged orig, CharacterMaster self)
		{
			orig.Invoke(self);
			if (self.hasBody && self.GetBody().baseNameToken == "PALADIN_NAME")
			{
				PaladinSwordController component = ((Component)self.GetBody()).GetComponent<PaladinSwordController>();
				if (Object.op_Implicit((Object)(object)component))
				{
					component.CheckInventory();
				}
			}
		}

		private void SceneDirector_Start(orig_Start orig, SceneDirector self)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_05a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_05d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_06c8: Unknown result type (might be due to invalid IL or missing references)
			Scene activeScene = SceneManager.GetActiveScene();
			if (((Scene)(ref activeScene)).name == "arena")
			{
				bool flag = false;
				for (int i = 0; i < CharacterMaster.readOnlyInstancesList.Count; i++)
				{
					if (CharacterMaster.readOnlyInstancesList[i].bodyPrefab.GetComponent<CharacterBody>().baseNameToken == "PALADIN_NAME" && CharacterMaster.readOnlyInstancesList[i].inventory.GetItemCount(Items.LunarTrinket) > 0)
					{
						flag = true;
						break;
					}
				}
				if (flag)
				{
					Object.Destroy((Object)(object)GameObject.Find("HOLDER: Nullifier Props").gameObject);
					Object.Destroy((Object)(object)GameObject.Find("HOLDER: Misc Props").gameObject);
					Object.Destroy((Object)(object)GameObject.Find("HOLDER: Terrain").gameObject);
					Object.Destroy((Object)(object)GameObject.Find("HOLDER: Ruins").gameObject);
					Object.Destroy((Object)(object)GameObject.Find("HOLDER: Small Trees").gameObject);
					Object.Destroy((Object)(object)GameObject.Find("HOLDER: Artifact Formula").gameObject);
					Object.Destroy((Object)(object)GameObject.Find("HOLDER: Rocks").gameObject);
					Object.Destroy((Object)(object)GameObject.Find("ArenaBoulderFix").gameObject);
					Object.Destroy((Object)(object)GameObject.Find("PortalArena").gameObject);
					((Component)GameObject.Find("ArenaMissionController").transform.Find("PPSick")).gameObject.SetActive(false);
					Object.Destroy((Object)(object)((Component)GameObject.Find("ArenaMissionController").transform.Find("NullSafeZone (1)")).gameObject);
					Object.Destroy((Object)(object)((Component)GameObject.Find("ArenaMissionController").transform.Find("NullSafeZone (2)")).gameObject);
					Object.Destroy((Object)(object)((Component)GameObject.Find("ArenaMissionController").transform.Find("NullSafeZone (3)")).gameObject);
					Object.Destroy((Object)(object)((Component)GameObject.Find("ArenaMissionController").transform.Find("NullSafeZone (4)")).gameObject);
					Object.Destroy((Object)(object)((Component)GameObject.Find("ArenaMissionController").transform.Find("NullSafeZone (5)")).gameObject);
					Object.Destroy((Object)(object)((Component)GameObject.Find("ArenaMissionController").transform.Find("NullSafeZone (6)")).gameObject);
					Object.Destroy((Object)(object)((Component)GameObject.Find("ArenaMissionController").transform.Find("NullSafeZone (7)")).gameObject);
					Object.Destroy((Object)(object)((Component)GameObject.Find("ArenaMissionController").transform.Find("NullSafeZone (8)")).gameObject);
					Object.Destroy((Object)(object)((Component)GameObject.Find("ArenaMissionController").transform.Find("NullSafeZone (9)")).gameObject);
					GameObject.Find("HOLDER: Ruins and Gameplay Zones").SetActive(true);
					((Component)GameObject.Find("HOLDER: Ruins and Gameplay Zones").transform.Find("ShrineCombat")).gameObject.SetActive(true);
					((Component)GameObject.Find("HOLDER: Ruins and Gameplay Zones").transform.Find("WPPlatform2")).gameObject.SetActive(true);
					((Component)GameObject.Find("HOLDER: Ruins and Gameplay Zones").transform.Find("WPPlatform2").Find("WPPlatform2Barrier")).gameObject.SetActive(true);
					((Component)GameObject.Find("HOLDER: Ruins and Gameplay Zones").transform.Find("WPPlatform2").Find("WPPlatform2Barrier (1)")).gameObject.SetActive(true);
					((Component)GameObject.Find("HOLDER: Ruins and Gameplay Zones").transform.Find("WPPlatform2").Find("WPPlatform2Barrier (2)")).gameObject.SetActive(true);
					((Component)GameObject.Find("HOLDER: Ruins and Gameplay Zones").transform.Find("WPPlatform2").Find("WPPlatform2Barrier (3)")).gameObject.SetActive(true);
					((Component)GameObject.Find("HOLDER: Ruins and Gameplay Zones").transform.Find("WPPlatform2").Find("WPPlatform2Barrier (4)")).gameObject.SetActive(true);
					((Component)GameObject.Find("HOLDER: Ruins and Gameplay Zones").transform.Find("WPPlatform2").Find("WPPlatform2Barrier (5)")).gameObject.SetActive(true);
					((Component)GameObject.Find("HOLDER: Ruins and Gameplay Zones").transform.Find("WPPlatform2").Find("WPPlatform2Barrier (6)")).gameObject.SetActive(true);
					((Component)GameObject.Find("HOLDER: Ruins and Gameplay Zones").transform.Find("WPPlatform2").Find("WPPlatform2Barrier (7)")).gameObject.SetActive(true);
					((Component)GameObject.Find("HOLDER: Ruins and Gameplay Zones").transform.Find("WPPlatform2").Find("ArenaBarrier").Find("ArenaBarrierCenter")).gameObject.SetActive(true);
					((Component)GameObject.Find("HOLDER: Ruins and Gameplay Zones").transform.Find("WPPlatform2").Find("ArenaBarrier (1)").Find("ArenaBarrierCenter")).gameObject.SetActive(true);
					((Component)GameObject.Find("HOLDER: Ruins and Gameplay Zones").transform.Find("WPPlatform2").Find("ArenaBarrier (2)").Find("ArenaBarrierCenter")).gameObject.SetActive(true);
					((Component)GameObject.Find("HOLDER: Ruins and Gameplay Zones").transform.Find("WPPlatform2").Find("ArenaBarrier (3)").Find("ArenaBarrierCenter")).gameObject.SetActive(true);
					GameObject.Find("HOLDER: Ruins and Gameplay Zones").transform.Find("ShrineCombat").localPosition = new Vector3(-84f, 112f, -6f);
					GameObject.Find("HOLDER: Ruins and Gameplay Zones").transform.Find("WPPlatform2").localPosition = new Vector3(-84f, 84f, -6f);
					((Component)GameObject.Find("HOLDER: Lighting, Effects, Wind, etc").transform.Find("ArenaSkybox").Find("CameraRelative").Find("Dust")).gameObject.SetActive(false);
					((Component)GameObject.Find("HOLDER: Lighting, Effects, Wind, etc").transform.Find("ArenaSkybox").Find("CameraRelative").Find("Weather (Locked Position/Rotation")
						.Find("Embers")).gameObject.SetActive(true);
					((Component)GameObject.Find("HOLDER: Lighting, Effects, Wind, etc").transform.Find("ArenaSkybox").Find("CameraRelative").Find("Weather (Locked Position/Rotation")
						.Find("GiantDust?")).gameObject.SetActive(true);
					SpawnPoint[] array = Object.FindObjectsOfType<SpawnPoint>();
					foreach (SpawnPoint val in array)
					{
						((Component)val).transform.position = new Vector3(-84f, 103f, 32f);
					}
					((Behaviour)GameObject.Find("ArenaMissionController").GetComponent<ArenaMissionController>()).enabled = false;
				}
			}
			orig.Invoke(self);
		}

		internal static void HUDAwake(orig_Awake orig, HUD self)
		{
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0079: Unknown result type (might be due to invalid IL or missing references)
			//IL_007e: 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)
			orig.Invoke(self);
			RageHUD rageHUD = ((Component)self).gameObject.AddComponent<RageHUD>();
			GameObject val = Object.Instantiate<GameObject>(Asset.mainAssetBundle.LoadAsset<GameObject>("RageGauge"), ((Component)self).transform.Find("MainContainer").Find("MainUIArea").Find("SpringCanvas")
				.Find("BottomLeftCluster"));
			((Transform)val.GetComponent<RectTransform>()).localPosition = Vector3.zero;
			val.GetComponent<RectTransform>().anchoredPosition = Vector2.op_Implicit(new Vector3(0f, -147.8f));
			((Transform)val.GetComponent<RectTransform>()).localScale = new Vector3(0.72f, 0.15f, 1f);
			rageHUD.rageGauge = val;
			rageHUD.rageFill = ((Component)val.transform.Find("GaugeFill")).gameObject.GetComponent<Image>();
		}

		private void CreateDoppelganger()
		{
			doppelganger = PrefabAPI.InstantiateClone(LegacyResourcesAPI.Load<GameObject>("Prefabs/CharacterMasters/MercMonsterMaster"), "PaladinMonsterMaster");
			doppelganger.GetComponent<CharacterMaster>().bodyPrefab = Prefabs.paladinPrefab;
			Prefabs.masterPrefabs.Add(doppelganger);
		}

		private void ScepterSkillSetup()
		{
			//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_016b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0170: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_030e: Unknown result type (might be due to invalid IL or missing references)
			//IL_03c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_041f: Unknown result type (might be due to invalid IL or missing references)
			//IL_04ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_04f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0548: Unknown result type (might be due to invalid IL or missing references)
			PaladinMod.Modules.States.AddState(typeof(ScepterChannelHealZone));
			PaladinMod.Modules.States.AddState(typeof(ScepterCastHealZone));
			scepterHealDef = ScriptableObject.CreateInstance<SkillDef>();
			scepterHealDef.activationState = new SerializableEntityStateType(typeof(ScepterChannelHealZone));
			scepterHealDef.activationStateMachineName = "Weapon";
			scepterHealDef.baseMaxStock = 1;
			scepterHealDef.baseRechargeInterval = 18f;
			scepterHealDef.beginSkillCooldownOnSkillEnd = true;
			scepterHealDef.canceledFromSprinting = false;
			scepterHealDef.fullRestockOnAssign = true;
			scepterHealDef.interruptPriority = (InterruptPriority)1;
			scepterHealDef.resetCooldownTimerOnUse = false;
			scepterHealDef.isCombatSkill = false;
			scepterHealDef.mustKeyPress = false;
			scepterHealDef.cancelSprintingOnActivation = true;
			scepterHealDef.rechargeStock = 1;
			scepterHealDef.requiredStock = 1;
			scepterHealDef.stockToConsume = 1;
			scepterHealDef.icon = Asset.icon4S;
			scepterHealDef.skillDescriptionToken = "PALADIN_SPECIAL_SCEPTERHEALZONE_DESCRIPTION";
			scepterHealDef.skillName = "PALADIN_SPECIAL_SCEPTERHEALZONE_NAME";
			scepterHealDef.skillNameToken = "PALADIN_SPECIAL_SCEPTERHEALZONE_NAME";
			Skills.skillDefs.Add(scepterHealDef);
			PaladinMod.Modules.States.AddState(typeof(ScepterChannelTorpor));
			PaladinMod.Modules.States.AddState(typeof(ScepterCastTorpor));
			scepterTorporDef = ScriptableObject.CreateInstance<SkillDef>();
			scepterTorporDef.activationState = new SerializableEntityStateType(typeof(ScepterChannelTorpor));
			scepterTorporDef.activationStateMachineName = "Weapon";
			scepterTorporDef.baseMaxStock = 1;
			scepterTorporDef.baseRechargeInterval = 18f;
			scepterTorporDef.beginSkillCooldownOnSkillEnd = true;
			scepterTorporDef.canceledFromSprinting = true;
			scepterTorporDef.fullRestockOnAssign = true;
			scepterTorporDef.interruptPriority = (InterruptPriority)1;
			scepterTorporDef.resetCooldownTimerOnUse = false;
			scepterTorporDef.isCombatSkill = false;
			scepterTorporDef.mustKeyPress = false;
			scepterTorporDef.cancelSprintingOnActivation = true;
			scepterTorporDef.rechargeStock = 1;
			scepterTorporDef.requiredStock = 1;
			scepterTorporDef.stockToConsume = 1;
			scepterTorporDef.icon = Asset.icon4bS;
			scepterTorporDef.skillDescriptionToken = "PALADIN_SPECIAL_SCEPTERTORPOR_DESCRIPTION";
			scepterTorporDef.skillName = "PALADIN_SPECIAL_SCEPTERTORPOR_NAME";
			scepterTorporDef.skillNameToken = "PALADIN_SPECIAL_SCEPTERTORPOR_NAME";
			scepterTorporDef.keywordTokens = new string[1] { "KEYWORD_TORPOR" };
			Skills.skillDefs.Add(scepterTorporDef);
			PaladinMod.Modules.States.AddState(typeof(ScepterChannelWarcry));
			PaladinMod.Modules.States.AddState(typeof(ScepterCastWarcry));
			scepterWarcryDef = ScriptableObject.CreateInstance<SkillDef>();
			scepterWarcryDef.activationState = new SerializableEntityStateType(typeof(ScepterChannelWarcry));
			scepterWarcryDef.activationStateMachineName = "Weapon";
			scepterWarcryDef.baseMaxStock = 1;
			scepterWarcryDef.baseRechargeInterval = 18f;
			scepterWarcryDef.beginSkillCooldownOnSkillEnd = true;
			scepterWarcryDef.canceledFromSprinting = true;
			scepterWarcryDef.fullRestockOnAssign = true;
			scepterWarcryDef.interruptPriority = (InterruptPriority)1;
			scepterWarcryDef.resetCooldownTimerOnUse = false;
			scepterWarcryDef.isCombatSkill = false;
			scepterWarcryDef.mustKeyPress = false;
			scepterWarcryDef.cancelSprintingOnActivation = true;
			scepterWarcryDef.rechargeStock = 1;
			scepterWarcryDef.requiredStock = 1;
			scepterWarcryDef.stockToConsume = 1;
			scepterWarcryDef.icon = Asset.icon4cS;
			scepterWarcryDef.skillDescriptionToken = "PALADIN_SPECIAL_SCEPTERWARCRY_DESCRIPTION";
			scepterWarcryDef.skillName = "PALADIN_SPECIAL_SCEPTERWARCRY_NAME";
			scepterWarcryDef.skillNameToken = "PALADIN_SPECIAL_SCEPTERWARCRY_NAME";
			Skills.skillDefs.Add(scepterWarcryDef);
			scepterCruelSunDef = ScriptableObject.CreateInstance<SkillDef>();
			scepterCruelSunDef.activationState = new SerializableEntityStateType(typeof(ScepterChannelCruelSun));
			scepterCruelSunDef.activationStateMachineName = "Weapon";
			scepterCruelSunDef.baseMaxStock = 1;
			scepterCruelSunDef.baseRechargeInterval = 20f;
			scepterCruelSunDef.beginSkillCooldownOnSkillEnd = true;
			scepterCruelSunDef.canceledFromSprinting = true;
			scepterCruelSunDef.fullRestockOnAssign = true;
			scepterCruelSunDef.interruptPriority = (InterruptPriority)1;
			scepterCruelSunDef.resetCooldownTimerOnUse = false;
			scepterCruelSunDef.isCombatSkill = true;
			scepterCruelSunDef.mustKeyPress = true;
			scepterCruelSunDef.cancelSprintingOnActivation = true;
			scepterCruelSunDef.rechargeStock = 1;
			scepterCruelSunDef.requiredStock = 1;
			scepterCruelSunDef.stockToConsume = 1;
			scepterCruelSunDef.icon = Asset.icon4dS;
			scepterCruelSunDef.skillDescriptionToken = "PALADIN_SPECIAL_SCEPSUN_DESCRIPTION";
			scepterCruelSunDef.skillName = "PALADIN_SPECIAL_SCEPSUN_NAME";
			scepterCruelSunDef.skillNameToken = "PALADIN_SPECIAL_SCEPSUN_NAME";
			scepterCruelSunDef.keywordTokens = new string[1] { "KEYWORD_OVERHEAT" };
			Skills.skillDefs.Add(scepterCruelSunDef);
			scepterCruelSunLegacyDef = ScriptableObject.CreateInstance<SkillDef>();
			scepterCruelSunLegacyDef.activationState = new SerializableEntityStateType(typeof(ScepterChannelCruelSunOld));
			scepterCruelSunLegacyDef.activationStateMachineName = "Weapon";
			scepterCruelSunLegacyDef.baseMaxStock = 1;
			scepterCruelSunLegacyDef.baseRechargeInterval = 40f;
			scepterCruelSunLegacyDef.beginSkillCooldownOnSkillEnd = true;
			scepterCruelSunLegacyDef.canceledFromSprinting = false;
			scepterCruelSunLegacyDef.fullRestockOnAssign = true;
			scepterCruelSunLegacyDef.interruptPriority = (InterruptPriority)1;
			scepterCruelSunLegacyDef.resetCooldownTimerOnUse = false;
			scepterCruelSunLegacyDef.isCombatSkill = true;
			scepterCruelSunLegacyDef.mustKeyPress = true;
			scepterCruelSunLegacyDef.cancelSprintingOnActivation = true;
			scepterCruelSunLegacyDef.rechargeStock = 1;
			scepterCruelSunLegacyDef.requiredStock = 1;
			scepterCruelSunLegacyDef.stockToConsume = 1;
			scepterCruelSunLegacyDef.icon = Asset.icon4dS;
			scepterCruelSunLegacyDef.skillDescriptionToken = "PALADIN_SPECIAL_SCEPSUN_LEGACY_DESCRIPTION";
			scepterCruelSunLegacyDef.skillName = "PALADIN_SPECIAL_SCEPSUN_LEGACY_NAME";
			scepterCruelSunLegacyDef.skillNameToken = "PALADIN_SPECIAL_SCEPSUN_LEGACY_NAME";
			scepterCruelSunLegacyDef.keywordTokens = null;
			Skills.skillDefs.Add(scepterCruelSunLegacyDef);
		}

		public static bool IsLocalVRPlayer(CharacterBody body)
		{
			return VREnabled && (Object)(object)body == (Object)(object)LocalUserManager.GetFirstLocalUser().cachedBody;
		}
	}
	internal class StaticValues
	{
		public const string characterName = "Paladin";

		public const string characterSubtitle = "Acolyte of Providence";

		public const string characterOutro = "..and so he left, faith in his doctrine shaken.";

		public const string characterOutroFailure = "..and so he vanished, his prayers unheard.";

		public const string characterLore = "\"You will go to Petrichor V.  This planet has been selected for your pilgrimage, the punishment for the sins committed towards your people<s>, K        </s>.\"\n\nI stared ahead, stripped of my armor and my sword.  My crown, shattered.  My obsidian-stone carapace, damaged and torn.  A small, starry gemstone embedded in my right palm, a remnant of my past as king.  They keep me bound and push me towards a ship, end of the line, my sacrifice for the good of my brothers and sisters.\n\nI did it to save my people, even if they do not accept such niceties.  I would not fall into their habits of never-ending war and suffering.  I tried to change them for the betterment of themselves, but I learned the hard way that traditionalism is something that one alone cannot change.\n\nSo be it.  Perhaps my message will live on in the minds of those who tried to defend me.  Maybe my actions will mean something, maybe they will result in nothing.  I do not care for my own fate, I only hope that my people will learn from their pasts and improve themselves.\n\nFor the sake of my people, for the sake of our history, for the sake of longevity...\n\nTo the stars I go... to this planet of hushed rumors.";

		public const string oldLore = "\nAlpha.  Gaze ahead.  He stands tall.  Similar face.  Blade like the sky, but not violent.  Peaceful yet powerful.  Protector.  Bulwark.  <color=#97d362>Friend.</color>\n\nMe.  Frail.  Not worthy.  Yet he gave me opportunity.  Saw potential.  Imbued me with something.  Strength.  Power.  Understanding.   <color=#390b6d>M o n s t e r .</color>\n\nRight hand.  Protectors alongside.  Other monsters.  None resemble me, or the Alpha.  Weapons were bestowed.  Hammer.  Axe.  Sword.  And more.  There was one other, however.  They looked off.  Red cape.  Bird-like.  Enemy.  Enemy?  She was the 13th Guardian.  The Alpha did not trust her, but the Omega insisted.  The Omega.  Brother.  Uncomfortable.  I do not trust him at all.\n\nLoud.  A rumbling in the sky.  Massive flying metal beast.  A ship.  Off-world beings.  Landing violently.  They are similar in shape to some of us, yet different to others.  Mixture of flesh and machine.  Full flesh were some.  Full machine were few.\n\nThem.  Non-hostile, but confused.  The Alpha explains they are confused.  Acting out of instinct to survive.  Something is wrong when I look at the Alpha.  He looks like he’s guilty of something.  Did he cause the crash?  Why were they nearby the planet?\n\nA truth.  The Alpha had left his throne.  His blade trailed behind him.  We follow.  I ask about the ship.  He explains his doing.  It was influenced by the Omega.  Told to attack to protect us.  The Alpha looked saddened to have to hold his blade.  Told us to leave him and protect the others.\n\nDestruction.  All over.  The dead are many.  I cannot bring them back.  Why?  I have been able to heal.  Why can’t I.  Frustration.  Eight of the Protectors are dead.  Four remain.  One is missing.  I do not know where they are.  I am afraid, but I will stay strong.\n\nRunning.  The Alpha is aboard the remains of the vessel.  His new throne.  I want to be there.  We are his guardians, why would he go alone?  Was he told by the Omega?  Hatred.  The Omega is the cause of our faults.  He wants control.  Will not let him have.  Why did the Omega know so much?  Was it the Thirteenth?   <color=#390b6d>H e r e t i c .</color>\n\nA battle.  I failed.  I could not get to the Alpha in time.  The Orange one made it first, covered like a magnet of power.  Lightning flairs from him.  Strange devices stabbed into him.  He does not slow.  He moves faster than anything I’ve seen.  Devices in his hands sound like explosions.  They fire fast.  The Alpha falls.  The Worms were obliterated.  The ship was going to explode.  He is gone.  As if removed from his spot and taken to safety in a flash.  I rush in.  Protect the Alpha.  Heal him.  I have to.  I will.\n\nFallen.  The Alpha does not stir.  Power is useless.  Sword is shattered.  The ship is going to explode.  Countdown.  Final moments.  Why is this happening?  Why did this have to happen?  Was it planned?  Omega.  Omega.  His fault.  His fault.  Anger.  Rage.  Hate.   <color=#390b6d>R e v e n g e .</color>\n\nSilence.  Bubble.  A shield.  The Alpha is alive but barely.  The ship had detonated.  The Alpha saved me with the last of his power.  No words.  Nothing more after.  Kept me alive.  Why?  Could he not heal himself?  Was this him bestowing his last remnants to me?  No answers.  New goal.  I picked up the snapped blade of the Alpha.  I began scouring the remains of the ship and took his cloak.  I will not falter.  I will move on.  I will revive him through having his will act through me.  The Orange One and his cohorts of sinners are burned into my mind.  They shall fall by my hand too.\n\nI am his last.  His final message.  His wrath.  And yet, I feel guilty.  I feel wrong.  Is this what the Alpha would have wanted?  Or is this  <color=#390b6d>i n s t i n c t ?</color>  Must repress.  Hold back.  We are to not forget ourselves.  Continue with the mission.  The Omega must fall.  The Omega will fall.  The Moon is a harbinger of death and lies.\n\n\nI am coming for you, <color=#dc0000>Mithrix.</color>";

		public const float maxSwordGlow = 3f;

		public const float swordGlowSpeed = 8f;

		public const float baseDamage = 12f;

		public const float baseDamagePerLevel = 2.4f;

		public const float armorPerLevel = 1f;

		public const float regenAmount = 3f;

		public const float slashDamageCoefficient = 3f;

		public const float beamDamageCoefficient = 3f;

		public const float beamSpeed = 160f;

		public const float cursedBladeDamageCoefficient = 3.8f;

		public const float cursedBladeHealCoefficient = 0.05f;

		public const float spinSlashDamageCoefficient = 7.5f;

		public const float lightningSpearMinDamageCoefficient = 3f;

		public const float lightningSpearMaxDamageCoefficient = 7f;

		public const float lightningSpearChargeTime = 1.25f;

		public const float lunarShardDamageCoefficient = 0.75f;

		public const int lunarShardMaxStock = 12;

		public const float dashBarrierAmount = 0.15f;

		public const float healRadius = 16f;

		public const float healAmount = 0.15f;

		public const float healBarrier = 0.15f;

		public const float healZoneChannelDuration = 1.5f;

		public const float healZoneRadius = 16f;

		public const float healZoneAmount = 0.01f;

		public const float healZoneBarrier = 0.01f;

		public const float healZoneDuration = 12f;

		public const float scepterHealZoneChannelDuration = 1.5f;

		public const float scepterHealZoneRadius = 16f;

		public const float scepterHealZoneAmount = 0.02f;

		public const float scepterHealZoneBarrier = 0.02f;

		public const float scepterHealZoneDuration = 12f;

		public const float torporChannelDuration = 2f;

		public const float torporRadius = 24f;

		public const float torporSlowAmount = 0.6f;

		public const float torporDuration = 10f;

		public const float scepterTorporChannelDuration = 2f;

		public const float scepterTorporRadius = 32f;

		public const float scepterTorporSlowAmount = 0.8f;

		public const float scepterTorporDuration = 10f;

		public const float warcryChannelDuration = 2f;

		public const float warcryRadius = 20f;

		public const float warcryDamageMultiplier = 0.25f;

		public const float warcryAttackSpeedBuff = 1f;

		public const float warcryDuration = 8f;

		public const float scepterWarcryChannelDuration = 1f;

		public const float scepterWarcryRadius = 20f;

		public const float scepterWarcryDamageMultiplier = 0.5f;

		public const float scepterWarcryAttackSpeedBuff = 2f;

		public const float scepterWarcryDuration = 8f;

		public const float cruelSunChannelDurationOld = 5f;

		public const float cruelSunChannelDuration = 2f;

		public const float cruelSunDuration = 12.5f;

		public static float cruelSunVfxSize = 0.37f;

		public static float cruelSunVfxCenterSize = 9.5f;

		public static float cruelSunVfxLightIntensity = 0.225f;

		public static float cruelSunAoE = 70f;

		public const float cruelSunCycleInterval = 0.5f;

		public const float cruelSunOverheatDuration = 1f;

		public const int cruelSunMinimumStacksBeforeApplyingBurns = 2;

		public const int cruelSunMaximumAllyStacks = 2;

		public const float cruelSunBurnDamageCoefficient = 1.6f;

		public static float cruelSunAllyDamageMultiplier = 0.15f;

		public static float prideFlareExplosionRadius = cruelSunAoE;

		public static float prideFlareMaxIndicatorRange = cruelSunAoE * 2f;

		public const float prideFlareDamageCoefficient = 0.01f;

		public const float prideFlareProcCoefficient = 1f;

		public const float prideFlareForce = 400f;

		public const float prideFlareSelfForce = 10f;

		public static float prideFlareSpeed = cruelSunAoE * 0.4f;

		public const float prideFlareAimTimeMax = 3f;
	}
}
namespace PaladinMod.States
{
	public class AimTorpor : BaseAimSpellState
	{
		private GameObject chargeEffect;

		public override void OnEnter()
		{
			chargeEffectPrefab = null;
			chargeSoundString = "Play_mage_m2_charge";
			spellRadius = 24f;
			base.OnEnter();
		}

		public override void FixedUpdate()
		{
			base.FixedUpdate();
		}

		public override void OnExit()
		{
			base.OnExit();
		}

		protected override BaseCastSpellState GetNextState()
		{
			return new CastTorpor();
		}
	}
	public class AirSlam : BaseSkillState
	{
		public static float damageCoefficient = 7.5f;

		public static float leapDuration = 0.6f;

		public static float dropVelocity = 18f;

		private float duration;

		private bool hasFired;

		private bool hasLanded;

		private float hitPauseTimer;

		private OverlapAttack attack;

		private bool inHitPause;

		private float stopwatch;

		private Animator animator;

		private HitStopCachedState hitStopCachedState;

		private PaladinSwordController swordController;

		private float previousAirControl;

		private bool hasHit;

		public override void OnEnter()
		{
			//IL_008a: Unknown result type (might be due to invalid IL or missing references)
			//IL_008f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0093: Unknown result type (might be due to invalid IL or missing references)
			//IL_0098: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_01dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_01dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ef: 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_00db: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0108: Unknown result type (might be due to invalid IL or missing references)
			//IL_0113: Unknown result type (might be due to invalid IL or missing references)
			//IL_0118: Unknown result type (might be due to invalid IL or missing references)
			//IL_011a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0124: Unknown result type (might be due to invalid IL or missing references)
			//IL_012e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0133: Unknown result type (might be due to invalid IL or missing references)
			//IL_0135: Unknown result type (might be due to invalid IL or missing references)
			//IL_0140: Unknown result type (might be due to invalid IL or missing references)
			//IL_0146: Unknown result type (might be due to invalid IL or missing references)
			//IL_014b: Unknown result type (might be due to invalid IL or missing references)
			//IL_014f: 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_0164: Unknown result type (might be due to invalid IL or missing references)
			//IL_0182: Unknown result type (might be due to invalid IL or missing references)
			//IL_0184: Unknown result type (might be due to invalid IL or missing references)
			//IL_0186: Unknown result type (might be due to invalid IL or missing references)
			//IL_018b: Unknown result type (might be due to invalid IL or missing references)
			//IL_018d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0192: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d4: Expected O, but got Unknown
			//IL_028c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0296: Expected O, but got Unknown
			//IL_029e: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_031b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0320: Unknown result type (might be due to invalid IL or missing references)
			//IL_032a: Unknown result type (might be due to invalid IL or missing references)
			//IL_032f: Unknown result type (might be due to invalid IL or missing references)
			//IL_036c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0371: Unknown result type (might be due to invalid IL or missing references)
			//IL_0392: Unknown result type (might be due to invalid IL or missing references)
			//IL_0397: Unknown result type (might be due to invalid IL or missing references)
			((BaseState)this).OnEnter();
			duration = leapDuration / (0.75f + 0.25f * ((BaseState)this).attackSpeedStat);
			hasFired = false;
			hasLanded = false;
			animator = ((EntityState)this).GetModelAnimator();
			swordController = ((EntityState)this).GetComponent<PaladinSwordController>();
			((EntityState)this).characterMotor.jumpCount = ((EntityState)this).characterBody.maxJumpCount;
			previousAirControl = ((EntityState)this).characterMotor.airControl;
			((EntityState)this).characterMotor.airControl = BaseLeap.airControl;
			Ray aimRay = ((BaseState)this).GetAimRay();
			Vector3 val = ((Ray)(ref aimRay)).direction;
			if (PaladinPlugin.IsLocalVRPlayer(((EntityState)this).characterBody))
			{
				val = ((Component)Camera.main).transform.forward;
			}
			if (((EntityState)this).isAuthority)
			{
				((EntityState)this).characterBody.isSprinting = true;
				val.y = Mathf.Max(val.y, 1.25f * BaseLeap.minimumY);
				Vector3 val2 = ((Vector3)(ref val)).normalized * (0.75f * BaseLeap.aimVelocity) * ((BaseState)this).moveSpeedStat;
				Vector3 val3 = Vector3.up * 0.95f * BaseLeap.upwardVelocity;
				Vector3 val4 = new Vector3(val.x, 0f, val.z);
				Vector3 val5 = ((Vector3)(ref val4)).normalized * (1.5f * BaseLeap.forwardVelocity);
				((BaseCharacterController)((EntityState)this).characterMotor).Motor.ForceUnground(0.1f);
				((EntityState)this).characterMotor.velocity = val2 + val3 + val5;
				EffectManager.SpawnEffect(LegacyResourcesAPI.Load<GameObject>("Prefabs/Effects/BoostJumpEffect"), new EffectData
				{
					origin = ((EntityState)this).characterBody.footPosition,
					rotation = Util.QuaternionSafeLookRotation(((EntityState)this).characterMotor.velocity)
				}, true);
			}
			((EntityState)this).characterDirection.moveVector = val;
			CharacterBody characterBody = ((EntityState)this).characterBody;
			characterBody.bodyFlags = (BodyFlags)(characterBody.bodyFlags | 1);
			HitBoxGroup hitBoxGroup = null;
			Transform modelTransform = ((EntityState)this).GetModelTransform();
			string hitboxString = "LeapStrike";
			if (Object.op_Implicit((Object)(object)modelTransform))
			{
				hitBoxGroup = Array.Find(((Component)modelTransform).GetComponents<HitBoxGroup>(), (HitBoxGroup element) => element.groupName == hitboxString);
			}
			swordController.airSlamStacks = 1;
			((EntityState)this).PlayAnimation("FullBody, Override", "LeapSlam", "Whirlwind.playbackRate", duration * 1.5f, 0f);
			Util.PlaySound("PaladinLunge", ((EntityState)this).gameObject);
			Util.PlaySound("PaladinCloth2", ((EntityState)this).gameObject);
			float num = damageCoefficient;
			attack = new OverlapAttack();
			attack.damageType = DamageTypeCombo.op_Implicit((DamageType)32);
			attack.attacker = ((EntityState)this).gameObject;
			attack.inflictor = ((EntityState)this).gameObject;
			attack.teamIndex = ((BaseState)this).GetTeam();
			attack.damage = num * ((BaseState)this).damageStat;
			attack.procCoefficient = 1f;
			attack.hitEffectPrefab = swordController.hitEffect;
			attack.forceVector = -Vector3.up * 6000f;
			attack.pushAwayForce = 500f;
			attack.hitBoxGroup = hitBoxGroup;
			attack.isCrit = ((BaseState)this).RollCrit();
			attack.impactSound = Asset.swordHitSoundEventL.index;
			if (swordController.isBlunt)
			{
				attack.impactSound = Asset.batHitSoundEventL.index;
			}
		}

		public override void OnExit()
		{
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)this).OnExit();
			((EntityState)this).PlayAnimation("FullBody, Override", "BufferEmpty");
			CharacterBody characterBody = ((EntityState)this).characterBody;
			characterBody.bodyFlags = (BodyFlags)(characterBody.bodyFlags & -2);
			((EntityState)this).characterMotor.airControl = previousAirControl;
		}

		public void FireAttack()
		{
			//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00da: Unknown result type (might be due to invalid IL or missing references)
			//IL_008a: 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_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_0114: Unknown result type (might be due to invalid IL or missing references)
			//IL_0119: Unknown result type (might be due to invalid IL or missing references)
			if (!hasFired)
			{
				hasFired = true;
				swordController.PlaySwingSound();
				if (((EntityState)this).isAuthority)
				{
					((BaseState)this).AddRecoil(-1f * GroundSweep.attackRecoil, -2f * GroundSweep.attackRecoil, -0.5f * GroundSweep.attackRecoil, 0.5f * GroundSweep.attackRecoil);
					EffectManager.SimpleMuzzleFlash(swordController.swingEffect, ((EntityState)this).gameObject, "SwingDown", true);
					CharacterMotor characterMotor = ((EntityState)this).characterMotor;
					characterMotor.velocity *= 0.25f;
					CharacterMotor characterMotor2 = ((EntityState)this).characterMotor;
					characterMotor2.velocity += Vector3.up * (0f - dropVelocity);
				}
			}
			if (!((EntityState)this).isAuthority)
			{
				return;
			}
			Ray aimRay = ((BaseState)this).GetAimRay();
			if (!attack.Fire((List<HurtBox>)null))
			{
				return;
			}
			if (!inHitPause)
			{
				hitStopCachedState = ((BaseState)this).CreateHitStopCachedState(((EntityState)this).characterMotor, animator, "Whirlwind.playbackRate");
				hitPauseTimer = 4f * GroundLight.hitPauseDuration / ((BaseState)this).attackSpeedStat;
				inHitPause = true;
			}
			if (!hasHit)
			{
				hasHit = true;
				if (((EntityState)this).skillLocator.utility.skillDef.skillNameToken == "PALADIN_UTILITY_DASH_NAME")
				{
					((EntityState)this).skillLocator.utility.RunRecharge(1f);
				}
			}
		}

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			((BaseState)this).StartAimMode(0.5f, false);
			stopwatch += Time.deltaTime;
			if (stopwatch >= duration)
			{
				FireAttack();
				if (((EntityState)this).isAuthority && ((EntityState)this).inputBank.skill2.down && ((EntityState)this).skillLocator.secondary.stock > 0)
				{
					EntityState nextState = (EntityState)(object)new AirSlamAlt();
					((EntityState)this).outer.SetNextState(nextState);
					return;
				}
			}
			if (stopwatch >= duration && ((EntityState)this).isAuthority && ((EntityState)this).characterMotor.isGrounded)
			{
				GroundImpact();
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		private void FireShockwave()
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			Vector3 footPosition = ((EntityState)this).characterBody.footPosition;
			Vector3 forward = ((EntityState)this).characterDirection.forward;
			ProjectileManager.instance.FireProjectile(Projectiles.shockwave, footPosition, Util.QuaternionSafeLookRotation(forward), ((EntityState)this).gameObject, ((EntityState)this).characterBody.damage * 3f, WeaponSlam.waveProjectileForce, ((BaseState)this).RollCrit(), (DamageColorIndex)0, (GameObject)null, -1f);
		}

		private void GroundImpact()
		{
			//IL_0091: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_009d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d3: Expected O, but got Unknown
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_006b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Expected O, but got Unknown
			if (!hasLanded)
			{
				hasLanded = true;
				if (Object.op_Implicit((Object)(object)swordController) && swordController.swordActive)
				{
					FireShockwave();
					EffectManager.SpawnEffect(Asset.airSlamBoostedFX, new EffectData
					{
						origin = ((EntityState)this).characterBody.footPosition + ((EntityState)this).characterDirection.forward * 2.5f,
						scale = 1f
					}, true);
				}
				else
				{
					EffectManager.SpawnEffect(Asset.airSlamFX, new EffectData
					{
						origin = ((EntityState)this).characterBody.footPosition + ((EntityState)this).characterDirection.forward * 2.5f,
						scale = 1f
					}, true);
				}
				Util.PlaySound("PaladinGroundImpact", ((EntityState)this).gameObject);
				Util.PlaySound("PaladinLeapSlam", ((EntityState)this).gameObject);
			}
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return (InterruptPriority)2;
		}
	}
	public class AirSlamAlt : BaseSkillState
	{
		public static float damageCoefficient = 7.5f;

		public static float leapDuration = 0.5f;

		public static float dropVelocity = 30f;

		public static float hopVelocity = 15f;

		private float duration;

		private bool hasFired;

		private bool hasLanded;

		private float hitPauseTimer;

		private OverlapAttack attack;

		private bool inHitPause;

		private float stopwatch;

		private Animator animator;

		private HitStopCachedState hitStopCachedState;

		private PaladinSwordController swordController;

		private bool hasHit;

		public override void OnEnter()
		{
			//IL_0065: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: Unknown result type (might be due to invalid IL or missing references)
			//IL_006e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0073: Unknown result type (might be due to invalid IL or missing references)
			//IL_0090: Unknown result type (might be due to invalid IL or missing references)
			//IL_0095: 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_00ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0190: Unknown result type (might be due to invalid IL or missing references)
			//IL_019a: Expected O, but got Unknown
			//IL_01a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01da: 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_023d: Unknown result type (might be due to inv