Decompiled source of Destiny 2 All Subclasses and Aspects v0.4.0

plugins/GuardianPaths/GuardianPaths.dll

Decompiled 2 days ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Reflection.Emit;
using System.Runtime.CompilerServices;
using System.Security.Cryptography;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using ExitGames.Client.Photon;
using HarmonyLib;
using InControl;
using Photon.Pun;
using Photon.Realtime;
using TMPro;
using UnboundLib.Cards;
using UnboundLib.GameModes;
using UnityEngine;
using UnityEngine.Audio;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: AssemblyVersion("0.4.0.0")]
namespace GuardianPaths;

public sealed class AbilityFx : MonoBehaviour
{
	private static readonly Dictionary<string, float> recent = new Dictionary<string, float>();

	private LineRenderer[] rays;

	private Element element;

	private float age;

	private float scale;

	private float duration;

	public static Color Colour(Element e)
	{
		//IL_002f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0044: Unknown result type (might be due to invalid IL or missing references)
		//IL_0059: 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_0083: 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)
		return (Color)(e switch
		{
			Element.Solar => new Color(0.95f, 0.24f, 0.015f), 
			Element.Arc => new Color(0.025f, 0.5f, 0.95f), 
			Element.Void => new Color(0.28f, 0.055f, 0.7f), 
			Element.Stasis => new Color(0.04f, 0.14f, 0.8f), 
			Element.Strand => new Color(0.035f, 0.7f, 0.11f), 
			_ => new Color(0.7f, 0.85f, 1f), 
		});
	}

	public static void Emit(GameObject emitter, string cue, Vector3 position, Element e, float size)
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0084: Unknown result type (might be due to invalid IL or missing references)
		//IL_008a: Expected O, but got Unknown
		//IL_0090: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ef: Expected O, but got Unknown
		GuardianAudio.Play(emitter, cue, position, e);
		string key = (Object.op_Implicit((Object)(object)emitter) ? ((Object)emitter).GetInstanceID() : 0) + ":" + cue;
		if (!recent.TryGetValue(key, out var value) || !(Time.unscaledTime - value < 0.12f))
		{
			if (recent.Count > 512)
			{
				recent.Clear();
			}
			recent[key] = Time.unscaledTime;
			GameObject val = new GameObject("GuardianPaths " + cue + " burst");
			val.transform.position = position;
			AbilityFx abilityFx = val.AddComponent<AbilityFx>();
			abilityFx.element = e;
			abilityFx.scale = size;
			abilityFx.duration = ((e == Element.Void) ? 0.65f : 0.5f);
			abilityFx.rays = (LineRenderer[])(object)new LineRenderer[10];
			for (int i = 0; i < abilityFx.rays.Length; i++)
			{
				GameObject val2 = new GameObject("filament " + i);
				val2.transform.SetParent(val.transform, false);
				LineRenderer val3 = val2.AddComponent<LineRenderer>();
				abilityFx.rays[i] = val3;
				((Renderer)val3).sharedMaterial = GuardianVfx.EffectMaterial;
				val3.useWorldSpace = false;
				val3.positionCount = ((e == Element.Stasis) ? 4 : 9);
				val3.loop = e == Element.Stasis;
				((Renderer)val3).sortingOrder = 17;
				val3.startWidth = 0.11f;
				val3.endWidth = 0.008f;
			}
		}
	}

	private void Update()
	{
		//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_0064: Unknown result type (might be due to invalid IL or missing references)
		//IL_007b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0085: 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_00c6: 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_01f8: Unknown result type (might be due to invalid IL or missing references)
		//IL_0211: Unknown result type (might be due to invalid IL or missing references)
		//IL_0216: Unknown result type (might be due to invalid IL or missing references)
		//IL_0235: Unknown result type (might be due to invalid IL or missing references)
		//IL_023f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0244: Unknown result type (might be due to invalid IL or missing references)
		//IL_0249: Unknown result type (might be due to invalid IL or missing references)
		//IL_0270: Unknown result type (might be due to invalid IL or missing references)
		//IL_0289: Unknown result type (might be due to invalid IL or missing references)
		//IL_028e: Unknown result type (might be due to invalid IL or missing references)
		//IL_03eb: Unknown result type (might be due to invalid IL or missing references)
		//IL_0322: Unknown result type (might be due to invalid IL or missing references)
		//IL_0329: Unknown result type (might be due to invalid IL or missing references)
		//IL_032e: Unknown result type (might be due to invalid IL or missing references)
		//IL_03a0: Unknown result type (might be due to invalid IL or missing references)
		//IL_03b9: Unknown result type (might be due to invalid IL or missing references)
		//IL_03be: Unknown result type (might be due to invalid IL or missing references)
		//IL_02cc: 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_01ce: 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_01de: Unknown result type (might be due to invalid IL or missing references)
		//IL_01e3: Unknown result type (might be due to invalid IL or missing references)
		//IL_01e8: Unknown result type (might be due to invalid IL or missing references)
		age += TimeHandler.deltaTime;
		float num = age / duration;
		if (num >= 1f)
		{
			Object.Destroy((Object)(object)((Component)this).gameObject);
			return;
		}
		Color val = Colour(element);
		val.a = (1f - num) * 0.9f;
		Vector2 val3 = default(Vector2);
		Vector2 val4 = default(Vector2);
		Vector2 val5 = default(Vector2);
		for (int i = 0; i < rays.Length; i++)
		{
			LineRenderer val2 = rays[i];
			Color startColor = Color.Lerp(val, new Color(1f, 1f, 1f, val.a), 0.12f);
			startColor.r *= 0.72f;
			startColor.g *= 0.72f;
			startColor.b *= 0.72f;
			val2.startColor = startColor;
			val2.endColor = new Color(val.r * 0.55f, val.g * 0.55f, val.b * 0.55f, (element == Element.Stasis) ? (val.a * 0.5f) : 0f);
			float num2 = (float)i * (float)Math.PI * 2f / (float)rays.Length;
			((Vector2)(ref val3))..ctor(Mathf.Cos(num2), Mathf.Sin(num2));
			((Vector2)(ref val4))..ctor(0f - val3.y, val3.x);
			for (int j = 0; j < val2.positionCount; j++)
			{
				float num3 = (float)j / (float)(val2.positionCount - 1);
				if (element == Element.Stasis)
				{
					float num4 = 0.4f + num * scale;
					float num5 = j switch
					{
						3 => -0.13f, 
						1 => 0.13f, 
						_ => 0f, 
					};
					val5 = val3 * (num4 + j switch
					{
						2 => 0.36f, 
						0 => -0.23f, 
						_ => 0f, 
					}) + val4 * num5;
				}
				else if (element == Element.Solar)
				{
					val5 = val3 * (0.3f + num * scale + num3 * 0.6f) + val4 * Mathf.Sin(num3 * 8f + age * 22f + (float)i) * 0.13f;
					val5.y += num * num * 0.9f;
				}
				else if (element == Element.Arc)
				{
					val5 = val3 * (0.2f + num3 * scale * (0.7f + num)) + val4 * ((j == 0 || j == 8) ? 0f : (Mathf.Sin((float)(j * 23 + i * 41 + (int)(age * 18f))) * 0.22f * (1f - num)));
				}
				else if (element == Element.Void)
				{
					float num6 = num2 + num3 * 2.4f + num * 3f;
					float num7 = (1f - num) * scale * (0.3f + num3);
					val5 = new Vector2(Mathf.Cos(num6), Mathf.Sin(num6)) * num7;
				}
				else if (element == Element.Strand)
				{
					float num8 = num3 * (float)Math.PI * 4f + num2 + num * 5f;
					((Vector2)(ref val5))..ctor((num3 - 0.5f) * scale * 2f, Mathf.Sin(num8) * scale * 0.3f + Mathf.Cos(num2) * scale * 0.18f);
				}
				else
				{
					val5 = val3 * (0.25f + num3 * scale * (0.4f + num));
					val5.y += num * 0.7f;
				}
				val2.SetPosition(j, new Vector3(val5.x, val5.y, -0.7f));
			}
		}
	}

	public static void HammerMesh(Transform parent, float size)
	{
		//IL_0019: Unknown result type (might be due to invalid IL or missing references)
		//IL_001e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0034: Unknown result type (might be due to invalid IL or missing references)
		//IL_0039: Unknown result type (might be due to invalid IL or missing references)
		//IL_004f: 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_006a: Unknown result type (might be due to invalid IL or missing references)
		//IL_006f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0085: 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_00a0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
		//IL_00de: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
		//IL_00fe: Unknown result type (might be due to invalid IL or missing references)
		//IL_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)
		//IL_012f: 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_0149: Unknown result type (might be due to invalid IL or missing references)
		//IL_016d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0172: Unknown result type (might be due to invalid IL or missing references)
		//IL_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_01a3: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a8: Unknown result type (might be due to invalid IL or missing references)
		//IL_01be: 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_01d8: Unknown result type (might be due to invalid IL or missing references)
		Facet(parent, (Vector2[])(object)new Vector2[6]
		{
			new Vector2(-0.6f, 0.25f),
			new Vector2(-0.7f, 0.58f),
			new Vector2(-0.45f, 0.82f),
			new Vector2(0.45f, 0.82f),
			new Vector2(0.7f, 0.58f),
			new Vector2(0.6f, 0.25f)
		}, new Color(0.8f, 0.21f, 0.015f), size);
		Facet(parent, (Vector2[])(object)new Vector2[4]
		{
			new Vector2(-0.45f, 0.38f),
			new Vector2(-0.45f, 0.62f),
			new Vector2(0.45f, 0.62f),
			new Vector2(0.45f, 0.38f)
		}, new Color(1f, 0.75f, 0.16f), size);
		Facet(parent, (Vector2[])(object)new Vector2[4]
		{
			new Vector2(-0.085f, -0.65f),
			new Vector2(-0.085f, 0.4f),
			new Vector2(0.085f, 0.4f),
			new Vector2(0.085f, -0.65f)
		}, new Color(0.95f, 0.45f, 0.1f), size);
	}

	public static void Facet(Transform parent, Vector2[] polygon, Color color, float size)
	{
		//IL_003e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0044: Expected O, but got Unknown
		//IL_0051: Unknown result type (might be due to invalid IL or missing references)
		//IL_0057: Expected O, but got Unknown
		//IL_0077: Unknown result type (might be due to invalid IL or missing references)
		//IL_007c: Unknown result type (might be due to invalid IL or missing references)
		//IL_008f: 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_0096: 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_009a: Unknown result type (might be due to invalid IL or missing references)
		//IL_009f: Unknown result type (might be due to invalid IL or missing references)
		//IL_00af: 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_00da: Unknown result type (might be due to invalid IL or missing references)
		//IL_00df: Unknown result type (might be due to invalid IL or missing references)
		//IL_00eb: 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_00f6: Unknown result type (might be due to invalid IL or missing references)
		//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
		//IL_0107: Unknown result type (might be due to invalid IL or missing references)
		//IL_011c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0126: Unknown result type (might be due to invalid IL or missing references)
		//IL_012b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0162: Unknown result type (might be due to invalid IL or missing references)
		//IL_0167: 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_0177: Unknown result type (might be due to invalid IL or missing references)
		color.r *= 0.45f;
		color.g *= 0.45f;
		color.b *= 0.45f;
		GameObject val = new GameObject("GuardianPaths facet");
		val.transform.SetParent(parent, false);
		Mesh val2 = new Mesh();
		Vector3[] array = (Vector3[])(object)new Vector3[polygon.Length + 1];
		Color[] array2 = (Color[])(object)new Color[array.Length];
		int[] array3 = new int[polygon.Length * 3];
		Vector2 val3 = Vector2.zero;
		foreach (Vector2 val4 in polygon)
		{
			val3 += val4;
		}
		val3 /= (float)polygon.Length;
		ref Vector3 reference = ref array[0];
		reference = new Vector3(val3.x * size, val3.y * size, -0.65f);
		ref Color reference2 = ref array2[0];
		reference2 = Color.Lerp(color, Color.white, 0.3f);
		ref Color reference3 = ref array2[0];
		reference3 = Color.Lerp(color, new Color(0.5f, 0.5f, 0.5f, 1f), 0.08f);
		for (int j = 0; j < polygon.Length; j++)
		{
			ref Vector3 reference4 = ref array[j + 1];
			reference4 = new Vector3(polygon[j].x * size, polygon[j].y * size, -0.65f);
			array2[j + 1] = color;
			array3[j * 3] = 0;
			array3[j * 3 + 1] = j + 1;
			array3[j * 3 + 2] = (j + 1) % polygon.Length + 1;
		}
		val2.vertices = array;
		val2.colors = array2;
		val2.triangles = array3;
		val2.RecalculateBounds();
		val.AddComponent<MeshFilter>().sharedMesh = val2;
		MeshRenderer val5 = val.AddComponent<MeshRenderer>();
		((Renderer)val5).sharedMaterial = GuardianVfx.EffectMaterial;
		((Renderer)val5).sortingOrder = 14;
		val.AddComponent<OwnedFxMesh>();
	}
}
internal sealed class OwnedFxMesh : MonoBehaviour
{
	private void OnDestroy()
	{
		MeshFilter component = ((Component)this).GetComponent<MeshFilter>();
		if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component.sharedMesh))
		{
			Object.Destroy((Object)(object)component.sharedMesh);
		}
	}
}
public sealed class AspectCombat : MonoBehaviour
{
	private Vector2 grapplePoint;

	private string diveAspect;

	private float diveDamage;

	internal Player Player;

	private GuardianCombat combat;

	private readonly Dictionary<string, float> cooldowns = new Dictionary<string, float>();

	private readonly Dictionary<string, float> times = new Dictionary<string, float>();

	private readonly Dictionary<string, float> values = new Dictionary<string, float>();

	private readonly Dictionary<string, int> counts = new Dictionary<string, int>();

	private readonly HashSet<long> countedShots = new HashSet<long>();

	private int sequence;

	private int entitySequence;

	private float forwardTime;

	private float aimTime;

	private float slideWas;

	private float glideExtended;

	private int aimedId = -1;

	private int receivedSequence;

	private readonly Dictionary<string, float> damageCharge = new Dictionary<string, float>();

	public bool AimReady
	{
		get
		{
			if (aimedId >= 0)
			{
				return aimTime >= 0.4f;
			}
			return false;
		}
	}

	internal int AimTarget => aimedId;

	public int ShotSerial { get; private set; }

	public int Casts { get; private set; }

	public bool Owner
	{
		get
		{
			if (!PhotonNetwork.OfflineMode)
			{
				return Player.data.view.IsMine;
			}
			return true;
		}
	}

	public bool Active
	{
		get
		{
			if (Object.op_Implicit((Object)(object)combat))
			{
				return combat.CombatActive;
			}
			return false;
		}
	}

	public Vector2 Aim
	{
		get
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			Vector2 val = Vector2.op_Implicit(Player.data.aimDirection);
			if (!(((Vector2)(ref val)).sqrMagnitude > 0.01f))
			{
				return Vector2.right;
			}
			return ((Vector2)(ref val)).normalized;
		}
	}

	public float Bullet => Mathf.Max(TitanCombat.BulletDamage(Player.data.weaponHandler.gun, modified: false), TitanCombat.BulletDamage(Player.data.weaponHandler.gun, modified: true));

	public float MovementMultiplier => 1f + Value("speed") + EquipmentSpeed;

	public float ReloadMultiplier => 1f + Value("reload");

	public bool CannotFire
	{
		get
		{
			if (!(TimeLeft("guard") > 0f) && !(TimeLeft("weave") > 0f))
			{
				return TimeLeft("siphon") > 0f;
			}
			return true;
		}
	}

	public float LastAbsorbed { get; private set; }

	private bool Crouched
	{
		get
		{
			if (Player.data.playerActions != null)
			{
				return ((OneAxisInputControl)Player.data.playerActions.Down).IsPressed;
			}
			return false;
		}
	}

	private float EquipmentResistance
	{
		get
		{
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			if (!Has("SparkofResistance") || !Enemies(Vector2.op_Implicit(((Component)Player).transform.position), 4f).Any())
			{
				return 0f;
			}
			return 0.2f;
		}
	}

	private float EquipmentSpeed
	{
		get
		{
			if (!Has("EchoofDilation") || !Crouched)
			{
				return 0f;
			}
			return 0.3f;
		}
	}

	public float ScorchMultiplier
	{
		get
		{
			if (!Has("EmberofAshes"))
			{
				return 1f;
			}
			return 1.75f;
		}
	}

	private void Blocked(BlockTriggerType type)
	{
		//IL_0000: Unknown result type (might be due to invalid IL or missing references)
		if ((int)type == 0 && Owner && Active && !(WarlockCombat.For(Player).FrozenRemaining > 0f))
		{
			PlayerActions playerActions = Player.data.playerActions;
			bool down = playerActions != null && ((OneAxisInputControl)playerActions.Down).IsPressed;
			BlockAction(!Player.data.isGrounded, down);
		}
	}

	public void BlockAction(bool air, bool down)
	{
		//IL_001c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0021: Unknown result type (might be due to invalid IL or missing references)
		//IL_0026: Unknown result type (might be due to invalid IL or missing references)
		//IL_0659: Unknown result type (might be due to invalid IL or missing references)
		//IL_065b: Unknown result type (might be due to invalid IL or missing references)
		if (!Owner || !Active)
		{
			return;
		}
		Vector2 pos = Vector2.op_Implicit(((Component)Player).transform.position);
		EquipmentBlock(air);
		AspectDefinition[] array = AspectCatalog.All.Values.Where((AspectDefinition d) => Has(d.Id)).ToArray();
		foreach (AspectDefinition aspectDefinition in array)
		{
			string id = aspectDefinition.Id;
			float num2 = 0f;
			int variant = 0;
			int target = -1;
			switch (id)
			{
			case "OnYourMark":
				num2 = 6f;
				break;
			case "KnockEmDown":
				if (Count(id) < 3)
				{
					continue;
				}
				num2 = 7f;
				break;
			case "GunpowderGamble":
				if (Count(id) < 4)
				{
					continue;
				}
				num2 = 8f;
				break;
			case "Crackshot":
				if (aimedId < 0 || aimTime < 0.4f)
				{
					continue;
				}
				target = aimedId;
				num2 = 8f;
				break;
			case "TempestStrike":
				if (!down || air)
				{
					continue;
				}
				num2 = 7f;
				break;
			case "Ascension":
				if (!air)
				{
					continue;
				}
				num2 = 6f;
				break;
			case "VanishingStep":
				num2 = 6f;
				break;
			case "TrappersAmbush":
				if (!air || !down)
				{
					continue;
				}
				variant = ((combat.InvisibleRemaining > 0f) ? 1 : 0);
				num2 = 8f;
				break;
			case "WintersShroud":
				num2 = 6f;
				break;
			case "Shatterdive":
				if (!air || !down)
				{
					continue;
				}
				num2 = 7f;
				break;
			case "TouchofWinter":
				if (Count(id) < 3)
				{
					continue;
				}
				num2 = 8f;
				break;
			case "WidowsSilk":
				if (!air || (down && Has("EnsnaringSlam")))
				{
					continue;
				}
				num2 = ((Count("grapple-pulls") <= 0) ? 8 : 0);
				if (num2 > 0f && Cooldown(id) > 0f)
				{
					continue;
				}
				break;
			case "EnsnaringSlam":
				if (!air || !down)
				{
					continue;
				}
				num2 = 8f;
				break;
			case "ThreadedSpecter":
				num2 = 8f;
				break;
			case "HeatRises":
				num2 = 6f;
				break;
			case "IcarusDash":
				if (!air)
				{
					continue;
				}
				num2 = ((!Has("HeatRises") || Count("icarus-pulls") <= 0) ? 5 : 0);
				if (num2 > 0f && Cooldown(id) > 0f)
				{
					continue;
				}
				break;
			case "TouchofFlame":
				num2 = 8f;
				break;
			case "Hellion":
				num2 = 9f;
				break;
			case "ArcSoul":
				num2 = 8f;
				break;
			case "IonicSentry":
				if (Count(id) < 4)
				{
					continue;
				}
				num2 = 10f;
				break;
			case "ChaosAccelerant":
				if (WarlockCombat.For(Player).VortexRemaining <= 0f)
				{
					continue;
				}
				num2 = 5f;
				break;
			case "ChildoftheOldGods":
				num2 = 8f;
				break;
			case "SoulSiphon":
				if (TimeLeft("siphon-ready") <= 0f)
				{
					continue;
				}
				num2 = 9f;
				break;
			case "BleakWatcher":
				num2 = 9f;
				break;
			case "WeaversCall":
				num2 = 8f;
				break;
			case "MindspunInvocation":
				num2 = 10f;
				break;
			case "Weavewalk":
				if (!air)
				{
					continue;
				}
				num2 = 10f;
				break;
			case "Consecration":
				if (!down || air)
				{
					continue;
				}
				num2 = 9f;
				break;
			case "Shieldburst":
				if (AspectEntity.Owned(Player.playerID, "solar-wall").Any())
				{
					AspectEntity.Detonate(Player.playerID, "solar-wall");
					continue;
				}
				num2 = 10f;
				break;
			case "TouchofThunder":
				num2 = 9f;
				break;
			case "StormsKeep":
				num2 = 7f;
				break;
			case "Bastion":
				num2 = 7f;
				break;
			case "ControlledDemolition":
				num2 = 7f;
				break;
			case "Unbreakable":
				num2 = 10f;
				break;
			case "HowloftheStorm":
				if (!down)
				{
					continue;
				}
				num2 = 8f;
				break;
			case "DrengrsLash":
				num2 = 8f;
				break;
			case "FlechetteStorm":
				if (!down || air)
				{
					continue;
				}
				num2 = 8f;
				break;
			default:
				continue;
			}
			if (!(num2 > 0f) || Ready(id, num2))
			{
				SpendCharge(id);
				Cast(id, pos, Aim, target, variant);
			}
		}
	}

	private void ApplyCast(string id, Vector2 pos, Vector2 aim, int target, int variant)
	{
		//IL_002b: Unknown result type (might be due to invalid IL or missing references)
		//IL_002c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0471: Unknown result type (might be due to invalid IL or missing references)
		//IL_0472: Unknown result type (might be due to invalid IL or missing references)
		//IL_048d: Unknown result type (might be due to invalid IL or missing references)
		//IL_048e: Unknown result type (might be due to invalid IL or missing references)
		//IL_054d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0552: Unknown result type (might be due to invalid IL or missing references)
		//IL_0557: Unknown result type (might be due to invalid IL or missing references)
		//IL_057c: Unknown result type (might be due to invalid IL or missing references)
		//IL_057d: Unknown result type (might be due to invalid IL or missing references)
		//IL_057e: Unknown result type (might be due to invalid IL or missing references)
		//IL_05bb: Unknown result type (might be due to invalid IL or missing references)
		//IL_05c0: Unknown result type (might be due to invalid IL or missing references)
		//IL_05ca: Unknown result type (might be due to invalid IL or missing references)
		//IL_05cf: Unknown result type (might be due to invalid IL or missing references)
		//IL_05da: Unknown result type (might be due to invalid IL or missing references)
		//IL_05f5: Unknown result type (might be due to invalid IL or missing references)
		//IL_05f6: Unknown result type (might be due to invalid IL or missing references)
		//IL_0639: Unknown result type (might be due to invalid IL or missing references)
		//IL_06ad: Unknown result type (might be due to invalid IL or missing references)
		//IL_06ae: Unknown result type (might be due to invalid IL or missing references)
		//IL_06ce: Unknown result type (might be due to invalid IL or missing references)
		//IL_06cf: Unknown result type (might be due to invalid IL or missing references)
		//IL_06ea: Unknown result type (might be due to invalid IL or missing references)
		//IL_06f5: Unknown result type (might be due to invalid IL or missing references)
		//IL_06fa: Unknown result type (might be due to invalid IL or missing references)
		//IL_0700: Unknown result type (might be due to invalid IL or missing references)
		//IL_0705: Unknown result type (might be due to invalid IL or missing references)
		//IL_07ac: Unknown result type (might be due to invalid IL or missing references)
		//IL_07ad: Unknown result type (might be due to invalid IL or missing references)
		//IL_07d1: Unknown result type (might be due to invalid IL or missing references)
		//IL_07d2: Unknown result type (might be due to invalid IL or missing references)
		//IL_0811: Unknown result type (might be due to invalid IL or missing references)
		//IL_086c: Unknown result type (might be due to invalid IL or missing references)
		//IL_086d: Unknown result type (might be due to invalid IL or missing references)
		//IL_088d: Unknown result type (might be due to invalid IL or missing references)
		//IL_088e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0898: Unknown result type (might be due to invalid IL or missing references)
		//IL_089d: Unknown result type (might be due to invalid IL or missing references)
		//IL_08a2: Unknown result type (might be due to invalid IL or missing references)
		//IL_08c6: Unknown result type (might be due to invalid IL or missing references)
		//IL_08c7: Unknown result type (might be due to invalid IL or missing references)
		//IL_08d1: Unknown result type (might be due to invalid IL or missing references)
		//IL_08d6: Unknown result type (might be due to invalid IL or missing references)
		//IL_08db: Unknown result type (might be due to invalid IL or missing references)
		//IL_08f9: Unknown result type (might be due to invalid IL or missing references)
		//IL_091a: Unknown result type (might be due to invalid IL or missing references)
		//IL_091b: Unknown result type (might be due to invalid IL or missing references)
		//IL_093d: Unknown result type (might be due to invalid IL or missing references)
		//IL_093e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0973: Unknown result type (might be due to invalid IL or missing references)
		//IL_0974: Unknown result type (might be due to invalid IL or missing references)
		//IL_09fa: Unknown result type (might be due to invalid IL or missing references)
		//IL_09fb: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b45: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b46: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b60: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b61: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b6b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b70: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b83: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b84: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b8e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b93: Unknown result type (might be due to invalid IL or missing references)
		//IL_0bb4: Unknown result type (might be due to invalid IL or missing references)
		//IL_0bb5: Unknown result type (might be due to invalid IL or missing references)
		//IL_0bb6: Unknown result type (might be due to invalid IL or missing references)
		//IL_0bc0: Unknown result type (might be due to invalid IL or missing references)
		//IL_0bc5: Unknown result type (might be due to invalid IL or missing references)
		//IL_0bca: Unknown result type (might be due to invalid IL or missing references)
		//IL_0bcf: Unknown result type (might be due to invalid IL or missing references)
		//IL_0c42: Unknown result type (might be due to invalid IL or missing references)
		//IL_0c43: Unknown result type (might be due to invalid IL or missing references)
		//IL_0c48: Unknown result type (might be due to invalid IL or missing references)
		//IL_0c6c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0c6d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0c6e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0cac: Unknown result type (might be due to invalid IL or missing references)
		//IL_0cea: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ceb: Unknown result type (might be due to invalid IL or missing references)
		//IL_0cec: Unknown result type (might be due to invalid IL or missing references)
		//IL_0cf1: Unknown result type (might be due to invalid IL or missing references)
		//IL_0cf6: Unknown result type (might be due to invalid IL or missing references)
		//IL_0cf7: Unknown result type (might be due to invalid IL or missing references)
		//IL_0d31: Unknown result type (might be due to invalid IL or missing references)
		//IL_0d32: Unknown result type (might be due to invalid IL or missing references)
		//IL_0d8c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0d8d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0e1c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0e1d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0e1e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ed0: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ed1: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ed2: Unknown result type (might be due to invalid IL or missing references)
		//IL_0f0f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0f14: Unknown result type (might be due to invalid IL or missing references)
		//IL_0f1e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0f23: Unknown result type (might be due to invalid IL or missing references)
		//IL_0f34: Unknown result type (might be due to invalid IL or missing references)
		//IL_0f35: Unknown result type (might be due to invalid IL or missing references)
		//IL_073e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0743: Unknown result type (might be due to invalid IL or missing references)
		//IL_0749: Unknown result type (might be due to invalid IL or missing references)
		//IL_074b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a78: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a7d: Unknown result type (might be due to invalid IL or missing references)
		//IL_04cf: Unknown result type (might be due to invalid IL or missing references)
		//IL_04d0: Unknown result type (might be due to invalid IL or missing references)
		//IL_04d9: Unknown result type (might be due to invalid IL or missing references)
		//IL_04e3: Unknown result type (might be due to invalid IL or missing references)
		//IL_04e8: Unknown result type (might be due to invalid IL or missing references)
		//IL_04ed: Unknown result type (might be due to invalid IL or missing references)
		//IL_067b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0e40: Unknown result type (might be due to invalid IL or missing references)
		//IL_0e41: Unknown result type (might be due to invalid IL or missing references)
		//IL_0e42: Unknown result type (might be due to invalid IL or missing references)
		//IL_0e50: Unknown result type (might be due to invalid IL or missing references)
		//IL_0e55: Unknown result type (might be due to invalid IL or missing references)
		//IL_0e5a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0e5f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0e61: Unknown result type (might be due to invalid IL or missing references)
		//IL_0e62: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ac7: Unknown result type (might be due to invalid IL or missing references)
		//IL_0acc: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ad8: Unknown result type (might be due to invalid IL or missing references)
		//IL_0add: Unknown result type (might be due to invalid IL or missing references)
		//IL_0aee: Unknown result type (might be due to invalid IL or missing references)
		//IL_0af3: Unknown result type (might be due to invalid IL or missing references)
		//IL_0af8: Unknown result type (might be due to invalid IL or missing references)
		//IL_0afd: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b01: Unknown result type (might be due to invalid IL or missing references)
		//IL_0e8b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0e8d: Unknown result type (might be due to invalid IL or missing references)
		if (id == "HowloftheStorm")
		{
			TitanCombat.For(Player).ReplaceCrystalForHowl();
		}
		if (!Owner || ApplyEquipmentCast(id, pos, aim, target))
		{
			return;
		}
		float bullet = Bullet;
		switch (id)
		{
		case "OnYourMark":
			SetCount("marks", 3);
			Buff("reload", 3f, 0.24f);
			break;
		case "KnockEmDown":
			Fan(id, "knife", pos, aim, 3, bullet * 0.15f, 15f);
			break;
		case "GunpowderGamble":
			Spawn(id, "bomb", pos, aim, bullet * 1.6f, 1.5f, 5.5f);
			break;
		case "Crackshot":
		{
			SetCount("crack-hits", 0);
			SetCount("crack-group", sequence);
			for (int num2 = 0; num2 < 3; num2++)
			{
				Spawn(id, "crackshot", pos + Vector2.up * (float)(num2 - 1) * 0.12f, aim, bullet * 0.15f, 1.5f, 0.18f, target);
			}
			break;
		}
		case "FlowState":
			Buff("speed", 2f, 0.15f);
			Buff("reload", 2f, 0.2f);
			break;
		case "LethalCurrent":
			Spawn(id, "aftershock", Vector2.op_Implicit(((Component)Find(target)).transform.position), Vector2.zero, bullet * 0.2f, 0.35f, 1.5f, target);
			break;
		case "TempestStrike":
			Spawn(id, "arc-wave", pos, Horizontal(aim), bullet * 0.45f, 0.65f, 1f);
			break;
		case "Ascension":
			NativeMotion.Set(Player.data.playerVel, NativeMotion.Get(Player.data.playerVel) + Vector2.up * 14f);
			Area(pos, 3f, bullet * 0.25f, Element.Arc);
			break;
		case "VanishingStep":
			Dash(Horizontal(aim), 5f);
			Buff("cloak", 1.2f, 0f);
			break;
		case "TrappersAmbush":
			StartDive(id, (variant == 1) ? (bullet * 0.45f) : (bullet * 0.3f));
			break;
		case "WintersShroud":
		{
			Player[] array = Enemies(pos, 4f).ToArray();
			foreach (Player target2 in array)
			{
				Status(target2, "slow", 1f, 0f);
			}
			if (Enemies(pos, 4f).Any())
			{
				Refund();
			}
			break;
		}
		case "Shatterdive":
			StartDive(id, bullet * 0.25f);
			break;
		case "TouchofWinter":
			Spawn(id, "frost-grenade", pos, aim, bullet * 0.4f, 1.2f, 4f);
			break;
		case "GrimHarvest":
		case "GlacialHarvest":
		case "TectonicHarvest":
			Spawn(id, "shard", pos, Vector2.zero, 0f, 4f, 0.3f);
			break;
		case "WidowsSilk":
		{
			RaycastHit2D val4 = TerrainSight.Sweep(pos, new Vector2(0.2f, 0.2f), aim, 16f);
			if (!Object.op_Implicit((Object)(object)((RaycastHit2D)(ref val4)).collider))
			{
				cooldowns[id] = 0f;
				break;
			}
			Buff("grapple", 0.6f, 1f);
			grapplePoint = ((RaycastHit2D)(ref val4)).point;
			AspectVisuals.Beam(id, pos, grapplePoint, 0.45f);
			if (Count("grapple-pulls") == 0)
			{
				SetCount("grapple-pulls", 1);
				Buff("grapple-window", 2f, 1f);
			}
			else
			{
				SetCount("grapple-pulls", 0);
			}
			break;
		}
		case "EnsnaringSlam":
			StartDive(id, bullet * 0.45f);
			break;
		case "ThreadedSpecter":
			Spawn(id, "decoy", pos, Vector2.zero, bullet * 0.2f, 3f, 0.8f);
			break;
		case "WhirlingMaelstrom":
		case "IntotheFray":
		case "TheWanderer":
			Spawn(id, "tangle", pos, Vector2.zero, bullet * 0.5f, 5f, 0.55f);
			break;
		case "HeatRises":
			Buff("glide", 3f, 0f);
			glideExtended = 0f;
			break;
		case "IcarusDash":
			Dash(aim, 6f);
			if (Has("HeatRises") && Count("icarus-pulls") == 0)
			{
				SetCount("icarus-pulls", 1);
				Buff("icarus-window", 2f, 1f);
			}
			else
			{
				SetCount("icarus-pulls", 0);
			}
			break;
		case "TouchofFlame":
			Spawn(id, "fusion", pos, aim, bullet * 0.25f, 1.4f, 2f);
			break;
		case "Hellion":
			Spawn(id, "hellion", pos + Vector2.up * 1.8f, Vector2.zero, bullet * 0.1f, 3f, 0.4f);
			break;
		case "ArcSoul":
			Spawn(id, "arc-soul", pos + Vector2.up * 1.5f, Vector2.zero, bullet * 0.1f, 3f, 0.35f);
			break;
		case "LightningSurge":
			Area(pos, 3f, bullet * 0.3f, Element.Arc);
			break;
		case "ElectrostaticMind":
			Spawn(id, "trace", pos, Vector2.zero, 0f, 4f, 0.2f);
			break;
		case "IonicSentry":
			Spawn(id, "sentry-seed", pos, aim, bullet * 0.15f, 1.2f, 0.4f);
			break;
		case "ChaosAccelerant":
			Buff("vortex-enhance", 0f, 0f);
			Spawn(id, "vortex", pos, Vector2.zero, bullet * 0.12f, 2f, 6.5f);
			break;
		case "FeedtheVoid":
			Buff("devour", 2f, 1f);
			SetCount("devour-heals", 0);
			break;
		case "ChildoftheOldGods":
			Buff("child-ready", 5f, 1f);
			break;
		case "SoulSiphon":
			Buff("siphon", 0.6f, 1f);
			Buff("siphon-ready", 0f, 0f);
			Spawn(id, "siphon", pos, aim, bullet * 0.0625f, 0.6f, 6f);
			break;
		case "IceflareBolts":
		{
			Player frozen = Find(target);
			if (Object.op_Implicit((Object)(object)frozen))
			{
				Status(frozen, "shatter", 0f, 0f);
				Deal(frozen, bullet * 0.25f, Element.Stasis);
				Player val2 = Enemies(Vector2.op_Implicit(((Component)frozen).transform.position), 8f).FirstOrDefault((Func<Player, bool>)((Player p) => (Object)(object)p != (Object)(object)frozen));
				if (Object.op_Implicit((Object)(object)val2))
				{
					Vector2 pos2 = Vector2.op_Implicit(((Component)frozen).transform.position);
					Vector2 val3 = Vector2.op_Implicit(((Component)val2).transform.position) - Vector2.op_Implicit(((Component)frozen).transform.position);
					Spawn(id, "ice-seeker", pos2, ((Vector2)(ref val3)).normalized, 0f, 1.5f, 0.2f, val2.playerID);
				}
			}
			break;
		}
		case "Frostpulse":
			Buff("armour", 1.5f, 0.15f);
			Refund();
			break;
		case "BleakWatcher":
			Spawn(id, "bleak-seed", pos, aim, bullet * 0.05f, 1.2f, 0.4f);
			break;
		case "WeaversCall":
			Pet(pos + Vector2.left * 0.6f, bullet * 0.6f, id);
			Pet(pos + Vector2.right * 0.6f, bullet * 0.6f, id);
			ReleasePerches();
			break;
		case "MindspunInvocation":
			Spawn(id, "nest", GroundSpot(pos + Horizontal(aim) * 1.8f), Vector2.zero, bullet * 0.6f, 3f, 0.7f);
			break;
		case "Weavewalk":
			Buff("weave", 0.8f, 1f);
			SetCount("weave-pet", 1);
			break;
		case "RoaringFlames":
			Buff("flames", 3f, Mathf.Min(0.45f, Value("flames") + 0.15f));
			break;
		case "SolInvictus":
			Spawn(id, "sunspot", GroundSpot(pos), Vector2.zero, bullet * 0.05f, 2f, 2f);
			break;
		case "Consecration":
			Spawn(id, "solar-wave", pos, Horizontal(aim), bullet * 0.25f, 0.65f, 1f);
			NativeMotion.Set(Player.data.playerVel, new Vector2(aim.x * 6f, 12f));
			Buff("consecration", 1.5f, bullet * 0.25f);
			Buff("consecration-windup", 0.18f, 1f);
			break;
		case "Shieldburst":
			Spawn(id, "solar-wall", pos + Horizontal(aim), Horizontal(aim), bullet * 0.5f, 3f, 1f);
			break;
		case "Knockout":
			Buff("knockout", 3f, 1f);
			break;
		case "TouchofThunder":
			Spawn(id, "storm-seed", pos, aim, bullet * 0.1f, 1.2f, 0.5f);
			break;
		case "Juggernaut":
			Buff("juggernaut", 2f, bullet * 0.4f);
			break;
		case "StormsKeep":
			SetCount("bolt", 1);
			Buff("bolt-window", 5f, 1f);
			break;
		case "Bastion":
			Spawn(id, "bastion", pos, Vector2.zero, 0f, 2f, 3f);
			break;
		case "ControlledDemolition":
			Buff("volatile-ready", 4f, 1f);
			break;
		case "Unbreakable":
			values["caught"] = 0f;
			Buff("guard", 0.8f, bullet);
			SetCount("guard-blast", 1);
			break;
		case "Cryoclasm":
			Buff("cryo-slide", 0.7f, (!(aim.x < 0f)) ? 1 : (-1));
			break;
		case "HowloftheStorm":
		{
			Spawn(id, "ice-wave", pos, Horizontal(aim), bullet * 0.3f, 0.55f, 1f);
			for (int i = 1; i <= 3; i++)
			{
				Vector2 val = GroundSpot(pos + Horizontal(aim) * ((float)i * 1.4f));
				if (!Physics2D.LinecastAll(pos, val).Any((RaycastHit2D h) => TerrainSight.Solid(((RaycastHit2D)(ref h)).collider) && (!Object.op_Implicit((Object)(object)((Component)((RaycastHit2D)(ref h)).collider).GetComponentInParent<AspectEntity>()) || !((Object)(object)((Component)((RaycastHit2D)(ref h)).collider).GetComponentInParent<AspectEntity>().Source == (Object)(object)this) || !(((Component)((RaycastHit2D)(ref h)).collider).GetComponentInParent<AspectEntity>().Kind == "mini-crystal"))))
				{
					Spawn(id, "mini-crystal", val, Vector2.zero, 0f, 3f, 0.45f);
				}
			}
			break;
		}
		case "DiamondLance":
			Buff("lance", 5f, 1f);
			break;
		case "DrengrsLash":
			Spawn(id, "strand-wave", pos, Horizontal(aim), bullet * 0.25f, 0.65f, 1f);
			break;
		case "FlechetteStorm":
			NativeMotion.Set(Player.data.playerVel, NativeMotion.Get(Player.data.playerVel) + Vector2.up * 10f);
			Fan(id, "needle", pos, aim, 5, bullet * 0.1f, 24f);
			break;
		case "BannerofWar":
			Buff("banner", 3f, 1f);
			SetCount("banner-heals", 0);
			break;
		}
	}

	internal static Vector2 Horizontal(Vector2 aim)
	{
		//IL_0000: 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)
		return Vector2.right * (float)((!(aim.x < 0f)) ? 1 : (-1));
	}

	internal Vector2 GroundSpot(Vector2 pos)
	{
		//IL_0000: Unknown result type (might be due to invalid IL or missing references)
		//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_000b: Unknown result type (might be due to invalid IL or missing references)
		//IL_005e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0063: 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)
		//IL_0085: 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_0072: Unknown result type (might be due to invalid IL or missing references)
		RaycastHit2D val = (from h in Physics2D.RaycastAll(pos + Vector2.up, Vector2.down, 3f)
			where TerrainSight.Solid(((RaycastHit2D)(ref h)).collider)
			orderby ((RaycastHit2D)(ref h)).distance
			select h).FirstOrDefault();
		if (!Object.op_Implicit((Object)(object)((RaycastHit2D)(ref val)).collider))
		{
			return pos;
		}
		return ((RaycastHit2D)(ref val)).point + Vector2.up * 0.5f;
	}

	private void Fan(string id, string kind, Vector2 pos, Vector2 aim, int count, float damage, float spread)
	{
		//IL_0027: Unknown result type (might be due to invalid IL or missing references)
		//IL_002c: Unknown result type (might be due to invalid IL or missing references)
		//IL_002e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0033: Unknown result type (might be due to invalid IL or missing references)
		//IL_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_0041: Unknown result type (might be due to invalid IL or missing references)
		//IL_0042: Unknown result type (might be due to invalid IL or missing references)
		for (int i = 0; i < count; i++)
		{
			float num = ((float)i - (float)(count - 1) * 0.5f) * spread / (float)(count - 1);
			Vector2 direction = Vector2.op_Implicit(Quaternion.Euler(0f, 0f, num) * Vector2.op_Implicit(aim));
			Spawn(id, kind, pos, direction, damage, 1.5f, 0.16f);
		}
	}

	private void StartDive(string id, float damage)
	{
		diveAspect = id;
		diveDamage = damage;
		Buff("dive", 1.5f, 1f);
	}

	private void LandDive(Vector2 pos)
	{
		//IL_002e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0047: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
		//IL_0072: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d9: Unknown result type (might be due to invalid IL or missing references)
		if (diveAspect == null)
		{
			return;
		}
		string text = diveAspect;
		diveAspect = null;
		Buff("dive", 0f, 0f);
		Flash(text, pos, 3f);
		if (text == "EnsnaringSlam")
		{
			Area(pos, 4.5f, diveDamage, Element.Strand, "suspend", 0.35f);
			return;
		}
		if (text == "Shatterdive")
		{
			Player[] array = Enemies(pos, 3f).ToArray();
			foreach (Player val in array)
			{
				Deal(val, diveDamage + ((GuardianCombat.For(val).SlowRemaining > 0f) ? (Bullet * 0.2f) : 0f), Element.Stasis);
			}
			ShatterCrystals(pos, 3f);
			return;
		}
		Player[] array2 = Enemies(pos, 3f).ToArray();
		Player[] array3 = array2;
		foreach (Player target in array3)
		{
			Deal(target, diveDamage, Element.Void);
		}
		if (array2.Length > 0)
		{
			Heal(5f);
		}
	}

	internal void ShatterCrystals(Vector2 pos, float radius)
	{
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		//IL_0008: Unknown result type (might be due to invalid IL or missing references)
		//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
		bool flag = false;
		StasisCrystal[] array = (from c in Object.FindObjectsOfType<StasisCrystal>()
			where Vector2.Distance(Vector2.op_Implicit(((Component)c).transform.position), pos) < radius && !Physics2D.LinecastAll(pos, Vector2.op_Implicit(((Component)c).transform.position)).Any((RaycastHit2D h) => TerrainSight.Solid(((RaycastHit2D)(ref h)).collider) && (Object)(object)((Component)((RaycastHit2D)(ref h)).collider).GetComponentInParent<StasisCrystal>() != (Object)(object)c)
			select c).ToArray();
		foreach (StasisCrystal stasisCrystal in array)
		{
			flag = true;
			stasisCrystal.RequestBreak(1f);
		}
		AspectEntity[] array2 = AspectEntity.All.Where((AspectEntity c) => c.Kind == "mini-crystal" && Vector2.Distance(Vector2.op_Implicit(((Component)c).transform.position), pos) < radius && !Physics2D.LinecastAll(pos, Vector2.op_Implicit(((Component)c).transform.position)).Any((RaycastHit2D h) => TerrainSight.Solid(((RaycastHit2D)(ref h)).collider) && (Object)(object)((Component)((RaycastHit2D)(ref h)).collider).GetComponentInParent<AspectEntity>() != (Object)(object)c)).ToArray();
		foreach (AspectEntity aspectEntity in array2)
		{
			flag = true;
			aspectEntity.ShotBy(Player, 1f);
		}
		if (flag && TimeLeft("cryo-slide") > 0f && Ready("cryo-shatter", 0.5f))
		{
			Area(pos, 3f, Bullet * 0.35f, Element.Stasis);
		}
	}

	internal void Dash(Vector2 direction, float length)
	{
		//IL_000b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0010: Unknown result type (might be due to invalid IL or missing references)
		//IL_0015: Unknown result type (might be due to invalid IL or missing references)
		//IL_0016: Unknown result type (might be due to invalid IL or missing references)
		//IL_0021: Unknown result type (might be due to invalid IL or missing references)
		//IL_0026: Unknown result type (might be due to invalid IL or missing references)
		//IL_0028: Unknown result type (might be due to invalid IL or missing references)
		//IL_002d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0063: Unknown result type (might be due to invalid IL or missing references)
		//IL_0068: Unknown result type (might be due to invalid IL or missing references)
		//IL_006a: Unknown result type (might be due to invalid IL or missing references)
		//IL_006f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0074: Unknown result type (might be due to invalid IL or missing references)
		//IL_008e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0094: Unknown result type (might be due to invalid IL or missing references)
		Vector2 start = Vector2.op_Implicit(((Component)Player).transform.position);
		RaycastHit2D val = TerrainSight.Sweep(start, new Vector2(1f, 1.5f), direction, length);
		float num = (Object.op_Implicit((Object)(object)((RaycastHit2D)(ref val)).collider) ? Mathf.Max(0f, ((RaycastHit2D)(ref val)).distance - 0.08f) : length);
		Transform transform = ((Component)Player).transform;
		transform.position += Vector2.op_Implicit(direction * num);
		NativeMotion.Set(Player.data.playerVel, direction * 8f);
	}

	private void TickActions(float dt)
	{
		//IL_0067: Unknown result type (might be due to invalid IL or missing references)
		//IL_006c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0158: Unknown result type (might be due to invalid IL or missing references)
		//IL_0168: Unknown result type (might be due to invalid IL or missing references)
		//IL_016d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0172: Unknown result type (might be due to invalid IL or missing references)
		//IL_0177: 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_0197: Unknown result type (might be due to invalid IL or missing references)
		//IL_019e: Unknown result type (might be due to invalid IL or missing references)
		//IL_01aa: Unknown result type (might be due to invalid IL or missing references)
		//IL_01af: Unknown result type (might be due to invalid IL or missing references)
		//IL_0245: Unknown result type (might be due to invalid IL or missing references)
		//IL_024a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0259: Unknown result type (might be due to invalid IL or missing references)
		//IL_025e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0274: Unknown result type (might be due to invalid IL or missing references)
		//IL_0279: Unknown result type (might be due to invalid IL or missing references)
		//IL_02a7: Unknown result type (might be due to invalid IL or missing references)
		//IL_02ac: Unknown result type (might be due to invalid IL or missing references)
		//IL_01f3: Unknown result type (might be due to invalid IL or missing references)
		//IL_0210: Unknown result type (might be due to invalid IL or missing references)
		//IL_02d2: Unknown result type (might be due to invalid IL or missing references)
		//IL_039d: Unknown result type (might be due to invalid IL or missing references)
		//IL_03b2: Unknown result type (might be due to invalid IL or missing references)
		//IL_0345: Unknown result type (might be due to invalid IL or missing references)
		//IL_034a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0350: Unknown result type (might be due to invalid IL or missing references)
		//IL_0355: Unknown result type (might be due to invalid IL or missing references)
		//IL_054e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0553: Unknown result type (might be due to invalid IL or missing references)
		//IL_0559: Unknown result type (might be due to invalid IL or missing references)
		//IL_055e: Unknown result type (might be due to invalid IL or missing references)
		//IL_04f8: Unknown result type (might be due to invalid IL or missing references)
		//IL_0502: Unknown result type (might be due to invalid IL or missing references)
		//IL_0518: Unknown result type (might be due to invalid IL or missing references)
		//IL_051d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0406: Unknown result type (might be due to invalid IL or missing references)
		//IL_040b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0411: Unknown result type (might be due to invalid IL or missing references)
		//IL_0495: Unknown result type (might be due to invalid IL or missing references)
		//IL_049a: Unknown result type (might be due to invalid IL or missing references)
		//IL_04a0: Unknown result type (might be due to invalid IL or missing references)
		//IL_0657: Unknown result type (might be due to invalid IL or missing references)
		//IL_065c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0705: Unknown result type (might be due to invalid IL or missing references)
		//IL_070a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0710: Unknown result type (might be due to invalid IL or missing references)
		//IL_0607: Unknown result type (might be due to invalid IL or missing references)
		//IL_060c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0612: Unknown result type (might be due to invalid IL or missing references)
		//IL_080c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0811: Unknown result type (might be due to invalid IL or missing references)
		EquipmentTick();
		WarlockCombat warlockCombat = WarlockCombat.For(Player);
		bool flag = Player.data.playerActions != null && ((OneAxisInputControl)Player.data.playerActions.Down).IsPressed;
		if (Has("Crackshot"))
		{
			Player val = (from p in Enemies(Vector2.op_Implicit(((Component)Player).transform.position), 30f).Where(delegate(Player p)
				{
					//IL_0018: Unknown result type (might be due to invalid IL or missing references)
					//IL_001d: Unknown result type (might be due to invalid IL or missing references)
					//IL_002d: Unknown result type (might be due to invalid IL or missing references)
					//IL_0032: Unknown result type (might be due to invalid IL or missing references)
					//IL_0037: Unknown result type (might be due to invalid IL or missing references)
					//IL_003c: 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_0045: Unknown result type (might be due to invalid IL or missing references)
					if (GuardianCombat.For(p).InvisibleRemaining <= 0f)
					{
						Vector2 val5 = Vector2.op_Implicit(((Component)p).transform.position) - Vector2.op_Implicit(((Component)Player).transform.position);
						return Vector2.Dot(((Vector2)(ref val5)).normalized, Aim) > 0.97f;
					}
					return false;
				})
				orderby Vector2.Distance(Vector2.op_Implicit(((Component)p).transform.position), Vector2.op_Implicit(((Component)Player).transform.position))
				select p).FirstOrDefault();
			if (Object.op_Implicit((Object)(object)val) && aimedId == val.playerID)
			{
				aimTime += dt;
			}
			else
			{
				aimedId = (Object.op_Implicit((Object)(object)val) ? val.playerID : (-1));
				aimTime = 0f;
			}
		}
		if (TimeLeft("grapple-window") <= 0f)
		{
			SetCount("grapple-pulls", 0);
		}
		if (TimeLeft("icarus-window") <= 0f)
		{
			SetCount("icarus-pulls", 0);
		}
		if (TimeLeft("grapple") > 0f && !warlockCombat.MovementLocked)
		{
			Vector2 val2 = grapplePoint - Vector2.op_Implicit(((Component)Player).transform.position);
			RaycastHit2D val3 = TerrainSight.Sweep(Vector2.op_Implicit(((Component)Player).transform.position), new Vector2(1f, 1.5f), ((Vector2)(ref val2)).normalized, ((Vector2)(ref val2)).magnitude);
			float num = (Object.op_Implicit((Object)(object)((RaycastHit2D)(ref val3)).collider) ? Mathf.Max(0f, ((RaycastHit2D)(ref val3)).distance - 0.08f) : ((Vector2)(ref val2)).magnitude);
			NativeMotion.Set(Player.data.playerVel, ((Vector2)(ref val2)).normalized * Mathf.Min(22f, num / Mathf.Max(0.01f, dt)));
		}
		if (TimeLeft("dive") > 0f && !warlockCombat.MovementLocked)
		{
			RaycastHit2D val4 = TerrainSight.Sweep(Vector2.op_Implicit(((Component)Player).transform.position), new Vector2(1f, 1.5f), Vector2.down, Mathf.Max(0.2f, 26f * dt));
			if (Player.data.isGrounded || Object.op_Implicit((Object)(object)((RaycastHit2D)(ref val4)).collider))
			{
				LandDive(Vector2.op_Implicit(((Component)Player).transform.position));
			}
			else
			{
				NativeMotion.Set(Player.data.playerVel, new Vector2(0f, -26f));
			}
		}
		else if (diveAspect != null)
		{
			diveAspect = null;
		}
		if (TimeLeft("consecration") > 0f && TimeLeft("consecration-windup") <= 0f && flag)
		{
			if (Player.data.isGrounded)
			{
				Spawn("Consecration", "solar-slam", Vector2.op_Implicit(((Component)Player).transform.position), Horizontal(Aim), Value("consecration"), 0.7f, 1.5f);
				Buff("consecration", 0f, 0f);
			}
			else
			{
				NativeMotion.Set(Player.data.playerVel, new Vector2(Aim.x * 5f, -22f));
			}
		}
		if (Has("LightningSurge") && slideWas > 0f && warlockCombat.SlideRemaining <= 0f && Ready("LightningSurge", 6f))
		{
			Cast("LightningSurge", Vector2.op_Implicit(((Component)Player).transform.position), Aim);
		}
		slideWas = warlockCombat.SlideRemaining;
		if (Has("Cryoclasm") && flag && Player.data.isGrounded && Mathf.Abs(Player.data.input.direction.x) > 0.1f && Ready("Cryoclasm", 5f))
		{
			Cast("Cryoclasm", Vector2.op_Implicit(((Component)Player).transform.position), Aim);
		}
		if (TimeLeft("cryo-slide") > 0f && !warlockCombat.MovementLocked)
		{
			NativeMotion.Set(Player.data.playerVel, new Vector2(Value("cryo-slide") * 24f, NativeMotion.Get(Player.data.playerVel).y));
			ShatterCrystals(Vector2.op_Implicit(((Component)Player).transform.position), 2f);
		}
		bool flag2 = Player.data.isGrounded && Vector2.Dot(Vector2.op_Implicit(Player.data.input.direction), Horizontal(Aim)) > 0.5f;
		forwardTime = (flag2 ? (forwardTime + dt) : 0f);
		if (!flag2 && TimeLeft("juggernaut") > 0f)
		{
			Buff("juggernaut", 0f, 0f);
		}
		if (Has("Juggernaut") && forwardTime > 0.8f && TimeLeft("juggernaut") <= 0f && Ready("Juggernaut", 6f))
		{
			Cast("Juggernaut", Vector2.op_Implicit(((Component)Player).transform.position), Aim);
		}
		if (Count("weave-pet") > 0 && TimeLeft("weave") <= 0f)
		{
			SetCount("weave-pet", 0);
			Pet(Vector2.op_Implicit(((Component)Player).transform.position), Bullet * 0.6f, "Weavewalk");
		}
		if (Count("guard-blast") > 0 && (TimeLeft("guard") <= 0f || (Player.data.playerActions != null && !((OneAxisInputControl)Player.data.playerActions.Block).IsPressed)))
		{
			SetCount("guard-blast", 0);
			Buff("guard", 0f, 0f);
			Spawn("Unbreakable", "void-blast", Vector2.op_Implicit(((Component)Player).transform.position), Aim, Mathf.Min(Bullet * 0.6f, Bullet * 0.2f + GetCaught() * 0.4f), 0.3f, 0.8f);
		}
		if (!(TimeLeft("banner") > 0f) || !Ready("banner-tick", 1f) || Count("banner-heals") >= 10)
		{
			return;
		}
		Add("banner-heals");
		foreach (Player item in PlayerManager.instance.players.Where((Player p) => p.teamID == Player.teamID && p.data.isPlaying && !p.data.dead && Vector2.Distance(Vector2.op_Implicit(((Component)p).transform.position), Vector2.op_Implicit(((Component)Player).transform.position)) < 4f && TerrainSight.Clear(Vector2.op_Implicit(((Component)Player).transform.position), Vector2.op_Implicit(((Component)p).transform.position))))
		{
			Status(item, "heal", 0f, 4f);
		}
		Flash("BannerofWar", Vector2.op_Implicit(((Component)Player).transform.position));
	}

	public void CancelDefence()
	{
		if (Owner && TimeLeft("weave") > 0f)
		{
			Buff("weave", 0f, 0f);
		}
	}

	public bool SpecialShot(ref bool result)
	{
		//IL_005c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0061: Unknown result type (might be due to invalid IL or missing references)
		//IL_0067: Unknown result type (might be due to invalid IL or missing references)
		if (!Owner || TimeLeft("lance") <= 0f)
		{
			return false;
		}
		Buff("lance-use", 0f, 0f);
		Buff("lance", 0f, 0f);
		Spawn("DiamondLance", "lance", Vector2.op_Implicit(((Component)Player).transform.position), Aim, Bullet * 0.4f, 2f, 0.25f);
		result = true;
		return true;
	}

	public void WeaponHit(Player target, float damage, bool gun, int serial, float healthBefore = -1f)
	{
		//IL_008f: 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_009a: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a1: 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_0149: 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_01a7: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a9: Unknown result type (might be due to invalid IL or missing references)
		//IL_0329: Unknown result type (might be due to invalid IL or missing references)
		//IL_032b: Unknown result type (might be due to invalid IL or missing references)
		//IL_03ad: Unknown result type (might be due to invalid IL or missing references)
		//IL_03af: Unknown result type (might be due to invalid IL or missing references)
		//IL_0472: Unknown result type (might be due to invalid IL or missing references)
		//IL_0474: Unknown result type (might be due to invalid IL or missing references)
		//IL_0562: Unknown result type (might be due to invalid IL or missing references)
		//IL_0567: Unknown result type (might be due to invalid IL or missing references)
		if (!Owner || !Active || !Object.op_Implicit((Object)(object)target) || !gun || damage <= 0f || float.IsNaN(damage) || float.IsInfinity(damage))
		{
			return;
		}
		ChargeWeaponDamage(target, damage);
		long item = ((long)serial << 32) | (uint)target.playerID;
		if (!countedShots.Add(item))
		{
			return;
		}
		if (countedShots.Count > 256)
		{
			countedShots.Clear();
			countedShots.Add(item);
		}
		Vector2 val = Vector2.op_Implicit(((Component)Player).transform.position);
		bool flag = Vector2.Distance(val, Vector2.op_Implicit(((Component)target).transform.position)) < 6f;
		if (Has("OnYourMark"))
		{
			int num = Math.Min(3, (!(TimeLeft("reload") > 0f)) ? 1 : (Count("marks") + 1));
			SetCount("marks", num);
			Buff("reload", 3f, (float)num * 0.08f);
		}
		if (Has("FlowState") && combat.ArcRemaining > 0f && Ready("FlowState", 4f))
		{
			Cast("FlowState", val, Aim);
		}
		if (Has("LethalCurrent") && TimeLeft("lethal-ready") > 0f && flag && Ready("LethalCurrent", 5f))
		{
			Buff("lethal-ready", 0f, 0f);
			Cast("LethalCurrent", val, Aim, target.playerID);
		}
		if (Has("StylishExecutioner") && TimeLeft("stylish-shot") > 0f)
		{
			Buff("stylish-shot", 0f, 0f);
			Status(target, "weak", 2f, 0.1f);
		}
		if (Has("HeatRises") && !Player.data.isGrounded && WarlockCombat.For(Player).GlideRemaining > 0f)
		{
			if (glideExtended < 1f)
			{
				Buff("glide", Mathf.Min(3f, WarlockCombat.For(Player).GlideRemaining + 0.25f), 0f);
				glideExtended += 0.25f;
			}
			if (Ready("heat-heal", 2f))
			{
				Heal(3f);
			}
		}
		if (TimeLeft("devour") > 0f && Count("devour-heals") < 6 && Ready("devour-tick", 0.5f))
		{
			Add("devour-heals");
			Heal(3f);
		}
		if (TimeLeft("child-ready") > 0f)
		{
			Buff("child-ready", 0f, 0f);
			Spawn("ChildoftheOldGods", "child", val, Aim, Bullet * 0.15f, 3f, 2.5f, target.playerID);
		}
		if (Has("SoulSiphon") && flag)
		{
			Buff("siphon-ready", 3f, 1f);
		}
		if (Has("IceflareBolts") && WarlockCombat.For(target).FrozenRemaining > 0f && Ready("IceflareBolts", 6f))
		{
			Cast("IceflareBolts", val, Aim, target.playerID);
		}
		if (TimeLeft("knockout") > 0f && flag)
		{
			Buff("knockout", 0f, 0f);
			Deal(target, Bullet * 0.2f, Element.Arc);
			Heal(5f);
		}
		if (Has("Knockout") && (healthBefore < 0f || healthBefore >= target.data.maxHealth * 0.5f) && target.data.health < target.data.maxHealth * 0.5f && Ready("Knockout", 7f))
		{
			Cast("Knockout", val, Aim);
		}
		if (Has("OffensiveBulwark") && flag && TitanCombat.For(Player).Overshield > 0f && Count("bulwark-refunds") < 2)
		{
			Add("bulwark-refunds");
			Buff("preserve-shield", 0f, 0.4f);
		}
		if (Has("ControlledDemolition"))
		{
			if (Count("volatile-target") == target.playerID + 1 && TimeLeft("volatile-mark") > 0f)
			{
				SetCount("volatile-target", 0);
				Buff("volatile-mark", 0f, 0f);
				Deal(target, Bullet * 0.25f, Element.Void);
				Heal(5f);
				Flash("ControlledDemolition", Vector2.op_Implicit(((Component)target).transform.position));
			}
			else if (TimeLeft("volatile-ready") > 0f)
			{
				Buff("volatile-ready", 0f, 0f);
				SetCount("volatile-target", target.playerID + 1);
				Buff("volatile-mark", 3f, 1f);
				Status(target, "volatile", 3f, 1f);
			}
		}
		EquipmentHit(target);
		ReleasePerches();
	}

	public void HammerHit(Player target, int id)
	{
		//IL_005b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0060: Unknown result type (might be due to invalid IL or missing references)
		//IL_0066: Unknown result type (might be due to invalid IL or missing references)
		if (!Owner || !Active || !Object.op_Implicit((Object)(object)target))
		{
			return;
		}
		string text = "hammer-" + id;
		if (Count(text) <= 0)
		{
			SetCount(text, 1);
			if (Has("RoaringFlames"))
			{
				Cast("RoaringFlames", Vector2.op_Implicit(((Component)Player).transform.position), Aim);
			}
			WeaponHit(target, Bullet, gun: false, id);
		}
	}

	public void HammerImpact(Vector2 pos)
	{
		//IL_002d: Unknown result type (might be due to invalid IL or missing references)
		//IL_002f: Unknown result type (might be due to invalid IL or missing references)
		if (Owner && Has("SolInvictus") && Ready("SolInvictus", 6f))
		{
			Cast("SolInvictus", pos, Aim);
		}
	}

	public void Froze(Player target)
	{
		//IL_0041: Unknown result type (might be due to invalid IL or missing references)
		//IL_0046: Unknown result type (might be due to invalid IL or missing references)
		//IL_004c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0084: Unknown result type (might be due to invalid IL or missing references)
		//IL_0089: 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)
		if (Owner && Active)
		{
			if (Has("Frostpulse") && Ready("Frostpulse", 6f))
			{
				Cast("Frostpulse", Vector2.op_Implicit(((Component)Player).transform.position), Aim);
			}
			if (Has("GlacialHarvest") && Ready("GlacialHarvest", 6f))
			{
				Cast("GlacialHarvest", Vector2.op_Implicit(((Component)target).transform.position), Aim);
			}
		}
	}

	public void CrystalShattered(Vector2 position)
	{
		//IL_0036: 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_0075: Unknown result type (might be due to invalid IL or missing references)
		//IL_007a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0080: Unknown result type (might be due to invalid IL or missing references)
		if (Owner && Active)
		{
			if (Has("TectonicHarvest") && Ready("TectonicHarvest", 6f))
			{
				Cast("TectonicHarvest", position, Aim);
			}
			if (Has("DiamondLance") && Ready("DiamondLance", 8f))
			{
				Cast("DiamondLance", Vector2.op_Implicit(((Component)Player).transform.position), Aim);
			}
		}
	}

	public void AirJumped()
	{
		//IL_0026: Unknown result type (might be due to invalid IL or missing references)
		//IL_002b: Unknown result type (might be due to invalid IL or missing references)
		if (Owner && Active)
		{
			GearTrigger("CyrtarachnesFacade", 5f, Vector2.op_Implicit(((Component)Player).transform.position));
		}
		if (Owner && Has("LethalCurrent"))
		{
			Buff("lethal-ready", 2f, 1f);
		}
	}

	public void Cloaked()
	{
		//IL_0021: Unknown result type (might be due to invalid IL or missing references)
		//IL_0026: Unknown result type (might be due to invalid IL or missing references)
		//IL_0070: Unknown result type (might be due to invalid IL or missing references)
		//IL_0075: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
		if (!Owner)
		{
			return;
		}
		GearTrigger("GravitonForfeit", 5f, Vector2.op_Implicit(((Component)Player).transform.position));
		if (Has("StylishExecutioner"))
		{
			Buff("stylish-shot", 3f, 1f);
		}
		if (Has("OntheProwl"))
		{
			Player val = (from t in Enemies(Vector2.op_Implicit(((Component)Player).transform.position), 20f)
				where GuardianCombat.For(t).InvisibleRemaining <= 0f
				orderby Vector2.Distance(Vector2.op_Implicit(((Component)t).transform.position), Vector2.op_Implicit(((Component)Player).transform.position))
				select t).FirstOrDefault();
			if (Object.op_Implicit((Object)(object)val))
			{
				SetCount("quarry", val.playerID + 1);
				Flash("OntheProwl", Vector2.op_Implicit(((Component)val).transform.position));
			}
		}
	}

	internal void PetHit(Vector2 pos)
	{
		//IL_0025: Unknown result type (might be due to invalid IL or missing references)
		//IL_0027: Unknown result type (might be due to invalid IL or missing references)
		if (Has("TheWanderer") && Ready("TheWanderer", 8f))
		{
			Cast("TheWanderer", pos, Aim);
		}
	}

	internal void Perch()
	{
		if (Has("WeaversCall"))
		{
			SetCount("perched", Math.Min(4, Count("perched") + 1));
		}
	}

	public void Fired()
	{
		if (Owner && Active)
		{
			ReleasePerches();
		}
	}

	private void ReleasePerches()
	{
		//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)
		int num = Count("perched");
		if (num > 0 && Has("WeaversCall"))
		{
			SetCount("perched", 0);
			for (int i = 0; i < num; i++)
			{
				Pet(Vector2.op_Implicit(((Component)Player).transform.position), Bullet * 0.2f, "WeaversCall");
			}
		}
	}

	internal void Pickup(string aspect)
	{
		//IL_0073: Unknown result type (might be due to invalid IL or missing references)
		//IL_0078: Unknown result type (might be due to invalid IL or missing references)
		switch (aspect)
		{
		case "EmberofSearing":
			Heal(4f);
			break;
		case "ElectrostaticMind":
		case "SparkofIons":
			Buff("speed", 2f, 0.15f);
			Refund();
			break;
		default:
			Buff("armour", 3f, 0.1f);
			break;
		}
		Flash(aspect, Vector2.op_Implicit(((Component)Player).transform.position), 1.2f);
	}

	public static AspectCombat For(Player player)
	{
		AspectCombat component = ((Component)player).GetComponent<AspectCombat>();
		if (!Object.op_Implicit((Object)(object)component))
		{
			return ((Component)player).gameObject.AddComponent<AspectCombat>();
		}
		return component;
	}

	private void Awake()
	{
		Player = ((Component)this).GetComponent<Player>();
		combat = GuardianCombat.For(Player);
		((Component)this).gameObject.AddComponent<AspectStatusVisuals>();
	}

	private void Start()
	{
		Block block = Player.data.block;
		block.BlockAction = (Action<BlockTriggerType>)Delegate.Combine(block.BlockAction, new Action<BlockTriggerType>(Blocked));
		HealthHandler healthHandler = Player.data.healthHandler;
		healthHandler.reviveAction = (Action)Delegate.Combine(healthHandler.reviveAction, new Action(Clear));
		Player.data.view.RefreshRpcMonoBehaviourCache();
	}

	public bool Has(string id)
	{
		GuardianState component = ((Component)this).GetComponent<GuardianState>();
		if (Object.op_Implicit((Object)(object)component) && component.Acquired.Contains(id))
		{
			return Player.data.currentCards.Any((CardInfo c) => Object.op_Implicit((Object)(object)c) && Object.op_Implicit((Object)(object)((Component)c).GetComponent<DestinyCard>()) && ((Component)c).GetComponent<DestinyCard>().Id == id);
		}
		return false;
	}

	public float TimeLeft(string key)
	{
		if (!times.TryGetValue(key, out var value))
		{
			return 0f;
		}
		return value;
	}

	public float Value(string key)
	{
		if (!(TimeLeft(key) > 0f) || !values.TryGetValue(key, out var value))
		{
			return 0f;
		}
		return value;
	}

	public float Cooldown(string key)
	{
		if (!cooldowns.TryGetValue(key, out var value))
		{
			return 0f;
		}
		return value;
	}

	public int Count(string key)
	{
		if (!counts.TryGetValue(key, out var value))
		{
			return 0;
		}
		return value;
	}

	public bool Ready(string id, float seconds)
	{
		if (Cooldown(id) > 0f)
		{
			return false;
		}
		cooldowns[id] = PowerBalance.Cooldown(seconds);
		return true;
	}

	internal int Add(string id, int n = 1)
	{
		return counts[id] = Count(id) + n;
	}

	internal void SetCount(string id, int n)
	{
		counts[id] = n;
	}

	public void NewShot()
	{
		ShotSerial++;
	}

	public void Clear()
	{
		cooldowns.Clear();
		times.Clear();
		values.Clear();
		counts.Clear();
		damageCharge.Clear();
		countedShots.Clear();
		forwardTime = (aimTime = (slideWas = (glideExtended = 0f)));
		aimedId = -1;
		diveAspect = null;
		AspectEntity.Clear(Player.playerID);
	}

	public void Advance(float dt)
	{
		string[] array = cooldowns.Keys.ToArray();
		foreach (string key in array)
		{
			cooldowns[key] = Mathf.Max(0f, cooldowns[key] - dt);
		}
		string[] array2 = times.Keys.ToArray();
		foreach (string key2 in array2)
		{
			times[key2] = Mathf.Max(0f, times[key2] - dt);
		}
		if (Value("shield") > 0f)
		{
			values["shield"] = Mathf.Max(0f, values["shield"] - 2.5f * dt);
		}
	}

	private void Update()
	{
		if (!Active)
		{
			if (times.Count > 0 || cooldowns.Count > 0 || counts.Count > 0)
			{
				Clear();
			}
			return;
		}
		Advance(TimeHandler.deltaTime);
		if (Owner)
		{
			TickActions(TimeHandler.deltaTime);
		}
	}

	internal void Buff(string key, float duration, float amount)
	{
		if (PhotonNetwork.OfflineMode)
		{
			ReceiveStatus(Player.playerID, key, duration, amount);
			return;
		}
		Player.data.view.RPC("GuardianPaths_AspectStatus", (RpcTarget)0, new object[4] { Player.playerID, key, duration, amount });
	}

	internal void Status(Player target, string key, float duration, float amount)
	{
		if (Object.op_Implicit((Object)(object)target) && Owner)
		{
			if (PhotonNetwork.OfflineMode)
			{
				ReceiveStatus(target.playerID, key, duration, amount);
				return;
			}
			Player.data.view.RPC("GuardianPaths_AspectStatus", (RpcTarget)0, new object[4] { target.playerID, key, duration, amount });
		}
	}

	private void ReceiveStatus(int id, string key, float duration, float amount)
	{
		//IL_0090: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a4: Unknown result type (might be due to invalid IL or missing references)
		//IL_03bf: Unknown result type (might be due to invalid IL or missing references)
		Player val = Find(id);
		if (!Object.op_Implicit((Object)(object)val) || !val.data.isPlaying || val.data.dead)
		{
			return;
		}
		AspectCombat aspectCombat = For(val);
		duration = PowerBalance.Duration(key, duration);
		amount = PowerBalance.Strength(key, amount);
		switch (key)
		{
		case "scorch":
		case "unravel":
			GuardianCombat.For(val).ApplyScorch(Player, duration, amount, (!(key == "unravel")) ? Element.Solar : Element.Strand);
			AbilityFx.Emit(((Component)val).gameObject, key, ((Component)val).transform.position, (!(key == "unravel")) ? Element.Solar : Element.Strand, 1f);
			return;
		case "vortex-enhance":
			WarlockCombat.For(val).EnhanceVortex();
			return;
		case "preserve-shield":
			TitanCombat.For(val).PreserveShield(amount);
			return;
		case "ammo":
			RefundAmmo(val);
			return;
		case "lance-use":
			UseLanceAmmo(val);
			return;
		case "heal":
			val.data.healthHandler.Heal(Mathf.Min(amount * 2.5f, 30f));
			return;
		case "refund":
		{
			Block block = val.data.block;
			block.counter += Mathf.Min(amount * 2f, 0.9f);
			return;
		}
		case "slow":
			GuardianCombat.For(val).ApplySlow(SlowDuration(duration));
			AbilityFx.Emit(((Component)val).gameObject, "aspect-slow", ((Component)val).transform.position, Element.Stasis, 1f);
			return;
		case "freeze":
		case "suspend":
			if (WarlockCombat.For(val).TryControl(duration, key == "suspend"))
			{
				Froze(val);
			}
			return;
		case "cloak":
			GuardianCombat.For(val).GrantCloak(duration);
			return;
		case "shatter":
			WarlockCombat.For(val).EndControl();
			return;
		case "glide":
			WarlockCombat.For(val).ExtendGlide(duration);
			return;
		case "reload":
		case "speed":
		case "armour":
		case "mail":
		case "radiant":
			duration = Mathf.Max(duration, aspectCombat.TimeLeft(key));
			amount = Mathf.Max(amount, aspectCombat.Value(key));
			break;
		}
		aspectCombat.times[key] = duration;
		aspectCombat.values[key] = amount;
		if (!(duration > 0f))
		{
			return;
		}
		switch (key)
		{
		case "reload":
		case "speed":
		case "armour":
		case "mail":
		case "weak":
		case "shield":
		case "volatile":
		case "stylish-shot":
		case "radiant":
		case "sever":
		{
			int num;
			switch (key)
			{
			default:
				num = 3;
				break;
			case "reload":
			case "radiant":
				num = 1;
				break;
			case "sever":
				num = 5;
				break;
			case "speed":
				num = 2;
				break;
			case "mail":
				num = 5;
				break;
			case "armour":
				num = 4;
				break;
			}
			Element e = (Element)num;
			AbilityFx.Emit(((Component)val).gameObject, "aspect-" + key, ((Component)val).transform.position, e, 0.9f);
			break;
		}
		}
	}

	[PunRPC]
	private void GuardianPaths_AspectStatus(int id, string key, float duration, float amount, PhotonMessageInfo info)
	{
		if (info.Sender == Player.data.view.Owner && !float.IsNaN(amount) && !float.IsInfinity(amount))
		{
			ReceiveStatus(id, key, duration, amount);
		}
	}

	public bool Deal(Player target, float damage, Element element, string status = null, float duration = 0f)
	{
		if (!Owner || !Active || !Object.op_Implicit((Object)(object)target) || target.teamID == Player.teamID || target.data.dead || !target.data.isPlaying || damage < 0f || target.data.block.IsBlocking())
		{
			return false;
		}
		damage *= 2.5f * (1f + Value("flames"));
		if (PhotonNetwork.OfflineMode)
		{
			ReceiveDamage(target.playerID, damage, (int)element);
		}
		else
		{
			Player.data.view.RPC("GuardianPaths_AspectDamage", (RpcTarget)0, new object[3]
			{
				target.playerID,
				damage,
				(int)element
			});
		}
		if (status != null)
		{
			Status(target, status, duration, 0f);
		}
		return true;
	}

	private void ReceiveDamage(int id, float damage, int element)
	{
		//IL_0041: Unknown result type (might be due to invalid IL or missing references)
		//IL_0047: Unknown result type (might be due to invalid IL or missing references)
		//IL_0052: Unknown result type (might be due to invalid IL or missing references)
		//IL_0057: Unknown result type (might be due to invalid IL or missing references)
		//IL_005d: 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)
		Player val = Find(id);
		if (Object.op_Implicit((Object)(object)val) && !val.data.dead && val.data.isPlaying)
		{
			bool statusDamage = GuardianCombat.StatusDamage;
			GuardianCombat.StatusDamage = true;
			try
			{
				((Damagable)val.data.healthHandler).TakeDamage(Vector2.right * damage, Vector2.op_Implicit(((Component)val).transform.position), AbilityFx.Colour((Element)element), (GameObject)null, Player, true, false);
			}
			finally
			{
				GuardianCombat.StatusDamage = statusDamage;
			}
			AbilityFx.Emit(((Component)val).gameObject, "aspect-impact-" + (Element)element, ((Component)val).transform.position, (Element)element, 0.8f);
		}
	}

	[PunRPC]
	private void GuardianPaths_AspectDamage(int id, float damage, int element, PhotonMessageInfo info)
	{
		if (info.Sender == Player.data.view.Owner && damage >= 0f && !float.IsInfinity(damage) && !float.IsNaN(damage))
		{
			ReceiveDamage(id, damage, element);
		}
	}

	internal static Player Find(int id)
	{
		return ((IEnumerable<Player>)PlayerManager.instance.players).FirstOrDefault((Func<Player, bool>)((Player p) => p.playerID == id));
	}

	internal IEnumerable<Player> Enemies(Vector2 pos, float radius)
	{
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		//IL_0008: Unknown result type (might be due to invalid IL or missing references)
		return PlayerManager.instance.players.Where((Player p) => Object.op_Implicit((Object)(object)p) && p.teamID != Player.teamID && p.data.isPlaying && !p.data.dead && Vector2.Distance(Vector2.op_Implicit(((Component)p).transform.position), pos) <= radius && TerrainSight.Clear(pos, Vector2.op_Implicit(((Component)p).transform.position)));
	}

	internal void Area(Vector2 pos, float radius, float damage, Element e, string status = null, float duration = 0f)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		Player[] array = Enemies(pos, radius).ToArray();
		foreach (Player target in array)
		{
			Deal(target, damage, e, status, duration);
		}
	}

	internal void Heal(float hp)
	{
		Status(Player, "heal", 0f, hp);
	}

	internal void Refund()
	{
		Status(Player, "refund", 0f, 0.35f);
	}

	internal void Flash(string id, Vector2 pos, float size = 2f)
	{
		//IL_000e: Unknown result type (might be due to invalid IL or missing references)
		//IL_000f: Unknown result type (might be due to invalid IL or missing references)
		//IL_001c: Unknown result type (might be due to invalid IL or missing references)
		//IL_001e: Unknown result type (might be due to invalid IL or missing references)
		Element e = EquipmentCatalog.ElementOf(id);
		AbilityFx.Emit(((Component)this).gameObject, id, Vector2.op_Implicit(pos), e, size);
		AspectVisuals.Cast(id, pos, Aim);
	}

	public bool Cast(string id, Vector2 pos, Vector2 aim, int target = -1, int variant = 0)
	{
		//IL_0065: 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_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)
		if (!Owner || !Active || !Has(id))
		{
			return false;
		}
		if (PhotonNetwork.OfflineMode)
		{
			ReceiveCast(id, pos, aim, target, variant, ++sequence);
		}
		else
		{
			Player.data.view.RPC("GuardianPaths_AspectCast", (RpcTarget)0, new object[6]
			{
				id,
				pos,
				aim,
				target,
				variant,
				++sequence
			});
		}
		return true;
	}

	private void ReceiveCast(string id, Vector2 pos, Vector2 aim, int target, int variant, int serial)
	{
		//IL_0034: Unknown result type (might be due to invalid IL or missing references)
		//IL_0041: Unknown result type (might be due to invalid IL or missing references)
		//IL_0042: Unknown result type (might be due to invalid IL or missing references)
		if (serial > receivedSequence && Has(id) && Active)
		{
			receivedSequence = serial;
			Casts++;
			Flash(id, pos);
			ApplyCast(id, pos, aim, target, variant);
		}
	}

	[PunRPC]
	private void GuardianPaths_AspectCast(string id, Vector2 pos, Vector2 aim, int target, int variant, int serial, PhotonMessageInfo info)
	{
		//IL_0020: Unknown result type (might be due to invalid IL or missing references)
		//IL_0021: Unknown result type (might be due to invalid IL or missing references)
		if (info.Sender == Player.data.view.Owner)
		{
			ReceiveCast(id, pos, aim, target, variant, serial);
		}
	}

	internal void Spawn(string aspect, string kind, Vector2 pos, Vector2 direction, float damage, float life, float radius, int target = -1)
	{
		//IL_007c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0085: Unknown result type (might be due to invalid IL or missing references)
		//IL_003a: Unknown result type (might be due to invalid IL or missing references)
		//IL_003b: Unknown result type (might be due to invalid IL or missing references)
		if (Owner)
		{
			life = PowerBalance.Life(kind, life);
			radius = PowerBalance.Radius(kind, radius);
			int num = ++entitySequence;
			if (PhotonNetwork.OfflineMode)
			{
				AspectEntity.Create(this, num, aspect, kind, pos, direction, damage, life, radius, target);
				return;
			}
			Player.data.view.RPC("GuardianPaths_AspectEntity", (RpcTarget)0, new object[9] { num, aspect, kind, pos, direction, damage, life, radius, target });
		}
	}

	[PunRPC]
	private void GuardianPaths_AspectEntity(int id, string aspect, string kind, Vector2 pos, Vector2 direction, float damage, float life, float radius, int target, PhotonMessageInfo info)
	{
		//IL_002b: Unknown result type (might be due to invalid IL or missing references)
		//IL_002d: Unknown result type (might be due to invalid IL or missing references)
		if (info.Sender == Player.data.view.Owner && Has(aspect))
		{
			AspectEntity.Create(this, id, aspect, kind, pos, direction, damage, life, radius, target);
		}
	}

	[PunRPC]
	private void GuardianPaths_AspectEntityMove(int id, Vector2 pos, bool alive, PhotonMessageInfo info)
	{
		//IL_002a: Unknown result type (might be due to invalid IL or missing references)
		if (info.Sender == Player.data.view.Owner)
		{
			AspectEntity.Receive(Player.playerID, id, pos, alive);
		}
	}

	[PunRPC]
	private void GuardianPaths_AspectEntityHit(int id, int shooter, float damage, PhotonMessageInfo info)
	{
		Player val = Find(shooter);
		if (Owner && Object.op_Implicit((Object)(object)val) && val.data.view.Owner == info.Sender)
		{
			AspectEntity.Shot(Player.playerID, id, val, damage);
		}
	}

	internal void EntityMove(int id, Vector2 pos, bool alive)
	{
		//IL_002f: Unknown result type (might be due to invalid IL or missing references)
		if (!PhotonNetwork.OfflineMode)
		{
			Player.data.view.RPC("GuardianPaths_AspectEntityMove", (RpcTarget)1, new object[3] { id, pos, alive });
		}
	}

	internal void Pet(Vector2 pos, float damage, string aspect)
	{
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		//IL_0008: Unknown result type (might be due to invalid IL or missing references)
		Spawn(aspect, "pet", pos, Vector2.zero, Mathf.Max(damage, Bullet * 0.6f), 5f, 0.3f);
	}

	public float Incoming(float amount, Vector2 direction)
	{
		//IL_0102: Unknown result type (might be due to invalid IL or missing references)
		//IL_0107: Unknown result type (might be due to invalid IL or missing references)
		//IL_010d: Unknown result type (might be due to invalid IL or missing references)
		//IL_029a: Unknown result type (might be due to invalid IL or missing references)
		//IL_01f8: Unknown result type (might be due to invalid IL or missing references)
		LastAbsorbed = 0f;
		if (!Active)
		{
			return amount;
		}
		float num = Mathf.Max(Mathf.Max(Value("armour"), Value("mail")), EquipmentResistance);
		float damageReduction = combat.DamageReduction;
		num = Mathf.Min(num, Mathf.Max(0f, (0.55f - damageReduction) / Mathf.Max(0.01f, 1f - damageReduction)));
		if (TimeLeft("weave") > 0f)
		{
			num = 0.8f;
		}
		amount *= 1f - num;
		amount *= 1f + Value("weak");
		if (Owner && !GuardianCombat.StatusDamage && num > 0f && Ready("armour-refund", 2f) && (Has("GrimHarvest") || Has("TectonicHarvest") || Has("GlacialHarvest")))
		{
			Refund();
		}
		if (Vector2.Dot(-((Vector2)(ref direction)).normalized, Aim) > 0.1f && (TimeLeft("guard") > 0f || TimeLeft("juggernaut") > 0f))
		{
			string text = ((TimeLeft("guard") > 0f) ? "guard" : "juggernaut");
			float num2 = Mathf.Min(amount, Value(text));
			values[text] = Mathf.Max(0f, Value(text) - num2);
			amount -= num2;
			LastAbsorbed += num2;
			values["caught"] = Mathf.Min(Bullet, GetCaught() + num2);
			times["caught"] = 4f;
			if (num2 > 0f)
			{
				AbilityFx.Emit(((Component)this).gameObject, "guard-hit", ((Component)this).transform.position, (text == "guard") ? Element.Void : Element.Arc, 1f);
			}
			if (values[text] <= 0f)
			{
				times[text] = 0f;
			}
		}
		float num3 = Mathf.Min(amount, Value("shield"));
		if (num3 > 0f)
		{
			LastAbsorbed += num3;
			values["shield"] -= num3;
			AbilityFx.Emit(((Component)this).gameObject, "aspect-shield-hit", ((Component)this).transform.position, Element.Void, 1f);
		}
		EquipmentHurt(amount - num3);
		return amount - num3;
	}

	private float GetCaught()
	{
		if (!values.TryGetValue("caught", out var value))
		{
			return 0f;
		}
		return value;
	}

	public float Outgoing(Player target)
	{
		//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_0058: Unknown result type (might be due to invalid IL or missing references)
		//IL_005d: Unknown result type (might be due to invalid IL or missing references)
		return (1f + Value("flames") + EquipmentOutgoing(target) + ((Has("OffensiveBulwark") && TitanCombat.For(Player).Overshield > 0f && Vector2.Distance(Vector2.op_Implicit(((Component)Player).transform.position), Vector2.op_Implicit(((Component)target).transform.position)) < 8f) ? 0.3f : 0f)) * (1f - Mathf.Clamp01(Value("sever")));
	}

	private void OnDestroy()
	{
		if (Object.op_Implicit((Object)(object)Player) && Object.op_Implicit((Object)(object)Player.data))
		{
			Block block = Player.data.block;
			block.BlockAction = (Action<BlockTriggerType>)Delegate.Remove(block.BlockAction, new Action<BlockTriggerType>(Blocked));
			HealthHandler healthHandler = Player.data.healthHandler;
			healthHandler.reviveAction = (Action)Delegate.Remove(healthHandler.reviveAction, new Action(Clear));
		}
		if (Object.op_Implicit((Object)(object)Player))
		{
			AspectEntity.Clear(Player.playerID);
		}
	}

	private static void RefundAmmo(Player p)
	{
		GunAmmo componentInChildren = ((Component)p.data.weaponHandler.gun).GetComponentInChildren<GunAmmo>();
		if (Object.op_Implicit((Object)(object)componentInChildren))
		{
			FieldInfo fieldInfo = AccessTools.Field(typeof(GunAmmo), "currentAmmo");
			int num = (int)fieldInfo.GetValue(componentInChildren);
			int val = (int)AccessTools.Field(typeof(GunAmmo), "maxAmmo").GetValue(componentInChildren);
			fieldInfo.SetValue(componentInChildren, Math.Min(val, num + 1));
			AccessTools.Method(typeof(GunAmmo), "SetActiveBullets", (Type[])null, (Type[])null).Invoke(componentInChildren, new object[1] { false });
		}
	}

	private static void UseLanceAmmo(Player p)
	{
		Gun gun = p.data.weaponHandler.gun;
		AccessTools.Field(typeof(Weapon), "sinceAttack").SetValue(gun, 0f);
		GunAmmo componentInChildren = ((Component)gun).GetComponentInChildren<GunAmmo>();
		if (Object.op_Implicit((Object)(object)componentInChildren))
		{
			MethodInfo methodInfo = AccessTools.Method(typeof(GunAmmo), "Shoot", (Type[])null, (Type[])null);
			object[] parameters = new object[1];
			methodInfo.Invoke(componentInChildren, parameters);
		}
	}

	private bool GearTrigger(string id, float seconds, Vector2 pos, int target = -1)
	{
		//IL_0015: Unknown result type (might be due to invalid IL or missing references)
		//IL_0017: Unknown result type (might be due to invalid IL or missing references)
		if (Has(id) && Ready(id, seconds))
		{
			return Cast(id, pos, Aim, target);
		}
		return false;
	}

	private void EquipmentBlock(bool air)
	{
		//IL_0014: Unknown result type (might be due to invalid IL or missing references)
		//IL_0019: Unknown result type (might be due to invalid IL or missing references)
		//IL_001e: Unknown result type (might be due to invalid IL or missing references)
		//IL_002f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0047: Unknown result type (might be due to invalid IL or missing references)
		//IL_00fd: Unknown result type (might be due to invalid IL or missing references)
		//IL_0115: Unknown result type (might be due to invalid IL or missing references)
		//IL_012d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0145: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
		//IL_007a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0160: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
		Vector2 pos = Vector2.op_Implicit(((Component)Player).transform.position);
		GearTrigger("YoungAhamkarasSpine", 8f, pos);
		GearTrigger("RenewalGrasps", 7f, pos);
		if (Has("Sunbracers") && Count("Sunbracers") >= 2 && GearTrigger("Sunbracers", 8f, pos))
		{
			SpendCharge("Sunbracers");
		}
		if (Has("OsmiomancyGloves"))
		{
			Player val = (from p in Enemies(pos, 24f)
				orderby Vector2.Distance(pos, Vector2.op_Implicit(((Component)p).transform.position))
				select p).FirstOrDefault();
			if (Object.op_Implicit((Object)(object)val))
			{
				GearTrigger("OsmiomancyGloves", 7f, pos, val.playerID);
			}
		}
		GearTrigger("SecondChance", 7f, pos);
		GearTrigger("HoarfrostZ", 7f, pos);
		GearTrigger("AbeyantLeap", 8f, pos);
		GearTrigger("ThreadofWarding", 6f, pos);
		if (air)
		{
			GearTrigger("ThreadofAscent", 5f, pos);
		}
	}

	private bool ApplyEquipmentCast(string id, Vector2 pos, Vector2 aim, int target)
	{
		//IL_0258: Unknown result type (might be due to invalid IL or missing references)
		//IL_0259: 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_0264: Unknown result type (might be due to invalid IL or missing references)
		//IL_0269: Unknown result type (might be due to invalid IL or missing references)
		//IL_026e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0273: Unknown result type (might be due to invalid IL or missing references)
		//IL_0274: Unknown result type (might be due to invalid IL or missing references)
		//IL_0275: Unknown result type (might be due to invalid IL or missing references)
		//IL_02da: Unknown result type (might be due to invalid IL or missing references)
		//IL_02db: Unknown result type (might be due to invalid IL or missing references)
		//IL_02e0: 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_0321: Unknown result type (might be due to invalid IL or missing references)
		//IL_0448: Unknown result type (might be due to invalid IL or missing references)
		//IL_0449: Unknown result type (might be due to invalid IL or missing references)
		//IL_044e: Unknown result type (might be due to invalid IL or missing references)
		//IL_049b: Unknown result type (might be due to invalid IL or missing references)
		//IL_049c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0537: Unknown result type (might be due to invalid IL or missing references)
		//IL_0538: Unknown result type (might be due to invalid IL or missing references)
		//IL_0539: Unknown result type (might be due to invalid IL or missing references)
		//IL_0561: Unknown result type (might be due to invalid IL or missing references)
		//IL_0562: Unknown result type (might be due to invalid IL or missing references)
		//IL_05f0: Unknown result type (might be due to invalid IL or missing references)
		//IL_05f1: Unknown result type (might be due to invalid IL or missing references)
		//IL_0286: Unknown result type (might be due to invalid IL or missing references)
		//IL_0287: Unknown result type (might be due to invalid IL or missing references)
		//IL_027d: Unknown result type (might be due to invalid IL or missing references)
		//IL_027e: Unknown result type (might be due to invalid IL or missing references)
		//IL_03b4: Unknown result type (might be due to invalid IL or missing references)
		//IL_03bb: Unknown result type (might be due to invalid IL or missing references)
		//IL_03c0: 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_03c6: Unknown result type (might be due to invalid IL or missing references)
		//IL_03cb: Unknown result type (might be due to invalid IL or missing references)
		//IL_03cf: Unknown result type (might be due to invalid IL or missing references)
		//IL_0403: Unknown result type (might be due to invalid IL or missing references)
		//IL_040a: Unknown result type (might be due to invalid IL or missing references)
		//IL_040f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0414: Unknown result type (might be due to invalid IL or missing references)
		//IL_0415: Unknown result type (might be due to invalid IL or missing references)
		//IL_041a: Unknown result type (might be due to invalid IL or missing references)
		//IL_041e: Unknown result type (might be due to invalid IL or missing references)
		//IL_04be: Unknown result type (might be due to invalid IL or missing references)
		//IL_04bf: Unknown result type (might be due to invalid IL or missing references)
		//IL_04c6: Unknown result type (might be due to invalid IL or missing references)
		//IL_04d0: Unknown result type (might be due to invalid IL or missing references)
		//IL_04d5: Unknown result type (might be due to invalid IL or missing references)
		//IL_04da: Unknown result type (might be due to invalid IL or missing references)
		//IL_04df: Unknown result type (might be due to invalid IL or missing references)
		//IL_04e1: Unknown result type (might be due to invalid IL or missing references)
		//IL_04e2: Unknown result type (might be due to invalid IL or missing references)
		//IL_04f2: Unknown result type (might be due to invalid IL or missing references)
		//IL_04f4: Unknown result type (might be due to invalid IL or missing references)
		if (!EquipmentCatalog.All.ContainsKey(id))
		{
			return false;
		}
		Player val = Find(target);
		float bullet = Bullet;
		switch (id)
		{
		case "YoungAhamkarasSpine":
		{
			Vector2 val5 = GroundSpot(pos + Horizontal(aim) * 1.2f);
			if (!TerrainSight.Clear(pos, val5))
			{
				val5 = pos;
			}
			Spawn(id, "tripmine", val5, Vector2.zero, bullet * 0.45f, 3f, 2.5f);
			break;
		}
		case "LiarsHandshake":
			Buff("counterpunch", 3f, 1f);
			break;
		case "GravitonForfeit":
			Heal(3f);
			break;
		case "RenewalGrasps":
			Spawn(id, "renewal-field", GroundSpot(pos), Vector2.zero, 0f, 2f, 3f);
			break;
		case "CyrtarachnesFacade":
			Buff("mail", 2f, 0.15f);
			break;
		case "Sunbracers":
			Spawn(id, "fusion", pos, aim, bullet * 0.2f, 1.4f, 2.5f);
			break;
		case "CrownofTempests":
			Buff("speed", 2f, 0.12f);
			Buff("reload", 2f, 0.2f);
			Refund();
			break;
		case "NezarecsSin":
			Buff("reload", 2f, 0.12f);
			Buff("refund", 0f, 0.2f);
			break;
		case "OsmiomancyGloves":
			if (Object.op_Implicit((Object)(object)val))
			{
				Vector2 val4 = Vector2.op_Implicit(((Component)val).transform.position) - pos;