Decompiled source of BFRM v1.15.2

bellusfennec-BFRM.dll

Decompiled a day ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using CardChoiceSpawnUniqueCardPatch.CustomCategories;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using ModdingUtils.Utils;
using MrFuntikMod.Cards;
using MrFuntikMod.Effects;
using Photon.Pun;
using UnboundLib;
using UnboundLib.Cards;
using UnboundLib.Networking;
using UnityEngine;
using UnityEngine.Rendering;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("bellusfennec-BFRM")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+9340f513b27be80d4d5f37ca63d5f45fa52a1ef8")]
[assembly: AssemblyProduct("bellusfennec-BFRM")]
[assembly: AssemblyTitle("bellusfennec-BFRM")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

		public NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
}
namespace MrFuntikMod
{
	public static class Assets
	{
	}
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("com.bellusfennec.rounds.mod", "BFRM", "1.15.2")]
	[BepInProcess("Rounds.exe")]
	public class MrFuntikMod : BaseUnityPlugin
	{
		private const string ModId = "com.bellusfennec.rounds.mod";

		private const string ModName = "BFRM";

		public const string Version = "1.15.2";

		public const string ModInitials = "BFRM";

		internal static CardCategory NonImmunityCards;

		internal static CardCategory ImmunityCards;

		internal static List<CardInfo> hiddenCards = new List<CardInfo>();

		public static MrFuntikMod instance { get; private set; }

		private void Awake()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Expected O, but got Unknown
			Harmony val = new Harmony("com.bellusfennec.rounds.mod");
			val.PatchAll();
		}

		private void Start()
		{
			Debug.Log((object)"[BFRM][Card] Start.");
			NonImmunityCards = CustomCardCategories.instance.CardCategory("NonImmunityCards");
			ImmunityCards = CustomCardCategories.instance.CardCategory("ImmunityCards");
			instance = this;
			CustomCard.BuildCard<WeakenedDebuffCard>((Action<CardInfo>)delegate(CardInfo cardInfo)
			{
				Cards.instance.AddHiddenCard(cardInfo);
				hiddenCards.Add(cardInfo);
				Debug.Log((object)"[BFRM] Registered hidden card: WeakenedDebuffCard");
			});
			CustomCard.BuildCard<DrainedDebuffCard>((Action<CardInfo>)delegate(CardInfo cardInfo)
			{
				Cards.instance.AddHiddenCard(cardInfo);
				hiddenCards.Add(cardInfo);
				Debug.Log((object)"[BFRM] Registered hidden card: DrainedDebuffCard");
			});
			CustomCard.BuildCard<SoftRicochetDebuffCard>((Action<CardInfo>)delegate(CardInfo cardInfo)
			{
				Cards.instance.AddHiddenCard(cardInfo);
				hiddenCards.Add(cardInfo);
				Debug.Log((object)"[BFRM] Registered hidden card: SoftRicochetDebuffCard");
			});
			CustomCard.BuildCard<ColdWaterDebuffCard>((Action<CardInfo>)delegate(CardInfo cardInfo)
			{
				Cards.instance.AddHiddenCard(cardInfo);
				hiddenCards.Add(cardInfo);
				Debug.Log((object)"[BFRM] Registered hidden card: ColdWaterDebuffCard");
			});
			CustomCard.BuildCard<HeavyHandsDebuffCard>((Action<CardInfo>)delegate(CardInfo cardInfo)
			{
				Cards.instance.AddHiddenCard(cardInfo);
				hiddenCards.Add(cardInfo);
				Debug.Log((object)"[BFRM] Registered hidden card: HeavyHandsDebuffCard");
			});
			CustomCard.BuildCard<OverheatedDebuffCard>((Action<CardInfo>)delegate(CardInfo cardInfo)
			{
				Cards.instance.AddHiddenCard(cardInfo);
				hiddenCards.Add(cardInfo);
				Debug.Log((object)"[BFRM] Registered hidden card: OverheatedDebuffCard");
			});
			CustomCard.BuildCard<UnstoppableCard>((Action<CardInfo>)delegate(CardInfo cardInfo)
			{
				ImmunityCardValidator.UnstoppableCardInfo = cardInfo;
				Debug.Log((object)"[BFRM] Registered immunity card: Unstoppable");
			});
			CustomCard.BuildCard<RootedCard>((Action<CardInfo>)delegate(CardInfo cardInfo)
			{
				ImmunityCardValidator.RootedCardInfo = cardInfo;
				Debug.Log((object)"[BFRM] Registered immunity card: Rooted");
			});
			CustomCard.BuildCard<SonicRiotCard>((Action<CardInfo>)delegate(CardInfo cardInfo)
			{
				ImmunityCardValidator.SonicRiotCardInfo = cardInfo;
				Debug.Log((object)"[BFRM] Registered immunity card: SonicRiot");
			});
			CustomCard.BuildCard<RicochetPowerCard>();
			CustomCard.BuildCard<PlanetCard>();
			CustomCard.BuildCard<TsunamiCard>();
			CustomCard.BuildCard<BlazingTrailCard>();
			CustomCard.BuildCard<BacktrackCard>();
			CustomCard.BuildCard<ExtendedGuardCard>();
			CustomCard.BuildCard<ExecutionerCard>();
			CustomCard.BuildCard<WeakeningAuraCard>();
			CustomCard.BuildCard<DrainAuraCard>();
			CustomCard.BuildCard<SoftRicochetAuraCard>();
			CustomCard.BuildCard<ColdWaterAuraCard>();
			CustomCard.BuildCard<HeavyHandsAuraCard>();
			CustomCard.BuildCard<OverheatedAuraCard>();
			ImmunityCardValidator.RegisterValidationFunctions();
		}
	}
	internal class CardCheck : MonoBehaviour
	{
		public static int Amount(Player player, string cardName)
		{
			List<CardInfo> currentCards = player.data.currentCards;
			int num = 0;
			for (int num2 = currentCards.Count - 1; num2 >= 0; num2--)
			{
				if (currentCards[num2].cardName == cardName)
				{
					num++;
				}
			}
			return num;
		}
	}
	public static class ImmunityCardValidator
	{
		public static CardInfo UnstoppableCardInfo;

		public static CardInfo RootedCardInfo;

		public static CardInfo SonicRiotCardInfo;

		public static bool CanPlayerTakeUnstoppable(Player player, CardInfo card)
		{
			if ((Object)(object)UnstoppableCardInfo == (Object)null)
			{
				return true;
			}
			if (((Object)((Component)card).gameObject).name != ((Object)((Component)UnstoppableCardInfo).gameObject).name)
			{
				return true;
			}
			bool flag = player.data.currentCards.Any((CardInfo c) => ((Object)((Component)c).gameObject).name == ((Object)((Component)UnstoppableCardInfo).gameObject).name);
			if (flag)
			{
				Debug.Log((object)string.Format("[{0}] Player {1} already has Unstoppable ({2}), blocking card draw.", "BFRM", player.playerID, ((Object)((Component)UnstoppableCardInfo).gameObject).name));
			}
			return !flag;
		}

		public static bool CanPlayerTakeRooted(Player player, CardInfo card)
		{
			if ((Object)(object)RootedCardInfo == (Object)null)
			{
				return true;
			}
			if (((Object)((Component)card).gameObject).name != ((Object)((Component)RootedCardInfo).gameObject).name)
			{
				return true;
			}
			bool flag = player.data.currentCards.Any((CardInfo c) => ((Object)((Component)c).gameObject).name == ((Object)((Component)RootedCardInfo).gameObject).name);
			if (flag)
			{
				Debug.Log((object)string.Format("[{0}] Player {1} already has Rooted ({2}), blocking card draw.", "BFRM", player.playerID, ((Object)((Component)RootedCardInfo).gameObject).name));
			}
			return !flag;
		}

		public static bool CanPlayerTakeSonicRiot(Player player, CardInfo card)
		{
			if ((Object)(object)SonicRiotCardInfo == (Object)null)
			{
				return true;
			}
			if (((Object)((Component)card).gameObject).name != ((Object)((Component)SonicRiotCardInfo).gameObject).name)
			{
				return true;
			}
			bool flag = player.data.currentCards.Any((CardInfo c) => ((Object)((Component)c).gameObject).name == ((Object)((Component)SonicRiotCardInfo).gameObject).name);
			if (flag)
			{
				Debug.Log((object)string.Format("[{0}] Player {1} already has Rooted ({2}), blocking card draw.", "BFRM", player.playerID, ((Object)((Component)SonicRiotCardInfo).gameObject).name));
			}
			return !flag;
		}

		public static void RegisterValidationFunctions()
		{
			Cards.instance.AddCardValidationFunction((Func<Player, CardInfo, bool>)CanPlayerTakeUnstoppable);
			Cards.instance.AddCardValidationFunction((Func<Player, CardInfo, bool>)CanPlayerTakeRooted);
			Cards.instance.AddCardValidationFunction((Func<Player, CardInfo, bool>)CanPlayerTakeSonicRiot);
			Debug.Log((object)"[BFRM] Immunity card validation functions registered.");
		}
	}
}
namespace MrFuntikMod.Patches
{
	[HarmonyPatch(typeof(SilenceHandler), "RPCA_AddSilence")]
	public class AntiSilencePatch
	{
		public static bool Prefix(SilenceHandler __instance, float __0)
		{
			Player component = ((Component)__instance).GetComponent<Player>();
			if ((Object)(object)component != (Object)null && (Object)(object)((Component)component).GetComponent<AntiSilenceMono>() != (Object)null)
			{
				return false;
			}
			return true;
		}

		private static void PlayResistEffect(Player player)
		{
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			Color color = default(Color);
			((Color)(ref color))..ctor(0.6f, 0.6f, 1f, 1f);
			ShieldEffect.PlayShieldEffect(player, color);
		}
	}
	[HarmonyPatch(typeof(ProjectileHit), "RPCA_DoHit")]
	public class AegisShieldPatch_RPCA_DoHit
	{
		public static bool Prefix(ProjectileHit __instance, Vector2 hitPoint, Vector2 hitNormal, Vector2 vel, int viewID, int colliderID, ref bool wasBlocked)
		{
			if (viewID == -1)
			{
				return true;
			}
			PhotonView photonView = PhotonNetwork.GetPhotonView(viewID);
			if ((Object)(object)photonView == (Object)null)
			{
				return true;
			}
			Player component = ((Component)photonView).GetComponent<Player>();
			if ((Object)(object)component == (Object)null)
			{
				return true;
			}
			if ((Object)(object)component.data == (Object)null || component.data.dead)
			{
				return true;
			}
			if ((Object)(object)component.data.healthHandler == (Object)null || component.data.healthHandler.isRespawning)
			{
				return true;
			}
			if (!AegisShieldMono.IsShieldActiveForPlayer(component))
			{
				return true;
			}
			wasBlocked = true;
			return true;
		}
	}
	[HarmonyPatch(typeof(HealthHandler), "DoDamage")]
	public class AegisShieldPatch_DoDamage
	{
		public static bool Prefix(HealthHandler __instance, ref Vector2 damage, Vector2 position, Color blinkColor, GameObject damagingWeapon, Player damagingPlayer, bool healthRemoval, bool lethal, bool ignoreBlock)
		{
			if ((Object)(object)__instance == (Object)null)
			{
				return true;
			}
			Player component = ((Component)__instance).GetComponent<Player>();
			if ((Object)(object)component == (Object)null)
			{
				return true;
			}
			if ((Object)(object)component.data == (Object)null || component.data.dead)
			{
				return true;
			}
			if (__instance.isRespawning)
			{
				return true;
			}
			if (!AegisShieldMono.IsShieldActiveForPlayer(component))
			{
				return true;
			}
			return false;
		}
	}
	[HarmonyPatch(typeof(HealthHandler), "CallTakeDamage")]
	public class AegisShieldPatch_CallTakeDamage
	{
		public static bool Prefix(HealthHandler __instance, Vector2 damage, Vector2 position, GameObject damagingWeapon, Player damagingPlayer, bool lethal)
		{
			//IL_000a: 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)
			if ((Object)(object)__instance == (Object)null || damage == Vector2.zero)
			{
				return true;
			}
			Player component = ((Component)__instance).GetComponent<Player>();
			if ((Object)(object)component == (Object)null)
			{
				return true;
			}
			if ((Object)(object)component.data == (Object)null || component.data.dead)
			{
				return true;
			}
			if (__instance.isRespawning)
			{
				return true;
			}
			if (!AegisShieldMono.IsShieldActiveForPlayer(component))
			{
				return true;
			}
			return false;
		}
	}
	[HarmonyPatch(typeof(HealthHandler), "TakeDamage", new Type[]
	{
		typeof(Vector2),
		typeof(Vector2),
		typeof(Color),
		typeof(GameObject),
		typeof(Player),
		typeof(bool),
		typeof(bool)
	})]
	public class AegisShieldPatch_TakeDamage
	{
		public static bool Prefix(HealthHandler __instance, Vector2 damage, Vector2 position, Color dmgColor, GameObject damagingWeapon, Player damagingPlayer, bool lethal, bool ignoreBlock)
		{
			//IL_000a: 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)
			if ((Object)(object)__instance == (Object)null || damage == Vector2.zero)
			{
				return true;
			}
			Player component = ((Component)__instance).GetComponent<Player>();
			if ((Object)(object)component == (Object)null)
			{
				return true;
			}
			if ((Object)(object)component.data == (Object)null || component.data.dead)
			{
				return true;
			}
			if (__instance.isRespawning)
			{
				return true;
			}
			if (!AegisShieldMono.IsShieldActiveForPlayer(component))
			{
				return true;
			}
			return false;
		}
	}
	[HarmonyPatch(typeof(HealthHandler), "RPCA_SendTakeDamage")]
	public class AegisShieldPatch_RPCA_SendTakeDamage
	{
		public static bool Prefix(HealthHandler __instance, ref Vector2 damage, Vector2 position, bool lethal, int playerID)
		{
			if ((Object)(object)__instance == (Object)null)
			{
				return true;
			}
			Player component = ((Component)__instance).GetComponent<Player>();
			if ((Object)(object)component == (Object)null)
			{
				return true;
			}
			if ((Object)(object)component.data == (Object)null || component.data.dead)
			{
				return true;
			}
			if (__instance.isRespawning)
			{
				return true;
			}
			if (!AegisShieldMono.IsShieldActiveForPlayer(component))
			{
				return true;
			}
			return false;
		}
	}
	[HarmonyPatch(typeof(HealthHandler), "CallTakeForce")]
	public class AegisShieldPatch_CallTakeForce
	{
		public static bool Prefix(HealthHandler __instance, Vector2 force, ForceMode2D forceMode, bool forceIgnoreMass, bool ignoreBlock, float setFlying)
		{
			//IL_000a: 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)
			if ((Object)(object)__instance == (Object)null || force == Vector2.zero)
			{
				return true;
			}
			Player component = ((Component)__instance).GetComponent<Player>();
			if ((Object)(object)component == (Object)null)
			{
				return true;
			}
			if ((Object)(object)component.data == (Object)null || component.data.dead)
			{
				return true;
			}
			if (__instance.isRespawning)
			{
				return true;
			}
			if (!AegisShieldMono.IsShieldActiveForPlayer(component))
			{
				return true;
			}
			return false;
		}
	}
	[HarmonyPatch(typeof(HealthHandler), "TakeForce")]
	public class AntiKnockbackPatch_TakeForce
	{
		private static float lastEffectTime;

		private static readonly float effectCooldown = 0.15f;

		public static bool Prefix(HealthHandler __instance, ref Vector2 force, ForceMode2D forceMode, bool forceIgnoreMass, bool ignoreBlock, float setFlying)
		{
			Player component = ((Component)__instance).GetComponent<Player>();
			if ((Object)(object)component != (Object)null && (Object)(object)((Component)component).gameObject.GetComponent<AntiKnockbackMono>() != (Object)null)
			{
				Debug.Log((object)string.Format("[{0}] TakeForce blocked for player {1}! (force: {2})", "BFRM", component.playerID, ((Vector2)(ref force)).magnitude));
				PlayResistEffects(component);
				return false;
			}
			return true;
		}

		private static void PlayResistEffects(Player player)
		{
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			if (!(Time.time - lastEffectTime < effectCooldown))
			{
				lastEffectTime = Time.time;
				Color color = default(Color);
				((Color)(ref color))..ctor(0.9f, 0.5f, 0.2f, 1f);
				ShieldEffect.PlayShieldEffect(player, color, 0.8f);
			}
		}
	}
	[HarmonyPatch(typeof(HealthHandler), "RPCA_SendTakeForce")]
	public class AntiKnockbackPatch_RPCA
	{
		public static bool Prefix(HealthHandler __instance, Vector2 force, int forceMode, bool forceIgnoreMass, bool ignoreBlock, float setFlying)
		{
			Player component = ((Component)__instance).GetComponent<Player>();
			if ((Object)(object)component != (Object)null && (Object)(object)((Component)component).gameObject.GetComponent<AntiKnockbackMono>() != (Object)null)
			{
				Debug.Log((object)string.Format("[{0}] RPCA_SendTakeForce blocked for player {1}!", "BFRM", component.playerID));
				AntiSlowPatch_AddSlowAddative.PlayResistEffects(component);
				return false;
			}
			return true;
		}
	}
	[HarmonyPatch(typeof(CharacterStatModifiers), "AddSlowAddative")]
	public class AntiSlowPatch_AddSlowAddative
	{
		public static bool Prefix(CharacterStatModifiers __instance, ref float slowToAdd, ref float maxValue, ref bool isFastSlow)
		{
			Player component = ((Component)__instance).GetComponent<Player>();
			if ((Object)(object)component != (Object)null && (Object)(object)((Component)component).gameObject.GetComponent<AntiSlowMono>() != (Object)null)
			{
				Debug.Log((object)string.Format("[{0}] AddSlowAddative blocked for player {1}! (slow: {2})", "BFRM", component.playerID, slowToAdd));
				PlayResistEffects(component);
				return false;
			}
			return true;
		}

		public static void PlayResistEffects(Player player)
		{
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			Color color = default(Color);
			((Color)(ref color))..ctor(0.2f, 1f, 0.6f, 1f);
			Debug.Log((object)string.Format("[{0}] === PLAYING RESIST EFFECTS for player {1} ===", "BFRM", player.playerID));
			ShieldEffect.PlayShieldEffect(player, color);
		}
	}
	[HarmonyPatch(typeof(CharacterStatModifiers), "RPCA_AddSlow")]
	public class AntiSlowPatch_RPCA_AddSlow
	{
		public static bool Prefix(CharacterStatModifiers __instance, ref float slowToAdd, ref bool isFastSlow)
		{
			Player component = ((Component)__instance).GetComponent<Player>();
			if ((Object)(object)component != (Object)null && (Object)(object)((Component)component).gameObject.GetComponent<AntiSlowMono>() != (Object)null)
			{
				Debug.Log((object)string.Format("[{0}] RPCA_AddSlow blocked for player {1}!", "BFRM", component.playerID));
				AntiSlowPatch_AddSlowAddative.PlayResistEffects(component);
				return false;
			}
			return true;
		}
	}
	[HarmonyPatch(typeof(CharacterStatModifiers), "DoSlowDown")]
	public class AntiSlowPatch_DoSlowDown
	{
		public static bool Prefix(CharacterStatModifiers __instance, ref float newSlow)
		{
			Player component = ((Component)__instance).GetComponent<Player>();
			if ((Object)(object)component != (Object)null && (Object)(object)((Component)component).gameObject.GetComponent<AntiSlowMono>() != (Object)null)
			{
				return false;
			}
			return true;
		}
	}
	[HarmonyPatch(typeof(ProjectileHit), "RPCA_DoHit")]
	[HarmonyPriority(800)]
	public class DancerDodgePatch
	{
		public static bool Prefix(ProjectileHit __instance, Vector2 hitPoint, Vector2 hitNormal, Vector2 vel, int viewID, int colliderID, bool wasBlocked)
		{
			if (wasBlocked)
			{
				return true;
			}
			if (viewID == -1)
			{
				return true;
			}
			PhotonView photonView = PhotonNetwork.GetPhotonView(viewID);
			if ((Object)(object)photonView == (Object)null)
			{
				return true;
			}
			HealthHandler component = ((Component)photonView).GetComponent<HealthHandler>();
			if ((Object)(object)component == (Object)null)
			{
				return true;
			}
			if (component.isRespawning)
			{
				return true;
			}
			Player component2 = ((Component)component).GetComponent<Player>();
			if ((Object)(object)component2 == (Object)null)
			{
				return true;
			}
			if ((Object)(object)component2.data == (Object)null || component2.data.dead)
			{
				return true;
			}
			Block component3 = ((Component)component).GetComponent<Block>();
			if ((Object)(object)component3 != (Object)null && component3.IsBlocking())
			{
				return true;
			}
			DancerMono component4 = ((Component)component2).GetComponent<DancerMono>();
			if ((Object)(object)component4 == (Object)null)
			{
				return true;
			}
			if (component4.IsInDodgeImmunity())
			{
				return false;
			}
			if (!__instance.view.IsMine)
			{
				return true;
			}
			if (component4.TryDodge())
			{
				NetworkingManager.RPC(typeof(DancerDodgePatch), "RPC_ShowDodgeEffect", new object[1] { component2.playerID });
				return false;
			}
			return true;
		}

		[UnboundRPC]
		public static void RPC_ShowDodgeEffect(int playerID)
		{
			Player val = ((IEnumerable<Player>)PlayerManager.instance.players).FirstOrDefault((Func<Player, bool>)((Player p) => p.playerID == playerID));
			if (!((Object)(object)val == (Object)null))
			{
				DancerMono component = ((Component)val).GetComponent<DancerMono>();
				if ((Object)(object)component != (Object)null)
				{
					component.ShowMissText();
				}
			}
		}

		public static bool CanDecideDodge(Player targetPlayer, Player damagingPlayer)
		{
			if ((Object)(object)damagingPlayer != (Object)null && (Object)(object)damagingPlayer.data != (Object)null && (Object)(object)damagingPlayer.data.view != (Object)null && damagingPlayer.data.view.IsMine)
			{
				return true;
			}
			if ((Object)(object)targetPlayer != (Object)null && (Object)(object)targetPlayer.data != (Object)null && (Object)(object)targetPlayer.data.view != (Object)null && targetPlayer.data.view.IsMine)
			{
				return true;
			}
			return false;
		}

		public static bool TryDodgeWithSync(DancerMono dancer, Player targetPlayer, string source)
		{
			if (dancer.TryDodge())
			{
				NetworkingManager.RPC(typeof(DancerDodgePatch), "RPC_ShowDodgeEffect", new object[1] { targetPlayer.playerID });
				return true;
			}
			return false;
		}
	}
	[HarmonyPatch(typeof(HealthHandler), "DoDamage")]
	[HarmonyPriority(800)]
	public class DancerDodgePatch_DoDamage
	{
		public static bool Prefix(HealthHandler __instance, Vector2 damage, Vector2 position, Color blinkColor, GameObject damagingWeapon, Player damagingPlayer, bool healthRemoval, bool lethal, bool ignoreBlock)
		{
			//IL_000a: 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)
			if ((Object)(object)__instance == (Object)null || damage == Vector2.zero)
			{
				return true;
			}
			if (__instance.isRespawning)
			{
				return true;
			}
			Player component = ((Component)__instance).GetComponent<Player>();
			if ((Object)(object)component == (Object)null)
			{
				return true;
			}
			if ((Object)(object)component.data == (Object)null || component.data.dead)
			{
				return true;
			}
			DancerMono component2 = ((Component)component).GetComponent<DancerMono>();
			if ((Object)(object)component2 == (Object)null)
			{
				return true;
			}
			if (component2.IsInDodgeImmunity())
			{
				return false;
			}
			if (DancerDodgePatch.CanDecideDodge(component, damagingPlayer) && DancerDodgePatch.TryDodgeWithSync(component2, component, "DoDamage"))
			{
				return false;
			}
			return true;
		}
	}
	[HarmonyPatch(typeof(HealthHandler), "CallTakeDamage")]
	[HarmonyPriority(800)]
	public class DancerDodgePatch_CallTakeDamage
	{
		public static bool Prefix(HealthHandler __instance, Vector2 damage, Vector2 position, GameObject damagingWeapon, Player damagingPlayer, bool lethal)
		{
			//IL_000a: 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)
			if ((Object)(object)__instance == (Object)null || damage == Vector2.zero)
			{
				return true;
			}
			if (__instance.isRespawning)
			{
				return true;
			}
			Block val = ((Component)__instance).GetComponent<CharacterData>()?.block;
			if ((Object)(object)val != (Object)null && val.IsBlocking())
			{
				return true;
			}
			Player component = ((Component)__instance).GetComponent<Player>();
			if ((Object)(object)component == (Object)null)
			{
				return true;
			}
			if ((Object)(object)component.data == (Object)null || component.data.dead)
			{
				return true;
			}
			DancerMono component2 = ((Component)component).GetComponent<DancerMono>();
			if ((Object)(object)component2 == (Object)null)
			{
				return true;
			}
			if (component2.IsInDodgeImmunity())
			{
				return false;
			}
			if (DancerDodgePatch.CanDecideDodge(component, damagingPlayer) && DancerDodgePatch.TryDodgeWithSync(component2, component, "CallTakeDamage"))
			{
				return false;
			}
			return true;
		}
	}
	[HarmonyPatch(typeof(HealthHandler), "TakeDamage", new Type[]
	{
		typeof(Vector2),
		typeof(Vector2),
		typeof(Color),
		typeof(GameObject),
		typeof(Player),
		typeof(bool),
		typeof(bool)
	})]
	[HarmonyPriority(800)]
	public class DancerDodgePatch_TakeDamage
	{
		public static bool Prefix(HealthHandler __instance, Vector2 damage, Vector2 position, Color dmgColor, GameObject damagingWeapon, Player damagingPlayer, bool lethal, bool ignoreBlock)
		{
			//IL_000a: 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)
			if ((Object)(object)__instance == (Object)null || damage == Vector2.zero)
			{
				return true;
			}
			if (__instance.isRespawning)
			{
				return true;
			}
			Player component = ((Component)__instance).GetComponent<Player>();
			if ((Object)(object)component == (Object)null)
			{
				return true;
			}
			if ((Object)(object)component.data == (Object)null || component.data.dead)
			{
				return true;
			}
			DancerMono component2 = ((Component)component).GetComponent<DancerMono>();
			if ((Object)(object)component2 == (Object)null)
			{
				return true;
			}
			if (component2.IsInDodgeImmunity())
			{
				return false;
			}
			if (DancerDodgePatch.CanDecideDodge(component, damagingPlayer) && DancerDodgePatch.TryDodgeWithSync(component2, component, "TakeDamage"))
			{
				return false;
			}
			return true;
		}
	}
	[HarmonyPatch(typeof(HealthHandler), "TakeDamage", new Type[]
	{
		typeof(Vector2),
		typeof(Vector2),
		typeof(GameObject),
		typeof(Player),
		typeof(bool),
		typeof(bool)
	})]
	[HarmonyPriority(800)]
	public class DancerDodgePatch_TakeDamage6
	{
		public static bool Prefix(HealthHandler __instance, Vector2 damage, Vector2 position, GameObject damagingWeapon, Player damagingPlayer, bool lethal, bool ignoreBlock)
		{
			//IL_000a: 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)
			if ((Object)(object)__instance == (Object)null || damage == Vector2.zero)
			{
				return true;
			}
			if (__instance.isRespawning)
			{
				return true;
			}
			Player component = ((Component)__instance).GetComponent<Player>();
			if ((Object)(object)component == (Object)null)
			{
				return true;
			}
			if ((Object)(object)component.data == (Object)null || component.data.dead)
			{
				return true;
			}
			DancerMono component2 = ((Component)component).GetComponent<DancerMono>();
			if ((Object)(object)component2 == (Object)null)
			{
				return true;
			}
			if (component2.IsInDodgeImmunity())
			{
				return false;
			}
			if (DancerDodgePatch.CanDecideDodge(component, damagingPlayer) && DancerDodgePatch.TryDodgeWithSync(component2, component, "TakeDamage6"))
			{
				return false;
			}
			return true;
		}
	}
	[HarmonyPatch(typeof(ProjectileHit), "Start")]
	public class BulletStartPatch
	{
		private static void Postfix(ProjectileHit __instance)
		{
			PhotonView component = ((Component)__instance).GetComponent<PhotonView>();
			if (!((Object)(object)component == (Object)null) && component.IsMine && !((Object)(object)__instance.ownPlayer == (Object)null))
			{
				ExecutionerMono component2 = ((Component)__instance.ownPlayer).GetComponent<ExecutionerMono>();
				if (!((Object)(object)component2 == (Object)null) && component2.TryExecute())
				{
					ExecutionerBullet executionerBullet = ((Component)__instance).gameObject.AddComponent<ExecutionerBullet>();
					executionerBullet.isExecutionerShot = true;
					component.RPC("RPC_SetExecutionerStatus", (RpcTarget)1, new object[1] { true });
				}
			}
		}
	}
	[HarmonyPatch(typeof(ProjectileHit), "RPCA_DoHit")]
	[HarmonyPriority(0)]
	public class ExecutionerPatch
	{
		public static bool Prefix(ProjectileHit __instance, Vector2 hitPoint, Vector2 hitNormal, Vector2 vel, int viewID, int colliderID, ref bool wasBlocked)
		{
			//IL_0113: 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_0143: Unknown result type (might be due to invalid IL or missing references)
			if (wasBlocked || viewID == -1)
			{
				return true;
			}
			ExecutionerBullet component = ((Component)__instance).GetComponent<ExecutionerBullet>();
			if ((Object)(object)component == (Object)null || !component.isExecutionerShot)
			{
				return true;
			}
			PhotonView photonView = PhotonNetwork.GetPhotonView(viewID);
			if ((Object)(object)photonView == (Object)null)
			{
				return true;
			}
			Player component2 = ((Component)photonView).GetComponent<Player>();
			if ((Object)(object)component2 == (Object)null || component2.data.dead)
			{
				return true;
			}
			HealthHandler component3 = ((Component)component2).GetComponent<HealthHandler>();
			if ((Object)(object)component3 == (Object)null || component3.isRespawning)
			{
				return true;
			}
			CharacterData data = component2.data;
			data.health = 1f;
			__instance.damage = 10000f;
			NetworkingManager.RPC(typeof(ExecutionerPatch), "RPC_RegisterPendingExecution", new object[5]
			{
				component2.playerID,
				__instance.ownPlayer.playerID,
				((Component)component2).transform.position.x,
				((Component)component2).transform.position.y,
				((Component)component2).transform.position.z
			});
			return true;
		}

		[UnboundRPC]
		public static void RPC_RegisterPendingExecution(int targetPlayerID, int attackerPlayerID, float posX, float posY, float posZ)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			ExecutionerMono.RegisterPendingExecution(targetPlayerID, attackerPlayerID, new Vector3(posX, posY, posZ));
		}

		[UnboundRPC]
		public static void RPC_ShowExecuteEffect(int attackerPlayerID, float posX, float posY, float posZ)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			ExecutionerMono.ShowExecuteTextStatic(attackerPlayerID, new Vector3(posX, posY, posZ));
		}
	}
	[HarmonyPatch(typeof(HealthHandler), "RPCA_Die")]
	public class ExecutionerDeathPatch
	{
		public static void Postfix(HealthHandler __instance, Vector2 deathDirection)
		{
			Player component = ((Component)__instance).GetComponent<Player>();
			if (!((Object)(object)component == (Object)null))
			{
				Debug.Log((object)string.Format("[{0}][Executioner] Player {1} died, checking for pending execution...", "BFRM", component.playerID));
				ExecutionerMono.OnPlayerDied(component.playerID);
			}
		}
	}
	[HarmonyPatch(typeof(HealthHandler), "RPCA_Die_Phoenix")]
	public class ExecutionerDeathPhoenixPatch
	{
		public static void Postfix(HealthHandler __instance, Vector2 deathDirection)
		{
			Player component = ((Component)__instance).GetComponent<Player>();
			if (!((Object)(object)component == (Object)null))
			{
				Debug.Log((object)string.Format("[{0}][Executioner] Player {1} died (Phoenix), checking for pending execution...", "BFRM", component.playerID));
				ExecutionerMono.OnPlayerDied(component.playerID);
			}
		}
	}
	[HarmonyPatch(typeof(Block), "RPCA_DoBlock")]
	public class ExtendedGuardSyncPatch
	{
		private static int patchCallCount;

		public static void Prefix(Block __instance, bool firstBlock, bool dontSetCD, BlockTriggerType triggerType, Vector3 useBlockPos, bool onlyBlockEffects)
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: Invalid comparison between Unknown and I4
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			patchCallCount++;
			if ((int)triggerType > 0)
			{
				Debug.Log((object)string.Format("[{0}][ExtendedGuard] Patch #{1}: Skipped - triggerType={2}", "BFRM", patchCallCount, triggerType));
				return;
			}
			if (!firstBlock)
			{
				Debug.Log((object)string.Format("[{0}][ExtendedGuard] Patch #{1}: Skipped - not firstBlock", "BFRM", patchCallCount));
				return;
			}
			Player component = ((Component)__instance).GetComponent<Player>();
			if ((Object)(object)component == (Object)null)
			{
				Debug.Log((object)string.Format("[{0}][ExtendedGuard] Patch #{1}: Skipped - no player", "BFRM", patchCallCount));
				return;
			}
			ExtendedGuardMono component2 = ((Component)component).GetComponent<ExtendedGuardMono>();
			if ((Object)(object)component2 == (Object)null)
			{
				Debug.Log((object)string.Format("[{0}][ExtendedGuard] Patch #{1}: Skipped - no ExtendedGuardMono on player {2}", "BFRM", patchCallCount, component.playerID));
				return;
			}
			CharacterData component3 = ((Component)component).GetComponent<CharacterData>();
			if ((Object)(object)component3 == (Object)null)
			{
				Debug.Log((object)string.Format("[{0}][ExtendedGuard] Patch #{1}: Skipped - no CharacterData", "BFRM", patchCallCount));
				return;
			}
			if (!component3.view.IsMine)
			{
				Debug.Log((object)string.Format("[{0}][ExtendedGuard] Patch #{1}: Skipped - not IsMine for player {2}", "BFRM", patchCallCount, component.playerID));
				return;
			}
			float value = Random.value;
			float critChance = component2.GetCritChance();
			Debug.Log((object)string.Format("[{0}][ExtendedGuard] Patch #{1}: Rolling for player {2}, roll={3:F3}, chance={4:F3}", "BFRM", patchCallCount, component.playerID, value, critChance));
			if (value < critChance)
			{
				NetworkingManager.RPC(typeof(ExtendedGuardSyncPatch), "RPC_ActivateCritBlock", new object[1] { component.playerID });
				Debug.Log((object)string.Format("[{0}][ExtendedGuard] Patch #{1}: CRIT! RPC sent for player {2}", "BFRM", patchCallCount, component.playerID));
			}
			else
			{
				Debug.Log((object)string.Format("[{0}][ExtendedGuard] Patch #{1}: No crit for player {2}", "BFRM", patchCallCount, component.playerID));
			}
		}

		[UnboundRPC]
		public static void RPC_ActivateCritBlock(int playerID)
		{
			Player val = ((IEnumerable<Player>)PlayerManager.instance.players).FirstOrDefault((Func<Player, bool>)((Player p) => p.playerID == playerID));
			if ((Object)(object)val == (Object)null)
			{
				Debug.LogWarning((object)string.Format("[{0}][ExtendedGuard] RPC: Player {1} not found!", "BFRM", playerID));
				return;
			}
			ExtendedGuardMono component = ((Component)val).GetComponent<ExtendedGuardMono>();
			if ((Object)(object)component != (Object)null)
			{
				component.ActivateCritBlockFromRPC();
				Debug.Log((object)string.Format("[{0}][ExtendedGuard] RPC: Crit block activated for player {1}", "BFRM", playerID));
			}
		}
	}
}
namespace MrFuntikMod.Effects
{
	public class AntiSilenceMono : MonoBehaviour
	{
		private Player player;

		public void Start()
		{
			player = ((Component)this).GetComponent<Player>();
			Debug.Log(string.Format("[{0}] AntiSilenceMono added to player {1}", "BFRM", player?.playerID));
		}

		private void OnDestroy()
		{
			Debug.Log(string.Format("[{0}] AntiSilenceMono removed from player {1}", "BFRM", player?.playerID));
		}
	}
	public class AegisShieldMono : MonoBehaviour
	{
		private const float BASE_SHIELD_DURATION = 3f;

		private const float BASE_COOLDOWN = 15f;

		private const float DURATION_PER_STACK = 1f;

		private const float COOLDOWN_REDUCTION_PER_STACK = 2f;

		public int stackCount = 1;

		private Player player;

		private Block block;

		private CharacterData data;

		private bool isShieldActive = false;

		private float shieldTimer = 0f;

		private float currentShieldDuration = 0f;

		private float cooldownRemaining = 0f;

		private bool isReady = true;

		private Action<BlockTriggerType> blockAction;

		private GameObject shieldVisual;

		private LineRenderer shieldRenderer;

		private static Material sharedMaterial;

		private GameObject cooldownUI;

		private TextMesh cooldownText;

		private TextMesh[] outlineTexts;

		private GameObject[] outlineObjects;

		private const int OUTLINE_COUNT = 8;

		private const float OUTLINE_OFFSET = 0.02f;

		private bool wasDeadLastFrame = false;

		public static bool IsShieldActiveForPlayer(Player player)
		{
			if ((Object)(object)player == (Object)null)
			{
				return false;
			}
			if ((Object)(object)player.data == (Object)null || player.data.dead)
			{
				return false;
			}
			AegisShieldMono component = ((Component)player).gameObject.GetComponent<AegisShieldMono>();
			return (Object)(object)component != (Object)null && component.isShieldActive;
		}

		private void Start()
		{
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0049: Expected O, but got Unknown
			player = ((Component)this).GetComponent<Player>();
			block = ((Component)this).GetComponent<Block>();
			data = ((Component)this).GetComponent<CharacterData>();
			if ((Object)(object)sharedMaterial == (Object)null)
			{
				sharedMaterial = new Material(Shader.Find("Sprites/Default"));
			}
			blockAction = OnBlock;
			block.BlockAction = (Action<BlockTriggerType>)Delegate.Combine(block.BlockAction, blockAction);
			CreateShieldVisual();
			CreateCooldownUI();
			Debug.Log((object)string.Format("[{0}][Aegis] Initialized for player {1}", "BFRM", player?.playerID));
		}

		private void Update()
		{
			if ((Object)(object)player == (Object)null || (Object)(object)data == (Object)null)
			{
				return;
			}
			bool dead = data.dead;
			if (wasDeadLastFrame && !dead)
			{
				ResetState();
			}
			wasDeadLastFrame = dead;
			if (dead)
			{
				if ((Object)(object)cooldownUI != (Object)null && cooldownUI.activeSelf)
				{
					cooldownUI.SetActive(false);
				}
				if ((Object)(object)shieldVisual != (Object)null && shieldVisual.activeSelf)
				{
					shieldVisual.SetActive(false);
				}
				return;
			}
			if (!isReady && cooldownRemaining > 0f)
			{
				cooldownRemaining -= Time.deltaTime;
				if (cooldownRemaining <= 0f)
				{
					cooldownRemaining = 0f;
					isReady = true;
				}
			}
			if (isShieldActive)
			{
				shieldTimer += TimeHandler.deltaTime;
				if (shieldTimer < currentShieldDuration)
				{
					block.sinceBlock = 0f;
					UpdateShieldVisual();
				}
				else
				{
					DeactivateShield();
				}
			}
			UpdateCooldownUI();
		}

		private void OnBlock(BlockTriggerType triggerType)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0003: Invalid comparison between Unknown and I4
			if ((int)triggerType <= 0 && isReady && !isShieldActive && !((Object)(object)data == (Object)null) && !data.dead && data.view.IsMine)
			{
				ActivateShieldLocal();
				NetworkingManager.RPC(typeof(AegisShieldMono), "RPC_ActivateShield", new object[1] { player.playerID });
			}
		}

		[UnboundRPC]
		public static void RPC_ActivateShield(int playerID)
		{
			Player val = ((IEnumerable<Player>)PlayerManager.instance.players).FirstOrDefault((Func<Player, bool>)((Player p) => p.playerID == playerID));
			if (!((Object)(object)val == (Object)null))
			{
				AegisShieldMono component = ((Component)val).GetComponent<AegisShieldMono>();
				if ((Object)(object)component != (Object)null)
				{
					component.ActivateShieldLocal();
				}
			}
		}

		private void ActivateShieldLocal()
		{
			currentShieldDuration = GetShieldDuration();
			isShieldActive = true;
			shieldTimer = 0f;
			isReady = false;
			cooldownRemaining = GetCooldown();
			if ((Object)(object)shieldVisual != (Object)null)
			{
				shieldVisual.SetActive(true);
			}
			Debug.Log((object)string.Format("[{0}][Aegis] Shield ACTIVATED! Duration: {1:F1}s", "BFRM", currentShieldDuration));
		}

		private void DeactivateShield()
		{
			isShieldActive = false;
			shieldTimer = 0f;
			currentShieldDuration = 0f;
			if ((Object)(object)shieldVisual != (Object)null)
			{
				shieldVisual.SetActive(false);
			}
		}

		private float GetShieldDuration()
		{
			return 3f + (float)(stackCount - 1) * 1f;
		}

		private float GetCooldown()
		{
			float num = 15f - (float)(stackCount - 1) * 2f;
			return Mathf.Max(num, 5f);
		}

		public float GetShieldTimeRemaining()
		{
			if (!isShieldActive)
			{
				return 0f;
			}
			return Mathf.Max(0f, currentShieldDuration - shieldTimer);
		}

		public void AddStack()
		{
			stackCount++;
		}

		public void RemoveStack()
		{
			stackCount--;
		}

		private void ResetState()
		{
			isShieldActive = false;
			shieldTimer = 0f;
			currentShieldDuration = 0f;
			cooldownRemaining = 0f;
			isReady = true;
			if ((Object)(object)shieldVisual != (Object)null)
			{
				shieldVisual.SetActive(false);
			}
			if ((Object)(object)cooldownUI != (Object)null)
			{
				cooldownUI.SetActive(false);
			}
		}

		private void CreateShieldVisual()
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Expected O, but got Unknown
			//IL_0033: 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)
			shieldVisual = new GameObject("AegisShield");
			shieldVisual.transform.SetParent(((Component)this).transform);
			shieldVisual.transform.localPosition = Vector3.zero;
			shieldRenderer = shieldVisual.AddComponent<LineRenderer>();
			shieldRenderer.useWorldSpace = false;
			shieldRenderer.loop = true;
			shieldRenderer.startWidth = 0.15f;
			shieldRenderer.endWidth = 0.15f;
			shieldRenderer.positionCount = 36;
			((Renderer)shieldRenderer).material = sharedMaterial;
			((Renderer)shieldRenderer).sortingLayerName = "MostFront";
			((Renderer)shieldRenderer).sortingOrder = 100;
			for (int i = 0; i < 36; i++)
			{
				float num = (float)i / 36f * MathF.PI * 2f;
				shieldRenderer.SetPosition(i, new Vector3(Mathf.Cos(num), Mathf.Sin(num), 0f));
			}
			shieldVisual.SetActive(false);
		}

		private void UpdateShieldVisual()
		{
			//IL_0089: 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_012d: Unknown result type (might be due to invalid IL or missing references)
			//IL_013f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0144: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ca: 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_00f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_018b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0199: Unknown result type (might be due to invalid IL or missing references)
			if (!((Object)(object)shieldRenderer == (Object)null))
			{
				float shieldTimeRemaining = GetShieldTimeRemaining();
				float num = shieldTimeRemaining / currentShieldDuration;
				float num2 = 1f + Mathf.Sin(Time.time * 8f) * 0.1f;
				float num3 = 1.2f * num2;
				for (int i = 0; i < 36; i++)
				{
					float num4 = (float)i / 36f * MathF.PI * 2f;
					shieldRenderer.SetPosition(i, new Vector3(Mathf.Cos(num4) * num3, Mathf.Sin(num4) * num3, 0f));
				}
				Color val = ((!(num > 0.5f)) ? Color.Lerp(new Color(1f, 1f, 0.3f, 0.8f), new Color(1f, 0.3f, 0.3f, 0.8f), (0.5f - num) * 2f) : Color.Lerp(new Color(0.2f, 0.8f, 1f, 0.8f), new Color(1f, 1f, 0.3f, 0.8f), (1f - num) * 2f));
				if (shieldTimeRemaining <= 1f)
				{
					float num5 = Mathf.Sin(Time.time * 20f) * 0.5f + 0.5f;
					val.a *= num5;
				}
				shieldRenderer.startColor = val;
				shieldRenderer.endColor = val;
			}
		}

		private void CreateCooldownUI()
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Expected O, but got Unknown
			//IL_0042: 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_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00aa: Expected O, but got Unknown
			//IL_0107: Unknown result type (might be due to invalid IL or missing references)
			//IL_0184: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f4: Expected O, but got Unknown
			//IL_0211: Unknown result type (might be due to invalid IL or missing references)
			//IL_027b: Unknown result type (might be due to invalid IL or missing references)
			cooldownUI = new GameObject("AegisCooldownUI");
			cooldownUI.transform.SetParent(((Component)this).transform);
			cooldownUI.transform.localPosition = new Vector3(0f, -1.2f, 0f);
			cooldownUI.transform.localScale = Vector3.one * 3f;
			outlineTexts = (TextMesh[])(object)new TextMesh[8];
			outlineObjects = (GameObject[])(object)new GameObject[8];
			for (int i = 0; i < 8; i++)
			{
				outlineObjects[i] = new GameObject($"Outline_{i}");
				outlineObjects[i].transform.SetParent(cooldownUI.transform);
				float num = (float)i / 8f * MathF.PI * 2f;
				outlineObjects[i].transform.localPosition = new Vector3(Mathf.Cos(num) * 0.02f, Mathf.Sin(num) * 0.02f, 0.01f);
				outlineTexts[i] = outlineObjects[i].AddComponent<TextMesh>();
				outlineTexts[i].fontSize = 48;
				outlineTexts[i].characterSize = 0.12f;
				outlineTexts[i].anchor = (TextAnchor)4;
				outlineTexts[i].alignment = (TextAlignment)1;
				outlineTexts[i].color = new Color(0f, 0f, 0f, 1f);
				outlineTexts[i].fontStyle = (FontStyle)1;
				MeshRenderer component = outlineObjects[i].GetComponent<MeshRenderer>();
				if ((Object)(object)component != (Object)null)
				{
					((Renderer)component).sortingLayerName = "MostFront";
					((Renderer)component).sortingOrder = 199;
				}
			}
			GameObject val = new GameObject("Text");
			val.transform.SetParent(cooldownUI.transform);
			val.transform.localPosition = Vector3.zero;
			cooldownText = val.AddComponent<TextMesh>();
			cooldownText.fontSize = 48;
			cooldownText.characterSize = 0.12f;
			cooldownText.anchor = (TextAnchor)4;
			cooldownText.alignment = (TextAlignment)1;
			cooldownText.color = new Color(0.3f, 0.7f, 1f, 1f);
			cooldownText.fontStyle = (FontStyle)1;
			MeshRenderer component2 = val.GetComponent<MeshRenderer>();
			if ((Object)(object)component2 != (Object)null)
			{
				((Renderer)component2).sortingLayerName = "MostFront";
				((Renderer)component2).sortingOrder = 200;
			}
			cooldownUI.SetActive(false);
		}

		private void UpdateCooldownUI()
		{
			//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_010c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0113: Unknown result type (might be due to invalid IL or missing references)
			//IL_0118: Unknown result type (might be due to invalid IL or missing references)
			//IL_0120: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c8: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)cooldownUI == (Object)null || (Object)(object)cooldownText == (Object)null)
			{
				return;
			}
			float shieldTimeRemaining = GetShieldTimeRemaining();
			if (!isReady && cooldownRemaining > 0f)
			{
				cooldownUI.SetActive(true);
				string text = ((cooldownRemaining >= 5f) ? $"{cooldownRemaining:F0}" : $"{cooldownRemaining:F1}");
				cooldownText.text = text;
				for (int i = 0; i < 8; i++)
				{
					outlineTexts[i].text = text;
				}
				float num = 1f - cooldownRemaining / GetCooldown();
				Color color = Color.Lerp(new Color(1f, 0.3f, 0.3f, 1f), new Color(0.3f, 1f, 0.5f, 1f), num);
				cooldownText.color = color;
			}
			else if (isShieldActive)
			{
				cooldownUI.SetActive(true);
				string text2 = ((shieldTimeRemaining >= 5f) ? $"{shieldTimeRemaining:F0}" : $"{shieldTimeRemaining:F1}");
				cooldownText.text = text2;
				for (int j = 0; j < 8; j++)
				{
					outlineTexts[j].text = text2;
				}
				cooldownText.color = new Color(0.3f, 0.8f, 1f, 1f);
			}
			else
			{
				cooldownUI.SetActive(false);
			}
		}

		private void OnDestroy()
		{
			if ((Object)(object)block != (Object)null && blockAction != null)
			{
				block.BlockAction = (Action<BlockTriggerType>)Delegate.Remove(block.BlockAction, blockAction);
			}
			if ((Object)(object)shieldVisual != (Object)null)
			{
				Object.Destroy((Object)(object)shieldVisual);
			}
			if ((Object)(object)cooldownUI != (Object)null)
			{
				Object.Destroy((Object)(object)cooldownUI);
			}
		}
	}
	public class AntiKnockbackMono : MonoBehaviour
	{
		private Player player;

		public void Start()
		{
			player = ((Component)this).GetComponent<Player>();
			Debug.Log((object)string.Format("[{0}] AntiKnockbackMono added to player {1}", "BFRM", player?.playerID));
		}

		private void OnDestroy()
		{
			Debug.Log((object)string.Format("[{0}] AntiKnockbackMono removed from player {1}", "BFRM", player?.playerID));
		}
	}
	public class AntiSlowMono : MonoBehaviour
	{
		private Player player;

		private CharacterStatModifiers stats;

		public void Start()
		{
			player = ((Component)this).GetComponent<Player>();
			stats = ((Component)this).GetComponent<CharacterStatModifiers>();
			Debug.Log((object)string.Format("[{0}] AntiSlowMono added to player {1}", "BFRM", player?.playerID));
		}

		public void Update()
		{
			if ((Object)(object)stats != (Object)null && (stats.slow > 0f || stats.slowSlow > 0f || stats.fastSlow > 0f))
			{
				stats.slow = 0f;
				stats.slowSlow = 0f;
				stats.fastSlow = 0f;
				Debug.Log((object)string.Format("[{0}] Force cleared slow for player {1}", "BFRM", player?.playerID));
			}
		}

		private void OnDestroy()
		{
			Debug.Log((object)string.Format("[{0}] AntiSlowMono removed from player {1}", "BFRM", player?.playerID));
		}
	}
	public class AntiStunMono : MonoBehaviour
	{
		private CharacterData data;

		public Player player;

		private Vector2 lastMoveSpeed;

		private float lastEffectTime;

		private readonly float effectCooldown = 0.15f;

		public void Start()
		{
			data = ((Component)this).GetComponentInParent<CharacterData>();
			player = ((Component)this).GetComponent<Player>();
		}

		public void Update()
		{
			if (!((Object)(object)player == (Object)null) && !((Object)(object)player.data == (Object)null))
			{
				if (player.data.isStunned)
				{
					CancelStun();
					PlayResistEffect();
				}
				else
				{
					TrySaveVelocity();
				}
			}
		}

		private void CancelStun()
		{
			//IL_0025: 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)
			StunHandler stunHandler = player.data.stunHandler;
			((MonoBehaviour)stunHandler.codeAnim).StopAllCoroutines();
			stunHandler.codeAnim.currentState = (AnimationUse)2;
			stunHandler.codeAnim.animations = (CodeAnimationInstance[])(object)new CodeAnimationInstance[0];
			stunHandler.codeAnim.isPlaying = false;
			stunHandler.StopStun();
			ExtensionMethods.SetFieldValue((object)player.data.playerVel, "velocity", (object)lastMoveSpeed);
			Debug.Log((object)"[BFRM] Stun resisted!");
		}

		private void PlayResistEffect()
		{
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			if (!(Time.time - lastEffectTime < effectCooldown))
			{
				lastEffectTime = Time.time;
				Color color = default(Color);
				((Color)(ref color))..ctor(0.3f, 0.8f, 1f, 1f);
				ShieldEffect.PlayShieldEffect(player, color);
			}
		}

		private void TrySaveVelocity()
		{
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			try
			{
				lastMoveSpeed = (Vector2)ExtensionMethods.GetFieldValue((object)player.data.playerVel, "velocity");
			}
			catch
			{
			}
		}

		private void OnDestroy()
		{
			Debug.Log((object)string.Format("[{0}] AntiSlowMono removed from player {1}", "BFRM", player?.playerID));
		}
	}
	public class BacktrackMono : MonoBehaviour
	{
		private struct Snapshot
		{
			public Vector3 position;

			public float time;
		}

		private const float BACKTRACK_TIME = 3f;

		private const float BASE_COOLDOWN = 15f;

		private const float COOLDOWN_REDUCTION_PER_STACK = 2f;

		private const float RECORD_INTERVAL = 0.05f;

		private const float HISTORY_DURATION = 4f;

		public int stackCount = 1;

		private Player player;

		private Block block;

		private CharacterData data;

		private float cooldownRemaining = 0f;

		private bool isReady = true;

		private float lastRecordTime = 0f;

		private bool wasDeadLastFrame = false;

		private bool wasRespawningLastFrame = false;

		private LinkedList<Snapshot> history = new LinkedList<Snapshot>();

		private Action<BlockTriggerType> blockAction;

		private GameObject cooldownUI;

		private TextMesh cooldownText;

		private TextMesh[] outlineTexts;

		private const int OUTLINE_COUNT = 8;

		private const float OUTLINE_OFFSET = 0.02f;

		private GameObject backtrackPreview;

		private SpriteRenderer previewSprite;

		private static Material ghostMaterial;

		public bool IsHolding => false;

		private void Start()
		{
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0049: Expected O, but got Unknown
			player = ((Component)this).GetComponent<Player>();
			block = ((Component)this).GetComponent<Block>();
			data = ((Component)this).GetComponent<CharacterData>();
			if ((Object)(object)ghostMaterial == (Object)null)
			{
				ghostMaterial = new Material(Shader.Find("Sprites/Default"));
			}
			blockAction = OnBlock;
			block.BlockAction = (Action<BlockTriggerType>)Delegate.Combine(block.BlockAction, blockAction);
			if ((Object)(object)data.healthHandler != (Object)null)
			{
				data.healthHandler.reviveAction = (Action)Delegate.Combine(data.healthHandler.reviveAction, new Action(OnRevive));
			}
			if (data.view.IsMine)
			{
				CreateCooldownUI();
				CreateBacktrackPreview();
			}
		}

		private void OnRevive()
		{
			ResetState();
		}

		private void Update()
		{
			if ((Object)(object)player == (Object)null || (Object)(object)data == (Object)null)
			{
				return;
			}
			bool dead = data.dead;
			bool flag = (Object)(object)data.healthHandler != (Object)null && data.healthHandler.isRespawning;
			if ((wasDeadLastFrame && !dead) || (wasRespawningLastFrame && !flag && !dead))
			{
				ResetState();
			}
			wasDeadLastFrame = dead;
			wasRespawningLastFrame = flag;
			if (dead)
			{
				HideAllUI();
				return;
			}
			if (Time.time - lastRecordTime >= 0.05f)
			{
				RecordSnapshot();
				lastRecordTime = Time.time;
			}
			CleanOldHistory();
			if (!isReady)
			{
				cooldownRemaining -= Time.deltaTime;
				if (cooldownRemaining <= 0f)
				{
					cooldownRemaining = 0f;
					isReady = true;
				}
			}
			if (data.view.IsMine)
			{
				UpdateCooldownUI();
				UpdateBacktrackPreview();
			}
		}

		private void HideAllUI()
		{
			if ((Object)(object)cooldownUI != (Object)null)
			{
				cooldownUI.SetActive(false);
			}
			if ((Object)(object)backtrackPreview != (Object)null)
			{
				backtrackPreview.SetActive(false);
			}
		}

		private void ResetState()
		{
			if (history != null)
			{
				history.Clear();
			}
			cooldownRemaining = 0f;
			isReady = true;
			lastRecordTime = 0f;
			HideAllUI();
		}

		private void RecordSnapshot()
		{
			//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)
			if (!((Object)(object)data == (Object)null) && history != null)
			{
				history.AddLast(new Snapshot
				{
					position = ((Component)this).transform.position,
					time = Time.time
				});
			}
		}

		private void CleanOldHistory()
		{
			if (history != null)
			{
				float num = Time.time - 4f;
				while (history.Count > 0 && history.First.Value.time < num)
				{
					history.RemoveFirst();
				}
			}
		}

		private void OnBlock(BlockTriggerType triggerType)
		{
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Invalid comparison between Unknown and I4
			//IL_00e3: 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_011a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0133: Unknown result type (might be due to invalid IL or missing references)
			//IL_014c: Unknown result type (might be due to invalid IL or missing references)
			//IL_015e: Unknown result type (might be due to invalid IL or missing references)
			//IL_016c: Unknown result type (might be due to invalid IL or missing references)
			//IL_017a: Unknown result type (might be due to invalid IL or missing references)
			if (!((Object)(object)data == (Object)null) && !data.dead && isReady && data.view.IsMine && (int)triggerType <= 0 && history != null && history.Count != 0 && !(Time.time - history.First.Value.time < 3f))
			{
				Snapshot? snapshot = FindSnapshotAtTime(Time.time - 3f);
				if (snapshot.HasValue)
				{
					Vector3 position = ((Component)this).transform.position;
					NetworkingManager.RPC(typeof(BacktrackMono), "RPC_PerformBacktrack", new object[7]
					{
						player.playerID,
						snapshot.Value.position.x,
						snapshot.Value.position.y,
						snapshot.Value.position.z,
						position.x,
						position.y,
						position.z
					});
					isReady = false;
					cooldownRemaining = GetCooldown();
				}
			}
		}

		[UnboundRPC]
		public static void RPC_PerformBacktrack(int playerID, float px, float py, float pz, float ox, float oy, float oz)
		{
			//IL_0070: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			Player val = ((IEnumerable<Player>)PlayerManager.instance.players).FirstOrDefault((Func<Player, bool>)((Player x) => x.playerID == playerID));
			if ((Object)(object)val != (Object)null)
			{
				BacktrackMono component = ((Component)val).GetComponent<BacktrackMono>();
				if ((Object)(object)component != (Object)null && (Object)(object)val.data != (Object)null && !val.data.dead)
				{
					component.PerformBacktrackLocal(new Vector3(px, py, pz));
					component.SpawnGhostEffect(new Vector3(ox, oy, oz));
				}
			}
		}

		private void PerformBacktrackLocal(Vector3 position)
		{
			//IL_007f: 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_006c: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			if (!((Object)(object)data == (Object)null) && !data.dead)
			{
				PlayerCollision component = ((Component)player).GetComponent<PlayerCollision>();
				if ((Object)(object)component != (Object)null)
				{
					component.IgnoreWallForFrames(10);
				}
				Rigidbody2D component2 = ((Component)player).GetComponent<Rigidbody2D>();
				if ((Object)(object)component2 != (Object)null)
				{
					component2.velocity = Vector2.zero;
					component2.position = Vector2.op_Implicit(position);
				}
				((Component)this).transform.position = position;
				if (history != null)
				{
					history.Clear();
				}
			}
		}

		private Snapshot? FindSnapshotAtTime(float targetTime)
		{
			if (history == null || history.Count == 0)
			{
				return null;
			}
			return history.OrderBy((Snapshot s) => Mathf.Abs(s.time - targetTime)).First();
		}

		private float GetCooldown()
		{
			return Mathf.Max(15f - (float)(stackCount - 1) * 2f, 5f);
		}

		public void AddStack()
		{
			stackCount++;
		}

		public void RemoveStack()
		{
			stackCount = Mathf.Max(0, stackCount - 1);
		}

		private void CreateCooldownUI()
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Expected O, but got Unknown
			//IL_001c: 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_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Expected O, but got Unknown
			//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0126: Unknown result type (might be due to invalid IL or missing references)
			//IL_012c: Expected O, but got Unknown
			//IL_0149: Unknown result type (might be due to invalid IL or missing references)
			cooldownUI = new GameObject("BacktrackUI");
			cooldownUI.transform.localScale = Vector3.one * 3f;
			outlineTexts = (TextMesh[])(object)new TextMesh[8];
			for (int i = 0; i < 8; i++)
			{
				GameObject val = new GameObject("Outline");
				val.transform.SetParent(cooldownUI.transform);
				float num = (float)i * MathF.PI * 2f / 8f;
				val.transform.localPosition = new Vector3(Mathf.Cos(num) * 0.02f, Mathf.Sin(num) * 0.02f, 0.01f);
				TextMesh val2 = val.AddComponent<TextMesh>();
				val2.fontSize = 48;
				val2.characterSize = 0.12f;
				val2.anchor = (TextAnchor)4;
				val2.color = Color.black;
				outlineTexts[i] = val2;
				MeshRenderer component = val.GetComponent<MeshRenderer>();
				if ((Object)(object)component != (Object)null)
				{
					((Renderer)component).sortingLayerName = "MostFront";
				}
			}
			GameObject val3 = new GameObject("Text");
			val3.transform.SetParent(cooldownUI.transform);
			val3.transform.localPosition = Vector3.zero;
			cooldownText = val3.AddComponent<TextMesh>();
			cooldownText.fontSize = 48;
			cooldownText.characterSize = 0.12f;
			cooldownText.anchor = (TextAnchor)4;
			MeshRenderer component2 = val3.GetComponent<MeshRenderer>();
			if ((Object)(object)component2 != (Object)null)
			{
				((Renderer)component2).sortingLayerName = "MostFront";
				((Renderer)component2).sortingOrder = 200;
			}
			cooldownUI.SetActive(false);
		}

		private void UpdateCooldownUI()
		{
			//IL_0065: Unknown result type (might be due to invalid IL or missing references)
			//IL_0079: Unknown result type (might be due to invalid IL or missing references)
			//IL_007e: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)cooldownUI == (Object)null || (Object)(object)cooldownText == (Object)null)
			{
				return;
			}
			if (!isReady && cooldownRemaining > 0f)
			{
				cooldownUI.SetActive(true);
				cooldownUI.transform.position = ((Component)this).transform.position + new Vector3(0f, -1.2f, 0f);
				string text = ((cooldownRemaining > 1f) ? cooldownRemaining.ToString("F0") : cooldownRemaining.ToString("F1"));
				cooldownText.text = text;
				if (outlineTexts == null)
				{
					return;
				}
				TextMesh[] array = outlineTexts;
				foreach (TextMesh val in array)
				{
					if ((Object)(object)val != (Object)null)
					{
						val.text = text;
					}
				}
			}
			else
			{
				cooldownUI.SetActive(false);
			}
		}

		private void CreateBacktrackPreview()
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Expected O, but got Unknown
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_0069: Unknown result type (might be due to invalid IL or missing references)
			backtrackPreview = new GameObject("BacktrackPreview");
			previewSprite = backtrackPreview.AddComponent<SpriteRenderer>();
			SpriteRenderer componentInChildren = ((Component)this).GetComponentInChildren<SpriteRenderer>();
			if ((Object)(object)componentInChildren != (Object)null)
			{
				previewSprite.sprite = componentInChildren.sprite;
			}
			Color color = player.GetTeamColors().color;
			color.a = 0.35f;
			previewSprite.color = color;
			((Renderer)previewSprite).material = ghostMaterial;
			((Renderer)previewSprite).sortingLayerName = "MostFront";
			((Renderer)previewSprite).sortingOrder = 40;
			backtrackPreview.SetActive(false);
		}

		private void UpdateBacktrackPreview()
		{
			//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00db: Unknown result type (might be due to invalid IL or missing references)
			//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0107: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)backtrackPreview == (Object)null || (Object)(object)data == (Object)null)
			{
				return;
			}
			bool flag = isReady && !data.dead && history != null && history.Count > 0;
			if (flag)
			{
				flag = Time.time - history.First.Value.time >= 3f;
			}
			if (flag)
			{
				float targetTime = Time.time - 3f;
				Vector3? interpolatedPosition = GetInterpolatedPosition(targetTime);
				if (interpolatedPosition.HasValue)
				{
					backtrackPreview.SetActive(true);
					backtrackPreview.transform.position = Vector3.Lerp(backtrackPreview.transform.position, interpolatedPosition.Value, Time.deltaTime * 15f);
					backtrackPreview.transform.localScale = ((Component)this).transform.localScale;
				}
			}
			else
			{
				backtrackPreview.SetActive(false);
			}
		}

		private Vector3? GetInterpolatedPosition(float targetTime)
		{
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_016f: Unknown result type (might be due to invalid IL or missing references)
			//IL_017b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0181: Unknown result type (might be due to invalid IL or missing references)
			//IL_0131: Unknown result type (might be due to invalid IL or missing references)
			//IL_011e: Unknown result type (might be due to invalid IL or missing references)
			if (history == null || history.Count < 2)
			{
				if (history != null && history.Count > 0)
				{
					return history.First.Value.position;
				}
				return null;
			}
			Snapshot? snapshot = null;
			Snapshot? snapshot2 = null;
			foreach (Snapshot item in history)
			{
				if (item.time <= targetTime)
				{
					snapshot = item;
					continue;
				}
				snapshot2 = item;
				break;
			}
			if (!snapshot.HasValue || !snapshot2.HasValue)
			{
				return snapshot.HasValue ? new Vector3?(snapshot.GetValueOrDefault().position) : snapshot2?.position;
			}
			float num = (targetTime - snapshot.Value.time) / (snapshot2.Value.time - snapshot.Value.time);
			return Vector3.Lerp(snapshot.Value.position, snapshot2.Value.position, num);
		}

		private void SpawnGhostEffect(Vector3 pos)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Expected O, but got Unknown
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = new GameObject("Ghost");
			GhostEffectRunner ghostEffectRunner = val.AddComponent<GhostEffectRunner>();
			ghostEffectRunner.Run(pos, ((Component)this).transform.localScale, ((Component)this).GetComponentInChildren<SpriteRenderer>(), ghostMaterial);
		}

		private void OnDestroy()
		{
			if ((Object)(object)block != (Object)null && blockAction != null)
			{
				block.BlockAction = (Action<BlockTriggerType>)Delegate.Remove(block.BlockAction, blockAction);
			}
			if ((Object)(object)data != (Object)null && (Object)(object)data.healthHandler != (Object)null)
			{
				data.healthHandler.reviveAction = (Action)Delegate.Remove(data.healthHandler.reviveAction, new Action(OnRevive));
			}
			if ((Object)(object)cooldownUI != (Object)null)
			{
				Object.Destroy((Object)(object)cooldownUI);
			}
			if ((Object)(object)backtrackPreview != (Object)null)
			{
				Object.Destroy((Object)(object)backtrackPreview);
			}
		}
	}
	public class GhostEffectRunner : MonoBehaviour
	{
		private SpriteRenderer sr;

		private float life = 0.8f;

		private float timer = 0f;

		public void Run(Vector3 pos, Vector3 scale, SpriteRenderer source, Material mat)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: 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)
			((Component)this).transform.position = pos;
			((Component)this).transform.localScale = scale;
			sr = ((Component)this).gameObject.AddComponent<SpriteRenderer>();
			if ((Object)(object)source != (Object)null)
			{
				sr.sprite = source.sprite;
				sr.flipX = source.flipX;
			}
			((Renderer)sr).material = mat;
			sr.color = new Color(0.3f, 0.7f, 1f, 0.6f);
			((Renderer)sr).sortingLayerName = "MostFront";
		}

		private void Update()
		{
			//IL_0064: 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_0086: Unknown result type (might be due to invalid IL or missing references)
			timer += Time.deltaTime;
			float num = timer / life;
			if (num >= 1f)
			{
				Object.Destroy((Object)(object)((Component)this).gameObject);
				return;
			}
			sr.color = new Color(0.3f, 0.7f, 1f, Mathf.Lerp(0.6f, 0f, num));
			Transform transform = ((Component)this).transform;
			transform.localScale *= 1f + Time.deltaTime;
		}
	}
	public class DancerMono : MonoBehaviour
	{
		private const float BASE_DODGE_CHANCE = 0.15f;

		private const float DODGE_CHANCE_PER_STACK = 0.5f;

		private const float MAX_DODGE_CHANCE = 0.45f;

		private const float DODGE_IMMUNITY_WINDOW = 0.15f;

		public int stackCount = 1;

		private Player player;

		private float lastDodgeTime = -10f;

		private static List<MissTextEffect> textPool = new List<MissTextEffect>();

		private const int POOL_SIZE = 5;

		private void Start()
		{
			player = ((Component)this).GetComponent<Player>();
			InitializePool();
		}

		private void InitializePool()
		{
			if (textPool.Count < 5)
			{
				for (int i = textPool.Count; i < 5; i++)
				{
					MissTextEffect missTextEffect = CreateMissTextObject();
					((Component)missTextEffect).gameObject.SetActive(false);
					textPool.Add(missTextEffect);
				}
			}
		}

		public float GetDodgeChance()
		{
			float num = 0.15f + (float)(stackCount - 1) * 0.5f;
			return Mathf.Min(num, 0.45f);
		}

		public bool IsInDodgeImmunity()
		{
			if (!CanDodge())
			{
				return false;
			}
			return Time.time - lastDodgeTime < 0.15f;
		}

		public void ActivateDodgeImmunity()
		{
			lastDodgeTime = Time.time;
		}

		public bool TryDodge()
		{
			if (!CanDodge())
			{
				return false;
			}
			float value = Random.value;
			float dodgeChance = GetDodgeChance();
			return value < dodgeChance;
		}

		public bool CanDodge()
		{
			if ((Object)(object)player == (Object)null)
			{
				return false;
			}
			if ((Object)(object)player.data == (Object)null)
			{
				return false;
			}
			if (player.data.health <= 0f)
			{
				return false;
			}
			if (player.data.dead)
			{
				return false;
			}
			if (!((Component)player).gameObject.activeInHierarchy)
			{
				return false;
			}
			return true;
		}

		public void ShowMissText()
		{
			//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			if (!CanDodge())
			{
				return;
			}
			ActivateDodgeImmunity();
			MissTextEffect missTextEffect = null;
			foreach (MissTextEffect item in textPool)
			{
				if ((Object)(object)item != (Object)null && !((Component)item).gameObject.activeInHierarchy)
				{
					missTextEffect = item;
					break;
				}
			}
			if ((Object)(object)missTextEffect == (Object)null)
			{
				missTextEffect = CreateMissTextObject();
				textPool.Add(missTextEffect);
			}
			Vector3 position = ((Component)player).transform.position + new Vector3(Random.Range(-0.3f, 0.3f), 0.5f, 0f);
			missTextEffect.Activate(position);
		}

		private MissTextEffect CreateMissTextObject()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Expected O, but got Unknown
			GameObject val = new GameObject("MissText");
			Object.DontDestroyOnLoad((Object)(object)val);
			return val.AddComponent<MissTextEffect>();
		}

		public void AddStack()
		{
			stackCount++;
		}

		public void RemoveStack()
		{
			stackCount--;
		}

		public void ResetForNewRound()
		{
			lastDodgeTime = -10f;
		}

		private void OnDestroy()
		{
		}
	}
	public class MissTextEffect : MonoBehaviour
	{
		private TextMesh textMesh;

		private MeshRenderer meshRenderer;

		private TextMesh[] outlineTexts;

		private GameObject[] outlineObjects;

		private const int OUTLINE_COUNT = 8;

		private const float OUTLINE_OFFSET = 0.015f;

		private float lifetime = 1.4f;

		private float timer = 0f;

		private float floatSpeed = 2.5f;

		private Vector3 startPosition;

		private bool isActive = false;

		private static readonly Color mainColor = new Color(1f, 1f, 0.2f, 1f);

		private static readonly Color outlineColor = new Color(0.1f, 0.1f, 0.1f, 1f);

		private static readonly Color endColor = new Color(1f, 0.5f, 0f, 0f);

		private void Awake()
		{
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Expected O, but got Unknown
			//IL_0096: 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_01d2: Unknown result type (might be due to invalid IL or missing references)
			outlineTexts = (TextMesh[])(object)new TextMesh[8];
			outlineObjects = (GameObject[])(object)new GameObject[8];
			for (int i = 0; i < 8; i++)
			{
				outlineObjects[i] = new GameObject($"Outline_{i}");
				outlineObjects[i].transform.SetParent(((Component)this).transform);
				float num = (float)i / 8f * MathF.PI * 2f;
				outlineObjects[i].transform.localPosition = new Vector3(Mathf.Cos(num) * 0.015f, Mathf.Sin(num) * 0.015f, 0.01f);
				outlineTexts[i] = outlineObjects[i].AddComponent<TextMesh>();
				outlineTexts[i].text = "MISS!";
				outlineTexts[i].fontSize = 48;
				outlineTexts[i].characterSize = 0.15f;
				outlineTexts[i].anchor = (TextAnchor)4;
				outlineTexts[i].alignment = (TextAlignment)1;
				outlineTexts[i].color = outlineColor;
				outlineTexts[i].fontStyle = (FontStyle)1;
				MeshRenderer component = outlineObjects[i].GetComponent<MeshRenderer>();
				if ((Object)(object)component != (Object)null)
				{
					((Renderer)component).sortingLayerName = "MostFront";
					((Renderer)component).sortingOrder = 499;
				}
			}
			textMesh = ((Component)this).gameObject.AddComponent<TextMesh>();
			textMesh.text = "MISS!";
			textMesh.fontSize = 48;
			textMesh.characterSize = 0.15f;
			textMesh.anchor = (TextAnchor)4;
			textMesh.alignment = (TextAlignment)1;
			textMesh.color = mainColor;
			textMesh.fontStyle = (FontStyle)1;
			meshRenderer = ((Component)this).GetComponent<MeshRenderer>();
			if ((Object)(object)meshRenderer != (Object)null)
			{
				((Renderer)meshRenderer).sortingLayerName = "MostFront";
				((Renderer)meshRenderer).sortingOrder = 500;
			}
		}

		public void Activate(Vector3 position)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: 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)
			//IL_0063: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: 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)
			((Component)this).transform.position = position;
			startPosition = position;
			timer = 0f;
			isActive = true;
			textMesh.color = mainColor;
			for (int i = 0; i < 8; i++)
			{
				outlineTexts[i].color = outlineColor;
			}
			((Component)this).transform.localScale = Vector3.one * 0.3f;
			float num = Random.Range(-15f, 15f);
			((Component)this).transform.rotation = Quaternion.Euler(0f, 0f, num);
			((Component)this).gameObject.SetActive(true);
		}

		private void Update()
		{
			//IL_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_0098: Unknown result type (might be due to invalid IL or missing references)
			//IL_009d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0160: Unknown result type (might be due to invalid IL or missing references)
			//IL_0166: Unknown result type (might be due to invalid IL or missing references)
			//IL_01af: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d6: 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_01fd: 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_0250: Unknown result type (might be due to invalid IL or missing references)
			//IL_0255: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a3: Unknown result type (might be due to invalid IL or missing references)
			if (!isActive)
			{
				return;
			}
			timer += Time.deltaTime;
			float num = timer / lifetime;
			if (num >= 1f)
			{
				isActive = false;
				((Component)this).gameObject.SetActive(false);
				return;
			}
			float num2 = 1f - Mathf.Pow(1f - num, 2f);
			float num3 = num2 * floatSpeed;
			((Component)this).transform.position = startPosition + new Vector3(0f, num3, 0f);
			float num5;
			if (num < 0.1f)
			{
				float num4 = num / 0.1f;
				num5 = 0.3f + num4 * 1.2f;
			}
			else if (num < 0.2f)
			{
				float num6 = (num - 0.1f) / 0.1f;
				num5 = 1.5f - num6 * 0.3f;
			}
			else if (num < 0.7f)
			{
				float num7 = Mathf.Sin((num - 0.2f) * 20f) * 0.05f;
				num5 = 1.2f + num7;
			}
			else
			{
				float num8 = (num - 0.7f) / 0.3f;
				num5 = 1.2f - num8 * 0.4f;
			}
			((Component)this).transform.localScale = Vector3.one * num5;
			float a;
			if (num < 0.6f)
			{
				a = 1f;
			}
			else
			{
				a = 1f - (num - 0.6f) / 0.4f;
				a = Mathf.Pow(a, 0.5f);
			}
			Color color = Color.Lerp(mainColor, endColor, num * 0.7f);
			color.a = a;
			textMesh.color = color;
			Color color2 = outlineColor;
			color2.a = a;
			for (int i = 0; i < 8; i++)
			{
				outlineTexts[i].color = color2;
			}
			float num9 = Mathf.Sin(timer * 12f) * 0.08f * (1f - num);
			Transform transform = ((Component)this).transform;
			transform.position += new Vector3(num9, 0f, 0f);
			float num10 = Mathf.Sin(timer * 8f) * 5f * (1f - num);
			((Component)this).transform.rotation = Quaternion.Euler(0f, 0f, num10 + Random.Range(-0.5f, 0.5f));
		}
	}
	public class ExecutionerMono : MonoBehaviour
	{
		public struct PendingExecution
		{
			public int attackerPlayerID;

			public Vector3 position;

			public float timestamp;
		}

		private const float BASE_EXECUTE_CHANCE = 0.02f;

		private const float EXECUTE_CHANCE_PER_STACK = 0.02f;

		private const float MAX_EXECUTE_CHANCE = 1f;

		private const float PENDING_EXECUTION_TIMEOUT = 0.5f;

		public int stackCount = 1;

		private Player player;

		private static Dictionary<int, PendingExecution> pendingExecutions = new Dictionary<int, PendingExecution>();

		private static List<ExecuteTextEffect> textPool = new List<ExecuteTextEffect>();

		private const int POOL_SIZE = 3;

		private void Start()
		{
			player = ((Component)this).GetComponent<Player>();
			InitializePool();
			Debug.Log((object)string.Format("[{0}][Executioner] Initialized for player {1}, execute chance: {2:F1}%", "BFRM", player?.playerID, GetExecuteChance() * 100f));
		}

		private void InitializePool()
		{
			if (textPool.Count < 3)
			{
				for (int i = textPool.Count; i < 3; i++)
				{
					ExecuteTextEffect executeTextEffect = CreateExecuteTextObject();
					((Component)executeTextEffect).gameObject.SetActive(false);
					textPool.Add(executeTextEffect);
				}
			}
		}

		public float GetExecuteChance()
		{
			float num = 0.02f + (float)(stackCount - 1) * 0.02f;
			return Mathf.Min(num, 1f);
		}

		public bool TryExecute()
		{
			float value = Random.value;
			float executeChance = GetExecuteChance();
			bool flag = value < executeChance;
			Debug.Log((object)string.Format("[{0}][Executioner] TryExecute: roll={1:F4}, chance={2:F4}, result={3}", "BFRM", value, executeChance, flag));
			return flag;
		}

		public static void RegisterPendingExecution(int targetPlayerID, int attackerPlayerID, Vector3 position)
		{
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			CleanupOldPendingExecutions();
			pendingExecutions[targetPlayerID] = new PendingExecution
			{
				attackerPlayerID = attackerPlayerID,
				position = position,
				timestamp = Time.time
			};
			Debug.Log((object)string.Format("[{0}][Executioner] Registered pending execution for player {1}", "BFRM", targetPlayerID));
		}

		public static void OnPlayerDied(int deadPlayerID)
		{
			//IL_0087: Unknown result type (might be due to invalid IL or missing references)
			if (pendingExecutions.TryGetValue(deadPlayerID, out var value))
			{
				if (Time.time - value.timestamp > 0.5f)
				{
					pendingExecutions.Remove(deadPlayerID);
					Debug.Log((object)string.Format("[{0}][Executioner] Pending execution for player {1} expired", "BFRM", deadPlayerID));
				}
				else
				{
					pendingExecutions.Remove(deadPlayerID);
					Debug.Log((object)string.Format("[{0}][Executioner] Confirmed execution of player {1}!", "BFRM", deadPlayerID));
					ShowExecuteTextStatic(value.attackerPlayerID, value.position);
				}
			}
		}

		public static void ShowExecuteTextStatic(int attackerPlayerID, Vector3 position)
		{
			//IL_0091: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0074: Expected O, but got Unknown
			ExecuteTextEffect executeTextEffect = null;
			foreach (ExecuteTextEffect item in textPool)
			{
				if ((Object)(object)item != (Object)null && !((Component)item).gameObject.activeInHierarchy)
				{
					executeTextEffect = item;
					break;
				}
			}
			if ((Object)(object)executeTextEffect == (Object)null)
			{
				GameObject val = new GameObject("ExecuteText");
				Object.DontDestroyOnLoad((Object)(object)val);
				executeTextEffect = val.AddComponent<ExecuteTextEffect>();
				textPool.Add(executeTextEffect);
			}
			Vector3 position2 = position + new Vector3(Random.Range(-0.3f, 0.3f), 0.5f, 0f);
			executeTextEffect.Activate(position2);
		}

		public void ShowExecuteText(Vector3 position)
		{
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			ShowExecuteTextStatic(player?.playerID ?? (-1), position);
		}

		private static void CleanupOldPendingExecutions()
		{
			List<int> list = new List<int>();
			foreach (KeyValuePair<int, PendingExecution> pendingExecution in pendingExecutions)
			{
				if (Time.time - pendingExecution.Value.timestamp > 1f)
				{
					list.Add(pendingExecution.Key);
				}
			}
			foreach (int item in list)
			{
				pendingExecutions.Remove(item);
			}
		}

		private ExecuteTextEffect CreateExecuteTextObject()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Expected O, but got Unknown
			GameObject val = new GameObject("ExecuteText");
			Object.DontDestroyOnLoad((Object)(object)val);
			return val.AddComponent<ExecuteTextEffect>();
		}

		public void AddStack()
		{
			stackCount++;
			Debug.Log((object)string.Format("[{0}][Executioner] New execute chance: {1:F1}%", "BFRM", GetExecuteChance() * 100f));
		}

		public void RemoveStack()
		{
			stackCount--;
		}

		public static void ClearPendingExecutions()
		{
			pendingExecutions.Clear();
		}

		private void OnDestroy()
		{
			Debug.Log((object)string.Format("[{0}][Executioner] Destroyed for player {1}", "BFRM", player?.playerID));
		}
	}
	public class ExecuteTextEffect : MonoBehaviour
	{
		private TextMesh textMesh;

		private MeshRenderer meshRenderer;

		private TextMesh[] outlineTexts;

		private GameObject[] outlineObjects;

		private const int OUTLINE_COUNT = 8;

		private const float OUTLINE_OFFSET = 0.02f;

		private float lifetime = 1.6f;

		private float timer = 0f;

		private float floatSpeed = 2f;

		private Vector3 startPosition;

		private bool isActive = false;

		private static readonly Color mainColor = new Color(1f, 0.1f, 0.1f, 1f);

		private static readonly Color outlineColor = new Color(0.2f, 0f, 0f, 1f);

		private static readonly Color endColor = new Color(0.5f, 0f, 0f, 0f);

		private void Awake()
		{
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Expected O, but got Unknown
			//IL_0096: 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_01d2: Unknown result type (might be due to invalid IL or missing references)
			outlineTexts = (TextMesh[])(object)new TextMesh[8];
			outlineObjects = (GameObject[])(object)new GameObject[8];
			for (int i = 0; i < 8; i++)
			{
				outlineObjects[i] = new GameObject($"Outline_{i}");
				outlineObjects[i].transform.SetParent(((Component)this).transform);
				float num = (float)i / 8f * MathF.PI * 2f;
				outlineObjects[i].transform.localPosition = new Vector3(Mathf.Cos(num) * 0.02f, Mathf.Sin(num) * 0.02f, 0.01f);
				outlineTexts[i] = outlineObjects[i].AddComponent<TextMesh>();
				outlineTexts[i].text = "EXECUTED!";
				outlineTexts[i].fontSize = 52;
				outlineTexts[i].characterSize = 0.15f;
				outlineTexts[i].anchor = (TextAnchor)4;
				outlineTexts[i].alignment = (TextAlignment)1;
				outlineTexts[i].color = outlineColor;
				outlineTexts[i].fontStyle = (FontStyle)1;
				MeshRenderer component = outlineObjects[i].GetComponent<MeshRenderer>();
				if ((Object)(object)component != (Object)null)
				{
					((Renderer)component).sortingLayerName = "MostFront";
					((Renderer)component).sortingOrder = 499;
				}
			}
			textMesh = ((Component)this).gameObject.AddComponent<TextMesh>();
			textMesh.text = "EXECUTED!";
			textMesh.fontSize = 52;
			textMesh.characterSize = 0.15f;
			textMesh.anchor = (TextAnchor)4;
			textMesh.alignment = (TextAlignment)1;
			textMesh.color = mainColor;
			textMesh.fontStyle = (FontStyle)1;
			meshRenderer = ((Component)this).GetComponent<MeshRenderer>();
			if ((Object)(object)meshRenderer != (Object)null)
			{
				((Renderer)meshRenderer).sortingLayerName = "MostFront";
				((Renderer)meshRenderer).sortingOrder = 500;
			}
		}

		public void Activate(Vector3 position)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: 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)
			//IL_0063: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: 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)
			((Component)this).transform.position = position;
			startPosition = position;
			timer = 0f;
			isActive = true;
			textMesh.color = mainColor;
			for (int i = 0; i < 8; i++)
			{
				outlineTexts[i].color = outlineColor;
			}
			((Component)this).transform.localScale = Vector3.one * 0.2f;
			float num = Random.Range(-10f, 10f);
			((Component)this).transform.rotation = Quaternion.Euler(0f, 0f, num);
			((Component)this).gameObject.SetActive(true);
		}

		private void Update()
		{
			//IL_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_0098: Unknown result type (might be due to invalid IL or missing references)
			//IL_009d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0140: Unknown result type (might be due to invalid IL or missing references)
			//IL_0146: Unknown result type (might be due to invalid IL or missing references)
			//IL_018f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0194: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b6: Unknown result type (might be due to invalid IL or missing references)
			//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_01dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0222: Unknown result type (might be due to invalid IL or missing references)
			//IL_0240: 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)
			if (!isActive)
			{
				return;
			}
			timer += Time.deltaTime;
			float num = timer / lifetime;
			if (num >= 1f)
			{
				isActive = false;
				((Component)this).gameObject.SetActive(false);
				return;
			}
			float num2 = 1f - Mathf.Pow(1f - num, 2f);
			float num3 = num2 * floatSpeed;
			((Component)this).transform.position = startPosition + new Vector3(0f, num3, 0f);
			float num5;
			if (num < 0.08f)
			{
				float num4 = num / 0.08f;
				num5 = 0.2f + num4 * 1.6f;
			}
			else if (num < 0.15f)
			{
				float num6 = (num - 0.08f) / 0.07f;
				num5 = 1.8f - num6 * 0.5f;
			}
			else if (num < 0.65f)
			{
				num5 = 1.3f;
			}
			else
			{
				float num7 = (num - 0.65f) / 0.35f;
				num5 = 1.3f - num7 * 0.5f;
			}
			((Component)this).transform.localScale = Vector3.one * num5;
			float a;
			if (num < 0.55f)
			{
				a = 1f;
			}
			else
			{
				a = 1f - (num - 0.55f) / 0.45f;
				a = Mathf.Pow(a, 0.6f);
			}
			Color color = Color.Lerp(mainColor, endColor, num * 0.5f);
			color.a = a;
			textMesh.color = color;
			Color color2 = outlineColor;
			color2.a = a;
			for (int i = 0; i < 8; i++)
			{
				outlineTexts[i].color = color2;
			}
			if (num < 0.2f)
			{
				float num8 = (1f - num / 0.2f) * 0.1f;
				Transform transform = ((Component)this).transform;
				transform.position += new Vector3(Random.Range(0f - num8, num8), Random.Range(0f - num8, num8), 0f);
			}
		}
	}
	public class ExecutionerBullet : MonoBehaviourPun
	{
		public bool isExecutionerShot = false;

		private void Start()
		{
			if (isExecutionerShot)
			{
				ApplyBloodyVisuals();
			}
		}

		[PunRPC]
		public void RPC_SetExecutionerStatus(bool status)
		{
			isExecutionerShot = status;
			if (status)
			{
				ApplyBloodyVisuals();
			}
		}

		public void ApplyBloodyVisuals()
		{
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
			Color val = default(Color);
			((Color)(ref val))..ctor(1f, 0f, 0f, 1f);
			TrailRenderer componentInChildren = ((Component)this).GetComponentInChildren<TrailRenderer>();
			if ((Object)(object)componentInChildren != (Object)null)
			{
				componentInChildren.startColor = val;
				componentInChildren.endColor = new Color(0.4f, 0f, 0f, 0f);
				componentInChildren.widthMultiplier *= 2f;
				componentInChildren.time *= 1.5f;
			}
			LineRenderer componentInChildren2 = ((Component)this).GetComponentInChildren<LineRenderer>();
			if ((Object)(object)componentInChildren2 != (Object)null)
			{
				componentInChildren2.startColor = val;
				componentInChildren2.endColor = val;
				((Renderer)componentInChildren2).material.color = val;
				((Renderer)componentInChildren2).material.EnableKeyword("_EMISSION");
				((Renderer)componentInChildren2).material.SetColor("_EmissionColor", val * 3f);
			}
			SpriteRenderer componentInChildren3 = ((Component)this).GetComponentInChildren<SpriteRenderer>();
			if ((Object)(object)componentInChildren3 != (Object)null)
			{
				componentInChildren3.color = val;
			}
		}
	}
	public class ExtendedGuardMono : MonoBehaviour
	{
		private const float BASE_CRIT_CHANCE = 0.25f;

		private const float CRIT_CHANCE_PER_STACK = 0.15f;

		private const float MAX_CRIT_CHANCE = 0.75f;

		private const float CRIT_BLOCK_DURATION = 0.6f;

		public int stackCount = 1;

		private Player player;

		private Block block;

		private CharacterData data;

		private Action<BlockTriggerType> blockAction;

		private GameObject critVisual;

		private LineRenderer critRenderer;

		private float critVisualTimer = 0f;

		private const float CRIT_VISUAL_DURATION = 0.6f;

		private bool isCritBlock = false;

		private float critBlockTimer = 0f;

		private bool wasDeadLastFrame = false;

		private void Start()
		{
			player = ((Component)this).GetComponent<Player>();
			block = ((Component)this).GetComponent<Block>();
			data = ((Component)this).GetComponent<CharacterData>();
			blockAction = OnBlock;
			block.BlockAction = (Action<BlockTriggerType>)Delegate.Combine(block.BlockAction, blockAction);
			CreateCritVisual();
			Debug.Log((object)string.Format("[{0}][ExtendedGuard] Initialized for player {1}, crit chance: {2:F0}%", "BFRM", player?.playerID, GetCritChance() * 100f));
		}

		public float GetCritChance()
		{
			float num = 0.25f + (float)(stackCount - 1) * 0.15f;
			return Mathf.Min(num, 0.75f);
		}

		private void OnBlock(BlockTriggerType triggerType)
		{
		}

		public void ActivateCritBlockFromRPC()
		{
			ActivateCritBlock();
		}

		private void ActivateCritBlock()
		{
			isCritBlock = true;
			critBlockTimer = 0f;
			Debug.Log((object)string.Format("[{0}][ExtendedGuard] Crit activated! Duration: {1}s", "BFRM", 0.6f));
			ShowCritVisual();
		}

		private void Update()
		{
			if ((Object)(object)player == (Object)null || (Object)(object)data == (Object)null)
			{
				return;
			}
			bool dead = data.dead;
			if (wasDeadLastFrame && !dead)
			{
				ResetState();
			}
			wasDeadLastFrame = dead;
			if (dead)
			{
				HideCritVisual();
				return;
			}
			if (isCritBlock)
			{
				critBlockTimer += TimeHandler.deltaTime;
				if (critBlockTimer < 0.6f)
				{
					block.sinceBlock = 0f;
				}
				else
				{
					isCritBlock = false;
					Debug.Log((object)"[BFRM][ExtendedGuard] Crit block ended");
				}
			}
			if (critVisualTimer > 0f)
			{
				critVisualTimer -= Time.deltaTime;
				UpdateCritVisual();
				if (critVisualTimer <= 0f)
				{
					HideCritVisual();
				}
			}
		}

		private void ResetState()
		{
			isCritBlock = false;
			critVisualTimer = 0f;
			critBlockTimer = 0f;
			HideCritVisual();
		}

		private void CreateCritVisual()
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Expected O, but got Unknown
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b2: Expected O, but got Unknown
			//IL_010a: Unknown result type (might be due to invalid IL or missing references)
			critVisual = new GameObject("ExtendedGuardCrit");
			critVisual.transform.SetParent(((Component)this).transform);
			critVisual.transform.localPosition = Vector3.zero;
			critRenderer = critVisual.AddComponent<LineRenderer>();
			critRenderer.useWorldSpace = false;
			critRenderer.loop = true;
			critRenderer.startWidth = 0.2f;
			critRenderer.endWidth = 0.2f;
			critRenderer.positionCount = 6;
			((Renderer)critRenderer).material = new Material(Shader.Find("Sprites/Default"));
			((Renderer)critRenderer).sortingLayerName = "MostFront";
			((Renderer)critRenderer).sortingOrder = 100;
			for (int i = 0; i < 6; i++)
			{
				float num = (float)i / 6f * MathF.PI * 2f - MathF.PI / 2f;
				critRenderer.SetPosition(i, new Vector3(Mathf.Cos(num), Mathf.Sin(num), 0f));
			}
			critVisual.SetActive(false);
		}

		private void ShowCritVisual()
		{
			critVisualTimer = 0.6f;
			if ((Object)(object)critVisual != (Object)null)
			{
				critVisual.SetActive(true);
			}
		}

		private void UpdateCritVisual()
		{
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
			if (!((Object)(object)critRenderer == (Object)null))
			{
				float num = critVisualTimer / 0.6f;
				float num2 = 1f + Mathf.Sin(Time.time * 15f) * 0.15f;
				float num3 = 1.5f * num2;
				for (int i = 0; i < 6; i++)
				{
					float num4 = (float)i / 6f * MathF.PI * 2f - MathF.PI / 2f;
					critRenderer.SetPosition(i, new Vector3(Mathf.Cos(num4) * num3, Mathf.Sin(num4) * num3, 0f));
				}
				float num5 = Mathf.Lerp(0.3f, 1f, num);
				Color val = default(Color);
				((Color)(ref val))..ctor(1f, 0.85f, 0.2f, num5);
				critRenderer.startColor = val;
				critRenderer.endColor = val;
				float num6 = Mathf.Lerp(0.1f, 0.25f, num);
				critRenderer.startWidth = num6;
				critRenderer.endWidth = num6;
			}
		}

		private void HideCritVisual()
		{
			if ((Object)(object)critVisual != (Object)null)
			{
				critVisual.SetActive(false);
			}
		}

		public void AddStack()
		{
			stackCount++;
			Debug.Log((object)string.Format("[{0}][ExtendedGuard] New crit chance: {1:F0}%", "BFRM", GetCritChance() * 100f));
		}

		public void RemoveStack()
		{
			stackCount--;
		}

		private void OnDestroy()
		{
			if ((Object)(object)block != (Object)null && blockAction != null)
			{
				block.BlockAction = (Action<BlockTriggerType>)Delegate.Remove(block.BlockAction, blockAction);
			}
			if ((Object)(object)critVisual != (Object)null)
			{
				Object.Destroy((Object)(object)critVisual);
			}
			Debug.Log((object)string.Format("[{0}][ExtendedGuard] Destroyed for player {1}", "BFRM", player?.playerID));
		}
	}
	public class GravityFieldMono : MonoBehaviour
	{
		private Player player;

		private float pullForce = 125f;

		private float maxDistance = 50f;

		private float minDistance = 2f;

		private float deadZone = 5f;

		private float weakZoneEnd = 10f;

		private int stacks = 1;

		private float bulletSear