Decompiled source of RSCards v1.3.5

RSCards.dll

Decompiled a month 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 BepInEx.Bootstrap;
using CardChoiceSpawnUniqueCardPatch.CustomCategories;
using HarmonyLib;
using InControl;
using Jotunn.Utils;
using ModdingUtils.Extensions;
using ModdingUtils.Utils;
using Photon.Pun;
using RSCards.Cards;
using RSCards.Utilities;
using Sonigon;
using UnboundLib;
using UnboundLib.Cards;
using UnboundLib.GameModes;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(/*Could not decode attribute arguments.*/)]
[assembly: TargetFramework(".NETFramework,Version=v4.7.1", FrameworkDisplayName = ".NET Framework 4.7.1")]
[assembly: AssemblyVersion("0.0.0.0")]
namespace RSCards
{
	public class CardHolder : MonoBehaviour
	{
		public List<GameObject> Cards;

		public List<GameObject> HiddenCards;

		internal void RegisterCards()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0104: Unknown result type (might be due to invalid IL or missing references)
			//IL_0109: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_0122: Unknown result type (might be due to invalid IL or missing references)
			//IL_0127: Unknown result type (might be due to invalid IL or missing references)
			//IL_0132: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: 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)
			//IL_008d: Unknown result type (might be due to invalid IL or missing references)
			Enumerator<GameObject> enumerator = Cards.GetEnumerator();
			DateTime utcNow;
			try
			{
				while (enumerator.MoveNext())
				{
					GameObject current = enumerator.Current;
					current.AddComponent<Template>();
					if (RSCards.RSClasses && ((Object)current).name == "Twin Scythe")
					{
						continue;
					}
					utcNow = DateTime.UtcNow;
					if (DateTools.WeekOf(new DateTime(((DateTime)(ref utcNow)).Year, 4, 1)) || !(((Object)current).name == "Repentence"))
					{
						utcNow = DateTime.UtcNow;
						if (!DateTools.WeekOf(new DateTime(((DateTime)(ref utcNow)).Year, 4, 1)) || !(((Object)current).name == "Repentance"))
						{
							CustomCard.RegisterUnityCard(current, "RSC", current.GetComponent<CardInfo>().cardName, true, (Action<CardInfo>)null);
							CustomCardCategories.instance.UpdateAndPullCategoriesFromCard(current.GetComponent<CardInfo>());
						}
					}
				}
			}
			finally
			{
				((IDisposable)enumerator).Dispose();
			}
			Enumerator<GameObject> enumerator2 = HiddenCards.GetEnumerator();
			try
			{
				while (enumerator2.MoveNext())
				{
					GameObject current2 = enumerator2.Current;
					current2.AddComponent<Template>();
					utcNow = DateTime.UtcNow;
					if (DateTools.WeekOf(new DateTime(((DateTime)(ref utcNow)).Year, 4, 1)) || !(((Object)current2).name == "Repen10ce"))
					{
						CustomCard.RegisterUnityCard(current2, "RSC", current2.GetComponent<CardInfo>().cardName, false, (Action<CardInfo>)null);
						CustomCardCategories.instance.UpdateAndPullCategoriesFromCard(current2.GetComponent<CardInfo>());
						Cards.instance.AddHiddenCard(current2.GetComponent<CardInfo>());
					}
				}
			}
			finally
			{
				((IDisposable)enumerator2).Dispose();
			}
		}
	}
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("com.rsmind.rounds.RSCards", "RSCards", "1.3.5")]
	[BepInProcess("Rounds.exe")]
	public class RSCards : BaseUnityPlugin
	{
		private const string ModId = "com.rsmind.rounds.RSCards";

		private const string ModName = "RSCards";

		public const string Version = "1.3.5";

		public const string ModInitials = "RSC";

		internal static bool RSClasses;

		public static bool Debug;

		internal static AssetBundle assets;

		[field: CompilerGenerated]
		[field: DebuggerBrowsable(/*Could not decode attribute arguments.*/)]
		public static RSCards instance
		{
			[CompilerGenerated]
			get;
			[CompilerGenerated]
			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.rsmind.rounds.RSCards");
			val.PatchAll();
		}

		private void Start()
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			Enumerator<BaseUnityPlugin> enumerator = Chainloader.Plugins.GetEnumerator();
			try
			{
				while (enumerator.MoveNext())
				{
					BaseUnityPlugin current = enumerator.Current;
					if (current.Info.Metadata.GUID == "com.rsmind.rounds.RSClasses")
					{
						RSClasses = true;
						break;
					}
				}
			}
			finally
			{
				((IDisposable)enumerator).Dispose();
			}
			instance = this;
			assets = AssetUtils.LoadAssetBundleFromResources("rscardart", typeof(RSCards).Assembly);
			assets.LoadAsset<GameObject>("CardHolder").GetComponent<CardHolder>().RegisterCards();
			if ((Object)(object)assets == (Object)null)
			{
				Debug.Log((object)"Failed to load RSCards asset bundle");
			}
			GameModeManager.AddHook("PlayerPickStart", (Func<IGameModeHandler, IEnumerator>)PlayerPickStart);
		}

		[IteratorStateMachine(/*Could not decode attribute arguments.*/)]
		private IEnumerator PlayerPickStart(IGameModeHandler gm)
		{
			Enumerator<Player> enumerator = PlayerManager.instance.players.GetEnumerator();
			try
			{
				while (enumerator.MoveNext())
				{
					Player player = enumerator.Current;
					if (((Component)((Component)player.data).GetComponent<Holding>().holdable).GetComponent<Gun>().reflects >= 2)
					{
						CharacterStatModifiersExtension.GetAdditionalData(player.data.stats).blacklistedCategories.Remove(RSCardCategories.BounceAbsorptionCategory);
					}
					else
					{
						CharacterStatModifiersExtension.GetAdditionalData(player.data.stats).blacklistedCategories.Add(RSCardCategories.BounceAbsorptionCategory);
					}
					if (((Component)player).GetComponent<CharacterStatModifiers>().lifeSteal >= 0.5f)
					{
						CharacterStatModifiersExtension.GetAdditionalData(player.data.stats).blacklistedCategories.Remove(RSCardCategories.RepentanceCategory);
					}
					else
					{
						CharacterStatModifiersExtension.GetAdditionalData(player.data.stats).blacklistedCategories.Add(RSCardCategories.RepentanceCategory);
					}
				}
			}
			finally
			{
				((IDisposable)enumerator).Dispose();
			}
			yield break;
		}
	}
	internal static class RSCardCategories : Object
	{
		public static CardCategory BounceAbsorptionCategory = CustomCardCategories.instance.CardCategory("BounceAbsorptionCategory");

		public static CardCategory RepentanceCategory = CustomCardCategories.instance.CardCategory("RepentanceCategory");
	}
}
namespace RSCards.Utilities
{
	internal static class DateTools : Object
	{
		public static bool DayOf(DateTime holiday)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			DateTime val = DateTime.UtcNow;
			double num = ((DateTime)(ref val)).ToOADate();
			val = ((DateTime)(ref holiday)).AddHours(-12.0);
			double num2 = ((DateTime)(ref val)).ToOADate();
			val = ((DateTime)(ref holiday)).AddHours(36.0);
			double num3 = ((DateTime)(ref val)).ToOADate();
			return num > num2 && num < num3;
		}

		public static bool DayOf(DateTime[] holidays)
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			for (int i = 0; i < holidays.Length; i++)
			{
				if (DayOf(holidays[i]))
				{
					return true;
				}
			}
			return false;
		}

		public static bool WeekOf(DateTime holiday)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Unknown result type (might be due to invalid IL or missing references)
			DateTime val = DateTime.UtcNow;
			double num = ((DateTime)(ref val)).ToOADate();
			val = ((DateTime)(ref holiday)).AddDays(-6.0);
			val = ((DateTime)(ref val)).AddHours(-12.0);
			double num2 = ((DateTime)(ref val)).ToOADate();
			val = ((DateTime)(ref holiday)).AddDays(6.0);
			val = ((DateTime)(ref val)).AddHours(36.0);
			double num3 = ((DateTime)(ref val)).ToOADate();
			return num > num2 && num < num3;
		}

		public static bool WeekOf(DateTime[] holidays)
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			for (int i = 0; i < holidays.Length; i++)
			{
				if (WeekOf(holidays[i]))
				{
					return true;
				}
			}
			return false;
		}

		public static void DateTest(DateTime testDate)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			if (DayOf(testDate))
			{
				Debug.Log((object)String.Format("It's {0}/{1} somewhere", (object)((DateTime)(ref testDate)).Month, (object)((DateTime)(ref testDate)).Day));
			}
			else if (WeekOf(testDate))
			{
				Debug.Log((object)String.Format("It's the week of {0}/{1} somewhere", (object)((DateTime)(ref testDate)).Month, (object)((DateTime)(ref testDate)).Day));
			}
			else
			{
				Debug.Log((object)String.Format("It's not {0}/{1} anywhere", (object)((DateTime)(ref testDate)).Month, (object)((DateTime)(ref testDate)).Day));
			}
		}
	}
}
namespace RSCards.Cards
{
	internal class Template : CustomCard
	{
		public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
		{
			if (RSCards.Debug)
			{
				Debug.Log((object)String.Concat("[RSC][Card] ", ((CustomCard)this).GetTitle(), " has been setup."));
			}
		}

		public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
			if (RSCards.Debug)
			{
				Debug.Log((object)String.Format("[{0}][Card] {1} has been added to player {2}.", (object)"RSC", (object)((CustomCard)this).GetTitle(), (object)player.playerID));
			}
		}

		public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
			if (RSCards.Debug)
			{
				Debug.Log((object)String.Format("[{0}][Card] {1} has been removed from player {2}.", (object)"RSC", (object)((CustomCard)this).GetTitle(), (object)player.playerID));
			}
		}

		protected override string GetTitle()
		{
			return "CardName";
		}

		protected override string GetDescription()
		{
			return "CardDescription";
		}

		protected override GameObject GetCardArt()
		{
			return null;
		}

		protected override Rarity GetRarity()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return (Rarity)0;
		}

		protected override CardInfoStat[] GetStats()
		{
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: 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)
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Expected O, but got Unknown
			return (CardInfoStat[])(object)new CardInfoStat[1]
			{
				new CardInfoStat
				{
					positive = true,
					stat = "Effect",
					amount = "No",
					simepleAmount = (SimpleAmount)0
				}
			};
		}

		protected override CardThemeColorType GetTheme()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return (CardThemeColorType)7;
		}

		public override string GetModName()
		{
			return "RSC";
		}
	}
}
namespace RSCards.MonoBehaviors
{
	public class Hitscan_Mono : MonoBehaviour
	{
		private Player player;

		private GameObject trail;

		private GameObject bullet;

		private void OnDestroy()
		{
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: Expected O, but got Unknown
			trail.transform.SetPositionAndRotation(((Component)this).transform.position, ((Component)this).transform.rotation);
			ExtensionMethods.ExecuteAfterSeconds((MonoBehaviour)(object)RSCards.instance, 2f, (Action)([CompilerGenerated] () =>
			{
				Object.Destroy((Object)(object)trail);
			}));
		}

		private void Start()
		{
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Expected O, but got Unknown
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			player = ((Component)this).GetComponentInParent<Player>();
			trail = new GameObject("Hitscan_Trail", (Type[])(object)new Type[1] { typeof(TrailRenderer) });
			trail.transform.SetPositionAndRotation(((Component)this).transform.position, ((Component)this).transform.rotation);
			trail.GetComponent<TrailRenderer>().startWidth = 0.1f;
			trail.GetComponent<TrailRenderer>().endWidth = 0.1f;
			trail.GetComponent<TrailRenderer>().time = 1f;
			((Renderer)trail.GetComponent<TrailRenderer>()).sharedMaterial = RSCards.assets.LoadAsset<Material>("Material");
			GameModeManager.AddHook("RoundStart", (Func<IGameModeHandler, IEnumerator>)RoundStart);
		}

		[IteratorStateMachine(/*Could not decode attribute arguments.*/)]
		private IEnumerator RoundStart(IGameModeHandler gm)
		{
			player.data.weaponHandler.gun.reflects = -2147483548;
			yield break;
		}

		private void Update()
		{
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			trail.transform.SetPositionAndRotation(((Component)this).transform.position, ((Component)this).transform.rotation);
		}
	}
	public class Mortar_Mono : MonoBehaviour
	{
		public bool snap;

		public bool trigger;

		public float rotateSpeed = 1000f;

		private SpawnedAttack spawned;

		private MoveTransform move;

		private float startVelocity;

		private bool isOn;

		private ProjectileHit hit;

		private float c;

		private PhotonView view;

		private ChildRPC childRPC;

		private void OnDestroy()
		{
		}

		private void Start()
		{
			childRPC = ((Component)this).GetComponentInParent<ChildRPC>();
			view = ((Component)this).GetComponentInParent<PhotonView>();
			hit = ((Component)this).GetComponentInParent<ProjectileHit>();
			move = ((Component)this).GetComponentInParent<MoveTransform>();
			spawned = ((Component)this).GetComponentInParent<SpawnedAttack>();
			startVelocity = ((Vector3)(ref move.velocity)).magnitude;
			((Component)this).GetComponentInParent<SyncProjectile>().active = true;
		}

		private void Update()
		{
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_006b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0080: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: 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_00c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_00de: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e8: 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)
			//IL_014d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0152: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ab: 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_01d9: 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)
			try
			{
				if (!view.IsMine)
				{
					return;
				}
				Vector3 val = Vector3.zero;
				if (((PlayerActionSet)spawned.spawner.data.playerActions).Device != null)
				{
					val = spawned.spawner.data.input.aimDirection;
				}
				else
				{
					val = MainCam.instance.cam.ScreenToWorldPoint(Input.mousePosition) - ((Component)this).transform.position;
					val.z = 0f;
					((Vector3)(ref val)).Normalize();
				}
				trigger = spawned.spawner.data.weaponHandler.gun.ReadyAmount() < 0.01f;
				val += Vector3.Cross(Vector3.forward, val) * move.selectedSpread;
				c += TimeHandler.deltaTime;
				if (!trigger)
				{
					return;
				}
				if (snap)
				{
					if (spawned.spawner.data.block.blockedThisFrame)
					{
						move.velocity *= -1f;
						((Behaviour)this).enabled = false;
					}
				}
				else if (((Vector3)(ref val)).magnitude > 0.2f && hit.sinceReflect > 2f)
				{
					move.velocity = Vector3.RotateTowards(move.velocity, ((Vector3)(ref val)).normalized * startVelocity, rotateSpeed * TimeHandler.deltaTime, rotateSpeed * TimeHandler.deltaTime * 10f);
					if (c > 0.1f)
					{
						c = 0f;
					}
					if (!isOn)
					{
						MoveTransform obj = move;
						obj.simulateGravity++;
					}
					isOn = true;
				}
				else
				{
					if (isOn)
					{
						MoveTransform obj2 = move;
						obj2.simulateGravity--;
					}
					isOn = false;
				}
			}
			catch (Object)
			{
			}
		}
	}
	public class Repentence_Mono : MonoBehaviour
	{
		private void Start()
		{
			//IL_0016: 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)
			Player componentInParent = ((Component)this).GetComponentInParent<Player>();
			int num = 0;
			Enumerator<CardInfo> enumerator = componentInParent.data.currentCards.GetEnumerator();
			try
			{
				while (enumerator.MoveNext())
				{
					CardInfo current = enumerator.Current;
					if (current.cardName == "Repentence")
					{
						num++;
					}
				}
			}
			finally
			{
				((IDisposable)enumerator).Dispose();
			}
			if (num == 9)
			{
				Cards.instance.AddCardToPlayer(componentInParent, Cards.instance.GetCardWithName("Repen10ce"), false, "", 0f, 0f);
			}
		}
	}
	internal class Scythe : MonoBehaviour
	{
		public bool active = true;

		public float damage = 35f;

		private Player Player;

		private Dictionary<int, float> recent = new Dictionary<int, float>();

		private GameObject scythe;

		private void OnDestroy()
		{
			Object.Destroy((Object)(object)scythe);
		}

		private void Start()
		{
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			Player = ((Component)this).GetComponentInParent<Player>();
			scythe = Object.Instantiate<GameObject>(RSCards.assets.LoadAsset<GameObject>("Scythe"), ((Component)Player).transform);
			scythe.SetActive(true);
			scythe.GetComponent<SpriteRenderer>().color = Player.GetTeamColors().color;
		}

		public void DoHit()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_01df: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_0202: Unknown result type (might be due to invalid IL or missing references)
			//IL_020d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0218: Unknown result type (might be due to invalid IL or missing references)
			//IL_021d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0174: Unknown result type (might be due to invalid IL or missing references)
			//IL_0179: Unknown result type (might be due to invalid IL or missing references)
			//IL_0184: Unknown result type (might be due to invalid IL or missing references)
			//IL_0189: Unknown result type (might be due to invalid IL or missing references)
			//IL_018e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0193: Unknown result type (might be due to invalid IL or missing references)
			//IL_0197: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a1: Unknown result type (might be due to invalid IL or missing references)
			if (!Player.data.view.IsMine)
			{
				return;
			}
			float y = ((Component)this).transform.localScale.y;
			Collider2D[] array = Physics2D.OverlapCircleAll(Vector2.op_Implicit(scythe.transform.position), y);
			Collider2D[] array2 = array;
			foreach (Collider2D val in array2)
			{
				int[] array3 = Enumerable.ToArray<int>((IEnumerable<int>)(object)recent.Keys);
				int[] array4 = array3;
				foreach (int num in array4)
				{
					Dictionary<int, float> val2 = recent;
					int num2 = num;
					val2[num2] -= TimeHandler.deltaTime;
				}
				ProjectileHit componentInParent = ((Component)val).gameObject.GetComponentInParent<ProjectileHit>();
				Damagable component = ((Component)val).gameObject.GetComponent<Damagable>();
				HealthHandler component2 = ((Component)val).gameObject.GetComponent<HealthHandler>();
				Vector2 val3;
				if (Object.op_Implicit((Object)(object)component2))
				{
					int playerID = ((Player)ExtensionMethods.GetFieldValue((object)component2, "player")).playerID;
					if (playerID == Player.playerID || (recent.ContainsKey(playerID) && recent[playerID] > 0f))
					{
						continue;
					}
					SoundManager.Instance.PlayAtPosition(component2.soundBounce, ((Component)this).transform, ((Component)component).transform);
					val3 = Vector2.op_Implicit(((Component)component).transform.position) - Vector2.op_Implicit(((Component)this).transform.position);
					component2.CallTakeForce(((Vector2)(ref val3)).normalized * 2500f, (ForceMode2D)1, true, false, 0f);
					recent[playerID] = 0.5f;
				}
				if (Object.op_Implicit((Object)(object)component))
				{
					val3 = Vector2.op_Implicit(((Component)component).transform.position) - Vector2.op_Implicit(((Component)this).transform.position);
					component.CallTakeDamage(((Vector2)(ref val3)).normalized * damage, Vector2.op_Implicit(((Component)this).transform.position), ((Component)this).gameObject, Player, true);
				}
				if (Object.op_Implicit((Object)(object)componentInParent))
				{
					componentInParent.deathEvent.Invoke();
					Object.Destroy((Object)(object)((Component)componentInParent).gameObject);
				}
			}
		}

		public void UpdatePos(double angle, float rotation, float radius)
		{
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_0074: Unknown result type (might be due to invalid IL or missing references)
			double num = angle * Math.PI / 180.0;
			Vector3 localPosition = default(Vector3);
			((Vector3)(ref localPosition))..ctor((float)((double)radius * Math.Sin(num)), (float)((double)radius * Math.Cos(num)), 0f);
			Quaternion rotation2 = default(Quaternion);
			((Quaternion)(ref rotation2)).eulerAngles = new Vector3(0f, 0f, rotation);
			scythe.transform.localPosition = localPosition;
			scythe.transform.rotation = rotation2;
		}
	}
	public class TwinScythe_Mono : MonoBehaviour
	{
		private float radius = 2.5f;

		private double angle = 0.0;

		private float rotation = 0f;

		public int count = 0;

		private bool active = false;

		private List<Scythe> scythes = new List<Scythe>();

		private Player player;

		private void Start()
		{
			player = ((Component)this).GetComponentInParent<Player>();
			TwinScythe_Mono[] componentsInChildren = ((Component)player).GetComponentsInChildren<TwinScythe_Mono>();
			for (int i = 0; i < componentsInChildren.Length; i++)
			{
				if (!((Object)(object)componentsInChildren[i] == (Object)(object)this))
				{
					componentsInChildren[i].count += count;
					Object.Destroy((Object)(object)((Component)this).gameObject);
				}
			}
			GameModeManager.AddHook("PointStart", (Func<IGameModeHandler, IEnumerator>)PointStart);
			GameModeManager.AddHook("PointEnd", (Func<IGameModeHandler, IEnumerator>)PointEnd);
			GameModeManager.AddHook("BattleStart", (Func<IGameModeHandler, IEnumerator>)BattleStart);
		}

		private void Update()
		{
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: Unknown result type (might be due to invalid IL or missing references)
			radius = 2f;
			angle = (angle + (double)(200f * TimeHandler.deltaTime)) % 360.0;
			rotation = (rotation - 1200f * TimeHandler.deltaTime) % 360f;
			int num = 0;
			Enumerator<Scythe> enumerator = scythes.GetEnumerator();
			try
			{
				while (enumerator.MoveNext())
				{
					Scythe current = enumerator.Current;
					double num2 = angle + (double)(360 / Enumerable.Count<Scythe>((IEnumerable<Scythe>)(object)scythes) * num);
					current.UpdatePos(num2, rotation, radius);
					num++;
				}
			}
			finally
			{
				((IDisposable)enumerator).Dispose();
			}
		}

		private void FixedUpdate()
		{
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			if (!active)
			{
				return;
			}
			Enumerator<Scythe> enumerator = scythes.GetEnumerator();
			try
			{
				while (enumerator.MoveNext())
				{
					Scythe current = enumerator.Current;
					current.DoHit();
				}
			}
			finally
			{
				((IDisposable)enumerator).Dispose();
			}
		}

		public void UpdateCard()
		{
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Expected O, but got Unknown
			//IL_006c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
			int num = Math.Min(count, 4);
			if (Enumerable.Count<Scythe>((IEnumerable<Scythe>)(object)scythes) < num)
			{
				GameObject val = new GameObject("Scythe", (Type[])(object)new Type[1] { typeof(Scythe) });
				val.transform.SetParent(((Component)player).transform);
				((Component)player).transform.position = ((Component)player).transform.position;
				scythes.Add(val.GetComponent<Scythe>());
			}
			else if (Enumerable.Count<Scythe>((IEnumerable<Scythe>)(object)scythes) > num)
			{
				Object.Destroy((Object)(object)scythes[0]);
				scythes.Remove(scythes[0]);
			}
			Enumerator<Scythe> enumerator = scythes.GetEnumerator();
			try
			{
				while (enumerator.MoveNext())
				{
					Scythe current = enumerator.Current;
					current.damage = 27.5f + 27.5f * (float)count;
				}
			}
			finally
			{
				((IDisposable)enumerator).Dispose();
			}
		}

		[IteratorStateMachine(/*Could not decode attribute arguments.*/)]
		private IEnumerator BattleStart(IGameModeHandler gm)
		{
			active = true;
			yield break;
		}

		[IteratorStateMachine(/*Could not decode attribute arguments.*/)]
		private IEnumerator PointStart(IGameModeHandler gm)
		{
			rotation = 0f;
			angle = 0.0;
			yield break;
		}

		[IteratorStateMachine(/*Could not decode attribute arguments.*/)]
		private IEnumerator PointEnd(IGameModeHandler gm)
		{
			active = false;
			yield break;
		}
	}
}